From e4811d3ad70b5a2e6af47a621cbfdb9bc4691b25 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 20 Sep 2023 10:16:01 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Attorney?= =?UTF-8?q?Online/webAO@abf87b75f8a57e6de0ef7349f6577a0e1c39ce1b=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client.65b971f855eb09ebcb76.bundle.js | 3 --- client.65b971f855eb09ebcb76.bundle.js.map | 1 - client.da1f9aff6d4b8c471701.bundle.js | 3 +++ ...SE.txt => client.da1f9aff6d4b8c471701.bundle.js.LICENSE.txt | 0 client.da1f9aff6d4b8c471701.bundle.js.map | 1 + client.html | 2 +- dom.f4368b8b305de31e374e.bundle.js.map | 2 +- ui.858f8ece88fc793ad89c.bundle.js.map | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 client.65b971f855eb09ebcb76.bundle.js delete mode 100644 client.65b971f855eb09ebcb76.bundle.js.map create mode 100644 client.da1f9aff6d4b8c471701.bundle.js rename client.65b971f855eb09ebcb76.bundle.js.LICENSE.txt => client.da1f9aff6d4b8c471701.bundle.js.LICENSE.txt (100%) create mode 100644 client.da1f9aff6d4b8c471701.bundle.js.map diff --git a/client.65b971f855eb09ebcb76.bundle.js b/client.65b971f855eb09ebcb76.bundle.js deleted file mode 100644 index fa67f149..00000000 --- a/client.65b971f855eb09ebcb76.bundle.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see client.65b971f855eb09ebcb76.bundle.js.LICENSE.txt */ -!function(){"use strict";var e,t={7496:function(e,t,n){n.r(t),t.default=["Anime","birthday","Christmas","CountyCourt","CruiseCourt","default","DGSEnglishCourt","DGSJapanCourt","DualDestinies","EnglishCourt","gs4","GS4Night","HD","Khura'in","mlp","NewCourt","RuinedCourt","Sky","SpaceCourt","Themis","TouhouCourt","WitchTrialCourt","Zetta"]},9585:function(e,t,n){n.r(t),t.default=["Adrian","Apollo","April","Armstrong","Atmey","Butz","Diego","Edgeworth","Edgeworthw","Ema","Emaskye","Franny","Franziska","Gant","Gavin","Gavin K","Godot","Gregory","Grossberg","Gumshoe","Gumshoey","Hawk","Hobo_Phoenix","Ini","Judge","Judge's Bro","Klav","Klavier","Kristoph","Lana","Layton","Lotta","Luis","Maggey","Manfred","Marshall","Matt","Maya","Mia","Miles","Oldbag","Payne","Pearl","Phoenix","Valant","Vasquez","Wellington","Winston","Winstonpayne","Young Mia","Zak"]},5954:function(e,t,n){n.r(t),t.default=["1.png","2.png","3.png","4.png","5.png","6.png","empty.png","lawyerbadge.png"]},6246:function(e,t,n){n.r(t),t.default=["Announce The Truth (AA).opus","Announce The Truth (AJ).opus","Announce The Truth (JFA).opus","Announce The Truth (Miles).opus","Announce The Truth (T&T).opus","Confrontation ~ Presto 2009.opus","Crises of Fate.opus","Forgotten Legend.opus","Godot - The Fragrance of Dark Coffee.opus","Great Revival ~ Franziska von Karma.opus","Great Revival ~ Miles Edgeworth.opus","Hotline of Fate.opus","Interesting People.opus","Logic and Trick.opus","Luke Atmey ~ I Just Want Love.opus","Noisy People.opus","OBJECTION (AA).opus","Objection (AJ).opus","OBJECTION (JFA).opus","Objection (Miles).opus","OBJECTION (T&T).opus","Others ~ Guilty love.opus","Prelude (AA).opus","Prelude (AJ).opus","Prologue (AA).opus","Pursuit (AA) - variation.opus","Pursuit (AA).opus","Pursuit (AJ).opus","Pursuit (DS).opus","Pursuit (JFA) - variation.opus","Pursuit (JFA).opus","Pursuit (Miles).opus","Pursuit (T&T) - variation.opus","Pursuit (T&T).opus","Pursuit ~ I Want to Find the Truth (Orchestra).opus","Questioning AA (Allegro).opus","Questioning AA (Moderato).opus","Questioning AJ (Allegro).opus","Questioning AJ (Moderato).opus","Questioning JFA (Allegro).opus","Questioning JFA (Moderato).opus","Questioning T&T (Allegro).opus","Questioning T&T (Moderato).opus","Speak up Pup.opus","Suspense (AA).opus","The Great Truth Burglar.opus","Trial (AA).opus","Trial (AJ).opus","Trial (Miles).opus"]},8481:function(e,t,n){n.r(t),t.default="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="},3983:function(e,t,n){n.r(t),n.d(t,{changeSFXVolume:function(){return o},changeShoutVolume:function(){return a},changeTestimonyVolume:function(){return i}});var r=n(2557);function o(){(0,r.default)("sfxVolume",document.getElementById("client_sfxaudio").volume)}function i(){(0,r.default)("testimonyVolume",document.getElementById("client_testimonyaudio").volume)}function a(){(0,r.default)("shoutVolume",document.getElementById("client_shoutaudio").volume)}window.changeSFXVolume=o,window.changeTestimonyVolume=i,window.changeShoutVolume=a},3583:function(e,t,n){n.r(t),n(9275),n(7838),n(9701),n(853),n(1078),n(6208),n(5668);var r={section:/^\s*\[\s*([^\]]*)\s*\]\s*$/,param:/^\s*([\w.\-_]+)\s*=\s*(.*?)\s*$/,comment:/^\s*;.*$/},o=function(e){var t=0===e.length;return!r.comment.test(e)&&!t};t.default=function(e){var t,n={};return e.split(/\r\n|\r|\n/).filter(o).forEach((function(e){var o=r.param.test(e),i=r.section.test(e);if(o&&t){var a=e.match(r.param),c=a[1].toLowerCase(),u=a[2];n[t][c]=function(e,t){return"showname"===e?t:t.toLowerCase()}(c,u)}else if(i){var s=e.match(r.section)[1].toLowerCase();n[s]={},t=s}})),n}},7659:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),c=new M(r||[]);return a(i,"_invoke",{value:L(e,n,c)}),i}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var h="suspendedStart",v="suspendedYield",y="executing",m="completed",g={};function b(){}function w(){}function _(){}var x={};f(x,u,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(j([])));S&&S!==n&&i.call(S,u)&&(x=S);var T=_.prototype=b.prototype=Object.create(x);function C(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function n(o,a,c,u){var s=p(e[o],e,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,c,u)}),(function(e){n("throw",e,c,u)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return n("throw",e,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function L(t,n,r){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=I(c,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var s=p(t,n,r);if("normal"===s.type){if(o=r.done?m:v,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function I(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,I(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=p(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function j(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:j(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function c(e){i(a,r,o,c,u,"next",e)}function u(e){i(a,r,o,c,u,"throw",e)}c(void 0)}))}}function c(e){return u.apply(this,arguments)}function u(){return(u=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=new XMLHttpRequest;r.responseType="arraybuffer",r.addEventListener("error",(function(){var e=new Error("Request for ".concat(t," failed: ").concat(r.statusText));e.code=r.status,n(e)})),r.addEventListener("abort",(function(){var e=new Error("Request for ".concat(t," was aborted!"));e.code=r.status,n(e)})),r.addEventListener("load",(function(){if(r.status<200||r.status>=300){var o=new Error("Request for ".concat(t," failed with status code ").concat(r.status));o.code=r.status,n(o)}else e(r.response)})),r.open("GET",t,!0),r.send()})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}n.r(t),n.d(t,{request:function(){return s},requestBuffer:function(){return c}}),n(853),n(5054),n(5862),n(3973),n(6364),n(6632),n(1928),n(4883),n(5007),n(8995),n(2729),n(3694),n(4063),n(2031),n(2477),n(6908),n(1078),n(6208),n(4994),n(1879),n(199),n(8821);var s=function(){var e=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=new XMLHttpRequest;r.responseType="text",r.addEventListener("error",(function(){var e=new Error("Request for ".concat(t," failed: ").concat(r.statusText));e.code=r.status,n(e)})),r.addEventListener("abort",(function(){var e=new Error("Request for ".concat(t," was aborted!"));e.code=r.status,n(e)})),r.addEventListener("load",(function(){if(r.status<200||r.status>=300){var o=new Error("Request for ".concat(t," failed with status code ").concat(r.status));o.code=r.status,n(o)}else e(r.response)})),r.open("GET",t,!0),r.send()})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();t.default=s},8999:function(e,t,n){n.r(t),t.default=["aa","acww","dd","dgs","plvsaa","trilogy","future","legacy","ddlc","dr1","dr2","drv3","drae","p3","p4","p5","999","halla","homestuck","key","sonic","yakuza","yttd","whentheycry","n64zelda","papermario"]},1198:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),c=new M(r||[]);return a(i,"_invoke",{value:L(e,n,c)}),i}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var h="suspendedStart",v="suspendedYield",y="executing",m="completed",g={};function b(){}function w(){}function _(){}var x={};f(x,u,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(j([])));S&&S!==n&&i.call(S,u)&&(x=S);var T=_.prototype=b.prototype=Object.create(x);function C(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function n(o,a,c,u){var s=p(e[o],e,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,c,u)}),(function(e){n("throw",e,c,u)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return n("throw",e,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function L(t,n,r){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=I(c,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var s=p(t,n,r);if("normal"===s.type){if(o=r.done?m:v,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function I(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,I(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=p(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function j(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:j(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}n.r(t),n(853),n(5054),n(3973),n(6364),n(6632),n(1928),n(4883),n(5007),n(8995),n(2729),n(3694),n(4063),n(2031),n(2477),n(6908),n(1078),n(6208),n(4994),n(1879),n(199),n(8821);var a=function(){var e,t=(e=o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=new XMLHttpRequest;r.open("HEAD",t),r.onload=function(t){4===r.readyState&&(200===r.status?e(!0):e(!1))},r.onerror=function(t){e(!1)},r.send(null)})));case 1:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function c(e){i(a,r,o,c,u,"next",e)}function u(e){i(a,r,o,c,u,"throw",e)}c(void 0)}))});return function(e){return t.apply(this,arguments)}}();t.default=a},9980:function(e,t,n){n.r(t),n.d(t,{default:function(){return l}}),n(853),n(5054),n(3973),n(6364),n(6632),n(1928),n(4883),n(5007),n(8995),n(2729),n(3694),n(4063),n(2031),n(2477),n(6908),n(1078),n(6208),n(4994),n(1879),n(199),n(8821),n(3180),n(9627),n(1358),n(6887),n(7353),n(6366),n(2372),n(5056),n(3677),n(7355),n(8784),n(8554),n(2403),n(4312),n(3444),n(70),n(6798),n(8036),n(7578),n(9641),n(2298),n(7306),n(5480),n(4314),n(572);var r=(n(174),{".gif":function(e){for(var t=new Uint8Array(e),n=0,r=0;r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:j(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function u(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}var s=function(){var e,t=(e=c().mark((function e(t){var n,a,u,s,l,f;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0,a=[".gif",".webp",".apng"];case 2:if(!(n0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]=o+n?(o=c,[4,u(0)]):[3,3]):[3,4];case 2:i.sent(),i.label=3;case 3:return++a,[3,1];case 4:return[2,r]}}))}))}function d(e){e.then(void 0,(function(){}))}function p(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function h(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function v(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<>>32-t,e[1]<>>32-t]:(t-=32,[e[1]<>>32-t,e[0]<>>32-t])}function y(e,t){return 0==(t%=64)?e:t<32?[e[0]<>>32-t,e[1]<>>1]),e=m(e=h(e,[4283543511,3981806797]),[0,e[0]>>>1]),m(e=h(e,[3301882366,444984403]),[0,e[0]>>>1])}function b(e,t){t=t||0;var n,r=(e=e||"").length%16,o=e.length-r,i=[0,t],a=[0,t],c=[0,0],u=[0,0],s=[2277735313,289559509],l=[1291169091,658871167];for(n=0;n>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)}function w(e){return parseInt(e)}function _(e){return parseFloat(e)}function x(e,t){return"number"==typeof e&&isNaN(e)?t:e}function E(e){return e.reduce((function(e,t){return e+(t?1:0)}),0)}function S(e,t){if(void 0===t&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function T(e){return e&&"object"==typeof e&&"message"in e?e:{message:e}}function C(e){return"function"!=typeof e}function O(e,t,n){var r=Object.keys(e).filter((function(e){return!function(e,t){for(var n=0,r=e.length;n=4}function k(){var e=window,t=navigator;return E(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!I()}function A(){var e=window,t=navigator;return E(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===t.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function M(){var e=window,t=navigator;return E(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===t.vendor.indexOf("Apple"),"getStorageUpdates"in t,"WebKitMediaKeys"in e])>=4}function j(){var e=window;return E(["safari"in e,!("DeviceMotionEvent"in e),!("ongestureend"in e),!("standalone"in navigator)])>=3}function P(){var e,t,n=window;return E(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function B(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function N(){var e=A(),t=P();if(!e&&!t)return!1;var n=window;return E(["onorientationchange"in n,"orientation"in n,e&&!("SharedWorker"in n),t&&/android/i.test(navigator.appVersion)])>=2}function R(e){var t=new Error(e);return t.name=e,t}function F(e,t,n){var r,a,c;return void 0===n&&(n=50),o(this,void 0,void 0,(function(){var o,s;return i(this,(function(i){switch(i.label){case 0:o=document,i.label=1;case 1:return o.body?[3,3]:[4,u(n)];case 2:return i.sent(),[3,1];case 3:s=o.createElement("iframe"),i.label=4;case 4:return i.trys.push([4,,10,11]),[4,new Promise((function(e,n){var r=!1,i=function(){r=!0,e()};s.onload=i,s.onerror=function(e){r=!0,n(e)};var a=s.style;a.setProperty("display","block","important"),a.position="absolute",a.top="0",a.left="0",a.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",o.body.appendChild(s);var c=function(){var e,t;r||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?i():setTimeout(c,10))};c()}))];case 5:i.sent(),i.label=6;case 6:return(null===(a=null===(r=s.contentWindow)||void 0===r?void 0:r.document)||void 0===a?void 0:a.body)?[3,8]:[4,u(n)];case 7:return i.sent(),[3,6];case 8:return[4,e(s,s.contentWindow)];case 9:return[2,i.sent()];case 10:return null===(c=s.parentNode)||void 0===c||c.removeChild(s),[7];case 11:return[2]}}))}))}function V(e){for(var t=function(e){for(var t,n,r="Unexpected syntax '".concat(e,"'"),o=/^\s*([a-z-]*)(.*)$/i.exec(e),i=o[1]||void 0,a={},c=/([.:#][\w-]+|\[.+?\])/gi,u=function(e,t){a[e]=a[e]||[],a[e].push(t)};;){var s=c.exec(o[2]);if(!s)break;var l=s[0];switch(l[0]){case".":u("class",l.slice(1));break;case"#":u("id",l.slice(1));break;case"[":var f=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(l);if(!f)throw new Error(r);u(f[1],null!==(n=null!==(t=f[4])&&void 0!==t?t:f[5])&&void 0!==n?n:"");break;default:throw new Error(r)}}return[i,a]}(e),n=t[0],r=t[1],o=document.createElement(null!=n?n:"div"),i=0,a=Object.keys(r);i.6*n.length}))).sort(),[2,o]}var c}))}))},fontPreferences:function(){return void 0===e&&(e=4e3),F((function(t,n){var r=n.document,o=r.body,i=o.style;i.width="".concat(e,"px"),i.webkitTextSizeAdjust=i.textSizeAdjust="none",A()?o.style.zoom="".concat(1/n.devicePixelRatio):M()&&(o.style.zoom="reset");var c=r.createElement("div");return c.textContent=a([],Array(e/20<<0),!0).map((function(){return"word"})).join(" "),o.appendChild(c),function(e,t){for(var n={},r={},o=0,i=Object.keys(ie);o');var e},audio:function(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(M()&&!j()&&!function(){var e=window;return E(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;var n=new t(1,5e3,44100),r=n.createOscillator();r.type="triangle",r.frequency.value=1e4;var o=n.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,r.connect(o),o.connect(n.destination),r.start(0);var i=function(e){var t=function(){};return[new Promise((function(n,r){var o=!1,i=0,a=0;e.oncomplete=function(e){return n(e.renderedBuffer)};var c=function(){setTimeout((function(){return r(R("timeout"))}),Math.min(500,a+5e3-Date.now()))},u=function(){try{var t=e.startRendering();switch(s(t)&&d(t),e.state){case"running":a=Date.now(),o&&c();break;case"suspended":document.hidden||i++,o&&i>=3?r(R("suspended")):setTimeout(u,500)}}catch(e){r(e)}};u(),t=function(){o||(o=!0,a>0&&c())}})),t]}(n),a=i[0],c=i[1],u=a.then((function(e){return function(e){for(var t=0,n=0;n=3||n.push(t.languages);else if("string"==typeof t.languages){var o=t.languages;o&&n.push(o.split(","))}return n},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return x(_(navigator.deviceMemory),void 0)},screenResolution:function(){var e=screen,t=function(e){return x(w(e),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n},hardwareConcurrency:function(){return x(w(navigator.hardwareConcurrency),void 0)},timezone:function(){var e,t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){var n=(new t).resolvedOptions().timeZone;if(n)return n}var r,o=(r=(new Date).getFullYear(),-Math.max(_(new Date(r,0,1).getTimezoneOffset()),_(new Date(r,6,1).getTimezoneOffset())));return"UTC".concat(o>=0?"+":"").concat(Math.abs(o))},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!I()&&!k())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var e=navigator.platform;return"MacIntel"===e&&M()&&!j()?function(){if("iPad"===navigator.platform)return!0;var e=screen,t=e.width/e.height;return E(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){var e=navigator.plugins;if(e){for(var t=[],n=0;n=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(c,"/npm-monitoring"),!0),e.send()}catch(e){console.error(e)}}(),[4,fe(n)];case 1:return e.sent(),[2,de(O(ae,{debug:r},[]),r)]}}))}))}var he={load:pe,hashComponents:le,componentsToDebugString:se},ve=b},7676:function(e,t,n){var r=n(5277),o=n(8768),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not a function")}},3327:function(e,t,n){var r=n(1536),o=n(8768),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not a constructor")}},5017:function(e,t,n){var r=n(5277),o=String,i=TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw i("Can't set "+o(e)+" as a prototype")}},6677:function(e,t,n){var r=n(2280),o=n(1569),i=n(6385).f,a=r("unscopables"),c=Array.prototype;void 0===c[a]&&i(c,a,{configurable:!0,value:o(null)}),e.exports=function(e){c[a][e]=!0}},3350:function(e,t,n){var r=n(1140).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},9519:function(e,t,n){var r=n(2010),o=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw o("Incorrect invocation")}},3875:function(e,t,n){var r=n(2786),o=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not an object")}},925:function(e){e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},2089:function(e,t,n){var r,o,i,a=n(925),c=n(7493),u=n(8363),s=n(5277),l=n(2786),f=n(4792),d=n(6994),p=n(8768),h=n(5899),v=n(403),y=n(3600),m=n(2010),g=n(2654),b=n(2412),w=n(2280),_=n(4524),x=n(821),E=x.enforce,S=x.get,T=u.Int8Array,C=T&&T.prototype,O=u.Uint8ClampedArray,L=O&&O.prototype,I=T&&g(T),k=C&&g(C),A=Object.prototype,M=u.TypeError,j=w("toStringTag"),P=_("TYPED_ARRAY_TAG"),B="TypedArrayConstructor",N=a&&!!b&&"Opera"!==d(u.opera),R=!1,F={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},V={BigInt64Array:8,BigUint64Array:8},H=function(e){var t=g(e);if(l(t)){var n=S(t);return n&&f(n,B)?n[B]:H(t)}},D=function(e){if(!l(e))return!1;var t=d(e);return f(F,t)||f(V,t)};for(r in F)(i=(o=u[r])&&o.prototype)?E(i)[B]=o:N=!1;for(r in V)(i=(o=u[r])&&o.prototype)&&(E(i)[B]=o);if((!N||!s(I)||I===Function.prototype)&&(I=function(){throw M("Incorrect invocation")},N))for(r in F)u[r]&&b(u[r],I);if((!N||!k||k===A)&&(k=I.prototype,N))for(r in F)u[r]&&b(u[r].prototype,k);if(N&&g(L)!==k&&b(L,k),c&&!f(k,j))for(r in R=!0,y(k,j,{configurable:!0,get:function(){return l(this)?this[P]:void 0}}),F)u[r]&&h(u[r],P,r);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:N,TYPED_ARRAY_TAG:R&&P,aTypedArray:function(e){if(D(e))return e;throw M("Target is not a typed array")},aTypedArrayConstructor:function(e){if(s(e)&&(!b||m(I,e)))return e;throw M(p(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(c){if(n)for(var o in F){var i=u[o];if(i&&f(i.prototype,e))try{delete i.prototype[e]}catch(n){try{i.prototype[e]=t}catch(e){}}}k[e]&&!n||v(k,e,n?t:N&&C[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,o;if(c){if(b){if(n)for(r in F)if((o=u[r])&&f(o,e))try{delete o[e]}catch(e){}if(I[e]&&!n)return;try{return v(I,e,n?t:N&&I[e]||t)}catch(e){}}for(r in F)!(o=u[r])||o[e]&&!n||v(o,e,t)}},getTypedArrayConstructor:H,isView:function(e){if(!l(e))return!1;var t=d(e);return"DataView"===t||f(F,t)||f(V,t)},isTypedArray:D,TypedArray:I,TypedArrayPrototype:k}},638:function(e,t,n){var r=n(8363),o=n(8697),i=n(7493),a=n(925),c=n(5316),u=n(5899),s=n(3600),l=n(3357),f=n(9044),d=n(9519),p=n(4229),h=n(5108),v=n(7302),y=n(5489),m=n(2654),g=n(2412),b=n(7994).f,w=n(5522),_=n(8990),x=n(878),E=n(821),S=c.PROPER,T=c.CONFIGURABLE,C="ArrayBuffer",O="DataView",L="prototype",I="Wrong index",k=E.getterFor(C),A=E.getterFor(O),M=E.set,j=r[C],P=j,B=P&&P[L],N=r[O],R=N&&N[L],F=Object.prototype,V=r.Array,H=r.RangeError,D=o(w),G=o([].reverse),W=y.pack,Z=y.unpack,U=function(e){return[255&e]},Y=function(e){return[255&e,e>>8&255]},X=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},J=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},z=function(e){return W(e,23,4)},K=function(e){return W(e,52,8)},Q=function(e,t,n){s(e[L],t,{configurable:!0,get:function(){return n(this)[t]}})},q=function(e,t,n,r){var o=A(e),i=v(n),a=!!r;if(i+t>o.byteLength)throw H(I);var c=o.bytes,u=i+o.byteOffset,s=_(c,u,u+t);return a?s:G(s)},$=function(e,t,n,r,o,i){var a=A(e),c=v(n),u=r(+o),s=!!i;if(c+t>a.byteLength)throw H(I);for(var l=a.bytes,f=c+a.byteOffset,d=0;dre;)(te=ne[re++])in P||u(P,te,j[te]);B.constructor=P}g&&m(R)!==F&&g(R,F);var oe=new N(new P(2)),ie=o(R.setInt8);oe.setInt8(0,2147483648),oe.setInt8(1,2147483649),!oe.getInt8(0)&&oe.getInt8(1)||l(R,{setInt8:function(e,t){ie(this,e,t<<24>>24)},setUint8:function(e,t){ie(this,e,t<<24>>24)}},{unsafe:!0})}else B=(P=function(e){d(this,B);var t=v(e);M(this,{type:C,bytes:D(V(t),0),byteLength:t}),i||(this.byteLength=t,this.detached=!1)})[L],R=(N=function(e,t,n){d(this,R),d(e,B);var r=k(e),o=r.byteLength,a=p(t);if(a<0||a>o)throw H("Wrong offset");if(a+(n=void 0===n?o-a:h(n))>o)throw H("Wrong length");M(this,{type:O,buffer:e,byteLength:n,byteOffset:a,bytes:r.bytes}),i||(this.buffer=e,this.byteLength=n,this.byteOffset=a)})[L],i&&(Q(P,"byteLength",k),Q(N,"buffer",A),Q(N,"byteLength",A),Q(N,"byteOffset",A)),l(R,{getInt8:function(e){return q(this,1,e)[0]<<24>>24},getUint8:function(e){return q(this,1,e)[0]},getInt16:function(e){var t=q(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=q(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return J(q(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return J(q(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return Z(q(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return Z(q(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){$(this,1,e,U,t)},setUint8:function(e,t){$(this,1,e,U,t)},setInt16:function(e,t){$(this,2,e,Y,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){$(this,2,e,Y,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){$(this,4,e,X,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){$(this,4,e,X,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){$(this,4,e,z,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){$(this,8,e,K,t,arguments.length>2&&arguments[2])}});x(P,C),x(N,O),e.exports={ArrayBuffer:P,DataView:N}},6759:function(e,t,n){var r=n(744),o=n(2565),i=n(7046),a=n(3731),c=Math.min;e.exports=[].copyWithin||function(e,t){var n=r(this),u=i(n),s=o(e,u),l=o(t,u),f=arguments.length>2?arguments[2]:void 0,d=c((void 0===f?u:o(f,u))-l,u-s),p=1;for(l0;)l in n?n[s]=n[l]:a(n,s),s+=p,l+=p;return n}},5522:function(e,t,n){var r=n(744),o=n(2565),i=n(7046);e.exports=function(e){for(var t=r(this),n=i(t),a=arguments.length,c=o(a>1?arguments[1]:void 0,n),u=a>2?arguments[2]:void 0,s=void 0===u?n:o(u,n);s>c;)t[c++]=e;return t}},379:function(e,t,n){var r=n(8671).forEach,o=n(4324)("forEach");e.exports=o?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},5626:function(e,t,n){var r=n(7046);e.exports=function(e,t){for(var n=0,o=r(t),i=new e(o);o>n;)i[n]=t[n++];return i}},7190:function(e,t,n){var r=n(9580),o=n(2565),i=n(7046),a=function(e){return function(t,n,a){var c,u=r(t),s=i(u),l=o(a,s);if(e&&n!=n){for(;s>l;)if((c=u[l++])!=c)return!0}else for(;s>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},8671:function(e,t,n){var r=n(8166),o=n(8697),i=n(8609),a=n(744),c=n(7046),u=n(150),s=o([].push),l=function(e){var t=1===e,n=2===e,o=3===e,l=4===e,f=6===e,d=7===e,p=5===e||f;return function(h,v,y,m){for(var g,b,w=a(h),_=i(w),x=r(v,y),E=c(_),S=0,T=m||u,C=t?T(h,E):n||d?T(h,0):void 0;E>S;S++)if((p||S in _)&&(b=x(g=_[S],S,w),e))if(t)C[S]=b;else if(b)switch(e){case 3:return!0;case 5:return g;case 6:return S;case 2:s(C,g)}else switch(e){case 4:return!1;case 7:s(C,g)}return f?-1:o||l?l:C}};e.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)}},7837:function(e,t,n){var r=n(3530),o=n(9580),i=n(4229),a=n(7046),c=n(4324),u=Math.min,s=[].lastIndexOf,l=!!s&&1/[1].lastIndexOf(1,-0)<0,f=c("lastIndexOf"),d=l||!f;e.exports=d?function(e){if(l)return r(s,this,arguments)||0;var t=o(this),n=a(t),c=n-1;for(arguments.length>1&&(c=u(c,i(arguments[1]))),c<0&&(c=n+c);c>=0;c--)if(c in t&&t[c]===e)return c||0;return-1}:s},2091:function(e,t,n){var r=n(9044),o=n(2280),i=n(1197),a=o("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},4324:function(e,t,n){var r=n(9044);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},6596:function(e,t,n){var r=n(7676),o=n(744),i=n(8609),a=n(7046),c=TypeError,u=function(e){return function(t,n,u,s){r(n);var l=o(t),f=i(l),d=a(l),p=e?d-1:0,h=e?-1:1;if(u<2)for(;;){if(p in f){s=f[p],p+=h;break}if(p+=h,e?p<0:d<=p)throw c("Reduce of empty array with no initial value")}for(;e?p>=0:d>p;p+=h)p in f&&(s=n(s,f[p],p,l));return s}};e.exports={left:u(!1),right:u(!0)}},8990:function(e,t,n){var r=n(2565),o=n(7046),i=n(5039),a=Array,c=Math.max;e.exports=function(e,t,n){for(var u=o(e),s=r(t,u),l=r(void 0===n?u:n,u),f=a(c(l-s,0)),d=0;s0;)e[r]=e[--r];r!==i++&&(e[r]=n)}return e},c=function(e,t,n,r){for(var o=t.length,i=n.length,a=0,c=0;a9007199254740991)throw t("Maximum allowed index exceeded");return e}},2848:function(e){e.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}},9189:function(e,t,n){var r=n(2750)("span").classList,o=r&&r.constructor&&r.constructor.prototype;e.exports=o===Object.prototype?void 0:o},4631:function(e,t,n){var r=n(2647).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},7923:function(e,t,n){var r=n(9756),o=n(3921);e.exports=!r&&!o&&"object"==typeof window&&"object"==typeof document},9756:function(e){e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},442:function(e,t,n){var r=n(2647);e.exports=/MSIE|Trident/.test(r)},5357:function(e,t,n){var r=n(2647);e.exports=/ipad|iphone|ipod/i.test(r)&&"undefined"!=typeof Pebble},3121:function(e,t,n){var r=n(2647);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},3921:function(e,t,n){var r=n(8363),o=n(9159);e.exports="process"===o(r.process)},4402:function(e,t,n){var r=n(2647);e.exports=/web0s(?!.*chrome)/i.test(r)},2647:function(e){e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},1197:function(e,t,n){var r,o,i=n(8363),a=n(2647),c=i.process,u=i.Deno,s=c&&c.versions||u&&u.version,l=s&&s.v8;l&&(o=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},6929:function(e,t,n){var r=n(2647).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},8869:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9882:function(e,t,n){var r=n(8363),o=n(6012).f,i=n(5899),a=n(403),c=n(2359),u=n(3870),s=n(6291);e.exports=function(e,t){var n,l,f,d,p,h=e.target,v=e.global,y=e.stat;if(n=v?r:y?r[h]||c(h,{}):(r[h]||{}).prototype)for(l in t){if(d=t[l],f=e.dontCallGetSet?(p=o(n,l))&&p.value:n[l],!s(v?l:h+(y?".":"#")+l,e.forced)&&void 0!==f){if(typeof d==typeof f)continue;u(d,f)}(e.sham||f&&f.sham)&&i(d,"sham",!0),a(n,l,d,e)}}},9044:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},1492:function(e,t,n){n(9275);var r=n(5785),o=n(403),i=n(9749),a=n(9044),c=n(2280),u=n(5899),s=c("species"),l=RegExp.prototype;e.exports=function(e,t,n,f){var d=c(e),p=!a((function(){var t={};return t[d]=function(){return 7},7!==""[e](t)})),h=p&&!a((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[s]=function(){return n},n.flags="",n[d]=/./[d]),n.exec=function(){return t=!0,null},n[d](""),!t}));if(!p||!h||n){var v=r(/./[d]),y=t(d,""[e],(function(e,t,n,o,a){var c=r(e),u=t.exec;return u===i||u===l.exec?p&&!a?{done:!0,value:v(t,n,o)}:{done:!0,value:c(n,t,o)}:{done:!1}}));o(String.prototype,e,y[0]),o(l,d,y[1])}f&&u(l[d],"sham",!0)}},3530:function(e,t,n){var r=n(3996),o=Function.prototype,i=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(i):function(){return a.apply(i,arguments)})},8166:function(e,t,n){var r=n(5785),o=n(7676),i=n(3996),a=r(r.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?a(e,t):function(){return e.apply(t,arguments)}}},3996:function(e,t,n){var r=n(9044);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},9611:function(e,t,n){var r=n(3996),o=Function.prototype.call;e.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},5316:function(e,t,n){var r=n(7493),o=n(4792),i=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,c=o(i,"name"),u=c&&"something"===function(){}.name,s=c&&(!r||r&&a(i,"name").configurable);e.exports={EXISTS:c,PROPER:u,CONFIGURABLE:s}},2575:function(e,t,n){var r=n(8697),o=n(7676);e.exports=function(e,t,n){try{return r(o(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},5785:function(e,t,n){var r=n(9159),o=n(8697);e.exports=function(e){if("Function"===r(e))return o(e)}},8697:function(e,t,n){var r=n(3996),o=Function.prototype,i=o.call,a=r&&o.bind.bind(i,i);e.exports=r?a:function(e){return function(){return i.apply(e,arguments)}}},2773:function(e,t,n){var r=n(8363),o=n(5277);e.exports=function(e,t){return arguments.length<2?(n=r[e],o(n)?n:void 0):r[e]&&r[e][t];var n}},7193:function(e,t,n){var r=n(6994),o=n(7219),i=n(9903),a=n(4818),c=n(2280)("iterator");e.exports=function(e){if(!i(e))return o(e,c)||o(e,"@@iterator")||a[r(e)]}},1805:function(e,t,n){var r=n(9611),o=n(7676),i=n(3875),a=n(8768),c=n(7193),u=TypeError;e.exports=function(e,t){var n=arguments.length<2?c(e):t;if(o(n))return i(r(n,e));throw u(a(e)+" is not iterable")}},6590:function(e,t,n){var r=n(8697),o=n(1982),i=n(5277),a=n(9159),c=n(8967),u=r([].push);e.exports=function(e){if(i(e))return e;if(o(e)){for(var t=e.length,n=[],r=0;r.5||.5===n&&t%2!=0?t+r(e):t};e.exports={pack:function(e,t,n){var r,o,d,p=i(n),h=8*n-t-1,v=(1<>1,m=23===t?c(2,-24)-c(2,-77):0,g=e<0||0===e&&1/e<0?1:0,b=0;for((e=a(e))!=e||e===1/0?(o=e!=e?1:0,r=v):(r=u(s(e)/l),e*(d=c(2,-r))<1&&(r--,d*=2),(e+=r+y>=1?m/d:m*c(2,1-y))*d>=2&&(r++,d/=2),r+y>=v?(o=0,r=v):r+y>=1?(o=f((e*d-1)*c(2,t)),r+=y):(o=f(e*c(2,y-1)*c(2,t)),r=0));t>=8;)p[b++]=255&o,o/=256,t-=8;for(r=r<0;)p[b++]=255&r,r/=256,h-=8;return p[--b]|=128*g,p},unpack:function(e,t){var n,r=e.length,o=8*r-t-1,i=(1<>1,u=o-7,s=r-1,l=e[s--],f=127&l;for(l>>=7;u>0;)f=256*f+e[s--],u-=8;for(n=f&(1<<-u)-1,f>>=-u,u+=t;u>0;)n=256*n+e[s--],u-=8;if(0===f)f=1-a;else{if(f===i)return n?NaN:l?-1/0:1/0;n+=c(2,t),f-=a}return(l?-1:1)*n*c(2,f-t)}}},8609:function(e,t,n){var r=n(8697),o=n(9044),i=n(9159),a=Object,c=r("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===i(e)?c(e,""):a(e)}:a},9250:function(e,t,n){var r=n(5277),o=n(2786),i=n(2412);e.exports=function(e,t,n){var a,c;return i&&r(a=t.constructor)&&a!==n&&o(c=a.prototype)&&c!==n.prototype&&i(e,c),e}},6429:function(e,t,n){var r=n(8697),o=n(5277),i=n(9415),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},821:function(e,t,n){var r,o,i,a=n(2512),c=n(8363),u=n(2786),s=n(5899),l=n(4792),f=n(9415),d=n(466),p=n(7505),h="Object already initialized",v=c.TypeError,y=c.WeakMap;if(a||f.state){var m=f.state||(f.state=new y);m.get=m.get,m.has=m.has,m.set=m.set,r=function(e,t){if(m.has(e))throw v(h);return t.facade=e,m.set(e,t),t},o=function(e){return m.get(e)||{}},i=function(e){return m.has(e)}}else{var g=d("state");p[g]=!0,r=function(e,t){if(l(e,g))throw v(h);return t.facade=e,s(e,g,t),t},o=function(e){return l(e,g)?e[g]:{}},i=function(e){return l(e,g)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!u(t)||(n=o(t)).type!==e)throw v("Incompatible receiver, "+e+" required");return n}}}},8089:function(e,t,n){var r=n(2280),o=n(4818),i=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},1982:function(e,t,n){var r=n(9159);e.exports=Array.isArray||function(e){return"Array"===r(e)}},217:function(e,t,n){var r=n(6994);e.exports=function(e){var t=r(e);return"BigInt64Array"===t||"BigUint64Array"===t}},5277:function(e,t,n){var r=n(3966),o=r.all;e.exports=r.IS_HTMLDDA?function(e){return"function"==typeof e||e===o}:function(e){return"function"==typeof e}},1536:function(e,t,n){var r=n(8697),o=n(9044),i=n(5277),a=n(6994),c=n(2773),u=n(6429),s=function(){},l=[],f=c("Reflect","construct"),d=/^\s*(?:class|function)\b/,p=r(d.exec),h=!d.exec(s),v=function(e){if(!i(e))return!1;try{return f(s,l,e),!0}catch(e){return!1}},y=function(e){if(!i(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!p(d,u(e))}catch(e){return!0}};y.sham=!0,e.exports=!f||o((function(){var e;return v(v.call)||!v(Object)||!v((function(){e=!0}))||e}))?y:v},6291:function(e,t,n){var r=n(9044),o=n(5277),i=/#|\.prototype\./,a=function(e,t){var n=u[c(e)];return n===l||n!==s&&(o(t)?r(t):!!t)},c=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},u=a.data={},s=a.NATIVE="N",l=a.POLYFILL="P";e.exports=a},7507:function(e,t,n){var r=n(2786),o=Math.floor;e.exports=Number.isInteger||function(e){return!r(e)&&isFinite(e)&&o(e)===e}},9903:function(e){e.exports=function(e){return null==e}},2786:function(e,t,n){var r=n(5277),o=n(3966),i=o.all;e.exports=o.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:r(e)||e===i}:function(e){return"object"==typeof e?null!==e:r(e)}},1178:function(e){e.exports=!1},2622:function(e,t,n){var r=n(2786),o=n(9159),i=n(2280)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"===o(e))}},6681:function(e,t,n){var r=n(2773),o=n(5277),i=n(2010),a=n(189),c=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&i(t.prototype,c(e))}},5166:function(e,t,n){var r=n(8166),o=n(9611),i=n(3875),a=n(8768),c=n(8089),u=n(7046),s=n(2010),l=n(1805),f=n(7193),d=n(8744),p=TypeError,h=function(e,t){this.stopped=e,this.result=t},v=h.prototype;e.exports=function(e,t,n){var y,m,g,b,w,_,x,E=n&&n.that,S=!(!n||!n.AS_ENTRIES),T=!(!n||!n.IS_RECORD),C=!(!n||!n.IS_ITERATOR),O=!(!n||!n.INTERRUPTED),L=r(t,E),I=function(e){return y&&d(y,"normal",e),new h(!0,e)},k=function(e){return S?(i(e),O?L(e[0],e[1],I):L(e[0],e[1])):O?L(e,I):L(e)};if(T)y=e.iterator;else if(C)y=e;else{if(!(m=f(e)))throw p(a(e)+" is not iterable");if(c(m)){for(g=0,b=u(e);b>g;g++)if((w=k(e[g]))&&s(v,w))return w;return new h(!1)}y=l(e,m)}for(_=T?e.next:y.next;!(x=o(_,y)).done;){try{w=k(x.value)}catch(e){d(y,"throw",e)}if("object"==typeof w&&w&&s(v,w))return w}return new h(!1)}},8744:function(e,t,n){var r=n(9611),o=n(3875),i=n(7219);e.exports=function(e,t,n){var a,c;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){c=!0,a=e}if("throw"===t)throw n;if(c)throw a;return o(a),n}},9952:function(e,t,n){var r=n(7022).IteratorPrototype,o=n(1569),i=n(9199),a=n(878),c=n(4818),u=function(){return this};e.exports=function(e,t,n,s){var l=t+" Iterator";return e.prototype=o(r,{next:i(+!s,n)}),a(e,l,!1,!0),c[l]=u,e}},8150:function(e,t,n){var r=n(9882),o=n(9611),i=n(1178),a=n(5316),c=n(5277),u=n(9952),s=n(2654),l=n(2412),f=n(878),d=n(5899),p=n(403),h=n(2280),v=n(4818),y=n(7022),m=a.PROPER,g=a.CONFIGURABLE,b=y.IteratorPrototype,w=y.BUGGY_SAFARI_ITERATORS,_=h("iterator"),x="keys",E="values",S="entries",T=function(){return this};e.exports=function(e,t,n,a,h,y,C){u(n,t,a);var O,L,I,k=function(e){if(e===h&&B)return B;if(!w&&e&&e in j)return j[e];switch(e){case x:case E:case S:return function(){return new n(this,e)}}return function(){return new n(this)}},A=t+" Iterator",M=!1,j=e.prototype,P=j[_]||j["@@iterator"]||h&&j[h],B=!w&&P||k(h),N="Array"===t&&j.entries||P;if(N&&(O=s(N.call(new e)))!==Object.prototype&&O.next&&(i||s(O)===b||(l?l(O,b):c(O[_])||p(O,_,T)),f(O,A,!0,!0),i&&(v[A]=T)),m&&h===E&&P&&P.name!==E&&(!i&&g?d(j,"name",E):(M=!0,B=function(){return o(P,this)})),h)if(L={values:k(E),keys:y?B:k(x),entries:k(S)},C)for(I in L)(w||M||!(I in j))&&p(j,I,L[I]);else r({target:t,proto:!0,forced:w||M},L);return i&&!C||j[_]===B||p(j,_,B,{name:h}),v[t]=B,L}},7022:function(e,t,n){var r,o,i,a=n(9044),c=n(5277),u=n(2786),s=n(1569),l=n(2654),f=n(403),d=n(2280),p=n(1178),h=d("iterator"),v=!1;[].keys&&("next"in(i=[].keys())?(o=l(l(i)))!==Object.prototype&&(r=o):v=!0),!u(r)||a((function(){var e={};return r[h].call(e)!==e}))?r={}:p&&(r=s(r)),c(r[h])||f(r,h,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:v}},4818:function(e){e.exports={}},7046:function(e,t,n){var r=n(5108);e.exports=function(e){return r(e.length)}},833:function(e,t,n){var r=n(8697),o=n(9044),i=n(5277),a=n(4792),c=n(7493),u=n(5316).CONFIGURABLE,s=n(6429),l=n(821),f=l.enforce,d=l.get,p=String,h=Object.defineProperty,v=r("".slice),y=r("".replace),m=r([].join),g=c&&!o((function(){return 8!==h((function(){}),"length",{value:8}).length})),b=String(String).split("String"),w=e.exports=function(e,t,n){"Symbol("===v(p(t),0,7)&&(t="["+y(p(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!a(e,"name")||u&&e.name!==t)&&(c?h(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&a(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?c&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=f(e);return a(r,"source")||(r.source=m(b,"string"==typeof t?t:"")),e};Function.prototype.toString=w((function(){return i(this)&&d(this).source||s(this)}),"toString")},3935:function(e){e.exports=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1}},8300:function(e){var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},1800:function(e,t,n){var r,o,i,a,c,u=n(8363),s=n(8166),l=n(6012).f,f=n(4643).set,d=n(2423),p=n(3121),h=n(5357),v=n(4402),y=n(3921),m=u.MutationObserver||u.WebKitMutationObserver,g=u.document,b=u.process,w=u.Promise,_=l(u,"queueMicrotask"),x=_&&_.value;if(!x){var E=new d,S=function(){var e,t;for(y&&(e=b.domain)&&e.exit();t=E.get();)try{t()}catch(e){throw E.head&&r(),e}e&&e.enter()};p||y||v||!m||!g?!h&&w&&w.resolve?((a=w.resolve(void 0)).constructor=w,c=s(a.then,a),r=function(){c(S)}):y?r=function(){b.nextTick(S)}:(f=s(f,u),r=function(){f(S)}):(o=!0,i=g.createTextNode(""),new m(S).observe(i,{characterData:!0}),r=function(){i.data=o=!o}),x=function(e){E.head||r(),E.add(e)}}e.exports=x},9269:function(e,t,n){var r=n(7676),o=TypeError,i=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw o("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new i(e)}},1569:function(e,t,n){var r,o=n(3875),i=n(7840),a=n(8869),c=n(7505),u=n(7055),s=n(2750),l=n(466),f="prototype",d="script",p=l("IE_PROTO"),h=function(){},v=function(e){return"<"+d+">"+e+""},y=function(e){e.write(v("")),e.close();var t=e.parentWindow.Object;return e=null,t},m=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;m="undefined"!=typeof document?document.domain&&r?y(r):(t=s("iframe"),n="java"+d+":",t.style.display="none",u.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(v("document.F=Object")),e.close(),e.F):y(r);for(var o=a.length;o--;)delete m[f][a[o]];return m()};c[p]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h[f]=o(e),n=new h,h[f]=null,n[p]=e):n=m(),void 0===t?n:i.f(n,t)}},7840:function(e,t,n){var r=n(7493),o=n(1010),i=n(6385),a=n(3875),c=n(9580),u=n(667);t.f=r&&!o?Object.defineProperties:function(e,t){a(e);for(var n,r=c(t),o=u(t),s=o.length,l=0;s>l;)i.f(e,n=o[l++],r[n]);return e}},6385:function(e,t,n){var r=n(7493),o=n(7548),i=n(1010),a=n(3875),c=n(383),u=TypeError,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",d="configurable",p="writable";t.f=r?i?function(e,t,n){if(a(e),t=c(t),a(n),"function"==typeof e&&"prototype"===t&&"value"in n&&p in n&&!n[p]){var r=l(e,t);r&&r[p]&&(e[t]=n.value,n={configurable:d in n?n[d]:r[d],enumerable:f in n?n[f]:r[f],writable:!1})}return s(e,t,n)}:s:function(e,t,n){if(a(e),t=c(t),a(n),o)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw u("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},6012:function(e,t,n){var r=n(7493),o=n(9611),i=n(1513),a=n(9199),c=n(9580),u=n(383),s=n(4792),l=n(7548),f=Object.getOwnPropertyDescriptor;t.f=r?f:function(e,t){if(e=c(e),t=u(t),l)try{return f(e,t)}catch(e){}if(s(e,t))return a(!o(i.f,e,t),e[t])}},4938:function(e,t,n){var r=n(9159),o=n(9580),i=n(7994).f,a=n(8990),c="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return c&&"Window"===r(e)?function(e){try{return i(e)}catch(e){return a(c)}}(e):i(o(e))}},7994:function(e,t,n){var r=n(8794),o=n(8869).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},9612:function(e,t){t.f=Object.getOwnPropertySymbols},2654:function(e,t,n){var r=n(4792),o=n(5277),i=n(744),a=n(466),c=n(5115),u=a("IE_PROTO"),s=Object,l=s.prototype;e.exports=c?s.getPrototypeOf:function(e){var t=i(e);if(r(t,u))return t[u];var n=t.constructor;return o(n)&&t instanceof n?n.prototype:t instanceof s?l:null}},2010:function(e,t,n){var r=n(8697);e.exports=r({}.isPrototypeOf)},8794:function(e,t,n){var r=n(8697),o=n(4792),i=n(9580),a=n(7190).indexOf,c=n(7505),u=r([].push);e.exports=function(e,t){var n,r=i(e),s=0,l=[];for(n in r)!o(c,n)&&o(r,n)&&u(l,n);for(;t.length>s;)o(r,n=t[s++])&&(~a(l,n)||u(l,n));return l}},667:function(e,t,n){var r=n(8794),o=n(8869);e.exports=Object.keys||function(e){return r(e,o)}},1513:function(e,t){var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},2412:function(e,t,n){var r=n(2575),o=n(3875),i=n(5017);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return o(n),i(r),t?e(n,r):n.__proto__=r,n}}():void 0)},6699:function(e,t,n){var r=n(7301),o=n(6994);e.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},7141:function(e,t,n){var r=n(9611),o=n(5277),i=n(2786),a=TypeError;e.exports=function(e,t){var n,c;if("string"===t&&o(n=e.toString)&&!i(c=r(n,e)))return c;if(o(n=e.valueOf)&&!i(c=r(n,e)))return c;if("string"!==t&&o(n=e.toString)&&!i(c=r(n,e)))return c;throw a("Can't convert object to primitive value")}},1561:function(e,t,n){var r=n(2773),o=n(8697),i=n(7994),a=n(9612),c=n(3875),u=o([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(c(e)),n=a.f;return n?u(t,n(e)):t}},7290:function(e,t,n){var r=n(8363);e.exports=r},4443:function(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},5182:function(e,t,n){var r=n(8363),o=n(5988),i=n(5277),a=n(6291),c=n(6429),u=n(2280),s=n(7923),l=n(9756),f=n(1178),d=n(1197),p=o&&o.prototype,h=u("species"),v=!1,y=i(r.PromiseRejectionEvent),m=a("Promise",(function(){var e=c(o),t=e!==String(o);if(!t&&66===d)return!0;if(f&&(!p.catch||!p.finally))return!0;if(!d||d<51||!/native code/.test(e)){var n=new o((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[h]=r,!(v=n.then((function(){}))instanceof r))return!0}return!t&&(s||l)&&!y}));e.exports={CONSTRUCTOR:m,REJECTION_EVENT:y,SUBCLASSING:v}},5988:function(e,t,n){var r=n(8363);e.exports=r.Promise},1621:function(e,t,n){var r=n(3875),o=n(2786),i=n(9269);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},9581:function(e,t,n){var r=n(5988),o=n(8662),i=n(5182).CONSTRUCTOR;e.exports=i||!o((function(e){r.all(e).then(void 0,(function(){}))}))},2423:function(e){var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},4088:function(e,t,n){var r=n(9611),o=n(3875),i=n(5277),a=n(9159),c=n(9749),u=TypeError;e.exports=function(e,t){var n=e.exec;if(i(n)){var s=r(n,e,t);return null!==s&&o(s),s}if("RegExp"===a(e))return r(c,e,t);throw u("RegExp#exec called on incompatible receiver")}},9749:function(e,t,n){var r,o,i=n(9611),a=n(8697),c=n(8967),u=n(8083),s=n(7047),l=n(3580),f=n(1569),d=n(821).get,p=n(1669),h=n(1638),v=l("native-string-replace",String.prototype.replace),y=RegExp.prototype.exec,m=y,g=a("".charAt),b=a("".indexOf),w=a("".replace),_=a("".slice),x=(o=/b*/g,i(y,r=/a/,"a"),i(y,o,"a"),0!==r.lastIndex||0!==o.lastIndex),E=s.BROKEN_CARET,S=void 0!==/()??/.exec("")[1];(x||S||E||p||h)&&(m=function(e){var t,n,r,o,a,s,l,p=this,h=d(p),T=c(e),C=h.raw;if(C)return C.lastIndex=p.lastIndex,t=i(m,C,T),p.lastIndex=C.lastIndex,t;var O=h.groups,L=E&&p.sticky,I=i(u,p),k=p.source,A=0,M=T;if(L&&(I=w(I,"y",""),-1===b(I,"g")&&(I+="g"),M=_(T,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==g(T,p.lastIndex-1))&&(k="(?: "+k+")",M=" "+M,A++),n=new RegExp("^(?:"+k+")",I)),S&&(n=new RegExp("^"+k+"$(?!\\s)",I)),x&&(r=p.lastIndex),o=i(y,L?n:p,M),L?o?(o.input=_(o.input,A),o[0]=_(o[0],A),o.index=p.lastIndex,p.lastIndex+=o[0].length):p.lastIndex=0:x&&o&&(p.lastIndex=p.global?o.index+o[0].length:r),S&&o&&o.length>1&&i(v,o[0],n,(function(){for(a=1;ab)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")}))},6411:function(e,t,n){var r=n(9903),o=TypeError;e.exports=function(e){if(r(e))throw o("Can't call method on "+e);return e}},7323:function(e,t,n){var r=n(2773),o=n(3600),i=n(2280),a=n(7493),c=i("species");e.exports=function(e){var t=r(e);a&&t&&!t[c]&&o(t,c,{configurable:!0,get:function(){return this}})}},878:function(e,t,n){var r=n(6385).f,o=n(4792),i=n(2280)("toStringTag");e.exports=function(e,t,n){e&&!n&&(e=e.prototype),e&&!o(e,i)&&r(e,i,{configurable:!0,value:t})}},466:function(e,t,n){var r=n(3580),o=n(4524),i=r("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},9415:function(e,t,n){var r=n(8363),o=n(2359),i="__core-js_shared__",a=r[i]||o(i,{});e.exports=a},3580:function(e,t,n){var r=n(1178),o=n(9415);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.32.2",mode:r?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE",source:"https://github.com/zloirock/core-js"})},7270:function(e,t,n){var r=n(3875),o=n(3327),i=n(9903),a=n(2280)("species");e.exports=function(e,t){var n,c=r(e).constructor;return void 0===c||i(n=r(c)[a])?t:o(n)}},1140:function(e,t,n){var r=n(8697),o=n(4229),i=n(8967),a=n(6411),c=r("".charAt),u=r("".charCodeAt),s=r("".slice),l=function(e){return function(t,n){var r,l,f=i(a(t)),d=o(n),p=f.length;return d<0||d>=p?e?"":void 0:(r=u(f,d))<55296||r>56319||d+1===p||(l=u(f,d+1))<56320||l>57343?e?c(f,d):r:e?s(f,d,d+2):l-56320+(r-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},287:function(e,t,n){var r=n(8697),o=n(6411),i=n(8967),a=n(2569),c=r("".replace),u=RegExp("^["+a+"]+"),s=RegExp("(^|[^"+a+"])["+a+"]+$"),l=function(e){return function(t){var n=i(o(t));return 1&e&&(n=c(n,u,"")),2&e&&(n=c(n,s,"$1")),n}};e.exports={start:l(1),end:l(2),trim:l(3)}},746:function(e,t,n){var r=n(1197),o=n(9044),i=n(8363).String;e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},455:function(e,t,n){var r=n(9611),o=n(2773),i=n(2280),a=n(403);e.exports=function(){var e=o("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,c=i("toPrimitive");t&&!t[c]&&a(t,c,(function(e){return r(n,this)}),{arity:1})}},3429:function(e,t,n){var r=n(746);e.exports=r&&!!Symbol.for&&!!Symbol.keyFor},4643:function(e,t,n){var r,o,i,a,c=n(8363),u=n(3530),s=n(8166),l=n(5277),f=n(4792),d=n(9044),p=n(7055),h=n(5629),v=n(2750),y=n(7687),m=n(3121),g=n(3921),b=c.setImmediate,w=c.clearImmediate,_=c.process,x=c.Dispatch,E=c.Function,S=c.MessageChannel,T=c.String,C=0,O={},L="onreadystatechange";d((function(){r=c.location}));var I=function(e){if(f(O,e)){var t=O[e];delete O[e],t()}},k=function(e){return function(){I(e)}},A=function(e){I(e.data)},M=function(e){c.postMessage(T(e),r.protocol+"//"+r.host)};b&&w||(b=function(e){y(arguments.length,1);var t=l(e)?e:E(e),n=h(arguments,1);return O[++C]=function(){u(t,void 0,n)},o(C),C},w=function(e){delete O[e]},g?o=function(e){_.nextTick(k(e))}:x&&x.now?o=function(e){x.now(k(e))}:S&&!m?(a=(i=new S).port2,i.port1.onmessage=A,o=s(a.postMessage,a)):c.addEventListener&&l(c.postMessage)&&!c.importScripts&&r&&"file:"!==r.protocol&&!d(M)?(o=M,c.addEventListener("message",A,!1)):o=L in v("script")?function(e){p.appendChild(v("script"))[L]=function(){p.removeChild(this),I(e)}}:function(e){setTimeout(k(e),0)}),e.exports={set:b,clear:w}},1655:function(e,t,n){var r=n(8697);e.exports=r(1..valueOf)},2565:function(e,t,n){var r=n(4229),o=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):i(n,t)}},2802:function(e,t,n){var r=n(1893),o=TypeError;e.exports=function(e){var t=r(e,"number");if("number"==typeof t)throw o("Can't convert number to bigint");return BigInt(t)}},7302:function(e,t,n){var r=n(4229),o=n(5108),i=RangeError;e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=o(t);if(t!==n)throw i("Wrong length or index");return n}},9580:function(e,t,n){var r=n(8609),o=n(6411);e.exports=function(e){return r(o(e))}},4229:function(e,t,n){var r=n(8300);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},5108:function(e,t,n){var r=n(4229),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},744:function(e,t,n){var r=n(6411),o=Object;e.exports=function(e){return o(r(e))}},5758:function(e,t,n){var r=n(3786),o=RangeError;e.exports=function(e,t){var n=r(e);if(n%t)throw o("Wrong offset");return n}},3786:function(e,t,n){var r=n(4229),o=RangeError;e.exports=function(e){var t=r(e);if(t<0)throw o("The argument can't be less than 0");return t}},1893:function(e,t,n){var r=n(9611),o=n(2786),i=n(6681),a=n(7219),c=n(7141),u=n(2280),s=TypeError,l=u("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var n,u=a(e,l);if(u){if(void 0===t&&(t="default"),n=r(u,e,t),!o(n)||i(n))return n;throw s("Can't convert object to primitive value")}return void 0===t&&(t="number"),c(e,t)}},383:function(e,t,n){var r=n(1893),o=n(6681);e.exports=function(e){var t=r(e,"string");return o(t)?t:t+""}},7301:function(e,t,n){var r={};r[n(2280)("toStringTag")]="z",e.exports="[object z]"===String(r)},8967:function(e,t,n){var r=n(6994),o=String;e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return o(e)}},5952:function(e){var t=Math.round;e.exports=function(e){var n=t(e);return n<0?0:n>255?255:255&n}},8768:function(e){var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},6764:function(e,t,n){var r=n(9882),o=n(8363),i=n(9611),a=n(7493),c=n(3231),u=n(2089),s=n(638),l=n(9519),f=n(9199),d=n(5899),p=n(7507),h=n(5108),v=n(7302),y=n(5758),m=n(5952),g=n(383),b=n(4792),w=n(6994),_=n(2786),x=n(6681),E=n(1569),S=n(2010),T=n(2412),C=n(7994).f,O=n(6503),L=n(8671).forEach,I=n(7323),k=n(3600),A=n(6385),M=n(6012),j=n(821),P=n(9250),B=j.get,N=j.set,R=j.enforce,F=A.f,V=M.f,H=o.RangeError,D=s.ArrayBuffer,G=D.prototype,W=s.DataView,Z=u.NATIVE_ARRAY_BUFFER_VIEWS,U=u.TYPED_ARRAY_TAG,Y=u.TypedArray,X=u.TypedArrayPrototype,J=u.aTypedArrayConstructor,z=u.isTypedArray,K="BYTES_PER_ELEMENT",Q="Wrong length",q=function(e,t){J(e);for(var n=0,r=t.length,o=new e(r);r>n;)o[n]=t[n++];return o},$=function(e,t){k(e,t,{configurable:!0,get:function(){return B(this)[t]}})},ee=function(e){var t;return S(G,e)||"ArrayBuffer"===(t=w(e))||"SharedArrayBuffer"===t},te=function(e,t){return z(e)&&!x(t)&&t in e&&p(+t)&&t>=0},ne=function(e,t){return t=g(t),te(e,t)?f(2,e[t]):V(e,t)},re=function(e,t,n){return t=g(t),!(te(e,t)&&_(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?F(e,t,n):(e[t]=n.value,e)};a?(Z||(M.f=ne,A.f=re,$(X,"buffer"),$(X,"byteOffset"),$(X,"byteLength"),$(X,"length")),r({target:"Object",stat:!0,forced:!Z},{getOwnPropertyDescriptor:ne,defineProperty:re}),e.exports=function(e,t,n){var a=e.match(/\d+/)[0]/8,u=e+(n?"Clamped":"")+"Array",s="get"+e,f="set"+e,p=o[u],g=p,b=g&&g.prototype,w={},x=function(e,t){F(e,t,{get:function(){return function(e,t){var n=B(e);return n.view[s](t*a+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var o=B(e);o.view[f](t*a+o.byteOffset,n?m(r):r,!0)}(this,t,e)},enumerable:!0})};Z?c&&(g=t((function(e,t,n,r){return l(e,b),P(_(t)?ee(t)?void 0!==r?new p(t,y(n,a),r):void 0!==n?new p(t,y(n,a)):new p(t):z(t)?q(g,t):i(O,g,t):new p(v(t)),e,g)})),T&&T(g,Y),L(C(p),(function(e){e in g||d(g,e,p[e])})),g.prototype=b):(g=t((function(e,t,n,r){l(e,b);var o,c,u,s=0,f=0;if(_(t)){if(!ee(t))return z(t)?q(g,t):i(O,g,t);o=t,f=y(n,a);var d=t.byteLength;if(void 0===r){if(d%a)throw H(Q);if((c=d-f)<0)throw H(Q)}else if((c=h(r)*a)+f>d)throw H(Q);u=c/a}else u=v(t),o=new D(c=u*a);for(N(e,{buffer:o,byteOffset:f,byteLength:c,length:u,view:new W(o)});s1?arguments[1]:void 0,S=void 0!==E,T=s(_);if(T&&!l(T))for(b=(g=u(_,T)).next,_=[];!(m=o(b,g)).done;)_.push(m.value);for(S&&x>2&&(E=r(E,arguments[2])),n=c(_),h=new(d(w))(n),v=f(h),t=0;n>t;t++)y=S?E(_[t],t):_[t],h[t]=v?p(y):+y;return h}},6107:function(e,t,n){var r=n(2089),o=n(7270),i=r.aTypedArrayConstructor,a=r.getTypedArrayConstructor;e.exports=function(e){return i(o(e,a(e)))}},4524:function(e,t,n){var r=n(8697),o=0,i=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},189:function(e,t,n){var r=n(746);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},1010:function(e,t,n){var r=n(7493),o=n(9044);e.exports=r&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},7687:function(e){var t=TypeError;e.exports=function(e,n){if(e=51||!o((function(){var e=[];return e[v]=!1,e.concat()[0]!==e})),m=function(e){if(!a(e))return!1;var t=e[v];return void 0!==t?!!t:i(e)};r({target:"Array",proto:!0,arity:1,forced:!y||!d("concat")},{concat:function(e){var t,n,r,o,i,a=c(this),d=f(a,0),p=0;for(t=-1,r=arguments.length;t1?arguments[1]:void 0)}})},1078:function(e,t,n){var r=n(9882),o=n(379);r({target:"Array",proto:!0,forced:[].forEach!==o},{forEach:o})},4883:function(e,t,n){var r=n(9580),o=n(6677),i=n(4818),a=n(821),c=n(6385).f,u=n(8150),s=n(6145),l=n(1178),f=n(7493),d="Array Iterator",p=a.set,h=a.getterFor(d);e.exports=u(Array,"Array",(function(e,t){p(this,{type:d,target:r(e),index:0,kind:t})}),(function(){var e=h(this),t=e.target,n=e.kind,r=e.index++;if(!t||r>=t.length)return e.target=void 0,s(void 0,!0);switch(n){case"keys":return s(r,!1);case"values":return s(t[r],!1)}return s([r,t[r]],!1)}),"values");var v=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!l&&f&&"values"!==v.name)try{c(v,"name",{value:"values"})}catch(e){}},199:function(e,t,n){var r=n(9882),o=n(8697),i=n(1982),a=o([].reverse),c=[1,2];r({target:"Array",proto:!0,forced:String(c)===String(c.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a(this)}})},8821:function(e,t,n){var r=n(9882),o=n(1982),i=n(1536),a=n(2786),c=n(2565),u=n(7046),s=n(9580),l=n(5039),f=n(2280),d=n(2091),p=n(5629),h=d("slice"),v=f("species"),y=Array,m=Math.max;r({target:"Array",proto:!0,forced:!h},{slice:function(e,t){var n,r,f,d=s(this),h=u(d),g=c(e,h),b=c(void 0===t?h:t,h);if(o(d)&&(n=d.constructor,(i(n)&&(n===y||o(n.prototype))||a(n)&&null===(n=n[v]))&&(n=void 0),n===y||void 0===n))return p(d,g,b);for(r=new(void 0===n?y:n)(m(b-g,0)),f=0;g2)if(s=w(s),43===(t=O(s,0))||45===t){if(88===(n=O(s,2))||120===n)return NaN}else if(48===t){switch(O(s,1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+s}for(a=(i=C(s,2)).length,c=0;co)return NaN;return parseInt(i,r)}return+s}(t)}(e));return d(S,t=this)&&v((function(){b(t)}))?f(Object(n),this,I):n};I.prototype=S,L&&!o&&(S.constructor=I),r({global:!0,constructor:!0,wrap:!0,forced:L},{Number:I});var k=function(e,t){for(var n,r=i?y(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;r.length>o;o++)l(t,n=r[o])&&!l(e,n)&&g(e,n,m(t,n))};o&&E&&k(c[_],E),(L||o)&&k(c[_],x)},2477:function(e,t,n){n(9882)({target:"Object",stat:!0,sham:!n(7493)},{create:n(1569)})},3973:function(e,t,n){var r=n(9882),o=n(7493),i=n(6385).f;r({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!o},{defineProperty:i})},5090:function(e,t,n){var r=n(9882),o=n(746),i=n(9044),a=n(9612),c=n(744);r({target:"Object",stat:!0,forced:!o||i((function(){a.f(1)}))},{getOwnPropertySymbols:function(e){var t=a.f;return t?t(c(e)):[]}})},6908:function(e,t,n){var r=n(9882),o=n(9044),i=n(744),a=n(2654),c=n(5115);r({target:"Object",stat:!0,forced:o((function(){a(1)})),sham:!c},{getPrototypeOf:function(e){return a(i(e))}})},1879:function(e,t,n){n(9882)({target:"Object",stat:!0},{setPrototypeOf:n(2412)})},853:function(e,t,n){var r=n(7301),o=n(403),i=n(6699);r||o(Object.prototype,"toString",i,{unsafe:!0})},1321:function(e,t,n){var r=n(9882),o=n(9611),i=n(7676),a=n(9269),c=n(4443),u=n(5166);r({target:"Promise",stat:!0,forced:n(9581)},{all:function(e){var t=this,n=a.f(t),r=n.resolve,s=n.reject,l=c((function(){var n=i(t.resolve),a=[],c=0,l=1;u(e,(function(e){var i=c++,u=!1;l++,o(n,t,e).then((function(e){u||(u=!0,a[i]=e,--l||r(a))}),s)})),--l||r(a)}));return l.error&&s(l.value),n.promise}})},865:function(e,t,n){var r=n(9882),o=n(1178),i=n(5182).CONSTRUCTOR,a=n(5988),c=n(2773),u=n(5277),s=n(403),l=a&&a.prototype;if(r({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(e){return this.then(void 0,e)}}),!o&&u(a)){var f=c("Promise").prototype.catch;l.catch!==f&&s(l,"catch",f,{unsafe:!0})}},5999:function(e,t,n){var r,o,i,a=n(9882),c=n(1178),u=n(3921),s=n(8363),l=n(9611),f=n(403),d=n(2412),p=n(878),h=n(7323),v=n(7676),y=n(5277),m=n(2786),g=n(9519),b=n(7270),w=n(4643).set,_=n(1800),x=n(6271),E=n(4443),S=n(2423),T=n(821),C=n(5988),O=n(5182),L=n(9269),I="Promise",k=O.CONSTRUCTOR,A=O.REJECTION_EVENT,M=O.SUBCLASSING,j=T.getterFor(I),P=T.set,B=C&&C.prototype,N=C,R=B,F=s.TypeError,V=s.document,H=s.process,D=L.f,G=D,W=!!(V&&V.createEvent&&s.dispatchEvent),Z="unhandledrejection",U=function(e){var t;return!(!m(e)||!y(t=e.then))&&t},Y=function(e,t){var n,r,o,i=t.value,a=1===t.state,c=a?e.ok:e.fail,u=e.resolve,s=e.reject,f=e.domain;try{c?(a||(2===t.rejection&&Q(t),t.rejection=1),!0===c?n=i:(f&&f.enter(),n=c(i),f&&(f.exit(),o=!0)),n===e.promise?s(F("Promise-chain cycle")):(r=U(n))?l(r,n,u,s):u(n)):s(i)}catch(e){f&&!o&&f.exit(),s(e)}},X=function(e,t){e.notified||(e.notified=!0,_((function(){for(var n,r=e.reactions;n=r.get();)Y(n,e);e.notified=!1,t&&!e.rejection&&z(e)})))},J=function(e,t,n){var r,o;W?((r=V.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),s.dispatchEvent(r)):r={promise:t,reason:n},!A&&(o=s["on"+e])?o(r):e===Z&&x("Unhandled promise rejection",n)},z=function(e){l(w,s,(function(){var t,n=e.facade,r=e.value;if(K(e)&&(t=E((function(){u?H.emit("unhandledRejection",r,n):J(Z,n,r)})),e.rejection=u||K(e)?2:1,t.error))throw t.value}))},K=function(e){return 1!==e.rejection&&!e.parent},Q=function(e){l(w,s,(function(){var t=e.facade;u?H.emit("rejectionHandled",t):J("rejectionhandled",t,e.value)}))},q=function(e,t,n){return function(r){e(t,r,n)}},$=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,X(e,!0))},ee=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw F("Promise can't be resolved itself");var r=U(t);r?_((function(){var n={done:!1};try{l(r,t,q(ee,n,e),q($,n,e))}catch(t){$(n,t,e)}})):(e.value=t,e.state=1,X(e,!1))}catch(t){$({done:!1},t,e)}}};if(k&&(R=(N=function(e){g(this,R),v(e),l(r,this);var t=j(this);try{e(q(ee,t),q($,t))}catch(e){$(t,e)}}).prototype,(r=function(e){P(this,{type:I,done:!1,notified:!1,parent:!1,reactions:new S,rejection:!1,state:0,value:void 0})}).prototype=f(R,"then",(function(e,t){var n=j(this),r=D(b(this,N));return n.parent=!0,r.ok=!y(e)||e,r.fail=y(t)&&t,r.domain=u?H.domain:void 0,0===n.state?n.reactions.add(r):_((function(){Y(r,n)})),r.promise})),o=function(){var e=new r,t=j(e);this.promise=e,this.resolve=q(ee,t),this.reject=q($,t)},L.f=D=function(e){return e===N||void 0===e?new o(e):G(e)},!c&&y(C)&&B!==Object.prototype)){i=B.then,M||f(B,"then",(function(e,t){var n=this;return new N((function(e,t){l(i,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete B.constructor}catch(e){}d&&d(B,R)}a({global:!0,constructor:!0,wrap:!0,forced:k},{Promise:N}),p(N,I,!1,!0),h(I)},5054:function(e,t,n){n(5999),n(1321),n(865),n(7688),n(6055),n(9240)},7688:function(e,t,n){var r=n(9882),o=n(9611),i=n(7676),a=n(9269),c=n(4443),u=n(5166);r({target:"Promise",stat:!0,forced:n(9581)},{race:function(e){var t=this,n=a.f(t),r=n.reject,s=c((function(){var a=i(t.resolve);u(e,(function(e){o(a,t,e).then(n.resolve,r)}))}));return s.error&&r(s.value),n.promise}})},6055:function(e,t,n){var r=n(9882),o=n(9611),i=n(9269);r({target:"Promise",stat:!0,forced:n(5182).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return o(t.reject,void 0,e),t.promise}})},9240:function(e,t,n){var r=n(9882),o=n(2773),i=n(1178),a=n(5988),c=n(5182).CONSTRUCTOR,u=n(1621),s=o("Promise"),l=i&&!c;r({target:"Promise",stat:!0,forced:i||c},{resolve:function(e){return u(l&&this===s?a:this,e)}})},9275:function(e,t,n){var r=n(9882),o=n(9749);r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},5007:function(e,t,n){var r=n(1140).charAt,o=n(8967),i=n(821),a=n(8150),c=n(6145),u="String Iterator",s=i.set,l=i.getterFor(u);a(String,"String",(function(e){s(this,{type:u,string:o(e),index:0})}),(function(){var e,t=l(this),n=t.string,o=t.index;return o>=n.length?c(void 0,!0):(e=r(n,o),t.index+=e.length,c(e,!1))}))},5668:function(e,t,n){var r=n(9611),o=n(1492),i=n(3875),a=n(9903),c=n(5108),u=n(8967),s=n(6411),l=n(7219),f=n(3350),d=n(4088);o("match",(function(e,t,n){return[function(t){var n=s(this),o=a(t)?void 0:l(t,e);return o?r(o,t,n):new RegExp(t)[e](u(n))},function(e){var r=i(this),o=u(e),a=n(t,r,o);if(a.done)return a.value;if(!r.global)return d(r,o);var s=r.unicode;r.lastIndex=0;for(var l,p=[],h=0;null!==(l=d(r,o));){var v=u(l[0]);p[h]=v,""===v&&(r.lastIndex=f(o,c(r.lastIndex),s)),h++}return 0===h?null:p}]}))},7838:function(e,t,n){var r=n(3530),o=n(9611),i=n(8697),a=n(1492),c=n(3875),u=n(9903),s=n(2622),l=n(6411),f=n(7270),d=n(3350),p=n(5108),h=n(8967),v=n(7219),y=n(8990),m=n(4088),g=n(9749),b=n(7047),w=n(9044),_=b.UNSUPPORTED_Y,x=4294967295,E=Math.min,S=[].push,T=i(/./.exec),C=i(S),O=i("".slice),L=!w((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));a("split",(function(e,t,n){var i;return i="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var i=h(l(this)),a=void 0===n?x:n>>>0;if(0===a)return[];if(void 0===e)return[i];if(!s(e))return o(t,i,e,a);for(var c,u,f,d=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),v=0,m=new RegExp(e.source,p+"g");(c=o(g,m,i))&&!((u=m.lastIndex)>v&&(C(d,O(i,v,c.index)),c.length>1&&c.index=a));)m.lastIndex===c.index&&m.lastIndex++;return v===i.length?!f&&T(m,"")||C(d,""):C(d,O(i,v)),d.length>a?y(d,0,a):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:o(t,this,e,n)}:t,[function(t,n){var r=l(this),a=u(t)?void 0:v(t,e);return a?o(a,t,r,n):o(i,h(r),t,n)},function(e,r){var o=c(this),a=h(e),u=n(i,o,a,r,i!==t);if(u.done)return u.value;var s=f(o,RegExp),l=o.unicode,v=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(_?"g":"y"),y=new s(_?"^(?:"+o.source+")":o,v),g=void 0===r?x:r>>>0;if(0===g)return[];if(0===a.length)return null===m(y,a)?[a]:[];for(var b=0,w=0,S=[];w2?arguments[2]:void 0)}))},6887:function(e,t,n){var r=n(2089),o=n(8671).every,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("every",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},7353:function(e,t,n){var r=n(2089),o=n(5522),i=n(2802),a=n(6994),c=n(9611),u=n(8697),s=n(9044),l=r.aTypedArray,f=r.exportTypedArrayMethod,d=u("".slice);f("fill",(function(e){var t=arguments.length;l(this);var n="Big"===d(a(this),0,3)?i(e):+e;return c(o,this,n,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),s((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})))},6366:function(e,t,n){var r=n(2089),o=n(8671).filter,i=n(3687),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("filter",(function(e){var t=o(a(this),e,arguments.length>1?arguments[1]:void 0);return i(this,t)}))},5056:function(e,t,n){var r=n(2089),o=n(8671).findIndex,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("findIndex",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},2372:function(e,t,n){var r=n(2089),o=n(8671).find,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("find",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},3677:function(e,t,n){var r=n(2089),o=n(8671).forEach,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("forEach",(function(e){o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},7355:function(e,t,n){var r=n(2089),o=n(7190).includes,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("includes",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},8784:function(e,t,n){var r=n(2089),o=n(7190).indexOf,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("indexOf",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},8554:function(e,t,n){var r=n(8363),o=n(9044),i=n(8697),a=n(2089),c=n(4883),u=n(2280)("iterator"),s=r.Uint8Array,l=i(c.values),f=i(c.keys),d=i(c.entries),p=a.aTypedArray,h=a.exportTypedArrayMethod,v=s&&s.prototype,y=!o((function(){v[u].call([1])})),m=!!v&&v.values&&v[u]===v.values&&"values"===v.values.name,g=function(){return l(p(this))};h("entries",(function(){return d(p(this))}),y),h("keys",(function(){return f(p(this))}),y),h("values",g,y||!m,{name:"values"}),h(u,g,y||!m,{name:"values"})},2403:function(e,t,n){var r=n(2089),o=n(8697),i=r.aTypedArray,a=r.exportTypedArrayMethod,c=o([].join);a("join",(function(e){return c(i(this),e)}))},4312:function(e,t,n){var r=n(2089),o=n(3530),i=n(7837),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return o(i,a(this),t>1?[e,arguments[1]]:[e])}))},3444:function(e,t,n){var r=n(2089),o=n(8671).map,i=n(6107),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("map",(function(e){return o(a(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(i(e))(t)}))}))},6798:function(e,t,n){var r=n(2089),o=n(6596).right,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return o(i(this),e,t,t>1?arguments[1]:void 0)}))},70:function(e,t,n){var r=n(2089),o=n(6596).left,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return o(i(this),e,t,t>1?arguments[1]:void 0)}))},8036:function(e,t,n){var r=n(2089),o=r.aTypedArray,i=r.exportTypedArrayMethod,a=Math.floor;i("reverse",(function(){for(var e,t=this,n=o(t).length,r=a(n/2),i=0;i1?arguments[1]:void 0,1),n=u(e);if(y)return o(p,this,n,t);var r=this.length,i=a(n),s=0;if(i+t>r)throw l("Wrong length");for(;si;)s[i]=n[i++];return s}),i((function(){new Int8Array(1).slice()})))},2298:function(e,t,n){var r=n(2089),o=n(8671).some,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("some",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},7306:function(e,t,n){var r=n(8363),o=n(5785),i=n(9044),a=n(7676),c=n(2013),u=n(2089),s=n(4631),l=n(442),f=n(1197),d=n(6929),p=u.aTypedArray,h=u.exportTypedArrayMethod,v=r.Uint16Array,y=v&&o(v.prototype.sort),m=!(!y||i((function(){y(new v(2),null)}))&&i((function(){y(new v(2),{})}))),g=!!y&&!i((function(){if(f)return f<74;if(s)return s<67;if(l)return!0;if(d)return d<602;var e,t,n=new v(516),r=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(y(n,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(n[e]!==r[e])return!0}));h("sort",(function(e){return void 0!==e&&a(e),g?y(this,e):c(p(this),function(e){return function(t,n){return void 0!==e?+e(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?1/t>0&&1/n<0?1:-1:t>n}}(e))}),!g||m)},5480:function(e,t,n){var r=n(2089),o=n(5108),i=n(2565),a=n(6107),c=r.aTypedArray;(0,r.exportTypedArrayMethod)("subarray",(function(e,t){var n=c(this),r=n.length,u=i(e,r);return new(a(n))(n.buffer,n.byteOffset+u*n.BYTES_PER_ELEMENT,o((void 0===t?r:i(t,r))-u))}))},4314:function(e,t,n){var r=n(8363),o=n(3530),i=n(2089),a=n(9044),c=n(5629),u=r.Int8Array,s=i.aTypedArray,l=i.exportTypedArrayMethod,f=[].toLocaleString,d=!!u&&a((function(){f.call(new u(1))}));l("toLocaleString",(function(){return o(f,d?c(s(this)):s(this),c(arguments))}),a((function(){return[1,2].toLocaleString()!==new u([1,2]).toLocaleString()}))||!a((function(){u.prototype.toLocaleString.call([1,2])})))},572:function(e,t,n){var r=n(2089).exportTypedArrayMethod,o=n(9044),i=n(8363),a=n(8697),c=i.Uint8Array,u=c&&c.prototype||{},s=[].toString,l=a([].join);o((function(){s.call({})}))&&(s=function(){return l(this)});var f=u.toString!==s;r("toString",s,f)},9627:function(e,t,n){n(6764)("Uint8",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},6208:function(e,t,n){var r=n(8363),o=n(2848),i=n(9189),a=n(379),c=n(5899),u=function(e){if(e&&e.forEach!==a)try{c(e,"forEach",a)}catch(t){e.forEach=a}};for(var s in o)o[s]&&u(r[s]&&r[s].prototype);u(i)},8995:function(e,t,n){var r=n(8363),o=n(2848),i=n(9189),a=n(4883),c=n(5899),u=n(2280),s=u("iterator"),l=u("toStringTag"),f=a.values,d=function(e,t){if(e){if(e[s]!==f)try{c(e,s,f)}catch(t){e[s]=f}if(e[l]||c(e,l,t),o[t])for(var n in a)if(e[n]!==a[n])try{c(e,n,a[n])}catch(t){e[n]=a[n]}}};for(var p in o)d(r[p]&&r[p].prototype,p);d(i,"DOMTokenList")},5939:function(e){var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}v(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function s(e,t,n,r){var o,i,a,s;if(c(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=u(e))>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,s=l,console&&console.warn&&console.warn(s)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=l.bind(r);return o.listener=n,r.wrapFn=o,o}function d(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var s=u.length,l=h(u,s);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},6459:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.setLastICMessageTime=t.lastICMessageTime=t.delay=t.setBanned=t.banned=t.setExtraFeatures=t.extrafeatures=t.setSelectedShout=t.selectedShout=t.setSelectedMenu=t.selectedMenu=t.setOldLoading=t.oldLoading=t.UPDATE_INTERVAL=t.setClient=t.client=t.setCHATBOX=t.CHATBOX=void 0;var a,c=n(4891),u=n(237),s=n(5335),l=n(488),f=n(1300),d=n(740),p=n(5939),h=n(838),v=n(3453),y=n(5131),m=n(989),g=n(7643),b=(0,l.default)(),w=b.ip,_=b.mode,x=b.theme||"default";t.setCHATBOX=function(e){t.CHATBOX=e},t.setClient=function(e){t.client=e},t.UPDATE_INTERVAL=60,t.oldLoading=!1,t.setOldLoading=function(e){console.warn("old loading set to "+e),t.oldLoading=e},t.selectedMenu=1,t.setSelectedMenu=function(e){t.selectedMenu=e},t.selectedShout=0,t.setSelectedShout=function(e){t.selectedShout=e},t.extrafeatures=[],t.setExtraFeatures=function(e){t.extrafeatures=e},t.banned=!1,t.setBanned=function(e){t.banned=e},u.default.load().then((function(e){return e.get()})).then((function(e){a=e.visitorId,t.client=new E(w),t.client.connect(),(0,c.isLowMemory)(),(0,y.loadResources)()})),t.delay=function(e){return new Promise((function(t){return setTimeout(t,e)}))},t.lastICMessageTime=new Date(0),t.setLastICMessageTime=function(e){t.lastICMessageTime=e};var E=function(e){function n(t){var n=e.call(this)||this;return n.connect=function(){n.on("open",n.onOpen.bind(n)),n.on("close",n.onClose.bind(n)),n.on("message",n.onMessage.bind(n)),n.on("error",n.onError.bind(n)),"replay"!==_?(n.serv=new WebSocket("ws://".concat(t)),n.serv.addEventListener("open",n.emit.bind(n,"open")),n.serv.addEventListener("close",n.emit.bind(n,"close")),n.serv.addEventListener("message",n.emit.bind(n,"message")),n.serv.addEventListener("error",n.emit.bind(n,"error"))):n.joinServer()},n.hp=[0,0],n.playerID=1,n.charID=-1,n.char_list_length=0,n.evidence_list_length=0,n.music_list_length=0,n.testimonyID=0,n.chars=[],n.emotes=[],n.evidences=[],n.areas=[],n.musics=[],n.musics_time=!1,n.callwords=[],n.manifest=[],n.resources=(0,f.default)(m.AO_HOST,x),n.selectedEmote=-1,n.selectedEvidence=0,n.checkUpdater=null,n.sender=s.sender,n.viewport=(0,d.default)(),n._lastTimeICReceived=new Date(0),n.partial_packet=!1,n.temp_packet="",y.loadResources,c.isLowMemory,n}return o(n,e),Object.defineProperty(n.prototype,"character",{get:function(){return this.chars[this.charID]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"emote",{get:function(){return this.emotes[this.selectedEmote]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"evidence",{get:function(){return document.getElementById("button_present").classList.contains("dark")?this.selectedEvidence:0},enumerable:!1,configurable:!0}),n.prototype.handleSelf=function(e){var t=this,n=new MessageEvent("websocket",{data:e});setTimeout((function(){return t.onMessage(n)}),1)},n.prototype.joinServer=function(){var e=this;this.sender.sendServer("HI#".concat(a,"#%")),"replay"!==_&&(this.checkUpdater=setInterval((function(){return e.sender.sendCheck()}),5e3))},n.prototype.onOpen=function(e){t.client.joinServer()},n.prototype.onClose=function(e){console.error("The connection was closed: ".concat(e.reason," (").concat(e.code,")")),0==t.extrafeatures.length&&!1===t.banned&&(document.getElementById("client_errortext").textContent="Could not connect to the server"),document.getElementById("client_waiting").style.display="block",document.getElementById("client_error").style.display="flex",document.getElementById("client_loading").style.display="none",document.getElementById("error_id").textContent=String(e.code),this.cleanup()},n.prototype.onMessage=function(e){var t=e.data;console.debug("S: ".concat(t)),this.handle_server_packet(t)},n.prototype.handle_server_packet=function(e){var t,n,r=e;if(!e.endsWith("%"))return this.partial_packet=!0,this.temp_packet=this.temp_packet+r,void console.log("Partial packet");this.partial_packet&&(r=this.temp_packet+r,this.temp_packet="",this.partial_packet=!1);var o=r.split("%");try{for(var a=i(o),c=a.next();!c.done;c=a.next()){var u,s=c.value;if(0!=(u=s.endsWith("#")?s.slice(0,-1).split("#"):s.split("#")).length){var l=u[0];""!==l&&(v.packetHandler.has(l)?v.packetHandler.get(l)(u):console.warn("Invalid packet header ".concat(l)))}else console.warn("WARNING: Empty packet received from server, skipping...")}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}},n.prototype.onError=function(e){console.error("A network error occurred"),document.getElementById("client_error").style.display="flex",this.cleanup()},n.prototype.cleanup=function(){clearInterval(this.checkUpdater),this.serv.close()},n.prototype.handleReplay=function(){var e=document.getElementById("client_ooclog"),t=Number(document.getElementById("client_replaytimer").value),n=e.value.split(/\r?\n/);if(n[0]){var r=String(n[0]);this.handleSelf(r),e.value=n.slice(1).join("\r\n"),"wait"===r.substr(0,4)?t=Number(r.split("#")[1]):"MS"!==r.substr(0,2)&&(t=0),setTimeout((function(){return(0,h.onReplayGo)(null)}),t)}},n.prototype.resetMusicList=function(){this.musics=[],document.getElementById("client_musiclist").innerHTML=""},n.prototype.resetAreaList=function(){this.areas=[],document.getElementById("areas").innerHTML="",(0,g.fetchBackgroundList)(),(0,g.fetchEvidenceList)(),(0,g.fetchCharacterList)()},n}(p.EventEmitter);t.default=E},9669:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.addTrack=void 0;var r=n(6459),o=n(164),i=n(6624);t.addTrack=function(e){var t=document.createElement("OPTION"),n=(0,i.getFilenameFromPath)(e);t.text=(0,o.unescapeChat)(n),t.value=e,document.getElementById("client_musiclist").options.add(t),r.client.musics.push(e)}},989:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.setAOhost=t.AO_HOST=void 0;var r=(0,n(488).default)().asset;t.AO_HOST=r||"http://attorneyoffline.de/base/",t.setAOhost=function(e){t.AO_HOST=e}},9442:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.appendICLog=void 0;var r=n(6459);t.appendICLog=function(e,t,n,o){void 0===t&&(t=""),void 0===n&&(n=""),void 0===o&&(o=new Date);var i=document.createElement("p"),a=document.createElement("span"),c=document.createElement("span"),u=document.createElement("span");if(c.className="iclog_name iclog_nameplate",c.appendChild(document.createTextNode(n)),a.className="iclog_name iclog_showname",""!==t&&t?a.appendChild(document.createTextNode(t)):a.appendChild(document.createTextNode(n)),u.className="iclog_text",u.appendChild(document.createTextNode(e)),i.appendChild(a),i.appendChild(c),i.appendChild(u),r.lastICMessageTime.getMinutes()!==o.getMinutes()){var s=document.createElement("span");s.className="iclog_time",s.innerText=o.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),i.appendChild(s)}var l=document.getElementById("client_log");l.appendChild(i),l.scrollTop>l.scrollHeight-800&&(l.scrollTop=l.scrollHeight),(0,r.setLastICMessageTime)(new Date)}},5693:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.checkCallword=void 0;var r=n(6459),o=n(989);t.checkCallword=function(e,t){r.client.callwords.forEach((function(n){""!==n&&e.toLowerCase().includes(n.toLowerCase())&&(t.pause(),t.src="".concat(o.AO_HOST,"sounds/general/sfx-gallery.opus"),t.play())}))}},8605:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createArea=void 0;var r=n(6459),o=n(3757);t.createArea=function(e,t){var n={name:t,players:0,status:"IDLE",cm:"",locked:"FREE"};r.client.areas.push(n);var i=document.createElement("SPAN");i.className="area-button area-default",i.id="area".concat(e),i.innerText=n.name,i.title="Players: ".concat(n.players,"\n")+"Status: ".concat(n.status,"\n")+"CM: ".concat(n.cm,"\n")+"Area lock: ".concat(n.locked),i.onclick=function(){(0,o.area_click)(i)},document.getElementById("areas").appendChild(i)}},7643:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]0){var e=r.client.areas.pop().name,t=document.getElementById("areas");t.removeChild(t.lastChild),(0,o.addTrack)(e)}}},7619:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.handleBans=void 0,t.handleBans=function(e,t){document.getElementById("client_error").style.display="flex",document.getElementById("client_errortext").innerHTML="".concat(e,":
").concat(t.replace(/\n/g,"
")),document.getElementById("client_reconnect").style.display="none",alert(e+":\r"+t)}},2651:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]").concat(_):w;"replay"===a&&(A="##",M="#0#0"),k="".concat((0,o.escapeChat)(g),"#").concat(b).concat(A,"#").concat(B).concat(M,"#").concat(Number(x),"#"),r.extrafeatures.includes("looping_sfx")&&(j="".concat(Number(E),"#").concat(Number(S),"#").concat(T,"#").concat(C,"#").concat(O,"#"),r.extrafeatures.includes("effects")&&(P="".concat(Number(L),"#").concat((0,o.escapeChat)(I),"#")))}var N="MS#".concat(e,"#").concat((0,o.escapeChat)(t),"#").concat((0,o.escapeChat)(n),"#").concat((0,o.escapeChat)(c))+"#".concat((0,o.escapeChat)(u),"#").concat((0,o.escapeChat)(s),"#").concat((0,o.escapeChat)(l),"#").concat(f)+"#".concat(i.client.charID,"#").concat(d,"#").concat(Number(p),"#").concat(Number(h),"#").concat(Number(v),"#").concat(Number(y),"#").concat(m,"#").concat(k).concat(j).concat(P,"%");i.client.sender.sendServer(N),"replay"===a&&(document.getElementById("client_ooclog").value+="wait#".concat(document.getElementById("client_replaytimer").value,"#%\r\n"))}},1263:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sendMusicChange=void 0;var r=n(6459);t.sendMusicChange=function(e){r.client.sender.sendServer("MC#".concat(e,"#").concat(r.client.charID,"#%"))}},2340:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sendOOC=void 0;var r=n(6459),o=n(164),i=n(2557),a=n(6066);t.sendOOC=function(e){(0,i.default)("OOC_name",document.getElementById("OOC_name").value);var t="".concat((0,o.escapeChat)(document.getElementById("OOC_name").value)),n="".concat((0,o.escapeChat)(e)),c={"/save_chatlog":a.saveChatlogHandle},u=new Map(Object.entries(c));if(n&&u.has(n.toLowerCase()))try{u.get(n.toLowerCase())()}catch(e){}else r.client.sender.sendServer("CT#".concat(t,"#").concat(n,"#%"))}},154:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sendPE=void 0;var r=n(6459),o=n(164);t.sendPE=function(e,t,n){r.client.sender.sendServer("PE#".concat((0,o.escapeChat)(e),"#").concat((0,o.escapeChat)(t),"#").concat((0,o.escapeChat)(n),"#%"))}},366:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sendRT=void 0;var r=n(6459);t.sendRT=function(e){r.client.sender.sendServer("RT#".concat(e,"#%"))}},2917:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sendSelf=void 0;var r=n(6459);t.sendSelf=function(e){document.getElementById("client_ooclog").value+="".concat(e,"\r\n"),r.client.handleSelf(e)}},7371:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sendServer=void 0;var r=n(6459),o=(0,n(488).default)().mode;t.sendServer=function(e){console.debug("C: "+e),"replay"===o?r.client.sender.sendSelf(e):r.client.serv.send(e)}},3723:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sendZZ=void 0;var r=n(6459);t.sendZZ=function(e){r.extrafeatures.includes("modcall_reason")?r.client.sender.sendServer("ZZ#".concat(e,"#%")):r.client.sender.sendServer("ZZ#%")}},9028:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var a=n(8481),c=n(1198);t.default=function(e,t,n,u,s,l,f){return r(void 0,void 0,void 0,(function(){var r,d,p,h,v,y,m,g,b,w,_,x;return o(this,(function(o){switch(o.label){case 0:r=l?"pair":"char",d="".concat(e,"characters/"),p=["def","pro","wit"].includes(f)?"".concat(f,"_"):"",h=document.getElementById("client_".concat(p).concat(r,"_img")),v=[".gif",".png",".apng",".webp",".webp.static"],o.label=1;case 1:o.trys.push([1,6,7,8]),y=i(v),m=y.next(),o.label=2;case 2:return m.done?[3,5]:(g=m.value,t.viewport.getLastCharacter()!==t.viewport.getChatmsg().name&&(h.src=a.default),b=void 0,b=".png"===g?"".concat(d).concat(encodeURI(n),"/").concat(encodeURI(u)).concat(g):".webp.static"===g?"".concat(d).concat(encodeURI(n),"/").concat(encodeURI(u),".webp"):"".concat(d).concat(encodeURI(n),"/").concat(encodeURI(s)).concat(encodeURI(u)).concat(g),[4,(0,c.default)(b)]);case 3:if(o.sent())return h.src=b,[3,5];o.label=4;case 4:return m=y.next(),[3,2];case 5:return[3,8];case 6:return w=o.sent(),_={error:w},[3,8];case 7:try{m&&!m.done&&(x=y.return)&&x.call(y)}finally{if(_)throw _.error}return[7];case 8:return[2]}}))}))}},3757:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.area_click=void 0;var r=n(6459);function o(e){var t=r.client.areas[e.id.substr(4)].name;r.client.sender.sendMusicChange(t);var n=document.createElement("div");n.className="hrtext",n.textContent="switched to ".concat(e.textContent),document.getElementById("client_log").appendChild(n)}t.area_click=o,window.area_click=o},1649:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.changeBlipVolume=void 0;var r=n(2557),o=n(6459);t.changeBlipVolume=function(){var e=document.getElementById("client_bvolume").value;o.client.viewport.blipChannels.forEach((function(t){return t.volume=Number(e)})),(0,r.default)("blipVolume",e)},window.changeBlipVolume=t.changeBlipVolume},5524:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.changeMusicVolume=void 0;var r=n(6459),o=n(2557);t.changeMusicVolume=function(e){void 0===e&&(e=-1);var t=Number(document.getElementById("client_mvolume").value),n=-1===e?t:e;r.client.viewport.music.forEach((function(e){return e.volume=n})),(0,o.default)("musicVolume",String(n))},window.changeMusicVolume=t.changeMusicVolume},1619:function(e,t){function n(e,t){for(var n=document.getElementById(e),r=1;r1,document.getElementById("sendpreanim").checked=1==r.client.emote.zoom}t.pickEmotion=o,window.pickEmotion=o},7549:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.reloadTheme=void 0;var r=n(6459),o=n(2557);t.reloadTheme=function(){r.client.viewport.setTheme(document.getElementById("client_themeselect").value),(0,o.default)("theme",r.client.viewport.getTheme()),document.getElementById("client_theme").href="styles/".concat(r.client.viewport.getTheme(),".css")},window.reloadTheme=t.reloadTheme},4923:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.resizeChatbox=void 0;var r=n(6459);function o(){var e=document.getElementById("client_chatcontainer"),t=document.getElementById("client_clock"),n=document.getElementById("client_trackstatus"),o=document.getElementById("client_background").offsetHeight;e.style.fontSize="".concat((.0521*o).toFixed(1),"px"),t.style.fontSize="".concat((.0521*o).toFixed(1),"px"),n.style.fontSize="".concat((.0521*o).toFixed(1),"px");var i=document.getElementById("client_trackstatustext");i.style.width=i.offsetWidth-1+"px";var a=new Date,c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];document.getElementById("client_clock_month").innerText=["January","February","March","April","May","June","July","August","September","October","November","December"][a.getMonth()],"acww"==r.CHATBOX?(c=["Su","Mo","Tu","We","Th","Fr","Sa"],document.getElementById("client_clock_weekday").innerText=c[a.getDay()],document.getElementById("client_clock_date").innerText=a.getDay()+"/"+a.getMonth(),document.getElementById("client_clock_time").innerText=a.getHours()+":"+a.getMinutes()):"key"==r.CHATBOX&&(c=["Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."],document.getElementById("client_clock_weekday").innerText=c[a.getDay()],document.getElementById("client_clock_date").innerText=String(a.getDate()))}t.resizeChatbox=o,window.resizeChatbox=o},3170:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.setChatbox=void 0;var r=n(6459),o=n(8999),i=n(2557);function a(e){var t=document.getElementById("chatbox_theme"),n=document.getElementById("client_chatboxselect");if((0,r.setCHATBOX)(n.value),(0,i.default)("chatbox",r.CHATBOX),"dynamic"===r.CHATBOX){var a=e.replace("chat","");o.default.includes(a)?t.href="styles/chatbox/".concat(a,".css"):t.href="styles/chatbox/aa.css"}else t.href="styles/chatbox/".concat(r.CHATBOX,".css")}t.setChatbox=a,window.setChatbox=a},5058:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.showname_click=void 0;var r=n(2557);function o(e){(0,r.default)("showname",String(document.getElementById("showname").checked)),(0,r.default)("ic_chat_name",document.getElementById("ic_chat_name").value);var t=document.getElementById("nameplate_setting");document.getElementById("showname").checked?t.href="styles/shownames.css":t.href="styles/nameplates.css"}t.showname_click=o,window.showname_click=o},9209:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.showFactorDialog=void 0;var r=n(6459);window.handleCredentialResponse=function(e){r.client.sender.sendServer("2T#".concat(e.credential,"#%"))},t.showFactorDialog=function(e){document.getElementById("client_secondfactor").style.display=e[1]}},2281:function(e,t){function n(e){"jud"===e?(document.getElementById("judge_action").style.display="inline-table",document.getElementById("no_action").style.display="none"):(document.getElementById("judge_action").style.display="none",document.getElementById("no_action").style.display="inline-table");for(var t=0,n=document.getElementById("role_select");t","#").replaceAll("","&").replaceAll("","%").replaceAll("","$")}function r(e){return e?e.replaceAll(">",">").replaceAll("<","<"):""}function o(e){return e.replace(/\\u([\d\w]{1,})/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))}Object.defineProperty(t,"__esModule",{value:!0}),t.prepChat=t.decodeChat=t.safeTags=t.unescapeChat=t.escapeChat=void 0,t.escapeChat=function(e){return e.replaceAll("#","").replaceAll("&","").replaceAll("%","").replaceAll("$","")},t.unescapeChat=n,t.safeTags=r,t.decodeChat=o,t.prepChat=function(e){return r(n(o(e)))}},7207:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleARUP=void 0;var r=n(6459),o=n(164);t.handleARUP=function(e){e=e.slice(1);for(var t=0;tt.scrollHeight-600&&(t.scrollTop=t.scrollHeight)}}},4914:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleCharsCheck=void 0;var r=n(6459);t.handleCharsCheck=function(e){for(var t=0;t=0?(t=o.client.chars[c].name,(0,a.appendICLog)("".concat(t," changed music to ").concat(n))):(0,a.appendICLog)("The music was changed to ".concat(n)),document.getElementById("client_trackstatustext").innerText=n}},3765:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.handleMM=void 0,t.handleMM=function(e){}},2639:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleMS=void 0;var r=n(6459),o=n(2651),i=n(2062),a=n(164),c=n(6991);t.handleMS=function(e){if(e[4]!==r.client.viewport.getChatmsg().content){document.getElementById("client_inner_chat").innerHTML="";var t=Number(e[9]),n=(0,a.safeTags)(e[3]),u=e[3],s="male",l="default",f=!1;if(t=0&&r.client.chars[t].name!==n){console.info("".concat(r.client.chars[t].name," is iniediting to ").concat(n));var d=("".concat(n,"&")+"iniediter").split("&");(0,o.handleCharacterInfo)(d,t)}try{u=r.client.chars[t].showname}catch(t){u=e[3]}try{s=r.client.chars[t].blips}catch(e){}try{l=r.client.chars[t].chat}catch(e){l="default"}try{f=r.client.chars[t].muted}catch(e){f=!1,console.error("we're still missing some character data")}if(!1===f){var p={deskmod:Number((0,a.safeTags)(e[1]).toLowerCase()),preanim:(0,a.safeTags)(e[2]).toLowerCase(),nameplate:u,chatbox:l,name:n,sprite:(0,a.safeTags)(e[4]).toLowerCase(),content:(0,a.prepChat)(e[5]),side:e[6].toLowerCase(),sound:(0,a.safeTags)(e[7]).toLowerCase(),blips:(0,a.safeTags)(s),type:Number(e[8]),charid:t,snddelay:Number(e[10]),objection:Number(e[11]),evidence:Number((0,a.safeTags)(e[12])),flip:Number(e[13]),flash:Number(e[14]),color:Number(e[15]),speed:r.UPDATE_INTERVAL};if(e.length>16){var h={showname:(0,a.prepChat)(e[16]),other_charid:Number(e[17]),other_name:(0,a.safeTags)(e[18]),other_emote:(0,a.safeTags)(e[19]),self_offset:e[20].split(""),other_offset:e[21].split(""),other_flip:Number(e[22]),noninterrupting_preanim:Number(e[23])};if(p=Object.assign(h,p),e.length>24){var v={looping_sfx:Number(e[24]),screenshake:Number(e[25]),frame_screenshake:(0,a.safeTags)(e[26]),frame_realization:(0,a.safeTags)(e[27]),frame_sfx:(0,a.safeTags)(e[28])};if(p=Object.assign(v,p),e.length>29){var y={additive:Number(e[29]),effects:e[30].split("|")};p=Object.assign(y,p)}else y={additive:0,effects:["","",""]},p=Object.assign(y,p)}else v={looping_sfx:0,screenshake:0,frame_screenshake:"",frame_realization:"",frame_sfx:""},p=Object.assign(v,p),y={additive:0,effects:["","",""]},p=Object.assign(y,p)}else h={showname:"",other_charid:0,other_name:"",other_emote:"",self_offset:[0,0],other_offset:[0,0],other_flip:0,noninterrupting_preanim:0},p=Object.assign(h,p),v={looping_sfx:0,screenshake:0,frame_screenshake:"",frame_realization:"",frame_sfx:""},p=Object.assign(v,p),y={additive:0,effects:["","",""]},p=Object.assign(y,p);""===p.content.trim()&&(p.content=""),p.charid===r.client.charID&&(0,i.resetICParams)(),(0,c.handle_ic_speaking)(p)}}}},8278:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handlePN=void 0;var r=n(6459);t.handlePN=function(e){r.client.sender.sendServer("askchaa#%")}},358:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]No emotes available';else{for(f=function(e){try{var o=l.emotions[e].split("#"),i=void 0,a=void 0;try{i=l.soundn[e]||"0",a=Number(l.soundt[e])||0}catch(e){console.warn("ini sound is completly missing"),i="0",a=0}n[e]={desc:o[0].toLowerCase(),preanim:o[1].toLowerCase(),emote:o[2].toLowerCase(),zoom:Number(o[3])||0,deskmod:Number(o[4])||1,sfx:i.toLowerCase(),sfxdelay:a,frame_screenshake:"",frame_realization:"",frame_sfx:"",button:"".concat(s.AO_HOST,"characters/").concat(encodeURI(t.name.toLowerCase()),"/emotions/button").concat(e,"_off.png")};var c=new Image;c.id="emo_"+e,c.className="emote_button",c.src=n[e].button,c.alt=n[e].desc,c.title=n[e].desc,c.onclick=function(){window.pickEmotion(e)},r.appendChild(c)}catch(t){console.error("missing emote ".concat(e))}},d=1;d<=l.emotions.number;d++)f(d);(0,u.pickEmotion)(1)}return[4,(0,a.default)("".concat(s.AO_HOST,"characters/").concat(encodeURI(t.name.toLowerCase()),"/custom.gif"))];case 1:return o.sent()?document.getElementById("button_4").style.display="":document.getElementById("button_4").style.display="none",[2]}}))}))}},6310:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleRC=void 0;var r=n(6459),o=n(9585);t.handleRC=function(e){r.client.sender.sendSelf("SC#".concat(o.default.join("#"),"#%"))}},2014:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleRD=void 0;var r=n(6459);t.handleRD=function(e){r.client.sender.sendSelf("BN#gs4#%"),r.client.sender.sendSelf("DONE#%");var t=document.getElementById("client_ooclog");t.value="",t.readOnly=!1,document.getElementById("client_oocinput").style.display="none",document.getElementById("client_replaycontrols").style.display="inline-block"}},9122:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleRM=void 0;var r=n(6459),o=n(6246);t.handleRM=function(e){r.client.sender.sendSelf("SM#".concat(o.default.join("#"),"#%"))}},1912:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleRMC=void 0;var r=n(6459);t.handleRMC=function(e){r.client.viewport.music.pause();var t=r.client.viewport.music;t.totime=e[1],t.offset=(new Date).getTime()/1e3,t.addEventListener("loadedmetadata",(function(){t.currentTime+=parseFloat(t.totime+((new Date).getTime()/1e3-t.offset)).toFixed(3),t.play()}),!1)}},7124:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleRT=void 0;var r=n(6459),o=n(309);t.handleRT=function(e){var t=Number(e[2]);switch(e[1]){case"testimony1":r.client.testimonyID=1;break;case"testimony2":r.client.testimonyID=2;break;case"judgeruling":r.client.testimonyID=3+t;break;default:console.warn("Invalid testimony")}(0,o.initTestimonyUpdater)()}},8710:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]t.scrollHeight-60&&(t.scrollTop=t.scrollHeight),r.client.viewport.getSfxAudio().pause();var n=r.client.viewport.getSfxAudio().volume;r.client.viewport.getSfxAudio().volume=1,r.client.viewport.getSfxAudio().src="".concat(o.AO_HOST,"sounds/general/sfx-gallery.opus"),r.client.viewport.getSfxAudio().play(),r.client.viewport.getSfxAudio().volume=n}},9208:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleackMS=void 0;var r=n(2062);t.handleackMS=function(){(0,r.resetICParams)()}},6661:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleaskchaa=void 0;var r=n(6459),o=n(9585);t.handleaskchaa=function(e){r.client.sender.sendSelf("SI#".concat(o.default.length,"#0#0#%"))}},3453:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.packetHandler=void 0;var r=n(4592);t.packetHandler=new Map(Object.entries(r.packets))},4592:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.packets=void 0;var r=n(2639),o=n(3267),i=n(7247),a=n(1912),c=n(9209),u=n(8915),s=n(3699),l=n(2122),f=n(3770),d=n(8710),p=n(2781),h=n(3103),v=n(4629),y=n(9747),m=n(3765),g=n(6420),b=n(8631),w=n(872),_=n(8239),x=n(766),E=n(5649),S=n(2543),T=n(7124),C=n(3645),O=n(2371),L=n(5270),I=n(4142),k=n(8278),A=n(831),M=n(7207),j=n(6661),P=n(2685),B=n(6310),N=n(9122),R=n(2014),F=n(4914),V=n(358),H=n(1182),D=n(9208),G=n(9498),W=n(5944);t.packets={MS:r.handleMS,CT:o.handleCT,MC:i.handleMC,RMC:a.handleRMC,CI:p.handleCI,SC:d.handleSC,EI:f.handleEI,"2A":c.showFactorDialog,FL:u.handleFL,LE:s.handleLE,EM:l.handleEM,FM:h.handleFM,FA:v.handleFA,SM:y.handleSM,MM:m.handleMM,BD:g.handleBD,BB:b.handleBB,KB:w.handleKB,KK:_.handleKK,DONE:x.handleDONE,BN:E.handleBN,HP:S.handleHP,RT:T.handleRT,TI:C.handleTI,ZZ:O.handleZZ,HI:L.handleHI,ID:I.handleID,PN:k.handlePN,SI:A.handleSI,ARUP:M.handleARUP,askchaa:j.handleaskchaa,CC:P.handleCC,RC:B.handleRC,RM:N.handleRM,RD:R.handleRD,CharsCheck:F.handleCharsCheck,PV:V.handlePV,ASS:H.handleASS,ackMS:D.handleackMS,SP:G.handleSP,JD:W.handleJD,decryptor:function(){},CHECK:function(){},CH:function(){}}},4355:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=document.createElement("a"),r=new Blob([e],{type:"text"});n.href=URL.createObjectURL(r),n.download=t,n.click()}},2567:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0});var c=n(7659);t.default=function(e){var t="".concat(e,"themes/default/chat_config.ini"),n=(0,c.default)(t).then((function(e){return function(e){var t,n,r={},o="";try{for(var a=i(e.split(/\r?\n/)),c=a.next();!c.done;c=a.next()){var u=c.value;if(""!==u){var s=u.split(" = "),l=s[0],f=s[1];if(""===o)r[o=l]={color:f};else{var d=l.split("_")[1];r[o][d]=f}}else o=""}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r}(e)}));return{applyMarkdown:function(e,t){return r(void 0,void 0,void 0,(function(){var c,u,s,l,f,d,p,h,v,y,m,g,b,w,_,x,E,S,T;return o(this,(function(C){switch(C.label){case 0:return[4,r(void 0,void 0,void 0,(function(){var e,t,r,c,u,s,l,f,d,p;return o(this,(function(o){switch(o.label){case 0:e=new Map,o.label=1;case 1:return o.trys.push([1,6,7,8]),u=(c=Object).entries,[4,n];case 2:t=i.apply(void 0,[u.apply(c,[o.sent()])]),r=t.next(),o.label=3;case 3:if(r.done)return[3,5];(s=a(r.value,2))[0],(l=s[1]).start&&l.end&&(e.set(l.start,l),e.set(l.end,l)),o.label=4;case 4:return r=t.next(),[3,3];case 5:return[3,8];case 6:return f=o.sent(),d={error:f},[3,8];case 7:try{r&&!r.done&&(p=t.return)&&p.call(t)}finally{if(d)throw d.error}return[7];case 8:return[2,e]}}))}))];case 1:return c=C.sent(),[4,r(void 0,void 0,void 0,(function(){var e,t,r,c,u,s,l,f,d,p;return o(this,(function(o){switch(o.label){case 0:e=new Set,o.label=1;case 1:return o.trys.push([1,6,7,8]),u=(c=Object).entries,[4,n];case 2:t=i.apply(void 0,[u.apply(c,[o.sent()])]),r=t.next(),o.label=3;case 3:if(r.done)return[3,5];(s=a(r.value,2))[0],(null==(l=s[1])?void 0:l.start)&&(null==l?void 0:l.end)&&e.add(l.start),o.label=4;case 4:return r=t.next(),[3,3];case 5:return[3,8];case 6:return f=o.sent(),d={error:f},[3,8];case 7:try{r&&!r.done&&(p=t.return)&&p.call(t)}finally{if(d)throw d.error}return[7];case 8:return[2,e]}}))}))];case 2:u=C.sent(),s=[],l=[],f=[];try{for(d=i(e),p=d.next();!p.done;p=d.next())h=p.value,v=document.createElement("span"),y=c.get(h),m=s[s.length-1],g=0===Number(null==y?void 0:y.remove),m===h?(w=l[l.length-1][0],_=l[l.length-1][1],x=l[l.length-1][2],E="color: rgb(".concat(w,",").concat(_,",").concat(x,");"),v.setAttribute("style",E),s.pop(),l.pop(),g&&(v.innerHTML=h)):u.has(h)?(b=c.get(h).color.split(","),w=b[0],_=b[1],x=b[2],l.push([w,_,x]),s.push(y.end),E="color: rgb(".concat(w,",").concat(_,",").concat(x,");"),v.setAttribute("style",E),g&&(v.innerHTML=h)):(v.innerHTML=h,0===l.length?v.className="text_".concat(t):(w=l[l.length-1][0],_=l[l.length-1][1],x=l[l.length-1][2],E="color: rgb(".concat(w,",").concat(_,",").concat(x,");"),v.setAttribute("style",E))),f.push(v)}catch(e){S={error:e}}finally{try{p&&!p.done&&(T=d.return)&&T.call(d)}finally{if(S)throw S.error}}return[2,f]}}))}))}}}},5223:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){try{for(var t="".concat(e,"="),n=decodeURIComponent(document.cookie).split(";"),r=0;r0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.handle_ic_speaking=t.setStartThirdTickCheck=t.startThirdTickCheck=t.setStartSecondTickCheck=t.startSecondTickCheck=t.setStartFirstTickCheck=t.startFirstTickCheck=void 0;var a=n(6459),c=n(9442),u=n(5693),s=n(9028),l=n(989),f=n(2496),d=n(9980),p=n(3170),h=n(4923),v=n(8481),y=n(7635),m=(0,n(2567).default)(l.AO_HOST);t.setStartFirstTickCheck=function(e){t.startFirstTickCheck=e},t.setStartSecondTickCheck=function(e){t.startSecondTickCheck=e},t.setStartThirdTickCheck=function(e){t.startThirdTickCheck=e},t.handle_ic_speaking=function(e){return r(void 0,void 0,void 0,(function(){var n,r,g,b,w,_,x,E,S,T,C,O,L,I,k,A,M,j,P,B,N,R,F,V,H,D,G,W,Z;return o(this,(function(o){switch(o.label){case 0:return a.client.viewport.setChatmsg(e),a.client.viewport.setTextNow(""),a.client.viewport.setSfxPlayed(0),a.client.viewport.setTickTimer(0),a.client.viewport.setAnimating(!0),t.startFirstTickCheck=!0,t.startSecondTickCheck=!1,t.startThirdTickCheck=!1,n=document.getElementById("client_char"),r=document.getElementById("client_pair_char"),clearTimeout(a.client.viewport.updater),a.client.viewport.getSfxAudio().loop=!1,g=document.getElementById("client_fg"),b=document.getElementById("client_gamewindow"),w=document.getElementById("client_chatwaiting"),b.style.animation="",w.style.opacity="0",_=document.getElementById("client_evi"),a.client.viewport.getLastEvidence()!==a.client.viewport.getChatmsg().evidence&&(_.style.opacity="0",_.style.height="0%"),a.client.viewport.setLastEvidence(a.client.viewport.getChatmsg().evidence),["def","pro","wit"].includes(a.client.viewport.getChatmsg().side)&&(n=document.getElementById("client_".concat(a.client.viewport.getChatmsg().side,"_char")),r=document.getElementById("client_".concat(a.client.viewport.getChatmsg().side,"_pair_char"))),x=document.getElementById("client_chatcontainer"),E=document.getElementById("client_inner_name"),S=document.getElementById("client_inner_chat"),T=document.getElementById("showname").checked&&""!==a.client.viewport.getChatmsg().showname?a.client.viewport.getChatmsg().showname:a.client.viewport.getChatmsg().nameplate,S.innerText=a.client.viewport.getTextNow(),E.innerText=T,a.client.viewport.getLastCharacter()!==a.client.viewport.getChatmsg().name&&(n.style.opacity="0",r.style.opacity="0"),a.client.viewport.setLastCharacter(a.client.viewport.getChatmsg().name),(0,c.appendICLog)(a.client.viewport.getChatmsg().content,a.client.viewport.getChatmsg().showname,a.client.viewport.getChatmsg().nameplate),(0,u.checkCallword)(a.client.viewport.getChatmsg().content,a.client.viewport.getSfxAudio()),(0,s.default)(l.AO_HOST,a.client,a.client.viewport.getChatmsg().name.toLowerCase(),a.client.viewport.getChatmsg().sprite,"(a)",!1,a.client.viewport.getChatmsg().side),a.client.viewport.getChatmsg().other_name&&(0,s.default)(l.AO_HOST,a.client,a.client.viewport.getChatmsg().other_name.toLowerCase(),a.client.viewport.getChatmsg().other_emote,"(a)",!1,a.client.viewport.getChatmsg().side),C=document.getElementById("client_shout"),(O=f.SHOUTS[a.client.viewport.getChatmsg().objection])?(x.style.opacity="0",4===a.client.viewport.getChatmsg().objection?C.src="".concat(l.AO_HOST,"characters/").concat(encodeURI(a.client.viewport.getChatmsg().name.toLowerCase()),"/custom.gif"):(C.src=a.client.resources[O].src,C.style.animation="bubble 700ms steps(10, jump-both)"),C.style.opacity="1",a.client.viewport.shoutaudio.src="".concat(l.AO_HOST,"characters/").concat(encodeURI(a.client.viewport.getChatmsg().name.toLowerCase()),"/").concat(O,".opus"),a.client.viewport.shoutaudio.play(),a.client.viewport.setShoutTimer(a.client.resources[O].duration)):a.client.viewport.setShoutTimer(0),a.client.viewport.getChatmsg().startpreanim=!0,L=0,1!==a.client.viewport.getChatmsg().type||"-"===a.client.viewport.getChatmsg().preanim?[3,2]:(x.style.opacity="0",[4,(0,d.default)("".concat(l.AO_HOST,"characters/").concat(encodeURI(a.client.viewport.getChatmsg().name.toLowerCase()),"/").concat(encodeURI(a.client.viewport.getChatmsg().preanim)))]);case 1:return L=o.sent(),a.client.viewport.getChatmsg().startspeaking=!1,[3,3];case 2:a.client.viewport.getChatmsg().startspeaking=!0,""!==a.client.viewport.getChatmsg().content.trim()&&(x.style.opacity="1"),o.label=3;case 3:if(a.client.viewport.getChatmsg().preanimdelay=L,I={position:a.client.viewport.getChatmsg().side,showSpeedLines:!1,showDesk:!1},k=!1,5===a.client.viewport.getChatmsg().type)I.showSpeedLines=!0,I.showDesk=!1,a.client.viewport.set_side(I);else switch(Number(a.client.viewport.getChatmsg().deskmod)){case 0:case 2:case 3:I.showSpeedLines=!1,I.showDesk=!1,a.client.viewport.set_side(I);break;case 1:case 5:default:I.showSpeedLines=!1,I.showDesk=!0,a.client.viewport.set_side(I);break;case 4:I.showSpeedLines=!1,I.showDesk=!1,a.client.viewport.set_side(I),k=!0}if((0,p.setChatbox)(a.client.viewport.getChatmsg().chatbox),(0,h.resizeChatbox)(),!k){switch(n.style.transform=1===a.client.viewport.getChatmsg().flip?"scaleX(-1)":"scaleX(1)",r.style.transform=1===a.client.viewport.getChatmsg().other_flip?"scaleX(-1)":"scaleX(1)",a.client.viewport.getChatmsg().side){case"wit":r.style.left="".concat(200+Number(a.client.viewport.getChatmsg().other_offset[0]),"%"),n.style.left="".concat(200+Number(a.client.viewport.getChatmsg().self_offset[0]),"%");break;case"pro":r.style.left="".concat(400+Number(a.client.viewport.getChatmsg().other_offset[0]),"%"),n.style.left="".concat(400+Number(a.client.viewport.getChatmsg().self_offset[0]),"%");break;default:r.style.left="".concat(Number(a.client.viewport.getChatmsg().other_offset[0]),"%"),n.style.left="".concat(Number(a.client.viewport.getChatmsg().self_offset[0]),"%")}r.style.top="".concat(Number(a.client.viewport.getChatmsg().other_offset[1]),"%"),n.style.top="".concat(Number(a.client.viewport.getChatmsg().self_offset[1]),"%")}if(a.client.viewport.blipChannels.forEach((function(e){return e.src="".concat(l.AO_HOST,"sounds/blips/").concat(encodeURI(a.client.viewport.getChatmsg().blips.toLowerCase()),".opus")})),a.client.viewport.getChatmsg().content.startsWith("~~")?(S.style.textAlign="center",a.client.viewport.getChatmsg().content=a.client.viewport.getChatmsg().content.substring(2,a.client.viewport.getChatmsg().content.length)):S.style.textAlign="inherit",g.style.animation="",A=a.client.viewport.getChatmsg().effects[0].toLowerCase(),M=["","-","none"],A.startsWith("rain"))for(document.getElementById("effect_css").href="styles/effects/rain.css",j=200,A.endsWith("weak")?j=100:A.endsWith("strong")&&(j=400),j0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]=n.duration?R():e=setTimeout((function(){return N()}),a.UPDATE_INTERVAL):R()},R=function(){i.client.testimonyID=0,A=0,document.getElementById("client_testimony").style.opacity="0",clearTimeout(e)},F=function(e){return r(void 0,void 0,void 0,(function(){var t,a,u,l,f,d,p,h,v,y,m,g;return o(this,(function(E){switch(E.label){case 0:if(t=document.getElementById("client_chat"),a=document.getElementById("client_chatwaiting"),u=document.getElementById("client_inner_chat"),l=_.name.toLowerCase(),f=_.sprite.toLowerCase()," "!==_.content.charAt(M.length)&&(w[x].play(),x++,x%=w.length),M=_.content.substring(0,M.length+1),!(d=_.parsed[M.length-1]))return[3,3];if(p=_.parsed[M.length],h=function(){return r(void 0,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return e=document.getElementById("client_fg"),B("".concat(s.AO_HOST,"sounds/general/sfx-realization.opus"),!1),e.style.animation="flash 0.4s 1",[4,(0,i.delay)(400)];case 1:return t.sent(),e.style.removeProperty("animation"),[2]}}))}))},v=function(){return r(void 0,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return e=document.getElementById("client_gamewindow"),B("".concat(s.AO_HOST,"sounds/general/sfx-stab.opus"),!1),e.style.animation="shake 0.2s 1",[4,(0,i.delay)(200)];case 1:return t.sent(),e.style.removeProperty("animation"),[2]}}))}))},y=new Map(Object.entries({s:v,f:h})),new Set(["{","}"]).has(d.innerHTML))for(m=M.length;m<_.content.length;m++)if("}"===(g=_.parsed[m-1].innerHTML))_.speed>0&&(_.speed-=20);else{if("{"!==g){M=_.content.substring(0,m);break}_.speed<120&&(_.speed+=20)}return"\\"===d.innerHTML&&y.has(null==p?void 0:p.innerHTML)?(M=_.content.substring(0,M.length+1),[4,y.get(p.innerHTML)()]):[3,2];case 1:return E.sent(),[3,3];case 2:u.appendChild(_.parsed[M.length-1]),E.label=3;case 3:return t.scrollTop=t.scrollHeight,M===_.content&&(b=!1,(0,c.default)(s.AO_HOST,i.client,l,f,"(a)",!1,_.side),e.style.opacity="1",a.style.opacity="1",clearTimeout(n)),[2]}}))}))},V=function(){return r(void 0,void 0,void 0,(function(){var e,t,r,l,f,d,p,h,v,w,x,E,S,T,C,I;return o(this,(function(o){switch(o.label){case 0:return[4,(0,i.delay)(_.speed)];case 1:return o.sent(),M===_.content?[2]:(e=document.getElementById("client_gamewindow"),t=document.getElementById("client_chatwaiting"),r=document.getElementById("client_evi"),l=document.getElementById("client_shout"),f=document.getElementById("client_fg"),d=document.getElementById("client_inner_chat"),p=document.getElementById("client_char"),h=document.getElementById("client_pair_char"),["def","pro","wit"].includes(_.side)&&(p=document.getElementById("client_".concat(_.side,"_char")),h=document.getElementById("client_".concat(_.side,"_pair_char"))),v=_.name.toLowerCase(),w=_.sprite.toLowerCase(),x=_.other_name.toLowerCase(),E=_.other_emote.toLowerCase(),S=j>=L,T=j>=L+_.preanimdelay,S&&g.startFirstTickCheck&&(1===_.screenshake&&(B("".concat(s.AO_HOST,"sounds/general/sfx-stab.opus"),!1),e.style.animation="shake 0.2s 1"),1===_.flash&&(B("".concat(s.AO_HOST,"sounds/general/sfx-realization.opus"),!1),f.style.animation="flash 0.4s 1"),_.preanimdelay>0&&(l.style.opacity="0",l.style.animation="",C=_.preanim.toLowerCase(),(0,c.default)(s.AO_HOST,i.client,v,C,"",!1,_.side)),_.other_name?h.style.opacity="1":h.style.opacity="0",(0,g.setStartFirstTickCheck)(!1),(0,g.setStartSecondTickCheck)(!0),_.startpreanim=!1,_.startspeaking=!0),I=1===_.noninterrupting_preanim,M!==_.content&&I?(document.getElementById("client_chatcontainer").style.opacity="1",[4,F(p)]):[3,3]);case 2:return o.sent(),[3,6];case 3:if(!T||!g.startSecondTickCheck)return[3,6];if(!_.startspeaking)return[3,4];switch(_.startspeaking=!1,_.evidence>0&&(r.src=(0,u.safeTags)(i.client.evidences[_.evidence-1].icon),r.style.width="auto",r.style.height="36.5%",r.style.opacity="1",k.src="".concat(s.AO_HOST,"sounds/general/sfx-evidenceshoop.opus"),k.play(),"def"===_.side?(r.style.right="1em",r.style.left="initial"):(r.style.right="initial",r.style.left="1em")),d.className="text_".concat(y.COLORS[_.color]),0===_.preanimdelay&&(l.style.opacity="0",l.style.animation=""),Number(_.deskmod)){case 2:case 4:(0,m.set_side)({position:_.side,showSpeedLines:!1,showDesk:!0});break;case 3:case 5:(0,m.set_side)({position:_.side,showSpeedLines:!1,showDesk:!1})}return _.other_name?((0,c.default)(s.AO_HOST,i.client,x,E,"(a)",!0,_.side),h.style.opacity="1"):h.style.opacity="0",(0,c.default)(s.AO_HOST,i.client,v,w,"(b)",!1,_.side),p.style.opacity="1",M===_.content?((0,c.default)(s.AO_HOST,i.client,v,w,"(a)",!1,_.side),p.style.opacity="1",t.style.opacity="1",b=!1,clearTimeout(n),[2]):[3,6];case 4:return M===_.content?[3,6]:(document.getElementById("client_chatcontainer").style.opacity="1",[4,F(p)]);case 5:o.sent(),o.label=6;case 6:return!O&&_.snddelay+L>=j&&(O=1,"0"===_.sound||"1"===_.sound||""===_.sound||void 0===_.sound||1!=_.type&&2!=_.type&&6!=_.type||B("".concat(s.AO_HOST,"sounds/general/").concat(encodeURI(_.sound.toLowerCase()),".opus"),_.looping_sfx)),b&&V(),j+=a.UPDATE_INTERVAL,[2]}}))}))};return{getTextNow:function(){return M},setTextNow:function(e){M=e},getChatmsg:function(){return _},setChatmsg:function(e){_=e},getSfxPlayed:function(){return O},setSfxPlayed:function(e){O=e},setTickTimer:function(e){j=e},getTickTimer:function(){return j},setAnimating:function(e){b=e},getAnimating:function(){return b},getLastEvidence:function(){return S},setLastEvidence:function(e){S=e},setLastCharacter:function(e){E=e},getLastCharacter:function(){return E},getShoutTimer:function(){return L},setShoutTimer:function(e){L=e},setTheme:function(e){t=e},getTheme:function(){return t},setTestimonyTimer:function(e){A=e},getTestimonyTimer:function(){return A},setTestimonyUpdater:function(t){e=t},getTestimonyUpdater:function(){return e},testimonyAudio:k,chat_tick:V,playSFX:B,set_side:m.set_side,setBackgroundName:function(e){P=e},updateTestimony:N,disposeTestimony:R,handleTextTick:F,getBackgroundFolder:function(){return"".concat(s.AO_HOST,"background/").concat(encodeURI(P.toLowerCase()),"/")},getBackgroundName:function(){return P},getSfxAudio:function(){return C},setSfxAudio:function(e){C=e},blipChannels:w,music:T,musicVolume:0,shoutaudio:I,updater:n}}}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e].call(i.exports,i,i.exports,r),i.exports}r.m=t,e=[],r.O=function(t,n,o,i){if(!n){var a=1/0;for(l=0;l=i)&&Object.keys(r.O).every((function(e){return r.O[e](n[u])}))?n.splice(u--,1):(c=!1,i0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[n,o,i]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={47:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var o,i,a=n[0],c=n[1],u=n[2],s=0;if(a.some((function(t){return 0!==e[t]}))){for(o in c)r.o(c,o)&&(r.m[o]=c[o]);if(u)var l=u(r)}for(t&&t(n);s 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","export default [\n 'Anime',\n 'birthday',\n 'Christmas',\n 'CountyCourt',\n 'CruiseCourt',\n 'default',\n 'DGSEnglishCourt',\n 'DGSJapanCourt',\n 'DualDestinies',\n 'EnglishCourt',\n 'gs4',\n 'GS4Night',\n 'HD',\n \"Khura'in\",\n 'mlp',\n 'NewCourt',\n 'RuinedCourt',\n 'Sky',\n 'SpaceCourt',\n 'Themis',\n 'TouhouCourt',\n 'WitchTrialCourt',\n 'Zetta',\n];\n","export default [\n 'Adrian',\n 'Apollo',\n 'April',\n 'Armstrong',\n 'Atmey',\n 'Butz',\n 'Diego',\n 'Edgeworth',\n 'Edgeworthw',\n 'Ema',\n 'Emaskye',\n 'Franny',\n 'Franziska',\n 'Gant',\n 'Gavin',\n 'Gavin K',\n 'Godot',\n 'Gregory',\n 'Grossberg',\n 'Gumshoe',\n 'Gumshoey',\n 'Hawk',\n 'Hobo_Phoenix',\n 'Ini',\n 'Judge',\n \"Judge's Bro\",\n 'Klav',\n 'Klavier',\n 'Kristoph',\n 'Lana',\n 'Layton',\n 'Lotta',\n 'Luis',\n 'Maggey',\n 'Manfred',\n 'Marshall',\n 'Matt',\n 'Maya',\n 'Mia',\n 'Miles',\n 'Oldbag',\n 'Payne',\n 'Pearl',\n 'Phoenix',\n 'Valant',\n 'Vasquez',\n 'Wellington',\n 'Winston',\n 'Winstonpayne',\n 'Young Mia',\n 'Zak',\n];\n","export default [\n '1.png',\n '2.png',\n '3.png',\n '4.png',\n '5.png',\n '6.png',\n 'empty.png',\n 'lawyerbadge.png',\n];\n","export default [\n 'Announce The Truth (AA).opus',\n 'Announce The Truth (AJ).opus',\n 'Announce The Truth (JFA).opus',\n 'Announce The Truth (Miles).opus',\n 'Announce The Truth (T&T).opus',\n 'Confrontation ~ Presto 2009.opus',\n 'Crises of Fate.opus',\n 'Forgotten Legend.opus',\n 'Godot - The Fragrance of Dark Coffee.opus',\n 'Great Revival ~ Franziska von Karma.opus',\n 'Great Revival ~ Miles Edgeworth.opus',\n 'Hotline of Fate.opus',\n 'Interesting People.opus',\n 'Logic and Trick.opus',\n 'Luke Atmey ~ I Just Want Love.opus',\n 'Noisy People.opus',\n 'OBJECTION (AA).opus',\n 'Objection (AJ).opus',\n 'OBJECTION (JFA).opus',\n 'Objection (Miles).opus',\n 'OBJECTION (T&T).opus',\n 'Others ~ Guilty love.opus',\n 'Prelude (AA).opus',\n 'Prelude (AJ).opus',\n 'Prologue (AA).opus',\n 'Pursuit (AA) - variation.opus',\n 'Pursuit (AA).opus',\n 'Pursuit (AJ).opus',\n 'Pursuit (DS).opus',\n 'Pursuit (JFA) - variation.opus',\n 'Pursuit (JFA).opus',\n 'Pursuit (Miles).opus',\n 'Pursuit (T&T) - variation.opus',\n 'Pursuit (T&T).opus',\n 'Pursuit ~ I Want to Find the Truth (Orchestra).opus',\n 'Questioning AA (Allegro).opus',\n 'Questioning AA (Moderato).opus',\n 'Questioning AJ (Allegro).opus',\n 'Questioning AJ (Moderato).opus',\n 'Questioning JFA (Allegro).opus',\n 'Questioning JFA (Moderato).opus',\n 'Questioning T&T (Allegro).opus',\n 'Questioning T&T (Moderato).opus',\n 'Speak up Pup.opus',\n 'Suspense (AA).opus',\n 'The Great Truth Burglar.opus',\n 'Trial (AA).opus',\n 'Trial (AJ).opus',\n 'Trial (Miles).opus',\n];\n","export default 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';\n","import setCookie from '../utils/setCookie.ts';\n\n/**\n * Triggered by the sound effect volume slider.\n */\n\nexport function changeSFXVolume() {\n setCookie('sfxVolume', document.getElementById('client_sfxaudio').volume);\n}\nwindow.changeSFXVolume = changeSFXVolume;\n\n/**\n * Triggered by the testimony volume slider.\n */\nexport function changeTestimonyVolume() {\n setCookie('testimonyVolume', document.getElementById('client_testimonyaudio').volume);\n}\nwindow.changeTestimonyVolume = changeTestimonyVolume;\n\n/**\n * Triggered by the shout volume slider.\n */\n\nexport function changeShoutVolume() {\n setCookie('shoutVolume', document.getElementById('client_shoutaudio').volume);\n}\nwindow.changeShoutVolume = changeShoutVolume;\n","const regexPatterns = {\n section: /^\\s*\\[\\s*([^\\]]*)\\s*\\]\\s*$/,\n param: /^\\s*([\\w.\\-_]+)\\s*=\\s*(.*?)\\s*$/,\n comment: /^\\s*;.*$/,\n};\n\nconst valueHandler = (matchKey, matchValue) => (matchKey === 'showname' ? matchValue : matchValue.toLowerCase());\n\nconst lineFilter = (value) => {\n const isEmpty = value.length === 0;\n const isComment = regexPatterns.comment.test(value);\n if (isComment || isEmpty) {\n return false;\n }\n return true;\n};\n\nconst iniParse = (data) => {\n const parsedIni = {};\n const lines = data.split(/\\r\\n|\\r|\\n/);\n const filteredLines = lines.filter(lineFilter);\n\n let currentSection;\n filteredLines.forEach((line) => {\n const isParameter = regexPatterns.param.test(line);\n const isSection = regexPatterns.section.test(line);\n if (isParameter && currentSection) {\n const match = line.match(regexPatterns.param);\n const matchKey = match[1].toLowerCase();\n const matchValue = match[2];\n parsedIni[currentSection][matchKey] = valueHandler(matchKey, matchValue);\n } else if (isSection) {\n const match = line.match(regexPatterns.section);\n const matchKey = match[1].toLowerCase();\n parsedIni[matchKey] = {};\n currentSection = matchKey;\n }\n });\n return parsedIni;\n};\n\nexport default iniParse;\n","/**\n * Make a GET request for a specific URI.\n * @param {string} url the URI to be requested\n * @returns response data\n * @throws {Error} if status code is not 2xx, or a network error occurs\n */\nexport async function requestBuffer(url) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.responseType = 'arraybuffer';\n xhr.addEventListener('error', () => {\n const err = new Error(`Request for ${url} failed: ${xhr.statusText}`);\n err.code = xhr.status;\n reject(err);\n });\n xhr.addEventListener('abort', () => {\n const err = new Error(`Request for ${url} was aborted!`);\n err.code = xhr.status;\n reject(err);\n });\n xhr.addEventListener('load', () => {\n if (xhr.status < 200 || xhr.status >= 300) {\n const err = new Error(`Request for ${url} failed with status code ${xhr.status}`);\n err.code = xhr.status;\n reject(err);\n } else {\n resolve(xhr.response);\n }\n });\n xhr.open('GET', url, true);\n xhr.send();\n });\n}\n\n/**\n * Make a GET request for a specific URI.\n * @param {string} url the URI to be requested\n * @returns response data\n * @throws {Error} if status code is not 2xx, or a network error occurs\n */\nexport const request = async (url) => new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.responseType = 'text';\n xhr.addEventListener('error', () => {\n const err = new Error(`Request for ${url} failed: ${xhr.statusText}`);\n err.code = xhr.status;\n reject(err);\n });\n xhr.addEventListener('abort', () => {\n const err = new Error(`Request for ${url} was aborted!`);\n err.code = xhr.status;\n reject(err);\n });\n xhr.addEventListener('load', () => {\n if (xhr.status < 200 || xhr.status >= 300) {\n const err = new Error(`Request for ${url} failed with status code ${xhr.status}`);\n err.code = xhr.status;\n reject(err);\n } else {\n resolve(xhr.response);\n }\n });\n xhr.open('GET', url, true);\n xhr.send();\n});\nexport default request;\n","export default [\n 'aa',\n 'acww',\n 'dd',\n 'dgs',\n 'plvsaa',\n 'trilogy',\n 'future',\n 'legacy',\n 'ddlc',\n 'dr1',\n 'dr2',\n 'drv3',\n 'drae',\n 'p3',\n 'p4',\n 'p5',\n '999',\n 'halla',\n 'homestuck',\n 'key',\n 'sonic',\n 'yakuza',\n 'yttd',\n 'whentheycry',\n 'n64zelda',\n 'papermario',\n];\n","const fileExists = async (url) => new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open('HEAD', url);\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n resolve(true);\n } else {\n resolve(false);\n }\n }\n };\n xhr.onerror = function (e) {\n resolve(false);\n };\n xhr.send(null);\n});\nexport default fileExists;\n","import calculateGifLength from './calculateGifLength';\nimport calculateWebpLength from './calculateWebpLength';\nimport calculateApngLength from './calculateApngLength';\n\nexport default {\n '.gif': calculateGifLength,\n '.webp': calculateWebpLength,\n '.apng': calculateApngLength,\n};\n","/**\n * Adds up the frame delays to find out how long a GIF is\n * I totally didn't steal this\n * @param {data} gifFile the GIF data\n */\nconst calculateGifLength = (gifFile) => {\n const d = new Uint8Array(gifFile);\n // Thanks to http://justinsomnia.org/2006/10/gif-animation-duration-calculation/\n // And http://www.w3.org/Graphics/GIF/spec-gif89a.txt\n let duration = 0;\n for (let i = 0; i < d.length; i++) {\n // Find a Graphic Control Extension hex(21F904__ ____ __00)\n if (d[i] === 0x21\n && d[i + 1] === 0xF9\n && d[i + 2] === 0x04\n && d[i + 7] === 0x00) {\n // Swap 5th and 6th bytes to get the delay per frame\n const delay = (d[i + 5] << 8) | (d[i + 4] & 0xFF);\n\n // Should be aware browsers have a minimum frame delay\n // e.g. 6ms for IE, 2ms modern browsers (50fps)\n duration += delay < 2 ? 10 : delay;\n }\n }\n return duration * 10;\n};\nexport default calculateGifLength;\n","const calculateWebpLength = (webpFile) => {\n const d = new Uint8Array(webpFile);\n // https://developers.google.com/speed/webp/docs/riff_container#animation\n let duration = 0;\n for (let i = 0; i < d.length; i++) {\n // Find ANMF header (41 4E 4D 46)\n if (d[i] === 0x41\n && d[i + 1] === 0x4E\n && d[i + 2] === 0x4D\n && d[i + 3] === 0x46) {\n // Swap 5th and 6th bytes to get the delay per frame\n const delay = (d[i + 21] << 8) | (d[i + 20] & 0xFF);\n\n // Should be aware browsers have a minimum frame delay\n // e.g. 6ms for IE, 2ms modern browsers (50fps)\n duration += delay < 2 ? 10 : delay;\n }\n }\n return duration;\n};\n\nexport default calculateWebpLength;\n","/**\n * Adds up the chunk delays to find out how long a APNG is\n * @param {data} apngFile the APNG data\n */\nconst calculateApngLength = (apngFile) => {\n const d = new Uint8Array(apngFile);\n // https://wiki.mozilla.org/APNG_Specification#.60fcTL.60:_The_Frame_Control_Chunk\n let duration = 0;\n for (let i = 0; i < d.length; i++) {\n // Find fcTL header (66 63 54 4C)\n if (d[i] === 0x66\n && d[i + 1] === 0x63\n && d[i + 2] === 0x54\n && d[i + 3] === 0x4C) {\n // numerator and denominator\n const delayNum = Number(d[i + 23]);\n const delayDen = Number(d[i + 25]);\n let delay;\n // minimum is 100ms\n if (delayDen === 0)\n delay = delayNum / 100;\n else\n delay = delayNum / delayDen;\n\n duration += delay;\n }\n }\n return duration * 10;\n};\nexport default calculateApngLength;\n","import calculatorHandler from './calculatorHandler';\nimport fileExists from './fileExists';\nimport { requestBuffer } from '../services/request';\n/**\n * Gets animation length. If the animation cannot be found, it will\n * silently fail and return 0 instead.\n * @param {string} filename the animation file name\n */\n\nconst getAnimLength = async (url) => {\n const extensions = ['.gif', '.webp', '.apng'];\n for (const extension of extensions) {\n const urlWithExtension = url + extension;\n const exists = await fileExists(urlWithExtension);\n if (exists) {\n const fileBuffer = await requestBuffer(urlWithExtension);\n const length = calculatorHandler[extension](fileBuffer);\n return length;\n }\n }\n return 0;\n};\nexport default getAnimLength;\n","const getResources = (AO_HOST, THEME) => ({\n holdit: {\n src: `${AO_HOST}misc/default/holdit_bubble.png`,\n duration: 720,\n },\n objection: {\n src: `${AO_HOST}misc/default/objection_bubble.png`,\n duration: 720,\n },\n takethat: {\n src: `${AO_HOST}misc/default/takethat_bubble.png`,\n duration: 840,\n },\n custom: {\n src: '',\n duration: 840,\n },\n witnesstestimony: {\n src: `${AO_HOST}themes/${THEME}/witnesstestimony_bubble.gif`,\n duration: 1560,\n sfx: `${AO_HOST}sounds/general/sfx-testimony.opus`,\n },\n crossexamination: {\n src: `${AO_HOST}themes/${THEME}/crossexamination_bubble.gif`,\n duration: 1600,\n sfx: `${AO_HOST}sounds/general/sfx-testimony2.opus`,\n },\n guilty: {\n src: `${AO_HOST}themes/${THEME}/guilty_bubble.gif`,\n duration: 2870,\n sfx: `${AO_HOST}sounds/general/sfx-guilty.opus`,\n },\n notguilty: {\n src: `${AO_HOST}themes/${THEME}/notguilty_bubble.gif`,\n duration: 2440,\n sfx: `${AO_HOST}sounds/general/sfx-notguilty.opus`,\n },\n});\nexport default getResources;\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","/**\n * FingerprintJS v3.4.2 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com)\n * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.\n *\n * This software contains code from open-source projects:\n * MurmurHash3 by Karan Lyons (https://github.com/karanlyons/murmurHash3.js)\n */\n\nimport { __awaiter, __generator, __assign, __spreadArray } from 'tslib';\n\nvar version = \"3.4.2\";\n\nfunction wait(durationMs, resolveWith) {\n return new Promise(function (resolve) { return setTimeout(resolve, durationMs, resolveWith); });\n}\nfunction requestIdleCallbackIfAvailable(fallbackTimeout, deadlineTimeout) {\n if (deadlineTimeout === void 0) { deadlineTimeout = Infinity; }\n var requestIdleCallback = window.requestIdleCallback;\n if (requestIdleCallback) {\n // The function `requestIdleCallback` loses the binding to `window` here.\n // `globalThis` isn't always equal `window` (see https://github.com/fingerprintjs/fingerprintjs/issues/683).\n // Therefore, an error can occur. `call(window,` prevents the error.\n return new Promise(function (resolve) { return requestIdleCallback.call(window, function () { return resolve(); }, { timeout: deadlineTimeout }); });\n }\n else {\n return wait(Math.min(fallbackTimeout, deadlineTimeout));\n }\n}\nfunction isPromise(value) {\n return !!value && typeof value.then === 'function';\n}\n/**\n * Calls a maybe asynchronous function without creating microtasks when the function is synchronous.\n * Catches errors in both cases.\n *\n * If just you run a code like this:\n * ```\n * console.time('Action duration')\n * await action()\n * console.timeEnd('Action duration')\n * ```\n * The synchronous function time can be measured incorrectly because another microtask may run before the `await`\n * returns the control back to the code.\n */\nfunction awaitIfAsync(action, callback) {\n try {\n var returnedValue = action();\n if (isPromise(returnedValue)) {\n returnedValue.then(function (result) { return callback(true, result); }, function (error) { return callback(false, error); });\n }\n else {\n callback(true, returnedValue);\n }\n }\n catch (error) {\n callback(false, error);\n }\n}\n/**\n * If you run many synchronous tasks without using this function, the JS main loop will be busy and asynchronous tasks\n * (e.g. completing a network request, rendering the page) won't be able to happen.\n * This function allows running many synchronous tasks such way that asynchronous tasks can run too in background.\n */\nfunction mapWithBreaks(items, callback, loopReleaseInterval) {\n if (loopReleaseInterval === void 0) { loopReleaseInterval = 16; }\n return __awaiter(this, void 0, void 0, function () {\n var results, lastLoopReleaseTime, i, now;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n results = Array(items.length);\n lastLoopReleaseTime = Date.now();\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < items.length)) return [3 /*break*/, 4];\n results[i] = callback(items[i], i);\n now = Date.now();\n if (!(now >= lastLoopReleaseTime + loopReleaseInterval)) return [3 /*break*/, 3];\n lastLoopReleaseTime = now;\n // Allows asynchronous actions and microtasks to happen\n return [4 /*yield*/, wait(0)];\n case 2:\n // Allows asynchronous actions and microtasks to happen\n _a.sent();\n _a.label = 3;\n case 3:\n ++i;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/, results];\n }\n });\n });\n}\n/**\n * Makes the given promise never emit an unhandled promise rejection console warning.\n * The promise will still pass errors to the next promises.\n *\n * Otherwise, promise emits a console warning unless it has a `catch` listener.\n */\nfunction suppressUnhandledRejectionWarning(promise) {\n promise.then(undefined, function () { return undefined; });\n}\n\n/*\n * Taken from https://github.com/karanlyons/murmurHash3.js/blob/a33d0723127e2e5415056c455f8aed2451ace208/murmurHash3.js\n */\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// added together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Add(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] + n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] + n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] + n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] + n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// multiplied together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Multiply(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] * n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] * n[3];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[2] += m[3] * n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] * n[3];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[2] * n[2];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[3] * n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] * n[3] + m[1] * n[2] + m[2] * n[1] + m[3] * n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}\n//\n// Given a 64bit int (as an array of two 32bit ints) and an int\n// representing a number of bit positions, returns the 64bit int (as an\n// array of two 32bit ints) rotated left by that number of positions.\n//\nfunction x64Rotl(m, n) {\n n %= 64;\n if (n === 32) {\n return [m[1], m[0]];\n }\n else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))];\n }\n else {\n n -= 32;\n return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))];\n }\n}\n//\n// Given a 64bit int (as an array of two 32bit ints) and an int\n// representing a number of bit positions, returns the 64bit int (as an\n// array of two 32bit ints) shifted left by that number of positions.\n//\nfunction x64LeftShift(m, n) {\n n %= 64;\n if (n === 0) {\n return m;\n }\n else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n];\n }\n else {\n return [m[1] << (n - 32), 0];\n }\n}\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// xored together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Xor(m, n) {\n return [m[0] ^ n[0], m[1] ^ n[1]];\n}\n//\n// Given a block, returns murmurHash3's final x64 mix of that block.\n// (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the\n// only place where we need to right shift 64bit ints.)\n//\nfunction x64Fmix(h) {\n h = x64Xor(h, [0, h[0] >>> 1]);\n h = x64Multiply(h, [0xff51afd7, 0xed558ccd]);\n h = x64Xor(h, [0, h[0] >>> 1]);\n h = x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]);\n h = x64Xor(h, [0, h[0] >>> 1]);\n return h;\n}\n//\n// Given a string and an optional seed as an int, returns a 128 bit\n// hash using the x64 flavor of MurmurHash3, as an unsigned hex.\n//\nfunction x64hash128(key, seed) {\n key = key || '';\n seed = seed || 0;\n var remainder = key.length % 16;\n var bytes = key.length - remainder;\n var h1 = [0, seed];\n var h2 = [0, seed];\n var k1 = [0, 0];\n var k2 = [0, 0];\n var c1 = [0x87c37b91, 0x114253d5];\n var c2 = [0x4cf5ad43, 0x2745937f];\n var i;\n for (i = 0; i < bytes; i = i + 16) {\n k1 = [\n (key.charCodeAt(i + 4) & 0xff) |\n ((key.charCodeAt(i + 5) & 0xff) << 8) |\n ((key.charCodeAt(i + 6) & 0xff) << 16) |\n ((key.charCodeAt(i + 7) & 0xff) << 24),\n (key.charCodeAt(i) & 0xff) |\n ((key.charCodeAt(i + 1) & 0xff) << 8) |\n ((key.charCodeAt(i + 2) & 0xff) << 16) |\n ((key.charCodeAt(i + 3) & 0xff) << 24),\n ];\n k2 = [\n (key.charCodeAt(i + 12) & 0xff) |\n ((key.charCodeAt(i + 13) & 0xff) << 8) |\n ((key.charCodeAt(i + 14) & 0xff) << 16) |\n ((key.charCodeAt(i + 15) & 0xff) << 24),\n (key.charCodeAt(i + 8) & 0xff) |\n ((key.charCodeAt(i + 9) & 0xff) << 8) |\n ((key.charCodeAt(i + 10) & 0xff) << 16) |\n ((key.charCodeAt(i + 11) & 0xff) << 24),\n ];\n k1 = x64Multiply(k1, c1);\n k1 = x64Rotl(k1, 31);\n k1 = x64Multiply(k1, c2);\n h1 = x64Xor(h1, k1);\n h1 = x64Rotl(h1, 27);\n h1 = x64Add(h1, h2);\n h1 = x64Add(x64Multiply(h1, [0, 5]), [0, 0x52dce729]);\n k2 = x64Multiply(k2, c2);\n k2 = x64Rotl(k2, 33);\n k2 = x64Multiply(k2, c1);\n h2 = x64Xor(h2, k2);\n h2 = x64Rotl(h2, 31);\n h2 = x64Add(h2, h1);\n h2 = x64Add(x64Multiply(h2, [0, 5]), [0, 0x38495ab5]);\n }\n k1 = [0, 0];\n k2 = [0, 0];\n switch (remainder) {\n case 15:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 14)], 48));\n // fallthrough\n case 14:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 13)], 40));\n // fallthrough\n case 13:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 12)], 32));\n // fallthrough\n case 12:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 11)], 24));\n // fallthrough\n case 11:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 10)], 16));\n // fallthrough\n case 10:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 9)], 8));\n // fallthrough\n case 9:\n k2 = x64Xor(k2, [0, key.charCodeAt(i + 8)]);\n k2 = x64Multiply(k2, c2);\n k2 = x64Rotl(k2, 33);\n k2 = x64Multiply(k2, c1);\n h2 = x64Xor(h2, k2);\n // fallthrough\n case 8:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 7)], 56));\n // fallthrough\n case 7:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 6)], 48));\n // fallthrough\n case 6:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 5)], 40));\n // fallthrough\n case 5:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 4)], 32));\n // fallthrough\n case 4:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 3)], 24));\n // fallthrough\n case 3:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 2)], 16));\n // fallthrough\n case 2:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 1)], 8));\n // fallthrough\n case 1:\n k1 = x64Xor(k1, [0, key.charCodeAt(i)]);\n k1 = x64Multiply(k1, c1);\n k1 = x64Rotl(k1, 31);\n k1 = x64Multiply(k1, c2);\n h1 = x64Xor(h1, k1);\n // fallthrough\n }\n h1 = x64Xor(h1, [0, key.length]);\n h2 = x64Xor(h2, [0, key.length]);\n h1 = x64Add(h1, h2);\n h2 = x64Add(h2, h1);\n h1 = x64Fmix(h1);\n h2 = x64Fmix(h2);\n h1 = x64Add(h1, h2);\n h2 = x64Add(h2, h1);\n return (('00000000' + (h1[0] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h1[1] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h2[0] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h2[1] >>> 0).toString(16)).slice(-8));\n}\n\n/**\n * Converts an error object to a plain object that can be used with `JSON.stringify`.\n * If you just run `JSON.stringify(error)`, you'll get `'{}'`.\n */\nfunction errorToObject(error) {\n var _a;\n return __assign({ name: error.name, message: error.message, stack: (_a = error.stack) === null || _a === void 0 ? void 0 : _a.split('\\n') }, error);\n}\n\n/*\n * This file contains functions to work with pure data only (no browser features, DOM, side effects, etc).\n */\n/**\n * Does the same as Array.prototype.includes but has better typing\n */\nfunction includes(haystack, needle) {\n for (var i = 0, l = haystack.length; i < l; ++i) {\n if (haystack[i] === needle) {\n return true;\n }\n }\n return false;\n}\n/**\n * Like `!includes()` but with proper typing\n */\nfunction excludes(haystack, needle) {\n return !includes(haystack, needle);\n}\n/**\n * Be careful, NaN can return\n */\nfunction toInt(value) {\n return parseInt(value);\n}\n/**\n * Be careful, NaN can return\n */\nfunction toFloat(value) {\n return parseFloat(value);\n}\nfunction replaceNaN(value, replacement) {\n return typeof value === 'number' && isNaN(value) ? replacement : value;\n}\nfunction countTruthy(values) {\n return values.reduce(function (sum, value) { return sum + (value ? 1 : 0); }, 0);\n}\nfunction round(value, base) {\n if (base === void 0) { base = 1; }\n if (Math.abs(base) >= 1) {\n return Math.round(value / base) * base;\n }\n else {\n // Sometimes when a number is multiplied by a small number, precision is lost,\n // for example 1234 * 0.0001 === 0.12340000000000001, and it's more precise divide: 1234 / (1 / 0.0001) === 0.1234.\n var counterBase = 1 / base;\n return Math.round(value * counterBase) / counterBase;\n }\n}\n/**\n * Parses a CSS selector into tag name with HTML attributes.\n * Only single element selector are supported (without operators like space, +, >, etc).\n *\n * Multiple values can be returned for each attribute. You decide how to handle them.\n */\nfunction parseSimpleCssSelector(selector) {\n var _a, _b;\n var errorMessage = \"Unexpected syntax '\".concat(selector, \"'\");\n var tagMatch = /^\\s*([a-z-]*)(.*)$/i.exec(selector);\n var tag = tagMatch[1] || undefined;\n var attributes = {};\n var partsRegex = /([.:#][\\w-]+|\\[.+?\\])/gi;\n var addAttribute = function (name, value) {\n attributes[name] = attributes[name] || [];\n attributes[name].push(value);\n };\n for (;;) {\n var match = partsRegex.exec(tagMatch[2]);\n if (!match) {\n break;\n }\n var part = match[0];\n switch (part[0]) {\n case '.':\n addAttribute('class', part.slice(1));\n break;\n case '#':\n addAttribute('id', part.slice(1));\n break;\n case '[': {\n var attributeMatch = /^\\[([\\w-]+)([~|^$*]?=(\"(.*?)\"|([\\w-]+)))?(\\s+[is])?\\]$/.exec(part);\n if (attributeMatch) {\n addAttribute(attributeMatch[1], (_b = (_a = attributeMatch[4]) !== null && _a !== void 0 ? _a : attributeMatch[5]) !== null && _b !== void 0 ? _b : '');\n }\n else {\n throw new Error(errorMessage);\n }\n break;\n }\n default:\n throw new Error(errorMessage);\n }\n }\n return [tag, attributes];\n}\n\nfunction ensureErrorWithMessage(error) {\n return error && typeof error === 'object' && 'message' in error ? error : { message: error };\n}\nfunction isFinalResultLoaded(loadResult) {\n return typeof loadResult !== 'function';\n}\n/**\n * Loads the given entropy source. Returns a function that gets an entropy component from the source.\n *\n * The result is returned synchronously to prevent `loadSources` from\n * waiting for one source to load before getting the components from the other sources.\n */\nfunction loadSource(source, sourceOptions) {\n var sourceLoadPromise = new Promise(function (resolveLoad) {\n var loadStartTime = Date.now();\n // `awaitIfAsync` is used instead of just `await` in order to measure the duration of synchronous sources\n // correctly (other microtasks won't affect the duration).\n awaitIfAsync(source.bind(null, sourceOptions), function () {\n var loadArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n loadArgs[_i] = arguments[_i];\n }\n var loadDuration = Date.now() - loadStartTime;\n // Source loading failed\n if (!loadArgs[0]) {\n return resolveLoad(function () { return ({ error: ensureErrorWithMessage(loadArgs[1]), duration: loadDuration }); });\n }\n var loadResult = loadArgs[1];\n // Source loaded with the final result\n if (isFinalResultLoaded(loadResult)) {\n return resolveLoad(function () { return ({ value: loadResult, duration: loadDuration }); });\n }\n // Source loaded with \"get\" stage\n resolveLoad(function () {\n return new Promise(function (resolveGet) {\n var getStartTime = Date.now();\n awaitIfAsync(loadResult, function () {\n var getArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n getArgs[_i] = arguments[_i];\n }\n var duration = loadDuration + Date.now() - getStartTime;\n // Source getting failed\n if (!getArgs[0]) {\n return resolveGet({ error: ensureErrorWithMessage(getArgs[1]), duration: duration });\n }\n // Source getting succeeded\n resolveGet({ value: getArgs[1], duration: duration });\n });\n });\n });\n });\n });\n suppressUnhandledRejectionWarning(sourceLoadPromise);\n return function getComponent() {\n return sourceLoadPromise.then(function (finalizeSource) { return finalizeSource(); });\n };\n}\n/**\n * Loads the given entropy sources. Returns a function that collects the entropy components.\n *\n * The result is returned synchronously in order to allow start getting the components\n * before the sources are loaded completely.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction loadSources(sources, sourceOptions, excludeSources) {\n var includedSources = Object.keys(sources).filter(function (sourceKey) { return excludes(excludeSources, sourceKey); });\n // Using `mapWithBreaks` allows asynchronous sources to complete between synchronous sources\n // and measure the duration correctly\n var sourceGettersPromise = mapWithBreaks(includedSources, function (sourceKey) {\n return loadSource(sources[sourceKey], sourceOptions);\n });\n suppressUnhandledRejectionWarning(sourceGettersPromise);\n return function getComponents() {\n return __awaiter(this, void 0, void 0, function () {\n var sourceGetters, componentPromises, componentArray, components, index;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, sourceGettersPromise];\n case 1:\n sourceGetters = _a.sent();\n return [4 /*yield*/, mapWithBreaks(sourceGetters, function (sourceGetter) {\n var componentPromise = sourceGetter();\n suppressUnhandledRejectionWarning(componentPromise);\n return componentPromise;\n })];\n case 2:\n componentPromises = _a.sent();\n return [4 /*yield*/, Promise.all(componentPromises)\n // Keeping the component keys order the same as the source keys order\n ];\n case 3:\n componentArray = _a.sent();\n components = {};\n for (index = 0; index < includedSources.length; ++index) {\n components[includedSources[index]] = componentArray[index];\n }\n return [2 /*return*/, components];\n }\n });\n });\n };\n}\n/**\n * Modifies an entropy source by transforming its returned value with the given function.\n * Keeps the source properties: sync/async, 1/2 stages.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction transformSource(source, transformValue) {\n var transformLoadResult = function (loadResult) {\n if (isFinalResultLoaded(loadResult)) {\n return transformValue(loadResult);\n }\n return function () {\n var getResult = loadResult();\n if (isPromise(getResult)) {\n return getResult.then(transformValue);\n }\n return transformValue(getResult);\n };\n };\n return function (options) {\n var loadResult = source(options);\n if (isPromise(loadResult)) {\n return loadResult.then(transformLoadResult);\n }\n return transformLoadResult(loadResult);\n };\n}\n\n/*\n * Functions to help with features that vary through browsers\n */\n/**\n * Checks whether the browser is based on Trident (the Internet Explorer engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isTrident() {\n var w = window;\n var n = navigator;\n // The properties are checked to be in IE 10, IE 11 and not to be in other browsers in October 2020\n return (countTruthy([\n 'MSCSSMatrix' in w,\n 'msSetImmediate' in w,\n 'msIndexedDB' in w,\n 'msMaxTouchPoints' in n,\n 'msPointerEnabled' in n,\n ]) >= 4);\n}\n/**\n * Checks whether the browser is based on EdgeHTML (the pre-Chromium Edge engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isEdgeHTML() {\n // Based on research in October 2020\n var w = window;\n var n = navigator;\n return (countTruthy(['msWriteProfilerMark' in w, 'MSStream' in w, 'msLaunchUri' in n, 'msSaveBlob' in n]) >= 3 &&\n !isTrident());\n}\n/**\n * Checks whether the browser is based on Chromium without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isChromium() {\n // Based on research in October 2020. Tested to detect Chromium 42-86.\n var w = window;\n var n = navigator;\n return (countTruthy([\n 'webkitPersistentStorage' in n,\n 'webkitTemporaryStorage' in n,\n n.vendor.indexOf('Google') === 0,\n 'webkitResolveLocalFileSystemURL' in w,\n 'BatteryManager' in w,\n 'webkitMediaStream' in w,\n 'webkitSpeechGrammar' in w,\n ]) >= 5);\n}\n/**\n * Checks whether the browser is based on mobile or desktop Safari without using user-agent.\n * All iOS browsers use WebKit (the Safari engine).\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isWebKit() {\n // Based on research in September 2020\n var w = window;\n var n = navigator;\n return (countTruthy([\n 'ApplePayError' in w,\n 'CSSPrimitiveValue' in w,\n 'Counter' in w,\n n.vendor.indexOf('Apple') === 0,\n 'getStorageUpdates' in n,\n 'WebKitMediaKeys' in w,\n ]) >= 4);\n}\n/**\n * Checks whether the WebKit browser is a desktop Safari.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isDesktopSafari() {\n var w = window;\n return (countTruthy([\n 'safari' in w,\n !('DeviceMotionEvent' in w),\n !('ongestureend' in w),\n !('standalone' in navigator),\n ]) >= 3);\n}\n/**\n * Checks whether the browser is based on Gecko (Firefox engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isGecko() {\n var _a, _b;\n var w = window;\n // Based on research in September 2020\n return (countTruthy([\n 'buildID' in navigator,\n 'MozAppearance' in ((_b = (_a = document.documentElement) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {}),\n 'onmozfullscreenchange' in w,\n 'mozInnerScreenX' in w,\n 'CSSMozDocumentRule' in w,\n 'CanvasCaptureMediaStream' in w,\n ]) >= 4);\n}\n/**\n * Checks whether the browser is based on Chromium version ≥86 without using user-agent.\n * It doesn't check that the browser is based on Chromium, there is a separate function for this.\n */\nfunction isChromium86OrNewer() {\n // Checked in Chrome 85 vs Chrome 86 both on desktop and Android\n var w = window;\n return (countTruthy([\n !('MediaSettingsRange' in w),\n 'RTCEncodedAudioFrame' in w,\n '' + w.Intl === '[object Intl]',\n '' + w.Reflect === '[object Reflect]',\n ]) >= 3);\n}\n/**\n * Checks whether the browser is based on WebKit version ≥606 (Safari ≥12) without using user-agent.\n * It doesn't check that the browser is based on WebKit, there is a separate function for this.\n *\n * @link https://en.wikipedia.org/wiki/Safari_version_history#Release_history Safari-WebKit versions map\n */\nfunction isWebKit606OrNewer() {\n // Checked in Safari 9–14\n var w = window;\n return (countTruthy([\n 'DOMRectList' in w,\n 'RTCPeerConnectionIceEvent' in w,\n 'SVGGeometryElement' in w,\n 'ontransitioncancel' in w,\n ]) >= 3);\n}\n/**\n * Checks whether the device is an iPad.\n * It doesn't check that the engine is WebKit and that the WebKit isn't desktop.\n */\nfunction isIPad() {\n // Checked on:\n // Safari on iPadOS (both mobile and desktop modes): 8, 11, 12, 13, 14\n // Chrome on iPadOS (both mobile and desktop modes): 11, 12, 13, 14\n // Safari on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14\n // Chrome on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14\n // Before iOS 13. Safari tampers the value in \"request desktop site\" mode since iOS 13.\n if (navigator.platform === 'iPad') {\n return true;\n }\n var s = screen;\n var screenRatio = s.width / s.height;\n return (countTruthy([\n 'MediaSource' in window,\n !!Element.prototype.webkitRequestFullscreen,\n // iPhone 4S that runs iOS 9 matches this. But it won't match the criteria above, so it won't be detected as iPad.\n screenRatio > 0.65 && screenRatio < 1.53,\n ]) >= 2);\n}\n/**\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction getFullscreenElement() {\n var d = document;\n return d.fullscreenElement || d.msFullscreenElement || d.mozFullScreenElement || d.webkitFullscreenElement || null;\n}\nfunction exitFullscreen() {\n var d = document;\n // `call` is required because the function throws an error without a proper \"this\" context\n return (d.exitFullscreen || d.msExitFullscreen || d.mozCancelFullScreen || d.webkitExitFullscreen).call(d);\n}\n/**\n * Checks whether the device runs on Android without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isAndroid() {\n var isItChromium = isChromium();\n var isItGecko = isGecko();\n // Only 2 browser engines are presented on Android.\n // Actually, there is also Android 4.1 browser, but it's not worth detecting it at the moment.\n if (!isItChromium && !isItGecko) {\n return false;\n }\n var w = window;\n // Chrome removes all words \"Android\" from `navigator` when desktop version is requested\n // Firefox keeps \"Android\" in `navigator.appVersion` when desktop version is requested\n return (countTruthy([\n 'onorientationchange' in w,\n 'orientation' in w,\n isItChromium && !('SharedWorker' in w),\n isItGecko && /android/i.test(navigator.appVersion),\n ]) >= 2);\n}\n\n/**\n * A deep description: https://fingerprint.com/blog/audio-fingerprinting/\n * Inspired by and based on https://github.com/cozylife/audio-fingerprint\n */\nfunction getAudioFingerprint() {\n var w = window;\n var AudioContext = w.OfflineAudioContext || w.webkitOfflineAudioContext;\n if (!AudioContext) {\n return -2 /* SpecialFingerprint.NotSupported */;\n }\n // In some browsers, audio context always stays suspended unless the context is started in response to a user action\n // (e.g. a click or a tap). It prevents audio fingerprint from being taken at an arbitrary moment of time.\n // Such browsers are old and unpopular, so the audio fingerprinting is just skipped in them.\n // See a similar case explanation at https://stackoverflow.com/questions/46363048/onaudioprocess-not-called-on-ios11#46534088\n if (doesCurrentBrowserSuspendAudioContext()) {\n return -1 /* SpecialFingerprint.KnownToSuspend */;\n }\n var hashFromIndex = 4500;\n var hashToIndex = 5000;\n var context = new AudioContext(1, hashToIndex, 44100);\n var oscillator = context.createOscillator();\n oscillator.type = 'triangle';\n oscillator.frequency.value = 10000;\n var compressor = context.createDynamicsCompressor();\n compressor.threshold.value = -50;\n compressor.knee.value = 40;\n compressor.ratio.value = 12;\n compressor.attack.value = 0;\n compressor.release.value = 0.25;\n oscillator.connect(compressor);\n compressor.connect(context.destination);\n oscillator.start(0);\n var _a = startRenderingAudio(context), renderPromise = _a[0], finishRendering = _a[1];\n var fingerprintPromise = renderPromise.then(function (buffer) { return getHash(buffer.getChannelData(0).subarray(hashFromIndex)); }, function (error) {\n if (error.name === \"timeout\" /* InnerErrorName.Timeout */ || error.name === \"suspended\" /* InnerErrorName.Suspended */) {\n return -3 /* SpecialFingerprint.Timeout */;\n }\n throw error;\n });\n // Suppresses the console error message in case when the fingerprint fails before requested\n suppressUnhandledRejectionWarning(fingerprintPromise);\n return function () {\n finishRendering();\n return fingerprintPromise;\n };\n}\n/**\n * Checks if the current browser is known to always suspend audio context\n */\nfunction doesCurrentBrowserSuspendAudioContext() {\n return isWebKit() && !isDesktopSafari() && !isWebKit606OrNewer();\n}\n/**\n * Starts rendering the audio context.\n * When the returned function is called, the render process starts finishing.\n */\nfunction startRenderingAudio(context) {\n var renderTryMaxCount = 3;\n var renderRetryDelay = 500;\n var runningMaxAwaitTime = 500;\n var runningSufficientTime = 5000;\n var finalize = function () { return undefined; };\n var resultPromise = new Promise(function (resolve, reject) {\n var isFinalized = false;\n var renderTryCount = 0;\n var startedRunningAt = 0;\n context.oncomplete = function (event) { return resolve(event.renderedBuffer); };\n var startRunningTimeout = function () {\n setTimeout(function () { return reject(makeInnerError(\"timeout\" /* InnerErrorName.Timeout */)); }, Math.min(runningMaxAwaitTime, startedRunningAt + runningSufficientTime - Date.now()));\n };\n var tryRender = function () {\n try {\n var renderingPromise = context.startRendering();\n // `context.startRendering` has two APIs: Promise and callback, we check that it's really a promise just in case\n if (isPromise(renderingPromise)) {\n // Suppresses all unhadled rejections in case of scheduled redundant retries after successful rendering\n suppressUnhandledRejectionWarning(renderingPromise);\n }\n switch (context.state) {\n case 'running':\n startedRunningAt = Date.now();\n if (isFinalized) {\n startRunningTimeout();\n }\n break;\n // Sometimes the audio context doesn't start after calling `startRendering` (in addition to the cases where\n // audio context doesn't start at all). A known case is starting an audio context when the browser tab is in\n // background on iPhone. Retries usually help in this case.\n case 'suspended':\n // The audio context can reject starting until the tab is in foreground. Long fingerprint duration\n // in background isn't a problem, therefore the retry attempts don't count in background. It can lead to\n // a situation when a fingerprint takes very long time and finishes successfully. FYI, the audio context\n // can be suspended when `document.hidden === false` and start running after a retry.\n if (!document.hidden) {\n renderTryCount++;\n }\n if (isFinalized && renderTryCount >= renderTryMaxCount) {\n reject(makeInnerError(\"suspended\" /* InnerErrorName.Suspended */));\n }\n else {\n setTimeout(tryRender, renderRetryDelay);\n }\n break;\n }\n }\n catch (error) {\n reject(error);\n }\n };\n tryRender();\n finalize = function () {\n if (!isFinalized) {\n isFinalized = true;\n if (startedRunningAt > 0) {\n startRunningTimeout();\n }\n }\n };\n });\n return [resultPromise, finalize];\n}\nfunction getHash(signal) {\n var hash = 0;\n for (var i = 0; i < signal.length; ++i) {\n hash += Math.abs(signal[i]);\n }\n return hash;\n}\nfunction makeInnerError(name) {\n var error = new Error(name);\n error.name = name;\n return error;\n}\n\n/**\n * Creates and keeps an invisible iframe while the given function runs.\n * The given function is called when the iframe is loaded and has a body.\n * The iframe allows to measure DOM sizes inside itself.\n *\n * Notice: passing an initial HTML code doesn't work in IE.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction withIframe(action, initialHtml, domPollInterval) {\n var _a, _b, _c;\n if (domPollInterval === void 0) { domPollInterval = 50; }\n return __awaiter(this, void 0, void 0, function () {\n var d, iframe;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n d = document;\n _d.label = 1;\n case 1:\n if (!!d.body) return [3 /*break*/, 3];\n return [4 /*yield*/, wait(domPollInterval)];\n case 2:\n _d.sent();\n return [3 /*break*/, 1];\n case 3:\n iframe = d.createElement('iframe');\n _d.label = 4;\n case 4:\n _d.trys.push([4, , 10, 11]);\n return [4 /*yield*/, new Promise(function (_resolve, _reject) {\n var isComplete = false;\n var resolve = function () {\n isComplete = true;\n _resolve();\n };\n var reject = function (error) {\n isComplete = true;\n _reject(error);\n };\n iframe.onload = resolve;\n iframe.onerror = reject;\n var style = iframe.style;\n style.setProperty('display', 'block', 'important'); // Required for browsers to calculate the layout\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.visibility = 'hidden';\n if (initialHtml && 'srcdoc' in iframe) {\n iframe.srcdoc = initialHtml;\n }\n else {\n iframe.src = 'about:blank';\n }\n d.body.appendChild(iframe);\n // WebKit in WeChat doesn't fire the iframe's `onload` for some reason.\n // This code checks for the loading state manually.\n // See https://github.com/fingerprintjs/fingerprintjs/issues/645\n var checkReadyState = function () {\n var _a, _b;\n // The ready state may never become 'complete' in Firefox despite the 'load' event being fired.\n // So an infinite setTimeout loop can happen without this check.\n // See https://github.com/fingerprintjs/fingerprintjs/pull/716#issuecomment-986898796\n if (isComplete) {\n return;\n }\n // Make sure iframe.contentWindow and iframe.contentWindow.document are both loaded\n // The contentWindow.document can miss in JSDOM (https://github.com/jsdom/jsdom).\n if (((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.readyState) === 'complete') {\n resolve();\n }\n else {\n setTimeout(checkReadyState, 10);\n }\n };\n checkReadyState();\n })];\n case 5:\n _d.sent();\n _d.label = 6;\n case 6:\n if (!!((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.body)) return [3 /*break*/, 8];\n return [4 /*yield*/, wait(domPollInterval)];\n case 7:\n _d.sent();\n return [3 /*break*/, 6];\n case 8: return [4 /*yield*/, action(iframe, iframe.contentWindow)];\n case 9: return [2 /*return*/, _d.sent()];\n case 10:\n (_c = iframe.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(iframe);\n return [7 /*endfinally*/];\n case 11: return [2 /*return*/];\n }\n });\n });\n}\n/**\n * Creates a DOM element that matches the given selector.\n * Only single element selector are supported (without operators like space, +, >, etc).\n */\nfunction selectorToElement(selector) {\n var _a = parseSimpleCssSelector(selector), tag = _a[0], attributes = _a[1];\n var element = document.createElement(tag !== null && tag !== void 0 ? tag : 'div');\n for (var _i = 0, _b = Object.keys(attributes); _i < _b.length; _i++) {\n var name_1 = _b[_i];\n var value = attributes[name_1].join(' ');\n // Changing the `style` attribute can cause a CSP error, therefore we change the `style.cssText` property.\n // https://github.com/fingerprintjs/fingerprintjs/issues/733\n if (name_1 === 'style') {\n addStyleString(element.style, value);\n }\n else {\n element.setAttribute(name_1, value);\n }\n }\n return element;\n}\n/**\n * Adds CSS styles from a string in such a way that doesn't trigger a CSP warning (unsafe-inline or unsafe-eval)\n */\nfunction addStyleString(style, source) {\n // We don't use `style.cssText` because browsers must block it when no `unsafe-eval` CSP is presented: https://csplite.com/csp145/#w3c_note\n // Even though the browsers ignore this standard, we don't use `cssText` just in case.\n for (var _i = 0, _a = source.split(';'); _i < _a.length; _i++) {\n var property = _a[_i];\n var match = /^\\s*([\\w-]+)\\s*:\\s*(.+?)(\\s*!([\\w-]+))?\\s*$/.exec(property);\n if (match) {\n var name_2 = match[1], value = match[2], priority = match[4];\n style.setProperty(name_2, value, priority || ''); // The last argument can't be undefined in IE11\n }\n }\n}\n\n// We use m or w because these two characters take up the maximum width.\n// And we use a LLi so that the same matching fonts can get separated.\nvar testString = 'mmMwWLliI0O&1';\n// We test using 48px font size, we may use any size. I guess larger the better.\nvar textSize = '48px';\n// A font will be compared against all the three default fonts.\n// And if for any default fonts it doesn't match, then that font is available.\nvar baseFonts = ['monospace', 'sans-serif', 'serif'];\nvar fontList = [\n // This is android-specific font from \"Roboto\" family\n 'sans-serif-thin',\n 'ARNO PRO',\n 'Agency FB',\n 'Arabic Typesetting',\n 'Arial Unicode MS',\n 'AvantGarde Bk BT',\n 'BankGothic Md BT',\n 'Batang',\n 'Bitstream Vera Sans Mono',\n 'Calibri',\n 'Century',\n 'Century Gothic',\n 'Clarendon',\n 'EUROSTILE',\n 'Franklin Gothic',\n 'Futura Bk BT',\n 'Futura Md BT',\n 'GOTHAM',\n 'Gill Sans',\n 'HELV',\n 'Haettenschweiler',\n 'Helvetica Neue',\n 'Humanst521 BT',\n 'Leelawadee',\n 'Letter Gothic',\n 'Levenim MT',\n 'Lucida Bright',\n 'Lucida Sans',\n 'Menlo',\n 'MS Mincho',\n 'MS Outlook',\n 'MS Reference Specialty',\n 'MS UI Gothic',\n 'MT Extra',\n 'MYRIAD PRO',\n 'Marlett',\n 'Meiryo UI',\n 'Microsoft Uighur',\n 'Minion Pro',\n 'Monotype Corsiva',\n 'PMingLiU',\n 'Pristina',\n 'SCRIPTINA',\n 'Segoe UI Light',\n 'Serifa',\n 'SimHei',\n 'Small Fonts',\n 'Staccato222 BT',\n 'TRAJAN PRO',\n 'Univers CE 55 Medium',\n 'Vrinda',\n 'ZWAdobeF',\n];\n// kudos to http://www.lalit.org/lab/javascript-css-font-detect/\nfunction getFonts() {\n // Running the script in an iframe makes it not affect the page look and not be affected by the page CSS. See:\n // https://github.com/fingerprintjs/fingerprintjs/issues/592\n // https://github.com/fingerprintjs/fingerprintjs/issues/628\n return withIframe(function (_, _a) {\n var document = _a.document;\n var holder = document.body;\n holder.style.fontSize = textSize;\n // div to load spans for the default fonts and the fonts to detect\n var spansContainer = document.createElement('div');\n var defaultWidth = {};\n var defaultHeight = {};\n // creates a span where the fonts will be loaded\n var createSpan = function (fontFamily) {\n var span = document.createElement('span');\n var style = span.style;\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.fontFamily = fontFamily;\n span.textContent = testString;\n spansContainer.appendChild(span);\n return span;\n };\n // creates a span and load the font to detect and a base font for fallback\n var createSpanWithFonts = function (fontToDetect, baseFont) {\n return createSpan(\"'\".concat(fontToDetect, \"',\").concat(baseFont));\n };\n // creates spans for the base fonts and adds them to baseFontsDiv\n var initializeBaseFontsSpans = function () {\n return baseFonts.map(createSpan);\n };\n // creates spans for the fonts to detect and adds them to fontsDiv\n var initializeFontsSpans = function () {\n // Stores {fontName : [spans for that font]}\n var spans = {};\n var _loop_1 = function (font) {\n spans[font] = baseFonts.map(function (baseFont) { return createSpanWithFonts(font, baseFont); });\n };\n for (var _i = 0, fontList_1 = fontList; _i < fontList_1.length; _i++) {\n var font = fontList_1[_i];\n _loop_1(font);\n }\n return spans;\n };\n // checks if a font is available\n var isFontAvailable = function (fontSpans) {\n return baseFonts.some(function (baseFont, baseFontIndex) {\n return fontSpans[baseFontIndex].offsetWidth !== defaultWidth[baseFont] ||\n fontSpans[baseFontIndex].offsetHeight !== defaultHeight[baseFont];\n });\n };\n // create spans for base fonts\n var baseFontsSpans = initializeBaseFontsSpans();\n // create spans for fonts to detect\n var fontsSpans = initializeFontsSpans();\n // add all the spans to the DOM\n holder.appendChild(spansContainer);\n // get the default width for the three base fonts\n for (var index = 0; index < baseFonts.length; index++) {\n defaultWidth[baseFonts[index]] = baseFontsSpans[index].offsetWidth; // width for the default font\n defaultHeight[baseFonts[index]] = baseFontsSpans[index].offsetHeight; // height for the default font\n }\n // check available fonts\n return fontList.filter(function (font) { return isFontAvailable(fontsSpans[font]); });\n });\n}\n\nfunction getPlugins() {\n var rawPlugins = navigator.plugins;\n if (!rawPlugins) {\n return undefined;\n }\n var plugins = [];\n // Safari 10 doesn't support iterating navigator.plugins with for...of\n for (var i = 0; i < rawPlugins.length; ++i) {\n var plugin = rawPlugins[i];\n if (!plugin) {\n continue;\n }\n var mimeTypes = [];\n for (var j = 0; j < plugin.length; ++j) {\n var mimeType = plugin[j];\n mimeTypes.push({\n type: mimeType.type,\n suffixes: mimeType.suffixes,\n });\n }\n plugins.push({\n name: plugin.name,\n description: plugin.description,\n mimeTypes: mimeTypes,\n });\n }\n return plugins;\n}\n\n// https://www.browserleaks.com/canvas#how-does-it-work\nfunction getCanvasFingerprint() {\n var winding = false;\n var geometry;\n var text;\n var _a = makeCanvasContext(), canvas = _a[0], context = _a[1];\n if (!isSupported(canvas, context)) {\n geometry = text = ''; // The value will be 'unsupported' in v3.4\n }\n else {\n winding = doesSupportWinding(context);\n renderTextImage(canvas, context);\n var textImage1 = canvasToString(canvas);\n var textImage2 = canvasToString(canvas); // It's slightly faster to double-encode the text image\n // Some browsers add a noise to the canvas: https://github.com/fingerprintjs/fingerprintjs/issues/791\n // The canvas is excluded from the fingerprint in this case\n if (textImage1 !== textImage2) {\n geometry = text = 'unstable';\n }\n else {\n text = textImage1;\n // Text is unstable:\n // https://github.com/fingerprintjs/fingerprintjs/issues/583\n // https://github.com/fingerprintjs/fingerprintjs/issues/103\n // Therefore it's extracted into a separate image.\n renderGeometryImage(canvas, context);\n geometry = canvasToString(canvas);\n }\n }\n return { winding: winding, geometry: geometry, text: text };\n}\nfunction makeCanvasContext() {\n var canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n return [canvas, canvas.getContext('2d')];\n}\nfunction isSupported(canvas, context) {\n return !!(context && canvas.toDataURL);\n}\nfunction doesSupportWinding(context) {\n // https://web.archive.org/web/20170825024655/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\n // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/canvas/winding.js\n context.rect(0, 0, 10, 10);\n context.rect(2, 2, 6, 6);\n return !context.isPointInPath(5, 5, 'evenodd');\n}\nfunction renderTextImage(canvas, context) {\n // Resizing the canvas cleans it\n canvas.width = 240;\n canvas.height = 60;\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#f60';\n context.fillRect(100, 1, 62, 20);\n context.fillStyle = '#069';\n // It's important to use explicit built-in fonts in order to exclude the affect of font preferences\n // (there is a separate entropy source for them).\n context.font = '11pt \"Times New Roman\"';\n // The choice of emojis has a gigantic impact on rendering performance (especially in FF).\n // Some newer emojis cause it to slow down 50-200 times.\n // There must be no text to the right of the emoji, see https://github.com/fingerprintjs/fingerprintjs/issues/574\n // A bare emoji shouldn't be used because the canvas will change depending on the script encoding:\n // https://github.com/fingerprintjs/fingerprintjs/issues/66\n // Escape sequence shouldn't be used too because Terser will turn it into a bare unicode.\n var printedText = \"Cwm fjordbank gly \".concat(String.fromCharCode(55357, 56835) /* 😃 */);\n context.fillText(printedText, 2, 15);\n context.fillStyle = 'rgba(102, 204, 0, 0.2)';\n context.font = '18pt Arial';\n context.fillText(printedText, 4, 45);\n}\nfunction renderGeometryImage(canvas, context) {\n // Resizing the canvas cleans it\n canvas.width = 122;\n canvas.height = 110;\n // Canvas blending\n // https://web.archive.org/web/20170826194121/http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/\n // http://jsfiddle.net/NDYV8/16/\n context.globalCompositeOperation = 'multiply';\n for (var _i = 0, _a = [\n ['#f2f', 40, 40],\n ['#2ff', 80, 40],\n ['#ff2', 60, 80],\n ]; _i < _a.length; _i++) {\n var _b = _a[_i], color = _b[0], x = _b[1], y = _b[2];\n context.fillStyle = color;\n context.beginPath();\n context.arc(x, y, 40, 0, Math.PI * 2, true);\n context.closePath();\n context.fill();\n }\n // Canvas winding\n // https://web.archive.org/web/20130913061632/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\n // http://jsfiddle.net/NDYV8/19/\n context.fillStyle = '#f9c';\n context.arc(60, 60, 60, 0, Math.PI * 2, true);\n context.arc(60, 60, 20, 0, Math.PI * 2, true);\n context.fill('evenodd');\n}\nfunction canvasToString(canvas) {\n return canvas.toDataURL();\n}\n\n/**\n * This is a crude and primitive touch screen detection. It's not possible to currently reliably detect the availability\n * of a touch screen with a JS, without actually subscribing to a touch event.\n *\n * @see http://www.stucox.com/blog/you-cant-detect-a-touchscreen/\n * @see https://github.com/Modernizr/Modernizr/issues/548\n */\nfunction getTouchSupport() {\n var n = navigator;\n var maxTouchPoints = 0;\n var touchEvent;\n if (n.maxTouchPoints !== undefined) {\n maxTouchPoints = toInt(n.maxTouchPoints);\n }\n else if (n.msMaxTouchPoints !== undefined) {\n maxTouchPoints = n.msMaxTouchPoints;\n }\n try {\n document.createEvent('TouchEvent');\n touchEvent = true;\n }\n catch (_a) {\n touchEvent = false;\n }\n var touchStart = 'ontouchstart' in window;\n return {\n maxTouchPoints: maxTouchPoints,\n touchEvent: touchEvent,\n touchStart: touchStart,\n };\n}\n\nfunction getOsCpu() {\n return navigator.oscpu;\n}\n\nfunction getLanguages() {\n var n = navigator;\n var result = [];\n var language = n.language || n.userLanguage || n.browserLanguage || n.systemLanguage;\n if (language !== undefined) {\n result.push([language]);\n }\n if (Array.isArray(n.languages)) {\n // Starting from Chromium 86, there is only a single value in `navigator.language` in Incognito mode:\n // the value of `navigator.language`. Therefore the value is ignored in this browser.\n if (!(isChromium() && isChromium86OrNewer())) {\n result.push(n.languages);\n }\n }\n else if (typeof n.languages === 'string') {\n var languages = n.languages;\n if (languages) {\n result.push(languages.split(','));\n }\n }\n return result;\n}\n\nfunction getColorDepth() {\n return window.screen.colorDepth;\n}\n\nfunction getDeviceMemory() {\n // `navigator.deviceMemory` is a string containing a number in some unidentified cases\n return replaceNaN(toFloat(navigator.deviceMemory), undefined);\n}\n\nfunction getScreenResolution() {\n var s = screen;\n // Some browsers return screen resolution as strings, e.g. \"1200\", instead of a number, e.g. 1200.\n // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.\n // Some browsers even return screen resolution as not numbers.\n var parseDimension = function (value) { return replaceNaN(toInt(value), null); };\n var dimensions = [parseDimension(s.width), parseDimension(s.height)];\n dimensions.sort().reverse();\n return dimensions;\n}\n\nvar screenFrameCheckInterval = 2500;\nvar roundingPrecision = 10;\n// The type is readonly to protect from unwanted mutations\nvar screenFrameBackup;\nvar screenFrameSizeTimeoutId;\n/**\n * Starts watching the screen frame size. When a non-zero size appears, the size is saved and the watch is stopped.\n * Later, when `getScreenFrame` runs, it will return the saved non-zero size if the current size is null.\n *\n * This trick is required to mitigate the fact that the screen frame turns null in some cases.\n * See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n */\nfunction watchScreenFrame() {\n if (screenFrameSizeTimeoutId !== undefined) {\n return;\n }\n var checkScreenFrame = function () {\n var frameSize = getCurrentScreenFrame();\n if (isFrameSizeNull(frameSize)) {\n screenFrameSizeTimeoutId = setTimeout(checkScreenFrame, screenFrameCheckInterval);\n }\n else {\n screenFrameBackup = frameSize;\n screenFrameSizeTimeoutId = undefined;\n }\n };\n checkScreenFrame();\n}\nfunction getScreenFrame() {\n var _this = this;\n watchScreenFrame();\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var frameSize;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n frameSize = getCurrentScreenFrame();\n if (!isFrameSizeNull(frameSize)) return [3 /*break*/, 2];\n if (screenFrameBackup) {\n return [2 /*return*/, __spreadArray([], screenFrameBackup, true)];\n }\n if (!getFullscreenElement()) return [3 /*break*/, 2];\n // Some browsers set the screen frame to zero when programmatic fullscreen is on.\n // There is a chance of getting a non-zero frame after exiting the fullscreen.\n // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n return [4 /*yield*/, exitFullscreen()];\n case 1:\n // Some browsers set the screen frame to zero when programmatic fullscreen is on.\n // There is a chance of getting a non-zero frame after exiting the fullscreen.\n // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n _a.sent();\n frameSize = getCurrentScreenFrame();\n _a.label = 2;\n case 2:\n if (!isFrameSizeNull(frameSize)) {\n screenFrameBackup = frameSize;\n }\n return [2 /*return*/, frameSize];\n }\n });\n }); };\n}\n/**\n * Sometimes the available screen resolution changes a bit, e.g. 1900x1440 → 1900x1439. A possible reason: macOS Dock\n * shrinks to fit more icons when there is too little space. The rounding is used to mitigate the difference.\n */\nfunction getRoundedScreenFrame() {\n var _this = this;\n var screenFrameGetter = getScreenFrame();\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var frameSize, processSize;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, screenFrameGetter()];\n case 1:\n frameSize = _a.sent();\n processSize = function (sideSize) { return (sideSize === null ? null : round(sideSize, roundingPrecision)); };\n // It might look like I don't know about `for` and `map`.\n // In fact, such code is used to avoid TypeScript issues without using `as`.\n return [2 /*return*/, [processSize(frameSize[0]), processSize(frameSize[1]), processSize(frameSize[2]), processSize(frameSize[3])]];\n }\n });\n }); };\n}\nfunction getCurrentScreenFrame() {\n var s = screen;\n // Some browsers return screen resolution as strings, e.g. \"1200\", instead of a number, e.g. 1200.\n // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.\n //\n // Some browsers (IE, Edge ≤18) don't provide `screen.availLeft` and `screen.availTop`. The property values are\n // replaced with 0 in such cases to not lose the entropy from `screen.availWidth` and `screen.availHeight`.\n return [\n replaceNaN(toFloat(s.availTop), null),\n replaceNaN(toFloat(s.width) - toFloat(s.availWidth) - replaceNaN(toFloat(s.availLeft), 0), null),\n replaceNaN(toFloat(s.height) - toFloat(s.availHeight) - replaceNaN(toFloat(s.availTop), 0), null),\n replaceNaN(toFloat(s.availLeft), null),\n ];\n}\nfunction isFrameSizeNull(frameSize) {\n for (var i = 0; i < 4; ++i) {\n if (frameSize[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction getHardwareConcurrency() {\n // sometimes hardware concurrency is a string\n return replaceNaN(toInt(navigator.hardwareConcurrency), undefined);\n}\n\nfunction getTimezone() {\n var _a;\n var DateTimeFormat = (_a = window.Intl) === null || _a === void 0 ? void 0 : _a.DateTimeFormat;\n if (DateTimeFormat) {\n var timezone = new DateTimeFormat().resolvedOptions().timeZone;\n if (timezone) {\n return timezone;\n }\n }\n // For browsers that don't support timezone names\n // The minus is intentional because the JS offset is opposite to the real offset\n var offset = -getTimezoneOffset();\n return \"UTC\".concat(offset >= 0 ? '+' : '').concat(Math.abs(offset));\n}\nfunction getTimezoneOffset() {\n var currentYear = new Date().getFullYear();\n // The timezone offset may change over time due to daylight saving time (DST) shifts.\n // The non-DST timezone offset is used as the result timezone offset.\n // Since the DST season differs in the northern and the southern hemispheres,\n // both January and July timezones offsets are considered.\n return Math.max(\n // `getTimezoneOffset` returns a number as a string in some unidentified cases\n toFloat(new Date(currentYear, 0, 1).getTimezoneOffset()), toFloat(new Date(currentYear, 6, 1).getTimezoneOffset()));\n}\n\nfunction getSessionStorage() {\n try {\n return !!window.sessionStorage;\n }\n catch (error) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\n// https://bugzilla.mozilla.org/show_bug.cgi?id=781447\nfunction getLocalStorage() {\n try {\n return !!window.localStorage;\n }\n catch (e) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\nfunction getIndexedDB() {\n // IE and Edge don't allow accessing indexedDB in private mode, therefore IE and Edge will have different\n // visitor identifier in normal and private modes.\n if (isTrident() || isEdgeHTML()) {\n return undefined;\n }\n try {\n return !!window.indexedDB;\n }\n catch (e) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\nfunction getOpenDatabase() {\n return !!window.openDatabase;\n}\n\nfunction getCpuClass() {\n return navigator.cpuClass;\n}\n\nfunction getPlatform() {\n // Android Chrome 86 and 87 and Android Firefox 80 and 84 don't mock the platform value when desktop mode is requested\n var platform = navigator.platform;\n // iOS mocks the platform value when desktop version is requested: https://github.com/fingerprintjs/fingerprintjs/issues/514\n // iPad uses desktop mode by default since iOS 13\n // The value is 'MacIntel' on M1 Macs\n // The value is 'iPhone' on iPod Touch\n if (platform === 'MacIntel') {\n if (isWebKit() && !isDesktopSafari()) {\n return isIPad() ? 'iPad' : 'iPhone';\n }\n }\n return platform;\n}\n\nfunction getVendor() {\n return navigator.vendor || '';\n}\n\n/**\n * Checks for browser-specific (not engine specific) global variables to tell browsers with the same engine apart.\n * Only somewhat popular browsers are considered.\n */\nfunction getVendorFlavors() {\n var flavors = [];\n for (var _i = 0, _a = [\n // Blink and some browsers on iOS\n 'chrome',\n // Safari on macOS\n 'safari',\n // Chrome on iOS (checked in 85 on 13 and 87 on 14)\n '__crWeb',\n '__gCrWeb',\n // Yandex Browser on iOS, macOS and Android (checked in 21.2 on iOS 14, macOS and Android)\n 'yandex',\n // Yandex Browser on iOS (checked in 21.2 on 14)\n '__yb',\n '__ybro',\n // Firefox on iOS (checked in 32 on 14)\n '__firefox__',\n // Edge on iOS (checked in 46 on 14)\n '__edgeTrackingPreventionStatistics',\n 'webkit',\n // Opera Touch on iOS (checked in 2.6 on 14)\n 'oprt',\n // Samsung Internet on Android (checked in 11.1)\n 'samsungAr',\n // UC Browser on Android (checked in 12.10 and 13.0)\n 'ucweb',\n 'UCShellJava',\n // Puffin on Android (checked in 9.0)\n 'puffinDevice',\n // UC on iOS and Opera on Android have no specific global variables\n // Edge for Android isn't checked\n ]; _i < _a.length; _i++) {\n var key = _a[_i];\n var value = window[key];\n if (value && typeof value === 'object') {\n flavors.push(key);\n }\n }\n return flavors.sort();\n}\n\n/**\n * navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking\n * cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past with\n * site-specific exceptions. Don't rely on it.\n *\n * @see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js Taken from here\n */\nfunction areCookiesEnabled() {\n var d = document;\n // Taken from here: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js\n // navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking\n // cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past\n // with site-specific exceptions. Don't rely on it.\n // try..catch because some in situations `document.cookie` is exposed but throws a\n // SecurityError if you try to access it; e.g. documents created from data URIs\n // or in sandboxed iframes (depending on flags/context)\n try {\n // Create cookie\n d.cookie = 'cookietest=1; SameSite=Strict;';\n var result = d.cookie.indexOf('cookietest=') !== -1;\n // Delete cookie\n d.cookie = 'cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT';\n return result;\n }\n catch (e) {\n return false;\n }\n}\n\n/**\n * Only single element selector are supported (no operators like space, +, >, etc).\n * `embed` and `position: fixed;` will be considered as blocked anyway because it always has no offsetParent.\n * Avoid `iframe` and anything with `[src=]` because they produce excess HTTP requests.\n *\n * The \"inappropriate\" selectors are obfuscated. See https://github.com/fingerprintjs/fingerprintjs/issues/734.\n * A function is used instead of a plain object to help tree-shaking.\n *\n * The function code is generated automatically. See docs/content_blockers.md to learn how to make the list.\n */\nfunction getFilters() {\n var fromB64 = atob; // Just for better minification\n return {\n abpIndo: [\n '#Iklan-Melayang',\n '#Kolom-Iklan-728',\n '#SidebarIklan-wrapper',\n '[title=\"ALIENBOLA\" i]',\n fromB64('I0JveC1CYW5uZXItYWRz'),\n ],\n abpvn: ['.quangcao', '#mobileCatfish', fromB64('LmNsb3NlLWFkcw=='), '[id^=\"bn_bottom_fixed_\"]', '#pmadv'],\n adBlockFinland: [\n '.mainostila',\n fromB64('LnNwb25zb3JpdA=='),\n '.ylamainos',\n fromB64('YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd'),\n ],\n adBlockPersian: [\n '#navbar_notice_50',\n '.kadr',\n 'TABLE[width=\"140px\"]',\n '#divAgahi',\n fromB64('YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd'),\n ],\n adBlockWarningRemoval: [\n '#adblock-honeypot',\n '.adblocker-root',\n '.wp_adblock_detect',\n fromB64('LmhlYWRlci1ibG9ja2VkLWFk'),\n fromB64('I2FkX2Jsb2NrZXI='),\n ],\n adGuardAnnoyances: [\n '.hs-sosyal',\n '#cookieconsentdiv',\n 'div[class^=\"app_gdpr\"]',\n '.as-oil',\n '[data-cypress=\"soft-push-notification-modal\"]',\n ],\n adGuardBase: [\n '.BetterJsPopOverlay',\n fromB64('I2FkXzMwMFgyNTA='),\n fromB64('I2Jhbm5lcmZsb2F0MjI='),\n fromB64('I2NhbXBhaWduLWJhbm5lcg=='),\n fromB64('I0FkLUNvbnRlbnQ='),\n ],\n adGuardChinese: [\n fromB64('LlppX2FkX2FfSA=='),\n fromB64('YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd'),\n '#widget-quan',\n fromB64('YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd'),\n fromB64('YVtocmVmKj0iLjE5NTZobC5jb20vIl0='),\n ],\n adGuardFrench: [\n '#pavePub',\n fromB64('LmFkLWRlc2t0b3AtcmVjdGFuZ2xl'),\n '.mobile_adhesion',\n '.widgetadv',\n fromB64('LmFkc19iYW4='),\n ],\n adGuardGerman: ['aside[data-portal-id=\"leaderboard\"]'],\n adGuardJapanese: [\n '#kauli_yad_1',\n fromB64('YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0='),\n fromB64('Ll9wb3BJbl9pbmZpbml0ZV9hZA=='),\n fromB64('LmFkZ29vZ2xl'),\n fromB64('Ll9faXNib29zdFJldHVybkFk'),\n ],\n adGuardMobile: [\n fromB64('YW1wLWF1dG8tYWRz'),\n fromB64('LmFtcF9hZA=='),\n 'amp-embed[type=\"24smi\"]',\n '#mgid_iframe1',\n fromB64('I2FkX2ludmlld19hcmVh'),\n ],\n adGuardRussian: [\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0='),\n fromB64('LnJlY2xhbWE='),\n 'div[id^=\"smi2adblock\"]',\n fromB64('ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd'),\n '#psyduckpockeball',\n ],\n adGuardSocial: [\n fromB64('YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0='),\n fromB64('YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0='),\n '.etsy-tweet',\n '#inlineShare',\n '.popup-social',\n ],\n adGuardSpanishPortuguese: ['#barraPublicidade', '#Publicidade', '#publiEspecial', '#queTooltip', '.cnt-publi'],\n adGuardTrackingProtection: [\n '#qoo-counter',\n fromB64('YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=='),\n fromB64('YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0='),\n fromB64('YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=='),\n '#top100counter',\n ],\n adGuardTurkish: [\n '#backkapat',\n fromB64('I3Jla2xhbWk='),\n fromB64('YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0='),\n fromB64('YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd'),\n fromB64('YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ=='),\n ],\n bulgarian: [fromB64('dGQjZnJlZW5ldF90YWJsZV9hZHM='), '#ea_intext_div', '.lapni-pop-over', '#xenium_hot_offers'],\n easyList: [\n '.yb-floorad',\n fromB64('LndpZGdldF9wb19hZHNfd2lkZ2V0'),\n fromB64('LnRyYWZmaWNqdW5reS1hZA=='),\n '.textad_headline',\n fromB64('LnNwb25zb3JlZC10ZXh0LWxpbmtz'),\n ],\n easyListChina: [\n fromB64('LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=='),\n fromB64('LmZyb250cGFnZUFkdk0='),\n '#taotaole',\n '#aafoot.top_box',\n '.cfa_popup',\n ],\n easyListCookie: [\n '.ezmob-footer',\n '.cc-CookieWarning',\n '[data-cookie-number]',\n fromB64('LmF3LWNvb2tpZS1iYW5uZXI='),\n '.sygnal24-gdpr-modal-wrap',\n ],\n easyListCzechSlovak: [\n '#onlajny-stickers',\n fromB64('I3Jla2xhbW5pLWJveA=='),\n fromB64('LnJla2xhbWEtbWVnYWJvYXJk'),\n '.sklik',\n fromB64('W2lkXj0ic2tsaWtSZWtsYW1hIl0='),\n ],\n easyListDutch: [\n fromB64('I2FkdmVydGVudGll'),\n fromB64('I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=='),\n '.adstekst',\n fromB64('YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0='),\n '#semilo-lrectangle',\n ],\n easyListGermany: [\n '#SSpotIMPopSlider',\n fromB64('LnNwb25zb3JsaW5rZ3J1ZW4='),\n fromB64('I3dlcmJ1bmdza3k='),\n fromB64('I3Jla2xhbWUtcmVjaHRzLW1pdHRl'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0='),\n ],\n easyListItaly: [\n fromB64('LmJveF9hZHZfYW5udW5jaQ=='),\n '.sb-box-pubbliredazionale',\n fromB64('YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ=='),\n ],\n easyListLithuania: [\n fromB64('LnJla2xhbW9zX3RhcnBhcw=='),\n fromB64('LnJla2xhbW9zX251b3JvZG9z'),\n fromB64('aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd'),\n fromB64('aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd'),\n fromB64('aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd'),\n ],\n estonian: [fromB64('QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==')],\n fanboyAnnoyances: ['#ac-lre-player', '.navigate-to-top', '#subscribe_popup', '.newsletter_holder', '#back-top'],\n fanboyAntiFacebook: ['.util-bar-module-firefly-visible'],\n fanboyEnhancedTrackers: [\n '.open.pushModal',\n '#issuem-leaky-paywall-articles-zero-remaining-nag',\n '#sovrn_container',\n 'div[class$=\"-hide\"][zoompage-fontsize][style=\"display: block;\"]',\n '.BlockNag__Card',\n ],\n fanboySocial: ['#FollowUs', '#meteored_share', '#social_follow', '.article-sharer', '.community__social-desc'],\n frellwitSwedish: [\n fromB64('YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=='),\n fromB64('YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=='),\n 'article.category-samarbete',\n fromB64('ZGl2LmhvbGlkQWRz'),\n 'ul.adsmodern',\n ],\n greekAdBlock: [\n fromB64('QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd'),\n fromB64('QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=='),\n fromB64('QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd'),\n 'DIV.agores300',\n 'TABLE.advright',\n ],\n hungarian: [\n '#cemp_doboz',\n '.optimonk-iframe-container',\n fromB64('LmFkX19tYWlu'),\n fromB64('W2NsYXNzKj0iR29vZ2xlQWRzIl0='),\n '#hirdetesek_box',\n ],\n iDontCareAboutCookies: [\n '.alert-info[data-block-track*=\"CookieNotice\"]',\n '.ModuleTemplateCookieIndicator',\n '.o--cookies--container',\n '#cookies-policy-sticky',\n '#stickyCookieBar',\n ],\n icelandicAbp: [fromB64('QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==')],\n latvian: [\n fromB64('YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0O' +\n 'iA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0='),\n fromB64('YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6I' +\n 'DMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ=='),\n ],\n listKr: [\n fromB64('YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0='),\n fromB64('I2xpdmVyZUFkV3JhcHBlcg=='),\n fromB64('YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=='),\n fromB64('aW5zLmZhc3R2aWV3LWFk'),\n '.revenue_unit_item.dable',\n ],\n listeAr: [\n fromB64('LmdlbWluaUxCMUFk'),\n '.right-and-left-sponsers',\n fromB64('YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=='),\n fromB64('YVtocmVmKj0iYm9vcmFxLm9yZyJd'),\n fromB64('YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd'),\n ],\n listeFr: [\n fromB64('YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=='),\n fromB64('I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=='),\n fromB64('YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0='),\n '.site-pub-interstitiel',\n 'div[id^=\"crt-\"][data-criteo-id]',\n ],\n officialPolish: [\n '#ceneo-placeholder-ceneo-12',\n fromB64('W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd'),\n fromB64('YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=='),\n fromB64('YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=='),\n fromB64('ZGl2I3NrYXBpZWNfYWQ='),\n ],\n ro: [\n fromB64('YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0='),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd'),\n 'a[href^=\"/url/\"]',\n ],\n ruAd: [\n fromB64('YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd'),\n fromB64('YVtocmVmKj0iLy91dGltZy5ydS8iXQ=='),\n fromB64('YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0='),\n '#pgeldiz',\n '.yandex-rtb-block',\n ],\n thaiAds: [\n 'a[href*=macau-uta-popup]',\n fromB64('I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=='),\n fromB64('LmFkczMwMHM='),\n '.bumq',\n '.img-kosana',\n ],\n webAnnoyancesUltralist: [\n '#mod-social-share-2',\n '#social-tools',\n fromB64('LmN0cGwtZnVsbGJhbm5lcg=='),\n '.zergnet-recommend',\n '.yt.btn-link.btn-md.btn',\n ],\n };\n}\n/**\n * The order of the returned array means nothing (it's always sorted alphabetically).\n *\n * Notice that the source is slightly unstable.\n * Safari provides a 2-taps way to disable all content blockers on a page temporarily.\n * Also content blockers can be disabled permanently for a domain, but it requires 4 taps.\n * So empty array shouldn't be treated as \"no blockers\", it should be treated as \"no signal\".\n * If you are a website owner, don't make your visitors want to disable content blockers.\n */\nfunction getDomBlockers(_a) {\n var _b = _a === void 0 ? {} : _a, debug = _b.debug;\n return __awaiter(this, void 0, void 0, function () {\n var filters, filterNames, allSelectors, blockedSelectors, activeBlockers;\n var _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n if (!isApplicable()) {\n return [2 /*return*/, undefined];\n }\n filters = getFilters();\n filterNames = Object.keys(filters);\n allSelectors = (_c = []).concat.apply(_c, filterNames.map(function (filterName) { return filters[filterName]; }));\n return [4 /*yield*/, getBlockedSelectors(allSelectors)];\n case 1:\n blockedSelectors = _d.sent();\n if (debug) {\n printDebug(filters, blockedSelectors);\n }\n activeBlockers = filterNames.filter(function (filterName) {\n var selectors = filters[filterName];\n var blockedCount = countTruthy(selectors.map(function (selector) { return blockedSelectors[selector]; }));\n return blockedCount > selectors.length * 0.6;\n });\n activeBlockers.sort();\n return [2 /*return*/, activeBlockers];\n }\n });\n });\n}\nfunction isApplicable() {\n // Safari (desktop and mobile) and all Android browsers keep content blockers in both regular and private mode\n return isWebKit() || isAndroid();\n}\nfunction getBlockedSelectors(selectors) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var d, root, elements, blockedSelectors, i, element, holder, i;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n d = document;\n root = d.createElement('div');\n elements = new Array(selectors.length);\n blockedSelectors = {} // Set() isn't used just in case somebody need older browser support\n ;\n forceShow(root);\n // First create all elements that can be blocked. If the DOM steps below are done in a single cycle,\n // browser will alternate tree modification and layout reading, that is very slow.\n for (i = 0; i < selectors.length; ++i) {\n element = selectorToElement(selectors[i]);\n if (element.tagName === 'DIALOG') {\n element.show();\n }\n holder = d.createElement('div') // Protects from unwanted effects of `+` and `~` selectors of filters\n ;\n forceShow(holder);\n holder.appendChild(element);\n root.appendChild(holder);\n elements[i] = element;\n }\n _b.label = 1;\n case 1:\n if (!!d.body) return [3 /*break*/, 3];\n return [4 /*yield*/, wait(50)];\n case 2:\n _b.sent();\n return [3 /*break*/, 1];\n case 3:\n d.body.appendChild(root);\n try {\n // Then check which of the elements are blocked\n for (i = 0; i < selectors.length; ++i) {\n if (!elements[i].offsetParent) {\n blockedSelectors[selectors[i]] = true;\n }\n }\n }\n finally {\n // Then remove the elements\n (_a = root.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(root);\n }\n return [2 /*return*/, blockedSelectors];\n }\n });\n });\n}\nfunction forceShow(element) {\n element.style.setProperty('display', 'block', 'important');\n}\nfunction printDebug(filters, blockedSelectors) {\n var message = 'DOM blockers debug:\\n```';\n for (var _i = 0, _a = Object.keys(filters); _i < _a.length; _i++) {\n var filterName = _a[_i];\n message += \"\\n\".concat(filterName, \":\");\n for (var _b = 0, _c = filters[filterName]; _b < _c.length; _b++) {\n var selector = _c[_b];\n message += \"\\n \".concat(blockedSelectors[selector] ? '🚫' : '➡️', \" \").concat(selector);\n }\n }\n // console.log is ok here because it's under a debug clause\n // eslint-disable-next-line no-console\n console.log(\"\".concat(message, \"\\n```\"));\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/color-gamut\n */\nfunction getColorGamut() {\n // rec2020 includes p3 and p3 includes srgb\n for (var _i = 0, _a = ['rec2020', 'p3', 'srgb']; _i < _a.length; _i++) {\n var gamut = _a[_i];\n if (matchMedia(\"(color-gamut: \".concat(gamut, \")\")).matches) {\n return gamut;\n }\n }\n return undefined;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/inverted-colors\n */\nfunction areColorsInverted() {\n if (doesMatch$4('inverted')) {\n return true;\n }\n if (doesMatch$4('none')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$4(value) {\n return matchMedia(\"(inverted-colors: \".concat(value, \")\")).matches;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors\n */\nfunction areColorsForced() {\n if (doesMatch$3('active')) {\n return true;\n }\n if (doesMatch$3('none')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$3(value) {\n return matchMedia(\"(forced-colors: \".concat(value, \")\")).matches;\n}\n\nvar maxValueToCheck = 100;\n/**\n * If the display is monochrome (e.g. black&white), the value will be ≥0 and will mean the number of bits per pixel.\n * If the display is not monochrome, the returned value will be 0.\n * If the browser doesn't support this feature, the returned value will be undefined.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/monochrome\n */\nfunction getMonochromeDepth() {\n if (!matchMedia('(min-monochrome: 0)').matches) {\n // The media feature isn't supported by the browser\n return undefined;\n }\n // A variation of binary search algorithm can be used here.\n // But since expected values are very small (≤10), there is no sense in adding the complexity.\n for (var i = 0; i <= maxValueToCheck; ++i) {\n if (matchMedia(\"(max-monochrome: \".concat(i, \")\")).matches) {\n return i;\n }\n }\n throw new Error('Too high value');\n}\n\n/**\n * @see https://www.w3.org/TR/mediaqueries-5/#prefers-contrast\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast\n */\nfunction getContrastPreference() {\n if (doesMatch$2('no-preference')) {\n return 0 /* ContrastPreference.None */;\n }\n // The sources contradict on the keywords. Probably 'high' and 'low' will never be implemented.\n // Need to check it when all browsers implement the feature.\n if (doesMatch$2('high') || doesMatch$2('more')) {\n return 1 /* ContrastPreference.More */;\n }\n if (doesMatch$2('low') || doesMatch$2('less')) {\n return -1 /* ContrastPreference.Less */;\n }\n if (doesMatch$2('forced')) {\n return 10 /* ContrastPreference.ForcedColors */;\n }\n return undefined;\n}\nfunction doesMatch$2(value) {\n return matchMedia(\"(prefers-contrast: \".concat(value, \")\")).matches;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion\n */\nfunction isMotionReduced() {\n if (doesMatch$1('reduce')) {\n return true;\n }\n if (doesMatch$1('no-preference')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$1(value) {\n return matchMedia(\"(prefers-reduced-motion: \".concat(value, \")\")).matches;\n}\n\n/**\n * @see https://www.w3.org/TR/mediaqueries-5/#dynamic-range\n */\nfunction isHDR() {\n if (doesMatch('high')) {\n return true;\n }\n if (doesMatch('standard')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch(value) {\n return matchMedia(\"(dynamic-range: \".concat(value, \")\")).matches;\n}\n\nvar M = Math; // To reduce the minified code size\nvar fallbackFn = function () { return 0; };\n/**\n * @see https://gitlab.torproject.org/legacy/trac/-/issues/13018\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=531915\n */\nfunction getMathFingerprint() {\n // Native operations\n var acos = M.acos || fallbackFn;\n var acosh = M.acosh || fallbackFn;\n var asin = M.asin || fallbackFn;\n var asinh = M.asinh || fallbackFn;\n var atanh = M.atanh || fallbackFn;\n var atan = M.atan || fallbackFn;\n var sin = M.sin || fallbackFn;\n var sinh = M.sinh || fallbackFn;\n var cos = M.cos || fallbackFn;\n var cosh = M.cosh || fallbackFn;\n var tan = M.tan || fallbackFn;\n var tanh = M.tanh || fallbackFn;\n var exp = M.exp || fallbackFn;\n var expm1 = M.expm1 || fallbackFn;\n var log1p = M.log1p || fallbackFn;\n // Operation polyfills\n var powPI = function (value) { return M.pow(M.PI, value); };\n var acoshPf = function (value) { return M.log(value + M.sqrt(value * value - 1)); };\n var asinhPf = function (value) { return M.log(value + M.sqrt(value * value + 1)); };\n var atanhPf = function (value) { return M.log((1 + value) / (1 - value)) / 2; };\n var sinhPf = function (value) { return M.exp(value) - 1 / M.exp(value) / 2; };\n var coshPf = function (value) { return (M.exp(value) + 1 / M.exp(value)) / 2; };\n var expm1Pf = function (value) { return M.exp(value) - 1; };\n var tanhPf = function (value) { return (M.exp(2 * value) - 1) / (M.exp(2 * value) + 1); };\n var log1pPf = function (value) { return M.log(1 + value); };\n // Note: constant values are empirical\n return {\n acos: acos(0.123124234234234242),\n acosh: acosh(1e308),\n acoshPf: acoshPf(1e154),\n asin: asin(0.123124234234234242),\n asinh: asinh(1),\n asinhPf: asinhPf(1),\n atanh: atanh(0.5),\n atanhPf: atanhPf(0.5),\n atan: atan(0.5),\n sin: sin(-1e300),\n sinh: sinh(1),\n sinhPf: sinhPf(1),\n cos: cos(10.000000000123),\n cosh: cosh(1),\n coshPf: coshPf(1),\n tan: tan(-1e300),\n tanh: tanh(1),\n tanhPf: tanhPf(1),\n exp: exp(1),\n expm1: expm1(1),\n expm1Pf: expm1Pf(1),\n log1p: log1p(10),\n log1pPf: log1pPf(10),\n powPI: powPI(-100),\n };\n}\n\n/**\n * We use m or w because these two characters take up the maximum width.\n * Also there are a couple of ligatures.\n */\nvar defaultText = 'mmMwWLliI0fiflO&1';\n/**\n * Settings of text blocks to measure. The keys are random but persistent words.\n */\nvar presets = {\n /**\n * The default font. User can change it in desktop Chrome, desktop Firefox, IE 11,\n * Android Chrome (but only when the size is ≥ than the default) and Android Firefox.\n */\n default: [],\n /** OS font on macOS. User can change its size and weight. Applies after Safari restart. */\n apple: [{ font: '-apple-system-body' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n serif: [{ fontFamily: 'serif' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n sans: [{ fontFamily: 'sans-serif' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n mono: [{ fontFamily: 'monospace' }],\n /**\n * Check the smallest allowed font size. User can change it in desktop Chrome, desktop Firefox and desktop Safari.\n * The height can be 0 in Chrome on a retina display.\n */\n min: [{ fontSize: '1px' }],\n /** Tells one OS from another in desktop Chrome. */\n system: [{ fontFamily: 'system-ui' }],\n};\n/**\n * The result is a dictionary of the width of the text samples.\n * Heights aren't included because they give no extra entropy and are unstable.\n *\n * The result is very stable in IE 11, Edge 18 and Safari 14.\n * The result changes when the OS pixel density changes in Chromium 87. The real pixel density is required to solve,\n * but seems like it's impossible: https://stackoverflow.com/q/1713771/1118709.\n * The \"min\" and the \"mono\" (only on Windows) value may change when the page is zoomed in Firefox 87.\n */\nfunction getFontPreferences() {\n return withNaturalFonts(function (document, container) {\n var elements = {};\n var sizes = {};\n // First create all elements to measure. If the DOM steps below are done in a single cycle,\n // browser will alternate tree modification and layout reading, that is very slow.\n for (var _i = 0, _a = Object.keys(presets); _i < _a.length; _i++) {\n var key = _a[_i];\n var _b = presets[key], _c = _b[0], style = _c === void 0 ? {} : _c, _d = _b[1], text = _d === void 0 ? defaultText : _d;\n var element = document.createElement('span');\n element.textContent = text;\n element.style.whiteSpace = 'nowrap';\n for (var _e = 0, _f = Object.keys(style); _e < _f.length; _e++) {\n var name_1 = _f[_e];\n var value = style[name_1];\n if (value !== undefined) {\n element.style[name_1] = value;\n }\n }\n elements[key] = element;\n container.appendChild(document.createElement('br'));\n container.appendChild(element);\n }\n // Then measure the created elements\n for (var _g = 0, _h = Object.keys(presets); _g < _h.length; _g++) {\n var key = _h[_g];\n sizes[key] = elements[key].getBoundingClientRect().width;\n }\n return sizes;\n });\n}\n/**\n * Creates a DOM environment that provides the most natural font available, including Android OS font.\n * Measurements of the elements are zoom-independent.\n * Don't put a content to measure inside an absolutely positioned element.\n */\nfunction withNaturalFonts(action, containerWidthPx) {\n if (containerWidthPx === void 0) { containerWidthPx = 4000; }\n /*\n * Requirements for Android Chrome to apply the system font size to a text inside an iframe:\n * - The iframe mustn't have a `display: none;` style;\n * - The text mustn't be positioned absolutely;\n * - The text block must be wide enough.\n * 2560px on some devices in portrait orientation for the biggest font size option (32px);\n * - There must be much enough text to form a few lines (I don't know the exact numbers);\n * - The text must have the `text-size-adjust: none` style. Otherwise the text will scale in \"Desktop site\" mode;\n *\n * Requirements for Android Firefox to apply the system font size to a text inside an iframe:\n * - The iframe document must have a header: ``.\n * The only way to set it is to use the `srcdoc` attribute of the iframe;\n * - The iframe content must get loaded before adding extra content with JavaScript;\n *\n * https://example.com as the iframe target always inherits Android font settings so it can be used as a reference.\n *\n * Observations on how page zoom affects the measurements:\n * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;\n * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;\n * - macOS Safari 14.0: offsetWidth = 5% fluctuation;\n * - macOS Safari 14.0: getBoundingClientRect = 5% fluctuation;\n * - iOS Safari 9, 10, 11.0, 12.0: haven't found a way to zoom a page (pinch doesn't change layout);\n * - iOS Safari 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;\n * - iOS Safari 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;\n * - iOS Safari 14.0: offsetWidth = 100% reliable;\n * - iOS Safari 14.0: getBoundingClientRect = 100% reliable;\n * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + offsetWidth = 1px fluctuation;\n * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + getBoundingClientRect = 100% reliable;\n * - Chrome 87: offsetWidth = 1px fluctuation;\n * - Chrome 87: getBoundingClientRect = 0.7px fluctuation;\n * - Firefox 48, 51: offsetWidth = 10% fluctuation;\n * - Firefox 48, 51: getBoundingClientRect = 10% fluctuation;\n * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: offsetWidth = width 100% reliable, height 10% fluctuation;\n * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: getBoundingClientRect = width 100% reliable, height 10%\n * fluctuation;\n * - Android Chrome 86: haven't found a way to zoom a page (pinch doesn't change layout);\n * - Android Firefox 84: font size in accessibility settings changes all the CSS sizes, but offsetWidth and\n * getBoundingClientRect keep measuring with regular units, so the size reflects the font size setting and doesn't\n * fluctuate;\n * - IE 11, Edge 18: zoom 1/devicePixelRatio + offsetWidth = 100% reliable;\n * - IE 11, Edge 18: zoom 1/devicePixelRatio + getBoundingClientRect = reflects the zoom level;\n * - IE 11, Edge 18: offsetWidth = 100% reliable;\n * - IE 11, Edge 18: getBoundingClientRect = 100% reliable;\n */\n return withIframe(function (_, iframeWindow) {\n var iframeDocument = iframeWindow.document;\n var iframeBody = iframeDocument.body;\n var bodyStyle = iframeBody.style;\n bodyStyle.width = \"\".concat(containerWidthPx, \"px\");\n bodyStyle.webkitTextSizeAdjust = bodyStyle.textSizeAdjust = 'none';\n // See the big comment above\n if (isChromium()) {\n iframeBody.style.zoom = \"\".concat(1 / iframeWindow.devicePixelRatio);\n }\n else if (isWebKit()) {\n iframeBody.style.zoom = 'reset';\n }\n // See the big comment above\n var linesOfText = iframeDocument.createElement('div');\n linesOfText.textContent = __spreadArray([], Array((containerWidthPx / 20) << 0), true).map(function () { return 'word'; }).join(' ');\n iframeBody.appendChild(linesOfText);\n return action(iframeDocument, iframeBody);\n }, '');\n}\n\n/**\n * @see Credits: https://stackoverflow.com/a/49267844\n */\nfunction getVideoCard() {\n var _a;\n var canvas = document.createElement('canvas');\n var gl = (_a = canvas.getContext('webgl')) !== null && _a !== void 0 ? _a : canvas.getContext('experimental-webgl');\n if (gl && 'getExtension' in gl) {\n var debugInfo = gl.getExtension('WEBGL_debug_renderer_info');\n if (debugInfo) {\n return {\n vendor: (gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) || '').toString(),\n renderer: (gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) || '').toString(),\n };\n }\n }\n return undefined;\n}\n\nfunction isPdfViewerEnabled() {\n return navigator.pdfViewerEnabled;\n}\n\n/**\n * Unlike most other architectures, on x86/x86-64 when floating-point instructions\n * have no NaN arguments, but produce NaN output, the output NaN has sign bit set.\n * We use it to distinguish x86/x86-64 from other architectures, by doing subtraction\n * of two infinities (must produce NaN per IEEE 754 standard).\n *\n * See https://codebrowser.bddppq.com/pytorch/pytorch/third_party/XNNPACK/src/init.c.html#79\n */\nfunction getArchitecture() {\n var f = new Float32Array(1);\n var u8 = new Uint8Array(f.buffer);\n f[0] = Infinity;\n f[0] = f[0] - f[0];\n return u8[3];\n}\n\n/**\n * The list of entropy sources used to make visitor identifiers.\n *\n * This value isn't restricted by Semantic Versioning, i.e. it may be changed without bumping minor or major version of\n * this package.\n *\n * Note: Rollup and Webpack are smart enough to remove unused properties of this object during tree-shaking, so there is\n * no need to export the sources individually.\n */\nvar sources = {\n // READ FIRST:\n // See https://github.com/fingerprintjs/fingerprintjs/blob/master/contributing.md#how-to-make-an-entropy-source\n // to learn how entropy source works and how to make your own.\n // The sources run in this exact order.\n // The asynchronous sources are at the start to run in parallel with other sources.\n fonts: getFonts,\n domBlockers: getDomBlockers,\n fontPreferences: getFontPreferences,\n audio: getAudioFingerprint,\n screenFrame: getRoundedScreenFrame,\n osCpu: getOsCpu,\n languages: getLanguages,\n colorDepth: getColorDepth,\n deviceMemory: getDeviceMemory,\n screenResolution: getScreenResolution,\n hardwareConcurrency: getHardwareConcurrency,\n timezone: getTimezone,\n sessionStorage: getSessionStorage,\n localStorage: getLocalStorage,\n indexedDB: getIndexedDB,\n openDatabase: getOpenDatabase,\n cpuClass: getCpuClass,\n platform: getPlatform,\n plugins: getPlugins,\n canvas: getCanvasFingerprint,\n touchSupport: getTouchSupport,\n vendor: getVendor,\n vendorFlavors: getVendorFlavors,\n cookiesEnabled: areCookiesEnabled,\n colorGamut: getColorGamut,\n invertedColors: areColorsInverted,\n forcedColors: areColorsForced,\n monochrome: getMonochromeDepth,\n contrast: getContrastPreference,\n reducedMotion: isMotionReduced,\n hdr: isHDR,\n math: getMathFingerprint,\n videoCard: getVideoCard,\n pdfViewerEnabled: isPdfViewerEnabled,\n architecture: getArchitecture,\n};\n/**\n * Loads the built-in entropy sources.\n * Returns a function that collects the entropy components to make the visitor identifier.\n */\nfunction loadBuiltinSources(options) {\n return loadSources(sources, options, []);\n}\n\nvar commentTemplate = '$ if upgrade to Pro: https://fpjs.dev/pro';\nfunction getConfidence(components) {\n var openConfidenceScore = getOpenConfidenceScore(components);\n var proConfidenceScore = deriveProConfidenceScore(openConfidenceScore);\n return { score: openConfidenceScore, comment: commentTemplate.replace(/\\$/g, \"\".concat(proConfidenceScore)) };\n}\nfunction getOpenConfidenceScore(components) {\n // In order to calculate the true probability of the visitor identifier being correct, we need to know the number of\n // website visitors (the higher the number, the less the probability because the fingerprint entropy is limited).\n // JS agent doesn't know the number of visitors, so we can only do an approximate assessment.\n if (isAndroid()) {\n return 0.4;\n }\n // Safari (mobile and desktop)\n if (isWebKit()) {\n return isDesktopSafari() ? 0.5 : 0.3;\n }\n var platform = components.platform.value || '';\n // Windows\n if (/^Win/.test(platform)) {\n // The score is greater than on macOS because of the higher variety of devices running Windows.\n // Chrome provides more entropy than Firefox according too\n // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Windows%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D\n // So we assign the same score to them.\n return 0.6;\n }\n // macOS\n if (/^Mac/.test(platform)) {\n // Chrome provides more entropy than Safari and Safari provides more entropy than Firefox.\n // Chrome is more popular than Safari and Safari is more popular than Firefox according to\n // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Mac%20OS%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D\n // So we assign the same score to them.\n return 0.5;\n }\n // Another platform, e.g. a desktop Linux. It's rare, so it should be pretty unique.\n return 0.7;\n}\nfunction deriveProConfidenceScore(openConfidenceScore) {\n return round(0.99 + 0.01 * openConfidenceScore, 0.0001);\n}\n\nfunction componentsToCanonicalString(components) {\n var result = '';\n for (var _i = 0, _a = Object.keys(components).sort(); _i < _a.length; _i++) {\n var componentKey = _a[_i];\n var component = components[componentKey];\n var value = component.error ? 'error' : JSON.stringify(component.value);\n result += \"\".concat(result ? '|' : '').concat(componentKey.replace(/([:|\\\\])/g, '\\\\$1'), \":\").concat(value);\n }\n return result;\n}\nfunction componentsToDebugString(components) {\n return JSON.stringify(components, function (_key, value) {\n if (value instanceof Error) {\n return errorToObject(value);\n }\n return value;\n }, 2);\n}\nfunction hashComponents(components) {\n return x64hash128(componentsToCanonicalString(components));\n}\n/**\n * Makes a GetResult implementation that calculates the visitor id hash on demand.\n * Designed for optimisation.\n */\nfunction makeLazyGetResult(components) {\n var visitorIdCache;\n // This function runs very fast, so there is no need to make it lazy\n var confidence = getConfidence(components);\n // A plain class isn't used because its getters and setters aren't enumerable.\n return {\n get visitorId() {\n if (visitorIdCache === undefined) {\n visitorIdCache = hashComponents(this.components);\n }\n return visitorIdCache;\n },\n set visitorId(visitorId) {\n visitorIdCache = visitorId;\n },\n confidence: confidence,\n components: components,\n version: version,\n };\n}\n/**\n * A delay is required to ensure consistent entropy components.\n * See https://github.com/fingerprintjs/fingerprintjs/issues/254\n * and https://github.com/fingerprintjs/fingerprintjs/issues/307\n * and https://github.com/fingerprintjs/fingerprintjs/commit/945633e7c5f67ae38eb0fea37349712f0e669b18\n */\nfunction prepareForSources(delayFallback) {\n if (delayFallback === void 0) { delayFallback = 50; }\n // A proper deadline is unknown. Let it be twice the fallback timeout so that both cases have the same average time.\n return requestIdleCallbackIfAvailable(delayFallback, delayFallback * 2);\n}\n/**\n * The function isn't exported from the index file to not allow to call it without `load()`.\n * The hiding gives more freedom for future non-breaking updates.\n *\n * A factory function is used instead of a class to shorten the attribute names in the minified code.\n * Native private class fields could've been used, but TypeScript doesn't allow them with `\"target\": \"es5\"`.\n */\nfunction makeAgent(getComponents, debug) {\n var creationTime = Date.now();\n return {\n get: function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var startTime, components, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n startTime = Date.now();\n return [4 /*yield*/, getComponents()];\n case 1:\n components = _a.sent();\n result = makeLazyGetResult(components);\n if (debug || (options === null || options === void 0 ? void 0 : options.debug)) {\n // console.log is ok here because it's under a debug clause\n // eslint-disable-next-line no-console\n console.log(\"Copy the text below to get the debug data:\\n\\n```\\nversion: \".concat(result.version, \"\\nuserAgent: \").concat(navigator.userAgent, \"\\ntimeBetweenLoadAndGet: \").concat(startTime - creationTime, \"\\nvisitorId: \").concat(result.visitorId, \"\\ncomponents: \").concat(componentsToDebugString(components), \"\\n```\"));\n }\n return [2 /*return*/, result];\n }\n });\n });\n },\n };\n}\n/**\n * Sends an unpersonalized AJAX request to collect installation statistics\n */\nfunction monitor() {\n // The FingerprintJS CDN (https://github.com/fingerprintjs/cdn) replaces `window.__fpjs_d_m` with `true`\n if (window.__fpjs_d_m || Math.random() >= 0.001) {\n return;\n }\n try {\n var request = new XMLHttpRequest();\n request.open('get', \"https://m1.openfpcdn.io/fingerprintjs/v\".concat(version, \"/npm-monitoring\"), true);\n request.send();\n }\n catch (error) {\n // console.error is ok here because it's an unexpected error handler\n // eslint-disable-next-line no-console\n console.error(error);\n }\n}\n/**\n * Builds an instance of Agent and waits a delay required for a proper operation.\n */\nfunction load(_a) {\n var _b = _a === void 0 ? {} : _a, delayFallback = _b.delayFallback, debug = _b.debug, _c = _b.monitoring, monitoring = _c === void 0 ? true : _c;\n return __awaiter(this, void 0, void 0, function () {\n var getComponents;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n if (monitoring) {\n monitor();\n }\n return [4 /*yield*/, prepareForSources(delayFallback)];\n case 1:\n _d.sent();\n getComponents = loadBuiltinSources({ debug: debug });\n return [2 /*return*/, makeAgent(getComponents, debug)];\n }\n });\n });\n}\n\n// The default export is a syntax sugar (`import * as FP from '...' → import FP from '...'`).\n// It should contain all the public exported values.\nvar index = { load: load, hashComponents: hashComponents, componentsToDebugString: componentsToDebugString };\n// The exports below are for private usage. They may change unexpectedly. Use them at your own risk.\n/** Not documented, out of Semantic Versioning, usage is at your own risk */\nvar murmurX64Hash128 = x64hash128;\n\nexport { componentsToDebugString, index as default, getFullscreenElement, getScreenFrame, hashComponents, isAndroid, isChromium, isDesktopSafari, isEdgeHTML, isGecko, isTrident, isWebKit, load, loadSources, murmurX64Hash128, prepareForSources, sources, transformSource, withIframe };\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a function');\n};\n","'use strict';\nvar isConstructor = require('../internals/is-constructor');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsConstructor(argument) is true`\nmodule.exports = function (argument) {\n if (isConstructor(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a constructor');\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument)) return argument;\n throw $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar create = require('../internals/object-create');\nvar defineProperty = require('../internals/object-define-property').f;\n\nvar UNSCOPABLES = wellKnownSymbol('unscopables');\nvar ArrayPrototype = Array.prototype;\n\n// Array.prototype[@@unscopables]\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\nif (ArrayPrototype[UNSCOPABLES] === undefined) {\n defineProperty(ArrayPrototype, UNSCOPABLES, {\n configurable: true,\n value: create(null)\n });\n}\n\n// add a key to Array.prototype[@@unscopables]\nmodule.exports = function (key) {\n ArrayPrototype[UNSCOPABLES][key] = true;\n};\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\n\n// `AdvanceStringIndex` abstract operation\n// https://tc39.es/ecma262/#sec-advancestringindex\nmodule.exports = function (S, index, unicode) {\n return index + (unicode ? charAt(S, index).length : 1);\n};\n","'use strict';\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (it, Prototype) {\n if (isPrototypeOf(Prototype, it)) return it;\n throw $TypeError('Incorrect invocation');\n};\n","'use strict';\nvar isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw $TypeError($String(argument) + ' is not an object');\n};\n","'use strict';\n// eslint-disable-next-line es/no-typed-arrays -- safe\nmodule.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';\n","'use strict';\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar hasOwn = require('../internals/has-own-property');\nvar classof = require('../internals/classof');\nvar tryToString = require('../internals/try-to-string');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar uid = require('../internals/uid');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\nvar Int8Array = global.Int8Array;\nvar Int8ArrayPrototype = Int8Array && Int8Array.prototype;\nvar Uint8ClampedArray = global.Uint8ClampedArray;\nvar Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;\nvar TypedArray = Int8Array && getPrototypeOf(Int8Array);\nvar TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);\nvar ObjectPrototype = Object.prototype;\nvar TypeError = global.TypeError;\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');\nvar TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';\n// Fixing native typed arrays in Opera Presto crashes the browser, see #595\nvar NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera';\nvar TYPED_ARRAY_TAG_REQUIRED = false;\nvar NAME, Constructor, Prototype;\n\nvar TypedArrayConstructorsList = {\n Int8Array: 1,\n Uint8Array: 1,\n Uint8ClampedArray: 1,\n Int16Array: 2,\n Uint16Array: 2,\n Int32Array: 4,\n Uint32Array: 4,\n Float32Array: 4,\n Float64Array: 8\n};\n\nvar BigIntArrayConstructorsList = {\n BigInt64Array: 8,\n BigUint64Array: 8\n};\n\nvar isView = function isView(it) {\n if (!isObject(it)) return false;\n var klass = classof(it);\n return klass === 'DataView'\n || hasOwn(TypedArrayConstructorsList, klass)\n || hasOwn(BigIntArrayConstructorsList, klass);\n};\n\nvar getTypedArrayConstructor = function (it) {\n var proto = getPrototypeOf(it);\n if (!isObject(proto)) return;\n var state = getInternalState(proto);\n return (state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR)) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto);\n};\n\nvar isTypedArray = function (it) {\n if (!isObject(it)) return false;\n var klass = classof(it);\n return hasOwn(TypedArrayConstructorsList, klass)\n || hasOwn(BigIntArrayConstructorsList, klass);\n};\n\nvar aTypedArray = function (it) {\n if (isTypedArray(it)) return it;\n throw TypeError('Target is not a typed array');\n};\n\nvar aTypedArrayConstructor = function (C) {\n if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C;\n throw TypeError(tryToString(C) + ' is not a typed array constructor');\n};\n\nvar exportTypedArrayMethod = function (KEY, property, forced, options) {\n if (!DESCRIPTORS) return;\n if (forced) for (var ARRAY in TypedArrayConstructorsList) {\n var TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) try {\n delete TypedArrayConstructor.prototype[KEY];\n } catch (error) {\n // old WebKit bug - some methods are non-configurable\n try {\n TypedArrayConstructor.prototype[KEY] = property;\n } catch (error2) { /* empty */ }\n }\n }\n if (!TypedArrayPrototype[KEY] || forced) {\n defineBuiltIn(TypedArrayPrototype, KEY, forced ? property\n : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);\n }\n};\n\nvar exportTypedArrayStaticMethod = function (KEY, property, forced) {\n var ARRAY, TypedArrayConstructor;\n if (!DESCRIPTORS) return;\n if (setPrototypeOf) {\n if (forced) for (ARRAY in TypedArrayConstructorsList) {\n TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try {\n delete TypedArrayConstructor[KEY];\n } catch (error) { /* empty */ }\n }\n if (!TypedArray[KEY] || forced) {\n // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable\n try {\n return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);\n } catch (error) { /* empty */ }\n } else return;\n }\n for (ARRAY in TypedArrayConstructorsList) {\n TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {\n defineBuiltIn(TypedArrayConstructor, KEY, property);\n }\n }\n};\n\nfor (NAME in TypedArrayConstructorsList) {\n Constructor = global[NAME];\n Prototype = Constructor && Constructor.prototype;\n if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;\n else NATIVE_ARRAY_BUFFER_VIEWS = false;\n}\n\nfor (NAME in BigIntArrayConstructorsList) {\n Constructor = global[NAME];\n Prototype = Constructor && Constructor.prototype;\n if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;\n}\n\n// WebKit bug - typed arrays constructors prototype is Object.prototype\nif (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {\n // eslint-disable-next-line no-shadow -- safe\n TypedArray = function TypedArray() {\n throw TypeError('Incorrect invocation');\n };\n if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {\n if (global[NAME]) setPrototypeOf(global[NAME], TypedArray);\n }\n}\n\nif (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {\n TypedArrayPrototype = TypedArray.prototype;\n if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {\n if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype);\n }\n}\n\n// WebKit bug - one more object in Uint8ClampedArray prototype chain\nif (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {\n setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);\n}\n\nif (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) {\n TYPED_ARRAY_TAG_REQUIRED = true;\n defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, {\n configurable: true,\n get: function () {\n return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;\n }\n });\n for (NAME in TypedArrayConstructorsList) if (global[NAME]) {\n createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME);\n }\n}\n\nmodule.exports = {\n NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,\n TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,\n aTypedArray: aTypedArray,\n aTypedArrayConstructor: aTypedArrayConstructor,\n exportTypedArrayMethod: exportTypedArrayMethod,\n exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,\n getTypedArrayConstructor: getTypedArrayConstructor,\n isView: isView,\n isTypedArray: isTypedArray,\n TypedArray: TypedArray,\n TypedArrayPrototype: TypedArrayPrototype\n};\n","'use strict';\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection');\nvar FunctionName = require('../internals/function-name');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar defineBuiltIns = require('../internals/define-built-ins');\nvar fails = require('../internals/fails');\nvar anInstance = require('../internals/an-instance');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toLength = require('../internals/to-length');\nvar toIndex = require('../internals/to-index');\nvar IEEE754 = require('../internals/ieee754');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar arrayFill = require('../internals/array-fill');\nvar arraySlice = require('../internals/array-slice-simple');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar PROPER_FUNCTION_NAME = FunctionName.PROPER;\nvar CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length';\nvar WRONG_INDEX = 'Wrong index';\nvar getInternalArrayBufferState = InternalStateModule.getterFor(ARRAY_BUFFER);\nvar getInternalDataViewState = InternalStateModule.getterFor(DATA_VIEW);\nvar setInternalState = InternalStateModule.set;\nvar NativeArrayBuffer = global[ARRAY_BUFFER];\nvar $ArrayBuffer = NativeArrayBuffer;\nvar ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE];\nvar $DataView = global[DATA_VIEW];\nvar DataViewPrototype = $DataView && $DataView[PROTOTYPE];\nvar ObjectPrototype = Object.prototype;\nvar Array = global.Array;\nvar RangeError = global.RangeError;\nvar fill = uncurryThis(arrayFill);\nvar reverse = uncurryThis([].reverse);\n\nvar packIEEE754 = IEEE754.pack;\nvar unpackIEEE754 = IEEE754.unpack;\n\nvar packInt8 = function (number) {\n return [number & 0xFF];\n};\n\nvar packInt16 = function (number) {\n return [number & 0xFF, number >> 8 & 0xFF];\n};\n\nvar packInt32 = function (number) {\n return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF];\n};\n\nvar unpackInt32 = function (buffer) {\n return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];\n};\n\nvar packFloat32 = function (number) {\n return packIEEE754(number, 23, 4);\n};\n\nvar packFloat64 = function (number) {\n return packIEEE754(number, 52, 8);\n};\n\nvar addGetter = function (Constructor, key, getInternalState) {\n defineBuiltInAccessor(Constructor[PROTOTYPE], key, {\n configurable: true,\n get: function () {\n return getInternalState(this)[key];\n }\n });\n};\n\nvar get = function (view, count, index, isLittleEndian) {\n var store = getInternalDataViewState(view);\n var intIndex = toIndex(index);\n var boolIsLittleEndian = !!isLittleEndian;\n if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);\n var bytes = store.bytes;\n var start = intIndex + store.byteOffset;\n var pack = arraySlice(bytes, start, start + count);\n return boolIsLittleEndian ? pack : reverse(pack);\n};\n\nvar set = function (view, count, index, conversion, value, isLittleEndian) {\n var store = getInternalDataViewState(view);\n var intIndex = toIndex(index);\n var pack = conversion(+value);\n var boolIsLittleEndian = !!isLittleEndian;\n if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);\n var bytes = store.bytes;\n var start = intIndex + store.byteOffset;\n for (var i = 0; i < count; i++) bytes[start + i] = pack[boolIsLittleEndian ? i : count - i - 1];\n};\n\nif (!NATIVE_ARRAY_BUFFER) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, ArrayBufferPrototype);\n var byteLength = toIndex(length);\n setInternalState(this, {\n type: ARRAY_BUFFER,\n bytes: fill(Array(byteLength), 0),\n byteLength: byteLength\n });\n if (!DESCRIPTORS) {\n this.byteLength = byteLength;\n this.detached = false;\n }\n };\n\n ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE];\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, DataViewPrototype);\n anInstance(buffer, ArrayBufferPrototype);\n var bufferState = getInternalArrayBufferState(buffer);\n var bufferLength = bufferState.byteLength;\n var offset = toIntegerOrInfinity(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n setInternalState(this, {\n type: DATA_VIEW,\n buffer: buffer,\n byteLength: byteLength,\n byteOffset: offset,\n bytes: bufferState.bytes\n });\n if (!DESCRIPTORS) {\n this.buffer = buffer;\n this.byteLength = byteLength;\n this.byteOffset = offset;\n }\n };\n\n DataViewPrototype = $DataView[PROTOTYPE];\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, 'byteLength', getInternalArrayBufferState);\n addGetter($DataView, 'buffer', getInternalDataViewState);\n addGetter($DataView, 'byteLength', getInternalDataViewState);\n addGetter($DataView, 'byteOffset', getInternalDataViewState);\n }\n\n defineBuiltIns(DataViewPrototype, {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false)) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false), 23);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : false), 52);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packInt8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packInt8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : false);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : false);\n }\n });\n} else {\n var INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER;\n /* eslint-disable no-new -- required for testing */\n if (!fails(function () {\n NativeArrayBuffer(1);\n }) || !fails(function () {\n new NativeArrayBuffer(-1);\n }) || fails(function () {\n new NativeArrayBuffer();\n new NativeArrayBuffer(1.5);\n new NativeArrayBuffer(NaN);\n return NativeArrayBuffer.length !== 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;\n })) {\n /* eslint-enable no-new -- required for testing */\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, ArrayBufferPrototype);\n return new NativeArrayBuffer(toIndex(length));\n };\n\n $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype;\n\n for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) {\n createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]);\n }\n }\n\n ArrayBufferPrototype.constructor = $ArrayBuffer;\n } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) {\n createNonEnumerableProperty(NativeArrayBuffer, 'name', ARRAY_BUFFER);\n }\n\n // WebKit bug - the same parent prototype for typed arrays and data view\n if (setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) {\n setPrototypeOf(DataViewPrototype, ObjectPrototype);\n }\n\n // iOS Safari 7.x bug\n var testView = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = uncurryThis(DataViewPrototype.setInt8);\n testView.setInt8(0, 2147483648);\n testView.setInt8(1, 2147483649);\n if (testView.getInt8(0) || !testView.getInt8(1)) defineBuiltIns(DataViewPrototype, {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8(this, byteOffset, value << 24 >> 24);\n }\n }, { unsafe: true });\n}\n\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\n\nmodule.exports = {\n ArrayBuffer: $ArrayBuffer,\n DataView: $DataView\n};\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar deletePropertyOrThrow = require('../internals/delete-property-or-throw');\n\nvar min = Math.min;\n\n// `Array.prototype.copyWithin` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.copywithin\n// eslint-disable-next-line es/no-array-prototype-copywithin -- safe\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = lengthOfArrayLike(O);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else deletePropertyOrThrow(O, to);\n to += inc;\n from += inc;\n } return O;\n};\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.fill` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.fill\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = lengthOfArrayLike(O);\n var argumentsLength = arguments.length;\n var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);\n var end = argumentsLength > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","'use strict';\nvar $forEach = require('../internals/array-iteration').forEach;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar STRICT_METHOD = arrayMethodIsStrict('forEach');\n\n// `Array.prototype.forEach` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.foreach\nmodule.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n// eslint-disable-next-line es/no-array-prototype-foreach -- safe\n} : [].forEach;\n","'use strict';\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\nmodule.exports = function (Constructor, list) {\n var index = 0;\n var length = lengthOfArrayLike(list);\n var result = new Constructor(length);\n while (length > index) result[index] = list[index++];\n return result;\n};\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el !== el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value !== value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar IndexedObject = require('../internals/indexed-object');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\nvar push = uncurryThis([].push);\n\n// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation\nvar createMethod = function (TYPE) {\n var IS_MAP = TYPE === 1;\n var IS_FILTER = TYPE === 2;\n var IS_SOME = TYPE === 3;\n var IS_EVERY = TYPE === 4;\n var IS_FIND_INDEX = TYPE === 6;\n var IS_FILTER_REJECT = TYPE === 7;\n var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;\n return function ($this, callbackfn, that, specificCreate) {\n var O = toObject($this);\n var self = IndexedObject(O);\n var boundFunction = bind(callbackfn, that);\n var length = lengthOfArrayLike(self);\n var index = 0;\n var create = specificCreate || arraySpeciesCreate;\n var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;\n var value, result;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n value = self[index];\n result = boundFunction(value, index, O);\n if (TYPE) {\n if (IS_MAP) target[index] = result; // map\n else if (result) switch (TYPE) {\n case 3: return true; // some\n case 5: return value; // find\n case 6: return index; // findIndex\n case 2: push(target, value); // filter\n } else switch (TYPE) {\n case 4: return false; // every\n case 7: push(target, value); // filterReject\n }\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.forEach` method\n // https://tc39.es/ecma262/#sec-array.prototype.foreach\n forEach: createMethod(0),\n // `Array.prototype.map` method\n // https://tc39.es/ecma262/#sec-array.prototype.map\n map: createMethod(1),\n // `Array.prototype.filter` method\n // https://tc39.es/ecma262/#sec-array.prototype.filter\n filter: createMethod(2),\n // `Array.prototype.some` method\n // https://tc39.es/ecma262/#sec-array.prototype.some\n some: createMethod(3),\n // `Array.prototype.every` method\n // https://tc39.es/ecma262/#sec-array.prototype.every\n every: createMethod(4),\n // `Array.prototype.find` method\n // https://tc39.es/ecma262/#sec-array.prototype.find\n find: createMethod(5),\n // `Array.prototype.findIndex` method\n // https://tc39.es/ecma262/#sec-array.prototype.findIndex\n findIndex: createMethod(6),\n // `Array.prototype.filterReject` method\n // https://github.com/tc39/proposal-array-filtering\n filterReject: createMethod(7)\n};\n","'use strict';\n/* eslint-disable es/no-array-prototype-lastindexof -- safe */\nvar apply = require('../internals/function-apply');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar min = Math.min;\nvar $lastIndexOf = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;\nvar STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');\nvar FORCED = NEGATIVE_ZERO || !STRICT_METHOD;\n\n// `Array.prototype.lastIndexOf` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.lastindexof\nmodule.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return apply($lastIndexOf, this, arguments) || 0;\n var O = toIndexedObject(this);\n var length = lengthOfArrayLike(O);\n var index = length - 1;\n if (arguments.length > 1) index = min(index, toIntegerOrInfinity(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;\n return -1;\n} : $lastIndexOf;\n","'use strict';\nvar fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (METHOD_NAME) {\n // We can't use this feature detection in V8 since it causes\n // deoptimization and serious performance degradation\n // https://github.com/zloirock/core-js/issues/677\n return V8_VERSION >= 51 || !fails(function () {\n var array = [];\n var constructor = array.constructor = {};\n constructor[SPECIES] = function () {\n return { foo: 1 };\n };\n return array[METHOD_NAME](Boolean).foo !== 1;\n });\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = function (METHOD_NAME, argument) {\n var method = [][METHOD_NAME];\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call -- required for testing\n method.call(null, argument || function () { return 1; }, 1);\n });\n};\n","'use strict';\nvar aCallable = require('../internals/a-callable');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\nvar $TypeError = TypeError;\n\n// `Array.prototype.{ reduce, reduceRight }` methods implementation\nvar createMethod = function (IS_RIGHT) {\n return function (that, callbackfn, argumentsLength, memo) {\n aCallable(callbackfn);\n var O = toObject(that);\n var self = IndexedObject(O);\n var length = lengthOfArrayLike(O);\n var index = IS_RIGHT ? length - 1 : 0;\n var i = IS_RIGHT ? -1 : 1;\n if (argumentsLength < 2) while (true) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (IS_RIGHT ? index < 0 : length <= index) {\n throw $TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.reduce` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduce\n left: createMethod(false),\n // `Array.prototype.reduceRight` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduceright\n right: createMethod(true)\n};\n","'use strict';\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar createProperty = require('../internals/create-property');\n\nvar $Array = Array;\nvar max = Math.max;\n\nmodule.exports = function (O, start, end) {\n var length = lengthOfArrayLike(O);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n var result = $Array(max(fin - k, 0));\n var n = 0;\n for (; k < fin; k++, n++) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis([].slice);\n","'use strict';\nvar arraySlice = require('../internals/array-slice-simple');\n\nvar floor = Math.floor;\n\nvar mergeSort = function (array, comparefn) {\n var length = array.length;\n var middle = floor(length / 2);\n return length < 8 ? insertionSort(array, comparefn) : merge(\n array,\n mergeSort(arraySlice(array, 0, middle), comparefn),\n mergeSort(arraySlice(array, middle), comparefn),\n comparefn\n );\n};\n\nvar insertionSort = function (array, comparefn) {\n var length = array.length;\n var i = 1;\n var element, j;\n\n while (i < length) {\n j = i;\n element = array[i];\n while (j && comparefn(array[j - 1], element) > 0) {\n array[j] = array[--j];\n }\n if (j !== i++) array[j] = element;\n } return array;\n};\n\nvar merge = function (array, left, right, comparefn) {\n var llength = left.length;\n var rlength = right.length;\n var lindex = 0;\n var rindex = 0;\n\n while (lindex < llength || rindex < rlength) {\n array[lindex + rindex] = (lindex < llength && rindex < rlength)\n ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]\n : lindex < llength ? left[lindex++] : right[rindex++];\n } return array;\n};\n\nmodule.exports = mergeSort;\n","'use strict';\nvar isArray = require('../internals/is-array');\nvar isConstructor = require('../internals/is-constructor');\nvar isObject = require('../internals/is-object');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\nvar $Array = Array;\n\n// a part of `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray) {\n var C;\n if (isArray(originalArray)) {\n C = originalArray.constructor;\n // cross-realm fallback\n if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;\n else if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? $Array : C;\n};\n","'use strict';\nvar arraySpeciesConstructor = require('../internals/array-species-constructor');\n\n// `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray, length) {\n return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n try {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n } catch (error) { return false; } // workaround of old WebKit + `eval` bug\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar isCallable = require('../internals/is-callable');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Object = Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n","'use strict';\nvar hasOwn = require('../internals/has-own-property');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source, exceptions) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n // eslint-disable-next-line es/no-object-getprototypeof -- required for testing\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","'use strict';\n// `CreateIterResultObject` abstract operation\n// https://tc39.es/ecma262/#sec-createiterresultobject\nmodule.exports = function (value, done) {\n return { value: value, done: done };\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","'use strict';\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","'use strict';\nvar toPropertyKey = require('../internals/to-property-key');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPropertyKey(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n};\n","'use strict';\nvar makeBuiltIn = require('../internals/make-built-in');\nvar defineProperty = require('../internals/object-define-property');\n\nmodule.exports = function (target, name, descriptor) {\n if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });\n if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });\n return defineProperty.f(target, name, descriptor);\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar definePropertyModule = require('../internals/object-define-property');\nvar makeBuiltIn = require('../internals/make-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nmodule.exports = function (O, key, value, options) {\n if (!options) options = {};\n var simple = options.enumerable;\n var name = options.name !== undefined ? options.name : key;\n if (isCallable(value)) makeBuiltIn(value, name, options);\n if (options.global) {\n if (simple) O[key] = value;\n else defineGlobalProperty(key, value);\n } else {\n try {\n if (!options.unsafe) delete O[key];\n else if (O[key]) simple = true;\n } catch (error) { /* empty */ }\n if (simple) O[key] = value;\n else definePropertyModule.f(O, key, {\n value: value,\n enumerable: false,\n configurable: !options.nonConfigurable,\n writable: !options.nonWritable\n });\n } return O;\n};\n","'use strict';\nvar defineBuiltIn = require('../internals/define-built-in');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) defineBuiltIn(target, key, src[key], options);\n return target;\n};\n","'use strict';\nvar global = require('../internals/global');\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","'use strict';\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (O, P) {\n if (!delete O[P]) throw $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;\n});\n","'use strict';\nvar documentAll = typeof document == 'object' && document.all;\n\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\n// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing\nvar IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;\n\nmodule.exports = {\n all: documentAll,\n IS_HTMLDDA: IS_HTMLDDA\n};\n","'use strict';\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","'use strict';\nvar $TypeError = TypeError;\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991\n\nmodule.exports = function (it) {\n if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');\n return it;\n};\n","'use strict';\n// iterable DOM collections\n// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods\nmodule.exports = {\n CSSRuleList: 0,\n CSSStyleDeclaration: 0,\n CSSValueList: 0,\n ClientRectList: 0,\n DOMRectList: 0,\n DOMStringList: 0,\n DOMTokenList: 1,\n DataTransferItemList: 0,\n FileList: 0,\n HTMLAllCollection: 0,\n HTMLCollection: 0,\n HTMLFormElement: 0,\n HTMLSelectElement: 0,\n MediaList: 0,\n MimeTypeArray: 0,\n NamedNodeMap: 0,\n NodeList: 1,\n PaintRequestList: 0,\n Plugin: 0,\n PluginArray: 0,\n SVGLengthList: 0,\n SVGNumberList: 0,\n SVGPathSegList: 0,\n SVGPointList: 0,\n SVGStringList: 0,\n SVGTransformList: 0,\n SourceBufferList: 0,\n StyleSheetList: 0,\n TextTrackCueList: 0,\n TextTrackList: 0,\n TouchList: 0\n};\n","'use strict';\n// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`\nvar documentCreateElement = require('../internals/document-create-element');\n\nvar classList = documentCreateElement('span').classList;\nvar DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;\n\nmodule.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;\n","'use strict';\nvar userAgent = require('../internals/engine-user-agent');\n\nvar firefox = userAgent.match(/firefox\\/(\\d+)/i);\n\nmodule.exports = !!firefox && +firefox[1];\n","'use strict';\nvar IS_DENO = require('../internals/engine-is-deno');\nvar IS_NODE = require('../internals/engine-is-node');\n\nmodule.exports = !IS_DENO && !IS_NODE\n && typeof window == 'object'\n && typeof document == 'object';\n","'use strict';\n/* global Deno -- Deno case */\nmodule.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';\n","'use strict';\nvar UA = require('../internals/engine-user-agent');\n\nmodule.exports = /MSIE|Trident/.test(UA);\n","'use strict';\nvar userAgent = require('../internals/engine-user-agent');\n\nmodule.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined';\n","'use strict';\nvar userAgent = require('../internals/engine-user-agent');\n\n// eslint-disable-next-line redos/no-vulnerable -- safe\nmodule.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);\n","'use strict';\nvar global = require('../internals/global');\nvar classof = require('../internals/classof-raw');\n\nmodule.exports = classof(global.process) === 'process';\n","'use strict';\nvar userAgent = require('../internals/engine-user-agent');\n\nmodule.exports = /web0s(?!.*chrome)/i.test(userAgent);\n","'use strict';\nmodule.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';\n","'use strict';\nvar global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","'use strict';\nvar userAgent = require('../internals/engine-user-agent');\n\nvar webkit = userAgent.match(/AppleWebKit\\/(\\d+)\\./);\n\nmodule.exports = !!webkit && +webkit[1];\n","'use strict';\n// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","'use strict';\nvar global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global;\n } else if (STATIC) {\n target = global[TARGET] || defineGlobalProperty(TARGET, {});\n } else {\n target = (global[TARGET] || {}).prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty == typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n defineBuiltIn(target, key, sourceProperty, options);\n }\n};\n","'use strict';\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","'use strict';\n// TODO: Remove from `core-js@4` since it's moved to entry points\nrequire('../modules/es.regexp.exec');\nvar uncurryThis = require('../internals/function-uncurry-this-clause');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar regexpExec = require('../internals/regexp-exec');\nvar fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nvar SPECIES = wellKnownSymbol('species');\nvar RegExpPrototype = RegExp.prototype;\n\nmodule.exports = function (KEY, exec, FORCED, SHAM) {\n var SYMBOL = wellKnownSymbol(KEY);\n\n var DELEGATES_TO_SYMBOL = !fails(function () {\n // String methods call symbol-named RegEp methods\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) !== 7;\n });\n\n var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {\n // Symbol-named RegExp methods call .exec\n var execCalled = false;\n var re = /a/;\n\n if (KEY === 'split') {\n // We can't use real regex here since it causes deoptimization\n // and serious performance degradation in V8\n // https://github.com/zloirock/core-js/issues/306\n re = {};\n // RegExp[@@split] doesn't call the regex's exec method, but first creates\n // a new one. We need to return the patched regex when creating the new one.\n re.constructor = {};\n re.constructor[SPECIES] = function () { return re; };\n re.flags = '';\n re[SYMBOL] = /./[SYMBOL];\n }\n\n re.exec = function () {\n execCalled = true;\n return null;\n };\n\n re[SYMBOL]('');\n return !execCalled;\n });\n\n if (\n !DELEGATES_TO_SYMBOL ||\n !DELEGATES_TO_EXEC ||\n FORCED\n ) {\n var uncurriedNativeRegExpMethod = uncurryThis(/./[SYMBOL]);\n var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {\n var uncurriedNativeMethod = uncurryThis(nativeMethod);\n var $exec = regexp.exec;\n if ($exec === regexpExec || $exec === RegExpPrototype.exec) {\n if (DELEGATES_TO_SYMBOL && !forceStringMethod) {\n // The native String method already delegates to @@method (this\n // polyfilled function), leasing to infinite recursion.\n // We avoid it by directly calling the native @@method method.\n return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };\n }\n return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };\n }\n return { done: false };\n });\n\n defineBuiltIn(String.prototype, KEY, methods[0]);\n defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);\n }\n\n if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);\n};\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this-clause');\nvar aCallable = require('../internals/a-callable');\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar hasOwn = require('../internals/has-own-property');\n\nvar FunctionPrototype = Function.prototype;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\n\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\n// additional protection from minified / mangled / dropped function names\nvar PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));\n\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\n\nmodule.exports = function (object, key, method) {\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));\n } catch (error) { /* empty */ }\n};\n","'use strict';\nvar classofRaw = require('../internals/classof-raw');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = function (fn) {\n // Nashorn bug:\n // https://github.com/zloirock/core-js/issues/1128\n // https://github.com/zloirock/core-js/issues/1130\n if (classofRaw(fn) === 'Function') return uncurryThis(fn);\n};\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar call = FunctionPrototype.call;\nvar uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {\n return function () {\n return call.apply(fn, arguments);\n };\n};\n","'use strict';\nvar global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (argument) {\n return isCallable(argument) ? argument : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];\n};\n","'use strict';\nvar classof = require('../internals/classof');\nvar getMethod = require('../internals/get-method');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)\n || getMethod(it, '@@iterator')\n || Iterators[classof(it)];\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar tryToString = require('../internals/try-to-string');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument, usingIterator) {\n var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;\n if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));\n throw $TypeError(tryToString(argument) + ' is not iterable');\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isArray = require('../internals/is-array');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof-raw');\nvar toString = require('../internals/to-string');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (replacer) {\n if (isCallable(replacer)) return replacer;\n if (!isArray(replacer)) return;\n var rawLength = replacer.length;\n var keys = [];\n for (var i = 0; i < rawLength; i++) {\n var element = replacer[i];\n if (typeof element == 'string') push(keys, element);\n else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') push(keys, toString(element));\n }\n var keysLength = keys.length;\n var root = true;\n return function (key, value) {\n if (root) {\n root = false;\n return value;\n }\n if (isArray(this)) return value;\n for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;\n };\n};\n","'use strict';\nvar aCallable = require('../internals/a-callable');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n","'use strict';\nvar check = function (it) {\n return it && it.Math === Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || this || Function('return this')();\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","'use strict';\nmodule.exports = {};\n","'use strict';\nmodule.exports = function (a, b) {\n try {\n // eslint-disable-next-line no-console -- safe\n arguments.length === 1 ? console.error(a) : console.error(a, b);\n } catch (error) { /* empty */ }\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a !== 7;\n});\n","'use strict';\n// IEEE754 conversions based on https://github.com/feross/ieee754\nvar sign = require('../internals/math-sign');\nvar trunc = require('../internals/math-trunc');\n\nvar $Array = Array;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\n\nvar roundToEven = function (number) {\n var truncated = trunc(number);\n var delta = abs(number - truncated);\n if (delta > 0.5 || delta === 0.5 && truncated % 2 !== 0) {\n return truncated + sign(number);\n } return truncated;\n};\n\nvar pack = function (number, mantissaLength, bytes) {\n var buffer = $Array(bytes);\n var exponentLength = bytes * 8 - mantissaLength - 1;\n var eMax = (1 << exponentLength) - 1;\n var eBias = eMax >> 1;\n var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var s = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;\n var index = 0;\n var exponent, mantissa, c;\n number = abs(number);\n // eslint-disable-next-line no-self-compare -- NaN check\n if (number !== number || number === Infinity) {\n // eslint-disable-next-line no-self-compare -- NaN check\n mantissa = number !== number ? 1 : 0;\n exponent = eMax;\n } else {\n exponent = floor(log(number) / LN2);\n c = pow(2, -exponent);\n if (number * c < 1) {\n exponent--;\n c *= 2;\n }\n if (exponent + eBias >= 1) {\n number += rt / c;\n } else {\n number += rt * pow(2, 1 - eBias);\n }\n if (number * c >= 2) {\n exponent++;\n c /= 2;\n }\n if (exponent + eBias >= eMax) {\n mantissa = 0;\n exponent = eMax;\n } else if (exponent + eBias >= 1) {\n mantissa = roundToEven((number * c - 1) * pow(2, mantissaLength));\n exponent += eBias;\n } else {\n mantissa = roundToEven(number * pow(2, eBias - 1) * pow(2, mantissaLength));\n exponent = 0;\n }\n }\n while (mantissaLength >= 8) {\n buffer[index++] = mantissa & 255;\n mantissa /= 256;\n mantissaLength -= 8;\n }\n exponent = exponent << mantissaLength | mantissa;\n exponentLength += mantissaLength;\n while (exponentLength > 0) {\n buffer[index++] = exponent & 255;\n exponent /= 256;\n exponentLength -= 8;\n }\n buffer[--index] |= s * 128;\n return buffer;\n};\n\nvar unpack = function (buffer, mantissaLength) {\n var bytes = buffer.length;\n var exponentLength = bytes * 8 - mantissaLength - 1;\n var eMax = (1 << exponentLength) - 1;\n var eBias = eMax >> 1;\n var nBits = exponentLength - 7;\n var index = bytes - 1;\n var s = buffer[index--];\n var exponent = s & 127;\n var mantissa;\n s >>= 7;\n while (nBits > 0) {\n exponent = exponent * 256 + buffer[index--];\n nBits -= 8;\n }\n mantissa = exponent & (1 << -nBits) - 1;\n exponent >>= -nBits;\n nBits += mantissaLength;\n while (nBits > 0) {\n mantissa = mantissa * 256 + buffer[index--];\n nBits -= 8;\n }\n if (exponent === 0) {\n exponent = 1 - eBias;\n } else if (exponent === eMax) {\n return mantissa ? NaN : s ? -Infinity : Infinity;\n } else {\n mantissa += pow(2, mantissaLength);\n exponent -= eBias;\n } return (s ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);\n};\n\nmodule.exports = {\n pack: pack,\n unpack: unpack\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) === 'String' ? split(it, '') : $Object(it);\n} : $Object;\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// makes subclassing work correct for wrapped built-ins\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (\n // it can work only with native `setPrototypeOf`\n setPrototypeOf &&\n // we haven't completely correct pre-ES6 way for getting `new.target`, so use this\n isCallable(NewTarget = dummy.constructor) &&\n NewTarget !== Wrapper &&\n isObject(NewTargetPrototype = NewTarget.prototype) &&\n NewTargetPrototype !== Wrapper.prototype\n ) setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar store = require('../internals/shared-store');\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","'use strict';\nvar NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n /* eslint-disable no-self-assign -- prototype methods protection */\n store.get = store.get;\n store.has = store.has;\n store.set = store.set;\n /* eslint-enable no-self-assign -- prototype methods protection */\n set = function (it, metadata) {\n if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n store.set(it, metadata);\n return metadata;\n };\n get = function (it) {\n return store.get(it) || {};\n };\n has = function (it) {\n return store.has(it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","'use strict';\nvar classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.es/ecma262/#sec-isarray\n// eslint-disable-next-line es/no-array-isarray -- safe\nmodule.exports = Array.isArray || function isArray(argument) {\n return classof(argument) === 'Array';\n};\n","'use strict';\nvar classof = require('../internals/classof');\n\nmodule.exports = function (it) {\n var klass = classof(it);\n return klass === 'BigInt64Array' || klass === 'BigUint64Array';\n};\n","'use strict';\nvar $documentAll = require('../internals/document-all');\n\nvar documentAll = $documentAll.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\nmodule.exports = $documentAll.IS_HTMLDDA ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof');\nvar getBuiltIn = require('../internals/get-built-in');\nvar inspectSource = require('../internals/inspect-source');\n\nvar noop = function () { /* empty */ };\nvar empty = [];\nvar construct = getBuiltIn('Reflect', 'construct');\nvar constructorRegExp = /^\\s*(?:class|function)\\b/;\nvar exec = uncurryThis(constructorRegExp.exec);\nvar INCORRECT_TO_STRING = !constructorRegExp.exec(noop);\n\nvar isConstructorModern = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n try {\n construct(noop, empty, argument);\n return true;\n } catch (error) {\n return false;\n }\n};\n\nvar isConstructorLegacy = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n switch (classof(argument)) {\n case 'AsyncFunction':\n case 'GeneratorFunction':\n case 'AsyncGeneratorFunction': return false;\n }\n try {\n // we can't check .prototype since constructors produced by .bind haven't it\n // `Function#toString` throws on some built-it function in some legacy engines\n // (for example, `DOMQuad` and similar in FF41-)\n return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));\n } catch (error) {\n return true;\n }\n};\n\nisConstructorLegacy.sham = true;\n\n// `IsConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-isconstructor\nmodule.exports = !construct || fails(function () {\n var called;\n return isConstructorModern(isConstructorModern.call)\n || !isConstructorModern(Object)\n || !isConstructorModern(function () { called = true; })\n || called;\n}) ? isConstructorLegacy : isConstructorModern;\n","'use strict';\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value === POLYFILL ? true\n : value === NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","'use strict';\nvar isObject = require('../internals/is-object');\n\nvar floor = Math.floor;\n\n// `IsIntegralNumber` abstract operation\n// https://tc39.es/ecma262/#sec-isintegralnumber\n// eslint-disable-next-line es/no-number-isinteger -- safe\nmodule.exports = Number.isInteger || function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n","'use strict';\n// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar $documentAll = require('../internals/document-all');\n\nvar documentAll = $documentAll.all;\n\nmodule.exports = $documentAll.IS_HTMLDDA ? function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;\n} : function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","'use strict';\nmodule.exports = false;\n","'use strict';\nvar isObject = require('../internals/is-object');\nvar classof = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\n// `IsRegExp` abstract operation\n// https://tc39.es/ecma262/#sec-isregexp\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar tryToString = require('../internals/try-to-string');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar iteratorClose = require('../internals/iterator-close');\n\nvar $TypeError = TypeError;\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nvar ResultPrototype = Result.prototype;\n\nmodule.exports = function (iterable, unboundFunction, options) {\n var that = options && options.that;\n var AS_ENTRIES = !!(options && options.AS_ENTRIES);\n var IS_RECORD = !!(options && options.IS_RECORD);\n var IS_ITERATOR = !!(options && options.IS_ITERATOR);\n var INTERRUPTED = !!(options && options.INTERRUPTED);\n var fn = bind(unboundFunction, that);\n var iterator, iterFn, index, length, result, next, step;\n\n var stop = function (condition) {\n if (iterator) iteratorClose(iterator, 'normal', condition);\n return new Result(true, condition);\n };\n\n var callFn = function (value) {\n if (AS_ENTRIES) {\n anObject(value);\n return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);\n } return INTERRUPTED ? fn(value, stop) : fn(value);\n };\n\n if (IS_RECORD) {\n iterator = iterable.iterator;\n } else if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {\n result = callFn(iterable[index]);\n if (result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n }\n iterator = getIterator(iterable, iterFn);\n }\n\n next = IS_RECORD ? iterable.next : iterator.next;\n while (!(step = call(next, iterator)).done) {\n try {\n result = callFn(step.value);\n } catch (error) {\n iteratorClose(iterator, 'throw', error);\n }\n if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar getMethod = require('../internals/get-method');\n\nmodule.exports = function (iterator, kind, value) {\n var innerResult, innerError;\n anObject(iterator);\n try {\n innerResult = getMethod(iterator, 'return');\n if (!innerResult) {\n if (kind === 'throw') throw value;\n return value;\n }\n innerResult = call(innerResult, iterator);\n } catch (error) {\n innerError = true;\n innerResult = error;\n }\n if (kind === 'throw') throw value;\n if (innerError) throw innerResult;\n anObject(innerResult);\n return value;\n};\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar IS_PURE = require('../internals/is-pure');\nvar FunctionName = require('../internals/function-name');\nvar isCallable = require('../internals/is-callable');\nvar createIteratorConstructor = require('../internals/iterator-create-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar PROPER_FUNCTION_NAME = FunctionName.PROPER;\nvar CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];\n\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n }\n\n return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {\n defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array.prototype.{ values, @@iterator }.name in V8 / FF\n if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {\n createNonEnumerableProperty(IterablePrototype, 'name', VALUES);\n } else {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return call(nativeIterator, this); };\n }\n }\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n defineBuiltIn(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });\n }\n Iterators[NAME] = defaultIterator;\n\n return methods;\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar create = require('../internals/object-create');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\n// `%IteratorPrototype%` object\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\n/* eslint-disable es/no-array-prototype-keys -- safe */\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nvar NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {\n var test = {};\n // FF44- legacy iterators case\n return IteratorPrototype[ITERATOR].call(test) !== test;\n});\n\nif (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};\nelse if (IS_PURE) IteratorPrototype = create(IteratorPrototype);\n\n// `%IteratorPrototype%[@@iterator]()` method\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator\nif (!isCallable(IteratorPrototype[ITERATOR])) {\n defineBuiltIn(IteratorPrototype, ITERATOR, function () {\n return this;\n });\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","'use strict';\nmodule.exports = {};\n","'use strict';\nvar toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE;\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\nvar $String = String;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\nvar stringSlice = uncurryThis(''.slice);\nvar replace = uncurryThis(''.replace);\nvar join = uncurryThis([].join);\n\nvar CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {\n return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;\n});\n\nvar TEMPLATE = String(String).split('String');\n\nvar makeBuiltIn = module.exports = function (value, name, options) {\n if (stringSlice($String(name), 0, 7) === 'Symbol(') {\n name = '[' + replace($String(name), /^Symbol\\(([^)]*)\\)/, '$1') + ']';\n }\n if (options && options.getter) name = 'get ' + name;\n if (options && options.setter) name = 'set ' + name;\n if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {\n if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });\n else value.name = name;\n }\n if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {\n defineProperty(value, 'length', { value: options.arity });\n }\n try {\n if (options && hasOwn(options, 'constructor') && options.constructor) {\n if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });\n // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable\n } else if (value.prototype) value.prototype = undefined;\n } catch (error) { /* empty */ }\n var state = enforceInternalState(value);\n if (!hasOwn(state, 'source')) {\n state.source = join(TEMPLATE, typeof name == 'string' ? name : '');\n } return value;\n};\n\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n// eslint-disable-next-line no-extend-native -- required\nFunction.prototype.toString = makeBuiltIn(function toString() {\n return isCallable(this) && getInternalState(this).source || inspectSource(this);\n}, 'toString');\n","'use strict';\n// `Math.sign` method implementation\n// https://tc39.es/ecma262/#sec-math.sign\n// eslint-disable-next-line es/no-math-sign -- safe\nmodule.exports = Math.sign || function sign(x) {\n var n = +x;\n // eslint-disable-next-line no-self-compare -- NaN check\n return n === 0 || n !== n ? n : n < 0 ? -1 : 1;\n};\n","'use strict';\nvar ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.es/ecma262/#sec-math.trunc\n// eslint-disable-next-line es/no-math-trunc -- safe\nmodule.exports = Math.trunc || function trunc(x) {\n var n = +x;\n return (n > 0 ? floor : ceil)(n);\n};\n","'use strict';\nvar global = require('../internals/global');\nvar bind = require('../internals/function-bind-context');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar macrotask = require('../internals/task').set;\nvar Queue = require('../internals/queue');\nvar IS_IOS = require('../internals/engine-is-ios');\nvar IS_IOS_PEBBLE = require('../internals/engine-is-ios-pebble');\nvar IS_WEBOS_WEBKIT = require('../internals/engine-is-webos-webkit');\nvar IS_NODE = require('../internals/engine-is-node');\n\nvar MutationObserver = global.MutationObserver || global.WebKitMutationObserver;\nvar document = global.document;\nvar process = global.process;\nvar Promise = global.Promise;\n// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`\nvar queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');\nvar microtask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;\nvar notify, toggle, node, promise, then;\n\n// modern engines have queueMicrotask method\nif (!microtask) {\n var queue = new Queue();\n\n var flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain)) parent.exit();\n while (fn = queue.get()) try {\n fn();\n } catch (error) {\n if (queue.head) notify();\n throw error;\n }\n if (parent) parent.enter();\n };\n\n // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339\n // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898\n if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n promise = Promise.resolve(undefined);\n // workaround of WebKit ~ iOS Safari 10.1 bug\n promise.constructor = Promise;\n then = bind(promise.then, promise);\n notify = function () {\n then(flush);\n };\n // Node.js without promises\n } else if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessage\n // - onreadystatechange\n // - setTimeout\n } else {\n // `webpack` dev server bug on IE global methods - use bind(fn, global)\n macrotask = bind(macrotask, global);\n notify = function () {\n macrotask(flush);\n };\n }\n\n microtask = function (fn) {\n if (!queue.head) notify();\n queue.add(fn);\n };\n}\n\nmodule.exports = microtask;\n","'use strict';\nvar aCallable = require('../internals/a-callable');\n\nvar $TypeError = TypeError;\n\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw $TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aCallable(resolve);\n this.reject = aCallable(reject);\n};\n\n// `NewPromiseCapability` abstract operation\n// https://tc39.es/ecma262/#sec-newpromisecapability\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","'use strict';\n/* global ActiveXObject -- old IE, WSH */\nvar anObject = require('../internals/an-object');\nvar definePropertiesModule = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n activeXDocument = new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = typeof document != 'undefined'\n ? document.domain && activeXDocument\n ? NullProtoObjectViaActiveX(activeXDocument) // old IE\n : NullProtoObjectViaIFrame()\n : NullProtoObjectViaActiveX(activeXDocument); // WSH\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.es/ecma262/#sec-object.create\n// eslint-disable-next-line es/no-object-create -- safe\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : definePropertiesModule.f(result, Properties);\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.es/ecma262/#sec-object.defineproperties\n// eslint-disable-next-line es/no-object-defineproperties -- safe\nexports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var props = toIndexedObject(Properties);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);\n return O;\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","'use strict';\n/* eslint-disable es/no-object-getownpropertynames -- safe */\nvar classof = require('../internals/classof-raw');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar $getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar arraySlice = require('../internals/array-slice-simple');\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return $getOwnPropertyNames(it);\n } catch (error) {\n return arraySlice(windowNames);\n }\n};\n\n// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && classof(it) === 'Window'\n ? getWindowNames(it)\n : $getOwnPropertyNames(toIndexedObject(it));\n};\n","'use strict';\nvar internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","'use strict';\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe\nexports.f = Object.getOwnPropertySymbols;\n","'use strict';\nvar hasOwn = require('../internals/has-own-property');\nvar isCallable = require('../internals/is-callable');\nvar toObject = require('../internals/to-object');\nvar sharedKey = require('../internals/shared-key');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar $Object = Object;\nvar ObjectPrototype = $Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.getprototypeof\n// eslint-disable-next-line es/no-object-getprototypeof -- safe\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {\n var object = toObject(O);\n if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];\n var constructor = object.constructor;\n if (isCallable(constructor) && object instanceof constructor) {\n return constructor.prototype;\n } return object instanceof $Object ? ObjectPrototype : null;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n","'use strict';\nvar internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\n// `Object.keys` method\n// https://tc39.es/ecma262/#sec-object.keys\n// eslint-disable-next-line es/no-object-keys -- safe\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","'use strict';\n/* eslint-disable no-proto -- safe */\nvar uncurryThisAccessor = require('../internals/function-uncurry-this-accessor');\nvar anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classof = require('../internals/classof');\n\n// `Object.prototype.toString` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.tostring\nmodule.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {\n return '[object ' + classof(this) + ']';\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw $TypeError(\"Can't convert object to primitive value\");\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\nvar concat = uncurryThis([].concat);\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n","'use strict';\nvar global = require('../internals/global');\n\nmodule.exports = global;\n","'use strict';\nmodule.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n","'use strict';\nvar global = require('../internals/global');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar isCallable = require('../internals/is-callable');\nvar isForced = require('../internals/is-forced');\nvar inspectSource = require('../internals/inspect-source');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_BROWSER = require('../internals/engine-is-browser');\nvar IS_DENO = require('../internals/engine-is-deno');\nvar IS_PURE = require('../internals/is-pure');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\nvar SPECIES = wellKnownSymbol('species');\nvar SUBCLASSING = false;\nvar NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);\n\nvar FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {\n var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);\n var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);\n // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // We can't detect it synchronously, so just check versions\n if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;\n // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution\n if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;\n // We can't use @@species feature detection in V8 since it causes\n // deoptimization and performance degradation\n // https://github.com/zloirock/core-js/issues/679\n if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {\n // Detect correctness of subclassing with @@species support\n var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });\n var FakePromise = function (exec) {\n exec(function () { /* empty */ }, function () { /* empty */ });\n };\n var constructor = promise.constructor = {};\n constructor[SPECIES] = FakePromise;\n SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;\n if (!SUBCLASSING) return true;\n // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT;\n});\n\nmodule.exports = {\n CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,\n REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,\n SUBCLASSING: SUBCLASSING\n};\n","'use strict';\nvar global = require('../internals/global');\n\nmodule.exports = global.Promise;\n","'use strict';\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","'use strict';\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\n\nmodule.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {\n NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });\n});\n","'use strict';\nvar Queue = function () {\n this.head = null;\n this.tail = null;\n};\n\nQueue.prototype = {\n add: function (item) {\n var entry = { item: item, next: null };\n var tail = this.tail;\n if (tail) tail.next = entry;\n else this.head = entry;\n this.tail = entry;\n },\n get: function () {\n var entry = this.head;\n if (entry) {\n var next = this.head = entry.next;\n if (next === null) this.tail = null;\n return entry.item;\n }\n }\n};\n\nmodule.exports = Queue;\n","'use strict';\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof-raw');\nvar regexpExec = require('../internals/regexp-exec');\n\nvar $TypeError = TypeError;\n\n// `RegExpExec` abstract operation\n// https://tc39.es/ecma262/#sec-regexpexec\nmodule.exports = function (R, S) {\n var exec = R.exec;\n if (isCallable(exec)) {\n var result = call(exec, R, S);\n if (result !== null) anObject(result);\n return result;\n }\n if (classof(R) === 'RegExp') return call(regexpExec, R, S);\n throw $TypeError('RegExp#exec called on incompatible receiver');\n};\n","'use strict';\n/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */\n/* eslint-disable regexp/no-useless-quantifier -- testing */\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toString = require('../internals/to-string');\nvar regexpFlags = require('../internals/regexp-flags');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar shared = require('../internals/shared');\nvar create = require('../internals/object-create');\nvar getInternalState = require('../internals/internal-state').get;\nvar UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all');\nvar UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg');\n\nvar nativeReplace = shared('native-string-replace', String.prototype.replace);\nvar nativeExec = RegExp.prototype.exec;\nvar patchedExec = nativeExec;\nvar charAt = uncurryThis(''.charAt);\nvar indexOf = uncurryThis(''.indexOf);\nvar replace = uncurryThis(''.replace);\nvar stringSlice = uncurryThis(''.slice);\n\nvar UPDATES_LAST_INDEX_WRONG = (function () {\n var re1 = /a/;\n var re2 = /b*/g;\n call(nativeExec, re1, 'a');\n call(nativeExec, re2, 'a');\n return re1.lastIndex !== 0 || re2.lastIndex !== 0;\n})();\n\nvar UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;\n\n// nonparticipating capturing group, copied from es5-shim's String#split patch.\nvar NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;\n\nvar PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;\n\nif (PATCH) {\n patchedExec = function exec(string) {\n var re = this;\n var state = getInternalState(re);\n var str = toString(string);\n var raw = state.raw;\n var result, reCopy, lastIndex, match, i, object, group;\n\n if (raw) {\n raw.lastIndex = re.lastIndex;\n result = call(patchedExec, raw, str);\n re.lastIndex = raw.lastIndex;\n return result;\n }\n\n var groups = state.groups;\n var sticky = UNSUPPORTED_Y && re.sticky;\n var flags = call(regexpFlags, re);\n var source = re.source;\n var charsAdded = 0;\n var strCopy = str;\n\n if (sticky) {\n flags = replace(flags, 'y', '');\n if (indexOf(flags, 'g') === -1) {\n flags += 'g';\n }\n\n strCopy = stringSlice(str, re.lastIndex);\n // Support anchored sticky behavior.\n if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\\n')) {\n source = '(?: ' + source + ')';\n strCopy = ' ' + strCopy;\n charsAdded++;\n }\n // ^(? + rx + ) is needed, in combination with some str slicing, to\n // simulate the 'y' flag.\n reCopy = new RegExp('^(?:' + source + ')', flags);\n }\n\n if (NPCG_INCLUDED) {\n reCopy = new RegExp('^' + source + '$(?!\\\\s)', flags);\n }\n if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;\n\n match = call(nativeExec, sticky ? reCopy : re, strCopy);\n\n if (sticky) {\n if (match) {\n match.input = stringSlice(match.input, charsAdded);\n match[0] = stringSlice(match[0], charsAdded);\n match.index = re.lastIndex;\n re.lastIndex += match[0].length;\n } else re.lastIndex = 0;\n } else if (UPDATES_LAST_INDEX_WRONG && match) {\n re.lastIndex = re.global ? match.index + match[0].length : lastIndex;\n }\n if (NPCG_INCLUDED && match && match.length > 1) {\n // Fix browsers whose `exec` methods don't consistently return `undefined`\n // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/\n call(nativeReplace, match[0], reCopy, function () {\n for (i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undefined) match[i] = undefined;\n }\n });\n }\n\n if (match && groups) {\n match.groups = object = create(null);\n for (i = 0; i < groups.length; i++) {\n group = groups[i];\n object[group[0]] = match[group[1]];\n }\n }\n\n return match;\n };\n}\n\nmodule.exports = patchedExec;\n","'use strict';\nvar anObject = require('../internals/an-object');\n\n// `RegExp.prototype.flags` getter implementation\n// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.hasIndices) result += 'd';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.dotAll) result += 's';\n if (that.unicode) result += 'u';\n if (that.unicodeSets) result += 'v';\n if (that.sticky) result += 'y';\n return result;\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\n\n// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError\nvar $RegExp = global.RegExp;\n\nvar UNSUPPORTED_Y = fails(function () {\n var re = $RegExp('a', 'y');\n re.lastIndex = 2;\n return re.exec('abcd') !== null;\n});\n\n// UC Browser bug\n// https://github.com/zloirock/core-js/issues/1008\nvar MISSED_STICKY = UNSUPPORTED_Y || fails(function () {\n return !$RegExp('a', 'y').sticky;\n});\n\nvar BROKEN_CARET = UNSUPPORTED_Y || fails(function () {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=773687\n var re = $RegExp('^r', 'gy');\n re.lastIndex = 2;\n return re.exec('str') !== null;\n});\n\nmodule.exports = {\n BROKEN_CARET: BROKEN_CARET,\n MISSED_STICKY: MISSED_STICKY,\n UNSUPPORTED_Y: UNSUPPORTED_Y\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\n\n// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError\nvar $RegExp = global.RegExp;\n\nmodule.exports = fails(function () {\n var re = $RegExp('.', 's');\n return !(re.dotAll && re.exec('\\n') && re.flags === 's');\n});\n","'use strict';\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\n\n// babel-minify and Closure Compiler transpiles RegExp('(?
b)', 'g') -> /(?b)/g and it causes SyntaxError\nvar $RegExp = global.RegExp;\n\nmodule.exports = fails(function () {\n var re = $RegExp('(?b)', 'g');\n return re.exec('b').groups.a !== 'b' ||\n 'b'.replace(re, '$c') !== 'bc';\n});\n","'use strict';\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw $TypeError(\"Can't call method on \" + it);\n return it;\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineBuiltInAccessor(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","'use strict';\nvar defineProperty = require('../internals/object-define-property').f;\nvar hasOwn = require('../internals/has-own-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (target, TAG, STATIC) {\n if (target && !STATIC) target = target.prototype;\n if (target && !hasOwn(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n};\n","'use strict';\nvar shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","'use strict';\nvar global = require('../internals/global');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n","'use strict';\nvar IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.32.2',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","'use strict';\nvar anObject = require('../internals/an-object');\nvar aConstructor = require('../internals/a-constructor');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S);\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar stringSlice = uncurryThis(''.slice);\n\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = toString(requireObjectCoercible($this));\n var position = toIntegerOrInfinity(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = charCodeAt(S, position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING\n ? charAt(S, position)\n : first\n : CONVERT_TO_STRING\n ? stringSlice(S, position, position + 2)\n : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.es/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar toString = require('../internals/to-string');\nvar whitespaces = require('../internals/whitespaces');\n\nvar replace = uncurryThis(''.replace);\nvar ltrim = RegExp('^[' + whitespaces + ']+');\nvar rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$');\n\n// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation\nvar createMethod = function (TYPE) {\n return function ($this) {\n var string = toString(requireObjectCoercible($this));\n if (TYPE & 1) string = replace(string, ltrim, '');\n if (TYPE & 2) string = replace(string, rtrim, '$1');\n return string;\n };\n};\n\nmodule.exports = {\n // `String.prototype.{ trimLeft, trimStart }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimstart\n start: createMethod(1),\n // `String.prototype.{ trimRight, trimEnd }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimend\n end: createMethod(2),\n // `String.prototype.trim` method\n // https://tc39.es/ecma262/#sec-string.prototype.trim\n trim: createMethod(3)\n};\n","'use strict';\n/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/engine-v8-version');\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\n\nvar $String = global.String;\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol('symbol detection');\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,\n // of course, fail.\n return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","'use strict';\nvar call = require('../internals/function-call');\nvar getBuiltIn = require('../internals/get-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar defineBuiltIn = require('../internals/define-built-in');\n\nmodule.exports = function () {\n var Symbol = getBuiltIn('Symbol');\n var SymbolPrototype = Symbol && Symbol.prototype;\n var valueOf = SymbolPrototype && SymbolPrototype.valueOf;\n var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {\n // `Symbol.prototype[@@toPrimitive]` method\n // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive\n // eslint-disable-next-line no-unused-vars -- required for .length\n defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {\n return call(valueOf, this);\n }, { arity: 1 });\n }\n};\n","'use strict';\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\n/* eslint-disable es/no-symbol -- safe */\nmodule.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;\n","'use strict';\nvar global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar bind = require('../internals/function-bind-context');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar fails = require('../internals/fails');\nvar html = require('../internals/html');\nvar arraySlice = require('../internals/array-slice');\nvar createElement = require('../internals/document-create-element');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\nvar IS_IOS = require('../internals/engine-is-ios');\nvar IS_NODE = require('../internals/engine-is-node');\n\nvar set = global.setImmediate;\nvar clear = global.clearImmediate;\nvar process = global.process;\nvar Dispatch = global.Dispatch;\nvar Function = global.Function;\nvar MessageChannel = global.MessageChannel;\nvar String = global.String;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar $location, defer, channel, port;\n\nfails(function () {\n // Deno throws a ReferenceError on `location` access without `--location` flag\n $location = global.location;\n});\n\nvar run = function (id) {\n if (hasOwn(queue, id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\n\nvar runner = function (id) {\n return function () {\n run(id);\n };\n};\n\nvar eventListener = function (event) {\n run(event.data);\n};\n\nvar globalPostMessageDefer = function (id) {\n // old engines have not location.origin\n global.postMessage(String(id), $location.protocol + '//' + $location.host);\n};\n\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!set || !clear) {\n set = function setImmediate(handler) {\n validateArgumentsLength(arguments.length, 1);\n var fn = isCallable(handler) ? handler : Function(handler);\n var args = arraySlice(arguments, 1);\n queue[++counter] = function () {\n apply(fn, undefined, args);\n };\n defer(counter);\n return counter;\n };\n clear = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (IS_NODE) {\n defer = function (id) {\n process.nextTick(runner(id));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(runner(id));\n };\n // Browsers with MessageChannel, includes WebWorkers\n // except iOS - https://github.com/zloirock/core-js/issues/624\n } else if (MessageChannel && !IS_IOS) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = eventListener;\n defer = bind(port.postMessage, port);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (\n global.addEventListener &&\n isCallable(global.postMessage) &&\n !global.importScripts &&\n $location && $location.protocol !== 'file:' &&\n !fails(globalPostMessageDefer)\n ) {\n defer = globalPostMessageDefer;\n global.addEventListener('message', eventListener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in createElement('script')) {\n defer = function (id) {\n html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(runner(id), 0);\n };\n }\n}\n\nmodule.exports = {\n set: set,\n clear: clear\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\n// `thisNumberValue` abstract operation\n// https://tc39.es/ecma262/#sec-thisnumbervalue\nmodule.exports = uncurryThis(1.0.valueOf);\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\n\nvar $TypeError = TypeError;\n\n// `ToBigInt` abstract operation\n// https://tc39.es/ecma262/#sec-tobigint\nmodule.exports = function (argument) {\n var prim = toPrimitive(argument, 'number');\n if (typeof prim == 'number') throw $TypeError(\"Can't convert number to bigint\");\n // eslint-disable-next-line es/no-bigint -- safe\n return BigInt(prim);\n};\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toLength = require('../internals/to-length');\n\nvar $RangeError = RangeError;\n\n// `ToIndex` abstract operation\n// https://tc39.es/ecma262/#sec-toindex\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toIntegerOrInfinity(it);\n var length = toLength(number);\n if (number !== length) throw $RangeError('Wrong length or index');\n return length;\n};\n","'use strict';\n// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","'use strict';\nvar trunc = require('../internals/math-trunc');\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- NaN check\n return number !== number || number === 0 ? 0 : trunc(number);\n};\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","'use strict';\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n","'use strict';\nvar toPositiveInteger = require('../internals/to-positive-integer');\n\nvar $RangeError = RangeError;\n\nmodule.exports = function (it, BYTES) {\n var offset = toPositiveInteger(it);\n if (offset % BYTES) throw $RangeError('Wrong offset');\n return offset;\n};\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar $RangeError = RangeError;\n\nmodule.exports = function (it) {\n var result = toIntegerOrInfinity(it);\n if (result < 0) throw $RangeError(\"The argument can't be less than 0\");\n return result;\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","'use strict';\nvar classof = require('../internals/classof');\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n","'use strict';\nvar round = Math.round;\n\nmodule.exports = function (it) {\n var value = round(it);\n return value < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF;\n};\n","'use strict';\nvar $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar ArrayBufferModule = require('../internals/array-buffer');\nvar anInstance = require('../internals/an-instance');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar isIntegralNumber = require('../internals/is-integral-number');\nvar toLength = require('../internals/to-length');\nvar toIndex = require('../internals/to-index');\nvar toOffset = require('../internals/to-offset');\nvar toUint8Clamped = require('../internals/to-uint8-clamped');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar classof = require('../internals/classof');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar create = require('../internals/object-create');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar typedArrayFrom = require('../internals/typed-array-from');\nvar forEach = require('../internals/array-iteration').forEach;\nvar setSpecies = require('../internals/set-species');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar definePropertyModule = require('../internals/object-define-property');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar InternalStateModule = require('../internals/internal-state');\nvar inheritIfRequired = require('../internals/inherit-if-required');\n\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar enforceInternalState = InternalStateModule.enforce;\nvar nativeDefineProperty = definePropertyModule.f;\nvar nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\nvar RangeError = global.RangeError;\nvar ArrayBuffer = ArrayBufferModule.ArrayBuffer;\nvar ArrayBufferPrototype = ArrayBuffer.prototype;\nvar DataView = ArrayBufferModule.DataView;\nvar NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;\nvar TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;\nvar TypedArray = ArrayBufferViewCore.TypedArray;\nvar TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;\nvar aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;\nvar isTypedArray = ArrayBufferViewCore.isTypedArray;\nvar BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\nvar WRONG_LENGTH = 'Wrong length';\n\nvar fromList = function (C, list) {\n aTypedArrayConstructor(C);\n var index = 0;\n var length = list.length;\n var result = new C(length);\n while (length > index) result[index] = list[index++];\n return result;\n};\n\nvar addGetter = function (it, key) {\n defineBuiltInAccessor(it, key, {\n configurable: true,\n get: function () {\n return getInternalState(this)[key];\n }\n });\n};\n\nvar isArrayBuffer = function (it) {\n var klass;\n return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) === 'ArrayBuffer' || klass === 'SharedArrayBuffer';\n};\n\nvar isTypedArrayIndex = function (target, key) {\n return isTypedArray(target)\n && !isSymbol(key)\n && key in target\n && isIntegralNumber(+key)\n && key >= 0;\n};\n\nvar wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {\n key = toPropertyKey(key);\n return isTypedArrayIndex(target, key)\n ? createPropertyDescriptor(2, target[key])\n : nativeGetOwnPropertyDescriptor(target, key);\n};\n\nvar wrappedDefineProperty = function defineProperty(target, key, descriptor) {\n key = toPropertyKey(key);\n if (isTypedArrayIndex(target, key)\n && isObject(descriptor)\n && hasOwn(descriptor, 'value')\n && !hasOwn(descriptor, 'get')\n && !hasOwn(descriptor, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !descriptor.configurable\n && (!hasOwn(descriptor, 'writable') || descriptor.writable)\n && (!hasOwn(descriptor, 'enumerable') || descriptor.enumerable)\n ) {\n target[key] = descriptor.value;\n return target;\n } return nativeDefineProperty(target, key, descriptor);\n};\n\nif (DESCRIPTORS) {\n if (!NATIVE_ARRAY_BUFFER_VIEWS) {\n getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;\n definePropertyModule.f = wrappedDefineProperty;\n addGetter(TypedArrayPrototype, 'buffer');\n addGetter(TypedArrayPrototype, 'byteOffset');\n addGetter(TypedArrayPrototype, 'byteLength');\n addGetter(TypedArrayPrototype, 'length');\n }\n\n $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {\n getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,\n defineProperty: wrappedDefineProperty\n });\n\n module.exports = function (TYPE, wrapper, CLAMPED) {\n var BYTES = TYPE.match(/\\d+/)[0] / 8;\n var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + TYPE;\n var SETTER = 'set' + TYPE;\n var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME];\n var TypedArrayConstructor = NativeTypedArrayConstructor;\n var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;\n var exported = {};\n\n var getter = function (that, index) {\n var data = getInternalState(that);\n return data.view[GETTER](index * BYTES + data.byteOffset, true);\n };\n\n var setter = function (that, index, value) {\n var data = getInternalState(that);\n data.view[SETTER](index * BYTES + data.byteOffset, CLAMPED ? toUint8Clamped(value) : value, true);\n };\n\n var addElement = function (that, index) {\n nativeDefineProperty(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n\n if (!NATIVE_ARRAY_BUFFER_VIEWS) {\n TypedArrayConstructor = wrapper(function (that, data, offset, $length) {\n anInstance(that, TypedArrayConstructorPrototype);\n var index = 0;\n var byteOffset = 0;\n var buffer, byteLength, length;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new ArrayBuffer(byteLength);\n } else if (isArrayBuffer(data)) {\n buffer = data;\n byteOffset = toOffset(offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - byteOffset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (isTypedArray(data)) {\n return fromList(TypedArrayConstructor, data);\n } else {\n return call(typedArrayFrom, TypedArrayConstructor, data);\n }\n setInternalState(that, {\n buffer: buffer,\n byteOffset: byteOffset,\n byteLength: byteLength,\n length: length,\n view: new DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n\n if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);\n TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);\n } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {\n TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) {\n anInstance(dummy, TypedArrayConstructorPrototype);\n return inheritIfRequired(function () {\n if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data));\n if (isArrayBuffer(data)) return $length !== undefined\n ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length)\n : typedArrayOffset !== undefined\n ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES))\n : new NativeTypedArrayConstructor(data);\n if (isTypedArray(data)) return fromList(TypedArrayConstructor, data);\n return call(typedArrayFrom, TypedArrayConstructor, data);\n }(), dummy, TypedArrayConstructor);\n });\n\n if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);\n forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) {\n if (!(key in TypedArrayConstructor)) {\n createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);\n }\n });\n TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;\n }\n\n if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor);\n }\n\n enforceInternalState(TypedArrayConstructorPrototype).TypedArrayConstructor = TypedArrayConstructor;\n\n if (TYPED_ARRAY_TAG) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);\n }\n\n var FORCED = TypedArrayConstructor !== NativeTypedArrayConstructor;\n\n exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;\n\n $({ global: true, constructor: true, forced: FORCED, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported);\n\n if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {\n createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);\n }\n\n if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);\n }\n\n setSpecies(CONSTRUCTOR_NAME);\n };\n} else module.exports = function () { /* empty */ };\n","'use strict';\n/* eslint-disable no-new -- required for testing */\nvar global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar NATIVE_ARRAY_BUFFER_VIEWS = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS;\n\nvar ArrayBuffer = global.ArrayBuffer;\nvar Int8Array = global.Int8Array;\n\nmodule.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {\n Int8Array(1);\n}) || !fails(function () {\n new Int8Array(-1);\n}) || !checkCorrectnessOfIteration(function (iterable) {\n new Int8Array();\n new Int8Array(null);\n new Int8Array(1.5);\n new Int8Array(iterable);\n}, true) || fails(function () {\n // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill\n return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;\n});\n","'use strict';\nvar arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list');\nvar typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');\n\nmodule.exports = function (instance, list) {\n return arrayFromConstructorAndList(typedArraySpeciesConstructor(instance), list);\n};\n","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar aConstructor = require('../internals/a-constructor');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar isBigIntArray = require('../internals/is-big-int-array');\nvar aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor;\nvar toBigInt = require('../internals/to-big-int');\n\nmodule.exports = function from(source /* , mapfn, thisArg */) {\n var C = aConstructor(this);\n var O = toObject(source);\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iteratorMethod = getIteratorMethod(O);\n var i, length, result, thisIsBigIntArray, value, step, iterator, next;\n if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) {\n iterator = getIterator(O, iteratorMethod);\n next = iterator.next;\n O = [];\n while (!(step = call(next, iterator)).done) {\n O.push(step.value);\n }\n }\n if (mapping && argumentsLength > 2) {\n mapfn = bind(mapfn, arguments[2]);\n }\n length = lengthOfArrayLike(O);\n result = new (aTypedArrayConstructor(C))(length);\n thisIsBigIntArray = isBigIntArray(result);\n for (i = 0; length > i; i++) {\n value = mapping ? mapfn(O[i], i) : O[i];\n // FF30- typed arrays doesn't properly convert objects to typed array values\n result[i] = thisIsBigIntArray ? toBigInt(value) : +value;\n }\n return result;\n};\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar speciesConstructor = require('../internals/species-constructor');\n\nvar aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;\nvar getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;\n\n// a part of `TypedArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#typedarray-species-create\nmodule.exports = function (originalArray) {\n return aTypedArrayConstructor(speciesConstructor(originalArray, getTypedArrayConstructor(originalArray)));\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","'use strict';\n/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype !== 42;\n});\n","'use strict';\nvar $TypeError = TypeError;\n\nmodule.exports = function (passed, required) {\n if (passed < required) throw $TypeError('Not enough arguments');\n return passed;\n};\n","'use strict';\nvar global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));\n","'use strict';\nvar path = require('../internals/path');\nvar hasOwn = require('../internals/has-own-property');\nvar wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');\nvar defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (NAME) {\n var Symbol = path.Symbol || (path.Symbol = {});\n if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {\n value: wrappedWellKnownSymbolModule.f(NAME)\n });\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nexports.f = wellKnownSymbol;\n","'use strict';\nvar global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar Symbol = global.Symbol;\nvar WellKnownSymbolsStore = shared('wks');\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name)) {\n WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)\n ? Symbol[name]\n : createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\n// a string of all valid unicode whitespaces\nmodule.exports = '\\u0009\\u000A\\u000B\\u000C\\u000D\\u0020\\u00A0\\u1680\\u2000\\u2001\\u2002' +\n '\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this-clause');\nvar fails = require('../internals/fails');\nvar ArrayBufferModule = require('../internals/array-buffer');\nvar anObject = require('../internals/an-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\nvar speciesConstructor = require('../internals/species-constructor');\n\nvar ArrayBuffer = ArrayBufferModule.ArrayBuffer;\nvar DataView = ArrayBufferModule.DataView;\nvar DataViewPrototype = DataView.prototype;\nvar nativeArrayBufferSlice = uncurryThis(ArrayBuffer.prototype.slice);\nvar getUint8 = uncurryThis(DataViewPrototype.getUint8);\nvar setUint8 = uncurryThis(DataViewPrototype.setUint8);\n\nvar INCORRECT_SLICE = fails(function () {\n return !new ArrayBuffer(2).slice(1, undefined).byteLength;\n});\n\n// `ArrayBuffer.prototype.slice` method\n// https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice\n$({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, {\n slice: function slice(start, end) {\n if (nativeArrayBufferSlice && end === undefined) {\n return nativeArrayBufferSlice(anObject(this), start); // FF fix\n }\n var length = anObject(this).byteLength;\n var first = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n var result = new (speciesConstructor(this, ArrayBuffer))(toLength(fin - first));\n var viewSource = new DataView(this);\n var viewTarget = new DataView(result);\n var index = 0;\n while (first < fin) {\n setUint8(viewTarget, index++, getUint8(viewSource, first++));\n } return result;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');\nvar createProperty = require('../internals/create-property');\nvar arraySpeciesCreate = require('../internals/array-species-create');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');\n\n// We can't use this feature detection in V8 since it causes\n// deoptimization and serious performance degradation\n// https://github.com/zloirock/core-js/issues/679\nvar IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {\n var array = [];\n array[IS_CONCAT_SPREADABLE] = false;\n return array.concat()[0] !== array;\n});\n\nvar isConcatSpreadable = function (O) {\n if (!isObject(O)) return false;\n var spreadable = O[IS_CONCAT_SPREADABLE];\n return spreadable !== undefined ? !!spreadable : isArray(O);\n};\n\nvar FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat');\n\n// `Array.prototype.concat` method\n// https://tc39.es/ecma262/#sec-array.prototype.concat\n// with adding support of @@isConcatSpreadable and @@species\n$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n concat: function concat(arg) {\n var O = toObject(this);\n var A = arraySpeciesCreate(O, 0);\n var n = 0;\n var i, k, length, len, E;\n for (i = -1, length = arguments.length; i < length; i++) {\n E = i === -1 ? O : arguments[i];\n if (isConcatSpreadable(E)) {\n len = lengthOfArrayLike(E);\n doesNotExceedSafeInteger(n + len);\n for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);\n } else {\n doesNotExceedSafeInteger(n + 1);\n createProperty(A, n++, E);\n }\n }\n A.length = n;\n return A;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $filter = require('../internals/array-iteration').filter;\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');\n\n// `Array.prototype.filter` method\n// https://tc39.es/ecma262/#sec-array.prototype.filter\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar forEach = require('../internals/array-for-each');\n\n// `Array.prototype.forEach` method\n// https://tc39.es/ecma262/#sec-array.prototype.foreach\n// eslint-disable-next-line es/no-array-prototype-foreach -- safe\n$({ target: 'Array', proto: true, forced: [].forEach !== forEach }, {\n forEach: forEach\n});\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineProperty = require('../internals/object-define-property').f;\nvar defineIterator = require('../internals/iterator-define');\nvar createIterResultObject = require('../internals/create-iter-result-object');\nvar IS_PURE = require('../internals/is-pure');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.es/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.es/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.es/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.es/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return createIterResultObject(undefined, true);\n }\n switch (kind) {\n case 'keys': return createIterResultObject(index, false);\n case 'values': return createIterResultObject(target[index], false);\n } return createIterResultObject([index, target[index]], false);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.es/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.es/ecma262/#sec-createmappedargumentsobject\nvar values = Iterators.Arguments = Iterators.Array;\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n// V8 ~ Chrome 45- bug\nif (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {\n defineProperty(values, 'name', { value: 'values' });\n} catch (error) { /* empty */ }\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isArray = require('../internals/is-array');\n\nvar nativeReverse = uncurryThis([].reverse);\nvar test = [1, 2];\n\n// `Array.prototype.reverse` method\n// https://tc39.es/ecma262/#sec-array.prototype.reverse\n// fix for Safari 12.0 bug\n// https://bugs.webkit.org/show_bug.cgi?id=188794\n$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {\n reverse: function reverse() {\n // eslint-disable-next-line no-self-assign -- dirty hack\n if (isArray(this)) this.length = this.length;\n return nativeReverse(this);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar isArray = require('../internals/is-array');\nvar isConstructor = require('../internals/is-constructor');\nvar isObject = require('../internals/is-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar createProperty = require('../internals/create-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar nativeSlice = require('../internals/array-slice');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');\n\nvar SPECIES = wellKnownSymbol('species');\nvar $Array = Array;\nvar max = Math.max;\n\n// `Array.prototype.slice` method\n// https://tc39.es/ecma262/#sec-array.prototype.slice\n// fallback for not array-like ES3 strings and DOM objects\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n slice: function slice(start, end) {\n var O = toIndexedObject(this);\n var length = lengthOfArrayLike(O);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible\n var Constructor, result, n;\n if (isArray(O)) {\n Constructor = O.constructor;\n // cross-realm fallback\n if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {\n Constructor = undefined;\n } else if (isObject(Constructor)) {\n Constructor = Constructor[SPECIES];\n if (Constructor === null) Constructor = undefined;\n }\n if (Constructor === $Array || Constructor === undefined) {\n return nativeSlice(O, k, fin);\n }\n }\n result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));\n for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n }\n});\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar FUNCTION_NAME_EXISTS = require('../internals/function-name').EXISTS;\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\n\nvar FunctionPrototype = Function.prototype;\nvar functionToString = uncurryThis(FunctionPrototype.toString);\nvar nameRE = /function\\b(?:\\s|\\/\\*[\\S\\s]*?\\*\\/|\\/\\/[^\\n\\r]*[\\n\\r]+)*([^\\s(/]*)/;\nvar regExpExec = uncurryThis(nameRE.exec);\nvar NAME = 'name';\n\n// Function instances `.name` property\n// https://tc39.es/ecma262/#sec-function-instances-name\nif (DESCRIPTORS && !FUNCTION_NAME_EXISTS) {\n defineBuiltInAccessor(FunctionPrototype, NAME, {\n configurable: true,\n get: function () {\n try {\n return regExpExec(nameRE, functionToString(this))[1];\n } catch (error) {\n return '';\n }\n }\n });\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar apply = require('../internals/function-apply');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar isSymbol = require('../internals/is-symbol');\nvar arraySlice = require('../internals/array-slice');\nvar getReplacerFunction = require('../internals/get-json-replacer-function');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nvar $String = String;\nvar $stringify = getBuiltIn('JSON', 'stringify');\nvar exec = uncurryThis(/./.exec);\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar replace = uncurryThis(''.replace);\nvar numberToString = uncurryThis(1.0.toString);\n\nvar tester = /[\\uD800-\\uDFFF]/g;\nvar low = /^[\\uD800-\\uDBFF]$/;\nvar hi = /^[\\uDC00-\\uDFFF]$/;\n\nvar WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {\n var symbol = getBuiltIn('Symbol')('stringify detection');\n // MS Edge converts symbol values to JSON as {}\n return $stringify([symbol]) !== '[null]'\n // WebKit converts symbol values to JSON as null\n || $stringify({ a: symbol }) !== '{}'\n // V8 throws on boxed symbols\n || $stringify(Object(symbol)) !== '{}';\n});\n\n// https://github.com/tc39/proposal-well-formed-stringify\nvar ILL_FORMED_UNICODE = fails(function () {\n return $stringify('\\uDF06\\uD834') !== '\"\\\\udf06\\\\ud834\"'\n || $stringify('\\uDEAD') !== '\"\\\\udead\"';\n});\n\nvar stringifyWithSymbolsFix = function (it, replacer) {\n var args = arraySlice(arguments);\n var $replacer = getReplacerFunction(replacer);\n if (!isCallable($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined\n args[1] = function (key, value) {\n // some old implementations (like WebKit) could pass numbers as keys\n if (isCallable($replacer)) value = call($replacer, this, $String(key), value);\n if (!isSymbol(value)) return value;\n };\n return apply($stringify, null, args);\n};\n\nvar fixIllFormed = function (match, offset, string) {\n var prev = charAt(string, offset - 1);\n var next = charAt(string, offset + 1);\n if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {\n return '\\\\u' + numberToString(charCodeAt(match, 0), 16);\n } return match;\n};\n\nif ($stringify) {\n // `JSON.stringify` method\n // https://tc39.es/ecma262/#sec-json.stringify\n $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n stringify: function stringify(it, replacer, space) {\n var args = arraySlice(arguments);\n var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);\n return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;\n }\n });\n}\n","'use strict';\nvar global = require('../internals/global');\nvar setToStringTag = require('../internals/set-to-string-tag');\n\n// JSON[@@toStringTag] property\n// https://tc39.es/ecma262/#sec-json-@@tostringtag\nsetToStringTag(global.JSON, 'JSON', true);\n","'use strict';\nvar setToStringTag = require('../internals/set-to-string-tag');\n\n// Math[@@toStringTag] property\n// https://tc39.es/ecma262/#sec-math-@@tostringtag\nsetToStringTag(Math, 'Math', true);\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar path = require('../internals/path');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isForced = require('../internals/is-forced');\nvar hasOwn = require('../internals/has-own-property');\nvar inheritIfRequired = require('../internals/inherit-if-required');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar isSymbol = require('../internals/is-symbol');\nvar toPrimitive = require('../internals/to-primitive');\nvar fails = require('../internals/fails');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar defineProperty = require('../internals/object-define-property').f;\nvar thisNumberValue = require('../internals/this-number-value');\nvar trim = require('../internals/string-trim').trim;\n\nvar NUMBER = 'Number';\nvar NativeNumber = global[NUMBER];\nvar PureNumberNamespace = path[NUMBER];\nvar NumberPrototype = NativeNumber.prototype;\nvar TypeError = global.TypeError;\nvar stringSlice = uncurryThis(''.slice);\nvar charCodeAt = uncurryThis(''.charCodeAt);\n\n// `ToNumeric` abstract operation\n// https://tc39.es/ecma262/#sec-tonumeric\nvar toNumeric = function (value) {\n var primValue = toPrimitive(value, 'number');\n return typeof primValue == 'bigint' ? primValue : toNumber(primValue);\n};\n\n// `ToNumber` abstract operation\n// https://tc39.es/ecma262/#sec-tonumber\nvar toNumber = function (argument) {\n var it = toPrimitive(argument, 'number');\n var first, third, radix, maxCode, digits, length, index, code;\n if (isSymbol(it)) throw TypeError('Cannot convert a Symbol value to a number');\n if (typeof it == 'string' && it.length > 2) {\n it = trim(it);\n first = charCodeAt(it, 0);\n if (first === 43 || first === 45) {\n third = charCodeAt(it, 2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (charCodeAt(it, 1)) {\n // fast equal of /^0b[01]+$/i\n case 66:\n case 98:\n radix = 2;\n maxCode = 49;\n break;\n // fast equal of /^0o[0-7]+$/i\n case 79:\n case 111:\n radix = 8;\n maxCode = 55;\n break;\n default:\n return +it;\n }\n digits = stringSlice(it, 2);\n length = digits.length;\n for (index = 0; index < length; index++) {\n code = charCodeAt(digits, index);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\nvar FORCED = isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'));\n\nvar calledWithNew = function (dummy) {\n // includes check on 1..constructor(foo) case\n return isPrototypeOf(NumberPrototype, dummy) && fails(function () { thisNumberValue(dummy); });\n};\n\n// `Number` constructor\n// https://tc39.es/ecma262/#sec-number-constructor\nvar NumberWrapper = function Number(value) {\n var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));\n return calledWithNew(this) ? inheritIfRequired(Object(n), this, NumberWrapper) : n;\n};\n\nNumberWrapper.prototype = NumberPrototype;\nif (FORCED && !IS_PURE) NumberPrototype.constructor = NumberWrapper;\n\n$({ global: true, constructor: true, wrap: true, forced: FORCED }, {\n Number: NumberWrapper\n});\n\n// Use `internal/copy-constructor-properties` helper in `core-js@4`\nvar copyConstructorProperties = function (target, source) {\n for (var keys = DESCRIPTORS ? getOwnPropertyNames(source) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES2015 (in case, if modules with ES2015 Number statics required before):\n 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' +\n // ESNext\n 'fromString,range'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (hasOwn(source, key = keys[j]) && !hasOwn(target, key)) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n\nif (IS_PURE && PureNumberNamespace) copyConstructorProperties(path[NUMBER], PureNumberNamespace);\nif (FORCED || IS_PURE) copyConstructorProperties(path[NUMBER], NativeNumber);\n","'use strict';\n// TODO: Remove from `core-js@4`\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar create = require('../internals/object-create');\n\n// `Object.create` method\n// https://tc39.es/ecma262/#sec-object.create\n$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {\n create: create\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar defineProperty = require('../internals/object-define-property').f;\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\n// eslint-disable-next-line es/no-object-defineproperty -- safe\n$({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {\n defineProperty: defineProperty\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar fails = require('../internals/fails');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar toObject = require('../internals/to-object');\n\n// V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives\n// https://bugs.chromium.org/p/v8/issues/detail?id=3443\nvar FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });\n\n// `Object.getOwnPropertySymbols` method\n// https://tc39.es/ecma262/#sec-object.getownpropertysymbols\n$({ target: 'Object', stat: true, forced: FORCED }, {\n getOwnPropertySymbols: function getOwnPropertySymbols(it) {\n var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar toObject = require('../internals/to-object');\nvar nativeGetPrototypeOf = require('../internals/object-get-prototype-of');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });\n\n// `Object.getPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.getprototypeof\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {\n getPrototypeOf: function getPrototypeOf(it) {\n return nativeGetPrototypeOf(toObject(it));\n }\n});\n\n","'use strict';\nvar $ = require('../internals/export');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n$({ target: 'Object', stat: true }, {\n setPrototypeOf: setPrototypeOf\n});\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar toString = require('../internals/object-to-string');\n\n// `Object.prototype.toString` method\n// https://tc39.es/ecma262/#sec-object.prototype.tostring\nif (!TO_STRING_TAG_SUPPORT) {\n defineBuiltIn(Object.prototype, 'toString', toString, { unsafe: true });\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\nvar PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');\n\n// `Promise.all` method\n// https://tc39.es/ecma262/#sec-promise.all\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aCallable(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n remaining++;\n call($promiseResolve, C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar defineBuiltIn = require('../internals/define-built-in');\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\n\n// `Promise.prototype.catch` method\n// https://tc39.es/ecma262/#sec-promise.prototype.catch\n$({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n});\n\n// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`\nif (!IS_PURE && isCallable(NativePromiseConstructor)) {\n var method = getBuiltIn('Promise').prototype['catch'];\n if (NativePromisePrototype['catch'] !== method) {\n defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });\n }\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar IS_NODE = require('../internals/engine-is-node');\nvar global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar setSpecies = require('../internals/set-species');\nvar aCallable = require('../internals/a-callable');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar anInstance = require('../internals/an-instance');\nvar speciesConstructor = require('../internals/species-constructor');\nvar task = require('../internals/task').set;\nvar microtask = require('../internals/microtask');\nvar hostReportErrors = require('../internals/host-report-errors');\nvar perform = require('../internals/perform');\nvar Queue = require('../internals/queue');\nvar InternalStateModule = require('../internals/internal-state');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar PromiseConstructorDetection = require('../internals/promise-constructor-detection');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\n\nvar PROMISE = 'Promise';\nvar FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;\nvar NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;\nvar NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;\nvar getInternalPromiseState = InternalStateModule.getterFor(PROMISE);\nvar setInternalState = InternalStateModule.set;\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\nvar PromiseConstructor = NativePromiseConstructor;\nvar PromisePrototype = NativePromisePrototype;\nvar TypeError = global.TypeError;\nvar document = global.document;\nvar process = global.process;\nvar newPromiseCapability = newPromiseCapabilityModule.f;\nvar newGenericPromiseCapability = newPromiseCapability;\n\nvar DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);\nvar UNHANDLED_REJECTION = 'unhandledrejection';\nvar REJECTION_HANDLED = 'rejectionhandled';\nvar PENDING = 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\nvar HANDLED = 1;\nvar UNHANDLED = 2;\n\nvar Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && isCallable(then = it.then) ? then : false;\n};\n\nvar callReaction = function (reaction, state) {\n var value = state.value;\n var ok = state.state === FULFILLED;\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (state.rejection === UNHANDLED) onHandleUnhandled(state);\n state.rejection = HANDLED;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // can throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n call(then, result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (error) {\n if (domain && !exited) domain.exit();\n reject(error);\n }\n};\n\nvar notify = function (state, isReject) {\n if (state.notified) return;\n state.notified = true;\n microtask(function () {\n var reactions = state.reactions;\n var reaction;\n while (reaction = reactions.get()) {\n callReaction(reaction, state);\n }\n state.notified = false;\n if (isReject && !state.rejection) onUnhandled(state);\n });\n};\n\nvar dispatchEvent = function (name, promise, reason) {\n var event, handler;\n if (DISPATCH_EVENT) {\n event = document.createEvent('Event');\n event.promise = promise;\n event.reason = reason;\n event.initEvent(name, false, true);\n global.dispatchEvent(event);\n } else event = { promise: promise, reason: reason };\n if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);\n else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);\n};\n\nvar onUnhandled = function (state) {\n call(task, global, function () {\n var promise = state.facade;\n var value = state.value;\n var IS_UNHANDLED = isUnhandled(state);\n var result;\n if (IS_UNHANDLED) {\n result = perform(function () {\n if (IS_NODE) {\n process.emit('unhandledRejection', value, promise);\n } else dispatchEvent(UNHANDLED_REJECTION, promise, value);\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;\n if (result.error) throw result.value;\n }\n });\n};\n\nvar isUnhandled = function (state) {\n return state.rejection !== HANDLED && !state.parent;\n};\n\nvar onHandleUnhandled = function (state) {\n call(task, global, function () {\n var promise = state.facade;\n if (IS_NODE) {\n process.emit('rejectionHandled', promise);\n } else dispatchEvent(REJECTION_HANDLED, promise, state.value);\n });\n};\n\nvar bind = function (fn, state, unwrap) {\n return function (value) {\n fn(state, value, unwrap);\n };\n};\n\nvar internalReject = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n state.value = value;\n state.state = REJECTED;\n notify(state, true);\n};\n\nvar internalResolve = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n try {\n if (state.facade === value) throw TypeError(\"Promise can't be resolved itself\");\n var then = isThenable(value);\n if (then) {\n microtask(function () {\n var wrapper = { done: false };\n try {\n call(then, value,\n bind(internalResolve, wrapper, state),\n bind(internalReject, wrapper, state)\n );\n } catch (error) {\n internalReject(wrapper, error, state);\n }\n });\n } else {\n state.value = value;\n state.state = FULFILLED;\n notify(state, false);\n }\n } catch (error) {\n internalReject({ done: false }, error, state);\n }\n};\n\n// constructor polyfill\nif (FORCED_PROMISE_CONSTRUCTOR) {\n // 25.4.3.1 Promise(executor)\n PromiseConstructor = function Promise(executor) {\n anInstance(this, PromisePrototype);\n aCallable(executor);\n call(Internal, this);\n var state = getInternalPromiseState(this);\n try {\n executor(bind(internalResolve, state), bind(internalReject, state));\n } catch (error) {\n internalReject(state, error);\n }\n };\n\n PromisePrototype = PromiseConstructor.prototype;\n\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n Internal = function Promise(executor) {\n setInternalState(this, {\n type: PROMISE,\n done: false,\n notified: false,\n parent: false,\n reactions: new Queue(),\n rejection: false,\n state: PENDING,\n value: undefined\n });\n };\n\n // `Promise.prototype.then` method\n // https://tc39.es/ecma262/#sec-promise.prototype.then\n Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var state = getInternalPromiseState(this);\n var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));\n state.parent = true;\n reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;\n reaction.fail = isCallable(onRejected) && onRejected;\n reaction.domain = IS_NODE ? process.domain : undefined;\n if (state.state === PENDING) state.reactions.add(reaction);\n else microtask(function () {\n callReaction(reaction, state);\n });\n return reaction.promise;\n });\n\n OwnPromiseCapability = function () {\n var promise = new Internal();\n var state = getInternalPromiseState(promise);\n this.promise = promise;\n this.resolve = bind(internalResolve, state);\n this.reject = bind(internalReject, state);\n };\n\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === PromiseConstructor || C === PromiseWrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n\n if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {\n nativeThen = NativePromisePrototype.then;\n\n if (!NATIVE_PROMISE_SUBCLASSING) {\n // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs\n defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var that = this;\n return new PromiseConstructor(function (resolve, reject) {\n call(nativeThen, that, resolve, reject);\n }).then(onFulfilled, onRejected);\n // https://github.com/zloirock/core-js/issues/640\n }, { unsafe: true });\n }\n\n // make `.constructor === Promise` work for native promise-based APIs\n try {\n delete NativePromisePrototype.constructor;\n } catch (error) { /* empty */ }\n\n // make `instanceof Promise` work for native promise-based APIs\n if (setPrototypeOf) {\n setPrototypeOf(NativePromisePrototype, PromisePrototype);\n }\n }\n}\n\n$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {\n Promise: PromiseConstructor\n});\n\nsetToStringTag(PromiseConstructor, PROMISE, false, true);\nsetSpecies(PROMISE);\n","'use strict';\n// TODO: Remove this module from `core-js@4` since it's split to modules listed below\nrequire('../modules/es.promise.constructor');\nrequire('../modules/es.promise.all');\nrequire('../modules/es.promise.catch');\nrequire('../modules/es.promise.race');\nrequire('../modules/es.promise.reject');\nrequire('../modules/es.promise.resolve');\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\nvar PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');\n\n// `Promise.race` method\n// https://tc39.es/ecma262/#sec-promise.race\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aCallable(C.resolve);\n iterate(iterable, function (promise) {\n call($promiseResolve, C, promise).then(capability.resolve, reject);\n });\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\n\n// `Promise.reject` method\n// https://tc39.es/ecma262/#sec-promise.reject\n$({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {\n reject: function reject(r) {\n var capability = newPromiseCapabilityModule.f(this);\n call(capability.reject, undefined, r);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar IS_PURE = require('../internals/is-pure');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\nvar promiseResolve = require('../internals/promise-resolve');\n\nvar PromiseConstructorWrapper = getBuiltIn('Promise');\nvar CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;\n\n// `Promise.resolve` method\n// https://tc39.es/ecma262/#sec-promise.resolve\n$({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {\n resolve: function resolve(x) {\n return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar exec = require('../internals/regexp-exec');\n\n// `RegExp.prototype.exec` method\n// https://tc39.es/ecma262/#sec-regexp.prototype.exec\n$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {\n exec: exec\n});\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\nvar toString = require('../internals/to-string');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/iterator-define');\nvar createIterResultObject = require('../internals/create-iter-result-object');\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: toString(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return createIterResultObject(undefined, true);\n point = charAt(string, index);\n state.index += point.length;\n return createIterResultObject(point, false);\n});\n","'use strict';\nvar call = require('../internals/function-call');\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar getMethod = require('../internals/get-method');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar regExpExec = require('../internals/regexp-exec-abstract');\n\n// @@match logic\nfixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {\n return [\n // `String.prototype.match` method\n // https://tc39.es/ecma262/#sec-string.prototype.match\n function match(regexp) {\n var O = requireObjectCoercible(this);\n var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);\n return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));\n },\n // `RegExp.prototype[@@match]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@match\n function (string) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(nativeMatch, rx, S);\n\n if (res.done) return res.value;\n\n if (!rx.global) return regExpExec(rx, S);\n\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n var A = [];\n var n = 0;\n var result;\n while ((result = regExpExec(rx, S)) !== null) {\n var matchStr = toString(result[0]);\n A[n] = matchStr;\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n n++;\n }\n return n === 0 ? null : A;\n }\n ];\n});\n","'use strict';\nvar apply = require('../internals/function-apply');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar isRegExp = require('../internals/is-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar speciesConstructor = require('../internals/species-constructor');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar getMethod = require('../internals/get-method');\nvar arraySlice = require('../internals/array-slice-simple');\nvar callRegExpExec = require('../internals/regexp-exec-abstract');\nvar regexpExec = require('../internals/regexp-exec');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar fails = require('../internals/fails');\n\nvar UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;\nvar MAX_UINT32 = 0xFFFFFFFF;\nvar min = Math.min;\nvar $push = [].push;\nvar exec = uncurryThis(/./.exec);\nvar push = uncurryThis($push);\nvar stringSlice = uncurryThis(''.slice);\n\n// Chrome 51 has a buggy \"split\" implementation when RegExp#exec !== nativeExec\n// Weex JS has frozen built-in prototypes, so use try / catch wrapper\nvar SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n var re = /(?:)/;\n var originalExec = re.exec;\n re.exec = function () { return originalExec.apply(this, arguments); };\n var result = 'ab'.split(re);\n return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';\n});\n\n// @@split logic\nfixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {\n var internalSplit;\n if (\n 'abbc'.split(/(b)*/)[1] === 'c' ||\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n 'test'.split(/(?:)/, -1).length !== 4 ||\n 'ab'.split(/(?:ab)*/).length !== 2 ||\n '.'.split(/(.?)(.?)/).length !== 4 ||\n // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing\n '.'.split(/()()/).length > 1 ||\n ''.split(/.?/).length\n ) {\n // based on es5-shim implementation, need to rework it\n internalSplit = function (separator, limit) {\n var string = toString(requireObjectCoercible(this));\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (separator === undefined) return [string];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) {\n return call(nativeSplit, string, separator, lim);\n }\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var match, lastIndex, lastLength;\n while (match = call(regexpExec, separatorCopy, string)) {\n lastIndex = separatorCopy.lastIndex;\n if (lastIndex > lastLastIndex) {\n push(output, stringSlice(string, lastLastIndex, match.index));\n if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1));\n lastLength = match[0].length;\n lastLastIndex = lastIndex;\n if (output.length >= lim) break;\n }\n if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop\n }\n if (lastLastIndex === string.length) {\n if (lastLength || !exec(separatorCopy, '')) push(output, '');\n } else push(output, stringSlice(string, lastLastIndex));\n return output.length > lim ? arraySlice(output, 0, lim) : output;\n };\n // Chakra, V8\n } else if ('0'.split(undefined, 0).length) {\n internalSplit = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);\n };\n } else internalSplit = nativeSplit;\n\n return [\n // `String.prototype.split` method\n // https://tc39.es/ecma262/#sec-string.prototype.split\n function split(separator, limit) {\n var O = requireObjectCoercible(this);\n var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT);\n return splitter\n ? call(splitter, separator, O, limit)\n : call(internalSplit, toString(O), separator, limit);\n },\n // `RegExp.prototype[@@split]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@split\n //\n // NOTE: This cannot be properly polyfilled in engines that don't support\n // the 'y' flag.\n function (string, limit) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);\n\n if (res.done) return res.value;\n\n var C = speciesConstructor(rx, RegExp);\n\n var unicodeMatching = rx.unicode;\n var flags = (rx.ignoreCase ? 'i' : '') +\n (rx.multiline ? 'm' : '') +\n (rx.unicode ? 'u' : '') +\n (UNSUPPORTED_Y ? 'g' : 'y');\n\n // ^(? + rx + ) is needed, in combination with some S slicing, to\n // simulate the 'y' flag.\n var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];\n var p = 0;\n var q = 0;\n var A = [];\n while (q < S.length) {\n splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;\n var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);\n var e;\n if (\n z === null ||\n (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p\n ) {\n q = advanceStringIndex(S, q, unicodeMatching);\n } else {\n push(A, stringSlice(S, p, q));\n if (A.length === lim) return A;\n for (var i = 1; i <= z.length - 1; i++) {\n push(A, z[i]);\n if (A.length === lim) return A;\n }\n q = p = e;\n }\n }\n push(A, stringSlice(S, p));\n return A;\n }\n ];\n}, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.asyncIterator` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.asynciterator\ndefineWellKnownSymbol('asyncIterator');\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar IS_PURE = require('../internals/is-pure');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar fails = require('../internals/fails');\nvar hasOwn = require('../internals/has-own-property');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar anObject = require('../internals/an-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar $toString = require('../internals/to-string');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar nativeObjectCreate = require('../internals/object-create');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertyNamesExternal = require('../internals/object-get-own-property-names-external');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\nvar definePropertiesModule = require('../internals/object-define-properties');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar shared = require('../internals/shared');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar uid = require('../internals/uid');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\nvar defineSymbolToPrimitive = require('../internals/symbol-define-to-primitive');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar InternalStateModule = require('../internals/internal-state');\nvar $forEach = require('../internals/array-iteration').forEach;\n\nvar HIDDEN = sharedKey('hidden');\nvar SYMBOL = 'Symbol';\nvar PROTOTYPE = 'prototype';\n\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(SYMBOL);\n\nvar ObjectPrototype = Object[PROTOTYPE];\nvar $Symbol = global.Symbol;\nvar SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];\nvar TypeError = global.TypeError;\nvar QObject = global.QObject;\nvar nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\nvar nativeDefineProperty = definePropertyModule.f;\nvar nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;\nvar nativePropertyIsEnumerable = propertyIsEnumerableModule.f;\nvar push = uncurryThis([].push);\n\nvar AllSymbols = shared('symbols');\nvar ObjectPrototypeSymbols = shared('op-symbols');\nvar WellKnownSymbolsStore = shared('wks');\n\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDescriptor = DESCRIPTORS && fails(function () {\n return nativeObjectCreate(nativeDefineProperty({}, 'a', {\n get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }\n })).a !== 7;\n}) ? function (O, P, Attributes) {\n var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);\n if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];\n nativeDefineProperty(O, P, Attributes);\n if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {\n nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);\n }\n} : nativeDefineProperty;\n\nvar wrap = function (tag, description) {\n var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);\n setInternalState(symbol, {\n type: SYMBOL,\n tag: tag,\n description: description\n });\n if (!DESCRIPTORS) symbol.description = description;\n return symbol;\n};\n\nvar $defineProperty = function defineProperty(O, P, Attributes) {\n if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);\n anObject(O);\n var key = toPropertyKey(P);\n anObject(Attributes);\n if (hasOwn(AllSymbols, key)) {\n if (!Attributes.enumerable) {\n if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));\n O[HIDDEN][key] = true;\n } else {\n if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;\n Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });\n } return setSymbolDescriptor(O, key, Attributes);\n } return nativeDefineProperty(O, key, Attributes);\n};\n\nvar $defineProperties = function defineProperties(O, Properties) {\n anObject(O);\n var properties = toIndexedObject(Properties);\n var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));\n $forEach(keys, function (key) {\n if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);\n });\n return O;\n};\n\nvar $create = function create(O, Properties) {\n return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);\n};\n\nvar $propertyIsEnumerable = function propertyIsEnumerable(V) {\n var P = toPropertyKey(V);\n var enumerable = call(nativePropertyIsEnumerable, this, P);\n if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;\n return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]\n ? enumerable : true;\n};\n\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {\n var it = toIndexedObject(O);\n var key = toPropertyKey(P);\n if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;\n var descriptor = nativeGetOwnPropertyDescriptor(it, key);\n if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {\n descriptor.enumerable = true;\n }\n return descriptor;\n};\n\nvar $getOwnPropertyNames = function getOwnPropertyNames(O) {\n var names = nativeGetOwnPropertyNames(toIndexedObject(O));\n var result = [];\n $forEach(names, function (key) {\n if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);\n });\n return result;\n};\n\nvar $getOwnPropertySymbols = function (O) {\n var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;\n var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));\n var result = [];\n $forEach(names, function (key) {\n if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {\n push(result, AllSymbols[key]);\n }\n });\n return result;\n};\n\n// `Symbol` constructor\n// https://tc39.es/ecma262/#sec-symbol-constructor\nif (!NATIVE_SYMBOL) {\n $Symbol = function Symbol() {\n if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor');\n var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);\n var tag = uid(description);\n var setter = function (value) {\n if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);\n if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));\n };\n if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });\n return wrap(tag, description);\n };\n\n SymbolPrototype = $Symbol[PROTOTYPE];\n\n defineBuiltIn(SymbolPrototype, 'toString', function toString() {\n return getInternalState(this).tag;\n });\n\n defineBuiltIn($Symbol, 'withoutSetter', function (description) {\n return wrap(uid(description), description);\n });\n\n propertyIsEnumerableModule.f = $propertyIsEnumerable;\n definePropertyModule.f = $defineProperty;\n definePropertiesModule.f = $defineProperties;\n getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;\n getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;\n getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;\n\n wrappedWellKnownSymbolModule.f = function (name) {\n return wrap(wellKnownSymbol(name), name);\n };\n\n if (DESCRIPTORS) {\n // https://github.com/tc39/proposal-Symbol-description\n defineBuiltInAccessor(SymbolPrototype, 'description', {\n configurable: true,\n get: function description() {\n return getInternalState(this).description;\n }\n });\n if (!IS_PURE) {\n defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });\n }\n }\n}\n\n$({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {\n Symbol: $Symbol\n});\n\n$forEach(objectKeys(WellKnownSymbolsStore), function (name) {\n defineWellKnownSymbol(name);\n});\n\n$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {\n useSetter: function () { USE_SETTER = true; },\n useSimple: function () { USE_SETTER = false; }\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {\n // `Object.create` method\n // https://tc39.es/ecma262/#sec-object.create\n create: $create,\n // `Object.defineProperty` method\n // https://tc39.es/ecma262/#sec-object.defineproperty\n defineProperty: $defineProperty,\n // `Object.defineProperties` method\n // https://tc39.es/ecma262/#sec-object.defineproperties\n defineProperties: $defineProperties,\n // `Object.getOwnPropertyDescriptor` method\n // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {\n // `Object.getOwnPropertyNames` method\n // https://tc39.es/ecma262/#sec-object.getownpropertynames\n getOwnPropertyNames: $getOwnPropertyNames\n});\n\n// `Symbol.prototype[@@toPrimitive]` method\n// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive\ndefineSymbolToPrimitive();\n\n// `Symbol.prototype[@@toStringTag]` property\n// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag\nsetToStringTag($Symbol, SYMBOL);\n\nhiddenKeys[HIDDEN] = true;\n","// `Symbol.prototype.description` getter\n// https://tc39.es/ecma262/#sec-symbol.prototype.description\n'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar toString = require('../internals/to-string');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\n\nvar NativeSymbol = global.Symbol;\nvar SymbolPrototype = NativeSymbol && NativeSymbol.prototype;\n\nif (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||\n // Safari 12 bug\n NativeSymbol().description !== undefined\n)) {\n var EmptyStringDescriptionStore = {};\n // wrap Symbol constructor for correct work with undefined description\n var SymbolWrapper = function Symbol() {\n var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);\n var result = isPrototypeOf(SymbolPrototype, this)\n ? new NativeSymbol(description)\n // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'\n : description === undefined ? NativeSymbol() : NativeSymbol(description);\n if (description === '') EmptyStringDescriptionStore[result] = true;\n return result;\n };\n\n copyConstructorProperties(SymbolWrapper, NativeSymbol);\n SymbolWrapper.prototype = SymbolPrototype;\n SymbolPrototype.constructor = SymbolWrapper;\n\n var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)';\n var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf);\n var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString);\n var regexp = /^Symbol\\((.*)\\)[^)]+$/;\n var replace = uncurryThis(''.replace);\n var stringSlice = uncurryThis(''.slice);\n\n defineBuiltInAccessor(SymbolPrototype, 'description', {\n configurable: true,\n get: function description() {\n var symbol = thisSymbolValue(this);\n if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';\n var string = symbolDescriptiveString(symbol);\n var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');\n return desc === '' ? undefined : desc;\n }\n });\n\n $({ global: true, constructor: true, forced: true }, {\n Symbol: SymbolWrapper\n });\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar hasOwn = require('../internals/has-own-property');\nvar toString = require('../internals/to-string');\nvar shared = require('../internals/shared');\nvar NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection');\n\nvar StringToSymbolRegistry = shared('string-to-symbol-registry');\nvar SymbolToStringRegistry = shared('symbol-to-string-registry');\n\n// `Symbol.for` method\n// https://tc39.es/ecma262/#sec-symbol.for\n$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {\n 'for': function (key) {\n var string = toString(key);\n if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];\n var symbol = getBuiltIn('Symbol')(string);\n StringToSymbolRegistry[string] = symbol;\n SymbolToStringRegistry[symbol] = string;\n return symbol;\n }\n});\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.iterator` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.iterator\ndefineWellKnownSymbol('iterator');\n","'use strict';\n// TODO: Remove this module from `core-js@4` since it's split to modules listed below\nrequire('../modules/es.symbol.constructor');\nrequire('../modules/es.symbol.for');\nrequire('../modules/es.symbol.key-for');\nrequire('../modules/es.json.stringify');\nrequire('../modules/es.object.get-own-property-symbols');\n","'use strict';\nvar $ = require('../internals/export');\nvar hasOwn = require('../internals/has-own-property');\nvar isSymbol = require('../internals/is-symbol');\nvar tryToString = require('../internals/try-to-string');\nvar shared = require('../internals/shared');\nvar NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection');\n\nvar SymbolToStringRegistry = shared('symbol-to-string-registry');\n\n// `Symbol.keyFor` method\n// https://tc39.es/ecma262/#sec-symbol.keyfor\n$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol');\n if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];\n }\n});\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\nvar setToStringTag = require('../internals/set-to-string-tag');\n\n// `Symbol.toStringTag` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.tostringtag\ndefineWellKnownSymbol('toStringTag');\n\n// `Symbol.prototype[@@toStringTag]` property\n// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag\nsetToStringTag(getBuiltIn('Symbol'), 'Symbol');\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $ArrayCopyWithin = require('../internals/array-copy-within');\n\nvar u$ArrayCopyWithin = uncurryThis($ArrayCopyWithin);\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.copyWithin` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin\nexportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) {\n return u$ArrayCopyWithin(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $every = require('../internals/array-iteration').every;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.every` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.every\nexportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) {\n return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $fill = require('../internals/array-fill');\nvar toBigInt = require('../internals/to-big-int');\nvar classof = require('../internals/classof');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar slice = uncurryThis(''.slice);\n\n// V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18\nvar CONVERSION_BUG = fails(function () {\n var count = 0;\n // eslint-disable-next-line es/no-typed-arrays -- safe\n new Int8Array(2).fill({ valueOf: function () { return count++; } });\n return count !== 1;\n});\n\n// `%TypedArray%.prototype.fill` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill\nexportTypedArrayMethod('fill', function fill(value /* , start, end */) {\n var length = arguments.length;\n aTypedArray(this);\n var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value;\n return call($fill, this, actualValue, length > 1 ? arguments[1] : undefined, length > 2 ? arguments[2] : undefined);\n}, CONVERSION_BUG);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $filter = require('../internals/array-iteration').filter;\nvar fromSpeciesAndList = require('../internals/typed-array-from-species-and-list');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.filter` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter\nexportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) {\n var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return fromSpeciesAndList(this, list);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $findIndex = require('../internals/array-iteration').findIndex;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.findIndex` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex\nexportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) {\n return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $find = require('../internals/array-iteration').find;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.find` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.find\nexportTypedArrayMethod('find', function find(predicate /* , thisArg */) {\n return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $forEach = require('../internals/array-iteration').forEach;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.forEach` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach\nexportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) {\n $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $includes = require('../internals/array-includes').includes;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.includes` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes\nexportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) {\n return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $indexOf = require('../internals/array-includes').indexOf;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.indexOf` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof\nexportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) {\n return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar ArrayIterators = require('../modules/es.array.iterator');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar Uint8Array = global.Uint8Array;\nvar arrayValues = uncurryThis(ArrayIterators.values);\nvar arrayKeys = uncurryThis(ArrayIterators.keys);\nvar arrayEntries = uncurryThis(ArrayIterators.entries);\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar TypedArrayPrototype = Uint8Array && Uint8Array.prototype;\n\nvar GENERIC = !fails(function () {\n TypedArrayPrototype[ITERATOR].call([1]);\n});\n\nvar ITERATOR_IS_VALUES = !!TypedArrayPrototype\n && TypedArrayPrototype.values\n && TypedArrayPrototype[ITERATOR] === TypedArrayPrototype.values\n && TypedArrayPrototype.values.name === 'values';\n\nvar typedArrayValues = function values() {\n return arrayValues(aTypedArray(this));\n};\n\n// `%TypedArray%.prototype.entries` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries\nexportTypedArrayMethod('entries', function entries() {\n return arrayEntries(aTypedArray(this));\n}, GENERIC);\n// `%TypedArray%.prototype.keys` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys\nexportTypedArrayMethod('keys', function keys() {\n return arrayKeys(aTypedArray(this));\n}, GENERIC);\n// `%TypedArray%.prototype.values` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.values\nexportTypedArrayMethod('values', typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' });\n// `%TypedArray%.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator\nexportTypedArrayMethod(ITERATOR, typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' });\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $join = uncurryThis([].join);\n\n// `%TypedArray%.prototype.join` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.join\nexportTypedArrayMethod('join', function join(separator) {\n return $join(aTypedArray(this), separator);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar apply = require('../internals/function-apply');\nvar $lastIndexOf = require('../internals/array-last-index-of');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.lastIndexOf` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof\nexportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) {\n var length = arguments.length;\n return apply($lastIndexOf, aTypedArray(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $map = require('../internals/array-iteration').map;\nvar typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.map` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.map\nexportTypedArrayMethod('map', function map(mapfn /* , thisArg */) {\n return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) {\n return new (typedArraySpeciesConstructor(O))(length);\n });\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $reduceRight = require('../internals/array-reduce').right;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.reduceRight` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright\nexportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) {\n var length = arguments.length;\n return $reduceRight(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $reduce = require('../internals/array-reduce').left;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.reduce` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce\nexportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) {\n var length = arguments.length;\n return $reduce(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar floor = Math.floor;\n\n// `%TypedArray%.prototype.reverse` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse\nexportTypedArrayMethod('reverse', function reverse() {\n var that = this;\n var length = aTypedArray(that).length;\n var middle = floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n});\n","'use strict';\nvar global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar toOffset = require('../internals/to-offset');\nvar toIndexedObject = require('../internals/to-object');\nvar fails = require('../internals/fails');\n\nvar RangeError = global.RangeError;\nvar Int8Array = global.Int8Array;\nvar Int8ArrayPrototype = Int8Array && Int8Array.prototype;\nvar $set = Int8ArrayPrototype && Int8ArrayPrototype.set;\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\nvar WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS = !fails(function () {\n // eslint-disable-next-line es/no-typed-arrays -- required for testing\n var array = new Uint8ClampedArray(2);\n call($set, array, { length: 1, 0: 3 }, 1);\n return array[1] !== 3;\n});\n\n// https://bugs.chromium.org/p/v8/issues/detail?id=11294 and other\nvar TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function () {\n var array = new Int8Array(2);\n array.set(1);\n array.set('2', 1);\n return array[0] !== 0 || array[1] !== 2;\n});\n\n// `%TypedArray%.prototype.set` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set\nexportTypedArrayMethod('set', function set(arrayLike /* , offset */) {\n aTypedArray(this);\n var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);\n var src = toIndexedObject(arrayLike);\n if (WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS) return call($set, this, src, offset);\n var length = this.length;\n var len = lengthOfArrayLike(src);\n var index = 0;\n if (len + offset > length) throw RangeError('Wrong length');\n while (index < len) this[offset + index] = src[index++];\n}, !WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');\nvar fails = require('../internals/fails');\nvar arraySlice = require('../internals/array-slice');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\nvar FORCED = fails(function () {\n // eslint-disable-next-line es/no-typed-arrays -- required for testing\n new Int8Array(1).slice();\n});\n\n// `%TypedArray%.prototype.slice` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice\nexportTypedArrayMethod('slice', function slice(start, end) {\n var list = arraySlice(aTypedArray(this), start, end);\n var C = typedArraySpeciesConstructor(this);\n var index = 0;\n var length = list.length;\n var result = new C(length);\n while (length > index) result[index] = list[index++];\n return result;\n}, FORCED);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $some = require('../internals/array-iteration').some;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.some` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.some\nexportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) {\n return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this-clause');\nvar fails = require('../internals/fails');\nvar aCallable = require('../internals/a-callable');\nvar internalSort = require('../internals/array-sort');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar FF = require('../internals/engine-ff-version');\nvar IE_OR_EDGE = require('../internals/engine-is-ie-or-edge');\nvar V8 = require('../internals/engine-v8-version');\nvar WEBKIT = require('../internals/engine-webkit-version');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar Uint16Array = global.Uint16Array;\nvar nativeSort = Uint16Array && uncurryThis(Uint16Array.prototype.sort);\n\n// WebKit\nvar ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !(fails(function () {\n nativeSort(new Uint16Array(2), null);\n}) && fails(function () {\n nativeSort(new Uint16Array(2), {});\n}));\n\nvar STABLE_SORT = !!nativeSort && !fails(function () {\n // feature detection can be too slow, so check engines versions\n if (V8) return V8 < 74;\n if (FF) return FF < 67;\n if (IE_OR_EDGE) return true;\n if (WEBKIT) return WEBKIT < 602;\n\n var array = new Uint16Array(516);\n var expected = Array(516);\n var index, mod;\n\n for (index = 0; index < 516; index++) {\n mod = index % 4;\n array[index] = 515 - index;\n expected[index] = index - 2 * mod + 3;\n }\n\n nativeSort(array, function (a, b) {\n return (a / 4 | 0) - (b / 4 | 0);\n });\n\n for (index = 0; index < 516; index++) {\n if (array[index] !== expected[index]) return true;\n }\n});\n\nvar getSortCompare = function (comparefn) {\n return function (x, y) {\n if (comparefn !== undefined) return +comparefn(x, y) || 0;\n // eslint-disable-next-line no-self-compare -- NaN check\n if (y !== y) return -1;\n // eslint-disable-next-line no-self-compare -- NaN check\n if (x !== x) return 1;\n if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1;\n return x > y;\n };\n};\n\n// `%TypedArray%.prototype.sort` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort\nexportTypedArrayMethod('sort', function sort(comparefn) {\n if (comparefn !== undefined) aCallable(comparefn);\n if (STABLE_SORT) return nativeSort(this, comparefn);\n\n return internalSort(aTypedArray(this), getSortCompare(comparefn));\n}, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.subarray` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray\nexportTypedArrayMethod('subarray', function subarray(begin, end) {\n var O = aTypedArray(this);\n var length = O.length;\n var beginIndex = toAbsoluteIndex(begin, length);\n var C = typedArraySpeciesConstructor(O);\n return new C(\n O.buffer,\n O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex)\n );\n});\n","'use strict';\nvar global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar fails = require('../internals/fails');\nvar arraySlice = require('../internals/array-slice');\n\nvar Int8Array = global.Int8Array;\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $toLocaleString = [].toLocaleString;\n\n// iOS Safari 6.x fails here\nvar TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {\n $toLocaleString.call(new Int8Array(1));\n});\n\nvar FORCED = fails(function () {\n return [1, 2].toLocaleString() !== new Int8Array([1, 2]).toLocaleString();\n}) || !fails(function () {\n Int8Array.prototype.toLocaleString.call([1, 2]);\n});\n\n// `%TypedArray%.prototype.toLocaleString` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring\nexportTypedArrayMethod('toLocaleString', function toLocaleString() {\n return apply(\n $toLocaleString,\n TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this),\n arraySlice(arguments)\n );\n}, FORCED);\n","'use strict';\nvar exportTypedArrayMethod = require('../internals/array-buffer-view-core').exportTypedArrayMethod;\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar Uint8Array = global.Uint8Array;\nvar Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {};\nvar arrayToString = [].toString;\nvar join = uncurryThis([].join);\n\nif (fails(function () { arrayToString.call({}); })) {\n arrayToString = function toString() {\n return join(this);\n };\n}\n\nvar IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString !== arrayToString;\n\n// `%TypedArray%.prototype.toString` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring\nexportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD);\n","'use strict';\nvar createTypedArrayConstructor = require('../internals/typed-array-constructor');\n\n// `Uint8Array` constructor\n// https://tc39.es/ecma262/#sec-typedarray-objects\ncreateTypedArrayConstructor('Uint8', function (init) {\n return function Uint8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","'use strict';\nvar global = require('../internals/global');\nvar DOMIterables = require('../internals/dom-iterables');\nvar DOMTokenListPrototype = require('../internals/dom-token-list-prototype');\nvar forEach = require('../internals/array-for-each');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nvar handlePrototype = function (CollectionPrototype) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {\n createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);\n } catch (error) {\n CollectionPrototype.forEach = forEach;\n }\n};\n\nfor (var COLLECTION_NAME in DOMIterables) {\n if (DOMIterables[COLLECTION_NAME]) {\n handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype);\n }\n}\n\nhandlePrototype(DOMTokenListPrototype);\n","'use strict';\nvar global = require('../internals/global');\nvar DOMIterables = require('../internals/dom-iterables');\nvar DOMTokenListPrototype = require('../internals/dom-token-list-prototype');\nvar ArrayIteratorMethods = require('../modules/es.array.iterator');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar ArrayValues = ArrayIteratorMethods.values;\n\nvar handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {\n if (CollectionPrototype) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype[ITERATOR] !== ArrayValues) try {\n createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);\n } catch (error) {\n CollectionPrototype[ITERATOR] = ArrayValues;\n }\n if (!CollectionPrototype[TO_STRING_TAG]) {\n createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);\n }\n if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {\n createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);\n } catch (error) {\n CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];\n }\n }\n }\n};\n\nfor (var COLLECTION_NAME in DOMIterables) {\n handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME);\n}\n\nhandlePrototype(DOMTokenListPrototype, 'DOMTokenList');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setLastICMessageTime = exports.lastICMessageTime = exports.delay = exports.setBanned = exports.banned = exports.setExtraFeatures = exports.extrafeatures = exports.setSelectedShout = exports.selectedShout = exports.setSelectedMenu = exports.selectedMenu = exports.setOldLoading = exports.oldLoading = exports.UPDATE_INTERVAL = exports.setClient = exports.client = exports.setCHATBOX = exports.CHATBOX = void 0;\n/*\n * Glorious webAO\n * made by sD, refactored by oldmud0 and Qubrick\n * credits to aleks for original idea and source\n */\nvar isLowMemory_1 = require(\"./client/isLowMemory\");\nvar fingerprintjs_1 = require(\"@fingerprintjs/fingerprintjs\");\nvar index_1 = require(\"./client/sender/index\");\nvar queryParser_1 = require(\"./utils/queryParser\");\nvar getResources_js_1 = require(\"./utils/getResources.js\");\nvar viewport_1 = require(\"./viewport/viewport\");\nvar events_1 = require(\"events\");\nvar onReplayGo_1 = require(\"./dom/onReplayGo\");\nvar packetHandler_1 = require(\"./packets/packetHandler\");\nvar loadResources_1 = require(\"./client/loadResources\");\nvar aoHost_1 = require(\"./client/aoHost\");\nvar fetchLists_1 = require(\"./client/fetchLists\");\nvar version = process.env.npm_package_version;\nvar _a = (0, queryParser_1.default)(), serverIP = _a.ip, mode = _a.mode, theme = _a.theme;\nvar THEME = theme || \"default\";\nvar setCHATBOX = function (val) {\n exports.CHATBOX = val;\n};\nexports.setCHATBOX = setCHATBOX;\nvar setClient = function (val) {\n exports.client = val;\n};\nexports.setClient = setClient;\nexports.UPDATE_INTERVAL = 60;\n/**\n * Toggles AO1-style loading using paginated music packets for mobile platforms.\n * The old loading uses more smaller packets instead of a single big one,\n * which caused problems on low-memory devices in the past.\n */\nexports.oldLoading = false;\nvar setOldLoading = function (val) {\n console.warn(\"old loading set to \" + val);\n exports.oldLoading = val;\n};\nexports.setOldLoading = setOldLoading;\n// presettings\nexports.selectedMenu = 1;\nvar setSelectedMenu = function (val) {\n exports.selectedMenu = val;\n};\nexports.setSelectedMenu = setSelectedMenu;\nexports.selectedShout = 0;\nvar setSelectedShout = function (val) {\n exports.selectedShout = val;\n};\nexports.setSelectedShout = setSelectedShout;\nexports.extrafeatures = [];\nvar setExtraFeatures = function (val) {\n exports.extrafeatures = val;\n};\nexports.setExtraFeatures = setExtraFeatures;\nexports.banned = false;\nvar setBanned = function (val) {\n exports.banned = val;\n};\nexports.setBanned = setBanned;\nvar hdid;\nvar fpPromise = fingerprintjs_1.default.load();\nfpPromise\n .then(function (fp) { return fp.get(); })\n .then(function (result) {\n hdid = result.visitorId;\n exports.client = new Client(serverIP);\n exports.client.connect();\n (0, isLowMemory_1.isLowMemory)();\n (0, loadResources_1.loadResources)();\n});\nvar delay = function (ms) { return new Promise(function (res) { return setTimeout(res, ms); }); };\nexports.delay = delay;\nexports.lastICMessageTime = new Date(0);\nvar setLastICMessageTime = function (val) {\n exports.lastICMessageTime = val;\n};\nexports.setLastICMessageTime = setLastICMessageTime;\nvar Client = /** @class */ (function (_super) {\n __extends(Client, _super);\n function Client(address) {\n var _this = _super.call(this) || this;\n _this.connect = function () {\n _this.on(\"open\", _this.onOpen.bind(_this));\n _this.on(\"close\", _this.onClose.bind(_this));\n _this.on(\"message\", _this.onMessage.bind(_this));\n _this.on(\"error\", _this.onError.bind(_this));\n if (mode !== \"replay\") {\n _this.serv = new WebSocket(\"ws://\".concat(address));\n // Assign the websocket events\n _this.serv.addEventListener(\"open\", _this.emit.bind(_this, \"open\"));\n _this.serv.addEventListener(\"close\", _this.emit.bind(_this, \"close\"));\n _this.serv.addEventListener(\"message\", _this.emit.bind(_this, \"message\"));\n _this.serv.addEventListener(\"error\", _this.emit.bind(_this, \"error\"));\n }\n else {\n _this.joinServer();\n }\n };\n _this.hp = [0, 0];\n _this.playerID = 1;\n _this.charID = -1;\n _this.char_list_length = 0;\n _this.evidence_list_length = 0;\n _this.music_list_length = 0;\n _this.testimonyID = 0;\n _this.chars = [];\n _this.emotes = [];\n _this.evidences = [];\n _this.areas = [];\n _this.musics = [];\n _this.musics_time = false;\n _this.callwords = [];\n _this.manifest = [];\n _this.resources = (0, getResources_js_1.default)(aoHost_1.AO_HOST, THEME);\n _this.selectedEmote = -1;\n _this.selectedEvidence = 0;\n _this.checkUpdater = null;\n _this.sender = index_1.sender;\n _this.viewport = (0, viewport_1.default)();\n _this._lastTimeICReceived = new Date(0);\n _this.partial_packet = false;\n _this.temp_packet = \"\";\n loadResources_1.loadResources;\n isLowMemory_1.isLowMemory;\n return _this;\n }\n Object.defineProperty(Client.prototype, \"character\", {\n /**\n * Gets the current player's character.\n */\n get: function () {\n return this.chars[this.charID];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Client.prototype, \"emote\", {\n /**\n * Gets the player's currently selected emote.\n */\n get: function () {\n return this.emotes[this.selectedEmote];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Client.prototype, \"evidence\", {\n /**\n * Gets the current evidence ID unless the player doesn't want to present any evidence\n */\n get: function () {\n return document.getElementById(\"button_present\").classList.contains(\"dark\")\n ? this.selectedEvidence\n : 0;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Hook for sending messages to the client\n * @param {string} message the message to send\n */\n Client.prototype.handleSelf = function (message) {\n var _this = this;\n var message_event = new MessageEvent(\"websocket\", { data: message });\n setTimeout(function () { return _this.onMessage(message_event); }, 1);\n };\n /**\n * Begins the handshake process by sending an identifier\n * to the server.\n */\n Client.prototype.joinServer = function () {\n var _this = this;\n this.sender.sendServer(\"HI#\".concat(hdid, \"#%\"));\n if (mode !== \"replay\") {\n this.checkUpdater = setInterval(function () { return _this.sender.sendCheck(); }, 5000);\n }\n };\n /**\n * Triggered when a connection is established to the server.\n */\n Client.prototype.onOpen = function (_e) {\n exports.client.joinServer();\n };\n /**\n * Triggered when the connection to the server closes.\n * @param {CloseEvent} e\n */\n Client.prototype.onClose = function (e) {\n console.error(\"The connection was closed: \".concat(e.reason, \" (\").concat(e.code, \")\"));\n if (exports.extrafeatures.length == 0 && exports.banned === false) {\n document.getElementById(\"client_errortext\").textContent =\n \"Could not connect to the server\";\n }\n document.getElementById(\"client_waiting\").style.display = \"block\";\n document.getElementById(\"client_error\").style.display = \"flex\";\n document.getElementById(\"client_loading\").style.display = \"none\";\n document.getElementById(\"error_id\").textContent = String(e.code);\n this.cleanup();\n };\n /**\n * Triggered when a packet is received from the server.\n * @param {MessageEvent} e\n */\n Client.prototype.onMessage = function (e) {\n var msg = e.data;\n console.debug(\"S: \".concat(msg));\n this.handle_server_packet(msg);\n };\n /**\n * Decode the packet\n * @param {MessageEvent} e\n */\n Client.prototype.handle_server_packet = function (p_data) {\n var e_1, _a;\n var in_data = p_data;\n if (!p_data.endsWith(\"%\")) {\n this.partial_packet = true;\n this.temp_packet = this.temp_packet + in_data;\n console.log(\"Partial packet\");\n return;\n }\n else {\n if (this.partial_packet) {\n in_data = this.temp_packet + in_data;\n this.temp_packet = \"\";\n this.partial_packet = false;\n }\n }\n var packet_list = in_data.split(\"%\");\n try {\n for (var packet_list_1 = __values(packet_list), packet_list_1_1 = packet_list_1.next(); !packet_list_1_1.done; packet_list_1_1 = packet_list_1.next()) {\n var packet = packet_list_1_1.value;\n var f_contents = void 0;\n // Packet should *always* end with #\n if (packet.endsWith(\"#\")) {\n f_contents = packet.slice(0, -1).split(\"#\");\n }\n // But, if it somehow doesn't, we should still be able to handle it\n else {\n f_contents = packet.split(\"#\");\n }\n // Empty packets are suspicious!\n if (f_contents.length == 0) {\n console.warn(\"WARNING: Empty packet received from server, skipping...\");\n continue;\n }\n // Take the first arg as the command\n var command = f_contents[0];\n if (command !== \"\") {\n // The rest is contents of the packet\n packetHandler_1.packetHandler.has(command)\n ? packetHandler_1.packetHandler.get(command)(f_contents)\n : console.warn(\"Invalid packet header \".concat(command));\n }\n ;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (packet_list_1_1 && !packet_list_1_1.done && (_a = packet_list_1.return)) _a.call(packet_list_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n /**\n * Triggered when an network error occurs.\n * @param {ErrorEvent} e\n */\n Client.prototype.onError = function (e) {\n console.error(\"A network error occurred\");\n document.getElementById(\"client_error\").style.display = \"flex\";\n this.cleanup();\n };\n /**\n * Stop sending keepalives to the server.\n */\n Client.prototype.cleanup = function () {\n clearInterval(this.checkUpdater);\n this.serv.close();\n };\n /**\n * Parse the lines in the OOC and play them\n * @param {*} args packet arguments\n */\n Client.prototype.handleReplay = function () {\n var ooclog = document.getElementById(\"client_ooclog\");\n var rawLog = false;\n var rtime = Number(document.getElementById(\"client_replaytimer\").value);\n var clines = ooclog.value.split(/\\r?\\n/);\n if (clines[0]) {\n var currentLine = String(clines[0]);\n this.handleSelf(currentLine);\n ooclog.value = clines.slice(1).join(\"\\r\\n\");\n if (currentLine.substr(0, 4) === \"wait\" && rawLog === false) {\n rtime = Number(currentLine.split(\"#\")[1]);\n }\n else if (currentLine.substr(0, 2) !== \"MS\") {\n rtime = 0;\n }\n setTimeout(function () { return (0, onReplayGo_1.onReplayGo)(null); }, rtime);\n }\n };\n Client.prototype.resetMusicList = function () {\n this.musics = [];\n document.getElementById(\"client_musiclist\").innerHTML = \"\";\n };\n Client.prototype.resetAreaList = function () {\n this.areas = [];\n document.getElementById(\"areas\").innerHTML = \"\";\n (0, fetchLists_1.fetchBackgroundList)();\n (0, fetchLists_1.fetchEvidenceList)();\n (0, fetchLists_1.fetchCharacterList)();\n };\n return Client;\n}(events_1.EventEmitter));\nexports.default = Client;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addTrack = void 0;\nvar client_1 = require(\"../client\");\nvar encoding_1 = require(\"../encoding\");\nvar paths_1 = require(\"../utils/paths\");\nvar addTrack = function (trackname) {\n var newentry = document.createElement(\"OPTION\");\n var songName = (0, paths_1.getFilenameFromPath)(trackname);\n newentry.text = (0, encoding_1.unescapeChat)(songName);\n newentry.value = trackname;\n (document.getElementById(\"client_musiclist\")).options.add(newentry);\n client_1.client.musics.push(trackname);\n};\nexports.addTrack = addTrack;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setAOhost = exports.AO_HOST = void 0;\nvar queryParser_1 = require(\"../utils/queryParser\");\nvar asset = (0, queryParser_1.default)().asset;\nvar DEFAULT_HOST = 'http://attorneyoffline.de/base/';\nexports.AO_HOST = asset || DEFAULT_HOST;\nvar setAOhost = function (val) {\n exports.AO_HOST = val;\n};\nexports.setAOhost = setAOhost;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.appendICLog = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Appends a message to the in-character chat log.\n * @param {string} msg the string to be added\n * @param {string} name the name of the sender\n */\nfunction appendICLog(msg, showname, nameplate, time) {\n if (showname === void 0) { showname = \"\"; }\n if (nameplate === void 0) { nameplate = \"\"; }\n if (time === void 0) { time = new Date(); }\n var entry = document.createElement(\"p\");\n var shownameField = document.createElement(\"span\");\n var nameplateField = document.createElement(\"span\");\n var textField = document.createElement(\"span\");\n nameplateField.className = \"iclog_name iclog_nameplate\";\n nameplateField.appendChild(document.createTextNode(nameplate));\n shownameField.className = \"iclog_name iclog_showname\";\n if (showname === \"\" || !showname) {\n shownameField.appendChild(document.createTextNode(nameplate));\n }\n else {\n shownameField.appendChild(document.createTextNode(showname));\n }\n textField.className = \"iclog_text\";\n textField.appendChild(document.createTextNode(msg));\n entry.appendChild(shownameField);\n entry.appendChild(nameplateField);\n entry.appendChild(textField);\n // Only put a timestamp if the minute has changed.\n if (client_1.lastICMessageTime.getMinutes() !== time.getMinutes()) {\n var timeStamp = document.createElement(\"span\");\n timeStamp.className = \"iclog_time\";\n timeStamp.innerText = time.toLocaleTimeString(undefined, {\n hour: \"numeric\",\n minute: \"2-digit\",\n });\n entry.appendChild(timeStamp);\n }\n var clientLog = document.getElementById(\"client_log\");\n clientLog.appendChild(entry);\n /* This is a little buggy - some troubleshooting might be desirable */\n if (clientLog.scrollTop > clientLog.scrollHeight - 800) {\n clientLog.scrollTop = clientLog.scrollHeight;\n }\n (0, client_1.setLastICMessageTime)(new Date());\n}\nexports.appendICLog = appendICLog;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkCallword = void 0;\nvar client_1 = require(\"../client\");\nvar aoHost_1 = require(\"./aoHost\");\n/**\n * check if the message contains an entry on our callword list\n * @param {string} message\n */\nfunction checkCallword(message, sfxAudio) {\n client_1.client.callwords.forEach(testCallword);\n function testCallword(item) {\n if (item !== \"\" && message.toLowerCase().includes(item.toLowerCase())) {\n sfxAudio.pause();\n sfxAudio.src = \"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-gallery.opus\");\n sfxAudio.play();\n }\n }\n}\nexports.checkCallword = checkCallword;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createArea = void 0;\nvar client_1 = require(\"../client\");\nvar areaClick_1 = require(\"../dom/areaClick\");\nvar createArea = function (id, name) {\n var thisarea = {\n name: name,\n players: 0,\n status: \"IDLE\",\n cm: \"\",\n locked: \"FREE\",\n };\n client_1.client.areas.push(thisarea);\n // Create area button\n var newarea = document.createElement(\"SPAN\");\n newarea.className = \"area-button area-default\";\n newarea.id = \"area\".concat(id);\n newarea.innerText = thisarea.name;\n newarea.title =\n \"Players: \".concat(thisarea.players, \"\\n\") +\n \"Status: \".concat(thisarea.status, \"\\n\") +\n \"CM: \".concat(thisarea.cm, \"\\n\") +\n \"Area lock: \".concat(thisarea.locked);\n newarea.onclick = function () {\n (0, areaClick_1.area_click)(newarea);\n };\n document.getElementById(\"areas\").appendChild(newarea);\n};\nexports.createArea = createArea;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fetchManifest = exports.fetchEvidenceList = exports.fetchCharacterList = exports.fetchBackgroundList = void 0;\nvar client_1 = require(\"../client\");\nvar aoHost_1 = require(\"./aoHost\");\nvar request_js_1 = require(\"../services/request.js\");\nvar fetchBackgroundList = function () { return __awaiter(void 0, void 0, void 0, function () {\n var bgdata, bg_array, bg_select_1, err_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, (0, request_js_1.request)(\"\".concat(aoHost_1.AO_HOST, \"backgrounds.json\"))];\n case 1:\n bgdata = _a.sent();\n bg_array = JSON.parse(bgdata);\n bg_select_1 = document.getElementById(\"bg_select\");\n bg_select_1.innerHTML = \"\";\n bg_select_1.add(new Option(\"Custom\", \"0\"));\n bg_array.forEach(function (background) {\n bg_select_1.add(new Option(background));\n });\n return [3 /*break*/, 3];\n case 2:\n err_1 = _a.sent();\n console.warn(\"there was no backgrounds.json file\");\n return [3 /*break*/, 3];\n case 3: return [2 /*return*/];\n }\n });\n}); };\nexports.fetchBackgroundList = fetchBackgroundList;\nvar fetchCharacterList = function () { return __awaiter(void 0, void 0, void 0, function () {\n var char_select, chardata, char_array, err_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n char_select = (document.getElementById(\"client_iniselect\"));\n char_select.innerHTML = \"\";\n char_select.add(new Option(\"Custom\", \"0\"));\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, (0, request_js_1.request)(\"\".concat(aoHost_1.AO_HOST, \"characters.json\"))];\n case 2:\n chardata = _a.sent();\n char_array = JSON.parse(chardata);\n // the try catch will fail before here when there is no file\n char_array.forEach(function (character) {\n char_select.add(new Option(character));\n });\n return [3 /*break*/, 4];\n case 3:\n err_2 = _a.sent();\n console.warn(\"there was no characters.json file\");\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n}); };\nexports.fetchCharacterList = fetchCharacterList;\nvar fetchEvidenceList = function () { return __awaiter(void 0, void 0, void 0, function () {\n var evi_select, evidata, evi_array, err_3;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n evi_select = (document.getElementById(\"evi_select\"));\n evi_select.innerHTML = \"\";\n evi_select.add(new Option(\"Custom\", \"0\"));\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, (0, request_js_1.request)(\"\".concat(aoHost_1.AO_HOST, \"evidence.json\"))];\n case 2:\n evidata = _a.sent();\n evi_array = JSON.parse(evidata);\n // the try catch will fail before here when there is no file\n evi_array.forEach(function (evi) {\n evi_select.add(new Option(evi));\n });\n return [3 /*break*/, 4];\n case 3:\n err_3 = _a.sent();\n console.warn(\"there was no evidence.json file\");\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n}); };\nexports.fetchEvidenceList = fetchEvidenceList;\nvar fetchManifest = function () { return __awaiter(void 0, void 0, void 0, function () {\n var manifestdata, err_4;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, (0, request_js_1.request)(\"\".concat(aoHost_1.AO_HOST, \"manifest.txt\"))];\n case 1:\n manifestdata = _a.sent();\n client_1.client.manifest = manifestdata.split(/\\r\\n|\\n\\r|\\n|\\r/);\n return [3 /*break*/, 3];\n case 2:\n err_4 = _a.sent();\n console.warn(\"there was no manifest.txt file\");\n return [3 /*break*/, 3];\n case 3: return [2 /*return*/];\n }\n });\n}); };\nexports.fetchManifest = fetchManifest;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fix_last_area = void 0;\nvar client_1 = require(\"../client\");\nvar addTrack_1 = require(\"./addTrack\");\n/**\n * Area list fuckery\n */\nvar fix_last_area = function () {\n if (client_1.client.areas.length > 0) {\n var malplaced = client_1.client.areas.pop().name;\n var areas = document.getElementById(\"areas\");\n areas.removeChild(areas.lastChild);\n (0, addTrack_1.addTrack)(malplaced);\n }\n};\nexports.fix_last_area = fix_last_area;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleBans = void 0;\n/**\n * Handles the kicked packet\n * @param {string} type is it a kick or a ban\n * @param {string} reason why\n */\nvar handleBans = function (type, reason) {\n document.getElementById(\"client_error\").style.display = \"flex\";\n document.getElementById(\"client_errortext\").innerHTML = \"\".concat(type, \":
\").concat(reason.replace(/\\n/g, \"
\"));\n (document.getElementById(\"client_reconnect\")).style.display = \"none\";\n alert(type + \":\\r\" + reason);\n};\nexports.handleBans = handleBans;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleCharacterInfo = void 0;\nvar client_1 = require(\"../client\");\nvar encoding_1 = require(\"../encoding\");\nvar iniParse_1 = require(\"../iniParse\");\nvar request_1 = require(\"../services/request\");\nvar fileExists_1 = require(\"../utils/fileExists\");\nvar aoHost_1 = require(\"./aoHost\");\n/**\n * Handles the incoming character information, and downloads the sprite + ini for it\n * @param {Array} chargs packet arguments\n * @param {Number} charid character ID\n */\nvar handleCharacterInfo = function (chargs, charid) { return __awaiter(void 0, void 0, void 0, function () {\n var img, cini, getCharIcon, cinidata, err_1, mute_select, pair_select, default_options, default_emotions;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n img = document.getElementById(\"demo_\".concat(charid));\n if (!chargs[0]) return [3 /*break*/, 5];\n cini = {};\n getCharIcon = function () { return __awaiter(void 0, void 0, void 0, function () {\n var extensions, charIconBaseUrl, i, fileUrl, exists;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n extensions = [\".png\", \".webp\"];\n img.alt = chargs[0];\n charIconBaseUrl = \"\".concat(aoHost_1.AO_HOST, \"characters/\").concat(encodeURI(chargs[0].toLowerCase()), \"/char_icon\");\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < extensions.length)) return [3 /*break*/, 4];\n fileUrl = charIconBaseUrl + extensions[i];\n return [4 /*yield*/, (0, fileExists_1.default)(fileUrl)];\n case 2:\n exists = _a.sent();\n if (exists) {\n img.alt = chargs[0];\n img.title = chargs[0];\n img.src = fileUrl;\n return [2 /*return*/];\n }\n _a.label = 3;\n case 3:\n i++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/];\n }\n });\n }); };\n getCharIcon();\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, (0, request_1.default)(\"\".concat(aoHost_1.AO_HOST, \"characters/\").concat(encodeURI(chargs[0].toLowerCase()), \"/char.ini\"))];\n case 2:\n cinidata = _a.sent();\n cini = (0, iniParse_1.default)(cinidata);\n return [3 /*break*/, 4];\n case 3:\n err_1 = _a.sent();\n cini = {};\n img.classList.add(\"noini\");\n console.warn(\"character \".concat(chargs[0], \" is missing from webAO\"));\n return [3 /*break*/, 4];\n case 4:\n mute_select = (document.getElementById(\"mute_select\"));\n mute_select.add(new Option((0, encoding_1.safeTags)(chargs[0]), String(charid)));\n pair_select = (document.getElementById(\"pair_select\"));\n pair_select.add(new Option((0, encoding_1.safeTags)(chargs[0]), String(charid)));\n default_options = {\n name: chargs[0],\n showname: chargs[0],\n side: \"def\",\n blips: \"male\",\n chat: \"\",\n category: \"\",\n };\n cini.options = Object.assign(default_options, cini.options);\n default_emotions = {\n number: 0,\n };\n cini.emotions = Object.assign(default_emotions, cini.emotions);\n client_1.client.chars[charid] = {\n name: (0, encoding_1.safeTags)(chargs[0]),\n showname: (0, encoding_1.safeTags)(cini.options.showname),\n desc: (0, encoding_1.safeTags)(chargs[1]),\n blips: (0, encoding_1.safeTags)(cini.options.blips).toLowerCase(),\n gender: (0, encoding_1.safeTags)(cini.options.gender).toLowerCase(),\n side: (0, encoding_1.safeTags)(cini.options.side).toLowerCase(),\n chat: cini.options.chat === \"\"\n ? (0, encoding_1.safeTags)(cini.options.category).toLowerCase()\n : (0, encoding_1.safeTags)(cini.options.chat).toLowerCase(),\n evidence: chargs[3],\n icon: img.src,\n inifile: cini,\n muted: false,\n };\n if (client_1.client.chars[charid].blips === \"male\" &&\n client_1.client.chars[charid].gender !== \"male\" &&\n client_1.client.chars[charid].gender !== \"\") {\n client_1.client.chars[charid].blips = client_1.client.chars[charid].gender;\n }\n return [3 /*break*/, 6];\n case 5:\n console.warn(\"missing charid \".concat(charid));\n img.style.display = \"none\";\n _a.label = 6;\n case 6: return [2 /*return*/];\n }\n });\n}); };\nexports.handleCharacterInfo = handleCharacterInfo;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isAudio = void 0;\nvar isAudio = function (trackname) {\n var audioEndings = [\".wav\", \".mp3\", \".ogg\", \".opus\"];\n return (audioEndings.filter(function (ending) { return trackname.endsWith(ending); }).length === 1);\n};\nexports.isAudio = isAudio;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isLowMemory = void 0;\nvar client_1 = require(\"../client\");\nvar isLowMemory = function () {\n if (/webOS|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|PlayStation|Nintendo|Opera Mini/i.test(navigator.userAgent)) {\n (0, client_1.setOldLoading)(true);\n }\n};\nexports.isLowMemory = isLowMemory;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.loadResources = void 0;\nvar getCookie_1 = require(\"../utils/getCookie\");\nvar evidence_js_1 = require(\"../constants/evidence.js\");\nvar backgrounds_js_1 = require(\"../constants/backgrounds.js\");\nvar changeMusicVolume_1 = require(\"../dom/changeMusicVolume\");\nvar setChatbox_1 = require(\"../dom/setChatbox\");\nvar changeVolume_1 = require(\"../dom/changeVolume\");\nvar showNameClick_1 = require(\"../dom/showNameClick\");\nvar changeBlipVolume_1 = require(\"../dom/changeBlipVolume\");\nvar reloadTheme_1 = require(\"../dom/reloadTheme\");\nvar version = process.env.npm_package_version;\n/**\n * Load game resources and stored settings.\n */\nvar loadResources = function () {\n document.getElementById(\"client_version\").innerText = \"version \".concat(version);\n // Load background array to select\n var background_select = (document.getElementById(\"bg_select\"));\n background_select.add(new Option(\"Custom\", \"0\"));\n backgrounds_js_1.default.forEach(function (background) {\n background_select.add(new Option(background));\n });\n // Load evidence array to select\n var evidence_select = (document.getElementById(\"evi_select\"));\n evidence_select.add(new Option(\"Custom\", \"0\"));\n evidence_js_1.default.forEach(function (evidence) {\n evidence_select.add(new Option(evidence));\n });\n // Read cookies and set the UI to its values\n document.getElementById(\"OOC_name\").value =\n (0, getCookie_1.default)(\"OOC_name\") ||\n \"web\".concat(String(Math.round(Math.random() * 100 + 10)));\n // Read cookies and set the UI to its values\n var cookietheme = (0, getCookie_1.default)(\"theme\") || \"default\";\n (document.querySelector(\"#client_themeselect [value=\\\"\".concat(cookietheme, \"\\\"]\"))).selected = true;\n (0, reloadTheme_1.reloadTheme)();\n var cookiechatbox = (0, getCookie_1.default)(\"chatbox\") || \"dynamic\";\n (document.querySelector(\"#client_chatboxselect [value=\\\"\".concat(cookiechatbox, \"\\\"]\"))).selected = true;\n (0, setChatbox_1.setChatbox)(cookiechatbox);\n document.getElementById(\"client_mvolume\").value =\n (0, getCookie_1.default)(\"musicVolume\") || \"1\";\n (0, changeMusicVolume_1.changeMusicVolume)();\n document.getElementById(\"client_sfxaudio\").volume =\n Number((0, getCookie_1.default)(\"sfxVolume\")) || 1;\n (0, changeVolume_1.changeSFXVolume)();\n document.getElementById(\"client_shoutaudio\").volume =\n Number((0, getCookie_1.default)(\"shoutVolume\")) || 1;\n (0, changeVolume_1.changeShoutVolume)();\n (document.getElementById(\"client_testimonyaudio\")).volume = Number((0, getCookie_1.default)(\"testimonyVolume\")) || 1;\n (0, changeVolume_1.changeTestimonyVolume)();\n document.getElementById(\"client_bvolume\").value =\n (0, getCookie_1.default)(\"blipVolume\") || \"1\";\n (0, changeBlipVolume_1.changeBlipVolume)();\n document.getElementById(\"ic_chat_name\").value =\n (0, getCookie_1.default)(\"ic_chat_name\");\n document.getElementById(\"showname\").checked = Boolean((0, getCookie_1.default)(\"showname\"));\n (0, showNameClick_1.showname_click)(null);\n document.getElementById(\"client_callwords\").value =\n (0, getCookie_1.default)(\"callwords\");\n};\nexports.loadResources = loadResources;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resetICParams = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Resets the IC parameters for the player to enter a new chat message.\n * This should only be called when the player's previous chat message\n * was successfully sent/presented.\n */\nfunction resetICParams() {\n document.getElementById(\"client_inputbox\").value = \"\";\n document.getElementById(\"button_flash\").className = \"client_button\";\n document.getElementById(\"button_shake\").className = \"client_button\";\n document.getElementById(\"sendpreanim\").checked = false;\n document.getElementById(\"sendsfx\").checked = false;\n if (client_1.selectedShout) {\n document.getElementById(\"button_\".concat(client_1.selectedShout)).className =\n \"client_button\";\n (0, client_1.setSelectedShout)(0);\n }\n}\nexports.resetICParams = resetICParams;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.saveChatlogHandle = void 0;\nvar downloadFile_1 = require(\"../services/downloadFile\");\nvar saveChatlogHandle = function () { return __awaiter(void 0, void 0, void 0, function () {\n var clientLog, icMessageLogs, messages, i, SHOWNAME_POSITION, TEXT_POSITION, showname, text, message, d, ye, mo, da, filename;\n return __generator(this, function (_a) {\n clientLog = document.getElementById(\"client_log\");\n icMessageLogs = clientLog.getElementsByTagName(\"p\");\n messages = [];\n for (i = 0; i < icMessageLogs.length; i++) {\n SHOWNAME_POSITION = 0;\n TEXT_POSITION = 2;\n showname = icMessageLogs[i].children[SHOWNAME_POSITION].innerHTML;\n text = icMessageLogs[i].children[TEXT_POSITION].innerHTML;\n message = \"\".concat(showname, \": \").concat(text);\n messages.push(message);\n }\n d = new Date();\n ye = new Intl.DateTimeFormat(\"en\", { year: \"numeric\" }).format(d);\n mo = new Intl.DateTimeFormat(\"en\", { month: \"short\" }).format(d);\n da = new Intl.DateTimeFormat(\"en\", { day: \"2-digit\" }).format(d);\n filename = \"chatlog-\".concat(da, \"-\").concat(mo, \"-\").concat(ye).toLowerCase();\n (0, downloadFile_1.default)(messages.join(\"\\n\"), filename);\n // Reset Chatbox to Empty\n document.getElementById(\"client_inputbox\").value = \"\";\n return [2 /*return*/];\n });\n}); };\nexports.saveChatlogHandle = saveChatlogHandle;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sender = void 0;\nvar sendIC_1 = require(\"./sendIC\");\nvar sendSelf_1 = require(\"./sendSelf\");\nvar sendServer_1 = require(\"./sendServer\");\nvar sendCheck_1 = require(\"./sendCheck\");\nvar sendHP_1 = require(\"./sendHP\");\nvar sendOOC_1 = require(\"./sendOOC\");\nvar sendCharacter_1 = require(\"./sendCharacter\");\nvar sendRT_1 = require(\"./sendRT\");\nvar sendMusicChange_1 = require(\"./sendMusicChange\");\nvar sendZZ_1 = require(\"./sendZZ\");\nvar sendEE_1 = require(\"./sendEE\");\nvar sendDE_1 = require(\"./sendDE\");\nvar sendPE_1 = require(\"./sendPE\");\nexports.sender = {\n sendIC: sendIC_1.sendIC,\n sendSelf: sendSelf_1.sendSelf,\n sendServer: sendServer_1.sendServer,\n sendCheck: sendCheck_1.sendCheck,\n sendHP: sendHP_1.sendHP,\n sendOOC: sendOOC_1.sendOOC,\n sendCharacter: sendCharacter_1.sendCharacter,\n sendRT: sendRT_1.sendRT,\n sendMusicChange: sendMusicChange_1.sendMusicChange,\n sendZZ: sendZZ_1.sendZZ,\n sendEE: sendEE_1.sendEE,\n sendDE: sendDE_1.sendDE,\n sendPE: sendPE_1.sendPE\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendCharacter = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Requests to play as a specified character.\n * @param {number} character the character ID\n */\nvar sendCharacter = function (character) {\n if (character === -1 || client_1.client.chars[character].name) {\n client_1.client.sender.sendServer(\"CC#\".concat(client_1.client.playerID, \"#\").concat(character, \"#web#%\"));\n }\n};\nexports.sendCharacter = sendCharacter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendCheck = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Sends a keepalive packet.\n */\nvar sendCheck = function () {\n client_1.client.sender.sendServer(\"CH#\".concat(client_1.client.charID, \"#%\"));\n};\nexports.sendCheck = sendCheck;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendDE = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Sends delete evidence command.\n * @param {number} evidence id\n */\nvar sendDE = function (id) {\n client_1.client.sender.sendServer(\"DE#\".concat(id, \"#%\"));\n};\nexports.sendDE = sendDE;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendEE = void 0;\nvar client_1 = require(\"../../client\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Sends edit evidence command.\n * @param {number} evidence id\n * @param {string} evidence name\n * @param {string} evidence description\n * @param {string} evidence image filename\n */\nvar sendEE = function (id, name, desc, img) {\n client_1.client.sender.sendServer(\"EE#\".concat(id, \"#\").concat((0, encoding_1.escapeChat)(name), \"#\").concat((0, encoding_1.escapeChat)(desc), \"#\").concat((0, encoding_1.escapeChat)(img), \"#%\"));\n};\nexports.sendEE = sendEE;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendHP = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Sends health point command.\n * @param {number} side the position\n * @param {number} hp the health point\n */\nvar sendHP = function (side, hp) {\n client_1.client.sender.sendServer(\"HP#\".concat(side, \"#\").concat(hp, \"#%\"));\n};\nexports.sendHP = sendHP;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendIC = void 0;\nvar client_1 = require(\"../../client\");\nvar encoding_1 = require(\"../../encoding\");\nvar client_2 = require(\"../../client\");\nvar queryParser_1 = require(\"../../utils/queryParser\");\nvar mode = (0, queryParser_1.default)().mode;\n/**\n * Sends an in-character chat message.\n * @param {number} deskmod controls the desk\n * @param {string} speaking who is speaking\n * @param {string} name the name of the current character\n * @param {string} silent whether or not it's silent\n * @param {string} message the message to be sent\n * @param {string} side the name of the side in the background\n * @param {string} sfx_name the name of the sound effect\n * @param {number} emote_modifier whether or not to zoom\n * @param {number} sfx_delay the delay (in milliseconds) to play the sound effect\n * @param {number} objection_modifier the number of the shout to play\n * @param {string} evidence the filename of evidence to show\n * @param {boolean} flip change to 1 to reverse sprite for position changes\n * @param {boolean} realization screen flash effect\n * @param {number} text_color text color\n * @param {string} showname custom name to be displayed (optional)\n * @param {number} other_charid paired character (optional)\n * @param {number} self_offset offset to paired character (optional)\n * @param {number} noninterrupting_preanim play the full preanim (optional)\n */\nvar sendIC = function (deskmod, preanim, name, emote, message, side, sfx_name, emote_modifier, sfx_delay, objection_modifier, evidence, flip, realization, text_color, showname, other_charid, self_hoffset, self_yoffset, noninterrupting_preanim, looping_sfx, screenshake, frame_screenshake, frame_realization, frame_sfx, additive, effect) {\n var extra_cccc = \"\";\n var other_emote = \"\";\n var other_offset = \"\";\n var extra_27 = \"\";\n var extra_28 = \"\";\n if (client_1.extrafeatures.includes(\"cccc_ic_support\")) {\n var self_offset = client_1.extrafeatures.includes(\"y_offset\")\n ? \"\".concat(self_hoffset, \"\").concat(self_yoffset)\n : self_hoffset; // HACK: this should be an & but client fucked it up and all the servers adopted it\n if (mode === \"replay\") {\n other_emote = \"##\";\n other_offset = \"#0#0\";\n }\n extra_cccc = \"\".concat((0, encoding_1.escapeChat)(showname), \"#\").concat(other_charid).concat(other_emote, \"#\").concat(self_offset).concat(other_offset, \"#\").concat(Number(noninterrupting_preanim), \"#\");\n if (client_1.extrafeatures.includes(\"looping_sfx\")) {\n extra_27 = \"\".concat(Number(looping_sfx), \"#\").concat(Number(screenshake), \"#\").concat(frame_screenshake, \"#\").concat(frame_realization, \"#\").concat(frame_sfx, \"#\");\n if (client_1.extrafeatures.includes(\"effects\")) {\n extra_28 = \"\".concat(Number(additive), \"#\").concat((0, encoding_1.escapeChat)(effect), \"#\");\n }\n }\n }\n var serverMessage = \"MS#\".concat(deskmod, \"#\").concat((0, encoding_1.escapeChat)(preanim), \"#\").concat((0, encoding_1.escapeChat)(name), \"#\").concat((0, encoding_1.escapeChat)(emote)) +\n \"#\".concat((0, encoding_1.escapeChat)(message), \"#\").concat((0, encoding_1.escapeChat)(side), \"#\").concat((0, encoding_1.escapeChat)(sfx_name), \"#\").concat(emote_modifier) +\n \"#\".concat(client_2.client.charID, \"#\").concat(sfx_delay, \"#\").concat(Number(objection_modifier), \"#\").concat(Number(evidence), \"#\").concat(Number(flip), \"#\").concat(Number(realization), \"#\").concat(text_color, \"#\").concat(extra_cccc).concat(extra_27).concat(extra_28, \"%\");\n client_2.client.sender.sendServer(serverMessage);\n if (mode === \"replay\") {\n (document.getElementById(\"client_ooclog\")).value += \"wait#\".concat(document.getElementById(\"client_replaytimer\").value, \"#%\\r\\n\");\n }\n};\nexports.sendIC = sendIC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendMusicChange = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Requests to change the music to the specified track.\n * @param {string} track the track ID\n */\nvar sendMusicChange = function (track) {\n client_1.client.sender.sendServer(\"MC#\".concat(track, \"#\").concat(client_1.client.charID, \"#%\"));\n};\nexports.sendMusicChange = sendMusicChange;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendOOC = void 0;\nvar client_1 = require(\"../../client\");\nvar encoding_1 = require(\"../../encoding\");\nvar setCookie_1 = require(\"../../utils/setCookie\");\nvar saveChatLogHandle_1 = require(\"../../client/saveChatLogHandle\");\n/**\n * Sends an out-of-character chat message.\n * @param {string} message the message to send\n */\nvar sendOOC = function (message) {\n (0, setCookie_1.default)(\"OOC_name\", document.getElementById(\"OOC_name\").value);\n var oocName = \"\".concat((0, encoding_1.escapeChat)(document.getElementById(\"OOC_name\").value));\n var oocMessage = \"\".concat((0, encoding_1.escapeChat)(message));\n var commands = {\n \"/save_chatlog\": saveChatLogHandle_1.saveChatlogHandle,\n };\n var commandsMap = new Map(Object.entries(commands));\n if (oocMessage && commandsMap.has(oocMessage.toLowerCase())) {\n try {\n commandsMap.get(oocMessage.toLowerCase())();\n }\n catch (e) {\n // Command Not Recognized\n }\n }\n else {\n client_1.client.sender.sendServer(\"CT#\".concat(oocName, \"#\").concat(oocMessage, \"#%\"));\n }\n};\nexports.sendOOC = sendOOC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendPE = void 0;\nvar client_1 = require(\"../../client\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Sends add evidence command.\n * @param {string} evidence name\n * @param {string} evidence description\n * @param {string} evidence image filename\n */\nvar sendPE = function (name, desc, img) {\n client_1.client.sender.sendServer(\"PE#\".concat((0, encoding_1.escapeChat)(name), \"#\").concat((0, encoding_1.escapeChat)(desc), \"#\").concat((0, encoding_1.escapeChat)(img), \"#%\"));\n};\nexports.sendPE = sendPE;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendRT = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Sends testimony command.\n * @param {string} testimony type\n */\nvar sendRT = function (testimony) {\n client_1.client.sender.sendServer(\"RT#\".concat(testimony, \"#%\"));\n};\nexports.sendRT = sendRT;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendSelf = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Hook for sending messages to the client\n * @param {string} message the message to send\n */\nvar sendSelf = function (message) {\n (document.getElementById(\"client_ooclog\")).value += \"\".concat(message, \"\\r\\n\");\n client_1.client.handleSelf(message);\n};\nexports.sendSelf = sendSelf;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendServer = void 0;\nvar client_1 = require(\"../../client\");\nvar queryParser_1 = require(\"../../utils/queryParser\");\nvar mode = (0, queryParser_1.default)().mode;\n/**\n * Hook for sending messages to the server\n * @param {string} message the message to send\n */\nvar sendServer = function (message) {\n console.debug(\"C: \" + message);\n mode === \"replay\" ? client_1.client.sender.sendSelf(message) : client_1.client.serv.send(message);\n};\nexports.sendServer = sendServer;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendZZ = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Sends call mod command.\n * @param {string} message to mod\n */\nvar sendZZ = function (msg) {\n if (client_1.extrafeatures.includes(\"modcall_reason\")) {\n client_1.client.sender.sendServer(\"ZZ#\".concat(msg, \"#%\"));\n }\n else {\n client_1.client.sender.sendServer(\"ZZ#%\");\n }\n};\nexports.sendZZ = sendZZ;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar transparentPng_1 = require(\"../constants/transparentPng\");\nvar fileExists_1 = require(\"../utils/fileExists\");\n/**\n * Sets all the img tags to the right sources\n * @param {*} chatmsg\n */\nvar setEmote = function (AO_HOST, client, charactername, emotename, prefix, pair, side) { return __awaiter(void 0, void 0, void 0, function () {\n var pairID, characterFolder, acceptedPositions, position, emoteSelector, extensionsMap, extensionsMap_1, extensionsMap_1_1, extension, url, exists, e_1_1;\n var e_1, _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n pairID = pair ? \"pair\" : \"char\";\n characterFolder = \"\".concat(AO_HOST, \"characters/\");\n acceptedPositions = [\"def\", \"pro\", \"wit\"];\n position = acceptedPositions.includes(side) ? \"\".concat(side, \"_\") : \"\";\n emoteSelector = document.getElementById(\"client_\".concat(position).concat(pairID, \"_img\"));\n extensionsMap = [\".gif\", \".png\", \".apng\", \".webp\", \".webp.static\"];\n _b.label = 1;\n case 1:\n _b.trys.push([1, 6, 7, 8]);\n extensionsMap_1 = __values(extensionsMap), extensionsMap_1_1 = extensionsMap_1.next();\n _b.label = 2;\n case 2:\n if (!!extensionsMap_1_1.done) return [3 /*break*/, 5];\n extension = extensionsMap_1_1.value;\n // Hides all sprites before creating a new sprite\n if (client.viewport.getLastCharacter() !== client.viewport.getChatmsg().name) {\n emoteSelector.src = transparentPng_1.default;\n }\n url = void 0;\n if (extension === \".png\") {\n url = \"\".concat(characterFolder).concat(encodeURI(charactername), \"/\").concat(encodeURI(emotename)).concat(extension);\n }\n else if (extension === \".webp.static\") {\n url = \"\".concat(characterFolder).concat(encodeURI(charactername), \"/\").concat(encodeURI(emotename), \".webp\");\n }\n else {\n url = \"\".concat(characterFolder).concat(encodeURI(charactername), \"/\").concat(encodeURI(prefix)).concat(encodeURI(emotename)).concat(extension);\n }\n return [4 /*yield*/, (0, fileExists_1.default)(url)];\n case 3:\n exists = _b.sent();\n if (exists) {\n emoteSelector.src = url;\n return [3 /*break*/, 5];\n }\n _b.label = 4;\n case 4:\n extensionsMap_1_1 = extensionsMap_1.next();\n return [3 /*break*/, 2];\n case 5: return [3 /*break*/, 8];\n case 6:\n e_1_1 = _b.sent();\n e_1 = { error: e_1_1 };\n return [3 /*break*/, 8];\n case 7:\n try {\n if (extensionsMap_1_1 && !extensionsMap_1_1.done && (_a = extensionsMap_1.return)) _a.call(extensionsMap_1);\n }\n finally { if (e_1) throw e_1.error; }\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/];\n }\n });\n}); };\nexports.default = setEmote;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.area_click = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Triggered when an item on the area list is clicked.\n * @param {HTMLElement} el\n */\nfunction area_click(el) {\n var area = client_1.client.areas[el.id.substr(4)].name;\n client_1.client.sender.sendMusicChange(area);\n var areaHr = document.createElement(\"div\");\n areaHr.className = \"hrtext\";\n areaHr.textContent = \"switched to \".concat(el.textContent);\n document.getElementById(\"client_log\").appendChild(areaHr);\n}\nexports.area_click = area_click;\nwindow.area_click = area_click;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.changeBlipVolume = void 0;\nvar setCookie_1 = require(\"../utils/setCookie\");\nvar client_1 = require(\"../client\");\n/**\n * Triggered by the blip volume slider.\n */\nvar changeBlipVolume = function () {\n var blipVolume = (document.getElementById(\"client_bvolume\")).value;\n client_1.client.viewport.blipChannels.forEach(function (channel) { return (channel.volume = Number(blipVolume)); });\n (0, setCookie_1.default)(\"blipVolume\", blipVolume);\n};\nexports.changeBlipVolume = changeBlipVolume;\nwindow.changeBlipVolume = exports.changeBlipVolume;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.changeMusicVolume = void 0;\nvar client_1 = require(\"../client\");\nvar setCookie_1 = require(\"../utils/setCookie\");\nvar changeMusicVolume = function (volume) {\n if (volume === void 0) { volume = -1; }\n var clientVolume = Number(document.getElementById(\"client_mvolume\").value);\n var musicVolume = volume === -1 ? clientVolume : volume;\n client_1.client.viewport.music.forEach(function (channel) { return (channel.volume = musicVolume); });\n (0, setCookie_1.default)(\"musicVolume\", String(musicVolume));\n};\nexports.changeMusicVolume = changeMusicVolume;\nwindow.changeMusicVolume = exports.changeMusicVolume;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIndexFromSelect = void 0;\n/**\n * Find index of anything in select box.\n * @param {string} select_box the select element name\n * @param {string} value the value that need to be compared\n */\nfunction getIndexFromSelect(select_box, value) {\n // Find if icon alraedy existed in select box\n var select_element = document.getElementById(select_box);\n for (var i = 1; i < select_element.length; ++i) {\n if (select_element.options[i].value === value) {\n return i;\n }\n }\n return 0;\n}\nexports.getIndexFromSelect = getIndexFromSelect;\nwindow.getIndexFromSelect = getIndexFromSelect;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.onReplayGo = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Triggered when the user click replay GOOOOO\n * @param {KeyboardEvent} event\n */\nfunction onReplayGo(_event) {\n client_1.client.handleReplay();\n}\nexports.onReplayGo = onReplayGo;\nwindow.onReplayGo = onReplayGo;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.opusCheck = void 0;\n/**\n * Triggered when there was an error loading a sound\n * @param {HTMLAudioElement} image the element containing the missing sound\n */\nfunction opusCheck(channel) {\n var audio = channel.src;\n if (audio === \"\") {\n return;\n }\n console.warn(\"failed to load sound \".concat(channel.src));\n var oldsrc = \"\";\n var newsrc = \"\";\n oldsrc = channel.src;\n if (!oldsrc.endsWith(\".opus\")) {\n newsrc = oldsrc.replace(\".mp3\", \".opus\");\n newsrc = newsrc.replace(\".wav\", \".opus\");\n channel.src = newsrc; // unload so the old sprite doesn't persist\n }\n}\nexports.opusCheck = opusCheck;\nwindow.opusCheck = opusCheck;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.pickEmotion = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Highlights and selects an emotion for in-character chat.\n * @param {string} emo the new emotion to be selected\n */\nfunction pickEmotion(emo) {\n try {\n if (client_1.client.selectedEmote !== -1) {\n document.getElementById(\"emo_\".concat(client_1.client.selectedEmote)).className =\n \"emote_button\";\n }\n }\n catch (err) {\n // do nothing\n }\n client_1.client.selectedEmote = emo;\n document.getElementById(\"emo_\".concat(emo)).className = \"emote_button dark\";\n document.getElementById(\"sendsfx\").checked =\n client_1.client.emote.sfx.length > 1;\n document.getElementById(\"sendpreanim\").checked =\n client_1.client.emote.zoom == 1;\n}\nexports.pickEmotion = pickEmotion;\nwindow.pickEmotion = pickEmotion;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.reloadTheme = void 0;\nvar client_1 = require(\"../client\");\nvar setCookie_1 = require(\"../utils/setCookie\");\n/**\n * Triggered by the theme selector.\n */\nvar reloadTheme = function () {\n client_1.client.viewport.setTheme(document.getElementById(\"client_themeselect\")\n .value);\n (0, setCookie_1.default)(\"theme\", client_1.client.viewport.getTheme());\n (document.getElementById(\"client_theme\")).href = \"styles/\".concat(client_1.client.viewport.getTheme(), \".css\");\n};\nexports.reloadTheme = reloadTheme;\nwindow.reloadTheme = exports.reloadTheme;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resizeChatbox = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Set the font size for the chatbox\n */\nfunction resizeChatbox() {\n var chatContainerBox = document.getElementById(\"client_chatcontainer\");\n var clockBox = document.getElementById(\"client_clock\");\n var trackstatusBox = document.getElementById(\"client_trackstatus\");\n var gameHeight = document.getElementById(\"client_background\").offsetHeight;\n chatContainerBox.style.fontSize = \"\".concat((gameHeight * 0.0521).toFixed(1), \"px\");\n clockBox.style.fontSize = \"\".concat((gameHeight * 0.0521).toFixed(1), \"px\");\n trackstatusBox.style.fontSize = \"\".concat((gameHeight * 0.0521).toFixed(1), \"px\");\n var trackstatus = (document.getElementById(\"client_trackstatustext\"));\n trackstatus.style.width = (trackstatus.offsetWidth - 1) + \"px\";\n //clock\n var now = new Date();\n var weekday = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n var month = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n document.getElementById(\"client_clock_month\").innerText = month[now.getMonth()];\n if (client_1.CHATBOX == \"acww\") {\n weekday = [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"];\n document.getElementById(\"client_clock_weekday\").innerText = weekday[now.getDay()];\n document.getElementById(\"client_clock_date\").innerText = now.getDay() + \"/\" + now.getMonth();\n document.getElementById(\"client_clock_time\").innerText = now.getHours() + \":\" + now.getMinutes();\n }\n else if (client_1.CHATBOX == \"key\") {\n weekday = [\"Sun.\", \"Mon.\", \"Tue.\", \"Wed.\", \"Thu.\", \"Fri.\", \"Sat.\"];\n document.getElementById(\"client_clock_weekday\").innerText = weekday[now.getDay()];\n document.getElementById(\"client_clock_date\").innerText = String(now.getDate());\n }\n}\nexports.resizeChatbox = resizeChatbox;\nwindow.resizeChatbox = resizeChatbox;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setChatbox = void 0;\nvar client_1 = require(\"../client\");\nvar chatboxes_js_1 = require(\"../styles/chatbox/chatboxes.js\");\nvar setCookie_1 = require(\"../utils/setCookie\");\n/**\n * Set the style of the chatbox\n */\nfunction setChatbox(setstyle) {\n var chatbox_theme = (document.getElementById(\"chatbox_theme\"));\n var themeselect = (document.getElementById(\"client_chatboxselect\"));\n (0, client_1.setCHATBOX)(themeselect.value);\n (0, setCookie_1.default)(\"chatbox\", client_1.CHATBOX);\n if (client_1.CHATBOX === \"dynamic\") {\n var style = setstyle.replace(\"chat\", \"\");\n if (chatboxes_js_1.default.includes(style)) {\n chatbox_theme.href = \"styles/chatbox/\".concat(style, \".css\");\n }\n else {\n chatbox_theme.href = \"styles/chatbox/aa.css\";\n }\n }\n else {\n chatbox_theme.href = \"styles/chatbox/\".concat(client_1.CHATBOX, \".css\");\n }\n}\nexports.setChatbox = setChatbox;\nwindow.setChatbox = setChatbox;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.showname_click = void 0;\nvar setCookie_1 = require(\"../utils/setCookie\");\n/**\n * Triggered when the showname checkboc is clicked\n * @param {MouseEvent} event\n */\nfunction showname_click(_event) {\n (0, setCookie_1.default)(\"showname\", String(document.getElementById(\"showname\").checked));\n (0, setCookie_1.default)(\"ic_chat_name\", document.getElementById(\"ic_chat_name\").value);\n var css_s = document.getElementById(\"nameplate_setting\");\n if (document.getElementById(\"showname\").checked) {\n css_s.href = \"styles/shownames.css\";\n }\n else {\n css_s.href = \"styles/nameplates.css\";\n }\n}\nexports.showname_click = showname_click;\nwindow.showname_click = showname_click;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.showFactorDialog = void 0;\nvar client_1 = require(\"../client\");\nfunction handleCredentialResponse(response) {\n client_1.client.sender.sendServer(\"2T#\".concat(response.credential, \"#%\"));\n}\nwindow.handleCredentialResponse = handleCredentialResponse;\nfunction showFactorDialog(args) {\n document.getElementById(\"client_secondfactor\").style.display = args[1];\n}\nexports.showFactorDialog = showFactorDialog;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateActionCommands = void 0;\n/**\n * Update evidence icon.\n */\nfunction updateActionCommands(side) {\n if (side === \"jud\") {\n document.getElementById(\"judge_action\").style.display = \"inline-table\";\n document.getElementById(\"no_action\").style.display = \"none\";\n }\n else {\n document.getElementById(\"judge_action\").style.display = \"none\";\n document.getElementById(\"no_action\").style.display = \"inline-table\";\n }\n // Update role selector\n for (var i = 0, role_select = document.getElementById(\"role_select\"); i < role_select.options.length; i++) {\n if (side === role_select.options[i].value) {\n role_select.options.selectedIndex = i;\n return;\n }\n }\n}\nexports.updateActionCommands = updateActionCommands;\nwindow.updateActionCommands = updateActionCommands;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateBackgroundPreview = void 0;\nvar aoHost_1 = require(\"../client/aoHost\");\nvar tryUrls_1 = require(\"../utils/tryUrls\");\n/**\n * Update background preview.\n */\nfunction updateBackgroundPreview() {\n var background_select = (document.getElementById(\"bg_select\"));\n var background_filename = (document.getElementById(\"bg_filename\"));\n var background_preview = (document.getElementById(\"bg_preview\"));\n if (background_select.selectedIndex === 0) {\n background_filename.style.display = \"initial\";\n }\n else {\n background_filename.style.display = \"none\";\n }\n (0, tryUrls_1.default)(\"\".concat(aoHost_1.AO_HOST, \"background/\").concat(encodeURI(background_select.value.toLowerCase()), \"/defenseempty\")).then(function (resp) {\n background_preview.src = resp;\n });\n}\nexports.updateBackgroundPreview = updateBackgroundPreview;\nwindow.updateBackgroundPreview = updateBackgroundPreview;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.prepChat = exports.decodeChat = exports.safeTags = exports.unescapeChat = exports.escapeChat = void 0;\n/**\n * Escapes a string to AO1 escape codes.\n * @param {string} estring the string to be escaped\n */\nfunction escapeChat(estring) {\n return estring\n .replaceAll('#', '')\n .replaceAll('&', '')\n .replaceAll('%', '')\n .replaceAll('$', '');\n}\nexports.escapeChat = escapeChat;\n/**\n * Unescapes a string to AO1 escape codes.\n * @param {string} estring the string to be unescaped\n */\nfunction unescapeChat(estring) {\n return estring\n .replaceAll('', '#')\n .replaceAll('', '&')\n .replaceAll('', '%')\n .replaceAll('', '$');\n}\nexports.unescapeChat = unescapeChat;\n/**\n * Escapes a string to be HTML-safe.\n *\n * XXX: This is unnecessary if we use `createTextNode` instead!\n * @param {string} unsafe an unsanitized string\n */\nfunction safeTags(unsafe) {\n if (unsafe) {\n return unsafe\n .replaceAll('>', '>')\n .replaceAll('<', '<');\n }\n return '';\n}\nexports.safeTags = safeTags;\n/**\n * Decodes text on client side.\n * @param {string} estring the string to be decoded\n */\nfunction decodeChat(estring) {\n // Source: https://stackoverflow.com/questions/7885096/how-do-i-decode-a-string-with-escaped-unicode\n return estring.replace(/\\\\u([\\d\\w]{1,})/gi, function (match, group) { return String.fromCharCode(parseInt(group, 16)); });\n}\nexports.decodeChat = decodeChat;\n/**\n * XXX: a nasty hack made by gameboyprinter.\n * @param {string} msg chat message to prepare for display\n */\nfunction prepChat(msg) {\n // TODO: make this less awful\n return safeTags(unescapeChat(decodeChat(msg)));\n}\nexports.prepChat = prepChat;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleARUP = void 0;\nvar client_1 = require(\"../../client\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Handle the change of players in an area.\n * @param {Array} args packet arguments\n */\nvar handleARUP = function (args) {\n args = args.slice(1);\n for (var i = 0; i < args.length - 2; i++) {\n if (client_1.client.areas[i]) {\n // the server sends us ARUP before we even get the area list\n var thisarea = document.getElementById(\"area\".concat(i));\n switch (Number(args[0])) {\n case 0: // playercount\n client_1.client.areas[i].players = Number(args[i + 1]);\n break;\n case 1: // status\n client_1.client.areas[i].status = (0, encoding_1.safeTags)(args[i + 1]);\n break;\n case 2:\n client_1.client.areas[i].cm = (0, encoding_1.safeTags)(args[i + 1]);\n break;\n case 3:\n client_1.client.areas[i].locked = (0, encoding_1.safeTags)(args[i + 1]);\n break;\n }\n thisarea.className = \"area-button area-\".concat(client_1.client.areas[i].status.toLowerCase());\n thisarea.innerText = \"\".concat(client_1.client.areas[i].name, \" (\").concat(client_1.client.areas[i].players, \") [\").concat(client_1.client.areas[i].status, \"]\");\n thisarea.title =\n \"Players: \".concat(client_1.client.areas[i].players, \"\\n\") +\n \"Status: \".concat(client_1.client.areas[i].status, \"\\n\") +\n \"CM: \".concat(client_1.client.areas[i].cm, \"\\n\") +\n \"Area lock: \".concat(client_1.client.areas[i].locked);\n }\n }\n};\nexports.handleARUP = handleARUP;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleASS = void 0;\nvar aoHost_1 = require(\"../../client/aoHost\");\n/**\n* new asset url!!\n* @param {Array} args packet arguments\n*/\nvar handleASS = function (args) {\n if (args[1] !== \"None\")\n (0, aoHost_1.setAOhost)(args[1]);\n};\nexports.handleASS = handleASS;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleBB = void 0;\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Handles the warning packet\n * on client this spawns a message box you can't close for 2 seconds\n * @param {Array} args ban reason\n */\nvar handleBB = function (args) {\n alert((0, encoding_1.safeTags)(args[1]));\n};\nexports.handleBB = handleBB;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleBD = void 0;\nvar client_1 = require(\"../../client\");\nvar encoding_1 = require(\"../../encoding\");\nvar handleBans_1 = require(\"../../client/handleBans\");\n/**\n * Handles the banned packet\n * this one is sent when you try to reconnect but you're banned\n * @param {Array} args ban reason\n */\nvar handleBD = function (args) {\n (0, handleBans_1.handleBans)(\"Banned\", (0, encoding_1.safeTags)(args[1]));\n (0, client_1.setBanned)(true);\n};\nexports.handleBD = handleBD;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleBN = void 0;\nvar client_1 = require(\"../../client\");\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar encoding_1 = require(\"../../encoding\");\nvar updateBackgroundPreview_1 = require(\"../../dom/updateBackgroundPreview\");\nvar getIndexFromSelect_1 = require(\"../../dom/getIndexFromSelect\");\nvar tryUrls_1 = require(\"../../utils/tryUrls\");\n/**\n * Handles a background change.\n * @param {Array} args packet arguments\n */\nvar handleBN = function (args) {\n var bgFromArgs = (0, encoding_1.safeTags)(args[1]);\n client_1.client.viewport.setBackgroundName(bgFromArgs);\n var bgfolder = client_1.client.viewport.getBackgroundFolder();\n var bg_index = (0, getIndexFromSelect_1.getIndexFromSelect)(\"bg_select\", client_1.client.viewport.getBackgroundName());\n document.getElementById(\"bg_select\").selectedIndex =\n bg_index;\n (0, updateBackgroundPreview_1.updateBackgroundPreview)();\n if (bg_index === 0) {\n document.getElementById(\"bg_filename\").value =\n client_1.client.viewport.getBackgroundName();\n }\n (0, tryUrls_1.default)(\"\".concat(aoHost_1.AO_HOST, \"background/\").concat(encodeURI(args[1].toLowerCase()), \"/defenseempty\")).then(function (resp) {\n document.getElementById(\"bg_preview\").src = resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"defensedesk\")).then(function (resp) {\n document.getElementById(\"client_def_bench\").src =\n resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"stand\")).then(function (resp) {\n document.getElementById(\"client_wit_bench\").src =\n resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"prosecutiondesk\")).then(function (resp) {\n document.getElementById(\"client_pro_bench\").src =\n resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"full\")).then(function (resp) {\n document.getElementById(\"client_court\").src = resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"defenseempty\")).then(function (resp) {\n document.getElementById(\"client_court_def\").src =\n resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"transition_def\")).then(function (resp) {\n document.getElementById(\"client_court_deft\").src =\n resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"witnessempty\")).then(function (resp) {\n document.getElementById(\"client_court_wit\").src =\n resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"transition_pro\")).then(function (resp) {\n document.getElementById(\"client_court_prot\").src =\n resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"prosecutorempty\")).then(function (resp) {\n document.getElementById(\"client_court_pro\").src =\n resp;\n });\n if (client_1.client.charID === -1) {\n client_1.client.viewport.set_side({\n position: \"jud\",\n showSpeedLines: false,\n showDesk: true,\n });\n }\n else {\n client_1.client.viewport.set_side({\n position: client_1.client.chars[client_1.client.charID].side,\n showSpeedLines: false,\n showDesk: true,\n });\n }\n};\nexports.handleBN = handleBN;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleCC = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * What? you want a character??\n * @param {Array} args packet arguments\n */\nvar handleCC = function (args) {\n client_1.client.sender.sendSelf(\"PV#1#CID#\".concat(args[2], \"#%\"));\n};\nexports.handleCC = handleCC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleCI = void 0;\nvar client_1 = require(\"../../client\");\nvar handleCharacterInfo_1 = require(\"../../client/handleCharacterInfo\");\n/**\n * Handles incoming character information, bundling multiple characters\n * per packet.\n * CI#0#Phoenix&description&&&&#Miles ...\n * @param {Array} args packet arguments\n */\nvar handleCI = function (args) {\n // Loop through the 10 characters that were sent\n document.getElementById(\"client_loadingtext\").innerHTML = \"Loading Character \".concat(args[1], \"/\").concat(client_1.client.char_list_length);\n var _loop_1 = function (i) {\n if (i % 2 === 0) {\n var chargs_1 = args[i].split(\"&\");\n var charid_1 = Number(args[i - 1]);\n setTimeout(function () { return (0, handleCharacterInfo_1.handleCharacterInfo)(chargs_1, charid_1); }, 500);\n }\n };\n for (var i = 2; i <= args.length - 2; i++) {\n _loop_1(i);\n }\n // Request the next pack\n client_1.client.sender.sendServer(\"AN#\".concat(Number(args[1]) / 10 + 1, \"#%\"));\n};\nexports.handleCI = handleCI;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleCT = void 0;\nvar queryParser_1 = require(\"../../utils/queryParser\");\nvar encoding_1 = require(\"../../encoding\");\nvar mode = (0, queryParser_1.default)().mode;\n/**\n * Handles an out-of-character chat message.\n * @param {Array} args packet arguments\n */\nvar handleCT = function (args) {\n if (mode !== \"replay\") {\n var oocLog = document.getElementById(\"client_ooclog\");\n oocLog.innerHTML += \"\".concat((0, encoding_1.prepChat)(args[1]), \": \").concat((0, encoding_1.prepChat)(args[2]), \"\\r\\n\");\n if (oocLog.scrollTop > oocLog.scrollHeight - 600) {\n oocLog.scrollTop = oocLog.scrollHeight;\n }\n }\n};\nexports.handleCT = handleCT;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleCharsCheck = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Handles the list of all used and vacant characters.\n * @param {Array} args list of all characters represented as a 0 for free or a -1 for taken\n */\nvar handleCharsCheck = function (args) {\n for (var i = 0; i < client_1.client.char_list_length; i++) {\n var img = document.getElementById(\"demo_\".concat(i));\n if (args[i + 1] === \"-1\") {\n img.style.opacity = \"0.25\";\n }\n else if (args[i + 1] === \"0\") {\n img.style.opacity = \"1\";\n }\n }\n};\nexports.handleCharsCheck = handleCharsCheck;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleDONE = void 0;\nvar queryParser_1 = require(\"../../utils/queryParser\");\nvar mode = (0, queryParser_1.default)().mode;\n/**\n * Handles the handshake completion packet, meaning the player\n * is ready to select a character.\n *\n * @param {Array} args packet arguments\n */\nvar handleDONE = function (_args) {\n document.getElementById(\"client_loading\").style.display = \"none\";\n if (mode === \"watch\") {\n // Spectators don't need to pick a character\n document.getElementById(\"client_waiting\").style.display = \"none\";\n }\n};\nexports.handleDONE = handleDONE;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleEI = void 0;\nvar client_1 = require(\"../../client\");\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Handles incoming evidence information, containing only one evidence\n * item per packet.\n *\n * EI#id#name&description&type&image&##%\n *\n * @param {Array} args packet arguments\n */\nvar handleEI = function (args) {\n document.getElementById(\"client_loadingtext\").innerHTML = \"Loading Evidence \".concat(args[1], \"/\").concat(client_1.client.evidence_list_length);\n var evidenceID = Number(args[1]);\n var arg = args[2].split(\"&\");\n client_1.client.evidences[evidenceID] = {\n name: (0, encoding_1.prepChat)(arg[0]),\n desc: (0, encoding_1.prepChat)(arg[1]),\n filename: (0, encoding_1.safeTags)(arg[3]),\n icon: \"\".concat(aoHost_1.AO_HOST, \"evidence/\").concat(encodeURI(arg[3].toLowerCase())),\n };\n client_1.client.sender.sendServer(\"AE\" + (evidenceID + 1) + \"#%\");\n};\nexports.handleEI = handleEI;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleEM = void 0;\nvar client_1 = require(\"../../client\");\nvar addTrack_1 = require(\"../../client/addTrack\");\nvar createArea_1 = require(\"../../client/createArea\");\nvar fixLastArea_1 = require(\"../../client/fixLastArea\");\nvar isAudio_1 = require(\"../../client/isAudio\");\n/**\n * Handles incoming music information, containing multiple entries\n * per packet.\n * @param {Array} args packet arguments\n */\nvar handleEM = function (args) {\n document.getElementById(\"client_loadingtext\").innerHTML = \"Loading Music\";\n if (args[1] === \"0\") {\n client_1.client.resetMusicList();\n client_1.client.resetAreaList();\n client_1.client.musics_time = false;\n }\n for (var i = 2; i < args.length - 1; i++) {\n if (i % 2 === 0) {\n var trackname = args[i];\n var trackindex = Number(args[i - 1]);\n if (client_1.client.musics_time) {\n (0, addTrack_1.addTrack)(trackname);\n }\n else if ((0, isAudio_1.isAudio)(trackname)) {\n client_1.client.musics_time = true;\n (0, fixLastArea_1.fix_last_area)();\n (0, addTrack_1.addTrack)(trackname);\n }\n else {\n (0, createArea_1.createArea)(trackindex, trackname);\n }\n }\n }\n // get the next batch of tracks\n client_1.client.sender.sendServer(\"AM#\".concat(Number(args[1]) / 10 + 1, \"#%\"));\n};\nexports.handleEM = handleEM;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleFA = void 0;\nvar client_1 = require(\"../../client\");\nvar createArea_1 = require(\"../../client/createArea\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Handles updated area list\n * @param {Array} args packet arguments\n */\nvar handleFA = function (args) {\n client_1.client.resetAreaList();\n for (var i = 1; i < args.length; i++) {\n (0, createArea_1.createArea)(i - 1, (0, encoding_1.safeTags)(args[i]));\n }\n};\nexports.handleFA = handleFA;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleFL = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * With this the server tells us which features it supports\n * @param {Array} args list of features\n */\nvar handleFL = function (args) {\n console.info(\"Server-supported features:\");\n console.info(args);\n (0, client_1.setExtraFeatures)(args);\n if (args.includes(\"yellowtext\")) {\n var colorselect = (document.getElementById(\"textcolor\"));\n colorselect.options[colorselect.options.length] = new Option(\"Yellow\", \"5\");\n colorselect.options[colorselect.options.length] = new Option(\"Pink\", \"6\");\n colorselect.options[colorselect.options.length] = new Option(\"Cyan\", \"7\");\n colorselect.options[colorselect.options.length] = new Option(\"Grey\", \"8\");\n }\n if (args.includes(\"cccc_ic_support\")) {\n document.getElementById(\"cccc\").style.display = \"\";\n document.getElementById(\"pairing\").style.display = \"\";\n }\n if (args.includes(\"flipping\")) {\n document.getElementById(\"button_flip\").style.display = \"\";\n }\n if (args.includes(\"looping_sfx\")) {\n document.getElementById(\"button_shake\").style.display = \"\";\n document.getElementById(\"2.7\").style.display = \"\";\n }\n if (args.includes(\"effects\")) {\n document.getElementById(\"2.8\").style.display = \"\";\n }\n if (args.includes(\"y_offset\")) {\n document.getElementById(\"y_offset\").style.display = \"\";\n }\n};\nexports.handleFL = handleFL;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleFM = void 0;\nvar client_1 = require(\"../../client\");\nvar addTrack_1 = require(\"../../client/addTrack\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Handles updated music list\n * @param {Array} args packet arguments\n */\nvar handleFM = function (args) {\n client_1.client.resetMusicList();\n for (var i = 1; i < args.length - 1; i++) {\n // Check when found the song for the first time\n (0, addTrack_1.addTrack)((0, encoding_1.safeTags)(args[i]));\n }\n};\nexports.handleFM = handleFM;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleHI = void 0;\nvar client_1 = require(\"../../client\");\nvar version = process.env.npm_package_version;\n/**\n * Handle the player\n * @param {Array} args packet arguments\n */\nvar handleHI = function (_args) {\n client_1.client.sender.sendSelf(\"ID#1#webAO#\".concat(version, \"#%\"));\n client_1.client.sender.sendSelf(\"FL#fastloading#yellowtext#cccc_ic_support#flipping#looping_sfx#effects#%\");\n};\nexports.handleHI = handleHI;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleHP = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Handles a change in the health bars' states.\n * @param {Array} args packet arguments\n */\nvar handleHP = function (args) {\n var percent_hp = Number(args[2]) * 10;\n var healthbox;\n if (args[1] === \"1\") {\n // Def hp\n client_1.client.hp[0] = Number(args[2]);\n healthbox = document.getElementById(\"client_defense_hp\");\n }\n else {\n // Pro hp\n client_1.client.hp[1] = Number(args[2]);\n healthbox = document.getElementById(\"client_prosecutor_hp\");\n }\n (healthbox.getElementsByClassName(\"health-bar\")[0]).style.width = \"\".concat(percent_hp, \"%\");\n};\nexports.handleHP = handleHP;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleID = void 0;\nvar client_1 = require(\"../../client\");\nvar version = process.env.npm_package_version;\n/**\n * Identifies the server and issues a playerID\n * @param {Array} args packet arguments\n */\nvar handleID = function (args) {\n client_1.client.playerID = Number(args[1]);\n var serverSoftware = args[2].split(\"&\")[0];\n var serverVersion;\n if (serverSoftware === \"serverD\") {\n serverVersion = args[2].split(\"&\")[1];\n }\n else if (serverSoftware === \"webAO\") {\n (0, client_1.setOldLoading)(false);\n client_1.client.sender.sendSelf(\"PN#0#1#%\");\n }\n else {\n serverVersion = args[3];\n }\n if (serverSoftware === \"serverD\" && serverVersion === \"1377.152\") {\n (0, client_1.setOldLoading)(true);\n } // bugged version\n if (serverSoftware !== \"webAO\") {\n client_1.client.sender.sendServer(\"ID#webAO#\".concat(version, \"#%\"));\n }\n};\nexports.handleID = handleID;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleJD = void 0;\n/**\n* show/hide judge controls\n* @param {number} show either a 1 or a 0\n*/\nvar handleJD = function (args) {\n if (Number(args[1]) === 1) {\n document.getElementById(\"judge_action\").style.display = \"inline-table\";\n document.getElementById(\"no_action\").style.display = \"none\";\n }\n else {\n document.getElementById(\"judge_action\").style.display = \"none\";\n document.getElementById(\"no_action\").style.display = \"inline-table\";\n }\n};\nexports.handleJD = handleJD;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleKB = void 0;\nvar client_1 = require(\"../../client\");\nvar encoding_1 = require(\"../../encoding\");\nvar handleBans_1 = require(\"../../client/handleBans\");\n/**\n * Handles the banned packet\n * this one is sent when you are kicked off the server\n * @param {Array} args ban reason\n */\nvar handleKB = function (args) {\n (0, handleBans_1.handleBans)(\"Banned\", (0, encoding_1.safeTags)(args[1]));\n (0, client_1.setBanned)(true);\n};\nexports.handleKB = handleKB;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleKK = void 0;\nvar encoding_1 = require(\"../../encoding\");\nvar handleBans_1 = require(\"../../client/handleBans\");\n/**\n * Handles the kicked packet\n * @param {Array} args kick reason\n */\nvar handleKK = function (args) {\n (0, handleBans_1.handleBans)(\"Kicked\", (0, encoding_1.safeTags)(args[1]));\n};\nexports.handleKK = handleKK;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleLE = void 0;\nvar client_1 = require(\"../../client\");\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Handles incoming evidence list, all evidences at once\n * item per packet.\n *\n * @param {Array} args packet arguments\n */\nvar handleLE = function (args) {\n client_1.client.evidences = [];\n for (var i = 1; i < args.length - 1; i++) {\n var arg = args[i].split(\"&\");\n client_1.client.evidences[i - 1] = {\n name: (0, encoding_1.prepChat)(arg[0]),\n desc: (0, encoding_1.prepChat)(arg[1]),\n filename: (0, encoding_1.safeTags)(arg[2]),\n icon: \"\".concat(aoHost_1.AO_HOST, \"evidence/\").concat(encodeURI(arg[2].toLowerCase())),\n };\n }\n var evidence_box = document.getElementById(\"evidences\");\n evidence_box.innerHTML = \"\";\n var _loop_1 = function (i) {\n var evi_item = new Image();\n evi_item.id = \"evi_\" + i;\n evi_item.className = \"evi_icon\";\n evi_item.src = client_1.client.evidences[i - 1].icon;\n evi_item.alt = client_1.client.evidences[i - 1].name;\n evi_item.onclick = function () { window.pickEvidence(i); };\n evidence_box.appendChild(evi_item);\n };\n for (var i = 1; i <= client_1.client.evidences.length; i++) {\n _loop_1(i);\n }\n};\nexports.handleLE = handleLE;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleMC = void 0;\nvar encoding_1 = require(\"../../encoding\");\nvar client_1 = require(\"../../client\");\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar appendICLog_1 = require(\"../../client/appendICLog\");\n/**\n * Handles a music change to an arbitrary resource.\n * @param {Array} args packet arguments\n */\nvar handleMC = function (args) {\n var track = (0, encoding_1.prepChat)(args[1]);\n var charID = Number(args[2]);\n var showname = args[3] || \"\";\n var looping = Boolean(args[4]);\n var channel = Number(args[5]) || 0;\n // const fading = Number(args[6]) || 0; // unused in web\n var music = client_1.client.viewport.music[channel];\n var musicname;\n music.pause();\n if (track.startsWith(\"http\")) {\n music.src = track;\n }\n else {\n music.src = \"\".concat(aoHost_1.AO_HOST, \"sounds/music/\").concat(encodeURI(track.toLowerCase()));\n }\n music.loop = looping;\n music.play();\n try {\n musicname = client_1.client.chars[charID].name;\n }\n catch (e) {\n charID = -1;\n }\n if (charID >= 0) {\n musicname = client_1.client.chars[charID].name;\n (0, appendICLog_1.appendICLog)(\"\".concat(musicname, \" changed music to \").concat(track));\n }\n else {\n (0, appendICLog_1.appendICLog)(\"The music was changed to \".concat(track));\n }\n document.getElementById(\"client_trackstatustext\").innerText = track;\n};\nexports.handleMC = handleMC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleMM = void 0;\n/**\n * Handles the \"MusicMode\" packet\n * @param {Array} args packet arguments\n */\nvar handleMM = function (_args) {\n // It's unused nowadays, as preventing people from changing the music is now serverside\n};\nexports.handleMM = handleMM;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleMS = void 0;\nvar client_1 = require(\"../../client\");\nvar handleCharacterInfo_1 = require(\"../../client/handleCharacterInfo\");\nvar resetICParams_1 = require(\"../../client/resetICParams\");\nvar encoding_1 = require(\"../../encoding\");\nvar handleICSpeaking_1 = require(\"../../viewport/utils/handleICSpeaking\");\n/**\n * Handles an in-character chat message.\n * @param {*} args packet arguments\n */\nvar handleMS = function (args) {\n // TODO: this if-statement might be a bug.\n if (args[4] !== client_1.client.viewport.getChatmsg().content) {\n document.getElementById(\"client_inner_chat\").innerHTML = \"\";\n var char_id = Number(args[9]);\n var char_name = (0, encoding_1.safeTags)(args[3]);\n var msg_nameplate = args[3];\n var msg_blips = \"male\";\n var char_chatbox = \"default\";\n var char_muted = false;\n if (char_id < client_1.client.char_list_length && char_id >= 0) {\n if (client_1.client.chars[char_id].name !== char_name) {\n console.info(\"\".concat(client_1.client.chars[char_id].name, \" is iniediting to \").concat(char_name));\n var chargs = (\"\".concat(char_name, \"&\") + \"iniediter\").split(\"&\");\n (0, handleCharacterInfo_1.handleCharacterInfo)(chargs, char_id);\n }\n }\n try {\n msg_nameplate = client_1.client.chars[char_id].showname;\n }\n catch (e) {\n msg_nameplate = args[3];\n }\n try {\n msg_blips = client_1.client.chars[char_id].blips;\n }\n catch (e) { }\n try {\n char_chatbox = client_1.client.chars[char_id].chat;\n }\n catch (e) {\n char_chatbox = \"default\";\n }\n try {\n char_muted = client_1.client.chars[char_id].muted;\n }\n catch (e) {\n char_muted = false;\n console.error(\"we're still missing some character data\");\n }\n if (char_muted === false) {\n var chatmsg = {\n deskmod: Number((0, encoding_1.safeTags)(args[1]).toLowerCase()),\n preanim: (0, encoding_1.safeTags)(args[2]).toLowerCase(),\n nameplate: msg_nameplate,\n chatbox: char_chatbox,\n name: char_name,\n sprite: (0, encoding_1.safeTags)(args[4]).toLowerCase(),\n content: (0, encoding_1.prepChat)(args[5]),\n side: args[6].toLowerCase(),\n sound: (0, encoding_1.safeTags)(args[7]).toLowerCase(),\n blips: (0, encoding_1.safeTags)(msg_blips),\n type: Number(args[8]),\n charid: char_id,\n snddelay: Number(args[10]),\n objection: Number(args[11]),\n evidence: Number((0, encoding_1.safeTags)(args[12])),\n flip: Number(args[13]),\n flash: Number(args[14]),\n color: Number(args[15]),\n speed: client_1.UPDATE_INTERVAL,\n };\n if (args.length > 16) {\n var extra_cccc = {\n showname: (0, encoding_1.prepChat)(args[16]),\n other_charid: Number(args[17]),\n other_name: (0, encoding_1.safeTags)(args[18]),\n other_emote: (0, encoding_1.safeTags)(args[19]),\n self_offset: args[20].split(\"\"),\n other_offset: args[21].split(\"\"),\n other_flip: Number(args[22]),\n noninterrupting_preanim: Number(args[23]),\n };\n chatmsg = Object.assign(extra_cccc, chatmsg);\n if (args.length > 24) {\n var extra_27 = {\n looping_sfx: Number(args[24]),\n screenshake: Number(args[25]),\n frame_screenshake: (0, encoding_1.safeTags)(args[26]),\n frame_realization: (0, encoding_1.safeTags)(args[27]),\n frame_sfx: (0, encoding_1.safeTags)(args[28]),\n };\n chatmsg = Object.assign(extra_27, chatmsg);\n if (args.length > 29) {\n var extra_28 = {\n additive: Number(args[29]),\n effects: args[30].split(\"|\"),\n };\n chatmsg = Object.assign(extra_28, chatmsg);\n }\n else {\n var extra_28 = {\n additive: 0,\n effects: [\"\", \"\", \"\"],\n };\n chatmsg = Object.assign(extra_28, chatmsg);\n }\n }\n else {\n var extra_27 = {\n looping_sfx: 0,\n screenshake: 0,\n frame_screenshake: \"\",\n frame_realization: \"\",\n frame_sfx: \"\",\n };\n chatmsg = Object.assign(extra_27, chatmsg);\n var extra_28 = {\n additive: 0,\n effects: [\"\", \"\", \"\"],\n };\n chatmsg = Object.assign(extra_28, chatmsg);\n }\n }\n else {\n var extra_cccc = {\n showname: \"\",\n other_charid: 0,\n other_name: \"\",\n other_emote: \"\",\n self_offset: [0, 0],\n other_offset: [0, 0],\n other_flip: 0,\n noninterrupting_preanim: 0,\n };\n chatmsg = Object.assign(extra_cccc, chatmsg);\n var extra_27 = {\n looping_sfx: 0,\n screenshake: 0,\n frame_screenshake: \"\",\n frame_realization: \"\",\n frame_sfx: \"\",\n };\n chatmsg = Object.assign(extra_27, chatmsg);\n var extra_28 = {\n additive: 0,\n effects: [\"\", \"\", \"\"],\n };\n chatmsg = Object.assign(extra_28, chatmsg);\n }\n if (chatmsg.content.trim() === \"\") {\n //blankpost\n chatmsg.content = \"\";\n }\n // our own message appeared, reset the buttons\n if (chatmsg.charid === client_1.client.charID) {\n (0, resetICParams_1.resetICParams)();\n }\n (0, handleICSpeaking_1.handle_ic_speaking)(chatmsg); // no await\n }\n }\n};\nexports.handleMS = handleMS;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handlePN = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Indicates how many users are on this server\n * @param {Array} args packet arguments\n */\nvar handlePN = function (_args) {\n client_1.client.sender.sendServer(\"askchaa#%\");\n};\nexports.handlePN = handlePN;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handlePV = void 0;\nvar client_1 = require(\"../../client\");\nvar fileExists_1 = require(\"../../utils/fileExists\");\nvar updateActionCommands_1 = require(\"../../dom/updateActionCommands\");\nvar pickEmotion_1 = require(\"../../dom/pickEmotion\");\nvar aoHost_1 = require(\"../../client/aoHost\");\n/**\n * Handles the server's assignment of a character for the player to use.\n * PV # playerID (unused) # CID # character ID\n * @param {Array} args packet arguments\n */\nvar handlePV = function (args) { return __awaiter(void 0, void 0, void 0, function () {\n var me, emotes, emotesList, ini, _loop_1, i;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n client_1.client.charID = Number(args[3]);\n document.getElementById(\"client_waiting\").style.display = \"none\";\n document.getElementById(\"client_charselect\").style.display = \"none\";\n me = client_1.client.chars[client_1.client.charID];\n client_1.client.selectedEmote = -1;\n emotes = client_1.client.emotes;\n emotesList = document.getElementById(\"client_emo\");\n emotesList.style.display = \"\";\n emotesList.innerHTML = \"\"; // Clear emote box\n ini = me.inifile;\n me.side = ini.options.side;\n (0, updateActionCommands_1.updateActionCommands)(me.side);\n if (ini.emotions.number === 0) {\n emotesList.innerHTML = \"No emotes available\";\n }\n else {\n _loop_1 = function (i) {\n try {\n var emoteinfo = ini.emotions[i].split(\"#\");\n var esfx = void 0;\n var esfxd = void 0;\n try {\n esfx = ini.soundn[i] || \"0\";\n esfxd = Number(ini.soundt[i]) || 0;\n }\n catch (e) {\n console.warn(\"ini sound is completly missing\");\n esfx = \"0\";\n esfxd = 0;\n }\n // Make sure the asset server is case insensitive, or that everything on it is lowercase\n emotes[i] = {\n desc: emoteinfo[0].toLowerCase(),\n preanim: emoteinfo[1].toLowerCase(),\n emote: emoteinfo[2].toLowerCase(),\n zoom: Number(emoteinfo[3]) || 0,\n deskmod: Number(emoteinfo[4]) || 1,\n sfx: esfx.toLowerCase(),\n sfxdelay: esfxd,\n frame_screenshake: \"\",\n frame_realization: \"\",\n frame_sfx: \"\",\n button: \"\".concat(aoHost_1.AO_HOST, \"characters/\").concat(encodeURI(me.name.toLowerCase()), \"/emotions/button\").concat(i, \"_off.png\"),\n };\n var emote_item = new Image();\n emote_item.id = \"emo_\" + i;\n emote_item.className = \"emote_button\";\n emote_item.src = emotes[i].button;\n emote_item.alt = emotes[i].desc;\n emote_item.title = emotes[i].desc;\n emote_item.onclick = function () { window.pickEmotion(i); };\n emotesList.appendChild(emote_item);\n }\n catch (e) {\n console.error(\"missing emote \".concat(i));\n }\n };\n for (i = 1; i <= ini.emotions.number; i++) {\n _loop_1(i);\n }\n (0, pickEmotion_1.pickEmotion)(1);\n }\n return [4 /*yield*/, (0, fileExists_1.default)(\"\".concat(aoHost_1.AO_HOST, \"characters/\").concat(encodeURI(me.name.toLowerCase()), \"/custom.gif\"))];\n case 1:\n if (_a.sent()) {\n document.getElementById(\"button_4\").style.display = \"\";\n }\n else {\n document.getElementById(\"button_4\").style.display = \"none\";\n }\n return [2 /*return*/];\n }\n });\n}); };\nexports.handlePV = handlePV;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleRC = void 0;\nvar client_1 = require(\"../../client\");\nvar characters_js_1 = require(\"../../constants/characters.js\");\n/**\n * we are asking ourselves what characters there are\n * @param {Array} args packet arguments\n */\nvar handleRC = function (_args) {\n client_1.client.sender.sendSelf(\"SC#\".concat(characters_js_1.default.join(\"#\"), \"#%\"));\n};\nexports.handleRC = handleRC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleRD = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * we are asking ourselves what characters there are\n * @param {Array} args packet arguments\n */\nvar handleRD = function (_args) {\n client_1.client.sender.sendSelf(\"BN#gs4#%\");\n client_1.client.sender.sendSelf(\"DONE#%\");\n var ooclog = document.getElementById(\"client_ooclog\");\n ooclog.value = \"\";\n ooclog.readOnly = false;\n document.getElementById(\"client_oocinput\").style.display = \"none\";\n document.getElementById(\"client_replaycontrols\").style.display =\n \"inline-block\";\n};\nexports.handleRD = handleRD;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleRM = void 0;\nvar client_1 = require(\"../../client\");\nvar music_js_1 = require(\"../../constants/music.js\");\n/**\n * we are asking ourselves what characters there are\n * @param {Array} args packet arguments\n */\nvar handleRM = function (_args) {\n client_1.client.sender.sendSelf(\"SM#\".concat(music_js_1.default.join(\"#\"), \"#%\"));\n};\nexports.handleRM = handleRM;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleRMC = void 0;\nvar client_1 = require(\"../../client\");\n// TODO BUG:\n// this.viewport.music is an array. Therefore you must access elements\n/**\n * Handles a music change to an arbitrary resource, with an offset in seconds.\n * @param {Array} args packet arguments\n */\nvar handleRMC = function (args) {\n client_1.client.viewport.music.pause();\n var music = client_1.client.viewport.music;\n // Music offset + drift from song loading\n music.totime = args[1];\n music.offset = new Date().getTime() / 1000;\n music.addEventListener(\"loadedmetadata\", function () {\n music.currentTime += parseFloat(music.totime + (new Date().getTime() / 1000 - music.offset)).toFixed(3);\n music.play();\n }, false);\n};\nexports.handleRMC = handleRMC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleRT = void 0;\nvar client_1 = require(\"../../client\");\nvar initTestimonyUpdater_1 = require(\"../../viewport/utils/initTestimonyUpdater\");\n/**\n * Handles a testimony states.\n * @param {Array} args packet arguments\n */\nvar handleRT = function (args) {\n var judgeid = Number(args[2]);\n switch (args[1]) {\n case \"testimony1\":\n client_1.client.testimonyID = 1;\n break;\n case \"testimony2\":\n // Cross Examination\n client_1.client.testimonyID = 2;\n break;\n case \"judgeruling\":\n client_1.client.testimonyID = 3 + judgeid;\n break;\n default:\n console.warn(\"Invalid testimony\");\n }\n (0, initTestimonyUpdater_1.initTestimonyUpdater)();\n};\nexports.handleRT = handleRT;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleSC = void 0;\nvar queryParser_1 = require(\"../../utils/queryParser\");\nvar client_1 = require(\"../../client\");\nvar handleCharacterInfo_1 = require(\"../../client/handleCharacterInfo\");\nvar mode = (0, queryParser_1.default)().mode;\n/**\n * Handles incoming character information, containing all characters\n * in one packet.\n * @param {Array} args packet arguments\n */\nvar handleSC = function (args) { return __awaiter(void 0, void 0, void 0, function () {\n var _loop_1, i;\n return __generator(this, function (_a) {\n if (mode === \"watch\") {\n // Spectators don't need to pick a character\n document.getElementById(\"client_charselect\").style.display = \"none\";\n }\n else {\n document.getElementById(\"client_charselect\").style.display = \"block\";\n }\n document.getElementById(\"client_loadingtext\").innerHTML =\n \"Loading Characters\";\n _loop_1 = function (i) {\n var chargs = args[i].split(\"&\");\n var charid = i - 1;\n setTimeout(function () { return (0, handleCharacterInfo_1.handleCharacterInfo)(chargs, charid); }, charid * 6);\n };\n for (i = 1; i < args.length - 1; i++) {\n _loop_1(i);\n }\n // We're done with the characters, request the music\n client_1.client.sender.sendServer(\"RM#%\");\n return [2 /*return*/];\n });\n}); };\nexports.handleSC = handleSC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleSI = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Received when the server announces its server info,\n * but we use it as a cue to begin retrieving characters.\n * @param {Array} args packet arguments\n */\nvar handleSI = function (args) {\n client_1.client.char_list_length = Number(args[1]);\n client_1.client.char_list_length += 1; // some servers count starting from 0 some from 1...\n client_1.client.evidence_list_length = Number(args[2]);\n client_1.client.music_list_length = Number(args[3]);\n // create the charselect grid, to be filled by the character loader\n document.getElementById(\"client_chartable\").innerHTML = \"\";\n for (var i = 0; i < client_1.client.char_list_length; i++) {\n var demothing = document.createElement(\"img\");\n demothing.className = \"demothing\";\n demothing.id = \"demo_\".concat(i);\n var demoonclick = document.createAttribute(\"onclick\");\n demoonclick.value = \"pickChar(\".concat(i, \")\");\n demothing.setAttributeNode(demoonclick);\n document.getElementById(\"client_chartable\").appendChild(demothing);\n }\n // this is determined at the top of this file\n if (!client_1.oldLoading && client_1.extrafeatures.includes(\"fastloading\")) {\n client_1.client.sender.sendServer(\"RC#%\");\n }\n else {\n client_1.client.sender.sendServer(\"askchar2#%\");\n }\n};\nexports.handleSI = handleSI;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleSM = void 0;\nvar client_1 = require(\"../../client\");\nvar addTrack_1 = require(\"../../client/addTrack\");\nvar isAudio_1 = require(\"../../client/isAudio\");\nvar fixLastArea_1 = require(\"../../client/fixLastArea\");\nvar createArea_1 = require(\"../../client/createArea\");\n/**\n * Handles incoming music information, containing all music in one packet.\n * @param {Array} args packet arguments\n */\nvar handleSM = function (args) {\n document.getElementById(\"client_loadingtext\").innerHTML = \"Loading Music \";\n client_1.client.resetMusicList();\n client_1.client.resetAreaList();\n client_1.client.musics_time = false;\n document.getElementById(\"client_loadingtext\").innerHTML = \"Loading Music\";\n for (var i = 1; i < args.length - 1; i++) {\n // Check when found the song for the first time\n var trackname = args[i];\n var trackindex = i - 1;\n if (client_1.client.musics_time) {\n (0, addTrack_1.addTrack)(trackname);\n }\n else if ((0, isAudio_1.isAudio)(trackname)) {\n client_1.client.musics_time = true;\n (0, fixLastArea_1.fix_last_area)();\n (0, addTrack_1.addTrack)(trackname);\n }\n else {\n (0, createArea_1.createArea)(trackindex, trackname);\n }\n }\n // Music done, carry on\n client_1.client.sender.sendServer(\"RD#%\");\n};\nexports.handleSM = handleSM;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleSP = void 0;\nvar updateActionCommands_1 = require(\"../../dom/updateActionCommands\");\n/**\n* position change\n* @param {string} pos new position\n*/\nvar handleSP = function (args) {\n (0, updateActionCommands_1.updateActionCommands)(args[1]);\n};\nexports.handleSP = handleSP;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleTI = void 0;\n/**\n * Handles a timer update\n * @param {Array} args packet arguments\n */\nvar handleTI = function (args) {\n var timerid = Number(args[1]);\n var type = Number(args[2]);\n var timer_value = args[3];\n switch (type) {\n case 0:\n //\n case 1:\n document.getElementById(\"client_timer\".concat(timerid)).innerText =\n timer_value;\n case 2:\n document.getElementById(\"client_timer\".concat(timerid)).style.display = \"\";\n case 3:\n document.getElementById(\"client_timer\".concat(timerid)).style.display =\n \"none\";\n }\n};\nexports.handleTI = handleTI;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleZZ = void 0;\nvar client_1 = require(\"../../client\");\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Handles a modcall\n * @param {Array} args packet arguments\n */\nvar handleZZ = function (args) {\n var oocLog = document.getElementById(\"client_ooclog\");\n oocLog.innerHTML += \"$Alert: \".concat((0, encoding_1.prepChat)(args[1]), \"\\r\\n\");\n if (oocLog.scrollTop > oocLog.scrollHeight - 60) {\n oocLog.scrollTop = oocLog.scrollHeight;\n }\n client_1.client.viewport.getSfxAudio().pause();\n var oldvolume = client_1.client.viewport.getSfxAudio().volume;\n client_1.client.viewport.getSfxAudio().volume = 1;\n client_1.client.viewport.getSfxAudio().src = \"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-gallery.opus\");\n client_1.client.viewport.getSfxAudio().play();\n client_1.client.viewport.getSfxAudio().volume = oldvolume;\n};\nexports.handleZZ = handleZZ;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleackMS = void 0;\nvar resetICParams_1 = require(\"../../client/resetICParams\");\n/**\n* server got our message\n*/\nvar handleackMS = function () {\n (0, resetICParams_1.resetICParams)();\n};\nexports.handleackMS = handleackMS;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleaskchaa = void 0;\nvar client_1 = require(\"../../client\");\nvar characters_js_1 = require(\"../../constants/characters.js\");\n/**\n * What? you want a character list from me??\n * @param {Array} args packet arguments\n */\nvar handleaskchaa = function (_args) {\n client_1.client.sender.sendSelf(\"SI#\".concat(characters_js_1.default.length, \"#0#0#%\"));\n};\nexports.handleaskchaa = handleaskchaa;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.packetHandler = void 0;\nvar packets_1 = require(\"./packets\");\nexports.packetHandler = new Map(Object.entries(packets_1.packets));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.packets = void 0;\nvar handleMS_1 = require(\"./handlers/handleMS\");\nvar handleCT_1 = require(\"./handlers/handleCT\");\nvar handleMC_1 = require(\"./handlers/handleMC\");\nvar handleRMC_1 = require(\"./handlers/handleRMC\");\nvar twofactor_1 = require(\"../dom/twofactor\");\nvar handleFL_1 = require(\"./handlers/handleFL\");\nvar handleLE_1 = require(\"./handlers/handleLE\");\nvar handleEM_1 = require(\"./handlers/handleEM\");\nvar handleEI_1 = require(\"./handlers/handleEI\");\nvar handleSC_1 = require(\"./handlers/handleSC\");\nvar handleCI_1 = require(\"./handlers/handleCI\");\nvar handleFM_1 = require(\"./handlers/handleFM\");\nvar handleFA_1 = require(\"./handlers/handleFA\");\nvar handleSM_1 = require(\"./handlers/handleSM\");\nvar handleMM_1 = require(\"./handlers/handleMM\");\nvar handleBD_1 = require(\"./handlers/handleBD\");\nvar handleBB_1 = require(\"./handlers/handleBB\");\nvar handleKB_1 = require(\"./handlers/handleKB\");\nvar handleKK_1 = require(\"./handlers/handleKK\");\nvar handleDONE_1 = require(\"./handlers/handleDONE\");\nvar handleBN_1 = require(\"./handlers/handleBN\");\nvar handleHP_1 = require(\"./handlers/handleHP\");\nvar handleRT_1 = require(\"./handlers/handleRT\");\nvar handleTI_1 = require(\"./handlers/handleTI\");\nvar handleZZ_1 = require(\"./handlers/handleZZ\");\nvar handleHI_1 = require(\"./handlers/handleHI\");\nvar handleID_1 = require(\"./handlers/handleID\");\nvar handlePN_1 = require(\"./handlers/handlePN\");\nvar handleSI_1 = require(\"./handlers/handleSI\");\nvar handleARUP_1 = require(\"./handlers/handleARUP\");\nvar handleaskchaa_1 = require(\"./handlers/handleaskchaa\");\nvar handleCC_1 = require(\"./handlers/handleCC\");\nvar handleRC_1 = require(\"./handlers/handleRC\");\nvar handleRM_1 = require(\"./handlers/handleRM\");\nvar handleRD_1 = require(\"./handlers/handleRD\");\nvar handleCharsCheck_1 = require(\"./handlers/handleCharsCheck\");\nvar handlePV_1 = require(\"./handlers/handlePV\");\nvar handleASS_1 = require(\"./handlers/handleASS\");\nvar handleackMS_1 = require(\"./handlers/handleackMS\");\nvar handleSP_1 = require(\"./handlers/handleSP\");\nvar handleJD_1 = require(\"./handlers/handleJD\");\nexports.packets = {\n \"MS\": handleMS_1.handleMS,\n \"CT\": handleCT_1.handleCT,\n \"MC\": handleMC_1.handleMC,\n \"RMC\": handleRMC_1.handleRMC,\n \"CI\": handleCI_1.handleCI,\n \"SC\": handleSC_1.handleSC,\n \"EI\": handleEI_1.handleEI,\n \"2A\": twofactor_1.showFactorDialog,\n \"FL\": handleFL_1.handleFL,\n \"LE\": handleLE_1.handleLE,\n \"EM\": handleEM_1.handleEM,\n \"FM\": handleFM_1.handleFM,\n \"FA\": handleFA_1.handleFA,\n \"SM\": handleSM_1.handleSM,\n \"MM\": handleMM_1.handleMM,\n \"BD\": handleBD_1.handleBD,\n \"BB\": handleBB_1.handleBB,\n \"KB\": handleKB_1.handleKB,\n \"KK\": handleKK_1.handleKK,\n \"DONE\": handleDONE_1.handleDONE,\n \"BN\": handleBN_1.handleBN,\n \"HP\": handleHP_1.handleHP,\n \"RT\": handleRT_1.handleRT,\n \"TI\": handleTI_1.handleTI,\n \"ZZ\": handleZZ_1.handleZZ,\n \"HI\": handleHI_1.handleHI,\n \"ID\": handleID_1.handleID,\n \"PN\": handlePN_1.handlePN,\n \"SI\": handleSI_1.handleSI,\n \"ARUP\": handleARUP_1.handleARUP,\n \"askchaa\": handleaskchaa_1.handleaskchaa,\n \"CC\": handleCC_1.handleCC,\n \"RC\": handleRC_1.handleRC,\n \"RM\": handleRM_1.handleRM,\n \"RD\": handleRD_1.handleRD,\n \"CharsCheck\": handleCharsCheck_1.handleCharsCheck,\n \"PV\": handlePV_1.handlePV,\n \"ASS\": handleASS_1.handleASS,\n \"ackMS\": handleackMS_1.handleackMS,\n \"SP\": handleSP_1.handleSP,\n \"JD\": handleJD_1.handleJD,\n \"decryptor\": function () { },\n \"CHECK\": function () { },\n \"CH\": function () { },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar downloadFile = function (content, filename) {\n var a = document.createElement('a');\n var file = new Blob([content], { type: 'text' });\n a.href = URL.createObjectURL(file);\n a.download = filename;\n a.click();\n};\nexports.default = downloadFile;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar request_1 = require(\"../services/request\");\nvar aomlParser = function (text) {\n var e_1, _a;\n var parsed = {};\n var currentHeader = '';\n try {\n for (var _b = __values(text.split(/\\r?\\n/)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var line = _c.value;\n if (line === '') {\n currentHeader = '';\n continue;\n }\n var content = line.split(' = ');\n var contentName = content[0];\n var contentValue = content[1];\n if (currentHeader === '') {\n currentHeader = contentName;\n parsed[currentHeader] = {\n color: contentValue\n };\n }\n else {\n var contentKey = contentName.split('_')[1];\n parsed[currentHeader][contentKey] = contentValue;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return parsed;\n};\nvar mlConfig = function (AO_HOST) {\n var defaultUrl = \"\".concat(AO_HOST, \"themes/default/chat_config.ini\");\n var aomlParsed = (0, request_1.default)(defaultUrl).then(function (data) { return aomlParser(data); });\n var createIdentifiers = function () { return __awaiter(void 0, void 0, void 0, function () {\n var identifiers, _a, _b, _c, _d, _e, ruleName, value, e_2_1;\n var e_2, _f;\n return __generator(this, function (_g) {\n switch (_g.label) {\n case 0:\n identifiers = new Map();\n _g.label = 1;\n case 1:\n _g.trys.push([1, 6, 7, 8]);\n _d = (_c = Object).entries;\n return [4 /*yield*/, aomlParsed];\n case 2:\n _a = __values.apply(void 0, [_d.apply(_c, [_g.sent()])]), _b = _a.next();\n _g.label = 3;\n case 3:\n if (!!_b.done) return [3 /*break*/, 5];\n _e = __read(_b.value, 2), ruleName = _e[0], value = _e[1];\n if (value.start && value.end) {\n identifiers.set(value.start, value);\n identifiers.set(value.end, value);\n }\n _g.label = 4;\n case 4:\n _b = _a.next();\n return [3 /*break*/, 3];\n case 5: return [3 /*break*/, 8];\n case 6:\n e_2_1 = _g.sent();\n e_2 = { error: e_2_1 };\n return [3 /*break*/, 8];\n case 7:\n try {\n if (_b && !_b.done && (_f = _a.return)) _f.call(_a);\n }\n finally { if (e_2) throw e_2.error; }\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/, identifiers];\n }\n });\n }); };\n var createStartIdentifiers = function () { return __awaiter(void 0, void 0, void 0, function () {\n var startingIdentifiers, _a, _b, _c, _d, _e, ruleName, value, e_3_1;\n var e_3, _f;\n return __generator(this, function (_g) {\n switch (_g.label) {\n case 0:\n startingIdentifiers = new Set();\n _g.label = 1;\n case 1:\n _g.trys.push([1, 6, 7, 8]);\n _d = (_c = Object).entries;\n return [4 /*yield*/, aomlParsed];\n case 2:\n _a = __values.apply(void 0, [_d.apply(_c, [_g.sent()])]), _b = _a.next();\n _g.label = 3;\n case 3:\n if (!!_b.done) return [3 /*break*/, 5];\n _e = __read(_b.value, 2), ruleName = _e[0], value = _e[1];\n if ((value === null || value === void 0 ? void 0 : value.start) && (value === null || value === void 0 ? void 0 : value.end)) {\n startingIdentifiers.add(value.start);\n }\n _g.label = 4;\n case 4:\n _b = _a.next();\n return [3 /*break*/, 3];\n case 5: return [3 /*break*/, 8];\n case 6:\n e_3_1 = _g.sent();\n e_3 = { error: e_3_1 };\n return [3 /*break*/, 8];\n case 7:\n try {\n if (_b && !_b.done && (_f = _a.return)) _f.call(_a);\n }\n finally { if (e_3) throw e_3.error; }\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/, startingIdentifiers];\n }\n });\n }); };\n var applyMarkdown = function (text, defaultColor) { return __awaiter(void 0, void 0, void 0, function () {\n var identifiers, startIdentifiers, closingStack, colorStack, output, text_1, text_1_1, letter, currentSelector, currentIdentifier, currentClosingLetter, keepChar, r, g, b, currentColor, color, r, g, b, currentColor, r, g, b, currentColor;\n var e_4, _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, createIdentifiers()];\n case 1:\n identifiers = _b.sent();\n return [4 /*yield*/, createStartIdentifiers()];\n case 2:\n startIdentifiers = _b.sent();\n closingStack = [];\n colorStack = [];\n output = [];\n try {\n for (text_1 = __values(text), text_1_1 = text_1.next(); !text_1_1.done; text_1_1 = text_1.next()) {\n letter = text_1_1.value;\n currentSelector = document.createElement('span');\n currentIdentifier = identifiers.get(letter);\n currentClosingLetter = closingStack[closingStack.length - 1];\n keepChar = Number(currentIdentifier === null || currentIdentifier === void 0 ? void 0 : currentIdentifier.remove) === 0;\n if (currentClosingLetter === letter) {\n r = colorStack[colorStack.length - 1][0];\n g = colorStack[colorStack.length - 1][1];\n b = colorStack[colorStack.length - 1][2];\n currentColor = \"color: rgb(\".concat(r, \",\").concat(g, \",\").concat(b, \");\");\n currentSelector.setAttribute('style', currentColor);\n closingStack.pop();\n colorStack.pop();\n if (keepChar) {\n currentSelector.innerHTML = letter;\n }\n }\n else if (startIdentifiers.has(letter)) {\n color = identifiers.get(letter).color.split(',');\n r = color[0];\n g = color[1];\n b = color[2];\n colorStack.push([r, g, b]);\n closingStack.push(currentIdentifier.end);\n currentColor = \"color: rgb(\".concat(r, \",\").concat(g, \",\").concat(b, \");\");\n currentSelector.setAttribute('style', currentColor);\n if (keepChar) {\n currentSelector.innerHTML = letter;\n }\n }\n else {\n currentSelector.innerHTML = letter;\n if (colorStack.length === 0) {\n currentSelector.className = \"text_\".concat(defaultColor);\n }\n else {\n r = colorStack[colorStack.length - 1][0];\n g = colorStack[colorStack.length - 1][1];\n b = colorStack[colorStack.length - 1][2];\n currentColor = \"color: rgb(\".concat(r, \",\").concat(g, \",\").concat(b, \");\");\n currentSelector.setAttribute('style', currentColor);\n }\n }\n output.push(currentSelector);\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (text_1_1 && !text_1_1.done && (_a = text_1.return)) _a.call(text_1);\n }\n finally { if (e_4) throw e_4.error; }\n }\n return [2 /*return*/, output];\n }\n });\n }); };\n return {\n applyMarkdown: applyMarkdown\n };\n};\nexports.default = mlConfig;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * read a cookie from storage\n * got this from w3schools\n * https://www.w3schools.com/js/js_cookies.asp\n * @param {String} cname The name of the cookie to return\n */\nvar getCookie = function (cname) {\n try {\n var name_1 = \"\".concat(cname, \"=\");\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) === ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name_1) === 0) {\n return c.substring(name_1.length, c.length);\n }\n }\n return '';\n }\n catch (error) {\n return '';\n }\n};\nexports.default = getCookie;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getFilenameFromPath = void 0;\nvar getFilenameFromPath = function (path) { return path.substring(path.lastIndexOf('/') + 1); };\nexports.getFilenameFromPath = getFilenameFromPath;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryParser = function () {\n var queryDict = {};\n location.search\n .substr(1)\n .split(\"&\")\n .forEach(function (item) {\n queryDict[item.split(\"=\")[0]] = item.split(\"=\")[1];\n });\n return queryDict;\n};\nexports.default = queryParser;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * set a cookie\n * the version from w3schools expects these to expire\n * @param {String} cname The name of the cookie to return\n * @param {any} value The value of that cookie option\n */\nvar setCookie = function (cname, value) {\n document.cookie = \"\".concat(cname, \"=\").concat(value, \";SameSite=Strict\");\n};\nexports.default = setCookie;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar fileExists_1 = require(\"./fileExists\");\nvar transparentPng_1 = require(\"../constants/transparentPng\");\nvar urlExtensionsToTry = [\n '.png',\n '.gif',\n '.webp',\n '.apng'\n];\nvar tryUrls = function (url) { return __awaiter(void 0, void 0, void 0, function () {\n var i, extension, fullFileUrl, exists;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < urlExtensionsToTry.length)) return [3 /*break*/, 4];\n extension = urlExtensionsToTry[i];\n fullFileUrl = url + extension;\n return [4 /*yield*/, (0, fileExists_1.default)(fullFileUrl)];\n case 2:\n exists = _a.sent();\n if (exists) {\n return [2 /*return*/, fullFileUrl];\n }\n _a.label = 3;\n case 3:\n i++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/, transparentPng_1.default];\n }\n });\n}); };\nexports.default = tryUrls;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.COLORS = void 0;\nexports.COLORS = [\n \"white\",\n \"green\",\n \"red\",\n \"orange\",\n \"blue\",\n \"yellow\",\n \"pink\",\n \"cyan\",\n \"grey\",\n \"rainbow\",\n];\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultChatMsg = void 0;\nvar client_1 = require(\"../../client\");\nexports.defaultChatMsg = {\n content: \"\",\n objection: 0,\n sound: \"\",\n startpreanim: true,\n startspeaking: false,\n side: null,\n color: 0,\n snddelay: 0,\n preanimdelay: 0,\n speed: client_1.UPDATE_INTERVAL,\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.positions = void 0;\nexports.positions = {\n def: {\n bg: \"defenseempty\",\n desk: { ao2: \"defensedesk.png\", ao1: \"bancodefensa.png\" },\n speedLines: \"defense_speedlines.gif\",\n },\n pro: {\n bg: \"prosecutorempty\",\n desk: { ao2: \"prosecutiondesk.png\", ao1: \"bancoacusacion.png\" },\n speedLines: \"prosecution_speedlines.gif\",\n },\n hld: {\n bg: \"helperstand\",\n desk: {},\n speedLines: \"defense_speedlines.gif\",\n },\n hlp: {\n bg: \"prohelperstand\",\n desk: {},\n speedLines: \"prosecution_speedlines.gif\",\n },\n wit: {\n bg: \"witnessempty\",\n desk: { ao2: \"stand.png\", ao1: \"estrado.png\" },\n speedLines: \"prosecution_speedlines.gif\",\n },\n jud: {\n bg: \"judgestand\",\n desk: { ao2: \"judgedesk.png\", ao1: \"judgedesk.gif\" },\n speedLines: \"prosecution_speedlines.gif\",\n },\n jur: {\n bg: \"jurystand\",\n desk: { ao2: \"jurydesk.png\", ao1: \"estrado.png\" },\n speedLines: \"defense_speedlines.gif\",\n },\n sea: {\n bg: \"seancestand\",\n desk: { ao2: \"seancedesk.png\", ao1: \"estrado.png\" },\n speedLines: \"prosecution_speedlines.gif\",\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SHOUTS = void 0;\nexports.SHOUTS = [undefined, \"holdit\", \"objection\", \"takethat\", \"custom\"];\n","\"use strict\";\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createBlipsChannels = void 0;\nvar opusCheck_1 = require(\"../../dom/opusCheck\");\nvar createBlipsChannels = function () {\n var blipSelectors = document.getElementsByClassName(\"blipSound\");\n var blipChannels = __spreadArray([], __read(blipSelectors), false);\n // Allocate multiple blip audio channels to make blips less jittery\n blipChannels.forEach(function (channel) { return (channel.volume = 0.5); });\n blipChannels.forEach(function (channel) { return (channel.onerror = (0, opusCheck_1.opusCheck)(channel)); });\n return blipChannels;\n};\nexports.createBlipsChannels = createBlipsChannels;\n","\"use strict\";\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createMusic = void 0;\nvar opusCheck_1 = require(\"../../dom/opusCheck\");\nvar createMusic = function () {\n var audioChannels = document.getElementsByClassName(\"audioChannel\");\n var music = __spreadArray([], __read(audioChannels), false);\n music.forEach(function (channel) { return (channel.volume = 0.5); });\n music.forEach(function (channel) { return (channel.onerror = (0, opusCheck_1.opusCheck)(channel)); });\n return music;\n};\nexports.createMusic = createMusic;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createSfxAudio = void 0;\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar createSfxAudio = function () {\n var sfxAudio = document.getElementById(\"client_sfxaudio\");\n sfxAudio.src = \"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-realization.opus\");\n return sfxAudio;\n};\nexports.createSfxAudio = createSfxAudio;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createShoutAudio = void 0;\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar createShoutAudio = function () {\n var shoutAudio = document.getElementById(\"client_shoutaudio\");\n shoutAudio.src = \"\".concat(aoHost_1.AO_HOST, \"misc/default/objection.opus\");\n return shoutAudio;\n};\nexports.createShoutAudio = createShoutAudio;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createTestimonyAudio = void 0;\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar createTestimonyAudio = function () {\n var testimonyAudio = document.getElementById(\"client_testimonyaudio\");\n testimonyAudio.src = \"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-guilty.opus\");\n return testimonyAudio;\n};\nexports.createTestimonyAudio = createTestimonyAudio;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handle_ic_speaking = exports.setStartThirdTickCheck = exports.startThirdTickCheck = exports.setStartSecondTickCheck = exports.startSecondTickCheck = exports.setStartFirstTickCheck = exports.startFirstTickCheck = void 0;\nvar client_1 = require(\"../../client\");\nvar appendICLog_1 = require(\"../../client/appendICLog\");\nvar checkCallword_1 = require(\"../../client/checkCallword\");\nvar setEmote_1 = require(\"../../client/setEmote\");\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar shouts_1 = require(\"../constants/shouts\");\nvar getAnimLength_1 = require(\"../../utils/getAnimLength\");\nvar setChatbox_1 = require(\"../../dom/setChatbox\");\nvar resizeChatbox_1 = require(\"../../dom/resizeChatbox\");\nvar transparentPng_1 = require(\"../../constants/transparentPng\");\nvar colors_1 = require(\"../constants/colors\");\nvar aoml_1 = require(\"../../utils/aoml\");\nvar attorneyMarkdown = (0, aoml_1.default)(aoHost_1.AO_HOST);\nvar setStartFirstTickCheck = function (val) { exports.startFirstTickCheck = val; };\nexports.setStartFirstTickCheck = setStartFirstTickCheck;\nvar setStartSecondTickCheck = function (val) { exports.startSecondTickCheck = val; };\nexports.setStartSecondTickCheck = setStartSecondTickCheck;\nvar setStartThirdTickCheck = function (val) { exports.startThirdTickCheck = val; };\nexports.setStartThirdTickCheck = setStartThirdTickCheck;\n/**\n * Sets a new emote.\n * This sets up everything before the tick() loops starts\n * a lot of things can probably be moved here, like starting the shout animation if there is one\n * TODO: the preanim logic, on the other hand, should probably be moved to tick()\n * @param {object} chatmsg the new chat message\n */\nvar handle_ic_speaking = function (playerChatMsg) { return __awaiter(void 0, void 0, void 0, function () {\n var charLayers, pairLayers, fg, gamewindow, waitingBox, eviBox, validSides, chatContainerBox, nameBoxInner, chatBoxInner, displayname, shoutSprite, shout, gifLength, setAside, skipoffset, effectName, badEffects, intensity, i, drop, baseEffectUrl, soundChecks, _a, error_1, output, _b, _c, letter, currentSelector;\n var e_1, _d;\n return __generator(this, function (_e) {\n switch (_e.label) {\n case 0:\n client_1.client.viewport.setChatmsg(playerChatMsg);\n client_1.client.viewport.setTextNow(\"\");\n client_1.client.viewport.setSfxPlayed(0);\n client_1.client.viewport.setTickTimer(0);\n client_1.client.viewport.setAnimating(true);\n exports.startFirstTickCheck = true;\n exports.startSecondTickCheck = false;\n exports.startThirdTickCheck = false;\n charLayers = document.getElementById(\"client_char\");\n pairLayers = document.getElementById(\"client_pair_char\");\n // stop updater\n clearTimeout(client_1.client.viewport.updater);\n // stop last sfx from looping any longer\n client_1.client.viewport.getSfxAudio().loop = false;\n fg = document.getElementById(\"client_fg\");\n gamewindow = document.getElementById(\"client_gamewindow\");\n waitingBox = document.getElementById(\"client_chatwaiting\");\n // Reset CSS animation\n gamewindow.style.animation = \"\";\n waitingBox.style.opacity = \"0\";\n eviBox = document.getElementById(\"client_evi\");\n if (client_1.client.viewport.getLastEvidence() !== client_1.client.viewport.getChatmsg().evidence) {\n eviBox.style.opacity = \"0\";\n eviBox.style.height = \"0%\";\n }\n client_1.client.viewport.setLastEvidence(client_1.client.viewport.getChatmsg().evidence);\n validSides = [\"def\", \"pro\", \"wit\"];\n if (validSides.includes(client_1.client.viewport.getChatmsg().side)) {\n charLayers = document.getElementById(\"client_\".concat(client_1.client.viewport.getChatmsg().side, \"_char\"));\n pairLayers = document.getElementById(\"client_\".concat(client_1.client.viewport.getChatmsg().side, \"_pair_char\"));\n }\n chatContainerBox = document.getElementById(\"client_chatcontainer\");\n nameBoxInner = document.getElementById(\"client_inner_name\");\n chatBoxInner = document.getElementById(\"client_inner_chat\");\n displayname = document.getElementById(\"showname\").checked &&\n client_1.client.viewport.getChatmsg().showname !== \"\"\n ? client_1.client.viewport.getChatmsg().showname\n : client_1.client.viewport.getChatmsg().nameplate;\n // Clear out the last message\n chatBoxInner.innerText = client_1.client.viewport.getTextNow();\n nameBoxInner.innerText = displayname;\n if (client_1.client.viewport.getLastCharacter() !== client_1.client.viewport.getChatmsg().name) {\n charLayers.style.opacity = \"0\";\n pairLayers.style.opacity = \"0\";\n }\n client_1.client.viewport.setLastCharacter(client_1.client.viewport.getChatmsg().name);\n (0, appendICLog_1.appendICLog)(client_1.client.viewport.getChatmsg().content, client_1.client.viewport.getChatmsg().showname, client_1.client.viewport.getChatmsg().nameplate);\n (0, checkCallword_1.checkCallword)(client_1.client.viewport.getChatmsg().content, client_1.client.viewport.getSfxAudio());\n (0, setEmote_1.default)(aoHost_1.AO_HOST, client_1.client, client_1.client.viewport.getChatmsg().name.toLowerCase(), client_1.client.viewport.getChatmsg().sprite, \"(a)\", false, client_1.client.viewport.getChatmsg().side);\n if (client_1.client.viewport.getChatmsg().other_name) {\n (0, setEmote_1.default)(aoHost_1.AO_HOST, client_1.client, client_1.client.viewport.getChatmsg().other_name.toLowerCase(), client_1.client.viewport.getChatmsg().other_emote, \"(a)\", false, client_1.client.viewport.getChatmsg().side);\n }\n shoutSprite = (document.getElementById(\"client_shout\"));\n shout = shouts_1.SHOUTS[client_1.client.viewport.getChatmsg().objection];\n if (shout) {\n // Hide message box\n chatContainerBox.style.opacity = \"0\";\n if (client_1.client.viewport.getChatmsg().objection === 4) {\n shoutSprite.src = \"\".concat(aoHost_1.AO_HOST, \"characters/\").concat(encodeURI(client_1.client.viewport.getChatmsg().name.toLowerCase()), \"/custom.gif\");\n }\n else {\n shoutSprite.src = client_1.client.resources[shout].src;\n shoutSprite.style.animation = \"bubble 700ms steps(10, jump-both)\";\n }\n shoutSprite.style.opacity = \"1\";\n client_1.client.viewport.shoutaudio.src = \"\".concat(aoHost_1.AO_HOST, \"characters/\").concat(encodeURI(client_1.client.viewport.getChatmsg().name.toLowerCase()), \"/\").concat(shout, \".opus\");\n client_1.client.viewport.shoutaudio.play();\n client_1.client.viewport.setShoutTimer(client_1.client.resources[shout].duration);\n }\n else {\n client_1.client.viewport.setShoutTimer(0);\n }\n client_1.client.viewport.getChatmsg().startpreanim = true;\n gifLength = 0;\n if (!(client_1.client.viewport.getChatmsg().type === 1 && client_1.client.viewport.getChatmsg().preanim !== \"-\")) return [3 /*break*/, 2];\n //we have a preanim\n chatContainerBox.style.opacity = \"0\";\n return [4 /*yield*/, (0, getAnimLength_1.default)(\"\".concat(aoHost_1.AO_HOST, \"characters/\").concat(encodeURI(client_1.client.viewport.getChatmsg().name.toLowerCase()), \"/\").concat(encodeURI(client_1.client.viewport.getChatmsg().preanim)))];\n case 1:\n gifLength = _e.sent();\n client_1.client.viewport.getChatmsg().startspeaking = false;\n return [3 /*break*/, 3];\n case 2:\n client_1.client.viewport.getChatmsg().startspeaking = true;\n if (client_1.client.viewport.getChatmsg().content.trim() !== \"\")\n chatContainerBox.style.opacity = \"1\";\n _e.label = 3;\n case 3:\n client_1.client.viewport.getChatmsg().preanimdelay = gifLength;\n setAside = {\n position: client_1.client.viewport.getChatmsg().side,\n showSpeedLines: false,\n showDesk: false,\n };\n skipoffset = false;\n if (client_1.client.viewport.getChatmsg().type === 5) {\n setAside.showSpeedLines = true;\n setAside.showDesk = false;\n client_1.client.viewport.set_side(setAside);\n }\n else {\n switch (Number(client_1.client.viewport.getChatmsg().deskmod)) {\n case 0: //desk is hidden\n setAside.showSpeedLines = false;\n setAside.showDesk = false;\n client_1.client.viewport.set_side(setAside);\n break;\n case 1: //desk is shown\n setAside.showSpeedLines = false;\n setAside.showDesk = true;\n client_1.client.viewport.set_side(setAside);\n break;\n case 2: //desk is hidden during preanim, but shown during idle/talk\n setAside.showSpeedLines = false;\n setAside.showDesk = false;\n client_1.client.viewport.set_side(setAside);\n break;\n case 3: //opposite of 2\n setAside.showSpeedLines = false;\n setAside.showDesk = false;\n client_1.client.viewport.set_side(setAside);\n break;\n case 4: //desk is hidden, character offset is ignored, pair character is hidden during preanim, normal behavior during idle/talk\n setAside.showSpeedLines = false;\n setAside.showDesk = false;\n client_1.client.viewport.set_side(setAside);\n skipoffset = true;\n break;\n case 5: //opposite of 4\n setAside.showSpeedLines = false;\n setAside.showDesk = true;\n client_1.client.viewport.set_side(setAside);\n break;\n default:\n setAside.showSpeedLines = false;\n setAside.showDesk = true;\n client_1.client.viewport.set_side(setAside);\n break;\n }\n }\n (0, setChatbox_1.setChatbox)(client_1.client.viewport.getChatmsg().chatbox);\n (0, resizeChatbox_1.resizeChatbox)();\n if (!skipoffset) {\n // Flip the character\n charLayers.style.transform =\n client_1.client.viewport.getChatmsg().flip === 1 ? \"scaleX(-1)\" : \"scaleX(1)\";\n pairLayers.style.transform =\n client_1.client.viewport.getChatmsg().other_flip === 1 ? \"scaleX(-1)\" : \"scaleX(1)\";\n // Shift by the horizontal offset\n switch (client_1.client.viewport.getChatmsg().side) {\n case \"wit\":\n pairLayers.style.left = \"\".concat(200 + Number(client_1.client.viewport.getChatmsg().other_offset[0]), \"%\");\n charLayers.style.left = \"\".concat(200 + Number(client_1.client.viewport.getChatmsg().self_offset[0]), \"%\");\n break;\n case \"pro\":\n pairLayers.style.left = \"\".concat(400 + Number(client_1.client.viewport.getChatmsg().other_offset[0]), \"%\");\n charLayers.style.left = \"\".concat(400 + Number(client_1.client.viewport.getChatmsg().self_offset[0]), \"%\");\n break;\n default:\n pairLayers.style.left = \"\".concat(Number(client_1.client.viewport.getChatmsg().other_offset[0]), \"%\");\n charLayers.style.left = \"\".concat(Number(client_1.client.viewport.getChatmsg().self_offset[0]), \"%\");\n break;\n }\n // New vertical offsets\n pairLayers.style.top = \"\".concat(Number(client_1.client.viewport.getChatmsg().other_offset[1]), \"%\");\n charLayers.style.top = \"\".concat(Number(client_1.client.viewport.getChatmsg().self_offset[1]), \"%\");\n }\n client_1.client.viewport.blipChannels.forEach(function (channel) {\n return (channel.src = \"\".concat(aoHost_1.AO_HOST, \"sounds/blips/\").concat(encodeURI(client_1.client.viewport.getChatmsg().blips.toLowerCase()), \".opus\"));\n });\n // process markup\n if (client_1.client.viewport.getChatmsg().content.startsWith(\"~~\")) {\n chatBoxInner.style.textAlign = \"center\";\n client_1.client.viewport.getChatmsg().content = client_1.client.viewport.getChatmsg().content.substring(2, client_1.client.viewport.getChatmsg().content.length);\n }\n else {\n chatBoxInner.style.textAlign = \"inherit\";\n }\n // apply effects\n fg.style.animation = \"\";\n effectName = client_1.client.viewport.getChatmsg().effects[0].toLowerCase();\n badEffects = [\"\", \"-\", \"none\"];\n if (effectName.startsWith(\"rain\")) {\n document.getElementById(\"effect_css\").href = \"styles/effects/rain.css\";\n intensity = 200;\n if (effectName.endsWith(\"weak\")) {\n intensity = 100;\n }\n else if (effectName.endsWith(\"strong\")) {\n intensity = 400;\n }\n if (intensity < fg.childElementCount)\n fg.innerHTML = '';\n else\n intensity = intensity - fg.childElementCount;\n for (i = 0; i < intensity; i++) {\n drop = document.createElement(\"p\");\n drop.style.left = (Math.random() * 100) + \"%\";\n drop.style.animationDelay = String(Math.random()) + \"s\";\n fg.appendChild(drop);\n }\n }\n else if (client_1.client.viewport.getChatmsg().effects[0] &&\n !badEffects.includes(effectName)) {\n document.getElementById(\"effect_css\").href = \"\";\n fg.innerHTML = '';\n baseEffectUrl = \"\".concat(aoHost_1.AO_HOST, \"themes/default/effects/\");\n fg.src = \"\".concat(baseEffectUrl).concat(encodeURI(effectName), \".webp\");\n }\n else {\n fg.innerHTML = '';\n fg.src = transparentPng_1.default;\n }\n charLayers.style.opacity = \"1\";\n soundChecks = [\"0\", \"1\", \"\", undefined];\n if (soundChecks.some(function (check) { return client_1.client.viewport.getChatmsg().sound === check; })) {\n client_1.client.viewport.getChatmsg().sound = client_1.client.viewport.getChatmsg().effects[2];\n }\n _e.label = 4;\n case 4:\n _e.trys.push([4, 6, , 7]);\n _a = client_1.client.viewport.getChatmsg();\n return [4 /*yield*/, attorneyMarkdown.applyMarkdown(client_1.client.viewport.getChatmsg().content, colors_1.COLORS[client_1.client.viewport.getChatmsg().color])];\n case 5:\n _a.parsed = _e.sent();\n return [3 /*break*/, 7];\n case 6:\n error_1 = _e.sent();\n console.warn(\"markdown failed\");\n output = [];\n try {\n for (_b = __values(client_1.client.viewport.getChatmsg().content), _c = _b.next(); !_c.done; _c = _b.next()) {\n letter = _c.value;\n currentSelector = document.createElement('span');\n currentSelector.innerHTML = letter;\n currentSelector.className = \"text_\".concat(colors_1.COLORS[client_1.client.viewport.getChatmsg().color]);\n output.push(currentSelector);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_d = _b.return)) _d.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n client_1.client.viewport.getChatmsg().parsed = output;\n return [3 /*break*/, 7];\n case 7:\n client_1.client.viewport.chat_tick();\n return [2 /*return*/];\n }\n });\n}); };\nexports.handle_ic_speaking = handle_ic_speaking;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.initTestimonyUpdater = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Intialize testimony updater\n */\nvar initTestimonyUpdater = function () {\n var testimonyFilenames = {\n 1: \"witnesstestimony\",\n 2: \"crossexamination\",\n 3: \"notguilty\",\n 4: \"guilty\",\n };\n var testimony = testimonyFilenames[client_1.client.testimonyID];\n if (!testimony) {\n console.warn(\"Invalid testimony ID \".concat(client_1.client.testimonyID));\n return;\n }\n client_1.client.viewport.testimonyAudio.src = client_1.client.resources[testimony].sfx;\n client_1.client.viewport.testimonyAudio.play();\n var testimonyOverlay = (document.getElementById(\"client_testimony\"));\n testimonyOverlay.src = client_1.client.resources[testimony].src;\n testimonyOverlay.style.opacity = \"1\";\n client_1.client.viewport.setTestimonyTimer(0);\n client_1.client.viewport.setTestimonyUpdater(setTimeout(function () { return client_1.client.viewport.updateTestimony(); }, client_1.UPDATE_INTERVAL));\n};\nexports.initTestimonyUpdater = initTestimonyUpdater;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.set_side = void 0;\nvar positions_1 = require(\"../constants/positions\");\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar client_1 = require(\"../../client\");\nvar tryUrls_1 = require(\"../../utils/tryUrls\");\nvar fileExists_1 = require(\"../../utils/fileExists\");\n/**\n * Changes the viewport background based on a given position.\n *\n * Valid positions: `def, pro, hld, hlp, wit, jud, jur, sea`\n * @param {string} position the position to change into\n */\nvar set_side = function (_a) {\n var position = _a.position, showSpeedLines = _a.showSpeedLines, showDesk = _a.showDesk;\n return __awaiter(void 0, void 0, void 0, function () {\n var view, bench, court, bg, desk, speedLines, _b, deskFilename;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n view = document.getElementById(\"client_fullview\");\n if (['def', 'pro', 'wit'].includes(position)) {\n bench = (document.getElementById(\"client_\".concat(position, \"_bench\")));\n }\n else {\n bench = document.getElementById(\"client_bench_classic\");\n }\n if (\"def,pro,wit\".includes(position)) {\n court = (document.getElementById(\"client_court_\".concat(position)));\n }\n else {\n court = document.getElementById(\"client_court_classic\");\n }\n if (\"def,pro,hld,hlp,wit,jud,jur,sea\".includes(position)) {\n bg = positions_1.positions[position].bg;\n desk = positions_1.positions[position].desk;\n speedLines = positions_1.positions[position].speedLines;\n }\n else {\n bg = \"\".concat(position);\n desk = { ao2: \"\".concat(position, \"_overlay.png\"), ao1: \"_overlay.png\" };\n speedLines = \"defense_speedlines.gif\";\n }\n if (!(showSpeedLines === true)) return [3 /*break*/, 1];\n court.src = \"\".concat(aoHost_1.AO_HOST, \"themes/default/\").concat(encodeURI(speedLines));\n return [3 /*break*/, 3];\n case 1:\n _b = court;\n return [4 /*yield*/, (0, tryUrls_1.default)(client_1.client.viewport.getBackgroundFolder() + bg)];\n case 2:\n _b.src = _c.sent();\n _c.label = 3;\n case 3:\n if (!(showDesk === true && desk)) return [3 /*break*/, 5];\n return [4 /*yield*/, (0, fileExists_1.default)(client_1.client.viewport.getBackgroundFolder() + desk.ao2)];\n case 4:\n deskFilename = (_c.sent())\n ? desk.ao2\n : desk.ao1;\n bench.src = client_1.client.viewport.getBackgroundFolder() + deskFilename;\n bench.style.opacity = \"1\";\n return [3 /*break*/, 6];\n case 5:\n bench.style.opacity = \"0\";\n _c.label = 6;\n case 6:\n if (\"def,pro,wit\".includes(position)) {\n view.style.display = \"\";\n document.getElementById(\"client_classicview\").style.display = \"none\";\n switch (position) {\n case \"def\":\n view.style.left = \"0\";\n break;\n case \"wit\":\n view.style.left = \"-200%\";\n break;\n case \"pro\":\n view.style.left = \"-400%\";\n break;\n }\n }\n else {\n view.style.display = \"none\";\n document.getElementById(\"client_classicview\").style.display = \"\";\n }\n return [2 /*return*/];\n }\n });\n });\n};\nexports.set_side = set_side;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"../client\");\nvar client_2 = require(\"../client\");\nvar setEmote_1 = require(\"../client/setEmote\");\nvar encoding_1 = require(\"../encoding\");\nvar aoHost_1 = require(\"../client/aoHost\");\nvar createBlipChannels_1 = require(\"./utils/createBlipChannels\");\nvar defaultChatMsg_1 = require(\"./constants/defaultChatMsg\");\nvar createMusic_1 = require(\"./utils/createMusic\");\nvar createSfxAudio_1 = require(\"./utils/createSfxAudio\");\nvar createShoutAudio_1 = require(\"./utils/createShoutAudio\");\nvar createTestimonyAudio_1 = require(\"./utils/createTestimonyAudio\");\nvar colors_1 = require(\"./constants/colors\");\nvar setSide_1 = require(\"./utils/setSide\");\nvar handleICSpeaking_1 = require(\"./utils/handleICSpeaking\");\nvar viewport = function () {\n var animating = false;\n var blipChannels = (0, createBlipChannels_1.createBlipsChannels)();\n var chatmsg = defaultChatMsg_1.defaultChatMsg;\n var currentBlipChannel = 0;\n var lastChar = \"\";\n var lastEvi = 0;\n var music = (0, createMusic_1.createMusic)();\n var musicVolume = 0;\n var sfxAudio = (0, createSfxAudio_1.createSfxAudio)();\n var sfxplayed = 0;\n var shoutTimer = 0;\n var shoutaudio = (0, createShoutAudio_1.createShoutAudio)();\n var testimonyAudio = (0, createTestimonyAudio_1.createTestimonyAudio)();\n var testimonyTimer = 0;\n var testimonyUpdater;\n var textnow = \"\";\n var theme;\n var tickTimer = 0;\n var updater;\n var backgroundName = \"\";\n var getSfxAudio = function () { return sfxAudio; };\n var setSfxAudio = function (value) { sfxAudio = value; };\n var getBackgroundName = function () { return backgroundName; };\n var setBackgroundName = function (value) { backgroundName = value; };\n var getBackgroundFolder = function () {\n return \"\".concat(aoHost_1.AO_HOST, \"background/\").concat(encodeURI(backgroundName.toLowerCase()), \"/\");\n };\n var getTextNow = function () { return textnow; };\n var setTextNow = function (val) { textnow = val; };\n var getChatmsg = function () { return chatmsg; };\n var setChatmsg = function (val) { chatmsg = val; };\n var getSfxPlayed = function () { return sfxplayed; };\n var setSfxPlayed = function (val) { sfxplayed = val; };\n var getTickTimer = function () { return tickTimer; };\n var setTickTimer = function (val) { tickTimer = val; };\n var getAnimating = function () { return animating; };\n var setAnimating = function (val) { animating = val; };\n var getLastEvidence = function () { return lastEvi; };\n var setLastEvidence = function (val) { lastEvi = val; };\n var setLastCharacter = function (val) { lastChar = val; };\n var getLastCharacter = function () { return lastChar; };\n var getShoutTimer = function () { return shoutTimer; };\n var setShoutTimer = function (val) { shoutTimer = val; };\n var getTheme = function () { return theme; };\n var setTheme = function (val) { theme = val; };\n var getTestimonyTimer = function () { return testimonyTimer; };\n var setTestimonyTimer = function (val) { testimonyTimer = val; };\n var setTestimonyUpdater = function (val) { testimonyUpdater = val; };\n var getTestimonyUpdater = function () { return testimonyUpdater; };\n var playSFX = function (sfxname, looping) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n sfxAudio.pause();\n sfxAudio.loop = looping;\n sfxAudio.src = sfxname;\n sfxAudio.play();\n return [2 /*return*/];\n });\n }); };\n /**\n * Updates the testimony overaly\n */\n var updateTestimony = function () {\n var testimonyFilenames = {\n 1: \"witnesstestimony\",\n 2: \"crossexamination\",\n 3: \"notguilty\",\n 4: \"guilty\",\n };\n // Update timer\n testimonyTimer += client_2.UPDATE_INTERVAL;\n var testimony = testimonyFilenames[client_1.client.testimonyID];\n var resource = client_1.client.resources[testimony];\n if (!resource) {\n disposeTestimony();\n return;\n }\n if (testimonyTimer >= resource.duration) {\n disposeTestimony();\n }\n else {\n testimonyUpdater = setTimeout(function () { return updateTestimony(); }, client_2.UPDATE_INTERVAL);\n }\n };\n /**\n * Dispose the testimony overlay\n */\n var disposeTestimony = function () {\n client_1.client.testimonyID = 0;\n testimonyTimer = 0;\n document.getElementById(\"client_testimony\").style.opacity = \"0\";\n clearTimeout(testimonyUpdater);\n };\n var handleTextTick = function (charLayers) { return __awaiter(void 0, void 0, void 0, function () {\n var chatBox, waitingBox, chatBoxInner, charName, charEmote, characterElement, COMMAND_IDENTIFIER, nextCharacterElement, flash, shake, commands, textSpeeds, MAX_SLOW_CHATSPEED, i, currentCharacter;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n chatBox = document.getElementById(\"client_chat\");\n waitingBox = document.getElementById(\"client_chatwaiting\");\n chatBoxInner = document.getElementById(\"client_inner_chat\");\n charName = chatmsg.name.toLowerCase();\n charEmote = chatmsg.sprite.toLowerCase();\n if (chatmsg.content.charAt(textnow.length) !== \" \") {\n blipChannels[currentBlipChannel].play();\n currentBlipChannel++;\n currentBlipChannel %= blipChannels.length;\n }\n textnow = chatmsg.content.substring(0, textnow.length + 1);\n characterElement = chatmsg.parsed[textnow.length - 1];\n if (!characterElement) return [3 /*break*/, 3];\n COMMAND_IDENTIFIER = \"\\\\\";\n nextCharacterElement = chatmsg.parsed[textnow.length];\n flash = function () { return __awaiter(void 0, void 0, void 0, function () {\n var effectlayer;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n effectlayer = document.getElementById(\"client_fg\");\n playSFX(\"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-realization.opus\"), false);\n effectlayer.style.animation = \"flash 0.4s 1\";\n return [4 /*yield*/, (0, client_1.delay)(400)];\n case 1:\n _a.sent();\n effectlayer.style.removeProperty(\"animation\");\n return [2 /*return*/];\n }\n });\n }); };\n shake = function () { return __awaiter(void 0, void 0, void 0, function () {\n var gamewindow;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n gamewindow = document.getElementById(\"client_gamewindow\");\n playSFX(\"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-stab.opus\"), false);\n gamewindow.style.animation = \"shake 0.2s 1\";\n return [4 /*yield*/, (0, client_1.delay)(200)];\n case 1:\n _a.sent();\n gamewindow.style.removeProperty(\"animation\");\n return [2 /*return*/];\n }\n });\n }); };\n commands = new Map(Object.entries({\n s: shake,\n f: flash,\n }));\n textSpeeds = new Set([\"{\", \"}\"]);\n // Changing Text Speed\n if (textSpeeds.has(characterElement.innerHTML)) {\n MAX_SLOW_CHATSPEED = 120;\n for (i = textnow.length; i < chatmsg.content.length; i++) {\n currentCharacter = chatmsg.parsed[i - 1].innerHTML;\n if (currentCharacter === \"}\") {\n if (chatmsg.speed > 0) {\n chatmsg.speed -= 20;\n }\n }\n else if (currentCharacter === \"{\") {\n if (chatmsg.speed < MAX_SLOW_CHATSPEED) {\n chatmsg.speed += 20;\n }\n }\n else {\n // No longer at a speed character\n textnow = chatmsg.content.substring(0, i);\n break;\n }\n }\n }\n if (!(characterElement.innerHTML === COMMAND_IDENTIFIER &&\n commands.has(nextCharacterElement === null || nextCharacterElement === void 0 ? void 0 : nextCharacterElement.innerHTML))) return [3 /*break*/, 2];\n textnow = chatmsg.content.substring(0, textnow.length + 1);\n return [4 /*yield*/, commands.get(nextCharacterElement.innerHTML)()];\n case 1:\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n chatBoxInner.appendChild(chatmsg.parsed[textnow.length - 1]);\n _a.label = 3;\n case 3:\n // scroll to bottom\n chatBox.scrollTop = chatBox.scrollHeight;\n if (textnow === chatmsg.content) {\n animating = false;\n (0, setEmote_1.default)(aoHost_1.AO_HOST, client_1.client, charName, charEmote, \"(a)\", false, chatmsg.side);\n charLayers.style.opacity = \"1\";\n waitingBox.style.opacity = \"1\";\n clearTimeout(updater);\n }\n return [2 /*return*/];\n }\n });\n }); };\n /**\n * Updates the chatbox based on the given text.\n *\n * OK, here's the documentation on how this works:\n *\n * 1 _animating\n * If we're not done with this characters animation, i.e. his text isn't fully there, set a timeout for the next tick/step to happen\n *\n * 2 startpreanim\n * If the shout timer is over it starts with the preanim\n * The first thing it checks for is the shake effect (TODO on client this is handled by the @ symbol and not a flag )\n * Then is the flash/realization effect\n * After that, the shout image set to be transparent\n * and the main characters preanim gif is loaded\n * If pairing is supported the paired character will just stand around with his idle sprite\n *\n * 3 preanimdelay over\n * this animates the evidence popup and finally shows the character name and message box\n * it sets the text color and the character speaking sprite\n *\n * 4 textnow != content\n * this adds a character to the textbox and stops the animations if the entire message is present in the textbox\n *\n * 5 sfx\n * independent of the stuff above, this will play any sound effects specified by the emote the character sent.\n * happens after the shout delay + an sfx delay that comes with the message packet\n *\n * XXX: This relies on a global variable `chatmsg`!\n */\n var chat_tick = function () { return __awaiter(void 0, void 0, void 0, function () {\n var gamewindow, waitingBox, eviBox, shoutSprite, effectlayer, chatBoxInner, charLayers, pairLayers, validSides, charName, charEmote, pairName, pairEmote, isShoutOver, isShoutAndPreanimOver, preanim, hasNonInterruptingPreAnim, chatContainerBox, chatContainerBox;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: \n // note: this is called fairly often\n // do not perform heavy operations here\n return [4 /*yield*/, (0, client_1.delay)(chatmsg.speed)];\n case 1:\n // note: this is called fairly often\n // do not perform heavy operations here\n _a.sent();\n if (textnow === chatmsg.content) {\n return [2 /*return*/];\n }\n gamewindow = document.getElementById(\"client_gamewindow\");\n waitingBox = document.getElementById(\"client_chatwaiting\");\n eviBox = document.getElementById(\"client_evi\");\n shoutSprite = (document.getElementById(\"client_shout\"));\n effectlayer = document.getElementById(\"client_fg\");\n chatBoxInner = document.getElementById(\"client_inner_chat\");\n charLayers = document.getElementById(\"client_char\");\n pairLayers = (document.getElementById(\"client_pair_char\"));\n validSides = [\"def\", \"pro\", \"wit\"];\n if (validSides.includes(chatmsg.side)) {\n charLayers = (document.getElementById(\"client_\".concat(chatmsg.side, \"_char\")));\n pairLayers = (document.getElementById(\"client_\".concat(chatmsg.side, \"_pair_char\")));\n }\n charName = chatmsg.name.toLowerCase();\n charEmote = chatmsg.sprite.toLowerCase();\n pairName = chatmsg.other_name.toLowerCase();\n pairEmote = chatmsg.other_emote.toLowerCase();\n isShoutOver = tickTimer >= shoutTimer;\n isShoutAndPreanimOver = tickTimer >= shoutTimer + chatmsg.preanimdelay;\n if (isShoutOver && handleICSpeaking_1.startFirstTickCheck) {\n // Effect stuff\n if (chatmsg.screenshake === 1) {\n // Shake screen\n playSFX(\"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-stab.opus\"), false);\n gamewindow.style.animation = \"shake 0.2s 1\";\n }\n if (chatmsg.flash === 1) {\n // Flash screen\n playSFX(\"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-realization.opus\"), false);\n effectlayer.style.animation = \"flash 0.4s 1\";\n }\n // Pre-animation stuff\n if (chatmsg.preanimdelay > 0) {\n shoutSprite.style.opacity = \"0\";\n shoutSprite.style.animation = \"\";\n preanim = chatmsg.preanim.toLowerCase();\n (0, setEmote_1.default)(aoHost_1.AO_HOST, client_1.client, charName, preanim, \"\", false, chatmsg.side);\n }\n if (chatmsg.other_name) {\n pairLayers.style.opacity = \"1\";\n }\n else {\n pairLayers.style.opacity = \"0\";\n }\n // Done with first check, move to second\n (0, handleICSpeaking_1.setStartFirstTickCheck)(false);\n (0, handleICSpeaking_1.setStartSecondTickCheck)(true);\n chatmsg.startpreanim = false;\n chatmsg.startspeaking = true;\n }\n hasNonInterruptingPreAnim = chatmsg.noninterrupting_preanim === 1;\n if (!(textnow !== chatmsg.content && hasNonInterruptingPreAnim)) return [3 /*break*/, 3];\n chatContainerBox = document.getElementById(\"client_chatcontainer\");\n chatContainerBox.style.opacity = \"1\";\n return [4 /*yield*/, handleTextTick(charLayers)];\n case 2:\n _a.sent();\n return [3 /*break*/, 6];\n case 3:\n if (!(isShoutAndPreanimOver && handleICSpeaking_1.startSecondTickCheck)) return [3 /*break*/, 6];\n if (!chatmsg.startspeaking) return [3 /*break*/, 4];\n chatmsg.startspeaking = false;\n // Evidence Bullshit\n if (chatmsg.evidence > 0) {\n // Prepare evidence\n eviBox.src = (0, encoding_1.safeTags)(client_1.client.evidences[chatmsg.evidence - 1].icon);\n eviBox.style.width = \"auto\";\n eviBox.style.height = \"36.5%\";\n eviBox.style.opacity = \"1\";\n testimonyAudio.src = \"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-evidenceshoop.opus\");\n testimonyAudio.play();\n if (chatmsg.side === \"def\") {\n // Only def show evidence on right\n eviBox.style.right = \"1em\";\n eviBox.style.left = \"initial\";\n }\n else {\n eviBox.style.right = \"initial\";\n eviBox.style.left = \"1em\";\n }\n }\n chatBoxInner.className = \"text_\".concat(colors_1.COLORS[chatmsg.color]);\n if (chatmsg.preanimdelay === 0) {\n shoutSprite.style.opacity = \"0\";\n shoutSprite.style.animation = \"\";\n }\n switch (Number(chatmsg.deskmod)) {\n case 2:\n (0, setSide_1.set_side)({\n position: chatmsg.side,\n showSpeedLines: false,\n showDesk: true,\n });\n break;\n case 3:\n (0, setSide_1.set_side)({\n position: chatmsg.side,\n showSpeedLines: false,\n showDesk: false,\n });\n break;\n case 4:\n (0, setSide_1.set_side)({\n position: chatmsg.side,\n showSpeedLines: false,\n showDesk: true,\n });\n break;\n case 5:\n (0, setSide_1.set_side)({\n position: chatmsg.side,\n showSpeedLines: false,\n showDesk: false,\n });\n break;\n }\n if (chatmsg.other_name) {\n (0, setEmote_1.default)(aoHost_1.AO_HOST, client_1.client, pairName, pairEmote, \"(a)\", true, chatmsg.side);\n pairLayers.style.opacity = \"1\";\n }\n else {\n pairLayers.style.opacity = \"0\";\n }\n (0, setEmote_1.default)(aoHost_1.AO_HOST, client_1.client, charName, charEmote, \"(b)\", false, chatmsg.side);\n charLayers.style.opacity = \"1\";\n if (textnow === chatmsg.content) {\n (0, setEmote_1.default)(aoHost_1.AO_HOST, client_1.client, charName, charEmote, \"(a)\", false, chatmsg.side);\n charLayers.style.opacity = \"1\";\n waitingBox.style.opacity = \"1\";\n animating = false;\n clearTimeout(updater);\n return [2 /*return*/];\n }\n return [3 /*break*/, 6];\n case 4:\n if (!(textnow !== chatmsg.content)) return [3 /*break*/, 6];\n chatContainerBox = document.getElementById(\"client_chatcontainer\");\n chatContainerBox.style.opacity = \"1\";\n return [4 /*yield*/, handleTextTick(charLayers)];\n case 5:\n _a.sent();\n _a.label = 6;\n case 6:\n if (!sfxplayed && chatmsg.snddelay + shoutTimer >= tickTimer) {\n sfxplayed = 1;\n if (chatmsg.sound !== \"0\" &&\n chatmsg.sound !== \"1\" &&\n chatmsg.sound !== \"\" &&\n chatmsg.sound !== undefined &&\n (chatmsg.type == 1 || chatmsg.type == 2 || chatmsg.type == 6)) {\n playSFX(\"\".concat(aoHost_1.AO_HOST, \"sounds/general/\").concat(encodeURI(chatmsg.sound.toLowerCase()), \".opus\"), chatmsg.looping_sfx);\n }\n }\n if (animating) {\n chat_tick();\n }\n tickTimer += client_2.UPDATE_INTERVAL;\n return [2 /*return*/];\n }\n });\n }); };\n return {\n getTextNow: getTextNow,\n setTextNow: setTextNow,\n getChatmsg: getChatmsg,\n setChatmsg: setChatmsg,\n getSfxPlayed: getSfxPlayed,\n setSfxPlayed: setSfxPlayed,\n setTickTimer: setTickTimer,\n getTickTimer: getTickTimer,\n setAnimating: setAnimating,\n getAnimating: getAnimating,\n getLastEvidence: getLastEvidence,\n setLastEvidence: setLastEvidence,\n setLastCharacter: setLastCharacter,\n getLastCharacter: getLastCharacter,\n getShoutTimer: getShoutTimer,\n setShoutTimer: setShoutTimer,\n setTheme: setTheme,\n getTheme: getTheme,\n setTestimonyTimer: setTestimonyTimer,\n getTestimonyTimer: getTestimonyTimer,\n setTestimonyUpdater: setTestimonyUpdater,\n getTestimonyUpdater: getTestimonyUpdater,\n testimonyAudio: testimonyAudio,\n chat_tick: chat_tick,\n playSFX: playSFX,\n set_side: setSide_1.set_side,\n setBackgroundName: setBackgroundName,\n updateTestimony: updateTestimony,\n disposeTestimony: disposeTestimony,\n handleTextTick: handleTextTick,\n getBackgroundFolder: getBackgroundFolder,\n getBackgroundName: getBackgroundName,\n getSfxAudio: getSfxAudio,\n setSfxAudio: setSfxAudio,\n blipChannels: blipChannels,\n music: music,\n musicVolume: musicVolume,\n shoutaudio: shoutaudio,\n updater: updater,\n };\n};\nexports.default = viewport;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t47: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkwebao\"] = self[\"webpackChunkwebao\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(6459);\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","changeSFXVolume","setCookie","document","getElementById","volume","changeTestimonyVolume","changeShoutVolume","window","regexPatterns","section","param","comment","lineFilter","value","isEmpty","length","test","data","currentSection","parsedIni","split","filter","forEach","line","isParameter","isSection","match","matchKey","toLowerCase","matchValue","valueHandler","_regeneratorRuntime","e","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","v","values","g","defineIteratorMethods","_invoke","AsyncIterator","invoke","_typeof","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","asyncGeneratorStep","gen","reject","_next","_throw","key","info","error","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","requestBuffer","_x","_requestBuffer","_callee2","url","_context2","xhr","XMLHttpRequest","responseType","addEventListener","concat","statusText","code","status","response","open","send","request","_ref","_callee","_context","_x2","fileExists","onload","readyState","onerror","gifFile","Uint8Array","duration","delay","webpFile","apngFile","delayNum","Number","delayDen","getAnimLength","_i","_extensions","extension","urlWithExtension","fileBuffer","calculatorHandler","AO_HOST","THEME","holdit","src","objection","takethat","custom","witnesstestimony","sfx","crossexamination","guilty","notguilty","__assign","assign","this","__awaiter","thisArg","_arguments","P","generator","fulfilled","step","rejected","result","__generator","body","_","label","trys","ops","verb","op","__spreadArray","to","from","pack","ar","Array","SuppressedError","version","wait","durationMs","resolveWith","setTimeout","isPromise","awaitIfAsync","action","callback","returnedValue","mapWithBreaks","items","loopReleaseInterval","results","lastLoopReleaseTime","now","_a","Date","suppressUnhandledRejectionWarning","promise","x64Add","m","x64Multiply","x64Rotl","x64LeftShift","x64Xor","x64Fmix","x64hash128","seed","remainder","bytes","h1","h2","k1","k2","c1","c2","charCodeAt","toString","toInt","parseInt","toFloat","parseFloat","replaceNaN","replacement","countTruthy","reduce","sum","round","base","Math","abs","counterBase","ensureErrorWithMessage","message","isFinalResultLoaded","loadResult","loadSources","sources","sourceOptions","excludeSources","includedSources","sourceKey","haystack","needle","includes","sourceGettersPromise","source","sourceLoadPromise","resolveLoad","loadStartTime","bind","loadArgs","loadDuration","resolveGet","getStartTime","getArgs","finalizeSource","loadSource","componentPromises","componentArray","components","index","sourceGetter","componentPromise","all","transformSource","transformValue","transformLoadResult","getResult","options","isTrident","w","navigator","isEdgeHTML","isChromium","vendor","indexOf","isWebKit","isDesktopSafari","isGecko","_b","documentElement","style","getFullscreenElement","fullscreenElement","msFullscreenElement","mozFullScreenElement","webkitFullscreenElement","isAndroid","isItChromium","isItGecko","appVersion","makeInnerError","withIframe","initialHtml","domPollInterval","_c","iframe","_d","createElement","_resolve","_reject","isComplete","setProperty","position","top","left","visibility","srcdoc","appendChild","checkReadyState","contentWindow","parentNode","removeChild","selectorToElement","selector","errorMessage","tagMatch","exec","tag","attributes","partsRegex","addAttribute","part","attributeMatch","parseSimpleCssSelector","element","name_1","join","addStyleString","setAttribute","property","name_2","priority","baseFonts","fontList","canvasToString","canvas","toDataURL","screenFrameBackup","screenFrameSizeTimeoutId","screenFrameCheckInterval","getScreenFrame","_this","checkScreenFrame","frameSize","getCurrentScreenFrame","isFrameSizeNull","watchScreenFrame","exitFullscreen","msExitFullscreen","mozCancelFullScreen","webkitExitFullscreen","screen","availTop","width","availWidth","availLeft","height","availHeight","getBlockedSelectors","selectors","root","elements","blockedSelectors","holder","forceShow","tagName","show","offsetParent","doesMatch$4","matchMedia","matches","doesMatch$3","doesMatch$2","doesMatch$1","doesMatch","M","fallbackFn","presets","default","apple","font","serif","fontFamily","sans","mono","min","fontSize","system","fonts","spansContainer","defaultWidth","defaultHeight","createSpan","span","textContent","baseFontsSpans","map","fontsSpans","spans","_loop_1","baseFont","fontToDetect","createSpanWithFonts","fontList_1","initializeFontsSpans","offsetWidth","offsetHeight","fontSpans","some","baseFontIndex","domBlockers","debug","filters","filterNames","activeBlockers","fromB64","atob","abpIndo","abpvn","adBlockFinland","adBlockPersian","adBlockWarningRemoval","adGuardAnnoyances","adGuardBase","adGuardChinese","adGuardFrench","adGuardGerman","adGuardJapanese","adGuardMobile","adGuardRussian","adGuardSocial","adGuardSpanishPortuguese","adGuardTrackingProtection","adGuardTurkish","bulgarian","easyList","easyListChina","easyListCookie","easyListCzechSlovak","easyListDutch","easyListGermany","easyListItaly","easyListLithuania","estonian","fanboyAnnoyances","fanboyAntiFacebook","fanboyEnhancedTrackers","fanboySocial","frellwitSwedish","greekAdBlock","hungarian","iDontCareAboutCookies","icelandicAbp","latvian","listKr","listeAr","listeFr","officialPolish","ro","ruAd","thaiAds","webAnnoyancesUltralist","filterName","console","log","printDebug","sort","fontPreferences","containerWidthPx","iframeWindow","iframeDocument","iframeBody","bodyStyle","webkitTextSizeAdjust","textSizeAdjust","zoom","devicePixelRatio","linesOfText","container","sizes","text","whiteSpace","_e","_f","_g","_h","getBoundingClientRect","audio","AudioContext","OfflineAudioContext","webkitOfflineAudioContext","isWebKit606OrNewer","context","oscillator","createOscillator","frequency","compressor","createDynamicsCompressor","threshold","knee","ratio","attack","release","connect","destination","start","finalize","isFinalized","renderTryCount","startedRunningAt","oncomplete","event","renderedBuffer","startRunningTimeout","tryRender","renderingPromise","startRendering","state","hidden","startRenderingAudio","renderPromise","finishRendering","fingerprintPromise","buffer","signal","hash","getHash","getChannelData","subarray","screenFrame","screenFrameGetter","processSize","sideSize","osCpu","oscpu","languages","language","userLanguage","browserLanguage","systemLanguage","isArray","Intl","Reflect","colorDepth","deviceMemory","screenResolution","parseDimension","dimensions","hardwareConcurrency","timezone","DateTimeFormat","resolvedOptions","timeZone","currentYear","offset","getFullYear","max","getTimezoneOffset","sessionStorage","localStorage","indexedDB","openDatabase","cpuClass","platform","screenRatio","Element","webkitRequestFullscreen","isIPad","plugins","rawPlugins","plugin","mimeTypes","j","mimeType","suffixes","description","geometry","winding","getContext","makeCanvasContext","isSupported","rect","isPointInPath","doesSupportWinding","textBaseline","fillStyle","fillRect","printedText","String","fromCharCode","fillText","renderTextImage","textImage1","globalCompositeOperation","color","x","beginPath","arc","PI","closePath","fill","renderGeometryImage","touchSupport","touchEvent","maxTouchPoints","msMaxTouchPoints","createEvent","touchStart","vendorFlavors","flavors","cookiesEnabled","cookie","colorGamut","gamut","invertedColors","forcedColors","monochrome","contrast","reducedMotion","hdr","math","acos","acosh","asin","asinh","atanh","atan","sin","sinh","cos","cosh","tan","tanh","exp","expm1","log1p","acoshPf","sqrt","asinhPf","atanhPf","sinhPf","coshPf","tanhPf","expm1Pf","log1pPf","powPI","pow","videoCard","gl","debugInfo","getExtension","getParameter","UNMASKED_VENDOR_WEBGL","renderer","UNMASKED_RENDERER_WEBGL","pdfViewerEnabled","architecture","Float32Array","u8","Infinity","commentTemplate","getConfidence","openConfidenceScore","getOpenConfidenceScore","proConfidenceScore","deriveProConfidenceScore","score","replace","componentsToDebugString","JSON","stringify","_key","stack","hashComponents","componentKey","component","componentsToCanonicalString","prepareForSources","delayFallback","fallbackTimeout","deadlineTimeout","requestIdleCallback","timeout","requestIdleCallbackIfAvailable","makeAgent","getComponents","creationTime","get","startTime","visitorIdCache","visitorId","confidence","makeLazyGetResult","userAgent","load","monitoring","__fpjs_d_m","random","monitor","murmurX64Hash128","isCallable","tryToString","$TypeError","module","exports","argument","isConstructor","$String","wellKnownSymbol","UNSCOPABLES","ArrayPrototype","S","unicode","isPrototypeOf","it","Prototype","isObject","ArrayBuffer","DataView","NAME","Constructor","NATIVE_ARRAY_BUFFER","DESCRIPTORS","global","hasOwn","classof","createNonEnumerableProperty","defineBuiltIn","defineBuiltInAccessor","uid","InternalStateModule","enforceInternalState","enforce","getInternalState","Int8Array","Int8ArrayPrototype","Uint8ClampedArray","Uint8ClampedArrayPrototype","TypedArray","TypedArrayPrototype","ObjectPrototype","TO_STRING_TAG","TYPED_ARRAY_TAG","TYPED_ARRAY_CONSTRUCTOR","NATIVE_ARRAY_BUFFER_VIEWS","opera","TYPED_ARRAY_TAG_REQUIRED","TypedArrayConstructorsList","Int16Array","Uint16Array","Int32Array","Uint32Array","Float64Array","BigIntArrayConstructorsList","BigInt64Array","BigUint64Array","getTypedArrayConstructor","proto","isTypedArray","klass","Function","aTypedArray","aTypedArrayConstructor","C","exportTypedArrayMethod","KEY","forced","ARRAY","TypedArrayConstructor","error2","exportTypedArrayStaticMethod","isView","uncurryThis","FunctionName","defineBuiltIns","fails","anInstance","toIntegerOrInfinity","toLength","toIndex","IEEE754","getOwnPropertyNames","arrayFill","arraySlice","setToStringTag","PROPER_FUNCTION_NAME","PROPER","CONFIGURABLE_FUNCTION_NAME","CONFIGURABLE","ARRAY_BUFFER","DATA_VIEW","PROTOTYPE","WRONG_INDEX","getInternalArrayBufferState","getterFor","getInternalDataViewState","setInternalState","set","NativeArrayBuffer","$ArrayBuffer","ArrayBufferPrototype","$DataView","DataViewPrototype","RangeError","packIEEE754","unpackIEEE754","unpack","packInt8","number","packInt16","packInt32","unpackInt32","packFloat32","packFloat64","addGetter","view","count","isLittleEndian","store","intIndex","boolIsLittleEndian","byteLength","byteOffset","conversion","INCORRECT_ARRAY_BUFFER_NAME","NaN","testView","$setInt8","setInt8","getInt8","setUint8","unsafe","detached","bufferState","bufferLength","getUint8","getInt16","getUint16","getInt32","getUint32","getFloat32","getFloat64","setInt16","setUint16","setInt32","setUint32","setFloat32","setFloat64","toObject","toAbsoluteIndex","lengthOfArrayLike","deletePropertyOrThrow","copyWithin","target","O","len","end","inc","argumentsLength","endPos","$forEach","STRICT_METHOD","arrayMethodIsStrict","callbackfn","list","toIndexedObject","createMethod","IS_INCLUDES","$this","el","fromIndex","IndexedObject","arraySpeciesCreate","TYPE","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","IS_FILTER_REJECT","NO_HOLES","that","specificCreate","boundFunction","every","find","findIndex","filterReject","$lastIndexOf","lastIndexOf","NEGATIVE_ZERO","FORCED","searchElement","V8_VERSION","SPECIES","METHOD_NAME","array","foo","Boolean","aCallable","IS_RIGHT","memo","right","createProperty","$Array","k","fin","floor","mergeSort","comparefn","middle","insertionSort","merge","llength","rlength","lindex","rindex","originalArray","arraySpeciesConstructor","ITERATOR","SAFE_CLOSING","called","iteratorWithReturn","SKIP_CLOSING","ITERATION_SUPPORT","object","stringSlice","TO_STRING_TAG_SUPPORT","classofRaw","$Object","CORRECT_ARGUMENTS","tryGet","callee","ownKeys","getOwnPropertyDescriptorModule","definePropertyModule","exceptions","getOwnPropertyDescriptor","F","createPropertyDescriptor","bitmap","toPropertyKey","propertyKey","makeBuiltIn","descriptor","getter","setter","defineGlobalProperty","simple","nonConfigurable","nonWritable","documentAll","IS_HTMLDDA","EXISTS","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DOMTokenList","DataTransferItemList","FileList","HTMLAllCollection","HTMLCollection","HTMLFormElement","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","PaintRequestList","Plugin","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TextTrackCueList","TextTrackList","TouchList","classList","documentCreateElement","DOMTokenListPrototype","firefox","IS_DENO","IS_NODE","Deno","UA","Pebble","process","versions","v8","webkit","copyConstructorProperties","isForced","targetProperty","sourceProperty","TARGET","GLOBAL","STATIC","stat","dontCallGetSet","sham","regexpExec","RegExpPrototype","RegExp","SHAM","SYMBOL","DELEGATES_TO_SYMBOL","DELEGATES_TO_EXEC","execCalled","re","flags","uncurriedNativeRegExpMethod","methods","nativeMethod","regexp","str","arg2","forceStringMethod","uncurriedNativeMethod","$exec","NATIVE_BIND","FunctionPrototype","getDescriptor","uncurryThisWithBind","namespace","getMethod","isNullOrUndefined","Iterators","anObject","getIteratorMethod","usingIterator","iteratorMethod","replacer","rawLength","keysLength","V","func","check","globalThis","b","getBuiltIn","sign","trunc","LN2","roundToEven","truncated","delta","mantissaLength","exponent","mantissa","exponentLength","eMax","eBias","rt","nBits","propertyIsEnumerable","dummy","Wrapper","NewTarget","NewTargetPrototype","functionToString","inspectSource","has","NATIVE_WEAK_MAP","shared","sharedKey","hiddenKeys","OBJECT_ALREADY_INITIALIZED","WeakMap","metadata","facade","STATE","$documentAll","noop","empty","construct","constructorRegExp","INCORRECT_TO_STRING","isConstructorModern","isConstructorLegacy","feature","detection","normalize","POLYFILL","NATIVE","string","isInteger","isFinite","MATCH","isRegExp","USE_SYMBOL_AS_UID","$Symbol","isArrayIteratorMethod","getIterator","iteratorClose","Result","stopped","ResultPrototype","iterable","unboundFunction","iterFn","AS_ENTRIES","IS_RECORD","IS_ITERATOR","INTERRUPTED","condition","callFn","kind","innerResult","innerError","IteratorPrototype","returnThis","IteratorConstructor","ENUMERABLE_NEXT","$","IS_PURE","createIteratorConstructor","IteratorsCore","BUGGY_SAFARI_ITERATORS","KEYS","VALUES","ENTRIES","Iterable","DEFAULT","IS_SET","CurrentIteratorPrototype","getIterationMethod","KIND","defaultIterator","IterablePrototype","INCORRECT_VALUES_NAME","nativeIterator","anyNativeIterator","entries","PrototypeOfArrayIteratorPrototype","arrayIterator","obj","CONFIGURABLE_LENGTH","TEMPLATE","arity","ceil","notify","toggle","node","macrotask","Queue","IS_IOS","IS_IOS_PEBBLE","IS_WEBOS_WEBKIT","MutationObserver","WebKitMutationObserver","queueMicrotaskDescriptor","microtask","queue","flush","parent","domain","exit","head","enter","nextTick","createTextNode","observe","characterData","add","PromiseCapability","$$resolve","$$reject","activeXDocument","definePropertiesModule","enumBugKeys","html","SCRIPT","IE_PROTO","EmptyConstructor","scriptTag","content","LT","NullProtoObjectViaActiveX","write","close","temp","parentWindow","NullProtoObject","ActiveXObject","JS","display","Properties","V8_PROTOTYPE_DEFINE_BUG","objectKeys","defineProperties","props","IE8_DOM_DEFINE","$defineProperty","$getOwnPropertyDescriptor","ENUMERABLE","WRITABLE","Attributes","current","propertyIsEnumerableModule","$getOwnPropertyNames","windowNames","getWindowNames","internalObjectKeys","getOwnPropertySymbols","CORRECT_PROTOTYPE_GETTER","names","$propertyIsEnumerable","NASHORN_BUG","uncurryThisAccessor","aPossiblePrototype","CORRECT_SETTER","input","pref","val","valueOf","getOwnPropertyNamesModule","getOwnPropertySymbolsModule","NativePromiseConstructor","IS_BROWSER","NativePromisePrototype","SUBCLASSING","NATIVE_PROMISE_REJECTION_EVENT","PromiseRejectionEvent","FORCED_PROMISE_CONSTRUCTOR","PROMISE_CONSTRUCTOR_SOURCE","GLOBAL_CORE_JS_PROMISE","FakePromise","CONSTRUCTOR","REJECTION_EVENT","newPromiseCapability","promiseCapability","checkCorrectnessOfIteration","tail","item","entry","R","re1","re2","regexpFlags","stickyHelpers","UNSUPPORTED_DOT_ALL","UNSUPPORTED_NCG","nativeReplace","nativeExec","patchedExec","UPDATES_LAST_INDEX_WRONG","lastIndex","UNSUPPORTED_Y","BROKEN_CARET","NPCG_INCLUDED","reCopy","group","raw","groups","sticky","charsAdded","strCopy","multiline","hasIndices","ignoreCase","dotAll","unicodeSets","$RegExp","MISSED_STICKY","CONSTRUCTOR_NAME","TAG","SHARED","mode","copyright","license","aConstructor","defaultConstructor","requireObjectCoercible","CONVERT_TO_STRING","pos","first","second","size","codeAt","whitespaces","ltrim","rtrim","trim","symbol","SymbolPrototype","TO_PRIMITIVE","hint","NATIVE_SYMBOL","keyFor","$location","defer","channel","port","validateArgumentsLength","setImmediate","clear","clearImmediate","Dispatch","MessageChannel","counter","ONREADYSTATECHANGE","location","run","id","runner","eventListener","globalPostMessageDefer","postMessage","protocol","host","handler","port2","port1","onmessage","importScripts","integer","toPrimitive","prim","BigInt","$RangeError","toPositiveInteger","BYTES","isSymbol","ordinaryToPrimitive","exoticToPrim","TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS","ArrayBufferViewCore","ArrayBufferModule","isIntegralNumber","toOffset","toUint8Clamped","typedArrayFrom","setSpecies","inheritIfRequired","nativeDefineProperty","nativeGetOwnPropertyDescriptor","BYTES_PER_ELEMENT","WRONG_LENGTH","fromList","isArrayBuffer","isTypedArrayIndex","wrappedGetOwnPropertyDescriptor","wrappedDefineProperty","wrapper","CLAMPED","GETTER","SETTER","NativeTypedArrayConstructor","TypedArrayConstructorPrototype","exported","addElement","typedArrayOffset","$length","$len","arrayFromConstructorAndList","typedArraySpeciesConstructor","instance","isBigIntArray","toBigInt","thisIsBigIntArray","mapfn","mapping","speciesConstructor","postfix","passed","required","path","wrappedWellKnownSymbolModule","WellKnownSymbolsStore","createWellKnownSymbol","withoutSetter","nativeArrayBufferSlice","viewSource","viewTarget","doesNotExceedSafeInteger","arrayMethodHasSpeciesSupport","IS_CONCAT_SPREADABLE","IS_CONCAT_SPREADABLE_SUPPORT","isConcatSpreadable","spreadable","E","A","$filter","addToUnscopables","defineIterator","createIterResultObject","ARRAY_ITERATOR","iterated","Arguments","nativeReverse","nativeSlice","HAS_SPECIES_SUPPORT","FUNCTION_NAME_EXISTS","nameRE","regExpExec","getReplacerFunction","$stringify","numberToString","tester","low","hi","WRONG_SYMBOLS_CONVERSION","ILL_FORMED_UNICODE","stringifyWithSymbolsFix","$replacer","fixIllFormed","space","thisNumberValue","NUMBER","NativeNumber","PureNumberNamespace","NumberPrototype","NumberWrapper","primValue","third","radix","maxCode","digits","toNumber","toNumeric","$getOwnPropertySymbols","nativeGetPrototypeOf","newPromiseCapabilityModule","perform","iterate","capability","$promiseResolve","remaining","alreadyCalled","real","onRejected","Internal","OwnPromiseCapability","nativeThen","task","hostReportErrors","PromiseConstructorDetection","PROMISE","NATIVE_PROMISE_SUBCLASSING","getInternalPromiseState","PromiseConstructor","PromisePrototype","newGenericPromiseCapability","DISPATCH_EVENT","dispatchEvent","UNHANDLED_REJECTION","isThenable","callReaction","reaction","exited","ok","fail","rejection","onHandleUnhandled","isReject","notified","reactions","onUnhandled","reason","initEvent","isUnhandled","emit","unwrap","internalReject","internalResolve","executor","onFulfilled","PromiseWrapper","race","promiseResolve","PromiseConstructorWrapper","CHECK_WRAPPER","STRING_ITERATOR","point","fixRegExpWellKnownSymbolLogic","advanceStringIndex","nativeMatch","maybeCallNative","matcher","rx","res","fullUnicode","matchStr","callRegExpExec","MAX_UINT32","$push","SPLIT_WORKS_WITH_OVERWRITTEN_EXEC","originalExec","SPLIT","nativeSplit","internalSplit","separator","limit","lim","lastLength","output","lastLastIndex","separatorCopy","splitter","unicodeMatching","q","z","defineWellKnownSymbol","$toString","nativeObjectCreate","getOwnPropertyNamesExternal","defineSymbolToPrimitive","HIDDEN","QObject","nativeGetOwnPropertyNames","nativePropertyIsEnumerable","AllSymbols","ObjectPrototypeSymbols","USE_SETTER","findChild","setSymbolDescriptor","ObjectPrototypeDescriptor","$defineProperties","properties","IS_OBJECT_PROTOTYPE","useSetter","useSimple","NativeSymbol","EmptyStringDescriptionStore","SymbolWrapper","thisSymbolValue","symbolDescriptiveString","desc","NATIVE_SYMBOL_REGISTRY","StringToSymbolRegistry","SymbolToStringRegistry","sym","u$ArrayCopyWithin","$every","$fill","actualValue","fromSpeciesAndList","$findIndex","predicate","$find","$includes","$indexOf","ArrayIterators","arrayValues","arrayKeys","arrayEntries","GENERIC","ITERATOR_IS_VALUES","typedArrayValues","$join","$map","$reduceRight","$reduce","$set","WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS","TO_OBJECT_BUG","arrayLike","$some","internalSort","FF","IE_OR_EDGE","V8","WEBKIT","nativeSort","ACCEPT_INCORRECT_ARGUMENTS","STABLE_SORT","mod","expected","getSortCompare","begin","beginIndex","$toLocaleString","toLocaleString","TO_LOCALE_STRING_BUG","Uint8ArrayPrototype","arrayToString","IS_NOT_ARRAY_METHOD","createTypedArrayConstructor","init","DOMIterables","handlePrototype","CollectionPrototype","COLLECTION_NAME","ArrayIteratorMethods","ArrayValues","ReflectOwnKeys","ReflectApply","receiver","NumberIsNaN","EventEmitter","once","emitter","errorListener","removeListener","resolver","eventTargetAgnosticAddListener","on","addErrorHandlerIfEventEmitter","_events","_eventsCount","_maxListeners","defaultMaxListeners","checkListener","listener","_getMaxListeners","_addListener","prepend","events","existing","warning","newListener","unshift","warned","warn","onceWrapper","fired","wrapFn","_onceWrap","wrapped","_listeners","evlistener","arr","ret","unwrapListeners","arrayClone","listenerCount","copy","wrapListener","removeEventListener","setMaxListeners","getMaxListeners","doError","er","listeners","addListener","prependListener","prependOnceListener","originalListener","shift","spliceOne","off","removeAllListeners","rawListeners","eventNames","extendStatics","__extends","__","__values","setLastICMessageTime","lastICMessageTime","setBanned","banned","setExtraFeatures","extrafeatures","setSelectedShout","selectedShout","setSelectedMenu","selectedMenu","setOldLoading","oldLoading","UPDATE_INTERVAL","setClient","client","setCHATBOX","CHATBOX","hdid","isLowMemory_1","fingerprintjs_1","index_1","queryParser_1","getResources_js_1","viewport_1","events_1","onReplayGo_1","packetHandler_1","loadResources_1","aoHost_1","fetchLists_1","serverIP","ip","theme","fp","Client","isLowMemory","loadResources","ms","_super","address","onOpen","onClose","onMessage","onError","serv","WebSocket","joinServer","hp","playerID","charID","char_list_length","evidence_list_length","music_list_length","testimonyID","chars","emotes","evidences","areas","musics","musics_time","callwords","manifest","resources","selectedEmote","selectedEvidence","checkUpdater","sender","viewport","_lastTimeICReceived","partial_packet","temp_packet","contains","handleSelf","message_event","MessageEvent","sendServer","setInterval","sendCheck","cleanup","msg","handle_server_packet","p_data","e_1","in_data","endsWith","packet_list","packet_list_1","packet_list_1_1","f_contents","packet","command","packetHandler","e_1_1","return","clearInterval","handleReplay","ooclog","rtime","clines","currentLine","substr","onReplayGo","resetMusicList","innerHTML","resetAreaList","fetchBackgroundList","fetchEvidenceList","fetchCharacterList","addTrack","client_1","encoding_1","paths_1","trackname","newentry","songName","getFilenameFromPath","unescapeChat","setAOhost","asset","appendICLog","showname","nameplate","time","shownameField","nameplateField","textField","className","getMinutes","timeStamp","innerText","toLocaleTimeString","hour","minute","clientLog","scrollTop","scrollHeight","checkCallword","sfxAudio","pause","play","createArea","areaClick_1","thisarea","players","cm","locked","newarea","title","onclick","area_click","fetchManifest","request_js_1","bgdata","bg_array","bg_select_1","parse","Option","background","char_select","chardata","character","evi_select","evidata","evi","manifestdata","fix_last_area","addTrack_1","malplaced","lastChild","handleBans","alert","handleCharacterInfo","iniParse_1","request_1","fileExists_1","chargs","charid","img","cini","getCharIcon","cinidata","default_options","default_emotions","extensions","charIconBaseUrl","fileUrl","alt","encodeURI","safeTags","side","blips","chat","category","emotions","gender","evidence","icon","inifile","muted","isAudio","ending","getCookie_1","evidence_js_1","backgrounds_js_1","changeMusicVolume_1","setChatbox_1","changeVolume_1","showNameClick_1","changeBlipVolume_1","reloadTheme_1","background_select","evidence_select","cookietheme","querySelector","selected","reloadTheme","cookiechatbox","setChatbox","changeMusicVolume","changeBlipVolume","checked","showname_click","resetICParams","saveChatlogHandle","downloadFile_1","icMessageLogs","messages","ye","mo","da","filename","getElementsByTagName","children","year","format","month","day","sendIC_1","sendSelf_1","sendServer_1","sendCheck_1","sendHP_1","sendOOC_1","sendCharacter_1","sendRT_1","sendMusicChange_1","sendZZ_1","sendEE_1","sendDE_1","sendPE_1","sendIC","sendSelf","sendHP","sendOOC","sendCharacter","sendRT","sendMusicChange","sendZZ","sendEE","sendDE","sendPE","escapeChat","client_2","deskmod","preanim","emote","sfx_name","emote_modifier","sfx_delay","objection_modifier","flip","realization","text_color","other_charid","self_hoffset","self_yoffset","noninterrupting_preanim","looping_sfx","screenshake","frame_screenshake","frame_realization","frame_sfx","additive","effect","extra_cccc","other_emote","other_offset","extra_27","extra_28","self_offset","serverMessage","track","setCookie_1","saveChatLogHandle_1","oocName","oocMessage","commands","commandsMap","Map","testimony","transparentPng_1","charactername","emotename","prefix","pair","pairID","characterFolder","emoteSelector","extensionsMap","extensionsMap_1","extensionsMap_1_1","getLastCharacter","getChatmsg","area","areaHr","blipVolume","blipChannels","clientVolume","musicVolume","music","getIndexFromSelect","select_box","select_element","_event","opusCheck","oldsrc","newsrc","pickEmotion","emo","setTheme","getTheme","href","resizeChatbox","chatContainerBox","clockBox","trackstatusBox","gameHeight","toFixed","trackstatus","weekday","getMonth","getDay","getHours","getDate","chatboxes_js_1","setstyle","chatbox_theme","themeselect","css_s","showFactorDialog","handleCredentialResponse","credential","updateActionCommands","role_select","selectedIndex","updateBackgroundPreview","tryUrls_1","background_filename","background_preview","resp","estring","replaceAll","decodeChat","prepChat","handleARUP","handleASS","handleBB","handleBD","handleBans_1","handleBN","updateBackgroundPreview_1","getIndexFromSelect_1","bgFromArgs","setBackgroundName","bgfolder","getBackgroundFolder","bg_index","getBackgroundName","set_side","showSpeedLines","showDesk","handleCC","handleCI","handleCharacterInfo_1","chargs_1","charid_1","handleCT","oocLog","handleCharsCheck","opacity","handleDONE","_args","handleEI","evidenceID","handleEM","createArea_1","fixLastArea_1","isAudio_1","trackindex","handleFA","handleFL","colorselect","handleFM","handleHI","handleHP","healthbox","percent_hp","getElementsByClassName","handleID","serverVersion","serverSoftware","handleJD","handleKB","handleKK","handleLE","evidence_box","evi_item","Image","pickEvidence","handleMC","appendICLog_1","musicname","looping","startsWith","loop","handleMM","handleMS","resetICParams_1","handleICSpeaking_1","char_id","char_name","msg_nameplate","msg_blips","char_chatbox","char_muted","chatmsg","chatbox","sprite","sound","snddelay","flash","speed","other_name","other_flip","effects","handle_ic_speaking","handlePN","handlePV","updateActionCommands_1","pickEmotion_1","me","emotesList","ini","emoteinfo","esfx","esfxd","soundn","soundt","sfxdelay","button","emote_item","handleRC","characters_js_1","handleRD","readOnly","handleRM","music_js_1","handleRMC","totime","getTime","currentTime","handleRT","initTestimonyUpdater_1","judgeid","initTestimonyUpdater","handleSC","handleSI","demothing","demoonclick","createAttribute","setAttributeNode","handleSM","handleSP","handleTI","timerid","timer_value","handleZZ","getSfxAudio","oldvolume","handleackMS","handleaskchaa","packets_1","packets","handleMS_1","handleCT_1","handleMC_1","handleRMC_1","twofactor_1","handleFL_1","handleLE_1","handleEM_1","handleEI_1","handleSC_1","handleCI_1","handleFM_1","handleFA_1","handleSM_1","handleMM_1","handleBD_1","handleBB_1","handleKB_1","handleKK_1","handleDONE_1","handleBN_1","handleHP_1","handleRT_1","handleTI_1","handleZZ_1","handleHI_1","handleID_1","handlePN_1","handleSI_1","handleARUP_1","handleaskchaa_1","handleCC_1","handleRC_1","handleRM_1","handleRD_1","handleCharsCheck_1","handlePV_1","handleASS_1","handleackMS_1","handleSP_1","handleJD_1","file","Blob","URL","createObjectURL","download","click","__read","defaultUrl","aomlParsed","parsed","currentHeader","contentName","contentValue","contentKey","aomlParser","applyMarkdown","defaultColor","identifiers","startIdentifiers","closingStack","colorStack","text_1","text_1_1","letter","currentSelector","currentIdentifier","currentClosingLetter","keepChar","currentColor","e_4","e_2_1","e_2","startingIdentifiers","e_3_1","e_3","Set","remove","e_4_1","cname","ca","decodeURIComponent","substring","queryDict","search","urlExtensionsToTry","fullFileUrl","COLORS","defaultChatMsg","startpreanim","startspeaking","preanimdelay","positions","def","bg","desk","ao2","ao1","speedLines","pro","hld","hlp","wit","jud","jur","sea","SHOUTS","createBlipsChannels","opusCheck_1","blipSelectors","createMusic","audioChannels","createSfxAudio","createShoutAudio","shoutAudio","createTestimonyAudio","testimonyAudio","setStartThirdTickCheck","startThirdTickCheck","setStartSecondTickCheck","startSecondTickCheck","setStartFirstTickCheck","startFirstTickCheck","checkCallword_1","setEmote_1","shouts_1","getAnimLength_1","resizeChatbox_1","colors_1","attorneyMarkdown","playerChatMsg","charLayers","pairLayers","fg","gamewindow","waitingBox","eviBox","nameBoxInner","chatBoxInner","displayname","shoutSprite","shout","gifLength","setAside","skipoffset","effectName","badEffects","intensity","drop","baseEffectUrl","setChatmsg","setTextNow","setSfxPlayed","setTickTimer","setAnimating","clearTimeout","updater","animation","getLastEvidence","setLastEvidence","getTextNow","setLastCharacter","shoutaudio","setShoutTimer","transform","textAlign","childElementCount","animationDelay","chat_tick","testimonyOverlay","setTestimonyTimer","setTestimonyUpdater","updateTestimony","positions_1","bench","court","deskFilename","createBlipChannels_1","defaultChatMsg_1","createMusic_1","createSfxAudio_1","createShoutAudio_1","createTestimonyAudio_1","setSide_1","testimonyUpdater","animating","currentBlipChannel","lastChar","lastEvi","sfxplayed","shoutTimer","testimonyTimer","textnow","tickTimer","backgroundName","playSFX","sfxname","resource","disposeTestimony","handleTextTick","chatBox","charName","charEmote","characterElement","nextCharacterElement","shake","currentCharacter","effectlayer","removeProperty","pairName","pairEmote","isShoutOver","isShoutAndPreanimOver","hasNonInterruptingPreAnim","getSfxPlayed","getTickTimer","getAnimating","getShoutTimer","getTestimonyTimer","getTestimonyUpdater","setSfxAudio","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","chunkIds","notFulfilled","splice","__esModule","definition","prop","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/client.da1f9aff6d4b8c471701.bundle.js b/client.da1f9aff6d4b8c471701.bundle.js new file mode 100644 index 00000000..bdf9d2a2 --- /dev/null +++ b/client.da1f9aff6d4b8c471701.bundle.js @@ -0,0 +1,3 @@ +/*! For license information please see client.da1f9aff6d4b8c471701.bundle.js.LICENSE.txt */ +!function(){"use strict";var e,t={7496:function(e,t,n){n.r(t),t.default=["Anime","birthday","Christmas","CountyCourt","CruiseCourt","default","DGSEnglishCourt","DGSJapanCourt","DualDestinies","EnglishCourt","gs4","GS4Night","HD","Khura'in","mlp","NewCourt","RuinedCourt","Sky","SpaceCourt","Themis","TouhouCourt","WitchTrialCourt","Zetta"]},9585:function(e,t,n){n.r(t),t.default=["Adrian","Apollo","April","Armstrong","Atmey","Butz","Diego","Edgeworth","Edgeworthw","Ema","Emaskye","Franny","Franziska","Gant","Gavin","Gavin K","Godot","Gregory","Grossberg","Gumshoe","Gumshoey","Hawk","Hobo_Phoenix","Ini","Judge","Judge's Bro","Klav","Klavier","Kristoph","Lana","Layton","Lotta","Luis","Maggey","Manfred","Marshall","Matt","Maya","Mia","Miles","Oldbag","Payne","Pearl","Phoenix","Valant","Vasquez","Wellington","Winston","Winstonpayne","Young Mia","Zak"]},5954:function(e,t,n){n.r(t),t.default=["1.png","2.png","3.png","4.png","5.png","6.png","empty.png","lawyerbadge.png"]},6246:function(e,t,n){n.r(t),t.default=["Announce The Truth (AA).opus","Announce The Truth (AJ).opus","Announce The Truth (JFA).opus","Announce The Truth (Miles).opus","Announce The Truth (T&T).opus","Confrontation ~ Presto 2009.opus","Crises of Fate.opus","Forgotten Legend.opus","Godot - The Fragrance of Dark Coffee.opus","Great Revival ~ Franziska von Karma.opus","Great Revival ~ Miles Edgeworth.opus","Hotline of Fate.opus","Interesting People.opus","Logic and Trick.opus","Luke Atmey ~ I Just Want Love.opus","Noisy People.opus","OBJECTION (AA).opus","Objection (AJ).opus","OBJECTION (JFA).opus","Objection (Miles).opus","OBJECTION (T&T).opus","Others ~ Guilty love.opus","Prelude (AA).opus","Prelude (AJ).opus","Prologue (AA).opus","Pursuit (AA) - variation.opus","Pursuit (AA).opus","Pursuit (AJ).opus","Pursuit (DS).opus","Pursuit (JFA) - variation.opus","Pursuit (JFA).opus","Pursuit (Miles).opus","Pursuit (T&T) - variation.opus","Pursuit (T&T).opus","Pursuit ~ I Want to Find the Truth (Orchestra).opus","Questioning AA (Allegro).opus","Questioning AA (Moderato).opus","Questioning AJ (Allegro).opus","Questioning AJ (Moderato).opus","Questioning JFA (Allegro).opus","Questioning JFA (Moderato).opus","Questioning T&T (Allegro).opus","Questioning T&T (Moderato).opus","Speak up Pup.opus","Suspense (AA).opus","The Great Truth Burglar.opus","Trial (AA).opus","Trial (AJ).opus","Trial (Miles).opus"]},8481:function(e,t,n){n.r(t),t.default="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="},3983:function(e,t,n){n.r(t),n.d(t,{changeSFXVolume:function(){return o},changeShoutVolume:function(){return a},changeTestimonyVolume:function(){return i}});var r=n(2557);function o(){(0,r.default)("sfxVolume",document.getElementById("client_sfxaudio").volume)}function i(){(0,r.default)("testimonyVolume",document.getElementById("client_testimonyaudio").volume)}function a(){(0,r.default)("shoutVolume",document.getElementById("client_shoutaudio").volume)}window.changeSFXVolume=o,window.changeTestimonyVolume=i,window.changeShoutVolume=a},3583:function(e,t,n){n.r(t),n(9275),n(7838),n(9701),n(853),n(1078),n(6208),n(5668);var r={section:/^\s*\[\s*([^\]]*)\s*\]\s*$/,param:/^\s*([\w.\-_]+)\s*=\s*(.*?)\s*$/,comment:/^\s*;.*$/},o=function(e){var t=0===e.length;return!r.comment.test(e)&&!t};t.default=function(e){var t,n={};return e.split(/\r\n|\r|\n/).filter(o).forEach((function(e){var o=r.param.test(e),i=r.section.test(e);if(o&&t){var a=e.match(r.param),c=a[1].toLowerCase(),u=a[2];n[t][c]=function(e,t){return"showname"===e?t:t.toLowerCase()}(c,u)}else if(i){var s=e.match(r.section)[1].toLowerCase();n[s]={},t=s}})),n}},7659:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),c=new M(r||[]);return a(i,"_invoke",{value:L(e,n,c)}),i}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var h="suspendedStart",v="suspendedYield",y="executing",m="completed",g={};function b(){}function w(){}function _(){}var x={};f(x,u,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(j([])));S&&S!==n&&i.call(S,u)&&(x=S);var T=_.prototype=b.prototype=Object.create(x);function C(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function n(o,a,c,u){var s=p(e[o],e,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,c,u)}),(function(e){n("throw",e,c,u)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return n("throw",e,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function L(t,n,r){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=I(c,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var s=p(t,n,r);if("normal"===s.type){if(o=r.done?m:v,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function I(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,I(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=p(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function j(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:j(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function c(e){i(a,r,o,c,u,"next",e)}function u(e){i(a,r,o,c,u,"throw",e)}c(void 0)}))}}function c(e){return u.apply(this,arguments)}function u(){return(u=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=new XMLHttpRequest;r.responseType="arraybuffer",r.addEventListener("error",(function(){var e=new Error("Request for ".concat(t," failed: ").concat(r.statusText));e.code=r.status,n(e)})),r.addEventListener("abort",(function(){var e=new Error("Request for ".concat(t," was aborted!"));e.code=r.status,n(e)})),r.addEventListener("load",(function(){if(r.status<200||r.status>=300){var o=new Error("Request for ".concat(t," failed with status code ").concat(r.status));o.code=r.status,n(o)}else e(r.response)})),r.open("GET",t,!0),r.send()})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}n.r(t),n.d(t,{request:function(){return s},requestBuffer:function(){return c}}),n(853),n(5054),n(5862),n(3973),n(6364),n(6632),n(1928),n(4883),n(5007),n(8995),n(2729),n(3694),n(4063),n(2031),n(2477),n(6908),n(1078),n(6208),n(4994),n(1879),n(199),n(8821);var s=function(){var e=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=new XMLHttpRequest;r.responseType="text",r.addEventListener("error",(function(){var e=new Error("Request for ".concat(t," failed: ").concat(r.statusText));e.code=r.status,n(e)})),r.addEventListener("abort",(function(){var e=new Error("Request for ".concat(t," was aborted!"));e.code=r.status,n(e)})),r.addEventListener("load",(function(){if(r.status<200||r.status>=300){var o=new Error("Request for ".concat(t," failed with status code ").concat(r.status));o.code=r.status,n(o)}else e(r.response)})),r.open("GET",t,!0),r.send()})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();t.default=s},8999:function(e,t,n){n.r(t),t.default=["aa","acww","dd","dgs","plvsaa","trilogy","future","legacy","ddlc","dr1","dr2","drv3","drae","p3","p4","p5","999","halla","homestuck","key","sonic","yakuza","yttd","whentheycry","n64zelda","papermario"]},1198:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(){o=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),c=new M(r||[]);return a(i,"_invoke",{value:L(e,n,c)}),i}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var h="suspendedStart",v="suspendedYield",y="executing",m="completed",g={};function b(){}function w(){}function _(){}var x={};f(x,u,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(j([])));S&&S!==n&&i.call(S,u)&&(x=S);var T=_.prototype=b.prototype=Object.create(x);function C(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function n(o,a,c,u){var s=p(e[o],e,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==r(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,c,u)}),(function(e){n("throw",e,c,u)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return n("throw",e,c,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function L(t,n,r){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=I(c,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var s=p(t,n,r);if("normal"===s.type){if(o=r.done?m:v,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function I(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,I(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=p(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function j(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:j(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function i(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}n.r(t),n(853),n(5054),n(3973),n(6364),n(6632),n(1928),n(4883),n(5007),n(8995),n(2729),n(3694),n(4063),n(2031),n(2477),n(6908),n(1078),n(6208),n(4994),n(1879),n(199),n(8821);var a=function(){var e,t=(e=o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var n=new XMLHttpRequest;n.open("HEAD",t),n.onload=function(){4===n.readyState&&(200===n.status?e(!0):e(!1))},n.onerror=function(){e(!1)},n.send(null)})));case 1:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function c(e){i(a,r,o,c,u,"next",e)}function u(e){i(a,r,o,c,u,"throw",e)}c(void 0)}))});return function(e){return t.apply(this,arguments)}}();t.default=a},9980:function(e,t,n){n.r(t),n.d(t,{default:function(){return l}}),n(853),n(5054),n(3973),n(6364),n(6632),n(1928),n(4883),n(5007),n(8995),n(2729),n(3694),n(4063),n(2031),n(2477),n(6908),n(1078),n(6208),n(4994),n(1879),n(199),n(8821),n(3180),n(9627),n(1358),n(6887),n(7353),n(6366),n(2372),n(5056),n(3677),n(7355),n(8784),n(8554),n(2403),n(4312),n(3444),n(70),n(6798),n(8036),n(7578),n(9641),n(2298),n(7306),n(5480),n(4314),n(572);var r=(n(174),{".gif":function(e){for(var t=new Uint8Array(e),n=0,r=0;r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(u&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:j(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function u(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}var s=function(){var e,t=(e=c().mark((function e(t){var n,a,u,s,l,f;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0,a=[".gif",".webp",".apng"];case 2:if(!(n0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]=o+n?(o=c,[4,u(0)]):[3,3]):[3,4];case 2:i.sent(),i.label=3;case 3:return++a,[3,1];case 4:return[2,r]}}))}))}function d(e){e.then(void 0,(function(){}))}function p(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function h(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function v(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<>>32-t,e[1]<>>32-t]:(t-=32,[e[1]<>>32-t,e[0]<>>32-t])}function y(e,t){return 0==(t%=64)?e:t<32?[e[0]<>>32-t,e[1]<>>1]),e=m(e=h(e,[4283543511,3981806797]),[0,e[0]>>>1]),m(e=h(e,[3301882366,444984403]),[0,e[0]>>>1])}function b(e,t){t=t||0;var n,r=(e=e||"").length%16,o=e.length-r,i=[0,t],a=[0,t],c=[0,0],u=[0,0],s=[2277735313,289559509],l=[1291169091,658871167];for(n=0;n>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)}function w(e){return parseInt(e)}function _(e){return parseFloat(e)}function x(e,t){return"number"==typeof e&&isNaN(e)?t:e}function E(e){return e.reduce((function(e,t){return e+(t?1:0)}),0)}function S(e,t){if(void 0===t&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function T(e){return e&&"object"==typeof e&&"message"in e?e:{message:e}}function C(e){return"function"!=typeof e}function O(e,t,n){var r=Object.keys(e).filter((function(e){return!function(e,t){for(var n=0,r=e.length;n=4}function k(){var e=window,t=navigator;return E(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!I()}function A(){var e=window,t=navigator;return E(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===t.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function M(){var e=window,t=navigator;return E(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===t.vendor.indexOf("Apple"),"getStorageUpdates"in t,"WebKitMediaKeys"in e])>=4}function j(){var e=window;return E(["safari"in e,!("DeviceMotionEvent"in e),!("ongestureend"in e),!("standalone"in navigator)])>=3}function P(){var e,t,n=window;return E(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function B(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function N(){var e=A(),t=P();if(!e&&!t)return!1;var n=window;return E(["onorientationchange"in n,"orientation"in n,e&&!("SharedWorker"in n),t&&/android/i.test(navigator.appVersion)])>=2}function R(e){var t=new Error(e);return t.name=e,t}function F(e,t,n){var r,a,c;return void 0===n&&(n=50),o(this,void 0,void 0,(function(){var o,s;return i(this,(function(i){switch(i.label){case 0:o=document,i.label=1;case 1:return o.body?[3,3]:[4,u(n)];case 2:return i.sent(),[3,1];case 3:s=o.createElement("iframe"),i.label=4;case 4:return i.trys.push([4,,10,11]),[4,new Promise((function(e,n){var r=!1,i=function(){r=!0,e()};s.onload=i,s.onerror=function(e){r=!0,n(e)};var a=s.style;a.setProperty("display","block","important"),a.position="absolute",a.top="0",a.left="0",a.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",o.body.appendChild(s);var c=function(){var e,t;r||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?i():setTimeout(c,10))};c()}))];case 5:i.sent(),i.label=6;case 6:return(null===(a=null===(r=s.contentWindow)||void 0===r?void 0:r.document)||void 0===a?void 0:a.body)?[3,8]:[4,u(n)];case 7:return i.sent(),[3,6];case 8:return[4,e(s,s.contentWindow)];case 9:return[2,i.sent()];case 10:return null===(c=s.parentNode)||void 0===c||c.removeChild(s),[7];case 11:return[2]}}))}))}function V(e){for(var t=function(e){for(var t,n,r="Unexpected syntax '".concat(e,"'"),o=/^\s*([a-z-]*)(.*)$/i.exec(e),i=o[1]||void 0,a={},c=/([.:#][\w-]+|\[.+?\])/gi,u=function(e,t){a[e]=a[e]||[],a[e].push(t)};;){var s=c.exec(o[2]);if(!s)break;var l=s[0];switch(l[0]){case".":u("class",l.slice(1));break;case"#":u("id",l.slice(1));break;case"[":var f=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(l);if(!f)throw new Error(r);u(f[1],null!==(n=null!==(t=f[4])&&void 0!==t?t:f[5])&&void 0!==n?n:"");break;default:throw new Error(r)}}return[i,a]}(e),n=t[0],r=t[1],o=document.createElement(null!=n?n:"div"),i=0,a=Object.keys(r);i.6*n.length}))).sort(),[2,o]}var c}))}))},fontPreferences:function(){return void 0===e&&(e=4e3),F((function(t,n){var r=n.document,o=r.body,i=o.style;i.width="".concat(e,"px"),i.webkitTextSizeAdjust=i.textSizeAdjust="none",A()?o.style.zoom="".concat(1/n.devicePixelRatio):M()&&(o.style.zoom="reset");var c=r.createElement("div");return c.textContent=a([],Array(e/20<<0),!0).map((function(){return"word"})).join(" "),o.appendChild(c),function(e,t){for(var n={},r={},o=0,i=Object.keys(ie);o');var e},audio:function(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(M()&&!j()&&!function(){var e=window;return E(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;var n=new t(1,5e3,44100),r=n.createOscillator();r.type="triangle",r.frequency.value=1e4;var o=n.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,r.connect(o),o.connect(n.destination),r.start(0);var i=function(e){var t=function(){};return[new Promise((function(n,r){var o=!1,i=0,a=0;e.oncomplete=function(e){return n(e.renderedBuffer)};var c=function(){setTimeout((function(){return r(R("timeout"))}),Math.min(500,a+5e3-Date.now()))},u=function(){try{var t=e.startRendering();switch(s(t)&&d(t),e.state){case"running":a=Date.now(),o&&c();break;case"suspended":document.hidden||i++,o&&i>=3?r(R("suspended")):setTimeout(u,500)}}catch(e){r(e)}};u(),t=function(){o||(o=!0,a>0&&c())}})),t]}(n),a=i[0],c=i[1],u=a.then((function(e){return function(e){for(var t=0,n=0;n=3||n.push(t.languages);else if("string"==typeof t.languages){var o=t.languages;o&&n.push(o.split(","))}return n},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return x(_(navigator.deviceMemory),void 0)},screenResolution:function(){var e=screen,t=function(e){return x(w(e),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n},hardwareConcurrency:function(){return x(w(navigator.hardwareConcurrency),void 0)},timezone:function(){var e,t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){var n=(new t).resolvedOptions().timeZone;if(n)return n}var r,o=(r=(new Date).getFullYear(),-Math.max(_(new Date(r,0,1).getTimezoneOffset()),_(new Date(r,6,1).getTimezoneOffset())));return"UTC".concat(o>=0?"+":"").concat(Math.abs(o))},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!I()&&!k())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var e=navigator.platform;return"MacIntel"===e&&M()&&!j()?function(){if("iPad"===navigator.platform)return!0;var e=screen,t=e.width/e.height;return E(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){var e=navigator.plugins;if(e){for(var t=[],n=0;n=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(c,"/npm-monitoring"),!0),e.send()}catch(e){console.error(e)}}(),[4,fe(n)];case 1:return e.sent(),[2,de(O(ae,{debug:r},[]),r)]}}))}))}var he={load:pe,hashComponents:le,componentsToDebugString:se},ve=b},7676:function(e,t,n){var r=n(5277),o=n(8768),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not a function")}},3327:function(e,t,n){var r=n(1536),o=n(8768),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not a constructor")}},5017:function(e,t,n){var r=n(5277),o=String,i=TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw i("Can't set "+o(e)+" as a prototype")}},6677:function(e,t,n){var r=n(2280),o=n(1569),i=n(6385).f,a=r("unscopables"),c=Array.prototype;void 0===c[a]&&i(c,a,{configurable:!0,value:o(null)}),e.exports=function(e){c[a][e]=!0}},3350:function(e,t,n){var r=n(1140).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},9519:function(e,t,n){var r=n(2010),o=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw o("Incorrect invocation")}},3875:function(e,t,n){var r=n(2786),o=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw i(o(e)+" is not an object")}},925:function(e){e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},2089:function(e,t,n){var r,o,i,a=n(925),c=n(7493),u=n(8363),s=n(5277),l=n(2786),f=n(4792),d=n(6994),p=n(8768),h=n(5899),v=n(403),y=n(3600),m=n(2010),g=n(2654),b=n(2412),w=n(2280),_=n(4524),x=n(821),E=x.enforce,S=x.get,T=u.Int8Array,C=T&&T.prototype,O=u.Uint8ClampedArray,L=O&&O.prototype,I=T&&g(T),k=C&&g(C),A=Object.prototype,M=u.TypeError,j=w("toStringTag"),P=_("TYPED_ARRAY_TAG"),B="TypedArrayConstructor",N=a&&!!b&&"Opera"!==d(u.opera),R=!1,F={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},V={BigInt64Array:8,BigUint64Array:8},H=function(e){var t=g(e);if(l(t)){var n=S(t);return n&&f(n,B)?n[B]:H(t)}},D=function(e){if(!l(e))return!1;var t=d(e);return f(F,t)||f(V,t)};for(r in F)(i=(o=u[r])&&o.prototype)?E(i)[B]=o:N=!1;for(r in V)(i=(o=u[r])&&o.prototype)&&(E(i)[B]=o);if((!N||!s(I)||I===Function.prototype)&&(I=function(){throw M("Incorrect invocation")},N))for(r in F)u[r]&&b(u[r],I);if((!N||!k||k===A)&&(k=I.prototype,N))for(r in F)u[r]&&b(u[r].prototype,k);if(N&&g(L)!==k&&b(L,k),c&&!f(k,j))for(r in R=!0,y(k,j,{configurable:!0,get:function(){return l(this)?this[P]:void 0}}),F)u[r]&&h(u[r],P,r);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:N,TYPED_ARRAY_TAG:R&&P,aTypedArray:function(e){if(D(e))return e;throw M("Target is not a typed array")},aTypedArrayConstructor:function(e){if(s(e)&&(!b||m(I,e)))return e;throw M(p(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(c){if(n)for(var o in F){var i=u[o];if(i&&f(i.prototype,e))try{delete i.prototype[e]}catch(n){try{i.prototype[e]=t}catch(e){}}}k[e]&&!n||v(k,e,n?t:N&&C[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,o;if(c){if(b){if(n)for(r in F)if((o=u[r])&&f(o,e))try{delete o[e]}catch(e){}if(I[e]&&!n)return;try{return v(I,e,n?t:N&&I[e]||t)}catch(e){}}for(r in F)!(o=u[r])||o[e]&&!n||v(o,e,t)}},getTypedArrayConstructor:H,isView:function(e){if(!l(e))return!1;var t=d(e);return"DataView"===t||f(F,t)||f(V,t)},isTypedArray:D,TypedArray:I,TypedArrayPrototype:k}},638:function(e,t,n){var r=n(8363),o=n(8697),i=n(7493),a=n(925),c=n(5316),u=n(5899),s=n(3600),l=n(3357),f=n(9044),d=n(9519),p=n(4229),h=n(5108),v=n(7302),y=n(5489),m=n(2654),g=n(2412),b=n(7994).f,w=n(5522),_=n(8990),x=n(878),E=n(821),S=c.PROPER,T=c.CONFIGURABLE,C="ArrayBuffer",O="DataView",L="prototype",I="Wrong index",k=E.getterFor(C),A=E.getterFor(O),M=E.set,j=r[C],P=j,B=P&&P[L],N=r[O],R=N&&N[L],F=Object.prototype,V=r.Array,H=r.RangeError,D=o(w),G=o([].reverse),W=y.pack,Z=y.unpack,U=function(e){return[255&e]},Y=function(e){return[255&e,e>>8&255]},X=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},J=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},z=function(e){return W(e,23,4)},K=function(e){return W(e,52,8)},Q=function(e,t,n){s(e[L],t,{configurable:!0,get:function(){return n(this)[t]}})},q=function(e,t,n,r){var o=A(e),i=v(n),a=!!r;if(i+t>o.byteLength)throw H(I);var c=o.bytes,u=i+o.byteOffset,s=_(c,u,u+t);return a?s:G(s)},$=function(e,t,n,r,o,i){var a=A(e),c=v(n),u=r(+o),s=!!i;if(c+t>a.byteLength)throw H(I);for(var l=a.bytes,f=c+a.byteOffset,d=0;dre;)(te=ne[re++])in P||u(P,te,j[te]);B.constructor=P}g&&m(R)!==F&&g(R,F);var oe=new N(new P(2)),ie=o(R.setInt8);oe.setInt8(0,2147483648),oe.setInt8(1,2147483649),!oe.getInt8(0)&&oe.getInt8(1)||l(R,{setInt8:function(e,t){ie(this,e,t<<24>>24)},setUint8:function(e,t){ie(this,e,t<<24>>24)}},{unsafe:!0})}else B=(P=function(e){d(this,B);var t=v(e);M(this,{type:C,bytes:D(V(t),0),byteLength:t}),i||(this.byteLength=t,this.detached=!1)})[L],R=(N=function(e,t,n){d(this,R),d(e,B);var r=k(e),o=r.byteLength,a=p(t);if(a<0||a>o)throw H("Wrong offset");if(a+(n=void 0===n?o-a:h(n))>o)throw H("Wrong length");M(this,{type:O,buffer:e,byteLength:n,byteOffset:a,bytes:r.bytes}),i||(this.buffer=e,this.byteLength=n,this.byteOffset=a)})[L],i&&(Q(P,"byteLength",k),Q(N,"buffer",A),Q(N,"byteLength",A),Q(N,"byteOffset",A)),l(R,{getInt8:function(e){return q(this,1,e)[0]<<24>>24},getUint8:function(e){return q(this,1,e)[0]},getInt16:function(e){var t=q(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=q(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return J(q(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return J(q(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return Z(q(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return Z(q(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){$(this,1,e,U,t)},setUint8:function(e,t){$(this,1,e,U,t)},setInt16:function(e,t){$(this,2,e,Y,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){$(this,2,e,Y,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){$(this,4,e,X,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){$(this,4,e,X,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){$(this,4,e,z,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){$(this,8,e,K,t,arguments.length>2&&arguments[2])}});x(P,C),x(N,O),e.exports={ArrayBuffer:P,DataView:N}},6759:function(e,t,n){var r=n(744),o=n(2565),i=n(7046),a=n(3731),c=Math.min;e.exports=[].copyWithin||function(e,t){var n=r(this),u=i(n),s=o(e,u),l=o(t,u),f=arguments.length>2?arguments[2]:void 0,d=c((void 0===f?u:o(f,u))-l,u-s),p=1;for(l0;)l in n?n[s]=n[l]:a(n,s),s+=p,l+=p;return n}},5522:function(e,t,n){var r=n(744),o=n(2565),i=n(7046);e.exports=function(e){for(var t=r(this),n=i(t),a=arguments.length,c=o(a>1?arguments[1]:void 0,n),u=a>2?arguments[2]:void 0,s=void 0===u?n:o(u,n);s>c;)t[c++]=e;return t}},379:function(e,t,n){var r=n(8671).forEach,o=n(4324)("forEach");e.exports=o?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},5626:function(e,t,n){var r=n(7046);e.exports=function(e,t){for(var n=0,o=r(t),i=new e(o);o>n;)i[n]=t[n++];return i}},7190:function(e,t,n){var r=n(9580),o=n(2565),i=n(7046),a=function(e){return function(t,n,a){var c,u=r(t),s=i(u),l=o(a,s);if(e&&n!=n){for(;s>l;)if((c=u[l++])!=c)return!0}else for(;s>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},8671:function(e,t,n){var r=n(8166),o=n(8697),i=n(8609),a=n(744),c=n(7046),u=n(150),s=o([].push),l=function(e){var t=1===e,n=2===e,o=3===e,l=4===e,f=6===e,d=7===e,p=5===e||f;return function(h,v,y,m){for(var g,b,w=a(h),_=i(w),x=r(v,y),E=c(_),S=0,T=m||u,C=t?T(h,E):n||d?T(h,0):void 0;E>S;S++)if((p||S in _)&&(b=x(g=_[S],S,w),e))if(t)C[S]=b;else if(b)switch(e){case 3:return!0;case 5:return g;case 6:return S;case 2:s(C,g)}else switch(e){case 4:return!1;case 7:s(C,g)}return f?-1:o||l?l:C}};e.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)}},7837:function(e,t,n){var r=n(3530),o=n(9580),i=n(4229),a=n(7046),c=n(4324),u=Math.min,s=[].lastIndexOf,l=!!s&&1/[1].lastIndexOf(1,-0)<0,f=c("lastIndexOf"),d=l||!f;e.exports=d?function(e){if(l)return r(s,this,arguments)||0;var t=o(this),n=a(t),c=n-1;for(arguments.length>1&&(c=u(c,i(arguments[1]))),c<0&&(c=n+c);c>=0;c--)if(c in t&&t[c]===e)return c||0;return-1}:s},2091:function(e,t,n){var r=n(9044),o=n(2280),i=n(1197),a=o("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},4324:function(e,t,n){var r=n(9044);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},6596:function(e,t,n){var r=n(7676),o=n(744),i=n(8609),a=n(7046),c=TypeError,u=function(e){return function(t,n,u,s){r(n);var l=o(t),f=i(l),d=a(l),p=e?d-1:0,h=e?-1:1;if(u<2)for(;;){if(p in f){s=f[p],p+=h;break}if(p+=h,e?p<0:d<=p)throw c("Reduce of empty array with no initial value")}for(;e?p>=0:d>p;p+=h)p in f&&(s=n(s,f[p],p,l));return s}};e.exports={left:u(!1),right:u(!0)}},8990:function(e,t,n){var r=n(2565),o=n(7046),i=n(5039),a=Array,c=Math.max;e.exports=function(e,t,n){for(var u=o(e),s=r(t,u),l=r(void 0===n?u:n,u),f=a(c(l-s,0)),d=0;s0;)e[r]=e[--r];r!==i++&&(e[r]=n)}return e},c=function(e,t,n,r){for(var o=t.length,i=n.length,a=0,c=0;a9007199254740991)throw t("Maximum allowed index exceeded");return e}},2848:function(e){e.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}},9189:function(e,t,n){var r=n(2750)("span").classList,o=r&&r.constructor&&r.constructor.prototype;e.exports=o===Object.prototype?void 0:o},4631:function(e,t,n){var r=n(2647).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},7923:function(e,t,n){var r=n(9756),o=n(3921);e.exports=!r&&!o&&"object"==typeof window&&"object"==typeof document},9756:function(e){e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},442:function(e,t,n){var r=n(2647);e.exports=/MSIE|Trident/.test(r)},5357:function(e,t,n){var r=n(2647);e.exports=/ipad|iphone|ipod/i.test(r)&&"undefined"!=typeof Pebble},3121:function(e,t,n){var r=n(2647);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},3921:function(e,t,n){var r=n(8363),o=n(9159);e.exports="process"===o(r.process)},4402:function(e,t,n){var r=n(2647);e.exports=/web0s(?!.*chrome)/i.test(r)},2647:function(e){e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},1197:function(e,t,n){var r,o,i=n(8363),a=n(2647),c=i.process,u=i.Deno,s=c&&c.versions||u&&u.version,l=s&&s.v8;l&&(o=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},6929:function(e,t,n){var r=n(2647).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},8869:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9882:function(e,t,n){var r=n(8363),o=n(6012).f,i=n(5899),a=n(403),c=n(2359),u=n(3870),s=n(6291);e.exports=function(e,t){var n,l,f,d,p,h=e.target,v=e.global,y=e.stat;if(n=v?r:y?r[h]||c(h,{}):(r[h]||{}).prototype)for(l in t){if(d=t[l],f=e.dontCallGetSet?(p=o(n,l))&&p.value:n[l],!s(v?l:h+(y?".":"#")+l,e.forced)&&void 0!==f){if(typeof d==typeof f)continue;u(d,f)}(e.sham||f&&f.sham)&&i(d,"sham",!0),a(n,l,d,e)}}},9044:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},1492:function(e,t,n){n(9275);var r=n(5785),o=n(403),i=n(9749),a=n(9044),c=n(2280),u=n(5899),s=c("species"),l=RegExp.prototype;e.exports=function(e,t,n,f){var d=c(e),p=!a((function(){var t={};return t[d]=function(){return 7},7!==""[e](t)})),h=p&&!a((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[s]=function(){return n},n.flags="",n[d]=/./[d]),n.exec=function(){return t=!0,null},n[d](""),!t}));if(!p||!h||n){var v=r(/./[d]),y=t(d,""[e],(function(e,t,n,o,a){var c=r(e),u=t.exec;return u===i||u===l.exec?p&&!a?{done:!0,value:v(t,n,o)}:{done:!0,value:c(n,t,o)}:{done:!1}}));o(String.prototype,e,y[0]),o(l,d,y[1])}f&&u(l[d],"sham",!0)}},3530:function(e,t,n){var r=n(3996),o=Function.prototype,i=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(i):function(){return a.apply(i,arguments)})},8166:function(e,t,n){var r=n(5785),o=n(7676),i=n(3996),a=r(r.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?a(e,t):function(){return e.apply(t,arguments)}}},3996:function(e,t,n){var r=n(9044);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},9611:function(e,t,n){var r=n(3996),o=Function.prototype.call;e.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},5316:function(e,t,n){var r=n(7493),o=n(4792),i=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,c=o(i,"name"),u=c&&"something"===function(){}.name,s=c&&(!r||r&&a(i,"name").configurable);e.exports={EXISTS:c,PROPER:u,CONFIGURABLE:s}},2575:function(e,t,n){var r=n(8697),o=n(7676);e.exports=function(e,t,n){try{return r(o(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},5785:function(e,t,n){var r=n(9159),o=n(8697);e.exports=function(e){if("Function"===r(e))return o(e)}},8697:function(e,t,n){var r=n(3996),o=Function.prototype,i=o.call,a=r&&o.bind.bind(i,i);e.exports=r?a:function(e){return function(){return i.apply(e,arguments)}}},2773:function(e,t,n){var r=n(8363),o=n(5277);e.exports=function(e,t){return arguments.length<2?(n=r[e],o(n)?n:void 0):r[e]&&r[e][t];var n}},7193:function(e,t,n){var r=n(6994),o=n(7219),i=n(9903),a=n(4818),c=n(2280)("iterator");e.exports=function(e){if(!i(e))return o(e,c)||o(e,"@@iterator")||a[r(e)]}},1805:function(e,t,n){var r=n(9611),o=n(7676),i=n(3875),a=n(8768),c=n(7193),u=TypeError;e.exports=function(e,t){var n=arguments.length<2?c(e):t;if(o(n))return i(r(n,e));throw u(a(e)+" is not iterable")}},6590:function(e,t,n){var r=n(8697),o=n(1982),i=n(5277),a=n(9159),c=n(8967),u=r([].push);e.exports=function(e){if(i(e))return e;if(o(e)){for(var t=e.length,n=[],r=0;r.5||.5===n&&t%2!=0?t+r(e):t};e.exports={pack:function(e,t,n){var r,o,d,p=i(n),h=8*n-t-1,v=(1<>1,m=23===t?c(2,-24)-c(2,-77):0,g=e<0||0===e&&1/e<0?1:0,b=0;for((e=a(e))!=e||e===1/0?(o=e!=e?1:0,r=v):(r=u(s(e)/l),e*(d=c(2,-r))<1&&(r--,d*=2),(e+=r+y>=1?m/d:m*c(2,1-y))*d>=2&&(r++,d/=2),r+y>=v?(o=0,r=v):r+y>=1?(o=f((e*d-1)*c(2,t)),r+=y):(o=f(e*c(2,y-1)*c(2,t)),r=0));t>=8;)p[b++]=255&o,o/=256,t-=8;for(r=r<0;)p[b++]=255&r,r/=256,h-=8;return p[--b]|=128*g,p},unpack:function(e,t){var n,r=e.length,o=8*r-t-1,i=(1<>1,u=o-7,s=r-1,l=e[s--],f=127&l;for(l>>=7;u>0;)f=256*f+e[s--],u-=8;for(n=f&(1<<-u)-1,f>>=-u,u+=t;u>0;)n=256*n+e[s--],u-=8;if(0===f)f=1-a;else{if(f===i)return n?NaN:l?-1/0:1/0;n+=c(2,t),f-=a}return(l?-1:1)*n*c(2,f-t)}}},8609:function(e,t,n){var r=n(8697),o=n(9044),i=n(9159),a=Object,c=r("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===i(e)?c(e,""):a(e)}:a},9250:function(e,t,n){var r=n(5277),o=n(2786),i=n(2412);e.exports=function(e,t,n){var a,c;return i&&r(a=t.constructor)&&a!==n&&o(c=a.prototype)&&c!==n.prototype&&i(e,c),e}},6429:function(e,t,n){var r=n(8697),o=n(5277),i=n(9415),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},821:function(e,t,n){var r,o,i,a=n(2512),c=n(8363),u=n(2786),s=n(5899),l=n(4792),f=n(9415),d=n(466),p=n(7505),h="Object already initialized",v=c.TypeError,y=c.WeakMap;if(a||f.state){var m=f.state||(f.state=new y);m.get=m.get,m.has=m.has,m.set=m.set,r=function(e,t){if(m.has(e))throw v(h);return t.facade=e,m.set(e,t),t},o=function(e){return m.get(e)||{}},i=function(e){return m.has(e)}}else{var g=d("state");p[g]=!0,r=function(e,t){if(l(e,g))throw v(h);return t.facade=e,s(e,g,t),t},o=function(e){return l(e,g)?e[g]:{}},i=function(e){return l(e,g)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!u(t)||(n=o(t)).type!==e)throw v("Incompatible receiver, "+e+" required");return n}}}},8089:function(e,t,n){var r=n(2280),o=n(4818),i=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},1982:function(e,t,n){var r=n(9159);e.exports=Array.isArray||function(e){return"Array"===r(e)}},217:function(e,t,n){var r=n(6994);e.exports=function(e){var t=r(e);return"BigInt64Array"===t||"BigUint64Array"===t}},5277:function(e,t,n){var r=n(3966),o=r.all;e.exports=r.IS_HTMLDDA?function(e){return"function"==typeof e||e===o}:function(e){return"function"==typeof e}},1536:function(e,t,n){var r=n(8697),o=n(9044),i=n(5277),a=n(6994),c=n(2773),u=n(6429),s=function(){},l=[],f=c("Reflect","construct"),d=/^\s*(?:class|function)\b/,p=r(d.exec),h=!d.exec(s),v=function(e){if(!i(e))return!1;try{return f(s,l,e),!0}catch(e){return!1}},y=function(e){if(!i(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!p(d,u(e))}catch(e){return!0}};y.sham=!0,e.exports=!f||o((function(){var e;return v(v.call)||!v(Object)||!v((function(){e=!0}))||e}))?y:v},6291:function(e,t,n){var r=n(9044),o=n(5277),i=/#|\.prototype\./,a=function(e,t){var n=u[c(e)];return n===l||n!==s&&(o(t)?r(t):!!t)},c=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},u=a.data={},s=a.NATIVE="N",l=a.POLYFILL="P";e.exports=a},7507:function(e,t,n){var r=n(2786),o=Math.floor;e.exports=Number.isInteger||function(e){return!r(e)&&isFinite(e)&&o(e)===e}},9903:function(e){e.exports=function(e){return null==e}},2786:function(e,t,n){var r=n(5277),o=n(3966),i=o.all;e.exports=o.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:r(e)||e===i}:function(e){return"object"==typeof e?null!==e:r(e)}},1178:function(e){e.exports=!1},2622:function(e,t,n){var r=n(2786),o=n(9159),i=n(2280)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"===o(e))}},6681:function(e,t,n){var r=n(2773),o=n(5277),i=n(2010),a=n(189),c=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&i(t.prototype,c(e))}},5166:function(e,t,n){var r=n(8166),o=n(9611),i=n(3875),a=n(8768),c=n(8089),u=n(7046),s=n(2010),l=n(1805),f=n(7193),d=n(8744),p=TypeError,h=function(e,t){this.stopped=e,this.result=t},v=h.prototype;e.exports=function(e,t,n){var y,m,g,b,w,_,x,E=n&&n.that,S=!(!n||!n.AS_ENTRIES),T=!(!n||!n.IS_RECORD),C=!(!n||!n.IS_ITERATOR),O=!(!n||!n.INTERRUPTED),L=r(t,E),I=function(e){return y&&d(y,"normal",e),new h(!0,e)},k=function(e){return S?(i(e),O?L(e[0],e[1],I):L(e[0],e[1])):O?L(e,I):L(e)};if(T)y=e.iterator;else if(C)y=e;else{if(!(m=f(e)))throw p(a(e)+" is not iterable");if(c(m)){for(g=0,b=u(e);b>g;g++)if((w=k(e[g]))&&s(v,w))return w;return new h(!1)}y=l(e,m)}for(_=T?e.next:y.next;!(x=o(_,y)).done;){try{w=k(x.value)}catch(e){d(y,"throw",e)}if("object"==typeof w&&w&&s(v,w))return w}return new h(!1)}},8744:function(e,t,n){var r=n(9611),o=n(3875),i=n(7219);e.exports=function(e,t,n){var a,c;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){c=!0,a=e}if("throw"===t)throw n;if(c)throw a;return o(a),n}},9952:function(e,t,n){var r=n(7022).IteratorPrototype,o=n(1569),i=n(9199),a=n(878),c=n(4818),u=function(){return this};e.exports=function(e,t,n,s){var l=t+" Iterator";return e.prototype=o(r,{next:i(+!s,n)}),a(e,l,!1,!0),c[l]=u,e}},8150:function(e,t,n){var r=n(9882),o=n(9611),i=n(1178),a=n(5316),c=n(5277),u=n(9952),s=n(2654),l=n(2412),f=n(878),d=n(5899),p=n(403),h=n(2280),v=n(4818),y=n(7022),m=a.PROPER,g=a.CONFIGURABLE,b=y.IteratorPrototype,w=y.BUGGY_SAFARI_ITERATORS,_=h("iterator"),x="keys",E="values",S="entries",T=function(){return this};e.exports=function(e,t,n,a,h,y,C){u(n,t,a);var O,L,I,k=function(e){if(e===h&&B)return B;if(!w&&e&&e in j)return j[e];switch(e){case x:case E:case S:return function(){return new n(this,e)}}return function(){return new n(this)}},A=t+" Iterator",M=!1,j=e.prototype,P=j[_]||j["@@iterator"]||h&&j[h],B=!w&&P||k(h),N="Array"===t&&j.entries||P;if(N&&(O=s(N.call(new e)))!==Object.prototype&&O.next&&(i||s(O)===b||(l?l(O,b):c(O[_])||p(O,_,T)),f(O,A,!0,!0),i&&(v[A]=T)),m&&h===E&&P&&P.name!==E&&(!i&&g?d(j,"name",E):(M=!0,B=function(){return o(P,this)})),h)if(L={values:k(E),keys:y?B:k(x),entries:k(S)},C)for(I in L)(w||M||!(I in j))&&p(j,I,L[I]);else r({target:t,proto:!0,forced:w||M},L);return i&&!C||j[_]===B||p(j,_,B,{name:h}),v[t]=B,L}},7022:function(e,t,n){var r,o,i,a=n(9044),c=n(5277),u=n(2786),s=n(1569),l=n(2654),f=n(403),d=n(2280),p=n(1178),h=d("iterator"),v=!1;[].keys&&("next"in(i=[].keys())?(o=l(l(i)))!==Object.prototype&&(r=o):v=!0),!u(r)||a((function(){var e={};return r[h].call(e)!==e}))?r={}:p&&(r=s(r)),c(r[h])||f(r,h,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:v}},4818:function(e){e.exports={}},7046:function(e,t,n){var r=n(5108);e.exports=function(e){return r(e.length)}},833:function(e,t,n){var r=n(8697),o=n(9044),i=n(5277),a=n(4792),c=n(7493),u=n(5316).CONFIGURABLE,s=n(6429),l=n(821),f=l.enforce,d=l.get,p=String,h=Object.defineProperty,v=r("".slice),y=r("".replace),m=r([].join),g=c&&!o((function(){return 8!==h((function(){}),"length",{value:8}).length})),b=String(String).split("String"),w=e.exports=function(e,t,n){"Symbol("===v(p(t),0,7)&&(t="["+y(p(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!a(e,"name")||u&&e.name!==t)&&(c?h(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&a(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?c&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=f(e);return a(r,"source")||(r.source=m(b,"string"==typeof t?t:"")),e};Function.prototype.toString=w((function(){return i(this)&&d(this).source||s(this)}),"toString")},3935:function(e){e.exports=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1}},8300:function(e){var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},1800:function(e,t,n){var r,o,i,a,c,u=n(8363),s=n(8166),l=n(6012).f,f=n(4643).set,d=n(2423),p=n(3121),h=n(5357),v=n(4402),y=n(3921),m=u.MutationObserver||u.WebKitMutationObserver,g=u.document,b=u.process,w=u.Promise,_=l(u,"queueMicrotask"),x=_&&_.value;if(!x){var E=new d,S=function(){var e,t;for(y&&(e=b.domain)&&e.exit();t=E.get();)try{t()}catch(e){throw E.head&&r(),e}e&&e.enter()};p||y||v||!m||!g?!h&&w&&w.resolve?((a=w.resolve(void 0)).constructor=w,c=s(a.then,a),r=function(){c(S)}):y?r=function(){b.nextTick(S)}:(f=s(f,u),r=function(){f(S)}):(o=!0,i=g.createTextNode(""),new m(S).observe(i,{characterData:!0}),r=function(){i.data=o=!o}),x=function(e){E.head||r(),E.add(e)}}e.exports=x},9269:function(e,t,n){var r=n(7676),o=TypeError,i=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw o("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new i(e)}},1569:function(e,t,n){var r,o=n(3875),i=n(7840),a=n(8869),c=n(7505),u=n(7055),s=n(2750),l=n(466),f="prototype",d="script",p=l("IE_PROTO"),h=function(){},v=function(e){return"<"+d+">"+e+""},y=function(e){e.write(v("")),e.close();var t=e.parentWindow.Object;return e=null,t},m=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;m="undefined"!=typeof document?document.domain&&r?y(r):(t=s("iframe"),n="java"+d+":",t.style.display="none",u.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(v("document.F=Object")),e.close(),e.F):y(r);for(var o=a.length;o--;)delete m[f][a[o]];return m()};c[p]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h[f]=o(e),n=new h,h[f]=null,n[p]=e):n=m(),void 0===t?n:i.f(n,t)}},7840:function(e,t,n){var r=n(7493),o=n(1010),i=n(6385),a=n(3875),c=n(9580),u=n(667);t.f=r&&!o?Object.defineProperties:function(e,t){a(e);for(var n,r=c(t),o=u(t),s=o.length,l=0;s>l;)i.f(e,n=o[l++],r[n]);return e}},6385:function(e,t,n){var r=n(7493),o=n(7548),i=n(1010),a=n(3875),c=n(383),u=TypeError,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",d="configurable",p="writable";t.f=r?i?function(e,t,n){if(a(e),t=c(t),a(n),"function"==typeof e&&"prototype"===t&&"value"in n&&p in n&&!n[p]){var r=l(e,t);r&&r[p]&&(e[t]=n.value,n={configurable:d in n?n[d]:r[d],enumerable:f in n?n[f]:r[f],writable:!1})}return s(e,t,n)}:s:function(e,t,n){if(a(e),t=c(t),a(n),o)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw u("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},6012:function(e,t,n){var r=n(7493),o=n(9611),i=n(1513),a=n(9199),c=n(9580),u=n(383),s=n(4792),l=n(7548),f=Object.getOwnPropertyDescriptor;t.f=r?f:function(e,t){if(e=c(e),t=u(t),l)try{return f(e,t)}catch(e){}if(s(e,t))return a(!o(i.f,e,t),e[t])}},4938:function(e,t,n){var r=n(9159),o=n(9580),i=n(7994).f,a=n(8990),c="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return c&&"Window"===r(e)?function(e){try{return i(e)}catch(e){return a(c)}}(e):i(o(e))}},7994:function(e,t,n){var r=n(8794),o=n(8869).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},9612:function(e,t){t.f=Object.getOwnPropertySymbols},2654:function(e,t,n){var r=n(4792),o=n(5277),i=n(744),a=n(466),c=n(5115),u=a("IE_PROTO"),s=Object,l=s.prototype;e.exports=c?s.getPrototypeOf:function(e){var t=i(e);if(r(t,u))return t[u];var n=t.constructor;return o(n)&&t instanceof n?n.prototype:t instanceof s?l:null}},2010:function(e,t,n){var r=n(8697);e.exports=r({}.isPrototypeOf)},8794:function(e,t,n){var r=n(8697),o=n(4792),i=n(9580),a=n(7190).indexOf,c=n(7505),u=r([].push);e.exports=function(e,t){var n,r=i(e),s=0,l=[];for(n in r)!o(c,n)&&o(r,n)&&u(l,n);for(;t.length>s;)o(r,n=t[s++])&&(~a(l,n)||u(l,n));return l}},667:function(e,t,n){var r=n(8794),o=n(8869);e.exports=Object.keys||function(e){return r(e,o)}},1513:function(e,t){var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},2412:function(e,t,n){var r=n(2575),o=n(3875),i=n(5017);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return o(n),i(r),t?e(n,r):n.__proto__=r,n}}():void 0)},6699:function(e,t,n){var r=n(7301),o=n(6994);e.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},7141:function(e,t,n){var r=n(9611),o=n(5277),i=n(2786),a=TypeError;e.exports=function(e,t){var n,c;if("string"===t&&o(n=e.toString)&&!i(c=r(n,e)))return c;if(o(n=e.valueOf)&&!i(c=r(n,e)))return c;if("string"!==t&&o(n=e.toString)&&!i(c=r(n,e)))return c;throw a("Can't convert object to primitive value")}},1561:function(e,t,n){var r=n(2773),o=n(8697),i=n(7994),a=n(9612),c=n(3875),u=o([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(c(e)),n=a.f;return n?u(t,n(e)):t}},7290:function(e,t,n){var r=n(8363);e.exports=r},4443:function(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},5182:function(e,t,n){var r=n(8363),o=n(5988),i=n(5277),a=n(6291),c=n(6429),u=n(2280),s=n(7923),l=n(9756),f=n(1178),d=n(1197),p=o&&o.prototype,h=u("species"),v=!1,y=i(r.PromiseRejectionEvent),m=a("Promise",(function(){var e=c(o),t=e!==String(o);if(!t&&66===d)return!0;if(f&&(!p.catch||!p.finally))return!0;if(!d||d<51||!/native code/.test(e)){var n=new o((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[h]=r,!(v=n.then((function(){}))instanceof r))return!0}return!t&&(s||l)&&!y}));e.exports={CONSTRUCTOR:m,REJECTION_EVENT:y,SUBCLASSING:v}},5988:function(e,t,n){var r=n(8363);e.exports=r.Promise},1621:function(e,t,n){var r=n(3875),o=n(2786),i=n(9269);e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e);return(0,n.resolve)(t),n.promise}},9581:function(e,t,n){var r=n(5988),o=n(8662),i=n(5182).CONSTRUCTOR;e.exports=i||!o((function(e){r.all(e).then(void 0,(function(){}))}))},2423:function(e){var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},4088:function(e,t,n){var r=n(9611),o=n(3875),i=n(5277),a=n(9159),c=n(9749),u=TypeError;e.exports=function(e,t){var n=e.exec;if(i(n)){var s=r(n,e,t);return null!==s&&o(s),s}if("RegExp"===a(e))return r(c,e,t);throw u("RegExp#exec called on incompatible receiver")}},9749:function(e,t,n){var r,o,i=n(9611),a=n(8697),c=n(8967),u=n(8083),s=n(7047),l=n(3580),f=n(1569),d=n(821).get,p=n(1669),h=n(1638),v=l("native-string-replace",String.prototype.replace),y=RegExp.prototype.exec,m=y,g=a("".charAt),b=a("".indexOf),w=a("".replace),_=a("".slice),x=(o=/b*/g,i(y,r=/a/,"a"),i(y,o,"a"),0!==r.lastIndex||0!==o.lastIndex),E=s.BROKEN_CARET,S=void 0!==/()??/.exec("")[1];(x||S||E||p||h)&&(m=function(e){var t,n,r,o,a,s,l,p=this,h=d(p),T=c(e),C=h.raw;if(C)return C.lastIndex=p.lastIndex,t=i(m,C,T),p.lastIndex=C.lastIndex,t;var O=h.groups,L=E&&p.sticky,I=i(u,p),k=p.source,A=0,M=T;if(L&&(I=w(I,"y",""),-1===b(I,"g")&&(I+="g"),M=_(T,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==g(T,p.lastIndex-1))&&(k="(?: "+k+")",M=" "+M,A++),n=new RegExp("^(?:"+k+")",I)),S&&(n=new RegExp("^"+k+"$(?!\\s)",I)),x&&(r=p.lastIndex),o=i(y,L?n:p,M),L?o?(o.input=_(o.input,A),o[0]=_(o[0],A),o.index=p.lastIndex,p.lastIndex+=o[0].length):p.lastIndex=0:x&&o&&(p.lastIndex=p.global?o.index+o[0].length:r),S&&o&&o.length>1&&i(v,o[0],n,(function(){for(a=1;ab)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$
c")}))},6411:function(e,t,n){var r=n(9903),o=TypeError;e.exports=function(e){if(r(e))throw o("Can't call method on "+e);return e}},7323:function(e,t,n){var r=n(2773),o=n(3600),i=n(2280),a=n(7493),c=i("species");e.exports=function(e){var t=r(e);a&&t&&!t[c]&&o(t,c,{configurable:!0,get:function(){return this}})}},878:function(e,t,n){var r=n(6385).f,o=n(4792),i=n(2280)("toStringTag");e.exports=function(e,t,n){e&&!n&&(e=e.prototype),e&&!o(e,i)&&r(e,i,{configurable:!0,value:t})}},466:function(e,t,n){var r=n(3580),o=n(4524),i=r("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},9415:function(e,t,n){var r=n(8363),o=n(2359),i="__core-js_shared__",a=r[i]||o(i,{});e.exports=a},3580:function(e,t,n){var r=n(1178),o=n(9415);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.32.2",mode:r?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE",source:"https://github.com/zloirock/core-js"})},7270:function(e,t,n){var r=n(3875),o=n(3327),i=n(9903),a=n(2280)("species");e.exports=function(e,t){var n,c=r(e).constructor;return void 0===c||i(n=r(c)[a])?t:o(n)}},1140:function(e,t,n){var r=n(8697),o=n(4229),i=n(8967),a=n(6411),c=r("".charAt),u=r("".charCodeAt),s=r("".slice),l=function(e){return function(t,n){var r,l,f=i(a(t)),d=o(n),p=f.length;return d<0||d>=p?e?"":void 0:(r=u(f,d))<55296||r>56319||d+1===p||(l=u(f,d+1))<56320||l>57343?e?c(f,d):r:e?s(f,d,d+2):l-56320+(r-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},287:function(e,t,n){var r=n(8697),o=n(6411),i=n(8967),a=n(2569),c=r("".replace),u=RegExp("^["+a+"]+"),s=RegExp("(^|[^"+a+"])["+a+"]+$"),l=function(e){return function(t){var n=i(o(t));return 1&e&&(n=c(n,u,"")),2&e&&(n=c(n,s,"$1")),n}};e.exports={start:l(1),end:l(2),trim:l(3)}},746:function(e,t,n){var r=n(1197),o=n(9044),i=n(8363).String;e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},455:function(e,t,n){var r=n(9611),o=n(2773),i=n(2280),a=n(403);e.exports=function(){var e=o("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,c=i("toPrimitive");t&&!t[c]&&a(t,c,(function(e){return r(n,this)}),{arity:1})}},3429:function(e,t,n){var r=n(746);e.exports=r&&!!Symbol.for&&!!Symbol.keyFor},4643:function(e,t,n){var r,o,i,a,c=n(8363),u=n(3530),s=n(8166),l=n(5277),f=n(4792),d=n(9044),p=n(7055),h=n(5629),v=n(2750),y=n(7687),m=n(3121),g=n(3921),b=c.setImmediate,w=c.clearImmediate,_=c.process,x=c.Dispatch,E=c.Function,S=c.MessageChannel,T=c.String,C=0,O={},L="onreadystatechange";d((function(){r=c.location}));var I=function(e){if(f(O,e)){var t=O[e];delete O[e],t()}},k=function(e){return function(){I(e)}},A=function(e){I(e.data)},M=function(e){c.postMessage(T(e),r.protocol+"//"+r.host)};b&&w||(b=function(e){y(arguments.length,1);var t=l(e)?e:E(e),n=h(arguments,1);return O[++C]=function(){u(t,void 0,n)},o(C),C},w=function(e){delete O[e]},g?o=function(e){_.nextTick(k(e))}:x&&x.now?o=function(e){x.now(k(e))}:S&&!m?(a=(i=new S).port2,i.port1.onmessage=A,o=s(a.postMessage,a)):c.addEventListener&&l(c.postMessage)&&!c.importScripts&&r&&"file:"!==r.protocol&&!d(M)?(o=M,c.addEventListener("message",A,!1)):o=L in v("script")?function(e){p.appendChild(v("script"))[L]=function(){p.removeChild(this),I(e)}}:function(e){setTimeout(k(e),0)}),e.exports={set:b,clear:w}},1655:function(e,t,n){var r=n(8697);e.exports=r(1..valueOf)},2565:function(e,t,n){var r=n(4229),o=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):i(n,t)}},2802:function(e,t,n){var r=n(1893),o=TypeError;e.exports=function(e){var t=r(e,"number");if("number"==typeof t)throw o("Can't convert number to bigint");return BigInt(t)}},7302:function(e,t,n){var r=n(4229),o=n(5108),i=RangeError;e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=o(t);if(t!==n)throw i("Wrong length or index");return n}},9580:function(e,t,n){var r=n(8609),o=n(6411);e.exports=function(e){return r(o(e))}},4229:function(e,t,n){var r=n(8300);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},5108:function(e,t,n){var r=n(4229),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},744:function(e,t,n){var r=n(6411),o=Object;e.exports=function(e){return o(r(e))}},5758:function(e,t,n){var r=n(3786),o=RangeError;e.exports=function(e,t){var n=r(e);if(n%t)throw o("Wrong offset");return n}},3786:function(e,t,n){var r=n(4229),o=RangeError;e.exports=function(e){var t=r(e);if(t<0)throw o("The argument can't be less than 0");return t}},1893:function(e,t,n){var r=n(9611),o=n(2786),i=n(6681),a=n(7219),c=n(7141),u=n(2280),s=TypeError,l=u("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var n,u=a(e,l);if(u){if(void 0===t&&(t="default"),n=r(u,e,t),!o(n)||i(n))return n;throw s("Can't convert object to primitive value")}return void 0===t&&(t="number"),c(e,t)}},383:function(e,t,n){var r=n(1893),o=n(6681);e.exports=function(e){var t=r(e,"string");return o(t)?t:t+""}},7301:function(e,t,n){var r={};r[n(2280)("toStringTag")]="z",e.exports="[object z]"===String(r)},8967:function(e,t,n){var r=n(6994),o=String;e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return o(e)}},5952:function(e){var t=Math.round;e.exports=function(e){var n=t(e);return n<0?0:n>255?255:255&n}},8768:function(e){var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},6764:function(e,t,n){var r=n(9882),o=n(8363),i=n(9611),a=n(7493),c=n(3231),u=n(2089),s=n(638),l=n(9519),f=n(9199),d=n(5899),p=n(7507),h=n(5108),v=n(7302),y=n(5758),m=n(5952),g=n(383),b=n(4792),w=n(6994),_=n(2786),x=n(6681),E=n(1569),S=n(2010),T=n(2412),C=n(7994).f,O=n(6503),L=n(8671).forEach,I=n(7323),k=n(3600),A=n(6385),M=n(6012),j=n(821),P=n(9250),B=j.get,N=j.set,R=j.enforce,F=A.f,V=M.f,H=o.RangeError,D=s.ArrayBuffer,G=D.prototype,W=s.DataView,Z=u.NATIVE_ARRAY_BUFFER_VIEWS,U=u.TYPED_ARRAY_TAG,Y=u.TypedArray,X=u.TypedArrayPrototype,J=u.aTypedArrayConstructor,z=u.isTypedArray,K="BYTES_PER_ELEMENT",Q="Wrong length",q=function(e,t){J(e);for(var n=0,r=t.length,o=new e(r);r>n;)o[n]=t[n++];return o},$=function(e,t){k(e,t,{configurable:!0,get:function(){return B(this)[t]}})},ee=function(e){var t;return S(G,e)||"ArrayBuffer"===(t=w(e))||"SharedArrayBuffer"===t},te=function(e,t){return z(e)&&!x(t)&&t in e&&p(+t)&&t>=0},ne=function(e,t){return t=g(t),te(e,t)?f(2,e[t]):V(e,t)},re=function(e,t,n){return t=g(t),!(te(e,t)&&_(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?F(e,t,n):(e[t]=n.value,e)};a?(Z||(M.f=ne,A.f=re,$(X,"buffer"),$(X,"byteOffset"),$(X,"byteLength"),$(X,"length")),r({target:"Object",stat:!0,forced:!Z},{getOwnPropertyDescriptor:ne,defineProperty:re}),e.exports=function(e,t,n){var a=e.match(/\d+/)[0]/8,u=e+(n?"Clamped":"")+"Array",s="get"+e,f="set"+e,p=o[u],g=p,b=g&&g.prototype,w={},x=function(e,t){F(e,t,{get:function(){return function(e,t){var n=B(e);return n.view[s](t*a+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var o=B(e);o.view[f](t*a+o.byteOffset,n?m(r):r,!0)}(this,t,e)},enumerable:!0})};Z?c&&(g=t((function(e,t,n,r){return l(e,b),P(_(t)?ee(t)?void 0!==r?new p(t,y(n,a),r):void 0!==n?new p(t,y(n,a)):new p(t):z(t)?q(g,t):i(O,g,t):new p(v(t)),e,g)})),T&&T(g,Y),L(C(p),(function(e){e in g||d(g,e,p[e])})),g.prototype=b):(g=t((function(e,t,n,r){l(e,b);var o,c,u,s=0,f=0;if(_(t)){if(!ee(t))return z(t)?q(g,t):i(O,g,t);o=t,f=y(n,a);var d=t.byteLength;if(void 0===r){if(d%a)throw H(Q);if((c=d-f)<0)throw H(Q)}else if((c=h(r)*a)+f>d)throw H(Q);u=c/a}else u=v(t),o=new D(c=u*a);for(N(e,{buffer:o,byteOffset:f,byteLength:c,length:u,view:new W(o)});s1?arguments[1]:void 0,S=void 0!==E,T=s(_);if(T&&!l(T))for(b=(g=u(_,T)).next,_=[];!(m=o(b,g)).done;)_.push(m.value);for(S&&x>2&&(E=r(E,arguments[2])),n=c(_),h=new(d(w))(n),v=f(h),t=0;n>t;t++)y=S?E(_[t],t):_[t],h[t]=v?p(y):+y;return h}},6107:function(e,t,n){var r=n(2089),o=n(7270),i=r.aTypedArrayConstructor,a=r.getTypedArrayConstructor;e.exports=function(e){return i(o(e,a(e)))}},4524:function(e,t,n){var r=n(8697),o=0,i=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},189:function(e,t,n){var r=n(746);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},1010:function(e,t,n){var r=n(7493),o=n(9044);e.exports=r&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},7687:function(e){var t=TypeError;e.exports=function(e,n){if(e=51||!o((function(){var e=[];return e[v]=!1,e.concat()[0]!==e})),m=function(e){if(!a(e))return!1;var t=e[v];return void 0!==t?!!t:i(e)};r({target:"Array",proto:!0,arity:1,forced:!y||!d("concat")},{concat:function(e){var t,n,r,o,i,a=c(this),d=f(a,0),p=0;for(t=-1,r=arguments.length;t1?arguments[1]:void 0)}})},1078:function(e,t,n){var r=n(9882),o=n(379);r({target:"Array",proto:!0,forced:[].forEach!==o},{forEach:o})},4883:function(e,t,n){var r=n(9580),o=n(6677),i=n(4818),a=n(821),c=n(6385).f,u=n(8150),s=n(6145),l=n(1178),f=n(7493),d="Array Iterator",p=a.set,h=a.getterFor(d);e.exports=u(Array,"Array",(function(e,t){p(this,{type:d,target:r(e),index:0,kind:t})}),(function(){var e=h(this),t=e.target,n=e.kind,r=e.index++;if(!t||r>=t.length)return e.target=void 0,s(void 0,!0);switch(n){case"keys":return s(r,!1);case"values":return s(t[r],!1)}return s([r,t[r]],!1)}),"values");var v=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!l&&f&&"values"!==v.name)try{c(v,"name",{value:"values"})}catch(e){}},199:function(e,t,n){var r=n(9882),o=n(8697),i=n(1982),a=o([].reverse),c=[1,2];r({target:"Array",proto:!0,forced:String(c)===String(c.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a(this)}})},8821:function(e,t,n){var r=n(9882),o=n(1982),i=n(1536),a=n(2786),c=n(2565),u=n(7046),s=n(9580),l=n(5039),f=n(2280),d=n(2091),p=n(5629),h=d("slice"),v=f("species"),y=Array,m=Math.max;r({target:"Array",proto:!0,forced:!h},{slice:function(e,t){var n,r,f,d=s(this),h=u(d),g=c(e,h),b=c(void 0===t?h:t,h);if(o(d)&&(n=d.constructor,(i(n)&&(n===y||o(n.prototype))||a(n)&&null===(n=n[v]))&&(n=void 0),n===y||void 0===n))return p(d,g,b);for(r=new(void 0===n?y:n)(m(b-g,0)),f=0;g2)if(s=w(s),43===(t=O(s,0))||45===t){if(88===(n=O(s,2))||120===n)return NaN}else if(48===t){switch(O(s,1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+s}for(a=(i=C(s,2)).length,c=0;co)return NaN;return parseInt(i,r)}return+s}(t)}(e));return d(S,t=this)&&v((function(){b(t)}))?f(Object(n),this,I):n};I.prototype=S,L&&!o&&(S.constructor=I),r({global:!0,constructor:!0,wrap:!0,forced:L},{Number:I});var k=function(e,t){for(var n,r=i?y(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;r.length>o;o++)l(t,n=r[o])&&!l(e,n)&&g(e,n,m(t,n))};o&&E&&k(c[_],E),(L||o)&&k(c[_],x)},2477:function(e,t,n){n(9882)({target:"Object",stat:!0,sham:!n(7493)},{create:n(1569)})},3973:function(e,t,n){var r=n(9882),o=n(7493),i=n(6385).f;r({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!o},{defineProperty:i})},5090:function(e,t,n){var r=n(9882),o=n(746),i=n(9044),a=n(9612),c=n(744);r({target:"Object",stat:!0,forced:!o||i((function(){a.f(1)}))},{getOwnPropertySymbols:function(e){var t=a.f;return t?t(c(e)):[]}})},6908:function(e,t,n){var r=n(9882),o=n(9044),i=n(744),a=n(2654),c=n(5115);r({target:"Object",stat:!0,forced:o((function(){a(1)})),sham:!c},{getPrototypeOf:function(e){return a(i(e))}})},1879:function(e,t,n){n(9882)({target:"Object",stat:!0},{setPrototypeOf:n(2412)})},853:function(e,t,n){var r=n(7301),o=n(403),i=n(6699);r||o(Object.prototype,"toString",i,{unsafe:!0})},1321:function(e,t,n){var r=n(9882),o=n(9611),i=n(7676),a=n(9269),c=n(4443),u=n(5166);r({target:"Promise",stat:!0,forced:n(9581)},{all:function(e){var t=this,n=a.f(t),r=n.resolve,s=n.reject,l=c((function(){var n=i(t.resolve),a=[],c=0,l=1;u(e,(function(e){var i=c++,u=!1;l++,o(n,t,e).then((function(e){u||(u=!0,a[i]=e,--l||r(a))}),s)})),--l||r(a)}));return l.error&&s(l.value),n.promise}})},865:function(e,t,n){var r=n(9882),o=n(1178),i=n(5182).CONSTRUCTOR,a=n(5988),c=n(2773),u=n(5277),s=n(403),l=a&&a.prototype;if(r({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(e){return this.then(void 0,e)}}),!o&&u(a)){var f=c("Promise").prototype.catch;l.catch!==f&&s(l,"catch",f,{unsafe:!0})}},5999:function(e,t,n){var r,o,i,a=n(9882),c=n(1178),u=n(3921),s=n(8363),l=n(9611),f=n(403),d=n(2412),p=n(878),h=n(7323),v=n(7676),y=n(5277),m=n(2786),g=n(9519),b=n(7270),w=n(4643).set,_=n(1800),x=n(6271),E=n(4443),S=n(2423),T=n(821),C=n(5988),O=n(5182),L=n(9269),I="Promise",k=O.CONSTRUCTOR,A=O.REJECTION_EVENT,M=O.SUBCLASSING,j=T.getterFor(I),P=T.set,B=C&&C.prototype,N=C,R=B,F=s.TypeError,V=s.document,H=s.process,D=L.f,G=D,W=!!(V&&V.createEvent&&s.dispatchEvent),Z="unhandledrejection",U=function(e){var t;return!(!m(e)||!y(t=e.then))&&t},Y=function(e,t){var n,r,o,i=t.value,a=1===t.state,c=a?e.ok:e.fail,u=e.resolve,s=e.reject,f=e.domain;try{c?(a||(2===t.rejection&&Q(t),t.rejection=1),!0===c?n=i:(f&&f.enter(),n=c(i),f&&(f.exit(),o=!0)),n===e.promise?s(F("Promise-chain cycle")):(r=U(n))?l(r,n,u,s):u(n)):s(i)}catch(e){f&&!o&&f.exit(),s(e)}},X=function(e,t){e.notified||(e.notified=!0,_((function(){for(var n,r=e.reactions;n=r.get();)Y(n,e);e.notified=!1,t&&!e.rejection&&z(e)})))},J=function(e,t,n){var r,o;W?((r=V.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),s.dispatchEvent(r)):r={promise:t,reason:n},!A&&(o=s["on"+e])?o(r):e===Z&&x("Unhandled promise rejection",n)},z=function(e){l(w,s,(function(){var t,n=e.facade,r=e.value;if(K(e)&&(t=E((function(){u?H.emit("unhandledRejection",r,n):J(Z,n,r)})),e.rejection=u||K(e)?2:1,t.error))throw t.value}))},K=function(e){return 1!==e.rejection&&!e.parent},Q=function(e){l(w,s,(function(){var t=e.facade;u?H.emit("rejectionHandled",t):J("rejectionhandled",t,e.value)}))},q=function(e,t,n){return function(r){e(t,r,n)}},$=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,X(e,!0))},ee=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw F("Promise can't be resolved itself");var r=U(t);r?_((function(){var n={done:!1};try{l(r,t,q(ee,n,e),q($,n,e))}catch(t){$(n,t,e)}})):(e.value=t,e.state=1,X(e,!1))}catch(t){$({done:!1},t,e)}}};if(k&&(R=(N=function(e){g(this,R),v(e),l(r,this);var t=j(this);try{e(q(ee,t),q($,t))}catch(e){$(t,e)}}).prototype,(r=function(e){P(this,{type:I,done:!1,notified:!1,parent:!1,reactions:new S,rejection:!1,state:0,value:void 0})}).prototype=f(R,"then",(function(e,t){var n=j(this),r=D(b(this,N));return n.parent=!0,r.ok=!y(e)||e,r.fail=y(t)&&t,r.domain=u?H.domain:void 0,0===n.state?n.reactions.add(r):_((function(){Y(r,n)})),r.promise})),o=function(){var e=new r,t=j(e);this.promise=e,this.resolve=q(ee,t),this.reject=q($,t)},L.f=D=function(e){return e===N||void 0===e?new o(e):G(e)},!c&&y(C)&&B!==Object.prototype)){i=B.then,M||f(B,"then",(function(e,t){var n=this;return new N((function(e,t){l(i,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete B.constructor}catch(e){}d&&d(B,R)}a({global:!0,constructor:!0,wrap:!0,forced:k},{Promise:N}),p(N,I,!1,!0),h(I)},5054:function(e,t,n){n(5999),n(1321),n(865),n(7688),n(6055),n(9240)},7688:function(e,t,n){var r=n(9882),o=n(9611),i=n(7676),a=n(9269),c=n(4443),u=n(5166);r({target:"Promise",stat:!0,forced:n(9581)},{race:function(e){var t=this,n=a.f(t),r=n.reject,s=c((function(){var a=i(t.resolve);u(e,(function(e){o(a,t,e).then(n.resolve,r)}))}));return s.error&&r(s.value),n.promise}})},6055:function(e,t,n){var r=n(9882),o=n(9611),i=n(9269);r({target:"Promise",stat:!0,forced:n(5182).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return o(t.reject,void 0,e),t.promise}})},9240:function(e,t,n){var r=n(9882),o=n(2773),i=n(1178),a=n(5988),c=n(5182).CONSTRUCTOR,u=n(1621),s=o("Promise"),l=i&&!c;r({target:"Promise",stat:!0,forced:i||c},{resolve:function(e){return u(l&&this===s?a:this,e)}})},9275:function(e,t,n){var r=n(9882),o=n(9749);r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},5007:function(e,t,n){var r=n(1140).charAt,o=n(8967),i=n(821),a=n(8150),c=n(6145),u="String Iterator",s=i.set,l=i.getterFor(u);a(String,"String",(function(e){s(this,{type:u,string:o(e),index:0})}),(function(){var e,t=l(this),n=t.string,o=t.index;return o>=n.length?c(void 0,!0):(e=r(n,o),t.index+=e.length,c(e,!1))}))},5668:function(e,t,n){var r=n(9611),o=n(1492),i=n(3875),a=n(9903),c=n(5108),u=n(8967),s=n(6411),l=n(7219),f=n(3350),d=n(4088);o("match",(function(e,t,n){return[function(t){var n=s(this),o=a(t)?void 0:l(t,e);return o?r(o,t,n):new RegExp(t)[e](u(n))},function(e){var r=i(this),o=u(e),a=n(t,r,o);if(a.done)return a.value;if(!r.global)return d(r,o);var s=r.unicode;r.lastIndex=0;for(var l,p=[],h=0;null!==(l=d(r,o));){var v=u(l[0]);p[h]=v,""===v&&(r.lastIndex=f(o,c(r.lastIndex),s)),h++}return 0===h?null:p}]}))},7838:function(e,t,n){var r=n(3530),o=n(9611),i=n(8697),a=n(1492),c=n(3875),u=n(9903),s=n(2622),l=n(6411),f=n(7270),d=n(3350),p=n(5108),h=n(8967),v=n(7219),y=n(8990),m=n(4088),g=n(9749),b=n(7047),w=n(9044),_=b.UNSUPPORTED_Y,x=4294967295,E=Math.min,S=[].push,T=i(/./.exec),C=i(S),O=i("".slice),L=!w((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));a("split",(function(e,t,n){var i;return i="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var i=h(l(this)),a=void 0===n?x:n>>>0;if(0===a)return[];if(void 0===e)return[i];if(!s(e))return o(t,i,e,a);for(var c,u,f,d=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),v=0,m=new RegExp(e.source,p+"g");(c=o(g,m,i))&&!((u=m.lastIndex)>v&&(C(d,O(i,v,c.index)),c.length>1&&c.index=a));)m.lastIndex===c.index&&m.lastIndex++;return v===i.length?!f&&T(m,"")||C(d,""):C(d,O(i,v)),d.length>a?y(d,0,a):d}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:o(t,this,e,n)}:t,[function(t,n){var r=l(this),a=u(t)?void 0:v(t,e);return a?o(a,t,r,n):o(i,h(r),t,n)},function(e,r){var o=c(this),a=h(e),u=n(i,o,a,r,i!==t);if(u.done)return u.value;var s=f(o,RegExp),l=o.unicode,v=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(_?"g":"y"),y=new s(_?"^(?:"+o.source+")":o,v),g=void 0===r?x:r>>>0;if(0===g)return[];if(0===a.length)return null===m(y,a)?[a]:[];for(var b=0,w=0,S=[];w2?arguments[2]:void 0)}))},6887:function(e,t,n){var r=n(2089),o=n(8671).every,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("every",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},7353:function(e,t,n){var r=n(2089),o=n(5522),i=n(2802),a=n(6994),c=n(9611),u=n(8697),s=n(9044),l=r.aTypedArray,f=r.exportTypedArrayMethod,d=u("".slice);f("fill",(function(e){var t=arguments.length;l(this);var n="Big"===d(a(this),0,3)?i(e):+e;return c(o,this,n,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),s((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})))},6366:function(e,t,n){var r=n(2089),o=n(8671).filter,i=n(3687),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("filter",(function(e){var t=o(a(this),e,arguments.length>1?arguments[1]:void 0);return i(this,t)}))},5056:function(e,t,n){var r=n(2089),o=n(8671).findIndex,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("findIndex",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},2372:function(e,t,n){var r=n(2089),o=n(8671).find,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("find",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},3677:function(e,t,n){var r=n(2089),o=n(8671).forEach,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("forEach",(function(e){o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},7355:function(e,t,n){var r=n(2089),o=n(7190).includes,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("includes",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},8784:function(e,t,n){var r=n(2089),o=n(7190).indexOf,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("indexOf",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},8554:function(e,t,n){var r=n(8363),o=n(9044),i=n(8697),a=n(2089),c=n(4883),u=n(2280)("iterator"),s=r.Uint8Array,l=i(c.values),f=i(c.keys),d=i(c.entries),p=a.aTypedArray,h=a.exportTypedArrayMethod,v=s&&s.prototype,y=!o((function(){v[u].call([1])})),m=!!v&&v.values&&v[u]===v.values&&"values"===v.values.name,g=function(){return l(p(this))};h("entries",(function(){return d(p(this))}),y),h("keys",(function(){return f(p(this))}),y),h("values",g,y||!m,{name:"values"}),h(u,g,y||!m,{name:"values"})},2403:function(e,t,n){var r=n(2089),o=n(8697),i=r.aTypedArray,a=r.exportTypedArrayMethod,c=o([].join);a("join",(function(e){return c(i(this),e)}))},4312:function(e,t,n){var r=n(2089),o=n(3530),i=n(7837),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return o(i,a(this),t>1?[e,arguments[1]]:[e])}))},3444:function(e,t,n){var r=n(2089),o=n(8671).map,i=n(6107),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("map",(function(e){return o(a(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(i(e))(t)}))}))},6798:function(e,t,n){var r=n(2089),o=n(6596).right,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return o(i(this),e,t,t>1?arguments[1]:void 0)}))},70:function(e,t,n){var r=n(2089),o=n(6596).left,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return o(i(this),e,t,t>1?arguments[1]:void 0)}))},8036:function(e,t,n){var r=n(2089),o=r.aTypedArray,i=r.exportTypedArrayMethod,a=Math.floor;i("reverse",(function(){for(var e,t=this,n=o(t).length,r=a(n/2),i=0;i1?arguments[1]:void 0,1),n=u(e);if(y)return o(p,this,n,t);var r=this.length,i=a(n),s=0;if(i+t>r)throw l("Wrong length");for(;si;)s[i]=n[i++];return s}),i((function(){new Int8Array(1).slice()})))},2298:function(e,t,n){var r=n(2089),o=n(8671).some,i=r.aTypedArray;(0,r.exportTypedArrayMethod)("some",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},7306:function(e,t,n){var r=n(8363),o=n(5785),i=n(9044),a=n(7676),c=n(2013),u=n(2089),s=n(4631),l=n(442),f=n(1197),d=n(6929),p=u.aTypedArray,h=u.exportTypedArrayMethod,v=r.Uint16Array,y=v&&o(v.prototype.sort),m=!(!y||i((function(){y(new v(2),null)}))&&i((function(){y(new v(2),{})}))),g=!!y&&!i((function(){if(f)return f<74;if(s)return s<67;if(l)return!0;if(d)return d<602;var e,t,n=new v(516),r=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(y(n,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(n[e]!==r[e])return!0}));h("sort",(function(e){return void 0!==e&&a(e),g?y(this,e):c(p(this),function(e){return function(t,n){return void 0!==e?+e(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?1/t>0&&1/n<0?1:-1:t>n}}(e))}),!g||m)},5480:function(e,t,n){var r=n(2089),o=n(5108),i=n(2565),a=n(6107),c=r.aTypedArray;(0,r.exportTypedArrayMethod)("subarray",(function(e,t){var n=c(this),r=n.length,u=i(e,r);return new(a(n))(n.buffer,n.byteOffset+u*n.BYTES_PER_ELEMENT,o((void 0===t?r:i(t,r))-u))}))},4314:function(e,t,n){var r=n(8363),o=n(3530),i=n(2089),a=n(9044),c=n(5629),u=r.Int8Array,s=i.aTypedArray,l=i.exportTypedArrayMethod,f=[].toLocaleString,d=!!u&&a((function(){f.call(new u(1))}));l("toLocaleString",(function(){return o(f,d?c(s(this)):s(this),c(arguments))}),a((function(){return[1,2].toLocaleString()!==new u([1,2]).toLocaleString()}))||!a((function(){u.prototype.toLocaleString.call([1,2])})))},572:function(e,t,n){var r=n(2089).exportTypedArrayMethod,o=n(9044),i=n(8363),a=n(8697),c=i.Uint8Array,u=c&&c.prototype||{},s=[].toString,l=a([].join);o((function(){s.call({})}))&&(s=function(){return l(this)});var f=u.toString!==s;r("toString",s,f)},9627:function(e,t,n){n(6764)("Uint8",(function(e){return function(t,n,r){return e(this,t,n,r)}}))},6208:function(e,t,n){var r=n(8363),o=n(2848),i=n(9189),a=n(379),c=n(5899),u=function(e){if(e&&e.forEach!==a)try{c(e,"forEach",a)}catch(t){e.forEach=a}};for(var s in o)o[s]&&u(r[s]&&r[s].prototype);u(i)},8995:function(e,t,n){var r=n(8363),o=n(2848),i=n(9189),a=n(4883),c=n(5899),u=n(2280),s=u("iterator"),l=u("toStringTag"),f=a.values,d=function(e,t){if(e){if(e[s]!==f)try{c(e,s,f)}catch(t){e[s]=f}if(e[l]||c(e,l,t),o[t])for(var n in a)if(e[n]!==a[n])try{c(e,n,a[n])}catch(t){e[n]=a[n]}}};for(var p in o)d(r[p]&&r[p].prototype,p);d(i,"DOMTokenList")},5939:function(e){var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}v(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function s(e,t,n,r){var o,i,a,s;if(c(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=u(e))>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,s=l,console&&console.warn&&console.warn(s)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=l.bind(r);return o.listener=n,r.wrapFn=o,o}function d(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var s=u.length,l=h(u,s);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},6459:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.setLastICMessageTime=t.lastICMessageTime=t.delay=t.setBanned=t.banned=t.setExtraFeatures=t.extrafeatures=t.setSelectedShout=t.selectedShout=t.setSelectedMenu=t.selectedMenu=t.setOldLoading=t.oldLoading=t.UPDATE_INTERVAL=t.setClient=t.client=t.setCHATBOX=t.CHATBOX=void 0;var a,c=n(4891),u=n(237),s=n(5335),l=n(488),f=n(1300),d=n(740),p=n(5939),h=n(838),v=n(3453),y=n(5131),m=n(989),g=n(7643),b=(0,l.default)(),w=b.ip,_=b.mode,x=b.theme||"default";t.setCHATBOX=function(e){t.CHATBOX=e},t.setClient=function(e){t.client=e},t.UPDATE_INTERVAL=60,t.oldLoading=!1,t.setOldLoading=function(e){console.warn("old loading set to "+e),t.oldLoading=e},t.selectedMenu=1,t.setSelectedMenu=function(e){t.selectedMenu=e},t.selectedShout=0,t.setSelectedShout=function(e){t.selectedShout=e},t.extrafeatures=[],t.setExtraFeatures=function(e){t.extrafeatures=e},t.banned=!1,t.setBanned=function(e){t.banned=e},u.default.load().then((function(e){return e.get()})).then((function(e){a=e.visitorId,t.client=new E(w),t.client.connect(),(0,c.isLowMemory)(),(0,y.loadResources)()})),t.delay=function(e){return new Promise((function(t){return setTimeout(t,e)}))},t.lastICMessageTime=new Date(0),t.setLastICMessageTime=function(e){t.lastICMessageTime=e};var E=function(e){function n(t){var n=e.call(this)||this;return n.connect=function(){n.on("open",n.onOpen.bind(n)),n.on("close",n.onClose.bind(n)),n.on("message",n.onMessage.bind(n)),n.on("error",n.onError.bind(n)),"replay"!==_?(n.serv=new WebSocket("ws://".concat(t)),n.serv.addEventListener("open",n.emit.bind(n,"open")),n.serv.addEventListener("close",n.emit.bind(n,"close")),n.serv.addEventListener("message",n.emit.bind(n,"message")),n.serv.addEventListener("error",n.emit.bind(n,"error"))):n.joinServer()},n.hp=[0,0],n.playerID=1,n.charID=-1,n.char_list_length=0,n.evidence_list_length=0,n.music_list_length=0,n.testimonyID=0,n.chars=[],n.emotes=[],n.evidences=[],n.areas=[],n.musics=[],n.musics_time=!1,n.callwords=[],n.manifest=[],n.resources=(0,f.default)(m.AO_HOST,x),n.selectedEmote=-1,n.selectedEvidence=0,n.checkUpdater=null,n.sender=s.sender,n.viewport=(0,d.default)(),n._lastTimeICReceived=new Date(0),n.partial_packet=!1,n.temp_packet="",y.loadResources,c.isLowMemory,n}return o(n,e),Object.defineProperty(n.prototype,"character",{get:function(){return this.chars[this.charID]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"emote",{get:function(){return this.emotes[this.selectedEmote]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"evidence",{get:function(){return document.getElementById("button_present").classList.contains("dark")?this.selectedEvidence:0},enumerable:!1,configurable:!0}),n.prototype.handleSelf=function(e){var t=this,n=new MessageEvent("websocket",{data:e});setTimeout((function(){return t.onMessage(n)}),1)},n.prototype.joinServer=function(){var e=this;this.sender.sendServer("HI#".concat(a,"#%")),"replay"!==_&&(this.checkUpdater=setInterval((function(){return e.sender.sendCheck()}),5e3))},n.prototype.onOpen=function(e){t.client.joinServer()},n.prototype.onClose=function(e){console.error("The connection was closed: ".concat(e.reason," (").concat(e.code,")")),0==t.extrafeatures.length&&!1===t.banned&&(document.getElementById("client_errortext").textContent="Could not connect to the server"),document.getElementById("client_waiting").style.display="block",document.getElementById("client_error").style.display="flex",document.getElementById("client_loading").style.display="none",document.getElementById("error_id").textContent=String(e.code),this.cleanup()},n.prototype.onMessage=function(e){var t=e.data;console.debug("S: ".concat(t)),this.handle_server_packet(t)},n.prototype.handle_server_packet=function(e){var t,n,r=e;if(!e.endsWith("%"))return this.partial_packet=!0,this.temp_packet=this.temp_packet+r,void console.log("Partial packet");this.partial_packet&&(r=this.temp_packet+r,this.temp_packet="",this.partial_packet=!1);var o=r.split("%");try{for(var a=i(o),c=a.next();!c.done;c=a.next()){var u,s=c.value;if(0!=(u=s.endsWith("#")?s.slice(0,-1).split("#"):s.split("#")).length){var l=u[0];""!==l&&(v.packetHandler.has(l)?v.packetHandler.get(l)(u):console.warn("Invalid packet header ".concat(l)))}else console.warn("WARNING: Empty packet received from server, skipping...")}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}},n.prototype.onError=function(e){console.error("A network error occurred"),document.getElementById("client_error").style.display="flex",this.cleanup()},n.prototype.cleanup=function(){clearInterval(this.checkUpdater),this.serv.close()},n.prototype.handleReplay=function(){var e=document.getElementById("client_ooclog"),t=Number(document.getElementById("client_replaytimer").value),n=e.value.split(/\r?\n/);if(n[0]){var r=String(n[0]);this.handleSelf(r),e.value=n.slice(1).join("\r\n"),"wait"===r.substr(0,4)?t=Number(r.split("#")[1]):"MS"!==r.substr(0,2)&&(t=0),setTimeout((function(){return(0,h.onReplayGo)(null)}),t)}},n.prototype.resetMusicList=function(){this.musics=[],document.getElementById("client_musiclist").innerHTML=""},n.prototype.resetAreaList=function(){this.areas=[],document.getElementById("areas").innerHTML="",(0,g.fetchBackgroundList)(),(0,g.fetchEvidenceList)(),(0,g.fetchCharacterList)()},n}(p.EventEmitter);t.default=E},9669:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.addTrack=void 0;var r=n(6459),o=n(164),i=n(6624);t.addTrack=function(e){var t=document.createElement("OPTION"),n=(0,i.getFilenameFromPath)(e);t.text=(0,o.unescapeChat)(n),t.value=e,document.getElementById("client_musiclist").options.add(t),r.client.musics.push(e)}},989:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.setAOhost=t.AO_HOST=void 0;var r=(0,n(488).default)().asset;t.AO_HOST=r||"http://attorneyoffline.de/base/",t.setAOhost=function(e){t.AO_HOST=e}},9442:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.appendICLog=void 0;var r=n(6459);t.appendICLog=function(e,t,n,o){void 0===t&&(t=""),void 0===n&&(n=""),void 0===o&&(o=new Date);var i=document.createElement("p"),a=document.createElement("span"),c=document.createElement("span"),u=document.createElement("span");if(c.className="iclog_name iclog_nameplate",c.appendChild(document.createTextNode(n)),a.className="iclog_name iclog_showname",""!==t&&t?a.appendChild(document.createTextNode(t)):a.appendChild(document.createTextNode(n)),u.className="iclog_text",u.appendChild(document.createTextNode(e)),i.appendChild(a),i.appendChild(c),i.appendChild(u),r.lastICMessageTime.getMinutes()!==o.getMinutes()){var s=document.createElement("span");s.className="iclog_time",s.innerText=o.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),i.appendChild(s)}var l=document.getElementById("client_log");l.appendChild(i),l.scrollTop>l.scrollHeight-800&&(l.scrollTop=l.scrollHeight),(0,r.setLastICMessageTime)(new Date)}},5693:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.checkCallword=void 0;var r=n(6459),o=n(989);t.checkCallword=function(e,t){r.client.callwords.forEach((function(n){""!==n&&e.toLowerCase().includes(n.toLowerCase())&&(t.pause(),t.src="".concat(o.AO_HOST,"sounds/general/sfx-gallery.opus"),t.play())}))}},8605:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createArea=void 0;var r=n(6459),o=n(3757);t.createArea=function(e,t){var n={name:t,players:0,status:"IDLE",cm:"",locked:"FREE"};r.client.areas.push(n);var i=document.createElement("SPAN");i.className="area-button area-default",i.id="area".concat(e),i.innerText=n.name,i.title="Players: ".concat(n.players,"\n")+"Status: ".concat(n.status,"\n")+"CM: ".concat(n.cm,"\n")+"Area lock: ".concat(n.locked),i.onclick=function(){(0,o.area_click)(i)},document.getElementById("areas").appendChild(i)}},7643:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]0){var e=r.client.areas.pop().name,t=document.getElementById("areas");t.removeChild(t.lastChild),(0,o.addTrack)(e)}}},7619:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.handleBans=void 0,t.handleBans=function(e,t){document.getElementById("client_error").style.display="flex",document.getElementById("client_errortext").innerHTML="".concat(e,":
").concat(t.replace(/\n/g,"
")),document.getElementById("client_reconnect").style.display="none",alert(e+":\r"+t)}},2651:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]").concat(_):w;"replay"===a&&(A="##",M="#0#0"),k="".concat((0,o.escapeChat)(g),"#").concat(b).concat(A,"#").concat(B).concat(M,"#").concat(Number(x),"#"),r.extrafeatures.includes("looping_sfx")&&(j="".concat(Number(E),"#").concat(Number(S),"#").concat(T,"#").concat(C,"#").concat(O,"#"),r.extrafeatures.includes("effects")&&(P="".concat(Number(L),"#").concat((0,o.escapeChat)(I),"#")))}var N="MS#".concat(e,"#").concat((0,o.escapeChat)(t),"#").concat((0,o.escapeChat)(n),"#").concat((0,o.escapeChat)(c))+"#".concat((0,o.escapeChat)(u),"#").concat((0,o.escapeChat)(s),"#").concat((0,o.escapeChat)(l),"#").concat(f)+"#".concat(i.client.charID,"#").concat(d,"#").concat(Number(p),"#").concat(Number(h),"#").concat(Number(v),"#").concat(Number(y),"#").concat(m,"#").concat(k).concat(j).concat(P,"%");i.client.sender.sendServer(N),"replay"===a&&(document.getElementById("client_ooclog").value+="wait#".concat(document.getElementById("client_replaytimer").value,"#%\r\n"))}},1263:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sendMusicChange=void 0;var r=n(6459);t.sendMusicChange=function(e){r.client.sender.sendServer("MC#".concat(e,"#").concat(r.client.charID,"#%"))}},2340:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sendOOC=void 0;var r=n(6459),o=n(164),i=n(2557),a=n(6066);t.sendOOC=function(e){(0,i.default)("OOC_name",document.getElementById("OOC_name").value);var t="".concat((0,o.escapeChat)(document.getElementById("OOC_name").value)),n="".concat((0,o.escapeChat)(e)),c={"/save_chatlog":a.saveChatlogHandle},u=new Map(Object.entries(c));if(n&&u.has(n.toLowerCase()))try{u.get(n.toLowerCase())()}catch(e){}else r.client.sender.sendServer("CT#".concat(t,"#").concat(n,"#%"))}},154:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sendPE=void 0;var r=n(6459),o=n(164);t.sendPE=function(e,t,n){r.client.sender.sendServer("PE#".concat((0,o.escapeChat)(e),"#").concat((0,o.escapeChat)(t),"#").concat((0,o.escapeChat)(n),"#%"))}},366:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sendRT=void 0;var r=n(6459);t.sendRT=function(e){r.client.sender.sendServer("RT#".concat(e,"#%"))}},2917:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sendSelf=void 0;var r=n(6459);t.sendSelf=function(e){document.getElementById("client_ooclog").value+="".concat(e,"\r\n"),r.client.handleSelf(e)}},7371:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sendServer=void 0;var r=n(6459),o=(0,n(488).default)().mode;t.sendServer=function(e){console.debug("C: "+e),"replay"===o?r.client.sender.sendSelf(e):r.client.serv.send(e)}},3723:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.sendZZ=void 0;var r=n(6459);t.sendZZ=function(e){r.extrafeatures.includes("modcall_reason")?r.client.sender.sendServer("ZZ#".concat(e,"#%")):r.client.sender.sendServer("ZZ#%")}},9028:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var a=n(8481),c=n(1198);t.default=function(e,t,n,u,s,l,f){return r(void 0,void 0,void 0,(function(){var r,d,p,h,v,y,m,g,b,w,_,x;return o(this,(function(o){switch(o.label){case 0:r=l?"pair":"char",d="".concat(e,"characters/"),p=["def","pro","wit"].includes(f)?"".concat(f,"_"):"",h=document.getElementById("client_".concat(p).concat(r,"_img")),v=[".gif",".png",".apng",".webp",".webp.static"],o.label=1;case 1:o.trys.push([1,6,7,8]),y=i(v),m=y.next(),o.label=2;case 2:return m.done?[3,5]:(g=m.value,t.viewport.getLastCharacter()!==t.viewport.getChatmsg().name&&(h.src=a.default),b=void 0,b=".png"===g?"".concat(d).concat(encodeURI(n),"/").concat(encodeURI(u)).concat(g):".webp.static"===g?"".concat(d).concat(encodeURI(n),"/").concat(encodeURI(u),".webp"):"".concat(d).concat(encodeURI(n),"/").concat(encodeURI(s)).concat(encodeURI(u)).concat(g),[4,(0,c.default)(b)]);case 3:if(o.sent())return h.src=b,[3,5];o.label=4;case 4:return m=y.next(),[3,2];case 5:return[3,8];case 6:return w=o.sent(),_={error:w},[3,8];case 7:try{m&&!m.done&&(x=y.return)&&x.call(y)}finally{if(_)throw _.error}return[7];case 8:return[2]}}))}))}},3757:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.area_click=void 0;var r=n(6459);function o(e){var t=r.client.areas[e.id.substr(4)].name;r.client.sender.sendMusicChange(t);var n=document.createElement("div");n.className="hrtext",n.textContent="switched to ".concat(e.textContent),document.getElementById("client_log").appendChild(n)}t.area_click=o,window.area_click=o},1649:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.changeBlipVolume=void 0;var r=n(2557),o=n(6459);t.changeBlipVolume=function(){var e=document.getElementById("client_bvolume").value;o.client.viewport.blipChannels.forEach((function(t){return t.volume=Number(e)})),(0,r.default)("blipVolume",e)},window.changeBlipVolume=t.changeBlipVolume},5524:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.changeMusicVolume=void 0;var r=n(6459),o=n(2557);t.changeMusicVolume=function(e){void 0===e&&(e=-1);var t=Number(document.getElementById("client_mvolume").value),n=-1===e?t:e;r.client.viewport.music.forEach((function(e){return e.volume=n})),(0,o.default)("musicVolume",String(n))},window.changeMusicVolume=t.changeMusicVolume},1619:function(e,t){function n(e,t){for(var n=document.getElementById(e),r=1;r1,document.getElementById("sendpreanim").checked=1==r.client.emote.zoom}t.pickEmotion=o,window.pickEmotion=o},7549:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.reloadTheme=void 0;var r=n(6459),o=n(2557);t.reloadTheme=function(){r.client.viewport.setTheme(document.getElementById("client_themeselect").value),(0,o.default)("theme",r.client.viewport.getTheme()),document.getElementById("client_theme").href="styles/".concat(r.client.viewport.getTheme(),".css")},window.reloadTheme=t.reloadTheme},4923:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.resizeChatbox=void 0;var r=n(6459);function o(){var e=document.getElementById("client_chatcontainer"),t=document.getElementById("client_clock"),n=document.getElementById("client_trackstatus"),o=document.getElementById("client_background").offsetHeight;e.style.fontSize="".concat((.0521*o).toFixed(1),"px"),t.style.fontSize="".concat((.0521*o).toFixed(1),"px"),n.style.fontSize="".concat((.0521*o).toFixed(1),"px");var i=document.getElementById("client_trackstatustext");i.style.width=i.offsetWidth-1+"px";var a=new Date,c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];document.getElementById("client_clock_month").innerText=["January","February","March","April","May","June","July","August","September","October","November","December"][a.getMonth()],"acww"==r.CHATBOX?(c=["Su","Mo","Tu","We","Th","Fr","Sa"],document.getElementById("client_clock_weekday").innerText=c[a.getDay()],document.getElementById("client_clock_date").innerText=a.getDay()+"/"+a.getMonth(),document.getElementById("client_clock_time").innerText=a.getHours()+":"+a.getMinutes()):"key"==r.CHATBOX&&(c=["Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."],document.getElementById("client_clock_weekday").innerText=c[a.getDay()],document.getElementById("client_clock_date").innerText=String(a.getDate()))}t.resizeChatbox=o,window.resizeChatbox=o},3170:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.setChatbox=void 0;var r=n(6459),o=n(8999),i=n(2557);function a(e){var t=document.getElementById("chatbox_theme"),n=document.getElementById("client_chatboxselect");if((0,r.setCHATBOX)(n.value),(0,i.default)("chatbox",r.CHATBOX),"dynamic"===r.CHATBOX){var a=e.replace("chat","");o.default.includes(a)?t.href="styles/chatbox/".concat(a,".css"):t.href="styles/chatbox/aa.css"}else t.href="styles/chatbox/".concat(r.CHATBOX,".css")}t.setChatbox=a,window.setChatbox=a},5058:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.showname_click=void 0;var r=n(2557);function o(e){(0,r.default)("showname",String(document.getElementById("showname").checked)),(0,r.default)("ic_chat_name",document.getElementById("ic_chat_name").value);var t=document.getElementById("nameplate_setting");document.getElementById("showname").checked?t.href="styles/shownames.css":t.href="styles/nameplates.css"}t.showname_click=o,window.showname_click=o},9209:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.showFactorDialog=void 0;var r=n(6459);window.handleCredentialResponse=function(e){r.client.sender.sendServer("2T#".concat(e.credential,"#%"))},t.showFactorDialog=function(e){document.getElementById("client_secondfactor").style.display=e[1]}},2281:function(e,t){function n(e){"jud"===e?(document.getElementById("judge_action").style.display="inline-table",document.getElementById("no_action").style.display="none"):(document.getElementById("judge_action").style.display="none",document.getElementById("no_action").style.display="inline-table");for(var t=0,n=document.getElementById("role_select");t","#").replaceAll("","&").replaceAll("","%").replaceAll("","$")}function r(e){return e?e.replaceAll(">",">").replaceAll("<","<"):""}function o(e){return e.replace(/\\u([\d\w]{1,})/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))}Object.defineProperty(t,"__esModule",{value:!0}),t.prepChat=t.decodeChat=t.safeTags=t.unescapeChat=t.escapeChat=void 0,t.escapeChat=function(e){return e.replaceAll("#","").replaceAll("&","").replaceAll("%","").replaceAll("$","")},t.unescapeChat=n,t.safeTags=r,t.decodeChat=o,t.prepChat=function(e){return r(n(o(e)))}},7207:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleARUP=void 0;var r=n(6459),o=n(164);t.handleARUP=function(e){e=e.slice(1);for(var t=0;tt.scrollHeight-600&&(t.scrollTop=t.scrollHeight)}}},4914:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleCharsCheck=void 0;var r=n(6459);t.handleCharsCheck=function(e){for(var t=0;t=0?(t=o.client.chars[c].name,(0,a.appendICLog)("".concat(t," changed music to ").concat(n))):(0,a.appendICLog)("The music was changed to ".concat(n)),document.getElementById("client_trackstatustext").innerText=n}},3765:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.handleMM=void 0,t.handleMM=function(e){}},2639:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleMS=void 0;var r=n(6459),o=n(2651),i=n(2062),a=n(164),c=n(6991);t.handleMS=function(e){if(e[4]!==r.client.viewport.getChatmsg().content){document.getElementById("client_inner_chat").innerHTML="";var t=Number(e[9]),n=(0,a.safeTags)(e[3]),u=e[3],s="male",l="default",f=!1;if(t=0&&r.client.chars[t].name!==n){console.info("".concat(r.client.chars[t].name," is iniediting to ").concat(n));var d=("".concat(n,"&")+"iniediter").split("&");(0,o.handleCharacterInfo)(d,t)}try{u=r.client.chars[t].showname}catch(t){u=e[3]}try{s=r.client.chars[t].blips}catch(e){}try{l=r.client.chars[t].chat}catch(e){l="default"}try{f=r.client.chars[t].muted}catch(e){f=!1,console.error("we're still missing some character data")}if(!1===f){var p={deskmod:Number((0,a.safeTags)(e[1]).toLowerCase()),preanim:(0,a.safeTags)(e[2]).toLowerCase(),nameplate:u,chatbox:l,name:n,sprite:(0,a.safeTags)(e[4]).toLowerCase(),content:(0,a.prepChat)(e[5]),side:e[6].toLowerCase(),sound:(0,a.safeTags)(e[7]).toLowerCase(),blips:(0,a.safeTags)(s),type:Number(e[8]),charid:t,snddelay:Number(e[10]),objection:Number(e[11]),evidence:Number((0,a.safeTags)(e[12])),flip:Number(e[13]),flash:Number(e[14]),color:Number(e[15]),speed:r.UPDATE_INTERVAL};if(e.length>16){var h={showname:(0,a.prepChat)(e[16]),other_charid:Number(e[17]),other_name:(0,a.safeTags)(e[18]),other_emote:(0,a.safeTags)(e[19]),self_offset:e[20].split(""),other_offset:e[21].split(""),other_flip:Number(e[22]),noninterrupting_preanim:Number(e[23])};if(p=Object.assign(h,p),e.length>24){var v={looping_sfx:Number(e[24]),screenshake:Number(e[25]),frame_screenshake:(0,a.safeTags)(e[26]),frame_realization:(0,a.safeTags)(e[27]),frame_sfx:(0,a.safeTags)(e[28])};if(p=Object.assign(v,p),e.length>29){var y={additive:Number(e[29]),effects:e[30].split("|")};p=Object.assign(y,p)}else y={additive:0,effects:["","",""]},p=Object.assign(y,p)}else v={looping_sfx:0,screenshake:0,frame_screenshake:"",frame_realization:"",frame_sfx:""},p=Object.assign(v,p),y={additive:0,effects:["","",""]},p=Object.assign(y,p)}else h={showname:"",other_charid:0,other_name:"",other_emote:"",self_offset:[0,0],other_offset:[0,0],other_flip:0,noninterrupting_preanim:0},p=Object.assign(h,p),v={looping_sfx:0,screenshake:0,frame_screenshake:"",frame_realization:"",frame_sfx:""},p=Object.assign(v,p),y={additive:0,effects:["","",""]},p=Object.assign(y,p);""===p.content.trim()&&(p.content=""),p.charid===r.client.charID&&(0,i.resetICParams)(),(0,c.handle_ic_speaking)(p)}}}},8278:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handlePN=void 0;var r=n(6459);t.handlePN=function(e){r.client.sender.sendServer("askchaa#%")}},358:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]No emotes available';else{for(f=function(e){try{var o=l.emotions[e].split("#"),i=void 0,a=void 0;try{i=l.soundn[e]||"0",a=Number(l.soundt[e])||0}catch(e){console.warn("ini sound is completly missing"),i="0",a=0}n[e]={desc:o[0].toLowerCase(),preanim:o[1].toLowerCase(),emote:o[2].toLowerCase(),zoom:Number(o[3])||0,deskmod:Number(o[4])||1,sfx:i.toLowerCase(),sfxdelay:a,frame_screenshake:"",frame_realization:"",frame_sfx:"",button:"".concat(s.AO_HOST,"characters/").concat(encodeURI(t.name.toLowerCase()),"/emotions/button").concat(e,"_off.png")};var c=new Image;c.id="emo_"+e,c.className="emote_button",c.src=n[e].button,c.alt=n[e].desc,c.title=n[e].desc,c.onclick=function(){window.pickEmotion(e)},r.appendChild(c)}catch(t){console.error("missing emote ".concat(e))}},d=1;d<=l.emotions.number;d++)f(d);(0,u.pickEmotion)(1)}return[4,(0,a.default)("".concat(s.AO_HOST,"characters/").concat(encodeURI(t.name.toLowerCase()),"/custom.gif"))];case 1:return o.sent()?document.getElementById("button_4").style.display="":document.getElementById("button_4").style.display="none",[2]}}))}))}},6310:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleRC=void 0;var r=n(6459),o=n(9585);t.handleRC=function(e){r.client.sender.sendSelf("SC#".concat(o.default.join("#"),"#%"))}},2014:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleRD=void 0;var r=n(6459);t.handleRD=function(e){r.client.sender.sendSelf("BN#gs4#%"),r.client.sender.sendSelf("DONE#%");var t=document.getElementById("client_ooclog");t.value="",t.readOnly=!1,document.getElementById("client_oocinput").style.display="none",document.getElementById("client_replaycontrols").style.display="inline-block"}},9122:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleRM=void 0;var r=n(6459),o=n(6246);t.handleRM=function(e){r.client.sender.sendSelf("SM#".concat(o.default.join("#"),"#%"))}},1912:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleRMC=void 0;var r=n(6459);t.handleRMC=function(e){r.client.viewport.music.pause();var t=r.client.viewport.music;t.totime=e[1],t.offset=(new Date).getTime()/1e3,t.addEventListener("loadedmetadata",(function(){t.currentTime+=parseFloat(t.totime+((new Date).getTime()/1e3-t.offset)).toFixed(3),t.play()}),!1)}},7124:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleRT=void 0;var r=n(6459),o=n(309);t.handleRT=function(e){var t=Number(e[2]);switch(e[1]){case"testimony1":r.client.testimonyID=1;break;case"testimony2":r.client.testimonyID=2;break;case"judgeruling":r.client.testimonyID=3+t;break;default:console.warn("Invalid testimony")}(0,o.initTestimonyUpdater)()}},8710:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]t.scrollHeight-60&&(t.scrollTop=t.scrollHeight),r.client.viewport.getSfxAudio().pause();var n=r.client.viewport.getSfxAudio().volume;r.client.viewport.getSfxAudio().volume=1,r.client.viewport.getSfxAudio().src="".concat(o.AO_HOST,"sounds/general/sfx-gallery.opus"),r.client.viewport.getSfxAudio().play(),r.client.viewport.getSfxAudio().volume=n}},9208:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleackMS=void 0;var r=n(2062);t.handleackMS=function(){(0,r.resetICParams)()}},6661:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.handleaskchaa=void 0;var r=n(6459),o=n(9585);t.handleaskchaa=function(e){r.client.sender.sendSelf("SI#".concat(o.default.length,"#0#0#%"))}},3453:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.packetHandler=void 0;var r=n(4592);t.packetHandler=new Map(Object.entries(r.packets))},4592:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.packets=void 0;var r=n(2639),o=n(3267),i=n(7247),a=n(1912),c=n(9209),u=n(8915),s=n(3699),l=n(2122),f=n(3770),d=n(8710),p=n(2781),h=n(3103),v=n(4629),y=n(9747),m=n(3765),g=n(6420),b=n(8631),w=n(872),_=n(8239),x=n(766),E=n(5649),S=n(2543),T=n(7124),C=n(3645),O=n(2371),L=n(5270),I=n(4142),k=n(8278),A=n(831),M=n(7207),j=n(6661),P=n(2685),B=n(6310),N=n(9122),R=n(2014),F=n(4914),V=n(358),H=n(1182),D=n(9208),G=n(9498),W=n(5944);t.packets={MS:r.handleMS,CT:o.handleCT,MC:i.handleMC,RMC:a.handleRMC,CI:p.handleCI,SC:d.handleSC,EI:f.handleEI,"2A":c.showFactorDialog,FL:u.handleFL,LE:s.handleLE,EM:l.handleEM,FM:h.handleFM,FA:v.handleFA,SM:y.handleSM,MM:m.handleMM,BD:g.handleBD,BB:b.handleBB,KB:w.handleKB,KK:_.handleKK,DONE:x.handleDONE,BN:E.handleBN,HP:S.handleHP,RT:T.handleRT,TI:C.handleTI,ZZ:O.handleZZ,HI:L.handleHI,ID:I.handleID,PN:k.handlePN,SI:A.handleSI,ARUP:M.handleARUP,askchaa:j.handleaskchaa,CC:P.handleCC,RC:B.handleRC,RM:N.handleRM,RD:R.handleRD,CharsCheck:F.handleCharsCheck,PV:V.handlePV,ASS:H.handleASS,ackMS:D.handleackMS,SP:G.handleSP,JD:W.handleJD,decryptor:function(){},CHECK:function(){},CH:function(){}}},4355:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=document.createElement("a"),r=new Blob([e],{type:"text"});n.href=URL.createObjectURL(r),n.download=t,n.click()}},2567:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0});var c=n(7659);t.default=function(e){var t="".concat(e,"themes/default/chat_config.ini"),n=(0,c.default)(t).then((function(e){return function(e){var t,n,r={},o="";try{for(var a=i(e.split(/\r?\n/)),c=a.next();!c.done;c=a.next()){var u=c.value;if(""!==u){var s=u.split(" = "),l=s[0],f=s[1];if(""===o)r[o=l]={color:f};else{var d=l.split("_")[1];r[o][d]=f}}else o=""}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r}(e)}));return{applyMarkdown:function(e,t){return r(void 0,void 0,void 0,(function(){var c,u,s,l,f,d,p,h,v,y,m,g,b,w,_,x,E,S,T;return o(this,(function(C){switch(C.label){case 0:return[4,r(void 0,void 0,void 0,(function(){var e,t,r,c,u,s,l,f,d,p;return o(this,(function(o){switch(o.label){case 0:e=new Map,o.label=1;case 1:return o.trys.push([1,6,7,8]),u=(c=Object).entries,[4,n];case 2:t=i.apply(void 0,[u.apply(c,[o.sent()])]),r=t.next(),o.label=3;case 3:if(r.done)return[3,5];(s=a(r.value,2))[0],(l=s[1]).start&&l.end&&(e.set(l.start,l),e.set(l.end,l)),o.label=4;case 4:return r=t.next(),[3,3];case 5:return[3,8];case 6:return f=o.sent(),d={error:f},[3,8];case 7:try{r&&!r.done&&(p=t.return)&&p.call(t)}finally{if(d)throw d.error}return[7];case 8:return[2,e]}}))}))];case 1:return c=C.sent(),[4,r(void 0,void 0,void 0,(function(){var e,t,r,c,u,s,l,f,d,p;return o(this,(function(o){switch(o.label){case 0:e=new Set,o.label=1;case 1:return o.trys.push([1,6,7,8]),u=(c=Object).entries,[4,n];case 2:t=i.apply(void 0,[u.apply(c,[o.sent()])]),r=t.next(),o.label=3;case 3:if(r.done)return[3,5];(s=a(r.value,2))[0],(null==(l=s[1])?void 0:l.start)&&(null==l?void 0:l.end)&&e.add(l.start),o.label=4;case 4:return r=t.next(),[3,3];case 5:return[3,8];case 6:return f=o.sent(),d={error:f},[3,8];case 7:try{r&&!r.done&&(p=t.return)&&p.call(t)}finally{if(d)throw d.error}return[7];case 8:return[2,e]}}))}))];case 2:u=C.sent(),s=[],l=[],f=[];try{for(d=i(e),p=d.next();!p.done;p=d.next())h=p.value,v=document.createElement("span"),y=c.get(h),m=s[s.length-1],g=0===Number(null==y?void 0:y.remove),m===h?(w=l[l.length-1][0],_=l[l.length-1][1],x=l[l.length-1][2],E="color: rgb(".concat(w,",").concat(_,",").concat(x,");"),v.setAttribute("style",E),s.pop(),l.pop(),g&&(v.innerHTML=h)):u.has(h)?(b=c.get(h).color.split(","),w=b[0],_=b[1],x=b[2],l.push([w,_,x]),s.push(y.end),E="color: rgb(".concat(w,",").concat(_,",").concat(x,");"),v.setAttribute("style",E),g&&(v.innerHTML=h)):(v.innerHTML=h,0===l.length?v.className="text_".concat(t):(w=l[l.length-1][0],_=l[l.length-1][1],x=l[l.length-1][2],E="color: rgb(".concat(w,",").concat(_,",").concat(x,");"),v.setAttribute("style",E))),f.push(v)}catch(e){S={error:e}}finally{try{p&&!p.done&&(T=d.return)&&T.call(d)}finally{if(S)throw S.error}}return[2,f]}}))}))}}}},5223:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){try{for(var t="".concat(e,"="),n=decodeURIComponent(document.cookie).split(";"),r=0;r0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.handle_ic_speaking=t.setStartThirdTickCheck=t.startThirdTickCheck=t.setStartSecondTickCheck=t.startSecondTickCheck=t.setStartFirstTickCheck=t.startFirstTickCheck=void 0;var a=n(6459),c=n(9442),u=n(5693),s=n(9028),l=n(989),f=n(2496),d=n(9980),p=n(3170),h=n(4923),v=n(8481),y=n(7635),m=(0,n(2567).default)(l.AO_HOST);t.setStartFirstTickCheck=function(e){t.startFirstTickCheck=e},t.setStartSecondTickCheck=function(e){t.startSecondTickCheck=e},t.setStartThirdTickCheck=function(e){t.startThirdTickCheck=e},t.handle_ic_speaking=function(e){return r(void 0,void 0,void 0,(function(){var n,r,g,b,w,_,x,E,S,T,C,O,L,I,k,A,M,j,P,B,N,R,F,V,H,D,G,W,Z;return o(this,(function(o){switch(o.label){case 0:return a.client.viewport.setChatmsg(e),a.client.viewport.setTextNow(""),a.client.viewport.setSfxPlayed(0),a.client.viewport.setTickTimer(0),a.client.viewport.setAnimating(!0),t.startFirstTickCheck=!0,t.startSecondTickCheck=!1,t.startThirdTickCheck=!1,n=document.getElementById("client_char"),r=document.getElementById("client_pair_char"),clearTimeout(a.client.viewport.updater),a.client.viewport.getSfxAudio().loop=!1,g=document.getElementById("client_fg"),b=document.getElementById("client_gamewindow"),w=document.getElementById("client_chatwaiting"),b.style.animation="",w.style.opacity="0",_=document.getElementById("client_evi"),a.client.viewport.getLastEvidence()!==a.client.viewport.getChatmsg().evidence&&(_.style.opacity="0",_.style.height="0%"),a.client.viewport.setLastEvidence(a.client.viewport.getChatmsg().evidence),["def","pro","wit"].includes(a.client.viewport.getChatmsg().side)&&(n=document.getElementById("client_".concat(a.client.viewport.getChatmsg().side,"_char")),r=document.getElementById("client_".concat(a.client.viewport.getChatmsg().side,"_pair_char"))),x=document.getElementById("client_chatcontainer"),E=document.getElementById("client_inner_name"),S=document.getElementById("client_inner_chat"),T=document.getElementById("showname").checked&&""!==a.client.viewport.getChatmsg().showname?a.client.viewport.getChatmsg().showname:a.client.viewport.getChatmsg().nameplate,S.innerText=a.client.viewport.getTextNow(),E.innerText=T,a.client.viewport.getLastCharacter()!==a.client.viewport.getChatmsg().name&&(n.style.opacity="0",r.style.opacity="0"),a.client.viewport.setLastCharacter(a.client.viewport.getChatmsg().name),(0,c.appendICLog)(a.client.viewport.getChatmsg().content,a.client.viewport.getChatmsg().showname,a.client.viewport.getChatmsg().nameplate),(0,u.checkCallword)(a.client.viewport.getChatmsg().content,a.client.viewport.getSfxAudio()),(0,s.default)(l.AO_HOST,a.client,a.client.viewport.getChatmsg().name.toLowerCase(),a.client.viewport.getChatmsg().sprite,"(a)",!1,a.client.viewport.getChatmsg().side),a.client.viewport.getChatmsg().other_name&&(0,s.default)(l.AO_HOST,a.client,a.client.viewport.getChatmsg().other_name.toLowerCase(),a.client.viewport.getChatmsg().other_emote,"(a)",!1,a.client.viewport.getChatmsg().side),C=document.getElementById("client_shout"),(O=f.SHOUTS[a.client.viewport.getChatmsg().objection])?(x.style.opacity="0",4===a.client.viewport.getChatmsg().objection?C.src="".concat(l.AO_HOST,"characters/").concat(encodeURI(a.client.viewport.getChatmsg().name.toLowerCase()),"/custom.gif"):(C.src=a.client.resources[O].src,C.style.animation="bubble 700ms steps(10, jump-both)"),C.style.opacity="1",a.client.viewport.shoutaudio.src="".concat(l.AO_HOST,"characters/").concat(encodeURI(a.client.viewport.getChatmsg().name.toLowerCase()),"/").concat(O,".opus"),a.client.viewport.shoutaudio.play(),a.client.viewport.setShoutTimer(a.client.resources[O].duration)):a.client.viewport.setShoutTimer(0),a.client.viewport.getChatmsg().startpreanim=!0,L=0,1!==a.client.viewport.getChatmsg().type||"-"===a.client.viewport.getChatmsg().preanim?[3,2]:(x.style.opacity="0",[4,(0,d.default)("".concat(l.AO_HOST,"characters/").concat(encodeURI(a.client.viewport.getChatmsg().name.toLowerCase()),"/").concat(encodeURI(a.client.viewport.getChatmsg().preanim)))]);case 1:return L=o.sent(),a.client.viewport.getChatmsg().startspeaking=!1,[3,3];case 2:a.client.viewport.getChatmsg().startspeaking=!0,""!==a.client.viewport.getChatmsg().content.trim()&&(x.style.opacity="1"),o.label=3;case 3:if(a.client.viewport.getChatmsg().preanimdelay=L,I={position:a.client.viewport.getChatmsg().side,showSpeedLines:!1,showDesk:!1},k=!1,5===a.client.viewport.getChatmsg().type)I.showSpeedLines=!0,I.showDesk=!1,a.client.viewport.set_side(I);else switch(Number(a.client.viewport.getChatmsg().deskmod)){case 0:case 2:case 3:I.showSpeedLines=!1,I.showDesk=!1,a.client.viewport.set_side(I);break;case 1:case 5:default:I.showSpeedLines=!1,I.showDesk=!0,a.client.viewport.set_side(I);break;case 4:I.showSpeedLines=!1,I.showDesk=!1,a.client.viewport.set_side(I),k=!0}if((0,p.setChatbox)(a.client.viewport.getChatmsg().chatbox),(0,h.resizeChatbox)(),!k){switch(n.style.transform=1===a.client.viewport.getChatmsg().flip?"scaleX(-1)":"scaleX(1)",r.style.transform=1===a.client.viewport.getChatmsg().other_flip?"scaleX(-1)":"scaleX(1)",a.client.viewport.getChatmsg().side){case"wit":r.style.left="".concat(200+Number(a.client.viewport.getChatmsg().other_offset[0]),"%"),n.style.left="".concat(200+Number(a.client.viewport.getChatmsg().self_offset[0]),"%");break;case"pro":r.style.left="".concat(400+Number(a.client.viewport.getChatmsg().other_offset[0]),"%"),n.style.left="".concat(400+Number(a.client.viewport.getChatmsg().self_offset[0]),"%");break;default:r.style.left="".concat(Number(a.client.viewport.getChatmsg().other_offset[0]),"%"),n.style.left="".concat(Number(a.client.viewport.getChatmsg().self_offset[0]),"%")}r.style.top="".concat(Number(a.client.viewport.getChatmsg().other_offset[1]),"%"),n.style.top="".concat(Number(a.client.viewport.getChatmsg().self_offset[1]),"%")}if(a.client.viewport.blipChannels.forEach((function(e){return e.src="".concat(l.AO_HOST,"sounds/blips/").concat(encodeURI(a.client.viewport.getChatmsg().blips.toLowerCase()),".opus")})),a.client.viewport.getChatmsg().content.startsWith("~~")?(S.style.textAlign="center",a.client.viewport.getChatmsg().content=a.client.viewport.getChatmsg().content.substring(2,a.client.viewport.getChatmsg().content.length)):S.style.textAlign="inherit",g.style.animation="",A=a.client.viewport.getChatmsg().effects[0].toLowerCase(),M=["","-","none"],A.startsWith("rain"))for(document.getElementById("effect_css").href="styles/effects/rain.css",j=200,A.endsWith("weak")?j=100:A.endsWith("strong")&&(j=400),j0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]=n.duration?R():e=setTimeout((function(){return N()}),a.UPDATE_INTERVAL):R()},R=function(){i.client.testimonyID=0,A=0,document.getElementById("client_testimony").style.opacity="0",clearTimeout(e)},F=function(e){return r(void 0,void 0,void 0,(function(){var t,a,u,l,f,d,p,h,v,y,m,g;return o(this,(function(E){switch(E.label){case 0:if(t=document.getElementById("client_chat"),a=document.getElementById("client_chatwaiting"),u=document.getElementById("client_inner_chat"),l=_.name.toLowerCase(),f=_.sprite.toLowerCase()," "!==_.content.charAt(M.length)&&(w[x].play(),x++,x%=w.length),M=_.content.substring(0,M.length+1),!(d=_.parsed[M.length-1]))return[3,3];if(p=_.parsed[M.length],h=function(){return r(void 0,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return e=document.getElementById("client_fg"),B("".concat(s.AO_HOST,"sounds/general/sfx-realization.opus"),!1),e.style.animation="flash 0.4s 1",[4,(0,i.delay)(400)];case 1:return t.sent(),e.style.removeProperty("animation"),[2]}}))}))},v=function(){return r(void 0,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return e=document.getElementById("client_gamewindow"),B("".concat(s.AO_HOST,"sounds/general/sfx-stab.opus"),!1),e.style.animation="shake 0.2s 1",[4,(0,i.delay)(200)];case 1:return t.sent(),e.style.removeProperty("animation"),[2]}}))}))},y=new Map(Object.entries({s:v,f:h})),new Set(["{","}"]).has(d.innerHTML))for(m=M.length;m<_.content.length;m++)if("}"===(g=_.parsed[m-1].innerHTML))_.speed>0&&(_.speed-=20);else{if("{"!==g){M=_.content.substring(0,m);break}_.speed<120&&(_.speed+=20)}return"\\"===d.innerHTML&&y.has(null==p?void 0:p.innerHTML)?(M=_.content.substring(0,M.length+1),[4,y.get(p.innerHTML)()]):[3,2];case 1:return E.sent(),[3,3];case 2:u.appendChild(_.parsed[M.length-1]),E.label=3;case 3:return t.scrollTop=t.scrollHeight,M===_.content&&(b=!1,(0,c.default)(s.AO_HOST,i.client,l,f,"(a)",!1,_.side),e.style.opacity="1",a.style.opacity="1",clearTimeout(n)),[2]}}))}))},V=function(){return r(void 0,void 0,void 0,(function(){var e,t,r,l,f,d,p,h,v,w,x,E,S,T,C,I;return o(this,(function(o){switch(o.label){case 0:return[4,(0,i.delay)(_.speed)];case 1:return o.sent(),M===_.content?[2]:(e=document.getElementById("client_gamewindow"),t=document.getElementById("client_chatwaiting"),r=document.getElementById("client_evi"),l=document.getElementById("client_shout"),f=document.getElementById("client_fg"),d=document.getElementById("client_inner_chat"),p=document.getElementById("client_char"),h=document.getElementById("client_pair_char"),["def","pro","wit"].includes(_.side)&&(p=document.getElementById("client_".concat(_.side,"_char")),h=document.getElementById("client_".concat(_.side,"_pair_char"))),v=_.name.toLowerCase(),w=_.sprite.toLowerCase(),x=_.other_name.toLowerCase(),E=_.other_emote.toLowerCase(),S=j>=L,T=j>=L+_.preanimdelay,S&&g.startFirstTickCheck&&(1===_.screenshake&&(B("".concat(s.AO_HOST,"sounds/general/sfx-stab.opus"),!1),e.style.animation="shake 0.2s 1"),1===_.flash&&(B("".concat(s.AO_HOST,"sounds/general/sfx-realization.opus"),!1),f.style.animation="flash 0.4s 1"),_.preanimdelay>0&&(l.style.opacity="0",l.style.animation="",C=_.preanim.toLowerCase(),(0,c.default)(s.AO_HOST,i.client,v,C,"",!1,_.side)),_.other_name?h.style.opacity="1":h.style.opacity="0",(0,g.setStartFirstTickCheck)(!1),(0,g.setStartSecondTickCheck)(!0),_.startpreanim=!1,_.startspeaking=!0),I=1===_.noninterrupting_preanim,M!==_.content&&I?(document.getElementById("client_chatcontainer").style.opacity="1",[4,F(p)]):[3,3]);case 2:return o.sent(),[3,6];case 3:if(!T||!g.startSecondTickCheck)return[3,6];if(!_.startspeaking)return[3,4];switch(_.startspeaking=!1,_.evidence>0&&(r.src=(0,u.safeTags)(i.client.evidences[_.evidence-1].icon),r.style.width="auto",r.style.height="36.5%",r.style.opacity="1",k.src="".concat(s.AO_HOST,"sounds/general/sfx-evidenceshoop.opus"),k.play(),"def"===_.side?(r.style.right="1em",r.style.left="initial"):(r.style.right="initial",r.style.left="1em")),d.className="text_".concat(y.COLORS[_.color]),0===_.preanimdelay&&(l.style.opacity="0",l.style.animation=""),Number(_.deskmod)){case 2:case 4:(0,m.set_side)({position:_.side,showSpeedLines:!1,showDesk:!0});break;case 3:case 5:(0,m.set_side)({position:_.side,showSpeedLines:!1,showDesk:!1})}return _.other_name?((0,c.default)(s.AO_HOST,i.client,x,E,"(a)",!0,_.side),h.style.opacity="1"):h.style.opacity="0",(0,c.default)(s.AO_HOST,i.client,v,w,"(b)",!1,_.side),p.style.opacity="1",M===_.content?((0,c.default)(s.AO_HOST,i.client,v,w,"(a)",!1,_.side),p.style.opacity="1",t.style.opacity="1",b=!1,clearTimeout(n),[2]):[3,6];case 4:return M===_.content?[3,6]:(document.getElementById("client_chatcontainer").style.opacity="1",[4,F(p)]);case 5:o.sent(),o.label=6;case 6:return!O&&_.snddelay+L>=j&&(O=1,"0"===_.sound||"1"===_.sound||""===_.sound||void 0===_.sound||1!=_.type&&2!=_.type&&6!=_.type||B("".concat(s.AO_HOST,"sounds/general/").concat(encodeURI(_.sound.toLowerCase()),".opus"),_.looping_sfx)),b&&V(),j+=a.UPDATE_INTERVAL,[2]}}))}))};return{getTextNow:function(){return M},setTextNow:function(e){M=e},getChatmsg:function(){return _},setChatmsg:function(e){_=e},getSfxPlayed:function(){return O},setSfxPlayed:function(e){O=e},setTickTimer:function(e){j=e},getTickTimer:function(){return j},setAnimating:function(e){b=e},getAnimating:function(){return b},getLastEvidence:function(){return S},setLastEvidence:function(e){S=e},setLastCharacter:function(e){E=e},getLastCharacter:function(){return E},getShoutTimer:function(){return L},setShoutTimer:function(e){L=e},setTheme:function(e){t=e},getTheme:function(){return t},setTestimonyTimer:function(e){A=e},getTestimonyTimer:function(){return A},setTestimonyUpdater:function(t){e=t},getTestimonyUpdater:function(){return e},testimonyAudio:k,chat_tick:V,playSFX:B,set_side:m.set_side,setBackgroundName:function(e){P=e},updateTestimony:N,disposeTestimony:R,handleTextTick:F,getBackgroundFolder:function(){return"".concat(s.AO_HOST,"background/").concat(encodeURI(P.toLowerCase()),"/")},getBackgroundName:function(){return P},getSfxAudio:function(){return C},setSfxAudio:function(e){C=e},blipChannels:w,music:T,musicVolume:0,shoutaudio:I,updater:n}}}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e].call(i.exports,i,i.exports,r),i.exports}r.m=t,e=[],r.O=function(t,n,o,i){if(!n){var a=1/0;for(l=0;l=i)&&Object.keys(r.O).every((function(e){return r.O[e](n[u])}))?n.splice(u--,1):(c=!1,i0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[n,o,i]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={47:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var o,i,a=n[0],c=n[1],u=n[2],s=0;if(a.some((function(t){return 0!==e[t]}))){for(o in c)r.o(c,o)&&(r.m[o]=c[o]);if(u)var l=u(r)}for(t&&t(n);s 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","export default [\n 'Anime',\n 'birthday',\n 'Christmas',\n 'CountyCourt',\n 'CruiseCourt',\n 'default',\n 'DGSEnglishCourt',\n 'DGSJapanCourt',\n 'DualDestinies',\n 'EnglishCourt',\n 'gs4',\n 'GS4Night',\n 'HD',\n \"Khura'in\",\n 'mlp',\n 'NewCourt',\n 'RuinedCourt',\n 'Sky',\n 'SpaceCourt',\n 'Themis',\n 'TouhouCourt',\n 'WitchTrialCourt',\n 'Zetta',\n];\n","export default [\n 'Adrian',\n 'Apollo',\n 'April',\n 'Armstrong',\n 'Atmey',\n 'Butz',\n 'Diego',\n 'Edgeworth',\n 'Edgeworthw',\n 'Ema',\n 'Emaskye',\n 'Franny',\n 'Franziska',\n 'Gant',\n 'Gavin',\n 'Gavin K',\n 'Godot',\n 'Gregory',\n 'Grossberg',\n 'Gumshoe',\n 'Gumshoey',\n 'Hawk',\n 'Hobo_Phoenix',\n 'Ini',\n 'Judge',\n \"Judge's Bro\",\n 'Klav',\n 'Klavier',\n 'Kristoph',\n 'Lana',\n 'Layton',\n 'Lotta',\n 'Luis',\n 'Maggey',\n 'Manfred',\n 'Marshall',\n 'Matt',\n 'Maya',\n 'Mia',\n 'Miles',\n 'Oldbag',\n 'Payne',\n 'Pearl',\n 'Phoenix',\n 'Valant',\n 'Vasquez',\n 'Wellington',\n 'Winston',\n 'Winstonpayne',\n 'Young Mia',\n 'Zak',\n];\n","export default [\n '1.png',\n '2.png',\n '3.png',\n '4.png',\n '5.png',\n '6.png',\n 'empty.png',\n 'lawyerbadge.png',\n];\n","export default [\n 'Announce The Truth (AA).opus',\n 'Announce The Truth (AJ).opus',\n 'Announce The Truth (JFA).opus',\n 'Announce The Truth (Miles).opus',\n 'Announce The Truth (T&T).opus',\n 'Confrontation ~ Presto 2009.opus',\n 'Crises of Fate.opus',\n 'Forgotten Legend.opus',\n 'Godot - The Fragrance of Dark Coffee.opus',\n 'Great Revival ~ Franziska von Karma.opus',\n 'Great Revival ~ Miles Edgeworth.opus',\n 'Hotline of Fate.opus',\n 'Interesting People.opus',\n 'Logic and Trick.opus',\n 'Luke Atmey ~ I Just Want Love.opus',\n 'Noisy People.opus',\n 'OBJECTION (AA).opus',\n 'Objection (AJ).opus',\n 'OBJECTION (JFA).opus',\n 'Objection (Miles).opus',\n 'OBJECTION (T&T).opus',\n 'Others ~ Guilty love.opus',\n 'Prelude (AA).opus',\n 'Prelude (AJ).opus',\n 'Prologue (AA).opus',\n 'Pursuit (AA) - variation.opus',\n 'Pursuit (AA).opus',\n 'Pursuit (AJ).opus',\n 'Pursuit (DS).opus',\n 'Pursuit (JFA) - variation.opus',\n 'Pursuit (JFA).opus',\n 'Pursuit (Miles).opus',\n 'Pursuit (T&T) - variation.opus',\n 'Pursuit (T&T).opus',\n 'Pursuit ~ I Want to Find the Truth (Orchestra).opus',\n 'Questioning AA (Allegro).opus',\n 'Questioning AA (Moderato).opus',\n 'Questioning AJ (Allegro).opus',\n 'Questioning AJ (Moderato).opus',\n 'Questioning JFA (Allegro).opus',\n 'Questioning JFA (Moderato).opus',\n 'Questioning T&T (Allegro).opus',\n 'Questioning T&T (Moderato).opus',\n 'Speak up Pup.opus',\n 'Suspense (AA).opus',\n 'The Great Truth Burglar.opus',\n 'Trial (AA).opus',\n 'Trial (AJ).opus',\n 'Trial (Miles).opus',\n];\n","export default 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';\n","import setCookie from '../utils/setCookie.ts';\n\n/**\n * Triggered by the sound effect volume slider.\n */\n\nexport function changeSFXVolume() {\n setCookie('sfxVolume', document.getElementById('client_sfxaudio').volume);\n}\nwindow.changeSFXVolume = changeSFXVolume;\n\n/**\n * Triggered by the testimony volume slider.\n */\nexport function changeTestimonyVolume() {\n setCookie('testimonyVolume', document.getElementById('client_testimonyaudio').volume);\n}\nwindow.changeTestimonyVolume = changeTestimonyVolume;\n\n/**\n * Triggered by the shout volume slider.\n */\n\nexport function changeShoutVolume() {\n setCookie('shoutVolume', document.getElementById('client_shoutaudio').volume);\n}\nwindow.changeShoutVolume = changeShoutVolume;\n","const regexPatterns = {\n section: /^\\s*\\[\\s*([^\\]]*)\\s*\\]\\s*$/,\n param: /^\\s*([\\w.\\-_]+)\\s*=\\s*(.*?)\\s*$/,\n comment: /^\\s*;.*$/,\n};\n\nconst valueHandler = (matchKey, matchValue) => (matchKey === 'showname' ? matchValue : matchValue.toLowerCase());\n\nconst lineFilter = (value) => {\n const isEmpty = value.length === 0;\n const isComment = regexPatterns.comment.test(value);\n if (isComment || isEmpty) {\n return false;\n }\n return true;\n};\n\nconst iniParse = (data) => {\n const parsedIni = {};\n const lines = data.split(/\\r\\n|\\r|\\n/);\n const filteredLines = lines.filter(lineFilter);\n\n let currentSection;\n filteredLines.forEach((line) => {\n const isParameter = regexPatterns.param.test(line);\n const isSection = regexPatterns.section.test(line);\n if (isParameter && currentSection) {\n const match = line.match(regexPatterns.param);\n const matchKey = match[1].toLowerCase();\n const matchValue = match[2];\n parsedIni[currentSection][matchKey] = valueHandler(matchKey, matchValue);\n } else if (isSection) {\n const match = line.match(regexPatterns.section);\n const matchKey = match[1].toLowerCase();\n parsedIni[matchKey] = {};\n currentSection = matchKey;\n }\n });\n return parsedIni;\n};\n\nexport default iniParse;\n","/**\n * Make a GET request for a specific URI.\n * @param {string} url the URI to be requested\n * @returns response data\n * @throws {Error} if status code is not 2xx, or a network error occurs\n */\nexport async function requestBuffer(url) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.responseType = 'arraybuffer';\n xhr.addEventListener('error', () => {\n const err = new Error(`Request for ${url} failed: ${xhr.statusText}`);\n err.code = xhr.status;\n reject(err);\n });\n xhr.addEventListener('abort', () => {\n const err = new Error(`Request for ${url} was aborted!`);\n err.code = xhr.status;\n reject(err);\n });\n xhr.addEventListener('load', () => {\n if (xhr.status < 200 || xhr.status >= 300) {\n const err = new Error(`Request for ${url} failed with status code ${xhr.status}`);\n err.code = xhr.status;\n reject(err);\n } else {\n resolve(xhr.response);\n }\n });\n xhr.open('GET', url, true);\n xhr.send();\n });\n}\n\n/**\n * Make a GET request for a specific URI.\n * @param {string} url the URI to be requested\n * @returns response data\n * @throws {Error} if status code is not 2xx, or a network error occurs\n */\nexport const request = async (url) => new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.responseType = 'text';\n xhr.addEventListener('error', () => {\n const err = new Error(`Request for ${url} failed: ${xhr.statusText}`);\n err.code = xhr.status;\n reject(err);\n });\n xhr.addEventListener('abort', () => {\n const err = new Error(`Request for ${url} was aborted!`);\n err.code = xhr.status;\n reject(err);\n });\n xhr.addEventListener('load', () => {\n if (xhr.status < 200 || xhr.status >= 300) {\n const err = new Error(`Request for ${url} failed with status code ${xhr.status}`);\n err.code = xhr.status;\n reject(err);\n } else {\n resolve(xhr.response);\n }\n });\n xhr.open('GET', url, true);\n xhr.send();\n});\nexport default request;\n","export default [\n 'aa',\n 'acww',\n 'dd',\n 'dgs',\n 'plvsaa',\n 'trilogy',\n 'future',\n 'legacy',\n 'ddlc',\n 'dr1',\n 'dr2',\n 'drv3',\n 'drae',\n 'p3',\n 'p4',\n 'p5',\n '999',\n 'halla',\n 'homestuck',\n 'key',\n 'sonic',\n 'yakuza',\n 'yttd',\n 'whentheycry',\n 'n64zelda',\n 'papermario',\n];\n","const fileExists = async (url) => new Promise((resolve) => {\n const xhr = new XMLHttpRequest();\n xhr.open('HEAD', url);\n xhr.onload = function checkLoad() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n resolve(true);\n } else {\n resolve(false);\n }\n }\n };\n xhr.onerror = function checkError() {\n resolve(false);\n };\n xhr.send(null);\n});\nexport default fileExists;\n","import calculateGifLength from './calculateGifLength';\nimport calculateWebpLength from './calculateWebpLength';\nimport calculateApngLength from './calculateApngLength';\n\nexport default {\n '.gif': calculateGifLength,\n '.webp': calculateWebpLength,\n '.apng': calculateApngLength,\n};\n","/* eslint no-bitwise: \"off\" */\n\n/**\n * Adds up the frame delays to find out how long a GIF is\n * I totally didn't steal this\n * @param {data} gifFile the GIF data\n */\nconst calculateGifLength = (gifFile) => {\n const d = new Uint8Array(gifFile);\n // Thanks to http://justinsomnia.org/2006/10/gif-animation-duration-calculation/\n // And http://www.w3.org/Graphics/GIF/spec-gif89a.txt\n let duration = 0;\n for (let i = 0; i < d.length; i++) {\n // Find a Graphic Control Extension hex(21F904__ ____ __00)\n if (d[i] === 0x21\n && d[i + 1] === 0xF9\n && d[i + 2] === 0x04\n && d[i + 7] === 0x00) {\n // Swap 5th and 6th bytes to get the delay per frame\n const delay = (d[i + 5] << 8) | (d[i + 4] & 0xFF);\n\n // Should be aware browsers have a minimum frame delay\n // e.g. 6ms for IE, 2ms modern browsers (50fps)\n duration += delay < 2 ? 10 : delay;\n }\n }\n return duration * 10;\n};\nexport default calculateGifLength;\n","/* eslint no-bitwise: \"off\" */\n\nconst calculateWebpLength = (webpFile) => {\n const d = new Uint8Array(webpFile);\n // https://developers.google.com/speed/webp/docs/riff_container#animation\n let duration = 0;\n for (let i = 0; i < d.length; i++) {\n // Find ANMF header (41 4E 4D 46)\n if (d[i] === 0x41\n && d[i + 1] === 0x4E\n && d[i + 2] === 0x4D\n && d[i + 3] === 0x46) {\n // Swap 5th and 6th bytes to get the delay per frame\n const delay = (d[i + 21] << 8) | (d[i + 20] & 0xFF);\n\n // Should be aware browsers have a minimum frame delay\n // e.g. 6ms for IE, 2ms modern browsers (50fps)\n duration += delay < 2 ? 10 : delay;\n }\n }\n return duration;\n};\n\nexport default calculateWebpLength;\n","/**\n * Adds up the chunk delays to find out how long a APNG is\n * @param {data} apngFile the APNG data\n */\nconst calculateApngLength = (apngFile) => {\n const d = new Uint8Array(apngFile);\n // https://wiki.mozilla.org/APNG_Specification#.60fcTL.60:_The_Frame_Control_Chunk\n let duration = 0;\n for (let i = 0; i < d.length; i++) {\n // Find fcTL header (66 63 54 4C)\n if (d[i] === 0x66\n && d[i + 1] === 0x63\n && d[i + 2] === 0x54\n && d[i + 3] === 0x4C) {\n // numerator and denominator\n const delayNum = Number(d[i + 23]);\n const delayDen = Number(d[i + 25]);\n let delay;\n // minimum is 100ms\n if (delayDen === 0) {\n delay = delayNum / 100;\n } else {\n delay = delayNum / delayDen;\n }\n duration += delay;\n }\n }\n return duration * 10;\n};\nexport default calculateApngLength;\n","/* eslint no-await-in-loop: \"warn\" */\n/* eslint no-restricted-syntax: \"off\" */\n/* TODO: use promises for this */\n\nimport calculatorHandler from './calculatorHandler';\nimport fileExists from './fileExists';\nimport { requestBuffer } from '../services/request';\n/**\n * Gets animation length. If the animation cannot be found, it will\n * silently fail and return 0 instead.\n * @param {string} filename the animation file name\n */\n\nconst getAnimLength = async (url) => {\n const extensions = ['.gif', '.webp', '.apng'];\n for (const extension of extensions) {\n const urlWithExtension = url + extension;\n const exists = await fileExists(urlWithExtension);\n if (exists) {\n const fileBuffer = await requestBuffer(urlWithExtension);\n const length = calculatorHandler[extension](fileBuffer);\n return length;\n }\n }\n return 0;\n};\nexport default getAnimLength;\n","const getResources = (AO_HOST, THEME) => ({\n holdit: {\n src: `${AO_HOST}misc/default/holdit_bubble.png`,\n duration: 720,\n },\n objection: {\n src: `${AO_HOST}misc/default/objection_bubble.png`,\n duration: 720,\n },\n takethat: {\n src: `${AO_HOST}misc/default/takethat_bubble.png`,\n duration: 840,\n },\n custom: {\n src: '',\n duration: 840,\n },\n witnesstestimony: {\n src: `${AO_HOST}themes/${THEME}/witnesstestimony_bubble.gif`,\n duration: 1560,\n sfx: `${AO_HOST}sounds/general/sfx-testimony.opus`,\n },\n crossexamination: {\n src: `${AO_HOST}themes/${THEME}/crossexamination_bubble.gif`,\n duration: 1600,\n sfx: `${AO_HOST}sounds/general/sfx-testimony2.opus`,\n },\n guilty: {\n src: `${AO_HOST}themes/${THEME}/guilty_bubble.gif`,\n duration: 2870,\n sfx: `${AO_HOST}sounds/general/sfx-guilty.opus`,\n },\n notguilty: {\n src: `${AO_HOST}themes/${THEME}/notguilty_bubble.gif`,\n duration: 2440,\n sfx: `${AO_HOST}sounds/general/sfx-notguilty.opus`,\n },\n});\nexport default getResources;\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","/**\n * FingerprintJS v3.4.2 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com)\n * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.\n *\n * This software contains code from open-source projects:\n * MurmurHash3 by Karan Lyons (https://github.com/karanlyons/murmurHash3.js)\n */\n\nimport { __awaiter, __generator, __assign, __spreadArray } from 'tslib';\n\nvar version = \"3.4.2\";\n\nfunction wait(durationMs, resolveWith) {\n return new Promise(function (resolve) { return setTimeout(resolve, durationMs, resolveWith); });\n}\nfunction requestIdleCallbackIfAvailable(fallbackTimeout, deadlineTimeout) {\n if (deadlineTimeout === void 0) { deadlineTimeout = Infinity; }\n var requestIdleCallback = window.requestIdleCallback;\n if (requestIdleCallback) {\n // The function `requestIdleCallback` loses the binding to `window` here.\n // `globalThis` isn't always equal `window` (see https://github.com/fingerprintjs/fingerprintjs/issues/683).\n // Therefore, an error can occur. `call(window,` prevents the error.\n return new Promise(function (resolve) { return requestIdleCallback.call(window, function () { return resolve(); }, { timeout: deadlineTimeout }); });\n }\n else {\n return wait(Math.min(fallbackTimeout, deadlineTimeout));\n }\n}\nfunction isPromise(value) {\n return !!value && typeof value.then === 'function';\n}\n/**\n * Calls a maybe asynchronous function without creating microtasks when the function is synchronous.\n * Catches errors in both cases.\n *\n * If just you run a code like this:\n * ```\n * console.time('Action duration')\n * await action()\n * console.timeEnd('Action duration')\n * ```\n * The synchronous function time can be measured incorrectly because another microtask may run before the `await`\n * returns the control back to the code.\n */\nfunction awaitIfAsync(action, callback) {\n try {\n var returnedValue = action();\n if (isPromise(returnedValue)) {\n returnedValue.then(function (result) { return callback(true, result); }, function (error) { return callback(false, error); });\n }\n else {\n callback(true, returnedValue);\n }\n }\n catch (error) {\n callback(false, error);\n }\n}\n/**\n * If you run many synchronous tasks without using this function, the JS main loop will be busy and asynchronous tasks\n * (e.g. completing a network request, rendering the page) won't be able to happen.\n * This function allows running many synchronous tasks such way that asynchronous tasks can run too in background.\n */\nfunction mapWithBreaks(items, callback, loopReleaseInterval) {\n if (loopReleaseInterval === void 0) { loopReleaseInterval = 16; }\n return __awaiter(this, void 0, void 0, function () {\n var results, lastLoopReleaseTime, i, now;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n results = Array(items.length);\n lastLoopReleaseTime = Date.now();\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < items.length)) return [3 /*break*/, 4];\n results[i] = callback(items[i], i);\n now = Date.now();\n if (!(now >= lastLoopReleaseTime + loopReleaseInterval)) return [3 /*break*/, 3];\n lastLoopReleaseTime = now;\n // Allows asynchronous actions and microtasks to happen\n return [4 /*yield*/, wait(0)];\n case 2:\n // Allows asynchronous actions and microtasks to happen\n _a.sent();\n _a.label = 3;\n case 3:\n ++i;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/, results];\n }\n });\n });\n}\n/**\n * Makes the given promise never emit an unhandled promise rejection console warning.\n * The promise will still pass errors to the next promises.\n *\n * Otherwise, promise emits a console warning unless it has a `catch` listener.\n */\nfunction suppressUnhandledRejectionWarning(promise) {\n promise.then(undefined, function () { return undefined; });\n}\n\n/*\n * Taken from https://github.com/karanlyons/murmurHash3.js/blob/a33d0723127e2e5415056c455f8aed2451ace208/murmurHash3.js\n */\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// added together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Add(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] + n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] + n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] + n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] + n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// multiplied together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Multiply(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] * n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] * n[3];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[2] += m[3] * n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] * n[3];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[2] * n[2];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[3] * n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] * n[3] + m[1] * n[2] + m[2] * n[1] + m[3] * n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}\n//\n// Given a 64bit int (as an array of two 32bit ints) and an int\n// representing a number of bit positions, returns the 64bit int (as an\n// array of two 32bit ints) rotated left by that number of positions.\n//\nfunction x64Rotl(m, n) {\n n %= 64;\n if (n === 32) {\n return [m[1], m[0]];\n }\n else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))];\n }\n else {\n n -= 32;\n return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))];\n }\n}\n//\n// Given a 64bit int (as an array of two 32bit ints) and an int\n// representing a number of bit positions, returns the 64bit int (as an\n// array of two 32bit ints) shifted left by that number of positions.\n//\nfunction x64LeftShift(m, n) {\n n %= 64;\n if (n === 0) {\n return m;\n }\n else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n];\n }\n else {\n return [m[1] << (n - 32), 0];\n }\n}\n//\n// Given two 64bit ints (as an array of two 32bit ints) returns the two\n// xored together as a 64bit int (as an array of two 32bit ints).\n//\nfunction x64Xor(m, n) {\n return [m[0] ^ n[0], m[1] ^ n[1]];\n}\n//\n// Given a block, returns murmurHash3's final x64 mix of that block.\n// (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the\n// only place where we need to right shift 64bit ints.)\n//\nfunction x64Fmix(h) {\n h = x64Xor(h, [0, h[0] >>> 1]);\n h = x64Multiply(h, [0xff51afd7, 0xed558ccd]);\n h = x64Xor(h, [0, h[0] >>> 1]);\n h = x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]);\n h = x64Xor(h, [0, h[0] >>> 1]);\n return h;\n}\n//\n// Given a string and an optional seed as an int, returns a 128 bit\n// hash using the x64 flavor of MurmurHash3, as an unsigned hex.\n//\nfunction x64hash128(key, seed) {\n key = key || '';\n seed = seed || 0;\n var remainder = key.length % 16;\n var bytes = key.length - remainder;\n var h1 = [0, seed];\n var h2 = [0, seed];\n var k1 = [0, 0];\n var k2 = [0, 0];\n var c1 = [0x87c37b91, 0x114253d5];\n var c2 = [0x4cf5ad43, 0x2745937f];\n var i;\n for (i = 0; i < bytes; i = i + 16) {\n k1 = [\n (key.charCodeAt(i + 4) & 0xff) |\n ((key.charCodeAt(i + 5) & 0xff) << 8) |\n ((key.charCodeAt(i + 6) & 0xff) << 16) |\n ((key.charCodeAt(i + 7) & 0xff) << 24),\n (key.charCodeAt(i) & 0xff) |\n ((key.charCodeAt(i + 1) & 0xff) << 8) |\n ((key.charCodeAt(i + 2) & 0xff) << 16) |\n ((key.charCodeAt(i + 3) & 0xff) << 24),\n ];\n k2 = [\n (key.charCodeAt(i + 12) & 0xff) |\n ((key.charCodeAt(i + 13) & 0xff) << 8) |\n ((key.charCodeAt(i + 14) & 0xff) << 16) |\n ((key.charCodeAt(i + 15) & 0xff) << 24),\n (key.charCodeAt(i + 8) & 0xff) |\n ((key.charCodeAt(i + 9) & 0xff) << 8) |\n ((key.charCodeAt(i + 10) & 0xff) << 16) |\n ((key.charCodeAt(i + 11) & 0xff) << 24),\n ];\n k1 = x64Multiply(k1, c1);\n k1 = x64Rotl(k1, 31);\n k1 = x64Multiply(k1, c2);\n h1 = x64Xor(h1, k1);\n h1 = x64Rotl(h1, 27);\n h1 = x64Add(h1, h2);\n h1 = x64Add(x64Multiply(h1, [0, 5]), [0, 0x52dce729]);\n k2 = x64Multiply(k2, c2);\n k2 = x64Rotl(k2, 33);\n k2 = x64Multiply(k2, c1);\n h2 = x64Xor(h2, k2);\n h2 = x64Rotl(h2, 31);\n h2 = x64Add(h2, h1);\n h2 = x64Add(x64Multiply(h2, [0, 5]), [0, 0x38495ab5]);\n }\n k1 = [0, 0];\n k2 = [0, 0];\n switch (remainder) {\n case 15:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 14)], 48));\n // fallthrough\n case 14:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 13)], 40));\n // fallthrough\n case 13:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 12)], 32));\n // fallthrough\n case 12:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 11)], 24));\n // fallthrough\n case 11:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 10)], 16));\n // fallthrough\n case 10:\n k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 9)], 8));\n // fallthrough\n case 9:\n k2 = x64Xor(k2, [0, key.charCodeAt(i + 8)]);\n k2 = x64Multiply(k2, c2);\n k2 = x64Rotl(k2, 33);\n k2 = x64Multiply(k2, c1);\n h2 = x64Xor(h2, k2);\n // fallthrough\n case 8:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 7)], 56));\n // fallthrough\n case 7:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 6)], 48));\n // fallthrough\n case 6:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 5)], 40));\n // fallthrough\n case 5:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 4)], 32));\n // fallthrough\n case 4:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 3)], 24));\n // fallthrough\n case 3:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 2)], 16));\n // fallthrough\n case 2:\n k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 1)], 8));\n // fallthrough\n case 1:\n k1 = x64Xor(k1, [0, key.charCodeAt(i)]);\n k1 = x64Multiply(k1, c1);\n k1 = x64Rotl(k1, 31);\n k1 = x64Multiply(k1, c2);\n h1 = x64Xor(h1, k1);\n // fallthrough\n }\n h1 = x64Xor(h1, [0, key.length]);\n h2 = x64Xor(h2, [0, key.length]);\n h1 = x64Add(h1, h2);\n h2 = x64Add(h2, h1);\n h1 = x64Fmix(h1);\n h2 = x64Fmix(h2);\n h1 = x64Add(h1, h2);\n h2 = x64Add(h2, h1);\n return (('00000000' + (h1[0] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h1[1] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h2[0] >>> 0).toString(16)).slice(-8) +\n ('00000000' + (h2[1] >>> 0).toString(16)).slice(-8));\n}\n\n/**\n * Converts an error object to a plain object that can be used with `JSON.stringify`.\n * If you just run `JSON.stringify(error)`, you'll get `'{}'`.\n */\nfunction errorToObject(error) {\n var _a;\n return __assign({ name: error.name, message: error.message, stack: (_a = error.stack) === null || _a === void 0 ? void 0 : _a.split('\\n') }, error);\n}\n\n/*\n * This file contains functions to work with pure data only (no browser features, DOM, side effects, etc).\n */\n/**\n * Does the same as Array.prototype.includes but has better typing\n */\nfunction includes(haystack, needle) {\n for (var i = 0, l = haystack.length; i < l; ++i) {\n if (haystack[i] === needle) {\n return true;\n }\n }\n return false;\n}\n/**\n * Like `!includes()` but with proper typing\n */\nfunction excludes(haystack, needle) {\n return !includes(haystack, needle);\n}\n/**\n * Be careful, NaN can return\n */\nfunction toInt(value) {\n return parseInt(value);\n}\n/**\n * Be careful, NaN can return\n */\nfunction toFloat(value) {\n return parseFloat(value);\n}\nfunction replaceNaN(value, replacement) {\n return typeof value === 'number' && isNaN(value) ? replacement : value;\n}\nfunction countTruthy(values) {\n return values.reduce(function (sum, value) { return sum + (value ? 1 : 0); }, 0);\n}\nfunction round(value, base) {\n if (base === void 0) { base = 1; }\n if (Math.abs(base) >= 1) {\n return Math.round(value / base) * base;\n }\n else {\n // Sometimes when a number is multiplied by a small number, precision is lost,\n // for example 1234 * 0.0001 === 0.12340000000000001, and it's more precise divide: 1234 / (1 / 0.0001) === 0.1234.\n var counterBase = 1 / base;\n return Math.round(value * counterBase) / counterBase;\n }\n}\n/**\n * Parses a CSS selector into tag name with HTML attributes.\n * Only single element selector are supported (without operators like space, +, >, etc).\n *\n * Multiple values can be returned for each attribute. You decide how to handle them.\n */\nfunction parseSimpleCssSelector(selector) {\n var _a, _b;\n var errorMessage = \"Unexpected syntax '\".concat(selector, \"'\");\n var tagMatch = /^\\s*([a-z-]*)(.*)$/i.exec(selector);\n var tag = tagMatch[1] || undefined;\n var attributes = {};\n var partsRegex = /([.:#][\\w-]+|\\[.+?\\])/gi;\n var addAttribute = function (name, value) {\n attributes[name] = attributes[name] || [];\n attributes[name].push(value);\n };\n for (;;) {\n var match = partsRegex.exec(tagMatch[2]);\n if (!match) {\n break;\n }\n var part = match[0];\n switch (part[0]) {\n case '.':\n addAttribute('class', part.slice(1));\n break;\n case '#':\n addAttribute('id', part.slice(1));\n break;\n case '[': {\n var attributeMatch = /^\\[([\\w-]+)([~|^$*]?=(\"(.*?)\"|([\\w-]+)))?(\\s+[is])?\\]$/.exec(part);\n if (attributeMatch) {\n addAttribute(attributeMatch[1], (_b = (_a = attributeMatch[4]) !== null && _a !== void 0 ? _a : attributeMatch[5]) !== null && _b !== void 0 ? _b : '');\n }\n else {\n throw new Error(errorMessage);\n }\n break;\n }\n default:\n throw new Error(errorMessage);\n }\n }\n return [tag, attributes];\n}\n\nfunction ensureErrorWithMessage(error) {\n return error && typeof error === 'object' && 'message' in error ? error : { message: error };\n}\nfunction isFinalResultLoaded(loadResult) {\n return typeof loadResult !== 'function';\n}\n/**\n * Loads the given entropy source. Returns a function that gets an entropy component from the source.\n *\n * The result is returned synchronously to prevent `loadSources` from\n * waiting for one source to load before getting the components from the other sources.\n */\nfunction loadSource(source, sourceOptions) {\n var sourceLoadPromise = new Promise(function (resolveLoad) {\n var loadStartTime = Date.now();\n // `awaitIfAsync` is used instead of just `await` in order to measure the duration of synchronous sources\n // correctly (other microtasks won't affect the duration).\n awaitIfAsync(source.bind(null, sourceOptions), function () {\n var loadArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n loadArgs[_i] = arguments[_i];\n }\n var loadDuration = Date.now() - loadStartTime;\n // Source loading failed\n if (!loadArgs[0]) {\n return resolveLoad(function () { return ({ error: ensureErrorWithMessage(loadArgs[1]), duration: loadDuration }); });\n }\n var loadResult = loadArgs[1];\n // Source loaded with the final result\n if (isFinalResultLoaded(loadResult)) {\n return resolveLoad(function () { return ({ value: loadResult, duration: loadDuration }); });\n }\n // Source loaded with \"get\" stage\n resolveLoad(function () {\n return new Promise(function (resolveGet) {\n var getStartTime = Date.now();\n awaitIfAsync(loadResult, function () {\n var getArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n getArgs[_i] = arguments[_i];\n }\n var duration = loadDuration + Date.now() - getStartTime;\n // Source getting failed\n if (!getArgs[0]) {\n return resolveGet({ error: ensureErrorWithMessage(getArgs[1]), duration: duration });\n }\n // Source getting succeeded\n resolveGet({ value: getArgs[1], duration: duration });\n });\n });\n });\n });\n });\n suppressUnhandledRejectionWarning(sourceLoadPromise);\n return function getComponent() {\n return sourceLoadPromise.then(function (finalizeSource) { return finalizeSource(); });\n };\n}\n/**\n * Loads the given entropy sources. Returns a function that collects the entropy components.\n *\n * The result is returned synchronously in order to allow start getting the components\n * before the sources are loaded completely.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction loadSources(sources, sourceOptions, excludeSources) {\n var includedSources = Object.keys(sources).filter(function (sourceKey) { return excludes(excludeSources, sourceKey); });\n // Using `mapWithBreaks` allows asynchronous sources to complete between synchronous sources\n // and measure the duration correctly\n var sourceGettersPromise = mapWithBreaks(includedSources, function (sourceKey) {\n return loadSource(sources[sourceKey], sourceOptions);\n });\n suppressUnhandledRejectionWarning(sourceGettersPromise);\n return function getComponents() {\n return __awaiter(this, void 0, void 0, function () {\n var sourceGetters, componentPromises, componentArray, components, index;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, sourceGettersPromise];\n case 1:\n sourceGetters = _a.sent();\n return [4 /*yield*/, mapWithBreaks(sourceGetters, function (sourceGetter) {\n var componentPromise = sourceGetter();\n suppressUnhandledRejectionWarning(componentPromise);\n return componentPromise;\n })];\n case 2:\n componentPromises = _a.sent();\n return [4 /*yield*/, Promise.all(componentPromises)\n // Keeping the component keys order the same as the source keys order\n ];\n case 3:\n componentArray = _a.sent();\n components = {};\n for (index = 0; index < includedSources.length; ++index) {\n components[includedSources[index]] = componentArray[index];\n }\n return [2 /*return*/, components];\n }\n });\n });\n };\n}\n/**\n * Modifies an entropy source by transforming its returned value with the given function.\n * Keeps the source properties: sync/async, 1/2 stages.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction transformSource(source, transformValue) {\n var transformLoadResult = function (loadResult) {\n if (isFinalResultLoaded(loadResult)) {\n return transformValue(loadResult);\n }\n return function () {\n var getResult = loadResult();\n if (isPromise(getResult)) {\n return getResult.then(transformValue);\n }\n return transformValue(getResult);\n };\n };\n return function (options) {\n var loadResult = source(options);\n if (isPromise(loadResult)) {\n return loadResult.then(transformLoadResult);\n }\n return transformLoadResult(loadResult);\n };\n}\n\n/*\n * Functions to help with features that vary through browsers\n */\n/**\n * Checks whether the browser is based on Trident (the Internet Explorer engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isTrident() {\n var w = window;\n var n = navigator;\n // The properties are checked to be in IE 10, IE 11 and not to be in other browsers in October 2020\n return (countTruthy([\n 'MSCSSMatrix' in w,\n 'msSetImmediate' in w,\n 'msIndexedDB' in w,\n 'msMaxTouchPoints' in n,\n 'msPointerEnabled' in n,\n ]) >= 4);\n}\n/**\n * Checks whether the browser is based on EdgeHTML (the pre-Chromium Edge engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isEdgeHTML() {\n // Based on research in October 2020\n var w = window;\n var n = navigator;\n return (countTruthy(['msWriteProfilerMark' in w, 'MSStream' in w, 'msLaunchUri' in n, 'msSaveBlob' in n]) >= 3 &&\n !isTrident());\n}\n/**\n * Checks whether the browser is based on Chromium without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isChromium() {\n // Based on research in October 2020. Tested to detect Chromium 42-86.\n var w = window;\n var n = navigator;\n return (countTruthy([\n 'webkitPersistentStorage' in n,\n 'webkitTemporaryStorage' in n,\n n.vendor.indexOf('Google') === 0,\n 'webkitResolveLocalFileSystemURL' in w,\n 'BatteryManager' in w,\n 'webkitMediaStream' in w,\n 'webkitSpeechGrammar' in w,\n ]) >= 5);\n}\n/**\n * Checks whether the browser is based on mobile or desktop Safari without using user-agent.\n * All iOS browsers use WebKit (the Safari engine).\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isWebKit() {\n // Based on research in September 2020\n var w = window;\n var n = navigator;\n return (countTruthy([\n 'ApplePayError' in w,\n 'CSSPrimitiveValue' in w,\n 'Counter' in w,\n n.vendor.indexOf('Apple') === 0,\n 'getStorageUpdates' in n,\n 'WebKitMediaKeys' in w,\n ]) >= 4);\n}\n/**\n * Checks whether the WebKit browser is a desktop Safari.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isDesktopSafari() {\n var w = window;\n return (countTruthy([\n 'safari' in w,\n !('DeviceMotionEvent' in w),\n !('ongestureend' in w),\n !('standalone' in navigator),\n ]) >= 3);\n}\n/**\n * Checks whether the browser is based on Gecko (Firefox engine) without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isGecko() {\n var _a, _b;\n var w = window;\n // Based on research in September 2020\n return (countTruthy([\n 'buildID' in navigator,\n 'MozAppearance' in ((_b = (_a = document.documentElement) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {}),\n 'onmozfullscreenchange' in w,\n 'mozInnerScreenX' in w,\n 'CSSMozDocumentRule' in w,\n 'CanvasCaptureMediaStream' in w,\n ]) >= 4);\n}\n/**\n * Checks whether the browser is based on Chromium version ≥86 without using user-agent.\n * It doesn't check that the browser is based on Chromium, there is a separate function for this.\n */\nfunction isChromium86OrNewer() {\n // Checked in Chrome 85 vs Chrome 86 both on desktop and Android\n var w = window;\n return (countTruthy([\n !('MediaSettingsRange' in w),\n 'RTCEncodedAudioFrame' in w,\n '' + w.Intl === '[object Intl]',\n '' + w.Reflect === '[object Reflect]',\n ]) >= 3);\n}\n/**\n * Checks whether the browser is based on WebKit version ≥606 (Safari ≥12) without using user-agent.\n * It doesn't check that the browser is based on WebKit, there is a separate function for this.\n *\n * @link https://en.wikipedia.org/wiki/Safari_version_history#Release_history Safari-WebKit versions map\n */\nfunction isWebKit606OrNewer() {\n // Checked in Safari 9–14\n var w = window;\n return (countTruthy([\n 'DOMRectList' in w,\n 'RTCPeerConnectionIceEvent' in w,\n 'SVGGeometryElement' in w,\n 'ontransitioncancel' in w,\n ]) >= 3);\n}\n/**\n * Checks whether the device is an iPad.\n * It doesn't check that the engine is WebKit and that the WebKit isn't desktop.\n */\nfunction isIPad() {\n // Checked on:\n // Safari on iPadOS (both mobile and desktop modes): 8, 11, 12, 13, 14\n // Chrome on iPadOS (both mobile and desktop modes): 11, 12, 13, 14\n // Safari on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14\n // Chrome on iOS (both mobile and desktop modes): 9, 10, 11, 12, 13, 14\n // Before iOS 13. Safari tampers the value in \"request desktop site\" mode since iOS 13.\n if (navigator.platform === 'iPad') {\n return true;\n }\n var s = screen;\n var screenRatio = s.width / s.height;\n return (countTruthy([\n 'MediaSource' in window,\n !!Element.prototype.webkitRequestFullscreen,\n // iPhone 4S that runs iOS 9 matches this. But it won't match the criteria above, so it won't be detected as iPad.\n screenRatio > 0.65 && screenRatio < 1.53,\n ]) >= 2);\n}\n/**\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction getFullscreenElement() {\n var d = document;\n return d.fullscreenElement || d.msFullscreenElement || d.mozFullScreenElement || d.webkitFullscreenElement || null;\n}\nfunction exitFullscreen() {\n var d = document;\n // `call` is required because the function throws an error without a proper \"this\" context\n return (d.exitFullscreen || d.msExitFullscreen || d.mozCancelFullScreen || d.webkitExitFullscreen).call(d);\n}\n/**\n * Checks whether the device runs on Android without using user-agent.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction isAndroid() {\n var isItChromium = isChromium();\n var isItGecko = isGecko();\n // Only 2 browser engines are presented on Android.\n // Actually, there is also Android 4.1 browser, but it's not worth detecting it at the moment.\n if (!isItChromium && !isItGecko) {\n return false;\n }\n var w = window;\n // Chrome removes all words \"Android\" from `navigator` when desktop version is requested\n // Firefox keeps \"Android\" in `navigator.appVersion` when desktop version is requested\n return (countTruthy([\n 'onorientationchange' in w,\n 'orientation' in w,\n isItChromium && !('SharedWorker' in w),\n isItGecko && /android/i.test(navigator.appVersion),\n ]) >= 2);\n}\n\n/**\n * A deep description: https://fingerprint.com/blog/audio-fingerprinting/\n * Inspired by and based on https://github.com/cozylife/audio-fingerprint\n */\nfunction getAudioFingerprint() {\n var w = window;\n var AudioContext = w.OfflineAudioContext || w.webkitOfflineAudioContext;\n if (!AudioContext) {\n return -2 /* SpecialFingerprint.NotSupported */;\n }\n // In some browsers, audio context always stays suspended unless the context is started in response to a user action\n // (e.g. a click or a tap). It prevents audio fingerprint from being taken at an arbitrary moment of time.\n // Such browsers are old and unpopular, so the audio fingerprinting is just skipped in them.\n // See a similar case explanation at https://stackoverflow.com/questions/46363048/onaudioprocess-not-called-on-ios11#46534088\n if (doesCurrentBrowserSuspendAudioContext()) {\n return -1 /* SpecialFingerprint.KnownToSuspend */;\n }\n var hashFromIndex = 4500;\n var hashToIndex = 5000;\n var context = new AudioContext(1, hashToIndex, 44100);\n var oscillator = context.createOscillator();\n oscillator.type = 'triangle';\n oscillator.frequency.value = 10000;\n var compressor = context.createDynamicsCompressor();\n compressor.threshold.value = -50;\n compressor.knee.value = 40;\n compressor.ratio.value = 12;\n compressor.attack.value = 0;\n compressor.release.value = 0.25;\n oscillator.connect(compressor);\n compressor.connect(context.destination);\n oscillator.start(0);\n var _a = startRenderingAudio(context), renderPromise = _a[0], finishRendering = _a[1];\n var fingerprintPromise = renderPromise.then(function (buffer) { return getHash(buffer.getChannelData(0).subarray(hashFromIndex)); }, function (error) {\n if (error.name === \"timeout\" /* InnerErrorName.Timeout */ || error.name === \"suspended\" /* InnerErrorName.Suspended */) {\n return -3 /* SpecialFingerprint.Timeout */;\n }\n throw error;\n });\n // Suppresses the console error message in case when the fingerprint fails before requested\n suppressUnhandledRejectionWarning(fingerprintPromise);\n return function () {\n finishRendering();\n return fingerprintPromise;\n };\n}\n/**\n * Checks if the current browser is known to always suspend audio context\n */\nfunction doesCurrentBrowserSuspendAudioContext() {\n return isWebKit() && !isDesktopSafari() && !isWebKit606OrNewer();\n}\n/**\n * Starts rendering the audio context.\n * When the returned function is called, the render process starts finishing.\n */\nfunction startRenderingAudio(context) {\n var renderTryMaxCount = 3;\n var renderRetryDelay = 500;\n var runningMaxAwaitTime = 500;\n var runningSufficientTime = 5000;\n var finalize = function () { return undefined; };\n var resultPromise = new Promise(function (resolve, reject) {\n var isFinalized = false;\n var renderTryCount = 0;\n var startedRunningAt = 0;\n context.oncomplete = function (event) { return resolve(event.renderedBuffer); };\n var startRunningTimeout = function () {\n setTimeout(function () { return reject(makeInnerError(\"timeout\" /* InnerErrorName.Timeout */)); }, Math.min(runningMaxAwaitTime, startedRunningAt + runningSufficientTime - Date.now()));\n };\n var tryRender = function () {\n try {\n var renderingPromise = context.startRendering();\n // `context.startRendering` has two APIs: Promise and callback, we check that it's really a promise just in case\n if (isPromise(renderingPromise)) {\n // Suppresses all unhadled rejections in case of scheduled redundant retries after successful rendering\n suppressUnhandledRejectionWarning(renderingPromise);\n }\n switch (context.state) {\n case 'running':\n startedRunningAt = Date.now();\n if (isFinalized) {\n startRunningTimeout();\n }\n break;\n // Sometimes the audio context doesn't start after calling `startRendering` (in addition to the cases where\n // audio context doesn't start at all). A known case is starting an audio context when the browser tab is in\n // background on iPhone. Retries usually help in this case.\n case 'suspended':\n // The audio context can reject starting until the tab is in foreground. Long fingerprint duration\n // in background isn't a problem, therefore the retry attempts don't count in background. It can lead to\n // a situation when a fingerprint takes very long time and finishes successfully. FYI, the audio context\n // can be suspended when `document.hidden === false` and start running after a retry.\n if (!document.hidden) {\n renderTryCount++;\n }\n if (isFinalized && renderTryCount >= renderTryMaxCount) {\n reject(makeInnerError(\"suspended\" /* InnerErrorName.Suspended */));\n }\n else {\n setTimeout(tryRender, renderRetryDelay);\n }\n break;\n }\n }\n catch (error) {\n reject(error);\n }\n };\n tryRender();\n finalize = function () {\n if (!isFinalized) {\n isFinalized = true;\n if (startedRunningAt > 0) {\n startRunningTimeout();\n }\n }\n };\n });\n return [resultPromise, finalize];\n}\nfunction getHash(signal) {\n var hash = 0;\n for (var i = 0; i < signal.length; ++i) {\n hash += Math.abs(signal[i]);\n }\n return hash;\n}\nfunction makeInnerError(name) {\n var error = new Error(name);\n error.name = name;\n return error;\n}\n\n/**\n * Creates and keeps an invisible iframe while the given function runs.\n * The given function is called when the iframe is loaded and has a body.\n * The iframe allows to measure DOM sizes inside itself.\n *\n * Notice: passing an initial HTML code doesn't work in IE.\n *\n * Warning for package users:\n * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.\n */\nfunction withIframe(action, initialHtml, domPollInterval) {\n var _a, _b, _c;\n if (domPollInterval === void 0) { domPollInterval = 50; }\n return __awaiter(this, void 0, void 0, function () {\n var d, iframe;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n d = document;\n _d.label = 1;\n case 1:\n if (!!d.body) return [3 /*break*/, 3];\n return [4 /*yield*/, wait(domPollInterval)];\n case 2:\n _d.sent();\n return [3 /*break*/, 1];\n case 3:\n iframe = d.createElement('iframe');\n _d.label = 4;\n case 4:\n _d.trys.push([4, , 10, 11]);\n return [4 /*yield*/, new Promise(function (_resolve, _reject) {\n var isComplete = false;\n var resolve = function () {\n isComplete = true;\n _resolve();\n };\n var reject = function (error) {\n isComplete = true;\n _reject(error);\n };\n iframe.onload = resolve;\n iframe.onerror = reject;\n var style = iframe.style;\n style.setProperty('display', 'block', 'important'); // Required for browsers to calculate the layout\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.visibility = 'hidden';\n if (initialHtml && 'srcdoc' in iframe) {\n iframe.srcdoc = initialHtml;\n }\n else {\n iframe.src = 'about:blank';\n }\n d.body.appendChild(iframe);\n // WebKit in WeChat doesn't fire the iframe's `onload` for some reason.\n // This code checks for the loading state manually.\n // See https://github.com/fingerprintjs/fingerprintjs/issues/645\n var checkReadyState = function () {\n var _a, _b;\n // The ready state may never become 'complete' in Firefox despite the 'load' event being fired.\n // So an infinite setTimeout loop can happen without this check.\n // See https://github.com/fingerprintjs/fingerprintjs/pull/716#issuecomment-986898796\n if (isComplete) {\n return;\n }\n // Make sure iframe.contentWindow and iframe.contentWindow.document are both loaded\n // The contentWindow.document can miss in JSDOM (https://github.com/jsdom/jsdom).\n if (((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.readyState) === 'complete') {\n resolve();\n }\n else {\n setTimeout(checkReadyState, 10);\n }\n };\n checkReadyState();\n })];\n case 5:\n _d.sent();\n _d.label = 6;\n case 6:\n if (!!((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.body)) return [3 /*break*/, 8];\n return [4 /*yield*/, wait(domPollInterval)];\n case 7:\n _d.sent();\n return [3 /*break*/, 6];\n case 8: return [4 /*yield*/, action(iframe, iframe.contentWindow)];\n case 9: return [2 /*return*/, _d.sent()];\n case 10:\n (_c = iframe.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(iframe);\n return [7 /*endfinally*/];\n case 11: return [2 /*return*/];\n }\n });\n });\n}\n/**\n * Creates a DOM element that matches the given selector.\n * Only single element selector are supported (without operators like space, +, >, etc).\n */\nfunction selectorToElement(selector) {\n var _a = parseSimpleCssSelector(selector), tag = _a[0], attributes = _a[1];\n var element = document.createElement(tag !== null && tag !== void 0 ? tag : 'div');\n for (var _i = 0, _b = Object.keys(attributes); _i < _b.length; _i++) {\n var name_1 = _b[_i];\n var value = attributes[name_1].join(' ');\n // Changing the `style` attribute can cause a CSP error, therefore we change the `style.cssText` property.\n // https://github.com/fingerprintjs/fingerprintjs/issues/733\n if (name_1 === 'style') {\n addStyleString(element.style, value);\n }\n else {\n element.setAttribute(name_1, value);\n }\n }\n return element;\n}\n/**\n * Adds CSS styles from a string in such a way that doesn't trigger a CSP warning (unsafe-inline or unsafe-eval)\n */\nfunction addStyleString(style, source) {\n // We don't use `style.cssText` because browsers must block it when no `unsafe-eval` CSP is presented: https://csplite.com/csp145/#w3c_note\n // Even though the browsers ignore this standard, we don't use `cssText` just in case.\n for (var _i = 0, _a = source.split(';'); _i < _a.length; _i++) {\n var property = _a[_i];\n var match = /^\\s*([\\w-]+)\\s*:\\s*(.+?)(\\s*!([\\w-]+))?\\s*$/.exec(property);\n if (match) {\n var name_2 = match[1], value = match[2], priority = match[4];\n style.setProperty(name_2, value, priority || ''); // The last argument can't be undefined in IE11\n }\n }\n}\n\n// We use m or w because these two characters take up the maximum width.\n// And we use a LLi so that the same matching fonts can get separated.\nvar testString = 'mmMwWLliI0O&1';\n// We test using 48px font size, we may use any size. I guess larger the better.\nvar textSize = '48px';\n// A font will be compared against all the three default fonts.\n// And if for any default fonts it doesn't match, then that font is available.\nvar baseFonts = ['monospace', 'sans-serif', 'serif'];\nvar fontList = [\n // This is android-specific font from \"Roboto\" family\n 'sans-serif-thin',\n 'ARNO PRO',\n 'Agency FB',\n 'Arabic Typesetting',\n 'Arial Unicode MS',\n 'AvantGarde Bk BT',\n 'BankGothic Md BT',\n 'Batang',\n 'Bitstream Vera Sans Mono',\n 'Calibri',\n 'Century',\n 'Century Gothic',\n 'Clarendon',\n 'EUROSTILE',\n 'Franklin Gothic',\n 'Futura Bk BT',\n 'Futura Md BT',\n 'GOTHAM',\n 'Gill Sans',\n 'HELV',\n 'Haettenschweiler',\n 'Helvetica Neue',\n 'Humanst521 BT',\n 'Leelawadee',\n 'Letter Gothic',\n 'Levenim MT',\n 'Lucida Bright',\n 'Lucida Sans',\n 'Menlo',\n 'MS Mincho',\n 'MS Outlook',\n 'MS Reference Specialty',\n 'MS UI Gothic',\n 'MT Extra',\n 'MYRIAD PRO',\n 'Marlett',\n 'Meiryo UI',\n 'Microsoft Uighur',\n 'Minion Pro',\n 'Monotype Corsiva',\n 'PMingLiU',\n 'Pristina',\n 'SCRIPTINA',\n 'Segoe UI Light',\n 'Serifa',\n 'SimHei',\n 'Small Fonts',\n 'Staccato222 BT',\n 'TRAJAN PRO',\n 'Univers CE 55 Medium',\n 'Vrinda',\n 'ZWAdobeF',\n];\n// kudos to http://www.lalit.org/lab/javascript-css-font-detect/\nfunction getFonts() {\n // Running the script in an iframe makes it not affect the page look and not be affected by the page CSS. See:\n // https://github.com/fingerprintjs/fingerprintjs/issues/592\n // https://github.com/fingerprintjs/fingerprintjs/issues/628\n return withIframe(function (_, _a) {\n var document = _a.document;\n var holder = document.body;\n holder.style.fontSize = textSize;\n // div to load spans for the default fonts and the fonts to detect\n var spansContainer = document.createElement('div');\n var defaultWidth = {};\n var defaultHeight = {};\n // creates a span where the fonts will be loaded\n var createSpan = function (fontFamily) {\n var span = document.createElement('span');\n var style = span.style;\n style.position = 'absolute';\n style.top = '0';\n style.left = '0';\n style.fontFamily = fontFamily;\n span.textContent = testString;\n spansContainer.appendChild(span);\n return span;\n };\n // creates a span and load the font to detect and a base font for fallback\n var createSpanWithFonts = function (fontToDetect, baseFont) {\n return createSpan(\"'\".concat(fontToDetect, \"',\").concat(baseFont));\n };\n // creates spans for the base fonts and adds them to baseFontsDiv\n var initializeBaseFontsSpans = function () {\n return baseFonts.map(createSpan);\n };\n // creates spans for the fonts to detect and adds them to fontsDiv\n var initializeFontsSpans = function () {\n // Stores {fontName : [spans for that font]}\n var spans = {};\n var _loop_1 = function (font) {\n spans[font] = baseFonts.map(function (baseFont) { return createSpanWithFonts(font, baseFont); });\n };\n for (var _i = 0, fontList_1 = fontList; _i < fontList_1.length; _i++) {\n var font = fontList_1[_i];\n _loop_1(font);\n }\n return spans;\n };\n // checks if a font is available\n var isFontAvailable = function (fontSpans) {\n return baseFonts.some(function (baseFont, baseFontIndex) {\n return fontSpans[baseFontIndex].offsetWidth !== defaultWidth[baseFont] ||\n fontSpans[baseFontIndex].offsetHeight !== defaultHeight[baseFont];\n });\n };\n // create spans for base fonts\n var baseFontsSpans = initializeBaseFontsSpans();\n // create spans for fonts to detect\n var fontsSpans = initializeFontsSpans();\n // add all the spans to the DOM\n holder.appendChild(spansContainer);\n // get the default width for the three base fonts\n for (var index = 0; index < baseFonts.length; index++) {\n defaultWidth[baseFonts[index]] = baseFontsSpans[index].offsetWidth; // width for the default font\n defaultHeight[baseFonts[index]] = baseFontsSpans[index].offsetHeight; // height for the default font\n }\n // check available fonts\n return fontList.filter(function (font) { return isFontAvailable(fontsSpans[font]); });\n });\n}\n\nfunction getPlugins() {\n var rawPlugins = navigator.plugins;\n if (!rawPlugins) {\n return undefined;\n }\n var plugins = [];\n // Safari 10 doesn't support iterating navigator.plugins with for...of\n for (var i = 0; i < rawPlugins.length; ++i) {\n var plugin = rawPlugins[i];\n if (!plugin) {\n continue;\n }\n var mimeTypes = [];\n for (var j = 0; j < plugin.length; ++j) {\n var mimeType = plugin[j];\n mimeTypes.push({\n type: mimeType.type,\n suffixes: mimeType.suffixes,\n });\n }\n plugins.push({\n name: plugin.name,\n description: plugin.description,\n mimeTypes: mimeTypes,\n });\n }\n return plugins;\n}\n\n// https://www.browserleaks.com/canvas#how-does-it-work\nfunction getCanvasFingerprint() {\n var winding = false;\n var geometry;\n var text;\n var _a = makeCanvasContext(), canvas = _a[0], context = _a[1];\n if (!isSupported(canvas, context)) {\n geometry = text = ''; // The value will be 'unsupported' in v3.4\n }\n else {\n winding = doesSupportWinding(context);\n renderTextImage(canvas, context);\n var textImage1 = canvasToString(canvas);\n var textImage2 = canvasToString(canvas); // It's slightly faster to double-encode the text image\n // Some browsers add a noise to the canvas: https://github.com/fingerprintjs/fingerprintjs/issues/791\n // The canvas is excluded from the fingerprint in this case\n if (textImage1 !== textImage2) {\n geometry = text = 'unstable';\n }\n else {\n text = textImage1;\n // Text is unstable:\n // https://github.com/fingerprintjs/fingerprintjs/issues/583\n // https://github.com/fingerprintjs/fingerprintjs/issues/103\n // Therefore it's extracted into a separate image.\n renderGeometryImage(canvas, context);\n geometry = canvasToString(canvas);\n }\n }\n return { winding: winding, geometry: geometry, text: text };\n}\nfunction makeCanvasContext() {\n var canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n return [canvas, canvas.getContext('2d')];\n}\nfunction isSupported(canvas, context) {\n return !!(context && canvas.toDataURL);\n}\nfunction doesSupportWinding(context) {\n // https://web.archive.org/web/20170825024655/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\n // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/canvas/winding.js\n context.rect(0, 0, 10, 10);\n context.rect(2, 2, 6, 6);\n return !context.isPointInPath(5, 5, 'evenodd');\n}\nfunction renderTextImage(canvas, context) {\n // Resizing the canvas cleans it\n canvas.width = 240;\n canvas.height = 60;\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#f60';\n context.fillRect(100, 1, 62, 20);\n context.fillStyle = '#069';\n // It's important to use explicit built-in fonts in order to exclude the affect of font preferences\n // (there is a separate entropy source for them).\n context.font = '11pt \"Times New Roman\"';\n // The choice of emojis has a gigantic impact on rendering performance (especially in FF).\n // Some newer emojis cause it to slow down 50-200 times.\n // There must be no text to the right of the emoji, see https://github.com/fingerprintjs/fingerprintjs/issues/574\n // A bare emoji shouldn't be used because the canvas will change depending on the script encoding:\n // https://github.com/fingerprintjs/fingerprintjs/issues/66\n // Escape sequence shouldn't be used too because Terser will turn it into a bare unicode.\n var printedText = \"Cwm fjordbank gly \".concat(String.fromCharCode(55357, 56835) /* 😃 */);\n context.fillText(printedText, 2, 15);\n context.fillStyle = 'rgba(102, 204, 0, 0.2)';\n context.font = '18pt Arial';\n context.fillText(printedText, 4, 45);\n}\nfunction renderGeometryImage(canvas, context) {\n // Resizing the canvas cleans it\n canvas.width = 122;\n canvas.height = 110;\n // Canvas blending\n // https://web.archive.org/web/20170826194121/http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/\n // http://jsfiddle.net/NDYV8/16/\n context.globalCompositeOperation = 'multiply';\n for (var _i = 0, _a = [\n ['#f2f', 40, 40],\n ['#2ff', 80, 40],\n ['#ff2', 60, 80],\n ]; _i < _a.length; _i++) {\n var _b = _a[_i], color = _b[0], x = _b[1], y = _b[2];\n context.fillStyle = color;\n context.beginPath();\n context.arc(x, y, 40, 0, Math.PI * 2, true);\n context.closePath();\n context.fill();\n }\n // Canvas winding\n // https://web.archive.org/web/20130913061632/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/\n // http://jsfiddle.net/NDYV8/19/\n context.fillStyle = '#f9c';\n context.arc(60, 60, 60, 0, Math.PI * 2, true);\n context.arc(60, 60, 20, 0, Math.PI * 2, true);\n context.fill('evenodd');\n}\nfunction canvasToString(canvas) {\n return canvas.toDataURL();\n}\n\n/**\n * This is a crude and primitive touch screen detection. It's not possible to currently reliably detect the availability\n * of a touch screen with a JS, without actually subscribing to a touch event.\n *\n * @see http://www.stucox.com/blog/you-cant-detect-a-touchscreen/\n * @see https://github.com/Modernizr/Modernizr/issues/548\n */\nfunction getTouchSupport() {\n var n = navigator;\n var maxTouchPoints = 0;\n var touchEvent;\n if (n.maxTouchPoints !== undefined) {\n maxTouchPoints = toInt(n.maxTouchPoints);\n }\n else if (n.msMaxTouchPoints !== undefined) {\n maxTouchPoints = n.msMaxTouchPoints;\n }\n try {\n document.createEvent('TouchEvent');\n touchEvent = true;\n }\n catch (_a) {\n touchEvent = false;\n }\n var touchStart = 'ontouchstart' in window;\n return {\n maxTouchPoints: maxTouchPoints,\n touchEvent: touchEvent,\n touchStart: touchStart,\n };\n}\n\nfunction getOsCpu() {\n return navigator.oscpu;\n}\n\nfunction getLanguages() {\n var n = navigator;\n var result = [];\n var language = n.language || n.userLanguage || n.browserLanguage || n.systemLanguage;\n if (language !== undefined) {\n result.push([language]);\n }\n if (Array.isArray(n.languages)) {\n // Starting from Chromium 86, there is only a single value in `navigator.language` in Incognito mode:\n // the value of `navigator.language`. Therefore the value is ignored in this browser.\n if (!(isChromium() && isChromium86OrNewer())) {\n result.push(n.languages);\n }\n }\n else if (typeof n.languages === 'string') {\n var languages = n.languages;\n if (languages) {\n result.push(languages.split(','));\n }\n }\n return result;\n}\n\nfunction getColorDepth() {\n return window.screen.colorDepth;\n}\n\nfunction getDeviceMemory() {\n // `navigator.deviceMemory` is a string containing a number in some unidentified cases\n return replaceNaN(toFloat(navigator.deviceMemory), undefined);\n}\n\nfunction getScreenResolution() {\n var s = screen;\n // Some browsers return screen resolution as strings, e.g. \"1200\", instead of a number, e.g. 1200.\n // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.\n // Some browsers even return screen resolution as not numbers.\n var parseDimension = function (value) { return replaceNaN(toInt(value), null); };\n var dimensions = [parseDimension(s.width), parseDimension(s.height)];\n dimensions.sort().reverse();\n return dimensions;\n}\n\nvar screenFrameCheckInterval = 2500;\nvar roundingPrecision = 10;\n// The type is readonly to protect from unwanted mutations\nvar screenFrameBackup;\nvar screenFrameSizeTimeoutId;\n/**\n * Starts watching the screen frame size. When a non-zero size appears, the size is saved and the watch is stopped.\n * Later, when `getScreenFrame` runs, it will return the saved non-zero size if the current size is null.\n *\n * This trick is required to mitigate the fact that the screen frame turns null in some cases.\n * See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n */\nfunction watchScreenFrame() {\n if (screenFrameSizeTimeoutId !== undefined) {\n return;\n }\n var checkScreenFrame = function () {\n var frameSize = getCurrentScreenFrame();\n if (isFrameSizeNull(frameSize)) {\n screenFrameSizeTimeoutId = setTimeout(checkScreenFrame, screenFrameCheckInterval);\n }\n else {\n screenFrameBackup = frameSize;\n screenFrameSizeTimeoutId = undefined;\n }\n };\n checkScreenFrame();\n}\nfunction getScreenFrame() {\n var _this = this;\n watchScreenFrame();\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var frameSize;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n frameSize = getCurrentScreenFrame();\n if (!isFrameSizeNull(frameSize)) return [3 /*break*/, 2];\n if (screenFrameBackup) {\n return [2 /*return*/, __spreadArray([], screenFrameBackup, true)];\n }\n if (!getFullscreenElement()) return [3 /*break*/, 2];\n // Some browsers set the screen frame to zero when programmatic fullscreen is on.\n // There is a chance of getting a non-zero frame after exiting the fullscreen.\n // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n return [4 /*yield*/, exitFullscreen()];\n case 1:\n // Some browsers set the screen frame to zero when programmatic fullscreen is on.\n // There is a chance of getting a non-zero frame after exiting the fullscreen.\n // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568\n _a.sent();\n frameSize = getCurrentScreenFrame();\n _a.label = 2;\n case 2:\n if (!isFrameSizeNull(frameSize)) {\n screenFrameBackup = frameSize;\n }\n return [2 /*return*/, frameSize];\n }\n });\n }); };\n}\n/**\n * Sometimes the available screen resolution changes a bit, e.g. 1900x1440 → 1900x1439. A possible reason: macOS Dock\n * shrinks to fit more icons when there is too little space. The rounding is used to mitigate the difference.\n */\nfunction getRoundedScreenFrame() {\n var _this = this;\n var screenFrameGetter = getScreenFrame();\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var frameSize, processSize;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, screenFrameGetter()];\n case 1:\n frameSize = _a.sent();\n processSize = function (sideSize) { return (sideSize === null ? null : round(sideSize, roundingPrecision)); };\n // It might look like I don't know about `for` and `map`.\n // In fact, such code is used to avoid TypeScript issues without using `as`.\n return [2 /*return*/, [processSize(frameSize[0]), processSize(frameSize[1]), processSize(frameSize[2]), processSize(frameSize[3])]];\n }\n });\n }); };\n}\nfunction getCurrentScreenFrame() {\n var s = screen;\n // Some browsers return screen resolution as strings, e.g. \"1200\", instead of a number, e.g. 1200.\n // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.\n //\n // Some browsers (IE, Edge ≤18) don't provide `screen.availLeft` and `screen.availTop`. The property values are\n // replaced with 0 in such cases to not lose the entropy from `screen.availWidth` and `screen.availHeight`.\n return [\n replaceNaN(toFloat(s.availTop), null),\n replaceNaN(toFloat(s.width) - toFloat(s.availWidth) - replaceNaN(toFloat(s.availLeft), 0), null),\n replaceNaN(toFloat(s.height) - toFloat(s.availHeight) - replaceNaN(toFloat(s.availTop), 0), null),\n replaceNaN(toFloat(s.availLeft), null),\n ];\n}\nfunction isFrameSizeNull(frameSize) {\n for (var i = 0; i < 4; ++i) {\n if (frameSize[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction getHardwareConcurrency() {\n // sometimes hardware concurrency is a string\n return replaceNaN(toInt(navigator.hardwareConcurrency), undefined);\n}\n\nfunction getTimezone() {\n var _a;\n var DateTimeFormat = (_a = window.Intl) === null || _a === void 0 ? void 0 : _a.DateTimeFormat;\n if (DateTimeFormat) {\n var timezone = new DateTimeFormat().resolvedOptions().timeZone;\n if (timezone) {\n return timezone;\n }\n }\n // For browsers that don't support timezone names\n // The minus is intentional because the JS offset is opposite to the real offset\n var offset = -getTimezoneOffset();\n return \"UTC\".concat(offset >= 0 ? '+' : '').concat(Math.abs(offset));\n}\nfunction getTimezoneOffset() {\n var currentYear = new Date().getFullYear();\n // The timezone offset may change over time due to daylight saving time (DST) shifts.\n // The non-DST timezone offset is used as the result timezone offset.\n // Since the DST season differs in the northern and the southern hemispheres,\n // both January and July timezones offsets are considered.\n return Math.max(\n // `getTimezoneOffset` returns a number as a string in some unidentified cases\n toFloat(new Date(currentYear, 0, 1).getTimezoneOffset()), toFloat(new Date(currentYear, 6, 1).getTimezoneOffset()));\n}\n\nfunction getSessionStorage() {\n try {\n return !!window.sessionStorage;\n }\n catch (error) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\n// https://bugzilla.mozilla.org/show_bug.cgi?id=781447\nfunction getLocalStorage() {\n try {\n return !!window.localStorage;\n }\n catch (e) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\nfunction getIndexedDB() {\n // IE and Edge don't allow accessing indexedDB in private mode, therefore IE and Edge will have different\n // visitor identifier in normal and private modes.\n if (isTrident() || isEdgeHTML()) {\n return undefined;\n }\n try {\n return !!window.indexedDB;\n }\n catch (e) {\n /* SecurityError when referencing it means it exists */\n return true;\n }\n}\n\nfunction getOpenDatabase() {\n return !!window.openDatabase;\n}\n\nfunction getCpuClass() {\n return navigator.cpuClass;\n}\n\nfunction getPlatform() {\n // Android Chrome 86 and 87 and Android Firefox 80 and 84 don't mock the platform value when desktop mode is requested\n var platform = navigator.platform;\n // iOS mocks the platform value when desktop version is requested: https://github.com/fingerprintjs/fingerprintjs/issues/514\n // iPad uses desktop mode by default since iOS 13\n // The value is 'MacIntel' on M1 Macs\n // The value is 'iPhone' on iPod Touch\n if (platform === 'MacIntel') {\n if (isWebKit() && !isDesktopSafari()) {\n return isIPad() ? 'iPad' : 'iPhone';\n }\n }\n return platform;\n}\n\nfunction getVendor() {\n return navigator.vendor || '';\n}\n\n/**\n * Checks for browser-specific (not engine specific) global variables to tell browsers with the same engine apart.\n * Only somewhat popular browsers are considered.\n */\nfunction getVendorFlavors() {\n var flavors = [];\n for (var _i = 0, _a = [\n // Blink and some browsers on iOS\n 'chrome',\n // Safari on macOS\n 'safari',\n // Chrome on iOS (checked in 85 on 13 and 87 on 14)\n '__crWeb',\n '__gCrWeb',\n // Yandex Browser on iOS, macOS and Android (checked in 21.2 on iOS 14, macOS and Android)\n 'yandex',\n // Yandex Browser on iOS (checked in 21.2 on 14)\n '__yb',\n '__ybro',\n // Firefox on iOS (checked in 32 on 14)\n '__firefox__',\n // Edge on iOS (checked in 46 on 14)\n '__edgeTrackingPreventionStatistics',\n 'webkit',\n // Opera Touch on iOS (checked in 2.6 on 14)\n 'oprt',\n // Samsung Internet on Android (checked in 11.1)\n 'samsungAr',\n // UC Browser on Android (checked in 12.10 and 13.0)\n 'ucweb',\n 'UCShellJava',\n // Puffin on Android (checked in 9.0)\n 'puffinDevice',\n // UC on iOS and Opera on Android have no specific global variables\n // Edge for Android isn't checked\n ]; _i < _a.length; _i++) {\n var key = _a[_i];\n var value = window[key];\n if (value && typeof value === 'object') {\n flavors.push(key);\n }\n }\n return flavors.sort();\n}\n\n/**\n * navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking\n * cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past with\n * site-specific exceptions. Don't rely on it.\n *\n * @see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js Taken from here\n */\nfunction areCookiesEnabled() {\n var d = document;\n // Taken from here: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js\n // navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking\n // cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past\n // with site-specific exceptions. Don't rely on it.\n // try..catch because some in situations `document.cookie` is exposed but throws a\n // SecurityError if you try to access it; e.g. documents created from data URIs\n // or in sandboxed iframes (depending on flags/context)\n try {\n // Create cookie\n d.cookie = 'cookietest=1; SameSite=Strict;';\n var result = d.cookie.indexOf('cookietest=') !== -1;\n // Delete cookie\n d.cookie = 'cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT';\n return result;\n }\n catch (e) {\n return false;\n }\n}\n\n/**\n * Only single element selector are supported (no operators like space, +, >, etc).\n * `embed` and `position: fixed;` will be considered as blocked anyway because it always has no offsetParent.\n * Avoid `iframe` and anything with `[src=]` because they produce excess HTTP requests.\n *\n * The \"inappropriate\" selectors are obfuscated. See https://github.com/fingerprintjs/fingerprintjs/issues/734.\n * A function is used instead of a plain object to help tree-shaking.\n *\n * The function code is generated automatically. See docs/content_blockers.md to learn how to make the list.\n */\nfunction getFilters() {\n var fromB64 = atob; // Just for better minification\n return {\n abpIndo: [\n '#Iklan-Melayang',\n '#Kolom-Iklan-728',\n '#SidebarIklan-wrapper',\n '[title=\"ALIENBOLA\" i]',\n fromB64('I0JveC1CYW5uZXItYWRz'),\n ],\n abpvn: ['.quangcao', '#mobileCatfish', fromB64('LmNsb3NlLWFkcw=='), '[id^=\"bn_bottom_fixed_\"]', '#pmadv'],\n adBlockFinland: [\n '.mainostila',\n fromB64('LnNwb25zb3JpdA=='),\n '.ylamainos',\n fromB64('YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd'),\n ],\n adBlockPersian: [\n '#navbar_notice_50',\n '.kadr',\n 'TABLE[width=\"140px\"]',\n '#divAgahi',\n fromB64('YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd'),\n ],\n adBlockWarningRemoval: [\n '#adblock-honeypot',\n '.adblocker-root',\n '.wp_adblock_detect',\n fromB64('LmhlYWRlci1ibG9ja2VkLWFk'),\n fromB64('I2FkX2Jsb2NrZXI='),\n ],\n adGuardAnnoyances: [\n '.hs-sosyal',\n '#cookieconsentdiv',\n 'div[class^=\"app_gdpr\"]',\n '.as-oil',\n '[data-cypress=\"soft-push-notification-modal\"]',\n ],\n adGuardBase: [\n '.BetterJsPopOverlay',\n fromB64('I2FkXzMwMFgyNTA='),\n fromB64('I2Jhbm5lcmZsb2F0MjI='),\n fromB64('I2NhbXBhaWduLWJhbm5lcg=='),\n fromB64('I0FkLUNvbnRlbnQ='),\n ],\n adGuardChinese: [\n fromB64('LlppX2FkX2FfSA=='),\n fromB64('YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd'),\n '#widget-quan',\n fromB64('YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd'),\n fromB64('YVtocmVmKj0iLjE5NTZobC5jb20vIl0='),\n ],\n adGuardFrench: [\n '#pavePub',\n fromB64('LmFkLWRlc2t0b3AtcmVjdGFuZ2xl'),\n '.mobile_adhesion',\n '.widgetadv',\n fromB64('LmFkc19iYW4='),\n ],\n adGuardGerman: ['aside[data-portal-id=\"leaderboard\"]'],\n adGuardJapanese: [\n '#kauli_yad_1',\n fromB64('YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0='),\n fromB64('Ll9wb3BJbl9pbmZpbml0ZV9hZA=='),\n fromB64('LmFkZ29vZ2xl'),\n fromB64('Ll9faXNib29zdFJldHVybkFk'),\n ],\n adGuardMobile: [\n fromB64('YW1wLWF1dG8tYWRz'),\n fromB64('LmFtcF9hZA=='),\n 'amp-embed[type=\"24smi\"]',\n '#mgid_iframe1',\n fromB64('I2FkX2ludmlld19hcmVh'),\n ],\n adGuardRussian: [\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0='),\n fromB64('LnJlY2xhbWE='),\n 'div[id^=\"smi2adblock\"]',\n fromB64('ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd'),\n '#psyduckpockeball',\n ],\n adGuardSocial: [\n fromB64('YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0='),\n fromB64('YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0='),\n '.etsy-tweet',\n '#inlineShare',\n '.popup-social',\n ],\n adGuardSpanishPortuguese: ['#barraPublicidade', '#Publicidade', '#publiEspecial', '#queTooltip', '.cnt-publi'],\n adGuardTrackingProtection: [\n '#qoo-counter',\n fromB64('YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=='),\n fromB64('YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0='),\n fromB64('YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=='),\n '#top100counter',\n ],\n adGuardTurkish: [\n '#backkapat',\n fromB64('I3Jla2xhbWk='),\n fromB64('YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0='),\n fromB64('YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd'),\n fromB64('YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ=='),\n ],\n bulgarian: [fromB64('dGQjZnJlZW5ldF90YWJsZV9hZHM='), '#ea_intext_div', '.lapni-pop-over', '#xenium_hot_offers'],\n easyList: [\n '.yb-floorad',\n fromB64('LndpZGdldF9wb19hZHNfd2lkZ2V0'),\n fromB64('LnRyYWZmaWNqdW5reS1hZA=='),\n '.textad_headline',\n fromB64('LnNwb25zb3JlZC10ZXh0LWxpbmtz'),\n ],\n easyListChina: [\n fromB64('LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=='),\n fromB64('LmZyb250cGFnZUFkdk0='),\n '#taotaole',\n '#aafoot.top_box',\n '.cfa_popup',\n ],\n easyListCookie: [\n '.ezmob-footer',\n '.cc-CookieWarning',\n '[data-cookie-number]',\n fromB64('LmF3LWNvb2tpZS1iYW5uZXI='),\n '.sygnal24-gdpr-modal-wrap',\n ],\n easyListCzechSlovak: [\n '#onlajny-stickers',\n fromB64('I3Jla2xhbW5pLWJveA=='),\n fromB64('LnJla2xhbWEtbWVnYWJvYXJk'),\n '.sklik',\n fromB64('W2lkXj0ic2tsaWtSZWtsYW1hIl0='),\n ],\n easyListDutch: [\n fromB64('I2FkdmVydGVudGll'),\n fromB64('I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=='),\n '.adstekst',\n fromB64('YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0='),\n '#semilo-lrectangle',\n ],\n easyListGermany: [\n '#SSpotIMPopSlider',\n fromB64('LnNwb25zb3JsaW5rZ3J1ZW4='),\n fromB64('I3dlcmJ1bmdza3k='),\n fromB64('I3Jla2xhbWUtcmVjaHRzLW1pdHRl'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0='),\n ],\n easyListItaly: [\n fromB64('LmJveF9hZHZfYW5udW5jaQ=='),\n '.sb-box-pubbliredazionale',\n fromB64('YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ=='),\n ],\n easyListLithuania: [\n fromB64('LnJla2xhbW9zX3RhcnBhcw=='),\n fromB64('LnJla2xhbW9zX251b3JvZG9z'),\n fromB64('aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd'),\n fromB64('aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd'),\n fromB64('aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd'),\n ],\n estonian: [fromB64('QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==')],\n fanboyAnnoyances: ['#ac-lre-player', '.navigate-to-top', '#subscribe_popup', '.newsletter_holder', '#back-top'],\n fanboyAntiFacebook: ['.util-bar-module-firefly-visible'],\n fanboyEnhancedTrackers: [\n '.open.pushModal',\n '#issuem-leaky-paywall-articles-zero-remaining-nag',\n '#sovrn_container',\n 'div[class$=\"-hide\"][zoompage-fontsize][style=\"display: block;\"]',\n '.BlockNag__Card',\n ],\n fanboySocial: ['#FollowUs', '#meteored_share', '#social_follow', '.article-sharer', '.community__social-desc'],\n frellwitSwedish: [\n fromB64('YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=='),\n fromB64('YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=='),\n 'article.category-samarbete',\n fromB64('ZGl2LmhvbGlkQWRz'),\n 'ul.adsmodern',\n ],\n greekAdBlock: [\n fromB64('QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd'),\n fromB64('QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=='),\n fromB64('QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd'),\n 'DIV.agores300',\n 'TABLE.advright',\n ],\n hungarian: [\n '#cemp_doboz',\n '.optimonk-iframe-container',\n fromB64('LmFkX19tYWlu'),\n fromB64('W2NsYXNzKj0iR29vZ2xlQWRzIl0='),\n '#hirdetesek_box',\n ],\n iDontCareAboutCookies: [\n '.alert-info[data-block-track*=\"CookieNotice\"]',\n '.ModuleTemplateCookieIndicator',\n '.o--cookies--container',\n '#cookies-policy-sticky',\n '#stickyCookieBar',\n ],\n icelandicAbp: [fromB64('QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==')],\n latvian: [\n fromB64('YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0O' +\n 'iA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0='),\n fromB64('YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6I' +\n 'DMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ=='),\n ],\n listKr: [\n fromB64('YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0='),\n fromB64('I2xpdmVyZUFkV3JhcHBlcg=='),\n fromB64('YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=='),\n fromB64('aW5zLmZhc3R2aWV3LWFk'),\n '.revenue_unit_item.dable',\n ],\n listeAr: [\n fromB64('LmdlbWluaUxCMUFk'),\n '.right-and-left-sponsers',\n fromB64('YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=='),\n fromB64('YVtocmVmKj0iYm9vcmFxLm9yZyJd'),\n fromB64('YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd'),\n ],\n listeFr: [\n fromB64('YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=='),\n fromB64('I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=='),\n fromB64('YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0='),\n '.site-pub-interstitiel',\n 'div[id^=\"crt-\"][data-criteo-id]',\n ],\n officialPolish: [\n '#ceneo-placeholder-ceneo-12',\n fromB64('W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd'),\n fromB64('YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=='),\n fromB64('YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=='),\n fromB64('ZGl2I3NrYXBpZWNfYWQ='),\n ],\n ro: [\n fromB64('YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd'),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0='),\n fromB64('YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd'),\n 'a[href^=\"/url/\"]',\n ],\n ruAd: [\n fromB64('YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd'),\n fromB64('YVtocmVmKj0iLy91dGltZy5ydS8iXQ=='),\n fromB64('YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0='),\n '#pgeldiz',\n '.yandex-rtb-block',\n ],\n thaiAds: [\n 'a[href*=macau-uta-popup]',\n fromB64('I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=='),\n fromB64('LmFkczMwMHM='),\n '.bumq',\n '.img-kosana',\n ],\n webAnnoyancesUltralist: [\n '#mod-social-share-2',\n '#social-tools',\n fromB64('LmN0cGwtZnVsbGJhbm5lcg=='),\n '.zergnet-recommend',\n '.yt.btn-link.btn-md.btn',\n ],\n };\n}\n/**\n * The order of the returned array means nothing (it's always sorted alphabetically).\n *\n * Notice that the source is slightly unstable.\n * Safari provides a 2-taps way to disable all content blockers on a page temporarily.\n * Also content blockers can be disabled permanently for a domain, but it requires 4 taps.\n * So empty array shouldn't be treated as \"no blockers\", it should be treated as \"no signal\".\n * If you are a website owner, don't make your visitors want to disable content blockers.\n */\nfunction getDomBlockers(_a) {\n var _b = _a === void 0 ? {} : _a, debug = _b.debug;\n return __awaiter(this, void 0, void 0, function () {\n var filters, filterNames, allSelectors, blockedSelectors, activeBlockers;\n var _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n if (!isApplicable()) {\n return [2 /*return*/, undefined];\n }\n filters = getFilters();\n filterNames = Object.keys(filters);\n allSelectors = (_c = []).concat.apply(_c, filterNames.map(function (filterName) { return filters[filterName]; }));\n return [4 /*yield*/, getBlockedSelectors(allSelectors)];\n case 1:\n blockedSelectors = _d.sent();\n if (debug) {\n printDebug(filters, blockedSelectors);\n }\n activeBlockers = filterNames.filter(function (filterName) {\n var selectors = filters[filterName];\n var blockedCount = countTruthy(selectors.map(function (selector) { return blockedSelectors[selector]; }));\n return blockedCount > selectors.length * 0.6;\n });\n activeBlockers.sort();\n return [2 /*return*/, activeBlockers];\n }\n });\n });\n}\nfunction isApplicable() {\n // Safari (desktop and mobile) and all Android browsers keep content blockers in both regular and private mode\n return isWebKit() || isAndroid();\n}\nfunction getBlockedSelectors(selectors) {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var d, root, elements, blockedSelectors, i, element, holder, i;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n d = document;\n root = d.createElement('div');\n elements = new Array(selectors.length);\n blockedSelectors = {} // Set() isn't used just in case somebody need older browser support\n ;\n forceShow(root);\n // First create all elements that can be blocked. If the DOM steps below are done in a single cycle,\n // browser will alternate tree modification and layout reading, that is very slow.\n for (i = 0; i < selectors.length; ++i) {\n element = selectorToElement(selectors[i]);\n if (element.tagName === 'DIALOG') {\n element.show();\n }\n holder = d.createElement('div') // Protects from unwanted effects of `+` and `~` selectors of filters\n ;\n forceShow(holder);\n holder.appendChild(element);\n root.appendChild(holder);\n elements[i] = element;\n }\n _b.label = 1;\n case 1:\n if (!!d.body) return [3 /*break*/, 3];\n return [4 /*yield*/, wait(50)];\n case 2:\n _b.sent();\n return [3 /*break*/, 1];\n case 3:\n d.body.appendChild(root);\n try {\n // Then check which of the elements are blocked\n for (i = 0; i < selectors.length; ++i) {\n if (!elements[i].offsetParent) {\n blockedSelectors[selectors[i]] = true;\n }\n }\n }\n finally {\n // Then remove the elements\n (_a = root.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(root);\n }\n return [2 /*return*/, blockedSelectors];\n }\n });\n });\n}\nfunction forceShow(element) {\n element.style.setProperty('display', 'block', 'important');\n}\nfunction printDebug(filters, blockedSelectors) {\n var message = 'DOM blockers debug:\\n```';\n for (var _i = 0, _a = Object.keys(filters); _i < _a.length; _i++) {\n var filterName = _a[_i];\n message += \"\\n\".concat(filterName, \":\");\n for (var _b = 0, _c = filters[filterName]; _b < _c.length; _b++) {\n var selector = _c[_b];\n message += \"\\n \".concat(blockedSelectors[selector] ? '🚫' : '➡️', \" \").concat(selector);\n }\n }\n // console.log is ok here because it's under a debug clause\n // eslint-disable-next-line no-console\n console.log(\"\".concat(message, \"\\n```\"));\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/color-gamut\n */\nfunction getColorGamut() {\n // rec2020 includes p3 and p3 includes srgb\n for (var _i = 0, _a = ['rec2020', 'p3', 'srgb']; _i < _a.length; _i++) {\n var gamut = _a[_i];\n if (matchMedia(\"(color-gamut: \".concat(gamut, \")\")).matches) {\n return gamut;\n }\n }\n return undefined;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/inverted-colors\n */\nfunction areColorsInverted() {\n if (doesMatch$4('inverted')) {\n return true;\n }\n if (doesMatch$4('none')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$4(value) {\n return matchMedia(\"(inverted-colors: \".concat(value, \")\")).matches;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors\n */\nfunction areColorsForced() {\n if (doesMatch$3('active')) {\n return true;\n }\n if (doesMatch$3('none')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$3(value) {\n return matchMedia(\"(forced-colors: \".concat(value, \")\")).matches;\n}\n\nvar maxValueToCheck = 100;\n/**\n * If the display is monochrome (e.g. black&white), the value will be ≥0 and will mean the number of bits per pixel.\n * If the display is not monochrome, the returned value will be 0.\n * If the browser doesn't support this feature, the returned value will be undefined.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/monochrome\n */\nfunction getMonochromeDepth() {\n if (!matchMedia('(min-monochrome: 0)').matches) {\n // The media feature isn't supported by the browser\n return undefined;\n }\n // A variation of binary search algorithm can be used here.\n // But since expected values are very small (≤10), there is no sense in adding the complexity.\n for (var i = 0; i <= maxValueToCheck; ++i) {\n if (matchMedia(\"(max-monochrome: \".concat(i, \")\")).matches) {\n return i;\n }\n }\n throw new Error('Too high value');\n}\n\n/**\n * @see https://www.w3.org/TR/mediaqueries-5/#prefers-contrast\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast\n */\nfunction getContrastPreference() {\n if (doesMatch$2('no-preference')) {\n return 0 /* ContrastPreference.None */;\n }\n // The sources contradict on the keywords. Probably 'high' and 'low' will never be implemented.\n // Need to check it when all browsers implement the feature.\n if (doesMatch$2('high') || doesMatch$2('more')) {\n return 1 /* ContrastPreference.More */;\n }\n if (doesMatch$2('low') || doesMatch$2('less')) {\n return -1 /* ContrastPreference.Less */;\n }\n if (doesMatch$2('forced')) {\n return 10 /* ContrastPreference.ForcedColors */;\n }\n return undefined;\n}\nfunction doesMatch$2(value) {\n return matchMedia(\"(prefers-contrast: \".concat(value, \")\")).matches;\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion\n */\nfunction isMotionReduced() {\n if (doesMatch$1('reduce')) {\n return true;\n }\n if (doesMatch$1('no-preference')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch$1(value) {\n return matchMedia(\"(prefers-reduced-motion: \".concat(value, \")\")).matches;\n}\n\n/**\n * @see https://www.w3.org/TR/mediaqueries-5/#dynamic-range\n */\nfunction isHDR() {\n if (doesMatch('high')) {\n return true;\n }\n if (doesMatch('standard')) {\n return false;\n }\n return undefined;\n}\nfunction doesMatch(value) {\n return matchMedia(\"(dynamic-range: \".concat(value, \")\")).matches;\n}\n\nvar M = Math; // To reduce the minified code size\nvar fallbackFn = function () { return 0; };\n/**\n * @see https://gitlab.torproject.org/legacy/trac/-/issues/13018\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=531915\n */\nfunction getMathFingerprint() {\n // Native operations\n var acos = M.acos || fallbackFn;\n var acosh = M.acosh || fallbackFn;\n var asin = M.asin || fallbackFn;\n var asinh = M.asinh || fallbackFn;\n var atanh = M.atanh || fallbackFn;\n var atan = M.atan || fallbackFn;\n var sin = M.sin || fallbackFn;\n var sinh = M.sinh || fallbackFn;\n var cos = M.cos || fallbackFn;\n var cosh = M.cosh || fallbackFn;\n var tan = M.tan || fallbackFn;\n var tanh = M.tanh || fallbackFn;\n var exp = M.exp || fallbackFn;\n var expm1 = M.expm1 || fallbackFn;\n var log1p = M.log1p || fallbackFn;\n // Operation polyfills\n var powPI = function (value) { return M.pow(M.PI, value); };\n var acoshPf = function (value) { return M.log(value + M.sqrt(value * value - 1)); };\n var asinhPf = function (value) { return M.log(value + M.sqrt(value * value + 1)); };\n var atanhPf = function (value) { return M.log((1 + value) / (1 - value)) / 2; };\n var sinhPf = function (value) { return M.exp(value) - 1 / M.exp(value) / 2; };\n var coshPf = function (value) { return (M.exp(value) + 1 / M.exp(value)) / 2; };\n var expm1Pf = function (value) { return M.exp(value) - 1; };\n var tanhPf = function (value) { return (M.exp(2 * value) - 1) / (M.exp(2 * value) + 1); };\n var log1pPf = function (value) { return M.log(1 + value); };\n // Note: constant values are empirical\n return {\n acos: acos(0.123124234234234242),\n acosh: acosh(1e308),\n acoshPf: acoshPf(1e154),\n asin: asin(0.123124234234234242),\n asinh: asinh(1),\n asinhPf: asinhPf(1),\n atanh: atanh(0.5),\n atanhPf: atanhPf(0.5),\n atan: atan(0.5),\n sin: sin(-1e300),\n sinh: sinh(1),\n sinhPf: sinhPf(1),\n cos: cos(10.000000000123),\n cosh: cosh(1),\n coshPf: coshPf(1),\n tan: tan(-1e300),\n tanh: tanh(1),\n tanhPf: tanhPf(1),\n exp: exp(1),\n expm1: expm1(1),\n expm1Pf: expm1Pf(1),\n log1p: log1p(10),\n log1pPf: log1pPf(10),\n powPI: powPI(-100),\n };\n}\n\n/**\n * We use m or w because these two characters take up the maximum width.\n * Also there are a couple of ligatures.\n */\nvar defaultText = 'mmMwWLliI0fiflO&1';\n/**\n * Settings of text blocks to measure. The keys are random but persistent words.\n */\nvar presets = {\n /**\n * The default font. User can change it in desktop Chrome, desktop Firefox, IE 11,\n * Android Chrome (but only when the size is ≥ than the default) and Android Firefox.\n */\n default: [],\n /** OS font on macOS. User can change its size and weight. Applies after Safari restart. */\n apple: [{ font: '-apple-system-body' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n serif: [{ fontFamily: 'serif' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n sans: [{ fontFamily: 'sans-serif' }],\n /** User can change it in desktop Chrome and desktop Firefox. */\n mono: [{ fontFamily: 'monospace' }],\n /**\n * Check the smallest allowed font size. User can change it in desktop Chrome, desktop Firefox and desktop Safari.\n * The height can be 0 in Chrome on a retina display.\n */\n min: [{ fontSize: '1px' }],\n /** Tells one OS from another in desktop Chrome. */\n system: [{ fontFamily: 'system-ui' }],\n};\n/**\n * The result is a dictionary of the width of the text samples.\n * Heights aren't included because they give no extra entropy and are unstable.\n *\n * The result is very stable in IE 11, Edge 18 and Safari 14.\n * The result changes when the OS pixel density changes in Chromium 87. The real pixel density is required to solve,\n * but seems like it's impossible: https://stackoverflow.com/q/1713771/1118709.\n * The \"min\" and the \"mono\" (only on Windows) value may change when the page is zoomed in Firefox 87.\n */\nfunction getFontPreferences() {\n return withNaturalFonts(function (document, container) {\n var elements = {};\n var sizes = {};\n // First create all elements to measure. If the DOM steps below are done in a single cycle,\n // browser will alternate tree modification and layout reading, that is very slow.\n for (var _i = 0, _a = Object.keys(presets); _i < _a.length; _i++) {\n var key = _a[_i];\n var _b = presets[key], _c = _b[0], style = _c === void 0 ? {} : _c, _d = _b[1], text = _d === void 0 ? defaultText : _d;\n var element = document.createElement('span');\n element.textContent = text;\n element.style.whiteSpace = 'nowrap';\n for (var _e = 0, _f = Object.keys(style); _e < _f.length; _e++) {\n var name_1 = _f[_e];\n var value = style[name_1];\n if (value !== undefined) {\n element.style[name_1] = value;\n }\n }\n elements[key] = element;\n container.appendChild(document.createElement('br'));\n container.appendChild(element);\n }\n // Then measure the created elements\n for (var _g = 0, _h = Object.keys(presets); _g < _h.length; _g++) {\n var key = _h[_g];\n sizes[key] = elements[key].getBoundingClientRect().width;\n }\n return sizes;\n });\n}\n/**\n * Creates a DOM environment that provides the most natural font available, including Android OS font.\n * Measurements of the elements are zoom-independent.\n * Don't put a content to measure inside an absolutely positioned element.\n */\nfunction withNaturalFonts(action, containerWidthPx) {\n if (containerWidthPx === void 0) { containerWidthPx = 4000; }\n /*\n * Requirements for Android Chrome to apply the system font size to a text inside an iframe:\n * - The iframe mustn't have a `display: none;` style;\n * - The text mustn't be positioned absolutely;\n * - The text block must be wide enough.\n * 2560px on some devices in portrait orientation for the biggest font size option (32px);\n * - There must be much enough text to form a few lines (I don't know the exact numbers);\n * - The text must have the `text-size-adjust: none` style. Otherwise the text will scale in \"Desktop site\" mode;\n *\n * Requirements for Android Firefox to apply the system font size to a text inside an iframe:\n * - The iframe document must have a header: ``.\n * The only way to set it is to use the `srcdoc` attribute of the iframe;\n * - The iframe content must get loaded before adding extra content with JavaScript;\n *\n * https://example.com as the iframe target always inherits Android font settings so it can be used as a reference.\n *\n * Observations on how page zoom affects the measurements:\n * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;\n * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;\n * - macOS Safari 14.0: offsetWidth = 5% fluctuation;\n * - macOS Safari 14.0: getBoundingClientRect = 5% fluctuation;\n * - iOS Safari 9, 10, 11.0, 12.0: haven't found a way to zoom a page (pinch doesn't change layout);\n * - iOS Safari 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;\n * - iOS Safari 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;\n * - iOS Safari 14.0: offsetWidth = 100% reliable;\n * - iOS Safari 14.0: getBoundingClientRect = 100% reliable;\n * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + offsetWidth = 1px fluctuation;\n * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + getBoundingClientRect = 100% reliable;\n * - Chrome 87: offsetWidth = 1px fluctuation;\n * - Chrome 87: getBoundingClientRect = 0.7px fluctuation;\n * - Firefox 48, 51: offsetWidth = 10% fluctuation;\n * - Firefox 48, 51: getBoundingClientRect = 10% fluctuation;\n * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: offsetWidth = width 100% reliable, height 10% fluctuation;\n * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: getBoundingClientRect = width 100% reliable, height 10%\n * fluctuation;\n * - Android Chrome 86: haven't found a way to zoom a page (pinch doesn't change layout);\n * - Android Firefox 84: font size in accessibility settings changes all the CSS sizes, but offsetWidth and\n * getBoundingClientRect keep measuring with regular units, so the size reflects the font size setting and doesn't\n * fluctuate;\n * - IE 11, Edge 18: zoom 1/devicePixelRatio + offsetWidth = 100% reliable;\n * - IE 11, Edge 18: zoom 1/devicePixelRatio + getBoundingClientRect = reflects the zoom level;\n * - IE 11, Edge 18: offsetWidth = 100% reliable;\n * - IE 11, Edge 18: getBoundingClientRect = 100% reliable;\n */\n return withIframe(function (_, iframeWindow) {\n var iframeDocument = iframeWindow.document;\n var iframeBody = iframeDocument.body;\n var bodyStyle = iframeBody.style;\n bodyStyle.width = \"\".concat(containerWidthPx, \"px\");\n bodyStyle.webkitTextSizeAdjust = bodyStyle.textSizeAdjust = 'none';\n // See the big comment above\n if (isChromium()) {\n iframeBody.style.zoom = \"\".concat(1 / iframeWindow.devicePixelRatio);\n }\n else if (isWebKit()) {\n iframeBody.style.zoom = 'reset';\n }\n // See the big comment above\n var linesOfText = iframeDocument.createElement('div');\n linesOfText.textContent = __spreadArray([], Array((containerWidthPx / 20) << 0), true).map(function () { return 'word'; }).join(' ');\n iframeBody.appendChild(linesOfText);\n return action(iframeDocument, iframeBody);\n }, '');\n}\n\n/**\n * @see Credits: https://stackoverflow.com/a/49267844\n */\nfunction getVideoCard() {\n var _a;\n var canvas = document.createElement('canvas');\n var gl = (_a = canvas.getContext('webgl')) !== null && _a !== void 0 ? _a : canvas.getContext('experimental-webgl');\n if (gl && 'getExtension' in gl) {\n var debugInfo = gl.getExtension('WEBGL_debug_renderer_info');\n if (debugInfo) {\n return {\n vendor: (gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) || '').toString(),\n renderer: (gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) || '').toString(),\n };\n }\n }\n return undefined;\n}\n\nfunction isPdfViewerEnabled() {\n return navigator.pdfViewerEnabled;\n}\n\n/**\n * Unlike most other architectures, on x86/x86-64 when floating-point instructions\n * have no NaN arguments, but produce NaN output, the output NaN has sign bit set.\n * We use it to distinguish x86/x86-64 from other architectures, by doing subtraction\n * of two infinities (must produce NaN per IEEE 754 standard).\n *\n * See https://codebrowser.bddppq.com/pytorch/pytorch/third_party/XNNPACK/src/init.c.html#79\n */\nfunction getArchitecture() {\n var f = new Float32Array(1);\n var u8 = new Uint8Array(f.buffer);\n f[0] = Infinity;\n f[0] = f[0] - f[0];\n return u8[3];\n}\n\n/**\n * The list of entropy sources used to make visitor identifiers.\n *\n * This value isn't restricted by Semantic Versioning, i.e. it may be changed without bumping minor or major version of\n * this package.\n *\n * Note: Rollup and Webpack are smart enough to remove unused properties of this object during tree-shaking, so there is\n * no need to export the sources individually.\n */\nvar sources = {\n // READ FIRST:\n // See https://github.com/fingerprintjs/fingerprintjs/blob/master/contributing.md#how-to-make-an-entropy-source\n // to learn how entropy source works and how to make your own.\n // The sources run in this exact order.\n // The asynchronous sources are at the start to run in parallel with other sources.\n fonts: getFonts,\n domBlockers: getDomBlockers,\n fontPreferences: getFontPreferences,\n audio: getAudioFingerprint,\n screenFrame: getRoundedScreenFrame,\n osCpu: getOsCpu,\n languages: getLanguages,\n colorDepth: getColorDepth,\n deviceMemory: getDeviceMemory,\n screenResolution: getScreenResolution,\n hardwareConcurrency: getHardwareConcurrency,\n timezone: getTimezone,\n sessionStorage: getSessionStorage,\n localStorage: getLocalStorage,\n indexedDB: getIndexedDB,\n openDatabase: getOpenDatabase,\n cpuClass: getCpuClass,\n platform: getPlatform,\n plugins: getPlugins,\n canvas: getCanvasFingerprint,\n touchSupport: getTouchSupport,\n vendor: getVendor,\n vendorFlavors: getVendorFlavors,\n cookiesEnabled: areCookiesEnabled,\n colorGamut: getColorGamut,\n invertedColors: areColorsInverted,\n forcedColors: areColorsForced,\n monochrome: getMonochromeDepth,\n contrast: getContrastPreference,\n reducedMotion: isMotionReduced,\n hdr: isHDR,\n math: getMathFingerprint,\n videoCard: getVideoCard,\n pdfViewerEnabled: isPdfViewerEnabled,\n architecture: getArchitecture,\n};\n/**\n * Loads the built-in entropy sources.\n * Returns a function that collects the entropy components to make the visitor identifier.\n */\nfunction loadBuiltinSources(options) {\n return loadSources(sources, options, []);\n}\n\nvar commentTemplate = '$ if upgrade to Pro: https://fpjs.dev/pro';\nfunction getConfidence(components) {\n var openConfidenceScore = getOpenConfidenceScore(components);\n var proConfidenceScore = deriveProConfidenceScore(openConfidenceScore);\n return { score: openConfidenceScore, comment: commentTemplate.replace(/\\$/g, \"\".concat(proConfidenceScore)) };\n}\nfunction getOpenConfidenceScore(components) {\n // In order to calculate the true probability of the visitor identifier being correct, we need to know the number of\n // website visitors (the higher the number, the less the probability because the fingerprint entropy is limited).\n // JS agent doesn't know the number of visitors, so we can only do an approximate assessment.\n if (isAndroid()) {\n return 0.4;\n }\n // Safari (mobile and desktop)\n if (isWebKit()) {\n return isDesktopSafari() ? 0.5 : 0.3;\n }\n var platform = components.platform.value || '';\n // Windows\n if (/^Win/.test(platform)) {\n // The score is greater than on macOS because of the higher variety of devices running Windows.\n // Chrome provides more entropy than Firefox according too\n // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Windows%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D\n // So we assign the same score to them.\n return 0.6;\n }\n // macOS\n if (/^Mac/.test(platform)) {\n // Chrome provides more entropy than Safari and Safari provides more entropy than Firefox.\n // Chrome is more popular than Safari and Safari is more popular than Firefox according to\n // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Mac%20OS%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D\n // So we assign the same score to them.\n return 0.5;\n }\n // Another platform, e.g. a desktop Linux. It's rare, so it should be pretty unique.\n return 0.7;\n}\nfunction deriveProConfidenceScore(openConfidenceScore) {\n return round(0.99 + 0.01 * openConfidenceScore, 0.0001);\n}\n\nfunction componentsToCanonicalString(components) {\n var result = '';\n for (var _i = 0, _a = Object.keys(components).sort(); _i < _a.length; _i++) {\n var componentKey = _a[_i];\n var component = components[componentKey];\n var value = component.error ? 'error' : JSON.stringify(component.value);\n result += \"\".concat(result ? '|' : '').concat(componentKey.replace(/([:|\\\\])/g, '\\\\$1'), \":\").concat(value);\n }\n return result;\n}\nfunction componentsToDebugString(components) {\n return JSON.stringify(components, function (_key, value) {\n if (value instanceof Error) {\n return errorToObject(value);\n }\n return value;\n }, 2);\n}\nfunction hashComponents(components) {\n return x64hash128(componentsToCanonicalString(components));\n}\n/**\n * Makes a GetResult implementation that calculates the visitor id hash on demand.\n * Designed for optimisation.\n */\nfunction makeLazyGetResult(components) {\n var visitorIdCache;\n // This function runs very fast, so there is no need to make it lazy\n var confidence = getConfidence(components);\n // A plain class isn't used because its getters and setters aren't enumerable.\n return {\n get visitorId() {\n if (visitorIdCache === undefined) {\n visitorIdCache = hashComponents(this.components);\n }\n return visitorIdCache;\n },\n set visitorId(visitorId) {\n visitorIdCache = visitorId;\n },\n confidence: confidence,\n components: components,\n version: version,\n };\n}\n/**\n * A delay is required to ensure consistent entropy components.\n * See https://github.com/fingerprintjs/fingerprintjs/issues/254\n * and https://github.com/fingerprintjs/fingerprintjs/issues/307\n * and https://github.com/fingerprintjs/fingerprintjs/commit/945633e7c5f67ae38eb0fea37349712f0e669b18\n */\nfunction prepareForSources(delayFallback) {\n if (delayFallback === void 0) { delayFallback = 50; }\n // A proper deadline is unknown. Let it be twice the fallback timeout so that both cases have the same average time.\n return requestIdleCallbackIfAvailable(delayFallback, delayFallback * 2);\n}\n/**\n * The function isn't exported from the index file to not allow to call it without `load()`.\n * The hiding gives more freedom for future non-breaking updates.\n *\n * A factory function is used instead of a class to shorten the attribute names in the minified code.\n * Native private class fields could've been used, but TypeScript doesn't allow them with `\"target\": \"es5\"`.\n */\nfunction makeAgent(getComponents, debug) {\n var creationTime = Date.now();\n return {\n get: function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var startTime, components, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n startTime = Date.now();\n return [4 /*yield*/, getComponents()];\n case 1:\n components = _a.sent();\n result = makeLazyGetResult(components);\n if (debug || (options === null || options === void 0 ? void 0 : options.debug)) {\n // console.log is ok here because it's under a debug clause\n // eslint-disable-next-line no-console\n console.log(\"Copy the text below to get the debug data:\\n\\n```\\nversion: \".concat(result.version, \"\\nuserAgent: \").concat(navigator.userAgent, \"\\ntimeBetweenLoadAndGet: \").concat(startTime - creationTime, \"\\nvisitorId: \").concat(result.visitorId, \"\\ncomponents: \").concat(componentsToDebugString(components), \"\\n```\"));\n }\n return [2 /*return*/, result];\n }\n });\n });\n },\n };\n}\n/**\n * Sends an unpersonalized AJAX request to collect installation statistics\n */\nfunction monitor() {\n // The FingerprintJS CDN (https://github.com/fingerprintjs/cdn) replaces `window.__fpjs_d_m` with `true`\n if (window.__fpjs_d_m || Math.random() >= 0.001) {\n return;\n }\n try {\n var request = new XMLHttpRequest();\n request.open('get', \"https://m1.openfpcdn.io/fingerprintjs/v\".concat(version, \"/npm-monitoring\"), true);\n request.send();\n }\n catch (error) {\n // console.error is ok here because it's an unexpected error handler\n // eslint-disable-next-line no-console\n console.error(error);\n }\n}\n/**\n * Builds an instance of Agent and waits a delay required for a proper operation.\n */\nfunction load(_a) {\n var _b = _a === void 0 ? {} : _a, delayFallback = _b.delayFallback, debug = _b.debug, _c = _b.monitoring, monitoring = _c === void 0 ? true : _c;\n return __awaiter(this, void 0, void 0, function () {\n var getComponents;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n if (monitoring) {\n monitor();\n }\n return [4 /*yield*/, prepareForSources(delayFallback)];\n case 1:\n _d.sent();\n getComponents = loadBuiltinSources({ debug: debug });\n return [2 /*return*/, makeAgent(getComponents, debug)];\n }\n });\n });\n}\n\n// The default export is a syntax sugar (`import * as FP from '...' → import FP from '...'`).\n// It should contain all the public exported values.\nvar index = { load: load, hashComponents: hashComponents, componentsToDebugString: componentsToDebugString };\n// The exports below are for private usage. They may change unexpectedly. Use them at your own risk.\n/** Not documented, out of Semantic Versioning, usage is at your own risk */\nvar murmurX64Hash128 = x64hash128;\n\nexport { componentsToDebugString, index as default, getFullscreenElement, getScreenFrame, hashComponents, isAndroid, isChromium, isDesktopSafari, isEdgeHTML, isGecko, isTrident, isWebKit, load, loadSources, murmurX64Hash128, prepareForSources, sources, transformSource, withIframe };\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a function');\n};\n","'use strict';\nvar isConstructor = require('../internals/is-constructor');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsConstructor(argument) is true`\nmodule.exports = function (argument) {\n if (isConstructor(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a constructor');\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument)) return argument;\n throw $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar create = require('../internals/object-create');\nvar defineProperty = require('../internals/object-define-property').f;\n\nvar UNSCOPABLES = wellKnownSymbol('unscopables');\nvar ArrayPrototype = Array.prototype;\n\n// Array.prototype[@@unscopables]\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\nif (ArrayPrototype[UNSCOPABLES] === undefined) {\n defineProperty(ArrayPrototype, UNSCOPABLES, {\n configurable: true,\n value: create(null)\n });\n}\n\n// add a key to Array.prototype[@@unscopables]\nmodule.exports = function (key) {\n ArrayPrototype[UNSCOPABLES][key] = true;\n};\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\n\n// `AdvanceStringIndex` abstract operation\n// https://tc39.es/ecma262/#sec-advancestringindex\nmodule.exports = function (S, index, unicode) {\n return index + (unicode ? charAt(S, index).length : 1);\n};\n","'use strict';\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (it, Prototype) {\n if (isPrototypeOf(Prototype, it)) return it;\n throw $TypeError('Incorrect invocation');\n};\n","'use strict';\nvar isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw $TypeError($String(argument) + ' is not an object');\n};\n","'use strict';\n// eslint-disable-next-line es/no-typed-arrays -- safe\nmodule.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';\n","'use strict';\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar hasOwn = require('../internals/has-own-property');\nvar classof = require('../internals/classof');\nvar tryToString = require('../internals/try-to-string');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar uid = require('../internals/uid');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\nvar Int8Array = global.Int8Array;\nvar Int8ArrayPrototype = Int8Array && Int8Array.prototype;\nvar Uint8ClampedArray = global.Uint8ClampedArray;\nvar Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;\nvar TypedArray = Int8Array && getPrototypeOf(Int8Array);\nvar TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);\nvar ObjectPrototype = Object.prototype;\nvar TypeError = global.TypeError;\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');\nvar TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';\n// Fixing native typed arrays in Opera Presto crashes the browser, see #595\nvar NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera';\nvar TYPED_ARRAY_TAG_REQUIRED = false;\nvar NAME, Constructor, Prototype;\n\nvar TypedArrayConstructorsList = {\n Int8Array: 1,\n Uint8Array: 1,\n Uint8ClampedArray: 1,\n Int16Array: 2,\n Uint16Array: 2,\n Int32Array: 4,\n Uint32Array: 4,\n Float32Array: 4,\n Float64Array: 8\n};\n\nvar BigIntArrayConstructorsList = {\n BigInt64Array: 8,\n BigUint64Array: 8\n};\n\nvar isView = function isView(it) {\n if (!isObject(it)) return false;\n var klass = classof(it);\n return klass === 'DataView'\n || hasOwn(TypedArrayConstructorsList, klass)\n || hasOwn(BigIntArrayConstructorsList, klass);\n};\n\nvar getTypedArrayConstructor = function (it) {\n var proto = getPrototypeOf(it);\n if (!isObject(proto)) return;\n var state = getInternalState(proto);\n return (state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR)) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto);\n};\n\nvar isTypedArray = function (it) {\n if (!isObject(it)) return false;\n var klass = classof(it);\n return hasOwn(TypedArrayConstructorsList, klass)\n || hasOwn(BigIntArrayConstructorsList, klass);\n};\n\nvar aTypedArray = function (it) {\n if (isTypedArray(it)) return it;\n throw TypeError('Target is not a typed array');\n};\n\nvar aTypedArrayConstructor = function (C) {\n if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C;\n throw TypeError(tryToString(C) + ' is not a typed array constructor');\n};\n\nvar exportTypedArrayMethod = function (KEY, property, forced, options) {\n if (!DESCRIPTORS) return;\n if (forced) for (var ARRAY in TypedArrayConstructorsList) {\n var TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) try {\n delete TypedArrayConstructor.prototype[KEY];\n } catch (error) {\n // old WebKit bug - some methods are non-configurable\n try {\n TypedArrayConstructor.prototype[KEY] = property;\n } catch (error2) { /* empty */ }\n }\n }\n if (!TypedArrayPrototype[KEY] || forced) {\n defineBuiltIn(TypedArrayPrototype, KEY, forced ? property\n : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);\n }\n};\n\nvar exportTypedArrayStaticMethod = function (KEY, property, forced) {\n var ARRAY, TypedArrayConstructor;\n if (!DESCRIPTORS) return;\n if (setPrototypeOf) {\n if (forced) for (ARRAY in TypedArrayConstructorsList) {\n TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try {\n delete TypedArrayConstructor[KEY];\n } catch (error) { /* empty */ }\n }\n if (!TypedArray[KEY] || forced) {\n // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable\n try {\n return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);\n } catch (error) { /* empty */ }\n } else return;\n }\n for (ARRAY in TypedArrayConstructorsList) {\n TypedArrayConstructor = global[ARRAY];\n if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {\n defineBuiltIn(TypedArrayConstructor, KEY, property);\n }\n }\n};\n\nfor (NAME in TypedArrayConstructorsList) {\n Constructor = global[NAME];\n Prototype = Constructor && Constructor.prototype;\n if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;\n else NATIVE_ARRAY_BUFFER_VIEWS = false;\n}\n\nfor (NAME in BigIntArrayConstructorsList) {\n Constructor = global[NAME];\n Prototype = Constructor && Constructor.prototype;\n if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;\n}\n\n// WebKit bug - typed arrays constructors prototype is Object.prototype\nif (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {\n // eslint-disable-next-line no-shadow -- safe\n TypedArray = function TypedArray() {\n throw TypeError('Incorrect invocation');\n };\n if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {\n if (global[NAME]) setPrototypeOf(global[NAME], TypedArray);\n }\n}\n\nif (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {\n TypedArrayPrototype = TypedArray.prototype;\n if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {\n if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype);\n }\n}\n\n// WebKit bug - one more object in Uint8ClampedArray prototype chain\nif (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {\n setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);\n}\n\nif (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) {\n TYPED_ARRAY_TAG_REQUIRED = true;\n defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, {\n configurable: true,\n get: function () {\n return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;\n }\n });\n for (NAME in TypedArrayConstructorsList) if (global[NAME]) {\n createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME);\n }\n}\n\nmodule.exports = {\n NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,\n TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,\n aTypedArray: aTypedArray,\n aTypedArrayConstructor: aTypedArrayConstructor,\n exportTypedArrayMethod: exportTypedArrayMethod,\n exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,\n getTypedArrayConstructor: getTypedArrayConstructor,\n isView: isView,\n isTypedArray: isTypedArray,\n TypedArray: TypedArray,\n TypedArrayPrototype: TypedArrayPrototype\n};\n","'use strict';\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection');\nvar FunctionName = require('../internals/function-name');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar defineBuiltIns = require('../internals/define-built-ins');\nvar fails = require('../internals/fails');\nvar anInstance = require('../internals/an-instance');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toLength = require('../internals/to-length');\nvar toIndex = require('../internals/to-index');\nvar IEEE754 = require('../internals/ieee754');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar arrayFill = require('../internals/array-fill');\nvar arraySlice = require('../internals/array-slice-simple');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar PROPER_FUNCTION_NAME = FunctionName.PROPER;\nvar CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length';\nvar WRONG_INDEX = 'Wrong index';\nvar getInternalArrayBufferState = InternalStateModule.getterFor(ARRAY_BUFFER);\nvar getInternalDataViewState = InternalStateModule.getterFor(DATA_VIEW);\nvar setInternalState = InternalStateModule.set;\nvar NativeArrayBuffer = global[ARRAY_BUFFER];\nvar $ArrayBuffer = NativeArrayBuffer;\nvar ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE];\nvar $DataView = global[DATA_VIEW];\nvar DataViewPrototype = $DataView && $DataView[PROTOTYPE];\nvar ObjectPrototype = Object.prototype;\nvar Array = global.Array;\nvar RangeError = global.RangeError;\nvar fill = uncurryThis(arrayFill);\nvar reverse = uncurryThis([].reverse);\n\nvar packIEEE754 = IEEE754.pack;\nvar unpackIEEE754 = IEEE754.unpack;\n\nvar packInt8 = function (number) {\n return [number & 0xFF];\n};\n\nvar packInt16 = function (number) {\n return [number & 0xFF, number >> 8 & 0xFF];\n};\n\nvar packInt32 = function (number) {\n return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF];\n};\n\nvar unpackInt32 = function (buffer) {\n return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];\n};\n\nvar packFloat32 = function (number) {\n return packIEEE754(number, 23, 4);\n};\n\nvar packFloat64 = function (number) {\n return packIEEE754(number, 52, 8);\n};\n\nvar addGetter = function (Constructor, key, getInternalState) {\n defineBuiltInAccessor(Constructor[PROTOTYPE], key, {\n configurable: true,\n get: function () {\n return getInternalState(this)[key];\n }\n });\n};\n\nvar get = function (view, count, index, isLittleEndian) {\n var store = getInternalDataViewState(view);\n var intIndex = toIndex(index);\n var boolIsLittleEndian = !!isLittleEndian;\n if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);\n var bytes = store.bytes;\n var start = intIndex + store.byteOffset;\n var pack = arraySlice(bytes, start, start + count);\n return boolIsLittleEndian ? pack : reverse(pack);\n};\n\nvar set = function (view, count, index, conversion, value, isLittleEndian) {\n var store = getInternalDataViewState(view);\n var intIndex = toIndex(index);\n var pack = conversion(+value);\n var boolIsLittleEndian = !!isLittleEndian;\n if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);\n var bytes = store.bytes;\n var start = intIndex + store.byteOffset;\n for (var i = 0; i < count; i++) bytes[start + i] = pack[boolIsLittleEndian ? i : count - i - 1];\n};\n\nif (!NATIVE_ARRAY_BUFFER) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, ArrayBufferPrototype);\n var byteLength = toIndex(length);\n setInternalState(this, {\n type: ARRAY_BUFFER,\n bytes: fill(Array(byteLength), 0),\n byteLength: byteLength\n });\n if (!DESCRIPTORS) {\n this.byteLength = byteLength;\n this.detached = false;\n }\n };\n\n ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE];\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, DataViewPrototype);\n anInstance(buffer, ArrayBufferPrototype);\n var bufferState = getInternalArrayBufferState(buffer);\n var bufferLength = bufferState.byteLength;\n var offset = toIntegerOrInfinity(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n setInternalState(this, {\n type: DATA_VIEW,\n buffer: buffer,\n byteLength: byteLength,\n byteOffset: offset,\n bytes: bufferState.bytes\n });\n if (!DESCRIPTORS) {\n this.buffer = buffer;\n this.byteLength = byteLength;\n this.byteOffset = offset;\n }\n };\n\n DataViewPrototype = $DataView[PROTOTYPE];\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, 'byteLength', getInternalArrayBufferState);\n addGetter($DataView, 'buffer', getInternalDataViewState);\n addGetter($DataView, 'byteLength', getInternalDataViewState);\n addGetter($DataView, 'byteOffset', getInternalDataViewState);\n }\n\n defineBuiltIns(DataViewPrototype, {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false)) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false), 23);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : false), 52);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packInt8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packInt8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : false);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : false);\n }\n });\n} else {\n var INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER;\n /* eslint-disable no-new -- required for testing */\n if (!fails(function () {\n NativeArrayBuffer(1);\n }) || !fails(function () {\n new NativeArrayBuffer(-1);\n }) || fails(function () {\n new NativeArrayBuffer();\n new NativeArrayBuffer(1.5);\n new NativeArrayBuffer(NaN);\n return NativeArrayBuffer.length !== 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;\n })) {\n /* eslint-enable no-new -- required for testing */\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, ArrayBufferPrototype);\n return new NativeArrayBuffer(toIndex(length));\n };\n\n $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype;\n\n for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) {\n createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]);\n }\n }\n\n ArrayBufferPrototype.constructor = $ArrayBuffer;\n } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) {\n createNonEnumerableProperty(NativeArrayBuffer, 'name', ARRAY_BUFFER);\n }\n\n // WebKit bug - the same parent prototype for typed arrays and data view\n if (setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) {\n setPrototypeOf(DataViewPrototype, ObjectPrototype);\n }\n\n // iOS Safari 7.x bug\n var testView = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = uncurryThis(DataViewPrototype.setInt8);\n testView.setInt8(0, 2147483648);\n testView.setInt8(1, 2147483649);\n if (testView.getInt8(0) || !testView.getInt8(1)) defineBuiltIns(DataViewPrototype, {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8(this, byteOffset, value << 24 >> 24);\n }\n }, { unsafe: true });\n}\n\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\n\nmodule.exports = {\n ArrayBuffer: $ArrayBuffer,\n DataView: $DataView\n};\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar deletePropertyOrThrow = require('../internals/delete-property-or-throw');\n\nvar min = Math.min;\n\n// `Array.prototype.copyWithin` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.copywithin\n// eslint-disable-next-line es/no-array-prototype-copywithin -- safe\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = lengthOfArrayLike(O);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else deletePropertyOrThrow(O, to);\n to += inc;\n from += inc;\n } return O;\n};\n","'use strict';\nvar toObject = require('../internals/to-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.fill` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.fill\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = lengthOfArrayLike(O);\n var argumentsLength = arguments.length;\n var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);\n var end = argumentsLength > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","'use strict';\nvar $forEach = require('../internals/array-iteration').forEach;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar STRICT_METHOD = arrayMethodIsStrict('forEach');\n\n// `Array.prototype.forEach` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.foreach\nmodule.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n// eslint-disable-next-line es/no-array-prototype-foreach -- safe\n} : [].forEach;\n","'use strict';\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\nmodule.exports = function (Constructor, list) {\n var index = 0;\n var length = lengthOfArrayLike(list);\n var result = new Constructor(length);\n while (length > index) result[index] = list[index++];\n return result;\n};\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el !== el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value !== value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar IndexedObject = require('../internals/indexed-object');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\nvar push = uncurryThis([].push);\n\n// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation\nvar createMethod = function (TYPE) {\n var IS_MAP = TYPE === 1;\n var IS_FILTER = TYPE === 2;\n var IS_SOME = TYPE === 3;\n var IS_EVERY = TYPE === 4;\n var IS_FIND_INDEX = TYPE === 6;\n var IS_FILTER_REJECT = TYPE === 7;\n var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;\n return function ($this, callbackfn, that, specificCreate) {\n var O = toObject($this);\n var self = IndexedObject(O);\n var boundFunction = bind(callbackfn, that);\n var length = lengthOfArrayLike(self);\n var index = 0;\n var create = specificCreate || arraySpeciesCreate;\n var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;\n var value, result;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n value = self[index];\n result = boundFunction(value, index, O);\n if (TYPE) {\n if (IS_MAP) target[index] = result; // map\n else if (result) switch (TYPE) {\n case 3: return true; // some\n case 5: return value; // find\n case 6: return index; // findIndex\n case 2: push(target, value); // filter\n } else switch (TYPE) {\n case 4: return false; // every\n case 7: push(target, value); // filterReject\n }\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.forEach` method\n // https://tc39.es/ecma262/#sec-array.prototype.foreach\n forEach: createMethod(0),\n // `Array.prototype.map` method\n // https://tc39.es/ecma262/#sec-array.prototype.map\n map: createMethod(1),\n // `Array.prototype.filter` method\n // https://tc39.es/ecma262/#sec-array.prototype.filter\n filter: createMethod(2),\n // `Array.prototype.some` method\n // https://tc39.es/ecma262/#sec-array.prototype.some\n some: createMethod(3),\n // `Array.prototype.every` method\n // https://tc39.es/ecma262/#sec-array.prototype.every\n every: createMethod(4),\n // `Array.prototype.find` method\n // https://tc39.es/ecma262/#sec-array.prototype.find\n find: createMethod(5),\n // `Array.prototype.findIndex` method\n // https://tc39.es/ecma262/#sec-array.prototype.findIndex\n findIndex: createMethod(6),\n // `Array.prototype.filterReject` method\n // https://github.com/tc39/proposal-array-filtering\n filterReject: createMethod(7)\n};\n","'use strict';\n/* eslint-disable es/no-array-prototype-lastindexof -- safe */\nvar apply = require('../internals/function-apply');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar min = Math.min;\nvar $lastIndexOf = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;\nvar STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');\nvar FORCED = NEGATIVE_ZERO || !STRICT_METHOD;\n\n// `Array.prototype.lastIndexOf` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.lastindexof\nmodule.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return apply($lastIndexOf, this, arguments) || 0;\n var O = toIndexedObject(this);\n var length = lengthOfArrayLike(O);\n var index = length - 1;\n if (arguments.length > 1) index = min(index, toIntegerOrInfinity(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;\n return -1;\n} : $lastIndexOf;\n","'use strict';\nvar fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (METHOD_NAME) {\n // We can't use this feature detection in V8 since it causes\n // deoptimization and serious performance degradation\n // https://github.com/zloirock/core-js/issues/677\n return V8_VERSION >= 51 || !fails(function () {\n var array = [];\n var constructor = array.constructor = {};\n constructor[SPECIES] = function () {\n return { foo: 1 };\n };\n return array[METHOD_NAME](Boolean).foo !== 1;\n });\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = function (METHOD_NAME, argument) {\n var method = [][METHOD_NAME];\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call -- required for testing\n method.call(null, argument || function () { return 1; }, 1);\n });\n};\n","'use strict';\nvar aCallable = require('../internals/a-callable');\nvar toObject = require('../internals/to-object');\nvar IndexedObject = require('../internals/indexed-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\nvar $TypeError = TypeError;\n\n// `Array.prototype.{ reduce, reduceRight }` methods implementation\nvar createMethod = function (IS_RIGHT) {\n return function (that, callbackfn, argumentsLength, memo) {\n aCallable(callbackfn);\n var O = toObject(that);\n var self = IndexedObject(O);\n var length = lengthOfArrayLike(O);\n var index = IS_RIGHT ? length - 1 : 0;\n var i = IS_RIGHT ? -1 : 1;\n if (argumentsLength < 2) while (true) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (IS_RIGHT ? index < 0 : length <= index) {\n throw $TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.reduce` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduce\n left: createMethod(false),\n // `Array.prototype.reduceRight` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduceright\n right: createMethod(true)\n};\n","'use strict';\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar createProperty = require('../internals/create-property');\n\nvar $Array = Array;\nvar max = Math.max;\n\nmodule.exports = function (O, start, end) {\n var length = lengthOfArrayLike(O);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n var result = $Array(max(fin - k, 0));\n var n = 0;\n for (; k < fin; k++, n++) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis([].slice);\n","'use strict';\nvar arraySlice = require('../internals/array-slice-simple');\n\nvar floor = Math.floor;\n\nvar mergeSort = function (array, comparefn) {\n var length = array.length;\n var middle = floor(length / 2);\n return length < 8 ? insertionSort(array, comparefn) : merge(\n array,\n mergeSort(arraySlice(array, 0, middle), comparefn),\n mergeSort(arraySlice(array, middle), comparefn),\n comparefn\n );\n};\n\nvar insertionSort = function (array, comparefn) {\n var length = array.length;\n var i = 1;\n var element, j;\n\n while (i < length) {\n j = i;\n element = array[i];\n while (j && comparefn(array[j - 1], element) > 0) {\n array[j] = array[--j];\n }\n if (j !== i++) array[j] = element;\n } return array;\n};\n\nvar merge = function (array, left, right, comparefn) {\n var llength = left.length;\n var rlength = right.length;\n var lindex = 0;\n var rindex = 0;\n\n while (lindex < llength || rindex < rlength) {\n array[lindex + rindex] = (lindex < llength && rindex < rlength)\n ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]\n : lindex < llength ? left[lindex++] : right[rindex++];\n } return array;\n};\n\nmodule.exports = mergeSort;\n","'use strict';\nvar isArray = require('../internals/is-array');\nvar isConstructor = require('../internals/is-constructor');\nvar isObject = require('../internals/is-object');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\nvar $Array = Array;\n\n// a part of `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray) {\n var C;\n if (isArray(originalArray)) {\n C = originalArray.constructor;\n // cross-realm fallback\n if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;\n else if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? $Array : C;\n};\n","'use strict';\nvar arraySpeciesConstructor = require('../internals/array-species-constructor');\n\n// `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray, length) {\n return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var called = 0;\n var iteratorWithReturn = {\n next: function () {\n return { done: !!called++ };\n },\n 'return': function () {\n SAFE_CLOSING = true;\n }\n };\n iteratorWithReturn[ITERATOR] = function () {\n return this;\n };\n // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing\n Array.from(iteratorWithReturn, function () { throw 2; });\n} catch (error) { /* empty */ }\n\nmodule.exports = function (exec, SKIP_CLOSING) {\n try {\n if (!SKIP_CLOSING && !SAFE_CLOSING) return false;\n } catch (error) { return false; } // workaround of old WebKit + `eval` bug\n var ITERATION_SUPPORT = false;\n try {\n var object = {};\n object[ITERATOR] = function () {\n return {\n next: function () {\n return { done: ITERATION_SUPPORT = true };\n }\n };\n };\n exec(object);\n } catch (error) { /* empty */ }\n return ITERATION_SUPPORT;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar isCallable = require('../internals/is-callable');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Object = Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n","'use strict';\nvar hasOwn = require('../internals/has-own-property');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source, exceptions) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n // eslint-disable-next-line es/no-object-getprototypeof -- required for testing\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","'use strict';\n// `CreateIterResultObject` abstract operation\n// https://tc39.es/ecma262/#sec-createiterresultobject\nmodule.exports = function (value, done) {\n return { value: value, done: done };\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","'use strict';\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","'use strict';\nvar toPropertyKey = require('../internals/to-property-key');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPropertyKey(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n};\n","'use strict';\nvar makeBuiltIn = require('../internals/make-built-in');\nvar defineProperty = require('../internals/object-define-property');\n\nmodule.exports = function (target, name, descriptor) {\n if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });\n if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });\n return defineProperty.f(target, name, descriptor);\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar definePropertyModule = require('../internals/object-define-property');\nvar makeBuiltIn = require('../internals/make-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nmodule.exports = function (O, key, value, options) {\n if (!options) options = {};\n var simple = options.enumerable;\n var name = options.name !== undefined ? options.name : key;\n if (isCallable(value)) makeBuiltIn(value, name, options);\n if (options.global) {\n if (simple) O[key] = value;\n else defineGlobalProperty(key, value);\n } else {\n try {\n if (!options.unsafe) delete O[key];\n else if (O[key]) simple = true;\n } catch (error) { /* empty */ }\n if (simple) O[key] = value;\n else definePropertyModule.f(O, key, {\n value: value,\n enumerable: false,\n configurable: !options.nonConfigurable,\n writable: !options.nonWritable\n });\n } return O;\n};\n","'use strict';\nvar defineBuiltIn = require('../internals/define-built-in');\n\nmodule.exports = function (target, src, options) {\n for (var key in src) defineBuiltIn(target, key, src[key], options);\n return target;\n};\n","'use strict';\nvar global = require('../internals/global');\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","'use strict';\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (O, P) {\n if (!delete O[P]) throw $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;\n});\n","'use strict';\nvar documentAll = typeof document == 'object' && document.all;\n\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\n// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing\nvar IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;\n\nmodule.exports = {\n all: documentAll,\n IS_HTMLDDA: IS_HTMLDDA\n};\n","'use strict';\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","'use strict';\nvar $TypeError = TypeError;\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991\n\nmodule.exports = function (it) {\n if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');\n return it;\n};\n","'use strict';\n// iterable DOM collections\n// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods\nmodule.exports = {\n CSSRuleList: 0,\n CSSStyleDeclaration: 0,\n CSSValueList: 0,\n ClientRectList: 0,\n DOMRectList: 0,\n DOMStringList: 0,\n DOMTokenList: 1,\n DataTransferItemList: 0,\n FileList: 0,\n HTMLAllCollection: 0,\n HTMLCollection: 0,\n HTMLFormElement: 0,\n HTMLSelectElement: 0,\n MediaList: 0,\n MimeTypeArray: 0,\n NamedNodeMap: 0,\n NodeList: 1,\n PaintRequestList: 0,\n Plugin: 0,\n PluginArray: 0,\n SVGLengthList: 0,\n SVGNumberList: 0,\n SVGPathSegList: 0,\n SVGPointList: 0,\n SVGStringList: 0,\n SVGTransformList: 0,\n SourceBufferList: 0,\n StyleSheetList: 0,\n TextTrackCueList: 0,\n TextTrackList: 0,\n TouchList: 0\n};\n","'use strict';\n// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`\nvar documentCreateElement = require('../internals/document-create-element');\n\nvar classList = documentCreateElement('span').classList;\nvar DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;\n\nmodule.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;\n","'use strict';\nvar userAgent = require('../internals/engine-user-agent');\n\nvar firefox = userAgent.match(/firefox\\/(\\d+)/i);\n\nmodule.exports = !!firefox && +firefox[1];\n","'use strict';\nvar IS_DENO = require('../internals/engine-is-deno');\nvar IS_NODE = require('../internals/engine-is-node');\n\nmodule.exports = !IS_DENO && !IS_NODE\n && typeof window == 'object'\n && typeof document == 'object';\n","'use strict';\n/* global Deno -- Deno case */\nmodule.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';\n","'use strict';\nvar UA = require('../internals/engine-user-agent');\n\nmodule.exports = /MSIE|Trident/.test(UA);\n","'use strict';\nvar userAgent = require('../internals/engine-user-agent');\n\nmodule.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined';\n","'use strict';\nvar userAgent = require('../internals/engine-user-agent');\n\n// eslint-disable-next-line redos/no-vulnerable -- safe\nmodule.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);\n","'use strict';\nvar global = require('../internals/global');\nvar classof = require('../internals/classof-raw');\n\nmodule.exports = classof(global.process) === 'process';\n","'use strict';\nvar userAgent = require('../internals/engine-user-agent');\n\nmodule.exports = /web0s(?!.*chrome)/i.test(userAgent);\n","'use strict';\nmodule.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';\n","'use strict';\nvar global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","'use strict';\nvar userAgent = require('../internals/engine-user-agent');\n\nvar webkit = userAgent.match(/AppleWebKit\\/(\\d+)\\./);\n\nmodule.exports = !!webkit && +webkit[1];\n","'use strict';\n// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","'use strict';\nvar global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global;\n } else if (STATIC) {\n target = global[TARGET] || defineGlobalProperty(TARGET, {});\n } else {\n target = (global[TARGET] || {}).prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty == typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n defineBuiltIn(target, key, sourceProperty, options);\n }\n};\n","'use strict';\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","'use strict';\n// TODO: Remove from `core-js@4` since it's moved to entry points\nrequire('../modules/es.regexp.exec');\nvar uncurryThis = require('../internals/function-uncurry-this-clause');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar regexpExec = require('../internals/regexp-exec');\nvar fails = require('../internals/fails');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nvar SPECIES = wellKnownSymbol('species');\nvar RegExpPrototype = RegExp.prototype;\n\nmodule.exports = function (KEY, exec, FORCED, SHAM) {\n var SYMBOL = wellKnownSymbol(KEY);\n\n var DELEGATES_TO_SYMBOL = !fails(function () {\n // String methods call symbol-named RegEp methods\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) !== 7;\n });\n\n var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {\n // Symbol-named RegExp methods call .exec\n var execCalled = false;\n var re = /a/;\n\n if (KEY === 'split') {\n // We can't use real regex here since it causes deoptimization\n // and serious performance degradation in V8\n // https://github.com/zloirock/core-js/issues/306\n re = {};\n // RegExp[@@split] doesn't call the regex's exec method, but first creates\n // a new one. We need to return the patched regex when creating the new one.\n re.constructor = {};\n re.constructor[SPECIES] = function () { return re; };\n re.flags = '';\n re[SYMBOL] = /./[SYMBOL];\n }\n\n re.exec = function () {\n execCalled = true;\n return null;\n };\n\n re[SYMBOL]('');\n return !execCalled;\n });\n\n if (\n !DELEGATES_TO_SYMBOL ||\n !DELEGATES_TO_EXEC ||\n FORCED\n ) {\n var uncurriedNativeRegExpMethod = uncurryThis(/./[SYMBOL]);\n var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {\n var uncurriedNativeMethod = uncurryThis(nativeMethod);\n var $exec = regexp.exec;\n if ($exec === regexpExec || $exec === RegExpPrototype.exec) {\n if (DELEGATES_TO_SYMBOL && !forceStringMethod) {\n // The native String method already delegates to @@method (this\n // polyfilled function), leasing to infinite recursion.\n // We avoid it by directly calling the native @@method method.\n return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };\n }\n return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };\n }\n return { done: false };\n });\n\n defineBuiltIn(String.prototype, KEY, methods[0]);\n defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);\n }\n\n if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);\n};\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this-clause');\nvar aCallable = require('../internals/a-callable');\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar hasOwn = require('../internals/has-own-property');\n\nvar FunctionPrototype = Function.prototype;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\n\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\n// additional protection from minified / mangled / dropped function names\nvar PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));\n\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\n\nmodule.exports = function (object, key, method) {\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));\n } catch (error) { /* empty */ }\n};\n","'use strict';\nvar classofRaw = require('../internals/classof-raw');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = function (fn) {\n // Nashorn bug:\n // https://github.com/zloirock/core-js/issues/1128\n // https://github.com/zloirock/core-js/issues/1130\n if (classofRaw(fn) === 'Function') return uncurryThis(fn);\n};\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar call = FunctionPrototype.call;\nvar uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {\n return function () {\n return call.apply(fn, arguments);\n };\n};\n","'use strict';\nvar global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (argument) {\n return isCallable(argument) ? argument : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];\n};\n","'use strict';\nvar classof = require('../internals/classof');\nvar getMethod = require('../internals/get-method');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar Iterators = require('../internals/iterators');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\n\nmodule.exports = function (it) {\n if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)\n || getMethod(it, '@@iterator')\n || Iterators[classof(it)];\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar tryToString = require('../internals/try-to-string');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument, usingIterator) {\n var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;\n if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));\n throw $TypeError(tryToString(argument) + ' is not iterable');\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isArray = require('../internals/is-array');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof-raw');\nvar toString = require('../internals/to-string');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (replacer) {\n if (isCallable(replacer)) return replacer;\n if (!isArray(replacer)) return;\n var rawLength = replacer.length;\n var keys = [];\n for (var i = 0; i < rawLength; i++) {\n var element = replacer[i];\n if (typeof element == 'string') push(keys, element);\n else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') push(keys, toString(element));\n }\n var keysLength = keys.length;\n var root = true;\n return function (key, value) {\n if (root) {\n root = false;\n return value;\n }\n if (isArray(this)) return value;\n for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;\n };\n};\n","'use strict';\nvar aCallable = require('../internals/a-callable');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n","'use strict';\nvar check = function (it) {\n return it && it.Math === Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || this || Function('return this')();\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","'use strict';\nmodule.exports = {};\n","'use strict';\nmodule.exports = function (a, b) {\n try {\n // eslint-disable-next-line no-console -- safe\n arguments.length === 1 ? console.error(a) : console.error(a, b);\n } catch (error) { /* empty */ }\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a !== 7;\n});\n","'use strict';\n// IEEE754 conversions based on https://github.com/feross/ieee754\nvar sign = require('../internals/math-sign');\nvar trunc = require('../internals/math-trunc');\n\nvar $Array = Array;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\n\nvar roundToEven = function (number) {\n var truncated = trunc(number);\n var delta = abs(number - truncated);\n if (delta > 0.5 || delta === 0.5 && truncated % 2 !== 0) {\n return truncated + sign(number);\n } return truncated;\n};\n\nvar pack = function (number, mantissaLength, bytes) {\n var buffer = $Array(bytes);\n var exponentLength = bytes * 8 - mantissaLength - 1;\n var eMax = (1 << exponentLength) - 1;\n var eBias = eMax >> 1;\n var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var s = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;\n var index = 0;\n var exponent, mantissa, c;\n number = abs(number);\n // eslint-disable-next-line no-self-compare -- NaN check\n if (number !== number || number === Infinity) {\n // eslint-disable-next-line no-self-compare -- NaN check\n mantissa = number !== number ? 1 : 0;\n exponent = eMax;\n } else {\n exponent = floor(log(number) / LN2);\n c = pow(2, -exponent);\n if (number * c < 1) {\n exponent--;\n c *= 2;\n }\n if (exponent + eBias >= 1) {\n number += rt / c;\n } else {\n number += rt * pow(2, 1 - eBias);\n }\n if (number * c >= 2) {\n exponent++;\n c /= 2;\n }\n if (exponent + eBias >= eMax) {\n mantissa = 0;\n exponent = eMax;\n } else if (exponent + eBias >= 1) {\n mantissa = roundToEven((number * c - 1) * pow(2, mantissaLength));\n exponent += eBias;\n } else {\n mantissa = roundToEven(number * pow(2, eBias - 1) * pow(2, mantissaLength));\n exponent = 0;\n }\n }\n while (mantissaLength >= 8) {\n buffer[index++] = mantissa & 255;\n mantissa /= 256;\n mantissaLength -= 8;\n }\n exponent = exponent << mantissaLength | mantissa;\n exponentLength += mantissaLength;\n while (exponentLength > 0) {\n buffer[index++] = exponent & 255;\n exponent /= 256;\n exponentLength -= 8;\n }\n buffer[--index] |= s * 128;\n return buffer;\n};\n\nvar unpack = function (buffer, mantissaLength) {\n var bytes = buffer.length;\n var exponentLength = bytes * 8 - mantissaLength - 1;\n var eMax = (1 << exponentLength) - 1;\n var eBias = eMax >> 1;\n var nBits = exponentLength - 7;\n var index = bytes - 1;\n var s = buffer[index--];\n var exponent = s & 127;\n var mantissa;\n s >>= 7;\n while (nBits > 0) {\n exponent = exponent * 256 + buffer[index--];\n nBits -= 8;\n }\n mantissa = exponent & (1 << -nBits) - 1;\n exponent >>= -nBits;\n nBits += mantissaLength;\n while (nBits > 0) {\n mantissa = mantissa * 256 + buffer[index--];\n nBits -= 8;\n }\n if (exponent === 0) {\n exponent = 1 - eBias;\n } else if (exponent === eMax) {\n return mantissa ? NaN : s ? -Infinity : Infinity;\n } else {\n mantissa += pow(2, mantissaLength);\n exponent -= eBias;\n } return (s ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);\n};\n\nmodule.exports = {\n pack: pack,\n unpack: unpack\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) === 'String' ? split(it, '') : $Object(it);\n} : $Object;\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// makes subclassing work correct for wrapped built-ins\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (\n // it can work only with native `setPrototypeOf`\n setPrototypeOf &&\n // we haven't completely correct pre-ES6 way for getting `new.target`, so use this\n isCallable(NewTarget = dummy.constructor) &&\n NewTarget !== Wrapper &&\n isObject(NewTargetPrototype = NewTarget.prototype) &&\n NewTargetPrototype !== Wrapper.prototype\n ) setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar store = require('../internals/shared-store');\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","'use strict';\nvar NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n /* eslint-disable no-self-assign -- prototype methods protection */\n store.get = store.get;\n store.has = store.has;\n store.set = store.set;\n /* eslint-enable no-self-assign -- prototype methods protection */\n set = function (it, metadata) {\n if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n store.set(it, metadata);\n return metadata;\n };\n get = function (it) {\n return store.get(it) || {};\n };\n has = function (it) {\n return store.has(it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar ArrayPrototype = Array.prototype;\n\n// check on default Array iterator\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);\n};\n","'use strict';\nvar classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.es/ecma262/#sec-isarray\n// eslint-disable-next-line es/no-array-isarray -- safe\nmodule.exports = Array.isArray || function isArray(argument) {\n return classof(argument) === 'Array';\n};\n","'use strict';\nvar classof = require('../internals/classof');\n\nmodule.exports = function (it) {\n var klass = classof(it);\n return klass === 'BigInt64Array' || klass === 'BigUint64Array';\n};\n","'use strict';\nvar $documentAll = require('../internals/document-all');\n\nvar documentAll = $documentAll.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\nmodule.exports = $documentAll.IS_HTMLDDA ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof');\nvar getBuiltIn = require('../internals/get-built-in');\nvar inspectSource = require('../internals/inspect-source');\n\nvar noop = function () { /* empty */ };\nvar empty = [];\nvar construct = getBuiltIn('Reflect', 'construct');\nvar constructorRegExp = /^\\s*(?:class|function)\\b/;\nvar exec = uncurryThis(constructorRegExp.exec);\nvar INCORRECT_TO_STRING = !constructorRegExp.exec(noop);\n\nvar isConstructorModern = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n try {\n construct(noop, empty, argument);\n return true;\n } catch (error) {\n return false;\n }\n};\n\nvar isConstructorLegacy = function isConstructor(argument) {\n if (!isCallable(argument)) return false;\n switch (classof(argument)) {\n case 'AsyncFunction':\n case 'GeneratorFunction':\n case 'AsyncGeneratorFunction': return false;\n }\n try {\n // we can't check .prototype since constructors produced by .bind haven't it\n // `Function#toString` throws on some built-it function in some legacy engines\n // (for example, `DOMQuad` and similar in FF41-)\n return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));\n } catch (error) {\n return true;\n }\n};\n\nisConstructorLegacy.sham = true;\n\n// `IsConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-isconstructor\nmodule.exports = !construct || fails(function () {\n var called;\n return isConstructorModern(isConstructorModern.call)\n || !isConstructorModern(Object)\n || !isConstructorModern(function () { called = true; })\n || called;\n}) ? isConstructorLegacy : isConstructorModern;\n","'use strict';\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value === POLYFILL ? true\n : value === NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","'use strict';\nvar isObject = require('../internals/is-object');\n\nvar floor = Math.floor;\n\n// `IsIntegralNumber` abstract operation\n// https://tc39.es/ecma262/#sec-isintegralnumber\n// eslint-disable-next-line es/no-number-isinteger -- safe\nmodule.exports = Number.isInteger || function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n","'use strict';\n// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar $documentAll = require('../internals/document-all');\n\nvar documentAll = $documentAll.all;\n\nmodule.exports = $documentAll.IS_HTMLDDA ? function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;\n} : function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","'use strict';\nmodule.exports = false;\n","'use strict';\nvar isObject = require('../internals/is-object');\nvar classof = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar MATCH = wellKnownSymbol('match');\n\n// `IsRegExp` abstract operation\n// https://tc39.es/ecma262/#sec-isregexp\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar tryToString = require('../internals/try-to-string');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar iteratorClose = require('../internals/iterator-close');\n\nvar $TypeError = TypeError;\n\nvar Result = function (stopped, result) {\n this.stopped = stopped;\n this.result = result;\n};\n\nvar ResultPrototype = Result.prototype;\n\nmodule.exports = function (iterable, unboundFunction, options) {\n var that = options && options.that;\n var AS_ENTRIES = !!(options && options.AS_ENTRIES);\n var IS_RECORD = !!(options && options.IS_RECORD);\n var IS_ITERATOR = !!(options && options.IS_ITERATOR);\n var INTERRUPTED = !!(options && options.INTERRUPTED);\n var fn = bind(unboundFunction, that);\n var iterator, iterFn, index, length, result, next, step;\n\n var stop = function (condition) {\n if (iterator) iteratorClose(iterator, 'normal', condition);\n return new Result(true, condition);\n };\n\n var callFn = function (value) {\n if (AS_ENTRIES) {\n anObject(value);\n return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);\n } return INTERRUPTED ? fn(value, stop) : fn(value);\n };\n\n if (IS_RECORD) {\n iterator = iterable.iterator;\n } else if (IS_ITERATOR) {\n iterator = iterable;\n } else {\n iterFn = getIteratorMethod(iterable);\n if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');\n // optimisation for array iterators\n if (isArrayIteratorMethod(iterFn)) {\n for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {\n result = callFn(iterable[index]);\n if (result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n }\n iterator = getIterator(iterable, iterFn);\n }\n\n next = IS_RECORD ? iterable.next : iterator.next;\n while (!(step = call(next, iterator)).done) {\n try {\n result = callFn(step.value);\n } catch (error) {\n iteratorClose(iterator, 'throw', error);\n }\n if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;\n } return new Result(false);\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar getMethod = require('../internals/get-method');\n\nmodule.exports = function (iterator, kind, value) {\n var innerResult, innerError;\n anObject(iterator);\n try {\n innerResult = getMethod(iterator, 'return');\n if (!innerResult) {\n if (kind === 'throw') throw value;\n return value;\n }\n innerResult = call(innerResult, iterator);\n } catch (error) {\n innerError = true;\n innerResult = error;\n }\n if (kind === 'throw') throw value;\n if (innerError) throw innerResult;\n anObject(innerResult);\n return value;\n};\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar IS_PURE = require('../internals/is-pure');\nvar FunctionName = require('../internals/function-name');\nvar isCallable = require('../internals/is-callable');\nvar createIteratorConstructor = require('../internals/iterator-create-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar PROPER_FUNCTION_NAME = FunctionName.PROPER;\nvar CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];\n\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n }\n\n return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {\n defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array.prototype.{ values, @@iterator }.name in V8 / FF\n if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {\n createNonEnumerableProperty(IterablePrototype, 'name', VALUES);\n } else {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return call(nativeIterator, this); };\n }\n }\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n defineBuiltIn(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });\n }\n Iterators[NAME] = defaultIterator;\n\n return methods;\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar create = require('../internals/object-create');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\n// `%IteratorPrototype%` object\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\n/* eslint-disable es/no-array-prototype-keys -- safe */\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nvar NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {\n var test = {};\n // FF44- legacy iterators case\n return IteratorPrototype[ITERATOR].call(test) !== test;\n});\n\nif (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};\nelse if (IS_PURE) IteratorPrototype = create(IteratorPrototype);\n\n// `%IteratorPrototype%[@@iterator]()` method\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator\nif (!isCallable(IteratorPrototype[ITERATOR])) {\n defineBuiltIn(IteratorPrototype, ITERATOR, function () {\n return this;\n });\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","'use strict';\nmodule.exports = {};\n","'use strict';\nvar toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE;\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\nvar $String = String;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\nvar stringSlice = uncurryThis(''.slice);\nvar replace = uncurryThis(''.replace);\nvar join = uncurryThis([].join);\n\nvar CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {\n return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;\n});\n\nvar TEMPLATE = String(String).split('String');\n\nvar makeBuiltIn = module.exports = function (value, name, options) {\n if (stringSlice($String(name), 0, 7) === 'Symbol(') {\n name = '[' + replace($String(name), /^Symbol\\(([^)]*)\\)/, '$1') + ']';\n }\n if (options && options.getter) name = 'get ' + name;\n if (options && options.setter) name = 'set ' + name;\n if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {\n if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });\n else value.name = name;\n }\n if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {\n defineProperty(value, 'length', { value: options.arity });\n }\n try {\n if (options && hasOwn(options, 'constructor') && options.constructor) {\n if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });\n // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable\n } else if (value.prototype) value.prototype = undefined;\n } catch (error) { /* empty */ }\n var state = enforceInternalState(value);\n if (!hasOwn(state, 'source')) {\n state.source = join(TEMPLATE, typeof name == 'string' ? name : '');\n } return value;\n};\n\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n// eslint-disable-next-line no-extend-native -- required\nFunction.prototype.toString = makeBuiltIn(function toString() {\n return isCallable(this) && getInternalState(this).source || inspectSource(this);\n}, 'toString');\n","'use strict';\n// `Math.sign` method implementation\n// https://tc39.es/ecma262/#sec-math.sign\n// eslint-disable-next-line es/no-math-sign -- safe\nmodule.exports = Math.sign || function sign(x) {\n var n = +x;\n // eslint-disable-next-line no-self-compare -- NaN check\n return n === 0 || n !== n ? n : n < 0 ? -1 : 1;\n};\n","'use strict';\nvar ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.es/ecma262/#sec-math.trunc\n// eslint-disable-next-line es/no-math-trunc -- safe\nmodule.exports = Math.trunc || function trunc(x) {\n var n = +x;\n return (n > 0 ? floor : ceil)(n);\n};\n","'use strict';\nvar global = require('../internals/global');\nvar bind = require('../internals/function-bind-context');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar macrotask = require('../internals/task').set;\nvar Queue = require('../internals/queue');\nvar IS_IOS = require('../internals/engine-is-ios');\nvar IS_IOS_PEBBLE = require('../internals/engine-is-ios-pebble');\nvar IS_WEBOS_WEBKIT = require('../internals/engine-is-webos-webkit');\nvar IS_NODE = require('../internals/engine-is-node');\n\nvar MutationObserver = global.MutationObserver || global.WebKitMutationObserver;\nvar document = global.document;\nvar process = global.process;\nvar Promise = global.Promise;\n// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`\nvar queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');\nvar microtask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;\nvar notify, toggle, node, promise, then;\n\n// modern engines have queueMicrotask method\nif (!microtask) {\n var queue = new Queue();\n\n var flush = function () {\n var parent, fn;\n if (IS_NODE && (parent = process.domain)) parent.exit();\n while (fn = queue.get()) try {\n fn();\n } catch (error) {\n if (queue.head) notify();\n throw error;\n }\n if (parent) parent.enter();\n };\n\n // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339\n // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898\n if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {\n toggle = true;\n node = document.createTextNode('');\n new MutationObserver(flush).observe(node, { characterData: true });\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n promise = Promise.resolve(undefined);\n // workaround of WebKit ~ iOS Safari 10.1 bug\n promise.constructor = Promise;\n then = bind(promise.then, promise);\n notify = function () {\n then(flush);\n };\n // Node.js without promises\n } else if (IS_NODE) {\n notify = function () {\n process.nextTick(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessage\n // - onreadystatechange\n // - setTimeout\n } else {\n // `webpack` dev server bug on IE global methods - use bind(fn, global)\n macrotask = bind(macrotask, global);\n notify = function () {\n macrotask(flush);\n };\n }\n\n microtask = function (fn) {\n if (!queue.head) notify();\n queue.add(fn);\n };\n}\n\nmodule.exports = microtask;\n","'use strict';\nvar aCallable = require('../internals/a-callable');\n\nvar $TypeError = TypeError;\n\nvar PromiseCapability = function (C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw $TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aCallable(resolve);\n this.reject = aCallable(reject);\n};\n\n// `NewPromiseCapability` abstract operation\n// https://tc39.es/ecma262/#sec-newpromisecapability\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","'use strict';\n/* global ActiveXObject -- old IE, WSH */\nvar anObject = require('../internals/an-object');\nvar definePropertiesModule = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n activeXDocument = new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = typeof document != 'undefined'\n ? document.domain && activeXDocument\n ? NullProtoObjectViaActiveX(activeXDocument) // old IE\n : NullProtoObjectViaIFrame()\n : NullProtoObjectViaActiveX(activeXDocument); // WSH\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.es/ecma262/#sec-object.create\n// eslint-disable-next-line es/no-object-create -- safe\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : definePropertiesModule.f(result, Properties);\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.es/ecma262/#sec-object.defineproperties\n// eslint-disable-next-line es/no-object-defineproperties -- safe\nexports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var props = toIndexedObject(Properties);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);\n return O;\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","'use strict';\n/* eslint-disable es/no-object-getownpropertynames -- safe */\nvar classof = require('../internals/classof-raw');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar $getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar arraySlice = require('../internals/array-slice-simple');\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return $getOwnPropertyNames(it);\n } catch (error) {\n return arraySlice(windowNames);\n }\n};\n\n// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && classof(it) === 'Window'\n ? getWindowNames(it)\n : $getOwnPropertyNames(toIndexedObject(it));\n};\n","'use strict';\nvar internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","'use strict';\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe\nexports.f = Object.getOwnPropertySymbols;\n","'use strict';\nvar hasOwn = require('../internals/has-own-property');\nvar isCallable = require('../internals/is-callable');\nvar toObject = require('../internals/to-object');\nvar sharedKey = require('../internals/shared-key');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar $Object = Object;\nvar ObjectPrototype = $Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.getprototypeof\n// eslint-disable-next-line es/no-object-getprototypeof -- safe\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {\n var object = toObject(O);\n if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];\n var constructor = object.constructor;\n if (isCallable(constructor) && object instanceof constructor) {\n return constructor.prototype;\n } return object instanceof $Object ? ObjectPrototype : null;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n","'use strict';\nvar internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\n// `Object.keys` method\n// https://tc39.es/ecma262/#sec-object.keys\n// eslint-disable-next-line es/no-object-keys -- safe\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","'use strict';\n/* eslint-disable no-proto -- safe */\nvar uncurryThisAccessor = require('../internals/function-uncurry-this-accessor');\nvar anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar classof = require('../internals/classof');\n\n// `Object.prototype.toString` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.tostring\nmodule.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {\n return '[object ' + classof(this) + ']';\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw $TypeError(\"Can't convert object to primitive value\");\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\nvar concat = uncurryThis([].concat);\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n","'use strict';\nvar global = require('../internals/global');\n\nmodule.exports = global;\n","'use strict';\nmodule.exports = function (exec) {\n try {\n return { error: false, value: exec() };\n } catch (error) {\n return { error: true, value: error };\n }\n};\n","'use strict';\nvar global = require('../internals/global');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar isCallable = require('../internals/is-callable');\nvar isForced = require('../internals/is-forced');\nvar inspectSource = require('../internals/inspect-source');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_BROWSER = require('../internals/engine-is-browser');\nvar IS_DENO = require('../internals/engine-is-deno');\nvar IS_PURE = require('../internals/is-pure');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\nvar SPECIES = wellKnownSymbol('species');\nvar SUBCLASSING = false;\nvar NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);\n\nvar FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {\n var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);\n var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);\n // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // We can't detect it synchronously, so just check versions\n if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;\n // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution\n if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;\n // We can't use @@species feature detection in V8 since it causes\n // deoptimization and performance degradation\n // https://github.com/zloirock/core-js/issues/679\n if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {\n // Detect correctness of subclassing with @@species support\n var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });\n var FakePromise = function (exec) {\n exec(function () { /* empty */ }, function () { /* empty */ });\n };\n var constructor = promise.constructor = {};\n constructor[SPECIES] = FakePromise;\n SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;\n if (!SUBCLASSING) return true;\n // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT;\n});\n\nmodule.exports = {\n CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,\n REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,\n SUBCLASSING: SUBCLASSING\n};\n","'use strict';\nvar global = require('../internals/global');\n\nmodule.exports = global.Promise;\n","'use strict';\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar newPromiseCapability = require('../internals/new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","'use strict';\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\n\nmodule.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {\n NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });\n});\n","'use strict';\nvar Queue = function () {\n this.head = null;\n this.tail = null;\n};\n\nQueue.prototype = {\n add: function (item) {\n var entry = { item: item, next: null };\n var tail = this.tail;\n if (tail) tail.next = entry;\n else this.head = entry;\n this.tail = entry;\n },\n get: function () {\n var entry = this.head;\n if (entry) {\n var next = this.head = entry.next;\n if (next === null) this.tail = null;\n return entry.item;\n }\n }\n};\n\nmodule.exports = Queue;\n","'use strict';\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar isCallable = require('../internals/is-callable');\nvar classof = require('../internals/classof-raw');\nvar regexpExec = require('../internals/regexp-exec');\n\nvar $TypeError = TypeError;\n\n// `RegExpExec` abstract operation\n// https://tc39.es/ecma262/#sec-regexpexec\nmodule.exports = function (R, S) {\n var exec = R.exec;\n if (isCallable(exec)) {\n var result = call(exec, R, S);\n if (result !== null) anObject(result);\n return result;\n }\n if (classof(R) === 'RegExp') return call(regexpExec, R, S);\n throw $TypeError('RegExp#exec called on incompatible receiver');\n};\n","'use strict';\n/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */\n/* eslint-disable regexp/no-useless-quantifier -- testing */\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toString = require('../internals/to-string');\nvar regexpFlags = require('../internals/regexp-flags');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar shared = require('../internals/shared');\nvar create = require('../internals/object-create');\nvar getInternalState = require('../internals/internal-state').get;\nvar UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all');\nvar UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg');\n\nvar nativeReplace = shared('native-string-replace', String.prototype.replace);\nvar nativeExec = RegExp.prototype.exec;\nvar patchedExec = nativeExec;\nvar charAt = uncurryThis(''.charAt);\nvar indexOf = uncurryThis(''.indexOf);\nvar replace = uncurryThis(''.replace);\nvar stringSlice = uncurryThis(''.slice);\n\nvar UPDATES_LAST_INDEX_WRONG = (function () {\n var re1 = /a/;\n var re2 = /b*/g;\n call(nativeExec, re1, 'a');\n call(nativeExec, re2, 'a');\n return re1.lastIndex !== 0 || re2.lastIndex !== 0;\n})();\n\nvar UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;\n\n// nonparticipating capturing group, copied from es5-shim's String#split patch.\nvar NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;\n\nvar PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;\n\nif (PATCH) {\n patchedExec = function exec(string) {\n var re = this;\n var state = getInternalState(re);\n var str = toString(string);\n var raw = state.raw;\n var result, reCopy, lastIndex, match, i, object, group;\n\n if (raw) {\n raw.lastIndex = re.lastIndex;\n result = call(patchedExec, raw, str);\n re.lastIndex = raw.lastIndex;\n return result;\n }\n\n var groups = state.groups;\n var sticky = UNSUPPORTED_Y && re.sticky;\n var flags = call(regexpFlags, re);\n var source = re.source;\n var charsAdded = 0;\n var strCopy = str;\n\n if (sticky) {\n flags = replace(flags, 'y', '');\n if (indexOf(flags, 'g') === -1) {\n flags += 'g';\n }\n\n strCopy = stringSlice(str, re.lastIndex);\n // Support anchored sticky behavior.\n if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\\n')) {\n source = '(?: ' + source + ')';\n strCopy = ' ' + strCopy;\n charsAdded++;\n }\n // ^(? + rx + ) is needed, in combination with some str slicing, to\n // simulate the 'y' flag.\n reCopy = new RegExp('^(?:' + source + ')', flags);\n }\n\n if (NPCG_INCLUDED) {\n reCopy = new RegExp('^' + source + '$(?!\\\\s)', flags);\n }\n if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;\n\n match = call(nativeExec, sticky ? reCopy : re, strCopy);\n\n if (sticky) {\n if (match) {\n match.input = stringSlice(match.input, charsAdded);\n match[0] = stringSlice(match[0], charsAdded);\n match.index = re.lastIndex;\n re.lastIndex += match[0].length;\n } else re.lastIndex = 0;\n } else if (UPDATES_LAST_INDEX_WRONG && match) {\n re.lastIndex = re.global ? match.index + match[0].length : lastIndex;\n }\n if (NPCG_INCLUDED && match && match.length > 1) {\n // Fix browsers whose `exec` methods don't consistently return `undefined`\n // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/\n call(nativeReplace, match[0], reCopy, function () {\n for (i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undefined) match[i] = undefined;\n }\n });\n }\n\n if (match && groups) {\n match.groups = object = create(null);\n for (i = 0; i < groups.length; i++) {\n group = groups[i];\n object[group[0]] = match[group[1]];\n }\n }\n\n return match;\n };\n}\n\nmodule.exports = patchedExec;\n","'use strict';\nvar anObject = require('../internals/an-object');\n\n// `RegExp.prototype.flags` getter implementation\n// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.hasIndices) result += 'd';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.dotAll) result += 's';\n if (that.unicode) result += 'u';\n if (that.unicodeSets) result += 'v';\n if (that.sticky) result += 'y';\n return result;\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\n\n// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError\nvar $RegExp = global.RegExp;\n\nvar UNSUPPORTED_Y = fails(function () {\n var re = $RegExp('a', 'y');\n re.lastIndex = 2;\n return re.exec('abcd') !== null;\n});\n\n// UC Browser bug\n// https://github.com/zloirock/core-js/issues/1008\nvar MISSED_STICKY = UNSUPPORTED_Y || fails(function () {\n return !$RegExp('a', 'y').sticky;\n});\n\nvar BROKEN_CARET = UNSUPPORTED_Y || fails(function () {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=773687\n var re = $RegExp('^r', 'gy');\n re.lastIndex = 2;\n return re.exec('str') !== null;\n});\n\nmodule.exports = {\n BROKEN_CARET: BROKEN_CARET,\n MISSED_STICKY: MISSED_STICKY,\n UNSUPPORTED_Y: UNSUPPORTED_Y\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\n\n// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError\nvar $RegExp = global.RegExp;\n\nmodule.exports = fails(function () {\n var re = $RegExp('.', 's');\n return !(re.dotAll && re.exec('\\n') && re.flags === 's');\n});\n","'use strict';\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\n\n// babel-minify and Closure Compiler transpiles RegExp('(?
b)', 'g') -> /(?b)/g and it causes SyntaxError\nvar $RegExp = global.RegExp;\n\nmodule.exports = fails(function () {\n var re = $RegExp('(?b)', 'g');\n return re.exec('b').groups.a !== 'b' ||\n 'b'.replace(re, '$c') !== 'bc';\n});\n","'use strict';\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw $TypeError(\"Can't call method on \" + it);\n return it;\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar SPECIES = wellKnownSymbol('species');\n\nmodule.exports = function (CONSTRUCTOR_NAME) {\n var Constructor = getBuiltIn(CONSTRUCTOR_NAME);\n\n if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {\n defineBuiltInAccessor(Constructor, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n }\n};\n","'use strict';\nvar defineProperty = require('../internals/object-define-property').f;\nvar hasOwn = require('../internals/has-own-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (target, TAG, STATIC) {\n if (target && !STATIC) target = target.prototype;\n if (target && !hasOwn(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n};\n","'use strict';\nvar shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","'use strict';\nvar global = require('../internals/global');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n","'use strict';\nvar IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.32.2',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","'use strict';\nvar anObject = require('../internals/an-object');\nvar aConstructor = require('../internals/a-constructor');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar SPECIES = wellKnownSymbol('species');\n\n// `SpeciesConstructor` abstract operation\n// https://tc39.es/ecma262/#sec-speciesconstructor\nmodule.exports = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S);\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar stringSlice = uncurryThis(''.slice);\n\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = toString(requireObjectCoercible($this));\n var position = toIntegerOrInfinity(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = charCodeAt(S, position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING\n ? charAt(S, position)\n : first\n : CONVERT_TO_STRING\n ? stringSlice(S, position, position + 2)\n : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n};\n\nmodule.exports = {\n // `String.prototype.codePointAt` method\n // https://tc39.es/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod(true)\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar toString = require('../internals/to-string');\nvar whitespaces = require('../internals/whitespaces');\n\nvar replace = uncurryThis(''.replace);\nvar ltrim = RegExp('^[' + whitespaces + ']+');\nvar rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$');\n\n// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation\nvar createMethod = function (TYPE) {\n return function ($this) {\n var string = toString(requireObjectCoercible($this));\n if (TYPE & 1) string = replace(string, ltrim, '');\n if (TYPE & 2) string = replace(string, rtrim, '$1');\n return string;\n };\n};\n\nmodule.exports = {\n // `String.prototype.{ trimLeft, trimStart }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimstart\n start: createMethod(1),\n // `String.prototype.{ trimRight, trimEnd }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimend\n end: createMethod(2),\n // `String.prototype.trim` method\n // https://tc39.es/ecma262/#sec-string.prototype.trim\n trim: createMethod(3)\n};\n","'use strict';\n/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/engine-v8-version');\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\n\nvar $String = global.String;\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol('symbol detection');\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,\n // of course, fail.\n return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","'use strict';\nvar call = require('../internals/function-call');\nvar getBuiltIn = require('../internals/get-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar defineBuiltIn = require('../internals/define-built-in');\n\nmodule.exports = function () {\n var Symbol = getBuiltIn('Symbol');\n var SymbolPrototype = Symbol && Symbol.prototype;\n var valueOf = SymbolPrototype && SymbolPrototype.valueOf;\n var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {\n // `Symbol.prototype[@@toPrimitive]` method\n // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive\n // eslint-disable-next-line no-unused-vars -- required for .length\n defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {\n return call(valueOf, this);\n }, { arity: 1 });\n }\n};\n","'use strict';\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\n/* eslint-disable es/no-symbol -- safe */\nmodule.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;\n","'use strict';\nvar global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar bind = require('../internals/function-bind-context');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar fails = require('../internals/fails');\nvar html = require('../internals/html');\nvar arraySlice = require('../internals/array-slice');\nvar createElement = require('../internals/document-create-element');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\nvar IS_IOS = require('../internals/engine-is-ios');\nvar IS_NODE = require('../internals/engine-is-node');\n\nvar set = global.setImmediate;\nvar clear = global.clearImmediate;\nvar process = global.process;\nvar Dispatch = global.Dispatch;\nvar Function = global.Function;\nvar MessageChannel = global.MessageChannel;\nvar String = global.String;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar $location, defer, channel, port;\n\nfails(function () {\n // Deno throws a ReferenceError on `location` access without `--location` flag\n $location = global.location;\n});\n\nvar run = function (id) {\n if (hasOwn(queue, id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\n\nvar runner = function (id) {\n return function () {\n run(id);\n };\n};\n\nvar eventListener = function (event) {\n run(event.data);\n};\n\nvar globalPostMessageDefer = function (id) {\n // old engines have not location.origin\n global.postMessage(String(id), $location.protocol + '//' + $location.host);\n};\n\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!set || !clear) {\n set = function setImmediate(handler) {\n validateArgumentsLength(arguments.length, 1);\n var fn = isCallable(handler) ? handler : Function(handler);\n var args = arraySlice(arguments, 1);\n queue[++counter] = function () {\n apply(fn, undefined, args);\n };\n defer(counter);\n return counter;\n };\n clear = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (IS_NODE) {\n defer = function (id) {\n process.nextTick(runner(id));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(runner(id));\n };\n // Browsers with MessageChannel, includes WebWorkers\n // except iOS - https://github.com/zloirock/core-js/issues/624\n } else if (MessageChannel && !IS_IOS) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = eventListener;\n defer = bind(port.postMessage, port);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (\n global.addEventListener &&\n isCallable(global.postMessage) &&\n !global.importScripts &&\n $location && $location.protocol !== 'file:' &&\n !fails(globalPostMessageDefer)\n ) {\n defer = globalPostMessageDefer;\n global.addEventListener('message', eventListener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in createElement('script')) {\n defer = function (id) {\n html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(runner(id), 0);\n };\n }\n}\n\nmodule.exports = {\n set: set,\n clear: clear\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\n// `thisNumberValue` abstract operation\n// https://tc39.es/ecma262/#sec-thisnumbervalue\nmodule.exports = uncurryThis(1.0.valueOf);\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\n\nvar $TypeError = TypeError;\n\n// `ToBigInt` abstract operation\n// https://tc39.es/ecma262/#sec-tobigint\nmodule.exports = function (argument) {\n var prim = toPrimitive(argument, 'number');\n if (typeof prim == 'number') throw $TypeError(\"Can't convert number to bigint\");\n // eslint-disable-next-line es/no-bigint -- safe\n return BigInt(prim);\n};\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar toLength = require('../internals/to-length');\n\nvar $RangeError = RangeError;\n\n// `ToIndex` abstract operation\n// https://tc39.es/ecma262/#sec-toindex\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toIntegerOrInfinity(it);\n var length = toLength(number);\n if (number !== length) throw $RangeError('Wrong length or index');\n return length;\n};\n","'use strict';\n// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","'use strict';\nvar trunc = require('../internals/math-trunc');\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- NaN check\n return number !== number || number === 0 ? 0 : trunc(number);\n};\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","'use strict';\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n","'use strict';\nvar toPositiveInteger = require('../internals/to-positive-integer');\n\nvar $RangeError = RangeError;\n\nmodule.exports = function (it, BYTES) {\n var offset = toPositiveInteger(it);\n if (offset % BYTES) throw $RangeError('Wrong offset');\n return offset;\n};\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar $RangeError = RangeError;\n\nmodule.exports = function (it) {\n var result = toIntegerOrInfinity(it);\n if (result < 0) throw $RangeError(\"The argument can't be less than 0\");\n return result;\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","'use strict';\nvar classof = require('../internals/classof');\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n","'use strict';\nvar round = Math.round;\n\nmodule.exports = function (it) {\n var value = round(it);\n return value < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF;\n};\n","'use strict';\nvar $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar ArrayBufferModule = require('../internals/array-buffer');\nvar anInstance = require('../internals/an-instance');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar isIntegralNumber = require('../internals/is-integral-number');\nvar toLength = require('../internals/to-length');\nvar toIndex = require('../internals/to-index');\nvar toOffset = require('../internals/to-offset');\nvar toUint8Clamped = require('../internals/to-uint8-clamped');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar classof = require('../internals/classof');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar create = require('../internals/object-create');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar typedArrayFrom = require('../internals/typed-array-from');\nvar forEach = require('../internals/array-iteration').forEach;\nvar setSpecies = require('../internals/set-species');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar definePropertyModule = require('../internals/object-define-property');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar InternalStateModule = require('../internals/internal-state');\nvar inheritIfRequired = require('../internals/inherit-if-required');\n\nvar getInternalState = InternalStateModule.get;\nvar setInternalState = InternalStateModule.set;\nvar enforceInternalState = InternalStateModule.enforce;\nvar nativeDefineProperty = definePropertyModule.f;\nvar nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\nvar RangeError = global.RangeError;\nvar ArrayBuffer = ArrayBufferModule.ArrayBuffer;\nvar ArrayBufferPrototype = ArrayBuffer.prototype;\nvar DataView = ArrayBufferModule.DataView;\nvar NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;\nvar TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;\nvar TypedArray = ArrayBufferViewCore.TypedArray;\nvar TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;\nvar aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;\nvar isTypedArray = ArrayBufferViewCore.isTypedArray;\nvar BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\nvar WRONG_LENGTH = 'Wrong length';\n\nvar fromList = function (C, list) {\n aTypedArrayConstructor(C);\n var index = 0;\n var length = list.length;\n var result = new C(length);\n while (length > index) result[index] = list[index++];\n return result;\n};\n\nvar addGetter = function (it, key) {\n defineBuiltInAccessor(it, key, {\n configurable: true,\n get: function () {\n return getInternalState(this)[key];\n }\n });\n};\n\nvar isArrayBuffer = function (it) {\n var klass;\n return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) === 'ArrayBuffer' || klass === 'SharedArrayBuffer';\n};\n\nvar isTypedArrayIndex = function (target, key) {\n return isTypedArray(target)\n && !isSymbol(key)\n && key in target\n && isIntegralNumber(+key)\n && key >= 0;\n};\n\nvar wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {\n key = toPropertyKey(key);\n return isTypedArrayIndex(target, key)\n ? createPropertyDescriptor(2, target[key])\n : nativeGetOwnPropertyDescriptor(target, key);\n};\n\nvar wrappedDefineProperty = function defineProperty(target, key, descriptor) {\n key = toPropertyKey(key);\n if (isTypedArrayIndex(target, key)\n && isObject(descriptor)\n && hasOwn(descriptor, 'value')\n && !hasOwn(descriptor, 'get')\n && !hasOwn(descriptor, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !descriptor.configurable\n && (!hasOwn(descriptor, 'writable') || descriptor.writable)\n && (!hasOwn(descriptor, 'enumerable') || descriptor.enumerable)\n ) {\n target[key] = descriptor.value;\n return target;\n } return nativeDefineProperty(target, key, descriptor);\n};\n\nif (DESCRIPTORS) {\n if (!NATIVE_ARRAY_BUFFER_VIEWS) {\n getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;\n definePropertyModule.f = wrappedDefineProperty;\n addGetter(TypedArrayPrototype, 'buffer');\n addGetter(TypedArrayPrototype, 'byteOffset');\n addGetter(TypedArrayPrototype, 'byteLength');\n addGetter(TypedArrayPrototype, 'length');\n }\n\n $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {\n getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,\n defineProperty: wrappedDefineProperty\n });\n\n module.exports = function (TYPE, wrapper, CLAMPED) {\n var BYTES = TYPE.match(/\\d+/)[0] / 8;\n var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + TYPE;\n var SETTER = 'set' + TYPE;\n var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME];\n var TypedArrayConstructor = NativeTypedArrayConstructor;\n var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;\n var exported = {};\n\n var getter = function (that, index) {\n var data = getInternalState(that);\n return data.view[GETTER](index * BYTES + data.byteOffset, true);\n };\n\n var setter = function (that, index, value) {\n var data = getInternalState(that);\n data.view[SETTER](index * BYTES + data.byteOffset, CLAMPED ? toUint8Clamped(value) : value, true);\n };\n\n var addElement = function (that, index) {\n nativeDefineProperty(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n\n if (!NATIVE_ARRAY_BUFFER_VIEWS) {\n TypedArrayConstructor = wrapper(function (that, data, offset, $length) {\n anInstance(that, TypedArrayConstructorPrototype);\n var index = 0;\n var byteOffset = 0;\n var buffer, byteLength, length;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new ArrayBuffer(byteLength);\n } else if (isArrayBuffer(data)) {\n buffer = data;\n byteOffset = toOffset(offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - byteOffset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (isTypedArray(data)) {\n return fromList(TypedArrayConstructor, data);\n } else {\n return call(typedArrayFrom, TypedArrayConstructor, data);\n }\n setInternalState(that, {\n buffer: buffer,\n byteOffset: byteOffset,\n byteLength: byteLength,\n length: length,\n view: new DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n\n if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);\n TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);\n } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {\n TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) {\n anInstance(dummy, TypedArrayConstructorPrototype);\n return inheritIfRequired(function () {\n if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data));\n if (isArrayBuffer(data)) return $length !== undefined\n ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length)\n : typedArrayOffset !== undefined\n ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES))\n : new NativeTypedArrayConstructor(data);\n if (isTypedArray(data)) return fromList(TypedArrayConstructor, data);\n return call(typedArrayFrom, TypedArrayConstructor, data);\n }(), dummy, TypedArrayConstructor);\n });\n\n if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);\n forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) {\n if (!(key in TypedArrayConstructor)) {\n createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);\n }\n });\n TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;\n }\n\n if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor);\n }\n\n enforceInternalState(TypedArrayConstructorPrototype).TypedArrayConstructor = TypedArrayConstructor;\n\n if (TYPED_ARRAY_TAG) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);\n }\n\n var FORCED = TypedArrayConstructor !== NativeTypedArrayConstructor;\n\n exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;\n\n $({ global: true, constructor: true, forced: FORCED, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported);\n\n if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {\n createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);\n }\n\n if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {\n createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);\n }\n\n setSpecies(CONSTRUCTOR_NAME);\n };\n} else module.exports = function () { /* empty */ };\n","'use strict';\n/* eslint-disable no-new -- required for testing */\nvar global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');\nvar NATIVE_ARRAY_BUFFER_VIEWS = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS;\n\nvar ArrayBuffer = global.ArrayBuffer;\nvar Int8Array = global.Int8Array;\n\nmodule.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {\n Int8Array(1);\n}) || !fails(function () {\n new Int8Array(-1);\n}) || !checkCorrectnessOfIteration(function (iterable) {\n new Int8Array();\n new Int8Array(null);\n new Int8Array(1.5);\n new Int8Array(iterable);\n}, true) || fails(function () {\n // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill\n return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;\n});\n","'use strict';\nvar arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list');\nvar typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');\n\nmodule.exports = function (instance, list) {\n return arrayFromConstructorAndList(typedArraySpeciesConstructor(instance), list);\n};\n","'use strict';\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar aConstructor = require('../internals/a-constructor');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar isBigIntArray = require('../internals/is-big-int-array');\nvar aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor;\nvar toBigInt = require('../internals/to-big-int');\n\nmodule.exports = function from(source /* , mapfn, thisArg */) {\n var C = aConstructor(this);\n var O = toObject(source);\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iteratorMethod = getIteratorMethod(O);\n var i, length, result, thisIsBigIntArray, value, step, iterator, next;\n if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) {\n iterator = getIterator(O, iteratorMethod);\n next = iterator.next;\n O = [];\n while (!(step = call(next, iterator)).done) {\n O.push(step.value);\n }\n }\n if (mapping && argumentsLength > 2) {\n mapfn = bind(mapfn, arguments[2]);\n }\n length = lengthOfArrayLike(O);\n result = new (aTypedArrayConstructor(C))(length);\n thisIsBigIntArray = isBigIntArray(result);\n for (i = 0; length > i; i++) {\n value = mapping ? mapfn(O[i], i) : O[i];\n // FF30- typed arrays doesn't properly convert objects to typed array values\n result[i] = thisIsBigIntArray ? toBigInt(value) : +value;\n }\n return result;\n};\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar speciesConstructor = require('../internals/species-constructor');\n\nvar aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;\nvar getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;\n\n// a part of `TypedArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#typedarray-species-create\nmodule.exports = function (originalArray) {\n return aTypedArrayConstructor(speciesConstructor(originalArray, getTypedArrayConstructor(originalArray)));\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","'use strict';\n/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype !== 42;\n});\n","'use strict';\nvar $TypeError = TypeError;\n\nmodule.exports = function (passed, required) {\n if (passed < required) throw $TypeError('Not enough arguments');\n return passed;\n};\n","'use strict';\nvar global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));\n","'use strict';\nvar path = require('../internals/path');\nvar hasOwn = require('../internals/has-own-property');\nvar wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');\nvar defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (NAME) {\n var Symbol = path.Symbol || (path.Symbol = {});\n if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {\n value: wrappedWellKnownSymbolModule.f(NAME)\n });\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nexports.f = wellKnownSymbol;\n","'use strict';\nvar global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar Symbol = global.Symbol;\nvar WellKnownSymbolsStore = shared('wks');\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name)) {\n WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)\n ? Symbol[name]\n : createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\n// a string of all valid unicode whitespaces\nmodule.exports = '\\u0009\\u000A\\u000B\\u000C\\u000D\\u0020\\u00A0\\u1680\\u2000\\u2001\\u2002' +\n '\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this-clause');\nvar fails = require('../internals/fails');\nvar ArrayBufferModule = require('../internals/array-buffer');\nvar anObject = require('../internals/an-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\nvar speciesConstructor = require('../internals/species-constructor');\n\nvar ArrayBuffer = ArrayBufferModule.ArrayBuffer;\nvar DataView = ArrayBufferModule.DataView;\nvar DataViewPrototype = DataView.prototype;\nvar nativeArrayBufferSlice = uncurryThis(ArrayBuffer.prototype.slice);\nvar getUint8 = uncurryThis(DataViewPrototype.getUint8);\nvar setUint8 = uncurryThis(DataViewPrototype.setUint8);\n\nvar INCORRECT_SLICE = fails(function () {\n return !new ArrayBuffer(2).slice(1, undefined).byteLength;\n});\n\n// `ArrayBuffer.prototype.slice` method\n// https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice\n$({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, {\n slice: function slice(start, end) {\n if (nativeArrayBufferSlice && end === undefined) {\n return nativeArrayBufferSlice(anObject(this), start); // FF fix\n }\n var length = anObject(this).byteLength;\n var first = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n var result = new (speciesConstructor(this, ArrayBuffer))(toLength(fin - first));\n var viewSource = new DataView(this);\n var viewTarget = new DataView(result);\n var index = 0;\n while (first < fin) {\n setUint8(viewTarget, index++, getUint8(viewSource, first++));\n } return result;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');\nvar createProperty = require('../internals/create-property');\nvar arraySpeciesCreate = require('../internals/array-species-create');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar V8_VERSION = require('../internals/engine-v8-version');\n\nvar IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');\n\n// We can't use this feature detection in V8 since it causes\n// deoptimization and serious performance degradation\n// https://github.com/zloirock/core-js/issues/679\nvar IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {\n var array = [];\n array[IS_CONCAT_SPREADABLE] = false;\n return array.concat()[0] !== array;\n});\n\nvar isConcatSpreadable = function (O) {\n if (!isObject(O)) return false;\n var spreadable = O[IS_CONCAT_SPREADABLE];\n return spreadable !== undefined ? !!spreadable : isArray(O);\n};\n\nvar FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat');\n\n// `Array.prototype.concat` method\n// https://tc39.es/ecma262/#sec-array.prototype.concat\n// with adding support of @@isConcatSpreadable and @@species\n$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n concat: function concat(arg) {\n var O = toObject(this);\n var A = arraySpeciesCreate(O, 0);\n var n = 0;\n var i, k, length, len, E;\n for (i = -1, length = arguments.length; i < length; i++) {\n E = i === -1 ? O : arguments[i];\n if (isConcatSpreadable(E)) {\n len = lengthOfArrayLike(E);\n doesNotExceedSafeInteger(n + len);\n for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);\n } else {\n doesNotExceedSafeInteger(n + 1);\n createProperty(A, n++, E);\n }\n }\n A.length = n;\n return A;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar $filter = require('../internals/array-iteration').filter;\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');\n\n// `Array.prototype.filter` method\n// https://tc39.es/ecma262/#sec-array.prototype.filter\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar forEach = require('../internals/array-for-each');\n\n// `Array.prototype.forEach` method\n// https://tc39.es/ecma262/#sec-array.prototype.foreach\n// eslint-disable-next-line es/no-array-prototype-foreach -- safe\n$({ target: 'Array', proto: true, forced: [].forEach !== forEach }, {\n forEach: forEach\n});\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineProperty = require('../internals/object-define-property').f;\nvar defineIterator = require('../internals/iterator-define');\nvar createIterResultObject = require('../internals/create-iter-result-object');\nvar IS_PURE = require('../internals/is-pure');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.es/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.es/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.es/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.es/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return createIterResultObject(undefined, true);\n }\n switch (kind) {\n case 'keys': return createIterResultObject(index, false);\n case 'values': return createIterResultObject(target[index], false);\n } return createIterResultObject([index, target[index]], false);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.es/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.es/ecma262/#sec-createmappedargumentsobject\nvar values = Iterators.Arguments = Iterators.Array;\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n// V8 ~ Chrome 45- bug\nif (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {\n defineProperty(values, 'name', { value: 'values' });\n} catch (error) { /* empty */ }\n","'use strict';\nvar $ = require('../internals/export');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isArray = require('../internals/is-array');\n\nvar nativeReverse = uncurryThis([].reverse);\nvar test = [1, 2];\n\n// `Array.prototype.reverse` method\n// https://tc39.es/ecma262/#sec-array.prototype.reverse\n// fix for Safari 12.0 bug\n// https://bugs.webkit.org/show_bug.cgi?id=188794\n$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {\n reverse: function reverse() {\n // eslint-disable-next-line no-self-assign -- dirty hack\n if (isArray(this)) this.length = this.length;\n return nativeReverse(this);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar isArray = require('../internals/is-array');\nvar isConstructor = require('../internals/is-constructor');\nvar isObject = require('../internals/is-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar createProperty = require('../internals/create-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\nvar nativeSlice = require('../internals/array-slice');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');\n\nvar SPECIES = wellKnownSymbol('species');\nvar $Array = Array;\nvar max = Math.max;\n\n// `Array.prototype.slice` method\n// https://tc39.es/ecma262/#sec-array.prototype.slice\n// fallback for not array-like ES3 strings and DOM objects\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n slice: function slice(start, end) {\n var O = toIndexedObject(this);\n var length = lengthOfArrayLike(O);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible\n var Constructor, result, n;\n if (isArray(O)) {\n Constructor = O.constructor;\n // cross-realm fallback\n if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {\n Constructor = undefined;\n } else if (isObject(Constructor)) {\n Constructor = Constructor[SPECIES];\n if (Constructor === null) Constructor = undefined;\n }\n if (Constructor === $Array || Constructor === undefined) {\n return nativeSlice(O, k, fin);\n }\n }\n result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));\n for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n }\n});\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar FUNCTION_NAME_EXISTS = require('../internals/function-name').EXISTS;\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\n\nvar FunctionPrototype = Function.prototype;\nvar functionToString = uncurryThis(FunctionPrototype.toString);\nvar nameRE = /function\\b(?:\\s|\\/\\*[\\S\\s]*?\\*\\/|\\/\\/[^\\n\\r]*[\\n\\r]+)*([^\\s(/]*)/;\nvar regExpExec = uncurryThis(nameRE.exec);\nvar NAME = 'name';\n\n// Function instances `.name` property\n// https://tc39.es/ecma262/#sec-function-instances-name\nif (DESCRIPTORS && !FUNCTION_NAME_EXISTS) {\n defineBuiltInAccessor(FunctionPrototype, NAME, {\n configurable: true,\n get: function () {\n try {\n return regExpExec(nameRE, functionToString(this))[1];\n } catch (error) {\n return '';\n }\n }\n });\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar apply = require('../internals/function-apply');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar isSymbol = require('../internals/is-symbol');\nvar arraySlice = require('../internals/array-slice');\nvar getReplacerFunction = require('../internals/get-json-replacer-function');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nvar $String = String;\nvar $stringify = getBuiltIn('JSON', 'stringify');\nvar exec = uncurryThis(/./.exec);\nvar charAt = uncurryThis(''.charAt);\nvar charCodeAt = uncurryThis(''.charCodeAt);\nvar replace = uncurryThis(''.replace);\nvar numberToString = uncurryThis(1.0.toString);\n\nvar tester = /[\\uD800-\\uDFFF]/g;\nvar low = /^[\\uD800-\\uDBFF]$/;\nvar hi = /^[\\uDC00-\\uDFFF]$/;\n\nvar WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {\n var symbol = getBuiltIn('Symbol')('stringify detection');\n // MS Edge converts symbol values to JSON as {}\n return $stringify([symbol]) !== '[null]'\n // WebKit converts symbol values to JSON as null\n || $stringify({ a: symbol }) !== '{}'\n // V8 throws on boxed symbols\n || $stringify(Object(symbol)) !== '{}';\n});\n\n// https://github.com/tc39/proposal-well-formed-stringify\nvar ILL_FORMED_UNICODE = fails(function () {\n return $stringify('\\uDF06\\uD834') !== '\"\\\\udf06\\\\ud834\"'\n || $stringify('\\uDEAD') !== '\"\\\\udead\"';\n});\n\nvar stringifyWithSymbolsFix = function (it, replacer) {\n var args = arraySlice(arguments);\n var $replacer = getReplacerFunction(replacer);\n if (!isCallable($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined\n args[1] = function (key, value) {\n // some old implementations (like WebKit) could pass numbers as keys\n if (isCallable($replacer)) value = call($replacer, this, $String(key), value);\n if (!isSymbol(value)) return value;\n };\n return apply($stringify, null, args);\n};\n\nvar fixIllFormed = function (match, offset, string) {\n var prev = charAt(string, offset - 1);\n var next = charAt(string, offset + 1);\n if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {\n return '\\\\u' + numberToString(charCodeAt(match, 0), 16);\n } return match;\n};\n\nif ($stringify) {\n // `JSON.stringify` method\n // https://tc39.es/ecma262/#sec-json.stringify\n $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n stringify: function stringify(it, replacer, space) {\n var args = arraySlice(arguments);\n var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);\n return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;\n }\n });\n}\n","'use strict';\nvar global = require('../internals/global');\nvar setToStringTag = require('../internals/set-to-string-tag');\n\n// JSON[@@toStringTag] property\n// https://tc39.es/ecma262/#sec-json-@@tostringtag\nsetToStringTag(global.JSON, 'JSON', true);\n","'use strict';\nvar setToStringTag = require('../internals/set-to-string-tag');\n\n// Math[@@toStringTag] property\n// https://tc39.es/ecma262/#sec-math-@@tostringtag\nsetToStringTag(Math, 'Math', true);\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar path = require('../internals/path');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isForced = require('../internals/is-forced');\nvar hasOwn = require('../internals/has-own-property');\nvar inheritIfRequired = require('../internals/inherit-if-required');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar isSymbol = require('../internals/is-symbol');\nvar toPrimitive = require('../internals/to-primitive');\nvar fails = require('../internals/fails');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names').f;\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar defineProperty = require('../internals/object-define-property').f;\nvar thisNumberValue = require('../internals/this-number-value');\nvar trim = require('../internals/string-trim').trim;\n\nvar NUMBER = 'Number';\nvar NativeNumber = global[NUMBER];\nvar PureNumberNamespace = path[NUMBER];\nvar NumberPrototype = NativeNumber.prototype;\nvar TypeError = global.TypeError;\nvar stringSlice = uncurryThis(''.slice);\nvar charCodeAt = uncurryThis(''.charCodeAt);\n\n// `ToNumeric` abstract operation\n// https://tc39.es/ecma262/#sec-tonumeric\nvar toNumeric = function (value) {\n var primValue = toPrimitive(value, 'number');\n return typeof primValue == 'bigint' ? primValue : toNumber(primValue);\n};\n\n// `ToNumber` abstract operation\n// https://tc39.es/ecma262/#sec-tonumber\nvar toNumber = function (argument) {\n var it = toPrimitive(argument, 'number');\n var first, third, radix, maxCode, digits, length, index, code;\n if (isSymbol(it)) throw TypeError('Cannot convert a Symbol value to a number');\n if (typeof it == 'string' && it.length > 2) {\n it = trim(it);\n first = charCodeAt(it, 0);\n if (first === 43 || first === 45) {\n third = charCodeAt(it, 2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (charCodeAt(it, 1)) {\n // fast equal of /^0b[01]+$/i\n case 66:\n case 98:\n radix = 2;\n maxCode = 49;\n break;\n // fast equal of /^0o[0-7]+$/i\n case 79:\n case 111:\n radix = 8;\n maxCode = 55;\n break;\n default:\n return +it;\n }\n digits = stringSlice(it, 2);\n length = digits.length;\n for (index = 0; index < length; index++) {\n code = charCodeAt(digits, index);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\nvar FORCED = isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'));\n\nvar calledWithNew = function (dummy) {\n // includes check on 1..constructor(foo) case\n return isPrototypeOf(NumberPrototype, dummy) && fails(function () { thisNumberValue(dummy); });\n};\n\n// `Number` constructor\n// https://tc39.es/ecma262/#sec-number-constructor\nvar NumberWrapper = function Number(value) {\n var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));\n return calledWithNew(this) ? inheritIfRequired(Object(n), this, NumberWrapper) : n;\n};\n\nNumberWrapper.prototype = NumberPrototype;\nif (FORCED && !IS_PURE) NumberPrototype.constructor = NumberWrapper;\n\n$({ global: true, constructor: true, wrap: true, forced: FORCED }, {\n Number: NumberWrapper\n});\n\n// Use `internal/copy-constructor-properties` helper in `core-js@4`\nvar copyConstructorProperties = function (target, source) {\n for (var keys = DESCRIPTORS ? getOwnPropertyNames(source) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES2015 (in case, if modules with ES2015 Number statics required before):\n 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' +\n // ESNext\n 'fromString,range'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (hasOwn(source, key = keys[j]) && !hasOwn(target, key)) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n\nif (IS_PURE && PureNumberNamespace) copyConstructorProperties(path[NUMBER], PureNumberNamespace);\nif (FORCED || IS_PURE) copyConstructorProperties(path[NUMBER], NativeNumber);\n","'use strict';\n// TODO: Remove from `core-js@4`\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar create = require('../internals/object-create');\n\n// `Object.create` method\n// https://tc39.es/ecma262/#sec-object.create\n$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {\n create: create\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar defineProperty = require('../internals/object-define-property').f;\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\n// eslint-disable-next-line es/no-object-defineproperty -- safe\n$({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {\n defineProperty: defineProperty\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar fails = require('../internals/fails');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar toObject = require('../internals/to-object');\n\n// V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives\n// https://bugs.chromium.org/p/v8/issues/detail?id=3443\nvar FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });\n\n// `Object.getOwnPropertySymbols` method\n// https://tc39.es/ecma262/#sec-object.getownpropertysymbols\n$({ target: 'Object', stat: true, forced: FORCED }, {\n getOwnPropertySymbols: function getOwnPropertySymbols(it) {\n var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar toObject = require('../internals/to-object');\nvar nativeGetPrototypeOf = require('../internals/object-get-prototype-of');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });\n\n// `Object.getPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.getprototypeof\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {\n getPrototypeOf: function getPrototypeOf(it) {\n return nativeGetPrototypeOf(toObject(it));\n }\n});\n\n","'use strict';\nvar $ = require('../internals/export');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n$({ target: 'Object', stat: true }, {\n setPrototypeOf: setPrototypeOf\n});\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar toString = require('../internals/object-to-string');\n\n// `Object.prototype.toString` method\n// https://tc39.es/ecma262/#sec-object.prototype.tostring\nif (!TO_STRING_TAG_SUPPORT) {\n defineBuiltIn(Object.prototype, 'toString', toString, { unsafe: true });\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\nvar PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');\n\n// `Promise.all` method\n// https://tc39.es/ecma262/#sec-promise.all\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aCallable(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n remaining++;\n call($promiseResolve, C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar defineBuiltIn = require('../internals/define-built-in');\n\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\n\n// `Promise.prototype.catch` method\n// https://tc39.es/ecma262/#sec-promise.prototype.catch\n$({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n});\n\n// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`\nif (!IS_PURE && isCallable(NativePromiseConstructor)) {\n var method = getBuiltIn('Promise').prototype['catch'];\n if (NativePromisePrototype['catch'] !== method) {\n defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });\n }\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar IS_PURE = require('../internals/is-pure');\nvar IS_NODE = require('../internals/engine-is-node');\nvar global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar setSpecies = require('../internals/set-species');\nvar aCallable = require('../internals/a-callable');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar anInstance = require('../internals/an-instance');\nvar speciesConstructor = require('../internals/species-constructor');\nvar task = require('../internals/task').set;\nvar microtask = require('../internals/microtask');\nvar hostReportErrors = require('../internals/host-report-errors');\nvar perform = require('../internals/perform');\nvar Queue = require('../internals/queue');\nvar InternalStateModule = require('../internals/internal-state');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar PromiseConstructorDetection = require('../internals/promise-constructor-detection');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\n\nvar PROMISE = 'Promise';\nvar FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;\nvar NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;\nvar NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;\nvar getInternalPromiseState = InternalStateModule.getterFor(PROMISE);\nvar setInternalState = InternalStateModule.set;\nvar NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;\nvar PromiseConstructor = NativePromiseConstructor;\nvar PromisePrototype = NativePromisePrototype;\nvar TypeError = global.TypeError;\nvar document = global.document;\nvar process = global.process;\nvar newPromiseCapability = newPromiseCapabilityModule.f;\nvar newGenericPromiseCapability = newPromiseCapability;\n\nvar DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);\nvar UNHANDLED_REJECTION = 'unhandledrejection';\nvar REJECTION_HANDLED = 'rejectionhandled';\nvar PENDING = 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\nvar HANDLED = 1;\nvar UNHANDLED = 2;\n\nvar Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && isCallable(then = it.then) ? then : false;\n};\n\nvar callReaction = function (reaction, state) {\n var value = state.value;\n var ok = state.state === FULFILLED;\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (state.rejection === UNHANDLED) onHandleUnhandled(state);\n state.rejection = HANDLED;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // can throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n call(then, result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (error) {\n if (domain && !exited) domain.exit();\n reject(error);\n }\n};\n\nvar notify = function (state, isReject) {\n if (state.notified) return;\n state.notified = true;\n microtask(function () {\n var reactions = state.reactions;\n var reaction;\n while (reaction = reactions.get()) {\n callReaction(reaction, state);\n }\n state.notified = false;\n if (isReject && !state.rejection) onUnhandled(state);\n });\n};\n\nvar dispatchEvent = function (name, promise, reason) {\n var event, handler;\n if (DISPATCH_EVENT) {\n event = document.createEvent('Event');\n event.promise = promise;\n event.reason = reason;\n event.initEvent(name, false, true);\n global.dispatchEvent(event);\n } else event = { promise: promise, reason: reason };\n if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);\n else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);\n};\n\nvar onUnhandled = function (state) {\n call(task, global, function () {\n var promise = state.facade;\n var value = state.value;\n var IS_UNHANDLED = isUnhandled(state);\n var result;\n if (IS_UNHANDLED) {\n result = perform(function () {\n if (IS_NODE) {\n process.emit('unhandledRejection', value, promise);\n } else dispatchEvent(UNHANDLED_REJECTION, promise, value);\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;\n if (result.error) throw result.value;\n }\n });\n};\n\nvar isUnhandled = function (state) {\n return state.rejection !== HANDLED && !state.parent;\n};\n\nvar onHandleUnhandled = function (state) {\n call(task, global, function () {\n var promise = state.facade;\n if (IS_NODE) {\n process.emit('rejectionHandled', promise);\n } else dispatchEvent(REJECTION_HANDLED, promise, state.value);\n });\n};\n\nvar bind = function (fn, state, unwrap) {\n return function (value) {\n fn(state, value, unwrap);\n };\n};\n\nvar internalReject = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n state.value = value;\n state.state = REJECTED;\n notify(state, true);\n};\n\nvar internalResolve = function (state, value, unwrap) {\n if (state.done) return;\n state.done = true;\n if (unwrap) state = unwrap;\n try {\n if (state.facade === value) throw TypeError(\"Promise can't be resolved itself\");\n var then = isThenable(value);\n if (then) {\n microtask(function () {\n var wrapper = { done: false };\n try {\n call(then, value,\n bind(internalResolve, wrapper, state),\n bind(internalReject, wrapper, state)\n );\n } catch (error) {\n internalReject(wrapper, error, state);\n }\n });\n } else {\n state.value = value;\n state.state = FULFILLED;\n notify(state, false);\n }\n } catch (error) {\n internalReject({ done: false }, error, state);\n }\n};\n\n// constructor polyfill\nif (FORCED_PROMISE_CONSTRUCTOR) {\n // 25.4.3.1 Promise(executor)\n PromiseConstructor = function Promise(executor) {\n anInstance(this, PromisePrototype);\n aCallable(executor);\n call(Internal, this);\n var state = getInternalPromiseState(this);\n try {\n executor(bind(internalResolve, state), bind(internalReject, state));\n } catch (error) {\n internalReject(state, error);\n }\n };\n\n PromisePrototype = PromiseConstructor.prototype;\n\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n Internal = function Promise(executor) {\n setInternalState(this, {\n type: PROMISE,\n done: false,\n notified: false,\n parent: false,\n reactions: new Queue(),\n rejection: false,\n state: PENDING,\n value: undefined\n });\n };\n\n // `Promise.prototype.then` method\n // https://tc39.es/ecma262/#sec-promise.prototype.then\n Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var state = getInternalPromiseState(this);\n var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));\n state.parent = true;\n reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;\n reaction.fail = isCallable(onRejected) && onRejected;\n reaction.domain = IS_NODE ? process.domain : undefined;\n if (state.state === PENDING) state.reactions.add(reaction);\n else microtask(function () {\n callReaction(reaction, state);\n });\n return reaction.promise;\n });\n\n OwnPromiseCapability = function () {\n var promise = new Internal();\n var state = getInternalPromiseState(promise);\n this.promise = promise;\n this.resolve = bind(internalResolve, state);\n this.reject = bind(internalReject, state);\n };\n\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === PromiseConstructor || C === PromiseWrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n\n if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {\n nativeThen = NativePromisePrototype.then;\n\n if (!NATIVE_PROMISE_SUBCLASSING) {\n // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs\n defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {\n var that = this;\n return new PromiseConstructor(function (resolve, reject) {\n call(nativeThen, that, resolve, reject);\n }).then(onFulfilled, onRejected);\n // https://github.com/zloirock/core-js/issues/640\n }, { unsafe: true });\n }\n\n // make `.constructor === Promise` work for native promise-based APIs\n try {\n delete NativePromisePrototype.constructor;\n } catch (error) { /* empty */ }\n\n // make `instanceof Promise` work for native promise-based APIs\n if (setPrototypeOf) {\n setPrototypeOf(NativePromisePrototype, PromisePrototype);\n }\n }\n}\n\n$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {\n Promise: PromiseConstructor\n});\n\nsetToStringTag(PromiseConstructor, PROMISE, false, true);\nsetSpecies(PROMISE);\n","'use strict';\n// TODO: Remove this module from `core-js@4` since it's split to modules listed below\nrequire('../modules/es.promise.constructor');\nrequire('../modules/es.promise.all');\nrequire('../modules/es.promise.catch');\nrequire('../modules/es.promise.race');\nrequire('../modules/es.promise.reject');\nrequire('../modules/es.promise.resolve');\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\nvar PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');\n\n// `Promise.race` method\n// https://tc39.es/ecma262/#sec-promise.race\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var reject = capability.reject;\n var result = perform(function () {\n var $promiseResolve = aCallable(C.resolve);\n iterate(iterable, function (promise) {\n call($promiseResolve, C, promise).then(capability.resolve, reject);\n });\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\n\n// `Promise.reject` method\n// https://tc39.es/ecma262/#sec-promise.reject\n$({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {\n reject: function reject(r) {\n var capability = newPromiseCapabilityModule.f(this);\n call(capability.reject, undefined, r);\n return capability.promise;\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar IS_PURE = require('../internals/is-pure');\nvar NativePromiseConstructor = require('../internals/promise-native-constructor');\nvar FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;\nvar promiseResolve = require('../internals/promise-resolve');\n\nvar PromiseConstructorWrapper = getBuiltIn('Promise');\nvar CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;\n\n// `Promise.resolve` method\n// https://tc39.es/ecma262/#sec-promise.resolve\n$({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {\n resolve: function resolve(x) {\n return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);\n }\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar exec = require('../internals/regexp-exec');\n\n// `RegExp.prototype.exec` method\n// https://tc39.es/ecma262/#sec-regexp.prototype.exec\n$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {\n exec: exec\n});\n","'use strict';\nvar charAt = require('../internals/string-multibyte').charAt;\nvar toString = require('../internals/to-string');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineIterator = require('../internals/iterator-define');\nvar createIterResultObject = require('../internals/create-iter-result-object');\n\nvar STRING_ITERATOR = 'String Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);\n\n// `String.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: toString(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next\n}, function next() {\n var state = getInternalState(this);\n var string = state.string;\n var index = state.index;\n var point;\n if (index >= string.length) return createIterResultObject(undefined, true);\n point = charAt(string, index);\n state.index += point.length;\n return createIterResultObject(point, false);\n});\n","'use strict';\nvar call = require('../internals/function-call');\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar getMethod = require('../internals/get-method');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar regExpExec = require('../internals/regexp-exec-abstract');\n\n// @@match logic\nfixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {\n return [\n // `String.prototype.match` method\n // https://tc39.es/ecma262/#sec-string.prototype.match\n function match(regexp) {\n var O = requireObjectCoercible(this);\n var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);\n return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));\n },\n // `RegExp.prototype[@@match]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@match\n function (string) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(nativeMatch, rx, S);\n\n if (res.done) return res.value;\n\n if (!rx.global) return regExpExec(rx, S);\n\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n var A = [];\n var n = 0;\n var result;\n while ((result = regExpExec(rx, S)) !== null) {\n var matchStr = toString(result[0]);\n A[n] = matchStr;\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n n++;\n }\n return n === 0 ? null : A;\n }\n ];\n});\n","'use strict';\nvar apply = require('../internals/function-apply');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar isRegExp = require('../internals/is-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar speciesConstructor = require('../internals/species-constructor');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar getMethod = require('../internals/get-method');\nvar arraySlice = require('../internals/array-slice-simple');\nvar callRegExpExec = require('../internals/regexp-exec-abstract');\nvar regexpExec = require('../internals/regexp-exec');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar fails = require('../internals/fails');\n\nvar UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;\nvar MAX_UINT32 = 0xFFFFFFFF;\nvar min = Math.min;\nvar $push = [].push;\nvar exec = uncurryThis(/./.exec);\nvar push = uncurryThis($push);\nvar stringSlice = uncurryThis(''.slice);\n\n// Chrome 51 has a buggy \"split\" implementation when RegExp#exec !== nativeExec\n// Weex JS has frozen built-in prototypes, so use try / catch wrapper\nvar SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n var re = /(?:)/;\n var originalExec = re.exec;\n re.exec = function () { return originalExec.apply(this, arguments); };\n var result = 'ab'.split(re);\n return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';\n});\n\n// @@split logic\nfixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {\n var internalSplit;\n if (\n 'abbc'.split(/(b)*/)[1] === 'c' ||\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n 'test'.split(/(?:)/, -1).length !== 4 ||\n 'ab'.split(/(?:ab)*/).length !== 2 ||\n '.'.split(/(.?)(.?)/).length !== 4 ||\n // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing\n '.'.split(/()()/).length > 1 ||\n ''.split(/.?/).length\n ) {\n // based on es5-shim implementation, need to rework it\n internalSplit = function (separator, limit) {\n var string = toString(requireObjectCoercible(this));\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (separator === undefined) return [string];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) {\n return call(nativeSplit, string, separator, lim);\n }\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var match, lastIndex, lastLength;\n while (match = call(regexpExec, separatorCopy, string)) {\n lastIndex = separatorCopy.lastIndex;\n if (lastIndex > lastLastIndex) {\n push(output, stringSlice(string, lastLastIndex, match.index));\n if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1));\n lastLength = match[0].length;\n lastLastIndex = lastIndex;\n if (output.length >= lim) break;\n }\n if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop\n }\n if (lastLastIndex === string.length) {\n if (lastLength || !exec(separatorCopy, '')) push(output, '');\n } else push(output, stringSlice(string, lastLastIndex));\n return output.length > lim ? arraySlice(output, 0, lim) : output;\n };\n // Chakra, V8\n } else if ('0'.split(undefined, 0).length) {\n internalSplit = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);\n };\n } else internalSplit = nativeSplit;\n\n return [\n // `String.prototype.split` method\n // https://tc39.es/ecma262/#sec-string.prototype.split\n function split(separator, limit) {\n var O = requireObjectCoercible(this);\n var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT);\n return splitter\n ? call(splitter, separator, O, limit)\n : call(internalSplit, toString(O), separator, limit);\n },\n // `RegExp.prototype[@@split]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@split\n //\n // NOTE: This cannot be properly polyfilled in engines that don't support\n // the 'y' flag.\n function (string, limit) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);\n\n if (res.done) return res.value;\n\n var C = speciesConstructor(rx, RegExp);\n\n var unicodeMatching = rx.unicode;\n var flags = (rx.ignoreCase ? 'i' : '') +\n (rx.multiline ? 'm' : '') +\n (rx.unicode ? 'u' : '') +\n (UNSUPPORTED_Y ? 'g' : 'y');\n\n // ^(? + rx + ) is needed, in combination with some S slicing, to\n // simulate the 'y' flag.\n var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];\n var p = 0;\n var q = 0;\n var A = [];\n while (q < S.length) {\n splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;\n var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);\n var e;\n if (\n z === null ||\n (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p\n ) {\n q = advanceStringIndex(S, q, unicodeMatching);\n } else {\n push(A, stringSlice(S, p, q));\n if (A.length === lim) return A;\n for (var i = 1; i <= z.length - 1; i++) {\n push(A, z[i]);\n if (A.length === lim) return A;\n }\n q = p = e;\n }\n }\n push(A, stringSlice(S, p));\n return A;\n }\n ];\n}, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.asyncIterator` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.asynciterator\ndefineWellKnownSymbol('asyncIterator');\n","'use strict';\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar IS_PURE = require('../internals/is-pure');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar fails = require('../internals/fails');\nvar hasOwn = require('../internals/has-own-property');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar anObject = require('../internals/an-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar $toString = require('../internals/to-string');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar nativeObjectCreate = require('../internals/object-create');\nvar objectKeys = require('../internals/object-keys');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertyNamesExternal = require('../internals/object-get-own-property-names-external');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\nvar definePropertiesModule = require('../internals/object-define-properties');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar shared = require('../internals/shared');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar uid = require('../internals/uid');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\nvar defineSymbolToPrimitive = require('../internals/symbol-define-to-primitive');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar InternalStateModule = require('../internals/internal-state');\nvar $forEach = require('../internals/array-iteration').forEach;\n\nvar HIDDEN = sharedKey('hidden');\nvar SYMBOL = 'Symbol';\nvar PROTOTYPE = 'prototype';\n\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(SYMBOL);\n\nvar ObjectPrototype = Object[PROTOTYPE];\nvar $Symbol = global.Symbol;\nvar SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];\nvar TypeError = global.TypeError;\nvar QObject = global.QObject;\nvar nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\nvar nativeDefineProperty = definePropertyModule.f;\nvar nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;\nvar nativePropertyIsEnumerable = propertyIsEnumerableModule.f;\nvar push = uncurryThis([].push);\n\nvar AllSymbols = shared('symbols');\nvar ObjectPrototypeSymbols = shared('op-symbols');\nvar WellKnownSymbolsStore = shared('wks');\n\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDescriptor = DESCRIPTORS && fails(function () {\n return nativeObjectCreate(nativeDefineProperty({}, 'a', {\n get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }\n })).a !== 7;\n}) ? function (O, P, Attributes) {\n var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);\n if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];\n nativeDefineProperty(O, P, Attributes);\n if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {\n nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);\n }\n} : nativeDefineProperty;\n\nvar wrap = function (tag, description) {\n var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);\n setInternalState(symbol, {\n type: SYMBOL,\n tag: tag,\n description: description\n });\n if (!DESCRIPTORS) symbol.description = description;\n return symbol;\n};\n\nvar $defineProperty = function defineProperty(O, P, Attributes) {\n if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);\n anObject(O);\n var key = toPropertyKey(P);\n anObject(Attributes);\n if (hasOwn(AllSymbols, key)) {\n if (!Attributes.enumerable) {\n if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));\n O[HIDDEN][key] = true;\n } else {\n if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;\n Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });\n } return setSymbolDescriptor(O, key, Attributes);\n } return nativeDefineProperty(O, key, Attributes);\n};\n\nvar $defineProperties = function defineProperties(O, Properties) {\n anObject(O);\n var properties = toIndexedObject(Properties);\n var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));\n $forEach(keys, function (key) {\n if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);\n });\n return O;\n};\n\nvar $create = function create(O, Properties) {\n return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);\n};\n\nvar $propertyIsEnumerable = function propertyIsEnumerable(V) {\n var P = toPropertyKey(V);\n var enumerable = call(nativePropertyIsEnumerable, this, P);\n if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;\n return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]\n ? enumerable : true;\n};\n\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {\n var it = toIndexedObject(O);\n var key = toPropertyKey(P);\n if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;\n var descriptor = nativeGetOwnPropertyDescriptor(it, key);\n if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {\n descriptor.enumerable = true;\n }\n return descriptor;\n};\n\nvar $getOwnPropertyNames = function getOwnPropertyNames(O) {\n var names = nativeGetOwnPropertyNames(toIndexedObject(O));\n var result = [];\n $forEach(names, function (key) {\n if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);\n });\n return result;\n};\n\nvar $getOwnPropertySymbols = function (O) {\n var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;\n var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));\n var result = [];\n $forEach(names, function (key) {\n if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {\n push(result, AllSymbols[key]);\n }\n });\n return result;\n};\n\n// `Symbol` constructor\n// https://tc39.es/ecma262/#sec-symbol-constructor\nif (!NATIVE_SYMBOL) {\n $Symbol = function Symbol() {\n if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor');\n var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);\n var tag = uid(description);\n var setter = function (value) {\n if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);\n if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));\n };\n if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });\n return wrap(tag, description);\n };\n\n SymbolPrototype = $Symbol[PROTOTYPE];\n\n defineBuiltIn(SymbolPrototype, 'toString', function toString() {\n return getInternalState(this).tag;\n });\n\n defineBuiltIn($Symbol, 'withoutSetter', function (description) {\n return wrap(uid(description), description);\n });\n\n propertyIsEnumerableModule.f = $propertyIsEnumerable;\n definePropertyModule.f = $defineProperty;\n definePropertiesModule.f = $defineProperties;\n getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;\n getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;\n getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;\n\n wrappedWellKnownSymbolModule.f = function (name) {\n return wrap(wellKnownSymbol(name), name);\n };\n\n if (DESCRIPTORS) {\n // https://github.com/tc39/proposal-Symbol-description\n defineBuiltInAccessor(SymbolPrototype, 'description', {\n configurable: true,\n get: function description() {\n return getInternalState(this).description;\n }\n });\n if (!IS_PURE) {\n defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });\n }\n }\n}\n\n$({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {\n Symbol: $Symbol\n});\n\n$forEach(objectKeys(WellKnownSymbolsStore), function (name) {\n defineWellKnownSymbol(name);\n});\n\n$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {\n useSetter: function () { USE_SETTER = true; },\n useSimple: function () { USE_SETTER = false; }\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {\n // `Object.create` method\n // https://tc39.es/ecma262/#sec-object.create\n create: $create,\n // `Object.defineProperty` method\n // https://tc39.es/ecma262/#sec-object.defineproperty\n defineProperty: $defineProperty,\n // `Object.defineProperties` method\n // https://tc39.es/ecma262/#sec-object.defineproperties\n defineProperties: $defineProperties,\n // `Object.getOwnPropertyDescriptor` method\n // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {\n // `Object.getOwnPropertyNames` method\n // https://tc39.es/ecma262/#sec-object.getownpropertynames\n getOwnPropertyNames: $getOwnPropertyNames\n});\n\n// `Symbol.prototype[@@toPrimitive]` method\n// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive\ndefineSymbolToPrimitive();\n\n// `Symbol.prototype[@@toStringTag]` property\n// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag\nsetToStringTag($Symbol, SYMBOL);\n\nhiddenKeys[HIDDEN] = true;\n","// `Symbol.prototype.description` getter\n// https://tc39.es/ecma262/#sec-symbol.prototype.description\n'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar toString = require('../internals/to-string');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\n\nvar NativeSymbol = global.Symbol;\nvar SymbolPrototype = NativeSymbol && NativeSymbol.prototype;\n\nif (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||\n // Safari 12 bug\n NativeSymbol().description !== undefined\n)) {\n var EmptyStringDescriptionStore = {};\n // wrap Symbol constructor for correct work with undefined description\n var SymbolWrapper = function Symbol() {\n var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);\n var result = isPrototypeOf(SymbolPrototype, this)\n ? new NativeSymbol(description)\n // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'\n : description === undefined ? NativeSymbol() : NativeSymbol(description);\n if (description === '') EmptyStringDescriptionStore[result] = true;\n return result;\n };\n\n copyConstructorProperties(SymbolWrapper, NativeSymbol);\n SymbolWrapper.prototype = SymbolPrototype;\n SymbolPrototype.constructor = SymbolWrapper;\n\n var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)';\n var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf);\n var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString);\n var regexp = /^Symbol\\((.*)\\)[^)]+$/;\n var replace = uncurryThis(''.replace);\n var stringSlice = uncurryThis(''.slice);\n\n defineBuiltInAccessor(SymbolPrototype, 'description', {\n configurable: true,\n get: function description() {\n var symbol = thisSymbolValue(this);\n if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';\n var string = symbolDescriptiveString(symbol);\n var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');\n return desc === '' ? undefined : desc;\n }\n });\n\n $({ global: true, constructor: true, forced: true }, {\n Symbol: SymbolWrapper\n });\n}\n","'use strict';\nvar $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar hasOwn = require('../internals/has-own-property');\nvar toString = require('../internals/to-string');\nvar shared = require('../internals/shared');\nvar NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection');\n\nvar StringToSymbolRegistry = shared('string-to-symbol-registry');\nvar SymbolToStringRegistry = shared('symbol-to-string-registry');\n\n// `Symbol.for` method\n// https://tc39.es/ecma262/#sec-symbol.for\n$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {\n 'for': function (key) {\n var string = toString(key);\n if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];\n var symbol = getBuiltIn('Symbol')(string);\n StringToSymbolRegistry[string] = symbol;\n SymbolToStringRegistry[symbol] = string;\n return symbol;\n }\n});\n","'use strict';\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\n\n// `Symbol.iterator` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.iterator\ndefineWellKnownSymbol('iterator');\n","'use strict';\n// TODO: Remove this module from `core-js@4` since it's split to modules listed below\nrequire('../modules/es.symbol.constructor');\nrequire('../modules/es.symbol.for');\nrequire('../modules/es.symbol.key-for');\nrequire('../modules/es.json.stringify');\nrequire('../modules/es.object.get-own-property-symbols');\n","'use strict';\nvar $ = require('../internals/export');\nvar hasOwn = require('../internals/has-own-property');\nvar isSymbol = require('../internals/is-symbol');\nvar tryToString = require('../internals/try-to-string');\nvar shared = require('../internals/shared');\nvar NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection');\n\nvar SymbolToStringRegistry = shared('symbol-to-string-registry');\n\n// `Symbol.keyFor` method\n// https://tc39.es/ecma262/#sec-symbol.keyfor\n$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol');\n if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];\n }\n});\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar defineWellKnownSymbol = require('../internals/well-known-symbol-define');\nvar setToStringTag = require('../internals/set-to-string-tag');\n\n// `Symbol.toStringTag` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.tostringtag\ndefineWellKnownSymbol('toStringTag');\n\n// `Symbol.prototype[@@toStringTag]` property\n// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag\nsetToStringTag(getBuiltIn('Symbol'), 'Symbol');\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $ArrayCopyWithin = require('../internals/array-copy-within');\n\nvar u$ArrayCopyWithin = uncurryThis($ArrayCopyWithin);\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.copyWithin` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin\nexportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) {\n return u$ArrayCopyWithin(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $every = require('../internals/array-iteration').every;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.every` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.every\nexportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) {\n return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $fill = require('../internals/array-fill');\nvar toBigInt = require('../internals/to-big-int');\nvar classof = require('../internals/classof');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar slice = uncurryThis(''.slice);\n\n// V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18\nvar CONVERSION_BUG = fails(function () {\n var count = 0;\n // eslint-disable-next-line es/no-typed-arrays -- safe\n new Int8Array(2).fill({ valueOf: function () { return count++; } });\n return count !== 1;\n});\n\n// `%TypedArray%.prototype.fill` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill\nexportTypedArrayMethod('fill', function fill(value /* , start, end */) {\n var length = arguments.length;\n aTypedArray(this);\n var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value;\n return call($fill, this, actualValue, length > 1 ? arguments[1] : undefined, length > 2 ? arguments[2] : undefined);\n}, CONVERSION_BUG);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $filter = require('../internals/array-iteration').filter;\nvar fromSpeciesAndList = require('../internals/typed-array-from-species-and-list');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.filter` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter\nexportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) {\n var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return fromSpeciesAndList(this, list);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $findIndex = require('../internals/array-iteration').findIndex;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.findIndex` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex\nexportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) {\n return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $find = require('../internals/array-iteration').find;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.find` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.find\nexportTypedArrayMethod('find', function find(predicate /* , thisArg */) {\n return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $forEach = require('../internals/array-iteration').forEach;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.forEach` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach\nexportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) {\n $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $includes = require('../internals/array-includes').includes;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.includes` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes\nexportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) {\n return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $indexOf = require('../internals/array-includes').indexOf;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.indexOf` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof\nexportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) {\n return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar global = require('../internals/global');\nvar fails = require('../internals/fails');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar ArrayIterators = require('../modules/es.array.iterator');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar Uint8Array = global.Uint8Array;\nvar arrayValues = uncurryThis(ArrayIterators.values);\nvar arrayKeys = uncurryThis(ArrayIterators.keys);\nvar arrayEntries = uncurryThis(ArrayIterators.entries);\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar TypedArrayPrototype = Uint8Array && Uint8Array.prototype;\n\nvar GENERIC = !fails(function () {\n TypedArrayPrototype[ITERATOR].call([1]);\n});\n\nvar ITERATOR_IS_VALUES = !!TypedArrayPrototype\n && TypedArrayPrototype.values\n && TypedArrayPrototype[ITERATOR] === TypedArrayPrototype.values\n && TypedArrayPrototype.values.name === 'values';\n\nvar typedArrayValues = function values() {\n return arrayValues(aTypedArray(this));\n};\n\n// `%TypedArray%.prototype.entries` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries\nexportTypedArrayMethod('entries', function entries() {\n return arrayEntries(aTypedArray(this));\n}, GENERIC);\n// `%TypedArray%.prototype.keys` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys\nexportTypedArrayMethod('keys', function keys() {\n return arrayKeys(aTypedArray(this));\n}, GENERIC);\n// `%TypedArray%.prototype.values` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.values\nexportTypedArrayMethod('values', typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' });\n// `%TypedArray%.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator\nexportTypedArrayMethod(ITERATOR, typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' });\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $join = uncurryThis([].join);\n\n// `%TypedArray%.prototype.join` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.join\nexportTypedArrayMethod('join', function join(separator) {\n return $join(aTypedArray(this), separator);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar apply = require('../internals/function-apply');\nvar $lastIndexOf = require('../internals/array-last-index-of');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.lastIndexOf` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof\nexportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) {\n var length = arguments.length;\n return apply($lastIndexOf, aTypedArray(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $map = require('../internals/array-iteration').map;\nvar typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.map` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.map\nexportTypedArrayMethod('map', function map(mapfn /* , thisArg */) {\n return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) {\n return new (typedArraySpeciesConstructor(O))(length);\n });\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $reduceRight = require('../internals/array-reduce').right;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.reduceRight` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright\nexportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) {\n var length = arguments.length;\n return $reduceRight(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $reduce = require('../internals/array-reduce').left;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.reduce` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce\nexportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) {\n var length = arguments.length;\n return $reduce(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar floor = Math.floor;\n\n// `%TypedArray%.prototype.reverse` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse\nexportTypedArrayMethod('reverse', function reverse() {\n var that = this;\n var length = aTypedArray(that).length;\n var middle = floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n});\n","'use strict';\nvar global = require('../internals/global');\nvar call = require('../internals/function-call');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar toOffset = require('../internals/to-offset');\nvar toIndexedObject = require('../internals/to-object');\nvar fails = require('../internals/fails');\n\nvar RangeError = global.RangeError;\nvar Int8Array = global.Int8Array;\nvar Int8ArrayPrototype = Int8Array && Int8Array.prototype;\nvar $set = Int8ArrayPrototype && Int8ArrayPrototype.set;\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\nvar WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS = !fails(function () {\n // eslint-disable-next-line es/no-typed-arrays -- required for testing\n var array = new Uint8ClampedArray(2);\n call($set, array, { length: 1, 0: 3 }, 1);\n return array[1] !== 3;\n});\n\n// https://bugs.chromium.org/p/v8/issues/detail?id=11294 and other\nvar TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function () {\n var array = new Int8Array(2);\n array.set(1);\n array.set('2', 1);\n return array[0] !== 0 || array[1] !== 2;\n});\n\n// `%TypedArray%.prototype.set` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set\nexportTypedArrayMethod('set', function set(arrayLike /* , offset */) {\n aTypedArray(this);\n var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);\n var src = toIndexedObject(arrayLike);\n if (WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS) return call($set, this, src, offset);\n var length = this.length;\n var len = lengthOfArrayLike(src);\n var index = 0;\n if (len + offset > length) throw RangeError('Wrong length');\n while (index < len) this[offset + index] = src[index++];\n}, !WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');\nvar fails = require('../internals/fails');\nvar arraySlice = require('../internals/array-slice');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\nvar FORCED = fails(function () {\n // eslint-disable-next-line es/no-typed-arrays -- required for testing\n new Int8Array(1).slice();\n});\n\n// `%TypedArray%.prototype.slice` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice\nexportTypedArrayMethod('slice', function slice(start, end) {\n var list = arraySlice(aTypedArray(this), start, end);\n var C = typedArraySpeciesConstructor(this);\n var index = 0;\n var length = list.length;\n var result = new C(length);\n while (length > index) result[index] = list[index++];\n return result;\n}, FORCED);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar $some = require('../internals/array-iteration').some;\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.some` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.some\nexportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) {\n return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n});\n","'use strict';\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this-clause');\nvar fails = require('../internals/fails');\nvar aCallable = require('../internals/a-callable');\nvar internalSort = require('../internals/array-sort');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar FF = require('../internals/engine-ff-version');\nvar IE_OR_EDGE = require('../internals/engine-is-ie-or-edge');\nvar V8 = require('../internals/engine-v8-version');\nvar WEBKIT = require('../internals/engine-webkit-version');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar Uint16Array = global.Uint16Array;\nvar nativeSort = Uint16Array && uncurryThis(Uint16Array.prototype.sort);\n\n// WebKit\nvar ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !(fails(function () {\n nativeSort(new Uint16Array(2), null);\n}) && fails(function () {\n nativeSort(new Uint16Array(2), {});\n}));\n\nvar STABLE_SORT = !!nativeSort && !fails(function () {\n // feature detection can be too slow, so check engines versions\n if (V8) return V8 < 74;\n if (FF) return FF < 67;\n if (IE_OR_EDGE) return true;\n if (WEBKIT) return WEBKIT < 602;\n\n var array = new Uint16Array(516);\n var expected = Array(516);\n var index, mod;\n\n for (index = 0; index < 516; index++) {\n mod = index % 4;\n array[index] = 515 - index;\n expected[index] = index - 2 * mod + 3;\n }\n\n nativeSort(array, function (a, b) {\n return (a / 4 | 0) - (b / 4 | 0);\n });\n\n for (index = 0; index < 516; index++) {\n if (array[index] !== expected[index]) return true;\n }\n});\n\nvar getSortCompare = function (comparefn) {\n return function (x, y) {\n if (comparefn !== undefined) return +comparefn(x, y) || 0;\n // eslint-disable-next-line no-self-compare -- NaN check\n if (y !== y) return -1;\n // eslint-disable-next-line no-self-compare -- NaN check\n if (x !== x) return 1;\n if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1;\n return x > y;\n };\n};\n\n// `%TypedArray%.prototype.sort` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort\nexportTypedArrayMethod('sort', function sort(comparefn) {\n if (comparefn !== undefined) aCallable(comparefn);\n if (STABLE_SORT) return nativeSort(this, comparefn);\n\n return internalSort(aTypedArray(this), getSortCompare(comparefn));\n}, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS);\n","'use strict';\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar toLength = require('../internals/to-length');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor');\n\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\n\n// `%TypedArray%.prototype.subarray` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray\nexportTypedArrayMethod('subarray', function subarray(begin, end) {\n var O = aTypedArray(this);\n var length = O.length;\n var beginIndex = toAbsoluteIndex(begin, length);\n var C = typedArraySpeciesConstructor(O);\n return new C(\n O.buffer,\n O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex)\n );\n});\n","'use strict';\nvar global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar ArrayBufferViewCore = require('../internals/array-buffer-view-core');\nvar fails = require('../internals/fails');\nvar arraySlice = require('../internals/array-slice');\n\nvar Int8Array = global.Int8Array;\nvar aTypedArray = ArrayBufferViewCore.aTypedArray;\nvar exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;\nvar $toLocaleString = [].toLocaleString;\n\n// iOS Safari 6.x fails here\nvar TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {\n $toLocaleString.call(new Int8Array(1));\n});\n\nvar FORCED = fails(function () {\n return [1, 2].toLocaleString() !== new Int8Array([1, 2]).toLocaleString();\n}) || !fails(function () {\n Int8Array.prototype.toLocaleString.call([1, 2]);\n});\n\n// `%TypedArray%.prototype.toLocaleString` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring\nexportTypedArrayMethod('toLocaleString', function toLocaleString() {\n return apply(\n $toLocaleString,\n TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this),\n arraySlice(arguments)\n );\n}, FORCED);\n","'use strict';\nvar exportTypedArrayMethod = require('../internals/array-buffer-view-core').exportTypedArrayMethod;\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar Uint8Array = global.Uint8Array;\nvar Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {};\nvar arrayToString = [].toString;\nvar join = uncurryThis([].join);\n\nif (fails(function () { arrayToString.call({}); })) {\n arrayToString = function toString() {\n return join(this);\n };\n}\n\nvar IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString !== arrayToString;\n\n// `%TypedArray%.prototype.toString` method\n// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring\nexportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD);\n","'use strict';\nvar createTypedArrayConstructor = require('../internals/typed-array-constructor');\n\n// `Uint8Array` constructor\n// https://tc39.es/ecma262/#sec-typedarray-objects\ncreateTypedArrayConstructor('Uint8', function (init) {\n return function Uint8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","'use strict';\nvar global = require('../internals/global');\nvar DOMIterables = require('../internals/dom-iterables');\nvar DOMTokenListPrototype = require('../internals/dom-token-list-prototype');\nvar forEach = require('../internals/array-for-each');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\nvar handlePrototype = function (CollectionPrototype) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {\n createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);\n } catch (error) {\n CollectionPrototype.forEach = forEach;\n }\n};\n\nfor (var COLLECTION_NAME in DOMIterables) {\n if (DOMIterables[COLLECTION_NAME]) {\n handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype);\n }\n}\n\nhandlePrototype(DOMTokenListPrototype);\n","'use strict';\nvar global = require('../internals/global');\nvar DOMIterables = require('../internals/dom-iterables');\nvar DOMTokenListPrototype = require('../internals/dom-token-list-prototype');\nvar ArrayIteratorMethods = require('../modules/es.array.iterator');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar ArrayValues = ArrayIteratorMethods.values;\n\nvar handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {\n if (CollectionPrototype) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype[ITERATOR] !== ArrayValues) try {\n createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);\n } catch (error) {\n CollectionPrototype[ITERATOR] = ArrayValues;\n }\n if (!CollectionPrototype[TO_STRING_TAG]) {\n createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);\n }\n if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {\n // some Chrome versions have non-configurable methods on DOMTokenList\n if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {\n createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);\n } catch (error) {\n CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];\n }\n }\n }\n};\n\nfor (var COLLECTION_NAME in DOMIterables) {\n handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME);\n}\n\nhandlePrototype(DOMTokenListPrototype, 'DOMTokenList');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setLastICMessageTime = exports.lastICMessageTime = exports.delay = exports.setBanned = exports.banned = exports.setExtraFeatures = exports.extrafeatures = exports.setSelectedShout = exports.selectedShout = exports.setSelectedMenu = exports.selectedMenu = exports.setOldLoading = exports.oldLoading = exports.UPDATE_INTERVAL = exports.setClient = exports.client = exports.setCHATBOX = exports.CHATBOX = void 0;\n/*\n * Glorious webAO\n * made by sD, refactored by oldmud0 and Qubrick\n * credits to aleks for original idea and source\n */\nvar isLowMemory_1 = require(\"./client/isLowMemory\");\nvar fingerprintjs_1 = require(\"@fingerprintjs/fingerprintjs\");\nvar index_1 = require(\"./client/sender/index\");\nvar queryParser_1 = require(\"./utils/queryParser\");\nvar getResources_js_1 = require(\"./utils/getResources.js\");\nvar viewport_1 = require(\"./viewport/viewport\");\nvar events_1 = require(\"events\");\nvar onReplayGo_1 = require(\"./dom/onReplayGo\");\nvar packetHandler_1 = require(\"./packets/packetHandler\");\nvar loadResources_1 = require(\"./client/loadResources\");\nvar aoHost_1 = require(\"./client/aoHost\");\nvar fetchLists_1 = require(\"./client/fetchLists\");\nvar version = process.env.npm_package_version;\nvar _a = (0, queryParser_1.default)(), serverIP = _a.ip, mode = _a.mode, theme = _a.theme;\nvar THEME = theme || \"default\";\nvar setCHATBOX = function (val) {\n exports.CHATBOX = val;\n};\nexports.setCHATBOX = setCHATBOX;\nvar setClient = function (val) {\n exports.client = val;\n};\nexports.setClient = setClient;\nexports.UPDATE_INTERVAL = 60;\n/**\n * Toggles AO1-style loading using paginated music packets for mobile platforms.\n * The old loading uses more smaller packets instead of a single big one,\n * which caused problems on low-memory devices in the past.\n */\nexports.oldLoading = false;\nvar setOldLoading = function (val) {\n console.warn(\"old loading set to \" + val);\n exports.oldLoading = val;\n};\nexports.setOldLoading = setOldLoading;\n// presettings\nexports.selectedMenu = 1;\nvar setSelectedMenu = function (val) {\n exports.selectedMenu = val;\n};\nexports.setSelectedMenu = setSelectedMenu;\nexports.selectedShout = 0;\nvar setSelectedShout = function (val) {\n exports.selectedShout = val;\n};\nexports.setSelectedShout = setSelectedShout;\nexports.extrafeatures = [];\nvar setExtraFeatures = function (val) {\n exports.extrafeatures = val;\n};\nexports.setExtraFeatures = setExtraFeatures;\nexports.banned = false;\nvar setBanned = function (val) {\n exports.banned = val;\n};\nexports.setBanned = setBanned;\nvar hdid;\nvar fpPromise = fingerprintjs_1.default.load();\nfpPromise\n .then(function (fp) { return fp.get(); })\n .then(function (result) {\n hdid = result.visitorId;\n exports.client = new Client(serverIP);\n exports.client.connect();\n (0, isLowMemory_1.isLowMemory)();\n (0, loadResources_1.loadResources)();\n});\nvar delay = function (ms) { return new Promise(function (res) { return setTimeout(res, ms); }); };\nexports.delay = delay;\nexports.lastICMessageTime = new Date(0);\nvar setLastICMessageTime = function (val) {\n exports.lastICMessageTime = val;\n};\nexports.setLastICMessageTime = setLastICMessageTime;\nvar Client = /** @class */ (function (_super) {\n __extends(Client, _super);\n function Client(address) {\n var _this = _super.call(this) || this;\n _this.connect = function () {\n _this.on(\"open\", _this.onOpen.bind(_this));\n _this.on(\"close\", _this.onClose.bind(_this));\n _this.on(\"message\", _this.onMessage.bind(_this));\n _this.on(\"error\", _this.onError.bind(_this));\n if (mode !== \"replay\") {\n _this.serv = new WebSocket(\"ws://\".concat(address));\n // Assign the websocket events\n _this.serv.addEventListener(\"open\", _this.emit.bind(_this, \"open\"));\n _this.serv.addEventListener(\"close\", _this.emit.bind(_this, \"close\"));\n _this.serv.addEventListener(\"message\", _this.emit.bind(_this, \"message\"));\n _this.serv.addEventListener(\"error\", _this.emit.bind(_this, \"error\"));\n }\n else {\n _this.joinServer();\n }\n };\n _this.hp = [0, 0];\n _this.playerID = 1;\n _this.charID = -1;\n _this.char_list_length = 0;\n _this.evidence_list_length = 0;\n _this.music_list_length = 0;\n _this.testimonyID = 0;\n _this.chars = [];\n _this.emotes = [];\n _this.evidences = [];\n _this.areas = [];\n _this.musics = [];\n _this.musics_time = false;\n _this.callwords = [];\n _this.manifest = [];\n _this.resources = (0, getResources_js_1.default)(aoHost_1.AO_HOST, THEME);\n _this.selectedEmote = -1;\n _this.selectedEvidence = 0;\n _this.checkUpdater = null;\n _this.sender = index_1.sender;\n _this.viewport = (0, viewport_1.default)();\n _this._lastTimeICReceived = new Date(0);\n _this.partial_packet = false;\n _this.temp_packet = \"\";\n loadResources_1.loadResources;\n isLowMemory_1.isLowMemory;\n return _this;\n }\n Object.defineProperty(Client.prototype, \"character\", {\n /**\n * Gets the current player's character.\n */\n get: function () {\n return this.chars[this.charID];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Client.prototype, \"emote\", {\n /**\n * Gets the player's currently selected emote.\n */\n get: function () {\n return this.emotes[this.selectedEmote];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Client.prototype, \"evidence\", {\n /**\n * Gets the current evidence ID unless the player doesn't want to present any evidence\n */\n get: function () {\n return document.getElementById(\"button_present\").classList.contains(\"dark\")\n ? this.selectedEvidence\n : 0;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Hook for sending messages to the client\n * @param {string} message the message to send\n */\n Client.prototype.handleSelf = function (message) {\n var _this = this;\n var message_event = new MessageEvent(\"websocket\", { data: message });\n setTimeout(function () { return _this.onMessage(message_event); }, 1);\n };\n /**\n * Begins the handshake process by sending an identifier\n * to the server.\n */\n Client.prototype.joinServer = function () {\n var _this = this;\n this.sender.sendServer(\"HI#\".concat(hdid, \"#%\"));\n if (mode !== \"replay\") {\n this.checkUpdater = setInterval(function () { return _this.sender.sendCheck(); }, 5000);\n }\n };\n /**\n * Triggered when a connection is established to the server.\n */\n Client.prototype.onOpen = function (_e) {\n exports.client.joinServer();\n };\n /**\n * Triggered when the connection to the server closes.\n * @param {CloseEvent} e\n */\n Client.prototype.onClose = function (e) {\n console.error(\"The connection was closed: \".concat(e.reason, \" (\").concat(e.code, \")\"));\n if (exports.extrafeatures.length == 0 && exports.banned === false) {\n document.getElementById(\"client_errortext\").textContent =\n \"Could not connect to the server\";\n }\n document.getElementById(\"client_waiting\").style.display = \"block\";\n document.getElementById(\"client_error\").style.display = \"flex\";\n document.getElementById(\"client_loading\").style.display = \"none\";\n document.getElementById(\"error_id\").textContent = String(e.code);\n this.cleanup();\n };\n /**\n * Triggered when a packet is received from the server.\n * @param {MessageEvent} e\n */\n Client.prototype.onMessage = function (e) {\n var msg = e.data;\n console.debug(\"S: \".concat(msg));\n this.handle_server_packet(msg);\n };\n /**\n * Decode the packet\n * @param {MessageEvent} e\n */\n Client.prototype.handle_server_packet = function (p_data) {\n var e_1, _a;\n var in_data = p_data;\n if (!p_data.endsWith(\"%\")) {\n this.partial_packet = true;\n this.temp_packet = this.temp_packet + in_data;\n console.log(\"Partial packet\");\n return;\n }\n else {\n if (this.partial_packet) {\n in_data = this.temp_packet + in_data;\n this.temp_packet = \"\";\n this.partial_packet = false;\n }\n }\n var packet_list = in_data.split(\"%\");\n try {\n for (var packet_list_1 = __values(packet_list), packet_list_1_1 = packet_list_1.next(); !packet_list_1_1.done; packet_list_1_1 = packet_list_1.next()) {\n var packet = packet_list_1_1.value;\n var f_contents = void 0;\n // Packet should *always* end with #\n if (packet.endsWith(\"#\")) {\n f_contents = packet.slice(0, -1).split(\"#\");\n }\n // But, if it somehow doesn't, we should still be able to handle it\n else {\n f_contents = packet.split(\"#\");\n }\n // Empty packets are suspicious!\n if (f_contents.length == 0) {\n console.warn(\"WARNING: Empty packet received from server, skipping...\");\n continue;\n }\n // Take the first arg as the command\n var command = f_contents[0];\n if (command !== \"\") {\n // The rest is contents of the packet\n packetHandler_1.packetHandler.has(command)\n ? packetHandler_1.packetHandler.get(command)(f_contents)\n : console.warn(\"Invalid packet header \".concat(command));\n }\n ;\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (packet_list_1_1 && !packet_list_1_1.done && (_a = packet_list_1.return)) _a.call(packet_list_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n /**\n * Triggered when an network error occurs.\n * @param {ErrorEvent} e\n */\n Client.prototype.onError = function (e) {\n console.error(\"A network error occurred\");\n document.getElementById(\"client_error\").style.display = \"flex\";\n this.cleanup();\n };\n /**\n * Stop sending keepalives to the server.\n */\n Client.prototype.cleanup = function () {\n clearInterval(this.checkUpdater);\n this.serv.close();\n };\n /**\n * Parse the lines in the OOC and play them\n * @param {*} args packet arguments\n */\n Client.prototype.handleReplay = function () {\n var ooclog = document.getElementById(\"client_ooclog\");\n var rawLog = false;\n var rtime = Number(document.getElementById(\"client_replaytimer\").value);\n var clines = ooclog.value.split(/\\r?\\n/);\n if (clines[0]) {\n var currentLine = String(clines[0]);\n this.handleSelf(currentLine);\n ooclog.value = clines.slice(1).join(\"\\r\\n\");\n if (currentLine.substr(0, 4) === \"wait\" && rawLog === false) {\n rtime = Number(currentLine.split(\"#\")[1]);\n }\n else if (currentLine.substr(0, 2) !== \"MS\") {\n rtime = 0;\n }\n setTimeout(function () { return (0, onReplayGo_1.onReplayGo)(null); }, rtime);\n }\n };\n Client.prototype.resetMusicList = function () {\n this.musics = [];\n document.getElementById(\"client_musiclist\").innerHTML = \"\";\n };\n Client.prototype.resetAreaList = function () {\n this.areas = [];\n document.getElementById(\"areas\").innerHTML = \"\";\n (0, fetchLists_1.fetchBackgroundList)();\n (0, fetchLists_1.fetchEvidenceList)();\n (0, fetchLists_1.fetchCharacterList)();\n };\n return Client;\n}(events_1.EventEmitter));\nexports.default = Client;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addTrack = void 0;\nvar client_1 = require(\"../client\");\nvar encoding_1 = require(\"../encoding\");\nvar paths_1 = require(\"../utils/paths\");\nvar addTrack = function (trackname) {\n var newentry = document.createElement(\"OPTION\");\n var songName = (0, paths_1.getFilenameFromPath)(trackname);\n newentry.text = (0, encoding_1.unescapeChat)(songName);\n newentry.value = trackname;\n (document.getElementById(\"client_musiclist\")).options.add(newentry);\n client_1.client.musics.push(trackname);\n};\nexports.addTrack = addTrack;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setAOhost = exports.AO_HOST = void 0;\nvar queryParser_1 = require(\"../utils/queryParser\");\nvar asset = (0, queryParser_1.default)().asset;\nvar DEFAULT_HOST = 'http://attorneyoffline.de/base/';\nexports.AO_HOST = asset || DEFAULT_HOST;\nvar setAOhost = function (val) {\n exports.AO_HOST = val;\n};\nexports.setAOhost = setAOhost;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.appendICLog = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Appends a message to the in-character chat log.\n * @param {string} msg the string to be added\n * @param {string} name the name of the sender\n */\nfunction appendICLog(msg, showname, nameplate, time) {\n if (showname === void 0) { showname = \"\"; }\n if (nameplate === void 0) { nameplate = \"\"; }\n if (time === void 0) { time = new Date(); }\n var entry = document.createElement(\"p\");\n var shownameField = document.createElement(\"span\");\n var nameplateField = document.createElement(\"span\");\n var textField = document.createElement(\"span\");\n nameplateField.className = \"iclog_name iclog_nameplate\";\n nameplateField.appendChild(document.createTextNode(nameplate));\n shownameField.className = \"iclog_name iclog_showname\";\n if (showname === \"\" || !showname) {\n shownameField.appendChild(document.createTextNode(nameplate));\n }\n else {\n shownameField.appendChild(document.createTextNode(showname));\n }\n textField.className = \"iclog_text\";\n textField.appendChild(document.createTextNode(msg));\n entry.appendChild(shownameField);\n entry.appendChild(nameplateField);\n entry.appendChild(textField);\n // Only put a timestamp if the minute has changed.\n if (client_1.lastICMessageTime.getMinutes() !== time.getMinutes()) {\n var timeStamp = document.createElement(\"span\");\n timeStamp.className = \"iclog_time\";\n timeStamp.innerText = time.toLocaleTimeString(undefined, {\n hour: \"numeric\",\n minute: \"2-digit\",\n });\n entry.appendChild(timeStamp);\n }\n var clientLog = document.getElementById(\"client_log\");\n clientLog.appendChild(entry);\n /* This is a little buggy - some troubleshooting might be desirable */\n if (clientLog.scrollTop > clientLog.scrollHeight - 800) {\n clientLog.scrollTop = clientLog.scrollHeight;\n }\n (0, client_1.setLastICMessageTime)(new Date());\n}\nexports.appendICLog = appendICLog;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkCallword = void 0;\nvar client_1 = require(\"../client\");\nvar aoHost_1 = require(\"./aoHost\");\n/**\n * check if the message contains an entry on our callword list\n * @param {string} message\n */\nfunction checkCallword(message, sfxAudio) {\n client_1.client.callwords.forEach(testCallword);\n function testCallword(item) {\n if (item !== \"\" && message.toLowerCase().includes(item.toLowerCase())) {\n sfxAudio.pause();\n sfxAudio.src = \"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-gallery.opus\");\n sfxAudio.play();\n }\n }\n}\nexports.checkCallword = checkCallword;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createArea = void 0;\nvar client_1 = require(\"../client\");\nvar areaClick_1 = require(\"../dom/areaClick\");\nvar createArea = function (id, name) {\n var thisarea = {\n name: name,\n players: 0,\n status: \"IDLE\",\n cm: \"\",\n locked: \"FREE\",\n };\n client_1.client.areas.push(thisarea);\n // Create area button\n var newarea = document.createElement(\"SPAN\");\n newarea.className = \"area-button area-default\";\n newarea.id = \"area\".concat(id);\n newarea.innerText = thisarea.name;\n newarea.title =\n \"Players: \".concat(thisarea.players, \"\\n\") +\n \"Status: \".concat(thisarea.status, \"\\n\") +\n \"CM: \".concat(thisarea.cm, \"\\n\") +\n \"Area lock: \".concat(thisarea.locked);\n newarea.onclick = function () {\n (0, areaClick_1.area_click)(newarea);\n };\n document.getElementById(\"areas\").appendChild(newarea);\n};\nexports.createArea = createArea;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fetchManifest = exports.fetchEvidenceList = exports.fetchCharacterList = exports.fetchBackgroundList = void 0;\nvar client_1 = require(\"../client\");\nvar aoHost_1 = require(\"./aoHost\");\nvar request_js_1 = require(\"../services/request.js\");\nvar fetchBackgroundList = function () { return __awaiter(void 0, void 0, void 0, function () {\n var bgdata, bg_array, bg_select_1, err_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, (0, request_js_1.request)(\"\".concat(aoHost_1.AO_HOST, \"backgrounds.json\"))];\n case 1:\n bgdata = _a.sent();\n bg_array = JSON.parse(bgdata);\n bg_select_1 = document.getElementById(\"bg_select\");\n bg_select_1.innerHTML = \"\";\n bg_select_1.add(new Option(\"Custom\", \"0\"));\n bg_array.forEach(function (background) {\n bg_select_1.add(new Option(background));\n });\n return [3 /*break*/, 3];\n case 2:\n err_1 = _a.sent();\n console.warn(\"there was no backgrounds.json file\");\n return [3 /*break*/, 3];\n case 3: return [2 /*return*/];\n }\n });\n}); };\nexports.fetchBackgroundList = fetchBackgroundList;\nvar fetchCharacterList = function () { return __awaiter(void 0, void 0, void 0, function () {\n var char_select, chardata, char_array, err_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n char_select = (document.getElementById(\"client_iniselect\"));\n char_select.innerHTML = \"\";\n char_select.add(new Option(\"Custom\", \"0\"));\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, (0, request_js_1.request)(\"\".concat(aoHost_1.AO_HOST, \"characters.json\"))];\n case 2:\n chardata = _a.sent();\n char_array = JSON.parse(chardata);\n // the try catch will fail before here when there is no file\n char_array.forEach(function (character) {\n char_select.add(new Option(character));\n });\n return [3 /*break*/, 4];\n case 3:\n err_2 = _a.sent();\n console.warn(\"there was no characters.json file\");\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n}); };\nexports.fetchCharacterList = fetchCharacterList;\nvar fetchEvidenceList = function () { return __awaiter(void 0, void 0, void 0, function () {\n var evi_select, evidata, evi_array, err_3;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n evi_select = (document.getElementById(\"evi_select\"));\n evi_select.innerHTML = \"\";\n evi_select.add(new Option(\"Custom\", \"0\"));\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, (0, request_js_1.request)(\"\".concat(aoHost_1.AO_HOST, \"evidence.json\"))];\n case 2:\n evidata = _a.sent();\n evi_array = JSON.parse(evidata);\n // the try catch will fail before here when there is no file\n evi_array.forEach(function (evi) {\n evi_select.add(new Option(evi));\n });\n return [3 /*break*/, 4];\n case 3:\n err_3 = _a.sent();\n console.warn(\"there was no evidence.json file\");\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n}); };\nexports.fetchEvidenceList = fetchEvidenceList;\nvar fetchManifest = function () { return __awaiter(void 0, void 0, void 0, function () {\n var manifestdata, err_4;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, (0, request_js_1.request)(\"\".concat(aoHost_1.AO_HOST, \"manifest.txt\"))];\n case 1:\n manifestdata = _a.sent();\n client_1.client.manifest = manifestdata.split(/\\r\\n|\\n\\r|\\n|\\r/);\n return [3 /*break*/, 3];\n case 2:\n err_4 = _a.sent();\n console.warn(\"there was no manifest.txt file\");\n return [3 /*break*/, 3];\n case 3: return [2 /*return*/];\n }\n });\n}); };\nexports.fetchManifest = fetchManifest;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fix_last_area = void 0;\nvar client_1 = require(\"../client\");\nvar addTrack_1 = require(\"./addTrack\");\n/**\n * Area list fuckery\n */\nvar fix_last_area = function () {\n if (client_1.client.areas.length > 0) {\n var malplaced = client_1.client.areas.pop().name;\n var areas = document.getElementById(\"areas\");\n areas.removeChild(areas.lastChild);\n (0, addTrack_1.addTrack)(malplaced);\n }\n};\nexports.fix_last_area = fix_last_area;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleBans = void 0;\n/**\n * Handles the kicked packet\n * @param {string} type is it a kick or a ban\n * @param {string} reason why\n */\nvar handleBans = function (type, reason) {\n document.getElementById(\"client_error\").style.display = \"flex\";\n document.getElementById(\"client_errortext\").innerHTML = \"\".concat(type, \":
\").concat(reason.replace(/\\n/g, \"
\"));\n (document.getElementById(\"client_reconnect\")).style.display = \"none\";\n alert(type + \":\\r\" + reason);\n};\nexports.handleBans = handleBans;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleCharacterInfo = void 0;\nvar client_1 = require(\"../client\");\nvar encoding_1 = require(\"../encoding\");\nvar iniParse_1 = require(\"../iniParse\");\nvar request_1 = require(\"../services/request\");\nvar fileExists_1 = require(\"../utils/fileExists\");\nvar aoHost_1 = require(\"./aoHost\");\n/**\n * Handles the incoming character information, and downloads the sprite + ini for it\n * @param {Array} chargs packet arguments\n * @param {Number} charid character ID\n */\nvar handleCharacterInfo = function (chargs, charid) { return __awaiter(void 0, void 0, void 0, function () {\n var img, cini, getCharIcon, cinidata, err_1, mute_select, pair_select, default_options, default_emotions;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n img = document.getElementById(\"demo_\".concat(charid));\n if (!chargs[0]) return [3 /*break*/, 5];\n cini = {};\n getCharIcon = function () { return __awaiter(void 0, void 0, void 0, function () {\n var extensions, charIconBaseUrl, i, fileUrl, exists;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n extensions = [\".png\", \".webp\"];\n img.alt = chargs[0];\n charIconBaseUrl = \"\".concat(aoHost_1.AO_HOST, \"characters/\").concat(encodeURI(chargs[0].toLowerCase()), \"/char_icon\");\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < extensions.length)) return [3 /*break*/, 4];\n fileUrl = charIconBaseUrl + extensions[i];\n return [4 /*yield*/, (0, fileExists_1.default)(fileUrl)];\n case 2:\n exists = _a.sent();\n if (exists) {\n img.alt = chargs[0];\n img.title = chargs[0];\n img.src = fileUrl;\n return [2 /*return*/];\n }\n _a.label = 3;\n case 3:\n i++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/];\n }\n });\n }); };\n getCharIcon();\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, (0, request_1.default)(\"\".concat(aoHost_1.AO_HOST, \"characters/\").concat(encodeURI(chargs[0].toLowerCase()), \"/char.ini\"))];\n case 2:\n cinidata = _a.sent();\n cini = (0, iniParse_1.default)(cinidata);\n return [3 /*break*/, 4];\n case 3:\n err_1 = _a.sent();\n cini = {};\n img.classList.add(\"noini\");\n console.warn(\"character \".concat(chargs[0], \" is missing from webAO\"));\n return [3 /*break*/, 4];\n case 4:\n mute_select = (document.getElementById(\"mute_select\"));\n mute_select.add(new Option((0, encoding_1.safeTags)(chargs[0]), String(charid)));\n pair_select = (document.getElementById(\"pair_select\"));\n pair_select.add(new Option((0, encoding_1.safeTags)(chargs[0]), String(charid)));\n default_options = {\n name: chargs[0],\n showname: chargs[0],\n side: \"def\",\n blips: \"male\",\n chat: \"\",\n category: \"\",\n };\n cini.options = Object.assign(default_options, cini.options);\n default_emotions = {\n number: 0,\n };\n cini.emotions = Object.assign(default_emotions, cini.emotions);\n client_1.client.chars[charid] = {\n name: (0, encoding_1.safeTags)(chargs[0]),\n showname: (0, encoding_1.safeTags)(cini.options.showname),\n desc: (0, encoding_1.safeTags)(chargs[1]),\n blips: (0, encoding_1.safeTags)(cini.options.blips).toLowerCase(),\n gender: (0, encoding_1.safeTags)(cini.options.gender).toLowerCase(),\n side: (0, encoding_1.safeTags)(cini.options.side).toLowerCase(),\n chat: cini.options.chat === \"\"\n ? (0, encoding_1.safeTags)(cini.options.category).toLowerCase()\n : (0, encoding_1.safeTags)(cini.options.chat).toLowerCase(),\n evidence: chargs[3],\n icon: img.src,\n inifile: cini,\n muted: false,\n };\n if (client_1.client.chars[charid].blips === \"male\" &&\n client_1.client.chars[charid].gender !== \"male\" &&\n client_1.client.chars[charid].gender !== \"\") {\n client_1.client.chars[charid].blips = client_1.client.chars[charid].gender;\n }\n return [3 /*break*/, 6];\n case 5:\n console.warn(\"missing charid \".concat(charid));\n img.style.display = \"none\";\n _a.label = 6;\n case 6: return [2 /*return*/];\n }\n });\n}); };\nexports.handleCharacterInfo = handleCharacterInfo;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isAudio = void 0;\nvar isAudio = function (trackname) {\n var audioEndings = [\".wav\", \".mp3\", \".ogg\", \".opus\"];\n return (audioEndings.filter(function (ending) { return trackname.endsWith(ending); }).length === 1);\n};\nexports.isAudio = isAudio;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isLowMemory = void 0;\nvar client_1 = require(\"../client\");\nvar isLowMemory = function () {\n if (/webOS|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|PlayStation|Nintendo|Opera Mini/i.test(navigator.userAgent)) {\n (0, client_1.setOldLoading)(true);\n }\n};\nexports.isLowMemory = isLowMemory;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.loadResources = void 0;\nvar getCookie_1 = require(\"../utils/getCookie\");\nvar evidence_js_1 = require(\"../constants/evidence.js\");\nvar backgrounds_js_1 = require(\"../constants/backgrounds.js\");\nvar changeMusicVolume_1 = require(\"../dom/changeMusicVolume\");\nvar setChatbox_1 = require(\"../dom/setChatbox\");\nvar changeVolume_1 = require(\"../dom/changeVolume\");\nvar showNameClick_1 = require(\"../dom/showNameClick\");\nvar changeBlipVolume_1 = require(\"../dom/changeBlipVolume\");\nvar reloadTheme_1 = require(\"../dom/reloadTheme\");\nvar version = process.env.npm_package_version;\n/**\n * Load game resources and stored settings.\n */\nvar loadResources = function () {\n document.getElementById(\"client_version\").innerText = \"version \".concat(version);\n // Load background array to select\n var background_select = (document.getElementById(\"bg_select\"));\n background_select.add(new Option(\"Custom\", \"0\"));\n backgrounds_js_1.default.forEach(function (background) {\n background_select.add(new Option(background));\n });\n // Load evidence array to select\n var evidence_select = (document.getElementById(\"evi_select\"));\n evidence_select.add(new Option(\"Custom\", \"0\"));\n evidence_js_1.default.forEach(function (evidence) {\n evidence_select.add(new Option(evidence));\n });\n // Read cookies and set the UI to its values\n document.getElementById(\"OOC_name\").value =\n (0, getCookie_1.default)(\"OOC_name\") ||\n \"web\".concat(String(Math.round(Math.random() * 100 + 10)));\n // Read cookies and set the UI to its values\n var cookietheme = (0, getCookie_1.default)(\"theme\") || \"default\";\n (document.querySelector(\"#client_themeselect [value=\\\"\".concat(cookietheme, \"\\\"]\"))).selected = true;\n (0, reloadTheme_1.reloadTheme)();\n var cookiechatbox = (0, getCookie_1.default)(\"chatbox\") || \"dynamic\";\n (document.querySelector(\"#client_chatboxselect [value=\\\"\".concat(cookiechatbox, \"\\\"]\"))).selected = true;\n (0, setChatbox_1.setChatbox)(cookiechatbox);\n document.getElementById(\"client_mvolume\").value =\n (0, getCookie_1.default)(\"musicVolume\") || \"1\";\n (0, changeMusicVolume_1.changeMusicVolume)();\n document.getElementById(\"client_sfxaudio\").volume =\n Number((0, getCookie_1.default)(\"sfxVolume\")) || 1;\n (0, changeVolume_1.changeSFXVolume)();\n document.getElementById(\"client_shoutaudio\").volume =\n Number((0, getCookie_1.default)(\"shoutVolume\")) || 1;\n (0, changeVolume_1.changeShoutVolume)();\n (document.getElementById(\"client_testimonyaudio\")).volume = Number((0, getCookie_1.default)(\"testimonyVolume\")) || 1;\n (0, changeVolume_1.changeTestimonyVolume)();\n document.getElementById(\"client_bvolume\").value =\n (0, getCookie_1.default)(\"blipVolume\") || \"1\";\n (0, changeBlipVolume_1.changeBlipVolume)();\n document.getElementById(\"ic_chat_name\").value =\n (0, getCookie_1.default)(\"ic_chat_name\");\n document.getElementById(\"showname\").checked = Boolean((0, getCookie_1.default)(\"showname\"));\n (0, showNameClick_1.showname_click)(null);\n document.getElementById(\"client_callwords\").value =\n (0, getCookie_1.default)(\"callwords\");\n};\nexports.loadResources = loadResources;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resetICParams = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Resets the IC parameters for the player to enter a new chat message.\n * This should only be called when the player's previous chat message\n * was successfully sent/presented.\n */\nfunction resetICParams() {\n document.getElementById(\"client_inputbox\").value = \"\";\n document.getElementById(\"button_flash\").className = \"client_button\";\n document.getElementById(\"button_shake\").className = \"client_button\";\n document.getElementById(\"sendpreanim\").checked = false;\n document.getElementById(\"sendsfx\").checked = false;\n if (client_1.selectedShout) {\n document.getElementById(\"button_\".concat(client_1.selectedShout)).className =\n \"client_button\";\n (0, client_1.setSelectedShout)(0);\n }\n}\nexports.resetICParams = resetICParams;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.saveChatlogHandle = void 0;\nvar downloadFile_1 = require(\"../services/downloadFile\");\nvar saveChatlogHandle = function () { return __awaiter(void 0, void 0, void 0, function () {\n var clientLog, icMessageLogs, messages, i, SHOWNAME_POSITION, TEXT_POSITION, showname, text, message, d, ye, mo, da, filename;\n return __generator(this, function (_a) {\n clientLog = document.getElementById(\"client_log\");\n icMessageLogs = clientLog.getElementsByTagName(\"p\");\n messages = [];\n for (i = 0; i < icMessageLogs.length; i++) {\n SHOWNAME_POSITION = 0;\n TEXT_POSITION = 2;\n showname = icMessageLogs[i].children[SHOWNAME_POSITION].innerHTML;\n text = icMessageLogs[i].children[TEXT_POSITION].innerHTML;\n message = \"\".concat(showname, \": \").concat(text);\n messages.push(message);\n }\n d = new Date();\n ye = new Intl.DateTimeFormat(\"en\", { year: \"numeric\" }).format(d);\n mo = new Intl.DateTimeFormat(\"en\", { month: \"short\" }).format(d);\n da = new Intl.DateTimeFormat(\"en\", { day: \"2-digit\" }).format(d);\n filename = \"chatlog-\".concat(da, \"-\").concat(mo, \"-\").concat(ye).toLowerCase();\n (0, downloadFile_1.default)(messages.join(\"\\n\"), filename);\n // Reset Chatbox to Empty\n document.getElementById(\"client_inputbox\").value = \"\";\n return [2 /*return*/];\n });\n}); };\nexports.saveChatlogHandle = saveChatlogHandle;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sender = void 0;\nvar sendIC_1 = require(\"./sendIC\");\nvar sendSelf_1 = require(\"./sendSelf\");\nvar sendServer_1 = require(\"./sendServer\");\nvar sendCheck_1 = require(\"./sendCheck\");\nvar sendHP_1 = require(\"./sendHP\");\nvar sendOOC_1 = require(\"./sendOOC\");\nvar sendCharacter_1 = require(\"./sendCharacter\");\nvar sendRT_1 = require(\"./sendRT\");\nvar sendMusicChange_1 = require(\"./sendMusicChange\");\nvar sendZZ_1 = require(\"./sendZZ\");\nvar sendEE_1 = require(\"./sendEE\");\nvar sendDE_1 = require(\"./sendDE\");\nvar sendPE_1 = require(\"./sendPE\");\nexports.sender = {\n sendIC: sendIC_1.sendIC,\n sendSelf: sendSelf_1.sendSelf,\n sendServer: sendServer_1.sendServer,\n sendCheck: sendCheck_1.sendCheck,\n sendHP: sendHP_1.sendHP,\n sendOOC: sendOOC_1.sendOOC,\n sendCharacter: sendCharacter_1.sendCharacter,\n sendRT: sendRT_1.sendRT,\n sendMusicChange: sendMusicChange_1.sendMusicChange,\n sendZZ: sendZZ_1.sendZZ,\n sendEE: sendEE_1.sendEE,\n sendDE: sendDE_1.sendDE,\n sendPE: sendPE_1.sendPE\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendCharacter = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Requests to play as a specified character.\n * @param {number} character the character ID\n */\nvar sendCharacter = function (character) {\n if (character === -1 || client_1.client.chars[character].name) {\n client_1.client.sender.sendServer(\"CC#\".concat(client_1.client.playerID, \"#\").concat(character, \"#web#%\"));\n }\n};\nexports.sendCharacter = sendCharacter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendCheck = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Sends a keepalive packet.\n */\nvar sendCheck = function () {\n client_1.client.sender.sendServer(\"CH#\".concat(client_1.client.charID, \"#%\"));\n};\nexports.sendCheck = sendCheck;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendDE = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Sends delete evidence command.\n * @param {number} evidence id\n */\nvar sendDE = function (id) {\n client_1.client.sender.sendServer(\"DE#\".concat(id, \"#%\"));\n};\nexports.sendDE = sendDE;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendEE = void 0;\nvar client_1 = require(\"../../client\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Sends edit evidence command.\n * @param {number} evidence id\n * @param {string} evidence name\n * @param {string} evidence description\n * @param {string} evidence image filename\n */\nvar sendEE = function (id, name, desc, img) {\n client_1.client.sender.sendServer(\"EE#\".concat(id, \"#\").concat((0, encoding_1.escapeChat)(name), \"#\").concat((0, encoding_1.escapeChat)(desc), \"#\").concat((0, encoding_1.escapeChat)(img), \"#%\"));\n};\nexports.sendEE = sendEE;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendHP = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Sends health point command.\n * @param {number} side the position\n * @param {number} hp the health point\n */\nvar sendHP = function (side, hp) {\n client_1.client.sender.sendServer(\"HP#\".concat(side, \"#\").concat(hp, \"#%\"));\n};\nexports.sendHP = sendHP;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendIC = void 0;\nvar client_1 = require(\"../../client\");\nvar encoding_1 = require(\"../../encoding\");\nvar client_2 = require(\"../../client\");\nvar queryParser_1 = require(\"../../utils/queryParser\");\nvar mode = (0, queryParser_1.default)().mode;\n/**\n * Sends an in-character chat message.\n * @param {number} deskmod controls the desk\n * @param {string} speaking who is speaking\n * @param {string} name the name of the current character\n * @param {string} silent whether or not it's silent\n * @param {string} message the message to be sent\n * @param {string} side the name of the side in the background\n * @param {string} sfx_name the name of the sound effect\n * @param {number} emote_modifier whether or not to zoom\n * @param {number} sfx_delay the delay (in milliseconds) to play the sound effect\n * @param {number} objection_modifier the number of the shout to play\n * @param {string} evidence the filename of evidence to show\n * @param {boolean} flip change to 1 to reverse sprite for position changes\n * @param {boolean} realization screen flash effect\n * @param {number} text_color text color\n * @param {string} showname custom name to be displayed (optional)\n * @param {number} other_charid paired character (optional)\n * @param {number} self_offset offset to paired character (optional)\n * @param {number} noninterrupting_preanim play the full preanim (optional)\n */\nvar sendIC = function (deskmod, preanim, name, emote, message, side, sfx_name, emote_modifier, sfx_delay, objection_modifier, evidence, flip, realization, text_color, showname, other_charid, self_hoffset, self_yoffset, noninterrupting_preanim, looping_sfx, screenshake, frame_screenshake, frame_realization, frame_sfx, additive, effect) {\n var extra_cccc = \"\";\n var other_emote = \"\";\n var other_offset = \"\";\n var extra_27 = \"\";\n var extra_28 = \"\";\n if (client_1.extrafeatures.includes(\"cccc_ic_support\")) {\n var self_offset = client_1.extrafeatures.includes(\"y_offset\")\n ? \"\".concat(self_hoffset, \"\").concat(self_yoffset)\n : self_hoffset; // HACK: this should be an & but client fucked it up and all the servers adopted it\n if (mode === \"replay\") {\n other_emote = \"##\";\n other_offset = \"#0#0\";\n }\n extra_cccc = \"\".concat((0, encoding_1.escapeChat)(showname), \"#\").concat(other_charid).concat(other_emote, \"#\").concat(self_offset).concat(other_offset, \"#\").concat(Number(noninterrupting_preanim), \"#\");\n if (client_1.extrafeatures.includes(\"looping_sfx\")) {\n extra_27 = \"\".concat(Number(looping_sfx), \"#\").concat(Number(screenshake), \"#\").concat(frame_screenshake, \"#\").concat(frame_realization, \"#\").concat(frame_sfx, \"#\");\n if (client_1.extrafeatures.includes(\"effects\")) {\n extra_28 = \"\".concat(Number(additive), \"#\").concat((0, encoding_1.escapeChat)(effect), \"#\");\n }\n }\n }\n var serverMessage = \"MS#\".concat(deskmod, \"#\").concat((0, encoding_1.escapeChat)(preanim), \"#\").concat((0, encoding_1.escapeChat)(name), \"#\").concat((0, encoding_1.escapeChat)(emote)) +\n \"#\".concat((0, encoding_1.escapeChat)(message), \"#\").concat((0, encoding_1.escapeChat)(side), \"#\").concat((0, encoding_1.escapeChat)(sfx_name), \"#\").concat(emote_modifier) +\n \"#\".concat(client_2.client.charID, \"#\").concat(sfx_delay, \"#\").concat(Number(objection_modifier), \"#\").concat(Number(evidence), \"#\").concat(Number(flip), \"#\").concat(Number(realization), \"#\").concat(text_color, \"#\").concat(extra_cccc).concat(extra_27).concat(extra_28, \"%\");\n client_2.client.sender.sendServer(serverMessage);\n if (mode === \"replay\") {\n (document.getElementById(\"client_ooclog\")).value += \"wait#\".concat(document.getElementById(\"client_replaytimer\").value, \"#%\\r\\n\");\n }\n};\nexports.sendIC = sendIC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendMusicChange = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Requests to change the music to the specified track.\n * @param {string} track the track ID\n */\nvar sendMusicChange = function (track) {\n client_1.client.sender.sendServer(\"MC#\".concat(track, \"#\").concat(client_1.client.charID, \"#%\"));\n};\nexports.sendMusicChange = sendMusicChange;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendOOC = void 0;\nvar client_1 = require(\"../../client\");\nvar encoding_1 = require(\"../../encoding\");\nvar setCookie_1 = require(\"../../utils/setCookie\");\nvar saveChatLogHandle_1 = require(\"../../client/saveChatLogHandle\");\n/**\n * Sends an out-of-character chat message.\n * @param {string} message the message to send\n */\nvar sendOOC = function (message) {\n (0, setCookie_1.default)(\"OOC_name\", document.getElementById(\"OOC_name\").value);\n var oocName = \"\".concat((0, encoding_1.escapeChat)(document.getElementById(\"OOC_name\").value));\n var oocMessage = \"\".concat((0, encoding_1.escapeChat)(message));\n var commands = {\n \"/save_chatlog\": saveChatLogHandle_1.saveChatlogHandle,\n };\n var commandsMap = new Map(Object.entries(commands));\n if (oocMessage && commandsMap.has(oocMessage.toLowerCase())) {\n try {\n commandsMap.get(oocMessage.toLowerCase())();\n }\n catch (e) {\n // Command Not Recognized\n }\n }\n else {\n client_1.client.sender.sendServer(\"CT#\".concat(oocName, \"#\").concat(oocMessage, \"#%\"));\n }\n};\nexports.sendOOC = sendOOC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendPE = void 0;\nvar client_1 = require(\"../../client\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Sends add evidence command.\n * @param {string} evidence name\n * @param {string} evidence description\n * @param {string} evidence image filename\n */\nvar sendPE = function (name, desc, img) {\n client_1.client.sender.sendServer(\"PE#\".concat((0, encoding_1.escapeChat)(name), \"#\").concat((0, encoding_1.escapeChat)(desc), \"#\").concat((0, encoding_1.escapeChat)(img), \"#%\"));\n};\nexports.sendPE = sendPE;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendRT = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Sends testimony command.\n * @param {string} testimony type\n */\nvar sendRT = function (testimony) {\n client_1.client.sender.sendServer(\"RT#\".concat(testimony, \"#%\"));\n};\nexports.sendRT = sendRT;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendSelf = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Hook for sending messages to the client\n * @param {string} message the message to send\n */\nvar sendSelf = function (message) {\n (document.getElementById(\"client_ooclog\")).value += \"\".concat(message, \"\\r\\n\");\n client_1.client.handleSelf(message);\n};\nexports.sendSelf = sendSelf;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendServer = void 0;\nvar client_1 = require(\"../../client\");\nvar queryParser_1 = require(\"../../utils/queryParser\");\nvar mode = (0, queryParser_1.default)().mode;\n/**\n * Hook for sending messages to the server\n * @param {string} message the message to send\n */\nvar sendServer = function (message) {\n console.debug(\"C: \" + message);\n mode === \"replay\" ? client_1.client.sender.sendSelf(message) : client_1.client.serv.send(message);\n};\nexports.sendServer = sendServer;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendZZ = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Sends call mod command.\n * @param {string} message to mod\n */\nvar sendZZ = function (msg) {\n if (client_1.extrafeatures.includes(\"modcall_reason\")) {\n client_1.client.sender.sendServer(\"ZZ#\".concat(msg, \"#%\"));\n }\n else {\n client_1.client.sender.sendServer(\"ZZ#%\");\n }\n};\nexports.sendZZ = sendZZ;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar transparentPng_1 = require(\"../constants/transparentPng\");\nvar fileExists_1 = require(\"../utils/fileExists\");\n/**\n * Sets all the img tags to the right sources\n * @param {*} chatmsg\n */\nvar setEmote = function (AO_HOST, client, charactername, emotename, prefix, pair, side) { return __awaiter(void 0, void 0, void 0, function () {\n var pairID, characterFolder, acceptedPositions, position, emoteSelector, extensionsMap, extensionsMap_1, extensionsMap_1_1, extension, url, exists, e_1_1;\n var e_1, _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n pairID = pair ? \"pair\" : \"char\";\n characterFolder = \"\".concat(AO_HOST, \"characters/\");\n acceptedPositions = [\"def\", \"pro\", \"wit\"];\n position = acceptedPositions.includes(side) ? \"\".concat(side, \"_\") : \"\";\n emoteSelector = document.getElementById(\"client_\".concat(position).concat(pairID, \"_img\"));\n extensionsMap = [\".gif\", \".png\", \".apng\", \".webp\", \".webp.static\"];\n _b.label = 1;\n case 1:\n _b.trys.push([1, 6, 7, 8]);\n extensionsMap_1 = __values(extensionsMap), extensionsMap_1_1 = extensionsMap_1.next();\n _b.label = 2;\n case 2:\n if (!!extensionsMap_1_1.done) return [3 /*break*/, 5];\n extension = extensionsMap_1_1.value;\n // Hides all sprites before creating a new sprite\n if (client.viewport.getLastCharacter() !== client.viewport.getChatmsg().name) {\n emoteSelector.src = transparentPng_1.default;\n }\n url = void 0;\n if (extension === \".png\") {\n url = \"\".concat(characterFolder).concat(encodeURI(charactername), \"/\").concat(encodeURI(emotename)).concat(extension);\n }\n else if (extension === \".webp.static\") {\n url = \"\".concat(characterFolder).concat(encodeURI(charactername), \"/\").concat(encodeURI(emotename), \".webp\");\n }\n else {\n url = \"\".concat(characterFolder).concat(encodeURI(charactername), \"/\").concat(encodeURI(prefix)).concat(encodeURI(emotename)).concat(extension);\n }\n return [4 /*yield*/, (0, fileExists_1.default)(url)];\n case 3:\n exists = _b.sent();\n if (exists) {\n emoteSelector.src = url;\n return [3 /*break*/, 5];\n }\n _b.label = 4;\n case 4:\n extensionsMap_1_1 = extensionsMap_1.next();\n return [3 /*break*/, 2];\n case 5: return [3 /*break*/, 8];\n case 6:\n e_1_1 = _b.sent();\n e_1 = { error: e_1_1 };\n return [3 /*break*/, 8];\n case 7:\n try {\n if (extensionsMap_1_1 && !extensionsMap_1_1.done && (_a = extensionsMap_1.return)) _a.call(extensionsMap_1);\n }\n finally { if (e_1) throw e_1.error; }\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/];\n }\n });\n}); };\nexports.default = setEmote;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.area_click = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Triggered when an item on the area list is clicked.\n * @param {HTMLElement} el\n */\nfunction area_click(el) {\n var area = client_1.client.areas[el.id.substr(4)].name;\n client_1.client.sender.sendMusicChange(area);\n var areaHr = document.createElement(\"div\");\n areaHr.className = \"hrtext\";\n areaHr.textContent = \"switched to \".concat(el.textContent);\n document.getElementById(\"client_log\").appendChild(areaHr);\n}\nexports.area_click = area_click;\nwindow.area_click = area_click;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.changeBlipVolume = void 0;\nvar setCookie_1 = require(\"../utils/setCookie\");\nvar client_1 = require(\"../client\");\n/**\n * Triggered by the blip volume slider.\n */\nvar changeBlipVolume = function () {\n var blipVolume = (document.getElementById(\"client_bvolume\")).value;\n client_1.client.viewport.blipChannels.forEach(function (channel) { return (channel.volume = Number(blipVolume)); });\n (0, setCookie_1.default)(\"blipVolume\", blipVolume);\n};\nexports.changeBlipVolume = changeBlipVolume;\nwindow.changeBlipVolume = exports.changeBlipVolume;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.changeMusicVolume = void 0;\nvar client_1 = require(\"../client\");\nvar setCookie_1 = require(\"../utils/setCookie\");\nvar changeMusicVolume = function (volume) {\n if (volume === void 0) { volume = -1; }\n var clientVolume = Number(document.getElementById(\"client_mvolume\").value);\n var musicVolume = volume === -1 ? clientVolume : volume;\n client_1.client.viewport.music.forEach(function (channel) { return (channel.volume = musicVolume); });\n (0, setCookie_1.default)(\"musicVolume\", String(musicVolume));\n};\nexports.changeMusicVolume = changeMusicVolume;\nwindow.changeMusicVolume = exports.changeMusicVolume;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIndexFromSelect = void 0;\n/**\n * Find index of anything in select box.\n * @param {string} select_box the select element name\n * @param {string} value the value that need to be compared\n */\nfunction getIndexFromSelect(select_box, value) {\n // Find if icon alraedy existed in select box\n var select_element = document.getElementById(select_box);\n for (var i = 1; i < select_element.length; ++i) {\n if (select_element.options[i].value === value) {\n return i;\n }\n }\n return 0;\n}\nexports.getIndexFromSelect = getIndexFromSelect;\nwindow.getIndexFromSelect = getIndexFromSelect;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.onReplayGo = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Triggered when the user click replay GOOOOO\n * @param {KeyboardEvent} event\n */\nfunction onReplayGo(_event) {\n client_1.client.handleReplay();\n}\nexports.onReplayGo = onReplayGo;\nwindow.onReplayGo = onReplayGo;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.opusCheck = void 0;\n/**\n * Triggered when there was an error loading a sound\n * @param {HTMLAudioElement} image the element containing the missing sound\n */\nfunction opusCheck(channel) {\n var audio = channel.src;\n if (audio === \"\") {\n return;\n }\n console.warn(\"failed to load sound \".concat(channel.src));\n var oldsrc = \"\";\n var newsrc = \"\";\n oldsrc = channel.src;\n if (!oldsrc.endsWith(\".opus\")) {\n newsrc = oldsrc.replace(\".mp3\", \".opus\");\n newsrc = newsrc.replace(\".wav\", \".opus\");\n channel.src = newsrc; // unload so the old sprite doesn't persist\n }\n}\nexports.opusCheck = opusCheck;\nwindow.opusCheck = opusCheck;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.pickEmotion = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Highlights and selects an emotion for in-character chat.\n * @param {string} emo the new emotion to be selected\n */\nfunction pickEmotion(emo) {\n try {\n if (client_1.client.selectedEmote !== -1) {\n document.getElementById(\"emo_\".concat(client_1.client.selectedEmote)).className =\n \"emote_button\";\n }\n }\n catch (err) {\n // do nothing\n }\n client_1.client.selectedEmote = emo;\n document.getElementById(\"emo_\".concat(emo)).className = \"emote_button dark\";\n document.getElementById(\"sendsfx\").checked =\n client_1.client.emote.sfx.length > 1;\n document.getElementById(\"sendpreanim\").checked =\n client_1.client.emote.zoom == 1;\n}\nexports.pickEmotion = pickEmotion;\nwindow.pickEmotion = pickEmotion;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.reloadTheme = void 0;\nvar client_1 = require(\"../client\");\nvar setCookie_1 = require(\"../utils/setCookie\");\n/**\n * Triggered by the theme selector.\n */\nvar reloadTheme = function () {\n client_1.client.viewport.setTheme(document.getElementById(\"client_themeselect\")\n .value);\n (0, setCookie_1.default)(\"theme\", client_1.client.viewport.getTheme());\n (document.getElementById(\"client_theme\")).href = \"styles/\".concat(client_1.client.viewport.getTheme(), \".css\");\n};\nexports.reloadTheme = reloadTheme;\nwindow.reloadTheme = exports.reloadTheme;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resizeChatbox = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Set the font size for the chatbox\n */\nfunction resizeChatbox() {\n var chatContainerBox = document.getElementById(\"client_chatcontainer\");\n var clockBox = document.getElementById(\"client_clock\");\n var trackstatusBox = document.getElementById(\"client_trackstatus\");\n var gameHeight = document.getElementById(\"client_background\").offsetHeight;\n chatContainerBox.style.fontSize = \"\".concat((gameHeight * 0.0521).toFixed(1), \"px\");\n clockBox.style.fontSize = \"\".concat((gameHeight * 0.0521).toFixed(1), \"px\");\n trackstatusBox.style.fontSize = \"\".concat((gameHeight * 0.0521).toFixed(1), \"px\");\n var trackstatus = (document.getElementById(\"client_trackstatustext\"));\n trackstatus.style.width = (trackstatus.offsetWidth - 1) + \"px\";\n //clock\n var now = new Date();\n var weekday = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n var month = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n document.getElementById(\"client_clock_month\").innerText = month[now.getMonth()];\n if (client_1.CHATBOX == \"acww\") {\n weekday = [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"];\n document.getElementById(\"client_clock_weekday\").innerText = weekday[now.getDay()];\n document.getElementById(\"client_clock_date\").innerText = now.getDay() + \"/\" + now.getMonth();\n document.getElementById(\"client_clock_time\").innerText = now.getHours() + \":\" + now.getMinutes();\n }\n else if (client_1.CHATBOX == \"key\") {\n weekday = [\"Sun.\", \"Mon.\", \"Tue.\", \"Wed.\", \"Thu.\", \"Fri.\", \"Sat.\"];\n document.getElementById(\"client_clock_weekday\").innerText = weekday[now.getDay()];\n document.getElementById(\"client_clock_date\").innerText = String(now.getDate());\n }\n}\nexports.resizeChatbox = resizeChatbox;\nwindow.resizeChatbox = resizeChatbox;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setChatbox = void 0;\nvar client_1 = require(\"../client\");\nvar chatboxes_js_1 = require(\"../styles/chatbox/chatboxes.js\");\nvar setCookie_1 = require(\"../utils/setCookie\");\n/**\n * Set the style of the chatbox\n */\nfunction setChatbox(setstyle) {\n var chatbox_theme = (document.getElementById(\"chatbox_theme\"));\n var themeselect = (document.getElementById(\"client_chatboxselect\"));\n (0, client_1.setCHATBOX)(themeselect.value);\n (0, setCookie_1.default)(\"chatbox\", client_1.CHATBOX);\n if (client_1.CHATBOX === \"dynamic\") {\n var style = setstyle.replace(\"chat\", \"\");\n if (chatboxes_js_1.default.includes(style)) {\n chatbox_theme.href = \"styles/chatbox/\".concat(style, \".css\");\n }\n else {\n chatbox_theme.href = \"styles/chatbox/aa.css\";\n }\n }\n else {\n chatbox_theme.href = \"styles/chatbox/\".concat(client_1.CHATBOX, \".css\");\n }\n}\nexports.setChatbox = setChatbox;\nwindow.setChatbox = setChatbox;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.showname_click = void 0;\nvar setCookie_1 = require(\"../utils/setCookie\");\n/**\n * Triggered when the showname checkboc is clicked\n * @param {MouseEvent} event\n */\nfunction showname_click(_event) {\n (0, setCookie_1.default)(\"showname\", String(document.getElementById(\"showname\").checked));\n (0, setCookie_1.default)(\"ic_chat_name\", document.getElementById(\"ic_chat_name\").value);\n var css_s = document.getElementById(\"nameplate_setting\");\n if (document.getElementById(\"showname\").checked) {\n css_s.href = \"styles/shownames.css\";\n }\n else {\n css_s.href = \"styles/nameplates.css\";\n }\n}\nexports.showname_click = showname_click;\nwindow.showname_click = showname_click;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.showFactorDialog = void 0;\nvar client_1 = require(\"../client\");\nfunction handleCredentialResponse(response) {\n client_1.client.sender.sendServer(\"2T#\".concat(response.credential, \"#%\"));\n}\nwindow.handleCredentialResponse = handleCredentialResponse;\nfunction showFactorDialog(args) {\n document.getElementById(\"client_secondfactor\").style.display = args[1];\n}\nexports.showFactorDialog = showFactorDialog;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateActionCommands = void 0;\n/**\n * Update evidence icon.\n */\nfunction updateActionCommands(side) {\n if (side === \"jud\") {\n document.getElementById(\"judge_action\").style.display = \"inline-table\";\n document.getElementById(\"no_action\").style.display = \"none\";\n }\n else {\n document.getElementById(\"judge_action\").style.display = \"none\";\n document.getElementById(\"no_action\").style.display = \"inline-table\";\n }\n // Update role selector\n for (var i = 0, role_select = document.getElementById(\"role_select\"); i < role_select.options.length; i++) {\n if (side === role_select.options[i].value) {\n role_select.options.selectedIndex = i;\n return;\n }\n }\n}\nexports.updateActionCommands = updateActionCommands;\nwindow.updateActionCommands = updateActionCommands;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateBackgroundPreview = void 0;\nvar aoHost_1 = require(\"../client/aoHost\");\nvar tryUrls_1 = require(\"../utils/tryUrls\");\n/**\n * Update background preview.\n */\nfunction updateBackgroundPreview() {\n var background_select = (document.getElementById(\"bg_select\"));\n var background_filename = (document.getElementById(\"bg_filename\"));\n var background_preview = (document.getElementById(\"bg_preview\"));\n if (background_select.selectedIndex === 0) {\n background_filename.style.display = \"initial\";\n }\n else {\n background_filename.style.display = \"none\";\n }\n (0, tryUrls_1.default)(\"\".concat(aoHost_1.AO_HOST, \"background/\").concat(encodeURI(background_select.value.toLowerCase()), \"/defenseempty\")).then(function (resp) {\n background_preview.src = resp;\n });\n}\nexports.updateBackgroundPreview = updateBackgroundPreview;\nwindow.updateBackgroundPreview = updateBackgroundPreview;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.prepChat = exports.decodeChat = exports.safeTags = exports.unescapeChat = exports.escapeChat = void 0;\n/**\n * Escapes a string to AO1 escape codes.\n * @param {string} estring the string to be escaped\n */\nfunction escapeChat(estring) {\n return estring\n .replaceAll('#', '')\n .replaceAll('&', '')\n .replaceAll('%', '')\n .replaceAll('$', '');\n}\nexports.escapeChat = escapeChat;\n/**\n * Unescapes a string to AO1 escape codes.\n * @param {string} estring the string to be unescaped\n */\nfunction unescapeChat(estring) {\n return estring\n .replaceAll('', '#')\n .replaceAll('', '&')\n .replaceAll('', '%')\n .replaceAll('', '$');\n}\nexports.unescapeChat = unescapeChat;\n/**\n * Escapes a string to be HTML-safe.\n *\n * XXX: This is unnecessary if we use `createTextNode` instead!\n * @param {string} unsafe an unsanitized string\n */\nfunction safeTags(unsafe) {\n if (unsafe) {\n return unsafe\n .replaceAll('>', '>')\n .replaceAll('<', '<');\n }\n return '';\n}\nexports.safeTags = safeTags;\n/**\n * Decodes text on client side.\n * @param {string} estring the string to be decoded\n */\nfunction decodeChat(estring) {\n // Source: https://stackoverflow.com/questions/7885096/how-do-i-decode-a-string-with-escaped-unicode\n return estring.replace(/\\\\u([\\d\\w]{1,})/gi, function (match, group) { return String.fromCharCode(parseInt(group, 16)); });\n}\nexports.decodeChat = decodeChat;\n/**\n * XXX: a nasty hack made by gameboyprinter.\n * @param {string} msg chat message to prepare for display\n */\nfunction prepChat(msg) {\n // TODO: make this less awful\n return safeTags(unescapeChat(decodeChat(msg)));\n}\nexports.prepChat = prepChat;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleARUP = void 0;\nvar client_1 = require(\"../../client\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Handle the change of players in an area.\n * @param {Array} args packet arguments\n */\nvar handleARUP = function (args) {\n args = args.slice(1);\n for (var i = 0; i < args.length - 2; i++) {\n if (client_1.client.areas[i]) {\n // the server sends us ARUP before we even get the area list\n var thisarea = document.getElementById(\"area\".concat(i));\n switch (Number(args[0])) {\n case 0: // playercount\n client_1.client.areas[i].players = Number(args[i + 1]);\n break;\n case 1: // status\n client_1.client.areas[i].status = (0, encoding_1.safeTags)(args[i + 1]);\n break;\n case 2:\n client_1.client.areas[i].cm = (0, encoding_1.safeTags)(args[i + 1]);\n break;\n case 3:\n client_1.client.areas[i].locked = (0, encoding_1.safeTags)(args[i + 1]);\n break;\n }\n thisarea.className = \"area-button area-\".concat(client_1.client.areas[i].status.toLowerCase());\n thisarea.innerText = \"\".concat(client_1.client.areas[i].name, \" (\").concat(client_1.client.areas[i].players, \") [\").concat(client_1.client.areas[i].status, \"]\");\n thisarea.title =\n \"Players: \".concat(client_1.client.areas[i].players, \"\\n\") +\n \"Status: \".concat(client_1.client.areas[i].status, \"\\n\") +\n \"CM: \".concat(client_1.client.areas[i].cm, \"\\n\") +\n \"Area lock: \".concat(client_1.client.areas[i].locked);\n }\n }\n};\nexports.handleARUP = handleARUP;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleASS = void 0;\nvar aoHost_1 = require(\"../../client/aoHost\");\n/**\n* new asset url!!\n* @param {Array} args packet arguments\n*/\nvar handleASS = function (args) {\n if (args[1] !== \"None\")\n (0, aoHost_1.setAOhost)(args[1]);\n};\nexports.handleASS = handleASS;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleBB = void 0;\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Handles the warning packet\n * on client this spawns a message box you can't close for 2 seconds\n * @param {Array} args ban reason\n */\nvar handleBB = function (args) {\n alert((0, encoding_1.safeTags)(args[1]));\n};\nexports.handleBB = handleBB;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleBD = void 0;\nvar client_1 = require(\"../../client\");\nvar encoding_1 = require(\"../../encoding\");\nvar handleBans_1 = require(\"../../client/handleBans\");\n/**\n * Handles the banned packet\n * this one is sent when you try to reconnect but you're banned\n * @param {Array} args ban reason\n */\nvar handleBD = function (args) {\n (0, handleBans_1.handleBans)(\"Banned\", (0, encoding_1.safeTags)(args[1]));\n (0, client_1.setBanned)(true);\n};\nexports.handleBD = handleBD;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleBN = void 0;\nvar client_1 = require(\"../../client\");\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar encoding_1 = require(\"../../encoding\");\nvar updateBackgroundPreview_1 = require(\"../../dom/updateBackgroundPreview\");\nvar getIndexFromSelect_1 = require(\"../../dom/getIndexFromSelect\");\nvar tryUrls_1 = require(\"../../utils/tryUrls\");\n/**\n * Handles a background change.\n * @param {Array} args packet arguments\n */\nvar handleBN = function (args) {\n var bgFromArgs = (0, encoding_1.safeTags)(args[1]);\n client_1.client.viewport.setBackgroundName(bgFromArgs);\n var bgfolder = client_1.client.viewport.getBackgroundFolder();\n var bg_index = (0, getIndexFromSelect_1.getIndexFromSelect)(\"bg_select\", client_1.client.viewport.getBackgroundName());\n document.getElementById(\"bg_select\").selectedIndex =\n bg_index;\n (0, updateBackgroundPreview_1.updateBackgroundPreview)();\n if (bg_index === 0) {\n document.getElementById(\"bg_filename\").value =\n client_1.client.viewport.getBackgroundName();\n }\n (0, tryUrls_1.default)(\"\".concat(aoHost_1.AO_HOST, \"background/\").concat(encodeURI(args[1].toLowerCase()), \"/defenseempty\")).then(function (resp) {\n document.getElementById(\"bg_preview\").src = resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"defensedesk\")).then(function (resp) {\n document.getElementById(\"client_def_bench\").src =\n resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"stand\")).then(function (resp) {\n document.getElementById(\"client_wit_bench\").src =\n resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"prosecutiondesk\")).then(function (resp) {\n document.getElementById(\"client_pro_bench\").src =\n resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"full\")).then(function (resp) {\n document.getElementById(\"client_court\").src = resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"defenseempty\")).then(function (resp) {\n document.getElementById(\"client_court_def\").src =\n resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"transition_def\")).then(function (resp) {\n document.getElementById(\"client_court_deft\").src =\n resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"witnessempty\")).then(function (resp) {\n document.getElementById(\"client_court_wit\").src =\n resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"transition_pro\")).then(function (resp) {\n document.getElementById(\"client_court_prot\").src =\n resp;\n });\n (0, tryUrls_1.default)(\"\".concat(bgfolder, \"prosecutorempty\")).then(function (resp) {\n document.getElementById(\"client_court_pro\").src =\n resp;\n });\n if (client_1.client.charID === -1) {\n client_1.client.viewport.set_side({\n position: \"jud\",\n showSpeedLines: false,\n showDesk: true,\n });\n }\n else {\n client_1.client.viewport.set_side({\n position: client_1.client.chars[client_1.client.charID].side,\n showSpeedLines: false,\n showDesk: true,\n });\n }\n};\nexports.handleBN = handleBN;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleCC = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * What? you want a character??\n * @param {Array} args packet arguments\n */\nvar handleCC = function (args) {\n client_1.client.sender.sendSelf(\"PV#1#CID#\".concat(args[2], \"#%\"));\n};\nexports.handleCC = handleCC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleCI = void 0;\nvar client_1 = require(\"../../client\");\nvar handleCharacterInfo_1 = require(\"../../client/handleCharacterInfo\");\n/**\n * Handles incoming character information, bundling multiple characters\n * per packet.\n * CI#0#Phoenix&description&&&&#Miles ...\n * @param {Array} args packet arguments\n */\nvar handleCI = function (args) {\n // Loop through the 10 characters that were sent\n document.getElementById(\"client_loadingtext\").innerHTML = \"Loading Character \".concat(args[1], \"/\").concat(client_1.client.char_list_length);\n var _loop_1 = function (i) {\n if (i % 2 === 0) {\n var chargs_1 = args[i].split(\"&\");\n var charid_1 = Number(args[i - 1]);\n setTimeout(function () { return (0, handleCharacterInfo_1.handleCharacterInfo)(chargs_1, charid_1); }, 500);\n }\n };\n for (var i = 2; i <= args.length - 2; i++) {\n _loop_1(i);\n }\n // Request the next pack\n client_1.client.sender.sendServer(\"AN#\".concat(Number(args[1]) / 10 + 1, \"#%\"));\n};\nexports.handleCI = handleCI;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleCT = void 0;\nvar queryParser_1 = require(\"../../utils/queryParser\");\nvar encoding_1 = require(\"../../encoding\");\nvar mode = (0, queryParser_1.default)().mode;\n/**\n * Handles an out-of-character chat message.\n * @param {Array} args packet arguments\n */\nvar handleCT = function (args) {\n if (mode !== \"replay\") {\n var oocLog = document.getElementById(\"client_ooclog\");\n oocLog.innerHTML += \"\".concat((0, encoding_1.prepChat)(args[1]), \": \").concat((0, encoding_1.prepChat)(args[2]), \"\\r\\n\");\n if (oocLog.scrollTop > oocLog.scrollHeight - 600) {\n oocLog.scrollTop = oocLog.scrollHeight;\n }\n }\n};\nexports.handleCT = handleCT;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleCharsCheck = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Handles the list of all used and vacant characters.\n * @param {Array} args list of all characters represented as a 0 for free or a -1 for taken\n */\nvar handleCharsCheck = function (args) {\n for (var i = 0; i < client_1.client.char_list_length; i++) {\n var img = document.getElementById(\"demo_\".concat(i));\n if (args[i + 1] === \"-1\") {\n img.style.opacity = \"0.25\";\n }\n else if (args[i + 1] === \"0\") {\n img.style.opacity = \"1\";\n }\n }\n};\nexports.handleCharsCheck = handleCharsCheck;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleDONE = void 0;\nvar queryParser_1 = require(\"../../utils/queryParser\");\nvar mode = (0, queryParser_1.default)().mode;\n/**\n * Handles the handshake completion packet, meaning the player\n * is ready to select a character.\n *\n * @param {Array} args packet arguments\n */\nvar handleDONE = function (_args) {\n document.getElementById(\"client_loading\").style.display = \"none\";\n if (mode === \"watch\") {\n // Spectators don't need to pick a character\n document.getElementById(\"client_waiting\").style.display = \"none\";\n }\n};\nexports.handleDONE = handleDONE;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleEI = void 0;\nvar client_1 = require(\"../../client\");\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Handles incoming evidence information, containing only one evidence\n * item per packet.\n *\n * EI#id#name&description&type&image&##%\n *\n * @param {Array} args packet arguments\n */\nvar handleEI = function (args) {\n document.getElementById(\"client_loadingtext\").innerHTML = \"Loading Evidence \".concat(args[1], \"/\").concat(client_1.client.evidence_list_length);\n var evidenceID = Number(args[1]);\n var arg = args[2].split(\"&\");\n client_1.client.evidences[evidenceID] = {\n name: (0, encoding_1.prepChat)(arg[0]),\n desc: (0, encoding_1.prepChat)(arg[1]),\n filename: (0, encoding_1.safeTags)(arg[3]),\n icon: \"\".concat(aoHost_1.AO_HOST, \"evidence/\").concat(encodeURI(arg[3].toLowerCase())),\n };\n client_1.client.sender.sendServer(\"AE\" + (evidenceID + 1) + \"#%\");\n};\nexports.handleEI = handleEI;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleEM = void 0;\nvar client_1 = require(\"../../client\");\nvar addTrack_1 = require(\"../../client/addTrack\");\nvar createArea_1 = require(\"../../client/createArea\");\nvar fixLastArea_1 = require(\"../../client/fixLastArea\");\nvar isAudio_1 = require(\"../../client/isAudio\");\n/**\n * Handles incoming music information, containing multiple entries\n * per packet.\n * @param {Array} args packet arguments\n */\nvar handleEM = function (args) {\n document.getElementById(\"client_loadingtext\").innerHTML = \"Loading Music\";\n if (args[1] === \"0\") {\n client_1.client.resetMusicList();\n client_1.client.resetAreaList();\n client_1.client.musics_time = false;\n }\n for (var i = 2; i < args.length - 1; i++) {\n if (i % 2 === 0) {\n var trackname = args[i];\n var trackindex = Number(args[i - 1]);\n if (client_1.client.musics_time) {\n (0, addTrack_1.addTrack)(trackname);\n }\n else if ((0, isAudio_1.isAudio)(trackname)) {\n client_1.client.musics_time = true;\n (0, fixLastArea_1.fix_last_area)();\n (0, addTrack_1.addTrack)(trackname);\n }\n else {\n (0, createArea_1.createArea)(trackindex, trackname);\n }\n }\n }\n // get the next batch of tracks\n client_1.client.sender.sendServer(\"AM#\".concat(Number(args[1]) / 10 + 1, \"#%\"));\n};\nexports.handleEM = handleEM;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleFA = void 0;\nvar client_1 = require(\"../../client\");\nvar createArea_1 = require(\"../../client/createArea\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Handles updated area list\n * @param {Array} args packet arguments\n */\nvar handleFA = function (args) {\n client_1.client.resetAreaList();\n for (var i = 1; i < args.length; i++) {\n (0, createArea_1.createArea)(i - 1, (0, encoding_1.safeTags)(args[i]));\n }\n};\nexports.handleFA = handleFA;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleFL = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * With this the server tells us which features it supports\n * @param {Array} args list of features\n */\nvar handleFL = function (args) {\n console.info(\"Server-supported features:\");\n console.info(args);\n (0, client_1.setExtraFeatures)(args);\n if (args.includes(\"yellowtext\")) {\n var colorselect = (document.getElementById(\"textcolor\"));\n colorselect.options[colorselect.options.length] = new Option(\"Yellow\", \"5\");\n colorselect.options[colorselect.options.length] = new Option(\"Pink\", \"6\");\n colorselect.options[colorselect.options.length] = new Option(\"Cyan\", \"7\");\n colorselect.options[colorselect.options.length] = new Option(\"Grey\", \"8\");\n }\n if (args.includes(\"cccc_ic_support\")) {\n document.getElementById(\"cccc\").style.display = \"\";\n document.getElementById(\"pairing\").style.display = \"\";\n }\n if (args.includes(\"flipping\")) {\n document.getElementById(\"button_flip\").style.display = \"\";\n }\n if (args.includes(\"looping_sfx\")) {\n document.getElementById(\"button_shake\").style.display = \"\";\n document.getElementById(\"2.7\").style.display = \"\";\n }\n if (args.includes(\"effects\")) {\n document.getElementById(\"2.8\").style.display = \"\";\n }\n if (args.includes(\"y_offset\")) {\n document.getElementById(\"y_offset\").style.display = \"\";\n }\n};\nexports.handleFL = handleFL;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleFM = void 0;\nvar client_1 = require(\"../../client\");\nvar addTrack_1 = require(\"../../client/addTrack\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Handles updated music list\n * @param {Array} args packet arguments\n */\nvar handleFM = function (args) {\n client_1.client.resetMusicList();\n for (var i = 1; i < args.length - 1; i++) {\n // Check when found the song for the first time\n (0, addTrack_1.addTrack)((0, encoding_1.safeTags)(args[i]));\n }\n};\nexports.handleFM = handleFM;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleHI = void 0;\nvar client_1 = require(\"../../client\");\nvar version = process.env.npm_package_version;\n/**\n * Handle the player\n * @param {Array} args packet arguments\n */\nvar handleHI = function (_args) {\n client_1.client.sender.sendSelf(\"ID#1#webAO#\".concat(version, \"#%\"));\n client_1.client.sender.sendSelf(\"FL#fastloading#yellowtext#cccc_ic_support#flipping#looping_sfx#effects#%\");\n};\nexports.handleHI = handleHI;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleHP = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Handles a change in the health bars' states.\n * @param {Array} args packet arguments\n */\nvar handleHP = function (args) {\n var percent_hp = Number(args[2]) * 10;\n var healthbox;\n if (args[1] === \"1\") {\n // Def hp\n client_1.client.hp[0] = Number(args[2]);\n healthbox = document.getElementById(\"client_defense_hp\");\n }\n else {\n // Pro hp\n client_1.client.hp[1] = Number(args[2]);\n healthbox = document.getElementById(\"client_prosecutor_hp\");\n }\n (healthbox.getElementsByClassName(\"health-bar\")[0]).style.width = \"\".concat(percent_hp, \"%\");\n};\nexports.handleHP = handleHP;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleID = void 0;\nvar client_1 = require(\"../../client\");\nvar version = process.env.npm_package_version;\n/**\n * Identifies the server and issues a playerID\n * @param {Array} args packet arguments\n */\nvar handleID = function (args) {\n client_1.client.playerID = Number(args[1]);\n var serverSoftware = args[2].split(\"&\")[0];\n var serverVersion;\n if (serverSoftware === \"serverD\") {\n serverVersion = args[2].split(\"&\")[1];\n }\n else if (serverSoftware === \"webAO\") {\n (0, client_1.setOldLoading)(false);\n client_1.client.sender.sendSelf(\"PN#0#1#%\");\n }\n else {\n serverVersion = args[3];\n }\n if (serverSoftware === \"serverD\" && serverVersion === \"1377.152\") {\n (0, client_1.setOldLoading)(true);\n } // bugged version\n if (serverSoftware !== \"webAO\") {\n client_1.client.sender.sendServer(\"ID#webAO#\".concat(version, \"#%\"));\n }\n};\nexports.handleID = handleID;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleJD = void 0;\n/**\n* show/hide judge controls\n* @param {number} show either a 1 or a 0\n*/\nvar handleJD = function (args) {\n if (Number(args[1]) === 1) {\n document.getElementById(\"judge_action\").style.display = \"inline-table\";\n document.getElementById(\"no_action\").style.display = \"none\";\n }\n else {\n document.getElementById(\"judge_action\").style.display = \"none\";\n document.getElementById(\"no_action\").style.display = \"inline-table\";\n }\n};\nexports.handleJD = handleJD;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleKB = void 0;\nvar client_1 = require(\"../../client\");\nvar encoding_1 = require(\"../../encoding\");\nvar handleBans_1 = require(\"../../client/handleBans\");\n/**\n * Handles the banned packet\n * this one is sent when you are kicked off the server\n * @param {Array} args ban reason\n */\nvar handleKB = function (args) {\n (0, handleBans_1.handleBans)(\"Banned\", (0, encoding_1.safeTags)(args[1]));\n (0, client_1.setBanned)(true);\n};\nexports.handleKB = handleKB;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleKK = void 0;\nvar encoding_1 = require(\"../../encoding\");\nvar handleBans_1 = require(\"../../client/handleBans\");\n/**\n * Handles the kicked packet\n * @param {Array} args kick reason\n */\nvar handleKK = function (args) {\n (0, handleBans_1.handleBans)(\"Kicked\", (0, encoding_1.safeTags)(args[1]));\n};\nexports.handleKK = handleKK;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleLE = void 0;\nvar client_1 = require(\"../../client\");\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Handles incoming evidence list, all evidences at once\n * item per packet.\n *\n * @param {Array} args packet arguments\n */\nvar handleLE = function (args) {\n client_1.client.evidences = [];\n for (var i = 1; i < args.length - 1; i++) {\n var arg = args[i].split(\"&\");\n client_1.client.evidences[i - 1] = {\n name: (0, encoding_1.prepChat)(arg[0]),\n desc: (0, encoding_1.prepChat)(arg[1]),\n filename: (0, encoding_1.safeTags)(arg[2]),\n icon: \"\".concat(aoHost_1.AO_HOST, \"evidence/\").concat(encodeURI(arg[2].toLowerCase())),\n };\n }\n var evidence_box = document.getElementById(\"evidences\");\n evidence_box.innerHTML = \"\";\n var _loop_1 = function (i) {\n var evi_item = new Image();\n evi_item.id = \"evi_\" + i;\n evi_item.className = \"evi_icon\";\n evi_item.src = client_1.client.evidences[i - 1].icon;\n evi_item.alt = client_1.client.evidences[i - 1].name;\n evi_item.onclick = function () { window.pickEvidence(i); };\n evidence_box.appendChild(evi_item);\n };\n for (var i = 1; i <= client_1.client.evidences.length; i++) {\n _loop_1(i);\n }\n};\nexports.handleLE = handleLE;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleMC = void 0;\nvar encoding_1 = require(\"../../encoding\");\nvar client_1 = require(\"../../client\");\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar appendICLog_1 = require(\"../../client/appendICLog\");\n/**\n * Handles a music change to an arbitrary resource.\n * @param {Array} args packet arguments\n */\nvar handleMC = function (args) {\n var track = (0, encoding_1.prepChat)(args[1]);\n var charID = Number(args[2]);\n var showname = args[3] || \"\";\n var looping = Boolean(args[4]);\n var channel = Number(args[5]) || 0;\n // const fading = Number(args[6]) || 0; // unused in web\n var music = client_1.client.viewport.music[channel];\n var musicname;\n music.pause();\n if (track.startsWith(\"http\")) {\n music.src = track;\n }\n else {\n music.src = \"\".concat(aoHost_1.AO_HOST, \"sounds/music/\").concat(encodeURI(track.toLowerCase()));\n }\n music.loop = looping;\n music.play();\n try {\n musicname = client_1.client.chars[charID].name;\n }\n catch (e) {\n charID = -1;\n }\n if (charID >= 0) {\n musicname = client_1.client.chars[charID].name;\n (0, appendICLog_1.appendICLog)(\"\".concat(musicname, \" changed music to \").concat(track));\n }\n else {\n (0, appendICLog_1.appendICLog)(\"The music was changed to \".concat(track));\n }\n document.getElementById(\"client_trackstatustext\").innerText = track;\n};\nexports.handleMC = handleMC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleMM = void 0;\n/**\n * Handles the \"MusicMode\" packet\n * @param {Array} args packet arguments\n */\nvar handleMM = function (_args) {\n // It's unused nowadays, as preventing people from changing the music is now serverside\n};\nexports.handleMM = handleMM;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleMS = void 0;\nvar client_1 = require(\"../../client\");\nvar handleCharacterInfo_1 = require(\"../../client/handleCharacterInfo\");\nvar resetICParams_1 = require(\"../../client/resetICParams\");\nvar encoding_1 = require(\"../../encoding\");\nvar handleICSpeaking_1 = require(\"../../viewport/utils/handleICSpeaking\");\n/**\n * Handles an in-character chat message.\n * @param {*} args packet arguments\n */\nvar handleMS = function (args) {\n // TODO: this if-statement might be a bug.\n if (args[4] !== client_1.client.viewport.getChatmsg().content) {\n document.getElementById(\"client_inner_chat\").innerHTML = \"\";\n var char_id = Number(args[9]);\n var char_name = (0, encoding_1.safeTags)(args[3]);\n var msg_nameplate = args[3];\n var msg_blips = \"male\";\n var char_chatbox = \"default\";\n var char_muted = false;\n if (char_id < client_1.client.char_list_length && char_id >= 0) {\n if (client_1.client.chars[char_id].name !== char_name) {\n console.info(\"\".concat(client_1.client.chars[char_id].name, \" is iniediting to \").concat(char_name));\n var chargs = (\"\".concat(char_name, \"&\") + \"iniediter\").split(\"&\");\n (0, handleCharacterInfo_1.handleCharacterInfo)(chargs, char_id);\n }\n }\n try {\n msg_nameplate = client_1.client.chars[char_id].showname;\n }\n catch (e) {\n msg_nameplate = args[3];\n }\n try {\n msg_blips = client_1.client.chars[char_id].blips;\n }\n catch (e) { }\n try {\n char_chatbox = client_1.client.chars[char_id].chat;\n }\n catch (e) {\n char_chatbox = \"default\";\n }\n try {\n char_muted = client_1.client.chars[char_id].muted;\n }\n catch (e) {\n char_muted = false;\n console.error(\"we're still missing some character data\");\n }\n if (char_muted === false) {\n var chatmsg = {\n deskmod: Number((0, encoding_1.safeTags)(args[1]).toLowerCase()),\n preanim: (0, encoding_1.safeTags)(args[2]).toLowerCase(),\n nameplate: msg_nameplate,\n chatbox: char_chatbox,\n name: char_name,\n sprite: (0, encoding_1.safeTags)(args[4]).toLowerCase(),\n content: (0, encoding_1.prepChat)(args[5]),\n side: args[6].toLowerCase(),\n sound: (0, encoding_1.safeTags)(args[7]).toLowerCase(),\n blips: (0, encoding_1.safeTags)(msg_blips),\n type: Number(args[8]),\n charid: char_id,\n snddelay: Number(args[10]),\n objection: Number(args[11]),\n evidence: Number((0, encoding_1.safeTags)(args[12])),\n flip: Number(args[13]),\n flash: Number(args[14]),\n color: Number(args[15]),\n speed: client_1.UPDATE_INTERVAL,\n };\n if (args.length > 16) {\n var extra_cccc = {\n showname: (0, encoding_1.prepChat)(args[16]),\n other_charid: Number(args[17]),\n other_name: (0, encoding_1.safeTags)(args[18]),\n other_emote: (0, encoding_1.safeTags)(args[19]),\n self_offset: args[20].split(\"\"),\n other_offset: args[21].split(\"\"),\n other_flip: Number(args[22]),\n noninterrupting_preanim: Number(args[23]),\n };\n chatmsg = Object.assign(extra_cccc, chatmsg);\n if (args.length > 24) {\n var extra_27 = {\n looping_sfx: Number(args[24]),\n screenshake: Number(args[25]),\n frame_screenshake: (0, encoding_1.safeTags)(args[26]),\n frame_realization: (0, encoding_1.safeTags)(args[27]),\n frame_sfx: (0, encoding_1.safeTags)(args[28]),\n };\n chatmsg = Object.assign(extra_27, chatmsg);\n if (args.length > 29) {\n var extra_28 = {\n additive: Number(args[29]),\n effects: args[30].split(\"|\"),\n };\n chatmsg = Object.assign(extra_28, chatmsg);\n }\n else {\n var extra_28 = {\n additive: 0,\n effects: [\"\", \"\", \"\"],\n };\n chatmsg = Object.assign(extra_28, chatmsg);\n }\n }\n else {\n var extra_27 = {\n looping_sfx: 0,\n screenshake: 0,\n frame_screenshake: \"\",\n frame_realization: \"\",\n frame_sfx: \"\",\n };\n chatmsg = Object.assign(extra_27, chatmsg);\n var extra_28 = {\n additive: 0,\n effects: [\"\", \"\", \"\"],\n };\n chatmsg = Object.assign(extra_28, chatmsg);\n }\n }\n else {\n var extra_cccc = {\n showname: \"\",\n other_charid: 0,\n other_name: \"\",\n other_emote: \"\",\n self_offset: [0, 0],\n other_offset: [0, 0],\n other_flip: 0,\n noninterrupting_preanim: 0,\n };\n chatmsg = Object.assign(extra_cccc, chatmsg);\n var extra_27 = {\n looping_sfx: 0,\n screenshake: 0,\n frame_screenshake: \"\",\n frame_realization: \"\",\n frame_sfx: \"\",\n };\n chatmsg = Object.assign(extra_27, chatmsg);\n var extra_28 = {\n additive: 0,\n effects: [\"\", \"\", \"\"],\n };\n chatmsg = Object.assign(extra_28, chatmsg);\n }\n if (chatmsg.content.trim() === \"\") {\n //blankpost\n chatmsg.content = \"\";\n }\n // our own message appeared, reset the buttons\n if (chatmsg.charid === client_1.client.charID) {\n (0, resetICParams_1.resetICParams)();\n }\n (0, handleICSpeaking_1.handle_ic_speaking)(chatmsg); // no await\n }\n }\n};\nexports.handleMS = handleMS;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handlePN = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Indicates how many users are on this server\n * @param {Array} args packet arguments\n */\nvar handlePN = function (_args) {\n client_1.client.sender.sendServer(\"askchaa#%\");\n};\nexports.handlePN = handlePN;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handlePV = void 0;\nvar client_1 = require(\"../../client\");\nvar fileExists_1 = require(\"../../utils/fileExists\");\nvar updateActionCommands_1 = require(\"../../dom/updateActionCommands\");\nvar pickEmotion_1 = require(\"../../dom/pickEmotion\");\nvar aoHost_1 = require(\"../../client/aoHost\");\n/**\n * Handles the server's assignment of a character for the player to use.\n * PV # playerID (unused) # CID # character ID\n * @param {Array} args packet arguments\n */\nvar handlePV = function (args) { return __awaiter(void 0, void 0, void 0, function () {\n var me, emotes, emotesList, ini, _loop_1, i;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n client_1.client.charID = Number(args[3]);\n document.getElementById(\"client_waiting\").style.display = \"none\";\n document.getElementById(\"client_charselect\").style.display = \"none\";\n me = client_1.client.chars[client_1.client.charID];\n client_1.client.selectedEmote = -1;\n emotes = client_1.client.emotes;\n emotesList = document.getElementById(\"client_emo\");\n emotesList.style.display = \"\";\n emotesList.innerHTML = \"\"; // Clear emote box\n ini = me.inifile;\n me.side = ini.options.side;\n (0, updateActionCommands_1.updateActionCommands)(me.side);\n if (ini.emotions.number === 0) {\n emotesList.innerHTML = \"No emotes available\";\n }\n else {\n _loop_1 = function (i) {\n try {\n var emoteinfo = ini.emotions[i].split(\"#\");\n var esfx = void 0;\n var esfxd = void 0;\n try {\n esfx = ini.soundn[i] || \"0\";\n esfxd = Number(ini.soundt[i]) || 0;\n }\n catch (e) {\n console.warn(\"ini sound is completly missing\");\n esfx = \"0\";\n esfxd = 0;\n }\n // Make sure the asset server is case insensitive, or that everything on it is lowercase\n emotes[i] = {\n desc: emoteinfo[0].toLowerCase(),\n preanim: emoteinfo[1].toLowerCase(),\n emote: emoteinfo[2].toLowerCase(),\n zoom: Number(emoteinfo[3]) || 0,\n deskmod: Number(emoteinfo[4]) || 1,\n sfx: esfx.toLowerCase(),\n sfxdelay: esfxd,\n frame_screenshake: \"\",\n frame_realization: \"\",\n frame_sfx: \"\",\n button: \"\".concat(aoHost_1.AO_HOST, \"characters/\").concat(encodeURI(me.name.toLowerCase()), \"/emotions/button\").concat(i, \"_off.png\"),\n };\n var emote_item = new Image();\n emote_item.id = \"emo_\" + i;\n emote_item.className = \"emote_button\";\n emote_item.src = emotes[i].button;\n emote_item.alt = emotes[i].desc;\n emote_item.title = emotes[i].desc;\n emote_item.onclick = function () { window.pickEmotion(i); };\n emotesList.appendChild(emote_item);\n }\n catch (e) {\n console.error(\"missing emote \".concat(i));\n }\n };\n for (i = 1; i <= ini.emotions.number; i++) {\n _loop_1(i);\n }\n (0, pickEmotion_1.pickEmotion)(1);\n }\n return [4 /*yield*/, (0, fileExists_1.default)(\"\".concat(aoHost_1.AO_HOST, \"characters/\").concat(encodeURI(me.name.toLowerCase()), \"/custom.gif\"))];\n case 1:\n if (_a.sent()) {\n document.getElementById(\"button_4\").style.display = \"\";\n }\n else {\n document.getElementById(\"button_4\").style.display = \"none\";\n }\n return [2 /*return*/];\n }\n });\n}); };\nexports.handlePV = handlePV;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleRC = void 0;\nvar client_1 = require(\"../../client\");\nvar characters_js_1 = require(\"../../constants/characters.js\");\n/**\n * we are asking ourselves what characters there are\n * @param {Array} args packet arguments\n */\nvar handleRC = function (_args) {\n client_1.client.sender.sendSelf(\"SC#\".concat(characters_js_1.default.join(\"#\"), \"#%\"));\n};\nexports.handleRC = handleRC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleRD = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * we are asking ourselves what characters there are\n * @param {Array} args packet arguments\n */\nvar handleRD = function (_args) {\n client_1.client.sender.sendSelf(\"BN#gs4#%\");\n client_1.client.sender.sendSelf(\"DONE#%\");\n var ooclog = document.getElementById(\"client_ooclog\");\n ooclog.value = \"\";\n ooclog.readOnly = false;\n document.getElementById(\"client_oocinput\").style.display = \"none\";\n document.getElementById(\"client_replaycontrols\").style.display =\n \"inline-block\";\n};\nexports.handleRD = handleRD;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleRM = void 0;\nvar client_1 = require(\"../../client\");\nvar music_js_1 = require(\"../../constants/music.js\");\n/**\n * we are asking ourselves what characters there are\n * @param {Array} args packet arguments\n */\nvar handleRM = function (_args) {\n client_1.client.sender.sendSelf(\"SM#\".concat(music_js_1.default.join(\"#\"), \"#%\"));\n};\nexports.handleRM = handleRM;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleRMC = void 0;\nvar client_1 = require(\"../../client\");\n// TODO BUG:\n// this.viewport.music is an array. Therefore you must access elements\n/**\n * Handles a music change to an arbitrary resource, with an offset in seconds.\n * @param {Array} args packet arguments\n */\nvar handleRMC = function (args) {\n client_1.client.viewport.music.pause();\n var music = client_1.client.viewport.music;\n // Music offset + drift from song loading\n music.totime = args[1];\n music.offset = new Date().getTime() / 1000;\n music.addEventListener(\"loadedmetadata\", function () {\n music.currentTime += parseFloat(music.totime + (new Date().getTime() / 1000 - music.offset)).toFixed(3);\n music.play();\n }, false);\n};\nexports.handleRMC = handleRMC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleRT = void 0;\nvar client_1 = require(\"../../client\");\nvar initTestimonyUpdater_1 = require(\"../../viewport/utils/initTestimonyUpdater\");\n/**\n * Handles a testimony states.\n * @param {Array} args packet arguments\n */\nvar handleRT = function (args) {\n var judgeid = Number(args[2]);\n switch (args[1]) {\n case \"testimony1\":\n client_1.client.testimonyID = 1;\n break;\n case \"testimony2\":\n // Cross Examination\n client_1.client.testimonyID = 2;\n break;\n case \"judgeruling\":\n client_1.client.testimonyID = 3 + judgeid;\n break;\n default:\n console.warn(\"Invalid testimony\");\n }\n (0, initTestimonyUpdater_1.initTestimonyUpdater)();\n};\nexports.handleRT = handleRT;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleSC = void 0;\nvar queryParser_1 = require(\"../../utils/queryParser\");\nvar client_1 = require(\"../../client\");\nvar handleCharacterInfo_1 = require(\"../../client/handleCharacterInfo\");\nvar mode = (0, queryParser_1.default)().mode;\n/**\n * Handles incoming character information, containing all characters\n * in one packet.\n * @param {Array} args packet arguments\n */\nvar handleSC = function (args) { return __awaiter(void 0, void 0, void 0, function () {\n var _loop_1, i;\n return __generator(this, function (_a) {\n if (mode === \"watch\") {\n // Spectators don't need to pick a character\n document.getElementById(\"client_charselect\").style.display = \"none\";\n }\n else {\n document.getElementById(\"client_charselect\").style.display = \"block\";\n }\n document.getElementById(\"client_loadingtext\").innerHTML =\n \"Loading Characters\";\n _loop_1 = function (i) {\n var chargs = args[i].split(\"&\");\n var charid = i - 1;\n setTimeout(function () { return (0, handleCharacterInfo_1.handleCharacterInfo)(chargs, charid); }, charid * 6);\n };\n for (i = 1; i < args.length - 1; i++) {\n _loop_1(i);\n }\n // We're done with the characters, request the music\n client_1.client.sender.sendServer(\"RM#%\");\n return [2 /*return*/];\n });\n}); };\nexports.handleSC = handleSC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleSI = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Received when the server announces its server info,\n * but we use it as a cue to begin retrieving characters.\n * @param {Array} args packet arguments\n */\nvar handleSI = function (args) {\n client_1.client.char_list_length = Number(args[1]);\n client_1.client.char_list_length += 1; // some servers count starting from 0 some from 1...\n client_1.client.evidence_list_length = Number(args[2]);\n client_1.client.music_list_length = Number(args[3]);\n // create the charselect grid, to be filled by the character loader\n document.getElementById(\"client_chartable\").innerHTML = \"\";\n for (var i = 0; i < client_1.client.char_list_length; i++) {\n var demothing = document.createElement(\"img\");\n demothing.className = \"demothing\";\n demothing.id = \"demo_\".concat(i);\n var demoonclick = document.createAttribute(\"onclick\");\n demoonclick.value = \"pickChar(\".concat(i, \")\");\n demothing.setAttributeNode(demoonclick);\n document.getElementById(\"client_chartable\").appendChild(demothing);\n }\n // this is determined at the top of this file\n if (!client_1.oldLoading && client_1.extrafeatures.includes(\"fastloading\")) {\n client_1.client.sender.sendServer(\"RC#%\");\n }\n else {\n client_1.client.sender.sendServer(\"askchar2#%\");\n }\n};\nexports.handleSI = handleSI;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleSM = void 0;\nvar client_1 = require(\"../../client\");\nvar addTrack_1 = require(\"../../client/addTrack\");\nvar isAudio_1 = require(\"../../client/isAudio\");\nvar fixLastArea_1 = require(\"../../client/fixLastArea\");\nvar createArea_1 = require(\"../../client/createArea\");\n/**\n * Handles incoming music information, containing all music in one packet.\n * @param {Array} args packet arguments\n */\nvar handleSM = function (args) {\n document.getElementById(\"client_loadingtext\").innerHTML = \"Loading Music \";\n client_1.client.resetMusicList();\n client_1.client.resetAreaList();\n client_1.client.musics_time = false;\n document.getElementById(\"client_loadingtext\").innerHTML = \"Loading Music\";\n for (var i = 1; i < args.length - 1; i++) {\n // Check when found the song for the first time\n var trackname = args[i];\n var trackindex = i - 1;\n if (client_1.client.musics_time) {\n (0, addTrack_1.addTrack)(trackname);\n }\n else if ((0, isAudio_1.isAudio)(trackname)) {\n client_1.client.musics_time = true;\n (0, fixLastArea_1.fix_last_area)();\n (0, addTrack_1.addTrack)(trackname);\n }\n else {\n (0, createArea_1.createArea)(trackindex, trackname);\n }\n }\n // Music done, carry on\n client_1.client.sender.sendServer(\"RD#%\");\n};\nexports.handleSM = handleSM;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleSP = void 0;\nvar updateActionCommands_1 = require(\"../../dom/updateActionCommands\");\n/**\n* position change\n* @param {string} pos new position\n*/\nvar handleSP = function (args) {\n (0, updateActionCommands_1.updateActionCommands)(args[1]);\n};\nexports.handleSP = handleSP;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleTI = void 0;\n/**\n * Handles a timer update\n * @param {Array} args packet arguments\n */\nvar handleTI = function (args) {\n var timerid = Number(args[1]);\n var type = Number(args[2]);\n var timer_value = args[3];\n switch (type) {\n case 0:\n //\n case 1:\n document.getElementById(\"client_timer\".concat(timerid)).innerText =\n timer_value;\n case 2:\n document.getElementById(\"client_timer\".concat(timerid)).style.display = \"\";\n case 3:\n document.getElementById(\"client_timer\".concat(timerid)).style.display =\n \"none\";\n }\n};\nexports.handleTI = handleTI;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleZZ = void 0;\nvar client_1 = require(\"../../client\");\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar encoding_1 = require(\"../../encoding\");\n/**\n * Handles a modcall\n * @param {Array} args packet arguments\n */\nvar handleZZ = function (args) {\n var oocLog = document.getElementById(\"client_ooclog\");\n oocLog.innerHTML += \"$Alert: \".concat((0, encoding_1.prepChat)(args[1]), \"\\r\\n\");\n if (oocLog.scrollTop > oocLog.scrollHeight - 60) {\n oocLog.scrollTop = oocLog.scrollHeight;\n }\n client_1.client.viewport.getSfxAudio().pause();\n var oldvolume = client_1.client.viewport.getSfxAudio().volume;\n client_1.client.viewport.getSfxAudio().volume = 1;\n client_1.client.viewport.getSfxAudio().src = \"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-gallery.opus\");\n client_1.client.viewport.getSfxAudio().play();\n client_1.client.viewport.getSfxAudio().volume = oldvolume;\n};\nexports.handleZZ = handleZZ;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleackMS = void 0;\nvar resetICParams_1 = require(\"../../client/resetICParams\");\n/**\n* server got our message\n*/\nvar handleackMS = function () {\n (0, resetICParams_1.resetICParams)();\n};\nexports.handleackMS = handleackMS;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handleaskchaa = void 0;\nvar client_1 = require(\"../../client\");\nvar characters_js_1 = require(\"../../constants/characters.js\");\n/**\n * What? you want a character list from me??\n * @param {Array} args packet arguments\n */\nvar handleaskchaa = function (_args) {\n client_1.client.sender.sendSelf(\"SI#\".concat(characters_js_1.default.length, \"#0#0#%\"));\n};\nexports.handleaskchaa = handleaskchaa;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.packetHandler = void 0;\nvar packets_1 = require(\"./packets\");\nexports.packetHandler = new Map(Object.entries(packets_1.packets));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.packets = void 0;\nvar handleMS_1 = require(\"./handlers/handleMS\");\nvar handleCT_1 = require(\"./handlers/handleCT\");\nvar handleMC_1 = require(\"./handlers/handleMC\");\nvar handleRMC_1 = require(\"./handlers/handleRMC\");\nvar twofactor_1 = require(\"../dom/twofactor\");\nvar handleFL_1 = require(\"./handlers/handleFL\");\nvar handleLE_1 = require(\"./handlers/handleLE\");\nvar handleEM_1 = require(\"./handlers/handleEM\");\nvar handleEI_1 = require(\"./handlers/handleEI\");\nvar handleSC_1 = require(\"./handlers/handleSC\");\nvar handleCI_1 = require(\"./handlers/handleCI\");\nvar handleFM_1 = require(\"./handlers/handleFM\");\nvar handleFA_1 = require(\"./handlers/handleFA\");\nvar handleSM_1 = require(\"./handlers/handleSM\");\nvar handleMM_1 = require(\"./handlers/handleMM\");\nvar handleBD_1 = require(\"./handlers/handleBD\");\nvar handleBB_1 = require(\"./handlers/handleBB\");\nvar handleKB_1 = require(\"./handlers/handleKB\");\nvar handleKK_1 = require(\"./handlers/handleKK\");\nvar handleDONE_1 = require(\"./handlers/handleDONE\");\nvar handleBN_1 = require(\"./handlers/handleBN\");\nvar handleHP_1 = require(\"./handlers/handleHP\");\nvar handleRT_1 = require(\"./handlers/handleRT\");\nvar handleTI_1 = require(\"./handlers/handleTI\");\nvar handleZZ_1 = require(\"./handlers/handleZZ\");\nvar handleHI_1 = require(\"./handlers/handleHI\");\nvar handleID_1 = require(\"./handlers/handleID\");\nvar handlePN_1 = require(\"./handlers/handlePN\");\nvar handleSI_1 = require(\"./handlers/handleSI\");\nvar handleARUP_1 = require(\"./handlers/handleARUP\");\nvar handleaskchaa_1 = require(\"./handlers/handleaskchaa\");\nvar handleCC_1 = require(\"./handlers/handleCC\");\nvar handleRC_1 = require(\"./handlers/handleRC\");\nvar handleRM_1 = require(\"./handlers/handleRM\");\nvar handleRD_1 = require(\"./handlers/handleRD\");\nvar handleCharsCheck_1 = require(\"./handlers/handleCharsCheck\");\nvar handlePV_1 = require(\"./handlers/handlePV\");\nvar handleASS_1 = require(\"./handlers/handleASS\");\nvar handleackMS_1 = require(\"./handlers/handleackMS\");\nvar handleSP_1 = require(\"./handlers/handleSP\");\nvar handleJD_1 = require(\"./handlers/handleJD\");\nexports.packets = {\n \"MS\": handleMS_1.handleMS,\n \"CT\": handleCT_1.handleCT,\n \"MC\": handleMC_1.handleMC,\n \"RMC\": handleRMC_1.handleRMC,\n \"CI\": handleCI_1.handleCI,\n \"SC\": handleSC_1.handleSC,\n \"EI\": handleEI_1.handleEI,\n \"2A\": twofactor_1.showFactorDialog,\n \"FL\": handleFL_1.handleFL,\n \"LE\": handleLE_1.handleLE,\n \"EM\": handleEM_1.handleEM,\n \"FM\": handleFM_1.handleFM,\n \"FA\": handleFA_1.handleFA,\n \"SM\": handleSM_1.handleSM,\n \"MM\": handleMM_1.handleMM,\n \"BD\": handleBD_1.handleBD,\n \"BB\": handleBB_1.handleBB,\n \"KB\": handleKB_1.handleKB,\n \"KK\": handleKK_1.handleKK,\n \"DONE\": handleDONE_1.handleDONE,\n \"BN\": handleBN_1.handleBN,\n \"HP\": handleHP_1.handleHP,\n \"RT\": handleRT_1.handleRT,\n \"TI\": handleTI_1.handleTI,\n \"ZZ\": handleZZ_1.handleZZ,\n \"HI\": handleHI_1.handleHI,\n \"ID\": handleID_1.handleID,\n \"PN\": handlePN_1.handlePN,\n \"SI\": handleSI_1.handleSI,\n \"ARUP\": handleARUP_1.handleARUP,\n \"askchaa\": handleaskchaa_1.handleaskchaa,\n \"CC\": handleCC_1.handleCC,\n \"RC\": handleRC_1.handleRC,\n \"RM\": handleRM_1.handleRM,\n \"RD\": handleRD_1.handleRD,\n \"CharsCheck\": handleCharsCheck_1.handleCharsCheck,\n \"PV\": handlePV_1.handlePV,\n \"ASS\": handleASS_1.handleASS,\n \"ackMS\": handleackMS_1.handleackMS,\n \"SP\": handleSP_1.handleSP,\n \"JD\": handleJD_1.handleJD,\n \"decryptor\": function () { },\n \"CHECK\": function () { },\n \"CH\": function () { },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar downloadFile = function (content, filename) {\n var a = document.createElement('a');\n var file = new Blob([content], { type: 'text' });\n a.href = URL.createObjectURL(file);\n a.download = filename;\n a.click();\n};\nexports.default = downloadFile;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar request_1 = require(\"../services/request\");\nvar aomlParser = function (text) {\n var e_1, _a;\n var parsed = {};\n var currentHeader = '';\n try {\n for (var _b = __values(text.split(/\\r?\\n/)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var line = _c.value;\n if (line === '') {\n currentHeader = '';\n continue;\n }\n var content = line.split(' = ');\n var contentName = content[0];\n var contentValue = content[1];\n if (currentHeader === '') {\n currentHeader = contentName;\n parsed[currentHeader] = {\n color: contentValue\n };\n }\n else {\n var contentKey = contentName.split('_')[1];\n parsed[currentHeader][contentKey] = contentValue;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return parsed;\n};\nvar mlConfig = function (AO_HOST) {\n var defaultUrl = \"\".concat(AO_HOST, \"themes/default/chat_config.ini\");\n var aomlParsed = (0, request_1.default)(defaultUrl).then(function (data) { return aomlParser(data); });\n var createIdentifiers = function () { return __awaiter(void 0, void 0, void 0, function () {\n var identifiers, _a, _b, _c, _d, _e, ruleName, value, e_2_1;\n var e_2, _f;\n return __generator(this, function (_g) {\n switch (_g.label) {\n case 0:\n identifiers = new Map();\n _g.label = 1;\n case 1:\n _g.trys.push([1, 6, 7, 8]);\n _d = (_c = Object).entries;\n return [4 /*yield*/, aomlParsed];\n case 2:\n _a = __values.apply(void 0, [_d.apply(_c, [_g.sent()])]), _b = _a.next();\n _g.label = 3;\n case 3:\n if (!!_b.done) return [3 /*break*/, 5];\n _e = __read(_b.value, 2), ruleName = _e[0], value = _e[1];\n if (value.start && value.end) {\n identifiers.set(value.start, value);\n identifiers.set(value.end, value);\n }\n _g.label = 4;\n case 4:\n _b = _a.next();\n return [3 /*break*/, 3];\n case 5: return [3 /*break*/, 8];\n case 6:\n e_2_1 = _g.sent();\n e_2 = { error: e_2_1 };\n return [3 /*break*/, 8];\n case 7:\n try {\n if (_b && !_b.done && (_f = _a.return)) _f.call(_a);\n }\n finally { if (e_2) throw e_2.error; }\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/, identifiers];\n }\n });\n }); };\n var createStartIdentifiers = function () { return __awaiter(void 0, void 0, void 0, function () {\n var startingIdentifiers, _a, _b, _c, _d, _e, ruleName, value, e_3_1;\n var e_3, _f;\n return __generator(this, function (_g) {\n switch (_g.label) {\n case 0:\n startingIdentifiers = new Set();\n _g.label = 1;\n case 1:\n _g.trys.push([1, 6, 7, 8]);\n _d = (_c = Object).entries;\n return [4 /*yield*/, aomlParsed];\n case 2:\n _a = __values.apply(void 0, [_d.apply(_c, [_g.sent()])]), _b = _a.next();\n _g.label = 3;\n case 3:\n if (!!_b.done) return [3 /*break*/, 5];\n _e = __read(_b.value, 2), ruleName = _e[0], value = _e[1];\n if ((value === null || value === void 0 ? void 0 : value.start) && (value === null || value === void 0 ? void 0 : value.end)) {\n startingIdentifiers.add(value.start);\n }\n _g.label = 4;\n case 4:\n _b = _a.next();\n return [3 /*break*/, 3];\n case 5: return [3 /*break*/, 8];\n case 6:\n e_3_1 = _g.sent();\n e_3 = { error: e_3_1 };\n return [3 /*break*/, 8];\n case 7:\n try {\n if (_b && !_b.done && (_f = _a.return)) _f.call(_a);\n }\n finally { if (e_3) throw e_3.error; }\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/, startingIdentifiers];\n }\n });\n }); };\n var applyMarkdown = function (text, defaultColor) { return __awaiter(void 0, void 0, void 0, function () {\n var identifiers, startIdentifiers, closingStack, colorStack, output, text_1, text_1_1, letter, currentSelector, currentIdentifier, currentClosingLetter, keepChar, r, g, b, currentColor, color, r, g, b, currentColor, r, g, b, currentColor;\n var e_4, _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, createIdentifiers()];\n case 1:\n identifiers = _b.sent();\n return [4 /*yield*/, createStartIdentifiers()];\n case 2:\n startIdentifiers = _b.sent();\n closingStack = [];\n colorStack = [];\n output = [];\n try {\n for (text_1 = __values(text), text_1_1 = text_1.next(); !text_1_1.done; text_1_1 = text_1.next()) {\n letter = text_1_1.value;\n currentSelector = document.createElement('span');\n currentIdentifier = identifiers.get(letter);\n currentClosingLetter = closingStack[closingStack.length - 1];\n keepChar = Number(currentIdentifier === null || currentIdentifier === void 0 ? void 0 : currentIdentifier.remove) === 0;\n if (currentClosingLetter === letter) {\n r = colorStack[colorStack.length - 1][0];\n g = colorStack[colorStack.length - 1][1];\n b = colorStack[colorStack.length - 1][2];\n currentColor = \"color: rgb(\".concat(r, \",\").concat(g, \",\").concat(b, \");\");\n currentSelector.setAttribute('style', currentColor);\n closingStack.pop();\n colorStack.pop();\n if (keepChar) {\n currentSelector.innerHTML = letter;\n }\n }\n else if (startIdentifiers.has(letter)) {\n color = identifiers.get(letter).color.split(',');\n r = color[0];\n g = color[1];\n b = color[2];\n colorStack.push([r, g, b]);\n closingStack.push(currentIdentifier.end);\n currentColor = \"color: rgb(\".concat(r, \",\").concat(g, \",\").concat(b, \");\");\n currentSelector.setAttribute('style', currentColor);\n if (keepChar) {\n currentSelector.innerHTML = letter;\n }\n }\n else {\n currentSelector.innerHTML = letter;\n if (colorStack.length === 0) {\n currentSelector.className = \"text_\".concat(defaultColor);\n }\n else {\n r = colorStack[colorStack.length - 1][0];\n g = colorStack[colorStack.length - 1][1];\n b = colorStack[colorStack.length - 1][2];\n currentColor = \"color: rgb(\".concat(r, \",\").concat(g, \",\").concat(b, \");\");\n currentSelector.setAttribute('style', currentColor);\n }\n }\n output.push(currentSelector);\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (text_1_1 && !text_1_1.done && (_a = text_1.return)) _a.call(text_1);\n }\n finally { if (e_4) throw e_4.error; }\n }\n return [2 /*return*/, output];\n }\n });\n }); };\n return {\n applyMarkdown: applyMarkdown\n };\n};\nexports.default = mlConfig;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * read a cookie from storage\n * got this from w3schools\n * https://www.w3schools.com/js/js_cookies.asp\n * @param {String} cname The name of the cookie to return\n */\nvar getCookie = function (cname) {\n try {\n var name_1 = \"\".concat(cname, \"=\");\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) === ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name_1) === 0) {\n return c.substring(name_1.length, c.length);\n }\n }\n return '';\n }\n catch (error) {\n return '';\n }\n};\nexports.default = getCookie;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getFilenameFromPath = void 0;\nvar getFilenameFromPath = function (path) { return path.substring(path.lastIndexOf('/') + 1); };\nexports.getFilenameFromPath = getFilenameFromPath;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryParser = function () {\n var queryDict = {};\n location.search\n .substr(1)\n .split(\"&\")\n .forEach(function (item) {\n queryDict[item.split(\"=\")[0]] = item.split(\"=\")[1];\n });\n return queryDict;\n};\nexports.default = queryParser;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * set a cookie\n * the version from w3schools expects these to expire\n * @param {String} cname The name of the cookie to return\n * @param {any} value The value of that cookie option\n */\nvar setCookie = function (cname, value) {\n document.cookie = \"\".concat(cname, \"=\").concat(value, \";SameSite=Strict\");\n};\nexports.default = setCookie;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar fileExists_1 = require(\"./fileExists\");\nvar transparentPng_1 = require(\"../constants/transparentPng\");\nvar urlExtensionsToTry = [\n '.png',\n '.gif',\n '.webp',\n '.apng'\n];\nvar tryUrls = function (url) { return __awaiter(void 0, void 0, void 0, function () {\n var i, extension, fullFileUrl, exists;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < urlExtensionsToTry.length)) return [3 /*break*/, 4];\n extension = urlExtensionsToTry[i];\n fullFileUrl = url + extension;\n return [4 /*yield*/, (0, fileExists_1.default)(fullFileUrl)];\n case 2:\n exists = _a.sent();\n if (exists) {\n return [2 /*return*/, fullFileUrl];\n }\n _a.label = 3;\n case 3:\n i++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/, transparentPng_1.default];\n }\n });\n}); };\nexports.default = tryUrls;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.COLORS = void 0;\nexports.COLORS = [\n \"white\",\n \"green\",\n \"red\",\n \"orange\",\n \"blue\",\n \"yellow\",\n \"pink\",\n \"cyan\",\n \"grey\",\n \"rainbow\",\n];\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultChatMsg = void 0;\nvar client_1 = require(\"../../client\");\nexports.defaultChatMsg = {\n content: \"\",\n objection: 0,\n sound: \"\",\n startpreanim: true,\n startspeaking: false,\n side: null,\n color: 0,\n snddelay: 0,\n preanimdelay: 0,\n speed: client_1.UPDATE_INTERVAL,\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.positions = void 0;\nexports.positions = {\n def: {\n bg: \"defenseempty\",\n desk: { ao2: \"defensedesk.png\", ao1: \"bancodefensa.png\" },\n speedLines: \"defense_speedlines.gif\",\n },\n pro: {\n bg: \"prosecutorempty\",\n desk: { ao2: \"prosecutiondesk.png\", ao1: \"bancoacusacion.png\" },\n speedLines: \"prosecution_speedlines.gif\",\n },\n hld: {\n bg: \"helperstand\",\n desk: {},\n speedLines: \"defense_speedlines.gif\",\n },\n hlp: {\n bg: \"prohelperstand\",\n desk: {},\n speedLines: \"prosecution_speedlines.gif\",\n },\n wit: {\n bg: \"witnessempty\",\n desk: { ao2: \"stand.png\", ao1: \"estrado.png\" },\n speedLines: \"prosecution_speedlines.gif\",\n },\n jud: {\n bg: \"judgestand\",\n desk: { ao2: \"judgedesk.png\", ao1: \"judgedesk.gif\" },\n speedLines: \"prosecution_speedlines.gif\",\n },\n jur: {\n bg: \"jurystand\",\n desk: { ao2: \"jurydesk.png\", ao1: \"estrado.png\" },\n speedLines: \"defense_speedlines.gif\",\n },\n sea: {\n bg: \"seancestand\",\n desk: { ao2: \"seancedesk.png\", ao1: \"estrado.png\" },\n speedLines: \"prosecution_speedlines.gif\",\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SHOUTS = void 0;\nexports.SHOUTS = [undefined, \"holdit\", \"objection\", \"takethat\", \"custom\"];\n","\"use strict\";\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createBlipsChannels = void 0;\nvar opusCheck_1 = require(\"../../dom/opusCheck\");\nvar createBlipsChannels = function () {\n var blipSelectors = document.getElementsByClassName(\"blipSound\");\n var blipChannels = __spreadArray([], __read(blipSelectors), false);\n // Allocate multiple blip audio channels to make blips less jittery\n blipChannels.forEach(function (channel) { return (channel.volume = 0.5); });\n blipChannels.forEach(function (channel) { return (channel.onerror = (0, opusCheck_1.opusCheck)(channel)); });\n return blipChannels;\n};\nexports.createBlipsChannels = createBlipsChannels;\n","\"use strict\";\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createMusic = void 0;\nvar opusCheck_1 = require(\"../../dom/opusCheck\");\nvar createMusic = function () {\n var audioChannels = document.getElementsByClassName(\"audioChannel\");\n var music = __spreadArray([], __read(audioChannels), false);\n music.forEach(function (channel) { return (channel.volume = 0.5); });\n music.forEach(function (channel) { return (channel.onerror = (0, opusCheck_1.opusCheck)(channel)); });\n return music;\n};\nexports.createMusic = createMusic;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createSfxAudio = void 0;\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar createSfxAudio = function () {\n var sfxAudio = document.getElementById(\"client_sfxaudio\");\n sfxAudio.src = \"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-realization.opus\");\n return sfxAudio;\n};\nexports.createSfxAudio = createSfxAudio;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createShoutAudio = void 0;\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar createShoutAudio = function () {\n var shoutAudio = document.getElementById(\"client_shoutaudio\");\n shoutAudio.src = \"\".concat(aoHost_1.AO_HOST, \"misc/default/objection.opus\");\n return shoutAudio;\n};\nexports.createShoutAudio = createShoutAudio;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createTestimonyAudio = void 0;\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar createTestimonyAudio = function () {\n var testimonyAudio = document.getElementById(\"client_testimonyaudio\");\n testimonyAudio.src = \"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-guilty.opus\");\n return testimonyAudio;\n};\nexports.createTestimonyAudio = createTestimonyAudio;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.handle_ic_speaking = exports.setStartThirdTickCheck = exports.startThirdTickCheck = exports.setStartSecondTickCheck = exports.startSecondTickCheck = exports.setStartFirstTickCheck = exports.startFirstTickCheck = void 0;\nvar client_1 = require(\"../../client\");\nvar appendICLog_1 = require(\"../../client/appendICLog\");\nvar checkCallword_1 = require(\"../../client/checkCallword\");\nvar setEmote_1 = require(\"../../client/setEmote\");\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar shouts_1 = require(\"../constants/shouts\");\nvar getAnimLength_1 = require(\"../../utils/getAnimLength\");\nvar setChatbox_1 = require(\"../../dom/setChatbox\");\nvar resizeChatbox_1 = require(\"../../dom/resizeChatbox\");\nvar transparentPng_1 = require(\"../../constants/transparentPng\");\nvar colors_1 = require(\"../constants/colors\");\nvar aoml_1 = require(\"../../utils/aoml\");\nvar attorneyMarkdown = (0, aoml_1.default)(aoHost_1.AO_HOST);\nvar setStartFirstTickCheck = function (val) { exports.startFirstTickCheck = val; };\nexports.setStartFirstTickCheck = setStartFirstTickCheck;\nvar setStartSecondTickCheck = function (val) { exports.startSecondTickCheck = val; };\nexports.setStartSecondTickCheck = setStartSecondTickCheck;\nvar setStartThirdTickCheck = function (val) { exports.startThirdTickCheck = val; };\nexports.setStartThirdTickCheck = setStartThirdTickCheck;\n/**\n * Sets a new emote.\n * This sets up everything before the tick() loops starts\n * a lot of things can probably be moved here, like starting the shout animation if there is one\n * TODO: the preanim logic, on the other hand, should probably be moved to tick()\n * @param {object} chatmsg the new chat message\n */\nvar handle_ic_speaking = function (playerChatMsg) { return __awaiter(void 0, void 0, void 0, function () {\n var charLayers, pairLayers, fg, gamewindow, waitingBox, eviBox, validSides, chatContainerBox, nameBoxInner, chatBoxInner, displayname, shoutSprite, shout, gifLength, setAside, skipoffset, effectName, badEffects, intensity, i, drop, baseEffectUrl, soundChecks, _a, error_1, output, _b, _c, letter, currentSelector;\n var e_1, _d;\n return __generator(this, function (_e) {\n switch (_e.label) {\n case 0:\n client_1.client.viewport.setChatmsg(playerChatMsg);\n client_1.client.viewport.setTextNow(\"\");\n client_1.client.viewport.setSfxPlayed(0);\n client_1.client.viewport.setTickTimer(0);\n client_1.client.viewport.setAnimating(true);\n exports.startFirstTickCheck = true;\n exports.startSecondTickCheck = false;\n exports.startThirdTickCheck = false;\n charLayers = document.getElementById(\"client_char\");\n pairLayers = document.getElementById(\"client_pair_char\");\n // stop updater\n clearTimeout(client_1.client.viewport.updater);\n // stop last sfx from looping any longer\n client_1.client.viewport.getSfxAudio().loop = false;\n fg = document.getElementById(\"client_fg\");\n gamewindow = document.getElementById(\"client_gamewindow\");\n waitingBox = document.getElementById(\"client_chatwaiting\");\n // Reset CSS animation\n gamewindow.style.animation = \"\";\n waitingBox.style.opacity = \"0\";\n eviBox = document.getElementById(\"client_evi\");\n if (client_1.client.viewport.getLastEvidence() !== client_1.client.viewport.getChatmsg().evidence) {\n eviBox.style.opacity = \"0\";\n eviBox.style.height = \"0%\";\n }\n client_1.client.viewport.setLastEvidence(client_1.client.viewport.getChatmsg().evidence);\n validSides = [\"def\", \"pro\", \"wit\"];\n if (validSides.includes(client_1.client.viewport.getChatmsg().side)) {\n charLayers = document.getElementById(\"client_\".concat(client_1.client.viewport.getChatmsg().side, \"_char\"));\n pairLayers = document.getElementById(\"client_\".concat(client_1.client.viewport.getChatmsg().side, \"_pair_char\"));\n }\n chatContainerBox = document.getElementById(\"client_chatcontainer\");\n nameBoxInner = document.getElementById(\"client_inner_name\");\n chatBoxInner = document.getElementById(\"client_inner_chat\");\n displayname = document.getElementById(\"showname\").checked &&\n client_1.client.viewport.getChatmsg().showname !== \"\"\n ? client_1.client.viewport.getChatmsg().showname\n : client_1.client.viewport.getChatmsg().nameplate;\n // Clear out the last message\n chatBoxInner.innerText = client_1.client.viewport.getTextNow();\n nameBoxInner.innerText = displayname;\n if (client_1.client.viewport.getLastCharacter() !== client_1.client.viewport.getChatmsg().name) {\n charLayers.style.opacity = \"0\";\n pairLayers.style.opacity = \"0\";\n }\n client_1.client.viewport.setLastCharacter(client_1.client.viewport.getChatmsg().name);\n (0, appendICLog_1.appendICLog)(client_1.client.viewport.getChatmsg().content, client_1.client.viewport.getChatmsg().showname, client_1.client.viewport.getChatmsg().nameplate);\n (0, checkCallword_1.checkCallword)(client_1.client.viewport.getChatmsg().content, client_1.client.viewport.getSfxAudio());\n (0, setEmote_1.default)(aoHost_1.AO_HOST, client_1.client, client_1.client.viewport.getChatmsg().name.toLowerCase(), client_1.client.viewport.getChatmsg().sprite, \"(a)\", false, client_1.client.viewport.getChatmsg().side);\n if (client_1.client.viewport.getChatmsg().other_name) {\n (0, setEmote_1.default)(aoHost_1.AO_HOST, client_1.client, client_1.client.viewport.getChatmsg().other_name.toLowerCase(), client_1.client.viewport.getChatmsg().other_emote, \"(a)\", false, client_1.client.viewport.getChatmsg().side);\n }\n shoutSprite = (document.getElementById(\"client_shout\"));\n shout = shouts_1.SHOUTS[client_1.client.viewport.getChatmsg().objection];\n if (shout) {\n // Hide message box\n chatContainerBox.style.opacity = \"0\";\n if (client_1.client.viewport.getChatmsg().objection === 4) {\n shoutSprite.src = \"\".concat(aoHost_1.AO_HOST, \"characters/\").concat(encodeURI(client_1.client.viewport.getChatmsg().name.toLowerCase()), \"/custom.gif\");\n }\n else {\n shoutSprite.src = client_1.client.resources[shout].src;\n shoutSprite.style.animation = \"bubble 700ms steps(10, jump-both)\";\n }\n shoutSprite.style.opacity = \"1\";\n client_1.client.viewport.shoutaudio.src = \"\".concat(aoHost_1.AO_HOST, \"characters/\").concat(encodeURI(client_1.client.viewport.getChatmsg().name.toLowerCase()), \"/\").concat(shout, \".opus\");\n client_1.client.viewport.shoutaudio.play();\n client_1.client.viewport.setShoutTimer(client_1.client.resources[shout].duration);\n }\n else {\n client_1.client.viewport.setShoutTimer(0);\n }\n client_1.client.viewport.getChatmsg().startpreanim = true;\n gifLength = 0;\n if (!(client_1.client.viewport.getChatmsg().type === 1 && client_1.client.viewport.getChatmsg().preanim !== \"-\")) return [3 /*break*/, 2];\n //we have a preanim\n chatContainerBox.style.opacity = \"0\";\n return [4 /*yield*/, (0, getAnimLength_1.default)(\"\".concat(aoHost_1.AO_HOST, \"characters/\").concat(encodeURI(client_1.client.viewport.getChatmsg().name.toLowerCase()), \"/\").concat(encodeURI(client_1.client.viewport.getChatmsg().preanim)))];\n case 1:\n gifLength = _e.sent();\n client_1.client.viewport.getChatmsg().startspeaking = false;\n return [3 /*break*/, 3];\n case 2:\n client_1.client.viewport.getChatmsg().startspeaking = true;\n if (client_1.client.viewport.getChatmsg().content.trim() !== \"\")\n chatContainerBox.style.opacity = \"1\";\n _e.label = 3;\n case 3:\n client_1.client.viewport.getChatmsg().preanimdelay = gifLength;\n setAside = {\n position: client_1.client.viewport.getChatmsg().side,\n showSpeedLines: false,\n showDesk: false,\n };\n skipoffset = false;\n if (client_1.client.viewport.getChatmsg().type === 5) {\n setAside.showSpeedLines = true;\n setAside.showDesk = false;\n client_1.client.viewport.set_side(setAside);\n }\n else {\n switch (Number(client_1.client.viewport.getChatmsg().deskmod)) {\n case 0: //desk is hidden\n setAside.showSpeedLines = false;\n setAside.showDesk = false;\n client_1.client.viewport.set_side(setAside);\n break;\n case 1: //desk is shown\n setAside.showSpeedLines = false;\n setAside.showDesk = true;\n client_1.client.viewport.set_side(setAside);\n break;\n case 2: //desk is hidden during preanim, but shown during idle/talk\n setAside.showSpeedLines = false;\n setAside.showDesk = false;\n client_1.client.viewport.set_side(setAside);\n break;\n case 3: //opposite of 2\n setAside.showSpeedLines = false;\n setAside.showDesk = false;\n client_1.client.viewport.set_side(setAside);\n break;\n case 4: //desk is hidden, character offset is ignored, pair character is hidden during preanim, normal behavior during idle/talk\n setAside.showSpeedLines = false;\n setAside.showDesk = false;\n client_1.client.viewport.set_side(setAside);\n skipoffset = true;\n break;\n case 5: //opposite of 4\n setAside.showSpeedLines = false;\n setAside.showDesk = true;\n client_1.client.viewport.set_side(setAside);\n break;\n default:\n setAside.showSpeedLines = false;\n setAside.showDesk = true;\n client_1.client.viewport.set_side(setAside);\n break;\n }\n }\n (0, setChatbox_1.setChatbox)(client_1.client.viewport.getChatmsg().chatbox);\n (0, resizeChatbox_1.resizeChatbox)();\n if (!skipoffset) {\n // Flip the character\n charLayers.style.transform =\n client_1.client.viewport.getChatmsg().flip === 1 ? \"scaleX(-1)\" : \"scaleX(1)\";\n pairLayers.style.transform =\n client_1.client.viewport.getChatmsg().other_flip === 1 ? \"scaleX(-1)\" : \"scaleX(1)\";\n // Shift by the horizontal offset\n switch (client_1.client.viewport.getChatmsg().side) {\n case \"wit\":\n pairLayers.style.left = \"\".concat(200 + Number(client_1.client.viewport.getChatmsg().other_offset[0]), \"%\");\n charLayers.style.left = \"\".concat(200 + Number(client_1.client.viewport.getChatmsg().self_offset[0]), \"%\");\n break;\n case \"pro\":\n pairLayers.style.left = \"\".concat(400 + Number(client_1.client.viewport.getChatmsg().other_offset[0]), \"%\");\n charLayers.style.left = \"\".concat(400 + Number(client_1.client.viewport.getChatmsg().self_offset[0]), \"%\");\n break;\n default:\n pairLayers.style.left = \"\".concat(Number(client_1.client.viewport.getChatmsg().other_offset[0]), \"%\");\n charLayers.style.left = \"\".concat(Number(client_1.client.viewport.getChatmsg().self_offset[0]), \"%\");\n break;\n }\n // New vertical offsets\n pairLayers.style.top = \"\".concat(Number(client_1.client.viewport.getChatmsg().other_offset[1]), \"%\");\n charLayers.style.top = \"\".concat(Number(client_1.client.viewport.getChatmsg().self_offset[1]), \"%\");\n }\n client_1.client.viewport.blipChannels.forEach(function (channel) {\n return (channel.src = \"\".concat(aoHost_1.AO_HOST, \"sounds/blips/\").concat(encodeURI(client_1.client.viewport.getChatmsg().blips.toLowerCase()), \".opus\"));\n });\n // process markup\n if (client_1.client.viewport.getChatmsg().content.startsWith(\"~~\")) {\n chatBoxInner.style.textAlign = \"center\";\n client_1.client.viewport.getChatmsg().content = client_1.client.viewport.getChatmsg().content.substring(2, client_1.client.viewport.getChatmsg().content.length);\n }\n else {\n chatBoxInner.style.textAlign = \"inherit\";\n }\n // apply effects\n fg.style.animation = \"\";\n effectName = client_1.client.viewport.getChatmsg().effects[0].toLowerCase();\n badEffects = [\"\", \"-\", \"none\"];\n if (effectName.startsWith(\"rain\")) {\n document.getElementById(\"effect_css\").href = \"styles/effects/rain.css\";\n intensity = 200;\n if (effectName.endsWith(\"weak\")) {\n intensity = 100;\n }\n else if (effectName.endsWith(\"strong\")) {\n intensity = 400;\n }\n if (intensity < fg.childElementCount)\n fg.innerHTML = '';\n else\n intensity = intensity - fg.childElementCount;\n for (i = 0; i < intensity; i++) {\n drop = document.createElement(\"p\");\n drop.style.left = (Math.random() * 100) + \"%\";\n drop.style.animationDelay = String(Math.random()) + \"s\";\n fg.appendChild(drop);\n }\n }\n else if (client_1.client.viewport.getChatmsg().effects[0] &&\n !badEffects.includes(effectName)) {\n document.getElementById(\"effect_css\").href = \"\";\n fg.innerHTML = '';\n baseEffectUrl = \"\".concat(aoHost_1.AO_HOST, \"themes/default/effects/\");\n fg.src = \"\".concat(baseEffectUrl).concat(encodeURI(effectName), \".webp\");\n }\n else {\n fg.innerHTML = '';\n fg.src = transparentPng_1.default;\n }\n charLayers.style.opacity = \"1\";\n soundChecks = [\"0\", \"1\", \"\", undefined];\n if (soundChecks.some(function (check) { return client_1.client.viewport.getChatmsg().sound === check; })) {\n client_1.client.viewport.getChatmsg().sound = client_1.client.viewport.getChatmsg().effects[2];\n }\n _e.label = 4;\n case 4:\n _e.trys.push([4, 6, , 7]);\n _a = client_1.client.viewport.getChatmsg();\n return [4 /*yield*/, attorneyMarkdown.applyMarkdown(client_1.client.viewport.getChatmsg().content, colors_1.COLORS[client_1.client.viewport.getChatmsg().color])];\n case 5:\n _a.parsed = _e.sent();\n return [3 /*break*/, 7];\n case 6:\n error_1 = _e.sent();\n console.warn(\"markdown failed\");\n output = [];\n try {\n for (_b = __values(client_1.client.viewport.getChatmsg().content), _c = _b.next(); !_c.done; _c = _b.next()) {\n letter = _c.value;\n currentSelector = document.createElement('span');\n currentSelector.innerHTML = letter;\n currentSelector.className = \"text_\".concat(colors_1.COLORS[client_1.client.viewport.getChatmsg().color]);\n output.push(currentSelector);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_d = _b.return)) _d.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n client_1.client.viewport.getChatmsg().parsed = output;\n return [3 /*break*/, 7];\n case 7:\n client_1.client.viewport.chat_tick();\n return [2 /*return*/];\n }\n });\n}); };\nexports.handle_ic_speaking = handle_ic_speaking;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.initTestimonyUpdater = void 0;\nvar client_1 = require(\"../../client\");\n/**\n * Intialize testimony updater\n */\nvar initTestimonyUpdater = function () {\n var testimonyFilenames = {\n 1: \"witnesstestimony\",\n 2: \"crossexamination\",\n 3: \"notguilty\",\n 4: \"guilty\",\n };\n var testimony = testimonyFilenames[client_1.client.testimonyID];\n if (!testimony) {\n console.warn(\"Invalid testimony ID \".concat(client_1.client.testimonyID));\n return;\n }\n client_1.client.viewport.testimonyAudio.src = client_1.client.resources[testimony].sfx;\n client_1.client.viewport.testimonyAudio.play();\n var testimonyOverlay = (document.getElementById(\"client_testimony\"));\n testimonyOverlay.src = client_1.client.resources[testimony].src;\n testimonyOverlay.style.opacity = \"1\";\n client_1.client.viewport.setTestimonyTimer(0);\n client_1.client.viewport.setTestimonyUpdater(setTimeout(function () { return client_1.client.viewport.updateTestimony(); }, client_1.UPDATE_INTERVAL));\n};\nexports.initTestimonyUpdater = initTestimonyUpdater;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.set_side = void 0;\nvar positions_1 = require(\"../constants/positions\");\nvar aoHost_1 = require(\"../../client/aoHost\");\nvar client_1 = require(\"../../client\");\nvar tryUrls_1 = require(\"../../utils/tryUrls\");\nvar fileExists_1 = require(\"../../utils/fileExists\");\n/**\n * Changes the viewport background based on a given position.\n *\n * Valid positions: `def, pro, hld, hlp, wit, jud, jur, sea`\n * @param {string} position the position to change into\n */\nvar set_side = function (_a) {\n var position = _a.position, showSpeedLines = _a.showSpeedLines, showDesk = _a.showDesk;\n return __awaiter(void 0, void 0, void 0, function () {\n var view, bench, court, bg, desk, speedLines, _b, deskFilename;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n view = document.getElementById(\"client_fullview\");\n if (['def', 'pro', 'wit'].includes(position)) {\n bench = (document.getElementById(\"client_\".concat(position, \"_bench\")));\n }\n else {\n bench = document.getElementById(\"client_bench_classic\");\n }\n if (\"def,pro,wit\".includes(position)) {\n court = (document.getElementById(\"client_court_\".concat(position)));\n }\n else {\n court = document.getElementById(\"client_court_classic\");\n }\n if (\"def,pro,hld,hlp,wit,jud,jur,sea\".includes(position)) {\n bg = positions_1.positions[position].bg;\n desk = positions_1.positions[position].desk;\n speedLines = positions_1.positions[position].speedLines;\n }\n else {\n bg = \"\".concat(position);\n desk = { ao2: \"\".concat(position, \"_overlay.png\"), ao1: \"_overlay.png\" };\n speedLines = \"defense_speedlines.gif\";\n }\n if (!(showSpeedLines === true)) return [3 /*break*/, 1];\n court.src = \"\".concat(aoHost_1.AO_HOST, \"themes/default/\").concat(encodeURI(speedLines));\n return [3 /*break*/, 3];\n case 1:\n _b = court;\n return [4 /*yield*/, (0, tryUrls_1.default)(client_1.client.viewport.getBackgroundFolder() + bg)];\n case 2:\n _b.src = _c.sent();\n _c.label = 3;\n case 3:\n if (!(showDesk === true && desk)) return [3 /*break*/, 5];\n return [4 /*yield*/, (0, fileExists_1.default)(client_1.client.viewport.getBackgroundFolder() + desk.ao2)];\n case 4:\n deskFilename = (_c.sent())\n ? desk.ao2\n : desk.ao1;\n bench.src = client_1.client.viewport.getBackgroundFolder() + deskFilename;\n bench.style.opacity = \"1\";\n return [3 /*break*/, 6];\n case 5:\n bench.style.opacity = \"0\";\n _c.label = 6;\n case 6:\n if (\"def,pro,wit\".includes(position)) {\n view.style.display = \"\";\n document.getElementById(\"client_classicview\").style.display = \"none\";\n switch (position) {\n case \"def\":\n view.style.left = \"0\";\n break;\n case \"wit\":\n view.style.left = \"-200%\";\n break;\n case \"pro\":\n view.style.left = \"-400%\";\n break;\n }\n }\n else {\n view.style.display = \"none\";\n document.getElementById(\"client_classicview\").style.display = \"\";\n }\n return [2 /*return*/];\n }\n });\n });\n};\nexports.set_side = set_side;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar client_1 = require(\"../client\");\nvar client_2 = require(\"../client\");\nvar setEmote_1 = require(\"../client/setEmote\");\nvar encoding_1 = require(\"../encoding\");\nvar aoHost_1 = require(\"../client/aoHost\");\nvar createBlipChannels_1 = require(\"./utils/createBlipChannels\");\nvar defaultChatMsg_1 = require(\"./constants/defaultChatMsg\");\nvar createMusic_1 = require(\"./utils/createMusic\");\nvar createSfxAudio_1 = require(\"./utils/createSfxAudio\");\nvar createShoutAudio_1 = require(\"./utils/createShoutAudio\");\nvar createTestimonyAudio_1 = require(\"./utils/createTestimonyAudio\");\nvar colors_1 = require(\"./constants/colors\");\nvar setSide_1 = require(\"./utils/setSide\");\nvar handleICSpeaking_1 = require(\"./utils/handleICSpeaking\");\nvar viewport = function () {\n var animating = false;\n var blipChannels = (0, createBlipChannels_1.createBlipsChannels)();\n var chatmsg = defaultChatMsg_1.defaultChatMsg;\n var currentBlipChannel = 0;\n var lastChar = \"\";\n var lastEvi = 0;\n var music = (0, createMusic_1.createMusic)();\n var musicVolume = 0;\n var sfxAudio = (0, createSfxAudio_1.createSfxAudio)();\n var sfxplayed = 0;\n var shoutTimer = 0;\n var shoutaudio = (0, createShoutAudio_1.createShoutAudio)();\n var testimonyAudio = (0, createTestimonyAudio_1.createTestimonyAudio)();\n var testimonyTimer = 0;\n var testimonyUpdater;\n var textnow = \"\";\n var theme;\n var tickTimer = 0;\n var updater;\n var backgroundName = \"\";\n var getSfxAudio = function () { return sfxAudio; };\n var setSfxAudio = function (value) { sfxAudio = value; };\n var getBackgroundName = function () { return backgroundName; };\n var setBackgroundName = function (value) { backgroundName = value; };\n var getBackgroundFolder = function () {\n return \"\".concat(aoHost_1.AO_HOST, \"background/\").concat(encodeURI(backgroundName.toLowerCase()), \"/\");\n };\n var getTextNow = function () { return textnow; };\n var setTextNow = function (val) { textnow = val; };\n var getChatmsg = function () { return chatmsg; };\n var setChatmsg = function (val) { chatmsg = val; };\n var getSfxPlayed = function () { return sfxplayed; };\n var setSfxPlayed = function (val) { sfxplayed = val; };\n var getTickTimer = function () { return tickTimer; };\n var setTickTimer = function (val) { tickTimer = val; };\n var getAnimating = function () { return animating; };\n var setAnimating = function (val) { animating = val; };\n var getLastEvidence = function () { return lastEvi; };\n var setLastEvidence = function (val) { lastEvi = val; };\n var setLastCharacter = function (val) { lastChar = val; };\n var getLastCharacter = function () { return lastChar; };\n var getShoutTimer = function () { return shoutTimer; };\n var setShoutTimer = function (val) { shoutTimer = val; };\n var getTheme = function () { return theme; };\n var setTheme = function (val) { theme = val; };\n var getTestimonyTimer = function () { return testimonyTimer; };\n var setTestimonyTimer = function (val) { testimonyTimer = val; };\n var setTestimonyUpdater = function (val) { testimonyUpdater = val; };\n var getTestimonyUpdater = function () { return testimonyUpdater; };\n var playSFX = function (sfxname, looping) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n sfxAudio.pause();\n sfxAudio.loop = looping;\n sfxAudio.src = sfxname;\n sfxAudio.play();\n return [2 /*return*/];\n });\n }); };\n /**\n * Updates the testimony overaly\n */\n var updateTestimony = function () {\n var testimonyFilenames = {\n 1: \"witnesstestimony\",\n 2: \"crossexamination\",\n 3: \"notguilty\",\n 4: \"guilty\",\n };\n // Update timer\n testimonyTimer += client_2.UPDATE_INTERVAL;\n var testimony = testimonyFilenames[client_1.client.testimonyID];\n var resource = client_1.client.resources[testimony];\n if (!resource) {\n disposeTestimony();\n return;\n }\n if (testimonyTimer >= resource.duration) {\n disposeTestimony();\n }\n else {\n testimonyUpdater = setTimeout(function () { return updateTestimony(); }, client_2.UPDATE_INTERVAL);\n }\n };\n /**\n * Dispose the testimony overlay\n */\n var disposeTestimony = function () {\n client_1.client.testimonyID = 0;\n testimonyTimer = 0;\n document.getElementById(\"client_testimony\").style.opacity = \"0\";\n clearTimeout(testimonyUpdater);\n };\n var handleTextTick = function (charLayers) { return __awaiter(void 0, void 0, void 0, function () {\n var chatBox, waitingBox, chatBoxInner, charName, charEmote, characterElement, COMMAND_IDENTIFIER, nextCharacterElement, flash, shake, commands, textSpeeds, MAX_SLOW_CHATSPEED, i, currentCharacter;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n chatBox = document.getElementById(\"client_chat\");\n waitingBox = document.getElementById(\"client_chatwaiting\");\n chatBoxInner = document.getElementById(\"client_inner_chat\");\n charName = chatmsg.name.toLowerCase();\n charEmote = chatmsg.sprite.toLowerCase();\n if (chatmsg.content.charAt(textnow.length) !== \" \") {\n blipChannels[currentBlipChannel].play();\n currentBlipChannel++;\n currentBlipChannel %= blipChannels.length;\n }\n textnow = chatmsg.content.substring(0, textnow.length + 1);\n characterElement = chatmsg.parsed[textnow.length - 1];\n if (!characterElement) return [3 /*break*/, 3];\n COMMAND_IDENTIFIER = \"\\\\\";\n nextCharacterElement = chatmsg.parsed[textnow.length];\n flash = function () { return __awaiter(void 0, void 0, void 0, function () {\n var effectlayer;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n effectlayer = document.getElementById(\"client_fg\");\n playSFX(\"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-realization.opus\"), false);\n effectlayer.style.animation = \"flash 0.4s 1\";\n return [4 /*yield*/, (0, client_1.delay)(400)];\n case 1:\n _a.sent();\n effectlayer.style.removeProperty(\"animation\");\n return [2 /*return*/];\n }\n });\n }); };\n shake = function () { return __awaiter(void 0, void 0, void 0, function () {\n var gamewindow;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n gamewindow = document.getElementById(\"client_gamewindow\");\n playSFX(\"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-stab.opus\"), false);\n gamewindow.style.animation = \"shake 0.2s 1\";\n return [4 /*yield*/, (0, client_1.delay)(200)];\n case 1:\n _a.sent();\n gamewindow.style.removeProperty(\"animation\");\n return [2 /*return*/];\n }\n });\n }); };\n commands = new Map(Object.entries({\n s: shake,\n f: flash,\n }));\n textSpeeds = new Set([\"{\", \"}\"]);\n // Changing Text Speed\n if (textSpeeds.has(characterElement.innerHTML)) {\n MAX_SLOW_CHATSPEED = 120;\n for (i = textnow.length; i < chatmsg.content.length; i++) {\n currentCharacter = chatmsg.parsed[i - 1].innerHTML;\n if (currentCharacter === \"}\") {\n if (chatmsg.speed > 0) {\n chatmsg.speed -= 20;\n }\n }\n else if (currentCharacter === \"{\") {\n if (chatmsg.speed < MAX_SLOW_CHATSPEED) {\n chatmsg.speed += 20;\n }\n }\n else {\n // No longer at a speed character\n textnow = chatmsg.content.substring(0, i);\n break;\n }\n }\n }\n if (!(characterElement.innerHTML === COMMAND_IDENTIFIER &&\n commands.has(nextCharacterElement === null || nextCharacterElement === void 0 ? void 0 : nextCharacterElement.innerHTML))) return [3 /*break*/, 2];\n textnow = chatmsg.content.substring(0, textnow.length + 1);\n return [4 /*yield*/, commands.get(nextCharacterElement.innerHTML)()];\n case 1:\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n chatBoxInner.appendChild(chatmsg.parsed[textnow.length - 1]);\n _a.label = 3;\n case 3:\n // scroll to bottom\n chatBox.scrollTop = chatBox.scrollHeight;\n if (textnow === chatmsg.content) {\n animating = false;\n (0, setEmote_1.default)(aoHost_1.AO_HOST, client_1.client, charName, charEmote, \"(a)\", false, chatmsg.side);\n charLayers.style.opacity = \"1\";\n waitingBox.style.opacity = \"1\";\n clearTimeout(updater);\n }\n return [2 /*return*/];\n }\n });\n }); };\n /**\n * Updates the chatbox based on the given text.\n *\n * OK, here's the documentation on how this works:\n *\n * 1 _animating\n * If we're not done with this characters animation, i.e. his text isn't fully there, set a timeout for the next tick/step to happen\n *\n * 2 startpreanim\n * If the shout timer is over it starts with the preanim\n * The first thing it checks for is the shake effect (TODO on client this is handled by the @ symbol and not a flag )\n * Then is the flash/realization effect\n * After that, the shout image set to be transparent\n * and the main characters preanim gif is loaded\n * If pairing is supported the paired character will just stand around with his idle sprite\n *\n * 3 preanimdelay over\n * this animates the evidence popup and finally shows the character name and message box\n * it sets the text color and the character speaking sprite\n *\n * 4 textnow != content\n * this adds a character to the textbox and stops the animations if the entire message is present in the textbox\n *\n * 5 sfx\n * independent of the stuff above, this will play any sound effects specified by the emote the character sent.\n * happens after the shout delay + an sfx delay that comes with the message packet\n *\n * XXX: This relies on a global variable `chatmsg`!\n */\n var chat_tick = function () { return __awaiter(void 0, void 0, void 0, function () {\n var gamewindow, waitingBox, eviBox, shoutSprite, effectlayer, chatBoxInner, charLayers, pairLayers, validSides, charName, charEmote, pairName, pairEmote, isShoutOver, isShoutAndPreanimOver, preanim, hasNonInterruptingPreAnim, chatContainerBox, chatContainerBox;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: \n // note: this is called fairly often\n // do not perform heavy operations here\n return [4 /*yield*/, (0, client_1.delay)(chatmsg.speed)];\n case 1:\n // note: this is called fairly often\n // do not perform heavy operations here\n _a.sent();\n if (textnow === chatmsg.content) {\n return [2 /*return*/];\n }\n gamewindow = document.getElementById(\"client_gamewindow\");\n waitingBox = document.getElementById(\"client_chatwaiting\");\n eviBox = document.getElementById(\"client_evi\");\n shoutSprite = (document.getElementById(\"client_shout\"));\n effectlayer = document.getElementById(\"client_fg\");\n chatBoxInner = document.getElementById(\"client_inner_chat\");\n charLayers = document.getElementById(\"client_char\");\n pairLayers = (document.getElementById(\"client_pair_char\"));\n validSides = [\"def\", \"pro\", \"wit\"];\n if (validSides.includes(chatmsg.side)) {\n charLayers = (document.getElementById(\"client_\".concat(chatmsg.side, \"_char\")));\n pairLayers = (document.getElementById(\"client_\".concat(chatmsg.side, \"_pair_char\")));\n }\n charName = chatmsg.name.toLowerCase();\n charEmote = chatmsg.sprite.toLowerCase();\n pairName = chatmsg.other_name.toLowerCase();\n pairEmote = chatmsg.other_emote.toLowerCase();\n isShoutOver = tickTimer >= shoutTimer;\n isShoutAndPreanimOver = tickTimer >= shoutTimer + chatmsg.preanimdelay;\n if (isShoutOver && handleICSpeaking_1.startFirstTickCheck) {\n // Effect stuff\n if (chatmsg.screenshake === 1) {\n // Shake screen\n playSFX(\"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-stab.opus\"), false);\n gamewindow.style.animation = \"shake 0.2s 1\";\n }\n if (chatmsg.flash === 1) {\n // Flash screen\n playSFX(\"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-realization.opus\"), false);\n effectlayer.style.animation = \"flash 0.4s 1\";\n }\n // Pre-animation stuff\n if (chatmsg.preanimdelay > 0) {\n shoutSprite.style.opacity = \"0\";\n shoutSprite.style.animation = \"\";\n preanim = chatmsg.preanim.toLowerCase();\n (0, setEmote_1.default)(aoHost_1.AO_HOST, client_1.client, charName, preanim, \"\", false, chatmsg.side);\n }\n if (chatmsg.other_name) {\n pairLayers.style.opacity = \"1\";\n }\n else {\n pairLayers.style.opacity = \"0\";\n }\n // Done with first check, move to second\n (0, handleICSpeaking_1.setStartFirstTickCheck)(false);\n (0, handleICSpeaking_1.setStartSecondTickCheck)(true);\n chatmsg.startpreanim = false;\n chatmsg.startspeaking = true;\n }\n hasNonInterruptingPreAnim = chatmsg.noninterrupting_preanim === 1;\n if (!(textnow !== chatmsg.content && hasNonInterruptingPreAnim)) return [3 /*break*/, 3];\n chatContainerBox = document.getElementById(\"client_chatcontainer\");\n chatContainerBox.style.opacity = \"1\";\n return [4 /*yield*/, handleTextTick(charLayers)];\n case 2:\n _a.sent();\n return [3 /*break*/, 6];\n case 3:\n if (!(isShoutAndPreanimOver && handleICSpeaking_1.startSecondTickCheck)) return [3 /*break*/, 6];\n if (!chatmsg.startspeaking) return [3 /*break*/, 4];\n chatmsg.startspeaking = false;\n // Evidence Bullshit\n if (chatmsg.evidence > 0) {\n // Prepare evidence\n eviBox.src = (0, encoding_1.safeTags)(client_1.client.evidences[chatmsg.evidence - 1].icon);\n eviBox.style.width = \"auto\";\n eviBox.style.height = \"36.5%\";\n eviBox.style.opacity = \"1\";\n testimonyAudio.src = \"\".concat(aoHost_1.AO_HOST, \"sounds/general/sfx-evidenceshoop.opus\");\n testimonyAudio.play();\n if (chatmsg.side === \"def\") {\n // Only def show evidence on right\n eviBox.style.right = \"1em\";\n eviBox.style.left = \"initial\";\n }\n else {\n eviBox.style.right = \"initial\";\n eviBox.style.left = \"1em\";\n }\n }\n chatBoxInner.className = \"text_\".concat(colors_1.COLORS[chatmsg.color]);\n if (chatmsg.preanimdelay === 0) {\n shoutSprite.style.opacity = \"0\";\n shoutSprite.style.animation = \"\";\n }\n switch (Number(chatmsg.deskmod)) {\n case 2:\n (0, setSide_1.set_side)({\n position: chatmsg.side,\n showSpeedLines: false,\n showDesk: true,\n });\n break;\n case 3:\n (0, setSide_1.set_side)({\n position: chatmsg.side,\n showSpeedLines: false,\n showDesk: false,\n });\n break;\n case 4:\n (0, setSide_1.set_side)({\n position: chatmsg.side,\n showSpeedLines: false,\n showDesk: true,\n });\n break;\n case 5:\n (0, setSide_1.set_side)({\n position: chatmsg.side,\n showSpeedLines: false,\n showDesk: false,\n });\n break;\n }\n if (chatmsg.other_name) {\n (0, setEmote_1.default)(aoHost_1.AO_HOST, client_1.client, pairName, pairEmote, \"(a)\", true, chatmsg.side);\n pairLayers.style.opacity = \"1\";\n }\n else {\n pairLayers.style.opacity = \"0\";\n }\n (0, setEmote_1.default)(aoHost_1.AO_HOST, client_1.client, charName, charEmote, \"(b)\", false, chatmsg.side);\n charLayers.style.opacity = \"1\";\n if (textnow === chatmsg.content) {\n (0, setEmote_1.default)(aoHost_1.AO_HOST, client_1.client, charName, charEmote, \"(a)\", false, chatmsg.side);\n charLayers.style.opacity = \"1\";\n waitingBox.style.opacity = \"1\";\n animating = false;\n clearTimeout(updater);\n return [2 /*return*/];\n }\n return [3 /*break*/, 6];\n case 4:\n if (!(textnow !== chatmsg.content)) return [3 /*break*/, 6];\n chatContainerBox = document.getElementById(\"client_chatcontainer\");\n chatContainerBox.style.opacity = \"1\";\n return [4 /*yield*/, handleTextTick(charLayers)];\n case 5:\n _a.sent();\n _a.label = 6;\n case 6:\n if (!sfxplayed && chatmsg.snddelay + shoutTimer >= tickTimer) {\n sfxplayed = 1;\n if (chatmsg.sound !== \"0\" &&\n chatmsg.sound !== \"1\" &&\n chatmsg.sound !== \"\" &&\n chatmsg.sound !== undefined &&\n (chatmsg.type == 1 || chatmsg.type == 2 || chatmsg.type == 6)) {\n playSFX(\"\".concat(aoHost_1.AO_HOST, \"sounds/general/\").concat(encodeURI(chatmsg.sound.toLowerCase()), \".opus\"), chatmsg.looping_sfx);\n }\n }\n if (animating) {\n chat_tick();\n }\n tickTimer += client_2.UPDATE_INTERVAL;\n return [2 /*return*/];\n }\n });\n }); };\n return {\n getTextNow: getTextNow,\n setTextNow: setTextNow,\n getChatmsg: getChatmsg,\n setChatmsg: setChatmsg,\n getSfxPlayed: getSfxPlayed,\n setSfxPlayed: setSfxPlayed,\n setTickTimer: setTickTimer,\n getTickTimer: getTickTimer,\n setAnimating: setAnimating,\n getAnimating: getAnimating,\n getLastEvidence: getLastEvidence,\n setLastEvidence: setLastEvidence,\n setLastCharacter: setLastCharacter,\n getLastCharacter: getLastCharacter,\n getShoutTimer: getShoutTimer,\n setShoutTimer: setShoutTimer,\n setTheme: setTheme,\n getTheme: getTheme,\n setTestimonyTimer: setTestimonyTimer,\n getTestimonyTimer: getTestimonyTimer,\n setTestimonyUpdater: setTestimonyUpdater,\n getTestimonyUpdater: getTestimonyUpdater,\n testimonyAudio: testimonyAudio,\n chat_tick: chat_tick,\n playSFX: playSFX,\n set_side: setSide_1.set_side,\n setBackgroundName: setBackgroundName,\n updateTestimony: updateTestimony,\n disposeTestimony: disposeTestimony,\n handleTextTick: handleTextTick,\n getBackgroundFolder: getBackgroundFolder,\n getBackgroundName: getBackgroundName,\n getSfxAudio: getSfxAudio,\n setSfxAudio: setSfxAudio,\n blipChannels: blipChannels,\n music: music,\n musicVolume: musicVolume,\n shoutaudio: shoutaudio,\n updater: updater,\n };\n};\nexports.default = viewport;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t47: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkwebao\"] = self[\"webpackChunkwebao\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(6459);\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","changeSFXVolume","setCookie","document","getElementById","volume","changeTestimonyVolume","changeShoutVolume","window","regexPatterns","section","param","comment","lineFilter","value","isEmpty","length","test","data","currentSection","parsedIni","split","filter","forEach","line","isParameter","isSection","match","matchKey","toLowerCase","matchValue","valueHandler","_regeneratorRuntime","e","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","v","values","g","defineIteratorMethods","_invoke","AsyncIterator","invoke","_typeof","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","asyncGeneratorStep","gen","reject","_next","_throw","key","info","error","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","requestBuffer","_x","_requestBuffer","_callee2","url","_context2","xhr","XMLHttpRequest","responseType","addEventListener","concat","statusText","code","status","response","open","send","request","_ref","_callee","_context","_x2","fileExists","onload","readyState","onerror","gifFile","Uint8Array","duration","delay","webpFile","apngFile","delayNum","Number","delayDen","getAnimLength","_i","_extensions","extension","urlWithExtension","fileBuffer","calculatorHandler","AO_HOST","THEME","holdit","src","objection","takethat","custom","witnesstestimony","sfx","crossexamination","guilty","notguilty","__assign","assign","this","__awaiter","thisArg","_arguments","P","generator","fulfilled","step","rejected","result","__generator","body","_","label","trys","ops","verb","op","__spreadArray","to","from","pack","ar","Array","SuppressedError","version","wait","durationMs","resolveWith","setTimeout","isPromise","awaitIfAsync","action","callback","returnedValue","mapWithBreaks","items","loopReleaseInterval","results","lastLoopReleaseTime","now","_a","Date","suppressUnhandledRejectionWarning","promise","x64Add","m","x64Multiply","x64Rotl","x64LeftShift","x64Xor","x64Fmix","x64hash128","seed","remainder","bytes","h1","h2","k1","k2","c1","c2","charCodeAt","toString","toInt","parseInt","toFloat","parseFloat","replaceNaN","replacement","countTruthy","reduce","sum","round","base","Math","abs","counterBase","ensureErrorWithMessage","message","isFinalResultLoaded","loadResult","loadSources","sources","sourceOptions","excludeSources","includedSources","sourceKey","haystack","needle","includes","sourceGettersPromise","source","sourceLoadPromise","resolveLoad","loadStartTime","bind","loadArgs","loadDuration","resolveGet","getStartTime","getArgs","finalizeSource","loadSource","componentPromises","componentArray","components","index","sourceGetter","componentPromise","all","transformSource","transformValue","transformLoadResult","getResult","options","isTrident","w","navigator","isEdgeHTML","isChromium","vendor","indexOf","isWebKit","isDesktopSafari","isGecko","_b","documentElement","style","getFullscreenElement","fullscreenElement","msFullscreenElement","mozFullScreenElement","webkitFullscreenElement","isAndroid","isItChromium","isItGecko","appVersion","makeInnerError","withIframe","initialHtml","domPollInterval","_c","iframe","_d","createElement","_resolve","_reject","isComplete","setProperty","position","top","left","visibility","srcdoc","appendChild","checkReadyState","contentWindow","parentNode","removeChild","selectorToElement","selector","errorMessage","tagMatch","exec","tag","attributes","partsRegex","addAttribute","part","attributeMatch","parseSimpleCssSelector","element","name_1","join","addStyleString","setAttribute","property","name_2","priority","baseFonts","fontList","canvasToString","canvas","toDataURL","screenFrameBackup","screenFrameSizeTimeoutId","screenFrameCheckInterval","getScreenFrame","_this","checkScreenFrame","frameSize","getCurrentScreenFrame","isFrameSizeNull","watchScreenFrame","exitFullscreen","msExitFullscreen","mozCancelFullScreen","webkitExitFullscreen","screen","availTop","width","availWidth","availLeft","height","availHeight","getBlockedSelectors","selectors","root","elements","blockedSelectors","holder","forceShow","tagName","show","offsetParent","doesMatch$4","matchMedia","matches","doesMatch$3","doesMatch$2","doesMatch$1","doesMatch","M","fallbackFn","presets","default","apple","font","serif","fontFamily","sans","mono","min","fontSize","system","fonts","spansContainer","defaultWidth","defaultHeight","createSpan","span","textContent","baseFontsSpans","map","fontsSpans","spans","_loop_1","baseFont","fontToDetect","createSpanWithFonts","fontList_1","initializeFontsSpans","offsetWidth","offsetHeight","fontSpans","some","baseFontIndex","domBlockers","debug","filters","filterNames","activeBlockers","fromB64","atob","abpIndo","abpvn","adBlockFinland","adBlockPersian","adBlockWarningRemoval","adGuardAnnoyances","adGuardBase","adGuardChinese","adGuardFrench","adGuardGerman","adGuardJapanese","adGuardMobile","adGuardRussian","adGuardSocial","adGuardSpanishPortuguese","adGuardTrackingProtection","adGuardTurkish","bulgarian","easyList","easyListChina","easyListCookie","easyListCzechSlovak","easyListDutch","easyListGermany","easyListItaly","easyListLithuania","estonian","fanboyAnnoyances","fanboyAntiFacebook","fanboyEnhancedTrackers","fanboySocial","frellwitSwedish","greekAdBlock","hungarian","iDontCareAboutCookies","icelandicAbp","latvian","listKr","listeAr","listeFr","officialPolish","ro","ruAd","thaiAds","webAnnoyancesUltralist","filterName","console","log","printDebug","sort","fontPreferences","containerWidthPx","iframeWindow","iframeDocument","iframeBody","bodyStyle","webkitTextSizeAdjust","textSizeAdjust","zoom","devicePixelRatio","linesOfText","container","sizes","text","whiteSpace","_e","_f","_g","_h","getBoundingClientRect","audio","AudioContext","OfflineAudioContext","webkitOfflineAudioContext","isWebKit606OrNewer","context","oscillator","createOscillator","frequency","compressor","createDynamicsCompressor","threshold","knee","ratio","attack","release","connect","destination","start","finalize","isFinalized","renderTryCount","startedRunningAt","oncomplete","event","renderedBuffer","startRunningTimeout","tryRender","renderingPromise","startRendering","state","hidden","startRenderingAudio","renderPromise","finishRendering","fingerprintPromise","buffer","signal","hash","getHash","getChannelData","subarray","screenFrame","screenFrameGetter","processSize","sideSize","osCpu","oscpu","languages","language","userLanguage","browserLanguage","systemLanguage","isArray","Intl","Reflect","colorDepth","deviceMemory","screenResolution","parseDimension","dimensions","hardwareConcurrency","timezone","DateTimeFormat","resolvedOptions","timeZone","currentYear","offset","getFullYear","max","getTimezoneOffset","sessionStorage","localStorage","indexedDB","openDatabase","cpuClass","platform","screenRatio","Element","webkitRequestFullscreen","isIPad","plugins","rawPlugins","plugin","mimeTypes","j","mimeType","suffixes","description","geometry","winding","getContext","makeCanvasContext","isSupported","rect","isPointInPath","doesSupportWinding","textBaseline","fillStyle","fillRect","printedText","String","fromCharCode","fillText","renderTextImage","textImage1","globalCompositeOperation","color","x","beginPath","arc","PI","closePath","fill","renderGeometryImage","touchSupport","touchEvent","maxTouchPoints","msMaxTouchPoints","createEvent","touchStart","vendorFlavors","flavors","cookiesEnabled","cookie","colorGamut","gamut","invertedColors","forcedColors","monochrome","contrast","reducedMotion","hdr","math","acos","acosh","asin","asinh","atanh","atan","sin","sinh","cos","cosh","tan","tanh","exp","expm1","log1p","acoshPf","sqrt","asinhPf","atanhPf","sinhPf","coshPf","tanhPf","expm1Pf","log1pPf","powPI","pow","videoCard","gl","debugInfo","getExtension","getParameter","UNMASKED_VENDOR_WEBGL","renderer","UNMASKED_RENDERER_WEBGL","pdfViewerEnabled","architecture","Float32Array","u8","Infinity","commentTemplate","getConfidence","openConfidenceScore","getOpenConfidenceScore","proConfidenceScore","deriveProConfidenceScore","score","replace","componentsToDebugString","JSON","stringify","_key","stack","hashComponents","componentKey","component","componentsToCanonicalString","prepareForSources","delayFallback","fallbackTimeout","deadlineTimeout","requestIdleCallback","timeout","requestIdleCallbackIfAvailable","makeAgent","getComponents","creationTime","get","startTime","visitorIdCache","visitorId","confidence","makeLazyGetResult","userAgent","load","monitoring","__fpjs_d_m","random","monitor","murmurX64Hash128","isCallable","tryToString","$TypeError","module","exports","argument","isConstructor","$String","wellKnownSymbol","UNSCOPABLES","ArrayPrototype","S","unicode","isPrototypeOf","it","Prototype","isObject","ArrayBuffer","DataView","NAME","Constructor","NATIVE_ARRAY_BUFFER","DESCRIPTORS","global","hasOwn","classof","createNonEnumerableProperty","defineBuiltIn","defineBuiltInAccessor","uid","InternalStateModule","enforceInternalState","enforce","getInternalState","Int8Array","Int8ArrayPrototype","Uint8ClampedArray","Uint8ClampedArrayPrototype","TypedArray","TypedArrayPrototype","ObjectPrototype","TO_STRING_TAG","TYPED_ARRAY_TAG","TYPED_ARRAY_CONSTRUCTOR","NATIVE_ARRAY_BUFFER_VIEWS","opera","TYPED_ARRAY_TAG_REQUIRED","TypedArrayConstructorsList","Int16Array","Uint16Array","Int32Array","Uint32Array","Float64Array","BigIntArrayConstructorsList","BigInt64Array","BigUint64Array","getTypedArrayConstructor","proto","isTypedArray","klass","Function","aTypedArray","aTypedArrayConstructor","C","exportTypedArrayMethod","KEY","forced","ARRAY","TypedArrayConstructor","error2","exportTypedArrayStaticMethod","isView","uncurryThis","FunctionName","defineBuiltIns","fails","anInstance","toIntegerOrInfinity","toLength","toIndex","IEEE754","getOwnPropertyNames","arrayFill","arraySlice","setToStringTag","PROPER_FUNCTION_NAME","PROPER","CONFIGURABLE_FUNCTION_NAME","CONFIGURABLE","ARRAY_BUFFER","DATA_VIEW","PROTOTYPE","WRONG_INDEX","getInternalArrayBufferState","getterFor","getInternalDataViewState","setInternalState","set","NativeArrayBuffer","$ArrayBuffer","ArrayBufferPrototype","$DataView","DataViewPrototype","RangeError","packIEEE754","unpackIEEE754","unpack","packInt8","number","packInt16","packInt32","unpackInt32","packFloat32","packFloat64","addGetter","view","count","isLittleEndian","store","intIndex","boolIsLittleEndian","byteLength","byteOffset","conversion","INCORRECT_ARRAY_BUFFER_NAME","NaN","testView","$setInt8","setInt8","getInt8","setUint8","unsafe","detached","bufferState","bufferLength","getUint8","getInt16","getUint16","getInt32","getUint32","getFloat32","getFloat64","setInt16","setUint16","setInt32","setUint32","setFloat32","setFloat64","toObject","toAbsoluteIndex","lengthOfArrayLike","deletePropertyOrThrow","copyWithin","target","O","len","end","inc","argumentsLength","endPos","$forEach","STRICT_METHOD","arrayMethodIsStrict","callbackfn","list","toIndexedObject","createMethod","IS_INCLUDES","$this","el","fromIndex","IndexedObject","arraySpeciesCreate","TYPE","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","IS_FILTER_REJECT","NO_HOLES","that","specificCreate","boundFunction","every","find","findIndex","filterReject","$lastIndexOf","lastIndexOf","NEGATIVE_ZERO","FORCED","searchElement","V8_VERSION","SPECIES","METHOD_NAME","array","foo","Boolean","aCallable","IS_RIGHT","memo","right","createProperty","$Array","k","fin","floor","mergeSort","comparefn","middle","insertionSort","merge","llength","rlength","lindex","rindex","originalArray","arraySpeciesConstructor","ITERATOR","SAFE_CLOSING","called","iteratorWithReturn","SKIP_CLOSING","ITERATION_SUPPORT","object","stringSlice","TO_STRING_TAG_SUPPORT","classofRaw","$Object","CORRECT_ARGUMENTS","tryGet","callee","ownKeys","getOwnPropertyDescriptorModule","definePropertyModule","exceptions","getOwnPropertyDescriptor","F","createPropertyDescriptor","bitmap","toPropertyKey","propertyKey","makeBuiltIn","descriptor","getter","setter","defineGlobalProperty","simple","nonConfigurable","nonWritable","documentAll","IS_HTMLDDA","EXISTS","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DOMTokenList","DataTransferItemList","FileList","HTMLAllCollection","HTMLCollection","HTMLFormElement","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","PaintRequestList","Plugin","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TextTrackCueList","TextTrackList","TouchList","classList","documentCreateElement","DOMTokenListPrototype","firefox","IS_DENO","IS_NODE","Deno","UA","Pebble","process","versions","v8","webkit","copyConstructorProperties","isForced","targetProperty","sourceProperty","TARGET","GLOBAL","STATIC","stat","dontCallGetSet","sham","regexpExec","RegExpPrototype","RegExp","SHAM","SYMBOL","DELEGATES_TO_SYMBOL","DELEGATES_TO_EXEC","execCalled","re","flags","uncurriedNativeRegExpMethod","methods","nativeMethod","regexp","str","arg2","forceStringMethod","uncurriedNativeMethod","$exec","NATIVE_BIND","FunctionPrototype","getDescriptor","uncurryThisWithBind","namespace","getMethod","isNullOrUndefined","Iterators","anObject","getIteratorMethod","usingIterator","iteratorMethod","replacer","rawLength","keysLength","V","func","check","globalThis","b","getBuiltIn","sign","trunc","LN2","roundToEven","truncated","delta","mantissaLength","exponent","mantissa","exponentLength","eMax","eBias","rt","nBits","propertyIsEnumerable","dummy","Wrapper","NewTarget","NewTargetPrototype","functionToString","inspectSource","has","NATIVE_WEAK_MAP","shared","sharedKey","hiddenKeys","OBJECT_ALREADY_INITIALIZED","WeakMap","metadata","facade","STATE","$documentAll","noop","empty","construct","constructorRegExp","INCORRECT_TO_STRING","isConstructorModern","isConstructorLegacy","feature","detection","normalize","POLYFILL","NATIVE","string","isInteger","isFinite","MATCH","isRegExp","USE_SYMBOL_AS_UID","$Symbol","isArrayIteratorMethod","getIterator","iteratorClose","Result","stopped","ResultPrototype","iterable","unboundFunction","iterFn","AS_ENTRIES","IS_RECORD","IS_ITERATOR","INTERRUPTED","condition","callFn","kind","innerResult","innerError","IteratorPrototype","returnThis","IteratorConstructor","ENUMERABLE_NEXT","$","IS_PURE","createIteratorConstructor","IteratorsCore","BUGGY_SAFARI_ITERATORS","KEYS","VALUES","ENTRIES","Iterable","DEFAULT","IS_SET","CurrentIteratorPrototype","getIterationMethod","KIND","defaultIterator","IterablePrototype","INCORRECT_VALUES_NAME","nativeIterator","anyNativeIterator","entries","PrototypeOfArrayIteratorPrototype","arrayIterator","obj","CONFIGURABLE_LENGTH","TEMPLATE","arity","ceil","notify","toggle","node","macrotask","Queue","IS_IOS","IS_IOS_PEBBLE","IS_WEBOS_WEBKIT","MutationObserver","WebKitMutationObserver","queueMicrotaskDescriptor","microtask","queue","flush","parent","domain","exit","head","enter","nextTick","createTextNode","observe","characterData","add","PromiseCapability","$$resolve","$$reject","activeXDocument","definePropertiesModule","enumBugKeys","html","SCRIPT","IE_PROTO","EmptyConstructor","scriptTag","content","LT","NullProtoObjectViaActiveX","write","close","temp","parentWindow","NullProtoObject","ActiveXObject","JS","display","Properties","V8_PROTOTYPE_DEFINE_BUG","objectKeys","defineProperties","props","IE8_DOM_DEFINE","$defineProperty","$getOwnPropertyDescriptor","ENUMERABLE","WRITABLE","Attributes","current","propertyIsEnumerableModule","$getOwnPropertyNames","windowNames","getWindowNames","internalObjectKeys","getOwnPropertySymbols","CORRECT_PROTOTYPE_GETTER","names","$propertyIsEnumerable","NASHORN_BUG","uncurryThisAccessor","aPossiblePrototype","CORRECT_SETTER","input","pref","val","valueOf","getOwnPropertyNamesModule","getOwnPropertySymbolsModule","NativePromiseConstructor","IS_BROWSER","NativePromisePrototype","SUBCLASSING","NATIVE_PROMISE_REJECTION_EVENT","PromiseRejectionEvent","FORCED_PROMISE_CONSTRUCTOR","PROMISE_CONSTRUCTOR_SOURCE","GLOBAL_CORE_JS_PROMISE","FakePromise","CONSTRUCTOR","REJECTION_EVENT","newPromiseCapability","promiseCapability","checkCorrectnessOfIteration","tail","item","entry","R","re1","re2","regexpFlags","stickyHelpers","UNSUPPORTED_DOT_ALL","UNSUPPORTED_NCG","nativeReplace","nativeExec","patchedExec","UPDATES_LAST_INDEX_WRONG","lastIndex","UNSUPPORTED_Y","BROKEN_CARET","NPCG_INCLUDED","reCopy","group","raw","groups","sticky","charsAdded","strCopy","multiline","hasIndices","ignoreCase","dotAll","unicodeSets","$RegExp","MISSED_STICKY","CONSTRUCTOR_NAME","TAG","SHARED","mode","copyright","license","aConstructor","defaultConstructor","requireObjectCoercible","CONVERT_TO_STRING","pos","first","second","size","codeAt","whitespaces","ltrim","rtrim","trim","symbol","SymbolPrototype","TO_PRIMITIVE","hint","NATIVE_SYMBOL","keyFor","$location","defer","channel","port","validateArgumentsLength","setImmediate","clear","clearImmediate","Dispatch","MessageChannel","counter","ONREADYSTATECHANGE","location","run","id","runner","eventListener","globalPostMessageDefer","postMessage","protocol","host","handler","port2","port1","onmessage","importScripts","integer","toPrimitive","prim","BigInt","$RangeError","toPositiveInteger","BYTES","isSymbol","ordinaryToPrimitive","exoticToPrim","TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS","ArrayBufferViewCore","ArrayBufferModule","isIntegralNumber","toOffset","toUint8Clamped","typedArrayFrom","setSpecies","inheritIfRequired","nativeDefineProperty","nativeGetOwnPropertyDescriptor","BYTES_PER_ELEMENT","WRONG_LENGTH","fromList","isArrayBuffer","isTypedArrayIndex","wrappedGetOwnPropertyDescriptor","wrappedDefineProperty","wrapper","CLAMPED","GETTER","SETTER","NativeTypedArrayConstructor","TypedArrayConstructorPrototype","exported","addElement","typedArrayOffset","$length","$len","arrayFromConstructorAndList","typedArraySpeciesConstructor","instance","isBigIntArray","toBigInt","thisIsBigIntArray","mapfn","mapping","speciesConstructor","postfix","passed","required","path","wrappedWellKnownSymbolModule","WellKnownSymbolsStore","createWellKnownSymbol","withoutSetter","nativeArrayBufferSlice","viewSource","viewTarget","doesNotExceedSafeInteger","arrayMethodHasSpeciesSupport","IS_CONCAT_SPREADABLE","IS_CONCAT_SPREADABLE_SUPPORT","isConcatSpreadable","spreadable","E","A","$filter","addToUnscopables","defineIterator","createIterResultObject","ARRAY_ITERATOR","iterated","Arguments","nativeReverse","nativeSlice","HAS_SPECIES_SUPPORT","FUNCTION_NAME_EXISTS","nameRE","regExpExec","getReplacerFunction","$stringify","numberToString","tester","low","hi","WRONG_SYMBOLS_CONVERSION","ILL_FORMED_UNICODE","stringifyWithSymbolsFix","$replacer","fixIllFormed","space","thisNumberValue","NUMBER","NativeNumber","PureNumberNamespace","NumberPrototype","NumberWrapper","primValue","third","radix","maxCode","digits","toNumber","toNumeric","$getOwnPropertySymbols","nativeGetPrototypeOf","newPromiseCapabilityModule","perform","iterate","capability","$promiseResolve","remaining","alreadyCalled","real","onRejected","Internal","OwnPromiseCapability","nativeThen","task","hostReportErrors","PromiseConstructorDetection","PROMISE","NATIVE_PROMISE_SUBCLASSING","getInternalPromiseState","PromiseConstructor","PromisePrototype","newGenericPromiseCapability","DISPATCH_EVENT","dispatchEvent","UNHANDLED_REJECTION","isThenable","callReaction","reaction","exited","ok","fail","rejection","onHandleUnhandled","isReject","notified","reactions","onUnhandled","reason","initEvent","isUnhandled","emit","unwrap","internalReject","internalResolve","executor","onFulfilled","PromiseWrapper","race","promiseResolve","PromiseConstructorWrapper","CHECK_WRAPPER","STRING_ITERATOR","point","fixRegExpWellKnownSymbolLogic","advanceStringIndex","nativeMatch","maybeCallNative","matcher","rx","res","fullUnicode","matchStr","callRegExpExec","MAX_UINT32","$push","SPLIT_WORKS_WITH_OVERWRITTEN_EXEC","originalExec","SPLIT","nativeSplit","internalSplit","separator","limit","lim","lastLength","output","lastLastIndex","separatorCopy","splitter","unicodeMatching","q","z","defineWellKnownSymbol","$toString","nativeObjectCreate","getOwnPropertyNamesExternal","defineSymbolToPrimitive","HIDDEN","QObject","nativeGetOwnPropertyNames","nativePropertyIsEnumerable","AllSymbols","ObjectPrototypeSymbols","USE_SETTER","findChild","setSymbolDescriptor","ObjectPrototypeDescriptor","$defineProperties","properties","IS_OBJECT_PROTOTYPE","useSetter","useSimple","NativeSymbol","EmptyStringDescriptionStore","SymbolWrapper","thisSymbolValue","symbolDescriptiveString","desc","NATIVE_SYMBOL_REGISTRY","StringToSymbolRegistry","SymbolToStringRegistry","sym","u$ArrayCopyWithin","$every","$fill","actualValue","fromSpeciesAndList","$findIndex","predicate","$find","$includes","$indexOf","ArrayIterators","arrayValues","arrayKeys","arrayEntries","GENERIC","ITERATOR_IS_VALUES","typedArrayValues","$join","$map","$reduceRight","$reduce","$set","WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS","TO_OBJECT_BUG","arrayLike","$some","internalSort","FF","IE_OR_EDGE","V8","WEBKIT","nativeSort","ACCEPT_INCORRECT_ARGUMENTS","STABLE_SORT","mod","expected","getSortCompare","begin","beginIndex","$toLocaleString","toLocaleString","TO_LOCALE_STRING_BUG","Uint8ArrayPrototype","arrayToString","IS_NOT_ARRAY_METHOD","createTypedArrayConstructor","init","DOMIterables","handlePrototype","CollectionPrototype","COLLECTION_NAME","ArrayIteratorMethods","ArrayValues","ReflectOwnKeys","ReflectApply","receiver","NumberIsNaN","EventEmitter","once","emitter","errorListener","removeListener","resolver","eventTargetAgnosticAddListener","on","addErrorHandlerIfEventEmitter","_events","_eventsCount","_maxListeners","defaultMaxListeners","checkListener","listener","_getMaxListeners","_addListener","prepend","events","existing","warning","newListener","unshift","warned","warn","onceWrapper","fired","wrapFn","_onceWrap","wrapped","_listeners","evlistener","arr","ret","unwrapListeners","arrayClone","listenerCount","copy","wrapListener","removeEventListener","setMaxListeners","getMaxListeners","doError","er","listeners","addListener","prependListener","prependOnceListener","originalListener","shift","spliceOne","off","removeAllListeners","rawListeners","eventNames","extendStatics","__extends","__","__values","setLastICMessageTime","lastICMessageTime","setBanned","banned","setExtraFeatures","extrafeatures","setSelectedShout","selectedShout","setSelectedMenu","selectedMenu","setOldLoading","oldLoading","UPDATE_INTERVAL","setClient","client","setCHATBOX","CHATBOX","hdid","isLowMemory_1","fingerprintjs_1","index_1","queryParser_1","getResources_js_1","viewport_1","events_1","onReplayGo_1","packetHandler_1","loadResources_1","aoHost_1","fetchLists_1","serverIP","ip","theme","fp","Client","isLowMemory","loadResources","ms","_super","address","onOpen","onClose","onMessage","onError","serv","WebSocket","joinServer","hp","playerID","charID","char_list_length","evidence_list_length","music_list_length","testimonyID","chars","emotes","evidences","areas","musics","musics_time","callwords","manifest","resources","selectedEmote","selectedEvidence","checkUpdater","sender","viewport","_lastTimeICReceived","partial_packet","temp_packet","contains","handleSelf","message_event","MessageEvent","sendServer","setInterval","sendCheck","cleanup","msg","handle_server_packet","p_data","e_1","in_data","endsWith","packet_list","packet_list_1","packet_list_1_1","f_contents","packet","command","packetHandler","e_1_1","return","clearInterval","handleReplay","ooclog","rtime","clines","currentLine","substr","onReplayGo","resetMusicList","innerHTML","resetAreaList","fetchBackgroundList","fetchEvidenceList","fetchCharacterList","addTrack","client_1","encoding_1","paths_1","trackname","newentry","songName","getFilenameFromPath","unescapeChat","setAOhost","asset","appendICLog","showname","nameplate","time","shownameField","nameplateField","textField","className","getMinutes","timeStamp","innerText","toLocaleTimeString","hour","minute","clientLog","scrollTop","scrollHeight","checkCallword","sfxAudio","pause","play","createArea","areaClick_1","thisarea","players","cm","locked","newarea","title","onclick","area_click","fetchManifest","request_js_1","bgdata","bg_array","bg_select_1","parse","Option","background","char_select","chardata","character","evi_select","evidata","evi","manifestdata","fix_last_area","addTrack_1","malplaced","lastChild","handleBans","alert","handleCharacterInfo","iniParse_1","request_1","fileExists_1","chargs","charid","img","cini","getCharIcon","cinidata","default_options","default_emotions","extensions","charIconBaseUrl","fileUrl","alt","encodeURI","safeTags","side","blips","chat","category","emotions","gender","evidence","icon","inifile","muted","isAudio","ending","getCookie_1","evidence_js_1","backgrounds_js_1","changeMusicVolume_1","setChatbox_1","changeVolume_1","showNameClick_1","changeBlipVolume_1","reloadTheme_1","background_select","evidence_select","cookietheme","querySelector","selected","reloadTheme","cookiechatbox","setChatbox","changeMusicVolume","changeBlipVolume","checked","showname_click","resetICParams","saveChatlogHandle","downloadFile_1","icMessageLogs","messages","ye","mo","da","filename","getElementsByTagName","children","year","format","month","day","sendIC_1","sendSelf_1","sendServer_1","sendCheck_1","sendHP_1","sendOOC_1","sendCharacter_1","sendRT_1","sendMusicChange_1","sendZZ_1","sendEE_1","sendDE_1","sendPE_1","sendIC","sendSelf","sendHP","sendOOC","sendCharacter","sendRT","sendMusicChange","sendZZ","sendEE","sendDE","sendPE","escapeChat","client_2","deskmod","preanim","emote","sfx_name","emote_modifier","sfx_delay","objection_modifier","flip","realization","text_color","other_charid","self_hoffset","self_yoffset","noninterrupting_preanim","looping_sfx","screenshake","frame_screenshake","frame_realization","frame_sfx","additive","effect","extra_cccc","other_emote","other_offset","extra_27","extra_28","self_offset","serverMessage","track","setCookie_1","saveChatLogHandle_1","oocName","oocMessage","commands","commandsMap","Map","testimony","transparentPng_1","charactername","emotename","prefix","pair","pairID","characterFolder","emoteSelector","extensionsMap","extensionsMap_1","extensionsMap_1_1","getLastCharacter","getChatmsg","area","areaHr","blipVolume","blipChannels","clientVolume","musicVolume","music","getIndexFromSelect","select_box","select_element","_event","opusCheck","oldsrc","newsrc","pickEmotion","emo","setTheme","getTheme","href","resizeChatbox","chatContainerBox","clockBox","trackstatusBox","gameHeight","toFixed","trackstatus","weekday","getMonth","getDay","getHours","getDate","chatboxes_js_1","setstyle","chatbox_theme","themeselect","css_s","showFactorDialog","handleCredentialResponse","credential","updateActionCommands","role_select","selectedIndex","updateBackgroundPreview","tryUrls_1","background_filename","background_preview","resp","estring","replaceAll","decodeChat","prepChat","handleARUP","handleASS","handleBB","handleBD","handleBans_1","handleBN","updateBackgroundPreview_1","getIndexFromSelect_1","bgFromArgs","setBackgroundName","bgfolder","getBackgroundFolder","bg_index","getBackgroundName","set_side","showSpeedLines","showDesk","handleCC","handleCI","handleCharacterInfo_1","chargs_1","charid_1","handleCT","oocLog","handleCharsCheck","opacity","handleDONE","_args","handleEI","evidenceID","handleEM","createArea_1","fixLastArea_1","isAudio_1","trackindex","handleFA","handleFL","colorselect","handleFM","handleHI","handleHP","healthbox","percent_hp","getElementsByClassName","handleID","serverVersion","serverSoftware","handleJD","handleKB","handleKK","handleLE","evidence_box","evi_item","Image","pickEvidence","handleMC","appendICLog_1","musicname","looping","startsWith","loop","handleMM","handleMS","resetICParams_1","handleICSpeaking_1","char_id","char_name","msg_nameplate","msg_blips","char_chatbox","char_muted","chatmsg","chatbox","sprite","sound","snddelay","flash","speed","other_name","other_flip","effects","handle_ic_speaking","handlePN","handlePV","updateActionCommands_1","pickEmotion_1","me","emotesList","ini","emoteinfo","esfx","esfxd","soundn","soundt","sfxdelay","button","emote_item","handleRC","characters_js_1","handleRD","readOnly","handleRM","music_js_1","handleRMC","totime","getTime","currentTime","handleRT","initTestimonyUpdater_1","judgeid","initTestimonyUpdater","handleSC","handleSI","demothing","demoonclick","createAttribute","setAttributeNode","handleSM","handleSP","handleTI","timerid","timer_value","handleZZ","getSfxAudio","oldvolume","handleackMS","handleaskchaa","packets_1","packets","handleMS_1","handleCT_1","handleMC_1","handleRMC_1","twofactor_1","handleFL_1","handleLE_1","handleEM_1","handleEI_1","handleSC_1","handleCI_1","handleFM_1","handleFA_1","handleSM_1","handleMM_1","handleBD_1","handleBB_1","handleKB_1","handleKK_1","handleDONE_1","handleBN_1","handleHP_1","handleRT_1","handleTI_1","handleZZ_1","handleHI_1","handleID_1","handlePN_1","handleSI_1","handleARUP_1","handleaskchaa_1","handleCC_1","handleRC_1","handleRM_1","handleRD_1","handleCharsCheck_1","handlePV_1","handleASS_1","handleackMS_1","handleSP_1","handleJD_1","file","Blob","URL","createObjectURL","download","click","__read","defaultUrl","aomlParsed","parsed","currentHeader","contentName","contentValue","contentKey","aomlParser","applyMarkdown","defaultColor","identifiers","startIdentifiers","closingStack","colorStack","text_1","text_1_1","letter","currentSelector","currentIdentifier","currentClosingLetter","keepChar","currentColor","e_4","e_2_1","e_2","startingIdentifiers","e_3_1","e_3","Set","remove","e_4_1","cname","ca","decodeURIComponent","substring","queryDict","search","urlExtensionsToTry","fullFileUrl","COLORS","defaultChatMsg","startpreanim","startspeaking","preanimdelay","positions","def","bg","desk","ao2","ao1","speedLines","pro","hld","hlp","wit","jud","jur","sea","SHOUTS","createBlipsChannels","opusCheck_1","blipSelectors","createMusic","audioChannels","createSfxAudio","createShoutAudio","shoutAudio","createTestimonyAudio","testimonyAudio","setStartThirdTickCheck","startThirdTickCheck","setStartSecondTickCheck","startSecondTickCheck","setStartFirstTickCheck","startFirstTickCheck","checkCallword_1","setEmote_1","shouts_1","getAnimLength_1","resizeChatbox_1","colors_1","attorneyMarkdown","playerChatMsg","charLayers","pairLayers","fg","gamewindow","waitingBox","eviBox","nameBoxInner","chatBoxInner","displayname","shoutSprite","shout","gifLength","setAside","skipoffset","effectName","badEffects","intensity","drop","baseEffectUrl","setChatmsg","setTextNow","setSfxPlayed","setTickTimer","setAnimating","clearTimeout","updater","animation","getLastEvidence","setLastEvidence","getTextNow","setLastCharacter","shoutaudio","setShoutTimer","transform","textAlign","childElementCount","animationDelay","chat_tick","testimonyOverlay","setTestimonyTimer","setTestimonyUpdater","updateTestimony","positions_1","bench","court","deskFilename","createBlipChannels_1","defaultChatMsg_1","createMusic_1","createSfxAudio_1","createShoutAudio_1","createTestimonyAudio_1","setSide_1","testimonyUpdater","animating","currentBlipChannel","lastChar","lastEvi","sfxplayed","shoutTimer","testimonyTimer","textnow","tickTimer","backgroundName","playSFX","sfxname","resource","disposeTestimony","handleTextTick","chatBox","charName","charEmote","characterElement","nextCharacterElement","shake","currentCharacter","effectlayer","removeProperty","pairName","pairEmote","isShoutOver","isShoutAndPreanimOver","hasNonInterruptingPreAnim","getSfxPlayed","getTickTimer","getAnimating","getShoutTimer","getTestimonyTimer","getTestimonyUpdater","setSfxAudio","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","chunkIds","notFulfilled","splice","__esModule","definition","prop","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/client.html b/client.html index 2e5e6433..6371ca17 100644 --- a/client.html +++ b/client.html @@ -1 +1 @@ -Attorney Online session
\ No newline at end of file +Attorney Online session

Loading

Choose your character





Having trouble? Join us on Discord

\ No newline at end of file diff --git a/dom.f4368b8b305de31e374e.bundle.js.map b/dom.f4368b8b305de31e374e.bundle.js.map index f0eae5e5..2c58dfc7 100644 --- a/dom.f4368b8b305de31e374e.bundle.js.map +++ b/dom.f4368b8b305de31e374e.bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"dom.f4368b8b305de31e374e.bundle.js","mappings":"kGAYAA,OAAOC,aAPA,SAAsBC,GACvBA,EAAOC,UAAUC,SAAS,QAC5BF,EAAOG,UAAY,gBAEnBH,EAAOG,UAAY,oBAEvB,C,uBCC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,IAAM,GAAGF,OAAOF,EAASK,QAAS,aAAaH,OAAOoN,UAAUF,EAAkBvO,MAAM6D,kBAGzG0K,EAAkBhP,MAAMC,QAAU,OAClCgP,EAAiBjN,IAAM,GAAGF,OAAOF,EAASK,QAAS,aAAaH,OAAOoN,UAAU7O,EAAgBI,MAAM6D,gBAE/G,CACA5C,EAAQK,mBAAqBA,EAC7B1C,OAAO0C,mBAAqBA,C,qBCJ5B1C,OAAO8P,cAXP,WACI,IAAIC,EAActP,SAASC,eAAe,oBACtCsP,EAAYvP,SAASC,eAAe,kBACP,IAA7BqP,EAAW1O,cACX2O,EAASrP,MAAMC,QAAU,UAGzBoP,EAASrP,MAAMC,QAAU,MAEjC,C","sources":["webpack://webao/./webAO/dom/toggleEffect.js","webpack://webao/./webAO/dom/toggleElement.js","webpack://webao/./webAO/dom/addEvidence.ts","webpack://webao/./webAO/dom/addHPD.ts","webpack://webao/./webAO/dom/addHPP.ts","webpack://webao/./webAO/dom/callMod.ts","webpack://webao/./webAO/dom/cancelEvidence.ts","webpack://webao/./webAO/dom/changeBackgroundOOC.ts","webpack://webao/./webAO/dom/changeCallwords.ts","webpack://webao/./webAO/dom/changeCharacter.ts","webpack://webao/./webAO/dom/changeRoleOOC.ts","webpack://webao/./webAO/dom/charError.ts","webpack://webao/./webAO/dom/charTableFilter.ts","webpack://webao/./webAO/dom/deleteEvidence.ts","webpack://webao/./webAO/dom/editEvidence.ts","webpack://webao/./webAO/dom/guilty.ts","webpack://webao/./webAO/dom/imgError.ts","webpack://webao/./webAO/dom/iniEdit.ts","webpack://webao/./webAO/dom/initCE.ts","webpack://webao/./webAO/dom/initWT.ts","webpack://webao/./webAO/dom/modCallTest.ts","webpack://webao/./webAO/dom/musicListClick.ts","webpack://webao/./webAO/dom/musicListFilter.ts","webpack://webao/./webAO/dom/muteListClick.ts","webpack://webao/./webAO/dom/notGuilty.ts","webpack://webao/./webAO/dom/onEnter.ts","webpack://webao/./webAO/dom/onOOCEnter.ts","webpack://webao/./webAO/dom/pickChar.ts","webpack://webao/./webAO/dom/pickEvidence.ts","webpack://webao/./webAO/dom/randomCharacterOOC.ts","webpack://webao/./webAO/dom/reconnectButton.ts","webpack://webao/./webAO/dom/redHPD.ts","webpack://webao/./webAO/dom/redHPP.ts","webpack://webao/./webAO/dom/resetOffset.ts","webpack://webao/./webAO/dom/switchAspectRatio.ts","webpack://webao/./webAO/dom/switchChatOffset.ts","webpack://webao/./webAO/dom/switchPanTilt.ts","webpack://webao/./webAO/dom/toggleMenu.ts","webpack://webao/./webAO/dom/toggleShout.ts","webpack://webao/./webAO/dom/updateEvidenceIcon.ts","webpack://webao/./webAO/dom/updateIniswap.ts"],"sourcesContent":["/**\n * Highlights and selects an effect for in-character chat.\n * If the same effect button is selected, then the effect is canceled.\n * @param {string} effect the new effect to be selected\n */\nexport function toggleEffect(button) {\n if (button.classList.contains('dark')) {\n button.className = 'client_button';\n } else {\n button.className = 'client_button dark';\n }\n}\nwindow.toggleEffect = toggleEffect;\n","/**\n * Hides and shows any html element\n * @param {string} element_id the id of the element to toggle\n */\nexport function toggleElement(element_id) {\n const element = document.getElementById(element_id);\n if (element.style.display !== 'none') {\n element.style.display = 'none';\n } else {\n element.style.display = 'block';\n }\n}\nwindow.toggleElement = toggleElement;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addEvidence = void 0;\nvar client_1 = require(\"../client\");\nvar cancelEvidence_1 = require(\"./cancelEvidence\");\n/**\n * Add evidence.\n */\nfunction addEvidence() {\n var evidence_select = (document.getElementById(\"evi_select\"));\n client_1.client.sender.sendPE(document.getElementById(\"evi_name\").value, document.getElementById(\"evi_desc\").value, evidence_select.selectedIndex === 0\n ? document.getElementById(\"evi_filename\").value\n : evidence_select.options[evidence_select.selectedIndex].text);\n (0, cancelEvidence_1.cancelEvidence)();\n}\nexports.addEvidence = addEvidence;\nwindow.addEvidence = addEvidence;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addHPD = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Increment defense health point.\n */\nfunction addHPD() {\n client_1.client.sender.sendHP(1, client_1.client.hp[0] + 1);\n}\nexports.addHPD = addHPD;\nwindow.addHPD = addHPD;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addHPP = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Increment prosecution health point.\n */\nfunction addHPP() {\n client_1.client.sender.sendHP(2, client_1.client.hp[1] + 1);\n}\nexports.addHPP = addHPP;\nwindow.addHPP = addHPP;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.callMod = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Call mod.\n */\nfunction callMod() {\n var modcall;\n if (client_1.extrafeatures.includes(\"modcall_reason\")) {\n modcall = prompt(\"Please enter the reason for the modcall\", \"\");\n }\n if (modcall == null || modcall === \"\") {\n // cancel\n }\n else {\n client_1.client.sender.sendZZ(modcall);\n }\n}\nexports.callMod = callMod;\nwindow.callMod = callMod;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.cancelEvidence = void 0;\nvar client_1 = require(\"../client\");\nvar updateEvidenceIcon_1 = require(\"./updateEvidenceIcon\");\nvar aoHost_1 = require(\"../client/aoHost\");\n/**\n * Cancel evidence selection.\n */\nfunction cancelEvidence() {\n // Clear evidence data\n if (client_1.client.selectedEvidence > 0) {\n document.getElementById(\"evi_\".concat(client_1.client.selectedEvidence)).className =\n \"evi_icon\";\n }\n client_1.client.selectedEvidence = 0;\n // Clear evidence on information window\n document.getElementById(\"evi_select\").selectedIndex = 0;\n (0, updateEvidenceIcon_1.updateEvidenceIcon)(); // Update icon widget\n document.getElementById(\"evi_filename\").value = \"\";\n document.getElementById(\"evi_name\").value = \"\";\n document.getElementById(\"evi_desc\").value = \"\";\n (document.getElementById(\"evi_preview\")).src = \"\".concat(aoHost_1.AO_HOST, \"misc/empty.png\"); // Clear icon\n // Update button\n document.getElementById(\"evi_add\").className = \"client_button hover_button\";\n document.getElementById(\"evi_edit\").className =\n \"client_button hover_button inactive\";\n document.getElementById(\"evi_cancel\").className =\n \"client_button hover_button inactive\";\n document.getElementById(\"evi_del\").className =\n \"client_button hover_button inactive\";\n}\nexports.cancelEvidence = cancelEvidence;\nwindow.cancelEvidence = cancelEvidence;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.changeBackgroundOOC = void 0;\nvar queryParser_1 = require(\"../utils/queryParser\");\nvar client_1 = require(\"../client\");\nvar mode = (0, queryParser_1.default)().mode;\n/**\n * Change background via OOC.\n */\nfunction changeBackgroundOOC() {\n var selectedBG = document.getElementById(\"bg_select\");\n var changeBGCommand = \"bg $1\";\n var bgFilename = document.getElementById(\"bg_filename\");\n var filename = \"\";\n if (selectedBG.selectedIndex === 0) {\n filename = bgFilename.value;\n }\n else {\n filename = selectedBG.value;\n }\n if (mode === \"join\") {\n client_1.client.sender.sendOOC(\"/\".concat(changeBGCommand.replace(\"$1\", filename)));\n }\n else if (mode === \"replay\") {\n client_1.client.sender.sendSelf(\"BN#\".concat(filename, \"#%\"));\n }\n}\nexports.changeBackgroundOOC = changeBackgroundOOC;\nwindow.changeBackgroundOOC = changeBackgroundOOC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.changeCallwords = void 0;\nvar client_1 = require(\"../client\");\nvar setCookie_1 = require(\"../utils/setCookie\");\n/**\n * Triggered by a changed callword list\n */\nfunction changeCallwords() {\n client_1.client.callwords = (document.getElementById(\"client_callwords\")).value.split(\"\\n\");\n (0, setCookie_1.default)(\"callwords\", client_1.client.callwords.join(\"\\n\"));\n}\nexports.changeCallwords = changeCallwords;\nwindow.changeCallwords = changeCallwords;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.changeCharacter = void 0;\n/**\n * Triggered when a character icon is clicked in the character selection menu.\n * @param {MouseEvent} event\n */\nfunction changeCharacter(_event) {\n document.getElementById(\"client_waiting\").style.display = \"block\";\n document.getElementById(\"client_charselect\").style.display = \"block\";\n document.getElementById(\"client_emo\").innerHTML = \"\";\n}\nexports.changeCharacter = changeCharacter;\nwindow.changeCharacter = changeCharacter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.changeRoleOOC = void 0;\nvar updateActionCommands_1 = require(\"./updateActionCommands\");\nvar client_1 = require(\"../client\");\n/**\n * Change role via OOC.\n */\nfunction changeRoleOOC() {\n var roleselect = document.getElementById(\"role_select\");\n client_1.client.sender.sendOOC(\"/pos \".concat(roleselect.value));\n client_1.client.sender.sendServer(\"SP#\".concat(roleselect.value, \"#%\"));\n (0, updateActionCommands_1.updateActionCommands)(roleselect.value);\n}\nexports.changeRoleOOC = changeRoleOOC;\nwindow.changeRoleOOC = changeRoleOOC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.charError = void 0;\nvar transparentPng_1 = require(\"../constants/transparentPng\");\n/**\n * Triggered when there was an error loading a character sprite.\n * @param {HTMLImageElement} image the element containing the missing image\n */\nfunction charError(image) {\n console.warn(\"\".concat(image.src, \" is missing from webAO\"));\n image.src = transparentPng_1.default;\n return true;\n}\nexports.charError = charError;\nwindow.charError = charError;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.chartable_filter = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Triggered when the music search bar is changed\n * @param {MouseEvent} event\n */\nfunction chartable_filter(_event) {\n var searchname = (document.getElementById(\"client_charactersearch\")).value;\n client_1.client.chars.forEach(function (character, charid) {\n var demothing = document.getElementById(\"demo_\".concat(charid));\n if (character.name.toLowerCase().indexOf(searchname.toLowerCase()) === -1) {\n demothing.style.display = \"none\";\n }\n else {\n demothing.style.display = \"inline-block\";\n }\n });\n}\nexports.chartable_filter = chartable_filter;\nwindow.chartable_filter = chartable_filter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deleteEvidence = void 0;\nvar client_1 = require(\"../client\");\nvar cancelEvidence_1 = require(\"./cancelEvidence\");\n/**\n * Delete selected evidence.\n */\nfunction deleteEvidence() {\n var id = client_1.client.selectedEvidence - 1;\n client_1.client.sender.sendDE(id);\n (0, cancelEvidence_1.cancelEvidence)();\n}\nexports.deleteEvidence = deleteEvidence;\nwindow.deleteEvidence = deleteEvidence;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.editEvidence = void 0;\nvar client_1 = require(\"../client\");\nvar cancelEvidence_1 = require(\"./cancelEvidence\");\n/**\n * Edit selected evidence.\n */\nfunction editEvidence() {\n var evidence_select = (document.getElementById(\"evi_select\"));\n var id = client_1.client.selectedEvidence - 1;\n client_1.client.sender.sendEE(id, document.getElementById(\"evi_name\").value, document.getElementById(\"evi_desc\").value, evidence_select.selectedIndex === 0\n ? document.getElementById(\"evi_filename\").value\n : evidence_select.options[evidence_select.selectedIndex].text);\n (0, cancelEvidence_1.cancelEvidence)();\n}\nexports.editEvidence = editEvidence;\nwindow.editEvidence = editEvidence;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.guilty = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Declare the defendant not guilty\n */\nfunction guilty() {\n client_1.client.sender.sendRT(\"judgeruling#1\");\n}\nexports.guilty = guilty;\nwindow.guilty = guilty;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.imgError = void 0;\n/**\n * Triggered when there was an error loading a generic sprite.\n * @param {HTMLImageElement} image the element containing the missing image\n */\nfunction imgError(image) {\n image.onerror = null;\n image.src = \"\"; // unload so the old sprite doesn't persist\n return true;\n}\nexports.imgError = imgError;\nwindow.imgError = imgError;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.iniedit = void 0;\nvar client_1 = require(\"../client\");\nvar handleCharacterInfo_1 = require(\"../client/handleCharacterInfo\");\nvar packetHandler_1 = require(\"../packets/packetHandler\");\n/**\n * Triggered by the ini button.\n */\nfunction iniedit() {\n return __awaiter(this, void 0, void 0, function () {\n var iniselect, ininame, inicharID, newname;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n iniselect = document.getElementById(\"client_iniselect\");\n ininame = document.getElementById(\"client_ininame\");\n inicharID = client_1.client.charID;\n newname = iniselect.selectedIndex === 0 ? ininame.value : iniselect.value;\n return [4 /*yield*/, (0, handleCharacterInfo_1.handleCharacterInfo)(newname.split(\"&\"), inicharID)];\n case 1:\n _a.sent();\n packetHandler_1.packetHandler.get(\"PV\")(\"PV#0#CID#\".concat(inicharID).split(\"#\"));\n return [2 /*return*/];\n }\n });\n });\n}\nexports.iniedit = iniedit;\nwindow.iniedit = iniedit;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.initCE = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Declare cross examination.\n */\nfunction initCE() {\n client_1.client.sender.sendRT(\"testimony2\");\n}\nexports.initCE = initCE;\nwindow.initCE = initCE;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.initWT = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Declare witness testimony.\n */\nfunction initWT() {\n client_1.client.sender.sendRT(\"testimony1\");\n}\nexports.initWT = initWT;\nwindow.initWT = initWT;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.modcall_test = void 0;\nvar packetHandler_1 = require(\"../packets/packetHandler\");\n/**\n * Triggered by the modcall sfx dropdown\n */\nfunction modcall_test() {\n packetHandler_1.packetHandler.get(\"ZZ\")(\"test#test\".split(\"#\"));\n}\nexports.modcall_test = modcall_test;\nwindow.modcall_test = modcall_test;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.musiclist_click = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Triggered when an item on the music list is clicked.\n * @param {MouseEvent} event\n */\nfunction musiclist_click(_event) {\n var playtrack = (document.getElementById(\"client_musiclist\")).value;\n client_1.client.sender.sendMusicChange(playtrack);\n // This is here so you can't actually select multiple tracks,\n // even though the select tag has the multiple option to render differently\n var musiclist_elements = (document.getElementById(\"client_musiclist\")).selectedOptions;\n for (var i = 0; i < musiclist_elements.length; i++) {\n musiclist_elements[i].selected = false;\n }\n}\nexports.musiclist_click = musiclist_click;\nwindow.musiclist_click = musiclist_click;\n","\"use strict\";\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.musiclist_filter = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Triggered when the music search bar is changed\n * @param {MouseEvent} event\n */\nfunction musiclist_filter(_event) {\n var e_1, _a;\n var musiclist_element = (document.getElementById(\"client_musiclist\"));\n var searchname = (document.getElementById(\"client_musicsearch\")).value;\n musiclist_element.innerHTML = \"\";\n try {\n for (var _b = __values(client_1.client.musics), _c = _b.next(); !_c.done; _c = _b.next()) {\n var trackname = _c.value;\n if (trackname.toLowerCase().indexOf(searchname.toLowerCase()) !== -1) {\n var newentry = document.createElement(\"OPTION\");\n newentry.text = trackname;\n musiclist_element.options.add(newentry);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n}\nexports.musiclist_filter = musiclist_filter;\nwindow.musiclist_filter = musiclist_filter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mutelist_click = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Triggered when a character in the mute list is clicked\n * @param {MouseEvent} event\n */\nfunction mutelist_click(_event) {\n var mutelist = (document.getElementById('mute_select'));\n var selected_character = mutelist.options[mutelist.selectedIndex];\n if (client_1.client.chars[selected_character.value].muted === false) {\n client_1.client.chars[selected_character.value].muted = true;\n selected_character.text = \"\".concat(client_1.client.chars[selected_character.value].name, \" (muted)\");\n console.info(\"muted \".concat(client_1.client.chars[selected_character.value].name));\n }\n else {\n client_1.client.chars[selected_character.value].muted = false;\n selected_character.text = client_1.client.chars[selected_character.value].name;\n }\n}\nexports.mutelist_click = mutelist_click;\nwindow.mutelist_click = mutelist_click;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.notguilty = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Declare the defendant not guilty\n */\nfunction notguilty() {\n client_1.client.sender.sendRT(\"judgeruling#0\");\n}\nexports.notguilty = notguilty;\nwindow.notguilty = notguilty;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.onEnter = void 0;\nvar client_1 = require(\"../client\");\nvar encoding_1 = require(\"../encoding\");\n/**\n * Triggered when the Return key is pressed on the in-character chat input box.\n * @param {KeyboardEvent} event\n */\nfunction onEnter(event) {\n if (event.keyCode === 13) {\n var mychar = client_1.client.character;\n var myemo = client_1.client.emote;\n var evi = client_1.client.evidence;\n var flip = Boolean(document.getElementById(\"button_flip\").classList.contains(\"dark\"));\n var flash = Boolean(document.getElementById(\"button_flash\").classList.contains(\"dark\"));\n var screenshake = Boolean(document.getElementById(\"button_shake\").classList.contains(\"dark\"));\n var noninterrupting_preanim = Boolean(document.getElementById(\"check_nonint\").checked);\n var looping_sfx = Boolean(document.getElementById(\"check_loopsfx\").checked);\n var color = Number(document.getElementById(\"textcolor\").value);\n var showname = (0, encoding_1.escapeChat)(document.getElementById(\"ic_chat_name\").value);\n var text = document.getElementById(\"client_inputbox\")\n .value;\n var pairchar = document.getElementById(\"pair_select\")\n .value;\n var pairoffset = Number(document.getElementById(\"pair_offset\").value);\n var pairyoffset = Number(document.getElementById(\"pair_y_offset\").value);\n var myrole = document.getElementById(\"role_select\")\n .value\n ? document.getElementById(\"role_select\").value\n : mychar.side;\n var additive = Boolean(document.getElementById(\"check_additive\").checked);\n var effect = document.getElementById(\"effect_select\")\n .value;\n var sfxname = \"0\";\n var sfxdelay = 0;\n var emote_mod = myemo.zoom;\n if (document.getElementById(\"sendsfx\").checked) {\n sfxname = myemo.sfx;\n sfxdelay = myemo.sfxdelay;\n }\n // not to overwrite a 5 from the ini or anything else\n if (document.getElementById(\"sendpreanim\").checked) {\n if (emote_mod === 0) {\n emote_mod = 1;\n }\n }\n else if (emote_mod === 1) {\n emote_mod = 0;\n }\n client_1.client.sender.sendIC(myemo.deskmod, myemo.preanim, mychar.name, myemo.emote, text, myrole, sfxname, emote_mod, sfxdelay, client_1.selectedShout, evi, flip, flash, color, showname, pairchar, pairoffset, pairyoffset, noninterrupting_preanim, looping_sfx, screenshake, \"-\", \"-\", \"-\", additive, effect);\n }\n return false;\n}\nexports.onEnter = onEnter;\nwindow.onEnter = onEnter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.onOOCEnter = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Triggered when the Return key is pressed on the out-of-character chat input box.\n * @param {KeyboardEvent} event\n */\nfunction onOOCEnter(event) {\n if (event.keyCode === 13) {\n client_1.client.sender.sendOOC(document.getElementById(\"client_oocinputbox\").value);\n document.getElementById(\"client_oocinputbox\").value =\n \"\";\n }\n}\nexports.onOOCEnter = onOOCEnter;\nwindow.onOOCEnter = onOOCEnter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.pickChar = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Requests to play as a character.\n * @param {number} ccharacter the character ID; if this is a large number,\n * then spectator is chosen instead.\n */\nfunction pickChar(ccharacter) {\n if (ccharacter === -1) {\n // Spectator\n document.getElementById(\"client_waiting\").style.display = \"none\";\n document.getElementById(\"client_charselect\").style.display = \"none\";\n }\n client_1.client.sender.sendCharacter(ccharacter);\n}\nexports.pickChar = pickChar;\nwindow.pickChar = pickChar;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.pickEvidence = void 0;\nvar client_1 = require(\"../client\");\nvar cancelEvidence_1 = require(\"./cancelEvidence\");\nvar updateEvidenceIcon_1 = require(\"./updateEvidenceIcon\");\nvar getIndexFromSelect_1 = require(\"./getIndexFromSelect\");\n/**\n * Highlights and selects an evidence for in-character chat.\n * @param {string} evidence the evidence to be presented\n */\nfunction pickEvidence(evidence) {\n if (client_1.client.selectedEvidence !== evidence) {\n // Update selected evidence\n if (client_1.client.selectedEvidence > 0) {\n document.getElementById(\"evi_\".concat(client_1.client.selectedEvidence)).className =\n \"evi_icon\";\n }\n document.getElementById(\"evi_\".concat(evidence)).className = \"evi_icon dark\";\n client_1.client.selectedEvidence = evidence;\n // Show evidence on information window\n document.getElementById(\"evi_name\").value =\n client_1.client.evidences[evidence - 1].name;\n document.getElementById(\"evi_desc\").value =\n client_1.client.evidences[evidence - 1].desc;\n // Update icon\n var icon_id = (0, getIndexFromSelect_1.getIndexFromSelect)(\"evi_select\", client_1.client.evidences[evidence - 1].filename);\n document.getElementById(\"evi_select\").selectedIndex =\n icon_id;\n if (icon_id === 0) {\n document.getElementById(\"evi_filename\").value =\n client_1.client.evidences[evidence - 1].filename;\n }\n (0, updateEvidenceIcon_1.updateEvidenceIcon)();\n // Update button\n document.getElementById(\"evi_add\").className =\n \"client_button hover_button inactive\";\n document.getElementById(\"evi_edit\").className =\n \"client_button hover_button\";\n document.getElementById(\"evi_cancel\").className =\n \"client_button hover_button\";\n document.getElementById(\"evi_del\").className = \"client_button hover_button\";\n }\n else {\n (0, cancelEvidence_1.cancelEvidence)();\n }\n}\nexports.pickEvidence = pickEvidence;\nwindow.pickEvidence = pickEvidence;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.randomCharacterOOC = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Random character via OOC.\n */\nfunction randomCharacterOOC() {\n client_1.client.sender.sendOOC(\"/randomchar\");\n}\nexports.randomCharacterOOC = randomCharacterOOC;\nwindow.randomCharacterOOC = randomCharacterOOC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ReconnectButton = void 0;\nvar client_1 = require(\"../client\");\nvar queryParser_1 = require(\"../utils/queryParser\");\nvar serverIP = (0, queryParser_1.default)().ip;\n/**\n * Triggered when the reconnect button is pushed.\n */\nfunction ReconnectButton() {\n client_1.client.cleanup();\n (0, client_1.setClient)(new client_1.default(serverIP));\n if (client_1.client) {\n document.getElementById(\"client_error\").style.display = \"none\";\n }\n}\nexports.ReconnectButton = ReconnectButton;\nwindow.ReconnectButton = ReconnectButton;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.redHPD = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Decrement defense health point.\n */\nfunction redHPD() {\n client_1.client.sender.sendHP(1, client_1.client.hp[0] - 1);\n}\nexports.redHPD = redHPD;\nwindow.redHPD = redHPD;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.redHPP = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Decrement prosecution health point.\n */\nfunction redHPP() {\n client_1.client.sender.sendHP(2, client_1.client.hp[1] - 1);\n}\nexports.redHPP = redHPP;\nwindow.redHPP = redHPP;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resetOffset = void 0;\nfunction resetOffset(_event) {\n document.getElementById(\"pair_offset\").value = \"0\";\n document.getElementById(\"pair_y_offset\").value = \"0\";\n}\nexports.resetOffset = resetOffset;\nwindow.resetOffset = resetOffset;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.switchAspectRatio = void 0;\n/**\n * Triggered by the change aspect ratio checkbox\n */\nfunction switchAspectRatio() {\n return __awaiter(this, void 0, void 0, function () {\n var background, offsetCheck;\n return __generator(this, function (_a) {\n background = document.getElementById(\"client_gamewindow\");\n offsetCheck = (document.getElementById(\"client_hdviewport_offset\"));\n if (document.getElementById(\"client_hdviewport\").checked) {\n background.style.paddingBottom = \"56.25%\";\n offsetCheck.disabled = false;\n }\n else {\n background.style.paddingBottom = \"75%\";\n offsetCheck.disabled = true;\n }\n return [2 /*return*/];\n });\n });\n}\nexports.switchAspectRatio = switchAspectRatio;\nwindow.switchAspectRatio = switchAspectRatio;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.switchChatOffset = void 0;\n/**\n * Triggered by the change aspect ratio checkbox\n */\nfunction switchChatOffset() {\n return __awaiter(this, void 0, void 0, function () {\n var container;\n return __generator(this, function (_a) {\n container = document.getElementById(\"client_chatcontainer\");\n if (document.getElementById(\"client_hdviewport_offset\")\n .checked) {\n container.style.width = \"80%\";\n container.style.left = \"10%\";\n }\n else {\n container.style.width = \"100%\";\n container.style.left = \"0\";\n }\n return [2 /*return*/];\n });\n });\n}\nexports.switchChatOffset = switchChatOffset;\nwindow.switchChatOffset = switchChatOffset;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.switchPanTilt = void 0;\n/**\n * Triggered by the pantilt checkbox\n */\nfunction switchPanTilt() {\n return __awaiter(this, void 0, void 0, function () {\n var fullview, checkbox;\n return __generator(this, function (_a) {\n fullview = document.getElementById(\"client_fullview\");\n checkbox = document.getElementById(\"client_pantilt\");\n if (checkbox.checked) {\n fullview.style.transition = \"0.5s ease-in-out\";\n }\n else {\n fullview.style.transition = \"none\";\n }\n return [2 /*return*/];\n });\n });\n}\nexports.switchPanTilt = switchPanTilt;\nwindow.switchPanTilt = switchPanTilt;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toggleMenu = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Highlights and selects a menu.\n * @param {number} menu the menu to be selected\n */\nfunction toggleMenu(menu) {\n if (menu !== client_1.selectedMenu) {\n document.getElementById(\"menu_\".concat(menu)).className = \"menu_button active\";\n document.getElementById(\"content_\".concat(menu)).className =\n \"menu_content active\";\n document.getElementById(\"menu_\".concat(client_1.selectedMenu)).className = \"menu_button\";\n document.getElementById(\"content_\".concat(client_1.selectedMenu)).className =\n \"menu_content\";\n (0, client_1.setSelectedMenu)(menu);\n }\n}\nexports.toggleMenu = toggleMenu;\nwindow.toggleMenu = toggleMenu;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toggleShout = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Highlights and selects a shout for in-character chat.\n * If the same shout button is selected, then the shout is canceled.\n * @param {number} shout the new shout to be selected\n */\nfunction toggleShout(shout) {\n if (shout === client_1.selectedShout) {\n document.getElementById(\"button_\".concat(shout)).className = \"client_button\";\n (0, client_1.setSelectedShout)(0);\n }\n else {\n document.getElementById(\"button_\".concat(shout)).className = \"client_button dark\";\n if (client_1.selectedShout) {\n document.getElementById(\"button_\".concat(client_1.selectedShout)).className =\n \"client_button\";\n }\n (0, client_1.setSelectedShout)(shout);\n }\n}\nexports.toggleShout = toggleShout;\nwindow.toggleShout = toggleShout;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateEvidenceIcon = void 0;\nvar aoHost_1 = require(\"../client/aoHost\");\n/**\n * Update evidence icon.\n */\nfunction updateEvidenceIcon() {\n var evidence_select = (document.getElementById(\"evi_select\"));\n var evidence_filename = (document.getElementById(\"evi_filename\"));\n var evidence_iconbox = (document.getElementById(\"evi_preview\"));\n if (evidence_select.selectedIndex === 0) {\n evidence_filename.style.display = \"initial\";\n evidence_iconbox.src = \"\".concat(aoHost_1.AO_HOST, \"evidence/\").concat(encodeURI(evidence_filename.value.toLowerCase()));\n }\n else {\n evidence_filename.style.display = \"none\";\n evidence_iconbox.src = \"\".concat(aoHost_1.AO_HOST, \"evidence/\").concat(encodeURI(evidence_select.value.toLowerCase()));\n }\n}\nexports.updateEvidenceIcon = updateEvidenceIcon;\nwindow.updateEvidenceIcon = updateEvidenceIcon;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateIniswap = void 0;\n/**\n * Update iniswap drowdown\n */\nfunction updateIniswap() {\n var ini_select = (document.getElementById(\"client_iniselect\"));\n var ini_name = (document.getElementById(\"client_ininame\"));\n if (ini_select.selectedIndex === 0) {\n ini_name.style.display = \"initial\";\n }\n else {\n ini_name.style.display = \"none\";\n }\n}\nexports.updateIniswap = updateIniswap;\nwindow.updateIniswap = updateIniswap;\n"],"names":["window","toggleEffect","button","classList","contains","className","toggleElement","element_id","element","document","getElementById","style","display","client_1","cancelEvidence_1","addEvidence","evidence_select","client","sender","sendPE","value","selectedIndex","options","text","cancelEvidence","addHPD","sendHP","hp","addHPP","callMod","modcall","extrafeatures","includes","prompt","sendZZ","Object","defineProperty","exports","updateEvidenceIcon_1","aoHost_1","selectedEvidence","concat","updateEvidenceIcon","src","AO_HOST","queryParser_1","mode","default","changeBackgroundOOC","filename","selectedBG","bgFilename","sendOOC","replace","sendSelf","setCookie_1","changeCallwords","callwords","split","join","changeCharacter","_event","innerHTML","updateActionCommands_1","changeRoleOOC","roleselect","sendServer","updateActionCommands","transparentPng_1","charError","image","console","warn","chartable_filter","searchname","chars","forEach","character","charid","demothing","name","toLowerCase","indexOf","deleteEvidence","id","sendDE","editEvidence","sendEE","guilty","sendRT","imgError","onerror","__awaiter","this","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","f","y","t","g","_","label","sent","trys","ops","verb","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","iniedit","handleCharacterInfo_1","packetHandler_1","iniselect","ininame","inicharID","newname","_a","charID","handleCharacterInfo","packetHandler","get","initCE","initWT","modcall_test","musiclist_click","playtrack","sendMusicChange","musiclist_elements","selectedOptions","i","selected","__values","o","s","m","musiclist_filter","e_1","musiclist_element","_b","musics","_c","trackname","newentry","createElement","add","e_1_1","error","return","mutelist_click","mutelist","selected_character","muted","info","notguilty","encoding_1","onEnter","event","keyCode","mychar","myemo","emote","evi","evidence","flip","Boolean","flash","screenshake","noninterrupting_preanim","checked","looping_sfx","color","Number","showname","escapeChat","pairchar","pairoffset","pairyoffset","myrole","side","additive","effect","sfxname","sfxdelay","emote_mod","zoom","sfx","sendIC","deskmod","preanim","selectedShout","onOOCEnter","pickChar","ccharacter","sendCharacter","getIndexFromSelect_1","pickEvidence","evidences","desc","icon_id","getIndexFromSelect","randomCharacterOOC","serverIP","ip","ReconnectButton","cleanup","setClient","redHPD","redHPP","resetOffset","switchAspectRatio","background","offsetCheck","paddingBottom","disabled","switchChatOffset","container","width","left","switchPanTilt","fullview","transition","toggleMenu","menu","selectedMenu","setSelectedMenu","toggleShout","shout","setSelectedShout","evidence_filename","evidence_iconbox","encodeURI","updateIniswap","ini_select","ini_name"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"dom.f4368b8b305de31e374e.bundle.js","mappings":"kGAcAA,OAAOC,aAPA,SAAsBC,GACvBA,EAAOC,UAAUC,SAAS,QAC5BF,EAAOG,UAAY,gBAEnBH,EAAOG,UAAY,oBAEvB,C,uBCDAL,OAAOM,cARA,SAAuBC,GAC5B,IAAMC,EAAUC,SAASC,eAAeH,GACV,SAA1BC,EAAQG,MAAMC,QAChBJ,EAAQG,MAAMC,QAAU,OAExBJ,EAAQG,MAAMC,QAAU,OAE5B,C,sBCRA,IAAIC,EAAW,EAAQ,MACnBC,EAAmB,EAAQ,GAY/Bd,OAAOe,YARP,WACI,IAAIC,EAAmBP,SAASC,eAAe,cAC/CG,EAASI,OAAOC,OAAOC,OAAOV,SAASC,eAAe,YAAYU,MAAOX,SA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tCsP,EAAYvP,SAASC,eAAe,kBACP,IAA7BqP,EAAW1O,cACX2O,EAASrP,MAAMC,QAAU,UAGzBoP,EAASrP,MAAMC,QAAU,MAEjC,C","sources":["webpack://webao/./webAO/dom/toggleEffect.js","webpack://webao/./webAO/dom/toggleElement.js","webpack://webao/./webAO/dom/addEvidence.ts","webpack://webao/./webAO/dom/addHPD.ts","webpack://webao/./webAO/dom/addHPP.ts","webpack://webao/./webAO/dom/callMod.ts","webpack://webao/./webAO/dom/cancelEvidence.ts","webpack://webao/./webAO/dom/changeBackgroundOOC.ts","webpack://webao/./webAO/dom/changeCallwords.ts","webpack://webao/./webAO/dom/changeCharacter.ts","webpack://webao/./webAO/dom/changeRoleOOC.ts","webpack://webao/./webAO/dom/charError.ts","webpack://webao/./webAO/dom/charTableFilter.ts","webpack://webao/./webAO/dom/deleteEvidence.ts","webpack://webao/./webAO/dom/editEvidence.ts","webpack://webao/./webAO/dom/guilty.ts","webpack://webao/./webAO/dom/imgError.ts","webpack://webao/./webAO/dom/iniEdit.ts","webpack://webao/./webAO/dom/initCE.ts","webpack://webao/./webAO/dom/initWT.ts","webpack://webao/./webAO/dom/modCallTest.ts","webpack://webao/./webAO/dom/musicListClick.ts","webpack://webao/./webAO/dom/musicListFilter.ts","webpack://webao/./webAO/dom/muteListClick.ts","webpack://webao/./webAO/dom/notGuilty.ts","webpack://webao/./webAO/dom/onEnter.ts","webpack://webao/./webAO/dom/onOOCEnter.ts","webpack://webao/./webAO/dom/pickChar.ts","webpack://webao/./webAO/dom/pickEvidence.ts","webpack://webao/./webAO/dom/randomCharacterOOC.ts","webpack://webao/./webAO/dom/reconnectButton.ts","webpack://webao/./webAO/dom/redHPD.ts","webpack://webao/./webAO/dom/redHPP.ts","webpack://webao/./webAO/dom/resetOffset.ts","webpack://webao/./webAO/dom/switchAspectRatio.ts","webpack://webao/./webAO/dom/switchChatOffset.ts","webpack://webao/./webAO/dom/switchPanTilt.ts","webpack://webao/./webAO/dom/toggleMenu.ts","webpack://webao/./webAO/dom/toggleShout.ts","webpack://webao/./webAO/dom/updateEvidenceIcon.ts","webpack://webao/./webAO/dom/updateIniswap.ts"],"sourcesContent":["/* eslint no-param-reassign: [\"error\",\n{ \"props\": true, \"ignorePropertyModificationsFor\": [\"button\"] }] */\n/**\n * Highlights and selects an effect for in-character chat.\n * If the same effect button is selected, then the effect is canceled.\n * @param {string} effect the new effect to be selected\n */\nexport function toggleEffect(button) {\n if (button.classList.contains('dark')) {\n button.className = 'client_button';\n } else {\n button.className = 'client_button dark';\n }\n}\nwindow.toggleEffect = toggleEffect;\nexport default toggleEffect;\n","/**\n * Hides and shows any html element\n * @param {string} elementId the id of the element to toggle\n */\nexport function toggleElement(elementId) {\n const element = document.getElementById(elementId);\n if (element.style.display !== 'none') {\n element.style.display = 'none';\n } else {\n element.style.display = 'block';\n }\n}\nwindow.toggleElement = toggleElement;\nexport default toggleElement;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addEvidence = void 0;\nvar client_1 = require(\"../client\");\nvar cancelEvidence_1 = require(\"./cancelEvidence\");\n/**\n * Add evidence.\n */\nfunction addEvidence() {\n var evidence_select = (document.getElementById(\"evi_select\"));\n client_1.client.sender.sendPE(document.getElementById(\"evi_name\").value, document.getElementById(\"evi_desc\").value, evidence_select.selectedIndex === 0\n ? document.getElementById(\"evi_filename\").value\n : evidence_select.options[evidence_select.selectedIndex].text);\n (0, cancelEvidence_1.cancelEvidence)();\n}\nexports.addEvidence = addEvidence;\nwindow.addEvidence = addEvidence;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addHPD = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Increment defense health point.\n */\nfunction addHPD() {\n client_1.client.sender.sendHP(1, client_1.client.hp[0] + 1);\n}\nexports.addHPD = addHPD;\nwindow.addHPD = addHPD;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addHPP = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Increment prosecution health point.\n */\nfunction addHPP() {\n client_1.client.sender.sendHP(2, client_1.client.hp[1] + 1);\n}\nexports.addHPP = addHPP;\nwindow.addHPP = addHPP;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.callMod = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Call mod.\n */\nfunction callMod() {\n var modcall;\n if (client_1.extrafeatures.includes(\"modcall_reason\")) {\n modcall = prompt(\"Please enter the reason for the modcall\", \"\");\n }\n if (modcall == null || modcall === \"\") {\n // cancel\n }\n else {\n client_1.client.sender.sendZZ(modcall);\n }\n}\nexports.callMod = callMod;\nwindow.callMod = callMod;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.cancelEvidence = void 0;\nvar client_1 = require(\"../client\");\nvar updateEvidenceIcon_1 = require(\"./updateEvidenceIcon\");\nvar aoHost_1 = require(\"../client/aoHost\");\n/**\n * Cancel evidence selection.\n */\nfunction cancelEvidence() {\n // Clear evidence data\n if (client_1.client.selectedEvidence > 0) {\n document.getElementById(\"evi_\".concat(client_1.client.selectedEvidence)).className =\n \"evi_icon\";\n }\n client_1.client.selectedEvidence = 0;\n // Clear evidence on information window\n document.getElementById(\"evi_select\").selectedIndex = 0;\n (0, updateEvidenceIcon_1.updateEvidenceIcon)(); // Update icon widget\n document.getElementById(\"evi_filename\").value = \"\";\n document.getElementById(\"evi_name\").value = \"\";\n document.getElementById(\"evi_desc\").value = \"\";\n (document.getElementById(\"evi_preview\")).src = \"\".concat(aoHost_1.AO_HOST, \"misc/empty.png\"); // Clear icon\n // Update button\n document.getElementById(\"evi_add\").className = \"client_button hover_button\";\n document.getElementById(\"evi_edit\").className =\n \"client_button hover_button inactive\";\n document.getElementById(\"evi_cancel\").className =\n \"client_button hover_button inactive\";\n document.getElementById(\"evi_del\").className =\n \"client_button hover_button inactive\";\n}\nexports.cancelEvidence = cancelEvidence;\nwindow.cancelEvidence = cancelEvidence;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.changeBackgroundOOC = void 0;\nvar queryParser_1 = require(\"../utils/queryParser\");\nvar client_1 = require(\"../client\");\nvar mode = (0, queryParser_1.default)().mode;\n/**\n * Change background via OOC.\n */\nfunction changeBackgroundOOC() {\n var selectedBG = document.getElementById(\"bg_select\");\n var changeBGCommand = \"bg $1\";\n var bgFilename = document.getElementById(\"bg_filename\");\n var filename = \"\";\n if (selectedBG.selectedIndex === 0) {\n filename = bgFilename.value;\n }\n else {\n filename = selectedBG.value;\n }\n if (mode === \"join\") {\n client_1.client.sender.sendOOC(\"/\".concat(changeBGCommand.replace(\"$1\", filename)));\n }\n else if (mode === \"replay\") {\n client_1.client.sender.sendSelf(\"BN#\".concat(filename, \"#%\"));\n }\n}\nexports.changeBackgroundOOC = changeBackgroundOOC;\nwindow.changeBackgroundOOC = changeBackgroundOOC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.changeCallwords = void 0;\nvar client_1 = require(\"../client\");\nvar setCookie_1 = require(\"../utils/setCookie\");\n/**\n * Triggered by a changed callword list\n */\nfunction changeCallwords() {\n client_1.client.callwords = (document.getElementById(\"client_callwords\")).value.split(\"\\n\");\n (0, setCookie_1.default)(\"callwords\", client_1.client.callwords.join(\"\\n\"));\n}\nexports.changeCallwords = changeCallwords;\nwindow.changeCallwords = changeCallwords;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.changeCharacter = void 0;\n/**\n * Triggered when a character icon is clicked in the character selection menu.\n * @param {MouseEvent} event\n */\nfunction changeCharacter(_event) {\n document.getElementById(\"client_waiting\").style.display = \"block\";\n document.getElementById(\"client_charselect\").style.display = \"block\";\n document.getElementById(\"client_emo\").innerHTML = \"\";\n}\nexports.changeCharacter = changeCharacter;\nwindow.changeCharacter = changeCharacter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.changeRoleOOC = void 0;\nvar updateActionCommands_1 = require(\"./updateActionCommands\");\nvar client_1 = require(\"../client\");\n/**\n * Change role via OOC.\n */\nfunction changeRoleOOC() {\n var roleselect = document.getElementById(\"role_select\");\n client_1.client.sender.sendOOC(\"/pos \".concat(roleselect.value));\n client_1.client.sender.sendServer(\"SP#\".concat(roleselect.value, \"#%\"));\n (0, updateActionCommands_1.updateActionCommands)(roleselect.value);\n}\nexports.changeRoleOOC = changeRoleOOC;\nwindow.changeRoleOOC = changeRoleOOC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.charError = void 0;\nvar transparentPng_1 = require(\"../constants/transparentPng\");\n/**\n * Triggered when there was an error loading a character sprite.\n * @param {HTMLImageElement} image the element containing the missing image\n */\nfunction charError(image) {\n console.warn(\"\".concat(image.src, \" is missing from webAO\"));\n image.src = transparentPng_1.default;\n return true;\n}\nexports.charError = charError;\nwindow.charError = charError;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.chartable_filter = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Triggered when the music search bar is changed\n * @param {MouseEvent} event\n */\nfunction chartable_filter(_event) {\n var searchname = (document.getElementById(\"client_charactersearch\")).value;\n client_1.client.chars.forEach(function (character, charid) {\n var demothing = document.getElementById(\"demo_\".concat(charid));\n if (character.name.toLowerCase().indexOf(searchname.toLowerCase()) === -1) {\n demothing.style.display = \"none\";\n }\n else {\n demothing.style.display = \"inline-block\";\n }\n });\n}\nexports.chartable_filter = chartable_filter;\nwindow.chartable_filter = chartable_filter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deleteEvidence = void 0;\nvar client_1 = require(\"../client\");\nvar cancelEvidence_1 = require(\"./cancelEvidence\");\n/**\n * Delete selected evidence.\n */\nfunction deleteEvidence() {\n var id = client_1.client.selectedEvidence - 1;\n client_1.client.sender.sendDE(id);\n (0, cancelEvidence_1.cancelEvidence)();\n}\nexports.deleteEvidence = deleteEvidence;\nwindow.deleteEvidence = deleteEvidence;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.editEvidence = void 0;\nvar client_1 = require(\"../client\");\nvar cancelEvidence_1 = require(\"./cancelEvidence\");\n/**\n * Edit selected evidence.\n */\nfunction editEvidence() {\n var evidence_select = (document.getElementById(\"evi_select\"));\n var id = client_1.client.selectedEvidence - 1;\n client_1.client.sender.sendEE(id, document.getElementById(\"evi_name\").value, document.getElementById(\"evi_desc\").value, evidence_select.selectedIndex === 0\n ? document.getElementById(\"evi_filename\").value\n : evidence_select.options[evidence_select.selectedIndex].text);\n (0, cancelEvidence_1.cancelEvidence)();\n}\nexports.editEvidence = editEvidence;\nwindow.editEvidence = editEvidence;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.guilty = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Declare the defendant not guilty\n */\nfunction guilty() {\n client_1.client.sender.sendRT(\"judgeruling#1\");\n}\nexports.guilty = guilty;\nwindow.guilty = guilty;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.imgError = void 0;\n/**\n * Triggered when there was an error loading a generic sprite.\n * @param {HTMLImageElement} image the element containing the missing image\n */\nfunction imgError(image) {\n image.onerror = null;\n image.src = \"\"; // unload so the old sprite doesn't persist\n return true;\n}\nexports.imgError = imgError;\nwindow.imgError = imgError;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.iniedit = void 0;\nvar client_1 = require(\"../client\");\nvar handleCharacterInfo_1 = require(\"../client/handleCharacterInfo\");\nvar packetHandler_1 = require(\"../packets/packetHandler\");\n/**\n * Triggered by the ini button.\n */\nfunction iniedit() {\n return __awaiter(this, void 0, void 0, function () {\n var iniselect, ininame, inicharID, newname;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n iniselect = document.getElementById(\"client_iniselect\");\n ininame = document.getElementById(\"client_ininame\");\n inicharID = client_1.client.charID;\n newname = iniselect.selectedIndex === 0 ? ininame.value : iniselect.value;\n return [4 /*yield*/, (0, handleCharacterInfo_1.handleCharacterInfo)(newname.split(\"&\"), inicharID)];\n case 1:\n _a.sent();\n packetHandler_1.packetHandler.get(\"PV\")(\"PV#0#CID#\".concat(inicharID).split(\"#\"));\n return [2 /*return*/];\n }\n });\n });\n}\nexports.iniedit = iniedit;\nwindow.iniedit = iniedit;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.initCE = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Declare cross examination.\n */\nfunction initCE() {\n client_1.client.sender.sendRT(\"testimony2\");\n}\nexports.initCE = initCE;\nwindow.initCE = initCE;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.initWT = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Declare witness testimony.\n */\nfunction initWT() {\n client_1.client.sender.sendRT(\"testimony1\");\n}\nexports.initWT = initWT;\nwindow.initWT = initWT;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.modcall_test = void 0;\nvar packetHandler_1 = require(\"../packets/packetHandler\");\n/**\n * Triggered by the modcall sfx dropdown\n */\nfunction modcall_test() {\n packetHandler_1.packetHandler.get(\"ZZ\")(\"test#test\".split(\"#\"));\n}\nexports.modcall_test = modcall_test;\nwindow.modcall_test = modcall_test;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.musiclist_click = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Triggered when an item on the music list is clicked.\n * @param {MouseEvent} event\n */\nfunction musiclist_click(_event) {\n var playtrack = (document.getElementById(\"client_musiclist\")).value;\n client_1.client.sender.sendMusicChange(playtrack);\n // This is here so you can't actually select multiple tracks,\n // even though the select tag has the multiple option to render differently\n var musiclist_elements = (document.getElementById(\"client_musiclist\")).selectedOptions;\n for (var i = 0; i < musiclist_elements.length; i++) {\n musiclist_elements[i].selected = false;\n }\n}\nexports.musiclist_click = musiclist_click;\nwindow.musiclist_click = musiclist_click;\n","\"use strict\";\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.musiclist_filter = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Triggered when the music search bar is changed\n * @param {MouseEvent} event\n */\nfunction musiclist_filter(_event) {\n var e_1, _a;\n var musiclist_element = (document.getElementById(\"client_musiclist\"));\n var searchname = (document.getElementById(\"client_musicsearch\")).value;\n musiclist_element.innerHTML = \"\";\n try {\n for (var _b = __values(client_1.client.musics), _c = _b.next(); !_c.done; _c = _b.next()) {\n var trackname = _c.value;\n if (trackname.toLowerCase().indexOf(searchname.toLowerCase()) !== -1) {\n var newentry = document.createElement(\"OPTION\");\n newentry.text = trackname;\n musiclist_element.options.add(newentry);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n}\nexports.musiclist_filter = musiclist_filter;\nwindow.musiclist_filter = musiclist_filter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mutelist_click = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Triggered when a character in the mute list is clicked\n * @param {MouseEvent} event\n */\nfunction mutelist_click(_event) {\n var mutelist = (document.getElementById('mute_select'));\n var selected_character = mutelist.options[mutelist.selectedIndex];\n if (client_1.client.chars[selected_character.value].muted === false) {\n client_1.client.chars[selected_character.value].muted = true;\n selected_character.text = \"\".concat(client_1.client.chars[selected_character.value].name, \" (muted)\");\n console.info(\"muted \".concat(client_1.client.chars[selected_character.value].name));\n }\n else {\n client_1.client.chars[selected_character.value].muted = false;\n selected_character.text = client_1.client.chars[selected_character.value].name;\n }\n}\nexports.mutelist_click = mutelist_click;\nwindow.mutelist_click = mutelist_click;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.notguilty = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Declare the defendant not guilty\n */\nfunction notguilty() {\n client_1.client.sender.sendRT(\"judgeruling#0\");\n}\nexports.notguilty = notguilty;\nwindow.notguilty = notguilty;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.onEnter = void 0;\nvar client_1 = require(\"../client\");\nvar encoding_1 = require(\"../encoding\");\n/**\n * Triggered when the Return key is pressed on the in-character chat input box.\n * @param {KeyboardEvent} event\n */\nfunction onEnter(event) {\n if (event.keyCode === 13) {\n var mychar = client_1.client.character;\n var myemo = client_1.client.emote;\n var evi = client_1.client.evidence;\n var flip = Boolean(document.getElementById(\"button_flip\").classList.contains(\"dark\"));\n var flash = Boolean(document.getElementById(\"button_flash\").classList.contains(\"dark\"));\n var screenshake = Boolean(document.getElementById(\"button_shake\").classList.contains(\"dark\"));\n var noninterrupting_preanim = Boolean(document.getElementById(\"check_nonint\").checked);\n var looping_sfx = Boolean(document.getElementById(\"check_loopsfx\").checked);\n var color = Number(document.getElementById(\"textcolor\").value);\n var showname = (0, encoding_1.escapeChat)(document.getElementById(\"ic_chat_name\").value);\n var text = document.getElementById(\"client_inputbox\")\n .value;\n var pairchar = document.getElementById(\"pair_select\")\n .value;\n var pairoffset = Number(document.getElementById(\"pair_offset\").value);\n var pairyoffset = Number(document.getElementById(\"pair_y_offset\").value);\n var myrole = document.getElementById(\"role_select\")\n .value\n ? document.getElementById(\"role_select\").value\n : mychar.side;\n var additive = Boolean(document.getElementById(\"check_additive\").checked);\n var effect = document.getElementById(\"effect_select\")\n .value;\n var sfxname = \"0\";\n var sfxdelay = 0;\n var emote_mod = myemo.zoom;\n if (document.getElementById(\"sendsfx\").checked) {\n sfxname = myemo.sfx;\n sfxdelay = myemo.sfxdelay;\n }\n // not to overwrite a 5 from the ini or anything else\n if (document.getElementById(\"sendpreanim\").checked) {\n if (emote_mod === 0) {\n emote_mod = 1;\n }\n }\n else if (emote_mod === 1) {\n emote_mod = 0;\n }\n client_1.client.sender.sendIC(myemo.deskmod, myemo.preanim, mychar.name, myemo.emote, text, myrole, sfxname, emote_mod, sfxdelay, client_1.selectedShout, evi, flip, flash, color, showname, pairchar, pairoffset, pairyoffset, noninterrupting_preanim, looping_sfx, screenshake, \"-\", \"-\", \"-\", additive, effect);\n }\n return false;\n}\nexports.onEnter = onEnter;\nwindow.onEnter = onEnter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.onOOCEnter = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Triggered when the Return key is pressed on the out-of-character chat input box.\n * @param {KeyboardEvent} event\n */\nfunction onOOCEnter(event) {\n if (event.keyCode === 13) {\n client_1.client.sender.sendOOC(document.getElementById(\"client_oocinputbox\").value);\n document.getElementById(\"client_oocinputbox\").value =\n \"\";\n }\n}\nexports.onOOCEnter = onOOCEnter;\nwindow.onOOCEnter = onOOCEnter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.pickChar = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Requests to play as a character.\n * @param {number} ccharacter the character ID; if this is a large number,\n * then spectator is chosen instead.\n */\nfunction pickChar(ccharacter) {\n if (ccharacter === -1) {\n // Spectator\n document.getElementById(\"client_waiting\").style.display = \"none\";\n document.getElementById(\"client_charselect\").style.display = \"none\";\n }\n client_1.client.sender.sendCharacter(ccharacter);\n}\nexports.pickChar = pickChar;\nwindow.pickChar = pickChar;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.pickEvidence = void 0;\nvar client_1 = require(\"../client\");\nvar cancelEvidence_1 = require(\"./cancelEvidence\");\nvar updateEvidenceIcon_1 = require(\"./updateEvidenceIcon\");\nvar getIndexFromSelect_1 = require(\"./getIndexFromSelect\");\n/**\n * Highlights and selects an evidence for in-character chat.\n * @param {string} evidence the evidence to be presented\n */\nfunction pickEvidence(evidence) {\n if (client_1.client.selectedEvidence !== evidence) {\n // Update selected evidence\n if (client_1.client.selectedEvidence > 0) {\n document.getElementById(\"evi_\".concat(client_1.client.selectedEvidence)).className =\n \"evi_icon\";\n }\n document.getElementById(\"evi_\".concat(evidence)).className = \"evi_icon dark\";\n client_1.client.selectedEvidence = evidence;\n // Show evidence on information window\n document.getElementById(\"evi_name\").value =\n client_1.client.evidences[evidence - 1].name;\n document.getElementById(\"evi_desc\").value =\n client_1.client.evidences[evidence - 1].desc;\n // Update icon\n var icon_id = (0, getIndexFromSelect_1.getIndexFromSelect)(\"evi_select\", client_1.client.evidences[evidence - 1].filename);\n document.getElementById(\"evi_select\").selectedIndex =\n icon_id;\n if (icon_id === 0) {\n document.getElementById(\"evi_filename\").value =\n client_1.client.evidences[evidence - 1].filename;\n }\n (0, updateEvidenceIcon_1.updateEvidenceIcon)();\n // Update button\n document.getElementById(\"evi_add\").className =\n \"client_button hover_button inactive\";\n document.getElementById(\"evi_edit\").className =\n \"client_button hover_button\";\n document.getElementById(\"evi_cancel\").className =\n \"client_button hover_button\";\n document.getElementById(\"evi_del\").className = \"client_button hover_button\";\n }\n else {\n (0, cancelEvidence_1.cancelEvidence)();\n }\n}\nexports.pickEvidence = pickEvidence;\nwindow.pickEvidence = pickEvidence;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.randomCharacterOOC = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Random character via OOC.\n */\nfunction randomCharacterOOC() {\n client_1.client.sender.sendOOC(\"/randomchar\");\n}\nexports.randomCharacterOOC = randomCharacterOOC;\nwindow.randomCharacterOOC = randomCharacterOOC;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ReconnectButton = void 0;\nvar client_1 = require(\"../client\");\nvar queryParser_1 = require(\"../utils/queryParser\");\nvar serverIP = (0, queryParser_1.default)().ip;\n/**\n * Triggered when the reconnect button is pushed.\n */\nfunction ReconnectButton() {\n client_1.client.cleanup();\n (0, client_1.setClient)(new client_1.default(serverIP));\n if (client_1.client) {\n document.getElementById(\"client_error\").style.display = \"none\";\n }\n}\nexports.ReconnectButton = ReconnectButton;\nwindow.ReconnectButton = ReconnectButton;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.redHPD = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Decrement defense health point.\n */\nfunction redHPD() {\n client_1.client.sender.sendHP(1, client_1.client.hp[0] - 1);\n}\nexports.redHPD = redHPD;\nwindow.redHPD = redHPD;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.redHPP = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Decrement prosecution health point.\n */\nfunction redHPP() {\n client_1.client.sender.sendHP(2, client_1.client.hp[1] - 1);\n}\nexports.redHPP = redHPP;\nwindow.redHPP = redHPP;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resetOffset = void 0;\nfunction resetOffset(_event) {\n document.getElementById(\"pair_offset\").value = \"0\";\n document.getElementById(\"pair_y_offset\").value = \"0\";\n}\nexports.resetOffset = resetOffset;\nwindow.resetOffset = resetOffset;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.switchAspectRatio = void 0;\n/**\n * Triggered by the change aspect ratio checkbox\n */\nfunction switchAspectRatio() {\n return __awaiter(this, void 0, void 0, function () {\n var background, offsetCheck;\n return __generator(this, function (_a) {\n background = document.getElementById(\"client_gamewindow\");\n offsetCheck = (document.getElementById(\"client_hdviewport_offset\"));\n if (document.getElementById(\"client_hdviewport\").checked) {\n background.style.paddingBottom = \"56.25%\";\n offsetCheck.disabled = false;\n }\n else {\n background.style.paddingBottom = \"75%\";\n offsetCheck.disabled = true;\n }\n return [2 /*return*/];\n });\n });\n}\nexports.switchAspectRatio = switchAspectRatio;\nwindow.switchAspectRatio = switchAspectRatio;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.switchChatOffset = void 0;\n/**\n * Triggered by the change aspect ratio checkbox\n */\nfunction switchChatOffset() {\n return __awaiter(this, void 0, void 0, function () {\n var container;\n return __generator(this, function (_a) {\n container = document.getElementById(\"client_chatcontainer\");\n if (document.getElementById(\"client_hdviewport_offset\")\n .checked) {\n container.style.width = \"80%\";\n container.style.left = \"10%\";\n }\n else {\n container.style.width = \"100%\";\n container.style.left = \"0\";\n }\n return [2 /*return*/];\n });\n });\n}\nexports.switchChatOffset = switchChatOffset;\nwindow.switchChatOffset = switchChatOffset;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.switchPanTilt = void 0;\n/**\n * Triggered by the pantilt checkbox\n */\nfunction switchPanTilt() {\n return __awaiter(this, void 0, void 0, function () {\n var fullview, checkbox;\n return __generator(this, function (_a) {\n fullview = document.getElementById(\"client_fullview\");\n checkbox = document.getElementById(\"client_pantilt\");\n if (checkbox.checked) {\n fullview.style.transition = \"0.5s ease-in-out\";\n }\n else {\n fullview.style.transition = \"none\";\n }\n return [2 /*return*/];\n });\n });\n}\nexports.switchPanTilt = switchPanTilt;\nwindow.switchPanTilt = switchPanTilt;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toggleMenu = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Highlights and selects a menu.\n * @param {number} menu the menu to be selected\n */\nfunction toggleMenu(menu) {\n if (menu !== client_1.selectedMenu) {\n document.getElementById(\"menu_\".concat(menu)).className = \"menu_button active\";\n document.getElementById(\"content_\".concat(menu)).className =\n \"menu_content active\";\n document.getElementById(\"menu_\".concat(client_1.selectedMenu)).className = \"menu_button\";\n document.getElementById(\"content_\".concat(client_1.selectedMenu)).className =\n \"menu_content\";\n (0, client_1.setSelectedMenu)(menu);\n }\n}\nexports.toggleMenu = toggleMenu;\nwindow.toggleMenu = toggleMenu;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toggleShout = void 0;\nvar client_1 = require(\"../client\");\n/**\n * Highlights and selects a shout for in-character chat.\n * If the same shout button is selected, then the shout is canceled.\n * @param {number} shout the new shout to be selected\n */\nfunction toggleShout(shout) {\n if (shout === client_1.selectedShout) {\n document.getElementById(\"button_\".concat(shout)).className = \"client_button\";\n (0, client_1.setSelectedShout)(0);\n }\n else {\n document.getElementById(\"button_\".concat(shout)).className = \"client_button dark\";\n if (client_1.selectedShout) {\n document.getElementById(\"button_\".concat(client_1.selectedShout)).className =\n \"client_button\";\n }\n (0, client_1.setSelectedShout)(shout);\n }\n}\nexports.toggleShout = toggleShout;\nwindow.toggleShout = toggleShout;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateEvidenceIcon = void 0;\nvar aoHost_1 = require(\"../client/aoHost\");\n/**\n * Update evidence icon.\n */\nfunction updateEvidenceIcon() {\n var evidence_select = (document.getElementById(\"evi_select\"));\n var evidence_filename = (document.getElementById(\"evi_filename\"));\n var evidence_iconbox = (document.getElementById(\"evi_preview\"));\n if (evidence_select.selectedIndex === 0) {\n evidence_filename.style.display = \"initial\";\n evidence_iconbox.src = \"\".concat(aoHost_1.AO_HOST, \"evidence/\").concat(encodeURI(evidence_filename.value.toLowerCase()));\n }\n else {\n evidence_filename.style.display = \"none\";\n evidence_iconbox.src = \"\".concat(aoHost_1.AO_HOST, \"evidence/\").concat(encodeURI(evidence_select.value.toLowerCase()));\n }\n}\nexports.updateEvidenceIcon = updateEvidenceIcon;\nwindow.updateEvidenceIcon = updateEvidenceIcon;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.updateIniswap = void 0;\n/**\n * Update iniswap drowdown\n */\nfunction updateIniswap() {\n var ini_select = (document.getElementById(\"client_iniselect\"));\n var ini_name = (document.getElementById(\"client_ininame\"));\n if (ini_select.selectedIndex === 0) {\n ini_name.style.display = \"initial\";\n }\n else {\n ini_name.style.display = \"none\";\n }\n}\nexports.updateIniswap = updateIniswap;\nwindow.updateIniswap = updateIniswap;\n"],"names":["window","toggleEffect","button","classList","contains","className","toggleElement","elementId","element","document","getElementById","style","display","client_1","cancelEvidence_1","addEvidence","evidence_select","client","sender","sendPE","value","selectedIndex","options","text","cancelEvidence","addHPD","sendHP","hp","addHPP","callMod","modcall","extrafeatures","includes","prompt","sendZZ","Object","defineProperty","exports","updateEvidenceIcon_1","aoHost_1","selectedEvidence","concat","updateEvidenceIcon","src","AO_HOST","queryParser_1","mode","default","changeBackgroundOOC","filename","selectedBG","bgFilename","sendOOC","replace","sendSelf","setCookie_1","changeCallwords","callwords","split","join","changeCharacter","_event","innerHTML","updateActionCommands_1","changeRoleOOC","roleselect","sendServer","updateActionCommands","transparentPng_1","charError","image","console","warn","chartable_filter","searchname","chars","forEach","character","charid","demothing","name","toLowerCase","indexOf","deleteEvidence","id","sendDE","editEvidence","sendEE","guilty","sendRT","imgError","onerror","__awaiter","this","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","f","y","t","g","_","label","sent","trys","ops","verb","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","iniedit","handleCharacterInfo_1","packetHandler_1","iniselect","ininame","inicharID","newname","_a","charID","handleCharacterInfo","packetHandler","get","initCE","initWT","modcall_test","musiclist_click","playtrack","sendMusicChange","musiclist_elements","selectedOptions","i","selected","__values","o","s","m","musiclist_filter","e_1","musiclist_element","_b","musics","_c","trackname","newentry","createElement","add","e_1_1","error","return","mutelist_click","mutelist","selected_character","muted","info","notguilty","encoding_1","onEnter","event","keyCode","mychar","myemo","emote","evi","evidence","flip","Boolean","flash","screenshake","noninterrupting_preanim","checked","looping_sfx","color","Number","showname","escapeChat","pairchar","pairoffset","pairyoffset","myrole","side","additive","effect","sfxname","sfxdelay","emote_mod","zoom","sfx","sendIC","deskmod","preanim","selectedShout","onOOCEnter","pickChar","ccharacter","sendCharacter","getIndexFromSelect_1","pickEvidence","evidences","desc","icon_id","getIndexFromSelect","randomCharacterOOC","serverIP","ip","ReconnectButton","cleanup","setClient","redHPD","redHPP","resetOffset","switchAspectRatio","background","offsetCheck","paddingBottom","disabled","switchChatOffset","container","width","left","switchPanTilt","fullview","transition","toggleMenu","menu","selectedMenu","setSelectedMenu","toggleShout","shout","setSelectedShout","evidence_filename","evidence_iconbox","encodeURI","updateIniswap","ini_select","ini_name"],"sourceRoot":""} \ No newline at end of file diff --git a/ui.858f8ece88fc793ad89c.bundle.js.map b/ui.858f8ece88fc793ad89c.bundle.js.map index 708f6c66..8b0fb95b 100644 --- a/ui.858f8ece88fc793ad89c.bundle.js.map +++ b/ui.858f8ece88fc793ad89c.bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"ui.858f8ece88fc793ad89c.bundle.js","mappings":"yBACA,MAAeA,UAAsBC,MACjC,WAAAC,CAAYC,EAAcC,EAAcC,GACpCC,MAAM,GAAGH,MAASC,SAAmBG,IAAZF,EAAwB,GAAK,KAAOA,IACjE,EAIG,MAAMG,UAAoBR,EAC7B,WAAAE,CAAYE,EAAcC,GACtBC,MAAM,SAAUF,EAAMC,EAC1B,EAIG,MAAMI,UAA6BT,EACtC,WAAAE,CAAYE,EAAcM,EAAsBL,GAC5CC,MAAM,kBAAmBF,EAAM,GAAGM,SAA4BH,IAAZF,EAAwB,GAAK,KAAOA,IAC1F,EAIG,MAAMM,UAA4BX,EACrC,WAAAE,CAAYE,EAAcC,GACtBC,MAAM,iBAAkBF,EAAMC,EAClC,EAIG,MAAMO,UAAiCZ,EAC1C,WAAAE,CAAYE,EAAcC,GACt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layout/src/ts/errors/internal-error.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/config-minifier.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/style-constants.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/types.ts","webpack://webao/./node_modules/golden-layout/src/ts/config/resolved-config.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/i18n-strings.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/utils.ts","webpack://webao/./node_modules/golden-layout/src/ts/errors/external-error.ts","webpack://webao/./node_modules/golden-layout/src/ts/config/config.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/event-emitter.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/browser-popout.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/header-button.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/drag-listener.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/tab.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/tabs-container.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/header.ts","webpack://webao/./node_modules/golden-layout/src/ts/container/component-container.ts","webpack://webao/./node_modules/golden-layout/src/ts/items/content-item.ts","webpack://webao/./node_modules/golden-layout/src/ts/items/component-item.ts","webpack://webao/./node_modules/golden-layout/src/ts/items/component-parentable-item.ts","webpack://webao/./node_modules/golden-layout/src/ts/items/stack.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/drag-proxy.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/splitter.ts","webpack://webao/./node_modules/golden-layout/src/ts/items/row-or-column.ts","webpack://webao/./node_modules/golden-layout/src/ts/items/ground-item.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/drag-source.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/drop-target-indicator.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/transition-indicator.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/event-hub.ts","webpack://webao/./node_modules/golden-layout/src/ts/layout-manager.ts","webpack://webao/./node_modules/golden-layout/src/ts/virtual-layout.ts","webpack://webao/./webAO/ui.js","webpack://webao/./node_modules/golden-layout/src/ts/golden-layout.ts"],"sourcesContent":["/** @internal */\nabstract class InternalError extends Error {\n constructor(type: string, code: string, message?: string) {\n super(`${type}: ${code}${message === undefined ? '' : ': ' + message}`)\n }\n}\n\n/** @internal */\nexport class AssertError extends InternalError {\n constructor(code: string, message?: string) {\n super('Assert', code, message)\n }\n}\n\n/** @internal */\nexport class UnreachableCaseError extends InternalError {\n constructor(code: string, variableValue: never, message?: string) {\n super('UnreachableCase', code, `${variableValue}${message === undefined ? '' : ': ' + message}`)\n }\n}\n\n/** @internal */\nexport class UnexpectedNullError extends InternalError {\n constructor(code: string, message?: string) {\n super('UnexpectedNull', code, message)\n }\n}\n\n/** @internal */\nexport class UnexpectedUndefinedError extends InternalError {\n constructor(code: string, message?: string) {\n super('UnexpectedUndefined', code, message)\n }\n}\n","/**\n * Minifies and unminifies configs by replacing frequent keys\n * and values with one letter substitutes. Config options must\n * retain array position/index, add new options at the end.\n * @internal\n*/\n\nexport namespace ConfigMinifier {\n\n export type YY = 'id' | 'title';\n export const enum XX {\n id = 'id'\n }\n const keys: readonly string[] = [\n 'settings',\n 'hasHeaders',\n 'constrainDragToContainer',\n 'selectionEnabled',\n 'dimensions',\n 'borderWidth',\n 'minItemHeight',\n 'minItemWidth',\n 'headerHeight',\n 'dragProxyWidth',\n 'dragProxyHeight',\n 'labels',\n 'close',\n 'maximise',\n 'minimise',\n 'popout',\n 'content',\n 'componentType',\n 'componentState',\n 'id',\n 'width',\n 'type',\n 'height',\n 'isClosable',\n 'title',\n 'popoutWholeStack',\n 'openPopouts',\n 'parentId',\n 'activeItemIndex',\n 'reorderEnabled',\n 'borderGrabWidth',\n\n\n\n\n //Maximum 36 entries, do not cross this line!\n ];\n\n const values: readonly (boolean | string)[] = [\n true,\n false,\n 'row',\n 'column',\n 'stack',\n 'component',\n 'close',\n 'maximise',\n 'minimise',\n 'open in new window'\n ];\n\n export function checkInitialise(): void {\n if (keys.length > 36) {\n throw new Error('Too many keys in config minifier map');\n }\n }\n\n export function translateObject(from: Record, minify: boolean): Record {\n const to: Record = {};\n for (const key in from) {\n if (from.hasOwnProperty(key)) { // In case something has extended Object prototypes\n let translatedKey: string;\n if (minify) {\n translatedKey = minifyKey(key);\n } else {\n translatedKey = unminifyKey(key);\n }\n\n const fromValue = from[key];\n to[translatedKey] = translateValue(fromValue, minify);\n }\n }\n\n return to;\n }\n\n function translateArray(from: unknown[], minify: boolean) {\n const length = from.length;\n const to = new Array(length);\n for (let i = 0; i < length; i++) {\n // In original code, array indices were numbers and not translated\n const fromValue = from[i];\n to[i] = translateValue(fromValue, minify);\n }\n return to;\n }\n\n function translateValue(from: unknown, minify: boolean) {\n if (typeof from === 'object') {\n if (from === null) {\n return null;\n } else {\n if (Array.isArray(from)) {\n return translateArray(from, minify);\n } else {\n return translateObject(from as Record, minify);\n }\n }\n } else {\n if (minify) {\n return minifyValue(from);\n } else {\n return unminifyValue(from);\n }\n }\n }\n\n function minifyKey(value: string) {\n /**\n * If a value actually is a single character, prefix it\n * with ___ to avoid mistaking it for a minification code\n */\n if (typeof value === 'string' && value.length === 1) {\n return '___' + value;\n }\n \n const index = indexOfKey(value);\n \n /**\n * value not found in the dictionary, return it unmodified\n */\n if (index === -1) {\n return value;\n \n /**\n * value found in dictionary, return its base36 counterpart\n */\n } else {\n return index.toString(36);\n }\n }\n\n function unminifyKey(key: string) {\n /**\n * value is a single character. Assume that it's a translation\n * and return the original value from the dictionary\n */\n if (key.length === 1) {\n return keys[parseInt(key, 36)];\n }\n \n /**\n * value originally was a single character and was prefixed with ___\n * to avoid mistaking it for a translation. Remove the prefix\n * and return the original character\n */\n if (key.substr(0, 3) === '___') {\n return key[3];\n }\n /**\n * value was not minified\n */\n return key;\n }\n\n function minifyValue(value: unknown) {\n /**\n * If a value actually is a single character, prefix it\n * with ___ to avoid mistaking it for a minification code\n */\n if (typeof value === 'string' && value.length === 1) {\n return '___' + value;\n }\n \n const index = indexOfValue(value);\n \n /**\n * value not found in the dictionary, return it unmodified\n */\n if (index === -1) {\n return value;\n \n /**\n * value found in dictionary, return its base36 counterpart\n */\n } else {\n return index.toString(36);\n }\n }\n\n function unminifyValue(value: unknown) {\n /**\n * value is a single character. Assume that it's a translation\n * and return the original value from the dictionary\n */\n if (typeof value === 'string' && value.length === 1) {\n return values[parseInt(value, 36)];\n }\n\n /**\n * value originally was a single character and was prefixed with ___\n * to avoid mistaking it for a translation. Remove the prefix\n * and return the original character\n */\n if (typeof value === 'string' && value.substr(0, 3) === '___') {\n return value[3];\n }\n /**\n * value was not minified\n */\n return value;\n }\n\n function indexOfKey(key: string) {\n for (let i = 0; i < keys.length; i++) {\n if (keys[i] === key) {\n return i;\n }\n }\n return -1;\n }\n\n function indexOfValue(value: unknown) {\n for (let i = 0; i < values.length; i++) {\n if (values[i] === value) {\n return i;\n }\n }\n return -1;\n }\n}\n","/** @public */\nexport namespace StyleConstants {\n export const defaultComponentBaseZIndex = 'auto';\n export const defaultComponentDragZIndex = '32';\n export const defaultComponentStackMaximisedZIndex = '41';\n}\n","import { UnreachableCaseError } from '../errors/internal-error';\nimport { StyleConstants } from './style-constants';\n\n/** @internal */\nexport type WidthOrHeightPropertyName = 'width' | 'height';\n\n/** @internal */\nexport namespace WidthOrHeightPropertyName {\n export const width = 'width';\n export const height = 'height';\n}\n\n/** @internal */\nexport interface WidthAndHeight {\n width: number;\n height: number;\n}\n\n/** @internal */\nexport interface LeftAndTop {\n left: number;\n top: number;\n}\n\n/** @public */\nexport type Side = 'top' | 'left' | 'right' | 'bottom';\n/** @public */\nexport namespace Side {\n export const top = 'top';\n export const left = 'left';\n export const right = 'right';\n export const bottom = 'bottom';\n}\n\n/** @public */\nexport type LogicalZIndex = 'base' | 'drag' | 'stackMaximised';\n/** @public */\nexport namespace LogicalZIndex {\n export const base = 'base';\n export const drag = 'drag';\n export const stackMaximised = 'stackMaximised';\n}\n\n/** @public */\nexport const LogicalZIndexToDefaultMap = {\n base: StyleConstants.defaultComponentBaseZIndex,\n drag: StyleConstants.defaultComponentDragZIndex,\n stackMaximised: StyleConstants.defaultComponentStackMaximisedZIndex,\n}\n\n/** @internal */\nexport interface Rect {\n left: number,\n top: number,\n width: number,\n height: number,\n}\n\n/** @internal */\nexport interface AreaLinkedRect {\n x1: number, // left\n x2: number, // nextLeft\n y1: number, // top\n y2: number, // nextTop\n}\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type JsonValue = string | number | boolean | null | Json | object | JsonValueArray;\n/** @public */\nexport interface Json {\n [name: string]: JsonValue;\n}\n/** @public */\nexport type JsonValueArray = Array\n/** @public */\nexport namespace JsonValue {\n export function isJson(value: JsonValue): value is Json {\n return isJsonObject(value);\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n export function isJsonObject(value: JsonValue): value is Json | object {\n return !Array.isArray(value) && value !== null && typeof value === 'object';\n }\n}\n\n/** @public */\nexport type ItemType = 'ground' | 'row' | 'column' | 'stack' | 'component';\n\n/** @public */\nexport namespace ItemType {\n export const ground = 'ground';\n export const row = 'row';\n export const column = 'column';\n export const stack = 'stack';\n export const component = 'component';\n}\n\n/** @public */\nexport type ResponsiveMode = 'none' | 'always' | 'onload';\n/** @public */\nexport namespace ResponsiveMode {\n export const none = 'none';\n export const always = 'always';\n export const onload = 'onload';\n}\n\n/**\n * Length units which can specify the size of a Component Item\n * @public\n */\nexport type SizeUnit = 'px' | '%' | 'fr' | 'em';\n\n/** @public */\nexport enum SizeUnitEnum {\n Pixel = 'px',\n Percent = '%',\n Fractional = 'fr',\n Em = 'em',\n}\n\n/** @public */\nexport namespace SizeUnitEnum {\n export function tryParse(value: string) {\n switch (value) {\n case SizeUnitEnum.Pixel: return SizeUnitEnum.Pixel;\n case SizeUnitEnum.Percent: return SizeUnitEnum.Percent;\n case SizeUnitEnum.Fractional: return SizeUnitEnum.Fractional;\n case SizeUnitEnum.Em: return SizeUnitEnum.Em;\n default: return undefined;\n }\n }\n\n export function format(value: SizeUnitEnum) {\n switch (value) {\n case SizeUnitEnum.Pixel: return SizeUnitEnum.Pixel;\n case SizeUnitEnum.Percent: return SizeUnitEnum.Percent;\n case SizeUnitEnum.Fractional: return SizeUnitEnum.Fractional;\n case SizeUnitEnum.Em: return SizeUnitEnum.Em;\n default:\n throw new UnreachableCaseError('SUEF44998', value);\n }\n }\n}\n","import { AssertError, UnreachableCaseError } from '../errors/internal-error';\nimport { ConfigMinifier } from '../utils/config-minifier';\nimport { ItemType, JsonValue, ResponsiveMode, Side, SizeUnitEnum } from '../utils/types';\nimport { deepExtendValue } from '../utils/utils';\n\n/** @public */\nexport interface ResolvedItemConfig {\n // see ItemConfig for comments\n readonly type: ItemType;\n readonly content: readonly ResolvedItemConfig[];\n readonly size: number;\n readonly sizeUnit: SizeUnitEnum;\n readonly minSize: number | undefined;\n readonly minSizeUnit: SizeUnitEnum;\n // id no longer specifies whether an Item is maximised. This is now done by HeaderItemConfig.maximised\n readonly id: string;\n readonly isClosable: boolean;\n}\n\n/** @public */\nexport namespace ResolvedItemConfig {\n export const defaults: ResolvedItemConfig = {\n type: ItemType.ground, // not really default but need something\n content: [],\n size: 1,\n sizeUnit: SizeUnitEnum.Fractional,\n minSize: undefined,\n minSizeUnit: SizeUnitEnum.Pixel,\n id: '',\n isClosable: true,\n } as const;\n\n /** Creates a copy of the original ResolvedItemConfig using an alternative content if specified */\n export function createCopy(original: ResolvedItemConfig, content?: ResolvedItemConfig[]): ResolvedItemConfig {\n switch (original.type) {\n case ItemType.ground:\n case ItemType.row:\n case ItemType.column:\n return ResolvedRowOrColumnItemConfig.createCopy(original as ResolvedRowOrColumnItemConfig,\n content as ResolvedRowOrColumnItemConfig.ChildItemConfig[]);\n\n case ItemType.stack:\n return ResolvedStackItemConfig.createCopy(original as ResolvedStackItemConfig, content as ResolvedComponentItemConfig[]);\n\n case ItemType.component:\n return ResolvedComponentItemConfig.createCopy(original as ResolvedComponentItemConfig);\n\n default:\n throw new UnreachableCaseError('CICC91354', original.type, 'Invalid Config Item type specified');\n }\n }\n\n export function createDefault(type: ItemType): ResolvedItemConfig {\n switch (type) {\n case ItemType.ground:\n throw new AssertError('CICCDR91562'); // Get default root from LayoutConfig\n case ItemType.row:\n case ItemType.column:\n return ResolvedRowOrColumnItemConfig.createDefault(type);\n\n case ItemType.stack:\n return ResolvedStackItemConfig.createDefault();\n\n case ItemType.component:\n return ResolvedComponentItemConfig.createDefault();\n\n default:\n throw new UnreachableCaseError('CICCDD91563', type, 'Invalid Config Item type specified');\n }\n }\n\n export function isComponentItem(itemConfig: ResolvedItemConfig): itemConfig is ResolvedComponentItemConfig {\n return itemConfig.type === ItemType.component;\n }\n\n export function isStackItem(itemConfig: ResolvedItemConfig): itemConfig is ResolvedStackItemConfig {\n return itemConfig.type === ItemType.stack;\n }\n\n /** @internal */\n export function isGroundItem(itemConfig: ResolvedItemConfig): itemConfig is ResolvedGroundItemConfig {\n return itemConfig.type === ItemType.ground;\n }\n}\n\n// Stack or Component\n/** @public */\nexport interface ResolvedHeaderedItemConfig extends ResolvedItemConfig {\n header: ResolvedHeaderedItemConfig.Header | undefined; // undefined means get header settings from LayoutConfig\n readonly maximised: boolean;\n}\n\n/** @public */\nexport namespace ResolvedHeaderedItemConfig {\n export const defaultMaximised = false;\n\n export interface Header {\n // undefined means get property value from LayoutConfig\n readonly show: false | Side | undefined;\n readonly popout: false | string | undefined;\n readonly maximise: false | string | undefined;\n readonly close: string | undefined;\n readonly minimise: string | undefined;\n readonly tabDropdown: false | string | undefined;\n }\n\n export namespace Header {\n export function createCopy(original: Header | undefined, show?: false | Side): Header | undefined {\n if (original === undefined) {\n return undefined;\n } else {\n return {\n show: show ?? original.show,\n popout: original.popout,\n close: original.close,\n maximise: original.maximise,\n minimise: original.minimise,\n tabDropdown: original.tabDropdown,\n }\n }\n }\n }\n}\n\n/** @public */\nexport interface ResolvedStackItemConfig extends ResolvedHeaderedItemConfig {\n readonly type: 'stack';\n readonly content: ResolvedComponentItemConfig[];\n /** The index of the active item in the Stack. Only undefined if the Stack is empty. */\n readonly activeItemIndex: number | undefined;\n}\n\n/** @public */\nexport namespace ResolvedStackItemConfig {\n export const defaultActiveItemIndex = 0;\n\n export function createCopy(original: ResolvedStackItemConfig, content?: ResolvedComponentItemConfig[]): ResolvedStackItemConfig {\n const result: ResolvedStackItemConfig = {\n type: original.type,\n content: content !== undefined ? copyContent(content) : copyContent(original.content),\n size: original.size,\n sizeUnit: original.sizeUnit,\n minSize: original.minSize,\n minSizeUnit: original.minSizeUnit,\n id: original.id,\n maximised: original.maximised,\n isClosable: original.isClosable,\n activeItemIndex: original.activeItemIndex,\n header: ResolvedHeaderedItemConfig.Header.createCopy(original.header),\n }\n return result;\n }\n\n export function copyContent(original: ResolvedComponentItemConfig[]): ResolvedComponentItemConfig[] {\n const count = original.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = ResolvedItemConfig.createCopy(original[i]) as ResolvedComponentItemConfig;\n }\n return result;\n }\n\n export function createDefault(): ResolvedStackItemConfig {\n const result: ResolvedStackItemConfig = {\n type: ItemType.stack,\n content: [],\n size: ResolvedItemConfig.defaults.size,\n sizeUnit: ResolvedItemConfig.defaults.sizeUnit,\n minSize: ResolvedItemConfig.defaults.minSize,\n minSizeUnit: ResolvedItemConfig.defaults.minSizeUnit,\n id: ResolvedItemConfig.defaults.id,\n maximised: ResolvedHeaderedItemConfig.defaultMaximised,\n isClosable: ResolvedItemConfig.defaults.isClosable,\n activeItemIndex: defaultActiveItemIndex,\n header: undefined,\n }\n return result;\n }\n}\n\n/** @public */\nexport interface ResolvedComponentItemConfig extends ResolvedHeaderedItemConfig {\n // see ComponentItemConfig for comments\n readonly type: 'component';\n readonly content: [];\n readonly title: string;\n readonly reorderEnabled: boolean; // Takes precedence over LayoutConfig.reorderEnabled.\n /**\n * The name of the component as specified in layout.registerComponent. Mandatory if type is 'component'.\n */\n readonly componentType: JsonValue;\n readonly componentState?: JsonValue;\n}\n\n/** @public */\nexport namespace ResolvedComponentItemConfig {\n export const defaultReorderEnabled = true;\n\n export function resolveComponentTypeName(itemConfig: ResolvedComponentItemConfig): string | undefined {\n const componentType = itemConfig.componentType;\n if (typeof componentType === 'string') {\n return componentType;\n } else {\n return undefined;\n }\n }\n\n export function createCopy(original: ResolvedComponentItemConfig): ResolvedComponentItemConfig {\n const result: ResolvedComponentItemConfig = {\n type: original.type,\n content: [],\n size: original.size,\n sizeUnit: original.sizeUnit,\n minSize: original.minSize,\n minSizeUnit: original.minSizeUnit,\n id: original.id,\n maximised: original.maximised,\n isClosable: original.isClosable,\n reorderEnabled: original.reorderEnabled,\n title: original.title,\n header: ResolvedHeaderedItemConfig.Header.createCopy(original.header),\n componentType: original.componentType,\n componentState: deepExtendValue(undefined, original.componentState) as JsonValue,\n }\n return result;\n }\n\n export function createDefault(componentType: JsonValue = '', componentState?: JsonValue, title = ''): ResolvedComponentItemConfig {\n const result: ResolvedComponentItemConfig = {\n type: ItemType.component,\n content: [],\n size: ResolvedItemConfig.defaults.size,\n sizeUnit: ResolvedItemConfig.defaults.sizeUnit,\n minSize: ResolvedItemConfig.defaults.minSize,\n minSizeUnit: ResolvedItemConfig.defaults.minSizeUnit,\n id: ResolvedItemConfig.defaults.id,\n maximised: ResolvedHeaderedItemConfig.defaultMaximised,\n isClosable: ResolvedItemConfig.defaults.isClosable,\n reorderEnabled: ResolvedComponentItemConfig.defaultReorderEnabled,\n title,\n header: undefined,\n componentType,\n componentState,\n }\n return result;\n }\n\n export function copyComponentType(componentType: JsonValue): JsonValue {\n return deepExtendValue({}, componentType) as JsonValue\n }\n}\n\n/** Base for Root or RowOrColumn ItemConfigs\n * @public\n */\nexport interface ResolvedRowOrColumnItemConfig extends ResolvedItemConfig {\n readonly type: 'row' | 'column';\n /** Note that RowOrColumn ResolvedItemConfig contents, can contain ComponentItem itemConfigs. However\n * when ContentItems are created, these ComponentItem itemConfigs will create a Stack with a child ComponentItem.\n */\n readonly content: readonly (ResolvedRowOrColumnItemConfig | ResolvedStackItemConfig | ResolvedComponentItemConfig)[];\n}\n\n/** @public */\nexport namespace ResolvedRowOrColumnItemConfig {\n export type ChildItemConfig = ResolvedRowOrColumnItemConfig | ResolvedStackItemConfig | ResolvedComponentItemConfig;\n\n export function isChildItemConfig(itemConfig: ResolvedItemConfig): itemConfig is ChildItemConfig {\n switch (itemConfig.type) {\n case ItemType.row:\n case ItemType.column:\n case ItemType.stack:\n case ItemType.component:\n return true;\n case ItemType.ground:\n return false;\n default:\n throw new UnreachableCaseError('CROCOSPCICIC13687', itemConfig.type);\n }\n }\n\n export function createCopy(original: ResolvedRowOrColumnItemConfig, content?: ChildItemConfig[]): ResolvedRowOrColumnItemConfig {\n const result: ResolvedRowOrColumnItemConfig = {\n type: original.type,\n content: content !== undefined ? copyContent(content) : copyContent(original.content),\n size: original.size,\n sizeUnit: original.sizeUnit,\n minSize: original.minSize,\n minSizeUnit: original.minSizeUnit,\n id: original.id,\n isClosable: original.isClosable,\n }\n return result;\n }\n\n export function copyContent(original: readonly ChildItemConfig[]): ChildItemConfig[] {\n const count = original.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = ResolvedItemConfig.createCopy(original[i]) as ChildItemConfig;\n }\n return result;\n }\n\n export function createDefault(type: 'row' | 'column'): ResolvedRowOrColumnItemConfig {\n const result: ResolvedRowOrColumnItemConfig = {\n type,\n content: [],\n size: ResolvedItemConfig.defaults.size,\n sizeUnit: ResolvedItemConfig.defaults.sizeUnit,\n minSize: ResolvedItemConfig.defaults.minSize,\n minSizeUnit: ResolvedItemConfig.defaults.minSizeUnit,\n id: ResolvedItemConfig.defaults.id,\n isClosable: ResolvedItemConfig.defaults.isClosable,\n }\n return result;\n }\n}\n\n/**\n * RootItemConfig is the topmost ResolvedItemConfig specified by the user.\n * Note that it does not have a corresponding contentItem. It specifies the one and only child of the Ground ContentItem\n * Note that RootItemConfig can be an ComponentItem itemConfig. However when the Ground ContentItem's child is created\n * a ComponentItem itemConfig will create a Stack with a child ComponentItem.\n * @public\n*/\nexport type ResolvedRootItemConfig = ResolvedRowOrColumnItemConfig | ResolvedStackItemConfig | ResolvedComponentItemConfig;\n\n/** @public */\nexport namespace ResolvedRootItemConfig {\n export function createCopy(config: ResolvedRootItemConfig): ResolvedRootItemConfig {\n return ResolvedItemConfig.createCopy(config) as ResolvedRootItemConfig;\n }\n\n export function isRootItemConfig(itemConfig: ResolvedItemConfig): itemConfig is ResolvedRootItemConfig {\n switch (itemConfig.type) {\n case ItemType.row:\n case ItemType.column:\n case ItemType.stack:\n case ItemType.component:\n return true;\n case ItemType.ground:\n return false;\n default:\n throw new UnreachableCaseError('CROCOSPCICIC13687', itemConfig.type);\n }\n }\n}\n\n/** @internal */\nexport interface ResolvedGroundItemConfig extends ResolvedItemConfig {\n readonly type: 'ground';\n readonly size: 100,\n readonly sizeUnit: SizeUnitEnum.Percent,\n readonly minSize: 0,\n readonly minSizeUnit: SizeUnitEnum.Pixel,\n readonly id: '',\n readonly isClosable: false,\n readonly title: '',\n readonly reorderEnabled: false,\n}\n\n/** @internal */\nexport namespace ResolvedGroundItemConfig {\n export function create(rootItemConfig: ResolvedRootItemConfig | undefined):ResolvedGroundItemConfig {\n const content = rootItemConfig === undefined ? [] : [rootItemConfig];\n return {\n type: ItemType.ground,\n content,\n size: 100,\n sizeUnit: SizeUnitEnum.Percent,\n minSize: 0,\n minSizeUnit: SizeUnitEnum.Pixel,\n id: '',\n isClosable: false,\n title: '',\n reorderEnabled: false,\n }\n }\n}\n\n/** @public */\nexport interface ResolvedLayoutConfig {\n readonly root: ResolvedRootItemConfig | undefined;\n readonly openPopouts: ResolvedPopoutLayoutConfig[];\n readonly dimensions: ResolvedLayoutConfig.Dimensions;\n readonly settings: ResolvedLayoutConfig.Settings;\n readonly header: ResolvedLayoutConfig.Header;\n readonly resolved: true,\n}\n\n/** @public */\nexport namespace ResolvedLayoutConfig {\n export interface Settings {\n // see Config.Settings for comments\n readonly constrainDragToContainer: boolean;\n readonly reorderEnabled: boolean; // also in ResolvedItemConfig which takes precedence\n readonly popoutWholeStack: boolean;\n readonly blockedPopoutsThrowError: boolean;\n /** @deprecated Will be removed in version 3. */\n readonly closePopoutsOnUnload: boolean;\n readonly responsiveMode: ResponsiveMode;\n readonly tabOverlapAllowance: number;\n readonly reorderOnTabMenuClick: boolean;\n readonly tabControlOffset: number;\n readonly popInOnClose: boolean;\n }\n\n export namespace Settings {\n export const defaults: ResolvedLayoutConfig.Settings = {\n constrainDragToContainer: true,\n reorderEnabled: true,\n popoutWholeStack: false,\n blockedPopoutsThrowError: true,\n closePopoutsOnUnload: true,\n responsiveMode: ResponsiveMode.none, // was onload\n tabOverlapAllowance: 0,\n reorderOnTabMenuClick: true,\n tabControlOffset: 10,\n popInOnClose: false,\n } as const;\n\n export function createCopy(original: Settings): Settings {\n return {\n constrainDragToContainer: original.constrainDragToContainer,\n reorderEnabled: original.reorderEnabled,\n popoutWholeStack: original.popoutWholeStack,\n blockedPopoutsThrowError: original.blockedPopoutsThrowError,\n closePopoutsOnUnload: original.closePopoutsOnUnload,\n responsiveMode: original.responsiveMode,\n tabOverlapAllowance: original.tabOverlapAllowance,\n reorderOnTabMenuClick: original.reorderOnTabMenuClick,\n tabControlOffset: original.tabControlOffset,\n popInOnClose: original.popInOnClose,\n }\n }\n }\n\n export interface Dimensions {\n // see LayoutConfig.Dimensions for comments\n readonly borderWidth: number;\n readonly borderGrabWidth: number,\n readonly defaultMinItemHeight: number;\n readonly defaultMinItemHeightUnit: SizeUnitEnum;\n readonly defaultMinItemWidth: number;\n readonly defaultMinItemWidthUnit: SizeUnitEnum;\n readonly headerHeight: number;\n readonly dragProxyWidth: number;\n readonly dragProxyHeight: number;\n }\n\n export namespace Dimensions {\n export function createCopy(original: Dimensions): Dimensions {\n return {\n borderWidth: original.borderWidth,\n borderGrabWidth: original.borderGrabWidth,\n defaultMinItemHeight: original.defaultMinItemHeight,\n defaultMinItemHeightUnit: original.defaultMinItemHeightUnit,\n defaultMinItemWidth: original.defaultMinItemWidth,\n defaultMinItemWidthUnit: original.defaultMinItemWidthUnit,\n headerHeight: original.headerHeight,\n dragProxyWidth: original.dragProxyWidth,\n dragProxyHeight: original.dragProxyHeight,\n }\n }\n\n export const defaults: ResolvedLayoutConfig.Dimensions = {\n borderWidth: 5,\n borderGrabWidth: 5,\n defaultMinItemHeight: 0,\n defaultMinItemHeightUnit: SizeUnitEnum.Pixel,\n defaultMinItemWidth: 10,\n defaultMinItemWidthUnit: SizeUnitEnum.Pixel,\n headerHeight: 20,\n dragProxyWidth: 300,\n dragProxyHeight: 200\n } as const;\n }\n\n export interface Header {\n readonly show: false | Side;\n readonly popout: false | string;\n readonly dock: string;\n readonly maximise: false | string;\n readonly minimise: string;\n readonly close: false | string;\n readonly tabDropdown: false | string;\n }\n\n export namespace Header {\n export function createCopy(original: Header): Header {\n return {\n show: original.show,\n popout: original.popout,\n dock: original.dock,\n close: original.close,\n maximise: original.maximise,\n minimise: original.minimise,\n tabDropdown: original.tabDropdown,\n }\n }\n\n export const defaults: ResolvedLayoutConfig.Header = {\n show: Side.top,\n popout: 'open in new window',\n dock: 'dock',\n maximise: 'maximise',\n minimise: 'minimise',\n close: 'close',\n tabDropdown: 'additional tabs'\n } as const;\n }\n\n export function isPopout(config: ResolvedLayoutConfig): config is ResolvedPopoutLayoutConfig {\n return 'parentId' in config;\n }\n\n export function createDefault(): ResolvedLayoutConfig {\n const result: ResolvedLayoutConfig = {\n root: undefined,\n openPopouts: [],\n dimensions: ResolvedLayoutConfig.Dimensions.defaults,\n settings: ResolvedLayoutConfig.Settings.defaults,\n header: ResolvedLayoutConfig.Header.defaults,\n resolved: true,\n }\n return result;\n }\n\n export function createCopy(config: ResolvedLayoutConfig): ResolvedLayoutConfig {\n if (isPopout(config)) {\n return ResolvedPopoutLayoutConfig.createCopy(config);\n } else {\n const result: ResolvedLayoutConfig = {\n root: config.root === undefined ? undefined : ResolvedRootItemConfig.createCopy(config.root),\n openPopouts: ResolvedLayoutConfig.copyOpenPopouts(config.openPopouts),\n settings: ResolvedLayoutConfig.Settings.createCopy(config.settings),\n dimensions: ResolvedLayoutConfig.Dimensions.createCopy(config.dimensions),\n header: ResolvedLayoutConfig.Header.createCopy(config.header),\n resolved: config.resolved,\n }\n return result;\n }\n }\n\n export function copyOpenPopouts(original: ResolvedPopoutLayoutConfig[]): ResolvedPopoutLayoutConfig[] {\n const count = original.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = ResolvedPopoutLayoutConfig.createCopy(original[i]);\n }\n return result;\n }\n\n /**\n * Takes a GoldenLayout configuration object and\n * replaces its keys and values recursively with\n * one letter counterparts\n */\n export function minifyConfig(layoutConfig: ResolvedLayoutConfig): ResolvedLayoutConfig {\n return ConfigMinifier.translateObject(layoutConfig, true) as ResolvedLayoutConfig;\n }\n\n /**\n * Takes a configuration Object that was previously minified\n * using minifyConfig and returns its original version\n */\n export function unminifyConfig(minifiedConfig: ResolvedLayoutConfig): ResolvedLayoutConfig {\n return ConfigMinifier.translateObject(minifiedConfig, false) as ResolvedLayoutConfig;\n }\n}\n\n/** @public */\nexport interface ResolvedPopoutLayoutConfig extends ResolvedLayoutConfig {\n readonly parentId: string | null;\n readonly indexInParent: number | null;\n readonly window: ResolvedPopoutLayoutConfig.Window;\n}\n\n/** @public */\nexport namespace ResolvedPopoutLayoutConfig {\n export interface Window {\n readonly width: number | null,\n readonly height: number | null,\n readonly left: number | null,\n readonly top: number | null,\n }\n\n export namespace Window {\n export function createCopy(original: Window): Window {\n return {\n width: original.width,\n height: original.height,\n left: original.left,\n top: original.top,\n }\n }\n\n export const defaults: ResolvedPopoutLayoutConfig.Window = {\n width: null,\n height: null,\n left: null,\n top: null,\n } as const;\n }\n\n export function createCopy(original: ResolvedPopoutLayoutConfig): ResolvedPopoutLayoutConfig {\n const result: ResolvedPopoutLayoutConfig = {\n root: original.root === undefined ? undefined : ResolvedRootItemConfig.createCopy(original.root),\n openPopouts: ResolvedLayoutConfig.copyOpenPopouts(original.openPopouts),\n settings: ResolvedLayoutConfig.Settings.createCopy(original.settings),\n dimensions: ResolvedLayoutConfig.Dimensions.createCopy(original.dimensions),\n header: ResolvedLayoutConfig.Header.createCopy(original.header),\n parentId: original.parentId,\n indexInParent: original.indexInParent,\n window: ResolvedPopoutLayoutConfig.Window.createCopy(original.window),\n resolved: original.resolved,\n }\n return result;\n }\n}\n","import { AssertError } from '../errors/internal-error';\n\n/** @public */\nexport const enum I18nStringId {\n PopoutCannotBeCreatedWithGroundItemConfig,\n PleaseRegisterAConstructorFunction,\n ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned,\n ComponentIsAlreadyRegistered,\n ComponentIsNotVirtuable,\n VirtualComponentDoesNotHaveRootHtmlElement,\n ItemConfigIsNotTypeComponent,\n InvalidNumberPartInSizeString,\n UnknownUnitInSizeString,\n UnsupportedUnitInSizeString,\n}\n\n/** @public */\nexport namespace I18nStrings {\n /** @internal */\n let initialised = false;\n\n /** @internal */\n interface Info {\n readonly id: I18nStringId;\n readonly default: string;\n }\n\n /** @internal */\n type InfosObject = { [id in keyof typeof I18nStringId]: Info };\n\n /** @internal */\n const infosObject: InfosObject = {\n PopoutCannotBeCreatedWithGroundItemConfig: {\n id: I18nStringId.PopoutCannotBeCreatedWithGroundItemConfig,\n default: 'Popout cannot be created with ground ItemConfig'\n },\n PleaseRegisterAConstructorFunction: {\n id: I18nStringId.PleaseRegisterAConstructorFunction,\n default: 'Please register a constructor function'\n },\n ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned: {\n id: I18nStringId.ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned,\n default: 'Component type not registered and BindComponentEvent handler not assigned',\n },\n ComponentIsAlreadyRegistered: {\n id: I18nStringId.ComponentIsAlreadyRegistered,\n default: 'Component is already registered',\n },\n ComponentIsNotVirtuable: {\n id: I18nStringId.ComponentIsNotVirtuable,\n default: 'Component is not virtuable. Requires rootHtmlElement field/getter',\n },\n VirtualComponentDoesNotHaveRootHtmlElement: {\n id: I18nStringId.VirtualComponentDoesNotHaveRootHtmlElement,\n default: 'Virtual component does not have getter \"rootHtmlElement\"',\n },\n ItemConfigIsNotTypeComponent: {\n id: I18nStringId.ItemConfigIsNotTypeComponent,\n default: 'ItemConfig is not of type component',\n },\n\n InvalidNumberPartInSizeString: {\n id: I18nStringId.InvalidNumberPartInSizeString,\n default: 'Invalid number part in size string',\n },\n UnknownUnitInSizeString: {\n id: I18nStringId.UnknownUnitInSizeString,\n default: 'Unknown unit in size string',\n },\n UnsupportedUnitInSizeString: {\n id: I18nStringId.UnsupportedUnitInSizeString,\n default: 'Unsupported unit in size string',\n },\n }\n\n export const idCount = Object.keys(infosObject).length;\n /** @internal */\n const infos = Object.values(infosObject);\n\n export function checkInitialise(): void {\n if (!initialised) {\n for (let i = 0; i < idCount; i++) {\n const info = infos[i];\n if (info.id !== i) {\n throw new AssertError('INSI00110', `${i}: ${info.id}`);\n } else {\n i18nStrings[i] = info.default;\n }\n }\n }\n initialised = true;\n }\n}\n\n/** @public */\nexport const i18nStrings = new Array(I18nStrings.idCount);\n","import { WidthAndHeight } from './types';\n\n/** @internal */\nexport function numberToPixels(value: number): string {\n return value.toString(10) + 'px';\n}\n\n/** @internal */\nexport function pixelsToNumber(value: string): number {\n const numberStr = value.replace(\"px\", \"\");\n return parseFloat(numberStr);\n}\n\n/** @internal */\nexport interface SplitStringAtFirstNonNumericCharResult {\n numericPart: string;\n firstNonNumericCharPart: string;\n}\n\n/** @internal */\nexport function splitStringAtFirstNonNumericChar(value: string): SplitStringAtFirstNonNumericCharResult {\n value = value.trimStart();\n\n const length = value.length;\n if (length === 0) {\n return { numericPart: '', firstNonNumericCharPart: '' }\n } else {\n let firstNonDigitPartIndex = length;\n let gotDecimalPoint = false;\n for (let i = 0; i < length; i++) {\n const char = value[i];\n if (!isDigit(char)) {\n if (char !== '.') {\n firstNonDigitPartIndex = i;\n break;\n } else {\n if (gotDecimalPoint) {\n firstNonDigitPartIndex = i;\n break;\n } else {\n gotDecimalPoint = true;\n }\n }\n }\n }\n const digitsPart = value.substring(0, firstNonDigitPartIndex);\n const firstNonDigitPart = value.substring(firstNonDigitPartIndex).trim();\n\n return { numericPart: digitsPart, firstNonNumericCharPart: firstNonDigitPart };\n }\n}\n\n/** @internal */\nexport function isDigit(char: string) {\n return char >= '0' && char <= '9';\n}\n\n/** @internal */\nexport function getElementWidth(element: HTMLElement): number {\n return element.offsetWidth;\n}\n\n/** @internal */\nexport function setElementWidth(element: HTMLElement, width: number): void {\n const widthAsPixels = numberToPixels(width);\n element.style.width = widthAsPixels;\n}\n\n/** @internal */\nexport function getElementHeight(element: HTMLElement): number {\n return element.offsetHeight;\n}\n\n/** @internal */\nexport function setElementHeight(element: HTMLElement, height: number): void {\n const heightAsPixels = numberToPixels(height);\n element.style.height = heightAsPixels;\n}\n\n/** @internal */\nexport function getElementWidthAndHeight(element: HTMLElement): WidthAndHeight {\n return {\n width: element.offsetWidth,\n height: element.offsetHeight,\n };\n}\n\n/** @internal */\nexport function setElementDisplayVisibility(element: HTMLElement, visible: boolean): void {\n if (visible) {\n element.style.display = '';\n } else {\n element.style.display = 'none';\n }\n}\n\n/** @internal */\nexport function ensureElementPositionAbsolute(element: HTMLElement): void {\n const absolutePosition = 'absolute';\n if (element.style.position !== absolutePosition) {\n element.style.position = absolutePosition;\n }\n}\n\n/**\n * Replacement for JQuery $.extend(target, obj)\n * @internal\n*/\nexport function extend(target: Record, obj: Record): Record {\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n target[key] = obj[key];\n }\n }\n return target;\n}\n\n/**\n * Replacement for JQuery $.extend(true, target, obj)\n * @internal\n*/\nexport function deepExtend(target: Record, obj: Record | undefined): Record {\n if (obj !== undefined) {\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n const value = obj[key];\n const existingTarget = target[key];\n target[key] = deepExtendValue(existingTarget, value);\n }\n }\n }\n\n return target;\n}\n\n/** @internal */\nexport function deepExtendValue(existingTarget: unknown, value: unknown): unknown {\n if (typeof value !== 'object') {\n return value;\n } else {\n if (Array.isArray(value)) {\n const length = value.length;\n const targetArray = new Array(length);\n for (let i = 0; i < length; i++) {\n const element = value[i];\n targetArray[i] = deepExtendValue({}, element);\n }\n return targetArray;\n } else {\n if (value === null) {\n return null;\n } else {\n const valueObj = value as Record;\n if (existingTarget === undefined) {\n return deepExtend({}, valueObj); // overwrite\n } else {\n if (typeof existingTarget !== \"object\") {\n return deepExtend({}, valueObj); // overwrite\n } else {\n if (Array.isArray(existingTarget)) {\n return deepExtend({}, valueObj); // overwrite\n } else {\n if (existingTarget === null) {\n return deepExtend({}, valueObj); // overwrite\n } else {\n const existingTargetObj = existingTarget as Record;\n return deepExtend(existingTargetObj, valueObj); // merge\n }\n }\n }\n }\n }\n }\n }\n}\n\n/** @internal */\nexport function removeFromArray(item: T, array: T[]): void {\n const index = array.indexOf(item);\n\n if (index === -1) {\n throw new Error('Can\\'t remove item from array. Item is not in the array');\n }\n\n array.splice(index, 1);\n}\n\n/** @internal */\nexport function getUniqueId(): string {\n return (Math.random() * 1000000000000000)\n .toString(36)\n .replace('.', '');\n}\n\n/** @internal */\nexport function getErrorMessage(e: unknown): string {\n if (e instanceof Error) {\n return e.message;\n } else {\n if (typeof e === 'string') {\n return e;\n } else {\n return 'Unknown Error';\n }\n }\n}\n","/** @public */\nexport abstract class ExternalError extends Error {\n /** @internal */\n constructor(public readonly type: string, message: string) {\n super(message);\n }\n}\n\n/** @public */\nexport class ConfigurationError extends ExternalError {\n /** @internal */\n constructor(message: string, public readonly node?: string) {\n super('Configuration', message);\n }\n}\n\n/** @public */\nexport class PopoutBlockedError extends ExternalError {\n /** @internal */\n constructor(message: string) {\n super('PopoutBlocked', message);\n }\n}\n\n/** @public */\nexport class ApiError extends ExternalError {\n /** @internal */\n constructor(message: string) {\n super('API', message);\n }\n}\n\n/** @public */\nexport class BindError extends ExternalError {\n /** @internal */\n constructor(message: string) {\n super('Bind', message);\n }\n}\n","import { ConfigurationError } from '../errors/external-error';\nimport { AssertError, UnexpectedUndefinedError, UnreachableCaseError } from '../errors/internal-error';\nimport { I18nStringId, i18nStrings } from '../utils/i18n-strings';\nimport { ItemType, JsonValue, ResponsiveMode, Side, SizeUnitEnum } from '../utils/types';\nimport { deepExtendValue, splitStringAtFirstNonNumericChar } from '../utils/utils';\nimport {\n ResolvedComponentItemConfig,\n ResolvedHeaderedItemConfig,\n ResolvedItemConfig,\n ResolvedLayoutConfig,\n ResolvedPopoutLayoutConfig,\n ResolvedRootItemConfig,\n ResolvedRowOrColumnItemConfig,\n ResolvedStackItemConfig\n} from \"./resolved-config\";\n\n/** @public */\nexport interface ItemConfig {\n /**\n * The type of the item. Possible values are 'row', 'column', 'stack', 'component'.\n */\n type: ItemType;\n\n /**\n * An array of configurations for items that will be created as children of this item.\n */\n content?: ItemConfig[];\n\n /**\n * The width of this item, relative to the other children of its parent in percent\n * @deprecated use {@link (ItemConfig:interface).size} instead\n */\n width?: number;\n\n /**\n * The minimum width of this item in pixels\n * CAUTION - Not tested - do not use\n * @deprecated use {@link (ItemConfig:interface).minSize} instead\n */\n minWidth?: number;\n\n /**\n * The height of this item, relative to the other children of its parent in percent\n * @deprecated use {@link (ItemConfig:interface).size} instead\n */\n height?: number;\n\n /**\n * The minimum height of this item in pixels\n * CAUTION - Not tested - do not use\n * @deprecated use {@link (ItemConfig:interface).minSize} instead\n */\n minHeight?: number;\n\n /**\n * The size of this item.\n * For rows, it specifies height. For columns, it specifies width.\n * Has format \\\\<{@link SizeUnit}\\>. Currently only supports units `fr` and `%`.\n *\n * Space is first proportionally allocated to items with sizeUnit `%`.\n * If there is any space left over (less than 100% allocated), then the\n * remainder is allocated to the items with unit `fr` according to the fractional size.\n * If more than 100% is allocated, then an extra 50% is allocated to items with unit `fr` and\n * is allocated to each item according to its fractional size. All item sizes are then adjusted\n * to bring the total back to 100%\n */\n size?: string;\n\n /**\n * The size of this item.\n * For rows, it specifies height. For columns, it specifies width.\n * Has format . Currently only supports units `px`\n */\n minSize?: string;\n\n /**\n * A string that can be used to identify a ContentItem.\n * Do NOT assign an array. This only exists for legacy purposes. If an array is assigned, the first element\n * will become the id.\n */\n id?: string;\n\n /**\n * Determines if the item is closable. If false, the x on the items tab will be hidden and container.close()\n * will return false\n * Default: true\n */\n isClosable?: boolean;\n\n /**\n * The title of the item as displayed on its tab and on popout windows\n * Default: componentType.toString() or ''\n * @deprecated only Component has a title\n */\n title?: string;\n}\n\n/** @public */\nexport namespace ItemConfig {\n /** @internal */\n export const enum SizeWidthHeightSpecificationType {\n None,\n Size,\n WidthOrHeight,\n }\n\n /** @internal */\n export function resolve(itemConfig: ItemConfig, rowAndColumnChildLegacySizeDefault: boolean): ResolvedItemConfig {\n switch (itemConfig.type) {\n case ItemType.ground:\n throw new ConfigurationError('ItemConfig cannot specify type ground', JSON.stringify(itemConfig));\n case ItemType.row:\n case ItemType.column:\n return RowOrColumnItemConfig.resolve(itemConfig as RowOrColumnItemConfig, rowAndColumnChildLegacySizeDefault);\n\n case ItemType.stack:\n return StackItemConfig.resolve(itemConfig as StackItemConfig, rowAndColumnChildLegacySizeDefault);\n\n case ItemType.component:\n return ComponentItemConfig.resolve(itemConfig as ComponentItemConfig, rowAndColumnChildLegacySizeDefault);\n\n default:\n throw new UnreachableCaseError('UCUICR55499', itemConfig.type);\n }\n }\n\n /** @internal */\n export function resolveContent(content: ItemConfig[] | undefined): ResolvedItemConfig[] {\n if (content === undefined) {\n return [];\n } else {\n const count = content.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = ItemConfig.resolve(content[i], false);\n }\n return result;\n }\n }\n\n /** @internal */\n export function resolveId(id: string | string[] | undefined): string {\n if (id === undefined) {\n return ResolvedItemConfig.defaults.id;\n } else {\n if (Array.isArray(id)) {\n if (id.length === 0) {\n return ResolvedItemConfig.defaults.id;\n } else {\n return id[0];\n }\n } else {\n return id;\n }\n }\n }\n\n /** @internal */\n export function resolveSize(\n size: string | undefined,\n width: number | undefined,\n height: number | undefined,\n rowAndColumnChildLegacySizeDefault: boolean):\n SizeWithUnit {\n // Remove support for rowAndColumnChildLegacySizeDefault in a major version release\n\n if (size !== undefined) {\n return parseSize(size, [SizeUnitEnum.Percent, SizeUnitEnum.Fractional]);\n } else {\n if (width !== undefined || height !== undefined) {\n if (width !== undefined) {\n return { size: width, sizeUnit: SizeUnitEnum.Percent };\n } else {\n if (height !== undefined) {\n return { size: height, sizeUnit: SizeUnitEnum.Percent };\n } else {\n throw new UnexpectedUndefinedError('CRS33390');\n }\n }\n } else {\n if (rowAndColumnChildLegacySizeDefault) {\n return { size: 50, sizeUnit: SizeUnitEnum.Percent };\n } else {\n return { size: ResolvedItemConfig.defaults.size, sizeUnit: ResolvedItemConfig.defaults.sizeUnit };\n }\n }\n }\n }\n\n /** @internal */\n export function resolveMinSize(minSize: string | undefined, minWidth: number | undefined, minHeight: number | undefined): UndefinableSizeWithUnit {\n if (minSize !== undefined) {\n return parseSize(minSize, [SizeUnitEnum.Pixel]);\n } else {\n const minWidthDefined = minWidth !== undefined;\n const minHeightDefined = minHeight !== undefined;\n if (minWidthDefined || minHeightDefined) {\n if (minWidthDefined) {\n return { size: minWidth, sizeUnit: SizeUnitEnum.Pixel };\n } else {\n return { size: minHeight, sizeUnit: SizeUnitEnum.Pixel };\n }\n } else {\n return { size: ResolvedItemConfig.defaults.minSize, sizeUnit: ResolvedItemConfig.defaults.minSizeUnit };\n }\n }\n }\n\n /** @internal */\n export function calculateSizeWidthHeightSpecificationType(config: ItemConfig): SizeWidthHeightSpecificationType {\n if (config.size !== undefined) {\n return SizeWidthHeightSpecificationType.Size;\n } else {\n if (config.width !== undefined || config.height !== undefined) {\n return SizeWidthHeightSpecificationType.WidthOrHeight;\n } else {\n return SizeWidthHeightSpecificationType.None;\n }\n }\n }\n\n export function isGround(config: ItemConfig): config is ItemConfig {\n return config.type === ItemType.ground;\n }\n export function isRow(config: ItemConfig): config is ItemConfig {\n return config.type === ItemType.row;\n }\n export function isColumn(config: ItemConfig): config is ItemConfig {\n return config.type === ItemType.column;\n }\n export function isStack(config: ItemConfig): config is ItemConfig {\n return config.type === ItemType.stack;\n }\n export function isComponent(config: ItemConfig): config is ComponentItemConfig {\n return config.type === ItemType.component;\n }\n}\n\n// Stack or Component\n/** @public */\nexport interface HeaderedItemConfig extends ItemConfig {\n /** @deprecated use {@link (HeaderedItemConfig:namespace).(Header:interface).show} instead */\n hasHeaders?: boolean;\n header?: HeaderedItemConfig.Header;\n maximised?: boolean;\n}\n\n/** @public */\nexport namespace HeaderedItemConfig {\n const legacyMaximisedId = '__glMaximised';\n\n export interface Header {\n show?: false | Side;\n popout?: false | string;\n dock?: false | string;\n maximise?: false | string;\n close?: string;\n minimise?: string;\n tabDropdown?: false | string;\n }\n\n export namespace Header {\n export function resolve(header: Header | undefined, hasHeaders: boolean | undefined): ResolvedHeaderedItemConfig.Header | undefined {\n if (header === undefined && hasHeaders === undefined) {\n return undefined;\n } else {\n const result: ResolvedHeaderedItemConfig.Header = {\n show: header?.show ?? (hasHeaders === undefined ? undefined : hasHeaders ? ResolvedLayoutConfig.Header.defaults.show : false),\n popout: header?.popout,\n maximise: header?.maximise,\n close: header?.close,\n minimise: header?.minimise,\n tabDropdown: header?.tabDropdown,\n }\n return result;\n }\n }\n }\n\n /** @internal */\n export function resolveIdAndMaximised(config: HeaderedItemConfig): { id: string, maximised: boolean} {\n let id: string;\n // To support legacy configs with Id saved as an array of string, assign config.id to a type which includes string array\n let legacyId: string | string[] | undefined = config.id;\n let legacyMaximised = false;\n if (legacyId === undefined) {\n id = ResolvedItemConfig.defaults.id;\n } else {\n if (Array.isArray(legacyId)) {\n const idx = legacyId.findIndex((id) => id === legacyMaximisedId)\n if (idx > 0) {\n legacyMaximised = true;\n legacyId = legacyId.splice(idx, 1);\n }\n if (legacyId.length > 0) {\n id = legacyId[0];\n } else {\n id = ResolvedItemConfig.defaults.id;\n }\n } else {\n id = legacyId;\n }\n }\n\n let maximised: boolean;\n if (config.maximised !== undefined) {\n maximised = config.maximised;\n } else {\n maximised = legacyMaximised;\n }\n\n return { id, maximised }\n }\n}\n\n/** @public */\nexport interface StackItemConfig extends HeaderedItemConfig {\n type: 'stack';\n content: ComponentItemConfig[];\n /** The index of the item in content which is to be active*/\n activeItemIndex?: number;\n}\n\n/** @public */\nexport namespace StackItemConfig {\n /** @internal */\n export function resolve(itemConfig: StackItemConfig, rowAndColumnChildLegacySizeDefault: boolean): ResolvedStackItemConfig {\n const { id, maximised } = HeaderedItemConfig.resolveIdAndMaximised(itemConfig);\n const { size, sizeUnit } = ItemConfig.resolveSize(itemConfig.size, itemConfig.width, itemConfig.height, rowAndColumnChildLegacySizeDefault);\n const { size: minSize, sizeUnit: minSizeUnit } = ItemConfig.resolveMinSize(itemConfig.minSize, itemConfig.minWidth, itemConfig.minHeight);\n\n const result: ResolvedStackItemConfig = {\n type: ItemType.stack,\n content: resolveContent(itemConfig.content),\n size,\n sizeUnit,\n minSize,\n minSizeUnit,\n id,\n maximised,\n isClosable: itemConfig.isClosable ?? ResolvedItemConfig.defaults.isClosable,\n activeItemIndex: itemConfig.activeItemIndex ?? ResolvedStackItemConfig.defaultActiveItemIndex,\n header: HeaderedItemConfig.Header.resolve(itemConfig.header, itemConfig.hasHeaders),\n };\n return result;\n }\n\n /** @internal */\n export function fromResolved(resolvedConfig: ResolvedStackItemConfig): StackItemConfig {\n const result: StackItemConfig = {\n type: ItemType.stack,\n content: fromResolvedContent(resolvedConfig.content),\n size: formatSize(resolvedConfig.size, resolvedConfig.sizeUnit),\n minSize: formatUndefinableSize(resolvedConfig.minSize, resolvedConfig.minSizeUnit),\n id: resolvedConfig.id,\n maximised: resolvedConfig.maximised,\n isClosable: resolvedConfig.isClosable,\n activeItemIndex: resolvedConfig.activeItemIndex,\n header: ResolvedHeaderedItemConfig.Header.createCopy(resolvedConfig.header),\n };\n\n return result;\n }\n\n /** @internal */\n function resolveContent(content: ComponentItemConfig[] | undefined): ResolvedComponentItemConfig[] {\n if (content === undefined) {\n return [];\n } else {\n const count = content.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const childItemConfig = content[i];\n const itemConfig = ItemConfig.resolve(childItemConfig, false);\n if (!ResolvedItemConfig.isComponentItem(itemConfig)) {\n throw new AssertError('UCUSICRC91114', JSON.stringify(itemConfig));\n } else {\n result[i] = itemConfig;\n }\n }\n return result;\n }\n }\n\n /** @internal */\n function fromResolvedContent(resolvedContent: ResolvedComponentItemConfig[]): ComponentItemConfig[] {\n const count = resolvedContent.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const resolvedContentConfig = resolvedContent[i];\n result[i] = ComponentItemConfig.fromResolved(resolvedContentConfig);\n }\n return result;\n }\n}\n\n/** @public */\nexport interface ComponentItemConfig extends HeaderedItemConfig {\n type: 'component';\n readonly content?: [];\n\n /**\n * The title of the item as displayed on its tab and on popout windows\n * Default: componentType.toString() or ''\n */\n title?: string;\n\n /**\n * The type of the component.\n * @deprecated use {@link (ComponentItemConfig:interface).componentType} instead\n */\n componentName?: string;\n\n /**\n * The type of the component.\n * `componentType` must be of type `string` if it is registered with any of the following functions:\n * * {@link (GoldenLayout:class).registerComponent} (deprecated)\n * * {@link (GoldenLayout:class).registerComponentConstructor}\n * * {@link (GoldenLayout:class).registerComponentFactoryFunction}\n */\n componentType: JsonValue;\n /**\n * The state information with which a component will be initialised with.\n * Will be passed to the component constructor function and will be the value returned by\n * container.initialState.\n */\n componentState?: JsonValue;\n\n /**\n * Default: true\n */\n reorderEnabled?: boolean; // Takes precedence over LayoutConfig.reorderEnabled.\n}\n\n/** @public */\nexport namespace ComponentItemConfig {\n /** @internal */\n export function resolve(itemConfig: ComponentItemConfig, rowAndColumnChildLegacySizeDefault: boolean): ResolvedComponentItemConfig {\n let componentType: JsonValue | undefined = itemConfig.componentType;\n if (componentType === undefined) {\n componentType = itemConfig.componentName;\n }\n if (componentType === undefined) {\n throw new Error('ComponentItemConfig.componentType is undefined');\n } else {\n const { id, maximised } = HeaderedItemConfig.resolveIdAndMaximised(itemConfig);\n let title: string;\n if (itemConfig.title === undefined || itemConfig.title === '') {\n title = ComponentItemConfig.componentTypeToTitle(componentType);\n } else {\n title = itemConfig.title;\n }\n const { size, sizeUnit } = ItemConfig.resolveSize(itemConfig.size, itemConfig.width, itemConfig.height, rowAndColumnChildLegacySizeDefault);\n const { size: minSize, sizeUnit: minSizeUnit } = ItemConfig.resolveMinSize(itemConfig.minSize, itemConfig.minWidth, itemConfig.minHeight);\n const result: ResolvedComponentItemConfig = {\n type: itemConfig.type,\n content: [],\n size,\n sizeUnit,\n minSize,\n minSizeUnit,\n id,\n maximised,\n isClosable: itemConfig.isClosable ?? ResolvedItemConfig.defaults.isClosable,\n reorderEnabled: itemConfig.reorderEnabled ?? ResolvedComponentItemConfig.defaultReorderEnabled,\n title,\n header: HeaderedItemConfig.Header.resolve(itemConfig.header, itemConfig.hasHeaders),\n componentType,\n componentState: itemConfig.componentState ?? {},\n };\n return result;\n }\n }\n\n /** @internal */\n export function fromResolved(resolvedConfig: ResolvedComponentItemConfig): ComponentItemConfig {\n const result: ComponentItemConfig = {\n type: ItemType.component,\n size: formatSize(resolvedConfig.size, resolvedConfig.sizeUnit),\n minSize: formatUndefinableSize(resolvedConfig.minSize, resolvedConfig.minSizeUnit),\n id: resolvedConfig.id,\n maximised: resolvedConfig.maximised,\n isClosable: resolvedConfig.isClosable,\n reorderEnabled: resolvedConfig.reorderEnabled,\n title: resolvedConfig.title,\n header: ResolvedHeaderedItemConfig.Header.createCopy(resolvedConfig.header),\n componentType: resolvedConfig.componentType,\n componentState: deepExtendValue(undefined, resolvedConfig.componentState) as JsonValue,\n }\n\n return result;\n }\n\n export function componentTypeToTitle(componentType: JsonValue): string {\n const componentTypeType = typeof componentType;\n switch (componentTypeType) {\n case 'string': return componentType as string;\n case 'number': return (componentType as number).toString();\n case 'boolean': return (componentType as boolean).toString();\n default: return '';\n }\n }\n}\n\n// RowOrColumn\n/** @public */\nexport interface RowOrColumnItemConfig extends ItemConfig {\n type: 'row' | 'column';\n content: (RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig)[];\n}\n\n/** @public */\nexport namespace RowOrColumnItemConfig {\n export type ChildItemConfig = RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig;\n\n export function isChildItemConfig(itemConfig: ItemConfig): itemConfig is ChildItemConfig {\n switch (itemConfig.type) {\n case ItemType.row:\n case ItemType.column:\n case ItemType.stack:\n case ItemType.component:\n return true;\n case ItemType.ground:\n return false;\n default:\n throw new UnreachableCaseError('UROCOSPCICIC13687', itemConfig.type);\n }\n }\n\n /** @internal */\n export function resolve(itemConfig: RowOrColumnItemConfig, rowAndColumnChildLegacySizeDefault: boolean): ResolvedRowOrColumnItemConfig {\n const { size, sizeUnit } = ItemConfig.resolveSize(itemConfig.size, itemConfig.width, itemConfig.height, rowAndColumnChildLegacySizeDefault);\n const { size: minSize, sizeUnit: minSizeUnit } = ItemConfig.resolveMinSize(itemConfig.minSize, itemConfig.minWidth, itemConfig.minHeight);\n const result: ResolvedRowOrColumnItemConfig = {\n type: itemConfig.type,\n content: RowOrColumnItemConfig.resolveContent(itemConfig.content),\n size,\n sizeUnit,\n minSize,\n minSizeUnit,\n id: ItemConfig.resolveId(itemConfig.id),\n isClosable: itemConfig.isClosable ?? ResolvedItemConfig.defaults.isClosable,\n }\n return result;\n }\n\n /** @internal */\n export function fromResolved(resolvedConfig: ResolvedRowOrColumnItemConfig): RowOrColumnItemConfig {\n const result: RowOrColumnItemConfig = {\n type: resolvedConfig.type,\n content: fromResolvedContent(resolvedConfig.content),\n size: formatSize(resolvedConfig.size, resolvedConfig.sizeUnit),\n minSize: formatUndefinableSize(resolvedConfig.minSize, resolvedConfig.minSizeUnit),\n id: resolvedConfig.id,\n isClosable: resolvedConfig.isClosable,\n }\n\n return result;\n }\n\n /** @internal */\n export function resolveContent(content: ChildItemConfig[] | undefined): ResolvedRowOrColumnItemConfig.ChildItemConfig[] {\n if (content === undefined) {\n return [];\n } else {\n const count = content.length;\n const childItemConfigs = new Array(count);\n let widthOrHeightSpecifiedAtLeastOnce = false;\n let sizeSpecifiedAtLeastOnce = false;\n for (let i = 0; i < count; i++) {\n const childItemConfig = content[i];\n if (!RowOrColumnItemConfig.isChildItemConfig(childItemConfig)) {\n throw new ConfigurationError('ItemConfig is not Row, Column or Stack', childItemConfig);\n } else {\n if (!sizeSpecifiedAtLeastOnce) {\n const sizeWidthHeightSpecificationType = ItemConfig.calculateSizeWidthHeightSpecificationType(childItemConfig);\n switch (sizeWidthHeightSpecificationType) {\n case ItemConfig.SizeWidthHeightSpecificationType.None:\n break;\n case ItemConfig.SizeWidthHeightSpecificationType.WidthOrHeight:\n widthOrHeightSpecifiedAtLeastOnce = true;\n break;\n case ItemConfig.SizeWidthHeightSpecificationType.Size:\n sizeSpecifiedAtLeastOnce = true;\n break;\n default:\n throw new UnreachableCaseError('ROCICRC87556', sizeWidthHeightSpecificationType);\n }\n }\n childItemConfigs[i] = childItemConfig;\n }\n }\n\n let legacySizeDefault: boolean;\n if (sizeSpecifiedAtLeastOnce) {\n legacySizeDefault = false;\n } else {\n if (widthOrHeightSpecifiedAtLeastOnce) {\n legacySizeDefault = true;\n } else {\n legacySizeDefault = false;\n }\n }\n\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const childItemConfig = childItemConfigs[i];\n const resolvedChildItemConfig = ItemConfig.resolve(childItemConfig, legacySizeDefault);\n if (!ResolvedRowOrColumnItemConfig.isChildItemConfig(resolvedChildItemConfig)) {\n throw new AssertError('UROCOSPIC99512', JSON.stringify(resolvedChildItemConfig));\n } else {\n result[i] = resolvedChildItemConfig;\n }\n }\n return result;\n }\n }\n\n /** @internal */\n function fromResolvedContent(resolvedContent: readonly ResolvedRowOrColumnItemConfig.ChildItemConfig[]): RowOrColumnItemConfig.ChildItemConfig[] {\n const count = resolvedContent.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const resolvedContentConfig = resolvedContent[i];\n const type = resolvedContentConfig.type;\n let contentConfig: RowOrColumnItemConfig.ChildItemConfig;\n switch (type) {\n case ItemType.row:\n case ItemType.column:\n contentConfig = RowOrColumnItemConfig.fromResolved(resolvedContentConfig);\n break;\n case ItemType.stack:\n contentConfig = StackItemConfig.fromResolved(resolvedContentConfig);\n break;\n case ItemType.component:\n contentConfig = ComponentItemConfig.fromResolved(resolvedContentConfig);\n break;\n default:\n throw new UnreachableCaseError('ROCICFRC44797', type);\n }\n result[i] = contentConfig;\n }\n return result;\n }\n}\n\n/** @public */\nexport type RootItemConfig = RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig;\n\n/** @public */\nexport namespace RootItemConfig {\n export function isRootItemConfig(itemConfig: ItemConfig): itemConfig is RootItemConfig {\n switch (itemConfig.type) {\n case ItemType.row:\n case ItemType.column:\n case ItemType.stack:\n case ItemType.component:\n return true;\n case ItemType.ground:\n return false;\n default:\n throw new UnreachableCaseError('URICIR23687', itemConfig.type);\n }\n }\n\n /** @internal */\n export function resolve(itemConfig: RootItemConfig | undefined): ResolvedRootItemConfig | undefined {\n if (itemConfig === undefined) {\n return undefined;\n } else {\n const result = ItemConfig.resolve(itemConfig, false);\n if (!ResolvedRootItemConfig.isRootItemConfig(result)) {\n throw new ConfigurationError('ItemConfig is not Row, Column or Stack', JSON.stringify(itemConfig));\n } else {\n return result;\n }\n }\n }\n\n /** @internal */\n export function fromResolvedOrUndefined(resolvedItemConfig: ResolvedRootItemConfig | undefined): RootItemConfig | undefined {\n if (resolvedItemConfig === undefined) {\n return undefined;\n } else {\n const type = resolvedItemConfig.type;\n switch (type) {\n case ItemType.row:\n case ItemType.column:\n return RowOrColumnItemConfig.fromResolved(resolvedItemConfig);\n case ItemType.stack:\n return StackItemConfig.fromResolved(resolvedItemConfig);\n case ItemType.component:\n return ComponentItemConfig.fromResolved(resolvedItemConfig);\n default:\n throw new UnreachableCaseError('RICFROU89921', type);\n }\n }\n }\n}\n\n/** @public */\nexport interface LayoutConfig {\n root: RootItemConfig | undefined;\n /** @deprecated Use {@link (LayoutConfig:interface).root} */\n content?: (RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig)[];\n openPopouts?: PopoutLayoutConfig[];\n dimensions?: LayoutConfig.Dimensions;\n settings?: LayoutConfig.Settings;\n /** @deprecated use {@link (LayoutConfig:interface).header} instead */\n labels?: LayoutConfig.Labels;\n header?: LayoutConfig.Header;\n}\n\n/** Use to specify LayoutConfig with defaults or deserialise a LayoutConfig.\n * Deserialisation will handle backwards compatibility.\n * Note that LayoutConfig should be used for serialisation (not LayoutConfig)\n * @public\n */\nexport namespace LayoutConfig {\n export interface Settings {\n /**\n * @deprecated use ${@link (LayoutConfig:namespace).(Header:interface).show} instead\n */\n hasHeaders?: boolean;\n\n /**\n * Constrains the area in which items can be dragged to the layout's container. Will be set to false\n * automatically when layout.createDragSource() is called.\n * Default: true\n */\n constrainDragToContainer?: boolean;\n\n /**\n * If true, the user can re-arrange the layout by dragging items by their tabs to the desired location.\n * Can be overridden by ItemConfig.reorderEnabled for specific ItemConfigs\n * Default: true\n */\n reorderEnabled?: boolean;\n\n /**\n * Decides what will be opened in a new window if the user clicks the popout icon. If true the entire stack will\n * be transferred to the new window, if false only the active component will be opened.\n * Default: false\n */\n popoutWholeStack?: boolean;\n\n /**\n * Specifies if an error is thrown when a popout is blocked by the browser (e.g. by opening it programmatically).\n * If false, the popout call will fail silently.\n * Default: true\n */\n blockedPopoutsThrowError?: boolean;\n\n /**\n * Specifies if all popouts should be closed when the page that created them is closed. Popouts don't have a\n * strong dependency on their parent and can exist on their own, but can be quite annoying to close by hand. In\n * addition, any changes made to popouts won't be stored after the parent is closed.\n * Default: true\n * @deprecated Will be removed in version 3.\n */\n closePopoutsOnUnload?: boolean;\n\n /**\n * Specifies if the popout icon should be displayed in the header-bar.\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).popout} instead\n */\n showPopoutIcon?: boolean;\n\n /**\n * Specifies if the maximise icon should be displayed in the header-bar.\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).maximise} instead\n */\n showMaximiseIcon?: boolean;\n\n /**\n * Specifies if the close icon should be displayed in the header-bar.\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).close} instead\n */\n showCloseIcon?: boolean;\n\n /**\n * Specifies Responsive Mode (more info needed).\n * Default: none\n */\n responsiveMode?: ResponsiveMode;\n\n /**\n * Specifies Maximum pixel overlap per tab.\n * Default: 0\n */\n tabOverlapAllowance?: number;\n\n /**\n *\n * Default: true\n */\n reorderOnTabMenuClick?: boolean;\n\n /**\n * Default: 10\n */\n tabControlOffset?: number;\n\n /**\n * Specifies whether to pop in elements when closing a popout window.\n * Default: false\n */\n popInOnClose?: boolean;\n }\n\n export namespace Settings {\n export function resolve(settings: Settings | undefined): ResolvedLayoutConfig.Settings {\n const result: ResolvedLayoutConfig.Settings = {\n constrainDragToContainer: settings?.constrainDragToContainer ?? ResolvedLayoutConfig.Settings.defaults.constrainDragToContainer,\n reorderEnabled: settings?.reorderEnabled ?? ResolvedLayoutConfig.Settings.defaults.reorderEnabled,\n popoutWholeStack: settings?.popoutWholeStack ?? ResolvedLayoutConfig.Settings.defaults.popoutWholeStack,\n blockedPopoutsThrowError: settings?.blockedPopoutsThrowError ?? ResolvedLayoutConfig.Settings.defaults.blockedPopoutsThrowError,\n closePopoutsOnUnload: settings?.closePopoutsOnUnload ?? ResolvedLayoutConfig.Settings.defaults.closePopoutsOnUnload,\n responsiveMode: settings?.responsiveMode ?? ResolvedLayoutConfig.Settings.defaults.responsiveMode,\n tabOverlapAllowance: settings?.tabOverlapAllowance ?? ResolvedLayoutConfig.Settings.defaults.tabOverlapAllowance,\n reorderOnTabMenuClick: settings?.reorderOnTabMenuClick ?? ResolvedLayoutConfig.Settings.defaults.reorderOnTabMenuClick,\n tabControlOffset: settings?.tabControlOffset ?? ResolvedLayoutConfig.Settings.defaults.tabControlOffset,\n popInOnClose: settings?.popInOnClose ?? ResolvedLayoutConfig.Settings.defaults.popInOnClose,\n }\n return result;\n }\n }\n\n export interface Dimensions {\n /**\n * The width of the borders between the layout items in pixel. Please note: The actual draggable area is wider\n * than the visible one, making it safe to set this to small values without affecting usability.\n * Default: 5\n */\n borderWidth?: number;\n\n /**\n * Default: 15\n */\n borderGrabWidth?: number,\n\n /**\n * The minimum height an item can be resized to (in pixel).\n * @deprecated use {@link (LayoutConfig:namespace).(Dimensions:interface).defaultMinItemHeight} instead\n */\n minItemHeight?: number;\n\n /**\n * The minimum height an item can be resized to.\n * Default: 0\n */\n defaultMinItemHeight?: string;\n\n /**\n * The minimum width an item can be resized to (in pixel).\n * @deprecated use {@link (LayoutConfig:namespace).(Dimensions:interface).defaultMinItemWidth} instead\n */\n minItemWidth?: number;\n\n /**\n * The minimum width an item can be resized to.\n * Default: 10px\n */\n defaultMinItemWidth?: string;\n\n /**\n * The height of the header elements in pixel. This can be changed, but your theme's header css needs to be\n * adjusted accordingly.\n * Default: 20\n */\n headerHeight?: number;\n\n /**\n * The width of the element that appears when an item is dragged (in pixel).\n * Default: 300\n */\n dragProxyWidth?: number;\n\n /**\n * The height of the element that appears when an item is dragged (in pixel).\n * Default: 200\n */\n dragProxyHeight?: number;\n }\n\n export namespace Dimensions {\n /** @internal */\n export function resolve(dimensions: Dimensions | undefined): ResolvedLayoutConfig.Dimensions {\n const { size: defaultMinItemHeight, sizeUnit: defaultMinItemHeightUnit } = Dimensions.resolveDefaultMinItemHeight(dimensions);\n const { size: defaultMinItemWidth, sizeUnit: defaultMinItemWidthUnit } = Dimensions.resolveDefaultMinItemWidth(dimensions);\n const result: ResolvedLayoutConfig.Dimensions = {\n borderWidth: dimensions?.borderWidth ?? ResolvedLayoutConfig.Dimensions.defaults.borderWidth,\n borderGrabWidth: dimensions?.borderGrabWidth ?? ResolvedLayoutConfig.Dimensions.defaults.borderGrabWidth,\n defaultMinItemHeight,\n defaultMinItemHeightUnit,\n defaultMinItemWidth,\n defaultMinItemWidthUnit,\n headerHeight: dimensions?.headerHeight ?? ResolvedLayoutConfig.Dimensions.defaults.headerHeight,\n dragProxyWidth: dimensions?.dragProxyWidth ?? ResolvedLayoutConfig.Dimensions.defaults.dragProxyWidth,\n dragProxyHeight: dimensions?.dragProxyHeight ?? ResolvedLayoutConfig.Dimensions.defaults.dragProxyHeight,\n }\n return result;\n }\n\n /** @internal */\n export function fromResolved(resolvedDimensions: ResolvedLayoutConfig.Dimensions): Dimensions {\n const result: Dimensions = {\n borderWidth: resolvedDimensions.borderWidth,\n borderGrabWidth: resolvedDimensions.borderGrabWidth,\n defaultMinItemHeight: formatSize(resolvedDimensions.defaultMinItemHeight, resolvedDimensions.defaultMinItemHeightUnit),\n defaultMinItemWidth: formatSize(resolvedDimensions.defaultMinItemWidth, resolvedDimensions.defaultMinItemWidthUnit),\n headerHeight: resolvedDimensions.headerHeight,\n dragProxyWidth: resolvedDimensions.dragProxyWidth,\n dragProxyHeight: resolvedDimensions.dragProxyHeight,\n };\n\n return result;\n }\n\n /** @internal */\n export function resolveDefaultMinItemHeight(dimensions: Dimensions | undefined): SizeWithUnit {\n const height = dimensions?.defaultMinItemHeight;\n if (height === undefined) {\n return { size: ResolvedLayoutConfig.Dimensions.defaults.defaultMinItemHeight, sizeUnit: ResolvedLayoutConfig.Dimensions.defaults.defaultMinItemHeightUnit };\n } else {\n return parseSize(height, [SizeUnitEnum.Pixel]);\n }\n }\n\n /** @internal */\n export function resolveDefaultMinItemWidth(dimensions: Dimensions | undefined): SizeWithUnit {\n const width = dimensions?.defaultMinItemWidth;\n if (width === undefined) {\n return { size: ResolvedLayoutConfig.Dimensions.defaults.defaultMinItemWidth, sizeUnit: ResolvedLayoutConfig.Dimensions.defaults.defaultMinItemWidthUnit };\n } else {\n return parseSize(width, [SizeUnitEnum.Pixel]);\n }\n }\n }\n\n export interface Labels {\n /**\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).close} instead\n */\n close?: string;\n\n /**\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).maximise} instead\n */\n maximise?: string;\n\n /**\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).minimise} instead\n */\n minimise?: string;\n\n /**\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).popin} instead\n */\n popin?: string;\n\n /**\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).popout} instead\n */\n popout?: string;\n\n /**\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).tabDropdown} instead\n */\n tabDropdown?: string;\n }\n\n export interface Header {\n /**\n * Specifies whether header should be displayed, and if so, on which side.\n * If false, the layout will be displayed with splitters only.\n * Default: 'top'\n */\n show?: false | Side;\n /**\n * The tooltip text that appears when hovering over the popout icon or false if popout button not displayed.\n * Default: 'open in new window'\n */\n popout?: false | string;\n /**\n * The tooltip text that appears when hovering over the popin icon.\n * Default: 'pop in'\n */\n popin?: string;\n /**\n * The tooltip text that appears when hovering over the maximise icon or false if maximised button not displayed.\n * Default: 'maximise'\n */\n maximise?: false | string;\n /**\n * The tooltip text that appears when hovering over the close icon.\n * Default: 'close'\n */\n close?: false | string;\n /**\n * The tooltip text that appears when hovering over the minimise icon.\n * Default: 'minimise'\n */\n minimise?: string;\n /**\n *\n * Default: 'additional tabs'\n */\n tabDropdown?: false | string;\n }\n\n export namespace Header {\n /** @internal */\n export function resolve(header: Header | undefined,\n settings: LayoutConfig.Settings | undefined, labels: LayoutConfig.Labels | undefined\n ): ResolvedLayoutConfig.Header {\n let show: false | Side;\n if (header?.show !== undefined) {\n show = header.show;\n } else {\n if (settings !== undefined && settings.hasHeaders !== undefined) {\n show = settings.hasHeaders ? ResolvedLayoutConfig.Header.defaults.show : false;\n } else {\n show = ResolvedLayoutConfig.Header.defaults.show;\n }\n }\n const result: ResolvedLayoutConfig.Header = {\n show,\n popout: header?.popout ?? labels?.popout ??\n (settings?.showPopoutIcon === false ? false : ResolvedLayoutConfig.Header.defaults.popout),\n dock: header?.popin ?? labels?.popin ?? ResolvedLayoutConfig.Header.defaults.dock,\n maximise: header?.maximise ?? labels?.maximise ??\n (settings?.showMaximiseIcon === false ? false : ResolvedLayoutConfig.Header.defaults.maximise),\n close: header?.close ?? labels?.close ??\n (settings?.showCloseIcon === false ? false : ResolvedLayoutConfig.Header.defaults.close),\n minimise: header?.minimise ?? labels?.minimise ?? ResolvedLayoutConfig.Header.defaults.minimise,\n tabDropdown: header?.tabDropdown ?? labels?.tabDropdown ?? ResolvedLayoutConfig.Header.defaults.tabDropdown,\n }\n return result;\n }\n }\n\n export function isPopout(config: LayoutConfig): config is PopoutLayoutConfig {\n return 'parentId' in config || 'indexInParent' in config || 'window' in config;\n }\n\n /** @internal */\n export function resolve(layoutConfig: LayoutConfig): ResolvedLayoutConfig {\n if (isPopout(layoutConfig)) {\n return PopoutLayoutConfig.resolve(layoutConfig);\n } else {\n let root: RootItemConfig | undefined;\n if (layoutConfig.root !== undefined) {\n root = layoutConfig.root;\n } else {\n if (layoutConfig.content !== undefined && layoutConfig.content.length > 0) {\n root = layoutConfig.content[0];\n } else {\n root = undefined;\n }\n }\n const config: ResolvedLayoutConfig = {\n resolved: true,\n root: RootItemConfig.resolve(root),\n openPopouts: LayoutConfig.resolveOpenPopouts(layoutConfig.openPopouts),\n dimensions: LayoutConfig.Dimensions.resolve(layoutConfig.dimensions),\n settings: LayoutConfig.Settings.resolve(layoutConfig.settings),\n header: LayoutConfig.Header.resolve(layoutConfig.header, layoutConfig.settings, layoutConfig.labels),\n }\n return config;\n }\n }\n\n export function fromResolved(config: ResolvedLayoutConfig): LayoutConfig {\n const result: LayoutConfig = {\n root: RootItemConfig.fromResolvedOrUndefined(config.root),\n openPopouts: PopoutLayoutConfig.fromResolvedArray(config.openPopouts),\n settings: ResolvedLayoutConfig.Settings.createCopy(config.settings),\n dimensions: LayoutConfig.Dimensions.fromResolved(config.dimensions),\n header: ResolvedLayoutConfig.Header.createCopy(config.header),\n };\n return result;\n }\n\n export function isResolved(configOrResolvedConfig: ResolvedLayoutConfig | LayoutConfig): configOrResolvedConfig is ResolvedLayoutConfig {\n const config = configOrResolvedConfig as ResolvedLayoutConfig;\n return config.resolved !== undefined && (config.resolved === true);\n }\n\n /** @internal */\n export function resolveOpenPopouts(popoutConfigs: PopoutLayoutConfig[] | undefined): ResolvedPopoutLayoutConfig[] {\n if (popoutConfigs === undefined) {\n return [];\n } else {\n const count = popoutConfigs.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = PopoutLayoutConfig.resolve(popoutConfigs[i]);\n }\n return result;\n }\n }\n}\n\n/** @public */\nexport interface PopoutLayoutConfig extends LayoutConfig {\n /** The id of the element the item will be appended to on popIn\n * If null, append to topmost layout element\n */\n parentId: string | null | undefined;\n /** The position of this element within its parent\n * If null, position is last\n */\n indexInParent: number | null | undefined;\n /** @deprecated use {@link (PopoutLayoutConfig:interface).window} */\n dimensions: PopoutLayoutConfig.Dimensions | undefined; // for backwards compatibility\n window: PopoutLayoutConfig.Window | undefined;\n}\n\n/** @public */\nexport namespace PopoutLayoutConfig {\n // Previous versions kept window information in Dimensions key. Only use for backwards compatibility\n /** @deprecated use {@link (PopoutLayoutConfig:namespace).(Window:interface)} */\n export interface Dimensions extends LayoutConfig.Dimensions {\n /** @deprecated use {@link (PopoutLayoutConfig:namespace).(Window:interface).width} */\n width?: number | null,\n /** @deprecated use {@link (PopoutLayoutConfig:namespace).(Window:interface).height} */\n height?: number | null,\n /** @deprecated use {@link (PopoutLayoutConfig:namespace).(Window:interface).left} */\n left?: number | null,\n /** @deprecated use {@link (PopoutLayoutConfig:namespace).(Window:interface).top} */\n top?: number | null,\n }\n\n export interface Window {\n width?: number,\n height?: number,\n left?: number,\n top?: number,\n }\n\n export namespace Window {\n /** @internal */\n export function resolve(window: Window | undefined,\n dimensions: Dimensions | undefined): ResolvedPopoutLayoutConfig.Window\n {\n let result: ResolvedPopoutLayoutConfig.Window;\n const defaults = ResolvedPopoutLayoutConfig.Window.defaults;\n if (window !== undefined) {\n result = {\n width: window.width ?? defaults.width,\n height: window.height ?? defaults.height,\n left: window.left ?? defaults.left,\n top: window.top ?? defaults.top,\n }\n } else {\n result = {\n width: dimensions?.width ?? defaults.width,\n height: dimensions?.height ?? defaults.height,\n left: dimensions?.left ?? defaults.left,\n top: dimensions?.top ?? defaults.top,\n }\n }\n return result;\n }\n\n /** @internal */\n export function fromResolved(resolvedWindow: ResolvedPopoutLayoutConfig.Window): Window {\n const result: Window = {\n width: resolvedWindow.width === null ? undefined : resolvedWindow.width,\n height: resolvedWindow.height === null ? undefined : resolvedWindow.height,\n left: resolvedWindow.left === null ? undefined : resolvedWindow.left,\n top: resolvedWindow.top === null ? undefined : resolvedWindow.top,\n }\n\n return result;\n }\n }\n\n /** @internal */\n export function resolve(popoutConfig: PopoutLayoutConfig): ResolvedPopoutLayoutConfig {\n let root: RootItemConfig | undefined;\n if (popoutConfig.root !== undefined) {\n root = popoutConfig.root;\n } else {\n if (popoutConfig.content !== undefined && popoutConfig.content.length > 0) {\n root = popoutConfig.content[0];\n } else {\n root = undefined;\n }\n }\n\n const config: ResolvedPopoutLayoutConfig = {\n root: RootItemConfig.resolve(root),\n openPopouts: LayoutConfig.resolveOpenPopouts(popoutConfig.openPopouts),\n dimensions: LayoutConfig.Dimensions.resolve(popoutConfig.dimensions),\n settings: LayoutConfig.Settings.resolve(popoutConfig.settings),\n header: LayoutConfig.Header.resolve(popoutConfig.header, popoutConfig.settings, popoutConfig.labels),\n parentId: popoutConfig.parentId ?? null,\n indexInParent: popoutConfig.indexInParent ?? null,\n window: PopoutLayoutConfig.Window.resolve(popoutConfig.window, popoutConfig.dimensions),\n resolved: true,\n }\n return config;\n }\n\n /** @internal */\n export function fromResolved(resolvedConfig: ResolvedPopoutLayoutConfig): PopoutLayoutConfig {\n const result: PopoutLayoutConfig = {\n root: RootItemConfig.fromResolvedOrUndefined(resolvedConfig.root),\n openPopouts: fromResolvedArray(resolvedConfig.openPopouts),\n dimensions: LayoutConfig.Dimensions.fromResolved(resolvedConfig.dimensions),\n settings: ResolvedLayoutConfig.Settings.createCopy(resolvedConfig.settings),\n header: ResolvedLayoutConfig.Header.createCopy(resolvedConfig.header),\n parentId: resolvedConfig.parentId,\n indexInParent: resolvedConfig.indexInParent,\n window: PopoutLayoutConfig.Window.fromResolved(resolvedConfig.window),\n }\n\n return result;\n }\n\n /** @internal */\n export function fromResolvedArray(resolvedArray: ResolvedPopoutLayoutConfig[]): PopoutLayoutConfig[] {\n const resolvedOpenPopoutCount = resolvedArray.length;\n const result = new Array(resolvedOpenPopoutCount);\n for (let i = 0; i < resolvedOpenPopoutCount; i++) {\n const resolvedOpenPopout = resolvedArray[i];\n result[i] = PopoutLayoutConfig.fromResolved(resolvedOpenPopout);\n }\n\n return result;\n }\n}\n\n/** @internal */\nexport interface SizeWithUnit {\n size: number;\n sizeUnit: SizeUnitEnum;\n}\n\n/** @internal */\nexport interface UndefinableSizeWithUnit {\n size: number | undefined;\n sizeUnit: SizeUnitEnum;\n}\n\n/** @internal */\nexport function parseSize(sizeString: string, allowableSizeUnits: readonly SizeUnitEnum[]): SizeWithUnit {\n const { numericPart: digitsPart, firstNonNumericCharPart: firstNonDigitPart } = splitStringAtFirstNonNumericChar(sizeString);\n const size = Number.parseInt(digitsPart, 10);\n if (isNaN(size)) {\n throw new ConfigurationError(`${i18nStrings[I18nStringId.InvalidNumberPartInSizeString]}: ${sizeString}`);\n } else {\n const sizeUnit = SizeUnitEnum.tryParse(firstNonDigitPart);\n if (sizeUnit === undefined) {\n throw new ConfigurationError(`${i18nStrings[I18nStringId.UnknownUnitInSizeString]}: ${sizeString}`)\n } else {\n if (!allowableSizeUnits.includes(sizeUnit)) {\n throw new ConfigurationError(`${i18nStrings[I18nStringId.UnsupportedUnitInSizeString]}: ${sizeString}`)\n } else {\n return { size, sizeUnit };\n }\n }\n }\n}\n\n/** @internal */\nexport function formatSize(size: number, sizeUnit: SizeUnitEnum) {\n return size.toString(10) + SizeUnitEnum.format(sizeUnit);\n}\n\n/** @internal */\nexport function formatUndefinableSize(size: number| undefined, sizeUnit: SizeUnitEnum) {\n if (size === undefined) {\n return undefined;\n } else {\n return size.toString(10) + SizeUnitEnum.format(sizeUnit);\n }\n}\n\n/** @public @deprecated - use {@link (LayoutConfig:interface)} */\nexport type Config = LayoutConfig;\n","import { BrowserPopout } from '../controls/browser-popout';\nimport { Tab } from '../controls/tab';\nimport { ComponentItem } from '../items/component-item';\n\n/**\n * A generic and very fast EventEmitter implementation. On top of emitting the actual event it emits an\n * {@link (EventEmitter:namespace).ALL_EVENT} event for every event triggered. This allows to hook into it and proxy events forwards\n * @public\n */\nexport class EventEmitter {\n /** @internal */\n private _allEventSubscriptions: EventEmitter.UnknownCallback[] = [];\n /** @internal */\n private _subscriptionsMap = new Map();\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n tryBubbleEvent(name: string, args: unknown[]): void {\n // overridden by ContentItem\n }\n\n /**\n * Emit an event and notify listeners\n *\n * @param eventName - The name of the event\n * @param args - Additional arguments that will be passed to the listener\n */\n emit(eventName: K, ...args: EventEmitter.EventParamsMap[K]): void {\n let subcriptions = this._subscriptionsMap.get(eventName);\n\n if (subcriptions !== undefined) {\n subcriptions = subcriptions.slice();\n for (let i = 0; i < subcriptions.length; i++) {\n const subscription = subcriptions[i];\n subscription(...args);\n }\n }\n\n this.emitAllEvent(eventName, args);\n this.tryBubbleEvent(eventName, args);\n }\n\n /** @internal */\n emitUnknown(eventName: string, ...args: EventEmitter.UnknownParams): void {\n let subs = this._subscriptionsMap.get(eventName);\n\n if (subs !== undefined) {\n subs = subs.slice();\n for (let i = 0; i < subs.length; i++) {\n subs[i](...args);\n }\n }\n\n this.emitAllEvent(eventName, args);\n this.tryBubbleEvent(eventName, args);\n }\n\n /* @internal **/\n emitBaseBubblingEvent(eventName: K): void {\n const event = new EventEmitter.BubblingEvent(eventName, this);\n this.emitUnknown(eventName, event);\n }\n\n /** @internal */\n emitUnknownBubblingEvent(eventName: string): void {\n const event = new EventEmitter.BubblingEvent(eventName, this);\n this.emitUnknown(eventName, event);\n }\n\n /**\n * Removes a listener for an event.\n * @param eventName - The name of the event\n * @param callback - The previously registered callback method (optional)\n */\n removeEventListener(eventName: K, callback: EventEmitter.Callback): void {\n const unknownCallback = callback as EventEmitter.UnknownCallback;\n this.removeUnknownEventListener(eventName, unknownCallback);\n }\n\n off(eventName: K, callback: EventEmitter.Callback): void {\n this.removeEventListener(eventName, callback);\n }\n\n /**\n * Alias for off\n */\n unbind = this.removeEventListener;\n\n /**\n * Alias for emit\n */\n trigger = this.emit;\n\n /**\n * Listen for events\n *\n * @param eventName - The name of the event to listen to\n * @param callback - The callback to execute when the event occurs\n */\n addEventListener(eventName: K, callback: EventEmitter.Callback): void {\n const unknownCallback = callback as EventEmitter.UnknownCallback;\n this.addUnknownEventListener(eventName, unknownCallback);\n }\n\n on(eventName: K, callback: EventEmitter.Callback): void {\n this.addEventListener(eventName, callback);\n }\n\n /** @internal */\n private addUnknownEventListener(eventName: string, callback: EventEmitter.UnknownCallback): void {\n if (eventName === EventEmitter.ALL_EVENT) {\n this._allEventSubscriptions.push(callback);\n } else {\n let subscriptions = this._subscriptionsMap.get(eventName);\n if (subscriptions !== undefined) {\n subscriptions.push(callback);\n } else {\n subscriptions = [callback];\n this._subscriptionsMap.set(eventName, subscriptions);\n }\n }\n }\n\n /** @internal */\n private removeUnknownEventListener(eventName: string, callback: EventEmitter.UnknownCallback): void {\n if (eventName === EventEmitter.ALL_EVENT) {\n this.removeSubscription(eventName, this._allEventSubscriptions, callback);\n } else {\n const subscriptions = this._subscriptionsMap.get(eventName);\n if (subscriptions === undefined) {\n throw new Error('No subscribtions to unsubscribe for event ' + eventName);\n } else {\n this.removeSubscription(eventName, subscriptions, callback);\n }\n }\n }\n\n /** @internal */\n private removeSubscription(eventName: string, subscriptions: EventEmitter.UnknownCallback[], callback: EventEmitter.UnknownCallback) {\n const idx = subscriptions.indexOf(callback);\n if (idx < 0) {\n throw new Error('Nothing to unbind for ' + eventName);\n } else {\n subscriptions.splice(idx, 1);\n }\n }\n\n /** @internal */\n private emitAllEvent(eventName: string, args: unknown[]) {\n const allEventSubscriptionsCount = this._allEventSubscriptions.length;\n if (allEventSubscriptionsCount > 0) {\n const unknownArgs = args.slice() as EventEmitter.UnknownParams;\n unknownArgs.unshift(eventName);\n\n const allEventSubcriptions = this._allEventSubscriptions.slice();\n\n for (let i = 0; i < allEventSubscriptionsCount; i++) {\n allEventSubcriptions[i](...unknownArgs);\n }\n }\n }\n}\n\n/** @public */\nexport namespace EventEmitter {\n /**\n * The name of the event that's triggered for every event\n */\n export const ALL_EVENT = '__all';\n\n export const headerClickEventName = 'stackHeaderClick';\n export const headerTouchStartEventName = 'stackHeaderTouchStart';\n\n /** @internal */\n export type UnknownCallback = (this: void, ...args: UnknownParams) => void;\n export type Callback = (this: void, ...args: EventParamsMap[K]) => void;\n\n export interface EventParamsMap {\n \"__all\": UnknownParams;\n \"activeContentItemChanged\": ComponentItemParam;\n \"close\": NoParams;\n \"closed\": NoParams;\n \"destroy\": NoParams;\n \"drag\": DragParams;\n \"dragStart\": DragStartParams;\n \"dragStop\": DragStopParams;\n \"hide\": NoParams;\n \"initialised\": NoParams;\n \"itemDropped\": ComponentItemParam;\n \"maximised\": NoParams;\n \"minimised\": NoParams;\n \"open\": NoParams;\n \"popIn\": NoParams;\n \"resize\": NoParams;\n \"show\": NoParams;\n /** @deprecated - use show instead */\n \"shown\": NoParams;\n \"stateChanged\": NoParams;\n \"tab\": TabParam;\n \"tabCreated\": TabParam;\n \"titleChanged\": StringParam;\n \"windowClosed\": PopoutParam;\n \"windowOpened\": PopoutParam;\n \"beforeComponentRelease\": BeforeComponentReleaseParams;\n \"beforeItemDestroyed\": BubblingEventParam;\n \"itemCreated\": BubblingEventParam;\n \"itemDestroyed\": BubblingEventParam;\n \"focus\": BubblingEventParam;\n \"blur\": BubblingEventParam;\n \"stackHeaderClick\": ClickBubblingEventParam;\n \"stackHeaderTouchStart\": TouchStartBubblingEventParam;\n \"userBroadcast\": UnknownParams;\n }\n\n export type UnknownParams = unknown[];\n export type NoParams = [];\n export type UnknownParam = [unknown];\n export type PopoutParam = [BrowserPopout];\n export type ComponentItemParam = [ComponentItem];\n export type TabParam = [Tab];\n export type BubblingEventParam = [EventEmitter.BubblingEvent]\n export type StringParam = [string];\n export type DragStartParams = [originalX: number, originalY: number];\n export type DragStopParams = [event: PointerEvent | undefined];\n export type DragParams = [offsetX: number, offsetY: number, event: PointerEvent];\n export type BeforeComponentReleaseParams = [component: unknown];\n export type ClickBubblingEventParam = [ClickBubblingEvent];\n export type TouchStartBubblingEventParam = [TouchStartBubblingEvent];\n\n export class BubblingEvent {\n /** @internal */\n private _isPropagationStopped = false;\n\n get name(): string { return this._name; }\n get target(): EventEmitter { return this._target; }\n /** @deprecated Use {@link (EventEmitter:namespace).(BubblingEvent:class).target} instead */\n get origin(): EventEmitter { return this._target; }\n get isPropagationStopped(): boolean { return this._isPropagationStopped; }\n\n /** @internal */\n constructor(\n /** @internal */\n private readonly _name: string,\n /** @internal */\n private readonly _target: EventEmitter) {\n }\n\n stopPropagation(): void {\n this._isPropagationStopped = true;\n }\n }\n\n export class ClickBubblingEvent extends BubblingEvent {\n get mouseEvent(): MouseEvent { return this._mouseEvent; }\n\n /** @internal */\n constructor(name: string, target: EventEmitter,\n /** @internal */\n private readonly _mouseEvent: MouseEvent\n ) {\n super(name, target);\n }\n }\n\n export class TouchStartBubblingEvent extends BubblingEvent {\n get touchEvent(): TouchEvent { return this._touchEvent; }\n\n /** @internal */\n constructor(name: string, target: EventEmitter,\n /** @internal */\n private readonly _touchEvent: TouchEvent\n ) {\n super(name, target);\n }\n }\n}\n","import { ResolvedLayoutConfig, ResolvedPopoutLayoutConfig } from '../config/resolved-config';\nimport { PopoutBlockedError } from '../errors/external-error';\nimport { UnexpectedNullError, UnexpectedUndefinedError } from '../errors/internal-error';\nimport { ContentItem } from '../items/content-item';\nimport { LayoutManager } from '../layout-manager';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { Rect } from '../utils/types';\nimport { deepExtend, getErrorMessage, getUniqueId } from '../utils/utils';\n\n/**\n * Pops a content item out into a new browser window.\n * This is achieved by\n *\n * - Creating a new configuration with the content item as root element\n * - Serializing and minifying the configuration\n * - Opening the current window's URL with the configuration as a GET parameter\n * - GoldenLayout when opened in the new window will look for the GET parameter\n * and use it instead of the provided configuration\n * @public\n */\n\nexport class BrowserPopout extends EventEmitter {\n /** @internal */\n private _popoutWindow: Window | null;\n /** @internal */\n private _isInitialised;\n /** @internal */\n private _checkReadyInterval: ReturnType | undefined;\n\n /**\n * @param _config - GoldenLayout item config\n * @param _initialWindowSize - A map with width, height, top and left\n * @internal\n */\n constructor(\n /** @internal */\n private _config: ResolvedPopoutLayoutConfig,\n /** @internal */\n private _initialWindowSize: Rect,\n /** @internal */\n private _layoutManager: LayoutManager,\n ) {\n super();\n\n this._isInitialised = false;\n this._popoutWindow = null;\n this.createWindow();\n }\n\n toConfig(): ResolvedPopoutLayoutConfig {\n if (this._isInitialised === false) {\n throw new Error('Can\\'t create config, layout not yet initialised');\n }\n\n const glInstance = this.getGlInstance();\n const glInstanceConfig = glInstance.saveLayout();\n\n let left: number | null;\n let top: number | null;\n if (this._popoutWindow === null) {\n left = null;\n top = null;\n } else {\n left = this._popoutWindow.screenX ?? this._popoutWindow.screenLeft;\n top = this._popoutWindow.screenY ?? this._popoutWindow.screenTop;\n }\n\n const window: ResolvedPopoutLayoutConfig.Window = {\n width: this.getGlInstance().width,\n height: this.getGlInstance().height,\n left,\n top,\n };\n\n const config: ResolvedPopoutLayoutConfig = {\n root: glInstanceConfig.root,\n openPopouts: glInstanceConfig.openPopouts,\n settings: glInstanceConfig.settings,\n dimensions: glInstanceConfig.dimensions,\n header: glInstanceConfig.header,\n window,\n parentId: this._config.parentId,\n indexInParent: this._config.indexInParent,\n resolved: true,\n };\n\n return config;\n }\n\n getGlInstance(): LayoutManager {\n if (this._popoutWindow === null) {\n throw new UnexpectedNullError('BPGGI24693');\n }\n return this._popoutWindow.__glInstance;\n }\n\n /**\n * Retrieves the native BrowserWindow backing this popout.\n * Might throw an UnexpectedNullError exception when the window is not initialized yet.\n * @public\n */\n getWindow(): Window {\n if (this._popoutWindow === null) {\n throw new UnexpectedNullError('BPGW087215');\n }\n return this._popoutWindow;\n }\n\n close(): void {\n if (this.getGlInstance()) {\n this.getGlInstance().closeWindow();\n } else {\n try {\n this.getWindow().close();\n } catch (e) {\n //\n }\n }\n }\n\n /**\n * Returns the popped out item to its original position. If the original\n * parent isn't available anymore it falls back to the layout's topmost element\n */\n popIn(): void {\n let parentItem: ContentItem;\n let index = this._config.indexInParent;\n\n if (!this._config.parentId) {\n return;\n }\n\n /*\n * The deepExtend call seems a bit pointless, but it's crucial to\n * copy the config returned by this.getGlInstance().toConfig()\n * onto a new object. Internet Explorer keeps the references\n * to objects on the child window, resulting in the following error\n * once the child window is closed:\n *\n * The callee (server [not server application]) is not available and disappeared\n */\n const glInstanceLayoutConfig = this.getGlInstance().saveLayout();\n const copiedGlInstanceLayoutConfig = deepExtend({}, glInstanceLayoutConfig) as ResolvedLayoutConfig;\n const copiedRoot = copiedGlInstanceLayoutConfig.root;\n if (copiedRoot === undefined) {\n throw new UnexpectedUndefinedError('BPPIR19998');\n }\n const groundItem = this._layoutManager.groundItem;\n if (groundItem === undefined) {\n throw new UnexpectedUndefinedError('BPPIG34972');\n }\n parentItem = groundItem.getItemsByPopInParentId(this._config.parentId)[0];\n\n /*\n * Fallback if parentItem is not available. Either add it to the topmost\n * item or make it the topmost item if the layout is empty\n */\n if (!parentItem) {\n if (groundItem.contentItems.length > 0) {\n parentItem = groundItem.contentItems[0];\n } else {\n parentItem = groundItem;\n }\n index = 0;\n }\n\n const newContentItem = this._layoutManager.createAndInitContentItem(copiedRoot, parentItem);\n\n parentItem.addChild(newContentItem, index);\n if (this._layoutManager.layoutConfig.settings.popInOnClose) {\n this._onClose();\n } else {\n this.close();\n }\n }\n\n /**\n * Creates the URL and window parameter\n * and opens a new window\n * @internal\n */\n private createWindow(): void {\n const url = this.createUrl();\n\n /**\n * Bogus title to prevent re-usage of existing window with the\n * same title. The actual title will be set by the new window's\n * GoldenLayout instance if it detects that it is in subWindowMode\n */\n const target = Math.floor(Math.random() * 1000000).toString(36);\n\n /**\n * The options as used in the window.open string\n */\n const features = this.serializeWindowFeatures({\n width: this._initialWindowSize.width,\n height: this._initialWindowSize.height,\n innerWidth: this._initialWindowSize.width,\n innerHeight: this._initialWindowSize.height,\n menubar: 'no',\n toolbar: 'no',\n location: 'no',\n personalbar: 'no',\n resizable: 'yes',\n scrollbars: 'no',\n status: 'no'\n });\n\n this._popoutWindow = globalThis.open(url, target, features);\n\n if (!this._popoutWindow) {\n if (this._layoutManager.layoutConfig.settings.blockedPopoutsThrowError === true) {\n const error = new PopoutBlockedError('Popout blocked');\n throw error;\n } else {\n return;\n }\n }\n\n this._popoutWindow.addEventListener('load', () => this.positionWindow(), { passive: true })\n this._popoutWindow.addEventListener('beforeunload', () => {\n if (this._layoutManager.layoutConfig.settings.popInOnClose) {\n this.popIn();\n } else {\n this._onClose();\n }\n }, { passive: true })\n\n /**\n * Polling the childwindow to find out if GoldenLayout has been initialised\n * doesn't seem optimal, but the alternatives - adding a callback to the parent\n * window or raising an event on the window object - both would introduce knowledge\n * about the parent to the child window which we'd rather avoid\n */\n this._checkReadyInterval = setInterval(() => this.checkReady(), 10);\n }\n\n /** @internal */\n private checkReady() {\n if (this._popoutWindow === null) {\n throw new UnexpectedNullError('BPCR01844');\n } else {\n if (this._popoutWindow.__glInstance && this._popoutWindow.__glInstance.isInitialised) {\n this.onInitialised();\n if (this._checkReadyInterval !== undefined) {\n clearInterval(this._checkReadyInterval);\n this._checkReadyInterval = undefined;\n }\n }\n }\n }\n\n /**\n * Serialises a map of key:values to a window options string\n *\n * @param windowOptions -\n *\n * @returns serialised window options\n * @internal\n */\n private serializeWindowFeatures(windowOptions: Record): string {\n const windowOptionsString: string[] = [];\n\n for (const key in windowOptions) {\n windowOptionsString.push(key + '=' + windowOptions[key].toString());\n }\n\n return windowOptionsString.join(',');\n }\n\n /**\n * Creates the URL for the new window, including the\n * config GET parameter\n *\n * @returns URL\n * @internal\n */\n private createUrl(): string {\n const storageKey = 'gl-window-config-' + getUniqueId();\n const config = ResolvedLayoutConfig.minifyConfig(this._config);\n\n try {\n localStorage.setItem(storageKey, JSON.stringify(config));\n } catch (e) {\n throw new Error('Error while writing to localStorage ' + getErrorMessage(e));\n }\n\n const url = new URL(location.href);\n url.searchParams.set('gl-window', storageKey);\n return url.toString();\n }\n\n /**\n * Move the newly created window roughly to\n * where the component used to be.\n * @internal\n */\n private positionWindow() {\n if (this._popoutWindow === null) {\n throw new Error('BrowserPopout.positionWindow: null popoutWindow');\n } else {\n this._popoutWindow.moveTo(this._initialWindowSize.left, this._initialWindowSize.top);\n this._popoutWindow.focus();\n }\n }\n\n /**\n * Callback when the new window is opened and the GoldenLayout instance\n * within it is initialised\n * @internal\n */\n private onInitialised(): void {\n this._isInitialised = true;\n this.getGlInstance().on('popIn', () => this.popIn());\n this.emit('initialised');\n }\n\n /**\n * Invoked 50ms after the window unload event\n * @internal\n */\n private _onClose() {\n setTimeout(() => this.emit('closed'), 50);\n }\n}\n","import { Header } from './header';\n\n/** @internal */\nexport class HeaderButton {\n private _element: HTMLElement;\n private _clickEventListener = (ev: MouseEvent) => this.onClick(ev);\n private _touchStartEventListener = (ev: TouchEvent) => this.onTouchStart(ev);\n\n get element(): HTMLElement { return this._element; }\n\n constructor(private _header: Header, label: string, cssClass: string, private _pushEvent: HeaderButton.PushEvent) {\n this._element = document.createElement('div');\n this._element.classList.add(cssClass);\n this._element.title = label;\n this._header.on('destroy', () => this.destroy());\n this._element.addEventListener('click', this._clickEventListener, { passive: true });\n this._element.addEventListener('touchstart', this._touchStartEventListener, { passive: true });\n this._header.controlsContainerElement.appendChild(this._element);\n }\n\n destroy(): void {\n this._element.removeEventListener('click', this._clickEventListener);\n this._element.removeEventListener('touchstart', this._touchStartEventListener);\n this._element.parentNode?.removeChild(this._element);\n }\n\n private onClick(ev: MouseEvent) {\n this._pushEvent(ev);\n }\n\n private onTouchStart(ev: TouchEvent) {\n this._pushEvent(ev);\n }\n}\n\n/** @internal */\nexport namespace HeaderButton {\n export type PushEvent = (this: void, ev: Event) => void;\n}\n","import { DomConstants } from './dom-constants';\nimport { EventEmitter } from './event-emitter';\n\n/** @internal */\nexport class DragListener extends EventEmitter {\n private _timeout: ReturnType | undefined;\n private _allowableTargets: HTMLElement[];\n private _oDocument: Document;\n private _eBody: HTMLElement;\n private _nDelay: number;\n private _nDistance: number;\n private _nX: number;\n private _nY: number;\n private _nOriginalX: number;\n private _nOriginalY: number;\n private _dragging: boolean;\n private _pointerTracking = false;\n\n private _pointerDownEventListener = (ev: PointerEvent) => this.onPointerDown(ev);\n private _pointerMoveEventListener = (ev: PointerEvent) => this.onPointerMove(ev);\n private _pointerUpEventListener = (ev: PointerEvent) => this.onPointerUp(ev);\n\n constructor(private _eElement: HTMLElement, extraAllowableChildTargets: HTMLElement[]) {\n super();\n\n this._timeout = undefined;\n\n this._allowableTargets = [_eElement, ...extraAllowableChildTargets];\n this._oDocument = document;\n this._eBody = document.body;\n\n /**\n * The delay after which to start the drag in milliseconds\n * Do NOT make too short (previous value of 200 was not long enough for my touchpad)\n * Should generally rely on the mouse move to start drag. Not this delay.\n */\n this._nDelay = 1800;\n\n /**\n * The distance the mouse needs to be moved to qualify as a drag\n * Previous comment: works better with delay only\n * ???\n * Probably somehow needs tuning for different devices\n */\n this._nDistance = 10;\n\n this._nX = 0;\n this._nY = 0;\n\n this._nOriginalX = 0;\n this._nOriginalY = 0;\n\n this._dragging = false;\n\n this._eElement.addEventListener('pointerdown', this._pointerDownEventListener, { passive: true });\n }\n\n destroy(): void {\n this.checkRemovePointerTrackingEventListeners();\n\n this._eElement.removeEventListener('pointerdown', this._pointerDownEventListener);\n }\n\n cancelDrag(): void {\n this.processDragStop(undefined);\n }\n\n private onPointerDown(oEvent: PointerEvent) {\n if (this._allowableTargets.includes(oEvent.target as HTMLElement) && oEvent.isPrimary) {\n const coordinates = this.getPointerCoordinates(oEvent);\n this.processPointerDown(coordinates);\n }\n }\n\n private processPointerDown(coordinates: DragListener.PointerCoordinates) {\n this._nOriginalX = coordinates.x;\n this._nOriginalY = coordinates.y;\n\n this._oDocument.addEventListener('pointermove', this._pointerMoveEventListener);\n this._oDocument.addEventListener('pointerup', this._pointerUpEventListener, { passive: true });\n this._pointerTracking = true;\n\n this._timeout = setTimeout(\n () => {\n try {\n this.startDrag()\n }\n catch (err) {\n console.error(err);\n throw err;\n }\n }\n , this._nDelay);\n }\n\n private onPointerMove(oEvent: PointerEvent) {\n if (this._pointerTracking) {\n this.processDragMove(oEvent);\n oEvent.preventDefault();\n }\n }\n\n private processDragMove(dragEvent: PointerEvent) {\n this._nX = dragEvent.pageX - this._nOriginalX;\n this._nY = dragEvent.pageY - this._nOriginalY;\n\n if (this._dragging === false) {\n if (\n Math.abs(this._nX) > this._nDistance ||\n Math.abs(this._nY) > this._nDistance\n ) {\n this.startDrag();\n }\n }\n\n if (this._dragging) {\n this.emit('drag', this._nX, this._nY, dragEvent);\n }\n }\n\n private onPointerUp(oEvent: PointerEvent) {\n this.processDragStop(oEvent);\n }\n\n private processDragStop(dragEvent?: PointerEvent) {\n if (this._timeout !== undefined) {\n clearTimeout(this._timeout);\n this._timeout = undefined;\n }\n\n this.checkRemovePointerTrackingEventListeners();\n \n if (this._dragging === true) {\n this._eBody.classList.remove(DomConstants.ClassName.Dragging);\n this._eElement.classList.remove(DomConstants.ClassName.Dragging);\n this._oDocument.querySelector('iframe')?.style.setProperty('pointer-events', '');\n this._dragging = false;\n this.emit('dragStop', dragEvent);\n }\n }\n\n private checkRemovePointerTrackingEventListeners(): void {\n if (this._pointerTracking) {\n this._oDocument.removeEventListener('pointermove', this._pointerMoveEventListener);\n this._oDocument.removeEventListener('pointerup', this._pointerUpEventListener);\n this._pointerTracking = false;\n } \n }\n\n private startDrag() {\n if (this._timeout !== undefined) {\n clearTimeout(this._timeout);\n this._timeout = undefined;\n }\n this._dragging = true;\n this._eBody.classList.add(DomConstants.ClassName.Dragging);\n this._eElement.classList.add(DomConstants.ClassName.Dragging);\n this._oDocument.querySelector('iframe')?.style.setProperty('pointer-events', 'none');\n this.emit('dragStart', this._nOriginalX, this._nOriginalY);\n }\n\n private getPointerCoordinates(event: PointerEvent) {\n const result: DragListener.PointerCoordinates = {\n x: event.pageX,\n y: event.pageY\n };\n return result;\n }\n\n}\n\n/** @internal */\nexport namespace DragListener {\n export interface PointerCoordinates {\n x: number,\n y: number,\n }\n}","import { UnexpectedUndefinedError } from '../errors/internal-error';\nimport { ComponentItem } from '../items/component-item';\nimport { LayoutManager } from '../layout-manager';\nimport { DomConstants } from '../utils/dom-constants';\nimport { DragListener } from '../utils/drag-listener';\n\n/**\n * Represents an individual tab within a Stack's header\n * @public\n */\nexport class Tab {\n /** @internal */\n private readonly _element: HTMLDivElement;\n /** @internal */\n private readonly _titleElement: HTMLSpanElement;\n /** @internal */\n private readonly _closeElement: HTMLDivElement | undefined;\n\n /** @internal */\n private _dragListener: DragListener | undefined;\n /** @internal */\n private _isActive = false;\n\n /** @internal */\n private readonly _tabClickListener = (ev: MouseEvent) => this.onTabClickDown(ev);\n /** @internal */\n private readonly _tabTouchStartListener = (ev: TouchEvent) => this.onTabTouchStart(ev);\n /** @internal */\n private readonly _closeClickListener = () => this.onCloseClick();\n /** @internal */\n private readonly _closeTouchStartListener = () => this.onCloseTouchStart();\n // /** @internal */\n // private readonly _closeMouseDownListener = () => this.onCloseMousedown();\n /** @internal */\n private readonly _dragStartListener = (x: number, y: number) => this.onDragStart(x, y);\n /** @internal */\n private readonly _contentItemDestroyListener = () => this.onContentItemDestroy();\n /** @internal */\n private readonly _tabTitleChangedListener = (title: string) => this.setTitle(title)\n\n get isActive(): boolean { return this._isActive; }\n // get header(): Header { return this._header; }\n get componentItem(): ComponentItem { return this._componentItem; }\n /** @deprecated use {@link (Tab:class).componentItem} */\n get contentItem(): ComponentItem { return this._componentItem; }\n get element(): HTMLElement { return this._element; }\n get titleElement(): HTMLElement { return this._titleElement; }\n get closeElement(): HTMLElement | undefined { return this._closeElement; }\n get reorderEnabled(): boolean { return this._dragListener !== undefined; }\n set reorderEnabled(value: boolean) {\n if (value !== this.reorderEnabled) {\n if (value) {\n this.enableReorder();\n } else {\n this.disableReorder();\n }\n }\n }\n\n /** @internal */\n constructor(\n /** @internal */\n private readonly _layoutManager: LayoutManager,\n /** @internal */\n private _componentItem: ComponentItem,\n /** @internal */\n private _closeEvent: Tab.CloseEvent | undefined,\n /** @internal */\n private _focusEvent: Tab.FocusEvent | undefined,\n /** @internal */\n private _dragStartEvent: Tab.DragStartEvent | undefined\n ) {\n this._element = document.createElement('div');\n this._element.classList.add(DomConstants.ClassName.Tab);\n this._titleElement = document.createElement('span'); \n this._titleElement.classList.add(DomConstants.ClassName.Title);\n this._closeElement = document.createElement('div'); \n this._closeElement.classList.add(DomConstants.ClassName.CloseTab);\n this._element.appendChild(this._titleElement);\n this._element.appendChild(this._closeElement);\n\n if (_componentItem.isClosable) {\n this._closeElement.style.display = '';\n } else {\n this._closeElement.style.display = 'none';\n }\n\n this.setTitle(_componentItem.title);\n this._componentItem.on('titleChanged', this._tabTitleChangedListener);\n\n const reorderEnabled = _componentItem.reorderEnabled ?? this._layoutManager.layoutConfig.settings.reorderEnabled;\n\n if (reorderEnabled) {\n this.enableReorder();\n }\n\n this._element.addEventListener('click', this._tabClickListener, { passive: true });\n this._element.addEventListener('touchstart', this._tabTouchStartListener, { passive: true });\n\n if (this._componentItem.isClosable) {\n this._closeElement.addEventListener('click', this._closeClickListener, { passive: true });\n this._closeElement.addEventListener('touchstart', this._closeTouchStartListener, { passive: true });\n // this._closeElement.addEventListener('mousedown', this._closeMouseDownListener, { passive: true });\n } else {\n this._closeElement.remove();\n this._closeElement = undefined;\n }\n\n this._componentItem.setTab(this);\n this._layoutManager.emit('tabCreated', this);\n }\n\n /**\n * Sets the tab's title to the provided string and sets\n * its title attribute to a pure text representation (without\n * html tags) of the same string.\n */\n setTitle(title: string): void {\n this._titleElement.innerText = title;\n this._element.title = title;\n }\n\n /**\n * Sets this tab's active state. To programmatically\n * switch tabs, use Stack.setActiveComponentItem( item ) instead.\n */\n setActive(isActive: boolean): void {\n if (isActive === this._isActive) {\n return;\n }\n this._isActive = isActive;\n\n if (isActive) {\n this._element.classList.add(DomConstants.ClassName.Active);\n } else {\n this._element.classList.remove(DomConstants.ClassName.Active);\n }\n }\n\n /**\n * Destroys the tab\n * @internal\n */\n destroy(): void {\n this._closeEvent = undefined;\n this._focusEvent = undefined;\n this._dragStartEvent = undefined;\n this._element.removeEventListener('click', this._tabClickListener);\n this._element.removeEventListener('touchstart', this._tabTouchStartListener);\n this._closeElement?.removeEventListener('click', this._closeClickListener);\n this._closeElement?.removeEventListener('touchstart', this._closeTouchStartListener);\n // this._closeElement?.removeEventListener('mousedown', this._closeMouseDownListener);\n this._componentItem.off('titleChanged', this._tabTitleChangedListener);\n if (this.reorderEnabled) {\n this.disableReorder();\n }\n this._element.remove();\n }\n\n /** @internal */\n setBlurred(): void {\n this._element.classList.remove(DomConstants.ClassName.Focused);\n this._titleElement.classList.remove(DomConstants.ClassName.Focused);\n }\n\n /** @internal */\n setFocused(): void {\n this._element.classList.add(DomConstants.ClassName.Focused);\n this._titleElement.classList.add(DomConstants.ClassName.Focused);\n }\n\n /**\n * Callback for the DragListener\n * @param x - The tabs absolute x position\n * @param y - The tabs absolute y position\n * @internal\n */\n private onDragStart(x: number, y: number): void {\n if (this._dragListener === undefined) {\n throw new UnexpectedUndefinedError('TODSDLU10093');\n } else {\n if (this._dragStartEvent === undefined) {\n throw new UnexpectedUndefinedError('TODS23309');\n } else {\n this._dragStartEvent(x, y, this._dragListener, this.componentItem);\n }\n }\n\n }\n\n /** @internal */\n private onContentItemDestroy() {\n if (this._dragListener !== undefined) {\n this._dragListener.destroy();\n this._dragListener = undefined;\n }\n }\n\n /**\n * Callback when the tab is clicked\n * @internal\n */\n private onTabClickDown(event: MouseEvent) {\n const target = event.target;\n if (target === this._element || target === this._titleElement) {\n // left mouse button\n if (event.button === 0) {\n // event.stopPropagation();\n this.notifyFocus();\n\n // middle mouse button\n } else if (event.button === 1 && this._componentItem.isClosable) {\n // event.stopPropagation();\n this.notifyClose();\n }\n }\n }\n\n /** @internal */\n private onTabTouchStart(event: TouchEvent) {\n if (event.target === this._element) {\n this.notifyFocus();\n }\n }\n\n /**\n * Callback when the tab's close button is clicked\n * @internal\n */\n private onCloseClick() {\n this.notifyClose();\n }\n\n /** @internal */\n private onCloseTouchStart() {\n this.notifyClose();\n }\n\n /**\n * Callback to capture tab close button mousedown\n * to prevent tab from activating.\n * @internal\n */\n // private onCloseMousedown(): void {\n // // event.stopPropagation();\n // }\n\n /** @internal */\n private notifyClose() {\n if (this._closeEvent === undefined) {\n throw new UnexpectedUndefinedError('TNC15007');\n } else {\n this._closeEvent(this._componentItem);\n }\n }\n\n /** @internal */\n private notifyFocus() {\n if (this._focusEvent === undefined) {\n throw new UnexpectedUndefinedError('TNA15007');\n } else {\n this._focusEvent(this._componentItem);\n }\n }\n\n /** @internal */\n private enableReorder() {\n this._dragListener = new DragListener(this._element, [this._titleElement]);\n this._dragListener.on('dragStart', this._dragStartListener);\n this._componentItem.on('destroy', this._contentItemDestroyListener);\n }\n\n /** @internal */\n private disableReorder() {\n if (this._dragListener === undefined) {\n throw new UnexpectedUndefinedError('TDR87745');\n } else {\n this._componentItem.off('destroy', this._contentItemDestroyListener);\n this._dragListener.off('dragStart', this._dragStartListener);\n this._dragListener = undefined;\n }\n }\n}\n\n/** @public */\nexport namespace Tab {\n /** @internal */\n export type CloseEvent = (componentItem: ComponentItem) => void;\n /** @internal */\n export type FocusEvent = (componentItem: ComponentItem) => void;\n /** @internal */\n export type DragStartEvent = (x: number, y: number, dragListener: DragListener, componentItem: ComponentItem) => void;\n}\n","import { AssertError } from '../errors/internal-error';\nimport { ComponentItem } from '../items/component-item';\nimport { LayoutManager } from '../layout-manager';\nimport { DomConstants } from '../utils/dom-constants';\nimport { DragListener } from '../utils/drag-listener';\nimport { numberToPixels, pixelsToNumber } from '../utils/utils';\nimport { Tab } from './tab';\n\n/** @internal */\nexport class TabsContainer {\n // There is one tab per ComponentItem in stack. However they may not be ordered the same\n private readonly _tabs: Tab[] = [];\n\n private readonly _dropdownElement: HTMLElement;\n private readonly _element: HTMLElement;\n private _lastVisibleTabIndex = -1;\n private _dropdownActive = false;\n\n get tabs(): Tab[] { return this._tabs; }\n get tabCount(): number { return this._tabs.length; }\n get lastVisibleTabIndex(): number { return this._lastVisibleTabIndex; }\n\n get element(): HTMLElement { return this._element; }\n get dropdownElement(): HTMLElement { return this._dropdownElement; }\n get dropdownActive(): boolean { return this._dropdownActive; }\n\n constructor(private _layoutManager: LayoutManager,\n private _componentRemoveEvent: TabsContainer.ComponentItemRemoveEvent,\n private _componentFocusEvent: TabsContainer.ComponentItemFocusEvent,\n private _componentDragStartEvent: TabsContainer.ComponentItemDragStartEvent,\n private _dropdownActiveChangedEvent: TabsContainer.DropdownActiveChangedEvent,\n ) {\n this._element = document.createElement('section');\n this._element.classList.add(DomConstants.ClassName.Tabs);\n\n this._dropdownElement = document.createElement('section');\n this._dropdownElement.classList.add(DomConstants.ClassName.TabDropdownList);\n this._dropdownElement.style.display = 'none';\n }\n\n destroy(): void {\n for (let i = 0; i < this._tabs.length; i++) {\n this._tabs[i].destroy();\n }\n }\n\n /**\n * Creates a new tab and associates it with a contentItem\n * @param index - The position of the tab\n */\n createTab(componentItem: ComponentItem, index: number): void {\n //If there's already a tab relating to the\n //content item, don't do anything\n for (let i = 0; i < this._tabs.length; i++) {\n if (this._tabs[i].componentItem === componentItem) {\n return;\n }\n }\n\n const tab = new Tab(this._layoutManager,\n componentItem,\n (item) => this.handleTabCloseEvent(item),\n (item) => this.handleTabFocusEvent(item),\n (x, y, dragListener, item) => this.handleTabDragStartEvent(x, y, dragListener, item));\n\n if (index === undefined) {\n index = this._tabs.length;\n }\n\n this._tabs.splice(index, 0, tab);\n\n if (index < this._element.childNodes.length) {\n this._element.insertBefore(tab.element, this._element.childNodes[index]);\n } else {\n this._element.appendChild(tab.element);\n }\n }\n\n removeTab(componentItem: ComponentItem): void {\n // componentItem cannot be ActiveComponentItem\n for (let i = 0; i < this._tabs.length; i++) {\n if (this._tabs[i].componentItem === componentItem) {\n const tab = this._tabs[i];\n tab.destroy();\n this._tabs.splice(i, 1);\n return;\n }\n }\n\n throw new Error('contentItem is not controlled by this header');\n }\n\n processActiveComponentChanged(newActiveComponentItem: ComponentItem): void {\n let activeIndex = -1;\n for (let i = 0; i < this._tabs.length; i++) {\n const isActive = this._tabs[i].componentItem === newActiveComponentItem;\n this._tabs[i].setActive(isActive);\n if (isActive) {\n activeIndex = i;\n }\n }\n\n if (activeIndex < 0) {\n throw new AssertError('HSACI56632');\n } else {\n if (this._layoutManager.layoutConfig.settings.reorderOnTabMenuClick) {\n /**\n * If the tab selected was in the dropdown, move everything down one to make way for this one to be the first.\n * This will make sure the most used tabs stay visible.\n */\n if (this._lastVisibleTabIndex !== -1 && activeIndex > this._lastVisibleTabIndex) {\n const activeTab = this._tabs[activeIndex];\n for (let j = activeIndex; j > 0; j--) {\n this._tabs[j] = this._tabs[j - 1];\n }\n this._tabs[0] = activeTab;\n\n // updateTabSizes will always be called after this and it will reposition tab elements\n }\n }\n }\n }\n\n /**\n * Pushes the tabs to the tab dropdown if the available space is not sufficient\n */\n updateTabSizes(availableWidth: number, activeComponentItem: ComponentItem | undefined): void {\n let dropDownActive = false;\n const success = this.tryUpdateTabSizes(dropDownActive, availableWidth, activeComponentItem);\n if (!success) {\n dropDownActive = true;\n // this will always succeed\n this.tryUpdateTabSizes(dropDownActive, availableWidth, activeComponentItem)\n }\n\n if (dropDownActive !== this._dropdownActive) {\n this._dropdownActive = dropDownActive;\n this._dropdownActiveChangedEvent();\n }\n }\n\n tryUpdateTabSizes(dropdownActive: boolean, availableWidth: number, activeComponentItem: ComponentItem | undefined): boolean {\n if (this._tabs.length > 0) {\n if (activeComponentItem === undefined) {\n throw new Error('non-empty tabs must have active component item');\n }\n\n let cumulativeTabWidth = 0;\n let tabOverlapAllowanceExceeded = false;\n const tabOverlapAllowance = this._layoutManager.layoutConfig.settings.tabOverlapAllowance;\n const activeIndex = this._tabs.indexOf(activeComponentItem.tab);\n const activeTab = this._tabs[activeIndex];\n this._lastVisibleTabIndex = -1;\n\n for (let i = 0; i < this._tabs.length; i++) {\n const tabElement = this._tabs[i].element;\n\n //Put the tab in the tabContainer so its true width can be checked\n if (tabElement.parentElement !== this._element) {\n this._element.appendChild(tabElement);\n }\n const tabMarginRightPixels = getComputedStyle(activeTab.element).marginRight;\n const tabMarginRight = pixelsToNumber(tabMarginRightPixels);\n const tabWidth = tabElement.offsetWidth + tabMarginRight;\n\n cumulativeTabWidth += tabWidth;\n\n //Include the active tab's width if it isn't already\n //This is to ensure there is room to show the active tab\n let visibleTabWidth = 0;\n if (activeIndex <= i) {\n visibleTabWidth = cumulativeTabWidth;\n } else {\n const activeTabMarginRightPixels = getComputedStyle(activeTab.element).marginRight;\n const activeTabMarginRight = pixelsToNumber(activeTabMarginRightPixels);\n visibleTabWidth = cumulativeTabWidth + activeTab.element.offsetWidth + activeTabMarginRight;\n }\n\n // If the tabs won't fit, check the overlap allowance.\n if (visibleTabWidth > availableWidth) {\n\n //Once allowance is exceeded, all remaining tabs go to menu.\n if (!tabOverlapAllowanceExceeded) {\n\n //No overlap for first tab or active tab\n //Overlap spreads among non-active, non-first tabs\n let overlap: number;\n if (activeIndex > 0 && activeIndex <= i) {\n overlap = (visibleTabWidth - availableWidth) / (i - 1);\n } else {\n overlap = (visibleTabWidth - availableWidth) / i;\n }\n\n //Check overlap against allowance.\n if (overlap < tabOverlapAllowance) {\n for (let j = 0; j <= i; j++) {\n const marginLeft = (j !== activeIndex && j !== 0) ? '-' + numberToPixels(overlap) : '';\n this._tabs[j].element.style.zIndex = numberToPixels(i - j);\n this._tabs[j].element.style.marginLeft = marginLeft;\n }\n this._lastVisibleTabIndex = i;\n if (tabElement.parentElement !== this._element) {\n this._element.appendChild(tabElement);\n }\n } else {\n tabOverlapAllowanceExceeded = true;\n }\n\n } else if (i === activeIndex) {\n //Active tab should show even if allowance exceeded. (We left room.)\n tabElement.style.zIndex = 'auto';\n tabElement.style.marginLeft = '';\n if (tabElement.parentElement !== this._element) {\n this._element.appendChild(tabElement);\n }\n }\n\n if (tabOverlapAllowanceExceeded && i !== activeIndex) {\n if (dropdownActive) {\n //Tab menu already shown, so we just add to it.\n tabElement.style.zIndex = 'auto';\n tabElement.style.marginLeft = '';\n\n if (tabElement.parentElement !== this._dropdownElement) {\n this._dropdownElement.appendChild(tabElement);\n }\n } else {\n //We now know the tab menu must be shown, so we have to recalculate everything.\n return false;\n }\n }\n\n } else {\n this._lastVisibleTabIndex = i;\n tabElement.style.zIndex = 'auto';\n tabElement.style.marginLeft = '';\n if (tabElement.parentElement !== this._element) {\n this._element.appendChild(tabElement);\n }\n }\n }\n }\n\n return true;\n }\n\n /**\n * Shows drop down for additional tabs when there are too many to display.\n */\n showAdditionalTabsDropdown(): void {\n this._dropdownElement.style.display = '';\n }\n\n /**\n * Hides drop down for additional tabs when there are too many to display.\n */\n hideAdditionalTabsDropdown(): void {\n this._dropdownElement.style.display = 'none';\n }\n\n private handleTabCloseEvent(componentItem: ComponentItem) {\n this._componentRemoveEvent(componentItem);\n }\n\n private handleTabFocusEvent(componentItem: ComponentItem) {\n this._componentFocusEvent(componentItem);\n }\n\n private handleTabDragStartEvent(x: number, y: number, dragListener: DragListener, componentItem: ComponentItem) {\n this._componentDragStartEvent(x, y, dragListener, componentItem);\n }\n\n}\n\n/** @internal */\nexport namespace TabsContainer {\n export type ComponentItemRemoveEvent = (this: void, componentItem: ComponentItem) => void;\n export type ComponentItemFocusEvent = (this: void, componentItem: ComponentItem) => void;\n export type ComponentItemDragStartEvent = (this: void, x: number, y: number, dragListener: DragListener, componentItem: ComponentItem) => void;\n export type DropdownActiveChangedEvent = (this: void) => void;\n}\n","import { UnexpectedUndefinedError } from '../errors/internal-error';\nimport { ComponentItem } from '../items/component-item';\nimport { Stack } from '../items/stack';\nimport { LayoutManager } from '../layout-manager';\nimport { DomConstants } from '../utils/dom-constants';\nimport { DragListener } from '../utils/drag-listener';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { Side } from '../utils/types';\nimport { numberToPixels, setElementDisplayVisibility } from '../utils/utils';\nimport { HeaderButton } from './header-button';\nimport { Tab } from './tab';\nimport { TabsContainer } from './tabs-container';\n\n/**\n * This class represents a header above a Stack ContentItem.\n * @public\n */\nexport class Header extends EventEmitter {\n /** @internal */\n private readonly _tabsContainer: TabsContainer;\n /** @internal */\n private readonly _element: HTMLElement;\n /** @internal */\n private readonly _controlsContainerElement: HTMLElement;\n\n /** @internal */\n private readonly _show: boolean;\n /** @internal */\n private readonly _popoutEnabled: boolean;\n /** @internal */\n private readonly _popoutLabel: string;\n /** @internal */\n private readonly _maximiseEnabled: boolean;\n /** @internal */\n private readonly _maximiseLabel: string;\n /** @internal */\n private readonly _minimiseEnabled: boolean;\n /** @internal */\n private readonly _minimiseLabel: string;\n /** @internal */\n private readonly _closeEnabled: boolean;\n /** @internal */\n private readonly _closeLabel: string;\n /** @internal */\n private readonly _tabDropdownEnabled: boolean;\n /** @internal */\n private readonly _tabDropdownLabel: string;\n\n /** @internal */\n private readonly _tabControlOffset: number;\n\n /** @internal */\n private readonly _clickListener = (ev: MouseEvent) => this.onClick(ev);\n /** @internal */\n private readonly _touchStartListener = (ev: TouchEvent) => this.onTouchStart(ev);\n /** @internal */\n private readonly _documentMouseUpListener: (this: void) => void;\n\n /** @internal */\n private _rowColumnClosable = true;\n /** @internal */\n private _canRemoveComponent: boolean;\n /** @internal */\n private _side: Side;\n /** @internal */\n private _leftRightSided: boolean;\n /** @internal */\n private readonly _closeButton: HeaderButton | null = null;\n /** @internal */\n private readonly _popoutButton: HeaderButton | null = null;\n /** @internal */\n private readonly _tabDropdownButton: HeaderButton;\n /** @internal */\n private readonly _maximiseButton: HeaderButton | undefined;\n // /** @internal */\n // private _activeComponentItem: ComponentItem | null = null; // only used to identify active tab\n\n get show(): boolean { return this._show; }\n get side(): Side { return this._side; }\n get leftRightSided(): boolean { return this._leftRightSided; }\n\n get layoutManager(): LayoutManager { return this._layoutManager; }\n get parent(): Stack { return this._parent; }\n get tabs(): Tab[] { return this._tabsContainer.tabs; }\n get lastVisibleTabIndex(): number { return this._tabsContainer.lastVisibleTabIndex; }\n\n get element(): HTMLElement { return this._element; }\n get tabsContainerElement(): HTMLElement { return this._tabsContainer.element; }\n get controlsContainerElement(): HTMLElement { return this._controlsContainerElement; }\n\n /** @internal */\n constructor(\n /** @internal */\n private _layoutManager: LayoutManager,\n /** @internal */\n private _parent: Stack,\n settings: Header.Settings,\n /** @internal */\n private readonly _configClosable: boolean,\n /** @internal */\n private _getActiveComponentItemEvent: Header.GetActiveComponentItemEvent,\n closeEvent: Header.CloseEvent,\n /** @internal */\n private _popoutEvent: Header.PopoutEvent | undefined,\n /** @internal */\n private _maximiseToggleEvent: Header.MaximiseToggleEvent | undefined,\n /** @internal */\n private _clickEvent: Header.ClickEvent | undefined,\n /** @internal */\n private _touchStartEvent: Header.TouchStartEvent | undefined,\n /** @internal */\n private _componentRemoveEvent: Header.ComponentRemoveEvent | undefined,\n /** @internal */\n private _componentFocusEvent: Header.ComponentFocusEvent | undefined,\n /** @internal */\n private _componentDragStartEvent: Header.ComponentDragStartEvent | undefined,\n ) {\n super();\n\n this._tabsContainer = new TabsContainer(this._layoutManager,\n (item) => this.handleTabInitiatedComponentRemoveEvent(item),\n (item) => this.handleTabInitiatedComponentFocusEvent(item),\n (x, y, dragListener, item) => this.handleTabInitiatedDragStartEvent(x, y, dragListener, item),\n () => this.processTabDropdownActiveChanged(),\n );\n\n this._show = settings.show;\n this._popoutEnabled = settings.popoutEnabled;\n this._popoutLabel = settings.popoutLabel;\n this._maximiseEnabled = settings.maximiseEnabled;\n this._maximiseLabel = settings.maximiseLabel;\n this._minimiseEnabled = settings.minimiseEnabled;\n this._minimiseLabel = settings.minimiseLabel;\n this._closeEnabled = settings.closeEnabled;\n this._closeLabel = settings.closeLabel;\n this._tabDropdownEnabled = settings.tabDropdownEnabled;\n this._tabDropdownLabel = settings.tabDropdownLabel;\n this.setSide(settings.side);\n\n this._canRemoveComponent = this._configClosable;\n\n this._element = document.createElement('section');\n this._element.classList.add(DomConstants.ClassName.Header);\n this._controlsContainerElement = document.createElement('section');\n this._controlsContainerElement.classList.add(DomConstants.ClassName.Controls);\n this._element.appendChild(this._tabsContainer.element);\n this._element.appendChild(this._controlsContainerElement);\n this._element.appendChild(this._tabsContainer.dropdownElement);\n\n this._element.addEventListener('click', this._clickListener, { passive: true });\n this._element.addEventListener('touchstart', this._touchStartListener, { passive: true });\n\n this._documentMouseUpListener = () => this._tabsContainer.hideAdditionalTabsDropdown()\n globalThis.document.addEventListener('mouseup', this._documentMouseUpListener, { passive: true });\n\n this._tabControlOffset = this._layoutManager.layoutConfig.settings.tabControlOffset;\n\n if (this._tabDropdownEnabled) {\n this._tabDropdownButton = new HeaderButton(this, this._tabDropdownLabel, DomConstants.ClassName.TabDropdown,\n () => this._tabsContainer.showAdditionalTabsDropdown()\n );\n }\n\n if (this._popoutEnabled) {\n this._popoutButton = new HeaderButton(this, this._popoutLabel, DomConstants.ClassName.Popout, () => this.handleButtonPopoutEvent());\n }\n\n /**\n * Maximise control - set the component to the full size of the layout\n */\n if (this._maximiseEnabled) {\n this._maximiseButton = new HeaderButton(this, this._maximiseLabel, DomConstants.ClassName.Maximise,\n (ev) => this.handleButtonMaximiseToggleEvent(ev)\n );\n }\n\n /**\n * Close button\n */\n if (this._configClosable) {\n this._closeButton = new HeaderButton(this, this._closeLabel, DomConstants.ClassName.Close, () => closeEvent());\n }\n\n this.processTabDropdownActiveChanged();\n }\n\n /**\n * Destroys the entire header\n * @internal\n */\n destroy(): void {\n this.emit('destroy');\n\n this._popoutEvent = undefined;\n this._maximiseToggleEvent = undefined;\n this._clickEvent = undefined;\n this._touchStartEvent = undefined;\n this._componentRemoveEvent = undefined;\n this._componentFocusEvent = undefined;\n this._componentDragStartEvent = undefined;\n\n this._tabsContainer.destroy();\n\n globalThis.document.removeEventListener('mouseup', this._documentMouseUpListener);\n this._element.remove();\n }\n\n /**\n * Creates a new tab and associates it with a contentItem\n * @param index - The position of the tab\n * @internal\n */\n createTab(componentItem: ComponentItem, index: number): void {\n this._tabsContainer.createTab(componentItem, index);\n }\n\n /**\n * Finds a tab based on the contentItem its associated with and removes it.\n * Cannot remove tab if it has the active ComponentItem\n * @internal\n */\n removeTab(componentItem: ComponentItem): void {\n this._tabsContainer.removeTab(componentItem);\n }\n\n /** @internal */\n processActiveComponentChanged(newActiveComponentItem: ComponentItem): void {\n this._tabsContainer.processActiveComponentChanged(newActiveComponentItem);\n this.updateTabSizes();\n }\n\n /** @internal */\n setSide(value: Side): void {\n this._side = value;\n this._leftRightSided = [Side.right, Side.left].includes(this._side);\n }\n\n /**\n * Programmatically set closability.\n * @param value - Whether to enable/disable closability.\n * @returns Whether the action was successful\n * @internal\n */\n setRowColumnClosable(value: boolean): void {\n this._rowColumnClosable = value;\n this.updateClosability();\n }\n\n /**\n * Updates the header's closability. If a stack/header is able\n * to close, but has a non closable component added to it, the stack is no\n * longer closable until all components are closable.\n * @internal\n */\n updateClosability(): void {\n let isClosable: boolean;\n if (!this._configClosable) {\n isClosable = false;\n } else {\n if (!this._rowColumnClosable) {\n isClosable = false;\n } else {\n isClosable = true;\n const len = this.tabs.length;\n for (let i = 0; i < len; i++) {\n const tab = this._tabsContainer.tabs[i];\n const item = tab.componentItem;\n if (!item.isClosable) {\n isClosable = false;\n break;\n }\n }\n }\n }\n\n if (this._closeButton !== null) {\n setElementDisplayVisibility(this._closeButton.element, isClosable);\n }\n if (this._popoutButton !== null) {\n setElementDisplayVisibility(this._popoutButton.element, isClosable);\n }\n\n this._canRemoveComponent = isClosable || this._tabsContainer.tabCount > 1;\n }\n\n /** @internal */\n applyFocusedValue(value: boolean): void {\n if (value) {\n this._element.classList.add(DomConstants.ClassName.Focused);\n } else {\n this._element.classList.remove(DomConstants.ClassName.Focused);\n }\n }\n\n /** @internal */\n processMaximised(): void {\n if (this._maximiseButton === undefined) {\n throw new UnexpectedUndefinedError('HPMAX16997');\n } else {\n this._maximiseButton.element.setAttribute('title', this._minimiseLabel);\n }\n }\n\n /** @internal */\n processMinimised(): void {\n if (this._maximiseButton === undefined) {\n throw new UnexpectedUndefinedError('HPMIN16997');\n } else {\n this._maximiseButton.element.setAttribute('title', this._maximiseLabel);\n }\n }\n\n /**\n * Pushes the tabs to the tab dropdown if the available space is not sufficient\n * @internal\n */\n updateTabSizes(): void {\n if (this._tabsContainer.tabCount > 0) {\n const headerHeight = this._show ? this._layoutManager.layoutConfig.dimensions.headerHeight : 0;\n\n if (this._leftRightSided) {\n this._element.style.height = '';\n this._element.style.width = numberToPixels(headerHeight);\n } else {\n this._element.style.width = '';\n this._element.style.height = numberToPixels(headerHeight);\n }\n let availableWidth: number;\n if (this._leftRightSided) {\n availableWidth = this._element.offsetHeight - this._controlsContainerElement.offsetHeight - this._tabControlOffset;\n } else {\n availableWidth = this._element.offsetWidth - this._controlsContainerElement.offsetWidth - this._tabControlOffset;\n }\n\n this._tabsContainer.updateTabSizes(availableWidth, this._getActiveComponentItemEvent());\n }\n }\n\n /** @internal */\n private handleTabInitiatedComponentRemoveEvent(componentItem: ComponentItem) {\n if (this._canRemoveComponent) {\n if (this._componentRemoveEvent === undefined) {\n throw new UnexpectedUndefinedError('HHTCE22294');\n } else {\n this._componentRemoveEvent(componentItem);\n }\n }\n }\n\n /** @internal */\n private handleTabInitiatedComponentFocusEvent(componentItem: ComponentItem) {\n if (this._componentFocusEvent === undefined) {\n throw new UnexpectedUndefinedError('HHTAE22294');\n } else {\n this._componentFocusEvent(componentItem);\n }\n }\n\n /** @internal */\n private handleTabInitiatedDragStartEvent(x: number, y: number, dragListener: DragListener, componentItem: ComponentItem) {\n if (!this._canRemoveComponent) {\n dragListener.cancelDrag();\n } else {\n if (this._componentDragStartEvent === undefined) {\n throw new UnexpectedUndefinedError('HHTDSE22294');\n } else {\n this._componentDragStartEvent(x, y, dragListener, componentItem);\n }\n }\n }\n\n /** @internal */\n private processTabDropdownActiveChanged() {\n if (this._tabDropdownButton !== undefined) {\n setElementDisplayVisibility(this._tabDropdownButton.element, this._tabsContainer.dropdownActive);\n }\n }\n\n /** @internal */\n private handleButtonPopoutEvent() {\n if (this._layoutManager.layoutConfig.settings.popoutWholeStack) {\n if (this._popoutEvent === undefined) {\n throw new UnexpectedUndefinedError('HHBPOE17834');\n } else {\n this._popoutEvent();\n }\n } else {\n const activeComponentItem = this._getActiveComponentItemEvent();\n if (activeComponentItem) {\n activeComponentItem.popout();\n }\n // else: if the stack is empty there won't be an active item (and nothing to popout)\n }\n }\n\n /** @internal */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private handleButtonMaximiseToggleEvent(ev: Event) {\n if (this._maximiseToggleEvent === undefined) {\n throw new UnexpectedUndefinedError('HHBMTE16834');\n } else {\n this._maximiseToggleEvent();\n }\n }\n\n /**\n * Invoked when the header's background is clicked (not it's tabs or controls)\n * @internal\n */\n private onClick(event: MouseEvent) {\n if (event.target === this._element) {\n this.notifyClick(event);\n }\n }\n\n /**\n * Invoked when the header's background is touched (not it's tabs or controls)\n * @internal\n */\n private onTouchStart(event: TouchEvent) {\n if (event.target === this._element) {\n this.notifyTouchStart(event);\n }\n }\n\n /** @internal */\n private notifyClick(ev: MouseEvent) {\n if (this._clickEvent === undefined) {\n throw new UnexpectedUndefinedError('HNHC46834');\n } else {\n this._clickEvent(ev);\n }\n }\n\n /** @internal */\n private notifyTouchStart(ev: TouchEvent) {\n if (this._touchStartEvent === undefined) {\n throw new UnexpectedUndefinedError('HNHTS46834');\n } else {\n this._touchStartEvent(ev);\n }\n }\n}\n\n/** @public */\nexport namespace Header {\n /** @internal */\n export type GetActiveComponentItemEvent = (this: void) => ComponentItem | undefined;\n /** @internal */\n export type CloseEvent = (this: void) => void;\n /** @internal */\n export type PopoutEvent = (this: void) => void;\n /** @internal */\n export type MaximiseToggleEvent = (this: void) => void;\n /** @internal */\n export type ClickEvent = (this: void, ev: MouseEvent) => void;\n /** @internal */\n export type TouchStartEvent = (this: void, ev: TouchEvent) => void;\n /** @internal */\n export type ComponentRemoveEvent = (this: void, componentItem: ComponentItem) => void;\n /** @internal */\n export type ComponentFocusEvent = (this: void, componentItem: ComponentItem) => void;\n /** @internal */\n export type ComponentDragStartEvent = (this: void, x: number, y: number, dragListener: DragListener, componentItem: ComponentItem) => void;\n /** @internal */\n export type StateChangedEvent = (this: void) => void;\n\n /** @internal */\n export interface Settings {\n show: boolean;\n side: Side;\n popoutEnabled: boolean;\n popoutLabel: string;\n maximiseEnabled: boolean;\n maximiseLabel: string;\n minimiseEnabled: boolean;\n minimiseLabel: string;\n closeEnabled: boolean;\n closeLabel: string;\n tabDropdownEnabled: boolean;\n tabDropdownLabel: string;\n }\n}\n","import { ComponentItemConfig, ItemConfig } from '../config/config';\nimport { ResolvedComponentItemConfig } from '../config/resolved-config';\nimport { Tab } from '../controls/tab';\nimport { AssertError, UnexpectedNullError } from '../errors/internal-error';\nimport { ComponentItem } from '../items/component-item';\nimport { ContentItem } from '../items/content-item';\nimport { LayoutManager } from '../layout-manager';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { JsonValue, LogicalZIndex, LogicalZIndexToDefaultMap } from '../utils/types';\nimport { deepExtend, setElementHeight, setElementWidth } from '../utils/utils';\n\n/** @public */\nexport class ComponentContainer extends EventEmitter {\n /** @internal */\n private _componentType: JsonValue;\n /** @internal */\n private _boundComponent: ComponentContainer.BindableComponent;\n /** @internal */\n private _width: number;\n /** @internal */\n private _height: number;\n /** @internal */\n private _isClosable;\n /** @internal */\n private _initialState: JsonValue | undefined;\n /** @internal */\n private _state: JsonValue | undefined;\n /** @internal */\n private _visible;\n /** @internal */\n private _isShownWithZeroDimensions;\n /** @internal */\n private _tab: Tab;\n /** @internal */\n private _stackMaximised = false;\n /** @internal */\n private _logicalZIndex: LogicalZIndex;\n\n stateRequestEvent: ComponentContainer.StateRequestEventHandler | undefined;\n virtualRectingRequiredEvent: ComponentContainer.VirtualRectingRequiredEvent | undefined;\n virtualVisibilityChangeRequiredEvent: ComponentContainer.VirtualVisibilityChangeRequiredEvent | undefined;\n virtualZIndexChangeRequiredEvent: ComponentContainer.VirtualZIndexChangeRequiredEvent | undefined;\n\n get width(): number { return this._width; }\n get height(): number { return this._height; }\n get parent(): ComponentItem { return this._parent; }\n /** @internal @deprecated use {@link (ComponentContainer:class).componentType} */\n get componentName(): JsonValue { return this._componentType; }\n get componentType(): JsonValue { return this._componentType; }\n get virtual(): boolean { return this._boundComponent.virtual; }\n get component(): ComponentContainer.Component { return this._boundComponent.component; }\n get tab(): Tab { return this._tab; }\n get title(): string { return this._parent.title; }\n get layoutManager(): LayoutManager { return this._layoutManager; }\n get isHidden(): boolean { return !this._visible; }\n get visible(): boolean { return this._visible; }\n get state(): JsonValue | undefined { return this._state; }\n /** Return the initial component state */\n get initialState(): JsonValue | undefined { return this._initialState; }\n /** The inner DOM element where the container's content is intended to live in */\n get element(): HTMLElement { return this._element; }\n\n /** @internal */\n constructor(\n /** @internal */\n private readonly _config: ResolvedComponentItemConfig,\n /** @internal */\n private readonly _parent: ComponentItem,\n /** @internal */\n private readonly _layoutManager: LayoutManager,\n /** @internal */\n private readonly _element: HTMLElement,\n /** @internal */\n private readonly _updateItemConfigEvent: ComponentContainer.UpdateItemConfigEventHandler,\n /** @internal */\n private readonly _showEvent: ComponentContainer.ShowEventHandler,\n /** @internal */\n private readonly _hideEvent: ComponentContainer.HideEventHandler,\n /** @internal */\n private readonly _focusEvent: ComponentContainer.FocusEventHandler,\n /** @internal */\n private readonly _blurEvent: ComponentContainer.BlurEventHandler,\n ) {\n super();\n\n this._width = 0;\n this._height = 0;\n this._visible = true;\n this._isShownWithZeroDimensions = true;\n\n this._componentType = _config.componentType;\n this._isClosable = _config.isClosable;\n this._initialState = _config.componentState;\n this._state = this._initialState;\n\n this._boundComponent = this.layoutManager.bindComponent(this, _config);\n\n this.updateElementPositionPropertyFromBoundComponent();\n }\n\n /** @internal */\n destroy(): void {\n this.releaseComponent();\n this.stateRequestEvent = undefined;\n this.emit('destroy');\n }\n\n /** @deprecated use {@link (ComponentContainer:class).element } */\n getElement(): HTMLElement {\n return this._element;\n }\n\n /**\n * Hides the container's component item (and hence, the container) if not already hidden.\n * Emits hide event prior to hiding the container.\n */\n hide(): void {\n this._hideEvent();\n }\n\n /**\n * Shows the container's component item (and hence, the container) if not visible.\n * Emits show event prior to hiding the container.\n */\n show(): void {\n this._showEvent();\n }\n\n /**\n * Focus this component in Layout.\n */\n focus(suppressEvent = false): void {\n this._focusEvent(suppressEvent);\n }\n\n /**\n * Remove focus from this component in Layout.\n */\n blur(suppressEvent = false): void {\n this._blurEvent(suppressEvent);\n }\n\n /**\n * Set the size from within the container. Traverses up\n * the item tree until it finds a row or column element\n * and resizes its items accordingly.\n *\n * If this container isn't a descendant of a row or column\n * it returns false\n * @param width - The new width in pixel\n * @param height - The new height in pixel\n *\n * @returns resizeSuccesful\n *\n * @internal\n */\n setSize(width: number, height: number): boolean {\n let ancestorItem: ContentItem | null = this._parent;\n if (ancestorItem.isColumn || ancestorItem.isRow || ancestorItem.parent === null) {\n throw new AssertError('ICSSPRC', 'ComponentContainer cannot have RowColumn Parent');\n } else {\n let ancestorChildItem: ContentItem;\n do {\n ancestorChildItem = ancestorItem;\n ancestorItem = ancestorItem.parent;\n } while (ancestorItem !== null && !ancestorItem.isColumn && !ancestorItem.isRow);\n\n if (ancestorItem === null) {\n // no Row or Column found\n return false;\n } else {\n // ancestorItem is Row or Column\n const direction = ancestorItem.isColumn ? 'height' : 'width';\n const currentSize = this[direction];\n if (currentSize === null) {\n throw new UnexpectedNullError('ICSSCS11194');\n } else {\n const newSize = direction === 'height' ? height : width;\n\n const totalPixel = currentSize * (1 / (ancestorChildItem.size / 100));\n const percentage = (newSize / totalPixel) * 100;\n const delta = (ancestorChildItem.size - percentage) / (ancestorItem.contentItems.length - 1);\n\n for (let i = 0; i < ancestorItem.contentItems.length; i++) {\n const ancestorItemContentItem = ancestorItem.contentItems[i];\n if (ancestorItemContentItem === ancestorChildItem) {\n ancestorItemContentItem.size = percentage;\n } else {\n ancestorItemContentItem.size += delta;\n }\n }\n\n ancestorItem.updateSize(false);\n\n return true;\n }\n }\n }\n }\n\n /**\n * Closes the container if it is closable. Can be called by\n * both the component within at as well as the contentItem containing\n * it. Emits a close event before the container itself is closed.\n */\n close(): void {\n if (this._isClosable) {\n this.emit('close');\n this._parent.close();\n }\n }\n\n /** Replaces component without affecting layout */\n replaceComponent(itemConfig: ComponentItemConfig): void {\n this.releaseComponent();\n\n if (!ItemConfig.isComponent(itemConfig)) {\n throw new Error('ReplaceComponent not passed a component ItemConfig')\n } else {\n const config = ComponentItemConfig.resolve(itemConfig, false);\n this._initialState = config.componentState;\n this._state = this._initialState;\n this._componentType = config.componentType;\n\n this._updateItemConfigEvent(config);\n\n this._boundComponent = this.layoutManager.bindComponent(this, config);\n this.updateElementPositionPropertyFromBoundComponent();\n\n if (this._boundComponent.virtual) {\n if (this.virtualVisibilityChangeRequiredEvent !== undefined) {\n this.virtualVisibilityChangeRequiredEvent(this, this._visible);\n }\n if (this.virtualRectingRequiredEvent !== undefined) {\n this._layoutManager.fireBeforeVirtualRectingEvent(1);\n try {\n this.virtualRectingRequiredEvent(this, this._width, this._height);\n } finally {\n this._layoutManager.fireAfterVirtualRectingEvent();\n }\n }\n this.setBaseLogicalZIndex();\n }\n\n this.emit('stateChanged');\n }\n }\n\n /**\n * Returns the initial component state or the latest passed in setState()\n * @returns state\n * @deprecated Use {@link (ComponentContainer:class).initialState}\n */\n getState(): JsonValue | undefined {\n return this._state;\n }\n\n /**\n * Merges the provided state into the current one\n * @deprecated Use {@link (ComponentContainer:class).stateRequestEvent}\n */\n extendState(state: Record): void {\n const extendedState = deepExtend(this._state as Record, state);\n this.setState(extendedState as JsonValue);\n }\n\n /**\n * Sets the component state\n * @deprecated Use {@link (ComponentContainer:class).stateRequestEvent}\n */\n setState(state: JsonValue): void {\n this._state = state;\n this._parent.emitBaseBubblingEvent('stateChanged');\n }\n\n /**\n * Set's the components title\n */\n setTitle(title: string): void {\n this._parent.setTitle(title);\n }\n\n /** @internal */\n setTab(tab: Tab): void {\n this._tab = tab;\n this.emit('tab', tab)\n }\n\n /** @internal */\n setVisibility(value: boolean): void {\n if (this._boundComponent.virtual) {\n if (this.virtualVisibilityChangeRequiredEvent !== undefined) {\n this.virtualVisibilityChangeRequiredEvent(this, value);\n }\n }\n\n if (value) {\n if (!this._visible) {\n this._visible = true;\n if (this._height === 0 && this._width === 0) {\n this._isShownWithZeroDimensions = true;\n } else {\n this._isShownWithZeroDimensions = false;\n this.setSizeToNodeSize(this._width, this._height, true);\n this.emitShow();\n }\n } else {\n if (this._isShownWithZeroDimensions && (this._height !== 0 || this._width !== 0)) {\n this._isShownWithZeroDimensions = false;\n this.setSizeToNodeSize(this._width, this._height, true);\n this.emitShow();\n }\n }\n } else {\n if (this._visible) {\n this._visible = false;\n this._isShownWithZeroDimensions = false;\n this.emitHide();\n }\n }\n }\n\n setBaseLogicalZIndex(): void {\n this.setLogicalZIndex(LogicalZIndex.base);\n }\n\n setLogicalZIndex(logicalZIndex: LogicalZIndex): void {\n if (logicalZIndex !== this._logicalZIndex) {\n this._logicalZIndex = logicalZIndex;\n\n this.notifyVirtualZIndexChangeRequired();\n }\n }\n\n /**\n * Set the container's size, but considered temporary (for dragging)\n * so don't emit any events.\n * @internal\n */\n enterDragMode(width: number, height: number): void {\n this._width = width;\n this._height = height;\n setElementWidth(this._element, width);\n setElementHeight(this._element, height);\n\n this.setLogicalZIndex(LogicalZIndex.drag);\n\n this.drag();\n }\n\n /** @internal */\n exitDragMode(): void {\n this.setBaseLogicalZIndex();\n }\n\n /** @internal */\n enterStackMaximised(): void {\n this._stackMaximised = true;\n this.setLogicalZIndex(LogicalZIndex.stackMaximised);\n }\n\n /** @internal */\n exitStackMaximised(): void {\n this.setBaseLogicalZIndex();\n this._stackMaximised = false;\n }\n\n /** @internal */\n drag(): void {\n if (this._boundComponent.virtual) {\n if (this.virtualRectingRequiredEvent !== undefined) {\n this._layoutManager.fireBeforeVirtualRectingEvent(1);\n try {\n this.virtualRectingRequiredEvent(this, this._width, this._height);\n } finally {\n this._layoutManager.fireAfterVirtualRectingEvent();\n }\n }\n }\n }\n\n /**\n * Sets the container's size. Called by the container's component item.\n * To instead set the size programmatically from within the component itself,\n * use the public setSize method\n * @param width - in px\n * @param height - in px\n * @param force - set even if no change\n * @internal\n */\n setSizeToNodeSize(width: number, height: number, force: boolean): void {\n if (width !== this._width || height !== this._height || force) {\n this._width = width;\n this._height = height;\n setElementWidth(this._element, width);\n setElementHeight(this._element, height);\n\n if (this._boundComponent.virtual) {\n this.addVirtualSizedContainerToLayoutManager();\n } else {\n this.emit('resize');\n this.checkShownFromZeroDimensions();\n }\n }\n }\n\n /** @internal */\n notifyVirtualRectingRequired(): void {\n if (this.virtualRectingRequiredEvent !== undefined) {\n this.virtualRectingRequiredEvent(this, this._width, this._height);\n this.emit('resize');\n this.checkShownFromZeroDimensions();\n }\n }\n\n /** @internal */\n private notifyVirtualZIndexChangeRequired(): void {\n if (this.virtualZIndexChangeRequiredEvent !== undefined) {\n const logicalZIndex = this._logicalZIndex;\n const defaultZIndex = LogicalZIndexToDefaultMap[logicalZIndex];\n this.virtualZIndexChangeRequiredEvent(this, logicalZIndex, defaultZIndex);\n }\n }\n\n /** @internal */\n private updateElementPositionPropertyFromBoundComponent() {\n if (this._boundComponent.virtual) {\n this._element.style.position = 'static';\n } else {\n this._element.style.position = ''; // set it back to attribute value\n }\n }\n\n /** @internal */\n private addVirtualSizedContainerToLayoutManager() {\n this._layoutManager.beginVirtualSizedContainerAdding();\n try {\n this._layoutManager.addVirtualSizedContainer(this);\n } finally {\n this._layoutManager.endVirtualSizedContainerAdding();\n }\n }\n\n /** @internal */\n private checkShownFromZeroDimensions() {\n if (this._isShownWithZeroDimensions && (this._height !== 0 || this._width !== 0)) {\n this._isShownWithZeroDimensions = false;\n this.emitShow();\n }\n }\n\n /** @internal */\n private emitShow(): void {\n this.emit('shown');\n this.emit('show');\n }\n\n /** @internal */\n private emitHide(): void {\n this.emit('hide');\n }\n\n /** @internal */\n private releaseComponent() {\n if (this._stackMaximised) {\n this.exitStackMaximised();\n }\n this.emit('beforeComponentRelease', this._boundComponent.component);\n this.layoutManager.unbindComponent(this, this._boundComponent.virtual, this._boundComponent.component);\n }\n}\n\n/** @public @deprecated use {@link ComponentContainer} */\nexport type ItemContainer = ComponentContainer;\n\n/** @public */\nexport namespace ComponentContainer {\n export type Component = unknown;\n\n export interface BindableComponent {\n component: Component;\n virtual: boolean;\n }\n\n export type StateRequestEventHandler = (this: void) => JsonValue | undefined;\n export type VirtualRectingRequiredEvent = (this: void, container: ComponentContainer, width: number, height: number) => void;\n export type VirtualVisibilityChangeRequiredEvent = (this: void, container: ComponentContainer, visible: boolean) => void;\n export type VirtualZIndexChangeRequiredEvent =\n (this: void, container: ComponentContainer, logicalZIndex: LogicalZIndex, defaultZIndex: string) => void;\n /** @internal */\n export type ShowEventHandler = (this: void) => void;\n /** @internal */\n export type HideEventHandler = (this: void) => void;\n /** @internal */\n export type FocusEventHandler = (this: void, suppressEvent: boolean) => void;\n /** @internal */\n export type BlurEventHandler = (this: void, suppressEvent: boolean) => void;\n /** @internal */\n export type UpdateItemConfigEventHandler = (itemConfig: ResolvedComponentItemConfig) => void;\n}\n","import { ResolvedItemConfig } from '../config/resolved-config'\nimport { BrowserPopout } from '../controls/browser-popout'\nimport { AssertError, UnexpectedNullError } from '../errors/internal-error'\nimport { LayoutManager } from '../layout-manager'\nimport { EventEmitter } from '../utils/event-emitter'\nimport { AreaLinkedRect, ItemType, SizeUnitEnum } from '../utils/types'\nimport { getUniqueId, setElementDisplayVisibility } from '../utils/utils'\nimport { ComponentItem } from './component-item'\nimport { ComponentParentableItem } from './component-parentable-item'\nimport { Stack } from './stack'\n\n/**\n * This is the baseclass that all content items inherit from.\n * Most methods provide a subset of what the sub-classes do.\n *\n * It also provides a number of functions for tree traversal\n * @public\n */\n\nexport abstract class ContentItem extends EventEmitter {\n /** @internal */\n private _type: ItemType;\n /** @internal */\n private _id: string;\n /** @internal */\n private _popInParentIds: string[] = [];\n /** @internal */\n private _contentItems: ContentItem[];\n /** @internal */\n private _isClosable;\n /** @internal */\n private _pendingEventPropagations: Record;\n /** @internal */\n private _throttledEvents: string[];\n /** @internal */\n private _isInitialised;\n\n /** @internal */\n size: number;\n /** @internal */\n sizeUnit: SizeUnitEnum;\n /** @internal */\n minSize: number | undefined;\n /** @internal */\n minSizeUnit: SizeUnitEnum;\n\n isGround: boolean\n isRow: boolean\n isColumn: boolean\n isStack: boolean\n isComponent: boolean\n\n get type(): ItemType { return this._type; }\n get id(): string { return this._id; }\n set id(value: string) { this._id = value; }\n /** @internal */\n get popInParentIds(): string[] { return this._popInParentIds; }\n get parent(): ContentItem | null { return this._parent; }\n get contentItems(): ContentItem[] { return this._contentItems; }\n get isClosable(): boolean { return this._isClosable; }\n get element(): HTMLElement { return this._element; }\n get isInitialised(): boolean { return this._isInitialised; }\n\n static isStack(item: ContentItem): item is Stack {\n return item.isStack;\n }\n\n static isComponentItem(item: ContentItem): item is ComponentItem {\n return item.isComponent;\n }\n\n static isComponentParentableItem(item: ContentItem): item is ComponentParentableItem {\n return item.isStack || item.isGround;\n }\n\n /** @internal */\n constructor(public readonly layoutManager: LayoutManager,\n config: ResolvedItemConfig,\n /** @internal */\n private _parent: ContentItem | null,\n /** @internal */\n private readonly _element: HTMLElement\n ) {\n super();\n\n this._type = config.type;\n this._id = config.id;\n\n this._isInitialised = false;\n this.isGround = false;\n this.isRow = false;\n this.isColumn = false;\n this.isStack = false;\n this.isComponent = false;\n\n this.size = config.size;\n this.sizeUnit = config.sizeUnit;\n this.minSize = config.minSize;\n this.minSizeUnit = config.minSizeUnit;\n\n this._isClosable = config.isClosable;\n\n this._pendingEventPropagations = {};\n this._throttledEvents = ['stateChanged'];\n\n this._contentItems = this.createContentItems(config.content);\n }\n\n /**\n * Updaters the size of the component and its children, called recursively\n * @param force - In some cases the size is not updated if it has not changed. In this case, events\n * (such as ComponentContainer.virtualRectingRequiredEvent) are not fired. Setting force to true, ensures the size is updated regardless, and\n * the respective events are fired. This is sometimes necessary when a component's size has not changed but it has become visible, and the\n * relevant events need to be fired.\n * @internal\n */\n abstract updateSize(force: boolean): void;\n\n /**\n * Removes a child node (and its children) from the tree\n * @param contentItem - The child item to remove\n * @param keepChild - Whether to destroy the removed item\n */\n removeChild(contentItem: ContentItem, keepChild = false): void {\n /*\n * Get the position of the item that's to be removed within all content items this node contains\n */\n const index = this._contentItems.indexOf(contentItem);\n\n /*\n * Make sure the content item to be removed is actually a child of this item\n */\n if (index === -1) {\n throw new Error('Can\\'t remove child item. Unknown content item');\n }\n\n /**\n\t\t * Call destroy on the content item.\n\t\t * All children are destroyed as well\n\t\t */\n if (!keepChild) {\n\t\t\tthis._contentItems[index].destroy();\n }\n\n /**\n * Remove the content item from this nodes array of children\n */\n this._contentItems.splice(index, 1);\n\n /**\n * If this node still contains other content items, adjust their size\n */\n if (this._contentItems.length > 0) {\n this.updateSize(false);\n } else {\n /**\n * If this was the last content item, remove this node as well\n */\n if (!this.isGround && this._isClosable === true) {\n if (this._parent === null) {\n throw new UnexpectedNullError('CIUC00874');\n } else {\n this._parent.removeChild(this);\n }\n }\n }\n }\n\n /**\n * Sets up the tree structure for the newly added child\n * The responsibility for the actual DOM manipulations lies\n * with the concrete item\n *\n * @param contentItem -\n * @param index - If omitted item will be appended\n * @param suspendResize - Used by descendent implementations\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n addChild(contentItem: ContentItem, index?: number | null, suspendResize?: boolean): number {\n index ??= this._contentItems.length;\n\n this._contentItems.splice(index, 0, contentItem);\n contentItem.setParent(this);\n\n if (this._isInitialised === true && contentItem._isInitialised === false) {\n contentItem.init();\n }\n\n return index;\n }\n\n /**\n * Replaces oldChild with newChild\n * @param oldChild -\n * @param newChild -\n * @internal\n */\n replaceChild(oldChild: ContentItem, newChild: ContentItem, destroyOldChild = false): void {\n // Do not try to replace ComponentItem - will not work\n const index = this._contentItems.indexOf(oldChild);\n const parentNode = oldChild._element.parentNode;\n\n if (index === -1) {\n throw new AssertError('CIRCI23232', 'Can\\'t replace child. oldChild is not child of this');\n }\n\n if (parentNode === null) {\n throw new UnexpectedNullError('CIRCP23232');\n } else {\n parentNode.replaceChild(newChild._element, oldChild._element);\n\n /*\n * Optionally destroy the old content item\n */\n if (destroyOldChild === true) {\n oldChild._parent = null;\n oldChild.destroy(); // will now also destroy all children of oldChild\n }\n\n /*\n * Wire the new contentItem into the tree\n */\n this._contentItems[index] = newChild;\n newChild.setParent(this);\n // newChild inherits the sizes from the old child:\n newChild.size = oldChild.size;\n newChild.sizeUnit = oldChild.sizeUnit;\n newChild.minSize = oldChild.minSize;\n newChild.minSizeUnit = oldChild.minSizeUnit;\n\n //TODO This doesn't update the config... refactor to leave item nodes untouched after creation\n if (newChild._parent === null) {\n throw new UnexpectedNullError('CIRCNC45699');\n } else {\n if (newChild._parent._isInitialised === true && newChild._isInitialised === false) {\n newChild.init();\n }\n\n this.updateSize(false);\n }\n }\n }\n\n /**\n * Convenience method.\n * Shorthand for this.parent.removeChild( this )\n */\n remove(): void {\n if (this._parent === null) {\n throw new UnexpectedNullError('CIR11110');\n } else {\n this._parent.removeChild(this);\n }\n }\n\n /**\n * Removes the component from the layout and creates a new\n * browser window with the component and its children inside\n */\n popout(): BrowserPopout {\n const parentId = getUniqueId();\n const browserPopout = this.layoutManager.createPopoutFromContentItem(this, undefined, parentId, undefined);\n this.emitBaseBubblingEvent('stateChanged');\n return browserPopout;\n }\n\n abstract toConfig(): ResolvedItemConfig;\n\n /** @internal */\n calculateConfigContent(): ResolvedItemConfig[] {\n const contentItems = this._contentItems;\n const count = contentItems.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const item = contentItems[i];\n result[i] = item.toConfig();\n }\n return result;\n }\n\n /** @internal */\n highlightDropZone(x: number, y: number, area: AreaLinkedRect): void {\n const dropTargetIndicator = this.layoutManager.dropTargetIndicator;\n if (dropTargetIndicator === null) {\n throw new UnexpectedNullError('ACIHDZ5593');\n } else {\n dropTargetIndicator.highlightArea(area, 1);\n }\n }\n\n /** @internal */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDrop(contentItem: ContentItem, area: ContentItem.Area): void {\n this.addChild(contentItem);\n }\n\n /** @internal */\n show(): void {\n this.layoutManager.beginSizeInvalidation();\n try {\n // Not sure why showAllActiveContentItems() was called. GoldenLayout seems to work fine without it. Left commented code\n // in source in case a reason for it becomes apparent.\n // this.layoutManager.showAllActiveContentItems();\n setElementDisplayVisibility(this._element, true);\n // this.layoutManager.updateSizeFromContainer();\n\n for (let i = 0; i < this._contentItems.length; i++) {\n this._contentItems[i].show();\n }\n } finally {\n this.layoutManager.endSizeInvalidation();\n }\n }\n\n /**\n * Destroys this item ands its children\n * @internal\n */\n destroy(): void {\n for (let i = 0; i < this._contentItems.length; i++) {\n this._contentItems[i].destroy();\n }\n this._contentItems = [];\n\n this.emitBaseBubblingEvent('beforeItemDestroyed');\n this._element.remove();\n this.emitBaseBubblingEvent('itemDestroyed');\n }\n\n /**\n * Returns the area the component currently occupies\n * @internal\n */\n getElementArea(element?: HTMLElement): ContentItem.Area | null {\n element = element ?? this._element;\n\n const rect = element.getBoundingClientRect();\n const top = rect.top + document.body.scrollTop;\n const left = rect.left + document.body.scrollLeft;\n\n const width = rect.width;\n const height = rect.height;\n\n return {\n x1: left,\n y1: top,\n x2: left + width,\n y2: top + height,\n surface: width * height,\n contentItem: this\n };\n }\n\n /**\n * The tree of content items is created in two steps: First all content items are instantiated,\n * then init is called recursively from top to bottem. This is the basic init function,\n * it can be used, extended or overwritten by the content items\n *\n * Its behaviour depends on the content item\n * @internal\n */\n init(): void {\n this._isInitialised = true;\n this.emitBaseBubblingEvent('itemCreated');\n this.emitUnknownBubblingEvent(this.type + 'Created');\n }\n\n /** @internal */\n protected setParent(parent: ContentItem): void {\n this._parent = parent;\n }\n\n /** @internal */\n addPopInParentId(id: string): void {\n if (!this.popInParentIds.includes(id)) {\n this.popInParentIds.push(id);\n }\n }\n\n /** @internal */\n protected initContentItems(): void {\n for (let i = 0; i < this._contentItems.length; i++) {\n this._contentItems[i].init();\n }\n }\n\n /** @internal */\n protected hide(): void {\n this.layoutManager.beginSizeInvalidation();\n try {\n setElementDisplayVisibility(this._element, false);\n // this.layoutManager.updateSizeFromContainer();\n } finally {\n this.layoutManager.endSizeInvalidation();\n }\n }\n\n /** @internal */\n protected updateContentItemsSize(force: boolean): void {\n for (let i = 0; i < this._contentItems.length; i++) {\n this._contentItems[i].updateSize(force);\n }\n }\n\n /**\n * creates all content items for this node at initialisation time\n * PLEASE NOTE, please see addChild for adding contentItems at runtime\n * @internal\n */\n private createContentItems(content: readonly ResolvedItemConfig[]) {\n const count = content.length;\n const result = new Array(count);\n for (let i = 0; i < content.length; i++) {\n result[i] = this.layoutManager.createContentItem(content[i], this);\n }\n return result;\n }\n\n /**\n * Called for every event on the item tree. Decides whether the event is a bubbling\n * event and propagates it to its parent\n *\n * @param name - The name of the event\n * @param event -\n * @internal\n */\n private propagateEvent(name: string, args: unknown[]) {\n if (args.length === 1) {\n const event = args[0];\n if (event instanceof EventEmitter.BubblingEvent &&\n event.isPropagationStopped === false &&\n this._isInitialised === true) {\n\n /**\n * In some cases (e.g. if an element is created from a DragSource) it\n * doesn't have a parent and is not a child of GroundItem. If that's the case\n * propagate the bubbling event from the top level of the substree directly\n * to the layoutManager\n */\n if (this.isGround === false && this._parent) {\n this._parent.emitUnknown(name, event);\n } else {\n this.scheduleEventPropagationToLayoutManager(name, event);\n }\n }\n }\n }\n\n override tryBubbleEvent(name: string, args: unknown[]): void {\n if (args.length === 1) {\n const event = args[0];\n if (event instanceof EventEmitter.BubblingEvent &&\n event.isPropagationStopped === false &&\n this._isInitialised === true\n ) {\n /**\n * In some cases (e.g. if an element is created from a DragSource) it\n * doesn't have a parent and is not a child of GroundItem. If that's the case\n * propagate the bubbling event from the top level of the substree directly\n * to the layoutManager\n */\n if (this.isGround === false && this._parent) {\n this._parent.emitUnknown(name, event);\n } else {\n this.scheduleEventPropagationToLayoutManager(name, event);\n }\n }\n }\n }\n\n /**\n * All raw events bubble up to the Ground element. Some events that\n * are propagated to - and emitted by - the layoutManager however are\n * only string-based, batched and sanitized to make them more usable\n *\n * @param name - The name of the event\n * @internal\n */\n private scheduleEventPropagationToLayoutManager(name: string, event: EventEmitter.BubblingEvent) {\n if (this._throttledEvents.indexOf(name) === -1) {\n this.layoutManager.emitUnknown(name, event);\n } else {\n if (this._pendingEventPropagations[name] !== true) {\n this._pendingEventPropagations[name] = true;\n globalThis.requestAnimationFrame(() => this.propagateEventToLayoutManager(name, event));\n }\n }\n\n }\n\n /**\n * Callback for events scheduled by _scheduleEventPropagationToLayoutManager\n *\n * @param name - The name of the event\n * @internal\n */\n private propagateEventToLayoutManager(name: string, event: EventEmitter.BubblingEvent) {\n this._pendingEventPropagations[name] = false;\n this.layoutManager.emitUnknown(name, event);\n }\n}\n\n/** @public */\nexport namespace ContentItem {\n /** @internal */\n export interface Area extends AreaLinkedRect {\n surface: number;\n contentItem: ContentItem;\n }\n}\n\n/** @public @deprecated Use {@link (ContentItem:class)} */\nexport type AbstractContentItem = ContentItem;\n","import { ResolvedComponentItemConfig, ResolvedHeaderedItemConfig } from '../config/resolved-config';\nimport { ComponentContainer } from '../container/component-container';\nimport { Tab } from '../controls/tab';\nimport { UnexpectedNullError } from '../errors/internal-error';\nimport { LayoutManager } from '../layout-manager';\nimport { DomConstants } from '../utils/dom-constants';\nimport { ItemType, JsonValue } from '../utils/types';\nimport { getElementWidthAndHeight, setElementHeight, setElementWidth } from '../utils/utils';\nimport { ComponentParentableItem } from './component-parentable-item';\nimport { ContentItem } from './content-item';\n\n/** @public */\nexport class ComponentItem extends ContentItem {\n /** @internal */\n private _reorderEnabled: boolean;\n /** @internal */\n private _headerConfig: ResolvedHeaderedItemConfig.Header | undefined;\n /** @internal */\n private _title: string;\n /** @internal */\n private readonly _initialWantMaximise: boolean;\n /** @internal */\n private _container: ComponentContainer;\n /** @internal */\n private _tab: Tab;\n /** @internal */\n private _focused = false;\n\n /** @internal @deprecated use {@link (ComponentItem:class).componentType} */\n get componentName(): JsonValue { return this._container.componentType; }\n get componentType(): JsonValue { return this._container.componentType; }\n get reorderEnabled(): boolean { return this._reorderEnabled; }\n /** @internal */\n get initialWantMaximise(): boolean { return this._initialWantMaximise; }\n get component(): ComponentContainer.Component | undefined { return this._container.component; }\n get container(): ComponentContainer { return this._container; }\n get parentItem(): ComponentParentableItem { return this._parentItem; }\n\n get headerConfig(): ResolvedHeaderedItemConfig.Header | undefined { return this._headerConfig; }\n get title(): string { return this._title; }\n get tab(): Tab { return this._tab; }\n get focused(): boolean { return this._focused; }\n\n /** @internal */\n constructor(\n layoutManager: LayoutManager,\n config: ResolvedComponentItemConfig,\n /** @internal */\n private _parentItem: ComponentParentableItem\n ) {\n super(layoutManager, config, _parentItem, document.createElement('div'));\n\n this.isComponent = true;\n\n this._reorderEnabled = config.reorderEnabled;\n\n this.applyUpdatableConfig(config);\n\n this._initialWantMaximise = config.maximised;\n\n const containerElement = document.createElement('div');\n containerElement.classList.add(DomConstants.ClassName.Content);\n this.element.appendChild(containerElement);\n this._container = new ComponentContainer(config, this, layoutManager, containerElement,\n (itemConfig) => this.handleUpdateItemConfigEvent(itemConfig),\n () => this.show(),\n () => this.hide(),\n (suppressEvent) => this.focus(suppressEvent),\n (suppressEvent) => this.blur(suppressEvent),\n );\n }\n\n /** @internal */\n override destroy(): void {\n this._container.destroy()\n super.destroy();\n }\n\n applyUpdatableConfig(config: ResolvedComponentItemConfig): void {\n this.setTitle(config.title);\n this._headerConfig = config.header;\n }\n\n toConfig(): ResolvedComponentItemConfig {\n const stateRequestEvent = this._container.stateRequestEvent;\n const state = stateRequestEvent === undefined ? this._container.state : stateRequestEvent();\n\n const result: ResolvedComponentItemConfig = {\n type: ItemType.component,\n content: [],\n size: this.size,\n sizeUnit: this.sizeUnit,\n minSize: this.minSize,\n minSizeUnit: this.minSizeUnit,\n id: this.id,\n maximised: false,\n isClosable: this.isClosable,\n reorderEnabled: this._reorderEnabled,\n title: this._title,\n header: ResolvedHeaderedItemConfig.Header.createCopy(this._headerConfig),\n componentType: ResolvedComponentItemConfig.copyComponentType(this.componentType),\n componentState: state,\n }\n\n return result;\n }\n\n close(): void {\n if (this.parent === null) {\n throw new UnexpectedNullError('CIC68883');\n } else {\n this.parent.removeChild(this, false);\n }\n }\n\n // Used by Drag Proxy\n /** @internal */\n enterDragMode(width: number, height: number): void {\n setElementWidth(this.element, width);\n setElementHeight(this.element, height);\n this._container.enterDragMode(width, height);\n }\n\n /** @internal */\n exitDragMode(): void {\n this._container.exitDragMode();\n }\n\n /** @internal */\n enterStackMaximised(): void {\n this._container.enterStackMaximised();\n }\n\n /** @internal */\n exitStackMaximised(): void {\n this._container.exitStackMaximised();\n }\n\n // Used by Drag Proxy\n /** @internal */\n drag(): void {\n this._container.drag();\n }\n\n /** @internal */\n override updateSize(force: boolean): void {\n this.updateNodeSize(force);\n }\n\n /** @internal */\n override init(): void {\n this.updateNodeSize(false);\n\n super.init();\n this._container.emit('open');\n this.initContentItems();\n }\n\n /**\n * Set this component's title\n *\n * @public\n * @param title -\n */\n\n setTitle(title: string): void {\n this._title = title;\n this.emit('titleChanged', title);\n this.emit('stateChanged');\n }\n\n setTab(tab: Tab): void {\n this._tab = tab;\n this.emit('tab', tab)\n this._container.setTab(tab);\n }\n\n /** @internal */\n override hide(): void {\n super.hide();\n this._container.setVisibility(false);\n }\n\n /** @internal */\n override show(): void {\n super.show();\n this._container.setVisibility(true);\n }\n\n /**\n * Focuses the item if it is not already focused\n */\n focus(suppressEvent = false): void {\n this.parentItem.setActiveComponentItem(this, true, suppressEvent);\n }\n\n /** @internal */\n setFocused(suppressEvent: boolean): void {\n this._focused = true;\n this.tab.setFocused();\n if (!suppressEvent) {\n this.emitBaseBubblingEvent('focus');\n }\n }\n\n /**\n * Blurs (defocuses) the item if it is focused\n */\n blur(suppressEvent = false): void {\n if (this._focused) {\n this.layoutManager.setFocusedComponentItem(undefined, suppressEvent);\n }\n }\n\n /** @internal */\n setBlurred(suppressEvent: boolean): void {\n this._focused = false;\n this.tab.setBlurred();\n if (!suppressEvent) {\n this.emitBaseBubblingEvent('blur');\n }\n }\n\n /** @internal */\n protected override setParent(parent: ContentItem): void {\n this._parentItem = parent as ComponentParentableItem;\n super.setParent(parent);\n }\n\n /** @internal */\n private handleUpdateItemConfigEvent(itemConfig: ResolvedComponentItemConfig) {\n this.applyUpdatableConfig(itemConfig);\n }\n\n /** @internal */\n private updateNodeSize(force: boolean): void {\n if (this.element.style.display !== 'none') {\n // Do not update size of hidden components to prevent unwanted reflows\n\n const { width, height } = getElementWidthAndHeight(this.element);\n this._container.setSizeToNodeSize(width, height, force);\n }\n }\n}\n\n/** @public @deprecated use {@link (ComponentItem:class)} */\nexport type Component = ComponentItem;\n\n/** @public */\nexport namespace ComponentItem {\n export type Component = ComponentContainer.Component;\n}\n","import { ComponentItem } from './component-item';\nimport { ContentItem } from './content-item';\n\nexport abstract class ComponentParentableItem extends ContentItem {\n /** @internal */\n private _focused = false;\n\n get focused(): boolean { return this._focused; }\n\n /** @internal */\n setFocusedValue(value: boolean): void {\n this._focused = value;\n }\n\n abstract setActiveComponentItem(item: ComponentItem, focus: boolean, suppressFocusEvent: boolean): void;\n}\n","import { ComponentItemConfig, ItemConfig } from '../config/config';\nimport { ResolvedComponentItemConfig, ResolvedHeaderedItemConfig, ResolvedItemConfig, ResolvedStackItemConfig } from '../config/resolved-config';\nimport { Header } from '../controls/header';\nimport { AssertError, UnexpectedNullError, UnexpectedUndefinedError } from '../errors/internal-error';\nimport { LayoutManager } from '../layout-manager';\nimport { DomConstants } from '../utils/dom-constants';\nimport { DragListener } from '../utils/drag-listener';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { AreaLinkedRect, ItemType, JsonValue, Side, SizeUnitEnum, WidthAndHeight, WidthOrHeightPropertyName } from '../utils/types';\nimport {\n getElementWidthAndHeight,\n numberToPixels,\n setElementDisplayVisibility\n} from '../utils/utils';\nimport { ComponentItem } from './component-item';\nimport { ComponentParentableItem } from './component-parentable-item';\nimport { ContentItem } from './content-item';\n\n/** @public */\nexport class Stack extends ComponentParentableItem {\n /** @internal */\n private readonly _headerConfig: ResolvedHeaderedItemConfig.Header | undefined;\n /** @internal */\n private readonly _header: Header;\n /** @internal */\n private readonly _childElementContainer: HTMLElement;\n /** @internal */\n private readonly _maximisedEnabled: boolean;\n /** @internal */\n private _activeComponentItem: ComponentItem | undefined;\n /** @internal */\n private _dropSegment: Stack.Segment;\n /** @internal */\n private _dropIndex: number;\n /** @internal */\n private _contentAreaDimensions: Stack.ContentAreaDimensions;\n /** @internal */\n private _headerSideChanged = false;\n /** @internal */\n private readonly _initialWantMaximise: boolean;\n /** @internal */\n private _initialActiveItemIndex: number;\n\n /** @internal */\n private _resizeListener = () => this.handleResize();\n /** @internal */\n private _maximisedListener = () => this.handleMaximised();\n /** @internal */\n private _minimisedListener = () => this.handleMinimised();\n\n get childElementContainer(): HTMLElement { return this._childElementContainer; }\n get header(): Header { return this._header; }\n get headerShow(): boolean { return this._header.show; }\n get headerSide(): Side { return this._header.side; }\n get headerLeftRightSided(): boolean { return this._header.leftRightSided; }\n /** @internal */\n get contentAreaDimensions(): Stack.ContentAreaDimensions | undefined { return this._contentAreaDimensions; }\n /** @internal */\n get initialWantMaximise(): boolean { return this._initialWantMaximise; }\n get isMaximised(): boolean { return this === this.layoutManager.maximisedStack; }\n get stackParent(): ContentItem {\n if (!this.parent) {\n throw new Error('Stack should always have a parent');\n }\n return this.parent;\n }\n\n /** @internal */\n constructor(layoutManager: LayoutManager, config: ResolvedStackItemConfig, parent: ContentItem) {\n super(layoutManager, config, parent, Stack.createElement(document));\n\n this._headerConfig = config.header;\n const layoutHeaderConfig = layoutManager.layoutConfig.header;\n const configContent = config.content;\n // If stack has only one component, then we can also check this for header settings\n let componentHeaderConfig: ResolvedHeaderedItemConfig.Header | undefined;\n if (configContent.length !== 1) {\n componentHeaderConfig = undefined;\n } else {\n const firstChildItemConfig = configContent[0];\n componentHeaderConfig = (firstChildItemConfig as ResolvedHeaderedItemConfig).header; // will be undefined if not component (and wont be stack)\n }\n\n this._initialWantMaximise = config.maximised;\n this._initialActiveItemIndex = config.activeItemIndex ?? 0; // make sure defined\n\n // check for defined value for each item in order of Stack (this Item), Component (first child), Manager.\n const show = this._headerConfig?.show ?? componentHeaderConfig?.show ?? layoutHeaderConfig.show;\n const popout = this._headerConfig?.popout ?? componentHeaderConfig?.popout ?? layoutHeaderConfig.popout;\n const maximise = this._headerConfig?.maximise ?? componentHeaderConfig?.maximise ?? layoutHeaderConfig.maximise;\n const close = this._headerConfig?.close ?? componentHeaderConfig?.close ?? layoutHeaderConfig.close;\n const minimise = this._headerConfig?.minimise ?? componentHeaderConfig?.minimise ?? layoutHeaderConfig.minimise;\n const tabDropdown = this._headerConfig?.tabDropdown ?? componentHeaderConfig?.tabDropdown ?? layoutHeaderConfig.tabDropdown;\n this._maximisedEnabled = maximise !== false;\n const headerSettings: Header.Settings = {\n show: show !== false,\n side: show === false ? Side.top : show,\n popoutEnabled: popout !== false,\n popoutLabel: popout === false ? '' : popout,\n maximiseEnabled: this._maximisedEnabled,\n maximiseLabel: maximise === false ? '' : maximise,\n closeEnabled: close !== false,\n closeLabel: close === false ? '' : close,\n minimiseEnabled: true,\n minimiseLabel: minimise,\n tabDropdownEnabled: tabDropdown !== false,\n tabDropdownLabel: tabDropdown === false ? '' : tabDropdown,\n };\n\n this._header = new Header(layoutManager,\n this, headerSettings,\n config.isClosable && close !== false,\n () => this.getActiveComponentItem(),\n () => this.remove(),\n () => this.handlePopoutEvent(),\n () => this.toggleMaximise(),\n (ev) => this.handleHeaderClickEvent(ev),\n (ev) => this.handleHeaderTouchStartEvent(ev),\n (item) => this.handleHeaderComponentRemoveEvent(item),\n (item) => this.handleHeaderComponentFocusEvent(item),\n (x, y, dragListener, item) => this.handleHeaderComponentStartDragEvent(x, y, dragListener, item),\n );\n\n // this._dropZones = {};\n\n this.isStack = true;\n\n this._childElementContainer = document.createElement('section');\n this._childElementContainer.classList.add(DomConstants.ClassName.Items);\n\n this.on('resize', this._resizeListener);\n if (this._maximisedEnabled) {\n this.on('maximised', this._maximisedListener);\n this.on('minimised', this._minimisedListener);\n }\n\n this.element.appendChild(this._header.element);\n this.element.appendChild(this._childElementContainer);\n\n this.setupHeaderPosition();\n this._header.updateClosability();\n }\n\n /** @internal */\n override updateSize(force: boolean): void {\n this.layoutManager.beginVirtualSizedContainerAdding();\n try {\n this.updateNodeSize();\n this.updateContentItemsSize(force);\n } finally {\n this.layoutManager.endVirtualSizedContainerAdding();\n }\n }\n\n /** @internal */\n override init(): void {\n if (this.isInitialised === true) return;\n\n this.updateNodeSize();\n\n for (let i = 0; i < this.contentItems.length; i++) {\n this._childElementContainer.appendChild(this.contentItems[i].element);\n }\n\n super.init();\n\n const contentItems = this.contentItems;\n const contentItemCount = contentItems.length;\n if (contentItemCount > 0) { // contentItemCount will be 0 on drag drop\n if (this._initialActiveItemIndex < 0 || this._initialActiveItemIndex >= contentItemCount) {\n throw new Error(`ActiveItemIndex out of range: ${this._initialActiveItemIndex} id: ${this.id}`);\n } else {\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (!(contentItem instanceof ComponentItem)) {\n throw new Error(`Stack Content Item is not of type ComponentItem: ${i} id: ${this.id}`);\n } else {\n this._header.createTab(contentItem, i);\n contentItem.hide();\n contentItem.container.setBaseLogicalZIndex();\n }\n }\n\n this.setActiveComponentItem(contentItems[this._initialActiveItemIndex] as ComponentItem, false);\n\n this._header.updateTabSizes();\n }\n }\n\n this._header.updateClosability();\n this.initContentItems();\n }\n\n /** @deprecated Use {@link (Stack:class).setActiveComponentItem} */\n setActiveContentItem(item: ContentItem): void {\n if (!ContentItem.isComponentItem(item)) {\n throw new Error('Stack.setActiveContentItem: item is not a ComponentItem');\n } else {\n this.setActiveComponentItem(item, false);\n }\n }\n\n setActiveComponentItem(componentItem: ComponentItem, focus: boolean, suppressFocusEvent = false): void {\n if (this._activeComponentItem !== componentItem) {\n if (this.contentItems.indexOf(componentItem) === -1) {\n throw new Error('componentItem is not a child of this stack');\n } else {\n this.layoutManager.beginSizeInvalidation();\n try {\n if (this._activeComponentItem !== undefined) {\n this._activeComponentItem.hide();\n }\n this._activeComponentItem = componentItem;\n this._header.processActiveComponentChanged(componentItem);\n componentItem.show();\n } finally {\n this.layoutManager.endSizeInvalidation();\n }\n\n this.emit('activeContentItemChanged', componentItem);\n this.layoutManager.emit('activeContentItemChanged', componentItem);\n this.emitStateChangedEvent();\n }\n }\n\n if (this.focused || focus) {\n this.layoutManager.setFocusedComponentItem(componentItem, suppressFocusEvent);\n }\n }\n\n /** @deprecated Use {@link (Stack:class).getActiveComponentItem} */\n getActiveContentItem(): ContentItem | null {\n return this.getActiveComponentItem() ?? null;\n }\n\n getActiveComponentItem(): ComponentItem | undefined {\n return this._activeComponentItem;\n }\n\n /** @internal */\n focusActiveContentItem(): void {\n this._activeComponentItem?.focus();\n }\n\n /** @internal */\n override setFocusedValue(value: boolean): void {\n this._header.applyFocusedValue(value);\n super.setFocusedValue(value);\n }\n\n /** @internal */\n setRowColumnClosable(value: boolean): void {\n this._header.setRowColumnClosable(value);\n }\n\n newComponent(componentType: JsonValue, componentState?: JsonValue, title?: string, index?: number): ComponentItem {\n const itemConfig: ComponentItemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n return this.newItem(itemConfig, index) as ComponentItem;\n }\n\n addComponent(componentType: JsonValue, componentState?: JsonValue, title?: string, index?: number): number {\n const itemConfig: ComponentItemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n return this.addItem(itemConfig, index);\n }\n\n newItem(itemConfig: ComponentItemConfig, index?: number): ContentItem {\n index = this.addItem(itemConfig, index);\n return this.contentItems[index];\n }\n\n addItem(itemConfig: ComponentItemConfig, index?: number): number {\n this.layoutManager.checkMinimiseMaximisedStack();\n\n const resolvedItemConfig = ItemConfig.resolve(itemConfig, false);\n const contentItem = this.layoutManager.createAndInitContentItem(resolvedItemConfig, this);\n return this.addChild(contentItem, index);\n }\n\n override addChild(contentItem: ContentItem, index?: number, focus = false): number {\n if(index !== undefined && index > this.contentItems.length){\n index -= 1;\n throw new AssertError('SAC99728'); // undisplayChild() removed so this condition should no longer occur\n }\n\n if (!(contentItem instanceof ComponentItem)) {\n throw new AssertError('SACC88532'); // Stacks can only have Component children\n } else {\n index = super.addChild(contentItem, index);\n this._childElementContainer.appendChild(contentItem.element);\n this._header.createTab(contentItem, index);\n this.setActiveComponentItem(contentItem, focus);\n this._header.updateTabSizes();\n this.updateSize(false);\n contentItem.container.setBaseLogicalZIndex();\n this._header.updateClosability();\n this.emitStateChangedEvent();\n return index;\n }\n }\n\n override removeChild(contentItem: ContentItem, keepChild: boolean): void {\n const componentItem = contentItem as ComponentItem;\n const index = this.contentItems.indexOf(componentItem);\n const stackWillBeDeleted = this.contentItems.length === 1;\n\n if (this._activeComponentItem === componentItem) {\n if (componentItem.focused) {\n componentItem.blur();\n }\n if (!stackWillBeDeleted) {\n // At this point we're already sure we have at least one content item left *after*\n // removing contentItem, so we can safely assume index 1 is a valid one if\n // the index of contentItem is 0, otherwise we just use the previous content item.\n const newActiveComponentIdx = index === 0 ? 1 : index - 1;\n this.setActiveComponentItem(this.contentItems[newActiveComponentIdx] as ComponentItem, false);\n }\n }\n\n this._header.removeTab(componentItem);\n\n super.removeChild(componentItem, keepChild);\n\n if (!stackWillBeDeleted) {\n this._header.updateClosability();\n }\n\n this.emitStateChangedEvent();\n }\n\n /**\n * Maximises the Item or minimises it if it is already maximised\n */\n toggleMaximise(): void {\n if (this.isMaximised) {\n this.minimise();\n } else {\n this.maximise();\n }\n }\n\n maximise(): void {\n if (!this.isMaximised) {\n this.layoutManager.setMaximisedStack(this);\n const contentItems = this.contentItems;\n const contentItemCount = contentItems.length;\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (contentItem instanceof ComponentItem) {\n contentItem.enterStackMaximised();\n } else {\n throw new AssertError('SMAXI87773');\n }\n }\n this.emitStateChangedEvent();\n }\n }\n\n minimise(): void {\n if (this.isMaximised) {\n this.layoutManager.setMaximisedStack(undefined);\n const contentItems = this.contentItems;\n const contentItemCount = contentItems.length;\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (contentItem instanceof ComponentItem) {\n contentItem.exitStackMaximised();\n } else {\n throw new AssertError('SMINI87773');\n }\n }\n this.emitStateChangedEvent();\n }\n }\n\n /** @internal */\n override destroy(): void {\n if (this._activeComponentItem?.focused) {\n this._activeComponentItem.blur();\n }\n super.destroy();\n this.off('resize', this._resizeListener);\n if (this._maximisedEnabled) {\n this.off('maximised', this._maximisedListener);\n this.off('minimised', this._minimisedListener);\n }\n this._header.destroy();\n }\n\n toConfig(): ResolvedStackItemConfig {\n let activeItemIndex: number | undefined;\n if (this._activeComponentItem) {\n activeItemIndex = this.contentItems.indexOf(this._activeComponentItem);\n if (activeItemIndex < 0) {\n throw new Error('active component item not found in stack');\n }\n }\n if (this.contentItems.length > 0 && activeItemIndex === undefined) {\n throw new Error('expected non-empty stack to have an active component item');\n } else {\n const result: ResolvedStackItemConfig = {\n type: 'stack',\n content: this.calculateConfigContent() as ResolvedComponentItemConfig[],\n size: this.size,\n sizeUnit: this.sizeUnit,\n minSize: this.minSize,\n minSizeUnit: this.minSizeUnit,\n id: this.id,\n isClosable: this.isClosable,\n maximised: this.isMaximised,\n header: this.createHeaderConfig(),\n activeItemIndex,\n }\n return result;\n }\n }\n\n /**\n * Ok, this one is going to be the tricky one: The user has dropped a {@link (ContentItem:class)} onto this stack.\n *\n * It was dropped on either the stacks header or the top, right, bottom or left bit of the content area\n * (which one of those is stored in this._dropSegment). Now, if the user has dropped on the header the case\n * is relatively clear: We add the item to the existing stack... job done (might be good to have\n * tab reordering at some point, but lets not sweat it right now)\n *\n * If the item was dropped on the content part things are a bit more complicated. If it was dropped on either the\n * top or bottom region we need to create a new column and place the items accordingly.\n * Unless, of course if the stack is already within a column... in which case we want\n * to add the newly created item to the existing column...\n * either prepend or append it, depending on wether its top or bottom.\n *\n * Same thing for rows and left / right drop segments... so in total there are 9 things that can potentially happen\n * (left, top, right, bottom) * is child of the right parent (row, column) + header drop\n *\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n override onDrop(contentItem: ContentItem, area: ContentItem.Area): void {\n /*\n * The item was dropped on the header area. Just add it as a child of this stack and\n * get the hell out of this logic\n */\n if (this._dropSegment === Stack.Segment.Header) {\n this.resetHeaderDropZone();\n if (this._dropIndex === undefined) {\n throw new UnexpectedUndefinedError('SODDI68990');\n } else {\n this.addChild(contentItem, this._dropIndex);\n return;\n }\n }\n\n /*\n * The stack is empty. Let's just add the element.\n */\n if (this._dropSegment === Stack.Segment.Body) {\n this.addChild(contentItem, 0, true);\n return;\n }\n\n /*\n * The item was dropped on the top-, left-, bottom- or right- part of the content. Let's\n * aggregate some conditions to make the if statements later on more readable\n */\n const isVertical = this._dropSegment === Stack.Segment.Top || this._dropSegment === Stack.Segment.Bottom;\n const isHorizontal = this._dropSegment === Stack.Segment.Left || this._dropSegment === Stack.Segment.Right;\n const insertBefore = this._dropSegment === Stack.Segment.Top || this._dropSegment === Stack.Segment.Left;\n const hasCorrectParent = (isVertical && this.stackParent.isColumn) || (isHorizontal && this.stackParent.isRow);\n\n /*\n * The content item can be either a component or a stack. If it is a component, wrap it into a stack\n */\n if (contentItem.isComponent) {\n const itemConfig = ResolvedStackItemConfig.createDefault();\n itemConfig.header = this.createHeaderConfig();\n const stack = this.layoutManager.createAndInitContentItem(itemConfig, this);\n stack.addChild(contentItem);\n contentItem = stack;\n }\n\n\n /*\n * If the contentItem that's being dropped is not dropped on a Stack (cases which just passed above and\n * which would wrap the contentItem in a Stack) we need to check whether contentItem is a RowOrColumn.\n * If it is, we need to re-wrap it in a Stack like it was when it was dragged by its Tab (it was dragged!).\n */\n if(contentItem.type === ItemType.row || contentItem.type === ItemType.column){\n const itemConfig = ResolvedStackItemConfig.createDefault();\n itemConfig.header = this.createHeaderConfig();\n const stack = this.layoutManager.createContentItem(itemConfig, this);\n stack.addChild(contentItem)\n contentItem = stack\n }\n\n /*\n * If the item is dropped on top or bottom of a column or left and right of a row, it's already\n * layd out in the correct way. Just add it as a child\n */\n if (hasCorrectParent) {\n const index = this.stackParent.contentItems.indexOf(this);\n this.stackParent.addChild(contentItem, insertBefore ? index : index + 1, true);\n this.size *= 0.5;\n contentItem.size = this.size;\n contentItem.sizeUnit = this.sizeUnit;\n this.stackParent.updateSize(false);\n /*\n * This handles items that are dropped on top or bottom of a row or left / right of a column. We need\n * to create the appropriate contentItem for them to live in\n */\n } else {\n const type = isVertical ? ItemType.column : ItemType.row;\n const itemConfig = ResolvedItemConfig.createDefault(type) as ResolvedItemConfig;\n const rowOrColumn = this.layoutManager.createContentItem(itemConfig, this);\n this.stackParent.replaceChild(this, rowOrColumn);\n\n rowOrColumn.addChild(contentItem, insertBefore ? 0 : undefined, true);\n rowOrColumn.addChild(this, insertBefore ? undefined : 0, true);\n\n this.size = 50;\n contentItem.size = 50;\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n rowOrColumn.updateSize(false);\n }\n }\n\n /**\n * If the user hovers above the header part of the stack, indicate drop positions for tabs.\n * otherwise indicate which segment of the body the dragged item would be dropped on\n *\n * @param x - Absolute Screen X\n * @param y - Absolute Screen Y\n * @internal\n */\n override highlightDropZone(x: number, y: number): void {\n for (const key in this._contentAreaDimensions) {\n const segment = key as Stack.Segment;\n const area = this._contentAreaDimensions[segment].hoverArea;\n\n if (area.x1 < x && area.x2 > x && area.y1 < y && area.y2 > y) {\n\n if (segment === Stack.Segment.Header) {\n this._dropSegment = Stack.Segment.Header;\n this.highlightHeaderDropZone(this._header.leftRightSided ? y : x);\n } else {\n this.resetHeaderDropZone();\n this.highlightBodyDropZone(segment);\n }\n\n return;\n }\n }\n }\n\n /** @internal */\n getArea(): ContentItem.Area | null {\n if (this.element.style.display === 'none') {\n return null;\n }\n\n const headerArea = super.getElementArea(this._header.element);\n const contentArea = super.getElementArea(this._childElementContainer);\n if (headerArea === null || contentArea === null) {\n throw new UnexpectedNullError('SGAHC13086');\n }\n const contentWidth = contentArea.x2 - contentArea.x1;\n const contentHeight = contentArea.y2 - contentArea.y1;\n\n this._contentAreaDimensions = {\n header: {\n hoverArea: {\n x1: headerArea.x1,\n y1: headerArea.y1,\n x2: headerArea.x2,\n y2: headerArea.y2\n },\n highlightArea: {\n x1: headerArea.x1,\n y1: headerArea.y1,\n x2: headerArea.x2,\n y2: headerArea.y2\n }\n }\n };\n\n /**\n * Highlight the entire body if the stack is empty\n */\n if (this.contentItems.length === 0) {\n\n this._contentAreaDimensions.body = {\n hoverArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y2\n },\n highlightArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y2\n }\n };\n\n return super.getElementArea(this.element);\n } else {\n this._contentAreaDimensions.left = {\n hoverArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x1 + contentWidth * 0.25,\n y2: contentArea.y2\n },\n highlightArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x1 + contentWidth * 0.5,\n y2: contentArea.y2\n }\n };\n\n this._contentAreaDimensions.top = {\n hoverArea: {\n x1: contentArea.x1 + contentWidth * 0.25,\n y1: contentArea.y1,\n x2: contentArea.x1 + contentWidth * 0.75,\n y2: contentArea.y1 + contentHeight * 0.5\n },\n highlightArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y1 + contentHeight * 0.5\n }\n };\n\n this._contentAreaDimensions.right = {\n hoverArea: {\n x1: contentArea.x1 + contentWidth * 0.75,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y2\n },\n highlightArea: {\n x1: contentArea.x1 + contentWidth * 0.5,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y2\n }\n };\n\n this._contentAreaDimensions.bottom = {\n hoverArea: {\n x1: contentArea.x1 + contentWidth * 0.25,\n y1: contentArea.y1 + contentHeight * 0.5,\n x2: contentArea.x1 + contentWidth * 0.75,\n y2: contentArea.y2\n },\n highlightArea: {\n x1: contentArea.x1,\n y1: contentArea.y1 + contentHeight * 0.5,\n x2: contentArea.x2,\n y2: contentArea.y2\n }\n };\n\n return super.getElementArea(this.element);\n }\n }\n\n /**\n * Programmatically operate with header position.\n *\n * @param position -\n *\n * @returns previous header position\n * @internal\n */\n positionHeader(position: Side): void {\n if (this._header.side !== position) {\n this._header.setSide(position);\n this._headerSideChanged = true;\n this.setupHeaderPosition();\n }\n }\n\n /** @internal */\n private updateNodeSize(): void {\n if (this.element.style.display !== 'none') {\n const content: WidthAndHeight = getElementWidthAndHeight(this.element);\n\n if (this._header.show) {\n const dimension = this._header.leftRightSided ? WidthOrHeightPropertyName.width : WidthOrHeightPropertyName.height;\n content[dimension] -= this.layoutManager.layoutConfig.dimensions.headerHeight;\n }\n this._childElementContainer.style.width = numberToPixels(content.width);\n this._childElementContainer.style.height = numberToPixels(content.height);\n for (let i = 0; i < this.contentItems.length; i++) {\n this.contentItems[i].element.style.width = numberToPixels(content.width);\n this.contentItems[i].element.style.height = numberToPixels(content.height);\n }\n this.emit('resize');\n this.emitStateChangedEvent();\n }\n }\n\n /** @internal */\n private highlightHeaderDropZone(x: number): void {\n const visibleTabsLength = this._header.lastVisibleTabIndex + 1;\n const tabsContainerElement = this._header.tabsContainerElement;\n const tabsContainerElementChildNodes = tabsContainerElement.childNodes;\n\n // Create shallow copy of childNodes list, excluding DropPlaceHolder, as we will be modifying the childNodes list\n const visibleTabElements = new Array(visibleTabsLength);\n let tabIndex = 0;\n let tabCount = 0;\n while (tabCount < visibleTabsLength) {\n const visibleTabElement = tabsContainerElementChildNodes[tabIndex++] as HTMLElement;\n if (visibleTabElement !== this.layoutManager.tabDropPlaceholder) {\n visibleTabElements[tabCount++] = visibleTabElement;\n }\n }\n\n const dropTargetIndicator = this.layoutManager.dropTargetIndicator;\n if (dropTargetIndicator === null) {\n throw new UnexpectedNullError('SHHDZDTI97110');\n }\n\n let area: AreaLinkedRect;\n\n // Empty stack\n if (visibleTabsLength === 0) {\n const headerRect = this._header.element.getBoundingClientRect();\n const headerTop = headerRect.top + document.body.scrollTop;\n const headerLeft = headerRect.left + document.body.scrollLeft;\n\n area = {\n x1: headerLeft,\n x2: headerLeft + 100,\n y1: headerTop + headerRect.height - 20,\n y2: headerTop + headerRect.height,\n };\n\n this._dropIndex = 0;\n } else {\n let tabIndex = 0;\n // This indicates whether our cursor is exactly over a tab\n let isAboveTab = false;\n let tabTop: number;\n let tabLeft: number;\n let tabWidth: number;\n let tabElement: HTMLElement;\n do {\n tabElement = visibleTabElements[tabIndex] as HTMLElement;\n const tabRect = tabElement.getBoundingClientRect();\n const tabRectTop = tabRect.top + document.body.scrollTop;\n const tabRectLeft = tabRect.left + document.body.scrollLeft;\n\n if (this._header.leftRightSided) {\n tabLeft = tabRectTop;\n tabTop = tabRectLeft;\n tabWidth = tabRect.height;\n } else {\n tabLeft = tabRectLeft;\n tabTop = tabRectTop;\n tabWidth = tabRect.width;\n }\n\n if (x >= tabLeft && x < tabLeft + tabWidth) {\n isAboveTab = true;\n } else {\n tabIndex++;\n }\n } while (tabIndex < visibleTabsLength && !isAboveTab);\n\n // If we're not above any tabs, or to the right of any tab, we are out of the area, so give up\n if (isAboveTab === false && x < tabLeft) {\n return;\n }\n\n const halfX = tabLeft + tabWidth / 2;\n\n if (x < halfX) {\n this._dropIndex = tabIndex;\n tabElement.insertAdjacentElement('beforebegin', this.layoutManager.tabDropPlaceholder);\n } else {\n this._dropIndex = Math.min(tabIndex + 1, visibleTabsLength);\n tabElement.insertAdjacentElement('afterend', this.layoutManager.tabDropPlaceholder);\n }\n\n const tabDropPlaceholderRect = this.layoutManager.tabDropPlaceholder.getBoundingClientRect();\n const tabDropPlaceholderRectTop = tabDropPlaceholderRect.top + document.body.scrollTop;\n const tabDropPlaceholderRectLeft = tabDropPlaceholderRect.left + document.body.scrollLeft;\n const tabDropPlaceholderRectWidth = tabDropPlaceholderRect.width;\n\n if (this._header.leftRightSided) {\n const placeHolderTop = tabDropPlaceholderRectTop;\n area = {\n x1: tabTop,\n x2: tabTop + tabElement.clientHeight,\n y1: placeHolderTop,\n y2: placeHolderTop + tabDropPlaceholderRectWidth,\n };\n } else {\n const placeHolderLeft = tabDropPlaceholderRectLeft;\n\n area = {\n x1: placeHolderLeft,\n x2: placeHolderLeft + tabDropPlaceholderRectWidth,\n y1: tabTop,\n y2: tabTop + tabElement.clientHeight,\n };\n }\n }\n\n dropTargetIndicator.highlightArea(area, 0);\n return;\n }\n\n /** @internal */\n private resetHeaderDropZone() {\n this.layoutManager.tabDropPlaceholder.remove();\n }\n\n /** @internal */\n private setupHeaderPosition() {\n setElementDisplayVisibility(this._header.element, this._header.show);\n this.element.classList.remove(DomConstants.ClassName.Left, DomConstants.ClassName.Right, DomConstants.ClassName.Bottom);\n if (this._header.leftRightSided) {\n this.element.classList.add('lm_' + this._header.side);\n }\n\n //if ([Side.right, Side.bottom].includes(this._header.side)) {\n // // move the header behind the content.\n // this.element.appendChild(this._header.element);\n //}\n this.updateSize(false);\n }\n\n /** @internal */\n private highlightBodyDropZone(segment: Stack.Segment): void {\n if (this._contentAreaDimensions === undefined) {\n throw new UnexpectedUndefinedError('SHBDZC82265');\n } else {\n const highlightArea = this._contentAreaDimensions[segment].highlightArea;\n const dropTargetIndicator = this.layoutManager.dropTargetIndicator;\n if (dropTargetIndicator === null) {\n throw new UnexpectedNullError('SHBDZD96110');\n } else {\n dropTargetIndicator.highlightArea(highlightArea, 1);\n this._dropSegment = segment;\n }\n }\n }\n\n /** @internal */\n private handleResize() {\n this._header.updateTabSizes()\n }\n\n /** @internal */\n private handleMaximised() {\n this._header.processMaximised();\n }\n\n /** @internal */\n private handleMinimised() {\n this._header.processMinimised();\n }\n\n /** @internal */\n private handlePopoutEvent() {\n this.popout();\n }\n\n /** @internal */\n private handleHeaderClickEvent(ev: MouseEvent) {\n const eventName = EventEmitter.headerClickEventName;\n const bubblingEvent = new EventEmitter.ClickBubblingEvent(eventName, this, ev);\n this.emit(eventName, bubblingEvent);\n }\n\n /** @internal */\n private handleHeaderTouchStartEvent(ev: TouchEvent) {\n const eventName = EventEmitter.headerTouchStartEventName;\n const bubblingEvent = new EventEmitter.TouchStartBubblingEvent(eventName, this, ev);\n this.emit(eventName, bubblingEvent);\n }\n\n /** @internal */\n private handleHeaderComponentRemoveEvent(item: ComponentItem) {\n this.removeChild(item, false);\n }\n\n /** @internal */\n private handleHeaderComponentFocusEvent(item: ComponentItem) {\n this.setActiveComponentItem(item, true);\n }\n\n /** @internal */\n private handleHeaderComponentStartDragEvent(x: number, y: number, dragListener: DragListener, componentItem: ComponentItem) {\n if (this.isMaximised === true) {\n this.toggleMaximise();\n }\n this.layoutManager.startComponentDrag(x, y, dragListener, componentItem, this);\n }\n\n /** @internal */\n private createHeaderConfig() {\n if (!this._headerSideChanged) {\n return ResolvedHeaderedItemConfig.Header.createCopy(this._headerConfig);\n } else {\n const show = this._header.show ? this._header.side : false;\n\n let result = ResolvedHeaderedItemConfig.Header.createCopy(this._headerConfig, show);\n if (result === undefined) {\n result = {\n show,\n popout: undefined,\n maximise: undefined,\n close: undefined,\n minimise: undefined,\n tabDropdown: undefined,\n };\n }\n return result;\n }\n }\n\n /** @internal */\n private emitStateChangedEvent() {\n this.emitBaseBubblingEvent('stateChanged');\n }\n}\n\n/** @public */\nexport namespace Stack {\n /** @internal */\n export const enum Segment {\n Header = 'header',\n Body = 'body',\n Left = 'left',\n Right = 'right',\n Top = 'top',\n Bottom = 'bottom',\n }\n\n /** @internal */\n export interface ContentAreaDimension {\n hoverArea: AreaLinkedRect;\n highlightArea: AreaLinkedRect;\n }\n\n /** @internal */\n export type ContentAreaDimensions = {\n [segment: string]: ContentAreaDimension;\n };\n\n /** @internal */\n export function createElement(document: Document): HTMLDivElement {\n const element = document.createElement('div');\n element.classList.add(DomConstants.ClassName.Item);\n element.classList.add(DomConstants.ClassName.Stack);\n return element;\n }\n}\n","import { UnexpectedNullError, UnexpectedUndefinedError } from '../errors/internal-error';\nimport { ComponentItem } from '../items/component-item';\nimport { ContentItem } from '../items/content-item';\nimport { Stack } from '../items/stack';\nimport { LayoutManager } from '../layout-manager';\nimport { DomConstants } from '../utils/dom-constants';\nimport { DragListener } from '../utils/drag-listener';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { Side } from '../utils/types';\nimport {\n numberToPixels\n} from '../utils/utils';\n\n/**\n * This class creates a temporary container\n * for the component whilst it is being dragged\n * and handles drag events\n * @internal\n */\nexport class DragProxy extends EventEmitter {\n private _area: ContentItem.Area | null = null;\n private _lastValidArea: ContentItem.Area | null = null;\n private _minX: number;\n private _minY: number;\n private _maxX: number;\n private _maxY: number;\n private _sided: boolean;\n private _element: HTMLElement;\n private _proxyContainerElement: HTMLElement;\n private _componentItemFocused: boolean;\n\n get element(): HTMLElement { return this._element; }\n\n /**\n * @param x - The initial x position\n * @param y - The initial y position\n * @internal\n */\n constructor(x: number, y: number,\n private readonly _dragListener: DragListener,\n private readonly _layoutManager: LayoutManager,\n private readonly _componentItem: ComponentItem,\n private readonly _originalParent: ContentItem) {\n\n super();\n\n this._dragListener.on('drag', (offsetX, offsetY, event) => this.onDrag(offsetX, offsetY, event));\n this._dragListener.on('dragStop', () => this.onDrop());\n\n this.createDragProxyElements(x, y);\n\n if (this._componentItem.parent === null) {\n // Note that _contentItem will have dummy GroundItem as parent if initiated by a external drag source\n throw new UnexpectedNullError('DPC10097');\n }\n\n this._componentItemFocused = this._componentItem.focused;\n if (this._componentItemFocused) {\n this._componentItem.blur();\n }\n this._componentItem.parent.removeChild(this._componentItem, true);\n\n this.setDimensions();\n\n document.body.appendChild(this._element);\n\n this.determineMinMaxXY();\n this._layoutManager.calculateItemAreas();\n this.setDropPosition(x, y);\n }\n\n /** Create Stack-like structure to contain the dragged component */\n private createDragProxyElements(initialX: number, initialY: number): void {\n this._element = document.createElement('div');\n this._element.classList.add(DomConstants.ClassName.DragProxy);\n const headerElement = document.createElement('div');\n headerElement.classList.add(DomConstants.ClassName.Header);\n const tabsElement = document.createElement('div');\n tabsElement.classList.add(DomConstants.ClassName.Tabs);\n const tabElement = document.createElement('div');\n tabElement.classList.add(DomConstants.ClassName.Tab);\n const titleElement = document.createElement('span');\n titleElement.classList.add(DomConstants.ClassName.Title);\n tabElement.appendChild(titleElement);\n tabsElement.appendChild(tabElement);\n headerElement.appendChild(tabsElement);\n\n this._proxyContainerElement = document.createElement('div');\n this._proxyContainerElement.classList.add(DomConstants.ClassName.Content);\n\n this._element.appendChild(headerElement);\n this._element.appendChild(this._proxyContainerElement);\n\n if (this._originalParent instanceof Stack && this._originalParent.headerShow) {\n this._sided = this._originalParent.headerLeftRightSided;\n this._element.classList.add('lm_' + this._originalParent.headerSide);\n if ([Side.right, Side.bottom].indexOf(this._originalParent.headerSide) >= 0) {\n this._proxyContainerElement.insertAdjacentElement('afterend', headerElement);\n }\n }\n this._element.style.left = numberToPixels(initialX);\n this._element.style.top = numberToPixels(initialY);\n tabElement.setAttribute('title', this._componentItem.title);\n titleElement.insertAdjacentText('afterbegin', this._componentItem.title);\n this._proxyContainerElement.appendChild(this._componentItem.element);\n }\n\n private determineMinMaxXY(): void {\n const groundItem = this._layoutManager.groundItem;\n if (groundItem === undefined) {\n throw new UnexpectedUndefinedError('DPDMMXY73109');\n } else {\n const groundElement = groundItem.element;\n const rect = groundElement.getBoundingClientRect();\n this._minX = rect.left + document.body.scrollLeft;\n this._minY = rect.top + document.body.scrollTop;\n this._maxX = this._minX + rect.width;\n this._maxY = this._minY + rect.height;\n }\n }\n\n /**\n * Callback on every mouseMove event during a drag. Determines if the drag is\n * still within the valid drag area and calls the layoutManager to highlight the\n * current drop area\n *\n * @param offsetX - The difference from the original x position in px\n * @param offsetY - The difference from the original y position in px\n * @param event -\n * @internal\n */\n private onDrag(offsetX: number, offsetY: number, event: PointerEvent) {\n\n const x = event.pageX;\n const y = event.pageY;\n\n this.setDropPosition(x, y);\n this._componentItem.drag();\n }\n\n /**\n * Sets the target position, highlighting the appropriate area\n *\n * @param x - The x position in px\n * @param y - The y position in px\n *\n * @internal\n */\n private setDropPosition(x: number, y: number): void {\n if (this._layoutManager.layoutConfig.settings.constrainDragToContainer) {\n if (x <= this._minX) {\n x = Math.ceil(this._minX);\n } else if (x >= this._maxX) {\n x = Math.floor(this._maxX);\n }\n\n if (y <= this._minY) {\n y = Math.ceil(this._minY);\n } else if (y >= this._maxY) {\n y = Math.floor(this._maxY);\n }\n }\n\n this._element.style.left = numberToPixels(x);\n this._element.style.top = numberToPixels(y);\n this._area = this._layoutManager.getArea(x, y);\n\n if (this._area !== null) {\n this._lastValidArea = this._area;\n this._area.contentItem.highlightDropZone(x, y, this._area);\n }\n }\n\n /**\n * Callback when the drag has finished. Determines the drop area\n * and adds the child to it\n * @internal\n */\n private onDrop(): void {\n const dropTargetIndicator = this._layoutManager.dropTargetIndicator;\n if (dropTargetIndicator === null) {\n throw new UnexpectedNullError('DPOD30011');\n } else {\n dropTargetIndicator.hide();\n }\n\n this._componentItem.exitDragMode();\n\n /*\n * Valid drop area found\n */\n let droppedComponentItem: ComponentItem | undefined;\n if (this._area !== null) {\n droppedComponentItem = this._componentItem;\n this._area.contentItem.onDrop(droppedComponentItem, this._area);\n\n /**\n * No valid drop area available at present, but one has been found before.\n * Use it\n */\n } else if (this._lastValidArea !== null) {\n droppedComponentItem = this._componentItem;\n const newParentContentItem = this._lastValidArea.contentItem;\n newParentContentItem.onDrop(droppedComponentItem, this._lastValidArea);\n\n /**\n * No valid drop area found during the duration of the drag. Return\n * content item to its original position if a original parent is provided.\n * (Which is not the case if the drag had been initiated by createDragSource)\n */\n } else if (this._originalParent) {\n droppedComponentItem = this._componentItem;\n this._originalParent.addChild(droppedComponentItem);\n\n /**\n * The drag didn't ultimately end up with adding the content item to\n * any container. In order to ensure clean up happens, destroy the\n * content item.\n */\n } else {\n this._componentItem.destroy(); // contentItem children are now destroyed as well\n }\n\n this._element.remove();\n\n this._layoutManager.emit('itemDropped', this._componentItem);\n\n if (this._componentItemFocused && droppedComponentItem !== undefined) {\n droppedComponentItem.focus();\n }\n }\n\n /**\n * Updates the Drag Proxy's dimensions\n * @internal\n */\n private setDimensions() {\n const dimensions = this._layoutManager.layoutConfig.dimensions;\n if (dimensions === undefined) {\n throw new Error('DragProxy.setDimensions: dimensions undefined');\n }\n\n let width = dimensions.dragProxyWidth;\n let height = dimensions.dragProxyHeight;\n if (width === undefined || height === undefined) {\n throw new Error('DragProxy.setDimensions: width and/or height undefined');\n }\n\n const headerHeight = this._layoutManager.layoutConfig.header.show === false ? 0 : dimensions.headerHeight;\n this._element.style.width = numberToPixels(width);\n this._element.style.height = numberToPixels(height)\n width -= (this._sided ? headerHeight : 0);\n height -= (!this._sided ? headerHeight : 0);\n this._proxyContainerElement.style.width = numberToPixels(width);\n this._proxyContainerElement.style.height = numberToPixels(height);\n this._componentItem.enterDragMode(width, height);\n this._componentItem.show();\n }\n}\n","import { DomConstants } from '../utils/dom-constants';\nimport { DragListener } from '../utils/drag-listener';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { numberToPixels } from '../utils/utils';\n\n/** @internal */\nexport class Splitter {\n private _grabSize;\n private _dragListener: DragListener;\n\n private readonly _element: HTMLDivElement;\n\n get element(): HTMLDivElement { return this._element; }\n\n constructor(private _isVertical: boolean, private _size: number, grabSize: number) {\n this._grabSize = grabSize < this._size ? this._size : grabSize;\n\n this._element = document.createElement('div');\n this._element.classList.add(DomConstants.ClassName.Splitter);\n const dragHandleElement = document.createElement('div');\n dragHandleElement.classList.add(DomConstants.ClassName.DragHandle);\n\n const handleExcessSize = this._grabSize - this._size;\n const handleExcessPos = handleExcessSize / 2;\n\n if (this._isVertical) {\n dragHandleElement.style.top = numberToPixels(-handleExcessPos);\n dragHandleElement.style.height = numberToPixels(this._size + handleExcessSize);\n this._element.classList.add(DomConstants.ClassName.Vertical);\n this._element.style.height = numberToPixels(this._size);\n } else {\n dragHandleElement.style.left = numberToPixels(-handleExcessPos);\n dragHandleElement.style.width = numberToPixels(this._size + handleExcessSize);\n this._element.classList.add(DomConstants.ClassName.Horizontal);\n this._element.style.width = numberToPixels(this._size);\n }\n\n this._element.appendChild(dragHandleElement);\n\n this._dragListener = new DragListener(this._element, [dragHandleElement]);\n }\n\n destroy(): void {\n this._element.remove();\n }\n\n on(eventName: K, callback: EventEmitter.Callback): void {\n this._dragListener.on(eventName, callback);\n }\n}\n","import { ComponentItemConfig, ItemConfig, RowOrColumnItemConfig, StackItemConfig } from '../config/config'\nimport { ResolvedRowOrColumnItemConfig, ResolvedStackItemConfig } from '../config/resolved-config'\nimport { Splitter } from '../controls/splitter'\nimport { AssertError, UnexpectedNullError } from '../errors/internal-error'\nimport { LayoutManager } from '../layout-manager'\nimport { DomConstants } from '../utils/dom-constants'\nimport { ItemType, JsonValue, SizeUnitEnum, WidthOrHeightPropertyName } from '../utils/types'\nimport {\n getElementHeight,\n getElementWidth,\n getElementWidthAndHeight,\n numberToPixels,\n pixelsToNumber,\n setElementHeight,\n setElementWidth\n} from \"../utils/utils\"\nimport { ComponentItem } from './component-item'\nimport { ContentItem } from './content-item'\n\n/** @public */\nexport class RowOrColumn extends ContentItem {\n /** @internal */\n private readonly _childElementContainer: HTMLElement;\n /** @internal */\n private readonly _configType: 'row' | 'column';\n /** @internal */\n private readonly _isColumn: boolean;\n /** @internal */\n private readonly _splitterSize: number;\n /** @internal */\n private readonly _splitterGrabSize: number;\n /** @internal */\n private readonly _dimension: WidthOrHeightPropertyName;\n /** @internal */\n private readonly _splitter: Splitter[] = [];\n /** @internal */\n private _splitterPosition: number | null;\n /** @internal */\n private _splitterMinPosition: number | null;\n /** @internal */\n private _splitterMaxPosition: number | null;\n\n /** @internal */\n constructor(isColumn: boolean, layoutManager: LayoutManager, config: ResolvedRowOrColumnItemConfig,\n /** @internal */\n private _rowOrColumnParent: ContentItem\n ) {\n super(layoutManager, config, _rowOrColumnParent, RowOrColumn.createElement(document, isColumn));\n\n this.isRow = !isColumn;\n this.isColumn = isColumn;\n\n this._childElementContainer = this.element;\n this._splitterSize = layoutManager.layoutConfig.dimensions.borderWidth;\n this._splitterGrabSize = layoutManager.layoutConfig.dimensions.borderGrabWidth;\n this._isColumn = isColumn;\n this._dimension = isColumn ? 'height' : 'width';\n this._splitterPosition = null;\n this._splitterMinPosition = null;\n this._splitterMaxPosition = null;\n\n switch (config.type) {\n case ItemType.row:\n case ItemType.column:\n this._configType = config.type;\n break;\n default:\n throw new AssertError('ROCCCT00925');\n }\n }\n\n newComponent(componentType: JsonValue, componentState?: JsonValue, title?: string, index?: number): ComponentItem {\n const itemConfig: ComponentItemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n return this.newItem(itemConfig, index) as ComponentItem;\n }\n\n addComponent(componentType: JsonValue, componentState?: JsonValue, title?: string, index?: number): number {\n const itemConfig: ComponentItemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n return this.addItem(itemConfig, index);\n }\n\n newItem(itemConfig: RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig, index?: number): ContentItem {\n index = this.addItem(itemConfig, index);\n const createdItem = this.contentItems[index];\n\n if (ContentItem.isStack(createdItem) && (ItemConfig.isComponent(itemConfig))) {\n // createdItem is a Stack which was created to hold wanted component. Return component\n return createdItem.contentItems[0];\n } else {\n return createdItem;\n }\n }\n\n addItem(itemConfig: RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig,\n index?: number\n ): number {\n this.layoutManager.checkMinimiseMaximisedStack();\n const resolvedItemConfig = ItemConfig.resolve(itemConfig, false);\n const contentItem = this.layoutManager.createAndInitContentItem(resolvedItemConfig, this);\n return this.addChild(contentItem, index, false);\n }\n\n /**\n * Add a new contentItem to the Row or Column\n *\n * @param contentItem -\n * @param index - The position of the new item within the Row or Column.\n * If no index is provided the item will be added to the end\n * @param suspendResize - If true the items won't be resized. This will leave the item in\n * an inconsistent state and is only intended to be used if multiple\n * children need to be added in one go and resize is called afterwards\n *\n * @returns\n */\n override addChild(contentItem: ContentItem, index?: number, suspendResize?: boolean): number {\n\n // contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);\n\n if (index === undefined) {\n index = this.contentItems.length;\n }\n\n if (this.contentItems.length > 0) {\n const splitterElement = this.createSplitter(Math.max(0, index - 1)).element;\n\n if (index > 0) {\n this.contentItems[index - 1].element.insertAdjacentElement('afterend', splitterElement);\n splitterElement.insertAdjacentElement('afterend', contentItem.element);\n } else {\n this.contentItems[0].element.insertAdjacentElement('beforebegin', splitterElement);\n splitterElement.insertAdjacentElement('beforebegin', contentItem.element);\n }\n } else {\n this._childElementContainer.appendChild(contentItem.element);\n }\n\n super.addChild(contentItem, index);\n\n const newItemSize = (1 / this.contentItems.length) * 100;\n\n if (suspendResize === true) {\n this.emitBaseBubblingEvent('stateChanged');\n return index;\n }\n\n for (let i = 0; i < this.contentItems.length; i++) {\n const indexedContentItem = this.contentItems[i];\n if (indexedContentItem === contentItem) {\n contentItem.size = newItemSize;\n } else {\n const itemSize = indexedContentItem.size *= (100 - newItemSize) / 100;\n indexedContentItem.size = itemSize;\n }\n }\n\n this.updateSize(false);\n this.emitBaseBubblingEvent('stateChanged');\n\n return index;\n }\n\n /**\n * Removes a child of this element\n *\n * @param contentItem -\n * @param keepChild - If true the child will be removed, but not destroyed\n *\n */\n override removeChild(contentItem: ContentItem, keepChild: boolean): void {\n const index = this.contentItems.indexOf(contentItem);\n const splitterIndex = Math.max(index - 1, 0);\n\n if (index === -1) {\n throw new Error('Can\\'t remove child. ContentItem is not child of this Row or Column');\n }\n\n /**\n * Remove the splitter before the item or after if the item happens\n * to be the first in the row/column\n */\n if (this._splitter[splitterIndex]) {\n this._splitter[splitterIndex].destroy();\n this._splitter.splice(splitterIndex, 1);\n }\n\n super.removeChild(contentItem, keepChild);\n\n if (this.contentItems.length === 1 && this.isClosable === true) {\n const childItem = this.contentItems[0];\n this.contentItems.length = 0;\n this._rowOrColumnParent.replaceChild(this, childItem, true);\n } else {\n this.updateSize(false);\n this.emitBaseBubblingEvent('stateChanged');\n }\n }\n\n /**\n * Replaces a child of this Row or Column with another contentItem\n */\n override replaceChild(oldChild: ContentItem, newChild: ContentItem): void {\n const size = oldChild.size;\n super.replaceChild(oldChild, newChild);\n newChild.size = size;\n this.updateSize(false);\n this.emitBaseBubblingEvent('stateChanged');\n }\n\n /**\n * Called whenever the dimensions of this item or one of its parents change\n */\n override updateSize(force: boolean): void {\n this.layoutManager.beginVirtualSizedContainerAdding();\n try {\n this.updateNodeSize();\n this.updateContentItemsSize(force);\n } finally {\n this.layoutManager.endVirtualSizedContainerAdding();\n }\n }\n\n /**\n * Invoked recursively by the layout manager. ContentItem.init appends\n * the contentItem's DOM elements to the container, RowOrColumn init adds splitters\n * in between them\n * @internal\n */\n override init(): void {\n if (this.isInitialised === true) return;\n\n this.updateNodeSize();\n\n for (let i = 0; i < this.contentItems.length; i++) {\n this._childElementContainer.appendChild(this.contentItems[i].element);\n }\n\n super.init();\n\n for (let i = 0; i < this.contentItems.length - 1; i++) {\n this.contentItems[i].element.insertAdjacentElement('afterend', this.createSplitter(i).element);\n }\n\n this.initContentItems();\n }\n\n toConfig(): ResolvedRowOrColumnItemConfig {\n const result: ResolvedRowOrColumnItemConfig = {\n type: this.type as 'row' | 'column',\n content: this.calculateConfigContent() as (ResolvedRowOrColumnItemConfig | ResolvedStackItemConfig)[],\n size: this.size,\n sizeUnit: this.sizeUnit,\n minSize: this.minSize,\n minSizeUnit: this.minSizeUnit,\n id: this.id,\n isClosable: this.isClosable,\n }\n return result;\n }\n\n /** @internal */\n protected override setParent(parent: ContentItem): void {\n this._rowOrColumnParent = parent;\n super.setParent(parent);\n }\n\n /** @internal */\n private updateNodeSize(): void {\n if (this.contentItems.length > 0) {\n this.calculateRelativeSizes();\n this.setAbsoluteSizes();\n }\n this.emitBaseBubblingEvent('stateChanged');\n this.emit('resize');\n }\n\n /**\n * Turns the relative sizes calculated by calculateRelativeSizes into\n * absolute pixel values and applies them to the children's DOM elements\n *\n * Assigns additional pixels to counteract Math.floor\n * @internal\n */\n private setAbsoluteSizes() {\n const absoluteSizes = this.calculateAbsoluteSizes();\n\n for (let i = 0; i < this.contentItems.length; i++) {\n if (absoluteSizes.additionalPixel - i > 0) {\n absoluteSizes.itemSizes[i]++;\n }\n\n if (this._isColumn) {\n setElementWidth(this.contentItems[i].element, absoluteSizes.crossAxisSize);\n setElementHeight(this.contentItems[i].element, absoluteSizes.itemSizes[i]);\n } else {\n setElementWidth(this.contentItems[i].element, absoluteSizes.itemSizes[i]);\n setElementHeight(this.contentItems[i].element, absoluteSizes.crossAxisSize);\n }\n }\n }\n\n /**\n * Calculates the absolute sizes of all of the children of this Item.\n * @returns Set with absolute sizes and additional pixels.\n * @internal\n */\n private calculateAbsoluteSizes(): RowOrColumn.AbsoluteSizes {\n const totalSplitterSize = (this.contentItems.length - 1) * this._splitterSize;\n const { width: elementWidth, height: elementHeight } = getElementWidthAndHeight(this.element);\n\n let totalSize: number;\n let crossAxisSize: number;\n if (this._isColumn) {\n totalSize = elementHeight - totalSplitterSize;\n crossAxisSize = elementWidth;\n } else {\n totalSize = elementWidth - totalSplitterSize;\n crossAxisSize = elementHeight;\n }\n\n let totalAssigned = 0;\n const itemSizes = [];\n\n for (let i = 0; i < this.contentItems.length; i++) {\n const contentItem = this.contentItems[i];\n let itemSize: number;\n if (contentItem.sizeUnit === SizeUnitEnum.Percent) {\n itemSize = Math.floor(totalSize * (contentItem.size / 100));\n } else {\n throw new AssertError('ROCCAS6692');\n }\n\n totalAssigned += itemSize;\n itemSizes.push(itemSize);\n }\n\n const additionalPixel = Math.floor(totalSize - totalAssigned);\n\n return {\n itemSizes,\n additionalPixel,\n totalSize,\n crossAxisSize,\n };\n }\n\n /**\n * Calculates the relative sizes of all children of this Item. The logic\n * is as follows:\n *\n * - Add up the total size of all items that have a configured size\n *\n * - If the total == 100 (check for floating point errors)\n * Excellent, job done\n *\n * - If the total is \\> 100,\n * set the size of items without set dimensions to 1/3 and add this to the total\n * set the size off all items so that the total is hundred relative to their original size\n *\n * - If the total is \\< 100\n * If there are items without set dimensions, distribute the remainder to 100 evenly between them\n * If there are no items without set dimensions, increase all items sizes relative to\n * their original size so that they add up to 100\n *\n * @internal\n */\n private calculateRelativeSizes() {\n\n let total = 0;\n const itemsWithFractionalSize: ContentItem[] = [];\n let totalFractionalSize = 0;\n\n for (let i = 0; i < this.contentItems.length; i++) {\n const contentItem = this.contentItems[i];\n const sizeUnit = contentItem.sizeUnit;\n switch (sizeUnit) {\n case SizeUnitEnum.Percent: {\n total += contentItem.size;\n break;\n }\n case SizeUnitEnum.Fractional: {\n itemsWithFractionalSize.push(contentItem);\n totalFractionalSize += contentItem.size;\n break;\n }\n default:\n throw new AssertError('ROCCRS49110', JSON.stringify(contentItem));\n }\n }\n\n /**\n * Everything adds up to hundred, all good :-)\n */\n if (Math.round(total) === 100) {\n this.respectMinItemSize();\n return;\n } else {\n /**\n * Allocate the remaining size to the items with a fractional size\n */\n if (Math.round(total) < 100 && itemsWithFractionalSize.length > 0) {\n const fractionalAllocatedSize = 100 - total;\n for (let i = 0; i < itemsWithFractionalSize.length; i++) {\n const contentItem = itemsWithFractionalSize[i];\n contentItem.size = fractionalAllocatedSize * (contentItem.size / totalFractionalSize);\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n }\n this.respectMinItemSize();\n return;\n } else {\n\n /**\n * If the total is > 100, but there are also items with a fractional size, assign another 50%\n * to the fractional items\n *\n * This will be reset in the next step\n */\n if (Math.round(total) > 100 && itemsWithFractionalSize.length > 0) {\n for (let i = 0; i < itemsWithFractionalSize.length; i++) {\n const contentItem = itemsWithFractionalSize[i];\n contentItem.size = 50 * (contentItem.size / totalFractionalSize);\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n }\n total += 50;\n }\n\n /**\n * Set every items size relative to 100 relative to its size to total\n */\n for (let i = 0; i < this.contentItems.length; i++) {\n const contentItem = this.contentItems[i];\n contentItem.size = (contentItem.size / total) * 100;\n }\n\n this.respectMinItemSize();\n }\n }\n }\n\n /**\n * Adjusts the column widths to respect the dimensions minItemWidth if set.\n * @internal\n */\n private respectMinItemSize() {\n interface Entry {\n size: number;\n }\n\n const minItemSize = this.calculateContentItemMinSize(this);\n\n if (minItemSize <= 0 || this.contentItems.length <= 1) {\n return;\n } else {\n let totalOverMin = 0;\n let totalUnderMin = 0;\n const entriesOverMin: Entry[] = [];\n const allEntries: Entry[] = [];\n\n const absoluteSizes = this.calculateAbsoluteSizes();\n\n /**\n * Figure out how much we are under the min item size total and how much room we have to use.\n */\n for (let i = 0; i < absoluteSizes.itemSizes.length; i++) {\n const itemSize = absoluteSizes.itemSizes[i];\n\n let entry: Entry;\n if (itemSize < minItemSize) {\n totalUnderMin += minItemSize - itemSize;\n entry = {\n size: minItemSize\n };\n\n } else {\n totalOverMin += itemSize - minItemSize;\n entry = {\n size: itemSize\n };\n entriesOverMin.push(entry);\n }\n\n allEntries.push(entry);\n }\n\n /**\n * If there is nothing under min, or there is not enough over to make up the difference, do nothing.\n */\n if (totalUnderMin === 0 || totalUnderMin > totalOverMin) {\n return;\n } else {\n /**\n * Evenly reduce all columns that are over the min item width to make up the difference.\n */\n const reducePercent = totalUnderMin / totalOverMin;\n let remainingSize = totalUnderMin;\n for (let i = 0; i < entriesOverMin.length; i++) {\n const entry = entriesOverMin[i];\n const reducedSize = Math.round((entry.size - minItemSize) * reducePercent);\n remainingSize -= reducedSize;\n entry.size -= reducedSize;\n }\n\n /**\n * Take anything remaining from the last item.\n */\n if (remainingSize !== 0) {\n allEntries[allEntries.length - 1].size -= remainingSize;\n }\n\n /**\n * Set every items size relative to 100 relative to its size to total\n */\n for (let i = 0; i < this.contentItems.length; i++) {\n const contentItem = this.contentItems[i];\n contentItem.size = (allEntries[i].size / absoluteSizes.totalSize) * 100;\n }\n }\n }\n }\n\n /**\n * Instantiates a new Splitter, binds events to it and adds\n * it to the array of splitters at the position specified as the index argument\n *\n * What it doesn't do though is append the splitter to the DOM\n *\n * @param index - The position of the splitter\n *\n * @returns\n * @internal\n */\n private createSplitter(index: number): Splitter {\n const splitter = new Splitter(this._isColumn, this._splitterSize, this._splitterGrabSize);\n splitter.on('drag', (offsetX, offsetY) => this.onSplitterDrag(splitter, offsetX, offsetY));\n splitter.on('dragStop', () => this.onSplitterDragStop(splitter));\n splitter.on('dragStart', () => this.onSplitterDragStart(splitter));\n this._splitter.splice(index, 0, splitter);\n return splitter;\n }\n\n /**\n * Locates the instance of Splitter in the array of\n * registered splitters and returns a map containing the contentItem\n * before and after the splitters, both of which are affected if the\n * splitter is moved\n *\n * @returns A map of contentItems that the splitter affects\n * @internal\n */\n private getSplitItems(splitter: Splitter) {\n const index = this._splitter.indexOf(splitter);\n\n return {\n before: this.contentItems[index],\n after: this.contentItems[index + 1]\n };\n }\n\n private calculateContentItemMinSize(contentItem: ContentItem) {\n const minSize = contentItem.minSize;\n if (minSize !== undefined) {\n if (contentItem.minSizeUnit === SizeUnitEnum.Pixel) {\n return minSize;\n } else {\n throw new AssertError('ROCGMD98831', JSON.stringify(contentItem));\n }\n } else {\n const dimensions = this.layoutManager.layoutConfig.dimensions;\n return this._isColumn ? dimensions.defaultMinItemHeight : dimensions.defaultMinItemWidth;\n }\n }\n\n /**\n * Gets the minimum dimensions for the given item configuration array\n * @internal\n */\n private calculateContentItemsTotalMinSize(contentItems: readonly ContentItem[]) {\n let totalMinSize = 0;\n\n for (const contentItem of contentItems) {\n totalMinSize += this.calculateContentItemMinSize(contentItem);\n }\n\n return totalMinSize;\n }\n\n /**\n * Invoked when a splitter's dragListener fires dragStart. Calculates the splitters\n * movement area once (so that it doesn't need calculating on every mousemove event)\n * @internal\n */\n private onSplitterDragStart(splitter: Splitter) {\n const items = this.getSplitItems(splitter);\n\n const beforeWidth = pixelsToNumber(items.before.element.style[this._dimension]);\n const afterSize = pixelsToNumber(items.after.element.style[this._dimension]);\n const beforeMinSize = this.calculateContentItemsTotalMinSize(items.before.contentItems);\n const afterMinSize = this.calculateContentItemsTotalMinSize(items.after.contentItems);\n\n this._splitterPosition = 0;\n this._splitterMinPosition = -1 * (beforeWidth - beforeMinSize);\n this._splitterMaxPosition = afterSize - afterMinSize;\n }\n\n /**\n * Invoked when a splitter's DragListener fires drag. Updates the splitter's DOM position,\n * but not the sizes of the elements the splitter controls in order to minimize resize events\n *\n * @param splitter -\n * @param offsetX - Relative pixel values to the splitter's original position. Can be negative\n * @param offsetY - Relative pixel values to the splitter's original position. Can be negative\n * @internal\n */\n private onSplitterDrag(splitter: Splitter, offsetX: number, offsetY: number) {\n let offset = this._isColumn ? offsetY : offsetX;\n\n if (this._splitterMinPosition === null || this._splitterMaxPosition === null) {\n throw new UnexpectedNullError('ROCOSD59226');\n }\n offset = Math.max(offset, this._splitterMinPosition);\n offset = Math.min(offset, this._splitterMaxPosition);\n\n this._splitterPosition = offset;\n const offsetPixels = numberToPixels(offset);\n if (this._isColumn) {\n splitter.element.style.top = offsetPixels;\n } else {\n splitter.element.style.left = offsetPixels;\n }\n }\n\n /**\n * Invoked when a splitter's DragListener fires dragStop. Resets the splitters DOM position,\n * and applies the new sizes to the elements before and after the splitter and their children\n * on the next animation frame\n * @internal\n */\n private onSplitterDragStop(splitter: Splitter) {\n if (this._splitterPosition === null) {\n throw new UnexpectedNullError('ROCOSDS66932');\n } else {\n const items = this.getSplitItems(splitter);\n const sizeBefore = pixelsToNumber(items.before.element.style[this._dimension]);\n const sizeAfter = pixelsToNumber(items.after.element.style[this._dimension]);\n const splitterPositionInRange = (this._splitterPosition + sizeBefore) / (sizeBefore + sizeAfter);\n const totalRelativeSize = items.before.size + items.after.size;\n\n items.before.size = splitterPositionInRange * totalRelativeSize;\n items.after.size = (1 - splitterPositionInRange) * totalRelativeSize;\n\n splitter.element.style.top = numberToPixels(0);\n splitter.element.style.left = numberToPixels(0);\n\n globalThis.requestAnimationFrame(() => this.updateSize(false));\n }\n }\n}\n\n/** @public */\nexport namespace RowOrColumn {\n /** @internal */\n export interface AbsoluteSizes {\n itemSizes: number[],\n additionalPixel: number,\n totalSize: number,\n crossAxisSize: number\n }\n\n /** @internal */\n export function getElementDimensionSize(element: HTMLElement, dimension: WidthOrHeightPropertyName): number {\n if (dimension === 'width') {\n return getElementWidth(element);\n } else {\n return getElementHeight(element);\n }\n }\n\n /** @internal */\n export function setElementDimensionSize(element: HTMLElement, dimension: WidthOrHeightPropertyName, value: number): void {\n if (dimension === 'width') {\n return setElementWidth(element, value);\n } else {\n return setElementHeight(element, value);\n }\n }\n\n /** @internal */\n export function createElement(document: Document, isColumn: boolean): HTMLDivElement {\n const element = document.createElement('div');\n element.classList.add(DomConstants.ClassName.Item);\n if (isColumn) {\n element.classList.add(DomConstants.ClassName.Column);\n } else {\n element.classList.add(DomConstants.ClassName.Row);\n }\n return element;\n }\n}\n","import { ComponentItemConfig, ItemConfig, RowOrColumnItemConfig, StackItemConfig } from '../config/config';\nimport { ResolvedComponentItemConfig, ResolvedGroundItemConfig, ResolvedHeaderedItemConfig, ResolvedItemConfig, ResolvedRootItemConfig, ResolvedStackItemConfig } from '../config/resolved-config';\nimport { AssertError, UnexpectedNullError } from '../errors/internal-error';\nimport { LayoutManager } from '../layout-manager';\nimport { DomConstants } from '../utils/dom-constants';\nimport { AreaLinkedRect, ItemType, SizeUnitEnum } from '../utils/types';\nimport { getElementWidthAndHeight, setElementHeight, setElementWidth } from '../utils/utils';\nimport { ComponentItem } from './component-item';\nimport { ComponentParentableItem } from './component-parentable-item';\nimport { ContentItem } from './content-item';\nimport { RowOrColumn } from './row-or-column';\n\n/**\n * GroundItem is the ContentItem whose one child is the root ContentItem (Root is planted in Ground).\n * (Previously it was called root however this was incorrect as its child is the root item)\n * There is only one instance of GroundItem and it is automatically created by the Layout Manager\n * @internal\n */\nexport class GroundItem extends ComponentParentableItem {\n private readonly _childElementContainer: HTMLElement;\n private readonly _containerElement: HTMLElement;\n\n constructor(layoutManager: LayoutManager, rootItemConfig: ResolvedRootItemConfig | undefined, containerElement: HTMLElement) {\n\n super(layoutManager, ResolvedGroundItemConfig.create(rootItemConfig), null, GroundItem.createElement(document));\n\n this.isGround = true;\n this._childElementContainer = this.element;\n this._containerElement = containerElement;\n\n // insert before any pre-existing content elements\n let before = null;\n while (true) {\n const prev: ChildNode | null =\n before ? before.previousSibling : this._containerElement.lastChild;\n if (prev instanceof Element\n && prev.classList.contains(DomConstants.ClassName.Content)) {\n before = prev;\n } else {\n break;\n }\n }\n this._containerElement.insertBefore(this.element, before);\n }\n\n override init(): void {\n if (this.isInitialised === true) return;\n\n this.updateNodeSize();\n\n for (let i = 0; i < this.contentItems.length; i++) {\n this._childElementContainer.appendChild(this.contentItems[i].element);\n }\n\n super.init();\n\n this.initContentItems();\n }\n\n /**\n * Loads a new Layout\n * Internal only. To load a new layout with API, use {@link (LayoutManager:class).loadLayout}\n */\n loadRoot(rootItemConfig: ResolvedRootItemConfig | undefined): void {\n // Remove existing root if it exists\n this.clearRoot();\n\n if (rootItemConfig !== undefined) {\n const rootContentItem = this.layoutManager.createAndInitContentItem(rootItemConfig, this);\n this.addChild(rootContentItem, 0);\n }\n }\n\n clearRoot(): void {\n // Remove existing root if it exists\n const contentItems = this.contentItems;\n switch (contentItems.length) {\n case 0: {\n return;\n }\n case 1: {\n const existingRootContentItem = contentItems[0];\n existingRootContentItem.remove();\n return;\n }\n default: {\n throw new AssertError('GILR07721');\n }\n }\n }\n\n /**\n * Adds a ContentItem child to root ContentItem.\n * Internal only. To load a add with API, use {@link (LayoutManager:class).addItem}\n * @returns -1 if added as root otherwise index in root ContentItem's content\n */\n addItem(itemConfig: RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig,\n index?: number\n ): number {\n this.layoutManager.checkMinimiseMaximisedStack();\n\n const resolvedItemConfig = ItemConfig.resolve(itemConfig, false);\n let parent: ContentItem;\n if (this.contentItems.length > 0) {\n parent = this.contentItems[0];\n } else {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n parent = this;\n }\n if (parent.isComponent) {\n throw new Error('Cannot add item as child to ComponentItem');\n } else {\n const contentItem = this.layoutManager.createAndInitContentItem(resolvedItemConfig, parent);\n index = parent.addChild(contentItem, index);\n return (parent === this) ? -1 : index;\n }\n }\n\n loadComponentAsRoot(itemConfig: ComponentItemConfig): void {\n // Remove existing root if it exists\n this.clearRoot();\n\n const resolvedItemConfig = ItemConfig.resolve(itemConfig, false) as ResolvedComponentItemConfig;\n\n if (resolvedItemConfig.maximised) {\n throw new Error('Root Component cannot be maximised');\n } else {\n const rootContentItem = new ComponentItem(this.layoutManager, resolvedItemConfig, this);\n rootContentItem.init();\n this.addChild(rootContentItem, 0);\n }\n }\n\n /**\n * Adds a Root ContentItem.\n * Internal only. To replace Root ContentItem with API, use {@link (LayoutManager:class).loadLayout}\n */\n override addChild(contentItem: ContentItem, index?: number): number {\n if (this.contentItems.length > 0) {\n throw new Error('Ground node can only have a single child');\n } else {\n // contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);\n this._childElementContainer.appendChild(contentItem.element);\n index = super.addChild(contentItem, index);\n\n this.updateSize(false);\n this.emitBaseBubblingEvent('stateChanged');\n\n return index;\n }\n }\n\n /** @internal */\n override calculateConfigContent(): ResolvedRootItemConfig[] {\n const contentItems = this.contentItems;\n const count = contentItems.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const item = contentItems[i];\n const itemConfig = item.toConfig();\n if (ResolvedRootItemConfig.isRootItemConfig(itemConfig)) {\n result[i] = itemConfig;\n } else {\n throw new AssertError('RCCC66832');\n }\n }\n return result;\n }\n\n /** @internal */\n setSize(width: number, height: number): void {\n if (width === undefined || height === undefined) {\n this.updateSize(false); // For backwards compatibility with v1.x API\n } else {\n setElementWidth(this.element, width);\n setElementHeight(this.element, height);\n\n // GroundItem can be empty\n if (this.contentItems.length > 0) {\n setElementWidth(this.contentItems[0].element, width);\n setElementHeight(this.contentItems[0].element, height);\n }\n\n this.updateContentItemsSize(false);\n }\n }\n\n /**\n * Adds a Root ContentItem.\n * Internal only. To replace Root ContentItem with API, use {@link (LayoutManager:class).updateRootSize}\n */\n override updateSize(force: boolean): void {\n this.layoutManager.beginVirtualSizedContainerAdding();\n try {\n this.updateNodeSize();\n this.updateContentItemsSize(force);\n } finally {\n this.layoutManager.endVirtualSizedContainerAdding();\n }\n }\n\n createSideAreas(): GroundItem.Area[] {\n const areaSize = 50;\n\n const oppositeSides = GroundItem.Area.oppositeSides;\n const result = new Array(Object.keys(oppositeSides).length);\n let idx = 0;\n\n for (const key in oppositeSides) {\n const side = key as keyof GroundItem.Area.Sides;\n const area = this.getElementArea() as GroundItem.Area;\n if (area === null) {\n throw new UnexpectedNullError('RCSA77553');\n } else {\n area.side = side;\n if (oppositeSides[side][1] === '2' )\n area[side] = area[oppositeSides[side]] - areaSize;\n else\n area[side] = area[oppositeSides[side]] + areaSize;\n area.surface = (area.x2 - area.x1) * (area.y2 - area.y1);\n result[idx++] = area;\n }\n }\n\n return result;\n }\n\n override highlightDropZone(x: number, y: number, area: AreaLinkedRect): void {\n this.layoutManager.tabDropPlaceholder.remove();\n super.highlightDropZone(x, y, area);\n }\n\n override onDrop(contentItem: ContentItem, area: GroundItem.Area): void {\n\n if (contentItem.isComponent) {\n const itemConfig = ResolvedStackItemConfig.createDefault();\n // since ResolvedItemConfig.contentItems not set up, we need to add header from Component\n const component = contentItem as ComponentItem;\n itemConfig.header = ResolvedHeaderedItemConfig.Header.createCopy(component.headerConfig);\n const stack = this.layoutManager.createAndInitContentItem(itemConfig, this);\n stack.addChild(contentItem);\n contentItem = stack;\n }\n\n if (this.contentItems.length === 0) {\n this.addChild(contentItem);\n } else {\n /*\n * If the contentItem that's being dropped is not dropped on a Stack (cases which just passed above and\n * which would wrap the contentItem in a Stack) we need to check whether contentItem is a RowOrColumn.\n * If it is, we need to re-wrap it in a Stack like it was when it was dragged by its Tab (it was dragged!).\n */\n if(contentItem.type === ItemType.row || contentItem.type === ItemType.column){\n const itemConfig = ResolvedStackItemConfig.createDefault();\n const stack = this.layoutManager.createContentItem(itemConfig, this);\n stack.addChild(contentItem)\n contentItem = stack\n }\n\n const type = area.side[0] == 'x' ? ItemType.row : ItemType.column;\n const insertBefore = area.side[1] == '2';\n const column = this.contentItems[0];\n if (!(column instanceof RowOrColumn) || column.type !== type) {\n const itemConfig = ResolvedItemConfig.createDefault(type);\n const rowOrColumn = this.layoutManager.createContentItem(itemConfig, this);\n this.replaceChild(column, rowOrColumn);\n rowOrColumn.addChild(contentItem, insertBefore ? 0 : undefined, true);\n rowOrColumn.addChild(column, insertBefore ? undefined : 0, true);\n column.size = 50;\n contentItem.size = 50;\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n rowOrColumn.updateSize(false);\n } else {\n const sibling = column.contentItems[insertBefore ? 0 : column.contentItems.length - 1]\n column.addChild(contentItem, insertBefore ? 0 : undefined, true);\n sibling.size *= 0.5;\n contentItem.size = sibling.size;\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n column.updateSize(false);\n }\n }\n }\n\n // No ContentItem can dock with groundItem. However Stack can have a GroundItem parent and Stack requires that\n // its parent implement dock() function. Accordingly this function is implemented but throws an exception as it should\n // never be called\n dock(): void {\n throw new AssertError('GID87731');\n }\n\n // No ContentItem can dock with groundItem. However Stack can have a GroundItem parent and Stack requires that\n // its parent implement validateDocking() function. Accordingly this function is implemented but throws an exception as it should\n // never be called\n validateDocking(): void {\n throw new AssertError('GIVD87732');\n }\n\n getAllContentItems(): ContentItem[] {\n const result: ContentItem[] = [this];\n this.deepGetAllContentItems(this.contentItems, result);\n return result;\n }\n\n getConfigMaximisedItems(): ContentItem[] {\n const result: ContentItem[] = [];\n this.deepFilterContentItems(this.contentItems, result, (item) => {\n if (ContentItem.isStack(item) && item.initialWantMaximise) {\n return true;\n } else {\n if (ContentItem.isComponentItem(item) && item.initialWantMaximise) {\n return true;\n } else {\n return false;\n }\n }\n });\n\n return result;\n }\n\n getItemsByPopInParentId(popInParentId: string): ContentItem[] {\n const result: ContentItem[] = [];\n this.deepFilterContentItems(this.contentItems, result, (item) => item.popInParentIds.includes(popInParentId));\n return result;\n }\n\n toConfig(): ResolvedItemConfig {\n throw new Error('Cannot generate GroundItem config');\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setActiveComponentItem(item: ComponentItem, focus: boolean, suppressFocusEvent: boolean): void {\n // only applicable if ComponentItem is root and then it always has focus\n }\n\n private updateNodeSize(): void {\n const { width, height } = getElementWidthAndHeight(this._containerElement);\n\n setElementWidth(this.element, width);\n setElementHeight(this.element, height);\n\n /*\n * GroundItem can be empty\n */\n if (this.contentItems.length > 0) {\n setElementWidth(this.contentItems[0].element, width);\n setElementHeight(this.contentItems[0].element, height);\n }\n }\n\n private deepGetAllContentItems(content: readonly ContentItem[], result: ContentItem[]): void {\n for (let i = 0; i < content.length; i++) {\n const contentItem = content[i];\n result.push(contentItem);\n this.deepGetAllContentItems(contentItem.contentItems, result);\n }\n }\n\n private deepFilterContentItems(content: readonly ContentItem[], result: ContentItem[],\n checkAcceptFtn: ((this: void, item: ContentItem) => boolean)\n ): void {\n for (let i = 0; i < content.length; i++) {\n const contentItem = content[i];\n if (checkAcceptFtn(contentItem)) {\n result.push(contentItem);\n }\n this.deepFilterContentItems(contentItem.contentItems, result, checkAcceptFtn);\n }\n }\n\n}\n\n/** @internal */\nexport namespace GroundItem {\n export interface Area extends ContentItem.Area {\n side: keyof typeof Area.Side;\n }\n\n export namespace Area {\n export const enum Side {\n y2,\n x2,\n y1,\n x1,\n }\n\n export type Sides = { [side in keyof typeof Side]: keyof typeof Side; }\n\n export const oppositeSides: Sides = {\n y2: 'y1',\n x2: 'x1',\n y1: 'y2',\n x1: 'x2',\n };\n }\n\n export function createElement(document: Document): HTMLDivElement {\n const element = document.createElement('div');\n element.classList.add(DomConstants.ClassName.GoldenLayout);\n element.classList.add(DomConstants.ClassName.Item);\n element.classList.add(DomConstants.ClassName.Root);\n return element;\n }\n}\n","import { ComponentItemConfig as ConfigComponentItemConfig } from '../config/config'; // remove alias in version 3\nimport { ResolvedRowOrColumnItemConfig } from \"../config/resolved-config\";\nimport { UnexpectedNullError } from '../errors/internal-error';\nimport { ComponentItem } from '../items/component-item';\nimport { GroundItem } from '../items/ground-item';\nimport { LayoutManager } from '../layout-manager';\nimport { DragListener } from '../utils/drag-listener';\nimport { JsonValue } from '../utils/types';\nimport { DragProxy } from './drag-proxy';\n\n/**\n * Allows for any DOM item to create a component on drag\n * start to be dragged into the Layout\n * @public\n */\nexport class DragSource {\n /** @internal */\n private _dragListener: DragListener | null;\n /** @internal */\n private _dummyGroundContainer: HTMLElement;\n /** @internal */\n private _dummyGroundContentItem: GroundItem;\n\n /** @internal */\n constructor(\n /** @internal */\n private _layoutManager: LayoutManager,\n /** @internal */\n private readonly _element: HTMLElement,\n /** @internal */\n private readonly _extraAllowableChildTargets: HTMLElement[],\n /** @internal @deprecated replace with componentItemConfigOrFtn in version 3 */\n private _componentTypeOrFtn: JsonValue | (() => (DragSource.ComponentItemConfig | ConfigComponentItemConfig)),\n /** @internal @deprecated remove in version 3 */\n private _componentState: JsonValue | undefined,\n /** @internal @deprecated remove in version 3 */\n private _title: string | undefined,\n /** @internal @deprecated remove in version 3 */\n private _id: string | undefined\n ) {\n this._dragListener = null;\n\n this._dummyGroundContainer = document.createElement('div');\n\n const dummyRootItemConfig = ResolvedRowOrColumnItemConfig.createDefault('row');\n this._dummyGroundContentItem = new GroundItem(this._layoutManager, dummyRootItemConfig, this._dummyGroundContainer);\n\n this.createDragListener();\n }\n\n\t/**\n\t * Disposes of the drag listeners so the drag source is not usable any more.\n * @internal\n\t */\n\tdestroy(): void {\n\t\tthis.removeDragListener();\n }\n\n /**\n * Called initially and after every drag\n * @internal\n */\n private createDragListener() {\n this.removeDragListener();\n\n this._dragListener = new DragListener(this._element, this._extraAllowableChildTargets);\n this._dragListener.on('dragStart', (x, y) => this.onDragStart(x, y));\n this._dragListener.on('dragStop', () => this.onDragStop());\n }\n\n /**\n * Callback for the DragListener's dragStart event\n *\n * @param x - The x position of the mouse on dragStart\n * @param y - The x position of the mouse on dragStart\n * @internal\n */\n private onDragStart(x: number, y: number) {\n const type = 'component';\n let dragSourceItemConfig: ConfigComponentItemConfig;\n\n if (typeof this._componentTypeOrFtn === \"function\") {\n const ftnDragSourceItemConfig = this._componentTypeOrFtn() as (DragSource.ComponentItemConfig | ConfigComponentItemConfig);\n // If the componentType property exists, then it is already a ComponentItemConfig so nothing to do\n if (DragSource.isDragSourceComponentItemConfig(ftnDragSourceItemConfig)) {\n dragSourceItemConfig = {\n type,\n componentState: ftnDragSourceItemConfig.state,\n componentType: ftnDragSourceItemConfig.type,\n title: ftnDragSourceItemConfig.title ?? this._title,\n };\n } else {\n dragSourceItemConfig = ftnDragSourceItemConfig;\n }\n } else {\n dragSourceItemConfig = {\n type,\n componentState: this._componentState,\n componentType: this._componentTypeOrFtn,\n title: this._title,\n id: this._id,\n };\n }\n\n // Create a dummy ContentItem only for drag purposes\n // All ContentItems (except for GroundItem) need a parent. When dragging, the parent is not used.\n // Instead of allowing null parents (as Javascript version did), use a temporary dummy GroundItem parent and add ContentItem to that\n // If this does not work, need to create alternative GroundItem class\n\n const resolvedItemConfig = ConfigComponentItemConfig.resolve(dragSourceItemConfig, false);\n\n const componentItem = new ComponentItem(this._layoutManager, resolvedItemConfig, this._dummyGroundContentItem)\n this._dummyGroundContentItem.contentItems.push(componentItem);\n\n if (this._dragListener === null) {\n throw new UnexpectedNullError('DSODSD66746');\n } else {\n const dragProxy = new DragProxy(x, y, this._dragListener, this._layoutManager, componentItem , this._dummyGroundContentItem);\n\n const transitionIndicator = this._layoutManager.transitionIndicator;\n if (transitionIndicator === null) {\n throw new UnexpectedNullError('DSODST66746');\n } else {\n transitionIndicator.transitionElements(this._element, dragProxy.element);\n }\n }\n }\n\n /** @internal */\n private onDragStop() {\n // if (this._dummyGroundContentItem === undefined) {\n // throw new UnexpectedUndefinedError('DSODSDRU08116');\n // } else {\n // this._dummyGroundContentItem._$destroy\n // this._dummyGroundContentItem = undefined;\n // }\n this.createDragListener();\n }\n\n /**\n\t * Called after every drag and when the drag source is being disposed of.\n * @internal\n\t */\n\tprivate removeDragListener() {\n\t\tif (this._dragListener !== null ) {\n this._dragListener.destroy();\n this._dragListener = null;\n\t\t}\n\t}\n}\n\n/** @public */\nexport namespace DragSource {\n /** @deprecated use Config {@link (ComponentItemConfig:interface)} */\n export interface ComponentItemConfig {\n type: JsonValue,\n state?: JsonValue,\n title?: string,\n }\n\n /** @deprecated remove in version 3 */\n export function isDragSourceComponentItemConfig(\n config: DragSource.ComponentItemConfig | ConfigComponentItemConfig\n ): config is DragSource.ComponentItemConfig {\n return !(\"componentType\" in config);\n }\n}\n","import { DomConstants } from '../utils/dom-constants';\nimport { AreaLinkedRect } from '../utils/types';\nimport { numberToPixels, setElementDisplayVisibility } from '../utils/utils';\n\n/** @internal */\nexport class DropTargetIndicator {\n private _element: HTMLElement;\n\n constructor() {\n // Maybe use container instead of Document Body?\n this._element = document.createElement('div');\n this._element.classList.add(DomConstants.ClassName.DropTargetIndicator);\n const innerElement = document.createElement('div');\n innerElement.classList.add(DomConstants.ClassName.Inner);\n this._element.appendChild(innerElement);\n\n document.body.appendChild(this._element);\n }\n\n destroy(): void {\n this._element.remove();\n }\n\n highlightArea(area: AreaLinkedRect, margin: number): void {\n this._element.style.left = numberToPixels(area.x1 + margin);\n this._element.style.top = numberToPixels(area.y1 + margin);\n this._element.style.width = numberToPixels(area.x2 - area.x1 - margin);\n this._element.style.height = numberToPixels(area.y2 - area.y1 - margin);\n this._element.style.display = 'block';\n }\n\n hide(): void {\n setElementDisplayVisibility(this._element, false);\n }\n}\n","import { DomConstants } from '../utils/dom-constants';\nimport { Rect } from '../utils/types';\n\n/** @internal @deprecated To be removed */\nexport class TransitionIndicator {\n private _element: HTMLElement;\n private _toElement: HTMLElement | null;\n private _fromDimensions: null;\n private _totalAnimationDuration: number;\n private _animationStartTime: number | null;\n\n constructor() {\n this._element = document.createElement('div');\n this._element.classList.add(DomConstants.ClassName.TransitionIndicator);\n document.body.appendChild(this._element);\n\n this._toElement = null;\n this._fromDimensions = null;\n this._totalAnimationDuration = 200;\n this._animationStartTime = null;\n }\n\n destroy(): void {\n this._element.remove();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n transitionElements(fromElement: HTMLElement, toElement: HTMLElement): void {\n /**\n * TODO - This is not quite as cool as expected. Review.\n */\n return;\n // this._toElement = toElement;\n // this._animationStartTime = now();\n // this._fromDimensions = this._measure(fromElement);\n // this._fromDimensions.opacity = 0.8;\n // this._element.show().css(this._fromDimensions);\n // animFrame(fnBind(this._nextAnimationFrame, this));\n }\n\n private nextAnimationFrame(): void {\n // if (this._toElement === null || this._fromDimensions === null || this._animationStartTime === null) {\n // throw new UnexpectedNullError('TINAFTD97115');\n // } else {\n // const toDimensions = this.measure(this._toElement);\n // const animationProgress = (now() - this._animationStartTime) / this._totalAnimationDuration;\n // const currentFrameStyles = {};\n // const cssProperty;\n\n // if (animationProgress >= 1) {\n // this._element.style.display = 'none';\n // return;\n // }\n\n // toDimensions.opacity = 0;\n\n // for (const cssProperty in this._fromDimensions) {\n // currentFrameStyles[cssProperty] = this._fromDimensions[cssProperty] +\n // (toDimensions[cssProperty] - this._fromDimensions[cssProperty]) *\n // animationProgress;\n // }\n\n // this._element.css(currentFrameStyles);\n // animFrame(fnBind(this._nextAnimationFrame, this));\n // }\n }\n\n private measure(element: HTMLElement): Rect {\n const rect = element.getBoundingClientRect();\n\n return {\n left: rect.left,\n top: rect.top,\n width: element.offsetWidth,\n height: element.offsetHeight,\n };\n }\n}\n","import { UnexpectedNullError } from '../errors/internal-error';\nimport { LayoutManager } from '../layout-manager';\nimport { EventEmitter } from './event-emitter';\n\n// Add our ChildEvent to WindowEventMap for type safety\n/** @public */\ndeclare global {\n interface WindowEventMap {\n [EventHub.ChildEventName]: CustomEvent;\n }\n}\n\n/**\n * An EventEmitter singleton that propagates events\n * across multiple windows. This is a little bit trickier since\n * windows are allowed to open childWindows in their own right.\n *\n * This means that we deal with a tree of windows. Therefore, we do the event propagation in two phases:\n *\n * - Propagate events from this layout to the parent layout\n * - Repeat until the event arrived at the root layout\n * - Propagate events to this layout and to all children\n * - Repeat until all layouts got the event\n *\n * **WARNING**: Only userBroadcast events are propagated between windows.\n * This means the you have to take care of propagating state changes between windows yourself.\n *\n * @public\n */\nexport class EventHub extends EventEmitter {\n\n /** @internal */\n private _childEventListener = (childEvent: CustomEvent) => this.onEventFromChild(childEvent);\n\n /**\n * Creates a new EventHub instance\n * @param _layoutManager - the layout manager to synchronize between the windows\n * @internal\n */\n constructor(\n /** @internal */\n private _layoutManager: LayoutManager\n ) {\n super();\n globalThis.addEventListener(EventHub.ChildEventName, this._childEventListener, { passive: true });\n }\n\n /**\n * Emit an event and notify listeners\n *\n * @param eventName - The name of the event\n * @param args - Additional arguments that will be passed to the listener\n * @public\n */\n override emit(eventName: K, ...args: EventEmitter.EventParamsMap[K]): void {\n if (eventName === 'userBroadcast') {\n // Explicitly redirect the user broadcast to our overridden method.\n this.emitUserBroadcast(...args);\n } else {\n super.emit(eventName, ...args);\n }\n }\n\n /**\n * Broadcasts a message to all other currently opened windows.\n * @public\n */\n emitUserBroadcast(...args: EventEmitter.UnknownParams): void {\n // Step 1: Bubble up the event\n this.handleUserBroadcastEvent('userBroadcast', args);\n }\n\n /**\n * Destroys the EventHub\n * @internal\n */\n destroy(): void {\n globalThis.removeEventListener(EventHub.ChildEventName, this._childEventListener);\n }\n\n /**\n * Internal processor to process local events.\n * @internal\n */\n private handleUserBroadcastEvent(eventName: string, args: unknown[]) {\n if (this._layoutManager.isSubWindow) {\n // We are a sub window and received an event from one of our children.\n // So propagate it to the Root.\n this.propagateToParent(eventName, args);\n } else {\n // We are the root window, propagate it to the subtree below us.\n this.propagateToThisAndSubtree(eventName, args);\n }\n }\n\n /**\n * Callback for child events raised on the window\n * @internal\n */\n private onEventFromChild(event: CustomEvent) {\n const detail = event.detail;\n this.handleUserBroadcastEvent(detail.eventName, detail.args);\n }\n\n /**\n * Propagates the event to the parent by emitting\n * it on the parent's DOM window\n * @internal\n */\n private propagateToParent(eventName: string, args: unknown[]) {\n const detail: EventHub.ChildEventDetail = {\n layoutManager: this._layoutManager,\n eventName,\n args: args,\n }\n\n const eventInit: EventHub.ChildEventInit = {\n bubbles: true,\n cancelable: true,\n detail,\n };\n\n const event = new CustomEvent(EventHub.ChildEventName, eventInit);\n const opener = globalThis.opener;\n if (opener === null) {\n throw new UnexpectedNullError('EHPTP15778')\n }\n\n opener.dispatchEvent(event);\n }\n\n /**\n * Propagate events to the whole subtree under this event hub.\n * @internal\n */\n private propagateToThisAndSubtree(eventName: string, args: unknown[]) {\n this.emitUnknown(eventName, ...args);\n for (let i = 0; i < this._layoutManager.openPopouts.length; i++) {\n const childGl = this._layoutManager.openPopouts[i].getGlInstance();\n\n if (childGl) {\n childGl.eventHub.propagateToThisAndSubtree(eventName, args);\n }\n }\n }\n}\n\n/** @public */\nexport namespace EventHub {\n\n /** @internal */\n export const ChildEventName = 'gl_child_event';\n\n /** @internal */\n export type ChildEventDetail = {\n layoutManager: LayoutManager;\n eventName: string;\n args: unknown[];\n };\n\n /** @internal */\n export type ChildEventInit = CustomEventInit;\n}\n","import { ComponentItemConfig, ItemConfig, LayoutConfig, RowOrColumnItemConfig, StackItemConfig } from './config/config';\nimport {\n ResolvedComponentItemConfig,\n ResolvedItemConfig,\n ResolvedLayoutConfig,\n ResolvedPopoutLayoutConfig,\n ResolvedRootItemConfig,\n ResolvedRowOrColumnItemConfig,\n ResolvedStackItemConfig\n} from \"./config/resolved-config\";\nimport { ComponentContainer } from './container/component-container';\nimport { BrowserPopout } from './controls/browser-popout';\nimport { DragProxy } from './controls/drag-proxy';\nimport { DragSource } from './controls/drag-source';\nimport { DropTargetIndicator } from './controls/drop-target-indicator';\nimport { TransitionIndicator } from './controls/transition-indicator';\nimport { ConfigurationError } from './errors/external-error';\nimport { AssertError, UnexpectedNullError, UnexpectedUndefinedError, UnreachableCaseError } from './errors/internal-error';\nimport { ComponentItem } from './items/component-item';\nimport { ComponentParentableItem } from './items/component-parentable-item';\nimport { ContentItem } from './items/content-item';\nimport { GroundItem } from './items/ground-item';\nimport { RowOrColumn } from './items/row-or-column';\nimport { Stack } from './items/stack';\nimport { ConfigMinifier } from './utils/config-minifier';\nimport { DomConstants } from './utils/dom-constants';\nimport { DragListener } from './utils/drag-listener';\nimport { EventEmitter } from './utils/event-emitter';\nimport { EventHub } from './utils/event-hub';\nimport { I18nStringId, I18nStrings, i18nStrings } from './utils/i18n-strings';\nimport { ItemType, JsonValue, Rect, ResponsiveMode } from './utils/types';\nimport {\n getElementWidthAndHeight,\n removeFromArray,\n setElementHeight,\n setElementWidth\n} from './utils/utils';\n\n/** @internal */\ndeclare global {\n interface Window {\n __glInstance: LayoutManager;\n }\n}\n\n/**\n * The main class that will be exposed as GoldenLayout.\n */\n\n/** @public */\nexport abstract class LayoutManager extends EventEmitter {\n /** Whether the layout will be automatically be resized to container whenever the container's size is changed\n * Default is true if is the container otherwise false\n * Default will be changed to true for any container in the future\n */\n resizeWithContainerAutomatically = false;\n /** The debounce interval (in milliseconds) used whenever a layout is automatically resized. 0 means next tick */\n resizeDebounceInterval = 100;\n /** Extend the current debounce delay time period if it is triggered during the delay.\n * If this is true, the layout will only resize when its container has stopped being resized.\n * If it is false, the layout will resize at intervals while its container is being resized.\n */\n resizeDebounceExtendedWhenPossible = true;\n\n /** @internal */\n private _containerElement: HTMLElement;\n /** @internal */\n private _isInitialised = false;\n /** @internal */\n private _groundItem: GroundItem | undefined = undefined;\n /** @internal */\n private _openPopouts: BrowserPopout[] = [];\n /** @internal */\n private _dropTargetIndicator: DropTargetIndicator | null = null;\n /** @internal */\n private _transitionIndicator: TransitionIndicator | null = null;\n /** @internal */\n private _resizeTimeoutId: ReturnType | undefined;\n /** @internal */\n private _itemAreas: ContentItem.Area[] = [];\n /** @internal */\n private _maximisedStack: Stack | undefined;\n /** @internal */\n private _maximisePlaceholder = LayoutManager.createMaximisePlaceElement(document);\n /** @internal */\n private _tabDropPlaceholder = LayoutManager.createTabDropPlaceholderElement(document);\n /** @internal */\n private _dragSources: DragSource[] = [];\n /** @internal */\n private _updatingColumnsResponsive = false;\n /** @internal */\n private _firstLoad = true;\n /** @internal */\n private _eventHub = new EventHub(this);\n /** @internal */\n private _width: number | null = null;\n /** @internal */\n private _height: number | null = null;\n /** @internal */\n private _focusedComponentItem: ComponentItem | undefined;\n /** @internal */\n private _virtualSizedContainers: ComponentContainer[] = [];\n /** @internal */\n private _virtualSizedContainerAddingBeginCount = 0;\n /** @internal */\n private _sizeInvalidationBeginCount = 0;\n /** @internal */\n protected _constructorOrSubWindowLayoutConfig: LayoutConfig | undefined; // protected for backwards compatibility\n\n /** @internal */\n private _resizeObserver = new ResizeObserver(() => this.handleContainerResize());\n /** @internal @deprecated to be removed in version 3 */\n private _windowBeforeUnloadListener = () => this.onBeforeUnload();\n /** @internal @deprecated to be removed in version 3 */\n private _windowBeforeUnloadListening = false;\n /** @internal */\n private _maximisedStackBeforeDestroyedListener = (ev: EventEmitter.BubblingEvent) => this.cleanupBeforeMaximisedStackDestroyed(ev);\n\n readonly isSubWindow: boolean;\n layoutConfig: ResolvedLayoutConfig;\n\n beforeVirtualRectingEvent: LayoutManager.BeforeVirtualRectingEvent | undefined;\n afterVirtualRectingEvent: LayoutManager.AfterVirtualRectingEvent | undefined;\n\n get container(): HTMLElement { return this._containerElement; }\n get isInitialised(): boolean { return this._isInitialised; }\n /** @internal */\n get groundItem(): GroundItem | undefined { return this._groundItem; }\n /** @internal @deprecated use {@link (LayoutManager:class).groundItem} instead */\n get root(): GroundItem | undefined { return this._groundItem; }\n get openPopouts(): BrowserPopout[] { return this._openPopouts; }\n /** @internal */\n get dropTargetIndicator(): DropTargetIndicator | null { return this._dropTargetIndicator; }\n /** @internal @deprecated To be removed */\n get transitionIndicator(): TransitionIndicator | null { return this._transitionIndicator; }\n get width(): number | null { return this._width; }\n get height(): number | null { return this._height; }\n /**\n * Retrieves the {@link (EventHub:class)} instance associated with this layout manager.\n * This can be used to propagate events between the windows\n * @public\n */\n get eventHub(): EventHub { return this._eventHub; }\n get rootItem(): ContentItem | undefined {\n if (this._groundItem === undefined) {\n throw new Error('Cannot access rootItem before init');\n } else {\n const groundContentItems = this._groundItem.contentItems;\n if (groundContentItems.length === 0) {\n return undefined;\n } else {\n return this._groundItem.contentItems[0];\n }\n }\n }\n get focusedComponentItem(): ComponentItem | undefined { return this._focusedComponentItem; }\n /** @internal */\n get tabDropPlaceholder(): HTMLElement { return this._tabDropPlaceholder; }\n get maximisedStack(): Stack | undefined { return this._maximisedStack; }\n\n /** @deprecated indicates deprecated constructor use */\n get deprecatedConstructor(): boolean { return !this.isSubWindow && this._constructorOrSubWindowLayoutConfig !== undefined; }\n\n\n /**\n * @param container - A Dom HTML element. Defaults to body\n * @internal\n */\n constructor(parameters: LayoutManager.ConstructorParameters) {\n super();\n\n this.isSubWindow = parameters.isSubWindow;\n\n this._constructorOrSubWindowLayoutConfig = parameters.constructorOrSubWindowLayoutConfig;\n\n I18nStrings.checkInitialise();\n ConfigMinifier.checkInitialise();\n\n if (parameters.containerElement !== undefined) {\n this._containerElement = parameters.containerElement;\n }\n }\n\n /**\n * Destroys the LayoutManager instance itself as well as every ContentItem\n * within it. After this is called nothing should be left of the LayoutManager.\n *\n * This function only needs to be called if an application wishes to destroy the Golden Layout object while\n * a page remains loaded. When a page is unloaded, all resources claimed by Golden Layout will automatically\n * be released.\n */\n destroy(): void {\n if (this._isInitialised) {\n if (this._windowBeforeUnloadListening) {\n globalThis.removeEventListener('beforeunload', this._windowBeforeUnloadListener);\n this._windowBeforeUnloadListening = false;\n }\n\n if (this.layoutConfig.settings.closePopoutsOnUnload === true) {\n this.closeAllOpenPopouts();\n }\n\n this._resizeObserver.disconnect();\n this.checkClearResizeTimeout();\n\n if (this._groundItem !== undefined) {\n this._groundItem.destroy();\n }\n this._tabDropPlaceholder.remove();\n if (this._dropTargetIndicator !== null) {\n this._dropTargetIndicator.destroy();\n }\n if (this._transitionIndicator !== null) {\n this._transitionIndicator.destroy();\n }\n this._eventHub.destroy();\n\n for (const dragSource of this._dragSources) {\n dragSource.destroy();\n }\n this._dragSources = [];\n\n this._isInitialised = false;\n }\n }\n\n /**\n * Takes a GoldenLayout configuration object and\n * replaces its keys and values recursively with\n * one letter codes\n * @deprecated use {@link (ResolvedLayoutConfig:namespace).minifyConfig} instead\n */\n minifyConfig(config: ResolvedLayoutConfig): ResolvedLayoutConfig {\n return ResolvedLayoutConfig.minifyConfig(config);\n }\n\n /**\n * Takes a configuration Object that was previously minified\n * using minifyConfig and returns its original version\n * @deprecated use {@link (ResolvedLayoutConfig:namespace).unminifyConfig} instead\n */\n unminifyConfig(config: ResolvedLayoutConfig): ResolvedLayoutConfig {\n return ResolvedLayoutConfig.unminifyConfig(config);\n }\n\n /** @internal */\n abstract bindComponent(container: ComponentContainer, itemConfig: ResolvedComponentItemConfig): ComponentContainer.BindableComponent;\n /** @internal */\n abstract unbindComponent(container: ComponentContainer, virtual: boolean, component: ComponentContainer.Component | undefined): void;\n\n /**\n * Called from GoldenLayout class. Finishes of init\n * @internal\n */\n init(): void {\n this.setContainer();\n this._dropTargetIndicator = new DropTargetIndicator(/*this.container*/);\n this._transitionIndicator = new TransitionIndicator();\n this.updateSizeFromContainer();\n\n let subWindowRootConfig: ComponentItemConfig | undefined;\n if (this.isSubWindow) {\n if (this._constructorOrSubWindowLayoutConfig === undefined) {\n // SubWindow LayoutConfig should have been generated by constructor\n throw new UnexpectedUndefinedError('LMIU07155');\n } else {\n const root = this._constructorOrSubWindowLayoutConfig.root;\n if (root === undefined) {\n // SubWindow LayoutConfig must not be empty\n throw new AssertError('LMIC07156');\n } else {\n if (ItemConfig.isComponent(root)) {\n subWindowRootConfig = root;\n } else {\n // SubWindow LayoutConfig must have Component as Root\n throw new AssertError('LMIC07157');\n }\n }\n const resolvedLayoutConfig = LayoutConfig.resolve(this._constructorOrSubWindowLayoutConfig);\n // remove root from layoutConfig\n this.layoutConfig = {\n ...resolvedLayoutConfig,\n root: undefined,\n }\n }\n } else {\n if (this._constructorOrSubWindowLayoutConfig === undefined) {\n this.layoutConfig = ResolvedLayoutConfig.createDefault(); // will overwritten be loaded via loadLayout\n } else {\n // backwards compatibility\n this.layoutConfig = LayoutConfig.resolve(this._constructorOrSubWindowLayoutConfig);\n }\n }\n const layoutConfig = this.layoutConfig;\n this._groundItem = new GroundItem(this, layoutConfig.root, this._containerElement);\n this._groundItem.init();\n\n this.checkLoadedLayoutMaximiseItem();\n\n this._resizeObserver.observe(this._containerElement);\n this._isInitialised = true;\n this.adjustColumnsResponsive();\n this.emit('initialised');\n\n if (subWindowRootConfig !== undefined) {\n // must be SubWindow\n this.loadComponentAsRoot(subWindowRootConfig);\n }\n }\n\n /**\n * Loads a new layout\n * @param layoutConfig - New layout to be loaded\n */\n loadLayout(layoutConfig: LayoutConfig): void {\n if (!this.isInitialised) {\n // In case application not correctly using legacy constructor\n throw new Error('GoldenLayout: Need to call init() if LayoutConfig with defined root passed to constructor')\n } else {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMLL11119');\n } else {\n this.createSubWindows(); // still needs to be tested\n\n this.layoutConfig = LayoutConfig.resolve(layoutConfig);\n this._groundItem.loadRoot(this.layoutConfig.root);\n this.checkLoadedLayoutMaximiseItem();\n this.adjustColumnsResponsive();\n }\n }\n }\n\n /**\n * Creates a layout configuration object based on the the current state\n *\n * @public\n * @returns GoldenLayout configuration\n */\n saveLayout(): ResolvedLayoutConfig {\n if (this._isInitialised === false) {\n throw new Error('Can\\'t create config, layout not yet initialised');\n } else {\n\n // if (root !== undefined && !(root instanceof ContentItem)) {\n // throw new Error('Root must be a ContentItem');\n // }\n\n /*\n * Content\n */\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMTC18244');\n } else {\n const groundContent = this._groundItem.calculateConfigContent();\n\n let rootItemConfig: ResolvedRootItemConfig | undefined;\n if (groundContent.length !== 1) {\n rootItemConfig = undefined;\n } else {\n rootItemConfig = groundContent[0];\n }\n\n /*\n * Retrieve config for subwindows\n */\n this.reconcilePopoutWindows();\n const openPopouts: ResolvedPopoutLayoutConfig[] = [];\n for (let i = 0; i < this._openPopouts.length; i++) {\n openPopouts.push(this._openPopouts[i].toConfig());\n }\n\n const config: ResolvedLayoutConfig = {\n root: rootItemConfig,\n openPopouts,\n settings: ResolvedLayoutConfig.Settings.createCopy(this.layoutConfig.settings),\n dimensions: ResolvedLayoutConfig.Dimensions.createCopy(this.layoutConfig.dimensions),\n header: ResolvedLayoutConfig.Header.createCopy(this.layoutConfig.header),\n resolved: true,\n }\n\n return config;\n }\n }\n }\n\n /**\n * Removes any existing layout. Effectively, an empty layout will be loaded.\n */\n\n clear(): void {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMCL11129');\n } else {\n this._groundItem.clearRoot();\n }\n }\n\n /**\n * @deprecated Use {@link (LayoutManager:class).saveLayout}\n */\n toConfig(): ResolvedLayoutConfig {\n return this.saveLayout();\n }\n\n /**\n * Adds a new ComponentItem. Will use default location selectors to ensure a location is found and\n * component is successfully added\n * @param componentTypeName - Name of component type to be created.\n * @param state - Optional initial state to be assigned to component\n * @returns New ComponentItem created.\n */\n newComponent(componentType: JsonValue, componentState?: JsonValue, title?: string): ComponentItem {\n const componentItem = this.newComponentAtLocation(componentType, componentState, title);\n if (componentItem === undefined) {\n throw new AssertError('LMNC65588');\n } else {\n return componentItem;\n }\n }\n\n /**\n * Adds a ComponentItem at the first valid selector location.\n * @param componentTypeName - Name of component type to be created.\n * @param state - Optional initial state to be assigned to component\n * @param locationSelectors - Array of location selectors used to find location in layout where component\n * will be added. First location in array which is valid will be used. If locationSelectors is undefined,\n * {@link (LayoutManager:namespace).defaultLocationSelectors} will be used\n * @returns New ComponentItem created or undefined if no valid location selector was in array.\n */\n newComponentAtLocation(componentType: JsonValue, componentState?: JsonValue, title?: string,\n locationSelectors?: LayoutManager.LocationSelector[]\n ): ComponentItem | undefined{\n if (this._groundItem === undefined) {\n throw new Error('Cannot add component before init');\n } else {\n const location = this.addComponentAtLocation(componentType, componentState, title, locationSelectors);\n if (location === undefined) {\n return undefined;\n } else {\n const createdItem = location.parentItem.contentItems[location.index];\n if (!ContentItem.isComponentItem(createdItem)) {\n throw new AssertError('LMNC992877533');\n } else {\n return createdItem;\n }\n }\n }\n }\n\n /**\n * Adds a new ComponentItem. Will use default location selectors to ensure a location is found and\n * component is successfully added\n * @param componentType - Type of component to be created.\n * @param state - Optional initial state to be assigned to component\n * @returns Location of new ComponentItem created.\n */\n addComponent(componentType: JsonValue, componentState?: JsonValue, title?: string): LayoutManager.Location {\n const location = this.addComponentAtLocation(componentType, componentState, title);\n if (location === undefined) {\n throw new AssertError('LMAC99943');\n } else {\n return location;\n }\n }\n\n /**\n * Adds a ComponentItem at the first valid selector location.\n * @param componentType - Type of component to be created.\n * @param state - Optional initial state to be assigned to component\n * @param locationSelectors - Array of location selectors used to find determine location in layout where component\n * will be added. First location in array which is valid will be used. If undefined,\n * {@link (LayoutManager:namespace).defaultLocationSelectors} will be used.\n * @returns Location of new ComponentItem created or undefined if no valid location selector was in array.\n */\n addComponentAtLocation(componentType: JsonValue, componentState?: JsonValue, title?: string,\n locationSelectors?: readonly LayoutManager.LocationSelector[]\n ): LayoutManager.Location | undefined {\n const itemConfig: ComponentItemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n\n return this.addItemAtLocation(itemConfig, locationSelectors);\n }\n\n /**\n * Adds a new ContentItem. Will use default location selectors to ensure a location is found and\n * component is successfully added\n * @param itemConfig - ResolvedItemConfig of child to be added.\n * @returns New ContentItem created.\n */\n newItem(itemConfig: RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig): ContentItem {\n const contentItem = this.newItemAtLocation(itemConfig);\n if (contentItem === undefined) {\n throw new AssertError('LMNC65588');\n } else {\n return contentItem;\n }\n }\n\n /**\n * Adds a new child ContentItem under the root ContentItem. If a root does not exist, then create root ContentItem instead\n * @param itemConfig - ResolvedItemConfig of child to be added.\n * @param locationSelectors - Array of location selectors used to find determine location in layout where ContentItem\n * will be added. First location in array which is valid will be used. If undefined,\n * {@link (LayoutManager:namespace).defaultLocationSelectors} will be used.\n * @returns New ContentItem created or undefined if no valid location selector was in array. */\n newItemAtLocation(itemConfig: RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig,\n locationSelectors?: readonly LayoutManager.LocationSelector[]\n ): ContentItem | undefined {\n if (this._groundItem === undefined) {\n throw new Error('Cannot add component before init');\n } else {\n const location = this.addItemAtLocation(itemConfig, locationSelectors);\n if (location === undefined) {\n return undefined;\n } else {\n const createdItem = location.parentItem.contentItems[location.index];\n return createdItem;\n }\n }\n }\n\n /**\n * Adds a new ContentItem. Will use default location selectors to ensure a location is found and\n * component is successfully added.\n * @param itemConfig - ResolvedItemConfig of child to be added.\n * @returns Location of new ContentItem created. */\n addItem(itemConfig: RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig): LayoutManager.Location {\n const location = this.addItemAtLocation(itemConfig);\n if (location === undefined) {\n throw new AssertError('LMAI99943');\n } else {\n return location;\n }\n }\n\n /**\n * Adds a ContentItem at the first valid selector location.\n * @param itemConfig - ResolvedItemConfig of child to be added.\n * @param locationSelectors - Array of location selectors used to find determine location in layout where ContentItem\n * will be added. First location in array which is valid will be used. If undefined,\n * {@link (LayoutManager:namespace).defaultLocationSelectors} will be used.\n * @returns Location of new ContentItem created or undefined if no valid location selector was in array. */\n addItemAtLocation(itemConfig: RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig,\n locationSelectors?: readonly LayoutManager.LocationSelector[]\n ): LayoutManager.Location | undefined {\n if (this._groundItem === undefined) {\n throw new Error('Cannot add component before init');\n } else {\n if (locationSelectors === undefined) {\n // defaultLocationSelectors should always find a location\n locationSelectors = LayoutManager.defaultLocationSelectors;\n }\n\n const location = this.findFirstLocation(locationSelectors);\n if (location === undefined) {\n return undefined;\n } else {\n let parentItem = location.parentItem;\n let addIdx: number;\n switch (parentItem.type) {\n case ItemType.ground: {\n const groundItem = parentItem as GroundItem;\n addIdx = groundItem.addItem(itemConfig, location.index);\n if (addIdx >= 0) {\n parentItem = this._groundItem.contentItems[0]; // was added to rootItem\n } else {\n addIdx = 0; // was added as rootItem (which is the first and only ContentItem in GroundItem)\n }\n break;\n }\n case ItemType.row:\n case ItemType.column: {\n const rowOrColumn = parentItem as RowOrColumn;\n addIdx = rowOrColumn.addItem(itemConfig, location.index);\n break;\n }\n case ItemType.stack: {\n if (!ItemConfig.isComponent(itemConfig)) {\n throw Error(i18nStrings[I18nStringId.ItemConfigIsNotTypeComponent]);\n } else {\n const stack = parentItem as Stack;\n addIdx = stack.addItem(itemConfig, location.index);\n break;\n }\n }\n case ItemType.component: {\n throw new AssertError('LMAIALC87444602');\n }\n default:\n throw new UnreachableCaseError('LMAIALU98881733', parentItem.type);\n }\n\n if (ItemConfig.isComponent(itemConfig)) {\n // see if stack was inserted\n const item = parentItem.contentItems[addIdx];\n if (ContentItem.isStack(item)) {\n parentItem = item;\n addIdx = 0;\n }\n }\n\n location.parentItem = parentItem;\n location.index = addIdx;\n\n return location;\n }\n }\n }\n\n /** Loads the specified component ResolvedItemConfig as root.\n * This can be used to display a Component all by itself. The layout cannot be changed other than having another new layout loaded.\n * Note that, if this layout is saved and reloaded, it will reload with the Component as a child of a Stack.\n */\n loadComponentAsRoot(itemConfig: ComponentItemConfig): void {\n if (this._groundItem === undefined) {\n throw new Error('Cannot add item before init');\n } else {\n this._groundItem.loadComponentAsRoot(itemConfig);\n }\n }\n\n /** @deprecated Use {@link (LayoutManager:class).setSize} */\n updateSize(width: number, height: number): void {\n this.setSize(width, height);\n }\n\n /**\n * Updates the layout managers size\n *\n * @param width - Width in pixels\n * @param height - Height in pixels\n */\n setSize(width: number, height: number): void {\n this._width = width;\n this._height = height;\n\n if (this._isInitialised === true) {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMUS18881');\n } else {\n this._groundItem.setSize(this._width, this._height);\n\n if (this._maximisedStack) {\n const { width, height } = getElementWidthAndHeight(this._containerElement);\n setElementWidth(this._maximisedStack.element, width);\n setElementHeight(this._maximisedStack.element, height);\n this._maximisedStack.updateSize(false);\n }\n\n this.adjustColumnsResponsive();\n }\n }\n }\n\n /** @internal */\n beginSizeInvalidation(): void {\n this._sizeInvalidationBeginCount++;\n }\n\n /** @internal */\n endSizeInvalidation(): void {\n if (--this._sizeInvalidationBeginCount === 0) {\n this.updateSizeFromContainer();\n }\n }\n\n /** @internal */\n updateSizeFromContainer(): void {\n const { width, height } = getElementWidthAndHeight(this._containerElement);\n this.setSize(width, height);\n }\n\n /**\n * Update the size of the root ContentItem. This will update the size of all contentItems in the tree\n * @param force - In some cases the size is not updated if it has not changed. In this case, events\n * (such as ComponentContainer.virtualRectingRequiredEvent) are not fired. Setting force to true, ensures the size is updated regardless, and\n * the respective events are fired. This is sometimes necessary when a component's size has not changed but it has become visible, and the\n * relevant events need to be fired.\n */\n updateRootSize(force = false): void {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMURS28881');\n } else {\n this._groundItem.updateSize(force);\n }\n }\n\n /** @public */\n createAndInitContentItem(config: ResolvedItemConfig, parent: ContentItem): ContentItem {\n const newItem = this.createContentItem(config, parent);\n newItem.init();\n return newItem;\n }\n\n /**\n * Recursively creates new item tree structures based on a provided\n * ItemConfiguration object\n *\n * @param config - ResolvedItemConfig\n * @param parent - The item the newly created item should be a child of\n * @internal\n */\n createContentItem(config: ResolvedItemConfig, parent: ContentItem): ContentItem {\n if (typeof config.type !== 'string') {\n throw new ConfigurationError('Missing parameter \\'type\\'', JSON.stringify(config));\n }\n\n /**\n * We add an additional stack around every component that's not within a stack anyways.\n */\n if (\n // If this is a component\n ResolvedItemConfig.isComponentItem(config) &&\n\n // and it's not already within a stack\n !(parent instanceof Stack) &&\n\n // and we have a parent\n !!parent &&\n\n // and it's not the topmost item in a new window\n !(this.isSubWindow === true && parent instanceof GroundItem)\n ) {\n const stackConfig: ResolvedStackItemConfig = {\n type: ItemType.stack,\n content: [config],\n size: config.size,\n sizeUnit: config.sizeUnit,\n minSize: config.minSize,\n minSizeUnit: config.minSizeUnit,\n id: config.id,\n maximised: config.maximised,\n isClosable: config.isClosable,\n activeItemIndex: 0,\n header: undefined,\n };\n\n config = stackConfig;\n }\n\n const contentItem = this.createContentItemFromConfig(config, parent);\n return contentItem;\n }\n\n findFirstComponentItemById(id: string): ComponentItem | undefined {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFFCIBI82446');\n } else {\n return this.findFirstContentItemTypeByIdRecursive(ItemType.component, id, this._groundItem) as ComponentItem;\n }\n }\n\n /**\n * Creates a popout window with the specified content at the specified position\n *\n * @param itemConfigOrContentItem - The content of the popout window's layout manager derived from either\n * a {@link (ContentItem:class)} or {@link (ItemConfig:interface)} or ResolvedItemConfig content (array of {@link (ItemConfig:interface)})\n * @param positionAndSize - The width, height, left and top of Popout window\n * @param parentId -The id of the element this item will be appended to when popIn is called\n * @param indexInParent - The position of this item within its parent element\n */\n\n createPopout(itemConfigOrContentItem: ContentItem | ResolvedRootItemConfig,\n positionAndSize: ResolvedPopoutLayoutConfig.Window,\n parentId: string | null,\n indexInParent: number | null\n ): BrowserPopout {\n if (itemConfigOrContentItem instanceof ContentItem) {\n return this.createPopoutFromContentItem(itemConfigOrContentItem, positionAndSize, parentId, indexInParent);\n } else {\n return this.createPopoutFromItemConfig(itemConfigOrContentItem, positionAndSize, parentId, indexInParent);\n }\n }\n\n /** @internal */\n createPopoutFromContentItem(item: ContentItem,\n window: ResolvedPopoutLayoutConfig.Window | undefined,\n parentId: string | null,\n indexInParent: number | null | undefined,\n ): BrowserPopout {\n /**\n * If the item is the only component within a stack or for some\n * other reason the only child of its parent the parent will be destroyed\n * when the child is removed.\n *\n * In order to support this we move up the tree until we find something\n * that will remain after the item is being popped out\n */\n let parent = item.parent;\n let child = item;\n while (parent !== null && parent.contentItems.length === 1 && !parent.isGround) {\n child = parent;\n parent = parent.parent;\n }\n\n if (parent === null) {\n throw new UnexpectedNullError('LMCPFCI00834');\n } else {\n if (indexInParent === undefined) {\n indexInParent = parent.contentItems.indexOf(child);\n }\n\n if (parentId !== null) {\n parent.addPopInParentId(parentId);\n }\n\n if (window === undefined) {\n const windowLeft = globalThis.screenX || globalThis.screenLeft;\n const windowTop = globalThis.screenY || globalThis.screenTop;\n const offsetLeft = item.element.offsetLeft;\n const offsetTop = item.element.offsetTop\n // const { left: offsetLeft, top: offsetTop } = getJQueryLeftAndTop(item.element);\n const { width, height } = getElementWidthAndHeight(item.element);\n\n window = {\n left: windowLeft + offsetLeft,\n top: windowTop + offsetTop,\n width,\n height,\n };\n }\n\n const itemConfig = item.toConfig();\n item.remove();\n\n if (!ResolvedRootItemConfig.isRootItemConfig(itemConfig)) {\n throw new Error(`${i18nStrings[I18nStringId.PopoutCannotBeCreatedWithGroundItemConfig]}`);\n } else {\n return this.createPopoutFromItemConfig(itemConfig, window, parentId, indexInParent);\n }\n }\n }\n\n /** @internal */\n beginVirtualSizedContainerAdding(): void {\n if (++this._virtualSizedContainerAddingBeginCount === 0) {\n this._virtualSizedContainers.length = 0;\n }\n }\n\n /** @internal */\n addVirtualSizedContainer(container: ComponentContainer): void {\n this._virtualSizedContainers.push(container);\n }\n\n /** @internal */\n endVirtualSizedContainerAdding(): void {\n if (--this._virtualSizedContainerAddingBeginCount === 0) {\n const count = this._virtualSizedContainers.length;\n if (count > 0) {\n this.fireBeforeVirtualRectingEvent(count);\n for (let i = 0; i < count; i++) {\n const container = this._virtualSizedContainers[i];\n container.notifyVirtualRectingRequired();\n }\n this.fireAfterVirtualRectingEvent();\n this._virtualSizedContainers.length = 0;\n }\n }\n }\n\n /** @internal */\n fireBeforeVirtualRectingEvent(count: number): void {\n if (this.beforeVirtualRectingEvent !== undefined) {\n this.beforeVirtualRectingEvent(count);\n }\n }\n\n /** @internal */\n fireAfterVirtualRectingEvent(): void {\n if (this.afterVirtualRectingEvent !== undefined) {\n this.afterVirtualRectingEvent();\n }\n }\n\n /** @internal */\n private createPopoutFromItemConfig(rootItemConfig: ResolvedRootItemConfig,\n window: ResolvedPopoutLayoutConfig.Window,\n parentId: string | null,\n indexInParent: number | null\n ) {\n const layoutConfig = this.toConfig();\n\n const popoutLayoutConfig: ResolvedPopoutLayoutConfig = {\n root: rootItemConfig,\n openPopouts: [],\n settings: layoutConfig.settings,\n dimensions: layoutConfig.dimensions,\n header: layoutConfig.header,\n window,\n parentId,\n indexInParent,\n resolved: true,\n }\n\n return this.createPopoutFromPopoutLayoutConfig(popoutLayoutConfig);\n }\n\n /** @internal */\n createPopoutFromPopoutLayoutConfig(config: ResolvedPopoutLayoutConfig): BrowserPopout {\n const configWindow = config.window;\n const initialWindow: Rect = {\n left: configWindow.left ?? (globalThis.screenX || globalThis.screenLeft + 20),\n top: configWindow.top ?? (globalThis.screenY || globalThis.screenTop + 20),\n width: configWindow.width ?? 500,\n height: configWindow.height ?? 309,\n };\n\n const browserPopout = new BrowserPopout(config, initialWindow, this);\n\n browserPopout.on('initialised', () => this.emit('windowOpened', browserPopout));\n browserPopout.on('closed', () => this.reconcilePopoutWindows());\n\n this._openPopouts.push(browserPopout);\n\n if (this.layoutConfig.settings.closePopoutsOnUnload && !this._windowBeforeUnloadListening) {\n globalThis.addEventListener('beforeunload', this._windowBeforeUnloadListener, { passive: true });\n this._windowBeforeUnloadListening = true;\n }\n\n return browserPopout;\n }\n\n /**\n * Closes all Open Popouts\n * Applications can call this method when a page is unloaded to remove its open popouts\n */\n\n closeAllOpenPopouts() {\n for (let i = 0; i < this._openPopouts.length; i++) {\n this._openPopouts[i].close();\n }\n\n this._openPopouts.length = 0;\n\n if (this._windowBeforeUnloadListening) {\n globalThis.removeEventListener('beforeunload', this._windowBeforeUnloadListener);\n this._windowBeforeUnloadListening = false;\n }\n }\n\n /**\n * Attaches DragListener to any given DOM element\n * and turns it into a way of creating new ComponentItems\n * by 'dragging' the DOM element into the layout\n *\n * @param element - The HTML element which will be listened to for commencement of drag.\n * @param componentTypeOrItemConfigCallback - Type of component to be created, or a callback which will provide the ItemConfig\n * to be used to create the component.\n * @param componentState - Optional initial state of component. This will be ignored if componentTypeOrFtn is a function.\n *\n * @returns an opaque object that identifies the DOM element\n\t * and the attached itemConfig. This can be used in\n\t * removeDragSource() later to get rid of the drag listeners.\n */\n newDragSource(element: HTMLElement, itemConfigCallback: () => (DragSource.ComponentItemConfig | ComponentItemConfig)): DragSource;\n /** @deprecated will be replaced in version 3 with newDragSource(element: HTMLElement, itemConfig: ComponentItemConfig) */\n newDragSource(element: HTMLElement, componentType: JsonValue, componentState?: JsonValue, title?: JsonValue, id?: string): DragSource;\n newDragSource(element: HTMLElement,\n componentTypeOrItemConfigCallback: JsonValue | (() => (DragSource.ComponentItemConfig | ComponentItemConfig)),\n componentState?: JsonValue,\n title?: string,\n id?: string,\n ): DragSource {\n const dragSource = new DragSource(this, element, [], componentTypeOrItemConfigCallback, componentState, title, id);\n this._dragSources.push(dragSource);\n\n return dragSource;\n }\n\n /**\n\t * Removes a DragListener added by createDragSource() so the corresponding\n\t * DOM element is not a drag source any more.\n\t */\n\tremoveDragSource(dragSource: DragSource): void {\n\t\tremoveFromArray(dragSource, this._dragSources );\n\t\tdragSource.destroy();\n }\n\n /** @internal */\n startComponentDrag(x: number, y: number, dragListener: DragListener, componentItem: ComponentItem, stack: Stack): void {\n new DragProxy(\n x,\n y,\n dragListener,\n this,\n componentItem,\n stack\n );\n }\n\n /**\n * Programmatically focuses an item. This focuses the specified component item\n * and the item emits a focus event\n *\n * @param item - The component item to be focused\n * @param suppressEvent - Whether to emit focus event\n */\n focusComponent(item: ComponentItem, suppressEvent = false): void {\n item.focus(suppressEvent);\n }\n\n /**\n * Programmatically blurs (defocuses) the currently focused component.\n * If a component item is focused, then it is blurred and and the item emits a blur event\n *\n * @param item - The component item to be blurred\n * @param suppressEvent - Whether to emit blur event\n */\n clearComponentFocus(suppressEvent = false): void {\n this.setFocusedComponentItem(undefined, suppressEvent);\n }\n\n /**\n * Programmatically focuses a component item or removes focus (blurs) from an existing focused component item.\n *\n * @param item - If defined, specifies the component item to be given focus. If undefined, clear component focus.\n * @param suppressEvents - Whether to emit focus and blur events\n * @internal\n */\n setFocusedComponentItem(item: ComponentItem | undefined, suppressEvents = false): void {\n if (item !== this._focusedComponentItem) {\n\n let newFocusedParentItem: ComponentParentableItem | undefined;\n if (item === undefined) {\n newFocusedParentItem === undefined;\n } else {\n newFocusedParentItem = item.parentItem;\n }\n\n if (this._focusedComponentItem !== undefined) {\n const oldFocusedItem = this._focusedComponentItem;\n this._focusedComponentItem = undefined;\n oldFocusedItem.setBlurred(suppressEvents);\n const oldFocusedParentItem = oldFocusedItem.parentItem;\n if (newFocusedParentItem === oldFocusedParentItem) {\n newFocusedParentItem = undefined;\n } else {\n oldFocusedParentItem.setFocusedValue(false);\n }\n }\n\n if (item !== undefined) {\n this._focusedComponentItem = item;\n item.setFocused(suppressEvents);\n if (newFocusedParentItem !== undefined) {\n newFocusedParentItem.setFocusedValue(true);\n }\n }\n }\n }\n\n /** @internal */\n private createContentItemFromConfig(config: ResolvedItemConfig, parent: ContentItem): ContentItem {\n switch (config.type) {\n case ItemType.ground: throw new AssertError('LMCCIFC68871');\n case ItemType.row: return new RowOrColumn(false, this, config as ResolvedRowOrColumnItemConfig, parent);\n case ItemType.column: return new RowOrColumn(true, this, config as ResolvedRowOrColumnItemConfig, parent);\n case ItemType.stack: return new Stack(this, config as ResolvedStackItemConfig, parent);\n case ItemType.component:\n return new ComponentItem(this, config as ResolvedComponentItemConfig, parent as Stack);\n default:\n throw new UnreachableCaseError('CCC913564', config.type, 'Invalid Config Item type specified');\n }\n }\n\n /**\n * This should only be called from stack component.\n * Stack will look after docking processing associated with maximise/minimise\n * @internal\n **/\n setMaximisedStack(stack: Stack | undefined): void {\n if (stack === undefined) {\n if (this._maximisedStack !== undefined) {\n this.processMinimiseMaximisedStack();\n }\n } else {\n if (stack !== this._maximisedStack) {\n if (this._maximisedStack !== undefined) {\n this.processMinimiseMaximisedStack();\n }\n\n this.processMaximiseStack(stack);\n }\n }\n }\n\n checkMinimiseMaximisedStack(): void {\n if (this._maximisedStack !== undefined) {\n this._maximisedStack.minimise();\n }\n }\n\n // showAllActiveContentItems() was called from ContentItem.show(). Not sure what its purpose was so have commented out\n // Everything seems to work ok without this. Have left commented code just in case there was a reason for it becomes\n // apparent\n\n // /** @internal */\n // showAllActiveContentItems(): void {\n // const allStacks = this.getAllStacks();\n\n // for (let i = 0; i < allStacks.length; i++) {\n // const stack = allStacks[i];\n // const activeContentItem = stack.getActiveComponentItem();\n\n // if (activeContentItem !== undefined) {\n // if (!(activeContentItem instanceof ComponentItem)) {\n // throw new AssertError('LMSAACIS22298');\n // } else {\n // activeContentItem.container.show();\n // }\n // }\n // }\n // }\n\n // hideAllActiveContentItems() was called from ContentItem.hide(). Not sure what its purpose was so have commented out\n // Everything seems to work ok without this. Have left commented code just in case there was a reason for it becomes\n // apparent\n\n // /** @internal */\n // hideAllActiveContentItems(): void {\n // const allStacks = this.getAllStacks();\n\n // for (let i = 0; i < allStacks.length; i++) {\n // const stack = allStacks[i];\n // const activeContentItem = stack.getActiveComponentItem();\n\n // if (activeContentItem !== undefined) {\n // if (!(activeContentItem instanceof ComponentItem)) {\n // throw new AssertError('LMSAACIH22298');\n // } else {\n // activeContentItem.container.hide();\n // }\n // }\n // }\n // }\n\n /** @internal */\n private cleanupBeforeMaximisedStackDestroyed(event: EventEmitter.BubblingEvent) {\n\t\tif (this._maximisedStack !== null && this._maximisedStack === event.target) {\n\t\t\tthis._maximisedStack.off('beforeItemDestroyed', this._maximisedStackBeforeDestroyedListener);\n\t\t\tthis._maximisedStack = undefined;\n\t\t}\n }\n\n /**\n * This method is used to get around sandboxed iframe restrictions.\n * If 'allow-top-navigation' is not specified in the iframe's 'sandbox' attribute\n * (as is the case with codepens) the parent window is forbidden from calling certain\n * methods on the child, such as window.close() or setting document.location.href.\n *\n * This prevented GoldenLayout popouts from popping in in codepens. The fix is to call\n * _$closeWindow on the child window's gl instance which (after a timeout to disconnect\n * the invoking method from the close call) closes itself.\n *\n * @internal\n */\n closeWindow(): void {\n globalThis.setTimeout(() => globalThis.close(), 1);\n }\n\n /** @internal */\n getArea(x: number, y: number): ContentItem.Area | null {\n let matchingArea = null;\n let smallestSurface = Infinity;\n\n for (let i = 0; i < this._itemAreas.length; i++) {\n const area = this._itemAreas[i];\n\n if (\n x >= area.x1 &&\n x < area.x2 && // x2 is not included in area\n y >= area.y1 &&\n y < area.y2 && // y2 is not included in area\n smallestSurface > area.surface\n ) {\n smallestSurface = area.surface;\n matchingArea = area;\n }\n }\n\n return matchingArea;\n }\n\n /** @internal */\n calculateItemAreas(): void {\n const allContentItems = this.getAllContentItems();\n /**\n * If the last item is dragged out, highlight the entire container size to\n * allow to re-drop it. this.ground.contentiItems.length === 0 at this point\n *\n * Don't include ground into the possible drop areas though otherwise since it\n * will used for every gap in the layout, e.g. splitters\n */\n const groundItem = this._groundItem;\n if (groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMCIAR44365');\n } else {\n if (allContentItems.length === 1) {\n // No root ContentItem (just Ground ContentItem)\n const groundArea = groundItem.getElementArea();\n if (groundArea === null) {\n throw new UnexpectedNullError('LMCIARA44365')\n } else {\n this._itemAreas = [groundArea];\n }\n return;\n } else {\n if (groundItem.contentItems[0].isStack) {\n // if root is Stack, then split stack and sides of Layout are same, so skip sides\n this._itemAreas = [];\n } else {\n // sides of layout\n this._itemAreas = groundItem.createSideAreas();\n }\n\n for (let i = 0; i < allContentItems.length; i++) {\n const stack = allContentItems[i];\n if (ContentItem.isStack(stack)) {\n const area = stack.getArea();\n\n if (area === null) {\n continue;\n } else {\n this._itemAreas.push(area);\n const stackContentAreaDimensions = stack.contentAreaDimensions;\n if (stackContentAreaDimensions === undefined) {\n throw new UnexpectedUndefinedError('LMCIASC45599');\n } else {\n const highlightArea = stackContentAreaDimensions.header.highlightArea\n const surface = (highlightArea.x2 - highlightArea.x1) * (highlightArea.y2 - highlightArea.y1);\n\n const header: ContentItem.Area = {\n x1: highlightArea.x1,\n x2: highlightArea.x2,\n y1: highlightArea.y1,\n y2: highlightArea.y2,\n contentItem: stack,\n surface,\n };\n this._itemAreas.push(header);\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Called as part of loading a new layout (including initial init()).\n * Checks to see layout has a maximised item. If so, it maximises that item.\n * @internal\n */\n private checkLoadedLayoutMaximiseItem() {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMCLLMI43432');\n } else {\n const configMaximisedItems = this._groundItem.getConfigMaximisedItems();\n\n if (configMaximisedItems.length > 0) {\n let item = configMaximisedItems[0];\n if (ContentItem.isComponentItem(item)) {\n const stack = item.parent;\n if (stack === null) {\n throw new UnexpectedNullError('LMXLLMI69999');\n } else {\n item = stack;\n }\n }\n if (!ContentItem.isStack(item)) {\n throw new AssertError('LMCLLMI19993');\n } else {\n item.maximise();\n }\n }\n }\n }\n\n /** @internal */\n private processMaximiseStack(stack: Stack): void {\n this._maximisedStack = stack;\n stack.on('beforeItemDestroyed', this._maximisedStackBeforeDestroyedListener);\n stack.element.classList.add(DomConstants.ClassName.Maximised);\n stack.element.insertAdjacentElement('afterend', this._maximisePlaceholder);\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMMXI19993');\n } else {\n this._groundItem.element.prepend(stack.element);\n const { width, height } = getElementWidthAndHeight(this._containerElement);\n setElementWidth(stack.element, width);\n setElementHeight(stack.element, height);\n stack.updateSize(true);\n stack.focusActiveContentItem();\n this._maximisedStack.emit('maximised');\n this.emit('stateChanged');\n }\n }\n\n /** @internal */\n private processMinimiseMaximisedStack(): void {\n if (this._maximisedStack === undefined) {\n throw new AssertError('LMMMS74422');\n } else {\n const stack = this._maximisedStack;\n if (stack.parent === null) {\n throw new UnexpectedNullError('LMMI13668');\n } else {\n stack.element.classList.remove(DomConstants.ClassName.Maximised);\n this._maximisePlaceholder.insertAdjacentElement('afterend', stack.element);\n this._maximisePlaceholder.remove();\n this.updateRootSize(true);\n this._maximisedStack = undefined;\n stack.off('beforeItemDestroyed', this._maximisedStackBeforeDestroyedListener);\n stack.emit('minimised');\n this.emit('stateChanged');\n }\n }\n }\n\n /**\n * Iterates through the array of open popout windows and removes the ones\n * that are effectively closed. This is necessary due to the lack of reliably\n * listening for window.close / unload events in a cross browser compatible fashion.\n * @internal\n */\n private reconcilePopoutWindows() {\n const openPopouts: BrowserPopout[] = [];\n\n for (let i = 0; i < this._openPopouts.length; i++) {\n if (this._openPopouts[i].getWindow().closed === false) {\n openPopouts.push(this._openPopouts[i]);\n } else {\n this.emit('windowClosed', this._openPopouts[i]);\n }\n }\n\n if (this._openPopouts.length !== openPopouts.length) {\n this._openPopouts = openPopouts;\n this.emit('stateChanged');\n }\n\n }\n\n /**\n * Returns a flattened array of all content items,\n * regardles of level or type\n * @internal\n */\n private getAllContentItems() {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMGACI13130');\n } else {\n return this._groundItem.getAllContentItems();\n }\n }\n\n /**\n * Creates Subwindows (if there are any). Throws an error\n * if popouts are blocked.\n * @internal\n */\n private createSubWindows() {\n for (let i = 0; i < this.layoutConfig.openPopouts.length; i++) {\n const popoutConfig = this.layoutConfig.openPopouts[i];\n this.createPopoutFromPopoutLayoutConfig(popoutConfig);\n }\n }\n\n /**\n * Debounces resize events\n * @internal\n */\n private handleContainerResize(): void {\n if (this.resizeWithContainerAutomatically) {\n this.processResizeWithDebounce();\n }\n }\n\n /**\n * Debounces resize events\n * @internal\n */\n private processResizeWithDebounce(): void {\n if (this.resizeDebounceExtendedWhenPossible) {\n this.checkClearResizeTimeout();\n }\n\n if (this._resizeTimeoutId === undefined) {\n this._resizeTimeoutId = setTimeout(\n () => {\n this._resizeTimeoutId = undefined;\n this.beginSizeInvalidation();\n this.endSizeInvalidation();\n },\n this.resizeDebounceInterval,\n );\n }\n }\n\n private checkClearResizeTimeout() {\n if (this._resizeTimeoutId !== undefined) {\n clearTimeout(this._resizeTimeoutId);\n this._resizeTimeoutId = undefined;\n }\n }\n\n /**\n * Determines what element the layout will be created in\n * @internal\n */\n private setContainer() {\n const bodyElement = document.body;\n const containerElement = this._containerElement ?? bodyElement;\n\n if (containerElement === bodyElement) {\n this.resizeWithContainerAutomatically = true;\n\n const documentElement = document.documentElement;\n documentElement.style.height = '100%';\n documentElement.style.margin = '0';\n documentElement.style.padding = '0';\n documentElement.style.overflow = 'clip';\n bodyElement.style.height = '100%';\n bodyElement.style.margin = '0';\n bodyElement.style.padding = '0';\n bodyElement.style.overflow = 'clip';\n }\n\n this._containerElement = containerElement;\n }\n\n /**\n * Called when the window is closed or the user navigates away\n * from the page\n * @internal\n * @deprecated to be removed in version 3\n */\n private onBeforeUnload(): void {\n this.destroy();\n }\n\n /**\n * Adjusts the number of columns to be lower to fit the screen and still maintain minItemWidth.\n * @internal\n */\n private adjustColumnsResponsive() {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMACR20883');\n } else {\n this._firstLoad = false;\n // If there is no min width set, or not content items, do nothing.\n if (this.useResponsiveLayout() &&\n !this._updatingColumnsResponsive &&\n this._groundItem.contentItems.length > 0 &&\n this._groundItem.contentItems[0].isRow)\n {\n if (this._groundItem === undefined || this._width === null) {\n throw new UnexpectedUndefinedError('LMACR77412');\n } else {\n // If there is only one column, do nothing.\n const columnCount = this._groundItem.contentItems[0].contentItems.length;\n if (columnCount <= 1) {\n return;\n } else {\n // If they all still fit, do nothing.\n const minItemWidth = this.layoutConfig.dimensions.defaultMinItemWidth;\n const totalMinWidth = columnCount * minItemWidth;\n if (totalMinWidth <= this._width) {\n return;\n } else {\n // Prevent updates while it is already happening.\n this._updatingColumnsResponsive = true;\n\n // Figure out how many columns to stack, and put them all in the first stack container.\n const finalColumnCount = Math.max(Math.floor(this._width / minItemWidth), 1);\n const stackColumnCount = columnCount - finalColumnCount;\n\n const rootContentItem = this._groundItem.contentItems[0];\n const allStacks = this.getAllStacks();\n if (allStacks.length === 0) {\n throw new AssertError('LMACRS77413')\n } else {\n const firstStackContainer = allStacks[0];\n for (let i = 0; i < stackColumnCount; i++) {\n // Stack from right.\n const column = rootContentItem.contentItems[rootContentItem.contentItems.length - 1];\n this.addChildContentItemsToContainer(firstStackContainer, column);\n }\n\n this._updatingColumnsResponsive = false;\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Determines if responsive layout should be used.\n *\n * @returns True if responsive layout should be used; otherwise false.\n * @internal\n */\n private useResponsiveLayout() {\n const settings = this.layoutConfig.settings;\n const alwaysResponsiveMode = settings.responsiveMode === ResponsiveMode.always;\n const onLoadResponsiveModeAndFirst = settings.responsiveMode === ResponsiveMode.onload && this._firstLoad;\n return alwaysResponsiveMode || onLoadResponsiveModeAndFirst;\n }\n\n /**\n * Adds all children of a node to another container recursively.\n * @param container - Container to add child content items to.\n * @param node - Node to search for content items.\n * @internal\n */\n private addChildContentItemsToContainer(container: ContentItem, node: ContentItem) {\n const contentItems = node.contentItems;\n if (node instanceof Stack) {\n for (let i = 0; i < contentItems.length; i++) {\n const item = contentItems[i];\n node.removeChild(item, true);\n container.addChild(item);\n }\n } else {\n for (let i = 0; i < contentItems.length; i++) {\n const item = contentItems[i];\n this.addChildContentItemsToContainer(container, item);\n }\n }\n }\n\n /**\n * Finds all the stacks.\n * @returns The found stack containers.\n * @internal\n */\n private getAllStacks() {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFASC52778');\n } else {\n const stacks: Stack[] = [];\n this.findAllStacksRecursive(stacks, this._groundItem);\n\n return stacks;\n }\n }\n\n /** @internal */\n private findFirstContentItemType(type: ItemType): ContentItem | undefined {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFFCIT82446');\n } else {\n return this.findFirstContentItemTypeRecursive(type, this._groundItem);\n }\n }\n\n /** @internal */\n private findFirstContentItemTypeRecursive(type: ItemType, node: ContentItem): ContentItem | undefined {\n const contentItems = node.contentItems;\n const contentItemCount = contentItems.length;\n if (contentItemCount === 0) {\n return undefined;\n } else {\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (contentItem.type === type) {\n return contentItem;\n }\n }\n\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n const foundContentItem = this.findFirstContentItemTypeRecursive(type, contentItem);\n if (foundContentItem !== undefined) {\n return foundContentItem;\n }\n }\n\n return undefined;\n }\n }\n\n /** @internal */\n private findFirstContentItemTypeByIdRecursive(type: ItemType, id: string, node: ContentItem): ContentItem | undefined {\n const contentItems = node.contentItems;\n const contentItemCount = contentItems.length;\n if (contentItemCount === 0) {\n return undefined;\n } else {\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (contentItem.type === type && contentItem.id === id) {\n return contentItem;\n }\n }\n\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n const foundContentItem = this.findFirstContentItemTypeByIdRecursive(type, id, contentItem);\n if (foundContentItem !== undefined) {\n return foundContentItem;\n }\n }\n\n return undefined;\n }\n }\n\n /**\n * Finds all the stack containers.\n *\n * @param stacks - Set of containers to populate.\n * @param node - Current node to process.\n * @internal\n */\n private findAllStacksRecursive(stacks: Stack[], node: ContentItem) {\n const contentItems = node.contentItems;\n for (let i = 0; i < contentItems.length; i++) {\n const item = contentItems[i];\n if (item instanceof Stack) {\n stacks.push(item);\n } else {\n if (!item.isComponent) {\n this.findAllStacksRecursive(stacks, item);\n }\n }\n }\n }\n\n /** @internal */\n private findFirstLocation(selectors: readonly LayoutManager.LocationSelector[]): LayoutManager.Location | undefined {\n const count = selectors.length;\n for (let i = 0; i < count; i++) {\n const selector = selectors[i];\n const location = this.findLocation(selector);\n if (location !== undefined) {\n return location;\n }\n }\n return undefined;\n }\n\n /** @internal */\n private findLocation(selector: LayoutManager.LocationSelector): LayoutManager.Location | undefined {\n const selectorIndex = selector.index;\n switch (selector.typeId) {\n case LayoutManager.LocationSelector.TypeId.FocusedItem: {\n if (this._focusedComponentItem === undefined) {\n return undefined\n } else {\n const parentItem = this._focusedComponentItem.parentItem;\n const parentContentItems = parentItem.contentItems;\n const parentContentItemCount = parentContentItems.length;\n if (selectorIndex === undefined) {\n return { parentItem, index: parentContentItemCount };\n } else {\n const focusedIndex = parentContentItems.indexOf(this._focusedComponentItem);\n const index = focusedIndex + selectorIndex;\n if (index < 0 || index > parentContentItemCount) {\n return undefined;\n } else {\n return { parentItem, index };\n }\n }\n }\n }\n case LayoutManager.LocationSelector.TypeId.FocusedStack: {\n if (this._focusedComponentItem === undefined) {\n return undefined\n } else {\n const parentItem = this._focusedComponentItem.parentItem;\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n case LayoutManager.LocationSelector.TypeId.FirstStack: {\n const parentItem = this.findFirstContentItemType(ItemType.stack);\n if (parentItem === undefined) {\n return undefined;\n } else {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n case LayoutManager.LocationSelector.TypeId.FirstRowOrColumn: {\n let parentItem = this.findFirstContentItemType(ItemType.row);\n if (parentItem !== undefined) {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n } else {\n parentItem = this.findFirstContentItemType(ItemType.column);\n if (parentItem !== undefined) {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n } else {\n return undefined;\n }\n }\n }\n case LayoutManager.LocationSelector.TypeId.FirstRow: {\n const parentItem = this.findFirstContentItemType(ItemType.row);\n if (parentItem === undefined) {\n return undefined;\n } else {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n case LayoutManager.LocationSelector.TypeId.FirstColumn: {\n const parentItem = this.findFirstContentItemType(ItemType.column);\n if (parentItem === undefined) {\n return undefined;\n } else {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n case LayoutManager.LocationSelector.TypeId.Empty: {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFLRIF18244');\n } else {\n if (this.rootItem !== undefined) {\n return undefined;\n } else {\n if (selectorIndex === undefined || selectorIndex === 0)\n return { parentItem: this._groundItem, index: 0 };\n else {\n return undefined;\n }\n }\n }\n }\n case LayoutManager.LocationSelector.TypeId.Root: {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFLF18244');\n } else {\n const groundContentItems = this._groundItem.contentItems;\n if (groundContentItems.length === 0) {\n if (selectorIndex === undefined || selectorIndex === 0)\n return { parentItem: this._groundItem, index: 0 };\n else {\n return undefined;\n }\n } else {\n const parentItem = groundContentItems[0];\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n }\n }\n }\n\n /** @internal */\n private tryCreateLocationFromParentItem(parentItem: ContentItem,\n selectorIndex: number | undefined\n ): LayoutManager.Location | undefined {\n const parentContentItems = parentItem.contentItems;\n const parentContentItemCount = parentContentItems.length;\n if (selectorIndex === undefined) {\n return { parentItem, index: parentContentItemCount };\n } else {\n if (selectorIndex < 0 || selectorIndex > parentContentItemCount) {\n return undefined;\n } else {\n return { parentItem, index: selectorIndex };\n }\n }\n }\n}\n\n/** @public */\nexport namespace LayoutManager {\n export type BeforeVirtualRectingEvent = (this: void, count: number) => void;\n export type AfterVirtualRectingEvent = (this: void) => void;\n\n /** @internal */\n export interface ConstructorParameters {\n constructorOrSubWindowLayoutConfig: LayoutConfig | undefined;\n isSubWindow: boolean;\n containerElement: HTMLElement | undefined;\n }\n\n /** @internal */\n export function createMaximisePlaceElement(document: Document): HTMLElement {\n const element = document.createElement('div');\n element.classList.add(DomConstants.ClassName.MaximisePlace);\n return element;\n }\n\n /** @internal */\n export function createTabDropPlaceholderElement(document: Document): HTMLElement {\n const element = document.createElement('div');\n element.classList.add(DomConstants.ClassName.DropTabPlaceholder);\n return element;\n }\n\n /**\n * Specifies a location of a ContentItem without referencing the content item.\n * Used to specify where a new item is to be added\n * @public\n */\n export interface Location {\n parentItem: ContentItem;\n index: number;\n }\n\n /**\n * A selector used to specify a unique location in the layout\n * @public\n */\n export interface LocationSelector {\n /** Specifies selector algorithm */\n typeId: LocationSelector.TypeId;\n /** Used by algorithm to determine index in found ContentItem */\n index?: number;\n }\n\n /** @public */\n export namespace LocationSelector {\n export const enum TypeId {\n /** Stack with focused Item. Index specifies offset from index of focused item (eg 1 is the position after focused item) */\n FocusedItem,\n /** Stack with focused Item. Index specfies ContentItems index */\n FocusedStack,\n /** First stack found in layout */\n FirstStack,\n /** First Row or Column found in layout (rows are searched first) */\n FirstRowOrColumn,\n /** First Row in layout */\n FirstRow,\n /** First Column in layout */\n FirstColumn,\n /** Finds a location if layout is empty. The found location will be the root ContentItem. */\n Empty,\n /** Finds root if layout is empty, otherwise a child under root */\n Root,\n }\n }\n\n /**\n * Default LocationSelectors array used if none is specified. Will always find a location.\n * @public\n */\n export const defaultLocationSelectors: readonly LocationSelector[] = [\n { typeId: LocationSelector.TypeId.FocusedStack, index: undefined },\n { typeId: LocationSelector.TypeId.FirstStack, index: undefined },\n { typeId: LocationSelector.TypeId.FirstRowOrColumn, index: undefined },\n { typeId: LocationSelector.TypeId.Root, index: undefined },\n ];\n\n /**\n * LocationSelectors to try to get location next to existing focused item\n * @public\n */\n export const afterFocusedItemIfPossibleLocationSelectors: readonly LocationSelector[] = [\n { typeId: LocationSelector.TypeId.FocusedItem, index: 1 },\n { typeId: LocationSelector.TypeId.FirstStack, index: undefined },\n { typeId: LocationSelector.TypeId.FirstRowOrColumn, index: undefined },\n { typeId: LocationSelector.TypeId.Root, index: undefined },\n ];\n}\n","import { LayoutConfig } from './config/config';\nimport { ResolvedComponentItemConfig, ResolvedLayoutConfig, ResolvedPopoutLayoutConfig } from './config/resolved-config';\nimport { ComponentContainer } from './container/component-container';\nimport { BindError } from './errors/external-error';\nimport { UnexpectedUndefinedError } from './errors/internal-error';\nimport { LayoutManager } from './layout-manager';\nimport { DomConstants } from './utils/dom-constants';\nimport { I18nStringId, i18nStrings } from './utils/i18n-strings';\n\n/** @public */\nexport class VirtualLayout extends LayoutManager {\n /**\n * @deprecated Use {@link (VirtualLayout:class).bindComponentEvent} and\n * {@link (VirtualLayout:class).unbindComponentEvent} with virtual components\n */\n getComponentEvent: VirtualLayout.GetComponentEventHandler | undefined;\n /**\n * @deprecated Use {@link (VirtualLayout:class).bindComponentEvent} and\n * {@link (VirtualLayout:class).unbindComponentEvent} with virtual components\n */\n releaseComponentEvent: VirtualLayout.ReleaseComponentEventHandler | undefined;\n\n bindComponentEvent: VirtualLayout.BindComponentEventHandler | undefined;\n unbindComponentEvent: VirtualLayout.UnbindComponentEventHandler | undefined;\n\n /** @internal @deprecated use while constructor is not determinate */\n private _bindComponentEventHanlderPassedInConstructor = false; // remove when constructor is determinate\n /** @internal @deprecated use while constructor is not determinate */\n private _creationTimeoutPassed = false; // remove when constructor is determinate\n\n /**\n * @param container - A Dom HTML element. Defaults to body\n * @param bindComponentEventHandler - Event handler to bind components\n * @param bindComponentEventHandler - Event handler to unbind components\n * If bindComponentEventHandler is defined, then constructor will be determinate. It will always call the init()\n * function and the init() function will always complete. This means that the bindComponentEventHandler will be called\n * if constructor is for a popout window. Make sure bindComponentEventHandler is ready for events.\n */\n constructor(\n container?: HTMLElement,\n bindComponentEventHandler?: VirtualLayout.BindComponentEventHandler,\n unbindComponentEventHandler?: VirtualLayout.UnbindComponentEventHandler,\n );\n /** @deprecated specify layoutConfig in {@link (LayoutManager:class).loadLayout} */\n constructor(config: LayoutConfig, container?: HTMLElement);\n /** @internal */\n constructor(configOrOptionalContainer: LayoutConfig | HTMLElement | undefined,\n containerOrBindComponentEventHandler: HTMLElement | VirtualLayout.BindComponentEventHandler | undefined,\n unbindComponentEventHandler: VirtualLayout.UnbindComponentEventHandler | undefined,\n skipInit: true,\n );\n /** @internal */\n constructor(configOrOptionalContainer: LayoutConfig | HTMLElement | undefined,\n containerOrBindComponentEventHandler?: HTMLElement | VirtualLayout.BindComponentEventHandler,\n unbindComponentEventHandler?: VirtualLayout.UnbindComponentEventHandler,\n skipInit?: true,\n ) {\n super(VirtualLayout.createLayoutManagerConstructorParameters(configOrOptionalContainer, containerOrBindComponentEventHandler));\n\n if (containerOrBindComponentEventHandler !== undefined) {\n if (typeof containerOrBindComponentEventHandler === 'function') {\n this.bindComponentEvent = containerOrBindComponentEventHandler;\n this._bindComponentEventHanlderPassedInConstructor = true;\n\n if (unbindComponentEventHandler !== undefined) {\n this.unbindComponentEvent = unbindComponentEventHandler;\n }\n }\n }\n\n if (!this._bindComponentEventHanlderPassedInConstructor) {\n // backward compatibility\n\n if (this.isSubWindow) {\n // document.body.style.visibility = 'hidden';\n // Set up layoutConfig since constructor is not determinate and may exit early. Other functions may need\n // this.layoutConfig. this.layoutConfig is again calculated in the same way when init() completes.\n // Remove this when constructor is determinate.\n if (this._constructorOrSubWindowLayoutConfig === undefined) {\n throw new UnexpectedUndefinedError('VLC98823');\n } else {\n const resolvedLayoutConfig = LayoutConfig.resolve(this._constructorOrSubWindowLayoutConfig);\n // remove root from layoutConfig\n this.layoutConfig = {\n ...resolvedLayoutConfig,\n root: undefined,\n }\n }\n }\n }\n\n if (skipInit !== true) {\n if (!this.deprecatedConstructor) {\n this.init();\n }\n }\n }\n\n override destroy(): void {\n this.bindComponentEvent = undefined;\n this.unbindComponentEvent = undefined;\n\n super.destroy();\n }\n\n\n /**\n * Creates the actual layout. Must be called after all initial components\n * are registered. Recurses through the configuration and sets up\n * the item tree.\n *\n * If called before the document is ready it adds itself as a listener\n * to the document.ready event\n * @deprecated LayoutConfig should not be loaded in {@link (LayoutManager:class)} constructor, but rather in a\n * {@link (LayoutManager:class).loadLayout} call. If LayoutConfig is not specified in {@link (LayoutManager:class)} constructor,\n * then init() will be automatically called internally and should not be called externally.\n */\n override init(): void {\n\n /**\n * If the document isn't ready yet, wait for it.\n */\n if (!this._bindComponentEventHanlderPassedInConstructor && (document.readyState === 'loading' || document.body === null)) {\n document.addEventListener('DOMContentLoaded', () => this.init(), { passive: true });\n return;\n }\n\n /**\n * If this is a subwindow, wait a few milliseconds for the original\n * page's js calls to be executed, then replace the bodies content\n * with GoldenLayout\n */\n if (!this._bindComponentEventHanlderPassedInConstructor && this.isSubWindow === true && !this._creationTimeoutPassed) {\n setTimeout(() => this.init(), 7);\n this._creationTimeoutPassed = true;\n return;\n }\n\n if (this.isSubWindow === true) {\n if (!this._bindComponentEventHanlderPassedInConstructor) {\n this.clearHtmlAndAdjustStylesForSubWindow();\n }\n\n // Expose this instance on the window object to allow the opening window to interact with it\n window.__glInstance = this;\n }\n\n super.init();\n }\n\n /**\n * Clears existing HTML and adjusts style to make window suitable to be a popout sub window\n * Curently is automatically called when window is a subWindow and bindComponentEvent is not passed in the constructor\n * If bindComponentEvent is not passed in the constructor, the application must either call this function explicitly or\n * (preferably) make the window suitable as a subwindow.\n * In the future, it is planned that this function is NOT automatically called in any circumstances. Applications will\n * need to determine whether a window is a Golden Layout popout window and either call this function explicitly or\n * hide HTML not relevant to the popout.\n * See apitest for an example of how HTML is hidden when popout windows are displayed\n */\n clearHtmlAndAdjustStylesForSubWindow(): void {\n const headElement = document.head;\n\n const appendNodeLists = new Array>(4);\n appendNodeLists[0] = document.querySelectorAll('body link');\n appendNodeLists[1] = document.querySelectorAll('body style');\n appendNodeLists[2] = document.querySelectorAll('template');\n appendNodeLists[3] = document.querySelectorAll('.gl_keep');\n\n for (let listIdx = 0; listIdx < appendNodeLists.length; listIdx++) {\n const appendNodeList = appendNodeLists[listIdx];\n for (let nodeIdx = 0; nodeIdx < appendNodeList.length; nodeIdx++) {\n const node = appendNodeList[nodeIdx];\n headElement.appendChild(node);\n }\n }\n\n const bodyElement = document.body;\n bodyElement.innerHTML = '';\n bodyElement.style.visibility = 'visible';\n this.checkAddDefaultPopinButton();\n\n /*\n * This seems a bit pointless, but actually causes a reflow/re-evaluation getting around\n * slickgrid's \"Cannot find stylesheet.\" bug in chrome\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const x = document.body.offsetHeight;\n }\n /**\n * Will add button if not popinOnClose specified in settings\n * @returns true if added otherwise false\n */\n checkAddDefaultPopinButton(): boolean {\n if (this.layoutConfig.settings.popInOnClose) {\n return false;\n } else {\n const popInButtonElement = document.createElement('div');\n popInButtonElement.classList.add(DomConstants.ClassName.Popin);\n popInButtonElement.setAttribute('title', this.layoutConfig.header.dock);\n const iconElement = document.createElement('div');\n iconElement.classList.add(DomConstants.ClassName.Icon);\n const bgElement = document.createElement('div');\n bgElement.classList.add(DomConstants.ClassName.Bg);\n popInButtonElement.appendChild(iconElement);\n popInButtonElement.appendChild(bgElement);\n popInButtonElement.addEventListener('click', () => this.emit('popIn'));\n document.body.appendChild(popInButtonElement);\n return true;\n }\n }\n\n /** @internal */\n override bindComponent(container: ComponentContainer, itemConfig: ResolvedComponentItemConfig): ComponentContainer.BindableComponent {\n if (this.bindComponentEvent !== undefined) {\n const bindableComponent = this.bindComponentEvent(container, itemConfig);\n return bindableComponent;\n } else {\n if (this.getComponentEvent !== undefined) {\n return {\n virtual: false,\n component: this.getComponentEvent(container, itemConfig),\n }\n } else {\n // There is no component registered for this type, and we don't have a getComponentEvent defined.\n // This might happen when the user pops out a dialog and the component types are not registered upfront.\n const text = i18nStrings[I18nStringId.ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned];\n const message = `${text}: ${JSON.stringify(itemConfig)}`\n throw new BindError(message);\n }\n }\n }\n\n /** @internal */\n override unbindComponent(container: ComponentContainer, virtual: boolean, component: ComponentContainer.Component | undefined): void {\n if (this.unbindComponentEvent !== undefined) {\n this.unbindComponentEvent(container);\n } else {\n if (!virtual && this.releaseComponentEvent !== undefined) {\n if (component === undefined) {\n throw new UnexpectedUndefinedError('VCUCRCU333998');\n } else {\n this.releaseComponentEvent(container, component);\n }\n }\n }\n }\n}\n\n/** @public */\nexport namespace VirtualLayout {\n /**\n * @deprecated Use virtual components with {@link (VirtualLayout:class).bindComponentEvent} and\n * {@link (VirtualLayout:class).unbindComponentEvent} events.\n */\n export type GetComponentEventHandler =\n (this: void, container: ComponentContainer, itemConfig: ResolvedComponentItemConfig) => ComponentContainer.Component;\n /**\n * @deprecated Use virtual components with {@link (VirtualLayout:class).bindComponentEvent} and\n * {@link (VirtualLayout:class).unbindComponentEvent} events.\n */\n export type ReleaseComponentEventHandler =\n (this: void, container: ComponentContainer, component: ComponentContainer.Component) => void;\n\n export type BindComponentEventHandler =\n (this: void, container: ComponentContainer, itemConfig: ResolvedComponentItemConfig) => ComponentContainer.BindableComponent;\n export type UnbindComponentEventHandler =\n (this: void, container: ComponentContainer) => void;\n\n export type BeforeVirtualRectingEvent = (this: void) => void;\n\n /** @internal\n * Veriable to hold the state whether we already checked if we are running in a sub window.\n * Fixes popout and creation of nested golden-layouts.\n */\n let subWindowChecked = false;\n\n /** @internal */\n export function createLayoutManagerConstructorParameters(configOrOptionalContainer: LayoutConfig | HTMLElement | undefined,\n containerOrBindComponentEventHandler?: HTMLElement | VirtualLayout.BindComponentEventHandler):\n LayoutManager.ConstructorParameters\n {\n const windowConfigKey = subWindowChecked ? null : new URL(document.location.href).searchParams.get('gl-window');\n subWindowChecked = true;\n const isSubWindow = windowConfigKey !== null;\n\n let containerElement: HTMLElement | undefined;\n let config: LayoutConfig | undefined;\n if (windowConfigKey !== null) {\n const windowConfigStr = localStorage.getItem(windowConfigKey);\n if (windowConfigStr === null) {\n throw new Error('Null gl-window Config');\n }\n localStorage.removeItem(windowConfigKey);\n const minifiedWindowConfig = JSON.parse(windowConfigStr) as ResolvedPopoutLayoutConfig;\n const resolvedConfig = ResolvedLayoutConfig.unminifyConfig(minifiedWindowConfig);\n config = LayoutConfig.fromResolved(resolvedConfig)\n\n if (configOrOptionalContainer instanceof HTMLElement) {\n containerElement = configOrOptionalContainer;\n }\n } else {\n if (configOrOptionalContainer === undefined) {\n config = undefined;\n } else {\n if (configOrOptionalContainer instanceof HTMLElement) {\n config = undefined;\n containerElement = configOrOptionalContainer;\n } else {\n // backwards compatibility\n config = configOrOptionalContainer;\n }\n }\n\n if (containerElement === undefined) {\n if (containerOrBindComponentEventHandler instanceof HTMLElement) {\n containerElement = containerOrBindComponentEventHandler;\n }\n }\n }\n\n return {\n constructorOrSubWindowLayoutConfig: config,\n isSubWindow,\n containerElement,\n };\n }\n}\n","import { GoldenLayout } from 'golden-layout';\n\nconst config = {\n settings: {\n showPopoutIcon: false,\n showCloseIcon: false,\n },\n dimensions: {\n minItemHeight: 40,\n },\n content: [{\n type: 'row',\n content: [{\n type: 'column',\n width: 40,\n content: [{\n type: 'component',\n isClosable: false,\n componentName: 'template',\n title: 'Game',\n componentState: { id: 'client_wrapper' },\n }],\n },\n {\n type: 'column',\n content: [{\n type: 'row',\n height: 65,\n content: [{\n type: 'stack',\n content: [{\n type: 'component',\n isClosable: false,\n title: 'Main',\n componentName: 'template',\n componentState: { id: 'mainmenu' },\n },\n {\n type: 'component',\n isClosable: false,\n title: 'Log',\n componentName: 'template',\n componentState: { id: 'log' },\n }],\n },\n {\n type: 'component',\n title: 'Music',\n width: 30,\n componentName: 'template',\n componentState: { id: 'music' },\n }],\n },\n {\n type: 'row',\n content: [{\n type: 'component',\n title: 'Server chat',\n componentName: 'template',\n componentState: { id: 'ooc' },\n }],\n }],\n }],\n }],\n};\n\nconst golden = new GoldenLayout();\ngolden.registerComponentFactoryFunction('template', (container, componentState) => {\n const template = document.querySelector(`#${componentState.id}`);\n container.element.innerHTML = template.innerHTML;\n // TODO: support multiple locales\n // container.setTitle(document.querySelector(`#${componentState.id} meta[name='frame-title']`).getAttribute(\"content\"));\n});\ngolden.loadLayout(config);\n","import { LayoutConfig } from './config/config';\nimport { ResolvedComponentItemConfig } from './config/resolved-config';\nimport { ComponentContainer } from './container/component-container';\nimport { ApiError, BindError } from './errors/external-error';\nimport { AssertError, UnexpectedUndefinedError } from './errors/internal-error';\nimport { I18nStringId, i18nStrings } from './utils/i18n-strings';\nimport { JsonValue, LogicalZIndex } from './utils/types';\nimport { deepExtendValue, ensureElementPositionAbsolute, numberToPixels, setElementDisplayVisibility, setElementHeight, setElementWidth } from './utils/utils';\nimport { VirtualLayout } from './virtual-layout';\n\n/** @public */\nexport class GoldenLayout extends VirtualLayout {\n /** @internal */\n private _componentTypesMap = new Map();\n /** @internal */\n private _getComponentConstructorFtn: GoldenLayout.GetComponentConstructorCallback;\n\n /** @internal */\n private _registeredComponentMap = new Map();\n /** @internal */\n private _virtuableComponentMap = new Map();\n /** @internal */\n private _goldenLayoutBoundingClientRect: DOMRect;\n\n /** @internal */\n private _containerVirtualRectingRequiredEventListener =\n (container: ComponentContainer, width: number, height: number) => this.handleContainerVirtualRectingRequiredEvent(container, width, height);\n /** @internal */\n private _containerVirtualVisibilityChangeRequiredEventListener =\n (container: ComponentContainer, visible: boolean) => this.handleContainerVirtualVisibilityChangeRequiredEvent(container, visible);\n /** @internal */\n private _containerVirtualZIndexChangeRequiredEventListener =\n (container: ComponentContainer, logicalZIndex: LogicalZIndex, defaultZIndex: string) =>\n this.handleContainerVirtualZIndexChangeRequiredEvent(container, logicalZIndex, defaultZIndex);\n\n /**\n * @param container - A Dom HTML element. Defaults to body\n * @param bindComponentEventHandler - Event handler to bind components\n * @param bindComponentEventHandler - Event handler to unbind components\n * If bindComponentEventHandler is defined, then constructor will be determinate. It will always call the init()\n * function and the init() function will always complete. This means that the bindComponentEventHandler will be called\n * if constructor is for a popout window. Make sure bindComponentEventHandler is ready for events.\n */\n constructor(\n container?: HTMLElement,\n bindComponentEventHandler?: VirtualLayout.BindComponentEventHandler,\n unbindComponentEventHandler?: VirtualLayout.UnbindComponentEventHandler,\n );\n /** @deprecated specify layoutConfig in {@link (LayoutManager:class).loadLayout} */\n constructor(config: LayoutConfig, container?: HTMLElement);\n /** @internal */\n constructor(configOrOptionalContainer: LayoutConfig | HTMLElement | undefined,\n containerOrBindComponentEventHandler?: HTMLElement | VirtualLayout.BindComponentEventHandler,\n unbindComponentEventHandler?: VirtualLayout.UnbindComponentEventHandler,\n ) {\n super(configOrOptionalContainer, containerOrBindComponentEventHandler, unbindComponentEventHandler, true);\n // we told VirtualLayout to not call init() (skipInit set to true) so that Golden Layout can initialise its properties before init is called\n if (!this.deprecatedConstructor) {\n this.init();\n }\n }\n\n /**\n * Register a new component type with the layout manager.\n *\n * @deprecated See {@link https://stackoverflow.com/questions/40922531/how-to-check-if-a-javascript-function-is-a-constructor}\n * instead use {@link (GoldenLayout:class).registerComponentConstructor}\n * or {@link (GoldenLayout:class).registerComponentFactoryFunction}\n */\n registerComponent(name: string,\n componentConstructorOrFactoryFtn: GoldenLayout.ComponentConstructor | GoldenLayout.ComponentFactoryFunction,\n virtual = false\n ): void {\n if (typeof componentConstructorOrFactoryFtn !== 'function') {\n throw new ApiError('registerComponent() componentConstructorOrFactoryFtn parameter is not a function')\n } else {\n if (componentConstructorOrFactoryFtn.hasOwnProperty('prototype')) {\n const componentConstructor = componentConstructorOrFactoryFtn as GoldenLayout.ComponentConstructor;\n this.registerComponentConstructor(name, componentConstructor, virtual);\n } else {\n const componentFactoryFtn = componentConstructorOrFactoryFtn as GoldenLayout.ComponentFactoryFunction;\n this.registerComponentFactoryFunction(name, componentFactoryFtn, virtual);\n }\n }\n }\n\n /**\n * Register a new component type with the layout manager.\n */\n registerComponentConstructor(typeName: string, componentConstructor: GoldenLayout.ComponentConstructor, virtual = false): void {\n if (typeof componentConstructor !== 'function') {\n throw new Error(i18nStrings[I18nStringId.PleaseRegisterAConstructorFunction]);\n }\n\n const existingComponentType = this._componentTypesMap.get(typeName);\n\n if (existingComponentType !== undefined) {\n throw new BindError(`${i18nStrings[I18nStringId.ComponentIsAlreadyRegistered]}: ${typeName}`);\n }\n\n this._componentTypesMap.set(typeName, {\n constructor: componentConstructor,\n factoryFunction: undefined,\n virtual,\n }\n );\n }\n\n /**\n * Register a new component with the layout manager.\n */\n registerComponentFactoryFunction(typeName: string, componentFactoryFunction: GoldenLayout.ComponentFactoryFunction, virtual = false): void {\n if (typeof componentFactoryFunction !== 'function') {\n throw new BindError('Please register a constructor function');\n }\n\n const existingComponentType = this._componentTypesMap.get(typeName);\n\n if (existingComponentType !== undefined) {\n throw new BindError(`${i18nStrings[I18nStringId.ComponentIsAlreadyRegistered]}: ${typeName}`);\n }\n\n this._componentTypesMap.set(typeName, {\n constructor: undefined,\n factoryFunction: componentFactoryFunction,\n virtual,\n }\n );\n }\n\n /**\n * Register a component function with the layout manager. This function should\n * return a constructor for a component based on a config.\n * This function will be called if a component type with the required name is not already registered.\n * It is recommended that applications use the {@link (VirtualLayout:class).getComponentEvent} and\n * {@link (VirtualLayout:class).releaseComponentEvent} instead of registering a constructor callback\n * @deprecated use {@link (GoldenLayout:class).registerGetComponentConstructorCallback}\n */\n registerComponentFunction(callback: GoldenLayout.GetComponentConstructorCallback): void {\n this.registerGetComponentConstructorCallback(callback);\n }\n\n /**\n * Register a callback closure with the layout manager which supplies a Component Constructor.\n * This callback should return a constructor for a component based on a config.\n * This function will be called if a component type with the required name is not already registered.\n * It is recommended that applications use the {@link (VirtualLayout:class).getComponentEvent} and\n * {@link (VirtualLayout:class).releaseComponentEvent} instead of registering a constructor callback\n */\n registerGetComponentConstructorCallback(callback: GoldenLayout.GetComponentConstructorCallback): void {\n if (typeof callback !== 'function') {\n throw new Error('Please register a callback function');\n }\n\n if (this._getComponentConstructorFtn !== undefined) {\n console.warn('Multiple component functions are being registered. Only the final registered function will be used.')\n }\n\n this._getComponentConstructorFtn = callback;\n }\n\n getRegisteredComponentTypeNames(): string[] {\n const typeNamesIterableIterator = this._componentTypesMap.keys();\n return Array.from(typeNamesIterableIterator);\n }\n\n /**\n * Returns a previously registered component instantiator. Attempts to utilize registered\n * component type by first, then falls back to the component constructor callback function (if registered).\n * If neither gets an instantiator, then returns `undefined`.\n * Note that `undefined` will return if config.componentType is not a string\n *\n * @param config - The item config\n * @public\n */\n getComponentInstantiator(config: ResolvedComponentItemConfig): GoldenLayout.ComponentInstantiator | undefined {\n let instantiator: GoldenLayout.ComponentInstantiator | undefined;\n\n const typeName = ResolvedComponentItemConfig.resolveComponentTypeName(config)\n if (typeName !== undefined) {\n instantiator = this._componentTypesMap.get(typeName);\n }\n if (instantiator === undefined) {\n if (this._getComponentConstructorFtn !== undefined) {\n instantiator = {\n constructor: this._getComponentConstructorFtn(config),\n factoryFunction: undefined,\n virtual: false,\n }\n }\n }\n\n return instantiator;\n }\n\n /** @internal */\n override bindComponent(container: ComponentContainer, itemConfig: ResolvedComponentItemConfig): ComponentContainer.BindableComponent {\n let instantiator: GoldenLayout.ComponentInstantiator | undefined;\n\n const typeName = ResolvedComponentItemConfig.resolveComponentTypeName(itemConfig);\n if (typeName !== undefined) {\n instantiator = this._componentTypesMap.get(typeName);\n }\n if (instantiator === undefined) {\n if (this._getComponentConstructorFtn !== undefined) {\n instantiator = {\n constructor: this._getComponentConstructorFtn(itemConfig),\n factoryFunction: undefined,\n virtual: false,\n }\n }\n }\n\n let result: ComponentContainer.BindableComponent;\n if (instantiator !== undefined) {\n const virtual = instantiator.virtual;\n // handle case where component is obtained by name or component constructor callback\n let componentState: JsonValue | undefined;\n if (itemConfig.componentState === undefined) {\n componentState = undefined;\n } else {\n // make copy\n componentState = deepExtendValue({}, itemConfig.componentState) as JsonValue;\n }\n\n let component: ComponentContainer.Component | undefined;\n const componentConstructor = instantiator.constructor;\n if (componentConstructor !== undefined) {\n component = new componentConstructor(container, componentState, virtual);\n } else {\n const factoryFunction = instantiator.factoryFunction;\n if (factoryFunction !== undefined) {\n component = factoryFunction(container, componentState, virtual);\n } else {\n throw new AssertError('LMBCFFU10008');\n }\n }\n\n if (virtual) {\n if (component === undefined) {\n throw new UnexpectedUndefinedError('GLBCVCU988774');\n } else {\n const virtuableComponent = component as GoldenLayout.VirtuableComponent;\n const componentRootElement = virtuableComponent.rootHtmlElement;\n if (componentRootElement === undefined) {\n throw new BindError(`${i18nStrings[I18nStringId.VirtualComponentDoesNotHaveRootHtmlElement]}: ${typeName}`);\n } else {\n ensureElementPositionAbsolute(componentRootElement);\n this.container.appendChild(componentRootElement);\n this._virtuableComponentMap.set(container, virtuableComponent);\n container.virtualRectingRequiredEvent = this._containerVirtualRectingRequiredEventListener;\n container.virtualVisibilityChangeRequiredEvent = this._containerVirtualVisibilityChangeRequiredEventListener;\n container.virtualZIndexChangeRequiredEvent = this._containerVirtualZIndexChangeRequiredEventListener;\n }\n }\n }\n\n this._registeredComponentMap.set(container, component);\n\n result = {\n virtual: instantiator.virtual,\n component,\n };\n\n } else {\n // Use getComponentEvent\n result = super.bindComponent(container, itemConfig);\n }\n\n return result;\n }\n\n /** @internal */\n override unbindComponent(container: ComponentContainer, virtual: boolean, component: ComponentContainer.Component | undefined): void {\n const registeredComponent = this._registeredComponentMap.get(container);\n if (registeredComponent === undefined) {\n super.unbindComponent(container, virtual, component); // was not created from registration so use virtual unbind events\n } else {\n const virtuableComponent = this._virtuableComponentMap.get(container);\n if (virtuableComponent !== undefined) {\n const componentRootElement = virtuableComponent.rootHtmlElement;\n if (componentRootElement === undefined) {\n throw new AssertError('GLUC77743', container.title);\n } else {\n this.container.removeChild(componentRootElement);\n this._virtuableComponentMap.delete(container);\n }\n }\n }\n }\n\n override fireBeforeVirtualRectingEvent(count: number): void {\n this._goldenLayoutBoundingClientRect = this.container.getBoundingClientRect();\n super.fireBeforeVirtualRectingEvent(count);\n }\n\n\n /** @internal */\n private handleContainerVirtualRectingRequiredEvent(container: ComponentContainer, width: number, height: number): void {\n const virtuableComponent = this._virtuableComponentMap.get(container);\n if (virtuableComponent === undefined) {\n throw new UnexpectedUndefinedError('GLHCSCE55933');\n } else {\n const rootElement = virtuableComponent.rootHtmlElement;\n if (rootElement === undefined) {\n throw new BindError(i18nStrings[I18nStringId.ComponentIsNotVirtuable] + ' ' + container.title);\n } else {\n const containerBoundingClientRect = container.element.getBoundingClientRect();\n const left = containerBoundingClientRect.left - this._goldenLayoutBoundingClientRect.left;\n rootElement.style.left = numberToPixels(left);\n const top = containerBoundingClientRect.top - this._goldenLayoutBoundingClientRect.top;\n rootElement.style.top = numberToPixels(top);\n setElementWidth(rootElement, width);\n setElementHeight(rootElement, height);\n }\n }\n }\n\n /** @internal */\n private handleContainerVirtualVisibilityChangeRequiredEvent(container: ComponentContainer, visible: boolean): void {\n const virtuableComponent = this._virtuableComponentMap.get(container);\n if (virtuableComponent === undefined) {\n throw new UnexpectedUndefinedError('GLHCVVCRE55934');\n } else {\n const rootElement = virtuableComponent.rootHtmlElement;\n if (rootElement === undefined) {\n throw new BindError(i18nStrings[I18nStringId.ComponentIsNotVirtuable] + ' ' + container.title);\n } else {\n setElementDisplayVisibility(rootElement, visible);\n }\n }\n }\n\n /** @internal */\n private handleContainerVirtualZIndexChangeRequiredEvent(container: ComponentContainer, logicalZIndex: LogicalZIndex, defaultZIndex: string) {\n const virtuableComponent = this._virtuableComponentMap.get(container);\n if (virtuableComponent === undefined) {\n throw new UnexpectedUndefinedError('GLHCVZICRE55935');\n } else {\n const rootElement = virtuableComponent.rootHtmlElement;\n if (rootElement === undefined) {\n throw new BindError(i18nStrings[I18nStringId.ComponentIsNotVirtuable] + ' ' + container.title);\n } else {\n rootElement.style.zIndex = defaultZIndex;\n }\n }\n }\n}\n\n/** @public */\nexport namespace GoldenLayout {\n export interface VirtuableComponent {\n rootHtmlElement: HTMLElement;\n }\n\n export type ComponentConstructor = new(container: ComponentContainer, state: JsonValue | undefined, virtual: boolean) => ComponentContainer.Component;\n export type ComponentFactoryFunction = (container: ComponentContainer, state: JsonValue | undefined, virtual: boolean) => ComponentContainer.Component | undefined;\n export type GetComponentConstructorCallback = (this: void, config: ResolvedComponentItemConfig) => ComponentConstructor;\n\n export interface ComponentInstantiator {\n constructor: ComponentConstructor | undefined;\n factoryFunction: ComponentFactoryFunction | undefined;\n virtual: boolean;\n }\n}\n"],"names":["InternalError","Error","constructor","type","code","message","super","undefined","AssertError","UnreachableCaseError","variableValue","UnexpectedNullError","UnexpectedUndefinedError","ConfigMinifier","StyleConstants","WidthOrHeightPropertyName","Side","LogicalZIndex","keys","values","translateObject","from","minify","to","key","hasOwnProperty","translatedKey","minifyKey","unminifyKey","fromValue","translateValue","Array","isArray","length","i","translateArray","value","index","indexOfValue","toString","minifyValue","parseInt","substr","indexOfKey","checkInitialise","defaultComponentBaseZIndex","defaultComponentDragZIndex","defaultComponentStackMaximisedZIndex","width","height","top","left","right","bottom","base","drag","stackMaximised","LogicalZIndexToDefaultMap","JsonValue","ItemType","ResponsiveMode","SizeUnitEnum","ResolvedItemConfig","ResolvedHeaderedItemConfig","ResolvedStackItemConfig","ResolvedComponentItemConfig","ResolvedRowOrColumnItemConfig","ResolvedRootItemConfig","ResolvedGroundItemConfig","ResolvedLayoutConfig","ResolvedPopoutLayoutConfig","I18nStrings","numberToPixels","pixelsToNumber","numberStr","replace","parseFloat","isDigit","char","setElementWidth","element","widthAsPixels","style","setElementHeight","heightAsPixels","getElementWidthAndHeight","offsetWidth","offsetHeight","setElementDisplayVisibility","visible","display","deepExtend","target","obj","existingTarget","deepExtendValue","targetArray","valueObj","getUniqueId","Math","random","isJsonObject","isJson","ground","row","column","stack","component","none","always","onload","tryParse","Pixel","Percent","Fractional","Em","format","defaults","content","size","sizeUnit","minSize","minSizeUnit","id","isClosable","createCopy","original","createDefault","isComponentItem","itemConfig","isStackItem","isGroundItem","Header","defaultMaximised","show","popout","close","maximise","minimise","tabDropdown","copyContent","count","result","defaultActiveItemIndex","maximised","activeItemIndex","header","defaultReorderEnabled","resolveComponentTypeName","componentType","reorderEnabled","title","componentState","copyComponentType","isChildItemConfig","config","isRootItemConfig","create","rootItemConfig","Settings","Dimensions","isPopout","constrainDragToContainer","popoutWholeStack","blockedPopoutsThrowError","closePopoutsOnUnload","responsiveMode","tabOverlapAllowance","reorderOnTabMenuClick","tabControlOffset","popInOnClose","borderWidth","borderGrabWidth","defaultMinItemHeight","defaultMinItemHeightUnit","defaultMinItemWidth","defaultMinItemWidthUnit","headerHeight","dragProxyWidth","dragProxyHeight","dock","root","openPopouts","dimensions","settings","resolved","copyOpenPopouts","minifyConfig","layoutConfig","unminifyConfig","minifiedConfig","Window","parentId","indexInParent","window","ExternalError","ConfigurationError","node","PopoutBlockedError","ApiError","BindError","initialised","infosObject","PopoutCannotBeCreatedWithGroundItemConfig","default","PleaseRegisterAConstructorFunction","ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned","ComponentIsAlreadyRegistered","ComponentIsNotVirtuable","VirtualComponentDoesNotHaveRootHtmlElement","ItemConfigIsNotTypeComponent","InvalidNumberPartInSizeString","UnknownUnitInSizeString","UnsupportedUnitInSizeString","idCount","Object","infos","info","i18nStrings","ItemConfig","HeaderedItemConfig","StackItemConfig","ComponentItemConfig","RowOrColumnItemConfig","RootItemConfig","LayoutConfig","PopoutLayoutConfig","parseSize","sizeString","allowableSizeUnits","numericPart","digitsPart","firstNonNumericCharPart","firstNonDigitPart","trimStart","firstNonDigitPartIndex","gotDecimalPoint","substring","trim","splitStringAtFirstNonNumericChar","Number","isNaN","includes","formatSize","formatUndefinableSize","resolve","rowAndColumnChildLegacySizeDefault","JSON","stringify","resolveContent","resolveId","resolveSize","resolveMinSize","minWidth","minHeight","minWidthDefined","calculateSizeWidthHeightSpecificationType","isGround","isRow","isColumn","isStack","isComponent","hasHeaders","resolveIdAndMaximised","legacyId","legacyMaximised","idx","findIndex","splice","childItemConfig","fromResolvedContent","resolvedContent","resolvedContentConfig","fromResolved","resolvedConfig","componentName","componentTypeToTitle","contentConfig","childItemConfigs","legacySizeDefault","widthOrHeightSpecifiedAtLeastOnce","sizeSpecifiedAtLeastOnce","sizeWidthHeightSpecificationType","resolvedChildItemConfig","fromResolvedOrUndefined","resolvedItemConfig","resolveDefaultMinItemHeight","resolveDefaultMinItemWidth","resolvedDimensions","labels","showPopoutIcon","popin","showMaximiseIcon","showCloseIcon","resolveOpenPopouts","fromResolvedArray","isResolved","configOrResolvedConfig","popoutConfigs","resolvedArray","resolvedOpenPopoutCount","resolvedOpenPopout","resolvedWindow","popoutConfig","EventEmitter","_allEventSubscriptions","_subscriptionsMap","Map","unbind","this","removeEventListener","trigger","emit","tryBubbleEvent","name","args","eventName","subcriptions","get","slice","subscription","emitAllEvent","emitUnknown","subs","emitBaseBubblingEvent","event","BubblingEvent","emitUnknownBubblingEvent","callback","unknownCallback","removeUnknownEventListener","off","addEventListener","addUnknownEventListener","on","ALL_EVENT","push","subscriptions","set","removeSubscription","indexOf","allEventSubscriptionsCount","unknownArgs","unshift","allEventSubcriptions","headerClickEventName","headerTouchStartEventName","_name","_target","_isPropagationStopped","origin","isPropagationStopped","stopPropagation","ClickBubblingEvent","_mouseEvent","mouseEvent","TouchStartBubblingEvent","_touchEvent","touchEvent","BrowserPopout","_config","_initialWindowSize","_layoutManager","_isInitialised","_popoutWindow","createWindow","toConfig","glInstanceConfig","getGlInstance","saveLayout","screenX","screenLeft","screenY","screenTop","__glInstance","getWindow","closeWindow","e","popIn","parentItem","copiedRoot","groundItem","getItemsByPopInParentId","contentItems","newContentItem","createAndInitContentItem","addChild","_onClose","url","createUrl","floor","features","serializeWindowFeatures","innerWidth","innerHeight","menubar","toolbar","location","personalbar","resizable","scrollbars","status","globalThis","open","positionWindow","passive","_checkReadyInterval","setInterval","checkReady","isInitialised","onInitialised","clearInterval","windowOptions","windowOptionsString","join","storageKey","localStorage","setItem","getErrorMessage","URL","href","searchParams","moveTo","focus","setTimeout","HeaderButton","_header","label","cssClass","_pushEvent","_clickEventListener","ev","onClick","_touchStartEventListener","onTouchStart","_element","document","createElement","classList","add","destroy","controlsContainerElement","appendChild","parentNode","removeChild","DragListener","_eElement","extraAllowableChildTargets","_pointerTracking","_pointerDownEventListener","onPointerDown","_pointerMoveEventListener","onPointerMove","_pointerUpEventListener","onPointerUp","_timeout","_allowableTargets","_oDocument","_eBody","body","_nDelay","_nDistance","_nX","_nY","_nOriginalX","_nOriginalY","_dragging","checkRemovePointerTrackingEventListeners","cancelDrag","processDragStop","oEvent","isPrimary","coordinates","getPointerCoordinates","processPointerDown","x","y","startDrag","err","console","error","processDragMove","preventDefault","dragEvent","pageX","pageY","abs","clearTimeout","remove","querySelector","setProperty","Tab","_componentItem","_closeEvent","_focusEvent","_dragStartEvent","_isActive","_tabClickListener","onTabClickDown","_tabTouchStartListener","onTabTouchStart","_closeClickListener","onCloseClick","_closeTouchStartListener","onCloseTouchStart","_dragStartListener","onDragStart","_contentItemDestroyListener","onContentItemDestroy","_tabTitleChangedListener","setTitle","_titleElement","_closeElement","enableReorder","setTab","isActive","componentItem","contentItem","titleElement","closeElement","_dragListener","disableReorder","innerText","setActive","setBlurred","setFocused","button","notifyFocus","notifyClose","TabsContainer","_componentRemoveEvent","_componentFocusEvent","_componentDragStartEvent","_dropdownActiveChangedEvent","_tabs","_lastVisibleTabIndex","_dropdownActive","_dropdownElement","tabs","tabCount","lastVisibleTabIndex","dropdownElement","dropdownActive","createTab","tab","item","handleTabCloseEvent","handleTabFocusEvent","dragListener","handleTabDragStartEvent","childNodes","insertBefore","removeTab","processActiveComponentChanged","newActiveComponentItem","activeIndex","activeTab","j","updateTabSizes","availableWidth","activeComponentItem","dropDownActive","tryUpdateTabSizes","cumulativeTabWidth","tabOverlapAllowanceExceeded","tabElement","parentElement","tabMarginRight","getComputedStyle","marginRight","visibleTabWidth","activeTabMarginRight","zIndex","marginLeft","overlap","showAdditionalTabsDropdown","hideAdditionalTabsDropdown","_parent","_configClosable","_getActiveComponentItemEvent","closeEvent","_popoutEvent","_maximiseToggleEvent","_clickEvent","_touchStartEvent","_clickListener","_touchStartListener","_rowColumnClosable","_closeButton","_popoutButton","_tabsContainer","handleTabInitiatedComponentRemoveEvent","handleTabInitiatedComponentFocusEvent","handleTabInitiatedDragStartEvent","processTabDropdownActiveChanged","_show","_popoutEnabled","popoutEnabled","_popoutLabel","popoutLabel","_maximiseEnabled","maximiseEnabled","_maximiseLabel","maximiseLabel","_minimiseEnabled","minimiseEnabled","_minimiseLabel","minimiseLabel","_closeEnabled","closeEnabled","_closeLabel","closeLabel","_tabDropdownEnabled","tabDropdownEnabled","_tabDropdownLabel","tabDropdownLabel","setSide","side","_canRemoveComponent","_controlsContainerElement","_documentMouseUpListener","_tabControlOffset","_tabDropdownButton","handleButtonPopoutEvent","_maximiseButton","handleButtonMaximiseToggleEvent","_side","leftRightSided","_leftRightSided","layoutManager","parent","tabsContainerElement","setRowColumnClosable","updateClosability","len","applyFocusedValue","processMaximised","setAttribute","processMinimised","notifyClick","notifyTouchStart","ComponentContainer","_updateItemConfigEvent","_showEvent","_hideEvent","_blurEvent","_stackMaximised","_width","_height","_visible","_isShownWithZeroDimensions","_componentType","_isClosable","_initialState","_state","_boundComponent","bindComponent","updateElementPositionPropertyFromBoundComponent","virtual","_tab","isHidden","state","initialState","releaseComponent","stateRequestEvent","getElement","hide","suppressEvent","blur","setSize","ancestorItem","ancestorChildItem","direction","currentSize","percentage","delta","ancestorItemContentItem","updateSize","replaceComponent","virtualVisibilityChangeRequiredEvent","virtualRectingRequiredEvent","fireBeforeVirtualRectingEvent","fireAfterVirtualRectingEvent","setBaseLogicalZIndex","getState","extendState","extendedState","setState","setVisibility","setSizeToNodeSize","emitShow","emitHide","setLogicalZIndex","logicalZIndex","_logicalZIndex","notifyVirtualZIndexChangeRequired","enterDragMode","exitDragMode","enterStackMaximised","exitStackMaximised","force","addVirtualSizedContainerToLayoutManager","checkShownFromZeroDimensions","notifyVirtualRectingRequired","virtualZIndexChangeRequiredEvent","defaultZIndex","position","beginVirtualSizedContainerAdding","addVirtualSizedContainer","endVirtualSizedContainerAdding","unbindComponent","ContentItem","_popInParentIds","_type","_id","_pendingEventPropagations","_throttledEvents","_contentItems","createContentItems","popInParentIds","isComponentParentableItem","keepChild","suspendResize","setParent","init","replaceChild","oldChild","newChild","destroyOldChild","browserPopout","createPopoutFromContentItem","calculateConfigContent","highlightDropZone","area","dropTargetIndicator","highlightArea","onDrop","beginSizeInvalidation","endSizeInvalidation","getElementArea","rect","getBoundingClientRect","scrollTop","scrollLeft","x1","y1","x2","y2","surface","addPopInParentId","initContentItems","updateContentItemsSize","createContentItem","propagateEvent","scheduleEventPropagationToLayoutManager","requestAnimationFrame","propagateEventToLayoutManager","ComponentItem","_parentItem","_focused","_reorderEnabled","applyUpdatableConfig","_initialWantMaximise","containerElement","_container","handleUpdateItemConfigEvent","initialWantMaximise","container","headerConfig","_headerConfig","_title","focused","updateNodeSize","setActiveComponentItem","setFocusedComponentItem","ComponentParentableItem","setFocusedValue","Stack","_headerSideChanged","_resizeListener","handleResize","_maximisedListener","handleMaximised","_minimisedListener","handleMinimised","layoutHeaderConfig","configContent","componentHeaderConfig","_initialActiveItemIndex","_maximisedEnabled","headerSettings","getActiveComponentItem","handlePopoutEvent","toggleMaximise","handleHeaderClickEvent","handleHeaderTouchStartEvent","handleHeaderComponentRemoveEvent","handleHeaderComponentFocusEvent","handleHeaderComponentStartDragEvent","_childElementContainer","setupHeaderPosition","childElementContainer","headerShow","headerSide","headerLeftRightSided","contentAreaDimensions","_contentAreaDimensions","isMaximised","maximisedStack","stackParent","contentItemCount","setActiveContentItem","suppressFocusEvent","_activeComponentItem","emitStateChangedEvent","getActiveContentItem","focusActiveContentItem","newComponent","newItem","addComponent","addItem","checkMinimiseMaximisedStack","stackWillBeDeleted","newActiveComponentIdx","setMaximisedStack","createHeaderConfig","_dropSegment","resetHeaderDropZone","_dropIndex","isVertical","isHorizontal","hasCorrectParent","rowOrColumn","segment","hoverArea","highlightHeaderDropZone","highlightBodyDropZone","getArea","headerArea","contentArea","contentWidth","contentHeight","positionHeader","visibleTabsLength","tabsContainerElementChildNodes","visibleTabElements","tabIndex","visibleTabElement","tabDropPlaceholder","headerRect","headerTop","headerLeft","tabTop","tabLeft","tabWidth","isAboveTab","tabRect","tabRectTop","tabRectLeft","insertAdjacentElement","min","tabDropPlaceholderRect","tabDropPlaceholderRectTop","tabDropPlaceholderRectLeft","tabDropPlaceholderRectWidth","placeHolderTop","clientHeight","bubblingEvent","startComponentDrag","DragProxy","_originalParent","_area","_lastValidArea","offsetX","offsetY","onDrag","createDragProxyElements","_componentItemFocused","setDimensions","determineMinMaxXY","calculateItemAreas","setDropPosition","initialX","initialY","headerElement","tabsElement","_proxyContainerElement","_sided","insertAdjacentText","_minX","_minY","_maxX","_maxY","ceil","droppedComponentItem","Splitter","_isVertical","_size","grabSize","_grabSize","dragHandleElement","handleExcessSize","handleExcessPos","RowOrColumn","_rowOrColumnParent","_splitter","_splitterSize","_splitterGrabSize","_isColumn","_dimension","_splitterPosition","_splitterMinPosition","_splitterMaxPosition","_configType","createdItem","splitterElement","createSplitter","max","newItemSize","indexedContentItem","itemSize","splitterIndex","childItem","calculateRelativeSizes","setAbsoluteSizes","absoluteSizes","calculateAbsoluteSizes","additionalPixel","itemSizes","crossAxisSize","totalSplitterSize","elementWidth","elementHeight","totalSize","totalAssigned","total","itemsWithFractionalSize","totalFractionalSize","round","fractionalAllocatedSize","respectMinItemSize","minItemSize","calculateContentItemMinSize","totalOverMin","totalUnderMin","entriesOverMin","allEntries","entry","reducePercent","remainingSize","reducedSize","splitter","onSplitterDrag","onSplitterDragStop","onSplitterDragStart","getSplitItems","before","after","calculateContentItemsTotalMinSize","totalMinSize","items","beforeWidth","afterSize","beforeMinSize","afterMinSize","offset","offsetPixels","sizeBefore","sizeAfter","splitterPositionInRange","totalRelativeSize","getElementDimensionSize","dimension","getElementWidth","getElementHeight","setElementDimensionSize","GroundItem","_containerElement","prev","previousSibling","lastChild","Element","contains","loadRoot","clearRoot","rootContentItem","loadComponentAsRoot","createSideAreas","oppositeSides","Area","sibling","validateDocking","getAllContentItems","deepGetAllContentItems","getConfigMaximisedItems","deepFilterContentItems","popInParentId","checkAcceptFtn","DragSource","_extraAllowableChildTargets","_componentTypeOrFtn","_componentState","_dummyGroundContainer","dummyRootItemConfig","_dummyGroundContentItem","createDragListener","removeDragListener","onDragStop","dragSourceItemConfig","ftnDragSourceItemConfig","isDragSourceComponentItemConfig","dragProxy","transitionIndicator","transitionElements","DropTargetIndicator","innerElement","margin","TransitionIndicator","_toElement","_fromDimensions","_totalAnimationDuration","_animationStartTime","fromElement","toElement","nextAnimationFrame","measure","EventHub","_childEventListener","childEvent","onEventFromChild","ChildEventName","emitUserBroadcast","handleUserBroadcastEvent","isSubWindow","propagateToParent","propagateToThisAndSubtree","detail","eventInit","bubbles","cancelable","CustomEvent","opener","dispatchEvent","childGl","eventHub","LayoutManager","parameters","resizeWithContainerAutomatically","resizeDebounceInterval","resizeDebounceExtendedWhenPossible","_groundItem","_openPopouts","_dropTargetIndicator","_transitionIndicator","_itemAreas","_maximisePlaceholder","createMaximisePlaceElement","_tabDropPlaceholder","createTabDropPlaceholderElement","_dragSources","_updatingColumnsResponsive","_firstLoad","_eventHub","_virtualSizedContainers","_virtualSizedContainerAddingBeginCount","_sizeInvalidationBeginCount","_resizeObserver","ResizeObserver","handleContainerResize","_windowBeforeUnloadListener","onBeforeUnload","_windowBeforeUnloadListening","_maximisedStackBeforeDestroyedListener","cleanupBeforeMaximisedStackDestroyed","_constructorOrSubWindowLayoutConfig","constructorOrSubWindowLayoutConfig","rootItem","focusedComponentItem","_focusedComponentItem","_maximisedStack","deprecatedConstructor","closeAllOpenPopouts","disconnect","checkClearResizeTimeout","dragSource","subWindowRootConfig","setContainer","updateSizeFromContainer","resolvedLayoutConfig","checkLoadedLayoutMaximiseItem","observe","adjustColumnsResponsive","loadLayout","createSubWindows","groundContent","reconcilePopoutWindows","clear","newComponentAtLocation","locationSelectors","addComponentAtLocation","addItemAtLocation","newItemAtLocation","defaultLocationSelectors","findFirstLocation","addIdx","updateRootSize","createContentItemFromConfig","findFirstComponentItemById","findFirstContentItemTypeByIdRecursive","createPopout","itemConfigOrContentItem","positionAndSize","createPopoutFromItemConfig","child","windowLeft","windowTop","offsetLeft","offsetTop","beforeVirtualRectingEvent","afterVirtualRectingEvent","popoutLayoutConfig","createPopoutFromPopoutLayoutConfig","configWindow","initialWindow","newDragSource","componentTypeOrItemConfigCallback","removeDragSource","array","removeFromArray","focusComponent","clearComponentFocus","suppressEvents","newFocusedParentItem","oldFocusedItem","oldFocusedParentItem","processMinimiseMaximisedStack","processMaximiseStack","matchingArea","smallestSurface","Infinity","allContentItems","stackContentAreaDimensions","groundArea","configMaximisedItems","prepend","closed","processResizeWithDebounce","_resizeTimeoutId","bodyElement","documentElement","padding","overflow","useResponsiveLayout","columnCount","minItemWidth","stackColumnCount","allStacks","getAllStacks","firstStackContainer","addChildContentItemsToContainer","alwaysResponsiveMode","onLoadResponsiveModeAndFirst","stacks","findAllStacksRecursive","findFirstContentItemType","findFirstContentItemTypeRecursive","foundContentItem","selectors","selector","findLocation","selectorIndex","typeId","parentContentItems","parentContentItemCount","tryCreateLocationFromParentItem","groundContentItems","afterFocusedItemIfPossibleLocationSelectors","VirtualLayout","configOrOptionalContainer","containerOrBindComponentEventHandler","unbindComponentEventHandler","skipInit","createLayoutManagerConstructorParameters","_bindComponentEventHanlderPassedInConstructor","_creationTimeoutPassed","bindComponentEvent","unbindComponentEvent","readyState","clearHtmlAndAdjustStylesForSubWindow","headElement","head","appendNodeLists","querySelectorAll","listIdx","appendNodeList","nodeIdx","innerHTML","visibility","checkAddDefaultPopinButton","popInButtonElement","iconElement","bgElement","getComponentEvent","releaseComponentEvent","subWindowChecked","windowConfigKey","windowConfigStr","getItem","removeItem","minifiedWindowConfig","parse","HTMLElement","golden","_componentTypesMap","_registeredComponentMap","_virtuableComponentMap","_containerVirtualRectingRequiredEventListener","handleContainerVirtualRectingRequiredEvent","_containerVirtualVisibilityChangeRequiredEventListener","handleContainerVirtualVisibilityChangeRequiredEvent","_containerVirtualZIndexChangeRequiredEventListener","handleContainerVirtualZIndexChangeRequiredEvent","registerComponent","componentConstructorOrFactoryFtn","componentConstructor","registerComponentConstructor","componentFactoryFtn","registerComponentFactoryFunction","typeName","factoryFunction","componentFactoryFunction","registerComponentFunction","registerGetComponentConstructorCallback","_getComponentConstructorFtn","warn","getRegisteredComponentTypeNames","typeNamesIterableIterator","getComponentInstantiator","instantiator","virtuableComponent","componentRootElement","rootHtmlElement","absolutePosition","ensureElementPositionAbsolute","delete","_goldenLayoutBoundingClientRect","rootElement","containerBoundingClientRect","template","concat","minItemHeight"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"ui.858f8ece88fc793ad89c.bundle.js","mappings":"yBACA,MAAeA,UAAsBC,MACjC,WAAAC,CAAYC,EAAcC,EAAcC,GACpCC,MAAM,GAAGH,MAASC,SAAmBG,IAAZF,EAAwB,GAAK,KAAOA,IACjE,EAIG,MAAMG,UAAoBR,EAC7B,WAAAE,CAAYE,EAAcC,GACtBC,MAAM,SAAUF,EAAMC,EAC1B,EAIG,MAAMI,UAA6BT,EACtC,WAAAE,CAAYE,EAAcM,EAAsBL,GAC5CC,MAAM,kBAAmBF,EAAM,GAAGM,SAA4BH,IAAZF,EAAwB,GAAK,KAAOA,IAC1F,EAIG,MAAMM,UAA4BX,EACrC,WAAAE,CAAYE,EAAcC,GACtBC,MAAM,iBAAkBF,EAAMC,EAClC,EAIG,MAAMO,UAAiCZ,EAC1C,WAAAE,CAAYE,EAAcC,GACtBC,MAAM,sBAAuBF,EAAMC,EACvC,ECzBG,IAAUQ,ECNAC,ECMAC,EAoBAC,EAUAC,GF9BjB,SAAiBJ,GAMb,MAAMK,EAA0B,CAC5B,WACA,aACA,2BACA,mBACA,aACA,cACA,gBACA,eACA,eACA,iBACA,kBACA,SACA,QACA,WACA,WACA,SACA,UACA,gBACA,iBACA,KACA,QACA,OACA,SACA,aACA,QACA,mBACA,cACA,WACA,kBACA,iBACA,mBAQEC,EAAwC,EAC1C,GACA,EACA,MACA,SACA,QACA,YACA,QACA,WACA,WACA,sBASJ,SAAgBC,EAAgBC,EAA+BC,GAC3D,MAAMC,EAA8B,CAAC,EACrC,IAAK,MAAMC,KAAOH,EACd,GAAIA,EAAKI,eAAeD,GAAM,CAC1B,IAAIE,EAEAA,EADAJ,EACgBK,EAAUH,GAEVI,EAAYJ,GAGhC,MAAMK,EAAYR,EAAKG,GACvBD,EAAGG,GAAiBI,EAAeD,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AC,CACRnH,KAAM,SACN6C,MAAO,GACPsE,QAAS,CAAC,CACRnH,KAAM,YACNyH,YAAY,EACZuJ,cAAe,WACf5H,MAAO,OACPC,eAAgB,CAAE7B,GAAI,qBAG1B,CACExH,KAAM,SACNmH,QAAS,CAAC,CACRnH,KAAM,MACN8C,OAAQ,GACRqE,QAAS,CAAC,CACRnH,KAAM,QACNmH,QAAS,CAAC,CACRnH,KAAM,YACNyH,YAAY,EACZ2B,MAAO,OACP4H,cAAe,WACf3H,eAAgB,CAAE7B,GAAI,aAExB,CACExH,KAAM,YACNyH,YAAY,EACZ2B,MAAO,MACP4H,cAAe,WACf3H,eAAgB,CAAE7B,GAAI,UAG1B,CACExH,KAAM,YACNoJ,MAAO,QACPvG,MAAO,GACPmO,cAAe,WACf3H,eAAgB,CAAE7B,GAAI,YAG1B,CACExH,KAAM,MACNmH,QAAS,CAAC,CACRnH,KAAM,YACNoJ,MAAO,cACP4H,cAAe,WACf3H,eAAgB,CAAE7B,GAAI,gB","sources":["webpack://webao/./node_modules/golden-layout/src/ts/errors/internal-error.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/config-minifier.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/style-constants.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/types.ts","webpack://webao/./node_modules/golden-layout/src/ts/config/resolved-config.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/i18n-strings.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/utils.ts","webpack://webao/./node_modules/golden-layout/src/ts/errors/external-error.ts","webpack://webao/./node_modules/golden-layout/src/ts/config/config.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/event-emitter.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/browser-popout.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/header-button.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/drag-listener.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/tab.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/tabs-container.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/header.ts","webpack://webao/./node_modules/golden-layout/src/ts/container/component-container.ts","webpack://webao/./node_modules/golden-layout/src/ts/items/content-item.ts","webpack://webao/./node_modules/golden-layout/src/ts/items/component-item.ts","webpack://webao/./node_modules/golden-layout/src/ts/items/component-parentable-item.ts","webpack://webao/./node_modules/golden-layout/src/ts/items/stack.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/drag-proxy.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/splitter.ts","webpack://webao/./node_modules/golden-layout/src/ts/items/row-or-column.ts","webpack://webao/./node_modules/golden-layout/src/ts/items/ground-item.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/drag-source.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/drop-target-indicator.ts","webpack://webao/./node_modules/golden-layout/src/ts/controls/transition-indicator.ts","webpack://webao/./node_modules/golden-layout/src/ts/utils/event-hub.ts","webpack://webao/./node_modules/golden-layout/src/ts/layout-manager.ts","webpack://webao/./node_modules/golden-layout/src/ts/virtual-layout.ts","webpack://webao/./webAO/ui.js","webpack://webao/./node_modules/golden-layout/src/ts/golden-layout.ts"],"sourcesContent":["/** @internal */\nabstract class InternalError extends Error {\n constructor(type: string, code: string, message?: string) {\n super(`${type}: ${code}${message === undefined ? '' : ': ' + message}`)\n }\n}\n\n/** @internal */\nexport class AssertError extends InternalError {\n constructor(code: string, message?: string) {\n super('Assert', code, message)\n }\n}\n\n/** @internal */\nexport class UnreachableCaseError extends InternalError {\n constructor(code: string, variableValue: never, message?: string) {\n super('UnreachableCase', code, `${variableValue}${message === undefined ? '' : ': ' + message}`)\n }\n}\n\n/** @internal */\nexport class UnexpectedNullError extends InternalError {\n constructor(code: string, message?: string) {\n super('UnexpectedNull', code, message)\n }\n}\n\n/** @internal */\nexport class UnexpectedUndefinedError extends InternalError {\n constructor(code: string, message?: string) {\n super('UnexpectedUndefined', code, message)\n }\n}\n","/**\n * Minifies and unminifies configs by replacing frequent keys\n * and values with one letter substitutes. Config options must\n * retain array position/index, add new options at the end.\n * @internal\n*/\n\nexport namespace ConfigMinifier {\n\n export type YY = 'id' | 'title';\n export const enum XX {\n id = 'id'\n }\n const keys: readonly string[] = [\n 'settings',\n 'hasHeaders',\n 'constrainDragToContainer',\n 'selectionEnabled',\n 'dimensions',\n 'borderWidth',\n 'minItemHeight',\n 'minItemWidth',\n 'headerHeight',\n 'dragProxyWidth',\n 'dragProxyHeight',\n 'labels',\n 'close',\n 'maximise',\n 'minimise',\n 'popout',\n 'content',\n 'componentType',\n 'componentState',\n 'id',\n 'width',\n 'type',\n 'height',\n 'isClosable',\n 'title',\n 'popoutWholeStack',\n 'openPopouts',\n 'parentId',\n 'activeItemIndex',\n 'reorderEnabled',\n 'borderGrabWidth',\n\n\n\n\n //Maximum 36 entries, do not cross this line!\n ];\n\n const values: readonly (boolean | string)[] = [\n true,\n false,\n 'row',\n 'column',\n 'stack',\n 'component',\n 'close',\n 'maximise',\n 'minimise',\n 'open in new window'\n ];\n\n export function checkInitialise(): void {\n if (keys.length > 36) {\n throw new Error('Too many keys in config minifier map');\n }\n }\n\n export function translateObject(from: Record, minify: boolean): Record {\n const to: Record = {};\n for (const key in from) {\n if (from.hasOwnProperty(key)) { // In case something has extended Object prototypes\n let translatedKey: string;\n if (minify) {\n translatedKey = minifyKey(key);\n } else {\n translatedKey = unminifyKey(key);\n }\n\n const fromValue = from[key];\n to[translatedKey] = translateValue(fromValue, minify);\n }\n }\n\n return to;\n }\n\n function translateArray(from: unknown[], minify: boolean) {\n const length = from.length;\n const to = new Array(length);\n for (let i = 0; i < length; i++) {\n // In original code, array indices were numbers and not translated\n const fromValue = from[i];\n to[i] = translateValue(fromValue, minify);\n }\n return to;\n }\n\n function translateValue(from: unknown, minify: boolean) {\n if (typeof from === 'object') {\n if (from === null) {\n return null;\n } else {\n if (Array.isArray(from)) {\n return translateArray(from, minify);\n } else {\n return translateObject(from as Record, minify);\n }\n }\n } else {\n if (minify) {\n return minifyValue(from);\n } else {\n return unminifyValue(from);\n }\n }\n }\n\n function minifyKey(value: string) {\n /**\n * If a value actually is a single character, prefix it\n * with ___ to avoid mistaking it for a minification code\n */\n if (typeof value === 'string' && value.length === 1) {\n return '___' + value;\n }\n \n const index = indexOfKey(value);\n \n /**\n * value not found in the dictionary, return it unmodified\n */\n if (index === -1) {\n return value;\n \n /**\n * value found in dictionary, return its base36 counterpart\n */\n } else {\n return index.toString(36);\n }\n }\n\n function unminifyKey(key: string) {\n /**\n * value is a single character. Assume that it's a translation\n * and return the original value from the dictionary\n */\n if (key.length === 1) {\n return keys[parseInt(key, 36)];\n }\n \n /**\n * value originally was a single character and was prefixed with ___\n * to avoid mistaking it for a translation. Remove the prefix\n * and return the original character\n */\n if (key.substr(0, 3) === '___') {\n return key[3];\n }\n /**\n * value was not minified\n */\n return key;\n }\n\n function minifyValue(value: unknown) {\n /**\n * If a value actually is a single character, prefix it\n * with ___ to avoid mistaking it for a minification code\n */\n if (typeof value === 'string' && value.length === 1) {\n return '___' + value;\n }\n \n const index = indexOfValue(value);\n \n /**\n * value not found in the dictionary, return it unmodified\n */\n if (index === -1) {\n return value;\n \n /**\n * value found in dictionary, return its base36 counterpart\n */\n } else {\n return index.toString(36);\n }\n }\n\n function unminifyValue(value: unknown) {\n /**\n * value is a single character. Assume that it's a translation\n * and return the original value from the dictionary\n */\n if (typeof value === 'string' && value.length === 1) {\n return values[parseInt(value, 36)];\n }\n\n /**\n * value originally was a single character and was prefixed with ___\n * to avoid mistaking it for a translation. Remove the prefix\n * and return the original character\n */\n if (typeof value === 'string' && value.substr(0, 3) === '___') {\n return value[3];\n }\n /**\n * value was not minified\n */\n return value;\n }\n\n function indexOfKey(key: string) {\n for (let i = 0; i < keys.length; i++) {\n if (keys[i] === key) {\n return i;\n }\n }\n return -1;\n }\n\n function indexOfValue(value: unknown) {\n for (let i = 0; i < values.length; i++) {\n if (values[i] === value) {\n return i;\n }\n }\n return -1;\n }\n}\n","/** @public */\nexport namespace StyleConstants {\n export const defaultComponentBaseZIndex = 'auto';\n export const defaultComponentDragZIndex = '32';\n export const defaultComponentStackMaximisedZIndex = '41';\n}\n","import { UnreachableCaseError } from '../errors/internal-error';\nimport { StyleConstants } from './style-constants';\n\n/** @internal */\nexport type WidthOrHeightPropertyName = 'width' | 'height';\n\n/** @internal */\nexport namespace WidthOrHeightPropertyName {\n export const width = 'width';\n export const height = 'height';\n}\n\n/** @internal */\nexport interface WidthAndHeight {\n width: number;\n height: number;\n}\n\n/** @internal */\nexport interface LeftAndTop {\n left: number;\n top: number;\n}\n\n/** @public */\nexport type Side = 'top' | 'left' | 'right' | 'bottom';\n/** @public */\nexport namespace Side {\n export const top = 'top';\n export const left = 'left';\n export const right = 'right';\n export const bottom = 'bottom';\n}\n\n/** @public */\nexport type LogicalZIndex = 'base' | 'drag' | 'stackMaximised';\n/** @public */\nexport namespace LogicalZIndex {\n export const base = 'base';\n export const drag = 'drag';\n export const stackMaximised = 'stackMaximised';\n}\n\n/** @public */\nexport const LogicalZIndexToDefaultMap = {\n base: StyleConstants.defaultComponentBaseZIndex,\n drag: StyleConstants.defaultComponentDragZIndex,\n stackMaximised: StyleConstants.defaultComponentStackMaximisedZIndex,\n}\n\n/** @internal */\nexport interface Rect {\n left: number,\n top: number,\n width: number,\n height: number,\n}\n\n/** @internal */\nexport interface AreaLinkedRect {\n x1: number, // left\n x2: number, // nextLeft\n y1: number, // top\n y2: number, // nextTop\n}\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type JsonValue = string | number | boolean | null | Json | object | JsonValueArray;\n/** @public */\nexport interface Json {\n [name: string]: JsonValue;\n}\n/** @public */\nexport type JsonValueArray = Array\n/** @public */\nexport namespace JsonValue {\n export function isJson(value: JsonValue): value is Json {\n return isJsonObject(value);\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n export function isJsonObject(value: JsonValue): value is Json | object {\n return !Array.isArray(value) && value !== null && typeof value === 'object';\n }\n}\n\n/** @public */\nexport type ItemType = 'ground' | 'row' | 'column' | 'stack' | 'component';\n\n/** @public */\nexport namespace ItemType {\n export const ground = 'ground';\n export const row = 'row';\n export const column = 'column';\n export const stack = 'stack';\n export const component = 'component';\n}\n\n/** @public */\nexport type ResponsiveMode = 'none' | 'always' | 'onload';\n/** @public */\nexport namespace ResponsiveMode {\n export const none = 'none';\n export const always = 'always';\n export const onload = 'onload';\n}\n\n/**\n * Length units which can specify the size of a Component Item\n * @public\n */\nexport type SizeUnit = 'px' | '%' | 'fr' | 'em';\n\n/** @public */\nexport enum SizeUnitEnum {\n Pixel = 'px',\n Percent = '%',\n Fractional = 'fr',\n Em = 'em',\n}\n\n/** @public */\nexport namespace SizeUnitEnum {\n export function tryParse(value: string) {\n switch (value) {\n case SizeUnitEnum.Pixel: return SizeUnitEnum.Pixel;\n case SizeUnitEnum.Percent: return SizeUnitEnum.Percent;\n case SizeUnitEnum.Fractional: return SizeUnitEnum.Fractional;\n case SizeUnitEnum.Em: return SizeUnitEnum.Em;\n default: return undefined;\n }\n }\n\n export function format(value: SizeUnitEnum) {\n switch (value) {\n case SizeUnitEnum.Pixel: return SizeUnitEnum.Pixel;\n case SizeUnitEnum.Percent: return SizeUnitEnum.Percent;\n case SizeUnitEnum.Fractional: return SizeUnitEnum.Fractional;\n case SizeUnitEnum.Em: return SizeUnitEnum.Em;\n default:\n throw new UnreachableCaseError('SUEF44998', value);\n }\n }\n}\n","import { AssertError, UnreachableCaseError } from '../errors/internal-error';\nimport { ConfigMinifier } from '../utils/config-minifier';\nimport { ItemType, JsonValue, ResponsiveMode, Side, SizeUnitEnum } from '../utils/types';\nimport { deepExtendValue } from '../utils/utils';\n\n/** @public */\nexport interface ResolvedItemConfig {\n // see ItemConfig for comments\n readonly type: ItemType;\n readonly content: readonly ResolvedItemConfig[];\n readonly size: number;\n readonly sizeUnit: SizeUnitEnum;\n readonly minSize: number | undefined;\n readonly minSizeUnit: SizeUnitEnum;\n // id no longer specifies whether an Item is maximised. This is now done by HeaderItemConfig.maximised\n readonly id: string;\n readonly isClosable: boolean;\n}\n\n/** @public */\nexport namespace ResolvedItemConfig {\n export const defaults: ResolvedItemConfig = {\n type: ItemType.ground, // not really default but need something\n content: [],\n size: 1,\n sizeUnit: SizeUnitEnum.Fractional,\n minSize: undefined,\n minSizeUnit: SizeUnitEnum.Pixel,\n id: '',\n isClosable: true,\n } as const;\n\n /** Creates a copy of the original ResolvedItemConfig using an alternative content if specified */\n export function createCopy(original: ResolvedItemConfig, content?: ResolvedItemConfig[]): ResolvedItemConfig {\n switch (original.type) {\n case ItemType.ground:\n case ItemType.row:\n case ItemType.column:\n return ResolvedRowOrColumnItemConfig.createCopy(original as ResolvedRowOrColumnItemConfig,\n content as ResolvedRowOrColumnItemConfig.ChildItemConfig[]);\n\n case ItemType.stack:\n return ResolvedStackItemConfig.createCopy(original as ResolvedStackItemConfig, content as ResolvedComponentItemConfig[]);\n\n case ItemType.component:\n return ResolvedComponentItemConfig.createCopy(original as ResolvedComponentItemConfig);\n\n default:\n throw new UnreachableCaseError('CICC91354', original.type, 'Invalid Config Item type specified');\n }\n }\n\n export function createDefault(type: ItemType): ResolvedItemConfig {\n switch (type) {\n case ItemType.ground:\n throw new AssertError('CICCDR91562'); // Get default root from LayoutConfig\n case ItemType.row:\n case ItemType.column:\n return ResolvedRowOrColumnItemConfig.createDefault(type);\n\n case ItemType.stack:\n return ResolvedStackItemConfig.createDefault();\n\n case ItemType.component:\n return ResolvedComponentItemConfig.createDefault();\n\n default:\n throw new UnreachableCaseError('CICCDD91563', type, 'Invalid Config Item type specified');\n }\n }\n\n export function isComponentItem(itemConfig: ResolvedItemConfig): itemConfig is ResolvedComponentItemConfig {\n return itemConfig.type === ItemType.component;\n }\n\n export function isStackItem(itemConfig: ResolvedItemConfig): itemConfig is ResolvedStackItemConfig {\n return itemConfig.type === ItemType.stack;\n }\n\n /** @internal */\n export function isGroundItem(itemConfig: ResolvedItemConfig): itemConfig is ResolvedGroundItemConfig {\n return itemConfig.type === ItemType.ground;\n }\n}\n\n// Stack or Component\n/** @public */\nexport interface ResolvedHeaderedItemConfig extends ResolvedItemConfig {\n header: ResolvedHeaderedItemConfig.Header | undefined; // undefined means get header settings from LayoutConfig\n readonly maximised: boolean;\n}\n\n/** @public */\nexport namespace ResolvedHeaderedItemConfig {\n export const defaultMaximised = false;\n\n export interface Header {\n // undefined means get property value from LayoutConfig\n readonly show: false | Side | undefined;\n readonly popout: false | string | undefined;\n readonly maximise: false | string | undefined;\n readonly close: string | undefined;\n readonly minimise: string | undefined;\n readonly tabDropdown: false | string | undefined;\n }\n\n export namespace Header {\n export function createCopy(original: Header | undefined, show?: false | Side): Header | undefined {\n if (original === undefined) {\n return undefined;\n } else {\n return {\n show: show ?? original.show,\n popout: original.popout,\n close: original.close,\n maximise: original.maximise,\n minimise: original.minimise,\n tabDropdown: original.tabDropdown,\n }\n }\n }\n }\n}\n\n/** @public */\nexport interface ResolvedStackItemConfig extends ResolvedHeaderedItemConfig {\n readonly type: 'stack';\n readonly content: ResolvedComponentItemConfig[];\n /** The index of the active item in the Stack. Only undefined if the Stack is empty. */\n readonly activeItemIndex: number | undefined;\n}\n\n/** @public */\nexport namespace ResolvedStackItemConfig {\n export const defaultActiveItemIndex = 0;\n\n export function createCopy(original: ResolvedStackItemConfig, content?: ResolvedComponentItemConfig[]): ResolvedStackItemConfig {\n const result: ResolvedStackItemConfig = {\n type: original.type,\n content: content !== undefined ? copyContent(content) : copyContent(original.content),\n size: original.size,\n sizeUnit: original.sizeUnit,\n minSize: original.minSize,\n minSizeUnit: original.minSizeUnit,\n id: original.id,\n maximised: original.maximised,\n isClosable: original.isClosable,\n activeItemIndex: original.activeItemIndex,\n header: ResolvedHeaderedItemConfig.Header.createCopy(original.header),\n }\n return result;\n }\n\n export function copyContent(original: ResolvedComponentItemConfig[]): ResolvedComponentItemConfig[] {\n const count = original.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = ResolvedItemConfig.createCopy(original[i]) as ResolvedComponentItemConfig;\n }\n return result;\n }\n\n export function createDefault(): ResolvedStackItemConfig {\n const result: ResolvedStackItemConfig = {\n type: ItemType.stack,\n content: [],\n size: ResolvedItemConfig.defaults.size,\n sizeUnit: ResolvedItemConfig.defaults.sizeUnit,\n minSize: ResolvedItemConfig.defaults.minSize,\n minSizeUnit: ResolvedItemConfig.defaults.minSizeUnit,\n id: ResolvedItemConfig.defaults.id,\n maximised: ResolvedHeaderedItemConfig.defaultMaximised,\n isClosable: ResolvedItemConfig.defaults.isClosable,\n activeItemIndex: defaultActiveItemIndex,\n header: undefined,\n }\n return result;\n }\n}\n\n/** @public */\nexport interface ResolvedComponentItemConfig extends ResolvedHeaderedItemConfig {\n // see ComponentItemConfig for comments\n readonly type: 'component';\n readonly content: [];\n readonly title: string;\n readonly reorderEnabled: boolean; // Takes precedence over LayoutConfig.reorderEnabled.\n /**\n * The name of the component as specified in layout.registerComponent. Mandatory if type is 'component'.\n */\n readonly componentType: JsonValue;\n readonly componentState?: JsonValue;\n}\n\n/** @public */\nexport namespace ResolvedComponentItemConfig {\n export const defaultReorderEnabled = true;\n\n export function resolveComponentTypeName(itemConfig: ResolvedComponentItemConfig): string | undefined {\n const componentType = itemConfig.componentType;\n if (typeof componentType === 'string') {\n return componentType;\n } else {\n return undefined;\n }\n }\n\n export function createCopy(original: ResolvedComponentItemConfig): ResolvedComponentItemConfig {\n const result: ResolvedComponentItemConfig = {\n type: original.type,\n content: [],\n size: original.size,\n sizeUnit: original.sizeUnit,\n minSize: original.minSize,\n minSizeUnit: original.minSizeUnit,\n id: original.id,\n maximised: original.maximised,\n isClosable: original.isClosable,\n reorderEnabled: original.reorderEnabled,\n title: original.title,\n header: ResolvedHeaderedItemConfig.Header.createCopy(original.header),\n componentType: original.componentType,\n componentState: deepExtendValue(undefined, original.componentState) as JsonValue,\n }\n return result;\n }\n\n export function createDefault(componentType: JsonValue = '', componentState?: JsonValue, title = ''): ResolvedComponentItemConfig {\n const result: ResolvedComponentItemConfig = {\n type: ItemType.component,\n content: [],\n size: ResolvedItemConfig.defaults.size,\n sizeUnit: ResolvedItemConfig.defaults.sizeUnit,\n minSize: ResolvedItemConfig.defaults.minSize,\n minSizeUnit: ResolvedItemConfig.defaults.minSizeUnit,\n id: ResolvedItemConfig.defaults.id,\n maximised: ResolvedHeaderedItemConfig.defaultMaximised,\n isClosable: ResolvedItemConfig.defaults.isClosable,\n reorderEnabled: ResolvedComponentItemConfig.defaultReorderEnabled,\n title,\n header: undefined,\n componentType,\n componentState,\n }\n return result;\n }\n\n export function copyComponentType(componentType: JsonValue): JsonValue {\n return deepExtendValue({}, componentType) as JsonValue\n }\n}\n\n/** Base for Root or RowOrColumn ItemConfigs\n * @public\n */\nexport interface ResolvedRowOrColumnItemConfig extends ResolvedItemConfig {\n readonly type: 'row' | 'column';\n /** Note that RowOrColumn ResolvedItemConfig contents, can contain ComponentItem itemConfigs. However\n * when ContentItems are created, these ComponentItem itemConfigs will create a Stack with a child ComponentItem.\n */\n readonly content: readonly (ResolvedRowOrColumnItemConfig | ResolvedStackItemConfig | ResolvedComponentItemConfig)[];\n}\n\n/** @public */\nexport namespace ResolvedRowOrColumnItemConfig {\n export type ChildItemConfig = ResolvedRowOrColumnItemConfig | ResolvedStackItemConfig | ResolvedComponentItemConfig;\n\n export function isChildItemConfig(itemConfig: ResolvedItemConfig): itemConfig is ChildItemConfig {\n switch (itemConfig.type) {\n case ItemType.row:\n case ItemType.column:\n case ItemType.stack:\n case ItemType.component:\n return true;\n case ItemType.ground:\n return false;\n default:\n throw new UnreachableCaseError('CROCOSPCICIC13687', itemConfig.type);\n }\n }\n\n export function createCopy(original: ResolvedRowOrColumnItemConfig, content?: ChildItemConfig[]): ResolvedRowOrColumnItemConfig {\n const result: ResolvedRowOrColumnItemConfig = {\n type: original.type,\n content: content !== undefined ? copyContent(content) : copyContent(original.content),\n size: original.size,\n sizeUnit: original.sizeUnit,\n minSize: original.minSize,\n minSizeUnit: original.minSizeUnit,\n id: original.id,\n isClosable: original.isClosable,\n }\n return result;\n }\n\n export function copyContent(original: readonly ChildItemConfig[]): ChildItemConfig[] {\n const count = original.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = ResolvedItemConfig.createCopy(original[i]) as ChildItemConfig;\n }\n return result;\n }\n\n export function createDefault(type: 'row' | 'column'): ResolvedRowOrColumnItemConfig {\n const result: ResolvedRowOrColumnItemConfig = {\n type,\n content: [],\n size: ResolvedItemConfig.defaults.size,\n sizeUnit: ResolvedItemConfig.defaults.sizeUnit,\n minSize: ResolvedItemConfig.defaults.minSize,\n minSizeUnit: ResolvedItemConfig.defaults.minSizeUnit,\n id: ResolvedItemConfig.defaults.id,\n isClosable: ResolvedItemConfig.defaults.isClosable,\n }\n return result;\n }\n}\n\n/**\n * RootItemConfig is the topmost ResolvedItemConfig specified by the user.\n * Note that it does not have a corresponding contentItem. It specifies the one and only child of the Ground ContentItem\n * Note that RootItemConfig can be an ComponentItem itemConfig. However when the Ground ContentItem's child is created\n * a ComponentItem itemConfig will create a Stack with a child ComponentItem.\n * @public\n*/\nexport type ResolvedRootItemConfig = ResolvedRowOrColumnItemConfig | ResolvedStackItemConfig | ResolvedComponentItemConfig;\n\n/** @public */\nexport namespace ResolvedRootItemConfig {\n export function createCopy(config: ResolvedRootItemConfig): ResolvedRootItemConfig {\n return ResolvedItemConfig.createCopy(config) as ResolvedRootItemConfig;\n }\n\n export function isRootItemConfig(itemConfig: ResolvedItemConfig): itemConfig is ResolvedRootItemConfig {\n switch (itemConfig.type) {\n case ItemType.row:\n case ItemType.column:\n case ItemType.stack:\n case ItemType.component:\n return true;\n case ItemType.ground:\n return false;\n default:\n throw new UnreachableCaseError('CROCOSPCICIC13687', itemConfig.type);\n }\n }\n}\n\n/** @internal */\nexport interface ResolvedGroundItemConfig extends ResolvedItemConfig {\n readonly type: 'ground';\n readonly size: 100,\n readonly sizeUnit: SizeUnitEnum.Percent,\n readonly minSize: 0,\n readonly minSizeUnit: SizeUnitEnum.Pixel,\n readonly id: '',\n readonly isClosable: false,\n readonly title: '',\n readonly reorderEnabled: false,\n}\n\n/** @internal */\nexport namespace ResolvedGroundItemConfig {\n export function create(rootItemConfig: ResolvedRootItemConfig | undefined):ResolvedGroundItemConfig {\n const content = rootItemConfig === undefined ? [] : [rootItemConfig];\n return {\n type: ItemType.ground,\n content,\n size: 100,\n sizeUnit: SizeUnitEnum.Percent,\n minSize: 0,\n minSizeUnit: SizeUnitEnum.Pixel,\n id: '',\n isClosable: false,\n title: '',\n reorderEnabled: false,\n }\n }\n}\n\n/** @public */\nexport interface ResolvedLayoutConfig {\n readonly root: ResolvedRootItemConfig | undefined;\n readonly openPopouts: ResolvedPopoutLayoutConfig[];\n readonly dimensions: ResolvedLayoutConfig.Dimensions;\n readonly settings: ResolvedLayoutConfig.Settings;\n readonly header: ResolvedLayoutConfig.Header;\n readonly resolved: true,\n}\n\n/** @public */\nexport namespace ResolvedLayoutConfig {\n export interface Settings {\n // see Config.Settings for comments\n readonly constrainDragToContainer: boolean;\n readonly reorderEnabled: boolean; // also in ResolvedItemConfig which takes precedence\n readonly popoutWholeStack: boolean;\n readonly blockedPopoutsThrowError: boolean;\n /** @deprecated Will be removed in version 3. */\n readonly closePopoutsOnUnload: boolean;\n readonly responsiveMode: ResponsiveMode;\n readonly tabOverlapAllowance: number;\n readonly reorderOnTabMenuClick: boolean;\n readonly tabControlOffset: number;\n readonly popInOnClose: boolean;\n }\n\n export namespace Settings {\n export const defaults: ResolvedLayoutConfig.Settings = {\n constrainDragToContainer: true,\n reorderEnabled: true,\n popoutWholeStack: false,\n blockedPopoutsThrowError: true,\n closePopoutsOnUnload: true,\n responsiveMode: ResponsiveMode.none, // was onload\n tabOverlapAllowance: 0,\n reorderOnTabMenuClick: true,\n tabControlOffset: 10,\n popInOnClose: false,\n } as const;\n\n export function createCopy(original: Settings): Settings {\n return {\n constrainDragToContainer: original.constrainDragToContainer,\n reorderEnabled: original.reorderEnabled,\n popoutWholeStack: original.popoutWholeStack,\n blockedPopoutsThrowError: original.blockedPopoutsThrowError,\n closePopoutsOnUnload: original.closePopoutsOnUnload,\n responsiveMode: original.responsiveMode,\n tabOverlapAllowance: original.tabOverlapAllowance,\n reorderOnTabMenuClick: original.reorderOnTabMenuClick,\n tabControlOffset: original.tabControlOffset,\n popInOnClose: original.popInOnClose,\n }\n }\n }\n\n export interface Dimensions {\n // see LayoutConfig.Dimensions for comments\n readonly borderWidth: number;\n readonly borderGrabWidth: number,\n readonly defaultMinItemHeight: number;\n readonly defaultMinItemHeightUnit: SizeUnitEnum;\n readonly defaultMinItemWidth: number;\n readonly defaultMinItemWidthUnit: SizeUnitEnum;\n readonly headerHeight: number;\n readonly dragProxyWidth: number;\n readonly dragProxyHeight: number;\n }\n\n export namespace Dimensions {\n export function createCopy(original: Dimensions): Dimensions {\n return {\n borderWidth: original.borderWidth,\n borderGrabWidth: original.borderGrabWidth,\n defaultMinItemHeight: original.defaultMinItemHeight,\n defaultMinItemHeightUnit: original.defaultMinItemHeightUnit,\n defaultMinItemWidth: original.defaultMinItemWidth,\n defaultMinItemWidthUnit: original.defaultMinItemWidthUnit,\n headerHeight: original.headerHeight,\n dragProxyWidth: original.dragProxyWidth,\n dragProxyHeight: original.dragProxyHeight,\n }\n }\n\n export const defaults: ResolvedLayoutConfig.Dimensions = {\n borderWidth: 5,\n borderGrabWidth: 5,\n defaultMinItemHeight: 0,\n defaultMinItemHeightUnit: SizeUnitEnum.Pixel,\n defaultMinItemWidth: 10,\n defaultMinItemWidthUnit: SizeUnitEnum.Pixel,\n headerHeight: 20,\n dragProxyWidth: 300,\n dragProxyHeight: 200\n } as const;\n }\n\n export interface Header {\n readonly show: false | Side;\n readonly popout: false | string;\n readonly dock: string;\n readonly maximise: false | string;\n readonly minimise: string;\n readonly close: false | string;\n readonly tabDropdown: false | string;\n }\n\n export namespace Header {\n export function createCopy(original: Header): Header {\n return {\n show: original.show,\n popout: original.popout,\n dock: original.dock,\n close: original.close,\n maximise: original.maximise,\n minimise: original.minimise,\n tabDropdown: original.tabDropdown,\n }\n }\n\n export const defaults: ResolvedLayoutConfig.Header = {\n show: Side.top,\n popout: 'open in new window',\n dock: 'dock',\n maximise: 'maximise',\n minimise: 'minimise',\n close: 'close',\n tabDropdown: 'additional tabs'\n } as const;\n }\n\n export function isPopout(config: ResolvedLayoutConfig): config is ResolvedPopoutLayoutConfig {\n return 'parentId' in config;\n }\n\n export function createDefault(): ResolvedLayoutConfig {\n const result: ResolvedLayoutConfig = {\n root: undefined,\n openPopouts: [],\n dimensions: ResolvedLayoutConfig.Dimensions.defaults,\n settings: ResolvedLayoutConfig.Settings.defaults,\n header: ResolvedLayoutConfig.Header.defaults,\n resolved: true,\n }\n return result;\n }\n\n export function createCopy(config: ResolvedLayoutConfig): ResolvedLayoutConfig {\n if (isPopout(config)) {\n return ResolvedPopoutLayoutConfig.createCopy(config);\n } else {\n const result: ResolvedLayoutConfig = {\n root: config.root === undefined ? undefined : ResolvedRootItemConfig.createCopy(config.root),\n openPopouts: ResolvedLayoutConfig.copyOpenPopouts(config.openPopouts),\n settings: ResolvedLayoutConfig.Settings.createCopy(config.settings),\n dimensions: ResolvedLayoutConfig.Dimensions.createCopy(config.dimensions),\n header: ResolvedLayoutConfig.Header.createCopy(config.header),\n resolved: config.resolved,\n }\n return result;\n }\n }\n\n export function copyOpenPopouts(original: ResolvedPopoutLayoutConfig[]): ResolvedPopoutLayoutConfig[] {\n const count = original.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = ResolvedPopoutLayoutConfig.createCopy(original[i]);\n }\n return result;\n }\n\n /**\n * Takes a GoldenLayout configuration object and\n * replaces its keys and values recursively with\n * one letter counterparts\n */\n export function minifyConfig(layoutConfig: ResolvedLayoutConfig): ResolvedLayoutConfig {\n return ConfigMinifier.translateObject(layoutConfig, true) as ResolvedLayoutConfig;\n }\n\n /**\n * Takes a configuration Object that was previously minified\n * using minifyConfig and returns its original version\n */\n export function unminifyConfig(minifiedConfig: ResolvedLayoutConfig): ResolvedLayoutConfig {\n return ConfigMinifier.translateObject(minifiedConfig, false) as ResolvedLayoutConfig;\n }\n}\n\n/** @public */\nexport interface ResolvedPopoutLayoutConfig extends ResolvedLayoutConfig {\n readonly parentId: string | null;\n readonly indexInParent: number | null;\n readonly window: ResolvedPopoutLayoutConfig.Window;\n}\n\n/** @public */\nexport namespace ResolvedPopoutLayoutConfig {\n export interface Window {\n readonly width: number | null,\n readonly height: number | null,\n readonly left: number | null,\n readonly top: number | null,\n }\n\n export namespace Window {\n export function createCopy(original: Window): Window {\n return {\n width: original.width,\n height: original.height,\n left: original.left,\n top: original.top,\n }\n }\n\n export const defaults: ResolvedPopoutLayoutConfig.Window = {\n width: null,\n height: null,\n left: null,\n top: null,\n } as const;\n }\n\n export function createCopy(original: ResolvedPopoutLayoutConfig): ResolvedPopoutLayoutConfig {\n const result: ResolvedPopoutLayoutConfig = {\n root: original.root === undefined ? undefined : ResolvedRootItemConfig.createCopy(original.root),\n openPopouts: ResolvedLayoutConfig.copyOpenPopouts(original.openPopouts),\n settings: ResolvedLayoutConfig.Settings.createCopy(original.settings),\n dimensions: ResolvedLayoutConfig.Dimensions.createCopy(original.dimensions),\n header: ResolvedLayoutConfig.Header.createCopy(original.header),\n parentId: original.parentId,\n indexInParent: original.indexInParent,\n window: ResolvedPopoutLayoutConfig.Window.createCopy(original.window),\n resolved: original.resolved,\n }\n return result;\n }\n}\n","import { AssertError } from '../errors/internal-error';\n\n/** @public */\nexport const enum I18nStringId {\n PopoutCannotBeCreatedWithGroundItemConfig,\n PleaseRegisterAConstructorFunction,\n ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned,\n ComponentIsAlreadyRegistered,\n ComponentIsNotVirtuable,\n VirtualComponentDoesNotHaveRootHtmlElement,\n ItemConfigIsNotTypeComponent,\n InvalidNumberPartInSizeString,\n UnknownUnitInSizeString,\n UnsupportedUnitInSizeString,\n}\n\n/** @public */\nexport namespace I18nStrings {\n /** @internal */\n let initialised = false;\n\n /** @internal */\n interface Info {\n readonly id: I18nStringId;\n readonly default: string;\n }\n\n /** @internal */\n type InfosObject = { [id in keyof typeof I18nStringId]: Info };\n\n /** @internal */\n const infosObject: InfosObject = {\n PopoutCannotBeCreatedWithGroundItemConfig: {\n id: I18nStringId.PopoutCannotBeCreatedWithGroundItemConfig,\n default: 'Popout cannot be created with ground ItemConfig'\n },\n PleaseRegisterAConstructorFunction: {\n id: I18nStringId.PleaseRegisterAConstructorFunction,\n default: 'Please register a constructor function'\n },\n ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned: {\n id: I18nStringId.ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned,\n default: 'Component type not registered and BindComponentEvent handler not assigned',\n },\n ComponentIsAlreadyRegistered: {\n id: I18nStringId.ComponentIsAlreadyRegistered,\n default: 'Component is already registered',\n },\n ComponentIsNotVirtuable: {\n id: I18nStringId.ComponentIsNotVirtuable,\n default: 'Component is not virtuable. Requires rootHtmlElement field/getter',\n },\n VirtualComponentDoesNotHaveRootHtmlElement: {\n id: I18nStringId.VirtualComponentDoesNotHaveRootHtmlElement,\n default: 'Virtual component does not have getter \"rootHtmlElement\"',\n },\n ItemConfigIsNotTypeComponent: {\n id: I18nStringId.ItemConfigIsNotTypeComponent,\n default: 'ItemConfig is not of type component',\n },\n\n InvalidNumberPartInSizeString: {\n id: I18nStringId.InvalidNumberPartInSizeString,\n default: 'Invalid number part in size string',\n },\n UnknownUnitInSizeString: {\n id: I18nStringId.UnknownUnitInSizeString,\n default: 'Unknown unit in size string',\n },\n UnsupportedUnitInSizeString: {\n id: I18nStringId.UnsupportedUnitInSizeString,\n default: 'Unsupported unit in size string',\n },\n }\n\n export const idCount = Object.keys(infosObject).length;\n /** @internal */\n const infos = Object.values(infosObject);\n\n export function checkInitialise(): void {\n if (!initialised) {\n for (let i = 0; i < idCount; i++) {\n const info = infos[i];\n if (info.id !== i) {\n throw new AssertError('INSI00110', `${i}: ${info.id}`);\n } else {\n i18nStrings[i] = info.default;\n }\n }\n }\n initialised = true;\n }\n}\n\n/** @public */\nexport const i18nStrings = new Array(I18nStrings.idCount);\n","import { WidthAndHeight } from './types';\n\n/** @internal */\nexport function numberToPixels(value: number): string {\n return value.toString(10) + 'px';\n}\n\n/** @internal */\nexport function pixelsToNumber(value: string): number {\n const numberStr = value.replace(\"px\", \"\");\n return parseFloat(numberStr);\n}\n\n/** @internal */\nexport interface SplitStringAtFirstNonNumericCharResult {\n numericPart: string;\n firstNonNumericCharPart: string;\n}\n\n/** @internal */\nexport function splitStringAtFirstNonNumericChar(value: string): SplitStringAtFirstNonNumericCharResult {\n value = value.trimStart();\n\n const length = value.length;\n if (length === 0) {\n return { numericPart: '', firstNonNumericCharPart: '' }\n } else {\n let firstNonDigitPartIndex = length;\n let gotDecimalPoint = false;\n for (let i = 0; i < length; i++) {\n const char = value[i];\n if (!isDigit(char)) {\n if (char !== '.') {\n firstNonDigitPartIndex = i;\n break;\n } else {\n if (gotDecimalPoint) {\n firstNonDigitPartIndex = i;\n break;\n } else {\n gotDecimalPoint = true;\n }\n }\n }\n }\n const digitsPart = value.substring(0, firstNonDigitPartIndex);\n const firstNonDigitPart = value.substring(firstNonDigitPartIndex).trim();\n\n return { numericPart: digitsPart, firstNonNumericCharPart: firstNonDigitPart };\n }\n}\n\n/** @internal */\nexport function isDigit(char: string) {\n return char >= '0' && char <= '9';\n}\n\n/** @internal */\nexport function getElementWidth(element: HTMLElement): number {\n return element.offsetWidth;\n}\n\n/** @internal */\nexport function setElementWidth(element: HTMLElement, width: number): void {\n const widthAsPixels = numberToPixels(width);\n element.style.width = widthAsPixels;\n}\n\n/** @internal */\nexport function getElementHeight(element: HTMLElement): number {\n return element.offsetHeight;\n}\n\n/** @internal */\nexport function setElementHeight(element: HTMLElement, height: number): void {\n const heightAsPixels = numberToPixels(height);\n element.style.height = heightAsPixels;\n}\n\n/** @internal */\nexport function getElementWidthAndHeight(element: HTMLElement): WidthAndHeight {\n return {\n width: element.offsetWidth,\n height: element.offsetHeight,\n };\n}\n\n/** @internal */\nexport function setElementDisplayVisibility(element: HTMLElement, visible: boolean): void {\n if (visible) {\n element.style.display = '';\n } else {\n element.style.display = 'none';\n }\n}\n\n/** @internal */\nexport function ensureElementPositionAbsolute(element: HTMLElement): void {\n const absolutePosition = 'absolute';\n if (element.style.position !== absolutePosition) {\n element.style.position = absolutePosition;\n }\n}\n\n/**\n * Replacement for JQuery $.extend(target, obj)\n * @internal\n*/\nexport function extend(target: Record, obj: Record): Record {\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n target[key] = obj[key];\n }\n }\n return target;\n}\n\n/**\n * Replacement for JQuery $.extend(true, target, obj)\n * @internal\n*/\nexport function deepExtend(target: Record, obj: Record | undefined): Record {\n if (obj !== undefined) {\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n const value = obj[key];\n const existingTarget = target[key];\n target[key] = deepExtendValue(existingTarget, value);\n }\n }\n }\n\n return target;\n}\n\n/** @internal */\nexport function deepExtendValue(existingTarget: unknown, value: unknown): unknown {\n if (typeof value !== 'object') {\n return value;\n } else {\n if (Array.isArray(value)) {\n const length = value.length;\n const targetArray = new Array(length);\n for (let i = 0; i < length; i++) {\n const element = value[i];\n targetArray[i] = deepExtendValue({}, element);\n }\n return targetArray;\n } else {\n if (value === null) {\n return null;\n } else {\n const valueObj = value as Record;\n if (existingTarget === undefined) {\n return deepExtend({}, valueObj); // overwrite\n } else {\n if (typeof existingTarget !== \"object\") {\n return deepExtend({}, valueObj); // overwrite\n } else {\n if (Array.isArray(existingTarget)) {\n return deepExtend({}, valueObj); // overwrite\n } else {\n if (existingTarget === null) {\n return deepExtend({}, valueObj); // overwrite\n } else {\n const existingTargetObj = existingTarget as Record;\n return deepExtend(existingTargetObj, valueObj); // merge\n }\n }\n }\n }\n }\n }\n }\n}\n\n/** @internal */\nexport function removeFromArray(item: T, array: T[]): void {\n const index = array.indexOf(item);\n\n if (index === -1) {\n throw new Error('Can\\'t remove item from array. Item is not in the array');\n }\n\n array.splice(index, 1);\n}\n\n/** @internal */\nexport function getUniqueId(): string {\n return (Math.random() * 1000000000000000)\n .toString(36)\n .replace('.', '');\n}\n\n/** @internal */\nexport function getErrorMessage(e: unknown): string {\n if (e instanceof Error) {\n return e.message;\n } else {\n if (typeof e === 'string') {\n return e;\n } else {\n return 'Unknown Error';\n }\n }\n}\n","/** @public */\nexport abstract class ExternalError extends Error {\n /** @internal */\n constructor(public readonly type: string, message: string) {\n super(message);\n }\n}\n\n/** @public */\nexport class ConfigurationError extends ExternalError {\n /** @internal */\n constructor(message: string, public readonly node?: string) {\n super('Configuration', message);\n }\n}\n\n/** @public */\nexport class PopoutBlockedError extends ExternalError {\n /** @internal */\n constructor(message: string) {\n super('PopoutBlocked', message);\n }\n}\n\n/** @public */\nexport class ApiError extends ExternalError {\n /** @internal */\n constructor(message: string) {\n super('API', message);\n }\n}\n\n/** @public */\nexport class BindError extends ExternalError {\n /** @internal */\n constructor(message: string) {\n super('Bind', message);\n }\n}\n","import { ConfigurationError } from '../errors/external-error';\nimport { AssertError, UnexpectedUndefinedError, UnreachableCaseError } from '../errors/internal-error';\nimport { I18nStringId, i18nStrings } from '../utils/i18n-strings';\nimport { ItemType, JsonValue, ResponsiveMode, Side, SizeUnitEnum } from '../utils/types';\nimport { deepExtendValue, splitStringAtFirstNonNumericChar } from '../utils/utils';\nimport {\n ResolvedComponentItemConfig,\n ResolvedHeaderedItemConfig,\n ResolvedItemConfig,\n ResolvedLayoutConfig,\n ResolvedPopoutLayoutConfig,\n ResolvedRootItemConfig,\n ResolvedRowOrColumnItemConfig,\n ResolvedStackItemConfig\n} from \"./resolved-config\";\n\n/** @public */\nexport interface ItemConfig {\n /**\n * The type of the item. Possible values are 'row', 'column', 'stack', 'component'.\n */\n type: ItemType;\n\n /**\n * An array of configurations for items that will be created as children of this item.\n */\n content?: ItemConfig[];\n\n /**\n * The width of this item, relative to the other children of its parent in percent\n * @deprecated use {@link (ItemConfig:interface).size} instead\n */\n width?: number;\n\n /**\n * The minimum width of this item in pixels\n * CAUTION - Not tested - do not use\n * @deprecated use {@link (ItemConfig:interface).minSize} instead\n */\n minWidth?: number;\n\n /**\n * The height of this item, relative to the other children of its parent in percent\n * @deprecated use {@link (ItemConfig:interface).size} instead\n */\n height?: number;\n\n /**\n * The minimum height of this item in pixels\n * CAUTION - Not tested - do not use\n * @deprecated use {@link (ItemConfig:interface).minSize} instead\n */\n minHeight?: number;\n\n /**\n * The size of this item.\n * For rows, it specifies height. For columns, it specifies width.\n * Has format \\\\<{@link SizeUnit}\\>. Currently only supports units `fr` and `%`.\n *\n * Space is first proportionally allocated to items with sizeUnit `%`.\n * If there is any space left over (less than 100% allocated), then the\n * remainder is allocated to the items with unit `fr` according to the fractional size.\n * If more than 100% is allocated, then an extra 50% is allocated to items with unit `fr` and\n * is allocated to each item according to its fractional size. All item sizes are then adjusted\n * to bring the total back to 100%\n */\n size?: string;\n\n /**\n * The size of this item.\n * For rows, it specifies height. For columns, it specifies width.\n * Has format . Currently only supports units `px`\n */\n minSize?: string;\n\n /**\n * A string that can be used to identify a ContentItem.\n * Do NOT assign an array. This only exists for legacy purposes. If an array is assigned, the first element\n * will become the id.\n */\n id?: string;\n\n /**\n * Determines if the item is closable. If false, the x on the items tab will be hidden and container.close()\n * will return false\n * Default: true\n */\n isClosable?: boolean;\n\n /**\n * The title of the item as displayed on its tab and on popout windows\n * Default: componentType.toString() or ''\n * @deprecated only Component has a title\n */\n title?: string;\n}\n\n/** @public */\nexport namespace ItemConfig {\n /** @internal */\n export const enum SizeWidthHeightSpecificationType {\n None,\n Size,\n WidthOrHeight,\n }\n\n /** @internal */\n export function resolve(itemConfig: ItemConfig, rowAndColumnChildLegacySizeDefault: boolean): ResolvedItemConfig {\n switch (itemConfig.type) {\n case ItemType.ground:\n throw new ConfigurationError('ItemConfig cannot specify type ground', JSON.stringify(itemConfig));\n case ItemType.row:\n case ItemType.column:\n return RowOrColumnItemConfig.resolve(itemConfig as RowOrColumnItemConfig, rowAndColumnChildLegacySizeDefault);\n\n case ItemType.stack:\n return StackItemConfig.resolve(itemConfig as StackItemConfig, rowAndColumnChildLegacySizeDefault);\n\n case ItemType.component:\n return ComponentItemConfig.resolve(itemConfig as ComponentItemConfig, rowAndColumnChildLegacySizeDefault);\n\n default:\n throw new UnreachableCaseError('UCUICR55499', itemConfig.type);\n }\n }\n\n /** @internal */\n export function resolveContent(content: ItemConfig[] | undefined): ResolvedItemConfig[] {\n if (content === undefined) {\n return [];\n } else {\n const count = content.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = ItemConfig.resolve(content[i], false);\n }\n return result;\n }\n }\n\n /** @internal */\n export function resolveId(id: string | string[] | undefined): string {\n if (id === undefined) {\n return ResolvedItemConfig.defaults.id;\n } else {\n if (Array.isArray(id)) {\n if (id.length === 0) {\n return ResolvedItemConfig.defaults.id;\n } else {\n return id[0];\n }\n } else {\n return id;\n }\n }\n }\n\n /** @internal */\n export function resolveSize(\n size: string | undefined,\n width: number | undefined,\n height: number | undefined,\n rowAndColumnChildLegacySizeDefault: boolean):\n SizeWithUnit {\n // Remove support for rowAndColumnChildLegacySizeDefault in a major version release\n\n if (size !== undefined) {\n return parseSize(size, [SizeUnitEnum.Percent, SizeUnitEnum.Fractional]);\n } else {\n if (width !== undefined || height !== undefined) {\n if (width !== undefined) {\n return { size: width, sizeUnit: SizeUnitEnum.Percent };\n } else {\n if (height !== undefined) {\n return { size: height, sizeUnit: SizeUnitEnum.Percent };\n } else {\n throw new UnexpectedUndefinedError('CRS33390');\n }\n }\n } else {\n if (rowAndColumnChildLegacySizeDefault) {\n return { size: 50, sizeUnit: SizeUnitEnum.Percent };\n } else {\n return { size: ResolvedItemConfig.defaults.size, sizeUnit: ResolvedItemConfig.defaults.sizeUnit };\n }\n }\n }\n }\n\n /** @internal */\n export function resolveMinSize(minSize: string | undefined, minWidth: number | undefined, minHeight: number | undefined): UndefinableSizeWithUnit {\n if (minSize !== undefined) {\n return parseSize(minSize, [SizeUnitEnum.Pixel]);\n } else {\n const minWidthDefined = minWidth !== undefined;\n const minHeightDefined = minHeight !== undefined;\n if (minWidthDefined || minHeightDefined) {\n if (minWidthDefined) {\n return { size: minWidth, sizeUnit: SizeUnitEnum.Pixel };\n } else {\n return { size: minHeight, sizeUnit: SizeUnitEnum.Pixel };\n }\n } else {\n return { size: ResolvedItemConfig.defaults.minSize, sizeUnit: ResolvedItemConfig.defaults.minSizeUnit };\n }\n }\n }\n\n /** @internal */\n export function calculateSizeWidthHeightSpecificationType(config: ItemConfig): SizeWidthHeightSpecificationType {\n if (config.size !== undefined) {\n return SizeWidthHeightSpecificationType.Size;\n } else {\n if (config.width !== undefined || config.height !== undefined) {\n return SizeWidthHeightSpecificationType.WidthOrHeight;\n } else {\n return SizeWidthHeightSpecificationType.None;\n }\n }\n }\n\n export function isGround(config: ItemConfig): config is ItemConfig {\n return config.type === ItemType.ground;\n }\n export function isRow(config: ItemConfig): config is ItemConfig {\n return config.type === ItemType.row;\n }\n export function isColumn(config: ItemConfig): config is ItemConfig {\n return config.type === ItemType.column;\n }\n export function isStack(config: ItemConfig): config is ItemConfig {\n return config.type === ItemType.stack;\n }\n export function isComponent(config: ItemConfig): config is ComponentItemConfig {\n return config.type === ItemType.component;\n }\n}\n\n// Stack or Component\n/** @public */\nexport interface HeaderedItemConfig extends ItemConfig {\n /** @deprecated use {@link (HeaderedItemConfig:namespace).(Header:interface).show} instead */\n hasHeaders?: boolean;\n header?: HeaderedItemConfig.Header;\n maximised?: boolean;\n}\n\n/** @public */\nexport namespace HeaderedItemConfig {\n const legacyMaximisedId = '__glMaximised';\n\n export interface Header {\n show?: false | Side;\n popout?: false | string;\n dock?: false | string;\n maximise?: false | string;\n close?: string;\n minimise?: string;\n tabDropdown?: false | string;\n }\n\n export namespace Header {\n export function resolve(header: Header | undefined, hasHeaders: boolean | undefined): ResolvedHeaderedItemConfig.Header | undefined {\n if (header === undefined && hasHeaders === undefined) {\n return undefined;\n } else {\n const result: ResolvedHeaderedItemConfig.Header = {\n show: header?.show ?? (hasHeaders === undefined ? undefined : hasHeaders ? ResolvedLayoutConfig.Header.defaults.show : false),\n popout: header?.popout,\n maximise: header?.maximise,\n close: header?.close,\n minimise: header?.minimise,\n tabDropdown: header?.tabDropdown,\n }\n return result;\n }\n }\n }\n\n /** @internal */\n export function resolveIdAndMaximised(config: HeaderedItemConfig): { id: string, maximised: boolean} {\n let id: string;\n // To support legacy configs with Id saved as an array of string, assign config.id to a type which includes string array\n let legacyId: string | string[] | undefined = config.id;\n let legacyMaximised = false;\n if (legacyId === undefined) {\n id = ResolvedItemConfig.defaults.id;\n } else {\n if (Array.isArray(legacyId)) {\n const idx = legacyId.findIndex((id) => id === legacyMaximisedId)\n if (idx > 0) {\n legacyMaximised = true;\n legacyId = legacyId.splice(idx, 1);\n }\n if (legacyId.length > 0) {\n id = legacyId[0];\n } else {\n id = ResolvedItemConfig.defaults.id;\n }\n } else {\n id = legacyId;\n }\n }\n\n let maximised: boolean;\n if (config.maximised !== undefined) {\n maximised = config.maximised;\n } else {\n maximised = legacyMaximised;\n }\n\n return { id, maximised }\n }\n}\n\n/** @public */\nexport interface StackItemConfig extends HeaderedItemConfig {\n type: 'stack';\n content: ComponentItemConfig[];\n /** The index of the item in content which is to be active*/\n activeItemIndex?: number;\n}\n\n/** @public */\nexport namespace StackItemConfig {\n /** @internal */\n export function resolve(itemConfig: StackItemConfig, rowAndColumnChildLegacySizeDefault: boolean): ResolvedStackItemConfig {\n const { id, maximised } = HeaderedItemConfig.resolveIdAndMaximised(itemConfig);\n const { size, sizeUnit } = ItemConfig.resolveSize(itemConfig.size, itemConfig.width, itemConfig.height, rowAndColumnChildLegacySizeDefault);\n const { size: minSize, sizeUnit: minSizeUnit } = ItemConfig.resolveMinSize(itemConfig.minSize, itemConfig.minWidth, itemConfig.minHeight);\n\n const result: ResolvedStackItemConfig = {\n type: ItemType.stack,\n content: resolveContent(itemConfig.content),\n size,\n sizeUnit,\n minSize,\n minSizeUnit,\n id,\n maximised,\n isClosable: itemConfig.isClosable ?? ResolvedItemConfig.defaults.isClosable,\n activeItemIndex: itemConfig.activeItemIndex ?? ResolvedStackItemConfig.defaultActiveItemIndex,\n header: HeaderedItemConfig.Header.resolve(itemConfig.header, itemConfig.hasHeaders),\n };\n return result;\n }\n\n /** @internal */\n export function fromResolved(resolvedConfig: ResolvedStackItemConfig): StackItemConfig {\n const result: StackItemConfig = {\n type: ItemType.stack,\n content: fromResolvedContent(resolvedConfig.content),\n size: formatSize(resolvedConfig.size, resolvedConfig.sizeUnit),\n minSize: formatUndefinableSize(resolvedConfig.minSize, resolvedConfig.minSizeUnit),\n id: resolvedConfig.id,\n maximised: resolvedConfig.maximised,\n isClosable: resolvedConfig.isClosable,\n activeItemIndex: resolvedConfig.activeItemIndex,\n header: ResolvedHeaderedItemConfig.Header.createCopy(resolvedConfig.header),\n };\n\n return result;\n }\n\n /** @internal */\n function resolveContent(content: ComponentItemConfig[] | undefined): ResolvedComponentItemConfig[] {\n if (content === undefined) {\n return [];\n } else {\n const count = content.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const childItemConfig = content[i];\n const itemConfig = ItemConfig.resolve(childItemConfig, false);\n if (!ResolvedItemConfig.isComponentItem(itemConfig)) {\n throw new AssertError('UCUSICRC91114', JSON.stringify(itemConfig));\n } else {\n result[i] = itemConfig;\n }\n }\n return result;\n }\n }\n\n /** @internal */\n function fromResolvedContent(resolvedContent: ResolvedComponentItemConfig[]): ComponentItemConfig[] {\n const count = resolvedContent.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const resolvedContentConfig = resolvedContent[i];\n result[i] = ComponentItemConfig.fromResolved(resolvedContentConfig);\n }\n return result;\n }\n}\n\n/** @public */\nexport interface ComponentItemConfig extends HeaderedItemConfig {\n type: 'component';\n readonly content?: [];\n\n /**\n * The title of the item as displayed on its tab and on popout windows\n * Default: componentType.toString() or ''\n */\n title?: string;\n\n /**\n * The type of the component.\n * @deprecated use {@link (ComponentItemConfig:interface).componentType} instead\n */\n componentName?: string;\n\n /**\n * The type of the component.\n * `componentType` must be of type `string` if it is registered with any of the following functions:\n * * {@link (GoldenLayout:class).registerComponent} (deprecated)\n * * {@link (GoldenLayout:class).registerComponentConstructor}\n * * {@link (GoldenLayout:class).registerComponentFactoryFunction}\n */\n componentType: JsonValue;\n /**\n * The state information with which a component will be initialised with.\n * Will be passed to the component constructor function and will be the value returned by\n * container.initialState.\n */\n componentState?: JsonValue;\n\n /**\n * Default: true\n */\n reorderEnabled?: boolean; // Takes precedence over LayoutConfig.reorderEnabled.\n}\n\n/** @public */\nexport namespace ComponentItemConfig {\n /** @internal */\n export function resolve(itemConfig: ComponentItemConfig, rowAndColumnChildLegacySizeDefault: boolean): ResolvedComponentItemConfig {\n let componentType: JsonValue | undefined = itemConfig.componentType;\n if (componentType === undefined) {\n componentType = itemConfig.componentName;\n }\n if (componentType === undefined) {\n throw new Error('ComponentItemConfig.componentType is undefined');\n } else {\n const { id, maximised } = HeaderedItemConfig.resolveIdAndMaximised(itemConfig);\n let title: string;\n if (itemConfig.title === undefined || itemConfig.title === '') {\n title = ComponentItemConfig.componentTypeToTitle(componentType);\n } else {\n title = itemConfig.title;\n }\n const { size, sizeUnit } = ItemConfig.resolveSize(itemConfig.size, itemConfig.width, itemConfig.height, rowAndColumnChildLegacySizeDefault);\n const { size: minSize, sizeUnit: minSizeUnit } = ItemConfig.resolveMinSize(itemConfig.minSize, itemConfig.minWidth, itemConfig.minHeight);\n const result: ResolvedComponentItemConfig = {\n type: itemConfig.type,\n content: [],\n size,\n sizeUnit,\n minSize,\n minSizeUnit,\n id,\n maximised,\n isClosable: itemConfig.isClosable ?? ResolvedItemConfig.defaults.isClosable,\n reorderEnabled: itemConfig.reorderEnabled ?? ResolvedComponentItemConfig.defaultReorderEnabled,\n title,\n header: HeaderedItemConfig.Header.resolve(itemConfig.header, itemConfig.hasHeaders),\n componentType,\n componentState: itemConfig.componentState ?? {},\n };\n return result;\n }\n }\n\n /** @internal */\n export function fromResolved(resolvedConfig: ResolvedComponentItemConfig): ComponentItemConfig {\n const result: ComponentItemConfig = {\n type: ItemType.component,\n size: formatSize(resolvedConfig.size, resolvedConfig.sizeUnit),\n minSize: formatUndefinableSize(resolvedConfig.minSize, resolvedConfig.minSizeUnit),\n id: resolvedConfig.id,\n maximised: resolvedConfig.maximised,\n isClosable: resolvedConfig.isClosable,\n reorderEnabled: resolvedConfig.reorderEnabled,\n title: resolvedConfig.title,\n header: ResolvedHeaderedItemConfig.Header.createCopy(resolvedConfig.header),\n componentType: resolvedConfig.componentType,\n componentState: deepExtendValue(undefined, resolvedConfig.componentState) as JsonValue,\n }\n\n return result;\n }\n\n export function componentTypeToTitle(componentType: JsonValue): string {\n const componentTypeType = typeof componentType;\n switch (componentTypeType) {\n case 'string': return componentType as string;\n case 'number': return (componentType as number).toString();\n case 'boolean': return (componentType as boolean).toString();\n default: return '';\n }\n }\n}\n\n// RowOrColumn\n/** @public */\nexport interface RowOrColumnItemConfig extends ItemConfig {\n type: 'row' | 'column';\n content: (RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig)[];\n}\n\n/** @public */\nexport namespace RowOrColumnItemConfig {\n export type ChildItemConfig = RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig;\n\n export function isChildItemConfig(itemConfig: ItemConfig): itemConfig is ChildItemConfig {\n switch (itemConfig.type) {\n case ItemType.row:\n case ItemType.column:\n case ItemType.stack:\n case ItemType.component:\n return true;\n case ItemType.ground:\n return false;\n default:\n throw new UnreachableCaseError('UROCOSPCICIC13687', itemConfig.type);\n }\n }\n\n /** @internal */\n export function resolve(itemConfig: RowOrColumnItemConfig, rowAndColumnChildLegacySizeDefault: boolean): ResolvedRowOrColumnItemConfig {\n const { size, sizeUnit } = ItemConfig.resolveSize(itemConfig.size, itemConfig.width, itemConfig.height, rowAndColumnChildLegacySizeDefault);\n const { size: minSize, sizeUnit: minSizeUnit } = ItemConfig.resolveMinSize(itemConfig.minSize, itemConfig.minWidth, itemConfig.minHeight);\n const result: ResolvedRowOrColumnItemConfig = {\n type: itemConfig.type,\n content: RowOrColumnItemConfig.resolveContent(itemConfig.content),\n size,\n sizeUnit,\n minSize,\n minSizeUnit,\n id: ItemConfig.resolveId(itemConfig.id),\n isClosable: itemConfig.isClosable ?? ResolvedItemConfig.defaults.isClosable,\n }\n return result;\n }\n\n /** @internal */\n export function fromResolved(resolvedConfig: ResolvedRowOrColumnItemConfig): RowOrColumnItemConfig {\n const result: RowOrColumnItemConfig = {\n type: resolvedConfig.type,\n content: fromResolvedContent(resolvedConfig.content),\n size: formatSize(resolvedConfig.size, resolvedConfig.sizeUnit),\n minSize: formatUndefinableSize(resolvedConfig.minSize, resolvedConfig.minSizeUnit),\n id: resolvedConfig.id,\n isClosable: resolvedConfig.isClosable,\n }\n\n return result;\n }\n\n /** @internal */\n export function resolveContent(content: ChildItemConfig[] | undefined): ResolvedRowOrColumnItemConfig.ChildItemConfig[] {\n if (content === undefined) {\n return [];\n } else {\n const count = content.length;\n const childItemConfigs = new Array(count);\n let widthOrHeightSpecifiedAtLeastOnce = false;\n let sizeSpecifiedAtLeastOnce = false;\n for (let i = 0; i < count; i++) {\n const childItemConfig = content[i];\n if (!RowOrColumnItemConfig.isChildItemConfig(childItemConfig)) {\n throw new ConfigurationError('ItemConfig is not Row, Column or Stack', childItemConfig);\n } else {\n if (!sizeSpecifiedAtLeastOnce) {\n const sizeWidthHeightSpecificationType = ItemConfig.calculateSizeWidthHeightSpecificationType(childItemConfig);\n switch (sizeWidthHeightSpecificationType) {\n case ItemConfig.SizeWidthHeightSpecificationType.None:\n break;\n case ItemConfig.SizeWidthHeightSpecificationType.WidthOrHeight:\n widthOrHeightSpecifiedAtLeastOnce = true;\n break;\n case ItemConfig.SizeWidthHeightSpecificationType.Size:\n sizeSpecifiedAtLeastOnce = true;\n break;\n default:\n throw new UnreachableCaseError('ROCICRC87556', sizeWidthHeightSpecificationType);\n }\n }\n childItemConfigs[i] = childItemConfig;\n }\n }\n\n let legacySizeDefault: boolean;\n if (sizeSpecifiedAtLeastOnce) {\n legacySizeDefault = false;\n } else {\n if (widthOrHeightSpecifiedAtLeastOnce) {\n legacySizeDefault = true;\n } else {\n legacySizeDefault = false;\n }\n }\n\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const childItemConfig = childItemConfigs[i];\n const resolvedChildItemConfig = ItemConfig.resolve(childItemConfig, legacySizeDefault);\n if (!ResolvedRowOrColumnItemConfig.isChildItemConfig(resolvedChildItemConfig)) {\n throw new AssertError('UROCOSPIC99512', JSON.stringify(resolvedChildItemConfig));\n } else {\n result[i] = resolvedChildItemConfig;\n }\n }\n return result;\n }\n }\n\n /** @internal */\n function fromResolvedContent(resolvedContent: readonly ResolvedRowOrColumnItemConfig.ChildItemConfig[]): RowOrColumnItemConfig.ChildItemConfig[] {\n const count = resolvedContent.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const resolvedContentConfig = resolvedContent[i];\n const type = resolvedContentConfig.type;\n let contentConfig: RowOrColumnItemConfig.ChildItemConfig;\n switch (type) {\n case ItemType.row:\n case ItemType.column:\n contentConfig = RowOrColumnItemConfig.fromResolved(resolvedContentConfig);\n break;\n case ItemType.stack:\n contentConfig = StackItemConfig.fromResolved(resolvedContentConfig);\n break;\n case ItemType.component:\n contentConfig = ComponentItemConfig.fromResolved(resolvedContentConfig);\n break;\n default:\n throw new UnreachableCaseError('ROCICFRC44797', type);\n }\n result[i] = contentConfig;\n }\n return result;\n }\n}\n\n/** @public */\nexport type RootItemConfig = RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig;\n\n/** @public */\nexport namespace RootItemConfig {\n export function isRootItemConfig(itemConfig: ItemConfig): itemConfig is RootItemConfig {\n switch (itemConfig.type) {\n case ItemType.row:\n case ItemType.column:\n case ItemType.stack:\n case ItemType.component:\n return true;\n case ItemType.ground:\n return false;\n default:\n throw new UnreachableCaseError('URICIR23687', itemConfig.type);\n }\n }\n\n /** @internal */\n export function resolve(itemConfig: RootItemConfig | undefined): ResolvedRootItemConfig | undefined {\n if (itemConfig === undefined) {\n return undefined;\n } else {\n const result = ItemConfig.resolve(itemConfig, false);\n if (!ResolvedRootItemConfig.isRootItemConfig(result)) {\n throw new ConfigurationError('ItemConfig is not Row, Column or Stack', JSON.stringify(itemConfig));\n } else {\n return result;\n }\n }\n }\n\n /** @internal */\n export function fromResolvedOrUndefined(resolvedItemConfig: ResolvedRootItemConfig | undefined): RootItemConfig | undefined {\n if (resolvedItemConfig === undefined) {\n return undefined;\n } else {\n const type = resolvedItemConfig.type;\n switch (type) {\n case ItemType.row:\n case ItemType.column:\n return RowOrColumnItemConfig.fromResolved(resolvedItemConfig);\n case ItemType.stack:\n return StackItemConfig.fromResolved(resolvedItemConfig);\n case ItemType.component:\n return ComponentItemConfig.fromResolved(resolvedItemConfig);\n default:\n throw new UnreachableCaseError('RICFROU89921', type);\n }\n }\n }\n}\n\n/** @public */\nexport interface LayoutConfig {\n root: RootItemConfig | undefined;\n /** @deprecated Use {@link (LayoutConfig:interface).root} */\n content?: (RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig)[];\n openPopouts?: PopoutLayoutConfig[];\n dimensions?: LayoutConfig.Dimensions;\n settings?: LayoutConfig.Settings;\n /** @deprecated use {@link (LayoutConfig:interface).header} instead */\n labels?: LayoutConfig.Labels;\n header?: LayoutConfig.Header;\n}\n\n/** Use to specify LayoutConfig with defaults or deserialise a LayoutConfig.\n * Deserialisation will handle backwards compatibility.\n * Note that LayoutConfig should be used for serialisation (not LayoutConfig)\n * @public\n */\nexport namespace LayoutConfig {\n export interface Settings {\n /**\n * @deprecated use ${@link (LayoutConfig:namespace).(Header:interface).show} instead\n */\n hasHeaders?: boolean;\n\n /**\n * Constrains the area in which items can be dragged to the layout's container. Will be set to false\n * automatically when layout.createDragSource() is called.\n * Default: true\n */\n constrainDragToContainer?: boolean;\n\n /**\n * If true, the user can re-arrange the layout by dragging items by their tabs to the desired location.\n * Can be overridden by ItemConfig.reorderEnabled for specific ItemConfigs\n * Default: true\n */\n reorderEnabled?: boolean;\n\n /**\n * Decides what will be opened in a new window if the user clicks the popout icon. If true the entire stack will\n * be transferred to the new window, if false only the active component will be opened.\n * Default: false\n */\n popoutWholeStack?: boolean;\n\n /**\n * Specifies if an error is thrown when a popout is blocked by the browser (e.g. by opening it programmatically).\n * If false, the popout call will fail silently.\n * Default: true\n */\n blockedPopoutsThrowError?: boolean;\n\n /**\n * Specifies if all popouts should be closed when the page that created them is closed. Popouts don't have a\n * strong dependency on their parent and can exist on their own, but can be quite annoying to close by hand. In\n * addition, any changes made to popouts won't be stored after the parent is closed.\n * Default: true\n * @deprecated Will be removed in version 3.\n */\n closePopoutsOnUnload?: boolean;\n\n /**\n * Specifies if the popout icon should be displayed in the header-bar.\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).popout} instead\n */\n showPopoutIcon?: boolean;\n\n /**\n * Specifies if the maximise icon should be displayed in the header-bar.\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).maximise} instead\n */\n showMaximiseIcon?: boolean;\n\n /**\n * Specifies if the close icon should be displayed in the header-bar.\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).close} instead\n */\n showCloseIcon?: boolean;\n\n /**\n * Specifies Responsive Mode (more info needed).\n * Default: none\n */\n responsiveMode?: ResponsiveMode;\n\n /**\n * Specifies Maximum pixel overlap per tab.\n * Default: 0\n */\n tabOverlapAllowance?: number;\n\n /**\n *\n * Default: true\n */\n reorderOnTabMenuClick?: boolean;\n\n /**\n * Default: 10\n */\n tabControlOffset?: number;\n\n /**\n * Specifies whether to pop in elements when closing a popout window.\n * Default: false\n */\n popInOnClose?: boolean;\n }\n\n export namespace Settings {\n export function resolve(settings: Settings | undefined): ResolvedLayoutConfig.Settings {\n const result: ResolvedLayoutConfig.Settings = {\n constrainDragToContainer: settings?.constrainDragToContainer ?? ResolvedLayoutConfig.Settings.defaults.constrainDragToContainer,\n reorderEnabled: settings?.reorderEnabled ?? ResolvedLayoutConfig.Settings.defaults.reorderEnabled,\n popoutWholeStack: settings?.popoutWholeStack ?? ResolvedLayoutConfig.Settings.defaults.popoutWholeStack,\n blockedPopoutsThrowError: settings?.blockedPopoutsThrowError ?? ResolvedLayoutConfig.Settings.defaults.blockedPopoutsThrowError,\n closePopoutsOnUnload: settings?.closePopoutsOnUnload ?? ResolvedLayoutConfig.Settings.defaults.closePopoutsOnUnload,\n responsiveMode: settings?.responsiveMode ?? ResolvedLayoutConfig.Settings.defaults.responsiveMode,\n tabOverlapAllowance: settings?.tabOverlapAllowance ?? ResolvedLayoutConfig.Settings.defaults.tabOverlapAllowance,\n reorderOnTabMenuClick: settings?.reorderOnTabMenuClick ?? ResolvedLayoutConfig.Settings.defaults.reorderOnTabMenuClick,\n tabControlOffset: settings?.tabControlOffset ?? ResolvedLayoutConfig.Settings.defaults.tabControlOffset,\n popInOnClose: settings?.popInOnClose ?? ResolvedLayoutConfig.Settings.defaults.popInOnClose,\n }\n return result;\n }\n }\n\n export interface Dimensions {\n /**\n * The width of the borders between the layout items in pixel. Please note: The actual draggable area is wider\n * than the visible one, making it safe to set this to small values without affecting usability.\n * Default: 5\n */\n borderWidth?: number;\n\n /**\n * Default: 15\n */\n borderGrabWidth?: number,\n\n /**\n * The minimum height an item can be resized to (in pixel).\n * @deprecated use {@link (LayoutConfig:namespace).(Dimensions:interface).defaultMinItemHeight} instead\n */\n minItemHeight?: number;\n\n /**\n * The minimum height an item can be resized to.\n * Default: 0\n */\n defaultMinItemHeight?: string;\n\n /**\n * The minimum width an item can be resized to (in pixel).\n * @deprecated use {@link (LayoutConfig:namespace).(Dimensions:interface).defaultMinItemWidth} instead\n */\n minItemWidth?: number;\n\n /**\n * The minimum width an item can be resized to.\n * Default: 10px\n */\n defaultMinItemWidth?: string;\n\n /**\n * The height of the header elements in pixel. This can be changed, but your theme's header css needs to be\n * adjusted accordingly.\n * Default: 20\n */\n headerHeight?: number;\n\n /**\n * The width of the element that appears when an item is dragged (in pixel).\n * Default: 300\n */\n dragProxyWidth?: number;\n\n /**\n * The height of the element that appears when an item is dragged (in pixel).\n * Default: 200\n */\n dragProxyHeight?: number;\n }\n\n export namespace Dimensions {\n /** @internal */\n export function resolve(dimensions: Dimensions | undefined): ResolvedLayoutConfig.Dimensions {\n const { size: defaultMinItemHeight, sizeUnit: defaultMinItemHeightUnit } = Dimensions.resolveDefaultMinItemHeight(dimensions);\n const { size: defaultMinItemWidth, sizeUnit: defaultMinItemWidthUnit } = Dimensions.resolveDefaultMinItemWidth(dimensions);\n const result: ResolvedLayoutConfig.Dimensions = {\n borderWidth: dimensions?.borderWidth ?? ResolvedLayoutConfig.Dimensions.defaults.borderWidth,\n borderGrabWidth: dimensions?.borderGrabWidth ?? ResolvedLayoutConfig.Dimensions.defaults.borderGrabWidth,\n defaultMinItemHeight,\n defaultMinItemHeightUnit,\n defaultMinItemWidth,\n defaultMinItemWidthUnit,\n headerHeight: dimensions?.headerHeight ?? ResolvedLayoutConfig.Dimensions.defaults.headerHeight,\n dragProxyWidth: dimensions?.dragProxyWidth ?? ResolvedLayoutConfig.Dimensions.defaults.dragProxyWidth,\n dragProxyHeight: dimensions?.dragProxyHeight ?? ResolvedLayoutConfig.Dimensions.defaults.dragProxyHeight,\n }\n return result;\n }\n\n /** @internal */\n export function fromResolved(resolvedDimensions: ResolvedLayoutConfig.Dimensions): Dimensions {\n const result: Dimensions = {\n borderWidth: resolvedDimensions.borderWidth,\n borderGrabWidth: resolvedDimensions.borderGrabWidth,\n defaultMinItemHeight: formatSize(resolvedDimensions.defaultMinItemHeight, resolvedDimensions.defaultMinItemHeightUnit),\n defaultMinItemWidth: formatSize(resolvedDimensions.defaultMinItemWidth, resolvedDimensions.defaultMinItemWidthUnit),\n headerHeight: resolvedDimensions.headerHeight,\n dragProxyWidth: resolvedDimensions.dragProxyWidth,\n dragProxyHeight: resolvedDimensions.dragProxyHeight,\n };\n\n return result;\n }\n\n /** @internal */\n export function resolveDefaultMinItemHeight(dimensions: Dimensions | undefined): SizeWithUnit {\n const height = dimensions?.defaultMinItemHeight;\n if (height === undefined) {\n return { size: ResolvedLayoutConfig.Dimensions.defaults.defaultMinItemHeight, sizeUnit: ResolvedLayoutConfig.Dimensions.defaults.defaultMinItemHeightUnit };\n } else {\n return parseSize(height, [SizeUnitEnum.Pixel]);\n }\n }\n\n /** @internal */\n export function resolveDefaultMinItemWidth(dimensions: Dimensions | undefined): SizeWithUnit {\n const width = dimensions?.defaultMinItemWidth;\n if (width === undefined) {\n return { size: ResolvedLayoutConfig.Dimensions.defaults.defaultMinItemWidth, sizeUnit: ResolvedLayoutConfig.Dimensions.defaults.defaultMinItemWidthUnit };\n } else {\n return parseSize(width, [SizeUnitEnum.Pixel]);\n }\n }\n }\n\n export interface Labels {\n /**\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).close} instead\n */\n close?: string;\n\n /**\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).maximise} instead\n */\n maximise?: string;\n\n /**\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).minimise} instead\n */\n minimise?: string;\n\n /**\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).popin} instead\n */\n popin?: string;\n\n /**\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).popout} instead\n */\n popout?: string;\n\n /**\n * @deprecated use {@link (LayoutConfig:namespace).(Header:interface).tabDropdown} instead\n */\n tabDropdown?: string;\n }\n\n export interface Header {\n /**\n * Specifies whether header should be displayed, and if so, on which side.\n * If false, the layout will be displayed with splitters only.\n * Default: 'top'\n */\n show?: false | Side;\n /**\n * The tooltip text that appears when hovering over the popout icon or false if popout button not displayed.\n * Default: 'open in new window'\n */\n popout?: false | string;\n /**\n * The tooltip text that appears when hovering over the popin icon.\n * Default: 'pop in'\n */\n popin?: string;\n /**\n * The tooltip text that appears when hovering over the maximise icon or false if maximised button not displayed.\n * Default: 'maximise'\n */\n maximise?: false | string;\n /**\n * The tooltip text that appears when hovering over the close icon.\n * Default: 'close'\n */\n close?: false | string;\n /**\n * The tooltip text that appears when hovering over the minimise icon.\n * Default: 'minimise'\n */\n minimise?: string;\n /**\n *\n * Default: 'additional tabs'\n */\n tabDropdown?: false | string;\n }\n\n export namespace Header {\n /** @internal */\n export function resolve(header: Header | undefined,\n settings: LayoutConfig.Settings | undefined, labels: LayoutConfig.Labels | undefined\n ): ResolvedLayoutConfig.Header {\n let show: false | Side;\n if (header?.show !== undefined) {\n show = header.show;\n } else {\n if (settings !== undefined && settings.hasHeaders !== undefined) {\n show = settings.hasHeaders ? ResolvedLayoutConfig.Header.defaults.show : false;\n } else {\n show = ResolvedLayoutConfig.Header.defaults.show;\n }\n }\n const result: ResolvedLayoutConfig.Header = {\n show,\n popout: header?.popout ?? labels?.popout ??\n (settings?.showPopoutIcon === false ? false : ResolvedLayoutConfig.Header.defaults.popout),\n dock: header?.popin ?? labels?.popin ?? ResolvedLayoutConfig.Header.defaults.dock,\n maximise: header?.maximise ?? labels?.maximise ??\n (settings?.showMaximiseIcon === false ? false : ResolvedLayoutConfig.Header.defaults.maximise),\n close: header?.close ?? labels?.close ??\n (settings?.showCloseIcon === false ? false : ResolvedLayoutConfig.Header.defaults.close),\n minimise: header?.minimise ?? labels?.minimise ?? ResolvedLayoutConfig.Header.defaults.minimise,\n tabDropdown: header?.tabDropdown ?? labels?.tabDropdown ?? ResolvedLayoutConfig.Header.defaults.tabDropdown,\n }\n return result;\n }\n }\n\n export function isPopout(config: LayoutConfig): config is PopoutLayoutConfig {\n return 'parentId' in config || 'indexInParent' in config || 'window' in config;\n }\n\n /** @internal */\n export function resolve(layoutConfig: LayoutConfig): ResolvedLayoutConfig {\n if (isPopout(layoutConfig)) {\n return PopoutLayoutConfig.resolve(layoutConfig);\n } else {\n let root: RootItemConfig | undefined;\n if (layoutConfig.root !== undefined) {\n root = layoutConfig.root;\n } else {\n if (layoutConfig.content !== undefined && layoutConfig.content.length > 0) {\n root = layoutConfig.content[0];\n } else {\n root = undefined;\n }\n }\n const config: ResolvedLayoutConfig = {\n resolved: true,\n root: RootItemConfig.resolve(root),\n openPopouts: LayoutConfig.resolveOpenPopouts(layoutConfig.openPopouts),\n dimensions: LayoutConfig.Dimensions.resolve(layoutConfig.dimensions),\n settings: LayoutConfig.Settings.resolve(layoutConfig.settings),\n header: LayoutConfig.Header.resolve(layoutConfig.header, layoutConfig.settings, layoutConfig.labels),\n }\n return config;\n }\n }\n\n export function fromResolved(config: ResolvedLayoutConfig): LayoutConfig {\n const result: LayoutConfig = {\n root: RootItemConfig.fromResolvedOrUndefined(config.root),\n openPopouts: PopoutLayoutConfig.fromResolvedArray(config.openPopouts),\n settings: ResolvedLayoutConfig.Settings.createCopy(config.settings),\n dimensions: LayoutConfig.Dimensions.fromResolved(config.dimensions),\n header: ResolvedLayoutConfig.Header.createCopy(config.header),\n };\n return result;\n }\n\n export function isResolved(configOrResolvedConfig: ResolvedLayoutConfig | LayoutConfig): configOrResolvedConfig is ResolvedLayoutConfig {\n const config = configOrResolvedConfig as ResolvedLayoutConfig;\n return config.resolved !== undefined && (config.resolved === true);\n }\n\n /** @internal */\n export function resolveOpenPopouts(popoutConfigs: PopoutLayoutConfig[] | undefined): ResolvedPopoutLayoutConfig[] {\n if (popoutConfigs === undefined) {\n return [];\n } else {\n const count = popoutConfigs.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = PopoutLayoutConfig.resolve(popoutConfigs[i]);\n }\n return result;\n }\n }\n}\n\n/** @public */\nexport interface PopoutLayoutConfig extends LayoutConfig {\n /** The id of the element the item will be appended to on popIn\n * If null, append to topmost layout element\n */\n parentId: string | null | undefined;\n /** The position of this element within its parent\n * If null, position is last\n */\n indexInParent: number | null | undefined;\n /** @deprecated use {@link (PopoutLayoutConfig:interface).window} */\n dimensions: PopoutLayoutConfig.Dimensions | undefined; // for backwards compatibility\n window: PopoutLayoutConfig.Window | undefined;\n}\n\n/** @public */\nexport namespace PopoutLayoutConfig {\n // Previous versions kept window information in Dimensions key. Only use for backwards compatibility\n /** @deprecated use {@link (PopoutLayoutConfig:namespace).(Window:interface)} */\n export interface Dimensions extends LayoutConfig.Dimensions {\n /** @deprecated use {@link (PopoutLayoutConfig:namespace).(Window:interface).width} */\n width?: number | null,\n /** @deprecated use {@link (PopoutLayoutConfig:namespace).(Window:interface).height} */\n height?: number | null,\n /** @deprecated use {@link (PopoutLayoutConfig:namespace).(Window:interface).left} */\n left?: number | null,\n /** @deprecated use {@link (PopoutLayoutConfig:namespace).(Window:interface).top} */\n top?: number | null,\n }\n\n export interface Window {\n width?: number,\n height?: number,\n left?: number,\n top?: number,\n }\n\n export namespace Window {\n /** @internal */\n export function resolve(window: Window | undefined,\n dimensions: Dimensions | undefined): ResolvedPopoutLayoutConfig.Window\n {\n let result: ResolvedPopoutLayoutConfig.Window;\n const defaults = ResolvedPopoutLayoutConfig.Window.defaults;\n if (window !== undefined) {\n result = {\n width: window.width ?? defaults.width,\n height: window.height ?? defaults.height,\n left: window.left ?? defaults.left,\n top: window.top ?? defaults.top,\n }\n } else {\n result = {\n width: dimensions?.width ?? defaults.width,\n height: dimensions?.height ?? defaults.height,\n left: dimensions?.left ?? defaults.left,\n top: dimensions?.top ?? defaults.top,\n }\n }\n return result;\n }\n\n /** @internal */\n export function fromResolved(resolvedWindow: ResolvedPopoutLayoutConfig.Window): Window {\n const result: Window = {\n width: resolvedWindow.width === null ? undefined : resolvedWindow.width,\n height: resolvedWindow.height === null ? undefined : resolvedWindow.height,\n left: resolvedWindow.left === null ? undefined : resolvedWindow.left,\n top: resolvedWindow.top === null ? undefined : resolvedWindow.top,\n }\n\n return result;\n }\n }\n\n /** @internal */\n export function resolve(popoutConfig: PopoutLayoutConfig): ResolvedPopoutLayoutConfig {\n let root: RootItemConfig | undefined;\n if (popoutConfig.root !== undefined) {\n root = popoutConfig.root;\n } else {\n if (popoutConfig.content !== undefined && popoutConfig.content.length > 0) {\n root = popoutConfig.content[0];\n } else {\n root = undefined;\n }\n }\n\n const config: ResolvedPopoutLayoutConfig = {\n root: RootItemConfig.resolve(root),\n openPopouts: LayoutConfig.resolveOpenPopouts(popoutConfig.openPopouts),\n dimensions: LayoutConfig.Dimensions.resolve(popoutConfig.dimensions),\n settings: LayoutConfig.Settings.resolve(popoutConfig.settings),\n header: LayoutConfig.Header.resolve(popoutConfig.header, popoutConfig.settings, popoutConfig.labels),\n parentId: popoutConfig.parentId ?? null,\n indexInParent: popoutConfig.indexInParent ?? null,\n window: PopoutLayoutConfig.Window.resolve(popoutConfig.window, popoutConfig.dimensions),\n resolved: true,\n }\n return config;\n }\n\n /** @internal */\n export function fromResolved(resolvedConfig: ResolvedPopoutLayoutConfig): PopoutLayoutConfig {\n const result: PopoutLayoutConfig = {\n root: RootItemConfig.fromResolvedOrUndefined(resolvedConfig.root),\n openPopouts: fromResolvedArray(resolvedConfig.openPopouts),\n dimensions: LayoutConfig.Dimensions.fromResolved(resolvedConfig.dimensions),\n settings: ResolvedLayoutConfig.Settings.createCopy(resolvedConfig.settings),\n header: ResolvedLayoutConfig.Header.createCopy(resolvedConfig.header),\n parentId: resolvedConfig.parentId,\n indexInParent: resolvedConfig.indexInParent,\n window: PopoutLayoutConfig.Window.fromResolved(resolvedConfig.window),\n }\n\n return result;\n }\n\n /** @internal */\n export function fromResolvedArray(resolvedArray: ResolvedPopoutLayoutConfig[]): PopoutLayoutConfig[] {\n const resolvedOpenPopoutCount = resolvedArray.length;\n const result = new Array(resolvedOpenPopoutCount);\n for (let i = 0; i < resolvedOpenPopoutCount; i++) {\n const resolvedOpenPopout = resolvedArray[i];\n result[i] = PopoutLayoutConfig.fromResolved(resolvedOpenPopout);\n }\n\n return result;\n }\n}\n\n/** @internal */\nexport interface SizeWithUnit {\n size: number;\n sizeUnit: SizeUnitEnum;\n}\n\n/** @internal */\nexport interface UndefinableSizeWithUnit {\n size: number | undefined;\n sizeUnit: SizeUnitEnum;\n}\n\n/** @internal */\nexport function parseSize(sizeString: string, allowableSizeUnits: readonly SizeUnitEnum[]): SizeWithUnit {\n const { numericPart: digitsPart, firstNonNumericCharPart: firstNonDigitPart } = splitStringAtFirstNonNumericChar(sizeString);\n const size = Number.parseInt(digitsPart, 10);\n if (isNaN(size)) {\n throw new ConfigurationError(`${i18nStrings[I18nStringId.InvalidNumberPartInSizeString]}: ${sizeString}`);\n } else {\n const sizeUnit = SizeUnitEnum.tryParse(firstNonDigitPart);\n if (sizeUnit === undefined) {\n throw new ConfigurationError(`${i18nStrings[I18nStringId.UnknownUnitInSizeString]}: ${sizeString}`)\n } else {\n if (!allowableSizeUnits.includes(sizeUnit)) {\n throw new ConfigurationError(`${i18nStrings[I18nStringId.UnsupportedUnitInSizeString]}: ${sizeString}`)\n } else {\n return { size, sizeUnit };\n }\n }\n }\n}\n\n/** @internal */\nexport function formatSize(size: number, sizeUnit: SizeUnitEnum) {\n return size.toString(10) + SizeUnitEnum.format(sizeUnit);\n}\n\n/** @internal */\nexport function formatUndefinableSize(size: number| undefined, sizeUnit: SizeUnitEnum) {\n if (size === undefined) {\n return undefined;\n } else {\n return size.toString(10) + SizeUnitEnum.format(sizeUnit);\n }\n}\n\n/** @public @deprecated - use {@link (LayoutConfig:interface)} */\nexport type Config = LayoutConfig;\n","import { BrowserPopout } from '../controls/browser-popout';\nimport { Tab } from '../controls/tab';\nimport { ComponentItem } from '../items/component-item';\n\n/**\n * A generic and very fast EventEmitter implementation. On top of emitting the actual event it emits an\n * {@link (EventEmitter:namespace).ALL_EVENT} event for every event triggered. This allows to hook into it and proxy events forwards\n * @public\n */\nexport class EventEmitter {\n /** @internal */\n private _allEventSubscriptions: EventEmitter.UnknownCallback[] = [];\n /** @internal */\n private _subscriptionsMap = new Map();\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n tryBubbleEvent(name: string, args: unknown[]): void {\n // overridden by ContentItem\n }\n\n /**\n * Emit an event and notify listeners\n *\n * @param eventName - The name of the event\n * @param args - Additional arguments that will be passed to the listener\n */\n emit(eventName: K, ...args: EventEmitter.EventParamsMap[K]): void {\n let subcriptions = this._subscriptionsMap.get(eventName);\n\n if (subcriptions !== undefined) {\n subcriptions = subcriptions.slice();\n for (let i = 0; i < subcriptions.length; i++) {\n const subscription = subcriptions[i];\n subscription(...args);\n }\n }\n\n this.emitAllEvent(eventName, args);\n this.tryBubbleEvent(eventName, args);\n }\n\n /** @internal */\n emitUnknown(eventName: string, ...args: EventEmitter.UnknownParams): void {\n let subs = this._subscriptionsMap.get(eventName);\n\n if (subs !== undefined) {\n subs = subs.slice();\n for (let i = 0; i < subs.length; i++) {\n subs[i](...args);\n }\n }\n\n this.emitAllEvent(eventName, args);\n this.tryBubbleEvent(eventName, args);\n }\n\n /* @internal **/\n emitBaseBubblingEvent(eventName: K): void {\n const event = new EventEmitter.BubblingEvent(eventName, this);\n this.emitUnknown(eventName, event);\n }\n\n /** @internal */\n emitUnknownBubblingEvent(eventName: string): void {\n const event = new EventEmitter.BubblingEvent(eventName, this);\n this.emitUnknown(eventName, event);\n }\n\n /**\n * Removes a listener for an event.\n * @param eventName - The name of the event\n * @param callback - The previously registered callback method (optional)\n */\n removeEventListener(eventName: K, callback: EventEmitter.Callback): void {\n const unknownCallback = callback as EventEmitter.UnknownCallback;\n this.removeUnknownEventListener(eventName, unknownCallback);\n }\n\n off(eventName: K, callback: EventEmitter.Callback): void {\n this.removeEventListener(eventName, callback);\n }\n\n /**\n * Alias for off\n */\n unbind = this.removeEventListener;\n\n /**\n * Alias for emit\n */\n trigger = this.emit;\n\n /**\n * Listen for events\n *\n * @param eventName - The name of the event to listen to\n * @param callback - The callback to execute when the event occurs\n */\n addEventListener(eventName: K, callback: EventEmitter.Callback): void {\n const unknownCallback = callback as EventEmitter.UnknownCallback;\n this.addUnknownEventListener(eventName, unknownCallback);\n }\n\n on(eventName: K, callback: EventEmitter.Callback): void {\n this.addEventListener(eventName, callback);\n }\n\n /** @internal */\n private addUnknownEventListener(eventName: string, callback: EventEmitter.UnknownCallback): void {\n if (eventName === EventEmitter.ALL_EVENT) {\n this._allEventSubscriptions.push(callback);\n } else {\n let subscriptions = this._subscriptionsMap.get(eventName);\n if (subscriptions !== undefined) {\n subscriptions.push(callback);\n } else {\n subscriptions = [callback];\n this._subscriptionsMap.set(eventName, subscriptions);\n }\n }\n }\n\n /** @internal */\n private removeUnknownEventListener(eventName: string, callback: EventEmitter.UnknownCallback): void {\n if (eventName === EventEmitter.ALL_EVENT) {\n this.removeSubscription(eventName, this._allEventSubscriptions, callback);\n } else {\n const subscriptions = this._subscriptionsMap.get(eventName);\n if (subscriptions === undefined) {\n throw new Error('No subscribtions to unsubscribe for event ' + eventName);\n } else {\n this.removeSubscription(eventName, subscriptions, callback);\n }\n }\n }\n\n /** @internal */\n private removeSubscription(eventName: string, subscriptions: EventEmitter.UnknownCallback[], callback: EventEmitter.UnknownCallback) {\n const idx = subscriptions.indexOf(callback);\n if (idx < 0) {\n throw new Error('Nothing to unbind for ' + eventName);\n } else {\n subscriptions.splice(idx, 1);\n }\n }\n\n /** @internal */\n private emitAllEvent(eventName: string, args: unknown[]) {\n const allEventSubscriptionsCount = this._allEventSubscriptions.length;\n if (allEventSubscriptionsCount > 0) {\n const unknownArgs = args.slice() as EventEmitter.UnknownParams;\n unknownArgs.unshift(eventName);\n\n const allEventSubcriptions = this._allEventSubscriptions.slice();\n\n for (let i = 0; i < allEventSubscriptionsCount; i++) {\n allEventSubcriptions[i](...unknownArgs);\n }\n }\n }\n}\n\n/** @public */\nexport namespace EventEmitter {\n /**\n * The name of the event that's triggered for every event\n */\n export const ALL_EVENT = '__all';\n\n export const headerClickEventName = 'stackHeaderClick';\n export const headerTouchStartEventName = 'stackHeaderTouchStart';\n\n /** @internal */\n export type UnknownCallback = (this: void, ...args: UnknownParams) => void;\n export type Callback = (this: void, ...args: EventParamsMap[K]) => void;\n\n export interface EventParamsMap {\n \"__all\": UnknownParams;\n \"activeContentItemChanged\": ComponentItemParam;\n \"close\": NoParams;\n \"closed\": NoParams;\n \"destroy\": NoParams;\n \"drag\": DragParams;\n \"dragStart\": DragStartParams;\n \"dragStop\": DragStopParams;\n \"hide\": NoParams;\n \"initialised\": NoParams;\n \"itemDropped\": ComponentItemParam;\n \"maximised\": NoParams;\n \"minimised\": NoParams;\n \"open\": NoParams;\n \"popIn\": NoParams;\n \"resize\": NoParams;\n \"show\": NoParams;\n /** @deprecated - use show instead */\n \"shown\": NoParams;\n \"stateChanged\": NoParams;\n \"tab\": TabParam;\n \"tabCreated\": TabParam;\n \"titleChanged\": StringParam;\n \"windowClosed\": PopoutParam;\n \"windowOpened\": PopoutParam;\n \"beforeComponentRelease\": BeforeComponentReleaseParams;\n \"beforeItemDestroyed\": BubblingEventParam;\n \"itemCreated\": BubblingEventParam;\n \"itemDestroyed\": BubblingEventParam;\n \"focus\": BubblingEventParam;\n \"blur\": BubblingEventParam;\n \"stackHeaderClick\": ClickBubblingEventParam;\n \"stackHeaderTouchStart\": TouchStartBubblingEventParam;\n \"userBroadcast\": UnknownParams;\n }\n\n export type UnknownParams = unknown[];\n export type NoParams = [];\n export type UnknownParam = [unknown];\n export type PopoutParam = [BrowserPopout];\n export type ComponentItemParam = [ComponentItem];\n export type TabParam = [Tab];\n export type BubblingEventParam = [EventEmitter.BubblingEvent]\n export type StringParam = [string];\n export type DragStartParams = [originalX: number, originalY: number];\n export type DragStopParams = [event: PointerEvent | undefined];\n export type DragParams = [offsetX: number, offsetY: number, event: PointerEvent];\n export type BeforeComponentReleaseParams = [component: unknown];\n export type ClickBubblingEventParam = [ClickBubblingEvent];\n export type TouchStartBubblingEventParam = [TouchStartBubblingEvent];\n\n export class BubblingEvent {\n /** @internal */\n private _isPropagationStopped = false;\n\n get name(): string { return this._name; }\n get target(): EventEmitter { return this._target; }\n /** @deprecated Use {@link (EventEmitter:namespace).(BubblingEvent:class).target} instead */\n get origin(): EventEmitter { return this._target; }\n get isPropagationStopped(): boolean { return this._isPropagationStopped; }\n\n /** @internal */\n constructor(\n /** @internal */\n private readonly _name: string,\n /** @internal */\n private readonly _target: EventEmitter) {\n }\n\n stopPropagation(): void {\n this._isPropagationStopped = true;\n }\n }\n\n export class ClickBubblingEvent extends BubblingEvent {\n get mouseEvent(): MouseEvent { return this._mouseEvent; }\n\n /** @internal */\n constructor(name: string, target: EventEmitter,\n /** @internal */\n private readonly _mouseEvent: MouseEvent\n ) {\n super(name, target);\n }\n }\n\n export class TouchStartBubblingEvent extends BubblingEvent {\n get touchEvent(): TouchEvent { return this._touchEvent; }\n\n /** @internal */\n constructor(name: string, target: EventEmitter,\n /** @internal */\n private readonly _touchEvent: TouchEvent\n ) {\n super(name, target);\n }\n }\n}\n","import { ResolvedLayoutConfig, ResolvedPopoutLayoutConfig } from '../config/resolved-config';\nimport { PopoutBlockedError } from '../errors/external-error';\nimport { UnexpectedNullError, UnexpectedUndefinedError } from '../errors/internal-error';\nimport { ContentItem } from '../items/content-item';\nimport { LayoutManager } from '../layout-manager';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { Rect } from '../utils/types';\nimport { deepExtend, getErrorMessage, getUniqueId } from '../utils/utils';\n\n/**\n * Pops a content item out into a new browser window.\n * This is achieved by\n *\n * - Creating a new configuration with the content item as root element\n * - Serializing and minifying the configuration\n * - Opening the current window's URL with the configuration as a GET parameter\n * - GoldenLayout when opened in the new window will look for the GET parameter\n * and use it instead of the provided configuration\n * @public\n */\n\nexport class BrowserPopout extends EventEmitter {\n /** @internal */\n private _popoutWindow: Window | null;\n /** @internal */\n private _isInitialised;\n /** @internal */\n private _checkReadyInterval: ReturnType | undefined;\n\n /**\n * @param _config - GoldenLayout item config\n * @param _initialWindowSize - A map with width, height, top and left\n * @internal\n */\n constructor(\n /** @internal */\n private _config: ResolvedPopoutLayoutConfig,\n /** @internal */\n private _initialWindowSize: Rect,\n /** @internal */\n private _layoutManager: LayoutManager,\n ) {\n super();\n\n this._isInitialised = false;\n this._popoutWindow = null;\n this.createWindow();\n }\n\n toConfig(): ResolvedPopoutLayoutConfig {\n if (this._isInitialised === false) {\n throw new Error('Can\\'t create config, layout not yet initialised');\n }\n\n const glInstance = this.getGlInstance();\n const glInstanceConfig = glInstance.saveLayout();\n\n let left: number | null;\n let top: number | null;\n if (this._popoutWindow === null) {\n left = null;\n top = null;\n } else {\n left = this._popoutWindow.screenX ?? this._popoutWindow.screenLeft;\n top = this._popoutWindow.screenY ?? this._popoutWindow.screenTop;\n }\n\n const window: ResolvedPopoutLayoutConfig.Window = {\n width: this.getGlInstance().width,\n height: this.getGlInstance().height,\n left,\n top,\n };\n\n const config: ResolvedPopoutLayoutConfig = {\n root: glInstanceConfig.root,\n openPopouts: glInstanceConfig.openPopouts,\n settings: glInstanceConfig.settings,\n dimensions: glInstanceConfig.dimensions,\n header: glInstanceConfig.header,\n window,\n parentId: this._config.parentId,\n indexInParent: this._config.indexInParent,\n resolved: true,\n };\n\n return config;\n }\n\n getGlInstance(): LayoutManager {\n if (this._popoutWindow === null) {\n throw new UnexpectedNullError('BPGGI24693');\n }\n return this._popoutWindow.__glInstance;\n }\n\n /**\n * Retrieves the native BrowserWindow backing this popout.\n * Might throw an UnexpectedNullError exception when the window is not initialized yet.\n * @public\n */\n getWindow(): Window {\n if (this._popoutWindow === null) {\n throw new UnexpectedNullError('BPGW087215');\n }\n return this._popoutWindow;\n }\n\n close(): void {\n if (this.getGlInstance()) {\n this.getGlInstance().closeWindow();\n } else {\n try {\n this.getWindow().close();\n } catch (e) {\n //\n }\n }\n }\n\n /**\n * Returns the popped out item to its original position. If the original\n * parent isn't available anymore it falls back to the layout's topmost element\n */\n popIn(): void {\n let parentItem: ContentItem;\n let index = this._config.indexInParent;\n\n if (!this._config.parentId) {\n return;\n }\n\n /*\n * The deepExtend call seems a bit pointless, but it's crucial to\n * copy the config returned by this.getGlInstance().toConfig()\n * onto a new object. Internet Explorer keeps the references\n * to objects on the child window, resulting in the following error\n * once the child window is closed:\n *\n * The callee (server [not server application]) is not available and disappeared\n */\n const glInstanceLayoutConfig = this.getGlInstance().saveLayout();\n const copiedGlInstanceLayoutConfig = deepExtend({}, glInstanceLayoutConfig) as ResolvedLayoutConfig;\n const copiedRoot = copiedGlInstanceLayoutConfig.root;\n if (copiedRoot === undefined) {\n throw new UnexpectedUndefinedError('BPPIR19998');\n }\n const groundItem = this._layoutManager.groundItem;\n if (groundItem === undefined) {\n throw new UnexpectedUndefinedError('BPPIG34972');\n }\n parentItem = groundItem.getItemsByPopInParentId(this._config.parentId)[0];\n\n /*\n * Fallback if parentItem is not available. Either add it to the topmost\n * item or make it the topmost item if the layout is empty\n */\n if (!parentItem) {\n if (groundItem.contentItems.length > 0) {\n parentItem = groundItem.contentItems[0];\n } else {\n parentItem = groundItem;\n }\n index = 0;\n }\n\n const newContentItem = this._layoutManager.createAndInitContentItem(copiedRoot, parentItem);\n\n parentItem.addChild(newContentItem, index);\n if (this._layoutManager.layoutConfig.settings.popInOnClose) {\n this._onClose();\n } else {\n this.close();\n }\n }\n\n /**\n * Creates the URL and window parameter\n * and opens a new window\n * @internal\n */\n private createWindow(): void {\n const url = this.createUrl();\n\n /**\n * Bogus title to prevent re-usage of existing window with the\n * same title. The actual title will be set by the new window's\n * GoldenLayout instance if it detects that it is in subWindowMode\n */\n const target = Math.floor(Math.random() * 1000000).toString(36);\n\n /**\n * The options as used in the window.open string\n */\n const features = this.serializeWindowFeatures({\n width: this._initialWindowSize.width,\n height: this._initialWindowSize.height,\n innerWidth: this._initialWindowSize.width,\n innerHeight: this._initialWindowSize.height,\n menubar: 'no',\n toolbar: 'no',\n location: 'no',\n personalbar: 'no',\n resizable: 'yes',\n scrollbars: 'no',\n status: 'no'\n });\n\n this._popoutWindow = globalThis.open(url, target, features);\n\n if (!this._popoutWindow) {\n if (this._layoutManager.layoutConfig.settings.blockedPopoutsThrowError === true) {\n const error = new PopoutBlockedError('Popout blocked');\n throw error;\n } else {\n return;\n }\n }\n\n this._popoutWindow.addEventListener('load', () => this.positionWindow(), { passive: true })\n this._popoutWindow.addEventListener('beforeunload', () => {\n if (this._layoutManager.layoutConfig.settings.popInOnClose) {\n this.popIn();\n } else {\n this._onClose();\n }\n }, { passive: true })\n\n /**\n * Polling the childwindow to find out if GoldenLayout has been initialised\n * doesn't seem optimal, but the alternatives - adding a callback to the parent\n * window or raising an event on the window object - both would introduce knowledge\n * about the parent to the child window which we'd rather avoid\n */\n this._checkReadyInterval = setInterval(() => this.checkReady(), 10);\n }\n\n /** @internal */\n private checkReady() {\n if (this._popoutWindow === null) {\n throw new UnexpectedNullError('BPCR01844');\n } else {\n if (this._popoutWindow.__glInstance && this._popoutWindow.__glInstance.isInitialised) {\n this.onInitialised();\n if (this._checkReadyInterval !== undefined) {\n clearInterval(this._checkReadyInterval);\n this._checkReadyInterval = undefined;\n }\n }\n }\n }\n\n /**\n * Serialises a map of key:values to a window options string\n *\n * @param windowOptions -\n *\n * @returns serialised window options\n * @internal\n */\n private serializeWindowFeatures(windowOptions: Record): string {\n const windowOptionsString: string[] = [];\n\n for (const key in windowOptions) {\n windowOptionsString.push(key + '=' + windowOptions[key].toString());\n }\n\n return windowOptionsString.join(',');\n }\n\n /**\n * Creates the URL for the new window, including the\n * config GET parameter\n *\n * @returns URL\n * @internal\n */\n private createUrl(): string {\n const storageKey = 'gl-window-config-' + getUniqueId();\n const config = ResolvedLayoutConfig.minifyConfig(this._config);\n\n try {\n localStorage.setItem(storageKey, JSON.stringify(config));\n } catch (e) {\n throw new Error('Error while writing to localStorage ' + getErrorMessage(e));\n }\n\n const url = new URL(location.href);\n url.searchParams.set('gl-window', storageKey);\n return url.toString();\n }\n\n /**\n * Move the newly created window roughly to\n * where the component used to be.\n * @internal\n */\n private positionWindow() {\n if (this._popoutWindow === null) {\n throw new Error('BrowserPopout.positionWindow: null popoutWindow');\n } else {\n this._popoutWindow.moveTo(this._initialWindowSize.left, this._initialWindowSize.top);\n this._popoutWindow.focus();\n }\n }\n\n /**\n * Callback when the new window is opened and the GoldenLayout instance\n * within it is initialised\n * @internal\n */\n private onInitialised(): void {\n this._isInitialised = true;\n this.getGlInstance().on('popIn', () => this.popIn());\n this.emit('initialised');\n }\n\n /**\n * Invoked 50ms after the window unload event\n * @internal\n */\n private _onClose() {\n setTimeout(() => this.emit('closed'), 50);\n }\n}\n","import { Header } from './header';\n\n/** @internal */\nexport class HeaderButton {\n private _element: HTMLElement;\n private _clickEventListener = (ev: MouseEvent) => this.onClick(ev);\n private _touchStartEventListener = (ev: TouchEvent) => this.onTouchStart(ev);\n\n get element(): HTMLElement { return this._element; }\n\n constructor(private _header: Header, label: string, cssClass: string, private _pushEvent: HeaderButton.PushEvent) {\n this._element = document.createElement('div');\n this._element.classList.add(cssClass);\n this._element.title = label;\n this._header.on('destroy', () => this.destroy());\n this._element.addEventListener('click', this._clickEventListener, { passive: true });\n this._element.addEventListener('touchstart', this._touchStartEventListener, { passive: true });\n this._header.controlsContainerElement.appendChild(this._element);\n }\n\n destroy(): void {\n this._element.removeEventListener('click', this._clickEventListener);\n this._element.removeEventListener('touchstart', this._touchStartEventListener);\n this._element.parentNode?.removeChild(this._element);\n }\n\n private onClick(ev: MouseEvent) {\n this._pushEvent(ev);\n }\n\n private onTouchStart(ev: TouchEvent) {\n this._pushEvent(ev);\n }\n}\n\n/** @internal */\nexport namespace HeaderButton {\n export type PushEvent = (this: void, ev: Event) => void;\n}\n","import { DomConstants } from './dom-constants';\nimport { EventEmitter } from './event-emitter';\n\n/** @internal */\nexport class DragListener extends EventEmitter {\n private _timeout: ReturnType | undefined;\n private _allowableTargets: HTMLElement[];\n private _oDocument: Document;\n private _eBody: HTMLElement;\n private _nDelay: number;\n private _nDistance: number;\n private _nX: number;\n private _nY: number;\n private _nOriginalX: number;\n private _nOriginalY: number;\n private _dragging: boolean;\n private _pointerTracking = false;\n\n private _pointerDownEventListener = (ev: PointerEvent) => this.onPointerDown(ev);\n private _pointerMoveEventListener = (ev: PointerEvent) => this.onPointerMove(ev);\n private _pointerUpEventListener = (ev: PointerEvent) => this.onPointerUp(ev);\n\n constructor(private _eElement: HTMLElement, extraAllowableChildTargets: HTMLElement[]) {\n super();\n\n this._timeout = undefined;\n\n this._allowableTargets = [_eElement, ...extraAllowableChildTargets];\n this._oDocument = document;\n this._eBody = document.body;\n\n /**\n * The delay after which to start the drag in milliseconds\n * Do NOT make too short (previous value of 200 was not long enough for my touchpad)\n * Should generally rely on the mouse move to start drag. Not this delay.\n */\n this._nDelay = 1800;\n\n /**\n * The distance the mouse needs to be moved to qualify as a drag\n * Previous comment: works better with delay only\n * ???\n * Probably somehow needs tuning for different devices\n */\n this._nDistance = 10;\n\n this._nX = 0;\n this._nY = 0;\n\n this._nOriginalX = 0;\n this._nOriginalY = 0;\n\n this._dragging = false;\n\n this._eElement.addEventListener('pointerdown', this._pointerDownEventListener, { passive: true });\n }\n\n destroy(): void {\n this.checkRemovePointerTrackingEventListeners();\n\n this._eElement.removeEventListener('pointerdown', this._pointerDownEventListener);\n }\n\n cancelDrag(): void {\n this.processDragStop(undefined);\n }\n\n private onPointerDown(oEvent: PointerEvent) {\n if (this._allowableTargets.includes(oEvent.target as HTMLElement) && oEvent.isPrimary) {\n const coordinates = this.getPointerCoordinates(oEvent);\n this.processPointerDown(coordinates);\n }\n }\n\n private processPointerDown(coordinates: DragListener.PointerCoordinates) {\n this._nOriginalX = coordinates.x;\n this._nOriginalY = coordinates.y;\n\n this._oDocument.addEventListener('pointermove', this._pointerMoveEventListener);\n this._oDocument.addEventListener('pointerup', this._pointerUpEventListener, { passive: true });\n this._pointerTracking = true;\n\n this._timeout = setTimeout(\n () => {\n try {\n this.startDrag()\n }\n catch (err) {\n console.error(err);\n throw err;\n }\n }\n , this._nDelay);\n }\n\n private onPointerMove(oEvent: PointerEvent) {\n if (this._pointerTracking) {\n this.processDragMove(oEvent);\n oEvent.preventDefault();\n }\n }\n\n private processDragMove(dragEvent: PointerEvent) {\n this._nX = dragEvent.pageX - this._nOriginalX;\n this._nY = dragEvent.pageY - this._nOriginalY;\n\n if (this._dragging === false) {\n if (\n Math.abs(this._nX) > this._nDistance ||\n Math.abs(this._nY) > this._nDistance\n ) {\n this.startDrag();\n }\n }\n\n if (this._dragging) {\n this.emit('drag', this._nX, this._nY, dragEvent);\n }\n }\n\n private onPointerUp(oEvent: PointerEvent) {\n this.processDragStop(oEvent);\n }\n\n private processDragStop(dragEvent?: PointerEvent) {\n if (this._timeout !== undefined) {\n clearTimeout(this._timeout);\n this._timeout = undefined;\n }\n\n this.checkRemovePointerTrackingEventListeners();\n \n if (this._dragging === true) {\n this._eBody.classList.remove(DomConstants.ClassName.Dragging);\n this._eElement.classList.remove(DomConstants.ClassName.Dragging);\n this._oDocument.querySelector('iframe')?.style.setProperty('pointer-events', '');\n this._dragging = false;\n this.emit('dragStop', dragEvent);\n }\n }\n\n private checkRemovePointerTrackingEventListeners(): void {\n if (this._pointerTracking) {\n this._oDocument.removeEventListener('pointermove', this._pointerMoveEventListener);\n this._oDocument.removeEventListener('pointerup', this._pointerUpEventListener);\n this._pointerTracking = false;\n } \n }\n\n private startDrag() {\n if (this._timeout !== undefined) {\n clearTimeout(this._timeout);\n this._timeout = undefined;\n }\n this._dragging = true;\n this._eBody.classList.add(DomConstants.ClassName.Dragging);\n this._eElement.classList.add(DomConstants.ClassName.Dragging);\n this._oDocument.querySelector('iframe')?.style.setProperty('pointer-events', 'none');\n this.emit('dragStart', this._nOriginalX, this._nOriginalY);\n }\n\n private getPointerCoordinates(event: PointerEvent) {\n const result: DragListener.PointerCoordinates = {\n x: event.pageX,\n y: event.pageY\n };\n return result;\n }\n\n}\n\n/** @internal */\nexport namespace DragListener {\n export interface PointerCoordinates {\n x: number,\n y: number,\n }\n}","import { UnexpectedUndefinedError } from '../errors/internal-error';\nimport { ComponentItem } from '../items/component-item';\nimport { LayoutManager } from '../layout-manager';\nimport { DomConstants } from '../utils/dom-constants';\nimport { DragListener } from '../utils/drag-listener';\n\n/**\n * Represents an individual tab within a Stack's header\n * @public\n */\nexport class Tab {\n /** @internal */\n private readonly _element: HTMLDivElement;\n /** @internal */\n private readonly _titleElement: HTMLSpanElement;\n /** @internal */\n private readonly _closeElement: HTMLDivElement | undefined;\n\n /** @internal */\n private _dragListener: DragListener | undefined;\n /** @internal */\n private _isActive = false;\n\n /** @internal */\n private readonly _tabClickListener = (ev: MouseEvent) => this.onTabClickDown(ev);\n /** @internal */\n private readonly _tabTouchStartListener = (ev: TouchEvent) => this.onTabTouchStart(ev);\n /** @internal */\n private readonly _closeClickListener = () => this.onCloseClick();\n /** @internal */\n private readonly _closeTouchStartListener = () => this.onCloseTouchStart();\n // /** @internal */\n // private readonly _closeMouseDownListener = () => this.onCloseMousedown();\n /** @internal */\n private readonly _dragStartListener = (x: number, y: number) => this.onDragStart(x, y);\n /** @internal */\n private readonly _contentItemDestroyListener = () => this.onContentItemDestroy();\n /** @internal */\n private readonly _tabTitleChangedListener = (title: string) => this.setTitle(title)\n\n get isActive(): boolean { return this._isActive; }\n // get header(): Header { return this._header; }\n get componentItem(): ComponentItem { return this._componentItem; }\n /** @deprecated use {@link (Tab:class).componentItem} */\n get contentItem(): ComponentItem { return this._componentItem; }\n get element(): HTMLElement { return this._element; }\n get titleElement(): HTMLElement { return this._titleElement; }\n get closeElement(): HTMLElement | undefined { return this._closeElement; }\n get reorderEnabled(): boolean { return this._dragListener !== undefined; }\n set reorderEnabled(value: boolean) {\n if (value !== this.reorderEnabled) {\n if (value) {\n this.enableReorder();\n } else {\n this.disableReorder();\n }\n }\n }\n\n /** @internal */\n constructor(\n /** @internal */\n private readonly _layoutManager: LayoutManager,\n /** @internal */\n private _componentItem: ComponentItem,\n /** @internal */\n private _closeEvent: Tab.CloseEvent | undefined,\n /** @internal */\n private _focusEvent: Tab.FocusEvent | undefined,\n /** @internal */\n private _dragStartEvent: Tab.DragStartEvent | undefined\n ) {\n this._element = document.createElement('div');\n this._element.classList.add(DomConstants.ClassName.Tab);\n this._titleElement = document.createElement('span'); \n this._titleElement.classList.add(DomConstants.ClassName.Title);\n this._closeElement = document.createElement('div'); \n this._closeElement.classList.add(DomConstants.ClassName.CloseTab);\n this._element.appendChild(this._titleElement);\n this._element.appendChild(this._closeElement);\n\n if (_componentItem.isClosable) {\n this._closeElement.style.display = '';\n } else {\n this._closeElement.style.display = 'none';\n }\n\n this.setTitle(_componentItem.title);\n this._componentItem.on('titleChanged', this._tabTitleChangedListener);\n\n const reorderEnabled = _componentItem.reorderEnabled ?? this._layoutManager.layoutConfig.settings.reorderEnabled;\n\n if (reorderEnabled) {\n this.enableReorder();\n }\n\n this._element.addEventListener('click', this._tabClickListener, { passive: true });\n this._element.addEventListener('touchstart', this._tabTouchStartListener, { passive: true });\n\n if (this._componentItem.isClosable) {\n this._closeElement.addEventListener('click', this._closeClickListener, { passive: true });\n this._closeElement.addEventListener('touchstart', this._closeTouchStartListener, { passive: true });\n // this._closeElement.addEventListener('mousedown', this._closeMouseDownListener, { passive: true });\n } else {\n this._closeElement.remove();\n this._closeElement = undefined;\n }\n\n this._componentItem.setTab(this);\n this._layoutManager.emit('tabCreated', this);\n }\n\n /**\n * Sets the tab's title to the provided string and sets\n * its title attribute to a pure text representation (without\n * html tags) of the same string.\n */\n setTitle(title: string): void {\n this._titleElement.innerText = title;\n this._element.title = title;\n }\n\n /**\n * Sets this tab's active state. To programmatically\n * switch tabs, use Stack.setActiveComponentItem( item ) instead.\n */\n setActive(isActive: boolean): void {\n if (isActive === this._isActive) {\n return;\n }\n this._isActive = isActive;\n\n if (isActive) {\n this._element.classList.add(DomConstants.ClassName.Active);\n } else {\n this._element.classList.remove(DomConstants.ClassName.Active);\n }\n }\n\n /**\n * Destroys the tab\n * @internal\n */\n destroy(): void {\n this._closeEvent = undefined;\n this._focusEvent = undefined;\n this._dragStartEvent = undefined;\n this._element.removeEventListener('click', this._tabClickListener);\n this._element.removeEventListener('touchstart', this._tabTouchStartListener);\n this._closeElement?.removeEventListener('click', this._closeClickListener);\n this._closeElement?.removeEventListener('touchstart', this._closeTouchStartListener);\n // this._closeElement?.removeEventListener('mousedown', this._closeMouseDownListener);\n this._componentItem.off('titleChanged', this._tabTitleChangedListener);\n if (this.reorderEnabled) {\n this.disableReorder();\n }\n this._element.remove();\n }\n\n /** @internal */\n setBlurred(): void {\n this._element.classList.remove(DomConstants.ClassName.Focused);\n this._titleElement.classList.remove(DomConstants.ClassName.Focused);\n }\n\n /** @internal */\n setFocused(): void {\n this._element.classList.add(DomConstants.ClassName.Focused);\n this._titleElement.classList.add(DomConstants.ClassName.Focused);\n }\n\n /**\n * Callback for the DragListener\n * @param x - The tabs absolute x position\n * @param y - The tabs absolute y position\n * @internal\n */\n private onDragStart(x: number, y: number): void {\n if (this._dragListener === undefined) {\n throw new UnexpectedUndefinedError('TODSDLU10093');\n } else {\n if (this._dragStartEvent === undefined) {\n throw new UnexpectedUndefinedError('TODS23309');\n } else {\n this._dragStartEvent(x, y, this._dragListener, this.componentItem);\n }\n }\n\n }\n\n /** @internal */\n private onContentItemDestroy() {\n if (this._dragListener !== undefined) {\n this._dragListener.destroy();\n this._dragListener = undefined;\n }\n }\n\n /**\n * Callback when the tab is clicked\n * @internal\n */\n private onTabClickDown(event: MouseEvent) {\n const target = event.target;\n if (target === this._element || target === this._titleElement) {\n // left mouse button\n if (event.button === 0) {\n // event.stopPropagation();\n this.notifyFocus();\n\n // middle mouse button\n } else if (event.button === 1 && this._componentItem.isClosable) {\n // event.stopPropagation();\n this.notifyClose();\n }\n }\n }\n\n /** @internal */\n private onTabTouchStart(event: TouchEvent) {\n if (event.target === this._element) {\n this.notifyFocus();\n }\n }\n\n /**\n * Callback when the tab's close button is clicked\n * @internal\n */\n private onCloseClick() {\n this.notifyClose();\n }\n\n /** @internal */\n private onCloseTouchStart() {\n this.notifyClose();\n }\n\n /**\n * Callback to capture tab close button mousedown\n * to prevent tab from activating.\n * @internal\n */\n // private onCloseMousedown(): void {\n // // event.stopPropagation();\n // }\n\n /** @internal */\n private notifyClose() {\n if (this._closeEvent === undefined) {\n throw new UnexpectedUndefinedError('TNC15007');\n } else {\n this._closeEvent(this._componentItem);\n }\n }\n\n /** @internal */\n private notifyFocus() {\n if (this._focusEvent === undefined) {\n throw new UnexpectedUndefinedError('TNA15007');\n } else {\n this._focusEvent(this._componentItem);\n }\n }\n\n /** @internal */\n private enableReorder() {\n this._dragListener = new DragListener(this._element, [this._titleElement]);\n this._dragListener.on('dragStart', this._dragStartListener);\n this._componentItem.on('destroy', this._contentItemDestroyListener);\n }\n\n /** @internal */\n private disableReorder() {\n if (this._dragListener === undefined) {\n throw new UnexpectedUndefinedError('TDR87745');\n } else {\n this._componentItem.off('destroy', this._contentItemDestroyListener);\n this._dragListener.off('dragStart', this._dragStartListener);\n this._dragListener = undefined;\n }\n }\n}\n\n/** @public */\nexport namespace Tab {\n /** @internal */\n export type CloseEvent = (componentItem: ComponentItem) => void;\n /** @internal */\n export type FocusEvent = (componentItem: ComponentItem) => void;\n /** @internal */\n export type DragStartEvent = (x: number, y: number, dragListener: DragListener, componentItem: ComponentItem) => void;\n}\n","import { AssertError } from '../errors/internal-error';\nimport { ComponentItem } from '../items/component-item';\nimport { LayoutManager } from '../layout-manager';\nimport { DomConstants } from '../utils/dom-constants';\nimport { DragListener } from '../utils/drag-listener';\nimport { numberToPixels, pixelsToNumber } from '../utils/utils';\nimport { Tab } from './tab';\n\n/** @internal */\nexport class TabsContainer {\n // There is one tab per ComponentItem in stack. However they may not be ordered the same\n private readonly _tabs: Tab[] = [];\n\n private readonly _dropdownElement: HTMLElement;\n private readonly _element: HTMLElement;\n private _lastVisibleTabIndex = -1;\n private _dropdownActive = false;\n\n get tabs(): Tab[] { return this._tabs; }\n get tabCount(): number { return this._tabs.length; }\n get lastVisibleTabIndex(): number { return this._lastVisibleTabIndex; }\n\n get element(): HTMLElement { return this._element; }\n get dropdownElement(): HTMLElement { return this._dropdownElement; }\n get dropdownActive(): boolean { return this._dropdownActive; }\n\n constructor(private _layoutManager: LayoutManager,\n private _componentRemoveEvent: TabsContainer.ComponentItemRemoveEvent,\n private _componentFocusEvent: TabsContainer.ComponentItemFocusEvent,\n private _componentDragStartEvent: TabsContainer.ComponentItemDragStartEvent,\n private _dropdownActiveChangedEvent: TabsContainer.DropdownActiveChangedEvent,\n ) {\n this._element = document.createElement('section');\n this._element.classList.add(DomConstants.ClassName.Tabs);\n\n this._dropdownElement = document.createElement('section');\n this._dropdownElement.classList.add(DomConstants.ClassName.TabDropdownList);\n this._dropdownElement.style.display = 'none';\n }\n\n destroy(): void {\n for (let i = 0; i < this._tabs.length; i++) {\n this._tabs[i].destroy();\n }\n }\n\n /**\n * Creates a new tab and associates it with a contentItem\n * @param index - The position of the tab\n */\n createTab(componentItem: ComponentItem, index: number): void {\n //If there's already a tab relating to the\n //content item, don't do anything\n for (let i = 0; i < this._tabs.length; i++) {\n if (this._tabs[i].componentItem === componentItem) {\n return;\n }\n }\n\n const tab = new Tab(this._layoutManager,\n componentItem,\n (item) => this.handleTabCloseEvent(item),\n (item) => this.handleTabFocusEvent(item),\n (x, y, dragListener, item) => this.handleTabDragStartEvent(x, y, dragListener, item));\n\n if (index === undefined) {\n index = this._tabs.length;\n }\n\n this._tabs.splice(index, 0, tab);\n\n if (index < this._element.childNodes.length) {\n this._element.insertBefore(tab.element, this._element.childNodes[index]);\n } else {\n this._element.appendChild(tab.element);\n }\n }\n\n removeTab(componentItem: ComponentItem): void {\n // componentItem cannot be ActiveComponentItem\n for (let i = 0; i < this._tabs.length; i++) {\n if (this._tabs[i].componentItem === componentItem) {\n const tab = this._tabs[i];\n tab.destroy();\n this._tabs.splice(i, 1);\n return;\n }\n }\n\n throw new Error('contentItem is not controlled by this header');\n }\n\n processActiveComponentChanged(newActiveComponentItem: ComponentItem): void {\n let activeIndex = -1;\n for (let i = 0; i < this._tabs.length; i++) {\n const isActive = this._tabs[i].componentItem === newActiveComponentItem;\n this._tabs[i].setActive(isActive);\n if (isActive) {\n activeIndex = i;\n }\n }\n\n if (activeIndex < 0) {\n throw new AssertError('HSACI56632');\n } else {\n if (this._layoutManager.layoutConfig.settings.reorderOnTabMenuClick) {\n /**\n * If the tab selected was in the dropdown, move everything down one to make way for this one to be the first.\n * This will make sure the most used tabs stay visible.\n */\n if (this._lastVisibleTabIndex !== -1 && activeIndex > this._lastVisibleTabIndex) {\n const activeTab = this._tabs[activeIndex];\n for (let j = activeIndex; j > 0; j--) {\n this._tabs[j] = this._tabs[j - 1];\n }\n this._tabs[0] = activeTab;\n\n // updateTabSizes will always be called after this and it will reposition tab elements\n }\n }\n }\n }\n\n /**\n * Pushes the tabs to the tab dropdown if the available space is not sufficient\n */\n updateTabSizes(availableWidth: number, activeComponentItem: ComponentItem | undefined): void {\n let dropDownActive = false;\n const success = this.tryUpdateTabSizes(dropDownActive, availableWidth, activeComponentItem);\n if (!success) {\n dropDownActive = true;\n // this will always succeed\n this.tryUpdateTabSizes(dropDownActive, availableWidth, activeComponentItem)\n }\n\n if (dropDownActive !== this._dropdownActive) {\n this._dropdownActive = dropDownActive;\n this._dropdownActiveChangedEvent();\n }\n }\n\n tryUpdateTabSizes(dropdownActive: boolean, availableWidth: number, activeComponentItem: ComponentItem | undefined): boolean {\n if (this._tabs.length > 0) {\n if (activeComponentItem === undefined) {\n throw new Error('non-empty tabs must have active component item');\n }\n\n let cumulativeTabWidth = 0;\n let tabOverlapAllowanceExceeded = false;\n const tabOverlapAllowance = this._layoutManager.layoutConfig.settings.tabOverlapAllowance;\n const activeIndex = this._tabs.indexOf(activeComponentItem.tab);\n const activeTab = this._tabs[activeIndex];\n this._lastVisibleTabIndex = -1;\n\n for (let i = 0; i < this._tabs.length; i++) {\n const tabElement = this._tabs[i].element;\n\n //Put the tab in the tabContainer so its true width can be checked\n if (tabElement.parentElement !== this._element) {\n this._element.appendChild(tabElement);\n }\n const tabMarginRightPixels = getComputedStyle(activeTab.element).marginRight;\n const tabMarginRight = pixelsToNumber(tabMarginRightPixels);\n const tabWidth = tabElement.offsetWidth + tabMarginRight;\n\n cumulativeTabWidth += tabWidth;\n\n //Include the active tab's width if it isn't already\n //This is to ensure there is room to show the active tab\n let visibleTabWidth = 0;\n if (activeIndex <= i) {\n visibleTabWidth = cumulativeTabWidth;\n } else {\n const activeTabMarginRightPixels = getComputedStyle(activeTab.element).marginRight;\n const activeTabMarginRight = pixelsToNumber(activeTabMarginRightPixels);\n visibleTabWidth = cumulativeTabWidth + activeTab.element.offsetWidth + activeTabMarginRight;\n }\n\n // If the tabs won't fit, check the overlap allowance.\n if (visibleTabWidth > availableWidth) {\n\n //Once allowance is exceeded, all remaining tabs go to menu.\n if (!tabOverlapAllowanceExceeded) {\n\n //No overlap for first tab or active tab\n //Overlap spreads among non-active, non-first tabs\n let overlap: number;\n if (activeIndex > 0 && activeIndex <= i) {\n overlap = (visibleTabWidth - availableWidth) / (i - 1);\n } else {\n overlap = (visibleTabWidth - availableWidth) / i;\n }\n\n //Check overlap against allowance.\n if (overlap < tabOverlapAllowance) {\n for (let j = 0; j <= i; j++) {\n const marginLeft = (j !== activeIndex && j !== 0) ? '-' + numberToPixels(overlap) : '';\n this._tabs[j].element.style.zIndex = numberToPixels(i - j);\n this._tabs[j].element.style.marginLeft = marginLeft;\n }\n this._lastVisibleTabIndex = i;\n if (tabElement.parentElement !== this._element) {\n this._element.appendChild(tabElement);\n }\n } else {\n tabOverlapAllowanceExceeded = true;\n }\n\n } else if (i === activeIndex) {\n //Active tab should show even if allowance exceeded. (We left room.)\n tabElement.style.zIndex = 'auto';\n tabElement.style.marginLeft = '';\n if (tabElement.parentElement !== this._element) {\n this._element.appendChild(tabElement);\n }\n }\n\n if (tabOverlapAllowanceExceeded && i !== activeIndex) {\n if (dropdownActive) {\n //Tab menu already shown, so we just add to it.\n tabElement.style.zIndex = 'auto';\n tabElement.style.marginLeft = '';\n\n if (tabElement.parentElement !== this._dropdownElement) {\n this._dropdownElement.appendChild(tabElement);\n }\n } else {\n //We now know the tab menu must be shown, so we have to recalculate everything.\n return false;\n }\n }\n\n } else {\n this._lastVisibleTabIndex = i;\n tabElement.style.zIndex = 'auto';\n tabElement.style.marginLeft = '';\n if (tabElement.parentElement !== this._element) {\n this._element.appendChild(tabElement);\n }\n }\n }\n }\n\n return true;\n }\n\n /**\n * Shows drop down for additional tabs when there are too many to display.\n */\n showAdditionalTabsDropdown(): void {\n this._dropdownElement.style.display = '';\n }\n\n /**\n * Hides drop down for additional tabs when there are too many to display.\n */\n hideAdditionalTabsDropdown(): void {\n this._dropdownElement.style.display = 'none';\n }\n\n private handleTabCloseEvent(componentItem: ComponentItem) {\n this._componentRemoveEvent(componentItem);\n }\n\n private handleTabFocusEvent(componentItem: ComponentItem) {\n this._componentFocusEvent(componentItem);\n }\n\n private handleTabDragStartEvent(x: number, y: number, dragListener: DragListener, componentItem: ComponentItem) {\n this._componentDragStartEvent(x, y, dragListener, componentItem);\n }\n\n}\n\n/** @internal */\nexport namespace TabsContainer {\n export type ComponentItemRemoveEvent = (this: void, componentItem: ComponentItem) => void;\n export type ComponentItemFocusEvent = (this: void, componentItem: ComponentItem) => void;\n export type ComponentItemDragStartEvent = (this: void, x: number, y: number, dragListener: DragListener, componentItem: ComponentItem) => void;\n export type DropdownActiveChangedEvent = (this: void) => void;\n}\n","import { UnexpectedUndefinedError } from '../errors/internal-error';\nimport { ComponentItem } from '../items/component-item';\nimport { Stack } from '../items/stack';\nimport { LayoutManager } from '../layout-manager';\nimport { DomConstants } from '../utils/dom-constants';\nimport { DragListener } from '../utils/drag-listener';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { Side } from '../utils/types';\nimport { numberToPixels, setElementDisplayVisibility } from '../utils/utils';\nimport { HeaderButton } from './header-button';\nimport { Tab } from './tab';\nimport { TabsContainer } from './tabs-container';\n\n/**\n * This class represents a header above a Stack ContentItem.\n * @public\n */\nexport class Header extends EventEmitter {\n /** @internal */\n private readonly _tabsContainer: TabsContainer;\n /** @internal */\n private readonly _element: HTMLElement;\n /** @internal */\n private readonly _controlsContainerElement: HTMLElement;\n\n /** @internal */\n private readonly _show: boolean;\n /** @internal */\n private readonly _popoutEnabled: boolean;\n /** @internal */\n private readonly _popoutLabel: string;\n /** @internal */\n private readonly _maximiseEnabled: boolean;\n /** @internal */\n private readonly _maximiseLabel: string;\n /** @internal */\n private readonly _minimiseEnabled: boolean;\n /** @internal */\n private readonly _minimiseLabel: string;\n /** @internal */\n private readonly _closeEnabled: boolean;\n /** @internal */\n private readonly _closeLabel: string;\n /** @internal */\n private readonly _tabDropdownEnabled: boolean;\n /** @internal */\n private readonly _tabDropdownLabel: string;\n\n /** @internal */\n private readonly _tabControlOffset: number;\n\n /** @internal */\n private readonly _clickListener = (ev: MouseEvent) => this.onClick(ev);\n /** @internal */\n private readonly _touchStartListener = (ev: TouchEvent) => this.onTouchStart(ev);\n /** @internal */\n private readonly _documentMouseUpListener: (this: void) => void;\n\n /** @internal */\n private _rowColumnClosable = true;\n /** @internal */\n private _canRemoveComponent: boolean;\n /** @internal */\n private _side: Side;\n /** @internal */\n private _leftRightSided: boolean;\n /** @internal */\n private readonly _closeButton: HeaderButton | null = null;\n /** @internal */\n private readonly _popoutButton: HeaderButton | null = null;\n /** @internal */\n private readonly _tabDropdownButton: HeaderButton;\n /** @internal */\n private readonly _maximiseButton: HeaderButton | undefined;\n // /** @internal */\n // private _activeComponentItem: ComponentItem | null = null; // only used to identify active tab\n\n get show(): boolean { return this._show; }\n get side(): Side { return this._side; }\n get leftRightSided(): boolean { return this._leftRightSided; }\n\n get layoutManager(): LayoutManager { return this._layoutManager; }\n get parent(): Stack { return this._parent; }\n get tabs(): Tab[] { return this._tabsContainer.tabs; }\n get lastVisibleTabIndex(): number { return this._tabsContainer.lastVisibleTabIndex; }\n\n get element(): HTMLElement { return this._element; }\n get tabsContainerElement(): HTMLElement { return this._tabsContainer.element; }\n get controlsContainerElement(): HTMLElement { return this._controlsContainerElement; }\n\n /** @internal */\n constructor(\n /** @internal */\n private _layoutManager: LayoutManager,\n /** @internal */\n private _parent: Stack,\n settings: Header.Settings,\n /** @internal */\n private readonly _configClosable: boolean,\n /** @internal */\n private _getActiveComponentItemEvent: Header.GetActiveComponentItemEvent,\n closeEvent: Header.CloseEvent,\n /** @internal */\n private _popoutEvent: Header.PopoutEvent | undefined,\n /** @internal */\n private _maximiseToggleEvent: Header.MaximiseToggleEvent | undefined,\n /** @internal */\n private _clickEvent: Header.ClickEvent | undefined,\n /** @internal */\n private _touchStartEvent: Header.TouchStartEvent | undefined,\n /** @internal */\n private _componentRemoveEvent: Header.ComponentRemoveEvent | undefined,\n /** @internal */\n private _componentFocusEvent: Header.ComponentFocusEvent | undefined,\n /** @internal */\n private _componentDragStartEvent: Header.ComponentDragStartEvent | undefined,\n ) {\n super();\n\n this._tabsContainer = new TabsContainer(this._layoutManager,\n (item) => this.handleTabInitiatedComponentRemoveEvent(item),\n (item) => this.handleTabInitiatedComponentFocusEvent(item),\n (x, y, dragListener, item) => this.handleTabInitiatedDragStartEvent(x, y, dragListener, item),\n () => this.processTabDropdownActiveChanged(),\n );\n\n this._show = settings.show;\n this._popoutEnabled = settings.popoutEnabled;\n this._popoutLabel = settings.popoutLabel;\n this._maximiseEnabled = settings.maximiseEnabled;\n this._maximiseLabel = settings.maximiseLabel;\n this._minimiseEnabled = settings.minimiseEnabled;\n this._minimiseLabel = settings.minimiseLabel;\n this._closeEnabled = settings.closeEnabled;\n this._closeLabel = settings.closeLabel;\n this._tabDropdownEnabled = settings.tabDropdownEnabled;\n this._tabDropdownLabel = settings.tabDropdownLabel;\n this.setSide(settings.side);\n\n this._canRemoveComponent = this._configClosable;\n\n this._element = document.createElement('section');\n this._element.classList.add(DomConstants.ClassName.Header);\n this._controlsContainerElement = document.createElement('section');\n this._controlsContainerElement.classList.add(DomConstants.ClassName.Controls);\n this._element.appendChild(this._tabsContainer.element);\n this._element.appendChild(this._controlsContainerElement);\n this._element.appendChild(this._tabsContainer.dropdownElement);\n\n this._element.addEventListener('click', this._clickListener, { passive: true });\n this._element.addEventListener('touchstart', this._touchStartListener, { passive: true });\n\n this._documentMouseUpListener = () => this._tabsContainer.hideAdditionalTabsDropdown()\n globalThis.document.addEventListener('mouseup', this._documentMouseUpListener, { passive: true });\n\n this._tabControlOffset = this._layoutManager.layoutConfig.settings.tabControlOffset;\n\n if (this._tabDropdownEnabled) {\n this._tabDropdownButton = new HeaderButton(this, this._tabDropdownLabel, DomConstants.ClassName.TabDropdown,\n () => this._tabsContainer.showAdditionalTabsDropdown()\n );\n }\n\n if (this._popoutEnabled) {\n this._popoutButton = new HeaderButton(this, this._popoutLabel, DomConstants.ClassName.Popout, () => this.handleButtonPopoutEvent());\n }\n\n /**\n * Maximise control - set the component to the full size of the layout\n */\n if (this._maximiseEnabled) {\n this._maximiseButton = new HeaderButton(this, this._maximiseLabel, DomConstants.ClassName.Maximise,\n (ev) => this.handleButtonMaximiseToggleEvent(ev)\n );\n }\n\n /**\n * Close button\n */\n if (this._configClosable) {\n this._closeButton = new HeaderButton(this, this._closeLabel, DomConstants.ClassName.Close, () => closeEvent());\n }\n\n this.processTabDropdownActiveChanged();\n }\n\n /**\n * Destroys the entire header\n * @internal\n */\n destroy(): void {\n this.emit('destroy');\n\n this._popoutEvent = undefined;\n this._maximiseToggleEvent = undefined;\n this._clickEvent = undefined;\n this._touchStartEvent = undefined;\n this._componentRemoveEvent = undefined;\n this._componentFocusEvent = undefined;\n this._componentDragStartEvent = undefined;\n\n this._tabsContainer.destroy();\n\n globalThis.document.removeEventListener('mouseup', this._documentMouseUpListener);\n this._element.remove();\n }\n\n /**\n * Creates a new tab and associates it with a contentItem\n * @param index - The position of the tab\n * @internal\n */\n createTab(componentItem: ComponentItem, index: number): void {\n this._tabsContainer.createTab(componentItem, index);\n }\n\n /**\n * Finds a tab based on the contentItem its associated with and removes it.\n * Cannot remove tab if it has the active ComponentItem\n * @internal\n */\n removeTab(componentItem: ComponentItem): void {\n this._tabsContainer.removeTab(componentItem);\n }\n\n /** @internal */\n processActiveComponentChanged(newActiveComponentItem: ComponentItem): void {\n this._tabsContainer.processActiveComponentChanged(newActiveComponentItem);\n this.updateTabSizes();\n }\n\n /** @internal */\n setSide(value: Side): void {\n this._side = value;\n this._leftRightSided = [Side.right, Side.left].includes(this._side);\n }\n\n /**\n * Programmatically set closability.\n * @param value - Whether to enable/disable closability.\n * @returns Whether the action was successful\n * @internal\n */\n setRowColumnClosable(value: boolean): void {\n this._rowColumnClosable = value;\n this.updateClosability();\n }\n\n /**\n * Updates the header's closability. If a stack/header is able\n * to close, but has a non closable component added to it, the stack is no\n * longer closable until all components are closable.\n * @internal\n */\n updateClosability(): void {\n let isClosable: boolean;\n if (!this._configClosable) {\n isClosable = false;\n } else {\n if (!this._rowColumnClosable) {\n isClosable = false;\n } else {\n isClosable = true;\n const len = this.tabs.length;\n for (let i = 0; i < len; i++) {\n const tab = this._tabsContainer.tabs[i];\n const item = tab.componentItem;\n if (!item.isClosable) {\n isClosable = false;\n break;\n }\n }\n }\n }\n\n if (this._closeButton !== null) {\n setElementDisplayVisibility(this._closeButton.element, isClosable);\n }\n if (this._popoutButton !== null) {\n setElementDisplayVisibility(this._popoutButton.element, isClosable);\n }\n\n this._canRemoveComponent = isClosable || this._tabsContainer.tabCount > 1;\n }\n\n /** @internal */\n applyFocusedValue(value: boolean): void {\n if (value) {\n this._element.classList.add(DomConstants.ClassName.Focused);\n } else {\n this._element.classList.remove(DomConstants.ClassName.Focused);\n }\n }\n\n /** @internal */\n processMaximised(): void {\n if (this._maximiseButton === undefined) {\n throw new UnexpectedUndefinedError('HPMAX16997');\n } else {\n this._maximiseButton.element.setAttribute('title', this._minimiseLabel);\n }\n }\n\n /** @internal */\n processMinimised(): void {\n if (this._maximiseButton === undefined) {\n throw new UnexpectedUndefinedError('HPMIN16997');\n } else {\n this._maximiseButton.element.setAttribute('title', this._maximiseLabel);\n }\n }\n\n /**\n * Pushes the tabs to the tab dropdown if the available space is not sufficient\n * @internal\n */\n updateTabSizes(): void {\n if (this._tabsContainer.tabCount > 0) {\n const headerHeight = this._show ? this._layoutManager.layoutConfig.dimensions.headerHeight : 0;\n\n if (this._leftRightSided) {\n this._element.style.height = '';\n this._element.style.width = numberToPixels(headerHeight);\n } else {\n this._element.style.width = '';\n this._element.style.height = numberToPixels(headerHeight);\n }\n let availableWidth: number;\n if (this._leftRightSided) {\n availableWidth = this._element.offsetHeight - this._controlsContainerElement.offsetHeight - this._tabControlOffset;\n } else {\n availableWidth = this._element.offsetWidth - this._controlsContainerElement.offsetWidth - this._tabControlOffset;\n }\n\n this._tabsContainer.updateTabSizes(availableWidth, this._getActiveComponentItemEvent());\n }\n }\n\n /** @internal */\n private handleTabInitiatedComponentRemoveEvent(componentItem: ComponentItem) {\n if (this._canRemoveComponent) {\n if (this._componentRemoveEvent === undefined) {\n throw new UnexpectedUndefinedError('HHTCE22294');\n } else {\n this._componentRemoveEvent(componentItem);\n }\n }\n }\n\n /** @internal */\n private handleTabInitiatedComponentFocusEvent(componentItem: ComponentItem) {\n if (this._componentFocusEvent === undefined) {\n throw new UnexpectedUndefinedError('HHTAE22294');\n } else {\n this._componentFocusEvent(componentItem);\n }\n }\n\n /** @internal */\n private handleTabInitiatedDragStartEvent(x: number, y: number, dragListener: DragListener, componentItem: ComponentItem) {\n if (!this._canRemoveComponent) {\n dragListener.cancelDrag();\n } else {\n if (this._componentDragStartEvent === undefined) {\n throw new UnexpectedUndefinedError('HHTDSE22294');\n } else {\n this._componentDragStartEvent(x, y, dragListener, componentItem);\n }\n }\n }\n\n /** @internal */\n private processTabDropdownActiveChanged() {\n if (this._tabDropdownButton !== undefined) {\n setElementDisplayVisibility(this._tabDropdownButton.element, this._tabsContainer.dropdownActive);\n }\n }\n\n /** @internal */\n private handleButtonPopoutEvent() {\n if (this._layoutManager.layoutConfig.settings.popoutWholeStack) {\n if (this._popoutEvent === undefined) {\n throw new UnexpectedUndefinedError('HHBPOE17834');\n } else {\n this._popoutEvent();\n }\n } else {\n const activeComponentItem = this._getActiveComponentItemEvent();\n if (activeComponentItem) {\n activeComponentItem.popout();\n }\n // else: if the stack is empty there won't be an active item (and nothing to popout)\n }\n }\n\n /** @internal */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private handleButtonMaximiseToggleEvent(ev: Event) {\n if (this._maximiseToggleEvent === undefined) {\n throw new UnexpectedUndefinedError('HHBMTE16834');\n } else {\n this._maximiseToggleEvent();\n }\n }\n\n /**\n * Invoked when the header's background is clicked (not it's tabs or controls)\n * @internal\n */\n private onClick(event: MouseEvent) {\n if (event.target === this._element) {\n this.notifyClick(event);\n }\n }\n\n /**\n * Invoked when the header's background is touched (not it's tabs or controls)\n * @internal\n */\n private onTouchStart(event: TouchEvent) {\n if (event.target === this._element) {\n this.notifyTouchStart(event);\n }\n }\n\n /** @internal */\n private notifyClick(ev: MouseEvent) {\n if (this._clickEvent === undefined) {\n throw new UnexpectedUndefinedError('HNHC46834');\n } else {\n this._clickEvent(ev);\n }\n }\n\n /** @internal */\n private notifyTouchStart(ev: TouchEvent) {\n if (this._touchStartEvent === undefined) {\n throw new UnexpectedUndefinedError('HNHTS46834');\n } else {\n this._touchStartEvent(ev);\n }\n }\n}\n\n/** @public */\nexport namespace Header {\n /** @internal */\n export type GetActiveComponentItemEvent = (this: void) => ComponentItem | undefined;\n /** @internal */\n export type CloseEvent = (this: void) => void;\n /** @internal */\n export type PopoutEvent = (this: void) => void;\n /** @internal */\n export type MaximiseToggleEvent = (this: void) => void;\n /** @internal */\n export type ClickEvent = (this: void, ev: MouseEvent) => void;\n /** @internal */\n export type TouchStartEvent = (this: void, ev: TouchEvent) => void;\n /** @internal */\n export type ComponentRemoveEvent = (this: void, componentItem: ComponentItem) => void;\n /** @internal */\n export type ComponentFocusEvent = (this: void, componentItem: ComponentItem) => void;\n /** @internal */\n export type ComponentDragStartEvent = (this: void, x: number, y: number, dragListener: DragListener, componentItem: ComponentItem) => void;\n /** @internal */\n export type StateChangedEvent = (this: void) => void;\n\n /** @internal */\n export interface Settings {\n show: boolean;\n side: Side;\n popoutEnabled: boolean;\n popoutLabel: string;\n maximiseEnabled: boolean;\n maximiseLabel: string;\n minimiseEnabled: boolean;\n minimiseLabel: string;\n closeEnabled: boolean;\n closeLabel: string;\n tabDropdownEnabled: boolean;\n tabDropdownLabel: string;\n }\n}\n","import { ComponentItemConfig, ItemConfig } from '../config/config';\nimport { ResolvedComponentItemConfig } from '../config/resolved-config';\nimport { Tab } from '../controls/tab';\nimport { AssertError, UnexpectedNullError } from '../errors/internal-error';\nimport { ComponentItem } from '../items/component-item';\nimport { ContentItem } from '../items/content-item';\nimport { LayoutManager } from '../layout-manager';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { JsonValue, LogicalZIndex, LogicalZIndexToDefaultMap } from '../utils/types';\nimport { deepExtend, setElementHeight, setElementWidth } from '../utils/utils';\n\n/** @public */\nexport class ComponentContainer extends EventEmitter {\n /** @internal */\n private _componentType: JsonValue;\n /** @internal */\n private _boundComponent: ComponentContainer.BindableComponent;\n /** @internal */\n private _width: number;\n /** @internal */\n private _height: number;\n /** @internal */\n private _isClosable;\n /** @internal */\n private _initialState: JsonValue | undefined;\n /** @internal */\n private _state: JsonValue | undefined;\n /** @internal */\n private _visible;\n /** @internal */\n private _isShownWithZeroDimensions;\n /** @internal */\n private _tab: Tab;\n /** @internal */\n private _stackMaximised = false;\n /** @internal */\n private _logicalZIndex: LogicalZIndex;\n\n stateRequestEvent: ComponentContainer.StateRequestEventHandler | undefined;\n virtualRectingRequiredEvent: ComponentContainer.VirtualRectingRequiredEvent | undefined;\n virtualVisibilityChangeRequiredEvent: ComponentContainer.VirtualVisibilityChangeRequiredEvent | undefined;\n virtualZIndexChangeRequiredEvent: ComponentContainer.VirtualZIndexChangeRequiredEvent | undefined;\n\n get width(): number { return this._width; }\n get height(): number { return this._height; }\n get parent(): ComponentItem { return this._parent; }\n /** @internal @deprecated use {@link (ComponentContainer:class).componentType} */\n get componentName(): JsonValue { return this._componentType; }\n get componentType(): JsonValue { return this._componentType; }\n get virtual(): boolean { return this._boundComponent.virtual; }\n get component(): ComponentContainer.Component { return this._boundComponent.component; }\n get tab(): Tab { return this._tab; }\n get title(): string { return this._parent.title; }\n get layoutManager(): LayoutManager { return this._layoutManager; }\n get isHidden(): boolean { return !this._visible; }\n get visible(): boolean { return this._visible; }\n get state(): JsonValue | undefined { return this._state; }\n /** Return the initial component state */\n get initialState(): JsonValue | undefined { return this._initialState; }\n /** The inner DOM element where the container's content is intended to live in */\n get element(): HTMLElement { return this._element; }\n\n /** @internal */\n constructor(\n /** @internal */\n private readonly _config: ResolvedComponentItemConfig,\n /** @internal */\n private readonly _parent: ComponentItem,\n /** @internal */\n private readonly _layoutManager: LayoutManager,\n /** @internal */\n private readonly _element: HTMLElement,\n /** @internal */\n private readonly _updateItemConfigEvent: ComponentContainer.UpdateItemConfigEventHandler,\n /** @internal */\n private readonly _showEvent: ComponentContainer.ShowEventHandler,\n /** @internal */\n private readonly _hideEvent: ComponentContainer.HideEventHandler,\n /** @internal */\n private readonly _focusEvent: ComponentContainer.FocusEventHandler,\n /** @internal */\n private readonly _blurEvent: ComponentContainer.BlurEventHandler,\n ) {\n super();\n\n this._width = 0;\n this._height = 0;\n this._visible = true;\n this._isShownWithZeroDimensions = true;\n\n this._componentType = _config.componentType;\n this._isClosable = _config.isClosable;\n this._initialState = _config.componentState;\n this._state = this._initialState;\n\n this._boundComponent = this.layoutManager.bindComponent(this, _config);\n\n this.updateElementPositionPropertyFromBoundComponent();\n }\n\n /** @internal */\n destroy(): void {\n this.releaseComponent();\n this.stateRequestEvent = undefined;\n this.emit('destroy');\n }\n\n /** @deprecated use {@link (ComponentContainer:class).element } */\n getElement(): HTMLElement {\n return this._element;\n }\n\n /**\n * Hides the container's component item (and hence, the container) if not already hidden.\n * Emits hide event prior to hiding the container.\n */\n hide(): void {\n this._hideEvent();\n }\n\n /**\n * Shows the container's component item (and hence, the container) if not visible.\n * Emits show event prior to hiding the container.\n */\n show(): void {\n this._showEvent();\n }\n\n /**\n * Focus this component in Layout.\n */\n focus(suppressEvent = false): void {\n this._focusEvent(suppressEvent);\n }\n\n /**\n * Remove focus from this component in Layout.\n */\n blur(suppressEvent = false): void {\n this._blurEvent(suppressEvent);\n }\n\n /**\n * Set the size from within the container. Traverses up\n * the item tree until it finds a row or column element\n * and resizes its items accordingly.\n *\n * If this container isn't a descendant of a row or column\n * it returns false\n * @param width - The new width in pixel\n * @param height - The new height in pixel\n *\n * @returns resizeSuccesful\n *\n * @internal\n */\n setSize(width: number, height: number): boolean {\n let ancestorItem: ContentItem | null = this._parent;\n if (ancestorItem.isColumn || ancestorItem.isRow || ancestorItem.parent === null) {\n throw new AssertError('ICSSPRC', 'ComponentContainer cannot have RowColumn Parent');\n } else {\n let ancestorChildItem: ContentItem;\n do {\n ancestorChildItem = ancestorItem;\n ancestorItem = ancestorItem.parent;\n } while (ancestorItem !== null && !ancestorItem.isColumn && !ancestorItem.isRow);\n\n if (ancestorItem === null) {\n // no Row or Column found\n return false;\n } else {\n // ancestorItem is Row or Column\n const direction = ancestorItem.isColumn ? 'height' : 'width';\n const currentSize = this[direction];\n if (currentSize === null) {\n throw new UnexpectedNullError('ICSSCS11194');\n } else {\n const newSize = direction === 'height' ? height : width;\n\n const totalPixel = currentSize * (1 / (ancestorChildItem.size / 100));\n const percentage = (newSize / totalPixel) * 100;\n const delta = (ancestorChildItem.size - percentage) / (ancestorItem.contentItems.length - 1);\n\n for (let i = 0; i < ancestorItem.contentItems.length; i++) {\n const ancestorItemContentItem = ancestorItem.contentItems[i];\n if (ancestorItemContentItem === ancestorChildItem) {\n ancestorItemContentItem.size = percentage;\n } else {\n ancestorItemContentItem.size += delta;\n }\n }\n\n ancestorItem.updateSize(false);\n\n return true;\n }\n }\n }\n }\n\n /**\n * Closes the container if it is closable. Can be called by\n * both the component within at as well as the contentItem containing\n * it. Emits a close event before the container itself is closed.\n */\n close(): void {\n if (this._isClosable) {\n this.emit('close');\n this._parent.close();\n }\n }\n\n /** Replaces component without affecting layout */\n replaceComponent(itemConfig: ComponentItemConfig): void {\n this.releaseComponent();\n\n if (!ItemConfig.isComponent(itemConfig)) {\n throw new Error('ReplaceComponent not passed a component ItemConfig')\n } else {\n const config = ComponentItemConfig.resolve(itemConfig, false);\n this._initialState = config.componentState;\n this._state = this._initialState;\n this._componentType = config.componentType;\n\n this._updateItemConfigEvent(config);\n\n this._boundComponent = this.layoutManager.bindComponent(this, config);\n this.updateElementPositionPropertyFromBoundComponent();\n\n if (this._boundComponent.virtual) {\n if (this.virtualVisibilityChangeRequiredEvent !== undefined) {\n this.virtualVisibilityChangeRequiredEvent(this, this._visible);\n }\n if (this.virtualRectingRequiredEvent !== undefined) {\n this._layoutManager.fireBeforeVirtualRectingEvent(1);\n try {\n this.virtualRectingRequiredEvent(this, this._width, this._height);\n } finally {\n this._layoutManager.fireAfterVirtualRectingEvent();\n }\n }\n this.setBaseLogicalZIndex();\n }\n\n this.emit('stateChanged');\n }\n }\n\n /**\n * Returns the initial component state or the latest passed in setState()\n * @returns state\n * @deprecated Use {@link (ComponentContainer:class).initialState}\n */\n getState(): JsonValue | undefined {\n return this._state;\n }\n\n /**\n * Merges the provided state into the current one\n * @deprecated Use {@link (ComponentContainer:class).stateRequestEvent}\n */\n extendState(state: Record): void {\n const extendedState = deepExtend(this._state as Record, state);\n this.setState(extendedState as JsonValue);\n }\n\n /**\n * Sets the component state\n * @deprecated Use {@link (ComponentContainer:class).stateRequestEvent}\n */\n setState(state: JsonValue): void {\n this._state = state;\n this._parent.emitBaseBubblingEvent('stateChanged');\n }\n\n /**\n * Set's the components title\n */\n setTitle(title: string): void {\n this._parent.setTitle(title);\n }\n\n /** @internal */\n setTab(tab: Tab): void {\n this._tab = tab;\n this.emit('tab', tab)\n }\n\n /** @internal */\n setVisibility(value: boolean): void {\n if (this._boundComponent.virtual) {\n if (this.virtualVisibilityChangeRequiredEvent !== undefined) {\n this.virtualVisibilityChangeRequiredEvent(this, value);\n }\n }\n\n if (value) {\n if (!this._visible) {\n this._visible = true;\n if (this._height === 0 && this._width === 0) {\n this._isShownWithZeroDimensions = true;\n } else {\n this._isShownWithZeroDimensions = false;\n this.setSizeToNodeSize(this._width, this._height, true);\n this.emitShow();\n }\n } else {\n if (this._isShownWithZeroDimensions && (this._height !== 0 || this._width !== 0)) {\n this._isShownWithZeroDimensions = false;\n this.setSizeToNodeSize(this._width, this._height, true);\n this.emitShow();\n }\n }\n } else {\n if (this._visible) {\n this._visible = false;\n this._isShownWithZeroDimensions = false;\n this.emitHide();\n }\n }\n }\n\n setBaseLogicalZIndex(): void {\n this.setLogicalZIndex(LogicalZIndex.base);\n }\n\n setLogicalZIndex(logicalZIndex: LogicalZIndex): void {\n if (logicalZIndex !== this._logicalZIndex) {\n this._logicalZIndex = logicalZIndex;\n\n this.notifyVirtualZIndexChangeRequired();\n }\n }\n\n /**\n * Set the container's size, but considered temporary (for dragging)\n * so don't emit any events.\n * @internal\n */\n enterDragMode(width: number, height: number): void {\n this._width = width;\n this._height = height;\n setElementWidth(this._element, width);\n setElementHeight(this._element, height);\n\n this.setLogicalZIndex(LogicalZIndex.drag);\n\n this.drag();\n }\n\n /** @internal */\n exitDragMode(): void {\n this.setBaseLogicalZIndex();\n }\n\n /** @internal */\n enterStackMaximised(): void {\n this._stackMaximised = true;\n this.setLogicalZIndex(LogicalZIndex.stackMaximised);\n }\n\n /** @internal */\n exitStackMaximised(): void {\n this.setBaseLogicalZIndex();\n this._stackMaximised = false;\n }\n\n /** @internal */\n drag(): void {\n if (this._boundComponent.virtual) {\n if (this.virtualRectingRequiredEvent !== undefined) {\n this._layoutManager.fireBeforeVirtualRectingEvent(1);\n try {\n this.virtualRectingRequiredEvent(this, this._width, this._height);\n } finally {\n this._layoutManager.fireAfterVirtualRectingEvent();\n }\n }\n }\n }\n\n /**\n * Sets the container's size. Called by the container's component item.\n * To instead set the size programmatically from within the component itself,\n * use the public setSize method\n * @param width - in px\n * @param height - in px\n * @param force - set even if no change\n * @internal\n */\n setSizeToNodeSize(width: number, height: number, force: boolean): void {\n if (width !== this._width || height !== this._height || force) {\n this._width = width;\n this._height = height;\n setElementWidth(this._element, width);\n setElementHeight(this._element, height);\n\n if (this._boundComponent.virtual) {\n this.addVirtualSizedContainerToLayoutManager();\n } else {\n this.emit('resize');\n this.checkShownFromZeroDimensions();\n }\n }\n }\n\n /** @internal */\n notifyVirtualRectingRequired(): void {\n if (this.virtualRectingRequiredEvent !== undefined) {\n this.virtualRectingRequiredEvent(this, this._width, this._height);\n this.emit('resize');\n this.checkShownFromZeroDimensions();\n }\n }\n\n /** @internal */\n private notifyVirtualZIndexChangeRequired(): void {\n if (this.virtualZIndexChangeRequiredEvent !== undefined) {\n const logicalZIndex = this._logicalZIndex;\n const defaultZIndex = LogicalZIndexToDefaultMap[logicalZIndex];\n this.virtualZIndexChangeRequiredEvent(this, logicalZIndex, defaultZIndex);\n }\n }\n\n /** @internal */\n private updateElementPositionPropertyFromBoundComponent() {\n if (this._boundComponent.virtual) {\n this._element.style.position = 'static';\n } else {\n this._element.style.position = ''; // set it back to attribute value\n }\n }\n\n /** @internal */\n private addVirtualSizedContainerToLayoutManager() {\n this._layoutManager.beginVirtualSizedContainerAdding();\n try {\n this._layoutManager.addVirtualSizedContainer(this);\n } finally {\n this._layoutManager.endVirtualSizedContainerAdding();\n }\n }\n\n /** @internal */\n private checkShownFromZeroDimensions() {\n if (this._isShownWithZeroDimensions && (this._height !== 0 || this._width !== 0)) {\n this._isShownWithZeroDimensions = false;\n this.emitShow();\n }\n }\n\n /** @internal */\n private emitShow(): void {\n this.emit('shown');\n this.emit('show');\n }\n\n /** @internal */\n private emitHide(): void {\n this.emit('hide');\n }\n\n /** @internal */\n private releaseComponent() {\n if (this._stackMaximised) {\n this.exitStackMaximised();\n }\n this.emit('beforeComponentRelease', this._boundComponent.component);\n this.layoutManager.unbindComponent(this, this._boundComponent.virtual, this._boundComponent.component);\n }\n}\n\n/** @public @deprecated use {@link ComponentContainer} */\nexport type ItemContainer = ComponentContainer;\n\n/** @public */\nexport namespace ComponentContainer {\n export type Component = unknown;\n\n export interface BindableComponent {\n component: Component;\n virtual: boolean;\n }\n\n export type StateRequestEventHandler = (this: void) => JsonValue | undefined;\n export type VirtualRectingRequiredEvent = (this: void, container: ComponentContainer, width: number, height: number) => void;\n export type VirtualVisibilityChangeRequiredEvent = (this: void, container: ComponentContainer, visible: boolean) => void;\n export type VirtualZIndexChangeRequiredEvent =\n (this: void, container: ComponentContainer, logicalZIndex: LogicalZIndex, defaultZIndex: string) => void;\n /** @internal */\n export type ShowEventHandler = (this: void) => void;\n /** @internal */\n export type HideEventHandler = (this: void) => void;\n /** @internal */\n export type FocusEventHandler = (this: void, suppressEvent: boolean) => void;\n /** @internal */\n export type BlurEventHandler = (this: void, suppressEvent: boolean) => void;\n /** @internal */\n export type UpdateItemConfigEventHandler = (itemConfig: ResolvedComponentItemConfig) => void;\n}\n","import { ResolvedItemConfig } from '../config/resolved-config'\nimport { BrowserPopout } from '../controls/browser-popout'\nimport { AssertError, UnexpectedNullError } from '../errors/internal-error'\nimport { LayoutManager } from '../layout-manager'\nimport { EventEmitter } from '../utils/event-emitter'\nimport { AreaLinkedRect, ItemType, SizeUnitEnum } from '../utils/types'\nimport { getUniqueId, setElementDisplayVisibility } from '../utils/utils'\nimport { ComponentItem } from './component-item'\nimport { ComponentParentableItem } from './component-parentable-item'\nimport { Stack } from './stack'\n\n/**\n * This is the baseclass that all content items inherit from.\n * Most methods provide a subset of what the sub-classes do.\n *\n * It also provides a number of functions for tree traversal\n * @public\n */\n\nexport abstract class ContentItem extends EventEmitter {\n /** @internal */\n private _type: ItemType;\n /** @internal */\n private _id: string;\n /** @internal */\n private _popInParentIds: string[] = [];\n /** @internal */\n private _contentItems: ContentItem[];\n /** @internal */\n private _isClosable;\n /** @internal */\n private _pendingEventPropagations: Record;\n /** @internal */\n private _throttledEvents: string[];\n /** @internal */\n private _isInitialised;\n\n /** @internal */\n size: number;\n /** @internal */\n sizeUnit: SizeUnitEnum;\n /** @internal */\n minSize: number | undefined;\n /** @internal */\n minSizeUnit: SizeUnitEnum;\n\n isGround: boolean\n isRow: boolean\n isColumn: boolean\n isStack: boolean\n isComponent: boolean\n\n get type(): ItemType { return this._type; }\n get id(): string { return this._id; }\n set id(value: string) { this._id = value; }\n /** @internal */\n get popInParentIds(): string[] { return this._popInParentIds; }\n get parent(): ContentItem | null { return this._parent; }\n get contentItems(): ContentItem[] { return this._contentItems; }\n get isClosable(): boolean { return this._isClosable; }\n get element(): HTMLElement { return this._element; }\n get isInitialised(): boolean { return this._isInitialised; }\n\n static isStack(item: ContentItem): item is Stack {\n return item.isStack;\n }\n\n static isComponentItem(item: ContentItem): item is ComponentItem {\n return item.isComponent;\n }\n\n static isComponentParentableItem(item: ContentItem): item is ComponentParentableItem {\n return item.isStack || item.isGround;\n }\n\n /** @internal */\n constructor(public readonly layoutManager: LayoutManager,\n config: ResolvedItemConfig,\n /** @internal */\n private _parent: ContentItem | null,\n /** @internal */\n private readonly _element: HTMLElement\n ) {\n super();\n\n this._type = config.type;\n this._id = config.id;\n\n this._isInitialised = false;\n this.isGround = false;\n this.isRow = false;\n this.isColumn = false;\n this.isStack = false;\n this.isComponent = false;\n\n this.size = config.size;\n this.sizeUnit = config.sizeUnit;\n this.minSize = config.minSize;\n this.minSizeUnit = config.minSizeUnit;\n\n this._isClosable = config.isClosable;\n\n this._pendingEventPropagations = {};\n this._throttledEvents = ['stateChanged'];\n\n this._contentItems = this.createContentItems(config.content);\n }\n\n /**\n * Updaters the size of the component and its children, called recursively\n * @param force - In some cases the size is not updated if it has not changed. In this case, events\n * (such as ComponentContainer.virtualRectingRequiredEvent) are not fired. Setting force to true, ensures the size is updated regardless, and\n * the respective events are fired. This is sometimes necessary when a component's size has not changed but it has become visible, and the\n * relevant events need to be fired.\n * @internal\n */\n abstract updateSize(force: boolean): void;\n\n /**\n * Removes a child node (and its children) from the tree\n * @param contentItem - The child item to remove\n * @param keepChild - Whether to destroy the removed item\n */\n removeChild(contentItem: ContentItem, keepChild = false): void {\n /*\n * Get the position of the item that's to be removed within all content items this node contains\n */\n const index = this._contentItems.indexOf(contentItem);\n\n /*\n * Make sure the content item to be removed is actually a child of this item\n */\n if (index === -1) {\n throw new Error('Can\\'t remove child item. Unknown content item');\n }\n\n /**\n\t\t * Call destroy on the content item.\n\t\t * All children are destroyed as well\n\t\t */\n if (!keepChild) {\n\t\t\tthis._contentItems[index].destroy();\n }\n\n /**\n * Remove the content item from this nodes array of children\n */\n this._contentItems.splice(index, 1);\n\n /**\n * If this node still contains other content items, adjust their size\n */\n if (this._contentItems.length > 0) {\n this.updateSize(false);\n } else {\n /**\n * If this was the last content item, remove this node as well\n */\n if (!this.isGround && this._isClosable === true) {\n if (this._parent === null) {\n throw new UnexpectedNullError('CIUC00874');\n } else {\n this._parent.removeChild(this);\n }\n }\n }\n }\n\n /**\n * Sets up the tree structure for the newly added child\n * The responsibility for the actual DOM manipulations lies\n * with the concrete item\n *\n * @param contentItem -\n * @param index - If omitted item will be appended\n * @param suspendResize - Used by descendent implementations\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n addChild(contentItem: ContentItem, index?: number | null, suspendResize?: boolean): number {\n index ??= this._contentItems.length;\n\n this._contentItems.splice(index, 0, contentItem);\n contentItem.setParent(this);\n\n if (this._isInitialised === true && contentItem._isInitialised === false) {\n contentItem.init();\n }\n\n return index;\n }\n\n /**\n * Replaces oldChild with newChild\n * @param oldChild -\n * @param newChild -\n * @internal\n */\n replaceChild(oldChild: ContentItem, newChild: ContentItem, destroyOldChild = false): void {\n // Do not try to replace ComponentItem - will not work\n const index = this._contentItems.indexOf(oldChild);\n const parentNode = oldChild._element.parentNode;\n\n if (index === -1) {\n throw new AssertError('CIRCI23232', 'Can\\'t replace child. oldChild is not child of this');\n }\n\n if (parentNode === null) {\n throw new UnexpectedNullError('CIRCP23232');\n } else {\n parentNode.replaceChild(newChild._element, oldChild._element);\n\n /*\n * Optionally destroy the old content item\n */\n if (destroyOldChild === true) {\n oldChild._parent = null;\n oldChild.destroy(); // will now also destroy all children of oldChild\n }\n\n /*\n * Wire the new contentItem into the tree\n */\n this._contentItems[index] = newChild;\n newChild.setParent(this);\n // newChild inherits the sizes from the old child:\n newChild.size = oldChild.size;\n newChild.sizeUnit = oldChild.sizeUnit;\n newChild.minSize = oldChild.minSize;\n newChild.minSizeUnit = oldChild.minSizeUnit;\n\n //TODO This doesn't update the config... refactor to leave item nodes untouched after creation\n if (newChild._parent === null) {\n throw new UnexpectedNullError('CIRCNC45699');\n } else {\n if (newChild._parent._isInitialised === true && newChild._isInitialised === false) {\n newChild.init();\n }\n\n this.updateSize(false);\n }\n }\n }\n\n /**\n * Convenience method.\n * Shorthand for this.parent.removeChild( this )\n */\n remove(): void {\n if (this._parent === null) {\n throw new UnexpectedNullError('CIR11110');\n } else {\n this._parent.removeChild(this);\n }\n }\n\n /**\n * Removes the component from the layout and creates a new\n * browser window with the component and its children inside\n */\n popout(): BrowserPopout {\n const parentId = getUniqueId();\n const browserPopout = this.layoutManager.createPopoutFromContentItem(this, undefined, parentId, undefined);\n this.emitBaseBubblingEvent('stateChanged');\n return browserPopout;\n }\n\n abstract toConfig(): ResolvedItemConfig;\n\n /** @internal */\n calculateConfigContent(): ResolvedItemConfig[] {\n const contentItems = this._contentItems;\n const count = contentItems.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const item = contentItems[i];\n result[i] = item.toConfig();\n }\n return result;\n }\n\n /** @internal */\n highlightDropZone(x: number, y: number, area: AreaLinkedRect): void {\n const dropTargetIndicator = this.layoutManager.dropTargetIndicator;\n if (dropTargetIndicator === null) {\n throw new UnexpectedNullError('ACIHDZ5593');\n } else {\n dropTargetIndicator.highlightArea(area, 1);\n }\n }\n\n /** @internal */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDrop(contentItem: ContentItem, area: ContentItem.Area): void {\n this.addChild(contentItem);\n }\n\n /** @internal */\n show(): void {\n this.layoutManager.beginSizeInvalidation();\n try {\n // Not sure why showAllActiveContentItems() was called. GoldenLayout seems to work fine without it. Left commented code\n // in source in case a reason for it becomes apparent.\n // this.layoutManager.showAllActiveContentItems();\n setElementDisplayVisibility(this._element, true);\n // this.layoutManager.updateSizeFromContainer();\n\n for (let i = 0; i < this._contentItems.length; i++) {\n this._contentItems[i].show();\n }\n } finally {\n this.layoutManager.endSizeInvalidation();\n }\n }\n\n /**\n * Destroys this item ands its children\n * @internal\n */\n destroy(): void {\n for (let i = 0; i < this._contentItems.length; i++) {\n this._contentItems[i].destroy();\n }\n this._contentItems = [];\n\n this.emitBaseBubblingEvent('beforeItemDestroyed');\n this._element.remove();\n this.emitBaseBubblingEvent('itemDestroyed');\n }\n\n /**\n * Returns the area the component currently occupies\n * @internal\n */\n getElementArea(element?: HTMLElement): ContentItem.Area | null {\n element = element ?? this._element;\n\n const rect = element.getBoundingClientRect();\n const top = rect.top + document.body.scrollTop;\n const left = rect.left + document.body.scrollLeft;\n\n const width = rect.width;\n const height = rect.height;\n\n return {\n x1: left,\n y1: top,\n x2: left + width,\n y2: top + height,\n surface: width * height,\n contentItem: this\n };\n }\n\n /**\n * The tree of content items is created in two steps: First all content items are instantiated,\n * then init is called recursively from top to bottem. This is the basic init function,\n * it can be used, extended or overwritten by the content items\n *\n * Its behaviour depends on the content item\n * @internal\n */\n init(): void {\n this._isInitialised = true;\n this.emitBaseBubblingEvent('itemCreated');\n this.emitUnknownBubblingEvent(this.type + 'Created');\n }\n\n /** @internal */\n protected setParent(parent: ContentItem): void {\n this._parent = parent;\n }\n\n /** @internal */\n addPopInParentId(id: string): void {\n if (!this.popInParentIds.includes(id)) {\n this.popInParentIds.push(id);\n }\n }\n\n /** @internal */\n protected initContentItems(): void {\n for (let i = 0; i < this._contentItems.length; i++) {\n this._contentItems[i].init();\n }\n }\n\n /** @internal */\n protected hide(): void {\n this.layoutManager.beginSizeInvalidation();\n try {\n setElementDisplayVisibility(this._element, false);\n // this.layoutManager.updateSizeFromContainer();\n } finally {\n this.layoutManager.endSizeInvalidation();\n }\n }\n\n /** @internal */\n protected updateContentItemsSize(force: boolean): void {\n for (let i = 0; i < this._contentItems.length; i++) {\n this._contentItems[i].updateSize(force);\n }\n }\n\n /**\n * creates all content items for this node at initialisation time\n * PLEASE NOTE, please see addChild for adding contentItems at runtime\n * @internal\n */\n private createContentItems(content: readonly ResolvedItemConfig[]) {\n const count = content.length;\n const result = new Array(count);\n for (let i = 0; i < content.length; i++) {\n result[i] = this.layoutManager.createContentItem(content[i], this);\n }\n return result;\n }\n\n /**\n * Called for every event on the item tree. Decides whether the event is a bubbling\n * event and propagates it to its parent\n *\n * @param name - The name of the event\n * @param event -\n * @internal\n */\n private propagateEvent(name: string, args: unknown[]) {\n if (args.length === 1) {\n const event = args[0];\n if (event instanceof EventEmitter.BubblingEvent &&\n event.isPropagationStopped === false &&\n this._isInitialised === true) {\n\n /**\n * In some cases (e.g. if an element is created from a DragSource) it\n * doesn't have a parent and is not a child of GroundItem. If that's the case\n * propagate the bubbling event from the top level of the substree directly\n * to the layoutManager\n */\n if (this.isGround === false && this._parent) {\n this._parent.emitUnknown(name, event);\n } else {\n this.scheduleEventPropagationToLayoutManager(name, event);\n }\n }\n }\n }\n\n override tryBubbleEvent(name: string, args: unknown[]): void {\n if (args.length === 1) {\n const event = args[0];\n if (event instanceof EventEmitter.BubblingEvent &&\n event.isPropagationStopped === false &&\n this._isInitialised === true\n ) {\n /**\n * In some cases (e.g. if an element is created from a DragSource) it\n * doesn't have a parent and is not a child of GroundItem. If that's the case\n * propagate the bubbling event from the top level of the substree directly\n * to the layoutManager\n */\n if (this.isGround === false && this._parent) {\n this._parent.emitUnknown(name, event);\n } else {\n this.scheduleEventPropagationToLayoutManager(name, event);\n }\n }\n }\n }\n\n /**\n * All raw events bubble up to the Ground element. Some events that\n * are propagated to - and emitted by - the layoutManager however are\n * only string-based, batched and sanitized to make them more usable\n *\n * @param name - The name of the event\n * @internal\n */\n private scheduleEventPropagationToLayoutManager(name: string, event: EventEmitter.BubblingEvent) {\n if (this._throttledEvents.indexOf(name) === -1) {\n this.layoutManager.emitUnknown(name, event);\n } else {\n if (this._pendingEventPropagations[name] !== true) {\n this._pendingEventPropagations[name] = true;\n globalThis.requestAnimationFrame(() => this.propagateEventToLayoutManager(name, event));\n }\n }\n\n }\n\n /**\n * Callback for events scheduled by _scheduleEventPropagationToLayoutManager\n *\n * @param name - The name of the event\n * @internal\n */\n private propagateEventToLayoutManager(name: string, event: EventEmitter.BubblingEvent) {\n this._pendingEventPropagations[name] = false;\n this.layoutManager.emitUnknown(name, event);\n }\n}\n\n/** @public */\nexport namespace ContentItem {\n /** @internal */\n export interface Area extends AreaLinkedRect {\n surface: number;\n contentItem: ContentItem;\n }\n}\n\n/** @public @deprecated Use {@link (ContentItem:class)} */\nexport type AbstractContentItem = ContentItem;\n","import { ResolvedComponentItemConfig, ResolvedHeaderedItemConfig } from '../config/resolved-config';\nimport { ComponentContainer } from '../container/component-container';\nimport { Tab } from '../controls/tab';\nimport { UnexpectedNullError } from '../errors/internal-error';\nimport { LayoutManager } from '../layout-manager';\nimport { DomConstants } from '../utils/dom-constants';\nimport { ItemType, JsonValue } from '../utils/types';\nimport { getElementWidthAndHeight, setElementHeight, setElementWidth } from '../utils/utils';\nimport { ComponentParentableItem } from './component-parentable-item';\nimport { ContentItem } from './content-item';\n\n/** @public */\nexport class ComponentItem extends ContentItem {\n /** @internal */\n private _reorderEnabled: boolean;\n /** @internal */\n private _headerConfig: ResolvedHeaderedItemConfig.Header | undefined;\n /** @internal */\n private _title: string;\n /** @internal */\n private readonly _initialWantMaximise: boolean;\n /** @internal */\n private _container: ComponentContainer;\n /** @internal */\n private _tab: Tab;\n /** @internal */\n private _focused = false;\n\n /** @internal @deprecated use {@link (ComponentItem:class).componentType} */\n get componentName(): JsonValue { return this._container.componentType; }\n get componentType(): JsonValue { return this._container.componentType; }\n get reorderEnabled(): boolean { return this._reorderEnabled; }\n /** @internal */\n get initialWantMaximise(): boolean { return this._initialWantMaximise; }\n get component(): ComponentContainer.Component | undefined { return this._container.component; }\n get container(): ComponentContainer { return this._container; }\n get parentItem(): ComponentParentableItem { return this._parentItem; }\n\n get headerConfig(): ResolvedHeaderedItemConfig.Header | undefined { return this._headerConfig; }\n get title(): string { return this._title; }\n get tab(): Tab { return this._tab; }\n get focused(): boolean { return this._focused; }\n\n /** @internal */\n constructor(\n layoutManager: LayoutManager,\n config: ResolvedComponentItemConfig,\n /** @internal */\n private _parentItem: ComponentParentableItem\n ) {\n super(layoutManager, config, _parentItem, document.createElement('div'));\n\n this.isComponent = true;\n\n this._reorderEnabled = config.reorderEnabled;\n\n this.applyUpdatableConfig(config);\n\n this._initialWantMaximise = config.maximised;\n\n const containerElement = document.createElement('div');\n containerElement.classList.add(DomConstants.ClassName.Content);\n this.element.appendChild(containerElement);\n this._container = new ComponentContainer(config, this, layoutManager, containerElement,\n (itemConfig) => this.handleUpdateItemConfigEvent(itemConfig),\n () => this.show(),\n () => this.hide(),\n (suppressEvent) => this.focus(suppressEvent),\n (suppressEvent) => this.blur(suppressEvent),\n );\n }\n\n /** @internal */\n override destroy(): void {\n this._container.destroy()\n super.destroy();\n }\n\n applyUpdatableConfig(config: ResolvedComponentItemConfig): void {\n this.setTitle(config.title);\n this._headerConfig = config.header;\n }\n\n toConfig(): ResolvedComponentItemConfig {\n const stateRequestEvent = this._container.stateRequestEvent;\n const state = stateRequestEvent === undefined ? this._container.state : stateRequestEvent();\n\n const result: ResolvedComponentItemConfig = {\n type: ItemType.component,\n content: [],\n size: this.size,\n sizeUnit: this.sizeUnit,\n minSize: this.minSize,\n minSizeUnit: this.minSizeUnit,\n id: this.id,\n maximised: false,\n isClosable: this.isClosable,\n reorderEnabled: this._reorderEnabled,\n title: this._title,\n header: ResolvedHeaderedItemConfig.Header.createCopy(this._headerConfig),\n componentType: ResolvedComponentItemConfig.copyComponentType(this.componentType),\n componentState: state,\n }\n\n return result;\n }\n\n close(): void {\n if (this.parent === null) {\n throw new UnexpectedNullError('CIC68883');\n } else {\n this.parent.removeChild(this, false);\n }\n }\n\n // Used by Drag Proxy\n /** @internal */\n enterDragMode(width: number, height: number): void {\n setElementWidth(this.element, width);\n setElementHeight(this.element, height);\n this._container.enterDragMode(width, height);\n }\n\n /** @internal */\n exitDragMode(): void {\n this._container.exitDragMode();\n }\n\n /** @internal */\n enterStackMaximised(): void {\n this._container.enterStackMaximised();\n }\n\n /** @internal */\n exitStackMaximised(): void {\n this._container.exitStackMaximised();\n }\n\n // Used by Drag Proxy\n /** @internal */\n drag(): void {\n this._container.drag();\n }\n\n /** @internal */\n override updateSize(force: boolean): void {\n this.updateNodeSize(force);\n }\n\n /** @internal */\n override init(): void {\n this.updateNodeSize(false);\n\n super.init();\n this._container.emit('open');\n this.initContentItems();\n }\n\n /**\n * Set this component's title\n *\n * @public\n * @param title -\n */\n\n setTitle(title: string): void {\n this._title = title;\n this.emit('titleChanged', title);\n this.emit('stateChanged');\n }\n\n setTab(tab: Tab): void {\n this._tab = tab;\n this.emit('tab', tab)\n this._container.setTab(tab);\n }\n\n /** @internal */\n override hide(): void {\n super.hide();\n this._container.setVisibility(false);\n }\n\n /** @internal */\n override show(): void {\n super.show();\n this._container.setVisibility(true);\n }\n\n /**\n * Focuses the item if it is not already focused\n */\n focus(suppressEvent = false): void {\n this.parentItem.setActiveComponentItem(this, true, suppressEvent);\n }\n\n /** @internal */\n setFocused(suppressEvent: boolean): void {\n this._focused = true;\n this.tab.setFocused();\n if (!suppressEvent) {\n this.emitBaseBubblingEvent('focus');\n }\n }\n\n /**\n * Blurs (defocuses) the item if it is focused\n */\n blur(suppressEvent = false): void {\n if (this._focused) {\n this.layoutManager.setFocusedComponentItem(undefined, suppressEvent);\n }\n }\n\n /** @internal */\n setBlurred(suppressEvent: boolean): void {\n this._focused = false;\n this.tab.setBlurred();\n if (!suppressEvent) {\n this.emitBaseBubblingEvent('blur');\n }\n }\n\n /** @internal */\n protected override setParent(parent: ContentItem): void {\n this._parentItem = parent as ComponentParentableItem;\n super.setParent(parent);\n }\n\n /** @internal */\n private handleUpdateItemConfigEvent(itemConfig: ResolvedComponentItemConfig) {\n this.applyUpdatableConfig(itemConfig);\n }\n\n /** @internal */\n private updateNodeSize(force: boolean): void {\n if (this.element.style.display !== 'none') {\n // Do not update size of hidden components to prevent unwanted reflows\n\n const { width, height } = getElementWidthAndHeight(this.element);\n this._container.setSizeToNodeSize(width, height, force);\n }\n }\n}\n\n/** @public @deprecated use {@link (ComponentItem:class)} */\nexport type Component = ComponentItem;\n\n/** @public */\nexport namespace ComponentItem {\n export type Component = ComponentContainer.Component;\n}\n","import { ComponentItem } from './component-item';\nimport { ContentItem } from './content-item';\n\nexport abstract class ComponentParentableItem extends ContentItem {\n /** @internal */\n private _focused = false;\n\n get focused(): boolean { return this._focused; }\n\n /** @internal */\n setFocusedValue(value: boolean): void {\n this._focused = value;\n }\n\n abstract setActiveComponentItem(item: ComponentItem, focus: boolean, suppressFocusEvent: boolean): void;\n}\n","import { ComponentItemConfig, ItemConfig } from '../config/config';\nimport { ResolvedComponentItemConfig, ResolvedHeaderedItemConfig, ResolvedItemConfig, ResolvedStackItemConfig } from '../config/resolved-config';\nimport { Header } from '../controls/header';\nimport { AssertError, UnexpectedNullError, UnexpectedUndefinedError } from '../errors/internal-error';\nimport { LayoutManager } from '../layout-manager';\nimport { DomConstants } from '../utils/dom-constants';\nimport { DragListener } from '../utils/drag-listener';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { AreaLinkedRect, ItemType, JsonValue, Side, SizeUnitEnum, WidthAndHeight, WidthOrHeightPropertyName } from '../utils/types';\nimport {\n getElementWidthAndHeight,\n numberToPixels,\n setElementDisplayVisibility\n} from '../utils/utils';\nimport { ComponentItem } from './component-item';\nimport { ComponentParentableItem } from './component-parentable-item';\nimport { ContentItem } from './content-item';\n\n/** @public */\nexport class Stack extends ComponentParentableItem {\n /** @internal */\n private readonly _headerConfig: ResolvedHeaderedItemConfig.Header | undefined;\n /** @internal */\n private readonly _header: Header;\n /** @internal */\n private readonly _childElementContainer: HTMLElement;\n /** @internal */\n private readonly _maximisedEnabled: boolean;\n /** @internal */\n private _activeComponentItem: ComponentItem | undefined;\n /** @internal */\n private _dropSegment: Stack.Segment;\n /** @internal */\n private _dropIndex: number;\n /** @internal */\n private _contentAreaDimensions: Stack.ContentAreaDimensions;\n /** @internal */\n private _headerSideChanged = false;\n /** @internal */\n private readonly _initialWantMaximise: boolean;\n /** @internal */\n private _initialActiveItemIndex: number;\n\n /** @internal */\n private _resizeListener = () => this.handleResize();\n /** @internal */\n private _maximisedListener = () => this.handleMaximised();\n /** @internal */\n private _minimisedListener = () => this.handleMinimised();\n\n get childElementContainer(): HTMLElement { return this._childElementContainer; }\n get header(): Header { return this._header; }\n get headerShow(): boolean { return this._header.show; }\n get headerSide(): Side { return this._header.side; }\n get headerLeftRightSided(): boolean { return this._header.leftRightSided; }\n /** @internal */\n get contentAreaDimensions(): Stack.ContentAreaDimensions | undefined { return this._contentAreaDimensions; }\n /** @internal */\n get initialWantMaximise(): boolean { return this._initialWantMaximise; }\n get isMaximised(): boolean { return this === this.layoutManager.maximisedStack; }\n get stackParent(): ContentItem {\n if (!this.parent) {\n throw new Error('Stack should always have a parent');\n }\n return this.parent;\n }\n\n /** @internal */\n constructor(layoutManager: LayoutManager, config: ResolvedStackItemConfig, parent: ContentItem) {\n super(layoutManager, config, parent, Stack.createElement(document));\n\n this._headerConfig = config.header;\n const layoutHeaderConfig = layoutManager.layoutConfig.header;\n const configContent = config.content;\n // If stack has only one component, then we can also check this for header settings\n let componentHeaderConfig: ResolvedHeaderedItemConfig.Header | undefined;\n if (configContent.length !== 1) {\n componentHeaderConfig = undefined;\n } else {\n const firstChildItemConfig = configContent[0];\n componentHeaderConfig = (firstChildItemConfig as ResolvedHeaderedItemConfig).header; // will be undefined if not component (and wont be stack)\n }\n\n this._initialWantMaximise = config.maximised;\n this._initialActiveItemIndex = config.activeItemIndex ?? 0; // make sure defined\n\n // check for defined value for each item in order of Stack (this Item), Component (first child), Manager.\n const show = this._headerConfig?.show ?? componentHeaderConfig?.show ?? layoutHeaderConfig.show;\n const popout = this._headerConfig?.popout ?? componentHeaderConfig?.popout ?? layoutHeaderConfig.popout;\n const maximise = this._headerConfig?.maximise ?? componentHeaderConfig?.maximise ?? layoutHeaderConfig.maximise;\n const close = this._headerConfig?.close ?? componentHeaderConfig?.close ?? layoutHeaderConfig.close;\n const minimise = this._headerConfig?.minimise ?? componentHeaderConfig?.minimise ?? layoutHeaderConfig.minimise;\n const tabDropdown = this._headerConfig?.tabDropdown ?? componentHeaderConfig?.tabDropdown ?? layoutHeaderConfig.tabDropdown;\n this._maximisedEnabled = maximise !== false;\n const headerSettings: Header.Settings = {\n show: show !== false,\n side: show === false ? Side.top : show,\n popoutEnabled: popout !== false,\n popoutLabel: popout === false ? '' : popout,\n maximiseEnabled: this._maximisedEnabled,\n maximiseLabel: maximise === false ? '' : maximise,\n closeEnabled: close !== false,\n closeLabel: close === false ? '' : close,\n minimiseEnabled: true,\n minimiseLabel: minimise,\n tabDropdownEnabled: tabDropdown !== false,\n tabDropdownLabel: tabDropdown === false ? '' : tabDropdown,\n };\n\n this._header = new Header(layoutManager,\n this, headerSettings,\n config.isClosable && close !== false,\n () => this.getActiveComponentItem(),\n () => this.remove(),\n () => this.handlePopoutEvent(),\n () => this.toggleMaximise(),\n (ev) => this.handleHeaderClickEvent(ev),\n (ev) => this.handleHeaderTouchStartEvent(ev),\n (item) => this.handleHeaderComponentRemoveEvent(item),\n (item) => this.handleHeaderComponentFocusEvent(item),\n (x, y, dragListener, item) => this.handleHeaderComponentStartDragEvent(x, y, dragListener, item),\n );\n\n // this._dropZones = {};\n\n this.isStack = true;\n\n this._childElementContainer = document.createElement('section');\n this._childElementContainer.classList.add(DomConstants.ClassName.Items);\n\n this.on('resize', this._resizeListener);\n if (this._maximisedEnabled) {\n this.on('maximised', this._maximisedListener);\n this.on('minimised', this._minimisedListener);\n }\n\n this.element.appendChild(this._header.element);\n this.element.appendChild(this._childElementContainer);\n\n this.setupHeaderPosition();\n this._header.updateClosability();\n }\n\n /** @internal */\n override updateSize(force: boolean): void {\n this.layoutManager.beginVirtualSizedContainerAdding();\n try {\n this.updateNodeSize();\n this.updateContentItemsSize(force);\n } finally {\n this.layoutManager.endVirtualSizedContainerAdding();\n }\n }\n\n /** @internal */\n override init(): void {\n if (this.isInitialised === true) return;\n\n this.updateNodeSize();\n\n for (let i = 0; i < this.contentItems.length; i++) {\n this._childElementContainer.appendChild(this.contentItems[i].element);\n }\n\n super.init();\n\n const contentItems = this.contentItems;\n const contentItemCount = contentItems.length;\n if (contentItemCount > 0) { // contentItemCount will be 0 on drag drop\n if (this._initialActiveItemIndex < 0 || this._initialActiveItemIndex >= contentItemCount) {\n throw new Error(`ActiveItemIndex out of range: ${this._initialActiveItemIndex} id: ${this.id}`);\n } else {\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (!(contentItem instanceof ComponentItem)) {\n throw new Error(`Stack Content Item is not of type ComponentItem: ${i} id: ${this.id}`);\n } else {\n this._header.createTab(contentItem, i);\n contentItem.hide();\n contentItem.container.setBaseLogicalZIndex();\n }\n }\n\n this.setActiveComponentItem(contentItems[this._initialActiveItemIndex] as ComponentItem, false);\n\n this._header.updateTabSizes();\n }\n }\n\n this._header.updateClosability();\n this.initContentItems();\n }\n\n /** @deprecated Use {@link (Stack:class).setActiveComponentItem} */\n setActiveContentItem(item: ContentItem): void {\n if (!ContentItem.isComponentItem(item)) {\n throw new Error('Stack.setActiveContentItem: item is not a ComponentItem');\n } else {\n this.setActiveComponentItem(item, false);\n }\n }\n\n setActiveComponentItem(componentItem: ComponentItem, focus: boolean, suppressFocusEvent = false): void {\n if (this._activeComponentItem !== componentItem) {\n if (this.contentItems.indexOf(componentItem) === -1) {\n throw new Error('componentItem is not a child of this stack');\n } else {\n this.layoutManager.beginSizeInvalidation();\n try {\n if (this._activeComponentItem !== undefined) {\n this._activeComponentItem.hide();\n }\n this._activeComponentItem = componentItem;\n this._header.processActiveComponentChanged(componentItem);\n componentItem.show();\n } finally {\n this.layoutManager.endSizeInvalidation();\n }\n\n this.emit('activeContentItemChanged', componentItem);\n this.layoutManager.emit('activeContentItemChanged', componentItem);\n this.emitStateChangedEvent();\n }\n }\n\n if (this.focused || focus) {\n this.layoutManager.setFocusedComponentItem(componentItem, suppressFocusEvent);\n }\n }\n\n /** @deprecated Use {@link (Stack:class).getActiveComponentItem} */\n getActiveContentItem(): ContentItem | null {\n return this.getActiveComponentItem() ?? null;\n }\n\n getActiveComponentItem(): ComponentItem | undefined {\n return this._activeComponentItem;\n }\n\n /** @internal */\n focusActiveContentItem(): void {\n this._activeComponentItem?.focus();\n }\n\n /** @internal */\n override setFocusedValue(value: boolean): void {\n this._header.applyFocusedValue(value);\n super.setFocusedValue(value);\n }\n\n /** @internal */\n setRowColumnClosable(value: boolean): void {\n this._header.setRowColumnClosable(value);\n }\n\n newComponent(componentType: JsonValue, componentState?: JsonValue, title?: string, index?: number): ComponentItem {\n const itemConfig: ComponentItemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n return this.newItem(itemConfig, index) as ComponentItem;\n }\n\n addComponent(componentType: JsonValue, componentState?: JsonValue, title?: string, index?: number): number {\n const itemConfig: ComponentItemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n return this.addItem(itemConfig, index);\n }\n\n newItem(itemConfig: ComponentItemConfig, index?: number): ContentItem {\n index = this.addItem(itemConfig, index);\n return this.contentItems[index];\n }\n\n addItem(itemConfig: ComponentItemConfig, index?: number): number {\n this.layoutManager.checkMinimiseMaximisedStack();\n\n const resolvedItemConfig = ItemConfig.resolve(itemConfig, false);\n const contentItem = this.layoutManager.createAndInitContentItem(resolvedItemConfig, this);\n return this.addChild(contentItem, index);\n }\n\n override addChild(contentItem: ContentItem, index?: number, focus = false): number {\n if(index !== undefined && index > this.contentItems.length){\n index -= 1;\n throw new AssertError('SAC99728'); // undisplayChild() removed so this condition should no longer occur\n }\n\n if (!(contentItem instanceof ComponentItem)) {\n throw new AssertError('SACC88532'); // Stacks can only have Component children\n } else {\n index = super.addChild(contentItem, index);\n this._childElementContainer.appendChild(contentItem.element);\n this._header.createTab(contentItem, index);\n this.setActiveComponentItem(contentItem, focus);\n this._header.updateTabSizes();\n this.updateSize(false);\n contentItem.container.setBaseLogicalZIndex();\n this._header.updateClosability();\n this.emitStateChangedEvent();\n return index;\n }\n }\n\n override removeChild(contentItem: ContentItem, keepChild: boolean): void {\n const componentItem = contentItem as ComponentItem;\n const index = this.contentItems.indexOf(componentItem);\n const stackWillBeDeleted = this.contentItems.length === 1;\n\n if (this._activeComponentItem === componentItem) {\n if (componentItem.focused) {\n componentItem.blur();\n }\n if (!stackWillBeDeleted) {\n // At this point we're already sure we have at least one content item left *after*\n // removing contentItem, so we can safely assume index 1 is a valid one if\n // the index of contentItem is 0, otherwise we just use the previous content item.\n const newActiveComponentIdx = index === 0 ? 1 : index - 1;\n this.setActiveComponentItem(this.contentItems[newActiveComponentIdx] as ComponentItem, false);\n }\n }\n\n this._header.removeTab(componentItem);\n\n super.removeChild(componentItem, keepChild);\n\n if (!stackWillBeDeleted) {\n this._header.updateClosability();\n }\n\n this.emitStateChangedEvent();\n }\n\n /**\n * Maximises the Item or minimises it if it is already maximised\n */\n toggleMaximise(): void {\n if (this.isMaximised) {\n this.minimise();\n } else {\n this.maximise();\n }\n }\n\n maximise(): void {\n if (!this.isMaximised) {\n this.layoutManager.setMaximisedStack(this);\n const contentItems = this.contentItems;\n const contentItemCount = contentItems.length;\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (contentItem instanceof ComponentItem) {\n contentItem.enterStackMaximised();\n } else {\n throw new AssertError('SMAXI87773');\n }\n }\n this.emitStateChangedEvent();\n }\n }\n\n minimise(): void {\n if (this.isMaximised) {\n this.layoutManager.setMaximisedStack(undefined);\n const contentItems = this.contentItems;\n const contentItemCount = contentItems.length;\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (contentItem instanceof ComponentItem) {\n contentItem.exitStackMaximised();\n } else {\n throw new AssertError('SMINI87773');\n }\n }\n this.emitStateChangedEvent();\n }\n }\n\n /** @internal */\n override destroy(): void {\n if (this._activeComponentItem?.focused) {\n this._activeComponentItem.blur();\n }\n super.destroy();\n this.off('resize', this._resizeListener);\n if (this._maximisedEnabled) {\n this.off('maximised', this._maximisedListener);\n this.off('minimised', this._minimisedListener);\n }\n this._header.destroy();\n }\n\n toConfig(): ResolvedStackItemConfig {\n let activeItemIndex: number | undefined;\n if (this._activeComponentItem) {\n activeItemIndex = this.contentItems.indexOf(this._activeComponentItem);\n if (activeItemIndex < 0) {\n throw new Error('active component item not found in stack');\n }\n }\n if (this.contentItems.length > 0 && activeItemIndex === undefined) {\n throw new Error('expected non-empty stack to have an active component item');\n } else {\n const result: ResolvedStackItemConfig = {\n type: 'stack',\n content: this.calculateConfigContent() as ResolvedComponentItemConfig[],\n size: this.size,\n sizeUnit: this.sizeUnit,\n minSize: this.minSize,\n minSizeUnit: this.minSizeUnit,\n id: this.id,\n isClosable: this.isClosable,\n maximised: this.isMaximised,\n header: this.createHeaderConfig(),\n activeItemIndex,\n }\n return result;\n }\n }\n\n /**\n * Ok, this one is going to be the tricky one: The user has dropped a {@link (ContentItem:class)} onto this stack.\n *\n * It was dropped on either the stacks header or the top, right, bottom or left bit of the content area\n * (which one of those is stored in this._dropSegment). Now, if the user has dropped on the header the case\n * is relatively clear: We add the item to the existing stack... job done (might be good to have\n * tab reordering at some point, but lets not sweat it right now)\n *\n * If the item was dropped on the content part things are a bit more complicated. If it was dropped on either the\n * top or bottom region we need to create a new column and place the items accordingly.\n * Unless, of course if the stack is already within a column... in which case we want\n * to add the newly created item to the existing column...\n * either prepend or append it, depending on wether its top or bottom.\n *\n * Same thing for rows and left / right drop segments... so in total there are 9 things that can potentially happen\n * (left, top, right, bottom) * is child of the right parent (row, column) + header drop\n *\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n override onDrop(contentItem: ContentItem, area: ContentItem.Area): void {\n /*\n * The item was dropped on the header area. Just add it as a child of this stack and\n * get the hell out of this logic\n */\n if (this._dropSegment === Stack.Segment.Header) {\n this.resetHeaderDropZone();\n if (this._dropIndex === undefined) {\n throw new UnexpectedUndefinedError('SODDI68990');\n } else {\n this.addChild(contentItem, this._dropIndex);\n return;\n }\n }\n\n /*\n * The stack is empty. Let's just add the element.\n */\n if (this._dropSegment === Stack.Segment.Body) {\n this.addChild(contentItem, 0, true);\n return;\n }\n\n /*\n * The item was dropped on the top-, left-, bottom- or right- part of the content. Let's\n * aggregate some conditions to make the if statements later on more readable\n */\n const isVertical = this._dropSegment === Stack.Segment.Top || this._dropSegment === Stack.Segment.Bottom;\n const isHorizontal = this._dropSegment === Stack.Segment.Left || this._dropSegment === Stack.Segment.Right;\n const insertBefore = this._dropSegment === Stack.Segment.Top || this._dropSegment === Stack.Segment.Left;\n const hasCorrectParent = (isVertical && this.stackParent.isColumn) || (isHorizontal && this.stackParent.isRow);\n\n /*\n * The content item can be either a component or a stack. If it is a component, wrap it into a stack\n */\n if (contentItem.isComponent) {\n const itemConfig = ResolvedStackItemConfig.createDefault();\n itemConfig.header = this.createHeaderConfig();\n const stack = this.layoutManager.createAndInitContentItem(itemConfig, this);\n stack.addChild(contentItem);\n contentItem = stack;\n }\n\n\n /*\n * If the contentItem that's being dropped is not dropped on a Stack (cases which just passed above and\n * which would wrap the contentItem in a Stack) we need to check whether contentItem is a RowOrColumn.\n * If it is, we need to re-wrap it in a Stack like it was when it was dragged by its Tab (it was dragged!).\n */\n if(contentItem.type === ItemType.row || contentItem.type === ItemType.column){\n const itemConfig = ResolvedStackItemConfig.createDefault();\n itemConfig.header = this.createHeaderConfig();\n const stack = this.layoutManager.createContentItem(itemConfig, this);\n stack.addChild(contentItem)\n contentItem = stack\n }\n\n /*\n * If the item is dropped on top or bottom of a column or left and right of a row, it's already\n * layd out in the correct way. Just add it as a child\n */\n if (hasCorrectParent) {\n const index = this.stackParent.contentItems.indexOf(this);\n this.stackParent.addChild(contentItem, insertBefore ? index : index + 1, true);\n this.size *= 0.5;\n contentItem.size = this.size;\n contentItem.sizeUnit = this.sizeUnit;\n this.stackParent.updateSize(false);\n /*\n * This handles items that are dropped on top or bottom of a row or left / right of a column. We need\n * to create the appropriate contentItem for them to live in\n */\n } else {\n const type = isVertical ? ItemType.column : ItemType.row;\n const itemConfig = ResolvedItemConfig.createDefault(type) as ResolvedItemConfig;\n const rowOrColumn = this.layoutManager.createContentItem(itemConfig, this);\n this.stackParent.replaceChild(this, rowOrColumn);\n\n rowOrColumn.addChild(contentItem, insertBefore ? 0 : undefined, true);\n rowOrColumn.addChild(this, insertBefore ? undefined : 0, true);\n\n this.size = 50;\n contentItem.size = 50;\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n rowOrColumn.updateSize(false);\n }\n }\n\n /**\n * If the user hovers above the header part of the stack, indicate drop positions for tabs.\n * otherwise indicate which segment of the body the dragged item would be dropped on\n *\n * @param x - Absolute Screen X\n * @param y - Absolute Screen Y\n * @internal\n */\n override highlightDropZone(x: number, y: number): void {\n for (const key in this._contentAreaDimensions) {\n const segment = key as Stack.Segment;\n const area = this._contentAreaDimensions[segment].hoverArea;\n\n if (area.x1 < x && area.x2 > x && area.y1 < y && area.y2 > y) {\n\n if (segment === Stack.Segment.Header) {\n this._dropSegment = Stack.Segment.Header;\n this.highlightHeaderDropZone(this._header.leftRightSided ? y : x);\n } else {\n this.resetHeaderDropZone();\n this.highlightBodyDropZone(segment);\n }\n\n return;\n }\n }\n }\n\n /** @internal */\n getArea(): ContentItem.Area | null {\n if (this.element.style.display === 'none') {\n return null;\n }\n\n const headerArea = super.getElementArea(this._header.element);\n const contentArea = super.getElementArea(this._childElementContainer);\n if (headerArea === null || contentArea === null) {\n throw new UnexpectedNullError('SGAHC13086');\n }\n const contentWidth = contentArea.x2 - contentArea.x1;\n const contentHeight = contentArea.y2 - contentArea.y1;\n\n this._contentAreaDimensions = {\n header: {\n hoverArea: {\n x1: headerArea.x1,\n y1: headerArea.y1,\n x2: headerArea.x2,\n y2: headerArea.y2\n },\n highlightArea: {\n x1: headerArea.x1,\n y1: headerArea.y1,\n x2: headerArea.x2,\n y2: headerArea.y2\n }\n }\n };\n\n /**\n * Highlight the entire body if the stack is empty\n */\n if (this.contentItems.length === 0) {\n\n this._contentAreaDimensions.body = {\n hoverArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y2\n },\n highlightArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y2\n }\n };\n\n return super.getElementArea(this.element);\n } else {\n this._contentAreaDimensions.left = {\n hoverArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x1 + contentWidth * 0.25,\n y2: contentArea.y2\n },\n highlightArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x1 + contentWidth * 0.5,\n y2: contentArea.y2\n }\n };\n\n this._contentAreaDimensions.top = {\n hoverArea: {\n x1: contentArea.x1 + contentWidth * 0.25,\n y1: contentArea.y1,\n x2: contentArea.x1 + contentWidth * 0.75,\n y2: contentArea.y1 + contentHeight * 0.5\n },\n highlightArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y1 + contentHeight * 0.5\n }\n };\n\n this._contentAreaDimensions.right = {\n hoverArea: {\n x1: contentArea.x1 + contentWidth * 0.75,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y2\n },\n highlightArea: {\n x1: contentArea.x1 + contentWidth * 0.5,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y2\n }\n };\n\n this._contentAreaDimensions.bottom = {\n hoverArea: {\n x1: contentArea.x1 + contentWidth * 0.25,\n y1: contentArea.y1 + contentHeight * 0.5,\n x2: contentArea.x1 + contentWidth * 0.75,\n y2: contentArea.y2\n },\n highlightArea: {\n x1: contentArea.x1,\n y1: contentArea.y1 + contentHeight * 0.5,\n x2: contentArea.x2,\n y2: contentArea.y2\n }\n };\n\n return super.getElementArea(this.element);\n }\n }\n\n /**\n * Programmatically operate with header position.\n *\n * @param position -\n *\n * @returns previous header position\n * @internal\n */\n positionHeader(position: Side): void {\n if (this._header.side !== position) {\n this._header.setSide(position);\n this._headerSideChanged = true;\n this.setupHeaderPosition();\n }\n }\n\n /** @internal */\n private updateNodeSize(): void {\n if (this.element.style.display !== 'none') {\n const content: WidthAndHeight = getElementWidthAndHeight(this.element);\n\n if (this._header.show) {\n const dimension = this._header.leftRightSided ? WidthOrHeightPropertyName.width : WidthOrHeightPropertyName.height;\n content[dimension] -= this.layoutManager.layoutConfig.dimensions.headerHeight;\n }\n this._childElementContainer.style.width = numberToPixels(content.width);\n this._childElementContainer.style.height = numberToPixels(content.height);\n for (let i = 0; i < this.contentItems.length; i++) {\n this.contentItems[i].element.style.width = numberToPixels(content.width);\n this.contentItems[i].element.style.height = numberToPixels(content.height);\n }\n this.emit('resize');\n this.emitStateChangedEvent();\n }\n }\n\n /** @internal */\n private highlightHeaderDropZone(x: number): void {\n const visibleTabsLength = this._header.lastVisibleTabIndex + 1;\n const tabsContainerElement = this._header.tabsContainerElement;\n const tabsContainerElementChildNodes = tabsContainerElement.childNodes;\n\n // Create shallow copy of childNodes list, excluding DropPlaceHolder, as we will be modifying the childNodes list\n const visibleTabElements = new Array(visibleTabsLength);\n let tabIndex = 0;\n let tabCount = 0;\n while (tabCount < visibleTabsLength) {\n const visibleTabElement = tabsContainerElementChildNodes[tabIndex++] as HTMLElement;\n if (visibleTabElement !== this.layoutManager.tabDropPlaceholder) {\n visibleTabElements[tabCount++] = visibleTabElement;\n }\n }\n\n const dropTargetIndicator = this.layoutManager.dropTargetIndicator;\n if (dropTargetIndicator === null) {\n throw new UnexpectedNullError('SHHDZDTI97110');\n }\n\n let area: AreaLinkedRect;\n\n // Empty stack\n if (visibleTabsLength === 0) {\n const headerRect = this._header.element.getBoundingClientRect();\n const headerTop = headerRect.top + document.body.scrollTop;\n const headerLeft = headerRect.left + document.body.scrollLeft;\n\n area = {\n x1: headerLeft,\n x2: headerLeft + 100,\n y1: headerTop + headerRect.height - 20,\n y2: headerTop + headerRect.height,\n };\n\n this._dropIndex = 0;\n } else {\n let tabIndex = 0;\n // This indicates whether our cursor is exactly over a tab\n let isAboveTab = false;\n let tabTop: number;\n let tabLeft: number;\n let tabWidth: number;\n let tabElement: HTMLElement;\n do {\n tabElement = visibleTabElements[tabIndex] as HTMLElement;\n const tabRect = tabElement.getBoundingClientRect();\n const tabRectTop = tabRect.top + document.body.scrollTop;\n const tabRectLeft = tabRect.left + document.body.scrollLeft;\n\n if (this._header.leftRightSided) {\n tabLeft = tabRectTop;\n tabTop = tabRectLeft;\n tabWidth = tabRect.height;\n } else {\n tabLeft = tabRectLeft;\n tabTop = tabRectTop;\n tabWidth = tabRect.width;\n }\n\n if (x >= tabLeft && x < tabLeft + tabWidth) {\n isAboveTab = true;\n } else {\n tabIndex++;\n }\n } while (tabIndex < visibleTabsLength && !isAboveTab);\n\n // If we're not above any tabs, or to the right of any tab, we are out of the area, so give up\n if (isAboveTab === false && x < tabLeft) {\n return;\n }\n\n const halfX = tabLeft + tabWidth / 2;\n\n if (x < halfX) {\n this._dropIndex = tabIndex;\n tabElement.insertAdjacentElement('beforebegin', this.layoutManager.tabDropPlaceholder);\n } else {\n this._dropIndex = Math.min(tabIndex + 1, visibleTabsLength);\n tabElement.insertAdjacentElement('afterend', this.layoutManager.tabDropPlaceholder);\n }\n\n const tabDropPlaceholderRect = this.layoutManager.tabDropPlaceholder.getBoundingClientRect();\n const tabDropPlaceholderRectTop = tabDropPlaceholderRect.top + document.body.scrollTop;\n const tabDropPlaceholderRectLeft = tabDropPlaceholderRect.left + document.body.scrollLeft;\n const tabDropPlaceholderRectWidth = tabDropPlaceholderRect.width;\n\n if (this._header.leftRightSided) {\n const placeHolderTop = tabDropPlaceholderRectTop;\n area = {\n x1: tabTop,\n x2: tabTop + tabElement.clientHeight,\n y1: placeHolderTop,\n y2: placeHolderTop + tabDropPlaceholderRectWidth,\n };\n } else {\n const placeHolderLeft = tabDropPlaceholderRectLeft;\n\n area = {\n x1: placeHolderLeft,\n x2: placeHolderLeft + tabDropPlaceholderRectWidth,\n y1: tabTop,\n y2: tabTop + tabElement.clientHeight,\n };\n }\n }\n\n dropTargetIndicator.highlightArea(area, 0);\n return;\n }\n\n /** @internal */\n private resetHeaderDropZone() {\n this.layoutManager.tabDropPlaceholder.remove();\n }\n\n /** @internal */\n private setupHeaderPosition() {\n setElementDisplayVisibility(this._header.element, this._header.show);\n this.element.classList.remove(DomConstants.ClassName.Left, DomConstants.ClassName.Right, DomConstants.ClassName.Bottom);\n if (this._header.leftRightSided) {\n this.element.classList.add('lm_' + this._header.side);\n }\n\n //if ([Side.right, Side.bottom].includes(this._header.side)) {\n // // move the header behind the content.\n // this.element.appendChild(this._header.element);\n //}\n this.updateSize(false);\n }\n\n /** @internal */\n private highlightBodyDropZone(segment: Stack.Segment): void {\n if (this._contentAreaDimensions === undefined) {\n throw new UnexpectedUndefinedError('SHBDZC82265');\n } else {\n const highlightArea = this._contentAreaDimensions[segment].highlightArea;\n const dropTargetIndicator = this.layoutManager.dropTargetIndicator;\n if (dropTargetIndicator === null) {\n throw new UnexpectedNullError('SHBDZD96110');\n } else {\n dropTargetIndicator.highlightArea(highlightArea, 1);\n this._dropSegment = segment;\n }\n }\n }\n\n /** @internal */\n private handleResize() {\n this._header.updateTabSizes()\n }\n\n /** @internal */\n private handleMaximised() {\n this._header.processMaximised();\n }\n\n /** @internal */\n private handleMinimised() {\n this._header.processMinimised();\n }\n\n /** @internal */\n private handlePopoutEvent() {\n this.popout();\n }\n\n /** @internal */\n private handleHeaderClickEvent(ev: MouseEvent) {\n const eventName = EventEmitter.headerClickEventName;\n const bubblingEvent = new EventEmitter.ClickBubblingEvent(eventName, this, ev);\n this.emit(eventName, bubblingEvent);\n }\n\n /** @internal */\n private handleHeaderTouchStartEvent(ev: TouchEvent) {\n const eventName = EventEmitter.headerTouchStartEventName;\n const bubblingEvent = new EventEmitter.TouchStartBubblingEvent(eventName, this, ev);\n this.emit(eventName, bubblingEvent);\n }\n\n /** @internal */\n private handleHeaderComponentRemoveEvent(item: ComponentItem) {\n this.removeChild(item, false);\n }\n\n /** @internal */\n private handleHeaderComponentFocusEvent(item: ComponentItem) {\n this.setActiveComponentItem(item, true);\n }\n\n /** @internal */\n private handleHeaderComponentStartDragEvent(x: number, y: number, dragListener: DragListener, componentItem: ComponentItem) {\n if (this.isMaximised === true) {\n this.toggleMaximise();\n }\n this.layoutManager.startComponentDrag(x, y, dragListener, componentItem, this);\n }\n\n /** @internal */\n private createHeaderConfig() {\n if (!this._headerSideChanged) {\n return ResolvedHeaderedItemConfig.Header.createCopy(this._headerConfig);\n } else {\n const show = this._header.show ? this._header.side : false;\n\n let result = ResolvedHeaderedItemConfig.Header.createCopy(this._headerConfig, show);\n if (result === undefined) {\n result = {\n show,\n popout: undefined,\n maximise: undefined,\n close: undefined,\n minimise: undefined,\n tabDropdown: undefined,\n };\n }\n return result;\n }\n }\n\n /** @internal */\n private emitStateChangedEvent() {\n this.emitBaseBubblingEvent('stateChanged');\n }\n}\n\n/** @public */\nexport namespace Stack {\n /** @internal */\n export const enum Segment {\n Header = 'header',\n Body = 'body',\n Left = 'left',\n Right = 'right',\n Top = 'top',\n Bottom = 'bottom',\n }\n\n /** @internal */\n export interface ContentAreaDimension {\n hoverArea: AreaLinkedRect;\n highlightArea: AreaLinkedRect;\n }\n\n /** @internal */\n export type ContentAreaDimensions = {\n [segment: string]: ContentAreaDimension;\n };\n\n /** @internal */\n export function createElement(document: Document): HTMLDivElement {\n const element = document.createElement('div');\n element.classList.add(DomConstants.ClassName.Item);\n element.classList.add(DomConstants.ClassName.Stack);\n return element;\n }\n}\n","import { UnexpectedNullError, UnexpectedUndefinedError } from '../errors/internal-error';\nimport { ComponentItem } from '../items/component-item';\nimport { ContentItem } from '../items/content-item';\nimport { Stack } from '../items/stack';\nimport { LayoutManager } from '../layout-manager';\nimport { DomConstants } from '../utils/dom-constants';\nimport { DragListener } from '../utils/drag-listener';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { Side } from '../utils/types';\nimport {\n numberToPixels\n} from '../utils/utils';\n\n/**\n * This class creates a temporary container\n * for the component whilst it is being dragged\n * and handles drag events\n * @internal\n */\nexport class DragProxy extends EventEmitter {\n private _area: ContentItem.Area | null = null;\n private _lastValidArea: ContentItem.Area | null = null;\n private _minX: number;\n private _minY: number;\n private _maxX: number;\n private _maxY: number;\n private _sided: boolean;\n private _element: HTMLElement;\n private _proxyContainerElement: HTMLElement;\n private _componentItemFocused: boolean;\n\n get element(): HTMLElement { return this._element; }\n\n /**\n * @param x - The initial x position\n * @param y - The initial y position\n * @internal\n */\n constructor(x: number, y: number,\n private readonly _dragListener: DragListener,\n private readonly _layoutManager: LayoutManager,\n private readonly _componentItem: ComponentItem,\n private readonly _originalParent: ContentItem) {\n\n super();\n\n this._dragListener.on('drag', (offsetX, offsetY, event) => this.onDrag(offsetX, offsetY, event));\n this._dragListener.on('dragStop', () => this.onDrop());\n\n this.createDragProxyElements(x, y);\n\n if (this._componentItem.parent === null) {\n // Note that _contentItem will have dummy GroundItem as parent if initiated by a external drag source\n throw new UnexpectedNullError('DPC10097');\n }\n\n this._componentItemFocused = this._componentItem.focused;\n if (this._componentItemFocused) {\n this._componentItem.blur();\n }\n this._componentItem.parent.removeChild(this._componentItem, true);\n\n this.setDimensions();\n\n document.body.appendChild(this._element);\n\n this.determineMinMaxXY();\n this._layoutManager.calculateItemAreas();\n this.setDropPosition(x, y);\n }\n\n /** Create Stack-like structure to contain the dragged component */\n private createDragProxyElements(initialX: number, initialY: number): void {\n this._element = document.createElement('div');\n this._element.classList.add(DomConstants.ClassName.DragProxy);\n const headerElement = document.createElement('div');\n headerElement.classList.add(DomConstants.ClassName.Header);\n const tabsElement = document.createElement('div');\n tabsElement.classList.add(DomConstants.ClassName.Tabs);\n const tabElement = document.createElement('div');\n tabElement.classList.add(DomConstants.ClassName.Tab);\n const titleElement = document.createElement('span');\n titleElement.classList.add(DomConstants.ClassName.Title);\n tabElement.appendChild(titleElement);\n tabsElement.appendChild(tabElement);\n headerElement.appendChild(tabsElement);\n\n this._proxyContainerElement = document.createElement('div');\n this._proxyContainerElement.classList.add(DomConstants.ClassName.Content);\n\n this._element.appendChild(headerElement);\n this._element.appendChild(this._proxyContainerElement);\n\n if (this._originalParent instanceof Stack && this._originalParent.headerShow) {\n this._sided = this._originalParent.headerLeftRightSided;\n this._element.classList.add('lm_' + this._originalParent.headerSide);\n if ([Side.right, Side.bottom].indexOf(this._originalParent.headerSide) >= 0) {\n this._proxyContainerElement.insertAdjacentElement('afterend', headerElement);\n }\n }\n this._element.style.left = numberToPixels(initialX);\n this._element.style.top = numberToPixels(initialY);\n tabElement.setAttribute('title', this._componentItem.title);\n titleElement.insertAdjacentText('afterbegin', this._componentItem.title);\n this._proxyContainerElement.appendChild(this._componentItem.element);\n }\n\n private determineMinMaxXY(): void {\n const groundItem = this._layoutManager.groundItem;\n if (groundItem === undefined) {\n throw new UnexpectedUndefinedError('DPDMMXY73109');\n } else {\n const groundElement = groundItem.element;\n const rect = groundElement.getBoundingClientRect();\n this._minX = rect.left + document.body.scrollLeft;\n this._minY = rect.top + document.body.scrollTop;\n this._maxX = this._minX + rect.width;\n this._maxY = this._minY + rect.height;\n }\n }\n\n /**\n * Callback on every mouseMove event during a drag. Determines if the drag is\n * still within the valid drag area and calls the layoutManager to highlight the\n * current drop area\n *\n * @param offsetX - The difference from the original x position in px\n * @param offsetY - The difference from the original y position in px\n * @param event -\n * @internal\n */\n private onDrag(offsetX: number, offsetY: number, event: PointerEvent) {\n\n const x = event.pageX;\n const y = event.pageY;\n\n this.setDropPosition(x, y);\n this._componentItem.drag();\n }\n\n /**\n * Sets the target position, highlighting the appropriate area\n *\n * @param x - The x position in px\n * @param y - The y position in px\n *\n * @internal\n */\n private setDropPosition(x: number, y: number): void {\n if (this._layoutManager.layoutConfig.settings.constrainDragToContainer) {\n if (x <= this._minX) {\n x = Math.ceil(this._minX);\n } else if (x >= this._maxX) {\n x = Math.floor(this._maxX);\n }\n\n if (y <= this._minY) {\n y = Math.ceil(this._minY);\n } else if (y >= this._maxY) {\n y = Math.floor(this._maxY);\n }\n }\n\n this._element.style.left = numberToPixels(x);\n this._element.style.top = numberToPixels(y);\n this._area = this._layoutManager.getArea(x, y);\n\n if (this._area !== null) {\n this._lastValidArea = this._area;\n this._area.contentItem.highlightDropZone(x, y, this._area);\n }\n }\n\n /**\n * Callback when the drag has finished. Determines the drop area\n * and adds the child to it\n * @internal\n */\n private onDrop(): void {\n const dropTargetIndicator = this._layoutManager.dropTargetIndicator;\n if (dropTargetIndicator === null) {\n throw new UnexpectedNullError('DPOD30011');\n } else {\n dropTargetIndicator.hide();\n }\n\n this._componentItem.exitDragMode();\n\n /*\n * Valid drop area found\n */\n let droppedComponentItem: ComponentItem | undefined;\n if (this._area !== null) {\n droppedComponentItem = this._componentItem;\n this._area.contentItem.onDrop(droppedComponentItem, this._area);\n\n /**\n * No valid drop area available at present, but one has been found before.\n * Use it\n */\n } else if (this._lastValidArea !== null) {\n droppedComponentItem = this._componentItem;\n const newParentContentItem = this._lastValidArea.contentItem;\n newParentContentItem.onDrop(droppedComponentItem, this._lastValidArea);\n\n /**\n * No valid drop area found during the duration of the drag. Return\n * content item to its original position if a original parent is provided.\n * (Which is not the case if the drag had been initiated by createDragSource)\n */\n } else if (this._originalParent) {\n droppedComponentItem = this._componentItem;\n this._originalParent.addChild(droppedComponentItem);\n\n /**\n * The drag didn't ultimately end up with adding the content item to\n * any container. In order to ensure clean up happens, destroy the\n * content item.\n */\n } else {\n this._componentItem.destroy(); // contentItem children are now destroyed as well\n }\n\n this._element.remove();\n\n this._layoutManager.emit('itemDropped', this._componentItem);\n\n if (this._componentItemFocused && droppedComponentItem !== undefined) {\n droppedComponentItem.focus();\n }\n }\n\n /**\n * Updates the Drag Proxy's dimensions\n * @internal\n */\n private setDimensions() {\n const dimensions = this._layoutManager.layoutConfig.dimensions;\n if (dimensions === undefined) {\n throw new Error('DragProxy.setDimensions: dimensions undefined');\n }\n\n let width = dimensions.dragProxyWidth;\n let height = dimensions.dragProxyHeight;\n if (width === undefined || height === undefined) {\n throw new Error('DragProxy.setDimensions: width and/or height undefined');\n }\n\n const headerHeight = this._layoutManager.layoutConfig.header.show === false ? 0 : dimensions.headerHeight;\n this._element.style.width = numberToPixels(width);\n this._element.style.height = numberToPixels(height)\n width -= (this._sided ? headerHeight : 0);\n height -= (!this._sided ? headerHeight : 0);\n this._proxyContainerElement.style.width = numberToPixels(width);\n this._proxyContainerElement.style.height = numberToPixels(height);\n this._componentItem.enterDragMode(width, height);\n this._componentItem.show();\n }\n}\n","import { DomConstants } from '../utils/dom-constants';\nimport { DragListener } from '../utils/drag-listener';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { numberToPixels } from '../utils/utils';\n\n/** @internal */\nexport class Splitter {\n private _grabSize;\n private _dragListener: DragListener;\n\n private readonly _element: HTMLDivElement;\n\n get element(): HTMLDivElement { return this._element; }\n\n constructor(private _isVertical: boolean, private _size: number, grabSize: number) {\n this._grabSize = grabSize < this._size ? this._size : grabSize;\n\n this._element = document.createElement('div');\n this._element.classList.add(DomConstants.ClassName.Splitter);\n const dragHandleElement = document.createElement('div');\n dragHandleElement.classList.add(DomConstants.ClassName.DragHandle);\n\n const handleExcessSize = this._grabSize - this._size;\n const handleExcessPos = handleExcessSize / 2;\n\n if (this._isVertical) {\n dragHandleElement.style.top = numberToPixels(-handleExcessPos);\n dragHandleElement.style.height = numberToPixels(this._size + handleExcessSize);\n this._element.classList.add(DomConstants.ClassName.Vertical);\n this._element.style.height = numberToPixels(this._size);\n } else {\n dragHandleElement.style.left = numberToPixels(-handleExcessPos);\n dragHandleElement.style.width = numberToPixels(this._size + handleExcessSize);\n this._element.classList.add(DomConstants.ClassName.Horizontal);\n this._element.style.width = numberToPixels(this._size);\n }\n\n this._element.appendChild(dragHandleElement);\n\n this._dragListener = new DragListener(this._element, [dragHandleElement]);\n }\n\n destroy(): void {\n this._element.remove();\n }\n\n on(eventName: K, callback: EventEmitter.Callback): void {\n this._dragListener.on(eventName, callback);\n }\n}\n","import { ComponentItemConfig, ItemConfig, RowOrColumnItemConfig, StackItemConfig } from '../config/config'\nimport { ResolvedRowOrColumnItemConfig, ResolvedStackItemConfig } from '../config/resolved-config'\nimport { Splitter } from '../controls/splitter'\nimport { AssertError, UnexpectedNullError } from '../errors/internal-error'\nimport { LayoutManager } from '../layout-manager'\nimport { DomConstants } from '../utils/dom-constants'\nimport { ItemType, JsonValue, SizeUnitEnum, WidthOrHeightPropertyName } from '../utils/types'\nimport {\n getElementHeight,\n getElementWidth,\n getElementWidthAndHeight,\n numberToPixels,\n pixelsToNumber,\n setElementHeight,\n setElementWidth\n} from \"../utils/utils\"\nimport { ComponentItem } from './component-item'\nimport { ContentItem } from './content-item'\n\n/** @public */\nexport class RowOrColumn extends ContentItem {\n /** @internal */\n private readonly _childElementContainer: HTMLElement;\n /** @internal */\n private readonly _configType: 'row' | 'column';\n /** @internal */\n private readonly _isColumn: boolean;\n /** @internal */\n private readonly _splitterSize: number;\n /** @internal */\n private readonly _splitterGrabSize: number;\n /** @internal */\n private readonly _dimension: WidthOrHeightPropertyName;\n /** @internal */\n private readonly _splitter: Splitter[] = [];\n /** @internal */\n private _splitterPosition: number | null;\n /** @internal */\n private _splitterMinPosition: number | null;\n /** @internal */\n private _splitterMaxPosition: number | null;\n\n /** @internal */\n constructor(isColumn: boolean, layoutManager: LayoutManager, config: ResolvedRowOrColumnItemConfig,\n /** @internal */\n private _rowOrColumnParent: ContentItem\n ) {\n super(layoutManager, config, _rowOrColumnParent, RowOrColumn.createElement(document, isColumn));\n\n this.isRow = !isColumn;\n this.isColumn = isColumn;\n\n this._childElementContainer = this.element;\n this._splitterSize = layoutManager.layoutConfig.dimensions.borderWidth;\n this._splitterGrabSize = layoutManager.layoutConfig.dimensions.borderGrabWidth;\n this._isColumn = isColumn;\n this._dimension = isColumn ? 'height' : 'width';\n this._splitterPosition = null;\n this._splitterMinPosition = null;\n this._splitterMaxPosition = null;\n\n switch (config.type) {\n case ItemType.row:\n case ItemType.column:\n this._configType = config.type;\n break;\n default:\n throw new AssertError('ROCCCT00925');\n }\n }\n\n newComponent(componentType: JsonValue, componentState?: JsonValue, title?: string, index?: number): ComponentItem {\n const itemConfig: ComponentItemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n return this.newItem(itemConfig, index) as ComponentItem;\n }\n\n addComponent(componentType: JsonValue, componentState?: JsonValue, title?: string, index?: number): number {\n const itemConfig: ComponentItemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n return this.addItem(itemConfig, index);\n }\n\n newItem(itemConfig: RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig, index?: number): ContentItem {\n index = this.addItem(itemConfig, index);\n const createdItem = this.contentItems[index];\n\n if (ContentItem.isStack(createdItem) && (ItemConfig.isComponent(itemConfig))) {\n // createdItem is a Stack which was created to hold wanted component. Return component\n return createdItem.contentItems[0];\n } else {\n return createdItem;\n }\n }\n\n addItem(itemConfig: RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig,\n index?: number\n ): number {\n this.layoutManager.checkMinimiseMaximisedStack();\n const resolvedItemConfig = ItemConfig.resolve(itemConfig, false);\n const contentItem = this.layoutManager.createAndInitContentItem(resolvedItemConfig, this);\n return this.addChild(contentItem, index, false);\n }\n\n /**\n * Add a new contentItem to the Row or Column\n *\n * @param contentItem -\n * @param index - The position of the new item within the Row or Column.\n * If no index is provided the item will be added to the end\n * @param suspendResize - If true the items won't be resized. This will leave the item in\n * an inconsistent state and is only intended to be used if multiple\n * children need to be added in one go and resize is called afterwards\n *\n * @returns\n */\n override addChild(contentItem: ContentItem, index?: number, suspendResize?: boolean): number {\n\n // contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);\n\n if (index === undefined) {\n index = this.contentItems.length;\n }\n\n if (this.contentItems.length > 0) {\n const splitterElement = this.createSplitter(Math.max(0, index - 1)).element;\n\n if (index > 0) {\n this.contentItems[index - 1].element.insertAdjacentElement('afterend', splitterElement);\n splitterElement.insertAdjacentElement('afterend', contentItem.element);\n } else {\n this.contentItems[0].element.insertAdjacentElement('beforebegin', splitterElement);\n splitterElement.insertAdjacentElement('beforebegin', contentItem.element);\n }\n } else {\n this._childElementContainer.appendChild(contentItem.element);\n }\n\n super.addChild(contentItem, index);\n\n const newItemSize = (1 / this.contentItems.length) * 100;\n\n if (suspendResize === true) {\n this.emitBaseBubblingEvent('stateChanged');\n return index;\n }\n\n for (let i = 0; i < this.contentItems.length; i++) {\n const indexedContentItem = this.contentItems[i];\n if (indexedContentItem === contentItem) {\n contentItem.size = newItemSize;\n } else {\n const itemSize = indexedContentItem.size *= (100 - newItemSize) / 100;\n indexedContentItem.size = itemSize;\n }\n }\n\n this.updateSize(false);\n this.emitBaseBubblingEvent('stateChanged');\n\n return index;\n }\n\n /**\n * Removes a child of this element\n *\n * @param contentItem -\n * @param keepChild - If true the child will be removed, but not destroyed\n *\n */\n override removeChild(contentItem: ContentItem, keepChild: boolean): void {\n const index = this.contentItems.indexOf(contentItem);\n const splitterIndex = Math.max(index - 1, 0);\n\n if (index === -1) {\n throw new Error('Can\\'t remove child. ContentItem is not child of this Row or Column');\n }\n\n /**\n * Remove the splitter before the item or after if the item happens\n * to be the first in the row/column\n */\n if (this._splitter[splitterIndex]) {\n this._splitter[splitterIndex].destroy();\n this._splitter.splice(splitterIndex, 1);\n }\n\n super.removeChild(contentItem, keepChild);\n\n if (this.contentItems.length === 1 && this.isClosable === true) {\n const childItem = this.contentItems[0];\n this.contentItems.length = 0;\n this._rowOrColumnParent.replaceChild(this, childItem, true);\n } else {\n this.updateSize(false);\n this.emitBaseBubblingEvent('stateChanged');\n }\n }\n\n /**\n * Replaces a child of this Row or Column with another contentItem\n */\n override replaceChild(oldChild: ContentItem, newChild: ContentItem): void {\n const size = oldChild.size;\n super.replaceChild(oldChild, newChild);\n newChild.size = size;\n this.updateSize(false);\n this.emitBaseBubblingEvent('stateChanged');\n }\n\n /**\n * Called whenever the dimensions of this item or one of its parents change\n */\n override updateSize(force: boolean): void {\n this.layoutManager.beginVirtualSizedContainerAdding();\n try {\n this.updateNodeSize();\n this.updateContentItemsSize(force);\n } finally {\n this.layoutManager.endVirtualSizedContainerAdding();\n }\n }\n\n /**\n * Invoked recursively by the layout manager. ContentItem.init appends\n * the contentItem's DOM elements to the container, RowOrColumn init adds splitters\n * in between them\n * @internal\n */\n override init(): void {\n if (this.isInitialised === true) return;\n\n this.updateNodeSize();\n\n for (let i = 0; i < this.contentItems.length; i++) {\n this._childElementContainer.appendChild(this.contentItems[i].element);\n }\n\n super.init();\n\n for (let i = 0; i < this.contentItems.length - 1; i++) {\n this.contentItems[i].element.insertAdjacentElement('afterend', this.createSplitter(i).element);\n }\n\n this.initContentItems();\n }\n\n toConfig(): ResolvedRowOrColumnItemConfig {\n const result: ResolvedRowOrColumnItemConfig = {\n type: this.type as 'row' | 'column',\n content: this.calculateConfigContent() as (ResolvedRowOrColumnItemConfig | ResolvedStackItemConfig)[],\n size: this.size,\n sizeUnit: this.sizeUnit,\n minSize: this.minSize,\n minSizeUnit: this.minSizeUnit,\n id: this.id,\n isClosable: this.isClosable,\n }\n return result;\n }\n\n /** @internal */\n protected override setParent(parent: ContentItem): void {\n this._rowOrColumnParent = parent;\n super.setParent(parent);\n }\n\n /** @internal */\n private updateNodeSize(): void {\n if (this.contentItems.length > 0) {\n this.calculateRelativeSizes();\n this.setAbsoluteSizes();\n }\n this.emitBaseBubblingEvent('stateChanged');\n this.emit('resize');\n }\n\n /**\n * Turns the relative sizes calculated by calculateRelativeSizes into\n * absolute pixel values and applies them to the children's DOM elements\n *\n * Assigns additional pixels to counteract Math.floor\n * @internal\n */\n private setAbsoluteSizes() {\n const absoluteSizes = this.calculateAbsoluteSizes();\n\n for (let i = 0; i < this.contentItems.length; i++) {\n if (absoluteSizes.additionalPixel - i > 0) {\n absoluteSizes.itemSizes[i]++;\n }\n\n if (this._isColumn) {\n setElementWidth(this.contentItems[i].element, absoluteSizes.crossAxisSize);\n setElementHeight(this.contentItems[i].element, absoluteSizes.itemSizes[i]);\n } else {\n setElementWidth(this.contentItems[i].element, absoluteSizes.itemSizes[i]);\n setElementHeight(this.contentItems[i].element, absoluteSizes.crossAxisSize);\n }\n }\n }\n\n /**\n * Calculates the absolute sizes of all of the children of this Item.\n * @returns Set with absolute sizes and additional pixels.\n * @internal\n */\n private calculateAbsoluteSizes(): RowOrColumn.AbsoluteSizes {\n const totalSplitterSize = (this.contentItems.length - 1) * this._splitterSize;\n const { width: elementWidth, height: elementHeight } = getElementWidthAndHeight(this.element);\n\n let totalSize: number;\n let crossAxisSize: number;\n if (this._isColumn) {\n totalSize = elementHeight - totalSplitterSize;\n crossAxisSize = elementWidth;\n } else {\n totalSize = elementWidth - totalSplitterSize;\n crossAxisSize = elementHeight;\n }\n\n let totalAssigned = 0;\n const itemSizes = [];\n\n for (let i = 0; i < this.contentItems.length; i++) {\n const contentItem = this.contentItems[i];\n let itemSize: number;\n if (contentItem.sizeUnit === SizeUnitEnum.Percent) {\n itemSize = Math.floor(totalSize * (contentItem.size / 100));\n } else {\n throw new AssertError('ROCCAS6692');\n }\n\n totalAssigned += itemSize;\n itemSizes.push(itemSize);\n }\n\n const additionalPixel = Math.floor(totalSize - totalAssigned);\n\n return {\n itemSizes,\n additionalPixel,\n totalSize,\n crossAxisSize,\n };\n }\n\n /**\n * Calculates the relative sizes of all children of this Item. The logic\n * is as follows:\n *\n * - Add up the total size of all items that have a configured size\n *\n * - If the total == 100 (check for floating point errors)\n * Excellent, job done\n *\n * - If the total is \\> 100,\n * set the size of items without set dimensions to 1/3 and add this to the total\n * set the size off all items so that the total is hundred relative to their original size\n *\n * - If the total is \\< 100\n * If there are items without set dimensions, distribute the remainder to 100 evenly between them\n * If there are no items without set dimensions, increase all items sizes relative to\n * their original size so that they add up to 100\n *\n * @internal\n */\n private calculateRelativeSizes() {\n\n let total = 0;\n const itemsWithFractionalSize: ContentItem[] = [];\n let totalFractionalSize = 0;\n\n for (let i = 0; i < this.contentItems.length; i++) {\n const contentItem = this.contentItems[i];\n const sizeUnit = contentItem.sizeUnit;\n switch (sizeUnit) {\n case SizeUnitEnum.Percent: {\n total += contentItem.size;\n break;\n }\n case SizeUnitEnum.Fractional: {\n itemsWithFractionalSize.push(contentItem);\n totalFractionalSize += contentItem.size;\n break;\n }\n default:\n throw new AssertError('ROCCRS49110', JSON.stringify(contentItem));\n }\n }\n\n /**\n * Everything adds up to hundred, all good :-)\n */\n if (Math.round(total) === 100) {\n this.respectMinItemSize();\n return;\n } else {\n /**\n * Allocate the remaining size to the items with a fractional size\n */\n if (Math.round(total) < 100 && itemsWithFractionalSize.length > 0) {\n const fractionalAllocatedSize = 100 - total;\n for (let i = 0; i < itemsWithFractionalSize.length; i++) {\n const contentItem = itemsWithFractionalSize[i];\n contentItem.size = fractionalAllocatedSize * (contentItem.size / totalFractionalSize);\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n }\n this.respectMinItemSize();\n return;\n } else {\n\n /**\n * If the total is > 100, but there are also items with a fractional size, assign another 50%\n * to the fractional items\n *\n * This will be reset in the next step\n */\n if (Math.round(total) > 100 && itemsWithFractionalSize.length > 0) {\n for (let i = 0; i < itemsWithFractionalSize.length; i++) {\n const contentItem = itemsWithFractionalSize[i];\n contentItem.size = 50 * (contentItem.size / totalFractionalSize);\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n }\n total += 50;\n }\n\n /**\n * Set every items size relative to 100 relative to its size to total\n */\n for (let i = 0; i < this.contentItems.length; i++) {\n const contentItem = this.contentItems[i];\n contentItem.size = (contentItem.size / total) * 100;\n }\n\n this.respectMinItemSize();\n }\n }\n }\n\n /**\n * Adjusts the column widths to respect the dimensions minItemWidth if set.\n * @internal\n */\n private respectMinItemSize() {\n interface Entry {\n size: number;\n }\n\n const minItemSize = this.calculateContentItemMinSize(this);\n\n if (minItemSize <= 0 || this.contentItems.length <= 1) {\n return;\n } else {\n let totalOverMin = 0;\n let totalUnderMin = 0;\n const entriesOverMin: Entry[] = [];\n const allEntries: Entry[] = [];\n\n const absoluteSizes = this.calculateAbsoluteSizes();\n\n /**\n * Figure out how much we are under the min item size total and how much room we have to use.\n */\n for (let i = 0; i < absoluteSizes.itemSizes.length; i++) {\n const itemSize = absoluteSizes.itemSizes[i];\n\n let entry: Entry;\n if (itemSize < minItemSize) {\n totalUnderMin += minItemSize - itemSize;\n entry = {\n size: minItemSize\n };\n\n } else {\n totalOverMin += itemSize - minItemSize;\n entry = {\n size: itemSize\n };\n entriesOverMin.push(entry);\n }\n\n allEntries.push(entry);\n }\n\n /**\n * If there is nothing under min, or there is not enough over to make up the difference, do nothing.\n */\n if (totalUnderMin === 0 || totalUnderMin > totalOverMin) {\n return;\n } else {\n /**\n * Evenly reduce all columns that are over the min item width to make up the difference.\n */\n const reducePercent = totalUnderMin / totalOverMin;\n let remainingSize = totalUnderMin;\n for (let i = 0; i < entriesOverMin.length; i++) {\n const entry = entriesOverMin[i];\n const reducedSize = Math.round((entry.size - minItemSize) * reducePercent);\n remainingSize -= reducedSize;\n entry.size -= reducedSize;\n }\n\n /**\n * Take anything remaining from the last item.\n */\n if (remainingSize !== 0) {\n allEntries[allEntries.length - 1].size -= remainingSize;\n }\n\n /**\n * Set every items size relative to 100 relative to its size to total\n */\n for (let i = 0; i < this.contentItems.length; i++) {\n const contentItem = this.contentItems[i];\n contentItem.size = (allEntries[i].size / absoluteSizes.totalSize) * 100;\n }\n }\n }\n }\n\n /**\n * Instantiates a new Splitter, binds events to it and adds\n * it to the array of splitters at the position specified as the index argument\n *\n * What it doesn't do though is append the splitter to the DOM\n *\n * @param index - The position of the splitter\n *\n * @returns\n * @internal\n */\n private createSplitter(index: number): Splitter {\n const splitter = new Splitter(this._isColumn, this._splitterSize, this._splitterGrabSize);\n splitter.on('drag', (offsetX, offsetY) => this.onSplitterDrag(splitter, offsetX, offsetY));\n splitter.on('dragStop', () => this.onSplitterDragStop(splitter));\n splitter.on('dragStart', () => this.onSplitterDragStart(splitter));\n this._splitter.splice(index, 0, splitter);\n return splitter;\n }\n\n /**\n * Locates the instance of Splitter in the array of\n * registered splitters and returns a map containing the contentItem\n * before and after the splitters, both of which are affected if the\n * splitter is moved\n *\n * @returns A map of contentItems that the splitter affects\n * @internal\n */\n private getSplitItems(splitter: Splitter) {\n const index = this._splitter.indexOf(splitter);\n\n return {\n before: this.contentItems[index],\n after: this.contentItems[index + 1]\n };\n }\n\n private calculateContentItemMinSize(contentItem: ContentItem) {\n const minSize = contentItem.minSize;\n if (minSize !== undefined) {\n if (contentItem.minSizeUnit === SizeUnitEnum.Pixel) {\n return minSize;\n } else {\n throw new AssertError('ROCGMD98831', JSON.stringify(contentItem));\n }\n } else {\n const dimensions = this.layoutManager.layoutConfig.dimensions;\n return this._isColumn ? dimensions.defaultMinItemHeight : dimensions.defaultMinItemWidth;\n }\n }\n\n /**\n * Gets the minimum dimensions for the given item configuration array\n * @internal\n */\n private calculateContentItemsTotalMinSize(contentItems: readonly ContentItem[]) {\n let totalMinSize = 0;\n\n for (const contentItem of contentItems) {\n totalMinSize += this.calculateContentItemMinSize(contentItem);\n }\n\n return totalMinSize;\n }\n\n /**\n * Invoked when a splitter's dragListener fires dragStart. Calculates the splitters\n * movement area once (so that it doesn't need calculating on every mousemove event)\n * @internal\n */\n private onSplitterDragStart(splitter: Splitter) {\n const items = this.getSplitItems(splitter);\n\n const beforeWidth = pixelsToNumber(items.before.element.style[this._dimension]);\n const afterSize = pixelsToNumber(items.after.element.style[this._dimension]);\n const beforeMinSize = this.calculateContentItemsTotalMinSize(items.before.contentItems);\n const afterMinSize = this.calculateContentItemsTotalMinSize(items.after.contentItems);\n\n this._splitterPosition = 0;\n this._splitterMinPosition = -1 * (beforeWidth - beforeMinSize);\n this._splitterMaxPosition = afterSize - afterMinSize;\n }\n\n /**\n * Invoked when a splitter's DragListener fires drag. Updates the splitter's DOM position,\n * but not the sizes of the elements the splitter controls in order to minimize resize events\n *\n * @param splitter -\n * @param offsetX - Relative pixel values to the splitter's original position. Can be negative\n * @param offsetY - Relative pixel values to the splitter's original position. Can be negative\n * @internal\n */\n private onSplitterDrag(splitter: Splitter, offsetX: number, offsetY: number) {\n let offset = this._isColumn ? offsetY : offsetX;\n\n if (this._splitterMinPosition === null || this._splitterMaxPosition === null) {\n throw new UnexpectedNullError('ROCOSD59226');\n }\n offset = Math.max(offset, this._splitterMinPosition);\n offset = Math.min(offset, this._splitterMaxPosition);\n\n this._splitterPosition = offset;\n const offsetPixels = numberToPixels(offset);\n if (this._isColumn) {\n splitter.element.style.top = offsetPixels;\n } else {\n splitter.element.style.left = offsetPixels;\n }\n }\n\n /**\n * Invoked when a splitter's DragListener fires dragStop. Resets the splitters DOM position,\n * and applies the new sizes to the elements before and after the splitter and their children\n * on the next animation frame\n * @internal\n */\n private onSplitterDragStop(splitter: Splitter) {\n if (this._splitterPosition === null) {\n throw new UnexpectedNullError('ROCOSDS66932');\n } else {\n const items = this.getSplitItems(splitter);\n const sizeBefore = pixelsToNumber(items.before.element.style[this._dimension]);\n const sizeAfter = pixelsToNumber(items.after.element.style[this._dimension]);\n const splitterPositionInRange = (this._splitterPosition + sizeBefore) / (sizeBefore + sizeAfter);\n const totalRelativeSize = items.before.size + items.after.size;\n\n items.before.size = splitterPositionInRange * totalRelativeSize;\n items.after.size = (1 - splitterPositionInRange) * totalRelativeSize;\n\n splitter.element.style.top = numberToPixels(0);\n splitter.element.style.left = numberToPixels(0);\n\n globalThis.requestAnimationFrame(() => this.updateSize(false));\n }\n }\n}\n\n/** @public */\nexport namespace RowOrColumn {\n /** @internal */\n export interface AbsoluteSizes {\n itemSizes: number[],\n additionalPixel: number,\n totalSize: number,\n crossAxisSize: number\n }\n\n /** @internal */\n export function getElementDimensionSize(element: HTMLElement, dimension: WidthOrHeightPropertyName): number {\n if (dimension === 'width') {\n return getElementWidth(element);\n } else {\n return getElementHeight(element);\n }\n }\n\n /** @internal */\n export function setElementDimensionSize(element: HTMLElement, dimension: WidthOrHeightPropertyName, value: number): void {\n if (dimension === 'width') {\n return setElementWidth(element, value);\n } else {\n return setElementHeight(element, value);\n }\n }\n\n /** @internal */\n export function createElement(document: Document, isColumn: boolean): HTMLDivElement {\n const element = document.createElement('div');\n element.classList.add(DomConstants.ClassName.Item);\n if (isColumn) {\n element.classList.add(DomConstants.ClassName.Column);\n } else {\n element.classList.add(DomConstants.ClassName.Row);\n }\n return element;\n }\n}\n","import { ComponentItemConfig, ItemConfig, RowOrColumnItemConfig, StackItemConfig } from '../config/config';\nimport { ResolvedComponentItemConfig, ResolvedGroundItemConfig, ResolvedHeaderedItemConfig, ResolvedItemConfig, ResolvedRootItemConfig, ResolvedStackItemConfig } from '../config/resolved-config';\nimport { AssertError, UnexpectedNullError } from '../errors/internal-error';\nimport { LayoutManager } from '../layout-manager';\nimport { DomConstants } from '../utils/dom-constants';\nimport { AreaLinkedRect, ItemType, SizeUnitEnum } from '../utils/types';\nimport { getElementWidthAndHeight, setElementHeight, setElementWidth } from '../utils/utils';\nimport { ComponentItem } from './component-item';\nimport { ComponentParentableItem } from './component-parentable-item';\nimport { ContentItem } from './content-item';\nimport { RowOrColumn } from './row-or-column';\n\n/**\n * GroundItem is the ContentItem whose one child is the root ContentItem (Root is planted in Ground).\n * (Previously it was called root however this was incorrect as its child is the root item)\n * There is only one instance of GroundItem and it is automatically created by the Layout Manager\n * @internal\n */\nexport class GroundItem extends ComponentParentableItem {\n private readonly _childElementContainer: HTMLElement;\n private readonly _containerElement: HTMLElement;\n\n constructor(layoutManager: LayoutManager, rootItemConfig: ResolvedRootItemConfig | undefined, containerElement: HTMLElement) {\n\n super(layoutManager, ResolvedGroundItemConfig.create(rootItemConfig), null, GroundItem.createElement(document));\n\n this.isGround = true;\n this._childElementContainer = this.element;\n this._containerElement = containerElement;\n\n // insert before any pre-existing content elements\n let before = null;\n while (true) {\n const prev: ChildNode | null =\n before ? before.previousSibling : this._containerElement.lastChild;\n if (prev instanceof Element\n && prev.classList.contains(DomConstants.ClassName.Content)) {\n before = prev;\n } else {\n break;\n }\n }\n this._containerElement.insertBefore(this.element, before);\n }\n\n override init(): void {\n if (this.isInitialised === true) return;\n\n this.updateNodeSize();\n\n for (let i = 0; i < this.contentItems.length; i++) {\n this._childElementContainer.appendChild(this.contentItems[i].element);\n }\n\n super.init();\n\n this.initContentItems();\n }\n\n /**\n * Loads a new Layout\n * Internal only. To load a new layout with API, use {@link (LayoutManager:class).loadLayout}\n */\n loadRoot(rootItemConfig: ResolvedRootItemConfig | undefined): void {\n // Remove existing root if it exists\n this.clearRoot();\n\n if (rootItemConfig !== undefined) {\n const rootContentItem = this.layoutManager.createAndInitContentItem(rootItemConfig, this);\n this.addChild(rootContentItem, 0);\n }\n }\n\n clearRoot(): void {\n // Remove existing root if it exists\n const contentItems = this.contentItems;\n switch (contentItems.length) {\n case 0: {\n return;\n }\n case 1: {\n const existingRootContentItem = contentItems[0];\n existingRootContentItem.remove();\n return;\n }\n default: {\n throw new AssertError('GILR07721');\n }\n }\n }\n\n /**\n * Adds a ContentItem child to root ContentItem.\n * Internal only. To load a add with API, use {@link (LayoutManager:class).addItem}\n * @returns -1 if added as root otherwise index in root ContentItem's content\n */\n addItem(itemConfig: RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig,\n index?: number\n ): number {\n this.layoutManager.checkMinimiseMaximisedStack();\n\n const resolvedItemConfig = ItemConfig.resolve(itemConfig, false);\n let parent: ContentItem;\n if (this.contentItems.length > 0) {\n parent = this.contentItems[0];\n } else {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n parent = this;\n }\n if (parent.isComponent) {\n throw new Error('Cannot add item as child to ComponentItem');\n } else {\n const contentItem = this.layoutManager.createAndInitContentItem(resolvedItemConfig, parent);\n index = parent.addChild(contentItem, index);\n return (parent === this) ? -1 : index;\n }\n }\n\n loadComponentAsRoot(itemConfig: ComponentItemConfig): void {\n // Remove existing root if it exists\n this.clearRoot();\n\n const resolvedItemConfig = ItemConfig.resolve(itemConfig, false) as ResolvedComponentItemConfig;\n\n if (resolvedItemConfig.maximised) {\n throw new Error('Root Component cannot be maximised');\n } else {\n const rootContentItem = new ComponentItem(this.layoutManager, resolvedItemConfig, this);\n rootContentItem.init();\n this.addChild(rootContentItem, 0);\n }\n }\n\n /**\n * Adds a Root ContentItem.\n * Internal only. To replace Root ContentItem with API, use {@link (LayoutManager:class).loadLayout}\n */\n override addChild(contentItem: ContentItem, index?: number): number {\n if (this.contentItems.length > 0) {\n throw new Error('Ground node can only have a single child');\n } else {\n // contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);\n this._childElementContainer.appendChild(contentItem.element);\n index = super.addChild(contentItem, index);\n\n this.updateSize(false);\n this.emitBaseBubblingEvent('stateChanged');\n\n return index;\n }\n }\n\n /** @internal */\n override calculateConfigContent(): ResolvedRootItemConfig[] {\n const contentItems = this.contentItems;\n const count = contentItems.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const item = contentItems[i];\n const itemConfig = item.toConfig();\n if (ResolvedRootItemConfig.isRootItemConfig(itemConfig)) {\n result[i] = itemConfig;\n } else {\n throw new AssertError('RCCC66832');\n }\n }\n return result;\n }\n\n /** @internal */\n setSize(width: number, height: number): void {\n if (width === undefined || height === undefined) {\n this.updateSize(false); // For backwards compatibility with v1.x API\n } else {\n setElementWidth(this.element, width);\n setElementHeight(this.element, height);\n\n // GroundItem can be empty\n if (this.contentItems.length > 0) {\n setElementWidth(this.contentItems[0].element, width);\n setElementHeight(this.contentItems[0].element, height);\n }\n\n this.updateContentItemsSize(false);\n }\n }\n\n /**\n * Adds a Root ContentItem.\n * Internal only. To replace Root ContentItem with API, use {@link (LayoutManager:class).updateRootSize}\n */\n override updateSize(force: boolean): void {\n this.layoutManager.beginVirtualSizedContainerAdding();\n try {\n this.updateNodeSize();\n this.updateContentItemsSize(force);\n } finally {\n this.layoutManager.endVirtualSizedContainerAdding();\n }\n }\n\n createSideAreas(): GroundItem.Area[] {\n const areaSize = 50;\n\n const oppositeSides = GroundItem.Area.oppositeSides;\n const result = new Array(Object.keys(oppositeSides).length);\n let idx = 0;\n\n for (const key in oppositeSides) {\n const side = key as keyof GroundItem.Area.Sides;\n const area = this.getElementArea() as GroundItem.Area;\n if (area === null) {\n throw new UnexpectedNullError('RCSA77553');\n } else {\n area.side = side;\n if (oppositeSides[side][1] === '2' )\n area[side] = area[oppositeSides[side]] - areaSize;\n else\n area[side] = area[oppositeSides[side]] + areaSize;\n area.surface = (area.x2 - area.x1) * (area.y2 - area.y1);\n result[idx++] = area;\n }\n }\n\n return result;\n }\n\n override highlightDropZone(x: number, y: number, area: AreaLinkedRect): void {\n this.layoutManager.tabDropPlaceholder.remove();\n super.highlightDropZone(x, y, area);\n }\n\n override onDrop(contentItem: ContentItem, area: GroundItem.Area): void {\n\n if (contentItem.isComponent) {\n const itemConfig = ResolvedStackItemConfig.createDefault();\n // since ResolvedItemConfig.contentItems not set up, we need to add header from Component\n const component = contentItem as ComponentItem;\n itemConfig.header = ResolvedHeaderedItemConfig.Header.createCopy(component.headerConfig);\n const stack = this.layoutManager.createAndInitContentItem(itemConfig, this);\n stack.addChild(contentItem);\n contentItem = stack;\n }\n\n if (this.contentItems.length === 0) {\n this.addChild(contentItem);\n } else {\n /*\n * If the contentItem that's being dropped is not dropped on a Stack (cases which just passed above and\n * which would wrap the contentItem in a Stack) we need to check whether contentItem is a RowOrColumn.\n * If it is, we need to re-wrap it in a Stack like it was when it was dragged by its Tab (it was dragged!).\n */\n if(contentItem.type === ItemType.row || contentItem.type === ItemType.column){\n const itemConfig = ResolvedStackItemConfig.createDefault();\n const stack = this.layoutManager.createContentItem(itemConfig, this);\n stack.addChild(contentItem)\n contentItem = stack\n }\n\n const type = area.side[0] == 'x' ? ItemType.row : ItemType.column;\n const insertBefore = area.side[1] == '2';\n const column = this.contentItems[0];\n if (!(column instanceof RowOrColumn) || column.type !== type) {\n const itemConfig = ResolvedItemConfig.createDefault(type);\n const rowOrColumn = this.layoutManager.createContentItem(itemConfig, this);\n this.replaceChild(column, rowOrColumn);\n rowOrColumn.addChild(contentItem, insertBefore ? 0 : undefined, true);\n rowOrColumn.addChild(column, insertBefore ? undefined : 0, true);\n column.size = 50;\n contentItem.size = 50;\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n rowOrColumn.updateSize(false);\n } else {\n const sibling = column.contentItems[insertBefore ? 0 : column.contentItems.length - 1]\n column.addChild(contentItem, insertBefore ? 0 : undefined, true);\n sibling.size *= 0.5;\n contentItem.size = sibling.size;\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n column.updateSize(false);\n }\n }\n }\n\n // No ContentItem can dock with groundItem. However Stack can have a GroundItem parent and Stack requires that\n // its parent implement dock() function. Accordingly this function is implemented but throws an exception as it should\n // never be called\n dock(): void {\n throw new AssertError('GID87731');\n }\n\n // No ContentItem can dock with groundItem. However Stack can have a GroundItem parent and Stack requires that\n // its parent implement validateDocking() function. Accordingly this function is implemented but throws an exception as it should\n // never be called\n validateDocking(): void {\n throw new AssertError('GIVD87732');\n }\n\n getAllContentItems(): ContentItem[] {\n const result: ContentItem[] = [this];\n this.deepGetAllContentItems(this.contentItems, result);\n return result;\n }\n\n getConfigMaximisedItems(): ContentItem[] {\n const result: ContentItem[] = [];\n this.deepFilterContentItems(this.contentItems, result, (item) => {\n if (ContentItem.isStack(item) && item.initialWantMaximise) {\n return true;\n } else {\n if (ContentItem.isComponentItem(item) && item.initialWantMaximise) {\n return true;\n } else {\n return false;\n }\n }\n });\n\n return result;\n }\n\n getItemsByPopInParentId(popInParentId: string): ContentItem[] {\n const result: ContentItem[] = [];\n this.deepFilterContentItems(this.contentItems, result, (item) => item.popInParentIds.includes(popInParentId));\n return result;\n }\n\n toConfig(): ResolvedItemConfig {\n throw new Error('Cannot generate GroundItem config');\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setActiveComponentItem(item: ComponentItem, focus: boolean, suppressFocusEvent: boolean): void {\n // only applicable if ComponentItem is root and then it always has focus\n }\n\n private updateNodeSize(): void {\n const { width, height } = getElementWidthAndHeight(this._containerElement);\n\n setElementWidth(this.element, width);\n setElementHeight(this.element, height);\n\n /*\n * GroundItem can be empty\n */\n if (this.contentItems.length > 0) {\n setElementWidth(this.contentItems[0].element, width);\n setElementHeight(this.contentItems[0].element, height);\n }\n }\n\n private deepGetAllContentItems(content: readonly ContentItem[], result: ContentItem[]): void {\n for (let i = 0; i < content.length; i++) {\n const contentItem = content[i];\n result.push(contentItem);\n this.deepGetAllContentItems(contentItem.contentItems, result);\n }\n }\n\n private deepFilterContentItems(content: readonly ContentItem[], result: ContentItem[],\n checkAcceptFtn: ((this: void, item: ContentItem) => boolean)\n ): void {\n for (let i = 0; i < content.length; i++) {\n const contentItem = content[i];\n if (checkAcceptFtn(contentItem)) {\n result.push(contentItem);\n }\n this.deepFilterContentItems(contentItem.contentItems, result, checkAcceptFtn);\n }\n }\n\n}\n\n/** @internal */\nexport namespace GroundItem {\n export interface Area extends ContentItem.Area {\n side: keyof typeof Area.Side;\n }\n\n export namespace Area {\n export const enum Side {\n y2,\n x2,\n y1,\n x1,\n }\n\n export type Sides = { [side in keyof typeof Side]: keyof typeof Side; }\n\n export const oppositeSides: Sides = {\n y2: 'y1',\n x2: 'x1',\n y1: 'y2',\n x1: 'x2',\n };\n }\n\n export function createElement(document: Document): HTMLDivElement {\n const element = document.createElement('div');\n element.classList.add(DomConstants.ClassName.GoldenLayout);\n element.classList.add(DomConstants.ClassName.Item);\n element.classList.add(DomConstants.ClassName.Root);\n return element;\n }\n}\n","import { ComponentItemConfig as ConfigComponentItemConfig } from '../config/config'; // remove alias in version 3\nimport { ResolvedRowOrColumnItemConfig } from \"../config/resolved-config\";\nimport { UnexpectedNullError } from '../errors/internal-error';\nimport { ComponentItem } from '../items/component-item';\nimport { GroundItem } from '../items/ground-item';\nimport { LayoutManager } from '../layout-manager';\nimport { DragListener } from '../utils/drag-listener';\nimport { JsonValue } from '../utils/types';\nimport { DragProxy } from './drag-proxy';\n\n/**\n * Allows for any DOM item to create a component on drag\n * start to be dragged into the Layout\n * @public\n */\nexport class DragSource {\n /** @internal */\n private _dragListener: DragListener | null;\n /** @internal */\n private _dummyGroundContainer: HTMLElement;\n /** @internal */\n private _dummyGroundContentItem: GroundItem;\n\n /** @internal */\n constructor(\n /** @internal */\n private _layoutManager: LayoutManager,\n /** @internal */\n private readonly _element: HTMLElement,\n /** @internal */\n private readonly _extraAllowableChildTargets: HTMLElement[],\n /** @internal @deprecated replace with componentItemConfigOrFtn in version 3 */\n private _componentTypeOrFtn: JsonValue | (() => (DragSource.ComponentItemConfig | ConfigComponentItemConfig)),\n /** @internal @deprecated remove in version 3 */\n private _componentState: JsonValue | undefined,\n /** @internal @deprecated remove in version 3 */\n private _title: string | undefined,\n /** @internal @deprecated remove in version 3 */\n private _id: string | undefined\n ) {\n this._dragListener = null;\n\n this._dummyGroundContainer = document.createElement('div');\n\n const dummyRootItemConfig = ResolvedRowOrColumnItemConfig.createDefault('row');\n this._dummyGroundContentItem = new GroundItem(this._layoutManager, dummyRootItemConfig, this._dummyGroundContainer);\n\n this.createDragListener();\n }\n\n\t/**\n\t * Disposes of the drag listeners so the drag source is not usable any more.\n * @internal\n\t */\n\tdestroy(): void {\n\t\tthis.removeDragListener();\n }\n\n /**\n * Called initially and after every drag\n * @internal\n */\n private createDragListener() {\n this.removeDragListener();\n\n this._dragListener = new DragListener(this._element, this._extraAllowableChildTargets);\n this._dragListener.on('dragStart', (x, y) => this.onDragStart(x, y));\n this._dragListener.on('dragStop', () => this.onDragStop());\n }\n\n /**\n * Callback for the DragListener's dragStart event\n *\n * @param x - The x position of the mouse on dragStart\n * @param y - The x position of the mouse on dragStart\n * @internal\n */\n private onDragStart(x: number, y: number) {\n const type = 'component';\n let dragSourceItemConfig: ConfigComponentItemConfig;\n\n if (typeof this._componentTypeOrFtn === \"function\") {\n const ftnDragSourceItemConfig = this._componentTypeOrFtn() as (DragSource.ComponentItemConfig | ConfigComponentItemConfig);\n // If the componentType property exists, then it is already a ComponentItemConfig so nothing to do\n if (DragSource.isDragSourceComponentItemConfig(ftnDragSourceItemConfig)) {\n dragSourceItemConfig = {\n type,\n componentState: ftnDragSourceItemConfig.state,\n componentType: ftnDragSourceItemConfig.type,\n title: ftnDragSourceItemConfig.title ?? this._title,\n };\n } else {\n dragSourceItemConfig = ftnDragSourceItemConfig;\n }\n } else {\n dragSourceItemConfig = {\n type,\n componentState: this._componentState,\n componentType: this._componentTypeOrFtn,\n title: this._title,\n id: this._id,\n };\n }\n\n // Create a dummy ContentItem only for drag purposes\n // All ContentItems (except for GroundItem) need a parent. When dragging, the parent is not used.\n // Instead of allowing null parents (as Javascript version did), use a temporary dummy GroundItem parent and add ContentItem to that\n // If this does not work, need to create alternative GroundItem class\n\n const resolvedItemConfig = ConfigComponentItemConfig.resolve(dragSourceItemConfig, false);\n\n const componentItem = new ComponentItem(this._layoutManager, resolvedItemConfig, this._dummyGroundContentItem)\n this._dummyGroundContentItem.contentItems.push(componentItem);\n\n if (this._dragListener === null) {\n throw new UnexpectedNullError('DSODSD66746');\n } else {\n const dragProxy = new DragProxy(x, y, this._dragListener, this._layoutManager, componentItem , this._dummyGroundContentItem);\n\n const transitionIndicator = this._layoutManager.transitionIndicator;\n if (transitionIndicator === null) {\n throw new UnexpectedNullError('DSODST66746');\n } else {\n transitionIndicator.transitionElements(this._element, dragProxy.element);\n }\n }\n }\n\n /** @internal */\n private onDragStop() {\n // if (this._dummyGroundContentItem === undefined) {\n // throw new UnexpectedUndefinedError('DSODSDRU08116');\n // } else {\n // this._dummyGroundContentItem._$destroy\n // this._dummyGroundContentItem = undefined;\n // }\n this.createDragListener();\n }\n\n /**\n\t * Called after every drag and when the drag source is being disposed of.\n * @internal\n\t */\n\tprivate removeDragListener() {\n\t\tif (this._dragListener !== null ) {\n this._dragListener.destroy();\n this._dragListener = null;\n\t\t}\n\t}\n}\n\n/** @public */\nexport namespace DragSource {\n /** @deprecated use Config {@link (ComponentItemConfig:interface)} */\n export interface ComponentItemConfig {\n type: JsonValue,\n state?: JsonValue,\n title?: string,\n }\n\n /** @deprecated remove in version 3 */\n export function isDragSourceComponentItemConfig(\n config: DragSource.ComponentItemConfig | ConfigComponentItemConfig\n ): config is DragSource.ComponentItemConfig {\n return !(\"componentType\" in config);\n }\n}\n","import { DomConstants } from '../utils/dom-constants';\nimport { AreaLinkedRect } from '../utils/types';\nimport { numberToPixels, setElementDisplayVisibility } from '../utils/utils';\n\n/** @internal */\nexport class DropTargetIndicator {\n private _element: HTMLElement;\n\n constructor() {\n // Maybe use container instead of Document Body?\n this._element = document.createElement('div');\n this._element.classList.add(DomConstants.ClassName.DropTargetIndicator);\n const innerElement = document.createElement('div');\n innerElement.classList.add(DomConstants.ClassName.Inner);\n this._element.appendChild(innerElement);\n\n document.body.appendChild(this._element);\n }\n\n destroy(): void {\n this._element.remove();\n }\n\n highlightArea(area: AreaLinkedRect, margin: number): void {\n this._element.style.left = numberToPixels(area.x1 + margin);\n this._element.style.top = numberToPixels(area.y1 + margin);\n this._element.style.width = numberToPixels(area.x2 - area.x1 - margin);\n this._element.style.height = numberToPixels(area.y2 - area.y1 - margin);\n this._element.style.display = 'block';\n }\n\n hide(): void {\n setElementDisplayVisibility(this._element, false);\n }\n}\n","import { DomConstants } from '../utils/dom-constants';\nimport { Rect } from '../utils/types';\n\n/** @internal @deprecated To be removed */\nexport class TransitionIndicator {\n private _element: HTMLElement;\n private _toElement: HTMLElement | null;\n private _fromDimensions: null;\n private _totalAnimationDuration: number;\n private _animationStartTime: number | null;\n\n constructor() {\n this._element = document.createElement('div');\n this._element.classList.add(DomConstants.ClassName.TransitionIndicator);\n document.body.appendChild(this._element);\n\n this._toElement = null;\n this._fromDimensions = null;\n this._totalAnimationDuration = 200;\n this._animationStartTime = null;\n }\n\n destroy(): void {\n this._element.remove();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n transitionElements(fromElement: HTMLElement, toElement: HTMLElement): void {\n /**\n * TODO - This is not quite as cool as expected. Review.\n */\n return;\n // this._toElement = toElement;\n // this._animationStartTime = now();\n // this._fromDimensions = this._measure(fromElement);\n // this._fromDimensions.opacity = 0.8;\n // this._element.show().css(this._fromDimensions);\n // animFrame(fnBind(this._nextAnimationFrame, this));\n }\n\n private nextAnimationFrame(): void {\n // if (this._toElement === null || this._fromDimensions === null || this._animationStartTime === null) {\n // throw new UnexpectedNullError('TINAFTD97115');\n // } else {\n // const toDimensions = this.measure(this._toElement);\n // const animationProgress = (now() - this._animationStartTime) / this._totalAnimationDuration;\n // const currentFrameStyles = {};\n // const cssProperty;\n\n // if (animationProgress >= 1) {\n // this._element.style.display = 'none';\n // return;\n // }\n\n // toDimensions.opacity = 0;\n\n // for (const cssProperty in this._fromDimensions) {\n // currentFrameStyles[cssProperty] = this._fromDimensions[cssProperty] +\n // (toDimensions[cssProperty] - this._fromDimensions[cssProperty]) *\n // animationProgress;\n // }\n\n // this._element.css(currentFrameStyles);\n // animFrame(fnBind(this._nextAnimationFrame, this));\n // }\n }\n\n private measure(element: HTMLElement): Rect {\n const rect = element.getBoundingClientRect();\n\n return {\n left: rect.left,\n top: rect.top,\n width: element.offsetWidth,\n height: element.offsetHeight,\n };\n }\n}\n","import { UnexpectedNullError } from '../errors/internal-error';\nimport { LayoutManager } from '../layout-manager';\nimport { EventEmitter } from './event-emitter';\n\n// Add our ChildEvent to WindowEventMap for type safety\n/** @public */\ndeclare global {\n interface WindowEventMap {\n [EventHub.ChildEventName]: CustomEvent;\n }\n}\n\n/**\n * An EventEmitter singleton that propagates events\n * across multiple windows. This is a little bit trickier since\n * windows are allowed to open childWindows in their own right.\n *\n * This means that we deal with a tree of windows. Therefore, we do the event propagation in two phases:\n *\n * - Propagate events from this layout to the parent layout\n * - Repeat until the event arrived at the root layout\n * - Propagate events to this layout and to all children\n * - Repeat until all layouts got the event\n *\n * **WARNING**: Only userBroadcast events are propagated between windows.\n * This means the you have to take care of propagating state changes between windows yourself.\n *\n * @public\n */\nexport class EventHub extends EventEmitter {\n\n /** @internal */\n private _childEventListener = (childEvent: CustomEvent) => this.onEventFromChild(childEvent);\n\n /**\n * Creates a new EventHub instance\n * @param _layoutManager - the layout manager to synchronize between the windows\n * @internal\n */\n constructor(\n /** @internal */\n private _layoutManager: LayoutManager\n ) {\n super();\n globalThis.addEventListener(EventHub.ChildEventName, this._childEventListener, { passive: true });\n }\n\n /**\n * Emit an event and notify listeners\n *\n * @param eventName - The name of the event\n * @param args - Additional arguments that will be passed to the listener\n * @public\n */\n override emit(eventName: K, ...args: EventEmitter.EventParamsMap[K]): void {\n if (eventName === 'userBroadcast') {\n // Explicitly redirect the user broadcast to our overridden method.\n this.emitUserBroadcast(...args);\n } else {\n super.emit(eventName, ...args);\n }\n }\n\n /**\n * Broadcasts a message to all other currently opened windows.\n * @public\n */\n emitUserBroadcast(...args: EventEmitter.UnknownParams): void {\n // Step 1: Bubble up the event\n this.handleUserBroadcastEvent('userBroadcast', args);\n }\n\n /**\n * Destroys the EventHub\n * @internal\n */\n destroy(): void {\n globalThis.removeEventListener(EventHub.ChildEventName, this._childEventListener);\n }\n\n /**\n * Internal processor to process local events.\n * @internal\n */\n private handleUserBroadcastEvent(eventName: string, args: unknown[]) {\n if (this._layoutManager.isSubWindow) {\n // We are a sub window and received an event from one of our children.\n // So propagate it to the Root.\n this.propagateToParent(eventName, args);\n } else {\n // We are the root window, propagate it to the subtree below us.\n this.propagateToThisAndSubtree(eventName, args);\n }\n }\n\n /**\n * Callback for child events raised on the window\n * @internal\n */\n private onEventFromChild(event: CustomEvent) {\n const detail = event.detail;\n this.handleUserBroadcastEvent(detail.eventName, detail.args);\n }\n\n /**\n * Propagates the event to the parent by emitting\n * it on the parent's DOM window\n * @internal\n */\n private propagateToParent(eventName: string, args: unknown[]) {\n const detail: EventHub.ChildEventDetail = {\n layoutManager: this._layoutManager,\n eventName,\n args: args,\n }\n\n const eventInit: EventHub.ChildEventInit = {\n bubbles: true,\n cancelable: true,\n detail,\n };\n\n const event = new CustomEvent(EventHub.ChildEventName, eventInit);\n const opener = globalThis.opener;\n if (opener === null) {\n throw new UnexpectedNullError('EHPTP15778')\n }\n\n opener.dispatchEvent(event);\n }\n\n /**\n * Propagate events to the whole subtree under this event hub.\n * @internal\n */\n private propagateToThisAndSubtree(eventName: string, args: unknown[]) {\n this.emitUnknown(eventName, ...args);\n for (let i = 0; i < this._layoutManager.openPopouts.length; i++) {\n const childGl = this._layoutManager.openPopouts[i].getGlInstance();\n\n if (childGl) {\n childGl.eventHub.propagateToThisAndSubtree(eventName, args);\n }\n }\n }\n}\n\n/** @public */\nexport namespace EventHub {\n\n /** @internal */\n export const ChildEventName = 'gl_child_event';\n\n /** @internal */\n export type ChildEventDetail = {\n layoutManager: LayoutManager;\n eventName: string;\n args: unknown[];\n };\n\n /** @internal */\n export type ChildEventInit = CustomEventInit;\n}\n","import { ComponentItemConfig, ItemConfig, LayoutConfig, RowOrColumnItemConfig, StackItemConfig } from './config/config';\nimport {\n ResolvedComponentItemConfig,\n ResolvedItemConfig,\n ResolvedLayoutConfig,\n ResolvedPopoutLayoutConfig,\n ResolvedRootItemConfig,\n ResolvedRowOrColumnItemConfig,\n ResolvedStackItemConfig\n} from \"./config/resolved-config\";\nimport { ComponentContainer } from './container/component-container';\nimport { BrowserPopout } from './controls/browser-popout';\nimport { DragProxy } from './controls/drag-proxy';\nimport { DragSource } from './controls/drag-source';\nimport { DropTargetIndicator } from './controls/drop-target-indicator';\nimport { TransitionIndicator } from './controls/transition-indicator';\nimport { ConfigurationError } from './errors/external-error';\nimport { AssertError, UnexpectedNullError, UnexpectedUndefinedError, UnreachableCaseError } from './errors/internal-error';\nimport { ComponentItem } from './items/component-item';\nimport { ComponentParentableItem } from './items/component-parentable-item';\nimport { ContentItem } from './items/content-item';\nimport { GroundItem } from './items/ground-item';\nimport { RowOrColumn } from './items/row-or-column';\nimport { Stack } from './items/stack';\nimport { ConfigMinifier } from './utils/config-minifier';\nimport { DomConstants } from './utils/dom-constants';\nimport { DragListener } from './utils/drag-listener';\nimport { EventEmitter } from './utils/event-emitter';\nimport { EventHub } from './utils/event-hub';\nimport { I18nStringId, I18nStrings, i18nStrings } from './utils/i18n-strings';\nimport { ItemType, JsonValue, Rect, ResponsiveMode } from './utils/types';\nimport {\n getElementWidthAndHeight,\n removeFromArray,\n setElementHeight,\n setElementWidth\n} from './utils/utils';\n\n/** @internal */\ndeclare global {\n interface Window {\n __glInstance: LayoutManager;\n }\n}\n\n/**\n * The main class that will be exposed as GoldenLayout.\n */\n\n/** @public */\nexport abstract class LayoutManager extends EventEmitter {\n /** Whether the layout will be automatically be resized to container whenever the container's size is changed\n * Default is true if is the container otherwise false\n * Default will be changed to true for any container in the future\n */\n resizeWithContainerAutomatically = false;\n /** The debounce interval (in milliseconds) used whenever a layout is automatically resized. 0 means next tick */\n resizeDebounceInterval = 100;\n /** Extend the current debounce delay time period if it is triggered during the delay.\n * If this is true, the layout will only resize when its container has stopped being resized.\n * If it is false, the layout will resize at intervals while its container is being resized.\n */\n resizeDebounceExtendedWhenPossible = true;\n\n /** @internal */\n private _containerElement: HTMLElement;\n /** @internal */\n private _isInitialised = false;\n /** @internal */\n private _groundItem: GroundItem | undefined = undefined;\n /** @internal */\n private _openPopouts: BrowserPopout[] = [];\n /** @internal */\n private _dropTargetIndicator: DropTargetIndicator | null = null;\n /** @internal */\n private _transitionIndicator: TransitionIndicator | null = null;\n /** @internal */\n private _resizeTimeoutId: ReturnType | undefined;\n /** @internal */\n private _itemAreas: ContentItem.Area[] = [];\n /** @internal */\n private _maximisedStack: Stack | undefined;\n /** @internal */\n private _maximisePlaceholder = LayoutManager.createMaximisePlaceElement(document);\n /** @internal */\n private _tabDropPlaceholder = LayoutManager.createTabDropPlaceholderElement(document);\n /** @internal */\n private _dragSources: DragSource[] = [];\n /** @internal */\n private _updatingColumnsResponsive = false;\n /** @internal */\n private _firstLoad = true;\n /** @internal */\n private _eventHub = new EventHub(this);\n /** @internal */\n private _width: number | null = null;\n /** @internal */\n private _height: number | null = null;\n /** @internal */\n private _focusedComponentItem: ComponentItem | undefined;\n /** @internal */\n private _virtualSizedContainers: ComponentContainer[] = [];\n /** @internal */\n private _virtualSizedContainerAddingBeginCount = 0;\n /** @internal */\n private _sizeInvalidationBeginCount = 0;\n /** @internal */\n protected _constructorOrSubWindowLayoutConfig: LayoutConfig | undefined; // protected for backwards compatibility\n\n /** @internal */\n private _resizeObserver = new ResizeObserver(() => this.handleContainerResize());\n /** @internal @deprecated to be removed in version 3 */\n private _windowBeforeUnloadListener = () => this.onBeforeUnload();\n /** @internal @deprecated to be removed in version 3 */\n private _windowBeforeUnloadListening = false;\n /** @internal */\n private _maximisedStackBeforeDestroyedListener = (ev: EventEmitter.BubblingEvent) => this.cleanupBeforeMaximisedStackDestroyed(ev);\n\n readonly isSubWindow: boolean;\n layoutConfig: ResolvedLayoutConfig;\n\n beforeVirtualRectingEvent: LayoutManager.BeforeVirtualRectingEvent | undefined;\n afterVirtualRectingEvent: LayoutManager.AfterVirtualRectingEvent | undefined;\n\n get container(): HTMLElement { return this._containerElement; }\n get isInitialised(): boolean { return this._isInitialised; }\n /** @internal */\n get groundItem(): GroundItem | undefined { return this._groundItem; }\n /** @internal @deprecated use {@link (LayoutManager:class).groundItem} instead */\n get root(): GroundItem | undefined { return this._groundItem; }\n get openPopouts(): BrowserPopout[] { return this._openPopouts; }\n /** @internal */\n get dropTargetIndicator(): DropTargetIndicator | null { return this._dropTargetIndicator; }\n /** @internal @deprecated To be removed */\n get transitionIndicator(): TransitionIndicator | null { return this._transitionIndicator; }\n get width(): number | null { return this._width; }\n get height(): number | null { return this._height; }\n /**\n * Retrieves the {@link (EventHub:class)} instance associated with this layout manager.\n * This can be used to propagate events between the windows\n * @public\n */\n get eventHub(): EventHub { return this._eventHub; }\n get rootItem(): ContentItem | undefined {\n if (this._groundItem === undefined) {\n throw new Error('Cannot access rootItem before init');\n } else {\n const groundContentItems = this._groundItem.contentItems;\n if (groundContentItems.length === 0) {\n return undefined;\n } else {\n return this._groundItem.contentItems[0];\n }\n }\n }\n get focusedComponentItem(): ComponentItem | undefined { return this._focusedComponentItem; }\n /** @internal */\n get tabDropPlaceholder(): HTMLElement { return this._tabDropPlaceholder; }\n get maximisedStack(): Stack | undefined { return this._maximisedStack; }\n\n /** @deprecated indicates deprecated constructor use */\n get deprecatedConstructor(): boolean { return !this.isSubWindow && this._constructorOrSubWindowLayoutConfig !== undefined; }\n\n\n /**\n * @param container - A Dom HTML element. Defaults to body\n * @internal\n */\n constructor(parameters: LayoutManager.ConstructorParameters) {\n super();\n\n this.isSubWindow = parameters.isSubWindow;\n\n this._constructorOrSubWindowLayoutConfig = parameters.constructorOrSubWindowLayoutConfig;\n\n I18nStrings.checkInitialise();\n ConfigMinifier.checkInitialise();\n\n if (parameters.containerElement !== undefined) {\n this._containerElement = parameters.containerElement;\n }\n }\n\n /**\n * Destroys the LayoutManager instance itself as well as every ContentItem\n * within it. After this is called nothing should be left of the LayoutManager.\n *\n * This function only needs to be called if an application wishes to destroy the Golden Layout object while\n * a page remains loaded. When a page is unloaded, all resources claimed by Golden Layout will automatically\n * be released.\n */\n destroy(): void {\n if (this._isInitialised) {\n if (this._windowBeforeUnloadListening) {\n globalThis.removeEventListener('beforeunload', this._windowBeforeUnloadListener);\n this._windowBeforeUnloadListening = false;\n }\n\n if (this.layoutConfig.settings.closePopoutsOnUnload === true) {\n this.closeAllOpenPopouts();\n }\n\n this._resizeObserver.disconnect();\n this.checkClearResizeTimeout();\n\n if (this._groundItem !== undefined) {\n this._groundItem.destroy();\n }\n this._tabDropPlaceholder.remove();\n if (this._dropTargetIndicator !== null) {\n this._dropTargetIndicator.destroy();\n }\n if (this._transitionIndicator !== null) {\n this._transitionIndicator.destroy();\n }\n this._eventHub.destroy();\n\n for (const dragSource of this._dragSources) {\n dragSource.destroy();\n }\n this._dragSources = [];\n\n this._isInitialised = false;\n }\n }\n\n /**\n * Takes a GoldenLayout configuration object and\n * replaces its keys and values recursively with\n * one letter codes\n * @deprecated use {@link (ResolvedLayoutConfig:namespace).minifyConfig} instead\n */\n minifyConfig(config: ResolvedLayoutConfig): ResolvedLayoutConfig {\n return ResolvedLayoutConfig.minifyConfig(config);\n }\n\n /**\n * Takes a configuration Object that was previously minified\n * using minifyConfig and returns its original version\n * @deprecated use {@link (ResolvedLayoutConfig:namespace).unminifyConfig} instead\n */\n unminifyConfig(config: ResolvedLayoutConfig): ResolvedLayoutConfig {\n return ResolvedLayoutConfig.unminifyConfig(config);\n }\n\n /** @internal */\n abstract bindComponent(container: ComponentContainer, itemConfig: ResolvedComponentItemConfig): ComponentContainer.BindableComponent;\n /** @internal */\n abstract unbindComponent(container: ComponentContainer, virtual: boolean, component: ComponentContainer.Component | undefined): void;\n\n /**\n * Called from GoldenLayout class. Finishes of init\n * @internal\n */\n init(): void {\n this.setContainer();\n this._dropTargetIndicator = new DropTargetIndicator(/*this.container*/);\n this._transitionIndicator = new TransitionIndicator();\n this.updateSizeFromContainer();\n\n let subWindowRootConfig: ComponentItemConfig | undefined;\n if (this.isSubWindow) {\n if (this._constructorOrSubWindowLayoutConfig === undefined) {\n // SubWindow LayoutConfig should have been generated by constructor\n throw new UnexpectedUndefinedError('LMIU07155');\n } else {\n const root = this._constructorOrSubWindowLayoutConfig.root;\n if (root === undefined) {\n // SubWindow LayoutConfig must not be empty\n throw new AssertError('LMIC07156');\n } else {\n if (ItemConfig.isComponent(root)) {\n subWindowRootConfig = root;\n } else {\n // SubWindow LayoutConfig must have Component as Root\n throw new AssertError('LMIC07157');\n }\n }\n const resolvedLayoutConfig = LayoutConfig.resolve(this._constructorOrSubWindowLayoutConfig);\n // remove root from layoutConfig\n this.layoutConfig = {\n ...resolvedLayoutConfig,\n root: undefined,\n }\n }\n } else {\n if (this._constructorOrSubWindowLayoutConfig === undefined) {\n this.layoutConfig = ResolvedLayoutConfig.createDefault(); // will overwritten be loaded via loadLayout\n } else {\n // backwards compatibility\n this.layoutConfig = LayoutConfig.resolve(this._constructorOrSubWindowLayoutConfig);\n }\n }\n const layoutConfig = this.layoutConfig;\n this._groundItem = new GroundItem(this, layoutConfig.root, this._containerElement);\n this._groundItem.init();\n\n this.checkLoadedLayoutMaximiseItem();\n\n this._resizeObserver.observe(this._containerElement);\n this._isInitialised = true;\n this.adjustColumnsResponsive();\n this.emit('initialised');\n\n if (subWindowRootConfig !== undefined) {\n // must be SubWindow\n this.loadComponentAsRoot(subWindowRootConfig);\n }\n }\n\n /**\n * Loads a new layout\n * @param layoutConfig - New layout to be loaded\n */\n loadLayout(layoutConfig: LayoutConfig): void {\n if (!this.isInitialised) {\n // In case application not correctly using legacy constructor\n throw new Error('GoldenLayout: Need to call init() if LayoutConfig with defined root passed to constructor')\n } else {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMLL11119');\n } else {\n this.createSubWindows(); // still needs to be tested\n\n this.layoutConfig = LayoutConfig.resolve(layoutConfig);\n this._groundItem.loadRoot(this.layoutConfig.root);\n this.checkLoadedLayoutMaximiseItem();\n this.adjustColumnsResponsive();\n }\n }\n }\n\n /**\n * Creates a layout configuration object based on the the current state\n *\n * @public\n * @returns GoldenLayout configuration\n */\n saveLayout(): ResolvedLayoutConfig {\n if (this._isInitialised === false) {\n throw new Error('Can\\'t create config, layout not yet initialised');\n } else {\n\n // if (root !== undefined && !(root instanceof ContentItem)) {\n // throw new Error('Root must be a ContentItem');\n // }\n\n /*\n * Content\n */\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMTC18244');\n } else {\n const groundContent = this._groundItem.calculateConfigContent();\n\n let rootItemConfig: ResolvedRootItemConfig | undefined;\n if (groundContent.length !== 1) {\n rootItemConfig = undefined;\n } else {\n rootItemConfig = groundContent[0];\n }\n\n /*\n * Retrieve config for subwindows\n */\n this.reconcilePopoutWindows();\n const openPopouts: ResolvedPopoutLayoutConfig[] = [];\n for (let i = 0; i < this._openPopouts.length; i++) {\n openPopouts.push(this._openPopouts[i].toConfig());\n }\n\n const config: ResolvedLayoutConfig = {\n root: rootItemConfig,\n openPopouts,\n settings: ResolvedLayoutConfig.Settings.createCopy(this.layoutConfig.settings),\n dimensions: ResolvedLayoutConfig.Dimensions.createCopy(this.layoutConfig.dimensions),\n header: ResolvedLayoutConfig.Header.createCopy(this.layoutConfig.header),\n resolved: true,\n }\n\n return config;\n }\n }\n }\n\n /**\n * Removes any existing layout. Effectively, an empty layout will be loaded.\n */\n\n clear(): void {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMCL11129');\n } else {\n this._groundItem.clearRoot();\n }\n }\n\n /**\n * @deprecated Use {@link (LayoutManager:class).saveLayout}\n */\n toConfig(): ResolvedLayoutConfig {\n return this.saveLayout();\n }\n\n /**\n * Adds a new ComponentItem. Will use default location selectors to ensure a location is found and\n * component is successfully added\n * @param componentTypeName - Name of component type to be created.\n * @param state - Optional initial state to be assigned to component\n * @returns New ComponentItem created.\n */\n newComponent(componentType: JsonValue, componentState?: JsonValue, title?: string): ComponentItem {\n const componentItem = this.newComponentAtLocation(componentType, componentState, title);\n if (componentItem === undefined) {\n throw new AssertError('LMNC65588');\n } else {\n return componentItem;\n }\n }\n\n /**\n * Adds a ComponentItem at the first valid selector location.\n * @param componentTypeName - Name of component type to be created.\n * @param state - Optional initial state to be assigned to component\n * @param locationSelectors - Array of location selectors used to find location in layout where component\n * will be added. First location in array which is valid will be used. If locationSelectors is undefined,\n * {@link (LayoutManager:namespace).defaultLocationSelectors} will be used\n * @returns New ComponentItem created or undefined if no valid location selector was in array.\n */\n newComponentAtLocation(componentType: JsonValue, componentState?: JsonValue, title?: string,\n locationSelectors?: LayoutManager.LocationSelector[]\n ): ComponentItem | undefined{\n if (this._groundItem === undefined) {\n throw new Error('Cannot add component before init');\n } else {\n const location = this.addComponentAtLocation(componentType, componentState, title, locationSelectors);\n if (location === undefined) {\n return undefined;\n } else {\n const createdItem = location.parentItem.contentItems[location.index];\n if (!ContentItem.isComponentItem(createdItem)) {\n throw new AssertError('LMNC992877533');\n } else {\n return createdItem;\n }\n }\n }\n }\n\n /**\n * Adds a new ComponentItem. Will use default location selectors to ensure a location is found and\n * component is successfully added\n * @param componentType - Type of component to be created.\n * @param state - Optional initial state to be assigned to component\n * @returns Location of new ComponentItem created.\n */\n addComponent(componentType: JsonValue, componentState?: JsonValue, title?: string): LayoutManager.Location {\n const location = this.addComponentAtLocation(componentType, componentState, title);\n if (location === undefined) {\n throw new AssertError('LMAC99943');\n } else {\n return location;\n }\n }\n\n /**\n * Adds a ComponentItem at the first valid selector location.\n * @param componentType - Type of component to be created.\n * @param state - Optional initial state to be assigned to component\n * @param locationSelectors - Array of location selectors used to find determine location in layout where component\n * will be added. First location in array which is valid will be used. If undefined,\n * {@link (LayoutManager:namespace).defaultLocationSelectors} will be used.\n * @returns Location of new ComponentItem created or undefined if no valid location selector was in array.\n */\n addComponentAtLocation(componentType: JsonValue, componentState?: JsonValue, title?: string,\n locationSelectors?: readonly LayoutManager.LocationSelector[]\n ): LayoutManager.Location | undefined {\n const itemConfig: ComponentItemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n\n return this.addItemAtLocation(itemConfig, locationSelectors);\n }\n\n /**\n * Adds a new ContentItem. Will use default location selectors to ensure a location is found and\n * component is successfully added\n * @param itemConfig - ResolvedItemConfig of child to be added.\n * @returns New ContentItem created.\n */\n newItem(itemConfig: RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig): ContentItem {\n const contentItem = this.newItemAtLocation(itemConfig);\n if (contentItem === undefined) {\n throw new AssertError('LMNC65588');\n } else {\n return contentItem;\n }\n }\n\n /**\n * Adds a new child ContentItem under the root ContentItem. If a root does not exist, then create root ContentItem instead\n * @param itemConfig - ResolvedItemConfig of child to be added.\n * @param locationSelectors - Array of location selectors used to find determine location in layout where ContentItem\n * will be added. First location in array which is valid will be used. If undefined,\n * {@link (LayoutManager:namespace).defaultLocationSelectors} will be used.\n * @returns New ContentItem created or undefined if no valid location selector was in array. */\n newItemAtLocation(itemConfig: RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig,\n locationSelectors?: readonly LayoutManager.LocationSelector[]\n ): ContentItem | undefined {\n if (this._groundItem === undefined) {\n throw new Error('Cannot add component before init');\n } else {\n const location = this.addItemAtLocation(itemConfig, locationSelectors);\n if (location === undefined) {\n return undefined;\n } else {\n const createdItem = location.parentItem.contentItems[location.index];\n return createdItem;\n }\n }\n }\n\n /**\n * Adds a new ContentItem. Will use default location selectors to ensure a location is found and\n * component is successfully added.\n * @param itemConfig - ResolvedItemConfig of child to be added.\n * @returns Location of new ContentItem created. */\n addItem(itemConfig: RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig): LayoutManager.Location {\n const location = this.addItemAtLocation(itemConfig);\n if (location === undefined) {\n throw new AssertError('LMAI99943');\n } else {\n return location;\n }\n }\n\n /**\n * Adds a ContentItem at the first valid selector location.\n * @param itemConfig - ResolvedItemConfig of child to be added.\n * @param locationSelectors - Array of location selectors used to find determine location in layout where ContentItem\n * will be added. First location in array which is valid will be used. If undefined,\n * {@link (LayoutManager:namespace).defaultLocationSelectors} will be used.\n * @returns Location of new ContentItem created or undefined if no valid location selector was in array. */\n addItemAtLocation(itemConfig: RowOrColumnItemConfig | StackItemConfig | ComponentItemConfig,\n locationSelectors?: readonly LayoutManager.LocationSelector[]\n ): LayoutManager.Location | undefined {\n if (this._groundItem === undefined) {\n throw new Error('Cannot add component before init');\n } else {\n if (locationSelectors === undefined) {\n // defaultLocationSelectors should always find a location\n locationSelectors = LayoutManager.defaultLocationSelectors;\n }\n\n const location = this.findFirstLocation(locationSelectors);\n if (location === undefined) {\n return undefined;\n } else {\n let parentItem = location.parentItem;\n let addIdx: number;\n switch (parentItem.type) {\n case ItemType.ground: {\n const groundItem = parentItem as GroundItem;\n addIdx = groundItem.addItem(itemConfig, location.index);\n if (addIdx >= 0) {\n parentItem = this._groundItem.contentItems[0]; // was added to rootItem\n } else {\n addIdx = 0; // was added as rootItem (which is the first and only ContentItem in GroundItem)\n }\n break;\n }\n case ItemType.row:\n case ItemType.column: {\n const rowOrColumn = parentItem as RowOrColumn;\n addIdx = rowOrColumn.addItem(itemConfig, location.index);\n break;\n }\n case ItemType.stack: {\n if (!ItemConfig.isComponent(itemConfig)) {\n throw Error(i18nStrings[I18nStringId.ItemConfigIsNotTypeComponent]);\n } else {\n const stack = parentItem as Stack;\n addIdx = stack.addItem(itemConfig, location.index);\n break;\n }\n }\n case ItemType.component: {\n throw new AssertError('LMAIALC87444602');\n }\n default:\n throw new UnreachableCaseError('LMAIALU98881733', parentItem.type);\n }\n\n if (ItemConfig.isComponent(itemConfig)) {\n // see if stack was inserted\n const item = parentItem.contentItems[addIdx];\n if (ContentItem.isStack(item)) {\n parentItem = item;\n addIdx = 0;\n }\n }\n\n location.parentItem = parentItem;\n location.index = addIdx;\n\n return location;\n }\n }\n }\n\n /** Loads the specified component ResolvedItemConfig as root.\n * This can be used to display a Component all by itself. The layout cannot be changed other than having another new layout loaded.\n * Note that, if this layout is saved and reloaded, it will reload with the Component as a child of a Stack.\n */\n loadComponentAsRoot(itemConfig: ComponentItemConfig): void {\n if (this._groundItem === undefined) {\n throw new Error('Cannot add item before init');\n } else {\n this._groundItem.loadComponentAsRoot(itemConfig);\n }\n }\n\n /** @deprecated Use {@link (LayoutManager:class).setSize} */\n updateSize(width: number, height: number): void {\n this.setSize(width, height);\n }\n\n /**\n * Updates the layout managers size\n *\n * @param width - Width in pixels\n * @param height - Height in pixels\n */\n setSize(width: number, height: number): void {\n this._width = width;\n this._height = height;\n\n if (this._isInitialised === true) {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMUS18881');\n } else {\n this._groundItem.setSize(this._width, this._height);\n\n if (this._maximisedStack) {\n const { width, height } = getElementWidthAndHeight(this._containerElement);\n setElementWidth(this._maximisedStack.element, width);\n setElementHeight(this._maximisedStack.element, height);\n this._maximisedStack.updateSize(false);\n }\n\n this.adjustColumnsResponsive();\n }\n }\n }\n\n /** @internal */\n beginSizeInvalidation(): void {\n this._sizeInvalidationBeginCount++;\n }\n\n /** @internal */\n endSizeInvalidation(): void {\n if (--this._sizeInvalidationBeginCount === 0) {\n this.updateSizeFromContainer();\n }\n }\n\n /** @internal */\n updateSizeFromContainer(): void {\n const { width, height } = getElementWidthAndHeight(this._containerElement);\n this.setSize(width, height);\n }\n\n /**\n * Update the size of the root ContentItem. This will update the size of all contentItems in the tree\n * @param force - In some cases the size is not updated if it has not changed. In this case, events\n * (such as ComponentContainer.virtualRectingRequiredEvent) are not fired. Setting force to true, ensures the size is updated regardless, and\n * the respective events are fired. This is sometimes necessary when a component's size has not changed but it has become visible, and the\n * relevant events need to be fired.\n */\n updateRootSize(force = false): void {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMURS28881');\n } else {\n this._groundItem.updateSize(force);\n }\n }\n\n /** @public */\n createAndInitContentItem(config: ResolvedItemConfig, parent: ContentItem): ContentItem {\n const newItem = this.createContentItem(config, parent);\n newItem.init();\n return newItem;\n }\n\n /**\n * Recursively creates new item tree structures based on a provided\n * ItemConfiguration object\n *\n * @param config - ResolvedItemConfig\n * @param parent - The item the newly created item should be a child of\n * @internal\n */\n createContentItem(config: ResolvedItemConfig, parent: ContentItem): ContentItem {\n if (typeof config.type !== 'string') {\n throw new ConfigurationError('Missing parameter \\'type\\'', JSON.stringify(config));\n }\n\n /**\n * We add an additional stack around every component that's not within a stack anyways.\n */\n if (\n // If this is a component\n ResolvedItemConfig.isComponentItem(config) &&\n\n // and it's not already within a stack\n !(parent instanceof Stack) &&\n\n // and we have a parent\n !!parent &&\n\n // and it's not the topmost item in a new window\n !(this.isSubWindow === true && parent instanceof GroundItem)\n ) {\n const stackConfig: ResolvedStackItemConfig = {\n type: ItemType.stack,\n content: [config],\n size: config.size,\n sizeUnit: config.sizeUnit,\n minSize: config.minSize,\n minSizeUnit: config.minSizeUnit,\n id: config.id,\n maximised: config.maximised,\n isClosable: config.isClosable,\n activeItemIndex: 0,\n header: undefined,\n };\n\n config = stackConfig;\n }\n\n const contentItem = this.createContentItemFromConfig(config, parent);\n return contentItem;\n }\n\n findFirstComponentItemById(id: string): ComponentItem | undefined {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFFCIBI82446');\n } else {\n return this.findFirstContentItemTypeByIdRecursive(ItemType.component, id, this._groundItem) as ComponentItem;\n }\n }\n\n /**\n * Creates a popout window with the specified content at the specified position\n *\n * @param itemConfigOrContentItem - The content of the popout window's layout manager derived from either\n * a {@link (ContentItem:class)} or {@link (ItemConfig:interface)} or ResolvedItemConfig content (array of {@link (ItemConfig:interface)})\n * @param positionAndSize - The width, height, left and top of Popout window\n * @param parentId -The id of the element this item will be appended to when popIn is called\n * @param indexInParent - The position of this item within its parent element\n */\n\n createPopout(itemConfigOrContentItem: ContentItem | ResolvedRootItemConfig,\n positionAndSize: ResolvedPopoutLayoutConfig.Window,\n parentId: string | null,\n indexInParent: number | null\n ): BrowserPopout {\n if (itemConfigOrContentItem instanceof ContentItem) {\n return this.createPopoutFromContentItem(itemConfigOrContentItem, positionAndSize, parentId, indexInParent);\n } else {\n return this.createPopoutFromItemConfig(itemConfigOrContentItem, positionAndSize, parentId, indexInParent);\n }\n }\n\n /** @internal */\n createPopoutFromContentItem(item: ContentItem,\n window: ResolvedPopoutLayoutConfig.Window | undefined,\n parentId: string | null,\n indexInParent: number | null | undefined,\n ): BrowserPopout {\n /**\n * If the item is the only component within a stack or for some\n * other reason the only child of its parent the parent will be destroyed\n * when the child is removed.\n *\n * In order to support this we move up the tree until we find something\n * that will remain after the item is being popped out\n */\n let parent = item.parent;\n let child = item;\n while (parent !== null && parent.contentItems.length === 1 && !parent.isGround) {\n child = parent;\n parent = parent.parent;\n }\n\n if (parent === null) {\n throw new UnexpectedNullError('LMCPFCI00834');\n } else {\n if (indexInParent === undefined) {\n indexInParent = parent.contentItems.indexOf(child);\n }\n\n if (parentId !== null) {\n parent.addPopInParentId(parentId);\n }\n\n if (window === undefined) {\n const windowLeft = globalThis.screenX || globalThis.screenLeft;\n const windowTop = globalThis.screenY || globalThis.screenTop;\n const offsetLeft = item.element.offsetLeft;\n const offsetTop = item.element.offsetTop\n // const { left: offsetLeft, top: offsetTop } = getJQueryLeftAndTop(item.element);\n const { width, height } = getElementWidthAndHeight(item.element);\n\n window = {\n left: windowLeft + offsetLeft,\n top: windowTop + offsetTop,\n width,\n height,\n };\n }\n\n const itemConfig = item.toConfig();\n item.remove();\n\n if (!ResolvedRootItemConfig.isRootItemConfig(itemConfig)) {\n throw new Error(`${i18nStrings[I18nStringId.PopoutCannotBeCreatedWithGroundItemConfig]}`);\n } else {\n return this.createPopoutFromItemConfig(itemConfig, window, parentId, indexInParent);\n }\n }\n }\n\n /** @internal */\n beginVirtualSizedContainerAdding(): void {\n if (++this._virtualSizedContainerAddingBeginCount === 0) {\n this._virtualSizedContainers.length = 0;\n }\n }\n\n /** @internal */\n addVirtualSizedContainer(container: ComponentContainer): void {\n this._virtualSizedContainers.push(container);\n }\n\n /** @internal */\n endVirtualSizedContainerAdding(): void {\n if (--this._virtualSizedContainerAddingBeginCount === 0) {\n const count = this._virtualSizedContainers.length;\n if (count > 0) {\n this.fireBeforeVirtualRectingEvent(count);\n for (let i = 0; i < count; i++) {\n const container = this._virtualSizedContainers[i];\n container.notifyVirtualRectingRequired();\n }\n this.fireAfterVirtualRectingEvent();\n this._virtualSizedContainers.length = 0;\n }\n }\n }\n\n /** @internal */\n fireBeforeVirtualRectingEvent(count: number): void {\n if (this.beforeVirtualRectingEvent !== undefined) {\n this.beforeVirtualRectingEvent(count);\n }\n }\n\n /** @internal */\n fireAfterVirtualRectingEvent(): void {\n if (this.afterVirtualRectingEvent !== undefined) {\n this.afterVirtualRectingEvent();\n }\n }\n\n /** @internal */\n private createPopoutFromItemConfig(rootItemConfig: ResolvedRootItemConfig,\n window: ResolvedPopoutLayoutConfig.Window,\n parentId: string | null,\n indexInParent: number | null\n ) {\n const layoutConfig = this.toConfig();\n\n const popoutLayoutConfig: ResolvedPopoutLayoutConfig = {\n root: rootItemConfig,\n openPopouts: [],\n settings: layoutConfig.settings,\n dimensions: layoutConfig.dimensions,\n header: layoutConfig.header,\n window,\n parentId,\n indexInParent,\n resolved: true,\n }\n\n return this.createPopoutFromPopoutLayoutConfig(popoutLayoutConfig);\n }\n\n /** @internal */\n createPopoutFromPopoutLayoutConfig(config: ResolvedPopoutLayoutConfig): BrowserPopout {\n const configWindow = config.window;\n const initialWindow: Rect = {\n left: configWindow.left ?? (globalThis.screenX || globalThis.screenLeft + 20),\n top: configWindow.top ?? (globalThis.screenY || globalThis.screenTop + 20),\n width: configWindow.width ?? 500,\n height: configWindow.height ?? 309,\n };\n\n const browserPopout = new BrowserPopout(config, initialWindow, this);\n\n browserPopout.on('initialised', () => this.emit('windowOpened', browserPopout));\n browserPopout.on('closed', () => this.reconcilePopoutWindows());\n\n this._openPopouts.push(browserPopout);\n\n if (this.layoutConfig.settings.closePopoutsOnUnload && !this._windowBeforeUnloadListening) {\n globalThis.addEventListener('beforeunload', this._windowBeforeUnloadListener, { passive: true });\n this._windowBeforeUnloadListening = true;\n }\n\n return browserPopout;\n }\n\n /**\n * Closes all Open Popouts\n * Applications can call this method when a page is unloaded to remove its open popouts\n */\n\n closeAllOpenPopouts() {\n for (let i = 0; i < this._openPopouts.length; i++) {\n this._openPopouts[i].close();\n }\n\n this._openPopouts.length = 0;\n\n if (this._windowBeforeUnloadListening) {\n globalThis.removeEventListener('beforeunload', this._windowBeforeUnloadListener);\n this._windowBeforeUnloadListening = false;\n }\n }\n\n /**\n * Attaches DragListener to any given DOM element\n * and turns it into a way of creating new ComponentItems\n * by 'dragging' the DOM element into the layout\n *\n * @param element - The HTML element which will be listened to for commencement of drag.\n * @param componentTypeOrItemConfigCallback - Type of component to be created, or a callback which will provide the ItemConfig\n * to be used to create the component.\n * @param componentState - Optional initial state of component. This will be ignored if componentTypeOrFtn is a function.\n *\n * @returns an opaque object that identifies the DOM element\n\t * and the attached itemConfig. This can be used in\n\t * removeDragSource() later to get rid of the drag listeners.\n */\n newDragSource(element: HTMLElement, itemConfigCallback: () => (DragSource.ComponentItemConfig | ComponentItemConfig)): DragSource;\n /** @deprecated will be replaced in version 3 with newDragSource(element: HTMLElement, itemConfig: ComponentItemConfig) */\n newDragSource(element: HTMLElement, componentType: JsonValue, componentState?: JsonValue, title?: JsonValue, id?: string): DragSource;\n newDragSource(element: HTMLElement,\n componentTypeOrItemConfigCallback: JsonValue | (() => (DragSource.ComponentItemConfig | ComponentItemConfig)),\n componentState?: JsonValue,\n title?: string,\n id?: string,\n ): DragSource {\n const dragSource = new DragSource(this, element, [], componentTypeOrItemConfigCallback, componentState, title, id);\n this._dragSources.push(dragSource);\n\n return dragSource;\n }\n\n /**\n\t * Removes a DragListener added by createDragSource() so the corresponding\n\t * DOM element is not a drag source any more.\n\t */\n\tremoveDragSource(dragSource: DragSource): void {\n\t\tremoveFromArray(dragSource, this._dragSources );\n\t\tdragSource.destroy();\n }\n\n /** @internal */\n startComponentDrag(x: number, y: number, dragListener: DragListener, componentItem: ComponentItem, stack: Stack): void {\n new DragProxy(\n x,\n y,\n dragListener,\n this,\n componentItem,\n stack\n );\n }\n\n /**\n * Programmatically focuses an item. This focuses the specified component item\n * and the item emits a focus event\n *\n * @param item - The component item to be focused\n * @param suppressEvent - Whether to emit focus event\n */\n focusComponent(item: ComponentItem, suppressEvent = false): void {\n item.focus(suppressEvent);\n }\n\n /**\n * Programmatically blurs (defocuses) the currently focused component.\n * If a component item is focused, then it is blurred and and the item emits a blur event\n *\n * @param item - The component item to be blurred\n * @param suppressEvent - Whether to emit blur event\n */\n clearComponentFocus(suppressEvent = false): void {\n this.setFocusedComponentItem(undefined, suppressEvent);\n }\n\n /**\n * Programmatically focuses a component item or removes focus (blurs) from an existing focused component item.\n *\n * @param item - If defined, specifies the component item to be given focus. If undefined, clear component focus.\n * @param suppressEvents - Whether to emit focus and blur events\n * @internal\n */\n setFocusedComponentItem(item: ComponentItem | undefined, suppressEvents = false): void {\n if (item !== this._focusedComponentItem) {\n\n let newFocusedParentItem: ComponentParentableItem | undefined;\n if (item === undefined) {\n newFocusedParentItem === undefined;\n } else {\n newFocusedParentItem = item.parentItem;\n }\n\n if (this._focusedComponentItem !== undefined) {\n const oldFocusedItem = this._focusedComponentItem;\n this._focusedComponentItem = undefined;\n oldFocusedItem.setBlurred(suppressEvents);\n const oldFocusedParentItem = oldFocusedItem.parentItem;\n if (newFocusedParentItem === oldFocusedParentItem) {\n newFocusedParentItem = undefined;\n } else {\n oldFocusedParentItem.setFocusedValue(false);\n }\n }\n\n if (item !== undefined) {\n this._focusedComponentItem = item;\n item.setFocused(suppressEvents);\n if (newFocusedParentItem !== undefined) {\n newFocusedParentItem.setFocusedValue(true);\n }\n }\n }\n }\n\n /** @internal */\n private createContentItemFromConfig(config: ResolvedItemConfig, parent: ContentItem): ContentItem {\n switch (config.type) {\n case ItemType.ground: throw new AssertError('LMCCIFC68871');\n case ItemType.row: return new RowOrColumn(false, this, config as ResolvedRowOrColumnItemConfig, parent);\n case ItemType.column: return new RowOrColumn(true, this, config as ResolvedRowOrColumnItemConfig, parent);\n case ItemType.stack: return new Stack(this, config as ResolvedStackItemConfig, parent);\n case ItemType.component:\n return new ComponentItem(this, config as ResolvedComponentItemConfig, parent as Stack);\n default:\n throw new UnreachableCaseError('CCC913564', config.type, 'Invalid Config Item type specified');\n }\n }\n\n /**\n * This should only be called from stack component.\n * Stack will look after docking processing associated with maximise/minimise\n * @internal\n **/\n setMaximisedStack(stack: Stack | undefined): void {\n if (stack === undefined) {\n if (this._maximisedStack !== undefined) {\n this.processMinimiseMaximisedStack();\n }\n } else {\n if (stack !== this._maximisedStack) {\n if (this._maximisedStack !== undefined) {\n this.processMinimiseMaximisedStack();\n }\n\n this.processMaximiseStack(stack);\n }\n }\n }\n\n checkMinimiseMaximisedStack(): void {\n if (this._maximisedStack !== undefined) {\n this._maximisedStack.minimise();\n }\n }\n\n // showAllActiveContentItems() was called from ContentItem.show(). Not sure what its purpose was so have commented out\n // Everything seems to work ok without this. Have left commented code just in case there was a reason for it becomes\n // apparent\n\n // /** @internal */\n // showAllActiveContentItems(): void {\n // const allStacks = this.getAllStacks();\n\n // for (let i = 0; i < allStacks.length; i++) {\n // const stack = allStacks[i];\n // const activeContentItem = stack.getActiveComponentItem();\n\n // if (activeContentItem !== undefined) {\n // if (!(activeContentItem instanceof ComponentItem)) {\n // throw new AssertError('LMSAACIS22298');\n // } else {\n // activeContentItem.container.show();\n // }\n // }\n // }\n // }\n\n // hideAllActiveContentItems() was called from ContentItem.hide(). Not sure what its purpose was so have commented out\n // Everything seems to work ok without this. Have left commented code just in case there was a reason for it becomes\n // apparent\n\n // /** @internal */\n // hideAllActiveContentItems(): void {\n // const allStacks = this.getAllStacks();\n\n // for (let i = 0; i < allStacks.length; i++) {\n // const stack = allStacks[i];\n // const activeContentItem = stack.getActiveComponentItem();\n\n // if (activeContentItem !== undefined) {\n // if (!(activeContentItem instanceof ComponentItem)) {\n // throw new AssertError('LMSAACIH22298');\n // } else {\n // activeContentItem.container.hide();\n // }\n // }\n // }\n // }\n\n /** @internal */\n private cleanupBeforeMaximisedStackDestroyed(event: EventEmitter.BubblingEvent) {\n\t\tif (this._maximisedStack !== null && this._maximisedStack === event.target) {\n\t\t\tthis._maximisedStack.off('beforeItemDestroyed', this._maximisedStackBeforeDestroyedListener);\n\t\t\tthis._maximisedStack = undefined;\n\t\t}\n }\n\n /**\n * This method is used to get around sandboxed iframe restrictions.\n * If 'allow-top-navigation' is not specified in the iframe's 'sandbox' attribute\n * (as is the case with codepens) the parent window is forbidden from calling certain\n * methods on the child, such as window.close() or setting document.location.href.\n *\n * This prevented GoldenLayout popouts from popping in in codepens. The fix is to call\n * _$closeWindow on the child window's gl instance which (after a timeout to disconnect\n * the invoking method from the close call) closes itself.\n *\n * @internal\n */\n closeWindow(): void {\n globalThis.setTimeout(() => globalThis.close(), 1);\n }\n\n /** @internal */\n getArea(x: number, y: number): ContentItem.Area | null {\n let matchingArea = null;\n let smallestSurface = Infinity;\n\n for (let i = 0; i < this._itemAreas.length; i++) {\n const area = this._itemAreas[i];\n\n if (\n x >= area.x1 &&\n x < area.x2 && // x2 is not included in area\n y >= area.y1 &&\n y < area.y2 && // y2 is not included in area\n smallestSurface > area.surface\n ) {\n smallestSurface = area.surface;\n matchingArea = area;\n }\n }\n\n return matchingArea;\n }\n\n /** @internal */\n calculateItemAreas(): void {\n const allContentItems = this.getAllContentItems();\n /**\n * If the last item is dragged out, highlight the entire container size to\n * allow to re-drop it. this.ground.contentiItems.length === 0 at this point\n *\n * Don't include ground into the possible drop areas though otherwise since it\n * will used for every gap in the layout, e.g. splitters\n */\n const groundItem = this._groundItem;\n if (groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMCIAR44365');\n } else {\n if (allContentItems.length === 1) {\n // No root ContentItem (just Ground ContentItem)\n const groundArea = groundItem.getElementArea();\n if (groundArea === null) {\n throw new UnexpectedNullError('LMCIARA44365')\n } else {\n this._itemAreas = [groundArea];\n }\n return;\n } else {\n if (groundItem.contentItems[0].isStack) {\n // if root is Stack, then split stack and sides of Layout are same, so skip sides\n this._itemAreas = [];\n } else {\n // sides of layout\n this._itemAreas = groundItem.createSideAreas();\n }\n\n for (let i = 0; i < allContentItems.length; i++) {\n const stack = allContentItems[i];\n if (ContentItem.isStack(stack)) {\n const area = stack.getArea();\n\n if (area === null) {\n continue;\n } else {\n this._itemAreas.push(area);\n const stackContentAreaDimensions = stack.contentAreaDimensions;\n if (stackContentAreaDimensions === undefined) {\n throw new UnexpectedUndefinedError('LMCIASC45599');\n } else {\n const highlightArea = stackContentAreaDimensions.header.highlightArea\n const surface = (highlightArea.x2 - highlightArea.x1) * (highlightArea.y2 - highlightArea.y1);\n\n const header: ContentItem.Area = {\n x1: highlightArea.x1,\n x2: highlightArea.x2,\n y1: highlightArea.y1,\n y2: highlightArea.y2,\n contentItem: stack,\n surface,\n };\n this._itemAreas.push(header);\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Called as part of loading a new layout (including initial init()).\n * Checks to see layout has a maximised item. If so, it maximises that item.\n * @internal\n */\n private checkLoadedLayoutMaximiseItem() {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMCLLMI43432');\n } else {\n const configMaximisedItems = this._groundItem.getConfigMaximisedItems();\n\n if (configMaximisedItems.length > 0) {\n let item = configMaximisedItems[0];\n if (ContentItem.isComponentItem(item)) {\n const stack = item.parent;\n if (stack === null) {\n throw new UnexpectedNullError('LMXLLMI69999');\n } else {\n item = stack;\n }\n }\n if (!ContentItem.isStack(item)) {\n throw new AssertError('LMCLLMI19993');\n } else {\n item.maximise();\n }\n }\n }\n }\n\n /** @internal */\n private processMaximiseStack(stack: Stack): void {\n this._maximisedStack = stack;\n stack.on('beforeItemDestroyed', this._maximisedStackBeforeDestroyedListener);\n stack.element.classList.add(DomConstants.ClassName.Maximised);\n stack.element.insertAdjacentElement('afterend', this._maximisePlaceholder);\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMMXI19993');\n } else {\n this._groundItem.element.prepend(stack.element);\n const { width, height } = getElementWidthAndHeight(this._containerElement);\n setElementWidth(stack.element, width);\n setElementHeight(stack.element, height);\n stack.updateSize(true);\n stack.focusActiveContentItem();\n this._maximisedStack.emit('maximised');\n this.emit('stateChanged');\n }\n }\n\n /** @internal */\n private processMinimiseMaximisedStack(): void {\n if (this._maximisedStack === undefined) {\n throw new AssertError('LMMMS74422');\n } else {\n const stack = this._maximisedStack;\n if (stack.parent === null) {\n throw new UnexpectedNullError('LMMI13668');\n } else {\n stack.element.classList.remove(DomConstants.ClassName.Maximised);\n this._maximisePlaceholder.insertAdjacentElement('afterend', stack.element);\n this._maximisePlaceholder.remove();\n this.updateRootSize(true);\n this._maximisedStack = undefined;\n stack.off('beforeItemDestroyed', this._maximisedStackBeforeDestroyedListener);\n stack.emit('minimised');\n this.emit('stateChanged');\n }\n }\n }\n\n /**\n * Iterates through the array of open popout windows and removes the ones\n * that are effectively closed. This is necessary due to the lack of reliably\n * listening for window.close / unload events in a cross browser compatible fashion.\n * @internal\n */\n private reconcilePopoutWindows() {\n const openPopouts: BrowserPopout[] = [];\n\n for (let i = 0; i < this._openPopouts.length; i++) {\n if (this._openPopouts[i].getWindow().closed === false) {\n openPopouts.push(this._openPopouts[i]);\n } else {\n this.emit('windowClosed', this._openPopouts[i]);\n }\n }\n\n if (this._openPopouts.length !== openPopouts.length) {\n this._openPopouts = openPopouts;\n this.emit('stateChanged');\n }\n\n }\n\n /**\n * Returns a flattened array of all content items,\n * regardles of level or type\n * @internal\n */\n private getAllContentItems() {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMGACI13130');\n } else {\n return this._groundItem.getAllContentItems();\n }\n }\n\n /**\n * Creates Subwindows (if there are any). Throws an error\n * if popouts are blocked.\n * @internal\n */\n private createSubWindows() {\n for (let i = 0; i < this.layoutConfig.openPopouts.length; i++) {\n const popoutConfig = this.layoutConfig.openPopouts[i];\n this.createPopoutFromPopoutLayoutConfig(popoutConfig);\n }\n }\n\n /**\n * Debounces resize events\n * @internal\n */\n private handleContainerResize(): void {\n if (this.resizeWithContainerAutomatically) {\n this.processResizeWithDebounce();\n }\n }\n\n /**\n * Debounces resize events\n * @internal\n */\n private processResizeWithDebounce(): void {\n if (this.resizeDebounceExtendedWhenPossible) {\n this.checkClearResizeTimeout();\n }\n\n if (this._resizeTimeoutId === undefined) {\n this._resizeTimeoutId = setTimeout(\n () => {\n this._resizeTimeoutId = undefined;\n this.beginSizeInvalidation();\n this.endSizeInvalidation();\n },\n this.resizeDebounceInterval,\n );\n }\n }\n\n private checkClearResizeTimeout() {\n if (this._resizeTimeoutId !== undefined) {\n clearTimeout(this._resizeTimeoutId);\n this._resizeTimeoutId = undefined;\n }\n }\n\n /**\n * Determines what element the layout will be created in\n * @internal\n */\n private setContainer() {\n const bodyElement = document.body;\n const containerElement = this._containerElement ?? bodyElement;\n\n if (containerElement === bodyElement) {\n this.resizeWithContainerAutomatically = true;\n\n const documentElement = document.documentElement;\n documentElement.style.height = '100%';\n documentElement.style.margin = '0';\n documentElement.style.padding = '0';\n documentElement.style.overflow = 'clip';\n bodyElement.style.height = '100%';\n bodyElement.style.margin = '0';\n bodyElement.style.padding = '0';\n bodyElement.style.overflow = 'clip';\n }\n\n this._containerElement = containerElement;\n }\n\n /**\n * Called when the window is closed or the user navigates away\n * from the page\n * @internal\n * @deprecated to be removed in version 3\n */\n private onBeforeUnload(): void {\n this.destroy();\n }\n\n /**\n * Adjusts the number of columns to be lower to fit the screen and still maintain minItemWidth.\n * @internal\n */\n private adjustColumnsResponsive() {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMACR20883');\n } else {\n this._firstLoad = false;\n // If there is no min width set, or not content items, do nothing.\n if (this.useResponsiveLayout() &&\n !this._updatingColumnsResponsive &&\n this._groundItem.contentItems.length > 0 &&\n this._groundItem.contentItems[0].isRow)\n {\n if (this._groundItem === undefined || this._width === null) {\n throw new UnexpectedUndefinedError('LMACR77412');\n } else {\n // If there is only one column, do nothing.\n const columnCount = this._groundItem.contentItems[0].contentItems.length;\n if (columnCount <= 1) {\n return;\n } else {\n // If they all still fit, do nothing.\n const minItemWidth = this.layoutConfig.dimensions.defaultMinItemWidth;\n const totalMinWidth = columnCount * minItemWidth;\n if (totalMinWidth <= this._width) {\n return;\n } else {\n // Prevent updates while it is already happening.\n this._updatingColumnsResponsive = true;\n\n // Figure out how many columns to stack, and put them all in the first stack container.\n const finalColumnCount = Math.max(Math.floor(this._width / minItemWidth), 1);\n const stackColumnCount = columnCount - finalColumnCount;\n\n const rootContentItem = this._groundItem.contentItems[0];\n const allStacks = this.getAllStacks();\n if (allStacks.length === 0) {\n throw new AssertError('LMACRS77413')\n } else {\n const firstStackContainer = allStacks[0];\n for (let i = 0; i < stackColumnCount; i++) {\n // Stack from right.\n const column = rootContentItem.contentItems[rootContentItem.contentItems.length - 1];\n this.addChildContentItemsToContainer(firstStackContainer, column);\n }\n\n this._updatingColumnsResponsive = false;\n }\n }\n }\n }\n }\n }\n }\n\n /**\n * Determines if responsive layout should be used.\n *\n * @returns True if responsive layout should be used; otherwise false.\n * @internal\n */\n private useResponsiveLayout() {\n const settings = this.layoutConfig.settings;\n const alwaysResponsiveMode = settings.responsiveMode === ResponsiveMode.always;\n const onLoadResponsiveModeAndFirst = settings.responsiveMode === ResponsiveMode.onload && this._firstLoad;\n return alwaysResponsiveMode || onLoadResponsiveModeAndFirst;\n }\n\n /**\n * Adds all children of a node to another container recursively.\n * @param container - Container to add child content items to.\n * @param node - Node to search for content items.\n * @internal\n */\n private addChildContentItemsToContainer(container: ContentItem, node: ContentItem) {\n const contentItems = node.contentItems;\n if (node instanceof Stack) {\n for (let i = 0; i < contentItems.length; i++) {\n const item = contentItems[i];\n node.removeChild(item, true);\n container.addChild(item);\n }\n } else {\n for (let i = 0; i < contentItems.length; i++) {\n const item = contentItems[i];\n this.addChildContentItemsToContainer(container, item);\n }\n }\n }\n\n /**\n * Finds all the stacks.\n * @returns The found stack containers.\n * @internal\n */\n private getAllStacks() {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFASC52778');\n } else {\n const stacks: Stack[] = [];\n this.findAllStacksRecursive(stacks, this._groundItem);\n\n return stacks;\n }\n }\n\n /** @internal */\n private findFirstContentItemType(type: ItemType): ContentItem | undefined {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFFCIT82446');\n } else {\n return this.findFirstContentItemTypeRecursive(type, this._groundItem);\n }\n }\n\n /** @internal */\n private findFirstContentItemTypeRecursive(type: ItemType, node: ContentItem): ContentItem | undefined {\n const contentItems = node.contentItems;\n const contentItemCount = contentItems.length;\n if (contentItemCount === 0) {\n return undefined;\n } else {\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (contentItem.type === type) {\n return contentItem;\n }\n }\n\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n const foundContentItem = this.findFirstContentItemTypeRecursive(type, contentItem);\n if (foundContentItem !== undefined) {\n return foundContentItem;\n }\n }\n\n return undefined;\n }\n }\n\n /** @internal */\n private findFirstContentItemTypeByIdRecursive(type: ItemType, id: string, node: ContentItem): ContentItem | undefined {\n const contentItems = node.contentItems;\n const contentItemCount = contentItems.length;\n if (contentItemCount === 0) {\n return undefined;\n } else {\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (contentItem.type === type && contentItem.id === id) {\n return contentItem;\n }\n }\n\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n const foundContentItem = this.findFirstContentItemTypeByIdRecursive(type, id, contentItem);\n if (foundContentItem !== undefined) {\n return foundContentItem;\n }\n }\n\n return undefined;\n }\n }\n\n /**\n * Finds all the stack containers.\n *\n * @param stacks - Set of containers to populate.\n * @param node - Current node to process.\n * @internal\n */\n private findAllStacksRecursive(stacks: Stack[], node: ContentItem) {\n const contentItems = node.contentItems;\n for (let i = 0; i < contentItems.length; i++) {\n const item = contentItems[i];\n if (item instanceof Stack) {\n stacks.push(item);\n } else {\n if (!item.isComponent) {\n this.findAllStacksRecursive(stacks, item);\n }\n }\n }\n }\n\n /** @internal */\n private findFirstLocation(selectors: readonly LayoutManager.LocationSelector[]): LayoutManager.Location | undefined {\n const count = selectors.length;\n for (let i = 0; i < count; i++) {\n const selector = selectors[i];\n const location = this.findLocation(selector);\n if (location !== undefined) {\n return location;\n }\n }\n return undefined;\n }\n\n /** @internal */\n private findLocation(selector: LayoutManager.LocationSelector): LayoutManager.Location | undefined {\n const selectorIndex = selector.index;\n switch (selector.typeId) {\n case LayoutManager.LocationSelector.TypeId.FocusedItem: {\n if (this._focusedComponentItem === undefined) {\n return undefined\n } else {\n const parentItem = this._focusedComponentItem.parentItem;\n const parentContentItems = parentItem.contentItems;\n const parentContentItemCount = parentContentItems.length;\n if (selectorIndex === undefined) {\n return { parentItem, index: parentContentItemCount };\n } else {\n const focusedIndex = parentContentItems.indexOf(this._focusedComponentItem);\n const index = focusedIndex + selectorIndex;\n if (index < 0 || index > parentContentItemCount) {\n return undefined;\n } else {\n return { parentItem, index };\n }\n }\n }\n }\n case LayoutManager.LocationSelector.TypeId.FocusedStack: {\n if (this._focusedComponentItem === undefined) {\n return undefined\n } else {\n const parentItem = this._focusedComponentItem.parentItem;\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n case LayoutManager.LocationSelector.TypeId.FirstStack: {\n const parentItem = this.findFirstContentItemType(ItemType.stack);\n if (parentItem === undefined) {\n return undefined;\n } else {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n case LayoutManager.LocationSelector.TypeId.FirstRowOrColumn: {\n let parentItem = this.findFirstContentItemType(ItemType.row);\n if (parentItem !== undefined) {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n } else {\n parentItem = this.findFirstContentItemType(ItemType.column);\n if (parentItem !== undefined) {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n } else {\n return undefined;\n }\n }\n }\n case LayoutManager.LocationSelector.TypeId.FirstRow: {\n const parentItem = this.findFirstContentItemType(ItemType.row);\n if (parentItem === undefined) {\n return undefined;\n } else {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n case LayoutManager.LocationSelector.TypeId.FirstColumn: {\n const parentItem = this.findFirstContentItemType(ItemType.column);\n if (parentItem === undefined) {\n return undefined;\n } else {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n case LayoutManager.LocationSelector.TypeId.Empty: {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFLRIF18244');\n } else {\n if (this.rootItem !== undefined) {\n return undefined;\n } else {\n if (selectorIndex === undefined || selectorIndex === 0)\n return { parentItem: this._groundItem, index: 0 };\n else {\n return undefined;\n }\n }\n }\n }\n case LayoutManager.LocationSelector.TypeId.Root: {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFLF18244');\n } else {\n const groundContentItems = this._groundItem.contentItems;\n if (groundContentItems.length === 0) {\n if (selectorIndex === undefined || selectorIndex === 0)\n return { parentItem: this._groundItem, index: 0 };\n else {\n return undefined;\n }\n } else {\n const parentItem = groundContentItems[0];\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n }\n }\n }\n\n /** @internal */\n private tryCreateLocationFromParentItem(parentItem: ContentItem,\n selectorIndex: number | undefined\n ): LayoutManager.Location | undefined {\n const parentContentItems = parentItem.contentItems;\n const parentContentItemCount = parentContentItems.length;\n if (selectorIndex === undefined) {\n return { parentItem, index: parentContentItemCount };\n } else {\n if (selectorIndex < 0 || selectorIndex > parentContentItemCount) {\n return undefined;\n } else {\n return { parentItem, index: selectorIndex };\n }\n }\n }\n}\n\n/** @public */\nexport namespace LayoutManager {\n export type BeforeVirtualRectingEvent = (this: void, count: number) => void;\n export type AfterVirtualRectingEvent = (this: void) => void;\n\n /** @internal */\n export interface ConstructorParameters {\n constructorOrSubWindowLayoutConfig: LayoutConfig | undefined;\n isSubWindow: boolean;\n containerElement: HTMLElement | undefined;\n }\n\n /** @internal */\n export function createMaximisePlaceElement(document: Document): HTMLElement {\n const element = document.createElement('div');\n element.classList.add(DomConstants.ClassName.MaximisePlace);\n return element;\n }\n\n /** @internal */\n export function createTabDropPlaceholderElement(document: Document): HTMLElement {\n const element = document.createElement('div');\n element.classList.add(DomConstants.ClassName.DropTabPlaceholder);\n return element;\n }\n\n /**\n * Specifies a location of a ContentItem without referencing the content item.\n * Used to specify where a new item is to be added\n * @public\n */\n export interface Location {\n parentItem: ContentItem;\n index: number;\n }\n\n /**\n * A selector used to specify a unique location in the layout\n * @public\n */\n export interface LocationSelector {\n /** Specifies selector algorithm */\n typeId: LocationSelector.TypeId;\n /** Used by algorithm to determine index in found ContentItem */\n index?: number;\n }\n\n /** @public */\n export namespace LocationSelector {\n export const enum TypeId {\n /** Stack with focused Item. Index specifies offset from index of focused item (eg 1 is the position after focused item) */\n FocusedItem,\n /** Stack with focused Item. Index specfies ContentItems index */\n FocusedStack,\n /** First stack found in layout */\n FirstStack,\n /** First Row or Column found in layout (rows are searched first) */\n FirstRowOrColumn,\n /** First Row in layout */\n FirstRow,\n /** First Column in layout */\n FirstColumn,\n /** Finds a location if layout is empty. The found location will be the root ContentItem. */\n Empty,\n /** Finds root if layout is empty, otherwise a child under root */\n Root,\n }\n }\n\n /**\n * Default LocationSelectors array used if none is specified. Will always find a location.\n * @public\n */\n export const defaultLocationSelectors: readonly LocationSelector[] = [\n { typeId: LocationSelector.TypeId.FocusedStack, index: undefined },\n { typeId: LocationSelector.TypeId.FirstStack, index: undefined },\n { typeId: LocationSelector.TypeId.FirstRowOrColumn, index: undefined },\n { typeId: LocationSelector.TypeId.Root, index: undefined },\n ];\n\n /**\n * LocationSelectors to try to get location next to existing focused item\n * @public\n */\n export const afterFocusedItemIfPossibleLocationSelectors: readonly LocationSelector[] = [\n { typeId: LocationSelector.TypeId.FocusedItem, index: 1 },\n { typeId: LocationSelector.TypeId.FirstStack, index: undefined },\n { typeId: LocationSelector.TypeId.FirstRowOrColumn, index: undefined },\n { typeId: LocationSelector.TypeId.Root, index: undefined },\n ];\n}\n","import { LayoutConfig } from './config/config';\nimport { ResolvedComponentItemConfig, ResolvedLayoutConfig, ResolvedPopoutLayoutConfig } from './config/resolved-config';\nimport { ComponentContainer } from './container/component-container';\nimport { BindError } from './errors/external-error';\nimport { UnexpectedUndefinedError } from './errors/internal-error';\nimport { LayoutManager } from './layout-manager';\nimport { DomConstants } from './utils/dom-constants';\nimport { I18nStringId, i18nStrings } from './utils/i18n-strings';\n\n/** @public */\nexport class VirtualLayout extends LayoutManager {\n /**\n * @deprecated Use {@link (VirtualLayout:class).bindComponentEvent} and\n * {@link (VirtualLayout:class).unbindComponentEvent} with virtual components\n */\n getComponentEvent: VirtualLayout.GetComponentEventHandler | undefined;\n /**\n * @deprecated Use {@link (VirtualLayout:class).bindComponentEvent} and\n * {@link (VirtualLayout:class).unbindComponentEvent} with virtual components\n */\n releaseComponentEvent: VirtualLayout.ReleaseComponentEventHandler | undefined;\n\n bindComponentEvent: VirtualLayout.BindComponentEventHandler | undefined;\n unbindComponentEvent: VirtualLayout.UnbindComponentEventHandler | undefined;\n\n /** @internal @deprecated use while constructor is not determinate */\n private _bindComponentEventHanlderPassedInConstructor = false; // remove when constructor is determinate\n /** @internal @deprecated use while constructor is not determinate */\n private _creationTimeoutPassed = false; // remove when constructor is determinate\n\n /**\n * @param container - A Dom HTML element. Defaults to body\n * @param bindComponentEventHandler - Event handler to bind components\n * @param bindComponentEventHandler - Event handler to unbind components\n * If bindComponentEventHandler is defined, then constructor will be determinate. It will always call the init()\n * function and the init() function will always complete. This means that the bindComponentEventHandler will be called\n * if constructor is for a popout window. Make sure bindComponentEventHandler is ready for events.\n */\n constructor(\n container?: HTMLElement,\n bindComponentEventHandler?: VirtualLayout.BindComponentEventHandler,\n unbindComponentEventHandler?: VirtualLayout.UnbindComponentEventHandler,\n );\n /** @deprecated specify layoutConfig in {@link (LayoutManager:class).loadLayout} */\n constructor(config: LayoutConfig, container?: HTMLElement);\n /** @internal */\n constructor(configOrOptionalContainer: LayoutConfig | HTMLElement | undefined,\n containerOrBindComponentEventHandler: HTMLElement | VirtualLayout.BindComponentEventHandler | undefined,\n unbindComponentEventHandler: VirtualLayout.UnbindComponentEventHandler | undefined,\n skipInit: true,\n );\n /** @internal */\n constructor(configOrOptionalContainer: LayoutConfig | HTMLElement | undefined,\n containerOrBindComponentEventHandler?: HTMLElement | VirtualLayout.BindComponentEventHandler,\n unbindComponentEventHandler?: VirtualLayout.UnbindComponentEventHandler,\n skipInit?: true,\n ) {\n super(VirtualLayout.createLayoutManagerConstructorParameters(configOrOptionalContainer, containerOrBindComponentEventHandler));\n\n if (containerOrBindComponentEventHandler !== undefined) {\n if (typeof containerOrBindComponentEventHandler === 'function') {\n this.bindComponentEvent = containerOrBindComponentEventHandler;\n this._bindComponentEventHanlderPassedInConstructor = true;\n\n if (unbindComponentEventHandler !== undefined) {\n this.unbindComponentEvent = unbindComponentEventHandler;\n }\n }\n }\n\n if (!this._bindComponentEventHanlderPassedInConstructor) {\n // backward compatibility\n\n if (this.isSubWindow) {\n // document.body.style.visibility = 'hidden';\n // Set up layoutConfig since constructor is not determinate and may exit early. Other functions may need\n // this.layoutConfig. this.layoutConfig is again calculated in the same way when init() completes.\n // Remove this when constructor is determinate.\n if (this._constructorOrSubWindowLayoutConfig === undefined) {\n throw new UnexpectedUndefinedError('VLC98823');\n } else {\n const resolvedLayoutConfig = LayoutConfig.resolve(this._constructorOrSubWindowLayoutConfig);\n // remove root from layoutConfig\n this.layoutConfig = {\n ...resolvedLayoutConfig,\n root: undefined,\n }\n }\n }\n }\n\n if (skipInit !== true) {\n if (!this.deprecatedConstructor) {\n this.init();\n }\n }\n }\n\n override destroy(): void {\n this.bindComponentEvent = undefined;\n this.unbindComponentEvent = undefined;\n\n super.destroy();\n }\n\n\n /**\n * Creates the actual layout. Must be called after all initial components\n * are registered. Recurses through the configuration and sets up\n * the item tree.\n *\n * If called before the document is ready it adds itself as a listener\n * to the document.ready event\n * @deprecated LayoutConfig should not be loaded in {@link (LayoutManager:class)} constructor, but rather in a\n * {@link (LayoutManager:class).loadLayout} call. If LayoutConfig is not specified in {@link (LayoutManager:class)} constructor,\n * then init() will be automatically called internally and should not be called externally.\n */\n override init(): void {\n\n /**\n * If the document isn't ready yet, wait for it.\n */\n if (!this._bindComponentEventHanlderPassedInConstructor && (document.readyState === 'loading' || document.body === null)) {\n document.addEventListener('DOMContentLoaded', () => this.init(), { passive: true });\n return;\n }\n\n /**\n * If this is a subwindow, wait a few milliseconds for the original\n * page's js calls to be executed, then replace the bodies content\n * with GoldenLayout\n */\n if (!this._bindComponentEventHanlderPassedInConstructor && this.isSubWindow === true && !this._creationTimeoutPassed) {\n setTimeout(() => this.init(), 7);\n this._creationTimeoutPassed = true;\n return;\n }\n\n if (this.isSubWindow === true) {\n if (!this._bindComponentEventHanlderPassedInConstructor) {\n this.clearHtmlAndAdjustStylesForSubWindow();\n }\n\n // Expose this instance on the window object to allow the opening window to interact with it\n window.__glInstance = this;\n }\n\n super.init();\n }\n\n /**\n * Clears existing HTML and adjusts style to make window suitable to be a popout sub window\n * Curently is automatically called when window is a subWindow and bindComponentEvent is not passed in the constructor\n * If bindComponentEvent is not passed in the constructor, the application must either call this function explicitly or\n * (preferably) make the window suitable as a subwindow.\n * In the future, it is planned that this function is NOT automatically called in any circumstances. Applications will\n * need to determine whether a window is a Golden Layout popout window and either call this function explicitly or\n * hide HTML not relevant to the popout.\n * See apitest for an example of how HTML is hidden when popout windows are displayed\n */\n clearHtmlAndAdjustStylesForSubWindow(): void {\n const headElement = document.head;\n\n const appendNodeLists = new Array>(4);\n appendNodeLists[0] = document.querySelectorAll('body link');\n appendNodeLists[1] = document.querySelectorAll('body style');\n appendNodeLists[2] = document.querySelectorAll('template');\n appendNodeLists[3] = document.querySelectorAll('.gl_keep');\n\n for (let listIdx = 0; listIdx < appendNodeLists.length; listIdx++) {\n const appendNodeList = appendNodeLists[listIdx];\n for (let nodeIdx = 0; nodeIdx < appendNodeList.length; nodeIdx++) {\n const node = appendNodeList[nodeIdx];\n headElement.appendChild(node);\n }\n }\n\n const bodyElement = document.body;\n bodyElement.innerHTML = '';\n bodyElement.style.visibility = 'visible';\n this.checkAddDefaultPopinButton();\n\n /*\n * This seems a bit pointless, but actually causes a reflow/re-evaluation getting around\n * slickgrid's \"Cannot find stylesheet.\" bug in chrome\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const x = document.body.offsetHeight;\n }\n /**\n * Will add button if not popinOnClose specified in settings\n * @returns true if added otherwise false\n */\n checkAddDefaultPopinButton(): boolean {\n if (this.layoutConfig.settings.popInOnClose) {\n return false;\n } else {\n const popInButtonElement = document.createElement('div');\n popInButtonElement.classList.add(DomConstants.ClassName.Popin);\n popInButtonElement.setAttribute('title', this.layoutConfig.header.dock);\n const iconElement = document.createElement('div');\n iconElement.classList.add(DomConstants.ClassName.Icon);\n const bgElement = document.createElement('div');\n bgElement.classList.add(DomConstants.ClassName.Bg);\n popInButtonElement.appendChild(iconElement);\n popInButtonElement.appendChild(bgElement);\n popInButtonElement.addEventListener('click', () => this.emit('popIn'));\n document.body.appendChild(popInButtonElement);\n return true;\n }\n }\n\n /** @internal */\n override bindComponent(container: ComponentContainer, itemConfig: ResolvedComponentItemConfig): ComponentContainer.BindableComponent {\n if (this.bindComponentEvent !== undefined) {\n const bindableComponent = this.bindComponentEvent(container, itemConfig);\n return bindableComponent;\n } else {\n if (this.getComponentEvent !== undefined) {\n return {\n virtual: false,\n component: this.getComponentEvent(container, itemConfig),\n }\n } else {\n // There is no component registered for this type, and we don't have a getComponentEvent defined.\n // This might happen when the user pops out a dialog and the component types are not registered upfront.\n const text = i18nStrings[I18nStringId.ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned];\n const message = `${text}: ${JSON.stringify(itemConfig)}`\n throw new BindError(message);\n }\n }\n }\n\n /** @internal */\n override unbindComponent(container: ComponentContainer, virtual: boolean, component: ComponentContainer.Component | undefined): void {\n if (this.unbindComponentEvent !== undefined) {\n this.unbindComponentEvent(container);\n } else {\n if (!virtual && this.releaseComponentEvent !== undefined) {\n if (component === undefined) {\n throw new UnexpectedUndefinedError('VCUCRCU333998');\n } else {\n this.releaseComponentEvent(container, component);\n }\n }\n }\n }\n}\n\n/** @public */\nexport namespace VirtualLayout {\n /**\n * @deprecated Use virtual components with {@link (VirtualLayout:class).bindComponentEvent} and\n * {@link (VirtualLayout:class).unbindComponentEvent} events.\n */\n export type GetComponentEventHandler =\n (this: void, container: ComponentContainer, itemConfig: ResolvedComponentItemConfig) => ComponentContainer.Component;\n /**\n * @deprecated Use virtual components with {@link (VirtualLayout:class).bindComponentEvent} and\n * {@link (VirtualLayout:class).unbindComponentEvent} events.\n */\n export type ReleaseComponentEventHandler =\n (this: void, container: ComponentContainer, component: ComponentContainer.Component) => void;\n\n export type BindComponentEventHandler =\n (this: void, container: ComponentContainer, itemConfig: ResolvedComponentItemConfig) => ComponentContainer.BindableComponent;\n export type UnbindComponentEventHandler =\n (this: void, container: ComponentContainer) => void;\n\n export type BeforeVirtualRectingEvent = (this: void) => void;\n\n /** @internal\n * Veriable to hold the state whether we already checked if we are running in a sub window.\n * Fixes popout and creation of nested golden-layouts.\n */\n let subWindowChecked = false;\n\n /** @internal */\n export function createLayoutManagerConstructorParameters(configOrOptionalContainer: LayoutConfig | HTMLElement | undefined,\n containerOrBindComponentEventHandler?: HTMLElement | VirtualLayout.BindComponentEventHandler):\n LayoutManager.ConstructorParameters\n {\n const windowConfigKey = subWindowChecked ? null : new URL(document.location.href).searchParams.get('gl-window');\n subWindowChecked = true;\n const isSubWindow = windowConfigKey !== null;\n\n let containerElement: HTMLElement | undefined;\n let config: LayoutConfig | undefined;\n if (windowConfigKey !== null) {\n const windowConfigStr = localStorage.getItem(windowConfigKey);\n if (windowConfigStr === null) {\n throw new Error('Null gl-window Config');\n }\n localStorage.removeItem(windowConfigKey);\n const minifiedWindowConfig = JSON.parse(windowConfigStr) as ResolvedPopoutLayoutConfig;\n const resolvedConfig = ResolvedLayoutConfig.unminifyConfig(minifiedWindowConfig);\n config = LayoutConfig.fromResolved(resolvedConfig)\n\n if (configOrOptionalContainer instanceof HTMLElement) {\n containerElement = configOrOptionalContainer;\n }\n } else {\n if (configOrOptionalContainer === undefined) {\n config = undefined;\n } else {\n if (configOrOptionalContainer instanceof HTMLElement) {\n config = undefined;\n containerElement = configOrOptionalContainer;\n } else {\n // backwards compatibility\n config = configOrOptionalContainer;\n }\n }\n\n if (containerElement === undefined) {\n if (containerOrBindComponentEventHandler instanceof HTMLElement) {\n containerElement = containerOrBindComponentEventHandler;\n }\n }\n }\n\n return {\n constructorOrSubWindowLayoutConfig: config,\n isSubWindow,\n containerElement,\n };\n }\n}\n","/* eslint no-param-reassign: [\"error\",\n{ \"props\": true, \"ignorePropertyModificationsFor\": [\"container\"] }] */\nimport { GoldenLayout } from 'golden-layout';\n\nconst config = {\n settings: {\n showPopoutIcon: false,\n showCloseIcon: false,\n },\n dimensions: {\n minItemHeight: 40,\n },\n content: [{\n type: 'row',\n content: [{\n type: 'column',\n width: 40,\n content: [{\n type: 'component',\n isClosable: false,\n componentName: 'template',\n title: 'Game',\n componentState: { id: 'client_wrapper' },\n }],\n },\n {\n type: 'column',\n content: [{\n type: 'row',\n height: 65,\n content: [{\n type: 'stack',\n content: [{\n type: 'component',\n isClosable: false,\n title: 'Main',\n componentName: 'template',\n componentState: { id: 'mainmenu' },\n },\n {\n type: 'component',\n isClosable: false,\n title: 'Log',\n componentName: 'template',\n componentState: { id: 'log' },\n }],\n },\n {\n type: 'component',\n title: 'Music',\n width: 30,\n componentName: 'template',\n componentState: { id: 'music' },\n }],\n },\n {\n type: 'row',\n content: [{\n type: 'component',\n title: 'Server chat',\n componentName: 'template',\n componentState: { id: 'ooc' },\n }],\n }],\n }],\n }],\n};\n\nconst golden = new GoldenLayout();\ngolden.registerComponentFactoryFunction('template', (container, componentState) => {\n const template = document.querySelector(`#${componentState.id}`);\n container.element.innerHTML = template.innerHTML;\n});\ngolden.loadLayout(config);\n","import { LayoutConfig } from './config/config';\nimport { ResolvedComponentItemConfig } from './config/resolved-config';\nimport { ComponentContainer } from './container/component-container';\nimport { ApiError, BindError } from './errors/external-error';\nimport { AssertError, UnexpectedUndefinedError } from './errors/internal-error';\nimport { I18nStringId, i18nStrings } from './utils/i18n-strings';\nimport { JsonValue, LogicalZIndex } from './utils/types';\nimport { deepExtendValue, ensureElementPositionAbsolute, numberToPixels, setElementDisplayVisibility, setElementHeight, setElementWidth } from './utils/utils';\nimport { VirtualLayout } from './virtual-layout';\n\n/** @public */\nexport class GoldenLayout extends VirtualLayout {\n /** @internal */\n private _componentTypesMap = new Map();\n /** @internal */\n private _getComponentConstructorFtn: GoldenLayout.GetComponentConstructorCallback;\n\n /** @internal */\n private _registeredComponentMap = new Map();\n /** @internal */\n private _virtuableComponentMap = new Map();\n /** @internal */\n private _goldenLayoutBoundingClientRect: DOMRect;\n\n /** @internal */\n private _containerVirtualRectingRequiredEventListener =\n (container: ComponentContainer, width: number, height: number) => this.handleContainerVirtualRectingRequiredEvent(container, width, height);\n /** @internal */\n private _containerVirtualVisibilityChangeRequiredEventListener =\n (container: ComponentContainer, visible: boolean) => this.handleContainerVirtualVisibilityChangeRequiredEvent(container, visible);\n /** @internal */\n private _containerVirtualZIndexChangeRequiredEventListener =\n (container: ComponentContainer, logicalZIndex: LogicalZIndex, defaultZIndex: string) =>\n this.handleContainerVirtualZIndexChangeRequiredEvent(container, logicalZIndex, defaultZIndex);\n\n /**\n * @param container - A Dom HTML element. Defaults to body\n * @param bindComponentEventHandler - Event handler to bind components\n * @param bindComponentEventHandler - Event handler to unbind components\n * If bindComponentEventHandler is defined, then constructor will be determinate. It will always call the init()\n * function and the init() function will always complete. This means that the bindComponentEventHandler will be called\n * if constructor is for a popout window. Make sure bindComponentEventHandler is ready for events.\n */\n constructor(\n container?: HTMLElement,\n bindComponentEventHandler?: VirtualLayout.BindComponentEventHandler,\n unbindComponentEventHandler?: VirtualLayout.UnbindComponentEventHandler,\n );\n /** @deprecated specify layoutConfig in {@link (LayoutManager:class).loadLayout} */\n constructor(config: LayoutConfig, container?: HTMLElement);\n /** @internal */\n constructor(configOrOptionalContainer: LayoutConfig | HTMLElement | undefined,\n containerOrBindComponentEventHandler?: HTMLElement | VirtualLayout.BindComponentEventHandler,\n unbindComponentEventHandler?: VirtualLayout.UnbindComponentEventHandler,\n ) {\n super(configOrOptionalContainer, containerOrBindComponentEventHandler, unbindComponentEventHandler, true);\n // we told VirtualLayout to not call init() (skipInit set to true) so that Golden Layout can initialise its properties before init is called\n if (!this.deprecatedConstructor) {\n this.init();\n }\n }\n\n /**\n * Register a new component type with the layout manager.\n *\n * @deprecated See {@link https://stackoverflow.com/questions/40922531/how-to-check-if-a-javascript-function-is-a-constructor}\n * instead use {@link (GoldenLayout:class).registerComponentConstructor}\n * or {@link (GoldenLayout:class).registerComponentFactoryFunction}\n */\n registerComponent(name: string,\n componentConstructorOrFactoryFtn: GoldenLayout.ComponentConstructor | GoldenLayout.ComponentFactoryFunction,\n virtual = false\n ): void {\n if (typeof componentConstructorOrFactoryFtn !== 'function') {\n throw new ApiError('registerComponent() componentConstructorOrFactoryFtn parameter is not a function')\n } else {\n if (componentConstructorOrFactoryFtn.hasOwnProperty('prototype')) {\n const componentConstructor = componentConstructorOrFactoryFtn as GoldenLayout.ComponentConstructor;\n this.registerComponentConstructor(name, componentConstructor, virtual);\n } else {\n const componentFactoryFtn = componentConstructorOrFactoryFtn as GoldenLayout.ComponentFactoryFunction;\n this.registerComponentFactoryFunction(name, componentFactoryFtn, virtual);\n }\n }\n }\n\n /**\n * Register a new component type with the layout manager.\n */\n registerComponentConstructor(typeName: string, componentConstructor: GoldenLayout.ComponentConstructor, virtual = false): void {\n if (typeof componentConstructor !== 'function') {\n throw new Error(i18nStrings[I18nStringId.PleaseRegisterAConstructorFunction]);\n }\n\n const existingComponentType = this._componentTypesMap.get(typeName);\n\n if (existingComponentType !== undefined) {\n throw new BindError(`${i18nStrings[I18nStringId.ComponentIsAlreadyRegistered]}: ${typeName}`);\n }\n\n this._componentTypesMap.set(typeName, {\n constructor: componentConstructor,\n factoryFunction: undefined,\n virtual,\n }\n );\n }\n\n /**\n * Register a new component with the layout manager.\n */\n registerComponentFactoryFunction(typeName: string, componentFactoryFunction: GoldenLayout.ComponentFactoryFunction, virtual = false): void {\n if (typeof componentFactoryFunction !== 'function') {\n throw new BindError('Please register a constructor function');\n }\n\n const existingComponentType = this._componentTypesMap.get(typeName);\n\n if (existingComponentType !== undefined) {\n throw new BindError(`${i18nStrings[I18nStringId.ComponentIsAlreadyRegistered]}: ${typeName}`);\n }\n\n this._componentTypesMap.set(typeName, {\n constructor: undefined,\n factoryFunction: componentFactoryFunction,\n virtual,\n }\n );\n }\n\n /**\n * Register a component function with the layout manager. This function should\n * return a constructor for a component based on a config.\n * This function will be called if a component type with the required name is not already registered.\n * It is recommended that applications use the {@link (VirtualLayout:class).getComponentEvent} and\n * {@link (VirtualLayout:class).releaseComponentEvent} instead of registering a constructor callback\n * @deprecated use {@link (GoldenLayout:class).registerGetComponentConstructorCallback}\n */\n registerComponentFunction(callback: GoldenLayout.GetComponentConstructorCallback): void {\n this.registerGetComponentConstructorCallback(callback);\n }\n\n /**\n * Register a callback closure with the layout manager which supplies a Component Constructor.\n * This callback should return a constructor for a component based on a config.\n * This function will be called if a component type with the required name is not already registered.\n * It is recommended that applications use the {@link (VirtualLayout:class).getComponentEvent} and\n * {@link (VirtualLayout:class).releaseComponentEvent} instead of registering a constructor callback\n */\n registerGetComponentConstructorCallback(callback: GoldenLayout.GetComponentConstructorCallback): void {\n if (typeof callback !== 'function') {\n throw new Error('Please register a callback function');\n }\n\n if (this._getComponentConstructorFtn !== undefined) {\n console.warn('Multiple component functions are being registered. Only the final registered function will be used.')\n }\n\n this._getComponentConstructorFtn = callback;\n }\n\n getRegisteredComponentTypeNames(): string[] {\n const typeNamesIterableIterator = this._componentTypesMap.keys();\n return Array.from(typeNamesIterableIterator);\n }\n\n /**\n * Returns a previously registered component instantiator. Attempts to utilize registered\n * component type by first, then falls back to the component constructor callback function (if registered).\n * If neither gets an instantiator, then returns `undefined`.\n * Note that `undefined` will return if config.componentType is not a string\n *\n * @param config - The item config\n * @public\n */\n getComponentInstantiator(config: ResolvedComponentItemConfig): GoldenLayout.ComponentInstantiator | undefined {\n let instantiator: GoldenLayout.ComponentInstantiator | undefined;\n\n const typeName = ResolvedComponentItemConfig.resolveComponentTypeName(config)\n if (typeName !== undefined) {\n instantiator = this._componentTypesMap.get(typeName);\n }\n if (instantiator === undefined) {\n if (this._getComponentConstructorFtn !== undefined) {\n instantiator = {\n constructor: this._getComponentConstructorFtn(config),\n factoryFunction: undefined,\n virtual: false,\n }\n }\n }\n\n return instantiator;\n }\n\n /** @internal */\n override bindComponent(container: ComponentContainer, itemConfig: ResolvedComponentItemConfig): ComponentContainer.BindableComponent {\n let instantiator: GoldenLayout.ComponentInstantiator | undefined;\n\n const typeName = ResolvedComponentItemConfig.resolveComponentTypeName(itemConfig);\n if (typeName !== undefined) {\n instantiator = this._componentTypesMap.get(typeName);\n }\n if (instantiator === undefined) {\n if (this._getComponentConstructorFtn !== undefined) {\n instantiator = {\n constructor: this._getComponentConstructorFtn(itemConfig),\n factoryFunction: undefined,\n virtual: false,\n }\n }\n }\n\n let result: ComponentContainer.BindableComponent;\n if (instantiator !== undefined) {\n const virtual = instantiator.virtual;\n // handle case where component is obtained by name or component constructor callback\n let componentState: JsonValue | undefined;\n if (itemConfig.componentState === undefined) {\n componentState = undefined;\n } else {\n // make copy\n componentState = deepExtendValue({}, itemConfig.componentState) as JsonValue;\n }\n\n let component: ComponentContainer.Component | undefined;\n const componentConstructor = instantiator.constructor;\n if (componentConstructor !== undefined) {\n component = new componentConstructor(container, componentState, virtual);\n } else {\n const factoryFunction = instantiator.factoryFunction;\n if (factoryFunction !== undefined) {\n component = factoryFunction(container, componentState, virtual);\n } else {\n throw new AssertError('LMBCFFU10008');\n }\n }\n\n if (virtual) {\n if (component === undefined) {\n throw new UnexpectedUndefinedError('GLBCVCU988774');\n } else {\n const virtuableComponent = component as GoldenLayout.VirtuableComponent;\n const componentRootElement = virtuableComponent.rootHtmlElement;\n if (componentRootElement === undefined) {\n throw new BindError(`${i18nStrings[I18nStringId.VirtualComponentDoesNotHaveRootHtmlElement]}: ${typeName}`);\n } else {\n ensureElementPositionAbsolute(componentRootElement);\n this.container.appendChild(componentRootElement);\n this._virtuableComponentMap.set(container, virtuableComponent);\n container.virtualRectingRequiredEvent = this._containerVirtualRectingRequiredEventListener;\n container.virtualVisibilityChangeRequiredEvent = this._containerVirtualVisibilityChangeRequiredEventListener;\n container.virtualZIndexChangeRequiredEvent = this._containerVirtualZIndexChangeRequiredEventListener;\n }\n }\n }\n\n this._registeredComponentMap.set(container, component);\n\n result = {\n virtual: instantiator.virtual,\n component,\n };\n\n } else {\n // Use getComponentEvent\n result = super.bindComponent(container, itemConfig);\n }\n\n return result;\n }\n\n /** @internal */\n override unbindComponent(container: ComponentContainer, virtual: boolean, component: ComponentContainer.Component | undefined): void {\n const registeredComponent = this._registeredComponentMap.get(container);\n if (registeredComponent === undefined) {\n super.unbindComponent(container, virtual, component); // was not created from registration so use virtual unbind events\n } else {\n const virtuableComponent = this._virtuableComponentMap.get(container);\n if (virtuableComponent !== undefined) {\n const componentRootElement = virtuableComponent.rootHtmlElement;\n if (componentRootElement === undefined) {\n throw new AssertError('GLUC77743', container.title);\n } else {\n this.container.removeChild(componentRootElement);\n this._virtuableComponentMap.delete(container);\n }\n }\n }\n }\n\n override fireBeforeVirtualRectingEvent(count: number): void {\n this._goldenLayoutBoundingClientRect = this.container.getBoundingClientRect();\n super.fireBeforeVirtualRectingEvent(count);\n }\n\n\n /** @internal */\n private handleContainerVirtualRectingRequiredEvent(container: ComponentContainer, width: number, height: number): void {\n const virtuableComponent = this._virtuableComponentMap.get(container);\n if (virtuableComponent === undefined) {\n throw new UnexpectedUndefinedError('GLHCSCE55933');\n } else {\n const rootElement = virtuableComponent.rootHtmlElement;\n if (rootElement === undefined) {\n throw new BindError(i18nStrings[I18nStringId.ComponentIsNotVirtuable] + ' ' + container.title);\n } else {\n const containerBoundingClientRect = container.element.getBoundingClientRect();\n const left = containerBoundingClientRect.left - this._goldenLayoutBoundingClientRect.left;\n rootElement.style.left = numberToPixels(left);\n const top = containerBoundingClientRect.top - this._goldenLayoutBoundingClientRect.top;\n rootElement.style.top = numberToPixels(top);\n setElementWidth(rootElement, width);\n setElementHeight(rootElement, height);\n }\n }\n }\n\n /** @internal */\n private handleContainerVirtualVisibilityChangeRequiredEvent(container: ComponentContainer, visible: boolean): void {\n const virtuableComponent = this._virtuableComponentMap.get(container);\n if (virtuableComponent === undefined) {\n throw new UnexpectedUndefinedError('GLHCVVCRE55934');\n } else {\n const rootElement = virtuableComponent.rootHtmlElement;\n if (rootElement === undefined) {\n throw new BindError(i18nStrings[I18nStringId.ComponentIsNotVirtuable] + ' ' + container.title);\n } else {\n setElementDisplayVisibility(rootElement, visible);\n }\n }\n }\n\n /** @internal */\n private handleContainerVirtualZIndexChangeRequiredEvent(container: ComponentContainer, logicalZIndex: LogicalZIndex, defaultZIndex: string) {\n const virtuableComponent = this._virtuableComponentMap.get(container);\n if (virtuableComponent === undefined) {\n throw new UnexpectedUndefinedError('GLHCVZICRE55935');\n } else {\n const rootElement = virtuableComponent.rootHtmlElement;\n if (rootElement === undefined) {\n throw new BindError(i18nStrings[I18nStringId.ComponentIsNotVirtuable] + ' ' + container.title);\n } else {\n rootElement.style.zIndex = defaultZIndex;\n }\n }\n }\n}\n\n/** @public */\nexport namespace GoldenLayout {\n export interface VirtuableComponent {\n rootHtmlElement: HTMLElement;\n }\n\n export type ComponentConstructor = new(container: ComponentContainer, state: JsonValue | undefined, virtual: boolean) => ComponentContainer.Component;\n export type ComponentFactoryFunction = (container: ComponentContainer, state: JsonValue | undefined, virtual: boolean) => ComponentContainer.Component | undefined;\n export type GetComponentConstructorCallback = (this: void, config: ResolvedComponentItemConfig) => ComponentConstructor;\n\n export interface ComponentInstantiator {\n constructor: ComponentConstructor | undefined;\n factoryFunction: ComponentFactoryFunction | undefined;\n virtual: boolean;\n }\n}\n"],"names":["InternalError","Error","constructor","type","code","message","super","undefined","AssertError","UnreachableCaseError","variableValue","UnexpectedNullError","UnexpectedUndefinedError","ConfigMinifier","StyleConstants","WidthOrHeightPropertyName","Side","LogicalZIndex","keys","values","translateObject","from","minify","to","key","hasOwnProperty","translatedKey","minifyKey","unminifyKey","fromValue","translateValue","Array","isArray","length","i","translateArray","value","index","indexOfValue","toString","minifyValue","parseInt","substr","indexOfKey","checkInitialise","defaultComponentBaseZIndex","defaultComponentDragZIndex","defaultComponentStackMaximisedZIndex","width","height","top","left","right","bottom","base","drag","stackMaximised","LogicalZIndexToDefaultMap","JsonValue","ItemType","ResponsiveMode","SizeUnitEnum","ResolvedItemConfig","ResolvedHeaderedItemConfig","ResolvedStackItemConfig","ResolvedComponentItemConfig","ResolvedRowOrColumnItemConfig","ResolvedRootItemConfig","ResolvedGroundItemConfig","ResolvedLayoutConfig","ResolvedPopoutLayoutConfig","I18nStrings","numberToPixels","pixelsToNumber","numberStr","replace","parseFloat","isDigit","char","setElementWidth","element","widthAsPixels","style","setElementHeight","heightAsPixels","getElementWidthAndHeight","offsetWidth","offsetHeight","setElementDisplayVisibility","visible","display","deepExtend","target","obj","existingTarget","deepExtendValue","targetArray","valueObj","getUniqueId","Math","random","isJsonObject","isJson","ground","row","column","stack","component","none","always","onload","tryParse","Pixel","Percent","Fractional","Em","format","defaults","content","size","sizeUnit","minSize","minSizeUnit","id","isClosable","createCopy","original","createDefault","isComponentItem","itemConfig","isStackItem","isGroundItem","Header","defaultMaximised","show","popout","close","maximise","minimise","tabDropdown","copyContent","count","result","defaultActiveItemIndex","maximised","activeItemIndex","header","defaultReorderEnabled","resolveComponentTypeName","componentType","reorderEnabled","title","componentState","copyComponentType","isChildItemConfig","config","isRootItemConfig","create","rootItemConfig","Settings","Dimensions","isPopout","constrainDragToContainer","popoutWholeStack","blockedPopoutsThrowError","closePopoutsOnUnload","responsiveMode","tabOverlapAllowance","reorderOnTabMenuClick","tabControlOffset","popInOnClose","borderWidth","borderGrabWidth","defaultMinItemHeight","defaultMinItemHeightUnit","defaultMinItemWidth","defaultMinItemWidthUnit","headerHeight","dragProxyWidth","dragProxyHeight","dock","root","openPopouts","dimensions","settings","resolved","copyOpenPopouts","minifyConfig","layoutConfig","unminifyConfig","minifiedConfig","Window","parentId","indexInParent","window","ExternalError","ConfigurationError","node","PopoutBlockedError","ApiError","BindError","initialised","infosObject","PopoutCannotBeCreatedWithGroundItemConfig","default","PleaseRegisterAConstructorFunction","ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned","ComponentIsAlreadyRegistered","ComponentIsNotVirtuable","VirtualComponentDoesNotHaveRootHtmlElement","ItemConfigIsNotTypeComponent","InvalidNumberPartInSizeString","UnknownUnitInSizeString","UnsupportedUnitInSizeString","idCount","Object","infos","info","i18nStrings","ItemConfig","HeaderedItemConfig","StackItemConfig","ComponentItemConfig","RowOrColumnItemConfig","RootItemConfig","LayoutConfig","PopoutLayoutConfig","parseSize","sizeString","allowableSizeUnits","numericPart","digitsPart","firstNonNumericCharPart","firstNonDigitPart","trimStart","firstNonDigitPartIndex","gotDecimalPoint","substring","trim","splitStringAtFirstNonNumericChar","Number","isNaN","includes","formatSize","formatUndefinableSize","resolve","rowAndColumnChildLegacySizeDefault","JSON","stringify","resolveContent","resolveId","resolveSize","resolveMinSize","minWidth","minHeight","minWidthDefined","calculateSizeWidthHeightSpecificationType","isGround","isRow","isColumn","isStack","isComponent","hasHeaders","resolveIdAndMaximised","legacyId","legacyMaximised","idx","findIndex","splice","childItemConfig","fromResolvedContent","resolvedContent","resolvedContentConfig","fromResolved","resolvedConfig","componentName","componentTypeToTitle","contentConfig","childItemConfigs","legacySizeDefault","widthOrHeightSpecifiedAtLeastOnce","sizeSpecifiedAtLeastOnce","sizeWidthHeightSpecificationType","resolvedChildItemConfig","fromResolvedOrUndefined","resolvedItemConfig","resolveDefaultMinItemHeight","resolveDefaultMinItemWidth","resolvedDimensions","labels","showPopoutIcon","popin","showMaximiseIcon","showCloseIcon","resolveOpenPopouts","fromResolvedArray","isResolved","configOrResolvedConfig","popoutConfigs","resolvedArray","resolvedOpenPopoutCount","resolvedOpenPopout","resolvedWindow","popoutConfig","EventEmitter","_allEventSubscriptions","_subscriptionsMap","Map","unbind","this","removeEventListener","trigger","emit","tryBubbleEvent","name","args","eventName","subcriptions","get","slice","subscription","emitAllEvent","emitUnknown","subs","emitBaseBubblingEvent","event","BubblingEvent","emitUnknownBubblingEvent","callback","unknownCallback","removeUnknownEventListener","off","addEventListener","addUnknownEventListener","on","ALL_EVENT","push","subscriptions","set","removeSubscription","indexOf","allEventSubscriptionsCount","unknownArgs","unshift","allEventSubcriptions","headerClickEventName","headerTouchStartEventName","_name","_target","_isPropagationStopped","origin","isPropagationStopped","stopPropagation","ClickBubblingEvent","_mouseEvent","mouseEvent","TouchStartBubblingEvent","_touchEvent","touchEvent","BrowserPopout","_config","_initialWindowSize","_layoutManager","_isInitialised","_popoutWindow","createWindow","toConfig","glInstanceConfig","getGlInstance","saveLayout","screenX","screenLeft","screenY","screenTop","__glInstance","getWindow","closeWindow","e","popIn","parentItem","copiedRoot","groundItem","getItemsByPopInParentId","contentItems","newContentItem","createAndInitContentItem","addChild","_onClose","url","createUrl","floor","features","serializeWindowFeatures","innerWidth","innerHeight","menubar","toolbar","location","personalbar","resizable","scrollbars","status","globalThis","open","positionWindow","passive","_checkReadyInterval","setInterval","checkReady","isInitialised","onInitialised","clearInterval","windowOptions","windowOptionsString","join","storageKey","localStorage","setItem","getErrorMessage","URL","href","searchParams","moveTo","focus","setTimeout","HeaderButton","_header","label","cssClass","_pushEvent","_clickEventListener","ev","onClick","_touchStartEventListener","onTouchStart","_element","document","createElement","classList","add","destroy","controlsContainerElement","appendChild","parentNode","removeChild","DragListener","_eElement","extraAllowableChildTargets","_pointerTracking","_pointerDownEventListener","onPointerDown","_pointerMoveEventListener","onPointerMove","_pointerUpEventListener","onPointerUp","_timeout","_allowableTargets","_oDocument","_eBody","body","_nDelay","_nDistance","_nX","_nY","_nOriginalX","_nOriginalY","_dragging","checkRemovePointerTrackingEventListeners","cancelDrag","processDragStop","oEvent","isPrimary","coordinates","getPointerCoordinates","processPointerDown","x","y","startDrag","err","console","error","processDragMove","preventDefault","dragEvent","pageX","pageY","abs","clearTimeout","remove","querySelector","setProperty","Tab","_componentItem","_closeEvent","_focusEvent","_dragStartEvent","_isActive","_tabClickListener","onTabClickDown","_tabTouchStartListener","onTabTouchStart","_closeClickListener","onCloseClick","_closeTouchStartListener","onCloseTouchStart","_dragStartListener","onDragStart","_contentItemDestroyListener","onContentItemDestroy","_tabTitleChangedListener","setTitle","_titleElement","_closeElement","enableReorder","setTab","isActive","componentItem","contentItem","titleElement","closeElement","_dragListener","disableReorder","innerText","setActive","setBlurred","setFocused","button","notifyFocus","notifyClose","TabsContainer","_componentRemoveEvent","_componentFocusEvent","_componentDragStartEvent","_dropdownActiveChangedEvent","_tabs","_lastVisibleTabIndex","_dropdownActive","_dropdownElement","tabs","tabCount","lastVisibleTabIndex","dropdownElement","dropdownActive","createTab","tab","item","handleTabCloseEvent","handleTabFocusEvent","dragListener","handleTabDragStartEvent","childNodes","insertBefore","removeTab","processActiveComponentChanged","newActiveComponentItem","activeIndex","activeTab","j","updateTabSizes","availableWidth","activeComponentItem","dropDownActive","tryUpdateTabSizes","cumulativeTabWidth","tabOverlapAllowanceExceeded","tabElement","parentElement","tabMarginRight","getComputedStyle","marginRight","visibleTabWidth","activeTabMarginRight","zIndex","marginLeft","overlap","showAdditionalTabsDropdown","hideAdditionalTabsDropdown","_parent","_configClosable","_getActiveComponentItemEvent","closeEvent","_popoutEvent","_maximiseToggleEvent","_clickEvent","_touchStartEvent","_clickListener","_touchStartListener","_rowColumnClosable","_closeButton","_popoutButton","_tabsContainer","handleTabInitiatedComponentRemoveEvent","handleTabInitiatedComponentFocusEvent","handleTabInitiatedDragStartEvent","processTabDropdownActiveChanged","_show","_popoutEnabled","popoutEnabled","_popoutLabel","popoutLabel","_maximiseEnabled","maximiseEnabled","_maximiseLabel","maximiseLabel","_minimiseEnabled","minimiseEnabled","_minimiseLabel","minimiseLabel","_closeEnabled","closeEnabled","_closeLabel","closeLabel","_tabDropdownEnabled","tabDropdownEnabled","_tabDropdownLabel","tabDropdownLabel","setSide","side","_canRemoveComponent","_controlsContainerElement","_documentMouseUpListener","_tabControlOffset","_tabDropdownButton","handleButtonPopoutEvent","_maximiseButton","handleButtonMaximiseToggleEvent","_side","leftRightSided","_leftRightSided","layoutManager","parent","tabsContainerElement","setRowColumnClosable","updateClosability","len","applyFocusedValue","processMaximised","setAttribute","processMinimised","notifyClick","notifyTouchStart","ComponentContainer","_updateItemConfigEvent","_showEvent","_hideEvent","_blurEvent","_stackMaximised","_width","_height","_visible","_isShownWithZeroDimensions","_componentType","_isClosable","_initialState","_state","_boundComponent","bindComponent","updateElementPositionPropertyFromBoundComponent","virtual","_tab","isHidden","state","initialState","releaseComponent","stateRequestEvent","getElement","hide","suppressEvent","blur","setSize","ancestorItem","ancestorChildItem","direction","currentSize","percentage","delta","ancestorItemContentItem","updateSize","replaceComponent","virtualVisibilityChangeRequiredEvent","virtualRectingRequiredEvent","fireBeforeVirtualRectingEvent","fireAfterVirtualRectingEvent","setBaseLogicalZIndex","getState","extendState","extendedState","setState","setVisibility","setSizeToNodeSize","emitShow","emitHide","setLogicalZIndex","logicalZIndex","_logicalZIndex","notifyVirtualZIndexChangeRequired","enterDragMode","exitDragMode","enterStackMaximised","exitStackMaximised","force","addVirtualSizedContainerToLayoutManager","checkShownFromZeroDimensions","notifyVirtualRectingRequired","virtualZIndexChangeRequiredEvent","defaultZIndex","position","beginVirtualSizedContainerAdding","addVirtualSizedContainer","endVirtualSizedContainerAdding","unbindComponent","ContentItem","_popInParentIds","_type","_id","_pendingEventPropagations","_throttledEvents","_contentItems","createContentItems","popInParentIds","isComponentParentableItem","keepChild","suspendResize","setParent","init","replaceChild","oldChild","newChild","destroyOldChild","browserPopout","createPopoutFromContentItem","calculateConfigContent","highlightDropZone","area","dropTargetIndicator","highlightArea","onDrop","beginSizeInvalidation","endSizeInvalidation","getElementArea","rect","getBoundingClientRect","scrollTop","scrollLeft","x1","y1","x2","y2","surface","addPopInParentId","initContentItems","updateContentItemsSize","createContentItem","propagateEvent","scheduleEventPropagationToLayoutManager","requestAnimationFrame","propagateEventToLayoutManager","ComponentItem","_parentItem","_focused","_reorderEnabled","applyUpdatableConfig","_initialWantMaximise","containerElement","_container","handleUpdateItemConfigEvent","initialWantMaximise","container","headerConfig","_headerConfig","_title","focused","updateNodeSize","setActiveComponentItem","setFocusedComponentItem","ComponentParentableItem","setFocusedValue","Stack","_headerSideChanged","_resizeListener","handleResize","_maximisedListener","handleMaximised","_minimisedListener","handleMinimised","layoutHeaderConfig","configContent","componentHeaderConfig","_initialActiveItemIndex","_maximisedEnabled","headerSettings","getActiveComponentItem","handlePopoutEvent","toggleMaximise","handleHeaderClickEvent","handleHeaderTouchStartEvent","handleHeaderComponentRemoveEvent","handleHeaderComponentFocusEvent","handleHeaderComponentStartDragEvent","_childElementContainer","setupHeaderPosition","childElementContainer","headerShow","headerSide","headerLeftRightSided","contentAreaDimensions","_contentAreaDimensions","isMaximised","maximisedStack","stackParent","contentItemCount","setActiveContentItem","suppressFocusEvent","_activeComponentItem","emitStateChangedEvent","getActiveContentItem","focusActiveContentItem","newComponent","newItem","addComponent","addItem","checkMinimiseMaximisedStack","stackWillBeDeleted","newActiveComponentIdx","setMaximisedStack","createHeaderConfig","_dropSegment","resetHeaderDropZone","_dropIndex","isVertical","isHorizontal","hasCorrectParent","rowOrColumn","segment","hoverArea","highlightHeaderDropZone","highlightBodyDropZone","getArea","headerArea","contentArea","contentWidth","contentHeight","positionHeader","visibleTabsLength","tabsContainerElementChildNodes","visibleTabElements","tabIndex","visibleTabElement","tabDropPlaceholder","headerRect","headerTop","headerLeft","tabTop","tabLeft","tabWidth","isAboveTab","tabRect","tabRectTop","tabRectLeft","insertAdjacentElement","min","tabDropPlaceholderRect","tabDropPlaceholderRectTop","tabDropPlaceholderRectLeft","tabDropPlaceholderRectWidth","placeHolderTop","clientHeight","bubblingEvent","startComponentDrag","DragProxy","_originalParent","_area","_lastValidArea","offsetX","offsetY","onDrag","createDragProxyElements","_componentItemFocused","setDimensions","determineMinMaxXY","calculateItemAreas","setDropPosition","initialX","initialY","headerElement","tabsElement","_proxyContainerElement","_sided","insertAdjacentText","_minX","_minY","_maxX","_maxY","ceil","droppedComponentItem","Splitter","_isVertical","_size","grabSize","_grabSize","dragHandleElement","handleExcessSize","handleExcessPos","RowOrColumn","_rowOrColumnParent","_splitter","_splitterSize","_splitterGrabSize","_isColumn","_dimension","_splitterPosition","_splitterMinPosition","_splitterMaxPosition","_configType","createdItem","splitterElement","createSplitter","max","newItemSize","indexedContentItem","itemSize","splitterIndex","childItem","calculateRelativeSizes","setAbsoluteSizes","absoluteSizes","calculateAbsoluteSizes","additionalPixel","itemSizes","crossAxisSize","totalSplitterSize","elementWidth","elementHeight","totalSize","totalAssigned","total","itemsWithFractionalSize","totalFractionalSize","round","fractionalAllocatedSize","respectMinItemSize","minItemSize","calculateContentItemMinSize","totalOverMin","totalUnderMin","entriesOverMin","allEntries","entry","reducePercent","remainingSize","reducedSize","splitter","onSplitterDrag","onSplitterDragStop","onSplitterDragStart","getSplitItems","before","after","calculateContentItemsTotalMinSize","totalMinSize","items","beforeWidth","afterSize","beforeMinSize","afterMinSize","offset","offsetPixels","sizeBefore","sizeAfter","splitterPositionInRange","totalRelativeSize","getElementDimensionSize","dimension","getElementWidth","getElementHeight","setElementDimensionSize","GroundItem","_containerElement","prev","previousSibling","lastChild","Element","contains","loadRoot","clearRoot","rootContentItem","loadComponentAsRoot","createSideAreas","oppositeSides","Area","sibling","validateDocking","getAllContentItems","deepGetAllContentItems","getConfigMaximisedItems","deepFilterContentItems","popInParentId","checkAcceptFtn","DragSource","_extraAllowableChildTargets","_componentTypeOrFtn","_componentState","_dummyGroundContainer","dummyRootItemConfig","_dummyGroundContentItem","createDragListener","removeDragListener","onDragStop","dragSourceItemConfig","ftnDragSourceItemConfig","isDragSourceComponentItemConfig","dragProxy","transitionIndicator","transitionElements","DropTargetIndicator","innerElement","margin","TransitionIndicator","_toElement","_fromDimensions","_totalAnimationDuration","_animationStartTime","fromElement","toElement","nextAnimationFrame","measure","EventHub","_childEventListener","childEvent","onEventFromChild","ChildEventName","emitUserBroadcast","handleUserBroadcastEvent","isSubWindow","propagateToParent","propagateToThisAndSubtree","detail","eventInit","bubbles","cancelable","CustomEvent","opener","dispatchEvent","childGl","eventHub","LayoutManager","parameters","resizeWithContainerAutomatically","resizeDebounceInterval","resizeDebounceExtendedWhenPossible","_groundItem","_openPopouts","_dropTargetIndicator","_transitionIndicator","_itemAreas","_maximisePlaceholder","createMaximisePlaceElement","_tabDropPlaceholder","createTabDropPlaceholderElement","_dragSources","_updatingColumnsResponsive","_firstLoad","_eventHub","_virtualSizedContainers","_virtualSizedContainerAddingBeginCount","_sizeInvalidationBeginCount","_resizeObserver","ResizeObserver","handleContainerResize","_windowBeforeUnloadListener","onBeforeUnload","_windowBeforeUnloadListening","_maximisedStackBeforeDestroyedListener","cleanupBeforeMaximisedStackDestroyed","_constructorOrSubWindowLayoutConfig","constructorOrSubWindowLayoutConfig","rootItem","focusedComponentItem","_focusedComponentItem","_maximisedStack","deprecatedConstructor","closeAllOpenPopouts","disconnect","checkClearResizeTimeout","dragSource","subWindowRootConfig","setContainer","updateSizeFromContainer","resolvedLayoutConfig","checkLoadedLayoutMaximiseItem","observe","adjustColumnsResponsive","loadLayout","createSubWindows","groundContent","reconcilePopoutWindows","clear","newComponentAtLocation","locationSelectors","addComponentAtLocation","addItemAtLocation","newItemAtLocation","defaultLocationSelectors","findFirstLocation","addIdx","updateRootSize","createContentItemFromConfig","findFirstComponentItemById","findFirstContentItemTypeByIdRecursive","createPopout","itemConfigOrContentItem","positionAndSize","createPopoutFromItemConfig","child","windowLeft","windowTop","offsetLeft","offsetTop","beforeVirtualRectingEvent","afterVirtualRectingEvent","popoutLayoutConfig","createPopoutFromPopoutLayoutConfig","configWindow","initialWindow","newDragSource","componentTypeOrItemConfigCallback","removeDragSource","array","removeFromArray","focusComponent","clearComponentFocus","suppressEvents","newFocusedParentItem","oldFocusedItem","oldFocusedParentItem","processMinimiseMaximisedStack","processMaximiseStack","matchingArea","smallestSurface","Infinity","allContentItems","stackContentAreaDimensions","groundArea","configMaximisedItems","prepend","closed","processResizeWithDebounce","_resizeTimeoutId","bodyElement","documentElement","padding","overflow","useResponsiveLayout","columnCount","minItemWidth","stackColumnCount","allStacks","getAllStacks","firstStackContainer","addChildContentItemsToContainer","alwaysResponsiveMode","onLoadResponsiveModeAndFirst","stacks","findAllStacksRecursive","findFirstContentItemType","findFirstContentItemTypeRecursive","foundContentItem","selectors","selector","findLocation","selectorIndex","typeId","parentContentItems","parentContentItemCount","tryCreateLocationFromParentItem","groundContentItems","afterFocusedItemIfPossibleLocationSelectors","VirtualLayout","configOrOptionalContainer","containerOrBindComponentEventHandler","unbindComponentEventHandler","skipInit","createLayoutManagerConstructorParameters","_bindComponentEventHanlderPassedInConstructor","_creationTimeoutPassed","bindComponentEvent","unbindComponentEvent","readyState","clearHtmlAndAdjustStylesForSubWindow","headElement","head","appendNodeLists","querySelectorAll","listIdx","appendNodeList","nodeIdx","innerHTML","visibility","checkAddDefaultPopinButton","popInButtonElement","iconElement","bgElement","getComponentEvent","releaseComponentEvent","subWindowChecked","windowConfigKey","windowConfigStr","getItem","removeItem","minifiedWindowConfig","parse","HTMLElement","golden","_componentTypesMap","_registeredComponentMap","_virtuableComponentMap","_containerVirtualRectingRequiredEventListener","handleContainerVirtualRectingRequiredEvent","_containerVirtualVisibilityChangeRequiredEventListener","handleContainerVirtualVisibilityChangeRequiredEvent","_containerVirtualZIndexChangeRequiredEventListener","handleContainerVirtualZIndexChangeRequiredEvent","registerComponent","componentConstructorOrFactoryFtn","componentConstructor","registerComponentConstructor","componentFactoryFtn","registerComponentFactoryFunction","typeName","factoryFunction","componentFactoryFunction","registerComponentFunction","registerGetComponentConstructorCallback","_getComponentConstructorFtn","warn","getRegisteredComponentTypeNames","typeNamesIterableIterator","getComponentInstantiator","instantiator","virtuableComponent","componentRootElement","rootHtmlElement","absolutePosition","ensureElementPositionAbsolute","delete","_goldenLayoutBoundingClientRect","rootElement","containerBoundingClientRect","template","concat","minItemHeight"],"sourceRoot":""} \ No newline at end of file