@webqit/oohtml 1.9.21 → 1.9.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/state-api.js CHANGED
@@ -1,2 +1,3 @@
1
- (()=>{"use strict";function e(e){return typeof e}function t(e,...t){globalThis.WebQitInternalsRegistry||(globalThis.WebQitInternalsRegistry=new Map);var r,n,s=globalThis.WebQitInternalsRegistry.get(e);if(!s){if(s=new Map,!1===t[0])return s;globalThis.WebQitInternalsRegistry.set(e,s)}for(;r=t.shift();)if((n=s)&&!(s=s.get(r))){if(s=new Map,!1===t[0])return s;n.set(r,s)}return s}function r(e){return Array.isArray(e)}function n(e){return"function"==typeof e}function s(e){return n(e)||e&&"[object function]"==={}.toString.call(e)}function i(e){return e instanceof Number||"number"==typeof e}function a(e){return i(e)||!0!==e&&!1!==e&&null!==e&&""!==e&&!isNaN(1*e)}function o(e){return!Array.isArray(e)&&"object"==typeof e&&e}function l(e){return e instanceof String||"string"==typeof e&&null!==e}function c(e){return Array.isArray(e)||"object"==typeof e&&e||n(e)}function u(e){return arguments.length&&(void 0===e||void 0===e)}function h(e,t=!0){return r(e)?e:!t&&o(e)?[e]:!1!==e&&0!==e&&function(e){return function(e){return null===e||""===e}(e)||u(e)||!1===e||0===e||c(e)&&!Object.keys(e).length}(e)?[]:function(e){return!l(e)&&!u(e.length)}(e)?Array.prototype.slice.call(e):o(e)?Object.values(e):[e]}function p(e,t,r=null){return r||!1!==r&&e.dotSafe&&t.dotSafe?e.join(".")===t.join("."):e.length===t.length&&e.reduce(((e,r,n)=>e&&r===t[n]),!0)}function f(e,t,n=null){return r(t)?e.filter((e=>n?t.filter((t=>n(e,t))).length:-1!==t.indexOf(e))):[]}function g(e){return(m(e)?e:h(e).length?[e]:[]).reduce(((e,t)=>e.concat([h(t)])),[]).map((e=>d.resolve(e)))}new Map;class d extends Array{static resolve(e){return e.every((e=>!(e+"").includes(".")))?(new d).concat(e):e}get dotSafe(){return!0}}function m(e){return h(e).reduce(((e,t)=>e||r(t)),!1)}function b(e){return e.filter((e=>e||0===e)).length!==e.length}class v{constructor(e){this.target=e,this.fireables=[],this.currentlyFiring=[]}add(e){return this.fireables.push(e),e}remove(e){this.fireables=this.fireables.filter((t=>t!==e))}removeMatches(e){this.match(e).forEach((e=>{this.fireables=this.fireables.filter((t=>t!==e))}))}match(e){return this.fireables.filter((t=>{var r=g(t.filter),n=h((t.params||{}).tags),s=g(e.filter),i=h((e.params||{}).tags);return(!e.originalHandler||t.handler===e.originalHandler)&&(!s.length||p(s,r))&&(!i.length||i.length===n.length&&f(n,i).length===i.length)}))}static _getFirebase(r,n,s=!0,i=this.__namespace){if(!c(n))throw new Error('Subject must be of type object; "'+e(n)+'" given!');var a=this;return i&&globalThis.WebQitObserverNamespaceRegistry.has(r+"-"+i)&&(a=globalThis.WebQitObserverNamespaceRegistry.get(r+"-"+i),r+="-"+i),!t(n,"firebases").has(r)&&s&&t(n,"firebases").set(r,new a(n)),t(n,"firebases").get(r)}static _namespace(e,t,r=null){if(e+="-"+t,2===arguments.length)return globalThis.WebQitObserverNamespaceRegistry.get(e);if(!(r.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${t} must be a subclass of ${this.name}.`);globalThis.WebQitObserverNamespaceRegistry.set(e,r),r.__namespace=t}}globalThis.WebQitObserverNamespaceRegistry||(globalThis.WebQitObserverNamespaceRegistry=new Map);class y{constructor(e,t){this.target=e,this.handler=t.handler,this.filter=t.filter,this.params=t.params}disconnect(){this.disconnected=!0}}class w extends y{fire(e,t,r){return this.disconnected||this.filter&&!f(h(this.filter),[e.type]).length?t(...Array.prototype.slice.call(arguments,2)):this.handler(e,r,t)}}function O(e,t){var r=void 0;return c(e)&&Object.keys(e).forEach(((n,s)=>{!1!==r&&(r=t(a(n)?parseFloat(n):n,e[n],s))})),r}class j{constructor(e,t){if(this.target=e,!t.type)throw new Error("Action type must be given in definition!");O(t,((e,t)=>{Object.defineProperty(this,e,{value:t,enumerable:!0})})),Object.seal(this)}}class E extends v{add(e){return super.add(new w(this.target,e))}fire(e,t=null){if(e instanceof j||(e=new j(this.target,e)),this.currentlyFiring.filter((t=>t.type===e.type&&t.name===e.name)).length)return t?t():void 0;this.currentlyFiring.push(e);const r=(n,...s)=>{var i=this.fireables[n];return i?i.fire(e,((...e)=>r(n+1,...e)),...s):t?t(...s):s[0]};var n=r(0);return this.currentlyFiring.pop(),n}static getFirebase(e,t=!0,r=null){return super._getFirebase("interceptor",...arguments)}static namespace(e,t=null){return super._namespace("interceptor",...arguments)}}function P(e){return t(e,!1).get(e)||e}function k(e,t,r={},n={}){if(!t||!c(t))throw new Error("Target must be of type object!");t=P(t);var s,i=function(n){return arguments.length?n:Reflect[e](t,...Object.values(r))};return(s=E.getFirebase(t,!1,n.namespace))?s.fire({type:e,...r},i):i()}function S(e,t,r,n={}){return k("apply",e,{thisArgument:t,argumentsList:r},n)}function C(e,t,r=null,n={}){return k("construct",e,arguments.length>2?{argumentsList:t,newTarget:r}:{argumentsList:t},n)}function _(e,t=1){var r=0;e.forEach((e=>{r++}));var n=e.slice(e.length-r,t);return arguments.length>1?n:n[0]}function $(e,t=1){return arguments.length>1?_(e.slice().reverse(),t).reverse():_(e.slice().reverse())}function x(e,t,r=null){return r||!1!==r&&e.dotSafe&&t.dotSafe?(e.join(".")+".").startsWith(t.join(".")+"."):t.reduce(((t,r,n)=>t&&r===e[n]),!0)}function M(e,t,r=null,n=!1){var s=function(e,t,r=null,n=!1){return t.length>e.length?-1:("number"==typeof r?n?e.slice(0,r+1+(r<0?e.length:0)):e.slice(r):e).reduce(((e,r,s)=>{var[i,a,o]=e;if(!n&&i>-1)return[i,a,o];var l=o+1,c=r===t[l]?0===l?[s,0]:[a,l]:[-1,-1];return c[1]===t.length-1&&(c[1]=-1,c[0]>-1)?[c[0]].concat(c):[i].concat(c)}),[-1,-1,-1])[0]+(n||"number"!=typeof r?0:r>-1?r:e.length-r)}(e,t,r,n);return-1===s?[]:e.slice(s+t.length)}class D{constructor(e,t=!1){this._={},this._.target=e,this._.cancellable=t,this._.propagationStopped=!1,this._.defaultPrevented=!1,this._.promisesInstance=null,this._.promises=[]}get target(){return this._.target}get cancellable(){return this._.cancellable}stopPropagation(){this._.propagationStopped=!0}get propagationStopped(){return this._.propagationStopped}preventDefault(){this._.defaultPrevented=!0}get defaultPrevented(){return this._.defaultPrevented}waitUntil(e){e instanceof Promise&&(this._.promises.push(e),this._.promisesInstance=null)}get promises(){return!this._.promisesInstance&&this._.promises.length&&(this._.promisesInstance=Promise.all(this._.promises)),this._.promisesInstance}respondWith(e){var t,r=o(e)&&!u(e.propagationStopped)&&!u(e.defaultPrevented);!1===e||r&&e.propagationStopped?this.stopPropagation():!1===e||r&&e.defaultPrevented?this.preventDefault():(e instanceof Promise&&(t=e)||r&&(t=e.promises))&&this.waitUntil(t)}}class T extends y{constructor(e,t){if(super(e,t),this.filters2D=g(this.filter),this.filtersIsOriginally2D=m(this.filter),this.filtersIsDynamic=this.filters2D.filter((e=>b(h(e)))).length>0,this.filtersIsDynamic&&this.filters2D.length>1)throw new Error('Only one "Dynamic Filter" must be observed at a time! "'+this.filters2D.map((e=>"["+e.join(", ")+"]")).join(", ")+'" have been bound together.')}fire(e){if(this.disconnected||this.params.type&&(t=e=>this.params.type===e.type,!e.reduce(((e,r,n)=>e||t(r)),!1)))return;var t;const r=e=>!["set","def"].includes(e.type)||!this.params.diff||(s(this.params.diff)?this.params.diff(e.value,e.oldValue):e.value!==e.oldValue);var n=new D(this.target);if(this.filters2D.length){var i=e.filter((e=>this.filters2D.filter(((t,n)=>{var s=t.slice();return this.filtersIsDynamic&&e.path.forEach(((e,t)=>{s[t]=s[t]||0===s[t]?s[t]:e})),(!this.filtersIsDynamic||!b(s))&&r(e)&&(!this.params.subtree&&p(s,e.path)||this.params.suptree&&x(s,e.path)&&(!a(this.params.suptree)||M(s,e.path).length<=this.params.suptree)||this.params.subtree&&e.path.length>=s.length&&x(e.path,s)&&(!a(this.params.subtree)||M(e.path,s).length<=this.params.subtree))})).length));if(i.length)if(this.filtersIsOriginally2D||this.params.subtree){var l=i;o(this.filter)&&(l={...this.filter},i.forEach(((e,t)=>{l[e.name]=e}))),n.respondWith(this.handler(l,n))}else i.forEach(((e,t)=>{n.respondWith(this.handler(e,n))}))}else(this.params.subtree||e.filter((e=>p(e.path,[e.name]))).length===e.length)&&e.filter((e=>r(e))).length&&n.respondWith(this.handler(e,n));return n}}class A{constructor(e,t){if(this.target=e,t.originalSubject||(this.originalSubject=e),!("type"in t))throw new Error("Mutation type must be given in definition!");if(!("name"in t))throw new Error("Property name must be given in definition!");O(t,((e,t)=>{"path"===e&&(t=d.resolve(t)),Object.defineProperty(this,e,{value:t,enumerable:!0})})),this.path||Object.defineProperty(this,"path",{value:d.resolve([t.name]),enumerable:!0}),Object.seal(this)}}class R extends v{constructor(e){super(e),this.buffers=[]}add(e){return super.add(new T(this.target,e))}fire(e,t){var r=new D(this.target,t);return e=h(e,!1).map((e=>e instanceof A?e:new A(this.target,e))),this.buffers.length?($(this.buffers)(e),r):(this.currentlyFiring.filter((t=>e.filter((e=>t.type===e.type&&t.name===e.name)).length)).length,this.fireables.forEach((n=>{if(r.propagationStopped&&t)return r;r.respondWith(n.fire(e))})),r)}static getFirebase(e,t=!0,r=null){return super._getFirebase("observer",...arguments)}static namespace(e,t=null){return super._namespace("observer",...arguments)}}function N(e,n,s=null,i={}){if(!(e=s||e)||!c(e))throw new Error("Target must be of type object!");e=P(e);var a=h(n),o=a.map((r=>{var n,o=function(n){return arguments.length?n:t(e,"accessorizedProps").has(r)&&t(e,"accessorizedProps").get(r).touch(!0)?t(e,"accessorizedProps").get(r).get():s?Reflect.get(e,r,s):Reflect.get(e,r)};return(n=E.getFirebase(e,!0,i.namespace))?n.fire({type:"get",name:r,related:a,receiver:s},o):o()}));return r(n)?o:o[0]}function F(e,t,n=!1,i=!1,l=!1){var u=0,h=e.shift();if((a(h)||!0===h||!1===h)&&(u=h,h=e.shift()),!e.length)throw new Error("_merge() requires two or more array/objects.");return e.forEach(((e,p)=>{var f,g,d;(c(e)||s(e))&&(n?(f=e,d=[],function(e,t){t=(t=t||Object.prototype)&&!r(t)?[t]:t;var n=[];for(e=e;e&&(!t||t.indexOf(e)<0)&&"default"!==e.name;)n.push(e),e=e?Object.getPrototypeOf(e):null;return n}(f,g).forEach((e=>{!function(e,...t){t.forEach((t=>{e.indexOf(t)<0&&e.push(t)}))}(d,...Object.getOwnPropertyNames(e))})),d):Object.getOwnPropertyNames(e)).forEach((s=>{if(t(s,h,e,p)){var c=h[s],f=e[s];if((r(c)&&r(f)||o(c)&&o(f))&&(!0===u||u>0))h[s]=r(c)&&r(f)?[]:{},F([a(u)?u-1:u,h[s],c,f],t,n,i,l);else if(r(h)&&r(e))i?h[s]=f:h.push(f);else try{l?Object.defineProperty(h,s,Object.getOwnPropertyDescriptor(e,s)):h[s]=e[s]}catch(e){}}}))})),h}function W(...e){return F(e,((e,t,r)=>!0),!1,!1,!1)}function Q(t,r,n=null,i={}){if(!(t=P(t))||!c(t))throw new Error('Observable subjects must be of type object; "'+e(t)+'" given!');if(s(r)&&(i=arguments.length>2?n:{},n=r,r=null),!s(n))throw new Error('Handler must be a function; "'+e(n)+'" given!');var a,o=R.getFirebase(t,!0,i.namespace),l={filter:r,handler:n,params:i};if((l.filter||"*"===l.params.subtree||l.params.subtree&&L(t))&&z(t,l.filter,l.params.subtree,i.namespace),l.params.unique&&(a=o.match({filter:r,params:i})).length){if("replace"!==l.params.unique)return a[0];o.remove(a[0])}return o.add(l)}function q(e,t,r,n=null,s={}){var i;if(e!==r&&(Q(r,((r,n)=>{if(i=R.getFirebase(e,!1,s.namespace)){var a=r.map((r=>{var n=r;do{if(n.target===e)return}while(n=n.src);var s={};return O(r,((e,t)=>{"target"!==e&&"name"!==e&&"path"!==e&&"src"!==e&&(s[e]=t)})),s.name=t,s.path=[t].concat(r.path),s.originalSubject=r.originalSubject,s.src=r,new A(e,s)})).filter((e=>e));if(a.length)return i.fire(a,n.cancellable)}}),{subtree:!0,...s,unique:!0,tags:[I,t,e]}),o(n)&&(i=R.getFirebase(e,!1,s.namespace)))){var a=W({name:t,type:"set",value:r,related:[t]},n);let e=i.fire(a,s.cancellable);if(s.eventTypeReturn)return e}}const I={};function z(e,t=null,r=!1,n=null){if(!e||!c(e))throw new Error("Target must be of type object!");var s=R.getFirebase(e,!0,n);if(s&&!s.build){s.build=r;var i=g(t),a=!i.length||i.filter((e=>!e[0]&&0!==e[0])).length?Object.keys(e):i.map((e=>e[0])),o=i.length?i.map((e=>e.slice(1))).filter((e=>e.length)):null;s.subBuild=o&&o.length?o:null,a.forEach((t=>{var i=N(e,t,null,{namespace:n});try{c(i)&&(q(e,t,i,null,params),(s.subBuild&&L(i)||(_isFunction(r)?r(i):r&&L(i)))&&z(i,s.subBuild,r,n))}catch(e){}}))}}const L=e=>(e instanceof Object||e instanceof Array||e instanceof Function)&&("undefined"==typeof window||e!==window);function V(t,r,n=null,i={}){if(!(t=P(t))||!c(t))throw new Error('Observable subjects must be of type object; "'+e(t)+'" given!');if(s(r)&&(i=arguments.length>2?n:{},n=r,r=null),n&&!s(n))throw new Error('Handler must be a function; "'+e(n)+'" given!');var a;if(a=R.getFirebase(t,!1,i.namespace))return a.removeMatches({filter:r,originalHandler:n,params:i})}function H(e,t,r,n=null,s={}){var i;if(V(r,null,null,{...s,tags:[I,t,e]}),o(n)&&(i=R.getFirebase(e,!1,s.namespace))){var a=W({name:t,type:"del",oldValue:r,related:[t]},n);i.fire(a,s.cancellable)}}function U(e,t,r={}){return k("has",e,{name:t},r)}function B(e,n,s,a={}){n=s.receiver||n;var u=s.keysOrPayload,p=s.value;if(!n||!c(n))throw new Error("Target must be of type object!");o(u)&&(a=p||{},p=null),n=P(n);var f=E.getFirebase(n,!1,a.namespace),g=R.getFirebase(n,!1,a.namespace);const d=(r,i,o,l)=>{var u,h="set";e&&(h="defineProperty",i=(u=i||{}).value);var p,d=!1;U(n,r,a)&&(d=!0,p=N(n,r,s.receiver,a));var m={name:r,type:h,value:i,receiver:s.receiver,related:o,detail:l,isUpdate:d,oldValue:p},b=function(e){return arguments.length&&(u?u=e:i=e),u?!(t(n,"accessorizedProps",!1).has(r)&&!t(n,"accessorizedProps").get(r).restore()||(Object.defineProperty(n,r,u),0)):t(n,"accessorizedProps",!1).has(r)?t(n,"accessorizedProps").get(r).set(i):(n[r]=i,!0)};if(f){var v=u?{type:"defineProperty",name:r,descriptor:u,receiver:s.receiver,related:o,detail:l,isUpdate:d,oldValue:p}:{type:"set",name:r,value:i,receiver:s.receiver,related:o,detail:l,isUpdate:d,oldValue:p};m.success=f.fire(v,b)}else m.success=b();return m.success&&m.value!==m.oldValue&&(c(m.oldValue)&&H(n,r,m.oldValue,null,a),c(m.value)&&(q(n,r,m.value,null,a),g&&(g.subBuild||g.build&&L(m.value))&&z(m.value,g.subBuild,g.build,a.namespace))),m};var m,b=[];r(u)||(l(u)||i(u))&&(m=h(u))?b=m.map((e=>d(e,p,m,a.detail))):o(u)&&(m=Object.keys(u))&&(b=m.map((e=>d(e,u[e],m,a.detail))));var v,y=b.filter((e=>!1!==e.success));return g?(v=g.fire(y,a.cancellable)).successCount=y.length:a.eventTypeReturn&&(v=new D(n)),a.eventTypeReturn?v:y.length>0}function G(e,t,r=null,n={}){return B(!0,e,{keysOrPayload:t,value:r},n)}function K(e,r,n={}){if(!e||!c(e))throw new Error("Target must be of type object!");e=P(e);var s,i,a=h(r),o=a.map((r=>{var s;U(e,r,n)&&(s=N(e,r,null,n));var i,o={name:r,type:"deleteProperty",related:a,detail:n.detail,oldValue:s},l=function(n){return arguments.length?n:!(t(e,"accessorizedProps",!1).has(r)&&!t(e,"accessorizedProps").get(r).restore()||(delete e[r],0))};return(i=E.getFirebase(e,!1,n.namespace))?o.success=i.fire({type:"deleteProperty",name:r,oldValue:s,related:a},l):o.success=l(),o.success&&c(o.oldValue)&&H(e,r,o.oldValue,null,n),o})),l=o.filter((e=>!1!==e.success));return(s=R.getFirebase(e,!1,n.namespace))?(i=s.fire(l,n.cancellable)).successCount=l.length:n.eventTypeReturn&&(i=new D(e)),n.eventTypeReturn?i:l.length>0}function J(e,t,r={}){return k("getOwnPropertyDescriptor",e,{name:t},r)}function X(e,t={}){return k("getPrototypeOf",e,{},t)}function Y(e,t={}){return k("isExtensible",e,{},t)}function Z(e,t={}){return k("ownKeys",e,{},t)}function ee(e,t={}){return k("preventExtensions",e,{},t)}function te(e,t,r=null,n=null,s={}){return B(!1,e,arguments.length>3?{keysOrPayload:t,value:r,receiver:n}:{keysOrPayload:t,value:r},s)}function re(e,t,r={}){return k("setPrototypeOf",e,{prototype:t},r)}function ne(e,t=[],n=!0){var i=0;return a(arguments[0])&&c(arguments[1])&&(i=arguments[0],e=arguments[1],t=arguments[2]||[]),F([i,{},e],((e,n,i)=>s(t)?t(e):!r(t)||!t.length||t.indexOf(e)>-1),!1,!1,n)}const se={apply:S,construct:C,defineProperty:G,deleteProperty:K,get:N,getOwnPropertyDescriptor:J,getPrototypeOf:X,has:U,isExtensible:Y,ownKeys:Z,preventExtensions:ee,set:te,setPrototypeOf:re,accessorize:function(e,n=[],s={}){s=o(n)?n:s;var i=(1===arguments.length?Object.keys(e):h(n)).map((r=>{if(t(e,"accessorizedProps").has(r)&&t(e,"accessorizedProps").get(r).touch(!0))return!1;const n=()=>{for(var t,n=e;!t&&(n=Object.getPrototypeOf(n));)t=Object.getOwnPropertyDescriptor(n,r);return t};var i,a,o=Object.getOwnPropertyDescriptor(e,r);o||(i={writable:!0,enumerable:!(r in e),configurable:!1!==s.configurable});var l={...o||i};"value"in l&&delete l.value,"writable"in l&&delete l.writable,l.get=()=>{if(c.ongoingGets.length)return c.get();c.ongoingGets.push(1);var t=N(e,r,null,s);return c.ongoingGets.pop(),t},l.set=t=>{if(c.ongoingSets.length)return c.set(t);c.ongoingSets.push(1);var n=te(e,r,t,null,s);return c.ongoingSets.pop(),n};var c={ongoingGets:[],ongoingSets:[],get:function(){var t=o;return t||(t=a?i:n()||i),t.get?t.get.call(e):t.value},set:function(t){var r=o;return r||(a?r=i:(r=n())?"value"in r&&(r=i,a=!0):(r=i,a=!0)),r.set||r.get?!!r.set&&r.set.call(e,t):(r.value=t,!0)},restore:function(){try{return this.intact()&&(o||a?Object.defineProperty(e,r,o||i):delete e[r],t(e,"accessorizedProps").delete(r)),!0}catch(e){}return!1},intact:function(){return(Object.getOwnPropertyDescriptor(e,r)||{}).get===l.get},touch:function(e=!1){return this.intact()||!!e&&!this.restore()}};try{return Object.defineProperty(e,r,l),t(e,"accessorizedProps").set(r,c),!0}catch(e){}return!1}));return r(n)?i:i[0]},unaccessorize:function(e,n=[],s={}){s=o(n)?n:s;var i=(1===arguments.length?Object.keys(e):h(n)).map((r=>!t(e,"accessorizedProps",!1).has(r)||t(e,"accessorizedProps").get(r).restore()));return r(n)?i:i[0]},proxy:function(r,i={}){if(!c(r))throw new Error('Object must be of type target; "'+e(r)+'" given!');var a=new Proxy(r,{apply:(e,t,r)=>S(e,t,r,i),construct:(e,t,r=null)=>C(e,t,r,i),defineProperty:(e,t,r)=>G(e,t,r,i),deleteProperty:(e,t)=>K(e,t,i),get:(e,t,r=null)=>{var o=N(e,t,r,i);return!1!==i.proxyAutoBinding&&s(o)&&!function(e){return n(e)&&/^class\s?/.test(Function.prototype.toString.call(e))}(o)?o.bind(a):o},getOwnPropertyDescriptor:(e,t)=>J(e,t,i),getPrototypeOf:e=>X(e,i),has:(e,t)=>U(e,t,i),isExtensible:e=>Y(e,i),ownKeys:e=>Z(e,i),preventExtensions:e=>ee(e,i),set:(e,t,r,n=null)=>te(e,t,r,n,i),setPrototypeOf:(e,t)=>re(e,t,i)});return t(a).set(a,r),a},unproxy:P,observe:Q,unobserve:V,intercept:function(t,r,n={}){if(!c(t=P(t)))throw new Error('Object must be of type target; "'+e(handler)+'" given!');var i={},a=!0;o(r)||(s(r)?r={"":r}:s(n)&&(r={[r]:n},n=arguments.length>3?arguments[3]:{}),a=!1);var l=E.getFirebase(t,!0,n.namespace);return Object.keys(r).forEach((t=>{if(!s(r[t]))throw new Error("Callback"+(null===t?"":" for "+t)+' must be a function; "'+e(r[t])+'" given!');var o,c={filter:t,handler:r[t],params:n};if(c.params.unique&&(o=l.match(c)).length){if("replace"!==c.params.unique)return o[0];l.remove(o[0])}a?i[t]=l.add(c):i=l.add(c)})),i},unintercept:function(t,r=null,n={}){if(!(t=P(t))||!c(t))throw new Error('Object must be of type target; "'+e(t)+'" given!');var i=E.getFirebase(t,!1,n.namespace);_isObject(r)||(s(r)?r={[null]:r}:s(n)&&(r={[r]:n},n=arguments.length>3?arguments[3]:{}),isOriginallyObj=!1),(i=E.getFirebase(t,!1,n.namespace))&&Object.keys(r).forEach((t=>{if(!s(r[t]))throw new Error("Callback"+(null===t?"":" for "+t)+' must be a function; "'+e(r[t])+'" given!');var a={filter:t,originalHandler:r[t],params:n};return i.removeMatches(a)}))},closure:function(e,...t){var n=t.map((e=>{if(!c(e=P(e)))throw new Error("Target must be of type object!");return{target:e,subjectCopy:r(e)?e.slice(0):ne(e)}})),s=e(...t);const i=()=>{n.map((e=>{var t,r,n=Object.keys(e.subjectCopy),s=Object.keys(e.target),i=[],a=(t=n.concat(s),t.filter(((e,t,r)=>r.indexOf(e)===t))).map((t=>{if(e.subjectCopy[t]!==e.target[t]){i.push(t);var r={name:t,related:i,buffered:!0};return s.includes(t)?(r.type="set",r.value=e.target[t],n.includes(t)&&(r.isUpdate=!0)):r.type="del",n.includes(t)&&(r.oldValue=e.subjectCopy[t]),c(e.subjectCopy[t])&&H(e.target,t,e.subjectCopy[t]),c(e.target[t])&&q(e.target,t,e.target[t]),r}})).filter((e=>e));if(a.length&&(r=R.getFirebase(e.target,!1)))return r.fire(a)}))};return s instanceof Promise?s.then(i):i(),s},build:z,link:q,unlink:H,Observers:R,Interceptors:E};function ie(e,t,n=null){return r(t)?e.filter((e=>n?t.filter((t=>n(e,t))).length:-1===t.indexOf(e))):[]}function ae(e){return!Array.isArray(e)&&"object"==typeof e&&e}function oe(){if(!(ae(this)&&this.window||"undefined"!=typeof window))throw new Error("A window context is required.");const e=ae(this)&&this.window?this.window:window;if(e.WebQit||(e.WebQit={}),!e.WebQit.window){let t,r;Object.defineProperty(e.WebQit,"window",{get:()=>e}),Object.defineProperty(e.WebQit,"vendor",{value:{getName:()=>(t||(t=function(e){if(void 0!==e.InstallTrigger)return"firefox";if(/constructor/i.test(e.HTMLElement)||"[object SafariRemoteNotification]"===(!e.safari||void 0!==e.safari&&e.safari.pushNotification).toString())return"safari";var t=!(!e.chrome||!e.chrome.webstore&&!e.chrome.runtime),r=t&&-1!=e.navigator.userAgent.indexOf("Edg"),n=!!e.opr&&!!e.opr.addons||!!e.opera||e.navigator.userAgent.indexOf(" OPR/")>=0,s=!!e.document.documentMode,i=!s&&!!e.StyleMedia;return(t||n)&&e.CSS,i?"edge":s?"ie":n?"opera":r?"ie-chromium":t?"chrome":"unknown"}(e)),t),getPrefix:()=>(r||(r=function(e){var t=e.getComputedStyle(e.document.documentElement,""),r=(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.Olink&&["","o"])[1];return{api:("WebKit|Moz|Ms|O".match(new RegExp("("+r+")","i"))||[])[1],prefix:r,css:"-"+r+"-"}}(e)),r)}})}return e.WebQit}class le{constructor(e,t=!0){this.window=e,this.async=t,this.readCallbacks=[],this.writeCallbacks=[],this._run()}_run(){this.window.requestAnimationFrame((()=>{this.readCallbacks.forEach(((e,t)=>{e&&!e()&&(this.readCallbacks[t]=null)})),this.writeCallbacks.forEach(((e,t)=>{e&&!e()&&(this.writeCallbacks[t]=null)})),this._run()}))}onread(e,t=!1){if(t)return new Promise(((t,r)=>{!1===this.async?e(t,r):this.readCallbacks.push((()=>{e(t,r)}))}));!1===this.async?e():this.readCallbacks.push(e)}onwrite(e,t=!1){if(t)return new Promise(((t,r)=>{!1===this.async?e(t,r):this.writeCallbacks.push((()=>{e(t,r)}))}));!1===this.async?e():this.writeCallbacks.push(e)}cycle(e,t,r){this.onread((()=>{var n=e(r);if(n){var s=n=>{this.onwrite((()=>{var s=t(n,r);if(s){var i=r=>{this.cycle(e,t,r)};s instanceof Promise?s.then(i):i()}}))};n instanceof Promise?n.then(s):s()}}))}}function ce(e){return e instanceof String||"string"==typeof e&&null!==e}function ue(e){return Array.isArray(e)}function he(e){return arguments.length&&(void 0===e||void 0===e)}function pe(e){return null===e||""===e}function fe(e){return"function"==typeof e}function ge(e){return Array.isArray(e)||"object"==typeof e&&e||fe(e)}function de(e,t=!0){return ue(e)?e:!t&&ae(e)?[e]:!1!==e&&0!==e&&function(e){return pe(e)||he(e)||!1===e||0===e||ge(e)&&!Object.keys(e).length}(e)?[]:function(e){return!ce(e)&&!he(e.length)}(e)?Array.prototype.slice.call(e):ae(e)?Object.values(e):[e]}function me(e){const t=oe.call(this);t.DOM.isDOMReady||"complete"===t.window.document.readyState?e(t.window):(t.window.domReadyCallbacks||(t.window.domReadyCallbacks=[],t.window.document.addEventListener("DOMContentLoaded",(()=>{t.DOM.isDOMReady=!0,t.window.domReadyCallbacks.splice(0).forEach((e=>e(t.window)))}),!1)),t.window.domReadyCallbacks.push(e))}class be{constructor(e){this.window=e}onAdded(e,t,r={}){return r.on="added",this.onPresenceChange(e,((e,r,n,s,i)=>{t(e,r,n,s,i)}),r)}onRemoved(e,t,r={}){return r.on="removed",this.onPresenceChange(e,((e,r,n,s,i)=>{t(e,r,n,s,i)}),r)}onPresent(e,t,r={}){me.call(this.window,(()=>{this.window.MutationObserver&&this.onAdded(e,((e,r)=>{e.forEach((e=>t(e,r)))}),r),ce(e)?de(this.window.document.querySelectorAll(e)).forEach((e=>t(e,1))):e.parentNode&&t(e,1)}))}onAbsent(e,t,r={}){me.call(this.window,(()=>{this.window.MutationObserver&&onRemoved(e,((e,r)=>{e.forEach((e=>t(e,r)))}),r),ce(e)?0===de(this.window.document.querySelectorAll(e)).length&&t(null,0):e.parentNode||t(e,0)}))}onPresenceChange(e,t,r={}){e=de(e,!1);var n=new Set,s=new Set,i=(i,a,o)=>{a&&"removed"===r.on||!a&&"added"===r.on||(i=((e,t)=>(t.$$searchCache||(t.$$searchCache=new Map),e.reduce(((e,n)=>{var s;return t.$$searchCache.has(n)?s=t.$$searchCache.get(n):(s=((e,t)=>{if(t=t.filter((e=>e.matches)),ce(e)){var n=t.filter((t=>t.matches(e)));if(!1!==r.observeIndirectMutation&&(n=t.reduce(((t,r)=>t.concat(de(r.querySelectorAll(e)))),n)).length)return n}else{if(t.includes(e))return[e];if(!1!==r.observeIndirectMutation&&t.length)for(var s=e;s=s.parentNode;)if(t.includes(s))return[e]}})(n,t,ce(n))||[],t.$$searchCache.set(n,s)),e.concat(s)}),[])))(e,i)).length&&(r.maintainCallState?(i.forEach((e=>{a?(n.add(e),s.delete(e)):(n.delete(e),s.add(e))})),t(i,a,o,n,s)):t(i,a,o))},a=r.context||this.window.document.documentElement;return this._observe(a,((e,t,n,s)=>{r.ignoreTransients||(i(e,0,!0),i(e.concat(t),1,!0),i(t,0,!0)),i(s,0),i(n,1)}))}onAttrChange(e,t,r=[]){var n=new this.window.MutationObserver(t),s={attributes:!0,attributeOldValue:!0};return r&&(s.attributeFilter=r),n.observe(e,s),n}onTreeChange(e,t,r=!1){var n=new this.window.MutationObserver(t),s={childList:!0,subtree:r};return n.observe(e,s),n}onMutation(e,t,r){var n=new this.window.MutationObserver(t);return n.observe(e,r),n}_observe(e,t){if(!ve.has(e)){const t=new Set,r=new this.window.MutationObserver((e=>{if(t.size){var r=e.reduce(((e,t)=>e.concat(de(t.addedNodes))),[]),n=e.reduce(((e,t)=>e.concat(de(t.removedNodes))),[]),s=[],i=[];r=new Set(r),n=new Set(n),r.forEach((e=>{n.has(e)&&(n.delete(e),r.delete(e),e.isConnected?s.push(e):i.push(e))})),r=[...r],n=[...n],t.forEach((e=>e(s,i,r,n)))}}));r.observe(e,{childList:!0,subtree:!0}),ve.set(e,{callbacks:t,observer:r})}const r=ve.get(e);return r.callbacks.add(t),{disconnect(){r.callbacks.delete(t)},reconnect(){r.callbacks.add(t)}}}}const ve=new Map;function ye(e,t=null,r=!1){const n=oe.call(this);if(ce(e)){var s;if(e.trim().startsWith("<")){var i=n.window.document.createElement("div");i.innerHTML=e,s=r?de(i.children):i.firstChild}else s=r?de(je.call(this,e,t)):Oe.call(this,e,t);return s}return e instanceof n.window.Element?r?[e]:e:r?de(e):e}function we(e,t=null){return ye.call(this,e,t,!0)}function Oe(e,t=null,r=!1){const n=oe.call(this);t=t||n.window.document;var s,i=r?"querySelectorAll":"querySelector";try{s=t[i](e)}catch(r){try{s=t[i](e.replace(/\:is\(/g,":matches("))}catch(r){try{s=t[i](e.replace(/\:is\(/g,":-webkit-any("))}catch(r){try{s=t[i](e.replace(/\:is\(/g,":-moz-any("))}catch(e){throw e}}}}return s}function je(e,t=null){return Oe.call(this,e,t,!0)}function Ee(e){return function(e){return e instanceof Number||"number"==typeof e}(e)||!0!==e&&!1!==e&&null!==e&&""!==e&&!isNaN(1*e)}function Pe(e){return fe(e)||e&&"[object function]"==={}.toString.call(e)}function ke(e,t,r={},n={}){t=de(t).slice();for(var s=e;!he(s)&&!pe(s)&&t.length;){var i=t.shift();if(!(r.get?r.get(s,i):ge(s)?i in s:s[i]))return void(n.exists=!1);s=r.get?r.get(s,i):s[i]}return n.exists=!0,s}function Se(e,t,r,n={},s={}){const i=(e,r,n)=>s.set?s.set(e,r,n):(Ee(t[o])&&ue(e)?e.push(n):e[r]=n,!0);t=de(t);for(var a=e,o=0;o<t.length;o++){if(!(o<t.length-1))return i(a,t[o],r);if(!a||!ge(a)&&!Pe(a))return!1;var l=ke(a,t[o],s);if(!ge(l)){if(!1===s.buildTree)return!1;if(l=Pe(s.buildTree)?s.buildTree(o):Ee(t[o+1])?[]:{},!i(a,t[o],l))return!1}a=l}}function Ce(e,t,r=!1,n={}){t=de(t);var s=!1;do{var i=""===(i=t.pop())?0:i,a=e;t.length&&(a=ke(e,t,{},n)),(ge(a)||Pe(a))&&(n.has?n.has(a,i):i in a)&&(n.deleteProperty?s=n.deleteProperty(a,i):n.del?s=n.del(a,i):(delete a[i],s=!0))}while(s&&r&&t.length&&(ge(a)||Pe(a))&&!(n.keys?n.keys(a):Object.keys(a)).length);return s}function _e(e,t,r={}){var n={};return ke(e,t,r,n),n.exists}function $e(e,t=!1){const r=oe.call(this);var n={};return!(n.el=r.window.document.head.querySelector('meta[name="oohtml"]'))&&t&&(n.el=r.window.document.createElement("meta"),n.el.setAttribute("name",e),r.window.document.head.append(n.el)),n.el&&(n.vars=(n.el.getAttribute("content")||"").split(";").filter((e=>e)).reduce(((e,t)=>{var r=t.split("=").map((e=>e.trim()));return Se(e,r[0].split("."),"true"===r[1]||"false"!==r[1]&&(Ee(r[1])?parseInt(r[1]):r[1])),e}),{})),n.get=function(e){return ke(this.vars,e.split("."))},n.set=function(e,r=null,n=!1){var s=ae(e)?e:{[e]:!0===r?"true":r};if(n=arguments.length<3?r:n,Object.keys(s).forEach((e=>{if(!1===s[e])Ce(this.vars,e.split("."));else if(ae(s[e]))Object.keys(s[e]).forEach((t=>{var r=(e+"."+t).split(".");n&&_e(this.vars,r)||Se(this.vars,r,s[e][t])}));else{var t=e.split(".");n&&_e(this.vars,t)||Se(this.vars,t,s[e])}})),t){const e=(t,r)=>Object.keys(r).reduce(((n,s)=>{var i=(t?t+".":"")+s;return ae(r[s])?n.push(...e(i,r[s])):n.push(i+"="+r[s]),n}),[]);this.el.setAttribute("content",e("",this.vars).join(";"))}return!0},n.defaults=function(e,t=null){return this.set(e,t,!0)},n}function xe(){const e=oe.call(this);return e.DOM||(e.DOM={},function(e){!function(e){e.CSS||(e.CSS={}),e.CSS.escape||(e.CSS.escape=e=>e.replace(/([\:@\~\$\&])/g,"\\$1"))}(e),function(e){"isConnected"in e.Node.prototype||Object.defineProperty(e.Node.prototype,"isConnected",{get:function(){return!(this.ownerDocument&&this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}(e),function(e){e.Element.prototype.matches||(e.Element.prototype.matches=e.Element.prototype.matchesSelector||e.Element.prototype.mozMatchesSelector||e.Element.prototype.msMatchesSelector||e.Element.prototype.oMatchesSelector||e.Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),r=t.length;--r>=0&&t.item(r)!==this;);return r>-1})}(e)}(e.window),e.DOM.reflow=new le(e.window),e.DOM.mutations=new be(e.window),e.DOM.meta=$e.bind(e.window),e.DOM.query=ye.bind(e.window),e.DOM.queryAll=we.bind(e.window),e.DOM.ready=me.bind(e.window)),e}const Me=function(e,t=1,n=!0){return!a(t)||t<=0?e:(!r(e)&&o(e)&&n&&(e=Object.values(e)),r(e)?e.reduce(((e,s)=>r(s)||o(s)&&n?e.concat(Me(r(s)?s:Object.values(s),t-1,n)):e.concat(s)),[]):e)},De=Me;function Te(e){return o(e)&&Object.getPrototypeOf(e)===Object.prototype}function Ae(e){return!0===e||!1===e}const Re=function(e,t,n=!0,a=1){if(r(e)&&r(t)&&e.length!==t.length)return!n;if(o(e)&&o(t)){var l=Object.keys(e),u=Object.keys(t);if(!l.length&&!u.length)return Te(e)&&Te(t)?n:e===t===n;if(!Re(l,u))return!n}if(a>0&&(r(e)&&r(t)||o(e)&&o(t))){var h=function(e,t,n=!0,s=!0,i=!1,a=!1){if(r(e)&&r(t)){var l=[],u=!0;return e.forEach((e=>{if(u){var h=!1;O(t,((t,i)=>{(!h||s&&c(e))&&((r(h=n(e,i))&&!h.length||o(h)&&!Object.keys(h).length)&&(h=!1),c(h)&&s&&(e=h))})),c(h)?l.push(s?h:e):Ae(h)?i&&!h||!i&&h?l.push(e):a&&(u=!1):l.push(h)}})),l}if(o(e)&&o(t))return l={},u=!0,Object.keys(e).forEach((h=>{if(u){var p=n(e[h],t[h]);(r(p)&&!p.length||o(p)&&!Object.keys(p).length)&&(p=!1),c(p)?l[h]=s?p:e[h]:Ae(p)?i&&!p||!i&&p?l[h]=e[h]:a&&(u=!1):l[h]=p}})),l}(e,t,((e,t)=>Re(e,t,n,a-1)),!1,!1,!0);return r(h)?h.length===e.length&&h.length===t.length:o(h)&&o(e)?Object.keys(h).length===Object.keys(e).length&&Object.keys(h).length===Object.keys(t).length:h}return s(n)?n(e,t):i(e)&&i(t)&&isNaN(e)&&isNaN(t)?n:e===t===n},Ne=Re;function Fe(e,t=[]){return F([{},e],((e,n,i)=>{if(!s(i[e]))return s(t)?t(e):!r(t)||!t.length||t.indexOf(e)>-1}),!1,!1,!1)}class We{static lex(e,t,r={}){if(!l(e+=""))throw new Error("Argument1 must be a string!");var n=e=>({delims:e.delims.slice(),options:Fe(e.options),nesting:e.nesting.slice(),maxDepth:e.maxDepth,comments:e.comments.slice(),tokens:e.tokens.slice(),matches:e.matches.slice(),matchesi:Fe(e.matchesi)});if(We.$cache[e]&&!1!==r.cache)for(var s=0;s<We.$cache[e].length;s++){var i=We.$cache[e][s];if(Ne(i.delims,t))return n(i)}var a=new We(e,r).lex(t);return!1!==r.cache&&(We.$cache[e]=We.$cache[e]||[],We.$cache[e].push(a)),n(a)}static split(e,t,r){return We.lex(e,t,r).tokens}static match(e,t,r){return We.lex(e,t,r).matches}constructor(e,t){if(!l(e))throw new Error("Lexer requires the first argument to be a string.");this.$str=e,this.$options=t||{},this.$options.blocks||(this.$options.blocks=We.$blocks),this.$options.quotes||(this.$options.quotes=We.$quotes),this.$options.comments||(this.$options.comments=We.$comments)}lex(e,t){for(var r={delims:h(e),options:W(!0,{},this.$options,t||{}),nesting:[],maxDepth:0,comments:[],tokens:[],matches:[],matchesi:{}},n=0;"number"==typeof n;)n=this._evalCharsAt(r,n);if(r.nesting.length)throw new Error("Error parsing the string: "+this.$str+". Unterminated blocks: "+De(r.nesting).join(", "));return r}_evalCharsAt(e,t){if(!(t>=this.$str.length)){var r=1,n={},s={},i={};if(e.openComment||(s=this._testQuotes(e,t)),e.openQuote||(n=this._testComments(e,t)),e.openComment||n.ending)e.nesting.length||i.ending?this._push(e,this.$str[t]):(r=(o=n.starting||n.ending||this.$str[t]).length,this._push(e,o,"comments",n.starting));else if(e.openQuote||s.ending)this._push(e,this.$str[t]);else{if(e.options.limit&&e.matches.length===e.options.limit)return this._push(e,this.$str[t]),t+1;i=this._testNesting(e,t),i=this._testNesting(e,t);var a=this._testChars(e.options.stopChars||[],e,t);if(!e.nesting.length&&!1!==a)return e.options.stopChar=a,void(e.options.stopCharForward=this.$str.substr(t));if(e.delims.length)if(e.nesting.length||i.ending){var o;r=(o=i.starting||i.ending||this.$str[t]).length,this._push(e,o)}else{this._push(e,"");var l=this._testChars(e.delims,e,t);if(!1!==l&&(e.matches.push(l),e.matchesi[t]=l,r=l.length||1,!e.options.preserveDelims)){var c=t+(l.length||1);return c===this.$str.length&&this._push(e,""),c}this._push(e,l||this.$str[t])}else 2===e.nesting.length&&i.starting?(e.matches.push(null),this._push(e,i.starting),r=i.starting.length):!e.nesting.length&&i.ending?(this._push(e,i.ending),r=i.ending.length,e.matches.push(null)):this._push(e,this.$str[t])}return t+r}}_testQuotes(e,t){var r={};return(e.options.quotes||[]).forEach((n=>{this.$str.substr(t,1)===n&&(e.openQuote?n===e.openQuote&&(e.openQuote=!1,r.ending=n):(e.openQuote=n,r.starting=n))})),r}_testComments(e,t){var r={};return(e.options.comments||[]).forEach((n=>{if(e.openComment){if($(n)===$(e.openComment)){var s=$(n);this.$str.substr(t).startsWith(s)&&(e.openComment=!1,r.ending=s)}}else{var i=_(n);this.$str.substr(t).startsWith(i)&&(e.openComment=n,r.starting=i)}})),r}_testNesting(e,t){var r={};return(e.options.blocks||[]).forEach((n=>{var s=_(n);if(this.$str.substr(t).startsWith(s))e.nesting=e.nesting.concat([n]),r.starting=s;else if(e.nesting.length&&$(n)===$($(e.nesting))){var i=$(n);this.$str.substr(t).startsWith(i)&&(e.nesting=e.nesting.slice(0,-1),r.ending=i)}})),e.maxDepth=Math.max(e.maxDepth,e.nesting.length),r}_testChars(e,t,r){for(var n=0;n<e.length;n++){var i=e[n];if(s(i)){var a=i(this.$str.substr(0,r),this.$str.substr(r),t.tokens.slice());if(!1!==a)return a}if(t.options.useRegex){var o=this.$str.substr(r).match(new RegExp("^"+i,!0!==t.options.useRegex?t.options.useRegex:""));if(o)return o[0]}if(!t.options.ci&&this.$str.substr(r,i.length)===i||t.options.ci&&this.$str.substr(r,i.length).toLowerCase()===i.toLowerCase())return i}return!1}_push(e,t,r="tokens",n=!1){var s=e.matches.length;if(u(e.tokens[s])&&(e.tokens[s]=""),"comments"===r){e.tokens[s].comments||(e.tokens[s]=new String(e.tokens[s]),e.tokens[s].comments=[]);var i=e.tokens[s].comments.length-(!e.tokens[s].comments.length||n?0:1);e.tokens[s].comments[i]=(e.tokens[s].comments[i]||"")+t}else e.tokens[s].comments,e.tokens[s]=e.tokens[s]+t}split(e,t,r){return this.lex(t,r).tokens}match(e,t,r){return this.lex(t,r).matches}regParse(e,t){return this.lex(e,W({useRegex:!0},t||{}))}regSplit(e,t){return this.regParse(e,t).tokens}regMatch(e,t){return this.regParse(e,t).matches}}function Qe(e,t={}){const r=xe.call(this);return r.OOHTML||(r.OOHTML={}),r.OOHTML.meta||(r.OOHTML.meta=r.DOM.meta("oohtml",!0)),r.OOHTML.meta.defaults(W(3,e,t)),r.OOHTML.meta}We.$blocks=[["(",")"],["[","]"],["{","}"]],We.$quotes=['"',"'","`"],We.$comments=[["/*","*/"],["//","\n"]],We.$cache=Object.create(null),function e(r={}){const n=xe.call(this);if(r.onDomReady)return void n.DOM.ready((()=>{e.call(this,{...r,onDomReady:!1})}));const s=n.window,i=n.window.document,a=Qe.call(this,{api:{state:"state",setState:"setState",clearState:"clearState"}},r.params),o=function(e,r=null){if(!t(e,"oohtml").has("state")||r){const n=r||Object.create(null),s=t(e,"oohtml").get("state");if(t(e,"oohtml").set("state",n),s&&se.unlink&&se.unlink(e,a.get("api.state"),s),se.link){let t=r?{isUpdate:!!s,oldValue:s}:null;se.link(e,a.get("api.state"),n,t)}}return t(e,"oohtml").get("state")};if(a.get("api.state")in s.Element.prototype)throw new Error('The "Element" class already has a "'+a.get("api.state")+'" property!');if(Object.defineProperty(s.Element.prototype,a.get("api.state"),{get:function(){return se.proxy(o(this))}}),a.get("api.setState")in s.Element.prototype)throw new Error('The "Element" class already has a "'+a.get("api.setState")+'" property!');if(Object.defineProperty(s.Element.prototype,a.get("api.setState"),{value:function(e,t={}){if(t.update){var r=o(this);if("merge"!==t.update){var n=ie(Object.keys(r),Object.keys(e));se.deleteProperty(r,n)}se.set(r,e)}else o(this,e)}}),a.get("api.clearState")in s.Element.prototype)throw new Error('The "Element" class already has a "'+a.get("api.clearState")+'" property!');if(Object.defineProperty(s.Element.prototype,a.get("api.clearState"),{value:function(){o(this,{})}}),a.get("api.state")in i)throw new Error('The "document" object already has a "'+a.get("api.state")+'" property!');if(Object.defineProperty(i,a.get("api.state"),{get:function(){return se.proxy(o(i))}}),a.get("api.setState")in i)throw new Error('The "document" object already has a "'+a.get("api.setState")+'" property!');if(Object.defineProperty(i,a.get("api.setState"),{value:function(e,t={}){if(t.update){var r=o(i);if("merge"!==t.update){var n=ie(Object.keys(r),Object.keys(e));se.deleteProperty(r,n)}se.set(r,e)}else o(i,e)}}),a.get("api.clearState")in i)throw new Error('The "document" object already has a "'+a.get("api.clearState")+'" property!');Object.defineProperty(i,a.get("api.clearState"),{value:function(){o(i,{})}})}.call(window)})();
2
- //# sourceMappingURL=state-api.js.map
1
+ (()=>{function g(t){return!Array.isArray(t)&&typeof t=="object"&&t}function T(t){return typeof t}function v(t,...e){globalThis.WebQitInternalsRegistry||(globalThis.WebQitInternalsRegistry=new Map);var r=globalThis.WebQitInternalsRegistry.get(t);if(!r){if(r=new Map,e[0]===!1)return r;globalThis.WebQitInternalsRegistry.set(t,r)}for(var o,i;o=e.shift();)if((i=r)&&!(r=r.get(o))){if(r=new Map,e[0]===!1)return r;i.set(o,r)}return r}function h(t){return Array.isArray(t)}function ge(t){return t===!0||t===!1}function te(t){return typeof t=="function"}function Ye(t){return te(t)&&/^class\s?/.test(Function.prototype.toString.call(t))}function Te(t){return t===null||t===""}function A(t){return arguments.length&&(t===void 0||typeof t>"u")}function d(t){return Array.isArray(t)||typeof t=="object"&&t||te(t)}function Ke(t){return Te(t)||A(t)||t===!1||t===0||d(t)&&!Object.keys(t).length}function _(t){return te(t)||t&&{}.toString.call(t)==="[object function]"}function U(t){return t instanceof Number||typeof t=="number"}function F(t){return U(t)||t!==!0&&t!==!1&&t!==null&&t!==""&&!isNaN(t*1)}function Se(t){return g(t)&&Object.getPrototypeOf(t)===Object.prototype}function z(t){return t instanceof String||typeof t=="string"&&t!==null}function ke(t){return!z(t)&&!A(t.length)}function H(t,e=1){var r=0;t.forEach(i=>{r++});var o=t.slice(t.length-r,e);return arguments.length>1?o:o[0]}function j(t,e=1){return arguments.length>1?H(t.slice().reverse(),e).reverse():H(t.slice().reverse())}function Ce(t,...e){return e.forEach(r=>{t.indexOf(r)<0&&t.push(r)}),t}function et(o,e){e=e||Object.prototype,e=e&&!h(e)?[e]:e;for(var r=[],o=o;o&&(!e||e.indexOf(o)<0)&&o.name!=="default";)r.push(o),o=o?Object.getPrototypeOf(o):null;return r}function tt(t,e){var r=[];return et(t,e).forEach(o=>{Ce(r,...Object.getOwnPropertyNames(o))}),r}function D(t,e,r=!1,o=!1,i=!1){var s=0,n=t.shift();if((F(n)||n===!0||n===!1)&&(s=n,n=t.shift()),!t.length)throw new Error("_merge() requires two or more array/objects.");return t.forEach((f,m)=>{!d(f)&&!_(f)||(r?tt(f):Object.getOwnPropertyNames(f)).forEach(u=>{if(!!e(u,n,f,m)){var p=n[u],a=f[u];if((h(p)&&h(a)||g(p)&&g(a))&&(s===!0||s>0))n[u]=h(p)&&h(a)?[]:{},D([F(s)?s-1:s,n[u],p,a],e,r,o,i);else if(h(n)&&h(f))o?n[u]=a:n.push(a);else try{i?Object.defineProperty(n,u,Object.getOwnPropertyDescriptor(f,u)):n[u]=f[u]}catch{}}})}),n}function W(t,e){var r=void 0;return d(t)&&Object.keys(t).forEach((o,i)=>{r!==!1&&(r=e(F(o)?parseFloat(o):o,t[o],i))}),r}function M(...t){return D(t,(e,r,o)=>!0,!1,!1,!1)}function ue(t,e,r=null,o=!1){return e.length>t.length?-1:(typeof r=="number"?o?t.slice(0,r+1+(r<0?t.length:0)):t.slice(r):t).reduce((i,s,n)=>{var[f,m,u]=i;if(!o&&f>-1)return[f,m,u];var p=u+1,a=s===e[p]?p===0?[n,0]:[m,p]:[-1,-1];return a[1]===e.length-1&&(a[1]=-1,a[0]>-1)?[a[0]].concat(a):[f].concat(a)},[-1,-1,-1])[0]+(o||typeof r!="number"?0:r>-1?r:t.length-r)}function me(t,e,r=null,o=!1){var i=ue(t,e,r,o);return i===-1?[]:t.slice(i+e.length)}function rt(t,e){return t.reduce((r,o,i)=>r||e(o,i),!1)}function y(t,e=!0){return h(t)?t:!e&&g(t)?[t]:t!==!1&&t!==0&&Ke(t)?[]:ke(t)?Array.prototype.slice.call(t):g(t)?Object.values(t):[t]}function Fe(t,e,r=null){return h(e)?t.filter(o=>r?e.filter(i=>r(o,i)).length:e.indexOf(o)===-1):[]}function G(t,e,r=null){return r||r!==!1&&t.dotSafe&&e.dotSafe?t.join(".")===e.join("."):t.length===e.length&&t.reduce((o,i,s)=>o&&i===e[s],!0)}var xt=function(t,e=1,r=!0){return!F(e)||e<=0||(!h(t)&&g(t)&&r&&(t=Object.values(t)),!h(t))?t:t.reduce((o,i)=>h(i)||g(i)&&r?o.concat(xt(h(i)?i:Object.values(i),e-1,r)):o.concat(i),[])},ot=xt;function _e(t,e,r=null){return h(e)?t.filter(o=>r?e.filter(i=>r(o,i)).length:e.indexOf(o)!==-1):[]}function ve(t,e,r=null){return r||r!==!1&&t.dotSafe&&e.dotSafe?(t.join(".")+".").startsWith(e.join(".")+"."):e.reduce((o,i,s)=>o&&i===t[s],!0)}function it(t){let e=(r,o,i)=>i.indexOf(r)===o;return t.filter(e)}function re(t){return(nt(t)?t:y(t).length?[t]:[]).reduce((e,r)=>e.concat([y(r)]),[]).map(e=>J.resolve(e))}var J=class extends Array{static resolve(e){return e.every(r=>!(r+"").includes("."))?new J().concat(e):e}get dotSafe(){return!0}};function nt(t){return y(t).reduce((e,r)=>e||h(r),!1)}function st(t){return t.filter(e=>e||e===0).length!==t.length}function Ot(t){return t.filter(e=>st(y(e))).length>0}var oe=class{constructor(e){this.target=e,this.fireables=[],this.currentlyFiring=[]}add(e){return this.fireables.push(e),e}remove(e){this.fireables=this.fireables.filter(r=>r!==e)}removeMatches(e){this.match(e).forEach(r=>{this.fireables=this.fireables.filter(o=>o!==r)})}match(e){return this.fireables.filter(r=>{var o=re(r.filter),i=y((r.params||{}).tags),s=re(e.filter),n=y((e.params||{}).tags);return(!e.originalHandler||r.handler===e.originalHandler)&&(!s.length||G(s,o))&&(!n.length||n.length===i.length&&_e(i,n).length===n.length)})}static _getFirebase(e,r,o=!0,i=this.__namespace){if(!d(r))throw new Error('Subject must be of type object; "'+T(r)+'" given!');var s=this;return i&&globalThis.WebQitObserverNamespaceRegistry.has(e+"-"+i)&&(s=globalThis.WebQitObserverNamespaceRegistry.get(e+"-"+i),e+="-"+i),!v(r,"firebases").has(e)&&o&&v(r,"firebases").set(e,new s(r)),v(r,"firebases").get(e)}static _namespace(e,r,o=null){if(e+="-"+r,arguments.length===2)return globalThis.WebQitObserverNamespaceRegistry.get(e);if(!(o.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${r} must be a subclass of ${this.name}.`);globalThis.WebQitObserverNamespaceRegistry.set(e,o),o.__namespace=r}};globalThis.WebQitObserverNamespaceRegistry||(globalThis.WebQitObserverNamespaceRegistry=new Map);var ie=class{constructor(e,r){this.target=e,this.handler=r.handler,this.filter=r.filter,this.params=r.params}disconnect(){this.disconnected=!0}};var ye=class extends ie{fire(e,r,o){return this.disconnected||this.filter&&!_e(y(this.filter),[e.type]).length?r(...Array.prototype.slice.call(arguments,2)):this.handler(e,o,r)}};function ae(t,e,r=!0,o=!0,i=!1,s=!1){if(h(t)&&h(e)){var n=[],f=!0;return t.forEach(m=>{if(!!f){var u=!1;W(e,(p,a)=>{(!u||o&&d(m))&&(u=r(m,a),(h(u)&&!u.length||g(u)&&!Object.keys(u).length)&&(u=!1),d(u)&&o&&(m=u))}),d(u)?n.push(o?u:m):ge(u)?i&&!u||!i&&u?n.push(m):s&&(f=!1):n.push(u)}}),n}if(g(t)&&g(e)){var n={},f=!0;return Object.keys(t).forEach(p=>{if(!!f){var a=r(t[p],e[p]);(h(a)&&!a.length||g(a)&&!Object.keys(a).length)&&(a=!1),d(a)?n[p]=o?a:t[p]:ge(a)?i&&!a||!i&&a?n[p]=t[p]:s&&(f=!1):n[p]=a}}),n}}function Ae(t,e=[],r=!0){var o=0;return F(arguments[0])&&d(arguments[1])&&(o=arguments[0],t=arguments[1],e=arguments[2]||[]),D([o,{},t],(i,s,n)=>_(e)?e(i):h(e)&&e.length?e.indexOf(i)>-1:!0,!1,!1,r)}function je(t,e=[]){return D([{},t],(r,o,i)=>{if(!_(i[r]))return _(e)?e(r):h(e)&&e.length?e.indexOf(r)>-1:!0},!1,!1,!1)}var ft=function(t,e,r=!0,o=1){if(h(t)&&h(e)&&t.length!==e.length)return!r;if(g(t)&&g(e)){var i=Object.keys(t),s=Object.keys(e);if(!i.length&&!s.length)return Se(t)&&Se(e)?r:t===e===r;if(!ft(i,s))return!r}if(o>0&&(h(t)&&h(e)||g(t)&&g(e))){var n=ae(t,e,(f,m)=>ft(f,m,r,o-1),!1,!1,!0);return h(n)?n.length===t.length&&n.length===e.length:g(n)&&g(t)?Object.keys(n).length===Object.keys(t).length&&Object.keys(n).length===Object.keys(e).length:n}return _(r)?r(t,e):U(t)&&U(e)&&isNaN(t)&&isNaN(e)?r:t===e===r},ut=ft;var le=class{constructor(e,r){if(this.target=e,!r.type)throw new Error("Action type must be given in definition!");W(r,(o,i)=>{Object.defineProperty(this,o,{value:i,enumerable:!0})}),Object.seal(this)}};var E=class extends oe{add(e){return super.add(new ye(this.target,e))}fire(e,r=null){if(e instanceof le||(e=new le(this.target,e)),this.currentlyFiring.filter(s=>s.type===e.type&&s.name===e.name).length)return r?r():void 0;this.currentlyFiring.push(e);let o=(s,...n)=>{var f=this.fireables[s];return f?f.fire(e,(...m)=>o(s+1,...m),...n):r?r(...n):n[0]};var i=o(0);return this.currentlyFiring.pop(),i}static getFirebase(e,r=!0,o=null){return super._getFirebase("interceptor",...arguments)}static namespace(e,r=null){return super._namespace("interceptor",...arguments)}};function w(t){return v(t,!1).get(t)||t}function P(t,e,r={},o={}){if(!e||!d(e))throw new Error("Target must be of type object!");e=w(e);var i,s=function(n){return arguments.length?n:Reflect[t](e,...Object.values(r))};return(i=E.getFirebase(e,!1,o.namespace))?i.fire({type:t,...r},s):s()}function Ne(t,e,r,o={}){return P("apply",t,{thisArgument:e,argumentsList:r},o)}function De(t,e,r=null,o={}){return P("construct",t,arguments.length>2?{argumentsList:e,newTarget:r}:{argumentsList:e},o)}var q=class{constructor(e,r=!1){this._={},this._.target=e,this._.cancellable=r,this._.propagationStopped=!1,this._.defaultPrevented=!1,this._.promisesInstance=null,this._.promises=[]}get target(){return this._.target}get cancellable(){return this._.cancellable}stopPropagation(){this._.propagationStopped=!0}get propagationStopped(){return this._.propagationStopped}preventDefault(){this._.defaultPrevented=!0}get defaultPrevented(){return this._.defaultPrevented}waitUntil(e){e instanceof Promise&&(this._.promises.push(e),this._.promisesInstance=null)}get promises(){return!this._.promisesInstance&&this._.promises.length&&(this._.promisesInstance=Promise.all(this._.promises)),this._.promisesInstance}respondWith(e){var r,o=g(e)&&!A(e.propagationStopped)&&!A(e.defaultPrevented);e===!1||o&&e.propagationStopped?this.stopPropagation():e===!1||o&&e.defaultPrevented?this.preventDefault():(e instanceof Promise&&(r=e)||o&&(r=e.promises))&&this.waitUntil(r)}};var be=class extends ie{constructor(e,r){if(super(e,r),this.filters2D=re(this.filter),this.filtersIsOriginally2D=nt(this.filter),this.filtersIsDynamic=Ot(this.filters2D),this.filtersIsDynamic&&this.filters2D.length>1)throw new Error('Only one "Dynamic Filter" must be observed at a time! "'+this.filters2D.map(o=>"["+o.join(", ")+"]").join(", ")+'" have been bound together.')}fire(e){if(this.disconnected||this.params.type&&!rt(e,n=>this.params.type===n.type))return;let r=n=>!["set","def"].includes(n.type)||!this.params.diff||(_(this.params.diff)?this.params.diff(n.value,n.oldValue):n.value!==n.oldValue);var o=new q(this.target);if(this.filters2D.length){var i=e.filter(n=>this.filters2D.filter((f,m)=>{var u=f.slice();return this.filtersIsDynamic&&n.path.forEach((p,a)=>{u[a]=u[a]||u[a]===0?u[a]:p}),(!this.filtersIsDynamic||!st(u))&&r(n)&&(!this.params.subtree&&G(u,n.path)||this.params.suptree&&ve(u,n.path)&&(!F(this.params.suptree)||me(u,n.path).length<=this.params.suptree)||this.params.subtree&&n.path.length>=u.length&&ve(n.path,u)&&(!F(this.params.subtree)||me(n.path,u).length<=this.params.subtree))}).length);if(i.length)if(this.filtersIsOriginally2D||this.params.subtree){var s=i;g(this.filter)&&(s={...this.filter},i.forEach((n,f)=>{s[n.name]=n})),o.respondWith(this.handler(s,o))}else i.forEach((n,f)=>{o.respondWith(this.handler(n,o))})}else(this.params.subtree||e.filter(n=>G(n.path,[n.name])).length===e.length)&&e.filter(n=>r(n)).length&&o.respondWith(this.handler(e,o));return o}};var Z=class{constructor(e,r){if(this.target=e,r.originalSubject||(this.originalSubject=e),!("type"in r))throw new Error("Mutation type must be given in definition!");if(!("name"in r))throw new Error("Property name must be given in definition!");W(r,(o,i)=>{o==="path"&&(i=J.resolve(i)),Object.defineProperty(this,o,{value:i,enumerable:!0})}),this.path||Object.defineProperty(this,"path",{value:J.resolve([r.name]),enumerable:!0}),Object.seal(this)}};var x=class extends oe{constructor(e){super(e),this.buffers=[]}add(e){return super.add(new be(this.target,e))}fire(e,r){var o=new q(this.target,r);return e=y(e,!1).map(i=>i instanceof Z?i:new Z(this.target,i)),this.buffers.length?(j(this.buffers)(e),o):(this.currentlyFiring.filter(i=>e.filter(s=>i.type===s.type&&i.name===s.name).length).length,this.fireables.forEach(i=>{if(o.propagationStopped&&r)return o;o.respondWith(i.fire(e))}),o)}static getFirebase(e,r=!0,o=null){return super._getFirebase("observer",...arguments)}static namespace(e,r=null){return super._namespace("observer",...arguments)}};function $(t,e,r=null,o={}){if(t=r||t,!t||!d(t))throw new Error("Target must be of type object!");t=w(t);var i=y(e),s=i.map(n=>{var f,m=function(u){return arguments.length?u:v(t,"accessorizedProps").has(n)&&v(t,"accessorizedProps").get(n).touch(!0)?v(t,"accessorizedProps").get(n).get():r?Reflect.get(t,n,r):Reflect.get(t,n)};return(f=E.getFirebase(t,!0,o.namespace))?f.fire({type:"get",name:n,related:i,receiver:r},m):m()});return h(e)?s:s[0]}function Me(t,e,r=null,o={}){if(t=w(t),!t||!d(t))throw new Error('Observable subjects must be of type object; "'+T(t)+'" given!');if(_(e)&&(o=arguments.length>2?r:{},r=e,e=null),!_(r))throw new Error('Handler must be a function; "'+T(r)+'" given!');var i,s=x.getFirebase(t,!0,o.namespace),n={filter:e,handler:r,params:o};if((n.filter||n.params.subtree==="*"||n.params.subtree&&pe(t))&&X(t,n.filter,n.params.subtree,o.namespace),n.params.unique&&(i=s.match({filter:e,params:o})).length){if(n.params.unique!=="replace")return i[0];s.remove(i[0])}return s.add(n)}function Y(t,e,r,o=null,i={}){if(t!==r){var s;if(Me(r,(f,m)=>{if(s=x.getFirebase(t,!1,i.namespace)){var u=f.map(p=>{var a=p;do if(a.target===t)return;while(a=a.src);var l={};return W(p,(c,b)=>{c!=="target"&&c!=="name"&&c!=="path"&&c!=="src"&&(l[c]=b)}),l.name=e,l.path=[e].concat(p.path),l.originalSubject=p.originalSubject,l.src=p,new Z(t,l)}).filter(p=>p);if(u.length)return s.fire(u,m.cancellable)}},{subtree:!0,...i,unique:!0,tags:[at,e,t]}),g(o)&&(s=x.getFirebase(t,!1,i.namespace))){var n=M({name:e,type:"set",value:r,related:[e]},o);let f=s.fire(n,i.cancellable);if(i.eventTypeReturn)return f}}}var at={};function X(t,e=null,r=!1,o=null){if(!t||!d(t))throw new Error("Target must be of type object!");var i=x.getFirebase(t,!0,o);if(!(!i||i.build)){i.build=r;var s=re(e),n=!s.length||s.filter(m=>!m[0]&&m[0]!==0).length?Object.keys(t):s.map(m=>m[0]),f=s.length?s.map(m=>m.slice(1)).filter(m=>m.length):null;i.subBuild=f&&f.length?f:null,n.forEach(m=>{var u=$(t,m,null,{namespace:o});try{d(u)&&(Y(t,m,u,null,params),(i.subBuild&&pe(u)||(_isFunction(r)?r(u):r&&pe(u)))&&X(u,i.subBuild,r,o))}catch{}})}}var pe=t=>(t instanceof Object||t instanceof Array||t instanceof Function)&&(typeof window>"u"||t!==window);function $e(t,e,r=null,o={}){if(t=w(t),!t||!d(t))throw new Error('Observable subjects must be of type object; "'+T(t)+'" given!');if(_(e)&&(o=arguments.length>2?r:{},r=e,e=null),r&&!_(r))throw new Error('Handler must be a function; "'+T(r)+'" given!');var i;if(i=x.getFirebase(t,!1,o.namespace))return i.removeMatches({filter:e,originalHandler:r,params:o})}function K(t,e,r,o=null,i={}){$e(r,null,null,{...i,tags:[at,e,t]});var s;if(g(o)&&(s=x.getFirebase(t,!1,i.namespace))){var n=M({name:e,type:"del",oldValue:r,related:[e]},o);s.fire(n,i.cancellable)}}function k(t,e,r={}){return P("has",t,{name:e},r)}function Ie(t,e,r,o={}){e=r.receiver||e;var i=r.keysOrPayload,s=r.value;if(!e||!d(e))throw new Error("Target must be of type object!");g(i)&&(o=s||{},s=null),e=w(e);var n=E.getFirebase(e,!1,o.namespace),f=x.getFirebase(e,!1,o.namespace);let m=(c,b,C,de)=>{var dt="set",L;t&&(dt="defineProperty",L=b||{},b=L.value);var Ee=!1,Pe;k(e,c,o)&&(Ee=!0,Pe=$(e,c,r.receiver,o));var N={name:c,type:dt,value:b,receiver:r.receiver,related:C,detail:de,isUpdate:Ee,oldValue:Pe},gt=function(_t){return arguments.length&&(L?L=_t:b=_t),L?v(e,"accessorizedProps",!1).has(c)&&!v(e,"accessorizedProps").get(c).restore()?!1:(Object.defineProperty(e,c,L),!0):v(e,"accessorizedProps",!1).has(c)?v(e,"accessorizedProps").get(c).set(b):(e[c]=b,!0)};if(n){var Qt=L?{type:"defineProperty",name:c,descriptor:L,receiver:r.receiver,related:C,detail:de,isUpdate:Ee,oldValue:Pe}:{type:"set",name:c,value:b,receiver:r.receiver,related:C,detail:de,isUpdate:Ee,oldValue:Pe};N.success=n.fire(Qt,gt)}else N.success=gt();return N.success&&N.value!==N.oldValue&&(d(N.oldValue)&&K(e,c,N.oldValue,null,o),d(N.value)&&(Y(e,c,N.value,null,o),f&&(f.subBuild||f.build&&pe(N.value))&&X(N.value,f.subBuild,f.build,o.namespace))),N};var u,p=[];h(i)||(z(i)||U(i))&&(u=y(i))?p=u.map(c=>m(c,s,u,o.detail)):g(i)&&(u=Object.keys(i))&&(p=u.map(c=>m(c,i[c],u,o.detail)));var a=p.filter(c=>c.success!==!1),l;return f?(l=f.fire(a,o.cancellable),l.successCount=a.length):o.eventTypeReturn&&(l=new q(e)),o.eventTypeReturn?l:a.length>0}function We(t,e,r=null,o={}){return Ie(!0,t,{keysOrPayload:e,value:r},o)}function qe(t,e,r={}){if(!t||!d(t))throw new Error("Target must be of type object!");t=w(t);var o=y(e),i=o.map(m=>{var u;k(t,m,r)&&(u=$(t,m,null,r));var p={name:m,type:"deleteProperty",related:o,detail:r.detail,oldValue:u},a,l=function(c){return arguments.length?c:v(t,"accessorizedProps",!1).has(m)&&!v(t,"accessorizedProps").get(m).restore()?!1:(delete t[m],!0)};return(a=E.getFirebase(t,!1,r.namespace))?p.success=a.fire({type:"deleteProperty",name:m,oldValue:u,related:o},l):p.success=l(),p.success&&d(p.oldValue)&&K(t,m,p.oldValue,null,r),p}),s=i.filter(m=>m.success!==!1),n,f;return(n=x.getFirebase(t,!1,r.namespace))?(f=n.fire(s,r.cancellable),f.successCount=s.length):r.eventTypeReturn&&(f=new q(t)),r.eventTypeReturn?f:s.length>0}function Re(t,e,r={}){return P("getOwnPropertyDescriptor",t,{name:e},r)}function Qe(t,e={}){return P("getPrototypeOf",t,{},e)}function Ue(t,e={}){return P("isExtensible",t,{},e)}function ze(t,e={}){return P("ownKeys",t,{},e)}function Be(t,e={}){return P("preventExtensions",t,{},e)}function ce(t,e,r=null,o=null,i={}){return Ie(!1,t,arguments.length>3?{keysOrPayload:e,value:r,receiver:o}:{keysOrPayload:e,value:r},i)}function Ve(t,e,r={}){return P("setPrototypeOf",t,{prototype:e},r)}function Et(t,e=[],r={}){r=g(e)?e:r;var o=(arguments.length===1?Object.keys(t):y(e)).map(i=>{if(v(t,"accessorizedProps").has(i)&&v(t,"accessorizedProps").get(i).touch(!0))return!1;let s=()=>{for(var l,c=t;!l&&(c=Object.getPrototypeOf(c));)l=Object.getOwnPropertyDescriptor(c,i);return l};var n=Object.getOwnPropertyDescriptor(t,i),f,m;n||(f={writable:!0,enumerable:!(i in t),configurable:r.configurable!==!1});var u={...n||f};"value"in u&&delete u.value,"writable"in u&&delete u.writable,u.get=()=>{if(a.ongoingGets.length)return a.get();a.ongoingGets.push(1);var l=$(t,i,null,r);return a.ongoingGets.pop(),l};var p;u.set=l=>{if(a.ongoingSets.length)return a.set(l);a.ongoingSets.push(1);var c=ce(t,i,l,null,r);return a.ongoingSets.pop(),c};var a={ongoingGets:[],ongoingSets:[],get:function(){var l=n;return l||(m?l=f:l=s()||f),l.get?l.get.call(t):l.value},set:function(l){var c=n;return c||(m?c=f:(c=s())?"value"in c&&(c=f,m=!0):(c=f,m=!0)),c.set||c.get?c.set?c.set.call(t,l):!1:(c.value=l,!0)},restore:function(){try{return this.intact()&&(n||m?Object.defineProperty(t,i,n||f):delete t[i],v(t,"accessorizedProps").delete(i)),!0}catch{}return!1},intact:function(){return(Object.getOwnPropertyDescriptor(t,i)||{}).get===u.get},touch:function(l=!1){return this.intact()||(l?!this.restore():!1)}};try{return Object.defineProperty(t,i,u),v(t,"accessorizedProps").set(i,a),!0}catch{}return!1});return h(e)?o:o[0]}function Pt(t,e=[],r={}){r=g(e)?e:r;var o=(arguments.length===1?Object.keys(t):y(e)).map(i=>v(t,"accessorizedProps",!1).has(i)?v(t,"accessorizedProps").get(i).restore():!0);return h(e)?o:o[0]}function Tt(t,e={}){if(!d(t))throw new Error('Object must be of type target; "'+T(t)+'" given!');var r=new Proxy(t,{apply:(o,i,s)=>Ne(o,i,s,e),construct:(o,i,s=null)=>De(o,i,s,e),defineProperty:(o,i,s)=>We(o,i,s,e),deleteProperty:(o,i)=>qe(o,i,e),get:(o,i,s=null)=>{var n=$(o,i,s,e);return e.proxyAutoBinding!==!1&&_(n)&&!Ye(n)?n.bind(r):n},getOwnPropertyDescriptor:(o,i)=>Re(o,i,e),getPrototypeOf:o=>Qe(o,e),has:(o,i)=>k(o,i,e),isExtensible:o=>Ue(o,e),ownKeys:o=>ze(o,e),preventExtensions:o=>Be(o,e),set:(o,i,s,n=null)=>ce(o,i,s,n,e),setPrototypeOf:(o,i)=>Ve(o,i,e)});return v(r).set(r,t),r}function St(t,e,r={}){if(t=w(t),!d(t))throw new Error('Object must be of type target; "'+T(handler)+'" given!');var o={},i=!0;g(e)||(_(e)?e={"":e}:_(r)&&(e={[e]:r},r=arguments.length>3?arguments[3]:{}),i=!1);var s=E.getFirebase(t,!0,r.namespace);return Object.keys(e).forEach(n=>{if(!_(e[n]))throw new Error("Callback"+(n===null?"":" for "+n)+' must be a function; "'+T(e[n])+'" given!');var f={filter:n,handler:e[n],params:r},m;if(f.params.unique&&(m=s.match(f)).length){if(f.params.unique!=="replace")return m[0];s.remove(m[0])}i?o[n]=s.add(f):o=s.add(f)}),o}function Ct(t,e=null,r={}){if(t=w(t),!t||!d(t))throw new Error('Object must be of type target; "'+T(t)+'" given!');var o=E.getFirebase(t,!1,r.namespace);_isObject(e)||(_(e)?e={[null]:e}:_(r)&&(e={[e]:r},r=arguments.length>3?arguments[3]:{}),isOriginallyObj=!1),(o=E.getFirebase(t,!1,r.namespace))&&Object.keys(e).forEach(i=>{if(!_(e[i]))throw new Error("Callback"+(i===null?"":" for "+i)+' must be a function; "'+T(e[i])+'" given!');var s={filter:i,originalHandler:e[i],params:r};return o.removeMatches(s)})}function Ft(t,...e){var r=e.map(s=>{if(s=w(s),!d(s))throw new Error("Target must be of type object!");return{target:s,subjectCopy:h(s)?s.slice(0):Ae(s)}}),o=t(...e);let i=()=>{r.map(s=>{var n=Object.keys(s.subjectCopy),f=Object.keys(s.target),m=[],u=it(n.concat(f)).map(a=>{if(s.subjectCopy[a]!==s.target[a]){m.push(a);var l={name:a,related:m,buffered:!0};return f.includes(a)?(l.type="set",l.value=s.target[a],n.includes(a)&&(l.isUpdate=!0)):l.type="del",n.includes(a)&&(l.oldValue=s.subjectCopy[a]),d(s.subjectCopy[a])&&K(s.target,a,s.subjectCopy[a]),d(s.target[a])&&Y(s.target,a,s.target[a]),l}}).filter(a=>a),p;if(u.length&&(p=x.getFirebase(s.target,!1)))return p.fire(u)})};return o instanceof Promise?o.then(i):i(),o}var R={apply:Ne,construct:De,defineProperty:We,deleteProperty:qe,get:$,getOwnPropertyDescriptor:Re,getPrototypeOf:Qe,has:k,isExtensible:Ue,ownKeys:ze,preventExtensions:Be,set:ce,setPrototypeOf:Ve,accessorize:Et,unaccessorize:Pt,proxy:Tt,unproxy:w,observe:Me,unobserve:$e,intercept:St,unintercept:Ct,closure:Ft,build:X,link:Y,unlink:K,Observers:x,Interceptors:E};function Q(t){return!Array.isArray(t)&&typeof t=="object"&&t}function At(t){var e=typeof t.InstallTrigger<"u";if(e)return"firefox";var r=/constructor/i.test(t.HTMLElement)||function(u){return u.toString()==="[object SafariRemoteNotification]"}(!t.safari||typeof t.safari<"u"&&t.safari.pushNotification);if(r)return"safari";var o=!!t.chrome&&(!!t.chrome.webstore||!!t.chrome.runtime),i=o&&t.navigator.userAgent.indexOf("Edg")!=-1,s=!!t.opr&&!!t.opr.addons||!!t.opera||t.navigator.userAgent.indexOf(" OPR/")>=0,n=!!t.document.documentMode,f=!n&&!!t.StyleMedia,m=(o||s)&&!!t.CSS;return f?"edge":n?"ie":s?"opera":i?"ie-chromium":o?"chrome":"unknown"}function jt(t){var e=t.getComputedStyle(t.document.documentElement,""),r=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||e.Olink===""&&["","o"])[1],o=("WebKit|Moz|Ms|O".match(new RegExp("("+r+")","i"))||[])[1];return{api:o,prefix:r,css:"-"+r+"-"}}function B(){if(!(Q(this)&&this.window)&&typeof window>"u")throw new Error("A window context is required.");let t=Q(this)&&this.window?this.window:window;if(t.WebQit||(t.WebQit={}),!t.WebQit.window){let e,r;Object.defineProperty(t.WebQit,"window",{get:()=>t}),Object.defineProperty(t.WebQit,"vendor",{value:{getName:()=>(e||(e=At(t)),e),getPrefix:()=>(r||(r=jt(t)),r)}})}return t.WebQit}function Le(t){return typeof t=="function"}function I(t){return Array.isArray(t)||typeof t=="object"&&t||Le(t)}function Nt(t){return t instanceof Number||typeof t=="number"}function ne(t){return Nt(t)||t!==!0&&t!==!1&&t!==null&&t!==""&&!isNaN(t*1)}var xe=class{constructor(e,r=!0){this.window=e,this.async=r,this.readCallbacks=[],this.writeCallbacks=[],this._run()}_run(){this.window.requestAnimationFrame(()=>{this.readCallbacks.forEach((e,r)=>{e&&!e()&&(this.readCallbacks[r]=null)}),this.writeCallbacks.forEach((e,r)=>{e&&!e()&&(this.writeCallbacks[r]=null)}),this._run()})}onread(e,r=!1){if(r)return new Promise((o,i)=>{this.async===!1?e(o,i):this.readCallbacks.push(()=>{e(o,i)})});this.async===!1?e():this.readCallbacks.push(e)}onwrite(e,r=!1){if(r)return new Promise((o,i)=>{this.async===!1?e(o,i):this.writeCallbacks.push(()=>{e(o,i)})});this.async===!1?e():this.writeCallbacks.push(e)}cycle(e,r,o){this.onread(()=>{var i=e(o);if(i){var s=n=>{this.onwrite(()=>{var f=r(n,o);if(f){var m=u=>{this.cycle(e,r,u)};f instanceof Promise?f.then(m):m()}})};i instanceof Promise?i.then(s):s()}})}};function V(t){return t instanceof String||typeof t=="string"&&t!==null}function se(t){return Array.isArray(t)}function he(t){return arguments.length&&(t===void 0||typeof t>"u")}function Dt(t){return!V(t)&&!he(t.length)}function He(t){return t===null||t===""}function Mt(t){return He(t)||he(t)||t===!1||t===0||I(t)&&!Object.keys(t).length}function S(t,e=!0){return se(t)?t:!e&&Q(t)?[t]:t!==!1&&t!==0&&Mt(t)?[]:Dt(t)?Array.prototype.slice.call(t):Q(t)?Object.values(t):[t]}function Oe(t){let e=B.call(this);e.DOM.isDOMReady||e.window.document.readyState==="complete"?t(e.window):(e.window.domReadyCallbacks||(e.window.domReadyCallbacks=[],e.window.document.addEventListener("DOMContentLoaded",()=>{e.DOM.isDOMReady=!0,e.window.domReadyCallbacks.splice(0).forEach(r=>r(e.window))},!1)),e.window.domReadyCallbacks.push(t))}var we=class{constructor(e){this.window=e}onAdded(e,r,o={}){return o.on="added",this.onPresenceChange(e,(i,s,n,f,m)=>{r(i,s,n,f,m)},o)}onRemoved(e,r,o={}){return o.on="removed",this.onPresenceChange(e,(i,s,n,f,m)=>{r(i,s,n,f,m)},o)}onPresent(e,r,o={}){Oe.call(this.window,()=>{this.window.MutationObserver&&this.onAdded(e,(i,s)=>{i.forEach(n=>r(n,s))},o),V(e)?S(this.window.document.querySelectorAll(e)).forEach(i=>r(i,1)):e.parentNode&&r(e,1)})}onAbsent(e,r,o={}){Oe.call(this.window,()=>{this.window.MutationObserver&&onRemoved(e,(i,s)=>{i.forEach(n=>r(n,s))},o),V(e)?S(this.window.document.querySelectorAll(e)).length===0&&r(null,0):e.parentNode||r(e,0)})}onPresenceChange(e,r,o={}){e=S(e,!1);var i=(a,l)=>{if(l=l.filter(C=>C.matches),V(a)){var c=l.filter(C=>C.matches(a));if(o.observeIndirectMutation!==!1&&(c=l.reduce((C,de)=>C.concat(S(de.querySelectorAll(a))),c),c.length))return c}else{if(l.includes(a))return[a];if(o.observeIndirectMutation!==!1&&l.length){for(var b=a;b=b.parentNode;)if(l.includes(b))return[a]}}},s=(a,l)=>(l.$$searchCache||(l.$$searchCache=new Map),a.reduce((c,b)=>{var C;return l.$$searchCache.has(b)?C=l.$$searchCache.get(b):(C=i(b,l,V(b))||[],l.$$searchCache.set(b,C)),c.concat(C)},[])),n=new Set,f=new Set,m=(a,l,c)=>{l&&o.on==="removed"||!l&&o.on==="added"||(a=s(e,a)).length&&(o.maintainCallState?(a.forEach(b=>{l?(n.add(b),f.delete(b)):(n.delete(b),f.add(b))}),r(a,l,c,n,f)):r(a,l,c))},u=o.context||this.window.document.documentElement,p=this._observe(u,(a,l,c,b)=>{o.ignoreTransients||(m(a,0,!0),m(a.concat(l),1,!0),m(l,0,!0)),m(b,0),m(c,1)});return p}onAttrChange(e,r,o=[]){var i=new this.window.MutationObserver(r),s={attributes:!0,attributeOldValue:!0};return o&&(s.attributeFilter=o),i.observe(e,s),i}onTreeChange(e,r,o=!1){var i=new this.window.MutationObserver(r),s={childList:!0,subtree:o};return i.observe(e,s),i}onMutation(e,r,o){var i=new this.window.MutationObserver(r);return i.observe(e,o),i}_observe(e,r){if(!lt.has(e)){let i=new Set,s=new this.window.MutationObserver(n=>{if(!!i.size){var f=n.reduce((a,l)=>a.concat(S(l.addedNodes)),[]),m=n.reduce((a,l)=>a.concat(S(l.removedNodes)),[]),u=[],p=[];f=new Set(f),m=new Set(m),f.forEach(a=>{m.has(a)&&(m.delete(a),f.delete(a),a.isConnected?u.push(a):p.push(a))}),f=[...f],m=[...m],i.forEach(a=>a(u,p,f,m))}});s.observe(e,{childList:!0,subtree:!0}),lt.set(e,{callbacks:i,observer:s})}let o=lt.get(e);return o.callbacks.add(r),{disconnect(){o.callbacks.delete(r)},reconnect(){o.callbacks.add(r)}}}},lt=new Map;function $t(t){rr(t),or(t),ir(t)}function rr(t){t.CSS||(t.CSS={}),t.CSS.escape||(t.CSS.escape=e=>e.replace(/([\:@\~\$\&])/g,"\\$1"))}function or(t){"isConnected"in t.Node.prototype||Object.defineProperty(t.Node.prototype,"isConnected",{get:function(){return!this.ownerDocument||!(this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}function ir(t){t.Element.prototype.matches||(t.Element.prototype.matches=t.Element.prototype.matchesSelector||t.Element.prototype.mozMatchesSelector||t.Element.prototype.msMatchesSelector||t.Element.prototype.oMatchesSelector||t.Element.prototype.webkitMatchesSelector||function(e){for(var r=(this.document||this.ownerDocument).querySelectorAll(e),o=r.length;--o>=0&&r.item(o)!==this;);return o>-1})}function Ge(t,e=null,r=!1){let o=B.call(this);if(V(t)){var i;if(t.trim().startsWith("<")){var s=o.window.document.createElement("div");s.innerHTML=t,i=r?S(s.children):s.firstChild}else i=r?S(Wt.call(this,t,e)):pt.call(this,t,e);return i}return t instanceof o.window.Element?r?[t]:t:r?S(t):t}function It(t,e=null){return Ge.call(this,t,e,!0)}function pt(t,e=null,r=!1){let o=B.call(this);e=e||o.window.document;var i,s=r?"querySelectorAll":"querySelector";try{i=e[s](t)}catch{try{i=e[s](t.replace(/\:is\(/g,":matches("))}catch{try{i=e[s](t.replace(/\:is\(/g,":-webkit-any("))}catch{try{i=e[s](t.replace(/\:is\(/g,":-moz-any("))}catch(u){throw u}}}}return i}function Wt(t,e=null){return pt.call(this,t,e,!0)}function fe(t){return Le(t)||t&&{}.toString.call(t)==="[object function]"}function ee(t,e,r={},o={}){e=S(e).slice();for(var i=t;!he(i)&&!He(i)&&e.length;){var s=e.shift();if(!(r.get?r.get(i,s):I(i)?s in i:i[s])){o.exists=!1;return}i=r.get?r.get(i,s):i[s]}return o.exists=!0,i}function Je(t,e,r,o={},i={}){let s=(p,a,l)=>i.set?i.set(p,a,l):(ne(e[f])&&se(p)?p.push(l):p[a]=l,!0);e=S(e);for(var n=t,f=0;f<e.length;f++)if(f<e.length-1){if(!n||!I(n)&&!fe(n))return!1;var m=ee(n,e[f],i);if(!I(m)){if(i.buildTree===!1)return!1;m=fe(i.buildTree)?i.buildTree(f):ne(e[f+1])?[]:{};var u=s(n,e[f],m);if(!u)return!1}n=m}else return s(n,e[f],r)}function qt(t,e,r=!1,o={}){e=S(e);var i=!1;do{var s=e.pop(),s=s===""?0:s,n=t;e.length&&(n=ee(t,e,{},o)),(I(n)||fe(n))&&(o.has?o.has(n,s):s in n)&&(o.deleteProperty?i=o.deleteProperty(n,s):o.del?i=o.del(n,s):(delete n[s],i=!0))}while(i&&r&&e.length&&(I(n)||fe(n))&&!(o.keys?o.keys(n):Object.keys(n)).length);return i}function ct(t,e,r={}){var o={};return ee(t,e,r,o),o.exists}function ht(t,e=!1){let r=B.call(this);var o={};return!(o.el=r.window.document.head.querySelector('meta[name="oohtml"]'))&&e&&(o.el=r.window.document.createElement("meta"),o.el.setAttribute("name",t),r.window.document.head.append(o.el)),o.el&&(o.vars=(o.el.getAttribute("content")||"").split(";").filter(i=>i).reduce((i,s)=>{var n=s.split("=").map(f=>f.trim());return Je(i,n[0].split("."),n[1]==="true"?!0:n[1]==="false"?!1:ne(n[1])?parseInt(n[1]):n[1]),i},{})),o.get=function(i){return ee(this.vars,i.split("."))},o.set=function(i,s=null,n=!1){var f=Q(i)?i:{[i]:s===!0?"true":s};if(n=arguments.length<3?s:n,Object.keys(f).forEach(m=>{if(f[m]===!1)qt(this.vars,m.split("."));else if(Q(f[m]))Object.keys(f[m]).forEach(p=>{var a=(m+"."+p).split(".");(!n||!ct(this.vars,a))&&Je(this.vars,a,f[m][p])});else{var u=m.split(".");(!n||!ct(this.vars,u))&&Je(this.vars,u,f[m])}}),e){let m=(u,p)=>Object.keys(p).reduce((a,l)=>{var c=(u?u+".":"")+l;return Q(p[l])?a.push(...m(c,p[l])):a.push(c+"="+p[l]),a},[]);this.el.setAttribute("content",m("",this.vars).join(";"))}return!0},o.defaults=function(i,s=null){return this.set(i,s,!0)},o}function Ze(){let t=B.call(this);return t.DOM||(t.DOM={},$t(t.window),t.DOM.reflow=new xe(t.window),t.DOM.mutations=new we(t.window),t.DOM.meta=ht.bind(t.window),t.DOM.query=Ge.bind(t.window),t.DOM.queryAll=It.bind(t.window),t.DOM.ready=Oe.bind(t.window)),t}var O=class{static lex(e,r,o={}){if(!z(e=e+""))throw new Error("Argument1 must be a string!");var i=u=>({delims:u.delims.slice(),options:je(u.options),nesting:u.nesting.slice(),maxDepth:u.maxDepth,comments:u.comments.slice(),tokens:u.tokens.slice(),matches:u.matches.slice(),matchesi:je(u.matchesi)});if(O.$cache[e]&&o.cache!==!1)for(var s=0;s<O.$cache[e].length;s++){var n=O.$cache[e][s];if(ut(n.delims,r))return i(n)}var f=new O(e,o),m=f.lex(r);return o.cache!==!1&&(O.$cache[e]=O.$cache[e]||[],O.$cache[e].push(m)),i(m)}static split(e,r,o){return O.lex(e,r,o).tokens}static match(e,r,o){return O.lex(e,r,o).matches}constructor(e,r){if(!z(e))throw new Error("Lexer requires the first argument to be a string.");this.$str=e,this.$options=r||{},this.$options.blocks||(this.$options.blocks=O.$blocks),this.$options.quotes||(this.$options.quotes=O.$quotes),this.$options.comments||(this.$options.comments=O.$comments)}lex(e,r){for(var o={delims:y(e),options:M(!0,{},this.$options,r||{}),nesting:[],maxDepth:0,comments:[],tokens:[],matches:[],matchesi:{}},i=0;typeof i=="number";)i=this._evalCharsAt(o,i);if(o.nesting.length)throw new Error("Error parsing the string: "+this.$str+". Unterminated blocks: "+ot(o.nesting).join(", "));return o}_evalCharsAt(e,r){if(!(r>=this.$str.length)){var o=1,i={},s={},n={};if(e.openComment||(s=this._testQuotes(e,r)),e.openQuote||(i=this._testComments(e,r)),e.openComment||i.ending)if(!e.nesting.length&&!n.ending){var f=i.starting||i.ending||this.$str[r];o=f.length,this._push(e,f,"comments",i.starting)}else this._push(e,this.$str[r]);else if(e.openQuote||s.ending)this._push(e,this.$str[r]);else{if(e.options.limit&&e.matches.length===e.options.limit)return this._push(e,this.$str[r]),r+1;n=this._testNesting(e,r);var n=this._testNesting(e,r),m=this._testChars(e.options.stopChars||[],e,r);if(!e.nesting.length&&m!==!1){e.options.stopChar=m,e.options.stopCharForward=this.$str.substr(r);return}if(!e.delims.length)e.nesting.length===2&&n.starting?(e.matches.push(null),this._push(e,n.starting),o=n.starting.length):!e.nesting.length&&n.ending?(this._push(e,n.ending),o=n.ending.length,e.matches.push(null)):this._push(e,this.$str[r]);else if(!e.nesting.length&&!n.ending){this._push(e,"");var u=this._testChars(e.delims,e,r);if(u!==!1&&(e.matches.push(u),e.matchesi[r]=u,o=u.length||1,!e.options.preserveDelims)){var p=r+(u.length||1);return p===this.$str.length&&this._push(e,""),p}this._push(e,u||this.$str[r])}else{var f=n.starting||n.ending||this.$str[r];o=f.length,this._push(e,f)}}return r+o}}_testQuotes(e,r){var o={};return(e.options.quotes||[]).forEach(i=>{this.$str.substr(r,1)===i&&(e.openQuote?i===e.openQuote&&(e.openQuote=!1,o.ending=i):(e.openQuote=i,o.starting=i))}),o}_testComments(e,r){var o={};return(e.options.comments||[]).forEach(i=>{if(e.openComment){if(j(i)===j(e.openComment)){var n=j(i);this.$str.substr(r).startsWith(n)&&(e.openComment=!1,o.ending=n)}}else{var s=H(i);this.$str.substr(r).startsWith(s)&&(e.openComment=i,o.starting=s)}}),o}_testNesting(e,r){var o={};return(e.options.blocks||[]).forEach(i=>{var s=H(i);if(this.$str.substr(r).startsWith(s))e.nesting=e.nesting.concat([i]),o.starting=s;else if(e.nesting.length&&j(i)===j(j(e.nesting))){var n=j(i);this.$str.substr(r).startsWith(n)&&(e.nesting=e.nesting.slice(0,-1),o.ending=n)}}),e.maxDepth=Math.max(e.maxDepth,e.nesting.length),o}_testChars(e,r,o){for(var i=0;i<e.length;i++){var s=e[i];if(_(s)){var n=s(this.$str.substr(0,o),this.$str.substr(o),r.tokens.slice());if(n!==!1)return n}if(r.options.useRegex){var f=this.$str.substr(o).match(new RegExp("^"+s,r.options.useRegex!==!0?r.options.useRegex:""));if(f)return f[0]}if(!r.options.ci&&this.$str.substr(o,s.length)===s||r.options.ci&&this.$str.substr(o,s.length).toLowerCase()===s.toLowerCase())return s}return!1}_push(e,r,o="tokens",i=!1){var s=e.matches.length;if(A(e.tokens[s])&&(e.tokens[s]=""),o==="comments"){e.tokens[s].comments||(e.tokens[s]=new String(e.tokens[s]),e.tokens[s].comments=[]);var n=e.tokens[s].comments.length-(!e.tokens[s].comments.length||i?0:1);e.tokens[s].comments[n]=(e.tokens[s].comments[n]||"")+r}else{var f=e.tokens[s].comments;e.tokens[s]=e.tokens[s]+r}}split(e,r,o){return this.lex(r,o).tokens}match(e,r,o){return this.lex(r,o).matches}regParse(e,r){return this.lex(e,M({useRegex:!0},r||{}))}regSplit(e,r){return this.regParse(e,r).tokens}regMatch(e,r){return this.regParse(e,r).matches}};O.$blocks=[["(",")"],["[","]"],["{","}"]];O.$quotes=['"',"'","`"];O.$comments=[["/*","*/"],["//",`
2
+ `]];O.$cache=Object.create(null);function Rt(t,e={}){let r=Ze.call(this);return r.OOHTML||(r.OOHTML={}),r.OOHTML.meta||(r.OOHTML.meta=r.DOM.meta("oohtml",!0)),r.OOHTML.meta.defaults(M(3,t,e)),r.OOHTML.meta}function Xe(t={}){let e=Ze.call(this);if(t.onDomReady){e.DOM.ready(()=>{Xe.call(this,{...t,onDomReady:!1})});return}let r=e.window,o=e.window.document,i=Rt.call(this,{api:{state:"state",setState:"setState",clearState:"clearState"}},t.params),s=function(n,f=null){if(!v(n,"oohtml").has("state")||f){let m=f||Object.create(null),u=v(n,"oohtml").get("state");if(v(n,"oohtml").set("state",m),u&&R.unlink&&R.unlink(n,i.get("api.state"),u),R.link){let p=f?{isUpdate:!!u,oldValue:u}:null;R.link(n,i.get("api.state"),m,p)}}return v(n,"oohtml").get("state")};if(i.get("api.state")in r.Element.prototype)throw new Error('The "Element" class already has a "'+i.get("api.state")+'" property!');if(Object.defineProperty(r.Element.prototype,i.get("api.state"),{get:function(){return R.proxy(s(this))}}),i.get("api.setState")in r.Element.prototype)throw new Error('The "Element" class already has a "'+i.get("api.setState")+'" property!');if(Object.defineProperty(r.Element.prototype,i.get("api.setState"),{value:function(n,f={}){if(!f.update)s(this,n);else{var m=s(this);if(f.update!=="merge"){var u=Fe(Object.keys(m),Object.keys(n));R.deleteProperty(m,u)}R.set(m,n)}}}),i.get("api.clearState")in r.Element.prototype)throw new Error('The "Element" class already has a "'+i.get("api.clearState")+'" property!');if(Object.defineProperty(r.Element.prototype,i.get("api.clearState"),{value:function(){s(this,{})}}),i.get("api.state")in o)throw new Error('The "document" object already has a "'+i.get("api.state")+'" property!');if(Object.defineProperty(o,i.get("api.state"),{get:function(){return R.proxy(s(o))}}),i.get("api.setState")in o)throw new Error('The "document" object already has a "'+i.get("api.setState")+'" property!');if(Object.defineProperty(o,i.get("api.setState"),{value:function(n,f={}){if(!f.update)s(o,n);else{var m=s(o);if(f.update!=="merge"){var u=Fe(Object.keys(m),Object.keys(n));R.deleteProperty(m,u)}R.set(m,n)}}}),i.get("api.clearState")in o)throw new Error('The "document" object already has a "'+i.get("api.clearState")+'" property!');Object.defineProperty(o,i.get("api.clearState"),{value:function(){s(o,{})}})}Xe.call(window);})();
3
+ //# sourceMappingURL=state-api.js.map