diff --git a/packages/monster/CHANGELOG b/packages/monster/CHANGELOG
index 3e2321996134d629ed2818d6fac5097829156523..c24a0651b0d817e44a51091022a881f24118ba4c 100644
--- a/packages/monster/CHANGELOG
+++ b/packages/monster/CHANGELOG
@@ -2,13 +2,18 @@
 
 All notable changes to this project will be documented in this file.
 
+## [1.31.0] - 2022-02-07
+
+## Added
+
+- [new promise domReady and windowReady](https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/116)
+
 ## [1.30.0] - 2022-02-05
 
 ## Added
 
 - [new class DeadMansSwitch](https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/115)
 
-
 ## [1.29.3] - 2022-01-23
 
 ## Fixed
diff --git a/packages/monster/dist/modules/constants.js b/packages/monster/dist/modules/constants.js
index a3e47c27910606c1da64bb72bba36b9fcb934858..aebb037f95a4e2aacdf76154797a4f182bdd23bc 100644
--- a/packages/monster/dist/modules/constants.js
+++ b/packages/monster/dist/modules/constants.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{Monster}from"./namespace.js";const internalSymbol=Symbol("internalData"),internalStateSymbol=Symbol("state");export{Monster,internalSymbol,internalStateSymbol};
\ No newline at end of file
+'use strict';import{Monster}from"./namespace.js";const internalSymbol=Symbol("internalData");const internalStateSymbol=Symbol("state");export{Monster,internalSymbol,internalStateSymbol};
diff --git a/packages/monster/dist/modules/constraints/abstract.js b/packages/monster/dist/modules/constraints/abstract.js
index 0e6a7b08756dec330f556627270ee83ad86345eb..664cf3e2257c16c7a0d2fcfdec72a23d4cb7eb4c 100644
--- a/packages/monster/dist/modules/constraints/abstract.js
+++ b/packages/monster/dist/modules/constraints/abstract.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";class AbstractConstraint extends Base{constructor(){super()}isValid(s){return Promise.reject(s)}}assignToNamespace("Monster.Constraints",AbstractConstraint);export{Monster,AbstractConstraint};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";class AbstractConstraint extends Base{constructor(){super()}isValid(value){return Promise.reject(value)}}assignToNamespace("Monster.Constraints",AbstractConstraint);export{Monster,AbstractConstraint};
diff --git a/packages/monster/dist/modules/constraints/abstractoperator.js b/packages/monster/dist/modules/constraints/abstractoperator.js
index 56610fb51bb045b6cb8a9a3748db792c3beeaa48..72823e2efe16c363470d6234a7d391edd6ab9aaf 100644
--- a/packages/monster/dist/modules/constraints/abstractoperator.js
+++ b/packages/monster/dist/modules/constraints/abstractoperator.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractConstraint}from"./abstract.js";class AbstractOperator extends AbstractConstraint{constructor(t,r){if(super(),!(t instanceof AbstractConstraint&&r instanceof AbstractConstraint))throw new TypeError("parameters must be from type AbstractConstraint");this.operantA=t,this.operantB=r}}assignToNamespace("Monster.Constraints",AbstractOperator);export{Monster,AbstractOperator};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{AbstractConstraint}from"./abstract.js";class AbstractOperator extends AbstractConstraint{constructor(operantA,operantB){super();if(!(operantA instanceof AbstractConstraint)||!(operantB instanceof AbstractConstraint)){throw new TypeError("parameters must be from type AbstractConstraint")}this.operantA=operantA;this.operantB=operantB}}assignToNamespace("Monster.Constraints",AbstractOperator);export{Monster,AbstractOperator};
diff --git a/packages/monster/dist/modules/constraints/andoperator.js b/packages/monster/dist/modules/constraints/andoperator.js
index e4642429a55047d4931929aa7a4e9f45c7c677bb..ac775a7e5fe1bc9c1c64cff322545077e525de62 100644
--- a/packages/monster/dist/modules/constraints/andoperator.js
+++ b/packages/monster/dist/modules/constraints/andoperator.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractOperator}from"./abstractoperator.js";class AndOperator extends AbstractOperator{isValid(r){return Promise.all([this.operantA.isValid(r),this.operantB.isValid(r)])}}assignToNamespace("Monster.Constraints",AndOperator);export{Monster,AndOperator};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{AbstractOperator}from"./abstractoperator.js";class AndOperator extends AbstractOperator{isValid(value){return Promise.all([this.operantA.isValid(value),this.operantB.isValid(value)])}}assignToNamespace("Monster.Constraints",AndOperator);export{Monster,AndOperator};
diff --git a/packages/monster/dist/modules/constraints/invalid.js b/packages/monster/dist/modules/constraints/invalid.js
index b49d771b95c0fc58cd952292ec0ff07714de983e..b40b4dca6ceb6da005cf0382660aa758d339f0ab 100644
--- a/packages/monster/dist/modules/constraints/invalid.js
+++ b/packages/monster/dist/modules/constraints/invalid.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractConstraint}from"./abstract.js";class Invalid extends AbstractConstraint{isValid(s){return Promise.reject(s)}}assignToNamespace("Monster.Constraints",Invalid);export{Monster,Invalid};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{AbstractConstraint}from"./abstract.js";class Invalid extends AbstractConstraint{isValid(value){return Promise.reject(value)}}assignToNamespace("Monster.Constraints",Invalid);export{Monster,Invalid};
diff --git a/packages/monster/dist/modules/constraints/isarray.js b/packages/monster/dist/modules/constraints/isarray.js
index 1d2def1424406c8e566077b6fd30260c7236e885..611fb95b12465cadce80bad84848bf1ad3f3e873 100644
--- a/packages/monster/dist/modules/constraints/isarray.js
+++ b/packages/monster/dist/modules/constraints/isarray.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isArray}from"../types/is.js";import{AbstractConstraint}from"./abstract.js";class IsArray extends AbstractConstraint{isValid(s){return isArray(s)?Promise.resolve(s):Promise.reject(s)}}assignToNamespace("Monster.Constraints",IsArray);export{Monster,IsArray};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{isArray}from"../types/is.js";import{AbstractConstraint}from"./abstract.js";class IsArray extends AbstractConstraint{isValid(value){if(isArray(value)){return Promise.resolve(value)}return Promise.reject(value)}}assignToNamespace("Monster.Constraints",IsArray);export{Monster,IsArray};
diff --git a/packages/monster/dist/modules/constraints/isobject.js b/packages/monster/dist/modules/constraints/isobject.js
index d491c53c72a79e7e810cb9e9db9341ecf626d8eb..4f04d212ee85b71371a7ee64a46e6e42e809955a 100644
--- a/packages/monster/dist/modules/constraints/isobject.js
+++ b/packages/monster/dist/modules/constraints/isobject.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isObject}from"../types/is.js";import{AbstractConstraint}from"./abstract.js";class IsObject extends AbstractConstraint{isValid(s){return isObject(s)?Promise.resolve(s):Promise.reject(s)}}assignToNamespace("Monster.Constraints",IsObject);export{Monster,IsObject};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{isObject}from"../types/is.js";import{AbstractConstraint}from"./abstract.js";class IsObject extends AbstractConstraint{isValid(value){if(isObject(value)){return Promise.resolve(value)}return Promise.reject(value)}}assignToNamespace("Monster.Constraints",IsObject);export{Monster,IsObject};
diff --git a/packages/monster/dist/modules/constraints/namespace.js b/packages/monster/dist/modules/constraints/namespace.js
index 3e257b49531364fb31bc59fc056a3d2d6e02d46a..230d84a6f464b25fe2aaf93ac4d41239947f4444 100644
--- a/packages/monster/dist/modules/constraints/namespace.js
+++ b/packages/monster/dist/modules/constraints/namespace.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";const namespace="Monster.Constraints";export{namespace};
\ No newline at end of file
+'use strict';export const namespace="Monster.Constraints";
diff --git a/packages/monster/dist/modules/constraints/oroperator.js b/packages/monster/dist/modules/constraints/oroperator.js
index 9585ee4ffc70c1879336710e4e01c8bc832282e0..1916b87ee7bf1fedc402ec37bee8b4c5bd1b173c 100644
--- a/packages/monster/dist/modules/constraints/oroperator.js
+++ b/packages/monster/dist/modules/constraints/oroperator.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractOperator}from"./abstractoperator.js";class OrOperator extends AbstractOperator{isValid(s){var o=this;return new Promise(function(t,r){let a,e;o.operantA.isValid(s).then(function(){t()}).catch(function(){(a=!1)===e&&r()}),o.operantB.isValid(s).then(function(){t()}).catch(function(){(e=!1)===a&&r()})})}}assignToNamespace("Monster.Constraints",OrOperator);export{Monster,OrOperator};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{AbstractOperator}from"./abstractoperator.js";class OrOperator extends AbstractOperator{isValid(value){var self=this;return new Promise(function(resolve,reject){let a,b;self.operantA.isValid(value).then(function(){resolve()}).catch(function(){a=false;if(b===false){reject()}});self.operantB.isValid(value).then(function(){resolve()}).catch(function(){b=false;if(a===false){reject()}})})}}assignToNamespace("Monster.Constraints",OrOperator);export{Monster,OrOperator};
diff --git a/packages/monster/dist/modules/constraints/valid.js b/packages/monster/dist/modules/constraints/valid.js
index 2554dc2c863b1a77c530051fec86a41f3821c5e0..d0c5b572d56eeb867e251789bdf5f5bf7e94c295 100644
--- a/packages/monster/dist/modules/constraints/valid.js
+++ b/packages/monster/dist/modules/constraints/valid.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractConstraint}from"./abstract.js";class Valid extends AbstractConstraint{isValid(s){return Promise.resolve(s)}}assignToNamespace("Monster.Constraints",Valid);export{Monster,Valid};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{AbstractConstraint}from"./abstract.js";class Valid extends AbstractConstraint{isValid(value){return Promise.resolve(value)}}assignToNamespace("Monster.Constraints",Valid);export{Monster,Valid};
diff --git a/packages/monster/dist/modules/data/buildmap.js b/packages/monster/dist/modules/data/buildmap.js
index 590423da402c2eaa339b1eca9bdd6aab9868b047..2cca3d36aeca68d9800998126e6daab1454c9e8b 100644
--- a/packages/monster/dist/modules/data/buildmap.js
+++ b/packages/monster/dist/modules/data/buildmap.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isFunction,isObject,isString}from"../types/is.js";import{validateString}from"../types/validate.js";import{clone}from"../util/clone.js";import{DELIMITER,Pathfinder,WILDCARD}from"./pathfinder.js";const PARENT="^";function buildMap(t,e,a,n,i){return assembleParts(t,e,i,function(t,e,i){e=build(t,n,e),t=build(t,a),this.set(e,t)})}function assembleParts(t,e,a,n){const r=new Map;let i;if(isFunction(e)){if(i=e(t),!(i instanceof Map))throw new TypeError("the selector callback must return a map")}else{if(!isString(e))throw new TypeError("selector is neither a string nor a function");i=new Map,buildFlatMap.call(i,t,e)}return i instanceof Map&&i.forEach((t,e,i)=>{isFunction(a)&&!0!==a.call(i,t,e)||n.call(r,t,e,i)}),r}function buildFlatMap(i,e,a,n){var r=this;const s=new Map;var f=r.size;void 0===a&&(a=[]);let o=e.split(DELIMITER),t,l=[];do{if(t=o.shift(),l.push(t),t===WILDCARD){let t=new Pathfinder(i),e;try{e=t.getVia(l.join(DELIMITER))}catch(t){e=new Map}for(const[c,p]of e){let e=clone(a);l.map(t=>{e.push(t===WILDCARD?c:t)});var u=e.join(DELIMITER);let t=buildFlatMap.call(r,p,o.join(DELIMITER),e,p);isObject(t)&&void 0!==n&&(t[PARENT]=n),s.set(u,t)}}}while(0<o.length);if(f===r.size)for(var[d,h]of s)r.set(d,h);return i}function build(t,a,n){if(void 0===a)return n||t;validateString(a);const e=[...a.matchAll(/(?<placeholder>\${(?<path>[a-z\^A-Z.\-_0-9]*)})/gm)];let r=new Pathfinder(t);return 0===e.length?r.getVia(a):(e.forEach(e=>{var e=e?.groups,i=e?.placeholder;if(void 0!==i){e=e?.path;let t=r.getVia(e);void 0===t&&(t=n),a=a.replaceAll(i,t)}}),a)}assignToNamespace("Monster.Data",buildMap);export{PARENT,Monster,buildMap,assembleParts};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{isFunction,isObject,isString}from"../types/is.js";import{validateString}from"../types/validate.js";import{clone}from"../util/clone.js";import{DELIMITER,Pathfinder,WILDCARD}from"./pathfinder.js";export const PARENT="^";function buildMap(subject,selector,valueTemplate,keyTemplate,filter){return assembleParts(subject,selector,filter,function(v,k,m){k=build(v,keyTemplate,k);v=build(v,valueTemplate);this.set(k,v)})}function assembleParts(subject,selector,filter,callback){const result=new Map;let map;if(isFunction(selector)){map=selector(subject);if(!(map instanceof Map)){throw new TypeError("the selector callback must return a map")}}else if(isString(selector)){map=new Map;buildFlatMap.call(map,subject,selector)}else{throw new TypeError("selector is neither a string nor a function")}if(!(map instanceof Map)){return result}map.forEach((v,k,m)=>{if(isFunction(filter)){if(filter.call(m,v,k)!==true)return}callback.call(result,v,k,m)});return result}function buildFlatMap(subject,selector,key,parentMap){const result=this;const currentMap=new Map;const resultLength=result.size;if(key===undefined)key=[];let parts=selector.split(DELIMITER);let current="",currentPath=[];do{current=parts.shift();currentPath.push(current);if(current===WILDCARD){let finder=new Pathfinder(subject);let map;try{map=finder.getVia(currentPath.join(DELIMITER))}catch(e){let a=e;map=new Map}for(const[k,o]of map){let copyKey=clone(key);currentPath.map(a=>{copyKey.push(a===WILDCARD?k:a)});let kk=copyKey.join(DELIMITER);let sub=buildFlatMap.call(result,o,parts.join(DELIMITER),copyKey,o);if(isObject(sub)&&parentMap!==undefined){sub[PARENT]=parentMap}currentMap.set(kk,sub)}}}while(parts.length>0);if(resultLength===result.size){for(const[k,o]of currentMap){result.set(k,o)}}return subject}function build(subject,definition,defaultValue){if(definition===undefined)return defaultValue?defaultValue:subject;validateString(definition);const regexp=/(?<placeholder>\${(?<path>[a-z\^A-Z.\-_0-9]*)})/gm;const array=[...definition.matchAll(regexp)];let finder=new Pathfinder(subject);if(array.length===0){return finder.getVia(definition)}array.forEach(a=>{let groups=a?.["groups"];let placeholder=groups?.["placeholder"];if(placeholder===undefined)return;let path=groups?.["path"];let v=finder.getVia(path);if(v===undefined)v=defaultValue;definition=definition.replaceAll(placeholder,v)});return definition}assignToNamespace("Monster.Data",buildMap);export{Monster,buildMap,assembleParts};
diff --git a/packages/monster/dist/modules/data/buildtree.js b/packages/monster/dist/modules/data/buildtree.js
index f92bcb1d5ce8207e456275d2b03ef299dd22e6ab..49d28cb3d5dd45d202ea3a64862a2601b3f59add 100644
--- a/packages/monster/dist/modules/data/buildtree.js
+++ b/packages/monster/dist/modules/data/buildtree.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isArray,isObject}from"../types/is.js";import{Node}from"../types/node.js";import{NodeList}from"../types/nodelist.js";import{assembleParts}from"./buildmap.js";import{extend}from"./extend.js";const parentSymbol=Symbol("parent"),rootSymbol=Symbol("root");function buildTree(e,o,i,a,t){const n=new Map;isObject(t)||(t={});var s=(t=extend({},{rootReferences:[null,void 0],filter:void 0},t))?.filter;let d=t.rootReferences;isArray(d)||(d=[d]);const r=assembleParts(e,o,s,function(e,o,t){var s=e?.[i];let r=e?.[a];if(-1!==d.indexOf(r)&&(r=rootSymbol),void 0===s)throw new Error("the object has no value for the specified id");e[parentSymbol]=r;e=new Node(e);this.has(r)?this.get(r).add(e):this.set(r,(new NodeList).add(e)),n.set(s,e)}),m=(n.forEach(e=>{var o=e?.value?.[i];r.has(o)&&(e.childNodes=r.get(o),r.delete(o))}),new NodeList);return r.forEach(e=>{e instanceof Set&&e.forEach(e=>{m.add(e)})}),m}assignToNamespace("Monster.Data",buildTree);export{Monster,buildTree};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{isArray,isObject}from"../types/is.js";import{Node}from"../types/node.js";import{NodeList}from"../types/nodelist.js";import{assembleParts}from"./buildmap.js";import{extend}from"./extend.js";const parentSymbol=Symbol("parent");const rootSymbol=Symbol("root");function buildTree(subject,selector,idKey,parentIDKey,options){const nodes=new Map;if(!isObject(options)){options={}}options=extend({},{rootReferences:[null,undefined],filter:undefined},options);const filter=options?.filter;let rootReferences=options.rootReferences;if(!isArray(rootReferences)){rootReferences=[rootReferences]}const childMap=assembleParts(subject,selector,filter,function(o,k,m){const key=o?.[idKey];let ref=o?.[parentIDKey];if(rootReferences.indexOf(ref)!==-1)ref=rootSymbol;if(key===undefined){throw new Error("the object has no value for the specified id")}o[parentSymbol]=ref;const node=new Node(o);this.has(ref)?this.get(ref).add(node):this.set(ref,new NodeList().add(node));nodes.set(key,node)});nodes.forEach(node=>{let id=node?.["value"]?.[idKey];if(childMap.has(id)){node.childNodes=childMap.get(id);childMap.delete(id)}});const list=new NodeList;childMap.forEach(s=>{if(s instanceof Set){s.forEach(n=>{list.add(n)})}});return list}assignToNamespace("Monster.Data",buildTree);export{Monster,buildTree};
diff --git a/packages/monster/dist/modules/data/datasource.js b/packages/monster/dist/modules/data/datasource.js
index c7398b94dc881059cafc7eb44e4154eeca08550b..2365c89567d422748091a879ffff32a0e07aa1d9 100644
--- a/packages/monster/dist/modules/data/datasource.js
+++ b/packages/monster/dist/modules/data/datasource.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../constants.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{parseDataURL}from"../types/dataurl.js";import{isString}from"../types/is.js";import{ProxyObserver}from"../types/proxyobserver.js";import{validateObject}from"../types/validate.js";import{extend}from"./extend.js";import{Pathfinder}from"./pathfinder.js";const internalDataSymbol=Symbol("internalData");class Datasource extends Base{constructor(){super(),this[internalSymbol]=new ProxyObserver({options:extend({},this.defaults)}),this[internalDataSymbol]=new ProxyObserver({})}attachObserver(t){return this[internalDataSymbol].attachObserver(t),this}detachObserver(t){return this[internalDataSymbol].detachObserver(t),this}containsObserver(t){return this[internalDataSymbol].containsObserver(t)}get defaults(){return{}}setOption(t,e){return new Pathfinder(this[internalSymbol].getSubject().options).setVia(t,e),this}setOptions(t){isString(t)&&(t=parseOptionsJSON(t));var e=this;return extend(e[internalSymbol].getSubject().options,e.defaults,t),e}getOption(t,e){let r;try{r=new Pathfinder(this[internalSymbol].getRealSubject().options).getVia(t)}catch(t){}return void 0===r?e:r}read(){throw new Error("this method must be implemented by derived classes")}write(){throw new Error("this method must be implemented by derived classes")}get(){return this[internalDataSymbol].getRealSubject()}set(t){return this[internalDataSymbol].setSubject(t),this}}function parseOptionsJSON(e){if(isString(e)){try{e=parseDataURL(e).content}catch(t){}try{var t=JSON.parse(e);return validateObject(t),t}catch(t){throw new Error("the options does not contain a valid json definition (actual: "+e+").")}}return{}}assignToNamespace("Monster.Data",Datasource);export{Monster,Datasource};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../constants.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{parseDataURL}from"../types/dataurl.js";import{isString}from"../types/is.js";import{ProxyObserver}from"../types/proxyobserver.js";import{validateObject}from"../types/validate.js";import{extend}from"./extend.js";import{Pathfinder}from"./pathfinder.js";const internalDataSymbol=Symbol("internalData");class Datasource extends Base{constructor(){super();this[internalSymbol]=new ProxyObserver({"options":extend({},this.defaults)});this[internalDataSymbol]=new ProxyObserver({})}attachObserver(observer){this[internalDataSymbol].attachObserver(observer);return this}detachObserver(observer){this[internalDataSymbol].detachObserver(observer);return this}containsObserver(observer){return this[internalDataSymbol].containsObserver(observer)}get defaults(){return{}}setOption(path,value){new Pathfinder(this[internalSymbol].getSubject()["options"]).setVia(path,value);return this}setOptions(options){if(isString(options)){options=parseOptionsJSON(options)}const self=this;extend(self[internalSymbol].getSubject()["options"],self.defaults,options);return self}getOption(path,defaultValue){let value;try{value=new Pathfinder(this[internalSymbol].getRealSubject()["options"]).getVia(path)}catch(e){}if(value===undefined)return defaultValue;return value}read(){throw new Error("this method must be implemented by derived classes")}write(){throw new Error("this method must be implemented by derived classes")}get(){const self=this;return self[internalDataSymbol].getRealSubject()}set(data){const self=this;self[internalDataSymbol].setSubject(data);return self}}function parseOptionsJSON(data){if(isString(data)){try{let dataUrl=parseDataURL(data);data=dataUrl.content}catch(e){}try{let obj=JSON.parse(data);validateObject(obj);return obj}catch(e){throw new Error("the options does not contain a valid json definition (actual: "+data+").")}}return{}}assignToNamespace("Monster.Data",Datasource);export{Monster,Datasource};
diff --git a/packages/monster/dist/modules/data/datasource/namespace.js b/packages/monster/dist/modules/data/datasource/namespace.js
index 78fd4dbd781463affe86ab631fba030b34ad03a2..7d8db377a65b6237cf5dc2c8f9ed7aaef14fb796 100644
--- a/packages/monster/dist/modules/data/datasource/namespace.js
+++ b/packages/monster/dist/modules/data/datasource/namespace.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";const namespace="Monster.Data.Datasource";export{namespace};
\ No newline at end of file
+'use strict';export const namespace="Monster.Data.Datasource";
diff --git a/packages/monster/dist/modules/data/datasource/restapi.js b/packages/monster/dist/modules/data/datasource/restapi.js
index fdcf7e1f8086df5de94c30122367d945ed02d7b7..b3888a737a63fb901881c6b2921a26d4b6f3cb42 100644
--- a/packages/monster/dist/modules/data/datasource/restapi.js
+++ b/packages/monster/dist/modules/data/datasource/restapi.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../../constants.js";import{assignToNamespace,Monster}from"../../namespace.js";import{isObject}from"../../types/is.js";import{Datasource}from"../datasource.js";import{Pathfinder}from"../pathfinder.js";import{Pipe}from"../pipe.js";import{WriteError}from"./restapi/writeerror.js";class RestAPI extends Datasource{constructor(t,e){super();const r={};isObject(t)&&(r.read=t),isObject(e)&&(r.write=e),this.setOptions(r)}get defaults(){return Object.assign({},super.defaults,{write:{init:{method:"POST"},acceptedStatus:[200,201],url:void 0,mapping:{transformer:void 0,callbacks:[]},report:{path:void 0}},read:{init:{method:"GET"},acceptedStatus:[200],url:void 0,mapping:{transformer:void 0,callbacks:[]}}})}read(){const s=this;let n,t=s.getOption("read.init");return isObject(t)||(t={}),fetch(s.getOption("read.url"),t).then(t=>{n=t;const e=s.getOption("read.acceptedStatus",[200]);if(-1===e.indexOf(t.status))throw Error("the data cannot be read (response "+t.status+")");return t.text()}).then(e=>{let t;try{t=JSON.parse(e)}catch(t){throw 100<e.length&&(e=e.substring(0,97)+"..."),new Error("the response does not contain a valid json (actual: "+e+").")}e=s.getOption("read.mapping.transformer");if(void 0!==e){const r=new Pipe(e);t=r.run(t)}return s.set(t),n})}write(){const e=this;let t=e.getOption("write.init"),r=(isObject(t)||(t={}),"object"!=typeof t.headers&&(t.headers={"Content-Type":"application/json"}),e.get());var s=e.getOption("write.mapping.transformer");if(void 0!==s){const a=new Pipe(s);r=a.run(r)}var n,s=e.getOption("write.sheathing.object"),i=e.getOption("write.sheathing.path");let o=e.getOption("write.report.path");return s&&i&&(n=r,r=s,new Pathfinder(r).setVia(i,n)),t.body=JSON.stringify(r),fetch(e.getOption("write.url"),t).then(s=>{const t=e.getOption("write.acceptedStatus",[200,2001]);return-1===t.indexOf(s.status)?s.text().then(e=>{let t,r;try{t=JSON.parse(e),r=new Pathfinder(t).getVia(o)}catch(t){throw 100<e.length&&(e=e.substring(0,97)+"..."),new Error("the response does not contain a valid json (actual: "+e+").")}throw new WriteError("the data cannot be written (response "+s.status+")",s,r)}):s})}getClone(){return new RestAPI(this[internalSymbol].getRealSubject().options.read,this[internalSymbol].getRealSubject().options.write)}}assignToNamespace("Monster.Data.Datasource",RestAPI);export{Monster,RestAPI};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../../constants.js";import{assignToNamespace,Monster}from"../../namespace.js";import{isObject}from"../../types/is.js";import{Datasource}from"../datasource.js";import{Pathfinder}from"../pathfinder.js";import{Pipe}from"../pipe.js";import{WriteError}from"./restapi/writeerror.js";class RestAPI extends Datasource{constructor(readDefinition,writeDefinition){super();const options={};if(isObject(readDefinition))options.read=readDefinition;if(isObject(writeDefinition))options.write=writeDefinition;this.setOptions(options)}get defaults(){return Object.assign({},super.defaults,{write:{init:{method:"POST"},acceptedStatus:[200,201],url:undefined,mapping:{transformer:undefined,callbacks:[]},report:{path:undefined}},read:{init:{method:"GET"},acceptedStatus:[200],url:undefined,mapping:{transformer:undefined,callbacks:[]}}})}read(){const self=this;let response;let init=self.getOption("read.init");if(!isObject(init))init={};return fetch(self.getOption("read.url"),init).then(resp=>{response=resp;const acceptedStatus=self.getOption("read.acceptedStatus",[200]);if(acceptedStatus.indexOf(resp.status)===-1){throw Error("the data cannot be read (response "+resp.status+")")}return resp.text()}).then(body=>{let obj;try{obj=JSON.parse(body)}catch(e){if(body.length>100){body=body.substring(0,97)+"..."}throw new Error("the response does not contain a valid json (actual: "+body+").")}let transformation=self.getOption("read.mapping.transformer");if(transformation!==undefined){const pipe=new Pipe(transformation);obj=pipe.run(obj)}self.set(obj);return response})}write(){const self=this;let init=self.getOption("write.init");if(!isObject(init))init={};if(typeof init["headers"]!=="object"){init["headers"]={"Content-Type":"application/json"}}let obj=self.get();let transformation=self.getOption("write.mapping.transformer");if(transformation!==undefined){const pipe=new Pipe(transformation);obj=pipe.run(obj)}let sheathingObject=self.getOption("write.sheathing.object");let sheathingPath=self.getOption("write.sheathing.path");let reportPath=self.getOption("write.report.path");if(sheathingObject&&sheathingPath){const sub=obj;obj=sheathingObject;new Pathfinder(obj).setVia(sheathingPath,sub)}init["body"]=JSON.stringify(obj);return fetch(self.getOption("write.url"),init).then(response=>{const acceptedStatus=self.getOption("write.acceptedStatus",[200,2001]);if(acceptedStatus.indexOf(response.status)===-1){return response.text().then(body=>{let obj,validation;try{obj=JSON.parse(body);validation=new Pathfinder(obj).getVia(reportPath)}catch(e){if(body.length>100){body=body.substring(0,97)+"..."}throw new Error("the response does not contain a valid json (actual: "+body+").")}throw new WriteError("the data cannot be written (response "+response.status+")",response,validation)})}return response})}getClone(){const self=this;return new RestAPI(self[internalSymbol].getRealSubject()["options"].read,self[internalSymbol].getRealSubject()["options"].write)}}assignToNamespace("Monster.Data.Datasource",RestAPI);export{Monster,RestAPI};
diff --git a/packages/monster/dist/modules/data/datasource/restapi/writeerror.js b/packages/monster/dist/modules/data/datasource/restapi/writeerror.js
index cc8cdc0f1dec665dc95394d65e3e252dec1bfe31..60a552d47a0c774417bf4704c9a19b3baf820e20 100644
--- a/packages/monster/dist/modules/data/datasource/restapi/writeerror.js
+++ b/packages/monster/dist/modules/data/datasource/restapi/writeerror.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../../../constants.js";import{assignToNamespace,Monster}from"../../../namespace.js";class WriteError extends Error{constructor(r,e,t){super(r),this[internalSymbol]={response:e,validation:t}}getResponse(){return this[internalSymbol].response}getValidation(){return this[internalSymbol].validation}}assignToNamespace("Monster.Data.Datasource.RestAPI",WriteError);export{Monster,WriteError};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../../../constants.js";import{assignToNamespace,Monster}from"../../../namespace.js";class WriteError extends Error{constructor(message,response,validation){super(message);this[internalSymbol]={response:response,validation:validation}}getResponse(){return this[internalSymbol]["response"]}getValidation(){return this[internalSymbol]["validation"]}}assignToNamespace("Monster.Data.Datasource.RestAPI",WriteError);export{Monster,WriteError};
diff --git a/packages/monster/dist/modules/data/datasource/storage.js b/packages/monster/dist/modules/data/datasource/storage.js
index 44909433ec06e1479b70b14cc863d3707ffa9051..2a4215a19de153ea78b6f1e156369cbb2f4a2a3d 100644
--- a/packages/monster/dist/modules/data/datasource/storage.js
+++ b/packages/monster/dist/modules/data/datasource/storage.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../../constants.js";import{assignToNamespace,Monster}from"../../namespace.js";import{validateString}from"../../types/validate.js";import{Datasource}from"../datasource.js";const storageObjectSymbol=Symbol("storageObject");class Storage extends Datasource{constructor(e){super(),this.setOption("key",validateString(e))}get defaults(){return Object.assign({},super.defaults,{key:void 0})}[storageObjectSymbol](){throw new Error("this method must be implemented by derived classes")}read(){const o=this,s=o[storageObjectSymbol]();return new Promise(function(e){var t=JSON.parse(s.getItem(o.getOption("key")));o.set(t??{}),e()})}write(){const o=this,s=o[storageObjectSymbol]();return new Promise(function(e){var t=o.get();void 0===t?s.removeItem(o.getOption("key")):s.setItem(o.getOption("key"),JSON.stringify(t)),e()})}getClone(){return new Storage(this[internalSymbol].getRealSubject().options.key)}}assignToNamespace("Monster.Data.Datasource",Storage);export{Monster,Storage,storageObjectSymbol};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../../constants.js";import{assignToNamespace,Monster}from"../../namespace.js";import{validateString}from"../../types/validate.js";import{Datasource}from"../datasource.js";const storageObjectSymbol=Symbol("storageObject");class Storage extends Datasource{constructor(key){super();this.setOption("key",validateString(key))}get defaults(){return Object.assign({},super.defaults,{key:undefined})}[storageObjectSymbol](){throw new Error("this method must be implemented by derived classes")}read(){const self=this;const storage=self[storageObjectSymbol]();return new Promise(function(resolve){const data=JSON.parse(storage.getItem(self.getOption("key")));self.set(data??{});resolve()})}write(){const self=this;const storage=self[storageObjectSymbol]();return new Promise(function(resolve){const data=self.get();if(data===undefined){storage.removeItem(self.getOption("key"))}else{storage.setItem(self.getOption("key"),JSON.stringify(data))}resolve()})}getClone(){const self=this;return new Storage(self[internalSymbol].getRealSubject()["options"].key)}}assignToNamespace("Monster.Data.Datasource",Storage);export{Monster,Storage,storageObjectSymbol};
diff --git a/packages/monster/dist/modules/data/datasource/storage/localstorage.js b/packages/monster/dist/modules/data/datasource/storage/localstorage.js
index e8a0a2889afc4c3b6a03214fe2c1abab77ec3abd..60bdce190da00f11fc989fec9aa4a8460d40d56d 100644
--- a/packages/monster/dist/modules/data/datasource/storage/localstorage.js
+++ b/packages/monster/dist/modules/data/datasource/storage/localstorage.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../../../constants.js";import{assignToNamespace,Monster}from"../../../namespace.js";import{getGlobalObject}from"../../../types/global.js";import{Datasource}from"../../datasource.js";import{Storage,storageObjectSymbol}from"../storage.js";class LocalStorage extends Storage{[storageObjectSymbol](){return getGlobalObject("localStorage")}getClone(){return new LocalStorage(this[internalSymbol].getRealSubject().options.key)}}assignToNamespace("Monster.Data.Datasource.Storage",LocalStorage);export{Monster,LocalStorage};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../../../constants.js";import{assignToNamespace,Monster}from"../../../namespace.js";import{getGlobalObject}from"../../../types/global.js";import{Datasource}from"../../datasource.js";import{Storage,storageObjectSymbol}from"../storage.js";class LocalStorage extends Storage{[storageObjectSymbol](){return getGlobalObject("localStorage")}getClone(){const self=this;return new LocalStorage(self[internalSymbol].getRealSubject()["options"].key)}}assignToNamespace("Monster.Data.Datasource.Storage",LocalStorage);export{Monster,LocalStorage};
diff --git a/packages/monster/dist/modules/data/datasource/storage/namespace.js b/packages/monster/dist/modules/data/datasource/storage/namespace.js
index 00cd997dbc7afeb1ff56678cdb33277e80014067..547d481bbe793368fc0dcfc105b88f916344156a 100644
--- a/packages/monster/dist/modules/data/datasource/storage/namespace.js
+++ b/packages/monster/dist/modules/data/datasource/storage/namespace.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";const namespace="Monster.Data.Datasource.Storage";export{namespace};
\ No newline at end of file
+'use strict';export const namespace="Monster.Data.Datasource.Storage";
diff --git a/packages/monster/dist/modules/data/datasource/storage/sessionstorage.js b/packages/monster/dist/modules/data/datasource/storage/sessionstorage.js
index d0f3d8a7564da9faa705c64ba237b261af79bca8..51246984475115125f32c32e2c18dedf75e69392 100644
--- a/packages/monster/dist/modules/data/datasource/storage/sessionstorage.js
+++ b/packages/monster/dist/modules/data/datasource/storage/sessionstorage.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../../../constants.js";import{assignToNamespace,Monster}from"../../../namespace.js";import{getGlobalObject}from"../../../types/global.js";import{Datasource}from"../../datasource.js";import{Storage,storageObjectSymbol}from"../storage.js";class SessionStorage extends Storage{[storageObjectSymbol](){return getGlobalObject("sessionStorage")}getClone(){return new SessionStorage(this[internalSymbol].getRealSubject().options.key)}}assignToNamespace("Monster.Data.Datasource.Storage",SessionStorage);export{Monster,SessionStorage};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../../../constants.js";import{assignToNamespace,Monster}from"../../../namespace.js";import{getGlobalObject}from"../../../types/global.js";import{Datasource}from"../../datasource.js";import{Storage,storageObjectSymbol}from"../storage.js";class SessionStorage extends Storage{[storageObjectSymbol](){return getGlobalObject("sessionStorage")}getClone(){const self=this;return new SessionStorage(self[internalSymbol].getRealSubject()["options"].key)}}assignToNamespace("Monster.Data.Datasource.Storage",SessionStorage);export{Monster,SessionStorage};
diff --git a/packages/monster/dist/modules/data/diff.js b/packages/monster/dist/modules/data/diff.js
index 7e8631509b2453a9a5431f80e4f72b9b4075d615..0cce17a3519759247c66c661ae1c68729e42269f 100644
--- a/packages/monster/dist/modules/data/diff.js
+++ b/packages/monster/dist/modules/data/diff.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isArray,isObject}from"../types/is.js";import{typeOf}from"../types/typeof.js";function diff(e,t){return doDiff(e,t)}function getKeys(e,t,n){if(isArray(n)){const o=e.length>t.length?new Array(e.length):new Array(t.length);return o.fill(0),new Set(o.map((e,t)=>t))}return new Set(Object.keys(e).concat(Object.keys(t)))}function doDiff(t,n,e,o){var r=typeOf(t),s=typeOf(n);const a=e||[],i=o||[];return r!==s||"object"!==r&&"array"!==r?void 0!==(o=getOperator(t,n,r,s))&&i.push(buildResult(t,n,o,e)):getKeys(t,n,r).forEach(e=>{Object.prototype.hasOwnProperty.call(t,e)?Object.prototype.hasOwnProperty.call(n,e)?doDiff(t[e],n[e],a.concat(e),i):i.push(buildResult(t[e],n[e],"delete",a.concat(e))):i.push(buildResult(t[e],n[e],"add",a.concat(e)))}),i}function buildResult(e,t,n,o){const r={operator:n,path:o};return"add"!==n&&(r.first={value:e,type:typeof e},!isObject(e)||void 0!==(o=Object.getPrototypeOf(e)?.constructor?.name)&&(r.first.instance=o)),"add"!==n&&"update"!==n||(r.second={value:t,type:typeof t},!isObject(t)||void 0!==(e=Object.getPrototypeOf(t)?.constructor?.name)&&(r.second.instance=e)),r}function isNotEqual(e,t){return typeof e!=typeof t||(e instanceof Date&&t instanceof Date?e.getTime()!==t.getTime():e!==t)}function getOperator(e,t){let n;var o=typeof e,r=typeof t;return"undefined"==o&&"undefined"!=r?n="add":"undefined"!=o&&"undefined"==r?n="delete":isNotEqual(e,t)&&(n="update"),n}assignToNamespace("Monster.Data",diff);export{Monster,diff};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{isArray,isObject}from"../types/is.js";import{typeOf}from"../types/typeof.js";function diff(first,second){return doDiff(first,second)}function getKeys(a,b,type){if(isArray(type)){const keys=a.length>b.length?new Array(a.length):new Array(b.length);keys.fill(0);return new Set(keys.map((_,i)=>i))}return new Set(Object.keys(a).concat(Object.keys(b)))}function doDiff(a,b,path,diff){let typeA=typeOf(a);let typeB=typeOf(b);const currPath=path||[];const currDiff=diff||[];if(typeA===typeB&&(typeA==="object"||typeA==="array")){getKeys(a,b,typeA).forEach(v=>{if(!Object.prototype.hasOwnProperty.call(a,v)){currDiff.push(buildResult(a[v],b[v],"add",currPath.concat(v)))}else if(!Object.prototype.hasOwnProperty.call(b,v)){currDiff.push(buildResult(a[v],b[v],"delete",currPath.concat(v)))}else{doDiff(a[v],b[v],currPath.concat(v),currDiff)}})}else{const o=getOperator(a,b,typeA,typeB);if(o!==undefined){currDiff.push(buildResult(a,b,o,path))}}return currDiff}function buildResult(a,b,operator,path){const result={operator,path};if(operator!=="add"){result.first={value:a,type:typeof a};if(isObject(a)){const name=Object.getPrototypeOf(a)?.constructor?.name;if(name!==undefined){result.first.instance=name}}}if(operator==="add"||operator==="update"){result.second={value:b,type:typeof b};if(isObject(b)){const name=Object.getPrototypeOf(b)?.constructor?.name;if(name!==undefined){result.second.instance=name}}}return result}function isNotEqual(a,b){if(typeof a!==typeof b){return true}if(a instanceof Date&&b instanceof Date){return a.getTime()!==b.getTime()}return a!==b}function getOperator(a,b){let operator;let typeA=typeof a;let typeB=typeof b;if(typeA==="undefined"&&typeB!=="undefined"){operator="add"}else if(typeA!=="undefined"&&typeB==="undefined"){operator="delete"}else if(isNotEqual(a,b)){operator="update"}return operator}assignToNamespace("Monster.Data",diff);export{Monster,diff};
diff --git a/packages/monster/dist/modules/data/extend.js b/packages/monster/dist/modules/data/extend.js
index 874ddb9a4fdc3f412fd5089c8813dfa7ab9c8553..534fce302e274adb1a9fc01951e7da1d17f523f7 100644
--- a/packages/monster/dist/modules/data/extend.js
+++ b/packages/monster/dist/modules/data/extend.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isArray,isObject}from"../types/is.js";import{typeOf}from"../types/typeof.js";function extend(){let e,t;for(t=0;t<arguments.length;t++){var r=arguments[t];if(!isObject(r)&&!isArray(r))throw new Error("unsupported argument "+JSON.stringify(r));if(void 0!==e)for(var s in r){var i=r?.[s];if(i!==e?.[s])if(isObject(i)&&"object"===typeOf(i)||isArray(i)){if(void 0===e[s])isArray(i)?e[s]=[]:e[s]={};else if(typeOf(e[s])!==typeOf(i))throw new Error("type mismatch: "+JSON.stringify(e[s])+"("+typeOf(e[s])+") != "+JSON.stringify(i)+"("+typeOf(i)+")");e[s]=extend(e[s],i)}else e[s]=i}else e=r}return e}assignToNamespace("Monster.Data",extend);export{Monster,extend};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{isArray,isObject}from"../types/is.js";import{typeOf}from"../types/typeof.js";function extend(){let o,i;for(i=0;i<arguments.length;i++){let a=arguments[i];if(!(isObject(a)||isArray(a))){throw new Error("unsupported argument "+JSON.stringify(a))}if(o===undefined){o=a;continue}for(let k in a){let v=a?.[k];if(v===o?.[k]){continue}if(isObject(v)&&typeOf(v)==="object"||isArray(v)){if(o[k]===undefined){if(isArray(v)){o[k]=[]}else{o[k]={}}}else{if(typeOf(o[k])!==typeOf(v)){throw new Error("type mismatch: "+JSON.stringify(o[k])+"("+typeOf(o[k])+") != "+JSON.stringify(v)+"("+typeOf(v)+")")}}o[k]=extend(o[k],v)}else{o[k]=v}}}return o}assignToNamespace("Monster.Data",extend);export{Monster,extend};
diff --git a/packages/monster/dist/modules/data/namespace.js b/packages/monster/dist/modules/data/namespace.js
index 3a9802a469c6c984d7acd8ca6bf4c2eea5b71851..0472f6d1e727e9962bb5aff8d846e0c0fda7e059 100644
--- a/packages/monster/dist/modules/data/namespace.js
+++ b/packages/monster/dist/modules/data/namespace.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";const namespace="Monster.Data";export{namespace};
\ No newline at end of file
+'use strict';export const namespace="Monster.Data";
diff --git a/packages/monster/dist/modules/data/pathfinder.js b/packages/monster/dist/modules/data/pathfinder.js
index 7fe318354cf61c7de091e246a5f7202953b5649b..1bf28c9a6a43ea5551c2c99e0887506c5b06fe15 100644
--- a/packages/monster/dist/modules/data/pathfinder.js
+++ b/packages/monster/dist/modules/data/pathfinder.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{isArray,isInteger,isObject,isPrimitive}from"../types/is.js";import{Stack}from"../types/stack.js";import{validateInteger,validateString}from"../types/validate.js";const DELIMITER=".",WILDCARD="*";class Pathfinder extends Base{constructor(t){if(super(),isPrimitive(t))throw new Error("the parameter must not be a simple type");this.object=t,this.wildCard=WILDCARD}setWildCard(t){return validateString(t),this.wildCard=t,this}getVia(t){return getValueViaPath.call(this,this.object,validateString(t))}setVia(t,e){return validateString(t),setValueViaPath.call(this,this.object,t,e),this}deleteVia(t){return validateString(t),deleteValueViaPath.call(this,this.object,t),this}exists(t){validateString(t);try{return getValueViaPath.call(this,this.object,t,!0),!0}catch(t){}return!1}}function iterate(t,e,a){const i=new Map;if(isObject(t)||isArray(t))for(var[r,s]of Object.entries(t))i.set(r,getValueViaPath.call(this,s,e,a));else{var n=e.split(DELIMITER).shift();i.set(n,getValueViaPath.call(this,t,e,a))}return i}function getValueViaPath(e,a,i){if(""===a)return e;let r=a.split(DELIMITER),s=r.shift();if(s===this.wildCard)return iterate.call(this,e,r.join(DELIMITER),i);if(isObject(e)||isArray(e)){let t;if(e instanceof Map||e instanceof WeakMap)t=e.get(s);else if(e instanceof Set||e instanceof WeakSet)s=parseInt(s),validateInteger(s),t=[...e][s];else{if("function"==typeof WeakRef&&e instanceof WeakRef)throw Error("unsupported action for this data type");t=(isArray(e)&&(s=parseInt(s),validateInteger(s)),e?.[s])}if(isObject(t)||isArray(t))return getValueViaPath.call(this,t,r.join(DELIMITER),i);if(0<r.length)throw Error("the journey is not at its end ("+r.join(DELIMITER)+")");if(!0===i){a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),s);if(!e.hasOwnProperty(s)&&void 0===a)throw Error("unknown value")}return t}throw TypeError("unsupported type "+typeof e)}function setValueViaPath(e,t,a){validateString(t);let i=t.split(DELIMITER),r=i.pop();var s,t=i.join(DELIMITER);let n=new Stack,o=t;for(;;){try{getValueViaPath.call(this,e,o,!0);break}catch(t){}if(n.push(o),i.pop(),o=i.join(DELIMITER),""===o)break}for(;!n.isEmpty();){o=n.pop();let t={};n.isEmpty()||(s=n.peek().split(DELIMITER).pop(),isInteger(parseInt(s))&&(t=[])),setValueViaPath.call(this,e,o,t)}let l=getValueViaPath.call(this,e,t);if(!isObject(e)&&!isArray(e))throw TypeError("unsupported type: "+typeof e);if(l instanceof Map||l instanceof WeakMap)l.set(r,a);else if(l instanceof Set||l instanceof WeakSet)l.append(a);else{if("function"==typeof WeakRef&&l instanceof WeakRef)throw Error("unsupported action for this data type");isArray(l)&&(r=parseInt(r),validateInteger(r)),assignProperty(l,r,a)}}function assignProperty(t,e,a){t.hasOwnProperty(e)&&void 0===a&&delete t[e],t[e]=a}function deleteValueViaPath(t,e){const a=e.split(DELIMITER);let i=a.pop();e=a.join(DELIMITER);const r=getValueViaPath.call(this,t,e);if(r instanceof Map)r.delete(i);else{if(r instanceof Set||r instanceof WeakMap||r instanceof WeakSet||"function"==typeof WeakRef&&r instanceof WeakRef)throw Error("unsupported action for this data type");isArray(r)&&(i=parseInt(i),validateInteger(i)),delete r[i]}}assignToNamespace("Monster.Data",Pathfinder);export{DELIMITER,WILDCARD,Monster,Pathfinder};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{isArray,isInteger,isObject,isPrimitive}from"../types/is.js";import{Stack}from"../types/stack.js";import{validateInteger,validateString}from"../types/validate.js";export const DELIMITER=".";export const WILDCARD="*";class Pathfinder extends Base{constructor(object){super();if(isPrimitive(object)){throw new Error("the parameter must not be a simple type")}this.object=object;this.wildCard=WILDCARD}setWildCard(wildcard){validateString(wildcard);this.wildCard=wildcard;return this}getVia(path){return getValueViaPath.call(this,this.object,validateString(path))}setVia(path,value){validateString(path);setValueViaPath.call(this,this.object,path,value);return this}deleteVia(path){validateString(path);deleteValueViaPath.call(this,this.object,path);return this}exists(path){validateString(path);try{getValueViaPath.call(this,this.object,path,true);return true}catch(e){}return false}}assignToNamespace("Monster.Data",Pathfinder);export{Monster,Pathfinder};function iterate(subject,path,check){const result=new Map;if(isObject(subject)||isArray(subject)){for(const[key,value]of Object.entries(subject)){result.set(key,getValueViaPath.call(this,value,path,check))}}else{let key=path.split(DELIMITER).shift();result.set(key,getValueViaPath.call(this,subject,path,check))}return result}function getValueViaPath(subject,path,check){if(path===""){return subject}let parts=path.split(DELIMITER);let current=parts.shift();if(current===this.wildCard){return iterate.call(this,subject,parts.join(DELIMITER),check)}if(isObject(subject)||isArray(subject)){let anchor;if(subject instanceof Map||subject instanceof WeakMap){anchor=subject.get(current)}else if(subject instanceof Set||subject instanceof WeakSet){current=parseInt(current);validateInteger(current);anchor=[...subject]?.[current]}else if(typeof WeakRef==="function"&&subject instanceof WeakRef){throw Error("unsupported action for this data type")}else if(isArray(subject)){current=parseInt(current);validateInteger(current);anchor=subject?.[current]}else{anchor=subject?.[current]}if(isObject(anchor)||isArray(anchor)){return getValueViaPath.call(this,anchor,parts.join(DELIMITER),check)}if(parts.length>0){throw Error("the journey is not at its end ("+parts.join(DELIMITER)+")")}if(check===true){const descriptor=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(subject),current);if(!subject.hasOwnProperty(current)&&descriptor===undefined){throw Error("unknown value")}}return anchor}throw TypeError("unsupported type "+typeof subject)}function setValueViaPath(object,path,value){validateString(path);let parts=path.split(DELIMITER);let last=parts.pop();let subpath=parts.join(DELIMITER);let stack=new Stack;let current=subpath;while(true){try{getValueViaPath.call(this,object,current,true);break}catch(e){}stack.push(current);parts.pop();current=parts.join(DELIMITER);if(current==="")break}while(!stack.isEmpty()){current=stack.pop();let obj={};if(!stack.isEmpty()){let n=stack.peek().split(DELIMITER).pop();if(isInteger(parseInt(n))){obj=[]}}setValueViaPath.call(this,object,current,obj)}let anchor=getValueViaPath.call(this,object,subpath);if(!isObject(object)&&!isArray(object)){throw TypeError("unsupported type: "+typeof object)}if(anchor instanceof Map||anchor instanceof WeakMap){anchor.set(last,value)}else if(anchor instanceof Set||anchor instanceof WeakSet){anchor.append(value)}else if(typeof WeakRef==="function"&&anchor instanceof WeakRef){throw Error("unsupported action for this data type")}else if(isArray(anchor)){last=parseInt(last);validateInteger(last);assignProperty(anchor,last,value)}else{assignProperty(anchor,last,value)}}function assignProperty(object,key,value){if(!object.hasOwnProperty(key)){object[key]=value;return}if(value===undefined){delete object[key]}object[key]=value}function deleteValueViaPath(object,path){const parts=path.split(DELIMITER);let last=parts.pop();const subpath=parts.join(DELIMITER);const anchor=getValueViaPath.call(this,object,subpath);if(anchor instanceof Map){anchor.delete(last)}else if(anchor instanceof Set||anchor instanceof WeakMap||anchor instanceof WeakSet||typeof WeakRef==="function"&&anchor instanceof WeakRef){throw Error("unsupported action for this data type")}else if(isArray(anchor)){last=parseInt(last);validateInteger(last);delete anchor[last]}else{delete anchor[last]}}
diff --git a/packages/monster/dist/modules/data/pipe.js b/packages/monster/dist/modules/data/pipe.js
index 8837a3519609f25c84e9d7ad4fdd5d29b3fa1bc4..acf9c7df2b4f27999fe6010f6f33fbd9353a3759 100644
--- a/packages/monster/dist/modules/data/pipe.js
+++ b/packages/monster/dist/modules/data/pipe.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateString}from"../types/validate.js";import{Transformer}from"./transformer.js";const DELIMITER="|";class Pipe extends Base{constructor(e){super(),validateString(e),this.pipe=e.split(DELIMITER).map(e=>new Transformer(e))}setCallback(e,s,r){for(var[,t]of Object.entries(this.pipe))t.setCallback(e,s,r);return this}run(e){return this.pipe.reduce((e,s,r,t)=>s.run(e),e)}}assignToNamespace("Monster.Data",Pipe);export{Monster,Pipe};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateString}from"../types/validate.js";import{Transformer}from"./transformer.js";const DELIMITER="|";class Pipe extends Base{constructor(pipe){super();validateString(pipe);this.pipe=pipe.split(DELIMITER).map(v=>{return new Transformer(v)})}setCallback(name,callback,context){for(const[,t]of Object.entries(this.pipe)){t.setCallback(name,callback,context)}return this}run(value){return this.pipe.reduce((accumulator,transformer,currentIndex,array)=>{return transformer.run(accumulator)},value)}}assignToNamespace("Monster.Data",Pipe);export{Monster,Pipe};
diff --git a/packages/monster/dist/modules/data/transformer.js b/packages/monster/dist/modules/data/transformer.js
index 6b6a1419fa3eb530b504a3869f420b47b92fb707..16492eb13dd8c56f5de4b1edc5fb571661a27874 100644
--- a/packages/monster/dist/modules/data/transformer.js
+++ b/packages/monster/dist/modules/data/transformer.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{getGlobal,getGlobalObject}from"../types/global.js";import{ID}from"../types/id.js";import{isArray,isObject,isString}from"../types/is.js";import{validateFunction,validateInteger,validateObject,validatePrimitive,validateString}from"../types/validate.js";import{clone}from"../util/clone.js";import{Pathfinder}from"./pathfinder.js";class Transformer extends Base{constructor(e){super(),this.args=disassemble(e),this.command=this.args.shift(),this.callbacks=new Map}setCallback(e,t,r){return validateString(e),validateFunction(t),void 0!==r&&validateObject(r),this.callbacks.set(e,{callback:t,context:r}),this}run(e){return transform.apply(this,[e])}}function disassemble(e){validateString(e);let a=new Map;var t;for(t of e.matchAll(/((?<pattern>\\(?<char>.)){1})/gim)){var r,s,n=t?.groups;isObject(n)&&(r=n?.pattern,n=n?.char,r&&n&&(s="__"+(new ID).toString()+"__",a.set(s,n),e=e.replace(r,s)))}let i=e.split(":");return i=i.map(function(e){let t=e.trim();for(var r of a)t=t.replace(r[0],r[1]);return t}),i}function convertToString(e){return isObject(e)&&e.hasOwnProperty("toString")&&(e=e.toString()),validateString(e),e}function transform(i){const o=getGlobalObject("console");let c=clone(this.args),l,u;switch(this.command){case"static":return this.args.join(":");case"tolower":case"strtolower":case"tolowercase":return validateString(i),i.toLowerCase();case"toupper":case"strtoupper":case"touppercase":return validateString(i),i.toUpperCase();case"tostring":return""+i;case"tointeger":var p=parseInt(i);return validateInteger(p),p;case"tojson":return JSON.stringify(i);case"fromjson":return JSON.parse(i);case"trim":return validateString(i),i.trim();case"rawurlencode":return validateString(i),encodeURIComponent(i).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A");case"call":let e;p=c.shift();let t=getGlobal();return isObject(i)&&i.hasOwnProperty(p)?e=i[p]:this.callbacks.has(p)?(d=this.callbacks.get(p),e=d?.callback,t=d?.context):"object"==typeof window&&window.hasOwnProperty(p)&&(e=window[p]),validateFunction(e),c.unshift(i),e.call(t,...c);case"plain":case"plaintext":return validateString(i),(new DOMParser).parseFromString(i,"text/html").body.textContent||"";case"if":case"?":validatePrimitive(i);let r=c.shift()||void 0,a=c.shift()||void 0;return"value"===r&&(r=i),"\\value"===r&&(r="value"),"value"===a&&(a=i),"\\value"===a&&(a="value"),void 0!==i&&""!==i&&"off"!==i&&"false"!==i&&!1!==i||"on"===i||"true"===i||!0===i?r:a;case"ucfirst":return validateString(i),i.charAt(0).toUpperCase()+i.substr(1);case"ucwords":return validateString(i),i.replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g,function(e){return e.toUpperCase()});case"count":case"length":if((isString(i)||isObject(i)||isArray(i))&&i.hasOwnProperty("length"))return i.length;throw new TypeError("unsupported type "+typeof i);case"to-base64":case"btoa":case"base64":return btoa(convertToString(i));case"atob":case"from-base64":return atob(convertToString(i));case"empty":return"";case"undefined":return;case"debug":return isObject(o)&&o.log(i),i;case"prefix":return validateString(i),c?.[0]+i;case"suffix":return validateString(i),i+c?.[0];case"uniqid":return(new ID).toString();case"first-key":case"last-key":case"nth-last-key":case"nth-key":if(!isObject(i))throw new Error("type not supported");var d=Object.keys(i).sort(),p=("first-key"===this.command?l=0:"last-key"===this.command?l=d.length-1:(l=validateInteger(parseInt(c.shift())),"nth-last-key"===this.command&&(l=d.length-l-1)),u=c.shift()||"",d?.[l]);return i?.[p]?i?.[p]:u;case"key":case"property":case"index":if(l=c.shift()||void 0,void 0===l)throw new Error("missing key parameter");if(u=c.shift()||void 0,i instanceof Map)return i.has(l)?i.get(l):u;if(isObject(i)||isArray(i))return i?.[l]||u;throw new Error("type not supported");case"path-exists":if(l=c.shift(),void 0===l)throw new Error("missing key parameter");return new Pathfinder(i).exists(l);case"path":if(l=c.shift(),void 0===l)throw new Error("missing key parameter");let s=new Pathfinder(i);return s.exists(l)?s.getVia(l):void 0;case"substring":validateString(i);d=parseInt(c[0])||0,p=(parseInt(c[1])||0)+d;return i.substring(d,p);case"nop":return i;case"??":case"default":if(null!=i)return i;u=c.shift();let n=c.shift();switch(void 0===n&&(n="string"),n){case"int":case"integer":return parseInt(u);case"float":return parseFloat(u);case"undefined":return;case"bool":case"boolean":return u=u.toLowerCase(),"undefined"!==u&&""!==u&&"off"!==u&&"false"!==u&&"false"!==u||"on"===u||"true"===u||"true"===u;case"string":return""+u;case"object":return JSON.parse(atob(u))}throw new Error("type not supported");default:throw new Error("unknown command "+this.command)}return i}assignToNamespace("Monster.Data",Transformer);export{Monster,Transformer};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{getGlobal,getGlobalObject}from"../types/global.js";import{ID}from"../types/id.js";import{isArray,isObject,isString}from"../types/is.js";import{validateFunction,validateInteger,validateObject,validatePrimitive,validateString}from"../types/validate.js";import{clone}from"../util/clone.js";import{Pathfinder}from"./pathfinder.js";class Transformer extends Base{constructor(definition){super();this.args=disassemble(definition);this.command=this.args.shift();this.callbacks=new Map}setCallback(name,callback,context){validateString(name);validateFunction(callback);if(context!==undefined){validateObject(context)}this.callbacks.set(name,{callback:callback,context:context});return this}run(value){return transform.apply(this,[value])}}assignToNamespace("Monster.Data",Transformer);export{Monster,Transformer};function disassemble(command){validateString(command);let placeholder=new Map;const regex=/((?<pattern>\\(?<char>.)){1})/mig;let result=command.matchAll(regex);for(let m of result){let g=m?.["groups"];if(!isObject(g)){continue}let p=g?.["pattern"];let c=g?.["char"];if(p&&c){let r="__"+new ID().toString()+"__";placeholder.set(r,c);command=command.replace(p,r)}}let parts=command.split(":");parts=parts.map(function(value){let v=value.trim();for(let k of placeholder){v=v.replace(k[0],k[1])}return v});return parts}function convertToString(value){if(isObject(value)&&value.hasOwnProperty("toString")){value=value.toString()}validateString(value);return value}function transform(value){const console=getGlobalObject("console");let args=clone(this.args);let key,defaultValue;switch(this.command){case"static":return this.args.join(":");case"tolower":case"strtolower":case"tolowercase":validateString(value);return value.toLowerCase();case"toupper":case"strtoupper":case"touppercase":validateString(value);return value.toUpperCase();case"tostring":return""+value;case"tointeger":let n=parseInt(value);validateInteger(n);return n;case"tojson":return JSON.stringify(value);case"fromjson":return JSON.parse(value);case"trim":validateString(value);return value.trim();case"rawurlencode":validateString(value);return encodeURIComponent(value).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A");case"call":let callback;let callbackName=args.shift();let context=getGlobal();if(isObject(value)&&value.hasOwnProperty(callbackName)){callback=value[callbackName]}else if(this.callbacks.has(callbackName)){let s=this.callbacks.get(callbackName);callback=s?.["callback"];context=s?.["context"]}else if(typeof window==="object"&&window.hasOwnProperty(callbackName)){callback=window[callbackName]}validateFunction(callback);args.unshift(value);return callback.call(context,...args);case"plain":case"plaintext":validateString(value);let doc=new DOMParser().parseFromString(value,"text/html");return doc.body.textContent||"";case"if":case"?":validatePrimitive(value);let trueStatement=args.shift()||undefined;let falseStatement=args.shift()||undefined;if(trueStatement==="value"){trueStatement=value}if(trueStatement==="\\value"){trueStatement="value"}if(falseStatement==="value"){falseStatement=value}if(falseStatement==="\\value"){falseStatement="value"}let condition=value!==undefined&&value!==""&&value!=="off"&&value!=="false"&&value!==false||value==="on"||value==="true"||value===true;return condition?trueStatement:falseStatement;case"ucfirst":validateString(value);let firstchar=value.charAt(0).toUpperCase();return firstchar+value.substr(1);case"ucwords":validateString(value);return value.replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g,function(v){return v.toUpperCase()});case"count":case"length":if((isString(value)||isObject(value)||isArray(value))&&value.hasOwnProperty("length")){return value.length}throw new TypeError("unsupported type "+typeof value);case"to-base64":case"btoa":case"base64":return btoa(convertToString(value));case"atob":case"from-base64":return atob(convertToString(value));case"empty":return"";case"undefined":return undefined;case"debug":if(isObject(console)){console.log(value)}return value;case"prefix":validateString(value);let prefix=args?.[0];return prefix+value;case"suffix":validateString(value);let suffix=args?.[0];return value+suffix;case"uniqid":return new ID().toString();case"first-key":case"last-key":case"nth-last-key":case"nth-key":if(!isObject(value)){throw new Error("type not supported")}const keys=Object.keys(value).sort();if(this.command==="first-key"){key=0}else if(this.command==="last-key"){key=keys.length-1}else{key=validateInteger(parseInt(args.shift()));if(this.command==="nth-last-key"){key=keys.length-key-1}}defaultValue=args.shift()||"";let useKey=keys?.[key];if(value?.[useKey]){return value?.[useKey]}return defaultValue;case"key":case"property":case"index":key=args.shift()||undefined;if(key===undefined){throw new Error("missing key parameter")}defaultValue=args.shift()||undefined;if(value instanceof Map){if(!value.has(key)){return defaultValue}return value.get(key)}if(isObject(value)||isArray(value)){if(value?.[key]){return value?.[key]}return defaultValue}throw new Error("type not supported");case"path-exists":key=args.shift();if(key===undefined){throw new Error("missing key parameter")}return new Pathfinder(value).exists(key);case"path":key=args.shift();if(key===undefined){throw new Error("missing key parameter")}let pf=new Pathfinder(value);if(!pf.exists(key)){return undefined}return pf.getVia(key);case"substring":validateString(value);let start=parseInt(args[0])||0;let end=(parseInt(args[1])||0)+start;return value.substring(start,end);case"nop":return value;case"??":case"default":if(value!==undefined&&value!==null){return value}defaultValue=args.shift();let defaultType=args.shift();if(defaultType===undefined){defaultType="string"}switch(defaultType){case"int":case"integer":return parseInt(defaultValue);case"float":return parseFloat(defaultValue);case"undefined":return undefined;case"bool":case"boolean":defaultValue=defaultValue.toLowerCase();return defaultValue!=="undefined"&&defaultValue!==""&&defaultValue!=="off"&&defaultValue!=="false"&&defaultValue!=="false"||defaultValue==="on"||defaultValue==="true"||defaultValue==="true";case"string":return""+defaultValue;case"object":return JSON.parse(atob(defaultValue));}throw new Error("type not supported");default:throw new Error("unknown command "+this.command);}return value}
diff --git a/packages/monster/dist/modules/dom/assembler.js b/packages/monster/dist/modules/dom/assembler.js
index 3a6c15afdc918483b52d4e17c183a866806592a3..40f56e0d576fd2f7dd00b493ee49fd43d6ebd1da 100644
--- a/packages/monster/dist/modules/dom/assembler.js
+++ b/packages/monster/dist/modules/dom/assembler.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{getGlobalFunction}from"../types/global.js";import{ProxyObserver}from"../types/proxyobserver.js";import{validateInstance,validateString}from"../types/validate.js";const ATTRIBUTEPREFIX="data-monster-";class Assembler extends Base{constructor(e){super(),this.attributePrefix=ATTRIBUTEPREFIX,validateInstance(e,getGlobalFunction("DocumentFragment")),this.fragment=e}setAttributePrefix(e){return validateString(e),this.attributePrefix=e,this}getAttributePrefix(){return this.attributePrefix}createDocumentFragment(e){return void 0===e&&(e=new ProxyObserver({})),validateInstance(e,ProxyObserver),this.fragment.cloneNode(!0)}}assignToNamespace("Monster.DOM",Assembler);export{Monster,ATTRIBUTEPREFIX,Assembler};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{getGlobalFunction}from"../types/global.js";import{ProxyObserver}from"../types/proxyobserver.js";import{validateInstance,validateString}from"../types/validate.js";const ATTRIBUTEPREFIX="data-monster-";class Assembler extends Base{constructor(fragment){super();this.attributePrefix=ATTRIBUTEPREFIX;validateInstance(fragment,getGlobalFunction("DocumentFragment"));this.fragment=fragment}setAttributePrefix(prefix){validateString(prefix);this.attributePrefix=prefix;return this}getAttributePrefix(){return this.attributePrefix}createDocumentFragment(data){if(data===undefined){data=new ProxyObserver({})}validateInstance(data,ProxyObserver);let fragment=this.fragment.cloneNode(true);return fragment}}assignToNamespace("Monster.DOM",Assembler);export{Monster,ATTRIBUTEPREFIX,Assembler};
diff --git a/packages/monster/dist/modules/dom/attributes.js b/packages/monster/dist/modules/dom/attributes.js
index c39ad24b706efad4baeea7f48559c310f268c85f..aea008f79200eded9dae6ef4b08e0fc34ed80b1d 100644
--- a/packages/monster/dist/modules/dom/attributes.js
+++ b/packages/monster/dist/modules/dom/attributes.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{getGlobalFunction}from"../types/global.js";import{TokenList}from"../types/tokenlist.js";import{validateInstance,validateString,validateSymbol}from"../types/validate.js";import{ATTRIBUTE_OBJECTLINK}from"./constants.js";function findClosestObjectLink(t){return findClosestByAttribute(t,ATTRIBUTE_OBJECTLINK)}function addToObjectLink(t,e,n){return validateInstance(t,HTMLElement),validateSymbol(e),void 0===t?.[e]&&(t[e]=new Set),addAttributeToken(t,ATTRIBUTE_OBJECTLINK,e.toString()),t[e].add(n),t}function removeObjectLink(t,e){return validateInstance(t,HTMLElement),validateSymbol(e),void 0===t?.[e]||(removeAttributeToken(t,ATTRIBUTE_OBJECTLINK,e.toString()),delete t[e]),t}function hasObjectLink(t,e){return validateInstance(t,HTMLElement),validateSymbol(e),void 0!==t?.[e]&&containsAttributeToken(t,ATTRIBUTE_OBJECTLINK,e.toString())}function getLinkedObjects(t,e){if(validateInstance(t,HTMLElement),validateSymbol(e),void 0===t?.[e])throw new Error("there is no object link for "+e.toString());return t?.[e][Symbol.iterator]()}function toggleAttributeToken(t,e,n){return validateInstance(t,HTMLElement),validateString(n),validateString(e),t.hasAttribute(e)?t.setAttribute(e,new TokenList(t.getAttribute(e)).toggle(n).toString()):t.setAttribute(e,n),t}function addAttributeToken(t,e,n){return validateInstance(t,HTMLElement),validateString(n),validateString(e),t.hasAttribute(e)?t.setAttribute(e,new TokenList(t.getAttribute(e)).add(n).toString()):t.setAttribute(e,n),t}function removeAttributeToken(t,e,n){return validateInstance(t,HTMLElement),validateString(n),validateString(e),t.hasAttribute(e)&&t.setAttribute(e,new TokenList(t.getAttribute(e)).remove(n).toString()),t}function containsAttributeToken(t,e,n){return validateInstance(t,HTMLElement),validateString(n),validateString(e),!!t.hasAttribute(e)&&new TokenList(t.getAttribute(e)).contains(n)}function replaceAttributeToken(t,e,n,i){return validateInstance(t,HTMLElement),validateString(n),validateString(i),validateString(e),t.hasAttribute(e)&&t.setAttribute(e,new TokenList(t.getAttribute(e)).replace(n,i).toString()),t}function clearAttributeTokens(t,e){return validateInstance(t,HTMLElement),validateString(e),t.hasAttribute(e)&&t.setAttribute(e,""),t}function findClosestByAttribute(t,e,n){if(validateInstance(t,getGlobalFunction("HTMLElement")),t.hasAttribute(e)){if(void 0===n)return t;if(t.getAttribute(e)===n)return t}let i=validateString(e);void 0!==n&&(i+="="+validateString(n));e=t.closest("["+i+"]");if(e instanceof HTMLElement)return e}function findClosestByClass(t,e){if(validateInstance(t,getGlobalFunction("HTMLElement")),t?.classList?.contains(validateString(e)))return t;t=t.closest("."+e);return t instanceof HTMLElement?t:void 0}assignToNamespace("Monster.DOM",findClosestByClass,getLinkedObjects,addToObjectLink,removeObjectLink,findClosestByAttribute,hasObjectLink,clearAttributeTokens,replaceAttributeToken,containsAttributeToken,removeAttributeToken,addAttributeToken,toggleAttributeToken);export{Monster,addToObjectLink,removeObjectLink,hasObjectLink,findClosestByAttribute,clearAttributeTokens,replaceAttributeToken,containsAttributeToken,removeAttributeToken,addAttributeToken,toggleAttributeToken,getLinkedObjects,findClosestObjectLink,findClosestByClass};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{getGlobalFunction}from"../types/global.js";import{TokenList}from"../types/tokenlist.js";import{validateInstance,validateString,validateSymbol}from"../types/validate.js";import{ATTRIBUTE_OBJECTLINK}from"./constants.js";function findClosestObjectLink(element){return findClosestByAttribute(element,ATTRIBUTE_OBJECTLINK)}function addToObjectLink(element,symbol,object){validateInstance(element,HTMLElement);validateSymbol(symbol);if(element?.[symbol]===undefined){element[symbol]=new Set}addAttributeToken(element,ATTRIBUTE_OBJECTLINK,symbol.toString());element[symbol].add(object);return element}function removeObjectLink(element,symbol){validateInstance(element,HTMLElement);validateSymbol(symbol);if(element?.[symbol]===undefined){return element}removeAttributeToken(element,ATTRIBUTE_OBJECTLINK,symbol.toString());delete element[symbol];return element}function hasObjectLink(element,symbol){validateInstance(element,HTMLElement);validateSymbol(symbol);if(element?.[symbol]===undefined){return false}return containsAttributeToken(element,ATTRIBUTE_OBJECTLINK,symbol.toString())}function getLinkedObjects(element,symbol){validateInstance(element,HTMLElement);validateSymbol(symbol);if(element?.[symbol]===undefined){throw new Error("there is no object link for "+symbol.toString())}return element?.[symbol][Symbol.iterator]()}function toggleAttributeToken(element,key,token){validateInstance(element,HTMLElement);validateString(token);validateString(key);if(!element.hasAttribute(key)){element.setAttribute(key,token);return element}element.setAttribute(key,new TokenList(element.getAttribute(key)).toggle(token).toString());return element}function addAttributeToken(element,key,token){validateInstance(element,HTMLElement);validateString(token);validateString(key);if(!element.hasAttribute(key)){element.setAttribute(key,token);return element}element.setAttribute(key,new TokenList(element.getAttribute(key)).add(token).toString());return element}function removeAttributeToken(element,key,token){validateInstance(element,HTMLElement);validateString(token);validateString(key);if(!element.hasAttribute(key)){return element}element.setAttribute(key,new TokenList(element.getAttribute(key)).remove(token).toString());return element}function containsAttributeToken(element,key,token){validateInstance(element,HTMLElement);validateString(token);validateString(key);if(!element.hasAttribute(key)){return false}return new TokenList(element.getAttribute(key)).contains(token)}function replaceAttributeToken(element,key,from,to){validateInstance(element,HTMLElement);validateString(from);validateString(to);validateString(key);if(!element.hasAttribute(key)){return element}element.setAttribute(key,new TokenList(element.getAttribute(key)).replace(from,to).toString());return element}function clearAttributeTokens(element,key){validateInstance(element,HTMLElement);validateString(key);if(!element.hasAttribute(key)){return element}element.setAttribute(key,"");return element}function findClosestByAttribute(element,key,value){validateInstance(element,getGlobalFunction("HTMLElement"));if(element.hasAttribute(key)){if(value===undefined){return element}if(element.getAttribute(key)===value){return element}}let selector=validateString(key);if(value!==undefined)selector+="="+validateString(value);let result=element.closest("["+selector+"]");if(result instanceof HTMLElement){return result}return undefined}function findClosestByClass(element,className){validateInstance(element,getGlobalFunction("HTMLElement"));if(element?.classList?.contains(validateString(className))){return element}let result=element.closest("."+className);if(result instanceof HTMLElement){return result}return undefined}assignToNamespace("Monster.DOM",findClosestByClass,getLinkedObjects,addToObjectLink,removeObjectLink,findClosestByAttribute,hasObjectLink,clearAttributeTokens,replaceAttributeToken,containsAttributeToken,removeAttributeToken,addAttributeToken,toggleAttributeToken);export{Monster,addToObjectLink,removeObjectLink,hasObjectLink,findClosestByAttribute,clearAttributeTokens,replaceAttributeToken,containsAttributeToken,removeAttributeToken,addAttributeToken,toggleAttributeToken,getLinkedObjects,findClosestObjectLink,findClosestByClass};
diff --git a/packages/monster/dist/modules/dom/constants.js b/packages/monster/dist/modules/dom/constants.js
index 54cef3bbd7ab97dc6a81b81dfba682c2c2423183..60fa0ba37616cccebf23091992ee5dc7095b410b 100644
--- a/packages/monster/dist/modules/dom/constants.js
+++ b/packages/monster/dist/modules/dom/constants.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{Monster}from"../namespace.js";const DEFAULT_THEME="monster",ATTRIBUTE_PREFIX="data-monster-",ATTRIBUTE_OPTIONS=ATTRIBUTE_PREFIX+"options",ATTRIBUTE_OPTIONS_SELECTOR=ATTRIBUTE_PREFIX+"options-selector",ATTRIBUTE_THEME_PREFIX=ATTRIBUTE_PREFIX+"theme-",ATTRIBUTE_THEME_NAME=ATTRIBUTE_THEME_PREFIX+"name",ATTRIBUTE_UPDATER_ATTRIBUTES=ATTRIBUTE_PREFIX+"attributes",ATTRIBUTE_UPDATER_SELECT_THIS=ATTRIBUTE_PREFIX+"select-this",ATTRIBUTE_UPDATER_REPLACE=ATTRIBUTE_PREFIX+"replace",ATTRIBUTE_UPDATER_INSERT=ATTRIBUTE_PREFIX+"insert",ATTRIBUTE_UPDATER_INSERT_REFERENCE=ATTRIBUTE_PREFIX+"insert-reference",ATTRIBUTE_UPDATER_REMOVE=ATTRIBUTE_PREFIX+"remove",ATTRIBUTE_UPDATER_BIND=ATTRIBUTE_PREFIX+"bind",ATTRIBUTE_TEMPLATE_PREFIX=ATTRIBUTE_PREFIX+"template-prefix",ATTRIBUTE_ROLE=ATTRIBUTE_PREFIX+"role",ATTRIBUTE_DISABLED="disabled",ATTRIBUTE_VALUE="value",ATTRIBUTE_OBJECTLINK=ATTRIBUTE_PREFIX+"objectlink",ATTRIBUTE_ERRORMESSAGE=ATTRIBUTE_PREFIX+"error",objectUpdaterLinkSymbol=Symbol("monsterUpdater"),TAG_SCRIPT="script",TAG_STYLE="style",TAG_LINK="link",ATTRIBUTE_ID="id",ATTRIBUTE_CLASS="class",ATTRIBUTE_TITLE="title",ATTRIBUTE_SRC="src",ATTRIBUTE_HREF="href",ATTRIBUTE_TYPE="type",ATTRIBUTE_NONCE="nonce",ATTRIBUTE_TRANSLATE="translate",ATTRIBUTE_TABINDEX="tabindex",ATTRIBUTE_SPELLCHECK="spellcheck",ATTRIBUTE_SLOT="slot",ATTRIBUTE_PART="part",ATTRIBUTE_LANG="lang",ATTRIBUTE_ITEMTYPE="itemtype",ATTRIBUTE_ITEMSCOPE="itemscope",ATTRIBUTE_ITEMREF="itemref",ATTRIBUTE_ITEMID="itemid",ATTRIBUTE_ITEMPROP="itemprop",ATTRIBUTE_IS="is",ATTRIBUTE_INPUTMODE="inputmode",ATTRIBUTE_ACCESSKEY="accesskey",ATTRIBUTE_AUTOCAPITALIZE="autocapitalize",ATTRIBUTE_AUTOFOCUS="autofocus",ATTRIBUTE_CONTENTEDITABLE="contenteditable",ATTRIBUTE_DIR="dir",ATTRIBUTE_DRAGGABLE="draggable",ATTRIBUTE_ENTERKEYHINT="enterkeyhint",ATTRIBUTE_EXPORTPARTS="exportparts",ATTRIBUTE_HIDDEN="hidden";export{Monster,ATTRIBUTE_HIDDEN,ATTRIBUTE_EXPORTPARTS,ATTRIBUTE_ENTERKEYHINT,ATTRIBUTE_DRAGGABLE,ATTRIBUTE_DIR,ATTRIBUTE_CONTENTEDITABLE,ATTRIBUTE_AUTOFOCUS,ATTRIBUTE_AUTOCAPITALIZE,ATTRIBUTE_ACCESSKEY,TAG_SCRIPT,TAG_LINK,ATTRIBUTE_INPUTMODE,ATTRIBUTE_IS,ATTRIBUTE_ITEMPROP,ATTRIBUTE_ITEMID,ATTRIBUTE_ITEMREF,ATTRIBUTE_ITEMSCOPE,TAG_STYLE,ATTRIBUTE_ITEMTYPE,ATTRIBUTE_HREF,ATTRIBUTE_LANG,ATTRIBUTE_PART,ATTRIBUTE_SLOT,ATTRIBUTE_SPELLCHECK,ATTRIBUTE_SRC,ATTRIBUTE_TABINDEX,ATTRIBUTE_TRANSLATE,ATTRIBUTE_NONCE,ATTRIBUTE_TYPE,ATTRIBUTE_TITLE,ATTRIBUTE_CLASS,ATTRIBUTE_ID,ATTRIBUTE_PREFIX,ATTRIBUTE_OPTIONS,DEFAULT_THEME,ATTRIBUTE_THEME_PREFIX,ATTRIBUTE_ROLE,ATTRIBUTE_THEME_NAME,ATTRIBUTE_UPDATER_ATTRIBUTES,ATTRIBUTE_UPDATER_REPLACE,ATTRIBUTE_UPDATER_INSERT,ATTRIBUTE_UPDATER_INSERT_REFERENCE,ATTRIBUTE_UPDATER_REMOVE,ATTRIBUTE_UPDATER_BIND,ATTRIBUTE_OBJECTLINK,ATTRIBUTE_DISABLED,ATTRIBUTE_ERRORMESSAGE,ATTRIBUTE_VALUE,objectUpdaterLinkSymbol,ATTRIBUTE_TEMPLATE_PREFIX,ATTRIBUTE_UPDATER_SELECT_THIS,ATTRIBUTE_OPTIONS_SELECTOR};
\ No newline at end of file
+'use strict';import{Monster}from"../namespace.js";const DEFAULT_THEME="monster";const ATTRIBUTE_PREFIX="data-monster-";const ATTRIBUTE_OPTIONS=ATTRIBUTE_PREFIX+"options";const ATTRIBUTE_OPTIONS_SELECTOR=ATTRIBUTE_PREFIX+"options-selector";const ATTRIBUTE_THEME_PREFIX=ATTRIBUTE_PREFIX+"theme-";const ATTRIBUTE_THEME_NAME=ATTRIBUTE_THEME_PREFIX+"name";const ATTRIBUTE_UPDATER_ATTRIBUTES=ATTRIBUTE_PREFIX+"attributes";const ATTRIBUTE_UPDATER_SELECT_THIS=ATTRIBUTE_PREFIX+"select-this";const ATTRIBUTE_UPDATER_REPLACE=ATTRIBUTE_PREFIX+"replace";const ATTRIBUTE_UPDATER_INSERT=ATTRIBUTE_PREFIX+"insert";const ATTRIBUTE_UPDATER_INSERT_REFERENCE=ATTRIBUTE_PREFIX+"insert-reference";const ATTRIBUTE_UPDATER_REMOVE=ATTRIBUTE_PREFIX+"remove";const ATTRIBUTE_UPDATER_BIND=ATTRIBUTE_PREFIX+"bind";const ATTRIBUTE_TEMPLATE_PREFIX=ATTRIBUTE_PREFIX+"template-prefix";const ATTRIBUTE_ROLE=ATTRIBUTE_PREFIX+"role";const ATTRIBUTE_DISABLED="disabled";const ATTRIBUTE_VALUE="value";const ATTRIBUTE_OBJECTLINK=ATTRIBUTE_PREFIX+"objectlink";const ATTRIBUTE_ERRORMESSAGE=ATTRIBUTE_PREFIX+"error";const objectUpdaterLinkSymbol=Symbol("monsterUpdater");const TAG_SCRIPT="script";const TAG_STYLE="style";const TAG_LINK="link";const ATTRIBUTE_ID="id";const ATTRIBUTE_CLASS="class";const ATTRIBUTE_TITLE="title";const ATTRIBUTE_SRC="src";const ATTRIBUTE_HREF="href";const ATTRIBUTE_TYPE="type";const ATTRIBUTE_NONCE="nonce";const ATTRIBUTE_TRANSLATE="translate";const ATTRIBUTE_TABINDEX="tabindex";const ATTRIBUTE_SPELLCHECK="spellcheck";const ATTRIBUTE_SLOT="slot";const ATTRIBUTE_PART="part";const ATTRIBUTE_LANG="lang";const ATTRIBUTE_ITEMTYPE="itemtype";const ATTRIBUTE_ITEMSCOPE="itemscope";const ATTRIBUTE_ITEMREF="itemref";const ATTRIBUTE_ITEMID="itemid";const ATTRIBUTE_ITEMPROP="itemprop";const ATTRIBUTE_IS="is";const ATTRIBUTE_INPUTMODE="inputmode";const ATTRIBUTE_ACCESSKEY="accesskey";const ATTRIBUTE_AUTOCAPITALIZE="autocapitalize";const ATTRIBUTE_AUTOFOCUS="autofocus";const ATTRIBUTE_CONTENTEDITABLE="contenteditable";const ATTRIBUTE_DIR="dir";const ATTRIBUTE_DRAGGABLE="draggable";const ATTRIBUTE_ENTERKEYHINT="enterkeyhint";const ATTRIBUTE_EXPORTPARTS="exportparts";const ATTRIBUTE_HIDDEN="hidden";export{Monster,ATTRIBUTE_HIDDEN,ATTRIBUTE_EXPORTPARTS,ATTRIBUTE_ENTERKEYHINT,ATTRIBUTE_DRAGGABLE,ATTRIBUTE_DIR,ATTRIBUTE_CONTENTEDITABLE,ATTRIBUTE_AUTOFOCUS,ATTRIBUTE_AUTOCAPITALIZE,ATTRIBUTE_ACCESSKEY,TAG_SCRIPT,TAG_LINK,ATTRIBUTE_INPUTMODE,ATTRIBUTE_IS,ATTRIBUTE_ITEMPROP,ATTRIBUTE_ITEMID,ATTRIBUTE_ITEMREF,ATTRIBUTE_ITEMSCOPE,TAG_STYLE,ATTRIBUTE_ITEMTYPE,ATTRIBUTE_HREF,ATTRIBUTE_LANG,ATTRIBUTE_PART,ATTRIBUTE_SLOT,ATTRIBUTE_SPELLCHECK,ATTRIBUTE_SRC,ATTRIBUTE_TABINDEX,ATTRIBUTE_TRANSLATE,ATTRIBUTE_NONCE,ATTRIBUTE_TYPE,ATTRIBUTE_TITLE,ATTRIBUTE_CLASS,ATTRIBUTE_ID,ATTRIBUTE_PREFIX,ATTRIBUTE_OPTIONS,DEFAULT_THEME,ATTRIBUTE_THEME_PREFIX,ATTRIBUTE_ROLE,ATTRIBUTE_THEME_NAME,ATTRIBUTE_UPDATER_ATTRIBUTES,ATTRIBUTE_UPDATER_REPLACE,ATTRIBUTE_UPDATER_INSERT,ATTRIBUTE_UPDATER_INSERT_REFERENCE,ATTRIBUTE_UPDATER_REMOVE,ATTRIBUTE_UPDATER_BIND,ATTRIBUTE_OBJECTLINK,ATTRIBUTE_DISABLED,ATTRIBUTE_ERRORMESSAGE,ATTRIBUTE_VALUE,objectUpdaterLinkSymbol,ATTRIBUTE_TEMPLATE_PREFIX,ATTRIBUTE_UPDATER_SELECT_THIS,ATTRIBUTE_OPTIONS_SELECTOR};
diff --git a/packages/monster/dist/modules/dom/customcontrol.js b/packages/monster/dist/modules/dom/customcontrol.js
index fcc2c18da7460692de1d6b9284a785b9c5d23581..e4ed7fbd628c491cb25d8076d10f0a15a72b3cae 100644
--- a/packages/monster/dist/modules/dom/customcontrol.js
+++ b/packages/monster/dist/modules/dom/customcontrol.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{extend}from"../data/extend.js";import{assignToNamespace,Monster}from"../namespace.js";import{ATTRIBUTE_VALUE}from"./constants.js";import{CustomElement,attributeObserverSymbol}from"./customelement.js";const attachedInternalSymbol=Symbol("attachedInternal");class CustomControl extends CustomElement{constructor(){super(),"function"==typeof this.attachInternals&&(this[attachedInternalSymbol]=this.attachInternals()),initObserver.call(this)}static get observedAttributes(){const t=super.observedAttributes;return t.push(ATTRIBUTE_VALUE),t}static get formAssociated(){return!0}get defaults(){return extend({},super.defaults)}get value(){throw Error("the value getter must be overwritten by the derived class")}set value(t){throw Error("the value setter must be overwritten by the derived class")}get labels(){return getInternal.call(this)?.labels}get name(){return this.getAttribute("name")}get type(){return this.constructor.getTag()}get validity(){return getInternal.call(this)?.validity}get validationMessage(){return getInternal.call(this)?.validationMessage}get willValidate(){return getInternal.call(this)?.willValidate}get states(){return getInternal.call(this)?.states}get form(){return getInternal.call(this)?.form}setFormValue(t,e){getInternal.call(this).setFormValue(t,e)}setValidity(t,e,r){getInternal.call(this).setValidity(t,e,r)}checkValidity(){return getInternal.call(this)?.checkValidity()}reportValidity(){return getInternal.call(this)?.reportValidity()}}function getInternal(){if(!(attachedInternalSymbol in this))throw new Error("ElementInternals is not supported and a polyfill is necessary");return this[attachedInternalSymbol]}function initObserver(){const t=this;t[attributeObserverSymbol].value=()=>{t.setOption("value",t.getAttribute("value"))}}assignToNamespace("Monster.DOM",CustomControl);export{Monster,CustomControl};
\ No newline at end of file
+'use strict';import{extend}from"../data/extend.js";import{assignToNamespace,Monster}from"../namespace.js";import{ATTRIBUTE_VALUE}from"./constants.js";import{CustomElement,attributeObserverSymbol}from"./customelement.js";const attachedInternalSymbol=Symbol("attachedInternal");class CustomControl extends CustomElement{constructor(){super();if(typeof this["attachInternals"]==="function"){this[attachedInternalSymbol]=this.attachInternals()}initObserver.call(this)}static get observedAttributes(){const list=super.observedAttributes;list.push(ATTRIBUTE_VALUE);return list}static get formAssociated(){return true}get defaults(){return extend({},super.defaults)}get value(){throw Error("the value getter must be overwritten by the derived class")}set value(value){throw Error("the value setter must be overwritten by the derived class")}get labels(){return getInternal.call(this)?.labels}get name(){return this.getAttribute("name")}get type(){return this.constructor.getTag()}get validity(){return getInternal.call(this)?.validity}get validationMessage(){return getInternal.call(this)?.validationMessage}get willValidate(){return getInternal.call(this)?.willValidate}get states(){return getInternal.call(this)?.states}get form(){return getInternal.call(this)?.form}setFormValue(value,state){getInternal.call(this).setFormValue(value,state)}setValidity(flags,message,anchor){getInternal.call(this).setValidity(flags,message,anchor)}checkValidity(){return getInternal.call(this)?.checkValidity()}reportValidity(){return getInternal.call(this)?.reportValidity()}}function getInternal(){const self=this;if(!(attachedInternalSymbol in this)){throw new Error("ElementInternals is not supported and a polyfill is necessary")}return this[attachedInternalSymbol]}function initObserver(){const self=this;self[attributeObserverSymbol]["value"]=()=>{self.setOption("value",self.getAttribute("value"))}}assignToNamespace("Monster.DOM",CustomControl);export{Monster,CustomControl};
diff --git a/packages/monster/dist/modules/dom/customelement.js b/packages/monster/dist/modules/dom/customelement.js
index 1e5714996d5d0704ee6214525b6ccf4916c37f6a..a29c110a1143fed62f4d8a67ba729a69902fcf5c 100644
--- a/packages/monster/dist/modules/dom/customelement.js
+++ b/packages/monster/dist/modules/dom/customelement.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{Pathfinder}from"../data/pathfinder.js";import{assignToNamespace,Monster}from"../namespace.js";import{parseDataURL}from"../types/dataurl.js";import{getGlobalObject}from"../types/global.js";import{isArray,isFunction,isObject,isString}from"../types/is.js";import{Observer}from"../types/observer.js";import{ProxyObserver}from"../types/proxyobserver.js";import{validateFunction,validateInstance,validateObject,validateString}from"../types/validate.js";import{clone}from"../util/clone.js";import{addAttributeToken,addToObjectLink,getLinkedObjects,hasObjectLink}from"./attributes.js";import{ATTRIBUTE_DISABLED,ATTRIBUTE_ERRORMESSAGE,ATTRIBUTE_OPTIONS,ATTRIBUTE_OPTIONS_SELECTOR,objectUpdaterLinkSymbol}from"./constants.js";import{findDocumentTemplate,Template}from"./template.js";import{Updater}from"./updater.js";const initMethodSymbol=Symbol("initMethodSymbol"),assembleMethodSymbol=Symbol("assembleMethodSymbol"),attributeObserverSymbol=Symbol("attributeObserver");class CustomElement extends HTMLElement{constructor(){super(),this[internalSymbol]=new ProxyObserver({options:extend({},this.defaults)}),this[attributeObserverSymbol]={},initOptionObserver.call(this),this[initMethodSymbol]()}static get observedAttributes(){return[ATTRIBUTE_OPTIONS,ATTRIBUTE_DISABLED]}get defaults(){return{ATTRIBUTE_DISABLED:this.getAttribute(ATTRIBUTE_DISABLED),shadowMode:"open",delegatesFocus:!0,templates:{main:void 0}}}static getTag(){throw new Error("the method getTag must be overwritten by the derived class.")}static getCSSStyleSheet(){}attachObserver(t){return this[internalSymbol].attachObserver(t),this}detachObserver(t){return this[internalSymbol].detachObserver(t),this}containsObserver(t){return this[internalSymbol].containsObserver(t)}getOption(t,e){let o;try{o=new Pathfinder(this[internalSymbol].getRealSubject().options).getVia(t)}catch(t){}return void 0===o?e:o}setOption(t,e){return new Pathfinder(this[internalSymbol].getSubject().options).setVia(t,e),this}setOptions(t){isString(t)&&(t=parseOptionsJSON.call(this,t));var e=this;return extend(e[internalSymbol].getSubject().options,e.defaults,t),e}[initMethodSymbol](){return this}[assembleMethodSymbol](){var e=this;let o,n;var t=getOptionsFromAttributes.call(e),t=(isObject(t)&&0<Object.keys(t).length&&e.setOptions(t),getOptionsFromScriptTag.call(e));if(isObject(t)&&0<Object.keys(t).length&&e.setOptions(t),!1!==e.getOption("shadowMode",!1)){try{initShadowRoot.call(e),o=e.shadowRoot.childNodes}catch(t){}try{initCSSStylesheet.call(this)}catch(t){addAttributeToken(e,ATTRIBUTE_ERRORMESSAGE,t.toString())}}o instanceof NodeList||o instanceof NodeList||(initHtmlContent.call(this),o=this.childNodes);try{n=new Set([...o,...getSlottedElements.call(e)])}catch(t){n=o}return assignUpdaterToElement.call(e,n,clone(e[internalSymbol].getRealSubject().options)),e}connectedCallback(){hasObjectLink(this,objectUpdaterLinkSymbol)||this[assembleMethodSymbol]()}disconnectedCallback(){}adoptedCallback(){}attributeChangedCallback(t,e,o){const n=this[attributeObserverSymbol]?.[t];isFunction(n)&&n.call(this,o,e)}hasNode(t){var e=this;return!!containChildNode.call(e,validateInstance(t,Node))||e.shadowRoot instanceof ShadowRoot&&containChildNode.call(e.shadowRoot,t)}}function getSlottedElements(e,t){const o=new Set;if(!(this.shadowRoot instanceof ShadowRoot))return o;let n="slot";void 0!==t&&(n+=null===t?":not([name])":"[name="+validateString(t)+"]");var i,t=this.shadowRoot.querySelectorAll(n);for([,i]of Object.entries(t))i.assignedElements().forEach(function(t){if(t instanceof HTMLElement)if(isString(e))t.querySelectorAll(e).forEach(function(t){o.add(t)}),t.matches(e)&&o.add(t);else{if(void 0!==e)throw new Error("query must be a string");o.add(t)}});return o}function containChildNode(t){var e;if(this.contains(t))return!0;for([,e]of Object.entries(this.childNodes)){if(e.contains(t))return!0;containChildNode.call(e,t)}return!1}function initOptionObserver(){const s=this;let e=void 0;s.attachObserver(new Observer(function(){var t=s.getOption("disabled");if(t!==e&&(e=t,s.shadowRoot instanceof ShadowRoot)){var o="button, command, fieldset, keygen, optgroup, option, select, textarea, input, [data-monster-objectlink]",n=s.shadowRoot.querySelectorAll(o);let e;try{e=new Set([...n,...getSlottedElements.call(s,o)])}catch(t){e=n}for(const i of[...e])!0===t?i.setAttribute(ATTRIBUTE_DISABLED,""):i.removeAttribute(ATTRIBUTE_DISABLED)}})),s.attachObserver(new Observer(function(){if(hasObjectLink(s,objectUpdaterLinkSymbol))for(const e of getLinkedObjects(s,objectUpdaterLinkSymbol))for(const o of e){var t=clone(s[internalSymbol].getRealSubject().options);Object.assign(o.getSubject(),t)}})),s[attributeObserverSymbol][ATTRIBUTE_DISABLED]=()=>{s.hasAttribute(ATTRIBUTE_DISABLED)?s.setOption(ATTRIBUTE_DISABLED,!0):s.setOption(ATTRIBUTE_DISABLED,void 0)},s[attributeObserverSymbol][ATTRIBUTE_OPTIONS]=()=>{var t=getOptionsFromAttributes.call(s);isObject(t)&&0<Object.keys(t).length&&s.setOptions(t)},s[attributeObserverSymbol][ATTRIBUTE_OPTIONS_SELECTOR]=()=>{var t=getOptionsFromScriptTag.call(s);isObject(t)&&0<Object.keys(t).length&&s.setOptions(t)}}function getOptionsFromScriptTag(){var e=this;if(!e.hasAttribute(ATTRIBUTE_OPTIONS_SELECTOR))return{};const t=document.querySelector(e.getAttribute(ATTRIBUTE_OPTIONS_SELECTOR));if(!(t instanceof HTMLScriptElement))return addAttributeToken(e,ATTRIBUTE_ERRORMESSAGE,"the selector "+ATTRIBUTE_OPTIONS_SELECTOR+" for options was specified ("+e.getAttribute(ATTRIBUTE_OPTIONS_SELECTOR)+") but not found."),{};let o={};try{o=parseOptionsJSON.call(this,t.textContent.trim())}catch(t){addAttributeToken(e,ATTRIBUTE_ERRORMESSAGE,"when analyzing the configuration from the script tag there was an error. "+t)}return o}function getOptionsFromAttributes(){if(this.hasAttribute(ATTRIBUTE_OPTIONS))try{return parseOptionsJSON.call(this,this.getAttribute(ATTRIBUTE_OPTIONS))}catch(t){addAttributeToken(this,ATTRIBUTE_ERRORMESSAGE,"the options attribute "+ATTRIBUTE_OPTIONS+" does not contain a valid json definition (actual: "+this.getAttribute(ATTRIBUTE_OPTIONS)+")."+t)}return{}}function parseOptionsJSON(t){var e={};if(!isString(t))return e;try{t=parseDataURL(t).content}catch(t){}try{var o=JSON.parse(t);return validateObject(o)}catch(t){throw t}return e}function initHtmlContent(){try{let t=findDocumentTemplate(this.constructor.getTag());this.appendChild(t.createDocumentFragment())}catch(t){var e=this.getOption("templates.main","");isString(e)&&0<e.length&&(this.innerHTML=e)}return this}function initCSSStylesheet(){if(!(this.shadowRoot instanceof ShadowRoot))return this;const t=this.constructor.getCSSStyleSheet();if(t instanceof CSSStyleSheet)0<t.cssRules.length&&(this.shadowRoot.adoptedStyleSheets=[t]);else if(isArray(t)){const n=[];for(var e of t)if(isString(e)){var o=e.trim();if(""!==o){const i=document.createElement("style");i.innerHTML=o,this.shadowRoot.prepend(i)}}else validateInstance(e,CSSStyleSheet),0<e.cssRules.length&&n.push(e);0<n.length&&(this.shadowRoot.adoptedStyleSheets=n)}else if(isString(t))if(""!==t.trim()){const s=document.createElement("style");s.innerHTML=t,this.shadowRoot.prepend(s)}return this}function initShadowRoot(){let t,e;try{t=findDocumentTemplate(this.constructor.getTag())}catch(t){if(e=this.getOption("templates.main",""),!isString(e)||void 0===e||""===e)throw new Error("html is not set.")}return this.attachShadow({mode:this.getOption("shadowMode","open"),delegatesFocus:this.getOption("delegatesFocus",!0)}),t instanceof Template?this.shadowRoot.appendChild(t.createDocumentFragment()):this.shadowRoot.innerHTML=e,this}function registerCustomElement(t){validateFunction(t),getGlobalObject("customElements").define(t.getTag(),t)}function assignUpdaterToElement(t,o){const n=new Set;t instanceof NodeList&&(t=new Set([...t]));let i=[];return t.forEach(t=>{if(t instanceof HTMLElement&&!(t instanceof HTMLTemplateElement)){const e=new Updater(t,o);n.add(e),i.push(e.run().then(()=>e.enableEventProcessing()))}}),0<n.size&&addToObjectLink(this,objectUpdaterLinkSymbol,n),i}assignToNamespace("Monster.DOM",CustomElement,registerCustomElement,assignUpdaterToElement);export{Monster,registerCustomElement,CustomElement,initMethodSymbol,assembleMethodSymbol,assignUpdaterToElement,attributeObserverSymbol,getSlottedElements};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{Pathfinder}from"../data/pathfinder.js";import{assignToNamespace,Monster}from"../namespace.js";import{parseDataURL}from"../types/dataurl.js";import{getGlobalObject}from"../types/global.js";import{isArray,isFunction,isObject,isString}from"../types/is.js";import{Observer}from"../types/observer.js";import{ProxyObserver}from"../types/proxyobserver.js";import{validateFunction,validateInstance,validateObject,validateString}from"../types/validate.js";import{clone}from"../util/clone.js";import{addAttributeToken,addToObjectLink,getLinkedObjects,hasObjectLink}from"./attributes.js";import{ATTRIBUTE_DISABLED,ATTRIBUTE_ERRORMESSAGE,ATTRIBUTE_OPTIONS,ATTRIBUTE_OPTIONS_SELECTOR,objectUpdaterLinkSymbol}from"./constants.js";import{findDocumentTemplate,Template}from"./template.js";import{Updater}from"./updater.js";const initMethodSymbol=Symbol("initMethodSymbol");const assembleMethodSymbol=Symbol("assembleMethodSymbol");const attributeObserverSymbol=Symbol("attributeObserver");class CustomElement extends HTMLElement{constructor(){super();this[internalSymbol]=new ProxyObserver({"options":extend({},this.defaults)});this[attributeObserverSymbol]={};initOptionObserver.call(this);this[initMethodSymbol]()}static get observedAttributes(){return[ATTRIBUTE_OPTIONS,ATTRIBUTE_DISABLED]}get defaults(){return{ATTRIBUTE_DISABLED:this.getAttribute(ATTRIBUTE_DISABLED),shadowMode:"open",delegatesFocus:true,templates:{main:undefined}}}static getTag(){throw new Error("the method getTag must be overwritten by the derived class.")}static getCSSStyleSheet(){return undefined}attachObserver(observer){this[internalSymbol].attachObserver(observer);return this}detachObserver(observer){this[internalSymbol].detachObserver(observer);return this}containsObserver(observer){return this[internalSymbol].containsObserver(observer)}getOption(path,defaultValue){let value;try{value=new Pathfinder(this[internalSymbol].getRealSubject()["options"]).getVia(path)}catch(e){}if(value===undefined)return defaultValue;return value}setOption(path,value){new Pathfinder(this[internalSymbol].getSubject()["options"]).setVia(path,value);return this}setOptions(options){if(isString(options)){options=parseOptionsJSON.call(this,options)}const self=this;extend(self[internalSymbol].getSubject()["options"],self.defaults,options);return self}[initMethodSymbol](){return this}[assembleMethodSymbol](){const self=this;let elements,nodeList;const AttributeOptions=getOptionsFromAttributes.call(self);if(isObject(AttributeOptions)&&Object.keys(AttributeOptions).length>0){self.setOptions(AttributeOptions)}const ScriptOptions=getOptionsFromScriptTag.call(self);if(isObject(ScriptOptions)&&Object.keys(ScriptOptions).length>0){self.setOptions(ScriptOptions)}if(self.getOption("shadowMode",false)!==false){try{initShadowRoot.call(self);elements=self.shadowRoot.childNodes}catch(e){}try{initCSSStylesheet.call(this)}catch(e){addAttributeToken(self,ATTRIBUTE_ERRORMESSAGE,e.toString())}}if(!(elements instanceof NodeList)){if(!(elements instanceof NodeList)){initHtmlContent.call(this);elements=this.childNodes}}try{nodeList=new Set([...elements,...getSlottedElements.call(self)])}catch(e){nodeList=elements}assignUpdaterToElement.call(self,nodeList,clone(self[internalSymbol].getRealSubject()["options"]));return self}connectedCallback(){let self=this;if(!hasObjectLink(self,objectUpdaterLinkSymbol)){self[assembleMethodSymbol]()}}disconnectedCallback(){}adoptedCallback(){}attributeChangedCallback(attrName,oldVal,newVal){const self=this;const callback=self[attributeObserverSymbol]?.[attrName];if(isFunction(callback)){callback.call(self,newVal,oldVal)}}hasNode(node){const self=this;if(containChildNode.call(self,validateInstance(node,Node))){return true}if(!(self.shadowRoot instanceof ShadowRoot)){return false}return containChildNode.call(self.shadowRoot,node)}}function getSlottedElements(query,name){const self=this;const result=new Set;if(!(self.shadowRoot instanceof ShadowRoot)){return result}let selector="slot";if(name!==undefined){if(name===null){selector+=":not([name])"}else{selector+="[name="+validateString(name)+"]"}}const slots=self.shadowRoot.querySelectorAll(selector);for(const[,slot]of Object.entries(slots)){slot.assignedElements().forEach(function(node){if(!(node instanceof HTMLElement))return;if(isString(query)){node.querySelectorAll(query).forEach(function(n){result.add(n)});if(node.matches(query)){result.add(node)}}else if(query!==undefined){throw new Error("query must be a string")}else{result.add(node)}})}return result}function containChildNode(node){const self=this;if(self.contains(node)){return true}for(const[,e]of Object.entries(self.childNodes)){if(e.contains(node)){return true}containChildNode.call(e,node)}return false}function initOptionObserver(){const self=this;let lastDisabledValue=undefined;self.attachObserver(new Observer(function(){const flag=self.getOption("disabled");if(flag===lastDisabledValue){return}lastDisabledValue=flag;if(!(self.shadowRoot instanceof ShadowRoot)){return}const query="button, command, fieldset, keygen, optgroup, option, select, textarea, input, [data-monster-objectlink]";const elements=self.shadowRoot.querySelectorAll(query);let nodeList;try{nodeList=new Set([...elements,...getSlottedElements.call(self,query)])}catch(e){nodeList=elements}for(const element of[...nodeList]){if(flag===true){element.setAttribute(ATTRIBUTE_DISABLED,"")}else{element.removeAttribute(ATTRIBUTE_DISABLED)}}}));self.attachObserver(new Observer(function(){if(!hasObjectLink(self,objectUpdaterLinkSymbol)){return}const updaters=getLinkedObjects(self,objectUpdaterLinkSymbol);for(const list of updaters){for(const updater of list){let d=clone(self[internalSymbol].getRealSubject()["options"]);Object.assign(updater.getSubject(),d)}}}));self[attributeObserverSymbol][ATTRIBUTE_DISABLED]=()=>{if(self.hasAttribute(ATTRIBUTE_DISABLED)){self.setOption(ATTRIBUTE_DISABLED,true)}else{self.setOption(ATTRIBUTE_DISABLED,undefined)}};self[attributeObserverSymbol][ATTRIBUTE_OPTIONS]=()=>{const options=getOptionsFromAttributes.call(self);if(isObject(options)&&Object.keys(options).length>0){self.setOptions(options)}};self[attributeObserverSymbol][ATTRIBUTE_OPTIONS_SELECTOR]=()=>{const options=getOptionsFromScriptTag.call(self);if(isObject(options)&&Object.keys(options).length>0){self.setOptions(options)}}}function getOptionsFromScriptTag(){const self=this;if(!self.hasAttribute(ATTRIBUTE_OPTIONS_SELECTOR)){return{}}const node=document.querySelector(self.getAttribute(ATTRIBUTE_OPTIONS_SELECTOR));if(!(node instanceof HTMLScriptElement)){addAttributeToken(self,ATTRIBUTE_ERRORMESSAGE,"the selector "+ATTRIBUTE_OPTIONS_SELECTOR+" for options was specified ("+self.getAttribute(ATTRIBUTE_OPTIONS_SELECTOR)+") but not found.");return{}}let obj={};try{obj=parseOptionsJSON.call(this,node.textContent.trim())}catch(e){addAttributeToken(self,ATTRIBUTE_ERRORMESSAGE,"when analyzing the configuration from the script tag there was an error. "+e)}return obj}function getOptionsFromAttributes(){const self=this;if(this.hasAttribute(ATTRIBUTE_OPTIONS)){try{return parseOptionsJSON.call(self,this.getAttribute(ATTRIBUTE_OPTIONS))}catch(e){addAttributeToken(self,ATTRIBUTE_ERRORMESSAGE,"the options attribute "+ATTRIBUTE_OPTIONS+" does not contain a valid json definition (actual: "+this.getAttribute(ATTRIBUTE_OPTIONS)+")."+e)}}return{}}function parseOptionsJSON(data){const self=this,obj={};if(!isString(data)){return obj}try{let dataUrl=parseDataURL(data);data=dataUrl.content}catch(e){}try{let _obj=JSON.parse(data);return validateObject(_obj)}catch(e){throw e}return obj}function initHtmlContent(){try{let template=findDocumentTemplate(this.constructor.getTag());this.appendChild(template.createDocumentFragment())}catch(e){let html=this.getOption("templates.main","");if(isString(html)&&html.length>0){this.innerHTML=html}}return this}function initCSSStylesheet(){const self=this;if(!(this.shadowRoot instanceof ShadowRoot)){return self}const styleSheet=this.constructor.getCSSStyleSheet();if(styleSheet instanceof CSSStyleSheet){if(styleSheet.cssRules.length>0){this.shadowRoot.adoptedStyleSheets=[styleSheet]}}else if(isArray(styleSheet)){const assign=[];for(let s of styleSheet){if(isString(s)){let trimedStyleSheet=s.trim();if(trimedStyleSheet!==""){const style=document.createElement("style");style.innerHTML=trimedStyleSheet;self.shadowRoot.prepend(style)}continue}validateInstance(s,CSSStyleSheet);if(s.cssRules.length>0){assign.push(s)}}if(assign.length>0){this.shadowRoot.adoptedStyleSheets=assign}}else if(isString(styleSheet)){let trimedStyleSheet=styleSheet.trim();if(trimedStyleSheet!==""){const style=document.createElement("style");style.innerHTML=styleSheet;self.shadowRoot.prepend(style)}}return self}function initShadowRoot(){let template,html;try{template=findDocumentTemplate(this.constructor.getTag())}catch(e){html=this.getOption("templates.main","");if(!isString(html)||html===undefined||html===""){throw new Error("html is not set.")}}this.attachShadow({mode:this.getOption("shadowMode","open"),delegatesFocus:this.getOption("delegatesFocus",true)});if(template instanceof Template){this.shadowRoot.appendChild(template.createDocumentFragment());return this}this.shadowRoot.innerHTML=html;return this}function registerCustomElement(element){validateFunction(element);getGlobalObject("customElements").define(element.getTag(),element)}function assignUpdaterToElement(elements,object){const updaters=new Set;if(elements instanceof NodeList){elements=new Set([...elements])}let result=[];elements.forEach(element=>{if(!(element instanceof HTMLElement))return;if(element instanceof HTMLTemplateElement)return;const u=new Updater(element,object);updaters.add(u);result.push(u.run().then(()=>{return u.enableEventProcessing()}))});if(updaters.size>0){addToObjectLink(this,objectUpdaterLinkSymbol,updaters)}return result}assignToNamespace("Monster.DOM",CustomElement,registerCustomElement,assignUpdaterToElement);export{Monster,registerCustomElement,CustomElement,initMethodSymbol,assembleMethodSymbol,assignUpdaterToElement,attributeObserverSymbol,getSlottedElements};
diff --git a/packages/monster/dist/modules/dom/events.js b/packages/monster/dist/modules/dom/events.js
index 493efcaf486861e86988e96961aecb40ca2391dc..12afbd9ecc7beeec47ee2d9bdf2994b140e0cfd8 100644
--- a/packages/monster/dist/modules/dom/events.js
+++ b/packages/monster/dist/modules/dom/events.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isArray,isObject}from"../types/is.js";import{validateInstance,validateString}from"../types/validate.js";import{getDocument}from"./util.js";function fireEvent(e,t){var n;getDocument();if(e instanceof HTMLElement)"click"!==t?(n=new Event(validateString(t),{bubbles:!0,cancelable:!0}),e.dispatchEvent(n)):e.click();else{if(!(e instanceof HTMLCollection||e instanceof NodeList))throw new TypeError("value is not an instance of HTMLElement or HTMLCollection");for(var o of e)fireEvent(o,t)}}function fireCustomEvent(e,t,n){getDocument();if(e instanceof HTMLElement){isObject(n)||(n={detail:n});var o=new CustomEvent(validateString(t),{bubbles:!0,cancelable:!0,detail:n});e.dispatchEvent(o)}else{if(!(e instanceof HTMLCollection||e instanceof NodeList))throw new TypeError("value is not an instance of HTMLElement or HTMLCollection");for(var i of e)fireCustomEvent(i,t,n)}}function findTargetElementFromEvent(e,t,n){if(validateInstance(e,Event),"function"!=typeof e.composedPath)throw new Error("unsupported event");var o=e.composedPath();if(isArray(o))for(let e=0;e<o.length;e++){const i=o[e];if(i instanceof HTMLElement&&i.hasAttribute(t)&&(void 0===n||i.getAttribute(t)===n))return i}}assignToNamespace("Monster.DOM",findTargetElementFromEvent,fireEvent,fireCustomEvent);export{Monster,findTargetElementFromEvent,fireEvent,fireCustomEvent};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{isArray,isObject}from"../types/is.js";import{validateInstance,validateString}from"../types/validate.js";import{getDocument}from"./util.js";function fireEvent(element,type){const document=getDocument();if(element instanceof HTMLElement){if(type==="click"){element.click();return}let event=new Event(validateString(type),{bubbles:true,cancelable:true});element.dispatchEvent(event)}else if(element instanceof HTMLCollection||element instanceof NodeList){for(let e of element){fireEvent(e,type)}}else{throw new TypeError("value is not an instance of HTMLElement or HTMLCollection")}}function fireCustomEvent(element,type,detail){const document=getDocument();if(element instanceof HTMLElement){if(!isObject(detail)){detail={detail}}let event=new CustomEvent(validateString(type),{bubbles:true,cancelable:true,detail});element.dispatchEvent(event)}else if(element instanceof HTMLCollection||element instanceof NodeList){for(let e of element){fireCustomEvent(e,type,detail)}}else{throw new TypeError("value is not an instance of HTMLElement or HTMLCollection")}}function findTargetElementFromEvent(event,attributeName,attributeValue){validateInstance(event,Event);if(typeof event.composedPath!=="function"){throw new Error("unsupported event")}const path=event.composedPath();if(isArray(path)){for(let i=0;i<path.length;i++){const o=path[i];if(o instanceof HTMLElement&&o.hasAttribute(attributeName)&&(attributeValue===undefined||o.getAttribute(attributeName)===attributeValue)){return o}}}return undefined}assignToNamespace("Monster.DOM",findTargetElementFromEvent,fireEvent,fireCustomEvent);export{Monster,findTargetElementFromEvent,fireEvent,fireCustomEvent};
diff --git a/packages/monster/dist/modules/dom/focusmanager.js b/packages/monster/dist/modules/dom/focusmanager.js
index ad4f9a4c6ae41e49caec85468ea35c6b19cb3faf..66dcbd1b6ca17c4c50157b39af69fbeff967f572 100644
--- a/packages/monster/dist/modules/dom/focusmanager.js
+++ b/packages/monster/dist/modules/dom/focusmanager.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{extend}from"../data/extend.js";import{assignToNamespace}from"../namespace.js";import{BaseWithOptions}from"../types/basewithoptions.js";import{getGlobalObject}from"../types/global.js";import{isArray}from"../types/is.js";import{Stack}from"../types/stack.js";import{validateInstance,validateString}from"../types/validate.js";const KEY_DOCUMENT="document",KEY_CONTEXT="context",stackSymbol=Symbol("stack");class FocusManager extends BaseWithOptions{constructor(t){super(t),validateInstance(this.getOption(KEY_DOCUMENT),HTMLDocument),this[stackSymbol]=new Stack}get defaults(){return extend({},super.defaults,{[KEY_DOCUMENT]:getGlobalObject("document"),[KEY_CONTEXT]:void 0})}storeFocus(){var t=this.getActive();return t instanceof Node&&this[stackSymbol].push(t),this}restoreFocus(){var t=this[stackSymbol].pop();return t instanceof Node&&this.focus(t),this}focus(t,e){return validateInstance(t,Node),t.focus({preventScroll:e??!1}),this}getActive(){return this.getOption(KEY_DOCUMENT).activeElement}getFocusable(e){let t=this.getOption(KEY_CONTEXT);return void 0===t&&(t=this.getOption(KEY_DOCUMENT)),validateInstance(t,Node),void 0!==e&&validateString(e),[...t.querySelectorAll('details, button, input, [tabindex]:not([tabindex="-1"]), select, textarea, a[href], body')].filter(t=>{if(void 0!==e&&!t.matches(e))return!1;if(t.hasAttribute("disabled"))return!1;if("true"===t.getAttribute("aria-hidden"))return!1;t=t.getBoundingClientRect();return 0!==t.width&&0!==t.height})}focusNext(t){var e,s=this.getActive();const i=this.getFocusable(t);return isArray(i)&&0!==i.length&&(s instanceof Node&&-1<(e=i.indexOf(s))?this.focus(i[e+1]||i[0]):this.focus(i[0])),this}focusPrev(t){var e,s=this.getActive();const i=this.getFocusable(t);return isArray(i)&&0!==i.length&&(s instanceof Node&&-1<(e=i.indexOf(s))?this.focus(i[e-1]||i[i.length-1]):this.focus(i[i.length-1])),this}}assignToNamespace("Monster.DOM",FocusManager);export{FocusManager};
\ No newline at end of file
+'use strict';import{extend}from"../data/extend.js";import{assignToNamespace}from"../namespace.js";import{BaseWithOptions}from"../types/basewithoptions.js";import{getGlobalObject}from"../types/global.js";import{isArray}from"../types/is.js";import{Stack}from"../types/stack.js";import{validateInstance,validateString}from"../types/validate.js";const KEY_DOCUMENT="document";const KEY_CONTEXT="context";const stackSymbol=Symbol("stack");class FocusManager extends BaseWithOptions{constructor(options){super(options);validateInstance(this.getOption(KEY_DOCUMENT),HTMLDocument);this[stackSymbol]=new Stack}get defaults(){return extend({},super.defaults,{[KEY_DOCUMENT]:getGlobalObject("document"),[KEY_CONTEXT]:undefined})}storeFocus(){const active=this.getActive();if(active instanceof Node){this[stackSymbol].push(active)}return this}restoreFocus(){const last=this[stackSymbol].pop();if(last instanceof Node){this.focus(last)}return this}focus(element,preventScroll){validateInstance(element,Node);element.focus({preventScroll:preventScroll??false});return this}getActive(){return this.getOption(KEY_DOCUMENT).activeElement}getFocusable(query){let contextElement=this.getOption(KEY_CONTEXT);if(contextElement===undefined){contextElement=this.getOption(KEY_DOCUMENT)}validateInstance(contextElement,Node);if(query!==undefined){validateString(query)}return[...contextElement.querySelectorAll("details, button, input, [tabindex]:not([tabindex=\"-1\"]), select, textarea, a[href], body")].filter(element=>{if(query!==undefined&&!element.matches(query)){return false}if(element.hasAttribute("disabled"))return false;if(element.getAttribute("aria-hidden")==="true")return false;const rect=element.getBoundingClientRect();if(rect.width===0)return false;if(rect.height===0)return false;return true})}focusNext(query){const current=this.getActive();const focusable=this.getFocusable(query);if(!isArray(focusable)||focusable.length===0){return this}if(current instanceof Node){let index=focusable.indexOf(current);if(index>-1){this.focus(focusable[index+1]||focusable[0])}else{this.focus(focusable[0])}}else{this.focus(focusable[0])}return this}focusPrev(query){const current=this.getActive();const focusable=this.getFocusable(query);if(!isArray(focusable)||focusable.length===0){return this}if(current instanceof Node){let index=focusable.indexOf(current);if(index>-1){this.focus(focusable[index-1]||focusable[focusable.length-1])}else{this.focus(focusable[focusable.length-1])}}else{this.focus(focusable[focusable.length-1])}return this}}assignToNamespace("Monster.DOM",FocusManager);export{FocusManager};
diff --git a/packages/monster/dist/modules/dom/locale.js b/packages/monster/dist/modules/dom/locale.js
index 3731b1531b45f9972ef1549f487cf34d4a28b428..7e1dfdf960d0f7a034ec4cb44dd976c1a4c89f6f 100644
--- a/packages/monster/dist/modules/dom/locale.js
+++ b/packages/monster/dist/modules/dom/locale.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{parseLocale}from"../i18n/locale.js";import{assignToNamespace,Monster}from"../namespace.js";import{getDocument}from"./util.js";const DEFAULT_LANGUAGE="en";function getLocaleOfDocument(){const e=getDocument();let t=e.querySelector("html");if(t instanceof HTMLElement&&t.hasAttribute("lang")){var o=t.getAttribute("lang");if(o)return new parseLocale(o)}return parseLocale(DEFAULT_LANGUAGE)}assignToNamespace("Monster.DOM",getLocaleOfDocument);export{Monster,getLocaleOfDocument};
\ No newline at end of file
+'use strict';import{parseLocale}from"../i18n/locale.js";import{assignToNamespace,Monster}from"../namespace.js";import{getDocument}from"./util.js";const DEFAULT_LANGUAGE="en";function getLocaleOfDocument(){const document=getDocument();let html=document.querySelector("html");if(html instanceof HTMLElement&&html.hasAttribute("lang")){let locale=html.getAttribute("lang");if(locale){return new parseLocale(locale)}}return parseLocale(DEFAULT_LANGUAGE)}assignToNamespace("Monster.DOM",getLocaleOfDocument);export{Monster,getLocaleOfDocument};
diff --git a/packages/monster/dist/modules/dom/namespace.js b/packages/monster/dist/modules/dom/namespace.js
index f6f43eb6667863dabf01828dd221be58d7983e5d..cdb3e16ac687cef5e24e8dcb8a8836fe8d3708c3 100644
--- a/packages/monster/dist/modules/dom/namespace.js
+++ b/packages/monster/dist/modules/dom/namespace.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";const namespace="Monster.DOM";export{namespace};
\ No newline at end of file
+'use strict';export const namespace="Monster.DOM";
diff --git a/packages/monster/dist/modules/dom/ready.js b/packages/monster/dist/modules/dom/ready.js
new file mode 100644
index 0000000000000000000000000000000000000000..51e9be236036a6a844afe27818fdc1729be4a23d
--- /dev/null
+++ b/packages/monster/dist/modules/dom/ready.js
@@ -0,0 +1,2 @@
+/** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
+'use strict';import{Monster}from"../namespace.js";import{getDocument,getWindow}from"./util.js";const domReady=new Promise(resolve=>{const document=getDocument();if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",resolve)}else{resolve()}});const windowReady=new Promise(resolve=>{const document=getDocument();const window=getWindow();if(document.readyState==="complete"){resolve()}else{window.addEventListener("load",resolve)}});export{Monster,windowReady,domReady};
diff --git a/packages/monster/dist/modules/dom/resource.js b/packages/monster/dist/modules/dom/resource.js
index 12c00065ada0c2203e7ea94fbb9844650c5f54ab..32ad882063fdc8d54363484565de3340bf4cfc16 100644
--- a/packages/monster/dist/modules/dom/resource.js
+++ b/packages/monster/dist/modules/dom/resource.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalStateSymbol,internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{assignToNamespace,Monster}from"../namespace.js";import{BaseWithOptions}from"../types/basewithoptions.js";import{getGlobalObject}from"../types/global.js";import{ID}from"../types/id.js";import{isString}from"../types/is.js";import{Observer}from"../types/observer.js";import{ProxyObserver}from"../types/proxyobserver.js";import{ATTRIBUTE_CLASS,ATTRIBUTE_ID,ATTRIBUTE_TITLE}from"./constants.js";const KEY_DOCUMENT="document",KEY_QUERY="query",KEY_TIMEOUT="timeout",referenceSymbol=Symbol("reference");class Resource extends BaseWithOptions{constructor(e){super(e);let t=this.getOption(this.constructor.getURLAttribute());if(void 0===t)throw new Error("missing source");if(t instanceof URL)t=t.toString();else if(!isString(t))throw new Error("unsupported url type");this[internalSymbol][this.constructor.getURLAttribute()]=t,this[internalStateSymbol]=new ProxyObserver({loaded:!1,error:void 0}),this[referenceSymbol]=void 0}isConnected(){return this[referenceSymbol]instanceof HTMLElement&&this[referenceSymbol].isConnected}create(){throw new Error("this method must be implemented by derived classes")}connect(){return this[referenceSymbol]instanceof HTMLElement||this.create(),appendToDocument.call(this),this}get defaults(){return extend({},super.defaults,{[this.constructor.getURLAttribute()]:void 0,[KEY_DOCUMENT]:getGlobalObject("document"),[KEY_QUERY]:"head",[KEY_TIMEOUT]:1e4,[ATTRIBUTE_ID]:new ID("resource").toString(),[ATTRIBUTE_CLASS]:void 0,[ATTRIBUTE_TITLE]:void 0})}available(){const n=this;return n[referenceSymbol]instanceof HTMLElement?n.isConnected()?!0===n[internalStateSymbol].getSubject().loaded?void 0!==n[internalStateSymbol].getSubject().error?Promise.reject(n[internalStateSymbol].getSubject().error):Promise.resolve():new Promise(function(e,t){const r=setTimeout(()=>{t("timeout")},n.getOption("timeout")),o=new Observer(()=>{clearTimeout(r),n[internalStateSymbol].detachObserver(o),e()});n[internalStateSymbol].attachObserver(o)}):Promise.reject("element not connected"):Promise.reject("no element")}static getURLAttribute(){throw new Error("this method must be implemented by derived classes")}}function appendToDocument(){var e=this;const t=document.querySelector(e.getOption(KEY_QUERY,"head"));if(!(t instanceof HTMLElement))throw new Error("target not found");return addEvents.call(e),t.appendChild(e[referenceSymbol]),e}function addEvents(){const e=this,t=()=>{e[referenceSymbol].removeEventListener("error",t),e[referenceSymbol].removeEventListener("load",r),e[internalStateSymbol].setSubject({loaded:!0,error:e[referenceSymbol][e.constructor.getURLAttribute()]+" is not available"})},r=()=>{e[referenceSymbol].removeEventListener("error",t),e[referenceSymbol].removeEventListener("load",r),e[internalStateSymbol].getSubject().loaded=!0};return e[referenceSymbol].addEventListener("load",r,!1),e[referenceSymbol].addEventListener("error",t,!1),e}assignToNamespace("Monster.DOM",Resource);export{KEY_DOCUMENT,KEY_QUERY,KEY_TIMEOUT,referenceSymbol,Monster,Resource};
\ No newline at end of file
+'use strict';import{internalStateSymbol,internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{assignToNamespace,Monster}from"../namespace.js";import{BaseWithOptions}from"../types/basewithoptions.js";import{getGlobalObject}from"../types/global.js";import{ID}from"../types/id.js";import{isString}from"../types/is.js";import{Observer}from"../types/observer.js";import{ProxyObserver}from"../types/proxyobserver.js";import{ATTRIBUTE_CLASS,ATTRIBUTE_ID,ATTRIBUTE_TITLE}from"./constants.js";export const KEY_DOCUMENT="document";export const KEY_QUERY="query";export const KEY_TIMEOUT="timeout";export const referenceSymbol=Symbol("reference");class Resource extends BaseWithOptions{constructor(options){super(options);let uri=this.getOption(this.constructor.getURLAttribute());if(uri===undefined){throw new Error("missing source")}else if(uri instanceof URL){uri=uri.toString()}else if(!isString(uri)){throw new Error("unsupported url type")}this[internalSymbol][this.constructor.getURLAttribute()]=uri;this[internalStateSymbol]=new ProxyObserver({loaded:false,error:undefined});this[referenceSymbol]=undefined}isConnected(){if(this[referenceSymbol]instanceof HTMLElement){return this[referenceSymbol].isConnected}return false}create(){throw new Error("this method must be implemented by derived classes")}connect(){if(!(this[referenceSymbol]instanceof HTMLElement)){this.create()}appendToDocument.call(this);return this}get defaults(){return extend({},super.defaults,{[this.constructor.getURLAttribute()]:undefined,[KEY_DOCUMENT]:getGlobalObject("document"),[KEY_QUERY]:"head",[KEY_TIMEOUT]:10000,[ATTRIBUTE_ID]:new ID("resource").toString(),[ATTRIBUTE_CLASS]:undefined,[ATTRIBUTE_TITLE]:undefined})}available(){const self=this;if(!(self[referenceSymbol]instanceof HTMLElement)){return Promise.reject("no element")}if(!self.isConnected()){return Promise.reject("element not connected")}if(self[internalStateSymbol].getSubject()["loaded"]===true){if(self[internalStateSymbol].getSubject()["error"]!==undefined){return Promise.reject(self[internalStateSymbol].getSubject()["error"])}return Promise.resolve()}return new Promise(function(resolve,reject){const timeout=setTimeout(()=>{reject("timeout")},self.getOption("timeout"));const observer=new Observer(()=>{clearTimeout(timeout);self[internalStateSymbol].detachObserver(observer);resolve()});self[internalStateSymbol].attachObserver(observer)})}static getURLAttribute(){throw new Error("this method must be implemented by derived classes")}}function appendToDocument(){const self=this;const targetNode=document.querySelector(self.getOption(KEY_QUERY,"head"));if(!(targetNode instanceof HTMLElement)){throw new Error("target not found")}addEvents.call(self);targetNode.appendChild(self[referenceSymbol]);return self}function addEvents(){const self=this;const onError=()=>{self[referenceSymbol].removeEventListener("error",onError);self[referenceSymbol].removeEventListener("load",onLoad);self[internalStateSymbol].setSubject({loaded:true,error:self[referenceSymbol][self.constructor.getURLAttribute()]+" is not available"});return};const onLoad=()=>{self[referenceSymbol].removeEventListener("error",onError);self[referenceSymbol].removeEventListener("load",onLoad);self[internalStateSymbol].getSubject()["loaded"]=true;return};self[referenceSymbol].addEventListener("load",onLoad,false);self[referenceSymbol].addEventListener("error",onError,false);return self}assignToNamespace("Monster.DOM",Resource);export{Monster,Resource};
diff --git a/packages/monster/dist/modules/dom/resource/data.js b/packages/monster/dist/modules/dom/resource/data.js
index a86fa58aedbe533952bf66cd7f14f2b5acd8253d..2e8cfd802116bdaa772eb1769fc1cc69d8318656 100644
--- a/packages/monster/dist/modules/dom/resource/data.js
+++ b/packages/monster/dist/modules/dom/resource/data.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalStateSymbol}from"../../constants.js";import{extend}from"../../data/extend.js";import{assignToNamespace,Monster}from"../../namespace.js";import{getGlobalFunction}from"../../types/global.js";import{ATTRIBUTE_CLASS,ATTRIBUTE_ERRORMESSAGE,ATTRIBUTE_ID,ATTRIBUTE_SRC,ATTRIBUTE_TITLE,ATTRIBUTE_TYPE,TAG_SCRIPT}from"../constants.js";import{KEY_DOCUMENT,KEY_QUERY,referenceSymbol,Resource}from"../resource.js";class Data extends Resource{get defaults(){return extend({},super.defaults,{mode:"cors",credentials:"same-origin",type:"application/json"})}create(){return createElement.call(this),this}connect(){return this[referenceSymbol]instanceof HTMLElement||this.create(),appendToDocument.call(this),this}static getURLAttribute(){return ATTRIBUTE_SRC}}function createElement(){var e,t=this;const o=t.getOption(KEY_DOCUMENT);t[referenceSymbol]=o.createElement(TAG_SCRIPT);for(e of[ATTRIBUTE_TYPE,ATTRIBUTE_ID,ATTRIBUTE_CLASS,ATTRIBUTE_TITLE])void 0!==t.getOption(e)&&(t[referenceSymbol][e]=t.getOption(e));return t}function appendToDocument(){const t=this,o=document.querySelector(t.getOption(KEY_QUERY,"head"));if(!(o instanceof HTMLElement))throw new Error("target not found");return o.appendChild(t[referenceSymbol]),getGlobalFunction("fetch")(t.getOption(ATTRIBUTE_SRC),{method:"GET",mode:t.getOption("mode","cors"),cache:"no-cache",credentials:t.getOption("credentials","same-origin"),headers:{Accept:t.getOption("type","application/json")},redirect:"follow",referrerPolicy:"no-referrer"}).then(e=>e.text()).then(e=>{e=document.createTextNode(e);t[referenceSymbol].appendChild(e),t[internalStateSymbol].getSubject().loaded=!0}).catch(e=>{t[internalStateSymbol].setSubject({loaded:!0,error:e.toString()}),o.setAttribute(ATTRIBUTE_ERRORMESSAGE,e.toString())}),t}assignToNamespace("Monster.DOM.Resource",Data);export{Monster,Data};
\ No newline at end of file
+'use strict';import{internalStateSymbol}from"../../constants.js";import{extend}from"../../data/extend.js";import{assignToNamespace,Monster}from"../../namespace.js";import{getGlobalFunction}from"../../types/global.js";import{ATTRIBUTE_CLASS,ATTRIBUTE_ERRORMESSAGE,ATTRIBUTE_ID,ATTRIBUTE_SRC,ATTRIBUTE_TITLE,ATTRIBUTE_TYPE,TAG_SCRIPT}from"../constants.js";import{KEY_DOCUMENT,KEY_QUERY,referenceSymbol,Resource}from"../resource.js";class Data extends Resource{get defaults(){return extend({},super.defaults,{mode:"cors",credentials:"same-origin",type:"application/json"})}create(){createElement.call(this);return this}connect(){if(!(this[referenceSymbol]instanceof HTMLElement)){this.create()}appendToDocument.call(this);return this}static getURLAttribute(){return ATTRIBUTE_SRC}}function createElement(){const self=this;const document=self.getOption(KEY_DOCUMENT);self[referenceSymbol]=document.createElement(TAG_SCRIPT);for(let key of[ATTRIBUTE_TYPE,ATTRIBUTE_ID,ATTRIBUTE_CLASS,ATTRIBUTE_TITLE]){if(self.getOption(key)!==undefined){self[referenceSymbol][key]=self.getOption(key)}}return self}function appendToDocument(){const self=this;const targetNode=document.querySelector(self.getOption(KEY_QUERY,"head"));if(!(targetNode instanceof HTMLElement)){throw new Error("target not found")}targetNode.appendChild(self[referenceSymbol]);getGlobalFunction("fetch")(self.getOption(ATTRIBUTE_SRC),{method:"GET",mode:self.getOption("mode","cors"),cache:"no-cache",credentials:self.getOption("credentials","same-origin"),headers:{"Accept":self.getOption("type","application/json")},redirect:"follow",referrerPolicy:"no-referrer"}).then(response=>{return response.text()}).then(text=>{const textNode=document.createTextNode(text);self[referenceSymbol].appendChild(textNode);self[internalStateSymbol].getSubject()["loaded"]=true}).catch(e=>{self[internalStateSymbol].setSubject({loaded:true,error:e.toString()});targetNode.setAttribute(ATTRIBUTE_ERRORMESSAGE,e.toString())});return self}assignToNamespace("Monster.DOM.Resource",Data);export{Monster,Data};
diff --git a/packages/monster/dist/modules/dom/resource/link.js b/packages/monster/dist/modules/dom/resource/link.js
index d9cc54a01856bc3db27f1060c6c24d94746e64d6..a565eb22a581bfe1ad3887888f293319f70923c6 100644
--- a/packages/monster/dist/modules/dom/resource/link.js
+++ b/packages/monster/dist/modules/dom/resource/link.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{extend}from"../../data/extend.js";import{assignToNamespace,Monster}from"../../namespace.js";import{ATTRIBUTE_CLASS,ATTRIBUTE_HREF,ATTRIBUTE_ID,ATTRIBUTE_NONCE,ATTRIBUTE_SRC,ATTRIBUTE_TITLE,ATTRIBUTE_TYPE,TAG_LINK}from"../constants.js";import{KEY_DOCUMENT,referenceSymbol,Resource}from"../resource.js";class Link extends Resource{get defaults(){return extend({},super.defaults,{as:void 0,crossOrigin:"anonymous",disabled:void 0,href:void 0,hreflang:void 0,imagesizes:void 0,imagesrcset:void 0,integrity:void 0,media:void 0,prefetch:void 0,referrerpolicy:void 0,rel:void 0,sizes:void 0,type:void 0,nonce:void 0})}create(){return createElement.call(this),this}static getURLAttribute(){return ATTRIBUTE_HREF}}function createElement(){var e,r=this;const t=r.getOption(KEY_DOCUMENT);r[referenceSymbol]=t.createElement(TAG_LINK);for(e of["as","crossOrigin","disabled","href","hreflang","imagesizes","imagesrcset","integrity","media","prefetch","referrerpolicy","sizes","rel","type",ATTRIBUTE_HREF,ATTRIBUTE_ID,ATTRIBUTE_CLASS,ATTRIBUTE_TITLE,ATTRIBUTE_NONCE])void 0!==r.getOption(e)&&(r[referenceSymbol][e]=r.getOption(e));return r}assignToNamespace("Monster.DOM.Resource",Link);export{Monster,Link};
\ No newline at end of file
+'use strict';import{extend}from"../../data/extend.js";import{assignToNamespace,Monster}from"../../namespace.js";import{ATTRIBUTE_CLASS,ATTRIBUTE_HREF,ATTRIBUTE_ID,ATTRIBUTE_NONCE,ATTRIBUTE_SRC,ATTRIBUTE_TITLE,ATTRIBUTE_TYPE,TAG_LINK}from"../constants.js";import{KEY_DOCUMENT,referenceSymbol,Resource}from"../resource.js";class Link extends Resource{get defaults(){return extend({},super.defaults,{as:undefined,crossOrigin:"anonymous",disabled:undefined,href:undefined,hreflang:undefined,imagesizes:undefined,imagesrcset:undefined,integrity:undefined,media:undefined,prefetch:undefined,referrerpolicy:undefined,rel:undefined,sizes:undefined,type:undefined,nonce:undefined})}create(){createElement.call(this);return this}static getURLAttribute(){return ATTRIBUTE_HREF}}function createElement(){const self=this;const document=self.getOption(KEY_DOCUMENT);self[referenceSymbol]=document.createElement(TAG_LINK);for(let key of["as","crossOrigin","disabled","href","hreflang","imagesizes","imagesrcset","integrity","media","prefetch","referrerpolicy","sizes","rel","type",ATTRIBUTE_HREF,ATTRIBUTE_ID,ATTRIBUTE_CLASS,ATTRIBUTE_TITLE,ATTRIBUTE_NONCE]){if(self.getOption(key)!==undefined){self[referenceSymbol][key]=self.getOption(key)}}return self}assignToNamespace("Monster.DOM.Resource",Link);export{Monster,Link};
diff --git a/packages/monster/dist/modules/dom/resource/link/stylesheet.js b/packages/monster/dist/modules/dom/resource/link/stylesheet.js
index 8ac1b4d6568a1355b0d6712f8a1734b0c89a683d..3e6008a5692d58e5761ba6ca912d945d5d0d0487 100644
--- a/packages/monster/dist/modules/dom/resource/link/stylesheet.js
+++ b/packages/monster/dist/modules/dom/resource/link/stylesheet.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{extend}from"../../../data/extend.js";import{assignToNamespace,Monster}from"../../../namespace.js";import{Link}from"../link.js";class Stylesheet extends Link{get defaults(){return extend({},super.defaults,{rel:"stylesheet"})}}assignToNamespace("Monster.DOM.Resource.Link",Stylesheet);export{Monster,Stylesheet};
\ No newline at end of file
+'use strict';import{extend}from"../../../data/extend.js";import{assignToNamespace,Monster}from"../../../namespace.js";import{Link}from"../link.js";class Stylesheet extends Link{get defaults(){return extend({},super.defaults,{rel:"stylesheet"})}}assignToNamespace("Monster.DOM.Resource.Link",Stylesheet);export{Monster,Stylesheet};
diff --git a/packages/monster/dist/modules/dom/resource/script.js b/packages/monster/dist/modules/dom/resource/script.js
index c90982ed3bfe4c779e32e9178561e0847acd7e7e..4c701d34240610ab56f6d432136b96fbdda6cb7d 100644
--- a/packages/monster/dist/modules/dom/resource/script.js
+++ b/packages/monster/dist/modules/dom/resource/script.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{extend}from"../../data/extend.js";import{assignToNamespace,Monster}from"../../namespace.js";import{ATTRIBUTE_CLASS,ATTRIBUTE_ID,ATTRIBUTE_NONCE,ATTRIBUTE_SRC,ATTRIBUTE_TITLE,ATTRIBUTE_TYPE,TAG_SCRIPT}from"../constants.js";import{KEY_DOCUMENT,referenceSymbol,Resource}from"../resource.js";class Script extends Resource{get defaults(){return extend({},super.defaults,{async:!0,crossOrigin:"anonymous",defer:!1,integrity:void 0,nomodule:!1,nonce:void 0,referrerpolicy:void 0,type:"text/javascript"})}create(){return createElement.call(this),this}static getURLAttribute(){return ATTRIBUTE_SRC}}function createElement(){var e,r=this;const t=r.getOption(KEY_DOCUMENT);r[referenceSymbol]=t.createElement(TAG_SCRIPT);for(e of["crossOrigin","defer","async","integrity","nomodule",ATTRIBUTE_NONCE,"referrerpolicy",ATTRIBUTE_TYPE,ATTRIBUTE_SRC,ATTRIBUTE_ID,ATTRIBUTE_CLASS,ATTRIBUTE_TITLE])void 0!==r.getOption(e)&&(r[referenceSymbol][e]=r.getOption(e));return r}assignToNamespace("Monster.DOM.Resource",Script);export{Monster,Script};
\ No newline at end of file
+'use strict';import{extend}from"../../data/extend.js";import{assignToNamespace,Monster}from"../../namespace.js";import{ATTRIBUTE_CLASS,ATTRIBUTE_ID,ATTRIBUTE_NONCE,ATTRIBUTE_SRC,ATTRIBUTE_TITLE,ATTRIBUTE_TYPE,TAG_SCRIPT}from"../constants.js";import{KEY_DOCUMENT,referenceSymbol,Resource}from"../resource.js";class Script extends Resource{get defaults(){return extend({},super.defaults,{async:true,crossOrigin:"anonymous",defer:false,integrity:undefined,nomodule:false,nonce:undefined,referrerpolicy:undefined,type:"text/javascript"})}create(){createElement.call(this);return this}static getURLAttribute(){return ATTRIBUTE_SRC}}function createElement(){const self=this;const document=self.getOption(KEY_DOCUMENT);self[referenceSymbol]=document.createElement(TAG_SCRIPT);for(let key of["crossOrigin","defer","async","integrity","nomodule",ATTRIBUTE_NONCE,"referrerpolicy",ATTRIBUTE_TYPE,ATTRIBUTE_SRC,ATTRIBUTE_ID,ATTRIBUTE_CLASS,ATTRIBUTE_TITLE]){if(self.getOption(key)!==undefined){self[referenceSymbol][key]=self.getOption(key)}}return self}assignToNamespace("Monster.DOM.Resource",Script);export{Monster,Script};
diff --git a/packages/monster/dist/modules/dom/resourcemanager.js b/packages/monster/dist/modules/dom/resourcemanager.js
index 46680c4d510ab948121863dbccbd69571569a1d9..decc662da5e401e57db7a988778a53966d32336c 100644
--- a/packages/monster/dist/modules/dom/resourcemanager.js
+++ b/packages/monster/dist/modules/dom/resourcemanager.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{extend}from"../data/extend.js";import{assignToNamespace,Monster}from"../namespace.js";import{BaseWithOptions}from"../types/basewithoptions.js";import{getGlobalObject}from"../types/global.js";import{isArray}from"../types/is.js";import{ATTRIBUTE_HREF,ATTRIBUTE_SRC}from"./constants.js";import{Resource}from"./resource.js";import{Data}from"./resource/data.js";import{Stylesheet}from"./resource/link/stylesheet.js";import{Script}from"./resource/script.js";class ResourceManager extends BaseWithOptions{constructor(e){if(super(e),!(this.getOption("document")instanceof Document))throw new Error("unsupported document type")}getBaseURL(){this.getOption("document")?.baseURL}get defaults(){return Object.assign({},super.defaults,{document:getGlobalObject("document"),resources:{scripts:[],stylesheets:[],data:[]}})}connect(){return runResourceMethod.call(this,"connect"),this}available(){return Promise.all(runResourceMethod.call(this,"available"))}addScript(e,t){return addResource.call(this,"scripts",e,t)}addStylesheet(e,t){return addResource.call(this,"stylesheets",e,t)}addData(e,t){return addResource.call(this,"data",e,t)}}function runResourceMethod(e){const t=[];for(const r of["scripts","stylesheets","data"]){var s=this.getOption("resources."+r);if(isArray(s))for(const o of s){if(!(o instanceof Resource))throw new Error("unsupported resource definition");t.push(o[e]())}}return t}function addResource(e,t,s){t instanceof URL&&(t=t.toString()),s=s||{};let r;switch(e){case"scripts":r=new Script(extend({},s,{[ATTRIBUTE_SRC]:t}));break;case"stylesheets":r=new Stylesheet(extend({},s,{[ATTRIBUTE_HREF]:t}));break;case"data":r=new Data(extend({},s,{[ATTRIBUTE_SRC]:t}));break;default:throw new Error("unsupported type "+e)}return(this.getOption("resources")?.[e]).push(r),this}assignToNamespace("Monster.DOM",ResourceManager);export{Monster,ResourceManager};
\ No newline at end of file
+'use strict';import{extend}from"../data/extend.js";import{assignToNamespace,Monster}from"../namespace.js";import{BaseWithOptions}from"../types/basewithoptions.js";import{getGlobalObject}from"../types/global.js";import{isArray}from"../types/is.js";import{ATTRIBUTE_HREF,ATTRIBUTE_SRC}from"./constants.js";import{Resource}from"./resource.js";import{Data}from"./resource/data.js";import{Stylesheet}from"./resource/link/stylesheet.js";import{Script}from"./resource/script.js";class ResourceManager extends BaseWithOptions{constructor(options){super(options);if(!(this.getOption("document")instanceof Document)){throw new Error("unsupported document type")}}getBaseURL(){this.getOption("document")?.baseURL}get defaults(){return Object.assign({},super.defaults,{document:getGlobalObject("document"),resources:{scripts:[],stylesheets:[],data:[]}})}connect(){runResourceMethod.call(this,"connect");return this}available(){return Promise.all(runResourceMethod.call(this,"available"))}addScript(url,options){return addResource.call(this,"scripts",url,options)}addStylesheet(url,options){return addResource.call(this,"stylesheets",url,options)}addData(url,options){return addResource.call(this,"data",url,options)}}function runResourceMethod(method){const self=this;const result=[];for(const type of["scripts","stylesheets","data"]){const resources=self.getOption("resources."+type);if(!isArray(resources)){continue}for(const resource of resources){if(!(resource instanceof Resource)){throw new Error("unsupported resource definition")}result.push(resource[method]())}}return result}function addResource(type,url,options){const self=this;if(url instanceof URL){url=url.toString()}options=options||{};let resource;switch(type){case"scripts":resource=new Script(extend({},options,{[ATTRIBUTE_SRC]:url}));break;case"stylesheets":resource=new Stylesheet(extend({},options,{[ATTRIBUTE_HREF]:url}));break;case"data":resource=new Data(extend({},options,{[ATTRIBUTE_SRC]:url}));break;default:throw new Error("unsupported type "+type);}(self.getOption("resources")?.[type]).push(resource);return self}assignToNamespace("Monster.DOM",ResourceManager);export{Monster,ResourceManager};
diff --git a/packages/monster/dist/modules/dom/template.js b/packages/monster/dist/modules/dom/template.js
index 113baa02b95600eecb1eee3fe87476c39e431ee0..39568c44a59f1ef969aac4e378d7cb7a2f65613a 100644
--- a/packages/monster/dist/modules/dom/template.js
+++ b/packages/monster/dist/modules/dom/template.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{getGlobalFunction,getGlobalObject}from"../types/global.js";import{validateInstance,validateString}from"../types/validate.js";import{ATTRIBUTE_TEMPLATE_PREFIX}from"./constants.js";import{getDocumentTheme}from"./theme.js";class Template extends Base{constructor(e){super();var t=getGlobalFunction("HTMLTemplateElement");validateInstance(e,t),this.template=e}getTemplateElement(){return this.template}createDocumentFragment(){return this.template.content.cloneNode(!0)}}function findDocumentTemplate(e,t){validateString(e);const n=getGlobalObject("document");var a=getGlobalFunction("HTMLTemplateElement"),o=getGlobalFunction("DocumentFragment"),m=getGlobalFunction("Document");let l;t instanceof m||t instanceof o||(t instanceof Node&&(t.hasAttribute(ATTRIBUTE_TEMPLATE_PREFIX)&&(l=t.getAttribute(ATTRIBUTE_TEMPLATE_PREFIX)),(t=t.getRootNode())instanceof m||t instanceof o||(t=t.ownerDocument)),t instanceof m||t instanceof o||(t=n));let s,i=getDocumentTheme();if(l){m=l+"-"+e+"-"+i.getName();if(s=t.getElementById(m),s instanceof a)return new Template(s);if(s=n.getElementById(m),s instanceof a)return new Template(s)}o=e+"-"+i.getName();if(s=t.getElementById(o),s instanceof a)return new Template(s);if(s=n.getElementById(o),s instanceof a)return new Template(s);if(s=t.getElementById(e),s instanceof a)return new Template(s);if(s=n.getElementById(e),s instanceof a)return new Template(s);throw new Error("template "+e+" not found.")}assignToNamespace("Monster.DOM",Template,findDocumentTemplate);export{Monster,Template,findDocumentTemplate};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{getGlobalFunction,getGlobalObject}from"../types/global.js";import{validateInstance,validateString}from"../types/validate.js";import{ATTRIBUTE_TEMPLATE_PREFIX}from"./constants.js";import{getDocumentTheme}from"./theme.js";class Template extends Base{constructor(template){super();const HTMLTemplateElement=getGlobalFunction("HTMLTemplateElement");validateInstance(template,HTMLTemplateElement);this.template=template}getTemplateElement(){return this.template}createDocumentFragment(){return this.template.content.cloneNode(true)}}function findDocumentTemplate(id,currentNode){validateString(id);const document=getGlobalObject("document");const HTMLTemplateElement=getGlobalFunction("HTMLTemplateElement");const DocumentFragment=getGlobalFunction("DocumentFragment");const Document=getGlobalFunction("Document");let prefixID;if(!(currentNode instanceof Document||currentNode instanceof DocumentFragment)){if(currentNode instanceof Node){if(currentNode.hasAttribute(ATTRIBUTE_TEMPLATE_PREFIX)){prefixID=currentNode.getAttribute(ATTRIBUTE_TEMPLATE_PREFIX)}currentNode=currentNode.getRootNode();if(!(currentNode instanceof Document||currentNode instanceof DocumentFragment)){currentNode=currentNode.ownerDocument}}if(!(currentNode instanceof Document||currentNode instanceof DocumentFragment)){currentNode=document}}let template;let theme=getDocumentTheme();if(prefixID){let themedPrefixID=prefixID+"-"+id+"-"+theme.getName();template=currentNode.getElementById(themedPrefixID);if(template instanceof HTMLTemplateElement){return new Template(template)}template=document.getElementById(themedPrefixID);if(template instanceof HTMLTemplateElement){return new Template(template)}}let themedID=id+"-"+theme.getName();template=currentNode.getElementById(themedID);if(template instanceof HTMLTemplateElement){return new Template(template)}template=document.getElementById(themedID);if(template instanceof HTMLTemplateElement){return new Template(template)}template=currentNode.getElementById(id);if(template instanceof HTMLTemplateElement){return new Template(template)}template=document.getElementById(id);if(template instanceof HTMLTemplateElement){return new Template(template)}throw new Error("template "+id+" not found.")}assignToNamespace("Monster.DOM",Template,findDocumentTemplate);export{Monster,Template,findDocumentTemplate};
diff --git a/packages/monster/dist/modules/dom/theme.js b/packages/monster/dist/modules/dom/theme.js
index fef16e7ec03ab7fd960d24113f5ec71f397ed67e..e777ca721a64edd4f5278520f9dd61301c472179 100644
--- a/packages/monster/dist/modules/dom/theme.js
+++ b/packages/monster/dist/modules/dom/theme.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{getGlobalObject}from"../types/global.js";import{validateString}from"../types/validate.js";import{ATTRIBUTE_THEME_NAME,DEFAULT_THEME}from"./constants.js";class Theme extends Base{constructor(e){super(),validateString(e),this.name=e}getName(){return this.name}}function getDocumentTheme(){let e=getGlobalObject("document"),t=DEFAULT_THEME,s=e.querySelector("html");var m;return s instanceof HTMLElement&&((m=s.getAttribute(ATTRIBUTE_THEME_NAME))&&(t=m)),new Theme(t)}assignToNamespace("Monster.DOM",Theme,getDocumentTheme);export{Monster,Theme,getDocumentTheme};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{getGlobalObject}from"../types/global.js";import{validateString}from"../types/validate.js";import{ATTRIBUTE_THEME_NAME,DEFAULT_THEME}from"./constants.js";class Theme extends Base{constructor(name){super();validateString(name);this.name=name}getName(){return this.name}}function getDocumentTheme(){let document=getGlobalObject("document");let name=DEFAULT_THEME;let element=document.querySelector("html");if(element instanceof HTMLElement){let theme=element.getAttribute(ATTRIBUTE_THEME_NAME);if(theme){name=theme}}return new Theme(name)}assignToNamespace("Monster.DOM",Theme,getDocumentTheme);export{Monster,Theme,getDocumentTheme};
diff --git a/packages/monster/dist/modules/dom/updater.js b/packages/monster/dist/modules/dom/updater.js
index 40f66aea8ea62c28d7261d93c4468baa57636ab8..7a26c8cdd73d540ebf141c4aaec11d17eca833ea 100644
--- a/packages/monster/dist/modules/dom/updater.js
+++ b/packages/monster/dist/modules/dom/updater.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../constants.js";import{diff}from"../data/diff.js";import{Pathfinder}from"../data/pathfinder.js";import{Pipe}from"../data/pipe.js";import{ATTRIBUTE_ERRORMESSAGE,ATTRIBUTE_UPDATER_ATTRIBUTES,ATTRIBUTE_UPDATER_BIND,ATTRIBUTE_UPDATER_INSERT,ATTRIBUTE_UPDATER_INSERT_REFERENCE,ATTRIBUTE_UPDATER_REMOVE,ATTRIBUTE_UPDATER_REPLACE,ATTRIBUTE_UPDATER_SELECT_THIS}from"../dom/constants.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{isArray,isInstance,isIterable}from"../types/is.js";import{Observer}from"../types/observer.js";import{ProxyObserver}from"../types/proxyobserver.js";import{validateArray,validateInstance}from"../types/validate.js";import{clone}from"../util/clone.js";import{trimSpaces}from"../util/trimspaces.js";import{findTargetElementFromEvent}from"./events.js";import{findDocumentTemplate}from"./template.js";import{getDocument}from"./util.js";class Updater extends Base{constructor(e,t){super(),isInstance(t=void 0===t?{}:t,ProxyObserver)||(t=new ProxyObserver(t)),this[internalSymbol]={element:validateInstance(e,HTMLElement),last:{},callbacks:new Map,eventTypes:["keyup","click","change","drop","touchend","input"],subject:t},this[internalSymbol].callbacks.set("checkstate",getCheckStateCallback.call(this)),this[internalSymbol].subject.attachObserver(new Observer(()=>{var e,t=this[internalSymbol].subject.getRealSubject(),r=diff(this[internalSymbol].last,t);this[internalSymbol].last=clone(t);for([,e]of Object.entries(r))removeElement.call(this,e),insertElement.call(this,e),updateContent.call(this,e),updateAttributes.call(this,e)}))}setEventTypes(e){return this[internalSymbol].eventTypes=validateArray(e),this}enableEventProcessing(){this.disableEventProcessing();for(const e of this[internalSymbol].eventTypes)this[internalSymbol].element.addEventListener(e,getControlEventHandler.call(this),{capture:!0,passive:!0});return this}disableEventProcessing(){for(const e of this[internalSymbol].eventTypes)this[internalSymbol].element.removeEventListener(e,getControlEventHandler.call(this));return this}run(){return this[internalSymbol].last={__init__:!0},this[internalSymbol].subject.notifyObservers()}retrieve(){return retrieveFromBindings.call(this),this}getSubject(){return this[internalSymbol].subject.getSubject()}setCallback(e,t){return this[internalSymbol].callbacks.set(e,t),this}}function getCheckStateCallback(){return function(e){if(this instanceof HTMLInputElement){if(-1!==["radio","checkbox"].indexOf(this.type))return this.value+""==e+""?"true":void 0}else if(this instanceof HTMLOptionElement&&isArray(e)&&-1!==e.indexOf(this.value))return"true"}}const symbol=Symbol("EventHandler");function getControlEventHandler(){const t=this;return t[symbol]||(t[symbol]=e=>{e=findTargetElementFromEvent(e,ATTRIBUTE_UPDATER_BIND);void 0!==e&&retrieveAndSetValue.call(t,e)},t[symbol])}function retrieveAndSetValue(t){var e=this;const r=new Pathfinder(e[internalSymbol].subject.getSubject());let n=t.getAttribute(ATTRIBUTE_UPDATER_BIND);if(0!==n.indexOf("path:"))throw new Error("the bind argument must start as a value with a path");n=n.substr(5);let i;if(t instanceof HTMLInputElement)i="checkbox"!==t.type||t.checked?t.value:void 0;else if(t instanceof HTMLTextAreaElement)i=t.value;else if(t instanceof HTMLSelectElement)switch(t.type){case"select-one":i=t.value;break;case"select-multiple":i=t.value;let e=t?.selectedOptions;void 0===e&&(e=t.querySelectorAll(":scope option:checked")),i=Array.from(e).map(({value:e})=>e)}else{if(!(t?.constructor?.prototype&&Object.getOwnPropertyDescriptor(t.constructor.prototype,"value")?.get||t.hasOwnProperty("value")))throw new Error("unsupported object");i=t?.value}var a=clone(e[internalSymbol].subject.getRealSubject());const l=new Pathfinder(a);l.setVia(n,i),0<diff(a,e[internalSymbol].subject.getRealSubject()).length&&r.setVia(n,i)}function retrieveFromBindings(){var e=this;e[internalSymbol].element.matches("["+ATTRIBUTE_UPDATER_BIND+"]")&&retrieveAndSetValue.call(e,element);for(const[,element]of e[internalSymbol].element.querySelectorAll("["+ATTRIBUTE_UPDATER_BIND+"]").entries())retrieveAndSetValue.call(e,element)}function removeElement(e){var t;for([,t]of this[internalSymbol].element.querySelectorAll(":scope ["+ATTRIBUTE_UPDATER_REMOVE+"]").entries())t.parentNode.removeChild(t)}function insertElement(i){var s=this,A=s[internalSymbol].subject.getRealSubject();getDocument();let o=new WeakSet,e=0;const r=s[internalSymbol].element;for(;;){let l=!1,t=(e++,clone(i?.path));if(!isArray(t))return s;for(;0<t.length;){var n=t.join(".");let e=new Set;var c,n="["+ATTRIBUTE_UPDATER_INSERT+'*="path:'+n+'"]',a=r.querySelectorAll(n);0<a.length&&(e=new Set([...a])),r.matches(n)&&e.add(r);for([,c]of e.entries())if(!o.has(c)){o.add(c),l=!0;var T=c.getAttribute(ATTRIBUTE_UPDATER_INSERT);let e=trimSpaces(T);var T=e.indexOf(" "),R=trimSpaces(e.substr(0,T)),b=R+"-";let t=trimSpaces(e.substr(T));if(0<t.indexOf("|"))throw new Error("pipes are not allowed when cloning a node.");let r=new Pipe(t);s[internalSymbol].callbacks.forEach((e,t)=>{r.setCallback(t,e)});let n;try{c.removeAttribute(ATTRIBUTE_ERRORMESSAGE),n=r.run(A)}catch(e){c.setAttribute(ATTRIBUTE_ERRORMESSAGE,e.message)}var E,p,f=t.split(":").pop();let i;if(c.hasChildNodes()&&(i=c.lastChild),!isIterable(n))throw new Error("the value is not iterable");let a=new Set;for([E,p]of Object.entries(n)){var u=b+E,h=f+"."+E,d=(a.add(u),c.querySelector("["+ATTRIBUTE_UPDATER_INSERT_REFERENCE+'="'+u+'"]'));d instanceof HTMLElement?i=d:appendNewDocumentFragment(c,R,u,h)}var m,T=c.querySelectorAll("["+ATTRIBUTE_UPDATER_INSERT_REFERENCE+'*="'+b+'"]');for([,m]of Object.entries(T))if(!a.has(m.getAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE)))try{c.removeChild(m)}catch(e){c.setAttribute(ATTRIBUTE_ERRORMESSAGE,(c.getAttribute(ATTRIBUTE_ERRORMESSAGE)+", "+e.message).trim())}}t.pop()}if(!1===l)break;if(200<e++)throw new Error("the maximum depth for the recursion is reached.")}}function appendNewDocumentFragment(e,t,r,n){let i=findDocumentTemplate(t,e);var a,l=i.createDocumentFragment();for([,a]of Object.entries(l.childNodes))a instanceof HTMLElement&&(applyRecursive(a,t,n),a.setAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE,r)),e.appendChild(a)}function applyRecursive(t,r,n){if(t instanceof HTMLElement){if(t.hasAttribute(ATTRIBUTE_UPDATER_REPLACE)){let e=t.getAttribute(ATTRIBUTE_UPDATER_REPLACE);t.setAttribute(ATTRIBUTE_UPDATER_REPLACE,e.replaceAll("path:"+r,"path:"+n))}if(t.hasAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES)){let e=t.getAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES);t.setAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES,e.replaceAll("path:"+r,"path:"+n))}for(var[,e]of Object.entries(t.childNodes))applyRecursive(e,r,n)}}function updateContent(e){var t=this[internalSymbol].subject.getRealSubject(),r=clone(e?.path),e=(runUpdateContent.call(this,this[internalSymbol].element,r,t),this[internalSymbol].element.querySelectorAll("slot"));if(0<e.length)for(var[,n]of Object.entries(e))for(var[,i]of Object.entries(n.assignedNodes()))runUpdateContent.call(this,i,r,t)}function runUpdateContent(e,r,n){if(isArray(r)&&e instanceof HTMLElement){r=clone(r);let t=new WeakSet;for(;0<r.length;){var i,a=r.join("."),a=(r.pop(),"["+ATTRIBUTE_UPDATER_REPLACE+'^="path:'+a+'"], ['+ATTRIBUTE_UPDATER_REPLACE+'^="static:"]'),l=e.querySelectorAll(a);const o=new Set([...l]);e.matches(a)&&o.add(e);for([i]of o.entries()){if(t.has(i))return;t.add(i);var s=i.getAttribute(ATTRIBUTE_UPDATER_REPLACE),s=trimSpaces(s);let r=new Pipe(s);this[internalSymbol].callbacks.forEach((e,t)=>{r.setCallback(t,e)});let e;try{i.removeAttribute(ATTRIBUTE_ERRORMESSAGE),e=r.run(n)}catch(e){i.setAttribute(ATTRIBUTE_ERRORMESSAGE,e.message)}if(e instanceof HTMLElement){for(;i.firstChild;)i.removeChild(i.firstChild);try{i.appendChild(e)}catch(e){i.setAttribute(ATTRIBUTE_ERRORMESSAGE,(i.getAttribute(ATTRIBUTE_ERRORMESSAGE)+", "+e.message).trim())}}else i.innerHTML=e}}}}function updateAttributes(e){var t=this[internalSymbol].subject.getRealSubject(),e=clone(e?.path);runUpdateAttributes.call(this,this[internalSymbol].element,e,t)}function runUpdateAttributes(r,n,i){if(isArray(n)){n=clone(n);let t=new WeakSet;for(;0<n.length;){var a=n.join(".");n.pop();let e=new Set;var a="["+ATTRIBUTE_UPDATER_SELECT_THIS+"], ["+ATTRIBUTE_UPDATER_ATTRIBUTES+'*="path:'+a+'"], ['+ATTRIBUTE_UPDATER_ATTRIBUTES+'^="static:"]',l=r.querySelectorAll(a);0<l.length&&(e=new Set([...l])),r.matches(a)&&e.add(r);for(const[T]of e.entries()){if(t.has(T))return;t.add(T);const E=T.getAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES);for(var[,s]of Object.entries(E.split(","))){s=trimSpaces(s);var o=s.indexOf(" "),c=trimSpaces(s.substr(0,o)),s=trimSpaces(s.substr(o));let r=new Pipe(s);this[internalSymbol].callbacks.forEach((e,t)=>{r.setCallback(t,e,T)});let e;try{T.removeAttribute(ATTRIBUTE_ERRORMESSAGE),e=r.run(i)}catch(e){T.setAttribute(ATTRIBUTE_ERRORMESSAGE,e.message)}void 0===e?T.removeAttribute(c):T.getAttribute(c)!==e&&T.setAttribute(c,e),handleInputControlAttributeUpdate.call(this,T,c,e)}}}}}function handleInputControlAttributeUpdate(e,t,r){if(e instanceof HTMLSelectElement)switch(e.type){case"select-multiple":for(var[n,i]of Object.entries(e.options))-1!==r.indexOf(i.value)?i.selected=!0:i.selected=!1;break;case"select-one":for(var[a,l]of Object.entries(e.options))if(l.value===r){e.selectedIndex=a;break}}else if(e instanceof HTMLInputElement)switch(e.type){case"radio":case"checkbox":"checked"===t&&(e.checked=void 0!==r);break;default:"value"===t&&(e.value=void 0===r?"":r)}else e instanceof HTMLTextAreaElement&&"value"===t&&(e.value=void 0===r?"":r)}assignToNamespace("Monster.DOM",Updater);export{Monster,Updater};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../constants.js";import{diff}from"../data/diff.js";import{Pathfinder}from"../data/pathfinder.js";import{Pipe}from"../data/pipe.js";import{ATTRIBUTE_ERRORMESSAGE,ATTRIBUTE_UPDATER_ATTRIBUTES,ATTRIBUTE_UPDATER_BIND,ATTRIBUTE_UPDATER_INSERT,ATTRIBUTE_UPDATER_INSERT_REFERENCE,ATTRIBUTE_UPDATER_REMOVE,ATTRIBUTE_UPDATER_REPLACE,ATTRIBUTE_UPDATER_SELECT_THIS}from"../dom/constants.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{isArray,isInstance,isIterable}from"../types/is.js";import{Observer}from"../types/observer.js";import{ProxyObserver}from"../types/proxyobserver.js";import{validateArray,validateInstance}from"../types/validate.js";import{clone}from"../util/clone.js";import{trimSpaces}from"../util/trimspaces.js";import{findTargetElementFromEvent}from"./events.js";import{findDocumentTemplate}from"./template.js";import{getDocument}from"./util.js";class Updater extends Base{constructor(element,subject){super();if(subject===undefined)subject={};if(!isInstance(subject,ProxyObserver)){subject=new ProxyObserver(subject)}this[internalSymbol]={element:validateInstance(element,HTMLElement),last:{},callbacks:new Map,eventTypes:["keyup","click","change","drop","touchend","input"],subject:subject};this[internalSymbol].callbacks.set("checkstate",getCheckStateCallback.call(this));this[internalSymbol].subject.attachObserver(new Observer(()=>{const s=this[internalSymbol].subject.getRealSubject();const diffResult=diff(this[internalSymbol].last,s);this[internalSymbol].last=clone(s);for(const[,change]of Object.entries(diffResult)){removeElement.call(this,change);insertElement.call(this,change);updateContent.call(this,change);updateAttributes.call(this,change)}}))}setEventTypes(types){this[internalSymbol].eventTypes=validateArray(types);return this}enableEventProcessing(){this.disableEventProcessing();for(const type of this[internalSymbol].eventTypes){this[internalSymbol].element.addEventListener(type,getControlEventHandler.call(this),{capture:true,passive:true})}return this}disableEventProcessing(){for(const type of this[internalSymbol].eventTypes){this[internalSymbol].element.removeEventListener(type,getControlEventHandler.call(this))}return this}run(){this[internalSymbol].last={"__init__":true};return this[internalSymbol].subject.notifyObservers()}retrieve(){retrieveFromBindings.call(this);return this}getSubject(){return this[internalSymbol].subject.getSubject()}setCallback(name,callback){this[internalSymbol].callbacks.set(name,callback);return this}}function getCheckStateCallback(){const self=this;return function(current){if(this instanceof HTMLInputElement){if(["radio","checkbox"].indexOf(this.type)!==-1){return this.value+""===current+""?"true":undefined}}else if(this instanceof HTMLOptionElement){if(isArray(current)&&current.indexOf(this.value)!==-1){return"true"}return undefined}}}const symbol=Symbol("EventHandler");function getControlEventHandler(){const self=this;if(self[symbol]){return self[symbol]}self[symbol]=event=>{const element=findTargetElementFromEvent(event,ATTRIBUTE_UPDATER_BIND);if(element===undefined){return}retrieveAndSetValue.call(self,element)};return self[symbol]}function retrieveAndSetValue(element){const self=this;const pathfinder=new Pathfinder(self[internalSymbol].subject.getSubject());let path=element.getAttribute(ATTRIBUTE_UPDATER_BIND);if(path.indexOf("path:")!==0){throw new Error("the bind argument must start as a value with a path")}path=path.substr(5);let value;if(element instanceof HTMLInputElement){switch(element.type){case"checkbox":value=element.checked?element.value:undefined;break;default:value=element.value;break;}}else if(element instanceof HTMLTextAreaElement){value=element.value}else if(element instanceof HTMLSelectElement){switch(element.type){case"select-one":value=element.value;break;case"select-multiple":value=element.value;let options=element?.selectedOptions;if(options===undefined)options=element.querySelectorAll(":scope option:checked");value=Array.from(options).map(({value})=>value);break;}}else if(element?.constructor?.prototype&&!!Object.getOwnPropertyDescriptor(element.constructor.prototype,"value")?.["get"]||element.hasOwnProperty("value")){value=element?.["value"]}else{throw new Error("unsupported object")}const copy=clone(self[internalSymbol].subject.getRealSubject());const pf=new Pathfinder(copy);pf.setVia(path,value);const diffResult=diff(copy,self[internalSymbol].subject.getRealSubject());if(diffResult.length>0){pathfinder.setVia(path,value)}}function retrieveFromBindings(){const self=this;if(self[internalSymbol].element.matches("["+ATTRIBUTE_UPDATER_BIND+"]")){retrieveAndSetValue.call(self,element)}for(const[,element]of self[internalSymbol].element.querySelectorAll("["+ATTRIBUTE_UPDATER_BIND+"]").entries()){retrieveAndSetValue.call(self,element)}}function removeElement(change){const self=this;for(const[,element]of self[internalSymbol].element.querySelectorAll(":scope ["+ATTRIBUTE_UPDATER_REMOVE+"]").entries()){element.parentNode.removeChild(element)}}function insertElement(change){const self=this;const subject=self[internalSymbol].subject.getRealSubject();const document=getDocument();let mem=new WeakSet;let wd=0;const container=self[internalSymbol].element;while(true){let found=false;wd++;let p=clone(change?.["path"]);if(!isArray(p))return self;while(p.length>0){const current=p.join(".");let iterator=new Set;const query="["+ATTRIBUTE_UPDATER_INSERT+"*=\"path:"+current+"\"]";const e=container.querySelectorAll(query);if(e.length>0){iterator=new Set([...e])}if(container.matches(query)){iterator.add(container)}for(const[,containerElement]of iterator.entries()){if(mem.has(containerElement))continue;mem.add(containerElement);found=true;const attributes=containerElement.getAttribute(ATTRIBUTE_UPDATER_INSERT);let def=trimSpaces(attributes);let i=def.indexOf(" ");let key=trimSpaces(def.substr(0,i));let refPrefix=key+"-";let cmd=trimSpaces(def.substr(i));if(cmd.indexOf("|")>0){throw new Error("pipes are not allowed when cloning a node.")}let pipe=new Pipe(cmd);self[internalSymbol].callbacks.forEach((f,n)=>{pipe.setCallback(n,f)});let value;try{containerElement.removeAttribute(ATTRIBUTE_ERRORMESSAGE);value=pipe.run(subject)}catch(e){containerElement.setAttribute(ATTRIBUTE_ERRORMESSAGE,e.message)}let dataPath=cmd.split(":").pop();let insertPoint;if(containerElement.hasChildNodes()){insertPoint=containerElement.lastChild}if(!isIterable(value)){throw new Error("the value is not iterable")}let available=new Set;for(const[_i,obj]of Object.entries(value)){let ref=refPrefix+_i;let currentPath=dataPath+"."+_i;available.add(ref);let refElement=containerElement.querySelector("["+ATTRIBUTE_UPDATER_INSERT_REFERENCE+"=\""+ref+"\"]");if(refElement instanceof HTMLElement){insertPoint=refElement;continue}appendNewDocumentFragment(containerElement,key,ref,currentPath)}let nodes=containerElement.querySelectorAll("["+ATTRIBUTE_UPDATER_INSERT_REFERENCE+"*=\""+refPrefix+"\"]");for(const[,node]of Object.entries(nodes)){if(!available.has(node.getAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE))){try{containerElement.removeChild(node)}catch(e){containerElement.setAttribute(ATTRIBUTE_ERRORMESSAGE,(containerElement.getAttribute(ATTRIBUTE_ERRORMESSAGE)+", "+e.message).trim())}}}}p.pop()}if(found===false)break;if(wd++>200){throw new Error("the maximum depth for the recursion is reached.")}}}function appendNewDocumentFragment(container,key,ref,path){let template=findDocumentTemplate(key,container);let nodes=template.createDocumentFragment();for(const[,node]of Object.entries(nodes.childNodes)){if(node instanceof HTMLElement){applyRecursive(node,key,path);node.setAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE,ref)}container.appendChild(node)}}function applyRecursive(node,key,path){if(node instanceof HTMLElement){if(node.hasAttribute(ATTRIBUTE_UPDATER_REPLACE)){let value=node.getAttribute(ATTRIBUTE_UPDATER_REPLACE);node.setAttribute(ATTRIBUTE_UPDATER_REPLACE,value.replaceAll("path:"+key,"path:"+path))}if(node.hasAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES)){let value=node.getAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES);node.setAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES,value.replaceAll("path:"+key,"path:"+path))}for(const[,child]of Object.entries(node.childNodes)){applyRecursive(child,key,path)}}}function updateContent(change){const self=this;const subject=self[internalSymbol].subject.getRealSubject();let p=clone(change?.["path"]);runUpdateContent.call(this,this[internalSymbol].element,p,subject);const slots=this[internalSymbol].element.querySelectorAll("slot");if(slots.length>0){for(const[,slot]of Object.entries(slots)){for(const[,element]of Object.entries(slot.assignedNodes())){runUpdateContent.call(this,element,p,subject)}}}}function runUpdateContent(container,parts,subject){if(!isArray(parts))return;if(!(container instanceof HTMLElement))return;parts=clone(parts);let mem=new WeakSet;while(parts.length>0){const current=parts.join(".");parts.pop();const query="["+ATTRIBUTE_UPDATER_REPLACE+"^=\"path:"+current+"\"], ["+ATTRIBUTE_UPDATER_REPLACE+"^=\"static:\"]";const e=container.querySelectorAll(""+query);const iterator=new Set([...e]);if(container.matches(query)){iterator.add(container)}for(const[element]of iterator.entries()){if(mem.has(element))return;mem.add(element);const attributes=element.getAttribute(ATTRIBUTE_UPDATER_REPLACE);let cmd=trimSpaces(attributes);let pipe=new Pipe(cmd);this[internalSymbol].callbacks.forEach((f,n)=>{pipe.setCallback(n,f)});let value;try{element.removeAttribute(ATTRIBUTE_ERRORMESSAGE);value=pipe.run(subject)}catch(e){element.setAttribute(ATTRIBUTE_ERRORMESSAGE,e.message)}if(value instanceof HTMLElement){while(element.firstChild){element.removeChild(element.firstChild)}try{element.appendChild(value)}catch(e){element.setAttribute(ATTRIBUTE_ERRORMESSAGE,(element.getAttribute(ATTRIBUTE_ERRORMESSAGE)+", "+e.message).trim())}}else{element.innerHTML=value}}}}function updateAttributes(change){const subject=this[internalSymbol].subject.getRealSubject();let p=clone(change?.["path"]);runUpdateAttributes.call(this,this[internalSymbol].element,p,subject)}function runUpdateAttributes(container,parts,subject){const self=this;if(!isArray(parts))return;parts=clone(parts);let mem=new WeakSet;while(parts.length>0){const current=parts.join(".");parts.pop();let iterator=new Set;const query="["+ATTRIBUTE_UPDATER_SELECT_THIS+"], ["+ATTRIBUTE_UPDATER_ATTRIBUTES+"*=\"path:"+current+"\"], ["+ATTRIBUTE_UPDATER_ATTRIBUTES+"^=\"static:\"]";const e=container.querySelectorAll(query);if(e.length>0){iterator=new Set([...e])}if(container.matches(query)){iterator.add(container)}for(const[element]of iterator.entries()){if(mem.has(element))return;mem.add(element);const attributes=element.getAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES);for(let[,def]of Object.entries(attributes.split(","))){def=trimSpaces(def);let i=def.indexOf(" ");let name=trimSpaces(def.substr(0,i));let cmd=trimSpaces(def.substr(i));let pipe=new Pipe(cmd);self[internalSymbol].callbacks.forEach((f,n)=>{pipe.setCallback(n,f,element)});let value;try{element.removeAttribute(ATTRIBUTE_ERRORMESSAGE);value=pipe.run(subject)}catch(e){element.setAttribute(ATTRIBUTE_ERRORMESSAGE,e.message)}if(value===undefined){element.removeAttribute(name)}else if(element.getAttribute(name)!==value){element.setAttribute(name,value)}handleInputControlAttributeUpdate.call(this,element,name,value)}}}}function handleInputControlAttributeUpdate(element,name,value){const self=this;if(element instanceof HTMLSelectElement){switch(element.type){case"select-multiple":for(const[index,opt]of Object.entries(element.options)){if(value.indexOf(opt.value)!==-1){opt.selected=true}else{opt.selected=false}}break;case"select-one":for(const[index,opt]of Object.entries(element.options)){if(opt.value===value){element.selectedIndex=index;break}}break;}}else if(element instanceof HTMLInputElement){switch(element.type){case"radio":if(name==="checked"){if(value!==undefined){element.checked=true}else{element.checked=false}}break;case"checkbox":if(name==="checked"){if(value!==undefined){element.checked=true}else{element.checked=false}}break;case"text":default:if(name==="value"){element.value=value===undefined?"":value}break;}}else if(element instanceof HTMLTextAreaElement){if(name==="value"){element.value=value===undefined?"":value}}}assignToNamespace("Monster.DOM",Updater);export{Monster,Updater};
diff --git a/packages/monster/dist/modules/dom/util.js b/packages/monster/dist/modules/dom/util.js
index ea7308974b65991d8d897e3722405993c0b56858..6c2068a453beaa62199b0e542eddf83452357fb9 100644
--- a/packages/monster/dist/modules/dom/util.js
+++ b/packages/monster/dist/modules/dom/util.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{getGlobal}from"../types/global.js";import{validateString}from"../types/validate.js";function getDocument(){var t=getGlobal()?.document;if("object"!=typeof t)throw new Error("not supported environment");return t}function getWindow(){var t=getGlobal()?.window;if("object"!=typeof t)throw new Error("not supported environment");return t}function getDocumentFragmentFromString(t){validateString(t);const e=getDocument(),n=e.createElement("template");return n.innerHTML=t,n.content}assignToNamespace("Monster.DOM",getWindow,getDocument,getDocumentFragmentFromString);export{Monster,getWindow,getDocument,getDocumentFragmentFromString};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{getGlobal}from"../types/global.js";import{validateString}from"../types/validate.js";function getDocument(){let document=getGlobal()?.["document"];if(typeof document!=="object"){throw new Error("not supported environment")}return document}function getWindow(){let window=getGlobal()?.["window"];if(typeof window!=="object"){throw new Error("not supported environment")}return window}function getDocumentFragmentFromString(html){validateString(html);const document=getDocument();const template=document.createElement("template");template.innerHTML=html;return template.content}assignToNamespace("Monster.DOM",getWindow,getDocument,getDocumentFragmentFromString);export{Monster,getWindow,getDocument,getDocumentFragmentFromString};
diff --git a/packages/monster/dist/modules/dom/worker/factory.js b/packages/monster/dist/modules/dom/worker/factory.js
index 44ef9ba9ca6344013c1e352253c2ec119ae7e028..d67211b4bff71061d0f576fb193e4fc1da3630f3 100644
--- a/packages/monster/dist/modules/dom/worker/factory.js
+++ b/packages/monster/dist/modules/dom/worker/factory.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../../constants.js";import{assignToNamespace,Monster}from"../../namespace.js";import{Base}from"../../types/base.js";import{getGlobal,getGlobalFunction}from"../../types/global.js";import{isFunction}from"../../types/is.js";import{validateInstance,validateString}from"../../types/validate.js";class Factory extends Base{constructor(){super(),this[internalSymbol]={worker:new WeakMap}}createFromURL=function(t,e,r){t instanceof URL&&(t=t.toString());const o=getGlobalFunction("Worker");var n=new o(validateString(t));return isFunction(e)&&(n.onmessage=t=>{e.call(n,t)}),isFunction(r)&&(n.onerror=t=>{r.call(n,t)}),n};createFromScript=function(t,e,r){const o=new getGlobalFunction("Blob");t=new o([validateString(t)],{type:"script/javascript"}),t=getGlobalFunction("URL").createObjectURL(t),e=this.createFromURL(t,e,r);return this[internalSymbol].worker.set(e,t),e};terminate(t){var e=getGlobalFunction("Worker");return validateInstance(t,e),t.terminate(),this[internalSymbol].worker.has(t)&&(e=this[internalSymbol].worker.get(t),URL.revokeObjectURL(e)),this}}assignToNamespace("Monster.DOM.Worker",Factory);export{Monster,Factory};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../../constants.js";import{assignToNamespace,Monster}from"../../namespace.js";import{Base}from"../../types/base.js";import{getGlobal,getGlobalFunction}from"../../types/global.js";import{isFunction}from"../../types/is.js";import{validateInstance,validateString}from"../../types/validate.js";class Factory extends Base{constructor(){super();this[internalSymbol]={worker:new WeakMap}}createFromURL=function(url,messageHandler,errorHandler){if(url instanceof URL){url=url.toString()}const workerClass=getGlobalFunction("Worker");var worker=new workerClass(validateString(url));if(isFunction(messageHandler)){worker.onmessage=event=>{messageHandler.call(worker,event)}}if(isFunction(errorHandler)){worker.onerror=event=>{errorHandler.call(worker,event)}}return worker};createFromScript=function(content,messageHandler,errorHandler){const blobFunction=new getGlobalFunction("Blob");const blob=new blobFunction([validateString(content)],{type:"script/javascript"});const url=getGlobalFunction("URL").createObjectURL(blob);const worker=this.createFromURL(url,messageHandler,errorHandler);this[internalSymbol]["worker"].set(worker,url);return worker};terminate(worker){const workerClass=getGlobalFunction("Worker");validateInstance(worker,workerClass);worker.terminate();if(this[internalSymbol]["worker"].has(worker)){const url=this[internalSymbol]["worker"].get(worker);URL.revokeObjectURL(url)}return this}}assignToNamespace("Monster.DOM.Worker",Factory);export{Monster,Factory};
diff --git a/packages/monster/dist/modules/i18n/formatter.js b/packages/monster/dist/modules/i18n/formatter.js
index 20220d53bd6cb0bb26b25aced9a29d71f28127ae..0f839ec47e960c5723c8ee8180565d772dadbb76 100644
--- a/packages/monster/dist/modules/i18n/formatter.js
+++ b/packages/monster/dist/modules/i18n/formatter.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{assignToNamespace,Monster}from"../namespace.js";import{Formatter as TextFormatter}from"../text/formatter.js";import{validateInstance,validateString}from"../types/validate.js";import{Translations}from"./translations.js";const internalTranslationSymbol=Symbol("internalTranslation");class Formatter extends TextFormatter{constructor(t,r,e){super(t,e),this[internalTranslationSymbol]=validateInstance(r,Translations)}get defaults(){const r=this;return extend({},super.defaults,{callbacks:{i18n:t=>r[internalTranslationSymbol].getText(validateString(t))},marker:{open:["i18n{","${"],close:["}"]}})}format(t){validateString(t);var r=this[internalSymbol].marker.open?.[0],e=this[internalSymbol].marker.close?.[0];if(0===t.indexOf(r)){if((t=t.substring(r.length)).indexOf(e)!==t.length-e.length)throw new Error("the closing marker is missing");t=t.substring(0,t.length-e.length)}const n=validateString(t).split("::");var t=n.shift().trim(),a=n.join("::").trim();let s=r+"static:"+t+" | call:i18n";return 0<a.length&&(s+="::"+a),s+=e,super.format(s)}}assignToNamespace("Monster.I18n",Formatter);export{Monster,Formatter};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{assignToNamespace,Monster}from"../namespace.js";import{Formatter as TextFormatter}from"../text/formatter.js";import{validateInstance,validateString}from"../types/validate.js";import{Translations}from"./translations.js";const internalTranslationSymbol=Symbol("internalTranslation");class Formatter extends TextFormatter{constructor(object,translation,options){super(object,options);this[internalTranslationSymbol]=validateInstance(translation,Translations)}get defaults(){const self=this;return extend({},super.defaults,{callbacks:{i18n:value=>{return self[internalTranslationSymbol].getText(validateString(value))}},marker:{open:["i18n{","${"],close:["}"]}})}format(text){validateString(text);const openMarker=this[internalSymbol]["marker"]["open"]?.[0];const closeMarker=this[internalSymbol]["marker"]["close"]?.[0];if(text.indexOf(openMarker)===0){text=text.substring(openMarker.length);if(text.indexOf(closeMarker)===text.length-closeMarker.length){text=text.substring(0,text.length-closeMarker.length)}else{throw new Error("the closing marker is missing")}}const parts=validateString(text).split("::");const translationKey=parts.shift().trim();const parameter=parts.join("::").trim();let assembledText=openMarker+"static:"+translationKey+" | call:i18n";if(parameter.length>0){assembledText+="::"+parameter}assembledText+=closeMarker;return super.format(assembledText)}}assignToNamespace("Monster.I18n",Formatter);export{Monster,Formatter};
diff --git a/packages/monster/dist/modules/i18n/locale.js b/packages/monster/dist/modules/i18n/locale.js
index 913eb3808aa8e322e321c82d3dfc2144b2d862e8..40f14875d802cdd681ac78c3f6a6bc51d444388a 100644
--- a/packages/monster/dist/modules/i18n/locale.js
+++ b/packages/monster/dist/modules/i18n/locale.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateString}from"../types/validate.js";import{clone}from"../util/clone.js";const propertiesSymbol=Symbol("properties"),localeStringSymbol=Symbol("localeString");class Locale extends Base{constructor(e,i,t,o,a,r){super(),this[propertiesSymbol]={language:void 0===e?void 0:validateString(e),script:void 0===t?void 0:validateString(t),region:void 0===i?void 0:validateString(i),variants:void 0===o?void 0:validateString(o),extlang:void 0===a?void 0:validateString(a),privateUse:void 0===r?void 0:validateString(r)};let n=[];if(void 0!==e&&n.push(e),void 0!==t&&n.push(t),void 0!==i&&n.push(i),void 0!==o&&n.push(o),void 0!==a&&n.push(a),void 0!==r&&n.push(r),0===n.length)throw new Error("unsupported locale");this[localeStringSymbol]=n.join("-")}get localeString(){return this[localeStringSymbol]}get language(){return this[propertiesSymbol].language}get region(){return this[propertiesSymbol].region}get script(){return this[propertiesSymbol].script}get variants(){return this[propertiesSymbol].variants}get extlang(){return this[propertiesSymbol].extlang}get privateUse(){return this[propertiesSymbol].privateValue}toString(){return""+this.localeString}getMap(){return clone(this[propertiesSymbol])}}function parseLocale(e){e=validateString(e).replace(/_/g,"-");let i,t,o,a,r,n,l=new RegExp("^(((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+))$"),s;if(null!==(s=l.exec(e))&&s.index===l.lastIndex&&l.lastIndex++,null==s)throw new Error("unsupported locale");return void 0!==s[6]&&(i=s[6],1<(a=i.split("-")).length&&(i=a[0],n=a[1])),void 0!==s[14]&&(t=s[14]),void 0!==s[12]&&(r=s[12]),void 0!==s[16]&&(o=s[16]),new Locale(i,t,r,o,n)}assignToNamespace("Monster.I18n",Locale,parseLocale);export{Monster,Locale,parseLocale};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateString}from"../types/validate.js";import{clone}from"../util/clone.js";const propertiesSymbol=Symbol("properties");const localeStringSymbol=Symbol("localeString");class Locale extends Base{constructor(language,region,script,variants,extlang,privateUse){super();this[propertiesSymbol]={language:language===undefined?undefined:validateString(language),script:script===undefined?undefined:validateString(script),region:region===undefined?undefined:validateString(region),variants:variants===undefined?undefined:validateString(variants),extlang:extlang===undefined?undefined:validateString(extlang),privateUse:privateUse===undefined?undefined:validateString(privateUse)};let s=[];if(language!==undefined)s.push(language);if(script!==undefined)s.push(script);if(region!==undefined)s.push(region);if(variants!==undefined)s.push(variants);if(extlang!==undefined)s.push(extlang);if(privateUse!==undefined)s.push(privateUse);if(s.length===0){throw new Error("unsupported locale")}this[localeStringSymbol]=s.join("-")}get localeString(){return this[localeStringSymbol]}get language(){return this[propertiesSymbol].language}get region(){return this[propertiesSymbol].region}get script(){return this[propertiesSymbol].script}get variants(){return this[propertiesSymbol].variants}get extlang(){return this[propertiesSymbol].extlang}get privateUse(){return this[propertiesSymbol].privateValue}toString(){return""+this.localeString}getMap(){return clone(this[propertiesSymbol])}}function parseLocale(locale){locale=validateString(locale).replace(/_/g,"-");let language,region,variants,parts,script,extlang,regexRegular="(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)",regexIrregular="(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)",regexGrandfathered="("+regexIrregular+"|"+regexRegular+")",regexPrivateUse="(x(-[A-Za-z0-9]{1,8})+)",regexSingleton="[0-9A-WY-Za-wy-z]",regexExtension="("+regexSingleton+"(-[A-Za-z0-9]{2,8})+)",regexVariant="([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3})",regexRegion="([A-Za-z]{2}|[0-9]{3})",regexScript="([A-Za-z]{4})",regexExtlang="([A-Za-z]{3}(-[A-Za-z]{3}){0,2})",regexLanguage="(([A-Za-z]{2,3}(-"+regexExtlang+")?)|[A-Za-z]{4}|[A-Za-z]{5,8})",regexLangtag="("+regexLanguage+"(-"+regexScript+")?"+"(-"+regexRegion+")?"+"(-"+regexVariant+")*"+"(-"+regexExtension+")*"+"(-"+regexPrivateUse+")?"+")",regexLanguageTag="^("+regexGrandfathered+"|"+regexLangtag+"|"+regexPrivateUse+")$",regex=new RegExp(regexLanguageTag),match;if((match=regex.exec(locale))!==null){if(match.index===regex.lastIndex){regex.lastIndex++}}if(match===undefined||match===null){throw new Error("unsupported locale")}if(match[6]!==undefined){language=match[6];parts=language.split("-");if(parts.length>1){language=parts[0];extlang=parts[1]}}if(match[14]!==undefined){region=match[14]}if(match[12]!==undefined){script=match[12]}if(match[16]!==undefined){variants=match[16]}return new Locale(language,region,script,variants,extlang)}assignToNamespace("Monster.I18n",Locale,parseLocale);export{Monster,Locale,parseLocale};
diff --git a/packages/monster/dist/modules/i18n/namespace.js b/packages/monster/dist/modules/i18n/namespace.js
index 71308a8317c81aba97e077ada7da4ba6e81420fd..09d35542bcbbb13f70fafe153f8a1060d983e450 100644
--- a/packages/monster/dist/modules/i18n/namespace.js
+++ b/packages/monster/dist/modules/i18n/namespace.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";const namespace="Monster.I18n";export{namespace};
\ No newline at end of file
+'use strict';export const namespace="Monster.I18n";
diff --git a/packages/monster/dist/modules/i18n/provider.js b/packages/monster/dist/modules/i18n/provider.js
index ec075a019fb4b5259677d5d5130f713c6d1926fe..3ba532e9983456245058f13ea0d49acf7a6ede2d 100644
--- a/packages/monster/dist/modules/i18n/provider.js
+++ b/packages/monster/dist/modules/i18n/provider.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{BaseWithOptions}from"../types/basewithoptions.js";import{Locale}from"./locale.js";import{Translations}from"./translations.js";class Provider extends BaseWithOptions{getTranslations(e){return new Promise((s,o)=>{try{s(new Translations(e))}catch(s){o(s)}})}}assignToNamespace("Monster.I18n",Provider);export{Monster,Provider};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{BaseWithOptions}from"../types/basewithoptions.js";import{Locale}from"./locale.js";import{Translations}from"./translations.js";class Provider extends BaseWithOptions{getTranslations(locale){return new Promise((resolve,reject)=>{try{resolve(new Translations(locale))}catch(e){reject(e)}})}}assignToNamespace("Monster.I18n",Provider);export{Monster,Provider};
diff --git a/packages/monster/dist/modules/i18n/providers/fetch.js b/packages/monster/dist/modules/i18n/providers/fetch.js
index 4153fa6431725d27465eab0cd0a91a20304b0fa9..55a566de566f8b7d13929487ca068434d9431278 100644
--- a/packages/monster/dist/modules/i18n/providers/fetch.js
+++ b/packages/monster/dist/modules/i18n/providers/fetch.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../../constants.js";import{extend}from"../../data/extend.js";import{assignToNamespace,Monster}from"../../namespace.js";import{Formatter}from"../../text/formatter.js";import{getGlobalFunction}from"../../types/global.js";import{isInstance,isString}from"../../types/is.js";import{validateObject,validateString}from"../../types/validate.js";import{parseLocale}from"../locale.js";import{Provider}from"../provider.js";import{Translations}from"../translations.js";class Fetch extends Provider{constructor(t,e){super(e),isInstance(t,URL)&&(t=t.toString()),void 0===e&&(e={}),validateString(t),this.url=t,this[internalSymbol]=extend({},super.defaults,this.defaults,validateObject(e))}get defaults(){return{fetch:{method:"GET",mode:"cors",cache:"no-cache",credentials:"omit",redirect:"follow",referrerPolicy:"no-referrer"}}}getTranslations(e){isString(e)&&(e=parseLocale(e));let t=new Formatter(e.getMap());return getGlobalFunction("fetch")(t.format(this.url),this.getOption("fetch",{})).then(t=>t.json()).then(t=>new Translations(e).assignTranslations(t))}}assignToNamespace("Monster.I18n.Providers",Fetch);export{Monster,Fetch};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../../constants.js";import{extend}from"../../data/extend.js";import{assignToNamespace,Monster}from"../../namespace.js";import{Formatter}from"../../text/formatter.js";import{getGlobalFunction}from"../../types/global.js";import{isInstance,isString}from"../../types/is.js";import{validateObject,validateString}from"../../types/validate.js";import{parseLocale}from"../locale.js";import{Provider}from"../provider.js";import{Translations}from"../translations.js";class Fetch extends Provider{constructor(url,options){super(options);if(isInstance(url,URL)){url=url.toString()}if(options===undefined){options={}}validateString(url);this.url=url;this[internalSymbol]=extend({},super.defaults,this.defaults,validateObject(options))}get defaults(){return{fetch:{method:"GET",mode:"cors",cache:"no-cache",credentials:"omit",redirect:"follow",referrerPolicy:"no-referrer"}}}getTranslations(locale){if(isString(locale)){locale=parseLocale(locale)}let formatter=new Formatter(locale.getMap());return getGlobalFunction("fetch")(formatter.format(this.url),this.getOption("fetch",{})).then(response=>response.json()).then(data=>{return new Translations(locale).assignTranslations(data)})}}assignToNamespace("Monster.I18n.Providers",Fetch);export{Monster,Fetch};
diff --git a/packages/monster/dist/modules/i18n/providers/namespace.js b/packages/monster/dist/modules/i18n/providers/namespace.js
index c324326094cd378edf96ab26da3aa7555dbdf2a4..273a2d7478ca0ba9294279f6114bfe2916447e59 100644
--- a/packages/monster/dist/modules/i18n/providers/namespace.js
+++ b/packages/monster/dist/modules/i18n/providers/namespace.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";const namespace="Monster.I18n.Providers";export{namespace};
\ No newline at end of file
+'use strict';export const namespace="Monster.I18n.Providers";
diff --git a/packages/monster/dist/modules/i18n/translations.js b/packages/monster/dist/modules/i18n/translations.js
index eac159c8837a13bbd2d8d8731c72411e8f94c9aa..bb9aaa5ac23b825d8d06d5015108269aaf5242cb 100644
--- a/packages/monster/dist/modules/i18n/translations.js
+++ b/packages/monster/dist/modules/i18n/translations.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{isObject,isString}from"../types/is.js";import{validateInstance,validateInteger,validateObject,validateString}from"../types/validate.js";import{Locale,parseLocale}from"./locale.js";class Translations extends Base{constructor(t){super(),isString(t)&&(t=parseLocale(t)),this.locale=validateInstance(t,Locale),this.storage=new Map}getText(t,e){if(!this.storage.has(t)){if(void 0===e)throw new Error("key "+t+" not found");return validateString(e)}var r=this.storage.get(t);return isObject(r)?this.getPluralRuleText(t,"other",e):this.storage.get(t)}getPluralRuleText(t,e,r){if(!this.storage.has(t))return validateString(r);let a=validateObject(this.storage.get(t)),s;if(isString(e))s=e.toLocaleString();else{if(0===(e=validateInteger(e))&&a.hasOwnProperty("zero"))return validateString(a.zero);s=new Intl.PluralRules(this.locale.toString()).select(validateInteger(e))}return a.hasOwnProperty(s)?validateString(a[s]):a.hasOwnProperty(DEFAULT_KEY)?validateString(a[DEFAULT_KEY]):validateString(r)}setText(t,e){if(isString(e)||isObject(e))return this.storage.set(validateString(t),e),this;throw new TypeError("value is not a string or object")}assignTranslations(t){validateObject(t);for(var[e,r]of Object.entries(t))this.setText(e,r);return this}}assignToNamespace("Monster.I18n",Translations);export{Monster,Translations};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{isObject,isString}from"../types/is.js";import{validateInstance,validateInteger,validateObject,validateString}from"../types/validate.js";import{Locale,parseLocale}from"./locale.js";class Translations extends Base{constructor(locale){super();if(isString(locale)){locale=parseLocale(locale)}this.locale=validateInstance(locale,Locale);this.storage=new Map}getText(key,defaultText){if(!this.storage.has(key)){if(defaultText===undefined){throw new Error("key "+key+" not found")}return validateString(defaultText)}let r=this.storage.get(key);if(isObject(r)){return this.getPluralRuleText(key,"other",defaultText)}return this.storage.get(key)}getPluralRuleText(key,count,defaultText){if(!this.storage.has(key)){return validateString(defaultText)}let r=validateObject(this.storage.get(key));let keyword;if(isString(count)){keyword=count.toLocaleString()}else{count=validateInteger(count);if(count===0){if(r.hasOwnProperty("zero")){return validateString(r["zero"])}}keyword=new Intl.PluralRules(this.locale.toString()).select(validateInteger(count))}if(r.hasOwnProperty(keyword)){return validateString(r[keyword])}if(r.hasOwnProperty(DEFAULT_KEY)){return validateString(r[DEFAULT_KEY])}return validateString(defaultText)}setText(key,text){if(isString(text)||isObject(text)){this.storage.set(validateString(key),text);return this}throw new TypeError("value is not a string or object")}assignTranslations(translations){validateObject(translations);for(const[k,v]of Object.entries(translations)){this.setText(k,v)}return this}}assignToNamespace("Monster.I18n",Translations);export{Monster,Translations};
diff --git a/packages/monster/dist/modules/logging/handler.js b/packages/monster/dist/modules/logging/handler.js
index 4611a1202f5fba561aaaaccab58883fb1fa2d732..4795f273e075a25887d995f262b2876dfe7985f7 100644
--- a/packages/monster/dist/modules/logging/handler.js
+++ b/packages/monster/dist/modules/logging/handler.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateInstance,validateInteger}from"../types/validate.js";import{LogEntry}from"./logentry.js";import{ALL,DEBUG,ERROR,FATAL,INFO,OFF,TRACE,WARN}from"./logger.js";class Handler extends Base{constructor(){super(),this.loglevel=OFF}log(e){return validateInstance(e,LogEntry),!(this.loglevel<e.getLogLevel())}setLogLevel(e){return validateInteger(e),this.loglevel=e,this}getLogLevel(){return this.loglevel}setAll(){return this.setLogLevel(ALL),this}setTrace(){return this.setLogLevel(TRACE),this}setDebug(){return this.setLogLevel(DEBUG),this}setInfo(){return this.setLogLevel(INFO),this}setWarn(){return this.setLogLevel(WARN),this}setError(){return this.setLogLevel(ERROR),this}setFatal(){return this.setLogLevel(FATAL),this}setOff(){return this.setLogLevel(OFF),this}}assignToNamespace("Monster.Logging",Handler);export{Monster,Handler};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateInstance,validateInteger}from"../types/validate.js";import{LogEntry}from"./logentry.js";import{ALL,DEBUG,ERROR,FATAL,INFO,OFF,TRACE,WARN}from"./logger.js";class Handler extends Base{constructor(){super();this.loglevel=OFF}log(entry){validateInstance(entry,LogEntry);if(this.loglevel<entry.getLogLevel()){return false}return true}setLogLevel(loglevel){validateInteger(loglevel);this.loglevel=loglevel;return this}getLogLevel(){return this.loglevel}setAll(){this.setLogLevel(ALL);return this}setTrace(){this.setLogLevel(TRACE);return this}setDebug(){this.setLogLevel(DEBUG);return this}setInfo(){this.setLogLevel(INFO);return this}setWarn(){this.setLogLevel(WARN);return this}setError(){this.setLogLevel(ERROR);return this}setFatal(){this.setLogLevel(FATAL);return this}setOff(){this.setLogLevel(OFF);return this}}assignToNamespace("Monster.Logging",Handler);export{Monster,Handler};
diff --git a/packages/monster/dist/modules/logging/handler/console.js b/packages/monster/dist/modules/logging/handler/console.js
index f7d08cba11530b3dbc9ead51b9f8da3e72acd605..c8d731699f40206bdcaf890ed4ec2bfcaa52e2bf 100644
--- a/packages/monster/dist/modules/logging/handler/console.js
+++ b/packages/monster/dist/modules/logging/handler/console.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../../namespace.js";import{Base}from"../../types/base.js";import{getGlobalObject}from"../../types/global.js";import{Handler}from"../handler.js";import{LogEntry}from"../logentry.js";class ConsoleHandler extends Handler{constructor(){super()}log(o){if(super.log(o)){let e=getGlobalObject("console");return e?(e.log(o.toString()),!0):!1}return!1}}assignToNamespace("Monster.Logging.Handler",ConsoleHandler);export{Monster,ConsoleHandler};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../../namespace.js";import{Base}from"../../types/base.js";import{getGlobalObject}from"../../types/global.js";import{Handler}from"../handler.js";import{LogEntry}from"../logentry.js";class ConsoleHandler extends Handler{constructor(){super()}log(entry){if(super.log(entry)){let console=getGlobalObject("console");if(!console)return false;console.log(entry.toString());return true}return false}}assignToNamespace("Monster.Logging.Handler",ConsoleHandler);export{Monster,ConsoleHandler};
diff --git a/packages/monster/dist/modules/logging/handler/namespace.js b/packages/monster/dist/modules/logging/handler/namespace.js
index f896b6859167a15f05ad8d920d26a2cd1a71c6bc..7ccd90dd624ea9e5c808a53f68eeced5b61ddddf 100644
--- a/packages/monster/dist/modules/logging/handler/namespace.js
+++ b/packages/monster/dist/modules/logging/handler/namespace.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";const namespace="Monster.Logging.Handler";export{namespace};
\ No newline at end of file
+'use strict';export const namespace="Monster.Logging.Handler";
diff --git a/packages/monster/dist/modules/logging/logentry.js b/packages/monster/dist/modules/logging/logentry.js
index d7249f076191bf8c24327b7c488563553bf228ef..452f2d4d8abe1b8a1e3d64a2df96d65076672c3a 100644
--- a/packages/monster/dist/modules/logging/logentry.js
+++ b/packages/monster/dist/modules/logging/logentry.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateInteger}from"../types/validate.js";class LogEntry extends Base{constructor(e,...t){super(),validateInteger(e),this.loglevel=e,this.arguments=t}getLogLevel(){return this.loglevel}getArguments(){return this.arguments}}assignToNamespace("Monster.Logging",LogEntry);export{Monster,LogEntry};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateInteger}from"../types/validate.js";class LogEntry extends Base{constructor(loglevel,...args){super();validateInteger(loglevel);this.loglevel=loglevel;this.arguments=args}getLogLevel(){return this.loglevel}getArguments(){return this.arguments}}assignToNamespace("Monster.Logging",LogEntry);export{Monster,LogEntry};
diff --git a/packages/monster/dist/modules/logging/logger.js b/packages/monster/dist/modules/logging/logger.js
index efb2922e899b7263732933284414e405ad6e45de..5151be532127dde957ae06ed056695746c1034a4 100644
--- a/packages/monster/dist/modules/logging/logger.js
+++ b/packages/monster/dist/modules/logging/logger.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{Handler}from"../logging/handler.js";import{LogEntry}from"../logging/logentry.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateInteger,validateObject,validateString}from"../types/validate.js";const ALL=255,TRACE=64,DEBUG=32,INFO=16,WARN=8,ERROR=4,FATAL=2,OFF=0;class Logger extends Base{constructor(){super(),this.handler=new Set}addHandler(e){if(validateObject(e),!(e instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.add(e),this}removeHandler(e){if(validateObject(e),!(e instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.delete(e),this}logTrace(){return triggerLog.apply(this,[TRACE,...arguments]),this}logDebug(){return triggerLog.apply(this,[DEBUG,...arguments]),this}logInfo(){return triggerLog.apply(this,[INFO,...arguments]),this}logWarn(){return triggerLog.apply(this,[WARN,...arguments]),this}logError(){return triggerLog.apply(this,[ERROR,...arguments]),this}logFatal(){return triggerLog.apply(this,[FATAL,...arguments]),this}getLabel(e){return validateInteger(e),e===ALL?"ALL":e===TRACE?"TRACE":e===DEBUG?"DEBUG":e===INFO?"INFO":e===WARN?"WARN":e===ERROR?"ERROR":e===FATAL?"FATAL":e===OFF?"OFF":"unknown"}getLevel(e){return validateString(e),"ALL"===e?ALL:"TRACE"===e?TRACE:"DEBUG"===e?DEBUG:"INFO"===e?INFO:"WARN"===e?WARN:"ERROR"===e?ERROR:"FATAL"===e?FATAL:"OFF"===e?OFF:0}}function triggerLog(e,...r){var t;for(t of this.handler)t.log(new LogEntry(e,r));return this}assignToNamespace("Monster.Logging",Logger);export{Monster,Logger,ALL,TRACE,DEBUG,INFO,WARN,ERROR,FATAL,OFF};
\ No newline at end of file
+'use strict';import{Handler}from"../logging/handler.js";import{LogEntry}from"../logging/logentry.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateInteger,validateObject,validateString}from"../types/validate.js";const ALL=255;const TRACE=64;const DEBUG=32;const INFO=16;const WARN=8;const ERROR=4;const FATAL=2;const OFF=0;class Logger extends Base{constructor(){super();this.handler=new Set}addHandler(handler){validateObject(handler);if(!(handler instanceof Handler)){throw new Error("the handler must be an instance of Handler")}this.handler.add(handler);return this}removeHandler(handler){validateObject(handler);if(!(handler instanceof Handler)){throw new Error("the handler must be an instance of Handler")}this.handler.delete(handler);return this}logTrace(){triggerLog.apply(this,[TRACE,...arguments]);return this}logDebug(){triggerLog.apply(this,[DEBUG,...arguments]);return this}logInfo(){triggerLog.apply(this,[INFO,...arguments]);return this}logWarn(){triggerLog.apply(this,[WARN,...arguments]);return this}logError(){triggerLog.apply(this,[ERROR,...arguments]);return this}logFatal(){triggerLog.apply(this,[FATAL,...arguments]);return this}getLabel(level){validateInteger(level);if(level===ALL)return"ALL";if(level===TRACE)return"TRACE";if(level===DEBUG)return"DEBUG";if(level===INFO)return"INFO";if(level===WARN)return"WARN";if(level===ERROR)return"ERROR";if(level===FATAL)return"FATAL";if(level===OFF)return"OFF";return"unknown"}getLevel(label){validateString(label);if(label==="ALL")return ALL;if(label==="TRACE")return TRACE;if(label==="DEBUG")return DEBUG;if(label==="INFO")return INFO;if(label==="WARN")return WARN;if(label==="ERROR")return ERROR;if(label==="FATAL")return FATAL;if(label==="OFF")return OFF;return 0}}assignToNamespace("Monster.Logging",Logger);export{Monster,Logger,ALL,TRACE,DEBUG,INFO,WARN,ERROR,FATAL,OFF};function triggerLog(loglevel,...args){var logger=this;for(let handler of logger.handler){handler.log(new LogEntry(loglevel,args))}return logger}
diff --git a/packages/monster/dist/modules/logging/namespace.js b/packages/monster/dist/modules/logging/namespace.js
index cf60e79056515f5f082668dcd24c52d283be1bc4..fb8dcd38c79f07bb51150a910a7d891893f904bb 100644
--- a/packages/monster/dist/modules/logging/namespace.js
+++ b/packages/monster/dist/modules/logging/namespace.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";const namespace="Monster.Logging";export{namespace};
\ No newline at end of file
+'use strict';export const namespace="Monster.Logging";
diff --git a/packages/monster/dist/modules/math/namespace.js b/packages/monster/dist/modules/math/namespace.js
index f8da36d2a61945d45ac2df8cc4cbf8ff4c6ae01a..7285c700328946404d6272701a2c95ed38f993ea 100644
--- a/packages/monster/dist/modules/math/namespace.js
+++ b/packages/monster/dist/modules/math/namespace.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";const namespace="Monster.Math";export{namespace};
\ No newline at end of file
+'use strict';export const namespace="Monster.Math";
diff --git a/packages/monster/dist/modules/math/random.js b/packages/monster/dist/modules/math/random.js
index dc5ee6f66fdbd00cd7258c4c1307e2c22ce1b076..9783769faec5782507693a9027a662c32ba63b06 100644
--- a/packages/monster/dist/modules/math/random.js
+++ b/packages/monster/dist/modules/math/random.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{getGlobal}from"../types/global.js";function random(r,t){if((t=void 0===t?MAX:t)<(r=void 0===r?0:r))throw new Error("max must be greater than min");return Math.round(create(r,t))}var MAX=1e9;function create(r,t){let e;var o=getGlobal();if(e=o?.crypto||o?.msCrypto||o?.crypto||void 0,void 0===e)throw new Error("missing crypt");let a=0;o=t-r;if(o<2)throw new Error("the distance is too small to create a random number.");var n=Math.ceil(Math.log2(o));if(53<n)throw new Error("we cannot generate numbers larger than 53 bits.");var i=Math.ceil(n/8),n=Math.pow(2,n)-1,s=new Uint8Array(i);e.getRandomValues(s);let l=8*(i-1);for(var m=0;m<i;m++)a+=s[m]*Math.pow(2,l),l-=8;return a&=n,a>=o?create(r,t):(a<r&&(a+=r),a)}Math.log2=Math.log2||function(r){return Math.log(r)/Math.log(2)},assignToNamespace("Monster.Math",random);export{Monster,random};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{getGlobal}from"../types/global.js";function random(min,max){if(min===undefined){min=0}if(max===undefined){max=MAX}if(max<min){throw new Error("max must be greater than min")}return Math.round(create(min,max))}var MAX=1000000000;Math.log2=Math.log2||function(n){return Math.log(n)/Math.log(2)};function create(min,max){let crypt;let globalReference=getGlobal();crypt=globalReference?.["crypto"]||globalReference?.["msCrypto"]||globalReference?.["crypto"]||undefined;if(typeof crypt==="undefined"){throw new Error("missing crypt")}let rval=0;const range=max-min;if(range<2){throw new Error("the distance is too small to create a random number.")}const bitsNeeded=Math.ceil(Math.log2(range));if(bitsNeeded>53){throw new Error("we cannot generate numbers larger than 53 bits.")}const bytesNeeded=Math.ceil(bitsNeeded/8);const mask=Math.pow(2,bitsNeeded)-1;const byteArray=new Uint8Array(bytesNeeded);crypt.getRandomValues(byteArray);let p=(bytesNeeded-1)*8;for(var i=0;i<bytesNeeded;i++){rval+=byteArray[i]*Math.pow(2,p);p-=8}rval=rval&mask;if(rval>=range){return create(min,max)}if(rval<min){rval+=min}return rval}assignToNamespace("Monster.Math",random);export{Monster,random};
diff --git a/packages/monster/dist/modules/monster.js b/packages/monster/dist/modules/monster.js
index 8ff3fa59b77bae2361defc0b5ddc80244a208c12..2de78cf1200287d4f116a4394d709c843afdbff8 100644
--- a/packages/monster/dist/modules/monster.js
+++ b/packages/monster/dist/modules/monster.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import"./constants.js";import"./constraints/abstract.js";import"./constraints/abstractoperator.js";import"./constraints/andoperator.js";import"./constraints/invalid.js";import"./constraints/isarray.js";import"./constraints/isobject.js";import"./constraints/oroperator.js";import"./constraints/valid.js";import"./data/buildmap.js";import"./data/diff.js";import"./data/extend.js";import"./data/pathfinder.js";import"./data/pipe.js";import"./data/transformer.js";import"./dom/assembler.js";import"./dom/attributes.js";import"./dom/constants.js";import"./dom/customcontrol.js";import"./dom/customelement.js";import"./dom/events.js";import"./dom/locale.js";import"./dom/template.js";import"./dom/theme.js";import"./dom/updater.js";import"./dom/util.js";import"./i18n/locale.js";import"./i18n/provider.js";import"./i18n/providers/fetch.js";import"./i18n/translations.js";import"./logging/handler.js";import"./logging/handler/console.js";import"./logging/logentry.js";import"./logging/logger.js";import"./math/random.js";import{Monster}from"./namespace.js";import"./text/formatter.js";import"./types/base.js";import"./types/basewithoptions.js";import"./types/global.js";import"./types/id.js";import"./types/is.js";import"./types/observer.js";import"./types/observerlist.js";import"./types/proxyobserver.js";import"./types/queue.js";import"./types/randomid.js";import"./types/stack.js";import"./types/tokenlist.js";import"./types/typeof.js";import"./types/uniquequeue.js";import"./types/validate.js";import"./types/version.js";import"./util/clone.js";import"./util/comparator.js";import"./util/freeze.js";let rootName;try{rootName=Monster.Types.getGlobalObject("__MonsterRootName__")}catch(t){}rootName=rootName||"Monster",Monster.Types.getGlobal()[rootName]=Monster;export{Monster};
\ No newline at end of file
+'use strict';import"./constants.js";import"./constraints/abstract.js";import"./constraints/abstractoperator.js";import"./constraints/andoperator.js";import"./constraints/invalid.js";import"./constraints/isarray.js";import"./constraints/isobject.js";import"./constraints/oroperator.js";import"./constraints/valid.js";import"./data/buildmap.js";import"./data/diff.js";import"./data/extend.js";import"./data/pathfinder.js";import"./data/pipe.js";import"./data/transformer.js";import"./dom/assembler.js";import"./dom/attributes.js";import"./dom/constants.js";import"./dom/customcontrol.js";import"./dom/customelement.js";import"./dom/events.js";import"./dom/locale.js";import"./dom/template.js";import"./dom/theme.js";import"./dom/updater.js";import"./dom/util.js";import"./i18n/locale.js";import"./i18n/provider.js";import"./i18n/providers/fetch.js";import"./i18n/translations.js";import"./logging/handler.js";import"./logging/handler/console.js";import"./logging/logentry.js";import"./logging/logger.js";import"./math/random.js";import{Monster}from"./namespace.js";import"./text/formatter.js";import"./types/base.js";import"./types/basewithoptions.js";import"./types/global.js";import"./types/id.js";import"./types/is.js";import"./types/observer.js";import"./types/observerlist.js";import"./types/proxyobserver.js";import"./types/queue.js";import"./types/randomid.js";import"./types/stack.js";import"./types/tokenlist.js";import"./types/typeof.js";import"./types/uniquequeue.js";import"./types/validate.js";import"./types/version.js";import"./util/clone.js";import"./util/comparator.js";import"./util/freeze.js";let rootName;try{rootName=Monster.Types.getGlobalObject("__MonsterRootName__")}catch(e){}if(!rootName)rootName="Monster";Monster.Types.getGlobal()[rootName]=Monster;export{Monster};
diff --git a/packages/monster/dist/modules/namespace.js b/packages/monster/dist/modules/namespace.js
index d991ee26c82319589ca6ef2d2f45e58062bf31ba..cf11705b450e085db91770e8734e24d1eeca9f5e 100644
--- a/packages/monster/dist/modules/namespace.js
+++ b/packages/monster/dist/modules/namespace.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";class Namespace{constructor(e){if(void 0===e||"string"!=typeof e)throw new Error("namespace is not a string");this.namespace=e}getNamespace(){return this.namespace}toString(){return this.getNamespace()}}const Monster=new Namespace("Monster");function assignToNamespace(e,...r){let n=namespaceFor(e.split("."));if(0===r.length)throw new Error("no functions have been passed.");for(let e=0,t=r.length;e<t;e++)n[objectName(r[e])]=r[e];return n}function objectName(t){try{if("function"!=typeof t)throw new Error("the first argument is not a function or class.");if(t.hasOwnProperty("name"))return t.name;if("function"==typeof t.toString){let e=t.toString();var r=e.match(/^\s*function\s+([^\s(]+)/);if(Array.isArray(r)&&"string"==typeof r[1])return r[1];var n=e.match(/^\s*class\s+([^\s(]+)/);if(Array.isArray(n)&&"string"==typeof n[1])return n[1]}}catch(e){throw new Error("exception "+e)}throw new Error("the name of the class or function cannot be resolved.")}function namespaceFor(t){let r=Monster,n="Monster";for(let e=0;e<t.length;e++)"Monster"!==t[e]&&(n+="."+t[e],r.hasOwnProperty(t[e])||(r[t[e]]=new Namespace(n)),r=r[t[e]]);return r}assignToNamespace("Monster",assignToNamespace,Namespace);export{Monster,assignToNamespace};
\ No newline at end of file
+'use strict';class Namespace{constructor(namespace){if(namespace===undefined||typeof namespace!=="string"){throw new Error("namespace is not a string")}this.namespace=namespace}getNamespace(){return this.namespace}toString(){return this.getNamespace()}}export const Monster=new Namespace("Monster");function assignToNamespace(ns,...obj){let current=namespaceFor(ns.split("."));if(obj.length===0){throw new Error("no functions have been passed.")}for(let i=0,l=obj.length;i<l;i++){current[objectName(obj[i])]=obj[i]}return current}function objectName(obj){try{if(typeof obj!=="function"){throw new Error("the first argument is not a function or class.")}if(obj.hasOwnProperty("name")){return obj.name}if("function"===typeof obj.toString){let s=obj.toString();let f=s.match(/^\s*function\s+([^\s(]+)/);if(Array.isArray(f)&&typeof f[1]==="string"){return f[1]}let c=s.match(/^\s*class\s+([^\s(]+)/);if(Array.isArray(c)&&typeof c[1]==="string"){return c[1]}}}catch(e){throw new Error("exception "+e)}throw new Error("the name of the class or function cannot be resolved.")}function namespaceFor(parts){let space=Monster,ns="Monster";for(let i=0;i<parts.length;i++){if("Monster"===parts[i]){continue}ns+="."+parts[i];if(!space.hasOwnProperty(parts[i])){space[parts[i]]=new Namespace(ns)}space=space[parts[i]]}return space}assignToNamespace("Monster",assignToNamespace,Namespace);export{assignToNamespace};
diff --git a/packages/monster/dist/modules/text/formatter.js b/packages/monster/dist/modules/text/formatter.js
index dc31e2f5534d61dcaaa991d5618d497dee7dfa77..b36afa0bdca4a38be9e5d1e7fc1535a3b56f6ec7 100644
--- a/packages/monster/dist/modules/text/formatter.js
+++ b/packages/monster/dist/modules/text/formatter.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{Pipe}from"../data/pipe.js";import{assignToNamespace,Monster}from"../namespace.js";import{BaseWithOptions}from"../types/basewithoptions.js";import{isObject,isString}from"../types/is.js";import{validateArray,validateString}from"../types/validate.js";const internalObjectSymbol=Symbol("internalObject"),watchdogSymbol=Symbol("watchdog"),markerOpenIndexSymbol=Symbol("markerOpenIndex"),markerCloseIndexSymbol=Symbol("markercloseIndex"),workingDataSymbol=Symbol("workingData");class Formatter extends BaseWithOptions{constructor(t,e){super(e),this[internalObjectSymbol]=t||{},this[markerOpenIndexSymbol]=0,this[markerCloseIndexSymbol]=0}get defaults(){return extend({},super.defaults,{marker:{open:["${"],close:["}"]},parameter:{delimiter:"::",assignment:"="},callbacks:{}})}setParameterChars(t,e){return void 0!==t&&(this[internalSymbol].parameter.delimiter=validateString(t)),void 0!==e&&(this[internalSymbol].parameter.assignment=validateString(e)),this}setMarker(t,e){return void 0===e&&(e=t),isString(t)&&(t=[t]),isString(e)&&(e=[e]),this[internalSymbol].marker.open=validateArray(t),this[internalSymbol].marker.close=validateArray(e),this}format(t){return this[watchdogSymbol]=0,this[markerOpenIndexSymbol]=0,this[markerCloseIndexSymbol]=0,this[workingDataSymbol]={},format.call(this,t)}}function format(t){var e=this;if(e[watchdogSymbol]++,20<this[watchdogSymbol])throw new Error("too deep nesting");var r=e[internalSymbol].marker.open?.[this[markerOpenIndexSymbol]],n=e[internalSymbol].marker.close?.[this[markerCloseIndexSymbol]];if(-1===t.indexOf(r)||-1===t.indexOf(n))return t;t=tokenize.call(this,validateString(t),r,n);return e[internalSymbol].marker.open?.[this[markerOpenIndexSymbol]+1]&&this[markerOpenIndexSymbol]++,e[internalSymbol].marker.close?.[this[markerCloseIndexSymbol]+1]&&this[markerCloseIndexSymbol]++,format.call(e,t)}function tokenize(a,i,o){var s=this;let l=[];for(var S=s[internalSymbol].parameter.assignment,y=s[internalSymbol].parameter.delimiter,m=s[internalSymbol].callbacks;;){var b=a.indexOf(i);if(-1===b){l.push(a);break}0<b&&(l.push(a.substring(0,b)),a=a.substring(b));let t=a.substring(i.length).indexOf(o);-1!==t&&(t+=i.length);b=a.substring(i.length).indexOf(i);if(-1!==b&&(b+=i.length)<t&&(d=tokenize.call(s,a.substring(b),i,o),a=a.substring(0,b)+d,t=a.substring(i.length).indexOf(o),-1!==t&&(t+=i.length)),-1===t)throw new Error("syntax error in formatter template");let e=a.substring(i.length,t),r=e.split(y);b=r.shift();s[workingDataSymbol]=extend({},s[internalObjectSymbol],s[workingDataSymbol]);for(const O of r){var[g,c]=O.split(S);s[workingDataSymbol][g]=c}const x=e.split("|").shift().trim(),u=x.split("::").shift().trim();var d=u.split(".").shift().trim(),h=s[workingDataSymbol]?.[d]?"path:":"static:";let n="";h&&0!==e.indexOf(h)&&0!==e.indexOf("path:")&&0!==e.indexOf("static:")&&(n=h),n+=b;const p=new Pipe(n);if(isObject(m))for(var[f,k]of Object.entries(m))p.setCallback(f,k);l.push(validateString(p.run(s[workingDataSymbol]))),a=a.substring(t+o.length)}return l.join("")}assignToNamespace("Monster.Text",Formatter);export{Monster,Formatter};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{Pipe}from"../data/pipe.js";import{assignToNamespace,Monster}from"../namespace.js";import{BaseWithOptions}from"../types/basewithoptions.js";import{isObject,isString}from"../types/is.js";import{validateArray,validateString}from"../types/validate.js";const internalObjectSymbol=Symbol("internalObject");const watchdogSymbol=Symbol("watchdog");const markerOpenIndexSymbol=Symbol("markerOpenIndex");const markerCloseIndexSymbol=Symbol("markercloseIndex");const workingDataSymbol=Symbol("workingData");class Formatter extends BaseWithOptions{constructor(object,options){super(options);this[internalObjectSymbol]=object||{};this[markerOpenIndexSymbol]=0;this[markerCloseIndexSymbol]=0}get defaults(){return extend({},super.defaults,{marker:{open:["${"],close:["}"]},parameter:{delimiter:"::",assignment:"="},callbacks:{}})}setParameterChars(delimiter,assignment){if(delimiter!==undefined){this[internalSymbol]["parameter"]["delimiter"]=validateString(delimiter)}if(assignment!==undefined){this[internalSymbol]["parameter"]["assignment"]=validateString(assignment)}return this}setMarker(open,close){if(close===undefined){close=open}if(isString(open))open=[open];if(isString(close))close=[close];this[internalSymbol]["marker"]["open"]=validateArray(open);this[internalSymbol]["marker"]["close"]=validateArray(close);return this}format(text){this[watchdogSymbol]=0;this[markerOpenIndexSymbol]=0;this[markerCloseIndexSymbol]=0;this[workingDataSymbol]={};return format.call(this,text)}}function format(text){const self=this;self[watchdogSymbol]++;if(this[watchdogSymbol]>20){throw new Error("too deep nesting")}let openMarker=self[internalSymbol]["marker"]["open"]?.[this[markerOpenIndexSymbol]];let closeMarker=self[internalSymbol]["marker"]["close"]?.[this[markerCloseIndexSymbol]];if(text.indexOf(openMarker)===-1||text.indexOf(closeMarker)===-1){return text}let result=tokenize.call(this,validateString(text),openMarker,closeMarker);if(self[internalSymbol]["marker"]["open"]?.[this[markerOpenIndexSymbol]+1]){this[markerOpenIndexSymbol]++}if(self[internalSymbol]["marker"]["close"]?.[this[markerCloseIndexSymbol]+1]){this[markerCloseIndexSymbol]++}result=format.call(self,result);return result}function tokenize(text,openMarker,closeMarker){const self=this;let formatted=[];const parameterAssignment=self[internalSymbol]["parameter"]["assignment"];const parameterDelimiter=self[internalSymbol]["parameter"]["delimiter"];const callbacks=self[internalSymbol]["callbacks"];while(true){let startIndex=text.indexOf(openMarker);if(startIndex===-1){formatted.push(text);break}else if(startIndex>0){formatted.push(text.substring(0,startIndex));text=text.substring(startIndex)}let endIndex=text.substring(openMarker.length).indexOf(closeMarker);if(endIndex!==-1)endIndex+=openMarker.length;let insideStartIndex=text.substring(openMarker.length).indexOf(openMarker);if(insideStartIndex!==-1){insideStartIndex+=openMarker.length;if(insideStartIndex<endIndex){let result=tokenize.call(self,text.substring(insideStartIndex),openMarker,closeMarker);text=text.substring(0,insideStartIndex)+result;endIndex=text.substring(openMarker.length).indexOf(closeMarker);if(endIndex!==-1)endIndex+=openMarker.length}}if(endIndex===-1){throw new Error("syntax error in formatter template");return}let key=text.substring(openMarker.length,endIndex);let parts=key.split(parameterDelimiter);let currentPipe=parts.shift();self[workingDataSymbol]=extend({},self[internalObjectSymbol],self[workingDataSymbol]);for(const kv of parts){const[k,v]=kv.split(parameterAssignment);self[workingDataSymbol][k]=v}const t1=key.split("|").shift().trim();const t2=t1.split("::").shift().trim();const t3=t2.split(".").shift().trim();let prefix=self[workingDataSymbol]?.[t3]?"path:":"static:";let command="";if(prefix&&key.indexOf(prefix)!==0&&key.indexOf("path:")!==0&&key.indexOf("static:")!==0){command=prefix}command+=currentPipe;const pipe=new Pipe(command);if(isObject(callbacks)){for(const[name,callback]of Object.entries(callbacks)){pipe.setCallback(name,callback)}}formatted.push(validateString(pipe.run(self[workingDataSymbol])));text=text.substring(endIndex+closeMarker.length)}return formatted.join("")}assignToNamespace("Monster.Text",Formatter);export{Monster,Formatter};
diff --git a/packages/monster/dist/modules/text/namespace.js b/packages/monster/dist/modules/text/namespace.js
index 86bb213006085cada32e7340ac4e5931c11be0ac..3e6677a057d10521c9a1540948c48e39f0010740 100644
--- a/packages/monster/dist/modules/text/namespace.js
+++ b/packages/monster/dist/modules/text/namespace.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";const namespace="Monster.Text";export{namespace};
\ No newline at end of file
+'use strict';export const namespace="Monster.Text";
diff --git a/packages/monster/dist/modules/types/base.js b/packages/monster/dist/modules/types/base.js
index d7ae26ca7f1a3aaa0371e1c3f36a26980e6bf11c..092a526cab28623452456cfa936e675544581aee 100644
--- a/packages/monster/dist/modules/types/base.js
+++ b/packages/monster/dist/modules/types/base.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";class Base extends Object{toString(){return JSON.stringify(this)}}assignToNamespace("Monster.Types",Base);export{Monster,Base};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";class Base extends Object{toString(){return JSON.stringify(this)}}assignToNamespace("Monster.Types",Base);export{Monster,Base};
diff --git a/packages/monster/dist/modules/types/basewithoptions.js b/packages/monster/dist/modules/types/basewithoptions.js
index 884aa7d0c9232d49e24ff7933b1aad0740e0c858..fed06113f1b52cb9963171b892b54bb6dcab0518 100644
--- a/packages/monster/dist/modules/types/basewithoptions.js
+++ b/packages/monster/dist/modules/types/basewithoptions.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{Pathfinder}from"../data/pathfinder.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{validateObject}from"./validate.js";class BaseWithOptions extends Base{constructor(t){super(),this[internalSymbol]=extend({},this.defaults,validateObject(t=void 0===t?{}:t))}get defaults(){return{}}getOption(t,e){let s;try{s=new Pathfinder(this[internalSymbol]).getVia(t)}catch(t){}return void 0===s?e:s}}assignToNamespace("Monster.Types",BaseWithOptions);export{Monster,BaseWithOptions};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../constants.js";import{extend}from"../data/extend.js";import{Pathfinder}from"../data/pathfinder.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{validateObject}from"./validate.js";class BaseWithOptions extends Base{constructor(options){super();if(options===undefined){options={}}this[internalSymbol]=extend({},this.defaults,validateObject(options))}get defaults(){return{}}getOption(path,defaultValue){let value;try{value=new Pathfinder(this[internalSymbol]).getVia(path)}catch(e){}if(value===undefined)return defaultValue;return value}}assignToNamespace("Monster.Types",BaseWithOptions);export{Monster,BaseWithOptions};
diff --git a/packages/monster/dist/modules/types/binary.js b/packages/monster/dist/modules/types/binary.js
index 2beda6b097b2875ff1fc96f7bbcdf27b2fb57f92..bb6813e84edc001e9b82b2b835173db6ba91e6b1 100644
--- a/packages/monster/dist/modules/types/binary.js
+++ b/packages/monster/dist/modules/types/binary.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace}from"../namespace.js";import{Monster,validateString}from"./validate.js";function toBinary(t){const e=new Uint16Array(validateString(t).length);for(let r=0;r<e.length;r++)e[r]=t.charCodeAt(r);var n=new Uint8Array(e.buffer);let a="";for(let r=0;r<n.byteLength;r++)a+=String.fromCharCode(n[r]);return a}function fromBinary(t){const e=new Uint8Array(validateString(t).length);for(let r=0;r<e.length;r++)e[r]=t.charCodeAt(r);var n=new Uint16Array(e.buffer);let a="";for(let r=0;r<n.length;r++)a+=String.fromCharCode(n[r]);return a}assignToNamespace("Monster.Types",toBinary,fromBinary);export{Monster,toBinary,fromBinary};
\ No newline at end of file
+'use strict';import{assignToNamespace}from"../namespace.js";import{Monster,validateString}from"./validate.js";function toBinary(string){const codeUnits=new Uint16Array(validateString(string).length);for(let i=0;i<codeUnits.length;i++){codeUnits[i]=string.charCodeAt(i)}const charCodes=new Uint8Array(codeUnits.buffer);let result="";for(let i=0;i<charCodes.byteLength;i++){result+=String.fromCharCode(charCodes[i])}return result}function fromBinary(binary){const bytes=new Uint8Array(validateString(binary).length);for(let i=0;i<bytes.length;i++){bytes[i]=binary.charCodeAt(i)}const charCodes=new Uint16Array(bytes.buffer);let result="";for(let i=0;i<charCodes.length;i++){result+=String.fromCharCode(charCodes[i])}return result}assignToNamespace("Monster.Types",toBinary,fromBinary);export{Monster,toBinary,fromBinary};
diff --git a/packages/monster/dist/modules/types/dataurl.js b/packages/monster/dist/modules/types/dataurl.js
index 82d12c4e9135beef16e60f513e3c9ae59e62d108..1c708956f23051f5ec559ebec530ba756fd0992a 100644
--- a/packages/monster/dist/modules/types/dataurl.js
+++ b/packages/monster/dist/modules/types/dataurl.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace}from"../namespace.js";import{Base,Monster}from"./base.js";import{isString}from"./is.js";import{MediaType,parseMediaType}from"./mediatype.js";import{validateBoolean,validateInstance,validateString}from"./validate.js";const internal=Symbol("internal");class DataUrl extends Base{constructor(t,e,a){super(),isString(e)&&(e=parseMediaType(e)),this[internal]={content:validateString(t),mediatype:validateInstance(e,MediaType),base64:validateBoolean(void 0===a||a)}}get content(){return this[internal].base64?atob(this[internal].content):this[internal].content}get mediatype(){return this[internal].mediatype}toString(){let t=this[internal].content;return t=!0===this[internal].base64?";base64,"+t:","+encodeURIComponent(t),"data:"+this[internal].mediatype.toString()+t}}function parseDataURL(t){if(validateString(t),"data:"!==(t=t.trim()).substring(0,5))throw new TypeError("incorrect or missing data protocol");var e=(t=t.substring(5)).indexOf(",");if(-1===e)throw new TypeError("malformed data url");let a=t.substring(e+1),n=t.substring(0,e).trim(),r="text/plain;charset=US-ASCII",i=!1;return""!==n?(r=n,n.endsWith("base64")?(t=n.lastIndexOf(";"),r=n.substring(0,t),i=!0):a=decodeURIComponent(a),r=parseMediaType(r)):a=decodeURIComponent(a),new DataUrl(a,r,i)}assignToNamespace("Monster.Types",parseDataURL,DataUrl);export{Monster,parseDataURL,DataUrl};
\ No newline at end of file
+'use strict';import{assignToNamespace}from"../namespace.js";import{Base,Monster}from"./base.js";import{isString}from"./is.js";import{MediaType,parseMediaType}from"./mediatype.js";import{validateBoolean,validateInstance,validateString}from"./validate.js";const internal=Symbol("internal");class DataUrl extends Base{constructor(content,mediatype,base64){super();if(isString(mediatype)){mediatype=parseMediaType(mediatype)}this[internal]={content:validateString(content),mediatype:validateInstance(mediatype,MediaType),base64:validateBoolean(base64===undefined?true:base64)}}get content(){return this[internal].base64?atob(this[internal].content):this[internal].content}get mediatype(){return this[internal].mediatype}toString(){let content=this[internal].content;if(this[internal].base64===true){content=";base64,"+content}else{content=","+encodeURIComponent(content)}return"data:"+this[internal].mediatype.toString()+content}}function parseDataURL(dataurl){validateString(dataurl);dataurl=dataurl.trim();if(dataurl.substring(0,5)!=="data:"){throw new TypeError("incorrect or missing data protocol")}dataurl=dataurl.substring(5);let p=dataurl.indexOf(",");if(p===-1){throw new TypeError("malformed data url")}let content=dataurl.substring(p+1);let mediatypeAndBase64=dataurl.substring(0,p).trim();let mediatype="text/plain;charset=US-ASCII";let base64Flag=false;if(mediatypeAndBase64!==""){mediatype=mediatypeAndBase64;if(mediatypeAndBase64.endsWith("base64")){let i=mediatypeAndBase64.lastIndexOf(";");mediatype=mediatypeAndBase64.substring(0,i);base64Flag=true}else{content=decodeURIComponent(content)}mediatype=parseMediaType(mediatype)}else{content=decodeURIComponent(content)}return new DataUrl(content,mediatype,base64Flag)}assignToNamespace("Monster.Types",parseDataURL,DataUrl);export{Monster,parseDataURL,DataUrl};
diff --git a/packages/monster/dist/modules/types/global.js b/packages/monster/dist/modules/types/global.js
index 365ca835c5055842294cfbd08db08d57c0fb49f3..6e5ef9ac3e3a62515d4ebd6b1964148c563e5c8f 100644
--- a/packages/monster/dist/modules/types/global.js
+++ b/packages/monster/dist/modules/types/global.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{validateFunction,validateObject,validateString}from"./validate.js";let globalReference;function getGlobal(){return globalReference}function getGlobalObject(e){validateString(e);var t=globalReference?.[e];if(void 0===t)throw new Error("the object "+e+" is not defined");return validateObject(t),t}function getGlobalFunction(e){validateString(e);var t=globalReference?.[e];if(void 0===t)throw new Error("the function "+e+" is not defined");return validateFunction(t),t}!function(){if("object"!=typeof globalThis)if("undefined"==typeof self){if("undefined"==typeof window){if(Object.defineProperty(Object.prototype,"__monster__",{get:function(){return this},configurable:!0}),"object"==typeof __monster__)return __monster__.globalThis=__monster__,delete Object.prototype.__monster__,globalReference=globalThis;try{globalReference=Function("return this")()}catch(e){}throw new Error("unsupported environment.")}globalReference=window}else globalReference=self;else globalReference=globalThis}(),assignToNamespace("Monster.Types",getGlobal,getGlobalObject,getGlobalFunction);export{Monster,getGlobal,getGlobalObject,getGlobalFunction};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{validateFunction,validateObject,validateString}from"./validate.js";let globalReference;(function(){if(typeof globalThis==="object"){globalReference=globalThis;return}if(typeof self!=="undefined"){globalReference=self;return}else if(typeof window!=="undefined"){globalReference=window;return}Object.defineProperty(Object.prototype,"__monster__",{get:function(){return this},configurable:true});if(typeof __monster__==="object"){__monster__.globalThis=__monster__;delete Object.prototype.__monster__;globalReference=globalThis;return}try{globalReference=Function("return this")()}catch(e){}throw new Error("unsupported environment.")})();function getGlobal(){return globalReference}function getGlobalObject(name){validateString(name);let o=globalReference?.[name];if(typeof o==="undefined")throw new Error("the object "+name+" is not defined");validateObject(o);return o}function getGlobalFunction(name){validateString(name);let f=globalReference?.[name];if(typeof f==="undefined")throw new Error("the function "+name+" is not defined");validateFunction(f);return f}assignToNamespace("Monster.Types",getGlobal,getGlobalObject,getGlobalFunction);export{Monster,getGlobal,getGlobalObject,getGlobalFunction};
diff --git a/packages/monster/dist/modules/types/id.js b/packages/monster/dist/modules/types/id.js
index 7d182a463afe525b2d972494fe328a3ad0ed04f6..8bb23afbb8c5d3db1fcda301a3e7a42801124e2e 100644
--- a/packages/monster/dist/modules/types/id.js
+++ b/packages/monster/dist/modules/types/id.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{validateString}from"./validate.js";let internalCounter=new Map;class ID extends Base{constructor(e){super(),validateString(e=void 0===e?"id":e),internalCounter.has(e)||internalCounter.set(e,1);var t=internalCounter.get(e);this.id=e+t,internalCounter.set(e,++t)}toString(){return this.id}}assignToNamespace("Monster.Types",ID);export{Monster,ID};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{validateString}from"./validate.js";let internalCounter=new Map;class ID extends Base{constructor(prefix){super();if(prefix===undefined){prefix="id"}validateString(prefix);if(!internalCounter.has(prefix)){internalCounter.set(prefix,1)}let count=internalCounter.get(prefix);this.id=prefix+count;internalCounter.set(prefix,++count)}toString(){return this.id}}assignToNamespace("Monster.Types",ID);export{Monster,ID};
diff --git a/packages/monster/dist/modules/types/is.js b/packages/monster/dist/modules/types/is.js
index 9ff7b0f5aa5d68333f6b9567b22602829d7be2b4..9fef6b3ae39a75a5806872b68f2c0f72586c770a 100644
--- a/packages/monster/dist/modules/types/is.js
+++ b/packages/monster/dist/modules/types/is.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";function isIterable(i){return void 0!==i&&(null!==i&&"function"==typeof i?.[Symbol.iterator])}function isPrimitive(i){return null==i||("string"==(i=typeof i)||"number"==i||"boolean"==i||"symbol"==i)}function isSymbol(i){return"symbol"==typeof i}function isBoolean(i){return!0===i||!1===i}function isString(i){return void 0!==i&&"string"==typeof i}function isObject(i){return!isArray(i)&&(!isPrimitive(i)&&"object"==typeof i)}function isInstance(i,n){return!!isObject(i)&&(!!isFunction(n)&&(!!n.hasOwnProperty("prototype")&&i instanceof n))}function isArray(i){return Array.isArray(i)}function isFunction(i){return!isArray(i)&&(!isPrimitive(i)&&"function"==typeof i)}function isInteger(i){return Number.isInteger(i)}assignToNamespace("Monster.Types",isPrimitive,isBoolean,isString,isObject,isArray,isFunction,isIterable,isInteger,isSymbol);export{Monster,isPrimitive,isBoolean,isString,isObject,isInstance,isArray,isFunction,isIterable,isInteger,isSymbol};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";function isIterable(value){if(value===undefined)return false;if(value===null)return false;return typeof value?.[Symbol.iterator]==="function"}function isPrimitive(value){var type;if(value===undefined||value===null){return true}type=typeof value;if(type==="string"||type==="number"||type==="boolean"||type==="symbol"){return true}return false}function isSymbol(value){return"symbol"===typeof value?true:false}function isBoolean(value){if(value===true||value===false){return true}return false}function isString(value){if(value===undefined||typeof value!=="string"){return false}return true}function isObject(value){if(isArray(value))return false;if(isPrimitive(value))return false;if(typeof value==="object"){return true}return false}function isInstance(value,instance){if(!isObject(value))return false;if(!isFunction(instance))return false;if(!instance.hasOwnProperty("prototype"))return false;return value instanceof instance?true:false}function isArray(value){return Array.isArray(value)}function isFunction(value){if(isArray(value))return false;if(isPrimitive(value))return false;if(typeof value==="function"){return true}return false}function isInteger(value){return Number.isInteger(value)}assignToNamespace("Monster.Types",isPrimitive,isBoolean,isString,isObject,isArray,isFunction,isIterable,isInteger,isSymbol);export{Monster,isPrimitive,isBoolean,isString,isObject,isInstance,isArray,isFunction,isIterable,isInteger,isSymbol};
diff --git a/packages/monster/dist/modules/types/mediatype.js b/packages/monster/dist/modules/types/mediatype.js
index 8d899d24b78ccaf1e16e0ca164b9f34f5c6c3893..b03b36cc68dad3263aa27642a68681db7906d290 100644
--- a/packages/monster/dist/modules/types/mediatype.js
+++ b/packages/monster/dist/modules/types/mediatype.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace}from"../namespace.js";import{Base,Monster}from"./base.js";import{isString}from"./is.js";import{validateArray,validateString}from"./validate.js";const internal=Symbol("internal");class MediaType extends Base{constructor(e,t,r){super(),this[internal]={type:validateString(e).toLowerCase(),subtype:validateString(t).toLowerCase(),parameter:[]},void 0!==r&&(this[internal].parameter=validateArray(r))}get type(){return this[internal].type}get subtype(){return this[internal].subtype}get parameter(){return this[internal].parameter}get parameter(){const r=new Map;return this[internal].parameter.forEach(e=>{let t=e.value;t.startsWith('"')&&t.endsWith('"')&&(t=t.substring(1,t.length-1)),r.set(e.key,t)}),r}toString(){let e=[];for(var t of this[internal].parameter)e.push(t.key+"="+t.value);return this[internal].type+"/"+this[internal].subtype+(0<e.length?";"+e.join(";"):"")}}function parseMediaType(e){e=/(?<type>[A-Za-z]+|\*)\/(?<subtype>([a-zA-Z0-9.\+_\-]+)|\*|)(?<parameter>\s*;\s*([a-zA-Z0-9]+)\s*(=\s*("?[A-Za-z0-9_\-]+"?))?)*/g.exec(validateString(e))?.groups;if(void 0===e)throw new TypeError("the mimetype can not be parsed");var t=e?.type,r=e?.subtype,e=e?.parameter;if(""===r||""===t)throw new TypeError("blank value is not allowed");return new MediaType(t,r,parseParameter(e))}function parseParameter(e){if(isString(e)){let r=[];return e.split(";").forEach(e=>{var t;""!==(e=e.trim())&&(e=e.split("="),t=validateString(e?.[0]).trim(),e=validateString(e?.[1]).trim(),r.push({key:t,value:e}))}),r}}assignToNamespace("Monster.Types",parseMediaType,MediaType);export{Monster,parseMediaType,MediaType};
\ No newline at end of file
+'use strict';import{assignToNamespace}from"../namespace.js";import{Base,Monster}from"./base.js";import{isString}from"./is.js";import{validateArray,validateString}from"./validate.js";const internal=Symbol("internal");class MediaType extends Base{constructor(type,subtype,parameter){super();this[internal]={type:validateString(type).toLowerCase(),subtype:validateString(subtype).toLowerCase(),parameter:[]};if(parameter!==undefined){this[internal]["parameter"]=validateArray(parameter)}}get type(){return this[internal].type}get subtype(){return this[internal].subtype}get parameter(){return this[internal].parameter}get parameter(){const result=new Map;this[internal]["parameter"].forEach(p=>{let value=p.value;if(value.startsWith("\"")&&value.endsWith("\"")){value=value.substring(1,value.length-1)}result.set(p.key,value)});return result}toString(){let parameter=[];for(let a of this[internal].parameter){parameter.push(a.key+"="+a.value)}return this[internal].type+"/"+this[internal].subtype+(parameter.length>0?";"+parameter.join(";"):"")}}function parseMediaType(mediatype){const regex=/(?<type>[A-Za-z]+|\*)\/(?<subtype>([a-zA-Z0-9.\+_\-]+)|\*|)(?<parameter>\s*;\s*([a-zA-Z0-9]+)\s*(=\s*("?[A-Za-z0-9_\-]+"?))?)*/g;const result=regex.exec(validateString(mediatype));const groups=result?.["groups"];if(groups===undefined){throw new TypeError("the mimetype can not be parsed")}const type=groups?.["type"];const subtype=groups?.["subtype"];const parameter=groups?.["parameter"];if(subtype===""||type===""){throw new TypeError("blank value is not allowed")}return new MediaType(type,subtype,parseParameter(parameter))}function parseParameter(parameter){if(!isString(parameter)){return undefined}let result=[];parameter.split(";").forEach(entry=>{entry=entry.trim();if(entry===""){return}const kv=entry.split("=");let key=validateString(kv?.[0]).trim();let value=validateString(kv?.[1]).trim();result.push({key:key,value:value})});return result}assignToNamespace("Monster.Types",parseMediaType,MediaType);export{Monster,parseMediaType,MediaType};
diff --git a/packages/monster/dist/modules/types/namespace.js b/packages/monster/dist/modules/types/namespace.js
index d23bcb3a2b00dcb9b948a1bcf000c43e1c6e9cb5..a749bbc415c829e41ae20d6b3c3438026b68c4c3 100644
--- a/packages/monster/dist/modules/types/namespace.js
+++ b/packages/monster/dist/modules/types/namespace.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";const namespace="Monster.Types";export{namespace};
\ No newline at end of file
+'use strict';export const namespace="Monster.Types";
diff --git a/packages/monster/dist/modules/types/node.js b/packages/monster/dist/modules/types/node.js
index b51b1775fa68cffa7f53b4e50031df0e134c2a87..4857a4e9e4356b62863d425799bba6ba1a258bd8 100644
--- a/packages/monster/dist/modules/types/node.js
+++ b/packages/monster/dist/modules/types/node.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{isPrimitive}from"./is.js";import{NodeList}from"./nodelist.js";import{validateInstance}from"./validate.js";const internalValueSymbol=Symbol("internalData"),treeStructureSymbol=Symbol("treeStructure");class Node extends Base{constructor(e){super(),this[internalValueSymbol]=e,this[treeStructureSymbol]={parent:null,childNodes:new NodeList,level:0}}get value(){return this[internalValueSymbol]}set value(e){this[internalValueSymbol]=e}get parent(){return this[treeStructureSymbol].parent}get level(){return this[treeStructureSymbol].level}get childNodes(){return this[treeStructureSymbol].childNodes}set childNodes(e){this[treeStructureSymbol].childNodes=validateInstance(e,NodeList),setChildLevelAndParent.call(this,this,1)}appendChild(e){return this[treeStructureSymbol].childNodes.add(validateInstance(e,Node)),e[treeStructureSymbol].parent=this,e[treeStructureSymbol].level=this.level+1,setChildLevelAndParent.call(this,e,1),this}removeChild(e){return this[treeStructureSymbol].childNodes.remove(validateInstance(e,Node)),e[treeStructureSymbol].parent=null,e[treeStructureSymbol].level=0,setChildLevelAndParent.call(this,e,-1),this}hasChildNodes(){return 0<this[treeStructureSymbol].childNodes.length}hasChild(e){return this[treeStructureSymbol].childNodes.has(validateInstance(e,Node))}toString(){let t=[];if(this[internalValueSymbol]){let e=this[internalValueSymbol];isPrimitive(e)||(e=JSON.stringify(this[internalValueSymbol])),t.push(e)}if(!this.hasChildNodes())return t.join("\n");let e=this.childNodes.length,r=0;for(const s of this.childNodes){r++;var l=(e===r?"└":"├").padStart(2*s.level," |");t.push(l+s.toString())}return t.join("\n")}}function setChildLevelAndParent(t,r){const l=this;return t!==this&&(t[treeStructureSymbol].parent=this),t[treeStructureSymbol].childNodes.forEach(function(e){e[treeStructureSymbol].parent=t,e[treeStructureSymbol].level=t[treeStructureSymbol].level+r,setChildLevelAndParent.call(l,e,r)}),this}assignToNamespace("Monster.Types",Node);export{Monster,Node};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{isPrimitive}from"./is.js";import{NodeList}from"./nodelist.js";import{validateInstance}from"./validate.js";const internalValueSymbol=Symbol("internalData");const treeStructureSymbol=Symbol("treeStructure");class Node extends Base{constructor(value){super();this[internalValueSymbol]=value;this[treeStructureSymbol]={parent:null,childNodes:new NodeList,level:0}}get value(){return this[internalValueSymbol]}set value(value){this[internalValueSymbol]=value}get parent(){return this[treeStructureSymbol].parent}get level(){return this[treeStructureSymbol].level}get childNodes(){return this[treeStructureSymbol].childNodes}set childNodes(childNodes){this[treeStructureSymbol].childNodes=validateInstance(childNodes,NodeList);setChildLevelAndParent.call(this,this,1)}appendChild(node){this[treeStructureSymbol].childNodes.add(validateInstance(node,Node));node[treeStructureSymbol].parent=this;node[treeStructureSymbol].level=this.level+1;setChildLevelAndParent.call(this,node,1);return this}removeChild(node){this[treeStructureSymbol].childNodes.remove(validateInstance(node,Node));node[treeStructureSymbol].parent=null;node[treeStructureSymbol].level=0;setChildLevelAndParent.call(this,node,-1);return this}hasChildNodes(){return this[treeStructureSymbol].childNodes.length>0}hasChild(node){return this[treeStructureSymbol].childNodes.has(validateInstance(node,Node))}toString(){let parts=[];if(this[internalValueSymbol]){let label=this[internalValueSymbol];if(!isPrimitive(label))label=JSON.stringify(this[internalValueSymbol]);parts.push(label)}if(!this.hasChildNodes()){return parts.join("\n")}let count=this.childNodes.length,counter=0;for(const node of this.childNodes){counter++;const prefix=(count===counter?"\u2514":"\u251C").padStart(2*node.level," |");parts.push(prefix+node.toString())}return parts.join("\n")}}function setChildLevelAndParent(node,operand){const self=this;if(node!==this){node[treeStructureSymbol].parent=this}node[treeStructureSymbol].childNodes.forEach(function(child){child[treeStructureSymbol].parent=node;child[treeStructureSymbol].level=node[treeStructureSymbol].level+operand;setChildLevelAndParent.call(self,child,operand)});return this}assignToNamespace("Monster.Types",Node);export{Monster,Node};
diff --git a/packages/monster/dist/modules/types/nodelist.js b/packages/monster/dist/modules/types/nodelist.js
index 6ffdf78a5862a251e664ebc47228679320aad49d..d49b578f35e9d41f77b5d68bf6ce3ad499be1149 100644
--- a/packages/monster/dist/modules/types/nodelist.js
+++ b/packages/monster/dist/modules/types/nodelist.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isArray,isInstance}from"./is.js";import{Node}from"./node.js";import{validateInstance}from"./validate.js";class NodeList extends Set{constructor(e){super();const r=this;if(void 0!==e)if(isArray(e))e.forEach(e=>r.add(e));else if(isInstance(e,NodeList))e.forEach(e=>r.add(e));else{if(!isInstance(e,Node))throw new Error("invalid value type");r.add(e)}}add(e){return super.add(validateInstance(e,Node)),this}remove(e){return super.delete(validateInstance(e,Node)),this}has(e){return super.has(validateInstance(e,Node))}clear(){return super.clear(),this}toArray(){return Array.from(this)}toJSON(){return this.toArray()}toString(){let e=[];for(const r of this.toArray())e.push(r.toString());return e.join("\n")}get length(){return super.size}}assignToNamespace("Monster.Types",NodeList);export{Monster,NodeList};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{isArray,isInstance}from"./is.js";import{Node}from"./node.js";import{validateInstance}from"./validate.js";class NodeList extends Set{constructor(values){super();const self=this;if(values===undefined)return;if(isArray(values)){values.forEach(value=>self.add(value))}else if(isInstance(values,NodeList)){values.forEach(value=>self.add(value))}else if(isInstance(values,Node)){self.add(values)}else{throw new Error("invalid value type")}}add(node){super.add(validateInstance(node,Node));return this}remove(node){super.delete(validateInstance(node,Node));return this}has(node){return super.has(validateInstance(node,Node));return false}clear(){super.clear();return this}toArray(){return Array.from(this)}toJSON(){return this.toArray()}toString(){let parts=[];for(const node of this.toArray()){parts.push(node.toString())}return parts.join("\n")}get length(){return super.size}}assignToNamespace("Monster.Types",NodeList);export{Monster,NodeList};
diff --git a/packages/monster/dist/modules/types/noderecursiveiterator.js b/packages/monster/dist/modules/types/noderecursiveiterator.js
index 2b15accf63fd6a2129d57931d3b9f1cb2c2f2571..2718a05f030a884d8e79c6fa644d9c764384fc4a 100644
--- a/packages/monster/dist/modules/types/noderecursiveiterator.js
+++ b/packages/monster/dist/modules/types/noderecursiveiterator.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../constants.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{isInstance}from"./is.js";import{Node}from"./node.js";import{NodeList}from"./nodelist.js";import{validateInstance}from"./validate.js";const isNodeListSymbol=Symbol("isNodeList");class NodeRecursiveIterator extends Base{constructor(s){var e;super(),this[isNodeListSymbol]=!1,isInstance(s,NodeList)&&(e=s,(s=new Node).childNodes=e,this[isNodeListSymbol]=!0),this[internalSymbol]=validateInstance(s,Node)}[Symbol.iterator]=function*(){var s;if(void 0!==this[internalSymbol]&&(!0!==this[isNodeListSymbol]&&(yield this[internalSymbol]),this[internalSymbol].hasChildNodes()))for(s of this[internalSymbol].childNodes)yield*new NodeRecursiveIterator(s)};forEach(s){for(const e of this)s(e);return this}}assignToNamespace("Monster.Types",NodeRecursiveIterator);export{Monster,NodeRecursiveIterator};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../constants.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{isInstance}from"./is.js";import{Node}from"./node.js";import{NodeList}from"./nodelist.js";import{validateInstance}from"./validate.js";const isNodeListSymbol=Symbol("isNodeList");class NodeRecursiveIterator extends Base{constructor(node){super();this[isNodeListSymbol]=false;if(isInstance(node,NodeList)){let children=node;node=new Node;node.childNodes=children;this[isNodeListSymbol]=true}this[internalSymbol]=validateInstance(node,Node)}[Symbol.iterator]=function*(){if(this[internalSymbol]===undefined){return}if(this[isNodeListSymbol]!==true){yield this[internalSymbol]}if(this[internalSymbol].hasChildNodes()){let childNodes=this[internalSymbol].childNodes;for(let node of childNodes){yield*new NodeRecursiveIterator(node)}}return};forEach(callback){for(const node of this){callback(node)}return this}}assignToNamespace("Monster.Types",NodeRecursiveIterator);export{Monster,NodeRecursiveIterator};
diff --git a/packages/monster/dist/modules/types/observer.js b/packages/monster/dist/modules/types/observer.js
index 8d373d833aa4db80655cdee27ded56429b2b822a..30fa912a950f10b8f8908094fcc59c1223f69922 100644
--- a/packages/monster/dist/modules/types/observer.js
+++ b/packages/monster/dist/modules/types/observer.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{isObject}from"./is.js";import{TokenList}from"./tokenlist.js";import{UniqueQueue}from"./uniquequeue.js";class Observer extends Base{constructor(e,...t){if(super(),"function"!=typeof e)throw new Error("observer callback must be a function");this.callback=e,this.arguments=t,this.tags=new TokenList,this.queue=new UniqueQueue}addTag(e){return this.tags.add(e),this}removeTag(e){return this.tags.remove(e),this}getTags(){return this.tags.entries()}hasTag(e){return this.tags.contains(e)}update(e){let i=this;return new Promise(function(s,r){isObject(e)?(i.queue.add(e),setTimeout(()=>{try{if(i.queue.isEmpty())return void s();var t=i.queue.poll();let e=i.callback.apply(t,i.arguments);if(isObject(e)&&e instanceof Promise)return void e.then(s).catch(r);s(e)}catch(e){r(e)}},0)):r("subject must be an object")})}}assignToNamespace("Monster.Types",Observer);export{Monster,Observer};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{isObject}from"./is.js";import{TokenList}from"./tokenlist.js";import{UniqueQueue}from"./uniquequeue.js";class Observer extends Base{constructor(callback,...args){super();if(typeof callback!=="function"){throw new Error("observer callback must be a function")}this.callback=callback;this.arguments=args;this.tags=new TokenList;this.queue=new UniqueQueue}addTag(tag){this.tags.add(tag);return this}removeTag(tag){this.tags.remove(tag);return this}getTags(){return this.tags.entries()}hasTag(tag){return this.tags.contains(tag)}update(subject){let self=this;return new Promise(function(resolve,reject){if(!isObject(subject)){reject("subject must be an object");return}self.queue.add(subject);setTimeout(()=>{try{if(self.queue.isEmpty()){resolve();return}let s=self.queue.poll();let result=self.callback.apply(s,self.arguments);if(isObject(result)&&result instanceof Promise){result.then(resolve).catch(reject);return}resolve(result)}catch(e){reject(e)}},0)})}}assignToNamespace("Monster.Types",Observer);export{Monster,Observer};
diff --git a/packages/monster/dist/modules/types/observerlist.js b/packages/monster/dist/modules/types/observerlist.js
index 6923474e238d0c07640ae8c8cbf2f0c0ff1781e9..4bbd884612fed180e38aa3a3a6b4fe24fecbccf4 100644
--- a/packages/monster/dist/modules/types/observerlist.js
+++ b/packages/monster/dist/modules/types/observerlist.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{Observer}from"./observer.js";import{validateInstance}from"./validate.js";class ObserverList extends Base{constructor(){super(),this.observers=[]}attach(e){return validateInstance(e,Observer),this.observers.push(e),this}detach(e){validateInstance(e,Observer);for(var s=0,r=this.observers.length;s<r;s++)this.observers[s]===e&&this.observers.splice(s,1);return this}contains(e){validateInstance(e,Observer);for(var s=0,r=this.observers.length;s<r;s++)if(this.observers[s]===e)return!0;return!1}notify(e){let s=[],r=0,t=this.observers.length;for(;r<t;r++)s.push(this.observers[r].update(e));return Promise.all(s)}}assignToNamespace("Monster.Types",ObserverList);export{Monster,ObserverList};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{Observer}from"./observer.js";import{validateInstance}from"./validate.js";class ObserverList extends Base{constructor(){super();this.observers=[]}attach(observer){validateInstance(observer,Observer);this.observers.push(observer);return this}detach(observer){validateInstance(observer,Observer);var i=0,l=this.observers.length;for(;i<l;i++){if(this.observers[i]===observer){this.observers.splice(i,1)}}return this}contains(observer){validateInstance(observer,Observer);var i=0,l=this.observers.length;for(;i<l;i++){if(this.observers[i]===observer){return true}}return false}notify(subject){let pomises=[];let i=0,l=this.observers.length;for(;i<l;i++){pomises.push(this.observers[i].update(subject))}return Promise.all(pomises)}}assignToNamespace("Monster.Types",ObserverList);export{Monster,ObserverList};
diff --git a/packages/monster/dist/modules/types/proxyobserver.js b/packages/monster/dist/modules/types/proxyobserver.js
index 235b81db64dc7a5114a92028530ab39206f5b89a..c4c57e3ad20ea62867413271d130e64cbe105538 100644
--- a/packages/monster/dist/modules/types/proxyobserver.js
+++ b/packages/monster/dist/modules/types/proxyobserver.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{isArray,isObject,isPrimitive}from"./is.js";import{Observer}from"./observer.js";import{ObserverList}from"./observerlist.js";import{validateObject}from"./validate.js";import{extend}from"../data/extend.js";class ProxyObserver extends Base{constructor(e){super(),this.realSubject=validateObject(e),this.subject=new Proxy(e,getHandler.call(this)),this.objectMap=new WeakMap,this.objectMap.set(this.realSubject,this.subject),this.proxyMap=new WeakMap,this.proxyMap.set(this.subject,this.realSubject),this.observers=new ObserverList}getSubject(){return this.subject}setSubject(e){let t,r=Object.keys(this.subject);for(t=0;t<r.length;t++)delete this.subject[r[t]];return this.subject=extend(this.subject,e),this}getRealSubject(){return this.realSubject}attachObserver(e){return this.observers.attach(e),this}detachObserver(e){return this.observers.detach(e),this}notifyObservers(){return this.observers.notify(this)}containsObserver(e){return this.observers.contains(e)}}function getHandler(){const a=this,s={get:function(e,t,r){e=Reflect.get(e,t,r);return"symbol"!=typeof t&&!isPrimitive(e)&&(isArray(e)||isObject(e))?a.objectMap.has(e)?a.objectMap.get(e):a.proxyMap.has(e)?e:(r=new Proxy(e,s),a.objectMap.set(e,r),a.proxyMap.set(r,e),r):e},set:function(e,t,r,s){a.proxyMap.has(r)&&(r=a.proxyMap.get(r)),a.proxyMap.has(e)&&(e=a.proxyMap.get(e));let o=Reflect.get(e,t,s);if(a.proxyMap.has(o)&&(o=a.proxyMap.get(o)),o===r)return!0;let i=Reflect.getOwnPropertyDescriptor(e,t);return void 0===i&&(i={writable:!0,enumerable:!0,configurable:!0}),i.value=r,s=Reflect.defineProperty(e,t,i),"symbol"!=typeof t&&a.observers.notify(a),s},deleteProperty:function(e,t){return t in e&&(delete e[t],"symbol"!=typeof t&&a.observers.notify(a),!0)},defineProperty:function(e,t,r){e=Reflect.defineProperty(e,t,r);return"symbol"!=typeof t&&a.observers.notify(a),e},setPrototypeOf:function(e,t){var r=Reflect.setPrototypeOf(object1,t);return"symbol"!=typeof t&&a.observers.notify(a),r}};return s}assignToNamespace("Monster.Types",ProxyObserver);export{Monster,ProxyObserver};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";import{isArray,isObject,isPrimitive}from"./is.js";import{Observer}from"./observer.js";import{ObserverList}from"./observerlist.js";import{validateObject}from"./validate.js";import{extend}from"../data/extend.js";class ProxyObserver extends Base{constructor(object){super();this.realSubject=validateObject(object);this.subject=new Proxy(object,getHandler.call(this));this.objectMap=new WeakMap;this.objectMap.set(this.realSubject,this.subject);this.proxyMap=new WeakMap;this.proxyMap.set(this.subject,this.realSubject);this.observers=new ObserverList}getSubject(){return this.subject}setSubject(obj){let i,k=Object.keys(this.subject);for(i=0;i<k.length;i++){delete this.subject[k[i]]}this.subject=extend(this.subject,obj);return this}getRealSubject(){return this.realSubject}attachObserver(observer){this.observers.attach(observer);return this}detachObserver(observer){this.observers.detach(observer);return this}notifyObservers(){return this.observers.notify(this)}containsObserver(observer){return this.observers.contains(observer)}}assignToNamespace("Monster.Types",ProxyObserver);export{Monster,ProxyObserver};function getHandler(){const proxy=this;const handler={get:function(target,key,receiver){const value=Reflect.get(target,key,receiver);if(typeof key==="symbol"){return value}if(isPrimitive(value)){return value}if(isArray(value)||isObject(value)){if(proxy.objectMap.has(value)){return proxy.objectMap.get(value)}else if(proxy.proxyMap.has(value)){return value}else{let p=new Proxy(value,handler);proxy.objectMap.set(value,p);proxy.proxyMap.set(p,value);return p}}return value},set:function(target,key,value,receiver){if(proxy.proxyMap.has(value)){value=proxy.proxyMap.get(value)}if(proxy.proxyMap.has(target)){target=proxy.proxyMap.get(target)}let current=Reflect.get(target,key,receiver);if(proxy.proxyMap.has(current)){current=proxy.proxyMap.get(current)}if(current===value){return true}let result;let descriptor=Reflect.getOwnPropertyDescriptor(target,key);if(descriptor===undefined){descriptor={writable:true,enumerable:true,configurable:true}}descriptor["value"]=value;result=Reflect.defineProperty(target,key,descriptor);if(typeof key!=="symbol"){proxy.observers.notify(proxy)}return result},deleteProperty:function(target,key){if(key in target){delete target[key];if(typeof key!=="symbol"){proxy.observers.notify(proxy)}return true}return false},defineProperty:function(target,key,descriptor){let result=Reflect.defineProperty(target,key,descriptor);if(typeof key!=="symbol"){proxy.observers.notify(proxy)}return result},setPrototypeOf:function(target,key){let result=Reflect.setPrototypeOf(object1,key);if(typeof key!=="symbol"){proxy.observers.notify(proxy)}return result}};return handler}
diff --git a/packages/monster/dist/modules/types/queue.js b/packages/monster/dist/modules/types/queue.js
index b415998585d543e2823766de3ed45ba617426a8b..299af87bbd0fe0d8bc2891f252d7e390dac292e8 100644
--- a/packages/monster/dist/modules/types/queue.js
+++ b/packages/monster/dist/modules/types/queue.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";class Queue extends Base{constructor(){super(),this.data=[]}isEmpty(){return 0===this.data.length}peek(){if(!this.isEmpty())return this.data[0]}add(s){return this.data.push(s),this}clear(){return this.data=[],this}poll(){if(!this.isEmpty())return this.data.shift()}}assignToNamespace("Monster.Types",Queue);export{Monster,Queue};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";class Queue extends Base{constructor(){super();this.data=[]}isEmpty(){return this.data.length===0}peek(){if(this.isEmpty()){return undefined}return this.data[0]}add(value){this.data.push(value);return this}clear(){this.data=[];return this}poll(){if(this.isEmpty()){return undefined}return this.data.shift()}}assignToNamespace("Monster.Types",Queue);export{Monster,Queue};
diff --git a/packages/monster/dist/modules/types/randomid.js b/packages/monster/dist/modules/types/randomid.js
index 210a4e2eb652987198ec574309fa7546d0a70bf2..8a51b8bbc6ec840e2646150840cc38c01c3841ed 100644
--- a/packages/monster/dist/modules/types/randomid.js
+++ b/packages/monster/dist/modules/types/randomid.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{random}from"../math/random.js";import{assignToNamespace,Monster}from"../namespace.js";import{getGlobal}from"./global.js";import{ID}from"./id.js";let internalCounter=0;class RandomID extends ID{constructor(){super(),internalCounter+=1,this.id=getGlobal().btoa(random(1,1e4)).replace(/=/g,"").replace(/^[0-9]+/,"X")+internalCounter}}assignToNamespace("Monster.Types",RandomID);export{Monster,RandomID};
\ No newline at end of file
+'use strict';import{random}from"../math/random.js";import{assignToNamespace,Monster}from"../namespace.js";import{getGlobal}from"./global.js";import{ID}from"./id.js";let internalCounter=0;class RandomID extends ID{constructor(){super();internalCounter+=1;this.id=getGlobal().btoa(random(1,10000)).replace(/=/g,"").replace(/^[0-9]+/,"X")+internalCounter}}assignToNamespace("Monster.Types",RandomID);export{Monster,RandomID};
diff --git a/packages/monster/dist/modules/types/regex.js b/packages/monster/dist/modules/types/regex.js
index 5c01c07b6d4091a5a4ec0515ee2773fb29252dc0..630aaef9384efbe3298e1663d1f1bcd6badf703c 100644
--- a/packages/monster/dist/modules/types/regex.js
+++ b/packages/monster/dist/modules/types/regex.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{validateString}from"./validate.js";function escapeString(e){return validateString(e).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}assignToNamespace("Monster.Types",escapeString);export{Monster,escapeString};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{validateString}from"./validate.js";function escapeString(value){return validateString(value).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}assignToNamespace("Monster.Types",escapeString);export{Monster,escapeString};
diff --git a/packages/monster/dist/modules/types/stack.js b/packages/monster/dist/modules/types/stack.js
index 202d810960571614c44218928222945336f0f6b1..09597b0ce26a3c8846cd71d54e2472bdf85ac251 100644
--- a/packages/monster/dist/modules/types/stack.js
+++ b/packages/monster/dist/modules/types/stack.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";class Stack extends Base{constructor(){super(),this.data=[]}isEmpty(){return 0===this.data.length}peek(){if(!this.isEmpty())return this.data?.[this.data.length-1]}push(t){return this.data.push(t),this}clear(){return this.data=[],this}pop(){if(!this.isEmpty())return this.data.pop()}}assignToNamespace("Monster.Types",Stack);export{Monster,Stack};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";class Stack extends Base{constructor(){super();this.data=[]}isEmpty(){return this.data.length===0}peek(){if(this.isEmpty()){return undefined}return this.data?.[this.data.length-1]}push(value){this.data.push(value);return this}clear(){this.data=[];return this}pop(){if(this.isEmpty()){return undefined}return this.data.pop()}}assignToNamespace("Monster.Types",Stack);export{Monster,Stack};
diff --git a/packages/monster/dist/modules/types/tokenlist.js b/packages/monster/dist/modules/types/tokenlist.js
index 5b7c55c2c9b59d24334ed101089145f09ebba000..210fb911229bec4b908670c141d293b43d376de0 100644
--- a/packages/monster/dist/modules/types/tokenlist.js
+++ b/packages/monster/dist/modules/types/tokenlist.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isIterable,isString}from"../types/is.js";import{validateFunction,validateString}from"../types/validate.js";import{Base}from"./base.js";class TokenList extends Base{constructor(t){super(),this.tokens=new Set,void 0!==t&&this.add(t)}getIterator(){return this[Symbol.iterator]()}[Symbol.iterator](){let t=0,e=this.entries();return{next:()=>t<e.length?{value:e?.[t++],done:!1}:{done:!0}}}contains(i){if(isString(i)){i=i.trim();let e=0;return i.split(" ").forEach(t=>!1!==this.tokens.has(t.trim())&&void e++),0<e}if(isIterable(i)){let t=0;for(var e of i){if(validateString(e),!1===this.tokens.has(e.trim()))return!1;t++}return 0<t}return!1}add(t){if(isString(t))t.split(" ").forEach(t=>{this.tokens.add(t.trim())});else if(isIterable(t))for(var e of t)validateString(e),this.tokens.add(e.trim());else if(void 0!==t)throw new TypeError("unsupported value");return this}clear(){return this.tokens.clear(),this}remove(t){if(isString(t))t.split(" ").forEach(t=>{this.tokens.delete(t.trim())});else if(isIterable(t))for(var e of t)validateString(e),this.tokens.delete(e.trim());else if(void 0!==t)throw new TypeError("unsupported value","types/tokenlist.js");return this}replace(t,e){if(validateString(t),validateString(e),!this.contains(t))return this;let i=Array.from(this.tokens);t=i.indexOf(t);return-1===t||(i.splice(t,1,e),this.tokens=new Set,this.add(i)),this}toggle(t){if(isString(t))t.split(" ").forEach(t=>{toggleValue.call(this,t)});else if(isIterable(t))for(var e of t)toggleValue.call(this,e);else if(void 0!==t)throw new TypeError("unsupported value","types/tokenlist.js");return this}entries(){return Array.from(this.tokens)}forEach(t){return validateFunction(t),this.tokens.forEach(t),this}toString(){return this.entries().join(" ")}}function toggleValue(t){if(!(this instanceof TokenList))throw Error("must be called with TokenList.call");return validateString(t),t=t.trim(),this.contains(t)?this.remove(t):this.add(t),this}assignToNamespace("Monster.Types",TokenList);export{Monster,TokenList};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{isIterable,isString}from"../types/is.js";import{validateFunction,validateString}from"../types/validate.js";import{Base}from"./base.js";class TokenList extends Base{constructor(init){super();this.tokens=new Set;if(typeof init!=="undefined"){this.add(init)}}getIterator(){return this[Symbol.iterator]()}[Symbol.iterator](){let index=0;let entries=this.entries();return{next:()=>{if(index<entries.length){return{value:entries?.[index++],done:false}}else{return{done:true}}}}}contains(value){if(isString(value)){value=value.trim();let counter=0;value.split(" ").forEach(token=>{if(this.tokens.has(token.trim())===false)return false;counter++});return counter>0?true:false}if(isIterable(value)){let counter=0;for(let token of value){validateString(token);if(this.tokens.has(token.trim())===false)return false;counter++}return counter>0?true:false}return false}add(value){if(isString(value)){value.split(" ").forEach(token=>{this.tokens.add(token.trim())})}else if(isIterable(value)){for(let token of value){validateString(token);this.tokens.add(token.trim())}}else if(typeof value!=="undefined"){throw new TypeError("unsupported value")}return this}clear(){this.tokens.clear();return this}remove(value){if(isString(value)){value.split(" ").forEach(token=>{this.tokens.delete(token.trim())})}else if(isIterable(value)){for(let token of value){validateString(token);this.tokens.delete(token.trim())}}else if(typeof value!=="undefined"){throw new TypeError("unsupported value","types/tokenlist.js")}return this}replace(token,newToken){validateString(token);validateString(newToken);if(!this.contains(token)){return this}let a=Array.from(this.tokens);let i=a.indexOf(token);if(i===-1)return this;a.splice(i,1,newToken);this.tokens=new Set;this.add(a);return this}toggle(value){if(isString(value)){value.split(" ").forEach(token=>{toggleValue.call(this,token)})}else if(isIterable(value)){for(let token of value){toggleValue.call(this,token)}}else if(typeof value!=="undefined"){throw new TypeError("unsupported value","types/tokenlist.js")}return this}entries(){return Array.from(this.tokens)}forEach(callback){validateFunction(callback);this.tokens.forEach(callback);return this}toString(){return this.entries().join(" ")}}function toggleValue(token){if(!(this instanceof TokenList))throw Error("must be called with TokenList.call");validateString(token);token=token.trim();if(this.contains(token)){this.remove(token);return this}this.add(token);return this}assignToNamespace("Monster.Types",TokenList);export{Monster,TokenList};
diff --git a/packages/monster/dist/modules/types/typeof.js b/packages/monster/dist/modules/types/typeof.js
index c3254a8fd549a1022431b55fd5b9dcb7a1627b08..e9aca3c6048bb1dfe01f6671886b8cc7c9a7209c 100644
--- a/packages/monster/dist/modules/types/typeof.js
+++ b/packages/monster/dist/modules/types/typeof.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";function typeOf(t){let e={}.toString.call(t).match(/\s([a-zA-Z]+)/)[1];return"Object"===e&&(t=/^(class|function)\s+(\w+)/.exec(t.constructor.toString()),e=t&&2<t.length?t[2]:""),e.toLowerCase()}assignToNamespace("Monster.Types",typeOf);export{Monster,typeOf};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";function typeOf(value){let type={}.toString.call(value).match(/\s([a-zA-Z]+)/)[1];if("Object"===type){const results=/^(class|function)\s+(\w+)/.exec(value.constructor.toString());type=results&&results.length>2?results[2]:""}return type.toLowerCase()}assignToNamespace("Monster.Types",typeOf);export{Monster,typeOf};
diff --git a/packages/monster/dist/modules/types/uniquequeue.js b/packages/monster/dist/modules/types/uniquequeue.js
index 190bcdff57e47315200fcb17106d8926a998d230..ef9a20ce8a357cf344a911df59c676a5942d20dc 100644
--- a/packages/monster/dist/modules/types/uniquequeue.js
+++ b/packages/monster/dist/modules/types/uniquequeue.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Queue}from"./queue.js";import{validateObject}from"./validate.js";class UniqueQueue extends Queue{constructor(){super(),this.unique=new WeakSet}add(e){return validateObject(e),this.unique.has(e)||(this.unique.add(e),super.add(e)),this}clear(){return super.clear(),this.unique=new WeakSet,this}poll(){var e;if(!this.isEmpty())return e=this.data.shift(),this.unique.delete(e),e}}assignToNamespace("Monster.Types",UniqueQueue);export{Monster,UniqueQueue};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Queue}from"./queue.js";import{validateObject}from"./validate.js";class UniqueQueue extends Queue{constructor(){super();this.unique=new WeakSet}add(value){validateObject(value);if(!this.unique.has(value)){this.unique.add(value);super.add(value)}return this}clear(){super.clear();this.unique=new WeakSet;return this}poll(){if(this.isEmpty()){return undefined}let value=this.data.shift();this.unique.delete(value);return value}}assignToNamespace("Monster.Types",UniqueQueue);export{Monster,UniqueQueue};
diff --git a/packages/monster/dist/modules/types/uuid.js b/packages/monster/dist/modules/types/uuid.js
index 691ada9b17a144e63d863dd05965caf0cd1929ef..b11ab3dab2814bc8f4a8ee84fcf6d715d98ee85a 100644
--- a/packages/monster/dist/modules/types/uuid.js
+++ b/packages/monster/dist/modules/types/uuid.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../constants.js";import{random}from"../math/random.js";import{assignToNamespace,Monster}from"../namespace.js";import{isObject}from"../types/is.js";import{Base}from"./base.js";import{getGlobalObject}from"./global.js";class UUID extends Base{constructor(){super();let t=createWithCrypto();if(void 0===t&&(t=createWithRandom()),void 0===t)throw new Error("unsupported");this[internalSymbol]={value:t}}toString(){return this[internalSymbol].value}}function createWithRandom(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var r=16*random(0,65e3)|0;return("x"===t?r:3&r|8).toString(16)[0]})}function createWithCrypto(){const t=getGlobalObject("crypto");isObject(t)&&t?.randomUUID}assignToNamespace("Monster.Types",UUID);export{Monster,UUID};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../constants.js";import{random}from"../math/random.js";import{assignToNamespace,Monster}from"../namespace.js";import{isObject}from"../types/is.js";import{Base}from"./base.js";import{getGlobalObject}from"./global.js";class UUID extends Base{constructor(){super();let uuid=createWithCrypto();if(uuid===undefined){uuid=createWithRandom()}if(uuid===undefined){throw new Error("unsupported")}this[internalSymbol]={value:uuid}}toString(){return this[internalSymbol]["value"]}}function createWithRandom(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=random(0,65000)*16|0,v=c==="x"?r:r&3|8;return v.toString(16)[0]})}function createWithCrypto(){const crypt=getGlobalObject("crypto");if(!isObject(crypt))return;if(typeof crypt?.["randomUUID"])return;return crypt.randomUUID()}assignToNamespace("Monster.Types",UUID);export{Monster,UUID};
diff --git a/packages/monster/dist/modules/types/validate.js b/packages/monster/dist/modules/types/validate.js
index 071d32004c8733dcc4ff57b3f370e988c91c4654..c3d474762329306d5aea9df9ebc3e064958f825c 100644
--- a/packages/monster/dist/modules/types/validate.js
+++ b/packages/monster/dist/modules/types/validate.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isArray,isBoolean,isFunction,isInstance,isInteger,isIterable,isObject,isPrimitive,isString,isSymbol}from"./is.js";function validateIterable(e){if(!isIterable(e))throw new TypeError("value is not iterable");return e}function validatePrimitive(e){if(!isPrimitive(e))throw new TypeError("value is not a primitive");return e}function validateBoolean(e){if(!isBoolean(e))throw new TypeError("value is not a boolean");return e}function validateString(e){if(!isString(e))throw new TypeError("value is not a string");return e}function validateObject(e){if(!isObject(e))throw new TypeError("value is not a object");return e}function validateInstance(e,i){if(isInstance(e,i))return e;{let e="";throw(isObject(i)||isFunction(i))&&(e=i?.name),e=e&&" "+e,new TypeError("value is not an instance of"+e)}}function validateArray(e){if(!isArray(e))throw new TypeError("value is not an array");return e}function validateSymbol(e){if(!isSymbol(e))throw new TypeError("value is not an symbol");return e}function validateFunction(e){if(!isFunction(e))throw new TypeError("value is not a function");return e}function validateInteger(e){if(!isInteger(e))throw new TypeError("value is not an integer");return e}assignToNamespace("Monster.Types",validatePrimitive,validateBoolean,validateString,validateObject,validateArray,validateFunction,validateIterable,validateInteger);export{Monster,validatePrimitive,validateBoolean,validateString,validateObject,validateInstance,validateArray,validateFunction,validateIterable,validateInteger,validateSymbol};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{isArray,isBoolean,isFunction,isInstance,isInteger,isIterable,isObject,isPrimitive,isString,isSymbol}from"./is.js";function validateIterable(value){if(!isIterable(value)){throw new TypeError("value is not iterable")}return value}function validatePrimitive(value){if(!isPrimitive(value)){throw new TypeError("value is not a primitive")}return value}function validateBoolean(value){if(!isBoolean(value)){throw new TypeError("value is not a boolean")}return value}function validateString(value){if(!isString(value)){throw new TypeError("value is not a string")}return value}function validateObject(value){if(!isObject(value)){throw new TypeError("value is not a object")}return value}function validateInstance(value,instance){if(!isInstance(value,instance)){let n="";if(isObject(instance)||isFunction(instance)){n=instance?.["name"]}if(n){n=" "+n}throw new TypeError("value is not an instance of"+n)}return value}function validateArray(value){if(!isArray(value)){throw new TypeError("value is not an array")}return value}function validateSymbol(value){if(!isSymbol(value)){throw new TypeError("value is not an symbol")}return value}function validateFunction(value){if(!isFunction(value)){throw new TypeError("value is not a function")}return value}function validateInteger(value){if(!isInteger(value)){throw new TypeError("value is not an integer")}return value}assignToNamespace("Monster.Types",validatePrimitive,validateBoolean,validateString,validateObject,validateArray,validateFunction,validateIterable,validateInteger);export{Monster,validatePrimitive,validateBoolean,validateString,validateObject,validateInstance,validateArray,validateFunction,validateIterable,validateInteger,validateSymbol};
diff --git a/packages/monster/dist/modules/types/version.js b/packages/monster/dist/modules/types/version.js
index 2771c375a343f73025d09833b98c5995f537c4d7..92b9d545b2b8506f8a04701ae6b2856aa42394ca 100644
--- a/packages/monster/dist/modules/types/version.js
+++ b/packages/monster/dist/modules/types/version.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";class Version extends Base{constructor(r,t,e){var s;if(super(),"string"==typeof r&&void 0===t&&void 0===e&&(s=r.toString().split("."),r=parseInt(s[0]||0),t=parseInt(s[1]||0),e=parseInt(s[2]||0)),void 0===r)throw new Error("major version is undefined");if(void 0===t&&(t=0),void 0===e&&(e=0),this.major=parseInt(r),this.minor=parseInt(t),this.patch=parseInt(e),isNaN(this.major))throw new Error("major is not a number");if(isNaN(this.minor))throw new Error("minor is not a number");if(isNaN(this.patch))throw new Error("patch is not a number")}toString(){return this.major+"."+this.minor+"."+this.patch}compareTo(r){if("string"!=typeof(r=r instanceof Version?r.toString():r))throw new Error("type exception");if(r===this.toString())return 0;var t=[this.major,this.minor,this.patch],e=r.split("."),s=Math.max(t.length,e.length);for(let r=0;r<s;r+=1){if(t[r]&&!e[r]&&0<parseInt(t[r])||parseInt(t[r])>parseInt(e[r]))return 1;if(e[r]&&!t[r]&&0<parseInt(e[r])||parseInt(t[r])<parseInt(e[r]))return-1}return 0}}assignToNamespace("Monster.Types",Version);let monsterVersion;function getVersion(){return monsterVersion instanceof Version||(monsterVersion=new Version("1.30.1")),monsterVersion}assignToNamespace("Monster",getVersion);export{Monster,Version,getVersion};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"./base.js";class Version extends Base{constructor(major,minor,patch){super();if(typeof major==="string"&&minor===undefined&&patch===undefined){let parts=major.toString().split(".");major=parseInt(parts[0]||0);minor=parseInt(parts[1]||0);patch=parseInt(parts[2]||0)}if(major===undefined){throw new Error("major version is undefined")}if(minor===undefined){minor=0}if(patch===undefined){patch=0}this.major=parseInt(major);this.minor=parseInt(minor);this.patch=parseInt(patch);if(isNaN(this.major)){throw new Error("major is not a number")}if(isNaN(this.minor)){throw new Error("minor is not a number")}if(isNaN(this.patch)){throw new Error("patch is not a number")}}toString(){return this.major+"."+this.minor+"."+this.patch}compareTo(version){if(version instanceof Version){version=version.toString()}if(typeof version!=="string"){throw new Error("type exception")}if(version===this.toString()){return 0}let a=[this.major,this.minor,this.patch];let b=version.split(".");let len=Math.max(a.length,b.length);for(let i=0;i<len;i+=1){if(a[i]&&!b[i]&&parseInt(a[i])>0||parseInt(a[i])>parseInt(b[i])){return 1}else if(b[i]&&!a[i]&&parseInt(b[i])>0||parseInt(a[i])<parseInt(b[i])){return-1}}return 0}}assignToNamespace("Monster.Types",Version);let monsterVersion;function getVersion(){if(monsterVersion instanceof Version){return monsterVersion}monsterVersion=new Version("1.30.1");return monsterVersion}assignToNamespace("Monster",getVersion);export{Monster,Version,getVersion};
diff --git a/packages/monster/dist/modules/util/clone.js b/packages/monster/dist/modules/util/clone.js
index 9ab1ca5a78c38b9b48805abc515eefbb7d0427a8..5be32bd6867caed8f20dd9fd45684a522489d720 100644
--- a/packages/monster/dist/modules/util/clone.js
+++ b/packages/monster/dist/modules/util/clone.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{getGlobal}from"../types/global.js";import{isArray,isFunction,isObject,isPrimitive}from"../types/is.js";import{typeOf}from"../types/typeof.js";import{validateObject}from"../types/validate.js";function clone(t){if(null===t)return t;if(isPrimitive(t))return t;if(isFunction(t))return t;if(isArray(t)){let e=[];for(var n=0,o=t.length;n<o;n++)e[n]=clone(t[n]);return e}if(isObject(t)){if(t instanceof Date){let e=new Date;return e.setTime(t.getTime()),e}if("undefined"!=typeof Element&&t instanceof Element)return t;if("undefined"!=typeof HTMLDocument&&t instanceof HTMLDocument)return t;if("undefined"!=typeof DocumentFragment&&t instanceof DocumentFragment)return t;if(t===getGlobal())return t;if("undefined"!=typeof globalContext&&t===globalContext)return t;if("undefined"!=typeof window&&t===window)return t;if("undefined"!=typeof document&&t===document)return t;if("undefined"!=typeof navigator&&t===navigator)return t;if("undefined"!=typeof JSON&&t===JSON)return t;try{if(t instanceof Proxy)return t}catch(e){}return cloneObject(t)}throw new Error("unable to clone obj! its type isn't supported.")}function cloneObject(e){validateObject(e);var t,n=e?.constructor;if("function"===typeOf(n)){const r=n?.prototype;if("object"==typeof r&&r.hasOwnProperty("getClone")&&"function"===typeOf(e.getClone))return e.getClone()}let o={};for(t in"function"==typeof e.constructor&&"function"==typeof e.constructor.call&&(o=new e.constructor),e)e.hasOwnProperty(t)&&(isPrimitive(e[t])?o[t]=e[t]:o[t]=clone(e[t]));return o}assignToNamespace("Monster.Util",clone);export{Monster,clone};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{getGlobal}from"../types/global.js";import{isArray,isFunction,isObject,isPrimitive}from"../types/is.js";import{typeOf}from"../types/typeof.js";import{validateObject}from"../types/validate.js";function clone(obj){if(null===obj){return obj}if(isPrimitive(obj)){return obj}if(isFunction(obj)){return obj}if(isArray(obj)){let copy=[];for(var i=0,len=obj.length;i<len;i++){copy[i]=clone(obj[i])}return copy}if(isObject(obj)){if(obj instanceof Date){let copy=new Date;copy.setTime(obj.getTime());return copy}if(typeof Element!=="undefined"&&obj instanceof Element)return obj;if(typeof HTMLDocument!=="undefined"&&obj instanceof HTMLDocument)return obj;if(typeof DocumentFragment!=="undefined"&&obj instanceof DocumentFragment)return obj;if(obj===getGlobal())return obj;if(typeof globalContext!=="undefined"&&obj===globalContext)return obj;if(typeof window!=="undefined"&&obj===window)return obj;if(typeof document!=="undefined"&&obj===document)return obj;if(typeof navigator!=="undefined"&&obj===navigator)return obj;if(typeof JSON!=="undefined"&&obj===JSON)return obj;try{if(obj instanceof Proxy){return obj}}catch(e){}return cloneObject(obj)}throw new Error("unable to clone obj! its type isn't supported.")}function cloneObject(obj){validateObject(obj);const constructor=obj?.["constructor"];if(typeOf(constructor)==="function"){const prototype=constructor?.prototype;if(typeof prototype==="object"){if(prototype.hasOwnProperty("getClone")&&typeOf(obj.getClone)==="function"){return obj.getClone()}}}let copy={};if(typeof obj.constructor==="function"&&typeof obj.constructor.call==="function"){copy=new obj.constructor}for(let key in obj){if(!obj.hasOwnProperty(key)){continue}if(isPrimitive(obj[key])){copy[key]=obj[key];continue}copy[key]=clone(obj[key])}return copy}assignToNamespace("Monster.Util",clone);export{Monster,clone};
diff --git a/packages/monster/dist/modules/util/comparator.js b/packages/monster/dist/modules/util/comparator.js
index 62f3a33723096eaefbcfdf375df1116252520eb2..5362a55a1d21184168ff0c93893a17d56156f9d0 100644
--- a/packages/monster/dist/modules/util/comparator.js
+++ b/packages/monster/dist/modules/util/comparator.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{isFunction}from"../types/is.js";class Comparator extends Base{constructor(r){if(super(),isFunction(r))this.compare=r;else{if(void 0!==r)throw new TypeError("unsupported type");this.compare=function(r,e){if(typeof r!=typeof e)throw new TypeError("impractical comparison","types/comparator.js");return r===e?0:r<e?-1:1}}}reverse(){const s=this.compare;return this.compare=(r,e)=>s(e,r),this}equal(r,e){return 0===this.compare(r,e)}greaterThan(r,e){return 0<this.compare(r,e)}greaterThanOrEqual(r,e){return this.greaterThan(r,e)||this.equal(r,e)}lessThanOrEqual(r,e){return this.lessThan(r,e)||this.equal(r,e)}lessThan(r,e){return this.compare(r,e)<0}}assignToNamespace("Monster.Util",Comparator);export{Monster,Comparator};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{isFunction}from"../types/is.js";class Comparator extends Base{constructor(callback){super();if(isFunction(callback)){this.compare=callback}else if(callback!==undefined){throw new TypeError("unsupported type")}else{this.compare=function(a,b){if(typeof a!==typeof b){throw new TypeError("impractical comparison","types/comparator.js")}if(a===b){return 0}return a<b?-1:1}}}reverse(){const original=this.compare;this.compare=(a,b)=>original(b,a);return this}equal(a,b){return this.compare(a,b)===0}greaterThan(a,b){return this.compare(a,b)>0}greaterThanOrEqual(a,b){return this.greaterThan(a,b)||this.equal(a,b)}lessThanOrEqual(a,b){return this.lessThan(a,b)||this.equal(a,b)}lessThan(a,b){return this.compare(a,b)<0}}assignToNamespace("Monster.Util",Comparator);export{Monster,Comparator};
diff --git a/packages/monster/dist/modules/util/deadmansswitch.js b/packages/monster/dist/modules/util/deadmansswitch.js
index c90a90a78c0f210d8d808aa99d9eda44540732e4..516d5d144f1dbc5d9d1bb0e1dd6a82f1c1b35e38 100644
--- a/packages/monster/dist/modules/util/deadmansswitch.js
+++ b/packages/monster/dist/modules/util/deadmansswitch.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../constants.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{isInteger}from"../types/is.js";import{validateFunction,validateInteger}from"../types/validate.js";class DeadMansSwitch extends Base{constructor(t,e){super(),init.call(this,validateInteger(t),validateFunction(e))}touch(t){if(!0===this[internalSymbol].isAlreadyRun)throw new Error("has already run");if(isInteger(t))this[internalSymbol].delay=t;else if(void 0!==t)throw new Error("unsupported argument");return clearTimeout(this[internalSymbol].timer),initCallback.call(this),this}}function initCallback(){const t=this;t[internalSymbol].timer=setTimeout(()=>{t[internalSymbol].isAlreadyRun=!0,t[internalSymbol].callback()},t[internalSymbol].delay)}function init(t,e){this[internalSymbol]={callback:e,delay:t,isAlreadyRun:!1,timer:void 0},initCallback.call(this)}assignToNamespace("Monster.Util",DeadMansSwitch);export{Monster,DeadMansSwitch};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../constants.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{isInteger}from"../types/is.js";import{validateFunction,validateInteger}from"../types/validate.js";class DeadMansSwitch extends Base{constructor(delay,callback){super();init.call(this,validateInteger(delay),validateFunction(callback))}touch(delay){if(this[internalSymbol]["isAlreadyRun"]===true){throw new Error("has already run")}if(isInteger(delay)){this[internalSymbol]["delay"]=delay}else if(delay!==undefined){throw new Error("unsupported argument")}clearTimeout(this[internalSymbol]["timer"]);initCallback.call(this);return this}}function initCallback(){const self=this;self[internalSymbol]["timer"]=setTimeout(()=>{self[internalSymbol]["isAlreadyRun"]=true;self[internalSymbol]["callback"]()},self[internalSymbol]["delay"])}function init(delay,callback){const self=this;self[internalSymbol]={callback,delay,isAlreadyRun:false,timer:undefined};initCallback.call(self)}assignToNamespace("Monster.Util",DeadMansSwitch);export{Monster,DeadMansSwitch};
diff --git a/packages/monster/dist/modules/util/freeze.js b/packages/monster/dist/modules/util/freeze.js
index ec46ea3191e784d27b0fc317a7d26042d68bf19f..f1d2e8ec8a0b5ffa85413f50a6b99bdf4feaa820 100644
--- a/packages/monster/dist/modules/util/freeze.js
+++ b/packages/monster/dist/modules/util/freeze.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{validateObject}from"../types/validate.js";function deepFreeze(e){var t;validateObject(e);for(t of Object.getOwnPropertyNames(e)){var r=e[t];e[t]=r&&"object"==typeof r?deepFreeze(r):r}return Object.freeze(e)}assignToNamespace("Monster.Util",deepFreeze);export{Monster,deepFreeze};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{validateObject}from"../types/validate.js";function deepFreeze(object){validateObject(object);var propNames=Object.getOwnPropertyNames(object);for(let name of propNames){let value=object[name];object[name]=value&&typeof value==="object"?deepFreeze(value):value}return Object.freeze(object)}assignToNamespace("Monster.Util",deepFreeze);export{Monster,deepFreeze};
diff --git a/packages/monster/dist/modules/util/namespace.js b/packages/monster/dist/modules/util/namespace.js
index 296df603cc858fc53a4bbdbd83e63ebab5a30adc..94d6d7519bb15f3f67347bd1502e501ab7af5bd2 100644
--- a/packages/monster/dist/modules/util/namespace.js
+++ b/packages/monster/dist/modules/util/namespace.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";const namespace="Monster.Util";export{namespace};
\ No newline at end of file
+'use strict';export const namespace="Monster.Util";
diff --git a/packages/monster/dist/modules/util/processing.js b/packages/monster/dist/modules/util/processing.js
index baa626bf415a3c032c3351039f2d3c5b19f8669a..d4d398271e6d4de36e6dacb70d9fc109720dd86d 100644
--- a/packages/monster/dist/modules/util/processing.js
+++ b/packages/monster/dist/modules/util/processing.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{internalSymbol}from"../constants.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{getGlobalFunction}from"../types/global.js";import{isFunction,isInteger}from"../types/is.js";import{Queue}from"../types/queue.js";import{validateFunction,validateInteger}from"../types/validate.js";class Callback{constructor(e,t){this[internalSymbol]={callback:validateFunction(e),time:validateInteger(t??0)}}run(s){const n=this;return new Promise((e,t)=>{getGlobalFunction("setTimeout")(()=>{try{e(n[internalSymbol].callback(s))}catch(e){t(e)}},n[internalSymbol].time)})}}class Processing extends Base{constructor(){super(),this[internalSymbol]={queue:new Queue};let e=0;for(var[,t]of Object.entries(arguments))if(isInteger(t)&&0<=t)e=t;else{if(!isFunction(t))throw new TypeError("the arguments must be either integer or functions");this[internalSymbol].queue.add(new Callback(t,e))}}add(e,t){return this[internalSymbol].queue.add(new Callback(e,t)),this}run(e){const t=this;return this[internalSymbol].queue.isEmpty()?Promise.resolve(e):this[internalSymbol].queue.poll().run(e).then(e=>t.run(e))}}assignToNamespace("Monster.Util",Processing);export{Monster,Processing};
\ No newline at end of file
+'use strict';import{internalSymbol}from"../constants.js";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";import{getGlobalFunction}from"../types/global.js";import{isFunction,isInteger}from"../types/is.js";import{Queue}from"../types/queue.js";import{validateFunction,validateInteger}from"../types/validate.js";class Callback{constructor(callback,time){this[internalSymbol]={callback:validateFunction(callback),time:validateInteger(time??0)}}run(data){const self=this;return new Promise((resolve,reject)=>{getGlobalFunction("setTimeout")(()=>{try{resolve(self[internalSymbol].callback(data))}catch(e){reject(e)}},self[internalSymbol].time)})}}class Processing extends Base{constructor(){super();this[internalSymbol]={queue:new Queue};let time=0;for(const[,arg]of Object.entries(arguments)){if(isInteger(arg)&&arg>=0){time=arg}else if(isFunction(arg)){this[internalSymbol].queue.add(new Callback(arg,time))}else{throw new TypeError("the arguments must be either integer or functions")}}}add(callback,time){this[internalSymbol].queue.add(new Callback(callback,time));return this}run(data){const self=this;if(this[internalSymbol].queue.isEmpty()){return Promise.resolve(data)}return this[internalSymbol].queue.poll().run(data).then(result=>{return self.run(result)})}}assignToNamespace("Monster.Util",Processing);export{Monster,Processing};
diff --git a/packages/monster/dist/modules/util/trimspaces.js b/packages/monster/dist/modules/util/trimspaces.js
index a2451d08e4e4fda9e6c131265415186ee1b3dcc2..d6153c622fa2ed34561fa91e9b8809694b271b68 100644
--- a/packages/monster/dist/modules/util/trimspaces.js
+++ b/packages/monster/dist/modules/util/trimspaces.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{ID}from"../types/id.js";import{isObject}from"../types/is.js";import{validateString}from"../types/validate.js";function trimSpaces(r){validateString(r);let t=new Map;var e;for(e of r.matchAll(/((?<pattern>\\(?<char>.)){1})/gim)){var a,s,i=e?.groups;isObject(i)&&(a=i?.pattern,i=i?.char,a&&i&&(s="__"+(new ID).toString()+"__",t.set(s,i),r=r.replace(a,s)))}return r=r.trim(),t.forEach((t,e)=>{r=r.replace(e,"\\"+t)}),r}assignToNamespace("Monster.Util",trimSpaces);export{Monster,trimSpaces};
\ No newline at end of file
+'use strict';import{assignToNamespace,Monster}from"../namespace.js";import{ID}from"../types/id.js";import{isObject}from"../types/is.js";import{validateString}from"../types/validate.js";function trimSpaces(value){validateString(value);let placeholder=new Map;const regex=/((?<pattern>\\(?<char>.)){1})/mig;let result=value.matchAll(regex);for(let m of result){let g=m?.["groups"];if(!isObject(g)){continue}let p=g?.["pattern"];let c=g?.["char"];if(p&&c){let r="__"+new ID().toString()+"__";placeholder.set(r,c);value=value.replace(p,r)}}value=value.trim();placeholder.forEach((v,k)=>{value=value.replace(k,"\\"+v)});return value}assignToNamespace("Monster.Util",trimSpaces);export{Monster,trimSpaces};
diff --git a/packages/monster/dist/monster.dev.js b/packages/monster/dist/monster.dev.js
index 0b391c156499a12a88a3ac6bb42a1277c8ea377c..3425c72e3810d3c952da226ff30be694f0847944 100644
--- a/packages/monster/dist/monster.dev.js
+++ b/packages/monster/dist/monster.dev.js
@@ -176,7 +176,7 @@ function assignToNamespace(ns) {
 }
 /**
  *
- * @param {class|function} fn
+ * @param {class|function|object} obj
  * @returns {string}
  * @private
  * @throws {Error} the name of the class or function cannot be resolved.
@@ -185,18 +185,18 @@ function assignToNamespace(ns) {
  */
 
 
-function objectName(fn) {
+function objectName(obj) {
   try {
-    if (typeof fn !== 'function') {
+    if (typeof obj !== 'function') {
       throw new Error("the first argument is not a function or class.");
     }
 
-    if (fn.hasOwnProperty('name')) {
-      return fn.name;
+    if (obj.hasOwnProperty('name')) {
+      return obj.name;
     }
 
-    if ("function" === typeof fn.toString) {
-      var s = fn.toString();
+    if ("function" === typeof obj.toString) {
+      var s = obj.toString();
       var f = s.match(/^\s*function\s+([^\s(]+)/);
 
       if (Array.isArray(f) && typeof f[1] === 'string') {
@@ -8541,7 +8541,7 @@ var CustomElement = /*#__PURE__*/function (_HTMLElement) {
      * }
      * ```
      *
-     * to set the options via the html tag the attribute data-monster-options must be set.
+     * To set the options via the html tag the attribute data-monster-options must be set.
      * As value a JSON object with the desired values must be defined.
      *
      * Since 1.18.0 the JSON can be specified as a DataURI.
@@ -8568,6 +8568,7 @@ var CustomElement = /*#__PURE__*/function (_HTMLElement) {
      * </script>
      * ```
      *
+     * The individual configuration values can be found in the table.
      *
      * @property {boolean} disabled=false Object The Boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form.
      * @property {string} shadowMode=open `open` Elements of the shadow root are accessible from JavaScript outside the root, for example using. `close` Denies access to the node(s) of a closed shadow root from JavaScript outside it
diff --git a/packages/monster/dist/monster.dev.js.map b/packages/monster/dist/monster.dev.js.map
index 73222b5af967190d8e1567aa5d9433b9efdac5bc..06047492d0269ab54650aac779684fad1611e1b3 100644
--- a/packages/monster/dist/monster.dev.js.map
+++ b/packages/monster/dist/monster.dev.js.map
@@ -1 +1 @@
-{"version":3,"file":"monster.dev.js","mappings":"AAAA;AACA;AACA;AAC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OAAd,CAAsBZ,KAAtB,CAAD,EAA+B,KAAKQ,QAAL,CAAcI,OAAd,CAAsBZ,KAAtB,CAA/B,CAAZ,CAAP;AACH;;;;EAVqBM;;AAc1B9B,gEAAiB,CAAC,qBAAD,EAAwBkC,WAAxB,CAAjB;;;;;;;;;;;;;;ACrEa;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMG;;;;;;;;;;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACI,qBAAQb,KAAR,EAAe;AACX,aAAOC,OAAO,CAACC,MAAR,CAAeF,KAAf,CAAP;AACH;;;;EAViBD;;AActBvB,gEAAiB,CAAC,qBAAD,EAAwBqC,OAAxB,CAAjB;;;;;;;;;;;;;;;AC7Da;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMC;;;;;;;;;;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACI,qBAAQd,KAAR,EAAe;AACX,UAAIR,qDAAO,CAACQ,KAAD,CAAX,EAAoB;AAChB,eAAOC,OAAO,CAACc,OAAR,CAAgBf,KAAhB,CAAP;AACH;;AAED,aAAOC,OAAO,CAACC,MAAR,CAAeF,KAAf,CAAP;AACH;;;;EAdiBD;;AAkBtBvB,gEAAiB,CAAC,qBAAD,EAAwBsC,OAAxB,CAAjB;;;;;;;;;;;;;;;;;;;;;;ACrEa;AAEb;AACA;AACA;;;;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASE,UAAT,CAAoBhB,KAApB,EAA2B;AACvB,MAAIA,KAAK,KAAK3B,SAAd,EAAyB,OAAO,KAAP;AACzB,MAAI2B,KAAK,KAAK,IAAd,EAAoB,OAAO,KAAP;AACpB,SAAO,QAAOA,KAAP,aAAOA,KAAP,uBAAOA,KAAK,CAAG/B,MAAM,CAACgD,QAAV,CAAZ,MAAoC,UAA3C;AACH;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,WAAT,CAAqBlB,KAArB,EAA4B;AACxB,MAAImB,IAAJ;;AAEA,MAAInB,KAAK,KAAK3B,SAAV,IAAuB2B,KAAK,KAAK,IAArC,EAA2C;AACvC,WAAO,IAAP;AACH;;AAEDmB,EAAAA,IAAI,WAAUnB,KAAV,CAAJ;;AAEA,MAAImB,IAAI,KAAK,QAAT,IAAqBA,IAAI,KAAK,QAA9B,IAA0CA,IAAI,KAAK,SAAnD,IAAgEA,IAAI,KAAK,QAA7E,EAAuF;AACnF,WAAO,IAAP;AACH;;AAED,SAAO,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,QAAT,CAAkBpB,KAAlB,EAAyB;AACrB,SAAQ,qBAAoBA,KAApB,CAAD,GAA8B,IAA9B,GAAqC,KAA5C;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASqB,SAAT,CAAmBrB,KAAnB,EAA0B;AAEtB,MAAIA,KAAK,KAAK,IAAV,IAAkBA,KAAK,KAAK,KAAhC,EAAuC;AACnC,WAAO,IAAP;AACH;;AAED,SAAO,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASsB,QAAT,CAAkBtB,KAAlB,EAAyB;AACrB,MAAIA,KAAK,KAAK3B,SAAV,IAAuB,OAAO2B,KAAP,KAAiB,QAA5C,EAAsD;AAClD,WAAO,KAAP;AACH;;AACD,SAAO,IAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASuB,QAAT,CAAkBvB,KAAlB,EAAyB;AAErB,MAAIR,OAAO,CAACQ,KAAD,CAAX,EAAoB,OAAO,KAAP;AACpB,MAAIkB,WAAW,CAAClB,KAAD,CAAf,EAAwB,OAAO,KAAP;;AAExB,MAAI,QAAOA,KAAP,MAAiB,QAArB,EAA+B;AAC3B,WAAO,IAAP;AACH;;AAED,SAAO,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASwB,UAAT,CAAoBxB,KAApB,EAA2ByB,QAA3B,EAAqC;AAEjC,MAAI,CAACF,QAAQ,CAACvB,KAAD,CAAb,EAAsB,OAAO,KAAP;AACtB,MAAI,CAAC0B,UAAU,CAACD,QAAD,CAAf,EAA2B,OAAO,KAAP;AAC3B,MAAI,CAACA,QAAQ,CAACxC,cAAT,CAAwB,WAAxB,CAAL,EAA2C,OAAO,KAAP;AAC3C,SAAQe,KAAK,YAAYyB,QAAlB,GAA8B,IAA9B,GAAqC,KAA5C;AAEH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASjC,OAAT,CAAiBQ,KAAjB,EAAwB;AACpB,SAAOT,KAAK,CAACC,OAAN,CAAcQ,KAAd,CAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS0B,UAAT,CAAoB1B,KAApB,EAA2B;AACvB,MAAIR,OAAO,CAACQ,KAAD,CAAX,EAAoB,OAAO,KAAP;AACpB,MAAIkB,WAAW,CAAClB,KAAD,CAAf,EAAwB,OAAO,KAAP;;AAExB,MAAI,OAAOA,KAAP,KAAiB,UAArB,EAAiC;AAC7B,WAAO,IAAP;AACH;;AAED,SAAO,KAAP;AAEH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS2B,SAAT,CAAmB3B,KAAnB,EAA0B;AACtB,SAAO4B,MAAM,CAACD,SAAP,CAAiB3B,KAAjB,CAAP;AACH;;AAGDxB,gEAAiB,CAAC,eAAD,EAAkB0C,WAAlB,EAA+BG,SAA/B,EAA0CC,QAA1C,EAAoDC,QAApD,EAA8D/B,OAA9D,EAAuEkC,UAAvE,EAAmFV,UAAnF,EAA+FW,SAA/F,EAA0GP,QAA1G,CAAjB;;;;;;;;;;;;;;;AC/Za;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMS;;;;;;;;;;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACI,qBAAQ7B,KAAR,EAAe;AACX,UAAIuB,sDAAQ,CAACvB,KAAD,CAAZ,EAAqB;AACjB,eAAOC,OAAO,CAACc,OAAR,CAAgBf,KAAhB,CAAP;AACH;;AAED,aAAOC,OAAO,CAACC,MAAR,CAAeF,KAAf,CAAP;AACH;;;;EAdkBD;;AAkBvBvB,gEAAiB,CAAC,qBAAD,EAAwBqD,QAAxB,CAAjB;;;;;;;;;;;;;;ACtEa;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMC;;;;;;;;;;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACI,qBAAQ9B,KAAR,EAAe;AACX,UAAI+B,IAAI,GAAG,IAAX;AAEA,aA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;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;;AACO,IAAMM,MAAM,GAAG,GAAf;AAGP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,QAAT,CAAkBC,OAAlB,EAA2BC,QAA3B,EAAqCC,aAArC,EAAoDC,WAApD,EAAiEC,MAAjE,EAAyE;AACrE,SAAOC,aAAa,CAACL,OAAD,EAAUC,QAAV,EAAoBG,MAApB,EAA4B,UAAUE,CAAV,EAAaC,CAAb,EAAgBC,CAAhB,EAAmB;AAC/DD,IAAAA,CAAC,GAAGE,KAAK,CAACH,CAAD,EAAIH,WAAJ,EAAiBI,CAAjB,CAAT;AACAD,IAAAA,CAAC,GAAGG,KAAK,CAACH,CAAD,EAAIJ,aAAJ,CAAT;AACA,SAAKQ,GAAL,CAASH,CAAT,EAAYD,CAAZ;AACH,GAJmB,CAApB;AAMH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASD,aAAT,CAAuBL,OAAvB,EAAgCC,QAAhC,EAA0CG,MAA1C,EAAkDO,QAAlD,EAA4D;AAExD,MAAMC,MAAM,GAAG,IAAIC,GAAJ,EA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iBb,SAAS,KAAK1F,SAAnC,EAA8C;AAC1CuG,YAAAA,GAAG,CAAClC,MAAD,CAAH,GAAcqB,SAAd;AACH;;AAEDC,UAAAA,UAAU,CAACV,GAAX,CAAeqB,EAAf,EAAmBC,GAAnB;AA3BkB;;AAYtB,4DAA0B;AAAA;AAgBzB;AA5BqB;AAAA;AAAA;AAAA;AAAA;AA8BzB;AAGJ,GAtCD,QAsCSjF,KAAK,CAACE,MAAN,GAAe,CAtCxB,EAXqD,CAmDrD;;;AACA,MAAIoE,YAAY,KAAKT,MAAM,CAACU,IAA5B,EAAkC;AAAA,gDACTF,UADS;AAAA;;AAAA;AAC9B,6DAAiC;AAAA;AAAA,YAArBb,CAAqB;AAAA,YAAlBsB,CAAkB;;AAC7BjB,QAAAA,MAAM,CAACF,GAAP,CAAWH,CAAX,EAAcsB,CAAd;AACH;AAH6B;AAAA;AAAA;AAAA;AAAA;AAIjC;;AAED,SAAO7B,OAAP;AAEH;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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;;;;;;;;;;;;;;;;;;;;;;AC/aa;AAEb;AACA;AACA;;AAEA;AACA;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAAS2C,gBAAT,CAA0BtF,KAA1B,EAAiC;AAC7B,MAAI,CAACgB,kDAAU,CAAChB,KAAD,CAAf,EAAwB;AACpB,UAAM,IAAIS,SAAJ,CAAc,uBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASuF,iBAAT,CAA2BvF,KAA3B,EAAkC;AAC9B,MAAI,CAACkB,mDAAW,CAAClB,KAAD,CAAhB,EAAyB;AACrB,UAAM,IAAIS,SAAJ,CAAc,0BAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASwF,eAAT,CAAyBxF,KAAzB,EAAgC;AAC5B,MAAI,CAACqB,iDAAS,CAACrB,KAAD,CAAd,EAAuB;AACnB,UAAM,IAAIS,SAAJ,CAAc,wBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASqC,cAAT,CAAwBrC,KAAxB,EAA+B;AAC3B,MAAI,CAACsB,gDAAQ,CAACtB,KAAD,CAAb,EAAsB;AAClB,UAAM,IAAIS,SAAJ,CAAc,uBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASyF,cAAT,CAAwBzF,KAAxB,EAA+B;AAC3B,MAAI,CAACuB,gDAAQ,CAACvB,KAAD,CAAb,EAAsB;AAClB,UAAM,IAAIS,SAAJ,CAAc,uBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS0F,gBAAT,CAA0B1F,KAA1B,EAAiCyB,QAAjC,EAA2C;AACvC,MAAI,CAACD,kDAAU,CAACxB,KAAD,EAAQyB,QAAR,CAAf,EAAkC;AAC9B,QAAIkE,CAAC,GAAG,EAAR;;AACA,QAAIpE,gDAAQ,CAACE,QAAD,CAAR,IAAsBC,kDAAU,CAACD,QAAD,CAApC,EAAgD;AAC5CkE,MAAAA,CAAC,GAAGlE,QAAH,aAAGA,QAAH,uBAAGA,QAAQ,CAAG,MAAH,CAAZ;AACH;;AAED,QAAIkE,CAAJ,EAAO;AACHA,MAAAA,CAAC,GAAG,MAAMA,CAAV;AACH;;AAED,UAAM,IAAIlF,SAAJ,CAAc,gCAAgCkF,CAA9C,CAAN;AACH;;AACD,SAAO3F,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS4F,aAAT,CAAuB5F,KAAvB,EAA8B;AAC1B,MAAI,CAACR,+CAAO,CAACQ,KAAD,CAAZ,EAAqB;AACjB,UAAM,IAAIS,SAAJ,CAAc,uBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS6F,cAAT,CAAwB7F,KAAxB,EAA+B;AAC3B,MAAI,CAACoB,gDAAQ,CAACpB,KAAD,CAAb,EAAsB;AAClB,UAAM,IAAIS,SAAJ,CAAc,wBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS8F,gBAAT,CAA0B9F,KAA1B,EAAiC;AAC7B,MAAI,CAAC0B,kDAAU,CAAC1B,KAAD,CAAf,EAAwB;AACpB,UAAM,IAAIS,SAAJ,CAAc,yBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS+F,eAAT,CAAyB/F,KAAzB,EAAgC;AAC5B,MAAI,CAAC2B,iDAAS,CAAC3B,KAAD,CAAd,EAAuB;AACnB,UAAM,IAAIS,SAAJ,CAAc,yBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;;AAEDxB,gEAAiB,CAAC,eAAD,EAAk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A9B,CAAmC9H,KAAK,CAACiH,WAAN,CAAkB9H,QAAlB,EAAnC,CAAhB;AACAgC,IAAAA,IAAI,GAAI0G,OAAO,IAAIA,OAAO,CAAChI,MAAR,GAAiB,CAA7B,GAAkCgI,OAAO,CAAC,CAAD,CAAzC,GAA+C,EAAtD;AACH;;AACD,SAAO1G,IAAI,CAAC4G,WAAL,EAAP;AACH;;AAEDvJ,gEAAiB,CAAC,eAAD,EAAkByH,MAAlB,CAAjB;;;;;;;;;;;;;;;;;;;AC1Da;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAM1D,SAAS,GAAG,GAAlB;AAEP;AACA;AACA;AACA;;AACO,IAAME,QAAQ,GAAG,GAAjB;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMD;;;;;AAEF;AACJ;AACA;AACA;AACA;AACI,sBAAYyF,MAAZ,EAAoB;AAAA;;AAAA;;AAChB;;AAEA,QAAI/G,yDAAW,CAAC+G,MAAD,CAAf,EAAyB;AACrB,YAAM,IAAI3J,KAAJ,CAAU,yCAAV,CAAN;AACH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oB;AAChB,eAAOlL,SAAP;AACH;;AAED,2BAAO,KAAKuL,IAAZ,+CAAO,WAAY,KAAKA,IAAL,CAAU/J,MAAV,GAAmB,CAA/B,CAAP;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,cAAKG,KAAL,EAAY;AACR,WAAK4J,IAAL,CAAUvF,IAAV,CAAerE,KAAf;AACA,aAAO,IAAP;AACH;AAED;AACJ;AACA;AACA;AACA;;;;WACI,iBAAQ;AACJ,WAAK4J,IAAL,GAAY,EAAZ;AACA,aAAO,IAAP;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;;;;WACI,eAAM;AACF,UAAI,KAAKL,OAAL,EAAJ,EAAoB;AAChB,eAAOlL,SAAP;AACH;;AACD,aAAO,KAAKuL,IAAL,CAAUR,GAAV,EAAP;AACH;;;;EAhEetJ;;AAqEpBtB,gEAAiB,CAAC,eAAD,EAAkBwJ,KAAlB,CAAjB;;;;;;;;;;;;;;;ACrGa;AAEb;AACA;AACA;;;;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAAS6B,IAAT,CAAcC,KAAd,EAAqBC,MAArB,EAA6B;AACzB,SAAOC,MAAM,CAACF,KAAD,EAAQC,MAAR,CAAb;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASE,OAAT,CAAiBjI,CAAjB,EAAoBC,CAApB,EAAuBd,IAAvB,EAA6B;AACzB,MAAI3B,qDAAO,CAA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C,WAAF,CAAcnM,IAAd,EAAoBqE,QAApB,EAA8B4H,OAA9B;AACH;;AAED,aAAO,IAAP;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,aAAInL,KAAJ,EAAW;AACP,aAAO,KAAKkL,IAAL,CAAUI,MAAV,CAAiB,UAACC,WAAD,EAAcC,WAAd,EAA2BC,YAA3B,EAAyCzG,KAAzC,EAAmD;AACvE,eAAOwG,WAAW,CAACE,GAAZ,CAAgBH,WAAhB,CAAP;AACH,OAFM,EAEJvL,KAFI,CAAP;AAGH;;;;EA9CcF;;AAiDnBtB,gEAAiB,CAAC,cAAD,EAAiByM,IAAjB,CAAjB;;;;;;;;;;;;;;;;;;;;AC7Ga;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMD;;;;;AACF;AACJ;AACA;AACA;AACI,uBAAYnG,UAAZ,EAAwB;AAAA;;AAAA;;AACpB;AACA,UAAK+G,IAAL,GAAYC,WAAW,CAAChH,UAAD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AOsO,OAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,sBAAT,CAAgCD,OAAhC,EAAyCtO,GAAzC,EAA8C9D,KAA9C,EAAqD;AACjD0F,EAAAA,oEAAgB,CAAC0M,OAAD,EAAUxK,mEAAiB,CAAC,aAAD,CAA3B,CAAhB;;AAEA,MAAIwK,OAAO,CAACY,YAAR,CAAqBlP,GAArB,CAAJ,EAA+B;AAC3B,QAAI9D,KAAK,KAAK3B,SAAd,EAAyB;AACrB,aAAO+T,OAAP;AACH;;AAED,QAAIA,OAAO,CAACc,YAAR,CAAqBpP,GAArB,MAA8B9D,KAAlC,EAAyC;AACrC,aAAOoS,OAAP;AACH;AAEJ;;AAED,MAAIvP,QAAQ,GAAGR,kEAAc,CAACyB,GAAD,CAA7B;AACA,MAAI9D,KAAK,KAAK3B,SAAd,EAAyBwE,QAAQ,IAAI,MAAMR,kEAAc,CAACrC,KAAD,CAAhC;AACzB,MAAIwD,MAAM,GAAG4O,OAAO,CAACmB,OAAR,CAAgB,MAAM1Q,QAAN,GAAiB,GAAjC,CAAb;;AACA,MAAIW,MAAM,YAAYgP,WAAtB,EAAmC;AAC/B,WAAOhP,MAAP;AACH;;AACD,SAAOnF,SAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASmV,kBAAT,CAA4BpB,OAA5B,EAAqCqB,SAArC,EAAgD;AAAA;;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AG,IAArB;AAEA;AACA;AACA;AACA;AACA;;AAEA,IAAMC,eAAe,GAAG,OAAxB;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,eAAe,GAAG,OAAxB;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,aAAa,GAAG,KAAtB;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,cAAc,GAAG,MAAvB;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,cAAc,GAAG,MAAvB;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,eAAe,GAAG,OAAxB;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,mBAAmB,GAAG,WAA5B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,kBAAkB,GAAG,UAA3B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,oBAAoB,GAAG,YAA7B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,cAAc,GAAG,MAAvB;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,cAAc,GAAG,MAAvB;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,cAAc,GAAG,MAAvB;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,kBAAkB,GAAG,UAA3B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,mBAAmB,GAAG,WAA5B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,iBAAiB,GAAG,SAA1B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,gBAAgB,GAAG,QAAzB;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,kBAAkB,GAAG,UAA3B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,YAAY,GAAG,IAArB;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,mBAAmB,GAAG,WAA5B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,mBAAmB,GAAG,WAA5B;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,wBAAwB,GAAG,gBAAjC;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,mBAAmB,GAAG,WAA5B;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,yBAAyB,GAAG,iBAAlC;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,aAAa,GAAG,KAAtB;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,mBAAmB,GAAG,WAA5B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,sBAAsB,GAAG,cAA/B;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,qBAAqB,GAAG,aAA9B;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,gBAAgB,GAAG,QAAzB;;;;;;;;;;;;;;;;AClYa;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb;AACA;AACA;AACA;;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;;AACA,IAAMG,sBAAsB,GAAG/Y,MAAM,CAAC,kBAAD,CAArC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMgZ;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACI,2BAAc;AAAA;;AAAA;;AACV;;AAEA,QAAI,OAAO,MAAK,iBAAL,CAAP,KAAmC,UAAvC,EAAmD;AAC/C;AACZ;AACA;AACA;AACA;AACY,YAAKD,sBAAL,IAA+B,MAAKE,eAAL,EAA/B;AACH;;AAEDC,IAAAA,YAAY,CAACvT,IAAb;AAZU;AAcb;AAED;AACJ;AACA;AACA;AACA;AACA;;;;;;AAiBI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACI,mBAAe;AACX,aAAOkH,uDAAM,CAAC,EAAD,mEAAb;AACH;AAED;AACJ;AACA;AACA;A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;;AAED,SAAO,KAAK0Y,sBAAL,CAAP;AACH;AAED;AACA;AACA;AACA;AACA;;;AACA,SAASG,YAAT,GAAwB;AACpB,MAAMpV,IAAI,GAAG,IAAb,CADoB,CAGpB;;AACAA,EAAAA,IAAI,CAACgV,sEAAD,CAAJ,CAA8B,OAA9B,IAAyC,YAAM;AAC3ChV,IAAAA,IAAI,CAACqW,SAAL,CAAe,OAAf,EAAwBrW,IAAI,CAACmR,YAAL,CAAkB,OAAlB,CAAxB;AACH,GAFD;AAIH;;AAED1U,gEAAiB,CAAC,aAAD,EAAgByY,aAAhB,CAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3Ua;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AAGA;AACA;AACA;AACA;;AACA,IAAMwB,gBAAgB,GAAGxa,MAAM,CAAC,kBAAD,CAA/B;AAEA;AACA;AACA;AACA;;AACA,IAAMya,oBAAoB,GAAGza,MAAM,CAAC,sBAAD,CAAnC;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAM8Y,uBAAuB,GAAG9Y,MAAM,CAAC,mBAAD,CAAtC;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACM6Y;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACA;AACI,2BAAc;AAAA;;AAAA;;AACV;AACA,UAAK9Y,yDAAL,IAAuB,IAAI4Q,kEAAJ,CAAkB;AAAC,iBAAW9D,uDAAM,CAAC,EAAD,EAAK,MAAK6N,QAAV;AAAlB,KAAlB,CAAvB;AACA,UAAK5B,uBAAL,IAAgC,EAAhC;AACA6B,IAAAA,kBAAkB,CAAChV,IAAnB;;AACA,UAAK6U,gBAAL;;AALU;AAMb;AAED;AACJ;AACA;AACA;AACA;AACA;;;;;;AAKI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACI,mBAAe;AACX,aAAO;AACH/D,QAAAA,kBAAkB,EAAE,KAAKxB,YAAL,CAAkBwB,8DAAlB,CADjB;AAEHmE,QAAAA,UAAU,EAAE,MAFT;AAGHC,QAAAA,cAAc,EAAE,IAHb;AAIHC,QAAAA,SAAS,EAAE;AACPC,UAAAA,IAAI,EAAE3a;AADC;AAJR,OAAP;AAQH;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AA+BI;AACJ;AACA;AACA;AACA;AACA;AACI,4BAAeoR,QAAf,EAAyB;AACrB,WAA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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS+c,SAAT,GAAqB;AAAA;;AACjB,MAAIhd,MAAM,kBAAGZ,2DAAS,EAAZ,gDAAG,YAAc,QAAd,CAAb;;AACA,MAAI,QAAOY,MAAP,MAAkB,QAAtB,EAAgC;AAC5B,UAAM,IAAItI,KAAJ,CAAU,2BAAV,CAAN;AACH;;AAED,SAAOsI,MAAP;AACH;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASid,6BAAT,CAAuCzH,IAAvC,EAA6C;AACzC/Z,EAAAA,kEAAc,CAAC+Z,IAAD,CAAd;AAEA,MAAMvV,QAAQ,GAAGyY,WAAW,EAA5B;AACA,MAAMrD,QAAQ,GAAGpV,QAAQ,CAACgW,aAAT,CAAuB,UAAvB,CAAjB;AACAZ,EAAAA,QAAQ,CAACI,SAAT,GAAqBD,IAArB;AAEA,SAAOH,QAAQ,CAACD,OAAhB;AACH;;AAGDxd,gEAAiB,CAAC,aAAD,EAAgBolB,SAAhB,EAA2BtE,WAA3B,EAAwCuE,6BAAxC,CAAjB;;;;;;;;;;;;;;;ACzMa;AAEb;AACA;AACA;;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;;AACA,IAAME,gBAAgB,GAAG,IAAzB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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,KAAa,CAAjB,EAAoB;AAChB,YAAM,IAAIvB,KAAJ,CAAU,oBAAV,CAAN;AACH;;AAED,UAAK6lB,kBAAL,IAA2B/kB,CAAC,CAACoF,IAAF,CAAO,GAAP,CAA3B;AAxBiE;AA0BpE;AAED;AACJ;AACA;;;;;SACI,eAAmB;AACf,aAAO,KAAK2f,kBAAL,CAAP;AACH;AAED;AACJ;AACA;;;;SACI,eAAe;AACX,aAAO,KAAKD,gBAAL,EAAuBG,QAA9B;AACH;AAED;AACJ;AACA;;;;SACI,eAAa;AACT,aAAO,KAAKH,gBAAL,EAAuBI,MAA9B;AACH;AAED;AACJ;AACA;;;;SACI,eAAa;AACT,aAAO,KAAKJ,gBAAL,EAAuBK,MAA9B;AACH;AAED;AACJ;AACA;;;;SACI,eAAe;AACX,aAAO,KAAKL,gBAAL,EAAuBM,QAA9B;AACH;AAED;AACJ;AACA;;;;SACI,eAAc;AACV,aAAO,KAAKN,gBAAL,EAAuBO,OAA9B;AACH;AAED;AACJ;AACA;;;;SACI,eAAiB;AACb,aAAO,KAAKP,gBAAL,EAAuBS,YAA9B;AACH;AAGD;AACJ;AACA;;;;WACI,oBAAW;AACP,aAAO,KAAK,KAAKC,YAAjB;AACH;AAED;AACJ;AACA;AACA;AACA;;;;WACI,kBAAS;AACL,aAAOtiB,qDAAK,CAAC,KAAK4hB,gBAAL,CAAD,CAAZ;AACH;;;;EAvGgBpkB;AA4GrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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B,GAAG1pB,MAAM,CAAC,gBAAD,CAAnC;AAEA;AACA;AACA;AACA;;AACA,IAAM2pB,cAAc,GAAG3pB,MAAM,CAAC,UAAD,CAA7B;AAEA;AACA;AACA;AACA;;AACA,IAAM4pB,qBAAqB,GAAG5pB,MAAM,CAAC,iBAAD,CAApC;AAEA;AACA;AACA;AACA;;AACA,IAAM6pB,sBAAsB,GAAG7pB,MAAM,CAAC,kBAAD,CAArC;AAEA;AACA;AACA;AACA;;AACA,IAAM8pB,iBAAiB,GAAG9pB,MAAM,CAAC,aAAD,CAAhC;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACM0oB;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACI,qBAAY1e,MAAZ,EAAoBsR,OAApB,EAA6B;AAAA;;AAAA;;AACzB,8BAAMA,OAAN;AACA,UAAKoO,oBAAL,IAA6B1f,MAAM,IAAI,EAAvC;AACA,UAAK4f,qBAAL,IAA8B,CAA9B;AACA,UAAKC,sBAAL,IAA+B,CAA/B;AAJyB;AAK5B;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;SACI,eAAe;AACX,aAAOhd,uDAAM,CAAC,EAAD,gEAAqB;AAC9Bkd,QAAAA,MAAM,EAAE;AACJC,UAAAA,IAAI,EAAE,CAAC,IAAD,CADF;AAEJC,UAAAA,KAAK,EAAE,CAAC,GAAD;AAFH,SADsB;AAK9B/J,Q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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMT;;;;;AACF;AACJ;AACA;AACA;AACA;AACI,oBAAYU,QAAZ,EAA+B;AAAA;;AAAA;;AAC3B;AACA7jB,IAAAA,mEAAe,CAAC6jB,QAAD,CAAf;AAEA,UAAKA,QAAL,GAAgBA,QAAhB;;AAJ2B,sCAANhe,IAAM;AAANA,MAAAA,IAAM;AAAA;;AAK3B,UAAKb,SAAL,GAAiBa,IAAjB;AAL2B;AAM9B;AAED;AACJ;AACA;AACA;;;;;WACI,uBAAc;AACV,aAAO,KAAKge,QAAZ;AACH;AAED;AACJ;AACA;AACA;;;;WACI,wBAAe;AACX,aAAO,KAAK7e,SAAZ;AACH;;;;EA5BkBjL;;AAgCvBtB,gEAAiB,CAAC,iBAAD,EAAoB0qB,QAApB,CAAjB;;;;;;;;;;;;;;;;;;;;;;;;;AClEa;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,GAAG,GAAG,GAAZ;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMM,KAAK,GAAG,EAAd;AACA;AACA;AACA;AACA;AACA;;AACA,IAAML,KAAK,GAAG,EAAd;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMG,IAAI,GAAG,EAAb;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMG,IAAI,GAAG,CAAb;AACA;AACA;AACA;AACA;AACA;;AACA,IAAML,KAAK,GAAG,CAAd;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,KAAK,GAAG,CAAd;AACA;AACA;AACA;AACA;AACA;;AACA,IAAME,GAAG,GAAG,CAAZ;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMO;;;;;AAEF;AACJ;AAC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AAlB;AAEA+I,MAAAA,MAAM,CAAC/I,IAAD,CAAN,GAAgBc,KAAK,IAAI,QAAOA,KAAP,MAAiB,QAA3B,GACXusB,UAAU,CAACvsB,KAAD,CADC,GACSA,KADxB;AAEH;AAbuB;AAAA;AAAA;AAAA;AAAA;;AAexB,SAAOK,MAAM,CAACqsB,MAAP,CAAczkB,MAAd,CAAP;AACH;;AAEDzJ,gEAAiB,CAAC,cAAD,EAAiB+tB,UAAjB,CAAjB;;;;;;UCvDA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AAEa;;AAEb;AACA;AACA;AACA;AACA;CAGA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,IAAII,QAAJ;;AACA,IAAI;AACAA,EAAAA,QAAQ,GAAG5uB,yEAAA,CAA8B,qBAA9B,CAAX;AACH,CAFD,CAEE,OAAO2B,CAAP,EAAU,CAEX;;AAED,IAAI,CAACitB,QAAL,EAAeA,QAAQ,GAAG,SAAX;AAEf5uB,mEAAA,GAA0B4uB,QAA1B,IAAsC5uB,mDAAtC","sources":["webpack:///webpack/universalModuleDefinition","webpack:///../../../../packages/monster/source/constants.js","webpack:///../../../../packages/monster/source/namespace.js","webpack:///../../../../packages/monster/source/constraints/abstract.js","webpack:///../../../../packages/monster/source/types/base.js","webpack:///../../../../packages/monster/source/constraints/abstractoperator.js","webpack:///../../../../packages/monster/source/constraints/andoperator.js","webpack:///../../../../packages/monster/source/constraints/invalid.js","webpack:///../../../../packages/monster/source/constraints/isarray.js","webpack:///../../../../packages/monster/source/types/is.js","webpack:///../../../../packages/monster/source/constraints/isobject.js","webpack:///../../../../packages/monster/source/constraints/oroperator.js","webpack:///../../../../packages/monster/source/constraints/valid.js","webpack:///../../../../packages/monster/source/data/buildmap.js","webpack:///../../../../packages/monster/source/types/validate.js","webpack:///../../../../packages/monster/source/util/clone.js","webpack:///../../../../packages/monster/source/types/global.js","webpack:///../../../../packages/monster/source/types/typeof.js","webpack:///../../../../packages/monster/source/data/pathfinder.js","webpack:///../../../../packages/monster/source/types/stack.js","webpack:///../../../../packages/monster/source/data/diff.js","webpack:///../../../../packages/monster/source/data/extend.js","webpack:///../../../../packages/monster/source/data/pipe.js","webpack:///../../../../packages/monster/source/data/transformer.js","webpack:///../../../../packages/monster/source/types/id.js","webpack:///../../../../packages/monster/source/dom/assembler.js","webpack:///../../../../packages/monster/source/types/proxyobserver.js","webpack:///../../../../packages/monster/source/types/observer.js","webpack:///../../../../packages/monster/source/types/tokenlist.js","webpack:///../../../../packages/monster/source/types/uniquequeue.js","webpack:///../../../../packages/monster/source/types/queue.js","webpack:///../../../../packages/monster/source/types/observerlist.js","webpack:///../../../../packages/monster/source/dom/attributes.js","webpack:///../../../../packages/monster/source/dom/constants.js","webpack:///../../../../packages/monster/source/dom/customcontrol.js","webpack:///../../../../packages/monster/source/dom/customelement.js","webpack:///../../../../packages/monster/source/types/dataurl.js","webpack:///../../../../packages/monster/source/types/mediatype.js","webpack:///../../../../packages/monster/source/dom/template.js","webpack:///../../../../packages/monster/source/dom/theme.js","webpack:///../../../../packages/monster/source/dom/updater.js","webpack:///../../../../packages/monster/source/util/trimspaces.js","webpack:///../../../../packages/monster/source/dom/events.js","webpack:///../../../../packages/monster/source/dom/util.js","webpack:///../../../../packages/monster/source/dom/locale.js","webpack:///../../../../packages/monster/source/i18n/locale.js","webpack:///../../../../packages/monster/source/i18n/provider.js","webpack:///../../../../packages/monster/source/types/basewithoptions.js","webpack:///../../../../packages/monster/source/i18n/translations.js","webpack:///../../../../packages/monster/source/i18n/providers/fetch.js","webpack:///../../../../packages/monster/source/text/formatter.js","webpack:///../../../../packages/monster/source/logging/handler.js","webpack:///../../../../packages/monster/source/logging/logentry.js","webpack:///../../../../packages/monster/source/logging/logger.js","webpack:///../../../../packages/monster/source/logging/handler/console.js","webpack:///../../../../packages/monster/source/math/random.js","webpack:///../../../../packages/monster/source/types/randomid.js","webpack:///../../../../packages/monster/source/types/version.js","webpack:///../../../../packages/monster/source/util/comparator.js","webpack:///../../../../packages/monster/source/util/freeze.js","webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///../../../../packages/monster/source/monster.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window\"] = factory();\n\telse\n\t\troot[\"window\"] = factory();\n})(self, function() {\nreturn ","'use strict';\n\nimport {Monster} from './namespace.js';\n/**\n * Property-Keys\n * @author schukai GmbH\n */\n\n/**\n * @private\n * @type {symbol}\n * @memberOf Monster\n * @since 1.24.0\n */\nconst internalSymbol = Symbol('internalData');\n\n/**\n * @private\n * @type {symbol}\n * @memberOf Monster\n * @since 1.25.0\n */\nconst internalStateSymbol = Symbol('state');\n\n\nexport {\n    Monster,\n    internalSymbol,\n    internalStateSymbol\n}\n\n","'use strict';\n\n/**\n * Main namespace for Monster.\n *\n * @namespace Monster\n * @author schukai GmbH\n */\n\n\n/**\n * namespace class objects form the basic framework of the namespace administration.\n *\n * all functions, classes and objects of the library hang within the namespace tree.\n *\n * via `obj instanceof Monster.Namespace` it is also easy to check whether it is an object or a namespace.\n *\n * @memberOf Monster\n * @copyright schukai GmbH\n * @since 1.0.0\n */\nclass Namespace {\n\n    /**\n     *\n     * @param namespace\n     * @param obj\n     */\n    constructor(namespace) {\n        if (namespace === undefined || typeof namespace !== 'string') {\n            throw new Error(\"namespace is not a string\")\n        }\n        this.namespace = namespace;\n    }\n\n    /**\n     *\n     * @returns {string}\n     */\n    getNamespace() {\n        return this.namespace;\n    }\n\n    /**\n     *\n     * @returns {string}\n     */\n    toString() {\n        return this.getNamespace();\n    }\n}\n\n/**\n * @type {Namespace}\n * @global\n */\nexport const Monster = new Namespace(\"Monster\");\n\n/**\n * To expand monster, the `Monster.assignToNamespace()` method can be used.\n *\n * you must call the method in the monster namespace. this allows you to mount your own classes, objects and functions into the namespace.\n *\n * To avoid confusion and so that you do not accidentally overwrite existing functions, you should use the custom namespace `X`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * function hello() {\n *            console.log('Hello World!');\n *        }\n * Monster.assignToNamespace(\"Monster.X\", hello)\n * Monster.X.hello(); // ↦ Hello World!\n * </script>\n *\n * ```\n *\n * @param {string} ns\n * @param {function} obj\n * @return {current}\n * @memberOf Monster\n * @throws {Error} no functions have been passed.\n * @throws {Error} the name of the class or function cannot be resolved.\n * @throws {Error} the first argument is not a function or class.\n * @throws {Error} exception\n * @since 1.0.0\n */\nfunction assignToNamespace(ns, ...obj) {\n    let current = namespaceFor(ns.split(\".\"));\n\n    if (obj.length === 0) {\n        throw new Error('no functions have been passed.');\n    }\n\n    for (let i = 0, l = obj.length; i < l; i++) {\n        current[objectName(obj[i])] = obj[i];\n    }\n\n    return current\n}\n\n/**\n *\n * @param {class|function} fn\n * @returns {string}\n * @private\n * @throws {Error} the name of the class or function cannot be resolved.\n * @throws {Error} the first argument is not a function or class.\n * @throws {Error} exception\n */\nfunction objectName(fn) {\n    try {\n\n        if (typeof fn !== 'function') {\n            throw  new Error(\"the first argument is not a function or class.\");\n        }\n\n        if (fn.hasOwnProperty('name')) {\n            return fn.name;\n        }\n\n        if (\"function\" === typeof fn.toString) {\n            let s = fn.toString();\n            let f = s.match(/^\\s*function\\s+([^\\s(]+)/);\n            if (Array.isArray(f) && typeof f[1] === 'string') {\n                return f[1];\n            }\n            let c = s.match(/^\\s*class\\s+([^\\s(]+)/);\n            if (Array.isArray(c) && typeof c[1] === 'string') {\n                return c[1];\n            }\n        }\n\n    } catch (e) {\n        throw new Error(\"exception \" + e);\n    }\n\n    throw new Error(\"the name of the class or function cannot be resolved.\");\n}\n\n/**\n *\n * @param parts\n * @returns {Namespace}\n * @private\n */\nfunction namespaceFor(parts) {\n    let space = Monster, ns = 'Monster';\n\n    for (let i = 0; i < parts.length; i++) {\n\n        if (\"Monster\" === parts[i]) {\n            continue;\n        }\n\n        ns += '.' + parts[i];\n\n        if (!space.hasOwnProperty(parts[i])) {\n            space[parts[i]] = new Namespace(ns);\n        }\n\n        space = space[parts[i]];\n    }\n\n    return space;\n}\n\n\nassignToNamespace('Monster', assignToNamespace, Namespace);\nexport {assignToNamespace}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\n\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n *\n * The uniform API of the constraints allows chains to be formed.\n * \n * The abstract constraint defines the api for all constraints. mainly the method isValid() is defined.\n *\n * derived classes must implement the method isValid().\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary The abstract constraint\n */\nclass AbstractConstraint extends Base {\n\n    /**\n     *\n     */\n    constructor() {\n        super();\n    }\n\n    /**\n     * this method must return a promise containing the result of the check.\n     *\n     * @param {*} value\n     * @returns {Promise}\n     */\n    isValid(value) {\n        return Promise.reject(value);\n    }\n}\n\nassignToNamespace('Monster.Constraints', AbstractConstraint);\nexport {Monster, AbstractConstraint}","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\n\n/**\n * This is the base class from which all monster classes are derived.\n *\n * You can call the method via the monster namespace `new Monster.Types.Base()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.Base()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Base} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/base.js';\n * new Base()\n * </script>\n * ```\n *\n * The class was formerly called Object.\n *\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass Base extends Object {\n\n    /**\n     *\n     * @returns {string}\n     */\n    toString() {\n        return JSON.stringify(this);\n    };\n\n\n}\n\nassignToNamespace('Monster.Types', Base);\nexport {Monster, Base}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {AbstractConstraint} from \"./abstract.js\";\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n *\n * The uniform API of the constraints allows chains to be formed.\n *\n * Operators allow you to link constraints together. for example, you can check whether a value is an object or an array. each operator has two operands that are linked together.\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary The abstract operator constraint\n */\nclass AbstractOperator extends AbstractConstraint {\n\n    /**\n     *\n     * @param {AbstractConstraint} operantA\n     * @param {AbstractConstraint} operantB\n     * @throws {TypeError} \"parameters must be from type AbstractConstraint\"\n     */\n    constructor(operantA, operantB) {\n        super();\n\n        if (!(operantA instanceof AbstractConstraint) || !(operantB instanceof AbstractConstraint)) {\n            throw new TypeError(\"parameters must be from type AbstractConstraint\")\n        }\n\n        this.operantA = operantA;\n        this.operantB = operantB;\n\n    }\n\n\n}\n\nassignToNamespace('Monster.Constraints', AbstractOperator);\nexport {Monster, AbstractOperator}","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {AbstractOperator} from \"./abstractoperator.js\";\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n *\n * The uniform API of the constraints allows chains to be formed.\n *\n * The AndOperator is used to link several contraints. The constraint is fulfilled if all constraints of the operators are fulfilled.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Constraint.AndOperator();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/andoperator.js';\n * new AndOperator();\n * </script>\n * ```\n *\n * @example\n *\n * import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/valid.js';\n * import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/invalid.js';\n * import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/andoperator.js';\n *\n * new AndOperator(\n * new Valid(), new Valid()).isValid()\n * .then(()=>console.log(true))\n * .catch(()=>console.log(false));\n * // ↦ true\n *\n * new AndOperator(\n * new Invalid(), new Valid()).isValid()\n * .then(()=>console.log(true))\n * .catch(()=>console.log(false));\n * // ↦ false\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary A and operator constraint\n */\nclass AndOperator extends AbstractOperator {\n\n    /**\n     * this method return a promise containing the result of the check.\n     *\n     * @param {*} value\n     * @returns {Promise}\n     */\n    isValid(value) {\n        return Promise.all([this.operantA.isValid(value), this.operantB.isValid(value)]);\n    }\n\n}\n\nassignToNamespace('Monster.Constraints', AndOperator);\nexport {Monster, AndOperator}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {AbstractConstraint} from \"./abstract.js\";\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n *\n * The uniform API of the constraints allows chains to be formed.\n *\n * The invalid constraint allows an always invalid query to be performed. this constraint is mainly intended for testing.\n *\n * You can call the method via the monster namespace `new Monster.Constraint.Invalid()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Constraint.Invalid();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/invalid.js';\n * new Invalid();\n * </script>\n * ```\n *\n * @example\n *\n * import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/invalid.js';\n *\n * new Invalid().isValid()\n * .then(()=>console.log(true))\n * .catch(()=>console.log(false));\n * // ↦ false\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary A constraint that always invalid\n */\nclass Invalid extends AbstractConstraint {\n\n    /**\n     * this method return a rejected promise\n     *\n     * @param {*} value\n     * @returns {Promise}\n     */\n    isValid(value) {\n        return Promise.reject(value);\n    }\n\n}\n\nassignToNamespace('Monster.Constraints', Invalid);\nexport {Monster, Invalid}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {isArray} from \"../types/is.js\";\nimport {AbstractConstraint} from \"./abstract.js\";\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n * \n * The uniform API of the constraints allows chains to be formed.\n * \n * You can call the method via the monster namespace `new Monster.Constraint.IsObject()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Constraint.IsArray()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/isarray.js';\n * console.log(new IsArray())\n * </script>\n * ```\n *\n * @example\n *\n * import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/isarray.js';\n *\n * new IsArray()\n * .isValid([])\n * .then(()=>console.log(true));\n * // ↦ true\n *\n * new IsArray()\n * .isValid(99)\n * .catch(e=>console.log(e));\n * // ↦ 99\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary A constraint to check if a value is an array\n */\nclass IsArray extends AbstractConstraint {\n\n    /**\n     * this method return a promise containing the result of the check.\n     *\n     * @param {*} value\n     * @returns {Promise}\n     */\n    isValid(value) {\n        if (isArray(value)) {\n            return Promise.resolve(value);\n        }\n\n        return Promise.reject(value);\n    }\n\n}\n\nassignToNamespace('Monster.Constraints', IsArray);\nexport {Monster, IsArray}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\n\n/**\n * With this function you can check if a value is iterable.\n * \n * This method is used in the library to have consistent names.\n *\n * You can call the method via the monster namespace `Monster.Types.isPrimitive()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isIterable(null) // ↦ false\n * Monster.Types.isIterable('hello') // ↦ true\n * Monster.Types.isIterable([]) // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isIterable} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isIterable(null)  // ↦ false\n * isIterable('hello')  // ↦ true\n * isIterable([])  // ↦ true\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.2.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isIterable(value) {\n    if (value === undefined) return false;\n    if (value === null) return false;\n    return typeof value?.[Symbol.iterator] === 'function';\n}\n\n\n/**\n * Checks whether the value passed is a primitive (string, number, boolean, NaN, undefined, null or symbol)\n * \n * This method is used in the library to have consistent names.\n *\n * You can call the method via the monster namespace `Monster.Types.isPrimitive()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isPrimitive('2') // ↦ false\n * Monster.Types.isPrimitive([]) // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isPrimitive} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isPrimitive('2'))  // ↦ true\n * isPrimitive([]))  // ↦ false\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isPrimitive(value) {\n    var type;\n\n    if (value === undefined || value === null) {\n        return true;\n    }\n\n    type = typeof value;\n\n    if (type === 'string' || type === 'number' || type === 'boolean' || type === 'symbol') {\n        return true;\n    }\n\n    return false;\n}\n\n/**\n * Checks whether the value passed is a symbol\n * \n * This method is used in the library to have consistent names.\n *\n * You can call the method via the monster namespace `Monster.Types.isSymbol()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isSymbol('2') // ↦ false\n * Monster.Types.isSymbol(Symbol('test') // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isSymbol} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isSymbol(Symbol('a')))  // ↦ true\n * isSymbol([])  // ↦ false\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isSymbol(value) {\n    return ('symbol' === typeof value) ? true : false;\n}\n\n/**\n * Checks whether the value passed is a boolean.\n * \n * This method is used in the library to have consistent names.\n *\n * You can call the method via the monster namespace `Monster.Types.isBoolean()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isBoolean('2') // ↦ false\n * Monster.Types.isBoolean([]) // ↦ false\n * Monster.Types.isBoolean(true) // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isBoolean} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isBoolean('2'))  // ↦ false\n * isBoolean([]))  // ↦ false\n * isBoolean(2>4))  // ↦ true\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isBoolean(value) {\n\n    if (value === true || value === false) {\n        return true;\n    }\n\n    return false;\n}\n\n/**\n * Checks whether the value passed is a string\n * \n * This method is used in the library to have consistent names.\n *\n * You can call the method via the monster namespace `Monster.Types.isString()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isString('2') // ↦ true\n * Monster.Types.isString([]) // ↦ false\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isString('2'))  // ↦ true\n * isString([]))  // ↦ false\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isString(value) {\n    if (value === undefined || typeof value !== 'string') {\n        return false;\n    }\n    return true;\n}\n\n/**\n * Checks whether the value passed is a object\n * \n * This method is used in the library to have consistent names.\n *\n * You can call the method via the monster namespace `Monster.Types.isObject()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isObject('2') // ↦ false\n * Monster.Types.isObject([]) // ↦ false\n * Monster.Types.isObject({}) // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isObject('2'))  // ↦ false\n * isObject([]))  // ↦ false\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isObject(value) {\n\n    if (isArray(value)) return false;\n    if (isPrimitive(value)) return false;\n\n    if (typeof value === 'object') {\n        return true;\n    }\n\n    return false;\n}\n\n/**\n * Checks whether the value passed is a object and instance of instance.\n * \n * This method is used in the library to have consistent names.\n *\n * you can call the method via the monster namespace `Monster.Types.isInstance()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isInstance('2') // ↦ false\n * Monster.Types.isInstance([]) // ↦ false\n * Monster.Types.isInstance({}) // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isInstance} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isInstance('2'))  // ↦ false\n * isInstance([]))  // ↦ false\n * </script>\n * ```\n *\n * @param {*} value\n * @param {*} instance\n * @returns {boolean}\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isInstance(value, instance) {\n\n    if (!isObject(value)) return false;\n    if (!isFunction(instance)) return false;\n    if (!instance.hasOwnProperty('prototype')) return false;\n    return (value instanceof instance) ? true : false;\n\n}\n\n/**\n * Checks whether the value passed is a array\n * \n * This method is used in the library to have consistent names. \n *\n * you can call the method via the monster namespace `Monster.Types.isArray()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isArray('2') // ↦ false\n * Monster.Types.isArray([]) // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isArray('2'))  // ↦ false\n * isArray([]))  // ↦ true\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @see https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray\n */\nfunction isArray(value) {\n    return Array.isArray(value);\n}\n\n/**\n * Checks whether the value passed is a function\n * \n * This method is used in the library to have consistent names. \n *\n * you can call the method via the monster namespace `Monster.Types.isFunction()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isFunction(()=>{}) // ↦ true\n * Monster.Types.isFunction('2') // ↦ false\n * Monster.Types.isFunction([]) // ↦ false\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isFunction(()=>{}) // ↦ true\n * isFunction('2'))  // ↦ false\n * isFunction([]))  // ↦ false\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isFunction(value) {\n    if (isArray(value)) return false;\n    if (isPrimitive(value)) return false;\n\n    if (typeof value === 'function') {\n        return true;\n    }\n\n    return false;\n\n}\n\n/**\n * Checks whether the value passed is an integer.\n * \n * This method is used in the library to have consistent names. \n *\n * You can call the method via the monster namespace `Monster.Types.isFunction()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isInteger(()=>{}) // ↦ true\n * Monster.Types.isInteger('2') // ↦ false\n * Monster.Types.isInteger(2) // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isInteger} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isInteger(()=>{}) // ↦ true\n * isInteger('2'))  // ↦ false\n * isInteger(2))  // ↦ true\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.4.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isInteger(value) {\n    return Number.isInteger(value);\n}\n\n\nassignToNamespace('Monster.Types', isPrimitive, isBoolean, isString, isObject, isArray, isFunction, isIterable, isInteger, isSymbol);\nexport {\n    Monster,\n    isPrimitive,\n    isBoolean,\n    isString,\n    isObject,\n    isInstance,\n    isArray,\n    isFunction,\n    isIterable,\n    isInteger,\n    isSymbol\n}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {isObject} from \"../types/is.js\";\nimport {AbstractConstraint} from \"./abstract.js\";\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n *\n * The uniform API of the constraints allows chains to be formed.\n *\n * You can call the method via the monster namespace `new Monster.Constraint.IsObject()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Constraint.IsObject())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/isobject.js';\n * console.log(new IsObject())\n * </script>\n * ```\n *\n * @example\n *\n * import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/isobject.js';\n *\n * new IsObject()\n * .isValid({})\n * .then(()=>console.log(true));\n * // ↦ true\n *\n *\n * new IsObject()\n * .isValid(99)\n * .catch(e=>console.log(e));\n * // ↦ 99\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary A constraint to check if a value is an object\n */\nclass IsObject extends AbstractConstraint {\n\n    /**\n     * this method return a promise containing the result of the check.\n     *\n     * @param {*} value\n     * @returns {Promise}\n     */\n    isValid(value) {\n        if (isObject(value)) {\n            return Promise.resolve(value);\n        }\n\n        return Promise.reject(value);\n    }\n\n}\n\nassignToNamespace('Monster.Constraints', IsObject);\nexport {Monster, IsObject}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {AbstractOperator} from \"./abstractoperator.js\";\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n *\n * The uniform API of the constraints allows chains to be formed.\n *\n * The OrOperator is used to link several constraints. The constraint is fulfilled if one of the constraints is fulfilled.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Constraint.OrOperator();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraint/oroperator.js';\n * new OrOperator();\n * </script>\n * ```\n *\n * @example\n *\n * import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/valid.js';\n * import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/invalid.js';\n * import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/oroperator.js';\n *\n * new OrOperator(\n * new Valid(), new Invalid()).isValid()\n * .then(()=>console.log(true))\n * .catch(()=>console.log(false));\n * // ↦ true\n *\n * new OrOperator(\n * new Invalid(), new Invalid()).isValid()\n * .then(()=>console.log(true))\n * .catch(()=>console.log(false));\n * // ↦ false\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary A or operator \n */\nclass OrOperator extends AbstractOperator {\n\n    /**\n     * this method return a promise containing the result of the check.\n     *\n     * @param {*} value\n     * @returns {Promise}\n     */\n    isValid(value) {\n        var self = this;\n\n        return new Promise(function (resolve, reject) {\n            let a, b;\n\n            self.operantA.isValid(value)\n                .then(function () {\n                    resolve();\n                }).catch(function () {\n                a = false;\n                /** b has already been evaluated and was not true */\n                if (b === false) {\n                    reject();\n                }\n            });\n\n            self.operantB.isValid(value)\n                .then(function () {\n                    resolve();\n                }).catch(function () {\n                b = false;\n                /** b has already been evaluated and was not true */\n                if (a === false) {\n                    reject();\n                }\n            });\n        });\n    }\n\n\n}\n\nassignToNamespace('Monster.Constraints', OrOperator);\nexport {Monster, OrOperator}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {AbstractConstraint} from \"./abstract.js\";\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n *\n * The uniform API of the constraints allows chains to be formed.\n *\n * The valid constraint allows an always valid query to be performed. this constraint is mainly intended for testing.\n *\n * You can call the method via the monster namespace `new Monster.Constraint.Valid()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Constraint.Valid();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/valid.js';\n * new Valid();\n * </script>\n * ```\n *\n * @example\n *\n * import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/valid.js';\n *\n * new Valid().isValid()\n * .then(()=>console.log(true))\n * .catch(()=>console.log(false));\n * // ↦ true\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary A constraint that always valid\n */\nclass Valid extends AbstractConstraint {\n\n    /**\n     * this method return a promise containing the result of the check.\n     *\n     * @param {*} value\n     * @returns {Promise}\n     */\n    isValid(value) {\n        return Promise.resolve(value);\n    }\n\n}\n\nassignToNamespace('Monster.Constraints', Valid);\nexport {Monster, Valid}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {isFunction, isObject, isString} from \"../types/is.js\";\nimport {validateString} from \"../types/validate.js\";\nimport {clone} from \"../util/clone.js\";\nimport {DELIMITER, Pathfinder, WILDCARD} from \"./pathfinder.js\";\n\n\n/**\n * @type {string} parent symbol\n */\nexport const PARENT = '^';\n\n\n/**\n * With the help of the function `buildMap()`, maps can be easily created from data objects.\n *\n * Either a simple definition `a.b.c` or a template `${a.b.c}` can be specified as the path.\n * Key and value can be either a definition or a template. The key does not have to be defined.\n *\n * You can call the method via the monster namespace `Monster.Data.buildMap()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Data.buildMap())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/buildmap.js';\n * console.log(buildMap())\n * </script>\n * ```\n *\n * The templates determine the appearance of the keys and the value of the map. Either a single value `id` can be taken or a composite key `${id} ${name}` can be used.\n *\n * If you want to access values of the parent data set, you have to use the `^` character `${id} ${^.name}`.\n *\n * @example\n *\n * import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/buildmap.js';\n * // a typical data structure as reported by an api\n *\n * let map;\n * let obj = {\n *     \"data\": [\n *         {\n *             \"id\": 10,\n *             \"name\": \"Cassandra\",\n *             \"address\": {\n *                 \"street\": \"493-4105 Vulputate Street\",\n *                 \"city\": \"Saumur\",\n *                 \"zip\": \"52628\"\n *             }\n *         },\n *         {\n *             \"id\": 20,\n *             \"name\": \"Holly\",\n *             \"address\": {\n *                 \"street\": \"1762 Eget Rd.\",\n *                 \"city\": \"Schwalbach\",\n *                 \"zip\": \"952340\"\n *             }\n *         },\n *         {\n *             \"id\": 30,\n *             \"name\": \"Guy\",\n *             \"address\": {\n *                 \"street\": \"957-388 Sollicitudin Avenue\",\n *                 \"city\": \"Panchià\",\n *                 \"zip\": \"420729\"\n *             }\n *         }\n *     ]\n * };\n *\n * // The function is passed this data structure and with the help of the selector `'data.*'` the data to be considered are selected.\n * // The key is given by a simple definition `'id'` and the value is given by a template `'${name} (${address.zip} ${address.city})'`.\n * map = buildMap(obj, 'data.*', '${name} (${address.zip} ${address.city})', 'id');\n * console.log(map);\n *\n * // ↦ Map(3) {\n * //  '10' => 'Cassandra (52628 Saumur)',\n * //  '20' => 'Holly (952340 Schwalbach)',\n * //  '30' => 'Guy (420729 Panchià)'\n * // }\n *\n * // If no key is specified, the key from the selection, here the array index, is taken.\n * map = buildMap(obj, 'data.*', '${name} (${address.zip} ${address.city})');\n * console.log(map);\n *\n * // ↦ Map(3) {\n * //  '0' => 'Cassandra (52628 Saumur)',\n * //  '1' => 'Holly (952340 Schwalbach)',\n * //  '2' => 'Guy (420729 Panchià)'\n * // }\n *\n * // a filter (function(value, key) {}) can be specified to accept only defined entries.\n * map = buildMap(obj, 'data.*', '${name} (${address.zip} ${address.city})', 'id', function (value, key) {\n *                return (value['id'] >= 20) ? true : false\n *            });\n * console.log(map);\n *\n * // ↦ Map(2) {\n * //  20 => 'Holly (952340 Schwalbach)',\n * //  30 => 'Guy (420729 Panchià)'\n * // }\n *\n * @param {*} subject\n * @param {string|Monster.Data~exampleSelectorCallback} selector\n * @param {string} [valueTemplate]\n * @param {string} [keyTemplate]\n * @param {Monster.Data~exampleFilterCallback} [filter]\n * @return {*}\n * @memberOf Monster.Data\n * @throws {TypeError} value is neither a string nor a function\n * @throws {TypeError} the selector callback must return a map\n */\nfunction buildMap(subject, selector, valueTemplate, keyTemplate, filter) {\n    return assembleParts(subject, selector, filter, function (v, k, m) {\n        k = build(v, keyTemplate, k);\n        v = build(v, valueTemplate);\n        this.set(k, v);\n    });\n\n}\n\n/**\n * @private\n * @param {*} subject\n * @param {string|Monster.Data~exampleSelectorCallback} selector\n * @param {Monster.Data~exampleFilterCallback} [filter]\n * @param {function} callback\n * @return {Map}\n * @throws {TypeError} selector is neither a string nor a function\n */\nfunction assembleParts(subject, selector, filter, callback) {\n\n    const result = new Map();\n\n    let map;\n    if (isFunction(selector)) {\n        map = selector(subject)\n        if (!(map instanceof Map)) {\n            throw new TypeError('the selector callback must return a map');\n        }\n    } else if (isString(selector)) {\n        map = new Map;\n        buildFlatMap.call(map, subject, selector);\n    } else {\n        throw new TypeError('selector is neither a string nor a function')\n    }\n\n    if (!(map instanceof Map)) {\n        return result;\n    }\n\n    map.forEach((v, k, m) => {\n        if (isFunction(filter)) {\n            if (filter.call(m, v, k) !== true) return;\n        }\n\n        callback.call(result, v, k, m);\n\n    });\n\n    return result;\n}\n\n/**\n * @private\n * @param subject\n * @param selector\n * @param key\n * @param parentMap\n * @return {*}\n */\nfunction buildFlatMap(subject, selector, key, parentMap) {\n\n    const result = this;\n    const currentMap = new Map;\n\n    const resultLength = result.size;\n\n    if (key === undefined) key = [];\n\n    let parts = selector.split(DELIMITER);\n    let current = \"\", currentPath = [];\n    do {\n\n        current = parts.shift();\n        currentPath.push(current);\n\n        if (current === WILDCARD) {\n\n            let finder = new Pathfinder(subject);\n            let map;\n\n            try {\n                map = finder.getVia(currentPath.join(DELIMITER));\n            } catch (e) {\n                let a = e;\n                map = new Map();\n            }\n\n            for (const [k, o] of map) {\n\n                let copyKey = clone(key);\n\n                currentPath.map((a) => {\n                    copyKey.push((a === WILDCARD) ? k : a)\n                })\n\n                let kk = copyKey.join(DELIMITER);\n                let sub = buildFlatMap.call(result, o, parts.join(DELIMITER), copyKey, o);\n\n                if (isObject(sub) && parentMap !== undefined) {\n                    sub[PARENT] = parentMap;\n                }\n\n                currentMap.set(kk, sub);\n            }\n\n        }\n\n\n    } while (parts.length > 0);\n\n    // no set in child run\n    if (resultLength === result.size) {\n        for (const [k, o] of currentMap) {\n            result.set(k, o);\n        }\n    }\n\n    return subject;\n\n}\n\n\n/**\n * With the help of this filter callback, values can be filtered out. Only if the filter function returns true, the value is taken for the map.\n *\n * @callback Monster.Data~exampleFilterCallback\n * @param {*} value Value\n * @param {string} key  Key\n * @memberOf Monster.Data\n * @see {@link Monster.Data.buildMap}\n */\n\n/**\n * Alternatively to a string selector a callback can be specified. this must return a map.\n *\n * @example\n * import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/buildmap.js';\n *\n * let obj = {\n *                \"data\": [\n *                    {\n *                        \"id\": 10,\n *                        \"name\": \"Cassandra\",\n *                        \"enrichment\": {\n *                            variants: [\n *                                {\n *                                    sku: 1, label: \"XXS\", price: [\n *                                        {vk: '12.12 €'},\n *                                        {vk: '12.12 €'}\n *                                    ]\n *                                },\n *                                {\n *                                    sku: 2, label: \"XS\", price: [\n *                                        {vk: '22.12 €'},\n *                                        {vk: '22.12 €'}\n *                                    ]\n *                                },\n *                                {\n *                                    sku: 3, label: \"S\", price: [\n *                                        {vk: '32.12 €'},\n *                                        {vk: '32.12 €'}\n *                                    ]\n *                                },\n *                                {\n *                                    sku: 4, label: \"L\", price: [\n *                                        {vk: '42.12 €'},\n *                                        {vk: '42.12 €'}\n *                                    ]\n *                                }\n *                            ]\n *\n *                        }\n *                    },\n *                    {\n *                        \"id\": 20,\n *                        \"name\": \"Yessey!\",\n *                        \"enrichment\": {\n *                            variants: [\n *                                {\n *                                    sku: 1, label: \"XXS\", price: [\n *                                        {vk: '12.12 €'},\n *                                        {vk: '12.12 €'}\n *                                    ]\n *                                },\n *                                {\n *                                    sku: 2, label: \"XS\", price: [\n *                                        {vk: '22.12 €'},\n *                                        {vk: '22.12 €'}\n *                                    ]\n *                                },\n *                                {\n *                                    sku: 3, label: \"S\", price: [\n *                                        {vk: '32.12 €'},\n *                                        {vk: '32.12 €'}\n *                                    ]\n *                                },\n *                                {\n *                                    sku: 4, label: \"L\", price: [\n *                                        {vk: '42.12 €'},\n *                                        {vk: '42.12 €'}\n *                                    ]\n *                                }\n *                            ]\n *\n *                        }\n *                    }\n *                ]\n *            };\n *\n * let callback = function (subject) {\n *                let m = new Map;\n *\n *                for (const [i, b] of Object.entries(subject.data)) {\n *\n *                    let key1 = i;\n *\n *                    for (const [j, c] of Object.entries(b.enrichment.variants)) {\n *                        let key2 = j;\n *\n *                        for (const [k, d] of Object.entries(c.price)) {\n *\n *                            let key3 = k;\n *\n *                            d.name = b.name;\n *                            d.label = c.label;\n *                            d.id = [key1, key2, key3].join('.');\n *\n *                            m.set(d.id, d);\n *                        }\n *\n *                    }\n *                }\n *                return m;\n *            }\n *\n * let map = buildMap(obj, callback, '${name} ${vk}', '${id}')\n *\n * // ↦ Map(3) {\n * //  \"0.0.0\":\"Cassandra 12.12 €\",\n * //  \"0.0.1\":\"Cassandra 12.12 €\",\n * //  \"0.1.0\":\"Cassandra 22.12 €\",\n * //  \"0.1.1\":\"Cassandra 22.12 €\",\n * //  \"0.2.0\":\"Cassandra 32.12 €\",\n * //  \"0.2.1\":\"Cassandra 32.12 €\",\n * //  \"0.3.0\":\"Cassandra 42.12 €\",\n * //  \"0.3.1\":\"Cassandra 42.12 €\",\n * //  \"1.0.0\":\"Yessey! 12.12 €\",\n * //  \"1.0.1\":\"Yessey! 12.12 €\",\n * //  \"1.1.0\":\"Yessey! 22.12 €\",\n * //  \"1.1.1\":\"Yessey! 22.12 €\",\n * //  \"1.2.0\":\"Yessey! 32.12 €\",\n * //  \"1.2.1\":\"Yessey! 32.12 €\",\n * //  \"1.3.0\":\"Yessey! 42.12 €\",\n * //  \"1.3.1\":\"Yessey! 42.12 €\"\n * // }\n *\n * @callback Monster.Data~exampleSelectorCallback\n * @param {*} subject subject\n * @return Map\n * @since 1.17.0\n * @memberOf Monster.Data\n * @see {@link Monster.Data.buildMap}\n */\n\n/**\n * @private\n * @param {*} subject\n * @param {string|undefined} definition\n * @param {*} defaultValue\n * @return {*}\n */\nfunction build(subject, definition, defaultValue) {\n    if (definition === undefined) return defaultValue ? defaultValue : subject;\n    validateString(definition);\n\n    const regexp = /(?<placeholder>\\${(?<path>[a-z\\^A-Z.\\-_0-9]*)})/gm\n    const array = [...definition.matchAll(regexp)];\n\n    let finder = new Pathfinder(subject);\n\n    if (array.length === 0) {\n        return finder.getVia(definition);\n    }\n\n    array.forEach((a) => {\n        let groups = a?.['groups'];\n        let placeholder = groups?.['placeholder']\n        if (placeholder === undefined) return;\n\n        let path = groups?.['path']\n\n        let v = finder.getVia(path);\n        if (v === undefined) v = defaultValue;\n\n        definition = definition.replaceAll(placeholder, v);\n\n\n    })\n\n    return definition;\n\n}\n\n\nassignToNamespace('Monster.Data', buildMap);\nexport {Monster, buildMap, assembleParts}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {\n    isArray,\n    isBoolean,\n    isFunction,\n    isInstance,\n    isInteger,\n    isIterable,\n    isObject,\n    isPrimitive,\n    isString,\n    isSymbol\n} from './is.js';\n\n/**\n * This method checks if the type matches the primitive type. this function is identical to isPrimitive() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validatePrimitive()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateIterable('2')) // ↦ TypeError\n * console.log(Monster.Types.validateIterable([])) // ↦ value\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateIterable} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateIterable('2'))  // ↦ TypeError\n * console.log(validateIterable([]))  // ↦ value\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.2.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not a primitive\n * @see {@link isPrimitive}\n * @see {@link Monster.Types.isPrimitive}\n * @see {@link Monster.Types#isPrimitive}\n */\nfunction validateIterable(value) {\n    if (!isIterable(value)) {\n        throw new TypeError('value is not iterable')\n    }\n    return value\n}\n\n/**\n * This method checks if the type matches the primitive type. this function is identical to isPrimitive() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validatePrimitive()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validatePrimitive('2')) // ↦ value\n * console.log(Monster.Types.validatePrimitive([])) // ↦ TypeError\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validatePrimitive} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validatePrimitive('2'))  // ↦ value\n * console.log(validatePrimitive([]))  // ↦ TypeError\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not a primitive\n * @see {@link isPrimitive}\n * @see {@link Monster.Types.isPrimitive}\n * @see {@link Monster.Types#isPrimitive}\n */\nfunction validatePrimitive(value) {\n    if (!isPrimitive(value)) {\n        throw new TypeError('value is not a primitive')\n    }\n    return value\n}\n\n/**\n * This method checks if the type matches the boolean type. this function is identical to isBoolean() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validateBoolean()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateBoolean(true)) // ↦ value\n * console.log(Monster.Types.validateBoolean('2')) // ↦ TypeError\n * console.log(Monster.Types.validateBoolean([])) // ↦ TypeError\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateBoolean} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateBoolean(false))  // ↦ value\n * console.log(validateBoolean('2'))  // ↦ TypeError\n * console.log(validateBoolean([]))  // ↦ TypeError\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n\n * @throws {TypeError}  value is not primitive\n */\nfunction validateBoolean(value) {\n    if (!isBoolean(value)) {\n        throw new TypeError('value is not a boolean')\n    }\n    return value\n}\n\n/**\n * This method checks if the type matches the string type. this function is identical to isString() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validateString()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateString('2')) // ↦ value\n * console.log(Monster.Types.validateString([])) // ↦ TypeError\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateString('2'))  // ↦ value\n * console.log(validateString([]))  // ↦ TypeError\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not a string\n */\nfunction validateString(value) {\n    if (!isString(value)) {\n        throw new TypeError('value is not a string')\n    }\n    return value\n}\n\n\n/**\n * This method checks if the type matches the object type. this function is identical to isObject() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validateObject()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateObject({})) // ↦ value\n * console.log(Monster.Types.validateObject('2')) // ↦ TypeError\n * console.log(Monster.Types.validateObject([])) // ↦ TypeError\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateObject({}))  // ↦ value\n * console.log(validateObject('2'))  // ↦ TypeError\n * console.log(validateObject([]))  // ↦ TypeError\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not a object\n */\nfunction validateObject(value) {\n    if (!isObject(value)) {\n        throw new TypeError('value is not a object')\n    }\n    return value\n}\n\n/**\n * This method checks if the type matches the object instance.\n *\n * You can call the method via the monster namespace `Monster.Types.validateInstance()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateInstance({}, Object)) // ↦ value\n * console.log(Monster.Types.validateInstance('2', Object)) // ↦ TypeError\n * console.log(Monster.Types.validateInstance([], Object)) // ↦ TypeError\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateInstance} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateInstance({}, Object)) // ↦ value\n * console.log(validateInstance('2', Object)) // ↦ TypeError\n * console.log(validateInstance([], Object)) // ↦ TypeError\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not an instance of\n */\nfunction validateInstance(value, instance) {\n    if (!isInstance(value, instance)) {\n        let n = \"\";\n        if (isObject(instance) || isFunction(instance)) {\n            n = instance?.['name']\n        }\n\n        if (n) {\n            n = \" \" + n;\n        }\n\n        throw new TypeError('value is not an instance of' + n)\n    }\n    return value\n}\n\n/**\n * This method checks if the type matches the array type. this function is identical to isArray() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validateArray()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateArray('2')) // ↦ TypeError\n * console.log(Monster.Types.validateArray([])) // ↦ value\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateArray('2'))  // ↦ TypeError\n * console.log(validateArray([]))  // ↦ value\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not an array\n */\nfunction validateArray(value) {\n    if (!isArray(value)) {\n        throw new TypeError('value is not an array')\n    }\n    return value\n}\n\n/**\n * This method checks if the type matches the symbol type. this function is identical to isSymbol() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validateSymbol()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateSymbol('2')) // ↦ TypeError\n * console.log(Monster.Types.validateSymbol([])) // ↦ value\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateSymbol} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateSymbol('2'))  // ↦ TypeError\n * console.log(validateSymbol())  // ↦ value\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not an symbol\n */\nfunction validateSymbol(value) {\n    if (!isSymbol(value)) {\n        throw new TypeError('value is not an symbol')\n    }\n    return value\n}\n\n/**\n * This method checks if the type matches the function type. this function is identical to isFunction() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validateFunction()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateFunction(()=>{})) // ↦ value\n * console.log(Monster.Types.validateFunction('2')) // ↦ TypeError\n * console.log(Monster.Types.validateFunction([])) // ↦ TypeError\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateFunction(()=>{})) // ↦ value\n * console.log(validateFunction('2'))  // ↦ TypeError\n * console.log(validateFunction([]))  // ↦ TypeError\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not a function\n */\nfunction validateFunction(value) {\n    if (!isFunction(value)) {\n        throw new TypeError('value is not a function')\n    }\n    return value\n}\n\n/**\n * This method checks if the type is an integer. this function is identical to isInteger() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validateInteger()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateInteger(true)) // ↦ TypeError\n * console.log(Monster.Types.validateInteger('2')) // ↦ TypeError\n * console.log(Monster.Types.validateInteger(2)) // ↦ value\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateInteger(true)) // ↦ TypeError\n * console.log(validateInteger('2'))  // ↦ TypeError\n * console.log(validateInteger(2))  // ↦ value\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.4.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not an integer\n */\nfunction validateInteger(value) {\n    if (!isInteger(value)) {\n        throw new TypeError('value is not an integer')\n    }\n    return value\n}\n\nassignToNamespace('Monster.Types', validatePrimitive, validateBoolean, validateString, validateObject, validateArray, validateFunction, validateIterable, validateInteger);\nexport {\n    Monster,\n    validatePrimitive,\n    validateBoolean,\n    validateString,\n    validateObject,\n    validateInstance,\n    validateArray,\n    validateFunction,\n    validateIterable,\n    validateInteger,\n    validateSymbol\n}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {getGlobal} from '../types/global.js';\nimport {isArray, isFunction, isObject, isPrimitive} from '../types/is.js';\nimport {typeOf} from \"../types/typeof.js\";\nimport {validateObject} from \"../types/validate.js\";\n\n\n/**\n * With this function, objects can be cloned.\n * The entire object tree is run through.\n *\n * Proxy, Element, HTMLDocument and DocumentFragment instances are not cloned.\n * Global objects such as windows are also not cloned,\n *\n * If an object has a method `getClone()`, this method is used to create the clone.\n *\n * You can call the method via the monster namespace `Monster.Util.clone()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Util.clone({})\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {clone} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/util/clone.js';\n * clone({})\n * </script>\n * ```\n *\n * @param {*} obj object to be cloned\n * @returns {*}\n * @since 1.0.0\n * @memberOf Monster.Util\n * @copyright schukai GmbH\n * @throws {Error} unable to clone obj! its type isn't supported.\n */\nfunction clone(obj) {\n\n    // typeof null results in 'object'.  https://2ality.com/2013/10/typeof-null.html\n    if (null === obj) {\n        return obj;\n    }\n\n    // Handle the two simple types, null and undefined\n    if (isPrimitive(obj)) {\n        return obj;\n    }\n\n    // Handle the two simple types, null and undefined\n    if (isFunction(obj)) {\n        return obj;\n    }\n\n    // Handle Array\n    if (isArray(obj)) {\n        let copy = [];\n        for (var i = 0, len = obj.length; i < len; i++) {\n            copy[i] = clone(obj[i]);\n        }\n\n        return copy;\n    }\n\n    if (isObject(obj)) {\n\n\n        // Handle Date\n        if (obj instanceof Date) {\n            let copy = new Date();\n            copy.setTime(obj.getTime());\n            return copy;\n        }\n\n        /** Do not clone DOM nodes */\n        if (typeof Element !== 'undefined' && obj instanceof Element) return obj;\n        if (typeof HTMLDocument !== 'undefined' && obj instanceof HTMLDocument) return obj;\n        if (typeof DocumentFragment !== 'undefined' && obj instanceof DocumentFragment) return obj;\n\n        /** Do not clone global objects */\n        if (obj === getGlobal()) return obj;\n        if (typeof globalContext !== 'undefined' && obj === globalContext) return obj;\n        if (typeof window !== 'undefined' && obj === window) return obj;\n        if (typeof document !== 'undefined' && obj === document) return obj;\n        if (typeof navigator !== 'undefined' && obj === navigator) return obj;\n        if (typeof JSON !== 'undefined' && obj === JSON) return obj;\n\n        // Handle Proxy-Object\n        try {\n            // try/catch because possible: TypeError: Function has non-object prototype 'undefined' in instanceof check\n            if (obj instanceof Proxy) {\n                return obj;\n            }\n        } catch (e) {\n        }\n\n        return cloneObject(obj)\n\n    }\n\n    throw new Error(\"unable to clone obj! its type isn't supported.\");\n}\n\n/**\n *\n * @param {object} obj\n * @returns {object}\n * @private\n */\nfunction cloneObject(obj) {\n    \n    validateObject(obj);\n    \n    const constructor = obj?.['constructor'];\n\n    /** Object has clone method */\n    if(typeOf(constructor)==='function') {\n        const prototype = constructor?.prototype;\n        if(typeof prototype==='object') {\n            if(prototype.hasOwnProperty('getClone')&& typeOf(obj.getClone) === 'function') {\n                return obj.getClone();        \n            }\n        }\n    }\n\n    let copy = {};\n    if (typeof obj.constructor === 'function' &&\n        typeof obj.constructor.call === 'function') {\n        copy = new obj.constructor();\n    }\n\n    for (let key in obj) {\n\n        if (!obj.hasOwnProperty(key)) {\n            continue;\n        }\n\n        if (isPrimitive(obj[key])) {\n            copy[key] = obj[key];\n            continue;\n        }\n\n        copy[key] = clone(obj[key]);\n    }\n\n    return copy;\n}\n\nassignToNamespace('Monster.Util', clone);\nexport {Monster, clone}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {validateFunction, validateObject, validateString} from \"./validate.js\";\n\n/**\n * @type {objec}\n * @private\n */\nlet globalReference;\n\n/**\n * @private\n * @throws {Error} unsupported environment.\n */\n(function () {\n\n    if (typeof globalThis === 'object') {\n        globalReference = globalThis;\n        return;\n    }\n\n    if (typeof self !== 'undefined') {\n        globalReference = self;\n        return;\n    } else if (typeof window !== 'undefined') {\n        globalReference = window;\n        return;\n    }\n\n    Object.defineProperty(Object.prototype, '__monster__', {\n        get: function () {\n            return this;\n        },\n        configurable: true\n    });\n\n    if (typeof __monster__ === 'object') {\n        __monster__.globalThis = __monster__;\n        delete Object.prototype.__monster__;\n\n        globalReference = globalThis;\n        return;\n    }\n\n    try {\n        globalReference = Function('return this')();\n    } catch (e) {\n\n    }\n\n    throw new Error(\"unsupported environment.\")\n\n\n}());\n\n/**\n * Return globalThis\n *\n * If globalThis is not available, it will be polyfilled\n *\n * @since 1.6.0\n * @memberOf Monster.Types\n * @returns {objec} globalThis\n */\nfunction getGlobal() {\n    return globalReference;\n}\n\n/**\n * Return global object or throw Error\n *\n * You can call the method via the monster namespace `Monster.Types.getGlobalObject()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.getGlobalObject('document') \n * // ↦ { }\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getGlobalObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/global.js';\n * getGlobalObject('document') \n * // ↦ { }\n * </script>\n * ```\n *\n * @since 1.6.0\n * @memberOf Monster.Types\n * @param {string} name\n * @returns {objec}\n * @throws {Error} the object is not defined\n * @throws {TypeError} value is not a object\n * @throws {TypeError} value is not a string\n */\nfunction getGlobalObject(name) {\n    validateString(name);\n    let o = globalReference?.[name];\n    if (typeof o === 'undefined') throw new Error('the object ' + name + ' is not defined');\n    validateObject(o);\n    return o;\n}\n\n/**\n * Return global function or throw Error\n *\n * You can call the method via the monster namespace `Monster.Types.getGlobalFunction()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.getGlobalFunction('parseInt')) // ↦ f parseInt() { }\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getGlobalFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/global.js';\n * console.log(getGlobalFunction('parseInt')) // ↦ f parseInt() { }\n * </script>\n * ```\n *\n * @since 1.6.0\n * @memberOf Monster.Types\n * @param {string} name\n * @return {objec}\n * @throws {TypeError} value is not a function\n * @throws {Error} the function is not defined\n * @throws {TypeError} value is not a string\n */\nfunction getGlobalFunction(name) {\n    validateString(name);\n    let f = globalReference?.[name];\n    if (typeof f === 'undefined') throw new Error('the function ' + name + ' is not defined');\n    validateFunction(f);\n    return f;\n}\n\n\nassignToNamespace('Monster.Types', getGlobal, getGlobalObject, getGlobalFunction);\nexport {Monster, getGlobal, getGlobalObject, getGlobalFunction}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\n\nimport {assignToNamespace, Monster} from '../namespace.js';\n\n/**\n * The built-in typeof method is known to have some historical weaknesses. This function tries to provide a better and more accurate result.\n *\n * You can call the method via the monster namespace `Monster.Types.typeOf()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.typeOf())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/typeof.js';\n * console.log(typeOf())\n * </script>\n * ```\n *\n * @example\n *\n * import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/typeof.js';\n *\n * console.log(typeOf(undefined)); // ↦ undefined\n * console.log(typeOf(\"\")); // ↦ string\n * console.log(typeOf(5)); // ↦ number\n * console.log(typeOf({})); // ↦ object\n * console.log(typeOf([])); // ↦ array\n * console.log(typeOf(new Map)); // ↦ map\n * console.log(typeOf(true)); // ↦ boolean\n *\n * @param {*} value\n * @return {string}\n * @since 1.7.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not a primitive\n */\nfunction typeOf(value) {\n    let type = ({}).toString.call(value).match(/\\s([a-zA-Z]+)/)[1];\n    if ('Object' === type) {\n        const results = (/^(class|function)\\s+(\\w+)/).exec(value.constructor.toString());\n        type = (results && results.length > 2) ? results[2] : '';\n    }\n    return type.toLowerCase();\n}\n\nassignToNamespace('Monster.Types', typeOf);\nexport {\n    Monster,\n    typeOf\n}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {isArray, isInteger, isObject, isPrimitive} from '../types/is.js';\nimport {Stack} from \"../types/stack.js\";\nimport {validateInteger, validateString} from '../types/validate.js';\n\n/**\n * path separator\n *\n * @private\n * @type {string}\n */\nexport const DELIMITER = '.';\n\n/**\n * @private\n * @type {string}\n */\nexport const WILDCARD = '*';\n\n/**\n * You can call the method via the monster namespace `new Monster.Data.Pathfinder()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Data.Pathfinder())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/pathfinder.js';\n * console.log(new Pathfinder())\n * </script>\n * ```\n *\n * With the help of the pathfinder, values can be read and written from an object construct.\n *\n * ```\n * new Pathfinder({\n * a: {\n *     b: {\n *         f: [\n *             {\n *                 g: false,\n *             }\n *         ],\n *     }\n * }\n * }).getVia(\"a.b.f.0.g\"); // ↦ false\n * ```\n *\n * if a value is not present or has the wrong type, a corresponding exception is thrown.\n *\n * ```\n * new Pathfinder({}).getVia(\"a.b.f.0.g\"); // ↦ Error\n * ```\n *\n * The `Pathfinder.exists()` method can be used to check whether access to the path is possible.\n *\n * ```\n * new Pathfinder({}).exists(\"a.b.f.0.g\"); // ↦ false\n * ```\n *\n * pathfinder can also be used to build object structures. to do this, the `Pathfinder.setVia()` method must be used.\n *\n * ```\n * obj = {};\n * new Pathfinder(obj).setVia('a.b.0.c', true); // ↦ {a:{b:[{c:true}]}}\n * ```\n *\n * @example\n *\n * import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/pathfinder.js';\n *\n * let value = new Pathfinder({\n * a: {\n *     b: {\n *         f: [\n *             {\n *                 g: false,\n *             }\n *         ],\n *     }\n * }\n * }).getVia(\"a.b.f.0.g\");\n *\n *  console.log(value);\n *  // ↦ false\n *\n * try {\n *   new Pathfinder({}).getVia(\"a.b.f.0.g\");  \n * } catch(e) {\n *   console.log(e.toString());\n *   // ↦ Error: the journey is not at its end (b.f.0.g)\n * }\n *\n * @example\n *\n * import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/pathfinder.js';\n *\n * let p = new Pathfinder({\n *                a: {\n *                    x: [\n *                        {c: 1}, {c: 2}\n *                    ],\n *                    y: true\n *                },\n *                b: {\n *                    x: [\n *                        {c: 1, d: false}, {c: 2}\n *                    ],\n *                    y: true\n *                },\n *            });\n *\n * let r = p.getVia(\"*.x.*.c\");\n * console.log(r);\n *\n * @since 1.4.0\n * @copyright schukai GmbH\n * @memberOf Monster.Data\n */\nclass Pathfinder extends Base {\n\n    /**\n     * @param {array|object|Map|Set} value\n     * @since 1.4.0\n     * @throws  {Error} the parameter must not be a simple type\n     **/\n    constructor(object) {\n        super();\n\n        if (isPrimitive(object)) {\n            throw new Error('the parameter must not be a simple type');\n        }\n\n        this.object = object;\n        this.wildCard = WILDCARD;\n    }\n\n    /**\n     * set wildcard\n     *\n     * @param {string} wildcard\n     * @return {Pathfinder}\n     * @since 1.7.0\n     */\n    setWildCard(wildcard) {\n        validateString(wildcard);\n        this.wildCard = wildcard;\n        return this;\n    }\n\n    /**\n     *\n     * @param {string} path\n     * @since 1.4.0\n     * @returns {*}\n     * @throws {TypeError} unsupported type\n     * @throws {Error} the journey is not at its end\n     * @throws {TypeError} value is not a string\n     * @throws {TypeError} value is not an integer\n     * @throws {Error} unsupported action for this data type\n     */\n    getVia(path) {\n        return getValueViaPath.call(this, this.object, validateString(path));\n    }\n\n    /**\n     *\n     * @param {string} path\n     * @param {*} value\n     * @returns {Pathfinder}\n     * @since 1.4.0\n     * @throws {TypeError} unsupported type\n     * @throws {TypeError} value is not a string\n     * @throws {TypeError} value is not an integer\n     * @throws {Error} unsupported action for this data type\n     */\n    setVia(path, value) {\n        validateString(path);\n        setValueViaPath.call(this, this.object, path, value);\n        return this;\n    }\n\n    /**\n     * Delete Via Path\n     *\n     * @param {string} path\n     * @returns {Pathfinder}\n     * @since 1.6.0\n     * @throws {TypeError} unsupported type\n     * @throws {TypeError} value is not a string\n     * @throws {TypeError} value is not an integer\n     * @throws {Error} unsupported action for this data type\n     */\n    deleteVia(path) {\n        validateString(path);\n        deleteValueViaPath.call(this, this.object, path);\n        return this;\n    }\n\n    /**\n     *\n     * @param {string} path\n     * @return {bool}\n     * @throws {TypeError} unsupported type\n     * @throws {TypeError} value is not a string\n     * @throws {TypeError} value is not an integer\n     * @since 1.4.0\n     */\n    exists(path) {\n        validateString(path);\n        try {\n            getValueViaPath.call(this, this.object, path, true);\n            return true;\n        } catch (e) {\n\n        }\n\n        return false;\n    }\n\n}\n\nassignToNamespace('Monster.Data', Pathfinder);\nexport {Monster, Pathfinder}\n\n/**\n *\n * @param {*} subject\n * @param {string} path\n * @param {string} check\n * @return {Map}\n * @throws {TypeError} unsupported type\n * @throws {Error} the journey is not at its end\n * @throws {Error} unsupported action for this data type\n * @private\n */\nfunction iterate(subject, path, check) {\n\n    const result = new Map;\n\n    if (isObject(subject) || isArray(subject)) {\n        for (const [key, value] of Object.entries(subject)) {\n            result.set(key, getValueViaPath.call(this, value, path, check))\n        }\n    } else {\n        let key = path.split(DELIMITER).shift();\n        result.set(key, getValueViaPath.call(this, subject, path, check));\n    }\n\n    return result;\n\n\n}\n\n/**\n *\n * @param {*} subject\n * @param [string} path\n * @param [boolean} check \n * @returns {*}\n * @throws {TypeError} unsupported type\n * @throws {Error} the journey is not at its end\n * @throws {Error} unsupported action for this data type\n * @private\n */\nfunction getValueViaPath(subject, path, check) {\n\n    if (path === \"\") {\n        return subject;\n    }\n\n    let parts = path.split(DELIMITER)\n    let current = parts.shift();\n\n    if (current === this.wildCard) {\n        return iterate.call(this, subject, parts.join(DELIMITER), check);\n    }\n\n    if (isObject(subject) || isArray(subject)) {\n\n        let anchor;\n        if (subject instanceof Map || subject instanceof WeakMap) {\n            anchor = subject.get(current);\n\n        } else if (subject instanceof Set || subject instanceof WeakSet) {\n            current = parseInt(current);\n            validateInteger(current)\n            anchor = [...subject]?.[current];\n\n        } else if (typeof WeakRef === 'function' && subject instanceof WeakRef) {\n            throw Error('unsupported action for this data type');\n\n        } else if (isArray(subject)) {\n            current = parseInt(current);\n            validateInteger(current)\n            anchor = subject?.[current];\n        } else {\n            anchor = subject?.[current];\n        }\n\n        if (isObject(anchor) || isArray(anchor)) {\n            return getValueViaPath.call(this, anchor, parts.join(DELIMITER), check)\n        }\n\n        if (parts.length > 0) {\n            throw Error(\"the journey is not at its end (\" + parts.join(DELIMITER) + \")\");\n        }\n\n\n        if (check === true) {\n            const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(subject), current);\n\n            if (!subject.hasOwnProperty(current) && descriptor === undefined) {\n                throw Error('unknown value');\n            }\n\n        }\n\n        return anchor;\n\n    }\n\n    throw TypeError(\"unsupported type \" + typeof subject)\n\n}\n\n/**\n *\n * @param object\n * @param path\n * @param value\n * @returns {void}\n * @throws {TypeError} unsupported type\n * @throws {TypeError} unsupported type\n * @throws {Error} the journey is not at its end\n * @throws {Error} unsupported action for this data type\n * @private\n */\nfunction setValueViaPath(object, path, value) {\n\n    validateString(path);\n\n    let parts = path.split(DELIMITER)\n    let last = parts.pop();\n    let subpath = parts.join(DELIMITER);\n\n    let stack = new Stack()\n    let current = subpath;\n    while (true) {\n\n        try {\n            getValueViaPath.call(this, object, current, true)\n            break;\n        } catch (e) {\n\n        }\n\n        stack.push(current);\n        parts.pop();\n        current = parts.join(DELIMITER);\n\n        if (current === \"\") break;\n    }\n\n    while (!stack.isEmpty()) {\n        current = stack.pop();\n        let obj = {};\n\n        if (!stack.isEmpty()) {\n            let n = stack.peek().split(DELIMITER).pop();\n            if (isInteger(parseInt(n))) {\n                obj = [];\n            }\n\n        }\n\n        setValueViaPath.call(this, object, current, obj);\n    }\n\n    let anchor = getValueViaPath.call(this, object, subpath);\n\n    if (!isObject(object) && !isArray(object)) {\n        throw TypeError(\"unsupported type: \" + typeof object);\n    }\n\n    if (anchor instanceof Map || anchor instanceof WeakMap) {\n        anchor.set(last, value);\n    } else if (anchor instanceof Set || anchor instanceof WeakSet) {\n        anchor.append(value)\n\n    } else if (typeof WeakRef === 'function' && anchor instanceof WeakRef) {\n        throw Error('unsupported action for this data type');\n\n    } else if (isArray(anchor)) {\n        last = parseInt(last);\n        validateInteger(last)\n        assignProperty(anchor, last, value);\n    } else {\n        assignProperty(anchor, last, value);\n    }\n\n\n}\n\n/**\n * @private\n * @param {object} object\n * @param {string} key\n * @param {*} value\n */\nfunction assignProperty(object, key, value) {\n\n    if (!object.hasOwnProperty(key)) {\n        object[key] = value;\n        return;\n    }\n\n    if (value === undefined) {\n        delete object[key];\n    }\n\n    object[key] = value;\n\n}\n\n/**\n *\n * @param object\n * @param path\n * @returns {void}\n * @throws {TypeError} unsupported type\n * @throws {TypeError} unsupported type\n * @throws {Error} the journey is not at its end\n * @throws {Error} unsupported action for this data type\n * @since 1.6.0\n * @private\n */\nfunction deleteValueViaPath(object, path) {\n\n    const parts = path.split(DELIMITER)\n    let last = parts.pop();\n    const subpath = parts.join(DELIMITER);\n\n    const anchor = getValueViaPath.call(this, object, subpath);\n\n    if (anchor instanceof Map) {\n        anchor.delete(last);\n    } else if (anchor instanceof Set || anchor instanceof WeakMap || anchor instanceof WeakSet || (typeof WeakRef === 'function' && anchor instanceof WeakRef)) {\n        throw Error('unsupported action for this data type');\n\n    } else if (isArray(anchor)) {\n        last = parseInt(last);\n        validateInteger(last)\n        delete anchor[last];\n    } else {\n        delete anchor[last];\n    }\n\n\n}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from './base.js';\n\n/**\n * You can call the method via the monster namespace `new Monster.Types.Queue()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Types.Stack())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/stack.js';\n * console.log(new Stack())\n * </script>\n * ```\n *\n * @since 1.4.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass Stack extends Base {\n\n    /**\n     *\n     */\n    constructor() {\n        super();\n        this.data = [];\n    }\n\n\n    /**\n     * @return {boolean}\n     */\n    isEmpty() {\n        return this.data.length === 0;\n    }\n\n    /**\n     * looks at the object at the top of this stack without removing it from the stack.\n     *\n     * @return {*}\n     */\n    peek() {\n        if (this.isEmpty()) {\n            return undefined;\n        }\n\n        return this.data?.[this.data.length - 1];\n    }\n\n    /**\n     * pushes an item onto the top of this stack.\n     *\n     * @param {*} value\n     * @returns {Queue}\n     */\n    push(value) {\n        this.data.push(value)\n        return this;\n    }\n\n    /**\n     * remove all entries\n     *\n     * @returns {Queue}\n     */\n    clear() {\n        this.data = [];\n        return this;\n    }\n\n    /**\n     * removes the object at the top of this stack and returns\n     * that object as the value of this function. is the stack empty\n     * the return value is undefined.\n     *\n     * @return {*}\n     */\n    pop() {\n        if (this.isEmpty()) {\n            return undefined;\n        }\n        return this.data.pop();\n    }\n\n\n}\n\nassignToNamespace('Monster.Types', Stack);\nexport {Monster, Stack}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {isArray, isObject} from \"../types/is.js\";\nimport {typeOf} from \"../types/typeof.js\";\n\n/**\n * With the diff function you can perform the change of one object to another. The result shows the changes of the second object to the first object.\n *\n * The operator `add` means that something has been added to the second object. `delete` means that something has been deleted from the second object compared to the first object.\n *\n * You can call the method via the monster namespace `Monster.Data.Diff()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Data.Diff(a, b)\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/diff.js';\n * Diff(a, b)\n * </script>\n * ```\n *\n * @example\n *\n * import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/diff.js';\n *\n * // given are two objects x and y.\n *\n * let x = {\n *     a: 1,\n *     b: \"Hello!\"\n * }\n *\n *  let y = {\n *     a: 2,\n *     c: true\n * }\n *\n * // These two objects can be compared with each other.\n *\n * console.log(Diff(x, y));\n *\n * // the result is then the following\n *\n * //\n * // [\n * // {\n * //        operator: 'update',\n * //        path: [ 'a' ],\n * //        first: { value: 1, type: 'number' },\n * //        second: { value: 2, type: 'number' }\n * //    },\n * // {\n * //        operator: 'delete',\n * //        path: [ 'b' ],\n * //        first: { value: 'Hello!', type: 'string' }\n * //    },\n * // {\n * //        operator: 'add',\n * //        path: [ 'c' ],\n * //        second: { value: true, type: 'boolean' }\n * //    }\n * // ]\n *\n * @param {*} first\n * @param {*} second\n * @return {array}\n * @since 1.6.0\n * @copyright schukai GmbH\n * @memberOf Monster.Data\n */\nfunction diff(first, second) {\n    return doDiff(first, second)\n}\n\n/**\n * @private\n * @param a\n * @param b\n * @param type\n * @return {Set<string>|Set<number>}\n */\nfunction getKeys(a, b, type) {\n    if (isArray(type)) {\n        const keys = a.length > b.length ? new Array(a.length) : new Array(b.length);\n        keys.fill(0);\n        return new Set(keys.map((_, i) => i));\n    }\n\n    return new Set(Object.keys(a).concat(Object.keys(b)));\n}\n\n/**\n * @private\n * @param a\n * @param b\n * @param path\n * @param diff\n * @return {array}\n */\nfunction doDiff(a, b, path, diff) {\n\n    let typeA = typeOf(a)\n    let typeB = typeOf(b)\n\n    const currPath = path || [];\n    const currDiff = diff || [];\n\n    if (typeA === typeB && (typeA === 'object' || typeA ==='array')) { \n\n        getKeys(a, b, typeA).forEach((v) => {\n\n            if (!(Object.prototype.hasOwnProperty.call(a, v))) {\n                currDiff.push(buildResult(a[v], b[v], 'add', currPath.concat(v)));\n            } else if (!(Object.prototype.hasOwnProperty.call(b, v))) {\n                currDiff.push(buildResult(a[v], b[v], 'delete', currPath.concat(v)));\n            } else {\n                doDiff(a[v], b[v], currPath.concat(v), currDiff);\n            }\n        });\n\n    } else {\n\n        const o = getOperator(a, b, typeA, typeB);\n        if (o !== undefined) {\n            currDiff.push(buildResult(a, b, o, path));\n        }\n\n    }\n\n    return currDiff;\n\n}\n\n/**\n *\n * @param {*} a\n * @param {*} b\n * @param {string} operator\n * @param {array} path\n * @return {{path: array, operator: string}}\n * @private\n */\nfunction buildResult(a, b, operator, path) {\n\n    const result = {\n        operator,\n        path,\n    };\n\n    if (operator !== 'add') {\n        result.first = {\n            value: a,\n            type: typeof a\n        };\n\n        if (isObject(a)) {\n            const name = Object.getPrototypeOf(a)?.constructor?.name;\n            if (name !== undefined) {\n                result.first.instance = name;\n            }\n        }\n    }\n\n    if (operator === 'add' || operator === 'update') {\n        result.second = {\n            value: b,\n            type: typeof b\n        };\n\n        if (isObject(b)) {\n            const name = Object.getPrototypeOf(b)?.constructor?.name;\n            if (name !== undefined) {\n                result.second.instance = name;\n            }\n        }\n\n    }\n\n    return result;\n}\n\n/**\n * @private\n * @param {*} a\n * @param {*} b\n * @return {boolean}\n */\nfunction isNotEqual(a, b) {\n\n    if (typeof a !== typeof b) {\n        return true;\n    }\n\n    if (a instanceof Date && b instanceof Date) {\n        return a.getTime() !== b.getTime();\n    }\n\n    return a !== b;\n}\n\n/**\n * @private\n * @param {*} a\n * @param {*} b\n * @return {string|undefined}\n */\nfunction getOperator(a, b) {\n\n    /**\n     * @type {string|undefined}\n     */\n    let operator;\n\n    /**\n     * @type {string}\n     */\n    let typeA = typeof a;\n\n    /**\n     * @type {string}\n     */\n    let typeB = typeof b;\n\n    if (typeA === 'undefined' && typeB !== 'undefined') {\n        operator = 'add';\n    } else if (typeA !== 'undefined' && typeB === 'undefined') {\n        operator = 'delete';\n    } else if (isNotEqual(a, b)) {\n        operator = 'update';\n    }\n\n    return operator;\n\n}\n\nassignToNamespace('Monster.Data', diff);\nexport {Monster, diff}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {isArray, isObject} from \"../types/is.js\";\nimport {typeOf} from \"../types/typeof.js\";\n\n/**\n * Extend copies all enumerable own properties from one or\n * more source objects to a target object. It returns the modified target object.\n *\n * You can call the method via the monster namespace `Monster.Data.extend()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Data.extend(a, b)\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {extend} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/extend.js';\n * extend(a, b)\n * </script>\n * ```\n *\n * @param {object} target\n * @param {object}\n * @return {object}\n * @since 1.10.0\n * @copyright schukai GmbH\n * @memberOf Monster.Data\n * @throws {Error} unsupported argument\n * @throws {Error} type mismatch\n */\nfunction extend() {\n    let o, i;\n\n    for (i = 0; i < arguments.length; i++) {\n        let a = arguments[i];\n\n        if (!(isObject(a) || isArray(a))) {\n            throw new Error('unsupported argument ' + JSON.stringify(a));\n        }\n\n        if (o === undefined) {\n            o = a;\n            continue;\n        }\n\n        for (let k in a) {\n\n            let v = a?.[k];\n\n            if (v === o?.[k]) {\n                continue;\n            }\n\n            if ((isObject(v)&&typeOf(v)==='object') || isArray(v)) {\n\n                if (o[k] === undefined) {\n                    if (isArray(v)) {\n                        o[k] = [];\n                    } else {\n                        o[k] = {};\n                    }\n                } else {\n                    if (typeOf(o[k]) !== typeOf(v)) {\n                        throw new Error(\"type mismatch: \" + JSON.stringify(o[k]) + \"(\" + typeOf(o[k]) + \") != \" + JSON.stringify(v) + \"(\" + typeOf(v) + \")\");\n                    }\n                }\n\n                o[k] = extend(o[k], v);\n\n            } else {\n                o[k] = v;\n            }\n\n        }\n    }\n\n    return o;\n}\n\n\nassignToNamespace('Monster.Data', extend);\nexport {Monster, extend}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {validateString} from '../types/validate.js';\nimport {Transformer} from './transformer.js';\n\n\nconst DELIMITER = '|';\n\n/**\n * The pipe class makes it possible to combine several processing steps.\n *\n * You can call the method via the monster namespace `new Monster.Data.Pipe()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Data.Pipe()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/pipe.js';\n * new Pipe()\n * </script>\n * ```\n *\n * A pipe consists of commands whose input and output are connected with the pipe symbol `|`.\n *\n * With the Pipe, processing steps can be combined. Here, the value of an object is accessed via the pathfinder (path command).\n * the word is then converted to uppercase letters and a prefix Hello is added. the two backslash safe the space char.\n *\n * @example\n * import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/pipe.js';\n *\n * let obj = {\n *    a: {\n *        b: {\n *            c: {\n *                d: \"world\"\n *            }\n *        }\n *    }\n * }\n *\n * console.log(new Pipe('path:a.b.c.d | toupper | prefix:Hello\\\\ ').run(obj));\n * // ↦ Hello WORLD\n *\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Data\n */\nclass Pipe extends Base {\n\n    /**\n     *\n     * @param {string} pipe a pipe consists of commands whose input and output are connected with the pipe symbol `|`.\n     * @throws {TypeError}\n     */\n    constructor(pipe) {\n        super();\n        validateString(pipe);\n        \n        this.pipe = pipe.split(DELIMITER).map((v) => {\n            return new Transformer(v);\n        });\n\n\n    }\n\n    /**\n     *\n     * @param {string} name\n     * @param {function} callback\n     * @param {object} context\n     * @returns {Transformer}\n     * @throws {TypeError} value is not a string\n     * @throws {TypeError} value is not a function\n     */\n    setCallback(name, callback, context) {\n\n        for (const [, t] of Object.entries(this.pipe)) {\n            t.setCallback(name, callback, context);\n        }\n\n        return this;\n    }\n\n    /**\n     * run a pipe\n     *\n     * @param {*} value\n     * @returns {*}\n     */\n    run(value) {\n        return this.pipe.reduce((accumulator, transformer, currentIndex, array) => {\n            return transformer.run(accumulator);\n        }, value);\n    }\n}\n\nassignToNamespace('Monster.Data', Pipe);\nexport {Monster, Pipe}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {getGlobal, getGlobalObject} from \"../types/global.js\";\nimport {ID} from '../types/id.js';\nimport {isArray, isObject, isString} from '../types/is.js';\nimport {\n    validateFunction,\n    validateInteger,\n    validateObject,\n    validatePrimitive,\n    validateString\n} from '../types/validate.js';\nimport {clone} from \"../util/clone.js\";\nimport {Pathfinder} from \"./pathfinder.js\";\n\n/**\n * The transformer class is a swiss army knife for manipulating values. especially in combination with the pipe, processing chains can be built up.\n *\n * You can call the method via the monster namespace `new Monster.Data.Transformer()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Data.Transformer()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/transformer.js';\n * new Transformer()\n * </script>\n * ```\n *\n * A simple example is the conversion of all characters to lowercase. for this purpose the command `tolower` must be used.\n *\n * ```\n * let t = new Transformer('tolower').run('ABC'); // ↦ abc\n * ```\n *\n * **all commands**\n *\n * in the following table all commands, parameters and existing aliases are described.\n *\n * | command      | parameter                  | alias                   | description                                                                                                                                                                                                                                                                                                                                                |\n * |:-------------|:---------------------------|:------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n * | to-base64    |                            | base64, btob            | Converts the value to base64                                                                                                                                                                                                                                                                                                                               |\n * | from-base64  |                            | atob                    | Converts the value from base64                                                                                                                                                                                                                                                                                                                             |\n * | call         | function:param1:param2:... |                         | Calling a callback function. The function can be defined in three places: either globally, in the context `addCallback` or in the passed object                                                                                                                                                                                                            |\n * | default      | value:type                 | ??                      | If the value is undefined the first argument is returned, otherwise the value. The third optional parameter specifies the desired type. If no type is specified, string is used. Valid types are bool, string, int, float, undefined and object. An object default value must be specified as a base64 encoded json string. (since 1.12.0)                 |\n * | debug        |                            |                         | the passed value is output (console) and returned  |\n * | empty        |                            |                         | Return empty String \"\"                                                                                                                                                                                                                                                                                                                                     |\n * | first-key    | default                    |                         | Can be applied to objects and returns the value of the first key. All keys of the object are fetched and sorted.    (since 1.23.0)                                                                                                                                                                                                                         |\n * | fromjson     |                            |                         | Type conversion from a JSON string (since 1.12.0)                                                                                                                                                                                                                                                                                                          |\n * | if           | statement1:statement2      | ?                       | Is the ternary operator, the first parameter is the valid statement, the second is the false part. To use the current value in the queue, you can set the value keyword. On the other hand, if you want to have the static string \"value\", you have to put one backslash \\\\ in front of it and write value. the follow values are true: 'on', true, 'true'. If you want to have a space, you also have to write \\\\ in front of the space.  |\n * | index        | key:default                | property, key           | Fetches a value from an object, an array, a map or a set                                                                                                                                                                                                                                                                                                   |\n * | last-key     | default                    |                         | Can be applied to objects and returns the value of the last key. All keys of the object are fetched and sorted. (since 1.23.0)                                                                                                                                                                                                                             |\n * | length       |                            | count                   | Length of the string or entries of an array or object                                                                                                                                                                                                                                                                                                      |\n * | nop          |                            |                         | Do nothing                                                                                                                                                                                                                                                                                                                                                 |\n * | nth-key      | index:default              |                         | Can be applied to objects and returns the value of the nth key. All keys of the object are fetched and sorted. (since 1.23.0)                                                                                                                                                                                                                              |\n * | nth-last-key | index:default              |                         | Can be applied to objects and returns the value of the nth key from behind. All keys of the object are fetched and sorted. (since 1.23.0)                                                                                                                                                                                                                  |\n * | path         | path                       |                         | The access to an object is done via a Pathfinder object                                                                                                                                                                                                                                                                                                    |\n * | path-exists  | path                       |                         | Check if the specified path is available in the value (since 1.24.0)    |\n * | plaintext    |                            | plain                   | All HTML tags are removed (*)                                                                                                                                                                                                                                                                                                                              |\n * | prefix       | text                       |                         | Adds a prefix                                                                                                                                                                                                                                                                                                                                              |\n * | rawurlencode |                            |                         | URL coding                                                                                                                                                                                                                                                                                                                                                 |\n * | static       |                            | none                    | The Arguments value is used and passed to the value. Special characters \\ <space> and : can be quotet by a preceding \\.                                                                                                                                                                                                                                    |\n * | substring    | start:length               |                         | Returns a substring                                                                                                                                                                                                                                                                                                                                        |\n * | suffix       | text                       |                         | Adds a suffix                                                                                                                                                                                                                                                                                                                                              |\n * | tointeger    |                            |                         | Type conversion to an integer value                                                                                                                                                                                                                                                                                                                        |\n * | tojson       |                            |                         | Type conversion to a JSON string (since 1.8.0)                                                                                                                                                                                                                                                                                                             |\n * | tolower      |                            | strtolower, tolowercase | The input value is converted to lowercase letters                                                                                                                                                                                                                                                                                                          |\n * | tostring     |                            |                         | Type conversion to a string.                                                                                                                                                                                                                                                                                                                               |\n * | toupper      |                            | strtoupper, touppercase | The input value is converted to uppercase letters                                                                                                                                                                                                                                                                                                          |\n * | trim         |                            |                         | Remove spaces at the beginning and end                                                                                                                                                                                                                                                                                                                     |\n * | ucfirst      |                            |                         | First character large                                                                                                                                                                                                                                                                                                                                      |\n * | ucwords      |                            |                         | Any word beginning large                                                                                                                                                                                                                                                                                                                                   |\n * | undefined    |                            |                         | Return undefined                                                                                                                                                                                                                                                                                                                                           |\n * | uniqid       |                            |                         | Creates a string with a unique value (**)\n *\n *  (*) for this functionality the extension [jsdom](https://www.npmjs.com/package/jsdom) must be loaded in the nodejs context.\n *\n * ```\n *  // polyfill\n *  if (typeof window !== \"object\") {\n *     const {window} = new JSDOM('', {\n *         url: 'http://example.com/',\n *         pretendToBeVisual: true\n *     });\n * \n *     [\n *         'self',\n *         'document',\n *         'Node',\n *         'Element',\n *         'HTMLElement',\n *         'DocumentFragment',\n *         'DOMParser',\n *         'XMLSerializer',\n *         'NodeFilter',\n *         'InputEvent',\n *         'CustomEvent'\n *     ].forEach(key => (global[key] = window[key]));\n * }\n * ```\n *\n * (**) for this command the crypt library is necessary in the nodejs context.\n *\n * ```\n * import * as Crypto from \"@peculiar/webcrypto\";\n * global['crypto'] = new Crypto.Crypto();\n * ```\n *\n * @example\n *\n * import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/transformer.js';\n *\n * const transformer = new Transformer(\"tolower\")\n *\n * console.log(transformer.run(\"HELLO\"))\n * // ↦ hello\n *\n * console.log(transformer.run(\"WORLD\"))\n * // ↦ world\n *\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Data\n */\nclass Transformer extends Base {\n    /**\n     *\n     * @param {string} definition\n     */\n    constructor(definition) {\n        super();\n        this.args = disassemble(definition);\n        this.command = this.args.shift()\n        this.callbacks = new Map();\n\n    }\n\n    /**\n     *\n     * @param {string} name\n     * @param {function} callback\n     * @param {object} context\n     * @returns {Transformer}\n     * @throws {TypeError} value is not a string\n     * @throws {TypeError} value is not a function\n     */\n    setCallback(name, callback, context) {\n        validateString(name)\n        validateFunction(callback)\n\n        if (context !== undefined) {\n            validateObject(context);\n        }\n\n        this.callbacks.set(name, {\n            callback: callback,\n            context: context,\n        });\n\n        return this;\n    }\n\n    /**\n     *\n     * @param {*} value\n     * @returns {*}\n     * @throws {Error} unknown command\n     * @throws {TypeError} unsupported type\n     * @throws {Error} type not supported\n     */\n    run(value) {\n        return transform.apply(this, [value])\n    }\n}\n\nassignToNamespace('Monster.Data', Transformer);\nexport {Monster, Transformer}\n\n/**\n *\n * @param {string} command\n * @returns {array}\n * @private\n */\nfunction disassemble(command) {\n\n    validateString(command);\n\n    let placeholder = new Map;\n    const regex = /((?<pattern>\\\\(?<char>.)){1})/mig;\n\n    // The separator for args must be escaped\n    // undefined string which should not occur normally and is also not a regex\n    let result = command.matchAll(regex)\n\n    for (let m of result) {\n        let g = m?.['groups'];\n        if (!isObject(g)) {\n            continue;\n        }\n\n        let p = g?.['pattern'];\n        let c = g?.['char'];\n\n        if (p && c) {\n            let r = '__' + new ID().toString() + '__';\n            placeholder.set(r, c);\n            command = command.replace(p, r);\n        }\n\n    }\n    let parts = command.split(':');\n\n    parts = parts.map(function (value) {\n        let v = value.trim();\n        for (let k of placeholder) {\n            v = v.replace(k[0], k[1]);\n        }\n        return v;\n\n\n    });\n\n    return parts\n}\n\n/**\n * tries to make a string out of value and if this succeeds to return it back\n *\n * @param {*} value\n * @returns {string}\n * @private\n */\nfunction convertToString(value) {\n\n    if (isObject(value) && value.hasOwnProperty('toString')) {\n        value = value.toString();\n    }\n\n    validateString(value)\n    return value;\n}\n\n/**\n *\n * @param {*} value\n * @returns {*}\n * @private\n * @throws {Error} unknown command\n * @throws {TypeError} unsupported type\n * @throws {Error} type not supported\n * @throws {Error} missing key parameter\n */\nfunction transform(value) {\n\n    const console = getGlobalObject('console');\n\n    let args = clone(this.args);\n    let key, defaultValue;\n\n    switch (this.command) {\n\n        case 'static':\n            return this.args.join(':');\n\n        case 'tolower':\n        case 'strtolower':\n        case 'tolowercase':\n            validateString(value)\n            return value.toLowerCase();\n\n        case 'toupper':\n        case 'strtoupper':\n        case 'touppercase':\n            validateString(value)\n            return value.toUpperCase();\n\n        case 'tostring':\n            return \"\" + value;\n\n        case 'tointeger':\n            let n = parseInt(value);\n            validateInteger(n);\n            return n\n\n        case 'tojson':\n            return JSON.stringify(value);\n\n        case 'fromjson':\n            return JSON.parse(value);\n\n        case 'trim':\n            validateString(value)\n            return value.trim();\n\n        case 'rawurlencode':\n            validateString(value)\n            return encodeURIComponent(value)\n                .replace(/!/g, '%21')\n                .replace(/'/g, '%27')\n                .replace(/\\(/g, '%28')\n                .replace(/\\)/g, '%29')\n                .replace(/\\*/g, '%2A');\n\n\n        case  'call':\n\n            /**\n             * callback-definition\n             * function callback(value, ...args) {\n             *   return value;\n             * }\n             */\n\n            let callback;\n            let callbackName = args.shift();\n            let context = getGlobal();\n\n            if (isObject(value) && value.hasOwnProperty(callbackName)) {\n                callback = value[callbackName];\n            } else if (this.callbacks.has(callbackName)) {\n                let s = this.callbacks.get(callbackName);\n                callback = s?.['callback'];\n                context = s?.['context'];\n            } else if (typeof window === 'object' && window.hasOwnProperty(callbackName)) {\n                callback = window[callbackName];\n            }\n            validateFunction(callback);\n\n            args.unshift(value);\n            return callback.call(context, ...args);\n\n        case  'plain':\n        case  'plaintext':\n            validateString(value);\n            let doc = new DOMParser().parseFromString(value, 'text/html');\n            return doc.body.textContent || \"\";\n\n        case  'if':\n        case  '?':\n\n            validatePrimitive(value);\n\n            let trueStatement = (args.shift() || undefined);\n            let falseStatement = (args.shift() || undefined);\n\n            if (trueStatement === 'value') {\n                trueStatement = value;\n            }\n            if (trueStatement === '\\\\value') {\n                trueStatement = 'value';\n            }\n            if (falseStatement === 'value') {\n                falseStatement = value;\n            }\n            if (falseStatement === '\\\\value') {\n                falseStatement = 'value';\n            }\n\n            let condition = ((value !== undefined && value !== '' && value !== 'off' && value !== 'false' && value !== false) || value === 'on' || value === 'true' || value === true);\n            return condition ? trueStatement : falseStatement;\n\n\n        case 'ucfirst':\n            validateString(value);\n\n            let firstchar = value.charAt(0).toUpperCase();\n            return firstchar + value.substr(1);\n        case 'ucwords':\n            validateString(value);\n\n            return value.replace(/^([a-z\\u00E0-\\u00FC])|\\s+([a-z\\u00E0-\\u00FC])/g, function (v) {\n                return v.toUpperCase();\n            });\n\n        case  'count':\n        case  'length':\n\n            if ((isString(value) || isObject(value) || isArray(value)) && value.hasOwnProperty('length')) {\n                return value.length;\n            }\n\n            throw new TypeError(\"unsupported type \" + typeof value);\n\n        case 'to-base64':\n        case 'btoa':\n        case 'base64':\n            return btoa(convertToString(value));\n\n        case 'atob':\n        case 'from-base64':\n            return atob(convertToString(value));\n\n        case 'empty':\n            return '';\n\n        case 'undefined':\n            return undefined;\n\n        case 'debug':\n\n            if (isObject(console)) {\n                console.log(value);\n            }\n\n            return value;\n\n        case 'prefix':\n            validateString(value);\n            let prefix = args?.[0];\n            return prefix + value;\n\n        case 'suffix':\n            validateString(value);\n            let suffix = args?.[0];\n            return value + suffix;\n\n        case 'uniqid':\n            return (new ID()).toString();\n\n        case 'first-key':\n        case 'last-key':\n        case 'nth-last-key':\n        case 'nth-key':\n\n            if (!isObject(value)) {\n                throw new Error(\"type not supported\")\n            }\n\n            const keys = Object.keys(value).sort()\n\n            if (this.command === 'first-key') {\n                key = 0;\n            } else if (this.command === 'last-key') {\n                key = keys.length - 1;\n            } else {\n\n                key = validateInteger(parseInt(args.shift()));\n\n                if (this.command === 'nth-last-key') {\n                    key = keys.length - key - 1;\n                }\n            }\n\n            defaultValue = (args.shift() || '');\n\n            let useKey = keys?.[key];\n\n            if (value?.[useKey]) {\n                return value?.[useKey];\n            }\n\n            return defaultValue;\n\n\n        case 'key':\n        case 'property':\n        case 'index':\n\n            key = args.shift() || undefined;\n\n            if (key === undefined) {\n                throw new Error(\"missing key parameter\")\n            }\n\n            defaultValue = (args.shift() || undefined);\n\n            if (value instanceof Map) {\n                if (!value.has(key)) {\n                    return defaultValue;\n                }\n                return value.get(key);\n            }\n\n            if (isObject(value) || isArray(value)) {\n\n                if (value?.[key]) {\n                    return value?.[key];\n                }\n\n                return defaultValue;\n            }\n\n            throw new Error(\"type not supported\")\n\n        case 'path-exists':\n\n            key = args.shift();\n            if (key === undefined) {\n                throw new Error(\"missing key parameter\")\n            }\n\n            return new Pathfinder(value).exists(key);\n\n        case 'path':\n\n            key = args.shift();\n            if (key === undefined) {\n                throw new Error(\"missing key parameter\")\n            }\n\n            let pf = new Pathfinder(value);\n\n            if (!pf.exists(key)) {\n                return undefined;\n            }\n\n            return pf.getVia(key);\n\n\n        case 'substring':\n\n            validateString(value);\n\n            let start = parseInt(args[0]) || 0;\n            let end = (parseInt(args[1]) || 0) + start;\n\n            return value.substring(start, end);\n\n        case 'nop':\n            return value;\n\n        case  '??':\n        case 'default':\n            if (value !== undefined && value !== null) {\n                return value;\n            }\n\n            defaultValue = args.shift();\n            let defaultType = args.shift();\n            if (defaultType === undefined) {\n                defaultType = 'string';\n            }\n\n            switch (defaultType) {\n                case 'int':\n                case 'integer':\n                    return parseInt(defaultValue);\n                case 'float':\n                    return parseFloat(defaultValue);\n                case 'undefined':\n                    return undefined\n                case 'bool':\n                case 'boolean':\n                    defaultValue = defaultValue.toLowerCase()\n                    return ((defaultValue !== 'undefined' && defaultValue !== '' && defaultValue !== 'off' && defaultValue !== 'false' && defaultValue !== 'false') || defaultValue === 'on' || defaultValue === 'true' || defaultValue === 'true');\n                case 'string':\n                    return \"\" + defaultValue;\n                case \"object\":\n                    return JSON.parse(atob(defaultValue));\n            }\n\n            throw new Error(\"type not supported\")\n\n\n        default:\n            throw new Error(\"unknown command \" + this.command)\n    }\n\n    return value;\n}\n\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from './base.js';\nimport {validateString} from \"./validate.js\";\n\n/**\n * @private\n * @type {Map<string, integer>}\n */\nlet internalCounter = new Map;\n\n/**\n * With the id class, sequences of ids can be created. for this purpose, an internal counter is incremented for each prefix.\n * thus, the first id with the prefix `myid` will be `myid1` and the second id `myid2`.\n * The ids are the same for every call, for example on a web page.\n *\n * So the ids can also be used for navigation. you just have to take care that the order stays the same.\n *\n * You can call the method via the monster namespace `new Monster.Types.ID()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Types.ID())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/id.js';\n * console.log(new ID())\n * </script>\n * ```\n *\n * As of version 1.6.0 there is the new RandomID. this ID class is continuous from now on.\n *\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @summary Automatic generation of ids\n */\nclass ID extends Base {\n\n    /**\n     * create new id with prefix\n     *\n     * @param {string} prefix\n     */\n    constructor(prefix) {\n        super();\n\n        if (prefix === undefined) {\n            prefix = \"id\";\n        }\n\n        validateString(prefix);\n\n        if (!internalCounter.has(prefix)) {\n            internalCounter.set(prefix, 1);\n        }\n\n        let count = internalCounter.get(prefix);\n        this.id = prefix + count;\n\n        internalCounter.set(prefix, ++count);\n    }\n\n    /**\n     * @return {string}\n     */\n    toString() {\n        return this.id;\n    }\n\n}\n\nassignToNamespace('Monster.Types', ID);\nexport {Monster, ID}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {getGlobalFunction} from \"../types/global.js\";\nimport {ProxyObserver} from \"../types/proxyobserver.js\";\nimport {validateInstance, validateString} from \"../types/validate.js\";\n\n\n/**\n * attribute prefix\n *\n * @type {string}\n * @memberOf Monster.DOM\n */\nconst ATTRIBUTEPREFIX = \"data-monster-\";\n\n/**\n * you can call the method via the monster namespace `new Monster.DOM.Assembler()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.DOM.Assembler())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Assembler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/assembler.js';\n * console.log(new Assembler())\n * </script>\n * ```\n *\n * @since 1.6.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @summary Allows you to build an html fragment\n */\nclass Assembler extends Base {\n\n    /**\n     * @param {DocumentFragment} fragment\n     * @throws {TypeError} value is not an instance of\n     * @throws {TypeError} value is not a function\n     * @throws {Error} the function is not defined\n     */\n    constructor(fragment) {\n        super();\n        this.attributePrefix = ATTRIBUTEPREFIX;\n        validateInstance(fragment, getGlobalFunction('DocumentFragment'));\n        this.fragment = fragment;\n    }\n\n    /**\n     *\n     * @param {string} prefix\n     * @returns {Assembler}\n     * @throws {TypeError} value is not a string\n     */\n    setAttributePrefix(prefix) {\n        validateString(prefix);\n        this.attributePrefix = prefix;\n        return this;\n    }\n\n    /**\n     *\n     * @returns {string}\n     */\n    getAttributePrefix() {\n        return this.attributePrefix;\n    }\n\n    /**\n     *\n     * @param {ProxyObserver|undefined} data\n     * @return {DocumentFragment}\n     * @throws {TypeError} value is not an instance of\n     */\n    createDocumentFragment(data) {\n\n        if (data === undefined) {\n            data = new ProxyObserver({});\n        }\n\n        validateInstance(data, ProxyObserver);\n        let fragment = this.fragment.cloneNode(true);\n        return fragment;\n    }\n\n}\n\nassignToNamespace('Monster.DOM', Assembler);\nexport {Monster, ATTRIBUTEPREFIX, Assembler}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from './base.js';\nimport {isArray, isObject, isPrimitive} from \"./is.js\";\nimport {Observer} from \"./observer.js\";\nimport {ObserverList} from \"./observerlist.js\";\nimport {validateObject} from \"./validate.js\";\nimport {extend} from \"../data/extend.js\";\n\n/**\n * An observer manages a callback function\n *\n * You can call create the class via the monster namespace `new Monster.Types.ProxyObserver()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.ProxyObserver()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this class individually.\n *\n * ```\n * <script type=\"module\">\n * import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/proxyobserver.js';\n * new ProxyObserver()\n * </script>\n * ```\n *\n * with the ProxyObserver you can attach observer for observation. with each change at the object to be observed an update takes place.\n *\n * this also applies to nested objects.\n *\n * @example\n *\n * import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/proxyobserver.js';\n * import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/observer.js';\n * import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n *\n * const o = new Observer(function () { \n *   if (isObject(this) && this instanceof ProxyObserver) {\n *       // do something (this ist ProxyObserver)\n *       const subject = this.getSubject();\n *       console.log(subject);\n *   }\n * });\n *\n * let realSubject = {\n *   a: {\n *       b: {\n *           c: true\n *       },\n *       d: 9\n *   }\n * }\n *\n * const p = new ProxyObserver(realSubject);\n * p.attachObserver(o);\n * const s = p.getSubject();\n * s.a.b.c = false;\n *\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass ProxyObserver extends Base {\n\n    /**\n     *\n     * @param {object} object\n     * @throws {TypeError} value is not a object\n     */\n    constructor(object) {\n        super();\n\n        this.realSubject = validateObject(object);\n        this.subject = new Proxy(object, getHandler.call(this));\n\n        this.objectMap = new WeakMap();\n        this.objectMap.set(this.realSubject, this.subject);\n\n        this.proxyMap = new WeakMap();\n        this.proxyMap.set(this.subject, this.realSubject);\n\n        this.observers = new ObserverList;\n    }\n\n    /**\n     * get the real object\n     *\n     * changes to this object are not noticed by the observers, so you can make a large number of changes and inform the observers later.\n     *\n     * @returns {object}\n     */\n    getSubject() {\n        return this.subject\n    }\n\n    /**\n     * @since 1.24.0\n     * @param {Object} obj\n     * @return {Monster.Types.ProxyObserver}\n     */\n    setSubject(obj) {\n\n        let i, k = Object.keys(this.subject);\n        for (i = 0; i < k.length; i++) {\n            delete this.subject[k[i]];\n        }\n\n        this.subject = extend(this.subject, obj);\n        return this;\n    }\n\n    /**\n     * get the proxied object\n     *\n     * @returns {object}\n     */\n    getRealSubject() {\n        return this.realSubject\n    }\n\n    /**\n     * attach a new observer\n     *\n     * @param {Observer} observer\n     * @returns {ProxyObserver}\n     */\n    attachObserver(observer) {\n        this.observers.attach(observer)\n        return this;\n    }\n\n    /**\n     * detach a observer\n     *\n     * @param {Observer} observer\n     * @returns {ProxyObserver}\n     */\n    detachObserver(observer) {\n        this.observers.detach(observer)\n        return this;\n    }\n\n    /**\n     * notify all observer\n     *\n     * @returns {Promise}\n     */\n    notifyObservers() {\n        return this.observers.notify(this);\n    }\n\n    /**\n     * @param {Observer} observer\n     * @returns {boolean}\n     */\n    containsObserver(observer) {\n        return this.observers.contains(observer)\n    }\n\n}\n\nassignToNamespace('Monster.Types', ProxyObserver);\nexport {Monster, ProxyObserver}\n\n/**\n *\n * @returns {{defineProperty: (function(*=, *=, *=): *), setPrototypeOf: (function(*, *=): boolean), set: (function(*, *, *, *): boolean), get: ((function(*=, *=, *=): (undefined))|*), deleteProperty: ((function(*, *): (boolean))|*)}}\n * @private\n * @see {@link https://gitlab.schukai.com/-/snippets/49}\n */\nfunction getHandler() {\n\n    const proxy = this;\n\n    // https://262.ecma-international.org/9.0/#sec-proxy-object-internal-methods-and-internal-slots\n    const handler = {\n\n        // https://262.ecma-international.org/9.0/#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiver\n        get: function (target, key, receiver) {\n\n            const value = Reflect.get(target, key, receiver);\n\n            if (typeof key === \"symbol\") {\n                return value;\n            }\n\n            if (isPrimitive(value)) {\n                return value;\n            }\n\n            // set value as proxy if object or array\n            if ((isArray(value) || isObject(value))) {\n                if (proxy.objectMap.has(value)) {\n                    return proxy.objectMap.get(value);\n                } else if (proxy.proxyMap.has(value)) {\n                    return value;\n                } else {\n                    let p = new Proxy(value, handler);\n                    proxy.objectMap.set(value, p);\n                    proxy.proxyMap.set(p, value);\n                    return p;\n                }\n\n            }\n\n            return value;\n\n        },\n\n        // https://262.ecma-international.org/9.0/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver \n        set: function (target, key, value, receiver) {\n\n            if (proxy.proxyMap.has(value)) {\n                value = proxy.proxyMap.get(value);\n            }\n\n            if (proxy.proxyMap.has(target)) {\n                target = proxy.proxyMap.get(target);\n            }\n\n            let current = Reflect.get(target, key, receiver);\n            if (proxy.proxyMap.has(current)) {\n                current = proxy.proxyMap.get(current);\n            }\n\n            if (current === value) {\n                return true;\n            }\n\n            let result;\n            let descriptor = Reflect.getOwnPropertyDescriptor(target, key);\n\n            if (descriptor === undefined) {\n                descriptor = {\n                    writable: true,\n                    enumerable: true,\n                    configurable: true\n                }\n            }\n\n            descriptor['value'] = value;\n            result = Reflect.defineProperty(target, key, descriptor);\n\n            if (typeof key !== \"symbol\") {\n                proxy.observers.notify(proxy);\n            }\n\n            return result;\n        },\n\n\n        // https://262.ecma-international.org/9.0/#sec-proxy-object-internal-methods-and-internal-slots-delete-p\n        deleteProperty: function (target, key) {\n            if (key in target) {\n                delete target[key];\n\n                if (typeof key !== \"symbol\") {\n                    proxy.observers.notify(proxy);\n                }\n\n                return true;\n            }\n            return false;\n        },\n\n        // https://262.ecma-international.org/9.0/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc\n        defineProperty: function (target, key, descriptor) {\n\n            let result = Reflect.defineProperty(target, key, descriptor);\n            if (typeof key !== \"symbol\") {\n                proxy.observers.notify(proxy);\n            }\n            return result;\n        },\n\n        // https://262.ecma-international.org/9.0/#sec-proxy-object-internal-methods-and-internal-slots-setprototypeof-v\n        setPrototypeOf: function (target, key) {\n            let result = Reflect.setPrototypeOf(object1, key);\n\n            if (typeof key !== \"symbol\") {\n                proxy.observers.notify(proxy);\n            }\n\n            return result;\n        }\n\n    };\n\n\n    return handler;\n}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from './base.js';\nimport {isObject} from './is.js';\nimport {TokenList} from './tokenlist.js';\nimport {UniqueQueue} from './uniquequeue.js';\n\n/**\n * An observer manages a callback function\n *\n * You can call the method via the monster namespace `new Monster.Types.Observer()`.\n *\n * ```\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.Observer()\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/observer.js';\n * new Observer()\n * ```\n *\n * The update method is called with the subject object as this pointer. For this reason the callback should not\n * be an arrow function, because it gets the this pointer of its own context.\n *\n * ```\n * new Observer(()=>{\n *     // this is not subject\n * })\n *\n * new Observer(function() {\n *     // this is subject\n * })\n * ```\n *\n * Additional arguments can be passed to the callback. To do this, simply specify them.\n *\n * ```\n * Observer(function(a, b, c) {\n *     console.log(a, b, c); // ↦ \"a\", 2, true \n * }, \"a\", 2, true)\n * ```\n *\n * The callback function must have as many parameters as arguments are given.\n *\n * @example\n *\n * import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/observer.js';\n *\n * const observer = new Observer(function(a, b, c) {\n *      console.log(this, a, b, c); // ↦ \"a\", 2, true \n * }, \"a\", 2, true);\n *\n * observer.update({value:true}).then(()=>{});\n * // ↦ {value: true} \"a\" 2 true\n *\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass Observer extends Base {\n\n    /**\n     *\n     * @param {function} callback\n     * @param {*} args\n     */\n    constructor(callback, ...args) {\n        super();\n\n        if (typeof callback !== 'function') {\n            throw new Error(\"observer callback must be a function\")\n        }\n\n        this.callback = callback;\n        this.arguments = args;\n        this.tags = new TokenList;\n        this.queue = new UniqueQueue();\n    }\n\n    /**\n     *\n     * @param {string} tag\n     * @returns {Observer}\n     */\n    addTag(tag) {\n        this.tags.add(tag);\n        return this;\n    }\n\n    /**\n     *\n     * @param {string} tag\n     * @returns {Observer}\n     */\n    removeTag(tag) {\n        this.tags.remove(tag);\n        return this;\n    }\n\n    /**\n     *\n     * @returns {Array}\n     */\n    getTags() {\n        return this.tags.entries()\n    }\n\n    /**\n     *\n     * @param {string} tag\n     * @returns {boolean}\n     */\n    hasTag(tag) {\n        return this.tags.contains(tag)\n    }\n\n    /**\n     *\n     * @param {object} subject\n     * @returns {Promise}\n     */\n    update(subject) {\n        let self = this;\n\n        return new Promise(function (resolve, reject) {\n            if (!isObject(subject)) {\n                reject(\"subject must be an object\");\n                return;\n            }\n\n            self.queue.add(subject);\n\n            setTimeout(() => {\n\n                try {\n                    // the queue and the settimeout ensure that an object is not \n                    // informed of the same change more than once.\n                    if (self.queue.isEmpty()) {\n                        resolve();\n                        return;\n                    }\n\n                    let s = self.queue.poll();\n                    let result = self.callback.apply(s, self.arguments);\n\n                    if (isObject(result) && result instanceof Promise) {\n                        result.then(resolve).catch(reject);\n                        return;\n                    }\n\n                    resolve(result);\n\n                } catch (e) {\n                    reject(e);\n                }\n            }, 0)\n\n        });\n\n    };\n\n}\n\nassignToNamespace('Monster.Types', Observer);\nexport {Monster, Observer}\n\n\n\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {isIterable, isString} from '../types/is.js';\nimport {validateFunction, validateString} from '../types/validate.js';\nimport {Base} from './base.js';\n\n/**\n * A tokenlist allows you to manage tokens (individual character strings such as css classes in an attribute string).\n *\n * The tokenlist offers various functions to manipulate values. For example, you can add, remove or replace a class in a CSS list.\n *\n * You can call the method via the monster namespace `new Monster.Types.TokenList()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.TokenList(\"myclass row\")\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {TokenList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/tokenlist.js';\n * new TokenList(\"myclass row\")\n * </script>\n * ```\n *\n * This class implements the [iteration protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).\n *\n * ```\n * typeof new TokenList(\"myclass row\")[Symbol.iterator]; \n * // ↦ \"function\"\n * ```\n *\n * @since 1.2.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass TokenList extends Base {\n\n    /**\n     *\n     * @param {array|string|iteratable} init\n     */\n    constructor(init) {\n        super();\n        this.tokens = new Set();\n\n        if (typeof init !== \"undefined\") {\n            this.add(init);\n        }\n\n    }\n\n    /**\n     * Iterator protocol\n     *\n     * @returns {Symbol.iterator}\n     */\n    getIterator() {\n        return this[Symbol.iterator]();\n    }\n\n    /**\n     * Iterator\n     *\n     * @returns {{next: ((function(): ({value: *, done: boolean}))|*)}}\n     */\n    [Symbol.iterator]() {\n        // Use a new index for each iterator. This makes multiple\n        // iterations over the iterable safe for non-trivial cases,\n        // such as use of break or nested looping over the same iterable.\n        let index = 0;\n        let entries = this.entries()\n\n        return {\n            next: () => {\n                if (index < entries.length) {\n                    return {value: entries?.[index++], done: false}\n                } else {\n                    return {done: true}\n                }\n            }\n        }\n    }\n\n    /**\n     * Returns true if it contains token, otherwise false\n     *\n     * ```\n     * new TokenList(\"start middle end\").contains('start')); // ↦ true\n     * new TokenList(\"start middle end\").contains('end')); // ↦ true\n     * new TokenList(\"start middle end\").contains('xyz')); // ↦ false\n     * new TokenList(\"start middle end\").contains(['end','start','middle'])); // ↦ true\n     * new TokenList(\"start middle end\").contains(['end','start','xyz'])); // ↦ false\n     * ```\n     *\n     * @param {array|string|iteratable} value\n     * @returns {boolean}\n     */\n    contains(value) {\n        if (isString(value)) {\n            value = value.trim()\n            let counter = 0;\n            value.split(\" \").forEach(token => {\n                if (this.tokens.has(token.trim()) === false) return false;\n                counter++\n            })\n            return counter > 0 ? true : false;\n        }\n\n        if (isIterable(value)) {\n            let counter = 0;\n            for (let token of value) {\n                validateString(token);\n                if (this.tokens.has(token.trim()) === false) return false;\n                counter++\n            }\n            return counter > 0 ? true : false;\n        }\n\n        return false;\n    }\n\n    /**\n     * add tokens\n     *\n     * ```\n     * new TokenList().add(\"abc xyz\").toString(); // ↦ \"abc xyz\"\n     * new TokenList().add([\"abc\",\"xyz\"]).toString(); // ↦ \"abc xyz\"\n     * new TokenList().add(undefined); // ↦ add nothing\n     * ```\n     *\n     * @param {array|string|iteratable} value\n     * @returns {TokenList}\n     * @throws {TypeError} unsupported value\n     */\n    add(value) {\n        if (isString(value)) {\n            value.split(\" \").forEach(token => {\n                this.tokens.add(token.trim());\n            })\n        } else if (isIterable(value)) {\n            for (let token of value) {\n                validateString(token);\n                this.tokens.add(token.trim());\n            }\n        } else if (typeof value !== \"undefined\") {\n            throw new TypeError(\"unsupported value\");\n        }\n\n        return this;\n    }\n\n    /**\n     * remove all tokens\n     *\n     * @returns {TokenList}\n     */\n    clear() {\n        this.tokens.clear();\n        return this;\n    }\n\n    /**\n     * Removes token\n     *\n     * ```\n     * new TokenList(\"abc xyz\").remove(\"xyz\").toString(); // ↦ \"abc\"\n     * new TokenList(\"abc xyz\").remove([\"xyz\"]).toString(); // ↦ \"abc\"\n     * new TokenList(\"abc xyz\").remove(undefined); // ↦ remove nothing\n     * ```\n     *\n     * @param {array|string|iteratable} value\n     * @returns {TokenList}\n     * @throws {TypeError} unsupported value\n     */\n    remove(value) {\n        if (isString(value)) {\n            value.split(\" \").forEach(token => {\n                this.tokens.delete(token.trim());\n            })\n        } else if (isIterable(value)) {\n            for (let token of value) {\n                validateString(token);\n                this.tokens.delete(token.trim());\n            }\n        } else if (typeof value !== \"undefined\") {\n            throw new TypeError(\"unsupported value\", \"types/tokenlist.js\");\n        }\n\n        return this;\n    }\n\n    /**\n     * this method replaces a token with a new token.\n     *\n     * if the passed token exists, it is replaced with newToken and TokenList is returned.\n     * if the token does not exist, newToken is not set and TokenList is returned.\n     *\n     * @param {string} token\n     * @param {string} newToken\n     * @returns {TokenList}\n     */\n    replace(token, newToken) {\n        validateString(token);\n        validateString(newToken);\n        if (!this.contains(token)) {\n            return this;\n        }\n\n        let a = Array.from(this.tokens)\n        let i = a.indexOf(token);\n        if (i === -1) return this;\n\n        a.splice(i, 1, newToken);\n        this.tokens = new Set();\n        this.add(a);\n\n        return this;\n\n\n    }\n\n    /**\n     * Removes token from string. If token doesn't exist it's added.\n     *\n     * ```\n     * new TokenList(\"abc def ghi\").toggle(\"def xyz\").toString(); // ↦ \"abc ghi xyz\"\n     * new TokenList(\"abc def ghi\").toggle([\"abc\",\"xyz\"]).toString(); // ↦ \"def ghi xyz\"\n     * new TokenList().toggle(undefined); // ↦ nothing\n     * ```\n     *\n     * @param {array|string|iteratable} value\n     * @returns {boolean}\n     * @throws {TypeError} unsupported value\n     */\n    toggle(value) {\n\n        if (isString(value)) {\n            value.split(\" \").forEach(token => {\n                toggleValue.call(this, token);\n            })\n        } else if (isIterable(value)) {\n            for (let token of value) {\n                toggleValue.call(this, token);\n            }\n        } else if (typeof value !== \"undefined\") {\n            throw new TypeError(\"unsupported value\", \"types/tokenlist.js\");\n        }\n\n        return this;\n\n    }\n\n    /**\n     * returns an array with all tokens\n     *\n     * @returns {array}\n     */\n    entries() {\n        return Array.from(this.tokens)\n    }\n\n    /**\n     * executes the provided function with each value of the set\n     *\n     * @param {function} callback\n     * @returns {TokenList}\n     */\n    forEach(callback) {\n        validateFunction(callback);\n        this.tokens.forEach(callback);\n        return this;\n    }\n\n    /**\n     * returns the individual tokens separated by a blank character\n     *\n     * @returns {string}\n     */\n    toString() {\n        return this.entries().join(' ');\n    }\n\n}\n\n/**\n * @private\n * @param token\n * @returns {toggleValue}\n * @throws {Error} must be called with TokenList.call\n */\nfunction toggleValue(token) {\n    if (!(this instanceof TokenList)) throw Error(\"must be called with TokenList.call\")\n    validateString(token);\n    token = token.trim();\n    if (this.contains(token)) {\n        this.remove(token);\n        return this;\n    }\n    this.add(token);\n    return this;\n}\n\nassignToNamespace('Monster.Types', TokenList);\nexport {Monster, TokenList}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Queue} from \"./queue.js\";\nimport {validateObject} from \"./validate.js\";\n\n/**\n * You can call the method via the monster namespace `new Monster.Types.Queue()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.UniqueQueue()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {UniqueQueue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/uniquequeue.js';\n * new UniqueQueue()\n * </script>\n * ```\n *\n * @since 1.4.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @summary A queue for unique values\n */\nclass UniqueQueue extends Queue {\n\n    /**\n     *\n     */\n    constructor() {\n        super();\n        this.unique = new WeakSet();\n    }\n\n    /**\n     * Add a new element to the end of the queue.\n     *\n     * @param {object} value\n     * @returns {Queue}\n     * @throws {TypeError} value is not a object\n     */\n    add(value) {\n\n        validateObject(value);\n\n        if (!this.unique.has(value)) {\n            this.unique.add(value);\n            super.add(value);\n        }\n\n        return this;\n    }\n\n    /**\n     * remove all entries\n     *\n     * @returns {Queue}\n     */\n    clear() {\n        super.clear();\n        this.unique = new WeakSet;\n        return this;\n    }\n\n    /**\n     * Remove the element at the front of the queue\n     * If the queue is empty, return undefined.\n     *\n     * @return {object}\n     */\n    poll() {\n\n        if (this.isEmpty()) {\n            return undefined;\n        }\n        let value = this.data.shift();\n        this.unique.delete(value);\n        return value;\n    }\n\n\n}\n\nassignToNamespace('Monster.Types', UniqueQueue);\nexport {Monster, UniqueQueue}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from './base.js';\n\n/**\n * You can create the instance via the monster namespace `new Monster.Types.Queue()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.Queue()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Queue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/queue.js';\n * new Queue()\n * </script>\n * ```\n *\n * @example\n *\n * import {Queue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/queue.js';\n *\n * const queue = new Queue;\n *\n * queue.add(2);\n * queue.add(true);\n * queue.add(\"Hello\");\n * queue.add(4.5);\n *\n * console.log(queue.poll());\n * // ↦ 2\n * console.log(queue.poll());\n * // ↦ true\n * console.log(queue.poll());\n * // ↦ \"Hello\"\n * console.log(queue.poll());\n * // ↦ 4.5\n * console.log(queue.poll());\n * // ↦ undefined\n *\n *\n * @since 1.4.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @summary A Queue (Fifo)\n */\nclass Queue extends Base {\n\n    /**\n     *\n     */\n    constructor() {\n        super();\n        this.data = [];\n    }\n\n\n    /**\n     * @return {boolean}\n     */\n    isEmpty() {\n        return this.data.length === 0;\n    }\n\n    /**\n     * Read the element at the front of the queue without removing it.\n     *\n     * @return {*}\n     */\n    peek() {\n        if (this.isEmpty()) {\n            return undefined;\n        }\n\n        return this.data[0];\n    }\n\n    /**\n     * Add a new element to the end of the queue.\n     *\n     * @param {*} value\n     * @returns {Queue}\n     */\n    add(value) {\n        this.data.push(value)\n        return this;\n    }\n\n    /**\n     * remove all entries\n     *\n     * @returns {Queue}\n     */\n    clear() {\n        this.data = [];\n        return this;\n    }\n\n    /**\n     * Remove the element at the front of the queue\n     * If the queue is empty, return undefined.\n     *\n     * @return {*}\n     */\n    poll() {\n        if (this.isEmpty()) {\n            return undefined;\n        }\n        return this.data.shift();\n    }\n\n\n}\n\nassignToNamespace('Monster.Types', Queue);\nexport {Monster, Queue}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from './base.js';\nimport {Observer} from \"./observer.js\";\nimport {validateInstance} from \"./validate.js\";\n\n/**\n * With the help of the ObserverList class, observer can be managed.\n *\n * You can call the method via the monster namespace `new Monster.Types.ObserverList()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Types.ObserverList())\n * console.log(new Monster.Types.ObserverList())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {ObserverList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/observerlist.js';\n * console.log(ObserverList())\n * console.log(ObserverList())\n * </script>\n * ```\n *\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass ObserverList extends Base {\n\n    /**\n     *\n     */\n    constructor() {\n        super();\n        this.observers = [];\n    }\n\n    /**\n     *\n     * @param {Observer} observer\n     * @return {ObserverList}\n     * @throws {TypeError} value is not an instance of Observer\n     */\n    attach(observer) {\n        validateInstance(observer, Observer)\n\n        this.observers.push(observer);\n        return this;\n    };\n\n    /**\n     *\n     * @param {Observer} observer\n     * @return {ObserverList}\n     * @throws {TypeError} value is not an instance of Observer\n     */\n    detach(observer) {\n        validateInstance(observer, Observer)\n\n        var i = 0, l = this.observers.length;\n        for (; i < l; i++) {\n            if (this.observers[i] === observer) {\n                this.observers.splice(i, 1);\n            }\n        }\n\n        return this;\n    };\n\n    /**\n     *\n     * @param {Observer} observer\n     * @return {boolean}\n     * @throws {TypeError} value is not an instance of Observer\n     */\n    contains(observer) {\n        validateInstance(observer, Observer)\n        var i = 0, l = this.observers.length;\n        for (; i < l; i++) {\n            if (this.observers[i] === observer) {\n                return true;\n            }\n        }\n        return false;\n    };\n\n    /**\n     *\n     * @param subject\n     * @return {Promise}\n     */\n    notify(subject) {\n\n        let pomises = []\n\n        let i = 0, l = this.observers.length;\n        for (; i < l; i++) {\n            pomises.push(this.observers[i].update(subject));\n        }\n\n        return Promise.all(pomises);\n    };\n\n}\n\nassignToNamespace('Monster.Types', ObserverList);\nexport {Monster, ObserverList}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {getGlobalFunction} from \"../types/global.js\";\nimport {TokenList} from \"../types/tokenlist.js\";\nimport {validateInstance, validateString, validateSymbol} from \"../types/validate.js\";\nimport {ATTRIBUTE_OBJECTLINK} from \"./constants.js\";\n\n/**\n * Get the closest object link of a node\n *\n * if a node is specified without a object link, a recursive search upwards is performed until the corresponding\n * object link is found, or undefined is returned.\n *\n * you can call the method via the monster namespace `Monster.DOM.getUpdaterFromNode()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.DOM.findClosestObjectLink())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getUpdaterFromNode} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/updater.js';\n * console.log(findClosestObjectLink())\n * </script>\n * ```\n *\n * @param {HTMLElement} element\n * @return {HTMLElement|undefined}\n * @since 1.10.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {TypeError} value is not an instance of HTMLElement\n */\nfunction findClosestObjectLink(element) {\n    return findClosestByAttribute(element, ATTRIBUTE_OBJECTLINK);\n}\n\n/**\n * You can call the method via the monster namespace `new Monster.DOM.addToObjectLink()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.addToObjectLink();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {addToObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * addToObjectLink();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {Symbol} symbol\n * @param {Object} object\n * @return {boolean}\n */\nfunction addToObjectLink(element, symbol, object) {\n\n    validateInstance(element, HTMLElement);\n    validateSymbol(symbol)\n\n    if (element?.[symbol] === undefined) {\n        element[symbol] = new Set;\n    }\n\n    addAttributeToken(element, ATTRIBUTE_OBJECTLINK, symbol.toString());\n    element[symbol].add(object);\n    return element;\n\n}\n\n/**\n * You can call the method via the monster namespace `new Monster.DOM.removeObjectLink()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.removeObjectLink();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {removeObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * removeObjectLink();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {Symbol} symbol\n * @return {boolean}\n */\nfunction removeObjectLink(element, symbol) {\n\n    validateInstance(element, HTMLElement);\n    validateSymbol(symbol)\n\n    if (element?.[symbol] === undefined) {\n        return element\n    }\n\n    removeAttributeToken(element, ATTRIBUTE_OBJECTLINK, symbol.toString());\n    delete element[symbol];\n    return element;\n\n}\n\n\n/**\n * You can call the method via the monster namespace `new Monster.DOM.hasObjectLink()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.hasObjectLink();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {hasObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * hasObjectLink();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {Symbol} symbol\n * @return {boolean}\n */\nfunction hasObjectLink(element, symbol) {\n\n    validateInstance(element, HTMLElement);\n    validateSymbol(symbol)\n\n    if (element?.[symbol] === undefined) {\n        return false\n    }\n\n    return containsAttributeToken(element, ATTRIBUTE_OBJECTLINK, symbol.toString());\n\n}\n\n/**\n * The ObjectLink can be used to attach objects to HTMLElements. The elements are kept in a set under a unique\n * symbol and can be read via an iterator {@see {@link getLinkedObjects}}.\n *\n * In addition, elements with an objectLink receive the attribute `data-monster-objectlink`.\n *\n * With the method  {@see {@link addToObjectLink}} the objects can be added.\n *\n * You can call the method via the monster namespace `new Monster.DOM.getLinkedObjects()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.getLinkedObjects();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getLinkedObjects} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * getLinkedObjects();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {Symbol} symbol\n * @return {Iterator}\n * @throws {Error} there is no object link for symbol\n */\nfunction getLinkedObjects(element, symbol) {\n\n    validateInstance(element, HTMLElement);\n    validateSymbol(symbol)\n\n    if (element?.[symbol] === undefined) {\n        throw new Error('there is no object link for ' + symbol.toString());\n    }\n\n    return element?.[symbol][Symbol.iterator]();\n\n}\n\n\n/**\n * With this method tokens in an attribute can be switched on or off. For example, classes can be switched on and off in the elements class attribute.\n *\n * Tokens are always separated by a space.\n *\n * You can call the method via the monster namespace `new Monster.DOM.toggleAttributeToken()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.toggleAttributeToken();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {toggleAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * toggleAttributeToken();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} key\n * @param {string} token\n * @return {HTMLElement}\n */\nfunction toggleAttributeToken(element, key, token) {\n    validateInstance(element, HTMLElement);\n    validateString(token)\n    validateString(key)\n\n    if (!element.hasAttribute(key)) {\n        element.setAttribute(key, token);\n        return element;\n    }\n\n    element.setAttribute(key, new TokenList(element.getAttribute(key)).toggle(token).toString());\n\n    return element\n}\n\n/**\n * This method can be used to add a token to an attribute. Tokens are always separated by a space.\n *\n * You can call the method via the monster namespace `new Monster.DOM.addAttributeToken()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.addAttributeToken();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {addAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * addAttributeToken();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} key\n * @param {string} token\n * @return {HTMLElement}\n */\nfunction addAttributeToken(element, key, token) {\n    validateInstance(element, HTMLElement);\n    validateString(token)\n    validateString(key)\n\n    if (!element.hasAttribute(key)) {\n        element.setAttribute(key, token);\n        return element;\n    }\n\n    element.setAttribute(key, new TokenList(element.getAttribute(key)).add(token).toString());\n\n    return element\n}\n\n/**\n * This function can be used to remove tokens from an attribute.\n *\n * Tokens are always separated by a space.\n *\n * You can call the method via the monster namespace `new Monster.DOM.removeAttributeToken()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.removeAttributeToken();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {removeAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * removeAttributeToken();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} key\n * @param {string} token\n * @return {HTMLElement}\n */\nfunction removeAttributeToken(element, key, token) {\n    validateInstance(element, HTMLElement);\n    validateString(token)\n    validateString(key)\n\n    if (!element.hasAttribute(key)) {\n        return element;\n    }\n\n    element.setAttribute(key, new TokenList(element.getAttribute(key)).remove(token).toString());\n\n    return element\n}\n\n/**\n * This method can be used to determine whether an attribute has a token.\n *\n * Tokens are always separated by a space.\n *\n * You can call the method via the monster namespace `new Monster.DOM.containsAttributeToken()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.containsAttributeToken();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {containsAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * containsAttributeToken();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} key\n * @param {string} token\n * @return {boolean}\n */\nfunction containsAttributeToken(element, key, token) {\n    validateInstance(element, HTMLElement);\n    validateString(token)\n    validateString(key)\n\n    if (!element.hasAttribute(key)) {\n        return false;\n    }\n\n    return new TokenList(element.getAttribute(key)).contains(token);\n\n}\n\n/**\n * Tokens are always separated by a space.\n *\n * You can call the method via the monster namespace `new Monster.DOM.replaceAttributeToken()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.replaceAttributeToken();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {replaceAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * replaceAttributeToken();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} key\n * @param {string} from\n * @param {string} to\n * @return {HTMLElement}\n */\nfunction replaceAttributeToken(element, key, from, to) {\n    validateInstance(element, HTMLElement);\n    validateString(from)\n    validateString(to)\n    validateString(key)\n\n    if (!element.hasAttribute(key)) {\n        return element;\n    }\n\n    element.setAttribute(key, new TokenList(element.getAttribute(key)).replace(from, to).toString());\n\n    return element\n}\n\n/**\n * Tokens are always separated by a space.\n *\n * You can call the method via the monster namespace `new Monster.DOM.clearAttributeTokens()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.clearAttributeTokens();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {clearAttributeTokens} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * clearAttributeTokens();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} key\n * @return {HTMLElement}\n */\nfunction clearAttributeTokens(element, key) {\n    validateInstance(element, HTMLElement);\n    validateString(key)\n\n    if (!element.hasAttribute(key)) {\n        return element;\n    }\n\n    element.setAttribute(key, \"\");\n\n    return element\n}\n\n/**\n * This function searches, starting from an `HTMLElemement`, for the next element that has a certain attribute.\n *\n * ```html\n * <div data-my-attribute=\"2\" id=\"2\">\n *     <div id=\"1\"></div>\n * </div>\n * ```\n *\n * ```javascript\n * // if no value is specified (undefined), then only the attribute is checked.\n * findClosestByAttribute(document.getElementById('1'),'data-my-attribute'); // ↦ node with id 2\n * findClosestByAttribute(document.getElementById('2'),'data-my-attribute'); // ↦ node with id 2\n *\n * // if a value is specified, for example an empty string, then the name and the value are checked.\n * findClosestByAttribute(document.getElementById('1'),'data-my-attribute', '');  // ↦ undefined\n * findClosestByAttribute(document.getElementById('1'),'data-my-attribute', '2'); // ↦ node with id 2\n * ```\n *\n * You can call the method via the monster namespace `new Monster.DOM.findClosestByAttribute()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.findClosestByAttribute();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {findClosestByAttribute} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * findClosestByAttribute();\n * </script>\n * ```\n *\n * @since 1.14.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} key\n * @param {string|undefined} value\n * @return {HTMLElement|undefined}\n * @summary find closest node\n */\nfunction findClosestByAttribute(element, key, value) {\n    validateInstance(element, getGlobalFunction('HTMLElement'));\n\n    if (element.hasAttribute(key)) {\n        if (value === undefined) {\n            return element;\n        }\n\n        if (element.getAttribute(key) === value) {\n            return element;\n        }\n\n    }\n\n    let selector = validateString(key);\n    if (value !== undefined) selector += \"=\" + validateString(value);\n    let result = element.closest('[' + selector + ']');\n    if (result instanceof HTMLElement) {\n        return result;\n    }\n    return undefined;\n}\n\n/**\n * This function searches, starting from an `HTMLElemement`, for the next element that has a certain attribute.\n *\n * ```html\n * <div class=\"myclass\" id=\"2\">\n *     <div id=\"1\"></div>\n * </div>\n * ```\n *\n * ```javascript\n * // if no value is specified (undefined), then only the attribute is checked.\n * findClosestByClass(document.getElementById('1'),'myclass'); // ↦ node with id 2\n * findClosestByClass(document.getElementById('2'),'myclass'); // ↦ node with id 2\n * ```\n *\n * You can call the method via the monster namespace `new Monster.DOM.findClosestByClass()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.findClosestByClass();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {findClosestByClass} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * findClosestByClass();\n * </script>\n * ```\n *\n * @since 1.27.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} className\n * @return {HTMLElement|undefined}\n * @summary find closest node\n */\nfunction findClosestByClass(element, className) {\n    validateInstance(element, getGlobalFunction('HTMLElement'));\n\n    if (element?.classList?.contains(validateString(className))) {\n        return element;\n    }\n\n    let result = element.closest('.' + className);\n    if (result instanceof HTMLElement) {\n        return result;\n    }\n    \n    return undefined;\n}\n\n// exports\nassignToNamespace('Monster.DOM', findClosestByClass, getLinkedObjects, addToObjectLink, removeObjectLink, findClosestByAttribute, hasObjectLink, clearAttributeTokens, replaceAttributeToken, containsAttributeToken, removeAttributeToken, addAttributeToken, toggleAttributeToken);\nexport {\n    Monster,\n    addToObjectLink,\n    removeObjectLink,\n    hasObjectLink,\n    findClosestByAttribute,\n    clearAttributeTokens,\n    replaceAttributeToken,\n    containsAttributeToken,\n    removeAttributeToken,\n    addAttributeToken,\n    toggleAttributeToken,\n    getLinkedObjects,\n    findClosestObjectLink,\n    findClosestByClass\n}\n","'use strict';\n\nimport {Monster} from '../namespace.js';\n/**\n * @author schukai GmbH\n */\n\n\n/**\n * default theme\n * @memberOf Monster.DOM\n * @type {string}\n */\nconst DEFAULT_THEME = 'monster';\n\n/**\n * @memberOf Monster.DOM\n * @since 1.8.0\n * @type {string}\n */\nconst ATTRIBUTE_PREFIX = 'data-monster-';\n\n/**\n * This is the name of the attribute to pass options to a control\n *\n * @memberOf Monster.DOM\n * @since 1.8.0\n * @type {string}\n */\nconst ATTRIBUTE_OPTIONS = ATTRIBUTE_PREFIX + 'options';\n\n/**\n * This is the name of the attribute to pass options to a control\n *\n * @memberOf Monster.DOM\n * @since 1.30.0\n * @type {string}\n */\nconst ATTRIBUTE_OPTIONS_SELECTOR = ATTRIBUTE_PREFIX + 'options-selector';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.8.0\n */\nconst ATTRIBUTE_THEME_PREFIX = ATTRIBUTE_PREFIX + 'theme-';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n */\nconst ATTRIBUTE_THEME_NAME = ATTRIBUTE_THEME_PREFIX + 'name';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.8.0\n */\nconst ATTRIBUTE_UPDATER_ATTRIBUTES = ATTRIBUTE_PREFIX + 'attributes';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.27.1\n */\nconst ATTRIBUTE_UPDATER_SELECT_THIS = ATTRIBUTE_PREFIX + 'select-this';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.8.0\n */\nconst ATTRIBUTE_UPDATER_REPLACE = ATTRIBUTE_PREFIX + 'replace';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.8.0\n */\nconst ATTRIBUTE_UPDATER_INSERT = ATTRIBUTE_PREFIX + 'insert';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.8.0\n */\nconst ATTRIBUTE_UPDATER_INSERT_REFERENCE = ATTRIBUTE_PREFIX + 'insert-reference';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.8.0\n */\nconst ATTRIBUTE_UPDATER_REMOVE = ATTRIBUTE_PREFIX + 'remove';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.9.0\n */\nconst ATTRIBUTE_UPDATER_BIND = ATTRIBUTE_PREFIX + 'bind';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.27.0\n */\nconst ATTRIBUTE_TEMPLATE_PREFIX = ATTRIBUTE_PREFIX + 'template-prefix';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.14.0\n */\nconst ATTRIBUTE_ROLE = ATTRIBUTE_PREFIX + 'role';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.24.0\n */\nconst ATTRIBUTE_DISABLED = 'disabled';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.24.0\n */\nconst ATTRIBUTE_VALUE = 'value';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.9.0\n */\nconst ATTRIBUTE_OBJECTLINK = ATTRIBUTE_PREFIX + 'objectlink';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.24.0\n */\nconst ATTRIBUTE_ERRORMESSAGE = ATTRIBUTE_PREFIX + 'error';\n\n/**\n * @memberOf Monster.DOM\n * @type {symbol}\n * @since 1.24.0\n */\nconst objectUpdaterLinkSymbol = Symbol('monsterUpdater');\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst TAG_SCRIPT = 'script';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst TAG_STYLE = 'style';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst TAG_LINK = 'link';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\n\nconst ATTRIBUTE_ID = 'id';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\n\nconst ATTRIBUTE_CLASS = 'class';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_TITLE = 'title';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_SRC = 'src';\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_HREF = 'href';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_TYPE = 'type';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_NONCE = 'nonce';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_TRANSLATE = 'translate';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_TABINDEX = 'tabindex';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_SPELLCHECK = 'spellcheck';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_SLOT = 'slot';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_PART = 'part';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_LANG = 'lang';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_ITEMTYPE = 'itemtype';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_ITEMSCOPE = 'itemscope';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_ITEMREF = 'itemref';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_ITEMID = 'itemid';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_ITEMPROP = 'itemprop';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_IS = 'is';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_INPUTMODE = 'inputmode';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_ACCESSKEY = 'accesskey';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_AUTOCAPITALIZE = 'autocapitalize';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_AUTOFOCUS = 'autofocus';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_CONTENTEDITABLE = 'contenteditable';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_DIR = 'dir';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_DRAGGABLE = 'draggable';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_ENTERKEYHINT = 'enterkeyhint';\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_EXPORTPARTS = 'exportparts';\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_HIDDEN = 'hidden';\n\n\nexport {\n    Monster,\n    ATTRIBUTE_HIDDEN,\n    ATTRIBUTE_EXPORTPARTS,\n    ATTRIBUTE_ENTERKEYHINT,\n    ATTRIBUTE_DRAGGABLE,\n    ATTRIBUTE_DIR,\n    ATTRIBUTE_CONTENTEDITABLE,\n    ATTRIBUTE_AUTOFOCUS,\n    ATTRIBUTE_AUTOCAPITALIZE,\n    ATTRIBUTE_ACCESSKEY,\n    TAG_SCRIPT,\n    TAG_LINK,\n    ATTRIBUTE_INPUTMODE,\n    ATTRIBUTE_IS,\n    ATTRIBUTE_ITEMPROP,\n    ATTRIBUTE_ITEMID,\n    ATTRIBUTE_ITEMREF,\n    ATTRIBUTE_ITEMSCOPE,\n    TAG_STYLE,\n    ATTRIBUTE_ITEMTYPE,\n    ATTRIBUTE_HREF,\n    ATTRIBUTE_LANG,\n    ATTRIBUTE_PART,\n    ATTRIBUTE_SLOT,\n    ATTRIBUTE_SPELLCHECK,\n    ATTRIBUTE_SRC,\n    ATTRIBUTE_TABINDEX,\n    ATTRIBUTE_TRANSLATE,\n    ATTRIBUTE_NONCE,\n    ATTRIBUTE_TYPE,\n    ATTRIBUTE_TITLE,\n    ATTRIBUTE_CLASS,\n    ATTRIBUTE_ID,\n    ATTRIBUTE_PREFIX,\n    ATTRIBUTE_OPTIONS,\n    DEFAULT_THEME,\n    ATTRIBUTE_THEME_PREFIX,\n    ATTRIBUTE_ROLE,\n    ATTRIBUTE_THEME_NAME,\n    ATTRIBUTE_UPDATER_ATTRIBUTES,\n    ATTRIBUTE_UPDATER_REPLACE,\n    ATTRIBUTE_UPDATER_INSERT,\n    ATTRIBUTE_UPDATER_INSERT_REFERENCE,\n    ATTRIBUTE_UPDATER_REMOVE,\n    ATTRIBUTE_UPDATER_BIND,\n    ATTRIBUTE_OBJECTLINK,\n    ATTRIBUTE_DISABLED,\n    ATTRIBUTE_ERRORMESSAGE,\n    ATTRIBUTE_VALUE,\n    objectUpdaterLinkSymbol,\n    ATTRIBUTE_TEMPLATE_PREFIX,\n    ATTRIBUTE_UPDATER_SELECT_THIS,\n    ATTRIBUTE_OPTIONS_SELECTOR\n} ","'use strict';\n\nimport {extend} from \"../data/extend.js\";\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {ATTRIBUTE_VALUE} from \"./constants.js\";\nimport {CustomElement, attributeObserverSymbol} from \"./customelement.js\";\n\n\n/**\n * @private\n * @type {symbol}\n */\nconst attachedInternalSymbol = Symbol('attachedInternal');\n\n/**\n * To define a new HTML control we need the power of CustomElement\n *\n * IMPORTANT: after defining a `CustomElement`, the `registerCustomElement` method must be called\n * with the new class name. only then will the tag defined via the `getTag` method be made known to the DOM.\n *\n * <img src=\"./images/customcontrol-class.png\">\n *\n * This control uses `attachInternals()` to integrate the control into a form.\n * If the target environment does not support this method, the [polyfill](https://www.npmjs.com/package/element-internals-polyfill ) can be used.\n *\n * You can create the object via the function `document.createElement()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * document.createElement('monster-')\n * </script>\n * ```\n *\n * @startuml customcontrol-class.png\n * skinparam monochrome true\n * skinparam shadowing false\n * HTMLElement <|-- CustomElement\n * CustomElement <|-- CustomControl\n * @enduml\n *\n * @summary A base class for customcontrols based on CustomElement\n * @see {@link https://www.npmjs.com/package/element-internals-polyfill}\n * @see {@link https://github.com/WICG/webcomponents}\n * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements}\n * @since 1.14.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n */\nclass CustomControl extends CustomElement {\n\n    /**\n     * IMPORTANT: CustomControls instances are not created via the constructor, but either via a tag in the HTML or via <code>document.createElement()</code>.\n     *\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     * @summary create new Instance\n     */\n    constructor() {\n        super();\n\n        if (typeof this['attachInternals'] === 'function') {\n            /**\n             * currently only supported by chrome\n             * @property {Object}\n             * @private\n             */\n            this[attachedInternalSymbol] = this.attachInternals();\n        }\n\n        initObserver.call(this);\n\n    }\n\n    /**\n     * This method determines which attributes are to be monitored by `attributeChangedCallback()`.\n     *\n     * @return {string[]}\n     * @since 1.15.0\n     */\n    static get observedAttributes() {\n        const list = super.observedAttributes;\n        list.push(ATTRIBUTE_VALUE);\n        return list;\n    }    \n    \n    /**\n     *\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals}\n     * @since 1.14.0\n     * @return {boolean}\n     */\n    static get formAssociated() {\n        return true;\n    }\n\n    /**\n     * Derived classes can override and extend this method as follows.\n     *\n     * ```\n     * get defaults() {\n     *    return extends{}, super.defaults, {\n     *        myValue:true\n     *    });\n     * }\n     * ```\n     *\n     * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example}\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals}\n     * @return {object}\n     * @since 1.14.0\n     */\n    get defaults() {\n        return extend({}, super.defaults);\n    }\n\n    /**\n     * Must be overridden by a derived class and return the value of the control.\n     *\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @since 1.14.0\n     * @throws {Error} the value getter must be overwritten by the derived class\n     */\n    get value() {\n        throw Error('the value getter must be overwritten by the derived class');\n    }\n\n    /**\n     * Must be overridden by a derived class and return the value of the control.\n     *\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @param {*} value\n     * @since 1.14.0\n     * @throws {Error} the value setter must be overwritten by the derived class\n     */\n    set value(value) {\n        throw Error('the value setter must be overwritten by the derived class');\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {NodeList}\n     * @since 1.14.0\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/labels}\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     */\n    get labels() {\n        return getInternal.call(this)?.labels;\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {string|null}\n     */\n    get name() {\n        return this.getAttribute('name');\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {string}\n     */\n    get type() {\n        return this.constructor.getTag();\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {ValidityState}\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/ValidityState}\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/validity}\n     */\n    get validity() {\n        return getInternal.call(this)?.validity;\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {string}\n     * @since 1.14.0\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/validationMessage\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     */\n    get validationMessage() {\n        return getInternal.call(this)?.validationMessage;\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {boolean}\n     * @since 1.14.0\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/willValidate\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     */\n    get willValidate() {\n        return getInternal.call(this)?.willValidate;\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {CustomStateSet}\n     * @since 1.14.0\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     */\n    get states() {\n        return getInternal.call(this)?.states;\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {HTMLFontElement|null}\n     * @since 1.14.0\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/form\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     */\n    get form() {\n        return getInternal.call(this)?.form;\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * ```\n     * // Use the control's name as the base name for submitted data\n     * const n = this.getAttribute('name');\n     * const entries = new FormData();\n     * entries.append(n + '-first-name', this.firstName_);\n     * entries.append(n + '-last-name', this.lastName_);\n     * this.setFormValue(entries);\n     * ```\n     *\n     * @param {File|string|FormData} value\n     * @param {File|string|FormData} state\n     * @since 1.14.0\n     * @return {undefined}\n     * @throws {DOMException} NotSupportedError\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/setFormValue\n     */\n    setFormValue(value, state) {\n        getInternal.call(this).setFormValue(value, state);\n    }\n\n    /**\n     *\n     * @param {object} flags\n     * @param {string|undefined} message\n     * @param {HTMLElement} anchor\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/setValidity\n     * @since 1.14.0\n     * @return {undefined}\n     * @throws {DOMException} NotSupportedError\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     */\n    setValidity(flags, message, anchor) {\n        getInternal.call(this).setValidity(flags, message, anchor);\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/checkValidity\n     * @since 1.14.0\n     * @return {boolean}\n     * @throws {DOMException} NotSupportedError\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     */\n    checkValidity() {\n        return getInternal.call(this)?.checkValidity();\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {boolean}\n     * @since 1.14.0\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/reportValidity\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     * @throws {DOMException} NotSupportedError\n     */\n    reportValidity() {\n        return getInternal.call(this)?.reportValidity();\n    }\n\n}\n\n/**\n * @private\n * @return {object}\n * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n * @this CustomControl\n */\nfunction getInternal() {\n    const self = this;\n\n    if (!(attachedInternalSymbol in this)) {\n        throw new Error('ElementInternals is not supported and a polyfill is necessary');\n    }\n\n    return this[attachedInternalSymbol];\n}\n\n/**\n * @private\n * @return {object}\n * @this CustomControl\n */\nfunction initObserver() {\n    const self = this;\n\n    // value\n    self[attributeObserverSymbol]['value'] = () => {\n        self.setOption('value', self.getAttribute('value'));\n    }\n\n}\n\nassignToNamespace('Monster.DOM', CustomControl);\nexport {Monster, CustomControl}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {internalSymbol} from \"../constants.js\";\nimport {extend} from \"../data/extend.js\";\nimport {Pathfinder} from \"../data/pathfinder.js\";\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {parseDataURL} from \"../types/dataurl.js\";\nimport {getGlobalObject} from \"../types/global.js\";\nimport {isArray, isFunction, isObject, isString} from \"../types/is.js\";\nimport {Observer} from \"../types/observer.js\";\nimport {ProxyObserver} from \"../types/proxyobserver.js\";\nimport {validateFunction, validateInstance, validateObject, validateString} from \"../types/validate.js\";\nimport {clone} from \"../util/clone.js\";\nimport {addAttributeToken, addToObjectLink, getLinkedObjects, hasObjectLink} from \"./attributes.js\";\nimport {\n    ATTRIBUTE_DISABLED,\n    ATTRIBUTE_ERRORMESSAGE,\n    ATTRIBUTE_OPTIONS,\n    ATTRIBUTE_OPTIONS_SELECTOR,\n    objectUpdaterLinkSymbol\n} from \"./constants.js\";\nimport {findDocumentTemplate, Template} from \"./template.js\";\nimport {Updater} from \"./updater.js\";\n\n\n/**\n * @memberOf Monster.DOM\n * @type {symbol}\n */\nconst initMethodSymbol = Symbol('initMethodSymbol');\n\n/**\n * @memberOf Monster.DOM\n * @type {symbol}\n */\nconst assembleMethodSymbol = Symbol('assembleMethodSymbol');\n\n/**\n * this symbol holds the attribute observer callbacks. The key is the attribute name.\n * @memberOf Monster.DOM\n * @type {symbol}\n */\nconst attributeObserverSymbol = Symbol('attributeObserver');\n\n\n/**\n * HTMLElement\n * @external HTMLElement\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement\n *\n * @startuml customelement-sequencediagram.png\n * skinparam monochrome true\n * skinparam shadowing false\n *\n * autonumber\n *\n * Script -> DOM: element = document.createElement('my-element')\n * DOM -> CustomElement: constructor()\n * CustomElement -> CustomElement: [initMethodSymbol]()\n *\n * CustomElement --> DOM: Element\n * DOM --> Script : element\n *\n *\n * Script -> DOM: document.querySelector('body').append(element)\n *\n * DOM -> CustomElement : connectedCallback()\n *\n * note right CustomElement: is only called at\\nthe first connection\n * CustomElement -> CustomElement : [assembleMethodSymbol]()\n *\n * ... ...\n *\n * autonumber\n *\n * Script -> DOM: document.querySelector('monster-confirm-button').parentNode.removeChild(element)\n * DOM -> CustomElement: disconnectedCallback()\n *\n *\n * @enduml\n *\n * @startuml customelement-class.png\n * skinparam monochrome true\n * skinparam shadowing false\n * HTMLElement <|-- CustomElement\n * @enduml\n */\n\n\n/**\n * To define a new HTML element we need the power of CustomElement\n *\n * IMPORTANT: after defining a `CustomElement`, the `registerCustomElement` method must be called\n * with the new class name. only then will the tag defined via the `getTag` method be made known to the DOM.\n *\n * <img src=\"./images/customelement-class.png\">\n *\n * You can create the object via the function `document.createElement()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * document.createElement('monster-')\n * </script>\n * ```\n *\n * ## Interaction\n *\n * <img src=\"./images/customelement-sequencediagram.png\">\n *\n * ## Styling\n *\n * For optimal display of custom-elements the pseudo-class :defined can be used.\n *\n * To prevent the custom elements from being displayed and flickering until the control is registered, it is recommended to create a css directive.\n *\n * In the simplest case, you can simply hide the control.\n *\n * ```\n * <style>\n *\n * my-custom-element:not(:defined) {\n *     display: none;\n * }\n *\n * my-custom-element:defined {\n *     display: flex;\n * }\n *\n * </style>\n * ```\n *\n * Alternatively you can also display a loader\n *\n * ```\n * my-custom-element:not(:defined) {\n *            display: flex;\n *            box-shadow: 0 4px 10px 0 rgba(33, 33, 33, 0.15);\n *            border-radius: 4px;\n *            height: 200px;\n *            position: relative;\n *            overflow: hidden;\n *        }\n *\n * my-custom-element:not(:defined)::before {\n *            content: '';\n *            display: block;\n *            position: absolute;\n *            left: -150px;\n *            top: 0;\n *            height: 100%;\n *            width: 150px;\n *            background: linear-gradient(to right, transparent 0%, #E8E8E8 50%, transparent 100%);\n *            animation: load 1s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;\n *        }\n *\n * @keyframes load {\n *            from {\n *                left: -150px;\n *            }\n *            to   {\n *                left: 100%;\n *            }\n *        }\n *\n * my-custom-element:defined {\n *           display: flex;\n *       }\n * ```\n *\n * @example\n *\n * // In the example the the user can use his own template by creating a template in the DOM with the ID `my-custom-element`.\n * // You can also specify a theme (for example `mytheme`), then it will search for the ID `my-custom-element-mytheme` and\n * // if not available for the ID `my-custom-element`.\n *\n * class MyCustomElement extends CustomElement {\n * \n *    static getTag() {\n *        return \"my-custom-element\"\n *    }\n *\n * }\n *\n * // ↦ <my-custom-element></my-custom-element>\n *\n * @see https://github.com/WICG/webcomponents\n * @see https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements\n * @since 1.7.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @extends external:HTMLElement\n * @summary A base class for HTML5 customcontrols\n */\nclass CustomElement extends HTMLElement {\n\n    /**\n     * A new object is created. First the `initOptions` method is called. Here the\n     * options can be defined in derived classes. Subsequently, the shadowRoot is initialized.\n     *\n     * @throws {Error} the options attribute does not contain a valid json definition.\n     * @since 1.7.0\n     */\n    constructor() {\n        super();\n        this[internalSymbol] = new ProxyObserver({'options': extend({}, this.defaults)});\n        this[attributeObserverSymbol] = {};\n        initOptionObserver.call(this);\n        this[initMethodSymbol]();\n    }\n\n    /**\n     * This method determines which attributes are to be monitored by `attributeChangedCallback()`.\n     *\n     * @return {string[]}\n     * @since 1.15.0\n     */\n    static get observedAttributes() {\n        return [ATTRIBUTE_OPTIONS, ATTRIBUTE_DISABLED];\n    }\n\n    /**\n     * Derived classes can override and extend this method as follows.\n     *\n     * ```\n     * get defaults() {\n     *    return Object.assign({}, super.defaults, {\n     *        myValue:true\n     *    });\n     * }\n     * ```\n     *\n     * to set the options via the html tag the attribute data-monster-options must be set.\n     * As value a JSON object with the desired values must be defined.\n     *\n     * Since 1.18.0 the JSON can be specified as a DataURI.\n     *\n     * ```\n     * new Monster.Types.DataUrl(btoa(JSON.stringify({\n     *        shadowMode: 'open',\n     *        delegatesFocus: true,\n     *        templates: {\n     *            main: undefined\n     *        }\n     *    })),'application/json',true).toString()\n     * ```\n     *\n     * The attribute data-monster-options-selector can be used to access a script tag that contains additional configuration.\n     *\n     * As value a selector must be specified, which belongs to a script tag and contains the configuration as json.\n     *\n     * ```\n     * <script id=\"id-for-this-config\" type=\"application/json\">\n     *    {\n     *        \"config-key\": \"config-value\"\n     *    }\n     * </script>\n     * ```\n     *\n     *\n     * @property {boolean} disabled=false Object The Boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form.\n     * @property {string} shadowMode=open `open` Elements of the shadow root are accessible from JavaScript outside the root, for example using. `close` Denies access to the node(s) of a closed shadow root from JavaScript outside it\n     * @property {Boolean} delegatesFocus=true A boolean that, when set to true, specifies behavior that mitigates custom element issues around focusability. When a non-focusable part of the shadow DOM is clicked, the first focusable part is given focus, and the shadow host is given any available :focus styling.\n     * @property {Object} templates Templates\n     * @property {string} templates.main=undefined Main template\n     *\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow\n     * @since 1.8.0\n     */\n    get defaults() {\n        return {\n            ATTRIBUTE_DISABLED: this.getAttribute(ATTRIBUTE_DISABLED),\n            shadowMode: 'open',\n            delegatesFocus: true,\n            templates: {\n                main: undefined\n            }\n        };\n    }\n\n    /**\n     * There is no check on the name by this class. the developer is responsible for assigning an appropriate tag.\n     * if the name is not valid, registerCustomElement() will issue an error\n     *\n     * @link https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n     * @return {string}\n     * @throws {Error} the method getTag must be overwritten by the derived class.\n     * @since 1.7.0\n     */\n    static getTag() {\n        throw new Error(\"the method getTag must be overwritten by the derived class.\");\n    }\n\n    /**\n     * At this point a `CSSStyleSheet` object can be returned. If the environment does not\n     * support a constructor, then an object can also be built using the following detour.\n     *\n     * If `undefined` is returned then the shadowRoot does not get a stylesheet.\n     *\n     * ```\n     * const doc = document.implementation.createHTMLDocument('title');\n     *\n     * let style = doc.createElement(\"style\");\n     * style.innerHTML=\"p{color:red;}\";\n     *\n     * // WebKit Hack\n     * style.appendChild(document.createTextNode(\"\"));\n     * // Add the <style> element to the page\n     * doc.head.appendChild(style);\n     * return doc.styleSheets[0];\n     * ;\n     * ```\n     *\n     * @return {CSSStyleSheet|CSSStyleSheet[]|string|undefined}\n     */\n    static getCSSStyleSheet() {\n        return undefined;\n    }\n\n    /**\n     * attach a new observer\n     *\n     * @param {Observer} observer\n     * @returns {CustomElement}\n     */\n    attachObserver(observer) {\n        this[internalSymbol].attachObserver(observer)\n        return this;\n    }\n\n    /**\n     * detach a observer\n     *\n     * @param {Observer} observer\n     * @returns {CustomElement}\n     */\n    detachObserver(observer) {\n        this[internalSymbol].detachObserver(observer)\n        return this;\n    }\n\n    /**\n     * @param {Observer} observer\n     * @returns {ProxyObserver}\n     */\n    containsObserver(observer) {\n        return this[internalSymbol].containsObserver(observer)\n    }\n\n    /**\n     * nested options can be specified by path `a.b.c`\n     *\n     * @param {string} path\n     * @param {*} defaultValue\n     * @return {*}\n     * @since 1.10.0\n     */\n    getOption(path, defaultValue) {\n        let value;\n\n        try {\n            value = new Pathfinder(this[internalSymbol].getRealSubject()['options']).getVia(path);\n        } catch (e) {\n\n        }\n\n        if (value === undefined) return defaultValue;\n        return value;\n    }\n\n    /**\n     * Set option and inform elements\n     *\n     * @param {string} path\n     * @param {*} value\n     * @return {CustomElement}\n     * @since 1.14.0\n     */\n    setOption(path, value) {\n        new Pathfinder(this[internalSymbol].getSubject()['options']).setVia(path, value);\n        return this;\n    }\n\n    /**\n     * @since 1.15.0\n     * @param {string|object} options\n     * @return {CustomElement}\n     */\n    setOptions(options) {\n\n        if (isString(options)) {\n            options = parseOptionsJSON.call(this, options)\n        }\n\n        const self = this;\n        extend(self[internalSymbol].getSubject()['options'], self.defaults, options);\n\n        return self;\n    }\n\n    /**\n     * Is called once via the constructor\n     *\n     * @return {CustomElement}\n     * @since 1.8.0\n     */\n    [initMethodSymbol]() {\n        return this;\n    }\n\n    /**\n     * Is called once when the object is included in the DOM for the first time.\n     *\n     * @return {CustomElement}\n     * @since 1.8.0\n     */\n    [assembleMethodSymbol]() {\n\n        const self = this;\n        let elements, nodeList;\n\n        const AttributeOptions = getOptionsFromAttributes.call(self);\n        if (isObject(AttributeOptions) && Object.keys(AttributeOptions).length > 0) {\n            self.setOptions(AttributeOptions);\n        }\n\n        const ScriptOptions = getOptionsFromScriptTag.call(self);\n        if (isObject(ScriptOptions) && Object.keys(ScriptOptions).length > 0) {\n            self.setOptions(ScriptOptions);\n        }\n\n\n        if (self.getOption('shadowMode', false) !== false) {\n            try {\n                initShadowRoot.call(self);\n                elements = self.shadowRoot.childNodes;\n\n            } catch (e) {\n\n            }\n\n            try {\n                initCSSStylesheet.call(this);\n            } catch (e) {\n                addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, e.toString());\n            }\n        }\n\n        if (!(elements instanceof NodeList)) {\n            if (!(elements instanceof NodeList)) {\n                initHtmlContent.call(this);\n                elements = this.childNodes;\n            }\n        }\n\n        try {\n            nodeList = new Set([\n                ...elements,\n                ...getSlottedElements.call(self)\n            ])\n        } catch (e) {\n            nodeList = elements\n        }\n\n        assignUpdaterToElement.call(self, nodeList, clone(self[internalSymbol].getRealSubject()['options']));\n        return self;\n    }\n\n    /**\n     * Called every time the element is inserted into the DOM. Useful for running setup code, such as\n     * fetching resources or rendering. Generally, you should try to delay work until this time.\n     *\n     * @return {void}\n     * @since 1.7.0\n     */\n    connectedCallback() {\n        let self = this;\n        if (!hasObjectLink(self, objectUpdaterLinkSymbol)) {\n            self[assembleMethodSymbol]()\n        }\n    }\n\n    /**\n     * Called every time the element is removed from the DOM. Useful for running clean up code.\n     *\n     * @return {void}\n     * @since 1.7.0\n     */\n    disconnectedCallback() {\n\n    }\n\n    /**\n     * The custom element has been moved into a new document (e.g. someone called document.adoptNode(el)).\n     *\n     * @return {void}\n     * @since 1.7.0\n     */\n    adoptedCallback() {\n\n    }\n\n    /**\n     * Called when an observed attribute has been added, removed, updated, or replaced. Also called for initial\n     * values when an element is created by the parser, or upgraded. Note: only attributes listed in the observedAttributes\n     * property will receive this callback.\n     *\n     * @param {string} attrName\n     * @param {string} oldVal\n     * @param {string} newVal\n     * @return {void}\n     * @since 1.15.0\n     */\n    attributeChangedCallback(attrName, oldVal, newVal) {\n        const self = this;\n\n        const callback = self[attributeObserverSymbol]?.[attrName];\n\n        if (isFunction(callback)) {\n            callback.call(self, newVal, oldVal);\n        }\n\n    }\n\n    /**\n     *\n     * @param {Node} node\n     * @return {boolean}\n     * @throws {TypeError} value is not an instance of\n     * @since 1.19.0\n     */\n    hasNode(node) {\n        const self = this;\n\n        if (containChildNode.call(self, validateInstance(node, Node))) {\n            return true;\n        }\n\n        if (!(self.shadowRoot instanceof ShadowRoot)) {\n            return false;\n        }\n\n        return containChildNode.call(self.shadowRoot, node);\n\n    }\n\n}\n\n/**\n * @private\n * @param {String|undefined} query\n * @param {String|undefined|null} name name of the slot (if the parameter is undefined, all slots are searched, if the parameter has the value null, all slots without a name are searched. if a string is specified, the slots with this name are searched.)\n * @return {*}\n * @this CustomElement\n * @since 1.23.0\n * @throws {Error} query must be a string\n */\nfunction getSlottedElements(query, name) {\n    const self = this;\n    const result = new Set;\n\n    if (!(self.shadowRoot instanceof ShadowRoot)) {\n        return result;\n    }\n\n    let selector = 'slot';\n    if (name !== undefined) {\n        if (name === null) {\n            selector += ':not([name])';\n        } else {\n            selector += '[name=' + validateString(name) + ']';\n        }\n\n    }\n\n    const slots = self.shadowRoot.querySelectorAll(selector);\n\n    for (const [, slot] of Object.entries(slots)) {\n        slot.assignedElements().forEach(function (node) {\n\n            if (!(node instanceof HTMLElement)) return;\n\n            if (isString(query)) {\n                node.querySelectorAll(query).forEach(function (n) {\n                    result.add(n);\n                });\n\n                if (node.matches(query)) {\n                    result.add(node);\n                }\n\n            } else if (query !== undefined) {\n                throw new Error('query must be a string')\n            } else {\n                result.add(node);\n            }\n        })\n    }\n\n    return result;\n}\n\n/**\n * @this CustomElement\n * @private\n * @param {Node} node\n * @return {boolean}\n */\nfunction containChildNode(node) {\n    const self = this;\n\n    if (self.contains(node)) {\n        return true;\n    }\n\n    for (const [, e] of Object.entries(self.childNodes)) {\n        if (e.contains(node)) {\n            return true;\n        }\n\n        containChildNode.call(e, node);\n    }\n\n\n    return false;\n}\n\n/**\n * @since 1.15.0\n * @private\n * @this CustomElement\n */\nfunction initOptionObserver() {\n    const self = this;\n\n    let lastDisabledValue = undefined;\n    self.attachObserver(new Observer(function () {\n        const flag = self.getOption('disabled');\n\n        if (flag === lastDisabledValue) {\n            return;\n        }\n\n        lastDisabledValue = flag;\n\n        if (!(self.shadowRoot instanceof ShadowRoot)) {\n            return;\n        }\n\n        const query = 'button, command, fieldset, keygen, optgroup, option, select, textarea, input, [data-monster-objectlink]';\n        const elements = self.shadowRoot.querySelectorAll(query);\n\n        let nodeList;\n        try {\n            nodeList = new Set([\n                ...elements,\n                ...getSlottedElements.call(self, query)\n            ])\n        } catch (e) {\n            nodeList = elements\n        }\n\n        for (const element of [...nodeList]) {\n            if (flag === true) {\n                element.setAttribute(ATTRIBUTE_DISABLED, '');\n            } else {\n                element.removeAttribute(ATTRIBUTE_DISABLED);\n            }\n        }\n\n    }));\n\n    self.attachObserver(new Observer(function () {\n\n        // not initialised\n        if (!hasObjectLink(self, objectUpdaterLinkSymbol)) {\n            return;\n        }\n        // inform every element\n        const updaters = getLinkedObjects(self, objectUpdaterLinkSymbol);\n\n        for (const list of updaters) {\n            for (const updater of list) {\n                let d = clone(self[internalSymbol].getRealSubject()['options']);\n                Object.assign(updater.getSubject(), d);\n            }\n        }\n\n    }));\n\n    // disabled\n    self[attributeObserverSymbol][ATTRIBUTE_DISABLED] = () => {\n        if (self.hasAttribute(ATTRIBUTE_DISABLED)) {\n            self.setOption(ATTRIBUTE_DISABLED, true);\n        } else {\n            self.setOption(ATTRIBUTE_DISABLED, undefined);\n        }\n    }\n\n    // data-monster-options\n    self[attributeObserverSymbol][ATTRIBUTE_OPTIONS] = () => {\n        const options = getOptionsFromAttributes.call(self);\n        if (isObject(options) && Object.keys(options).length > 0) {\n            self.setOptions(options);\n        }\n    }\n\n    // data-monster-options-selector\n    self[attributeObserverSymbol][ATTRIBUTE_OPTIONS_SELECTOR] = () => {\n        const options = getOptionsFromScriptTag.call(self);\n        if (isObject(options) && Object.keys(options).length > 0) {\n            self.setOptions(options);\n        }\n    }\n\n\n}\n\n/**\n * @private\n * @return {object}\n * @throws {TypeError} value is not a object\n */\nfunction getOptionsFromScriptTag() {\n    const self = this;\n\n    if (!self.hasAttribute(ATTRIBUTE_OPTIONS_SELECTOR)) {\n        return {};\n    }\n\n    const node = document.querySelector(self.getAttribute(ATTRIBUTE_OPTIONS_SELECTOR));\n    if (!(node instanceof HTMLScriptElement)) {\n        addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, 'the selector ' + ATTRIBUTE_OPTIONS_SELECTOR + ' for options was specified (' + self.getAttribute(ATTRIBUTE_OPTIONS_SELECTOR) + ') but not found.');\n        return {};\n    }\n\n    let obj = {};\n\n    try {\n        obj = parseOptionsJSON.call(this, node.textContent.trim())\n    } catch (e) {\n        addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, 'when analyzing the configuration from the script tag there was an error. ' + e);\n    }\n\n    return obj;\n\n}\n\n/**\n * @private\n * @return {object}\n */\nfunction getOptionsFromAttributes() {\n    const self = this;\n\n    if (this.hasAttribute(ATTRIBUTE_OPTIONS)) {\n        try {\n            return parseOptionsJSON.call(self, this.getAttribute(ATTRIBUTE_OPTIONS))\n        } catch (e) {\n            addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, 'the options attribute ' + ATTRIBUTE_OPTIONS + ' does not contain a valid json definition (actual: ' + this.getAttribute(ATTRIBUTE_OPTIONS) + ').' + e);\n        }\n    }\n\n    return {};\n}\n\n/**\n * @private\n * @param data\n * @return {Object}\n */\nfunction parseOptionsJSON(data) {\n\n    const self = this, obj = {};\n\n    if (!isString(data)) {\n        return obj;\n    }\n\n    // the configuration can be specified as a data url.\n    try {\n        let dataUrl = parseDataURL(data);\n        data = dataUrl.content;\n    } catch (e) {\n\n    }\n\n    try {\n        let obj = JSON.parse(data);\n        return validateObject(obj);\n    } catch (e) {\n        throw e;\n    }\n\n\n    return obj;\n}\n\n/**\n * @private\n * @return {initHtmlContent}\n */\nfunction initHtmlContent() {\n\n    try {\n        let template = findDocumentTemplate(this.constructor.getTag());\n        this.appendChild(template.createDocumentFragment());\n    } catch (e) {\n\n        let html = this.getOption('templates.main', '');\n        if (isString(html) && html.length > 0) {\n            this.innerHTML = html;\n        }\n\n    }\n\n    return this;\n\n}\n\n/**\n * @private\n * @return {CustomElement}\n * @memberOf Monster.DOM\n * @this CustomElement\n * @since 1.16.0\n * @throws {TypeError} value is not an instance of\n */\nfunction initCSSStylesheet() {\n    const self = this;\n\n    if (!(this.shadowRoot instanceof ShadowRoot)) {\n        return self;\n    }\n\n    const styleSheet = this.constructor.getCSSStyleSheet();\n\n    if (styleSheet instanceof CSSStyleSheet) {\n        if (styleSheet.cssRules.length > 0) {\n            this.shadowRoot.adoptedStyleSheets = [styleSheet];\n        }\n    } else if (isArray(styleSheet)) {\n        const assign = [];\n        for (let s of styleSheet) {\n\n            if (isString(s)) {\n                let trimedStyleSheet = s.trim()\n                if (trimedStyleSheet !== '') {\n                    const style = document.createElement('style')\n                    style.innerHTML = trimedStyleSheet;\n                    self.shadowRoot.prepend(style);\n                }\n                continue;\n            }\n\n            validateInstance(s, CSSStyleSheet);\n\n            if (s.cssRules.length > 0) {\n                assign.push(s);\n            }\n\n        }\n\n        if (assign.length > 0) {\n            this.shadowRoot.adoptedStyleSheets = assign;\n        }\n\n    } else if (isString(styleSheet)) {\n\n        let trimedStyleSheet = styleSheet.trim()\n        if (trimedStyleSheet !== '') {\n            const style = document.createElement('style')\n            style.innerHTML = styleSheet;\n            self.shadowRoot.prepend(style);\n        }\n\n    }\n\n    return self;\n\n}\n\n/**\n * @private\n * @return {CustomElement}\n * @throws {Error} html is not set.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow\n * @memberOf Monster.DOM\n * @since 1.8.0\n */\nfunction initShadowRoot() {\n\n    let template, html;\n\n    try {\n        template = findDocumentTemplate(this.constructor.getTag());\n    } catch (e) {\n\n        html = this.getOption('templates.main', '');\n        if (!isString(html) || html === undefined || html === \"\") {\n            throw new Error(\"html is not set.\");\n        }\n\n    }\n\n    this.attachShadow({\n        mode: this.getOption('shadowMode', 'open'),\n        delegatesFocus: this.getOption('delegatesFocus', true)\n    });\n\n    if (template instanceof Template) {\n        this.shadowRoot.appendChild(template.createDocumentFragment());\n        return this;\n    }\n\n    this.shadowRoot.innerHTML = html;\n    return this;\n}\n\n/**\n * This method registers a new element. The string returned by `CustomElement.getTag()` is used as the tag.\n *\n * @param {CustomElement} element\n * @return {void}\n * @since 1.7.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {DOMException} Failed to execute 'define' on 'CustomElementRegistry': is not a valid custom element name\n */\nfunction registerCustomElement(element) {\n    validateFunction(element);\n    getGlobalObject('customElements').define(element.getTag(), element);\n}\n\n\n/**\n *\n * @param element\n * @param object\n * @return {Promise[]}\n * @since 1.23.0\n * @memberOf Monster.DOM\n */\nfunction assignUpdaterToElement(elements, object) {\n\n    const updaters = new Set;\n\n    if (elements instanceof NodeList) {\n        elements = new Set([\n            ...elements\n        ])\n    }\n\n    let result = [];\n\n    elements.forEach((element) => {\n        if (!(element instanceof HTMLElement)) return;\n        if ((element instanceof HTMLTemplateElement)) return;\n\n        const u = new Updater(element, object)\n        updaters.add(u);\n\n        result.push(u.run().then(() => {\n            return u.enableEventProcessing();\n        }));\n\n    });\n\n    if (updaters.size > 0) {\n        addToObjectLink(this, objectUpdaterLinkSymbol, updaters);\n    }\n\n    return result;\n}\n\nassignToNamespace('Monster.DOM', CustomElement, registerCustomElement, assignUpdaterToElement);\nexport {\n    Monster,\n    registerCustomElement,\n    CustomElement,\n    initMethodSymbol,\n    assembleMethodSymbol,\n    assignUpdaterToElement,\n    attributeObserverSymbol,\n    getSlottedElements\n}\n","'use strict';\n\nimport {assignToNamespace} from \"../namespace.js\";\n/**\n * @author schukai GmbH\n */\nimport {Base, Monster} from \"./base.js\";\nimport {isString} from \"./is.js\";\nimport {MediaType, parseMediaType} from \"./mediatype.js\";\nimport {validateBoolean, validateInstance, validateString} from \"./validate.js\";\n\n/**\n * @private\n * @type {symbol}\n */\nconst internal = Symbol('internal');\n\n/**\n * You can create an object via the monster namespace `new Monster.Types.DataUrl()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.DataUrl()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {DataUrl} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/dataurl.js';\n * new DataUrl()\n * </script>\n * ```\n *\n * @since 1.8.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\n * @see https://datatracker.ietf.org/doc/html/rfc2397\n */\nclass DataUrl extends Base {\n\n    /**\n     *\n     * @param {String} content\n     * @param {String|Monster.Types.MediaType} mediatype\n     * @param {boolean} base64=true\n     */\n    constructor(content, mediatype, base64) {\n        super();\n\n        if (isString(mediatype)) {\n            mediatype = parseMediaType(mediatype);\n        }\n\n        this[internal] = {\n            content: validateString(content),\n            mediatype: validateInstance(mediatype, MediaType),\n            base64: validateBoolean(base64 === undefined ? true : base64)\n        }\n\n\n    }\n\n    get content() {\n        return this[internal].base64 ? atob(this[internal].content) : this[internal].content;\n    }\n\n    get mediatype() {\n        return this[internal].mediatype;\n    }\n\n\n    /**\n     *\n     * @return {string}\n     * @see https://datatracker.ietf.org/doc/html/rfc2397\n     */\n    toString() {\n\n        let content = this[internal].content;\n\n        if (this[internal].base64 === true) {\n            content = ';base64,' + content;\n        } else {\n            content = ',' + encodeURIComponent(content);\n        }\n\n        return 'data:' + this[internal].mediatype.toString() + content;\n    }\n\n}\n\n/**\n * You can call the function via the monster namespace `Monster.Types.parseDataURL()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.parseDataURL())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {parseDataURL} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/dataurl.js';\n * console.log(parseDataURL())\n * </script>\n * ```\n *\n * Specification:\n *\n * ```\n * dataurl    := \"data:\" [ mediatype ] [ \";base64\" ] \",\" data\n * mediatype  := [ type \"/\" subtype ] *( \";\" parameter )\n * data       := *urlchar\n * parameter  := attribute \"=\" value\n * ```\n *\n * @param {String} dataurl\n * @return {Monster.Types.DataUrl}\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\n * @see https://datatracker.ietf.org/doc/html/rfc2397\n * @throws {TypeError} incorrect or missing data protocol\n * @throws {TypeError} malformed data url\n * @memberOf Monster.Types\n */\nfunction parseDataURL(dataurl) {\n\n    validateString(dataurl);\n\n    dataurl = dataurl.trim();\n\n    if (dataurl.substring(0, 5) !== 'data:') {\n        throw new TypeError('incorrect or missing data protocol')\n    }\n\n    dataurl = dataurl.substring(5);\n\n    let p = dataurl.indexOf(',');\n    if (p === -1) {\n        throw new TypeError('malformed data url')\n    }\n\n    let content = dataurl.substring(p + 1);\n    let mediatypeAndBase64 = dataurl.substring(0, p).trim();\n    let mediatype = 'text/plain;charset=US-ASCII';\n    let base64Flag = false;\n\n    if (mediatypeAndBase64 !== \"\") {\n        mediatype = mediatypeAndBase64;\n        if (mediatypeAndBase64.endsWith('base64')) {\n            let i = mediatypeAndBase64.lastIndexOf(';');\n            mediatype = mediatypeAndBase64.substring(0, i);\n            base64Flag = true;\n        } else {\n            content = decodeURIComponent(content);\n        }\n\n        mediatype = parseMediaType(mediatype);\n    } else {\n        content = decodeURIComponent(content);\n    }\n\n    return new DataUrl(content, mediatype, base64Flag);\n\n\n}\n\n\nassignToNamespace('Monster.Types', parseDataURL, DataUrl);\nexport {Monster, parseDataURL, DataUrl};\n","'use strict';\n\nimport {assignToNamespace} from \"../namespace.js\";\n/**\n * @author schukai GmbH\n */\nimport {Base, Monster} from \"./base.js\";\nimport {isString} from \"./is.js\";\nimport {validateArray, validateString} from \"./validate.js\";\n\n\n/**\n * @private\n * @type {symbol}\n */\nconst internal = Symbol('internal');\n\n/**\n * @typedef {Object} Parameter\n * @property {string} key\n * @property {string} value\n * @memberOf Monster.Types\n */\n\n\n/**\n * You can create an object via the monster namespace `new Monster.Types.MediaType()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Types.MediaType())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {MediaType} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/mediatype.js';\n * console.log(new MediaType())\n * </script>\n * ```\n *\n * @since 1.8.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass MediaType extends Base {\n\n    /**\n     *\n     * @param {String} type\n     * @param {String} subtype\n     * @param {Monster.Types.Parameter[]} parameter\n     */\n    constructor(type, subtype, parameter) {\n        super();\n\n        this[internal] = {\n            type: validateString(type).toLowerCase(),\n            subtype: validateString(subtype).toLowerCase(),\n            parameter: []\n        }\n\n        if (parameter !== undefined) {\n            this[internal]['parameter'] = validateArray(parameter);\n        }\n\n\n    }\n\n    /**\n     * @return {String}\n     */\n    get type() {\n        return this[internal].type;\n    }\n\n    /**\n     * @return {String}\n     */\n    get subtype() {\n        return this[internal].subtype;\n    }\n\n    /**\n     * @return {Monster.Types.Parameter[]}\n     */\n    get parameter() {\n        return this[internal].parameter;\n    }\n\n    /**\n     *\n     *\n     * @return {Map}\n     */\n    get parameter() {\n\n        const result = new Map\n\n        this[internal]['parameter'].forEach(p => {\n\n            let value = p.value;\n\n            // internally special values are partly stored with quotes, this function removes them.\n            if (value.startsWith('\"') && value.endsWith('\"')) {\n                value = value.substring(1, value.length - 1);\n            }\n\n            result.set(p.key, value);\n        })\n\n\n        return result;\n    }\n\n    /**\n     *\n     * @return {string}\n     */\n    toString() {\n\n        let parameter = [];\n        for (let a of this[internal].parameter) {\n            parameter.push(a.key + '=' + a.value);\n        }\n\n        return this[internal].type + '/' + this[internal].subtype + (parameter.length > 0 ? ';' + parameter.join(';') : '');\n    }\n\n}\n\n/**\n * You can call the function via the monster namespace `Monster.Types.parseMediaType()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.parseMediaType())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {parseMediaType} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/dataurl.js';\n * console.log(parseMediaType())\n * </script>\n * ```\n *\n * Specification:\n *\n * ```\n * dataurl    := \"data:\" [ mediatype ] [ \";base64\" ] \",\" data\n * mediatype  := [ type \"/\" subtype ] *( \";\" parameter )\n * data       := *urlchar\n * parameter  := attribute \"=\" value\n * ```\n *\n * @param {String} mediatype\n * @return {Monster.Types.MediaType}\n * @see https://datatracker.ietf.org/doc/html/rfc2045#section-5.1\n * @throws {TypeError} the mimetype can not be parsed\n * @throws {TypeError} blank value is not allowed\n * @throws {TypeError} malformed data url\n * @memberOf Monster.Types\n */\nfunction parseMediaType(mediatype) {\n\n    const regex = /(?<type>[A-Za-z]+|\\*)\\/(?<subtype>([a-zA-Z0-9.\\+_\\-]+)|\\*|)(?<parameter>\\s*;\\s*([a-zA-Z0-9]+)\\s*(=\\s*(\"?[A-Za-z0-9_\\-]+\"?))?)*/g;\n    const result = regex.exec(validateString(mediatype));\n\n    const groups = result?.['groups'];\n    if (groups === undefined) {\n        throw new TypeError('the mimetype can not be parsed')\n    }\n\n    const type = groups?.['type'];\n    const subtype = groups?.['subtype'];\n    const parameter = groups?.['parameter'];\n\n    if (subtype === \"\" || type === \"\") {\n        throw new TypeError('blank value is not allowed');\n    }\n\n    return new MediaType(type, subtype, parseParameter(parameter));\n\n\n}\n\n/**\n * @private\n * @since 1.18.0\n * @param {String} parameter\n * @return {Monster.Types.Parameter[]|undefined}\n * @memberOf Monster.Types\n */\nfunction parseParameter(parameter) {\n\n    if (!isString(parameter)) {\n        return undefined;\n    }\n\n    let result = [];\n\n    parameter.split(';').forEach((entry) => {\n\n        entry = entry.trim();\n        if (entry === \"\") {\n            return;\n        }\n\n        const kv = entry.split('=')\n\n        let key = validateString(kv?.[0]).trim();\n        let value = validateString(kv?.[1]).trim();\n\n        // if values are quoted, they remain so internally\n        result.push({\n            key: key,\n            value: value\n        })\n\n\n    })\n\n    return result;\n\n}\n\n\nassignToNamespace('Monster.Types', parseMediaType, MediaType);\nexport {Monster, parseMediaType, MediaType};\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {getGlobalFunction, getGlobalObject} from '../types/global.js';\nimport {validateInstance, validateString} from \"../types/validate.js\";\nimport {ATTRIBUTE_TEMPLATE_PREFIX} from \"./constants.js\";\nimport {getDocumentTheme} from \"./theme.js\";\n\n/**\n * you can call the method via the monster namespace `new Monster.DOM.Template()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.DOM.Template()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Template} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/template.js';\n * new Template()\n * </script>\n * ```\n *\n * @since 1.6.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @summary A template class\n */\nclass Template extends Base {\n    /**\n     *\n     * @param {HTMLTemplateElement} template\n     * @throws {TypeError} value is not an instance of\n     * @throws {TypeError} value is not a function\n     * @throws {Error} the function is not defined\n     */\n    constructor(template) {\n        super();\n        const HTMLTemplateElement = getGlobalFunction('HTMLTemplateElement');\n        validateInstance(template, HTMLTemplateElement);\n        this.template = template;\n    }\n\n    /**\n     *\n     * @returns {HTMLTemplateElement}\n     */\n    getTemplateElement() {\n        return this.template;\n    }\n\n    /**\n     *\n     * @return {DocumentFragment}\n     * @throws {TypeError} value is not an instance of\n     */\n    createDocumentFragment() {\n        return this.template.content.cloneNode(true);\n    }\n\n}\n\n/**\n * This method loads a template with the given ID and returns it.\n *\n * To do this, it first reads the theme of the document and looks for the `data-monster-theme-name` attribute in the HTML tag.\n *\n * ```\n * <html data-monster-theme-name=\"my-theme\">\n * ```\n *\n * If no theme was specified, the default theme is `monster`.\n *\n * Now it is looked if there is a template with the given ID and theme `id-theme` and if yes it is returned.\n * If there is no template a search for a template with the given ID `id` is done. If this is also not found, an error is thrown.\n *\n * You can call the method via the monster namespace `Monster.DOM.findDocumentTemplate()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.findDocumentTemplate()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {findTemplate} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/template.js';\n * findDocumentTemplate()\n * </script>\n * ```\n *\n * @example\n *\n * import { findDocumentTemplate } from \"https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/template.js\";\n *\n * const template = document.createElement(\"template\");\n * template.id = \"myTemplate\";\n * template.innerHTML = \"<p>my default template</p>\";\n * document.body.appendChild(template);\n *\n * const themedTemplate = document.createElement(\"template\");\n * themedTemplate.id = \"myTemplate-myTheme\";\n * themedTemplate.innerHTML = \"<p>my themed template</p>\";\n * document.body.appendChild(themedTemplate);\n *\n * // loads the temple and since no theme is set the default template\n * const template1 = findDocumentTemplate(\"myTemplate\");\n * console.log(template1.createDocumentFragment());\n * // ↦ '<p>my default template</p>'\n *\n * // now we set our own theme\n * document\n * .querySelector(\"html\")\n * .setAttribute(\"data-monster-theme-name\", \"myTheme\");\n *\n * // now we don't get the default template,\n * // but the template with the theme in the id\n * const template2 = findDocumentTemplate(\"myTemplate\");\n * console.log(template2.createDocumentFragment());\n * // ↦ '<p>my themed template</p>'\n *\n * @param {string} id\n * @param {Node} currentNode\n * @return {Monster.DOM.Template}\n * @since 1.7.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {Error} template id not found.\n * @throws {TypeError} value is not a string\n */\nfunction findDocumentTemplate(id, currentNode) {\n    validateString(id);\n\n    const document = getGlobalObject('document');\n    const HTMLTemplateElement = getGlobalFunction('HTMLTemplateElement');\n    const DocumentFragment = getGlobalFunction('DocumentFragment');\n    const Document = getGlobalFunction('Document');\n\n\n    let prefixID;\n\n    if (!(currentNode instanceof Document || currentNode instanceof DocumentFragment)) {\n\n        if (currentNode instanceof Node) {\n\n            if (currentNode.hasAttribute(ATTRIBUTE_TEMPLATE_PREFIX)) {\n                prefixID = currentNode.getAttribute(ATTRIBUTE_TEMPLATE_PREFIX)\n            }\n\n            currentNode = currentNode.getRootNode();\n\n            if (!(currentNode instanceof Document || currentNode instanceof DocumentFragment)) {\n                currentNode = currentNode.ownerDocument;\n            }\n\n        }\n\n        if (!(currentNode instanceof Document || currentNode instanceof DocumentFragment)) {\n            currentNode = document;\n        }\n    }\n\n    let template;\n    let theme = getDocumentTheme()\n\n    if (prefixID) {\n        let themedPrefixID = prefixID + '-' + id + '-' + theme.getName();\n\n        // current + themedPrefixID\n        template = currentNode.getElementById(themedPrefixID);\n        if (template instanceof HTMLTemplateElement) {\n            return new Template(template);\n        }\n\n        // document + themedPrefixID\n        template = document.getElementById(themedPrefixID);\n        if (template instanceof HTMLTemplateElement) {\n            return new Template(template);\n        }\n    }\n\n    let themedID = id + '-' + theme.getName();\n\n    // current + themedID\n    template = currentNode.getElementById(themedID);\n    if (template instanceof HTMLTemplateElement) {\n        return new Template(template);\n    }\n\n    // document + themedID\n    template = document.getElementById(themedID);\n    if (template instanceof HTMLTemplateElement) {\n        return new Template(template);\n    }\n\n    // current + ID\n    template = currentNode.getElementById(id);\n    if (template instanceof HTMLTemplateElement) {\n        return new Template(template);\n    }\n\n    // document + ID\n    template = document.getElementById(id);\n    if (template instanceof HTMLTemplateElement) {\n        return new Template(template);\n    }\n\n    throw new Error(\"template \" + id + \" not found.\")\n}\n\n\nassignToNamespace('Monster.DOM', Template, findDocumentTemplate);\nexport {Monster, Template, findDocumentTemplate}\n\n\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {getGlobalObject} from '../types/global.js';\nimport {validateString} from \"../types/validate.js\";\nimport {ATTRIBUTE_THEME_NAME, DEFAULT_THEME} from \"./constants.js\";\n\n\n/**\n * You can call the method via the monster namespace `new Monster.DOM.Theme()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.DOM.Theme())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Theme} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/theme.js';\n * console.log(new Theme())\n * </script>\n * ```\n *\n * @example\n *\n * import {getDocumentTheme} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/theme.js';\n *\n * const theme = getDocumentTheme();\n * console.log(theme.getName());\n * // ↦ monster\n *\n * @since 1.7.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @summary A theme class\n */\nclass Theme extends Base {\n\n    /**\n     *\n     * @param name\n     * @throws {TypeError} value is not a string\n     */\n    constructor(name) {\n        super();\n        validateString(name);\n        this.name = name;\n    }\n\n    /**\n     *\n     * @returns {string}\n     */\n    getName() {\n        return this.name;\n    }\n\n}\n\n/**\n * The theming used in the document can be defined via the html-tag.\n * The theming is specified via the attribute `data-monster-theme-name`.\n *\n * As name for a theme all characters are valid, which are also allowed for a HTMLElement-ID.\n *\n * ```\n * <html data-monster-theme-name=\"my-theme\">\n * ```\n *\n * the default theme name is `monster`.\n *\n * @return {Theme}\n * @memberOf Monster.DOM\n * @since 1.7.0\n */\nfunction getDocumentTheme() {\n    let document = getGlobalObject('document');\n    let name = DEFAULT_THEME;\n\n    let element = document.querySelector('html');\n    if (element instanceof HTMLElement) {\n        let theme = element.getAttribute(ATTRIBUTE_THEME_NAME);\n        if (theme) {\n            name = theme;\n        }\n    }\n\n    return new Theme(name);\n\n}\n\nassignToNamespace('Monster.DOM', Theme, getDocumentTheme);\nexport {Monster, Theme, getDocumentTheme}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {internalSymbol} from \"../constants.js\";\nimport {diff} from \"../data/diff.js\";\nimport {Pathfinder} from \"../data/pathfinder.js\";\nimport {Pipe} from \"../data/pipe.js\";\nimport {\n    ATTRIBUTE_ERRORMESSAGE,\n    ATTRIBUTE_UPDATER_ATTRIBUTES,\n    ATTRIBUTE_UPDATER_BIND,\n    ATTRIBUTE_UPDATER_INSERT,\n    ATTRIBUTE_UPDATER_INSERT_REFERENCE,\n    ATTRIBUTE_UPDATER_REMOVE,\n    ATTRIBUTE_UPDATER_REPLACE,\n    ATTRIBUTE_UPDATER_SELECT_THIS\n} from \"../dom/constants.js\";\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from \"../types/base.js\";\nimport {isArray, isInstance, isIterable} from \"../types/is.js\";\nimport {Observer} from \"../types/observer.js\";\nimport {ProxyObserver} from \"../types/proxyobserver.js\";\nimport {validateArray, validateInstance} from \"../types/validate.js\";\nimport {clone} from \"../util/clone.js\";\nimport {trimSpaces} from \"../util/trimspaces.js\";\nimport {findTargetElementFromEvent} from \"./events.js\";\nimport {findDocumentTemplate} from \"./template.js\";\nimport {getDocument} from \"./util.js\";\n\n\n/**\n * The updater class connects an object with the dom. In this way, structures and contents in the DOM can be programmatically adapted via attributes.\n *\n * For example, to include a string from an object, the attribute `data-monster-replace` can be used.\n * a further explanation can be found under {@tutorial dom-based-templating-implementation}.\n *\n * Changes to attributes are made only when the direct values are changed. If you want to assign changes to other values\n * as well, you have to insert the attribute `data-monster-select-this`. This should be done with care, as it can reduce performance.\n *\n * You can create an object of this class using the monster namespace `new Monster.DOM.Updater()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.DOM.Updater()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/updater.js';\n * new Updater()\n * </script>\n * ```\n *\n * @example\n *\n * import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/updater.js';\n *\n * // First we prepare the html document.\n * // This is done here via script, but can also be inserted into the document as pure html.\n * // To do this, simply insert the tag <h1 data-monster-replace=\"path:headline\"></h1>.\n * const body = document.querySelector('body');\n * const headline = document.createElement('h1');\n * headline.setAttribute('data-monster-replace','path:headline')\n * body.appendChild(headline);\n *\n * // the data structure\n * let obj = {\n *    headline: \"Hello World\",\n * };\n *\n * // Now comes the real magic. we pass the updater the parent HTMLElement\n * // and the desired data structure.\n * const updater = new Updater(body, obj);\n * updater.run();\n *\n * // Now you can change the data structure and the HTML will follow these changes.\n * const subject = updater.getSubject();\n * subject['headline'] = \"Hello World!\"\n *\n * @since 1.8.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {Error} the value is not iterable\n * @throws {Error} pipes are not allowed when cloning a node.\n * @throws {Error} no template was found with the specified key.\n * @throws {Error} the maximum depth for the recursion is reached.\n * @throws {TypeError} value is not a object\n * @throws {TypeError} value is not an instance of HTMLElement\n * @summary The updater class connects an object with the dom\n */\nclass Updater extends Base {\n\n    /**\n     * @since 1.8.0\n     * @param {HTMLElement} element\n     * @param {object|ProxyObserver|undefined} subject\n     * @throws {TypeError} value is not a object\n     * @throws {TypeError} value is not an instance of HTMLElement\n     * @see {@link Monster.DOM.findDocumentTemplate}\n     */\n    constructor(element, subject) {\n        super();\n\n        /**\n         * @type {HTMLElement}\n         */\n        if (subject === undefined) subject = {}\n        if (!isInstance(subject, ProxyObserver)) {\n            subject = new ProxyObserver(subject);\n        }\n\n        this[internalSymbol] = {\n            element: validateInstance(element, HTMLElement),\n            last: {},\n            callbacks: new Map(),\n            eventTypes: ['keyup', 'click', 'change', 'drop', 'touchend', 'input'],\n            subject: subject\n        }\n\n        this[internalSymbol].callbacks.set('checkstate', getCheckStateCallback.call(this));\n\n        this[internalSymbol].subject.attachObserver(new Observer(() => {\n\n            const s = this[internalSymbol].subject.getRealSubject();\n\n            const diffResult = diff(this[internalSymbol].last, s)\n            this[internalSymbol].last = clone(s);\n\n            for (const [, change] of Object.entries(diffResult)) {\n                removeElement.call(this, change);\n                insertElement.call(this, change);\n                updateContent.call(this, change);\n                updateAttributes.call(this, change);\n            }\n        }));\n\n    }\n\n    /**\n     * Defaults: 'keyup', 'click', 'change', 'drop', 'touchend'\n     *\n     * @see {@link https://developer.mozilla.org/de/docs/Web/Events}\n     * @since 1.9.0\n     * @param {Array} types\n     * @return {Updater}\n     */\n    setEventTypes(types) {\n        this[internalSymbol].eventTypes = validateArray(types);\n        return this;\n    }\n\n    /**\n     * With this method, the eventlisteners are hooked in and the magic begins.\n     *\n     * ```\n     * updater.run().then(() => {\n     *   updater.enableEventProcessing();\n     * });\n     * ```\n     *\n     * @since 1.9.0\n     * @return {Updater}\n     * @throws {Error} the bind argument must start as a value with a path\n     */\n    enableEventProcessing() {\n        this.disableEventProcessing();\n\n        for (const type of this[internalSymbol].eventTypes) {\n            // @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n            this[internalSymbol].element.addEventListener(type, getControlEventHandler.call(this), {\n                capture: true,\n                passive: true\n            });\n        }\n\n        return this;\n\n    }\n\n    /**\n     * This method turns off the magic or who loves it more profane it removes the eventListener.\n     *\n     * @since 1.9.0\n     * @return {Updater}\n     */\n    disableEventProcessing() {\n\n        for (const type of this[internalSymbol].eventTypes) {\n            this[internalSymbol].element.removeEventListener(type, getControlEventHandler.call(this));\n        }\n\n        return this;\n\n    }\n\n    /**\n     * The run method must be called for the update to start working.\n     * The method ensures that changes are detected.\n     *\n     * ```\n     * updater.run().then(() => {\n     *   updater.enableEventProcessing();\n     * });\n     * ```\n     *\n     * @summary Let the magic begin\n     * @return {Promise}\n     */\n    run() {\n        // the key __init__has no further meaning and is only \n        // used to create the diff for empty objects.\n        this[internalSymbol].last = {'__init__': true};\n        return this[internalSymbol].subject.notifyObservers();\n    }\n\n    /**\n     * Gets the values of bound elements and changes them in subject\n     *\n     * @since 1.27.0\n     * @return {Monster.DOM.Updater}\n     */\n    retrieve() {\n        retrieveFromBindings.call(this);\n        return this;\n    }\n\n    /**\n     * If you have passed a ProxyObserver in the constructor, you will get the object that the ProxyObserver manages here.\n     * However, if you passed a simple object, here you will get a proxy for that object.\n     *\n     * For changes the ProxyObserver must be used.\n     *\n     * @since 1.8.0\n     * @return {Proxy}\n     */\n    getSubject() {\n        return this[internalSymbol].subject.getSubject();\n    }\n\n    /**\n     * This method can be used to register commands that can be called via call: instruction.\n     * This can be used to provide a pipe with its own functionality.\n     *\n     * @param {string} name\n     * @param {function} callback\n     * @returns {Transformer}\n     * @throws {TypeError} value is not a string\n     * @throws {TypeError} value is not a function\n     */\n    setCallback(name, callback) {\n        this[internalSymbol].callbacks.set(name, callback);\n        return this;\n    }\n\n}\n\n/**\n * @private\n * @since 1.9.0\n * @return {function\n * @this Updater\n */\nfunction getCheckStateCallback() {\n    const self = this;\n\n    return function (current) {\n\n        // this is a reference to the current object (therefore no array function here)\n        if (this instanceof HTMLInputElement) {\n            if (['radio', 'checkbox'].indexOf(this.type) !== -1) {\n                return (this.value + \"\" === current + \"\") ? 'true' : undefined\n            }\n        } else if (this instanceof HTMLOptionElement) {\n\n            if (isArray(current) && current.indexOf(this.value) !== -1) {\n                return 'true'\n            }\n\n            return undefined;\n        }\n    }\n}\n\n/**\n * @private\n */\nconst symbol = Symbol('EventHandler');\n\n/**\n * @private\n * @return {function}\n * @this Updater\n * @throws {Error} the bind argument must start as a value with a path\n */\nfunction getControlEventHandler() {\n\n    const self = this;\n\n    if (self[symbol]) {\n        return self[symbol];\n    }\n\n    /**\n     * @throws {Error} the bind argument must start as a value with a path.\n     * @throws {Error} unsupported object\n     * @param {Event} event\n     */\n    self[symbol] = (event) => {\n        const element = findTargetElementFromEvent(event, ATTRIBUTE_UPDATER_BIND);\n\n        if (element === undefined) {\n            return;\n        }\n\n        retrieveAndSetValue.call(self, element);\n\n    }\n\n    return self[symbol];\n\n\n}\n\n/**\n * @throws {Error} the bind argument must start as a value with a path\n * @param {HTMLElement} element\n * @return void\n * @memberOf Monster.DOM\n * @private\n */\nfunction retrieveAndSetValue(element) {\n\n    const self = this;\n\n    const pathfinder = new Pathfinder(self[internalSymbol].subject.getSubject());\n\n    let path = element.getAttribute(ATTRIBUTE_UPDATER_BIND);\n\n    if (path.indexOf('path:') !== 0) {\n        throw new Error('the bind argument must start as a value with a path');\n    }\n\n    path = path.substr(5);\n\n    let value;\n\n    if (element instanceof HTMLInputElement) {\n        switch (element.type) {\n\n            case 'checkbox':\n                value = element.checked ? element.value : undefined;\n                break;\n            default:\n                value = element.value;\n                break;\n\n\n        }\n    } else if (element instanceof HTMLTextAreaElement) {\n        value = element.value;\n\n    } else if (element instanceof HTMLSelectElement) {\n\n        switch (element.type) {\n            case 'select-one':\n                value = element.value;\n                break;\n            case 'select-multiple':\n                value = element.value;\n\n                let options = element?.selectedOptions;\n                if (options === undefined) options = element.querySelectorAll(\":scope option:checked\");\n                value = Array.from(options).map(({value}) => value);\n\n                break;\n        }\n\n\n        // values from customelements \n    } else if ((element?.constructor?.prototype && !!Object.getOwnPropertyDescriptor(element.constructor.prototype, 'value')?.['get']) || element.hasOwnProperty('value')) {\n        value = element?.['value'];\n    } else {\n        throw new Error(\"unsupported object\");\n    }\n\n    const copy = clone(self[internalSymbol].subject.getRealSubject());\n    const pf = new Pathfinder(copy);\n    pf.setVia(path, value);\n\n    const diffResult = diff(copy, self[internalSymbol].subject.getRealSubject());\n\n    if (diffResult.length > 0) {\n        pathfinder.setVia(path, value);\n    }\n}\n\n/**\n * @since 1.27.0\n * @return void\n * @private\n */\nfunction retrieveFromBindings() {\n    const self = this;\n\n    if (self[internalSymbol].element.matches('[' + ATTRIBUTE_UPDATER_BIND + ']')) {\n        retrieveAndSetValue.call(self, element)\n    }\n\n    for (const [, element] of self[internalSymbol].element.querySelectorAll('[' + ATTRIBUTE_UPDATER_BIND + ']').entries()) {\n        retrieveAndSetValue.call(self, element)\n    }\n\n}\n\n/**\n * @private\n * @since 1.8.0\n * @param {object} change\n * @return {void}\n */\nfunction removeElement(change) {\n    const self = this;\n\n    for (const [, element] of self[internalSymbol].element.querySelectorAll(':scope [' + ATTRIBUTE_UPDATER_REMOVE + ']').entries()) {\n        element.parentNode.removeChild(element);\n    }\n}\n\n/**\n * @private\n * @since 1.8.0\n * @param {object} change\n * @return {void}\n * @throws {Error} the value is not iterable\n * @throws {Error} pipes are not allowed when cloning a node.\n * @throws {Error} no template was found with the specified key.\n * @throws {Error} the maximum depth for the recursion is reached.\n * @this Updater\n */\nfunction insertElement(change) {\n    const self = this;\n    const subject = self[internalSymbol].subject.getRealSubject();\n    const document = getDocument();\n\n    let mem = new WeakSet;\n    let wd = 0;\n\n    const container = self[internalSymbol].element;\n\n    while (true) {\n        let found = false;\n        wd++;\n\n        let p = clone(change?.['path']);\n        if (!isArray(p)) return self;\n\n        while (p.length > 0) {\n            const current = p.join('.');\n\n            let iterator = new Set;\n            const query = '[' + ATTRIBUTE_UPDATER_INSERT + '*=\"path:' + current + '\"]';\n\n            const e = container.querySelectorAll(query);\n\n            if (e.length > 0) {\n                iterator = new Set(\n                    [...e]\n                )\n            }\n\n            if (container.matches(query)) {\n                iterator.add(container);\n            }\n\n            for (const [, containerElement] of iterator.entries()) {\n\n                if (mem.has(containerElement)) continue;\n                mem.add(containerElement)\n\n                found = true;\n\n                const attributes = containerElement.getAttribute(ATTRIBUTE_UPDATER_INSERT);\n                let def = trimSpaces(attributes);\n                let i = def.indexOf(' ');\n                let key = trimSpaces(def.substr(0, i));\n                let refPrefix = key + '-';\n                let cmd = trimSpaces(def.substr(i));\n\n                // this case is actually excluded by the query but is nevertheless checked again here\n                if (cmd.indexOf('|') > 0) {\n                    throw new Error(\"pipes are not allowed when cloning a node.\");\n                }\n\n                let pipe = new Pipe(cmd);\n                self[internalSymbol].callbacks.forEach((f, n) => {\n                    pipe.setCallback(n, f);\n                })\n\n                let value\n                try {\n                    containerElement.removeAttribute(ATTRIBUTE_ERRORMESSAGE);\n                    value = pipe.run(subject)\n                } catch (e) {\n                    containerElement.setAttribute(ATTRIBUTE_ERRORMESSAGE, e.message);\n                }\n\n                let dataPath = cmd.split(':').pop();\n\n                let insertPoint;\n                if (containerElement.hasChildNodes()) {\n                    insertPoint = containerElement.lastChild;\n                }\n\n                if (!isIterable(value)) {\n                    throw new Error('the value is not iterable');\n                }\n\n                let available = new Set;\n\n                for (const [i, obj] of Object.entries(value)) {\n                    let ref = refPrefix + i;\n                    let currentPath = dataPath + \".\" + i;\n\n                    available.add(ref);\n                    let refElement = containerElement.querySelector('[' + ATTRIBUTE_UPDATER_INSERT_REFERENCE + '=\"' + ref + '\"]');\n\n                    if (refElement instanceof HTMLElement) {\n                        insertPoint = refElement;\n                        continue;\n                    }\n\n                    appendNewDocumentFragment(containerElement, key, ref, currentPath);\n                }\n\n                let nodes = containerElement.querySelectorAll('[' + ATTRIBUTE_UPDATER_INSERT_REFERENCE + '*=\"' + refPrefix + '\"]');\n                for (const [, node] of Object.entries(nodes)) {\n                    if (!available.has(node.getAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE))) {\n                        try {\n                            containerElement.removeChild(node);\n                        } catch (e) {\n                            containerElement.setAttribute(ATTRIBUTE_ERRORMESSAGE, (containerElement.getAttribute(ATTRIBUTE_ERRORMESSAGE) + \", \" + e.message).trim());\n                        }\n\n                    }\n                }\n            }\n\n            p.pop();\n        }\n\n        if (found === false) break;\n        if (wd++ > 200) {\n            throw new Error('the maximum depth for the recursion is reached.');\n        }\n\n    }\n\n\n}\n\n/**\n *\n * @private\n * @since 1.8.0\n * @param {HTMLElement} container\n * @param {string} key\n * @param {string} ref\n * @param {string} path\n * @throws {Error} no template was found with the specified key.\n */\nfunction appendNewDocumentFragment(container, key, ref, path) {\n\n    let template = findDocumentTemplate(key, container);\n\n    let nodes = template.createDocumentFragment();\n    for (const [, node] of Object.entries(nodes.childNodes)) {\n        if (node instanceof HTMLElement) {\n\n            applyRecursive(node, key, path);\n            node.setAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE, ref);\n        }\n\n        container.appendChild(node);\n    }\n}\n\n/**\n * @private\n * @since 1.10.0\n * @param {HTMLElement} node\n * @param {string} key\n * @param {string} path\n * @return {void}\n */\nfunction applyRecursive(node, key, path) {\n\n    if (node instanceof HTMLElement) {\n\n        if (node.hasAttribute(ATTRIBUTE_UPDATER_REPLACE)) {\n            let value = node.getAttribute(ATTRIBUTE_UPDATER_REPLACE);\n            node.setAttribute(ATTRIBUTE_UPDATER_REPLACE, value.replaceAll(\"path:\" + key, \"path:\" + path));\n        }\n\n        if (node.hasAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES)) {\n            let value = node.getAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES);\n            node.setAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES, value.replaceAll(\"path:\" + key, \"path:\" + path));\n        }\n\n        for (const [, child] of Object.entries(node.childNodes)) {\n            applyRecursive(child, key, path);\n        }\n    }\n}\n\n/**\n * @private\n * @since 1.8.0\n * @param {object} change\n * @return {void}\n * @this Updater\n */\nfunction updateContent(change) {\n    const self = this;\n    const subject = self[internalSymbol].subject.getRealSubject();\n\n    let p = clone(change?.['path']);\n    runUpdateContent.call(this, this[internalSymbol].element, p, subject);\n\n    const slots = this[internalSymbol].element.querySelectorAll('slot');\n    if (slots.length > 0) {\n        for (const [, slot] of Object.entries(slots)) {\n            for (const [, element] of Object.entries(slot.assignedNodes())) {\n                runUpdateContent.call(this, element, p, subject);\n            }\n        }\n    }\n\n\n}\n\n/**\n * @private\n * @since 1.8.0\n * @param {HTMLElement} container\n * @param {array} parts\n * @param {object} subject\n * @return {void}\n */\nfunction runUpdateContent(container, parts, subject) {\n    if (!isArray(parts)) return;\n    if (!(container instanceof HTMLElement)) return;\n    parts = clone(parts);\n\n    let mem = new WeakSet;\n\n    while (parts.length > 0) {\n        const current = parts.join('.');\n        parts.pop();\n\n        // Unfortunately, static data is always changed as well, since it is not possible to react to changes here.\n        const query = '[' + ATTRIBUTE_UPDATER_REPLACE + '^=\"path:' + current + '\"], [' + ATTRIBUTE_UPDATER_REPLACE + '^=\"static:\"]';\n        const e = container.querySelectorAll('' + query);\n\n        const iterator = new Set([\n            ...e\n        ])\n\n        if (container.matches(query)) {\n            iterator.add(container);\n        }\n\n        /**\n         * @type {HTMLElement} element\n         */\n        for (const [element] of iterator.entries()) {\n\n            if (mem.has(element)) return;\n            mem.add(element)\n\n            const attributes = element.getAttribute(ATTRIBUTE_UPDATER_REPLACE)\n            let cmd = trimSpaces(attributes);\n\n            let pipe = new Pipe(cmd);\n            this[internalSymbol].callbacks.forEach((f, n) => {\n                pipe.setCallback(n, f);\n            })\n\n            let value\n            try {\n                element.removeAttribute(ATTRIBUTE_ERRORMESSAGE);\n                value = pipe.run(subject)\n            } catch (e) {\n                element.setAttribute(ATTRIBUTE_ERRORMESSAGE, e.message);\n            }\n\n            if (value instanceof HTMLElement) {\n                while (element.firstChild) {\n                    element.removeChild(element.firstChild);\n                }\n                \n                try {\n                    element.appendChild(value);\n                } catch (e) {\n                    element.setAttribute(ATTRIBUTE_ERRORMESSAGE, (element.getAttribute(ATTRIBUTE_ERRORMESSAGE) + \", \" + e.message).trim());\n                }\n\n            } else {\n                element.innerHTML = value;\n            }\n\n        }\n\n\n    }\n\n}\n\n/**\n * @private\n * @since 1.8.0\n * @param {string} path\n * @param {object} change\n * @return {void}\n */\nfunction updateAttributes(change) {\n    const subject = this[internalSymbol].subject.getRealSubject();\n    let p = clone(change?.['path']);\n    runUpdateAttributes.call(this, this[internalSymbol].element, p, subject);\n}\n\n/**\n * @private\n * @param {HTMLElement} container\n * @param {array} parts\n * @param {object} subject\n * @return {void}\n * @this Updater\n */\nfunction runUpdateAttributes(container, parts, subject) {\n\n    const self = this;\n\n    if (!isArray(parts)) return;\n    parts = clone(parts);\n\n    let mem = new WeakSet;\n\n    while (parts.length > 0) {\n        const current = parts.join('.');\n        parts.pop();\n\n        let iterator = new Set;\n\n        const query = '[' + ATTRIBUTE_UPDATER_SELECT_THIS + '], [' + ATTRIBUTE_UPDATER_ATTRIBUTES + '*=\"path:' + current + '\"], [' + ATTRIBUTE_UPDATER_ATTRIBUTES + '^=\"static:\"]';\n\n        const e = container.querySelectorAll(query);\n\n        if (e.length > 0) {\n            iterator = new Set(\n                [...e]\n            )\n        }\n\n        if (container.matches(query)) {\n            iterator.add(container);\n        }\n\n        for (const [element] of iterator.entries()) {\n\n            if (mem.has(element)) return;\n            mem.add(element)\n\n            const attributes = element.getAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES)\n\n            for (let [, def] of Object.entries(attributes.split(','))) {\n                def = trimSpaces(def);\n                let i = def.indexOf(' ');\n                let name = trimSpaces(def.substr(0, i));\n                let cmd = trimSpaces(def.substr(i));\n\n                let pipe = new Pipe(cmd);\n\n                self[internalSymbol].callbacks.forEach((f, n) => {\n                    pipe.setCallback(n, f, element);\n                })\n\n                let value\n                try {\n                    element.removeAttribute(ATTRIBUTE_ERRORMESSAGE);\n                    value = pipe.run(subject)\n                } catch (e) {\n                    element.setAttribute(ATTRIBUTE_ERRORMESSAGE, e.message);\n                }\n\n\n                if (value === undefined) {\n                    element.removeAttribute(name)\n\n                } else if (element.getAttribute(name) !== value) {\n                    element.setAttribute(name, value);\n                }\n\n                handleInputControlAttributeUpdate.call(this, element, name, value);\n\n            }\n        }\n    }\n\n}\n\n/**\n * @private\n * @param {HTMLElement|*} element\n * @param {string} name\n * @param {string|number|undefined} value\n * @return {void}\n * @this Updater\n */\n\nfunction handleInputControlAttributeUpdate(element, name, value) {\n    const self = this;\n\n    if (element instanceof HTMLSelectElement) {\n\n\n        switch (element.type) {\n            case 'select-multiple':\n\n                for (const [index, opt] of Object.entries(element.options)) {\n                    if (value.indexOf(opt.value) !== -1) {\n                        opt.selected = true;\n                    } else {\n                        opt.selected = false;\n                    }\n                }\n\n                break;\n            case 'select-one':\n                // Only one value may be selected\n\n                for (const [index, opt] of Object.entries(element.options)) {\n                    if (opt.value === value) {\n                        element.selectedIndex = index;\n                        break;\n                    }\n                }\n\n                break;\n        }\n\n\n    } else if (element instanceof HTMLInputElement) {\n        switch (element.type) {\n\n            case 'radio':\n                if (name === 'checked') {\n\n                    if (value !== undefined) {\n                        element.checked = true;\n                    } else {\n                        element.checked = false;\n                    }\n                }\n\n                break;\n\n            case 'checkbox':\n\n                if (name === 'checked') {\n\n                    if (value !== undefined) {\n                        element.checked = true;\n                    } else {\n                        element.checked = false;\n                    }\n                }\n\n                break;\n            case 'text':\n            default:\n                if (name === 'value') {\n                    element.value = (value === undefined ? \"\" : value);\n                }\n\n                break;\n\n\n        }\n    } else if (element instanceof HTMLTextAreaElement) {\n        if (name === 'value') {\n            element.value = (value === undefined ? \"\" : value);\n        }\n    }\n\n}\n\nassignToNamespace('Monster.DOM', Updater);\nexport {Monster, Updater}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from \"../namespace.js\";\nimport {ID} from \"../types/id.js\";\nimport {isObject} from \"../types/is.js\";\nimport {validateString} from \"../types/validate.js\";\n\n/**\n * This special trim function allows to trim spaces that have been protected by a special escape character.\n *\n * You can call the method via the monster namespace `Monster.Util.trimSpaces()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Util.trimSpaces(\" hello \")\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {trimSpaces} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/util/trimspaces.js';\n * trimSpaces(' hello \\\\ ')\n * </script>\n * ```\n * \n * Hint: One stroke is escaped by the javascript interpreter, the second stroke escapes the stroke.\n * \n * ```text\n * a\\ b  ↦ a b\n * a\\\\ b ↦ a\\ b\n * ```\n * \n * @since 1.24.0\n * @memberOf Monster.Util\n * @copyright schukai GmbH\n * @param {string} value\n * @return {string}\n * @throws {TypeError} value is not a string\n */\nfunction trimSpaces(value) {\n\n    validateString(value);\n\n    let placeholder = new Map;\n    const regex = /((?<pattern>\\\\(?<char>.)){1})/mig;\n\n    // The separator for args must be escaped\n    // undefined string which should not occur normally and is also not a regex\n    let result = value.matchAll(regex)\n\n    for (let m of result) {\n        let g = m?.['groups'];\n        if (!isObject(g)) {\n            continue;\n        }\n\n        let p = g?.['pattern'];\n        let c = g?.['char'];\n\n        if (p && c) {\n            let r = '__' + new ID().toString() + '__';\n            placeholder.set(r, c);\n            value = value.replace(p, r);\n        }\n\n    }\n\n    value = value.trim();\n    placeholder.forEach((v, k) => {\n        value = value.replace(k, '\\\\' + v)\n    })\n\n    return value;\n\n}\n\nassignToNamespace('Monster.Util', trimSpaces);\nexport {Monster, trimSpaces}\n","'use strict';\n\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {isArray,isObject} from \"../types/is.js\";\nimport {validateInstance, validateString} from \"../types/validate.js\";\nimport {getDocument} from \"./util.js\";\n\n/**\n * You can call the function via the monster namespace `new Monster.DOM.fireEvent()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.DOM.fireEvent()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {fireEvent} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/events.js';\n * fireEvent()\n * </script>\n * ```\n *\n * @param {HTMLElement|HTMLCollection|NodeList} element\n * @param {string} type\n * @return {void}\n * @since 1.10.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {TypeError} value is not an instance of HTMLElement or HTMLCollection\n * @summary Construct and send and event\n */\nfunction fireEvent(element, type) {\n\n    const document = getDocument();\n\n    if (element instanceof HTMLElement) {\n\n        if (type === 'click') {\n            element.click();\n            return;\n        }\n\n        let event = new Event(validateString(type), {\n            bubbles: true,\n            cancelable: true,\n        });\n\n        element.dispatchEvent(event);\n\n    } else if (element instanceof HTMLCollection || element instanceof NodeList) {\n        for (let e of element) {\n            fireEvent(e, type);\n        }\n    } else {\n        throw new TypeError('value is not an instance of HTMLElement or HTMLCollection')\n    }\n\n}\n\n/**\n * You can call the function via the monster namespace `new Monster.DOM.fireCustomEvent()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.DOM.fireCustomEvent()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {fireCustomEvent} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/events.js';\n * fireCustomEvent()\n * </script>\n * ```\n *\n * @param {HTMLElement|HTMLCollection|NodeList} element\n * @param {string} type\n * @return {void}\n * @since 1.29.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {TypeError} value is not an instance of HTMLElement or HTMLCollection\n * @summary Construct and send and event\n */\nfunction fireCustomEvent(element, type, detail) {\n\n    const document = getDocument();\n\n    if (element instanceof HTMLElement) {\n\n        if (!isObject(detail)) {\n            detail = {detail};\n        }\n\n        let event = new CustomEvent(validateString(type), {\n            bubbles: true,\n            cancelable: true,\n            detail\n        });\n\n        element.dispatchEvent(event);\n\n    } else if (element instanceof HTMLCollection || element instanceof NodeList) {\n        for (let e of element) {\n            fireCustomEvent(e, type, detail);\n        }\n    } else {\n        throw new TypeError('value is not an instance of HTMLElement or HTMLCollection')\n    }\n\n}\n\n/**\n * This function gets the path `Event.composedPath()` from an event and tries to find the next element\n * up the tree `element.closest()` with the attribute and value. If no value, or a value that is undefined or null,\n * is specified, only the attribute is searched.\n *\n * You can call the function via the monster namespace `new Monster.DOM.findTargetElementFromEvent()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.DOM.findTargetElementFromEvent()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {findTargetElementFromEvent} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/events.js';\n * findTargetElementFromEvent()\n * </script>\n * ```\n *\n * @since 1.14.0\n * @param {Event} event\n * @param {string} attributeName\n * @param {string|null|undefined} attributeValue\n * @throws {Error} unsupported event\n * @memberOf Monster.DOM\n * @throws {TypeError} value is not a string\n * @throws {TypeError} value is not an instance of HTMLElement\n * @summary Help function to find the appropriate control\n */\nfunction findTargetElementFromEvent(event, attributeName, attributeValue) {\n    validateInstance(event, Event);\n\n    if (typeof event.composedPath !== 'function') {\n        throw new Error('unsupported event');\n    }\n\n    const path = event.composedPath();\n\n    // closest cannot be used here, because closest is not correct for slotted elements\n    if (isArray(path)) {\n        for (let i = 0; i < path.length; i++) {\n            const o = path[i];\n\n            if (o instanceof HTMLElement &&\n                o.hasAttribute(attributeName)\n                && (attributeValue === undefined || o.getAttribute(attributeName) === attributeValue)) {\n                return o;\n            }\n        }\n    }\n\n    return undefined;\n\n}\n\n\nassignToNamespace('Monster.DOM', findTargetElementFromEvent, fireEvent, fireCustomEvent);\nexport {Monster, findTargetElementFromEvent, fireEvent, fireCustomEvent}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {getGlobal} from \"../types/global.js\";\nimport {validateString} from \"../types/validate.js\";\n\n\n/**\n * this method fetches the document object\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.DOM.getDocument())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getDocument} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/util.js';\n * console.log(getDocument())\n * </script>\n * ```\n *\n * in nodejs this functionality can be performed with [jsdom](https://www.npmjs.com/package/jsdom).\n *\n * ```\n * import {JSDOM} from \"jsdom\"\n * if (typeof window !== \"object\") {\n *    const {window} = new JSDOM('', {\n *        url: 'http://example.com/',\n *        pretendToBeVisual: true\n *    });\n *\n *    [\n *        'self',\n *        'document',\n *        'Document',\n *        'Node',\n *        'Element',\n *        'HTMLElement',\n *        'DocumentFragment',\n *        'DOMParser',\n *        'XMLSerializer',\n *        'NodeFilter',\n *        'InputEvent',\n *        'CustomEvent'\n *    ].forEach(key => (getGlobal()[key] = window[key]));\n * }\n * ```\n *\n * @returns {object}\n * @since 1.6.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {Error} not supported environment\n */\nfunction getDocument() {\n    let document = getGlobal()?.['document'];\n    if (typeof document !== 'object') {\n        throw new Error(\"not supported environment\")\n    }\n\n    return document;\n}\n\n/**\n * this method fetches the window object\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.DOM.getWindow())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getWindow} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/util.js';\n * console.log(getWindow(null))\n * </script>\n * ```\n *\n * in nodejs this functionality can be performed with [jsdom](https://www.npmjs.com/package/jsdom).\n *\n * ```\n * import {JSDOM} from \"jsdom\"\n * if (typeof window !== \"object\") {\n *    const {window} = new JSDOM('', {\n *        url: 'http://example.com/',\n *        pretendToBeVisual: true\n *    });\n *\n *    getGlobal()['window']=window;\n * \n *    [\n *        'self',\n *        'document',\n *        'Document',\n *        'Node',\n *        'Element',\n *        'HTMLElement',\n *        'DocumentFragment',\n *        'DOMParser',\n *        'XMLSerializer',\n *        'NodeFilter',\n *        'InputEvent',\n *        'CustomEvent'\n *    ].forEach(key => (getGlobal()[key] = window[key]));\n * }\n * ```\n *\n * @returns {object}\n * @since 1.6.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {Error} not supported environment\n */\nfunction getWindow() {\n    let window = getGlobal()?.['window'];\n    if (typeof window !== 'object') {\n        throw new Error(\"not supported environment\")\n    }\n\n    return window;\n}\n\n\n/**\n *\n *\n * this method fetches the document object\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.DOM.getDocumentFragmentFromString())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getDocumentFragmentFromString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/util.js';\n * console.log(getDocumentFragmentFromString('<div></div>'))\n * </script>\n * ```\n *\n * in nodejs this functionality can be performed with [jsdom](https://www.npmjs.com/package/jsdom).\n *\n * ```\n * import {JSDOM} from \"jsdom\"\n * if (typeof window !== \"object\") {\n *    const {window} = new JSDOM('', {\n *        url: 'http://example.com/',\n *        pretendToBeVisual: true\n *    });\n *\n *    [\n *        'self',\n *        'document',\n *        'Document',\n *        'Node',\n *        'Element',\n *        'HTMLElement',\n *        'DocumentFragment',\n *        'DOMParser',\n *        'XMLSerializer',\n *        'NodeFilter',\n *        'InputEvent',\n *        'CustomEvent'\n *    ].forEach(key => (getGlobal()[key] = window[key]));\n * }\n * ```\n *\n * @returns {DocumentFragment}\n * @since 1.6.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {Error} not supported environment\n * @throws {TypeError} value is not a string\n */\nfunction getDocumentFragmentFromString(html) {\n    validateString(html);\n\n    const document = getDocument();\n    const template = document.createElement('template');\n    template.innerHTML = html;\n\n    return template.content;\n}\n\n\nassignToNamespace('Monster.DOM', getWindow, getDocument, getDocumentFragmentFromString);\nexport {Monster, getWindow, getDocument, getDocumentFragmentFromString}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {parseLocale} from \"../i18n/locale.js\";\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {getDocument} from \"./util.js\";\n\n/**\n * @private\n * @type {string}\n */\nconst DEFAULT_LANGUAGE = 'en';\n\n/**\n * With this function you can read the language version set by the document.\n * For this the attribute `lang` in the html tag is read. If no attribute is set, `en` is used as default.\n * \n * ```html\n * <html lang=\"en\">\n * ```\n *\n * You can call the function via the monster namespace `new Monster.DOM.getLocaleOfDocument()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.DOM.getLocaleOfDocument()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getLocaleOfDocument} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/locale.js';\n * new getLocaleOfDocument()\n * </script>\n * ```\n *\n * @since 1.13.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {TypeError} value is not a string\n * @throws {Error} unsupported locale\n * @summary Tries to determine the locale used\n */\nfunction getLocaleOfDocument() {\n\n    const document = getDocument();\n\n    let html = document.querySelector('html')\n    if (html instanceof HTMLElement && html.hasAttribute('lang')) {\n        let locale = html.getAttribute('lang');\n        if (locale) {\n            return new parseLocale(locale)\n        }\n    }\n\n    return parseLocale(DEFAULT_LANGUAGE);\n}\n\nassignToNamespace('Monster.DOM', getLocaleOfDocument);\nexport {Monster, getLocaleOfDocument}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from \"../types/base.js\";\nimport {validateString} from \"../types/validate.js\";\nimport {clone} from \"../util/clone.js\";\n\n/**\n * @memberOf Monster.I18n\n * @type {symbol}\n */\nconst propertiesSymbol = Symbol('properties');\n\n/**\n * @type {symbol}\n * @memberOf Monster.I18n\n */\nconst localeStringSymbol = Symbol('localeString');\n\n/**\n * You can create an instance via the monster namespace `new Monster.I18n.Locale()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.I18n.Locale()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this class individually.\n *\n * ```\n * <script type=\"module\">\n * import {Locale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/locale.js';\n * new Locale()\n * </script>\n * ```\n *\n * RFC\n *\n * ```\n * A Language-Tag consists of:\n * langtag                           ; generated tag\n *           -or- private-use        ; a private use tag\n *\n * langtag       = (language\n *                    [\"-\" script]\n *                    [\"-\" region]\n *                    *(\"-\" variant)\n *                    *(\"-\" extension)\n *                    [\"-\" privateuse])\n *\n * language      = \"en\", \"ale\", or a registered value\n *\n * script        = \"Latn\", \"Cyrl\", \"Hant\" ISO 15924 codes\n *\n * region        = \"US\", \"CS\", \"FR\" ISO 3166 codes\n *                 \"419\", \"019\",  or UN M.49 codes\n *\n * variant       = \"rozaj\", \"nedis\", \"1996\", multiple subtags can be used in a tag\n *\n * extension     = single letter followed by additional subtags; more than one extension\n *                 may be used in a language tag\n *\n * private-use   = \"x-\" followed by additional subtags, as many as are required\n *                 Note that these can start a tag or appear at the end (but not\n *                 in the middle)\n * ```\n *\n * @since 1.13.0\n * @copyright schukai GmbH\n * @memberOf Monster.I18n\n * @see https://datatracker.ietf.org/doc/html/rfc3066\n */\nclass Locale extends Base {\n\n    /**\n     * @param {string} language\n     * @param {string} [region]\n     * @param {string} [script]\n     * @param {string} [variants]\n     * @param {string} [extlang]\n     * @param {string} [privateUse]\n     * @throws {Error} unsupported locale\n     */\n    constructor(language, region, script, variants, extlang, privateUse) {\n        super();\n\n        this[propertiesSymbol] = {\n            language: (language === undefined) ? undefined : validateString(language),\n            script: (script === undefined) ? undefined : validateString(script),\n            region: (region === undefined) ? undefined : validateString(region),\n            variants: (variants === undefined) ? undefined : validateString(variants),\n            extlang: (extlang === undefined) ? undefined : validateString(extlang),\n            privateUse: (privateUse === undefined) ? undefined : validateString(privateUse),\n        };\n\n        let s = [];\n        if (language !== undefined) s.push(language);\n        if (script !== undefined) s.push(script);\n        if (region !== undefined) s.push(region);\n        if (variants !== undefined) s.push(variants);\n        if (extlang !== undefined) s.push(extlang);\n        if (privateUse !== undefined) s.push(privateUse);\n\n        if (s.length === 0) {\n            throw new Error('unsupported locale');\n        }\n\n        this[localeStringSymbol] = s.join('-');\n\n    }\n\n    /**\n     * @return {string}\n     */\n    get localeString() {\n        return this[localeStringSymbol];\n    }\n\n    /**\n     * @return {string|undefined}\n     */\n    get language() {\n        return this[propertiesSymbol].language;\n    }\n\n    /**\n     * @return {string|undefined}\n     */\n    get region() {\n        return this[propertiesSymbol].region;\n    }\n\n    /**\n     * @return {string|undefined}\n     */\n    get script() {\n        return this[propertiesSymbol].script;\n    }\n\n    /**\n     * @return {string|undefined}\n     */\n    get variants() {\n        return this[propertiesSymbol].variants;\n    }\n\n    /**\n     * @return {string|undefined}\n     */\n    get extlang() {\n        return this[propertiesSymbol].extlang;\n    }\n\n    /**\n     * @return {string|undefined}\n     */\n    get privateUse() {\n        return this[propertiesSymbol].privateValue;\n    }\n\n\n    /**\n     * @return {string}\n     */\n    toString() {\n        return \"\" + this.localeString;\n    }\n\n    /**\n     * The structure has the following: language, script, region, variants, extlang, privateUse\n     *\n     * @return {Monster.I18n.LocaleMap}\n     */\n    getMap() {\n        return clone(this[propertiesSymbol])\n    }\n\n\n}\n\n/**\n * @typedef {Object} LocaleMap\n * @property {string} language\n * @property {string} script\n * @property {string} region\n * @property {string} variants\n * @property {string} extlang\n * @property {string} privateUse\n * @memberOf Monster.I18n\n */\n\n/**\n * Parse local according to rfc4646 standard\n *\n * Limitations: The regex cannot handle multiple variants or private.\n *\n * You can call the method via the monster namespace `Monster.I18n.createLocale()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.I18n.createLocale()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {createLocale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/locale.js';\n * createLocale()\n * </script>\n * ```\n *\n * RFC\n *\n * ```\n *   The syntax of the language tag in ABNF [RFC4234] is:\n *\n *   Language-Tag  = langtag\n *                 / privateuse             ; private use tag\n *                 / grandfathered          ; grandfathered registrations\n *\n *   langtag       = (language\n *                    [\"-\" script]\n *                    [\"-\" region]\n *                    *(\"-\" variant)\n *                    *(\"-\" extension)\n *                    [\"-\" privateuse])\n *\n *   language      = (2*3ALPHA [ extlang ]) ; shortest ISO 639 code\n *                 / 4ALPHA                 ; reserved for future use\n *                 / 5*8ALPHA               ; registered language subtag\n *\n *   extlang       = *3(\"-\" 3ALPHA)         ; reserved for future use\n *\n *   script        = 4ALPHA                 ; ISO 15924 code\n *\n *   region        = 2ALPHA                 ; ISO 3166 code\n *                 / 3DIGIT                 ; UN M.49 code\n *\n *   variant       = 5*8alphanum            ; registered variants\n *                 / (DIGIT 3alphanum)\n *\n *   extension     = singleton 1*(\"-\" (2*8alphanum))\n *\n *   singleton     = %x41-57 / %x59-5A / %x61-77 / %x79-7A / DIGIT\n *                 ; \"a\"-\"w\" / \"y\"-\"z\" / \"A\"-\"W\" / \"Y\"-\"Z\" / \"0\"-\"9\"\n *                 ; Single letters: x/X is reserved for private use\n *\n *   privateuse    = (\"x\"/\"X\") 1*(\"-\" (1*8alphanum))\n *\n *   grandfathered = 1*3ALPHA 1*2(\"-\" (2*8alphanum))\n *                   ; grandfathered registration\n *                   ; Note: i is the only singleton\n *                   ; that starts a grandfathered tag\n *\n *   alphanum      = (ALPHA / DIGIT)       ; letters and numbers\n *\n *                        Figure 1: Language Tag ABNF\n * ```\n *\n * @param {string} locale\n * @returns {Locale}\n * @since 1.14.0\n * @copyright schukai GmbH\n * @memberOf Monster.I18n\n * @throws {TypeError} value is not a string\n * @throws {Error} unsupported locale\n */\nfunction parseLocale(locale) {\n\n    locale = validateString(locale).replace(/_/g, \"-\");\n\n    let language, region, variants, parts, script, extlang,\n        regexRegular = \"(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)\",\n        regexIrregular = \"(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)\",\n        regexGrandfathered = \"(\" + regexIrregular + \"|\" + regexRegular + \")\",\n        regexPrivateUse = \"(x(-[A-Za-z0-9]{1,8})+)\",\n        regexSingleton = \"[0-9A-WY-Za-wy-z]\",\n        regexExtension = \"(\" + regexSingleton + \"(-[A-Za-z0-9]{2,8})+)\",\n        regexVariant = \"([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3})\",\n        regexRegion = \"([A-Za-z]{2}|[0-9]{3})\",\n        regexScript = \"([A-Za-z]{4})\",\n        regexExtlang = \"([A-Za-z]{3}(-[A-Za-z]{3}){0,2})\",\n        regexLanguage = \"(([A-Za-z]{2,3}(-\" + regexExtlang + \")?)|[A-Za-z]{4}|[A-Za-z]{5,8})\",\n        regexLangtag = \"(\" + regexLanguage + \"(-\" + regexScript + \")?\" + \"(-\" + regexRegion + \")?\" + \"(-\" + regexVariant + \")*\" + \"(-\" + regexExtension + \")*\" + \"(-\" + regexPrivateUse + \")?\" + \")\",\n        regexLanguageTag = \"^(\" + regexGrandfathered + \"|\" + regexLangtag + \"|\" + regexPrivateUse + \")$\",\n        regex = new RegExp(regexLanguageTag), match;\n\n\n    if ((match = regex.exec(locale)) !== null) {\n        if (match.index === regex.lastIndex) {\n            regex.lastIndex++;\n        }\n    }\n\n    if (match === undefined || match === null) {\n        throw new Error('unsupported locale');\n    }\n\n    if (match[6] !== undefined) {\n        language = match[6];\n\n        parts = language.split('-');\n        if (parts.length > 1) {\n            language = parts[0];\n            extlang = parts[1];\n        }\n\n    }\n\n    if (match[14] !== undefined) {\n        region = match[14];\n    }\n\n    if (match[12] !== undefined) {\n        script = match[12];\n    }\n\n    if (match[16] !== undefined) {\n        variants = match[16];\n    }\n\n    return new Locale(language, region, script, variants, extlang);\n\n}\n\n\nassignToNamespace('Monster.I18n', Locale, parseLocale);\nexport {Monster, Locale, parseLocale}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {BaseWithOptions} from \"../types/basewithoptions.js\";\nimport {Locale} from \"./locale.js\"\nimport {Translations} from \"./translations.js\"\n\n/**\n * A provider makes a translation object available.\n *\n * You can call the method via the monster namespace `new Monster.I18n.Provider()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.I18n.Provider()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Provider} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/provider.js';\n * new Provider()\n * </script>\n * ```\n *\n * @since 1.13.0\n * @copyright schukai GmbH\n * @memberOf Monster.I18n\n * @see {@link https://datatracker.ietf.org/doc/html/rfc3066}\n */\nclass Provider extends BaseWithOptions {\n\n    /**\n     * @param {Locale|string} locale\n     * @return {Promise}\n     */\n    getTranslations(locale) {\n        return new Promise((resolve, reject) => {\n            try {\n                resolve(new Translations(locale));\n            } catch (e) {\n                reject(e);\n            }\n\n        });\n    }\n\n}\n\n\nassignToNamespace('Monster.I18n', Provider);\nexport {Monster, Provider}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {internalSymbol} from \"../constants.js\";\nimport {extend} from \"../data/extend.js\";\nimport {Pathfinder} from \"../data/pathfinder.js\";\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from \"./base.js\";\nimport {validateObject} from \"./validate.js\";\n\n/**\n * This is the base class with options from which some monster classes are derived.\n *\n * This class is actually only used as a base class.\n * \n * However, you can also create an instance directly via the monster namespace `new Monster.Types.BaseWithOptions()`.\n *\n * ```html\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.BaseWithOptions()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```html\n * <script type=\"module\">\n * import {BaseWithOptions} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/basewithoptions.js';\n * new BaseWithOptions()\n * </script>\n * ```\n * \n * Classes that require the possibility of options can be derived directly from this class.\n * Derived classes almost always override the `defaul` getter with their own values.\n *\n * ```javascript\n * class My extends BaseWithOptions {\n *    get defaults() {\n *        return Object.assign({}, super.defaults, {\n *            mykey: true\n *        });\n *    }  \n * }\n * ```\n * \n * The class was formerly called Object.\n *\n * @since 1.13.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass BaseWithOptions extends Base {\n\n    /**\n     *\n     * @param {object} options\n     */\n    constructor(options) {\n        super();\n\n        if (options === undefined) {\n            options = {};\n        }\n\n        this[internalSymbol] = extend({}, this.defaults, validateObject(options));\n\n    }\n\n    /**\n     * This getter provides the options. Derived classes overwrite \n     * this getter with their own values. It is good karma to always include \n     * the values from the parent class.\n     * \n     * ```javascript\n     * get defaults() {\n     *     return Object.assign({}, super.defaults, {\n     *         mykey: true\n     *     });\n     * }\n     * \n     * ```\n     *\n     * @return {object}\n     */\n    get defaults() {\n        return {}\n    }\n\n    /**\n     * nested options can be specified by path `a.b.c`\n     *\n     * @param {string} path\n     * @param {*} defaultValue\n     * @return {*}\n     * @since 1.10.0\n     */\n    getOption(path, defaultValue) {\n        let value;\n\n        try {\n            value = new Pathfinder(this[internalSymbol]).getVia(path);\n        } catch (e) {\n\n        }\n\n        if (value === undefined) return defaultValue;\n        return value;\n    }\n\n\n}\n\nassignToNamespace('Monster.Types', BaseWithOptions);\nexport {Monster, BaseWithOptions}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from \"../types/base.js\";\nimport {isObject, isString} from \"../types/is.js\";\nimport {validateInstance, validateInteger, validateObject, validateString} from \"../types/validate.js\";\nimport {Locale, parseLocale} from \"./locale.js\";\n\n\n/**\n * With this class you can manage translations and access the keys.\n *\n * You can call the method via the monster namespace `new Monster.I18n.Translations()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.I18n.Translations()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/translations.js';\n * new Translations()\n * </script>\n * ```\n *\n * @example\n *\n * import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/translations.js';\n * import {parseLocale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/locale.js';\n *\n * const translation = new Translations(parseLocale('en-GB'));\n *\n * translation.assignTranslations({\n *           text1: \"click\",\n *           text2: {\n *             'one': 'click once',\n *             'other': 'click n times'\n *           }\n *        });\n *\n * console.log(translation.getText('text1'));\n * // ↦ click\n *\n * console.log(translation.getPluralRuleText('text2',1));\n * // -> click once\n * console.log(translation.getPluralRuleText('text2',2));\n * // -> click n times\n *\n * @since 1.13.0\n * @copyright schukai GmbH\n * @memberOf Monster.I18n\n * @see https://datatracker.ietf.org/doc/html/rfc3066\n */\nclass Translations extends Base {\n\n    /**\n     *\n     * @param {Locale} locale\n     */\n    constructor(locale) {\n        super();\n\n        if (isString(locale)) {\n            locale = parseLocale(locale);\n        }\n\n        this.locale = validateInstance(locale, Locale);\n        this.storage = new Map();\n\n    }\n\n\n    /**\n     * Fetches a text using the specified key.\n     * If no suitable key is found, `defaultText` is taken.\n     *\n     * @param {string} key\n     * @param {string|undefined} defaultText\n     * @return {string}\n     * @throws {Error} key not found\n     */\n    getText(key, defaultText) {\n        if (!this.storage.has(key)) {\n            if (defaultText === undefined) {\n                throw new Error('key ' + key + ' not found');\n            }\n\n            return validateString(defaultText);\n        }\n\n        let r = this.storage.get(key);\n        if (isObject(r)) {\n            return this.getPluralRuleText(key, 'other', defaultText);\n        }\n\n        return this.storage.get(key);\n    }\n\n    /**\n     * A number `count` can be passed to this method. In addition to a number, one of the keywords can also be passed directly.\n     * \"zero\", \"one\", \"two\", \"few\", \"many\" and \"other\". Remember: not every language has all rules.\n     *\n     * The appropriate text for this number is then selected. If no suitable key is found, `defaultText` is taken.\n     *\n     * @param {string} key\n     * @param {integer|count} count\n     * @param {string|undefined} defaultText\n     * @return {string}\n     */\n    getPluralRuleText(key, count, defaultText) {\n        if (!this.storage.has(key)) {\n            return validateString(defaultText);\n        }\n\n        let r = validateObject(this.storage.get(key));\n\n        let keyword;\n        if (isString(count)) {\n            keyword = count.toLocaleString();\n        } else {\n            count = validateInteger(count);\n            if (count === 0) {\n                // special handlig for zero count\n                if (r.hasOwnProperty('zero')) {\n                    return validateString(r['zero']);\n                }\n            }\n\n            keyword = new Intl.PluralRules(this.locale.toString()).select(validateInteger(count));\n        }\n\n        if (r.hasOwnProperty(keyword)) {\n            return validateString(r[keyword]);\n        }\n\n        if (r.hasOwnProperty(DEFAULT_KEY)) {\n            return validateString(r[DEFAULT_KEY]);\n        }\n\n        return validateString(defaultText);\n    }\n\n    /**\n     * Set a text for a key\n     *\n     * ```\n     * translations.setText(\"text1\": \"Make my day!\");\n     * // plural rules\n     * translations.setText(\"text6\": {\n     *     \"zero\": \"There are no files on Disk.\",\n     *     \"one\": \"There is one file on Disk.\",\n     *     \"other\": \"There are files on Disk.\"\n     *     \"default\": \"There are files on Disk.\"\n     * });\n     * ```\n     *\n     * @param {string} key\n     * @param {string|object} text\n     * @return {Translations}\n     * @throws {TypeError} value is not a string or object\n     */\n    setText(key, text) {\n\n        if (isString(text) || isObject(text)) {\n            this.storage.set(validateString(key), text);\n            return this;\n        }\n\n        throw new TypeError('value is not a string or object');\n\n    }\n\n    /**\n     * This method can be used to transfer overlays from an object. The keys are transferred and the values are entered as text.\n     *\n     * The values can either be character strings or, in the case of texts with plural forms, objects. The plural forms must be stored as text via a standard key \"zero\", \"one\", \"two\", \"few\", \"many\" and \"other\".\n     *\n     * Additionally, the key default can be specified, which will be used if no other key fits.\n     *\n     * In some languages, like for example in german, there is no own more number at the value 0. In these languages the function applies additionally zero.\n     *\n     * ```\n     * translations.assignTranslations({\n     *   \"text1\": \"Make my day!\",\n     *   \"text2\": \"I'll be back!\",\n     *   \"text6\": {\n     *     \"zero\": \"There are no files on Disk.\",\n     *     \"one\": \"There is one file on Disk.\",\n     *     \"other\": \"There are files on Disk.\"\n     *     \"default\": \"There are files on Disk.\"\n     * });\n     * ```\n     *\n     * @param {object} translations\n     * @return {Translations}\n     */\n    assignTranslations(translations) {\n        validateObject(translations);\n\n        for (const [k, v] of Object.entries(translations)) {\n            this.setText(k, v);\n        }\n\n        return this;\n\n    }\n\n}\n\nassignToNamespace('Monster.I18n', Translations);\nexport {Monster, Translations}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {internalSymbol} from \"../../constants.js\";\nimport {extend} from \"../../data/extend.js\";\nimport {assignToNamespace, Monster} from '../../namespace.js';\nimport {Formatter} from \"../../text/formatter.js\";\nimport {getGlobalFunction} from \"../../types/global.js\";\nimport {isInstance, isString} from \"../../types/is.js\";\nimport {validateObject, validateString} from \"../../types/validate.js\";\nimport {parseLocale} from \"../locale.js\";\nimport {Provider} from \"../provider.js\";\nimport {Translations} from \"../translations.js\";\n\n/**\n * The fetch provider retrieves a JSON file from the given URL and returns a translation object.\n *\n * You can create the object via the monster namespace `new Monster.I18n.Provider.Fetch()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.I18n.Providers.Fetch()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Fetch} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/providers/fetch.js';\n * new Fetch()\n * </script>\n * ```\n * \n * @example <caption>das ist ein test</caption>\n * \n * import {Fetch} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/providers/fetch.js';\n * \n * // fetch from API\n * const translation = new Fetch('https://example.com/${language}.json').getTranslation('en-GB');\n * // ↦ https://example.com/en.json\n *\n * @since 1.13.0\n * @copyright schukai GmbH\n * @memberOf Monster.I18n.Providers\n * @see {@link https://datatracker.ietf.org/doc/html/rfc3066}\n * @tutorial i18n-locale-and-formatter\n */\nclass Fetch extends Provider {\n\n    /**\n     * As options the key `fetch` can be passed. This config object is passed to the fetch method as init.\n     * \n     * The url may contain placeholders (language, script, region, variants, extlang, privateUse), so you can specify one url for all translations.\n     * \n     * ```\n     * new Fetch('https://www.example.com/assets/${language}.json')\n     * ```\n     * \n     * @param {string|URL} url\n     * @param {Object} options see {@link Monster.I18n.Providers.Fetch#defaults}\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/fetch}\n     */\n    constructor(url, options) {\n        super(options);\n\n        if (isInstance(url, URL)) {\n            url = url.toString();\n        }\n\n        if (options === undefined) {\n            options = {};\n        }\n\n        validateString(url);\n\n        /**\n         * @property {string}\n         */\n        this.url = url;\n\n        /**\n         * @private\n         * @property {Object} options\n         */\n        this[internalSymbol] = extend({}, super.defaults, this.defaults, validateObject(options));\n\n    }\n\n    /**\n     * Defaults\n     *\n     * @property {Object} fetch\n     * @property {String} fetch.method=GET\n     * @property {String} fetch.mode=cors\n     * @property {String} fetch.cache=no-cache\n     * @property {String} fetch.credentials=omit\n     * @property {String} fetch.redirect=follow\n     * @property {String} fetch.referrerPolicy=no-referrer\n     *\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API}\n     */\n    get defaults() {\n\n        return {\n            fetch: {\n                method: 'GET', // *GET, POST, PUT, DELETE, etc.\n                mode: 'cors', // no-cors, *cors, same-origin\n                cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached\n                credentials: 'omit', // include, *same-origin, omit\n                redirect: 'follow', // manual, *follow, error\n                referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url\n            }\n        }\n\n    }\n\n    /**\n     *\n     * @param {Locale|string} locale\n     * @return {Promise}\n     */\n    getTranslations(locale) {\n\n        if (isString(locale)) {\n            locale = parseLocale(locale);\n        }\n\n        let formatter = new Formatter(locale.getMap())\n\n        return getGlobalFunction('fetch')(formatter.format(this.url), this.getOption('fetch', {}))\n            .then((response) => response.json()).then(data => {\n                return new Translations(locale).assignTranslations(data);\n            });\n\n    }\n\n\n}\n\n\nassignToNamespace('Monster.I18n.Providers', Fetch);\nexport {Monster, Fetch}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {internalSymbol} from \"../constants.js\";\nimport {extend} from \"../data/extend.js\";\nimport {Pipe} from \"../data/pipe.js\";\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {BaseWithOptions} from \"../types/basewithoptions.js\";\nimport {isObject, isString} from \"../types/is.js\";\nimport {validateArray, validateString} from \"../types/validate.js\";\n\n\n/**\n * @private\n * @type {symbol}\n */\nconst internalObjectSymbol = Symbol('internalObject');\n\n/**\n * @private\n * @type {symbol}\n */\nconst watchdogSymbol = Symbol('watchdog');\n\n/**\n * @private\n * @type {symbol}\n */\nconst markerOpenIndexSymbol = Symbol('markerOpenIndex');\n\n/**\n * @private\n * @type {symbol}\n */\nconst markerCloseIndexSymbol = Symbol('markercloseIndex');\n\n/**\n * @private\n * @type {symbol}\n */\nconst workingDataSymbol = Symbol('workingData');\n\n\n/**\n * Messages can be formatted with the formatter. To do this, an object with the values must be passed to the formatter. The message can then contain placeholders.\n *\n * Look at the example below. The placeholders use the logic of Pipe.\n *\n * You can create an instance via the monster namespace `new Monster.Text.Formatter()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Text.Formatter()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/text/formatter.js';\n * new Formatter()\n * </script>\n * ```\n *\n * ## Marker in marker\n *\n * Markers can be nested. Here, the inner marker is resolved first `${subkey} ↦ 1 = ${mykey2}` and then the outer marker `${mykey2}`.\n *\n * ```\n * const text = '${mykey${subkey}}';\n * let obj = {\n *  mykey2: \"1\",\n *  subkey: \"2\"\n * };\n *\n * new Formatter(obj).format(text);\n * // ↦ 1\n * ```\n *\n * ## Callbacks\n *\n * The values in a formatter can be adjusted via the commands of the `Transformer` or the`Pipe`.\n * There is also the possibility to use callbacks.\n *\n * const formatter = new Formatter({x: '1'}, {\n *                callbacks: {\n *                    quote: (value) => {\n *                        return '\"' + value + '\"'\n *                    }\n *                }\n *            });\n *\n * formatter.format('${x | call:quote}'))\n * // ↦ \"1\"\n *\n * ## Marker with parameter\n *\n * A string can also bring its own values. These must then be separated from the key by a separator `::`.\n * The values themselves must be specified in key/value pairs. The key must be separated from the value by a separator `=`.\n *\n * When using a pipe, you must pay attention to the separators.\n *\n * @example\n *\n * import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/text/formatter.js';\n *\n * new Formatter({\n *       a: {\n *           b: {\n *               c: \"Hello\"\n *           },\n *           d: \"world\",\n *       }\n *   }).format(\"${a.b.c} ${a.d | ucfirst}!\"); // with pipe\n *\n * // ↦ Hello World!\n *\n * @since 1.12.0\n * @copyright schukai GmbH\n * @memberOf Monster.Text\n */\nclass Formatter extends BaseWithOptions {\n\n    /**\n     * Default values for the markers are `${` and `}`\n     *\n     * @param {object} object\n     * @throws {TypeError} value is not a object\n     */\n    constructor(object, options) {\n        super(options);\n        this[internalObjectSymbol] = object || {}\n        this[markerOpenIndexSymbol] = 0;\n        this[markerCloseIndexSymbol] = 0;\n    }\n\n    /**\n     * @property {object} marker\n     * @property {array} marker.open=[\"${\"]\n     * @property {array} marker.close=[\"${\"]\n     * @property {object} parameter\n     * @property {string} parameter.delimiter=\"::\"\n     * @property {string} parameter.assignment=\"=\"\n     * @property {object} callbacks={}\n     */\n    get defaults() {\n        return extend({}, super.defaults, {\n            marker: {\n                open: ['${'],\n                close: ['}']\n            },\n            parameter: {\n                delimiter: '::',\n                assignment: '='\n            },\n            callbacks: {},\n        })\n    }\n\n\n    /**\n     * Set new Parameter Character\n     *\n     * Default values for the chars are `::` and `=`\n     *\n     * ```\n     * formatter.setParameterChars('#');\n     * formatter.setParameterChars('[',']');\n     * formatter.setParameterChars('i18n{','}');\n     * ```\n     *\n     * @param {string} delimiter\n     * @param {string} assignment\n     * @return {Formatter}\n     * @since 1.24.0\n     * @throws {TypeError} value is not a string\n     */\n    setParameterChars(delimiter, assignment) {\n\n        if (delimiter !== undefined) {\n            this[internalSymbol]['parameter']['delimiter'] = validateString(delimiter);\n        }\n\n        if (assignment !== undefined) {\n            this[internalSymbol]['parameter']['assignment'] = validateString(assignment);\n        }\n\n        return this;\n    }\n\n    /**\n     * Set new Marker\n     *\n     * Default values for the markers are `${` and `}`\n     *\n     * ```\n     * formatter.setMarker('#'); // open and close are both #\n     * formatter.setMarker('[',']');\n     * formatter.setMarker('i18n{','}');\n     * ```\n     *\n     * @param {array|string} open\n     * @param {array|string|undefined} close\n     * @return {Formatter}\n     * @since 1.12.0\n     * @throws {TypeError} value is not a string\n     */\n    setMarker(open, close) {\n\n        if (close === undefined) {\n            close = open;\n        }\n\n        if (isString(open)) open = [open];\n        if (isString(close)) close = [close];\n\n        this[internalSymbol]['marker']['open'] = validateArray(open);\n        this[internalSymbol]['marker']['close'] = validateArray(close);\n        return this;\n    }\n\n    /**\n     *\n     * @param {string} text\n     * @return {string}\n     * @throws {TypeError} value is not a string\n     * @throws {Error} too deep nesting\n     */\n    format(text) {\n        this[watchdogSymbol] = 0;\n        this[markerOpenIndexSymbol] = 0;\n        this[markerCloseIndexSymbol] = 0;\n        this[workingDataSymbol] = {};\n        return format.call(this, text);\n    }\n\n}\n\n/**\n * @private\n * @return {string}\n */\nfunction format(text) {\n    const self = this;\n\n    self[watchdogSymbol]++;\n    if (this[watchdogSymbol] > 20) {\n        throw new Error('too deep nesting')\n    }\n\n    let openMarker = self[internalSymbol]['marker']['open']?.[this[markerOpenIndexSymbol]];\n    let closeMarker = self[internalSymbol]['marker']['close']?.[this[markerCloseIndexSymbol]];\n\n    // contains no placeholders\n    if (text.indexOf(openMarker) === -1 || text.indexOf(closeMarker) === -1) {\n        return text;\n    }\n\n    let result = tokenize.call(this, validateString(text), openMarker, closeMarker)\n\n    if (self[internalSymbol]['marker']['open']?.[this[markerOpenIndexSymbol] + 1]) {\n        this[markerOpenIndexSymbol]++;\n    }\n\n    if (self[internalSymbol]['marker']['close']?.[this[markerCloseIndexSymbol] + 1]) {\n        this[markerCloseIndexSymbol]++;\n    }\n\n    result = format.call(self, result)\n\n    return result;\n}\n\n/**\n * @private\n * @since 1.12.0\n * @param text\n * @return {string}\n */\nfunction tokenize(text, openMarker, closeMarker) {\n    const self = this;\n\n    let formatted = [];\n\n    const parameterAssignment = self[internalSymbol]['parameter']['assignment']\n    const parameterDelimiter = self[internalSymbol]['parameter']['delimiter']\n    const callbacks = self[internalSymbol]['callbacks'];\n\n    while (true) {\n\n        let startIndex = text.indexOf(openMarker);\n        // no marker \n        if (startIndex === -1) {\n            formatted.push(text);\n            break;\n        } else if (startIndex > 0) {\n            formatted.push(text.substring(0, startIndex))\n            text = text.substring(startIndex)\n        }\n\n        let endIndex = text.substring(openMarker.length).indexOf(closeMarker);\n        if (endIndex !== -1) endIndex += openMarker.length;\n        let insideStartIndex = text.substring(openMarker.length).indexOf(openMarker);\n        if (insideStartIndex !== -1) {\n            insideStartIndex += openMarker.length;\n            if (insideStartIndex < endIndex) {\n                let result = tokenize.call(self, text.substring(insideStartIndex), openMarker, closeMarker);\n                text = text.substring(0, insideStartIndex) + result\n                endIndex = text.substring(openMarker.length).indexOf(closeMarker);\n                if (endIndex !== -1) endIndex += openMarker.length;\n            }\n        }\n\n        if (endIndex === -1) {\n            throw new Error(\"syntax error in formatter template\")\n            return;\n        }\n\n        let key = text.substring(openMarker.length, endIndex);\n        let parts = key.split(parameterDelimiter);\n        let currentPipe = parts.shift();\n\n        self[workingDataSymbol] = extend({}, self[internalObjectSymbol], self[workingDataSymbol]);\n\n        for (const kv of parts) {\n            const [k, v] = kv.split(parameterAssignment);\n            self[workingDataSymbol][k] = v;\n        }\n\n        const t1 = key.split('|').shift().trim(); // pipe symbol\n        const t2 = t1.split('::').shift().trim(); // key value delimiter\n        const t3 = t2.split('.').shift().trim(); // path delimiter\n        let prefix = self[workingDataSymbol]?.[t3] ? 'path:' : 'static:';\n\n        let command = \"\";\n        if (prefix && key.indexOf(prefix) !== 0\n            && key.indexOf('path:') !== 0\n            && key.indexOf('static:') !== 0) {\n            command = prefix;\n        }\n\n        command += currentPipe;\n\n        const pipe = new Pipe(command);\n\n        if (isObject(callbacks)) {\n            for (const [name, callback] of Object.entries(callbacks)) {\n                pipe.setCallback(name, callback);\n            }\n        }\n\n        formatted.push(validateString(pipe.run(self[workingDataSymbol])));\n\n        text = text.substring(endIndex + closeMarker.length);\n\n    }\n\n    return formatted.join('');\n}\n\nassignToNamespace('Monster.Text', Formatter);\nexport {Monster, Formatter}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {validateInstance, validateInteger} from \"../types/validate.js\";\nimport {LogEntry} from \"./logentry.js\";\nimport {ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN} from \"./logger.js\";\n\n/**\n * you can call the method via the monster namespace `new Monster.Logging.Handler()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Logging.Handler())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/logging/handler.js';\n * console.log(new Handler())\n * </script>\n * ```\n *\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Logging\n */\nclass Handler extends Base {\n    constructor() {\n        super();\n\n        /**\n         * Loglevel\n         *\n         * @type {integer}\n         */\n        this.loglevel = OFF;\n    }\n\n    /**\n     * This is the central log function. this method must be\n     * overwritten by derived handlers with their own logic.\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     * @param {LogEntry} entry\n     * @returns {boolean}\n     */\n    log(entry) {\n        validateInstance(entry, LogEntry);\n\n        if (this.loglevel < entry.getLogLevel()) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * set loglevel\n     *\n     * @param {integer} loglevel\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setLogLevel(loglevel) {\n        validateInteger(loglevel)\n        this.loglevel = loglevel;\n        return this;\n    }\n\n    /**\n     * get loglevel\n     *\n     * @returns {integer}\n     * @since 1.5.0\n     */\n    getLogLevel() {\n        return this.loglevel;\n    }\n\n    /**\n     *  Set log level to All\n     *\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setAll() {\n        this.setLogLevel(ALL);\n        return this;\n    };\n\n    /**\n     * Set log level to Trace\n     *\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setTrace() {\n        this.setLogLevel(TRACE);\n        return this;\n    };\n\n    /**\n     * Set log level to Debug\n     *\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setDebug() {\n        this.setLogLevel(DEBUG);\n        return this;\n    };\n\n    /**\n     * Set log level to Info\n     *\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setInfo() {\n        this.setLogLevel(INFO);\n        return this;\n    };\n\n    /**\n     * Set log level to Warn\n     *\n     * @returns {undefined}\n     * @since 1.5.0\n     */\n    setWarn() {\n        this.setLogLevel(WARN);\n        return this;\n    };\n\n    /**\n     * Set log level to Error\n     *\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setError() {\n        this.setLogLevel(ERROR);\n        return this;\n    };\n\n    /**\n     * Set log level to Fatal\n     *\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setFatal() {\n        this.setLogLevel(FATAL);\n        return this;\n    };\n\n\n    /**\n     * Set log level to Off\n     *\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setOff() {\n        this.setLogLevel(OFF);\n        return this;\n    };\n\n\n}\n\n\nassignToNamespace('Monster.Logging', Handler);\nexport {Monster, Handler};\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {validateInteger} from '../types/validate.js';\n\n\n/**\n * you can call the method via the monster namespace `new Monster.Logging.LogEntry()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Logging.LogEntry())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/logging/logentry.js';\n * console.log(new LogEntry())\n * </script>\n * ```\n *\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Logging\n */\nclass LogEntry extends Base {\n    /**\n     *\n     * @param {Integer} loglevel\n     * @param {...*} args\n     */\n    constructor(loglevel, ...args) {\n        super();\n        validateInteger(loglevel);\n\n        this.loglevel = loglevel\n        this.arguments = args\n    }\n\n    /**\n     *\n     * @returns {integerr}\n     */\n    getLogLevel() {\n        return this.loglevel\n    }\n\n    /**\n     *\n     * @returns {array}\n     */\n    getArguments() {\n        return this.arguments\n    }\n\n}\n\nassignToNamespace('Monster.Logging', LogEntry);\nexport {Monster, LogEntry}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {Handler} from '../logging/handler.js';\nimport {LogEntry} from '../logging/logentry.js';\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {validateInteger, validateObject, validateString} from '../types/validate.js';\n\n\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst ALL = 255;\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst TRACE = 64;\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst DEBUG = 32;\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst INFO = 16;\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst WARN = 8;\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst ERROR = 4;\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst FATAL = 2;\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst OFF = 0;\n\n/**\n * You can create an object of the class simply by using the namespace `new Monster.Logging.Logger()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Logging.Logger()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this class individually.\n *\n * ```\n * <script type=\"module\">\n * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/logging/logger.js';\n * new Logger()\n * </script>\n * ```\n *\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Logging\n */\nclass Logger extends Base {\n\n    /**\n     *\n     */\n    constructor() {\n        super();\n        this.handler = new Set;\n    }\n\n    /**\n     *\n     * @param {Handler} handler\n     * @returns {Logger}\n     * @throws {Error} the handler must be an instance of Handler\n     */\n    addHandler(handler) {\n        validateObject(handler)\n        if (!(handler instanceof Handler)) {\n            throw new Error(\"the handler must be an instance of Handler\")\n        }\n\n        this.handler.add(handler)\n        return this;\n    }\n\n    /**\n     *\n     * @param {Handler} handler\n     * @returns {Logger}\n     * @throws {Error} the handler must be an instance of Handler\n     */\n    removeHandler(handler) {\n        validateObject(handler)\n        if (!(handler instanceof Handler)) {\n            throw new Error(\"the handler must be an instance of Handler\")\n        }\n\n        this.handler.delete(handler);\n        return this;\n    }\n\n    /**\n     * log Trace message\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     * @param {*} arguments\n     * @returns {Logger}\n     * @since 1.5.0\n     */\n    logTrace() {\n        triggerLog.apply(this, [TRACE, ...arguments]);\n        return this;\n    };\n\n    /**\n     * log Debug message\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     * @param {*} arguments\n     * @returns {Logger}\n     * @since 1.5.0\n     */\n    logDebug() {\n        triggerLog.apply(this, [DEBUG, ...arguments]);\n        return this;\n    };\n\n    /**\n     * log Info message\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     *\n     * @param {*} arguments\n     * @returns {Logger}\n     * @since 1.5.0\n     */\n    logInfo() {\n        triggerLog.apply(this, [INFO, ...arguments]);\n        return this;\n    };\n\n    /**\n     * log Warn message\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     * @param {*} arguments\n     * @returns {Logger}\n     * @since 1.5.0\n     */\n    logWarn() {\n        triggerLog.apply(this, [WARN, ...arguments]);\n        return this;\n    };\n\n    /**\n     * log Error message\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     * @param {*} arguments\n     * @returns {Logger}\n     * @since 1.5.0\n     */\n    logError() {\n        triggerLog.apply(this, [ERROR, ...arguments]);\n        return this;\n    };\n\n    /**\n     * log Fatal message\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     * @param {*} arguments\n     * @returns {Logger}\n     * @since 1.5.0\n     */\n    logFatal() {\n        triggerLog.apply(this, [FATAL, ...arguments]);\n        return this;\n    };\n\n\n    /**\n     * Labels\n     *\n     * @param {integer} level\n     * @returns {string}\n     */\n    getLabel(level) {\n        validateInteger(level);\n\n        if (level === ALL) return 'ALL';\n        if (level === TRACE) return 'TRACE';\n        if (level === DEBUG) return 'DEBUG';\n        if (level === INFO) return 'INFO';\n        if (level === WARN) return 'WARN';\n        if (level === ERROR) return 'ERROR';\n        if (level === FATAL) return 'FATAL';\n        if (level === OFF) return 'OFF';\n\n        return 'unknown';\n    };\n\n    /**\n     * Level\n     *\n     * @param {string} label\n     * @returns {integer}\n     */\n    getLevel(label) {\n        validateString(label);\n\n        if (label === 'ALL') return ALL;\n        if (label === 'TRACE') return TRACE;\n        if (label === 'DEBUG') return DEBUG;\n        if (label === 'INFO') return INFO;\n        if (label === 'WARN') return WARN;\n        if (label === 'ERROR') return ERROR;\n        if (label === 'FATAL') return FATAL;\n        if (label === 'OFF') return OFF;\n\n        return 0;\n    };\n\n\n}\n\nassignToNamespace('Monster.Logging', Logger);\nexport {Monster, Logger, ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF};\n\n\n/**\n * Log triggern\n *\n * @param {integer} loglevel\n * @param {*} args\n * @returns {Logger}\n * @private\n */\nfunction triggerLog(loglevel, ...args) {\n    var logger = this;\n\n    for (let handler of logger.handler) {\n        handler.log(new LogEntry(loglevel, args))\n    }\n\n    return logger;\n\n}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../../namespace.js';\nimport {Base} from '../../types/base.js';\nimport {getGlobalObject} from \"../../types/global.js\";\nimport {Handler} from '../handler.js';\nimport {LogEntry} from \"../logentry.js\";\n\n/**\n * You can create an object of the class simply by using the namespace `new Monster.Logging.Handler.ConsoleHandler()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Logging.Handler.ConsoleHandler())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this class individually.\n *\n * ```\n * <script type=\"module\">\n * import {ConsoleHandler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/logging/handler/console.js';\n * console.log(new ConsoleHandler())\n * </script>\n * ```\n *\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Logging.Handler\n */\nclass ConsoleHandler extends Handler {\n    constructor() {\n        super();\n    }\n\n\n    /**\n     * This is the central log function. this method must be\n     * overwritten by derived handlers with their own logic.\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     * @param {LogEntry} entry\n     * @returns {boolean}\n     */\n    log(entry) {\n        if (super.log(entry)) {\n            let console = getGlobalObject('console');\n            if (!console) return false;\n            console.log(entry.toString());\n            return true;\n        }\n\n        return false;\n    }\n\n}\n\n\nassignToNamespace('Monster.Logging.Handler', ConsoleHandler);\nexport {Monster, ConsoleHandler};\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {getGlobal} from '../types/global.js';\n\n\n/**\n * this function uses crypt and returns a random number.\n *\n * you can call the method via the monster namespace `Monster.Math.random()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Math.random(1,10)\n * // ↦ 5\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {random} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/math/random.js';\n * random(1,10)\n * // ↦ 5\n * </script>\n * ```\n *\n * @param {number} min starting value of the definition set (default is 0)\n * @param {number} max end value of the definition set (default is 1000000000)\n * @returns {number}\n * @memberOf Monster.Math\n * @throws {Error} missing crypt\n * @throws {Error} we cannot generate numbers larger than 53 bits.\n * @throws {Error} the distance is too small to create a random number.\n\n * @since 1.0.0\n * @copyright schukai GmbH\n */\nfunction random(min, max) {\n\n    if (min === undefined) {\n        min = 0;\n    }\n    if (max === undefined) {\n        max = MAX;\n    }\n\n    if (max < min) {\n        throw new Error(\"max must be greater than min\");\n    }\n\n    return Math.round(create(min, max));\n\n}\n\n/**\n * @private\n * @type {number}\n */\nvar MAX = 1000000000;\n\n\nMath.log2 = Math.log2 || function (n) {\n    return Math.log(n) / Math.log(2);\n};\n\n/**\n *\n * @param {number} min\n * @param {number} max\n * @returns {number}\n * @private\n * @throws {Error} missing crypt\n * @throws {Error} we cannot generate numbers larger than 53 bits.\n * @throws {Error} the distance is too small to create a random number.\n */\nfunction create(min, max) {\n    let crypt;\n    let globalReference = getGlobal();\n\n    crypt = globalReference?.['crypto'] || globalReference?.['msCrypto'] || globalReference?.['crypto'] || undefined;\n\n    if (typeof crypt === \"undefined\") {\n        throw new Error(\"missing crypt\")\n    }\n\n    let rval = 0;\n    const range = max - min;\n    if (range < 2) {\n        throw  new Error('the distance is too small to create a random number.')\n    }\n\n    const bitsNeeded = Math.ceil(Math.log2(range));\n    if (bitsNeeded > 53) {\n        throw  new Error(\"we cannot generate numbers larger than 53 bits.\");\n    }\n    const bytesNeeded = Math.ceil(bitsNeeded / 8);\n    const mask = Math.pow(2, bitsNeeded) - 1;\n\n    const byteArray = new Uint8Array(bytesNeeded);\n    crypt.getRandomValues(byteArray);\n\n    let p = (bytesNeeded - 1) * 8;\n    for (var i = 0; i < bytesNeeded; i++) {\n        rval += byteArray[i] * Math.pow(2, p);\n        p -= 8;\n    }\n\n    rval = rval & mask;\n\n    if (rval >= range) {\n        return create(min, max);\n    }\n\n    if (rval < min) {\n        rval += min;\n    }\n    \n    return rval;\n\n}\n\nassignToNamespace('Monster.Math', random);\nexport {Monster, random}\n\n\n\n\n","'use strict';\n\nimport {random} from \"../math/random.js\";\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {getGlobal} from \"./global.js\";\nimport {ID} from \"./id.js\";\n\n/**\n * @private\n * @type {number}\n */\nlet internalCounter = 0;\n\n/**\n * You can call the method via the monster namespace `new Monster.Types.RandomID()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Types.RandomID())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {RandomID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/randomid.js';\n * console.log(new RandomID())\n * </script>\n * ```\n *\n * @since 1.6.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @summary class to generate random numbers\n */\nclass RandomID extends ID {\n\n    /**\n     * create new object\n     */\n    constructor() {\n        super();\n\n        internalCounter += 1;\n\n        this.id = getGlobal().btoa(random(1, 10000))\n            .replace(/=/g, '')\n            /** No numbers at the beginning of the ID, because of possible problems with DOM */\n            .replace(/^[0-9]+/, 'X') + internalCounter;\n    }\n\n}\n\nassignToNamespace('Monster.Types', RandomID);\nexport {Monster, RandomID}\n","'use strict';\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from './base.js';\n\n/**\n * The version object contains a sematic version number\n *\n * You can create the object via the monster namespace `new Monster.Types.Version()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Types.Version('1.2.3')) // ↦ 1.2.3\n * console.log(new Monster.Types.Version('1')) // ↦ 1.0.0\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this class individually.\n *\n * ```\n * <script type=\"module\">\n * import {Version} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/version.js';\n * console.log(new Version('1.2.3')) // ↦ 1.2.3\n * console.log(new Version('1')) // ↦ 1.0.0\n * </script>\n * ```\n *\n * @example\n *\n * import {Version} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/version.js';\n *\n * new Version('1.0.0') // ↦ 1.0.0\n * new Version(1)  // ↦ 1.0.0\n * new Version(1, 0, 0) // ↦ 1.0.0\n * new Version('1.2.3', 4, 5) // ↦ 1.4.5\n *\n * @since 1.0.0\n * @author schukai GmbH\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @summary The version object contains a sematic version number\n */\nclass Version extends Base {\n\n    /**\n     *\n     * @param major\n     * @param minor\n     * @param patch\n     * @throws {Error} major is not a number\n     * @throws {Error} minor is not a number\n     * @throws {Error} patch is not a number\n     */\n    constructor(major, minor, patch) {\n        super();\n\n        if (typeof major === 'string' && minor === undefined && patch === undefined) {\n\n            let parts = major.toString().split('.');\n            major = parseInt(parts[0] || 0);\n            minor = parseInt(parts[1] || 0);\n            patch = parseInt(parts[2] || 0);\n        }\n\n        if (major === undefined) {\n            throw  new Error(\"major version is undefined\");\n        }\n\n        if (minor === undefined) {\n            minor = 0;\n        }\n\n        if (patch === undefined) {\n            patch = 0;\n        }\n\n        this.major = parseInt(major);\n        this.minor = parseInt(minor);\n        this.patch = parseInt(patch);\n\n        if (isNaN(this.major)) {\n            throw  new Error(\"major is not a number\");\n        }\n\n        if (isNaN(this.minor)) {\n            throw  new Error(\"minor is not a number\");\n        }\n\n        if (isNaN(this.patch)) {\n            throw  new Error(\"patch is not a number\");\n        }\n\n    }\n\n    /**\n     *\n     * @returns {string}\n     */\n    toString() {\n        return this.major + '.' + this.minor + '.' + this.patch;\n    }\n\n    /**\n     * returns 0 if equal, -1 if the object version is less and 1 if greater\n     * then the compared version\n     *\n     * @param {string|Version} version Version to compare\n     * @returns {number}\n     */\n    compareTo(version) {\n\n        if (version instanceof Version) {\n            version = version.toString();\n        }\n\n        if (typeof version !== 'string') {\n            throw  new Error(\"type exception\");\n        }\n\n        if (version === this.toString()) {\n            return 0;\n        }\n\n        let a = [this.major, this.minor, this.patch];\n        let b = version.split('.');\n        let len = Math.max(a.length, b.length);\n\n        for (let i = 0; i < len; i += 1) {\n            if ((a[i] && !b[i] && parseInt(a[i]) > 0) || (parseInt(a[i]) > parseInt(b[i]))) {\n                return 1;\n            } else if ((b[i] && !a[i] && parseInt(b[i]) > 0) || (parseInt(a[i]) < parseInt(b[i]))) {\n                return -1;\n            }\n        }\n\n        return 0;\n    };\n\n}\n\nassignToNamespace('Monster.Types', Version);\n\n\nlet monsterVersion;\n\n/**\n * Version of monster\n *\n * You can call the method via the monster namespace `Monster.getVersion()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.getVersion())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getVersion} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/version.js';\n * console.log(getVersion())\n * </script>\n * ```\n *\n * @returns {Monster.Types.Version}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @author schukai GmbH\n * @memberOf Monster\n */\nfunction getVersion() {\n    if (monsterVersion instanceof Version) {\n        return monsterVersion;\n    }\n    /**#@+ dont touch, replaced by make with package.json version */\n    monsterVersion = new Version('1.30.1')\n    /**#@-*/\n\n    return monsterVersion;\n\n}\n\nassignToNamespace('Monster', getVersion);\nexport {Monster, Version, getVersion}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {isFunction} from '../types/is.js';\n\n/**\n * The comparator allows a comparison function to be abstracted.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Util.Comparator()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Comparator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/util/comparator.js';\n * console.log(new Comparator())\n * </script>\n * ```\n *\n * The following are some examples of the application of the class.\n *\n * ```\n * new Comparator().lessThanOrEqual(2, 5) // ↦ true\n * new Comparator().greaterThan(4, 2) // ↦ true\n * new Comparator().equal(4, 4) // ↦ true\n * new Comparator().equal(4, 5) // ↦ false\n * ```\n *\n * You can also pass your own comparison function, and thus define the comparison function.\n *\n * ```\n * new Comparator(function (a, b) {\n *      if (a.v === b.v) return 0;\n *         return a.v < b.v ? -1 : 1;\n *      }).equal({v: 2}, {v: 2});  // ↦ true\n * ```\n *\n * @example\n *\n * import {Comparator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/util/comparator.js';\n *\n * console.log(new Comparator().lessThanOrEqual(2, 5))\n * // ↦ true\n * console.log(new Comparator().greaterThan(4, 2))\n * // ↦ true\n * console.log(new Comparator().equal(4, 4))\n * // ↦ true\n * console.log(new Comparator().equal(4, 5))\n * // ↦ false\n *\n * @since 1.3.0\n * @memberOf Monster.Util\n */\nclass Comparator extends Base {\n\n    /**\n     * create new comparator\n     *\n     * @param {Monster.Util~exampleCallback} [callback] Comparator callback\n     * @throw {TypeError} unsupported type\n     * @throw {TypeError} impractical comparison\n     */\n    constructor(callback) {\n        super();\n\n        if (isFunction(callback)) {\n            this.compare = callback\n        } else if (callback !== undefined) {\n            throw new TypeError(\"unsupported type\")\n        } else {\n            // default compare function\n\n            /**\n             *\n             * @param {*} a\n             * @param {*} b\n             * @return {integer} -1, 0 or 1\n             */\n            this.compare = function (a, b) {\n\n                if (typeof a !== typeof b) {\n                    throw new TypeError(\"impractical comparison\", \"types/comparator.js\")\n                }\n\n                if (a === b) {\n                    return 0;\n                }\n                return a < b ? -1 : 1;\n            };\n        }\n\n    }\n\n    /**\n     * changes the order of the operators\n     *\n     * @return {Comparator}\n     */\n    reverse() {\n        const original = this.compare;\n        this.compare = (a, b) => original(b, a);\n        return this;\n    }\n\n    /**\n     * Checks if two variables are equal.\n     *\n     * @param {*} a\n     * @param {*} b\n     *\n     * @return {boolean}\n     */\n    equal(a, b) {\n        return this.compare(a, b) === 0;\n    }\n\n\n    /**\n     * Checks if variable `a` is greater than `b`\n     *\n     * @param {*} a\n     * @param {*} b\n     *\n     * @return {boolean}\n     */\n    greaterThan(a, b) {\n        return this.compare(a, b) > 0;\n    }\n\n    /**\n     * Checks if variable `a` is greater than or equal to `b`\n     *\n     * @param {*} a\n     * @param {*} b\n     *\n     * @return {boolean}\n     */\n    greaterThanOrEqual(a, b) {\n        return this.greaterThan(a, b) || this.equal(a, b);\n    }\n\n    /**\n     * Checks if variable `a` is less than or equal to `b`\n     *\n     * @param {*} a\n     * @param {*} b\n     *\n     * @return {boolean}\n     */\n    lessThanOrEqual(a, b) {\n        return this.lessThan(a, b) || this.equal(a, b);\n    }\n\n    /**\n     * Checks if variable a is less than b\n     *\n     * @param {*} a\n     * @param {*} b\n     *\n     * @return {boolean}\n     */\n    lessThan(a, b) {\n        return this.compare(a, b) < 0;\n    }\n\n\n}\n\n\n/**\n * This is the description for the callback function used by the operator\n *\n * ```\n * new Comparator(function (a, b) {\n *      if (a.v === b.v) return 0;\n *         return a.v < b.v ? -1 : 1;\n *      }).equal({v: 2}, {v: 2});  // ↦ true\n * ```\n *\n * @callback Monster.Util~exampleCallback\n * @param {*} a\n * @param {*} b\n * @return {integer} -1, 0 or 1\n * @memberOf Monster.Util\n * @see Monster.Util.Comparator\n */\n\n\n/**\n *\n */\nassignToNamespace('Monster.Util', Comparator);\nexport {Monster, Comparator}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {validateObject} from '../types/validate.js';\n\n/**\n * Deep freeze a object\n *\n * You can call the method via the monster namespace `Monster.Util.deepFreeze()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Util.deepFreeze({})\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {deepFreeze} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/util/freeze.js';\n * deepFreeze({})\n * </script>\n * ```\n *\n * @param {object} object object to be freeze\n * @since 1.0.0\n * @returns {object}\n * @memberOf Monster.Util\n * @copyright schukai GmbH\n * @throws {TypeError} value is not a object\n */\nfunction deepFreeze(object) {\n\n    validateObject(object)\n\n    // Retrieve the defined property names of the object\n    var propNames = Object.getOwnPropertyNames(object);\n\n    // Freeze properties before freezing yourself\n    for (let name of propNames) {\n        let value = object[name];\n\n        object[name] = (value && typeof value === \"object\") ?\n            deepFreeze(value) : value;\n    }\n\n    return Object.freeze(object);\n}\n\nassignToNamespace('Monster.Util', deepFreeze);\nexport {Monster, deepFreeze}\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](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\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__.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};","/**\n * @license\n * Copyright 2021 schukai GmbH\n * SPDX-License-Identifier: AGPL-3.0-only or COMMERCIAL\n * @author schukai GmbH\n */\n\n'use strict';\n\nimport './constants.js';\nimport './constraints/abstract.js';\nimport './constraints/abstractoperator.js';\nimport './constraints/andoperator.js';\nimport './constraints/invalid.js';\nimport './constraints/isarray.js';\n\n// find packages/monster/source/ -type f -name \"*.js\" -not -name \"*namespace*\" -not -iname  \"monster.js\"\nimport './constraints/isobject.js';\nimport './constraints/oroperator.js';\nimport './constraints/valid.js';\nimport './data/buildmap.js';\nimport './data/diff.js';\nimport './data/extend.js';\nimport './data/pathfinder.js';\nimport './data/pipe.js';\nimport './data/transformer.js';\nimport './dom/assembler.js';\nimport './dom/attributes.js';\nimport './dom/constants.js';\nimport './dom/customcontrol.js';\nimport './dom/customelement.js';\nimport './dom/events.js';\nimport './dom/locale.js';\nimport './dom/template.js';\nimport './dom/theme.js';\nimport './dom/updater.js';\nimport './dom/util.js';\nimport './i18n/locale.js';\nimport './i18n/provider.js';\nimport './i18n/providers/fetch.js';\nimport './i18n/translations.js';\nimport './logging/handler.js';\nimport './logging/handler/console.js';\nimport './logging/logentry.js';\nimport './logging/logger.js';\nimport './math/random.js';\nimport {Monster} from './namespace.js';\nimport './text/formatter.js';\nimport './types/base.js';\nimport './types/basewithoptions.js';\nimport './types/global.js';\nimport './types/id.js';\nimport './types/is.js';\nimport './types/observer.js';\nimport './types/observerlist.js';\nimport './types/proxyobserver.js';\nimport './types/queue.js';\nimport './types/randomid.js';\nimport './types/stack.js';\nimport './types/tokenlist.js';\nimport './types/typeof.js';\nimport './types/uniquequeue.js';\nimport './types/validate.js';\nimport './types/version.js';\nimport './util/clone.js';\nimport './util/comparator.js';\nimport './util/freeze.js';\n\n\nlet rootName\ntry {\n    rootName = Monster.Types.getGlobalObject('__MonsterRootName__');\n} catch (e) {\n\n}\n\nif (!rootName) rootName = \"Monster\";\n\nMonster.Types.getGlobal()[rootName] = Monster\nexport {Monster};"],"names":["Monster","internalSymbol","Symbol","internalStateSymbol","Namespace","namespace","undefined","Error","getNamespace","assignToNamespace","ns","current","namespaceFor","split","i","l","objectName","fn","hasOwnProperty","name","toString","s","f","match","Array","isArray","c","e","parts","space","length","Base","AbstractConstraint","value","Promise","reject","JSON","stringify","Object","AbstractOperator","operantA","operantB","TypeError","AndOperator","all","isValid","Invalid","IsArray","resolve","isIterable","iterator","isPrimitive","type","isSymbol","isBoolean","isString","isObject","isInstance","instance","isFunction","isInteger","Number","IsObject","OrOperator","self","a","b","then","catch","Valid","validateString","clone","DELIMITER","Pathfinder","WILDCARD","PARENT","buildMap","subject","selector","valueTemplate","keyTemplate","filter","assembleParts","v","k","m","build","set","callback","result","Map","map","buildFlatMap","call","forEach","key","parentMap","currentMap","resultLength","size","currentPath","shift","push","finder","getVia","join","o","copyKey","kk","sub","definition","defaultValue","regexp","array","matchAll","groups","placeholder","path","replaceAll","validateIterable","validatePrimitive","validateBoolean","validateObject","validateInstance","n","validateArray","validateSymbol","validateFunction","validateInteger","getGlobal","typeOf","obj","copy","len","Date","setTime","getTime","Element","HTMLDocument","DocumentFragment","globalContext","window","document","navigator","Proxy","cloneObject","constructor","prototype","getClone","globalReference","globalThis","defineProperty","get","configurable","__monster__","Function","getGlobalObject","getGlobalFunction","results","exec","toLowerCase","Stack","object","wildCard","wildcard","getValueViaPath","setValueViaPath","deleteValueViaPath","iterate","check","entries","anchor","WeakMap","Set","WeakSet","parseInt","WeakRef","descriptor","getOwnPropertyDescriptor","getPrototypeOf","last","pop","subpath","stack","isEmpty","peek","append","assignProperty","delete","data","diff","first","second","doDiff","getKeys","keys","fill","_","concat","typeA","typeB","currPath","currDiff","buildResult","getOperator","operator","isNotEqual","extend","arguments","Transformer","Pipe","pipe","context","t","setCallback","reduce","accumulator","transformer","currentIndex","run","ID","args","disassemble","command","callbacks","transform","apply","regex","g","p","r","replace","trim","convertToString","console","toUpperCase","parse","encodeURIComponent","callbackName","has","unshift","doc","DOMParser","parseFromString","body","textContent","trueStatement","falseStatement","condition","firstchar","charAt","substr","btoa","atob","log","prefix","suffix","sort","useKey","exists","pf","start","end","substring","defaultType","parseFloat","internalCounter","count","id","ProxyObserver","ATTRIBUTEPREFIX","Assembler","fragment","attributePrefix","cloneNode","Observer","ObserverList","realSubject","getHandler","objectMap","proxyMap","observers","observer","attach","detach","notify","contains","proxy","handler","target","receiver","Reflect","writable","enumerable","deleteProperty","setPrototypeOf","object1","TokenList","UniqueQueue","tags","queue","tag","add","remove","setTimeout","poll","init","tokens","index","next","done","counter","token","clear","newToken","from","indexOf","splice","toggleValue","Queue","unique","pomises","update","ATTRIBUTE_OBJECTLINK","findClosestObjectLink","element","findClosestByAttribute","addToObjectLink","symbol","HTMLElement","addAttributeToken","removeObjectLink","removeAttributeToken","hasObjectLink","containsAttributeToken","getLinkedObjects","toggleAttributeToken","hasAttribute","setAttribute","getAttribute","toggle","replaceAttributeToken","to","clearAttributeTokens","closest","findClosestByClass","className","classList","DEFAULT_THEME","ATTRIBUTE_PREFIX","ATTRIBUTE_OPTIONS","ATTRIBUTE_OPTIONS_SELECTOR","ATTRIBUTE_THEME_PREFIX","ATTRIBUTE_THEME_NAME","ATTRIBUTE_UPDATER_ATTRIBUTES","ATTRIBUTE_UPDATER_SELECT_THIS","ATTRIBUTE_UPDATER_REPLACE","ATTRIBUTE_UPDATER_INSERT","ATTRIBUTE_UPDATER_INSERT_REFERENCE","ATTRIBUTE_UPDATER_REMOVE","ATTRIBUTE_UPDATER_BIND","ATTRIBUTE_TEMPLATE_PREFIX","ATTRIBUTE_ROLE","ATTRIBUTE_DISABLED","ATTRIBUTE_VALUE","ATTRIBUTE_ERRORMESSAGE","objectUpdaterLinkSymbol","TAG_SCRIPT","TAG_STYLE","TAG_LINK","ATTRIBUTE_ID","ATTRIBUTE_CLASS","ATTRIBUTE_TITLE","ATTRIBUTE_SRC","ATTRIBUTE_HREF","ATTRIBUTE_TYPE","ATTRIBUTE_NONCE","ATTRIBUTE_TRANSLATE","ATTRIBUTE_TABINDEX","ATTRIBUTE_SPELLCHECK","ATTRIBUTE_SLOT","ATTRIBUTE_PART","ATTRIBUTE_LANG","ATTRIBUTE_ITEMTYPE","ATTRIBUTE_ITEMSCOPE","ATTRIBUTE_ITEMREF","ATTRIBUTE_ITEMID","ATTRIBUTE_ITEMPROP","ATTRIBUTE_IS","ATTRIBUTE_INPUTMODE","ATTRIBUTE_ACCESSKEY","ATTRIBUTE_AUTOCAPITALIZE","ATTRIBUTE_AUTOFOCUS","ATTRIBUTE_CONTENTEDITABLE","ATTRIBUTE_DIR","ATTRIBUTE_DRAGGABLE","ATTRIBUTE_ENTERKEYHINT","ATTRIBUTE_EXPORTPARTS","ATTRIBUTE_HIDDEN","CustomElement","attributeObserverSymbol","attachedInternalSymbol","CustomControl","attachInternals","initObserver","getInternal","labels","getTag","validity","validationMessage","willValidate","states","form","state","setFormValue","flags","message","setValidity","checkValidity","reportValidity","list","setOption","parseDataURL","findDocumentTemplate","Template","Updater","initMethodSymbol","assembleMethodSymbol","defaults","initOptionObserver","shadowMode","delegatesFocus","templates","main","attachObserver","detachObserver","containsObserver","getRealSubject","getSubject","setVia","options","parseOptionsJSON","elements","nodeList","AttributeOptions","getOptionsFromAttributes","setOptions","ScriptOptions","getOptionsFromScriptTag","getOption","initShadowRoot","shadowRoot","childNodes","initCSSStylesheet","NodeList","initHtmlContent","getSlottedElements","assignUpdaterToElement","attrName","oldVal","newVal","node","containChildNode","Node","ShadowRoot","query","slots","querySelectorAll","slot","assignedElements","matches","lastDisabledValue","flag","removeAttribute","updaters","updater","d","assign","querySelector","HTMLScriptElement","dataUrl","content","template","appendChild","createDocumentFragment","html","innerHTML","styleSheet","getCSSStyleSheet","CSSStyleSheet","cssRules","adoptedStyleSheets","trimedStyleSheet","style","createElement","prepend","attachShadow","mode","registerCustomElement","define","HTMLTemplateElement","u","enableEventProcessing","MediaType","parseMediaType","internal","DataUrl","mediatype","base64","dataurl","mediatypeAndBase64","base64Flag","endsWith","lastIndexOf","decodeURIComponent","subtype","parameter","startsWith","parseParameter","entry","kv","getDocumentTheme","currentNode","Document","prefixID","getRootNode","ownerDocument","theme","themedPrefixID","getName","getElementById","themedID","Theme","trimSpaces","findTargetElementFromEvent","getDocument","eventTypes","getCheckStateCallback","diffResult","change","removeElement","insertElement","updateContent","updateAttributes","types","disableEventProcessing","addEventListener","getControlEventHandler","capture","passive","removeEventListener","notifyObservers","retrieveFromBindings","HTMLInputElement","HTMLOptionElement","event","retrieveAndSetValue","pathfinder","checked","HTMLTextAreaElement","HTMLSelectElement","selectedOptions","parentNode","removeChild","mem","wd","container","found","containerElement","attributes","def","refPrefix","cmd","dataPath","insertPoint","hasChildNodes","lastChild","available","ref","refElement","appendNewDocumentFragment","nodes","applyRecursive","child","runUpdateContent","assignedNodes","firstChild","runUpdateAttributes","handleInputControlAttributeUpdate","opt","selected","selectedIndex","fireEvent","click","Event","bubbles","cancelable","dispatchEvent","HTMLCollection","fireCustomEvent","detail","CustomEvent","attributeName","attributeValue","composedPath","getWindow","getDocumentFragmentFromString","parseLocale","DEFAULT_LANGUAGE","getLocaleOfDocument","locale","propertiesSymbol","localeStringSymbol","Locale","language","region","script","variants","extlang","privateUse","privateValue","localeString","regexRegular","regexIrregular","regexGrandfathered","regexPrivateUse","regexSingleton","regexExtension","regexVariant","regexRegion","regexScript","regexExtlang","regexLanguage","regexLangtag","regexLanguageTag","RegExp","lastIndex","BaseWithOptions","Translations","Provider","storage","defaultText","getPluralRuleText","keyword","toLocaleString","Intl","PluralRules","select","DEFAULT_KEY","text","translations","setText","Formatter","Fetch","url","URL","fetch","method","cache","credentials","redirect","referrerPolicy","formatter","getMap","format","response","json","assignTranslations","internalObjectSymbol","watchdogSymbol","markerOpenIndexSymbol","markerCloseIndexSymbol","workingDataSymbol","marker","open","close","delimiter","assignment","openMarker","closeMarker","tokenize","formatted","parameterAssignment","parameterDelimiter","startIndex","endIndex","insideStartIndex","currentPipe","t1","t2","t3","LogEntry","ALL","DEBUG","ERROR","FATAL","INFO","OFF","TRACE","WARN","Handler","loglevel","getLogLevel","setLogLevel","Logger","triggerLog","level","label","logger","ConsoleHandler","random","min","max","MAX","Math","round","create","log2","crypt","rval","range","bitsNeeded","ceil","bytesNeeded","mask","pow","byteArray","Uint8Array","getRandomValues","RandomID","Version","major","minor","patch","isNaN","version","monsterVersion","getVersion","Comparator","compare","original","greaterThan","equal","lessThan","deepFreeze","propNames","getOwnPropertyNames","freeze","rootName","Types"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"monster.dev.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;ACVa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,cAAc,GAAGC,MAAM,CAAC,cAAD,CAA7B;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,mBAAmB,GAAGD,MAAM,CAAC,OAAD,CAAlC;;;;;;;;;;;;ACtBa;AAGb;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;IACME;AAEF;AACJ;AACA;AACA;AACA;AACI,qBAAYC,SAAZ,EAAuB;AAAA;;AACnB,QAAIA,SAAS,KAAKC,SAAd,IAA2B,OAAOD,SAAP,KAAqB,QAApD,EAA8D;AAC1D,YAAM,IAAIE,KAAJ,CAAU,2BAAV,CAAN;AACH;;AACD,SAAKF,SAAL,GAAiBA,SAAjB;AACH;AAED;AACJ;AACA;AACA;;;;;WACI,wBAAe;AACX,aAAO,KAAKA,SAAZ;AACH;AAED;AACJ;AACA;AACA;;;;WACI,oBAAW;AACP,aAAO,KAAKG,YAAL,EAAP;AACH;;;;;AAGL;AACA;AACA;AACA;;;AACO,IAAMR,OAAO,GAAG,IAAII,SAAJ,CAAc,SAAd,CAAhB;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMI;;;;;;;;;;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACI,qBAAQV,KAAR,EAAe;AACX,aAAOC,OAAO,CAACU,GAAR,CAAY,CAAC,KAAKJ,QAAL,CAAcK,OAAd,CAAsBZ,KAAtB,CAAD,EAA+B,KAAKQ,QAAL,CAAcI,OAAd,CAAsBZ,KAAtB,CAA/B,CAAZ,CAAP;AACH;;;;EAVqBM;;AAc1B9B,gEAAiB,CAAC,qBAAD,EAAwBkC,WAAxB,CAAjB;;;;;;;;;;;;;;ACrEa;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMG;;;;;;;;;;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACI,qBAAQb,KAAR,EAAe;AACX,aAAOC,OAAO,CAACC,MAAR,CAAeF,KAAf,CAAP;AACH;;;;EAViBD;;AActBvB,gEAAiB,CAAC,qBAAD,EAAwBqC,OAAxB,CAAjB;;;;;;;;;;;;;;;AC7Da;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMC;;;;;;;;;;;;;;AAEF;AAC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IAAP;AACH;;AAED,SAAO,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,QAAT,CAAkBpB,KAAlB,EAAyB;AACrB,SAAQ,qBAAoBA,KAApB,CAAD,GAA8B,IAA9B,GAAqC,KAA5C;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASqB,SAAT,CAAmBrB,KAAnB,EAA0B;AAEtB,MAAIA,KAAK,KAAK,IAAV,IAAkBA,KAAK,KAAK,KAAhC,EAAuC;AACnC,WAAO,IAAP;AACH;;AAED,SAAO,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASsB,QAAT,CAAkBtB,KAAlB,EAAyB;AACrB,MAAIA,KAAK,KAAK3B,SAAV,IAAuB,OAAO2B,KAAP,KAAiB,QAA5C,EAAsD;AAClD,WAAO,KAAP;AACH;;AACD,SAAO,IAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASuB,QAAT,CAAkBvB,KAAlB,EAAyB;AAErB,MAAIR,OAAO,CAACQ,KAAD,CAAX,EAAoB,OAAO,KAAP;AACpB,MAAIkB,WAAW,CAAClB,KAAD,CAAf,EAAwB,OAAO,KAAP;;AAExB,MAAI,QAAOA,KAAP,MAAiB,QAArB,EAA+B;AAC3B,WAAO,IAAP;AACH;;AAED,SAAO,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASwB,UAAT,CAAoBxB,KAApB,EAA2ByB,QAA3B,EAAqC;AAEjC,MAAI,CAACF,QAAQ,CAACvB,KAAD,CAAb,EAAsB,OAAO,KAAP;AACtB,MAAI,CAAC0B,UAAU,CAACD,QAAD,CAAf,EAA2B,OAAO,KAAP;AAC3B,MAAI,CAACA,QAAQ,CAACxC,cAAT,CAAwB,WAAxB,CAAL,EAA2C,OAAO,KAAP;AAC3C,SAAQe,KAAK,YAAYyB,QAAlB,GAA8B,IAA9B,GAAqC,KAA5C;AAEH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASjC,OAAT,CAAiBQ,KAAjB,EAAwB;AACpB,SAAOT,KAAK,CAACC,OAAN,CAAcQ,KAAd,CAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS0B,UAAT,CAAoB1B,KAApB,EAA2B;AACvB,MAAIR,OAAO,CAACQ,KAAD,CAAX,EAAoB,OAAO,KAAP;AACpB,MAAIkB,WAAW,CAAClB,KAAD,CAAf,EAAwB,OAAO,KAAP;;AAExB,MAAI,OAAOA,KAAP,KAAiB,UAArB,EAAiC;AAC7B,WAAO,IAAP;AACH;;AAED,SAAO,KAAP;AAEH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS2B,SAAT,CAAmB3B,KAAnB,EAA0B;AACtB,SAAO4B,MAAM,CAACD,SAAP,CAAiB3B,KAAjB,CAAP;AACH;;AAGDxB,gEAAiB,CAAC,eAAD,EAAkB0C,WAAlB,EAA+BG,SAA/B,EAA0CC,QAA1C,EAAoDC,QAApD,EAA8D/B,OAA9D,EAAuEkC,UAAvE,EAAmFV,UAAnF,EAA+FW,SAA/F,EAA0GP,QAA1G,CAAjB;;;;;;;;;;;;;;;AC/Za;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMS;;;;;;;;;;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACI,qBAAQ7B,KAAR,EAAe;AACX,UAAIuB,sDAAQ,CAACvB,KAAD,CAAZ,EAAqB;AACjB,eAAOC,OAAO,CAACc,OAAR,CAAgBf,KAAhB,CAAP;AACH;;AAED,aAAOC,OAAO,CAACC,MAAR,CAAeF,KAAf,CAAP;AACH;;;;EAdkBD;;AAkBvBvB,gEAAiB,CAAC,qBAAD,EAAwBqD,QAAxB,CAAjB;;;;;;;;;;;;;;ACtEa;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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;AACA;AACA;AACA;AACA;;IACMM;;;;;;;;;;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACI,qBAAQpC,KAAR,EAAe;AACX,aAAOC,OAAO,CAACc,OAAR,CAAgBf,KAAhB,CAAP;AACH;;;;EAVeD;;AAcpBvB,gEAAiB,CAAC,qBAAD,EAAwB4D,KAAxB,CAAjB;;;;;;;;;;;;;;;;;;;AC7Da;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;;AACO,IAAMM,MAAM,GAAG,GAAf;AAGP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,QAAT,CAAkBC,OAAlB,EAA2BC,QAA3B,EAAqCC,aAArC,EAAoDC,WAApD,EAAiEC,MAAjE,EAAyE;AACrE,SAAOC,aAAa,CAACL,OAAD,EAAUC,QAAV,EAAoBG,MAApB,EAA4B,UAAUE,CAAV,EAAaC,CAAb,EAAgBC,CAAhB,EAAmB;AAC/DD,IAAAA,CAAC,GAAGE,KAAK,CAACH,CAAD,EAAIH,WAAJ,EAAiBI,CAAjB,CAAT;AACAD,IAAAA,CAAC,GAAGG,KAAK,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AAM,CAACC,MAAP,CAAca,IAAd,CAAR;AACA,QAAIlC,CAAC,KAAK7E,SAAV,EAAqB6E,CAAC,GAAG4B,YAAJ;AAErBD,IAAAA,UAAU,GAAGA,UAAU,CAACQ,UAAX,CAAsBF,WAAtB,EAAmCjC,CAAnC,CAAb;AAGH,GAbD;AAeA,SAAO2B,UAAP;AAEH;;AAGDrG,gEAAiB,CAAC,cAAD,EAAiBmE,QAAjB,CAAjB;;;;;;;;;;;;;;;;;;;;;;;AC/aa;AAEb;AACA;AACA;;AAEA;AACA;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAAS2C,gBAAT,CAA0BtF,KAA1B,EAAiC;AAC7B,MAAI,CAACgB,kDAAU,CAAChB,KAAD,CAAf,EAAwB;AACpB,UAAM,IAAIS,SAAJ,CAAc,uBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASuF,iBAAT,CAA2BvF,KAA3B,EAAkC;AAC9B,MAAI,CAACkB,mDAAW,CAAClB,KAAD,CAAhB,EAAyB;AACrB,UAAM,IAAIS,SAAJ,CAAc,0BAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASwF,eAAT,CAAyBxF,KAAzB,EAAgC;AAC5B,MAAI,CAACqB,iDAAS,CAACrB,KAAD,CAAd,EAAuB;AACnB,UAAM,IAAIS,SAAJ,CAAc,wBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASqC,cAAT,CAAwBrC,KAAxB,EAA+B;AAC3B,MAAI,CAACsB,gDAAQ,CAACtB,KAAD,CAAb,EAAsB;AAClB,UAAM,IAAIS,SAAJ,CAAc,uBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASyF,cAAT,CAAwBzF,KAAxB,EAA+B;AAC3B,MAAI,CAACuB,gDAAQ,CAACvB,KAAD,CAAb,EAAsB;AAClB,UAAM,IAAIS,SAAJ,CAAc,uBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS0F,gBAAT,CAA0B1F,KAA1B,EAAiCyB,QAAjC,EAA2C;AACvC,MAAI,CAACD,kDAAU,CAACxB,KAAD,EAAQyB,QAAR,CAAf,EAAkC;AAC9B,QAAIkE,CAAC,GAAG,EAAR;;AACA,QAAIpE,gDAAQ,CAACE,QAAD,CAAR,IAAsBC,kDAAU,CAACD,QAAD,CAApC,EAAgD;AAC5CkE,MAAAA,CAAC,GAAGlE,QAAH,aAAGA,QAAH,uBAAGA,QAAQ,CAAG,MAAH,CAAZ;AACH;;AAED,QAAIkE,CAAJ,EAAO;AACHA,MAAAA,CAAC,GAAG,MAAMA,CAAV;AACH;;AAED,UAAM,IAAIlF,SAAJ,CAAc,gCAAgCkF,CAA9C,CAAN;AACH;;AACD,SAAO3F,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS4F,aAAT,CAAuB5F,KAAvB,EAA8B;AAC1B,MAAI,CAACR,+CAAO,CAACQ,KAAD,CAAZ,EAAqB;AACjB,UAAM,IAAIS,SAAJ,CAAc,uBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS6F,cAAT,CAAwB7F,KAAxB,EAA+B;AAC3B,MAAI,CAACoB,gDAAQ,CAACpB,KAAD,CAAb,EAAsB;AAClB,UAAM,IAAIS,SAAJ,CAAc,wBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS8F,gBAAT,CAA0B9F,KAA1B,EAAiC;AAC7B,MAAI,CAAC0B,kDAAU,CAAC1B,KAAD,CAAf,EAAwB;AACpB,UAAM,IAAIS,SAAJ,CAAc,yBAAd,CAAN;AACH;;AACD,SAAOT,KAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAAS1B,MAAT,CAAgBjG,KAAhB,EAAuB;AACnB,MAAImB,IAAI,GAAI,EAAD,CAAKhC,QAAL,CAAcyE,IAAd,CAAmB5D,KAAnB,EAA0BV,KAA1B,CAAgC,eAAhC,EAAiD,CAAjD,CAAX;;AACA,MAAI,aAAa6B,IAAjB,EAAuB;AACnB,QAAMyG,OAAO,GAAI,2BAAD,CAA8BC,IAA9B,CAAmC7H,KAAK,CAACgH,WAAN,CAAkB7H,QAAlB,EAAnC,CAAhB;AACAgC,IAAAA,IAAI,GAAIyG,OAAO,IAAIA,OAAO,CAAC/H,MAAR,GAAiB,CAA7B,GAAkC+H,OAAO,CAAC,CAAD,CAAzC,GAA+C,EAAtD;AACH;;AACD,SAAOzG,IAAI,CAAC2G,WAAL,EAAP;AACH;;AAEDtJ,gEAAiB,CAAC,eAAD,EAAkByH,MAAlB,CAAjB;;;;;;;;;;;;;;;;;;;AC1Da;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAM1D,SAAS,GAAG,GAAlB;AAEP;AACA;AACA;AACA;;AACO,IAAME,QAAQ,GAAG,GAAjB;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMnB;;;;;AAEF;AACJ;AACA;AACI,mBAAc;AAAA;;AAAA;;AACV;AACA,UAAK4B,IAAL,GAAY,EAAZ;AAFU;AAGb;AAGD;AACJ;AACA;;;;;WACI,mBAAU;AACN,aAAO,KAAKA,IAAL,CAAU9J,MAAV,KAAqB,CAA5B;AACH;AAED;AACJ;AACA;AACA;AACA;;;;WACI,gBAAO;AAAA;;AACH,UAAI,KAAKyJ,OAAL,EAAJ,EAAoB;AAChB,eAAOjL,SAAP;AACH;;AAED,2BAAO,KAAKsL,IAAZ,+CAAO,WAAY,KAAKA,IAAL,CAAU9J,MAAV,GAAmB,CAA/B,CAAP;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,cAAKG,KAAL,EAAY;AACR,WAAK2J,IAAL,CAAUtF,IAAV,CAAerE,KAAf;AACA,aAAO,IAAP;AACH;AAED;AACJ;AACA;AACA;AACA;;;;WACI,iBAAQ;AACJ,WAAK2J,IAAL,GAAY,EAAZ;AACA,aAAO,IAAP;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;;;;WACI,eAAM;AACF,UAAI,KAAKL,OAAL,EAAJ,EAAoB;AAChB,eAAOjL,SAAP;AACH;;AACD,aAAO,KAAKsL,IAAL,CAAUR,GAAV,EAAP;AACH;;;;EAhEerJ;;AAqEpBtB,gEAAiB,CAAC,eAAD,EAAkBuJ,KAAlB,CAAjB;;;;;;;;;;;;;;;ACrGa;AAEb;AACA;AACA;;;;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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,CAAD,EAAO;AACzC,aAAO,IAAI6H,wDAAJ,CAAgB7H,CAAhB,CAAP;AACH,KAFW,CAAZ;AAJc;AASjB;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;WACI,qBAAYhE,IAAZ,EAAkBqE,QAAlB,EAA4B2H,OAA5B,EAAqC;AAEjC,yCAAoB7K,MAAM,CAACmI,OAAP,CAAe,KAAKyC,IAApB,CAApB,qCAA+C;AAA1C;AAAA,YAASE,CAAT;;AACDA,QAAAA,CAAC,CAACC,WAAF,CAAclM,IAAd,EAAoBqE,QAApB,EAA8B2H,OAA9B;AACH;;AAED,aAAO,IAAP;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;;;;WACI,aAAIlL,KAAJ,EAAW;AACP,aAAO,KAAKiL,IAAL,CAAUI,MAAV,CAAiB,UAACC,WAAD,EAAcC,WAAd,EAA2BC,YAA3B,EAAyCxG,KAAzC,EAAmD;AACvE,eAAOuG,WAAW,CAACE,GAAZ,CAAgBH,WAAhB,CAAP;AACH,OAFM,EAEJtL,KAFI,CAAP;AAGH;;;;EA9CcF;;AAiDnBtB,gEAAiB,CAAC,cAAD,EAAiBwM,IAAjB,CAAjB;;;;;;;;;;;;;;;;;;;;AC7Ga;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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G,OAAlD;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMiB,uBAAuB,GAAG3W,MAAM,CAAC,gBAAD,CAAtC;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAM4W,UAAU,GAAG,QAAnB;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,SAAS,GAAG,OAAlB;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,QAAQ,GAAG,MAAjB;AAEA;AACA;AACA;AACA;AACA;;AAEA,IAAMC,YAAY,GAAG,IAArB;AAEA;AACA;AACA;AACA;AACA;;AAEA,IAAMC,eAAe,GAAG,OAAxB;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,eAAe,GAAG,OAAxB;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,aAAa,GAAG,KAAtB;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,cAAc,GAAG,MAAvB;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,cAAc,GAAG,MAAvB;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,eAAe,GAAG,OAAxB;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,mBAAmB,GAAG,WAA5B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,kBAAkB,GAAG,UAA3B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,oBAAoB,GAAG,YAA7B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,cAAc,GAAG,MAAvB;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,cAAc,GAAG,MAAvB;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,cAAc,GAAG,MAAvB;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,kBAAkB,GAAG,UAA3B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,mBAAmB,GAAG,WAA5B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,iBAAiB,GAAG,SAA1B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,gBAAgB,GAAG,QAAzB;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,kBAAkB,GAAG,UAA3B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,YAAY,GAAG,IAArB;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,mBAAmB,GAAG,WAA5B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,mBAAmB,GAAG,WAA5B;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,wBAAwB,GAAG,gBAAjC;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,mBAAmB,GAAG,WAA5B;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,yBAAyB,GAAG,iBAAlC;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,aAAa,GAAG,KAAtB;AAEA;AACA;AACA;AACA;AACA;;AACA,IAAMC,mBAAmB,GAAG,WAA5B;AAGA;AACA;AACA;AACA;AACA;;AACA,IAAMC,sBAAsB,GAAG,cAA/B;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,qBAAqB,GAAG,aAA9B;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,gBAAgB,GAAG,QAAzB;;;;;;;;;;;;;;;;AClYa;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb;AACA;AACA;AACA;;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;;AACA,IAAMG,sBAAsB,GAAG9Y,MAAM,CAAC,kBAAD,CAArC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACM+Y;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACI,2BAAc;AAAA;;AAAA;;AACV;;AAEA,QAAI,OAAO,MAAK,iBAAL,CAAP,KAAmC,UAAvC,EAAmD;AAC/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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACM4Y;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACA;AACI,2BAAc;AAAA;;AAAA;;AACV;AACA,UAAK7Y,yDAAL,IAAuB,IAAI2Q,kEAAJ,CAAkB;AAAC,iBAAW9D,uDAAM,CAAC,EAAD,EAAK,MAAK6N,QAAV;AAAlB,KAAlB,CAAvB;AACA,UAAK5B,uBAAL,IAAgC,EAAhC;AACA6B,IAAAA,kBAAkB,CAAC/U,IAAnB;;AACA,UAAK4U,gBAAL;;AALU;AAMb;AAED;AACJ;AACA;AACA;AACA;AACA;;;;;;AAKI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACI,mBAAe;AACX,aAAO;AACH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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASye,gBAAT,GAA4B;AACxB,MAAI3X,QAAQ,GAAGc,iEAAe,CAAC,UAAD,CAA9B;AACA,MAAIxI,IAAI,GAAGwU,wDAAX;AAEA,MAAIvB,OAAO,GAAGvL,QAAQ,CAACgV,aAAT,CAAuB,MAAvB,CAAd;;AACA,MAAIzJ,OAAO,YAAYI,WAAvB,EAAoC;AAChC,QAAIsM,KAAK,GAAG1M,OAAO,CAACc,YAAR,CAAqBc,+DAArB,CAAZ;;AACA,QAAI8K,KAAJ,EAAW;AACP3f,MAAAA,IAAI,GAAG2f,KAAP;AACH;AACJ;;AAED,SAAO,IAAIK,KAAJ,CAAUhgB,IAAV,CAAP;AAEH;;AAEDV,gEAAiB,CAAC,aAAD,EAAgB0gB,KAAhB,EAAuBX,gBAAvB,CAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnGa;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMhG;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACI,mBAAYpG,OAAZ,EAAqBvP,OAArB,EAA8B;AAAA;;AAAA;;AAC1B;AAEA;AACR;AACA;;AACQ,QAAIA,OAAO,KAAKvE,SAAhB,EAA2BuE,OAAO,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AAIzY,QAAQ,iBAAGZ,2DAAS,EAAZ,+CAAG,WAAc,UAAd,CAAf;;AACA,MAAI,QAAOY,QAAP,MAAoB,QAAxB,EAAkC;AAC9B,UAAM,IAAItI,KAAJ,CAAU,2BAAV,CAAN;AACH;;AAED,SAAOsI,QAAP;AACH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAAS+c,SAAT,GAAqB;AAAA;;AACjB,MAAIhd,MAAM,kBAAGX,2DAAS,EAAZ,gDAAG,YAAc,QAAd,CAAb;;AACA,MAAI,QAAOW,MAAP,MAAkB,QAAtB,EAAgC;AAC5B,UAAM,IAAIrI,KAAJ,CAAU,2BAAV,CAAN;AACH;;AAED,SAAOqI,MAAP;AACH;AAGD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASid,6BAAT,CAAuCzH,IAAvC,EAA6C;AACzC9Z,EAAAA,kEAAc,CAAC8Z,IAAD,CAAd;AAEA,MAAMvV,QAAQ,GAAGyY,WAAW,EAA5B;AACA,MAAMrD,QAAQ,GAAGpV,QAAQ,CAACgW,aAAT,CAAuB,UAAvB,CAAjB;AACAZ,EAAAA,QAAQ,CAACI,SAAT,GAAqBD,IAArB;AAEA,SAAOH,QAAQ,CAACD,OAAhB;AAC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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMF;;;;;AAEF;AACJ;AACA;AACA;AACI,2BAAYrM,OAAZ,EAAqB;AAAA;;AAAA;;AACjB;;AAEA,QAAIA,OAAO,KAAKjb,SAAhB,EAA2B;AACvBib,MAAAA,OAAO,GAAG,EAAV;AACH;;AAED,UAAKtb,yDAAL,IAAuB6M,uDAAM,CAAC,EAAD,EAAK,MAAK6N,QAAV,EAAoBjT,4DAAc,CAAC6T,OAAD,CAAlC,CAA7B;AAPiB;AASpB;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;SACI,eAAe;AACX,aAAO,EAAP;AACH;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;;;WACI,mBAAUlU,IAAV,EAAgBN,YAAhB,EAA8B;AAC1B,UAAI9E,KAAJ;;AAEA,UAAI;AACAA,QAAAA,KAAK,GAAG,IAAIwC,2DAAJ,CAAe,KAAKxE,yDAAL,CAAf,EAAqCuG,MAArC,CAA4Ca,IAA5C,CAAR;AACH,OAFD,CAEE,OAAO1F,CAAP,EAAU,CAEX;;AAED,UAAIM,KAAK,KAAK3B,SAAd,EAAyB,OAAOyG,YAAP;AACzB,aAAO9E,KAAP;AACH;;;;EAxDyBF;;AA6D9BtB,gEAAiB,CAAC,eAAD,EAAkBmnB,eAAlB,CAAjB;;;;;;;;;;;;;;;;;ACpHa;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AAb,CAAiBjB,kEAAc,CAACyB,GAAD,CAA/B,EAAsCyiB,IAAtC;AACA,eAAO,IAAP;AACH;;AAED,YAAM,IAAI9lB,SAAJ,CAAc,iCAAd,CAAN;AAEH;AAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;WACI,4BAAmB+lB,YAAnB,EAAiC;AAC7B/gB,MAAAA,kEAAc,CAAC+gB,YAAD,CAAd;;AAEA,yCAAqBnmB,MAAM,CAACmI,OAAP,CAAege,YAAf,CAArB,qCAAmD;AAA9C;AAAA,YAAOrjB,CAAP;AAAA,YAAUD,CAAV;;AACD,aAAKujB,OAAL,CAAatjB,CAAb,EAAgBD,CAAhB;AACH;;AAED,aAAO,IAAP;AAEH;;;;EAxJsBpD;;AA4J3BtB,gEAAiB,CAAC,cAAD,EAAiBonB,YAAjB,CAAjB;;;;;;;;;;;;;;;;;;;;;;ACzNa;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMe;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACI,iBAAYC,GAAZ,EAAiBtN,OAAjB,EAA0B;AAAA;;AAAA;;AACtB,8BAAMA,OAAN;;AAEA,QAAI9X,wDAAU,CAAColB,GAAD,EAAMC,GAAN,CAAd,EAA0B;AACtBD,MAAAA,GAAG,GAAGA,GAAG,CAACznB,QAAJ,EAAN;AACH;;AAED,QAAIma,OAAO,KAAKjb,SAAhB,EAA2B;AACvBib,MAAAA,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AyByD,kBAAzB,CAA4C9d,IAA5C,CAAP;AACH,OAHE,CAAP;AAKH;;;;EAvFekc;;AA6FpBrnB,gEAAiB,CAAC,wBAAD,EAA2BmoB,KAA3B,CAAjB;;;;;;;;;;;;;;;;;;;ACjJa;AAEb;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;;AACA,IAAMe,oBAAoB,GAAGzpB,MAAM,CAAC,gBAAD,CAAnC;AAEA;AACA;AACA;AACA;;AACA,IAAM0pB,cAAc,GAAG1pB,MAAM,CAAC,UAAD,CAA7B;AAEA;AACA;AACA;AACA;;AACA,IAAM2pB,qBAAqB,GAAG3pB,MAAM,CAAC,iBAAD,CAApC;AAEA;AACA;AACA;AACA;;AACA,IAAM4pB,sBAAsB,GAAG5pB,MAAM,CAAC,kBAAD,CAArC;AAEA;AACA;AACA;AACA;;AACA,IAAM6pB,iBAAiB,GAAG7pB,MAAM,CAAC,aAAD,CAAhC;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACMyoB;;;;;AAEF;AACJ;AACA;AACA;AACA;AACA;AACI,qBAAY1e,MAAZ,EAAoBsR,OAApB,EAA6B;AAAA;;AAAA;;AACzB,8BAAMA,OAAN;AACA,UAAKoO,oBAAL,IAA6B1f,MAAM,IAAI,EAAvC;AACA,UAAK4f,qBA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;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,IAAII,QAAJ;;AACA,IAAI;AACAA,EAAAA,QAAQ,GAAG3uB,yEAAA,CAA8B,qBAA9B,CAAX;AACH,CAFD,CAEE,OAAO2B,CAAP,EAAU,CAEX;;AAED,IAAI,CAACgtB,QAAL,EAAeA,QAAQ,GAAG,SAAX;AAEf3uB,mEAAA,GAA0B2uB,QAA1B,IAAsC3uB,mDAAtC","sources":["webpack:///webpack/universalModuleDefinition","webpack:///../../../../packages/monster/source/constants.js","webpack:///../../../../packages/monster/source/namespace.js","webpack:///../../../../packages/monster/source/constraints/abstract.js","webpack:///../../../../packages/monster/source/types/base.js","webpack:///../../../../packages/monster/source/constraints/abstractoperator.js","webpack:///../../../../packages/monster/source/constraints/andoperator.js","webpack:///../../../../packages/monster/source/constraints/invalid.js","webpack:///../../../../packages/monster/source/constraints/isarray.js","webpack:///../../../../packages/monster/source/types/is.js","webpack:///../../../../packages/monster/source/constraints/isobject.js","webpack:///../../../../packages/monster/source/constraints/oroperator.js","webpack:///../../../../packages/monster/source/constraints/valid.js","webpack:///../../../../packages/monster/source/data/buildmap.js","webpack:///../../../../packages/monster/source/types/validate.js","webpack:///../../../../packages/monster/source/util/clone.js","webpack:///../../../../packages/monster/source/types/global.js","webpack:///../../../../packages/monster/source/types/typeof.js","webpack:///../../../../packages/monster/source/data/pathfinder.js","webpack:///../../../../packages/monster/source/types/stack.js","webpack:///../../../../packages/monster/source/data/diff.js","webpack:///../../../../packages/monster/source/data/extend.js","webpack:///../../../../packages/monster/source/data/pipe.js","webpack:///../../../../packages/monster/source/data/transformer.js","webpack:///../../../../packages/monster/source/types/id.js","webpack:///../../../../packages/monster/source/dom/assembler.js","webpack:///../../../../packages/monster/source/types/proxyobserver.js","webpack:///../../../../packages/monster/source/types/observer.js","webpack:///../../../../packages/monster/source/types/tokenlist.js","webpack:///../../../../packages/monster/source/types/uniquequeue.js","webpack:///../../../../packages/monster/source/types/queue.js","webpack:///../../../../packages/monster/source/types/observerlist.js","webpack:///../../../../packages/monster/source/dom/attributes.js","webpack:///../../../../packages/monster/source/dom/constants.js","webpack:///../../../../packages/monster/source/dom/customcontrol.js","webpack:///../../../../packages/monster/source/dom/customelement.js","webpack:///../../../../packages/monster/source/types/dataurl.js","webpack:///../../../../packages/monster/source/types/mediatype.js","webpack:///../../../../packages/monster/source/dom/template.js","webpack:///../../../../packages/monster/source/dom/theme.js","webpack:///../../../../packages/monster/source/dom/updater.js","webpack:///../../../../packages/monster/source/util/trimspaces.js","webpack:///../../../../packages/monster/source/dom/events.js","webpack:///../../../../packages/monster/source/dom/util.js","webpack:///../../../../packages/monster/source/dom/locale.js","webpack:///../../../../packages/monster/source/i18n/locale.js","webpack:///../../../../packages/monster/source/i18n/provider.js","webpack:///../../../../packages/monster/source/types/basewithoptions.js","webpack:///../../../../packages/monster/source/i18n/translations.js","webpack:///../../../../packages/monster/source/i18n/providers/fetch.js","webpack:///../../../../packages/monster/source/text/formatter.js","webpack:///../../../../packages/monster/source/logging/handler.js","webpack:///../../../../packages/monster/source/logging/logentry.js","webpack:///../../../../packages/monster/source/logging/logger.js","webpack:///../../../../packages/monster/source/logging/handler/console.js","webpack:///../../../../packages/monster/source/math/random.js","webpack:///../../../../packages/monster/source/types/randomid.js","webpack:///../../../../packages/monster/source/types/version.js","webpack:///../../../../packages/monster/source/util/comparator.js","webpack:///../../../../packages/monster/source/util/freeze.js","webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///../../../../packages/monster/source/monster.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"window\"] = factory();\n\telse\n\t\troot[\"window\"] = factory();\n})(self, function() {\nreturn ","'use strict';\n\nimport {Monster} from './namespace.js';\n/**\n * Property-Keys\n * @author schukai GmbH\n */\n\n/**\n * @private\n * @type {symbol}\n * @memberOf Monster\n * @since 1.24.0\n */\nconst internalSymbol = Symbol('internalData');\n\n/**\n * @private\n * @type {symbol}\n * @memberOf Monster\n * @since 1.25.0\n */\nconst internalStateSymbol = Symbol('state');\n\n\nexport {\n    Monster,\n    internalSymbol,\n    internalStateSymbol\n}\n\n","'use strict';\n\n\n/**\n * Main namespace for Monster.\n *\n * @namespace Monster\n * @author schukai GmbH\n */\n\n\n/**\n * namespace class objects form the basic framework of the namespace administration.\n *\n * all functions, classes and objects of the library hang within the namespace tree.\n *\n * via `obj instanceof Monster.Namespace` it is also easy to check whether it is an object or a namespace.\n *\n * @memberOf Monster\n * @copyright schukai GmbH\n * @since 1.0.0\n */\nclass Namespace {\n\n    /**\n     *\n     * @param namespace\n     * @param obj\n     */\n    constructor(namespace) {\n        if (namespace === undefined || typeof namespace !== 'string') {\n            throw new Error(\"namespace is not a string\")\n        }\n        this.namespace = namespace;\n    }\n\n    /**\n     *\n     * @returns {string}\n     */\n    getNamespace() {\n        return this.namespace;\n    }\n\n    /**\n     *\n     * @returns {string}\n     */\n    toString() {\n        return this.getNamespace();\n    }\n}\n\n/**\n * @type {Namespace}\n * @global\n */\nexport const Monster = new Namespace(\"Monster\");\n\n/**\n * To expand monster, the `Monster.assignToNamespace()` method can be used.\n *\n * you must call the method in the monster namespace. this allows you to mount your own classes, objects and functions into the namespace.\n *\n * To avoid confusion and so that you do not accidentally overwrite existing functions, you should use the custom namespace `X`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * function hello() {\n *            console.log('Hello World!');\n *        }\n * Monster.assignToNamespace(\"Monster.X\", hello)\n * Monster.X.hello(); // ↦ Hello World!\n * </script>\n *\n * ```\n *\n * @param {string} ns\n * @param {function} obj\n * @return {current}\n * @memberOf Monster\n * @throws {Error} no functions have been passed.\n * @throws {Error} the name of the class or function cannot be resolved.\n * @throws {Error} the first argument is not a function or class.\n * @throws {Error} exception\n * @since 1.0.0\n */\nfunction assignToNamespace(ns, ...obj) {\n    let current = namespaceFor(ns.split(\".\"));\n\n    if (obj.length === 0) {\n        throw new Error('no functions have been passed.');\n    }\n\n    for (let i = 0, l = obj.length; i < l; i++) {\n        current[objectName(obj[i])] = obj[i];\n    }\n\n    return current\n}\n\n/**\n *\n * @param {class|function|object} obj\n * @returns {string}\n * @private\n * @throws {Error} the name of the class or function cannot be resolved.\n * @throws {Error} the first argument is not a function or class.\n * @throws {Error} exception\n */\nfunction objectName(obj) {\n    try {\n\n        if (typeof obj !== 'function') {\n            throw  new Error(\"the first argument is not a function or class.\");\n        }\n\n        if (obj.hasOwnProperty('name')) {\n            return obj.name;\n        }\n\n        if (\"function\" === typeof obj.toString) {\n            let s = obj.toString();\n            let f = s.match(/^\\s*function\\s+([^\\s(]+)/);\n            if (Array.isArray(f) && typeof f[1] === 'string') {\n                return f[1];\n            }\n            let c = s.match(/^\\s*class\\s+([^\\s(]+)/);\n            if (Array.isArray(c) && typeof c[1] === 'string') {\n                return c[1];\n            }\n        }\n\n    } catch (e) {\n        throw new Error(\"exception \" + e);\n    }\n\n    throw new Error(\"the name of the class or function cannot be resolved.\");\n}\n\n/**\n *\n * @param parts\n * @returns {Namespace}\n * @private\n */\nfunction namespaceFor(parts) {\n    let space = Monster, ns = 'Monster';\n\n    for (let i = 0; i < parts.length; i++) {\n\n        if (\"Monster\" === parts[i]) {\n            continue;\n        }\n\n        ns += '.' + parts[i];\n\n        if (!space.hasOwnProperty(parts[i])) {\n            space[parts[i]] = new Namespace(ns);\n        }\n\n        space = space[parts[i]];\n    }\n\n    return space;\n}\n\n\nassignToNamespace('Monster', assignToNamespace, Namespace);\nexport {assignToNamespace}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\n\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n *\n * The uniform API of the constraints allows chains to be formed.\n * \n * The abstract constraint defines the api for all constraints. mainly the method isValid() is defined.\n *\n * derived classes must implement the method isValid().\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary The abstract constraint\n */\nclass AbstractConstraint extends Base {\n\n    /**\n     *\n     */\n    constructor() {\n        super();\n    }\n\n    /**\n     * this method must return a promise containing the result of the check.\n     *\n     * @param {*} value\n     * @returns {Promise}\n     */\n    isValid(value) {\n        return Promise.reject(value);\n    }\n}\n\nassignToNamespace('Monster.Constraints', AbstractConstraint);\nexport {Monster, AbstractConstraint}","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\n\n/**\n * This is the base class from which all monster classes are derived.\n *\n * You can call the method via the monster namespace `new Monster.Types.Base()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.Base()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Base} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/base.js';\n * new Base()\n * </script>\n * ```\n *\n * The class was formerly called Object.\n *\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass Base extends Object {\n\n    /**\n     *\n     * @returns {string}\n     */\n    toString() {\n        return JSON.stringify(this);\n    };\n\n\n}\n\nassignToNamespace('Monster.Types', Base);\nexport {Monster, Base}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {AbstractConstraint} from \"./abstract.js\";\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n *\n * The uniform API of the constraints allows chains to be formed.\n *\n * Operators allow you to link constraints together. for example, you can check whether a value is an object or an array. each operator has two operands that are linked together.\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary The abstract operator constraint\n */\nclass AbstractOperator extends AbstractConstraint {\n\n    /**\n     *\n     * @param {AbstractConstraint} operantA\n     * @param {AbstractConstraint} operantB\n     * @throws {TypeError} \"parameters must be from type AbstractConstraint\"\n     */\n    constructor(operantA, operantB) {\n        super();\n\n        if (!(operantA instanceof AbstractConstraint) || !(operantB instanceof AbstractConstraint)) {\n            throw new TypeError(\"parameters must be from type AbstractConstraint\")\n        }\n\n        this.operantA = operantA;\n        this.operantB = operantB;\n\n    }\n\n\n}\n\nassignToNamespace('Monster.Constraints', AbstractOperator);\nexport {Monster, AbstractOperator}","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {AbstractOperator} from \"./abstractoperator.js\";\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n *\n * The uniform API of the constraints allows chains to be formed.\n *\n * The AndOperator is used to link several contraints. The constraint is fulfilled if all constraints of the operators are fulfilled.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Constraint.AndOperator();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/andoperator.js';\n * new AndOperator();\n * </script>\n * ```\n *\n * @example\n *\n * import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/valid.js';\n * import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/invalid.js';\n * import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/andoperator.js';\n *\n * new AndOperator(\n * new Valid(), new Valid()).isValid()\n * .then(()=>console.log(true))\n * .catch(()=>console.log(false));\n * // ↦ true\n *\n * new AndOperator(\n * new Invalid(), new Valid()).isValid()\n * .then(()=>console.log(true))\n * .catch(()=>console.log(false));\n * // ↦ false\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary A and operator constraint\n */\nclass AndOperator extends AbstractOperator {\n\n    /**\n     * this method return a promise containing the result of the check.\n     *\n     * @param {*} value\n     * @returns {Promise}\n     */\n    isValid(value) {\n        return Promise.all([this.operantA.isValid(value), this.operantB.isValid(value)]);\n    }\n\n}\n\nassignToNamespace('Monster.Constraints', AndOperator);\nexport {Monster, AndOperator}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {AbstractConstraint} from \"./abstract.js\";\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n *\n * The uniform API of the constraints allows chains to be formed.\n *\n * The invalid constraint allows an always invalid query to be performed. this constraint is mainly intended for testing.\n *\n * You can call the method via the monster namespace `new Monster.Constraint.Invalid()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Constraint.Invalid();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/invalid.js';\n * new Invalid();\n * </script>\n * ```\n *\n * @example\n *\n * import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/invalid.js';\n *\n * new Invalid().isValid()\n * .then(()=>console.log(true))\n * .catch(()=>console.log(false));\n * // ↦ false\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary A constraint that always invalid\n */\nclass Invalid extends AbstractConstraint {\n\n    /**\n     * this method return a rejected promise\n     *\n     * @param {*} value\n     * @returns {Promise}\n     */\n    isValid(value) {\n        return Promise.reject(value);\n    }\n\n}\n\nassignToNamespace('Monster.Constraints', Invalid);\nexport {Monster, Invalid}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {isArray} from \"../types/is.js\";\nimport {AbstractConstraint} from \"./abstract.js\";\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n * \n * The uniform API of the constraints allows chains to be formed.\n * \n * You can call the method via the monster namespace `new Monster.Constraint.IsObject()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Constraint.IsArray()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/isarray.js';\n * console.log(new IsArray())\n * </script>\n * ```\n *\n * @example\n *\n * import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/isarray.js';\n *\n * new IsArray()\n * .isValid([])\n * .then(()=>console.log(true));\n * // ↦ true\n *\n * new IsArray()\n * .isValid(99)\n * .catch(e=>console.log(e));\n * // ↦ 99\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary A constraint to check if a value is an array\n */\nclass IsArray extends AbstractConstraint {\n\n    /**\n     * this method return a promise containing the result of the check.\n     *\n     * @param {*} value\n     * @returns {Promise}\n     */\n    isValid(value) {\n        if (isArray(value)) {\n            return Promise.resolve(value);\n        }\n\n        return Promise.reject(value);\n    }\n\n}\n\nassignToNamespace('Monster.Constraints', IsArray);\nexport {Monster, IsArray}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\n\n/**\n * With this function you can check if a value is iterable.\n * \n * This method is used in the library to have consistent names.\n *\n * You can call the method via the monster namespace `Monster.Types.isPrimitive()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isIterable(null) // ↦ false\n * Monster.Types.isIterable('hello') // ↦ true\n * Monster.Types.isIterable([]) // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isIterable} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isIterable(null)  // ↦ false\n * isIterable('hello')  // ↦ true\n * isIterable([])  // ↦ true\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.2.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isIterable(value) {\n    if (value === undefined) return false;\n    if (value === null) return false;\n    return typeof value?.[Symbol.iterator] === 'function';\n}\n\n\n/**\n * Checks whether the value passed is a primitive (string, number, boolean, NaN, undefined, null or symbol)\n * \n * This method is used in the library to have consistent names.\n *\n * You can call the method via the monster namespace `Monster.Types.isPrimitive()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isPrimitive('2') // ↦ false\n * Monster.Types.isPrimitive([]) // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isPrimitive} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isPrimitive('2'))  // ↦ true\n * isPrimitive([]))  // ↦ false\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isPrimitive(value) {\n    var type;\n\n    if (value === undefined || value === null) {\n        return true;\n    }\n\n    type = typeof value;\n\n    if (type === 'string' || type === 'number' || type === 'boolean' || type === 'symbol') {\n        return true;\n    }\n\n    return false;\n}\n\n/**\n * Checks whether the value passed is a symbol\n * \n * This method is used in the library to have consistent names.\n *\n * You can call the method via the monster namespace `Monster.Types.isSymbol()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isSymbol('2') // ↦ false\n * Monster.Types.isSymbol(Symbol('test') // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isSymbol} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isSymbol(Symbol('a')))  // ↦ true\n * isSymbol([])  // ↦ false\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isSymbol(value) {\n    return ('symbol' === typeof value) ? true : false;\n}\n\n/**\n * Checks whether the value passed is a boolean.\n * \n * This method is used in the library to have consistent names.\n *\n * You can call the method via the monster namespace `Monster.Types.isBoolean()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isBoolean('2') // ↦ false\n * Monster.Types.isBoolean([]) // ↦ false\n * Monster.Types.isBoolean(true) // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isBoolean} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isBoolean('2'))  // ↦ false\n * isBoolean([]))  // ↦ false\n * isBoolean(2>4))  // ↦ true\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isBoolean(value) {\n\n    if (value === true || value === false) {\n        return true;\n    }\n\n    return false;\n}\n\n/**\n * Checks whether the value passed is a string\n * \n * This method is used in the library to have consistent names.\n *\n * You can call the method via the monster namespace `Monster.Types.isString()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isString('2') // ↦ true\n * Monster.Types.isString([]) // ↦ false\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isString('2'))  // ↦ true\n * isString([]))  // ↦ false\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isString(value) {\n    if (value === undefined || typeof value !== 'string') {\n        return false;\n    }\n    return true;\n}\n\n/**\n * Checks whether the value passed is a object\n * \n * This method is used in the library to have consistent names.\n *\n * You can call the method via the monster namespace `Monster.Types.isObject()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isObject('2') // ↦ false\n * Monster.Types.isObject([]) // ↦ false\n * Monster.Types.isObject({}) // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isObject('2'))  // ↦ false\n * isObject([]))  // ↦ false\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isObject(value) {\n\n    if (isArray(value)) return false;\n    if (isPrimitive(value)) return false;\n\n    if (typeof value === 'object') {\n        return true;\n    }\n\n    return false;\n}\n\n/**\n * Checks whether the value passed is a object and instance of instance.\n * \n * This method is used in the library to have consistent names.\n *\n * you can call the method via the monster namespace `Monster.Types.isInstance()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isInstance('2') // ↦ false\n * Monster.Types.isInstance([]) // ↦ false\n * Monster.Types.isInstance({}) // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isInstance} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isInstance('2'))  // ↦ false\n * isInstance([]))  // ↦ false\n * </script>\n * ```\n *\n * @param {*} value\n * @param {*} instance\n * @returns {boolean}\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isInstance(value, instance) {\n\n    if (!isObject(value)) return false;\n    if (!isFunction(instance)) return false;\n    if (!instance.hasOwnProperty('prototype')) return false;\n    return (value instanceof instance) ? true : false;\n\n}\n\n/**\n * Checks whether the value passed is a array\n * \n * This method is used in the library to have consistent names. \n *\n * you can call the method via the monster namespace `Monster.Types.isArray()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isArray('2') // ↦ false\n * Monster.Types.isArray([]) // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isArray('2'))  // ↦ false\n * isArray([]))  // ↦ true\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @see https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray\n */\nfunction isArray(value) {\n    return Array.isArray(value);\n}\n\n/**\n * Checks whether the value passed is a function\n * \n * This method is used in the library to have consistent names. \n *\n * you can call the method via the monster namespace `Monster.Types.isFunction()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isFunction(()=>{}) // ↦ true\n * Monster.Types.isFunction('2') // ↦ false\n * Monster.Types.isFunction([]) // ↦ false\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isFunction(()=>{}) // ↦ true\n * isFunction('2'))  // ↦ false\n * isFunction([]))  // ↦ false\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isFunction(value) {\n    if (isArray(value)) return false;\n    if (isPrimitive(value)) return false;\n\n    if (typeof value === 'function') {\n        return true;\n    }\n\n    return false;\n\n}\n\n/**\n * Checks whether the value passed is an integer.\n * \n * This method is used in the library to have consistent names. \n *\n * You can call the method via the monster namespace `Monster.Types.isFunction()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.isInteger(()=>{}) // ↦ true\n * Monster.Types.isInteger('2') // ↦ false\n * Monster.Types.isInteger(2) // ↦ true\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {isInteger} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n * isInteger(()=>{}) // ↦ true\n * isInteger('2'))  // ↦ false\n * isInteger(2))  // ↦ true\n * </script>\n * ```\n *\n * @param {*} value\n * @returns {boolean}\n * @since 1.4.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nfunction isInteger(value) {\n    return Number.isInteger(value);\n}\n\n\nassignToNamespace('Monster.Types', isPrimitive, isBoolean, isString, isObject, isArray, isFunction, isIterable, isInteger, isSymbol);\nexport {\n    Monster,\n    isPrimitive,\n    isBoolean,\n    isString,\n    isObject,\n    isInstance,\n    isArray,\n    isFunction,\n    isIterable,\n    isInteger,\n    isSymbol\n}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {isObject} from \"../types/is.js\";\nimport {AbstractConstraint} from \"./abstract.js\";\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n *\n * The uniform API of the constraints allows chains to be formed.\n *\n * You can call the method via the monster namespace `new Monster.Constraint.IsObject()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Constraint.IsObject())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/isobject.js';\n * console.log(new IsObject())\n * </script>\n * ```\n *\n * @example\n *\n * import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/isobject.js';\n *\n * new IsObject()\n * .isValid({})\n * .then(()=>console.log(true));\n * // ↦ true\n *\n *\n * new IsObject()\n * .isValid(99)\n * .catch(e=>console.log(e));\n * // ↦ 99\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary A constraint to check if a value is an object\n */\nclass IsObject extends AbstractConstraint {\n\n    /**\n     * this method return a promise containing the result of the check.\n     *\n     * @param {*} value\n     * @returns {Promise}\n     */\n    isValid(value) {\n        if (isObject(value)) {\n            return Promise.resolve(value);\n        }\n\n        return Promise.reject(value);\n    }\n\n}\n\nassignToNamespace('Monster.Constraints', IsObject);\nexport {Monster, IsObject}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {AbstractOperator} from \"./abstractoperator.js\";\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n *\n * The uniform API of the constraints allows chains to be formed.\n *\n * The OrOperator is used to link several constraints. The constraint is fulfilled if one of the constraints is fulfilled.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Constraint.OrOperator();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraint/oroperator.js';\n * new OrOperator();\n * </script>\n * ```\n *\n * @example\n *\n * import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/valid.js';\n * import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/invalid.js';\n * import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/oroperator.js';\n *\n * new OrOperator(\n * new Valid(), new Invalid()).isValid()\n * .then(()=>console.log(true))\n * .catch(()=>console.log(false));\n * // ↦ true\n *\n * new OrOperator(\n * new Invalid(), new Invalid()).isValid()\n * .then(()=>console.log(true))\n * .catch(()=>console.log(false));\n * // ↦ false\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary A or operator \n */\nclass OrOperator extends AbstractOperator {\n\n    /**\n     * this method return a promise containing the result of the check.\n     *\n     * @param {*} value\n     * @returns {Promise}\n     */\n    isValid(value) {\n        var self = this;\n\n        return new Promise(function (resolve, reject) {\n            let a, b;\n\n            self.operantA.isValid(value)\n                .then(function () {\n                    resolve();\n                }).catch(function () {\n                a = false;\n                /** b has already been evaluated and was not true */\n                if (b === false) {\n                    reject();\n                }\n            });\n\n            self.operantB.isValid(value)\n                .then(function () {\n                    resolve();\n                }).catch(function () {\n                b = false;\n                /** b has already been evaluated and was not true */\n                if (a === false) {\n                    reject();\n                }\n            });\n        });\n    }\n\n\n}\n\nassignToNamespace('Monster.Constraints', OrOperator);\nexport {Monster, OrOperator}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {AbstractConstraint} from \"./abstract.js\";\n\n/**\n * Constraints are used to define conditions that must be met by the value of a variable.\n *\n * The uniform API of the constraints allows chains to be formed.\n *\n * The valid constraint allows an always valid query to be performed. this constraint is mainly intended for testing.\n *\n * You can call the method via the monster namespace `new Monster.Constraint.Valid()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Constraint.Valid();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/valid.js';\n * new Valid();\n * </script>\n * ```\n *\n * @example\n *\n * import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/constraints/valid.js';\n *\n * new Valid().isValid()\n * .then(()=>console.log(true))\n * .catch(()=>console.log(false));\n * // ↦ true\n *\n * @since 1.3.0\n * @copyright schukai GmbH\n * @memberOf Monster.Constraints\n * @summary A constraint that always valid\n */\nclass Valid extends AbstractConstraint {\n\n    /**\n     * this method return a promise containing the result of the check.\n     *\n     * @param {*} value\n     * @returns {Promise}\n     */\n    isValid(value) {\n        return Promise.resolve(value);\n    }\n\n}\n\nassignToNamespace('Monster.Constraints', Valid);\nexport {Monster, Valid}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {isFunction, isObject, isString} from \"../types/is.js\";\nimport {validateString} from \"../types/validate.js\";\nimport {clone} from \"../util/clone.js\";\nimport {DELIMITER, Pathfinder, WILDCARD} from \"./pathfinder.js\";\n\n\n/**\n * @type {string} parent symbol\n */\nexport const PARENT = '^';\n\n\n/**\n * With the help of the function `buildMap()`, maps can be easily created from data objects.\n *\n * Either a simple definition `a.b.c` or a template `${a.b.c}` can be specified as the path.\n * Key and value can be either a definition or a template. The key does not have to be defined.\n *\n * You can call the method via the monster namespace `Monster.Data.buildMap()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Data.buildMap())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/buildmap.js';\n * console.log(buildMap())\n * </script>\n * ```\n *\n * The templates determine the appearance of the keys and the value of the map. Either a single value `id` can be taken or a composite key `${id} ${name}` can be used.\n *\n * If you want to access values of the parent data set, you have to use the `^` character `${id} ${^.name}`.\n *\n * @example\n *\n * import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/buildmap.js';\n * // a typical data structure as reported by an api\n *\n * let map;\n * let obj = {\n *     \"data\": [\n *         {\n *             \"id\": 10,\n *             \"name\": \"Cassandra\",\n *             \"address\": {\n *                 \"street\": \"493-4105 Vulputate Street\",\n *                 \"city\": \"Saumur\",\n *                 \"zip\": \"52628\"\n *             }\n *         },\n *         {\n *             \"id\": 20,\n *             \"name\": \"Holly\",\n *             \"address\": {\n *                 \"street\": \"1762 Eget Rd.\",\n *                 \"city\": \"Schwalbach\",\n *                 \"zip\": \"952340\"\n *             }\n *         },\n *         {\n *             \"id\": 30,\n *             \"name\": \"Guy\",\n *             \"address\": {\n *                 \"street\": \"957-388 Sollicitudin Avenue\",\n *                 \"city\": \"Panchià\",\n *                 \"zip\": \"420729\"\n *             }\n *         }\n *     ]\n * };\n *\n * // The function is passed this data structure and with the help of the selector `'data.*'` the data to be considered are selected.\n * // The key is given by a simple definition `'id'` and the value is given by a template `'${name} (${address.zip} ${address.city})'`.\n * map = buildMap(obj, 'data.*', '${name} (${address.zip} ${address.city})', 'id');\n * console.log(map);\n *\n * // ↦ Map(3) {\n * //  '10' => 'Cassandra (52628 Saumur)',\n * //  '20' => 'Holly (952340 Schwalbach)',\n * //  '30' => 'Guy (420729 Panchià)'\n * // }\n *\n * // If no key is specified, the key from the selection, here the array index, is taken.\n * map = buildMap(obj, 'data.*', '${name} (${address.zip} ${address.city})');\n * console.log(map);\n *\n * // ↦ Map(3) {\n * //  '0' => 'Cassandra (52628 Saumur)',\n * //  '1' => 'Holly (952340 Schwalbach)',\n * //  '2' => 'Guy (420729 Panchià)'\n * // }\n *\n * // a filter (function(value, key) {}) can be specified to accept only defined entries.\n * map = buildMap(obj, 'data.*', '${name} (${address.zip} ${address.city})', 'id', function (value, key) {\n *                return (value['id'] >= 20) ? true : false\n *            });\n * console.log(map);\n *\n * // ↦ Map(2) {\n * //  20 => 'Holly (952340 Schwalbach)',\n * //  30 => 'Guy (420729 Panchià)'\n * // }\n *\n * @param {*} subject\n * @param {string|Monster.Data~exampleSelectorCallback} selector\n * @param {string} [valueTemplate]\n * @param {string} [keyTemplate]\n * @param {Monster.Data~exampleFilterCallback} [filter]\n * @return {*}\n * @memberOf Monster.Data\n * @throws {TypeError} value is neither a string nor a function\n * @throws {TypeError} the selector callback must return a map\n */\nfunction buildMap(subject, selector, valueTemplate, keyTemplate, filter) {\n    return assembleParts(subject, selector, filter, function (v, k, m) {\n        k = build(v, keyTemplate, k);\n        v = build(v, valueTemplate);\n        this.set(k, v);\n    });\n\n}\n\n/**\n * @private\n * @param {*} subject\n * @param {string|Monster.Data~exampleSelectorCallback} selector\n * @param {Monster.Data~exampleFilterCallback} [filter]\n * @param {function} callback\n * @return {Map}\n * @throws {TypeError} selector is neither a string nor a function\n */\nfunction assembleParts(subject, selector, filter, callback) {\n\n    const result = new Map();\n\n    let map;\n    if (isFunction(selector)) {\n        map = selector(subject)\n        if (!(map instanceof Map)) {\n            throw new TypeError('the selector callback must return a map');\n        }\n    } else if (isString(selector)) {\n        map = new Map;\n        buildFlatMap.call(map, subject, selector);\n    } else {\n        throw new TypeError('selector is neither a string nor a function')\n    }\n\n    if (!(map instanceof Map)) {\n        return result;\n    }\n\n    map.forEach((v, k, m) => {\n        if (isFunction(filter)) {\n            if (filter.call(m, v, k) !== true) return;\n        }\n\n        callback.call(result, v, k, m);\n\n    });\n\n    return result;\n}\n\n/**\n * @private\n * @param subject\n * @param selector\n * @param key\n * @param parentMap\n * @return {*}\n */\nfunction buildFlatMap(subject, selector, key, parentMap) {\n\n    const result = this;\n    const currentMap = new Map;\n\n    const resultLength = result.size;\n\n    if (key === undefined) key = [];\n\n    let parts = selector.split(DELIMITER);\n    let current = \"\", currentPath = [];\n    do {\n\n        current = parts.shift();\n        currentPath.push(current);\n\n        if (current === WILDCARD) {\n\n            let finder = new Pathfinder(subject);\n            let map;\n\n            try {\n                map = finder.getVia(currentPath.join(DELIMITER));\n            } catch (e) {\n                let a = e;\n                map = new Map();\n            }\n\n            for (const [k, o] of map) {\n\n                let copyKey = clone(key);\n\n                currentPath.map((a) => {\n                    copyKey.push((a === WILDCARD) ? k : a)\n                })\n\n                let kk = copyKey.join(DELIMITER);\n                let sub = buildFlatMap.call(result, o, parts.join(DELIMITER), copyKey, o);\n\n                if (isObject(sub) && parentMap !== undefined) {\n                    sub[PARENT] = parentMap;\n                }\n\n                currentMap.set(kk, sub);\n            }\n\n        }\n\n\n    } while (parts.length > 0);\n\n    // no set in child run\n    if (resultLength === result.size) {\n        for (const [k, o] of currentMap) {\n            result.set(k, o);\n        }\n    }\n\n    return subject;\n\n}\n\n\n/**\n * With the help of this filter callback, values can be filtered out. Only if the filter function returns true, the value is taken for the map.\n *\n * @callback Monster.Data~exampleFilterCallback\n * @param {*} value Value\n * @param {string} key  Key\n * @memberOf Monster.Data\n * @see {@link Monster.Data.buildMap}\n */\n\n/**\n * Alternatively to a string selector a callback can be specified. this must return a map.\n *\n * @example\n * import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/buildmap.js';\n *\n * let obj = {\n *                \"data\": [\n *                    {\n *                        \"id\": 10,\n *                        \"name\": \"Cassandra\",\n *                        \"enrichment\": {\n *                            variants: [\n *                                {\n *                                    sku: 1, label: \"XXS\", price: [\n *                                        {vk: '12.12 €'},\n *                                        {vk: '12.12 €'}\n *                                    ]\n *                                },\n *                                {\n *                                    sku: 2, label: \"XS\", price: [\n *                                        {vk: '22.12 €'},\n *                                        {vk: '22.12 €'}\n *                                    ]\n *                                },\n *                                {\n *                                    sku: 3, label: \"S\", price: [\n *                                        {vk: '32.12 €'},\n *                                        {vk: '32.12 €'}\n *                                    ]\n *                                },\n *                                {\n *                                    sku: 4, label: \"L\", price: [\n *                                        {vk: '42.12 €'},\n *                                        {vk: '42.12 €'}\n *                                    ]\n *                                }\n *                            ]\n *\n *                        }\n *                    },\n *                    {\n *                        \"id\": 20,\n *                        \"name\": \"Yessey!\",\n *                        \"enrichment\": {\n *                            variants: [\n *                                {\n *                                    sku: 1, label: \"XXS\", price: [\n *                                        {vk: '12.12 €'},\n *                                        {vk: '12.12 €'}\n *                                    ]\n *                                },\n *                                {\n *                                    sku: 2, label: \"XS\", price: [\n *                                        {vk: '22.12 €'},\n *                                        {vk: '22.12 €'}\n *                                    ]\n *                                },\n *                                {\n *                                    sku: 3, label: \"S\", price: [\n *                                        {vk: '32.12 €'},\n *                                        {vk: '32.12 €'}\n *                                    ]\n *                                },\n *                                {\n *                                    sku: 4, label: \"L\", price: [\n *                                        {vk: '42.12 €'},\n *                                        {vk: '42.12 €'}\n *                                    ]\n *                                }\n *                            ]\n *\n *                        }\n *                    }\n *                ]\n *            };\n *\n * let callback = function (subject) {\n *                let m = new Map;\n *\n *                for (const [i, b] of Object.entries(subject.data)) {\n *\n *                    let key1 = i;\n *\n *                    for (const [j, c] of Object.entries(b.enrichment.variants)) {\n *                        let key2 = j;\n *\n *                        for (const [k, d] of Object.entries(c.price)) {\n *\n *                            let key3 = k;\n *\n *                            d.name = b.name;\n *                            d.label = c.label;\n *                            d.id = [key1, key2, key3].join('.');\n *\n *                            m.set(d.id, d);\n *                        }\n *\n *                    }\n *                }\n *                return m;\n *            }\n *\n * let map = buildMap(obj, callback, '${name} ${vk}', '${id}')\n *\n * // ↦ Map(3) {\n * //  \"0.0.0\":\"Cassandra 12.12 €\",\n * //  \"0.0.1\":\"Cassandra 12.12 €\",\n * //  \"0.1.0\":\"Cassandra 22.12 €\",\n * //  \"0.1.1\":\"Cassandra 22.12 €\",\n * //  \"0.2.0\":\"Cassandra 32.12 €\",\n * //  \"0.2.1\":\"Cassandra 32.12 €\",\n * //  \"0.3.0\":\"Cassandra 42.12 €\",\n * //  \"0.3.1\":\"Cassandra 42.12 €\",\n * //  \"1.0.0\":\"Yessey! 12.12 €\",\n * //  \"1.0.1\":\"Yessey! 12.12 €\",\n * //  \"1.1.0\":\"Yessey! 22.12 €\",\n * //  \"1.1.1\":\"Yessey! 22.12 €\",\n * //  \"1.2.0\":\"Yessey! 32.12 €\",\n * //  \"1.2.1\":\"Yessey! 32.12 €\",\n * //  \"1.3.0\":\"Yessey! 42.12 €\",\n * //  \"1.3.1\":\"Yessey! 42.12 €\"\n * // }\n *\n * @callback Monster.Data~exampleSelectorCallback\n * @param {*} subject subject\n * @return Map\n * @since 1.17.0\n * @memberOf Monster.Data\n * @see {@link Monster.Data.buildMap}\n */\n\n/**\n * @private\n * @param {*} subject\n * @param {string|undefined} definition\n * @param {*} defaultValue\n * @return {*}\n */\nfunction build(subject, definition, defaultValue) {\n    if (definition === undefined) return defaultValue ? defaultValue : subject;\n    validateString(definition);\n\n    const regexp = /(?<placeholder>\\${(?<path>[a-z\\^A-Z.\\-_0-9]*)})/gm\n    const array = [...definition.matchAll(regexp)];\n\n    let finder = new Pathfinder(subject);\n\n    if (array.length === 0) {\n        return finder.getVia(definition);\n    }\n\n    array.forEach((a) => {\n        let groups = a?.['groups'];\n        let placeholder = groups?.['placeholder']\n        if (placeholder === undefined) return;\n\n        let path = groups?.['path']\n\n        let v = finder.getVia(path);\n        if (v === undefined) v = defaultValue;\n\n        definition = definition.replaceAll(placeholder, v);\n\n\n    })\n\n    return definition;\n\n}\n\n\nassignToNamespace('Monster.Data', buildMap);\nexport {Monster, buildMap, assembleParts}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {\n    isArray,\n    isBoolean,\n    isFunction,\n    isInstance,\n    isInteger,\n    isIterable,\n    isObject,\n    isPrimitive,\n    isString,\n    isSymbol\n} from './is.js';\n\n/**\n * This method checks if the type matches the primitive type. this function is identical to isPrimitive() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validatePrimitive()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateIterable('2')) // ↦ TypeError\n * console.log(Monster.Types.validateIterable([])) // ↦ value\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateIterable} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateIterable('2'))  // ↦ TypeError\n * console.log(validateIterable([]))  // ↦ value\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.2.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not a primitive\n * @see {@link isPrimitive}\n * @see {@link Monster.Types.isPrimitive}\n * @see {@link Monster.Types#isPrimitive}\n */\nfunction validateIterable(value) {\n    if (!isIterable(value)) {\n        throw new TypeError('value is not iterable')\n    }\n    return value\n}\n\n/**\n * This method checks if the type matches the primitive type. this function is identical to isPrimitive() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validatePrimitive()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validatePrimitive('2')) // ↦ value\n * console.log(Monster.Types.validatePrimitive([])) // ↦ TypeError\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validatePrimitive} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validatePrimitive('2'))  // ↦ value\n * console.log(validatePrimitive([]))  // ↦ TypeError\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not a primitive\n * @see {@link isPrimitive}\n * @see {@link Monster.Types.isPrimitive}\n * @see {@link Monster.Types#isPrimitive}\n */\nfunction validatePrimitive(value) {\n    if (!isPrimitive(value)) {\n        throw new TypeError('value is not a primitive')\n    }\n    return value\n}\n\n/**\n * This method checks if the type matches the boolean type. this function is identical to isBoolean() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validateBoolean()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateBoolean(true)) // ↦ value\n * console.log(Monster.Types.validateBoolean('2')) // ↦ TypeError\n * console.log(Monster.Types.validateBoolean([])) // ↦ TypeError\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateBoolean} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateBoolean(false))  // ↦ value\n * console.log(validateBoolean('2'))  // ↦ TypeError\n * console.log(validateBoolean([]))  // ↦ TypeError\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n\n * @throws {TypeError}  value is not primitive\n */\nfunction validateBoolean(value) {\n    if (!isBoolean(value)) {\n        throw new TypeError('value is not a boolean')\n    }\n    return value\n}\n\n/**\n * This method checks if the type matches the string type. this function is identical to isString() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validateString()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateString('2')) // ↦ value\n * console.log(Monster.Types.validateString([])) // ↦ TypeError\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateString('2'))  // ↦ value\n * console.log(validateString([]))  // ↦ TypeError\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not a string\n */\nfunction validateString(value) {\n    if (!isString(value)) {\n        throw new TypeError('value is not a string')\n    }\n    return value\n}\n\n\n/**\n * This method checks if the type matches the object type. this function is identical to isObject() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validateObject()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateObject({})) // ↦ value\n * console.log(Monster.Types.validateObject('2')) // ↦ TypeError\n * console.log(Monster.Types.validateObject([])) // ↦ TypeError\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateObject({}))  // ↦ value\n * console.log(validateObject('2'))  // ↦ TypeError\n * console.log(validateObject([]))  // ↦ TypeError\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not a object\n */\nfunction validateObject(value) {\n    if (!isObject(value)) {\n        throw new TypeError('value is not a object')\n    }\n    return value\n}\n\n/**\n * This method checks if the type matches the object instance.\n *\n * You can call the method via the monster namespace `Monster.Types.validateInstance()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateInstance({}, Object)) // ↦ value\n * console.log(Monster.Types.validateInstance('2', Object)) // ↦ TypeError\n * console.log(Monster.Types.validateInstance([], Object)) // ↦ TypeError\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateInstance} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateInstance({}, Object)) // ↦ value\n * console.log(validateInstance('2', Object)) // ↦ TypeError\n * console.log(validateInstance([], Object)) // ↦ TypeError\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not an instance of\n */\nfunction validateInstance(value, instance) {\n    if (!isInstance(value, instance)) {\n        let n = \"\";\n        if (isObject(instance) || isFunction(instance)) {\n            n = instance?.['name']\n        }\n\n        if (n) {\n            n = \" \" + n;\n        }\n\n        throw new TypeError('value is not an instance of' + n)\n    }\n    return value\n}\n\n/**\n * This method checks if the type matches the array type. this function is identical to isArray() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validateArray()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateArray('2')) // ↦ TypeError\n * console.log(Monster.Types.validateArray([])) // ↦ value\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateArray('2'))  // ↦ TypeError\n * console.log(validateArray([]))  // ↦ value\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not an array\n */\nfunction validateArray(value) {\n    if (!isArray(value)) {\n        throw new TypeError('value is not an array')\n    }\n    return value\n}\n\n/**\n * This method checks if the type matches the symbol type. this function is identical to isSymbol() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validateSymbol()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateSymbol('2')) // ↦ TypeError\n * console.log(Monster.Types.validateSymbol([])) // ↦ value\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateSymbol} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateSymbol('2'))  // ↦ TypeError\n * console.log(validateSymbol())  // ↦ value\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not an symbol\n */\nfunction validateSymbol(value) {\n    if (!isSymbol(value)) {\n        throw new TypeError('value is not an symbol')\n    }\n    return value\n}\n\n/**\n * This method checks if the type matches the function type. this function is identical to isFunction() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validateFunction()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateFunction(()=>{})) // ↦ value\n * console.log(Monster.Types.validateFunction('2')) // ↦ TypeError\n * console.log(Monster.Types.validateFunction([])) // ↦ TypeError\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateFunction(()=>{})) // ↦ value\n * console.log(validateFunction('2'))  // ↦ TypeError\n * console.log(validateFunction([]))  // ↦ TypeError\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not a function\n */\nfunction validateFunction(value) {\n    if (!isFunction(value)) {\n        throw new TypeError('value is not a function')\n    }\n    return value\n}\n\n/**\n * This method checks if the type is an integer. this function is identical to isInteger() except that a TypeError is thrown.\n *\n * You can call the method via the monster namespace `Monster.Types.validateInteger()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.validateInteger(true)) // ↦ TypeError\n * console.log(Monster.Types.validateInteger('2')) // ↦ TypeError\n * console.log(Monster.Types.validateInteger(2)) // ↦ value\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {validateFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/validate.js';\n * console.log(validateInteger(true)) // ↦ TypeError\n * console.log(validateInteger('2'))  // ↦ TypeError\n * console.log(validateInteger(2))  // ↦ value\n * </script>\n * ```\n *\n * @param {*} value\n * @return {*}\n * @since 1.4.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not an integer\n */\nfunction validateInteger(value) {\n    if (!isInteger(value)) {\n        throw new TypeError('value is not an integer')\n    }\n    return value\n}\n\nassignToNamespace('Monster.Types', validatePrimitive, validateBoolean, validateString, validateObject, validateArray, validateFunction, validateIterable, validateInteger);\nexport {\n    Monster,\n    validatePrimitive,\n    validateBoolean,\n    validateString,\n    validateObject,\n    validateInstance,\n    validateArray,\n    validateFunction,\n    validateIterable,\n    validateInteger,\n    validateSymbol\n}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {getGlobal} from '../types/global.js';\nimport {isArray, isFunction, isObject, isPrimitive} from '../types/is.js';\nimport {typeOf} from \"../types/typeof.js\";\nimport {validateObject} from \"../types/validate.js\";\n\n\n/**\n * With this function, objects can be cloned.\n * The entire object tree is run through.\n *\n * Proxy, Element, HTMLDocument and DocumentFragment instances are not cloned.\n * Global objects such as windows are also not cloned,\n *\n * If an object has a method `getClone()`, this method is used to create the clone.\n *\n * You can call the method via the monster namespace `Monster.Util.clone()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Util.clone({})\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {clone} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/util/clone.js';\n * clone({})\n * </script>\n * ```\n *\n * @param {*} obj object to be cloned\n * @returns {*}\n * @since 1.0.0\n * @memberOf Monster.Util\n * @copyright schukai GmbH\n * @throws {Error} unable to clone obj! its type isn't supported.\n */\nfunction clone(obj) {\n\n    // typeof null results in 'object'.  https://2ality.com/2013/10/typeof-null.html\n    if (null === obj) {\n        return obj;\n    }\n\n    // Handle the two simple types, null and undefined\n    if (isPrimitive(obj)) {\n        return obj;\n    }\n\n    // Handle the two simple types, null and undefined\n    if (isFunction(obj)) {\n        return obj;\n    }\n\n    // Handle Array\n    if (isArray(obj)) {\n        let copy = [];\n        for (var i = 0, len = obj.length; i < len; i++) {\n            copy[i] = clone(obj[i]);\n        }\n\n        return copy;\n    }\n\n    if (isObject(obj)) {\n\n\n        // Handle Date\n        if (obj instanceof Date) {\n            let copy = new Date();\n            copy.setTime(obj.getTime());\n            return copy;\n        }\n\n        /** Do not clone DOM nodes */\n        if (typeof Element !== 'undefined' && obj instanceof Element) return obj;\n        if (typeof HTMLDocument !== 'undefined' && obj instanceof HTMLDocument) return obj;\n        if (typeof DocumentFragment !== 'undefined' && obj instanceof DocumentFragment) return obj;\n\n        /** Do not clone global objects */\n        if (obj === getGlobal()) return obj;\n        if (typeof globalContext !== 'undefined' && obj === globalContext) return obj;\n        if (typeof window !== 'undefined' && obj === window) return obj;\n        if (typeof document !== 'undefined' && obj === document) return obj;\n        if (typeof navigator !== 'undefined' && obj === navigator) return obj;\n        if (typeof JSON !== 'undefined' && obj === JSON) return obj;\n\n        // Handle Proxy-Object\n        try {\n            // try/catch because possible: TypeError: Function has non-object prototype 'undefined' in instanceof check\n            if (obj instanceof Proxy) {\n                return obj;\n            }\n        } catch (e) {\n        }\n\n        return cloneObject(obj)\n\n    }\n\n    throw new Error(\"unable to clone obj! its type isn't supported.\");\n}\n\n/**\n *\n * @param {object} obj\n * @returns {object}\n * @private\n */\nfunction cloneObject(obj) {\n    \n    validateObject(obj);\n    \n    const constructor = obj?.['constructor'];\n\n    /** Object has clone method */\n    if(typeOf(constructor)==='function') {\n        const prototype = constructor?.prototype;\n        if(typeof prototype==='object') {\n            if(prototype.hasOwnProperty('getClone')&& typeOf(obj.getClone) === 'function') {\n                return obj.getClone();        \n            }\n        }\n    }\n\n    let copy = {};\n    if (typeof obj.constructor === 'function' &&\n        typeof obj.constructor.call === 'function') {\n        copy = new obj.constructor();\n    }\n\n    for (let key in obj) {\n\n        if (!obj.hasOwnProperty(key)) {\n            continue;\n        }\n\n        if (isPrimitive(obj[key])) {\n            copy[key] = obj[key];\n            continue;\n        }\n\n        copy[key] = clone(obj[key]);\n    }\n\n    return copy;\n}\n\nassignToNamespace('Monster.Util', clone);\nexport {Monster, clone}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {validateFunction, validateObject, validateString} from \"./validate.js\";\n\n/**\n * @type {objec}\n * @private\n */\nlet globalReference;\n\n/**\n * @private\n * @throws {Error} unsupported environment.\n */\n(function () {\n\n    if (typeof globalThis === 'object') {\n        globalReference = globalThis;\n        return;\n    }\n\n    if (typeof self !== 'undefined') {\n        globalReference = self;\n        return;\n    } else if (typeof window !== 'undefined') {\n        globalReference = window;\n        return;\n    }\n\n    Object.defineProperty(Object.prototype, '__monster__', {\n        get: function () {\n            return this;\n        },\n        configurable: true\n    });\n\n    if (typeof __monster__ === 'object') {\n        __monster__.globalThis = __monster__;\n        delete Object.prototype.__monster__;\n\n        globalReference = globalThis;\n        return;\n    }\n\n    try {\n        globalReference = Function('return this')();\n    } catch (e) {\n\n    }\n\n    throw new Error(\"unsupported environment.\")\n\n\n}());\n\n/**\n * Return globalThis\n *\n * If globalThis is not available, it will be polyfilled\n *\n * @since 1.6.0\n * @memberOf Monster.Types\n * @returns {objec} globalThis\n */\nfunction getGlobal() {\n    return globalReference;\n}\n\n/**\n * Return global object or throw Error\n *\n * You can call the method via the monster namespace `Monster.Types.getGlobalObject()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Types.getGlobalObject('document') \n * // ↦ { }\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getGlobalObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/global.js';\n * getGlobalObject('document') \n * // ↦ { }\n * </script>\n * ```\n *\n * @since 1.6.0\n * @memberOf Monster.Types\n * @param {string} name\n * @returns {objec}\n * @throws {Error} the object is not defined\n * @throws {TypeError} value is not a object\n * @throws {TypeError} value is not a string\n */\nfunction getGlobalObject(name) {\n    validateString(name);\n    let o = globalReference?.[name];\n    if (typeof o === 'undefined') throw new Error('the object ' + name + ' is not defined');\n    validateObject(o);\n    return o;\n}\n\n/**\n * Return global function or throw Error\n *\n * You can call the method via the monster namespace `Monster.Types.getGlobalFunction()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.getGlobalFunction('parseInt')) // ↦ f parseInt() { }\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getGlobalFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/global.js';\n * console.log(getGlobalFunction('parseInt')) // ↦ f parseInt() { }\n * </script>\n * ```\n *\n * @since 1.6.0\n * @memberOf Monster.Types\n * @param {string} name\n * @return {objec}\n * @throws {TypeError} value is not a function\n * @throws {Error} the function is not defined\n * @throws {TypeError} value is not a string\n */\nfunction getGlobalFunction(name) {\n    validateString(name);\n    let f = globalReference?.[name];\n    if (typeof f === 'undefined') throw new Error('the function ' + name + ' is not defined');\n    validateFunction(f);\n    return f;\n}\n\n\nassignToNamespace('Monster.Types', getGlobal, getGlobalObject, getGlobalFunction);\nexport {Monster, getGlobal, getGlobalObject, getGlobalFunction}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\n\nimport {assignToNamespace, Monster} from '../namespace.js';\n\n/**\n * The built-in typeof method is known to have some historical weaknesses. This function tries to provide a better and more accurate result.\n *\n * You can call the method via the monster namespace `Monster.Types.typeOf()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.typeOf())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/typeof.js';\n * console.log(typeOf())\n * </script>\n * ```\n *\n * @example\n *\n * import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/typeof.js';\n *\n * console.log(typeOf(undefined)); // ↦ undefined\n * console.log(typeOf(\"\")); // ↦ string\n * console.log(typeOf(5)); // ↦ number\n * console.log(typeOf({})); // ↦ object\n * console.log(typeOf([])); // ↦ array\n * console.log(typeOf(new Map)); // ↦ map\n * console.log(typeOf(true)); // ↦ boolean\n *\n * @param {*} value\n * @return {string}\n * @since 1.7.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @throws {TypeError} value is not a primitive\n */\nfunction typeOf(value) {\n    let type = ({}).toString.call(value).match(/\\s([a-zA-Z]+)/)[1];\n    if ('Object' === type) {\n        const results = (/^(class|function)\\s+(\\w+)/).exec(value.constructor.toString());\n        type = (results && results.length > 2) ? results[2] : '';\n    }\n    return type.toLowerCase();\n}\n\nassignToNamespace('Monster.Types', typeOf);\nexport {\n    Monster,\n    typeOf\n}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {isArray, isInteger, isObject, isPrimitive} from '../types/is.js';\nimport {Stack} from \"../types/stack.js\";\nimport {validateInteger, validateString} from '../types/validate.js';\n\n/**\n * path separator\n *\n * @private\n * @type {string}\n */\nexport const DELIMITER = '.';\n\n/**\n * @private\n * @type {string}\n */\nexport const WILDCARD = '*';\n\n/**\n * You can call the method via the monster namespace `new Monster.Data.Pathfinder()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Data.Pathfinder())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/pathfinder.js';\n * console.log(new Pathfinder())\n * </script>\n * ```\n *\n * With the help of the pathfinder, values can be read and written from an object construct.\n *\n * ```\n * new Pathfinder({\n * a: {\n *     b: {\n *         f: [\n *             {\n *                 g: false,\n *             }\n *         ],\n *     }\n * }\n * }).getVia(\"a.b.f.0.g\"); // ↦ false\n * ```\n *\n * if a value is not present or has the wrong type, a corresponding exception is thrown.\n *\n * ```\n * new Pathfinder({}).getVia(\"a.b.f.0.g\"); // ↦ Error\n * ```\n *\n * The `Pathfinder.exists()` method can be used to check whether access to the path is possible.\n *\n * ```\n * new Pathfinder({}).exists(\"a.b.f.0.g\"); // ↦ false\n * ```\n *\n * pathfinder can also be used to build object structures. to do this, the `Pathfinder.setVia()` method must be used.\n *\n * ```\n * obj = {};\n * new Pathfinder(obj).setVia('a.b.0.c', true); // ↦ {a:{b:[{c:true}]}}\n * ```\n *\n * @example\n *\n * import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/pathfinder.js';\n *\n * let value = new Pathfinder({\n * a: {\n *     b: {\n *         f: [\n *             {\n *                 g: false,\n *             }\n *         ],\n *     }\n * }\n * }).getVia(\"a.b.f.0.g\");\n *\n *  console.log(value);\n *  // ↦ false\n *\n * try {\n *   new Pathfinder({}).getVia(\"a.b.f.0.g\");  \n * } catch(e) {\n *   console.log(e.toString());\n *   // ↦ Error: the journey is not at its end (b.f.0.g)\n * }\n *\n * @example\n *\n * import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/pathfinder.js';\n *\n * let p = new Pathfinder({\n *                a: {\n *                    x: [\n *                        {c: 1}, {c: 2}\n *                    ],\n *                    y: true\n *                },\n *                b: {\n *                    x: [\n *                        {c: 1, d: false}, {c: 2}\n *                    ],\n *                    y: true\n *                },\n *            });\n *\n * let r = p.getVia(\"*.x.*.c\");\n * console.log(r);\n *\n * @since 1.4.0\n * @copyright schukai GmbH\n * @memberOf Monster.Data\n */\nclass Pathfinder extends Base {\n\n    /**\n     * @param {array|object|Map|Set} value\n     * @since 1.4.0\n     * @throws  {Error} the parameter must not be a simple type\n     **/\n    constructor(object) {\n        super();\n\n        if (isPrimitive(object)) {\n            throw new Error('the parameter must not be a simple type');\n        }\n\n        this.object = object;\n        this.wildCard = WILDCARD;\n    }\n\n    /**\n     * set wildcard\n     *\n     * @param {string} wildcard\n     * @return {Pathfinder}\n     * @since 1.7.0\n     */\n    setWildCard(wildcard) {\n        validateString(wildcard);\n        this.wildCard = wildcard;\n        return this;\n    }\n\n    /**\n     *\n     * @param {string} path\n     * @since 1.4.0\n     * @returns {*}\n     * @throws {TypeError} unsupported type\n     * @throws {Error} the journey is not at its end\n     * @throws {TypeError} value is not a string\n     * @throws {TypeError} value is not an integer\n     * @throws {Error} unsupported action for this data type\n     */\n    getVia(path) {\n        return getValueViaPath.call(this, this.object, validateString(path));\n    }\n\n    /**\n     *\n     * @param {string} path\n     * @param {*} value\n     * @returns {Pathfinder}\n     * @since 1.4.0\n     * @throws {TypeError} unsupported type\n     * @throws {TypeError} value is not a string\n     * @throws {TypeError} value is not an integer\n     * @throws {Error} unsupported action for this data type\n     */\n    setVia(path, value) {\n        validateString(path);\n        setValueViaPath.call(this, this.object, path, value);\n        return this;\n    }\n\n    /**\n     * Delete Via Path\n     *\n     * @param {string} path\n     * @returns {Pathfinder}\n     * @since 1.6.0\n     * @throws {TypeError} unsupported type\n     * @throws {TypeError} value is not a string\n     * @throws {TypeError} value is not an integer\n     * @throws {Error} unsupported action for this data type\n     */\n    deleteVia(path) {\n        validateString(path);\n        deleteValueViaPath.call(this, this.object, path);\n        return this;\n    }\n\n    /**\n     *\n     * @param {string} path\n     * @return {bool}\n     * @throws {TypeError} unsupported type\n     * @throws {TypeError} value is not a string\n     * @throws {TypeError} value is not an integer\n     * @since 1.4.0\n     */\n    exists(path) {\n        validateString(path);\n        try {\n            getValueViaPath.call(this, this.object, path, true);\n            return true;\n        } catch (e) {\n\n        }\n\n        return false;\n    }\n\n}\n\nassignToNamespace('Monster.Data', Pathfinder);\nexport {Monster, Pathfinder}\n\n/**\n *\n * @param {*} subject\n * @param {string} path\n * @param {string} check\n * @return {Map}\n * @throws {TypeError} unsupported type\n * @throws {Error} the journey is not at its end\n * @throws {Error} unsupported action for this data type\n * @private\n */\nfunction iterate(subject, path, check) {\n\n    const result = new Map;\n\n    if (isObject(subject) || isArray(subject)) {\n        for (const [key, value] of Object.entries(subject)) {\n            result.set(key, getValueViaPath.call(this, value, path, check))\n        }\n    } else {\n        let key = path.split(DELIMITER).shift();\n        result.set(key, getValueViaPath.call(this, subject, path, check));\n    }\n\n    return result;\n\n\n}\n\n/**\n *\n * @param {*} subject\n * @param [string} path\n * @param [boolean} check \n * @returns {*}\n * @throws {TypeError} unsupported type\n * @throws {Error} the journey is not at its end\n * @throws {Error} unsupported action for this data type\n * @private\n */\nfunction getValueViaPath(subject, path, check) {\n\n    if (path === \"\") {\n        return subject;\n    }\n\n    let parts = path.split(DELIMITER)\n    let current = parts.shift();\n\n    if (current === this.wildCard) {\n        return iterate.call(this, subject, parts.join(DELIMITER), check);\n    }\n\n    if (isObject(subject) || isArray(subject)) {\n\n        let anchor;\n        if (subject instanceof Map || subject instanceof WeakMap) {\n            anchor = subject.get(current);\n\n        } else if (subject instanceof Set || subject instanceof WeakSet) {\n            current = parseInt(current);\n            validateInteger(current)\n            anchor = [...subject]?.[current];\n\n        } else if (typeof WeakRef === 'function' && subject instanceof WeakRef) {\n            throw Error('unsupported action for this data type');\n\n        } else if (isArray(subject)) {\n            current = parseInt(current);\n            validateInteger(current)\n            anchor = subject?.[current];\n        } else {\n            anchor = subject?.[current];\n        }\n\n        if (isObject(anchor) || isArray(anchor)) {\n            return getValueViaPath.call(this, anchor, parts.join(DELIMITER), check)\n        }\n\n        if (parts.length > 0) {\n            throw Error(\"the journey is not at its end (\" + parts.join(DELIMITER) + \")\");\n        }\n\n\n        if (check === true) {\n            const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(subject), current);\n\n            if (!subject.hasOwnProperty(current) && descriptor === undefined) {\n                throw Error('unknown value');\n            }\n\n        }\n\n        return anchor;\n\n    }\n\n    throw TypeError(\"unsupported type \" + typeof subject)\n\n}\n\n/**\n *\n * @param object\n * @param path\n * @param value\n * @returns {void}\n * @throws {TypeError} unsupported type\n * @throws {TypeError} unsupported type\n * @throws {Error} the journey is not at its end\n * @throws {Error} unsupported action for this data type\n * @private\n */\nfunction setValueViaPath(object, path, value) {\n\n    validateString(path);\n\n    let parts = path.split(DELIMITER)\n    let last = parts.pop();\n    let subpath = parts.join(DELIMITER);\n\n    let stack = new Stack()\n    let current = subpath;\n    while (true) {\n\n        try {\n            getValueViaPath.call(this, object, current, true)\n            break;\n        } catch (e) {\n\n        }\n\n        stack.push(current);\n        parts.pop();\n        current = parts.join(DELIMITER);\n\n        if (current === \"\") break;\n    }\n\n    while (!stack.isEmpty()) {\n        current = stack.pop();\n        let obj = {};\n\n        if (!stack.isEmpty()) {\n            let n = stack.peek().split(DELIMITER).pop();\n            if (isInteger(parseInt(n))) {\n                obj = [];\n            }\n\n        }\n\n        setValueViaPath.call(this, object, current, obj);\n    }\n\n    let anchor = getValueViaPath.call(this, object, subpath);\n\n    if (!isObject(object) && !isArray(object)) {\n        throw TypeError(\"unsupported type: \" + typeof object);\n    }\n\n    if (anchor instanceof Map || anchor instanceof WeakMap) {\n        anchor.set(last, value);\n    } else if (anchor instanceof Set || anchor instanceof WeakSet) {\n        anchor.append(value)\n\n    } else if (typeof WeakRef === 'function' && anchor instanceof WeakRef) {\n        throw Error('unsupported action for this data type');\n\n    } else if (isArray(anchor)) {\n        last = parseInt(last);\n        validateInteger(last)\n        assignProperty(anchor, last, value);\n    } else {\n        assignProperty(anchor, last, value);\n    }\n\n\n}\n\n/**\n * @private\n * @param {object} object\n * @param {string} key\n * @param {*} value\n */\nfunction assignProperty(object, key, value) {\n\n    if (!object.hasOwnProperty(key)) {\n        object[key] = value;\n        return;\n    }\n\n    if (value === undefined) {\n        delete object[key];\n    }\n\n    object[key] = value;\n\n}\n\n/**\n *\n * @param object\n * @param path\n * @returns {void}\n * @throws {TypeError} unsupported type\n * @throws {TypeError} unsupported type\n * @throws {Error} the journey is not at its end\n * @throws {Error} unsupported action for this data type\n * @since 1.6.0\n * @private\n */\nfunction deleteValueViaPath(object, path) {\n\n    const parts = path.split(DELIMITER)\n    let last = parts.pop();\n    const subpath = parts.join(DELIMITER);\n\n    const anchor = getValueViaPath.call(this, object, subpath);\n\n    if (anchor instanceof Map) {\n        anchor.delete(last);\n    } else if (anchor instanceof Set || anchor instanceof WeakMap || anchor instanceof WeakSet || (typeof WeakRef === 'function' && anchor instanceof WeakRef)) {\n        throw Error('unsupported action for this data type');\n\n    } else if (isArray(anchor)) {\n        last = parseInt(last);\n        validateInteger(last)\n        delete anchor[last];\n    } else {\n        delete anchor[last];\n    }\n\n\n}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from './base.js';\n\n/**\n * You can call the method via the monster namespace `new Monster.Types.Queue()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Types.Stack())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/stack.js';\n * console.log(new Stack())\n * </script>\n * ```\n *\n * @since 1.4.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass Stack extends Base {\n\n    /**\n     *\n     */\n    constructor() {\n        super();\n        this.data = [];\n    }\n\n\n    /**\n     * @return {boolean}\n     */\n    isEmpty() {\n        return this.data.length === 0;\n    }\n\n    /**\n     * looks at the object at the top of this stack without removing it from the stack.\n     *\n     * @return {*}\n     */\n    peek() {\n        if (this.isEmpty()) {\n            return undefined;\n        }\n\n        return this.data?.[this.data.length - 1];\n    }\n\n    /**\n     * pushes an item onto the top of this stack.\n     *\n     * @param {*} value\n     * @returns {Queue}\n     */\n    push(value) {\n        this.data.push(value)\n        return this;\n    }\n\n    /**\n     * remove all entries\n     *\n     * @returns {Queue}\n     */\n    clear() {\n        this.data = [];\n        return this;\n    }\n\n    /**\n     * removes the object at the top of this stack and returns\n     * that object as the value of this function. is the stack empty\n     * the return value is undefined.\n     *\n     * @return {*}\n     */\n    pop() {\n        if (this.isEmpty()) {\n            return undefined;\n        }\n        return this.data.pop();\n    }\n\n\n}\n\nassignToNamespace('Monster.Types', Stack);\nexport {Monster, Stack}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {isArray, isObject} from \"../types/is.js\";\nimport {typeOf} from \"../types/typeof.js\";\n\n/**\n * With the diff function you can perform the change of one object to another. The result shows the changes of the second object to the first object.\n *\n * The operator `add` means that something has been added to the second object. `delete` means that something has been deleted from the second object compared to the first object.\n *\n * You can call the method via the monster namespace `Monster.Data.Diff()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Data.Diff(a, b)\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/diff.js';\n * Diff(a, b)\n * </script>\n * ```\n *\n * @example\n *\n * import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/diff.js';\n *\n * // given are two objects x and y.\n *\n * let x = {\n *     a: 1,\n *     b: \"Hello!\"\n * }\n *\n *  let y = {\n *     a: 2,\n *     c: true\n * }\n *\n * // These two objects can be compared with each other.\n *\n * console.log(Diff(x, y));\n *\n * // the result is then the following\n *\n * //\n * // [\n * // {\n * //        operator: 'update',\n * //        path: [ 'a' ],\n * //        first: { value: 1, type: 'number' },\n * //        second: { value: 2, type: 'number' }\n * //    },\n * // {\n * //        operator: 'delete',\n * //        path: [ 'b' ],\n * //        first: { value: 'Hello!', type: 'string' }\n * //    },\n * // {\n * //        operator: 'add',\n * //        path: [ 'c' ],\n * //        second: { value: true, type: 'boolean' }\n * //    }\n * // ]\n *\n * @param {*} first\n * @param {*} second\n * @return {array}\n * @since 1.6.0\n * @copyright schukai GmbH\n * @memberOf Monster.Data\n */\nfunction diff(first, second) {\n    return doDiff(first, second)\n}\n\n/**\n * @private\n * @param a\n * @param b\n * @param type\n * @return {Set<string>|Set<number>}\n */\nfunction getKeys(a, b, type) {\n    if (isArray(type)) {\n        const keys = a.length > b.length ? new Array(a.length) : new Array(b.length);\n        keys.fill(0);\n        return new Set(keys.map((_, i) => i));\n    }\n\n    return new Set(Object.keys(a).concat(Object.keys(b)));\n}\n\n/**\n * @private\n * @param a\n * @param b\n * @param path\n * @param diff\n * @return {array}\n */\nfunction doDiff(a, b, path, diff) {\n\n    let typeA = typeOf(a)\n    let typeB = typeOf(b)\n\n    const currPath = path || [];\n    const currDiff = diff || [];\n\n    if (typeA === typeB && (typeA === 'object' || typeA ==='array')) { \n\n        getKeys(a, b, typeA).forEach((v) => {\n\n            if (!(Object.prototype.hasOwnProperty.call(a, v))) {\n                currDiff.push(buildResult(a[v], b[v], 'add', currPath.concat(v)));\n            } else if (!(Object.prototype.hasOwnProperty.call(b, v))) {\n                currDiff.push(buildResult(a[v], b[v], 'delete', currPath.concat(v)));\n            } else {\n                doDiff(a[v], b[v], currPath.concat(v), currDiff);\n            }\n        });\n\n    } else {\n\n        const o = getOperator(a, b, typeA, typeB);\n        if (o !== undefined) {\n            currDiff.push(buildResult(a, b, o, path));\n        }\n\n    }\n\n    return currDiff;\n\n}\n\n/**\n *\n * @param {*} a\n * @param {*} b\n * @param {string} operator\n * @param {array} path\n * @return {{path: array, operator: string}}\n * @private\n */\nfunction buildResult(a, b, operator, path) {\n\n    const result = {\n        operator,\n        path,\n    };\n\n    if (operator !== 'add') {\n        result.first = {\n            value: a,\n            type: typeof a\n        };\n\n        if (isObject(a)) {\n            const name = Object.getPrototypeOf(a)?.constructor?.name;\n            if (name !== undefined) {\n                result.first.instance = name;\n            }\n        }\n    }\n\n    if (operator === 'add' || operator === 'update') {\n        result.second = {\n            value: b,\n            type: typeof b\n        };\n\n        if (isObject(b)) {\n            const name = Object.getPrototypeOf(b)?.constructor?.name;\n            if (name !== undefined) {\n                result.second.instance = name;\n            }\n        }\n\n    }\n\n    return result;\n}\n\n/**\n * @private\n * @param {*} a\n * @param {*} b\n * @return {boolean}\n */\nfunction isNotEqual(a, b) {\n\n    if (typeof a !== typeof b) {\n        return true;\n    }\n\n    if (a instanceof Date && b instanceof Date) {\n        return a.getTime() !== b.getTime();\n    }\n\n    return a !== b;\n}\n\n/**\n * @private\n * @param {*} a\n * @param {*} b\n * @return {string|undefined}\n */\nfunction getOperator(a, b) {\n\n    /**\n     * @type {string|undefined}\n     */\n    let operator;\n\n    /**\n     * @type {string}\n     */\n    let typeA = typeof a;\n\n    /**\n     * @type {string}\n     */\n    let typeB = typeof b;\n\n    if (typeA === 'undefined' && typeB !== 'undefined') {\n        operator = 'add';\n    } else if (typeA !== 'undefined' && typeB === 'undefined') {\n        operator = 'delete';\n    } else if (isNotEqual(a, b)) {\n        operator = 'update';\n    }\n\n    return operator;\n\n}\n\nassignToNamespace('Monster.Data', diff);\nexport {Monster, diff}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {isArray, isObject} from \"../types/is.js\";\nimport {typeOf} from \"../types/typeof.js\";\n\n/**\n * Extend copies all enumerable own properties from one or\n * more source objects to a target object. It returns the modified target object.\n *\n * You can call the method via the monster namespace `Monster.Data.extend()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Data.extend(a, b)\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {extend} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/extend.js';\n * extend(a, b)\n * </script>\n * ```\n *\n * @param {object} target\n * @param {object}\n * @return {object}\n * @since 1.10.0\n * @copyright schukai GmbH\n * @memberOf Monster.Data\n * @throws {Error} unsupported argument\n * @throws {Error} type mismatch\n */\nfunction extend() {\n    let o, i;\n\n    for (i = 0; i < arguments.length; i++) {\n        let a = arguments[i];\n\n        if (!(isObject(a) || isArray(a))) {\n            throw new Error('unsupported argument ' + JSON.stringify(a));\n        }\n\n        if (o === undefined) {\n            o = a;\n            continue;\n        }\n\n        for (let k in a) {\n\n            let v = a?.[k];\n\n            if (v === o?.[k]) {\n                continue;\n            }\n\n            if ((isObject(v)&&typeOf(v)==='object') || isArray(v)) {\n\n                if (o[k] === undefined) {\n                    if (isArray(v)) {\n                        o[k] = [];\n                    } else {\n                        o[k] = {};\n                    }\n                } else {\n                    if (typeOf(o[k]) !== typeOf(v)) {\n                        throw new Error(\"type mismatch: \" + JSON.stringify(o[k]) + \"(\" + typeOf(o[k]) + \") != \" + JSON.stringify(v) + \"(\" + typeOf(v) + \")\");\n                    }\n                }\n\n                o[k] = extend(o[k], v);\n\n            } else {\n                o[k] = v;\n            }\n\n        }\n    }\n\n    return o;\n}\n\n\nassignToNamespace('Monster.Data', extend);\nexport {Monster, extend}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {validateString} from '../types/validate.js';\nimport {Transformer} from './transformer.js';\n\n\nconst DELIMITER = '|';\n\n/**\n * The pipe class makes it possible to combine several processing steps.\n *\n * You can call the method via the monster namespace `new Monster.Data.Pipe()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Data.Pipe()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/pipe.js';\n * new Pipe()\n * </script>\n * ```\n *\n * A pipe consists of commands whose input and output are connected with the pipe symbol `|`.\n *\n * With the Pipe, processing steps can be combined. Here, the value of an object is accessed via the pathfinder (path command).\n * the word is then converted to uppercase letters and a prefix Hello is added. the two backslash safe the space char.\n *\n * @example\n * import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/pipe.js';\n *\n * let obj = {\n *    a: {\n *        b: {\n *            c: {\n *                d: \"world\"\n *            }\n *        }\n *    }\n * }\n *\n * console.log(new Pipe('path:a.b.c.d | toupper | prefix:Hello\\\\ ').run(obj));\n * // ↦ Hello WORLD\n *\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Data\n */\nclass Pipe extends Base {\n\n    /**\n     *\n     * @param {string} pipe a pipe consists of commands whose input and output are connected with the pipe symbol `|`.\n     * @throws {TypeError}\n     */\n    constructor(pipe) {\n        super();\n        validateString(pipe);\n        \n        this.pipe = pipe.split(DELIMITER).map((v) => {\n            return new Transformer(v);\n        });\n\n\n    }\n\n    /**\n     *\n     * @param {string} name\n     * @param {function} callback\n     * @param {object} context\n     * @returns {Transformer}\n     * @throws {TypeError} value is not a string\n     * @throws {TypeError} value is not a function\n     */\n    setCallback(name, callback, context) {\n\n        for (const [, t] of Object.entries(this.pipe)) {\n            t.setCallback(name, callback, context);\n        }\n\n        return this;\n    }\n\n    /**\n     * run a pipe\n     *\n     * @param {*} value\n     * @returns {*}\n     */\n    run(value) {\n        return this.pipe.reduce((accumulator, transformer, currentIndex, array) => {\n            return transformer.run(accumulator);\n        }, value);\n    }\n}\n\nassignToNamespace('Monster.Data', Pipe);\nexport {Monster, Pipe}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {getGlobal, getGlobalObject} from \"../types/global.js\";\nimport {ID} from '../types/id.js';\nimport {isArray, isObject, isString} from '../types/is.js';\nimport {\n    validateFunction,\n    validateInteger,\n    validateObject,\n    validatePrimitive,\n    validateString\n} from '../types/validate.js';\nimport {clone} from \"../util/clone.js\";\nimport {Pathfinder} from \"./pathfinder.js\";\n\n/**\n * The transformer class is a swiss army knife for manipulating values. especially in combination with the pipe, processing chains can be built up.\n *\n * You can call the method via the monster namespace `new Monster.Data.Transformer()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Data.Transformer()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/transformer.js';\n * new Transformer()\n * </script>\n * ```\n *\n * A simple example is the conversion of all characters to lowercase. for this purpose the command `tolower` must be used.\n *\n * ```\n * let t = new Transformer('tolower').run('ABC'); // ↦ abc\n * ```\n *\n * **all commands**\n *\n * in the following table all commands, parameters and existing aliases are described.\n *\n * | command      | parameter                  | alias                   | description                                                                                                                                                                                                                                                                                                                                                |\n * |:-------------|:---------------------------|:------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n * | to-base64    |                            | base64, btob            | Converts the value to base64                                                                                                                                                                                                                                                                                                                               |\n * | from-base64  |                            | atob                    | Converts the value from base64                                                                                                                                                                                                                                                                                                                             |\n * | call         | function:param1:param2:... |                         | Calling a callback function. The function can be defined in three places: either globally, in the context `addCallback` or in the passed object                                                                                                                                                                                                            |\n * | default      | value:type                 | ??                      | If the value is undefined the first argument is returned, otherwise the value. The third optional parameter specifies the desired type. If no type is specified, string is used. Valid types are bool, string, int, float, undefined and object. An object default value must be specified as a base64 encoded json string. (since 1.12.0)                 |\n * | debug        |                            |                         | the passed value is output (console) and returned  |\n * | empty        |                            |                         | Return empty String \"\"                                                                                                                                                                                                                                                                                                                                     |\n * | first-key    | default                    |                         | Can be applied to objects and returns the value of the first key. All keys of the object are fetched and sorted.    (since 1.23.0)                                                                                                                                                                                                                         |\n * | fromjson     |                            |                         | Type conversion from a JSON string (since 1.12.0)                                                                                                                                                                                                                                                                                                          |\n * | if           | statement1:statement2      | ?                       | Is the ternary operator, the first parameter is the valid statement, the second is the false part. To use the current value in the queue, you can set the value keyword. On the other hand, if you want to have the static string \"value\", you have to put one backslash \\\\ in front of it and write value. the follow values are true: 'on', true, 'true'. If you want to have a space, you also have to write \\\\ in front of the space.  |\n * | index        | key:default                | property, key           | Fetches a value from an object, an array, a map or a set                                                                                                                                                                                                                                                                                                   |\n * | last-key     | default                    |                         | Can be applied to objects and returns the value of the last key. All keys of the object are fetched and sorted. (since 1.23.0)                                                                                                                                                                                                                             |\n * | length       |                            | count                   | Length of the string or entries of an array or object                                                                                                                                                                                                                                                                                                      |\n * | nop          |                            |                         | Do nothing                                                                                                                                                                                                                                                                                                                                                 |\n * | nth-key      | index:default              |                         | Can be applied to objects and returns the value of the nth key. All keys of the object are fetched and sorted. (since 1.23.0)                                                                                                                                                                                                                              |\n * | nth-last-key | index:default              |                         | Can be applied to objects and returns the value of the nth key from behind. All keys of the object are fetched and sorted. (since 1.23.0)                                                                                                                                                                                                                  |\n * | path         | path                       |                         | The access to an object is done via a Pathfinder object                                                                                                                                                                                                                                                                                                    |\n * | path-exists  | path                       |                         | Check if the specified path is available in the value (since 1.24.0)    |\n * | plaintext    |                            | plain                   | All HTML tags are removed (*)                                                                                                                                                                                                                                                                                                                              |\n * | prefix       | text                       |                         | Adds a prefix                                                                                                                                                                                                                                                                                                                                              |\n * | rawurlencode |                            |                         | URL coding                                                                                                                                                                                                                                                                                                                                                 |\n * | static       |                            | none                    | The Arguments value is used and passed to the value. Special characters \\ <space> and : can be quotet by a preceding \\.                                                                                                                                                                                                                                    |\n * | substring    | start:length               |                         | Returns a substring                                                                                                                                                                                                                                                                                                                                        |\n * | suffix       | text                       |                         | Adds a suffix                                                                                                                                                                                                                                                                                                                                              |\n * | tointeger    |                            |                         | Type conversion to an integer value                                                                                                                                                                                                                                                                                                                        |\n * | tojson       |                            |                         | Type conversion to a JSON string (since 1.8.0)                                                                                                                                                                                                                                                                                                             |\n * | tolower      |                            | strtolower, tolowercase | The input value is converted to lowercase letters                                                                                                                                                                                                                                                                                                          |\n * | tostring     |                            |                         | Type conversion to a string.                                                                                                                                                                                                                                                                                                                               |\n * | toupper      |                            | strtoupper, touppercase | The input value is converted to uppercase letters                                                                                                                                                                                                                                                                                                          |\n * | trim         |                            |                         | Remove spaces at the beginning and end                                                                                                                                                                                                                                                                                                                     |\n * | ucfirst      |                            |                         | First character large                                                                                                                                                                                                                                                                                                                                      |\n * | ucwords      |                            |                         | Any word beginning large                                                                                                                                                                                                                                                                                                                                   |\n * | undefined    |                            |                         | Return undefined                                                                                                                                                                                                                                                                                                                                           |\n * | uniqid       |                            |                         | Creates a string with a unique value (**)\n *\n *  (*) for this functionality the extension [jsdom](https://www.npmjs.com/package/jsdom) must be loaded in the nodejs context.\n *\n * ```\n *  // polyfill\n *  if (typeof window !== \"object\") {\n *     const {window} = new JSDOM('', {\n *         url: 'http://example.com/',\n *         pretendToBeVisual: true\n *     });\n * \n *     [\n *         'self',\n *         'document',\n *         'Node',\n *         'Element',\n *         'HTMLElement',\n *         'DocumentFragment',\n *         'DOMParser',\n *         'XMLSerializer',\n *         'NodeFilter',\n *         'InputEvent',\n *         'CustomEvent'\n *     ].forEach(key => (global[key] = window[key]));\n * }\n * ```\n *\n * (**) for this command the crypt library is necessary in the nodejs context.\n *\n * ```\n * import * as Crypto from \"@peculiar/webcrypto\";\n * global['crypto'] = new Crypto.Crypto();\n * ```\n *\n * @example\n *\n * import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/data/transformer.js';\n *\n * const transformer = new Transformer(\"tolower\")\n *\n * console.log(transformer.run(\"HELLO\"))\n * // ↦ hello\n *\n * console.log(transformer.run(\"WORLD\"))\n * // ↦ world\n *\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Data\n */\nclass Transformer extends Base {\n    /**\n     *\n     * @param {string} definition\n     */\n    constructor(definition) {\n        super();\n        this.args = disassemble(definition);\n        this.command = this.args.shift()\n        this.callbacks = new Map();\n\n    }\n\n    /**\n     *\n     * @param {string} name\n     * @param {function} callback\n     * @param {object} context\n     * @returns {Transformer}\n     * @throws {TypeError} value is not a string\n     * @throws {TypeError} value is not a function\n     */\n    setCallback(name, callback, context) {\n        validateString(name)\n        validateFunction(callback)\n\n        if (context !== undefined) {\n            validateObject(context);\n        }\n\n        this.callbacks.set(name, {\n            callback: callback,\n            context: context,\n        });\n\n        return this;\n    }\n\n    /**\n     *\n     * @param {*} value\n     * @returns {*}\n     * @throws {Error} unknown command\n     * @throws {TypeError} unsupported type\n     * @throws {Error} type not supported\n     */\n    run(value) {\n        return transform.apply(this, [value])\n    }\n}\n\nassignToNamespace('Monster.Data', Transformer);\nexport {Monster, Transformer}\n\n/**\n *\n * @param {string} command\n * @returns {array}\n * @private\n */\nfunction disassemble(command) {\n\n    validateString(command);\n\n    let placeholder = new Map;\n    const regex = /((?<pattern>\\\\(?<char>.)){1})/mig;\n\n    // The separator for args must be escaped\n    // undefined string which should not occur normally and is also not a regex\n    let result = command.matchAll(regex)\n\n    for (let m of result) {\n        let g = m?.['groups'];\n        if (!isObject(g)) {\n            continue;\n        }\n\n        let p = g?.['pattern'];\n        let c = g?.['char'];\n\n        if (p && c) {\n            let r = '__' + new ID().toString() + '__';\n            placeholder.set(r, c);\n            command = command.replace(p, r);\n        }\n\n    }\n    let parts = command.split(':');\n\n    parts = parts.map(function (value) {\n        let v = value.trim();\n        for (let k of placeholder) {\n            v = v.replace(k[0], k[1]);\n        }\n        return v;\n\n\n    });\n\n    return parts\n}\n\n/**\n * tries to make a string out of value and if this succeeds to return it back\n *\n * @param {*} value\n * @returns {string}\n * @private\n */\nfunction convertToString(value) {\n\n    if (isObject(value) && value.hasOwnProperty('toString')) {\n        value = value.toString();\n    }\n\n    validateString(value)\n    return value;\n}\n\n/**\n *\n * @param {*} value\n * @returns {*}\n * @private\n * @throws {Error} unknown command\n * @throws {TypeError} unsupported type\n * @throws {Error} type not supported\n * @throws {Error} missing key parameter\n */\nfunction transform(value) {\n\n    const console = getGlobalObject('console');\n\n    let args = clone(this.args);\n    let key, defaultValue;\n\n    switch (this.command) {\n\n        case 'static':\n            return this.args.join(':');\n\n        case 'tolower':\n        case 'strtolower':\n        case 'tolowercase':\n            validateString(value)\n            return value.toLowerCase();\n\n        case 'toupper':\n        case 'strtoupper':\n        case 'touppercase':\n            validateString(value)\n            return value.toUpperCase();\n\n        case 'tostring':\n            return \"\" + value;\n\n        case 'tointeger':\n            let n = parseInt(value);\n            validateInteger(n);\n            return n\n\n        case 'tojson':\n            return JSON.stringify(value);\n\n        case 'fromjson':\n            return JSON.parse(value);\n\n        case 'trim':\n            validateString(value)\n            return value.trim();\n\n        case 'rawurlencode':\n            validateString(value)\n            return encodeURIComponent(value)\n                .replace(/!/g, '%21')\n                .replace(/'/g, '%27')\n                .replace(/\\(/g, '%28')\n                .replace(/\\)/g, '%29')\n                .replace(/\\*/g, '%2A');\n\n\n        case  'call':\n\n            /**\n             * callback-definition\n             * function callback(value, ...args) {\n             *   return value;\n             * }\n             */\n\n            let callback;\n            let callbackName = args.shift();\n            let context = getGlobal();\n\n            if (isObject(value) && value.hasOwnProperty(callbackName)) {\n                callback = value[callbackName];\n            } else if (this.callbacks.has(callbackName)) {\n                let s = this.callbacks.get(callbackName);\n                callback = s?.['callback'];\n                context = s?.['context'];\n            } else if (typeof window === 'object' && window.hasOwnProperty(callbackName)) {\n                callback = window[callbackName];\n            }\n            validateFunction(callback);\n\n            args.unshift(value);\n            return callback.call(context, ...args);\n\n        case  'plain':\n        case  'plaintext':\n            validateString(value);\n            let doc = new DOMParser().parseFromString(value, 'text/html');\n            return doc.body.textContent || \"\";\n\n        case  'if':\n        case  '?':\n\n            validatePrimitive(value);\n\n            let trueStatement = (args.shift() || undefined);\n            let falseStatement = (args.shift() || undefined);\n\n            if (trueStatement === 'value') {\n                trueStatement = value;\n            }\n            if (trueStatement === '\\\\value') {\n                trueStatement = 'value';\n            }\n            if (falseStatement === 'value') {\n                falseStatement = value;\n            }\n            if (falseStatement === '\\\\value') {\n                falseStatement = 'value';\n            }\n\n            let condition = ((value !== undefined && value !== '' && value !== 'off' && value !== 'false' && value !== false) || value === 'on' || value === 'true' || value === true);\n            return condition ? trueStatement : falseStatement;\n\n\n        case 'ucfirst':\n            validateString(value);\n\n            let firstchar = value.charAt(0).toUpperCase();\n            return firstchar + value.substr(1);\n        case 'ucwords':\n            validateString(value);\n\n            return value.replace(/^([a-z\\u00E0-\\u00FC])|\\s+([a-z\\u00E0-\\u00FC])/g, function (v) {\n                return v.toUpperCase();\n            });\n\n        case  'count':\n        case  'length':\n\n            if ((isString(value) || isObject(value) || isArray(value)) && value.hasOwnProperty('length')) {\n                return value.length;\n            }\n\n            throw new TypeError(\"unsupported type \" + typeof value);\n\n        case 'to-base64':\n        case 'btoa':\n        case 'base64':\n            return btoa(convertToString(value));\n\n        case 'atob':\n        case 'from-base64':\n            return atob(convertToString(value));\n\n        case 'empty':\n            return '';\n\n        case 'undefined':\n            return undefined;\n\n        case 'debug':\n\n            if (isObject(console)) {\n                console.log(value);\n            }\n\n            return value;\n\n        case 'prefix':\n            validateString(value);\n            let prefix = args?.[0];\n            return prefix + value;\n\n        case 'suffix':\n            validateString(value);\n            let suffix = args?.[0];\n            return value + suffix;\n\n        case 'uniqid':\n            return (new ID()).toString();\n\n        case 'first-key':\n        case 'last-key':\n        case 'nth-last-key':\n        case 'nth-key':\n\n            if (!isObject(value)) {\n                throw new Error(\"type not supported\")\n            }\n\n            const keys = Object.keys(value).sort()\n\n            if (this.command === 'first-key') {\n                key = 0;\n            } else if (this.command === 'last-key') {\n                key = keys.length - 1;\n            } else {\n\n                key = validateInteger(parseInt(args.shift()));\n\n                if (this.command === 'nth-last-key') {\n                    key = keys.length - key - 1;\n                }\n            }\n\n            defaultValue = (args.shift() || '');\n\n            let useKey = keys?.[key];\n\n            if (value?.[useKey]) {\n                return value?.[useKey];\n            }\n\n            return defaultValue;\n\n\n        case 'key':\n        case 'property':\n        case 'index':\n\n            key = args.shift() || undefined;\n\n            if (key === undefined) {\n                throw new Error(\"missing key parameter\")\n            }\n\n            defaultValue = (args.shift() || undefined);\n\n            if (value instanceof Map) {\n                if (!value.has(key)) {\n                    return defaultValue;\n                }\n                return value.get(key);\n            }\n\n            if (isObject(value) || isArray(value)) {\n\n                if (value?.[key]) {\n                    return value?.[key];\n                }\n\n                return defaultValue;\n            }\n\n            throw new Error(\"type not supported\")\n\n        case 'path-exists':\n\n            key = args.shift();\n            if (key === undefined) {\n                throw new Error(\"missing key parameter\")\n            }\n\n            return new Pathfinder(value).exists(key);\n\n        case 'path':\n\n            key = args.shift();\n            if (key === undefined) {\n                throw new Error(\"missing key parameter\")\n            }\n\n            let pf = new Pathfinder(value);\n\n            if (!pf.exists(key)) {\n                return undefined;\n            }\n\n            return pf.getVia(key);\n\n\n        case 'substring':\n\n            validateString(value);\n\n            let start = parseInt(args[0]) || 0;\n            let end = (parseInt(args[1]) || 0) + start;\n\n            return value.substring(start, end);\n\n        case 'nop':\n            return value;\n\n        case  '??':\n        case 'default':\n            if (value !== undefined && value !== null) {\n                return value;\n            }\n\n            defaultValue = args.shift();\n            let defaultType = args.shift();\n            if (defaultType === undefined) {\n                defaultType = 'string';\n            }\n\n            switch (defaultType) {\n                case 'int':\n                case 'integer':\n                    return parseInt(defaultValue);\n                case 'float':\n                    return parseFloat(defaultValue);\n                case 'undefined':\n                    return undefined\n                case 'bool':\n                case 'boolean':\n                    defaultValue = defaultValue.toLowerCase()\n                    return ((defaultValue !== 'undefined' && defaultValue !== '' && defaultValue !== 'off' && defaultValue !== 'false' && defaultValue !== 'false') || defaultValue === 'on' || defaultValue === 'true' || defaultValue === 'true');\n                case 'string':\n                    return \"\" + defaultValue;\n                case \"object\":\n                    return JSON.parse(atob(defaultValue));\n            }\n\n            throw new Error(\"type not supported\")\n\n\n        default:\n            throw new Error(\"unknown command \" + this.command)\n    }\n\n    return value;\n}\n\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from './base.js';\nimport {validateString} from \"./validate.js\";\n\n/**\n * @private\n * @type {Map<string, integer>}\n */\nlet internalCounter = new Map;\n\n/**\n * With the id class, sequences of ids can be created. for this purpose, an internal counter is incremented for each prefix.\n * thus, the first id with the prefix `myid` will be `myid1` and the second id `myid2`.\n * The ids are the same for every call, for example on a web page.\n *\n * So the ids can also be used for navigation. you just have to take care that the order stays the same.\n *\n * You can call the method via the monster namespace `new Monster.Types.ID()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Types.ID())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/id.js';\n * console.log(new ID())\n * </script>\n * ```\n *\n * As of version 1.6.0 there is the new RandomID. this ID class is continuous from now on.\n *\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @summary Automatic generation of ids\n */\nclass ID extends Base {\n\n    /**\n     * create new id with prefix\n     *\n     * @param {string} prefix\n     */\n    constructor(prefix) {\n        super();\n\n        if (prefix === undefined) {\n            prefix = \"id\";\n        }\n\n        validateString(prefix);\n\n        if (!internalCounter.has(prefix)) {\n            internalCounter.set(prefix, 1);\n        }\n\n        let count = internalCounter.get(prefix);\n        this.id = prefix + count;\n\n        internalCounter.set(prefix, ++count);\n    }\n\n    /**\n     * @return {string}\n     */\n    toString() {\n        return this.id;\n    }\n\n}\n\nassignToNamespace('Monster.Types', ID);\nexport {Monster, ID}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {getGlobalFunction} from \"../types/global.js\";\nimport {ProxyObserver} from \"../types/proxyobserver.js\";\nimport {validateInstance, validateString} from \"../types/validate.js\";\n\n\n/**\n * attribute prefix\n *\n * @type {string}\n * @memberOf Monster.DOM\n */\nconst ATTRIBUTEPREFIX = \"data-monster-\";\n\n/**\n * you can call the method via the monster namespace `new Monster.DOM.Assembler()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.DOM.Assembler())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Assembler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/assembler.js';\n * console.log(new Assembler())\n * </script>\n * ```\n *\n * @since 1.6.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @summary Allows you to build an html fragment\n */\nclass Assembler extends Base {\n\n    /**\n     * @param {DocumentFragment} fragment\n     * @throws {TypeError} value is not an instance of\n     * @throws {TypeError} value is not a function\n     * @throws {Error} the function is not defined\n     */\n    constructor(fragment) {\n        super();\n        this.attributePrefix = ATTRIBUTEPREFIX;\n        validateInstance(fragment, getGlobalFunction('DocumentFragment'));\n        this.fragment = fragment;\n    }\n\n    /**\n     *\n     * @param {string} prefix\n     * @returns {Assembler}\n     * @throws {TypeError} value is not a string\n     */\n    setAttributePrefix(prefix) {\n        validateString(prefix);\n        this.attributePrefix = prefix;\n        return this;\n    }\n\n    /**\n     *\n     * @returns {string}\n     */\n    getAttributePrefix() {\n        return this.attributePrefix;\n    }\n\n    /**\n     *\n     * @param {ProxyObserver|undefined} data\n     * @return {DocumentFragment}\n     * @throws {TypeError} value is not an instance of\n     */\n    createDocumentFragment(data) {\n\n        if (data === undefined) {\n            data = new ProxyObserver({});\n        }\n\n        validateInstance(data, ProxyObserver);\n        let fragment = this.fragment.cloneNode(true);\n        return fragment;\n    }\n\n}\n\nassignToNamespace('Monster.DOM', Assembler);\nexport {Monster, ATTRIBUTEPREFIX, Assembler}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from './base.js';\nimport {isArray, isObject, isPrimitive} from \"./is.js\";\nimport {Observer} from \"./observer.js\";\nimport {ObserverList} from \"./observerlist.js\";\nimport {validateObject} from \"./validate.js\";\nimport {extend} from \"../data/extend.js\";\n\n/**\n * An observer manages a callback function\n *\n * You can call create the class via the monster namespace `new Monster.Types.ProxyObserver()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.ProxyObserver()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this class individually.\n *\n * ```\n * <script type=\"module\">\n * import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/proxyobserver.js';\n * new ProxyObserver()\n * </script>\n * ```\n *\n * with the ProxyObserver you can attach observer for observation. with each change at the object to be observed an update takes place.\n *\n * this also applies to nested objects.\n *\n * @example\n *\n * import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/proxyobserver.js';\n * import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/observer.js';\n * import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/is.js';\n *\n * const o = new Observer(function () { \n *   if (isObject(this) && this instanceof ProxyObserver) {\n *       // do something (this ist ProxyObserver)\n *       const subject = this.getSubject();\n *       console.log(subject);\n *   }\n * });\n *\n * let realSubject = {\n *   a: {\n *       b: {\n *           c: true\n *       },\n *       d: 9\n *   }\n * }\n *\n * const p = new ProxyObserver(realSubject);\n * p.attachObserver(o);\n * const s = p.getSubject();\n * s.a.b.c = false;\n *\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass ProxyObserver extends Base {\n\n    /**\n     *\n     * @param {object} object\n     * @throws {TypeError} value is not a object\n     */\n    constructor(object) {\n        super();\n\n        this.realSubject = validateObject(object);\n        this.subject = new Proxy(object, getHandler.call(this));\n\n        this.objectMap = new WeakMap();\n        this.objectMap.set(this.realSubject, this.subject);\n\n        this.proxyMap = new WeakMap();\n        this.proxyMap.set(this.subject, this.realSubject);\n\n        this.observers = new ObserverList;\n    }\n\n    /**\n     * get the real object\n     *\n     * changes to this object are not noticed by the observers, so you can make a large number of changes and inform the observers later.\n     *\n     * @returns {object}\n     */\n    getSubject() {\n        return this.subject\n    }\n\n    /**\n     * @since 1.24.0\n     * @param {Object} obj\n     * @return {Monster.Types.ProxyObserver}\n     */\n    setSubject(obj) {\n\n        let i, k = Object.keys(this.subject);\n        for (i = 0; i < k.length; i++) {\n            delete this.subject[k[i]];\n        }\n\n        this.subject = extend(this.subject, obj);\n        return this;\n    }\n\n    /**\n     * get the proxied object\n     *\n     * @returns {object}\n     */\n    getRealSubject() {\n        return this.realSubject\n    }\n\n    /**\n     * attach a new observer\n     *\n     * @param {Observer} observer\n     * @returns {ProxyObserver}\n     */\n    attachObserver(observer) {\n        this.observers.attach(observer)\n        return this;\n    }\n\n    /**\n     * detach a observer\n     *\n     * @param {Observer} observer\n     * @returns {ProxyObserver}\n     */\n    detachObserver(observer) {\n        this.observers.detach(observer)\n        return this;\n    }\n\n    /**\n     * notify all observer\n     *\n     * @returns {Promise}\n     */\n    notifyObservers() {\n        return this.observers.notify(this);\n    }\n\n    /**\n     * @param {Observer} observer\n     * @returns {boolean}\n     */\n    containsObserver(observer) {\n        return this.observers.contains(observer)\n    }\n\n}\n\nassignToNamespace('Monster.Types', ProxyObserver);\nexport {Monster, ProxyObserver}\n\n/**\n *\n * @returns {{defineProperty: (function(*=, *=, *=): *), setPrototypeOf: (function(*, *=): boolean), set: (function(*, *, *, *): boolean), get: ((function(*=, *=, *=): (undefined))|*), deleteProperty: ((function(*, *): (boolean))|*)}}\n * @private\n * @see {@link https://gitlab.schukai.com/-/snippets/49}\n */\nfunction getHandler() {\n\n    const proxy = this;\n\n    // https://262.ecma-international.org/9.0/#sec-proxy-object-internal-methods-and-internal-slots\n    const handler = {\n\n        // https://262.ecma-international.org/9.0/#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiver\n        get: function (target, key, receiver) {\n\n            const value = Reflect.get(target, key, receiver);\n\n            if (typeof key === \"symbol\") {\n                return value;\n            }\n\n            if (isPrimitive(value)) {\n                return value;\n            }\n\n            // set value as proxy if object or array\n            if ((isArray(value) || isObject(value))) {\n                if (proxy.objectMap.has(value)) {\n                    return proxy.objectMap.get(value);\n                } else if (proxy.proxyMap.has(value)) {\n                    return value;\n                } else {\n                    let p = new Proxy(value, handler);\n                    proxy.objectMap.set(value, p);\n                    proxy.proxyMap.set(p, value);\n                    return p;\n                }\n\n            }\n\n            return value;\n\n        },\n\n        // https://262.ecma-international.org/9.0/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver \n        set: function (target, key, value, receiver) {\n\n            if (proxy.proxyMap.has(value)) {\n                value = proxy.proxyMap.get(value);\n            }\n\n            if (proxy.proxyMap.has(target)) {\n                target = proxy.proxyMap.get(target);\n            }\n\n            let current = Reflect.get(target, key, receiver);\n            if (proxy.proxyMap.has(current)) {\n                current = proxy.proxyMap.get(current);\n            }\n\n            if (current === value) {\n                return true;\n            }\n\n            let result;\n            let descriptor = Reflect.getOwnPropertyDescriptor(target, key);\n\n            if (descriptor === undefined) {\n                descriptor = {\n                    writable: true,\n                    enumerable: true,\n                    configurable: true\n                }\n            }\n\n            descriptor['value'] = value;\n            result = Reflect.defineProperty(target, key, descriptor);\n\n            if (typeof key !== \"symbol\") {\n                proxy.observers.notify(proxy);\n            }\n\n            return result;\n        },\n\n\n        // https://262.ecma-international.org/9.0/#sec-proxy-object-internal-methods-and-internal-slots-delete-p\n        deleteProperty: function (target, key) {\n            if (key in target) {\n                delete target[key];\n\n                if (typeof key !== \"symbol\") {\n                    proxy.observers.notify(proxy);\n                }\n\n                return true;\n            }\n            return false;\n        },\n\n        // https://262.ecma-international.org/9.0/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc\n        defineProperty: function (target, key, descriptor) {\n\n            let result = Reflect.defineProperty(target, key, descriptor);\n            if (typeof key !== \"symbol\") {\n                proxy.observers.notify(proxy);\n            }\n            return result;\n        },\n\n        // https://262.ecma-international.org/9.0/#sec-proxy-object-internal-methods-and-internal-slots-setprototypeof-v\n        setPrototypeOf: function (target, key) {\n            let result = Reflect.setPrototypeOf(object1, key);\n\n            if (typeof key !== \"symbol\") {\n                proxy.observers.notify(proxy);\n            }\n\n            return result;\n        }\n\n    };\n\n\n    return handler;\n}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from './base.js';\nimport {isObject} from './is.js';\nimport {TokenList} from './tokenlist.js';\nimport {UniqueQueue} from './uniquequeue.js';\n\n/**\n * An observer manages a callback function\n *\n * You can call the method via the monster namespace `new Monster.Types.Observer()`.\n *\n * ```\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.Observer()\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/observer.js';\n * new Observer()\n * ```\n *\n * The update method is called with the subject object as this pointer. For this reason the callback should not\n * be an arrow function, because it gets the this pointer of its own context.\n *\n * ```\n * new Observer(()=>{\n *     // this is not subject\n * })\n *\n * new Observer(function() {\n *     // this is subject\n * })\n * ```\n *\n * Additional arguments can be passed to the callback. To do this, simply specify them.\n *\n * ```\n * Observer(function(a, b, c) {\n *     console.log(a, b, c); // ↦ \"a\", 2, true \n * }, \"a\", 2, true)\n * ```\n *\n * The callback function must have as many parameters as arguments are given.\n *\n * @example\n *\n * import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/observer.js';\n *\n * const observer = new Observer(function(a, b, c) {\n *      console.log(this, a, b, c); // ↦ \"a\", 2, true \n * }, \"a\", 2, true);\n *\n * observer.update({value:true}).then(()=>{});\n * // ↦ {value: true} \"a\" 2 true\n *\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass Observer extends Base {\n\n    /**\n     *\n     * @param {function} callback\n     * @param {*} args\n     */\n    constructor(callback, ...args) {\n        super();\n\n        if (typeof callback !== 'function') {\n            throw new Error(\"observer callback must be a function\")\n        }\n\n        this.callback = callback;\n        this.arguments = args;\n        this.tags = new TokenList;\n        this.queue = new UniqueQueue();\n    }\n\n    /**\n     *\n     * @param {string} tag\n     * @returns {Observer}\n     */\n    addTag(tag) {\n        this.tags.add(tag);\n        return this;\n    }\n\n    /**\n     *\n     * @param {string} tag\n     * @returns {Observer}\n     */\n    removeTag(tag) {\n        this.tags.remove(tag);\n        return this;\n    }\n\n    /**\n     *\n     * @returns {Array}\n     */\n    getTags() {\n        return this.tags.entries()\n    }\n\n    /**\n     *\n     * @param {string} tag\n     * @returns {boolean}\n     */\n    hasTag(tag) {\n        return this.tags.contains(tag)\n    }\n\n    /**\n     *\n     * @param {object} subject\n     * @returns {Promise}\n     */\n    update(subject) {\n        let self = this;\n\n        return new Promise(function (resolve, reject) {\n            if (!isObject(subject)) {\n                reject(\"subject must be an object\");\n                return;\n            }\n\n            self.queue.add(subject);\n\n            setTimeout(() => {\n\n                try {\n                    // the queue and the settimeout ensure that an object is not \n                    // informed of the same change more than once.\n                    if (self.queue.isEmpty()) {\n                        resolve();\n                        return;\n                    }\n\n                    let s = self.queue.poll();\n                    let result = self.callback.apply(s, self.arguments);\n\n                    if (isObject(result) && result instanceof Promise) {\n                        result.then(resolve).catch(reject);\n                        return;\n                    }\n\n                    resolve(result);\n\n                } catch (e) {\n                    reject(e);\n                }\n            }, 0)\n\n        });\n\n    };\n\n}\n\nassignToNamespace('Monster.Types', Observer);\nexport {Monster, Observer}\n\n\n\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {isIterable, isString} from '../types/is.js';\nimport {validateFunction, validateString} from '../types/validate.js';\nimport {Base} from './base.js';\n\n/**\n * A tokenlist allows you to manage tokens (individual character strings such as css classes in an attribute string).\n *\n * The tokenlist offers various functions to manipulate values. For example, you can add, remove or replace a class in a CSS list.\n *\n * You can call the method via the monster namespace `new Monster.Types.TokenList()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.TokenList(\"myclass row\")\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {TokenList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/tokenlist.js';\n * new TokenList(\"myclass row\")\n * </script>\n * ```\n *\n * This class implements the [iteration protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).\n *\n * ```\n * typeof new TokenList(\"myclass row\")[Symbol.iterator]; \n * // ↦ \"function\"\n * ```\n *\n * @since 1.2.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass TokenList extends Base {\n\n    /**\n     *\n     * @param {array|string|iteratable} init\n     */\n    constructor(init) {\n        super();\n        this.tokens = new Set();\n\n        if (typeof init !== \"undefined\") {\n            this.add(init);\n        }\n\n    }\n\n    /**\n     * Iterator protocol\n     *\n     * @returns {Symbol.iterator}\n     */\n    getIterator() {\n        return this[Symbol.iterator]();\n    }\n\n    /**\n     * Iterator\n     *\n     * @returns {{next: ((function(): ({value: *, done: boolean}))|*)}}\n     */\n    [Symbol.iterator]() {\n        // Use a new index for each iterator. This makes multiple\n        // iterations over the iterable safe for non-trivial cases,\n        // such as use of break or nested looping over the same iterable.\n        let index = 0;\n        let entries = this.entries()\n\n        return {\n            next: () => {\n                if (index < entries.length) {\n                    return {value: entries?.[index++], done: false}\n                } else {\n                    return {done: true}\n                }\n            }\n        }\n    }\n\n    /**\n     * Returns true if it contains token, otherwise false\n     *\n     * ```\n     * new TokenList(\"start middle end\").contains('start')); // ↦ true\n     * new TokenList(\"start middle end\").contains('end')); // ↦ true\n     * new TokenList(\"start middle end\").contains('xyz')); // ↦ false\n     * new TokenList(\"start middle end\").contains(['end','start','middle'])); // ↦ true\n     * new TokenList(\"start middle end\").contains(['end','start','xyz'])); // ↦ false\n     * ```\n     *\n     * @param {array|string|iteratable} value\n     * @returns {boolean}\n     */\n    contains(value) {\n        if (isString(value)) {\n            value = value.trim()\n            let counter = 0;\n            value.split(\" \").forEach(token => {\n                if (this.tokens.has(token.trim()) === false) return false;\n                counter++\n            })\n            return counter > 0 ? true : false;\n        }\n\n        if (isIterable(value)) {\n            let counter = 0;\n            for (let token of value) {\n                validateString(token);\n                if (this.tokens.has(token.trim()) === false) return false;\n                counter++\n            }\n            return counter > 0 ? true : false;\n        }\n\n        return false;\n    }\n\n    /**\n     * add tokens\n     *\n     * ```\n     * new TokenList().add(\"abc xyz\").toString(); // ↦ \"abc xyz\"\n     * new TokenList().add([\"abc\",\"xyz\"]).toString(); // ↦ \"abc xyz\"\n     * new TokenList().add(undefined); // ↦ add nothing\n     * ```\n     *\n     * @param {array|string|iteratable} value\n     * @returns {TokenList}\n     * @throws {TypeError} unsupported value\n     */\n    add(value) {\n        if (isString(value)) {\n            value.split(\" \").forEach(token => {\n                this.tokens.add(token.trim());\n            })\n        } else if (isIterable(value)) {\n            for (let token of value) {\n                validateString(token);\n                this.tokens.add(token.trim());\n            }\n        } else if (typeof value !== \"undefined\") {\n            throw new TypeError(\"unsupported value\");\n        }\n\n        return this;\n    }\n\n    /**\n     * remove all tokens\n     *\n     * @returns {TokenList}\n     */\n    clear() {\n        this.tokens.clear();\n        return this;\n    }\n\n    /**\n     * Removes token\n     *\n     * ```\n     * new TokenList(\"abc xyz\").remove(\"xyz\").toString(); // ↦ \"abc\"\n     * new TokenList(\"abc xyz\").remove([\"xyz\"]).toString(); // ↦ \"abc\"\n     * new TokenList(\"abc xyz\").remove(undefined); // ↦ remove nothing\n     * ```\n     *\n     * @param {array|string|iteratable} value\n     * @returns {TokenList}\n     * @throws {TypeError} unsupported value\n     */\n    remove(value) {\n        if (isString(value)) {\n            value.split(\" \").forEach(token => {\n                this.tokens.delete(token.trim());\n            })\n        } else if (isIterable(value)) {\n            for (let token of value) {\n                validateString(token);\n                this.tokens.delete(token.trim());\n            }\n        } else if (typeof value !== \"undefined\") {\n            throw new TypeError(\"unsupported value\", \"types/tokenlist.js\");\n        }\n\n        return this;\n    }\n\n    /**\n     * this method replaces a token with a new token.\n     *\n     * if the passed token exists, it is replaced with newToken and TokenList is returned.\n     * if the token does not exist, newToken is not set and TokenList is returned.\n     *\n     * @param {string} token\n     * @param {string} newToken\n     * @returns {TokenList}\n     */\n    replace(token, newToken) {\n        validateString(token);\n        validateString(newToken);\n        if (!this.contains(token)) {\n            return this;\n        }\n\n        let a = Array.from(this.tokens)\n        let i = a.indexOf(token);\n        if (i === -1) return this;\n\n        a.splice(i, 1, newToken);\n        this.tokens = new Set();\n        this.add(a);\n\n        return this;\n\n\n    }\n\n    /**\n     * Removes token from string. If token doesn't exist it's added.\n     *\n     * ```\n     * new TokenList(\"abc def ghi\").toggle(\"def xyz\").toString(); // ↦ \"abc ghi xyz\"\n     * new TokenList(\"abc def ghi\").toggle([\"abc\",\"xyz\"]).toString(); // ↦ \"def ghi xyz\"\n     * new TokenList().toggle(undefined); // ↦ nothing\n     * ```\n     *\n     * @param {array|string|iteratable} value\n     * @returns {boolean}\n     * @throws {TypeError} unsupported value\n     */\n    toggle(value) {\n\n        if (isString(value)) {\n            value.split(\" \").forEach(token => {\n                toggleValue.call(this, token);\n            })\n        } else if (isIterable(value)) {\n            for (let token of value) {\n                toggleValue.call(this, token);\n            }\n        } else if (typeof value !== \"undefined\") {\n            throw new TypeError(\"unsupported value\", \"types/tokenlist.js\");\n        }\n\n        return this;\n\n    }\n\n    /**\n     * returns an array with all tokens\n     *\n     * @returns {array}\n     */\n    entries() {\n        return Array.from(this.tokens)\n    }\n\n    /**\n     * executes the provided function with each value of the set\n     *\n     * @param {function} callback\n     * @returns {TokenList}\n     */\n    forEach(callback) {\n        validateFunction(callback);\n        this.tokens.forEach(callback);\n        return this;\n    }\n\n    /**\n     * returns the individual tokens separated by a blank character\n     *\n     * @returns {string}\n     */\n    toString() {\n        return this.entries().join(' ');\n    }\n\n}\n\n/**\n * @private\n * @param token\n * @returns {toggleValue}\n * @throws {Error} must be called with TokenList.call\n */\nfunction toggleValue(token) {\n    if (!(this instanceof TokenList)) throw Error(\"must be called with TokenList.call\")\n    validateString(token);\n    token = token.trim();\n    if (this.contains(token)) {\n        this.remove(token);\n        return this;\n    }\n    this.add(token);\n    return this;\n}\n\nassignToNamespace('Monster.Types', TokenList);\nexport {Monster, TokenList}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Queue} from \"./queue.js\";\nimport {validateObject} from \"./validate.js\";\n\n/**\n * You can call the method via the monster namespace `new Monster.Types.Queue()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.UniqueQueue()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {UniqueQueue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/uniquequeue.js';\n * new UniqueQueue()\n * </script>\n * ```\n *\n * @since 1.4.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @summary A queue for unique values\n */\nclass UniqueQueue extends Queue {\n\n    /**\n     *\n     */\n    constructor() {\n        super();\n        this.unique = new WeakSet();\n    }\n\n    /**\n     * Add a new element to the end of the queue.\n     *\n     * @param {object} value\n     * @returns {Queue}\n     * @throws {TypeError} value is not a object\n     */\n    add(value) {\n\n        validateObject(value);\n\n        if (!this.unique.has(value)) {\n            this.unique.add(value);\n            super.add(value);\n        }\n\n        return this;\n    }\n\n    /**\n     * remove all entries\n     *\n     * @returns {Queue}\n     */\n    clear() {\n        super.clear();\n        this.unique = new WeakSet;\n        return this;\n    }\n\n    /**\n     * Remove the element at the front of the queue\n     * If the queue is empty, return undefined.\n     *\n     * @return {object}\n     */\n    poll() {\n\n        if (this.isEmpty()) {\n            return undefined;\n        }\n        let value = this.data.shift();\n        this.unique.delete(value);\n        return value;\n    }\n\n\n}\n\nassignToNamespace('Monster.Types', UniqueQueue);\nexport {Monster, UniqueQueue}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from './base.js';\n\n/**\n * You can create the instance via the monster namespace `new Monster.Types.Queue()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.Queue()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Queue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/queue.js';\n * new Queue()\n * </script>\n * ```\n *\n * @example\n *\n * import {Queue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/queue.js';\n *\n * const queue = new Queue;\n *\n * queue.add(2);\n * queue.add(true);\n * queue.add(\"Hello\");\n * queue.add(4.5);\n *\n * console.log(queue.poll());\n * // ↦ 2\n * console.log(queue.poll());\n * // ↦ true\n * console.log(queue.poll());\n * // ↦ \"Hello\"\n * console.log(queue.poll());\n * // ↦ 4.5\n * console.log(queue.poll());\n * // ↦ undefined\n *\n *\n * @since 1.4.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @summary A Queue (Fifo)\n */\nclass Queue extends Base {\n\n    /**\n     *\n     */\n    constructor() {\n        super();\n        this.data = [];\n    }\n\n\n    /**\n     * @return {boolean}\n     */\n    isEmpty() {\n        return this.data.length === 0;\n    }\n\n    /**\n     * Read the element at the front of the queue without removing it.\n     *\n     * @return {*}\n     */\n    peek() {\n        if (this.isEmpty()) {\n            return undefined;\n        }\n\n        return this.data[0];\n    }\n\n    /**\n     * Add a new element to the end of the queue.\n     *\n     * @param {*} value\n     * @returns {Queue}\n     */\n    add(value) {\n        this.data.push(value)\n        return this;\n    }\n\n    /**\n     * remove all entries\n     *\n     * @returns {Queue}\n     */\n    clear() {\n        this.data = [];\n        return this;\n    }\n\n    /**\n     * Remove the element at the front of the queue\n     * If the queue is empty, return undefined.\n     *\n     * @return {*}\n     */\n    poll() {\n        if (this.isEmpty()) {\n            return undefined;\n        }\n        return this.data.shift();\n    }\n\n\n}\n\nassignToNamespace('Monster.Types', Queue);\nexport {Monster, Queue}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from './base.js';\nimport {Observer} from \"./observer.js\";\nimport {validateInstance} from \"./validate.js\";\n\n/**\n * With the help of the ObserverList class, observer can be managed.\n *\n * You can call the method via the monster namespace `new Monster.Types.ObserverList()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Types.ObserverList())\n * console.log(new Monster.Types.ObserverList())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {ObserverList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/observerlist.js';\n * console.log(ObserverList())\n * console.log(ObserverList())\n * </script>\n * ```\n *\n * @since 1.0.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass ObserverList extends Base {\n\n    /**\n     *\n     */\n    constructor() {\n        super();\n        this.observers = [];\n    }\n\n    /**\n     *\n     * @param {Observer} observer\n     * @return {ObserverList}\n     * @throws {TypeError} value is not an instance of Observer\n     */\n    attach(observer) {\n        validateInstance(observer, Observer)\n\n        this.observers.push(observer);\n        return this;\n    };\n\n    /**\n     *\n     * @param {Observer} observer\n     * @return {ObserverList}\n     * @throws {TypeError} value is not an instance of Observer\n     */\n    detach(observer) {\n        validateInstance(observer, Observer)\n\n        var i = 0, l = this.observers.length;\n        for (; i < l; i++) {\n            if (this.observers[i] === observer) {\n                this.observers.splice(i, 1);\n            }\n        }\n\n        return this;\n    };\n\n    /**\n     *\n     * @param {Observer} observer\n     * @return {boolean}\n     * @throws {TypeError} value is not an instance of Observer\n     */\n    contains(observer) {\n        validateInstance(observer, Observer)\n        var i = 0, l = this.observers.length;\n        for (; i < l; i++) {\n            if (this.observers[i] === observer) {\n                return true;\n            }\n        }\n        return false;\n    };\n\n    /**\n     *\n     * @param subject\n     * @return {Promise}\n     */\n    notify(subject) {\n\n        let pomises = []\n\n        let i = 0, l = this.observers.length;\n        for (; i < l; i++) {\n            pomises.push(this.observers[i].update(subject));\n        }\n\n        return Promise.all(pomises);\n    };\n\n}\n\nassignToNamespace('Monster.Types', ObserverList);\nexport {Monster, ObserverList}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {getGlobalFunction} from \"../types/global.js\";\nimport {TokenList} from \"../types/tokenlist.js\";\nimport {validateInstance, validateString, validateSymbol} from \"../types/validate.js\";\nimport {ATTRIBUTE_OBJECTLINK} from \"./constants.js\";\n\n/**\n * Get the closest object link of a node\n *\n * if a node is specified without a object link, a recursive search upwards is performed until the corresponding\n * object link is found, or undefined is returned.\n *\n * you can call the method via the monster namespace `Monster.DOM.getUpdaterFromNode()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.DOM.findClosestObjectLink())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getUpdaterFromNode} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/updater.js';\n * console.log(findClosestObjectLink())\n * </script>\n * ```\n *\n * @param {HTMLElement} element\n * @return {HTMLElement|undefined}\n * @since 1.10.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {TypeError} value is not an instance of HTMLElement\n */\nfunction findClosestObjectLink(element) {\n    return findClosestByAttribute(element, ATTRIBUTE_OBJECTLINK);\n}\n\n/**\n * You can call the method via the monster namespace `new Monster.DOM.addToObjectLink()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.addToObjectLink();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {addToObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * addToObjectLink();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {Symbol} symbol\n * @param {Object} object\n * @return {boolean}\n */\nfunction addToObjectLink(element, symbol, object) {\n\n    validateInstance(element, HTMLElement);\n    validateSymbol(symbol)\n\n    if (element?.[symbol] === undefined) {\n        element[symbol] = new Set;\n    }\n\n    addAttributeToken(element, ATTRIBUTE_OBJECTLINK, symbol.toString());\n    element[symbol].add(object);\n    return element;\n\n}\n\n/**\n * You can call the method via the monster namespace `new Monster.DOM.removeObjectLink()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.removeObjectLink();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {removeObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * removeObjectLink();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {Symbol} symbol\n * @return {boolean}\n */\nfunction removeObjectLink(element, symbol) {\n\n    validateInstance(element, HTMLElement);\n    validateSymbol(symbol)\n\n    if (element?.[symbol] === undefined) {\n        return element\n    }\n\n    removeAttributeToken(element, ATTRIBUTE_OBJECTLINK, symbol.toString());\n    delete element[symbol];\n    return element;\n\n}\n\n\n/**\n * You can call the method via the monster namespace `new Monster.DOM.hasObjectLink()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.hasObjectLink();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {hasObjectLink} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * hasObjectLink();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {Symbol} symbol\n * @return {boolean}\n */\nfunction hasObjectLink(element, symbol) {\n\n    validateInstance(element, HTMLElement);\n    validateSymbol(symbol)\n\n    if (element?.[symbol] === undefined) {\n        return false\n    }\n\n    return containsAttributeToken(element, ATTRIBUTE_OBJECTLINK, symbol.toString());\n\n}\n\n/**\n * The ObjectLink can be used to attach objects to HTMLElements. The elements are kept in a set under a unique\n * symbol and can be read via an iterator {@see {@link getLinkedObjects}}.\n *\n * In addition, elements with an objectLink receive the attribute `data-monster-objectlink`.\n *\n * With the method  {@see {@link addToObjectLink}} the objects can be added.\n *\n * You can call the method via the monster namespace `new Monster.DOM.getLinkedObjects()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.getLinkedObjects();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getLinkedObjects} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * getLinkedObjects();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {Symbol} symbol\n * @return {Iterator}\n * @throws {Error} there is no object link for symbol\n */\nfunction getLinkedObjects(element, symbol) {\n\n    validateInstance(element, HTMLElement);\n    validateSymbol(symbol)\n\n    if (element?.[symbol] === undefined) {\n        throw new Error('there is no object link for ' + symbol.toString());\n    }\n\n    return element?.[symbol][Symbol.iterator]();\n\n}\n\n\n/**\n * With this method tokens in an attribute can be switched on or off. For example, classes can be switched on and off in the elements class attribute.\n *\n * Tokens are always separated by a space.\n *\n * You can call the method via the monster namespace `new Monster.DOM.toggleAttributeToken()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.toggleAttributeToken();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {toggleAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * toggleAttributeToken();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} key\n * @param {string} token\n * @return {HTMLElement}\n */\nfunction toggleAttributeToken(element, key, token) {\n    validateInstance(element, HTMLElement);\n    validateString(token)\n    validateString(key)\n\n    if (!element.hasAttribute(key)) {\n        element.setAttribute(key, token);\n        return element;\n    }\n\n    element.setAttribute(key, new TokenList(element.getAttribute(key)).toggle(token).toString());\n\n    return element\n}\n\n/**\n * This method can be used to add a token to an attribute. Tokens are always separated by a space.\n *\n * You can call the method via the monster namespace `new Monster.DOM.addAttributeToken()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.addAttributeToken();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {addAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * addAttributeToken();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} key\n * @param {string} token\n * @return {HTMLElement}\n */\nfunction addAttributeToken(element, key, token) {\n    validateInstance(element, HTMLElement);\n    validateString(token)\n    validateString(key)\n\n    if (!element.hasAttribute(key)) {\n        element.setAttribute(key, token);\n        return element;\n    }\n\n    element.setAttribute(key, new TokenList(element.getAttribute(key)).add(token).toString());\n\n    return element\n}\n\n/**\n * This function can be used to remove tokens from an attribute.\n *\n * Tokens are always separated by a space.\n *\n * You can call the method via the monster namespace `new Monster.DOM.removeAttributeToken()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.removeAttributeToken();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {removeAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * removeAttributeToken();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} key\n * @param {string} token\n * @return {HTMLElement}\n */\nfunction removeAttributeToken(element, key, token) {\n    validateInstance(element, HTMLElement);\n    validateString(token)\n    validateString(key)\n\n    if (!element.hasAttribute(key)) {\n        return element;\n    }\n\n    element.setAttribute(key, new TokenList(element.getAttribute(key)).remove(token).toString());\n\n    return element\n}\n\n/**\n * This method can be used to determine whether an attribute has a token.\n *\n * Tokens are always separated by a space.\n *\n * You can call the method via the monster namespace `new Monster.DOM.containsAttributeToken()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.containsAttributeToken();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {containsAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * containsAttributeToken();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} key\n * @param {string} token\n * @return {boolean}\n */\nfunction containsAttributeToken(element, key, token) {\n    validateInstance(element, HTMLElement);\n    validateString(token)\n    validateString(key)\n\n    if (!element.hasAttribute(key)) {\n        return false;\n    }\n\n    return new TokenList(element.getAttribute(key)).contains(token);\n\n}\n\n/**\n * Tokens are always separated by a space.\n *\n * You can call the method via the monster namespace `new Monster.DOM.replaceAttributeToken()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.replaceAttributeToken();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {replaceAttributeToken} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * replaceAttributeToken();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} key\n * @param {string} from\n * @param {string} to\n * @return {HTMLElement}\n */\nfunction replaceAttributeToken(element, key, from, to) {\n    validateInstance(element, HTMLElement);\n    validateString(from)\n    validateString(to)\n    validateString(key)\n\n    if (!element.hasAttribute(key)) {\n        return element;\n    }\n\n    element.setAttribute(key, new TokenList(element.getAttribute(key)).replace(from, to).toString());\n\n    return element\n}\n\n/**\n * Tokens are always separated by a space.\n *\n * You can call the method via the monster namespace `new Monster.DOM.clearAttributeTokens()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.clearAttributeTokens();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {clearAttributeTokens} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * clearAttributeTokens();\n * </script>\n * ```\n *\n * @since 1.9.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} key\n * @return {HTMLElement}\n */\nfunction clearAttributeTokens(element, key) {\n    validateInstance(element, HTMLElement);\n    validateString(key)\n\n    if (!element.hasAttribute(key)) {\n        return element;\n    }\n\n    element.setAttribute(key, \"\");\n\n    return element\n}\n\n/**\n * This function searches, starting from an `HTMLElemement`, for the next element that has a certain attribute.\n *\n * ```html\n * <div data-my-attribute=\"2\" id=\"2\">\n *     <div id=\"1\"></div>\n * </div>\n * ```\n *\n * ```javascript\n * // if no value is specified (undefined), then only the attribute is checked.\n * findClosestByAttribute(document.getElementById('1'),'data-my-attribute'); // ↦ node with id 2\n * findClosestByAttribute(document.getElementById('2'),'data-my-attribute'); // ↦ node with id 2\n *\n * // if a value is specified, for example an empty string, then the name and the value are checked.\n * findClosestByAttribute(document.getElementById('1'),'data-my-attribute', '');  // ↦ undefined\n * findClosestByAttribute(document.getElementById('1'),'data-my-attribute', '2'); // ↦ node with id 2\n * ```\n *\n * You can call the method via the monster namespace `new Monster.DOM.findClosestByAttribute()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.findClosestByAttribute();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {findClosestByAttribute} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * findClosestByAttribute();\n * </script>\n * ```\n *\n * @since 1.14.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} key\n * @param {string|undefined} value\n * @return {HTMLElement|undefined}\n * @summary find closest node\n */\nfunction findClosestByAttribute(element, key, value) {\n    validateInstance(element, getGlobalFunction('HTMLElement'));\n\n    if (element.hasAttribute(key)) {\n        if (value === undefined) {\n            return element;\n        }\n\n        if (element.getAttribute(key) === value) {\n            return element;\n        }\n\n    }\n\n    let selector = validateString(key);\n    if (value !== undefined) selector += \"=\" + validateString(value);\n    let result = element.closest('[' + selector + ']');\n    if (result instanceof HTMLElement) {\n        return result;\n    }\n    return undefined;\n}\n\n/**\n * This function searches, starting from an `HTMLElemement`, for the next element that has a certain attribute.\n *\n * ```html\n * <div class=\"myclass\" id=\"2\">\n *     <div id=\"1\"></div>\n * </div>\n * ```\n *\n * ```javascript\n * // if no value is specified (undefined), then only the attribute is checked.\n * findClosestByClass(document.getElementById('1'),'myclass'); // ↦ node with id 2\n * findClosestByClass(document.getElementById('2'),'myclass'); // ↦ node with id 2\n * ```\n *\n * You can call the method via the monster namespace `new Monster.DOM.findClosestByClass()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.findClosestByClass();\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {findClosestByClass} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/attributes.js';\n * findClosestByClass();\n * </script>\n * ```\n *\n * @since 1.27.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @param {HTMLElement} element\n * @param {string} className\n * @return {HTMLElement|undefined}\n * @summary find closest node\n */\nfunction findClosestByClass(element, className) {\n    validateInstance(element, getGlobalFunction('HTMLElement'));\n\n    if (element?.classList?.contains(validateString(className))) {\n        return element;\n    }\n\n    let result = element.closest('.' + className);\n    if (result instanceof HTMLElement) {\n        return result;\n    }\n    \n    return undefined;\n}\n\n// exports\nassignToNamespace('Monster.DOM', findClosestByClass, getLinkedObjects, addToObjectLink, removeObjectLink, findClosestByAttribute, hasObjectLink, clearAttributeTokens, replaceAttributeToken, containsAttributeToken, removeAttributeToken, addAttributeToken, toggleAttributeToken);\nexport {\n    Monster,\n    addToObjectLink,\n    removeObjectLink,\n    hasObjectLink,\n    findClosestByAttribute,\n    clearAttributeTokens,\n    replaceAttributeToken,\n    containsAttributeToken,\n    removeAttributeToken,\n    addAttributeToken,\n    toggleAttributeToken,\n    getLinkedObjects,\n    findClosestObjectLink,\n    findClosestByClass\n}\n","'use strict';\n\nimport {Monster} from '../namespace.js';\n/**\n * @author schukai GmbH\n */\n\n\n/**\n * default theme\n * @memberOf Monster.DOM\n * @type {string}\n */\nconst DEFAULT_THEME = 'monster';\n\n/**\n * @memberOf Monster.DOM\n * @since 1.8.0\n * @type {string}\n */\nconst ATTRIBUTE_PREFIX = 'data-monster-';\n\n/**\n * This is the name of the attribute to pass options to a control\n *\n * @memberOf Monster.DOM\n * @since 1.8.0\n * @type {string}\n */\nconst ATTRIBUTE_OPTIONS = ATTRIBUTE_PREFIX + 'options';\n\n/**\n * This is the name of the attribute to pass options to a control\n *\n * @memberOf Monster.DOM\n * @since 1.30.0\n * @type {string}\n */\nconst ATTRIBUTE_OPTIONS_SELECTOR = ATTRIBUTE_PREFIX + 'options-selector';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.8.0\n */\nconst ATTRIBUTE_THEME_PREFIX = ATTRIBUTE_PREFIX + 'theme-';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n */\nconst ATTRIBUTE_THEME_NAME = ATTRIBUTE_THEME_PREFIX + 'name';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.8.0\n */\nconst ATTRIBUTE_UPDATER_ATTRIBUTES = ATTRIBUTE_PREFIX + 'attributes';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.27.1\n */\nconst ATTRIBUTE_UPDATER_SELECT_THIS = ATTRIBUTE_PREFIX + 'select-this';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.8.0\n */\nconst ATTRIBUTE_UPDATER_REPLACE = ATTRIBUTE_PREFIX + 'replace';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.8.0\n */\nconst ATTRIBUTE_UPDATER_INSERT = ATTRIBUTE_PREFIX + 'insert';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.8.0\n */\nconst ATTRIBUTE_UPDATER_INSERT_REFERENCE = ATTRIBUTE_PREFIX + 'insert-reference';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.8.0\n */\nconst ATTRIBUTE_UPDATER_REMOVE = ATTRIBUTE_PREFIX + 'remove';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.9.0\n */\nconst ATTRIBUTE_UPDATER_BIND = ATTRIBUTE_PREFIX + 'bind';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.27.0\n */\nconst ATTRIBUTE_TEMPLATE_PREFIX = ATTRIBUTE_PREFIX + 'template-prefix';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.14.0\n */\nconst ATTRIBUTE_ROLE = ATTRIBUTE_PREFIX + 'role';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.24.0\n */\nconst ATTRIBUTE_DISABLED = 'disabled';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.24.0\n */\nconst ATTRIBUTE_VALUE = 'value';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.9.0\n */\nconst ATTRIBUTE_OBJECTLINK = ATTRIBUTE_PREFIX + 'objectlink';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.24.0\n */\nconst ATTRIBUTE_ERRORMESSAGE = ATTRIBUTE_PREFIX + 'error';\n\n/**\n * @memberOf Monster.DOM\n * @type {symbol}\n * @since 1.24.0\n */\nconst objectUpdaterLinkSymbol = Symbol('monsterUpdater');\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst TAG_SCRIPT = 'script';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst TAG_STYLE = 'style';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst TAG_LINK = 'link';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\n\nconst ATTRIBUTE_ID = 'id';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\n\nconst ATTRIBUTE_CLASS = 'class';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_TITLE = 'title';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_SRC = 'src';\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_HREF = 'href';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_TYPE = 'type';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_NONCE = 'nonce';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_TRANSLATE = 'translate';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_TABINDEX = 'tabindex';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_SPELLCHECK = 'spellcheck';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_SLOT = 'slot';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_PART = 'part';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_LANG = 'lang';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_ITEMTYPE = 'itemtype';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_ITEMSCOPE = 'itemscope';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_ITEMREF = 'itemref';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_ITEMID = 'itemid';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_ITEMPROP = 'itemprop';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_IS = 'is';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_INPUTMODE = 'inputmode';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_ACCESSKEY = 'accesskey';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_AUTOCAPITALIZE = 'autocapitalize';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_AUTOFOCUS = 'autofocus';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_CONTENTEDITABLE = 'contenteditable';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_DIR = 'dir';\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_DRAGGABLE = 'draggable';\n\n\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_ENTERKEYHINT = 'enterkeyhint';\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_EXPORTPARTS = 'exportparts';\n/**\n * @memberOf Monster.DOM\n * @type {string}\n * @since 1.25.0\n */\nconst ATTRIBUTE_HIDDEN = 'hidden';\n\n\nexport {\n    Monster,\n    ATTRIBUTE_HIDDEN,\n    ATTRIBUTE_EXPORTPARTS,\n    ATTRIBUTE_ENTERKEYHINT,\n    ATTRIBUTE_DRAGGABLE,\n    ATTRIBUTE_DIR,\n    ATTRIBUTE_CONTENTEDITABLE,\n    ATTRIBUTE_AUTOFOCUS,\n    ATTRIBUTE_AUTOCAPITALIZE,\n    ATTRIBUTE_ACCESSKEY,\n    TAG_SCRIPT,\n    TAG_LINK,\n    ATTRIBUTE_INPUTMODE,\n    ATTRIBUTE_IS,\n    ATTRIBUTE_ITEMPROP,\n    ATTRIBUTE_ITEMID,\n    ATTRIBUTE_ITEMREF,\n    ATTRIBUTE_ITEMSCOPE,\n    TAG_STYLE,\n    ATTRIBUTE_ITEMTYPE,\n    ATTRIBUTE_HREF,\n    ATTRIBUTE_LANG,\n    ATTRIBUTE_PART,\n    ATTRIBUTE_SLOT,\n    ATTRIBUTE_SPELLCHECK,\n    ATTRIBUTE_SRC,\n    ATTRIBUTE_TABINDEX,\n    ATTRIBUTE_TRANSLATE,\n    ATTRIBUTE_NONCE,\n    ATTRIBUTE_TYPE,\n    ATTRIBUTE_TITLE,\n    ATTRIBUTE_CLASS,\n    ATTRIBUTE_ID,\n    ATTRIBUTE_PREFIX,\n    ATTRIBUTE_OPTIONS,\n    DEFAULT_THEME,\n    ATTRIBUTE_THEME_PREFIX,\n    ATTRIBUTE_ROLE,\n    ATTRIBUTE_THEME_NAME,\n    ATTRIBUTE_UPDATER_ATTRIBUTES,\n    ATTRIBUTE_UPDATER_REPLACE,\n    ATTRIBUTE_UPDATER_INSERT,\n    ATTRIBUTE_UPDATER_INSERT_REFERENCE,\n    ATTRIBUTE_UPDATER_REMOVE,\n    ATTRIBUTE_UPDATER_BIND,\n    ATTRIBUTE_OBJECTLINK,\n    ATTRIBUTE_DISABLED,\n    ATTRIBUTE_ERRORMESSAGE,\n    ATTRIBUTE_VALUE,\n    objectUpdaterLinkSymbol,\n    ATTRIBUTE_TEMPLATE_PREFIX,\n    ATTRIBUTE_UPDATER_SELECT_THIS,\n    ATTRIBUTE_OPTIONS_SELECTOR\n} ","'use strict';\n\nimport {extend} from \"../data/extend.js\";\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {ATTRIBUTE_VALUE} from \"./constants.js\";\nimport {CustomElement, attributeObserverSymbol} from \"./customelement.js\";\n\n\n/**\n * @private\n * @type {symbol}\n */\nconst attachedInternalSymbol = Symbol('attachedInternal');\n\n/**\n * To define a new HTML control we need the power of CustomElement\n *\n * IMPORTANT: after defining a `CustomElement`, the `registerCustomElement` method must be called\n * with the new class name. only then will the tag defined via the `getTag` method be made known to the DOM.\n *\n * <img src=\"./images/customcontrol-class.png\">\n *\n * This control uses `attachInternals()` to integrate the control into a form.\n * If the target environment does not support this method, the [polyfill](https://www.npmjs.com/package/element-internals-polyfill ) can be used.\n *\n * You can create the object via the function `document.createElement()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * document.createElement('monster-')\n * </script>\n * ```\n *\n * @startuml customcontrol-class.png\n * skinparam monochrome true\n * skinparam shadowing false\n * HTMLElement <|-- CustomElement\n * CustomElement <|-- CustomControl\n * @enduml\n *\n * @summary A base class for customcontrols based on CustomElement\n * @see {@link https://www.npmjs.com/package/element-internals-polyfill}\n * @see {@link https://github.com/WICG/webcomponents}\n * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements}\n * @since 1.14.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n */\nclass CustomControl extends CustomElement {\n\n    /**\n     * IMPORTANT: CustomControls instances are not created via the constructor, but either via a tag in the HTML or via <code>document.createElement()</code>.\n     *\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     * @summary create new Instance\n     */\n    constructor() {\n        super();\n\n        if (typeof this['attachInternals'] === 'function') {\n            /**\n             * currently only supported by chrome\n             * @property {Object}\n             * @private\n             */\n            this[attachedInternalSymbol] = this.attachInternals();\n        }\n\n        initObserver.call(this);\n\n    }\n\n    /**\n     * This method determines which attributes are to be monitored by `attributeChangedCallback()`.\n     *\n     * @return {string[]}\n     * @since 1.15.0\n     */\n    static get observedAttributes() {\n        const list = super.observedAttributes;\n        list.push(ATTRIBUTE_VALUE);\n        return list;\n    }    \n    \n    /**\n     *\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals}\n     * @since 1.14.0\n     * @return {boolean}\n     */\n    static get formAssociated() {\n        return true;\n    }\n\n    /**\n     * Derived classes can override and extend this method as follows.\n     *\n     * ```\n     * get defaults() {\n     *    return extends{}, super.defaults, {\n     *        myValue:true\n     *    });\n     * }\n     * ```\n     *\n     * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example}\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals}\n     * @return {object}\n     * @since 1.14.0\n     */\n    get defaults() {\n        return extend({}, super.defaults);\n    }\n\n    /**\n     * Must be overridden by a derived class and return the value of the control.\n     *\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @since 1.14.0\n     * @throws {Error} the value getter must be overwritten by the derived class\n     */\n    get value() {\n        throw Error('the value getter must be overwritten by the derived class');\n    }\n\n    /**\n     * Must be overridden by a derived class and return the value of the control.\n     *\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @param {*} value\n     * @since 1.14.0\n     * @throws {Error} the value setter must be overwritten by the derived class\n     */\n    set value(value) {\n        throw Error('the value setter must be overwritten by the derived class');\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {NodeList}\n     * @since 1.14.0\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/labels}\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     */\n    get labels() {\n        return getInternal.call(this)?.labels;\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {string|null}\n     */\n    get name() {\n        return this.getAttribute('name');\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {string}\n     */\n    get type() {\n        return this.constructor.getTag();\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {ValidityState}\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/ValidityState}\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/validity}\n     */\n    get validity() {\n        return getInternal.call(this)?.validity;\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {string}\n     * @since 1.14.0\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/validationMessage\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     */\n    get validationMessage() {\n        return getInternal.call(this)?.validationMessage;\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {boolean}\n     * @since 1.14.0\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/willValidate\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     */\n    get willValidate() {\n        return getInternal.call(this)?.willValidate;\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {CustomStateSet}\n     * @since 1.14.0\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/states\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     */\n    get states() {\n        return getInternal.call(this)?.states;\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {HTMLFontElement|null}\n     * @since 1.14.0\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/form\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     */\n    get form() {\n        return getInternal.call(this)?.form;\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * ```\n     * // Use the control's name as the base name for submitted data\n     * const n = this.getAttribute('name');\n     * const entries = new FormData();\n     * entries.append(n + '-first-name', this.firstName_);\n     * entries.append(n + '-last-name', this.lastName_);\n     * this.setFormValue(entries);\n     * ```\n     *\n     * @param {File|string|FormData} value\n     * @param {File|string|FormData} state\n     * @since 1.14.0\n     * @return {undefined}\n     * @throws {DOMException} NotSupportedError\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/setFormValue\n     */\n    setFormValue(value, state) {\n        getInternal.call(this).setFormValue(value, state);\n    }\n\n    /**\n     *\n     * @param {object} flags\n     * @param {string|undefined} message\n     * @param {HTMLElement} anchor\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/setValidity\n     * @since 1.14.0\n     * @return {undefined}\n     * @throws {DOMException} NotSupportedError\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     */\n    setValidity(flags, message, anchor) {\n        getInternal.call(this).setValidity(flags, message, anchor);\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/checkValidity\n     * @since 1.14.0\n     * @return {boolean}\n     * @throws {DOMException} NotSupportedError\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     */\n    checkValidity() {\n        return getInternal.call(this)?.checkValidity();\n    }\n\n    /**\n     * This is a method of [internal api](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals)\n     *\n     * @return {boolean}\n     * @since 1.14.0\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals/reportValidity\n     * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n     * @throws {DOMException} NotSupportedError\n     */\n    reportValidity() {\n        return getInternal.call(this)?.reportValidity();\n    }\n\n}\n\n/**\n * @private\n * @return {object}\n * @throws {Error} the ElementInternals is not supported and a polyfill is necessary\n * @this CustomControl\n */\nfunction getInternal() {\n    const self = this;\n\n    if (!(attachedInternalSymbol in this)) {\n        throw new Error('ElementInternals is not supported and a polyfill is necessary');\n    }\n\n    return this[attachedInternalSymbol];\n}\n\n/**\n * @private\n * @return {object}\n * @this CustomControl\n */\nfunction initObserver() {\n    const self = this;\n\n    // value\n    self[attributeObserverSymbol]['value'] = () => {\n        self.setOption('value', self.getAttribute('value'));\n    }\n\n}\n\nassignToNamespace('Monster.DOM', CustomControl);\nexport {Monster, CustomControl}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {internalSymbol} from \"../constants.js\";\nimport {extend} from \"../data/extend.js\";\nimport {Pathfinder} from \"../data/pathfinder.js\";\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {parseDataURL} from \"../types/dataurl.js\";\nimport {getGlobalObject} from \"../types/global.js\";\nimport {isArray, isFunction, isObject, isString} from \"../types/is.js\";\nimport {Observer} from \"../types/observer.js\";\nimport {ProxyObserver} from \"../types/proxyobserver.js\";\nimport {validateFunction, validateInstance, validateObject, validateString} from \"../types/validate.js\";\nimport {clone} from \"../util/clone.js\";\nimport {addAttributeToken, addToObjectLink, getLinkedObjects, hasObjectLink} from \"./attributes.js\";\nimport {\n    ATTRIBUTE_DISABLED,\n    ATTRIBUTE_ERRORMESSAGE,\n    ATTRIBUTE_OPTIONS,\n    ATTRIBUTE_OPTIONS_SELECTOR,\n    objectUpdaterLinkSymbol\n} from \"./constants.js\";\nimport {findDocumentTemplate, Template} from \"./template.js\";\nimport {Updater} from \"./updater.js\";\n\n\n/**\n * @memberOf Monster.DOM\n * @type {symbol}\n */\nconst initMethodSymbol = Symbol('initMethodSymbol');\n\n/**\n * @memberOf Monster.DOM\n * @type {symbol}\n */\nconst assembleMethodSymbol = Symbol('assembleMethodSymbol');\n\n/**\n * this symbol holds the attribute observer callbacks. The key is the attribute name.\n * @memberOf Monster.DOM\n * @type {symbol}\n */\nconst attributeObserverSymbol = Symbol('attributeObserver');\n\n\n/**\n * HTMLElement\n * @external HTMLElement\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement\n *\n * @startuml customelement-sequencediagram.png\n * skinparam monochrome true\n * skinparam shadowing false\n *\n * autonumber\n *\n * Script -> DOM: element = document.createElement('my-element')\n * DOM -> CustomElement: constructor()\n * CustomElement -> CustomElement: [initMethodSymbol]()\n *\n * CustomElement --> DOM: Element\n * DOM --> Script : element\n *\n *\n * Script -> DOM: document.querySelector('body').append(element)\n *\n * DOM -> CustomElement : connectedCallback()\n *\n * note right CustomElement: is only called at\\nthe first connection\n * CustomElement -> CustomElement : [assembleMethodSymbol]()\n *\n * ... ...\n *\n * autonumber\n *\n * Script -> DOM: document.querySelector('monster-confirm-button').parentNode.removeChild(element)\n * DOM -> CustomElement: disconnectedCallback()\n *\n *\n * @enduml\n *\n * @startuml customelement-class.png\n * skinparam monochrome true\n * skinparam shadowing false\n * HTMLElement <|-- CustomElement\n * @enduml\n */\n\n\n/**\n * To define a new HTML element we need the power of CustomElement\n *\n * IMPORTANT: after defining a `CustomElement`, the `registerCustomElement` method must be called\n * with the new class name. only then will the tag defined via the `getTag` method be made known to the DOM.\n *\n * <img src=\"./images/customelement-class.png\">\n *\n * You can create the object via the function `document.createElement()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * document.createElement('monster-')\n * </script>\n * ```\n *\n * ## Interaction\n *\n * <img src=\"./images/customelement-sequencediagram.png\">\n *\n * ## Styling\n *\n * For optimal display of custom-elements the pseudo-class :defined can be used.\n *\n * To prevent the custom elements from being displayed and flickering until the control is registered, it is recommended to create a css directive.\n *\n * In the simplest case, you can simply hide the control.\n *\n * ```\n * <style>\n *\n * my-custom-element:not(:defined) {\n *     display: none;\n * }\n *\n * my-custom-element:defined {\n *     display: flex;\n * }\n *\n * </style>\n * ```\n *\n * Alternatively you can also display a loader\n *\n * ```\n * my-custom-element:not(:defined) {\n *            display: flex;\n *            box-shadow: 0 4px 10px 0 rgba(33, 33, 33, 0.15);\n *            border-radius: 4px;\n *            height: 200px;\n *            position: relative;\n *            overflow: hidden;\n *        }\n *\n * my-custom-element:not(:defined)::before {\n *            content: '';\n *            display: block;\n *            position: absolute;\n *            left: -150px;\n *            top: 0;\n *            height: 100%;\n *            width: 150px;\n *            background: linear-gradient(to right, transparent 0%, #E8E8E8 50%, transparent 100%);\n *            animation: load 1s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;\n *        }\n *\n * @keyframes load {\n *            from {\n *                left: -150px;\n *            }\n *            to   {\n *                left: 100%;\n *            }\n *        }\n *\n * my-custom-element:defined {\n *           display: flex;\n *       }\n * ```\n *\n * @example\n *\n * // In the example the the user can use his own template by creating a template in the DOM with the ID `my-custom-element`.\n * // You can also specify a theme (for example `mytheme`), then it will search for the ID `my-custom-element-mytheme` and\n * // if not available for the ID `my-custom-element`.\n *\n * class MyCustomElement extends CustomElement {\n * \n *    static getTag() {\n *        return \"my-custom-element\"\n *    }\n *\n * }\n *\n * // ↦ <my-custom-element></my-custom-element>\n *\n * @see https://github.com/WICG/webcomponents\n * @see https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements\n * @since 1.7.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @extends external:HTMLElement\n * @summary A base class for HTML5 customcontrols\n */\nclass CustomElement extends HTMLElement {\n\n    /**\n     * A new object is created. First the `initOptions` method is called. Here the\n     * options can be defined in derived classes. Subsequently, the shadowRoot is initialized.\n     *\n     * @throws {Error} the options attribute does not contain a valid json definition.\n     * @since 1.7.0\n     */\n    constructor() {\n        super();\n        this[internalSymbol] = new ProxyObserver({'options': extend({}, this.defaults)});\n        this[attributeObserverSymbol] = {};\n        initOptionObserver.call(this);\n        this[initMethodSymbol]();\n    }\n\n    /**\n     * This method determines which attributes are to be monitored by `attributeChangedCallback()`.\n     *\n     * @return {string[]}\n     * @since 1.15.0\n     */\n    static get observedAttributes() {\n        return [ATTRIBUTE_OPTIONS, ATTRIBUTE_DISABLED];\n    }\n\n    /**\n     * Derived classes can override and extend this method as follows.\n     *\n     * ```\n     * get defaults() {\n     *    return Object.assign({}, super.defaults, {\n     *        myValue:true\n     *    });\n     * }\n     * ```\n     *\n     * To set the options via the html tag the attribute data-monster-options must be set.\n     * As value a JSON object with the desired values must be defined.\n     *\n     * Since 1.18.0 the JSON can be specified as a DataURI.\n     *\n     * ```\n     * new Monster.Types.DataUrl(btoa(JSON.stringify({\n     *        shadowMode: 'open',\n     *        delegatesFocus: true,\n     *        templates: {\n     *            main: undefined\n     *        }\n     *    })),'application/json',true).toString()\n     * ```\n     *\n     * The attribute data-monster-options-selector can be used to access a script tag that contains additional configuration.\n     *\n     * As value a selector must be specified, which belongs to a script tag and contains the configuration as json.\n     *\n     * ```\n     * <script id=\"id-for-this-config\" type=\"application/json\">\n     *    {\n     *        \"config-key\": \"config-value\"\n     *    }\n     * </script>\n     * ```\n     *\n     * The individual configuration values can be found in the table.\n     *\n     * @property {boolean} disabled=false Object The Boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form.\n     * @property {string} shadowMode=open `open` Elements of the shadow root are accessible from JavaScript outside the root, for example using. `close` Denies access to the node(s) of a closed shadow root from JavaScript outside it\n     * @property {Boolean} delegatesFocus=true A boolean that, when set to true, specifies behavior that mitigates custom element issues around focusability. When a non-focusable part of the shadow DOM is clicked, the first focusable part is given focus, and the shadow host is given any available :focus styling.\n     * @property {Object} templates Templates\n     * @property {string} templates.main=undefined Main template\n     *\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow\n     * @since 1.8.0\n     */\n    get defaults() {\n        return {\n            ATTRIBUTE_DISABLED: this.getAttribute(ATTRIBUTE_DISABLED),\n            shadowMode: 'open',\n            delegatesFocus: true,\n            templates: {\n                main: undefined\n            }\n        };\n    }\n\n    /**\n     * There is no check on the name by this class. the developer is responsible for assigning an appropriate tag.\n     * if the name is not valid, registerCustomElement() will issue an error\n     *\n     * @link https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n     * @return {string}\n     * @throws {Error} the method getTag must be overwritten by the derived class.\n     * @since 1.7.0\n     */\n    static getTag() {\n        throw new Error(\"the method getTag must be overwritten by the derived class.\");\n    }\n\n    /**\n     * At this point a `CSSStyleSheet` object can be returned. If the environment does not\n     * support a constructor, then an object can also be built using the following detour.\n     *\n     * If `undefined` is returned then the shadowRoot does not get a stylesheet.\n     *\n     * ```\n     * const doc = document.implementation.createHTMLDocument('title');\n     *\n     * let style = doc.createElement(\"style\");\n     * style.innerHTML=\"p{color:red;}\";\n     *\n     * // WebKit Hack\n     * style.appendChild(document.createTextNode(\"\"));\n     * // Add the <style> element to the page\n     * doc.head.appendChild(style);\n     * return doc.styleSheets[0];\n     * ;\n     * ```\n     *\n     * @return {CSSStyleSheet|CSSStyleSheet[]|string|undefined}\n     */\n    static getCSSStyleSheet() {\n        return undefined;\n    }\n\n    /**\n     * attach a new observer\n     *\n     * @param {Observer} observer\n     * @returns {CustomElement}\n     */\n    attachObserver(observer) {\n        this[internalSymbol].attachObserver(observer)\n        return this;\n    }\n\n    /**\n     * detach a observer\n     *\n     * @param {Observer} observer\n     * @returns {CustomElement}\n     */\n    detachObserver(observer) {\n        this[internalSymbol].detachObserver(observer)\n        return this;\n    }\n\n    /**\n     * @param {Observer} observer\n     * @returns {ProxyObserver}\n     */\n    containsObserver(observer) {\n        return this[internalSymbol].containsObserver(observer)\n    }\n\n    /**\n     * nested options can be specified by path `a.b.c`\n     *\n     * @param {string} path\n     * @param {*} defaultValue\n     * @return {*}\n     * @since 1.10.0\n     */\n    getOption(path, defaultValue) {\n        let value;\n\n        try {\n            value = new Pathfinder(this[internalSymbol].getRealSubject()['options']).getVia(path);\n        } catch (e) {\n\n        }\n\n        if (value === undefined) return defaultValue;\n        return value;\n    }\n\n    /**\n     * Set option and inform elements\n     *\n     * @param {string} path\n     * @param {*} value\n     * @return {CustomElement}\n     * @since 1.14.0\n     */\n    setOption(path, value) {\n        new Pathfinder(this[internalSymbol].getSubject()['options']).setVia(path, value);\n        return this;\n    }\n\n    /**\n     * @since 1.15.0\n     * @param {string|object} options\n     * @return {CustomElement}\n     */\n    setOptions(options) {\n\n        if (isString(options)) {\n            options = parseOptionsJSON.call(this, options)\n        }\n\n        const self = this;\n        extend(self[internalSymbol].getSubject()['options'], self.defaults, options);\n\n        return self;\n    }\n\n    /**\n     * Is called once via the constructor\n     *\n     * @return {CustomElement}\n     * @since 1.8.0\n     */\n    [initMethodSymbol]() {\n        return this;\n    }\n\n    /**\n     * Is called once when the object is included in the DOM for the first time.\n     *\n     * @return {CustomElement}\n     * @since 1.8.0\n     */\n    [assembleMethodSymbol]() {\n\n        const self = this;\n        let elements, nodeList;\n\n        const AttributeOptions = getOptionsFromAttributes.call(self);\n        if (isObject(AttributeOptions) && Object.keys(AttributeOptions).length > 0) {\n            self.setOptions(AttributeOptions);\n        }\n\n        const ScriptOptions = getOptionsFromScriptTag.call(self);\n        if (isObject(ScriptOptions) && Object.keys(ScriptOptions).length > 0) {\n            self.setOptions(ScriptOptions);\n        }\n\n\n        if (self.getOption('shadowMode', false) !== false) {\n            try {\n                initShadowRoot.call(self);\n                elements = self.shadowRoot.childNodes;\n\n            } catch (e) {\n\n            }\n\n            try {\n                initCSSStylesheet.call(this);\n            } catch (e) {\n                addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, e.toString());\n            }\n        }\n\n        if (!(elements instanceof NodeList)) {\n            if (!(elements instanceof NodeList)) {\n                initHtmlContent.call(this);\n                elements = this.childNodes;\n            }\n        }\n\n        try {\n            nodeList = new Set([\n                ...elements,\n                ...getSlottedElements.call(self)\n            ])\n        } catch (e) {\n            nodeList = elements\n        }\n\n        assignUpdaterToElement.call(self, nodeList, clone(self[internalSymbol].getRealSubject()['options']));\n        return self;\n    }\n\n    /**\n     * Called every time the element is inserted into the DOM. Useful for running setup code, such as\n     * fetching resources or rendering. Generally, you should try to delay work until this time.\n     *\n     * @return {void}\n     * @since 1.7.0\n     */\n    connectedCallback() {\n        let self = this;\n        if (!hasObjectLink(self, objectUpdaterLinkSymbol)) {\n            self[assembleMethodSymbol]()\n        }\n    }\n\n    /**\n     * Called every time the element is removed from the DOM. Useful for running clean up code.\n     *\n     * @return {void}\n     * @since 1.7.0\n     */\n    disconnectedCallback() {\n\n    }\n\n    /**\n     * The custom element has been moved into a new document (e.g. someone called document.adoptNode(el)).\n     *\n     * @return {void}\n     * @since 1.7.0\n     */\n    adoptedCallback() {\n\n    }\n\n    /**\n     * Called when an observed attribute has been added, removed, updated, or replaced. Also called for initial\n     * values when an element is created by the parser, or upgraded. Note: only attributes listed in the observedAttributes\n     * property will receive this callback.\n     *\n     * @param {string} attrName\n     * @param {string} oldVal\n     * @param {string} newVal\n     * @return {void}\n     * @since 1.15.0\n     */\n    attributeChangedCallback(attrName, oldVal, newVal) {\n        const self = this;\n\n        const callback = self[attributeObserverSymbol]?.[attrName];\n\n        if (isFunction(callback)) {\n            callback.call(self, newVal, oldVal);\n        }\n\n    }\n\n    /**\n     *\n     * @param {Node} node\n     * @return {boolean}\n     * @throws {TypeError} value is not an instance of\n     * @since 1.19.0\n     */\n    hasNode(node) {\n        const self = this;\n\n        if (containChildNode.call(self, validateInstance(node, Node))) {\n            return true;\n        }\n\n        if (!(self.shadowRoot instanceof ShadowRoot)) {\n            return false;\n        }\n\n        return containChildNode.call(self.shadowRoot, node);\n\n    }\n\n}\n\n/**\n * @private\n * @param {String|undefined} query\n * @param {String|undefined|null} name name of the slot (if the parameter is undefined, all slots are searched, if the parameter has the value null, all slots without a name are searched. if a string is specified, the slots with this name are searched.)\n * @return {*}\n * @this CustomElement\n * @since 1.23.0\n * @throws {Error} query must be a string\n */\nfunction getSlottedElements(query, name) {\n    const self = this;\n    const result = new Set;\n\n    if (!(self.shadowRoot instanceof ShadowRoot)) {\n        return result;\n    }\n\n    let selector = 'slot';\n    if (name !== undefined) {\n        if (name === null) {\n            selector += ':not([name])';\n        } else {\n            selector += '[name=' + validateString(name) + ']';\n        }\n\n    }\n\n    const slots = self.shadowRoot.querySelectorAll(selector);\n\n    for (const [, slot] of Object.entries(slots)) {\n        slot.assignedElements().forEach(function (node) {\n\n            if (!(node instanceof HTMLElement)) return;\n\n            if (isString(query)) {\n                node.querySelectorAll(query).forEach(function (n) {\n                    result.add(n);\n                });\n\n                if (node.matches(query)) {\n                    result.add(node);\n                }\n\n            } else if (query !== undefined) {\n                throw new Error('query must be a string')\n            } else {\n                result.add(node);\n            }\n        })\n    }\n\n    return result;\n}\n\n/**\n * @this CustomElement\n * @private\n * @param {Node} node\n * @return {boolean}\n */\nfunction containChildNode(node) {\n    const self = this;\n\n    if (self.contains(node)) {\n        return true;\n    }\n\n    for (const [, e] of Object.entries(self.childNodes)) {\n        if (e.contains(node)) {\n            return true;\n        }\n\n        containChildNode.call(e, node);\n    }\n\n\n    return false;\n}\n\n/**\n * @since 1.15.0\n * @private\n * @this CustomElement\n */\nfunction initOptionObserver() {\n    const self = this;\n\n    let lastDisabledValue = undefined;\n    self.attachObserver(new Observer(function () {\n        const flag = self.getOption('disabled');\n\n        if (flag === lastDisabledValue) {\n            return;\n        }\n\n        lastDisabledValue = flag;\n\n        if (!(self.shadowRoot instanceof ShadowRoot)) {\n            return;\n        }\n\n        const query = 'button, command, fieldset, keygen, optgroup, option, select, textarea, input, [data-monster-objectlink]';\n        const elements = self.shadowRoot.querySelectorAll(query);\n\n        let nodeList;\n        try {\n            nodeList = new Set([\n                ...elements,\n                ...getSlottedElements.call(self, query)\n            ])\n        } catch (e) {\n            nodeList = elements\n        }\n\n        for (const element of [...nodeList]) {\n            if (flag === true) {\n                element.setAttribute(ATTRIBUTE_DISABLED, '');\n            } else {\n                element.removeAttribute(ATTRIBUTE_DISABLED);\n            }\n        }\n\n    }));\n\n    self.attachObserver(new Observer(function () {\n\n        // not initialised\n        if (!hasObjectLink(self, objectUpdaterLinkSymbol)) {\n            return;\n        }\n        // inform every element\n        const updaters = getLinkedObjects(self, objectUpdaterLinkSymbol);\n\n        for (const list of updaters) {\n            for (const updater of list) {\n                let d = clone(self[internalSymbol].getRealSubject()['options']);\n                Object.assign(updater.getSubject(), d);\n            }\n        }\n\n    }));\n\n    // disabled\n    self[attributeObserverSymbol][ATTRIBUTE_DISABLED] = () => {\n        if (self.hasAttribute(ATTRIBUTE_DISABLED)) {\n            self.setOption(ATTRIBUTE_DISABLED, true);\n        } else {\n            self.setOption(ATTRIBUTE_DISABLED, undefined);\n        }\n    }\n\n    // data-monster-options\n    self[attributeObserverSymbol][ATTRIBUTE_OPTIONS] = () => {\n        const options = getOptionsFromAttributes.call(self);\n        if (isObject(options) && Object.keys(options).length > 0) {\n            self.setOptions(options);\n        }\n    }\n\n    // data-monster-options-selector\n    self[attributeObserverSymbol][ATTRIBUTE_OPTIONS_SELECTOR] = () => {\n        const options = getOptionsFromScriptTag.call(self);\n        if (isObject(options) && Object.keys(options).length > 0) {\n            self.setOptions(options);\n        }\n    }\n\n\n}\n\n/**\n * @private\n * @return {object}\n * @throws {TypeError} value is not a object\n */\nfunction getOptionsFromScriptTag() {\n    const self = this;\n\n    if (!self.hasAttribute(ATTRIBUTE_OPTIONS_SELECTOR)) {\n        return {};\n    }\n\n    const node = document.querySelector(self.getAttribute(ATTRIBUTE_OPTIONS_SELECTOR));\n    if (!(node instanceof HTMLScriptElement)) {\n        addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, 'the selector ' + ATTRIBUTE_OPTIONS_SELECTOR + ' for options was specified (' + self.getAttribute(ATTRIBUTE_OPTIONS_SELECTOR) + ') but not found.');\n        return {};\n    }\n\n    let obj = {};\n\n    try {\n        obj = parseOptionsJSON.call(this, node.textContent.trim())\n    } catch (e) {\n        addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, 'when analyzing the configuration from the script tag there was an error. ' + e);\n    }\n\n    return obj;\n\n}\n\n/**\n * @private\n * @return {object}\n */\nfunction getOptionsFromAttributes() {\n    const self = this;\n\n    if (this.hasAttribute(ATTRIBUTE_OPTIONS)) {\n        try {\n            return parseOptionsJSON.call(self, this.getAttribute(ATTRIBUTE_OPTIONS))\n        } catch (e) {\n            addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, 'the options attribute ' + ATTRIBUTE_OPTIONS + ' does not contain a valid json definition (actual: ' + this.getAttribute(ATTRIBUTE_OPTIONS) + ').' + e);\n        }\n    }\n\n    return {};\n}\n\n/**\n * @private\n * @param data\n * @return {Object}\n */\nfunction parseOptionsJSON(data) {\n\n    const self = this, obj = {};\n\n    if (!isString(data)) {\n        return obj;\n    }\n\n    // the configuration can be specified as a data url.\n    try {\n        let dataUrl = parseDataURL(data);\n        data = dataUrl.content;\n    } catch (e) {\n\n    }\n\n    try {\n        let obj = JSON.parse(data);\n        return validateObject(obj);\n    } catch (e) {\n        throw e;\n    }\n\n\n    return obj;\n}\n\n/**\n * @private\n * @return {initHtmlContent}\n */\nfunction initHtmlContent() {\n\n    try {\n        let template = findDocumentTemplate(this.constructor.getTag());\n        this.appendChild(template.createDocumentFragment());\n    } catch (e) {\n\n        let html = this.getOption('templates.main', '');\n        if (isString(html) && html.length > 0) {\n            this.innerHTML = html;\n        }\n\n    }\n\n    return this;\n\n}\n\n/**\n * @private\n * @return {CustomElement}\n * @memberOf Monster.DOM\n * @this CustomElement\n * @since 1.16.0\n * @throws {TypeError} value is not an instance of\n */\nfunction initCSSStylesheet() {\n    const self = this;\n\n    if (!(this.shadowRoot instanceof ShadowRoot)) {\n        return self;\n    }\n\n    const styleSheet = this.constructor.getCSSStyleSheet();\n\n    if (styleSheet instanceof CSSStyleSheet) {\n        if (styleSheet.cssRules.length > 0) {\n            this.shadowRoot.adoptedStyleSheets = [styleSheet];\n        }\n    } else if (isArray(styleSheet)) {\n        const assign = [];\n        for (let s of styleSheet) {\n\n            if (isString(s)) {\n                let trimedStyleSheet = s.trim()\n                if (trimedStyleSheet !== '') {\n                    const style = document.createElement('style')\n                    style.innerHTML = trimedStyleSheet;\n                    self.shadowRoot.prepend(style);\n                }\n                continue;\n            }\n\n            validateInstance(s, CSSStyleSheet);\n\n            if (s.cssRules.length > 0) {\n                assign.push(s);\n            }\n\n        }\n\n        if (assign.length > 0) {\n            this.shadowRoot.adoptedStyleSheets = assign;\n        }\n\n    } else if (isString(styleSheet)) {\n\n        let trimedStyleSheet = styleSheet.trim()\n        if (trimedStyleSheet !== '') {\n            const style = document.createElement('style')\n            style.innerHTML = styleSheet;\n            self.shadowRoot.prepend(style);\n        }\n\n    }\n\n    return self;\n\n}\n\n/**\n * @private\n * @return {CustomElement}\n * @throws {Error} html is not set.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow\n * @memberOf Monster.DOM\n * @since 1.8.0\n */\nfunction initShadowRoot() {\n\n    let template, html;\n\n    try {\n        template = findDocumentTemplate(this.constructor.getTag());\n    } catch (e) {\n\n        html = this.getOption('templates.main', '');\n        if (!isString(html) || html === undefined || html === \"\") {\n            throw new Error(\"html is not set.\");\n        }\n\n    }\n\n    this.attachShadow({\n        mode: this.getOption('shadowMode', 'open'),\n        delegatesFocus: this.getOption('delegatesFocus', true)\n    });\n\n    if (template instanceof Template) {\n        this.shadowRoot.appendChild(template.createDocumentFragment());\n        return this;\n    }\n\n    this.shadowRoot.innerHTML = html;\n    return this;\n}\n\n/**\n * This method registers a new element. The string returned by `CustomElement.getTag()` is used as the tag.\n *\n * @param {CustomElement} element\n * @return {void}\n * @since 1.7.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {DOMException} Failed to execute 'define' on 'CustomElementRegistry': is not a valid custom element name\n */\nfunction registerCustomElement(element) {\n    validateFunction(element);\n    getGlobalObject('customElements').define(element.getTag(), element);\n}\n\n\n/**\n *\n * @param element\n * @param object\n * @return {Promise[]}\n * @since 1.23.0\n * @memberOf Monster.DOM\n */\nfunction assignUpdaterToElement(elements, object) {\n\n    const updaters = new Set;\n\n    if (elements instanceof NodeList) {\n        elements = new Set([\n            ...elements\n        ])\n    }\n\n    let result = [];\n\n    elements.forEach((element) => {\n        if (!(element instanceof HTMLElement)) return;\n        if ((element instanceof HTMLTemplateElement)) return;\n\n        const u = new Updater(element, object)\n        updaters.add(u);\n\n        result.push(u.run().then(() => {\n            return u.enableEventProcessing();\n        }));\n\n    });\n\n    if (updaters.size > 0) {\n        addToObjectLink(this, objectUpdaterLinkSymbol, updaters);\n    }\n\n    return result;\n}\n\nassignToNamespace('Monster.DOM', CustomElement, registerCustomElement, assignUpdaterToElement);\nexport {\n    Monster,\n    registerCustomElement,\n    CustomElement,\n    initMethodSymbol,\n    assembleMethodSymbol,\n    assignUpdaterToElement,\n    attributeObserverSymbol,\n    getSlottedElements\n}\n","'use strict';\n\nimport {assignToNamespace} from \"../namespace.js\";\n/**\n * @author schukai GmbH\n */\nimport {Base, Monster} from \"./base.js\";\nimport {isString} from \"./is.js\";\nimport {MediaType, parseMediaType} from \"./mediatype.js\";\nimport {validateBoolean, validateInstance, validateString} from \"./validate.js\";\n\n/**\n * @private\n * @type {symbol}\n */\nconst internal = Symbol('internal');\n\n/**\n * You can create an object via the monster namespace `new Monster.Types.DataUrl()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.DataUrl()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {DataUrl} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/dataurl.js';\n * new DataUrl()\n * </script>\n * ```\n *\n * @since 1.8.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\n * @see https://datatracker.ietf.org/doc/html/rfc2397\n */\nclass DataUrl extends Base {\n\n    /**\n     *\n     * @param {String} content\n     * @param {String|Monster.Types.MediaType} mediatype\n     * @param {boolean} base64=true\n     */\n    constructor(content, mediatype, base64) {\n        super();\n\n        if (isString(mediatype)) {\n            mediatype = parseMediaType(mediatype);\n        }\n\n        this[internal] = {\n            content: validateString(content),\n            mediatype: validateInstance(mediatype, MediaType),\n            base64: validateBoolean(base64 === undefined ? true : base64)\n        }\n\n\n    }\n\n    get content() {\n        return this[internal].base64 ? atob(this[internal].content) : this[internal].content;\n    }\n\n    get mediatype() {\n        return this[internal].mediatype;\n    }\n\n\n    /**\n     *\n     * @return {string}\n     * @see https://datatracker.ietf.org/doc/html/rfc2397\n     */\n    toString() {\n\n        let content = this[internal].content;\n\n        if (this[internal].base64 === true) {\n            content = ';base64,' + content;\n        } else {\n            content = ',' + encodeURIComponent(content);\n        }\n\n        return 'data:' + this[internal].mediatype.toString() + content;\n    }\n\n}\n\n/**\n * You can call the function via the monster namespace `Monster.Types.parseDataURL()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.parseDataURL())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {parseDataURL} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/dataurl.js';\n * console.log(parseDataURL())\n * </script>\n * ```\n *\n * Specification:\n *\n * ```\n * dataurl    := \"data:\" [ mediatype ] [ \";base64\" ] \",\" data\n * mediatype  := [ type \"/\" subtype ] *( \";\" parameter )\n * data       := *urlchar\n * parameter  := attribute \"=\" value\n * ```\n *\n * @param {String} dataurl\n * @return {Monster.Types.DataUrl}\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\n * @see https://datatracker.ietf.org/doc/html/rfc2397\n * @throws {TypeError} incorrect or missing data protocol\n * @throws {TypeError} malformed data url\n * @memberOf Monster.Types\n */\nfunction parseDataURL(dataurl) {\n\n    validateString(dataurl);\n\n    dataurl = dataurl.trim();\n\n    if (dataurl.substring(0, 5) !== 'data:') {\n        throw new TypeError('incorrect or missing data protocol')\n    }\n\n    dataurl = dataurl.substring(5);\n\n    let p = dataurl.indexOf(',');\n    if (p === -1) {\n        throw new TypeError('malformed data url')\n    }\n\n    let content = dataurl.substring(p + 1);\n    let mediatypeAndBase64 = dataurl.substring(0, p).trim();\n    let mediatype = 'text/plain;charset=US-ASCII';\n    let base64Flag = false;\n\n    if (mediatypeAndBase64 !== \"\") {\n        mediatype = mediatypeAndBase64;\n        if (mediatypeAndBase64.endsWith('base64')) {\n            let i = mediatypeAndBase64.lastIndexOf(';');\n            mediatype = mediatypeAndBase64.substring(0, i);\n            base64Flag = true;\n        } else {\n            content = decodeURIComponent(content);\n        }\n\n        mediatype = parseMediaType(mediatype);\n    } else {\n        content = decodeURIComponent(content);\n    }\n\n    return new DataUrl(content, mediatype, base64Flag);\n\n\n}\n\n\nassignToNamespace('Monster.Types', parseDataURL, DataUrl);\nexport {Monster, parseDataURL, DataUrl};\n","'use strict';\n\nimport {assignToNamespace} from \"../namespace.js\";\n/**\n * @author schukai GmbH\n */\nimport {Base, Monster} from \"./base.js\";\nimport {isString} from \"./is.js\";\nimport {validateArray, validateString} from \"./validate.js\";\n\n\n/**\n * @private\n * @type {symbol}\n */\nconst internal = Symbol('internal');\n\n/**\n * @typedef {Object} Parameter\n * @property {string} key\n * @property {string} value\n * @memberOf Monster.Types\n */\n\n\n/**\n * You can create an object via the monster namespace `new Monster.Types.MediaType()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Types.MediaType())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {MediaType} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/mediatype.js';\n * console.log(new MediaType())\n * </script>\n * ```\n *\n * @since 1.8.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass MediaType extends Base {\n\n    /**\n     *\n     * @param {String} type\n     * @param {String} subtype\n     * @param {Monster.Types.Parameter[]} parameter\n     */\n    constructor(type, subtype, parameter) {\n        super();\n\n        this[internal] = {\n            type: validateString(type).toLowerCase(),\n            subtype: validateString(subtype).toLowerCase(),\n            parameter: []\n        }\n\n        if (parameter !== undefined) {\n            this[internal]['parameter'] = validateArray(parameter);\n        }\n\n\n    }\n\n    /**\n     * @return {String}\n     */\n    get type() {\n        return this[internal].type;\n    }\n\n    /**\n     * @return {String}\n     */\n    get subtype() {\n        return this[internal].subtype;\n    }\n\n    /**\n     * @return {Monster.Types.Parameter[]}\n     */\n    get parameter() {\n        return this[internal].parameter;\n    }\n\n    /**\n     *\n     *\n     * @return {Map}\n     */\n    get parameter() {\n\n        const result = new Map\n\n        this[internal]['parameter'].forEach(p => {\n\n            let value = p.value;\n\n            // internally special values are partly stored with quotes, this function removes them.\n            if (value.startsWith('\"') && value.endsWith('\"')) {\n                value = value.substring(1, value.length - 1);\n            }\n\n            result.set(p.key, value);\n        })\n\n\n        return result;\n    }\n\n    /**\n     *\n     * @return {string}\n     */\n    toString() {\n\n        let parameter = [];\n        for (let a of this[internal].parameter) {\n            parameter.push(a.key + '=' + a.value);\n        }\n\n        return this[internal].type + '/' + this[internal].subtype + (parameter.length > 0 ? ';' + parameter.join(';') : '');\n    }\n\n}\n\n/**\n * You can call the function via the monster namespace `Monster.Types.parseMediaType()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.Types.parseMediaType())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {parseMediaType} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/dataurl.js';\n * console.log(parseMediaType())\n * </script>\n * ```\n *\n * Specification:\n *\n * ```\n * dataurl    := \"data:\" [ mediatype ] [ \";base64\" ] \",\" data\n * mediatype  := [ type \"/\" subtype ] *( \";\" parameter )\n * data       := *urlchar\n * parameter  := attribute \"=\" value\n * ```\n *\n * @param {String} mediatype\n * @return {Monster.Types.MediaType}\n * @see https://datatracker.ietf.org/doc/html/rfc2045#section-5.1\n * @throws {TypeError} the mimetype can not be parsed\n * @throws {TypeError} blank value is not allowed\n * @throws {TypeError} malformed data url\n * @memberOf Monster.Types\n */\nfunction parseMediaType(mediatype) {\n\n    const regex = /(?<type>[A-Za-z]+|\\*)\\/(?<subtype>([a-zA-Z0-9.\\+_\\-]+)|\\*|)(?<parameter>\\s*;\\s*([a-zA-Z0-9]+)\\s*(=\\s*(\"?[A-Za-z0-9_\\-]+\"?))?)*/g;\n    const result = regex.exec(validateString(mediatype));\n\n    const groups = result?.['groups'];\n    if (groups === undefined) {\n        throw new TypeError('the mimetype can not be parsed')\n    }\n\n    const type = groups?.['type'];\n    const subtype = groups?.['subtype'];\n    const parameter = groups?.['parameter'];\n\n    if (subtype === \"\" || type === \"\") {\n        throw new TypeError('blank value is not allowed');\n    }\n\n    return new MediaType(type, subtype, parseParameter(parameter));\n\n\n}\n\n/**\n * @private\n * @since 1.18.0\n * @param {String} parameter\n * @return {Monster.Types.Parameter[]|undefined}\n * @memberOf Monster.Types\n */\nfunction parseParameter(parameter) {\n\n    if (!isString(parameter)) {\n        return undefined;\n    }\n\n    let result = [];\n\n    parameter.split(';').forEach((entry) => {\n\n        entry = entry.trim();\n        if (entry === \"\") {\n            return;\n        }\n\n        const kv = entry.split('=')\n\n        let key = validateString(kv?.[0]).trim();\n        let value = validateString(kv?.[1]).trim();\n\n        // if values are quoted, they remain so internally\n        result.push({\n            key: key,\n            value: value\n        })\n\n\n    })\n\n    return result;\n\n}\n\n\nassignToNamespace('Monster.Types', parseMediaType, MediaType);\nexport {Monster, parseMediaType, MediaType};\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {getGlobalFunction, getGlobalObject} from '../types/global.js';\nimport {validateInstance, validateString} from \"../types/validate.js\";\nimport {ATTRIBUTE_TEMPLATE_PREFIX} from \"./constants.js\";\nimport {getDocumentTheme} from \"./theme.js\";\n\n/**\n * you can call the method via the monster namespace `new Monster.DOM.Template()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.DOM.Template()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Template} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/template.js';\n * new Template()\n * </script>\n * ```\n *\n * @since 1.6.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @summary A template class\n */\nclass Template extends Base {\n    /**\n     *\n     * @param {HTMLTemplateElement} template\n     * @throws {TypeError} value is not an instance of\n     * @throws {TypeError} value is not a function\n     * @throws {Error} the function is not defined\n     */\n    constructor(template) {\n        super();\n        const HTMLTemplateElement = getGlobalFunction('HTMLTemplateElement');\n        validateInstance(template, HTMLTemplateElement);\n        this.template = template;\n    }\n\n    /**\n     *\n     * @returns {HTMLTemplateElement}\n     */\n    getTemplateElement() {\n        return this.template;\n    }\n\n    /**\n     *\n     * @return {DocumentFragment}\n     * @throws {TypeError} value is not an instance of\n     */\n    createDocumentFragment() {\n        return this.template.content.cloneNode(true);\n    }\n\n}\n\n/**\n * This method loads a template with the given ID and returns it.\n *\n * To do this, it first reads the theme of the document and looks for the `data-monster-theme-name` attribute in the HTML tag.\n *\n * ```\n * <html data-monster-theme-name=\"my-theme\">\n * ```\n *\n * If no theme was specified, the default theme is `monster`.\n *\n * Now it is looked if there is a template with the given ID and theme `id-theme` and if yes it is returned.\n * If there is no template a search for a template with the given ID `id` is done. If this is also not found, an error is thrown.\n *\n * You can call the method via the monster namespace `Monster.DOM.findDocumentTemplate()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.DOM.findDocumentTemplate()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {findTemplate} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/template.js';\n * findDocumentTemplate()\n * </script>\n * ```\n *\n * @example\n *\n * import { findDocumentTemplate } from \"https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/template.js\";\n *\n * const template = document.createElement(\"template\");\n * template.id = \"myTemplate\";\n * template.innerHTML = \"<p>my default template</p>\";\n * document.body.appendChild(template);\n *\n * const themedTemplate = document.createElement(\"template\");\n * themedTemplate.id = \"myTemplate-myTheme\";\n * themedTemplate.innerHTML = \"<p>my themed template</p>\";\n * document.body.appendChild(themedTemplate);\n *\n * // loads the temple and since no theme is set the default template\n * const template1 = findDocumentTemplate(\"myTemplate\");\n * console.log(template1.createDocumentFragment());\n * // ↦ '<p>my default template</p>'\n *\n * // now we set our own theme\n * document\n * .querySelector(\"html\")\n * .setAttribute(\"data-monster-theme-name\", \"myTheme\");\n *\n * // now we don't get the default template,\n * // but the template with the theme in the id\n * const template2 = findDocumentTemplate(\"myTemplate\");\n * console.log(template2.createDocumentFragment());\n * // ↦ '<p>my themed template</p>'\n *\n * @param {string} id\n * @param {Node} currentNode\n * @return {Monster.DOM.Template}\n * @since 1.7.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {Error} template id not found.\n * @throws {TypeError} value is not a string\n */\nfunction findDocumentTemplate(id, currentNode) {\n    validateString(id);\n\n    const document = getGlobalObject('document');\n    const HTMLTemplateElement = getGlobalFunction('HTMLTemplateElement');\n    const DocumentFragment = getGlobalFunction('DocumentFragment');\n    const Document = getGlobalFunction('Document');\n\n\n    let prefixID;\n\n    if (!(currentNode instanceof Document || currentNode instanceof DocumentFragment)) {\n\n        if (currentNode instanceof Node) {\n\n            if (currentNode.hasAttribute(ATTRIBUTE_TEMPLATE_PREFIX)) {\n                prefixID = currentNode.getAttribute(ATTRIBUTE_TEMPLATE_PREFIX)\n            }\n\n            currentNode = currentNode.getRootNode();\n\n            if (!(currentNode instanceof Document || currentNode instanceof DocumentFragment)) {\n                currentNode = currentNode.ownerDocument;\n            }\n\n        }\n\n        if (!(currentNode instanceof Document || currentNode instanceof DocumentFragment)) {\n            currentNode = document;\n        }\n    }\n\n    let template;\n    let theme = getDocumentTheme()\n\n    if (prefixID) {\n        let themedPrefixID = prefixID + '-' + id + '-' + theme.getName();\n\n        // current + themedPrefixID\n        template = currentNode.getElementById(themedPrefixID);\n        if (template instanceof HTMLTemplateElement) {\n            return new Template(template);\n        }\n\n        // document + themedPrefixID\n        template = document.getElementById(themedPrefixID);\n        if (template instanceof HTMLTemplateElement) {\n            return new Template(template);\n        }\n    }\n\n    let themedID = id + '-' + theme.getName();\n\n    // current + themedID\n    template = currentNode.getElementById(themedID);\n    if (template instanceof HTMLTemplateElement) {\n        return new Template(template);\n    }\n\n    // document + themedID\n    template = document.getElementById(themedID);\n    if (template instanceof HTMLTemplateElement) {\n        return new Template(template);\n    }\n\n    // current + ID\n    template = currentNode.getElementById(id);\n    if (template instanceof HTMLTemplateElement) {\n        return new Template(template);\n    }\n\n    // document + ID\n    template = document.getElementById(id);\n    if (template instanceof HTMLTemplateElement) {\n        return new Template(template);\n    }\n\n    throw new Error(\"template \" + id + \" not found.\")\n}\n\n\nassignToNamespace('Monster.DOM', Template, findDocumentTemplate);\nexport {Monster, Template, findDocumentTemplate}\n\n\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {getGlobalObject} from '../types/global.js';\nimport {validateString} from \"../types/validate.js\";\nimport {ATTRIBUTE_THEME_NAME, DEFAULT_THEME} from \"./constants.js\";\n\n\n/**\n * You can call the method via the monster namespace `new Monster.DOM.Theme()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.DOM.Theme())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Theme} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/theme.js';\n * console.log(new Theme())\n * </script>\n * ```\n *\n * @example\n *\n * import {getDocumentTheme} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/theme.js';\n *\n * const theme = getDocumentTheme();\n * console.log(theme.getName());\n * // ↦ monster\n *\n * @since 1.7.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @summary A theme class\n */\nclass Theme extends Base {\n\n    /**\n     *\n     * @param name\n     * @throws {TypeError} value is not a string\n     */\n    constructor(name) {\n        super();\n        validateString(name);\n        this.name = name;\n    }\n\n    /**\n     *\n     * @returns {string}\n     */\n    getName() {\n        return this.name;\n    }\n\n}\n\n/**\n * The theming used in the document can be defined via the html-tag.\n * The theming is specified via the attribute `data-monster-theme-name`.\n *\n * As name for a theme all characters are valid, which are also allowed for a HTMLElement-ID.\n *\n * ```\n * <html data-monster-theme-name=\"my-theme\">\n * ```\n *\n * the default theme name is `monster`.\n *\n * @return {Theme}\n * @memberOf Monster.DOM\n * @since 1.7.0\n */\nfunction getDocumentTheme() {\n    let document = getGlobalObject('document');\n    let name = DEFAULT_THEME;\n\n    let element = document.querySelector('html');\n    if (element instanceof HTMLElement) {\n        let theme = element.getAttribute(ATTRIBUTE_THEME_NAME);\n        if (theme) {\n            name = theme;\n        }\n    }\n\n    return new Theme(name);\n\n}\n\nassignToNamespace('Monster.DOM', Theme, getDocumentTheme);\nexport {Monster, Theme, getDocumentTheme}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {internalSymbol} from \"../constants.js\";\nimport {diff} from \"../data/diff.js\";\nimport {Pathfinder} from \"../data/pathfinder.js\";\nimport {Pipe} from \"../data/pipe.js\";\nimport {\n    ATTRIBUTE_ERRORMESSAGE,\n    ATTRIBUTE_UPDATER_ATTRIBUTES,\n    ATTRIBUTE_UPDATER_BIND,\n    ATTRIBUTE_UPDATER_INSERT,\n    ATTRIBUTE_UPDATER_INSERT_REFERENCE,\n    ATTRIBUTE_UPDATER_REMOVE,\n    ATTRIBUTE_UPDATER_REPLACE,\n    ATTRIBUTE_UPDATER_SELECT_THIS\n} from \"../dom/constants.js\";\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from \"../types/base.js\";\nimport {isArray, isInstance, isIterable} from \"../types/is.js\";\nimport {Observer} from \"../types/observer.js\";\nimport {ProxyObserver} from \"../types/proxyobserver.js\";\nimport {validateArray, validateInstance} from \"../types/validate.js\";\nimport {clone} from \"../util/clone.js\";\nimport {trimSpaces} from \"../util/trimspaces.js\";\nimport {findTargetElementFromEvent} from \"./events.js\";\nimport {findDocumentTemplate} from \"./template.js\";\nimport {getDocument} from \"./util.js\";\n\n\n/**\n * The updater class connects an object with the dom. In this way, structures and contents in the DOM can be programmatically adapted via attributes.\n *\n * For example, to include a string from an object, the attribute `data-monster-replace` can be used.\n * a further explanation can be found under {@tutorial dom-based-templating-implementation}.\n *\n * Changes to attributes are made only when the direct values are changed. If you want to assign changes to other values\n * as well, you have to insert the attribute `data-monster-select-this`. This should be done with care, as it can reduce performance.\n *\n * You can create an object of this class using the monster namespace `new Monster.DOM.Updater()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.DOM.Updater()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/updater.js';\n * new Updater()\n * </script>\n * ```\n *\n * @example\n *\n * import {Updater} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/updater.js';\n *\n * // First we prepare the html document.\n * // This is done here via script, but can also be inserted into the document as pure html.\n * // To do this, simply insert the tag <h1 data-monster-replace=\"path:headline\"></h1>.\n * const body = document.querySelector('body');\n * const headline = document.createElement('h1');\n * headline.setAttribute('data-monster-replace','path:headline')\n * body.appendChild(headline);\n *\n * // the data structure\n * let obj = {\n *    headline: \"Hello World\",\n * };\n *\n * // Now comes the real magic. we pass the updater the parent HTMLElement\n * // and the desired data structure.\n * const updater = new Updater(body, obj);\n * updater.run();\n *\n * // Now you can change the data structure and the HTML will follow these changes.\n * const subject = updater.getSubject();\n * subject['headline'] = \"Hello World!\"\n *\n * @since 1.8.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {Error} the value is not iterable\n * @throws {Error} pipes are not allowed when cloning a node.\n * @throws {Error} no template was found with the specified key.\n * @throws {Error} the maximum depth for the recursion is reached.\n * @throws {TypeError} value is not a object\n * @throws {TypeError} value is not an instance of HTMLElement\n * @summary The updater class connects an object with the dom\n */\nclass Updater extends Base {\n\n    /**\n     * @since 1.8.0\n     * @param {HTMLElement} element\n     * @param {object|ProxyObserver|undefined} subject\n     * @throws {TypeError} value is not a object\n     * @throws {TypeError} value is not an instance of HTMLElement\n     * @see {@link Monster.DOM.findDocumentTemplate}\n     */\n    constructor(element, subject) {\n        super();\n\n        /**\n         * @type {HTMLElement}\n         */\n        if (subject === undefined) subject = {}\n        if (!isInstance(subject, ProxyObserver)) {\n            subject = new ProxyObserver(subject);\n        }\n\n        this[internalSymbol] = {\n            element: validateInstance(element, HTMLElement),\n            last: {},\n            callbacks: new Map(),\n            eventTypes: ['keyup', 'click', 'change', 'drop', 'touchend', 'input'],\n            subject: subject\n        }\n\n        this[internalSymbol].callbacks.set('checkstate', getCheckStateCallback.call(this));\n\n        this[internalSymbol].subject.attachObserver(new Observer(() => {\n\n            const s = this[internalSymbol].subject.getRealSubject();\n\n            const diffResult = diff(this[internalSymbol].last, s)\n            this[internalSymbol].last = clone(s);\n\n            for (const [, change] of Object.entries(diffResult)) {\n                removeElement.call(this, change);\n                insertElement.call(this, change);\n                updateContent.call(this, change);\n                updateAttributes.call(this, change);\n            }\n        }));\n\n    }\n\n    /**\n     * Defaults: 'keyup', 'click', 'change', 'drop', 'touchend'\n     *\n     * @see {@link https://developer.mozilla.org/de/docs/Web/Events}\n     * @since 1.9.0\n     * @param {Array} types\n     * @return {Updater}\n     */\n    setEventTypes(types) {\n        this[internalSymbol].eventTypes = validateArray(types);\n        return this;\n    }\n\n    /**\n     * With this method, the eventlisteners are hooked in and the magic begins.\n     *\n     * ```\n     * updater.run().then(() => {\n     *   updater.enableEventProcessing();\n     * });\n     * ```\n     *\n     * @since 1.9.0\n     * @return {Updater}\n     * @throws {Error} the bind argument must start as a value with a path\n     */\n    enableEventProcessing() {\n        this.disableEventProcessing();\n\n        for (const type of this[internalSymbol].eventTypes) {\n            // @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n            this[internalSymbol].element.addEventListener(type, getControlEventHandler.call(this), {\n                capture: true,\n                passive: true\n            });\n        }\n\n        return this;\n\n    }\n\n    /**\n     * This method turns off the magic or who loves it more profane it removes the eventListener.\n     *\n     * @since 1.9.0\n     * @return {Updater}\n     */\n    disableEventProcessing() {\n\n        for (const type of this[internalSymbol].eventTypes) {\n            this[internalSymbol].element.removeEventListener(type, getControlEventHandler.call(this));\n        }\n\n        return this;\n\n    }\n\n    /**\n     * The run method must be called for the update to start working.\n     * The method ensures that changes are detected.\n     *\n     * ```\n     * updater.run().then(() => {\n     *   updater.enableEventProcessing();\n     * });\n     * ```\n     *\n     * @summary Let the magic begin\n     * @return {Promise}\n     */\n    run() {\n        // the key __init__has no further meaning and is only \n        // used to create the diff for empty objects.\n        this[internalSymbol].last = {'__init__': true};\n        return this[internalSymbol].subject.notifyObservers();\n    }\n\n    /**\n     * Gets the values of bound elements and changes them in subject\n     *\n     * @since 1.27.0\n     * @return {Monster.DOM.Updater}\n     */\n    retrieve() {\n        retrieveFromBindings.call(this);\n        return this;\n    }\n\n    /**\n     * If you have passed a ProxyObserver in the constructor, you will get the object that the ProxyObserver manages here.\n     * However, if you passed a simple object, here you will get a proxy for that object.\n     *\n     * For changes the ProxyObserver must be used.\n     *\n     * @since 1.8.0\n     * @return {Proxy}\n     */\n    getSubject() {\n        return this[internalSymbol].subject.getSubject();\n    }\n\n    /**\n     * This method can be used to register commands that can be called via call: instruction.\n     * This can be used to provide a pipe with its own functionality.\n     *\n     * @param {string} name\n     * @param {function} callback\n     * @returns {Transformer}\n     * @throws {TypeError} value is not a string\n     * @throws {TypeError} value is not a function\n     */\n    setCallback(name, callback) {\n        this[internalSymbol].callbacks.set(name, callback);\n        return this;\n    }\n\n}\n\n/**\n * @private\n * @since 1.9.0\n * @return {function\n * @this Updater\n */\nfunction getCheckStateCallback() {\n    const self = this;\n\n    return function (current) {\n\n        // this is a reference to the current object (therefore no array function here)\n        if (this instanceof HTMLInputElement) {\n            if (['radio', 'checkbox'].indexOf(this.type) !== -1) {\n                return (this.value + \"\" === current + \"\") ? 'true' : undefined\n            }\n        } else if (this instanceof HTMLOptionElement) {\n\n            if (isArray(current) && current.indexOf(this.value) !== -1) {\n                return 'true'\n            }\n\n            return undefined;\n        }\n    }\n}\n\n/**\n * @private\n */\nconst symbol = Symbol('EventHandler');\n\n/**\n * @private\n * @return {function}\n * @this Updater\n * @throws {Error} the bind argument must start as a value with a path\n */\nfunction getControlEventHandler() {\n\n    const self = this;\n\n    if (self[symbol]) {\n        return self[symbol];\n    }\n\n    /**\n     * @throws {Error} the bind argument must start as a value with a path.\n     * @throws {Error} unsupported object\n     * @param {Event} event\n     */\n    self[symbol] = (event) => {\n        const element = findTargetElementFromEvent(event, ATTRIBUTE_UPDATER_BIND);\n\n        if (element === undefined) {\n            return;\n        }\n\n        retrieveAndSetValue.call(self, element);\n\n    }\n\n    return self[symbol];\n\n\n}\n\n/**\n * @throws {Error} the bind argument must start as a value with a path\n * @param {HTMLElement} element\n * @return void\n * @memberOf Monster.DOM\n * @private\n */\nfunction retrieveAndSetValue(element) {\n\n    const self = this;\n\n    const pathfinder = new Pathfinder(self[internalSymbol].subject.getSubject());\n\n    let path = element.getAttribute(ATTRIBUTE_UPDATER_BIND);\n\n    if (path.indexOf('path:') !== 0) {\n        throw new Error('the bind argument must start as a value with a path');\n    }\n\n    path = path.substr(5);\n\n    let value;\n\n    if (element instanceof HTMLInputElement) {\n        switch (element.type) {\n\n            case 'checkbox':\n                value = element.checked ? element.value : undefined;\n                break;\n            default:\n                value = element.value;\n                break;\n\n\n        }\n    } else if (element instanceof HTMLTextAreaElement) {\n        value = element.value;\n\n    } else if (element instanceof HTMLSelectElement) {\n\n        switch (element.type) {\n            case 'select-one':\n                value = element.value;\n                break;\n            case 'select-multiple':\n                value = element.value;\n\n                let options = element?.selectedOptions;\n                if (options === undefined) options = element.querySelectorAll(\":scope option:checked\");\n                value = Array.from(options).map(({value}) => value);\n\n                break;\n        }\n\n\n        // values from customelements \n    } else if ((element?.constructor?.prototype && !!Object.getOwnPropertyDescriptor(element.constructor.prototype, 'value')?.['get']) || element.hasOwnProperty('value')) {\n        value = element?.['value'];\n    } else {\n        throw new Error(\"unsupported object\");\n    }\n\n    const copy = clone(self[internalSymbol].subject.getRealSubject());\n    const pf = new Pathfinder(copy);\n    pf.setVia(path, value);\n\n    const diffResult = diff(copy, self[internalSymbol].subject.getRealSubject());\n\n    if (diffResult.length > 0) {\n        pathfinder.setVia(path, value);\n    }\n}\n\n/**\n * @since 1.27.0\n * @return void\n * @private\n */\nfunction retrieveFromBindings() {\n    const self = this;\n\n    if (self[internalSymbol].element.matches('[' + ATTRIBUTE_UPDATER_BIND + ']')) {\n        retrieveAndSetValue.call(self, element)\n    }\n\n    for (const [, element] of self[internalSymbol].element.querySelectorAll('[' + ATTRIBUTE_UPDATER_BIND + ']').entries()) {\n        retrieveAndSetValue.call(self, element)\n    }\n\n}\n\n/**\n * @private\n * @since 1.8.0\n * @param {object} change\n * @return {void}\n */\nfunction removeElement(change) {\n    const self = this;\n\n    for (const [, element] of self[internalSymbol].element.querySelectorAll(':scope [' + ATTRIBUTE_UPDATER_REMOVE + ']').entries()) {\n        element.parentNode.removeChild(element);\n    }\n}\n\n/**\n * @private\n * @since 1.8.0\n * @param {object} change\n * @return {void}\n * @throws {Error} the value is not iterable\n * @throws {Error} pipes are not allowed when cloning a node.\n * @throws {Error} no template was found with the specified key.\n * @throws {Error} the maximum depth for the recursion is reached.\n * @this Updater\n */\nfunction insertElement(change) {\n    const self = this;\n    const subject = self[internalSymbol].subject.getRealSubject();\n    const document = getDocument();\n\n    let mem = new WeakSet;\n    let wd = 0;\n\n    const container = self[internalSymbol].element;\n\n    while (true) {\n        let found = false;\n        wd++;\n\n        let p = clone(change?.['path']);\n        if (!isArray(p)) return self;\n\n        while (p.length > 0) {\n            const current = p.join('.');\n\n            let iterator = new Set;\n            const query = '[' + ATTRIBUTE_UPDATER_INSERT + '*=\"path:' + current + '\"]';\n\n            const e = container.querySelectorAll(query);\n\n            if (e.length > 0) {\n                iterator = new Set(\n                    [...e]\n                )\n            }\n\n            if (container.matches(query)) {\n                iterator.add(container);\n            }\n\n            for (const [, containerElement] of iterator.entries()) {\n\n                if (mem.has(containerElement)) continue;\n                mem.add(containerElement)\n\n                found = true;\n\n                const attributes = containerElement.getAttribute(ATTRIBUTE_UPDATER_INSERT);\n                let def = trimSpaces(attributes);\n                let i = def.indexOf(' ');\n                let key = trimSpaces(def.substr(0, i));\n                let refPrefix = key + '-';\n                let cmd = trimSpaces(def.substr(i));\n\n                // this case is actually excluded by the query but is nevertheless checked again here\n                if (cmd.indexOf('|') > 0) {\n                    throw new Error(\"pipes are not allowed when cloning a node.\");\n                }\n\n                let pipe = new Pipe(cmd);\n                self[internalSymbol].callbacks.forEach((f, n) => {\n                    pipe.setCallback(n, f);\n                })\n\n                let value\n                try {\n                    containerElement.removeAttribute(ATTRIBUTE_ERRORMESSAGE);\n                    value = pipe.run(subject)\n                } catch (e) {\n                    containerElement.setAttribute(ATTRIBUTE_ERRORMESSAGE, e.message);\n                }\n\n                let dataPath = cmd.split(':').pop();\n\n                let insertPoint;\n                if (containerElement.hasChildNodes()) {\n                    insertPoint = containerElement.lastChild;\n                }\n\n                if (!isIterable(value)) {\n                    throw new Error('the value is not iterable');\n                }\n\n                let available = new Set;\n\n                for (const [i, obj] of Object.entries(value)) {\n                    let ref = refPrefix + i;\n                    let currentPath = dataPath + \".\" + i;\n\n                    available.add(ref);\n                    let refElement = containerElement.querySelector('[' + ATTRIBUTE_UPDATER_INSERT_REFERENCE + '=\"' + ref + '\"]');\n\n                    if (refElement instanceof HTMLElement) {\n                        insertPoint = refElement;\n                        continue;\n                    }\n\n                    appendNewDocumentFragment(containerElement, key, ref, currentPath);\n                }\n\n                let nodes = containerElement.querySelectorAll('[' + ATTRIBUTE_UPDATER_INSERT_REFERENCE + '*=\"' + refPrefix + '\"]');\n                for (const [, node] of Object.entries(nodes)) {\n                    if (!available.has(node.getAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE))) {\n                        try {\n                            containerElement.removeChild(node);\n                        } catch (e) {\n                            containerElement.setAttribute(ATTRIBUTE_ERRORMESSAGE, (containerElement.getAttribute(ATTRIBUTE_ERRORMESSAGE) + \", \" + e.message).trim());\n                        }\n\n                    }\n                }\n            }\n\n            p.pop();\n        }\n\n        if (found === false) break;\n        if (wd++ > 200) {\n            throw new Error('the maximum depth for the recursion is reached.');\n        }\n\n    }\n\n\n}\n\n/**\n *\n * @private\n * @since 1.8.0\n * @param {HTMLElement} container\n * @param {string} key\n * @param {string} ref\n * @param {string} path\n * @throws {Error} no template was found with the specified key.\n */\nfunction appendNewDocumentFragment(container, key, ref, path) {\n\n    let template = findDocumentTemplate(key, container);\n\n    let nodes = template.createDocumentFragment();\n    for (const [, node] of Object.entries(nodes.childNodes)) {\n        if (node instanceof HTMLElement) {\n\n            applyRecursive(node, key, path);\n            node.setAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE, ref);\n        }\n\n        container.appendChild(node);\n    }\n}\n\n/**\n * @private\n * @since 1.10.0\n * @param {HTMLElement} node\n * @param {string} key\n * @param {string} path\n * @return {void}\n */\nfunction applyRecursive(node, key, path) {\n\n    if (node instanceof HTMLElement) {\n\n        if (node.hasAttribute(ATTRIBUTE_UPDATER_REPLACE)) {\n            let value = node.getAttribute(ATTRIBUTE_UPDATER_REPLACE);\n            node.setAttribute(ATTRIBUTE_UPDATER_REPLACE, value.replaceAll(\"path:\" + key, \"path:\" + path));\n        }\n\n        if (node.hasAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES)) {\n            let value = node.getAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES);\n            node.setAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES, value.replaceAll(\"path:\" + key, \"path:\" + path));\n        }\n\n        for (const [, child] of Object.entries(node.childNodes)) {\n            applyRecursive(child, key, path);\n        }\n    }\n}\n\n/**\n * @private\n * @since 1.8.0\n * @param {object} change\n * @return {void}\n * @this Updater\n */\nfunction updateContent(change) {\n    const self = this;\n    const subject = self[internalSymbol].subject.getRealSubject();\n\n    let p = clone(change?.['path']);\n    runUpdateContent.call(this, this[internalSymbol].element, p, subject);\n\n    const slots = this[internalSymbol].element.querySelectorAll('slot');\n    if (slots.length > 0) {\n        for (const [, slot] of Object.entries(slots)) {\n            for (const [, element] of Object.entries(slot.assignedNodes())) {\n                runUpdateContent.call(this, element, p, subject);\n            }\n        }\n    }\n\n\n}\n\n/**\n * @private\n * @since 1.8.0\n * @param {HTMLElement} container\n * @param {array} parts\n * @param {object} subject\n * @return {void}\n */\nfunction runUpdateContent(container, parts, subject) {\n    if (!isArray(parts)) return;\n    if (!(container instanceof HTMLElement)) return;\n    parts = clone(parts);\n\n    let mem = new WeakSet;\n\n    while (parts.length > 0) {\n        const current = parts.join('.');\n        parts.pop();\n\n        // Unfortunately, static data is always changed as well, since it is not possible to react to changes here.\n        const query = '[' + ATTRIBUTE_UPDATER_REPLACE + '^=\"path:' + current + '\"], [' + ATTRIBUTE_UPDATER_REPLACE + '^=\"static:\"]';\n        const e = container.querySelectorAll('' + query);\n\n        const iterator = new Set([\n            ...e\n        ])\n\n        if (container.matches(query)) {\n            iterator.add(container);\n        }\n\n        /**\n         * @type {HTMLElement} element\n         */\n        for (const [element] of iterator.entries()) {\n\n            if (mem.has(element)) return;\n            mem.add(element)\n\n            const attributes = element.getAttribute(ATTRIBUTE_UPDATER_REPLACE)\n            let cmd = trimSpaces(attributes);\n\n            let pipe = new Pipe(cmd);\n            this[internalSymbol].callbacks.forEach((f, n) => {\n                pipe.setCallback(n, f);\n            })\n\n            let value\n            try {\n                element.removeAttribute(ATTRIBUTE_ERRORMESSAGE);\n                value = pipe.run(subject)\n            } catch (e) {\n                element.setAttribute(ATTRIBUTE_ERRORMESSAGE, e.message);\n            }\n\n            if (value instanceof HTMLElement) {\n                while (element.firstChild) {\n                    element.removeChild(element.firstChild);\n                }\n                \n                try {\n                    element.appendChild(value);\n                } catch (e) {\n                    element.setAttribute(ATTRIBUTE_ERRORMESSAGE, (element.getAttribute(ATTRIBUTE_ERRORMESSAGE) + \", \" + e.message).trim());\n                }\n\n            } else {\n                element.innerHTML = value;\n            }\n\n        }\n\n\n    }\n\n}\n\n/**\n * @private\n * @since 1.8.0\n * @param {string} path\n * @param {object} change\n * @return {void}\n */\nfunction updateAttributes(change) {\n    const subject = this[internalSymbol].subject.getRealSubject();\n    let p = clone(change?.['path']);\n    runUpdateAttributes.call(this, this[internalSymbol].element, p, subject);\n}\n\n/**\n * @private\n * @param {HTMLElement} container\n * @param {array} parts\n * @param {object} subject\n * @return {void}\n * @this Updater\n */\nfunction runUpdateAttributes(container, parts, subject) {\n\n    const self = this;\n\n    if (!isArray(parts)) return;\n    parts = clone(parts);\n\n    let mem = new WeakSet;\n\n    while (parts.length > 0) {\n        const current = parts.join('.');\n        parts.pop();\n\n        let iterator = new Set;\n\n        const query = '[' + ATTRIBUTE_UPDATER_SELECT_THIS + '], [' + ATTRIBUTE_UPDATER_ATTRIBUTES + '*=\"path:' + current + '\"], [' + ATTRIBUTE_UPDATER_ATTRIBUTES + '^=\"static:\"]';\n\n        const e = container.querySelectorAll(query);\n\n        if (e.length > 0) {\n            iterator = new Set(\n                [...e]\n            )\n        }\n\n        if (container.matches(query)) {\n            iterator.add(container);\n        }\n\n        for (const [element] of iterator.entries()) {\n\n            if (mem.has(element)) return;\n            mem.add(element)\n\n            const attributes = element.getAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES)\n\n            for (let [, def] of Object.entries(attributes.split(','))) {\n                def = trimSpaces(def);\n                let i = def.indexOf(' ');\n                let name = trimSpaces(def.substr(0, i));\n                let cmd = trimSpaces(def.substr(i));\n\n                let pipe = new Pipe(cmd);\n\n                self[internalSymbol].callbacks.forEach((f, n) => {\n                    pipe.setCallback(n, f, element);\n                })\n\n                let value\n                try {\n                    element.removeAttribute(ATTRIBUTE_ERRORMESSAGE);\n                    value = pipe.run(subject)\n                } catch (e) {\n                    element.setAttribute(ATTRIBUTE_ERRORMESSAGE, e.message);\n                }\n\n\n                if (value === undefined) {\n                    element.removeAttribute(name)\n\n                } else if (element.getAttribute(name) !== value) {\n                    element.setAttribute(name, value);\n                }\n\n                handleInputControlAttributeUpdate.call(this, element, name, value);\n\n            }\n        }\n    }\n\n}\n\n/**\n * @private\n * @param {HTMLElement|*} element\n * @param {string} name\n * @param {string|number|undefined} value\n * @return {void}\n * @this Updater\n */\n\nfunction handleInputControlAttributeUpdate(element, name, value) {\n    const self = this;\n\n    if (element instanceof HTMLSelectElement) {\n\n\n        switch (element.type) {\n            case 'select-multiple':\n\n                for (const [index, opt] of Object.entries(element.options)) {\n                    if (value.indexOf(opt.value) !== -1) {\n                        opt.selected = true;\n                    } else {\n                        opt.selected = false;\n                    }\n                }\n\n                break;\n            case 'select-one':\n                // Only one value may be selected\n\n                for (const [index, opt] of Object.entries(element.options)) {\n                    if (opt.value === value) {\n                        element.selectedIndex = index;\n                        break;\n                    }\n                }\n\n                break;\n        }\n\n\n    } else if (element instanceof HTMLInputElement) {\n        switch (element.type) {\n\n            case 'radio':\n                if (name === 'checked') {\n\n                    if (value !== undefined) {\n                        element.checked = true;\n                    } else {\n                        element.checked = false;\n                    }\n                }\n\n                break;\n\n            case 'checkbox':\n\n                if (name === 'checked') {\n\n                    if (value !== undefined) {\n                        element.checked = true;\n                    } else {\n                        element.checked = false;\n                    }\n                }\n\n                break;\n            case 'text':\n            default:\n                if (name === 'value') {\n                    element.value = (value === undefined ? \"\" : value);\n                }\n\n                break;\n\n\n        }\n    } else if (element instanceof HTMLTextAreaElement) {\n        if (name === 'value') {\n            element.value = (value === undefined ? \"\" : value);\n        }\n    }\n\n}\n\nassignToNamespace('Monster.DOM', Updater);\nexport {Monster, Updater}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from \"../namespace.js\";\nimport {ID} from \"../types/id.js\";\nimport {isObject} from \"../types/is.js\";\nimport {validateString} from \"../types/validate.js\";\n\n/**\n * This special trim function allows to trim spaces that have been protected by a special escape character.\n *\n * You can call the method via the monster namespace `Monster.Util.trimSpaces()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Util.trimSpaces(\" hello \")\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {trimSpaces} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/util/trimspaces.js';\n * trimSpaces(' hello \\\\ ')\n * </script>\n * ```\n * \n * Hint: One stroke is escaped by the javascript interpreter, the second stroke escapes the stroke.\n * \n * ```text\n * a\\ b  ↦ a b\n * a\\\\ b ↦ a\\ b\n * ```\n * \n * @since 1.24.0\n * @memberOf Monster.Util\n * @copyright schukai GmbH\n * @param {string} value\n * @return {string}\n * @throws {TypeError} value is not a string\n */\nfunction trimSpaces(value) {\n\n    validateString(value);\n\n    let placeholder = new Map;\n    const regex = /((?<pattern>\\\\(?<char>.)){1})/mig;\n\n    // The separator for args must be escaped\n    // undefined string which should not occur normally and is also not a regex\n    let result = value.matchAll(regex)\n\n    for (let m of result) {\n        let g = m?.['groups'];\n        if (!isObject(g)) {\n            continue;\n        }\n\n        let p = g?.['pattern'];\n        let c = g?.['char'];\n\n        if (p && c) {\n            let r = '__' + new ID().toString() + '__';\n            placeholder.set(r, c);\n            value = value.replace(p, r);\n        }\n\n    }\n\n    value = value.trim();\n    placeholder.forEach((v, k) => {\n        value = value.replace(k, '\\\\' + v)\n    })\n\n    return value;\n\n}\n\nassignToNamespace('Monster.Util', trimSpaces);\nexport {Monster, trimSpaces}\n","'use strict';\n\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {isArray,isObject} from \"../types/is.js\";\nimport {validateInstance, validateString} from \"../types/validate.js\";\nimport {getDocument} from \"./util.js\";\n\n/**\n * You can call the function via the monster namespace `new Monster.DOM.fireEvent()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.DOM.fireEvent()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {fireEvent} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/events.js';\n * fireEvent()\n * </script>\n * ```\n *\n * @param {HTMLElement|HTMLCollection|NodeList} element\n * @param {string} type\n * @return {void}\n * @since 1.10.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {TypeError} value is not an instance of HTMLElement or HTMLCollection\n * @summary Construct and send and event\n */\nfunction fireEvent(element, type) {\n\n    const document = getDocument();\n\n    if (element instanceof HTMLElement) {\n\n        if (type === 'click') {\n            element.click();\n            return;\n        }\n\n        let event = new Event(validateString(type), {\n            bubbles: true,\n            cancelable: true,\n        });\n\n        element.dispatchEvent(event);\n\n    } else if (element instanceof HTMLCollection || element instanceof NodeList) {\n        for (let e of element) {\n            fireEvent(e, type);\n        }\n    } else {\n        throw new TypeError('value is not an instance of HTMLElement or HTMLCollection')\n    }\n\n}\n\n/**\n * You can call the function via the monster namespace `new Monster.DOM.fireCustomEvent()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.DOM.fireCustomEvent()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {fireCustomEvent} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/events.js';\n * fireCustomEvent()\n * </script>\n * ```\n *\n * @param {HTMLElement|HTMLCollection|NodeList} element\n * @param {string} type\n * @return {void}\n * @since 1.29.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {TypeError} value is not an instance of HTMLElement or HTMLCollection\n * @summary Construct and send and event\n */\nfunction fireCustomEvent(element, type, detail) {\n\n    const document = getDocument();\n\n    if (element instanceof HTMLElement) {\n\n        if (!isObject(detail)) {\n            detail = {detail};\n        }\n\n        let event = new CustomEvent(validateString(type), {\n            bubbles: true,\n            cancelable: true,\n            detail\n        });\n\n        element.dispatchEvent(event);\n\n    } else if (element instanceof HTMLCollection || element instanceof NodeList) {\n        for (let e of element) {\n            fireCustomEvent(e, type, detail);\n        }\n    } else {\n        throw new TypeError('value is not an instance of HTMLElement or HTMLCollection')\n    }\n\n}\n\n/**\n * This function gets the path `Event.composedPath()` from an event and tries to find the next element\n * up the tree `element.closest()` with the attribute and value. If no value, or a value that is undefined or null,\n * is specified, only the attribute is searched.\n *\n * You can call the function via the monster namespace `new Monster.DOM.findTargetElementFromEvent()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.DOM.findTargetElementFromEvent()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {findTargetElementFromEvent} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/events.js';\n * findTargetElementFromEvent()\n * </script>\n * ```\n *\n * @since 1.14.0\n * @param {Event} event\n * @param {string} attributeName\n * @param {string|null|undefined} attributeValue\n * @throws {Error} unsupported event\n * @memberOf Monster.DOM\n * @throws {TypeError} value is not a string\n * @throws {TypeError} value is not an instance of HTMLElement\n * @summary Help function to find the appropriate control\n */\nfunction findTargetElementFromEvent(event, attributeName, attributeValue) {\n    validateInstance(event, Event);\n\n    if (typeof event.composedPath !== 'function') {\n        throw new Error('unsupported event');\n    }\n\n    const path = event.composedPath();\n\n    // closest cannot be used here, because closest is not correct for slotted elements\n    if (isArray(path)) {\n        for (let i = 0; i < path.length; i++) {\n            const o = path[i];\n\n            if (o instanceof HTMLElement &&\n                o.hasAttribute(attributeName)\n                && (attributeValue === undefined || o.getAttribute(attributeName) === attributeValue)) {\n                return o;\n            }\n        }\n    }\n\n    return undefined;\n\n}\n\n\nassignToNamespace('Monster.DOM', findTargetElementFromEvent, fireEvent, fireCustomEvent);\nexport {Monster, findTargetElementFromEvent, fireEvent, fireCustomEvent}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {getGlobal} from \"../types/global.js\";\nimport {validateString} from \"../types/validate.js\";\n\n\n/**\n * this method fetches the document object\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.DOM.getDocument())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getDocument} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/util.js';\n * console.log(getDocument())\n * </script>\n * ```\n *\n * in nodejs this functionality can be performed with [jsdom](https://www.npmjs.com/package/jsdom).\n *\n * ```\n * import {JSDOM} from \"jsdom\"\n * if (typeof window !== \"object\") {\n *    const {window} = new JSDOM('', {\n *        url: 'http://example.com/',\n *        pretendToBeVisual: true\n *    });\n *\n *    [\n *        'self',\n *        'document',\n *        'Document',\n *        'Node',\n *        'Element',\n *        'HTMLElement',\n *        'DocumentFragment',\n *        'DOMParser',\n *        'XMLSerializer',\n *        'NodeFilter',\n *        'InputEvent',\n *        'CustomEvent'\n *    ].forEach(key => (getGlobal()[key] = window[key]));\n * }\n * ```\n *\n * @returns {object}\n * @since 1.6.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {Error} not supported environment\n */\nfunction getDocument() {\n    let document = getGlobal()?.['document'];\n    if (typeof document !== 'object') {\n        throw new Error(\"not supported environment\")\n    }\n\n    return document;\n}\n\n/**\n * this method fetches the window object\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.DOM.getWindow())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getWindow} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/util.js';\n * console.log(getWindow(null))\n * </script>\n * ```\n *\n * in nodejs this functionality can be performed with [jsdom](https://www.npmjs.com/package/jsdom).\n *\n * ```\n * import {JSDOM} from \"jsdom\"\n * if (typeof window !== \"object\") {\n *    const {window} = new JSDOM('', {\n *        url: 'http://example.com/',\n *        pretendToBeVisual: true\n *    });\n *\n *    getGlobal()['window']=window;\n * \n *    [\n *        'self',\n *        'document',\n *        'Document',\n *        'Node',\n *        'Element',\n *        'HTMLElement',\n *        'DocumentFragment',\n *        'DOMParser',\n *        'XMLSerializer',\n *        'NodeFilter',\n *        'InputEvent',\n *        'CustomEvent'\n *    ].forEach(key => (getGlobal()[key] = window[key]));\n * }\n * ```\n *\n * @returns {object}\n * @since 1.6.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {Error} not supported environment\n */\nfunction getWindow() {\n    let window = getGlobal()?.['window'];\n    if (typeof window !== 'object') {\n        throw new Error(\"not supported environment\")\n    }\n\n    return window;\n}\n\n\n/**\n *\n *\n * this method fetches the document object\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.DOM.getDocumentFragmentFromString())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getDocumentFragmentFromString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/util.js';\n * console.log(getDocumentFragmentFromString('<div></div>'))\n * </script>\n * ```\n *\n * in nodejs this functionality can be performed with [jsdom](https://www.npmjs.com/package/jsdom).\n *\n * ```\n * import {JSDOM} from \"jsdom\"\n * if (typeof window !== \"object\") {\n *    const {window} = new JSDOM('', {\n *        url: 'http://example.com/',\n *        pretendToBeVisual: true\n *    });\n *\n *    [\n *        'self',\n *        'document',\n *        'Document',\n *        'Node',\n *        'Element',\n *        'HTMLElement',\n *        'DocumentFragment',\n *        'DOMParser',\n *        'XMLSerializer',\n *        'NodeFilter',\n *        'InputEvent',\n *        'CustomEvent'\n *    ].forEach(key => (getGlobal()[key] = window[key]));\n * }\n * ```\n *\n * @returns {DocumentFragment}\n * @since 1.6.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {Error} not supported environment\n * @throws {TypeError} value is not a string\n */\nfunction getDocumentFragmentFromString(html) {\n    validateString(html);\n\n    const document = getDocument();\n    const template = document.createElement('template');\n    template.innerHTML = html;\n\n    return template.content;\n}\n\n\nassignToNamespace('Monster.DOM', getWindow, getDocument, getDocumentFragmentFromString);\nexport {Monster, getWindow, getDocument, getDocumentFragmentFromString}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {parseLocale} from \"../i18n/locale.js\";\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {getDocument} from \"./util.js\";\n\n/**\n * @private\n * @type {string}\n */\nconst DEFAULT_LANGUAGE = 'en';\n\n/**\n * With this function you can read the language version set by the document.\n * For this the attribute `lang` in the html tag is read. If no attribute is set, `en` is used as default.\n * \n * ```html\n * <html lang=\"en\">\n * ```\n *\n * You can call the function via the monster namespace `new Monster.DOM.getLocaleOfDocument()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.DOM.getLocaleOfDocument()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getLocaleOfDocument} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/locale.js';\n * new getLocaleOfDocument()\n * </script>\n * ```\n *\n * @since 1.13.0\n * @copyright schukai GmbH\n * @memberOf Monster.DOM\n * @throws {TypeError} value is not a string\n * @throws {Error} unsupported locale\n * @summary Tries to determine the locale used\n */\nfunction getLocaleOfDocument() {\n\n    const document = getDocument();\n\n    let html = document.querySelector('html')\n    if (html instanceof HTMLElement && html.hasAttribute('lang')) {\n        let locale = html.getAttribute('lang');\n        if (locale) {\n            return new parseLocale(locale)\n        }\n    }\n\n    return parseLocale(DEFAULT_LANGUAGE);\n}\n\nassignToNamespace('Monster.DOM', getLocaleOfDocument);\nexport {Monster, getLocaleOfDocument}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from \"../types/base.js\";\nimport {validateString} from \"../types/validate.js\";\nimport {clone} from \"../util/clone.js\";\n\n/**\n * @memberOf Monster.I18n\n * @type {symbol}\n */\nconst propertiesSymbol = Symbol('properties');\n\n/**\n * @type {symbol}\n * @memberOf Monster.I18n\n */\nconst localeStringSymbol = Symbol('localeString');\n\n/**\n * You can create an instance via the monster namespace `new Monster.I18n.Locale()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.I18n.Locale()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this class individually.\n *\n * ```\n * <script type=\"module\">\n * import {Locale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/locale.js';\n * new Locale()\n * </script>\n * ```\n *\n * RFC\n *\n * ```\n * A Language-Tag consists of:\n * langtag                           ; generated tag\n *           -or- private-use        ; a private use tag\n *\n * langtag       = (language\n *                    [\"-\" script]\n *                    [\"-\" region]\n *                    *(\"-\" variant)\n *                    *(\"-\" extension)\n *                    [\"-\" privateuse])\n *\n * language      = \"en\", \"ale\", or a registered value\n *\n * script        = \"Latn\", \"Cyrl\", \"Hant\" ISO 15924 codes\n *\n * region        = \"US\", \"CS\", \"FR\" ISO 3166 codes\n *                 \"419\", \"019\",  or UN M.49 codes\n *\n * variant       = \"rozaj\", \"nedis\", \"1996\", multiple subtags can be used in a tag\n *\n * extension     = single letter followed by additional subtags; more than one extension\n *                 may be used in a language tag\n *\n * private-use   = \"x-\" followed by additional subtags, as many as are required\n *                 Note that these can start a tag or appear at the end (but not\n *                 in the middle)\n * ```\n *\n * @since 1.13.0\n * @copyright schukai GmbH\n * @memberOf Monster.I18n\n * @see https://datatracker.ietf.org/doc/html/rfc3066\n */\nclass Locale extends Base {\n\n    /**\n     * @param {string} language\n     * @param {string} [region]\n     * @param {string} [script]\n     * @param {string} [variants]\n     * @param {string} [extlang]\n     * @param {string} [privateUse]\n     * @throws {Error} unsupported locale\n     */\n    constructor(language, region, script, variants, extlang, privateUse) {\n        super();\n\n        this[propertiesSymbol] = {\n            language: (language === undefined) ? undefined : validateString(language),\n            script: (script === undefined) ? undefined : validateString(script),\n            region: (region === undefined) ? undefined : validateString(region),\n            variants: (variants === undefined) ? undefined : validateString(variants),\n            extlang: (extlang === undefined) ? undefined : validateString(extlang),\n            privateUse: (privateUse === undefined) ? undefined : validateString(privateUse),\n        };\n\n        let s = [];\n        if (language !== undefined) s.push(language);\n        if (script !== undefined) s.push(script);\n        if (region !== undefined) s.push(region);\n        if (variants !== undefined) s.push(variants);\n        if (extlang !== undefined) s.push(extlang);\n        if (privateUse !== undefined) s.push(privateUse);\n\n        if (s.length === 0) {\n            throw new Error('unsupported locale');\n        }\n\n        this[localeStringSymbol] = s.join('-');\n\n    }\n\n    /**\n     * @return {string}\n     */\n    get localeString() {\n        return this[localeStringSymbol];\n    }\n\n    /**\n     * @return {string|undefined}\n     */\n    get language() {\n        return this[propertiesSymbol].language;\n    }\n\n    /**\n     * @return {string|undefined}\n     */\n    get region() {\n        return this[propertiesSymbol].region;\n    }\n\n    /**\n     * @return {string|undefined}\n     */\n    get script() {\n        return this[propertiesSymbol].script;\n    }\n\n    /**\n     * @return {string|undefined}\n     */\n    get variants() {\n        return this[propertiesSymbol].variants;\n    }\n\n    /**\n     * @return {string|undefined}\n     */\n    get extlang() {\n        return this[propertiesSymbol].extlang;\n    }\n\n    /**\n     * @return {string|undefined}\n     */\n    get privateUse() {\n        return this[propertiesSymbol].privateValue;\n    }\n\n\n    /**\n     * @return {string}\n     */\n    toString() {\n        return \"\" + this.localeString;\n    }\n\n    /**\n     * The structure has the following: language, script, region, variants, extlang, privateUse\n     *\n     * @return {Monster.I18n.LocaleMap}\n     */\n    getMap() {\n        return clone(this[propertiesSymbol])\n    }\n\n\n}\n\n/**\n * @typedef {Object} LocaleMap\n * @property {string} language\n * @property {string} script\n * @property {string} region\n * @property {string} variants\n * @property {string} extlang\n * @property {string} privateUse\n * @memberOf Monster.I18n\n */\n\n/**\n * Parse local according to rfc4646 standard\n *\n * Limitations: The regex cannot handle multiple variants or private.\n *\n * You can call the method via the monster namespace `Monster.I18n.createLocale()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.I18n.createLocale()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {createLocale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/locale.js';\n * createLocale()\n * </script>\n * ```\n *\n * RFC\n *\n * ```\n *   The syntax of the language tag in ABNF [RFC4234] is:\n *\n *   Language-Tag  = langtag\n *                 / privateuse             ; private use tag\n *                 / grandfathered          ; grandfathered registrations\n *\n *   langtag       = (language\n *                    [\"-\" script]\n *                    [\"-\" region]\n *                    *(\"-\" variant)\n *                    *(\"-\" extension)\n *                    [\"-\" privateuse])\n *\n *   language      = (2*3ALPHA [ extlang ]) ; shortest ISO 639 code\n *                 / 4ALPHA                 ; reserved for future use\n *                 / 5*8ALPHA               ; registered language subtag\n *\n *   extlang       = *3(\"-\" 3ALPHA)         ; reserved for future use\n *\n *   script        = 4ALPHA                 ; ISO 15924 code\n *\n *   region        = 2ALPHA                 ; ISO 3166 code\n *                 / 3DIGIT                 ; UN M.49 code\n *\n *   variant       = 5*8alphanum            ; registered variants\n *                 / (DIGIT 3alphanum)\n *\n *   extension     = singleton 1*(\"-\" (2*8alphanum))\n *\n *   singleton     = %x41-57 / %x59-5A / %x61-77 / %x79-7A / DIGIT\n *                 ; \"a\"-\"w\" / \"y\"-\"z\" / \"A\"-\"W\" / \"Y\"-\"Z\" / \"0\"-\"9\"\n *                 ; Single letters: x/X is reserved for private use\n *\n *   privateuse    = (\"x\"/\"X\") 1*(\"-\" (1*8alphanum))\n *\n *   grandfathered = 1*3ALPHA 1*2(\"-\" (2*8alphanum))\n *                   ; grandfathered registration\n *                   ; Note: i is the only singleton\n *                   ; that starts a grandfathered tag\n *\n *   alphanum      = (ALPHA / DIGIT)       ; letters and numbers\n *\n *                        Figure 1: Language Tag ABNF\n * ```\n *\n * @param {string} locale\n * @returns {Locale}\n * @since 1.14.0\n * @copyright schukai GmbH\n * @memberOf Monster.I18n\n * @throws {TypeError} value is not a string\n * @throws {Error} unsupported locale\n */\nfunction parseLocale(locale) {\n\n    locale = validateString(locale).replace(/_/g, \"-\");\n\n    let language, region, variants, parts, script, extlang,\n        regexRegular = \"(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)\",\n        regexIrregular = \"(en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)\",\n        regexGrandfathered = \"(\" + regexIrregular + \"|\" + regexRegular + \")\",\n        regexPrivateUse = \"(x(-[A-Za-z0-9]{1,8})+)\",\n        regexSingleton = \"[0-9A-WY-Za-wy-z]\",\n        regexExtension = \"(\" + regexSingleton + \"(-[A-Za-z0-9]{2,8})+)\",\n        regexVariant = \"([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3})\",\n        regexRegion = \"([A-Za-z]{2}|[0-9]{3})\",\n        regexScript = \"([A-Za-z]{4})\",\n        regexExtlang = \"([A-Za-z]{3}(-[A-Za-z]{3}){0,2})\",\n        regexLanguage = \"(([A-Za-z]{2,3}(-\" + regexExtlang + \")?)|[A-Za-z]{4}|[A-Za-z]{5,8})\",\n        regexLangtag = \"(\" + regexLanguage + \"(-\" + regexScript + \")?\" + \"(-\" + regexRegion + \")?\" + \"(-\" + regexVariant + \")*\" + \"(-\" + regexExtension + \")*\" + \"(-\" + regexPrivateUse + \")?\" + \")\",\n        regexLanguageTag = \"^(\" + regexGrandfathered + \"|\" + regexLangtag + \"|\" + regexPrivateUse + \")$\",\n        regex = new RegExp(regexLanguageTag), match;\n\n\n    if ((match = regex.exec(locale)) !== null) {\n        if (match.index === regex.lastIndex) {\n            regex.lastIndex++;\n        }\n    }\n\n    if (match === undefined || match === null) {\n        throw new Error('unsupported locale');\n    }\n\n    if (match[6] !== undefined) {\n        language = match[6];\n\n        parts = language.split('-');\n        if (parts.length > 1) {\n            language = parts[0];\n            extlang = parts[1];\n        }\n\n    }\n\n    if (match[14] !== undefined) {\n        region = match[14];\n    }\n\n    if (match[12] !== undefined) {\n        script = match[12];\n    }\n\n    if (match[16] !== undefined) {\n        variants = match[16];\n    }\n\n    return new Locale(language, region, script, variants, extlang);\n\n}\n\n\nassignToNamespace('Monster.I18n', Locale, parseLocale);\nexport {Monster, Locale, parseLocale}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {BaseWithOptions} from \"../types/basewithoptions.js\";\nimport {Locale} from \"./locale.js\"\nimport {Translations} from \"./translations.js\"\n\n/**\n * A provider makes a translation object available.\n *\n * You can call the method via the monster namespace `new Monster.I18n.Provider()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.I18n.Provider()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Provider} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/provider.js';\n * new Provider()\n * </script>\n * ```\n *\n * @since 1.13.0\n * @copyright schukai GmbH\n * @memberOf Monster.I18n\n * @see {@link https://datatracker.ietf.org/doc/html/rfc3066}\n */\nclass Provider extends BaseWithOptions {\n\n    /**\n     * @param {Locale|string} locale\n     * @return {Promise}\n     */\n    getTranslations(locale) {\n        return new Promise((resolve, reject) => {\n            try {\n                resolve(new Translations(locale));\n            } catch (e) {\n                reject(e);\n            }\n\n        });\n    }\n\n}\n\n\nassignToNamespace('Monster.I18n', Provider);\nexport {Monster, Provider}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {internalSymbol} from \"../constants.js\";\nimport {extend} from \"../data/extend.js\";\nimport {Pathfinder} from \"../data/pathfinder.js\";\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from \"./base.js\";\nimport {validateObject} from \"./validate.js\";\n\n/**\n * This is the base class with options from which some monster classes are derived.\n *\n * This class is actually only used as a base class.\n * \n * However, you can also create an instance directly via the monster namespace `new Monster.Types.BaseWithOptions()`.\n *\n * ```html\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Types.BaseWithOptions()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```html\n * <script type=\"module\">\n * import {BaseWithOptions} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/basewithoptions.js';\n * new BaseWithOptions()\n * </script>\n * ```\n * \n * Classes that require the possibility of options can be derived directly from this class.\n * Derived classes almost always override the `defaul` getter with their own values.\n *\n * ```javascript\n * class My extends BaseWithOptions {\n *    get defaults() {\n *        return Object.assign({}, super.defaults, {\n *            mykey: true\n *        });\n *    }  \n * }\n * ```\n * \n * The class was formerly called Object.\n *\n * @since 1.13.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n */\nclass BaseWithOptions extends Base {\n\n    /**\n     *\n     * @param {object} options\n     */\n    constructor(options) {\n        super();\n\n        if (options === undefined) {\n            options = {};\n        }\n\n        this[internalSymbol] = extend({}, this.defaults, validateObject(options));\n\n    }\n\n    /**\n     * This getter provides the options. Derived classes overwrite \n     * this getter with their own values. It is good karma to always include \n     * the values from the parent class.\n     * \n     * ```javascript\n     * get defaults() {\n     *     return Object.assign({}, super.defaults, {\n     *         mykey: true\n     *     });\n     * }\n     * \n     * ```\n     *\n     * @return {object}\n     */\n    get defaults() {\n        return {}\n    }\n\n    /**\n     * nested options can be specified by path `a.b.c`\n     *\n     * @param {string} path\n     * @param {*} defaultValue\n     * @return {*}\n     * @since 1.10.0\n     */\n    getOption(path, defaultValue) {\n        let value;\n\n        try {\n            value = new Pathfinder(this[internalSymbol]).getVia(path);\n        } catch (e) {\n\n        }\n\n        if (value === undefined) return defaultValue;\n        return value;\n    }\n\n\n}\n\nassignToNamespace('Monster.Types', BaseWithOptions);\nexport {Monster, BaseWithOptions}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from \"../types/base.js\";\nimport {isObject, isString} from \"../types/is.js\";\nimport {validateInstance, validateInteger, validateObject, validateString} from \"../types/validate.js\";\nimport {Locale, parseLocale} from \"./locale.js\";\n\n\n/**\n * With this class you can manage translations and access the keys.\n *\n * You can call the method via the monster namespace `new Monster.I18n.Translations()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.I18n.Translations()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/translations.js';\n * new Translations()\n * </script>\n * ```\n *\n * @example\n *\n * import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/translations.js';\n * import {parseLocale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/locale.js';\n *\n * const translation = new Translations(parseLocale('en-GB'));\n *\n * translation.assignTranslations({\n *           text1: \"click\",\n *           text2: {\n *             'one': 'click once',\n *             'other': 'click n times'\n *           }\n *        });\n *\n * console.log(translation.getText('text1'));\n * // ↦ click\n *\n * console.log(translation.getPluralRuleText('text2',1));\n * // -> click once\n * console.log(translation.getPluralRuleText('text2',2));\n * // -> click n times\n *\n * @since 1.13.0\n * @copyright schukai GmbH\n * @memberOf Monster.I18n\n * @see https://datatracker.ietf.org/doc/html/rfc3066\n */\nclass Translations extends Base {\n\n    /**\n     *\n     * @param {Locale} locale\n     */\n    constructor(locale) {\n        super();\n\n        if (isString(locale)) {\n            locale = parseLocale(locale);\n        }\n\n        this.locale = validateInstance(locale, Locale);\n        this.storage = new Map();\n\n    }\n\n\n    /**\n     * Fetches a text using the specified key.\n     * If no suitable key is found, `defaultText` is taken.\n     *\n     * @param {string} key\n     * @param {string|undefined} defaultText\n     * @return {string}\n     * @throws {Error} key not found\n     */\n    getText(key, defaultText) {\n        if (!this.storage.has(key)) {\n            if (defaultText === undefined) {\n                throw new Error('key ' + key + ' not found');\n            }\n\n            return validateString(defaultText);\n        }\n\n        let r = this.storage.get(key);\n        if (isObject(r)) {\n            return this.getPluralRuleText(key, 'other', defaultText);\n        }\n\n        return this.storage.get(key);\n    }\n\n    /**\n     * A number `count` can be passed to this method. In addition to a number, one of the keywords can also be passed directly.\n     * \"zero\", \"one\", \"two\", \"few\", \"many\" and \"other\". Remember: not every language has all rules.\n     *\n     * The appropriate text for this number is then selected. If no suitable key is found, `defaultText` is taken.\n     *\n     * @param {string} key\n     * @param {integer|count} count\n     * @param {string|undefined} defaultText\n     * @return {string}\n     */\n    getPluralRuleText(key, count, defaultText) {\n        if (!this.storage.has(key)) {\n            return validateString(defaultText);\n        }\n\n        let r = validateObject(this.storage.get(key));\n\n        let keyword;\n        if (isString(count)) {\n            keyword = count.toLocaleString();\n        } else {\n            count = validateInteger(count);\n            if (count === 0) {\n                // special handlig for zero count\n                if (r.hasOwnProperty('zero')) {\n                    return validateString(r['zero']);\n                }\n            }\n\n            keyword = new Intl.PluralRules(this.locale.toString()).select(validateInteger(count));\n        }\n\n        if (r.hasOwnProperty(keyword)) {\n            return validateString(r[keyword]);\n        }\n\n        if (r.hasOwnProperty(DEFAULT_KEY)) {\n            return validateString(r[DEFAULT_KEY]);\n        }\n\n        return validateString(defaultText);\n    }\n\n    /**\n     * Set a text for a key\n     *\n     * ```\n     * translations.setText(\"text1\": \"Make my day!\");\n     * // plural rules\n     * translations.setText(\"text6\": {\n     *     \"zero\": \"There are no files on Disk.\",\n     *     \"one\": \"There is one file on Disk.\",\n     *     \"other\": \"There are files on Disk.\"\n     *     \"default\": \"There are files on Disk.\"\n     * });\n     * ```\n     *\n     * @param {string} key\n     * @param {string|object} text\n     * @return {Translations}\n     * @throws {TypeError} value is not a string or object\n     */\n    setText(key, text) {\n\n        if (isString(text) || isObject(text)) {\n            this.storage.set(validateString(key), text);\n            return this;\n        }\n\n        throw new TypeError('value is not a string or object');\n\n    }\n\n    /**\n     * This method can be used to transfer overlays from an object. The keys are transferred and the values are entered as text.\n     *\n     * The values can either be character strings or, in the case of texts with plural forms, objects. The plural forms must be stored as text via a standard key \"zero\", \"one\", \"two\", \"few\", \"many\" and \"other\".\n     *\n     * Additionally, the key default can be specified, which will be used if no other key fits.\n     *\n     * In some languages, like for example in german, there is no own more number at the value 0. In these languages the function applies additionally zero.\n     *\n     * ```\n     * translations.assignTranslations({\n     *   \"text1\": \"Make my day!\",\n     *   \"text2\": \"I'll be back!\",\n     *   \"text6\": {\n     *     \"zero\": \"There are no files on Disk.\",\n     *     \"one\": \"There is one file on Disk.\",\n     *     \"other\": \"There are files on Disk.\"\n     *     \"default\": \"There are files on Disk.\"\n     * });\n     * ```\n     *\n     * @param {object} translations\n     * @return {Translations}\n     */\n    assignTranslations(translations) {\n        validateObject(translations);\n\n        for (const [k, v] of Object.entries(translations)) {\n            this.setText(k, v);\n        }\n\n        return this;\n\n    }\n\n}\n\nassignToNamespace('Monster.I18n', Translations);\nexport {Monster, Translations}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {internalSymbol} from \"../../constants.js\";\nimport {extend} from \"../../data/extend.js\";\nimport {assignToNamespace, Monster} from '../../namespace.js';\nimport {Formatter} from \"../../text/formatter.js\";\nimport {getGlobalFunction} from \"../../types/global.js\";\nimport {isInstance, isString} from \"../../types/is.js\";\nimport {validateObject, validateString} from \"../../types/validate.js\";\nimport {parseLocale} from \"../locale.js\";\nimport {Provider} from \"../provider.js\";\nimport {Translations} from \"../translations.js\";\n\n/**\n * The fetch provider retrieves a JSON file from the given URL and returns a translation object.\n *\n * You can create the object via the monster namespace `new Monster.I18n.Provider.Fetch()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.I18n.Providers.Fetch()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Fetch} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/providers/fetch.js';\n * new Fetch()\n * </script>\n * ```\n * \n * @example <caption>das ist ein test</caption>\n * \n * import {Fetch} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/i18n/providers/fetch.js';\n * \n * // fetch from API\n * const translation = new Fetch('https://example.com/${language}.json').getTranslation('en-GB');\n * // ↦ https://example.com/en.json\n *\n * @since 1.13.0\n * @copyright schukai GmbH\n * @memberOf Monster.I18n.Providers\n * @see {@link https://datatracker.ietf.org/doc/html/rfc3066}\n * @tutorial i18n-locale-and-formatter\n */\nclass Fetch extends Provider {\n\n    /**\n     * As options the key `fetch` can be passed. This config object is passed to the fetch method as init.\n     * \n     * The url may contain placeholders (language, script, region, variants, extlang, privateUse), so you can specify one url for all translations.\n     * \n     * ```\n     * new Fetch('https://www.example.com/assets/${language}.json')\n     * ```\n     * \n     * @param {string|URL} url\n     * @param {Object} options see {@link Monster.I18n.Providers.Fetch#defaults}\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/fetch}\n     */\n    constructor(url, options) {\n        super(options);\n\n        if (isInstance(url, URL)) {\n            url = url.toString();\n        }\n\n        if (options === undefined) {\n            options = {};\n        }\n\n        validateString(url);\n\n        /**\n         * @property {string}\n         */\n        this.url = url;\n\n        /**\n         * @private\n         * @property {Object} options\n         */\n        this[internalSymbol] = extend({}, super.defaults, this.defaults, validateObject(options));\n\n    }\n\n    /**\n     * Defaults\n     *\n     * @property {Object} fetch\n     * @property {String} fetch.method=GET\n     * @property {String} fetch.mode=cors\n     * @property {String} fetch.cache=no-cache\n     * @property {String} fetch.credentials=omit\n     * @property {String} fetch.redirect=follow\n     * @property {String} fetch.referrerPolicy=no-referrer\n     *\n     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API}\n     */\n    get defaults() {\n\n        return {\n            fetch: {\n                method: 'GET', // *GET, POST, PUT, DELETE, etc.\n                mode: 'cors', // no-cors, *cors, same-origin\n                cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached\n                credentials: 'omit', // include, *same-origin, omit\n                redirect: 'follow', // manual, *follow, error\n                referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url\n            }\n        }\n\n    }\n\n    /**\n     *\n     * @param {Locale|string} locale\n     * @return {Promise}\n     */\n    getTranslations(locale) {\n\n        if (isString(locale)) {\n            locale = parseLocale(locale);\n        }\n\n        let formatter = new Formatter(locale.getMap())\n\n        return getGlobalFunction('fetch')(formatter.format(this.url), this.getOption('fetch', {}))\n            .then((response) => response.json()).then(data => {\n                return new Translations(locale).assignTranslations(data);\n            });\n\n    }\n\n\n}\n\n\nassignToNamespace('Monster.I18n.Providers', Fetch);\nexport {Monster, Fetch}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {internalSymbol} from \"../constants.js\";\nimport {extend} from \"../data/extend.js\";\nimport {Pipe} from \"../data/pipe.js\";\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {BaseWithOptions} from \"../types/basewithoptions.js\";\nimport {isObject, isString} from \"../types/is.js\";\nimport {validateArray, validateString} from \"../types/validate.js\";\n\n\n/**\n * @private\n * @type {symbol}\n */\nconst internalObjectSymbol = Symbol('internalObject');\n\n/**\n * @private\n * @type {symbol}\n */\nconst watchdogSymbol = Symbol('watchdog');\n\n/**\n * @private\n * @type {symbol}\n */\nconst markerOpenIndexSymbol = Symbol('markerOpenIndex');\n\n/**\n * @private\n * @type {symbol}\n */\nconst markerCloseIndexSymbol = Symbol('markercloseIndex');\n\n/**\n * @private\n * @type {symbol}\n */\nconst workingDataSymbol = Symbol('workingData');\n\n\n/**\n * Messages can be formatted with the formatter. To do this, an object with the values must be passed to the formatter. The message can then contain placeholders.\n *\n * Look at the example below. The placeholders use the logic of Pipe.\n *\n * You can create an instance via the monster namespace `new Monster.Text.Formatter()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Text.Formatter()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/text/formatter.js';\n * new Formatter()\n * </script>\n * ```\n *\n * ## Marker in marker\n *\n * Markers can be nested. Here, the inner marker is resolved first `${subkey} ↦ 1 = ${mykey2}` and then the outer marker `${mykey2}`.\n *\n * ```\n * const text = '${mykey${subkey}}';\n * let obj = {\n *  mykey2: \"1\",\n *  subkey: \"2\"\n * };\n *\n * new Formatter(obj).format(text);\n * // ↦ 1\n * ```\n *\n * ## Callbacks\n *\n * The values in a formatter can be adjusted via the commands of the `Transformer` or the`Pipe`.\n * There is also the possibility to use callbacks.\n *\n * const formatter = new Formatter({x: '1'}, {\n *                callbacks: {\n *                    quote: (value) => {\n *                        return '\"' + value + '\"'\n *                    }\n *                }\n *            });\n *\n * formatter.format('${x | call:quote}'))\n * // ↦ \"1\"\n *\n * ## Marker with parameter\n *\n * A string can also bring its own values. These must then be separated from the key by a separator `::`.\n * The values themselves must be specified in key/value pairs. The key must be separated from the value by a separator `=`.\n *\n * When using a pipe, you must pay attention to the separators.\n *\n * @example\n *\n * import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/text/formatter.js';\n *\n * new Formatter({\n *       a: {\n *           b: {\n *               c: \"Hello\"\n *           },\n *           d: \"world\",\n *       }\n *   }).format(\"${a.b.c} ${a.d | ucfirst}!\"); // with pipe\n *\n * // ↦ Hello World!\n *\n * @since 1.12.0\n * @copyright schukai GmbH\n * @memberOf Monster.Text\n */\nclass Formatter extends BaseWithOptions {\n\n    /**\n     * Default values for the markers are `${` and `}`\n     *\n     * @param {object} object\n     * @throws {TypeError} value is not a object\n     */\n    constructor(object, options) {\n        super(options);\n        this[internalObjectSymbol] = object || {}\n        this[markerOpenIndexSymbol] = 0;\n        this[markerCloseIndexSymbol] = 0;\n    }\n\n    /**\n     * @property {object} marker\n     * @property {array} marker.open=[\"${\"]\n     * @property {array} marker.close=[\"${\"]\n     * @property {object} parameter\n     * @property {string} parameter.delimiter=\"::\"\n     * @property {string} parameter.assignment=\"=\"\n     * @property {object} callbacks={}\n     */\n    get defaults() {\n        return extend({}, super.defaults, {\n            marker: {\n                open: ['${'],\n                close: ['}']\n            },\n            parameter: {\n                delimiter: '::',\n                assignment: '='\n            },\n            callbacks: {},\n        })\n    }\n\n\n    /**\n     * Set new Parameter Character\n     *\n     * Default values for the chars are `::` and `=`\n     *\n     * ```\n     * formatter.setParameterChars('#');\n     * formatter.setParameterChars('[',']');\n     * formatter.setParameterChars('i18n{','}');\n     * ```\n     *\n     * @param {string} delimiter\n     * @param {string} assignment\n     * @return {Formatter}\n     * @since 1.24.0\n     * @throws {TypeError} value is not a string\n     */\n    setParameterChars(delimiter, assignment) {\n\n        if (delimiter !== undefined) {\n            this[internalSymbol]['parameter']['delimiter'] = validateString(delimiter);\n        }\n\n        if (assignment !== undefined) {\n            this[internalSymbol]['parameter']['assignment'] = validateString(assignment);\n        }\n\n        return this;\n    }\n\n    /**\n     * Set new Marker\n     *\n     * Default values for the markers are `${` and `}`\n     *\n     * ```\n     * formatter.setMarker('#'); // open and close are both #\n     * formatter.setMarker('[',']');\n     * formatter.setMarker('i18n{','}');\n     * ```\n     *\n     * @param {array|string} open\n     * @param {array|string|undefined} close\n     * @return {Formatter}\n     * @since 1.12.0\n     * @throws {TypeError} value is not a string\n     */\n    setMarker(open, close) {\n\n        if (close === undefined) {\n            close = open;\n        }\n\n        if (isString(open)) open = [open];\n        if (isString(close)) close = [close];\n\n        this[internalSymbol]['marker']['open'] = validateArray(open);\n        this[internalSymbol]['marker']['close'] = validateArray(close);\n        return this;\n    }\n\n    /**\n     *\n     * @param {string} text\n     * @return {string}\n     * @throws {TypeError} value is not a string\n     * @throws {Error} too deep nesting\n     */\n    format(text) {\n        this[watchdogSymbol] = 0;\n        this[markerOpenIndexSymbol] = 0;\n        this[markerCloseIndexSymbol] = 0;\n        this[workingDataSymbol] = {};\n        return format.call(this, text);\n    }\n\n}\n\n/**\n * @private\n * @return {string}\n */\nfunction format(text) {\n    const self = this;\n\n    self[watchdogSymbol]++;\n    if (this[watchdogSymbol] > 20) {\n        throw new Error('too deep nesting')\n    }\n\n    let openMarker = self[internalSymbol]['marker']['open']?.[this[markerOpenIndexSymbol]];\n    let closeMarker = self[internalSymbol]['marker']['close']?.[this[markerCloseIndexSymbol]];\n\n    // contains no placeholders\n    if (text.indexOf(openMarker) === -1 || text.indexOf(closeMarker) === -1) {\n        return text;\n    }\n\n    let result = tokenize.call(this, validateString(text), openMarker, closeMarker)\n\n    if (self[internalSymbol]['marker']['open']?.[this[markerOpenIndexSymbol] + 1]) {\n        this[markerOpenIndexSymbol]++;\n    }\n\n    if (self[internalSymbol]['marker']['close']?.[this[markerCloseIndexSymbol] + 1]) {\n        this[markerCloseIndexSymbol]++;\n    }\n\n    result = format.call(self, result)\n\n    return result;\n}\n\n/**\n * @private\n * @since 1.12.0\n * @param text\n * @return {string}\n */\nfunction tokenize(text, openMarker, closeMarker) {\n    const self = this;\n\n    let formatted = [];\n\n    const parameterAssignment = self[internalSymbol]['parameter']['assignment']\n    const parameterDelimiter = self[internalSymbol]['parameter']['delimiter']\n    const callbacks = self[internalSymbol]['callbacks'];\n\n    while (true) {\n\n        let startIndex = text.indexOf(openMarker);\n        // no marker \n        if (startIndex === -1) {\n            formatted.push(text);\n            break;\n        } else if (startIndex > 0) {\n            formatted.push(text.substring(0, startIndex))\n            text = text.substring(startIndex)\n        }\n\n        let endIndex = text.substring(openMarker.length).indexOf(closeMarker);\n        if (endIndex !== -1) endIndex += openMarker.length;\n        let insideStartIndex = text.substring(openMarker.length).indexOf(openMarker);\n        if (insideStartIndex !== -1) {\n            insideStartIndex += openMarker.length;\n            if (insideStartIndex < endIndex) {\n                let result = tokenize.call(self, text.substring(insideStartIndex), openMarker, closeMarker);\n                text = text.substring(0, insideStartIndex) + result\n                endIndex = text.substring(openMarker.length).indexOf(closeMarker);\n                if (endIndex !== -1) endIndex += openMarker.length;\n            }\n        }\n\n        if (endIndex === -1) {\n            throw new Error(\"syntax error in formatter template\")\n            return;\n        }\n\n        let key = text.substring(openMarker.length, endIndex);\n        let parts = key.split(parameterDelimiter);\n        let currentPipe = parts.shift();\n\n        self[workingDataSymbol] = extend({}, self[internalObjectSymbol], self[workingDataSymbol]);\n\n        for (const kv of parts) {\n            const [k, v] = kv.split(parameterAssignment);\n            self[workingDataSymbol][k] = v;\n        }\n\n        const t1 = key.split('|').shift().trim(); // pipe symbol\n        const t2 = t1.split('::').shift().trim(); // key value delimiter\n        const t3 = t2.split('.').shift().trim(); // path delimiter\n        let prefix = self[workingDataSymbol]?.[t3] ? 'path:' : 'static:';\n\n        let command = \"\";\n        if (prefix && key.indexOf(prefix) !== 0\n            && key.indexOf('path:') !== 0\n            && key.indexOf('static:') !== 0) {\n            command = prefix;\n        }\n\n        command += currentPipe;\n\n        const pipe = new Pipe(command);\n\n        if (isObject(callbacks)) {\n            for (const [name, callback] of Object.entries(callbacks)) {\n                pipe.setCallback(name, callback);\n            }\n        }\n\n        formatted.push(validateString(pipe.run(self[workingDataSymbol])));\n\n        text = text.substring(endIndex + closeMarker.length);\n\n    }\n\n    return formatted.join('');\n}\n\nassignToNamespace('Monster.Text', Formatter);\nexport {Monster, Formatter}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {validateInstance, validateInteger} from \"../types/validate.js\";\nimport {LogEntry} from \"./logentry.js\";\nimport {ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN} from \"./logger.js\";\n\n/**\n * you can call the method via the monster namespace `new Monster.Logging.Handler()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Logging.Handler())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/logging/handler.js';\n * console.log(new Handler())\n * </script>\n * ```\n *\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Logging\n */\nclass Handler extends Base {\n    constructor() {\n        super();\n\n        /**\n         * Loglevel\n         *\n         * @type {integer}\n         */\n        this.loglevel = OFF;\n    }\n\n    /**\n     * This is the central log function. this method must be\n     * overwritten by derived handlers with their own logic.\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     * @param {LogEntry} entry\n     * @returns {boolean}\n     */\n    log(entry) {\n        validateInstance(entry, LogEntry);\n\n        if (this.loglevel < entry.getLogLevel()) {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * set loglevel\n     *\n     * @param {integer} loglevel\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setLogLevel(loglevel) {\n        validateInteger(loglevel)\n        this.loglevel = loglevel;\n        return this;\n    }\n\n    /**\n     * get loglevel\n     *\n     * @returns {integer}\n     * @since 1.5.0\n     */\n    getLogLevel() {\n        return this.loglevel;\n    }\n\n    /**\n     *  Set log level to All\n     *\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setAll() {\n        this.setLogLevel(ALL);\n        return this;\n    };\n\n    /**\n     * Set log level to Trace\n     *\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setTrace() {\n        this.setLogLevel(TRACE);\n        return this;\n    };\n\n    /**\n     * Set log level to Debug\n     *\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setDebug() {\n        this.setLogLevel(DEBUG);\n        return this;\n    };\n\n    /**\n     * Set log level to Info\n     *\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setInfo() {\n        this.setLogLevel(INFO);\n        return this;\n    };\n\n    /**\n     * Set log level to Warn\n     *\n     * @returns {undefined}\n     * @since 1.5.0\n     */\n    setWarn() {\n        this.setLogLevel(WARN);\n        return this;\n    };\n\n    /**\n     * Set log level to Error\n     *\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setError() {\n        this.setLogLevel(ERROR);\n        return this;\n    };\n\n    /**\n     * Set log level to Fatal\n     *\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setFatal() {\n        this.setLogLevel(FATAL);\n        return this;\n    };\n\n\n    /**\n     * Set log level to Off\n     *\n     * @returns {Handler}\n     * @since 1.5.0\n     */\n    setOff() {\n        this.setLogLevel(OFF);\n        return this;\n    };\n\n\n}\n\n\nassignToNamespace('Monster.Logging', Handler);\nexport {Monster, Handler};\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {validateInteger} from '../types/validate.js';\n\n\n/**\n * you can call the method via the monster namespace `new Monster.Logging.LogEntry()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Logging.LogEntry())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/logging/logentry.js';\n * console.log(new LogEntry())\n * </script>\n * ```\n *\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Logging\n */\nclass LogEntry extends Base {\n    /**\n     *\n     * @param {Integer} loglevel\n     * @param {...*} args\n     */\n    constructor(loglevel, ...args) {\n        super();\n        validateInteger(loglevel);\n\n        this.loglevel = loglevel\n        this.arguments = args\n    }\n\n    /**\n     *\n     * @returns {integerr}\n     */\n    getLogLevel() {\n        return this.loglevel\n    }\n\n    /**\n     *\n     * @returns {array}\n     */\n    getArguments() {\n        return this.arguments\n    }\n\n}\n\nassignToNamespace('Monster.Logging', LogEntry);\nexport {Monster, LogEntry}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {Handler} from '../logging/handler.js';\nimport {LogEntry} from '../logging/logentry.js';\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {validateInteger, validateObject, validateString} from '../types/validate.js';\n\n\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst ALL = 255;\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst TRACE = 64;\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst DEBUG = 32;\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst INFO = 16;\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst WARN = 8;\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst ERROR = 4;\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst FATAL = 2;\n/**\n * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF\n * @type {number}\n * @memberOf Monster.Logging\n */\nconst OFF = 0;\n\n/**\n * You can create an object of the class simply by using the namespace `new Monster.Logging.Logger()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Logging.Logger()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this class individually.\n *\n * ```\n * <script type=\"module\">\n * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/logging/logger.js';\n * new Logger()\n * </script>\n * ```\n *\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Logging\n */\nclass Logger extends Base {\n\n    /**\n     *\n     */\n    constructor() {\n        super();\n        this.handler = new Set;\n    }\n\n    /**\n     *\n     * @param {Handler} handler\n     * @returns {Logger}\n     * @throws {Error} the handler must be an instance of Handler\n     */\n    addHandler(handler) {\n        validateObject(handler)\n        if (!(handler instanceof Handler)) {\n            throw new Error(\"the handler must be an instance of Handler\")\n        }\n\n        this.handler.add(handler)\n        return this;\n    }\n\n    /**\n     *\n     * @param {Handler} handler\n     * @returns {Logger}\n     * @throws {Error} the handler must be an instance of Handler\n     */\n    removeHandler(handler) {\n        validateObject(handler)\n        if (!(handler instanceof Handler)) {\n            throw new Error(\"the handler must be an instance of Handler\")\n        }\n\n        this.handler.delete(handler);\n        return this;\n    }\n\n    /**\n     * log Trace message\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     * @param {*} arguments\n     * @returns {Logger}\n     * @since 1.5.0\n     */\n    logTrace() {\n        triggerLog.apply(this, [TRACE, ...arguments]);\n        return this;\n    };\n\n    /**\n     * log Debug message\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     * @param {*} arguments\n     * @returns {Logger}\n     * @since 1.5.0\n     */\n    logDebug() {\n        triggerLog.apply(this, [DEBUG, ...arguments]);\n        return this;\n    };\n\n    /**\n     * log Info message\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     *\n     * @param {*} arguments\n     * @returns {Logger}\n     * @since 1.5.0\n     */\n    logInfo() {\n        triggerLog.apply(this, [INFO, ...arguments]);\n        return this;\n    };\n\n    /**\n     * log Warn message\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     * @param {*} arguments\n     * @returns {Logger}\n     * @since 1.5.0\n     */\n    logWarn() {\n        triggerLog.apply(this, [WARN, ...arguments]);\n        return this;\n    };\n\n    /**\n     * log Error message\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     * @param {*} arguments\n     * @returns {Logger}\n     * @since 1.5.0\n     */\n    logError() {\n        triggerLog.apply(this, [ERROR, ...arguments]);\n        return this;\n    };\n\n    /**\n     * log Fatal message\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     * @param {*} arguments\n     * @returns {Logger}\n     * @since 1.5.0\n     */\n    logFatal() {\n        triggerLog.apply(this, [FATAL, ...arguments]);\n        return this;\n    };\n\n\n    /**\n     * Labels\n     *\n     * @param {integer} level\n     * @returns {string}\n     */\n    getLabel(level) {\n        validateInteger(level);\n\n        if (level === ALL) return 'ALL';\n        if (level === TRACE) return 'TRACE';\n        if (level === DEBUG) return 'DEBUG';\n        if (level === INFO) return 'INFO';\n        if (level === WARN) return 'WARN';\n        if (level === ERROR) return 'ERROR';\n        if (level === FATAL) return 'FATAL';\n        if (level === OFF) return 'OFF';\n\n        return 'unknown';\n    };\n\n    /**\n     * Level\n     *\n     * @param {string} label\n     * @returns {integer}\n     */\n    getLevel(label) {\n        validateString(label);\n\n        if (label === 'ALL') return ALL;\n        if (label === 'TRACE') return TRACE;\n        if (label === 'DEBUG') return DEBUG;\n        if (label === 'INFO') return INFO;\n        if (label === 'WARN') return WARN;\n        if (label === 'ERROR') return ERROR;\n        if (label === 'FATAL') return FATAL;\n        if (label === 'OFF') return OFF;\n\n        return 0;\n    };\n\n\n}\n\nassignToNamespace('Monster.Logging', Logger);\nexport {Monster, Logger, ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF};\n\n\n/**\n * Log triggern\n *\n * @param {integer} loglevel\n * @param {*} args\n * @returns {Logger}\n * @private\n */\nfunction triggerLog(loglevel, ...args) {\n    var logger = this;\n\n    for (let handler of logger.handler) {\n        handler.log(new LogEntry(loglevel, args))\n    }\n\n    return logger;\n\n}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../../namespace.js';\nimport {Base} from '../../types/base.js';\nimport {getGlobalObject} from \"../../types/global.js\";\nimport {Handler} from '../handler.js';\nimport {LogEntry} from \"../logentry.js\";\n\n/**\n * You can create an object of the class simply by using the namespace `new Monster.Logging.Handler.ConsoleHandler()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Logging.Handler.ConsoleHandler())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this class individually.\n *\n * ```\n * <script type=\"module\">\n * import {ConsoleHandler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/logging/handler/console.js';\n * console.log(new ConsoleHandler())\n * </script>\n * ```\n *\n * @since 1.5.0\n * @copyright schukai GmbH\n * @memberOf Monster.Logging.Handler\n */\nclass ConsoleHandler extends Handler {\n    constructor() {\n        super();\n    }\n\n\n    /**\n     * This is the central log function. this method must be\n     * overwritten by derived handlers with their own logic.\n     *\n     * ALL > TRACE > DEBUG > INFO > WARN > ERROR > FATAL > OFF  (ALL = 0xff;OFF = 0x00;\n     *\n     * @param {LogEntry} entry\n     * @returns {boolean}\n     */\n    log(entry) {\n        if (super.log(entry)) {\n            let console = getGlobalObject('console');\n            if (!console) return false;\n            console.log(entry.toString());\n            return true;\n        }\n\n        return false;\n    }\n\n}\n\n\nassignToNamespace('Monster.Logging.Handler', ConsoleHandler);\nexport {Monster, ConsoleHandler};\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {getGlobal} from '../types/global.js';\n\n\n/**\n * this function uses crypt and returns a random number.\n *\n * you can call the method via the monster namespace `Monster.Math.random()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Math.random(1,10)\n * // ↦ 5\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {random} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/math/random.js';\n * random(1,10)\n * // ↦ 5\n * </script>\n * ```\n *\n * @param {number} min starting value of the definition set (default is 0)\n * @param {number} max end value of the definition set (default is 1000000000)\n * @returns {number}\n * @memberOf Monster.Math\n * @throws {Error} missing crypt\n * @throws {Error} we cannot generate numbers larger than 53 bits.\n * @throws {Error} the distance is too small to create a random number.\n\n * @since 1.0.0\n * @copyright schukai GmbH\n */\nfunction random(min, max) {\n\n    if (min === undefined) {\n        min = 0;\n    }\n    if (max === undefined) {\n        max = MAX;\n    }\n\n    if (max < min) {\n        throw new Error(\"max must be greater than min\");\n    }\n\n    return Math.round(create(min, max));\n\n}\n\n/**\n * @private\n * @type {number}\n */\nvar MAX = 1000000000;\n\n\nMath.log2 = Math.log2 || function (n) {\n    return Math.log(n) / Math.log(2);\n};\n\n/**\n *\n * @param {number} min\n * @param {number} max\n * @returns {number}\n * @private\n * @throws {Error} missing crypt\n * @throws {Error} we cannot generate numbers larger than 53 bits.\n * @throws {Error} the distance is too small to create a random number.\n */\nfunction create(min, max) {\n    let crypt;\n    let globalReference = getGlobal();\n\n    crypt = globalReference?.['crypto'] || globalReference?.['msCrypto'] || globalReference?.['crypto'] || undefined;\n\n    if (typeof crypt === \"undefined\") {\n        throw new Error(\"missing crypt\")\n    }\n\n    let rval = 0;\n    const range = max - min;\n    if (range < 2) {\n        throw  new Error('the distance is too small to create a random number.')\n    }\n\n    const bitsNeeded = Math.ceil(Math.log2(range));\n    if (bitsNeeded > 53) {\n        throw  new Error(\"we cannot generate numbers larger than 53 bits.\");\n    }\n    const bytesNeeded = Math.ceil(bitsNeeded / 8);\n    const mask = Math.pow(2, bitsNeeded) - 1;\n\n    const byteArray = new Uint8Array(bytesNeeded);\n    crypt.getRandomValues(byteArray);\n\n    let p = (bytesNeeded - 1) * 8;\n    for (var i = 0; i < bytesNeeded; i++) {\n        rval += byteArray[i] * Math.pow(2, p);\n        p -= 8;\n    }\n\n    rval = rval & mask;\n\n    if (rval >= range) {\n        return create(min, max);\n    }\n\n    if (rval < min) {\n        rval += min;\n    }\n    \n    return rval;\n\n}\n\nassignToNamespace('Monster.Math', random);\nexport {Monster, random}\n\n\n\n\n","'use strict';\n\nimport {random} from \"../math/random.js\";\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {getGlobal} from \"./global.js\";\nimport {ID} from \"./id.js\";\n\n/**\n * @private\n * @type {number}\n */\nlet internalCounter = 0;\n\n/**\n * You can call the method via the monster namespace `new Monster.Types.RandomID()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Types.RandomID())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {RandomID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/randomid.js';\n * console.log(new RandomID())\n * </script>\n * ```\n *\n * @since 1.6.0\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @summary class to generate random numbers\n */\nclass RandomID extends ID {\n\n    /**\n     * create new object\n     */\n    constructor() {\n        super();\n\n        internalCounter += 1;\n\n        this.id = getGlobal().btoa(random(1, 10000))\n            .replace(/=/g, '')\n            /** No numbers at the beginning of the ID, because of possible problems with DOM */\n            .replace(/^[0-9]+/, 'X') + internalCounter;\n    }\n\n}\n\nassignToNamespace('Monster.Types', RandomID);\nexport {Monster, RandomID}\n","'use strict';\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from './base.js';\n\n/**\n * The version object contains a sematic version number\n *\n * You can create the object via the monster namespace `new Monster.Types.Version()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(new Monster.Types.Version('1.2.3')) // ↦ 1.2.3\n * console.log(new Monster.Types.Version('1')) // ↦ 1.0.0\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this class individually.\n *\n * ```\n * <script type=\"module\">\n * import {Version} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/version.js';\n * console.log(new Version('1.2.3')) // ↦ 1.2.3\n * console.log(new Version('1')) // ↦ 1.0.0\n * </script>\n * ```\n *\n * @example\n *\n * import {Version} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/version.js';\n *\n * new Version('1.0.0') // ↦ 1.0.0\n * new Version(1)  // ↦ 1.0.0\n * new Version(1, 0, 0) // ↦ 1.0.0\n * new Version('1.2.3', 4, 5) // ↦ 1.4.5\n *\n * @since 1.0.0\n * @author schukai GmbH\n * @copyright schukai GmbH\n * @memberOf Monster.Types\n * @summary The version object contains a sematic version number\n */\nclass Version extends Base {\n\n    /**\n     *\n     * @param major\n     * @param minor\n     * @param patch\n     * @throws {Error} major is not a number\n     * @throws {Error} minor is not a number\n     * @throws {Error} patch is not a number\n     */\n    constructor(major, minor, patch) {\n        super();\n\n        if (typeof major === 'string' && minor === undefined && patch === undefined) {\n\n            let parts = major.toString().split('.');\n            major = parseInt(parts[0] || 0);\n            minor = parseInt(parts[1] || 0);\n            patch = parseInt(parts[2] || 0);\n        }\n\n        if (major === undefined) {\n            throw  new Error(\"major version is undefined\");\n        }\n\n        if (minor === undefined) {\n            minor = 0;\n        }\n\n        if (patch === undefined) {\n            patch = 0;\n        }\n\n        this.major = parseInt(major);\n        this.minor = parseInt(minor);\n        this.patch = parseInt(patch);\n\n        if (isNaN(this.major)) {\n            throw  new Error(\"major is not a number\");\n        }\n\n        if (isNaN(this.minor)) {\n            throw  new Error(\"minor is not a number\");\n        }\n\n        if (isNaN(this.patch)) {\n            throw  new Error(\"patch is not a number\");\n        }\n\n    }\n\n    /**\n     *\n     * @returns {string}\n     */\n    toString() {\n        return this.major + '.' + this.minor + '.' + this.patch;\n    }\n\n    /**\n     * returns 0 if equal, -1 if the object version is less and 1 if greater\n     * then the compared version\n     *\n     * @param {string|Version} version Version to compare\n     * @returns {number}\n     */\n    compareTo(version) {\n\n        if (version instanceof Version) {\n            version = version.toString();\n        }\n\n        if (typeof version !== 'string') {\n            throw  new Error(\"type exception\");\n        }\n\n        if (version === this.toString()) {\n            return 0;\n        }\n\n        let a = [this.major, this.minor, this.patch];\n        let b = version.split('.');\n        let len = Math.max(a.length, b.length);\n\n        for (let i = 0; i < len; i += 1) {\n            if ((a[i] && !b[i] && parseInt(a[i]) > 0) || (parseInt(a[i]) > parseInt(b[i]))) {\n                return 1;\n            } else if ((b[i] && !a[i] && parseInt(b[i]) > 0) || (parseInt(a[i]) < parseInt(b[i]))) {\n                return -1;\n            }\n        }\n\n        return 0;\n    };\n\n}\n\nassignToNamespace('Monster.Types', Version);\n\n\nlet monsterVersion;\n\n/**\n * Version of monster\n *\n * You can call the method via the monster namespace `Monster.getVersion()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * console.log(Monster.getVersion())\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {getVersion} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/types/version.js';\n * console.log(getVersion())\n * </script>\n * ```\n *\n * @returns {Monster.Types.Version}\n * @since 1.0.0\n * @copyright schukai GmbH\n * @author schukai GmbH\n * @memberOf Monster\n */\nfunction getVersion() {\n    if (monsterVersion instanceof Version) {\n        return monsterVersion;\n    }\n    /**#@+ dont touch, replaced by make with package.json version */\n    monsterVersion = new Version('1.30.1')\n    /**#@-*/\n\n    return monsterVersion;\n\n}\n\nassignToNamespace('Monster', getVersion);\nexport {Monster, Version, getVersion}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {Base} from '../types/base.js';\nimport {isFunction} from '../types/is.js';\n\n/**\n * The comparator allows a comparison function to be abstracted.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * new Monster.Util.Comparator()\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {Comparator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/util/comparator.js';\n * console.log(new Comparator())\n * </script>\n * ```\n *\n * The following are some examples of the application of the class.\n *\n * ```\n * new Comparator().lessThanOrEqual(2, 5) // ↦ true\n * new Comparator().greaterThan(4, 2) // ↦ true\n * new Comparator().equal(4, 4) // ↦ true\n * new Comparator().equal(4, 5) // ↦ false\n * ```\n *\n * You can also pass your own comparison function, and thus define the comparison function.\n *\n * ```\n * new Comparator(function (a, b) {\n *      if (a.v === b.v) return 0;\n *         return a.v < b.v ? -1 : 1;\n *      }).equal({v: 2}, {v: 2});  // ↦ true\n * ```\n *\n * @example\n *\n * import {Comparator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/util/comparator.js';\n *\n * console.log(new Comparator().lessThanOrEqual(2, 5))\n * // ↦ true\n * console.log(new Comparator().greaterThan(4, 2))\n * // ↦ true\n * console.log(new Comparator().equal(4, 4))\n * // ↦ true\n * console.log(new Comparator().equal(4, 5))\n * // ↦ false\n *\n * @since 1.3.0\n * @memberOf Monster.Util\n */\nclass Comparator extends Base {\n\n    /**\n     * create new comparator\n     *\n     * @param {Monster.Util~exampleCallback} [callback] Comparator callback\n     * @throw {TypeError} unsupported type\n     * @throw {TypeError} impractical comparison\n     */\n    constructor(callback) {\n        super();\n\n        if (isFunction(callback)) {\n            this.compare = callback\n        } else if (callback !== undefined) {\n            throw new TypeError(\"unsupported type\")\n        } else {\n            // default compare function\n\n            /**\n             *\n             * @param {*} a\n             * @param {*} b\n             * @return {integer} -1, 0 or 1\n             */\n            this.compare = function (a, b) {\n\n                if (typeof a !== typeof b) {\n                    throw new TypeError(\"impractical comparison\", \"types/comparator.js\")\n                }\n\n                if (a === b) {\n                    return 0;\n                }\n                return a < b ? -1 : 1;\n            };\n        }\n\n    }\n\n    /**\n     * changes the order of the operators\n     *\n     * @return {Comparator}\n     */\n    reverse() {\n        const original = this.compare;\n        this.compare = (a, b) => original(b, a);\n        return this;\n    }\n\n    /**\n     * Checks if two variables are equal.\n     *\n     * @param {*} a\n     * @param {*} b\n     *\n     * @return {boolean}\n     */\n    equal(a, b) {\n        return this.compare(a, b) === 0;\n    }\n\n\n    /**\n     * Checks if variable `a` is greater than `b`\n     *\n     * @param {*} a\n     * @param {*} b\n     *\n     * @return {boolean}\n     */\n    greaterThan(a, b) {\n        return this.compare(a, b) > 0;\n    }\n\n    /**\n     * Checks if variable `a` is greater than or equal to `b`\n     *\n     * @param {*} a\n     * @param {*} b\n     *\n     * @return {boolean}\n     */\n    greaterThanOrEqual(a, b) {\n        return this.greaterThan(a, b) || this.equal(a, b);\n    }\n\n    /**\n     * Checks if variable `a` is less than or equal to `b`\n     *\n     * @param {*} a\n     * @param {*} b\n     *\n     * @return {boolean}\n     */\n    lessThanOrEqual(a, b) {\n        return this.lessThan(a, b) || this.equal(a, b);\n    }\n\n    /**\n     * Checks if variable a is less than b\n     *\n     * @param {*} a\n     * @param {*} b\n     *\n     * @return {boolean}\n     */\n    lessThan(a, b) {\n        return this.compare(a, b) < 0;\n    }\n\n\n}\n\n\n/**\n * This is the description for the callback function used by the operator\n *\n * ```\n * new Comparator(function (a, b) {\n *      if (a.v === b.v) return 0;\n *         return a.v < b.v ? -1 : 1;\n *      }).equal({v: 2}, {v: 2});  // ↦ true\n * ```\n *\n * @callback Monster.Util~exampleCallback\n * @param {*} a\n * @param {*} b\n * @return {integer} -1, 0 or 1\n * @memberOf Monster.Util\n * @see Monster.Util.Comparator\n */\n\n\n/**\n *\n */\nassignToNamespace('Monster.Util', Comparator);\nexport {Monster, Comparator}\n","'use strict';\n\n/**\n * @author schukai GmbH\n */\n\nimport {assignToNamespace, Monster} from '../namespace.js';\nimport {validateObject} from '../types/validate.js';\n\n/**\n * Deep freeze a object\n *\n * You can call the method via the monster namespace `Monster.Util.deepFreeze()`.\n *\n * ```\n * <script type=\"module\">\n * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/monster.js';\n * Monster.Util.deepFreeze({})\n * </script>\n * ```\n *\n * Alternatively, you can also integrate this function individually.\n *\n * ```\n * <script type=\"module\">\n * import {deepFreeze} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/util/freeze.js';\n * deepFreeze({})\n * </script>\n * ```\n *\n * @param {object} object object to be freeze\n * @since 1.0.0\n * @returns {object}\n * @memberOf Monster.Util\n * @copyright schukai GmbH\n * @throws {TypeError} value is not a object\n */\nfunction deepFreeze(object) {\n\n    validateObject(object)\n\n    // Retrieve the defined property names of the object\n    var propNames = Object.getOwnPropertyNames(object);\n\n    // Freeze properties before freezing yourself\n    for (let name of propNames) {\n        let value = object[name];\n\n        object[name] = (value && typeof value === \"object\") ?\n            deepFreeze(value) : value;\n    }\n\n    return Object.freeze(object);\n}\n\nassignToNamespace('Monster.Util', deepFreeze);\nexport {Monster, deepFreeze}\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](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\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__.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};","/**\n * @license\n * Copyright 2021 schukai GmbH\n * SPDX-License-Identifier: AGPL-3.0-only or COMMERCIAL\n * @author schukai GmbH\n */\n\n'use strict';\n\nimport './constants.js';\nimport './constraints/abstract.js';\nimport './constraints/abstractoperator.js';\nimport './constraints/andoperator.js';\nimport './constraints/invalid.js';\nimport './constraints/isarray.js';\n\n// find packages/monster/source/ -type f -name \"*.js\" -not -name \"*namespace*\" -not -iname  \"monster.js\"\nimport './constraints/isobject.js';\nimport './constraints/oroperator.js';\nimport './constraints/valid.js';\nimport './data/buildmap.js';\nimport './data/diff.js';\nimport './data/extend.js';\nimport './data/pathfinder.js';\nimport './data/pipe.js';\nimport './data/transformer.js';\nimport './dom/assembler.js';\nimport './dom/attributes.js';\nimport './dom/constants.js';\nimport './dom/customcontrol.js';\nimport './dom/customelement.js';\nimport './dom/events.js';\nimport './dom/locale.js';\nimport './dom/template.js';\nimport './dom/theme.js';\nimport './dom/updater.js';\nimport './dom/util.js';\nimport './i18n/locale.js';\nimport './i18n/provider.js';\nimport './i18n/providers/fetch.js';\nimport './i18n/translations.js';\nimport './logging/handler.js';\nimport './logging/handler/console.js';\nimport './logging/logentry.js';\nimport './logging/logger.js';\nimport './math/random.js';\nimport {Monster} from './namespace.js';\nimport './text/formatter.js';\nimport './types/base.js';\nimport './types/basewithoptions.js';\nimport './types/global.js';\nimport './types/id.js';\nimport './types/is.js';\nimport './types/observer.js';\nimport './types/observerlist.js';\nimport './types/proxyobserver.js';\nimport './types/queue.js';\nimport './types/randomid.js';\nimport './types/stack.js';\nimport './types/tokenlist.js';\nimport './types/typeof.js';\nimport './types/uniquequeue.js';\nimport './types/validate.js';\nimport './types/version.js';\nimport './util/clone.js';\nimport './util/comparator.js';\nimport './util/freeze.js';\n\n\nlet rootName\ntry {\n    rootName = Monster.Types.getGlobalObject('__MonsterRootName__');\n} catch (e) {\n\n}\n\nif (!rootName) rootName = \"Monster\";\n\nMonster.Types.getGlobal()[rootName] = Monster\nexport {Monster};"],"names":["Monster","internalSymbol","Symbol","internalStateSymbol","Namespace","namespace","undefined","Error","getNamespace","assignToNamespace","ns","current","namespaceFor","split","i","l","objectName","obj","hasOwnProperty","name","toString","s","f","match","Array","isArray","c","e","parts","space","length","Base","AbstractConstraint","value","Promise","reject","JSON","stringify","Object","AbstractOperator","operantA","operantB","TypeError","AndOperator","all","isValid","Invalid","IsArray","resolve","isIterable","iterator","isPrimitive","type","isSymbol","isBoolean","isString","isObject","isInstance","instance","isFunction","isInteger","Number","IsObject","OrOperator","self","a","b","then","catch","Valid","validateString","clone","DELIMITER","Pathfinder","WILDCARD","PARENT","buildMap","subject","selector","valueTemplate","keyTemplate","filter","assembleParts","v","k","m","build","set","callback","result","Map","map","buildFlatMap","call","forEach","key","parentMap","currentMap","resultLength","size","currentPath","shift","push","finder","getVia","join","o","copyKey","kk","sub","definition","defaultValue","regexp","array","matchAll","groups","placeholder","path","replaceAll","validateIterable","validatePrimitive","validateBoolean","validateObject","validateInstance","n","validateArray","validateSymbol","validateFunction","validateInteger","getGlobal","typeOf","copy","len","Date","setTime","getTime","Element","HTMLDocument","DocumentFragment","globalContext","window","document","navigator","Proxy","cloneObject","constructor","prototype","getClone","globalReference","globalThis","defineProperty","get","configurable","__monster__","Function","getGlobalObject","getGlobalFunction","results","exec","toLowerCase","Stack","object","wildCard","wildcard","getValueViaPath","setValueViaPath","deleteValueViaPath","iterate","check","entries","anchor","WeakMap","Set","WeakSet","parseInt","WeakRef","descriptor","getOwnPropertyDescriptor","getPrototypeOf","last","pop","subpath","stack","isEmpty","peek","append","assignProperty","delete","data","diff","first","second","doDiff","getKeys","keys","fill","_","concat","typeA","typeB","currPath","currDiff","buildResult","getOperator","operator","isNotEqual","extend","arguments","Transformer","Pipe","pipe","context","t","setCallback","reduce","accumulator","transformer","currentIndex","run","ID","args","disassemble","command","callbacks","transform","apply","regex","g","p","r","replace","trim","convertToString","console","toUpperCase","parse","encodeURIComponent","callbackName","has","unshift","doc","DOMParser","parseFromString","body","textContent","trueStatement","falseStatement","condition","firstchar","charAt","substr","btoa","atob","log","prefix","suffix","sort","useKey","exists","pf","start","end","substring","defaultType","parseFloat","internalCounter","count","id","ProxyObserver","ATTRIBUTEPREFIX","Assembler","fragment","attributePrefix","cloneNode","Observer","ObserverList","realSubject","getHandler","objectMap","proxyMap","observers","observer","attach","detach","notify","contains","proxy","handler","target","receiver","Reflect","writable","enumerable","deleteProperty","setPrototypeOf","object1","TokenList","UniqueQueue","tags","queue","tag","add","remove","setTimeout","poll","init","tokens","index","next","done","counter","token","clear","newToken","from","indexOf","splice","toggleValue","Queue","unique","pomises","update","ATTRIBUTE_OBJECTLINK","findClosestObjectLink","element","findClosestByAttribute","addToObjectLink","symbol","HTMLElement","addAttributeToken","removeObjectLink","removeAttributeToken","hasObjectLink","containsAttributeToken","getLinkedObjects","toggleAttributeToken","hasAttribute","setAttribute","getAttribute","toggle","replaceAttributeToken","to","clearAttributeTokens","closest","findClosestByClass","className","classList","DEFAULT_THEME","ATTRIBUTE_PREFIX","ATTRIBUTE_OPTIONS","ATTRIBUTE_OPTIONS_SELECTOR","ATTRIBUTE_THEME_PREFIX","ATTRIBUTE_THEME_NAME","ATTRIBUTE_UPDATER_ATTRIBUTES","ATTRIBUTE_UPDATER_SELECT_THIS","ATTRIBUTE_UPDATER_REPLACE","ATTRIBUTE_UPDATER_INSERT","ATTRIBUTE_UPDATER_INSERT_REFERENCE","ATTRIBUTE_UPDATER_REMOVE","ATTRIBUTE_UPDATER_BIND","ATTRIBUTE_TEMPLATE_PREFIX","ATTRIBUTE_ROLE","ATTRIBUTE_DISABLED","ATTRIBUTE_VALUE","ATTRIBUTE_ERRORMESSAGE","objectUpdaterLinkSymbol","TAG_SCRIPT","TAG_STYLE","TAG_LINK","ATTRIBUTE_ID","ATTRIBUTE_CLASS","ATTRIBUTE_TITLE","ATTRIBUTE_SRC","ATTRIBUTE_HREF","ATTRIBUTE_TYPE","ATTRIBUTE_NONCE","ATTRIBUTE_TRANSLATE","ATTRIBUTE_TABINDEX","ATTRIBUTE_SPELLCHECK","ATTRIBUTE_SLOT","ATTRIBUTE_PART","ATTRIBUTE_LANG","ATTRIBUTE_ITEMTYPE","ATTRIBUTE_ITEMSCOPE","ATTRIBUTE_ITEMREF","ATTRIBUTE_ITEMID","ATTRIBUTE_ITEMPROP","ATTRIBUTE_IS","ATTRIBUTE_INPUTMODE","ATTRIBUTE_ACCESSKEY","ATTRIBUTE_AUTOCAPITALIZE","ATTRIBUTE_AUTOFOCUS","ATTRIBUTE_CONTENTEDITABLE","ATTRIBUTE_DIR","ATTRIBUTE_DRAGGABLE","ATTRIBUTE_ENTERKEYHINT","ATTRIBUTE_EXPORTPARTS","ATTRIBUTE_HIDDEN","CustomElement","attributeObserverSymbol","attachedInternalSymbol","CustomControl","attachInternals","initObserver","getInternal","labels","getTag","validity","validationMessage","willValidate","states","form","state","setFormValue","flags","message","setValidity","checkValidity","reportValidity","list","setOption","parseDataURL","findDocumentTemplate","Template","Updater","initMethodSymbol","assembleMethodSymbol","defaults","initOptionObserver","shadowMode","delegatesFocus","templates","main","attachObserver","detachObserver","containsObserver","getRealSubject","getSubject","setVia","options","parseOptionsJSON","elements","nodeList","AttributeOptions","getOptionsFromAttributes","setOptions","ScriptOptions","getOptionsFromScriptTag","getOption","initShadowRoot","shadowRoot","childNodes","initCSSStylesheet","NodeList","initHtmlContent","getSlottedElements","assignUpdaterToElement","attrName","oldVal","newVal","node","containChildNode","Node","ShadowRoot","query","slots","querySelectorAll","slot","assignedElements","matches","lastDisabledValue","flag","removeAttribute","updaters","updater","d","assign","querySelector","HTMLScriptElement","dataUrl","content","template","appendChild","createDocumentFragment","html","innerHTML","styleSheet","getCSSStyleSheet","CSSStyleSheet","cssRules","adoptedStyleSheets","trimedStyleSheet","style","createElement","prepend","attachShadow","mode","registerCustomElement","define","HTMLTemplateElement","u","enableEventProcessing","MediaType","parseMediaType","internal","DataUrl","mediatype","base64","dataurl","mediatypeAndBase64","base64Flag","endsWith","lastIndexOf","decodeURIComponent","subtype","parameter","startsWith","parseParameter","entry","kv","getDocumentTheme","currentNode","Document","prefixID","getRootNode","ownerDocument","theme","themedPrefixID","getName","getElementById","themedID","Theme","trimSpaces","findTargetElementFromEvent","getDocument","eventTypes","getCheckStateCallback","diffResult","change","removeElement","insertElement","updateContent","updateAttributes","types","disableEventProcessing","addEventListener","getControlEventHandler","capture","passive","removeEventListener","notifyObservers","retrieveFromBindings","HTMLInputElement","HTMLOptionElement","event","retrieveAndSetValue","pathfinder","checked","HTMLTextAreaElement","HTMLSelectElement","selectedOptions","parentNode","removeChild","mem","wd","container","found","containerElement","attributes","def","refPrefix","cmd","dataPath","insertPoint","hasChildNodes","lastChild","available","ref","refElement","appendNewDocumentFragment","nodes","applyRecursive","child","runUpdateContent","assignedNodes","firstChild","runUpdateAttributes","handleInputControlAttributeUpdate","opt","selected","selectedIndex","fireEvent","click","Event","bubbles","cancelable","dispatchEvent","HTMLCollection","fireCustomEvent","detail","CustomEvent","attributeName","attributeValue","composedPath","getWindow","getDocumentFragmentFromString","parseLocale","DEFAULT_LANGUAGE","getLocaleOfDocument","locale","propertiesSymbol","localeStringSymbol","Locale","language","region","script","variants","extlang","privateUse","privateValue","localeString","regexRegular","regexIrregular","regexGrandfathered","regexPrivateUse","regexSingleton","regexExtension","regexVariant","regexRegion","regexScript","regexExtlang","regexLanguage","regexLangtag","regexLanguageTag","RegExp","lastIndex","BaseWithOptions","Translations","Provider","storage","defaultText","getPluralRuleText","keyword","toLocaleString","Intl","PluralRules","select","DEFAULT_KEY","text","translations","setText","Formatter","Fetch","url","URL","fetch","method","cache","credentials","redirect","referrerPolicy","formatter","getMap","format","response","json","assignTranslations","internalObjectSymbol","watchdogSymbol","markerOpenIndexSymbol","markerCloseIndexSymbol","workingDataSymbol","marker","open","close","delimiter","assignment","openMarker","closeMarker","tokenize","formatted","parameterAssignment","parameterDelimiter","startIndex","endIndex","insideStartIndex","currentPipe","t1","t2","t3","LogEntry","ALL","DEBUG","ERROR","FATAL","INFO","OFF","TRACE","WARN","Handler","loglevel","getLogLevel","setLogLevel","Logger","triggerLog","level","label","logger","ConsoleHandler","random","min","max","MAX","Math","round","create","log2","crypt","rval","range","bitsNeeded","ceil","bytesNeeded","mask","pow","byteArray","Uint8Array","getRandomValues","RandomID","Version","major","minor","patch","isNaN","version","monsterVersion","getVersion","Comparator","compare","original","greaterThan","equal","lessThan","deepFreeze","propNames","getOwnPropertyNames","freeze","rootName","Types"],"sourceRoot":""}
\ No newline at end of file
diff --git a/packages/monster/dist/monster.js b/packages/monster/dist/monster.js
index 8ec6464cd49f4eb411c20f4149a69805bdd106f8..d76c89bb53d92c7a65e72d5306df54fb4892957f 100644
--- a/packages/monster/dist/monster.js
+++ b/packages/monster/dist/monster.js
@@ -1,2 +1,2 @@
 /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
-!function webpackUniversalModuleDefinition(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?exports.window=factory():root.window=factory()}(self,(function(){return function(){var __webpack_require__={d:function(exports,definition){for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},o:function(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)},r:function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})}},__webpack_exports__={};function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Monster:function(){return Monster}});var Namespace=function(){function Namespace(namespace){if(function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Namespace),void 0===namespace||"string"!=typeof namespace)throw new Error("namespace is not a string");this.namespace=namespace}return function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(Namespace,[{key:"getNamespace",value:function getNamespace(){return this.namespace}},{key:"toString",value:function toString(){return this.getNamespace()}}]),Namespace}(),Monster=new Namespace("Monster");function assignToNamespace(ns){var current=namespaceFor(ns.split("."));if(0==(arguments.length<=1?0:arguments.length-1))throw new Error("no functions have been passed.");for(var i=0,l=arguments.length<=1?0:arguments.length-1;i<l;i++)current[objectName(i+1<1||arguments.length<=i+1?void 0:arguments[i+1])]=i+1<1||arguments.length<=i+1?void 0:arguments[i+1];return current}function objectName(fn){try{if("function"!=typeof fn)throw new Error("the first argument is not a function or class.");if(fn.hasOwnProperty("name"))return fn.name;if("function"==typeof fn.toString){var s=fn.toString(),f=s.match(/^\s*function\s+([^\s(]+)/);if(Array.isArray(f)&&"string"==typeof f[1])return f[1];var c=s.match(/^\s*class\s+([^\s(]+)/);if(Array.isArray(c)&&"string"==typeof c[1])return c[1]}}catch(e){throw new Error("exception "+e)}throw new Error("the name of the class or function cannot be resolved.")}function namespaceFor(parts){for(var space=Monster,ns="Monster",i=0;i<parts.length;i++)"Monster"!==parts[i]&&(ns+="."+parts[i],space.hasOwnProperty(parts[i])||(space[parts[i]]=new Namespace(ns)),space=space[parts[i]]);return space}assignToNamespace("Monster",assignToNamespace,Namespace);var internalSymbol=Symbol("internalData");Symbol("state");function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function base_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function base_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _possibleConstructorReturn(self,call){if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function _wrapNativeSuper(Class){var _cache="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function _wrapNativeSuper(Class){if(null===Class||!function _isNativeFunction(fn){return-1!==Function.toString.call(fn).indexOf("[native code]")}(Class))return Class;if("function"!=typeof Class)throw new TypeError("Super expression must either be null or a function");if(void 0!==_cache){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper)}function Wrapper(){return _construct(Class,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,Class)})(Class)}function _construct(Parent,args,Class){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}var Base=function(_Object){!function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_setPrototypeOf(subClass,superClass)}(Base,_Object);var _super=function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return _possibleConstructorReturn(this,result)}}(Base);function Base(){return base_classCallCheck(this,Base),_super.apply(this,arguments)}return function base_createClass(Constructor,protoProps,staticProps){return protoProps&&base_defineProperties(Constructor.prototype,protoProps),staticProps&&base_defineProperties(Constructor,staticProps),Constructor}(Base,[{key:"toString",value:function toString(){return JSON.stringify(this)}}]),Base}(_wrapNativeSuper(Object));function abstract_typeof(obj){return(abstract_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function abstract_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function abstract_setPrototypeOf(o,p){return(abstract_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function abstract_createSuper(Derived){var hasNativeReflectConstruct=function abstract_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=abstract_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=abstract_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return abstract_possibleConstructorReturn(this,result)}}function abstract_possibleConstructorReturn(self,call){if(call&&("object"===abstract_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function abstract_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function abstract_getPrototypeOf(o){return(abstract_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Base);var AbstractConstraint=function(_Base){!function abstract_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&abstract_setPrototypeOf(subClass,superClass)}(AbstractConstraint,_Base);var _super=abstract_createSuper(AbstractConstraint);function AbstractConstraint(){return function abstract_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AbstractConstraint),_super.call(this)}return function abstract_createClass(Constructor,protoProps,staticProps){return protoProps&&abstract_defineProperties(Constructor.prototype,protoProps),staticProps&&abstract_defineProperties(Constructor,staticProps),Constructor}(AbstractConstraint,[{key:"isValid",value:function isValid(value){return Promise.reject(value)}}]),AbstractConstraint}(Base);function abstractoperator_typeof(obj){return(abstractoperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function abstractoperator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function abstractoperator_setPrototypeOf(o,p){return(abstractoperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function abstractoperator_createSuper(Derived){var hasNativeReflectConstruct=function abstractoperator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=abstractoperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=abstractoperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return abstractoperator_possibleConstructorReturn(this,result)}}function abstractoperator_possibleConstructorReturn(self,call){if(call&&("object"===abstractoperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function abstractoperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function abstractoperator_getPrototypeOf(o){return(abstractoperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Constraints",AbstractConstraint);var globalReference,AbstractOperator=function(_AbstractConstraint){!function abstractoperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&abstractoperator_setPrototypeOf(subClass,superClass)}(AbstractOperator,_AbstractConstraint);var _super=abstractoperator_createSuper(AbstractOperator);function AbstractOperator(operantA,operantB){var _this;if(function abstractoperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AbstractOperator),_this=_super.call(this),!(operantA instanceof AbstractConstraint&&operantB instanceof AbstractConstraint))throw new TypeError("parameters must be from type AbstractConstraint");return _this.operantA=operantA,_this.operantB=operantB,_this}return function abstractoperator_createClass(Constructor,protoProps,staticProps){return protoProps&&abstractoperator_defineProperties(Constructor.prototype,protoProps),staticProps&&abstractoperator_defineProperties(Constructor,staticProps),Constructor}(AbstractOperator)}(AbstractConstraint);function andoperator_typeof(obj){return(andoperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function andoperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function andoperator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function andoperator_setPrototypeOf(o,p){return(andoperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function andoperator_createSuper(Derived){var hasNativeReflectConstruct=function andoperator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=andoperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=andoperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return andoperator_possibleConstructorReturn(this,result)}}function andoperator_possibleConstructorReturn(self,call){if(call&&("object"===andoperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function andoperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function andoperator_getPrototypeOf(o){return(andoperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function invalid_typeof(obj){return(invalid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function invalid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function invalid_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function invalid_setPrototypeOf(o,p){return(invalid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function invalid_createSuper(Derived){var hasNativeReflectConstruct=function invalid_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=invalid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=invalid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return invalid_possibleConstructorReturn(this,result)}}function invalid_possibleConstructorReturn(self,call){if(call&&("object"===invalid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function invalid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function invalid_getPrototypeOf(o){return(invalid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function is_typeof(obj){return(is_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isIterable(value){return void 0!==value&&(null!==value&&"function"==typeof(null==value?void 0:value[Symbol.iterator]))}function isPrimitive(value){var type;return null==value||("string"===(type=is_typeof(value))||"number"===type||"boolean"===type||"symbol"===type)}function isSymbol(value){return"symbol"===is_typeof(value)}function isBoolean(value){return!0===value||!1===value}function isString(value){return void 0!==value&&"string"==typeof value}function isObject(value){return!isArray(value)&&(!isPrimitive(value)&&"object"===is_typeof(value))}function isInstance(value,instance){return!!isObject(value)&&(!!isFunction(instance)&&(!!instance.hasOwnProperty("prototype")&&value instanceof instance))}function isArray(value){return Array.isArray(value)}function isFunction(value){return!isArray(value)&&(!isPrimitive(value)&&"function"==typeof value)}function isInteger(value){return Number.isInteger(value)}function isarray_typeof(obj){return(isarray_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isarray_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function isarray_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function isarray_setPrototypeOf(o,p){return(isarray_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function isarray_createSuper(Derived){var hasNativeReflectConstruct=function isarray_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=isarray_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=isarray_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return isarray_possibleConstructorReturn(this,result)}}function isarray_possibleConstructorReturn(self,call){if(call&&("object"===isarray_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function isarray_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function isarray_getPrototypeOf(o){return(isarray_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function isobject_typeof(obj){return(isobject_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isobject_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function isobject_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function isobject_setPrototypeOf(o,p){return(isobject_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function isobject_createSuper(Derived){var hasNativeReflectConstruct=function isobject_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=isobject_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=isobject_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return isobject_possibleConstructorReturn(this,result)}}function isobject_possibleConstructorReturn(self,call){if(call&&("object"===isobject_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function isobject_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function isobject_getPrototypeOf(o){return(isobject_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function oroperator_typeof(obj){return(oroperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function oroperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function oroperator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function oroperator_setPrototypeOf(o,p){return(oroperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function oroperator_createSuper(Derived){var hasNativeReflectConstruct=function oroperator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=oroperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=oroperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return oroperator_possibleConstructorReturn(this,result)}}function oroperator_possibleConstructorReturn(self,call){if(call&&("object"===oroperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function oroperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function oroperator_getPrototypeOf(o){return(oroperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function valid_typeof(obj){return(valid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function valid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function valid_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function valid_setPrototypeOf(o,p){return(valid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function valid_createSuper(Derived){var hasNativeReflectConstruct=function valid_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=valid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=valid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return valid_possibleConstructorReturn(this,result)}}function valid_possibleConstructorReturn(self,call){if(call&&("object"===valid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function valid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function valid_getPrototypeOf(o){return(valid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function validatePrimitive(value){if(!isPrimitive(value))throw new TypeError("value is not a primitive");return value}function validateBoolean(value){if(!isBoolean(value))throw new TypeError("value is not a boolean");return value}function validateString(value){if(!isString(value))throw new TypeError("value is not a string");return value}function validateObject(value){if(!isObject(value))throw new TypeError("value is not a object");return value}function validateInstance(value,instance){if(!isInstance(value,instance)){var n="";throw(isObject(instance)||isFunction(instance))&&(n=null==instance?void 0:instance.name),n&&(n=" "+n),new TypeError("value is not an instance of"+n)}return value}function validateArray(value){if(!isArray(value))throw new TypeError("value is not an array");return value}function validateSymbol(value){if(!isSymbol(value))throw new TypeError("value is not an symbol");return value}function validateFunction(value){if(!isFunction(value))throw new TypeError("value is not a function");return value}function validateInteger(value){if(!isInteger(value))throw new TypeError("value is not an integer");return value}function global_typeof(obj){return(global_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function getGlobal(){return globalReference}function getGlobalObject(name){var _globalReference;validateString(name);var o=null===(_globalReference=globalReference)||void 0===_globalReference?void 0:_globalReference[name];if(void 0===o)throw new Error("the object "+name+" is not defined");return validateObject(o),o}function getGlobalFunction(name){var _globalReference2;validateString(name);var f=null===(_globalReference2=globalReference)||void 0===_globalReference2?void 0:_globalReference2[name];if(void 0===f)throw new Error("the function "+name+" is not defined");return validateFunction(f),f}function typeOf(value){var type={}.toString.call(value).match(/\s([a-zA-Z]+)/)[1];if("Object"===type){var results=/^(class|function)\s+(\w+)/.exec(value.constructor.toString());type=results&&results.length>2?results[2]:""}return type.toLowerCase()}function clone_typeof(obj){return(clone_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function clone(obj){if(null===obj)return obj;if(isPrimitive(obj))return obj;if(isFunction(obj))return obj;if(isArray(obj)){for(var copy=[],i=0,len=obj.length;i<len;i++)copy[i]=clone(obj[i]);return copy}if(isObject(obj)){if(obj instanceof Date){var _copy=new Date;return _copy.setTime(obj.getTime()),_copy}if("undefined"!=typeof Element&&obj instanceof Element)return obj;if("undefined"!=typeof HTMLDocument&&obj instanceof HTMLDocument)return obj;if("undefined"!=typeof DocumentFragment&&obj instanceof DocumentFragment)return obj;if(obj===getGlobal())return obj;if("undefined"!=typeof globalContext&&obj===globalContext)return obj;if("undefined"!=typeof window&&obj===window)return obj;if("undefined"!=typeof document&&obj===document)return obj;if("undefined"!=typeof navigator&&obj===navigator)return obj;if("undefined"!=typeof JSON&&obj===JSON)return obj;try{if(obj instanceof Proxy)return obj}catch(e){}return function cloneObject(obj){validateObject(obj);var constructor=null==obj?void 0:obj.constructor;if("function"===typeOf(constructor)){var prototype=null==constructor?void 0:constructor.prototype;if("object"===clone_typeof(prototype)&&prototype.hasOwnProperty("getClone")&&"function"===typeOf(obj.getClone))return obj.getClone()}var copy={};"function"==typeof obj.constructor&&"function"==typeof obj.constructor.call&&(copy=new obj.constructor);for(var key in obj)obj.hasOwnProperty(key)&&(isPrimitive(obj[key])?copy[key]=obj[key]:copy[key]=clone(obj[key]));return copy}(obj)}throw new Error("unable to clone obj! its type isn't supported.")}function stack_typeof(obj){return(stack_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function stack_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function stack_setPrototypeOf(o,p){return(stack_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function stack_createSuper(Derived){var hasNativeReflectConstruct=function stack_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=stack_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=stack_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return stack_possibleConstructorReturn(this,result)}}function stack_possibleConstructorReturn(self,call){if(call&&("object"===stack_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function stack_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function stack_getPrototypeOf(o){return(stack_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Constraints",AbstractOperator),assignToNamespace("Monster.Constraints",function(_AbstractOperator){!function andoperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&andoperator_setPrototypeOf(subClass,superClass)}(AndOperator,_AbstractOperator);var _super=andoperator_createSuper(AndOperator);function AndOperator(){return andoperator_classCallCheck(this,AndOperator),_super.apply(this,arguments)}return function andoperator_createClass(Constructor,protoProps,staticProps){return protoProps&&andoperator_defineProperties(Constructor.prototype,protoProps),staticProps&&andoperator_defineProperties(Constructor,staticProps),Constructor}(AndOperator,[{key:"isValid",value:function isValid(value){return Promise.all([this.operantA.isValid(value),this.operantB.isValid(value)])}}]),AndOperator}(AbstractOperator)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function invalid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&invalid_setPrototypeOf(subClass,superClass)}(Invalid,_AbstractConstraint);var _super=invalid_createSuper(Invalid);function Invalid(){return invalid_classCallCheck(this,Invalid),_super.apply(this,arguments)}return function invalid_createClass(Constructor,protoProps,staticProps){return protoProps&&invalid_defineProperties(Constructor.prototype,protoProps),staticProps&&invalid_defineProperties(Constructor,staticProps),Constructor}(Invalid,[{key:"isValid",value:function isValid(value){return Promise.reject(value)}}]),Invalid}(AbstractConstraint)),assignToNamespace("Monster.Types",isPrimitive,isBoolean,isString,isObject,isArray,isFunction,isIterable,isInteger,isSymbol),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function isarray_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&isarray_setPrototypeOf(subClass,superClass)}(IsArray,_AbstractConstraint);var _super=isarray_createSuper(IsArray);function IsArray(){return isarray_classCallCheck(this,IsArray),_super.apply(this,arguments)}return function isarray_createClass(Constructor,protoProps,staticProps){return protoProps&&isarray_defineProperties(Constructor.prototype,protoProps),staticProps&&isarray_defineProperties(Constructor,staticProps),Constructor}(IsArray,[{key:"isValid",value:function isValid(value){return isArray(value)?Promise.resolve(value):Promise.reject(value)}}]),IsArray}(AbstractConstraint)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function isobject_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&isobject_setPrototypeOf(subClass,superClass)}(IsObject,_AbstractConstraint);var _super=isobject_createSuper(IsObject);function IsObject(){return isobject_classCallCheck(this,IsObject),_super.apply(this,arguments)}return function isobject_createClass(Constructor,protoProps,staticProps){return protoProps&&isobject_defineProperties(Constructor.prototype,protoProps),staticProps&&isobject_defineProperties(Constructor,staticProps),Constructor}(IsObject,[{key:"isValid",value:function isValid(value){return isObject(value)?Promise.resolve(value):Promise.reject(value)}}]),IsObject}(AbstractConstraint)),assignToNamespace("Monster.Constraints",function(_AbstractOperator){!function oroperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&oroperator_setPrototypeOf(subClass,superClass)}(OrOperator,_AbstractOperator);var _super=oroperator_createSuper(OrOperator);function OrOperator(){return oroperator_classCallCheck(this,OrOperator),_super.apply(this,arguments)}return function oroperator_createClass(Constructor,protoProps,staticProps){return protoProps&&oroperator_defineProperties(Constructor.prototype,protoProps),staticProps&&oroperator_defineProperties(Constructor,staticProps),Constructor}(OrOperator,[{key:"isValid",value:function isValid(value){var self=this;return new Promise((function(resolve,reject){var a,b;self.operantA.isValid(value).then((function(){resolve()})).catch((function(){a=!1,!1===b&&reject()})),self.operantB.isValid(value).then((function(){resolve()})).catch((function(){b=!1,!1===a&&reject()}))}))}}]),OrOperator}(AbstractOperator)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function valid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&valid_setPrototypeOf(subClass,superClass)}(Valid,_AbstractConstraint);var _super=valid_createSuper(Valid);function Valid(){return valid_classCallCheck(this,Valid),_super.apply(this,arguments)}return function valid_createClass(Constructor,protoProps,staticProps){return protoProps&&valid_defineProperties(Constructor.prototype,protoProps),staticProps&&valid_defineProperties(Constructor,staticProps),Constructor}(Valid,[{key:"isValid",value:function isValid(value){return Promise.resolve(value)}}]),Valid}(AbstractConstraint)),assignToNamespace("Monster.Types",validatePrimitive,validateBoolean,validateString,validateObject,validateArray,validateFunction,(function validateIterable(value){if(!isIterable(value))throw new TypeError("value is not iterable");return value}),validateInteger),function(){if("object"!==("undefined"==typeof globalThis?"undefined":global_typeof(globalThis)))if("undefined"==typeof self){if("undefined"==typeof window){if(Object.defineProperty(Object.prototype,"__monster__",{get:function get(){return this},configurable:!0}),"object"===("undefined"==typeof __monster__?"undefined":global_typeof(__monster__)))return __monster__.globalThis=__monster__,delete Object.prototype.__monster__,void(globalReference=globalThis);try{globalReference=Function("return this")()}catch(e){}throw new Error("unsupported environment.")}globalReference=window}else globalReference=self;else globalReference=globalThis}(),assignToNamespace("Monster.Types",getGlobal,getGlobalObject,getGlobalFunction),assignToNamespace("Monster.Types",typeOf),assignToNamespace("Monster.Util",clone);var Stack=function(_Base){!function stack_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&stack_setPrototypeOf(subClass,superClass)}(Stack,_Base);var _super=stack_createSuper(Stack);function Stack(){var _this;return function stack_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Stack),(_this=_super.call(this)).data=[],_this}return function stack_createClass(Constructor,protoProps,staticProps){return protoProps&&stack_defineProperties(Constructor.prototype,protoProps),staticProps&&stack_defineProperties(Constructor,staticProps),Constructor}(Stack,[{key:"isEmpty",value:function isEmpty(){return 0===this.data.length}},{key:"peek",value:function peek(){var _this$data;if(!this.isEmpty())return null===(_this$data=this.data)||void 0===_this$data?void 0:_this$data[this.data.length-1]}},{key:"push",value:function push(value){return this.data.push(value),this}},{key:"clear",value:function clear(){return this.data=[],this}},{key:"pop",value:function pop(){if(!this.isEmpty())return this.data.pop()}}]),Stack}(Base);function pathfinder_typeof(obj){return(pathfinder_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _toConsumableArray(arr){return function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||_unsupportedIterableToArray(arr)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||_unsupportedIterableToArray(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function pathfinder_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function pathfinder_setPrototypeOf(o,p){return(pathfinder_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function pathfinder_createSuper(Derived){var hasNativeReflectConstruct=function pathfinder_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=pathfinder_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=pathfinder_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return pathfinder_possibleConstructorReturn(this,result)}}function pathfinder_possibleConstructorReturn(self,call){if(call&&("object"===pathfinder_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function pathfinder_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function pathfinder_getPrototypeOf(o){return(pathfinder_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Stack);var Pathfinder=function(_Base){!function pathfinder_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&pathfinder_setPrototypeOf(subClass,superClass)}(Pathfinder,_Base);var _super=pathfinder_createSuper(Pathfinder);function Pathfinder(object){var _this;if(function pathfinder_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Pathfinder),_this=_super.call(this),isPrimitive(object))throw new Error("the parameter must not be a simple type");return _this.object=object,_this.wildCard="*",_this}return function pathfinder_createClass(Constructor,protoProps,staticProps){return protoProps&&pathfinder_defineProperties(Constructor.prototype,protoProps),staticProps&&pathfinder_defineProperties(Constructor,staticProps),Constructor}(Pathfinder,[{key:"setWildCard",value:function setWildCard(wildcard){return validateString(wildcard),this.wildCard=wildcard,this}},{key:"getVia",value:function getVia(path){return getValueViaPath.call(this,this.object,validateString(path))}},{key:"setVia",value:function setVia(path,value){return validateString(path),setValueViaPath.call(this,this.object,path,value),this}},{key:"deleteVia",value:function deleteVia(path){return validateString(path),deleteValueViaPath.call(this,this.object,path),this}},{key:"exists",value:function exists(path){validateString(path);try{return getValueViaPath.call(this,this.object,path,!0),!0}catch(e){}return!1}}]),Pathfinder}(Base);function iterate(subject,path,check){var result=new Map;if(isObject(subject)||isArray(subject))for(var _i=0,_Object$entries=Object.entries(subject);_i<_Object$entries.length;_i++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i],2),key=_Object$entries$_i[0],value=_Object$entries$_i[1];result.set(key,getValueViaPath.call(this,value,path,check))}else{var _key=path.split(".").shift();result.set(_key,getValueViaPath.call(this,subject,path,check))}return result}function getValueViaPath(subject,path,check){if(""===path)return subject;var parts=path.split("."),current=parts.shift();if(current===this.wildCard)return iterate.call(this,subject,parts.join("."),check);if(isObject(subject)||isArray(subject)){var anchor;if(subject instanceof Map||subject instanceof WeakMap)anchor=subject.get(current);else if(subject instanceof Set||subject instanceof WeakSet){var _ref;validateInteger(current=parseInt(current)),anchor=null===(_ref=_toConsumableArray(subject))||void 0===_ref?void 0:_ref[current]}else{if("function"==typeof WeakRef&&subject instanceof WeakRef)throw Error("unsupported action for this data type");isArray(subject)?(validateInteger(current=parseInt(current)),anchor=null==subject?void 0:subject[current]):anchor=null==subject?void 0:subject[current]}if(isObject(anchor)||isArray(anchor))return getValueViaPath.call(this,anchor,parts.join("."),check);if(parts.length>0)throw Error("the journey is not at its end ("+parts.join(".")+")");if(!0===check){var descriptor=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(subject),current);if(!subject.hasOwnProperty(current)&&void 0===descriptor)throw Error("unknown value")}return anchor}throw TypeError("unsupported type "+pathfinder_typeof(subject))}function setValueViaPath(object,path,value){validateString(path);for(var parts=path.split("."),last=parts.pop(),subpath=parts.join("."),stack=new Stack,current=subpath;;){try{getValueViaPath.call(this,object,current,!0);break}catch(e){}if(stack.push(current),parts.pop(),""===(current=parts.join(".")))break}for(;!stack.isEmpty();){current=stack.pop();var obj={};if(!stack.isEmpty()){var n=stack.peek().split(".").pop();isInteger(parseInt(n))&&(obj=[])}setValueViaPath.call(this,object,current,obj)}var anchor=getValueViaPath.call(this,object,subpath);if(!isObject(object)&&!isArray(object))throw TypeError("unsupported type: "+pathfinder_typeof(object));if(anchor instanceof Map||anchor instanceof WeakMap)anchor.set(last,value);else if(anchor instanceof Set||anchor instanceof WeakSet)anchor.append(value);else{if("function"==typeof WeakRef&&anchor instanceof WeakRef)throw Error("unsupported action for this data type");isArray(anchor)?(validateInteger(last=parseInt(last)),assignProperty(anchor,last,value)):assignProperty(anchor,last,value)}}function assignProperty(object,key,value){object.hasOwnProperty(key)?(void 0===value&&delete object[key],object[key]=value):object[key]=value}function deleteValueViaPath(object,path){var parts=path.split("."),last=parts.pop(),subpath=parts.join("."),anchor=getValueViaPath.call(this,object,subpath);if(anchor instanceof Map)anchor.delete(last);else{if(anchor instanceof Set||anchor instanceof WeakMap||anchor instanceof WeakSet||"function"==typeof WeakRef&&anchor instanceof WeakRef)throw Error("unsupported action for this data type");isArray(anchor)?(validateInteger(last=parseInt(last)),delete anchor[last]):delete anchor[last]}}function buildmap_typeof(obj){return(buildmap_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function buildmap_toConsumableArray(arr){return function buildmap_arrayWithoutHoles(arr){if(Array.isArray(arr))return buildmap_arrayLikeToArray(arr)}(arr)||function buildmap_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||buildmap_unsupportedIterableToArray(arr)||function buildmap_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _wrapRegExp(){_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),buildmap_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return buildmap_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==buildmap_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},_wrapRegExp.apply(this,arguments)}function buildmap_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&buildmap_setPrototypeOf(subClass,superClass)}function buildmap_setPrototypeOf(o,p){return(buildmap_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function buildmap_slicedToArray(arr,i){return function buildmap_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function buildmap_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||buildmap_unsupportedIterableToArray(arr,i)||function buildmap_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=buildmap_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function buildmap_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return buildmap_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?buildmap_arrayLikeToArray(o,minLen):void 0}}function buildmap_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}assignToNamespace("Monster.Data",Pathfinder);function buildFlatMap(subject,selector,key,parentMap){var result=this,currentMap=new Map,resultLength=result.size;void 0===key&&(key=[]);var parts=selector.split("."),current="",currentPath=[];do{if(current=parts.shift(),currentPath.push(current),"*"===current){var finder=new Pathfinder(subject),map=void 0;try{map=finder.getVia(currentPath.join("."))}catch(e){map=new Map}var _step,_iterator=_createForOfIteratorHelper(map);try{var _loop=function _loop(){var _step$value=buildmap_slicedToArray(_step.value,2),k=_step$value[0],o=_step$value[1],copyKey=clone(key);currentPath.map((function(a){copyKey.push("*"===a?k:a)}));var kk=copyKey.join("."),sub=buildFlatMap.call(result,o,parts.join("."),copyKey,o);isObject(sub)&&void 0!==parentMap&&(sub["^"]=parentMap),currentMap.set(kk,sub)};for(_iterator.s();!(_step=_iterator.n()).done;)_loop()}catch(err){_iterator.e(err)}finally{_iterator.f()}}}while(parts.length>0);if(resultLength===result.size){var _step2,_iterator2=_createForOfIteratorHelper(currentMap);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _step2$value=buildmap_slicedToArray(_step2.value,2),k=_step2$value[0],o=_step2$value[1];result.set(k,o)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}return subject}function build(subject,definition,defaultValue){if(void 0===definition)return defaultValue||subject;validateString(definition);var regexp=_wrapRegExp(/(\$\{([a-z\^A-Z.\-_0-9]*)\})/gm,{placeholder:1,path:2}),array=buildmap_toConsumableArray(definition.matchAll(regexp)),finder=new Pathfinder(subject);return 0===array.length?finder.getVia(definition):(array.forEach((function(a){var groups=null==a?void 0:a.groups,placeholder=null==groups?void 0:groups.placeholder;if(void 0!==placeholder){var path=null==groups?void 0:groups.path,v=finder.getVia(path);void 0===v&&(v=defaultValue),definition=definition.replaceAll(placeholder,v)}})),definition)}function diff_typeof(obj){return(diff_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function diff(first,second){return doDiff(first,second)}function doDiff(a,b,path,diff){var typeA=typeOf(a),typeB=typeOf(b),currPath=path||[],currDiff=diff||[];if(typeA!==typeB||"object"!==typeA&&"array"!==typeA){var o=function getOperator(a,b){var operator,typeA=diff_typeof(a),typeB=diff_typeof(b);"undefined"===typeA&&"undefined"!==typeB?operator="add":"undefined"!==typeA&&"undefined"===typeB?operator="delete":function isNotEqual(a,b){if(diff_typeof(a)!==diff_typeof(b))return!0;if(a instanceof Date&&b instanceof Date)return a.getTime()!==b.getTime();return a!==b}(a,b)&&(operator="update");return operator}(a,b);void 0!==o&&currDiff.push(buildResult(a,b,o,path))}else(function getKeys(a,b,type){if(isArray(type)){var keys=a.length>b.length?new Array(a.length):new Array(b.length);return keys.fill(0),new Set(keys.map((function(_,i){return i})))}return new Set(Object.keys(a).concat(Object.keys(b)))})(a,b,typeA).forEach((function(v){Object.prototype.hasOwnProperty.call(a,v)?Object.prototype.hasOwnProperty.call(b,v)?doDiff(a[v],b[v],currPath.concat(v),currDiff):currDiff.push(buildResult(a[v],b[v],"delete",currPath.concat(v))):currDiff.push(buildResult(a[v],b[v],"add",currPath.concat(v)))}));return currDiff}function buildResult(a,b,operator,path){var result={operator:operator,path:path};if("add"!==operator&&(result.first={value:a,type:diff_typeof(a)},isObject(a))){var _Object$getPrototypeO,_Object$getPrototypeO2,name=null===(_Object$getPrototypeO=Object.getPrototypeOf(a))||void 0===_Object$getPrototypeO||null===(_Object$getPrototypeO2=_Object$getPrototypeO.constructor)||void 0===_Object$getPrototypeO2?void 0:_Object$getPrototypeO2.name;void 0!==name&&(result.first.instance=name)}if(("add"===operator||"update"===operator)&&(result.second={value:b,type:diff_typeof(b)},isObject(b))){var _Object$getPrototypeO3,_Object$getPrototypeO4,_name=null===(_Object$getPrototypeO3=Object.getPrototypeOf(b))||void 0===_Object$getPrototypeO3||null===(_Object$getPrototypeO4=_Object$getPrototypeO3.constructor)||void 0===_Object$getPrototypeO4?void 0:_Object$getPrototypeO4.name;void 0!==_name&&(result.second.instance=_name)}return result}function extend(){var o,i;for(i=0;i<arguments.length;i++){var a=arguments[i];if(!isObject(a)&&!isArray(a))throw new Error("unsupported argument "+JSON.stringify(a));if(void 0!==o)for(var k in a){var _o,v=null==a?void 0:a[k];if(v!==(null===(_o=o)||void 0===_o?void 0:_o[k]))if(isObject(v)&&"object"===typeOf(v)||isArray(v)){if(void 0===o[k])isArray(v)?o[k]=[]:o[k]={};else if(typeOf(o[k])!==typeOf(v))throw new Error("type mismatch: "+JSON.stringify(o[k])+"("+typeOf(o[k])+") != "+JSON.stringify(v)+"("+typeOf(v)+")");o[k]=extend(o[k],v)}else o[k]=v}else o=a}return o}function id_typeof(obj){return(id_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function id_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function id_setPrototypeOf(o,p){return(id_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function id_createSuper(Derived){var hasNativeReflectConstruct=function id_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=id_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=id_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return id_possibleConstructorReturn(this,result)}}function id_possibleConstructorReturn(self,call){if(call&&("object"===id_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function id_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function id_getPrototypeOf(o){return(id_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",(function buildMap(subject,selector,valueTemplate,keyTemplate,filter){return function assembleParts(subject,selector,filter,callback){var map,result=new Map;if(isFunction(selector)){if(!((map=selector(subject))instanceof Map))throw new TypeError("the selector callback must return a map")}else{if(!isString(selector))throw new TypeError("selector is neither a string nor a function");map=new Map,buildFlatMap.call(map,subject,selector)}if(!(map instanceof Map))return result;return map.forEach((function(v,k,m){isFunction(filter)&&!0!==filter.call(m,v,k)||callback.call(result,v,k,m)})),result}(subject,selector,filter,(function(v,k,m){k=build(v,keyTemplate,k),v=build(v,valueTemplate),this.set(k,v)}))})),assignToNamespace("Monster.Data",diff),assignToNamespace("Monster.Data",extend);var internalCounter=new Map,ID=function(_Base){!function id_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&id_setPrototypeOf(subClass,superClass)}(ID,_Base);var _super=id_createSuper(ID);function ID(prefix){var _this;!function id_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ID),_this=_super.call(this),void 0===prefix&&(prefix="id"),validateString(prefix),internalCounter.has(prefix)||internalCounter.set(prefix,1);var count=internalCounter.get(prefix);return _this.id=prefix+count,internalCounter.set(prefix,++count),_this}return function id_createClass(Constructor,protoProps,staticProps){return protoProps&&id_defineProperties(Constructor.prototype,protoProps),staticProps&&id_defineProperties(Constructor,staticProps),Constructor}(ID,[{key:"toString",value:function toString(){return this.id}}]),ID}(Base);function transformer_toConsumableArray(arr){return function transformer_arrayWithoutHoles(arr){if(Array.isArray(arr))return transformer_arrayLikeToArray(arr)}(arr)||function transformer_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||transformer_unsupportedIterableToArray(arr)||function transformer_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function transformer_typeof(obj){return(transformer_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function transformer_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=transformer_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function transformer_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return transformer_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?transformer_arrayLikeToArray(o,minLen):void 0}}function transformer_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function transformer_wrapRegExp(){transformer_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),transformer_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return transformer_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==transformer_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},transformer_wrapRegExp.apply(this,arguments)}function transformer_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function transformer_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&transformer_setPrototypeOf(subClass,superClass)}function transformer_setPrototypeOf(o,p){return(transformer_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function transformer_createSuper(Derived){var hasNativeReflectConstruct=function transformer_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=transformer_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=transformer_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return transformer_possibleConstructorReturn(this,result)}}function transformer_possibleConstructorReturn(self,call){if(call&&("object"===transformer_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function transformer_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function transformer_getPrototypeOf(o){return(transformer_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",ID);var Transformer=function(_Base){transformer_inherits(Transformer,_Base);var _super=transformer_createSuper(Transformer);function Transformer(definition){var _this;return function transformer_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Transformer),(_this=_super.call(this)).args=function disassemble(command){validateString(command);var _step,placeholder=new Map,regex=transformer_wrapRegExp(/((\\(.)){1})/gim,{pattern:2,char:3}),_iterator=transformer_createForOfIteratorHelper(command.matchAll(regex));try{for(_iterator.s();!(_step=_iterator.n()).done;){var m=_step.value,g=null==m?void 0:m.groups;if(isObject(g)){var p=null==g?void 0:g.pattern,c=null==g?void 0:g.char;if(p&&c){var r="__"+(new ID).toString()+"__";placeholder.set(r,c),command=command.replace(p,r)}}}}catch(err){_iterator.e(err)}finally{_iterator.f()}var parts=command.split(":");return parts=parts.map((function(value){var _step2,v=value.trim(),_iterator2=transformer_createForOfIteratorHelper(placeholder);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var k=_step2.value;v=v.replace(k[0],k[1])}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return v}))}(definition),_this.command=_this.args.shift(),_this.callbacks=new Map,_this}return function transformer_createClass(Constructor,protoProps,staticProps){return protoProps&&transformer_defineProperties(Constructor.prototype,protoProps),staticProps&&transformer_defineProperties(Constructor,staticProps),Constructor}(Transformer,[{key:"setCallback",value:function setCallback(name,callback,context){return validateString(name),validateFunction(callback),void 0!==context&&validateObject(context),this.callbacks.set(name,{callback:callback,context:context}),this}},{key:"run",value:function run(value){return transform.apply(this,[value])}}]),Transformer}(Base);function convertToString(value){return isObject(value)&&value.hasOwnProperty("toString")&&(value=value.toString()),validateString(value),value}function transform(value){var _callback,key,defaultValue,console=getGlobalObject("console"),args=clone(this.args);switch(this.command){case"static":return this.args.join(":");case"tolower":case"strtolower":case"tolowercase":return validateString(value),value.toLowerCase();case"toupper":case"strtoupper":case"touppercase":return validateString(value),value.toUpperCase();case"tostring":return""+value;case"tointeger":var n=parseInt(value);return validateInteger(n),n;case"tojson":return JSON.stringify(value);case"fromjson":return JSON.parse(value);case"trim":return validateString(value),value.trim();case"rawurlencode":return validateString(value),encodeURIComponent(value).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A");case"call":var callback,callbackName=args.shift(),context=getGlobal();if(isObject(value)&&value.hasOwnProperty(callbackName))callback=value[callbackName];else if(this.callbacks.has(callbackName)){var s=this.callbacks.get(callbackName);callback=null==s?void 0:s.callback,context=null==s?void 0:s.context}else"object"===("undefined"==typeof window?"undefined":transformer_typeof(window))&&window.hasOwnProperty(callbackName)&&(callback=window[callbackName]);return validateFunction(callback),args.unshift(value),(_callback=callback).call.apply(_callback,[context].concat(transformer_toConsumableArray(args)));case"plain":case"plaintext":return validateString(value),(new DOMParser).parseFromString(value,"text/html").body.textContent||"";case"if":case"?":validatePrimitive(value);var trueStatement=args.shift()||void 0,falseStatement=args.shift()||void 0;return"value"===trueStatement&&(trueStatement=value),"\\value"===trueStatement&&(trueStatement="value"),"value"===falseStatement&&(falseStatement=value),"\\value"===falseStatement&&(falseStatement="value"),void 0!==value&&""!==value&&"off"!==value&&"false"!==value&&!1!==value||"on"===value||"true"===value||!0===value?trueStatement:falseStatement;case"ucfirst":return validateString(value),value.charAt(0).toUpperCase()+value.substr(1);case"ucwords":return validateString(value),value.replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g,(function(v){return v.toUpperCase()}));case"count":case"length":if((isString(value)||isObject(value)||isArray(value))&&value.hasOwnProperty("length"))return value.length;throw new TypeError("unsupported type "+transformer_typeof(value));case"to-base64":case"btoa":case"base64":return btoa(convertToString(value));case"atob":case"from-base64":return atob(convertToString(value));case"empty":return"";case"undefined":return;case"debug":return isObject(console)&&console.log(value),value;case"prefix":return validateString(value),(null==args?void 0:args[0])+value;case"suffix":return validateString(value),value+(null==args?void 0:args[0]);case"uniqid":return(new ID).toString();case"first-key":case"last-key":case"nth-last-key":case"nth-key":if(!isObject(value))throw new Error("type not supported");var keys=Object.keys(value).sort();"first-key"===this.command?key=0:"last-key"===this.command?key=keys.length-1:(key=validateInteger(parseInt(args.shift())),"nth-last-key"===this.command&&(key=keys.length-key-1)),defaultValue=args.shift()||"";var useKey=null==keys?void 0:keys[key];return null!=value&&value[useKey]?null==value?void 0:value[useKey]:defaultValue;case"key":case"property":case"index":if(void 0===(key=args.shift()||void 0))throw new Error("missing key parameter");if(defaultValue=args.shift()||void 0,value instanceof Map)return value.has(key)?value.get(key):defaultValue;if(isObject(value)||isArray(value))return null!=value&&value[key]?null==value?void 0:value[key]:defaultValue;throw new Error("type not supported");case"path-exists":if(void 0===(key=args.shift()))throw new Error("missing key parameter");return new Pathfinder(value).exists(key);case"path":if(void 0===(key=args.shift()))throw new Error("missing key parameter");var pf=new Pathfinder(value);if(!pf.exists(key))return;return pf.getVia(key);case"substring":validateString(value);var start=parseInt(args[0])||0,end=(parseInt(args[1])||0)+start;return value.substring(start,end);case"nop":return value;case"??":case"default":if(null!=value)return value;defaultValue=args.shift();var defaultType=args.shift();switch(void 0===defaultType&&(defaultType="string"),defaultType){case"int":case"integer":return parseInt(defaultValue);case"float":return parseFloat(defaultValue);case"undefined":return;case"bool":case"boolean":return"undefined"!==(defaultValue=defaultValue.toLowerCase())&&""!==defaultValue&&"off"!==defaultValue&&"false"!==defaultValue&&"false"!==defaultValue||"on"===defaultValue||"true"===defaultValue||"true"===defaultValue;case"string":return""+defaultValue;case"object":return JSON.parse(atob(defaultValue))}throw new Error("type not supported");default:throw new Error("unknown command "+this.command)}return value}function pipe_typeof(obj){return(pipe_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function pipe_slicedToArray(arr,i){return function pipe_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function pipe_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function pipe_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return pipe_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pipe_arrayLikeToArray(o,minLen)}(arr,i)||function pipe_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pipe_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function pipe_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function pipe_setPrototypeOf(o,p){return(pipe_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function pipe_createSuper(Derived){var hasNativeReflectConstruct=function pipe_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=pipe_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=pipe_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return pipe_possibleConstructorReturn(this,result)}}function pipe_possibleConstructorReturn(self,call){if(call&&("object"===pipe_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function pipe_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function pipe_getPrototypeOf(o){return(pipe_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",Transformer);var Pipe=function(_Base){!function pipe_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&pipe_setPrototypeOf(subClass,superClass)}(Pipe,_Base);var _super=pipe_createSuper(Pipe);function Pipe(pipe){var _this;return function pipe_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Pipe),_this=_super.call(this),validateString(pipe),_this.pipe=pipe.split("|").map((function(v){return new Transformer(v)})),_this}return function pipe_createClass(Constructor,protoProps,staticProps){return protoProps&&pipe_defineProperties(Constructor.prototype,protoProps),staticProps&&pipe_defineProperties(Constructor,staticProps),Constructor}(Pipe,[{key:"setCallback",value:function setCallback(name,callback,context){for(var _i=0,_Object$entries=Object.entries(this.pipe);_i<_Object$entries.length;_i++){pipe_slicedToArray(_Object$entries[_i],2)[1].setCallback(name,callback,context)}return this}},{key:"run",value:function run(value){return this.pipe.reduce((function(accumulator,transformer,currentIndex,array){return transformer.run(accumulator)}),value)}}]),Pipe}(Base);function tokenlist_typeof(obj){return(tokenlist_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function tokenlist_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function tokenlist_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return tokenlist_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tokenlist_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function tokenlist_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function tokenlist_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function tokenlist_setPrototypeOf(o,p){return(tokenlist_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function tokenlist_createSuper(Derived){var hasNativeReflectConstruct=function tokenlist_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=tokenlist_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=tokenlist_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return tokenlist_possibleConstructorReturn(this,result)}}function tokenlist_possibleConstructorReturn(self,call){if(call&&("object"===tokenlist_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function tokenlist_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function tokenlist_getPrototypeOf(o){return(tokenlist_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",Pipe);var TokenList=function(_Base,_Symbol$iterator){!function tokenlist_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&tokenlist_setPrototypeOf(subClass,superClass)}(TokenList,_Base);var _super=tokenlist_createSuper(TokenList);function TokenList(init){var _this;return function tokenlist_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,TokenList),(_this=_super.call(this)).tokens=new Set,void 0!==init&&_this.add(init),_this}return function tokenlist_createClass(Constructor,protoProps,staticProps){return protoProps&&tokenlist_defineProperties(Constructor.prototype,protoProps),staticProps&&tokenlist_defineProperties(Constructor,staticProps),Constructor}(TokenList,[{key:"getIterator",value:function getIterator(){return this[Symbol.iterator]()}},{key:_Symbol$iterator,value:function value(){var index=0,entries=this.entries();return{next:function next(){return index<entries.length?{value:null==entries?void 0:entries[index++],done:!1}:{done:!0}}}}},{key:"contains",value:function contains(value){var _this2=this;if(isString(value)){value=value.trim();var counter=0;return value.split(" ").forEach((function(token){if(!1===_this2.tokens.has(token.trim()))return!1;counter++})),counter>0}if(isIterable(value)){var _step,_counter=0,_iterator=tokenlist_createForOfIteratorHelper(value);try{for(_iterator.s();!(_step=_iterator.n()).done;){var token=_step.value;if(validateString(token),!1===this.tokens.has(token.trim()))return!1;_counter++}}catch(err){_iterator.e(err)}finally{_iterator.f()}return _counter>0}return!1}},{key:"add",value:function add(value){var _this3=this;if(isString(value))value.split(" ").forEach((function(token){_this3.tokens.add(token.trim())}));else if(isIterable(value)){var _step2,_iterator2=tokenlist_createForOfIteratorHelper(value);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var token=_step2.value;validateString(token),this.tokens.add(token.trim())}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}else if(void 0!==value)throw new TypeError("unsupported value");return this}},{key:"clear",value:function clear(){return this.tokens.clear(),this}},{key:"remove",value:function remove(value){var _this4=this;if(isString(value))value.split(" ").forEach((function(token){_this4.tokens.delete(token.trim())}));else if(isIterable(value)){var _step3,_iterator3=tokenlist_createForOfIteratorHelper(value);try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var token=_step3.value;validateString(token),this.tokens.delete(token.trim())}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}else if(void 0!==value)throw new TypeError("unsupported value","types/tokenlist.js");return this}},{key:"replace",value:function replace(token,newToken){if(validateString(token),validateString(newToken),!this.contains(token))return this;var a=Array.from(this.tokens),i=a.indexOf(token);return-1===i||(a.splice(i,1,newToken),this.tokens=new Set,this.add(a)),this}},{key:"toggle",value:function toggle(value){var _this5=this;if(isString(value))value.split(" ").forEach((function(token){toggleValue.call(_this5,token)}));else if(isIterable(value)){var _step4,_iterator4=tokenlist_createForOfIteratorHelper(value);try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var token=_step4.value;toggleValue.call(this,token)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}else if(void 0!==value)throw new TypeError("unsupported value","types/tokenlist.js");return this}},{key:"entries",value:function entries(){return Array.from(this.tokens)}},{key:"forEach",value:function forEach(callback){return validateFunction(callback),this.tokens.forEach(callback),this}},{key:"toString",value:function toString(){return this.entries().join(" ")}}]),TokenList}(Base,Symbol.iterator);function toggleValue(token){if(!(this instanceof TokenList))throw Error("must be called with TokenList.call");return validateString(token),token=token.trim(),this.contains(token)?(this.remove(token),this):(this.add(token),this)}function queue_typeof(obj){return(queue_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function queue_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function queue_setPrototypeOf(o,p){return(queue_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function queue_createSuper(Derived){var hasNativeReflectConstruct=function queue_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=queue_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=queue_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return queue_possibleConstructorReturn(this,result)}}function queue_possibleConstructorReturn(self,call){if(call&&("object"===queue_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function queue_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function queue_getPrototypeOf(o){return(queue_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",TokenList);var Queue=function(_Base){!function queue_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&queue_setPrototypeOf(subClass,superClass)}(Queue,_Base);var _super=queue_createSuper(Queue);function Queue(){var _this;return function queue_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Queue),(_this=_super.call(this)).data=[],_this}return function queue_createClass(Constructor,protoProps,staticProps){return protoProps&&queue_defineProperties(Constructor.prototype,protoProps),staticProps&&queue_defineProperties(Constructor,staticProps),Constructor}(Queue,[{key:"isEmpty",value:function isEmpty(){return 0===this.data.length}},{key:"peek",value:function peek(){if(!this.isEmpty())return this.data[0]}},{key:"add",value:function add(value){return this.data.push(value),this}},{key:"clear",value:function clear(){return this.data=[],this}},{key:"poll",value:function poll(){if(!this.isEmpty())return this.data.shift()}}]),Queue}(Base);function uniquequeue_typeof(obj){return(uniquequeue_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function uniquequeue_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _get(target,property,receiver){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function _superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=uniquequeue_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function uniquequeue_setPrototypeOf(o,p){return(uniquequeue_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function uniquequeue_createSuper(Derived){var hasNativeReflectConstruct=function uniquequeue_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=uniquequeue_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=uniquequeue_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return uniquequeue_possibleConstructorReturn(this,result)}}function uniquequeue_possibleConstructorReturn(self,call){if(call&&("object"===uniquequeue_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function uniquequeue_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function uniquequeue_getPrototypeOf(o){return(uniquequeue_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Queue);var UniqueQueue=function(_Queue){!function uniquequeue_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&uniquequeue_setPrototypeOf(subClass,superClass)}(UniqueQueue,_Queue);var _super=uniquequeue_createSuper(UniqueQueue);function UniqueQueue(){var _this;return function uniquequeue_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UniqueQueue),(_this=_super.call(this)).unique=new WeakSet,_this}return function uniquequeue_createClass(Constructor,protoProps,staticProps){return protoProps&&uniquequeue_defineProperties(Constructor.prototype,protoProps),staticProps&&uniquequeue_defineProperties(Constructor,staticProps),Constructor}(UniqueQueue,[{key:"add",value:function add(value){return validateObject(value),this.unique.has(value)||(this.unique.add(value),_get(uniquequeue_getPrototypeOf(UniqueQueue.prototype),"add",this).call(this,value)),this}},{key:"clear",value:function clear(){return _get(uniquequeue_getPrototypeOf(UniqueQueue.prototype),"clear",this).call(this),this.unique=new WeakSet,this}},{key:"poll",value:function poll(){if(!this.isEmpty()){var value=this.data.shift();return this.unique.delete(value),value}}}]),UniqueQueue}(Queue);function observer_typeof(obj){return(observer_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function observer_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function observer_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function observer_setPrototypeOf(o,p){return(observer_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function observer_createSuper(Derived){var hasNativeReflectConstruct=function observer_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=observer_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=observer_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return observer_possibleConstructorReturn(this,result)}}function observer_possibleConstructorReturn(self,call){if(call&&("object"===observer_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function observer_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function observer_getPrototypeOf(o){return(observer_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",UniqueQueue);var Observer=function(_Base){!function observer_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&observer_setPrototypeOf(subClass,superClass)}(Observer,_Base);var _super=observer_createSuper(Observer);function Observer(callback){var _this;if(observer_classCallCheck(this,Observer),_this=_super.call(this),"function"!=typeof callback)throw new Error("observer callback must be a function");_this.callback=callback;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return _this.arguments=args,_this.tags=new TokenList,_this.queue=new UniqueQueue,_this}return function observer_createClass(Constructor,protoProps,staticProps){return protoProps&&observer_defineProperties(Constructor.prototype,protoProps),staticProps&&observer_defineProperties(Constructor,staticProps),Constructor}(Observer,[{key:"addTag",value:function addTag(tag){return this.tags.add(tag),this}},{key:"removeTag",value:function removeTag(tag){return this.tags.remove(tag),this}},{key:"getTags",value:function getTags(){return this.tags.entries()}},{key:"hasTag",value:function hasTag(tag){return this.tags.contains(tag)}},{key:"update",value:function update(subject){var self=this;return new Promise((function(resolve,reject){isObject(subject)?(self.queue.add(subject),setTimeout((function(){try{if(self.queue.isEmpty())return void resolve();var s=self.queue.poll(),result=self.callback.apply(s,self.arguments);if(isObject(result)&&result instanceof Promise)return void result.then(resolve).catch(reject);resolve(result)}catch(e){reject(e)}}),0)):reject("subject must be an object")}))}}]),Observer}(Base);function observerlist_typeof(obj){return(observerlist_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function observerlist_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function observerlist_setPrototypeOf(o,p){return(observerlist_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function observerlist_createSuper(Derived){var hasNativeReflectConstruct=function observerlist_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=observerlist_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=observerlist_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return observerlist_possibleConstructorReturn(this,result)}}function observerlist_possibleConstructorReturn(self,call){if(call&&("object"===observerlist_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function observerlist_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function observerlist_getPrototypeOf(o){return(observerlist_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Observer);var ObserverList=function(_Base){!function observerlist_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&observerlist_setPrototypeOf(subClass,superClass)}(ObserverList,_Base);var _super=observerlist_createSuper(ObserverList);function ObserverList(){var _this;return function observerlist_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ObserverList),(_this=_super.call(this)).observers=[],_this}return function observerlist_createClass(Constructor,protoProps,staticProps){return protoProps&&observerlist_defineProperties(Constructor.prototype,protoProps),staticProps&&observerlist_defineProperties(Constructor,staticProps),Constructor}(ObserverList,[{key:"attach",value:function attach(observer){return validateInstance(observer,Observer),this.observers.push(observer),this}},{key:"detach",value:function detach(observer){validateInstance(observer,Observer);for(var i=0,l=this.observers.length;i<l;i++)this.observers[i]===observer&&this.observers.splice(i,1);return this}},{key:"contains",value:function contains(observer){validateInstance(observer,Observer);for(var i=0,l=this.observers.length;i<l;i++)if(this.observers[i]===observer)return!0;return!1}},{key:"notify",value:function notify(subject){for(var pomises=[],i=0,l=this.observers.length;i<l;i++)pomises.push(this.observers[i].update(subject));return Promise.all(pomises)}}]),ObserverList}(Base);function proxyobserver_typeof(obj){return(proxyobserver_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function proxyobserver_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function proxyobserver_setPrototypeOf(o,p){return(proxyobserver_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function proxyobserver_createSuper(Derived){var hasNativeReflectConstruct=function proxyobserver_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=proxyobserver_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=proxyobserver_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return proxyobserver_possibleConstructorReturn(this,result)}}function proxyobserver_possibleConstructorReturn(self,call){if(call&&("object"===proxyobserver_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return proxyobserver_assertThisInitialized(self)}function proxyobserver_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function proxyobserver_getPrototypeOf(o){return(proxyobserver_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",ObserverList);var ProxyObserver=function(_Base){!function proxyobserver_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&proxyobserver_setPrototypeOf(subClass,superClass)}(ProxyObserver,_Base);var _super=proxyobserver_createSuper(ProxyObserver);function ProxyObserver(object){var _this;return function proxyobserver_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ProxyObserver),(_this=_super.call(this)).realSubject=validateObject(object),_this.subject=new Proxy(object,getHandler.call(proxyobserver_assertThisInitialized(_this))),_this.objectMap=new WeakMap,_this.objectMap.set(_this.realSubject,_this.subject),_this.proxyMap=new WeakMap,_this.proxyMap.set(_this.subject,_this.realSubject),_this.observers=new ObserverList,_this}return function proxyobserver_createClass(Constructor,protoProps,staticProps){return protoProps&&proxyobserver_defineProperties(Constructor.prototype,protoProps),staticProps&&proxyobserver_defineProperties(Constructor,staticProps),Constructor}(ProxyObserver,[{key:"getSubject",value:function getSubject(){return this.subject}},{key:"setSubject",value:function setSubject(obj){var i,k=Object.keys(this.subject);for(i=0;i<k.length;i++)delete this.subject[k[i]];return this.subject=extend(this.subject,obj),this}},{key:"getRealSubject",value:function getRealSubject(){return this.realSubject}},{key:"attachObserver",value:function attachObserver(observer){return this.observers.attach(observer),this}},{key:"detachObserver",value:function detachObserver(observer){return this.observers.detach(observer),this}},{key:"notifyObservers",value:function notifyObservers(){return this.observers.notify(this)}},{key:"containsObserver",value:function containsObserver(observer){return this.observers.contains(observer)}}]),ProxyObserver}(Base);function getHandler(){var proxy=this,handler={get:function get(target,key,receiver){var value=Reflect.get(target,key,receiver);if("symbol"===proxyobserver_typeof(key))return value;if(isPrimitive(value))return value;if(isArray(value)||isObject(value)){if(proxy.objectMap.has(value))return proxy.objectMap.get(value);if(proxy.proxyMap.has(value))return value;var p=new Proxy(value,handler);return proxy.objectMap.set(value,p),proxy.proxyMap.set(p,value),p}return value},set:function set(target,key,value,receiver){proxy.proxyMap.has(value)&&(value=proxy.proxyMap.get(value)),proxy.proxyMap.has(target)&&(target=proxy.proxyMap.get(target));var result,current=Reflect.get(target,key,receiver);if(proxy.proxyMap.has(current)&&(current=proxy.proxyMap.get(current)),current===value)return!0;var descriptor=Reflect.getOwnPropertyDescriptor(target,key);return void 0===descriptor&&(descriptor={writable:!0,enumerable:!0,configurable:!0}),descriptor.value=value,result=Reflect.defineProperty(target,key,descriptor),"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result},deleteProperty:function deleteProperty(target,key){return key in target&&(delete target[key],"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),!0)},defineProperty:function defineProperty(target,key,descriptor){var result=Reflect.defineProperty(target,key,descriptor);return"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result},setPrototypeOf:function setPrototypeOf(target,key){var result=Reflect.setPrototypeOf(object1,key);return"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result}};return handler}function assembler_typeof(obj){return(assembler_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function assembler_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function assembler_setPrototypeOf(o,p){return(assembler_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function assembler_createSuper(Derived){var hasNativeReflectConstruct=function assembler_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=assembler_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=assembler_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return assembler_possibleConstructorReturn(this,result)}}function assembler_possibleConstructorReturn(self,call){if(call&&("object"===assembler_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function assembler_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function assembler_getPrototypeOf(o){return(assembler_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",ProxyObserver);assignToNamespace("Monster.DOM",function(_Base){!function assembler_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&assembler_setPrototypeOf(subClass,superClass)}(Assembler,_Base);var _super=assembler_createSuper(Assembler);function Assembler(fragment){var _this;return function assembler_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Assembler),(_this=_super.call(this)).attributePrefix="data-monster-",validateInstance(fragment,getGlobalFunction("DocumentFragment")),_this.fragment=fragment,_this}return function assembler_createClass(Constructor,protoProps,staticProps){return protoProps&&assembler_defineProperties(Constructor.prototype,protoProps),staticProps&&assembler_defineProperties(Constructor,staticProps),Constructor}(Assembler,[{key:"setAttributePrefix",value:function setAttributePrefix(prefix){return validateString(prefix),this.attributePrefix=prefix,this}},{key:"getAttributePrefix",value:function getAttributePrefix(){return this.attributePrefix}},{key:"createDocumentFragment",value:function createDocumentFragment(data){return void 0===data&&(data=new ProxyObserver({})),validateInstance(data,ProxyObserver),this.fragment.cloneNode(!0)}}]),Assembler}(Base));var objectUpdaterLinkSymbol=Symbol("monsterUpdater");function addToObjectLink(element,symbol,object){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol])&&(element[symbol]=new Set),addAttributeToken(element,"data-monster-objectlink",symbol.toString()),element[symbol].add(object),element}function hasObjectLink(element,symbol){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0!==(null==element?void 0:element[symbol])&&containsAttributeToken(element,"data-monster-objectlink",symbol.toString())}function getLinkedObjects(element,symbol){if(validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol]))throw new Error("there is no object link for "+symbol.toString());return null==element?void 0:element[symbol][Symbol.iterator]()}function addAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).add(token).toString()),element):(element.setAttribute(key,token),element)}function removeAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).remove(token).toString()),element):element}function containsAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),!!element.hasAttribute(key)&&new TokenList(element.getAttribute(key)).contains(token)}function findClosestByAttribute(element,key,value){if(validateInstance(element,getGlobalFunction("HTMLElement")),element.hasAttribute(key)){if(void 0===value)return element;if(element.getAttribute(key)===value)return element}var selector=validateString(key);void 0!==value&&(selector+="="+validateString(value));var result=element.closest("["+selector+"]");if(result instanceof HTMLElement)return result}function mediatype_typeof(obj){return(mediatype_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function mediatype_wrapRegExp(){mediatype_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),mediatype_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return mediatype_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==mediatype_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},mediatype_wrapRegExp.apply(this,arguments)}function mediatype_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function mediatype_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return mediatype_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mediatype_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function mediatype_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function mediatype_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function mediatype_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&mediatype_setPrototypeOf(subClass,superClass)}function mediatype_setPrototypeOf(o,p){return(mediatype_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function mediatype_createSuper(Derived){var hasNativeReflectConstruct=function mediatype_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=mediatype_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=mediatype_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return mediatype_possibleConstructorReturn(this,result)}}function mediatype_possibleConstructorReturn(self,call){if(call&&("object"===mediatype_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function mediatype_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function mediatype_getPrototypeOf(o){return(mediatype_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",(function findClosestByClass(element,className){var _element$classList;if(validateInstance(element,getGlobalFunction("HTMLElement")),null!=element&&null!==(_element$classList=element.classList)&&void 0!==_element$classList&&_element$classList.contains(validateString(className)))return element;var result=element.closest("."+className);return result instanceof HTMLElement?result:void 0}),getLinkedObjects,addToObjectLink,(function removeObjectLink(element,symbol){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol])||(removeAttributeToken(element,"data-monster-objectlink",symbol.toString()),delete element[symbol]),element}),findClosestByAttribute,hasObjectLink,(function clearAttributeTokens(element,key){return validateInstance(element,HTMLElement),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,""),element):element}),(function replaceAttributeToken(element,key,from,to){return validateInstance(element,HTMLElement),validateString(from),validateString(to),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).replace(from,to).toString()),element):element}),containsAttributeToken,removeAttributeToken,addAttributeToken,(function toggleAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).toggle(token).toString()),element):(element.setAttribute(key,token),element)}));var internal=Symbol("internal"),MediaType=function(_Base){mediatype_inherits(MediaType,_Base);var _super=mediatype_createSuper(MediaType);function MediaType(type,subtype,parameter){var _this;return function mediatype_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,MediaType),(_this=_super.call(this))[internal]={type:validateString(type).toLowerCase(),subtype:validateString(subtype).toLowerCase(),parameter:[]},void 0!==parameter&&(_this[internal].parameter=validateArray(parameter)),_this}return function mediatype_createClass(Constructor,protoProps,staticProps){return protoProps&&mediatype_defineProperties(Constructor.prototype,protoProps),staticProps&&mediatype_defineProperties(Constructor,staticProps),Constructor}(MediaType,[{key:"type",get:function get(){return this[internal].type}},{key:"subtype",get:function get(){return this[internal].subtype}},{key:"parameter",get:function get(){var result=new Map;return this[internal].parameter.forEach((function(p){var value=p.value;value.startsWith('"')&&value.endsWith('"')&&(value=value.substring(1,value.length-1)),result.set(p.key,value)})),result}},{key:"toString",value:function toString(){var _step,parameter=[],_iterator=mediatype_createForOfIteratorHelper(this[internal].parameter);try{for(_iterator.s();!(_step=_iterator.n()).done;){var a=_step.value;parameter.push(a.key+"="+a.value)}}catch(err){_iterator.e(err)}finally{_iterator.f()}return this[internal].type+"/"+this[internal].subtype+(parameter.length>0?";"+parameter.join(";"):"")}}]),MediaType}(Base);function parseMediaType(mediatype){var result=mediatype_wrapRegExp(/([A-Za-z]+|\*)\/(([a-zA-Z0-9.\+_\-]+)|\*|)(\s*;\s*([a-zA-Z0-9]+)\s*(=\s*("?[A-Za-z0-9_\-]+"?))?)*/g,{type:1,subtype:2,parameter:4}).exec(validateString(mediatype)),groups=null==result?void 0:result.groups;if(void 0===groups)throw new TypeError("the mimetype can not be parsed");var type=null==groups?void 0:groups.type,subtype=null==groups?void 0:groups.subtype,parameter=null==groups?void 0:groups.parameter;if(""===subtype||""===type)throw new TypeError("blank value is not allowed");return new MediaType(type,subtype,function parseParameter(parameter){if(!isString(parameter))return;var result=[];return parameter.split(";").forEach((function(entry){if(""!==(entry=entry.trim())){var kv=entry.split("="),key=validateString(null==kv?void 0:kv[0]).trim(),value=validateString(null==kv?void 0:kv[1]).trim();result.push({key:key,value:value})}})),result}(parameter))}function dataurl_typeof(obj){return(dataurl_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function dataurl_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function dataurl_setPrototypeOf(o,p){return(dataurl_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function dataurl_createSuper(Derived){var hasNativeReflectConstruct=function dataurl_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=dataurl_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=dataurl_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return dataurl_possibleConstructorReturn(this,result)}}function dataurl_possibleConstructorReturn(self,call){if(call&&("object"===dataurl_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function dataurl_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function dataurl_getPrototypeOf(o){return(dataurl_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",parseMediaType,MediaType);var dataurl_internal=Symbol("internal"),DataUrl=function(_Base){!function dataurl_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&dataurl_setPrototypeOf(subClass,superClass)}(DataUrl,_Base);var _super=dataurl_createSuper(DataUrl);function DataUrl(content,mediatype,base64){var _this;return function dataurl_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,DataUrl),_this=_super.call(this),isString(mediatype)&&(mediatype=parseMediaType(mediatype)),_this[dataurl_internal]={content:validateString(content),mediatype:validateInstance(mediatype,MediaType),base64:validateBoolean(void 0===base64||base64)},_this}return function dataurl_createClass(Constructor,protoProps,staticProps){return protoProps&&dataurl_defineProperties(Constructor.prototype,protoProps),staticProps&&dataurl_defineProperties(Constructor,staticProps),Constructor}(DataUrl,[{key:"content",get:function get(){return this[dataurl_internal].base64?atob(this[dataurl_internal].content):this[dataurl_internal].content}},{key:"mediatype",get:function get(){return this[dataurl_internal].mediatype}},{key:"toString",value:function toString(){var content=this[dataurl_internal].content;return content=!0===this[dataurl_internal].base64?";base64,"+content:","+encodeURIComponent(content),"data:"+this[dataurl_internal].mediatype.toString()+content}}]),DataUrl}(Base);function parseDataURL(dataurl){if(validateString(dataurl),"data:"!==(dataurl=dataurl.trim()).substring(0,5))throw new TypeError("incorrect or missing data protocol");var p=(dataurl=dataurl.substring(5)).indexOf(",");if(-1===p)throw new TypeError("malformed data url");var content=dataurl.substring(p+1),mediatypeAndBase64=dataurl.substring(0,p).trim(),mediatype="text/plain;charset=US-ASCII",base64Flag=!1;if(""!==mediatypeAndBase64){if(mediatype=mediatypeAndBase64,mediatypeAndBase64.endsWith("base64")){var i=mediatypeAndBase64.lastIndexOf(";");mediatype=mediatypeAndBase64.substring(0,i),base64Flag=!0}else content=decodeURIComponent(content);mediatype=parseMediaType(mediatype)}else content=decodeURIComponent(content);return new DataUrl(content,mediatype,base64Flag)}function theme_typeof(obj){return(theme_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function theme_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function theme_setPrototypeOf(o,p){return(theme_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function theme_createSuper(Derived){var hasNativeReflectConstruct=function theme_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=theme_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=theme_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return theme_possibleConstructorReturn(this,result)}}function theme_possibleConstructorReturn(self,call){if(call&&("object"===theme_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function theme_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function theme_getPrototypeOf(o){return(theme_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",parseDataURL,DataUrl);var Theme=function(_Base){!function theme_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&theme_setPrototypeOf(subClass,superClass)}(Theme,_Base);var _super=theme_createSuper(Theme);function Theme(name){var _this;return function theme_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Theme),_this=_super.call(this),validateString(name),_this.name=name,_this}return function theme_createClass(Constructor,protoProps,staticProps){return protoProps&&theme_defineProperties(Constructor.prototype,protoProps),staticProps&&theme_defineProperties(Constructor,staticProps),Constructor}(Theme,[{key:"getName",value:function getName(){return this.name}}]),Theme}(Base);function getDocumentTheme(){var name="monster",element=getGlobalObject("document").querySelector("html");if(element instanceof HTMLElement){var theme=element.getAttribute("data-monster-theme-name");theme&&(name=theme)}return new Theme(name)}function template_typeof(obj){return(template_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function template_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function template_setPrototypeOf(o,p){return(template_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function template_createSuper(Derived){var hasNativeReflectConstruct=function template_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=template_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=template_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return template_possibleConstructorReturn(this,result)}}function template_possibleConstructorReturn(self,call){if(call&&("object"===template_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function template_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function template_getPrototypeOf(o){return(template_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Theme,getDocumentTheme);var Template=function(_Base){!function template_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&template_setPrototypeOf(subClass,superClass)}(Template,_Base);var _super=template_createSuper(Template);function Template(template){var _this;return function template_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Template),_this=_super.call(this),validateInstance(template,getGlobalFunction("HTMLTemplateElement")),_this.template=template,_this}return function template_createClass(Constructor,protoProps,staticProps){return protoProps&&template_defineProperties(Constructor.prototype,protoProps),staticProps&&template_defineProperties(Constructor,staticProps),Constructor}(Template,[{key:"getTemplateElement",value:function getTemplateElement(){return this.template}},{key:"createDocumentFragment",value:function createDocumentFragment(){return this.template.content.cloneNode(!0)}}]),Template}(Base);function findDocumentTemplate(id,currentNode){validateString(id);var prefixID,template,document=getGlobalObject("document"),HTMLTemplateElement=getGlobalFunction("HTMLTemplateElement"),DocumentFragment=getGlobalFunction("DocumentFragment"),Document=getGlobalFunction("Document");currentNode instanceof Document||currentNode instanceof DocumentFragment||(currentNode instanceof Node&&(currentNode.hasAttribute("data-monster-template-prefix")&&(prefixID=currentNode.getAttribute("data-monster-template-prefix")),(currentNode=currentNode.getRootNode())instanceof Document||currentNode instanceof DocumentFragment||(currentNode=currentNode.ownerDocument)),currentNode instanceof Document||currentNode instanceof DocumentFragment||(currentNode=document));var theme=getDocumentTheme();if(prefixID){var themedPrefixID=prefixID+"-"+id+"-"+theme.getName();if((template=currentNode.getElementById(themedPrefixID))instanceof HTMLTemplateElement)return new Template(template);if((template=document.getElementById(themedPrefixID))instanceof HTMLTemplateElement)return new Template(template)}var themedID=id+"-"+theme.getName();if((template=currentNode.getElementById(themedID))instanceof HTMLTemplateElement)return new Template(template);if((template=document.getElementById(themedID))instanceof HTMLTemplateElement)return new Template(template);if((template=currentNode.getElementById(id))instanceof HTMLTemplateElement)return new Template(template);if((template=document.getElementById(id))instanceof HTMLTemplateElement)return new Template(template);throw new Error("template "+id+" not found.")}function trimspaces_typeof(obj){return(trimspaces_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function trimspaces_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function trimspaces_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return trimspaces_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return trimspaces_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function trimspaces_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function trimspaces_wrapRegExp(){trimspaces_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),trimspaces_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return trimspaces_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==trimspaces_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},trimspaces_wrapRegExp.apply(this,arguments)}function trimspaces_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&trimspaces_setPrototypeOf(subClass,superClass)}function trimspaces_setPrototypeOf(o,p){return(trimspaces_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function trimSpaces(value){validateString(value);var _step,placeholder=new Map,regex=trimspaces_wrapRegExp(/((\\(.)){1})/gim,{pattern:2,char:3}),_iterator=trimspaces_createForOfIteratorHelper(value.matchAll(regex));try{for(_iterator.s();!(_step=_iterator.n()).done;){var m=_step.value,g=null==m?void 0:m.groups;if(isObject(g)){var p=null==g?void 0:g.pattern,c=null==g?void 0:g.char;if(p&&c){var r="__"+(new ID).toString()+"__";placeholder.set(r,c),value=value.replace(p,r)}}}}catch(err){_iterator.e(err)}finally{_iterator.f()}return value=value.trim(),placeholder.forEach((function(v,k){value=value.replace(k,"\\"+v)})),value}function util_typeof(obj){return(util_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function getDocument(){var _getGlobal,document=null===(_getGlobal=getGlobal())||void 0===_getGlobal?void 0:_getGlobal.document;if("object"!==util_typeof(document))throw new Error("not supported environment");return document}function events_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function events_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return events_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return events_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function events_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function findTargetElementFromEvent(event,attributeName,attributeValue){if(validateInstance(event,Event),"function"!=typeof event.composedPath)throw new Error("unsupported event");var path=event.composedPath();if(isArray(path))for(var i=0;i<path.length;i++){var o=path[i];if(o instanceof HTMLElement&&o.hasAttribute(attributeName)&&(void 0===attributeValue||o.getAttribute(attributeName)===attributeValue))return o}}function updater_typeof(obj){return(updater_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function updater_toConsumableArray(arr){return function updater_arrayWithoutHoles(arr){if(Array.isArray(arr))return updater_arrayLikeToArray(arr)}(arr)||function updater_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||updater_unsupportedIterableToArray(arr)||function updater_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function updater_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=updater_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function updater_slicedToArray(arr,i){return function updater_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function updater_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||updater_unsupportedIterableToArray(arr,i)||function updater_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function updater_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return updater_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?updater_arrayLikeToArray(o,minLen):void 0}}function updater_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function updater_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function updater_setPrototypeOf(o,p){return(updater_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function updater_createSuper(Derived){var hasNativeReflectConstruct=function updater_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=updater_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=updater_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return updater_possibleConstructorReturn(this,result)}}function updater_possibleConstructorReturn(self,call){if(call&&("object"===updater_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return updater_assertThisInitialized(self)}function updater_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function updater_getPrototypeOf(o){return(updater_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Template,findDocumentTemplate),assignToNamespace("Monster.Util",trimSpaces),assignToNamespace("Monster.DOM",(function getWindow(){var _getGlobal2,window=null===(_getGlobal2=getGlobal())||void 0===_getGlobal2?void 0:_getGlobal2.window;if("object"!==util_typeof(window))throw new Error("not supported environment");return window}),getDocument,(function getDocumentFragmentFromString(html){validateString(html);var template=getDocument().createElement("template");return template.innerHTML=html,template.content})),assignToNamespace("Monster.DOM",findTargetElementFromEvent,(function fireEvent(element,type){if(getDocument(),element instanceof HTMLElement){if("click"===type)return void element.click();var event=new Event(validateString(type),{bubbles:!0,cancelable:!0});element.dispatchEvent(event)}else{if(!(element instanceof HTMLCollection||element instanceof NodeList))throw new TypeError("value is not an instance of HTMLElement or HTMLCollection");var _step,_iterator=events_createForOfIteratorHelper(element);try{for(_iterator.s();!(_step=_iterator.n()).done;){fireEvent(_step.value,type)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}}),(function fireCustomEvent(element,type,detail){if(getDocument(),element instanceof HTMLElement){isObject(detail)||(detail={detail:detail});var event=new CustomEvent(validateString(type),{bubbles:!0,cancelable:!0,detail:detail});element.dispatchEvent(event)}else{if(!(element instanceof HTMLCollection||element instanceof NodeList))throw new TypeError("value is not an instance of HTMLElement or HTMLCollection");var _step2,_iterator2=events_createForOfIteratorHelper(element);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){fireCustomEvent(_step2.value,type,detail)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}}));var Updater=function(_Base){!function updater_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&updater_setPrototypeOf(subClass,superClass)}(Updater,_Base);var _super=updater_createSuper(Updater);function Updater(element,subject){var _this;return function updater_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Updater),_this=_super.call(this),void 0===subject&&(subject={}),isInstance(subject,ProxyObserver)||(subject=new ProxyObserver(subject)),_this[internalSymbol]={element:validateInstance(element,HTMLElement),last:{},callbacks:new Map,eventTypes:["keyup","click","change","drop","touchend","input"],subject:subject},_this[internalSymbol].callbacks.set("checkstate",getCheckStateCallback.call(updater_assertThisInitialized(_this))),_this[internalSymbol].subject.attachObserver(new Observer((function(){var s=_this[internalSymbol].subject.getRealSubject(),diffResult=diff(_this[internalSymbol].last,s);_this[internalSymbol].last=clone(s);for(var _i=0,_Object$entries=Object.entries(diffResult);_i<_Object$entries.length;_i++){var change=updater_slicedToArray(_Object$entries[_i],2)[1];removeElement.call(updater_assertThisInitialized(_this),change),insertElement.call(updater_assertThisInitialized(_this),change),updateContent.call(updater_assertThisInitialized(_this),change),updateAttributes.call(updater_assertThisInitialized(_this),change)}}))),_this}return function updater_createClass(Constructor,protoProps,staticProps){return protoProps&&updater_defineProperties(Constructor.prototype,protoProps),staticProps&&updater_defineProperties(Constructor,staticProps),Constructor}(Updater,[{key:"setEventTypes",value:function setEventTypes(types){return this[internalSymbol].eventTypes=validateArray(types),this}},{key:"enableEventProcessing",value:function enableEventProcessing(){this.disableEventProcessing();var _step,_iterator=updater_createForOfIteratorHelper(this[internalSymbol].eventTypes);try{for(_iterator.s();!(_step=_iterator.n()).done;){var type=_step.value;this[internalSymbol].element.addEventListener(type,getControlEventHandler.call(this),{capture:!0,passive:!0})}}catch(err){_iterator.e(err)}finally{_iterator.f()}return this}},{key:"disableEventProcessing",value:function disableEventProcessing(){var _step2,_iterator2=updater_createForOfIteratorHelper(this[internalSymbol].eventTypes);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var type=_step2.value;this[internalSymbol].element.removeEventListener(type,getControlEventHandler.call(this))}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return this}},{key:"run",value:function run(){return this[internalSymbol].last={__init__:!0},this[internalSymbol].subject.notifyObservers()}},{key:"retrieve",value:function retrieve(){return retrieveFromBindings.call(this),this}},{key:"getSubject",value:function getSubject(){return this[internalSymbol].subject.getSubject()}},{key:"setCallback",value:function setCallback(name,callback){return this[internalSymbol].callbacks.set(name,callback),this}}]),Updater}(Base);function getCheckStateCallback(){return function(current){if(this instanceof HTMLInputElement){if(-1!==["radio","checkbox"].indexOf(this.type))return this.value+""==current+""?"true":void 0}else if(this instanceof HTMLOptionElement)return isArray(current)&&-1!==current.indexOf(this.value)?"true":void 0}}var symbol=Symbol("EventHandler");function getControlEventHandler(){var self=this;return self[symbol]||(self[symbol]=function(event){var element=findTargetElementFromEvent(event,"data-monster-bind");void 0!==element&&retrieveAndSetValue.call(self,element)}),self[symbol]}function retrieveAndSetValue(element){var _element$constructor,_Object$getOwnPropert,value,pathfinder=new Pathfinder(this[internalSymbol].subject.getSubject()),path=element.getAttribute("data-monster-bind");if(0!==path.indexOf("path:"))throw new Error("the bind argument must start as a value with a path");if(path=path.substr(5),element instanceof HTMLInputElement)switch(element.type){case"checkbox":value=element.checked?element.value:void 0;break;default:value=element.value}else if(element instanceof HTMLTextAreaElement)value=element.value;else if(element instanceof HTMLSelectElement)switch(element.type){case"select-one":value=element.value;break;case"select-multiple":value=element.value;var options=null==element?void 0:element.selectedOptions;void 0===options&&(options=element.querySelectorAll(":scope option:checked")),value=Array.from(options).map((function(_ref){return _ref.value}))}else{if(!(null!=element&&null!==(_element$constructor=element.constructor)&&void 0!==_element$constructor&&_element$constructor.prototype&&null!==(_Object$getOwnPropert=Object.getOwnPropertyDescriptor(element.constructor.prototype,"value"))&&void 0!==_Object$getOwnPropert&&_Object$getOwnPropert.get||element.hasOwnProperty("value")))throw new Error("unsupported object");value=null==element?void 0:element.value}var copy=clone(this[internalSymbol].subject.getRealSubject());new Pathfinder(copy).setVia(path,value),diff(copy,this[internalSymbol].subject.getRealSubject()).length>0&&pathfinder.setVia(path,value)}function retrieveFromBindings(){this[internalSymbol].element.matches("[data-monster-bind]")&&retrieveAndSetValue.call(this,element);var _step3,_iterator3=updater_createForOfIteratorHelper(this[internalSymbol].element.querySelectorAll("[data-monster-bind]").entries());try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _element=updater_slicedToArray(_step3.value,2)[1];retrieveAndSetValue.call(this,_element)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}function removeElement(change){var _step4,_iterator4=updater_createForOfIteratorHelper(this[internalSymbol].element.querySelectorAll(":scope [data-monster-remove]").entries());try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _element2=updater_slicedToArray(_step4.value,2)[1];_element2.parentNode.removeChild(_element2)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}function insertElement(change){for(var self=this,subject=self[internalSymbol].subject.getRealSubject(),mem=(getDocument(),new WeakSet),wd=0,container=self[internalSymbol].element;;){var found=!1;wd++;var p=clone(null==change?void 0:change.path);if(!isArray(p))return self;for(;p.length>0;){var current=p.join("."),iterator=new Set,query='[data-monster-insert*="path:'+current+'"]',e=container.querySelectorAll(query);e.length>0&&(iterator=new Set(updater_toConsumableArray(e))),container.matches(query)&&iterator.add(container);var _step5,_iterator5=updater_createForOfIteratorHelper(iterator.entries());try{var _loop=function _loop(){var containerElement=updater_slicedToArray(_step5.value,2)[1];if(mem.has(containerElement))return"continue";mem.add(containerElement),found=!0;var def=trimSpaces(containerElement.getAttribute("data-monster-insert")),i=def.indexOf(" "),key=trimSpaces(def.substr(0,i)),refPrefix=key+"-",cmd=trimSpaces(def.substr(i));if(cmd.indexOf("|")>0)throw new Error("pipes are not allowed when cloning a node.");var pipe=new Pipe(cmd);self[internalSymbol].callbacks.forEach((function(f,n){pipe.setCallback(n,f)}));var value=void 0;try{containerElement.removeAttribute("data-monster-error"),value=pipe.run(subject)}catch(e){containerElement.setAttribute("data-monster-error",e.message)}var dataPath=cmd.split(":").pop();if(containerElement.hasChildNodes()&&containerElement.lastChild,!isIterable(value))throw new Error("the value is not iterable");for(var available=new Set,_i2=0,_Object$entries2=Object.entries(value);_i2<_Object$entries2.length;_i2++){var _Object$entries2$_i=updater_slicedToArray(_Object$entries2[_i2],2),_i3=_Object$entries2$_i[0],ref=(_Object$entries2$_i[1],refPrefix+_i3),currentPath=dataPath+"."+_i3;available.add(ref);var refElement=containerElement.querySelector('[data-monster-insert-reference="'+ref+'"]');refElement instanceof HTMLElement?refElement:appendNewDocumentFragment(containerElement,key,ref,currentPath)}for(var nodes=containerElement.querySelectorAll('[data-monster-insert-reference*="'+refPrefix+'"]'),_i4=0,_Object$entries3=Object.entries(nodes);_i4<_Object$entries3.length;_i4++){var node=updater_slicedToArray(_Object$entries3[_i4],2)[1];if(!available.has(node.getAttribute("data-monster-insert-reference")))try{containerElement.removeChild(node)}catch(e){containerElement.setAttribute("data-monster-error",(containerElement.getAttribute("data-monster-error")+", "+e.message).trim())}}};for(_iterator5.s();!(_step5=_iterator5.n()).done;)_loop()}catch(err){_iterator5.e(err)}finally{_iterator5.f()}p.pop()}if(!1===found)break;if(wd++>200)throw new Error("the maximum depth for the recursion is reached.")}}function appendNewDocumentFragment(container,key,ref,path){for(var nodes=findDocumentTemplate(key,container).createDocumentFragment(),_i5=0,_Object$entries4=Object.entries(nodes.childNodes);_i5<_Object$entries4.length;_i5++){var node=updater_slicedToArray(_Object$entries4[_i5],2)[1];node instanceof HTMLElement&&(applyRecursive(node,key,path),node.setAttribute("data-monster-insert-reference",ref)),container.appendChild(node)}}function applyRecursive(node,key,path){if(node instanceof HTMLElement){if(node.hasAttribute("data-monster-replace")){var value=node.getAttribute("data-monster-replace");node.setAttribute("data-monster-replace",value.replaceAll("path:"+key,"path:"+path))}if(node.hasAttribute("data-monster-attributes")){var _value=node.getAttribute("data-monster-attributes");node.setAttribute("data-monster-attributes",_value.replaceAll("path:"+key,"path:"+path))}for(var _i6=0,_Object$entries5=Object.entries(node.childNodes);_i6<_Object$entries5.length;_i6++){applyRecursive(updater_slicedToArray(_Object$entries5[_i6],2)[1],key,path)}}}function updateContent(change){var subject=this[internalSymbol].subject.getRealSubject(),p=clone(null==change?void 0:change.path);runUpdateContent.call(this,this[internalSymbol].element,p,subject);var slots=this[internalSymbol].element.querySelectorAll("slot");if(slots.length>0)for(var _i7=0,_Object$entries6=Object.entries(slots);_i7<_Object$entries6.length;_i7++)for(var slot=updater_slicedToArray(_Object$entries6[_i7],2)[1],_i8=0,_Object$entries7=Object.entries(slot.assignedNodes());_i8<_Object$entries7.length;_i8++){var _element3=updater_slicedToArray(_Object$entries7[_i8],2)[1];runUpdateContent.call(this,_element3,p,subject)}}function runUpdateContent(container,parts,subject){var _this2=this;if(isArray(parts)&&container instanceof HTMLElement){parts=clone(parts);for(var mem=new WeakSet;parts.length>0;){var current=parts.join(".");parts.pop();var query='[data-monster-replace^="path:'+current+'"], [data-monster-replace^="static:"]',e=container.querySelectorAll(""+query),iterator=new Set(updater_toConsumableArray(e));container.matches(query)&&iterator.add(container);var _step6,_iterator6=updater_createForOfIteratorHelper(iterator.entries());try{var _loop2=function _loop2(){var element=updater_slicedToArray(_step6.value,1)[0];if(mem.has(element))return{v:void 0};mem.add(element);var cmd=trimSpaces(element.getAttribute("data-monster-replace")),pipe=new Pipe(cmd);_this2[internalSymbol].callbacks.forEach((function(f,n){pipe.setCallback(n,f)}));var value=void 0;try{element.removeAttribute("data-monster-error"),value=pipe.run(subject)}catch(e){element.setAttribute("data-monster-error",e.message)}if(value instanceof HTMLElement){for(;element.firstChild;)element.removeChild(element.firstChild);try{element.appendChild(value)}catch(e){element.setAttribute("data-monster-error",(element.getAttribute("data-monster-error")+", "+e.message).trim())}}else element.innerHTML=value};for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _ret2=_loop2();if("object"===updater_typeof(_ret2))return _ret2.v}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}}}}function updateAttributes(change){var subject=this[internalSymbol].subject.getRealSubject(),p=clone(null==change?void 0:change.path);runUpdateAttributes.call(this,this[internalSymbol].element,p,subject)}function runUpdateAttributes(container,parts,subject){var _this3=this,self=this;if(isArray(parts)){parts=clone(parts);for(var mem=new WeakSet;parts.length>0;){var current=parts.join(".");parts.pop();var iterator=new Set,query='[data-monster-select-this], [data-monster-attributes*="path:'+current+'"], [data-monster-attributes^="static:"]',e=container.querySelectorAll(query);e.length>0&&(iterator=new Set(updater_toConsumableArray(e))),container.matches(query)&&iterator.add(container);var _step7,_iterator7=updater_createForOfIteratorHelper(iterator.entries());try{var _loop3=function _loop3(){var element=updater_slicedToArray(_step7.value,1)[0];if(mem.has(element))return{v:void 0};mem.add(element);for(var attributes=element.getAttribute("data-monster-attributes"),_loop4=function _loop4(){var def=updater_slicedToArray(_Object$entries8[_i9],2)[1],i=(def=trimSpaces(def)).indexOf(" "),name=trimSpaces(def.substr(0,i)),cmd=trimSpaces(def.substr(i)),pipe=new Pipe(cmd);self[internalSymbol].callbacks.forEach((function(f,n){pipe.setCallback(n,f,element)}));var value=void 0;try{element.removeAttribute("data-monster-error"),value=pipe.run(subject)}catch(e){element.setAttribute("data-monster-error",e.message)}void 0===value?element.removeAttribute(name):element.getAttribute(name)!==value&&element.setAttribute(name,value),handleInputControlAttributeUpdate.call(_this3,element,name,value)},_i9=0,_Object$entries8=Object.entries(attributes.split(","));_i9<_Object$entries8.length;_i9++)_loop4()};for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _ret3=_loop3();if("object"===updater_typeof(_ret3))return _ret3.v}}catch(err){_iterator7.e(err)}finally{_iterator7.f()}}}}function handleInputControlAttributeUpdate(element,name,value){if(element instanceof HTMLSelectElement)switch(element.type){case"select-multiple":for(var _i10=0,_Object$entries9=Object.entries(element.options);_i10<_Object$entries9.length;_i10++){var _Object$entries9$_i=updater_slicedToArray(_Object$entries9[_i10],2),opt=(_Object$entries9$_i[0],_Object$entries9$_i[1]);-1!==value.indexOf(opt.value)?opt.selected=!0:opt.selected=!1}break;case"select-one":for(var _i11=0,_Object$entries10=Object.entries(element.options);_i11<_Object$entries10.length;_i11++){var _Object$entries10$_i=updater_slicedToArray(_Object$entries10[_i11],2),_index=_Object$entries10$_i[0];if(_Object$entries10$_i[1].value===value){element.selectedIndex=_index;break}}}else if(element instanceof HTMLInputElement)switch(element.type){case"radio":case"checkbox":"checked"===name&&(element.checked=void 0!==value);break;case"text":default:"value"===name&&(element.value=void 0===value?"":value)}else element instanceof HTMLTextAreaElement&&"value"===name&&(element.value=void 0===value?"":value)}function customelement_typeof(obj){return(customelement_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function customelement_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=customelement_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function customelement_slicedToArray(arr,i){return function customelement_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function customelement_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||customelement_unsupportedIterableToArray(arr,i)||function customelement_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function customelement_toConsumableArray(arr){return function customelement_arrayWithoutHoles(arr){if(Array.isArray(arr))return customelement_arrayLikeToArray(arr)}(arr)||function customelement_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||customelement_unsupportedIterableToArray(arr)||function customelement_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function customelement_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return customelement_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?customelement_arrayLikeToArray(o,minLen):void 0}}function customelement_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function customelement_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function customelement_possibleConstructorReturn(self,call){if(call&&("object"===customelement_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return customelement_assertThisInitialized(self)}function customelement_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function customelement_wrapNativeSuper(Class){var _cache="function"==typeof Map?new Map:void 0;return(customelement_wrapNativeSuper=function _wrapNativeSuper(Class){if(null===Class||!function customelement_isNativeFunction(fn){return-1!==Function.toString.call(fn).indexOf("[native code]")}(Class))return Class;if("function"!=typeof Class)throw new TypeError("Super expression must either be null or a function");if(void 0!==_cache){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper)}function Wrapper(){return customelement_construct(Class,arguments,customelement_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),customelement_setPrototypeOf(Wrapper,Class)})(Class)}function customelement_construct(Parent,args,Class){return(customelement_construct=customelement_isNativeReflectConstruct()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&customelement_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}function customelement_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function customelement_setPrototypeOf(o,p){return(customelement_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function customelement_getPrototypeOf(o){return(customelement_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Updater);var initMethodSymbol=Symbol("initMethodSymbol"),assembleMethodSymbol=Symbol("assembleMethodSymbol"),attributeObserverSymbol=Symbol("attributeObserver"),CustomElement=function(_HTMLElement){!function customelement_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&customelement_setPrototypeOf(subClass,superClass)}(CustomElement,_HTMLElement);var _super=function customelement_createSuper(Derived){var hasNativeReflectConstruct=customelement_isNativeReflectConstruct();return function _createSuperInternal(){var result,Super=customelement_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=customelement_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return customelement_possibleConstructorReturn(this,result)}}(CustomElement);function CustomElement(){var _this;return function customelement_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CustomElement),(_this=_super.call(this))[internalSymbol]=new ProxyObserver({options:extend({},_this.defaults)}),_this[attributeObserverSymbol]={},initOptionObserver.call(customelement_assertThisInitialized(_this)),_this[initMethodSymbol](),_this}return function customelement_createClass(Constructor,protoProps,staticProps){return protoProps&&customelement_defineProperties(Constructor.prototype,protoProps),staticProps&&customelement_defineProperties(Constructor,staticProps),Constructor}(CustomElement,[{key:"defaults",get:function get(){return{ATTRIBUTE_DISABLED:this.getAttribute("disabled"),shadowMode:"open",delegatesFocus:!0,templates:{main:void 0}}}},{key:"attachObserver",value:function attachObserver(observer){return this[internalSymbol].attachObserver(observer),this}},{key:"detachObserver",value:function detachObserver(observer){return this[internalSymbol].detachObserver(observer),this}},{key:"containsObserver",value:function containsObserver(observer){return this[internalSymbol].containsObserver(observer)}},{key:"getOption",value:function getOption(path,defaultValue){var value;try{value=new Pathfinder(this[internalSymbol].getRealSubject().options).getVia(path)}catch(e){}return void 0===value?defaultValue:value}},{key:"setOption",value:function setOption(path,value){return new Pathfinder(this[internalSymbol].getSubject().options).setVia(path,value),this}},{key:"setOptions",value:function setOptions(options){isString(options)&&(options=parseOptionsJSON.call(this,options));return extend(this[internalSymbol].getSubject().options,this.defaults,options),this}},{key:initMethodSymbol,value:function value(){return this}},{key:assembleMethodSymbol,value:function value(){var elements,nodeList,AttributeOptions=getOptionsFromAttributes.call(this);isObject(AttributeOptions)&&Object.keys(AttributeOptions).length>0&&this.setOptions(AttributeOptions);var ScriptOptions=getOptionsFromScriptTag.call(this);if(isObject(ScriptOptions)&&Object.keys(ScriptOptions).length>0&&this.setOptions(ScriptOptions),!1!==this.getOption("shadowMode",!1)){try{initShadowRoot.call(this),elements=this.shadowRoot.childNodes}catch(e){}try{initCSSStylesheet.call(this)}catch(e){addAttributeToken(this,"data-monster-error",e.toString())}}elements instanceof NodeList||elements instanceof NodeList||(initHtmlContent.call(this),elements=this.childNodes);try{nodeList=new Set([].concat(customelement_toConsumableArray(elements),customelement_toConsumableArray(getSlottedElements.call(this))))}catch(e){nodeList=elements}return assignUpdaterToElement.call(this,nodeList,clone(this[internalSymbol].getRealSubject().options)),this}},{key:"connectedCallback",value:function connectedCallback(){hasObjectLink(this,objectUpdaterLinkSymbol)||this[assembleMethodSymbol]()}},{key:"disconnectedCallback",value:function disconnectedCallback(){}},{key:"adoptedCallback",value:function adoptedCallback(){}},{key:"attributeChangedCallback",value:function attributeChangedCallback(attrName,oldVal,newVal){var _self$attributeObserv,callback=null===(_self$attributeObserv=this[attributeObserverSymbol])||void 0===_self$attributeObserv?void 0:_self$attributeObserv[attrName];isFunction(callback)&&callback.call(this,newVal,oldVal)}},{key:"hasNode",value:function hasNode(node){return!!containChildNode.call(this,validateInstance(node,Node))||this.shadowRoot instanceof ShadowRoot&&containChildNode.call(this.shadowRoot,node)}}],[{key:"observedAttributes",get:function get(){return["data-monster-options","disabled"]}},{key:"getTag",value:function getTag(){throw new Error("the method getTag must be overwritten by the derived class.")}},{key:"getCSSStyleSheet",value:function getCSSStyleSheet(){}}]),CustomElement}(customelement_wrapNativeSuper(HTMLElement));function getSlottedElements(query,name){var result=new Set;if(!(this.shadowRoot instanceof ShadowRoot))return result;var selector="slot";void 0!==name&&(selector+=null===name?":not([name])":"[name="+validateString(name)+"]");for(var slots=this.shadowRoot.querySelectorAll(selector),_i=0,_Object$entries=Object.entries(slots);_i<_Object$entries.length;_i++){customelement_slicedToArray(_Object$entries[_i],2)[1].assignedElements().forEach((function(node){if(node instanceof HTMLElement)if(isString(query))node.querySelectorAll(query).forEach((function(n){result.add(n)})),node.matches(query)&&result.add(node);else{if(void 0!==query)throw new Error("query must be a string");result.add(node)}}))}return result}function containChildNode(node){if(this.contains(node))return!0;for(var _i2=0,_Object$entries2=Object.entries(this.childNodes);_i2<_Object$entries2.length;_i2++){var e=customelement_slicedToArray(_Object$entries2[_i2],2)[1];if(e.contains(node))return!0;containChildNode.call(e,node)}return!1}function initOptionObserver(){var self=this,lastDisabledValue=void 0;self.attachObserver(new Observer((function(){var flag=self.getOption("disabled");if(flag!==lastDisabledValue&&(lastDisabledValue=flag,self.shadowRoot instanceof ShadowRoot)){var nodeList,query="button, command, fieldset, keygen, optgroup, option, select, textarea, input, [data-monster-objectlink]",elements=self.shadowRoot.querySelectorAll(query);try{nodeList=new Set([].concat(customelement_toConsumableArray(elements),customelement_toConsumableArray(getSlottedElements.call(self,query))))}catch(e){nodeList=elements}for(var _i3=0,_arr2=customelement_toConsumableArray(nodeList);_i3<_arr2.length;_i3++){var element=_arr2[_i3];!0===flag?element.setAttribute("disabled",""):element.removeAttribute("disabled")}}}))),self.attachObserver(new Observer((function(){if(hasObjectLink(self,objectUpdaterLinkSymbol)){var _step,_iterator=customelement_createForOfIteratorHelper(getLinkedObjects(self,objectUpdaterLinkSymbol));try{for(_iterator.s();!(_step=_iterator.n()).done;){var _step2,_iterator2=customelement_createForOfIteratorHelper(_step.value);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var updater=_step2.value,d=clone(self[internalSymbol].getRealSubject().options);Object.assign(updater.getSubject(),d)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}}catch(err){_iterator.e(err)}finally{_iterator.f()}}}))),self[attributeObserverSymbol].disabled=function(){self.hasAttribute("disabled")?self.setOption("disabled",!0):self.setOption("disabled",void 0)},self[attributeObserverSymbol]["data-monster-options"]=function(){var options=getOptionsFromAttributes.call(self);isObject(options)&&Object.keys(options).length>0&&self.setOptions(options)},self[attributeObserverSymbol]["data-monster-options-selector"]=function(){var options=getOptionsFromScriptTag.call(self);isObject(options)&&Object.keys(options).length>0&&self.setOptions(options)}}function getOptionsFromScriptTag(){if(!this.hasAttribute("data-monster-options-selector"))return{};var node=document.querySelector(this.getAttribute("data-monster-options-selector"));if(!(node instanceof HTMLScriptElement))return addAttributeToken(this,"data-monster-error","the selector data-monster-options-selector for options was specified ("+this.getAttribute("data-monster-options-selector")+") but not found."),{};var obj={};try{obj=parseOptionsJSON.call(this,node.textContent.trim())}catch(e){addAttributeToken(this,"data-monster-error","when analyzing the configuration from the script tag there was an error. "+e)}return obj}function getOptionsFromAttributes(){if(this.hasAttribute("data-monster-options"))try{return parseOptionsJSON.call(this,this.getAttribute("data-monster-options"))}catch(e){addAttributeToken(this,"data-monster-error","the options attribute data-monster-options does not contain a valid json definition (actual: "+this.getAttribute("data-monster-options")+")."+e)}return{}}function parseOptionsJSON(data){var obj={};if(!isString(data))return obj;try{data=parseDataURL(data).content}catch(e){}try{return validateObject(JSON.parse(data))}catch(e){throw e}return obj}function initHtmlContent(){try{var template=findDocumentTemplate(this.constructor.getTag());this.appendChild(template.createDocumentFragment())}catch(e){var html=this.getOption("templates.main","");isString(html)&&html.length>0&&(this.innerHTML=html)}return this}function initCSSStylesheet(){if(!(this.shadowRoot instanceof ShadowRoot))return this;var styleSheet=this.constructor.getCSSStyleSheet();if(styleSheet instanceof CSSStyleSheet)styleSheet.cssRules.length>0&&(this.shadowRoot.adoptedStyleSheets=[styleSheet]);else if(isArray(styleSheet)){var _step3,assign=[],_iterator3=customelement_createForOfIteratorHelper(styleSheet);try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var s=_step3.value;if(isString(s)){var trimedStyleSheet=s.trim();if(""!==trimedStyleSheet){var style=document.createElement("style");style.innerHTML=trimedStyleSheet,this.shadowRoot.prepend(style)}}else validateInstance(s,CSSStyleSheet),s.cssRules.length>0&&assign.push(s)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}assign.length>0&&(this.shadowRoot.adoptedStyleSheets=assign)}else if(isString(styleSheet)){if(""!==styleSheet.trim()){var _style=document.createElement("style");_style.innerHTML=styleSheet,this.shadowRoot.prepend(_style)}}return this}function initShadowRoot(){var template,html;try{template=findDocumentTemplate(this.constructor.getTag())}catch(e){if(!isString(html=this.getOption("templates.main",""))||void 0===html||""===html)throw new Error("html is not set.")}return this.attachShadow({mode:this.getOption("shadowMode","open"),delegatesFocus:this.getOption("delegatesFocus",!0)}),template instanceof Template?(this.shadowRoot.appendChild(template.createDocumentFragment()),this):(this.shadowRoot.innerHTML=html,this)}function assignUpdaterToElement(elements,object){var updaters=new Set;elements instanceof NodeList&&(elements=new Set(customelement_toConsumableArray(elements)));var result=[];return elements.forEach((function(element){if(element instanceof HTMLElement&&!(element instanceof HTMLTemplateElement)){var u=new Updater(element,object);updaters.add(u),result.push(u.run().then((function(){return u.enableEventProcessing()})))}})),updaters.size>0&&addToObjectLink(this,objectUpdaterLinkSymbol,updaters),result}function customcontrol_typeof(obj){return(customcontrol_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function customcontrol_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function customcontrol_get(target,property,receiver){return(customcontrol_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function customcontrol_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=customcontrol_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function customcontrol_setPrototypeOf(o,p){return(customcontrol_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function customcontrol_createSuper(Derived){var hasNativeReflectConstruct=function customcontrol_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=customcontrol_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=customcontrol_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return customcontrol_possibleConstructorReturn(this,result)}}function customcontrol_possibleConstructorReturn(self,call){if(call&&("object"===customcontrol_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return customcontrol_assertThisInitialized(self)}function customcontrol_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function customcontrol_getPrototypeOf(o){return(customcontrol_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",CustomElement,(function registerCustomElement(element){validateFunction(element),getGlobalObject("customElements").define(element.getTag(),element)}),assignUpdaterToElement);var attachedInternalSymbol=Symbol("attachedInternal");function getInternal(){if(!(attachedInternalSymbol in this))throw new Error("ElementInternals is not supported and a polyfill is necessary");return this[attachedInternalSymbol]}function initObserver(){var self=this;self[attributeObserverSymbol].value=function(){self.setOption("value",self.getAttribute("value"))}}function locale_typeof(obj){return(locale_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function locale_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function locale_setPrototypeOf(o,p){return(locale_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function locale_createSuper(Derived){var hasNativeReflectConstruct=function locale_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=locale_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=locale_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return locale_possibleConstructorReturn(this,result)}}function locale_possibleConstructorReturn(self,call){if(call&&("object"===locale_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function locale_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function locale_getPrototypeOf(o){return(locale_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",function(_CustomElement){!function customcontrol_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&customcontrol_setPrototypeOf(subClass,superClass)}(CustomControl,_CustomElement);var _super=customcontrol_createSuper(CustomControl);function CustomControl(){var _this;return function customcontrol_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CustomControl),"function"==typeof(_this=_super.call(this)).attachInternals&&(_this[attachedInternalSymbol]=_this.attachInternals()),initObserver.call(customcontrol_assertThisInitialized(_this)),_this}return function customcontrol_createClass(Constructor,protoProps,staticProps){return protoProps&&customcontrol_defineProperties(Constructor.prototype,protoProps),staticProps&&customcontrol_defineProperties(Constructor,staticProps),Constructor}(CustomControl,[{key:"defaults",get:function get(){return extend({},customcontrol_get(customcontrol_getPrototypeOf(CustomControl.prototype),"defaults",this))}},{key:"value",get:function get(){throw Error("the value getter must be overwritten by the derived class")},set:function set(value){throw Error("the value setter must be overwritten by the derived class")}},{key:"labels",get:function get(){var _getInternal$call;return null===(_getInternal$call=getInternal.call(this))||void 0===_getInternal$call?void 0:_getInternal$call.labels}},{key:"name",get:function get(){return this.getAttribute("name")}},{key:"type",get:function get(){return this.constructor.getTag()}},{key:"validity",get:function get(){var _getInternal$call2;return null===(_getInternal$call2=getInternal.call(this))||void 0===_getInternal$call2?void 0:_getInternal$call2.validity}},{key:"validationMessage",get:function get(){var _getInternal$call3;return null===(_getInternal$call3=getInternal.call(this))||void 0===_getInternal$call3?void 0:_getInternal$call3.validationMessage}},{key:"willValidate",get:function get(){var _getInternal$call4;return null===(_getInternal$call4=getInternal.call(this))||void 0===_getInternal$call4?void 0:_getInternal$call4.willValidate}},{key:"states",get:function get(){var _getInternal$call5;return null===(_getInternal$call5=getInternal.call(this))||void 0===_getInternal$call5?void 0:_getInternal$call5.states}},{key:"form",get:function get(){var _getInternal$call6;return null===(_getInternal$call6=getInternal.call(this))||void 0===_getInternal$call6?void 0:_getInternal$call6.form}},{key:"setFormValue",value:function setFormValue(value,state){getInternal.call(this).setFormValue(value,state)}},{key:"setValidity",value:function setValidity(flags,message,anchor){getInternal.call(this).setValidity(flags,message,anchor)}},{key:"checkValidity",value:function checkValidity(){var _getInternal$call7;return null===(_getInternal$call7=getInternal.call(this))||void 0===_getInternal$call7?void 0:_getInternal$call7.checkValidity()}},{key:"reportValidity",value:function reportValidity(){var _getInternal$call8;return null===(_getInternal$call8=getInternal.call(this))||void 0===_getInternal$call8?void 0:_getInternal$call8.reportValidity()}}],[{key:"observedAttributes",get:function get(){var list=customcontrol_get(customcontrol_getPrototypeOf(CustomControl),"observedAttributes",this);return list.push("value"),list}},{key:"formAssociated",get:function get(){return!0}}]),CustomControl}(CustomElement));var propertiesSymbol=Symbol("properties"),localeStringSymbol=Symbol("localeString"),Locale=function(_Base){!function locale_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&locale_setPrototypeOf(subClass,superClass)}(Locale,_Base);var _super=locale_createSuper(Locale);function Locale(language,region,script,variants,extlang,privateUse){var _this;!function locale_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Locale),(_this=_super.call(this))[propertiesSymbol]={language:void 0===language?void 0:validateString(language),script:void 0===script?void 0:validateString(script),region:void 0===region?void 0:validateString(region),variants:void 0===variants?void 0:validateString(variants),extlang:void 0===extlang?void 0:validateString(extlang),privateUse:void 0===privateUse?void 0:validateString(privateUse)};var s=[];if(void 0!==language&&s.push(language),void 0!==script&&s.push(script),void 0!==region&&s.push(region),void 0!==variants&&s.push(variants),void 0!==extlang&&s.push(extlang),void 0!==privateUse&&s.push(privateUse),0===s.length)throw new Error("unsupported locale");return _this[localeStringSymbol]=s.join("-"),_this}return function locale_createClass(Constructor,protoProps,staticProps){return protoProps&&locale_defineProperties(Constructor.prototype,protoProps),staticProps&&locale_defineProperties(Constructor,staticProps),Constructor}(Locale,[{key:"localeString",get:function get(){return this[localeStringSymbol]}},{key:"language",get:function get(){return this[propertiesSymbol].language}},{key:"region",get:function get(){return this[propertiesSymbol].region}},{key:"script",get:function get(){return this[propertiesSymbol].script}},{key:"variants",get:function get(){return this[propertiesSymbol].variants}},{key:"extlang",get:function get(){return this[propertiesSymbol].extlang}},{key:"privateUse",get:function get(){return this[propertiesSymbol].privateValue}},{key:"toString",value:function toString(){return""+this.localeString}},{key:"getMap",value:function getMap(){return clone(this[propertiesSymbol])}}]),Locale}(Base);function parseLocale(locale){locale=validateString(locale).replace(/_/g,"-");var language,region,variants,parts,script,extlang,match,regex=new RegExp("^(((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+))$");if(null!==(match=regex.exec(locale))&&match.index===regex.lastIndex&&regex.lastIndex++,null==match)throw new Error("unsupported locale");return void 0!==match[6]&&(parts=(language=match[6]).split("-")).length>1&&(language=parts[0],extlang=parts[1]),void 0!==match[14]&&(region=match[14]),void 0!==match[12]&&(script=match[12]),void 0!==match[16]&&(variants=match[16]),new Locale(language,region,script,variants,extlang)}assignToNamespace("Monster.I18n",Locale,parseLocale);function basewithoptions_typeof(obj){return(basewithoptions_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function basewithoptions_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function basewithoptions_setPrototypeOf(o,p){return(basewithoptions_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function basewithoptions_createSuper(Derived){var hasNativeReflectConstruct=function basewithoptions_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=basewithoptions_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=basewithoptions_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return basewithoptions_possibleConstructorReturn(this,result)}}function basewithoptions_possibleConstructorReturn(self,call){if(call&&("object"===basewithoptions_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function basewithoptions_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function basewithoptions_getPrototypeOf(o){return(basewithoptions_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",(function getLocaleOfDocument(){var html=getDocument().querySelector("html");if(html instanceof HTMLElement&&html.hasAttribute("lang")){var locale=html.getAttribute("lang");if(locale)return new parseLocale(locale)}return parseLocale("en")}));var BaseWithOptions=function(_Base){!function basewithoptions_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&basewithoptions_setPrototypeOf(subClass,superClass)}(BaseWithOptions,_Base);var _super=basewithoptions_createSuper(BaseWithOptions);function BaseWithOptions(options){var _this;return function basewithoptions_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,BaseWithOptions),void 0===options&&(options={}),(_this=_super.call(this))[internalSymbol]=extend({},_this.defaults,validateObject(options)),_this}return function basewithoptions_createClass(Constructor,protoProps,staticProps){return protoProps&&basewithoptions_defineProperties(Constructor.prototype,protoProps),staticProps&&basewithoptions_defineProperties(Constructor,staticProps),Constructor}(BaseWithOptions,[{key:"defaults",get:function get(){return{}}},{key:"getOption",value:function getOption(path,defaultValue){var value;try{value=new Pathfinder(this[internalSymbol]).getVia(path)}catch(e){}return void 0===value?defaultValue:value}}]),BaseWithOptions}(Base);function translations_typeof(obj){return(translations_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function translations_slicedToArray(arr,i){return function translations_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function translations_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function translations_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return translations_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return translations_arrayLikeToArray(o,minLen)}(arr,i)||function translations_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function translations_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function translations_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function translations_setPrototypeOf(o,p){return(translations_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function translations_createSuper(Derived){var hasNativeReflectConstruct=function translations_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=translations_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=translations_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return translations_possibleConstructorReturn(this,result)}}function translations_possibleConstructorReturn(self,call){if(call&&("object"===translations_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function translations_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function translations_getPrototypeOf(o){return(translations_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",BaseWithOptions);var Translations=function(_Base){!function translations_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&translations_setPrototypeOf(subClass,superClass)}(Translations,_Base);var _super=translations_createSuper(Translations);function Translations(locale){var _this;return function translations_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Translations),_this=_super.call(this),isString(locale)&&(locale=parseLocale(locale)),_this.locale=validateInstance(locale,Locale),_this.storage=new Map,_this}return function translations_createClass(Constructor,protoProps,staticProps){return protoProps&&translations_defineProperties(Constructor.prototype,protoProps),staticProps&&translations_defineProperties(Constructor,staticProps),Constructor}(Translations,[{key:"getText",value:function getText(key,defaultText){if(!this.storage.has(key)){if(void 0===defaultText)throw new Error("key "+key+" not found");return validateString(defaultText)}return isObject(this.storage.get(key))?this.getPluralRuleText(key,"other",defaultText):this.storage.get(key)}},{key:"getPluralRuleText",value:function getPluralRuleText(key,count,defaultText){if(!this.storage.has(key))return validateString(defaultText);var keyword,r=validateObject(this.storage.get(key));if(isString(count))keyword=count.toLocaleString();else{if(0===(count=validateInteger(count))&&r.hasOwnProperty("zero"))return validateString(r.zero);keyword=new Intl.PluralRules(this.locale.toString()).select(validateInteger(count))}return r.hasOwnProperty(keyword)?validateString(r[keyword]):r.hasOwnProperty(DEFAULT_KEY)?validateString(r[DEFAULT_KEY]):validateString(defaultText)}},{key:"setText",value:function setText(key,text){if(isString(text)||isObject(text))return this.storage.set(validateString(key),text),this;throw new TypeError("value is not a string or object")}},{key:"assignTranslations",value:function assignTranslations(translations){validateObject(translations);for(var _i=0,_Object$entries=Object.entries(translations);_i<_Object$entries.length;_i++){var _Object$entries$_i=translations_slicedToArray(_Object$entries[_i],2),k=_Object$entries$_i[0],v=_Object$entries$_i[1];this.setText(k,v)}return this}}]),Translations}(Base);function provider_typeof(obj){return(provider_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function provider_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function provider_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function provider_setPrototypeOf(o,p){return(provider_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function provider_createSuper(Derived){var hasNativeReflectConstruct=function provider_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=provider_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=provider_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return provider_possibleConstructorReturn(this,result)}}function provider_possibleConstructorReturn(self,call){if(call&&("object"===provider_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function provider_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function provider_getPrototypeOf(o){return(provider_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.I18n",Translations);var Provider=function(_BaseWithOptions){!function provider_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&provider_setPrototypeOf(subClass,superClass)}(Provider,_BaseWithOptions);var _super=provider_createSuper(Provider);function Provider(){return provider_classCallCheck(this,Provider),_super.apply(this,arguments)}return function provider_createClass(Constructor,protoProps,staticProps){return protoProps&&provider_defineProperties(Constructor.prototype,protoProps),staticProps&&provider_defineProperties(Constructor,staticProps),Constructor}(Provider,[{key:"getTranslations",value:function getTranslations(locale){return new Promise((function(resolve,reject){try{resolve(new Translations(locale))}catch(e){reject(e)}}))}}]),Provider}(BaseWithOptions);function formatter_typeof(obj){return(formatter_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function formatter_slicedToArray(arr,i){return function formatter_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function formatter_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||formatter_unsupportedIterableToArray(arr,i)||function formatter_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function formatter_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=formatter_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function formatter_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return formatter_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?formatter_arrayLikeToArray(o,minLen):void 0}}function formatter_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function formatter_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function formatter_get(target,property,receiver){return(formatter_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function formatter_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=formatter_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function formatter_setPrototypeOf(o,p){return(formatter_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function formatter_createSuper(Derived){var hasNativeReflectConstruct=function formatter_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=formatter_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=formatter_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return formatter_possibleConstructorReturn(this,result)}}function formatter_possibleConstructorReturn(self,call){if(call&&("object"===formatter_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function formatter_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function formatter_getPrototypeOf(o){return(formatter_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.I18n",Provider);var internalObjectSymbol=Symbol("internalObject"),watchdogSymbol=Symbol("watchdog"),markerOpenIndexSymbol=Symbol("markerOpenIndex"),markerCloseIndexSymbol=Symbol("markercloseIndex"),workingDataSymbol=Symbol("workingData"),Formatter=function(_BaseWithOptions){!function formatter_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&formatter_setPrototypeOf(subClass,superClass)}(Formatter,_BaseWithOptions);var _super=formatter_createSuper(Formatter);function Formatter(object,options){var _this;return function formatter_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Formatter),(_this=_super.call(this,options))[internalObjectSymbol]=object||{},_this[markerOpenIndexSymbol]=0,_this[markerCloseIndexSymbol]=0,_this}return function formatter_createClass(Constructor,protoProps,staticProps){return protoProps&&formatter_defineProperties(Constructor.prototype,protoProps),staticProps&&formatter_defineProperties(Constructor,staticProps),Constructor}(Formatter,[{key:"defaults",get:function get(){return extend({},formatter_get(formatter_getPrototypeOf(Formatter.prototype),"defaults",this),{marker:{open:["${"],close:["}"]},parameter:{delimiter:"::",assignment:"="},callbacks:{}})}},{key:"setParameterChars",value:function setParameterChars(delimiter,assignment){return void 0!==delimiter&&(this[internalSymbol].parameter.delimiter=validateString(delimiter)),void 0!==assignment&&(this[internalSymbol].parameter.assignment=validateString(assignment)),this}},{key:"setMarker",value:function setMarker(open,close){return void 0===close&&(close=open),isString(open)&&(open=[open]),isString(close)&&(close=[close]),this[internalSymbol].marker.open=validateArray(open),this[internalSymbol].marker.close=validateArray(close),this}},{key:"format",value:function format(text){return this[watchdogSymbol]=0,this[markerOpenIndexSymbol]=0,this[markerCloseIndexSymbol]=0,this[workingDataSymbol]={},_format.call(this,text)}}]),Formatter}(BaseWithOptions);function _format(text){var _self$internalSymbol$,_self$internalSymbol$2,_self$internalSymbol$3,_self$internalSymbol$4;if(this[watchdogSymbol]++,this[watchdogSymbol]>20)throw new Error("too deep nesting");var openMarker=null===(_self$internalSymbol$=this[internalSymbol].marker.open)||void 0===_self$internalSymbol$?void 0:_self$internalSymbol$[this[markerOpenIndexSymbol]],closeMarker=null===(_self$internalSymbol$2=this[internalSymbol].marker.close)||void 0===_self$internalSymbol$2?void 0:_self$internalSymbol$2[this[markerCloseIndexSymbol]];if(-1===text.indexOf(openMarker)||-1===text.indexOf(closeMarker))return text;var result=tokenize.call(this,validateString(text),openMarker,closeMarker);return null!==(_self$internalSymbol$3=this[internalSymbol].marker.open)&&void 0!==_self$internalSymbol$3&&_self$internalSymbol$3[this[markerOpenIndexSymbol]+1]&&this[markerOpenIndexSymbol]++,null!==(_self$internalSymbol$4=this[internalSymbol].marker.close)&&void 0!==_self$internalSymbol$4&&_self$internalSymbol$4[this[markerCloseIndexSymbol]+1]&&this[markerCloseIndexSymbol]++,result=_format.call(this,result)}function tokenize(text,openMarker,closeMarker){for(var formatted=[],parameterAssignment=this[internalSymbol].parameter.assignment,parameterDelimiter=this[internalSymbol].parameter.delimiter,callbacks=this[internalSymbol].callbacks;;){var _self$workingDataSymb,startIndex=text.indexOf(openMarker);if(-1===startIndex){formatted.push(text);break}startIndex>0&&(formatted.push(text.substring(0,startIndex)),text=text.substring(startIndex));var endIndex=text.substring(openMarker.length).indexOf(closeMarker);-1!==endIndex&&(endIndex+=openMarker.length);var insideStartIndex=text.substring(openMarker.length).indexOf(openMarker);if(-1!==insideStartIndex&&(insideStartIndex+=openMarker.length)<endIndex){var result=tokenize.call(this,text.substring(insideStartIndex),openMarker,closeMarker);-1!==(endIndex=(text=text.substring(0,insideStartIndex)+result).substring(openMarker.length).indexOf(closeMarker))&&(endIndex+=openMarker.length)}if(-1===endIndex)throw new Error("syntax error in formatter template");var key=text.substring(openMarker.length,endIndex),parts=key.split(parameterDelimiter),currentPipe=parts.shift();this[workingDataSymbol]=extend({},this[internalObjectSymbol],this[workingDataSymbol]);var _step,_iterator=formatter_createForOfIteratorHelper(parts);try{for(_iterator.s();!(_step=_iterator.n()).done;){var _kv$split2=formatter_slicedToArray(_step.value.split(parameterAssignment),2),k=_kv$split2[0],v=_kv$split2[1];this[workingDataSymbol][k]=v}}catch(err){_iterator.e(err)}finally{_iterator.f()}var t3=key.split("|").shift().trim().split("::").shift().trim().split(".").shift().trim(),prefix=null!==(_self$workingDataSymb=this[workingDataSymbol])&&void 0!==_self$workingDataSymb&&_self$workingDataSymb[t3]?"path:":"static:",command="";prefix&&0!==key.indexOf(prefix)&&0!==key.indexOf("path:")&&0!==key.indexOf("static:")&&(command=prefix);var pipe=new Pipe(command+=currentPipe);if(isObject(callbacks))for(var _i=0,_Object$entries=Object.entries(callbacks);_i<_Object$entries.length;_i++){var _Object$entries$_i=formatter_slicedToArray(_Object$entries[_i],2),name=_Object$entries$_i[0],callback=_Object$entries$_i[1];pipe.setCallback(name,callback)}formatted.push(validateString(pipe.run(this[workingDataSymbol]))),text=text.substring(endIndex+closeMarker.length)}return formatted.join("")}function fetch_typeof(obj){return(fetch_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function fetch_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function fetch_setPrototypeOf(o,p){return(fetch_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function fetch_createSuper(Derived){var hasNativeReflectConstruct=function fetch_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=fetch_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=fetch_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return fetch_possibleConstructorReturn(this,result)}}function fetch_possibleConstructorReturn(self,call){if(call&&("object"===fetch_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return fetch_assertThisInitialized(self)}function fetch_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function fetch_get(target,property,receiver){return(fetch_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function fetch_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=fetch_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function fetch_getPrototypeOf(o){return(fetch_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function logentry_typeof(obj){return(logentry_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function logentry_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function logentry_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function logentry_setPrototypeOf(o,p){return(logentry_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function logentry_createSuper(Derived){var hasNativeReflectConstruct=function logentry_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=logentry_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=logentry_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return logentry_possibleConstructorReturn(this,result)}}function logentry_possibleConstructorReturn(self,call){if(call&&("object"===logentry_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function logentry_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function logentry_getPrototypeOf(o){return(logentry_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Text",Formatter),assignToNamespace("Monster.I18n.Providers",function(_Provider){!function fetch_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&fetch_setPrototypeOf(subClass,superClass)}(Fetch,_Provider);var _super=fetch_createSuper(Fetch);function Fetch(url,options){var _thisSuper,_this;return function fetch_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Fetch),_this=_super.call(this,options),isInstance(url,URL)&&(url=url.toString()),void 0===options&&(options={}),validateString(url),_this.url=url,_this[internalSymbol]=extend({},fetch_get((_thisSuper=fetch_assertThisInitialized(_this),fetch_getPrototypeOf(Fetch.prototype)),"defaults",_thisSuper),_this.defaults,validateObject(options)),_this}return function fetch_createClass(Constructor,protoProps,staticProps){return protoProps&&fetch_defineProperties(Constructor.prototype,protoProps),staticProps&&fetch_defineProperties(Constructor,staticProps),Constructor}(Fetch,[{key:"defaults",get:function get(){return{fetch:{method:"GET",mode:"cors",cache:"no-cache",credentials:"omit",redirect:"follow",referrerPolicy:"no-referrer"}}}},{key:"getTranslations",value:function getTranslations(locale){isString(locale)&&(locale=parseLocale(locale));var formatter=new Formatter(locale.getMap());return getGlobalFunction("fetch")(formatter.format(this.url),this.getOption("fetch",{})).then((function(response){return response.json()})).then((function(data){return new Translations(locale).assignTranslations(data)}))}}]),Fetch}(Provider));var LogEntry=function(_Base){!function logentry_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&logentry_setPrototypeOf(subClass,superClass)}(LogEntry,_Base);var _super=logentry_createSuper(LogEntry);function LogEntry(loglevel){var _this;logentry_classCallCheck(this,LogEntry),_this=_super.call(this),validateInteger(loglevel),_this.loglevel=loglevel;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return _this.arguments=args,_this}return function logentry_createClass(Constructor,protoProps,staticProps){return protoProps&&logentry_defineProperties(Constructor.prototype,protoProps),staticProps&&logentry_defineProperties(Constructor,staticProps),Constructor}(LogEntry,[{key:"getLogLevel",value:function getLogLevel(){return this.loglevel}},{key:"getArguments",value:function getArguments(){return this.arguments}}]),LogEntry}(Base);function logger_typeof(obj){return(logger_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function logger_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function logger_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return logger_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return logger_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function logger_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function logger_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function logger_setPrototypeOf(o,p){return(logger_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function logger_createSuper(Derived){var hasNativeReflectConstruct=function logger_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=logger_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=logger_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return logger_possibleConstructorReturn(this,result)}}function logger_possibleConstructorReturn(self,call){if(call&&("object"===logger_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function logger_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function logger_getPrototypeOf(o){return(logger_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Logging",LogEntry);var TRACE=64,DEBUG=32,INFO=16,WARN=8,ERROR=4,FATAL=2;function triggerLog(loglevel){for(var logger=this,_len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];var _step,_iterator=logger_createForOfIteratorHelper(logger.handler);try{for(_iterator.s();!(_step=_iterator.n()).done;){var handler=_step.value;handler.log(new LogEntry(loglevel,args))}}catch(err){_iterator.e(err)}finally{_iterator.f()}return logger}function handler_typeof(obj){return(handler_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function handler_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function handler_setPrototypeOf(o,p){return(handler_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function handler_createSuper(Derived){var hasNativeReflectConstruct=function handler_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=handler_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=handler_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return handler_possibleConstructorReturn(this,result)}}function handler_possibleConstructorReturn(self,call){if(call&&("object"===handler_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function handler_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function handler_getPrototypeOf(o){return(handler_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Logging",function(_Base){!function logger_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&logger_setPrototypeOf(subClass,superClass)}(Logger,_Base);var _super=logger_createSuper(Logger);function Logger(){var _this;return function logger_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Logger),(_this=_super.call(this)).handler=new Set,_this}return function logger_createClass(Constructor,protoProps,staticProps){return protoProps&&logger_defineProperties(Constructor.prototype,protoProps),staticProps&&logger_defineProperties(Constructor,staticProps),Constructor}(Logger,[{key:"addHandler",value:function addHandler(handler){if(validateObject(handler),!(handler instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.add(handler),this}},{key:"removeHandler",value:function removeHandler(handler){if(validateObject(handler),!(handler instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.delete(handler),this}},{key:"logTrace",value:function logTrace(){return triggerLog.apply(this,[TRACE].concat(Array.prototype.slice.call(arguments))),this}},{key:"logDebug",value:function logDebug(){return triggerLog.apply(this,[DEBUG].concat(Array.prototype.slice.call(arguments))),this}},{key:"logInfo",value:function logInfo(){return triggerLog.apply(this,[INFO].concat(Array.prototype.slice.call(arguments))),this}},{key:"logWarn",value:function logWarn(){return triggerLog.apply(this,[WARN].concat(Array.prototype.slice.call(arguments))),this}},{key:"logError",value:function logError(){return triggerLog.apply(this,[ERROR].concat(Array.prototype.slice.call(arguments))),this}},{key:"logFatal",value:function logFatal(){return triggerLog.apply(this,[FATAL].concat(Array.prototype.slice.call(arguments))),this}},{key:"getLabel",value:function getLabel(level){return validateInteger(level),255===level?"ALL":level===TRACE?"TRACE":level===DEBUG?"DEBUG":level===INFO?"INFO":level===WARN?"WARN":level===ERROR?"ERROR":level===FATAL?"FATAL":0===level?"OFF":"unknown"}},{key:"getLevel",value:function getLevel(label){return validateString(label),"ALL"===label?255:"TRACE"===label?TRACE:"DEBUG"===label?DEBUG:"INFO"===label?INFO:"WARN"===label?WARN:"ERROR"===label?ERROR:"FATAL"===label?FATAL:0}}]),Logger}(Base));var Handler=function(_Base){!function handler_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&handler_setPrototypeOf(subClass,superClass)}(Handler,_Base);var _super=handler_createSuper(Handler);function Handler(){var _this;return function handler_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Handler),(_this=_super.call(this)).loglevel=0,_this}return function handler_createClass(Constructor,protoProps,staticProps){return protoProps&&handler_defineProperties(Constructor.prototype,protoProps),staticProps&&handler_defineProperties(Constructor,staticProps),Constructor}(Handler,[{key:"log",value:function log(entry){return validateInstance(entry,LogEntry),!(this.loglevel<entry.getLogLevel())}},{key:"setLogLevel",value:function setLogLevel(loglevel){return validateInteger(loglevel),this.loglevel=loglevel,this}},{key:"getLogLevel",value:function getLogLevel(){return this.loglevel}},{key:"setAll",value:function setAll(){return this.setLogLevel(255),this}},{key:"setTrace",value:function setTrace(){return this.setLogLevel(TRACE),this}},{key:"setDebug",value:function setDebug(){return this.setLogLevel(DEBUG),this}},{key:"setInfo",value:function setInfo(){return this.setLogLevel(INFO),this}},{key:"setWarn",value:function setWarn(){return this.setLogLevel(WARN),this}},{key:"setError",value:function setError(){return this.setLogLevel(ERROR),this}},{key:"setFatal",value:function setFatal(){return this.setLogLevel(FATAL),this}},{key:"setOff",value:function setOff(){return this.setLogLevel(0),this}}]),Handler}(Base);function console_typeof(obj){return(console_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function console_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function console_get(target,property,receiver){return(console_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function console_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=console_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function console_setPrototypeOf(o,p){return(console_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function console_createSuper(Derived){var hasNativeReflectConstruct=function console_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=console_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=console_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return console_possibleConstructorReturn(this,result)}}function console_possibleConstructorReturn(self,call){if(call&&("object"===console_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function console_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function console_getPrototypeOf(o){return(console_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function random(min,max){if(void 0===min&&(min=0),void 0===max&&(max=MAX),max<min)throw new Error("max must be greater than min");return Math.round(create(min,max))}assignToNamespace("Monster.Logging",Handler),assignToNamespace("Monster.Logging.Handler",function(_Handler){!function console_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&console_setPrototypeOf(subClass,superClass)}(ConsoleHandler,_Handler);var _super=console_createSuper(ConsoleHandler);function ConsoleHandler(){return function console_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ConsoleHandler),_super.call(this)}return function console_createClass(Constructor,protoProps,staticProps){return protoProps&&console_defineProperties(Constructor.prototype,protoProps),staticProps&&console_defineProperties(Constructor,staticProps),Constructor}(ConsoleHandler,[{key:"log",value:function log(entry){if(console_get(console_getPrototypeOf(ConsoleHandler.prototype),"log",this).call(this,entry)){var console=getGlobalObject("console");return!!console&&(console.log(entry.toString()),!0)}return!1}}]),ConsoleHandler}(Handler));var MAX=1e9;function create(min,max){var crypt,globalReference=getGlobal();if(void 0===(crypt=(null==globalReference?void 0:globalReference.crypto)||(null==globalReference?void 0:globalReference.msCrypto)||(null==globalReference?void 0:globalReference.crypto)||void 0))throw new Error("missing crypt");var rval=0,range=max-min;if(range<2)throw new Error("the distance is too small to create a random number.");var bitsNeeded=Math.ceil(Math.log2(range));if(bitsNeeded>53)throw new Error("we cannot generate numbers larger than 53 bits.");var bytesNeeded=Math.ceil(bitsNeeded/8),mask=Math.pow(2,bitsNeeded)-1,byteArray=new Uint8Array(bytesNeeded);crypt.getRandomValues(byteArray);for(var p=8*(bytesNeeded-1),i=0;i<bytesNeeded;i++)rval+=byteArray[i]*Math.pow(2,p),p-=8;return(rval&=mask)>=range?create(min,max):(rval<min&&(rval+=min),rval)}function randomid_typeof(obj){return(randomid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function randomid_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function randomid_setPrototypeOf(o,p){return(randomid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function randomid_createSuper(Derived){var hasNativeReflectConstruct=function randomid_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=randomid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=randomid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return randomid_possibleConstructorReturn(this,result)}}function randomid_possibleConstructorReturn(self,call){if(call&&("object"===randomid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function randomid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function randomid_getPrototypeOf(o){return(randomid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Math.log2=Math.log2||function(n){return Math.log(n)/Math.log(2)},assignToNamespace("Monster.Math",random);var randomid_internalCounter=0;function version_typeof(obj){return(version_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function version_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function version_setPrototypeOf(o,p){return(version_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function version_createSuper(Derived){var hasNativeReflectConstruct=function version_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=version_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=version_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return version_possibleConstructorReturn(this,result)}}function version_possibleConstructorReturn(self,call){if(call&&("object"===version_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function version_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function version_getPrototypeOf(o){return(version_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",function(_ID){!function randomid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&randomid_setPrototypeOf(subClass,superClass)}(RandomID,_ID);var _super=randomid_createSuper(RandomID);function RandomID(){var _this;return function randomid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RandomID),_this=_super.call(this),randomid_internalCounter+=1,_this.id=getGlobal().btoa(random(1,1e4)).replace(/=/g,"").replace(/^[0-9]+/,"X")+randomid_internalCounter,_this}return function randomid_createClass(Constructor,protoProps,staticProps){return protoProps&&randomid_defineProperties(Constructor.prototype,protoProps),staticProps&&randomid_defineProperties(Constructor,staticProps),Constructor}(RandomID)}(ID));var monsterVersion,rootName,Version=function(_Base){!function version_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&version_setPrototypeOf(subClass,superClass)}(Version,_Base);var _super=version_createSuper(Version);function Version(major,minor,patch){var _this;if(function version_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Version),_this=_super.call(this),"string"==typeof major&&void 0===minor&&void 0===patch){var parts=major.toString().split(".");major=parseInt(parts[0]||0),minor=parseInt(parts[1]||0),patch=parseInt(parts[2]||0)}if(void 0===major)throw new Error("major version is undefined");if(void 0===minor&&(minor=0),void 0===patch&&(patch=0),_this.major=parseInt(major),_this.minor=parseInt(minor),_this.patch=parseInt(patch),isNaN(_this.major))throw new Error("major is not a number");if(isNaN(_this.minor))throw new Error("minor is not a number");if(isNaN(_this.patch))throw new Error("patch is not a number");return _this}return function version_createClass(Constructor,protoProps,staticProps){return protoProps&&version_defineProperties(Constructor.prototype,protoProps),staticProps&&version_defineProperties(Constructor,staticProps),Constructor}(Version,[{key:"toString",value:function toString(){return this.major+"."+this.minor+"."+this.patch}},{key:"compareTo",value:function compareTo(version){if(version instanceof Version&&(version=version.toString()),"string"!=typeof version)throw new Error("type exception");if(version===this.toString())return 0;for(var a=[this.major,this.minor,this.patch],b=version.split("."),len=Math.max(a.length,b.length),i=0;i<len;i+=1){if(a[i]&&!b[i]&&parseInt(a[i])>0||parseInt(a[i])>parseInt(b[i]))return 1;if(b[i]&&!a[i]&&parseInt(b[i])>0||parseInt(a[i])<parseInt(b[i]))return-1}return 0}}]),Version}(Base);function comparator_typeof(obj){return(comparator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function comparator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function comparator_setPrototypeOf(o,p){return(comparator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function comparator_createSuper(Derived){var hasNativeReflectConstruct=function comparator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=comparator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=comparator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return comparator_possibleConstructorReturn(this,result)}}function comparator_possibleConstructorReturn(self,call){if(call&&("object"===comparator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function comparator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function comparator_getPrototypeOf(o){return(comparator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function freeze_typeof(obj){return(freeze_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function freeze_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function freeze_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return freeze_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return freeze_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function freeze_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}assignToNamespace("Monster.Types",Version),assignToNamespace("Monster",(function getVersion(){return monsterVersion instanceof Version?monsterVersion:monsterVersion=new Version("1.30.1")})),assignToNamespace("Monster.Util",function(_Base){!function comparator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&comparator_setPrototypeOf(subClass,superClass)}(Comparator,_Base);var _super=comparator_createSuper(Comparator);function Comparator(callback){var _this;if(function comparator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Comparator),_this=_super.call(this),isFunction(callback))_this.compare=callback;else{if(void 0!==callback)throw new TypeError("unsupported type");_this.compare=function(a,b){if(comparator_typeof(a)!==comparator_typeof(b))throw new TypeError("impractical comparison","types/comparator.js");return a===b?0:a<b?-1:1}}return _this}return function comparator_createClass(Constructor,protoProps,staticProps){return protoProps&&comparator_defineProperties(Constructor.prototype,protoProps),staticProps&&comparator_defineProperties(Constructor,staticProps),Constructor}(Comparator,[{key:"reverse",value:function reverse(){var original=this.compare;return this.compare=function(a,b){return original(b,a)},this}},{key:"equal",value:function equal(a,b){return 0===this.compare(a,b)}},{key:"greaterThan",value:function greaterThan(a,b){return this.compare(a,b)>0}},{key:"greaterThanOrEqual",value:function greaterThanOrEqual(a,b){return this.greaterThan(a,b)||this.equal(a,b)}},{key:"lessThanOrEqual",value:function lessThanOrEqual(a,b){return this.lessThan(a,b)||this.equal(a,b)}},{key:"lessThan",value:function lessThan(a,b){return this.compare(a,b)<0}}]),Comparator}(Base)),assignToNamespace("Monster.Util",(function deepFreeze(object){validateObject(object);var _step,_iterator=freeze_createForOfIteratorHelper(Object.getOwnPropertyNames(object));try{for(_iterator.s();!(_step=_iterator.n()).done;){var name=_step.value,value=object[name];object[name]=value&&"object"===freeze_typeof(value)?deepFreeze(value):value}}catch(err){_iterator.e(err)}finally{_iterator.f()}return Object.freeze(object)}));try{rootName=Monster.Types.getGlobalObject("__MonsterRootName__")}catch(e){}return rootName||(rootName="Monster"),Monster.Types.getGlobal()[rootName]=Monster,__webpack_exports__}()}));
\ No newline at end of file
+!function webpackUniversalModuleDefinition(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?exports.window=factory():root.window=factory()}(self,(function(){return function(){var __webpack_require__={d:function(exports,definition){for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},o:function(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)},r:function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})}},__webpack_exports__={};function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Monster:function(){return Monster}});var Namespace=function(){function Namespace(namespace){if(function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Namespace),void 0===namespace||"string"!=typeof namespace)throw new Error("namespace is not a string");this.namespace=namespace}return function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(Namespace,[{key:"getNamespace",value:function getNamespace(){return this.namespace}},{key:"toString",value:function toString(){return this.getNamespace()}}]),Namespace}(),Monster=new Namespace("Monster");function assignToNamespace(ns){var current=namespaceFor(ns.split("."));if(0==(arguments.length<=1?0:arguments.length-1))throw new Error("no functions have been passed.");for(var i=0,l=arguments.length<=1?0:arguments.length-1;i<l;i++)current[objectName(i+1<1||arguments.length<=i+1?void 0:arguments[i+1])]=i+1<1||arguments.length<=i+1?void 0:arguments[i+1];return current}function objectName(obj){try{if("function"!=typeof obj)throw new Error("the first argument is not a function or class.");if(obj.hasOwnProperty("name"))return obj.name;if("function"==typeof obj.toString){var s=obj.toString(),f=s.match(/^\s*function\s+([^\s(]+)/);if(Array.isArray(f)&&"string"==typeof f[1])return f[1];var c=s.match(/^\s*class\s+([^\s(]+)/);if(Array.isArray(c)&&"string"==typeof c[1])return c[1]}}catch(e){throw new Error("exception "+e)}throw new Error("the name of the class or function cannot be resolved.")}function namespaceFor(parts){for(var space=Monster,ns="Monster",i=0;i<parts.length;i++)"Monster"!==parts[i]&&(ns+="."+parts[i],space.hasOwnProperty(parts[i])||(space[parts[i]]=new Namespace(ns)),space=space[parts[i]]);return space}assignToNamespace("Monster",assignToNamespace,Namespace);var internalSymbol=Symbol("internalData");Symbol("state");function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function base_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function base_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _possibleConstructorReturn(self,call){if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function _wrapNativeSuper(Class){var _cache="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function _wrapNativeSuper(Class){if(null===Class||!function _isNativeFunction(fn){return-1!==Function.toString.call(fn).indexOf("[native code]")}(Class))return Class;if("function"!=typeof Class)throw new TypeError("Super expression must either be null or a function");if(void 0!==_cache){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper)}function Wrapper(){return _construct(Class,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,Class)})(Class)}function _construct(Parent,args,Class){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}var Base=function(_Object){!function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_setPrototypeOf(subClass,superClass)}(Base,_Object);var _super=function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return _possibleConstructorReturn(this,result)}}(Base);function Base(){return base_classCallCheck(this,Base),_super.apply(this,arguments)}return function base_createClass(Constructor,protoProps,staticProps){return protoProps&&base_defineProperties(Constructor.prototype,protoProps),staticProps&&base_defineProperties(Constructor,staticProps),Constructor}(Base,[{key:"toString",value:function toString(){return JSON.stringify(this)}}]),Base}(_wrapNativeSuper(Object));function abstract_typeof(obj){return(abstract_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function abstract_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function abstract_setPrototypeOf(o,p){return(abstract_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function abstract_createSuper(Derived){var hasNativeReflectConstruct=function abstract_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=abstract_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=abstract_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return abstract_possibleConstructorReturn(this,result)}}function abstract_possibleConstructorReturn(self,call){if(call&&("object"===abstract_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function abstract_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function abstract_getPrototypeOf(o){return(abstract_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Base);var AbstractConstraint=function(_Base){!function abstract_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&abstract_setPrototypeOf(subClass,superClass)}(AbstractConstraint,_Base);var _super=abstract_createSuper(AbstractConstraint);function AbstractConstraint(){return function abstract_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AbstractConstraint),_super.call(this)}return function abstract_createClass(Constructor,protoProps,staticProps){return protoProps&&abstract_defineProperties(Constructor.prototype,protoProps),staticProps&&abstract_defineProperties(Constructor,staticProps),Constructor}(AbstractConstraint,[{key:"isValid",value:function isValid(value){return Promise.reject(value)}}]),AbstractConstraint}(Base);function abstractoperator_typeof(obj){return(abstractoperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function abstractoperator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function abstractoperator_setPrototypeOf(o,p){return(abstractoperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function abstractoperator_createSuper(Derived){var hasNativeReflectConstruct=function abstractoperator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=abstractoperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=abstractoperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return abstractoperator_possibleConstructorReturn(this,result)}}function abstractoperator_possibleConstructorReturn(self,call){if(call&&("object"===abstractoperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function abstractoperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function abstractoperator_getPrototypeOf(o){return(abstractoperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Constraints",AbstractConstraint);var globalReference,AbstractOperator=function(_AbstractConstraint){!function abstractoperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&abstractoperator_setPrototypeOf(subClass,superClass)}(AbstractOperator,_AbstractConstraint);var _super=abstractoperator_createSuper(AbstractOperator);function AbstractOperator(operantA,operantB){var _this;if(function abstractoperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AbstractOperator),_this=_super.call(this),!(operantA instanceof AbstractConstraint&&operantB instanceof AbstractConstraint))throw new TypeError("parameters must be from type AbstractConstraint");return _this.operantA=operantA,_this.operantB=operantB,_this}return function abstractoperator_createClass(Constructor,protoProps,staticProps){return protoProps&&abstractoperator_defineProperties(Constructor.prototype,protoProps),staticProps&&abstractoperator_defineProperties(Constructor,staticProps),Constructor}(AbstractOperator)}(AbstractConstraint);function andoperator_typeof(obj){return(andoperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function andoperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function andoperator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function andoperator_setPrototypeOf(o,p){return(andoperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function andoperator_createSuper(Derived){var hasNativeReflectConstruct=function andoperator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=andoperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=andoperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return andoperator_possibleConstructorReturn(this,result)}}function andoperator_possibleConstructorReturn(self,call){if(call&&("object"===andoperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function andoperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function andoperator_getPrototypeOf(o){return(andoperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function invalid_typeof(obj){return(invalid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function invalid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function invalid_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function invalid_setPrototypeOf(o,p){return(invalid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function invalid_createSuper(Derived){var hasNativeReflectConstruct=function invalid_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=invalid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=invalid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return invalid_possibleConstructorReturn(this,result)}}function invalid_possibleConstructorReturn(self,call){if(call&&("object"===invalid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function invalid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function invalid_getPrototypeOf(o){return(invalid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function is_typeof(obj){return(is_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isIterable(value){return void 0!==value&&(null!==value&&"function"==typeof(null==value?void 0:value[Symbol.iterator]))}function isPrimitive(value){var type;return null==value||("string"===(type=is_typeof(value))||"number"===type||"boolean"===type||"symbol"===type)}function isSymbol(value){return"symbol"===is_typeof(value)}function isBoolean(value){return!0===value||!1===value}function isString(value){return void 0!==value&&"string"==typeof value}function isObject(value){return!isArray(value)&&(!isPrimitive(value)&&"object"===is_typeof(value))}function isInstance(value,instance){return!!isObject(value)&&(!!isFunction(instance)&&(!!instance.hasOwnProperty("prototype")&&value instanceof instance))}function isArray(value){return Array.isArray(value)}function isFunction(value){return!isArray(value)&&(!isPrimitive(value)&&"function"==typeof value)}function isInteger(value){return Number.isInteger(value)}function isarray_typeof(obj){return(isarray_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isarray_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function isarray_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function isarray_setPrototypeOf(o,p){return(isarray_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function isarray_createSuper(Derived){var hasNativeReflectConstruct=function isarray_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=isarray_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=isarray_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return isarray_possibleConstructorReturn(this,result)}}function isarray_possibleConstructorReturn(self,call){if(call&&("object"===isarray_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function isarray_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function isarray_getPrototypeOf(o){return(isarray_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function isobject_typeof(obj){return(isobject_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isobject_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function isobject_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function isobject_setPrototypeOf(o,p){return(isobject_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function isobject_createSuper(Derived){var hasNativeReflectConstruct=function isobject_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=isobject_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=isobject_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return isobject_possibleConstructorReturn(this,result)}}function isobject_possibleConstructorReturn(self,call){if(call&&("object"===isobject_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function isobject_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function isobject_getPrototypeOf(o){return(isobject_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function oroperator_typeof(obj){return(oroperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function oroperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function oroperator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function oroperator_setPrototypeOf(o,p){return(oroperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function oroperator_createSuper(Derived){var hasNativeReflectConstruct=function oroperator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=oroperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=oroperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return oroperator_possibleConstructorReturn(this,result)}}function oroperator_possibleConstructorReturn(self,call){if(call&&("object"===oroperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function oroperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function oroperator_getPrototypeOf(o){return(oroperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function valid_typeof(obj){return(valid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function valid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function valid_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function valid_setPrototypeOf(o,p){return(valid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function valid_createSuper(Derived){var hasNativeReflectConstruct=function valid_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=valid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=valid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return valid_possibleConstructorReturn(this,result)}}function valid_possibleConstructorReturn(self,call){if(call&&("object"===valid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function valid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function valid_getPrototypeOf(o){return(valid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function validatePrimitive(value){if(!isPrimitive(value))throw new TypeError("value is not a primitive");return value}function validateBoolean(value){if(!isBoolean(value))throw new TypeError("value is not a boolean");return value}function validateString(value){if(!isString(value))throw new TypeError("value is not a string");return value}function validateObject(value){if(!isObject(value))throw new TypeError("value is not a object");return value}function validateInstance(value,instance){if(!isInstance(value,instance)){var n="";throw(isObject(instance)||isFunction(instance))&&(n=null==instance?void 0:instance.name),n&&(n=" "+n),new TypeError("value is not an instance of"+n)}return value}function validateArray(value){if(!isArray(value))throw new TypeError("value is not an array");return value}function validateSymbol(value){if(!isSymbol(value))throw new TypeError("value is not an symbol");return value}function validateFunction(value){if(!isFunction(value))throw new TypeError("value is not a function");return value}function validateInteger(value){if(!isInteger(value))throw new TypeError("value is not an integer");return value}function global_typeof(obj){return(global_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function getGlobal(){return globalReference}function getGlobalObject(name){var _globalReference;validateString(name);var o=null===(_globalReference=globalReference)||void 0===_globalReference?void 0:_globalReference[name];if(void 0===o)throw new Error("the object "+name+" is not defined");return validateObject(o),o}function getGlobalFunction(name){var _globalReference2;validateString(name);var f=null===(_globalReference2=globalReference)||void 0===_globalReference2?void 0:_globalReference2[name];if(void 0===f)throw new Error("the function "+name+" is not defined");return validateFunction(f),f}function typeOf(value){var type={}.toString.call(value).match(/\s([a-zA-Z]+)/)[1];if("Object"===type){var results=/^(class|function)\s+(\w+)/.exec(value.constructor.toString());type=results&&results.length>2?results[2]:""}return type.toLowerCase()}function clone_typeof(obj){return(clone_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function clone(obj){if(null===obj)return obj;if(isPrimitive(obj))return obj;if(isFunction(obj))return obj;if(isArray(obj)){for(var copy=[],i=0,len=obj.length;i<len;i++)copy[i]=clone(obj[i]);return copy}if(isObject(obj)){if(obj instanceof Date){var _copy=new Date;return _copy.setTime(obj.getTime()),_copy}if("undefined"!=typeof Element&&obj instanceof Element)return obj;if("undefined"!=typeof HTMLDocument&&obj instanceof HTMLDocument)return obj;if("undefined"!=typeof DocumentFragment&&obj instanceof DocumentFragment)return obj;if(obj===getGlobal())return obj;if("undefined"!=typeof globalContext&&obj===globalContext)return obj;if("undefined"!=typeof window&&obj===window)return obj;if("undefined"!=typeof document&&obj===document)return obj;if("undefined"!=typeof navigator&&obj===navigator)return obj;if("undefined"!=typeof JSON&&obj===JSON)return obj;try{if(obj instanceof Proxy)return obj}catch(e){}return function cloneObject(obj){validateObject(obj);var constructor=null==obj?void 0:obj.constructor;if("function"===typeOf(constructor)){var prototype=null==constructor?void 0:constructor.prototype;if("object"===clone_typeof(prototype)&&prototype.hasOwnProperty("getClone")&&"function"===typeOf(obj.getClone))return obj.getClone()}var copy={};"function"==typeof obj.constructor&&"function"==typeof obj.constructor.call&&(copy=new obj.constructor);for(var key in obj)obj.hasOwnProperty(key)&&(isPrimitive(obj[key])?copy[key]=obj[key]:copy[key]=clone(obj[key]));return copy}(obj)}throw new Error("unable to clone obj! its type isn't supported.")}function stack_typeof(obj){return(stack_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function stack_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function stack_setPrototypeOf(o,p){return(stack_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function stack_createSuper(Derived){var hasNativeReflectConstruct=function stack_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=stack_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=stack_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return stack_possibleConstructorReturn(this,result)}}function stack_possibleConstructorReturn(self,call){if(call&&("object"===stack_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function stack_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function stack_getPrototypeOf(o){return(stack_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Constraints",AbstractOperator),assignToNamespace("Monster.Constraints",function(_AbstractOperator){!function andoperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&andoperator_setPrototypeOf(subClass,superClass)}(AndOperator,_AbstractOperator);var _super=andoperator_createSuper(AndOperator);function AndOperator(){return andoperator_classCallCheck(this,AndOperator),_super.apply(this,arguments)}return function andoperator_createClass(Constructor,protoProps,staticProps){return protoProps&&andoperator_defineProperties(Constructor.prototype,protoProps),staticProps&&andoperator_defineProperties(Constructor,staticProps),Constructor}(AndOperator,[{key:"isValid",value:function isValid(value){return Promise.all([this.operantA.isValid(value),this.operantB.isValid(value)])}}]),AndOperator}(AbstractOperator)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function invalid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&invalid_setPrototypeOf(subClass,superClass)}(Invalid,_AbstractConstraint);var _super=invalid_createSuper(Invalid);function Invalid(){return invalid_classCallCheck(this,Invalid),_super.apply(this,arguments)}return function invalid_createClass(Constructor,protoProps,staticProps){return protoProps&&invalid_defineProperties(Constructor.prototype,protoProps),staticProps&&invalid_defineProperties(Constructor,staticProps),Constructor}(Invalid,[{key:"isValid",value:function isValid(value){return Promise.reject(value)}}]),Invalid}(AbstractConstraint)),assignToNamespace("Monster.Types",isPrimitive,isBoolean,isString,isObject,isArray,isFunction,isIterable,isInteger,isSymbol),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function isarray_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&isarray_setPrototypeOf(subClass,superClass)}(IsArray,_AbstractConstraint);var _super=isarray_createSuper(IsArray);function IsArray(){return isarray_classCallCheck(this,IsArray),_super.apply(this,arguments)}return function isarray_createClass(Constructor,protoProps,staticProps){return protoProps&&isarray_defineProperties(Constructor.prototype,protoProps),staticProps&&isarray_defineProperties(Constructor,staticProps),Constructor}(IsArray,[{key:"isValid",value:function isValid(value){return isArray(value)?Promise.resolve(value):Promise.reject(value)}}]),IsArray}(AbstractConstraint)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function isobject_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&isobject_setPrototypeOf(subClass,superClass)}(IsObject,_AbstractConstraint);var _super=isobject_createSuper(IsObject);function IsObject(){return isobject_classCallCheck(this,IsObject),_super.apply(this,arguments)}return function isobject_createClass(Constructor,protoProps,staticProps){return protoProps&&isobject_defineProperties(Constructor.prototype,protoProps),staticProps&&isobject_defineProperties(Constructor,staticProps),Constructor}(IsObject,[{key:"isValid",value:function isValid(value){return isObject(value)?Promise.resolve(value):Promise.reject(value)}}]),IsObject}(AbstractConstraint)),assignToNamespace("Monster.Constraints",function(_AbstractOperator){!function oroperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&oroperator_setPrototypeOf(subClass,superClass)}(OrOperator,_AbstractOperator);var _super=oroperator_createSuper(OrOperator);function OrOperator(){return oroperator_classCallCheck(this,OrOperator),_super.apply(this,arguments)}return function oroperator_createClass(Constructor,protoProps,staticProps){return protoProps&&oroperator_defineProperties(Constructor.prototype,protoProps),staticProps&&oroperator_defineProperties(Constructor,staticProps),Constructor}(OrOperator,[{key:"isValid",value:function isValid(value){var self=this;return new Promise((function(resolve,reject){var a,b;self.operantA.isValid(value).then((function(){resolve()})).catch((function(){a=!1,!1===b&&reject()})),self.operantB.isValid(value).then((function(){resolve()})).catch((function(){b=!1,!1===a&&reject()}))}))}}]),OrOperator}(AbstractOperator)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function valid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&valid_setPrototypeOf(subClass,superClass)}(Valid,_AbstractConstraint);var _super=valid_createSuper(Valid);function Valid(){return valid_classCallCheck(this,Valid),_super.apply(this,arguments)}return function valid_createClass(Constructor,protoProps,staticProps){return protoProps&&valid_defineProperties(Constructor.prototype,protoProps),staticProps&&valid_defineProperties(Constructor,staticProps),Constructor}(Valid,[{key:"isValid",value:function isValid(value){return Promise.resolve(value)}}]),Valid}(AbstractConstraint)),assignToNamespace("Monster.Types",validatePrimitive,validateBoolean,validateString,validateObject,validateArray,validateFunction,(function validateIterable(value){if(!isIterable(value))throw new TypeError("value is not iterable");return value}),validateInteger),function(){if("object"!==("undefined"==typeof globalThis?"undefined":global_typeof(globalThis)))if("undefined"==typeof self){if("undefined"==typeof window){if(Object.defineProperty(Object.prototype,"__monster__",{get:function get(){return this},configurable:!0}),"object"===("undefined"==typeof __monster__?"undefined":global_typeof(__monster__)))return __monster__.globalThis=__monster__,delete Object.prototype.__monster__,void(globalReference=globalThis);try{globalReference=Function("return this")()}catch(e){}throw new Error("unsupported environment.")}globalReference=window}else globalReference=self;else globalReference=globalThis}(),assignToNamespace("Monster.Types",getGlobal,getGlobalObject,getGlobalFunction),assignToNamespace("Monster.Types",typeOf),assignToNamespace("Monster.Util",clone);var Stack=function(_Base){!function stack_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&stack_setPrototypeOf(subClass,superClass)}(Stack,_Base);var _super=stack_createSuper(Stack);function Stack(){var _this;return function stack_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Stack),(_this=_super.call(this)).data=[],_this}return function stack_createClass(Constructor,protoProps,staticProps){return protoProps&&stack_defineProperties(Constructor.prototype,protoProps),staticProps&&stack_defineProperties(Constructor,staticProps),Constructor}(Stack,[{key:"isEmpty",value:function isEmpty(){return 0===this.data.length}},{key:"peek",value:function peek(){var _this$data;if(!this.isEmpty())return null===(_this$data=this.data)||void 0===_this$data?void 0:_this$data[this.data.length-1]}},{key:"push",value:function push(value){return this.data.push(value),this}},{key:"clear",value:function clear(){return this.data=[],this}},{key:"pop",value:function pop(){if(!this.isEmpty())return this.data.pop()}}]),Stack}(Base);function pathfinder_typeof(obj){return(pathfinder_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _toConsumableArray(arr){return function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}(arr)||function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||_unsupportedIterableToArray(arr)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||_unsupportedIterableToArray(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function pathfinder_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function pathfinder_setPrototypeOf(o,p){return(pathfinder_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function pathfinder_createSuper(Derived){var hasNativeReflectConstruct=function pathfinder_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=pathfinder_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=pathfinder_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return pathfinder_possibleConstructorReturn(this,result)}}function pathfinder_possibleConstructorReturn(self,call){if(call&&("object"===pathfinder_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function pathfinder_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function pathfinder_getPrototypeOf(o){return(pathfinder_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Stack);var Pathfinder=function(_Base){!function pathfinder_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&pathfinder_setPrototypeOf(subClass,superClass)}(Pathfinder,_Base);var _super=pathfinder_createSuper(Pathfinder);function Pathfinder(object){var _this;if(function pathfinder_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Pathfinder),_this=_super.call(this),isPrimitive(object))throw new Error("the parameter must not be a simple type");return _this.object=object,_this.wildCard="*",_this}return function pathfinder_createClass(Constructor,protoProps,staticProps){return protoProps&&pathfinder_defineProperties(Constructor.prototype,protoProps),staticProps&&pathfinder_defineProperties(Constructor,staticProps),Constructor}(Pathfinder,[{key:"setWildCard",value:function setWildCard(wildcard){return validateString(wildcard),this.wildCard=wildcard,this}},{key:"getVia",value:function getVia(path){return getValueViaPath.call(this,this.object,validateString(path))}},{key:"setVia",value:function setVia(path,value){return validateString(path),setValueViaPath.call(this,this.object,path,value),this}},{key:"deleteVia",value:function deleteVia(path){return validateString(path),deleteValueViaPath.call(this,this.object,path),this}},{key:"exists",value:function exists(path){validateString(path);try{return getValueViaPath.call(this,this.object,path,!0),!0}catch(e){}return!1}}]),Pathfinder}(Base);function iterate(subject,path,check){var result=new Map;if(isObject(subject)||isArray(subject))for(var _i=0,_Object$entries=Object.entries(subject);_i<_Object$entries.length;_i++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i],2),key=_Object$entries$_i[0],value=_Object$entries$_i[1];result.set(key,getValueViaPath.call(this,value,path,check))}else{var _key=path.split(".").shift();result.set(_key,getValueViaPath.call(this,subject,path,check))}return result}function getValueViaPath(subject,path,check){if(""===path)return subject;var parts=path.split("."),current=parts.shift();if(current===this.wildCard)return iterate.call(this,subject,parts.join("."),check);if(isObject(subject)||isArray(subject)){var anchor;if(subject instanceof Map||subject instanceof WeakMap)anchor=subject.get(current);else if(subject instanceof Set||subject instanceof WeakSet){var _ref;validateInteger(current=parseInt(current)),anchor=null===(_ref=_toConsumableArray(subject))||void 0===_ref?void 0:_ref[current]}else{if("function"==typeof WeakRef&&subject instanceof WeakRef)throw Error("unsupported action for this data type");isArray(subject)?(validateInteger(current=parseInt(current)),anchor=null==subject?void 0:subject[current]):anchor=null==subject?void 0:subject[current]}if(isObject(anchor)||isArray(anchor))return getValueViaPath.call(this,anchor,parts.join("."),check);if(parts.length>0)throw Error("the journey is not at its end ("+parts.join(".")+")");if(!0===check){var descriptor=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(subject),current);if(!subject.hasOwnProperty(current)&&void 0===descriptor)throw Error("unknown value")}return anchor}throw TypeError("unsupported type "+pathfinder_typeof(subject))}function setValueViaPath(object,path,value){validateString(path);for(var parts=path.split("."),last=parts.pop(),subpath=parts.join("."),stack=new Stack,current=subpath;;){try{getValueViaPath.call(this,object,current,!0);break}catch(e){}if(stack.push(current),parts.pop(),""===(current=parts.join(".")))break}for(;!stack.isEmpty();){current=stack.pop();var obj={};if(!stack.isEmpty()){var n=stack.peek().split(".").pop();isInteger(parseInt(n))&&(obj=[])}setValueViaPath.call(this,object,current,obj)}var anchor=getValueViaPath.call(this,object,subpath);if(!isObject(object)&&!isArray(object))throw TypeError("unsupported type: "+pathfinder_typeof(object));if(anchor instanceof Map||anchor instanceof WeakMap)anchor.set(last,value);else if(anchor instanceof Set||anchor instanceof WeakSet)anchor.append(value);else{if("function"==typeof WeakRef&&anchor instanceof WeakRef)throw Error("unsupported action for this data type");isArray(anchor)?(validateInteger(last=parseInt(last)),assignProperty(anchor,last,value)):assignProperty(anchor,last,value)}}function assignProperty(object,key,value){object.hasOwnProperty(key)?(void 0===value&&delete object[key],object[key]=value):object[key]=value}function deleteValueViaPath(object,path){var parts=path.split("."),last=parts.pop(),subpath=parts.join("."),anchor=getValueViaPath.call(this,object,subpath);if(anchor instanceof Map)anchor.delete(last);else{if(anchor instanceof Set||anchor instanceof WeakMap||anchor instanceof WeakSet||"function"==typeof WeakRef&&anchor instanceof WeakRef)throw Error("unsupported action for this data type");isArray(anchor)?(validateInteger(last=parseInt(last)),delete anchor[last]):delete anchor[last]}}function buildmap_typeof(obj){return(buildmap_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function buildmap_toConsumableArray(arr){return function buildmap_arrayWithoutHoles(arr){if(Array.isArray(arr))return buildmap_arrayLikeToArray(arr)}(arr)||function buildmap_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||buildmap_unsupportedIterableToArray(arr)||function buildmap_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _wrapRegExp(){_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),buildmap_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return buildmap_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==buildmap_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},_wrapRegExp.apply(this,arguments)}function buildmap_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&buildmap_setPrototypeOf(subClass,superClass)}function buildmap_setPrototypeOf(o,p){return(buildmap_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function buildmap_slicedToArray(arr,i){return function buildmap_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function buildmap_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||buildmap_unsupportedIterableToArray(arr,i)||function buildmap_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=buildmap_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function buildmap_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return buildmap_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?buildmap_arrayLikeToArray(o,minLen):void 0}}function buildmap_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}assignToNamespace("Monster.Data",Pathfinder);function buildFlatMap(subject,selector,key,parentMap){var result=this,currentMap=new Map,resultLength=result.size;void 0===key&&(key=[]);var parts=selector.split("."),current="",currentPath=[];do{if(current=parts.shift(),currentPath.push(current),"*"===current){var finder=new Pathfinder(subject),map=void 0;try{map=finder.getVia(currentPath.join("."))}catch(e){map=new Map}var _step,_iterator=_createForOfIteratorHelper(map);try{var _loop=function _loop(){var _step$value=buildmap_slicedToArray(_step.value,2),k=_step$value[0],o=_step$value[1],copyKey=clone(key);currentPath.map((function(a){copyKey.push("*"===a?k:a)}));var kk=copyKey.join("."),sub=buildFlatMap.call(result,o,parts.join("."),copyKey,o);isObject(sub)&&void 0!==parentMap&&(sub["^"]=parentMap),currentMap.set(kk,sub)};for(_iterator.s();!(_step=_iterator.n()).done;)_loop()}catch(err){_iterator.e(err)}finally{_iterator.f()}}}while(parts.length>0);if(resultLength===result.size){var _step2,_iterator2=_createForOfIteratorHelper(currentMap);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _step2$value=buildmap_slicedToArray(_step2.value,2),k=_step2$value[0],o=_step2$value[1];result.set(k,o)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}return subject}function build(subject,definition,defaultValue){if(void 0===definition)return defaultValue||subject;validateString(definition);var regexp=_wrapRegExp(/(\$\{([a-z\^A-Z.\-_0-9]*)\})/gm,{placeholder:1,path:2}),array=buildmap_toConsumableArray(definition.matchAll(regexp)),finder=new Pathfinder(subject);return 0===array.length?finder.getVia(definition):(array.forEach((function(a){var groups=null==a?void 0:a.groups,placeholder=null==groups?void 0:groups.placeholder;if(void 0!==placeholder){var path=null==groups?void 0:groups.path,v=finder.getVia(path);void 0===v&&(v=defaultValue),definition=definition.replaceAll(placeholder,v)}})),definition)}function diff_typeof(obj){return(diff_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function diff(first,second){return doDiff(first,second)}function doDiff(a,b,path,diff){var typeA=typeOf(a),typeB=typeOf(b),currPath=path||[],currDiff=diff||[];if(typeA!==typeB||"object"!==typeA&&"array"!==typeA){var o=function getOperator(a,b){var operator,typeA=diff_typeof(a),typeB=diff_typeof(b);"undefined"===typeA&&"undefined"!==typeB?operator="add":"undefined"!==typeA&&"undefined"===typeB?operator="delete":function isNotEqual(a,b){if(diff_typeof(a)!==diff_typeof(b))return!0;if(a instanceof Date&&b instanceof Date)return a.getTime()!==b.getTime();return a!==b}(a,b)&&(operator="update");return operator}(a,b);void 0!==o&&currDiff.push(buildResult(a,b,o,path))}else(function getKeys(a,b,type){if(isArray(type)){var keys=a.length>b.length?new Array(a.length):new Array(b.length);return keys.fill(0),new Set(keys.map((function(_,i){return i})))}return new Set(Object.keys(a).concat(Object.keys(b)))})(a,b,typeA).forEach((function(v){Object.prototype.hasOwnProperty.call(a,v)?Object.prototype.hasOwnProperty.call(b,v)?doDiff(a[v],b[v],currPath.concat(v),currDiff):currDiff.push(buildResult(a[v],b[v],"delete",currPath.concat(v))):currDiff.push(buildResult(a[v],b[v],"add",currPath.concat(v)))}));return currDiff}function buildResult(a,b,operator,path){var result={operator:operator,path:path};if("add"!==operator&&(result.first={value:a,type:diff_typeof(a)},isObject(a))){var _Object$getPrototypeO,_Object$getPrototypeO2,name=null===(_Object$getPrototypeO=Object.getPrototypeOf(a))||void 0===_Object$getPrototypeO||null===(_Object$getPrototypeO2=_Object$getPrototypeO.constructor)||void 0===_Object$getPrototypeO2?void 0:_Object$getPrototypeO2.name;void 0!==name&&(result.first.instance=name)}if(("add"===operator||"update"===operator)&&(result.second={value:b,type:diff_typeof(b)},isObject(b))){var _Object$getPrototypeO3,_Object$getPrototypeO4,_name=null===(_Object$getPrototypeO3=Object.getPrototypeOf(b))||void 0===_Object$getPrototypeO3||null===(_Object$getPrototypeO4=_Object$getPrototypeO3.constructor)||void 0===_Object$getPrototypeO4?void 0:_Object$getPrototypeO4.name;void 0!==_name&&(result.second.instance=_name)}return result}function extend(){var o,i;for(i=0;i<arguments.length;i++){var a=arguments[i];if(!isObject(a)&&!isArray(a))throw new Error("unsupported argument "+JSON.stringify(a));if(void 0!==o)for(var k in a){var _o,v=null==a?void 0:a[k];if(v!==(null===(_o=o)||void 0===_o?void 0:_o[k]))if(isObject(v)&&"object"===typeOf(v)||isArray(v)){if(void 0===o[k])isArray(v)?o[k]=[]:o[k]={};else if(typeOf(o[k])!==typeOf(v))throw new Error("type mismatch: "+JSON.stringify(o[k])+"("+typeOf(o[k])+") != "+JSON.stringify(v)+"("+typeOf(v)+")");o[k]=extend(o[k],v)}else o[k]=v}else o=a}return o}function id_typeof(obj){return(id_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function id_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function id_setPrototypeOf(o,p){return(id_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function id_createSuper(Derived){var hasNativeReflectConstruct=function id_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=id_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=id_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return id_possibleConstructorReturn(this,result)}}function id_possibleConstructorReturn(self,call){if(call&&("object"===id_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function id_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function id_getPrototypeOf(o){return(id_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",(function buildMap(subject,selector,valueTemplate,keyTemplate,filter){return function assembleParts(subject,selector,filter,callback){var map,result=new Map;if(isFunction(selector)){if(!((map=selector(subject))instanceof Map))throw new TypeError("the selector callback must return a map")}else{if(!isString(selector))throw new TypeError("selector is neither a string nor a function");map=new Map,buildFlatMap.call(map,subject,selector)}if(!(map instanceof Map))return result;return map.forEach((function(v,k,m){isFunction(filter)&&!0!==filter.call(m,v,k)||callback.call(result,v,k,m)})),result}(subject,selector,filter,(function(v,k,m){k=build(v,keyTemplate,k),v=build(v,valueTemplate),this.set(k,v)}))})),assignToNamespace("Monster.Data",diff),assignToNamespace("Monster.Data",extend);var internalCounter=new Map,ID=function(_Base){!function id_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&id_setPrototypeOf(subClass,superClass)}(ID,_Base);var _super=id_createSuper(ID);function ID(prefix){var _this;!function id_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ID),_this=_super.call(this),void 0===prefix&&(prefix="id"),validateString(prefix),internalCounter.has(prefix)||internalCounter.set(prefix,1);var count=internalCounter.get(prefix);return _this.id=prefix+count,internalCounter.set(prefix,++count),_this}return function id_createClass(Constructor,protoProps,staticProps){return protoProps&&id_defineProperties(Constructor.prototype,protoProps),staticProps&&id_defineProperties(Constructor,staticProps),Constructor}(ID,[{key:"toString",value:function toString(){return this.id}}]),ID}(Base);function transformer_toConsumableArray(arr){return function transformer_arrayWithoutHoles(arr){if(Array.isArray(arr))return transformer_arrayLikeToArray(arr)}(arr)||function transformer_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||transformer_unsupportedIterableToArray(arr)||function transformer_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function transformer_typeof(obj){return(transformer_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function transformer_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=transformer_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function transformer_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return transformer_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?transformer_arrayLikeToArray(o,minLen):void 0}}function transformer_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function transformer_wrapRegExp(){transformer_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),transformer_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return transformer_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==transformer_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},transformer_wrapRegExp.apply(this,arguments)}function transformer_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function transformer_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&transformer_setPrototypeOf(subClass,superClass)}function transformer_setPrototypeOf(o,p){return(transformer_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function transformer_createSuper(Derived){var hasNativeReflectConstruct=function transformer_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=transformer_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=transformer_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return transformer_possibleConstructorReturn(this,result)}}function transformer_possibleConstructorReturn(self,call){if(call&&("object"===transformer_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function transformer_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function transformer_getPrototypeOf(o){return(transformer_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",ID);var Transformer=function(_Base){transformer_inherits(Transformer,_Base);var _super=transformer_createSuper(Transformer);function Transformer(definition){var _this;return function transformer_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Transformer),(_this=_super.call(this)).args=function disassemble(command){validateString(command);var _step,placeholder=new Map,regex=transformer_wrapRegExp(/((\\(.)){1})/gim,{pattern:2,char:3}),_iterator=transformer_createForOfIteratorHelper(command.matchAll(regex));try{for(_iterator.s();!(_step=_iterator.n()).done;){var m=_step.value,g=null==m?void 0:m.groups;if(isObject(g)){var p=null==g?void 0:g.pattern,c=null==g?void 0:g.char;if(p&&c){var r="__"+(new ID).toString()+"__";placeholder.set(r,c),command=command.replace(p,r)}}}}catch(err){_iterator.e(err)}finally{_iterator.f()}var parts=command.split(":");return parts=parts.map((function(value){var _step2,v=value.trim(),_iterator2=transformer_createForOfIteratorHelper(placeholder);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var k=_step2.value;v=v.replace(k[0],k[1])}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return v}))}(definition),_this.command=_this.args.shift(),_this.callbacks=new Map,_this}return function transformer_createClass(Constructor,protoProps,staticProps){return protoProps&&transformer_defineProperties(Constructor.prototype,protoProps),staticProps&&transformer_defineProperties(Constructor,staticProps),Constructor}(Transformer,[{key:"setCallback",value:function setCallback(name,callback,context){return validateString(name),validateFunction(callback),void 0!==context&&validateObject(context),this.callbacks.set(name,{callback:callback,context:context}),this}},{key:"run",value:function run(value){return transform.apply(this,[value])}}]),Transformer}(Base);function convertToString(value){return isObject(value)&&value.hasOwnProperty("toString")&&(value=value.toString()),validateString(value),value}function transform(value){var _callback,key,defaultValue,console=getGlobalObject("console"),args=clone(this.args);switch(this.command){case"static":return this.args.join(":");case"tolower":case"strtolower":case"tolowercase":return validateString(value),value.toLowerCase();case"toupper":case"strtoupper":case"touppercase":return validateString(value),value.toUpperCase();case"tostring":return""+value;case"tointeger":var n=parseInt(value);return validateInteger(n),n;case"tojson":return JSON.stringify(value);case"fromjson":return JSON.parse(value);case"trim":return validateString(value),value.trim();case"rawurlencode":return validateString(value),encodeURIComponent(value).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A");case"call":var callback,callbackName=args.shift(),context=getGlobal();if(isObject(value)&&value.hasOwnProperty(callbackName))callback=value[callbackName];else if(this.callbacks.has(callbackName)){var s=this.callbacks.get(callbackName);callback=null==s?void 0:s.callback,context=null==s?void 0:s.context}else"object"===("undefined"==typeof window?"undefined":transformer_typeof(window))&&window.hasOwnProperty(callbackName)&&(callback=window[callbackName]);return validateFunction(callback),args.unshift(value),(_callback=callback).call.apply(_callback,[context].concat(transformer_toConsumableArray(args)));case"plain":case"plaintext":return validateString(value),(new DOMParser).parseFromString(value,"text/html").body.textContent||"";case"if":case"?":validatePrimitive(value);var trueStatement=args.shift()||void 0,falseStatement=args.shift()||void 0;return"value"===trueStatement&&(trueStatement=value),"\\value"===trueStatement&&(trueStatement="value"),"value"===falseStatement&&(falseStatement=value),"\\value"===falseStatement&&(falseStatement="value"),void 0!==value&&""!==value&&"off"!==value&&"false"!==value&&!1!==value||"on"===value||"true"===value||!0===value?trueStatement:falseStatement;case"ucfirst":return validateString(value),value.charAt(0).toUpperCase()+value.substr(1);case"ucwords":return validateString(value),value.replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g,(function(v){return v.toUpperCase()}));case"count":case"length":if((isString(value)||isObject(value)||isArray(value))&&value.hasOwnProperty("length"))return value.length;throw new TypeError("unsupported type "+transformer_typeof(value));case"to-base64":case"btoa":case"base64":return btoa(convertToString(value));case"atob":case"from-base64":return atob(convertToString(value));case"empty":return"";case"undefined":return;case"debug":return isObject(console)&&console.log(value),value;case"prefix":return validateString(value),(null==args?void 0:args[0])+value;case"suffix":return validateString(value),value+(null==args?void 0:args[0]);case"uniqid":return(new ID).toString();case"first-key":case"last-key":case"nth-last-key":case"nth-key":if(!isObject(value))throw new Error("type not supported");var keys=Object.keys(value).sort();"first-key"===this.command?key=0:"last-key"===this.command?key=keys.length-1:(key=validateInteger(parseInt(args.shift())),"nth-last-key"===this.command&&(key=keys.length-key-1)),defaultValue=args.shift()||"";var useKey=null==keys?void 0:keys[key];return null!=value&&value[useKey]?null==value?void 0:value[useKey]:defaultValue;case"key":case"property":case"index":if(void 0===(key=args.shift()||void 0))throw new Error("missing key parameter");if(defaultValue=args.shift()||void 0,value instanceof Map)return value.has(key)?value.get(key):defaultValue;if(isObject(value)||isArray(value))return null!=value&&value[key]?null==value?void 0:value[key]:defaultValue;throw new Error("type not supported");case"path-exists":if(void 0===(key=args.shift()))throw new Error("missing key parameter");return new Pathfinder(value).exists(key);case"path":if(void 0===(key=args.shift()))throw new Error("missing key parameter");var pf=new Pathfinder(value);if(!pf.exists(key))return;return pf.getVia(key);case"substring":validateString(value);var start=parseInt(args[0])||0,end=(parseInt(args[1])||0)+start;return value.substring(start,end);case"nop":return value;case"??":case"default":if(null!=value)return value;defaultValue=args.shift();var defaultType=args.shift();switch(void 0===defaultType&&(defaultType="string"),defaultType){case"int":case"integer":return parseInt(defaultValue);case"float":return parseFloat(defaultValue);case"undefined":return;case"bool":case"boolean":return"undefined"!==(defaultValue=defaultValue.toLowerCase())&&""!==defaultValue&&"off"!==defaultValue&&"false"!==defaultValue&&"false"!==defaultValue||"on"===defaultValue||"true"===defaultValue||"true"===defaultValue;case"string":return""+defaultValue;case"object":return JSON.parse(atob(defaultValue))}throw new Error("type not supported");default:throw new Error("unknown command "+this.command)}return value}function pipe_typeof(obj){return(pipe_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function pipe_slicedToArray(arr,i){return function pipe_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function pipe_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function pipe_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return pipe_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pipe_arrayLikeToArray(o,minLen)}(arr,i)||function pipe_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pipe_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function pipe_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function pipe_setPrototypeOf(o,p){return(pipe_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function pipe_createSuper(Derived){var hasNativeReflectConstruct=function pipe_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=pipe_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=pipe_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return pipe_possibleConstructorReturn(this,result)}}function pipe_possibleConstructorReturn(self,call){if(call&&("object"===pipe_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function pipe_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function pipe_getPrototypeOf(o){return(pipe_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",Transformer);var Pipe=function(_Base){!function pipe_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&pipe_setPrototypeOf(subClass,superClass)}(Pipe,_Base);var _super=pipe_createSuper(Pipe);function Pipe(pipe){var _this;return function pipe_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Pipe),_this=_super.call(this),validateString(pipe),_this.pipe=pipe.split("|").map((function(v){return new Transformer(v)})),_this}return function pipe_createClass(Constructor,protoProps,staticProps){return protoProps&&pipe_defineProperties(Constructor.prototype,protoProps),staticProps&&pipe_defineProperties(Constructor,staticProps),Constructor}(Pipe,[{key:"setCallback",value:function setCallback(name,callback,context){for(var _i=0,_Object$entries=Object.entries(this.pipe);_i<_Object$entries.length;_i++){pipe_slicedToArray(_Object$entries[_i],2)[1].setCallback(name,callback,context)}return this}},{key:"run",value:function run(value){return this.pipe.reduce((function(accumulator,transformer,currentIndex,array){return transformer.run(accumulator)}),value)}}]),Pipe}(Base);function tokenlist_typeof(obj){return(tokenlist_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function tokenlist_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function tokenlist_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return tokenlist_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tokenlist_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function tokenlist_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function tokenlist_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function tokenlist_setPrototypeOf(o,p){return(tokenlist_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function tokenlist_createSuper(Derived){var hasNativeReflectConstruct=function tokenlist_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=tokenlist_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=tokenlist_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return tokenlist_possibleConstructorReturn(this,result)}}function tokenlist_possibleConstructorReturn(self,call){if(call&&("object"===tokenlist_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function tokenlist_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function tokenlist_getPrototypeOf(o){return(tokenlist_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",Pipe);var TokenList=function(_Base,_Symbol$iterator){!function tokenlist_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&tokenlist_setPrototypeOf(subClass,superClass)}(TokenList,_Base);var _super=tokenlist_createSuper(TokenList);function TokenList(init){var _this;return function tokenlist_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,TokenList),(_this=_super.call(this)).tokens=new Set,void 0!==init&&_this.add(init),_this}return function tokenlist_createClass(Constructor,protoProps,staticProps){return protoProps&&tokenlist_defineProperties(Constructor.prototype,protoProps),staticProps&&tokenlist_defineProperties(Constructor,staticProps),Constructor}(TokenList,[{key:"getIterator",value:function getIterator(){return this[Symbol.iterator]()}},{key:_Symbol$iterator,value:function value(){var index=0,entries=this.entries();return{next:function next(){return index<entries.length?{value:null==entries?void 0:entries[index++],done:!1}:{done:!0}}}}},{key:"contains",value:function contains(value){var _this2=this;if(isString(value)){value=value.trim();var counter=0;return value.split(" ").forEach((function(token){if(!1===_this2.tokens.has(token.trim()))return!1;counter++})),counter>0}if(isIterable(value)){var _step,_counter=0,_iterator=tokenlist_createForOfIteratorHelper(value);try{for(_iterator.s();!(_step=_iterator.n()).done;){var token=_step.value;if(validateString(token),!1===this.tokens.has(token.trim()))return!1;_counter++}}catch(err){_iterator.e(err)}finally{_iterator.f()}return _counter>0}return!1}},{key:"add",value:function add(value){var _this3=this;if(isString(value))value.split(" ").forEach((function(token){_this3.tokens.add(token.trim())}));else if(isIterable(value)){var _step2,_iterator2=tokenlist_createForOfIteratorHelper(value);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var token=_step2.value;validateString(token),this.tokens.add(token.trim())}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}else if(void 0!==value)throw new TypeError("unsupported value");return this}},{key:"clear",value:function clear(){return this.tokens.clear(),this}},{key:"remove",value:function remove(value){var _this4=this;if(isString(value))value.split(" ").forEach((function(token){_this4.tokens.delete(token.trim())}));else if(isIterable(value)){var _step3,_iterator3=tokenlist_createForOfIteratorHelper(value);try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var token=_step3.value;validateString(token),this.tokens.delete(token.trim())}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}else if(void 0!==value)throw new TypeError("unsupported value","types/tokenlist.js");return this}},{key:"replace",value:function replace(token,newToken){if(validateString(token),validateString(newToken),!this.contains(token))return this;var a=Array.from(this.tokens),i=a.indexOf(token);return-1===i||(a.splice(i,1,newToken),this.tokens=new Set,this.add(a)),this}},{key:"toggle",value:function toggle(value){var _this5=this;if(isString(value))value.split(" ").forEach((function(token){toggleValue.call(_this5,token)}));else if(isIterable(value)){var _step4,_iterator4=tokenlist_createForOfIteratorHelper(value);try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var token=_step4.value;toggleValue.call(this,token)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}else if(void 0!==value)throw new TypeError("unsupported value","types/tokenlist.js");return this}},{key:"entries",value:function entries(){return Array.from(this.tokens)}},{key:"forEach",value:function forEach(callback){return validateFunction(callback),this.tokens.forEach(callback),this}},{key:"toString",value:function toString(){return this.entries().join(" ")}}]),TokenList}(Base,Symbol.iterator);function toggleValue(token){if(!(this instanceof TokenList))throw Error("must be called with TokenList.call");return validateString(token),token=token.trim(),this.contains(token)?(this.remove(token),this):(this.add(token),this)}function queue_typeof(obj){return(queue_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function queue_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function queue_setPrototypeOf(o,p){return(queue_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function queue_createSuper(Derived){var hasNativeReflectConstruct=function queue_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=queue_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=queue_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return queue_possibleConstructorReturn(this,result)}}function queue_possibleConstructorReturn(self,call){if(call&&("object"===queue_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function queue_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function queue_getPrototypeOf(o){return(queue_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",TokenList);var Queue=function(_Base){!function queue_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&queue_setPrototypeOf(subClass,superClass)}(Queue,_Base);var _super=queue_createSuper(Queue);function Queue(){var _this;return function queue_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Queue),(_this=_super.call(this)).data=[],_this}return function queue_createClass(Constructor,protoProps,staticProps){return protoProps&&queue_defineProperties(Constructor.prototype,protoProps),staticProps&&queue_defineProperties(Constructor,staticProps),Constructor}(Queue,[{key:"isEmpty",value:function isEmpty(){return 0===this.data.length}},{key:"peek",value:function peek(){if(!this.isEmpty())return this.data[0]}},{key:"add",value:function add(value){return this.data.push(value),this}},{key:"clear",value:function clear(){return this.data=[],this}},{key:"poll",value:function poll(){if(!this.isEmpty())return this.data.shift()}}]),Queue}(Base);function uniquequeue_typeof(obj){return(uniquequeue_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function uniquequeue_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _get(target,property,receiver){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function _superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=uniquequeue_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function uniquequeue_setPrototypeOf(o,p){return(uniquequeue_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function uniquequeue_createSuper(Derived){var hasNativeReflectConstruct=function uniquequeue_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=uniquequeue_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=uniquequeue_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return uniquequeue_possibleConstructorReturn(this,result)}}function uniquequeue_possibleConstructorReturn(self,call){if(call&&("object"===uniquequeue_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function uniquequeue_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function uniquequeue_getPrototypeOf(o){return(uniquequeue_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Queue);var UniqueQueue=function(_Queue){!function uniquequeue_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&uniquequeue_setPrototypeOf(subClass,superClass)}(UniqueQueue,_Queue);var _super=uniquequeue_createSuper(UniqueQueue);function UniqueQueue(){var _this;return function uniquequeue_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UniqueQueue),(_this=_super.call(this)).unique=new WeakSet,_this}return function uniquequeue_createClass(Constructor,protoProps,staticProps){return protoProps&&uniquequeue_defineProperties(Constructor.prototype,protoProps),staticProps&&uniquequeue_defineProperties(Constructor,staticProps),Constructor}(UniqueQueue,[{key:"add",value:function add(value){return validateObject(value),this.unique.has(value)||(this.unique.add(value),_get(uniquequeue_getPrototypeOf(UniqueQueue.prototype),"add",this).call(this,value)),this}},{key:"clear",value:function clear(){return _get(uniquequeue_getPrototypeOf(UniqueQueue.prototype),"clear",this).call(this),this.unique=new WeakSet,this}},{key:"poll",value:function poll(){if(!this.isEmpty()){var value=this.data.shift();return this.unique.delete(value),value}}}]),UniqueQueue}(Queue);function observer_typeof(obj){return(observer_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function observer_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function observer_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function observer_setPrototypeOf(o,p){return(observer_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function observer_createSuper(Derived){var hasNativeReflectConstruct=function observer_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=observer_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=observer_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return observer_possibleConstructorReturn(this,result)}}function observer_possibleConstructorReturn(self,call){if(call&&("object"===observer_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function observer_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function observer_getPrototypeOf(o){return(observer_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",UniqueQueue);var Observer=function(_Base){!function observer_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&observer_setPrototypeOf(subClass,superClass)}(Observer,_Base);var _super=observer_createSuper(Observer);function Observer(callback){var _this;if(observer_classCallCheck(this,Observer),_this=_super.call(this),"function"!=typeof callback)throw new Error("observer callback must be a function");_this.callback=callback;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return _this.arguments=args,_this.tags=new TokenList,_this.queue=new UniqueQueue,_this}return function observer_createClass(Constructor,protoProps,staticProps){return protoProps&&observer_defineProperties(Constructor.prototype,protoProps),staticProps&&observer_defineProperties(Constructor,staticProps),Constructor}(Observer,[{key:"addTag",value:function addTag(tag){return this.tags.add(tag),this}},{key:"removeTag",value:function removeTag(tag){return this.tags.remove(tag),this}},{key:"getTags",value:function getTags(){return this.tags.entries()}},{key:"hasTag",value:function hasTag(tag){return this.tags.contains(tag)}},{key:"update",value:function update(subject){var self=this;return new Promise((function(resolve,reject){isObject(subject)?(self.queue.add(subject),setTimeout((function(){try{if(self.queue.isEmpty())return void resolve();var s=self.queue.poll(),result=self.callback.apply(s,self.arguments);if(isObject(result)&&result instanceof Promise)return void result.then(resolve).catch(reject);resolve(result)}catch(e){reject(e)}}),0)):reject("subject must be an object")}))}}]),Observer}(Base);function observerlist_typeof(obj){return(observerlist_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function observerlist_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function observerlist_setPrototypeOf(o,p){return(observerlist_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function observerlist_createSuper(Derived){var hasNativeReflectConstruct=function observerlist_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=observerlist_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=observerlist_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return observerlist_possibleConstructorReturn(this,result)}}function observerlist_possibleConstructorReturn(self,call){if(call&&("object"===observerlist_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function observerlist_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function observerlist_getPrototypeOf(o){return(observerlist_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Observer);var ObserverList=function(_Base){!function observerlist_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&observerlist_setPrototypeOf(subClass,superClass)}(ObserverList,_Base);var _super=observerlist_createSuper(ObserverList);function ObserverList(){var _this;return function observerlist_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ObserverList),(_this=_super.call(this)).observers=[],_this}return function observerlist_createClass(Constructor,protoProps,staticProps){return protoProps&&observerlist_defineProperties(Constructor.prototype,protoProps),staticProps&&observerlist_defineProperties(Constructor,staticProps),Constructor}(ObserverList,[{key:"attach",value:function attach(observer){return validateInstance(observer,Observer),this.observers.push(observer),this}},{key:"detach",value:function detach(observer){validateInstance(observer,Observer);for(var i=0,l=this.observers.length;i<l;i++)this.observers[i]===observer&&this.observers.splice(i,1);return this}},{key:"contains",value:function contains(observer){validateInstance(observer,Observer);for(var i=0,l=this.observers.length;i<l;i++)if(this.observers[i]===observer)return!0;return!1}},{key:"notify",value:function notify(subject){for(var pomises=[],i=0,l=this.observers.length;i<l;i++)pomises.push(this.observers[i].update(subject));return Promise.all(pomises)}}]),ObserverList}(Base);function proxyobserver_typeof(obj){return(proxyobserver_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function proxyobserver_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function proxyobserver_setPrototypeOf(o,p){return(proxyobserver_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function proxyobserver_createSuper(Derived){var hasNativeReflectConstruct=function proxyobserver_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=proxyobserver_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=proxyobserver_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return proxyobserver_possibleConstructorReturn(this,result)}}function proxyobserver_possibleConstructorReturn(self,call){if(call&&("object"===proxyobserver_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return proxyobserver_assertThisInitialized(self)}function proxyobserver_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function proxyobserver_getPrototypeOf(o){return(proxyobserver_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",ObserverList);var ProxyObserver=function(_Base){!function proxyobserver_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&proxyobserver_setPrototypeOf(subClass,superClass)}(ProxyObserver,_Base);var _super=proxyobserver_createSuper(ProxyObserver);function ProxyObserver(object){var _this;return function proxyobserver_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ProxyObserver),(_this=_super.call(this)).realSubject=validateObject(object),_this.subject=new Proxy(object,getHandler.call(proxyobserver_assertThisInitialized(_this))),_this.objectMap=new WeakMap,_this.objectMap.set(_this.realSubject,_this.subject),_this.proxyMap=new WeakMap,_this.proxyMap.set(_this.subject,_this.realSubject),_this.observers=new ObserverList,_this}return function proxyobserver_createClass(Constructor,protoProps,staticProps){return protoProps&&proxyobserver_defineProperties(Constructor.prototype,protoProps),staticProps&&proxyobserver_defineProperties(Constructor,staticProps),Constructor}(ProxyObserver,[{key:"getSubject",value:function getSubject(){return this.subject}},{key:"setSubject",value:function setSubject(obj){var i,k=Object.keys(this.subject);for(i=0;i<k.length;i++)delete this.subject[k[i]];return this.subject=extend(this.subject,obj),this}},{key:"getRealSubject",value:function getRealSubject(){return this.realSubject}},{key:"attachObserver",value:function attachObserver(observer){return this.observers.attach(observer),this}},{key:"detachObserver",value:function detachObserver(observer){return this.observers.detach(observer),this}},{key:"notifyObservers",value:function notifyObservers(){return this.observers.notify(this)}},{key:"containsObserver",value:function containsObserver(observer){return this.observers.contains(observer)}}]),ProxyObserver}(Base);function getHandler(){var proxy=this,handler={get:function get(target,key,receiver){var value=Reflect.get(target,key,receiver);if("symbol"===proxyobserver_typeof(key))return value;if(isPrimitive(value))return value;if(isArray(value)||isObject(value)){if(proxy.objectMap.has(value))return proxy.objectMap.get(value);if(proxy.proxyMap.has(value))return value;var p=new Proxy(value,handler);return proxy.objectMap.set(value,p),proxy.proxyMap.set(p,value),p}return value},set:function set(target,key,value,receiver){proxy.proxyMap.has(value)&&(value=proxy.proxyMap.get(value)),proxy.proxyMap.has(target)&&(target=proxy.proxyMap.get(target));var result,current=Reflect.get(target,key,receiver);if(proxy.proxyMap.has(current)&&(current=proxy.proxyMap.get(current)),current===value)return!0;var descriptor=Reflect.getOwnPropertyDescriptor(target,key);return void 0===descriptor&&(descriptor={writable:!0,enumerable:!0,configurable:!0}),descriptor.value=value,result=Reflect.defineProperty(target,key,descriptor),"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result},deleteProperty:function deleteProperty(target,key){return key in target&&(delete target[key],"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),!0)},defineProperty:function defineProperty(target,key,descriptor){var result=Reflect.defineProperty(target,key,descriptor);return"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result},setPrototypeOf:function setPrototypeOf(target,key){var result=Reflect.setPrototypeOf(object1,key);return"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result}};return handler}function assembler_typeof(obj){return(assembler_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function assembler_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function assembler_setPrototypeOf(o,p){return(assembler_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function assembler_createSuper(Derived){var hasNativeReflectConstruct=function assembler_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=assembler_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=assembler_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return assembler_possibleConstructorReturn(this,result)}}function assembler_possibleConstructorReturn(self,call){if(call&&("object"===assembler_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function assembler_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function assembler_getPrototypeOf(o){return(assembler_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",ProxyObserver);assignToNamespace("Monster.DOM",function(_Base){!function assembler_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&assembler_setPrototypeOf(subClass,superClass)}(Assembler,_Base);var _super=assembler_createSuper(Assembler);function Assembler(fragment){var _this;return function assembler_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Assembler),(_this=_super.call(this)).attributePrefix="data-monster-",validateInstance(fragment,getGlobalFunction("DocumentFragment")),_this.fragment=fragment,_this}return function assembler_createClass(Constructor,protoProps,staticProps){return protoProps&&assembler_defineProperties(Constructor.prototype,protoProps),staticProps&&assembler_defineProperties(Constructor,staticProps),Constructor}(Assembler,[{key:"setAttributePrefix",value:function setAttributePrefix(prefix){return validateString(prefix),this.attributePrefix=prefix,this}},{key:"getAttributePrefix",value:function getAttributePrefix(){return this.attributePrefix}},{key:"createDocumentFragment",value:function createDocumentFragment(data){return void 0===data&&(data=new ProxyObserver({})),validateInstance(data,ProxyObserver),this.fragment.cloneNode(!0)}}]),Assembler}(Base));var objectUpdaterLinkSymbol=Symbol("monsterUpdater");function addToObjectLink(element,symbol,object){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol])&&(element[symbol]=new Set),addAttributeToken(element,"data-monster-objectlink",symbol.toString()),element[symbol].add(object),element}function hasObjectLink(element,symbol){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0!==(null==element?void 0:element[symbol])&&containsAttributeToken(element,"data-monster-objectlink",symbol.toString())}function getLinkedObjects(element,symbol){if(validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol]))throw new Error("there is no object link for "+symbol.toString());return null==element?void 0:element[symbol][Symbol.iterator]()}function addAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).add(token).toString()),element):(element.setAttribute(key,token),element)}function removeAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).remove(token).toString()),element):element}function containsAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),!!element.hasAttribute(key)&&new TokenList(element.getAttribute(key)).contains(token)}function findClosestByAttribute(element,key,value){if(validateInstance(element,getGlobalFunction("HTMLElement")),element.hasAttribute(key)){if(void 0===value)return element;if(element.getAttribute(key)===value)return element}var selector=validateString(key);void 0!==value&&(selector+="="+validateString(value));var result=element.closest("["+selector+"]");if(result instanceof HTMLElement)return result}function mediatype_typeof(obj){return(mediatype_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function mediatype_wrapRegExp(){mediatype_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),mediatype_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return mediatype_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==mediatype_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},mediatype_wrapRegExp.apply(this,arguments)}function mediatype_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function mediatype_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return mediatype_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mediatype_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function mediatype_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function mediatype_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function mediatype_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&mediatype_setPrototypeOf(subClass,superClass)}function mediatype_setPrototypeOf(o,p){return(mediatype_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function mediatype_createSuper(Derived){var hasNativeReflectConstruct=function mediatype_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=mediatype_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=mediatype_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return mediatype_possibleConstructorReturn(this,result)}}function mediatype_possibleConstructorReturn(self,call){if(call&&("object"===mediatype_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function mediatype_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function mediatype_getPrototypeOf(o){return(mediatype_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",(function findClosestByClass(element,className){var _element$classList;if(validateInstance(element,getGlobalFunction("HTMLElement")),null!=element&&null!==(_element$classList=element.classList)&&void 0!==_element$classList&&_element$classList.contains(validateString(className)))return element;var result=element.closest("."+className);return result instanceof HTMLElement?result:void 0}),getLinkedObjects,addToObjectLink,(function removeObjectLink(element,symbol){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol])||(removeAttributeToken(element,"data-monster-objectlink",symbol.toString()),delete element[symbol]),element}),findClosestByAttribute,hasObjectLink,(function clearAttributeTokens(element,key){return validateInstance(element,HTMLElement),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,""),element):element}),(function replaceAttributeToken(element,key,from,to){return validateInstance(element,HTMLElement),validateString(from),validateString(to),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).replace(from,to).toString()),element):element}),containsAttributeToken,removeAttributeToken,addAttributeToken,(function toggleAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).toggle(token).toString()),element):(element.setAttribute(key,token),element)}));var internal=Symbol("internal"),MediaType=function(_Base){mediatype_inherits(MediaType,_Base);var _super=mediatype_createSuper(MediaType);function MediaType(type,subtype,parameter){var _this;return function mediatype_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,MediaType),(_this=_super.call(this))[internal]={type:validateString(type).toLowerCase(),subtype:validateString(subtype).toLowerCase(),parameter:[]},void 0!==parameter&&(_this[internal].parameter=validateArray(parameter)),_this}return function mediatype_createClass(Constructor,protoProps,staticProps){return protoProps&&mediatype_defineProperties(Constructor.prototype,protoProps),staticProps&&mediatype_defineProperties(Constructor,staticProps),Constructor}(MediaType,[{key:"type",get:function get(){return this[internal].type}},{key:"subtype",get:function get(){return this[internal].subtype}},{key:"parameter",get:function get(){var result=new Map;return this[internal].parameter.forEach((function(p){var value=p.value;value.startsWith('"')&&value.endsWith('"')&&(value=value.substring(1,value.length-1)),result.set(p.key,value)})),result}},{key:"toString",value:function toString(){var _step,parameter=[],_iterator=mediatype_createForOfIteratorHelper(this[internal].parameter);try{for(_iterator.s();!(_step=_iterator.n()).done;){var a=_step.value;parameter.push(a.key+"="+a.value)}}catch(err){_iterator.e(err)}finally{_iterator.f()}return this[internal].type+"/"+this[internal].subtype+(parameter.length>0?";"+parameter.join(";"):"")}}]),MediaType}(Base);function parseMediaType(mediatype){var result=mediatype_wrapRegExp(/([A-Za-z]+|\*)\/(([a-zA-Z0-9.\+_\-]+)|\*|)(\s*;\s*([a-zA-Z0-9]+)\s*(=\s*("?[A-Za-z0-9_\-]+"?))?)*/g,{type:1,subtype:2,parameter:4}).exec(validateString(mediatype)),groups=null==result?void 0:result.groups;if(void 0===groups)throw new TypeError("the mimetype can not be parsed");var type=null==groups?void 0:groups.type,subtype=null==groups?void 0:groups.subtype,parameter=null==groups?void 0:groups.parameter;if(""===subtype||""===type)throw new TypeError("blank value is not allowed");return new MediaType(type,subtype,function parseParameter(parameter){if(!isString(parameter))return;var result=[];return parameter.split(";").forEach((function(entry){if(""!==(entry=entry.trim())){var kv=entry.split("="),key=validateString(null==kv?void 0:kv[0]).trim(),value=validateString(null==kv?void 0:kv[1]).trim();result.push({key:key,value:value})}})),result}(parameter))}function dataurl_typeof(obj){return(dataurl_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function dataurl_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function dataurl_setPrototypeOf(o,p){return(dataurl_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function dataurl_createSuper(Derived){var hasNativeReflectConstruct=function dataurl_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=dataurl_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=dataurl_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return dataurl_possibleConstructorReturn(this,result)}}function dataurl_possibleConstructorReturn(self,call){if(call&&("object"===dataurl_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function dataurl_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function dataurl_getPrototypeOf(o){return(dataurl_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",parseMediaType,MediaType);var dataurl_internal=Symbol("internal"),DataUrl=function(_Base){!function dataurl_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&dataurl_setPrototypeOf(subClass,superClass)}(DataUrl,_Base);var _super=dataurl_createSuper(DataUrl);function DataUrl(content,mediatype,base64){var _this;return function dataurl_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,DataUrl),_this=_super.call(this),isString(mediatype)&&(mediatype=parseMediaType(mediatype)),_this[dataurl_internal]={content:validateString(content),mediatype:validateInstance(mediatype,MediaType),base64:validateBoolean(void 0===base64||base64)},_this}return function dataurl_createClass(Constructor,protoProps,staticProps){return protoProps&&dataurl_defineProperties(Constructor.prototype,protoProps),staticProps&&dataurl_defineProperties(Constructor,staticProps),Constructor}(DataUrl,[{key:"content",get:function get(){return this[dataurl_internal].base64?atob(this[dataurl_internal].content):this[dataurl_internal].content}},{key:"mediatype",get:function get(){return this[dataurl_internal].mediatype}},{key:"toString",value:function toString(){var content=this[dataurl_internal].content;return content=!0===this[dataurl_internal].base64?";base64,"+content:","+encodeURIComponent(content),"data:"+this[dataurl_internal].mediatype.toString()+content}}]),DataUrl}(Base);function parseDataURL(dataurl){if(validateString(dataurl),"data:"!==(dataurl=dataurl.trim()).substring(0,5))throw new TypeError("incorrect or missing data protocol");var p=(dataurl=dataurl.substring(5)).indexOf(",");if(-1===p)throw new TypeError("malformed data url");var content=dataurl.substring(p+1),mediatypeAndBase64=dataurl.substring(0,p).trim(),mediatype="text/plain;charset=US-ASCII",base64Flag=!1;if(""!==mediatypeAndBase64){if(mediatype=mediatypeAndBase64,mediatypeAndBase64.endsWith("base64")){var i=mediatypeAndBase64.lastIndexOf(";");mediatype=mediatypeAndBase64.substring(0,i),base64Flag=!0}else content=decodeURIComponent(content);mediatype=parseMediaType(mediatype)}else content=decodeURIComponent(content);return new DataUrl(content,mediatype,base64Flag)}function theme_typeof(obj){return(theme_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function theme_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function theme_setPrototypeOf(o,p){return(theme_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function theme_createSuper(Derived){var hasNativeReflectConstruct=function theme_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=theme_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=theme_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return theme_possibleConstructorReturn(this,result)}}function theme_possibleConstructorReturn(self,call){if(call&&("object"===theme_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function theme_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function theme_getPrototypeOf(o){return(theme_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",parseDataURL,DataUrl);var Theme=function(_Base){!function theme_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&theme_setPrototypeOf(subClass,superClass)}(Theme,_Base);var _super=theme_createSuper(Theme);function Theme(name){var _this;return function theme_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Theme),_this=_super.call(this),validateString(name),_this.name=name,_this}return function theme_createClass(Constructor,protoProps,staticProps){return protoProps&&theme_defineProperties(Constructor.prototype,protoProps),staticProps&&theme_defineProperties(Constructor,staticProps),Constructor}(Theme,[{key:"getName",value:function getName(){return this.name}}]),Theme}(Base);function getDocumentTheme(){var name="monster",element=getGlobalObject("document").querySelector("html");if(element instanceof HTMLElement){var theme=element.getAttribute("data-monster-theme-name");theme&&(name=theme)}return new Theme(name)}function template_typeof(obj){return(template_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function template_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function template_setPrototypeOf(o,p){return(template_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function template_createSuper(Derived){var hasNativeReflectConstruct=function template_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=template_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=template_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return template_possibleConstructorReturn(this,result)}}function template_possibleConstructorReturn(self,call){if(call&&("object"===template_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function template_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function template_getPrototypeOf(o){return(template_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Theme,getDocumentTheme);var Template=function(_Base){!function template_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&template_setPrototypeOf(subClass,superClass)}(Template,_Base);var _super=template_createSuper(Template);function Template(template){var _this;return function template_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Template),_this=_super.call(this),validateInstance(template,getGlobalFunction("HTMLTemplateElement")),_this.template=template,_this}return function template_createClass(Constructor,protoProps,staticProps){return protoProps&&template_defineProperties(Constructor.prototype,protoProps),staticProps&&template_defineProperties(Constructor,staticProps),Constructor}(Template,[{key:"getTemplateElement",value:function getTemplateElement(){return this.template}},{key:"createDocumentFragment",value:function createDocumentFragment(){return this.template.content.cloneNode(!0)}}]),Template}(Base);function findDocumentTemplate(id,currentNode){validateString(id);var prefixID,template,document=getGlobalObject("document"),HTMLTemplateElement=getGlobalFunction("HTMLTemplateElement"),DocumentFragment=getGlobalFunction("DocumentFragment"),Document=getGlobalFunction("Document");currentNode instanceof Document||currentNode instanceof DocumentFragment||(currentNode instanceof Node&&(currentNode.hasAttribute("data-monster-template-prefix")&&(prefixID=currentNode.getAttribute("data-monster-template-prefix")),(currentNode=currentNode.getRootNode())instanceof Document||currentNode instanceof DocumentFragment||(currentNode=currentNode.ownerDocument)),currentNode instanceof Document||currentNode instanceof DocumentFragment||(currentNode=document));var theme=getDocumentTheme();if(prefixID){var themedPrefixID=prefixID+"-"+id+"-"+theme.getName();if((template=currentNode.getElementById(themedPrefixID))instanceof HTMLTemplateElement)return new Template(template);if((template=document.getElementById(themedPrefixID))instanceof HTMLTemplateElement)return new Template(template)}var themedID=id+"-"+theme.getName();if((template=currentNode.getElementById(themedID))instanceof HTMLTemplateElement)return new Template(template);if((template=document.getElementById(themedID))instanceof HTMLTemplateElement)return new Template(template);if((template=currentNode.getElementById(id))instanceof HTMLTemplateElement)return new Template(template);if((template=document.getElementById(id))instanceof HTMLTemplateElement)return new Template(template);throw new Error("template "+id+" not found.")}function trimspaces_typeof(obj){return(trimspaces_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function trimspaces_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function trimspaces_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return trimspaces_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return trimspaces_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function trimspaces_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function trimspaces_wrapRegExp(){trimspaces_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),trimspaces_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return trimspaces_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==trimspaces_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},trimspaces_wrapRegExp.apply(this,arguments)}function trimspaces_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&trimspaces_setPrototypeOf(subClass,superClass)}function trimspaces_setPrototypeOf(o,p){return(trimspaces_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function trimSpaces(value){validateString(value);var _step,placeholder=new Map,regex=trimspaces_wrapRegExp(/((\\(.)){1})/gim,{pattern:2,char:3}),_iterator=trimspaces_createForOfIteratorHelper(value.matchAll(regex));try{for(_iterator.s();!(_step=_iterator.n()).done;){var m=_step.value,g=null==m?void 0:m.groups;if(isObject(g)){var p=null==g?void 0:g.pattern,c=null==g?void 0:g.char;if(p&&c){var r="__"+(new ID).toString()+"__";placeholder.set(r,c),value=value.replace(p,r)}}}}catch(err){_iterator.e(err)}finally{_iterator.f()}return value=value.trim(),placeholder.forEach((function(v,k){value=value.replace(k,"\\"+v)})),value}function util_typeof(obj){return(util_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function getDocument(){var _getGlobal,document=null===(_getGlobal=getGlobal())||void 0===_getGlobal?void 0:_getGlobal.document;if("object"!==util_typeof(document))throw new Error("not supported environment");return document}function events_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function events_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return events_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return events_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function events_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function findTargetElementFromEvent(event,attributeName,attributeValue){if(validateInstance(event,Event),"function"!=typeof event.composedPath)throw new Error("unsupported event");var path=event.composedPath();if(isArray(path))for(var i=0;i<path.length;i++){var o=path[i];if(o instanceof HTMLElement&&o.hasAttribute(attributeName)&&(void 0===attributeValue||o.getAttribute(attributeName)===attributeValue))return o}}function updater_typeof(obj){return(updater_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function updater_toConsumableArray(arr){return function updater_arrayWithoutHoles(arr){if(Array.isArray(arr))return updater_arrayLikeToArray(arr)}(arr)||function updater_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||updater_unsupportedIterableToArray(arr)||function updater_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function updater_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=updater_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function updater_slicedToArray(arr,i){return function updater_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function updater_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||updater_unsupportedIterableToArray(arr,i)||function updater_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function updater_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return updater_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?updater_arrayLikeToArray(o,minLen):void 0}}function updater_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function updater_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function updater_setPrototypeOf(o,p){return(updater_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function updater_createSuper(Derived){var hasNativeReflectConstruct=function updater_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=updater_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=updater_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return updater_possibleConstructorReturn(this,result)}}function updater_possibleConstructorReturn(self,call){if(call&&("object"===updater_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return updater_assertThisInitialized(self)}function updater_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function updater_getPrototypeOf(o){return(updater_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Template,findDocumentTemplate),assignToNamespace("Monster.Util",trimSpaces),assignToNamespace("Monster.DOM",(function getWindow(){var _getGlobal2,window=null===(_getGlobal2=getGlobal())||void 0===_getGlobal2?void 0:_getGlobal2.window;if("object"!==util_typeof(window))throw new Error("not supported environment");return window}),getDocument,(function getDocumentFragmentFromString(html){validateString(html);var template=getDocument().createElement("template");return template.innerHTML=html,template.content})),assignToNamespace("Monster.DOM",findTargetElementFromEvent,(function fireEvent(element,type){if(getDocument(),element instanceof HTMLElement){if("click"===type)return void element.click();var event=new Event(validateString(type),{bubbles:!0,cancelable:!0});element.dispatchEvent(event)}else{if(!(element instanceof HTMLCollection||element instanceof NodeList))throw new TypeError("value is not an instance of HTMLElement or HTMLCollection");var _step,_iterator=events_createForOfIteratorHelper(element);try{for(_iterator.s();!(_step=_iterator.n()).done;){fireEvent(_step.value,type)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}}),(function fireCustomEvent(element,type,detail){if(getDocument(),element instanceof HTMLElement){isObject(detail)||(detail={detail:detail});var event=new CustomEvent(validateString(type),{bubbles:!0,cancelable:!0,detail:detail});element.dispatchEvent(event)}else{if(!(element instanceof HTMLCollection||element instanceof NodeList))throw new TypeError("value is not an instance of HTMLElement or HTMLCollection");var _step2,_iterator2=events_createForOfIteratorHelper(element);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){fireCustomEvent(_step2.value,type,detail)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}}));var Updater=function(_Base){!function updater_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&updater_setPrototypeOf(subClass,superClass)}(Updater,_Base);var _super=updater_createSuper(Updater);function Updater(element,subject){var _this;return function updater_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Updater),_this=_super.call(this),void 0===subject&&(subject={}),isInstance(subject,ProxyObserver)||(subject=new ProxyObserver(subject)),_this[internalSymbol]={element:validateInstance(element,HTMLElement),last:{},callbacks:new Map,eventTypes:["keyup","click","change","drop","touchend","input"],subject:subject},_this[internalSymbol].callbacks.set("checkstate",getCheckStateCallback.call(updater_assertThisInitialized(_this))),_this[internalSymbol].subject.attachObserver(new Observer((function(){var s=_this[internalSymbol].subject.getRealSubject(),diffResult=diff(_this[internalSymbol].last,s);_this[internalSymbol].last=clone(s);for(var _i=0,_Object$entries=Object.entries(diffResult);_i<_Object$entries.length;_i++){var change=updater_slicedToArray(_Object$entries[_i],2)[1];removeElement.call(updater_assertThisInitialized(_this),change),insertElement.call(updater_assertThisInitialized(_this),change),updateContent.call(updater_assertThisInitialized(_this),change),updateAttributes.call(updater_assertThisInitialized(_this),change)}}))),_this}return function updater_createClass(Constructor,protoProps,staticProps){return protoProps&&updater_defineProperties(Constructor.prototype,protoProps),staticProps&&updater_defineProperties(Constructor,staticProps),Constructor}(Updater,[{key:"setEventTypes",value:function setEventTypes(types){return this[internalSymbol].eventTypes=validateArray(types),this}},{key:"enableEventProcessing",value:function enableEventProcessing(){this.disableEventProcessing();var _step,_iterator=updater_createForOfIteratorHelper(this[internalSymbol].eventTypes);try{for(_iterator.s();!(_step=_iterator.n()).done;){var type=_step.value;this[internalSymbol].element.addEventListener(type,getControlEventHandler.call(this),{capture:!0,passive:!0})}}catch(err){_iterator.e(err)}finally{_iterator.f()}return this}},{key:"disableEventProcessing",value:function disableEventProcessing(){var _step2,_iterator2=updater_createForOfIteratorHelper(this[internalSymbol].eventTypes);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var type=_step2.value;this[internalSymbol].element.removeEventListener(type,getControlEventHandler.call(this))}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return this}},{key:"run",value:function run(){return this[internalSymbol].last={__init__:!0},this[internalSymbol].subject.notifyObservers()}},{key:"retrieve",value:function retrieve(){return retrieveFromBindings.call(this),this}},{key:"getSubject",value:function getSubject(){return this[internalSymbol].subject.getSubject()}},{key:"setCallback",value:function setCallback(name,callback){return this[internalSymbol].callbacks.set(name,callback),this}}]),Updater}(Base);function getCheckStateCallback(){return function(current){if(this instanceof HTMLInputElement){if(-1!==["radio","checkbox"].indexOf(this.type))return this.value+""==current+""?"true":void 0}else if(this instanceof HTMLOptionElement)return isArray(current)&&-1!==current.indexOf(this.value)?"true":void 0}}var symbol=Symbol("EventHandler");function getControlEventHandler(){var self=this;return self[symbol]||(self[symbol]=function(event){var element=findTargetElementFromEvent(event,"data-monster-bind");void 0!==element&&retrieveAndSetValue.call(self,element)}),self[symbol]}function retrieveAndSetValue(element){var _element$constructor,_Object$getOwnPropert,value,pathfinder=new Pathfinder(this[internalSymbol].subject.getSubject()),path=element.getAttribute("data-monster-bind");if(0!==path.indexOf("path:"))throw new Error("the bind argument must start as a value with a path");if(path=path.substr(5),element instanceof HTMLInputElement)switch(element.type){case"checkbox":value=element.checked?element.value:void 0;break;default:value=element.value}else if(element instanceof HTMLTextAreaElement)value=element.value;else if(element instanceof HTMLSelectElement)switch(element.type){case"select-one":value=element.value;break;case"select-multiple":value=element.value;var options=null==element?void 0:element.selectedOptions;void 0===options&&(options=element.querySelectorAll(":scope option:checked")),value=Array.from(options).map((function(_ref){return _ref.value}))}else{if(!(null!=element&&null!==(_element$constructor=element.constructor)&&void 0!==_element$constructor&&_element$constructor.prototype&&null!==(_Object$getOwnPropert=Object.getOwnPropertyDescriptor(element.constructor.prototype,"value"))&&void 0!==_Object$getOwnPropert&&_Object$getOwnPropert.get||element.hasOwnProperty("value")))throw new Error("unsupported object");value=null==element?void 0:element.value}var copy=clone(this[internalSymbol].subject.getRealSubject());new Pathfinder(copy).setVia(path,value),diff(copy,this[internalSymbol].subject.getRealSubject()).length>0&&pathfinder.setVia(path,value)}function retrieveFromBindings(){this[internalSymbol].element.matches("[data-monster-bind]")&&retrieveAndSetValue.call(this,element);var _step3,_iterator3=updater_createForOfIteratorHelper(this[internalSymbol].element.querySelectorAll("[data-monster-bind]").entries());try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _element=updater_slicedToArray(_step3.value,2)[1];retrieveAndSetValue.call(this,_element)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}function removeElement(change){var _step4,_iterator4=updater_createForOfIteratorHelper(this[internalSymbol].element.querySelectorAll(":scope [data-monster-remove]").entries());try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _element2=updater_slicedToArray(_step4.value,2)[1];_element2.parentNode.removeChild(_element2)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}function insertElement(change){for(var self=this,subject=self[internalSymbol].subject.getRealSubject(),mem=(getDocument(),new WeakSet),wd=0,container=self[internalSymbol].element;;){var found=!1;wd++;var p=clone(null==change?void 0:change.path);if(!isArray(p))return self;for(;p.length>0;){var current=p.join("."),iterator=new Set,query='[data-monster-insert*="path:'+current+'"]',e=container.querySelectorAll(query);e.length>0&&(iterator=new Set(updater_toConsumableArray(e))),container.matches(query)&&iterator.add(container);var _step5,_iterator5=updater_createForOfIteratorHelper(iterator.entries());try{var _loop=function _loop(){var containerElement=updater_slicedToArray(_step5.value,2)[1];if(mem.has(containerElement))return"continue";mem.add(containerElement),found=!0;var def=trimSpaces(containerElement.getAttribute("data-monster-insert")),i=def.indexOf(" "),key=trimSpaces(def.substr(0,i)),refPrefix=key+"-",cmd=trimSpaces(def.substr(i));if(cmd.indexOf("|")>0)throw new Error("pipes are not allowed when cloning a node.");var pipe=new Pipe(cmd);self[internalSymbol].callbacks.forEach((function(f,n){pipe.setCallback(n,f)}));var value=void 0;try{containerElement.removeAttribute("data-monster-error"),value=pipe.run(subject)}catch(e){containerElement.setAttribute("data-monster-error",e.message)}var dataPath=cmd.split(":").pop();if(containerElement.hasChildNodes()&&containerElement.lastChild,!isIterable(value))throw new Error("the value is not iterable");for(var available=new Set,_i2=0,_Object$entries2=Object.entries(value);_i2<_Object$entries2.length;_i2++){var _Object$entries2$_i=updater_slicedToArray(_Object$entries2[_i2],2),_i3=_Object$entries2$_i[0],ref=(_Object$entries2$_i[1],refPrefix+_i3),currentPath=dataPath+"."+_i3;available.add(ref);var refElement=containerElement.querySelector('[data-monster-insert-reference="'+ref+'"]');refElement instanceof HTMLElement?refElement:appendNewDocumentFragment(containerElement,key,ref,currentPath)}for(var nodes=containerElement.querySelectorAll('[data-monster-insert-reference*="'+refPrefix+'"]'),_i4=0,_Object$entries3=Object.entries(nodes);_i4<_Object$entries3.length;_i4++){var node=updater_slicedToArray(_Object$entries3[_i4],2)[1];if(!available.has(node.getAttribute("data-monster-insert-reference")))try{containerElement.removeChild(node)}catch(e){containerElement.setAttribute("data-monster-error",(containerElement.getAttribute("data-monster-error")+", "+e.message).trim())}}};for(_iterator5.s();!(_step5=_iterator5.n()).done;)_loop()}catch(err){_iterator5.e(err)}finally{_iterator5.f()}p.pop()}if(!1===found)break;if(wd++>200)throw new Error("the maximum depth for the recursion is reached.")}}function appendNewDocumentFragment(container,key,ref,path){for(var nodes=findDocumentTemplate(key,container).createDocumentFragment(),_i5=0,_Object$entries4=Object.entries(nodes.childNodes);_i5<_Object$entries4.length;_i5++){var node=updater_slicedToArray(_Object$entries4[_i5],2)[1];node instanceof HTMLElement&&(applyRecursive(node,key,path),node.setAttribute("data-monster-insert-reference",ref)),container.appendChild(node)}}function applyRecursive(node,key,path){if(node instanceof HTMLElement){if(node.hasAttribute("data-monster-replace")){var value=node.getAttribute("data-monster-replace");node.setAttribute("data-monster-replace",value.replaceAll("path:"+key,"path:"+path))}if(node.hasAttribute("data-monster-attributes")){var _value=node.getAttribute("data-monster-attributes");node.setAttribute("data-monster-attributes",_value.replaceAll("path:"+key,"path:"+path))}for(var _i6=0,_Object$entries5=Object.entries(node.childNodes);_i6<_Object$entries5.length;_i6++){applyRecursive(updater_slicedToArray(_Object$entries5[_i6],2)[1],key,path)}}}function updateContent(change){var subject=this[internalSymbol].subject.getRealSubject(),p=clone(null==change?void 0:change.path);runUpdateContent.call(this,this[internalSymbol].element,p,subject);var slots=this[internalSymbol].element.querySelectorAll("slot");if(slots.length>0)for(var _i7=0,_Object$entries6=Object.entries(slots);_i7<_Object$entries6.length;_i7++)for(var slot=updater_slicedToArray(_Object$entries6[_i7],2)[1],_i8=0,_Object$entries7=Object.entries(slot.assignedNodes());_i8<_Object$entries7.length;_i8++){var _element3=updater_slicedToArray(_Object$entries7[_i8],2)[1];runUpdateContent.call(this,_element3,p,subject)}}function runUpdateContent(container,parts,subject){var _this2=this;if(isArray(parts)&&container instanceof HTMLElement){parts=clone(parts);for(var mem=new WeakSet;parts.length>0;){var current=parts.join(".");parts.pop();var query='[data-monster-replace^="path:'+current+'"], [data-monster-replace^="static:"]',e=container.querySelectorAll(""+query),iterator=new Set(updater_toConsumableArray(e));container.matches(query)&&iterator.add(container);var _step6,_iterator6=updater_createForOfIteratorHelper(iterator.entries());try{var _loop2=function _loop2(){var element=updater_slicedToArray(_step6.value,1)[0];if(mem.has(element))return{v:void 0};mem.add(element);var cmd=trimSpaces(element.getAttribute("data-monster-replace")),pipe=new Pipe(cmd);_this2[internalSymbol].callbacks.forEach((function(f,n){pipe.setCallback(n,f)}));var value=void 0;try{element.removeAttribute("data-monster-error"),value=pipe.run(subject)}catch(e){element.setAttribute("data-monster-error",e.message)}if(value instanceof HTMLElement){for(;element.firstChild;)element.removeChild(element.firstChild);try{element.appendChild(value)}catch(e){element.setAttribute("data-monster-error",(element.getAttribute("data-monster-error")+", "+e.message).trim())}}else element.innerHTML=value};for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _ret2=_loop2();if("object"===updater_typeof(_ret2))return _ret2.v}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}}}}function updateAttributes(change){var subject=this[internalSymbol].subject.getRealSubject(),p=clone(null==change?void 0:change.path);runUpdateAttributes.call(this,this[internalSymbol].element,p,subject)}function runUpdateAttributes(container,parts,subject){var _this3=this,self=this;if(isArray(parts)){parts=clone(parts);for(var mem=new WeakSet;parts.length>0;){var current=parts.join(".");parts.pop();var iterator=new Set,query='[data-monster-select-this], [data-monster-attributes*="path:'+current+'"], [data-monster-attributes^="static:"]',e=container.querySelectorAll(query);e.length>0&&(iterator=new Set(updater_toConsumableArray(e))),container.matches(query)&&iterator.add(container);var _step7,_iterator7=updater_createForOfIteratorHelper(iterator.entries());try{var _loop3=function _loop3(){var element=updater_slicedToArray(_step7.value,1)[0];if(mem.has(element))return{v:void 0};mem.add(element);for(var attributes=element.getAttribute("data-monster-attributes"),_loop4=function _loop4(){var def=updater_slicedToArray(_Object$entries8[_i9],2)[1],i=(def=trimSpaces(def)).indexOf(" "),name=trimSpaces(def.substr(0,i)),cmd=trimSpaces(def.substr(i)),pipe=new Pipe(cmd);self[internalSymbol].callbacks.forEach((function(f,n){pipe.setCallback(n,f,element)}));var value=void 0;try{element.removeAttribute("data-monster-error"),value=pipe.run(subject)}catch(e){element.setAttribute("data-monster-error",e.message)}void 0===value?element.removeAttribute(name):element.getAttribute(name)!==value&&element.setAttribute(name,value),handleInputControlAttributeUpdate.call(_this3,element,name,value)},_i9=0,_Object$entries8=Object.entries(attributes.split(","));_i9<_Object$entries8.length;_i9++)_loop4()};for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _ret3=_loop3();if("object"===updater_typeof(_ret3))return _ret3.v}}catch(err){_iterator7.e(err)}finally{_iterator7.f()}}}}function handleInputControlAttributeUpdate(element,name,value){if(element instanceof HTMLSelectElement)switch(element.type){case"select-multiple":for(var _i10=0,_Object$entries9=Object.entries(element.options);_i10<_Object$entries9.length;_i10++){var _Object$entries9$_i=updater_slicedToArray(_Object$entries9[_i10],2),opt=(_Object$entries9$_i[0],_Object$entries9$_i[1]);-1!==value.indexOf(opt.value)?opt.selected=!0:opt.selected=!1}break;case"select-one":for(var _i11=0,_Object$entries10=Object.entries(element.options);_i11<_Object$entries10.length;_i11++){var _Object$entries10$_i=updater_slicedToArray(_Object$entries10[_i11],2),_index=_Object$entries10$_i[0];if(_Object$entries10$_i[1].value===value){element.selectedIndex=_index;break}}}else if(element instanceof HTMLInputElement)switch(element.type){case"radio":case"checkbox":"checked"===name&&(element.checked=void 0!==value);break;case"text":default:"value"===name&&(element.value=void 0===value?"":value)}else element instanceof HTMLTextAreaElement&&"value"===name&&(element.value=void 0===value?"":value)}function customelement_typeof(obj){return(customelement_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function customelement_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=customelement_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function customelement_slicedToArray(arr,i){return function customelement_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function customelement_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||customelement_unsupportedIterableToArray(arr,i)||function customelement_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function customelement_toConsumableArray(arr){return function customelement_arrayWithoutHoles(arr){if(Array.isArray(arr))return customelement_arrayLikeToArray(arr)}(arr)||function customelement_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||customelement_unsupportedIterableToArray(arr)||function customelement_nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function customelement_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return customelement_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?customelement_arrayLikeToArray(o,minLen):void 0}}function customelement_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function customelement_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function customelement_possibleConstructorReturn(self,call){if(call&&("object"===customelement_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return customelement_assertThisInitialized(self)}function customelement_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function customelement_wrapNativeSuper(Class){var _cache="function"==typeof Map?new Map:void 0;return(customelement_wrapNativeSuper=function _wrapNativeSuper(Class){if(null===Class||!function customelement_isNativeFunction(fn){return-1!==Function.toString.call(fn).indexOf("[native code]")}(Class))return Class;if("function"!=typeof Class)throw new TypeError("Super expression must either be null or a function");if(void 0!==_cache){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper)}function Wrapper(){return customelement_construct(Class,arguments,customelement_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),customelement_setPrototypeOf(Wrapper,Class)})(Class)}function customelement_construct(Parent,args,Class){return(customelement_construct=customelement_isNativeReflectConstruct()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&customelement_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}function customelement_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function customelement_setPrototypeOf(o,p){return(customelement_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function customelement_getPrototypeOf(o){return(customelement_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Updater);var initMethodSymbol=Symbol("initMethodSymbol"),assembleMethodSymbol=Symbol("assembleMethodSymbol"),attributeObserverSymbol=Symbol("attributeObserver"),CustomElement=function(_HTMLElement){!function customelement_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&customelement_setPrototypeOf(subClass,superClass)}(CustomElement,_HTMLElement);var _super=function customelement_createSuper(Derived){var hasNativeReflectConstruct=customelement_isNativeReflectConstruct();return function _createSuperInternal(){var result,Super=customelement_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=customelement_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return customelement_possibleConstructorReturn(this,result)}}(CustomElement);function CustomElement(){var _this;return function customelement_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CustomElement),(_this=_super.call(this))[internalSymbol]=new ProxyObserver({options:extend({},_this.defaults)}),_this[attributeObserverSymbol]={},initOptionObserver.call(customelement_assertThisInitialized(_this)),_this[initMethodSymbol](),_this}return function customelement_createClass(Constructor,protoProps,staticProps){return protoProps&&customelement_defineProperties(Constructor.prototype,protoProps),staticProps&&customelement_defineProperties(Constructor,staticProps),Constructor}(CustomElement,[{key:"defaults",get:function get(){return{ATTRIBUTE_DISABLED:this.getAttribute("disabled"),shadowMode:"open",delegatesFocus:!0,templates:{main:void 0}}}},{key:"attachObserver",value:function attachObserver(observer){return this[internalSymbol].attachObserver(observer),this}},{key:"detachObserver",value:function detachObserver(observer){return this[internalSymbol].detachObserver(observer),this}},{key:"containsObserver",value:function containsObserver(observer){return this[internalSymbol].containsObserver(observer)}},{key:"getOption",value:function getOption(path,defaultValue){var value;try{value=new Pathfinder(this[internalSymbol].getRealSubject().options).getVia(path)}catch(e){}return void 0===value?defaultValue:value}},{key:"setOption",value:function setOption(path,value){return new Pathfinder(this[internalSymbol].getSubject().options).setVia(path,value),this}},{key:"setOptions",value:function setOptions(options){isString(options)&&(options=parseOptionsJSON.call(this,options));return extend(this[internalSymbol].getSubject().options,this.defaults,options),this}},{key:initMethodSymbol,value:function value(){return this}},{key:assembleMethodSymbol,value:function value(){var elements,nodeList,AttributeOptions=getOptionsFromAttributes.call(this);isObject(AttributeOptions)&&Object.keys(AttributeOptions).length>0&&this.setOptions(AttributeOptions);var ScriptOptions=getOptionsFromScriptTag.call(this);if(isObject(ScriptOptions)&&Object.keys(ScriptOptions).length>0&&this.setOptions(ScriptOptions),!1!==this.getOption("shadowMode",!1)){try{initShadowRoot.call(this),elements=this.shadowRoot.childNodes}catch(e){}try{initCSSStylesheet.call(this)}catch(e){addAttributeToken(this,"data-monster-error",e.toString())}}elements instanceof NodeList||elements instanceof NodeList||(initHtmlContent.call(this),elements=this.childNodes);try{nodeList=new Set([].concat(customelement_toConsumableArray(elements),customelement_toConsumableArray(getSlottedElements.call(this))))}catch(e){nodeList=elements}return assignUpdaterToElement.call(this,nodeList,clone(this[internalSymbol].getRealSubject().options)),this}},{key:"connectedCallback",value:function connectedCallback(){hasObjectLink(this,objectUpdaterLinkSymbol)||this[assembleMethodSymbol]()}},{key:"disconnectedCallback",value:function disconnectedCallback(){}},{key:"adoptedCallback",value:function adoptedCallback(){}},{key:"attributeChangedCallback",value:function attributeChangedCallback(attrName,oldVal,newVal){var _self$attributeObserv,callback=null===(_self$attributeObserv=this[attributeObserverSymbol])||void 0===_self$attributeObserv?void 0:_self$attributeObserv[attrName];isFunction(callback)&&callback.call(this,newVal,oldVal)}},{key:"hasNode",value:function hasNode(node){return!!containChildNode.call(this,validateInstance(node,Node))||this.shadowRoot instanceof ShadowRoot&&containChildNode.call(this.shadowRoot,node)}}],[{key:"observedAttributes",get:function get(){return["data-monster-options","disabled"]}},{key:"getTag",value:function getTag(){throw new Error("the method getTag must be overwritten by the derived class.")}},{key:"getCSSStyleSheet",value:function getCSSStyleSheet(){}}]),CustomElement}(customelement_wrapNativeSuper(HTMLElement));function getSlottedElements(query,name){var result=new Set;if(!(this.shadowRoot instanceof ShadowRoot))return result;var selector="slot";void 0!==name&&(selector+=null===name?":not([name])":"[name="+validateString(name)+"]");for(var slots=this.shadowRoot.querySelectorAll(selector),_i=0,_Object$entries=Object.entries(slots);_i<_Object$entries.length;_i++){customelement_slicedToArray(_Object$entries[_i],2)[1].assignedElements().forEach((function(node){if(node instanceof HTMLElement)if(isString(query))node.querySelectorAll(query).forEach((function(n){result.add(n)})),node.matches(query)&&result.add(node);else{if(void 0!==query)throw new Error("query must be a string");result.add(node)}}))}return result}function containChildNode(node){if(this.contains(node))return!0;for(var _i2=0,_Object$entries2=Object.entries(this.childNodes);_i2<_Object$entries2.length;_i2++){var e=customelement_slicedToArray(_Object$entries2[_i2],2)[1];if(e.contains(node))return!0;containChildNode.call(e,node)}return!1}function initOptionObserver(){var self=this,lastDisabledValue=void 0;self.attachObserver(new Observer((function(){var flag=self.getOption("disabled");if(flag!==lastDisabledValue&&(lastDisabledValue=flag,self.shadowRoot instanceof ShadowRoot)){var nodeList,query="button, command, fieldset, keygen, optgroup, option, select, textarea, input, [data-monster-objectlink]",elements=self.shadowRoot.querySelectorAll(query);try{nodeList=new Set([].concat(customelement_toConsumableArray(elements),customelement_toConsumableArray(getSlottedElements.call(self,query))))}catch(e){nodeList=elements}for(var _i3=0,_arr2=customelement_toConsumableArray(nodeList);_i3<_arr2.length;_i3++){var element=_arr2[_i3];!0===flag?element.setAttribute("disabled",""):element.removeAttribute("disabled")}}}))),self.attachObserver(new Observer((function(){if(hasObjectLink(self,objectUpdaterLinkSymbol)){var _step,_iterator=customelement_createForOfIteratorHelper(getLinkedObjects(self,objectUpdaterLinkSymbol));try{for(_iterator.s();!(_step=_iterator.n()).done;){var _step2,_iterator2=customelement_createForOfIteratorHelper(_step.value);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var updater=_step2.value,d=clone(self[internalSymbol].getRealSubject().options);Object.assign(updater.getSubject(),d)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}}catch(err){_iterator.e(err)}finally{_iterator.f()}}}))),self[attributeObserverSymbol].disabled=function(){self.hasAttribute("disabled")?self.setOption("disabled",!0):self.setOption("disabled",void 0)},self[attributeObserverSymbol]["data-monster-options"]=function(){var options=getOptionsFromAttributes.call(self);isObject(options)&&Object.keys(options).length>0&&self.setOptions(options)},self[attributeObserverSymbol]["data-monster-options-selector"]=function(){var options=getOptionsFromScriptTag.call(self);isObject(options)&&Object.keys(options).length>0&&self.setOptions(options)}}function getOptionsFromScriptTag(){if(!this.hasAttribute("data-monster-options-selector"))return{};var node=document.querySelector(this.getAttribute("data-monster-options-selector"));if(!(node instanceof HTMLScriptElement))return addAttributeToken(this,"data-monster-error","the selector data-monster-options-selector for options was specified ("+this.getAttribute("data-monster-options-selector")+") but not found."),{};var obj={};try{obj=parseOptionsJSON.call(this,node.textContent.trim())}catch(e){addAttributeToken(this,"data-monster-error","when analyzing the configuration from the script tag there was an error. "+e)}return obj}function getOptionsFromAttributes(){if(this.hasAttribute("data-monster-options"))try{return parseOptionsJSON.call(this,this.getAttribute("data-monster-options"))}catch(e){addAttributeToken(this,"data-monster-error","the options attribute data-monster-options does not contain a valid json definition (actual: "+this.getAttribute("data-monster-options")+")."+e)}return{}}function parseOptionsJSON(data){var obj={};if(!isString(data))return obj;try{data=parseDataURL(data).content}catch(e){}try{return validateObject(JSON.parse(data))}catch(e){throw e}return obj}function initHtmlContent(){try{var template=findDocumentTemplate(this.constructor.getTag());this.appendChild(template.createDocumentFragment())}catch(e){var html=this.getOption("templates.main","");isString(html)&&html.length>0&&(this.innerHTML=html)}return this}function initCSSStylesheet(){if(!(this.shadowRoot instanceof ShadowRoot))return this;var styleSheet=this.constructor.getCSSStyleSheet();if(styleSheet instanceof CSSStyleSheet)styleSheet.cssRules.length>0&&(this.shadowRoot.adoptedStyleSheets=[styleSheet]);else if(isArray(styleSheet)){var _step3,assign=[],_iterator3=customelement_createForOfIteratorHelper(styleSheet);try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var s=_step3.value;if(isString(s)){var trimedStyleSheet=s.trim();if(""!==trimedStyleSheet){var style=document.createElement("style");style.innerHTML=trimedStyleSheet,this.shadowRoot.prepend(style)}}else validateInstance(s,CSSStyleSheet),s.cssRules.length>0&&assign.push(s)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}assign.length>0&&(this.shadowRoot.adoptedStyleSheets=assign)}else if(isString(styleSheet)){if(""!==styleSheet.trim()){var _style=document.createElement("style");_style.innerHTML=styleSheet,this.shadowRoot.prepend(_style)}}return this}function initShadowRoot(){var template,html;try{template=findDocumentTemplate(this.constructor.getTag())}catch(e){if(!isString(html=this.getOption("templates.main",""))||void 0===html||""===html)throw new Error("html is not set.")}return this.attachShadow({mode:this.getOption("shadowMode","open"),delegatesFocus:this.getOption("delegatesFocus",!0)}),template instanceof Template?(this.shadowRoot.appendChild(template.createDocumentFragment()),this):(this.shadowRoot.innerHTML=html,this)}function assignUpdaterToElement(elements,object){var updaters=new Set;elements instanceof NodeList&&(elements=new Set(customelement_toConsumableArray(elements)));var result=[];return elements.forEach((function(element){if(element instanceof HTMLElement&&!(element instanceof HTMLTemplateElement)){var u=new Updater(element,object);updaters.add(u),result.push(u.run().then((function(){return u.enableEventProcessing()})))}})),updaters.size>0&&addToObjectLink(this,objectUpdaterLinkSymbol,updaters),result}function customcontrol_typeof(obj){return(customcontrol_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function customcontrol_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function customcontrol_get(target,property,receiver){return(customcontrol_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function customcontrol_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=customcontrol_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function customcontrol_setPrototypeOf(o,p){return(customcontrol_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function customcontrol_createSuper(Derived){var hasNativeReflectConstruct=function customcontrol_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=customcontrol_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=customcontrol_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return customcontrol_possibleConstructorReturn(this,result)}}function customcontrol_possibleConstructorReturn(self,call){if(call&&("object"===customcontrol_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return customcontrol_assertThisInitialized(self)}function customcontrol_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function customcontrol_getPrototypeOf(o){return(customcontrol_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",CustomElement,(function registerCustomElement(element){validateFunction(element),getGlobalObject("customElements").define(element.getTag(),element)}),assignUpdaterToElement);var attachedInternalSymbol=Symbol("attachedInternal");function getInternal(){if(!(attachedInternalSymbol in this))throw new Error("ElementInternals is not supported and a polyfill is necessary");return this[attachedInternalSymbol]}function initObserver(){var self=this;self[attributeObserverSymbol].value=function(){self.setOption("value",self.getAttribute("value"))}}function locale_typeof(obj){return(locale_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function locale_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function locale_setPrototypeOf(o,p){return(locale_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function locale_createSuper(Derived){var hasNativeReflectConstruct=function locale_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=locale_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=locale_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return locale_possibleConstructorReturn(this,result)}}function locale_possibleConstructorReturn(self,call){if(call&&("object"===locale_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function locale_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function locale_getPrototypeOf(o){return(locale_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",function(_CustomElement){!function customcontrol_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&customcontrol_setPrototypeOf(subClass,superClass)}(CustomControl,_CustomElement);var _super=customcontrol_createSuper(CustomControl);function CustomControl(){var _this;return function customcontrol_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CustomControl),"function"==typeof(_this=_super.call(this)).attachInternals&&(_this[attachedInternalSymbol]=_this.attachInternals()),initObserver.call(customcontrol_assertThisInitialized(_this)),_this}return function customcontrol_createClass(Constructor,protoProps,staticProps){return protoProps&&customcontrol_defineProperties(Constructor.prototype,protoProps),staticProps&&customcontrol_defineProperties(Constructor,staticProps),Constructor}(CustomControl,[{key:"defaults",get:function get(){return extend({},customcontrol_get(customcontrol_getPrototypeOf(CustomControl.prototype),"defaults",this))}},{key:"value",get:function get(){throw Error("the value getter must be overwritten by the derived class")},set:function set(value){throw Error("the value setter must be overwritten by the derived class")}},{key:"labels",get:function get(){var _getInternal$call;return null===(_getInternal$call=getInternal.call(this))||void 0===_getInternal$call?void 0:_getInternal$call.labels}},{key:"name",get:function get(){return this.getAttribute("name")}},{key:"type",get:function get(){return this.constructor.getTag()}},{key:"validity",get:function get(){var _getInternal$call2;return null===(_getInternal$call2=getInternal.call(this))||void 0===_getInternal$call2?void 0:_getInternal$call2.validity}},{key:"validationMessage",get:function get(){var _getInternal$call3;return null===(_getInternal$call3=getInternal.call(this))||void 0===_getInternal$call3?void 0:_getInternal$call3.validationMessage}},{key:"willValidate",get:function get(){var _getInternal$call4;return null===(_getInternal$call4=getInternal.call(this))||void 0===_getInternal$call4?void 0:_getInternal$call4.willValidate}},{key:"states",get:function get(){var _getInternal$call5;return null===(_getInternal$call5=getInternal.call(this))||void 0===_getInternal$call5?void 0:_getInternal$call5.states}},{key:"form",get:function get(){var _getInternal$call6;return null===(_getInternal$call6=getInternal.call(this))||void 0===_getInternal$call6?void 0:_getInternal$call6.form}},{key:"setFormValue",value:function setFormValue(value,state){getInternal.call(this).setFormValue(value,state)}},{key:"setValidity",value:function setValidity(flags,message,anchor){getInternal.call(this).setValidity(flags,message,anchor)}},{key:"checkValidity",value:function checkValidity(){var _getInternal$call7;return null===(_getInternal$call7=getInternal.call(this))||void 0===_getInternal$call7?void 0:_getInternal$call7.checkValidity()}},{key:"reportValidity",value:function reportValidity(){var _getInternal$call8;return null===(_getInternal$call8=getInternal.call(this))||void 0===_getInternal$call8?void 0:_getInternal$call8.reportValidity()}}],[{key:"observedAttributes",get:function get(){var list=customcontrol_get(customcontrol_getPrototypeOf(CustomControl),"observedAttributes",this);return list.push("value"),list}},{key:"formAssociated",get:function get(){return!0}}]),CustomControl}(CustomElement));var propertiesSymbol=Symbol("properties"),localeStringSymbol=Symbol("localeString"),Locale=function(_Base){!function locale_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&locale_setPrototypeOf(subClass,superClass)}(Locale,_Base);var _super=locale_createSuper(Locale);function Locale(language,region,script,variants,extlang,privateUse){var _this;!function locale_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Locale),(_this=_super.call(this))[propertiesSymbol]={language:void 0===language?void 0:validateString(language),script:void 0===script?void 0:validateString(script),region:void 0===region?void 0:validateString(region),variants:void 0===variants?void 0:validateString(variants),extlang:void 0===extlang?void 0:validateString(extlang),privateUse:void 0===privateUse?void 0:validateString(privateUse)};var s=[];if(void 0!==language&&s.push(language),void 0!==script&&s.push(script),void 0!==region&&s.push(region),void 0!==variants&&s.push(variants),void 0!==extlang&&s.push(extlang),void 0!==privateUse&&s.push(privateUse),0===s.length)throw new Error("unsupported locale");return _this[localeStringSymbol]=s.join("-"),_this}return function locale_createClass(Constructor,protoProps,staticProps){return protoProps&&locale_defineProperties(Constructor.prototype,protoProps),staticProps&&locale_defineProperties(Constructor,staticProps),Constructor}(Locale,[{key:"localeString",get:function get(){return this[localeStringSymbol]}},{key:"language",get:function get(){return this[propertiesSymbol].language}},{key:"region",get:function get(){return this[propertiesSymbol].region}},{key:"script",get:function get(){return this[propertiesSymbol].script}},{key:"variants",get:function get(){return this[propertiesSymbol].variants}},{key:"extlang",get:function get(){return this[propertiesSymbol].extlang}},{key:"privateUse",get:function get(){return this[propertiesSymbol].privateValue}},{key:"toString",value:function toString(){return""+this.localeString}},{key:"getMap",value:function getMap(){return clone(this[propertiesSymbol])}}]),Locale}(Base);function parseLocale(locale){locale=validateString(locale).replace(/_/g,"-");var language,region,variants,parts,script,extlang,match,regex=new RegExp("^(((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+))$");if(null!==(match=regex.exec(locale))&&match.index===regex.lastIndex&&regex.lastIndex++,null==match)throw new Error("unsupported locale");return void 0!==match[6]&&(parts=(language=match[6]).split("-")).length>1&&(language=parts[0],extlang=parts[1]),void 0!==match[14]&&(region=match[14]),void 0!==match[12]&&(script=match[12]),void 0!==match[16]&&(variants=match[16]),new Locale(language,region,script,variants,extlang)}assignToNamespace("Monster.I18n",Locale,parseLocale);function basewithoptions_typeof(obj){return(basewithoptions_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function basewithoptions_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function basewithoptions_setPrototypeOf(o,p){return(basewithoptions_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function basewithoptions_createSuper(Derived){var hasNativeReflectConstruct=function basewithoptions_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=basewithoptions_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=basewithoptions_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return basewithoptions_possibleConstructorReturn(this,result)}}function basewithoptions_possibleConstructorReturn(self,call){if(call&&("object"===basewithoptions_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function basewithoptions_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function basewithoptions_getPrototypeOf(o){return(basewithoptions_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",(function getLocaleOfDocument(){var html=getDocument().querySelector("html");if(html instanceof HTMLElement&&html.hasAttribute("lang")){var locale=html.getAttribute("lang");if(locale)return new parseLocale(locale)}return parseLocale("en")}));var BaseWithOptions=function(_Base){!function basewithoptions_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&basewithoptions_setPrototypeOf(subClass,superClass)}(BaseWithOptions,_Base);var _super=basewithoptions_createSuper(BaseWithOptions);function BaseWithOptions(options){var _this;return function basewithoptions_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,BaseWithOptions),void 0===options&&(options={}),(_this=_super.call(this))[internalSymbol]=extend({},_this.defaults,validateObject(options)),_this}return function basewithoptions_createClass(Constructor,protoProps,staticProps){return protoProps&&basewithoptions_defineProperties(Constructor.prototype,protoProps),staticProps&&basewithoptions_defineProperties(Constructor,staticProps),Constructor}(BaseWithOptions,[{key:"defaults",get:function get(){return{}}},{key:"getOption",value:function getOption(path,defaultValue){var value;try{value=new Pathfinder(this[internalSymbol]).getVia(path)}catch(e){}return void 0===value?defaultValue:value}}]),BaseWithOptions}(Base);function translations_typeof(obj){return(translations_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function translations_slicedToArray(arr,i){return function translations_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function translations_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function translations_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return translations_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return translations_arrayLikeToArray(o,minLen)}(arr,i)||function translations_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function translations_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function translations_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function translations_setPrototypeOf(o,p){return(translations_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function translations_createSuper(Derived){var hasNativeReflectConstruct=function translations_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=translations_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=translations_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return translations_possibleConstructorReturn(this,result)}}function translations_possibleConstructorReturn(self,call){if(call&&("object"===translations_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function translations_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function translations_getPrototypeOf(o){return(translations_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",BaseWithOptions);var Translations=function(_Base){!function translations_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&translations_setPrototypeOf(subClass,superClass)}(Translations,_Base);var _super=translations_createSuper(Translations);function Translations(locale){var _this;return function translations_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Translations),_this=_super.call(this),isString(locale)&&(locale=parseLocale(locale)),_this.locale=validateInstance(locale,Locale),_this.storage=new Map,_this}return function translations_createClass(Constructor,protoProps,staticProps){return protoProps&&translations_defineProperties(Constructor.prototype,protoProps),staticProps&&translations_defineProperties(Constructor,staticProps),Constructor}(Translations,[{key:"getText",value:function getText(key,defaultText){if(!this.storage.has(key)){if(void 0===defaultText)throw new Error("key "+key+" not found");return validateString(defaultText)}return isObject(this.storage.get(key))?this.getPluralRuleText(key,"other",defaultText):this.storage.get(key)}},{key:"getPluralRuleText",value:function getPluralRuleText(key,count,defaultText){if(!this.storage.has(key))return validateString(defaultText);var keyword,r=validateObject(this.storage.get(key));if(isString(count))keyword=count.toLocaleString();else{if(0===(count=validateInteger(count))&&r.hasOwnProperty("zero"))return validateString(r.zero);keyword=new Intl.PluralRules(this.locale.toString()).select(validateInteger(count))}return r.hasOwnProperty(keyword)?validateString(r[keyword]):r.hasOwnProperty(DEFAULT_KEY)?validateString(r[DEFAULT_KEY]):validateString(defaultText)}},{key:"setText",value:function setText(key,text){if(isString(text)||isObject(text))return this.storage.set(validateString(key),text),this;throw new TypeError("value is not a string or object")}},{key:"assignTranslations",value:function assignTranslations(translations){validateObject(translations);for(var _i=0,_Object$entries=Object.entries(translations);_i<_Object$entries.length;_i++){var _Object$entries$_i=translations_slicedToArray(_Object$entries[_i],2),k=_Object$entries$_i[0],v=_Object$entries$_i[1];this.setText(k,v)}return this}}]),Translations}(Base);function provider_typeof(obj){return(provider_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function provider_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function provider_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function provider_setPrototypeOf(o,p){return(provider_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function provider_createSuper(Derived){var hasNativeReflectConstruct=function provider_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=provider_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=provider_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return provider_possibleConstructorReturn(this,result)}}function provider_possibleConstructorReturn(self,call){if(call&&("object"===provider_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function provider_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function provider_getPrototypeOf(o){return(provider_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.I18n",Translations);var Provider=function(_BaseWithOptions){!function provider_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&provider_setPrototypeOf(subClass,superClass)}(Provider,_BaseWithOptions);var _super=provider_createSuper(Provider);function Provider(){return provider_classCallCheck(this,Provider),_super.apply(this,arguments)}return function provider_createClass(Constructor,protoProps,staticProps){return protoProps&&provider_defineProperties(Constructor.prototype,protoProps),staticProps&&provider_defineProperties(Constructor,staticProps),Constructor}(Provider,[{key:"getTranslations",value:function getTranslations(locale){return new Promise((function(resolve,reject){try{resolve(new Translations(locale))}catch(e){reject(e)}}))}}]),Provider}(BaseWithOptions);function formatter_typeof(obj){return(formatter_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function formatter_slicedToArray(arr,i){return function formatter_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function formatter_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||formatter_unsupportedIterableToArray(arr,i)||function formatter_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function formatter_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=formatter_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function formatter_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return formatter_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?formatter_arrayLikeToArray(o,minLen):void 0}}function formatter_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function formatter_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function formatter_get(target,property,receiver){return(formatter_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function formatter_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=formatter_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function formatter_setPrototypeOf(o,p){return(formatter_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function formatter_createSuper(Derived){var hasNativeReflectConstruct=function formatter_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=formatter_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=formatter_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return formatter_possibleConstructorReturn(this,result)}}function formatter_possibleConstructorReturn(self,call){if(call&&("object"===formatter_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function formatter_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function formatter_getPrototypeOf(o){return(formatter_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.I18n",Provider);var internalObjectSymbol=Symbol("internalObject"),watchdogSymbol=Symbol("watchdog"),markerOpenIndexSymbol=Symbol("markerOpenIndex"),markerCloseIndexSymbol=Symbol("markercloseIndex"),workingDataSymbol=Symbol("workingData"),Formatter=function(_BaseWithOptions){!function formatter_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&formatter_setPrototypeOf(subClass,superClass)}(Formatter,_BaseWithOptions);var _super=formatter_createSuper(Formatter);function Formatter(object,options){var _this;return function formatter_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Formatter),(_this=_super.call(this,options))[internalObjectSymbol]=object||{},_this[markerOpenIndexSymbol]=0,_this[markerCloseIndexSymbol]=0,_this}return function formatter_createClass(Constructor,protoProps,staticProps){return protoProps&&formatter_defineProperties(Constructor.prototype,protoProps),staticProps&&formatter_defineProperties(Constructor,staticProps),Constructor}(Formatter,[{key:"defaults",get:function get(){return extend({},formatter_get(formatter_getPrototypeOf(Formatter.prototype),"defaults",this),{marker:{open:["${"],close:["}"]},parameter:{delimiter:"::",assignment:"="},callbacks:{}})}},{key:"setParameterChars",value:function setParameterChars(delimiter,assignment){return void 0!==delimiter&&(this[internalSymbol].parameter.delimiter=validateString(delimiter)),void 0!==assignment&&(this[internalSymbol].parameter.assignment=validateString(assignment)),this}},{key:"setMarker",value:function setMarker(open,close){return void 0===close&&(close=open),isString(open)&&(open=[open]),isString(close)&&(close=[close]),this[internalSymbol].marker.open=validateArray(open),this[internalSymbol].marker.close=validateArray(close),this}},{key:"format",value:function format(text){return this[watchdogSymbol]=0,this[markerOpenIndexSymbol]=0,this[markerCloseIndexSymbol]=0,this[workingDataSymbol]={},_format.call(this,text)}}]),Formatter}(BaseWithOptions);function _format(text){var _self$internalSymbol$,_self$internalSymbol$2,_self$internalSymbol$3,_self$internalSymbol$4;if(this[watchdogSymbol]++,this[watchdogSymbol]>20)throw new Error("too deep nesting");var openMarker=null===(_self$internalSymbol$=this[internalSymbol].marker.open)||void 0===_self$internalSymbol$?void 0:_self$internalSymbol$[this[markerOpenIndexSymbol]],closeMarker=null===(_self$internalSymbol$2=this[internalSymbol].marker.close)||void 0===_self$internalSymbol$2?void 0:_self$internalSymbol$2[this[markerCloseIndexSymbol]];if(-1===text.indexOf(openMarker)||-1===text.indexOf(closeMarker))return text;var result=tokenize.call(this,validateString(text),openMarker,closeMarker);return null!==(_self$internalSymbol$3=this[internalSymbol].marker.open)&&void 0!==_self$internalSymbol$3&&_self$internalSymbol$3[this[markerOpenIndexSymbol]+1]&&this[markerOpenIndexSymbol]++,null!==(_self$internalSymbol$4=this[internalSymbol].marker.close)&&void 0!==_self$internalSymbol$4&&_self$internalSymbol$4[this[markerCloseIndexSymbol]+1]&&this[markerCloseIndexSymbol]++,result=_format.call(this,result)}function tokenize(text,openMarker,closeMarker){for(var formatted=[],parameterAssignment=this[internalSymbol].parameter.assignment,parameterDelimiter=this[internalSymbol].parameter.delimiter,callbacks=this[internalSymbol].callbacks;;){var _self$workingDataSymb,startIndex=text.indexOf(openMarker);if(-1===startIndex){formatted.push(text);break}startIndex>0&&(formatted.push(text.substring(0,startIndex)),text=text.substring(startIndex));var endIndex=text.substring(openMarker.length).indexOf(closeMarker);-1!==endIndex&&(endIndex+=openMarker.length);var insideStartIndex=text.substring(openMarker.length).indexOf(openMarker);if(-1!==insideStartIndex&&(insideStartIndex+=openMarker.length)<endIndex){var result=tokenize.call(this,text.substring(insideStartIndex),openMarker,closeMarker);-1!==(endIndex=(text=text.substring(0,insideStartIndex)+result).substring(openMarker.length).indexOf(closeMarker))&&(endIndex+=openMarker.length)}if(-1===endIndex)throw new Error("syntax error in formatter template");var key=text.substring(openMarker.length,endIndex),parts=key.split(parameterDelimiter),currentPipe=parts.shift();this[workingDataSymbol]=extend({},this[internalObjectSymbol],this[workingDataSymbol]);var _step,_iterator=formatter_createForOfIteratorHelper(parts);try{for(_iterator.s();!(_step=_iterator.n()).done;){var _kv$split2=formatter_slicedToArray(_step.value.split(parameterAssignment),2),k=_kv$split2[0],v=_kv$split2[1];this[workingDataSymbol][k]=v}}catch(err){_iterator.e(err)}finally{_iterator.f()}var t3=key.split("|").shift().trim().split("::").shift().trim().split(".").shift().trim(),prefix=null!==(_self$workingDataSymb=this[workingDataSymbol])&&void 0!==_self$workingDataSymb&&_self$workingDataSymb[t3]?"path:":"static:",command="";prefix&&0!==key.indexOf(prefix)&&0!==key.indexOf("path:")&&0!==key.indexOf("static:")&&(command=prefix);var pipe=new Pipe(command+=currentPipe);if(isObject(callbacks))for(var _i=0,_Object$entries=Object.entries(callbacks);_i<_Object$entries.length;_i++){var _Object$entries$_i=formatter_slicedToArray(_Object$entries[_i],2),name=_Object$entries$_i[0],callback=_Object$entries$_i[1];pipe.setCallback(name,callback)}formatted.push(validateString(pipe.run(this[workingDataSymbol]))),text=text.substring(endIndex+closeMarker.length)}return formatted.join("")}function fetch_typeof(obj){return(fetch_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function fetch_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function fetch_setPrototypeOf(o,p){return(fetch_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function fetch_createSuper(Derived){var hasNativeReflectConstruct=function fetch_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=fetch_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=fetch_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return fetch_possibleConstructorReturn(this,result)}}function fetch_possibleConstructorReturn(self,call){if(call&&("object"===fetch_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return fetch_assertThisInitialized(self)}function fetch_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function fetch_get(target,property,receiver){return(fetch_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function fetch_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=fetch_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function fetch_getPrototypeOf(o){return(fetch_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function logentry_typeof(obj){return(logentry_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function logentry_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function logentry_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function logentry_setPrototypeOf(o,p){return(logentry_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function logentry_createSuper(Derived){var hasNativeReflectConstruct=function logentry_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=logentry_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=logentry_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return logentry_possibleConstructorReturn(this,result)}}function logentry_possibleConstructorReturn(self,call){if(call&&("object"===logentry_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function logentry_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function logentry_getPrototypeOf(o){return(logentry_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Text",Formatter),assignToNamespace("Monster.I18n.Providers",function(_Provider){!function fetch_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&fetch_setPrototypeOf(subClass,superClass)}(Fetch,_Provider);var _super=fetch_createSuper(Fetch);function Fetch(url,options){var _thisSuper,_this;return function fetch_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Fetch),_this=_super.call(this,options),isInstance(url,URL)&&(url=url.toString()),void 0===options&&(options={}),validateString(url),_this.url=url,_this[internalSymbol]=extend({},fetch_get((_thisSuper=fetch_assertThisInitialized(_this),fetch_getPrototypeOf(Fetch.prototype)),"defaults",_thisSuper),_this.defaults,validateObject(options)),_this}return function fetch_createClass(Constructor,protoProps,staticProps){return protoProps&&fetch_defineProperties(Constructor.prototype,protoProps),staticProps&&fetch_defineProperties(Constructor,staticProps),Constructor}(Fetch,[{key:"defaults",get:function get(){return{fetch:{method:"GET",mode:"cors",cache:"no-cache",credentials:"omit",redirect:"follow",referrerPolicy:"no-referrer"}}}},{key:"getTranslations",value:function getTranslations(locale){isString(locale)&&(locale=parseLocale(locale));var formatter=new Formatter(locale.getMap());return getGlobalFunction("fetch")(formatter.format(this.url),this.getOption("fetch",{})).then((function(response){return response.json()})).then((function(data){return new Translations(locale).assignTranslations(data)}))}}]),Fetch}(Provider));var LogEntry=function(_Base){!function logentry_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&logentry_setPrototypeOf(subClass,superClass)}(LogEntry,_Base);var _super=logentry_createSuper(LogEntry);function LogEntry(loglevel){var _this;logentry_classCallCheck(this,LogEntry),_this=_super.call(this),validateInteger(loglevel),_this.loglevel=loglevel;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return _this.arguments=args,_this}return function logentry_createClass(Constructor,protoProps,staticProps){return protoProps&&logentry_defineProperties(Constructor.prototype,protoProps),staticProps&&logentry_defineProperties(Constructor,staticProps),Constructor}(LogEntry,[{key:"getLogLevel",value:function getLogLevel(){return this.loglevel}},{key:"getArguments",value:function getArguments(){return this.arguments}}]),LogEntry}(Base);function logger_typeof(obj){return(logger_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function logger_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function logger_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return logger_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return logger_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function logger_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function logger_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function logger_setPrototypeOf(o,p){return(logger_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function logger_createSuper(Derived){var hasNativeReflectConstruct=function logger_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=logger_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=logger_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return logger_possibleConstructorReturn(this,result)}}function logger_possibleConstructorReturn(self,call){if(call&&("object"===logger_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function logger_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function logger_getPrototypeOf(o){return(logger_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Logging",LogEntry);var TRACE=64,DEBUG=32,INFO=16,WARN=8,ERROR=4,FATAL=2;function triggerLog(loglevel){for(var logger=this,_len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];var _step,_iterator=logger_createForOfIteratorHelper(logger.handler);try{for(_iterator.s();!(_step=_iterator.n()).done;){var handler=_step.value;handler.log(new LogEntry(loglevel,args))}}catch(err){_iterator.e(err)}finally{_iterator.f()}return logger}function handler_typeof(obj){return(handler_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function handler_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function handler_setPrototypeOf(o,p){return(handler_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function handler_createSuper(Derived){var hasNativeReflectConstruct=function handler_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=handler_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=handler_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return handler_possibleConstructorReturn(this,result)}}function handler_possibleConstructorReturn(self,call){if(call&&("object"===handler_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function handler_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function handler_getPrototypeOf(o){return(handler_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Logging",function(_Base){!function logger_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&logger_setPrototypeOf(subClass,superClass)}(Logger,_Base);var _super=logger_createSuper(Logger);function Logger(){var _this;return function logger_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Logger),(_this=_super.call(this)).handler=new Set,_this}return function logger_createClass(Constructor,protoProps,staticProps){return protoProps&&logger_defineProperties(Constructor.prototype,protoProps),staticProps&&logger_defineProperties(Constructor,staticProps),Constructor}(Logger,[{key:"addHandler",value:function addHandler(handler){if(validateObject(handler),!(handler instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.add(handler),this}},{key:"removeHandler",value:function removeHandler(handler){if(validateObject(handler),!(handler instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.delete(handler),this}},{key:"logTrace",value:function logTrace(){return triggerLog.apply(this,[TRACE].concat(Array.prototype.slice.call(arguments))),this}},{key:"logDebug",value:function logDebug(){return triggerLog.apply(this,[DEBUG].concat(Array.prototype.slice.call(arguments))),this}},{key:"logInfo",value:function logInfo(){return triggerLog.apply(this,[INFO].concat(Array.prototype.slice.call(arguments))),this}},{key:"logWarn",value:function logWarn(){return triggerLog.apply(this,[WARN].concat(Array.prototype.slice.call(arguments))),this}},{key:"logError",value:function logError(){return triggerLog.apply(this,[ERROR].concat(Array.prototype.slice.call(arguments))),this}},{key:"logFatal",value:function logFatal(){return triggerLog.apply(this,[FATAL].concat(Array.prototype.slice.call(arguments))),this}},{key:"getLabel",value:function getLabel(level){return validateInteger(level),255===level?"ALL":level===TRACE?"TRACE":level===DEBUG?"DEBUG":level===INFO?"INFO":level===WARN?"WARN":level===ERROR?"ERROR":level===FATAL?"FATAL":0===level?"OFF":"unknown"}},{key:"getLevel",value:function getLevel(label){return validateString(label),"ALL"===label?255:"TRACE"===label?TRACE:"DEBUG"===label?DEBUG:"INFO"===label?INFO:"WARN"===label?WARN:"ERROR"===label?ERROR:"FATAL"===label?FATAL:0}}]),Logger}(Base));var Handler=function(_Base){!function handler_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&handler_setPrototypeOf(subClass,superClass)}(Handler,_Base);var _super=handler_createSuper(Handler);function Handler(){var _this;return function handler_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Handler),(_this=_super.call(this)).loglevel=0,_this}return function handler_createClass(Constructor,protoProps,staticProps){return protoProps&&handler_defineProperties(Constructor.prototype,protoProps),staticProps&&handler_defineProperties(Constructor,staticProps),Constructor}(Handler,[{key:"log",value:function log(entry){return validateInstance(entry,LogEntry),!(this.loglevel<entry.getLogLevel())}},{key:"setLogLevel",value:function setLogLevel(loglevel){return validateInteger(loglevel),this.loglevel=loglevel,this}},{key:"getLogLevel",value:function getLogLevel(){return this.loglevel}},{key:"setAll",value:function setAll(){return this.setLogLevel(255),this}},{key:"setTrace",value:function setTrace(){return this.setLogLevel(TRACE),this}},{key:"setDebug",value:function setDebug(){return this.setLogLevel(DEBUG),this}},{key:"setInfo",value:function setInfo(){return this.setLogLevel(INFO),this}},{key:"setWarn",value:function setWarn(){return this.setLogLevel(WARN),this}},{key:"setError",value:function setError(){return this.setLogLevel(ERROR),this}},{key:"setFatal",value:function setFatal(){return this.setLogLevel(FATAL),this}},{key:"setOff",value:function setOff(){return this.setLogLevel(0),this}}]),Handler}(Base);function console_typeof(obj){return(console_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function console_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function console_get(target,property,receiver){return(console_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function console_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=console_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function console_setPrototypeOf(o,p){return(console_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function console_createSuper(Derived){var hasNativeReflectConstruct=function console_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=console_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=console_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return console_possibleConstructorReturn(this,result)}}function console_possibleConstructorReturn(self,call){if(call&&("object"===console_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function console_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function console_getPrototypeOf(o){return(console_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function random(min,max){if(void 0===min&&(min=0),void 0===max&&(max=MAX),max<min)throw new Error("max must be greater than min");return Math.round(create(min,max))}assignToNamespace("Monster.Logging",Handler),assignToNamespace("Monster.Logging.Handler",function(_Handler){!function console_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&console_setPrototypeOf(subClass,superClass)}(ConsoleHandler,_Handler);var _super=console_createSuper(ConsoleHandler);function ConsoleHandler(){return function console_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ConsoleHandler),_super.call(this)}return function console_createClass(Constructor,protoProps,staticProps){return protoProps&&console_defineProperties(Constructor.prototype,protoProps),staticProps&&console_defineProperties(Constructor,staticProps),Constructor}(ConsoleHandler,[{key:"log",value:function log(entry){if(console_get(console_getPrototypeOf(ConsoleHandler.prototype),"log",this).call(this,entry)){var console=getGlobalObject("console");return!!console&&(console.log(entry.toString()),!0)}return!1}}]),ConsoleHandler}(Handler));var MAX=1e9;function create(min,max){var crypt,globalReference=getGlobal();if(void 0===(crypt=(null==globalReference?void 0:globalReference.crypto)||(null==globalReference?void 0:globalReference.msCrypto)||(null==globalReference?void 0:globalReference.crypto)||void 0))throw new Error("missing crypt");var rval=0,range=max-min;if(range<2)throw new Error("the distance is too small to create a random number.");var bitsNeeded=Math.ceil(Math.log2(range));if(bitsNeeded>53)throw new Error("we cannot generate numbers larger than 53 bits.");var bytesNeeded=Math.ceil(bitsNeeded/8),mask=Math.pow(2,bitsNeeded)-1,byteArray=new Uint8Array(bytesNeeded);crypt.getRandomValues(byteArray);for(var p=8*(bytesNeeded-1),i=0;i<bytesNeeded;i++)rval+=byteArray[i]*Math.pow(2,p),p-=8;return(rval&=mask)>=range?create(min,max):(rval<min&&(rval+=min),rval)}function randomid_typeof(obj){return(randomid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function randomid_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function randomid_setPrototypeOf(o,p){return(randomid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function randomid_createSuper(Derived){var hasNativeReflectConstruct=function randomid_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=randomid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=randomid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return randomid_possibleConstructorReturn(this,result)}}function randomid_possibleConstructorReturn(self,call){if(call&&("object"===randomid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function randomid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function randomid_getPrototypeOf(o){return(randomid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Math.log2=Math.log2||function(n){return Math.log(n)/Math.log(2)},assignToNamespace("Monster.Math",random);var randomid_internalCounter=0;function version_typeof(obj){return(version_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function version_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function version_setPrototypeOf(o,p){return(version_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function version_createSuper(Derived){var hasNativeReflectConstruct=function version_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=version_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=version_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return version_possibleConstructorReturn(this,result)}}function version_possibleConstructorReturn(self,call){if(call&&("object"===version_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function version_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function version_getPrototypeOf(o){return(version_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",function(_ID){!function randomid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&randomid_setPrototypeOf(subClass,superClass)}(RandomID,_ID);var _super=randomid_createSuper(RandomID);function RandomID(){var _this;return function randomid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RandomID),_this=_super.call(this),randomid_internalCounter+=1,_this.id=getGlobal().btoa(random(1,1e4)).replace(/=/g,"").replace(/^[0-9]+/,"X")+randomid_internalCounter,_this}return function randomid_createClass(Constructor,protoProps,staticProps){return protoProps&&randomid_defineProperties(Constructor.prototype,protoProps),staticProps&&randomid_defineProperties(Constructor,staticProps),Constructor}(RandomID)}(ID));var monsterVersion,rootName,Version=function(_Base){!function version_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&version_setPrototypeOf(subClass,superClass)}(Version,_Base);var _super=version_createSuper(Version);function Version(major,minor,patch){var _this;if(function version_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Version),_this=_super.call(this),"string"==typeof major&&void 0===minor&&void 0===patch){var parts=major.toString().split(".");major=parseInt(parts[0]||0),minor=parseInt(parts[1]||0),patch=parseInt(parts[2]||0)}if(void 0===major)throw new Error("major version is undefined");if(void 0===minor&&(minor=0),void 0===patch&&(patch=0),_this.major=parseInt(major),_this.minor=parseInt(minor),_this.patch=parseInt(patch),isNaN(_this.major))throw new Error("major is not a number");if(isNaN(_this.minor))throw new Error("minor is not a number");if(isNaN(_this.patch))throw new Error("patch is not a number");return _this}return function version_createClass(Constructor,protoProps,staticProps){return protoProps&&version_defineProperties(Constructor.prototype,protoProps),staticProps&&version_defineProperties(Constructor,staticProps),Constructor}(Version,[{key:"toString",value:function toString(){return this.major+"."+this.minor+"."+this.patch}},{key:"compareTo",value:function compareTo(version){if(version instanceof Version&&(version=version.toString()),"string"!=typeof version)throw new Error("type exception");if(version===this.toString())return 0;for(var a=[this.major,this.minor,this.patch],b=version.split("."),len=Math.max(a.length,b.length),i=0;i<len;i+=1){if(a[i]&&!b[i]&&parseInt(a[i])>0||parseInt(a[i])>parseInt(b[i]))return 1;if(b[i]&&!a[i]&&parseInt(b[i])>0||parseInt(a[i])<parseInt(b[i]))return-1}return 0}}]),Version}(Base);function comparator_typeof(obj){return(comparator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function comparator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function comparator_setPrototypeOf(o,p){return(comparator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function comparator_createSuper(Derived){var hasNativeReflectConstruct=function comparator_isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var result,Super=comparator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=comparator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return comparator_possibleConstructorReturn(this,result)}}function comparator_possibleConstructorReturn(self,call){if(call&&("object"===comparator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function comparator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function comparator_getPrototypeOf(o){return(comparator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function freeze_typeof(obj){return(freeze_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function freeze_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function freeze_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return freeze_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return freeze_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function freeze_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}assignToNamespace("Monster.Types",Version),assignToNamespace("Monster",(function getVersion(){return monsterVersion instanceof Version?monsterVersion:monsterVersion=new Version("1.30.1")})),assignToNamespace("Monster.Util",function(_Base){!function comparator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&comparator_setPrototypeOf(subClass,superClass)}(Comparator,_Base);var _super=comparator_createSuper(Comparator);function Comparator(callback){var _this;if(function comparator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Comparator),_this=_super.call(this),isFunction(callback))_this.compare=callback;else{if(void 0!==callback)throw new TypeError("unsupported type");_this.compare=function(a,b){if(comparator_typeof(a)!==comparator_typeof(b))throw new TypeError("impractical comparison","types/comparator.js");return a===b?0:a<b?-1:1}}return _this}return function comparator_createClass(Constructor,protoProps,staticProps){return protoProps&&comparator_defineProperties(Constructor.prototype,protoProps),staticProps&&comparator_defineProperties(Constructor,staticProps),Constructor}(Comparator,[{key:"reverse",value:function reverse(){var original=this.compare;return this.compare=function(a,b){return original(b,a)},this}},{key:"equal",value:function equal(a,b){return 0===this.compare(a,b)}},{key:"greaterThan",value:function greaterThan(a,b){return this.compare(a,b)>0}},{key:"greaterThanOrEqual",value:function greaterThanOrEqual(a,b){return this.greaterThan(a,b)||this.equal(a,b)}},{key:"lessThanOrEqual",value:function lessThanOrEqual(a,b){return this.lessThan(a,b)||this.equal(a,b)}},{key:"lessThan",value:function lessThan(a,b){return this.compare(a,b)<0}}]),Comparator}(Base)),assignToNamespace("Monster.Util",(function deepFreeze(object){validateObject(object);var _step,_iterator=freeze_createForOfIteratorHelper(Object.getOwnPropertyNames(object));try{for(_iterator.s();!(_step=_iterator.n()).done;){var name=_step.value,value=object[name];object[name]=value&&"object"===freeze_typeof(value)?deepFreeze(value):value}}catch(err){_iterator.e(err)}finally{_iterator.f()}return Object.freeze(object)}));try{rootName=Monster.Types.getGlobalObject("__MonsterRootName__")}catch(e){}return rootName||(rootName="Monster"),Monster.Types.getGlobal()[rootName]=Monster,__webpack_exports__}()}));
\ No newline at end of file
diff --git a/packages/monster/source/dom/customelement.js b/packages/monster/source/dom/customelement.js
index 54739cdeb302db9ca4055dfaebd7f65a597e64ea..6f60caed5c84454b76d94564c887b2314d3ee44d 100644
--- a/packages/monster/source/dom/customelement.js
+++ b/packages/monster/source/dom/customelement.js
@@ -234,7 +234,7 @@ class CustomElement extends HTMLElement {
      * }
      * ```
      *
-     * to set the options via the html tag the attribute data-monster-options must be set.
+     * To set the options via the html tag the attribute data-monster-options must be set.
      * As value a JSON object with the desired values must be defined.
      *
      * Since 1.18.0 the JSON can be specified as a DataURI.
@@ -261,6 +261,7 @@ class CustomElement extends HTMLElement {
      * </script>
      * ```
      *
+     * The individual configuration values can be found in the table.
      *
      * @property {boolean} disabled=false Object The Boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form.
      * @property {string} shadowMode=open `open` Elements of the shadow root are accessible from JavaScript outside the root, for example using. `close` Denies access to the node(s) of a closed shadow root from JavaScript outside it
diff --git a/packages/monster/source/dom/ready.js b/packages/monster/source/dom/ready.js
new file mode 100644
index 0000000000000000000000000000000000000000..0bae7c02df0c8ceaf167fe78d42fc0cc8ac9107e
--- /dev/null
+++ b/packages/monster/source/dom/ready.js
@@ -0,0 +1,81 @@
+'use strict';
+
+
+/**
+ * @author schukai GmbH
+ */
+
+
+import {Monster} from '../namespace.js';
+import {getDocument, getWindow} from "./util.js";
+
+/**
+ * This variable is a promise that is fulfilled as soon as the dom is available.
+ *
+ * The DOMContentLoaded event is fired when the original HTML document is fully loaded and parsed 
+ * without waiting for stylesheets, images, and subframes to finish loading.
+ *
+ * ```
+ * <script type="module">
+ * import {domReady} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/ready.js';
+ * domReady().then(()=>{
+ *     // ...
+ * })
+ * </script>
+ * ```
+ *
+ * @since 1.31.0
+ * @memberOf Monster.DOM
+ * @summary variable to check if dom is ready
+ * @type {Promise}
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/DOMContentLoaded_event
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState
+ */
+const domReady = new Promise(resolve => {
+
+    const document = getDocument();
+
+    if (document.readyState === "loading") {
+        document.addEventListener('DOMContentLoaded', resolve);
+    } else {
+        resolve();
+    }
+});
+
+
+/**
+ * This variable is a promise that is fulfilled as soon as the windows is available.
+ *
+ * The load event fires when the entire page is loaded, including all dependent resources such as stylesheets, 
+ * assets, and images. Unlike DOMContentLoaded, which fires as soon as the DOM of the page is loaded, 
+ * without waiting for the resources to finish loading.
+ *
+ * ```
+ * <script type="module">
+ * import {windowReady} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.30.1/dist/modules/dom/ready.js';
+ * windowReady().then(()=>{
+ *     // ...
+ * })
+ * </script>
+ * ```
+ *
+ * @since 1.31.0
+ * @memberOf Monster.DOM
+ * @summary variable to check if window is ready
+ * @type {Promise}
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState
+ */
+const windowReady = new Promise(resolve => {
+
+    const document = getDocument();
+    const window = getWindow();
+    
+    if (document.readyState === 'complete') {
+        resolve();
+    } else {
+        window.addEventListener('load', resolve);
+    }
+});
+
+export {Monster, windowReady, domReady}
\ No newline at end of file
diff --git a/packages/monster/source/namespace.js b/packages/monster/source/namespace.js
index 386ae1a542d2cadf338c450255a38521f95043bd..e97ba4bc91205a3fb8f57adda84370eaebc93cdd 100644
--- a/packages/monster/source/namespace.js
+++ b/packages/monster/source/namespace.js
@@ -1,5 +1,6 @@
 'use strict';
 
+
 /**
  * Main namespace for Monster.
  *
@@ -101,26 +102,26 @@ function assignToNamespace(ns, ...obj) {
 
 /**
  *
- * @param {class|function} fn
+ * @param {class|function|object} obj
  * @returns {string}
  * @private
  * @throws {Error} the name of the class or function cannot be resolved.
  * @throws {Error} the first argument is not a function or class.
  * @throws {Error} exception
  */
-function objectName(fn) {
+function objectName(obj) {
     try {
 
-        if (typeof fn !== 'function') {
+        if (typeof obj !== 'function') {
             throw  new Error("the first argument is not a function or class.");
         }
 
-        if (fn.hasOwnProperty('name')) {
-            return fn.name;
+        if (obj.hasOwnProperty('name')) {
+            return obj.name;
         }
 
-        if ("function" === typeof fn.toString) {
-            let s = fn.toString();
+        if ("function" === typeof obj.toString) {
+            let s = obj.toString();
             let f = s.match(/^\s*function\s+([^\s(]+)/);
             if (Array.isArray(f) && typeof f[1] === 'string') {
                 return f[1];
diff --git a/packages/monster/test/cases/dom/ready.js b/packages/monster/test/cases/dom/ready.js
new file mode 100644
index 0000000000000000000000000000000000000000..90cbc57d23f76c7d1b9e913edd935b8a99b78f68
--- /dev/null
+++ b/packages/monster/test/cases/dom/ready.js
@@ -0,0 +1,42 @@
+'use strict';
+
+
+import {initJSDOM} from "../../util/jsdom.js";
+
+let windowReady;
+let domReady;
+
+describe('Ready', function () {
+
+    before(function (done) {
+        initJSDOM().then(() => {
+
+            import("../../../source/dom/ready.js").then((m) => {
+                domReady = m['domReady'];
+                windowReady = m['windowReady'];
+                done()
+            });
+
+        });
+
+
+    })
+
+    describe('domReady', function () {
+
+        it('resolve promise', function (done) {
+            domReady.then(done).catch(e => done(e));
+        });
+
+    });
+
+    describe('windowReady', function () {
+
+        it('resolve promise', function (done) {
+            windowReady.then(done).catch(e => done(e));
+        });
+
+    });
+
+
+});
\ No newline at end of file