j-templates 5.0.50 → 5.0.52

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.
Files changed (45) hide show
  1. package/DOM/createEventAssignment.d.ts +3 -0
  2. package/DOM/createEventAssignment.js +29 -0
  3. package/DOM/createPropertyAssignment.d.ts +4 -0
  4. package/DOM/createPropertyAssignment.js +74 -0
  5. package/DOM/domNodeConfig.d.ts +1 -1
  6. package/DOM/domNodeConfig.js +27 -12
  7. package/DOM/elements.d.ts +1 -0
  8. package/DOM/elements.js +27 -24
  9. package/DOM/index.d.ts +2 -1
  10. package/DOM/index.js +2 -1
  11. package/DOM/svgElements.js +3 -4
  12. package/Node/boundNode.js +16 -34
  13. package/Node/boundNode.types.d.ts +10 -4
  14. package/Node/component.js +1 -0
  15. package/Node/componentNode.js +0 -1
  16. package/Node/elementNode.js +12 -13
  17. package/Node/nodeConfig.d.ts +10 -1
  18. package/Node/nodeRef.d.ts +1 -1
  19. package/Node/nodeRef.js +58 -26
  20. package/Node/nodeRef.types.d.ts +2 -4
  21. package/Store/Diff/diffTree.js +1 -2
  22. package/Store/Tree/observableComputed.d.ts +4 -0
  23. package/Store/Tree/observableComputed.js +45 -0
  24. package/Store/Tree/observableNode.d.ts +3 -0
  25. package/Store/Tree/observableNode.js +195 -0
  26. package/Store/Tree/observableScope.d.ts +7 -12
  27. package/Store/Tree/observableScope.js +38 -34
  28. package/Store/index.d.ts +2 -0
  29. package/Store/index.js +5 -1
  30. package/Utils/decorators.d.ts +3 -1
  31. package/Utils/decorators.js +36 -39
  32. package/Utils/emitter.d.ts +2 -6
  33. package/Utils/emitter.js +8 -1
  34. package/Utils/json.d.ts +7 -0
  35. package/Utils/json.js +109 -0
  36. package/Utils/list.js +7 -7
  37. package/Utils/thread.d.ts +9 -15
  38. package/Utils/thread.js +36 -29
  39. package/jTemplates.js +1 -3176
  40. package/jTemplates.js.map +1 -1
  41. package/package.json +1 -1
  42. package/web.export.d.ts +1 -1
  43. package/web.export.js +3 -1
  44. package/DOM/utils.d.ts +0 -1
  45. package/DOM/utils.js +0 -47
