j-templates 5.0.52 → 5.0.54
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/DOM/createPropertyAssignment.js +1 -1
- package/Store/Tree/observableNode.js +26 -25
- package/jTemplates.js +1 -1
- package/jTemplates.js.map +1 -1
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ function CreateValueAssignment(target) {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
function ValueAssignment(target, writeTo, next) {
|
|
41
|
-
writeTo.value ??= CreateValueAssignment(target);
|
|
41
|
+
writeTo.value ??= target.nodeName === 'INPUT' ? CreateValueAssignment(target) : AssignProp(target, 'value');
|
|
42
42
|
writeTo.value(next.value);
|
|
43
43
|
}
|
|
44
44
|
function DefaultAssignment(target, writeTo, next, prop) {
|
|
@@ -9,14 +9,14 @@ function getOwnPropertyDescriptor(target, prop) {
|
|
|
9
9
|
const descriptor = Object.getOwnPropertyDescriptor(target, prop);
|
|
10
10
|
return {
|
|
11
11
|
...descriptor,
|
|
12
|
-
configurable: true
|
|
12
|
+
configurable: true,
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
function getOwnPropertyDescriptorArray(target, prop) {
|
|
16
16
|
const descriptor = Object.getOwnPropertyDescriptor(target, prop);
|
|
17
17
|
return {
|
|
18
18
|
...descriptor,
|
|
19
|
-
configurable: true
|
|
19
|
+
configurable: true,
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
function has(value, prop) {
|
|
@@ -34,16 +34,16 @@ function ownKeysArray(value) {
|
|
|
34
34
|
function UnwrapProxy(value) {
|
|
35
35
|
if (!value)
|
|
36
36
|
return value;
|
|
37
|
-
if (value.toJSON && typeof value.toJSON ===
|
|
37
|
+
if (value.toJSON && typeof value.toJSON === "function")
|
|
38
38
|
return value.toJSON();
|
|
39
39
|
const type = (0, json_1.JsonType)(value);
|
|
40
40
|
switch (type) {
|
|
41
|
-
case
|
|
41
|
+
case "object": {
|
|
42
42
|
const keys = Object.keys(value);
|
|
43
43
|
for (let x = 0; x < keys.length; x++)
|
|
44
44
|
value[keys[x]] = UnwrapProxy(value[keys[x]]);
|
|
45
45
|
}
|
|
46
|
-
case
|
|
46
|
+
case "array": {
|
|
47
47
|
for (let x = 0; x < value.length; x++)
|
|
48
48
|
value[x] = UnwrapProxy(value[x]);
|
|
49
49
|
}
|
|
@@ -57,7 +57,7 @@ function CreateArrayProxy(value) {
|
|
|
57
57
|
set: ArrayProxySetter,
|
|
58
58
|
has: hasArray,
|
|
59
59
|
ownKeys: ownKeysArray,
|
|
60
|
-
getOwnPropertyDescriptor: getOwnPropertyDescriptorArray
|
|
60
|
+
getOwnPropertyDescriptor: getOwnPropertyDescriptorArray,
|
|
61
61
|
});
|
|
62
62
|
scopeCache.set(value, scope);
|
|
63
63
|
proxyCache.set(value, proxy);
|
|
@@ -70,7 +70,7 @@ function CreateObjectProxy(value) {
|
|
|
70
70
|
set: ObjectProxySetter,
|
|
71
71
|
has,
|
|
72
72
|
ownKeys,
|
|
73
|
-
getOwnPropertyDescriptor
|
|
73
|
+
getOwnPropertyDescriptor,
|
|
74
74
|
});
|
|
75
75
|
scopeCache.set(value, scope);
|
|
76
76
|
proxyCache.set(value, proxy);
|
|
@@ -93,22 +93,23 @@ function ArrayProxyGetter(array, prop) {
|
|
|
93
93
|
};
|
|
94
94
|
default: {
|
|
95
95
|
const arrayValue = array[prop];
|
|
96
|
-
if (typeof prop ===
|
|
96
|
+
if (typeof prop === "symbol")
|
|
97
97
|
return arrayValue;
|
|
98
|
-
if (typeof arrayValue ===
|
|
98
|
+
if (typeof arrayValue === "function")
|
|
99
99
|
return function ArrayFunction(...args) {
|
|
100
100
|
const proxyArray = array.slice();
|
|
101
101
|
for (let x = 0; x < proxyArray.length; x++)
|
|
102
|
-
proxyArray[x] =
|
|
102
|
+
proxyArray[x] =
|
|
103
|
+
proxyCache.get(proxyArray[x]) ?? CreateProxy(proxyArray[x]);
|
|
103
104
|
let result = proxyArray[prop](...args);
|
|
104
105
|
switch (prop) {
|
|
105
|
-
case
|
|
106
|
-
case
|
|
107
|
-
case
|
|
108
|
-
case
|
|
109
|
-
case
|
|
110
|
-
case
|
|
111
|
-
case
|
|
106
|
+
case "push":
|
|
107
|
+
case "unshift":
|
|
108
|
+
case "splice":
|
|
109
|
+
case "pop":
|
|
110
|
+
case "shift":
|
|
111
|
+
case "sort":
|
|
112
|
+
case "reverse":
|
|
112
113
|
array.length = proxyArray.length;
|
|
113
114
|
for (let x = 0; x < proxyArray.length; x++)
|
|
114
115
|
array[x] = UnwrapProxy(proxyArray[x]);
|
|
@@ -132,20 +133,20 @@ function ObjectProxySetter(object, prop, value) {
|
|
|
132
133
|
}
|
|
133
134
|
else {
|
|
134
135
|
applyingDiff = true;
|
|
135
|
-
const
|
|
136
|
-
const json = proxy.toJSON();
|
|
137
|
-
const diff = (0, json_1.JsonDiff)(value, json[prop]);
|
|
136
|
+
const diff = (0, json_1.JsonDiff)(value, object[prop]);
|
|
138
137
|
for (let x = 0; x < diff.length; x++) {
|
|
139
138
|
if (diff[x].path.length === 0) {
|
|
139
|
+
const proxy = proxyCache.get(object);
|
|
140
140
|
proxy[prop] = diff[x].value;
|
|
141
141
|
}
|
|
142
142
|
else {
|
|
143
143
|
const path = diff[x].path;
|
|
144
|
-
let curr =
|
|
144
|
+
let curr = object[prop];
|
|
145
145
|
let y = 0;
|
|
146
146
|
for (; y < path.length - 1; y++)
|
|
147
147
|
curr = curr[path[y]];
|
|
148
|
-
|
|
148
|
+
const target = proxyCache.get(curr) ?? curr;
|
|
149
|
+
target[path[y]] = diff[x].value;
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
applyingDiff = false;
|
|
@@ -162,7 +163,7 @@ function ObjectProxyGetter(object, prop) {
|
|
|
162
163
|
};
|
|
163
164
|
default: {
|
|
164
165
|
const proxyValue = object[prop];
|
|
165
|
-
if (typeof prop ===
|
|
166
|
+
if (typeof prop === "symbol")
|
|
166
167
|
return proxyValue;
|
|
167
168
|
const proxy = CreateProxy(proxyValue);
|
|
168
169
|
return proxy;
|
|
@@ -172,11 +173,11 @@ function ObjectProxyGetter(object, prop) {
|
|
|
172
173
|
function CreateProxy(value) {
|
|
173
174
|
const type = (0, json_1.JsonType)(value);
|
|
174
175
|
switch (type) {
|
|
175
|
-
case
|
|
176
|
+
case "object": {
|
|
176
177
|
const proxy = proxyCache.get(value) ?? CreateObjectProxy(value);
|
|
177
178
|
return proxy;
|
|
178
179
|
}
|
|
179
|
-
case
|
|
180
|
+
case "array": {
|
|
180
181
|
const proxy = proxyCache.get(value) ?? CreateArrayProxy(value);
|
|
181
182
|
observableScope_1.ObservableScope.Touch(scopeCache.get(value));
|
|
182
183
|
return proxy;
|
package/jTemplates.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var __webpack_modules__={642:(e,t)=>{function n(e,t,n,r){const o=n;t[r]??=function(e,t){let n;return function(r){r!==n&&(n&&e.removeEventListener(t,n),r&&e.addEventListener(t,r),n=r)}}(e,r),t[r](o)}Object.defineProperty(t,"__esModule",{value:!0}),t.CreateEventAssignment=function(e){let t;const r={};return function(o){const i=null!==o?Object.keys(o):[],s=void 0===t?i:i.concat(t);t=i;for(let t=0;t<s.length;t++)n(e,r,o&&o[s[t]],s[t])}}},543:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateNodeValueAssignment=function(e){let t=e.nodeValue;return function(n){n.nodeValue!==t&&(e.nodeValue=n.nodeValue,t=n.nodeValue)}},t.CreatePropertyAssignment=s;const r=n(874);function o(e,t,n){t.value??=function(e){let t=e.value;return e.addEventListener("blur",(function(){e.value=t})),function(n){if(n!==t){const r=e.selectionStart,o=e.selectionEnd;e.value=n,e.ownerDocument.activeElement===e&&e.setSelectionRange(r,o),t=n}}}(e),t.value(n.value)}function i(e,t,n,o){const i=n[o];t[o]??="value"===(0,r.JsonType)(i)?function(e,t){let n=e[t];return function(r){r!==n&&(e[t]=r,n=r)}}(e,o):s(e[o],!1),t[o](i)}function s(e,t=!0){const n={};return function(r){const s=Object.keys(r);for(let a=0;a<s.length;a++)!0===t&&"value"===s[a]?o(e,n,r):i(e,n,r,s[a])}}},641:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DOMNodeConfig=void 0;const r=n(819),o=n(496),i=n(543),s=n(642);let a=o.List.Create(),c=!1;function u(){o.List.Add(a,null);const e=Date.now();let t;for(;t=o.List.Pop(a);)t();0===a.size?c=!1:Date.now()-e<16?u():r.wndw.requestAnimationFrame(u)}t.DOMNodeConfig={createNode:(e,t)=>t?r.wndw.document.createElementNS(t,e):r.wndw.document.createElement(e),createTextNode:(e="")=>r.wndw.document.createTextNode(e),scheduleUpdate(e){o.List.Add(a,e),c||(c=!0,r.wndw.requestAnimationFrame(u))},addListener(e,t,n){e.addEventListener(t,n)},removeListener(e,t,n){e.removeEventListener(t,n)},addChild(e,t){e.appendChild(t)},addChildFirst(e,n){t.DOMNodeConfig.addChildBefore(e,e.firstChild,n)},addChildBefore(e,n,r){n?r!==n&&e.insertBefore(r,n):t.DOMNodeConfig.addChild(e,r)},addChildAfter(e,n,r){n?t.DOMNodeConfig.addChildBefore(e,n.nextSibling,r):t.DOMNodeConfig.addChildFirst(e,r)},removeChild(e,t){e.removeChild(t)},remove(e){e&&e.parentNode&&e.parentNode.removeChild(e)},setText(e,t){e.textContent=t},getAttribute:(e,t)=>e.getAttribute(t),setAttribute(e,t,n){e.setAttribute(t,n)},createPropertyAssignment:e=>e.nodeType===Node.TEXT_NODE?(0,i.CreateNodeValueAssignment)(e):(0,i.CreatePropertyAssignment)(e),createEventAssignment:e=>(0,s.CreateEventAssignment)(e),fireEvent(e,t,n){var r=new CustomEvent(t,n);e.dispatchEvent(r)},getFirstChild:e=>e.firstChild,getLastChild:e=>e.lastChild,getNextSibling:e=>e.nextSibling,replaceChildren(e,t){e.replaceChildren(...t)}}},774:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.div=function(e,t){return r.ElementNode.Create("div",null,e,t)},t.a=function(e,t){return r.ElementNode.Create("a",null,e,t)},t.ul=function(e,t){return r.ElementNode.Create("ul",null,e,t)},t.li=function(e,t){return r.ElementNode.Create("li",null,e,t)},t.br=function(e){return r.ElementNode.Create("br",null,e,null)},t.b=function(e,t){return r.ElementNode.Create("b",null,e,t)},t.span=function(e,t){return r.ElementNode.Create("span",null,e,t)},t.img=function(e){return r.ElementNode.Create("img",null,e,null)},t.video=function(e,t){return r.ElementNode.Create("video",null,e,t)},t.source=function(e){return r.ElementNode.Create("source",null,e,null)},t.input=function(e){return r.ElementNode.Create("input",null,e,null)},t.textarea=function(e){return r.ElementNode.Create("textarea",null,e,null)},t.select=function(e,t){return r.ElementNode.Create("select",null,e,t)},t.option=function(e,t){return r.ElementNode.Create("option",null,e,t)},t.h1=function(e,t){return r.ElementNode.Create("h1",null,e,t)},t.h2=function(e,t){return r.ElementNode.Create("h2",null,e,t)},t.h3=function(e,t){return r.ElementNode.Create("h3",null,e,t)},t.p=function(e,t){return r.ElementNode.Create("p",null,e,t)},t.style=function(e,t){return r.ElementNode.Create("style",null,e,t)},t.button=function(e,t){return r.ElementNode.Create("button",null,e,t)},t.table=function(e,t){return r.ElementNode.Create("table",null,e,t)},t.th=function(e,t){return r.ElementNode.Create("th",null,e,t)},t.tr=function(e,t){return r.ElementNode.Create("tr",null,e,t)},t.td=function(e,t){return r.ElementNode.Create("td",null,e,t)};const r=n(413)},147:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(774),t),o(n(716),t),o(n(543),t),o(n(642),t)},716:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.svg=function(e,t){return r.ElementNode.Create("svg",o,e,t)},t.g=function(e,t){return r.ElementNode.Create("g",o,e,t)},t.circle=function(e,t){return r.ElementNode.Create("circle",o,e,t)};const r=n(413),o="http://www.w3.org/2000/svg"},819:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wndw=void 0,t.wndw="undefined"!=typeof window?window:new(Object(function(){var e=new Error("Cannot find module 'jsdom'");throw e.code="MODULE_NOT_FOUND",e}())("").window)},173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BoundNode=void 0;const r=n(267),o=n(948);var i;function s(e,t){if(t)for(var n in t)r.NodeConfig.getAttribute(e.node,n)!==t[n]&&r.NodeConfig.setAttribute(e.node,n,t[n])}!function(e){e.Init=function(e){const t=e.nodeDef;if(t.props){const n=o.ObservableScope.Create(t.props);e.scopes??=[],e.scopes.push(n),e.assignProperties=r.NodeConfig.createPropertyAssignment(e.node),o.ObservableScope.Watch(n,(function(t){!function(e,t){e.setProperties||(e.setProperties=!0,r.NodeConfig.scheduleUpdate((function(){if(e.setProperties=!1,e.destroyed)return;const n=o.ObservableScope.Value(t);e.assignProperties(n)})))}(e,t)}));const i=o.ObservableScope.Value(n);e.assignProperties(i)}if(t.attrs){const n=o.ObservableScope.Create(t.attrs);e.scopes??=[],e.scopes.push(n),o.ObservableScope.Watch(n,(function(t){!function(e,t){e.setAttributes||(e.setAttributes=!0,r.NodeConfig.scheduleUpdate((function(){e.setAttributes=!1,e.destroyed||s(e,o.ObservableScope.Value(t))})))}(e,t)})),s(e,o.ObservableScope.Value(n))}if(t.on){const n=o.ObservableScope.Create(t.on);e.scopes??=[],e.scopes.push(n),e.assignEvents=r.NodeConfig.createEventAssignment(e.node),o.ObservableScope.Watch(n,(function(t){!function(e,t){e.setEvents||(e.setEvents=!0,r.NodeConfig.scheduleUpdate((function(){if(e.setEvents=!1,e.destroyed)return;const n=o.ObservableScope.Value(t);e.assignEvents(n)})))}(e,t)}));const i=o.ObservableScope.Value(n);e.assignEvents(i)}}}(i||(t.BoundNode=i={}))},342:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;const r=n(64),o=n(230),i=n(334),s=n(948);class a{nodeRef;componentEvents;scope;templates;decoratorMap;get Injector(){return this.nodeRef.injector}get Destroyed(){return this.nodeRef.destroyed}get DecoratorMap(){return this.decoratorMap}get Scope(){return this.scope}get Data(){return this.scope.Value}get NodeRef(){return this.nodeRef}get Templates(){return this.templates}constructor(e,t,n,r){this.nodeRef=n,this.componentEvents=r,this.scope=new s.ObservableScope(e),this.templates=t||{},this.decoratorMap=new Map}Template(){return[]}Bound(){}Fire(e,t){var n=this.componentEvents&&this.componentEvents[e];n&&n(t)}Destroy(){this.scope.Destroy(),i.Destroy.All(this)}}t.Component=a,function(e){function t(e,t,n){return o.ComponentNode.ToFunction(e,t,n)}function n(e,t){r.NodeRef.Init(t);var n=r.NodeRef.Wrap(e);r.NodeRef.AddChild(n,t)}e.ToFunction=t,e.Register=function(e,r){const o=t(`${e}-component`,void 0,r);class i extends HTMLElement{constructor(){super(),n(this.attachShadow({mode:"open"}),o({}))}}customElements.define(e,i)},e.Attach=n}(a||(t.Component=a={}))},230:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentNode=void 0;const r=n(173),o=n(64),i=n(267),s=n(342),a=n(880),c=n(334),u=n(224),l=n(496);var d;function f(e){const t=e.component.Template();return Array.isArray(t)?t:[t]}function h(e,t){(0,u.Thread)((function(){if(e.destroyed)return;const n=a.Injector.Scope(e.injector,f,e);(0,u.Schedule)((function(){o.NodeRef.InitAll(e,n)})),(0,u.Thread)((function(){if(e.destroyed)return;const r=l.List.Create();l.List.Add(r,{value:void 0,init:!0,nodes:n}),t?o.NodeRef.ReconcileChildren(e,r):i.NodeConfig.scheduleUpdate((function(){e.destroyed||o.NodeRef.ReconcileChildren(e,r)}))})),e.component.Bound!==s.Component.prototype.Bound&&(0,u.After)((function(){i.NodeConfig.scheduleUpdate((()=>setTimeout((()=>e.component.Bound()),0)))}))}))}!function(e){e.Fire=function(e,t){var n=this.componentEvents&&this.componentEvents[e];n&&n(t)},e.ToFunction=function(e,t,n){return function(r,i){return function(e,t,n,r,i){var s=o.NodeRef.Create(e,t,o.NodeRefType.ComponentNode);return s.nodeDef=n,s.constructor=r,s.templates=i,s}(e,t,r,n,i)}},e.Init=function(e){var t,n=e.nodeDef,s=n.on;n.on=null,e.component=new e.constructor(n.data,e.templates,e,s),t=e,c.PreReq.Has(t.component)?function(e){return new Promise((t=>{(0,u.Thread)((function(){const n=a.Injector.Scope(e.injector,c.PreReqTemplate.Get,e.component);(0,u.Schedule)((function(){e.destroyed||o.NodeRef.InitAll(e,n)})),(0,u.Thread)((function(){if(!e.destroyed){for(var r=0;r<n.length;r++)o.NodeRef.AddChild(e,n[r]);c.PreReq.All(e.component).then((function(){if(!e.destroyed){for(var r=0;r<n.length;r++)o.NodeRef.Destroy(n[r]);i.NodeConfig.scheduleUpdate((function(){if(!e.destroyed){for(var r=0;r<n.length;r++)o.NodeRef.DetachChild(e,n[r]);t()}}))}}))}}))}))}))}(t).then((function(){h(t,!1)})):h(t,!0),r.BoundNode.Init(e)}}(d||(t.ComponentNode=d={}))},413:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ElementNode=void 0;const r=n(948),o=n(880),i=n(496),s=n(224),a=n(173),c=n(267),u=n(64);var l;!function(e){e.Create=function(e,t,n,r){var o=u.NodeRef.Create(e,t,u.NodeRefType.ElementNode);return o.nodeDef=n,o.childrenFunc=r,o},e.Init=function(e){if(e.childrenFunc){var t=e.nodeDef;if(t.data){const n=r.ObservableScope.Create(t.data);e.childNodes=new Set,e.scopes??=[],e.scopes.push(n),r.ObservableScope.Watch(n,(function(){!function(e,t){e.setData||(e.setData=!0,c.NodeConfig.scheduleUpdate((function(){e.setData=!1,e.destroyed||p(e,f(t))})))}(e,n)})),p(e,f(n),!0)}else n=e,(0,s.Synch)((function(){const e=o.Injector.Scope(n.injector,b,n.childrenFunc,!0);e.length>0&&(u.NodeRef.InitAll(n,e),(0,s.Thread)((function(){if(n.destroyed)return;const t=i.List.Create();i.List.Add(t,{value:null,init:!0,nodes:e}),u.NodeRef.ReconcileChildren(n,t)})))}))}var n;a.BoundNode.Init(e)}}(l||(t.ElementNode=l={}));const d=[];function f(e){var t=r.ObservableScope.Value(e);return t?(Array.isArray(t)||(t=[t]),t):d}function h(e){return e.value}function p(e,t,n=!1){(0,s.Synch)((function(){!function(e,t){const n=i.List.Create(),r=i.List.Create(),a=e.nodeList,c=a&&i.List.ToNodeMap(a,h);for(let s=0;s<t.length;s++){let u;if(c){const e=c.get(t[s]);if(e){let t=e.length-1;for(;t>=0&&!u;t--)u=e[t],e[t]=null}}u?(i.List.RemoveNode(a,u),i.List.AddNode(n,u),u.data.init||i.List.Add(r,u.data)):(u=i.List.Add(n,{value:t[s],init:!1,nodes:o.Injector.Scope(e.injector,b,e.childrenFunc,t[s])}),i.List.Add(r,u.data))}let l=r.head;for(;l;){const t=l.data;(0,s.Schedule)((function(){e.destroyed||0===n.size||(u.NodeRef.InitAll(e,t.nodes),t.init=!0)})),l=l.next}if(a){let t=a.head;for(;t;){const n=t.data;t=t.next;for(let t=0;t<n.nodes.length;t++)e.childNodes.delete(n.nodes[t]);u.NodeRef.DestroyAll(n.nodes)}i.List.Clear(a)}e.nodeList=n}(e,t);const r=e.nodeList,a=r.size;(0,s.Thread)((function(t){e.destroyed||(n||!t?u.NodeRef.ReconcileChildren(e,r):c.NodeConfig.scheduleUpdate((function(){e.destroyed||r.size!==a||u.NodeRef.ReconcileChildren(e,r)})))}))}))}function b(e,t){const n=e(t);if("string"==typeof n||!n){const n=u.NodeRef.Create("text",null,u.NodeRefType.BoundNode);return n.nodeDef={props:function(){return{nodeValue:e(t)}}},[n]}return Array.isArray(n)?n:[n]}},267:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeConfig=void 0;const r=n(641);t.NodeConfig=r.DOMNodeConfig},64:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRef=t.NodeRefType=void 0;const r=n(267),o=n(880),i=n(173),s=n(413),a=n(230),c=n(890);var u,l;!function(e){e[e.NodeRef=0]="NodeRef",e[e.BoundNode=1]="BoundNode",e[e.ElementNode=2]="ElementNode",e[e.ComponentNode=3]="ComponentNode"}(u||(t.NodeRefType=u={})),function(e){function t(e,t,n){switch(n){case u.NodeRef:return{node:null,nodeType:e,nodeNamespace:t,type:u.NodeRef,injector:o.Injector.Current()||new o.Injector,parent:null,childNodes:null,destroyed:!1};case u.BoundNode:return{node:null,nodeDef:null,nodeType:e,nodeNamespace:t,type:u.BoundNode,injector:o.Injector.Current()||new o.Injector,parent:null,childNodes:null,destroyed:!1,lastEvents:null,setProperties:!1,assignProperties:null,assignEvents:null,setAttributes:!1,setEvents:!1,scopes:null};case u.ElementNode:return{node:null,nodeDef:null,nodeType:e,nodeNamespace:t,type:u.ElementNode,injector:o.Injector.Current()||new o.Injector,parent:null,childNodes:null,destroyed:!1,lastEvents:null,setProperties:!1,assignProperties:null,assignEvents:null,setAttributes:!1,setEvents:!1,childrenFunc:null,nodeList:null,setData:!1,scopes:null};case u.ComponentNode:return{node:null,nodeDef:null,nodeType:e,nodeNamespace:t,type:u.ComponentNode,injector:o.Injector.Current()||new o.Injector,parent:null,childNodes:null,destroyed:!1,setProperties:!1,assignProperties:null,assignEvents:null,setAttributes:!1,setEvents:!1,component:null,componentEvents:null,scopes:null}}}function n(e){if(!e.node)switch(e.node="text"===e.nodeType?r.NodeConfig.createTextNode():r.NodeConfig.createNode(e.nodeType,e.nodeNamespace),e.childNodes="text"!==e.nodeType?[]:null,e.type){case u.BoundNode:i.BoundNode.Init(e);break;case u.ElementNode:s.ElementNode.Init(e);break;case u.ComponentNode:a.ComponentNode.Init(e)}}function l(e,t){Array.isArray(e.childNodes)?e.childNodes.push(t):e.childNodes.add(t)}function d(e){if(!e.destroyed){if(e.destroyed=!0,Array.isArray(e.childNodes))for(let t=0;t<e.childNodes.length;t++)d(e.childNodes[t]);else e.childNodes?.forEach(d);switch(e.type){case u.ComponentNode:e.component?.Destroy();case u.ElementNode:e.assignEvents?.(null);case u.BoundNode:for(let t=0;e.scopes&&t<e.scopes.length;t++)c.ObservableScope.Destroy(e.scopes[t])}e.node=null}}e.Wrap=function(e){var n=t(null,null,u.NodeRef);return n.node=e,n.childNodes=new Set,n},e.Create=t,e.Init=n,e.InitAll=function(e,t){for(var r=0;r<t.length;r++)t[r].parent=e,l(e,t[r]),n(t[r])},e.AddChild=function(e,t){t.parent=e,l(e,t),r.NodeConfig.addChild(e.node,t.node)},e.AddChildAfter=function(e,t,n){if(t&&t.parent!==e)throw"currentChild is not valid";n.parent=e,l(e,n),r.NodeConfig.addChildAfter(e.node,t&&t.node,n.node)},e.ReconcileChildren=function(e,t){const n=e.node;if(0===t.size)return void r.NodeConfig.replaceChildren(n,[]);let o,i=t?.head,s=!1,a=!1;for(;i;){for(let e=0;e<i.data.nodes.length;e++){const t=o?r.NodeConfig.getNextSibling(o):r.NodeConfig.getFirstChild(n),c=i.data.nodes[e].node;t!==c?(r.NodeConfig.addChildBefore(n,t,c),!a&&s&&t&&r.NodeConfig.removeChild(n,t),a=s,s=!0):(s=!1,a=!1),o=c}i=i.next}let c=r.NodeConfig.getLastChild(n);for(;o&&o!==c;)r.NodeConfig.removeChild(n,c),c=r.NodeConfig.getLastChild(n)},e.DetachChild=function(e,t){!Array.isArray(e.childNodes)&&e.childNodes.delete(t)&&(r.NodeConfig.removeChild(e.node,t.node),t.parent=null)},e.Destroy=d,e.DestroyAll=function(e){for(let t=0;t<e.length;t++)d(e[t])}}(l||(t.NodeRef=l={}))},377:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiffAsync=void 0;const r=n(285),o=n(521),i=n(547),s=(0,r.DiffTreeScope)();t.DiffAsync=class{workerQueue;constructor(e){this.workerQueue=new o.WorkerQueue(i.DiffWorker.Create()),this.workerQueue.Push({method:"create",arguments:[e.toString()]})}static GetKeyRef(e){return s.GetKeyRef(e)}static ReadKeyRef(e){return s.ReadKeyRef(e)}async DiffPath(e,t){return await this.workerQueue.Push({method:"diffpath",arguments:[e,t]})}async DiffBatch(e){return await this.workerQueue.Push({method:"diffbatch",arguments:[e]})}async UpdatePath(e,t){await this.workerQueue.Push({method:"updatepath",arguments:[e,t]})}async GetPath(e){return await this.workerQueue.Push({method:"getpath",arguments:[e]})}Destroy(){this.workerQueue.Destroy()}}},606:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiffSync=void 0;const r=(0,n(285).DiffTreeScope)();t.DiffSync=class{diffTree;constructor(e){this.diffTree=new r(e)}static GetKeyRef(e){return r.GetKeyRef(e)}static ReadKeyRef(e){return r.ReadKeyRef(e)}DiffPath(e,t){return this.diffTree.DiffPath(e,t)}DiffBatch(e){return this.diffTree.DiffBatch(e)}UpdatePath(e,t){this.diffTree.UpdatePath(e,t)}}},285:(__unused_webpack_module,exports)=>{function DiffTreeScope(worker){const ctx=this;if(ctx&&worker){let diffTree=null;ctx.onmessage=function(event){var data=event.data;switch(data.method){case"create":var keyFunc=data.arguments[0]?eval(data.arguments[0]):void 0;diffTree=new DiffTree(keyFunc),ctx.postMessage(null);break;case"diffpath":var diff=diffTree.DiffPath(data.arguments[0],data.arguments[1]);ctx.postMessage(diff);break;case"diffbatch":var diff=diffTree.DiffBatch(data.arguments[0]);ctx.postMessage(diff);break;case"updatepath":diffTree.UpdatePath(data.arguments[0],data.arguments[1]),ctx.postMessage(null);break;case"getpath":var ret=diffTree.GetPath(data.arguments[0]);ctx.postMessage(ret)}}}const jsonConstructor={}.constructor;function IsValue(e){return!e||!(jsonConstructor===e.constructor||Array.isArray(e))}let Type;function TypeOf(e){return e?jsonConstructor===e.constructor?Type.Object:Array.isArray(e)?Type.Array:Type.Value:Type.Value}function JsonDiffRecursive(e,t,n,r){if(t===n)return!1;const o=TypeOf(t),i=TypeOf(n),s=r.length;let a=!0;if(o===i)switch(o){case Type.Array:a=JsonDiffArrays(e,t,n,r);break;case Type.Object:a=JsonDiffObjects(e,t,n,r)}return!!a&&(r.splice(s),r.push({path:e,value:t}),!0)}function JsonDiffArrays(e,t,n,r){let o=!0;if(t.length!==n.length&&r.push({path:e?`${e}.length`:"length",value:t.length}),t.length>0||n.length>0)for(let i=0;i<t.length;i++)o=JsonDiffRecursive(e?`${e}.${i}`:`${i}`,t[i],n[i],r)&&o;else o=!1;return o}function JsonDiffObjects(e,t,n,r){let o=!0;const i=Object.keys(t),s=Object.keys(n);if(0===i.length&&0===s.length)return!1;if(i.length>=s.length){let a=0,c=0;for(;a<i.length;){const u=e?`${e}.${i[a]}`:i[a];c<s.length&&i[a]===s[c]?(o=JsonDiffRecursive(u,t[i[a]],n[s[c]],r)&&o,c++):void 0!==t[i[a]]&&r.push({path:u,value:t[i[a]]}),a++}c<s.length&&(o=!0)}return o}function BreakUpValue(e,t,n,r,o){const i=r?t[r]:t,s=IsValue(i);if(!o&&s)return new Map([[e,i]]);if(o=o||new Map,s)return o;const a=n?n(i):null,c=a&&DiffTree.GetKeyRef(a);if(a&&a!==e)r&&(t[r]=c),BreakUpValue(a,i,n,null,o);else for(const t in i)BreakUpValue(`${e}.${t}`,i,n,t,o);return r||o.set(e,a===e?i:c||i),o}!function(e){e[e.Value=0]="Value",e[e.Object=1]="Object",e[e.Array=2]="Array"}(Type||(Type={}));class DiffTree{keyFunc;rootStateMap=new Map;constructor(e){this.keyFunc=e}static GetKeyRef(e){return`___DiffTreeKeyRef.${e}`}static ReadKeyRef(e){if(e){var t=e.match(/^___DiffTreeKeyRef\.([^.]+$)/);if(t)return t[1]}}DiffBatch(e){for(var t=[],n=0;n<e.length;n++)this.RunDiff(e[n].path,e[n].value,t);return t}DiffPath(e,t){var n=[];return this.RunDiff(e,t,n),n}UpdatePath(e,t){this.SetPathValue(e,t)}GetPath(e){return this.GetPathValue(e)}RunDiff(e,t,n){var r=this.GetBreakUpMap(e,t),o=n||[];r.forEach(((e,t)=>{var n=t.split(".").reduce(((e,t,n)=>0===n?this.rootStateMap.get(t):e&&e[t]),null);JsonDiffRecursive(t,e,n,o)}));for(var i=0;i<o.length;i++)this.SetPathValue(o[i].path,o[i].value)}GetPathValue(e){for(var t=e.split("."),n=this.rootStateMap.get(t[0]),r=1;r<t.length;r++)n=n&&n[t[r]];return n}SetPathValue(e,t){var n=e.split(".");if(1===n.length)this.rootStateMap.set(n[0],t);else{for(var r=this.rootStateMap.get(n[0]),o=1;o<n.length-1;o++)r=r[n[o]];r[n[n.length-1]]=t}}GetBreakUpMap(e,t){return this.keyFunc?BreakUpValue(e,t,this.keyFunc):new Map([[e,t]])}}return DiffTree}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DiffTreeScope=DiffTreeScope},547:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiffWorker=void 0;const r=n(285);var o;!function(e){var t=null,n=null;"undefined"!=typeof Worker&&(t=Worker,n=URL.createObjectURL(new Blob([`(${r.DiffTreeScope}).call(this, true)`]))),e.Create=function(){if(!t)throw"Worker is not available";return new t(n)}}(o||(t.DiffWorker=o={}))},521:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerQueue=void 0;const r=n(496);t.WorkerQueue=class{callbacks;worker;constructor(e){this.worker=e,this.callbacks=r.List.Create(),this.worker.onerror=e=>{var t=r.List.Pop(this.callbacks);t&&t(null,e)},this.worker.onmessage=e=>{var t=r.List.Pop(this.callbacks);t&&t(e.data)}}Push(e){return new Promise(((t,n)=>{r.List.Add(this.callbacks,(function(e,r){r?n(r):t(e)})),this.worker.postMessage(e)}))}Destroy(){this.worker.terminate()}}},501:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Store=void 0;const r=n(586),o=n(778);t.Store=class{observableTree=new r.ObservableTree;storeWriter=new o.StoreWriter(this.observableTree);rootScope=this.observableTree.Scope("ROOT",(e=>e));get Root(){return this.rootScope}constructor(e){e&&this.Write(e)}Action(e){e(this.observableTree.Get("ROOT"),this.storeWriter)}Write(e){this.Action(((t,n)=>n.Write(t,e)))}Merge(e){this.Action(((t,n)=>n.Merge(t,e)))}Destroy(){this.rootScope.Destroy()}}},161:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreAsync=void 0;const r=n(586),o=n(377),i=n(22),s=n(263);t.StoreAsync=class{idFunc;diffAsync;observableTree;asyncWriter;asyncQueue;constructor(e,t){if(this.idFunc=e,this.diffAsync=new o.DiffAsync(this.idFunc),this.observableTree=new r.ObservableTree(o.DiffAsync.ReadKeyRef),this.asyncWriter=new i.StoreAsyncWriter(this.idFunc,this.diffAsync,this.observableTree),this.asyncQueue=new s.AsyncQueue,t){var n=this.idFunc(t);this.observableTree.Write(n,t),this.Write(t)}}Scope(e,t){return this.observableTree.Scope(e,t)}async Action(e,t){await this.asyncQueue.Next((async()=>{await t(e&&this.observableTree.Get(e),this.asyncWriter)}))}async Write(e){await this.Action(null,(async(t,n)=>{await n.Write(t,e)}))}async Merge(e,t){await this.Action(e,(async(e,n)=>{await n.Merge(e,t)}))}Destroy(){this.asyncQueue.Stop(),this.diffAsync.Destroy()}}},22:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreAsyncWriter=void 0,t.StoreAsyncWriter=class{idFunc;diffAsync;observableTree;constructor(e,t,n){this.idFunc=e,this.diffAsync=t,this.observableTree=n}async Write(e,t){let n;if(e)n=this.observableTree.GetPathOf(e);else if(n=this.idFunc(t),!n)throw new Error("data must have an id");let r=await this.diffAsync.DiffPath(n,t);this.ApplyChanges(r)}async Merge(e,t){const n=this.observableTree.GetPathOf(e),r=Object.keys(t).map((e=>({path:`${n}.${e}`,value:t[e]}))),o=await this.diffAsync.DiffBatch(r);this.ApplyChanges(o)}async Push(e,t){const n=this.observableTree.GetPathOf(e);var r=`${n}.length`,o=await this.diffAsync.GetPath(r),i=await this.diffAsync.DiffPath(`${n}.${o}`,t);this.ApplyChanges(i)}async Splice(e,t,n,...r){var o=this.observableTree.GetPathOf(e),i=await this.diffAsync.GetPath(o);(i=i.slice()).splice(t,n,...r);var s=await this.diffAsync.DiffPath(o,i);this.ApplyChanges(s)}ApplyChanges(e){this.observableTree.WriteAll(e)}}},961:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreSync=void 0;const r=n(606),o=n(586),i=n(921);t.StoreSync=class{diffSync=new r.DiffSync;observableTree=new o.ObservableTree;storeWriter=new i.StoreSyncWriter(this.diffSync,this.observableTree);rootScope=this.observableTree.Scope("ROOT",(e=>e));get Root(){return this.rootScope}constructor(e){e&&this.Write(e)}Action(e){e(this.observableTree.Get("ROOT"),this.storeWriter)}Write(e){this.Action(((t,n)=>n.Write(t,e)))}Merge(e){this.Action(((t,n)=>n.Merge(t,e)))}Destroy(){this.rootScope.Destroy()}}},921:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreSyncWriter=void 0,t.StoreSyncWriter=class{diffSync;observableTree;constructor(e,t){this.diffSync=e,this.observableTree=t}Write(e,t){var n=e&&this.observableTree.GetPathOf(e)||"ROOT",r=this.diffSync.DiffPath(n,t);this.ApplyChanges(r)}Merge(e,t){var n=this.observableTree.GetPathOf(e),r=Object.keys(t).map((e=>({path:`${n}.${e}`,value:t[e]}))),o=this.diffSync.DiffBatch(r);this.ApplyChanges(o)}Push(e,t){var n=this.observableTree.GetPathOf(e),r=e.length;this.diffSync.UpdatePath(`${n}.${r}`,t),this.observableTree.Write(`${n}.${r}`,t)}Splice(e,t,n,...r){var o=this.observableTree.GetPathOf(e);const i=this.observableTree.Get(o).toJSON().slice();i.splice(t,n,...r),this.diffSync.UpdatePath(o,i),this.observableTree.Write(o,i)}ApplyChanges(e){this.observableTree.WriteAll(e)}}},778:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreWriter=void 0,t.StoreWriter=class{observableTree;constructor(e){this.observableTree=e}Write(e,t){const n=e&&this.observableTree.GetPathOf(e)||"ROOT";this.observableTree.Write(n,t)}Merge(e,t){const n=this.observableTree.GetPathOf(e);for(const e in t)this.observableTree.Write(`${n}.${e}`,t[e])}Push(e,t){const n=this.observableTree.GetPathOf(e);this.observableTree.Write(`${n}.${e.length}`,t)}Splice(e,t,n,...r){const o=e.toJSON().slice();o.splice(t,n,...r);const i=this.observableTree.GetPathOf(e);this.observableTree.Write(i,o)}}},645:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableComputed=void 0;const r=n(874),o=n(496),i=n(318),s=n(948),a=new Set,c=o.List.Create();function u({node:e,scope:t}){const n=s.ObservableScope.Value(t);e.data=(0,r.JsonDeepClone)(n)}let l=!1;var d;!function(e){e.Create=function(e){return function(e){const t=s.ObservableScope.Create(e),n=i.ObservableNode.Create({data:null});return s.ObservableScope.Watch(t,(function(e){!function(e,t){a.has(e)||(a.add(e),o.List.Add(c,{node:e,scope:t}),l||(l=!0,queueMicrotask((function(){l=!1,a.clear(),o.List.ForEach(c,u),o.List.Clear(c)}))))}(n,e)})),n.data=s.ObservableScope.Value(t),s.ObservableScope.Create((function(){return n.data}),[t])}(e)}}(d||(t.ObservableComputed=d={}))},318:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableNode=void 0;const r=n(874),o=n(948),i=new WeakMap,s=new WeakMap;function a(e,t){return{...Object.getOwnPropertyDescriptor(e,t),configurable:!0}}function c(e,t){return{...Object.getOwnPropertyDescriptor(e,t),configurable:!0}}function u(e,t){return Object.hasOwn(e,t)}function l(e,t){return Object.hasOwn(e,t)}function d(e){return Object.keys(e)}function f(e){return Object.keys(e)}function h(e){if(!e)return e;if(e.toJSON&&"function"==typeof e.toJSON)return e.toJSON();switch((0,r.JsonType)(e)){case"object":{const t=Object.keys(e);for(let n=0;n<t.length;n++)e[t[n]]=h(e[t[n]])}case"array":for(let t=0;t<e.length;t++)e[t]=h(e[t])}return e}function p(e,t,n){n=h(n),e[t]=n;const r=s.get(e);return o.ObservableScope.Update(r),!0}function b(e,t){const n=s.get(e);if(e=o.ObservableScope.Value(n),"toJSON"===t)return function(){return e};{const r=e[t];return"symbol"==typeof t?r:"function"==typeof r?function(...r){const s=e.slice();for(let e=0;e<s.length;e++)s[e]=i.get(s[e])??m(s[e]);let a=s[t](...r);switch(t){case"push":case"unshift":case"splice":case"pop":case"shift":case"sort":case"reverse":e.length=s.length;for(let t=0;t<s.length;t++)e[t]=h(s[t]);o.ObservableScope.Update(n)}return a}:m(r)}}let v=!1;function y(e,t,n){const a=s.get(e);if(n=h(n),v)e[t]=n,o.ObservableScope.Update(a);else{v=!0;const o=i.get(e),s=o.toJSON(),a=(0,r.JsonDiff)(n,s[t]);for(let e=0;e<a.length;e++)if(0===a[e].path.length)o[t]=a[e].value;else{const n=a[e].path;let r=o[t],i=0;for(;i<n.length-1;i++)r=r[n[i]];r[n[i]]=a[e].value}v=!1}return!0}function g(e,t){const n=s.get(e);if(e=o.ObservableScope.Value(n),"toJSON"===t)return function(){return e};{const n=e[t];return"symbol"==typeof t?n:m(n)}}function m(e){switch((0,r.JsonType)(e)){case"object":{const t=i.get(e)??function(e){const t=o.ObservableScope.Create((()=>e)),n=new Proxy(e,{get:g,set:y,has:u,ownKeys:d,getOwnPropertyDescriptor:a});return s.set(e,t),i.set(e,n),n}(e);return t}case"array":{const t=i.get(e)??function(e){const t=o.ObservableScope.Create((()=>e)),n=new Proxy(e,{get:b,set:p,has:l,ownKeys:f,getOwnPropertyDescriptor:c});return s.set(e,t),i.set(e,n),n}(e);return o.ObservableScope.Touch(s.get(e)),t}default:return e}}var O;!function(e){e.Create=function(e){return m(e=h(e))}}(O||(t.ObservableNode=O={}))},948:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableScope=t.ObservableScopeWrapper=t.ObservableScopeValue=void 0;const r=n(116);class o{scope;get Value(){return s.Value(this.scope)}constructor(e){this.scope=e}}t.ObservableScopeValue=o;class i extends o{scopeEmitter;constructor(e){super(e),e.emitter&&(this.scopeEmitter=r.Emitter.Create(),r.Emitter.On(e.emitter,(()=>r.Emitter.Emit(this.scopeEmitter,this))))}Scope(e){return new s((()=>e(this.Value)))}Watch(e){this.scopeEmitter&&(r.Emitter.On(this.scopeEmitter,e),e(this))}Unwatch(e){this.scopeEmitter&&r.Emitter.Remove(this.scopeEmitter,e)}Destroy(){l(this.scope),this.scopeEmitter&&this.scopeEmitter.clear()}}t.ObservableScopeWrapper=i;class s extends i{constructor(e){super(s.Create(e))}}t.ObservableScope=s;let a=null,c=!1;function u(e){return!e||e.dirty||e.destroyed?e.destroyed:(e.dirty=!!e.getFunction,r.Emitter.Emit(e.emitter,e),!1)}function l(e){if(e){if(void 0!==e.dependencies)for(let t=0;t<e.dependencies.length;t++)l(e.dependencies[t]);e.emitters&&e.emitters.clear(),e.emitter&&e.emitter.clear(),e.getFunction=null,e.setCallback=null,e.destroyed=!0}}!function(e){function t(e){c&&e&&(a??=new Set,a.add(e))}e.Create=function(e,t){const n="function"==typeof e,o={getFunction:n?e:null,value:n?null:e,async:!!n&&"AsyncFunction"===e[Symbol.toStringTag],dirty:n,emitter:n?r.Emitter.Create():null,emitters:null,destroyed:!1,setCallback:n?function(){return u(o)}:null,dependencies:t};return o},e.Register=t,e.Value=function(e){if(e)return t(e.emitter),function(e){if(!e.dirty)return;e.dirty=!1;let t=null;const n=e.getFunction&&function(n){const r=a;a=null;const o=c;c=!0,t=e.getFunction();const i=a;return a=r,c=o,i}();e.async?Promise.resolve(t).then((t=>{e.value=t,r.Emitter.Emit(e.emitter,e)})):e.value=t,function(e,t){t&&t.forEach((t=>{e.emitters?.delete(t)||r.Emitter.On(t,e.setCallback)})),e.emitters&&e.emitters.forEach((t=>r.Emitter.Remove(t,e.setCallback))),e.emitters=t}(e,n)}(e),e.value},e.Watching=function(){return c},e.Touch=function(e){e&&e.emitter&&t(e.emitter)},e.Watch=function(e,t){e&&e.emitter&&r.Emitter.On(e.emitter,t)},e.Unwatch=function(e,t){e&&e.emitter&&r.Emitter.Remove(e.emitter,t)},e.Update=function(e){u(e)},e.Destroy=function(e){l(e)}}(s||(t.ObservableScope=s={}))},586:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableTree=void 0;const r=n(948);var o;!function(e){e[e.Value=0]="Value",e[e.Object=1]="Object",e[e.Array=2]="Array"}(o||(o={}));const i={}.constructor;function s(e){return e?i===e.constructor?o.Object:Array.isArray(e)?o.Array:o.Value:o.Value}class a{valuePathResolver;undefinedScope=r.ObservableScope.Create((function(){}));scopeCache=new WeakMap;leafScopeCache=new WeakMap;proxyCache=new WeakMap;pathCache=new WeakMap;rootStateMap=new Map;constructor(e){this.valuePathResolver=e}static UnwrapProxyValues(e){if(e?.toJSON&&"function"==typeof e.toJSON)return e.toJSON();const t=s(e);if(t===o.Value)return e;if(t===o.Array){const t=e;for(let e=0;e<t.length;e++)t[e]=a.UnwrapProxyValues(t[e])}else{const t=Object.keys(e);for(let n=0;n<t.length;n++)e[t[n]]=a.UnwrapProxyValues(e[t[n]])}return e}Get(e){return e.split(".").reduce(((e,t,n)=>{if(0===n){let e=this.rootStateMap.get(t);const n=this.GetParentScope(e);return r.ObservableScope.Value(n)}return e&&e[t]}),null)}GetPathOf(e){return e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),this.pathCache.get(e)}Scope(e,t){return new r.ObservableScope((()=>{const n=this.Get(e);return t&&t(n)||n}))}Write(e,t){const n=this.WritePath(e,t);r.ObservableScope.Update(n)}WriteAll(e){const t=new Set;for(var n=0;n<e.length;n++){const r=this.WritePath(e[n].path,e[n].value);t.add(r)}t.forEach((e=>r.ObservableScope.Update(e)))}GetParentScope(e){if(void 0===e)return this.undefinedScope;let t=this.scopeCache.get(e);return t||(t=r.ObservableScope.Create((()=>this.GetValueProxy(e))),this.scopeCache.set(e,t)),t}GetPropertyScope(e,t){const n=e[t];if(s(n)===o.Value){let n=this.leafScopeCache.get(e)||{};return n[t]=n[t]||r.ObservableScope.Create((()=>{const n=this.scopeCache.get(e),o=r.ObservableScope.Value(n).toJSON()[t];let i;return this.valuePathResolver&&"string"==typeof o&&(i=this.valuePathResolver(o))?this.Get(i):o})),this.leafScopeCache.set(e,n),n[t]}{let o=this.scopeCache.get(n);return o||(o=r.ObservableScope.Create((()=>{const n=this.scopeCache.get(e),o=r.ObservableScope.Value(n).toJSON()[t];return this.GetValueProxy(o)})),this.scopeCache.set(n,o)),o}}GetValueProxy(e){let t=this.proxyCache.get(e);return t||(t=this.CreateProxy(e),this.proxyCache.set(e,t)),t}ObjectProxyGetter=(e,t)=>"toJSON"===t?function(){return e}:"symbol"==typeof t?e[t]:r.ObservableScope.Value(this.GetPropertyScope(e,t));CreateObjectProxy(e){return new Proxy(e,{get:this.ObjectProxyGetter})}ArrayProxyGetter=(e,t)=>{if("toJSON"===t)return function(){return e};if("symbol"==typeof t)return e[t];if(isNaN(parseInt(t))){const n=e[t];if("function"==typeof n){const t=e.map(((t,n)=>r.ObservableScope.Value(this.GetPropertyScope(e,n.toString()))));return n.bind(t)}return n}return r.ObservableScope.Value(this.GetPropertyScope(e,t))};CreateArrayProxy(e){return new Proxy(e,{get:this.ArrayProxyGetter})}CreateProxy(e){switch(s(e)){case o.Object:return this.CreateObjectProxy(e);case o.Array:return this.CreateArrayProxy(e);default:return e}}WritePath(e,t){this.UpdatePathCache(e,t);const n=e.split(".");if(1===n.length){const e=this.rootStateMap.get(n[0]);return this.rootStateMap.set(n[0],t),void 0===e?this.undefinedScope:this.scopeCache.get(e)}let r,i=0;for(;i<n.length-1&&(0===i||r);i++)r=0===i?this.rootStateMap.get(n[i]):r&&r[n[i]];if(!r)throw new Error("Unable to write path: "+e+". Falsey value found at: "+n.slice(0,i).join("."));const a=n[i],c=r[a],u=s(c);if(r[a]=t,u!==o.Value||Array.isArray(r))return this.scopeCache.get(r)||this.scopeCache.get(c);const l=this.leafScopeCache.get(r);return l&&l[a]||this.scopeCache.get(r)}UpdatePathCache(e,t){if(s(t)===o.Value)return;this.pathCache.set(t,e),this.proxyCache.delete(t),this.scopeCache.delete(t),this.leafScopeCache.delete(t);const n=Object.keys(t);for(let r=0;r<n.length;r++)this.UpdatePathCache(`${e}.${n[r]}`,t[n[r]]);return t}}t.ObservableTree=a},890:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableComputed=t.ObservableNode=t.ObservableScope=t.StoreAsync=t.StoreSync=t.Store=void 0;var r=n(501);Object.defineProperty(t,"Store",{enumerable:!0,get:function(){return r.Store}});var o=n(961);Object.defineProperty(t,"StoreSync",{enumerable:!0,get:function(){return o.StoreSync}});var i=n(161);Object.defineProperty(t,"StoreAsync",{enumerable:!0,get:function(){return i.StoreAsync}});var s=n(948);Object.defineProperty(t,"ObservableScope",{enumerable:!0,get:function(){return s.ObservableScope}});var a=n(318);Object.defineProperty(t,"ObservableNode",{enumerable:!0,get:function(){return a.ObservableNode}});var c=n(645);Object.defineProperty(t,"ObservableComputed",{enumerable:!0,get:function(){return c.ObservableComputed}})},20:(e,t)=>{var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.Animation=t.AnimationType=void 0,function(e){e.EaseIn=function*(e){for(var t=1/e,n=t,r=0;r<e;r++,n+=t)yield(1-n)*(1-n)*(1-n)*0+3*(1-n)*(1-n)*n*1+3*(1-n)*n*n*1+n*n*n*1},e.Linear=function*(e){for(var t=1/e,n=t,r=0;r<e;r++,n+=t)yield n}}(n||(n={})),function(e){e[e.Linear=0]="Linear",e[e.EaseIn=1]="EaseIn"}(r||(t.AnimationType=r={})),t.Animation=class{type;frameCount;frameTimings;update;animationTimeouts;running;start;end;enabled;get Running(){return this.running}get Start(){return this.start}get End(){return this.end}get Enabled(){return this.enabled}constructor(e,t,n){this.running=!1,this.start=null,this.end=null,this.enabled=!0,this.type=e,this.frameCount=Math.ceil(t/1e3*60),this.frameTimings=[];for(var r=t/this.frameCount,o=0;o<this.frameCount;o++)this.frameTimings[o]=(o+1)*r;this.update=n,this.animationTimeouts=[]}Animate(e,t){if(this.enabled){var o=t-e;if(0!==o)return this.Cancel(),this.running=!0,this.start=e,this.end=t,new Promise((t=>{var i=n[r[this.type]],s=0;for(var a of i(this.frameCount)){var c=a*o+e;this.SetTimeout(s,c,s===this.frameCount-1?t:null),s++}})).then((()=>{this.running=!1,this.start=null,this.end=null}))}}Disable(){this.Cancel(),this.enabled=!1}Enable(){this.enabled=!0}Cancel(){for(var e=0;e<this.animationTimeouts.length;e++)clearTimeout(this.animationTimeouts[e]);this.running=!1,this.start=null,this.end=null}Destroy(){this.Cancel()}SetTimeout(e,t,n){this.animationTimeouts[e]=setTimeout((()=>{this.update(t),n&&n()}),this.frameTimings[e])}}},263:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncQueue=void 0;const r=n(496);t.AsyncQueue=class{running=!1;queue=r.List.Create();Next(e){const t=new Promise(((t,n)=>{r.List.Add(this.queue,(async function(){try{const n=await e();t(n)}catch(e){n(e)}}))}));return this.Start(),t}Stop(){r.List.Clear(this.queue)}Start(){this.running||(this.running=!0,this.ExecuteQueue())}async ExecuteQueue(){const e=r.List.Pop(this.queue);null!==e?(await e(),this.ExecuteQueue()):this.running=!1}}},334:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.State=function(){return a},t.StateSync=function(){return c},t.StateAsync=function(){return u},t.Scope=function(){return l},t.DestroyScope=function(){return d},t.Computed=function(){return f},t.ComputedAsync=function(e){return h.bind(null,e)},t.Inject=function(e){return p.bind(null,e)},t.Destroy=b,t.PreReqTemplate=y,t.PreReq=m;const r=n(890),o=n(948),i=n(586),s=n(318);function a(e,t){const n=`StoreDecorator_${t}`;return{configurable:!1,enumerable:!0,get:function(){return this.DecoratorMap.get(n)},set:function(e){const t=this.DecoratorMap,r=t.get(n);if(r){const t=Object.keys(e);for(let n=0;n<t.length;n++)r[t[n]]=e[t[n]]}else t.set(n,s.ObservableNode.Create(e))}}}function c(e,t){const n=`StoreSyncDecorator_${t}`;return{configurable:!1,enumerable:!0,get:function(){return this.DecoratorMap.get(n)},set:function(e){const t=this.DecoratorMap,r=t.get(n);if(r){const t=Object.keys(e);for(let n=0;n<t.length;n++)r[t[n]]=e[t[n]]}else t.set(n,s.ObservableNode.Create(e))}}}function u(e,t){const n=`StoreAsyncDecorator_${t}`,s=`StoreAsyncDecorator_Scope_${t}`;return v(e,n),v(e,s),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap.get(s);const t=e&&e.Value;return o.ObservableScope.Watching()?t:i.ObservableTree.UnwrapProxyValues(t)},set:function(e){var t=this.DecoratorMap,o=t.get(n);o?o.Action("ROOT",(async(t,n)=>await n.Merge(t.data,e))):(o=new r.StoreAsync((e=>e.___id),{___id:"ROOT",data:e}),t.set(n,o),t.set(s,o.Scope("ROOT",(e=>e.data))))}}}function l(e,t,n){if(!n||!n.get)throw"Scope decorator requires a getter";if(n&&n.set)throw"Scope decorator does not support setters";const r=`ScopeDecorator_${t}`;return v(e,r),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap,t=e.get(r);if(!t){const i=n.get.bind(this);t=new o.ObservableScope(i),e.set(r,t)}return t.Value}}}function d(e,t,n){if(!n||!n.get)throw"Destroy Scope decorator requires a getter";if(n&&n.set)throw"Destroy Scope decorator does not support setters";const r=`ScopeDecorator_${t}`;v(e,r);const i=`ScopeDecorator_${t}_Value`;return v(e,i),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap,t=e.get(r);if(!t){const s=n.get.bind(this);t=new o.ObservableScope(s),e.set(r,t),t.Watch((t=>{var n=e.get(i);n&&n.Destroy(),e.set(i,t.Value)}))}return t.Value}}}function f(e,t,n){if(!n||!n.get)throw"Computed decorator requires a getter";if(n&&n.set)throw"Computed decorator does not support setters";const i=`ComputedDecorator_Scope_${t}`,s=`ComputedDecorator_Store_${t}`;return v(e,i),v(e,s),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap,t=e.get(s);if(!t){const a=n.get.bind(this),c=new o.ObservableScope(a);t=new r.StoreSync(c.Value),c.Watch((e=>{this.Destroyed||t.Write(e.Value)})),e.set(i,c),e.set(s,t)}return t.Root.Value}}}function h(e,t,n,i){if(!i||!i.get)throw"ComputedAsync decorator requires a getter";if(i&&i.set)throw"ComputedAsync decorator does not support setters";const s=`ComputedDecorator_Scope_${n}`,a=`ComputedDecorator_Store_${n}`,c=`ComputedDecorator_StoreScope_${n}`;return v(t,s),v(t,a),v(t,c),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap,t=e.get(c);if(!t){const n=i.get.bind(this),u=new o.ObservableScope((()=>{var e=n();return e&&"function"==typeof e.toJSON&&(e=e.toJSON()),e})),l=new r.StoreAsync((e=>e._id),{_id:"ROOT",data:u.Value});u.Watch((e=>{this.Destroyed||l.Write({_id:"ROOT",data:e.Value})})),t=l.Scope("ROOT",(e=>e.data)),e.set(c,t),e.set(s,u),e.set(a,l)}return t.Value}}}function p(e,t,n,r){return{configurable:!1,enumerable:!0,get:function(){return this.Injector.Get(e)},set:function(t){this.Injector.Set(e,t)}}}function b(){return v}function v(e,t){var n=e;n.DestroyDecorator_Destroys=n.DestroyDecorator_Destroys||[],n.DestroyDecorator_Destroys.push(t)}function y(e){return g.bind(null,e)}function g(e,t){t.prototype.PreReqTemplateDecorator_Template=e}function m(){return O}function O(e,t){var n=e;n.PreReqDecorator_PreReqs=n.PreReqDecorator_PreReqs||[],n.PreReqDecorator_PreReqs.push(t)}!function(e){e.All=function(e){(function(e){return e&&e.DestroyDecorator_Destroys||[]})(e).map((t=>e[t]||e.DecoratorMap.get(t))).filter((e=>!!e)).forEach((e=>e.Destroy()))}}(b||(t.Destroy=b={})),function(e){e.Get=function(e){var t=e&&e.PreReqTemplateDecorator_Template,n=t?t():[];return Array.isArray(n)||(n=[n]),n}}(y||(t.PreReqTemplate=y={})),function(e){function t(e){return e&&e.PreReqDecorator_PreReqs||[]}e.All=function(e){var n=t(e).map((t=>e[t]&&e[t].Init||Promise.resolve()));return Promise.all(n)},e.Has=function(e){return t(e).length>0}}(m||(t.PreReq=m={}))},116:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=void 0,function(e){function t(e,t){e.delete(t)}e.Create=function(){return new Set},e.On=function(e,t){e.add(t)},e.Emit=function(e,...n){let r;e.forEach((function(e){!0===e(...n)&&(r??=[],r.push(e))}));for(let n=0;void 0!==r&&n<r.length;n++)t(e,r[n])},e.Remove=t}(n||(t.Emitter=n={}))},205:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(334),t),o(n(20),t)},880:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Injector=void 0;class n{parent;typeMap;constructor(){this.parent=n.Current(),this.typeMap=new Map}Get(e){if(0===this.typeMap.size)return this.parent&&this.parent.Get(e);var t=this.typeMap.get(e);return t||(t=this.parent&&this.parent.Get(e)),t}Set(e,t){this.typeMap.set(e,t)}}t.Injector=n,function(e){var t=null;function n(){return t}e.Current=n,e.Scope=function(e,r,...o){var i=n();t=e;const s=r(...o);return t=i,s}}(n||(t.Injector=n={}))},874:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JsonType=r,t.JsonDeepClone=function e(t){switch(r(t)){case"array":return t.map(e);case"object":{const n={},r=Object.keys(t);for(let o=0;o<r.length;o++)n[r[o]]=e(t[r[o]]);return n}default:return t}},t.JsonDiff=function(e,t){const n=[];return o([],e,t,n),n};const n=Object.getPrototypeOf({});function r(e){return null==e?"value":Array.isArray(e)?"array":n===Object.getPrototypeOf(e)?"object":"value"}function o(e,t,n,i){if(t===n)return!1;const s=r(t),a=r(n),c=i.length;let u=!0;if(s===a)switch(s){case"array":u=function(e,t,n,r){let i=!0;if(t.length!==n.length&&r.push({path:e.concat("length"),value:t.length}),t.length>0||n.length>0)for(let s=0;s<t.length;s++){const a=e.concat(s),c=n[s];i=o(a,t[s],c,r)&&i}else i=!1;return i}(e,t,n,i);break;case"object":u=function(e,t,n,r){const i=Object.keys(t).sort(),s=Object.keys(n).sort();if(0===i.length&&0===s.length)return!1;if(i.length<s.length)return!0;let a=0,c=0;for(;a<i.length;){const u=e.concat(i[a]);c<s.length&&i[a]===s[c]?(o(u,t[i[a]],n[s[c]],r),c++):void 0!==t[i[a]]&&r.push({path:u,value:t[i[a]]}),a++}return c<s.length}(e,t,n,i)}return!!u&&(i.splice(c),i.push({path:e,value:t}),!0)}},496:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.List=void 0,function(e){function t(e,t){return 0===e.size?(e.head=t,e.tail=t,e.size=1):(t.previous=e.tail,e.tail.next=t,e.tail=t,e.size++),t}e.Create=function(){return{head:null,tail:null,size:0}},e.Clear=function(e){e.head=null,e.tail=null,e.size=0},e.Push=function(e,t){const n={previous:null,next:null,data:t};return 0===e.size?(e.head=n,e.tail=n,e.size=1):(n.next=e.head,e.head.previous=n,e.head=n,e.size++),n},e.Pop=function(e){if(0===e.size)return null;const t=e.head;return e.head=t.next,e.head&&(e.head.previous=null),e.size--,0===e.size&&(e.tail=null),t.data},e.Add=function(e,n){return t(e,{previous:null,next:null,data:n})},e.AddNode=t,e.AddBefore=function(t,n,r){if(!n)return e.Add(t,r);const o={previous:null,next:null,data:r},i=n.previous;return o.next=n,n.previous=o,t.head===n&&(t.head=o),i&&(i.next=o,o.previous=i),t.size++,o},e.AddAfter=function(t,n,r){if(!n)return e.Push(t,r);const o={previous:null,next:null,data:r},i=n.next;return n.next=o,o.previous=n,t.tail===n&&(t.tail=o),i&&(i.previous=o,o.next=i),t.size++,o},e.Remove=function(e){if(0===e.size)return null;var t=e.tail;return e.tail=t.previous,e.tail&&(e.tail.next=null),e.size--,0===e.size&&(e.head=null),t.data},e.RemoveNode=function(e,t){if(e.head===t)e.head=t.next;else if(e.tail===t)e.tail=t.previous;else{const e=t.previous,n=t.next;e.next=n,n.previous=e}t.next=t.previous=null,e.size--,e.size>0&&(e.head.previous=e.tail.next=null)},e.ForEach=function(e,t){let n=e.head;for(;n;)t(n.data),n=n.next},e.ToNodeMap=function(e,t){const n=new Map;let r=e.head;for(;r;){const e=t(r.data),o=n.get(e)||[r];o[0]!==r?o.push(r):n.set(e,o),r=r.next}return n}}(n||(t.List=n={}))},224:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Schedule=v,t.After=function(e){b(e,!1,!1)},t.Callback=function(e){return function(t,n,r,o){v((function(){e(t,n,r,o)}))}},t.Synch=g,t.Thread=m,t.ThreadAsync=function(e){return new Promise((t=>m((function(n){e(n),m(t)}))))};const r=n(496),o=16,i=r.List.Create();let s=null,a=!1;const c=setTimeout;function u(){return this.end-Date.now()}function l(){return{end:Date.now()+o,timeRemaining:u}}function d(e=l()){let t;for(;e.timeRemaining()>0&&(t=r.List.Pop(i));)p(t,e);i.size>0?c(d):a=!1}function f(e){r.List.Add(i,e),a||(a=!0,c(d))}function h(e,t){const n=e.workEndNode;e.workEndNode=e.workList.head,t(!0),e.workEndNode=n}function p(e,t=l()){const n=s;s=e;const o=e.async;let i;for(;o===e.async&&t.timeRemaining()>0&&(i=r.List.Pop(e.workList));)h(e,i);e.workList.size>0&&f(e),s=n}function b(e,t,n){s=s||{async:!1,workEndNode:null,workList:r.List.Create()},s.async=s.async||n,t?r.List.AddBefore(s.workList,s.workEndNode,e):s.workEndNode?r.List.AddAfter(s.workList,s.workEndNode,e):s.workEndNode=r.List.Add(s.workList,e)}function v(e){b(e,!0,!0)}var y=!1;function g(e){s||y?e(!1):(y=!0,function(e){e(!1),s&&(s.async?f(s):p(s)),s=null}(e),y=!1)}function m(e){s?b(e,!0,!1):g(e)}},156:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var r=n(342);Object.defineProperty(t,"Component",{enumerable:!0,get:function(){return r.Component}})},576:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableComputed=t.ObservableNode=t.StoreAsync=t.Store=t.ObservableScope=void 0,o(n(156),t),o(n(205),t);var i=n(890);Object.defineProperty(t,"ObservableScope",{enumerable:!0,get:function(){return i.ObservableScope}}),Object.defineProperty(t,"Store",{enumerable:!0,get:function(){return i.Store}}),Object.defineProperty(t,"StoreAsync",{enumerable:!0,get:function(){return i.StoreAsync}}),Object.defineProperty(t,"ObservableNode",{enumerable:!0,get:function(){return i.ObservableNode}}),Object.defineProperty(t,"ObservableComputed",{enumerable:!0,get:function(){return i.ObservableComputed}}),o(n(147),t)}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}var __webpack_exports__={};(()=>{const e=__webpack_require__(576);for(var t in e)window[t]=e[t]})()})();
|
|
1
|
+
(()=>{"use strict";var __webpack_modules__={642:(e,t)=>{function n(e,t,n,r){const o=n;t[r]??=function(e,t){let n;return function(r){r!==n&&(n&&e.removeEventListener(t,n),r&&e.addEventListener(t,r),n=r)}}(e,r),t[r](o)}Object.defineProperty(t,"__esModule",{value:!0}),t.CreateEventAssignment=function(e){let t;const r={};return function(o){const i=null!==o?Object.keys(o):[],s=void 0===t?i:i.concat(t);t=i;for(let t=0;t<s.length;t++)n(e,r,o&&o[s[t]],s[t])}}},543:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateNodeValueAssignment=function(e){let t=e.nodeValue;return function(n){n.nodeValue!==t&&(e.nodeValue=n.nodeValue,t=n.nodeValue)}},t.CreatePropertyAssignment=a;const r=n(874);function o(e,t){let n=e[t];return function(r){r!==n&&(e[t]=r,n=r)}}function i(e,t,n){t.value??="INPUT"===e.nodeName?function(e){let t=e.value;return e.addEventListener("blur",(function(){e.value=t})),function(n){if(n!==t){const r=e.selectionStart,o=e.selectionEnd;e.value=n,e.ownerDocument.activeElement===e&&e.setSelectionRange(r,o),t=n}}}(e):o(e,"value"),t.value(n.value)}function s(e,t,n,i){const s=n[i];t[i]??="value"===(0,r.JsonType)(s)?o(e,i):a(e[i],!1),t[i](s)}function a(e,t=!0){const n={};return function(r){const o=Object.keys(r);for(let a=0;a<o.length;a++)!0===t&&"value"===o[a]?i(e,n,r):s(e,n,r,o[a])}}},641:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DOMNodeConfig=void 0;const r=n(819),o=n(496),i=n(543),s=n(642);let a=o.List.Create(),c=!1;function u(){o.List.Add(a,null);const e=Date.now();let t;for(;t=o.List.Pop(a);)t();0===a.size?c=!1:Date.now()-e<16?u():r.wndw.requestAnimationFrame(u)}t.DOMNodeConfig={createNode:(e,t)=>t?r.wndw.document.createElementNS(t,e):r.wndw.document.createElement(e),createTextNode:(e="")=>r.wndw.document.createTextNode(e),scheduleUpdate(e){o.List.Add(a,e),c||(c=!0,r.wndw.requestAnimationFrame(u))},addListener(e,t,n){e.addEventListener(t,n)},removeListener(e,t,n){e.removeEventListener(t,n)},addChild(e,t){e.appendChild(t)},addChildFirst(e,n){t.DOMNodeConfig.addChildBefore(e,e.firstChild,n)},addChildBefore(e,n,r){n?r!==n&&e.insertBefore(r,n):t.DOMNodeConfig.addChild(e,r)},addChildAfter(e,n,r){n?t.DOMNodeConfig.addChildBefore(e,n.nextSibling,r):t.DOMNodeConfig.addChildFirst(e,r)},removeChild(e,t){e.removeChild(t)},remove(e){e&&e.parentNode&&e.parentNode.removeChild(e)},setText(e,t){e.textContent=t},getAttribute:(e,t)=>e.getAttribute(t),setAttribute(e,t,n){e.setAttribute(t,n)},createPropertyAssignment:e=>e.nodeType===Node.TEXT_NODE?(0,i.CreateNodeValueAssignment)(e):(0,i.CreatePropertyAssignment)(e),createEventAssignment:e=>(0,s.CreateEventAssignment)(e),fireEvent(e,t,n){var r=new CustomEvent(t,n);e.dispatchEvent(r)},getFirstChild:e=>e.firstChild,getLastChild:e=>e.lastChild,getNextSibling:e=>e.nextSibling,replaceChildren(e,t){e.replaceChildren(...t)}}},774:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.div=function(e,t){return r.ElementNode.Create("div",null,e,t)},t.a=function(e,t){return r.ElementNode.Create("a",null,e,t)},t.ul=function(e,t){return r.ElementNode.Create("ul",null,e,t)},t.li=function(e,t){return r.ElementNode.Create("li",null,e,t)},t.br=function(e){return r.ElementNode.Create("br",null,e,null)},t.b=function(e,t){return r.ElementNode.Create("b",null,e,t)},t.span=function(e,t){return r.ElementNode.Create("span",null,e,t)},t.img=function(e){return r.ElementNode.Create("img",null,e,null)},t.video=function(e,t){return r.ElementNode.Create("video",null,e,t)},t.source=function(e){return r.ElementNode.Create("source",null,e,null)},t.input=function(e){return r.ElementNode.Create("input",null,e,null)},t.textarea=function(e){return r.ElementNode.Create("textarea",null,e,null)},t.select=function(e,t){return r.ElementNode.Create("select",null,e,t)},t.option=function(e,t){return r.ElementNode.Create("option",null,e,t)},t.h1=function(e,t){return r.ElementNode.Create("h1",null,e,t)},t.h2=function(e,t){return r.ElementNode.Create("h2",null,e,t)},t.h3=function(e,t){return r.ElementNode.Create("h3",null,e,t)},t.p=function(e,t){return r.ElementNode.Create("p",null,e,t)},t.style=function(e,t){return r.ElementNode.Create("style",null,e,t)},t.button=function(e,t){return r.ElementNode.Create("button",null,e,t)},t.table=function(e,t){return r.ElementNode.Create("table",null,e,t)},t.th=function(e,t){return r.ElementNode.Create("th",null,e,t)},t.tr=function(e,t){return r.ElementNode.Create("tr",null,e,t)},t.td=function(e,t){return r.ElementNode.Create("td",null,e,t)};const r=n(413)},147:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(774),t),o(n(716),t),o(n(543),t),o(n(642),t)},716:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.svg=function(e,t){return r.ElementNode.Create("svg",o,e,t)},t.g=function(e,t){return r.ElementNode.Create("g",o,e,t)},t.circle=function(e,t){return r.ElementNode.Create("circle",o,e,t)};const r=n(413),o="http://www.w3.org/2000/svg"},819:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wndw=void 0,t.wndw="undefined"!=typeof window?window:new(Object(function(){var e=new Error("Cannot find module 'jsdom'");throw e.code="MODULE_NOT_FOUND",e}())("").window)},173:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BoundNode=void 0;const r=n(267),o=n(948);var i;function s(e,t){if(t)for(var n in t)r.NodeConfig.getAttribute(e.node,n)!==t[n]&&r.NodeConfig.setAttribute(e.node,n,t[n])}!function(e){e.Init=function(e){const t=e.nodeDef;if(t.props){const n=o.ObservableScope.Create(t.props);e.scopes??=[],e.scopes.push(n),e.assignProperties=r.NodeConfig.createPropertyAssignment(e.node),o.ObservableScope.Watch(n,(function(t){!function(e,t){e.setProperties||(e.setProperties=!0,r.NodeConfig.scheduleUpdate((function(){if(e.setProperties=!1,e.destroyed)return;const n=o.ObservableScope.Value(t);e.assignProperties(n)})))}(e,t)}));const i=o.ObservableScope.Value(n);e.assignProperties(i)}if(t.attrs){const n=o.ObservableScope.Create(t.attrs);e.scopes??=[],e.scopes.push(n),o.ObservableScope.Watch(n,(function(t){!function(e,t){e.setAttributes||(e.setAttributes=!0,r.NodeConfig.scheduleUpdate((function(){e.setAttributes=!1,e.destroyed||s(e,o.ObservableScope.Value(t))})))}(e,t)})),s(e,o.ObservableScope.Value(n))}if(t.on){const n=o.ObservableScope.Create(t.on);e.scopes??=[],e.scopes.push(n),e.assignEvents=r.NodeConfig.createEventAssignment(e.node),o.ObservableScope.Watch(n,(function(t){!function(e,t){e.setEvents||(e.setEvents=!0,r.NodeConfig.scheduleUpdate((function(){if(e.setEvents=!1,e.destroyed)return;const n=o.ObservableScope.Value(t);e.assignEvents(n)})))}(e,t)}));const i=o.ObservableScope.Value(n);e.assignEvents(i)}}}(i||(t.BoundNode=i={}))},342:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;const r=n(64),o=n(230),i=n(334),s=n(948);class a{nodeRef;componentEvents;scope;templates;decoratorMap;get Injector(){return this.nodeRef.injector}get Destroyed(){return this.nodeRef.destroyed}get DecoratorMap(){return this.decoratorMap}get Scope(){return this.scope}get Data(){return this.scope.Value}get NodeRef(){return this.nodeRef}get Templates(){return this.templates}constructor(e,t,n,r){this.nodeRef=n,this.componentEvents=r,this.scope=new s.ObservableScope(e),this.templates=t||{},this.decoratorMap=new Map}Template(){return[]}Bound(){}Fire(e,t){var n=this.componentEvents&&this.componentEvents[e];n&&n(t)}Destroy(){this.scope.Destroy(),i.Destroy.All(this)}}t.Component=a,function(e){function t(e,t,n){return o.ComponentNode.ToFunction(e,t,n)}function n(e,t){r.NodeRef.Init(t);var n=r.NodeRef.Wrap(e);r.NodeRef.AddChild(n,t)}e.ToFunction=t,e.Register=function(e,r){const o=t(`${e}-component`,void 0,r);class i extends HTMLElement{constructor(){super(),n(this.attachShadow({mode:"open"}),o({}))}}customElements.define(e,i)},e.Attach=n}(a||(t.Component=a={}))},230:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ComponentNode=void 0;const r=n(173),o=n(64),i=n(267),s=n(342),a=n(880),c=n(334),u=n(224),l=n(496);var d;function f(e){const t=e.component.Template();return Array.isArray(t)?t:[t]}function h(e,t){(0,u.Thread)((function(){if(e.destroyed)return;const n=a.Injector.Scope(e.injector,f,e);(0,u.Schedule)((function(){o.NodeRef.InitAll(e,n)})),(0,u.Thread)((function(){if(e.destroyed)return;const r=l.List.Create();l.List.Add(r,{value:void 0,init:!0,nodes:n}),t?o.NodeRef.ReconcileChildren(e,r):i.NodeConfig.scheduleUpdate((function(){e.destroyed||o.NodeRef.ReconcileChildren(e,r)}))})),e.component.Bound!==s.Component.prototype.Bound&&(0,u.After)((function(){i.NodeConfig.scheduleUpdate((()=>setTimeout((()=>e.component.Bound()),0)))}))}))}!function(e){e.Fire=function(e,t){var n=this.componentEvents&&this.componentEvents[e];n&&n(t)},e.ToFunction=function(e,t,n){return function(r,i){return function(e,t,n,r,i){var s=o.NodeRef.Create(e,t,o.NodeRefType.ComponentNode);return s.nodeDef=n,s.constructor=r,s.templates=i,s}(e,t,r,n,i)}},e.Init=function(e){var t,n=e.nodeDef,s=n.on;n.on=null,e.component=new e.constructor(n.data,e.templates,e,s),t=e,c.PreReq.Has(t.component)?function(e){return new Promise((t=>{(0,u.Thread)((function(){const n=a.Injector.Scope(e.injector,c.PreReqTemplate.Get,e.component);(0,u.Schedule)((function(){e.destroyed||o.NodeRef.InitAll(e,n)})),(0,u.Thread)((function(){if(!e.destroyed){for(var r=0;r<n.length;r++)o.NodeRef.AddChild(e,n[r]);c.PreReq.All(e.component).then((function(){if(!e.destroyed){for(var r=0;r<n.length;r++)o.NodeRef.Destroy(n[r]);i.NodeConfig.scheduleUpdate((function(){if(!e.destroyed){for(var r=0;r<n.length;r++)o.NodeRef.DetachChild(e,n[r]);t()}}))}}))}}))}))}))}(t).then((function(){h(t,!1)})):h(t,!0),r.BoundNode.Init(e)}}(d||(t.ComponentNode=d={}))},413:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ElementNode=void 0;const r=n(948),o=n(880),i=n(496),s=n(224),a=n(173),c=n(267),u=n(64);var l;!function(e){e.Create=function(e,t,n,r){var o=u.NodeRef.Create(e,t,u.NodeRefType.ElementNode);return o.nodeDef=n,o.childrenFunc=r,o},e.Init=function(e){if(e.childrenFunc){var t=e.nodeDef;if(t.data){const n=r.ObservableScope.Create(t.data);e.childNodes=new Set,e.scopes??=[],e.scopes.push(n),r.ObservableScope.Watch(n,(function(){!function(e,t){e.setData||(e.setData=!0,c.NodeConfig.scheduleUpdate((function(){e.setData=!1,e.destroyed||p(e,f(t))})))}(e,n)})),p(e,f(n),!0)}else n=e,(0,s.Synch)((function(){const e=o.Injector.Scope(n.injector,b,n.childrenFunc,!0);e.length>0&&(u.NodeRef.InitAll(n,e),(0,s.Thread)((function(){if(n.destroyed)return;const t=i.List.Create();i.List.Add(t,{value:null,init:!0,nodes:e}),u.NodeRef.ReconcileChildren(n,t)})))}))}var n;a.BoundNode.Init(e)}}(l||(t.ElementNode=l={}));const d=[];function f(e){var t=r.ObservableScope.Value(e);return t?(Array.isArray(t)||(t=[t]),t):d}function h(e){return e.value}function p(e,t,n=!1){(0,s.Synch)((function(){!function(e,t){const n=i.List.Create(),r=i.List.Create(),a=e.nodeList,c=a&&i.List.ToNodeMap(a,h);for(let s=0;s<t.length;s++){let u;if(c){const e=c.get(t[s]);if(e){let t=e.length-1;for(;t>=0&&!u;t--)u=e[t],e[t]=null}}u?(i.List.RemoveNode(a,u),i.List.AddNode(n,u),u.data.init||i.List.Add(r,u.data)):(u=i.List.Add(n,{value:t[s],init:!1,nodes:o.Injector.Scope(e.injector,b,e.childrenFunc,t[s])}),i.List.Add(r,u.data))}let l=r.head;for(;l;){const t=l.data;(0,s.Schedule)((function(){e.destroyed||0===n.size||(u.NodeRef.InitAll(e,t.nodes),t.init=!0)})),l=l.next}if(a){let t=a.head;for(;t;){const n=t.data;t=t.next;for(let t=0;t<n.nodes.length;t++)e.childNodes.delete(n.nodes[t]);u.NodeRef.DestroyAll(n.nodes)}i.List.Clear(a)}e.nodeList=n}(e,t);const r=e.nodeList,a=r.size;(0,s.Thread)((function(t){e.destroyed||(n||!t?u.NodeRef.ReconcileChildren(e,r):c.NodeConfig.scheduleUpdate((function(){e.destroyed||r.size!==a||u.NodeRef.ReconcileChildren(e,r)})))}))}))}function b(e,t){const n=e(t);if("string"==typeof n||!n){const n=u.NodeRef.Create("text",null,u.NodeRefType.BoundNode);return n.nodeDef={props:function(){return{nodeValue:e(t)}}},[n]}return Array.isArray(n)?n:[n]}},267:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeConfig=void 0;const r=n(641);t.NodeConfig=r.DOMNodeConfig},64:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeRef=t.NodeRefType=void 0;const r=n(267),o=n(880),i=n(173),s=n(413),a=n(230),c=n(890);var u,l;!function(e){e[e.NodeRef=0]="NodeRef",e[e.BoundNode=1]="BoundNode",e[e.ElementNode=2]="ElementNode",e[e.ComponentNode=3]="ComponentNode"}(u||(t.NodeRefType=u={})),function(e){function t(e,t,n){switch(n){case u.NodeRef:return{node:null,nodeType:e,nodeNamespace:t,type:u.NodeRef,injector:o.Injector.Current()||new o.Injector,parent:null,childNodes:null,destroyed:!1};case u.BoundNode:return{node:null,nodeDef:null,nodeType:e,nodeNamespace:t,type:u.BoundNode,injector:o.Injector.Current()||new o.Injector,parent:null,childNodes:null,destroyed:!1,lastEvents:null,setProperties:!1,assignProperties:null,assignEvents:null,setAttributes:!1,setEvents:!1,scopes:null};case u.ElementNode:return{node:null,nodeDef:null,nodeType:e,nodeNamespace:t,type:u.ElementNode,injector:o.Injector.Current()||new o.Injector,parent:null,childNodes:null,destroyed:!1,lastEvents:null,setProperties:!1,assignProperties:null,assignEvents:null,setAttributes:!1,setEvents:!1,childrenFunc:null,nodeList:null,setData:!1,scopes:null};case u.ComponentNode:return{node:null,nodeDef:null,nodeType:e,nodeNamespace:t,type:u.ComponentNode,injector:o.Injector.Current()||new o.Injector,parent:null,childNodes:null,destroyed:!1,setProperties:!1,assignProperties:null,assignEvents:null,setAttributes:!1,setEvents:!1,component:null,componentEvents:null,scopes:null}}}function n(e){if(!e.node)switch(e.node="text"===e.nodeType?r.NodeConfig.createTextNode():r.NodeConfig.createNode(e.nodeType,e.nodeNamespace),e.childNodes="text"!==e.nodeType?[]:null,e.type){case u.BoundNode:i.BoundNode.Init(e);break;case u.ElementNode:s.ElementNode.Init(e);break;case u.ComponentNode:a.ComponentNode.Init(e)}}function l(e,t){Array.isArray(e.childNodes)?e.childNodes.push(t):e.childNodes.add(t)}function d(e){if(!e.destroyed){if(e.destroyed=!0,Array.isArray(e.childNodes))for(let t=0;t<e.childNodes.length;t++)d(e.childNodes[t]);else e.childNodes?.forEach(d);switch(e.type){case u.ComponentNode:e.component?.Destroy();case u.ElementNode:e.assignEvents?.(null);case u.BoundNode:for(let t=0;e.scopes&&t<e.scopes.length;t++)c.ObservableScope.Destroy(e.scopes[t])}e.node=null}}e.Wrap=function(e){var n=t(null,null,u.NodeRef);return n.node=e,n.childNodes=new Set,n},e.Create=t,e.Init=n,e.InitAll=function(e,t){for(var r=0;r<t.length;r++)t[r].parent=e,l(e,t[r]),n(t[r])},e.AddChild=function(e,t){t.parent=e,l(e,t),r.NodeConfig.addChild(e.node,t.node)},e.AddChildAfter=function(e,t,n){if(t&&t.parent!==e)throw"currentChild is not valid";n.parent=e,l(e,n),r.NodeConfig.addChildAfter(e.node,t&&t.node,n.node)},e.ReconcileChildren=function(e,t){const n=e.node;if(0===t.size)return void r.NodeConfig.replaceChildren(n,[]);let o,i=t?.head,s=!1,a=!1;for(;i;){for(let e=0;e<i.data.nodes.length;e++){const t=o?r.NodeConfig.getNextSibling(o):r.NodeConfig.getFirstChild(n),c=i.data.nodes[e].node;t!==c?(r.NodeConfig.addChildBefore(n,t,c),!a&&s&&t&&r.NodeConfig.removeChild(n,t),a=s,s=!0):(s=!1,a=!1),o=c}i=i.next}let c=r.NodeConfig.getLastChild(n);for(;o&&o!==c;)r.NodeConfig.removeChild(n,c),c=r.NodeConfig.getLastChild(n)},e.DetachChild=function(e,t){!Array.isArray(e.childNodes)&&e.childNodes.delete(t)&&(r.NodeConfig.removeChild(e.node,t.node),t.parent=null)},e.Destroy=d,e.DestroyAll=function(e){for(let t=0;t<e.length;t++)d(e[t])}}(l||(t.NodeRef=l={}))},377:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiffAsync=void 0;const r=n(285),o=n(521),i=n(547),s=(0,r.DiffTreeScope)();t.DiffAsync=class{workerQueue;constructor(e){this.workerQueue=new o.WorkerQueue(i.DiffWorker.Create()),this.workerQueue.Push({method:"create",arguments:[e.toString()]})}static GetKeyRef(e){return s.GetKeyRef(e)}static ReadKeyRef(e){return s.ReadKeyRef(e)}async DiffPath(e,t){return await this.workerQueue.Push({method:"diffpath",arguments:[e,t]})}async DiffBatch(e){return await this.workerQueue.Push({method:"diffbatch",arguments:[e]})}async UpdatePath(e,t){await this.workerQueue.Push({method:"updatepath",arguments:[e,t]})}async GetPath(e){return await this.workerQueue.Push({method:"getpath",arguments:[e]})}Destroy(){this.workerQueue.Destroy()}}},606:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiffSync=void 0;const r=(0,n(285).DiffTreeScope)();t.DiffSync=class{diffTree;constructor(e){this.diffTree=new r(e)}static GetKeyRef(e){return r.GetKeyRef(e)}static ReadKeyRef(e){return r.ReadKeyRef(e)}DiffPath(e,t){return this.diffTree.DiffPath(e,t)}DiffBatch(e){return this.diffTree.DiffBatch(e)}UpdatePath(e,t){this.diffTree.UpdatePath(e,t)}}},285:(__unused_webpack_module,exports)=>{function DiffTreeScope(worker){const ctx=this;if(ctx&&worker){let diffTree=null;ctx.onmessage=function(event){var data=event.data;switch(data.method){case"create":var keyFunc=data.arguments[0]?eval(data.arguments[0]):void 0;diffTree=new DiffTree(keyFunc),ctx.postMessage(null);break;case"diffpath":var diff=diffTree.DiffPath(data.arguments[0],data.arguments[1]);ctx.postMessage(diff);break;case"diffbatch":var diff=diffTree.DiffBatch(data.arguments[0]);ctx.postMessage(diff);break;case"updatepath":diffTree.UpdatePath(data.arguments[0],data.arguments[1]),ctx.postMessage(null);break;case"getpath":var ret=diffTree.GetPath(data.arguments[0]);ctx.postMessage(ret)}}}const jsonConstructor={}.constructor;function IsValue(e){return!e||!(jsonConstructor===e.constructor||Array.isArray(e))}let Type;function TypeOf(e){return e?jsonConstructor===e.constructor?Type.Object:Array.isArray(e)?Type.Array:Type.Value:Type.Value}function JsonDiffRecursive(e,t,n,r){if(t===n)return!1;const o=TypeOf(t),i=TypeOf(n),s=r.length;let a=!0;if(o===i)switch(o){case Type.Array:a=JsonDiffArrays(e,t,n,r);break;case Type.Object:a=JsonDiffObjects(e,t,n,r)}return!!a&&(r.splice(s),r.push({path:e,value:t}),!0)}function JsonDiffArrays(e,t,n,r){let o=!0;if(t.length!==n.length&&r.push({path:e?`${e}.length`:"length",value:t.length}),t.length>0||n.length>0)for(let i=0;i<t.length;i++)o=JsonDiffRecursive(e?`${e}.${i}`:`${i}`,t[i],n[i],r)&&o;else o=!1;return o}function JsonDiffObjects(e,t,n,r){let o=!0;const i=Object.keys(t),s=Object.keys(n);if(0===i.length&&0===s.length)return!1;if(i.length>=s.length){let a=0,c=0;for(;a<i.length;){const u=e?`${e}.${i[a]}`:i[a];c<s.length&&i[a]===s[c]?(o=JsonDiffRecursive(u,t[i[a]],n[s[c]],r)&&o,c++):void 0!==t[i[a]]&&r.push({path:u,value:t[i[a]]}),a++}c<s.length&&(o=!0)}return o}function BreakUpValue(e,t,n,r,o){const i=r?t[r]:t,s=IsValue(i);if(!o&&s)return new Map([[e,i]]);if(o=o||new Map,s)return o;const a=n?n(i):null,c=a&&DiffTree.GetKeyRef(a);if(a&&a!==e)r&&(t[r]=c),BreakUpValue(a,i,n,null,o);else for(const t in i)BreakUpValue(`${e}.${t}`,i,n,t,o);return r||o.set(e,a===e?i:c||i),o}!function(e){e[e.Value=0]="Value",e[e.Object=1]="Object",e[e.Array=2]="Array"}(Type||(Type={}));class DiffTree{keyFunc;rootStateMap=new Map;constructor(e){this.keyFunc=e}static GetKeyRef(e){return`___DiffTreeKeyRef.${e}`}static ReadKeyRef(e){if(e){var t=e.match(/^___DiffTreeKeyRef\.([^.]+$)/);if(t)return t[1]}}DiffBatch(e){for(var t=[],n=0;n<e.length;n++)this.RunDiff(e[n].path,e[n].value,t);return t}DiffPath(e,t){var n=[];return this.RunDiff(e,t,n),n}UpdatePath(e,t){this.SetPathValue(e,t)}GetPath(e){return this.GetPathValue(e)}RunDiff(e,t,n){var r=this.GetBreakUpMap(e,t),o=n||[];r.forEach(((e,t)=>{var n=t.split(".").reduce(((e,t,n)=>0===n?this.rootStateMap.get(t):e&&e[t]),null);JsonDiffRecursive(t,e,n,o)}));for(var i=0;i<o.length;i++)this.SetPathValue(o[i].path,o[i].value)}GetPathValue(e){for(var t=e.split("."),n=this.rootStateMap.get(t[0]),r=1;r<t.length;r++)n=n&&n[t[r]];return n}SetPathValue(e,t){var n=e.split(".");if(1===n.length)this.rootStateMap.set(n[0],t);else{for(var r=this.rootStateMap.get(n[0]),o=1;o<n.length-1;o++)r=r[n[o]];r[n[n.length-1]]=t}}GetBreakUpMap(e,t){return this.keyFunc?BreakUpValue(e,t,this.keyFunc):new Map([[e,t]])}}return DiffTree}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DiffTreeScope=DiffTreeScope},547:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiffWorker=void 0;const r=n(285);var o;!function(e){var t=null,n=null;"undefined"!=typeof Worker&&(t=Worker,n=URL.createObjectURL(new Blob([`(${r.DiffTreeScope}).call(this, true)`]))),e.Create=function(){if(!t)throw"Worker is not available";return new t(n)}}(o||(t.DiffWorker=o={}))},521:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerQueue=void 0;const r=n(496);t.WorkerQueue=class{callbacks;worker;constructor(e){this.worker=e,this.callbacks=r.List.Create(),this.worker.onerror=e=>{var t=r.List.Pop(this.callbacks);t&&t(null,e)},this.worker.onmessage=e=>{var t=r.List.Pop(this.callbacks);t&&t(e.data)}}Push(e){return new Promise(((t,n)=>{r.List.Add(this.callbacks,(function(e,r){r?n(r):t(e)})),this.worker.postMessage(e)}))}Destroy(){this.worker.terminate()}}},501:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Store=void 0;const r=n(586),o=n(778);t.Store=class{observableTree=new r.ObservableTree;storeWriter=new o.StoreWriter(this.observableTree);rootScope=this.observableTree.Scope("ROOT",(e=>e));get Root(){return this.rootScope}constructor(e){e&&this.Write(e)}Action(e){e(this.observableTree.Get("ROOT"),this.storeWriter)}Write(e){this.Action(((t,n)=>n.Write(t,e)))}Merge(e){this.Action(((t,n)=>n.Merge(t,e)))}Destroy(){this.rootScope.Destroy()}}},161:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreAsync=void 0;const r=n(586),o=n(377),i=n(22),s=n(263);t.StoreAsync=class{idFunc;diffAsync;observableTree;asyncWriter;asyncQueue;constructor(e,t){if(this.idFunc=e,this.diffAsync=new o.DiffAsync(this.idFunc),this.observableTree=new r.ObservableTree(o.DiffAsync.ReadKeyRef),this.asyncWriter=new i.StoreAsyncWriter(this.idFunc,this.diffAsync,this.observableTree),this.asyncQueue=new s.AsyncQueue,t){var n=this.idFunc(t);this.observableTree.Write(n,t),this.Write(t)}}Scope(e,t){return this.observableTree.Scope(e,t)}async Action(e,t){await this.asyncQueue.Next((async()=>{await t(e&&this.observableTree.Get(e),this.asyncWriter)}))}async Write(e){await this.Action(null,(async(t,n)=>{await n.Write(t,e)}))}async Merge(e,t){await this.Action(e,(async(e,n)=>{await n.Merge(e,t)}))}Destroy(){this.asyncQueue.Stop(),this.diffAsync.Destroy()}}},22:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreAsyncWriter=void 0,t.StoreAsyncWriter=class{idFunc;diffAsync;observableTree;constructor(e,t,n){this.idFunc=e,this.diffAsync=t,this.observableTree=n}async Write(e,t){let n;if(e)n=this.observableTree.GetPathOf(e);else if(n=this.idFunc(t),!n)throw new Error("data must have an id");let r=await this.diffAsync.DiffPath(n,t);this.ApplyChanges(r)}async Merge(e,t){const n=this.observableTree.GetPathOf(e),r=Object.keys(t).map((e=>({path:`${n}.${e}`,value:t[e]}))),o=await this.diffAsync.DiffBatch(r);this.ApplyChanges(o)}async Push(e,t){const n=this.observableTree.GetPathOf(e);var r=`${n}.length`,o=await this.diffAsync.GetPath(r),i=await this.diffAsync.DiffPath(`${n}.${o}`,t);this.ApplyChanges(i)}async Splice(e,t,n,...r){var o=this.observableTree.GetPathOf(e),i=await this.diffAsync.GetPath(o);(i=i.slice()).splice(t,n,...r);var s=await this.diffAsync.DiffPath(o,i);this.ApplyChanges(s)}ApplyChanges(e){this.observableTree.WriteAll(e)}}},961:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreSync=void 0;const r=n(606),o=n(586),i=n(921);t.StoreSync=class{diffSync=new r.DiffSync;observableTree=new o.ObservableTree;storeWriter=new i.StoreSyncWriter(this.diffSync,this.observableTree);rootScope=this.observableTree.Scope("ROOT",(e=>e));get Root(){return this.rootScope}constructor(e){e&&this.Write(e)}Action(e){e(this.observableTree.Get("ROOT"),this.storeWriter)}Write(e){this.Action(((t,n)=>n.Write(t,e)))}Merge(e){this.Action(((t,n)=>n.Merge(t,e)))}Destroy(){this.rootScope.Destroy()}}},921:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreSyncWriter=void 0,t.StoreSyncWriter=class{diffSync;observableTree;constructor(e,t){this.diffSync=e,this.observableTree=t}Write(e,t){var n=e&&this.observableTree.GetPathOf(e)||"ROOT",r=this.diffSync.DiffPath(n,t);this.ApplyChanges(r)}Merge(e,t){var n=this.observableTree.GetPathOf(e),r=Object.keys(t).map((e=>({path:`${n}.${e}`,value:t[e]}))),o=this.diffSync.DiffBatch(r);this.ApplyChanges(o)}Push(e,t){var n=this.observableTree.GetPathOf(e),r=e.length;this.diffSync.UpdatePath(`${n}.${r}`,t),this.observableTree.Write(`${n}.${r}`,t)}Splice(e,t,n,...r){var o=this.observableTree.GetPathOf(e);const i=this.observableTree.Get(o).toJSON().slice();i.splice(t,n,...r),this.diffSync.UpdatePath(o,i),this.observableTree.Write(o,i)}ApplyChanges(e){this.observableTree.WriteAll(e)}}},778:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StoreWriter=void 0,t.StoreWriter=class{observableTree;constructor(e){this.observableTree=e}Write(e,t){const n=e&&this.observableTree.GetPathOf(e)||"ROOT";this.observableTree.Write(n,t)}Merge(e,t){const n=this.observableTree.GetPathOf(e);for(const e in t)this.observableTree.Write(`${n}.${e}`,t[e])}Push(e,t){const n=this.observableTree.GetPathOf(e);this.observableTree.Write(`${n}.${e.length}`,t)}Splice(e,t,n,...r){const o=e.toJSON().slice();o.splice(t,n,...r);const i=this.observableTree.GetPathOf(e);this.observableTree.Write(i,o)}}},645:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableComputed=void 0;const r=n(874),o=n(496),i=n(318),s=n(948),a=new Set,c=o.List.Create();function u({node:e,scope:t}){const n=s.ObservableScope.Value(t);e.data=(0,r.JsonDeepClone)(n)}let l=!1;var d;!function(e){e.Create=function(e){return function(e){const t=s.ObservableScope.Create(e),n=i.ObservableNode.Create({data:null});return s.ObservableScope.Watch(t,(function(e){!function(e,t){a.has(e)||(a.add(e),o.List.Add(c,{node:e,scope:t}),l||(l=!0,queueMicrotask((function(){l=!1,a.clear(),o.List.ForEach(c,u),o.List.Clear(c)}))))}(n,e)})),n.data=s.ObservableScope.Value(t),s.ObservableScope.Create((function(){return n.data}),[t])}(e)}}(d||(t.ObservableComputed=d={}))},318:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableNode=void 0;const r=n(874),o=n(948),i=new WeakMap,s=new WeakMap;function a(e,t){return{...Object.getOwnPropertyDescriptor(e,t),configurable:!0}}function c(e,t){return{...Object.getOwnPropertyDescriptor(e,t),configurable:!0}}function u(e,t){return Object.hasOwn(e,t)}function l(e,t){return Object.hasOwn(e,t)}function d(e){return Object.keys(e)}function f(e){return Object.keys(e)}function h(e){if(!e)return e;if(e.toJSON&&"function"==typeof e.toJSON)return e.toJSON();switch((0,r.JsonType)(e)){case"object":{const t=Object.keys(e);for(let n=0;n<t.length;n++)e[t[n]]=h(e[t[n]])}case"array":for(let t=0;t<e.length;t++)e[t]=h(e[t])}return e}function p(e,t,n){n=h(n),e[t]=n;const r=s.get(e);return o.ObservableScope.Update(r),!0}function b(e,t){const n=s.get(e);if(e=o.ObservableScope.Value(n),"toJSON"===t)return function(){return e};{const r=e[t];return"symbol"==typeof t?r:"function"==typeof r?function(...r){const s=e.slice();for(let e=0;e<s.length;e++)s[e]=i.get(s[e])??m(s[e]);let a=s[t](...r);switch(t){case"push":case"unshift":case"splice":case"pop":case"shift":case"sort":case"reverse":e.length=s.length;for(let t=0;t<s.length;t++)e[t]=h(s[t]);o.ObservableScope.Update(n)}return a}:m(r)}}let v=!1;function y(e,t,n){const a=s.get(e);if(n=h(n),v)e[t]=n,o.ObservableScope.Update(a);else{v=!0;const o=(0,r.JsonDiff)(n,e[t]);for(let n=0;n<o.length;n++)if(0===o[n].path.length)i.get(e)[t]=o[n].value;else{const r=o[n].path;let s=e[t],a=0;for(;a<r.length-1;a++)s=s[r[a]];(i.get(s)??s)[r[a]]=o[n].value}v=!1}return!0}function g(e,t){const n=s.get(e);if(e=o.ObservableScope.Value(n),"toJSON"===t)return function(){return e};{const n=e[t];return"symbol"==typeof t?n:m(n)}}function m(e){switch((0,r.JsonType)(e)){case"object":{const t=i.get(e)??function(e){const t=o.ObservableScope.Create((()=>e)),n=new Proxy(e,{get:g,set:y,has:u,ownKeys:d,getOwnPropertyDescriptor:a});return s.set(e,t),i.set(e,n),n}(e);return t}case"array":{const t=i.get(e)??function(e){const t=o.ObservableScope.Create((()=>e)),n=new Proxy(e,{get:b,set:p,has:l,ownKeys:f,getOwnPropertyDescriptor:c});return s.set(e,t),i.set(e,n),n}(e);return o.ObservableScope.Touch(s.get(e)),t}default:return e}}var O;!function(e){e.Create=function(e){return m(e=h(e))}}(O||(t.ObservableNode=O={}))},948:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableScope=t.ObservableScopeWrapper=t.ObservableScopeValue=void 0;const r=n(116);class o{scope;get Value(){return s.Value(this.scope)}constructor(e){this.scope=e}}t.ObservableScopeValue=o;class i extends o{scopeEmitter;constructor(e){super(e),e.emitter&&(this.scopeEmitter=r.Emitter.Create(),r.Emitter.On(e.emitter,(()=>r.Emitter.Emit(this.scopeEmitter,this))))}Scope(e){return new s((()=>e(this.Value)))}Watch(e){this.scopeEmitter&&(r.Emitter.On(this.scopeEmitter,e),e(this))}Unwatch(e){this.scopeEmitter&&r.Emitter.Remove(this.scopeEmitter,e)}Destroy(){l(this.scope),this.scopeEmitter&&this.scopeEmitter.clear()}}t.ObservableScopeWrapper=i;class s extends i{constructor(e){super(s.Create(e))}}t.ObservableScope=s;let a=null,c=!1;function u(e){return!e||e.dirty||e.destroyed?e.destroyed:(e.dirty=!!e.getFunction,r.Emitter.Emit(e.emitter,e),!1)}function l(e){if(e){if(void 0!==e.dependencies)for(let t=0;t<e.dependencies.length;t++)l(e.dependencies[t]);e.emitters&&e.emitters.clear(),e.emitter&&e.emitter.clear(),e.getFunction=null,e.setCallback=null,e.destroyed=!0}}!function(e){function t(e){c&&e&&(a??=new Set,a.add(e))}e.Create=function(e,t){const n="function"==typeof e,o={getFunction:n?e:null,value:n?null:e,async:!!n&&"AsyncFunction"===e[Symbol.toStringTag],dirty:n,emitter:n?r.Emitter.Create():null,emitters:null,destroyed:!1,setCallback:n?function(){return u(o)}:null,dependencies:t};return o},e.Register=t,e.Value=function(e){if(e)return t(e.emitter),function(e){if(!e.dirty)return;e.dirty=!1;let t=null;const n=e.getFunction&&function(n){const r=a;a=null;const o=c;c=!0,t=e.getFunction();const i=a;return a=r,c=o,i}();e.async?Promise.resolve(t).then((t=>{e.value=t,r.Emitter.Emit(e.emitter,e)})):e.value=t,function(e,t){t&&t.forEach((t=>{e.emitters?.delete(t)||r.Emitter.On(t,e.setCallback)})),e.emitters&&e.emitters.forEach((t=>r.Emitter.Remove(t,e.setCallback))),e.emitters=t}(e,n)}(e),e.value},e.Watching=function(){return c},e.Touch=function(e){e&&e.emitter&&t(e.emitter)},e.Watch=function(e,t){e&&e.emitter&&r.Emitter.On(e.emitter,t)},e.Unwatch=function(e,t){e&&e.emitter&&r.Emitter.Remove(e.emitter,t)},e.Update=function(e){u(e)},e.Destroy=function(e){l(e)}}(s||(t.ObservableScope=s={}))},586:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableTree=void 0;const r=n(948);var o;!function(e){e[e.Value=0]="Value",e[e.Object=1]="Object",e[e.Array=2]="Array"}(o||(o={}));const i={}.constructor;function s(e){return e?i===e.constructor?o.Object:Array.isArray(e)?o.Array:o.Value:o.Value}class a{valuePathResolver;undefinedScope=r.ObservableScope.Create((function(){}));scopeCache=new WeakMap;leafScopeCache=new WeakMap;proxyCache=new WeakMap;pathCache=new WeakMap;rootStateMap=new Map;constructor(e){this.valuePathResolver=e}static UnwrapProxyValues(e){if(e?.toJSON&&"function"==typeof e.toJSON)return e.toJSON();const t=s(e);if(t===o.Value)return e;if(t===o.Array){const t=e;for(let e=0;e<t.length;e++)t[e]=a.UnwrapProxyValues(t[e])}else{const t=Object.keys(e);for(let n=0;n<t.length;n++)e[t[n]]=a.UnwrapProxyValues(e[t[n]])}return e}Get(e){return e.split(".").reduce(((e,t,n)=>{if(0===n){let e=this.rootStateMap.get(t);const n=this.GetParentScope(e);return r.ObservableScope.Value(n)}return e&&e[t]}),null)}GetPathOf(e){return e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),this.pathCache.get(e)}Scope(e,t){return new r.ObservableScope((()=>{const n=this.Get(e);return t&&t(n)||n}))}Write(e,t){const n=this.WritePath(e,t);r.ObservableScope.Update(n)}WriteAll(e){const t=new Set;for(var n=0;n<e.length;n++){const r=this.WritePath(e[n].path,e[n].value);t.add(r)}t.forEach((e=>r.ObservableScope.Update(e)))}GetParentScope(e){if(void 0===e)return this.undefinedScope;let t=this.scopeCache.get(e);return t||(t=r.ObservableScope.Create((()=>this.GetValueProxy(e))),this.scopeCache.set(e,t)),t}GetPropertyScope(e,t){const n=e[t];if(s(n)===o.Value){let n=this.leafScopeCache.get(e)||{};return n[t]=n[t]||r.ObservableScope.Create((()=>{const n=this.scopeCache.get(e),o=r.ObservableScope.Value(n).toJSON()[t];let i;return this.valuePathResolver&&"string"==typeof o&&(i=this.valuePathResolver(o))?this.Get(i):o})),this.leafScopeCache.set(e,n),n[t]}{let o=this.scopeCache.get(n);return o||(o=r.ObservableScope.Create((()=>{const n=this.scopeCache.get(e),o=r.ObservableScope.Value(n).toJSON()[t];return this.GetValueProxy(o)})),this.scopeCache.set(n,o)),o}}GetValueProxy(e){let t=this.proxyCache.get(e);return t||(t=this.CreateProxy(e),this.proxyCache.set(e,t)),t}ObjectProxyGetter=(e,t)=>"toJSON"===t?function(){return e}:"symbol"==typeof t?e[t]:r.ObservableScope.Value(this.GetPropertyScope(e,t));CreateObjectProxy(e){return new Proxy(e,{get:this.ObjectProxyGetter})}ArrayProxyGetter=(e,t)=>{if("toJSON"===t)return function(){return e};if("symbol"==typeof t)return e[t];if(isNaN(parseInt(t))){const n=e[t];if("function"==typeof n){const t=e.map(((t,n)=>r.ObservableScope.Value(this.GetPropertyScope(e,n.toString()))));return n.bind(t)}return n}return r.ObservableScope.Value(this.GetPropertyScope(e,t))};CreateArrayProxy(e){return new Proxy(e,{get:this.ArrayProxyGetter})}CreateProxy(e){switch(s(e)){case o.Object:return this.CreateObjectProxy(e);case o.Array:return this.CreateArrayProxy(e);default:return e}}WritePath(e,t){this.UpdatePathCache(e,t);const n=e.split(".");if(1===n.length){const e=this.rootStateMap.get(n[0]);return this.rootStateMap.set(n[0],t),void 0===e?this.undefinedScope:this.scopeCache.get(e)}let r,i=0;for(;i<n.length-1&&(0===i||r);i++)r=0===i?this.rootStateMap.get(n[i]):r&&r[n[i]];if(!r)throw new Error("Unable to write path: "+e+". Falsey value found at: "+n.slice(0,i).join("."));const a=n[i],c=r[a],u=s(c);if(r[a]=t,u!==o.Value||Array.isArray(r))return this.scopeCache.get(r)||this.scopeCache.get(c);const l=this.leafScopeCache.get(r);return l&&l[a]||this.scopeCache.get(r)}UpdatePathCache(e,t){if(s(t)===o.Value)return;this.pathCache.set(t,e),this.proxyCache.delete(t),this.scopeCache.delete(t),this.leafScopeCache.delete(t);const n=Object.keys(t);for(let r=0;r<n.length;r++)this.UpdatePathCache(`${e}.${n[r]}`,t[n[r]]);return t}}t.ObservableTree=a},890:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableComputed=t.ObservableNode=t.ObservableScope=t.StoreAsync=t.StoreSync=t.Store=void 0;var r=n(501);Object.defineProperty(t,"Store",{enumerable:!0,get:function(){return r.Store}});var o=n(961);Object.defineProperty(t,"StoreSync",{enumerable:!0,get:function(){return o.StoreSync}});var i=n(161);Object.defineProperty(t,"StoreAsync",{enumerable:!0,get:function(){return i.StoreAsync}});var s=n(948);Object.defineProperty(t,"ObservableScope",{enumerable:!0,get:function(){return s.ObservableScope}});var a=n(318);Object.defineProperty(t,"ObservableNode",{enumerable:!0,get:function(){return a.ObservableNode}});var c=n(645);Object.defineProperty(t,"ObservableComputed",{enumerable:!0,get:function(){return c.ObservableComputed}})},20:(e,t)=>{var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.Animation=t.AnimationType=void 0,function(e){e.EaseIn=function*(e){for(var t=1/e,n=t,r=0;r<e;r++,n+=t)yield(1-n)*(1-n)*(1-n)*0+3*(1-n)*(1-n)*n*1+3*(1-n)*n*n*1+n*n*n*1},e.Linear=function*(e){for(var t=1/e,n=t,r=0;r<e;r++,n+=t)yield n}}(n||(n={})),function(e){e[e.Linear=0]="Linear",e[e.EaseIn=1]="EaseIn"}(r||(t.AnimationType=r={})),t.Animation=class{type;frameCount;frameTimings;update;animationTimeouts;running;start;end;enabled;get Running(){return this.running}get Start(){return this.start}get End(){return this.end}get Enabled(){return this.enabled}constructor(e,t,n){this.running=!1,this.start=null,this.end=null,this.enabled=!0,this.type=e,this.frameCount=Math.ceil(t/1e3*60),this.frameTimings=[];for(var r=t/this.frameCount,o=0;o<this.frameCount;o++)this.frameTimings[o]=(o+1)*r;this.update=n,this.animationTimeouts=[]}Animate(e,t){if(this.enabled){var o=t-e;if(0!==o)return this.Cancel(),this.running=!0,this.start=e,this.end=t,new Promise((t=>{var i=n[r[this.type]],s=0;for(var a of i(this.frameCount)){var c=a*o+e;this.SetTimeout(s,c,s===this.frameCount-1?t:null),s++}})).then((()=>{this.running=!1,this.start=null,this.end=null}))}}Disable(){this.Cancel(),this.enabled=!1}Enable(){this.enabled=!0}Cancel(){for(var e=0;e<this.animationTimeouts.length;e++)clearTimeout(this.animationTimeouts[e]);this.running=!1,this.start=null,this.end=null}Destroy(){this.Cancel()}SetTimeout(e,t,n){this.animationTimeouts[e]=setTimeout((()=>{this.update(t),n&&n()}),this.frameTimings[e])}}},263:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncQueue=void 0;const r=n(496);t.AsyncQueue=class{running=!1;queue=r.List.Create();Next(e){const t=new Promise(((t,n)=>{r.List.Add(this.queue,(async function(){try{const n=await e();t(n)}catch(e){n(e)}}))}));return this.Start(),t}Stop(){r.List.Clear(this.queue)}Start(){this.running||(this.running=!0,this.ExecuteQueue())}async ExecuteQueue(){const e=r.List.Pop(this.queue);null!==e?(await e(),this.ExecuteQueue()):this.running=!1}}},334:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.State=function(){return a},t.StateSync=function(){return c},t.StateAsync=function(){return u},t.Scope=function(){return l},t.DestroyScope=function(){return d},t.Computed=function(){return f},t.ComputedAsync=function(e){return h.bind(null,e)},t.Inject=function(e){return p.bind(null,e)},t.Destroy=b,t.PreReqTemplate=y,t.PreReq=m;const r=n(890),o=n(948),i=n(586),s=n(318);function a(e,t){const n=`StoreDecorator_${t}`;return{configurable:!1,enumerable:!0,get:function(){return this.DecoratorMap.get(n)},set:function(e){const t=this.DecoratorMap,r=t.get(n);if(r){const t=Object.keys(e);for(let n=0;n<t.length;n++)r[t[n]]=e[t[n]]}else t.set(n,s.ObservableNode.Create(e))}}}function c(e,t){const n=`StoreSyncDecorator_${t}`;return{configurable:!1,enumerable:!0,get:function(){return this.DecoratorMap.get(n)},set:function(e){const t=this.DecoratorMap,r=t.get(n);if(r){const t=Object.keys(e);for(let n=0;n<t.length;n++)r[t[n]]=e[t[n]]}else t.set(n,s.ObservableNode.Create(e))}}}function u(e,t){const n=`StoreAsyncDecorator_${t}`,s=`StoreAsyncDecorator_Scope_${t}`;return v(e,n),v(e,s),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap.get(s);const t=e&&e.Value;return o.ObservableScope.Watching()?t:i.ObservableTree.UnwrapProxyValues(t)},set:function(e){var t=this.DecoratorMap,o=t.get(n);o?o.Action("ROOT",(async(t,n)=>await n.Merge(t.data,e))):(o=new r.StoreAsync((e=>e.___id),{___id:"ROOT",data:e}),t.set(n,o),t.set(s,o.Scope("ROOT",(e=>e.data))))}}}function l(e,t,n){if(!n||!n.get)throw"Scope decorator requires a getter";if(n&&n.set)throw"Scope decorator does not support setters";const r=`ScopeDecorator_${t}`;return v(e,r),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap,t=e.get(r);if(!t){const i=n.get.bind(this);t=new o.ObservableScope(i),e.set(r,t)}return t.Value}}}function d(e,t,n){if(!n||!n.get)throw"Destroy Scope decorator requires a getter";if(n&&n.set)throw"Destroy Scope decorator does not support setters";const r=`ScopeDecorator_${t}`;v(e,r);const i=`ScopeDecorator_${t}_Value`;return v(e,i),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap,t=e.get(r);if(!t){const s=n.get.bind(this);t=new o.ObservableScope(s),e.set(r,t),t.Watch((t=>{var n=e.get(i);n&&n.Destroy(),e.set(i,t.Value)}))}return t.Value}}}function f(e,t,n){if(!n||!n.get)throw"Computed decorator requires a getter";if(n&&n.set)throw"Computed decorator does not support setters";const i=`ComputedDecorator_Scope_${t}`,s=`ComputedDecorator_Store_${t}`;return v(e,i),v(e,s),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap,t=e.get(s);if(!t){const a=n.get.bind(this),c=new o.ObservableScope(a);t=new r.StoreSync(c.Value),c.Watch((e=>{this.Destroyed||t.Write(e.Value)})),e.set(i,c),e.set(s,t)}return t.Root.Value}}}function h(e,t,n,i){if(!i||!i.get)throw"ComputedAsync decorator requires a getter";if(i&&i.set)throw"ComputedAsync decorator does not support setters";const s=`ComputedDecorator_Scope_${n}`,a=`ComputedDecorator_Store_${n}`,c=`ComputedDecorator_StoreScope_${n}`;return v(t,s),v(t,a),v(t,c),{configurable:!1,enumerable:!0,get:function(){var e=this.DecoratorMap,t=e.get(c);if(!t){const n=i.get.bind(this),u=new o.ObservableScope((()=>{var e=n();return e&&"function"==typeof e.toJSON&&(e=e.toJSON()),e})),l=new r.StoreAsync((e=>e._id),{_id:"ROOT",data:u.Value});u.Watch((e=>{this.Destroyed||l.Write({_id:"ROOT",data:e.Value})})),t=l.Scope("ROOT",(e=>e.data)),e.set(c,t),e.set(s,u),e.set(a,l)}return t.Value}}}function p(e,t,n,r){return{configurable:!1,enumerable:!0,get:function(){return this.Injector.Get(e)},set:function(t){this.Injector.Set(e,t)}}}function b(){return v}function v(e,t){var n=e;n.DestroyDecorator_Destroys=n.DestroyDecorator_Destroys||[],n.DestroyDecorator_Destroys.push(t)}function y(e){return g.bind(null,e)}function g(e,t){t.prototype.PreReqTemplateDecorator_Template=e}function m(){return O}function O(e,t){var n=e;n.PreReqDecorator_PreReqs=n.PreReqDecorator_PreReqs||[],n.PreReqDecorator_PreReqs.push(t)}!function(e){e.All=function(e){(function(e){return e&&e.DestroyDecorator_Destroys||[]})(e).map((t=>e[t]||e.DecoratorMap.get(t))).filter((e=>!!e)).forEach((e=>e.Destroy()))}}(b||(t.Destroy=b={})),function(e){e.Get=function(e){var t=e&&e.PreReqTemplateDecorator_Template,n=t?t():[];return Array.isArray(n)||(n=[n]),n}}(y||(t.PreReqTemplate=y={})),function(e){function t(e){return e&&e.PreReqDecorator_PreReqs||[]}e.All=function(e){var n=t(e).map((t=>e[t]&&e[t].Init||Promise.resolve()));return Promise.all(n)},e.Has=function(e){return t(e).length>0}}(m||(t.PreReq=m={}))},116:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=void 0,function(e){function t(e,t){e.delete(t)}e.Create=function(){return new Set},e.On=function(e,t){e.add(t)},e.Emit=function(e,...n){let r;e.forEach((function(e){!0===e(...n)&&(r??=[],r.push(e))}));for(let n=0;void 0!==r&&n<r.length;n++)t(e,r[n])},e.Remove=t}(n||(t.Emitter=n={}))},205:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(334),t),o(n(20),t)},880:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Injector=void 0;class n{parent;typeMap;constructor(){this.parent=n.Current(),this.typeMap=new Map}Get(e){if(0===this.typeMap.size)return this.parent&&this.parent.Get(e);var t=this.typeMap.get(e);return t||(t=this.parent&&this.parent.Get(e)),t}Set(e,t){this.typeMap.set(e,t)}}t.Injector=n,function(e){var t=null;function n(){return t}e.Current=n,e.Scope=function(e,r,...o){var i=n();t=e;const s=r(...o);return t=i,s}}(n||(t.Injector=n={}))},874:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JsonType=r,t.JsonDeepClone=function e(t){switch(r(t)){case"array":return t.map(e);case"object":{const n={},r=Object.keys(t);for(let o=0;o<r.length;o++)n[r[o]]=e(t[r[o]]);return n}default:return t}},t.JsonDiff=function(e,t){const n=[];return o([],e,t,n),n};const n=Object.getPrototypeOf({});function r(e){return null==e?"value":Array.isArray(e)?"array":n===Object.getPrototypeOf(e)?"object":"value"}function o(e,t,n,i){if(t===n)return!1;const s=r(t),a=r(n),c=i.length;let u=!0;if(s===a)switch(s){case"array":u=function(e,t,n,r){let i=!0;if(t.length!==n.length&&r.push({path:e.concat("length"),value:t.length}),t.length>0||n.length>0)for(let s=0;s<t.length;s++){const a=e.concat(s),c=n[s];i=o(a,t[s],c,r)&&i}else i=!1;return i}(e,t,n,i);break;case"object":u=function(e,t,n,r){const i=Object.keys(t).sort(),s=Object.keys(n).sort();if(0===i.length&&0===s.length)return!1;if(i.length<s.length)return!0;let a=0,c=0;for(;a<i.length;){const u=e.concat(i[a]);c<s.length&&i[a]===s[c]?(o(u,t[i[a]],n[s[c]],r),c++):void 0!==t[i[a]]&&r.push({path:u,value:t[i[a]]}),a++}return c<s.length}(e,t,n,i)}return!!u&&(i.splice(c),i.push({path:e,value:t}),!0)}},496:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.List=void 0,function(e){function t(e,t){return 0===e.size?(e.head=t,e.tail=t,e.size=1):(t.previous=e.tail,e.tail.next=t,e.tail=t,e.size++),t}e.Create=function(){return{head:null,tail:null,size:0}},e.Clear=function(e){e.head=null,e.tail=null,e.size=0},e.Push=function(e,t){const n={previous:null,next:null,data:t};return 0===e.size?(e.head=n,e.tail=n,e.size=1):(n.next=e.head,e.head.previous=n,e.head=n,e.size++),n},e.Pop=function(e){if(0===e.size)return null;const t=e.head;return e.head=t.next,e.head&&(e.head.previous=null),e.size--,0===e.size&&(e.tail=null),t.data},e.Add=function(e,n){return t(e,{previous:null,next:null,data:n})},e.AddNode=t,e.AddBefore=function(t,n,r){if(!n)return e.Add(t,r);const o={previous:null,next:null,data:r},i=n.previous;return o.next=n,n.previous=o,t.head===n&&(t.head=o),i&&(i.next=o,o.previous=i),t.size++,o},e.AddAfter=function(t,n,r){if(!n)return e.Push(t,r);const o={previous:null,next:null,data:r},i=n.next;return n.next=o,o.previous=n,t.tail===n&&(t.tail=o),i&&(i.previous=o,o.next=i),t.size++,o},e.Remove=function(e){if(0===e.size)return null;var t=e.tail;return e.tail=t.previous,e.tail&&(e.tail.next=null),e.size--,0===e.size&&(e.head=null),t.data},e.RemoveNode=function(e,t){if(e.head===t)e.head=t.next;else if(e.tail===t)e.tail=t.previous;else{const e=t.previous,n=t.next;e.next=n,n.previous=e}t.next=t.previous=null,e.size--,e.size>0&&(e.head.previous=e.tail.next=null)},e.ForEach=function(e,t){let n=e.head;for(;n;)t(n.data),n=n.next},e.ToNodeMap=function(e,t){const n=new Map;let r=e.head;for(;r;){const e=t(r.data),o=n.get(e)||[r];o[0]!==r?o.push(r):n.set(e,o),r=r.next}return n}}(n||(t.List=n={}))},224:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Schedule=v,t.After=function(e){b(e,!1,!1)},t.Callback=function(e){return function(t,n,r,o){v((function(){e(t,n,r,o)}))}},t.Synch=g,t.Thread=m,t.ThreadAsync=function(e){return new Promise((t=>m((function(n){e(n),m(t)}))))};const r=n(496),o=16,i=r.List.Create();let s=null,a=!1;const c=setTimeout;function u(){return this.end-Date.now()}function l(){return{end:Date.now()+o,timeRemaining:u}}function d(e=l()){let t;for(;e.timeRemaining()>0&&(t=r.List.Pop(i));)p(t,e);i.size>0?c(d):a=!1}function f(e){r.List.Add(i,e),a||(a=!0,c(d))}function h(e,t){const n=e.workEndNode;e.workEndNode=e.workList.head,t(!0),e.workEndNode=n}function p(e,t=l()){const n=s;s=e;const o=e.async;let i;for(;o===e.async&&t.timeRemaining()>0&&(i=r.List.Pop(e.workList));)h(e,i);e.workList.size>0&&f(e),s=n}function b(e,t,n){s=s||{async:!1,workEndNode:null,workList:r.List.Create()},s.async=s.async||n,t?r.List.AddBefore(s.workList,s.workEndNode,e):s.workEndNode?r.List.AddAfter(s.workList,s.workEndNode,e):s.workEndNode=r.List.Add(s.workList,e)}function v(e){b(e,!0,!0)}var y=!1;function g(e){s||y?e(!1):(y=!0,function(e){e(!1),s&&(s.async?f(s):p(s)),s=null}(e),y=!1)}function m(e){s?b(e,!0,!1):g(e)}},156:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var r=n(342);Object.defineProperty(t,"Component",{enumerable:!0,get:function(){return r.Component}})},576:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableComputed=t.ObservableNode=t.StoreAsync=t.Store=t.ObservableScope=void 0,o(n(156),t),o(n(205),t);var i=n(890);Object.defineProperty(t,"ObservableScope",{enumerable:!0,get:function(){return i.ObservableScope}}),Object.defineProperty(t,"Store",{enumerable:!0,get:function(){return i.Store}}),Object.defineProperty(t,"StoreAsync",{enumerable:!0,get:function(){return i.StoreAsync}}),Object.defineProperty(t,"ObservableNode",{enumerable:!0,get:function(){return i.ObservableNode}}),Object.defineProperty(t,"ObservableComputed",{enumerable:!0,get:function(){return i.ObservableComputed}}),o(n(147),t)}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}var __webpack_exports__={};(()=>{const e=__webpack_require__(576);for(var t in e)window[t]=e[t]})()})();
|
|
2
2
|
//# sourceMappingURL=jTemplates.js.map
|