package/jTemplates.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"jTemplates.js","mappings":";;;;;;;;;;AAAa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB,iBAAiB,mBAAO,CAAC,qCAAU;AACnC,eAAe,mBAAO,CAAC,0CAAe;AACtC,gBAAgB,mBAAO,CAAC,mCAAS;AACjC,iBAAiB,mBAAO,CAAC,8CAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;;;;;;;;;;;AC1Fa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,cAAc,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,cAAc,GAAG,aAAa,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW;AACrU,sBAAsB,mBAAO,CAAC,sDAAqB;AACnD;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;;;;;;;;;;;AC/FG;AACb;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa,mBAAO,CAAC,yCAAY;AACjC,aAAa,mBAAO,CAAC,+CAAe;AACpC,aAAa,mBAAO,CAAC,mCAAS;;;;;;;;;;;AClBjB;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc,GAAG,SAAS,GAAG,WAAW;AACxC,sBAAsB,mBAAO,CAAC,sDAAqB;AACnD;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,cAAc;;;;;;;;;;;AChBD;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;;;;;;;;;;AC9CR;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,YAAY;AACZ,YAAY,kDAAkD,oIAAsB;;;;;;;;;;;ACHvE;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,qBAAqB,mBAAO,CAAC,8CAAc;AAC3C,0BAA0B,mBAAO,CAAC,0EAA+B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,0CAA0C;AACxH;AACA;AACA;AACA;AACA;AACA,8EAA8E,0CAA0C;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA,aAAa;AACb,8EAA8E,sCAAsC;AACpH;AACA;AACA;AACA;AACA,CAAC,gBAAgB,iBAAiB,iBAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AClGa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,kBAAkB,mBAAO,CAAC,wCAAW;AACrC,wBAAwB,mBAAO,CAAC,oDAAiB;AACjD,qBAAqB,mBAAO,CAAC,sDAAqB;AAClD,0BAA0B,mBAAO,CAAC,0EAA+B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,KAAK;AACrD;AACA;AACA;AACA,uDAAuD,cAAc;AACrE,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gBAAgB,iBAAiB,iBAAiB;;;;;;;;;;;AC/EtC;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB,oBAAoB,mBAAO,CAAC,4CAAa;AACzC,kBAAkB,mBAAO,CAAC,wCAAW;AACrC,qBAAqB,mBAAO,CAAC,8CAAc;AAC3C,oBAAoB,mBAAO,CAAC,4CAAa;AACzC,mBAAmB,mBAAO,CAAC,kDAAmB;AAC9C,qBAAqB,mBAAO,CAAC,sDAAqB;AAClD,iBAAiB,mBAAO,CAAC,8CAAiB;AAC1C,eAAe,mBAAO,CAAC,0CAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oBAAoB,qBAAqB,qBAAqB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA,oCAAoC,qBAAqB;AACzD;AACA;AACA;AACA;AACA,wCAAwC,qBAAqB;AAC7D;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb,KAAK;AACL;;;;;;;;;;;ACvHa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB,0BAA0B,mBAAO,CAAC,0EAA+B;AACjE,mBAAmB,mBAAO,CAAC,kDAAmB;AAC9C,eAAe,mBAAO,CAAC,0CAAe;AACtC,iBAAiB,mBAAO,CAAC,8CAAiB;AAC1C,oBAAoB,mBAAO,CAAC,4CAAa;AACzC,qBAAqB,mBAAO,CAAC,8CAAc;AAC3C,kBAAkB,mBAAO,CAAC,wCAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kBAAkB,mBAAmB,mBAAmB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iCAAiC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC3Ka;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB;AAClB,wBAAwB,mBAAO,CAAC,wDAAsB;AACtD,kBAAkB;;;;;;;;;;;ACJL;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe,GAAG,mBAAmB;AACrC,qBAAqB,mBAAO,CAAC,8CAAc;AAC3C,mBAAmB,mBAAO,CAAC,kDAAmB;AAC9C,oBAAoB,mBAAO,CAAC,4CAAa;AACzC,sBAAsB,mBAAO,CAAC,gDAAe;AAC7C,wBAAwB,mBAAO,CAAC,oDAAiB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kBAAkB,mBAAmB,mBAAmB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mCAAmC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA,CAAC,cAAc,eAAe,eAAe;;;;;;;;;;;ACzLhC;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,mBAAmB,mBAAO,CAAC,gDAAY;AACvC,sBAAsB,mBAAO,CAAC,sDAAe;AAC7C,qBAAqB,mBAAO,CAAC,oDAAc;AAC3C;AACA;AACA;AACA;AACA;AACA,gCAAgC,mDAAmD;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,8CAA8C;AAC3F;AACA;AACA,6CAA6C,wCAAwC;AACrF;AACA;AACA,sCAAsC,gDAAgD;AACtF;AACA;AACA,6CAA6C,sCAAsC;AACnF;AACA;AACA;AACA;AACA;AACA,iBAAiB;;;;;;;;;;;ACnCJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,gBAAgB;AAChB,mBAAmB,mBAAO,CAAC,gDAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;;;;;;;;;;AC1BH;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,oBAAoB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,KAAK;AACrC;AACA,aAAa;AACb;AACA,4BAA4B,qBAAqB;AACjD,4CAA4C,KAAK,GAAG,EAAE,OAAO,EAAE;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,KAAK,GAAG,qBAAqB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,KAAK,GAAG,QAAQ;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,IAAI;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sBAAsB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;;;;;;;;;;ACvOR;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB;AAClB,mBAAmB,mBAAO,CAAC,gDAAY;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,yBAAyB;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,iBAAiB,kBAAkB,kBAAkB;;;;;;;;;;;AClBzC;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB,eAAe,mBAAO,CAAC,6CAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,mBAAmB;;;;;;;;;;;AClCN;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa;AACb,yBAAyB,mBAAO,CAAC,kEAAwB;AACzD,sBAAsB,mBAAO,CAAC,uDAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;;;;;;;;;;AC9BA;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB;AAClB,yBAAyB,mBAAO,CAAC,kEAAwB;AACzD,oBAAoB,mBAAO,CAAC,wDAAmB;AAC/C,2BAA2B,mBAAO,CAAC,iEAAoB;AACvD,qBAAqB,mBAAO,CAAC,yDAAwB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;;;;;;;;;;;AChDL;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS,SAAS,GAAG,IAAI,qBAAqB;AACzF;AACA;AACA;AACA;AACA;AACA,4BAA4B,SAAS;AACrC;AACA,oDAAoD,SAAS,GAAG,OAAO;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;;;;;;;;;;;ACnDX;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,mBAAmB,mBAAO,CAAC,sDAAkB;AAC7C,yBAAyB,mBAAO,CAAC,kEAAwB;AACzD,0BAA0B,mBAAO,CAAC,+DAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;;;;;;;;;;AChCJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS,SAAS,GAAG,IAAI,qBAAqB;AACvF;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,SAAS,GAAG,OAAO;AACvD,qCAAqC,SAAS,GAAG,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;;;;;;;;;;;ACxCV;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,SAAS,GAAG,IAAI;AACzD;AACA;AACA;AACA,qCAAqC,SAAS,GAAG,cAAc;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;;;;;;;;;;;AC7BN;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,uBAAuB,GAAG,8BAA8B,GAAG,4BAA4B;AACvF,kBAAkB,mBAAO,CAAC,mDAAqB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sBAAsB,uBAAuB,uBAAuB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;;;;;;;;;ACvKa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,sBAAsB;AACtB,0BAA0B,mBAAO,CAAC,oEAAyB;AAC3D;AACA;AACA;AACA;AACA;AACA,CAAC,oBAAoB;AACrB,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,mBAAmB;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sDAAsD;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC,oCAAoC,KAAK,GAAG,QAAQ;AACpD;AACA;AACA;AACA,sBAAsB;;;;;;;;;;;ACxOT;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,uBAAuB,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,aAAa;AAChF,cAAc,mBAAO,CAAC,iDAAe;AACrC,yCAAwC,EAAE,qCAAqC,yBAAyB,EAAC;AACzG,kBAAkB,mBAAO,CAAC,yDAAmB;AAC7C,6CAA4C,EAAE,qCAAqC,iCAAiC,EAAC;AACrH,mBAAmB,mBAAO,CAAC,2DAAoB;AAC/C,8CAA6C,EAAE,qCAAqC,mCAAmC,EAAC;AACxH,wBAAwB,mBAAO,CAAC,mEAAwB;AACxD,mDAAkD,EAAE,qCAAqC,6CAA6C,EAAC;;;;;;;;;;;ACV1H;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB,GAAG,qBAAqB;AACzC;AACA;AACA;AACA;AACA,kCAAkC,WAAW;AAC7C;AACA;AACA;AACA;AACA;AACA,kCAAkC,WAAW;AAC7C;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;AACA;AACA;AACA;AACA,CAAC,oBAAoB,qBAAqB,qBAAqB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mCAAmC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iBAAiB;;;;;;;;;;;AC3GJ;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB;AAClB,eAAe,mBAAO,CAAC,mCAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;;;;;;;;;;;ACzCL;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,cAAc,GAAG,sBAAsB,GAAG,eAAe,GAAG,cAAc,GAAG,qBAAqB,GAAG,gBAAgB,GAAG,oBAAoB,GAAG,aAAa,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,aAAa;AACrN,gBAAgB,mBAAO,CAAC,wDAAsB;AAC9C,gBAAgB,mBAAO,CAAC,sCAAU;AAClC,0BAA0B,mBAAO,CAAC,0EAA+B;AACjE,yBAAyB,mBAAO,CAAC,wEAA8B;AAC/D;AACA;AACA;AACA,aAAa;AACb;AACA,sCAAsC,YAAY;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,0CAA0C,YAAY;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,2CAA2C,YAAY;AACvD,kDAAkD,YAAY;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,qEAAqE,0BAA0B;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,sCAAsC,YAAY;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,sCAAsC,YAAY;AAClD;AACA,qCAAqC,YAAY;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,gDAAgD,YAAY;AAC5D,gDAAgD,YAAY;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,gDAAgD,YAAY;AAC5D,gDAAgD,YAAY;AAC5D,0DAA0D,YAAY;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,yEAAyE,gCAAgC;AACzG;AACA;AACA,sCAAsC,gCAAgC;AACtE,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,cAAc,eAAe,eAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,qBAAqB,sBAAsB,sBAAsB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,aAAa,cAAc,cAAc;AAC1C;AACA;AACA;AACA;AACA;;;;;;;;;;;ACrTa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,cAAc,eAAe,eAAe;;;;;;;;;;;ACvBhC;AACb;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa,mBAAO,CAAC,+CAAc;AACnC,aAAa,mBAAO,CAAC,6CAAa;;;;;;;;;;;ACjBrB;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,eAAe,gBAAgB,gBAAgB;;;;;;;;;;;ACrCnC;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,WAAW,YAAY,YAAY;;;;;;;;;;;AC7JvB;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB,GAAG,cAAc,GAAG,aAAa,GAAG,gBAAgB,GAAG,aAAa,GAAG,gBAAgB;AAC1G,eAAe,mBAAO,CAAC,mCAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,mBAAmB;;;;;;;;;;;AC3GN;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,kBAAkB,mBAAO,CAAC,iDAAkB;AAC5C,6CAA4C,EAAE,qCAAqC,iCAAiC,EAAC;;;;;;;;;;;ACJxG;AACb;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB,GAAG,aAAa,GAAG,uBAAuB;AAC5D,aAAa,mBAAO,CAAC,+BAAS;AAC9B,aAAa,mBAAO,CAAC,qCAAS;AAC9B,cAAc,mBAAO,CAAC,qCAAS;AAC/B,mDAAkD,EAAE,qCAAqC,mCAAmC,EAAC;AAC7H,yCAAwC,EAAE,qCAAqC,yBAAyB,EAAC;AACzG,8CAA6C,EAAE,qCAAqC,8BAA8B,EAAC;AACnH,aAAa,mBAAO,CAAC,iCAAO;;;;;;;UCvB5B;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;;;;ACtBa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,YAAY,mBAAO,CAAC,yCAAc;AAClC;AACA","sources":["webpack://j-templates/./src/DOM/domNodeConfig.ts","webpack://j-templates/./src/DOM/elements.ts","webpack://j-templates/./src/DOM/index.ts","webpack://j-templates/./src/DOM/svgElements.ts","webpack://j-templates/./src/DOM/utils.ts","webpack://j-templates/./src/DOM/window.ts","webpack://j-templates/./src/Node/boundNode.ts","webpack://j-templates/./src/Node/component.ts","webpack://j-templates/./src/Node/componentNode.ts","webpack://j-templates/./src/Node/elementNode.ts","webpack://j-templates/./src/Node/nodeConfig.ts","webpack://j-templates/./src/Node/nodeRef.ts","webpack://j-templates/./src/Store/Diff/diffAsync.ts","webpack://j-templates/./src/Store/Diff/diffSync.ts","webpack://j-templates/./src/Store/Diff/diffTree.ts","webpack://j-templates/./src/Store/Diff/diffWorker.ts","webpack://j-templates/./src/Store/Diff/workerQueue.ts","webpack://j-templates/./src/Store/Store/store.ts","webpack://j-templates/./src/Store/Store/storeAsync.ts","webpack://j-templates/./src/Store/Store/storeAsyncWriter.ts","webpack://j-templates/./src/Store/Store/storeSync.ts","webpack://j-templates/./src/Store/Store/storeSyncWriter.ts","webpack://j-templates/./src/Store/Store/storeWriter.ts","webpack://j-templates/./src/Store/Tree/observableScope.ts","webpack://j-templates/./src/Store/Tree/observableTree.ts","webpack://j-templates/./src/Store/index.ts","webpack://j-templates/./src/Utils/animation.ts","webpack://j-templates/./src/Utils/asyncQueue.ts","webpack://j-templates/./src/Utils/decorators.ts","webpack://j-templates/./src/Utils/emitter.ts","webpack://j-templates/./src/Utils/index.ts","webpack://j-templates/./src/Utils/injector.ts","webpack://j-templates/./src/Utils/list.ts","webpack://j-templates/./src/Utils/thread.ts","webpack://j-templates/./src/index.ts","webpack://j-templates/./src/web.export.ts","webpack://j-templates/webpack/bootstrap","webpack://j-templates/./src/web.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DOMNodeConfig = void 0;\nconst window_1 = require(\"./window\");\nconst list_1 = require(\"../Utils/list\");\nconst utils_1 = require(\"./utils\");\nconst thread_1 = require(\"../Utils/thread\");\nvar pendingUpdates = list_1.List.Create();\nvar updateScheduled = false;\nfunction processUpdates() {\n list_1.List.Add(pendingUpdates, null);\n var callback;\n while ((callback = list_1.List.Pop(pendingUpdates)))\n (0, thread_1.Synch)(callback);\n if (pendingUpdates.size === 0)\n updateScheduled = false;\n else\n window_1.wndw.requestAnimationFrame(processUpdates);\n}\nexports.DOMNodeConfig = {\n createNode(type, namespace) {\n return type !== \"text\" ?\n namespace ?\n window_1.wndw.document.createElementNS(namespace, type) :\n window_1.wndw.document.createElement(type) :\n window_1.wndw.document.createTextNode(\"\");\n },\n scheduleUpdate(callback) {\n list_1.List.Add(pendingUpdates, callback);\n if (!updateScheduled) {\n updateScheduled = true;\n window_1.wndw.requestAnimationFrame(processUpdates);\n }\n },\n addListener(target, type, callback) {\n target.addEventListener(type, callback);\n },\n removeListener(target, type, callback) {\n target.removeEventListener(type, callback);\n },\n addChild(root, child) {\n root.appendChild(child);\n },\n addChildFirst(root, child) {\n exports.DOMNodeConfig.addChildBefore(root, root.firstChild, child);\n },\n addChildBefore(root, sibling, child) {\n if (!sibling) {\n exports.DOMNodeConfig.addChild(root, child);\n return;\n }\n if (child !== sibling)\n root.insertBefore(child, sibling);\n },\n addChildAfter(root, sibling, child) {\n if (!sibling) {\n exports.DOMNodeConfig.addChildFirst(root, child);\n return;\n }\n exports.DOMNodeConfig.addChildBefore(root, sibling.nextSibling, child);\n },\n removeChild(root, child) {\n root.removeChild(child);\n },\n remove(target) {\n target && target.parentNode && target.parentNode.removeChild(target);\n },\n setText(target, text) {\n target.textContent = text;\n },\n getAttribute(target, attribute) {\n return target.getAttribute(attribute);\n },\n setAttribute(target, attribute, value) {\n target.setAttribute(attribute, value);\n },\n fireEvent(target, event, data) {\n var cEvent = new CustomEvent(event, data);\n target.dispatchEvent(cEvent);\n },\n setProperties: utils_1.SetProperties,\n getFirstChild(target) {\n return target.firstChild;\n },\n getNextSibling(target) {\n return target.nextSibling;\n },\n replaceChildren(target, children) {\n target.replaceChildren(...children);\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.td = exports.tr = exports.th = exports.table = exports.button = exports.style = exports.p = exports.h3 = exports.h2 = exports.h1 = exports.option = exports.select = exports.input = exports.source = exports.video = exports.img = exports.span = exports.b = exports.br = exports.li = exports.ul = exports.a = exports.div = void 0;\nconst elementNode_1 = require(\"../Node/elementNode\");\nfunction div(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"div\", null, nodeDef, children);\n}\nexports.div = div;\nfunction a(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"a\", null, nodeDef, children);\n}\nexports.a = a;\nfunction ul(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"ul\", null, nodeDef, children);\n}\nexports.ul = ul;\nfunction li(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"li\", null, nodeDef, children);\n}\nexports.li = li;\nfunction br(nodeDef) {\n return elementNode_1.ElementNode.Create(\"br\", null, nodeDef, null);\n}\nexports.br = br;\nfunction b(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"b\", null, nodeDef, children);\n}\nexports.b = b;\nfunction span(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"span\", null, nodeDef, children);\n}\nexports.span = span;\nfunction img(nodeDef) {\n return elementNode_1.ElementNode.Create(\"img\", null, nodeDef, null);\n}\nexports.img = img;\nfunction video(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"video\", null, nodeDef, children);\n}\nexports.video = video;\nfunction source(nodeDef) {\n return elementNode_1.ElementNode.Create(\"source\", null, nodeDef, null);\n}\nexports.source = source;\nfunction input(nodeDef) {\n return elementNode_1.ElementNode.Create(\"input\", null, nodeDef, null);\n}\nexports.input = input;\nfunction select(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"select\", null, nodeDef, children);\n}\nexports.select = select;\nfunction option(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"option\", null, nodeDef, children);\n}\nexports.option = option;\nfunction h1(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"h1\", null, nodeDef, children);\n}\nexports.h1 = h1;\nfunction h2(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"h2\", null, nodeDef, children);\n}\nexports.h2 = h2;\nfunction h3(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"h3\", null, nodeDef, children);\n}\nexports.h3 = h3;\nfunction p(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"p\", null, nodeDef, children);\n}\nexports.p = p;\nfunction style(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"style\", null, nodeDef, children);\n}\nexports.style = style;\nfunction button(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"button\", null, nodeDef, children);\n}\nexports.button = button;\nfunction table(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"table\", null, nodeDef, children);\n}\nexports.table = table;\nfunction th(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"th\", null, nodeDef, children);\n}\nexports.th = th;\nfunction tr(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"tr\", null, nodeDef, children);\n}\nexports.tr = tr;\nfunction td(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"td\", null, nodeDef, children);\n}\nexports.td = td;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./elements\"), exports);\n__exportStar(require(\"./svgElements\"), exports);\n__exportStar(require(\"./utils\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.circle = exports.g = exports.svg = void 0;\nconst elementNode_1 = require(\"../Node/elementNode\");\nconst svgNs = \"http://www.w3.org/2000/svg\";\nfunction svg(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"svg\", svgNs, nodeDef, children);\n}\nexports.svg = svg;\nfunction g(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"g\", svgNs, nodeDef, children);\n}\nexports.g = g;\nfunction circle(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"circle\", svgNs, nodeDef, children);\n}\nexports.circle = circle;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SetProperties = void 0;\nfunction SetValue(target, value) {\n switch (target.nodeName) {\n case \"INPUT\":\n var start = target.selectionStart;\n var end = target.selectionEnd;\n target.value = value;\n if (target.ownerDocument.activeElement === target)\n target.setSelectionRange(start, end);\n break;\n default:\n target.value = value;\n }\n}\nfunction SetStyle(target, styleDef, lastStyleDef) {\n for (var key in styleDef)\n if (!lastStyleDef || lastStyleDef[key] !== styleDef[key])\n target.style[key] = styleDef[key];\n}\nfunction SetRootProperty(target, prop, value, lastValue) {\n switch (prop) {\n case \"value\":\n SetValue(target, value);\n break;\n case \"style\":\n SetStyle(target, value, lastValue);\n break;\n default:\n target[prop] = value;\n }\n}\nfunction SetChangedProperties(target, lastProperties, properties) {\n const keys = Object.keys(properties);\n for (let x = 0; x < keys.length; x++) {\n if (!lastProperties || lastProperties[keys[x]] !== properties[keys[x]])\n SetRootProperty(target, keys[x], properties[keys[x]], lastProperties && lastProperties[keys[x]]);\n }\n}\nfunction SetProperties(target, lastProperties, properties) {\n if (!lastProperties && target.nodeType === Node.TEXT_NODE)\n target.nodeValue = properties.nodeValue;\n else\n SetChangedProperties(target, lastProperties, properties);\n}\nexports.SetProperties = SetProperties;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.wndw = void 0;\nexports.wndw = typeof window !== \"undefined\" ? window : (new (require(\"jsdom\").JSDOM(\"\")).window);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BoundNode = void 0;\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nvar BoundNode;\n(function (BoundNode) {\n function Init(boundNode) {\n const nodeDef = boundNode.nodeDef;\n if (nodeDef.props) {\n const scope = observableScope_1.ObservableScope.Create(nodeDef.props);\n boundNode.destroyables.push(CreateScopeDestroyable(scope));\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetProperties(boundNode, scope); });\n SetProperties(boundNode, observableScope_1.ObservableScope.Value(scope));\n }\n if (nodeDef.attrs) {\n const scope = observableScope_1.ObservableScope.Create(nodeDef.attrs);\n boundNode.destroyables.push(CreateScopeDestroyable(scope));\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetAttributes(boundNode, scope); });\n SetAttributes(boundNode, observableScope_1.ObservableScope.Value(scope));\n }\n if (nodeDef.on) {\n const scope = observableScope_1.ObservableScope.Create(nodeDef.on);\n boundNode.destroyables.push(CreateScopeDestroyable(scope));\n boundNode.destroyables.push({\n Destroy() {\n SetEvents(boundNode, {});\n }\n });\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetEvents(boundNode, scope); });\n SetEvents(boundNode, observableScope_1.ObservableScope.Value(scope));\n }\n }\n BoundNode.Init = Init;\n})(BoundNode || (exports.BoundNode = BoundNode = {}));\nfunction CreateScopeDestroyable(scope) {\n return {\n Destroy() {\n observableScope_1.ObservableScope.Destroy(scope);\n }\n };\n}\nfunction ScheduleSetProperties(node, scope) {\n if (node.setProperties)\n return;\n node.setProperties = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setProperties = false;\n if (node.destroyed)\n return;\n SetProperties(node, observableScope_1.ObservableScope.Value(scope));\n });\n}\nfunction SetProperties(node, properties) {\n if (!properties)\n return;\n nodeConfig_1.NodeConfig.setProperties(node.node, node.lastProperties, properties);\n node.lastProperties = properties;\n}\nfunction ScheduleSetAttributes(node, scope) {\n if (node.setAttributes)\n return;\n node.setAttributes = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setAttributes = false;\n if (node.destroyed)\n return;\n SetAttributes(node, observableScope_1.ObservableScope.Value(scope));\n });\n}\nfunction SetAttributes(node, attributes) {\n if (!attributes)\n return;\n for (var key in attributes) {\n var val = nodeConfig_1.NodeConfig.getAttribute(node.node, key);\n if (val !== attributes[key])\n nodeConfig_1.NodeConfig.setAttribute(node.node, key, attributes[key]);\n }\n}\nfunction ScheduleSetEvents(node, scope) {\n if (node.setEvents)\n return;\n node.setEvents = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setEvents = false;\n if (node.destroyed)\n return;\n SetEvents(node, observableScope_1.ObservableScope.Value(scope));\n });\n}\nfunction SetEvents(node, events) {\n if (!events)\n return;\n for (var key in node.lastEvents)\n nodeConfig_1.NodeConfig.removeListener(node.node, key, node.lastEvents[key]);\n for (var key in events)\n nodeConfig_1.NodeConfig.addListener(node.node, key, events[key]);\n node.lastEvents = events;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nconst nodeRef_1 = require(\"./nodeRef\");\nconst componentNode_1 = require(\"./componentNode\");\nconst decorators_1 = require(\"../Utils/decorators\");\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nclass Component {\n nodeRef;\n componentEvents;\n scope;\n templates;\n decoratorMap;\n get Injector() {\n return this.nodeRef.injector;\n }\n get Destroyed() {\n return this.nodeRef.destroyed;\n }\n get DecoratorMap() {\n return this.decoratorMap;\n }\n get Scope() {\n return this.scope;\n }\n get Data() {\n return this.scope.Value;\n }\n get NodeRef() {\n return this.nodeRef;\n }\n get Templates() {\n return this.templates;\n }\n constructor(data, templates, nodeRef, componentEvents) {\n this.nodeRef = nodeRef;\n this.componentEvents = componentEvents;\n this.scope = new observableScope_1.ObservableScope(data);\n this.templates = templates || {};\n this.decoratorMap = new Map();\n }\n Template() {\n return [];\n }\n Bound() {\n }\n Fire(event, data) {\n var eventCallback = this.componentEvents && this.componentEvents[event];\n eventCallback && eventCallback(data);\n }\n Destroy() {\n decorators_1.Destroy.All(this);\n }\n}\nexports.Component = Component;\n(function (Component) {\n function ToFunction(type, namespace, constructor) {\n return componentNode_1.ComponentNode.ToFunction(type, namespace, constructor);\n }\n Component.ToFunction = ToFunction;\n function Register(name, constructor) {\n const componentFunction = ToFunction(`${name}-component`, undefined, constructor);\n class WebComponent extends HTMLElement {\n constructor() {\n super();\n const shadowRoot = this.attachShadow({ mode: 'open' });\n const node = componentFunction({});\n Attach(shadowRoot, node);\n }\n }\n customElements.define(name, WebComponent);\n }\n Component.Register = Register;\n function Attach(node, nodeRef) {\n nodeRef_1.NodeRef.Init(nodeRef);\n var rootRef = nodeRef_1.NodeRef.Wrap(node);\n nodeRef_1.NodeRef.AddChild(rootRef, nodeRef);\n }\n Component.Attach = Attach;\n})(Component || (exports.Component = Component = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ComponentNode = void 0;\nconst boundNode_1 = require(\"./boundNode\");\nconst nodeRef_1 = require(\"./nodeRef\");\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst component_1 = require(\"./component\");\nconst injector_1 = require(\"../Utils/injector\");\nconst decorators_1 = require(\"../Utils/decorators\");\nconst thread_1 = require(\"../Utils/thread\");\nconst list_1 = require(\"../Utils/list\");\nvar ComponentNode;\n(function (ComponentNode) {\n function Fire(event, data) {\n var eventCallback = this.componentEvents && this.componentEvents[event];\n eventCallback && eventCallback(data);\n }\n ComponentNode.Fire = Fire;\n function ToFunction(type, namespace, constructor) {\n return function (nodeDef, templates) {\n return Create(type, namespace, nodeDef, constructor, templates);\n };\n }\n ComponentNode.ToFunction = ToFunction;\n function Init(componentNode) {\n var nodeDef = componentNode.nodeDef;\n var events = nodeDef.on;\n nodeDef.on = null;\n componentNode.component = new componentNode.constructor(nodeDef.data, componentNode.templates, componentNode, events);\n SetChildren(componentNode);\n componentNode.destroyables.push(componentNode.component);\n boundNode_1.BoundNode.Init(componentNode);\n }\n ComponentNode.Init = Init;\n})(ComponentNode || (exports.ComponentNode = ComponentNode = {}));\nfunction Create(type, namespace, nodeDef, constructor, templates) {\n var compNode = nodeRef_1.NodeRef.Create(type, namespace, nodeRef_1.NodeRefType.ComponentNode);\n compNode.nodeDef = nodeDef;\n compNode.constructor = constructor;\n compNode.templates = templates;\n return compNode;\n}\nfunction SetChildren(node) {\n if (decorators_1.PreReq.Has(node.component)) {\n AddPreReqTemplate(node).then(function () {\n AddTemplate(node, false);\n });\n }\n else\n AddTemplate(node, true);\n}\nfunction AddPreReqTemplate(node) {\n return new Promise(resolve => {\n (0, thread_1.Thread)(function () {\n const preNodes = injector_1.Injector.Scope(node.injector, decorators_1.PreReqTemplate.Get, node.component);\n (0, thread_1.Schedule)(function () {\n if (node.destroyed)\n return;\n nodeRef_1.NodeRef.InitAll(node, preNodes);\n });\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n for (var x = 0; x < preNodes.length; x++)\n nodeRef_1.NodeRef.AddChild(node, preNodes[x]);\n decorators_1.PreReq.All(node.component).then(function () {\n if (node.destroyed)\n return;\n for (var x = 0; x < preNodes.length; x++)\n nodeRef_1.NodeRef.Destroy(preNodes[x]);\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n if (node.destroyed)\n return;\n for (var x = 0; x < preNodes.length; x++)\n nodeRef_1.NodeRef.DetachChild(node, preNodes[x]);\n resolve();\n });\n });\n });\n });\n });\n}\nfunction InvokeNodeTemplate(node) {\n const nodes = node.component.Template();\n if (!Array.isArray(nodes))\n return [nodes];\n return nodes;\n}\nfunction AddTemplate(node, init) {\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n const nodes = injector_1.Injector.Scope(node.injector, InvokeNodeTemplate, node);\n (0, thread_1.Schedule)(function () {\n nodeRef_1.NodeRef.InitAll(node, nodes);\n });\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n const list = list_1.List.Create();\n list_1.List.Add(list, {\n value: undefined,\n init: true,\n nodes\n });\n if (init)\n nodeRef_1.NodeRef.ReconcileChildren(node, list);\n else\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n if (node.destroyed)\n return;\n nodeRef_1.NodeRef.ReconcileChildren(node, list);\n });\n });\n if (node.component.Bound !== component_1.Component.prototype.Bound)\n (0, thread_1.After)(function () {\n nodeConfig_1.NodeConfig.scheduleUpdate(() => setTimeout(() => node.component.Bound(), 0));\n });\n });\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ElementNode = void 0;\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nconst injector_1 = require(\"../Utils/injector\");\nconst list_1 = require(\"../Utils/list\");\nconst thread_1 = require(\"../Utils/thread\");\nconst boundNode_1 = require(\"./boundNode\");\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst nodeRef_1 = require(\"./nodeRef\");\nvar ElementNode;\n(function (ElementNode) {\n function Create(type, namespace, nodeDef, children) {\n var elemNode = nodeRef_1.NodeRef.Create(type, namespace, nodeRef_1.NodeRefType.ElementNode);\n elemNode.nodeDef = nodeDef;\n elemNode.childrenFunc = children;\n return elemNode;\n }\n ElementNode.Create = Create;\n function Init(elementNode) {\n if (elementNode.childrenFunc) {\n var nodeDef = elementNode.nodeDef;\n if (nodeDef.data) {\n const dataScope = observableScope_1.ObservableScope.Create(nodeDef.data);\n observableScope_1.ObservableScope.Watch(dataScope, function () {\n ScheduleSetData(elementNode, dataScope);\n });\n SetData(elementNode, GetValue(dataScope), true);\n elementNode.destroyables.push({\n Destroy: function () {\n observableScope_1.ObservableScope.Destroy(dataScope);\n }\n });\n }\n else\n SetDefaultData(elementNode);\n }\n boundNode_1.BoundNode.Init(elementNode);\n }\n ElementNode.Init = Init;\n})(ElementNode || (exports.ElementNode = ElementNode = {}));\nconst valueDefault = [];\nfunction GetValue(dataScope) {\n var value = observableScope_1.ObservableScope.Value(dataScope);\n if (!value)\n return valueDefault;\n if (!Array.isArray(value))\n value = [value];\n return value;\n}\nfunction ScheduleSetData(node, scope) {\n if (node.setData)\n return;\n node.setData = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setData = false;\n if (node.destroyed)\n return;\n SetData(node, GetValue(scope));\n });\n}\nfunction SetDefaultData(node) {\n (0, thread_1.Synch)(function () {\n const nodes = injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, true);\n if (nodes.length > 0) {\n nodeRef_1.NodeRef.InitAll(node, nodes);\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n const defaultNodeList = list_1.List.Create();\n list_1.List.Add(defaultNodeList, {\n value: null,\n init: true,\n nodes\n });\n nodeRef_1.NodeRef.ReconcileChildren(node, defaultNodeList);\n });\n }\n });\n}\nfunction GetDataValue(data) {\n return data.value;\n}\nfunction ReconcileNodeData(node, values) {\n const nextNodeList = list_1.List.Create();\n const initNodeList = list_1.List.Create();\n const currentNodeList = node.nodeList;\n const nodeMap = currentNodeList && list_1.List.ToNodeMap(currentNodeList, GetDataValue);\n for (let x = 0; x < values.length; x++) {\n let curNode;\n if (nodeMap) {\n const nodeArr = nodeMap.get(values[x]);\n if (nodeArr) {\n let y = nodeArr.length - 1;\n for (; y >= 0 && !curNode; y--) {\n curNode = nodeArr[y];\n nodeArr[y] = null;\n }\n }\n }\n if (curNode) {\n list_1.List.RemoveNode(currentNodeList, curNode);\n list_1.List.AddNode(nextNodeList, curNode);\n if (!curNode.data.init)\n list_1.List.Add(initNodeList, curNode.data);\n }\n else {\n curNode = list_1.List.Add(nextNodeList, {\n value: values[x],\n init: false,\n nodes: injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, values[x])\n });\n list_1.List.Add(initNodeList, curNode.data);\n }\n }\n let curNode = initNodeList.head;\n while (curNode) {\n const data = curNode.data;\n (0, thread_1.Schedule)(function () {\n if (node.destroyed || nextNodeList.size === 0)\n return;\n nodeRef_1.NodeRef.InitAll(node, data.nodes);\n data.init = true;\n });\n curNode = curNode.next;\n }\n if (currentNodeList) {\n let curDetach = currentNodeList.head;\n while (curDetach) {\n nodeRef_1.NodeRef.DestroyAll(curDetach.data.nodes);\n for (let x = 0; x < curDetach.data.nodes.length; x++)\n node.childNodes.delete(curDetach.data.nodes[x]);\n curDetach = curDetach.next;\n }\n list_1.List.Clear(currentNodeList);\n }\n node.nodeList = nextNodeList;\n}\nfunction SetData(node, values, init = false) {\n (0, thread_1.Synch)(function () {\n ReconcileNodeData(node, values);\n const attachNodes = node.nodeList;\n const startSize = attachNodes.size;\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n if (init)\n nodeRef_1.NodeRef.ReconcileChildren(node, attachNodes);\n else\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n if (node.destroyed || attachNodes.size !== startSize)\n return;\n nodeRef_1.NodeRef.ReconcileChildren(node, attachNodes);\n });\n });\n });\n}\nfunction CreateNodeArray(childrenFunc, value) {\n var newNodes = childrenFunc(value);\n if (typeof newNodes === \"string\") {\n var textNode = nodeRef_1.NodeRef.Create(\"text\", null, nodeRef_1.NodeRefType.BoundNode);\n textNode.nodeDef = {\n props: function () {\n return { nodeValue: childrenFunc(value) };\n }\n };\n return [textNode];\n }\n if (Array.isArray(newNodes))\n return newNodes;\n return [newNodes];\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeConfig = void 0;\nconst domNodeConfig_1 = require(\"../DOM/domNodeConfig\");\nexports.NodeConfig = domNodeConfig_1.DOMNodeConfig;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeRef = exports.NodeRefType = void 0;\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst injector_1 = require(\"../Utils/injector\");\nconst boundNode_1 = require(\"./boundNode\");\nconst elementNode_1 = require(\"./elementNode\");\nconst componentNode_1 = require(\"./componentNode\");\nvar NodeRefType;\n(function (NodeRefType) {\n NodeRefType[NodeRefType[\"NodeRef\"] = 0] = \"NodeRef\";\n NodeRefType[NodeRefType[\"BoundNode\"] = 1] = \"BoundNode\";\n NodeRefType[NodeRefType[\"ElementNode\"] = 2] = \"ElementNode\";\n NodeRefType[NodeRefType[\"ComponentNode\"] = 3] = \"ComponentNode\";\n})(NodeRefType || (exports.NodeRefType = NodeRefType = {}));\nvar NodeRef;\n(function (NodeRef) {\n function Wrap(node) {\n var nodeRef = Create(null, null, NodeRefType.NodeRef);\n nodeRef.node = node;\n nodeRef.childNodes = new Set();\n return nodeRef;\n }\n NodeRef.Wrap = Wrap;\n function Create(nodeType, namespace, type) {\n switch (type) {\n case NodeRefType.NodeRef:\n return {\n node: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.NodeRef,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n destroyables: []\n };\n case NodeRefType.BoundNode:\n return {\n node: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.BoundNode,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n destroyables: [],\n lastProperties: null,\n lastEvents: null,\n setProperties: false,\n setAttributes: false,\n setEvents: false\n };\n case NodeRefType.ElementNode:\n return {\n node: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.ElementNode,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n destroyables: [],\n lastProperties: null,\n lastEvents: null,\n setProperties: false,\n setAttributes: false,\n setEvents: false,\n childrenFunc: null,\n nodeList: null,\n setData: false\n };\n case NodeRefType.ComponentNode:\n return {\n node: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.ComponentNode,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n destroyables: [],\n lastProperties: null,\n lastEvents: null,\n setProperties: false,\n setAttributes: false,\n setEvents: false,\n component: null,\n componentEvents: null\n };\n }\n }\n NodeRef.Create = Create;\n function Init(nodeRef) {\n if (nodeRef.node)\n return;\n nodeRef.node = nodeConfig_1.NodeConfig.createNode(nodeRef.nodeType, nodeRef.nodeNamespace);\n nodeRef.childNodes = new Set();\n switch (nodeRef.type) {\n case NodeRefType.BoundNode:\n boundNode_1.BoundNode.Init(nodeRef);\n break;\n case NodeRefType.ElementNode:\n elementNode_1.ElementNode.Init(nodeRef);\n break;\n case NodeRefType.ComponentNode:\n componentNode_1.ComponentNode.Init(nodeRef);\n break;\n }\n }\n NodeRef.Init = Init;\n function InitAll(parentNode, nodeRefs) {\n for (var x = 0; x < nodeRefs.length; x++) {\n nodeRefs[x].parent = parentNode;\n parentNode.childNodes.add(nodeRefs[x]);\n Init(nodeRefs[x]);\n }\n }\n NodeRef.InitAll = InitAll;\n function AddChild(node, child) {\n child.parent = node;\n node.childNodes.add(child);\n nodeConfig_1.NodeConfig.addChild(node.node, child.node);\n }\n NodeRef.AddChild = AddChild;\n function AddChildAfter(node, currentChild, newChild) {\n if (currentChild && currentChild.parent !== node)\n throw \"currentChild is not valid\";\n newChild.parent = node;\n node.childNodes.add(newChild);\n nodeConfig_1.NodeConfig.addChildAfter(node.node, currentChild && currentChild.node, newChild.node);\n }\n NodeRef.AddChildAfter = AddChildAfter;\n function ReconcileChildren(node, nextChildren) {\n const rootNode = node.node;\n if (nextChildren.size === 0) {\n nodeConfig_1.NodeConfig.replaceChildren(rootNode, []);\n return;\n }\n let priorNode;\n let curDataNode = nextChildren?.head;\n while (curDataNode) {\n for (let x = 0; x < curDataNode.data.nodes.length; x++) {\n const actualNode = priorNode ? nodeConfig_1.NodeConfig.getNextSibling(priorNode) : nodeConfig_1.NodeConfig.getFirstChild(rootNode);\n const virtualNode = curDataNode.data.nodes[x];\n const expectedNode = virtualNode.node;\n if (actualNode !== expectedNode) {\n nodeConfig_1.NodeConfig.addChildBefore(rootNode, actualNode, expectedNode);\n }\n priorNode = expectedNode;\n }\n curDataNode = curDataNode.next;\n }\n let remainingSibling = priorNode && nodeConfig_1.NodeConfig.getNextSibling(priorNode);\n while (remainingSibling) {\n nodeConfig_1.NodeConfig.removeChild(rootNode, remainingSibling);\n remainingSibling = nodeConfig_1.NodeConfig.getNextSibling(priorNode);\n }\n }\n NodeRef.ReconcileChildren = ReconcileChildren;\n function DetachChild(node, child) {\n if (node.childNodes.delete(child)) {\n nodeConfig_1.NodeConfig.removeChild(node.node, child.node);\n child.parent = null;\n }\n }\n NodeRef.DetachChild = DetachChild;\n function Destroy(node) {\n if (node.destroyed)\n return;\n node.destroyed = true;\n node.childNodes?.forEach(Destroy);\n for (let x = 0; x < node.destroyables.length; x++)\n node.destroyables[x]?.Destroy();\n }\n NodeRef.Destroy = Destroy;\n function DestroyAll(nodes) {\n for (var x = 0; x < nodes.length; x++)\n Destroy(nodes[x]);\n }\n NodeRef.DestroyAll = DestroyAll;\n})(NodeRef || (exports.NodeRef = NodeRef = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffAsync = void 0;\nconst diffTree_1 = require(\"./diffTree\");\nconst workerQueue_1 = require(\"./workerQueue\");\nconst diffWorker_1 = require(\"./diffWorker\");\nconst diffCnstr = (0, diffTree_1.DiffTreeScope)();\nclass DiffAsync {\n workerQueue;\n constructor(keyFunc) {\n this.workerQueue = new workerQueue_1.WorkerQueue(diffWorker_1.DiffWorker.Create());\n this.workerQueue.Push({ method: \"create\", arguments: [keyFunc.toString()] });\n }\n static GetKeyRef(key) {\n return diffCnstr.GetKeyRef(key);\n }\n static ReadKeyRef(ref) {\n return diffCnstr.ReadKeyRef(ref);\n }\n async DiffPath(path, value) {\n return await this.workerQueue.Push({ method: \"diffpath\", arguments: [path, value] });\n }\n async DiffBatch(data) {\n return await this.workerQueue.Push({ method: \"diffbatch\", arguments: [data] });\n }\n async UpdatePath(path, value) {\n await this.workerQueue.Push({ method: \"updatepath\", arguments: [path, value] });\n }\n async GetPath(path) {\n return await this.workerQueue.Push({ method: \"getpath\", arguments: [path] });\n }\n Destroy() {\n this.workerQueue.Destroy();\n }\n}\nexports.DiffAsync = DiffAsync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffSync = void 0;\nconst diffTree_1 = require(\"./diffTree\");\nconst diffCnstr = (0, diffTree_1.DiffTreeScope)();\nclass DiffSync {\n diffTree;\n constructor(keyFunc) {\n this.diffTree = new diffCnstr(keyFunc);\n }\n static GetKeyRef(key) {\n return diffCnstr.GetKeyRef(key);\n }\n static ReadKeyRef(ref) {\n return diffCnstr.ReadKeyRef(ref);\n }\n DiffPath(path, value) {\n return this.diffTree.DiffPath(path, value);\n }\n DiffBatch(data) {\n return this.diffTree.DiffBatch(data);\n }\n UpdatePath(path, value) {\n this.diffTree.UpdatePath(path, value);\n }\n}\nexports.DiffSync = DiffSync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffTreeScope = void 0;\nfunction DiffTreeScope(worker) {\n const ctx = this;\n if (ctx && worker) {\n let diffTree = null;\n ctx.onmessage = function (event) {\n var data = event.data;\n switch (data.method) {\n case \"create\":\n var keyFunc = data.arguments[0] ? eval(data.arguments[0]) : undefined;\n diffTree = new DiffTree(keyFunc);\n ctx.postMessage(null);\n break;\n case \"diffpath\":\n var diff = diffTree.DiffPath(data.arguments[0], data.arguments[1]);\n ctx.postMessage(diff);\n break;\n case \"diffbatch\":\n var diff = diffTree.DiffBatch(data.arguments[0]);\n ctx.postMessage(diff);\n break;\n case \"updatepath\":\n diffTree.UpdatePath(data.arguments[0], data.arguments[1]);\n ctx.postMessage(null);\n break;\n case \"getpath\":\n var ret = diffTree.GetPath(data.arguments[0]);\n ctx.postMessage(ret);\n break;\n }\n };\n }\n const jsonConstructor = {}.constructor;\n function IsValue(value) {\n if (!value)\n return true;\n return !(jsonConstructor === value.constructor || Array.isArray(value));\n }\n let Type;\n (function (Type) {\n Type[Type[\"Value\"] = 0] = \"Value\";\n Type[Type[\"Object\"] = 1] = \"Object\";\n Type[Type[\"Array\"] = 2] = \"Array\";\n })(Type || (Type = {}));\n function TypeOf(value) {\n if (!value)\n return Type.Value;\n if (jsonConstructor === value.constructor)\n return Type.Object;\n if (Array.isArray(value))\n return Type.Array;\n return Type.Value;\n }\n function JsonDiffRecursive(path, newValue, oldValue, resp) {\n if (newValue === oldValue)\n return false;\n const newType = TypeOf(newValue);\n const oldType = TypeOf(oldValue);\n const changedPathLength = resp.length;\n let allChildrenChanged = true;\n if (newType === oldType)\n switch (newType) {\n case Type.Array: {\n allChildrenChanged = JsonDiffArrays(path, newValue, oldValue, resp);\n break;\n }\n case Type.Object: {\n allChildrenChanged = JsonDiffObjects(path, newValue, oldValue, resp);\n break;\n }\n }\n if (allChildrenChanged) {\n resp.splice(changedPathLength);\n resp.push({\n path,\n value: newValue\n });\n return true;\n }\n return false;\n }\n function JsonDiffArrays(path, newValue, oldValue, resp) {\n let allChildrenChanged = true;\n if (newValue.length !== oldValue.length)\n resp.push({\n path: path ? `${path}.length` : 'length',\n value: newValue.length\n });\n if (newValue.length > 0 || oldValue.length > 0) {\n for (let y = 0; y < newValue.length; y++) {\n const arrayPath = path ? `${path}.${y}` : `${y}`;\n allChildrenChanged = JsonDiffRecursive(arrayPath, newValue[y], oldValue[y], resp) && allChildrenChanged;\n }\n }\n else\n allChildrenChanged = false;\n return allChildrenChanged;\n }\n function JsonDiffObjects(path, newValue, oldValue, resp) {\n let allChildrenChanged = true;\n const newKeys = Object.keys(newValue);\n const oldKeys = Object.keys(oldValue);\n if (newKeys.length === 0 && oldKeys.length === 0) {\n return false;\n }\n if (newKeys.length >= oldKeys.length) {\n let newKeyIndex = 0;\n let oldKeyIndex = 0;\n while (newKeyIndex < newKeys.length) {\n const childPath = path ? `${path}.${newKeys[newKeyIndex]}` : newKeys[newKeyIndex];\n if (oldKeyIndex < oldKeys.length && newKeys[newKeyIndex] === oldKeys[oldKeyIndex]) {\n allChildrenChanged =\n JsonDiffRecursive(childPath, newValue[newKeys[newKeyIndex]], oldValue[oldKeys[oldKeyIndex]], resp) &&\n allChildrenChanged;\n oldKeyIndex++;\n }\n else if (newValue[newKeys[newKeyIndex]] !== undefined) {\n resp.push({\n path: childPath,\n value: newValue[newKeys[newKeyIndex]]\n });\n }\n newKeyIndex++;\n }\n if (oldKeyIndex < oldKeys.length)\n allChildrenChanged = true;\n }\n return allChildrenChanged;\n }\n function BreakUpValue(path, parent, keyFunc, prop, map) {\n const value = prop ? parent[prop] : parent;\n const isValue = IsValue(value);\n if (!map && isValue)\n return new Map([[path, value]]);\n map = map || new Map();\n if (isValue)\n return map;\n const key = keyFunc ? keyFunc(value) : null;\n const keyRef = key && DiffTree.GetKeyRef(key);\n if (key && key !== path) {\n if (prop)\n parent[prop] = keyRef;\n BreakUpValue(key, value, keyFunc, null, map);\n }\n else {\n for (const subProp in value) {\n const childPath = `${path}.${subProp}`;\n BreakUpValue(childPath, value, keyFunc, subProp, map);\n }\n }\n if (!prop)\n map.set(path, key === path ? value : keyRef || value);\n return map;\n }\n class DiffTree {\n keyFunc;\n rootStateMap = new Map();\n constructor(keyFunc) {\n this.keyFunc = keyFunc;\n }\n static GetKeyRef(key) {\n return `___DiffTreeKeyRef.${key}`;\n }\n static ReadKeyRef(ref) {\n if (!ref)\n return undefined;\n var matches = ref.match(/^___DiffTreeKeyRef\\.([^.]+$)/);\n if (!matches)\n return undefined;\n return matches[1];\n }\n DiffBatch(data) {\n var resp = [];\n ;\n for (var x = 0; x < data.length; x++)\n this.RunDiff(data[x].path, data[x].value, resp);\n return resp;\n }\n DiffPath(path, value) {\n var resp = [];\n this.RunDiff(path, value, resp);\n return resp;\n }\n UpdatePath(path, value) {\n this.SetPathValue(path, value);\n }\n GetPath(path) {\n return this.GetPathValue(path);\n }\n RunDiff(path, value, diffResp) {\n var breakupMap = this.GetBreakUpMap(path, value);\n var resp = diffResp || [];\n breakupMap.forEach((value, key) => {\n var currentValue = key.split(\".\").reduce((pre, curr, index) => {\n if (index === 0)\n return this.rootStateMap.get(curr);\n return pre && pre[curr];\n }, null);\n JsonDiffRecursive(key, value, currentValue, resp);\n });\n for (var x = 0; x < resp.length; x++)\n this.SetPathValue(resp[x].path, resp[x].value);\n }\n GetPathValue(path) {\n var parts = path.split(\".\");\n var curr = this.rootStateMap.get(parts[0]);\n for (var x = 1; x < parts.length; x++)\n curr = curr && curr[parts[x]];\n return curr;\n }\n SetPathValue(path, value) {\n var parts = path.split(\".\");\n if (parts.length === 1)\n this.rootStateMap.set(parts[0], value);\n else {\n var curr = this.rootStateMap.get(parts[0]);\n for (var x = 1; x < parts.length - 1; x++)\n curr = curr[parts[x]];\n curr[parts[parts.length - 1]] = value;\n }\n }\n GetBreakUpMap(path, value) {\n if (!this.keyFunc)\n return new Map([[path, value]]);\n return BreakUpValue(path, value, this.keyFunc);\n }\n }\n return DiffTree;\n}\nexports.DiffTreeScope = DiffTreeScope;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffWorker = void 0;\nconst diffTree_1 = require(\"./diffTree\");\nvar DiffWorker;\n(function (DiffWorker) {\n var workerConstructor = null;\n var workerParameter = null;\n if (typeof Worker !== 'undefined') {\n workerConstructor = Worker;\n workerParameter = URL.createObjectURL(new Blob([`(${diffTree_1.DiffTreeScope}).call(this, true)`]));\n }\n function Create() {\n if (!workerConstructor)\n throw \"Worker is not available\";\n return new workerConstructor(workerParameter);\n }\n DiffWorker.Create = Create;\n})(DiffWorker || (exports.DiffWorker = DiffWorker = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkerQueue = void 0;\nconst list_1 = require(\"../../Utils/list\");\nclass WorkerQueue {\n callbacks;\n worker;\n constructor(worker) {\n this.worker = worker;\n this.callbacks = list_1.List.Create();\n this.worker.onerror = (err) => {\n var cb = list_1.List.Pop(this.callbacks);\n cb && cb(null, err);\n };\n this.worker.onmessage = (message) => {\n var cb = list_1.List.Pop(this.callbacks);\n cb && cb(message.data);\n };\n }\n Push(message) {\n return new Promise((resolve, reject) => {\n list_1.List.Add(this.callbacks, function (data, err) {\n if (err)\n reject(err);\n else\n resolve(data);\n });\n this.worker.postMessage(message);\n });\n }\n Destroy() {\n this.worker.terminate();\n }\n}\nexports.WorkerQueue = WorkerQueue;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Store = void 0;\nconst observableTree_1 = require(\"../Tree/observableTree\");\nconst storeWriter_1 = require(\"./storeWriter\");\nclass Store {\n observableTree = new observableTree_1.ObservableTree();\n storeWriter = new storeWriter_1.StoreWriter(this.observableTree);\n rootScope = this.observableTree.Scope(\"ROOT\", root => root);\n get Root() {\n return this.rootScope;\n }\n constructor(init) {\n if (init)\n this.Write(init);\n }\n Action(action) {\n var proxy = this.observableTree.Get(\"ROOT\");\n action(proxy, this.storeWriter);\n }\n Write(data) {\n this.Action((root, writer) => writer.Write(root, data));\n }\n Merge(data) {\n this.Action((root, writer) => writer.Merge(root, data));\n }\n Destroy() {\n this.rootScope.Destroy();\n }\n}\nexports.Store = Store;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreAsync = void 0;\nconst observableTree_1 = require(\"../Tree/observableTree\");\nconst diffAsync_1 = require(\"../Diff/diffAsync\");\nconst storeAsyncWriter_1 = require(\"./storeAsyncWriter\");\nconst asyncQueue_1 = require(\"../../Utils/asyncQueue\");\nclass StoreAsync {\n idFunc;\n diffAsync;\n observableTree;\n asyncWriter;\n asyncQueue;\n constructor(idFunc, init) {\n this.idFunc = idFunc;\n this.diffAsync = new diffAsync_1.DiffAsync(this.idFunc);\n this.observableTree = new observableTree_1.ObservableTree(diffAsync_1.DiffAsync.ReadKeyRef);\n this.asyncWriter = new storeAsyncWriter_1.StoreAsyncWriter(this.idFunc, this.diffAsync, this.observableTree);\n this.asyncQueue = new asyncQueue_1.AsyncQueue();\n if (init) {\n var id = this.idFunc(init);\n this.observableTree.Write(id, init);\n this.Write(init);\n }\n }\n Scope(id, func) {\n return this.observableTree.Scope(id, func);\n }\n async Action(id, action) {\n await this.asyncQueue.Next(async () => {\n await action(id && this.observableTree.Get(id), this.asyncWriter);\n });\n }\n async Write(data) {\n await this.Action(null, async (val, writer) => {\n await writer.Write(val, data);\n });\n }\n async Merge(id, data) {\n await this.Action(id, async (val, writer) => {\n await writer.Merge(val, data);\n });\n }\n Destroy() {\n this.asyncQueue.Stop();\n this.diffAsync.Destroy();\n }\n}\nexports.StoreAsync = StoreAsync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreAsyncWriter = void 0;\nclass StoreAsyncWriter {\n idFunc;\n diffAsync;\n observableTree;\n constructor(idFunc, diffAsync, observableTree) {\n this.idFunc = idFunc;\n this.diffAsync = diffAsync;\n this.observableTree = observableTree;\n }\n async Write(source, data) {\n let path;\n if (source) {\n path = this.observableTree.GetPathOf(source);\n }\n else {\n path = this.idFunc(data);\n if (!path)\n throw new Error(\"data must have an id\");\n }\n let diff = await this.diffAsync.DiffPath(path, data);\n this.ApplyChanges(diff);\n }\n async Merge(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n const keys = Object.keys(data);\n const message = keys.map(key => ({ path: `${rootPath}.${key}`, value: data[key] }));\n const diff = await this.diffAsync.DiffBatch(message);\n this.ApplyChanges(diff);\n }\n async Push(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n var lengthPath = `${rootPath}.length`;\n var length = await this.diffAsync.GetPath(lengthPath);\n var diff = await this.diffAsync.DiffPath(`${rootPath}.${length}`, data);\n this.ApplyChanges(diff);\n }\n async Splice(source, start, deleteCount, ...items) {\n var rootPath = this.observableTree.GetPathOf(source);\n var array = await this.diffAsync.GetPath(rootPath);\n array = array.slice();\n array.splice(start, deleteCount, ...items);\n var diff = await this.diffAsync.DiffPath(rootPath, array);\n this.ApplyChanges(diff);\n }\n ApplyChanges(diff) {\n this.observableTree.WriteAll(diff);\n }\n}\nexports.StoreAsyncWriter = StoreAsyncWriter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreSync = void 0;\nconst diffSync_1 = require(\"../Diff/diffSync\");\nconst observableTree_1 = require(\"../Tree/observableTree\");\nconst storeSyncWriter_1 = require(\"./storeSyncWriter\");\nclass StoreSync {\n diffSync = new diffSync_1.DiffSync();\n observableTree = new observableTree_1.ObservableTree();\n storeWriter = new storeSyncWriter_1.StoreSyncWriter(this.diffSync, this.observableTree);\n rootScope = this.observableTree.Scope(\"ROOT\", root => root);\n get Root() {\n return this.rootScope;\n }\n constructor(init) {\n if (init)\n this.Write(init);\n }\n Action(action) {\n var proxy = this.observableTree.Get(\"ROOT\");\n action(proxy, this.storeWriter);\n }\n Write(data) {\n this.Action((root, writer) => writer.Write(root, data));\n }\n Merge(data) {\n this.Action((root, writer) => writer.Merge(root, data));\n }\n Destroy() {\n this.rootScope.Destroy();\n }\n}\nexports.StoreSync = StoreSync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreSyncWriter = void 0;\nclass StoreSyncWriter {\n diffSync;\n observableTree;\n constructor(diffSync, observableTree) {\n this.diffSync = diffSync;\n this.observableTree = observableTree;\n }\n Write(source, data) {\n var rootPath = source && this.observableTree.GetPathOf(source) || \"ROOT\";\n var diff = this.diffSync.DiffPath(rootPath, data);\n this.ApplyChanges(diff);\n }\n Merge(source, data) {\n var rootPath = this.observableTree.GetPathOf(source);\n var keys = Object.keys(data);\n var message = keys.map(key => ({ path: `${rootPath}.${key}`, value: data[key] }));\n var diff = this.diffSync.DiffBatch(message);\n this.ApplyChanges(diff);\n }\n Push(source, data) {\n var rootPath = this.observableTree.GetPathOf(source);\n var length = source.length;\n this.diffSync.UpdatePath(`${rootPath}.${length}`, data);\n this.observableTree.Write(`${rootPath}.${length}`, data);\n }\n Splice(source, start, deleteCount, ...items) {\n var rootPath = this.observableTree.GetPathOf(source);\n var proxy = this.observableTree.Get(rootPath);\n const array = proxy.toJSON().slice();\n array.splice(start, deleteCount, ...items);\n this.diffSync.UpdatePath(rootPath, array);\n this.observableTree.Write(rootPath, array);\n }\n ApplyChanges(diff) {\n this.observableTree.WriteAll(diff);\n }\n}\nexports.StoreSyncWriter = StoreSyncWriter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreWriter = void 0;\nclass StoreWriter {\n observableTree;\n constructor(observableTree) {\n this.observableTree = observableTree;\n }\n Write(source, data) {\n const rootPath = source && this.observableTree.GetPathOf(source) || \"ROOT\";\n this.observableTree.Write(rootPath, data);\n }\n Merge(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n for (const key in data)\n this.observableTree.Write(`${rootPath}.${key}`, data[key]);\n }\n Push(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n this.observableTree.Write(`${rootPath}.${source.length}`, data);\n }\n Splice(source, start, deleteCount, ...items) {\n const json = source.toJSON();\n const copy = json.slice();\n copy.splice(start, deleteCount, ...items);\n const rootPath = this.observableTree.GetPathOf(source);\n this.observableTree.Write(rootPath, copy);\n }\n}\nexports.StoreWriter = StoreWriter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableScope = exports.ObservableScopeWrapper = exports.ObservableScopeValue = void 0;\nconst emitter_1 = require(\"../../Utils/emitter\");\nclass ObservableScopeValue {\n scope;\n get Value() {\n return ObservableScope.Value(this.scope);\n }\n constructor(scope) {\n this.scope = scope;\n }\n}\nexports.ObservableScopeValue = ObservableScopeValue;\nclass ObservableScopeWrapper extends ObservableScopeValue {\n scopeEmitter;\n constructor(scope) {\n super(scope);\n if (scope.emitter) {\n this.scopeEmitter = emitter_1.Emitter.Create();\n emitter_1.Emitter.On(scope.emitter, () => emitter_1.Emitter.Emit(this.scopeEmitter, this));\n }\n }\n Scope(callback) {\n return new ObservableScope(() => callback(this.Value));\n }\n Watch(callback) {\n if (!this.scopeEmitter)\n return;\n emitter_1.Emitter.On(this.scopeEmitter, callback);\n callback(this);\n }\n Unwatch(callback) {\n if (!this.scopeEmitter)\n return;\n emitter_1.Emitter.Remove(this.scopeEmitter, callback);\n }\n Destroy() {\n DestroyScope(this.scope);\n this.scopeEmitter && this.scopeEmitter.clear();\n }\n}\nexports.ObservableScopeWrapper = ObservableScopeWrapper;\nclass ObservableScope extends ObservableScopeWrapper {\n constructor(getFunction) {\n super(ObservableScope.Create(getFunction));\n }\n}\nexports.ObservableScope = ObservableScope;\nvar currentSet = null;\nvar watching = false;\nfunction WatchAction(action) {\n var parentSet = currentSet;\n currentSet = null;\n var parentWatching = watching;\n watching = true;\n action();\n var lastSet = currentSet;\n currentSet = parentSet;\n watching = parentWatching;\n return lastSet;\n}\n(function (ObservableScope) {\n function Create(valueFunction) {\n if (typeof valueFunction !== 'function')\n return {\n value: valueFunction,\n dirty: false,\n destroyed: false\n };\n var scope = {\n getFunction: valueFunction,\n async: valueFunction[Symbol.toStringTag] === 'AsyncFunction',\n value: null,\n dirty: true,\n emitter: emitter_1.Emitter.Create(),\n emitters: null,\n destroyed: false,\n setCallback: function () {\n OnSet(scope);\n }\n };\n return scope;\n }\n ObservableScope.Create = Create;\n function Register(emitter) {\n if (!watching || !emitter)\n return;\n currentSet = currentSet || new Set();\n currentSet.add(emitter);\n }\n ObservableScope.Register = Register;\n function Value(scope) {\n if (!scope)\n return undefined;\n Register(scope.emitter);\n UpdateValue(scope);\n return scope.value;\n }\n ObservableScope.Value = Value;\n function Watching() {\n return watching;\n }\n ObservableScope.Watching = Watching;\n function Watch(scope, callback) {\n if (!scope || !scope.emitter)\n return;\n emitter_1.Emitter.On(scope.emitter, callback);\n }\n ObservableScope.Watch = Watch;\n function Unwatch(scope, callback) {\n if (!scope || !scope.emitter)\n return;\n emitter_1.Emitter.Remove(scope.emitter, callback);\n }\n ObservableScope.Unwatch = Unwatch;\n function Update(scope) {\n OnSet(scope);\n }\n ObservableScope.Update = Update;\n function Emit(scope) {\n emitter_1.Emitter.Emit(scope.emitter);\n }\n ObservableScope.Emit = Emit;\n function Destroy(scope) {\n DestroyScope(scope);\n }\n ObservableScope.Destroy = Destroy;\n})(ObservableScope || (exports.ObservableScope = ObservableScope = {}));\nfunction OnSet(scope) {\n if (!scope || scope.dirty)\n return;\n scope.dirty = true;\n emitter_1.Emitter.Emit(scope.emitter, scope);\n}\nfunction UpdateValue(scope) {\n if (!scope.dirty)\n return;\n scope.dirty = false;\n var value = null;\n var emitters = scope.getFunction && WatchAction(() => value = scope.getFunction());\n if (scope.async)\n Promise.resolve(value).then(val => {\n scope.value = val;\n emitter_1.Emitter.Emit(scope.emitter, scope);\n });\n else\n scope.value = value;\n UpdateEmitters(scope, emitters);\n}\nfunction DestroyScope(scope) {\n if (!scope)\n return;\n scope.emitters && scope.emitters.forEach(e => emitter_1.Emitter.Remove(e, scope.setCallback));\n scope.emitters && scope.emitters.clear();\n scope.emitter && scope.emitter.clear();\n scope.destroyed = true;\n}\nfunction UpdateEmitters(scope, newEmitters) {\n if (newEmitters)\n newEmitters.forEach(e => {\n if (!scope.emitters || !scope.emitters.delete(e))\n emitter_1.Emitter.On(e, scope.setCallback);\n });\n if (scope.emitters)\n scope.emitters.forEach(e => emitter_1.Emitter.Remove(e, scope.setCallback));\n scope.emitters = newEmitters;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableTree = void 0;\nconst observableScope_1 = require(\"../Tree/observableScope\");\nvar Type;\n(function (Type) {\n Type[Type[\"Value\"] = 0] = \"Value\";\n Type[Type[\"Object\"] = 1] = \"Object\";\n Type[Type[\"Array\"] = 2] = \"Array\";\n})(Type || (Type = {}));\nconst jsonConstructor = {}.constructor;\nfunction TypeOf(value) {\n if (!value)\n return Type.Value;\n if (jsonConstructor === value.constructor)\n return Type.Object;\n if (Array.isArray(value))\n return Type.Array;\n return Type.Value;\n}\nclass ObservableTree {\n valuePathResolver;\n undefinedScope = observableScope_1.ObservableScope.Create(function () { return undefined; });\n scopeCache = new WeakMap();\n leafScopeCache = new WeakMap();\n proxyCache = new WeakMap();\n pathCache = new WeakMap();\n rootStateMap = new Map();\n constructor(valuePathResolver) {\n this.valuePathResolver = valuePathResolver;\n }\n static UnwrapProxyValues(value) {\n if (value?.toJSON && typeof value.toJSON === 'function')\n return value.toJSON();\n const type = TypeOf(value);\n if (type === Type.Value)\n return value;\n if (type === Type.Array) {\n const arr = value;\n for (let x = 0; x < arr.length; x++)\n arr[x] = ObservableTree.UnwrapProxyValues(arr[x]);\n }\n else {\n const keys = Object.keys(value);\n for (let x = 0; x < keys.length; x++)\n value[keys[x]] = ObservableTree.UnwrapProxyValues(value[keys[x]]);\n }\n return value;\n }\n Get(path) {\n const val = path.split(\".\").reduce((pre, curr, index) => {\n if (index === 0) {\n let value = this.rootStateMap.get(curr);\n const scope = this.GetParentScope(value);\n return observableScope_1.ObservableScope.Value(scope);\n }\n return pre && pre[curr];\n }, null);\n return val;\n }\n GetPathOf(value) {\n if (value.toJSON && typeof value.toJSON === 'function')\n value = value.toJSON();\n return this.pathCache.get(value);\n }\n Scope(path, callback) {\n return new observableScope_1.ObservableScope(() => {\n const obj = this.Get(path);\n return callback && callback(obj) || obj;\n });\n }\n Write(path, value) {\n const scope = this.WritePath(path, value);\n observableScope_1.ObservableScope.Update(scope);\n }\n WriteAll(data) {\n const scopeSet = new Set();\n for (var x = 0; x < data.length; x++) {\n const scope = this.WritePath(data[x].path, data[x].value);\n scopeSet.add(scope);\n }\n scopeSet.forEach(scope => observableScope_1.ObservableScope.Update(scope));\n }\n GetParentScope(value) {\n if (value === undefined)\n return this.undefinedScope;\n let scope = this.scopeCache.get(value);\n if (!scope) {\n scope = observableScope_1.ObservableScope.Create(() => this.GetValueProxy(value));\n this.scopeCache.set(value, scope);\n }\n return scope;\n }\n GetPropertyScope(parent, prop) {\n const value = parent[prop];\n const type = TypeOf(value);\n if (type === Type.Value) {\n let leafScopes = this.leafScopeCache.get(parent) || {};\n leafScopes[prop] = leafScopes[prop] || observableScope_1.ObservableScope.Create(() => {\n const parentScope = this.scopeCache.get(parent);\n const parentValue = observableScope_1.ObservableScope.Value(parentScope);\n const parentJson = parentValue.toJSON();\n const currentValue = parentJson[prop];\n let path;\n if (this.valuePathResolver && typeof currentValue === 'string' && (path = this.valuePathResolver(currentValue)))\n return this.Get(path);\n return currentValue;\n });\n this.leafScopeCache.set(parent, leafScopes);\n return leafScopes[prop];\n }\n else {\n let scope = this.scopeCache.get(value);\n if (!scope) {\n scope = observableScope_1.ObservableScope.Create(() => {\n const parentScope = this.scopeCache.get(parent);\n const parentValue = observableScope_1.ObservableScope.Value(parentScope);\n const parentJson = parentValue.toJSON();\n const currentValue = parentJson[prop];\n return this.GetValueProxy(currentValue);\n });\n this.scopeCache.set(value, scope);\n }\n return scope;\n }\n }\n GetValueProxy(value) {\n let proxy = this.proxyCache.get(value);\n if (!proxy) {\n proxy = this.CreateProxy(value);\n this.proxyCache.set(value, proxy);\n }\n return proxy;\n }\n ObjectProxyGetter = (value, prop) => {\n function toJSON() {\n return value;\n }\n ;\n switch (prop) {\n case \"toJSON\":\n return toJSON;\n default:\n if (typeof prop === 'symbol')\n return value[prop];\n return observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, prop));\n }\n };\n CreateObjectProxy(value) {\n return new Proxy(value, {\n get: this.ObjectProxyGetter\n });\n }\n ArrayProxyGetter = (value, prop) => {\n function toJSON() {\n return value;\n }\n ;\n switch (prop) {\n case \"toJSON\":\n return toJSON;\n default:\n if (typeof prop === 'symbol')\n return value[prop];\n if (isNaN(parseInt(prop))) {\n const ret = value[prop];\n if (typeof ret === 'function') {\n const copy = value.map((val, index) => observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, index.toString())));\n return ret.bind(copy);\n }\n return ret;\n }\n return observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, prop));\n }\n };\n CreateArrayProxy(value) {\n return new Proxy(value, {\n get: this.ArrayProxyGetter\n });\n }\n CreateProxy(value) {\n const type = TypeOf(value);\n switch (type) {\n case Type.Object:\n return this.CreateObjectProxy(value);\n case Type.Array:\n return this.CreateArrayProxy(value);\n default:\n return value;\n }\n }\n WritePath(path, value) {\n this.UpdatePathCache(path, value);\n const pathParts = path.split(\".\");\n if (pathParts.length === 1) {\n const currentValue = this.rootStateMap.get(pathParts[0]);\n this.rootStateMap.set(pathParts[0], value);\n return currentValue === undefined ? this.undefinedScope : this.scopeCache.get(currentValue);\n }\n let parentValue;\n let x = 0;\n for (; x < pathParts.length - 1 && (x === 0 || parentValue); x++) {\n if (x === 0)\n parentValue = this.rootStateMap.get(pathParts[x]);\n else\n parentValue = parentValue && parentValue[pathParts[x]];\n }\n if (!parentValue)\n throw new Error(\"Unable to write path: \" + path + \". Falsey value found at: \" + pathParts.slice(0, x).join(\".\"));\n const prop = pathParts[x];\n const oldValue = parentValue[prop];\n const oldType = TypeOf(oldValue);\n parentValue[prop] = value;\n if (oldType !== Type.Value || Array.isArray(parentValue))\n return this.scopeCache.get(parentValue) || this.scopeCache.get(oldValue);\n const leafScopes = this.leafScopeCache.get(parentValue);\n return leafScopes && leafScopes[prop] || this.scopeCache.get(parentValue);\n }\n UpdatePathCache(path, value) {\n const type = TypeOf(value);\n if (type === Type.Value)\n return;\n this.pathCache.set(value, path);\n this.proxyCache.delete(value);\n this.scopeCache.delete(value);\n this.leafScopeCache.delete(value);\n const keys = Object.keys(value);\n for (let x = 0; x < keys.length; x++)\n this.UpdatePathCache(`${path}.${keys[x]}`, value[keys[x]]);\n return value;\n }\n}\nexports.ObservableTree = ObservableTree;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableScope = exports.StoreAsync = exports.StoreSync = exports.Store = void 0;\nvar store_1 = require(\"./Store/store\");\nObject.defineProperty(exports, \"Store\", { enumerable: true, get: function () { return store_1.Store; } });\nvar storeSync_1 = require(\"./Store/storeSync\");\nObject.defineProperty(exports, \"StoreSync\", { enumerable: true, get: function () { return storeSync_1.StoreSync; } });\nvar storeAsync_1 = require(\"./Store/storeAsync\");\nObject.defineProperty(exports, \"StoreAsync\", { enumerable: true, get: function () { return storeAsync_1.StoreAsync; } });\nvar observableScope_1 = require(\"./Tree/observableScope\");\nObject.defineProperty(exports, \"ObservableScope\", { enumerable: true, get: function () { return observableScope_1.ObservableScope; } });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Animation = exports.AnimationType = void 0;\nvar StepFunctions;\n(function (StepFunctions) {\n function* EaseIn(count) {\n var diff = 1 / count;\n for (var t = diff, x = 0; x < count; x++, t += diff)\n yield (1 - t) * (1 - t) * (1 - t) * 0 + 3 * (1 - t) * (1 - t) * t * 1 + 3 * (1 - t) * t * t * 1 + t * t * t * 1;\n }\n StepFunctions.EaseIn = EaseIn;\n function* Linear(count) {\n var diff = 1 / count;\n for (var t = diff, x = 0; x < count; x++, t += diff)\n yield t;\n }\n StepFunctions.Linear = Linear;\n})(StepFunctions || (StepFunctions = {}));\nvar AnimationType;\n(function (AnimationType) {\n AnimationType[AnimationType[\"Linear\"] = 0] = \"Linear\";\n AnimationType[AnimationType[\"EaseIn\"] = 1] = \"EaseIn\";\n})(AnimationType || (exports.AnimationType = AnimationType = {}));\nclass Animation {\n type;\n frameCount;\n frameTimings;\n update;\n animationTimeouts;\n running;\n start;\n end;\n enabled;\n get Running() {\n return this.running;\n }\n get Start() {\n return this.start;\n }\n get End() {\n return this.end;\n }\n get Enabled() {\n return this.enabled;\n }\n constructor(type, duration, update) {\n this.running = false;\n this.start = null;\n this.end = null;\n this.enabled = true;\n this.type = type;\n this.frameCount = Math.ceil((duration / 1000) * 60);\n this.frameTimings = [];\n var frameTime = duration / this.frameCount;\n for (var x = 0; x < this.frameCount; x++)\n this.frameTimings[x] = (x + 1) * frameTime;\n this.update = update;\n this.animationTimeouts = [];\n }\n Animate(start, end) {\n if (!this.enabled)\n return;\n var diff = end - start;\n if (diff === 0)\n return;\n this.Cancel();\n this.running = true;\n this.start = start;\n this.end = end;\n return new Promise(resolve => {\n var stepFunc = StepFunctions[AnimationType[this.type]];\n var index = 0;\n for (var step of stepFunc(this.frameCount)) {\n var value = (step * diff) + start;\n this.SetTimeout(index, value, index === (this.frameCount - 1) ? resolve : null);\n index++;\n }\n }).then(() => {\n this.running = false;\n this.start = null;\n this.end = null;\n });\n }\n Disable() {\n this.Cancel();\n this.enabled = false;\n }\n Enable() {\n this.enabled = true;\n }\n Cancel() {\n for (var x = 0; x < this.animationTimeouts.length; x++)\n clearTimeout(this.animationTimeouts[x]);\n this.running = false;\n this.start = null;\n this.end = null;\n }\n Destroy() {\n this.Cancel();\n }\n SetTimeout(index, value, resolve) {\n this.animationTimeouts[index] = setTimeout(() => {\n this.update(value);\n resolve && resolve();\n }, this.frameTimings[index]);\n }\n}\nexports.Animation = Animation;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AsyncQueue = void 0;\nconst list_1 = require(\"./list\");\nclass AsyncQueue {\n running = false;\n queue = list_1.List.Create();\n Next(callback) {\n const ret = new Promise((resolve, reject) => {\n list_1.List.Add(this.queue, async function () {\n try {\n const ret = await callback();\n resolve(ret);\n }\n catch (e) {\n reject(e);\n }\n });\n });\n this.Start();\n return ret;\n }\n Stop() {\n list_1.List.Clear(this.queue);\n }\n Start() {\n if (this.running)\n return;\n this.running = true;\n this.ExecuteQueue();\n }\n async ExecuteQueue() {\n const callback = list_1.List.Pop(this.queue);\n if (callback !== null) {\n await callback();\n this.ExecuteQueue();\n }\n else\n this.running = false;\n }\n}\nexports.AsyncQueue = AsyncQueue;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PreReq = exports.PreReqTemplate = exports.Destroy = exports.Inject = exports.ComputedAsync = exports.Computed = exports.DestroyScope = exports.Scope = exports.StateAsync = exports.StateSync = exports.State = void 0;\nconst store_1 = require(\"../Store/Store/store\");\nconst Store_1 = require(\"../Store\");\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nconst observableTree_1 = require(\"../Store/Tree/observableTree\");\nfunction State() {\n return StateDecorator;\n}\nexports.State = State;\nfunction StateDecorator(target, propertyKey) {\n const propKey = `StoreDecorator_${propertyKey}`;\n DestroyDecorator(target, propKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n const value = store && store.Root.Value;\n if (observableScope_1.ObservableScope.Watching())\n return value;\n return observableTree_1.ObservableTree.UnwrapProxyValues(value);\n },\n set: function (val) {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n if (!store)\n map.set(propKey, new store_1.Store(val));\n else\n store.Merge(val);\n }\n };\n}\nfunction StateSync() {\n return StateSyncDecorator;\n}\nexports.StateSync = StateSync;\nfunction StateSyncDecorator(target, propertyKey) {\n const propKey = `StoreSyncDecorator_${propertyKey}`;\n DestroyDecorator(target, propKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n const value = store && store.Root.Value;\n if (observableScope_1.ObservableScope.Watching())\n return value;\n return observableTree_1.ObservableTree.UnwrapProxyValues(value);\n },\n set: function (val) {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n if (!store)\n map.set(propKey, new Store_1.StoreSync(val));\n else\n store.Merge(val);\n }\n };\n}\nfunction StateAsync() {\n return StateAsyncDecorator;\n}\nexports.StateAsync = StateAsync;\nfunction StateAsyncDecorator(target, propertyKey) {\n const propKey = `StoreAsyncDecorator_${propertyKey}`;\n const scopeKey = `StoreAsyncDecorator_Scope_${propertyKey}`;\n DestroyDecorator(target, propKey);\n DestroyDecorator(target, scopeKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var scope = map.get(scopeKey);\n const value = scope && scope.Value;\n if (observableScope_1.ObservableScope.Watching())\n return value;\n return observableTree_1.ObservableTree.UnwrapProxyValues(value);\n },\n set: function (val) {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n if (!store) {\n store = new Store_1.StoreAsync((val) => val.___id, { ___id: \"ROOT\", data: val });\n map.set(propKey, store);\n map.set(scopeKey, store.Scope(\"ROOT\", val => val.data));\n }\n else\n store.Action(\"ROOT\", async (root, writer) => await writer.Merge(root.data, val));\n }\n };\n}\nfunction Scope() {\n return ScopeDecorator;\n}\nexports.Scope = Scope;\nfunction ScopeDecorator(target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"Scope decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"Scope decorator does not support setters\";\n const propKey = `ScopeDecorator_${propertyKey}`;\n DestroyDecorator(target, propKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var scope = map.get(propKey);\n if (!scope) {\n const getter = descriptor.get.bind(this);\n scope = new observableScope_1.ObservableScope(getter);\n map.set(propKey, scope);\n }\n return scope.Value;\n }\n };\n}\nfunction DestroyScope() {\n return DestroyScopeDecorator;\n}\nexports.DestroyScope = DestroyScope;\nfunction DestroyScopeDecorator(target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"Destroy Scope decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"Destroy Scope decorator does not support setters\";\n const propKey = `ScopeDecorator_${propertyKey}`;\n DestroyDecorator(target, propKey);\n const valKey = `ScopeDecorator_${propertyKey}_Value`;\n DestroyDecorator(target, valKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var scope = map.get(propKey);\n if (!scope) {\n const getter = descriptor.get.bind(this);\n scope = new observableScope_1.ObservableScope(getter);\n map.set(propKey, scope);\n scope.Watch(scope => {\n var lastValue = map.get(valKey);\n lastValue && lastValue.Destroy();\n map.set(valKey, scope.Value);\n });\n }\n return scope.Value;\n }\n };\n}\nfunction Computed() {\n return ComputedDecorator;\n}\nexports.Computed = Computed;\nfunction ComputedDecorator(target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"Computed decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"Computed decorator does not support setters\";\n const scopeKey = `ComputedDecorator_Scope_${propertyKey}`;\n const storeKey = `ComputedDecorator_Store_${propertyKey}`;\n DestroyDecorator(target, scopeKey);\n DestroyDecorator(target, storeKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var store = map.get(storeKey);\n if (!store) {\n const getter = descriptor.get.bind(this);\n const scope = new observableScope_1.ObservableScope(getter);\n store = new Store_1.StoreSync(scope.Value);\n scope.Watch(scope => {\n if (!this.Destroyed)\n store.Write(scope.Value);\n });\n map.set(scopeKey, scope);\n map.set(storeKey, store);\n }\n return store.Root.Value;\n }\n };\n}\nfunction ComputedAsync(idFunc) {\n return ComputedAsyncDecorator.bind(null, idFunc);\n}\nexports.ComputedAsync = ComputedAsync;\nfunction ComputedAsyncDecorator(idFunc, target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"ComputedAsync decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"ComputedAsync decorator does not support setters\";\n const scopeKey = `ComputedDecorator_Scope_${propertyKey}`;\n const storeKey = `ComputedDecorator_Store_${propertyKey}`;\n const storeScopeKey = `ComputedDecorator_StoreScope_${propertyKey}`;\n DestroyDecorator(target, scopeKey);\n DestroyDecorator(target, storeKey);\n DestroyDecorator(target, storeScopeKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var storeScope = map.get(storeScopeKey);\n if (!storeScope) {\n const getter = descriptor.get.bind(this);\n const scope = new observableScope_1.ObservableScope(() => {\n var value = getter();\n if (value && typeof value.toJSON === 'function')\n value = value.toJSON();\n return value;\n });\n const store = new Store_1.StoreAsync((val) => val._id, { _id: \"ROOT\", data: scope.Value });\n scope.Watch(scope => {\n if (!this.Destroyed)\n store.Write({ _id: \"ROOT\", data: scope.Value });\n });\n storeScope = store.Scope(\"ROOT\", (val) => val.data);\n map.set(storeScopeKey, storeScope);\n map.set(scopeKey, scope);\n map.set(storeKey, store);\n }\n return storeScope.Value;\n }\n };\n}\nfunction Inject(type) {\n return InjectorDecorator.bind(null, type);\n}\nexports.Inject = Inject;\nfunction InjectorDecorator(type, target, propertyKey, descriptor) {\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n return this.Injector.Get(type);\n },\n set: function (val) {\n this.Injector.Set(type, val);\n }\n };\n}\nfunction Destroy() {\n return DestroyDecorator;\n}\nexports.Destroy = Destroy;\n(function (Destroy) {\n function Get(value) {\n return value && value.DestroyDecorator_Destroys || [];\n }\n function All(value) {\n var arr = Get(value);\n arr.map(prop => (value[prop] || value.DecoratorMap.get(prop)))\n .filter(o => !!o)\n .forEach(o => o.Destroy());\n }\n Destroy.All = All;\n})(Destroy || (exports.Destroy = Destroy = {}));\nfunction DestroyDecorator(target, propertyKey) {\n var proto = target;\n proto.DestroyDecorator_Destroys = proto.DestroyDecorator_Destroys || [];\n proto.DestroyDecorator_Destroys.push(propertyKey);\n}\nfunction PreReqTemplate(template) {\n return PreReqTemplateDecorator.bind(null, template);\n}\nexports.PreReqTemplate = PreReqTemplate;\n(function (PreReqTemplate) {\n function Get(value) {\n var func = value && value.PreReqTemplateDecorator_Template;\n var ret = func ? func() : [];\n if (!Array.isArray(ret))\n ret = [ret];\n return ret;\n }\n PreReqTemplate.Get = Get;\n})(PreReqTemplate || (exports.PreReqTemplate = PreReqTemplate = {}));\nfunction PreReqTemplateDecorator(template, target) {\n var proto = target.prototype;\n proto.PreReqTemplateDecorator_Template = template;\n}\nfunction PreReq() {\n return PreReqDecorator;\n}\nexports.PreReq = PreReq;\n(function (PreReq) {\n function Get(value) {\n return value && value.PreReqDecorator_PreReqs || [];\n }\n function All(value) {\n var arr = Get(value).map((prop) => (value[prop] && value[prop].Init) || Promise.resolve());\n return Promise.all(arr);\n }\n PreReq.All = All;\n function Has(value) {\n return Get(value).length > 0;\n }\n PreReq.Has = Has;\n})(PreReq || (exports.PreReq = PreReq = {}));\nfunction PreReqDecorator(target, propertyKey) {\n var proto = target;\n proto.PreReqDecorator_PreReqs = proto.PreReqDecorator_PreReqs || [];\n proto.PreReqDecorator_PreReqs.push(propertyKey);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = void 0;\nvar Emitter;\n(function (Emitter) {\n function Create() {\n return new Set();\n }\n Emitter.Create = Create;\n function On(emitter, callback) {\n emitter.add(callback);\n }\n Emitter.On = On;\n function Emit(emitter, ...args) {\n emitter.forEach(function (cb) {\n cb(...args);\n });\n }\n Emitter.Emit = Emit;\n function Remove(emitter, callback) {\n emitter.delete(callback);\n }\n Emitter.Remove = Remove;\n})(Emitter || (exports.Emitter = Emitter = {}));\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./decorators\"), exports);\n__exportStar(require(\"./animation\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Injector = void 0;\nclass Injector {\n parent;\n typeMap;\n constructor() {\n this.parent = Injector.Current();\n this.typeMap = new Map();\n }\n Get(type) {\n if (this.typeMap.size === 0)\n return this.parent && this.parent.Get(type);\n var ret = this.typeMap.get(type);\n if (!ret)\n ret = this.parent && this.parent.Get(type);\n return ret;\n }\n Set(type, instance) {\n this.typeMap.set(type, instance);\n }\n}\nexports.Injector = Injector;\n(function (Injector) {\n var scope = null;\n function Current() {\n return scope;\n }\n Injector.Current = Current;\n function Scope(injector, action, ...args) {\n var parent = Current();\n scope = injector;\n const ret = action(...args);\n scope = parent;\n return ret;\n }\n Injector.Scope = Scope;\n})(Injector || (exports.Injector = Injector = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.List = void 0;\nvar List;\n(function (List) {\n function Create() {\n return {\n head: null,\n tail: null,\n size: 0\n };\n }\n List.Create = Create;\n function Clear(list) {\n list.head = null;\n list.tail = null;\n list.size = 0;\n }\n List.Clear = Clear;\n function Push(list, data) {\n var node = { previous: null, next: null, data: data };\n if (list.size === 0) {\n list.head = node;\n list.tail = node;\n list.size = 1;\n }\n else {\n node.next = list.head;\n list.head.previous = node;\n list.head = node;\n list.size++;\n }\n return node;\n }\n List.Push = Push;\n function Pop(list) {\n if (list.size === 0)\n return null;\n var node = list.head;\n list.head = node.next;\n if (list.head)\n list.head.previous = null;\n list.size--;\n if (list.size === 0)\n list.tail = null;\n return node.data;\n }\n List.Pop = Pop;\n function Add(list, data) {\n const node = { previous: null, next: null, data: data };\n return AddNode(list, node);\n }\n List.Add = Add;\n function AddNode(list, node) {\n if (list.size === 0) {\n list.head = node;\n list.tail = node;\n list.size = 1;\n }\n else {\n node.previous = list.tail;\n list.tail.next = node;\n list.tail = node;\n list.size++;\n }\n return node;\n }\n List.AddNode = AddNode;\n function AddBefore(list, node, data) {\n if (!node)\n return List.Add(list, data);\n var newNode = { previous: null, next: null, data: data };\n var prevNode = node.previous;\n newNode.next = node;\n node.previous = newNode;\n if (list.head === node)\n list.head = newNode;\n if (prevNode) {\n prevNode.next = newNode;\n newNode.previous = prevNode;\n }\n list.size++;\n return newNode;\n }\n List.AddBefore = AddBefore;\n function AddAfter(list, node, data) {\n if (!node)\n return List.Push(list, data);\n var newNode = { previous: null, next: null, data: data };\n var nextNode = node.next;\n node.next = newNode;\n newNode.previous = node;\n if (list.tail === node)\n list.tail = newNode;\n if (nextNode) {\n nextNode.previous = newNode;\n newNode.next = nextNode;\n }\n list.size++;\n return newNode;\n }\n List.AddAfter = AddAfter;\n function Remove(list) {\n if (list.size === 0)\n return null;\n var node = list.tail;\n list.tail = node.previous;\n if (list.tail)\n list.tail.next = null;\n list.size--;\n if (list.size === 0)\n list.head = null;\n return node.data;\n }\n List.Remove = Remove;\n function RemoveNode(list, node) {\n if (list.head === node) {\n list.head = node.next;\n }\n else if (list.tail === node) {\n list.tail = node.previous;\n }\n else {\n const prev = node.previous;\n const next = node.next;\n prev.next = next;\n next.previous = prev;\n }\n node.next = node.previous = null;\n list.size--;\n if (list.size > 0)\n list.head.previous = list.tail.next = null;\n }\n List.RemoveNode = RemoveNode;\n function ForEach(list, callback) {\n var node = list.head;\n while (node) {\n callback(node.data);\n node = node.next;\n }\n }\n List.ForEach = ForEach;\n function ToNodeMap(list, keyCallback) {\n const map = new Map();\n let node = list.head;\n while (node) {\n const key = keyCallback(node.data);\n const nodes = map.get(key) || [node];\n if (nodes[0] !== node)\n nodes.push(node);\n else\n map.set(key, nodes);\n node = node.next;\n }\n return map;\n }\n List.ToNodeMap = ToNodeMap;\n})(List || (exports.List = List = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ThreadAsync = exports.Thread = exports.Synch = exports.Callback = exports.After = exports.Schedule = void 0;\nconst list_1 = require(\"./list\");\nconst workTimeMs = 16;\nconst contextQueue = list_1.List.Create();\nvar threadContext = null;\nvar timeoutRunning = false;\nfunction ProcessQueue() {\n var workEndTime = Date.now() + workTimeMs;\n var ctx;\n while (Date.now() < workEndTime && (ctx = list_1.List.Pop(contextQueue)))\n DoWork(ctx, workEndTime);\n if (contextQueue.size > 0)\n setTimeout(ProcessQueue);\n else\n timeoutRunning = false;\n}\nfunction ScheduleWork(ctx) {\n list_1.List.Add(contextQueue, ctx);\n if (timeoutRunning)\n return;\n timeoutRunning = true;\n setTimeout(ProcessQueue);\n}\nfunction Invoke(ctx, callback) {\n var parent = ctx.workEndNode;\n ctx.workEndNode = ctx.workList.head;\n callback();\n ctx.workEndNode = parent;\n}\nfunction DoWork(ctx, workEndTime = Date.now() + workTimeMs) {\n var parentContext = threadContext;\n threadContext = ctx;\n var async = ctx.async;\n var callback;\n while (async === ctx.async && Date.now() < workEndTime && (callback = list_1.List.Pop(ctx.workList)))\n Invoke(ctx, callback);\n if (ctx.workList.size > 0)\n ScheduleWork(ctx);\n threadContext = parentContext;\n}\nfunction CreateContext() {\n return {\n async: false,\n workEndNode: null,\n workList: list_1.List.Create()\n };\n}\nfunction ScheduleCallback(callback, before, async) {\n threadContext = threadContext || CreateContext();\n threadContext.async = threadContext.async || async;\n if (before)\n list_1.List.AddBefore(threadContext.workList, threadContext.workEndNode, callback);\n else if (threadContext.workEndNode)\n list_1.List.AddAfter(threadContext.workList, threadContext.workEndNode, callback);\n else\n threadContext.workEndNode = list_1.List.Add(threadContext.workList, callback);\n}\nfunction SynchWithoutThread(callback) {\n var workEndTime = Date.now() + workTimeMs;\n callback();\n if (threadContext)\n if (threadContext.async)\n ScheduleWork(threadContext);\n else\n DoWork(threadContext, workEndTime);\n threadContext = null;\n}\nfunction Schedule(callback) {\n ScheduleCallback(callback, true, true);\n}\nexports.Schedule = Schedule;\nfunction After(callback) {\n ScheduleCallback(callback, false, false);\n}\nexports.After = After;\nfunction Callback(callback) {\n return function (a, b, c, d) {\n Schedule(function () { callback(a, b, c, d); });\n };\n}\nexports.Callback = Callback;\nvar inSynchCallback = false;\nfunction Synch(callback) {\n if (threadContext || inSynchCallback)\n callback();\n else {\n inSynchCallback = true;\n SynchWithoutThread(callback);\n inSynchCallback = false;\n }\n}\nexports.Synch = Synch;\nfunction Thread(callback) {\n if (threadContext)\n ScheduleCallback(callback, true, false);\n else\n Synch(callback);\n}\nexports.Thread = Thread;\nfunction ThreadAsync(callback) {\n return new Promise(resolve => Thread(function () {\n callback();\n Thread(resolve);\n }));\n}\nexports.ThreadAsync = ThreadAsync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nvar component_1 = require(\"./Node/component\");\nObject.defineProperty(exports, \"Component\", { enumerable: true, get: function () { return component_1.Component; } });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreAsync = exports.Store = exports.ObservableScope = void 0;\n__exportStar(require(\"./index\"), exports);\n__exportStar(require(\"./Utils\"), exports);\nvar Store_1 = require(\"./Store\");\nObject.defineProperty(exports, \"ObservableScope\", { enumerable: true, get: function () { return Store_1.ObservableScope; } });\nObject.defineProperty(exports, \"Store\", { enumerable: true, get: function () { return Store_1.Store; } });\nObject.defineProperty(exports, \"StoreAsync\", { enumerable: true, get: function () { return Store_1.StoreAsync; } });\n__exportStar(require(\"./DOM\"), exports);\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst Web = require(\"./web.export\");\nfor (var key in Web)\n window[key] = Web[key];\n"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"jTemplates.js","mappings":"wDAaA,SAASA,EAAkBC,EAAQC,EAASC,EAAMC,GAC9C,MAAMC,EAAQF,EACdD,EAAQE,KAZZ,SAAqBH,EAAQG,GACzB,IAAIE,EACJ,OAAO,SAAgBD,GACfA,IAAUC,IACVA,GAAaL,EAAOM,oBAAoBH,EAAOE,GAC/CD,GAASJ,EAAOO,iBAAiBJ,EAAOC,GACxCC,EAAYD,EAEpB,CACJ,CAGuBI,CAAYR,EAAQG,GACvCF,EAAQE,GAAOC,EACnB,CAhBAK,OAAOC,eAAeC,EAAS,aAAc,CAAEP,OAAO,IACtDO,EAAQC,sBAgBR,SAA+BZ,GAC3B,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,OAAOC,eAAeC,EAAS,aAAc,CAAEgI,YAAY,EAAMC,IAAK,WAAc,OAAOqJ,EAAQwH,UAAY,IAC/GhZ,OAAOC,eAAeC,EAAS,iBAAkB,CAAEgI,YAAY,EAAMC,IAAK,WAAc,OAAOqJ,EAAQiK,cAAgB,IACvHzb,OAAOC,eAAeC,EAAS,qBAAsB,CAAEgI,YAAY,EAAMC,IAAK,WAAc,OAAOqJ,EAAQyJ,kBAAoB,IAC/H7S,EAAa,EAAQ,KAAUlI,E,GCxB3B+nB,yBAA2B,CAAC,EAGhC,SAASC,oBAAoBC,GAE5B,IAAIC,EAAeH,yBAAyBE,GAC5C,QAAqB5nB,IAAjB6nB,EACH,OAAOA,EAAaloB,QAGrB,IAAImoB,EAASJ,yBAAyBE,GAAY,CAGjDjoB,QAAS,CAAC,GAOX,OAHAooB,oBAAoBH,GAAU5f,KAAK8f,EAAOnoB,QAASmoB,EAAQA,EAAOnoB,QAASgoB,qBAGpEG,EAAOnoB,OACf,C,iCCpBA,MAAMqoB,EAAM,oBAAQ,KACpB,IAAK,IAAIpf,KAAOof,EACZ3f,OAAOO,GAAOof,EAAIpf,E","sources":["webpack://j-templates/./src/DOM/createEventAssignment.ts","webpack://j-templates/./src/DOM/createPropertyAssignment.ts","webpack://j-templates/./src/DOM/domNodeConfig.ts","webpack://j-templates/./src/DOM/elements.ts","webpack://j-templates/./src/DOM/index.ts","webpack://j-templates/./src/DOM/svgElements.ts","webpack://j-templates/./src/DOM/window.ts","webpack://j-templates/./src/Node/boundNode.ts","webpack://j-templates/./src/Node/component.ts","webpack://j-templates/./src/Node/componentNode.ts","webpack://j-templates/./src/Node/elementNode.ts","webpack://j-templates/./src/Node/nodeConfig.ts","webpack://j-templates/./src/Node/nodeRef.ts","webpack://j-templates/./src/Store/Diff/diffAsync.ts","webpack://j-templates/./src/Store/Diff/diffSync.ts","webpack://j-templates/./src/Store/Diff/diffTree.ts","webpack://j-templates/./src/Store/Diff/diffWorker.ts","webpack://j-templates/./src/Store/Diff/workerQueue.ts","webpack://j-templates/./src/Store/Store/store.ts","webpack://j-templates/./src/Store/Store/storeAsync.ts","webpack://j-templates/./src/Store/Store/storeAsyncWriter.ts","webpack://j-templates/./src/Store/Store/storeSync.ts","webpack://j-templates/./src/Store/Store/storeSyncWriter.ts","webpack://j-templates/./src/Store/Store/storeWriter.ts","webpack://j-templates/./src/Store/Tree/observableComputed.ts","webpack://j-templates/./src/Store/Tree/observableNode.ts","webpack://j-templates/./src/Store/Tree/observableScope.ts","webpack://j-templates/./src/Store/Tree/observableTree.ts","webpack://j-templates/./src/Store/index.ts","webpack://j-templates/./src/Utils/animation.ts","webpack://j-templates/./src/Utils/asyncQueue.ts","webpack://j-templates/./src/Utils/decorators.ts","webpack://j-templates/./src/Utils/emitter.ts","webpack://j-templates/./src/Utils/index.ts","webpack://j-templates/./src/Utils/injector.ts","webpack://j-templates/./src/Utils/json.ts","webpack://j-templates/./src/Utils/list.ts","webpack://j-templates/./src/Utils/thread.ts","webpack://j-templates/./src/index.ts","webpack://j-templates/./src/web.export.ts","webpack://j-templates/webpack/bootstrap","webpack://j-templates/./src/web.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CreateEventAssignment = CreateEventAssignment;\nfunction AssignEvent(target, event) {\n let lastValue;\n return function Assign(value) {\n if (value !== lastValue) {\n lastValue && target.removeEventListener(event, lastValue);\n value && target.addEventListener(event, value);\n lastValue = value;\n }\n };\n}\nfunction DefaultAssignment(target, writeTo, next, event) {\n const value = next;\n writeTo[event] ??= AssignEvent(target, event);\n writeTo[event](value);\n}\nfunction CreateEventAssignment(target) {\n let priorKeys;\n const writeTo = {};\n return function AssignNext(next) {\n const nextKeys = next !== null ? Object.keys(next) : [];\n const keys = priorKeys === undefined ? nextKeys : nextKeys.concat(priorKeys);\n priorKeys = nextKeys;\n for (let x = 0; x < keys.length; x++)\n DefaultAssignment(target, writeTo, next && next[keys[x]], keys[x]);\n };\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CreateNodeValueAssignment = CreateNodeValueAssignment;\nexports.CreatePropertyAssignment = CreatePropertyAssignment;\nconst json_1 = require(\"../Utils/json\");\nfunction AssignProp(target, prop) {\n let lastValue = target[prop];\n return function Assign(value) {\n if (value !== lastValue) {\n target[prop] = value;\n lastValue = value;\n }\n };\n}\nfunction CreateNodeValueAssignment(target) {\n let lastValue = target.nodeValue;\n return function AssignNodeValue(value) {\n if (value.nodeValue !== lastValue) {\n target.nodeValue = value.nodeValue;\n lastValue = value.nodeValue;\n }\n };\n}\nfunction CreateValueAssignment(target) {\n let lastValue = target.value;\n target.addEventListener('blur', function () {\n target.value = lastValue;\n });\n return function AssignValue(value) {\n if (value !== lastValue) {\n const start = target.selectionStart;\n const end = target.selectionEnd;\n target.value = value;\n if (target.ownerDocument.activeElement === target)\n target.setSelectionRange(start, end);\n lastValue = value;\n }\n };\n}\nfunction ValueAssignment(target, writeTo, next) {\n writeTo.value ??= CreateValueAssignment(target);\n writeTo.value(next.value);\n}\nfunction DefaultAssignment(target, writeTo, next, prop) {\n const value = next[prop];\n writeTo[prop] ??= (0, json_1.JsonType)(value) === 'value' ?\n AssignProp(target, prop) :\n CreatePropertyAssignment(target[prop], false);\n writeTo[prop](value);\n}\nfunction CreatePropertyAssignment(target, root = true) {\n const writeTo = {};\n return function AssignNext(next) {\n const keys = Object.keys(next);\n for (let x = 0; x < keys.length; x++) {\n switch (root) {\n case true: {\n switch (keys[x]) {\n case 'value':\n ValueAssignment(target, writeTo, next);\n break;\n default:\n DefaultAssignment(target, writeTo, next, keys[x]);\n break;\n }\n break;\n }\n default:\n DefaultAssignment(target, writeTo, next, keys[x]);\n break;\n }\n }\n };\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DOMNodeConfig = void 0;\nconst window_1 = require(\"./window\");\nconst list_1 = require(\"../Utils/list\");\nconst createPropertyAssignment_1 = require(\"./createPropertyAssignment\");\nconst createEventAssignment_1 = require(\"./createEventAssignment\");\nlet pendingUpdates = list_1.List.Create();\nlet updateScheduled = false;\nconst updateMs = 16;\nfunction processUpdates() {\n list_1.List.Add(pendingUpdates, null);\n const start = Date.now();\n let callback;\n while ((callback = list_1.List.Pop(pendingUpdates)))\n callback();\n if (pendingUpdates.size === 0)\n updateScheduled = false;\n else if (Date.now() - start < updateMs)\n processUpdates();\n else\n window_1.wndw.requestAnimationFrame(processUpdates);\n}\nexports.DOMNodeConfig = {\n createNode(type, namespace) {\n return namespace ?\n window_1.wndw.document.createElementNS(namespace, type) :\n window_1.wndw.document.createElement(type);\n },\n createTextNode(value = '') {\n return window_1.wndw.document.createTextNode(value);\n },\n scheduleUpdate(callback) {\n list_1.List.Add(pendingUpdates, callback);\n if (!updateScheduled) {\n updateScheduled = true;\n window_1.wndw.requestAnimationFrame(processUpdates);\n }\n },\n addListener(target, type, callback) {\n target.addEventListener(type, callback);\n },\n removeListener(target, type, callback) {\n target.removeEventListener(type, callback);\n },\n addChild(root, child) {\n root.appendChild(child);\n },\n addChildFirst(root, child) {\n exports.DOMNodeConfig.addChildBefore(root, root.firstChild, child);\n },\n addChildBefore(root, sibling, child) {\n if (!sibling) {\n exports.DOMNodeConfig.addChild(root, child);\n return;\n }\n if (child !== sibling)\n root.insertBefore(child, sibling);\n },\n addChildAfter(root, sibling, child) {\n if (!sibling) {\n exports.DOMNodeConfig.addChildFirst(root, child);\n return;\n }\n exports.DOMNodeConfig.addChildBefore(root, sibling.nextSibling, child);\n },\n removeChild(root, child) {\n root.removeChild(child);\n },\n remove(target) {\n target && target.parentNode && target.parentNode.removeChild(target);\n },\n setText(target, text) {\n target.textContent = text;\n },\n getAttribute(target, attribute) {\n return target.getAttribute(attribute);\n },\n setAttribute(target, attribute, value) {\n target.setAttribute(attribute, value);\n },\n createPropertyAssignment(target) {\n if (target.nodeType === Node.TEXT_NODE)\n return (0, createPropertyAssignment_1.CreateNodeValueAssignment)(target);\n return (0, createPropertyAssignment_1.CreatePropertyAssignment)(target);\n },\n createEventAssignment(target) {\n return (0, createEventAssignment_1.CreateEventAssignment)(target);\n },\n fireEvent(target, event, data) {\n var cEvent = new CustomEvent(event, data);\n target.dispatchEvent(cEvent);\n },\n getFirstChild(target) {\n return target.firstChild;\n },\n getLastChild(target) {\n return target.lastChild;\n },\n getNextSibling(target) {\n return target.nextSibling;\n },\n replaceChildren(target, children) {\n target.replaceChildren(...children);\n },\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.div = div;\nexports.a = a;\nexports.ul = ul;\nexports.li = li;\nexports.br = br;\nexports.b = b;\nexports.span = span;\nexports.img = img;\nexports.video = video;\nexports.source = source;\nexports.input = input;\nexports.textarea = textarea;\nexports.select = select;\nexports.option = option;\nexports.h1 = h1;\nexports.h2 = h2;\nexports.h3 = h3;\nexports.p = p;\nexports.style = style;\nexports.button = button;\nexports.table = table;\nexports.th = th;\nexports.tr = tr;\nexports.td = td;\nconst elementNode_1 = require(\"../Node/elementNode\");\nfunction div(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"div\", null, nodeDef, children);\n}\nfunction a(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"a\", null, nodeDef, children);\n}\nfunction ul(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"ul\", null, nodeDef, children);\n}\nfunction li(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"li\", null, nodeDef, children);\n}\nfunction br(nodeDef) {\n return elementNode_1.ElementNode.Create(\"br\", null, nodeDef, null);\n}\nfunction b(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"b\", null, nodeDef, children);\n}\nfunction span(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"span\", null, nodeDef, children);\n}\nfunction img(nodeDef) {\n return elementNode_1.ElementNode.Create(\"img\", null, nodeDef, null);\n}\nfunction video(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"video\", null, nodeDef, children);\n}\nfunction source(nodeDef) {\n return elementNode_1.ElementNode.Create(\"source\", null, nodeDef, null);\n}\nfunction input(nodeDef) {\n return elementNode_1.ElementNode.Create(\"input\", null, nodeDef, null);\n}\nfunction textarea(nodeDef) {\n return elementNode_1.ElementNode.Create(\"textarea\", null, nodeDef, null);\n}\nfunction select(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"select\", null, nodeDef, children);\n}\nfunction option(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"option\", null, nodeDef, children);\n}\nfunction h1(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"h1\", null, nodeDef, children);\n}\nfunction h2(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"h2\", null, nodeDef, children);\n}\nfunction h3(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"h3\", null, nodeDef, children);\n}\nfunction p(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"p\", null, nodeDef, children);\n}\nfunction style(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"style\", null, nodeDef, children);\n}\nfunction button(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"button\", null, nodeDef, children);\n}\nfunction table(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"table\", null, nodeDef, children);\n}\nfunction th(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"th\", null, nodeDef, children);\n}\nfunction tr(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"tr\", null, nodeDef, children);\n}\nfunction td(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"td\", null, nodeDef, children);\n}\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./elements\"), exports);\n__exportStar(require(\"./svgElements\"), exports);\n__exportStar(require(\"./createPropertyAssignment\"), exports);\n__exportStar(require(\"./createEventAssignment\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.svg = svg;\nexports.g = g;\nexports.circle = circle;\nconst elementNode_1 = require(\"../Node/elementNode\");\nconst svgNs = \"http://www.w3.org/2000/svg\";\nfunction svg(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"svg\", svgNs, nodeDef, children);\n}\nfunction g(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"g\", svgNs, nodeDef, children);\n}\nfunction circle(nodeDef, children) {\n return elementNode_1.ElementNode.Create(\"circle\", svgNs, nodeDef, children);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.wndw = void 0;\nexports.wndw = typeof window !== \"undefined\" ? window : (new (require(\"jsdom\").JSDOM(\"\")).window);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BoundNode = void 0;\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nvar BoundNode;\n(function (BoundNode) {\n function Init(boundNode) {\n const nodeDef = boundNode.nodeDef;\n if (nodeDef.props) {\n const scope = observableScope_1.ObservableScope.Create(nodeDef.props);\n boundNode.scopes ??= [];\n boundNode.scopes.push(scope);\n boundNode.assignProperties = nodeConfig_1.NodeConfig.createPropertyAssignment(boundNode.node);\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetProperties(boundNode, scope); });\n const next = observableScope_1.ObservableScope.Value(scope);\n boundNode.assignProperties(next);\n }\n if (nodeDef.attrs) {\n const scope = observableScope_1.ObservableScope.Create(nodeDef.attrs);\n boundNode.scopes ??= [];\n boundNode.scopes.push(scope);\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetAttributes(boundNode, scope); });\n SetAttributes(boundNode, observableScope_1.ObservableScope.Value(scope));\n }\n if (nodeDef.on) {\n const scope = observableScope_1.ObservableScope.Create(nodeDef.on);\n boundNode.scopes ??= [];\n boundNode.scopes.push(scope);\n boundNode.assignEvents = nodeConfig_1.NodeConfig.createEventAssignment(boundNode.node);\n observableScope_1.ObservableScope.Watch(scope, function (scope) { ScheduleSetEvents(boundNode, scope); });\n const next = observableScope_1.ObservableScope.Value(scope);\n boundNode.assignEvents(next);\n }\n }\n BoundNode.Init = Init;\n})(BoundNode || (exports.BoundNode = BoundNode = {}));\nfunction ScheduleSetProperties(node, scope) {\n if (node.setProperties)\n return;\n node.setProperties = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setProperties = false;\n if (node.destroyed)\n return;\n const next = observableScope_1.ObservableScope.Value(scope);\n node.assignProperties(next);\n });\n}\nfunction ScheduleSetAttributes(node, scope) {\n if (node.setAttributes)\n return;\n node.setAttributes = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setAttributes = false;\n if (node.destroyed)\n return;\n SetAttributes(node, observableScope_1.ObservableScope.Value(scope));\n });\n}\nfunction SetAttributes(node, attributes) {\n if (!attributes)\n return;\n for (var key in attributes) {\n var val = nodeConfig_1.NodeConfig.getAttribute(node.node, key);\n if (val !== attributes[key])\n nodeConfig_1.NodeConfig.setAttribute(node.node, key, attributes[key]);\n }\n}\nfunction ScheduleSetEvents(node, scope) {\n if (node.setEvents)\n return;\n node.setEvents = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setEvents = false;\n if (node.destroyed)\n return;\n const next = observableScope_1.ObservableScope.Value(scope);\n node.assignEvents(next);\n });\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nconst nodeRef_1 = require(\"./nodeRef\");\nconst componentNode_1 = require(\"./componentNode\");\nconst decorators_1 = require(\"../Utils/decorators\");\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nclass Component {\n nodeRef;\n componentEvents;\n scope;\n templates;\n decoratorMap;\n get Injector() {\n return this.nodeRef.injector;\n }\n get Destroyed() {\n return this.nodeRef.destroyed;\n }\n get DecoratorMap() {\n return this.decoratorMap;\n }\n get Scope() {\n return this.scope;\n }\n get Data() {\n return this.scope.Value;\n }\n get NodeRef() {\n return this.nodeRef;\n }\n get Templates() {\n return this.templates;\n }\n constructor(data, templates, nodeRef, componentEvents) {\n this.nodeRef = nodeRef;\n this.componentEvents = componentEvents;\n this.scope = new observableScope_1.ObservableScope(data);\n this.templates = templates || {};\n this.decoratorMap = new Map();\n }\n Template() {\n return [];\n }\n Bound() {\n }\n Fire(event, data) {\n var eventCallback = this.componentEvents && this.componentEvents[event];\n eventCallback && eventCallback(data);\n }\n Destroy() {\n this.scope.Destroy();\n decorators_1.Destroy.All(this);\n }\n}\nexports.Component = Component;\n(function (Component) {\n function ToFunction(type, namespace, constructor) {\n return componentNode_1.ComponentNode.ToFunction(type, namespace, constructor);\n }\n Component.ToFunction = ToFunction;\n function Register(name, constructor) {\n const componentFunction = ToFunction(`${name}-component`, undefined, constructor);\n class WebComponent extends HTMLElement {\n constructor() {\n super();\n const shadowRoot = this.attachShadow({ mode: 'open' });\n const node = componentFunction({});\n Attach(shadowRoot, node);\n }\n }\n customElements.define(name, WebComponent);\n }\n Component.Register = Register;\n function Attach(node, nodeRef) {\n nodeRef_1.NodeRef.Init(nodeRef);\n var rootRef = nodeRef_1.NodeRef.Wrap(node);\n nodeRef_1.NodeRef.AddChild(rootRef, nodeRef);\n }\n Component.Attach = Attach;\n})(Component || (exports.Component = Component = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ComponentNode = void 0;\nconst boundNode_1 = require(\"./boundNode\");\nconst nodeRef_1 = require(\"./nodeRef\");\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst component_1 = require(\"./component\");\nconst injector_1 = require(\"../Utils/injector\");\nconst decorators_1 = require(\"../Utils/decorators\");\nconst thread_1 = require(\"../Utils/thread\");\nconst list_1 = require(\"../Utils/list\");\nvar ComponentNode;\n(function (ComponentNode) {\n function Fire(event, data) {\n var eventCallback = this.componentEvents && this.componentEvents[event];\n eventCallback && eventCallback(data);\n }\n ComponentNode.Fire = Fire;\n function ToFunction(type, namespace, constructor) {\n return function (nodeDef, templates) {\n return Create(type, namespace, nodeDef, constructor, templates);\n };\n }\n ComponentNode.ToFunction = ToFunction;\n function Init(componentNode) {\n var nodeDef = componentNode.nodeDef;\n var events = nodeDef.on;\n nodeDef.on = null;\n componentNode.component = new componentNode.constructor(nodeDef.data, componentNode.templates, componentNode, events);\n SetChildren(componentNode);\n boundNode_1.BoundNode.Init(componentNode);\n }\n ComponentNode.Init = Init;\n})(ComponentNode || (exports.ComponentNode = ComponentNode = {}));\nfunction Create(type, namespace, nodeDef, constructor, templates) {\n var compNode = nodeRef_1.NodeRef.Create(type, namespace, nodeRef_1.NodeRefType.ComponentNode);\n compNode.nodeDef = nodeDef;\n compNode.constructor = constructor;\n compNode.templates = templates;\n return compNode;\n}\nfunction SetChildren(node) {\n if (decorators_1.PreReq.Has(node.component)) {\n AddPreReqTemplate(node).then(function () {\n AddTemplate(node, false);\n });\n }\n else\n AddTemplate(node, true);\n}\nfunction AddPreReqTemplate(node) {\n return new Promise(resolve => {\n (0, thread_1.Thread)(function () {\n const preNodes = injector_1.Injector.Scope(node.injector, decorators_1.PreReqTemplate.Get, node.component);\n (0, thread_1.Schedule)(function () {\n if (node.destroyed)\n return;\n nodeRef_1.NodeRef.InitAll(node, preNodes);\n });\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n for (var x = 0; x < preNodes.length; x++)\n nodeRef_1.NodeRef.AddChild(node, preNodes[x]);\n decorators_1.PreReq.All(node.component).then(function () {\n if (node.destroyed)\n return;\n for (var x = 0; x < preNodes.length; x++)\n nodeRef_1.NodeRef.Destroy(preNodes[x]);\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n if (node.destroyed)\n return;\n for (var x = 0; x < preNodes.length; x++)\n nodeRef_1.NodeRef.DetachChild(node, preNodes[x]);\n resolve();\n });\n });\n });\n });\n });\n}\nfunction InvokeNodeTemplate(node) {\n const nodes = node.component.Template();\n if (!Array.isArray(nodes))\n return [nodes];\n return nodes;\n}\nfunction AddTemplate(node, init) {\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n const nodes = injector_1.Injector.Scope(node.injector, InvokeNodeTemplate, node);\n (0, thread_1.Schedule)(function () {\n nodeRef_1.NodeRef.InitAll(node, nodes);\n });\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n const list = list_1.List.Create();\n list_1.List.Add(list, {\n value: undefined,\n init: true,\n nodes\n });\n if (init)\n nodeRef_1.NodeRef.ReconcileChildren(node, list);\n else\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n if (node.destroyed)\n return;\n nodeRef_1.NodeRef.ReconcileChildren(node, list);\n });\n });\n if (node.component.Bound !== component_1.Component.prototype.Bound)\n (0, thread_1.After)(function () {\n nodeConfig_1.NodeConfig.scheduleUpdate(() => setTimeout(() => node.component.Bound(), 0));\n });\n });\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ElementNode = void 0;\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nconst injector_1 = require(\"../Utils/injector\");\nconst list_1 = require(\"../Utils/list\");\nconst thread_1 = require(\"../Utils/thread\");\nconst boundNode_1 = require(\"./boundNode\");\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst nodeRef_1 = require(\"./nodeRef\");\nvar ElementNode;\n(function (ElementNode) {\n function Create(type, namespace, nodeDef, children) {\n var elemNode = nodeRef_1.NodeRef.Create(type, namespace, nodeRef_1.NodeRefType.ElementNode);\n elemNode.nodeDef = nodeDef;\n elemNode.childrenFunc = children;\n return elemNode;\n }\n ElementNode.Create = Create;\n function Init(elementNode) {\n if (elementNode.childrenFunc) {\n var nodeDef = elementNode.nodeDef;\n if (nodeDef.data) {\n const dataScope = observableScope_1.ObservableScope.Create(nodeDef.data);\n elementNode.childNodes = new Set();\n elementNode.scopes ??= [];\n elementNode.scopes.push(dataScope);\n observableScope_1.ObservableScope.Watch(dataScope, function () {\n ScheduleSetData(elementNode, dataScope);\n });\n SetData(elementNode, GetValue(dataScope), true);\n }\n else\n SetDefaultData(elementNode);\n }\n boundNode_1.BoundNode.Init(elementNode);\n }\n ElementNode.Init = Init;\n})(ElementNode || (exports.ElementNode = ElementNode = {}));\nconst valueDefault = [];\nfunction GetValue(dataScope) {\n var value = observableScope_1.ObservableScope.Value(dataScope);\n if (!value)\n return valueDefault;\n if (!Array.isArray(value))\n value = [value];\n return value;\n}\nfunction ScheduleSetData(node, scope) {\n if (node.setData)\n return;\n node.setData = true;\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n node.setData = false;\n if (node.destroyed)\n return;\n SetData(node, GetValue(scope));\n });\n}\nfunction SetDefaultData(node) {\n (0, thread_1.Synch)(function () {\n const nodes = injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, true);\n if (nodes.length > 0) {\n nodeRef_1.NodeRef.InitAll(node, nodes);\n (0, thread_1.Thread)(function () {\n if (node.destroyed)\n return;\n const defaultNodeList = list_1.List.Create();\n list_1.List.Add(defaultNodeList, {\n value: null,\n init: true,\n nodes\n });\n nodeRef_1.NodeRef.ReconcileChildren(node, defaultNodeList);\n });\n }\n });\n}\nfunction GetDataValue(data) {\n return data.value;\n}\nfunction ReconcileNodeData(node, values) {\n const nextNodeList = list_1.List.Create();\n const initNodeList = list_1.List.Create();\n const currentNodeList = node.nodeList;\n const nodeMap = currentNodeList && list_1.List.ToNodeMap(currentNodeList, GetDataValue);\n for (let x = 0; x < values.length; x++) {\n let curNode;\n if (nodeMap) {\n const nodeArr = nodeMap.get(values[x]);\n if (nodeArr) {\n let y = nodeArr.length - 1;\n for (; y >= 0 && !curNode; y--) {\n curNode = nodeArr[y];\n nodeArr[y] = null;\n }\n }\n }\n if (curNode) {\n list_1.List.RemoveNode(currentNodeList, curNode);\n list_1.List.AddNode(nextNodeList, curNode);\n if (!curNode.data.init)\n list_1.List.Add(initNodeList, curNode.data);\n }\n else {\n curNode = list_1.List.Add(nextNodeList, {\n value: values[x],\n init: false,\n nodes: injector_1.Injector.Scope(node.injector, CreateNodeArray, node.childrenFunc, values[x])\n });\n list_1.List.Add(initNodeList, curNode.data);\n }\n }\n let curNode = initNodeList.head;\n while (curNode) {\n const data = curNode.data;\n (0, thread_1.Schedule)(function () {\n if (node.destroyed || nextNodeList.size === 0)\n return;\n nodeRef_1.NodeRef.InitAll(node, data.nodes);\n data.init = true;\n });\n curNode = curNode.next;\n }\n if (currentNodeList) {\n let curDetach = currentNodeList.head;\n while (curDetach) {\n const data = curDetach.data;\n curDetach = curDetach.next;\n for (let x = 0; x < data.nodes.length; x++)\n node.childNodes.delete(data.nodes[x]);\n nodeRef_1.NodeRef.DestroyAll(data.nodes);\n }\n list_1.List.Clear(currentNodeList);\n }\n node.nodeList = nextNodeList;\n}\nfunction SetData(node, values, init = false) {\n (0, thread_1.Synch)(function () {\n ReconcileNodeData(node, values);\n const attachNodes = node.nodeList;\n const startSize = attachNodes.size;\n (0, thread_1.Thread)(function (async) {\n if (node.destroyed)\n return;\n if (init || !async)\n nodeRef_1.NodeRef.ReconcileChildren(node, attachNodes);\n else\n nodeConfig_1.NodeConfig.scheduleUpdate(function () {\n if (node.destroyed || attachNodes.size !== startSize)\n return;\n nodeRef_1.NodeRef.ReconcileChildren(node, attachNodes);\n });\n });\n });\n}\nfunction CreateNodeArray(childrenFunc, value) {\n const newNodes = childrenFunc(value);\n if (typeof newNodes === \"string\" || !newNodes) {\n const textNode = nodeRef_1.NodeRef.Create(\"text\", null, nodeRef_1.NodeRefType.BoundNode);\n textNode.nodeDef = {\n props: function () {\n return { nodeValue: childrenFunc(value) };\n }\n };\n return [textNode];\n }\n if (Array.isArray(newNodes))\n return newNodes;\n return [newNodes];\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeConfig = void 0;\nconst domNodeConfig_1 = require(\"../DOM/domNodeConfig\");\nexports.NodeConfig = domNodeConfig_1.DOMNodeConfig;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeRef = exports.NodeRefType = void 0;\nconst nodeConfig_1 = require(\"./nodeConfig\");\nconst injector_1 = require(\"../Utils/injector\");\nconst boundNode_1 = require(\"./boundNode\");\nconst elementNode_1 = require(\"./elementNode\");\nconst componentNode_1 = require(\"./componentNode\");\nconst Store_1 = require(\"../Store\");\nvar NodeRefType;\n(function (NodeRefType) {\n NodeRefType[NodeRefType[\"NodeRef\"] = 0] = \"NodeRef\";\n NodeRefType[NodeRefType[\"BoundNode\"] = 1] = \"BoundNode\";\n NodeRefType[NodeRefType[\"ElementNode\"] = 2] = \"ElementNode\";\n NodeRefType[NodeRefType[\"ComponentNode\"] = 3] = \"ComponentNode\";\n})(NodeRefType || (exports.NodeRefType = NodeRefType = {}));\nvar NodeRef;\n(function (NodeRef) {\n function Wrap(node) {\n var nodeRef = Create(null, null, NodeRefType.NodeRef);\n nodeRef.node = node;\n nodeRef.childNodes = new Set();\n return nodeRef;\n }\n NodeRef.Wrap = Wrap;\n function Create(nodeType, namespace, type) {\n switch (type) {\n case NodeRefType.NodeRef:\n return {\n node: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.NodeRef,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false\n };\n case NodeRefType.BoundNode:\n return {\n node: null,\n nodeDef: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.BoundNode,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n lastEvents: null,\n setProperties: false,\n assignProperties: null,\n assignEvents: null,\n setAttributes: false,\n setEvents: false,\n scopes: null\n };\n case NodeRefType.ElementNode:\n return {\n node: null,\n nodeDef: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.ElementNode,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n lastEvents: null,\n setProperties: false,\n assignProperties: null,\n assignEvents: null,\n setAttributes: false,\n setEvents: false,\n childrenFunc: null,\n nodeList: null,\n setData: false,\n scopes: null\n };\n case NodeRefType.ComponentNode:\n return {\n node: null,\n nodeDef: null,\n nodeType: nodeType,\n nodeNamespace: namespace,\n type: NodeRefType.ComponentNode,\n injector: injector_1.Injector.Current() || new injector_1.Injector(),\n parent: null,\n childNodes: null,\n destroyed: false,\n setProperties: false,\n assignProperties: null,\n assignEvents: null,\n setAttributes: false,\n setEvents: false,\n component: null,\n componentEvents: null,\n scopes: null\n };\n }\n }\n NodeRef.Create = Create;\n function Init(nodeRef) {\n if (nodeRef.node)\n return;\n nodeRef.node = nodeRef.nodeType === 'text' ? nodeConfig_1.NodeConfig.createTextNode() : nodeConfig_1.NodeConfig.createNode(nodeRef.nodeType, nodeRef.nodeNamespace);\n nodeRef.childNodes = nodeRef.nodeType !== 'text' ? [] : null;\n switch (nodeRef.type) {\n case NodeRefType.BoundNode:\n boundNode_1.BoundNode.Init(nodeRef);\n break;\n case NodeRefType.ElementNode:\n elementNode_1.ElementNode.Init(nodeRef);\n break;\n case NodeRefType.ComponentNode:\n componentNode_1.ComponentNode.Init(nodeRef);\n break;\n }\n }\n NodeRef.Init = Init;\n function AddChildToNode(parentNode, child) {\n if (Array.isArray(parentNode.childNodes))\n parentNode.childNodes.push(child);\n else\n parentNode.childNodes.add(child);\n }\n function InitAll(parentNode, nodeRefs) {\n for (var x = 0; x < nodeRefs.length; x++) {\n nodeRefs[x].parent = parentNode;\n AddChildToNode(parentNode, nodeRefs[x]);\n Init(nodeRefs[x]);\n }\n }\n NodeRef.InitAll = InitAll;\n function AddChild(node, child) {\n child.parent = node;\n AddChildToNode(node, child);\n nodeConfig_1.NodeConfig.addChild(node.node, child.node);\n }\n NodeRef.AddChild = AddChild;\n function AddChildAfter(node, currentChild, newChild) {\n if (currentChild && currentChild.parent !== node)\n throw \"currentChild is not valid\";\n newChild.parent = node;\n AddChildToNode(node, newChild);\n nodeConfig_1.NodeConfig.addChildAfter(node.node, currentChild && currentChild.node, newChild.node);\n }\n NodeRef.AddChildAfter = AddChildAfter;\n function ReconcileChildren(node, nextChildren) {\n const rootNode = node.node;\n if (nextChildren.size === 0) {\n nodeConfig_1.NodeConfig.replaceChildren(rootNode, []);\n return;\n }\n let priorNode;\n let curDataNode = nextChildren?.head;\n let insert = false;\n let remove = false;\n while (curDataNode) {\n for (let x = 0; x < curDataNode.data.nodes.length; x++) {\n const actualNode = priorNode ? nodeConfig_1.NodeConfig.getNextSibling(priorNode) : nodeConfig_1.NodeConfig.getFirstChild(rootNode);\n const virtualNode = curDataNode.data.nodes[x];\n const expectedNode = virtualNode.node;\n if (actualNode !== expectedNode) {\n nodeConfig_1.NodeConfig.addChildBefore(rootNode, actualNode, expectedNode);\n !remove && insert && actualNode && nodeConfig_1.NodeConfig.removeChild(rootNode, actualNode);\n remove = insert;\n insert = true;\n }\n else {\n insert = false;\n remove = false;\n }\n priorNode = expectedNode;\n }\n curDataNode = curDataNode.next;\n }\n let lastChild = nodeConfig_1.NodeConfig.getLastChild(rootNode);\n while (priorNode && priorNode !== lastChild) {\n nodeConfig_1.NodeConfig.removeChild(rootNode, lastChild);\n lastChild = nodeConfig_1.NodeConfig.getLastChild(rootNode);\n }\n }\n NodeRef.ReconcileChildren = ReconcileChildren;\n function DetachChild(node, child) {\n if (!Array.isArray(node.childNodes) && node.childNodes.delete(child)) {\n nodeConfig_1.NodeConfig.removeChild(node.node, child.node);\n child.parent = null;\n }\n }\n NodeRef.DetachChild = DetachChild;\n function Destroy(node) {\n if (node.destroyed)\n return;\n node.destroyed = true;\n if (Array.isArray(node.childNodes))\n for (let x = 0; x < node.childNodes.length; x++)\n Destroy(node.childNodes[x]);\n else\n node.childNodes?.forEach(Destroy);\n switch (node.type) {\n case NodeRefType.ComponentNode:\n node.component?.Destroy();\n case NodeRefType.ElementNode:\n node.assignEvents?.(null);\n case NodeRefType.BoundNode:\n for (let x = 0; node.scopes && x < node.scopes.length; x++)\n Store_1.ObservableScope.Destroy(node.scopes[x]);\n }\n node.node = null;\n }\n NodeRef.Destroy = Destroy;\n function DestroyAll(nodes) {\n for (let x = 0; x < nodes.length; x++)\n Destroy(nodes[x]);\n }\n NodeRef.DestroyAll = DestroyAll;\n})(NodeRef || (exports.NodeRef = NodeRef = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffAsync = void 0;\nconst diffTree_1 = require(\"./diffTree\");\nconst workerQueue_1 = require(\"./workerQueue\");\nconst diffWorker_1 = require(\"./diffWorker\");\nconst diffCnstr = (0, diffTree_1.DiffTreeScope)();\nclass DiffAsync {\n workerQueue;\n constructor(keyFunc) {\n this.workerQueue = new workerQueue_1.WorkerQueue(diffWorker_1.DiffWorker.Create());\n this.workerQueue.Push({ method: \"create\", arguments: [keyFunc.toString()] });\n }\n static GetKeyRef(key) {\n return diffCnstr.GetKeyRef(key);\n }\n static ReadKeyRef(ref) {\n return diffCnstr.ReadKeyRef(ref);\n }\n async DiffPath(path, value) {\n return await this.workerQueue.Push({ method: \"diffpath\", arguments: [path, value] });\n }\n async DiffBatch(data) {\n return await this.workerQueue.Push({ method: \"diffbatch\", arguments: [data] });\n }\n async UpdatePath(path, value) {\n await this.workerQueue.Push({ method: \"updatepath\", arguments: [path, value] });\n }\n async GetPath(path) {\n return await this.workerQueue.Push({ method: \"getpath\", arguments: [path] });\n }\n Destroy() {\n this.workerQueue.Destroy();\n }\n}\nexports.DiffAsync = DiffAsync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffSync = void 0;\nconst diffTree_1 = require(\"./diffTree\");\nconst diffCnstr = (0, diffTree_1.DiffTreeScope)();\nclass DiffSync {\n diffTree;\n constructor(keyFunc) {\n this.diffTree = new diffCnstr(keyFunc);\n }\n static GetKeyRef(key) {\n return diffCnstr.GetKeyRef(key);\n }\n static ReadKeyRef(ref) {\n return diffCnstr.ReadKeyRef(ref);\n }\n DiffPath(path, value) {\n return this.diffTree.DiffPath(path, value);\n }\n DiffBatch(data) {\n return this.diffTree.DiffBatch(data);\n }\n UpdatePath(path, value) {\n this.diffTree.UpdatePath(path, value);\n }\n}\nexports.DiffSync = DiffSync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffTreeScope = DiffTreeScope;\nfunction DiffTreeScope(worker) {\n const ctx = this;\n if (ctx && worker) {\n let diffTree = null;\n ctx.onmessage = function (event) {\n var data = event.data;\n switch (data.method) {\n case \"create\":\n var keyFunc = data.arguments[0] ? eval(data.arguments[0]) : undefined;\n diffTree = new DiffTree(keyFunc);\n ctx.postMessage(null);\n break;\n case \"diffpath\":\n var diff = diffTree.DiffPath(data.arguments[0], data.arguments[1]);\n ctx.postMessage(diff);\n break;\n case \"diffbatch\":\n var diff = diffTree.DiffBatch(data.arguments[0]);\n ctx.postMessage(diff);\n break;\n case \"updatepath\":\n diffTree.UpdatePath(data.arguments[0], data.arguments[1]);\n ctx.postMessage(null);\n break;\n case \"getpath\":\n var ret = diffTree.GetPath(data.arguments[0]);\n ctx.postMessage(ret);\n break;\n }\n };\n }\n const jsonConstructor = {}.constructor;\n function IsValue(value) {\n if (!value)\n return true;\n return !(jsonConstructor === value.constructor || Array.isArray(value));\n }\n let Type;\n (function (Type) {\n Type[Type[\"Value\"] = 0] = \"Value\";\n Type[Type[\"Object\"] = 1] = \"Object\";\n Type[Type[\"Array\"] = 2] = \"Array\";\n })(Type || (Type = {}));\n function TypeOf(value) {\n if (!value)\n return Type.Value;\n if (jsonConstructor === value.constructor)\n return Type.Object;\n if (Array.isArray(value))\n return Type.Array;\n return Type.Value;\n }\n function JsonDiffRecursive(path, newValue, oldValue, resp) {\n if (newValue === oldValue)\n return false;\n const newType = TypeOf(newValue);\n const oldType = TypeOf(oldValue);\n const changedPathLength = resp.length;\n let allChildrenChanged = true;\n if (newType === oldType)\n switch (newType) {\n case Type.Array: {\n allChildrenChanged = JsonDiffArrays(path, newValue, oldValue, resp);\n break;\n }\n case Type.Object: {\n allChildrenChanged = JsonDiffObjects(path, newValue, oldValue, resp);\n break;\n }\n }\n if (allChildrenChanged) {\n resp.splice(changedPathLength);\n resp.push({\n path,\n value: newValue\n });\n return true;\n }\n return false;\n }\n function JsonDiffArrays(path, newValue, oldValue, resp) {\n let allChildrenChanged = true;\n if (newValue.length !== oldValue.length)\n resp.push({\n path: path ? `${path}.length` : 'length',\n value: newValue.length\n });\n if (newValue.length > 0 || oldValue.length > 0) {\n for (let y = 0; y < newValue.length; y++) {\n const arrayPath = path ? `${path}.${y}` : `${y}`;\n allChildrenChanged = JsonDiffRecursive(arrayPath, newValue[y], oldValue[y], resp) && allChildrenChanged;\n }\n }\n else\n allChildrenChanged = false;\n return allChildrenChanged;\n }\n function JsonDiffObjects(path, newValue, oldValue, resp) {\n let allChildrenChanged = true;\n const newKeys = Object.keys(newValue);\n const oldKeys = Object.keys(oldValue);\n if (newKeys.length === 0 && oldKeys.length === 0) {\n return false;\n }\n if (newKeys.length >= oldKeys.length) {\n let newKeyIndex = 0;\n let oldKeyIndex = 0;\n while (newKeyIndex < newKeys.length) {\n const childPath = path ? `${path}.${newKeys[newKeyIndex]}` : newKeys[newKeyIndex];\n if (oldKeyIndex < oldKeys.length && newKeys[newKeyIndex] === oldKeys[oldKeyIndex]) {\n allChildrenChanged =\n JsonDiffRecursive(childPath, newValue[newKeys[newKeyIndex]], oldValue[oldKeys[oldKeyIndex]], resp) &&\n allChildrenChanged;\n oldKeyIndex++;\n }\n else if (newValue[newKeys[newKeyIndex]] !== undefined) {\n resp.push({\n path: childPath,\n value: newValue[newKeys[newKeyIndex]]\n });\n }\n newKeyIndex++;\n }\n if (oldKeyIndex < oldKeys.length)\n allChildrenChanged = true;\n }\n return allChildrenChanged;\n }\n function BreakUpValue(path, parent, keyFunc, prop, map) {\n const value = prop ? parent[prop] : parent;\n const isValue = IsValue(value);\n if (!map && isValue)\n return new Map([[path, value]]);\n map = map || new Map();\n if (isValue)\n return map;\n const key = keyFunc ? keyFunc(value) : null;\n const keyRef = key && DiffTree.GetKeyRef(key);\n if (key && key !== path) {\n if (prop)\n parent[prop] = keyRef;\n BreakUpValue(key, value, keyFunc, null, map);\n }\n else {\n for (const subProp in value) {\n const childPath = `${path}.${subProp}`;\n BreakUpValue(childPath, value, keyFunc, subProp, map);\n }\n }\n if (!prop)\n map.set(path, key === path ? value : keyRef || value);\n return map;\n }\n class DiffTree {\n keyFunc;\n rootStateMap = new Map();\n constructor(keyFunc) {\n this.keyFunc = keyFunc;\n }\n static GetKeyRef(key) {\n return `___DiffTreeKeyRef.${key}`;\n }\n static ReadKeyRef(ref) {\n if (!ref)\n return undefined;\n var matches = ref.match(/^___DiffTreeKeyRef\\.([^.]+$)/);\n if (!matches)\n return undefined;\n return matches[1];\n }\n DiffBatch(data) {\n var resp = [];\n ;\n for (var x = 0; x < data.length; x++)\n this.RunDiff(data[x].path, data[x].value, resp);\n return resp;\n }\n DiffPath(path, value) {\n var resp = [];\n this.RunDiff(path, value, resp);\n return resp;\n }\n UpdatePath(path, value) {\n this.SetPathValue(path, value);\n }\n GetPath(path) {\n return this.GetPathValue(path);\n }\n RunDiff(path, value, diffResp) {\n var breakupMap = this.GetBreakUpMap(path, value);\n var resp = diffResp || [];\n breakupMap.forEach((value, key) => {\n var currentValue = key.split(\".\").reduce((pre, curr, index) => {\n if (index === 0)\n return this.rootStateMap.get(curr);\n return pre && pre[curr];\n }, null);\n JsonDiffRecursive(key, value, currentValue, resp);\n });\n for (var x = 0; x < resp.length; x++)\n this.SetPathValue(resp[x].path, resp[x].value);\n }\n GetPathValue(path) {\n var parts = path.split(\".\");\n var curr = this.rootStateMap.get(parts[0]);\n for (var x = 1; x < parts.length; x++)\n curr = curr && curr[parts[x]];\n return curr;\n }\n SetPathValue(path, value) {\n var parts = path.split(\".\");\n if (parts.length === 1)\n this.rootStateMap.set(parts[0], value);\n else {\n var curr = this.rootStateMap.get(parts[0]);\n for (var x = 1; x < parts.length - 1; x++)\n curr = curr[parts[x]];\n curr[parts[parts.length - 1]] = value;\n }\n }\n GetBreakUpMap(path, value) {\n if (!this.keyFunc)\n return new Map([[path, value]]);\n return BreakUpValue(path, value, this.keyFunc);\n }\n }\n return DiffTree;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiffWorker = void 0;\nconst diffTree_1 = require(\"./diffTree\");\nvar DiffWorker;\n(function (DiffWorker) {\n var workerConstructor = null;\n var workerParameter = null;\n if (typeof Worker !== 'undefined') {\n workerConstructor = Worker;\n workerParameter = URL.createObjectURL(new Blob([`(${diffTree_1.DiffTreeScope}).call(this, true)`]));\n }\n function Create() {\n if (!workerConstructor)\n throw \"Worker is not available\";\n return new workerConstructor(workerParameter);\n }\n DiffWorker.Create = Create;\n})(DiffWorker || (exports.DiffWorker = DiffWorker = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkerQueue = void 0;\nconst list_1 = require(\"../../Utils/list\");\nclass WorkerQueue {\n callbacks;\n worker;\n constructor(worker) {\n this.worker = worker;\n this.callbacks = list_1.List.Create();\n this.worker.onerror = (err) => {\n var cb = list_1.List.Pop(this.callbacks);\n cb && cb(null, err);\n };\n this.worker.onmessage = (message) => {\n var cb = list_1.List.Pop(this.callbacks);\n cb && cb(message.data);\n };\n }\n Push(message) {\n return new Promise((resolve, reject) => {\n list_1.List.Add(this.callbacks, function (data, err) {\n if (err)\n reject(err);\n else\n resolve(data);\n });\n this.worker.postMessage(message);\n });\n }\n Destroy() {\n this.worker.terminate();\n }\n}\nexports.WorkerQueue = WorkerQueue;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Store = void 0;\nconst observableTree_1 = require(\"../Tree/observableTree\");\nconst storeWriter_1 = require(\"./storeWriter\");\nclass Store {\n observableTree = new observableTree_1.ObservableTree();\n storeWriter = new storeWriter_1.StoreWriter(this.observableTree);\n rootScope = this.observableTree.Scope(\"ROOT\", root => root);\n get Root() {\n return this.rootScope;\n }\n constructor(init) {\n if (init)\n this.Write(init);\n }\n Action(action) {\n var proxy = this.observableTree.Get(\"ROOT\");\n action(proxy, this.storeWriter);\n }\n Write(data) {\n this.Action((root, writer) => writer.Write(root, data));\n }\n Merge(data) {\n this.Action((root, writer) => writer.Merge(root, data));\n }\n Destroy() {\n this.rootScope.Destroy();\n }\n}\nexports.Store = Store;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreAsync = void 0;\nconst observableTree_1 = require(\"../Tree/observableTree\");\nconst diffAsync_1 = require(\"../Diff/diffAsync\");\nconst storeAsyncWriter_1 = require(\"./storeAsyncWriter\");\nconst asyncQueue_1 = require(\"../../Utils/asyncQueue\");\nclass StoreAsync {\n idFunc;\n diffAsync;\n observableTree;\n asyncWriter;\n asyncQueue;\n constructor(idFunc, init) {\n this.idFunc = idFunc;\n this.diffAsync = new diffAsync_1.DiffAsync(this.idFunc);\n this.observableTree = new observableTree_1.ObservableTree(diffAsync_1.DiffAsync.ReadKeyRef);\n this.asyncWriter = new storeAsyncWriter_1.StoreAsyncWriter(this.idFunc, this.diffAsync, this.observableTree);\n this.asyncQueue = new asyncQueue_1.AsyncQueue();\n if (init) {\n var id = this.idFunc(init);\n this.observableTree.Write(id, init);\n this.Write(init);\n }\n }\n Scope(id, func) {\n return this.observableTree.Scope(id, func);\n }\n async Action(id, action) {\n await this.asyncQueue.Next(async () => {\n await action(id && this.observableTree.Get(id), this.asyncWriter);\n });\n }\n async Write(data) {\n await this.Action(null, async (val, writer) => {\n await writer.Write(val, data);\n });\n }\n async Merge(id, data) {\n await this.Action(id, async (val, writer) => {\n await writer.Merge(val, data);\n });\n }\n Destroy() {\n this.asyncQueue.Stop();\n this.diffAsync.Destroy();\n }\n}\nexports.StoreAsync = StoreAsync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreAsyncWriter = void 0;\nclass StoreAsyncWriter {\n idFunc;\n diffAsync;\n observableTree;\n constructor(idFunc, diffAsync, observableTree) {\n this.idFunc = idFunc;\n this.diffAsync = diffAsync;\n this.observableTree = observableTree;\n }\n async Write(source, data) {\n let path;\n if (source) {\n path = this.observableTree.GetPathOf(source);\n }\n else {\n path = this.idFunc(data);\n if (!path)\n throw new Error(\"data must have an id\");\n }\n let diff = await this.diffAsync.DiffPath(path, data);\n this.ApplyChanges(diff);\n }\n async Merge(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n const keys = Object.keys(data);\n const message = keys.map(key => ({ path: `${rootPath}.${key}`, value: data[key] }));\n const diff = await this.diffAsync.DiffBatch(message);\n this.ApplyChanges(diff);\n }\n async Push(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n var lengthPath = `${rootPath}.length`;\n var length = await this.diffAsync.GetPath(lengthPath);\n var diff = await this.diffAsync.DiffPath(`${rootPath}.${length}`, data);\n this.ApplyChanges(diff);\n }\n async Splice(source, start, deleteCount, ...items) {\n var rootPath = this.observableTree.GetPathOf(source);\n var array = await this.diffAsync.GetPath(rootPath);\n array = array.slice();\n array.splice(start, deleteCount, ...items);\n var diff = await this.diffAsync.DiffPath(rootPath, array);\n this.ApplyChanges(diff);\n }\n ApplyChanges(diff) {\n this.observableTree.WriteAll(diff);\n }\n}\nexports.StoreAsyncWriter = StoreAsyncWriter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreSync = void 0;\nconst diffSync_1 = require(\"../Diff/diffSync\");\nconst observableTree_1 = require(\"../Tree/observableTree\");\nconst storeSyncWriter_1 = require(\"./storeSyncWriter\");\nclass StoreSync {\n diffSync = new diffSync_1.DiffSync();\n observableTree = new observableTree_1.ObservableTree();\n storeWriter = new storeSyncWriter_1.StoreSyncWriter(this.diffSync, this.observableTree);\n rootScope = this.observableTree.Scope(\"ROOT\", root => root);\n get Root() {\n return this.rootScope;\n }\n constructor(init) {\n if (init)\n this.Write(init);\n }\n Action(action) {\n var proxy = this.observableTree.Get(\"ROOT\");\n action(proxy, this.storeWriter);\n }\n Write(data) {\n this.Action((root, writer) => writer.Write(root, data));\n }\n Merge(data) {\n this.Action((root, writer) => writer.Merge(root, data));\n }\n Destroy() {\n this.rootScope.Destroy();\n }\n}\nexports.StoreSync = StoreSync;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreSyncWriter = void 0;\nclass StoreSyncWriter {\n diffSync;\n observableTree;\n constructor(diffSync, observableTree) {\n this.diffSync = diffSync;\n this.observableTree = observableTree;\n }\n Write(source, data) {\n var rootPath = source && this.observableTree.GetPathOf(source) || \"ROOT\";\n var diff = this.diffSync.DiffPath(rootPath, data);\n this.ApplyChanges(diff);\n }\n Merge(source, data) {\n var rootPath = this.observableTree.GetPathOf(source);\n var keys = Object.keys(data);\n var message = keys.map(key => ({ path: `${rootPath}.${key}`, value: data[key] }));\n var diff = this.diffSync.DiffBatch(message);\n this.ApplyChanges(diff);\n }\n Push(source, data) {\n var rootPath = this.observableTree.GetPathOf(source);\n var length = source.length;\n this.diffSync.UpdatePath(`${rootPath}.${length}`, data);\n this.observableTree.Write(`${rootPath}.${length}`, data);\n }\n Splice(source, start, deleteCount, ...items) {\n var rootPath = this.observableTree.GetPathOf(source);\n var proxy = this.observableTree.Get(rootPath);\n const array = proxy.toJSON().slice();\n array.splice(start, deleteCount, ...items);\n this.diffSync.UpdatePath(rootPath, array);\n this.observableTree.Write(rootPath, array);\n }\n ApplyChanges(diff) {\n this.observableTree.WriteAll(diff);\n }\n}\nexports.StoreSyncWriter = StoreSyncWriter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StoreWriter = void 0;\nclass StoreWriter {\n observableTree;\n constructor(observableTree) {\n this.observableTree = observableTree;\n }\n Write(source, data) {\n const rootPath = source && this.observableTree.GetPathOf(source) || \"ROOT\";\n this.observableTree.Write(rootPath, data);\n }\n Merge(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n for (const key in data)\n this.observableTree.Write(`${rootPath}.${key}`, data[key]);\n }\n Push(source, data) {\n const rootPath = this.observableTree.GetPathOf(source);\n this.observableTree.Write(`${rootPath}.${source.length}`, data);\n }\n Splice(source, start, deleteCount, ...items) {\n const json = source.toJSON();\n const copy = json.slice();\n copy.splice(start, deleteCount, ...items);\n const rootPath = this.observableTree.GetPathOf(source);\n this.observableTree.Write(rootPath, copy);\n }\n}\nexports.StoreWriter = StoreWriter;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableComputed = void 0;\nconst json_1 = require(\"../../Utils/json\");\nconst list_1 = require(\"../../Utils/list\");\nconst observableNode_1 = require(\"./observableNode\");\nconst observableScope_1 = require(\"./observableScope\");\nconst scheduleNodes = new Set();\nconst computedQueue = list_1.List.Create();\nfunction updateNode({ node, scope }) {\n const value = observableScope_1.ObservableScope.Value(scope);\n node.data = (0, json_1.JsonDeepClone)(value);\n}\nlet computing = false;\nfunction scheduleComputed(node, scope) {\n if (scheduleNodes.has(node))\n return;\n scheduleNodes.add(node);\n list_1.List.Add(computedQueue, { node, scope });\n if (!computing) {\n computing = true;\n queueMicrotask(function () {\n computing = false;\n scheduleNodes.clear();\n list_1.List.ForEach(computedQueue, updateNode);\n list_1.List.Clear(computedQueue);\n });\n }\n}\nfunction CreateComputed(compute) {\n const scope = observableScope_1.ObservableScope.Create(compute);\n const node = observableNode_1.ObservableNode.Create({ data: null });\n observableScope_1.ObservableScope.Watch(scope, function (scope) {\n scheduleComputed(node, scope);\n });\n node.data = observableScope_1.ObservableScope.Value(scope);\n return observableScope_1.ObservableScope.Create(function () { return node.data; }, [scope]);\n}\nvar ObservableComputed;\n(function (ObservableComputed) {\n function Create(compute) {\n return CreateComputed(compute);\n }\n ObservableComputed.Create = Create;\n})(ObservableComputed || (exports.ObservableComputed = ObservableComputed = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableNode = void 0;\nconst json_1 = require(\"../../Utils/json\");\nconst observableScope_1 = require(\"./observableScope\");\nconst proxyCache = new WeakMap();\nconst scopeCache = new WeakMap();\nfunction getOwnPropertyDescriptor(target, prop) {\n const descriptor = Object.getOwnPropertyDescriptor(target, prop);\n return {\n ...descriptor,\n configurable: true\n };\n}\nfunction getOwnPropertyDescriptorArray(target, prop) {\n const descriptor = Object.getOwnPropertyDescriptor(target, prop);\n return {\n ...descriptor,\n configurable: true\n };\n}\nfunction has(value, prop) {\n return Object.hasOwn(value, prop);\n}\nfunction hasArray(value, prop) {\n return Object.hasOwn(value, prop);\n}\nfunction ownKeys(value) {\n return Object.keys(value);\n}\nfunction ownKeysArray(value) {\n return Object.keys(value);\n}\nfunction UnwrapProxy(value) {\n if (!value)\n return value;\n if (value.toJSON && typeof value.toJSON === 'function')\n return value.toJSON();\n const type = (0, json_1.JsonType)(value);\n switch (type) {\n case 'object': {\n const keys = Object.keys(value);\n for (let x = 0; x < keys.length; x++)\n value[keys[x]] = UnwrapProxy(value[keys[x]]);\n }\n case 'array': {\n for (let x = 0; x < value.length; x++)\n value[x] = UnwrapProxy(value[x]);\n }\n }\n return value;\n}\nfunction CreateArrayProxy(value) {\n const scope = observableScope_1.ObservableScope.Create(() => value);\n const proxy = new Proxy(value, {\n get: ArrayProxyGetter,\n set: ArrayProxySetter,\n has: hasArray,\n ownKeys: ownKeysArray,\n getOwnPropertyDescriptor: getOwnPropertyDescriptorArray\n });\n scopeCache.set(value, scope);\n proxyCache.set(value, proxy);\n return proxy;\n}\nfunction CreateObjectProxy(value) {\n const scope = observableScope_1.ObservableScope.Create(() => value);\n const proxy = new Proxy(value, {\n get: ObjectProxyGetter,\n set: ObjectProxySetter,\n has,\n ownKeys,\n getOwnPropertyDescriptor\n });\n scopeCache.set(value, scope);\n proxyCache.set(value, proxy);\n return proxy;\n}\nfunction ArrayProxySetter(array, prop, value) {\n value = UnwrapProxy(value);\n array[prop] = value;\n const scope = scopeCache.get(array);\n observableScope_1.ObservableScope.Update(scope);\n return true;\n}\nfunction ArrayProxyGetter(array, prop) {\n const scope = scopeCache.get(array);\n array = observableScope_1.ObservableScope.Value(scope);\n switch (prop) {\n case \"toJSON\":\n return function () {\n return array;\n };\n default: {\n const arrayValue = array[prop];\n if (typeof prop === 'symbol')\n return arrayValue;\n if (typeof arrayValue === 'function')\n return function ArrayFunction(...args) {\n const proxyArray = array.slice();\n for (let x = 0; x < proxyArray.length; x++)\n proxyArray[x] = proxyCache.get(proxyArray[x]) ?? CreateProxy(proxyArray[x]);\n let result = proxyArray[prop](...args);\n switch (prop) {\n case 'push':\n case 'unshift':\n case 'splice':\n case 'pop':\n case 'shift':\n case 'sort':\n case 'reverse':\n array.length = proxyArray.length;\n for (let x = 0; x < proxyArray.length; x++)\n array[x] = UnwrapProxy(proxyArray[x]);\n observableScope_1.ObservableScope.Update(scope);\n break;\n }\n return result;\n };\n const proxy = CreateProxy(arrayValue);\n return proxy;\n }\n }\n}\nlet applyingDiff = false;\nfunction ObjectProxySetter(object, prop, value) {\n const scope = scopeCache.get(object);\n value = UnwrapProxy(value);\n if (applyingDiff) {\n object[prop] = value;\n observableScope_1.ObservableScope.Update(scope);\n }\n else {\n applyingDiff = true;\n const proxy = proxyCache.get(object);\n const json = proxy.toJSON();\n const diff = (0, json_1.JsonDiff)(value, json[prop]);\n for (let x = 0; x < diff.length; x++) {\n if (diff[x].path.length === 0) {\n proxy[prop] = diff[x].value;\n }\n else {\n const path = diff[x].path;\n let curr = proxy[prop];\n let y = 0;\n for (; y < path.length - 1; y++)\n curr = curr[path[y]];\n curr[path[y]] = diff[x].value;\n }\n }\n applyingDiff = false;\n }\n return true;\n}\nfunction ObjectProxyGetter(object, prop) {\n const scope = scopeCache.get(object);\n object = observableScope_1.ObservableScope.Value(scope);\n switch (prop) {\n case \"toJSON\":\n return function () {\n return object;\n };\n default: {\n const proxyValue = object[prop];\n if (typeof prop === 'symbol')\n return proxyValue;\n const proxy = CreateProxy(proxyValue);\n return proxy;\n }\n }\n}\nfunction CreateProxy(value) {\n const type = (0, json_1.JsonType)(value);\n switch (type) {\n case 'object': {\n const proxy = proxyCache.get(value) ?? CreateObjectProxy(value);\n return proxy;\n }\n case 'array': {\n const proxy = proxyCache.get(value) ?? CreateArrayProxy(value);\n observableScope_1.ObservableScope.Touch(scopeCache.get(value));\n return proxy;\n }\n default:\n return value;\n }\n}\nvar ObservableNode;\n(function (ObservableNode) {\n function Create(value) {\n value = UnwrapProxy(value);\n return CreateProxy(value);\n }\n ObservableNode.Create = Create;\n})(ObservableNode || (exports.ObservableNode = ObservableNode = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableScope = exports.ObservableScopeWrapper = exports.ObservableScopeValue = void 0;\nconst emitter_1 = require(\"../../Utils/emitter\");\nclass ObservableScopeValue {\n scope;\n get Value() {\n return ObservableScope.Value(this.scope);\n }\n constructor(scope) {\n this.scope = scope;\n }\n}\nexports.ObservableScopeValue = ObservableScopeValue;\nclass ObservableScopeWrapper extends ObservableScopeValue {\n scopeEmitter;\n constructor(scope) {\n super(scope);\n if (scope.emitter) {\n this.scopeEmitter = emitter_1.Emitter.Create();\n emitter_1.Emitter.On(scope.emitter, () => emitter_1.Emitter.Emit(this.scopeEmitter, this));\n }\n }\n Scope(callback) {\n return new ObservableScope(() => callback(this.Value));\n }\n Watch(callback) {\n if (!this.scopeEmitter)\n return;\n emitter_1.Emitter.On(this.scopeEmitter, callback);\n callback(this);\n }\n Unwatch(callback) {\n if (!this.scopeEmitter)\n return;\n emitter_1.Emitter.Remove(this.scopeEmitter, callback);\n }\n Destroy() {\n DestroyScope(this.scope);\n this.scopeEmitter && this.scopeEmitter.clear();\n }\n}\nexports.ObservableScopeWrapper = ObservableScopeWrapper;\nclass ObservableScope extends ObservableScopeWrapper {\n constructor(getFunction) {\n super(ObservableScope.Create(getFunction));\n }\n}\nexports.ObservableScope = ObservableScope;\nlet currentSet = null;\nlet watching = false;\nfunction WatchAction(action) {\n const parentSet = currentSet;\n currentSet = null;\n const parentWatching = watching;\n watching = true;\n action();\n const lastSet = currentSet;\n currentSet = parentSet;\n watching = parentWatching;\n return lastSet;\n}\n(function (ObservableScope) {\n function Create(valueFunction, dependencies) {\n const hasFunction = typeof valueFunction === 'function';\n const scope = {\n getFunction: hasFunction ? valueFunction : null,\n value: hasFunction ? null : valueFunction,\n async: hasFunction ? valueFunction[Symbol.toStringTag] === 'AsyncFunction' : false,\n dirty: hasFunction,\n emitter: hasFunction ? emitter_1.Emitter.Create() : null,\n emitters: null,\n destroyed: false,\n setCallback: hasFunction ? function () {\n return OnSet(scope);\n } : null,\n dependencies\n };\n return scope;\n }\n ObservableScope.Create = Create;\n function Register(emitter) {\n if (!watching || !emitter)\n return;\n currentSet ??= new Set();\n currentSet.add(emitter);\n }\n ObservableScope.Register = Register;\n function Value(scope) {\n if (!scope)\n return undefined;\n Register(scope.emitter);\n UpdateValue(scope);\n return scope.value;\n }\n ObservableScope.Value = Value;\n function Watching() {\n return watching;\n }\n ObservableScope.Watching = Watching;\n function Touch(scope) {\n if (!scope || !scope.emitter)\n return;\n Register(scope.emitter);\n }\n ObservableScope.Touch = Touch;\n function Watch(scope, callback) {\n if (!scope || !scope.emitter)\n return;\n emitter_1.Emitter.On(scope.emitter, callback);\n }\n ObservableScope.Watch = Watch;\n function Unwatch(scope, callback) {\n if (!scope || !scope.emitter)\n return;\n emitter_1.Emitter.Remove(scope.emitter, callback);\n }\n ObservableScope.Unwatch = Unwatch;\n function Update(scope) {\n OnSet(scope);\n }\n ObservableScope.Update = Update;\n function Destroy(scope) {\n DestroyScope(scope);\n }\n ObservableScope.Destroy = Destroy;\n})(ObservableScope || (exports.ObservableScope = ObservableScope = {}));\nfunction OnSet(scope) {\n if (!scope || scope.dirty || scope.destroyed)\n return scope.destroyed;\n scope.dirty = !!scope.getFunction;\n emitter_1.Emitter.Emit(scope.emitter, scope);\n return false;\n}\nfunction UpdateValue(scope) {\n if (!scope.dirty)\n return;\n scope.dirty = false;\n let value = null;\n const emitters = scope.getFunction && WatchAction(() => value = scope.getFunction());\n if (scope.async)\n Promise.resolve(value).then(val => {\n scope.value = val;\n emitter_1.Emitter.Emit(scope.emitter, scope);\n });\n else\n scope.value = value;\n UpdateEmitters(scope, emitters);\n}\nfunction DestroyScope(scope) {\n if (!scope)\n return;\n if (scope.dependencies !== undefined)\n for (let x = 0; x < scope.dependencies.length; x++)\n DestroyScope(scope.dependencies[x]);\n scope.emitters && scope.emitters.clear();\n scope.emitter && scope.emitter.clear();\n scope.getFunction = null;\n scope.setCallback = null;\n scope.destroyed = true;\n}\nfunction UpdateEmitters(scope, newEmitters) {\n if (newEmitters) {\n newEmitters.forEach(e => {\n if (!scope.emitters?.delete(e))\n emitter_1.Emitter.On(e, scope.setCallback);\n });\n }\n if (scope.emitters)\n scope.emitters.forEach(e => emitter_1.Emitter.Remove(e, scope.setCallback));\n scope.emitters = newEmitters;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableTree = void 0;\nconst observableScope_1 = require(\"../Tree/observableScope\");\nvar Type;\n(function (Type) {\n Type[Type[\"Value\"] = 0] = \"Value\";\n Type[Type[\"Object\"] = 1] = \"Object\";\n Type[Type[\"Array\"] = 2] = \"Array\";\n})(Type || (Type = {}));\nconst jsonConstructor = {}.constructor;\nfunction TypeOf(value) {\n if (!value)\n return Type.Value;\n if (jsonConstructor === value.constructor)\n return Type.Object;\n if (Array.isArray(value))\n return Type.Array;\n return Type.Value;\n}\nclass ObservableTree {\n valuePathResolver;\n undefinedScope = observableScope_1.ObservableScope.Create(function () { return undefined; });\n scopeCache = new WeakMap();\n leafScopeCache = new WeakMap();\n proxyCache = new WeakMap();\n pathCache = new WeakMap();\n rootStateMap = new Map();\n constructor(valuePathResolver) {\n this.valuePathResolver = valuePathResolver;\n }\n static UnwrapProxyValues(value) {\n if (value?.toJSON && typeof value.toJSON === 'function')\n return value.toJSON();\n const type = TypeOf(value);\n if (type === Type.Value)\n return value;\n if (type === Type.Array) {\n const arr = value;\n for (let x = 0; x < arr.length; x++)\n arr[x] = ObservableTree.UnwrapProxyValues(arr[x]);\n }\n else {\n const keys = Object.keys(value);\n for (let x = 0; x < keys.length; x++)\n value[keys[x]] = ObservableTree.UnwrapProxyValues(value[keys[x]]);\n }\n return value;\n }\n Get(path) {\n const val = path.split(\".\").reduce((pre, curr, index) => {\n if (index === 0) {\n let value = this.rootStateMap.get(curr);\n const scope = this.GetParentScope(value);\n return observableScope_1.ObservableScope.Value(scope);\n }\n return pre && pre[curr];\n }, null);\n return val;\n }\n GetPathOf(value) {\n if (value.toJSON && typeof value.toJSON === 'function')\n value = value.toJSON();\n return this.pathCache.get(value);\n }\n Scope(path, callback) {\n return new observableScope_1.ObservableScope(() => {\n const obj = this.Get(path);\n return callback && callback(obj) || obj;\n });\n }\n Write(path, value) {\n const scope = this.WritePath(path, value);\n observableScope_1.ObservableScope.Update(scope);\n }\n WriteAll(data) {\n const scopeSet = new Set();\n for (var x = 0; x < data.length; x++) {\n const scope = this.WritePath(data[x].path, data[x].value);\n scopeSet.add(scope);\n }\n scopeSet.forEach(scope => observableScope_1.ObservableScope.Update(scope));\n }\n GetParentScope(value) {\n if (value === undefined)\n return this.undefinedScope;\n let scope = this.scopeCache.get(value);\n if (!scope) {\n scope = observableScope_1.ObservableScope.Create(() => this.GetValueProxy(value));\n this.scopeCache.set(value, scope);\n }\n return scope;\n }\n GetPropertyScope(parent, prop) {\n const value = parent[prop];\n const type = TypeOf(value);\n if (type === Type.Value) {\n let leafScopes = this.leafScopeCache.get(parent) || {};\n leafScopes[prop] = leafScopes[prop] || observableScope_1.ObservableScope.Create(() => {\n const parentScope = this.scopeCache.get(parent);\n const parentValue = observableScope_1.ObservableScope.Value(parentScope);\n const parentJson = parentValue.toJSON();\n const currentValue = parentJson[prop];\n let path;\n if (this.valuePathResolver && typeof currentValue === 'string' && (path = this.valuePathResolver(currentValue)))\n return this.Get(path);\n return currentValue;\n });\n this.leafScopeCache.set(parent, leafScopes);\n return leafScopes[prop];\n }\n else {\n let scope = this.scopeCache.get(value);\n if (!scope) {\n scope = observableScope_1.ObservableScope.Create(() => {\n const parentScope = this.scopeCache.get(parent);\n const parentValue = observableScope_1.ObservableScope.Value(parentScope);\n const parentJson = parentValue.toJSON();\n const currentValue = parentJson[prop];\n return this.GetValueProxy(currentValue);\n });\n this.scopeCache.set(value, scope);\n }\n return scope;\n }\n }\n GetValueProxy(value) {\n let proxy = this.proxyCache.get(value);\n if (!proxy) {\n proxy = this.CreateProxy(value);\n this.proxyCache.set(value, proxy);\n }\n return proxy;\n }\n ObjectProxyGetter = (value, prop) => {\n function toJSON() {\n return value;\n }\n ;\n switch (prop) {\n case \"toJSON\":\n return toJSON;\n default:\n if (typeof prop === 'symbol')\n return value[prop];\n return observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, prop));\n }\n };\n CreateObjectProxy(value) {\n return new Proxy(value, {\n get: this.ObjectProxyGetter\n });\n }\n ArrayProxyGetter = (value, prop) => {\n function toJSON() {\n return value;\n }\n ;\n switch (prop) {\n case \"toJSON\":\n return toJSON;\n default:\n if (typeof prop === 'symbol')\n return value[prop];\n if (isNaN(parseInt(prop))) {\n const ret = value[prop];\n if (typeof ret === 'function') {\n const copy = value.map((val, index) => observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, index.toString())));\n return ret.bind(copy);\n }\n return ret;\n }\n return observableScope_1.ObservableScope.Value(this.GetPropertyScope(value, prop));\n }\n };\n CreateArrayProxy(value) {\n return new Proxy(value, {\n get: this.ArrayProxyGetter\n });\n }\n CreateProxy(value) {\n const type = TypeOf(value);\n switch (type) {\n case Type.Object:\n return this.CreateObjectProxy(value);\n case Type.Array:\n return this.CreateArrayProxy(value);\n default:\n return value;\n }\n }\n WritePath(path, value) {\n this.UpdatePathCache(path, value);\n const pathParts = path.split(\".\");\n if (pathParts.length === 1) {\n const currentValue = this.rootStateMap.get(pathParts[0]);\n this.rootStateMap.set(pathParts[0], value);\n return currentValue === undefined ? this.undefinedScope : this.scopeCache.get(currentValue);\n }\n let parentValue;\n let x = 0;\n for (; x < pathParts.length - 1 && (x === 0 || parentValue); x++) {\n if (x === 0)\n parentValue = this.rootStateMap.get(pathParts[x]);\n else\n parentValue = parentValue && parentValue[pathParts[x]];\n }\n if (!parentValue)\n throw new Error(\"Unable to write path: \" + path + \". Falsey value found at: \" + pathParts.slice(0, x).join(\".\"));\n const prop = pathParts[x];\n const oldValue = parentValue[prop];\n const oldType = TypeOf(oldValue);\n parentValue[prop] = value;\n if (oldType !== Type.Value || Array.isArray(parentValue))\n return this.scopeCache.get(parentValue) || this.scopeCache.get(oldValue);\n const leafScopes = this.leafScopeCache.get(parentValue);\n return leafScopes && leafScopes[prop] || this.scopeCache.get(parentValue);\n }\n UpdatePathCache(path, value) {\n const type = TypeOf(value);\n if (type === Type.Value)\n return;\n this.pathCache.set(value, path);\n this.proxyCache.delete(value);\n this.scopeCache.delete(value);\n this.leafScopeCache.delete(value);\n const keys = Object.keys(value);\n for (let x = 0; x < keys.length; x++)\n this.UpdatePathCache(`${path}.${keys[x]}`, value[keys[x]]);\n return value;\n }\n}\nexports.ObservableTree = ObservableTree;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableComputed = exports.ObservableNode = exports.ObservableScope = exports.StoreAsync = exports.StoreSync = exports.Store = void 0;\nvar store_1 = require(\"./Store/store\");\nObject.defineProperty(exports, \"Store\", { enumerable: true, get: function () { return store_1.Store; } });\nvar storeSync_1 = require(\"./Store/storeSync\");\nObject.defineProperty(exports, \"StoreSync\", { enumerable: true, get: function () { return storeSync_1.StoreSync; } });\nvar storeAsync_1 = require(\"./Store/storeAsync\");\nObject.defineProperty(exports, \"StoreAsync\", { enumerable: true, get: function () { return storeAsync_1.StoreAsync; } });\nvar observableScope_1 = require(\"./Tree/observableScope\");\nObject.defineProperty(exports, \"ObservableScope\", { enumerable: true, get: function () { return observableScope_1.ObservableScope; } });\nvar observableNode_1 = require(\"./Tree/observableNode\");\nObject.defineProperty(exports, \"ObservableNode\", { enumerable: true, get: function () { return observableNode_1.ObservableNode; } });\nvar observableComputed_1 = require(\"./Tree/observableComputed\");\nObject.defineProperty(exports, \"ObservableComputed\", { enumerable: true, get: function () { return observableComputed_1.ObservableComputed; } });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Animation = exports.AnimationType = void 0;\nvar StepFunctions;\n(function (StepFunctions) {\n function* EaseIn(count) {\n var diff = 1 / count;\n for (var t = diff, x = 0; x < count; x++, t += diff)\n yield (1 - t) * (1 - t) * (1 - t) * 0 + 3 * (1 - t) * (1 - t) * t * 1 + 3 * (1 - t) * t * t * 1 + t * t * t * 1;\n }\n StepFunctions.EaseIn = EaseIn;\n function* Linear(count) {\n var diff = 1 / count;\n for (var t = diff, x = 0; x < count; x++, t += diff)\n yield t;\n }\n StepFunctions.Linear = Linear;\n})(StepFunctions || (StepFunctions = {}));\nvar AnimationType;\n(function (AnimationType) {\n AnimationType[AnimationType[\"Linear\"] = 0] = \"Linear\";\n AnimationType[AnimationType[\"EaseIn\"] = 1] = \"EaseIn\";\n})(AnimationType || (exports.AnimationType = AnimationType = {}));\nclass Animation {\n type;\n frameCount;\n frameTimings;\n update;\n animationTimeouts;\n running;\n start;\n end;\n enabled;\n get Running() {\n return this.running;\n }\n get Start() {\n return this.start;\n }\n get End() {\n return this.end;\n }\n get Enabled() {\n return this.enabled;\n }\n constructor(type, duration, update) {\n this.running = false;\n this.start = null;\n this.end = null;\n this.enabled = true;\n this.type = type;\n this.frameCount = Math.ceil((duration / 1000) * 60);\n this.frameTimings = [];\n var frameTime = duration / this.frameCount;\n for (var x = 0; x < this.frameCount; x++)\n this.frameTimings[x] = (x + 1) * frameTime;\n this.update = update;\n this.animationTimeouts = [];\n }\n Animate(start, end) {\n if (!this.enabled)\n return;\n var diff = end - start;\n if (diff === 0)\n return;\n this.Cancel();\n this.running = true;\n this.start = start;\n this.end = end;\n return new Promise(resolve => {\n var stepFunc = StepFunctions[AnimationType[this.type]];\n var index = 0;\n for (var step of stepFunc(this.frameCount)) {\n var value = (step * diff) + start;\n this.SetTimeout(index, value, index === (this.frameCount - 1) ? resolve : null);\n index++;\n }\n }).then(() => {\n this.running = false;\n this.start = null;\n this.end = null;\n });\n }\n Disable() {\n this.Cancel();\n this.enabled = false;\n }\n Enable() {\n this.enabled = true;\n }\n Cancel() {\n for (var x = 0; x < this.animationTimeouts.length; x++)\n clearTimeout(this.animationTimeouts[x]);\n this.running = false;\n this.start = null;\n this.end = null;\n }\n Destroy() {\n this.Cancel();\n }\n SetTimeout(index, value, resolve) {\n this.animationTimeouts[index] = setTimeout(() => {\n this.update(value);\n resolve && resolve();\n }, this.frameTimings[index]);\n }\n}\nexports.Animation = Animation;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AsyncQueue = void 0;\nconst list_1 = require(\"./list\");\nclass AsyncQueue {\n running = false;\n queue = list_1.List.Create();\n Next(callback) {\n const ret = new Promise((resolve, reject) => {\n list_1.List.Add(this.queue, async function () {\n try {\n const ret = await callback();\n resolve(ret);\n }\n catch (e) {\n reject(e);\n }\n });\n });\n this.Start();\n return ret;\n }\n Stop() {\n list_1.List.Clear(this.queue);\n }\n Start() {\n if (this.running)\n return;\n this.running = true;\n this.ExecuteQueue();\n }\n async ExecuteQueue() {\n const callback = list_1.List.Pop(this.queue);\n if (callback !== null) {\n await callback();\n this.ExecuteQueue();\n }\n else\n this.running = false;\n }\n}\nexports.AsyncQueue = AsyncQueue;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.State = State;\nexports.StateSync = StateSync;\nexports.StateAsync = StateAsync;\nexports.Scope = Scope;\nexports.DestroyScope = DestroyScope;\nexports.Computed = Computed;\nexports.ComputedAsync = ComputedAsync;\nexports.Inject = Inject;\nexports.Destroy = Destroy;\nexports.PreReqTemplate = PreReqTemplate;\nexports.PreReq = PreReq;\nconst Store_1 = require(\"../Store\");\nconst observableScope_1 = require(\"../Store/Tree/observableScope\");\nconst observableTree_1 = require(\"../Store/Tree/observableTree\");\nconst observableNode_1 = require(\"../Store/Tree/observableNode\");\nfunction State() {\n return StateDecorator;\n}\nfunction StateDecorator(target, propertyKey) {\n const propKey = `StoreDecorator_${propertyKey}`;\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n const map = this.DecoratorMap;\n const node = map.get(propKey);\n return node;\n },\n set: function (val) {\n const map = this.DecoratorMap;\n const node = map.get(propKey);\n if (!node)\n map.set(propKey, observableNode_1.ObservableNode.Create(val));\n else {\n const keys = Object.keys(val);\n for (let x = 0; x < keys.length; x++)\n node[keys[x]] = val[keys[x]];\n }\n }\n };\n}\nfunction StateSync() {\n return StateSyncDecorator;\n}\nfunction StateSyncDecorator(target, propertyKey) {\n const propKey = `StoreSyncDecorator_${propertyKey}`;\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n const map = this.DecoratorMap;\n const node = map.get(propKey);\n return node;\n },\n set: function (val) {\n const map = this.DecoratorMap;\n const node = map.get(propKey);\n if (!node)\n map.set(propKey, observableNode_1.ObservableNode.Create(val));\n else {\n const keys = Object.keys(val);\n for (let x = 0; x < keys.length; x++)\n node[keys[x]] = val[keys[x]];\n }\n }\n };\n}\nfunction StateAsync() {\n return StateAsyncDecorator;\n}\nfunction StateAsyncDecorator(target, propertyKey) {\n const propKey = `StoreAsyncDecorator_${propertyKey}`;\n const scopeKey = `StoreAsyncDecorator_Scope_${propertyKey}`;\n DestroyDecorator(target, propKey);\n DestroyDecorator(target, scopeKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var scope = map.get(scopeKey);\n const value = scope && scope.Value;\n if (observableScope_1.ObservableScope.Watching())\n return value;\n return observableTree_1.ObservableTree.UnwrapProxyValues(value);\n },\n set: function (val) {\n var map = this.DecoratorMap;\n var store = map.get(propKey);\n if (!store) {\n store = new Store_1.StoreAsync((val) => val.___id, { ___id: \"ROOT\", data: val });\n map.set(propKey, store);\n map.set(scopeKey, store.Scope(\"ROOT\", val => val.data));\n }\n else\n store.Action(\"ROOT\", async (root, writer) => await writer.Merge(root.data, val));\n }\n };\n}\nfunction Scope() {\n return ScopeDecorator;\n}\nfunction ScopeDecorator(target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"Scope decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"Scope decorator does not support setters\";\n const propKey = `ScopeDecorator_${propertyKey}`;\n DestroyDecorator(target, propKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var scope = map.get(propKey);\n if (!scope) {\n const getter = descriptor.get.bind(this);\n scope = new observableScope_1.ObservableScope(getter);\n map.set(propKey, scope);\n }\n return scope.Value;\n }\n };\n}\nfunction DestroyScope() {\n return DestroyScopeDecorator;\n}\nfunction DestroyScopeDecorator(target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"Destroy Scope decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"Destroy Scope decorator does not support setters\";\n const propKey = `ScopeDecorator_${propertyKey}`;\n DestroyDecorator(target, propKey);\n const valKey = `ScopeDecorator_${propertyKey}_Value`;\n DestroyDecorator(target, valKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var scope = map.get(propKey);\n if (!scope) {\n const getter = descriptor.get.bind(this);\n scope = new observableScope_1.ObservableScope(getter);\n map.set(propKey, scope);\n scope.Watch(scope => {\n var lastValue = map.get(valKey);\n lastValue && lastValue.Destroy();\n map.set(valKey, scope.Value);\n });\n }\n return scope.Value;\n }\n };\n}\nfunction Computed() {\n return ComputedDecorator;\n}\nfunction ComputedDecorator(target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"Computed decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"Computed decorator does not support setters\";\n const scopeKey = `ComputedDecorator_Scope_${propertyKey}`;\n const storeKey = `ComputedDecorator_Store_${propertyKey}`;\n DestroyDecorator(target, scopeKey);\n DestroyDecorator(target, storeKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var store = map.get(storeKey);\n if (!store) {\n const getter = descriptor.get.bind(this);\n const scope = new observableScope_1.ObservableScope(getter);\n store = new Store_1.StoreSync(scope.Value);\n scope.Watch(scope => {\n if (!this.Destroyed)\n store.Write(scope.Value);\n });\n map.set(scopeKey, scope);\n map.set(storeKey, store);\n }\n return store.Root.Value;\n }\n };\n}\nfunction ComputedAsync(idFunc) {\n return ComputedAsyncDecorator.bind(null, idFunc);\n}\nfunction ComputedAsyncDecorator(idFunc, target, propertyKey, descriptor) {\n if (!(descriptor && descriptor.get))\n throw \"ComputedAsync decorator requires a getter\";\n if (descriptor && descriptor.set)\n throw \"ComputedAsync decorator does not support setters\";\n const scopeKey = `ComputedDecorator_Scope_${propertyKey}`;\n const storeKey = `ComputedDecorator_Store_${propertyKey}`;\n const storeScopeKey = `ComputedDecorator_StoreScope_${propertyKey}`;\n DestroyDecorator(target, scopeKey);\n DestroyDecorator(target, storeKey);\n DestroyDecorator(target, storeScopeKey);\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n var map = this.DecoratorMap;\n var storeScope = map.get(storeScopeKey);\n if (!storeScope) {\n const getter = descriptor.get.bind(this);\n const scope = new observableScope_1.ObservableScope(() => {\n var value = getter();\n if (value && typeof value.toJSON === 'function')\n value = value.toJSON();\n return value;\n });\n const store = new Store_1.StoreAsync((val) => val._id, { _id: \"ROOT\", data: scope.Value });\n scope.Watch(scope => {\n if (!this.Destroyed)\n store.Write({ _id: \"ROOT\", data: scope.Value });\n });\n storeScope = store.Scope(\"ROOT\", (val) => val.data);\n map.set(storeScopeKey, storeScope);\n map.set(scopeKey, scope);\n map.set(storeKey, store);\n }\n return storeScope.Value;\n }\n };\n}\nfunction Inject(type) {\n return InjectorDecorator.bind(null, type);\n}\nfunction InjectorDecorator(type, target, propertyKey, descriptor) {\n return {\n configurable: false,\n enumerable: true,\n get: function () {\n return this.Injector.Get(type);\n },\n set: function (val) {\n this.Injector.Set(type, val);\n }\n };\n}\nfunction Destroy() {\n return DestroyDecorator;\n}\n(function (Destroy) {\n function Get(value) {\n return value && value.DestroyDecorator_Destroys || [];\n }\n function All(value) {\n var arr = Get(value);\n arr.map(prop => (value[prop] || value.DecoratorMap.get(prop)))\n .filter(o => !!o)\n .forEach(o => o.Destroy());\n }\n Destroy.All = All;\n})(Destroy || (exports.Destroy = Destroy = {}));\nfunction DestroyDecorator(target, propertyKey) {\n var proto = target;\n proto.DestroyDecorator_Destroys = proto.DestroyDecorator_Destroys || [];\n proto.DestroyDecorator_Destroys.push(propertyKey);\n}\nfunction PreReqTemplate(template) {\n return PreReqTemplateDecorator.bind(null, template);\n}\n(function (PreReqTemplate) {\n function Get(value) {\n var func = value && value.PreReqTemplateDecorator_Template;\n var ret = func ? func() : [];\n if (!Array.isArray(ret))\n ret = [ret];\n return ret;\n }\n PreReqTemplate.Get = Get;\n})(PreReqTemplate || (exports.PreReqTemplate = PreReqTemplate = {}));\nfunction PreReqTemplateDecorator(template, target) {\n var proto = target.prototype;\n proto.PreReqTemplateDecorator_Template = template;\n}\nfunction PreReq() {\n return PreReqDecorator;\n}\n(function (PreReq) {\n function Get(value) {\n return value && value.PreReqDecorator_PreReqs || [];\n }\n function All(value) {\n var arr = Get(value).map((prop) => (value[prop] && value[prop].Init) || Promise.resolve());\n return Promise.all(arr);\n }\n PreReq.All = All;\n function Has(value) {\n return Get(value).length > 0;\n }\n PreReq.Has = Has;\n})(PreReq || (exports.PreReq = PreReq = {}));\nfunction PreReqDecorator(target, propertyKey) {\n var proto = target;\n proto.PreReqDecorator_PreReqs = proto.PreReqDecorator_PreReqs || [];\n proto.PreReqDecorator_PreReqs.push(propertyKey);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Emitter = void 0;\nvar Emitter;\n(function (Emitter) {\n function Create() {\n return new Set();\n }\n Emitter.Create = Create;\n function On(emitter, callback) {\n emitter.add(callback);\n }\n Emitter.On = On;\n function Emit(emitter, ...args) {\n let cleanup;\n emitter.forEach(function (cb) {\n const result = cb(...args);\n if (result === true) {\n cleanup ??= [];\n cleanup.push(cb);\n }\n });\n for (let x = 0; cleanup !== undefined && x < cleanup.length; x++)\n Remove(emitter, cleanup[x]);\n }\n Emitter.Emit = Emit;\n function Remove(emitter, callback) {\n emitter.delete(callback);\n }\n Emitter.Remove = Remove;\n})(Emitter || (exports.Emitter = Emitter = {}));\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./decorators\"), exports);\n__exportStar(require(\"./animation\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Injector = void 0;\nclass Injector {\n parent;\n typeMap;\n constructor() {\n this.parent = Injector.Current();\n this.typeMap = new Map();\n }\n Get(type) {\n if (this.typeMap.size === 0)\n return this.parent && this.parent.Get(type);\n var ret = this.typeMap.get(type);\n if (!ret)\n ret = this.parent && this.parent.Get(type);\n return ret;\n }\n Set(type, instance) {\n this.typeMap.set(type, instance);\n }\n}\nexports.Injector = Injector;\n(function (Injector) {\n var scope = null;\n function Current() {\n return scope;\n }\n Injector.Current = Current;\n function Scope(injector, action, ...args) {\n var parent = Current();\n scope = injector;\n const ret = action(...args);\n scope = parent;\n return ret;\n }\n Injector.Scope = Scope;\n})(Injector || (exports.Injector = Injector = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.JsonType = JsonType;\nexports.JsonDeepClone = JsonDeepClone;\nexports.JsonDiff = JsonDiff;\nconst jsonProto = Object.getPrototypeOf({});\nfunction JsonType(value) {\n if (value === null || value === undefined)\n return 'value';\n if (Array.isArray(value))\n return 'array';\n if (jsonProto === Object.getPrototypeOf(value))\n return 'object';\n return 'value';\n}\nfunction JsonDeepClone(value) {\n const type = JsonType(value);\n switch (type) {\n case 'array':\n return value.map(JsonDeepClone);\n case 'object': {\n const ret = {};\n const keys = Object.keys(value);\n for (let x = 0; x < keys.length; x++)\n ret[keys[x]] = JsonDeepClone(value[keys[x]]);\n return ret;\n }\n default:\n return value;\n }\n}\nfunction JsonDiff(newValue, oldValue) {\n const result = [];\n JsonDiffRecursive([], newValue, oldValue, result);\n return result;\n}\nfunction JsonDiffRecursive(path, newValue, oldValue, resp) {\n if (newValue === oldValue)\n return false;\n const newType = JsonType(newValue);\n const oldType = JsonType(oldValue);\n const changedPathLength = resp.length;\n let allChildrenChanged = true;\n if (newType === oldType)\n switch (newType) {\n case 'array': {\n allChildrenChanged = JsonDiffArrays(path, newValue, oldValue, resp);\n break;\n }\n case 'object': {\n allChildrenChanged = JsonDiffObjects(path, newValue, oldValue, resp);\n break;\n }\n }\n if (allChildrenChanged) {\n resp.splice(changedPathLength);\n resp.push({\n path,\n value: newValue\n });\n return true;\n }\n return false;\n}\nfunction JsonDiffArrays(path, newValue, oldValue, resp) {\n let allChildrenChanged = true;\n if (newValue.length !== oldValue.length)\n resp.push({\n path: path.concat('length'),\n value: newValue.length\n });\n if (newValue.length > 0 || oldValue.length > 0) {\n for (let y = 0; y < newValue.length; y++) {\n const arrayPath = path.concat(y);\n const oldValueElem = oldValue[y];\n allChildrenChanged = JsonDiffRecursive(arrayPath, newValue[y], oldValueElem, resp) && allChildrenChanged;\n }\n }\n else\n allChildrenChanged = false;\n return allChildrenChanged;\n}\nfunction JsonDiffObjects(path, newValue, oldValue, resp) {\n const newKeys = Object.keys(newValue).sort();\n const oldKeys = Object.keys(oldValue).sort();\n if (newKeys.length === 0 && oldKeys.length === 0)\n return false;\n if (newKeys.length < oldKeys.length)\n return true;\n let newKeyIndex = 0;\n let oldKeyIndex = 0;\n while (newKeyIndex < newKeys.length) {\n const childPath = path.concat(newKeys[newKeyIndex]);\n if (oldKeyIndex < oldKeys.length && newKeys[newKeyIndex] === oldKeys[oldKeyIndex]) {\n JsonDiffRecursive(childPath, newValue[newKeys[newKeyIndex]], oldValue[oldKeys[oldKeyIndex]], resp);\n oldKeyIndex++;\n }\n else if (newValue[newKeys[newKeyIndex]] !== undefined) {\n resp.push({\n path: childPath,\n value: newValue[newKeys[newKeyIndex]]\n });\n }\n newKeyIndex++;\n }\n if (oldKeyIndex < oldKeys.length)\n return true;\n return false;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.List = void 0;\nvar List;\n(function (List) {\n function Create() {\n return {\n head: null,\n tail: null,\n size: 0\n };\n }\n List.Create = Create;\n function Clear(list) {\n list.head = null;\n list.tail = null;\n list.size = 0;\n }\n List.Clear = Clear;\n function Push(list, data) {\n const node = { previous: null, next: null, data: data };\n if (list.size === 0) {\n list.head = node;\n list.tail = node;\n list.size = 1;\n }\n else {\n node.next = list.head;\n list.head.previous = node;\n list.head = node;\n list.size++;\n }\n return node;\n }\n List.Push = Push;\n function Pop(list) {\n if (list.size === 0)\n return null;\n const node = list.head;\n list.head = node.next;\n if (list.head)\n list.head.previous = null;\n list.size--;\n if (list.size === 0)\n list.tail = null;\n return node.data;\n }\n List.Pop = Pop;\n function Add(list, data) {\n const node = { previous: null, next: null, data: data };\n return AddNode(list, node);\n }\n List.Add = Add;\n function AddNode(list, node) {\n if (list.size === 0) {\n list.head = node;\n list.tail = node;\n list.size = 1;\n }\n else {\n node.previous = list.tail;\n list.tail.next = node;\n list.tail = node;\n list.size++;\n }\n return node;\n }\n List.AddNode = AddNode;\n function AddBefore(list, node, data) {\n if (!node)\n return List.Add(list, data);\n const newNode = { previous: null, next: null, data: data };\n const prevNode = node.previous;\n newNode.next = node;\n node.previous = newNode;\n if (list.head === node)\n list.head = newNode;\n if (prevNode) {\n prevNode.next = newNode;\n newNode.previous = prevNode;\n }\n list.size++;\n return newNode;\n }\n List.AddBefore = AddBefore;\n function AddAfter(list, node, data) {\n if (!node)\n return List.Push(list, data);\n const newNode = { previous: null, next: null, data: data };\n const nextNode = node.next;\n node.next = newNode;\n newNode.previous = node;\n if (list.tail === node)\n list.tail = newNode;\n if (nextNode) {\n nextNode.previous = newNode;\n newNode.next = nextNode;\n }\n list.size++;\n return newNode;\n }\n List.AddAfter = AddAfter;\n function Remove(list) {\n if (list.size === 0)\n return null;\n var node = list.tail;\n list.tail = node.previous;\n if (list.tail)\n list.tail.next = null;\n list.size--;\n if (list.size === 0)\n list.head = null;\n return node.data;\n }\n List.Remove = Remove;\n function RemoveNode(list, node) {\n if (list.head === node) {\n list.head = node.next;\n }\n else if (list.tail === node) {\n list.tail = node.previous;\n }\n else {\n const prev = node.previous;\n const next = node.next;\n prev.next = next;\n next.previous = prev;\n }\n node.next = node.previous = null;\n list.size--;\n if (list.size > 0)\n list.head.previous = list.tail.next = null;\n }\n List.RemoveNode = RemoveNode;\n function ForEach(list, callback) {\n let node = list.head;\n while (node) {\n callback(node.data);\n node = node.next;\n }\n }\n List.ForEach = ForEach;\n function ToNodeMap(list, keyCallback) {\n const map = new Map();\n let node = list.head;\n while (node) {\n const key = keyCallback(node.data);\n const nodes = map.get(key) || [node];\n if (nodes[0] !== node)\n nodes.push(node);\n else\n map.set(key, nodes);\n node = node.next;\n }\n return map;\n }\n List.ToNodeMap = ToNodeMap;\n})(List || (exports.List = List = {}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Schedule = Schedule;\nexports.After = After;\nexports.Callback = Callback;\nexports.Synch = Synch;\nexports.Thread = Thread;\nexports.ThreadAsync = ThreadAsync;\nconst list_1 = require(\"./list\");\nconst workTimeMs = 16;\nconst contextQueue = list_1.List.Create();\nlet threadContext = null;\nlet timeoutRunning = false;\nconst scheduleCallback = setTimeout;\nfunction timeRemaining() {\n return this.end - Date.now();\n}\nfunction createDeadline() {\n return {\n end: Date.now() + workTimeMs,\n timeRemaining\n };\n}\nfunction ProcessQueue(deadline = createDeadline()) {\n let ctx;\n while (deadline.timeRemaining() > 0 && (ctx = list_1.List.Pop(contextQueue)))\n DoWork(ctx, deadline);\n if (contextQueue.size > 0)\n scheduleCallback(ProcessQueue);\n else\n timeoutRunning = false;\n}\nfunction ScheduleWork(ctx) {\n list_1.List.Add(contextQueue, ctx);\n if (timeoutRunning)\n return;\n timeoutRunning = true;\n scheduleCallback(ProcessQueue);\n}\nfunction Invoke(ctx, callback) {\n const parent = ctx.workEndNode;\n ctx.workEndNode = ctx.workList.head;\n callback(true);\n ctx.workEndNode = parent;\n}\nfunction DoWork(ctx, deadline = createDeadline()) {\n const parentContext = threadContext;\n threadContext = ctx;\n const async = ctx.async;\n let callback;\n while (async === ctx.async && deadline.timeRemaining() > 0 && (callback = list_1.List.Pop(ctx.workList)))\n Invoke(ctx, callback);\n if (ctx.workList.size > 0)\n ScheduleWork(ctx);\n threadContext = parentContext;\n}\nfunction CreateContext() {\n return {\n async: false,\n workEndNode: null,\n workList: list_1.List.Create()\n };\n}\nfunction ScheduleCallback(callback, before, async) {\n threadContext = threadContext || CreateContext();\n threadContext.async = threadContext.async || async;\n if (before)\n list_1.List.AddBefore(threadContext.workList, threadContext.workEndNode, callback);\n else if (threadContext.workEndNode)\n list_1.List.AddAfter(threadContext.workList, threadContext.workEndNode, callback);\n else\n threadContext.workEndNode = list_1.List.Add(threadContext.workList, callback);\n}\nfunction SynchWithoutThread(callback) {\n callback(false);\n if (threadContext)\n if (threadContext.async)\n ScheduleWork(threadContext);\n else\n DoWork(threadContext);\n threadContext = null;\n}\nfunction Schedule(callback) {\n ScheduleCallback(callback, true, true);\n}\nfunction After(callback) {\n ScheduleCallback(callback, false, false);\n}\nfunction Callback(callback) {\n return function (a, b, c, d) {\n Schedule(function () { callback(a, b, c, d); });\n };\n}\nvar inSynchCallback = false;\nfunction Synch(callback) {\n if (threadContext || inSynchCallback)\n callback(false);\n else {\n inSynchCallback = true;\n SynchWithoutThread(callback);\n inSynchCallback = false;\n }\n}\nfunction Thread(callback) {\n if (threadContext)\n ScheduleCallback(callback, true, false);\n else\n Synch(callback);\n}\nfunction ThreadAsync(callback) {\n return new Promise(resolve => Thread(function (async) {\n callback(async);\n Thread(resolve);\n }));\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Component = void 0;\nvar component_1 = require(\"./Node/component\");\nObject.defineProperty(exports, \"Component\", { enumerable: true, get: function () { return component_1.Component; } });\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableComputed = exports.ObservableNode = exports.StoreAsync = exports.Store = exports.ObservableScope = void 0;\n__exportStar(require(\"./index\"), exports);\n__exportStar(require(\"./Utils\"), exports);\nvar Store_1 = require(\"./Store\");\nObject.defineProperty(exports, \"ObservableScope\", { enumerable: true, get: function () { return Store_1.ObservableScope; } });\nObject.defineProperty(exports, \"Store\", { enumerable: true, get: function () { return Store_1.Store; } });\nObject.defineProperty(exports, \"StoreAsync\", { enumerable: true, get: function () { return Store_1.StoreAsync; } });\nObject.defineProperty(exports, \"ObservableNode\", { enumerable: true, get: function () { return Store_1.ObservableNode; } });\nObject.defineProperty(exports, \"ObservableComputed\", { enumerable: true, get: function () { return Store_1.ObservableComputed; } });\n__exportStar(require(\"./DOM\"), exports);\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst Web = require(\"./web.export\");\nfor (var key in Web)\n window[key] = Web[key];\n"],"names":["DefaultAssignment","target","writeTo","next","event","value","lastValue","removeEventListener","addEventListener","AssignEvent","Object","defineProperty","exports","CreateEventAssignment","priorKeys","nextKeys","keys","undefined","concat","x","length","CreateNodeValueAssignment","nodeValue","CreatePropertyAssignment","json_1","ValueAssignment","start","selectionStart","end","selectionEnd","ownerDocument","activeElement","setSelectionRange","CreateValueAssignment","prop","JsonType","AssignProp","root","DOMNodeConfig","window_1","list_1","createPropertyAssignment_1","createEventAssignment_1","pendingUpdates","List","Create","updateScheduled","processUpdates","Add","Date","now","callback","Pop","size","wndw","requestAnimationFrame","createNode","type","namespace","document","createElementNS","createElement","createTextNode","scheduleUpdate","addListener","removeListener","addChild","child","appendChild","addChildFirst","addChildBefore","firstChild","sibling","insertBefore","addChildAfter","nextSibling","removeChild","remove","parentNode","setText","text","textContent","getAttribute","attribute","setAttribute","createPropertyAssignment","nodeType","Node","TEXT_NODE","createEventAssignment","fireEvent","data","cEvent","CustomEvent","dispatchEvent","getFirstChild","getLastChild","lastChild","getNextSibling","replaceChildren","children","div","nodeDef","elementNode_1","ElementNode","a","ul","li","br","b","span","img","video","source","input","textarea","select","option","h1","h2","h3","p","style","button","table","th","tr","td","__createBinding","this","create","o","m","k","k2","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","__exportStar","prototype","hasOwnProperty","call","svg","svgNs","g","circle","window","BoundNode","nodeConfig_1","observableScope_1","SetAttributes","node","attributes","key","NodeConfig","Init","boundNode","props","scope","ObservableScope","scopes","push","assignProperties","Watch","setProperties","destroyed","Value","ScheduleSetProperties","attrs","setAttributes","ScheduleSetAttributes","on","assignEvents","setEvents","ScheduleSetEvents","Component","nodeRef_1","componentNode_1","decorators_1","nodeRef","componentEvents","templates","decoratorMap","Injector","injector","Destroyed","DecoratorMap","Scope","Data","NodeRef","Templates","constructor","Map","Template","Bound","Fire","eventCallback","Destroy","All","ToFunction","ComponentNode","Attach","rootRef","Wrap","AddChild","Register","name","componentFunction","WebComponent","HTMLElement","super","attachShadow","mode","customElements","define","boundNode_1","component_1","injector_1","thread_1","InvokeNodeTemplate","nodes","component","Array","isArray","AddTemplate","init","Thread","Schedule","InitAll","list","ReconcileChildren","After","setTimeout","compNode","NodeRefType","componentNode","events","PreReq","Has","Promise","resolve","preNodes","PreReqTemplate","Get","then","DetachChild","AddPreReqTemplate","elemNode","childrenFunc","elementNode","dataScope","childNodes","Set","setData","SetData","GetValue","ScheduleSetData","Synch","CreateNodeArray","defaultNodeList","valueDefault","GetDataValue","values","nextNodeList","initNodeList","currentNodeList","nodeList","nodeMap","ToNodeMap","curNode","nodeArr","y","RemoveNode","AddNode","head","curDetach","delete","DestroyAll","Clear","ReconcileNodeData","attachNodes","startSize","async","newNodes","textNode","domNodeConfig_1","Store_1","nodeNamespace","Current","parent","lastEvents","AddChildToNode","add","forEach","nodeRefs","AddChildAfter","currentChild","newChild","nextChildren","rootNode","priorNode","curDataNode","insert","actualNode","expectedNode","DiffAsync","diffTree_1","workerQueue_1","diffWorker_1","diffCnstr","DiffTreeScope","workerQueue","keyFunc","WorkerQueue","DiffWorker","Push","method","arguments","toString","GetKeyRef","ReadKeyRef","ref","DiffPath","path","DiffBatch","UpdatePath","GetPath","DiffSync","diffTree","worker","ctx","onmessage","eval","DiffTree","postMessage","diff","ret","jsonConstructor","IsValue","Type","TypeOf","JsonDiffRecursive","newValue","oldValue","resp","newType","oldType","changedPathLength","allChildrenChanged","JsonDiffArrays","JsonDiffObjects","splice","newKeys","oldKeys","newKeyIndex","oldKeyIndex","childPath","BreakUpValue","map","isValue","keyRef","subProp","set","rootStateMap","matches","match","RunDiff","SetPathValue","GetPathValue","diffResp","breakupMap","GetBreakUpMap","currentValue","split","reduce","pre","curr","index","parts","workerConstructor","workerParameter","Worker","URL","createObjectURL","Blob","callbacks","onerror","err","cb","message","reject","terminate","Store","observableTree_1","storeWriter_1","observableTree","ObservableTree","storeWriter","StoreWriter","rootScope","Root","Write","Action","action","writer","Merge","StoreAsync","diffAsync_1","storeAsyncWriter_1","asyncQueue_1","idFunc","diffAsync","asyncWriter","asyncQueue","StoreAsyncWriter","AsyncQueue","id","func","Next","val","Stop","GetPathOf","Error","ApplyChanges","rootPath","lengthPath","Splice","deleteCount","items","array","slice","WriteAll","StoreSync","diffSync_1","storeSyncWriter_1","diffSync","StoreSyncWriter","toJSON","copy","ObservableComputed","observableNode_1","scheduleNodes","computedQueue","updateNode","JsonDeepClone","computing","compute","ObservableNode","has","queueMicrotask","clear","ForEach","scheduleComputed","CreateComputed","proxyCache","WeakMap","scopeCache","getOwnPropertyDescriptorArray","hasOwn","hasArray","ownKeys","ownKeysArray","UnwrapProxy","ArrayProxySetter","Update","ArrayProxyGetter","arrayValue","args","proxyArray","CreateProxy","result","applyingDiff","ObjectProxySetter","object","proxy","json","JsonDiff","ObjectProxyGetter","proxyValue","Proxy","CreateObjectProxy","CreateArrayProxy","Touch","ObservableScopeWrapper","ObservableScopeValue","emitter_1","scopeEmitter","emitter","Emitter","On","Emit","Unwatch","Remove","DestroyScope","getFunction","currentSet","watching","OnSet","dirty","dependencies","emitters","setCallback","valueFunction","hasFunction","Symbol","toStringTag","parentSet","parentWatching","lastSet","WatchAction","newEmitters","e","UpdateEmitters","UpdateValue","Watching","valuePathResolver","undefinedScope","leafScopeCache","pathCache","UnwrapProxyValues","arr","GetParentScope","obj","WritePath","scopeSet","GetValueProxy","GetPropertyScope","leafScopes","parentScope","isNaN","parseInt","bind","UpdatePathCache","pathParts","parentValue","join","store_1","storeSync_1","storeAsync_1","observableComputed_1","StepFunctions","AnimationType","Animation","EaseIn","count","t","Linear","frameCount","frameTimings","update","animationTimeouts","running","enabled","Running","Start","End","Enabled","duration","Math","ceil","frameTime","Animate","Cancel","stepFunc","step","SetTimeout","Disable","Enable","clearTimeout","queue","ExecuteQueue","State","StateDecorator","StateSync","StateSyncDecorator","StateAsync","StateAsyncDecorator","ScopeDecorator","DestroyScopeDecorator","Computed","ComputedDecorator","ComputedAsync","ComputedAsyncDecorator","Inject","InjectorDecorator","propertyKey","propKey","scopeKey","DestroyDecorator","store","___id","descriptor","getter","valKey","storeKey","storeScopeKey","storeScope","_id","proto","DestroyDecorator_Destroys","template","PreReqTemplateDecorator","PreReqTemplateDecorator_Template","PreReqDecorator","PreReqDecorator_PreReqs","filter","all","cleanup","typeMap","instance","jsonProto","getPrototypeOf","arrayPath","oldValueElem","sort","tail","previous","AddBefore","newNode","prevNode","AddAfter","nextNode","prev","keyCallback","ScheduleCallback","Callback","c","d","ThreadAsync","workTimeMs","contextQueue","threadContext","timeoutRunning","scheduleCallback","timeRemaining","createDeadline","ProcessQueue","deadline","DoWork","ScheduleWork","Invoke","workEndNode","workList","parentContext","before","inSynchCallback","SynchWithoutThread","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","module","__webpack_modules__","Web"],"sourceRoot":""}