taggedjs 2.5.13 → 2.5.15

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 (209) hide show
  1. package/bundle.js +1 -4784
  2. package/bundle.js.gz +0 -0
  3. package/bundle.js.map +1 -1
  4. package/bundle.js.map.gz +0 -0
  5. package/js/alterProps.function.d.ts +1 -1
  6. package/js/alterProps.function.js +6 -6
  7. package/js/alterProps.function.js.map +1 -1
  8. package/js/index.d.ts +19 -21
  9. package/js/index.js +18 -20
  10. package/js/index.js.map +1 -1
  11. package/js/insertAfter.function.d.ts +1 -1
  12. package/js/interpolations/Clones.type.d.ts +1 -1
  13. package/js/interpolations/afterInterpolateElement.function.d.ts +3 -3
  14. package/js/interpolations/afterInterpolateElement.function.js +2 -2
  15. package/js/interpolations/afterInterpolateElement.function.js.map +1 -1
  16. package/js/interpolations/bindSubjectCallback.function.d.ts +1 -1
  17. package/js/interpolations/bindSubjectCallback.function.js +1 -1
  18. package/js/interpolations/bindSubjectCallback.function.js.map +1 -1
  19. package/js/interpolations/elementInitCheck.d.ts +1 -1
  20. package/js/interpolations/interpolateAttributes.d.ts +2 -2
  21. package/js/interpolations/interpolateAttributes.js +1 -1
  22. package/js/interpolations/interpolateAttributes.js.map +1 -1
  23. package/js/interpolations/interpolateContentTemplates.d.ts +4 -4
  24. package/js/interpolations/interpolateContentTemplates.js +1 -1
  25. package/js/interpolations/interpolateContentTemplates.js.map +1 -1
  26. package/js/interpolations/interpolateElement.d.ts +5 -5
  27. package/js/interpolations/interpolateElement.js +4 -4
  28. package/js/interpolations/interpolateElement.js.map +1 -1
  29. package/js/interpolations/interpolateTemplate.d.ts +5 -5
  30. package/js/interpolations/interpolateTemplate.js +8 -8
  31. package/js/interpolations/interpolateTemplate.js.map +1 -1
  32. package/js/interpolations/processAttribute.function.d.ts +3 -3
  33. package/js/interpolations/processAttribute.function.js +3 -3
  34. package/js/interpolations/processAttribute.function.js.map +1 -1
  35. package/js/interpolations/scanTextAreaValue.function.d.ts +2 -2
  36. package/js/interpolations/scanTextAreaValue.function.js +1 -1
  37. package/js/interpolations/scanTextAreaValue.function.js.map +1 -1
  38. package/js/isInstance.d.ts +5 -5
  39. package/js/isInstance.js +12 -8
  40. package/js/isInstance.js.map +1 -1
  41. package/js/render.d.ts +1 -1
  42. package/js/state/callbackMaker.function.js +5 -5
  43. package/js/state/callbackMaker.function.js.map +1 -1
  44. package/js/state/children.d.ts +1 -1
  45. package/js/state/children.js +1 -1
  46. package/js/state/children.js.map +1 -1
  47. package/js/state/index.d.ts +12 -12
  48. package/js/state/index.js +11 -11
  49. package/js/state/index.js.map +1 -1
  50. package/js/state/letProp.function.d.ts +1 -1
  51. package/js/state/letProp.function.js +2 -2
  52. package/js/state/letProp.function.js.map +1 -1
  53. package/js/state/letState.function.d.ts +1 -1
  54. package/js/state/letState.function.js +2 -2
  55. package/js/state/letState.function.js.map +1 -1
  56. package/js/state/onDestroy.js +1 -1
  57. package/js/state/onDestroy.js.map +1 -1
  58. package/js/state/onInit.js +1 -1
  59. package/js/state/onInit.js.map +1 -1
  60. package/js/state/provider.utils.d.ts +1 -1
  61. package/js/state/provider.utils.js +2 -2
  62. package/js/state/provider.utils.js.map +1 -1
  63. package/js/state/providers.d.ts +1 -1
  64. package/js/state/providers.js +3 -3
  65. package/js/state/providers.js.map +1 -1
  66. package/js/state/setUse.function.d.ts +3 -3
  67. package/js/state/state.function.js +3 -3
  68. package/js/state/state.function.js.map +1 -1
  69. package/js/state/state.utils.d.ts +1 -1
  70. package/js/state/state.utils.js +2 -2
  71. package/js/state/state.utils.js.map +1 -1
  72. package/js/state/subject.function.d.ts +2 -2
  73. package/js/state/subject.function.js +6 -6
  74. package/js/state/subject.function.js.map +1 -1
  75. package/js/state/syncStates.function.d.ts +1 -1
  76. package/js/state/watch.function.d.ts +1 -1
  77. package/js/state/watch.function.js +6 -25
  78. package/js/state/watch.function.js.map +1 -1
  79. package/js/subject/Subject.class.d.ts +8 -4
  80. package/js/subject/Subject.class.js +46 -15
  81. package/js/subject/Subject.class.js.map +1 -1
  82. package/js/subject/ValueSubject.d.ts +4 -3
  83. package/js/subject/ValueSubject.js +3 -2
  84. package/js/subject/ValueSubject.js.map +1 -1
  85. package/js/subject/combineLatest.function.d.ts +1 -1
  86. package/js/subject/combineLatest.function.js +1 -1
  87. package/js/subject/combineLatest.function.js.map +1 -1
  88. package/js/subject/index.d.ts +4 -4
  89. package/js/subject/index.js +4 -4
  90. package/js/subject/index.js.map +1 -1
  91. package/js/subject/subject.utils.d.ts +2 -2
  92. package/js/subject/subject.utils.js +5 -5
  93. package/js/subject/subject.utils.js.map +1 -1
  94. package/js/subject/will.functions.d.ts +1 -1
  95. package/js/subject.types.d.ts +6 -6
  96. package/js/tag/Tag.class.d.ts +8 -7
  97. package/js/tag/Tag.class.js +2 -1
  98. package/js/tag/Tag.class.js.map +1 -1
  99. package/js/tag/TagSupport.class.d.ts +10 -10
  100. package/js/tag/TagSupport.class.js +27 -27
  101. package/js/tag/TagSupport.class.js.map +1 -1
  102. package/js/{TemplaterResult.class.d.ts → tag/TemplaterResult.class.d.ts} +13 -13
  103. package/js/tag/TemplaterResult.class.js +22 -0
  104. package/js/tag/TemplaterResult.class.js.map +1 -0
  105. package/js/tag/ValueTypes.enum.d.ts +13 -0
  106. package/js/tag/ValueTypes.enum.js +15 -0
  107. package/js/tag/ValueTypes.enum.js.map +1 -0
  108. package/js/tag/checkDestroyPrevious.function.d.ts +6 -5
  109. package/js/tag/checkDestroyPrevious.function.js +11 -10
  110. package/js/tag/checkDestroyPrevious.function.js.map +1 -1
  111. package/js/tag/cloneValueArray.function.d.ts +1 -1
  112. package/js/tag/cloneValueArray.function.js +12 -11
  113. package/js/tag/cloneValueArray.function.js.map +1 -1
  114. package/js/tag/destroy.support.d.ts +1 -1
  115. package/js/tag/destroyTag.function.d.ts +1 -1
  116. package/js/tag/destroyTag.function.js.map +1 -1
  117. package/js/tag/getSupportInCycle.function.d.ts +1 -1
  118. package/js/tag/getSupportInCycle.function.js +1 -1
  119. package/js/tag/getSupportInCycle.function.js.map +1 -1
  120. package/js/tag/getTagWrap.function.d.ts +6 -0
  121. package/js/tag/getTagWrap.function.js +67 -0
  122. package/js/tag/getTagWrap.function.js.map +1 -0
  123. package/js/tag/hasPropChanges.function.d.ts +1 -1
  124. package/js/tag/hasPropChanges.function.js +1 -1
  125. package/js/tag/hasPropChanges.function.js.map +1 -1
  126. package/js/tag/hasTagSupportChanged.function.d.ts +2 -2
  127. package/js/tag/hasTagSupportChanged.function.js +1 -1
  128. package/js/tag/hasTagSupportChanged.function.js.map +1 -1
  129. package/js/tag/html.d.ts +3 -3
  130. package/js/tag/html.js +1 -1
  131. package/js/tag/html.js.map +1 -1
  132. package/js/tag/index.d.ts +5 -0
  133. package/js/tag/index.js +6 -0
  134. package/js/tag/index.js.map +1 -0
  135. package/js/tag/isLikeTags.function.d.ts +2 -2
  136. package/js/tag/kidsToTagArraySubject.function.d.ts +5 -0
  137. package/js/tag/kidsToTagArraySubject.function.js +21 -0
  138. package/js/tag/kidsToTagArraySubject.function.js.map +1 -0
  139. package/js/tag/render/renderExistingTag.function.d.ts +2 -2
  140. package/js/tag/render/renderExistingTag.function.js +3 -3
  141. package/js/tag/render/renderExistingTag.function.js.map +1 -1
  142. package/js/tag/render/renderSubjectComponent.function.d.ts +2 -2
  143. package/js/tag/render/renderSubjectComponent.function.js +1 -1
  144. package/js/tag/render/renderSubjectComponent.function.js.map +1 -1
  145. package/js/tag/render/renderTagOnly.function.d.ts +2 -2
  146. package/js/tag/render/renderTagOnly.function.js +3 -3
  147. package/js/tag/render/renderTagOnly.function.js.map +1 -1
  148. package/js/tag/render/renderTagSupport.function.d.ts +1 -1
  149. package/js/tag/render/renderTagSupport.function.js +2 -2
  150. package/js/tag/render/renderTagSupport.function.js.map +1 -1
  151. package/js/tag/render/renderWithSupport.function.d.ts +2 -2
  152. package/js/tag/render/renderWithSupport.function.js +3 -3
  153. package/js/tag/render/renderWithSupport.function.js.map +1 -1
  154. package/js/tag/setTagPlaceholder.function.d.ts +2 -2
  155. package/js/tag/tag.d.ts +9 -11
  156. package/js/tag/tag.js +25 -101
  157. package/js/tag/tag.js.map +1 -1
  158. package/js/tag/tag.types.d.ts +13 -0
  159. package/js/tag/tag.types.js +6 -0
  160. package/js/tag/tag.types.js.map +1 -0
  161. package/js/tag/tag.utils.d.ts +9 -4
  162. package/js/tag/tag.utils.js.map +1 -1
  163. package/js/tag/tagElement.d.ts +3 -3
  164. package/js/tag/tagElement.js +4 -4
  165. package/js/tag/tagElement.js.map +1 -1
  166. package/js/tag/tagRunner.d.ts +1 -1
  167. package/js/tag/tagRunner.js +3 -3
  168. package/js/tag/tagRunner.js.map +1 -1
  169. package/js/tag/update/ValueTypes.enum.d.ts +13 -0
  170. package/js/tag/update/ValueTypes.enum.js +15 -0
  171. package/js/tag/update/ValueTypes.enum.js.map +1 -0
  172. package/js/tag/update/processFirstSubject.utils.d.ts +11 -23
  173. package/js/tag/update/processFirstSubject.utils.js +28 -37
  174. package/js/tag/update/processFirstSubject.utils.js.map +1 -1
  175. package/js/tag/update/processFirstSubjectValue.function.d.ts +7 -4
  176. package/js/tag/update/processFirstSubjectValue.function.js +25 -22
  177. package/js/tag/update/processFirstSubjectValue.function.js.map +1 -1
  178. package/js/tag/update/processNewValue.function.d.ts +2 -2
  179. package/js/tag/update/processNewValue.function.js +5 -4
  180. package/js/tag/update/processNewValue.function.js.map +1 -1
  181. package/js/tag/update/processRegularValue.function.d.ts +1 -1
  182. package/js/tag/update/processRegularValue.function.js +1 -1
  183. package/js/tag/update/processRegularValue.function.js.map +1 -1
  184. package/js/tag/update/processSubjectComponent.function.d.ts +5 -5
  185. package/js/tag/update/processSubjectComponent.function.js +4 -4
  186. package/js/tag/update/processSubjectComponent.function.js.map +1 -1
  187. package/js/tag/update/processTag.function.d.ts +6 -6
  188. package/js/tag/update/processTag.function.js +11 -11
  189. package/js/tag/update/processTag.function.js.map +1 -1
  190. package/js/tag/update/processTagArray.d.ts +6 -6
  191. package/js/tag/update/processTagArray.js +6 -6
  192. package/js/tag/update/processTagArray.js.map +1 -1
  193. package/js/tag/update/processTagResult.function.d.ts +5 -5
  194. package/js/tag/update/updateContextItem.function.d.ts +2 -2
  195. package/js/tag/update/updateContextItem.function.js +5 -3
  196. package/js/tag/update/updateContextItem.function.js.map +1 -1
  197. package/js/tag/update/updateExistingTagComponent.function.d.ts +3 -3
  198. package/js/tag/update/updateExistingTagComponent.function.js +8 -8
  199. package/js/tag/update/updateExistingTagComponent.function.js.map +1 -1
  200. package/js/tag/update/updateExistingValue.function.d.ts +3 -3
  201. package/js/tag/update/updateExistingValue.function.js +14 -15
  202. package/js/tag/update/updateExistingValue.function.js.map +1 -1
  203. package/js/updateBeforeTemplate.function.d.ts +2 -2
  204. package/package.json +2 -1
  205. package/js/TemplaterResult.class.js +0 -23
  206. package/js/TemplaterResult.class.js.map +0 -1
  207. package/js/tag/update/processSubjectValue.function.d.ts +0 -7
  208. package/js/tag/update/processSubjectValue.function.js +0 -31
  209. package/js/tag/update/processSubjectValue.function.js.map +0 -1
package/bundle.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.js","mappings":";;;;;;;;;;;;;;;AAAsC;AACY;AACT;AAClC;AACP;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kDAAY;AAC/B;AACA;AACA;AACA;AACA,6BAA6B,+CAAG;AAChC,gBAAgB,4BAA4B,EAAE,+DAAqB;AACnE;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACrBuD;AAClB;AACqC;AACzC;AACoC;AACrE;AACO;AACP,sBAAsB,kDAAK;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,sEAAsE;AACtE;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,kBAAkB,kFAAiB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,yDAAS,CAAC,yDAAS;AACjD;AACA,aAAa;AACb;AACA,+BAA+B;AAC/B;AACA;AACA,uBAAuB,uFAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,0CAAM;AACV;AACA;;;;;;;;;;;;;;;;AC7DO;AACP;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,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;;;;;;;;;;;;;ACpGO;AACP;AACA,gDAAgD;AAChD;AACA;AACA,yBAAyB;AACzB;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACzBA;AACO;AACP;AACA;AACA;;;;;;;;;;;;ACJU;;;;;;;;;;;;;;;;;ACA8B;AACc;AAC/C;AACP,mBAAmB,oDAAW;AAC9B;AACA;AACA;AACA,wCAAwC,YAAY;AACpD;AACA,QAAQ,mEAAa;AACrB;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACbA;AAC2E;AACpE;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C,aAAa;AACb;AACA,+BAA+B;AAC/B;AACA,mBAAmB,uFAAgB;AACnC;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA,2BAA2B,uFAAgB;AAC3C;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;;;;;;;;;;;;;AC1CO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;;;;;;;;;;;;;;;AChBO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sBAAsB;AACtD;AACA;AACA;AACA;AACA,gCAAgC,sBAAsB;AACtD;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACpB+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,wBAAwB,0BAA0B;AAClD;AACA;AACA;AACA;AACA;AACA,QAAQ,4EAAgB;AACxB,sCAAsC;AACtC;AACA;;;;;;;;;;;;;;;;ACnB4D;AACrD;AACP;AACA;AACA;AACA;AACA;AACA,sCAAsC,YAAY;AAClD;AACA,gBAAgB,mCAAmC,EAAE,yEAAmB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,YAAY;AACpE;AACA;AACA;AACA,4BAA4B,eAAe,EAAE,yEAAmB;AAChE;AACA;AACA;AACA;AACA,wBAAwB,sDAAsD;AAC9E;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACtCgE;AACN;AACkB;AACZ;AAChE;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uDAAuD,EAAE,yFAA2B;AACpG;AACA;AACA;AACA,IAAI,6EAAqB;AACzB;AACA,aAAa;AACb;AACA;AACA,0CAA0C,YAAY;AACtD;AACA,QAAQ,6EAAqB;AAC7B;AACA;AACA;AACA;AACA;AACO;AACP,mBAAmB,uEAAsB;AACzC,0CAA0C,wDAAY,EAAE,0DAAc;AACtE;AACA;;;;;;;;;;;;;;;;;;;;;;;;ACnCkD;AACI;AACqC;AAChC;AACM;AACgB;AACZ;AAC9D;AACP,+BAA+B,WAAW,MAAM;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,UAAU;AAC3B;AACA;AACA,mCAAmC,0DAAc,aAAa,0DAAc;AAC5E,iBAAiB,UAAU;AAC3B;AACA;AACA,sBAAsB,2DAAc,2BAA2B,uDAAU;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACO;AACP;AACA;AACA;AACA,YAAY,6FAAmB;AAC/B;AACA;AACA;AACA,QAAQ,uGAAwB;AAChC,sBAAsB,WAAW;AACjC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,iFAAgB;AACtD;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,wBAAwB;AACxB;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,kCAAkC;AAClC;AACA,QAAQ,8EAAiB;AACzB;AACA;AACA,WAAW,mEAAgB;AAC3B;AACA;AACA,8CAA8C,YAAY;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACzFA;AACO,sGAAsG,WAAW,GAAG;AAC3H,eAAe,GAAG;AACX;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,GAAG;AACnD,KAAK;AACL,aAAa;AACb;;;;;;;;;;;;;;;;;;AChBkD;AACA;AACmB;AACrE,wBAAwB;AACxB,kBAAkB;AAClB;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+DAAc;AAC7B;AACA;AACA,yDAAyD;AACzD;AACA,8DAA8D,UAAU;AACxE;AACA;AACA;AACA;AACA,iCAAiC,8CAA8C;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAiB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,kFAAmB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+DAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AC/H+D;AAC/D,0EAA0E,IAAI;AACvE;AACP;AACA;AACA,+CAA+C,IAAI;AACnD;AACA,0BAA0B,cAAc;AACxC;AACA;AACA;AACA,QAAQ,4EAAgB;AACxB;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACdO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP,+EAA+E;AAC/E;AACO;AACP;AACA;;;;;;;;;;;;;;;ACrBO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;AChB2C;AACgC;AAC7B;AACK;AACmB;AACtE;AACA,cAAc,sDAAiB;AAC/B;AACO;AACP,sCAAsC;AACtC,wDAAM;AACN;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,KAAK;AACL,CAAC;AACM;AACP,uBAAuB,kFAAiB;AACxC;AACA,0BAA0B,sDAAiB;AAC3C;AACA;AACA,qBAAqB,oDAAM;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oDAAM;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gEAAU;AACd;AACA;AACA;AACA,IAAI,gEAAU;AACd;AACA;AACA;AACA;AACA;AACA,IAAI,uFAAgB;AACpB;AACA;AACA;AACA,YAAY,gEAAU;AACtB,YAAY,uFAAgB;AAC5B,SAAS;AACT;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACvE2C;AAC3C;AACA,IAAI,oDAAM;AACV;AACO;AACP,uBAAuB,oDAAM;AAC7B;AACA;AACA;AACA,wDAAM;AACN;AACA;AACA,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACZgC;AACU;AACF;AACN;AACA;AACY;AACP;AACC;AAChB;AACG;AACD;;;;;;;;;;;;;;;;;ACVoB;AACN;AACzC;AACA;AACA;AACA;AACA;AACO;AACP;AACA,qBAAqB,4DAAQ;AAC7B,QAAQ,sDAAK;AACb;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACd8C;AACH;AAC3C;AACO;AACP,mBAAmB,oDAAM;AACzB;AACA;AACA;AACA;AACA,uBAAuB,2DAAa;AACpC;AACA;AACA,uBAAuB,2DAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2DAAa;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACxC2C;AAC3C;AACA,IAAI,oDAAM;AACV;AACO;AACP,uBAAuB,oDAAM;AAC7B;AACA;AACA,wDAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;;;;ACjB0C;AAC3C;AACA,IAAI,oDAAM;AACV;AACO;AACP,uBAAuB,oDAAM;AAC7B;AACA;AACA,oBAAoB;AACpB;AACA;AACA,wDAAM;AACN;AACA;AACA,CAAC;;;;;;;;;;;;;;;;;ACduD;AACmB;AACpE;AACP;AACA,sEAAsE,yDAAS;AAC/E;AACA,sDAAsD,YAAY;AAClE;AACA;AACA;AACA,yBAAyB,yDAAS;AAClC;AACA;AACA;AACA;AACA,kDAAkD,YAAY;AAC9D,gBAAgB,oCAAoC;AACpD;AACA,sBAAsB;AACtB;AACA;AACA;AACA,6BAA6B,yDAAS;AACtC,YAAY,uFAAgB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,2CAA2C,YAAY;AACvD;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;AC7C6C;AACF;AACF;AACzC,oDAAM;AACN;AACA;AACA;AACO;AACP;AACA,gCAAgC,sDAAK,UAAU,mCAAmC;AAClF;AACA;AACA,oDAAoD,OAAO;AAC3D,gBAAgB,sDAAK;AACrB;AACA,2BAA2B,sDAAK;AAChC;AACA;AACA;AACA,uBAAuB,sDAAK;AAC5B,2BAA2B,oDAAM;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,yDAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,eAAe,uCAAuC;AACtD,iBAAiB;AACjB;AACA;AACA;AACA,eAAe,sDAAK;AACpB,2BAA2B,oDAAM;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,qCAAqC,yDAAS,qBAAqB;AACnE;AACA;AACA;AACA,+CAA+C;AAC/C;AACA,sDAAsD,kBAAkB,EAAE,YAAY;AACtF,4BAA4B,IAAI;AAChC;AACA,SAAS;AACT;AACA;AACA,wDAAM;AACN;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,uBAAuB,oDAAM;AAC7B;AACA;AACA;AACA,CAAC;AACD;AACA,mBAAmB,oDAAM;AACzB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACnGA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACZ2C;AACG;AACK;AACnD;AACO;AACP,mBAAmB,oDAAM;AACzB;AACA;AACA;AACA;AACA,uBAAuB,2DAAa;AACpC;AACA;AACA,uBAAuB,2DAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gEAAU;AACtB;AACA,YAAY,gEAAU;AACtB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,mBAAmB,2DAAa;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACjD+C;AACJ;AAC3C,oDAAM;AACN;AACA;AACA;AACA;AACA,wDAAM;AACN;AACA;AACA;AACA;AACA,uBAAuB,oDAAM;AAC7B;AACA;AACA;AACA,+DAA+D,gBAAgB,MAAM,oBAAoB;AACzG;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,uDAAkB;AACpD;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,2CAA2C,YAAY;AACvD;AACA,kDAAkD;AAClD;AACA;AACA;AACA,CAAC;AACM;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,oCAAoC;AACrE;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,mBAAmB,oDAAM;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACO;AACP,8CAA8C;AAC9C;AACA,0CAA0C;AAC1C;AACA;;;;;;;;;;;;;;;;;;;;ACjHmD;AACmB;AAC3B;AACF;AACU;AACnD;AACO;AACP,wBAAwB,sDAAK,OAAO,oDAAM;AAC1C,0BAA0B,kFAAiB;AAC3C,WAAW,sDAAK;AAChB,4BAA4B,6CAAO;AACnC,YAAY,gEAAU;AACtB;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA,wBAAwB,sDAAK,OAAO,oDAAM;AAC1C,0BAA0B,kFAAiB;AAC3C,WAAW,sDAAK;AAChB,4BAA4B,kDAAY;AACxC,YAAY,gEAAU;AACtB;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA,wBAAwB,sDAAK,OAAO,oDAAM;AAC1C,0BAA0B,kFAAiB;AAC3C,WAAW,6CAAO;AAClB,QAAQ,gEAAU;AAClB;AACA,KAAK;AACL;AACA;;;;;;;;;;;;;;;ACpCO;AACP,2CAA2C,YAAY;AACvD;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,8CAA8C;AAC9C;AACA;;;;;;;;;;;;;;;;;;;;ACV0C;AAC4B;AAC3B;AACF;AACU;AACnD;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,qDAAqD,IAAI;AACxG,mBAAmB,sDAAK;AACxB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,sCAAsC,sDAAK,OAAO,kFAAiB;AACnE,gCAAgC,sDAAK,WAAW,kDAAY;AAC5D;AACA;AACA;AACA,4CAA4C,oDAAM;AAClD,wBAAwB,gEAAU;AAClC;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,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA,gCAAgC;;;;;;;;;;;;;;;;;;ACvHkB;AACO;AACU;AAC5D;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,+DAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,+DAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8DAAiB;AACjC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT,eAAe,sEAAa;AAC5B;AACA,6CAA6C;AAC7C;;;;;;;;;;;;;;;;ACxF0C;AACnC,2BAA2B,mDAAO;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACb0C;AACnC;AACP,uBAAuB,mDAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,YAAY;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AC9BgC;AACD;AACU;AACR;;;;;;;;;;;;;;;;;ACHS;AAC1C;AACA;AACA;AACA;AACA;AACA;AACO;AACP,yBAAyB,mDAAO;AAChC,IAAI,mDAAO;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA,QAAQ,mDAAO;AACf;AACA;AACA;AACA;AACA,mDAAmD,YAAY;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;;;;;;;;;;;;;;;;;ACpDO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACO;AACP;AACA;AACA;AACA,SAAS,GAAG;AACZ;AACA;AACA,KAAK;AACL;AACA;AACO;AACP;AACA;AACA;AACA,SAAS,GAAG;AACZ;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;;;;;;;;;;;;;;;;;AC9BO;AACA;AACA;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzB6D;AAChB;AACE;AACc;AACM;AACpB;AACW;AACW;AACG;AACJ;AACH;AAC4B;AACjB;AACiB;AAC7F,gCAAgC,sDAAc;AAC9C;AACO;AACP;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mBAAmB,+EAA+E;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA,uCAAuC;AACvC,gDAAgD,yDAAS;AACzD;AACA;AACA;AACA;AACA,oCAAoC,0EAAe;AACnD;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC,KAAK;AACL;AACA;AACA;AACA;AACA,YAAY,+EAAiB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gBAAgB,EAAE,uFAAkB;AACpD;AACA;AACA,SAAS;AACT,QAAQ,0GAAuB;AAC/B;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA,YAAY,yFAAmB;AAC/B,YAAY,0GAAuB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,sDAAc;AAC1E,sEAAsE,EAAE,sDAAc,CAAC,EAAE,OAAO;AAChG;AACA;AACA,SAAS;AACT,8BAA8B,sFAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,sDAAc;AAC/C;AACA;AACA;AACA;AACA,uBAAuB,qFAAiB;AACxC;AACA;AACA,oCAAoC,iFAAe;AACnD,SAAS;AACT;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,kDAAkD,uEAAqB;AACvE,4BAA4B,2DAAc;AAC1C,YAAY,4DAAgB;AAC5B;AACA;AACA;AACA,+CAA+C,YAAY;AAC3D;AACA;AACA;AACA;AACA,gBAAgB,2DAAc;AAC9B,gBAAgB,4DAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gFAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,4BAA4B;AAChG;AACA,aAAa;AACb;AACA;AACA,yEAAyE,4BAA4B;AACrG;AACA;AACA;AACA;AACA;AACA,0CAA0C,YAAY;AACtD;AACA;AACA;AACA;AACA,oBAAoB,UAAU;AAC9B;AACA,KAAK;AACL;AACA,gCAAgC;AAChC,wGAAwG;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,kFAAmB;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gFAAgB;AACpB;AACA,2CAA2C,YAAY;AACvD;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;ACvSkE;AACf;AAC6B;AAC1B;AAC/C;AACP;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,uDAAU;AAC/B;AACA;AACA;AACA,QAAQ,kEAAW;AACnB,8CAA8C,YAAY;AAC1D,oBAAoB,aAAa;AACjC,0CAA0C,sBAAsB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kDAAK;AAChC,6BAA6B,kDAAK;AAClC;AACA;AACA;AACA,iBAAiB,gEAAU;AAC3B;AACA;AACA,gBAAgB,sEAAgB;AAChC;AACA;AACA;AACA;AACA,oCAAoC,2DAAc;AAClD;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,sEAAgB;AACxB;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP,IAAI,2EAAqB;AACzB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,QAAQ,kEAAW;AACnB;AACA;AACA;;;;;;;;;;;;;;;;;ACjG6C;AAC0C;AAChF;AACP;AACA;AACA,YAAY,2DAAc;AAC1B;AACA,mBAAmB,yDAAS;AAC5B;AACA,YAAY,uDAAU,SAAS,2DAAc;AAC7C;AACA;AACA,YAAY,uDAAU;AACtB;AACA;AACA,eAAe,yDAAS;AACxB,KAAK;AACL;;;;;;;;;;;;;;;ACjBO;AACP,2CAA2C,YAAY;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACRO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;;;;;;;;;;;;;;;ACVO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;;;;;;;;;;;;;;;;ACfkC;AAC3B;AACP,WAAW,0CAAM;AACjB;;;;;;;;;;;;;;;;ACH6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,8BAA8B,wBAAwB;AACtD;AACA;AACA;AACA;AACA,yCAAyC;AACzC,0CAA0C;AAC1C;AACA;AACA,oDAAoD;AACpD,qDAAqD;AACrD,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yDAAS;AACxB;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC9E2D;AACpD;AACP,4CAA4C;AAC5C;AACA,yBAAyB,wEAAc;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;;;;;;;;;;;;;;ACrBkC;AAC3B;AACP,eAAe,2CAAG;AAClB;;;;;;;;;;;;;;;;ACHO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,KAAK;AACL;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACxCkE;AACd;AACa;AACjE;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,2EAAoB;AACxB;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,sBAAsB,8EAAiB;AACvC;AACA;AACA;AACA,QAAQ,gEAAU;AAClB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AC9BiE;AAC1D;AACP;AACA,gBAAgB,8EAAiB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACZgE;AAC3B;AACS;AACvC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,0DAAc;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2DAAe;AACvB;AACA;AACA;AACA,QAAQ,2DAAe;AACvB;AACA,0BAA0B,0CAAM;AAChC;AACA;AACA;;;;;;;;;;;;;;;;;ACvCgD;AACiB;AACjE;AACO;AACP;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,yDAAS;AACxE;AACA;AACA;AACA,gBAAgB,8EAAiB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACnCoD;AACM;AACD;AAClD;AACP;AACA;AACA,sBAAsB,sEAAa;AACnC,sCAAsC,gEAAU;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,sEAAgB;AACpB;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AC7BO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;ACV8D;AAC5B;AACyB;AACqB;AACnC;AACG;AACI;AACG;AACpB;AACnC;AACA;AACA;AACA;AACO;AACP;AACA;AACA,8BAA8B,mEAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,4CAAI;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC;AACM;AACP,QAAQ,8DAAiB;AACzB,iBAAiB;AACjB;AACA;AACA,QAAQ,uDAAU;AAClB,iBAAiB,kBAAkB,+DAAY;AAC/C;AACA;AACA;AACA;AACA,iBAAiB,kBAAkB,+DAAY;AAC/C;AACA;AACA,0BAA0B,+DAAY;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,4CAAI;AAC5B,0BAA0B,0CAAM;AAChC,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA,6CAA6C,gEAAU;AACvD,gDAAgD,yDAAS,UAAU;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,yDAAU;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA,+CAA+C,YAAY;AAC3D;AACA;AACA,oDAAoD,YAAY;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,+BAA+B,4FAAc;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACpIO;;;;;;;;;;;;;;;;;;;ACA6C;AACU;AACP;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,SAAS;AAC/F;AACA;AACA;AACA,mEAAmE,kBAAkB;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,wBAAwB,+DAAY;AACpC,qBAAqB,6DAAc;AACnC;AACA;AACA,IAAI,2DAAe;AACnB;AACA;AACA;AACA,IAAI,0DAAc;AAClB;AACA;;;;;;;;;;;;;;;;;;;;;AC9DkC;AACG;AAC4B;AACjE;AACA,0CAAM,yBAAyB,6CAAO;AACtC,SAAS,8EAAiB;AAC1B,6BAA6B;AAC7B;AACA,CAAC;AACD;AACO;AACP,mBAAmB,0CAAM;AACzB;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACO;AACP,mBAAmB,0CAAM;AACzB;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA,IAAI,0CAAM;AACV;AACA;AACO;AACP,mBAAmB,0CAAM;AACzB;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACO;AACP,mBAAmB,0CAAM;AACzB;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;;;;;;;;;;;;;;;;;;ACzC6G;AAC7C;AACzD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4EAAY;AACpB;AACA;AACA,QAAQ,2DAAc;AACtB;AACA;AACA,QAAQ,2DAAc;AACtB;AACA;AACA,QAAQ,uDAAU;AAClB;AACA;AACA,QAAQ,uDAAU;AAClB;AACA;AACA,QAAQ,8DAAiB;AACzB;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;AC9C6E;AACzB;AACU;AACY;AACqB;AACxB;AACN;AAC1D;AACP;AACA;AACA;AACA,sBAAsB,wEAAY;AAClC;AACA,aAAa,kEAAU;AACvB,YAAY,gEAAU;AACtB;AACA,aAAa,kEAAU;AACvB;AACA;AACA;AACA,4BAA4B,sEAAgB;AAC5C;AACA,YAAY,gEAAU;AACtB;AACA,aAAa,kEAAU;AACvB,mBAAmB,iEAAe;AAClC,aAAa,kEAAU;AACvB,YAAY,0FAAuB;AACnC;AACA,aAAa,kEAAU;AACvB;AACA;AACA,sCAAsC,mEAAe;AACrD,mCAAmC,8EAAwB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6EAAa;AAC7B;AACA;AACA,gBAAgB,gEAAU;AAC1B;AACA;AACA;AACA;AACA,IAAI,uFAAwB;AAC5B;;;;;;;;;;;;;;;;;;;ACrD0D;AACI;AACb;AACsB;AAChE;AACP,sBAAsB,wEAAY;AAClC;AACA,aAAa,kEAAU;AACvB,mCAAmC,+DAAY;AAC/C;AACA,aAAa,kEAAU;AACvB;AACA;AACA;AACA,aAAa,kEAAU;AACvB;AACA,aAAa,kEAAU;AACvB;AACA;AACA,eAAe,+DAAY;AAC3B;AACA;AACA;AACA;AACA;AACA,wBAAwB,mEAAe;AACvC;AACA;AACA;AACA,wBAAwB,+DAAY;AACpC,6BAA6B,yDAAU;AACvC;AACA;;;;;;;;;;;;;;;;;AChC0F;AACnF;AACP;AACA;AACA,kDAAkD;AAClD;AACA;AACA,gBAAgB;AAChB;AACA;AACA,wBAAwB,6EAAa;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,oFAAoB;AACtC,2BAA2B;AAC3B;AACO;AACP;AACA;AACA,wBAAwB,6EAAa;AACrC;AACA,kBAAkB,oFAAoB;AACtC,2BAA2B;AAC3B;;;;;;;;;;;;;;;;;;;AC5BqC;AAC0B;AACd;AACkC;AAC5E;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uIAAuI,MAAM;AAC7I;AACA;AACA,2BAA2B,yDAAU;AACrC;AACA;AACA;AACA,sBAAsB,0CAAM;AAC5B;AACA;AACA;AACA;AACA,oBAAoB,+FAAsB;AAC1C;AACA,IAAI,4EAAgB;AACpB;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACjCiD;AACJ;AAC7C;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC,KAAK;AACL;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA,sBAAsB,kDAAY;AAClC,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,2BAA2B,yDAAU;AACrC;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;AC/C0D;AACX;AACoB;AACS;AAC3B;AACH;AACvC;AACP;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+EAAe;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA,YAAY,uDAAU;AACtB,YAAY,sEAAgB;AAC5B;AACA,+BAA+B,yDAAU,qCAAqC,+DAAY;AAC1F;AACA,YAAY,uEAAiB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,oDAAe;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACzHO;AACP;AACA,EAAE,SAAS;AACX;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;;;;;;;;;;;;;;;;;AC3BqE;AACpB;AAC1C;AACP;AACA;AACA;AACA;AACA;AACA,gBAAgB,2DAAc;AAC9B;AACA,qCAAqC,yDAAU;AAC/C,oBAAoB,2DAAc;AAClC;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAiB;AACzB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;AC1CwE;AACK;AACnB;AACa;AACT;AACV;AAC7C;AACP;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,sEAAgB;AACxB,eAAe,0FAAuB;AACtC,sBAAsB,sBAAsB;AAC5C,SAAS;AACT;AACA;AACA,2BAA2B,oFAAoB;AAC/C;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA,uBAAuB,mFAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,gEAAU;AAC7C;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA,YAAY,sEAAgB;AAC5B,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,YAAY;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA,uBAAuB,uEAAiB;AACxC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AChHiD;AACa;AACA;AACS;AACnB;AAC+B;AACd;AACqB;AACb;AACzB;AACoC;AACvB;AAC1D;AACP;AACA,sBAAsB,wEAAY;AAClC,IAAI,oFAAoB;AACxB;AACA,sBAAsB,kEAAU;AAChC;AACA;AACA;AACA;AACA;AACA,0BAA0B,kEAAU;AACpC,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA,aAAa,kEAAU;AACvB,YAAY,iEAAe;AAC3B,4BAA4B;AAC5B;AACA;AACA,mBAAmB;AACnB;AACA,aAAa,kEAAU;AACvB,YAAY,iEAAU;AACtB;AACA,aAAa,kEAAU;AACvB;AACA;AACA;AACA,4BAA4B,uEAAgB;AAC5C;AACA;AACA;AACA,YAAY,iEAAU;AACtB;AACA,aAAa,kEAAU;AACvB;AACA;AACA,aAAa,kEAAU;AACvB;AACA;AACA;AACA,gCAAgC,8EAAgB;AAChD;AACA;AACA;AACA;AACA,IAAI,kFAAmB;AACvB;AACA;AACA;AACA;AACA;AACA,oBAAoB,uDAAU;AAC9B;AACA;AACA;AACA;AACA,4BAA4B,mEAAe;AAC3C;AACA;AACA;AACA;AACA,6BAA6B,yDAAU;AACvC;AACA;AACA;AACA,+BAA+B,gEAAU;AACzC,QAAQ,2DAAc;AACtB,QAAQ,wEAAiB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iEAAU;AACzB;AACA,WAAW,kFAAmB;AAC9B;AACA;AACA;AACA;AACA,QAAQ,0FAAuB;AAC/B;AACA,sBAAsB,sBAAsB;AAC5C,SAAS;AACT;AACA;AACA,2BAA2B,yDAAU;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gFAAgB;AACxB,QAAQ,0FAAuB;AAC/B,sBAAsB,sBAAsB;AAC5C,SAAS;AACT;AACA;AACA;AACA;AACA,IAAI,gGAA0B;AAC9B;AACA;AACA;;;;;;;;;;;;;;;;AC/HA;AACO;AACP;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACO;AACP;AACA,oDAAoD;AACpD;AACA;AACA;AACA;;;;;;;SCjBA;SACA;;SAEA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;SACA;;SAEA;SACA;;SAEA;SACA;SACA;;;;;UCtBA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA;;;;;UCAA;UACA;UACA;UACA,uDAAuD,iBAAiB;UACxE;UACA,gDAAgD,aAAa;UAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACN0B;AACM;AACL;AACF;AACI;AACC;AACE;AACO;AACuB;AACV;AACN;AACR;AACY;AACwB;AACE;AAChB;AACQ;AACM;AACE;AAC9B;AACvC;AACP,cAAc,6EAAmB,0GAAkB;AACnD,iBAAiB;AACjB","sources":["webpack://taggedjs/./ts/TemplaterResult.class.ts","webpack://taggedjs/./ts/alterProps.function.ts","webpack://taggedjs/./ts/deepFunctions.ts","webpack://taggedjs/./ts/errors.ts","webpack://taggedjs/./ts/insertAfter.function.ts","webpack://taggedjs/./ts/interpolations/ElementTargetEvent.interface.ts","webpack://taggedjs/./ts/interpolations/afterInterpolateElement.function.ts","webpack://taggedjs/./ts/interpolations/bindSubjectCallback.function.ts","webpack://taggedjs/./ts/interpolations/elementInitCheck.ts","webpack://taggedjs/./ts/interpolations/inputAttribute.ts","webpack://taggedjs/./ts/interpolations/interpolateAttributes.ts","webpack://taggedjs/./ts/interpolations/interpolateContentTemplates.ts","webpack://taggedjs/./ts/interpolations/interpolateElement.ts","webpack://taggedjs/./ts/interpolations/interpolateTemplate.ts","webpack://taggedjs/./ts/interpolations/interpolations.ts","webpack://taggedjs/./ts/interpolations/processAttribute.function.ts","webpack://taggedjs/./ts/interpolations/scanTextAreaValue.function.ts","webpack://taggedjs/./ts/isInstance.ts","webpack://taggedjs/./ts/render.ts","webpack://taggedjs/./ts/state/callbackMaker.function.ts","webpack://taggedjs/./ts/state/children.ts","webpack://taggedjs/./ts/state/index.ts","webpack://taggedjs/./ts/state/letProp.function.ts","webpack://taggedjs/./ts/state/letState.function.ts","webpack://taggedjs/./ts/state/onDestroy.ts","webpack://taggedjs/./ts/state/onInit.ts","webpack://taggedjs/./ts/state/provider.utils.ts","webpack://taggedjs/./ts/state/providers.ts","webpack://taggedjs/./ts/state/setUse.function.ts","webpack://taggedjs/./ts/state/state.function.ts","webpack://taggedjs/./ts/state/state.utils.ts","webpack://taggedjs/./ts/state/subject.function.ts","webpack://taggedjs/./ts/state/syncStates.function.ts","webpack://taggedjs/./ts/state/watch.function.ts","webpack://taggedjs/./ts/subject/Subject.class.ts","webpack://taggedjs/./ts/subject/ValueSubject.ts","webpack://taggedjs/./ts/subject/combineLatest.function.ts","webpack://taggedjs/./ts/subject/index.ts","webpack://taggedjs/./ts/subject/subject.utils.ts","webpack://taggedjs/./ts/subject/will.functions.ts","webpack://taggedjs/./ts/tag/Tag.class.ts","webpack://taggedjs/./ts/tag/TagSupport.class.ts","webpack://taggedjs/./ts/tag/checkDestroyPrevious.function.ts","webpack://taggedjs/./ts/tag/cloneValueArray.function.ts","webpack://taggedjs/./ts/tag/destroy.support.ts","webpack://taggedjs/./ts/tag/destroyTag.function.ts","webpack://taggedjs/./ts/tag/elementDestroyCheck.function.ts","webpack://taggedjs/./ts/tag/getSupportInCycle.function.ts","webpack://taggedjs/./ts/tag/hasPropChanges.function.ts","webpack://taggedjs/./ts/tag/hasTagSupportChanged.function.ts","webpack://taggedjs/./ts/tag/html.ts","webpack://taggedjs/./ts/tag/isLikeTags.function.ts","webpack://taggedjs/./ts/tag/render/renderExistingTag.function.ts","webpack://taggedjs/./ts/tag/render/renderSubjectComponent.function.ts","webpack://taggedjs/./ts/tag/render/renderTagOnly.function.ts","webpack://taggedjs/./ts/tag/render/renderTagSupport.function.ts","webpack://taggedjs/./ts/tag/render/renderWithSupport.function.ts","webpack://taggedjs/./ts/tag/setTagPlaceholder.function.ts","webpack://taggedjs/./ts/tag/tag.ts","webpack://taggedjs/./ts/tag/tag.utils.ts","webpack://taggedjs/./ts/tag/tagElement.ts","webpack://taggedjs/./ts/tag/tagRunner.ts","webpack://taggedjs/./ts/tag/update/processFirstSubject.utils.ts","webpack://taggedjs/./ts/tag/update/processFirstSubjectValue.function.ts","webpack://taggedjs/./ts/tag/update/processNewValue.function.ts","webpack://taggedjs/./ts/tag/update/processRegularValue.function.ts","webpack://taggedjs/./ts/tag/update/processSubjectComponent.function.ts","webpack://taggedjs/./ts/tag/update/processTag.function.ts","webpack://taggedjs/./ts/tag/update/processTagArray.ts","webpack://taggedjs/./ts/tag/update/processTagResult.function.ts","webpack://taggedjs/./ts/tag/update/updateContextItem.function.ts","webpack://taggedjs/./ts/tag/update/updateExistingTagComponent.function.ts","webpack://taggedjs/./ts/tag/update/updateExistingValue.function.ts","webpack://taggedjs/./ts/updateBeforeTemplate.function.ts","webpack://taggedjs/webpack/bootstrap","webpack://taggedjs/webpack/runtime/define property getters","webpack://taggedjs/webpack/runtime/hasOwnProperty shorthand","webpack://taggedjs/webpack/runtime/make namespace object","webpack://taggedjs/./ts/index.ts"],"sourcesContent":["import { Tag } from './tag/Tag.class';\nimport { kidsToTagArraySubject } from './tag/tag';\nimport { ValueSubject } from './subject';\nexport class TemplaterResult {\n props;\n isTemplater = true;\n tagged;\n wrapper;\n madeChildIntoSubject = false;\n tag;\n children = new ValueSubject([]);\n constructor(props) {\n this.props = props;\n }\n html(strings, ...values) {\n const children = new Tag(strings, values);\n const { childSubject, madeSubject } = kidsToTagArraySubject(children);\n this.children = childSubject;\n this.madeChildIntoSubject = madeSubject;\n return this;\n }\n}\n","import { deepClone, deepEqual } from './deepFunctions';\nimport { isTag } from './isInstance';\nimport { renderTagSupport } from './tag/render/renderTagSupport.function';\nimport { setUse } from './state';\nimport { getSupportInCycle } from './tag/getSupportInCycle.function';\n/* Used to rewrite props that are functions. When they are called it should cause parent rendering */\nexport function alterProps(props, ownerSupport) {\n const isPropTag = isTag(props);\n const watchProps = isPropTag ? 0 : props;\n const newProps = resetFunctionProps(watchProps, ownerSupport);\n return newProps;\n}\nfunction resetFunctionProps(newProps, ownerSupport) {\n if (typeof (newProps) !== 'object' || !ownerSupport) {\n return newProps;\n }\n // BELOW: Do not clone because if first argument is object, the memory ref back is lost\n // const newProps = {...props} \n for (const name in newProps) {\n const value = newProps[name];\n if (!(value instanceof Function)) {\n continue;\n }\n const toCall = newProps[name].toCall;\n if (toCall) {\n continue; // already previously converted\n }\n newProps[name] = (...args) => newProps[name].toCall(...args); // what gets called can switch over parent state changes\n // Currently, call self but over parent state changes, I may need to call a newer parent tag owner\n newProps[name].toCall = (...args) => callbackPropOwner(value, args, ownerSupport);\n newProps[name].original = value;\n }\n return newProps;\n}\nexport function callbackPropOwner(toCall, callWith, ownerSupport) {\n // const renderCount = ownerSupport.global.renderCount\n const cycle = getSupportInCycle();\n const result = toCall(...callWith);\n const run = () => {\n const lastestOwner = ownerSupport.global.newest;\n if (cycle) {\n // appears a prop function was called sync/immediately so lets see if owner changed state\n const allMatched = lastestOwner.memory.state.every(state => {\n const lastValue = state.lastValue;\n const get = state.get();\n const equal = deepEqual(deepClone(lastValue), get);\n return equal;\n });\n if (allMatched) {\n return result; // owner did not change\n }\n }\n const newest = renderTagSupport(lastestOwner, true);\n lastestOwner.global.newest = newest;\n return result;\n };\n if (!cycle) {\n return run();\n }\n setUse.memory.tagClosed$.toCallback(run);\n return result;\n}\n","export function deepClone(obj) {\n return makeDeepClone(obj, new WeakMap());\n}\nfunction makeDeepClone(obj, visited) {\n // If obj is a primitive type or null, return it directly\n if (obj === null || typeof obj !== 'object') {\n return obj;\n }\n // If obj is already visited, return the cloned reference\n if (visited.has(obj)) {\n return visited.get(obj);\n }\n // Handle special cases like Date and RegExp\n if (obj instanceof Date) {\n return new Date(obj);\n }\n if (obj instanceof RegExp) {\n return new RegExp(obj);\n }\n // Create an empty object or array with the same prototype\n const clone = Array.isArray(obj) ? [] : Object.create(Object.getPrototypeOf(obj));\n // Register the cloned object to avoid cyclic references\n visited.set(obj, clone);\n // Clone each property or element of the object or array\n if (Array.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n clone[i] = makeDeepClone(obj[i], visited);\n }\n }\n else {\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n clone[key] = makeDeepClone(obj[key], visited);\n }\n }\n }\n return clone;\n}\nexport function deepEqual(obj1, obj2) {\n return isDeepEqual(obj1, obj2, new WeakMap());\n}\nfunction isDeepEqual(obj1, obj2, visited) {\n const directEqual = obj1 === obj2;\n if (directEqual || isSameFunctions(obj1, obj2)) {\n return true;\n }\n // If obj is already visited, return the cloned reference\n if (visited.has(obj1)) {\n return true;\n }\n if (typeof obj1 === 'object' && typeof obj2 === 'object') {\n // both are dates and were already determined not the same\n if (obj1 instanceof Date && obj2 instanceof Date) {\n return obj1.getTime() === obj2.getTime();\n }\n // Register the cloned object to avoid cyclic references\n visited.set(obj1, 0);\n // Check if obj1 and obj2 are both arrays\n if (Array.isArray(obj1) && Array.isArray(obj2)) {\n return isArrayDeepEqual(obj1, obj2, visited);\n }\n else if (Array.isArray(obj1) || Array.isArray(obj2)) {\n // One is an array, and the other is not\n return false;\n }\n return isObjectDeepEqual(obj1, obj2, visited);\n }\n return false;\n}\nfunction isObjectDeepEqual(obj1, obj2, visited) {\n const keys1 = Object.keys(obj1);\n const keys2 = Object.keys(obj2);\n if (keys1.length === 0 && keys2.length === 0) {\n return true;\n }\n if (keys1.length !== keys2.length) {\n return false;\n }\n for (const key of keys1) {\n const keyFound = keys2.includes(key);\n if (!keyFound || !isDeepEqual(obj1[key], obj2[key], visited)) {\n return false;\n }\n }\n return true;\n}\nfunction isArrayDeepEqual(obj1, obj2, visited) {\n if (obj1.length !== obj2.length) {\n return false;\n }\n for (let i = 0; i < obj1.length; i++) {\n if (!isDeepEqual(obj1[i], obj2[i], visited)) {\n return false;\n }\n }\n return true;\n}\nfunction isSameFunctions(fn0, fn1) {\n const bothFunction = fn0 instanceof Function && fn1 instanceof Function;\n return bothFunction && fn0.toString() === fn1.toString();\n}\n","export class TagError extends Error {\n details;\n constructor(message, errorCode, details = {}) {\n super(message);\n this.name = TagError.name;\n this.details = { ...details, errorCode };\n }\n}\nexport class ArrayNoKeyError extends TagError {\n constructor(message, details) {\n super(message, 'array-no-key-error', details);\n this.name = ArrayNoKeyError.name;\n }\n}\nexport class StateMismatchError extends TagError {\n constructor(message, details) {\n super(message, 'state-mismatch-error', details);\n this.name = StateMismatchError.name;\n }\n}\nexport class SyncCallbackError extends TagError {\n constructor(message, details) {\n super(message, 'sync-callback-error', details);\n this.name = SyncCallbackError.name;\n }\n}\n","// Function to insert element after reference element\nexport function insertAfter(newNode, referenceNode) {\n const parentNode = referenceNode.parentNode;\n parentNode.insertBefore(newNode, referenceNode.nextSibling);\n}\n","export {};\n","import { buildClones } from '../render';\nimport { afterElmBuild } from './interpolateTemplate';\nexport function afterInterpolateElement(container, insertBefore, tagSupport, context, options) {\n const clones = buildClones(container, insertBefore);\n if (!clones.length) {\n return clones;\n }\n for (let index = clones.length - 1; index >= 0; --index) {\n const clone = clones[index];\n afterElmBuild(clone, options, context, tagSupport);\n tagSupport.clones.push(clone);\n }\n return clones;\n}\n","/** File largely responsible for reacting to element events, such as onclick */\nimport { renderTagSupport } from \"../tag/render/renderTagSupport.function\";\nexport function bindSubjectCallback(value, tagSupport) {\n // Is this children? No override needed\n if (value.isChildOverride) {\n return value;\n }\n const subjectFunction = (element, args) => runTagCallback(value, tagSupport, element, args);\n // link back to original. Mostly used for <div oninit ondestroy> animations\n subjectFunction.tagFunction = value;\n return subjectFunction;\n}\nexport function runTagCallback(value, tagSupport, bindTo, args) {\n const myGlobal = tagSupport.global;\n const renderCount = myGlobal.renderCount;\n const method = value.bind(bindTo);\n const callbackResult = method(...args);\n const sameRenderCount = renderCount === myGlobal.renderCount;\n const skipRender = !sameRenderCount || myGlobal.deleted;\n // already rendered OR tag was deleted before event processing\n if (skipRender) {\n if (callbackResult instanceof Promise) {\n return callbackResult.then(() => {\n return 'promise-no-data-ever'; // tag was deleted during event processing\n });\n }\n return 'no-data-ever'; // already rendered\n }\n const newest = renderTagSupport(myGlobal.newest, true);\n myGlobal.newest = newest;\n if (callbackResult instanceof Promise) {\n return callbackResult.then(() => {\n if (myGlobal.deleted) {\n return 'promise-no-data-ever'; // tag was deleted during event processing\n }\n const newest = renderTagSupport(myGlobal.newest, true);\n myGlobal.newest = newest;\n return 'promise-no-data-ever';\n });\n }\n // Caller always expects a Promise\n return 'no-data-ever';\n}\n","export function elementInitCheck(nextSibling, counts) {\n const onInitDoubleWrap = nextSibling.oninit;\n if (!onInitDoubleWrap) {\n return counts.added;\n }\n const onInitWrap = onInitDoubleWrap.tagFunction;\n if (!onInitWrap) {\n return counts.added;\n }\n const onInit = onInitWrap.tagFunction;\n if (!onInit) {\n return counts.added;\n }\n const event = { target: nextSibling, stagger: counts.added };\n onInit(event);\n return ++counts.added;\n}\n","export function inputAttribute(name, value, element) {\n const names = name.split('.');\n // style.position = \"absolute\"\n if (names[0] === 'style') {\n element.style[names[1]] = value;\n }\n // Example: class.width-full = \"true\"\n if (names[0] === 'class') {\n names.shift();\n if (value) {\n for (let index = 0; index < names.length; ++index) {\n element.classList.add(names[index]);\n }\n }\n else {\n for (let index = 0; index < names.length; ++index) {\n element.classList.remove(names[index]);\n }\n }\n }\n}\n","import { processAttribute } from \"./processAttribute.function\";\nfunction howToSetAttribute(element, name, value) {\n element.setAttribute(name, value);\n}\nfunction howToSetInputValue(element, name, value) {\n element[name] = value;\n}\nexport function interpolateAttributes(child, scope, ownerSupport) {\n const attrNames = child.getAttributeNames();\n let howToSet = howToSetAttribute;\n for (let index = 0; index < attrNames.length; ++index) {\n const attrName = attrNames[index];\n if (child.nodeName === 'INPUT' && attrName === 'value') {\n howToSet = howToSetInputValue;\n }\n const value = child.getAttribute(attrName);\n processAttribute(attrName, value, child, scope, ownerSupport, howToSet);\n howToSet = howToSetAttribute; // put back\n }\n}\n","import { interpolateTemplate } from \"./interpolateTemplate\";\nexport function interpolateContentTemplates(context, tagSupport, options, children) {\n // counting for animation stagger computing\n const counts = options.counts;\n const clones = [];\n const tagComponents = [];\n const childLength = children.length;\n for (let index = childLength - 1; index >= 0; --index) {\n const child = children[index];\n const { clones: nextClones, tagComponent } = interpolateTemplate(child, context, tagSupport, counts, options);\n clones.push(...nextClones);\n if (tagComponent) {\n tagComponents.push(tagComponent);\n continue;\n }\n if (child.children) {\n for (let index = child.children.length - 1; index >= 0; --index) {\n const subChild = child.children[index];\n // IF <template end /> its a variable to be processed\n if (isRenderEndTemplate(subChild)) {\n const { tagComponent } = interpolateTemplate(subChild, context, tagSupport, counts, options);\n if (tagComponent) {\n tagComponents.push(tagComponent);\n }\n }\n const { clones: nextClones, tagComponents: nextTagComponent } = interpolateContentTemplates(context, tagSupport, options, subChild.children);\n clones.push(...nextClones);\n tagComponents.push(...nextTagComponent);\n }\n }\n }\n return { clones, tagComponents };\n}\nfunction isRenderEndTemplate(child) {\n const isTemplate = child.tagName === 'TEMPLATE';\n return isTemplate &&\n child.getAttribute('interpolate') !== undefined &&\n child.getAttribute('end') !== undefined;\n}\n","import { interpolateAttributes } from \"./interpolateAttributes\";\nimport { interpolateToTemplates } from \"./interpolations\";\nimport { interpolateContentTemplates } from \"./interpolateContentTemplates\";\nimport { escapeSearch, variablePrefix } from \"../tag/Tag.class\";\n/** Review elements within an element */\nexport function interpolateElement(container, // element containing innerHTML to review interpolations\ncontext, // variables used to evaluate\ninterpolatedTemplates, ownerSupport, options) {\n const clones = [];\n const tagComponents = [];\n const result = interpolatedTemplates.interpolation;\n const template = container.children[0];\n const children = template.content.children;\n if (result.keys.length) {\n const { clones: nextClones, tagComponents: nextTagComponents } = interpolateContentTemplates(context, ownerSupport, options, children);\n clones.push(...nextClones);\n tagComponents.push(...nextTagComponents);\n }\n interpolateAttributes(template, context, ownerSupport);\n processChildrenAttributes(children, context, ownerSupport);\n return { clones, tagComponents };\n}\nfunction processChildrenAttributes(children, context, ownerSupport) {\n for (let index = children.length - 1; index >= 0; --index) {\n const child = children[index];\n interpolateAttributes(child, context, ownerSupport);\n if (child.children) {\n processChildrenAttributes(child.children, context, ownerSupport);\n }\n }\n}\nexport function interpolateString(string) {\n const result = interpolateToTemplates(string);\n result.string = result.string.replace(escapeSearch, variablePrefix);\n return result;\n}\n","import { variablePrefix } from \"../tag/Tag.class\";\nimport { elementInitCheck } from \"./elementInitCheck\";\nimport { processFirstSubjectValue } from \"../tag/update/processFirstSubjectValue.function\";\nimport { isTagArray, isTagComponent } from \"../isInstance\";\nimport { scanTextAreaValue } from \"./scanTextAreaValue.function\";\nimport { updateExistingValue } from \"../tag/update/updateExistingValue.function\";\nimport { swapInsertBefore } from \"../tag/setTagPlaceholder.function\";\nexport function interpolateTemplate(insertBefore, // <template end interpolate /> (will be removed)\ncontext, // variable scope of {`__tagvar${index}`:'x'}\nownerSupport, // Tag class\ncounts, // used for animation stagger computing\noptions) {\n // TODO: THe clones array is useless here\n const clones = [];\n if (!insertBefore.hasAttribute('end')) {\n return { clones }; // only care about <template end>\n }\n const variableName = insertBefore.getAttribute('id');\n if (variableName?.substring(0, variablePrefix.length) !== variablePrefix) {\n return { clones }; // ignore, not a tagVar\n }\n const existingSubject = context[variableName];\n const isDynamic = isTagComponent(existingSubject.value) || isTagArray(existingSubject.value);\n // process dynamics later\n if (isDynamic) {\n return {\n clones,\n tagComponent: {\n variableName,\n ownerSupport,\n subject: existingSubject,\n insertBefore\n }\n };\n }\n subscribeToTemplate(insertBefore, existingSubject, ownerSupport, counts);\n return { clones };\n}\nexport function subscribeToTemplate(insertBefore, subject, ownerSupport, counts) {\n let called = false;\n const onValue = (value) => {\n if (called) {\n updateExistingValue(subject, value, ownerSupport, insertBefore);\n return;\n }\n const templater = value;\n processFirstSubjectValue(templater, subject, insertBefore, ownerSupport, {\n counts: { ...counts },\n });\n called = true;\n };\n let mutatingCallback = onValue;\n const callback = (value) => mutatingCallback(value);\n const sub = subject.subscribe(callback);\n // on subscribe, the Subject did NOT emit immediately. Lets pull the template off the document\n if (insertBefore.parentNode) {\n const clone = subject.clone = swapInsertBefore(insertBefore);\n mutatingCallback = v => {\n const parentNode = clone.parentNode;\n parentNode.insertBefore(insertBefore, clone);\n parentNode.removeChild(clone);\n delete subject.clone;\n mutatingCallback = onValue; // all future calls will just produce value\n onValue(v); // calls for rending\n };\n }\n ownerSupport.global.subscriptions.push(sub);\n}\nexport function afterElmBuild(elm, options, context, ownerSupport) {\n if (!elm.getAttribute) {\n return;\n }\n const tagName = elm.nodeName; // elm.tagName\n if (tagName === 'TEXTAREA') {\n scanTextAreaValue(elm, context, ownerSupport);\n }\n let diff = options.counts.added;\n diff = elementInitCheck(elm, options.counts) - diff;\n if (elm.children) {\n const children = elm.children;\n for (let index = children.length - 1; index >= 0; --index) {\n const child = children[index];\n const subOptions = {\n ...options,\n counts: options.counts,\n };\n return afterElmBuild(child, subOptions, context, ownerSupport);\n }\n }\n}\n","// support arrow functions in attributes\nexport const interpolateReplace = /(?:<[^>]*?(?:(?:\\s+\\w+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^>\\s]+)))*\\s*)\\/?>)|({__tagvar[^}]+})/g;\n/** replaces ${x} with <template id=\"x-start\"></template><template id=\"x-end\"></template> */\nexport function interpolateToTemplates(template) {\n const keys = [];\n const string = template.replace(interpolateReplace, (match, expression) => {\n if (match.startsWith('<')) {\n // If the match is an HTML tag, don't replace\n return match;\n }\n const noBraces = expression.substring(1, expression.length - 1);\n const id = noBraces;\n keys.push(id);\n return `<template interpolate end id=\"${id}\"></template>`;\n });\n return { string, keys };\n}\n","import { inputAttribute } from './inputAttribute';\nimport { isSubjectInstance } from '../isInstance';\nimport { bindSubjectCallback } from './bindSubjectCallback.function';\nconst startRegX = /^\\s*{__tagvar/;\nconst endRegX = /}\\s*$/;\nfunction isTagVar(value) {\n return value && value.search(startRegX) >= 0 && value.search(endRegX) >= 0;\n}\nexport function processAttribute(attrName, value, child, scope, ownerSupport, howToSet) {\n if (isTagVar(value)) {\n return processScopedNameValueAttr(attrName, value, child, scope, ownerSupport, howToSet);\n }\n if (isTagVar(attrName)) {\n const contextValueSubject = getContextValueByVarString(scope, attrName);\n let lastValue;\n // the above callback gets called immediately since its a ValueSubject()\n const sub = contextValueSubject.subscribe((value) => {\n processNameOnlyAttr(value, lastValue, child, ownerSupport, howToSet);\n lastValue = value;\n });\n ownerSupport.global.subscriptions.push(sub); // this is where unsubscribe is picked up\n child.removeAttribute(attrName);\n return;\n }\n // Non dynamic\n const isSpecial = isSpecialAttr(attrName);\n if (isSpecial) {\n return inputAttribute(attrName, value, child);\n }\n}\nfunction processScopedNameValueAttr(attrName, value, // {__tagVarN}\nchild, scope, ownerSupport, howToSet) {\n // get the code inside the brackets like \"variable0\" or \"{variable0}\"\n const result = getContextValueByVarString(scope, value);\n return processNameValueAttr(attrName, result, child, ownerSupport, howToSet);\n}\nfunction getContextValueByVarString(scope, value) {\n const code = value.replace('{', '').split('').reverse().join('').replace('}', '').split('').reverse().join('');\n return scope[code];\n}\nfunction processNameOnlyAttr(attrValue, lastValue, child, ownerSupport, howToSet) {\n if (lastValue && lastValue != attrValue) {\n if (typeof (lastValue) === 'string') {\n child.removeAttribute(lastValue);\n }\n else if (lastValue instanceof Object) {\n for (const name in lastValue) {\n child.removeAttribute(name);\n }\n }\n }\n if (typeof (attrValue) === 'string') {\n if (!attrValue.length) {\n return;\n }\n processNameValueAttr(attrValue, '', child, ownerSupport, howToSet);\n return;\n }\n if (attrValue instanceof Object) {\n for (const name in attrValue) {\n processNameValueAttr(name, attrValue[name], child, ownerSupport, howToSet);\n }\n }\n}\nfunction processNameValueAttr(attrName, result, child, ownerSupport, howToSet) {\n const isSpecial = isSpecialAttr(attrName);\n if (result instanceof Function) {\n const action = function (...args) {\n const result2 = result(child, args);\n return result2;\n };\n child[attrName].action = action;\n }\n // Most every variable comes in here since everything is made a ValueSubject\n if (isSubjectInstance(result)) {\n child.removeAttribute(attrName);\n const callback = (newAttrValue) => {\n // should the function be wrapped so every time its called we re-render?\n if (newAttrValue instanceof Function) {\n const wrapper = ownerSupport.templater.wrapper;\n const parentWrap = wrapper?.parentWrap;\n const oneRender = parentWrap?.oneRender;\n if (!oneRender) {\n newAttrValue = bindSubjectCallback(newAttrValue, ownerSupport);\n }\n }\n return processAttributeSubjectValue(newAttrValue, child, attrName, isSpecial, howToSet);\n };\n // 🗞️ Subscribe. Above callback called immediately since its a ValueSubject()\n const sub = result.subscribe(callback);\n // Record subscription for later unsubscribe when element destroyed\n ownerSupport.global.subscriptions.push(sub);\n return;\n }\n howToSet(child, attrName, result);\n // child.setAttribute(attrName, result.value)\n return;\n}\nfunction processAttributeSubjectValue(newAttrValue, child, attrName, isSpecial, howToSet) {\n if (newAttrValue instanceof Function) {\n const fun = function (...args) {\n return newAttrValue(child, args);\n };\n // access to original function\n fun.tagFunction = newAttrValue;\n child[attrName] = fun;\n return;\n }\n if (isSpecial) {\n inputAttribute(attrName, newAttrValue, child);\n return;\n }\n if (newAttrValue) {\n howToSet(child, attrName, newAttrValue);\n return;\n }\n const isDeadValue = [undefined, false, null].includes(newAttrValue);\n if (isDeadValue) {\n child.removeAttribute(attrName);\n return;\n }\n // value is 0\n howToSet(child, attrName, newAttrValue);\n}\n/** Looking for (class | style) followed by a period */\nfunction isSpecialAttr(attrName) {\n return attrName.search(/^(class|style)(\\.)/) >= 0;\n}\n","import { processAttribute } from './processAttribute.function';\nconst search = new RegExp('\\\\s*<template interpolate end id=\"__tagvar(\\\\d{1,4})\"([^>]*)></template>(\\\\s*)');\nexport function scanTextAreaValue(textarea, context, ownerSupport) {\n const value = textarea.value;\n if (value.search(search) >= 0) {\n const match = value.match(/__tagvar(\\d{1,4})/);\n const token = match ? match[0] : '';\n const dynamic = '{' + token + '}';\n textarea.value = '';\n textarea.setAttribute('text-var-value', dynamic);\n const howToSet = (_elm, _name, value) => textarea.value = value;\n processAttribute('text-var-value', dynamic, // realValue, // context[token].value,\n textarea, context, ownerSupport, howToSet);\n }\n}\n","export function isTag(value) {\n return isTagTemplater(value) || isTagClass(value);\n}\nexport function isTagTemplater(value) {\n const templater = value;\n return templater?.isTemplater === true && templater.wrapper === undefined;\n}\n// TODO: whats the difference between isTagClass and isTagComponent\nexport function isTagComponent(value) {\n return value?.wrapper?.parentWrap.original instanceof Function;\n}\nexport function isTagClass(value) {\n const templater = value;\n return templater?.isTagClass === true;\n}\n// isSubjectLike\nexport function isSubjectInstance(subject) {\n return (subject?.isSubject === true || subject?.subscribe) ? true : false; // subject?.isSubject === true || \n}\nexport function isTagArray(value) {\n return value instanceof Array && value.every(x => isTagClass(x) || isTagTemplater(x));\n}\n","export function buildClones(temporary, insertBefore) {\n const clones = [];\n const template = temporary.children[0];\n let nextSibling = template.content.firstChild;\n const fragment = document.createDocumentFragment();\n while (nextSibling) {\n const nextNextSibling = nextSibling.nextSibling;\n clones.push(nextSibling);\n fragment.appendChild(nextSibling);\n nextSibling = nextNextSibling;\n }\n if (insertBefore.parentNode) {\n const parentNode = insertBefore.parentNode;\n parentNode.insertBefore(fragment, insertBefore);\n }\n return clones;\n}\n","import { setUse } from \"./setUse.function\";\nimport { renderTagSupport } from \"../tag/render/renderTagSupport.function\";\nimport { SyncCallbackError } from \"../errors\";\nimport { syncStates } from \"./syncStates.function\";\nimport { getSupportInCycle } from \"../tag/getSupportInCycle.function\";\nlet innerCallback = (callback) => (a, b, c, d, e, f) => {\n throw new SyncCallbackError('Callback function was called immediately in sync and must instead be call async');\n};\nexport const callbackMaker = () => innerCallback;\nconst originalGetter = innerCallback; // callbackMaker\nsetUse({\n beforeRender: (tagSupport) => initMemory(tagSupport),\n beforeRedraw: (tagSupport) => initMemory(tagSupport),\n afterRender: (tagSupport) => {\n ;\n tagSupport.global.callbackMaker = true;\n innerCallback = originalGetter; // prevent crossing callbacks with another tag\n },\n});\nexport function callback(callback) {\n const tagSupport = getSupportInCycle();\n if (!tagSupport) {\n const error = new SyncCallbackError('callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering');\n throw error;\n }\n const oldState = setUse.memory.stateConfig.array;\n const trigger = (...args) => {\n const callbackMaker = tagSupport.global.callbackMaker;\n if (callbackMaker) {\n return triggerStateUpdate(tagSupport, callback, oldState, ...args);\n }\n return callback(...args);\n };\n return trigger;\n}\nfunction initMemory(tagSupport) {\n const oldState = setUse.memory.stateConfig.array;\n innerCallback = (callback) => {\n const trigger = (...args) => {\n const callbackMaker = tagSupport.global.callbackMaker;\n if (callbackMaker) {\n return triggerStateUpdate(tagSupport, callback, oldState, ...args);\n }\n return callback(...args);\n };\n return trigger;\n };\n}\nfunction triggerStateUpdate(tagSupport, callback, oldState, ...args) {\n const state = tagSupport.memory.state;\n // ensure that the oldest has the latest values first\n syncStates(state, oldState);\n // run the callback\n const maybePromise = callback(...args);\n // send the oldest state changes into the newest\n syncStates(oldState, state);\n /*\n if(tagSupport.global.deleted) {\n return maybePromise // While running callback the tag was deleted. Often that happens\n }\n */\n renderTagSupport(tagSupport, false);\n if (maybePromise instanceof Promise) {\n maybePromise.finally(() => {\n // send the oldest state changes into the newest\n syncStates(oldState, state);\n renderTagSupport(tagSupport, false);\n });\n }\n // return undefined as T\n return maybePromise;\n}\n","import { setUse } from \"./setUse.function\";\nfunction setCurrentTagSupport(support) {\n setUse.memory.childrenCurrentSupport = support;\n}\nexport function children() {\n const tagSupport = setUse.memory.childrenCurrentSupport;\n const children = tagSupport.templater.children;\n return children;\n}\nsetUse({\n beforeRender: tagSupport => setCurrentTagSupport(tagSupport),\n beforeRedraw: tagSupport => setCurrentTagSupport(tagSupport),\n});\n","export * from \"./watch.function\";\nexport { setUse } from \"./setUse.function\";\nexport { state } from \"./state.function\";\nexport * from \"./subject.function\";\nexport * from \"./letProp.function\";\nexport { letState } from \"./letState.function\";\nexport { providers } from \"./providers\";\nexport * from \"./callbackMaker.function\";\nexport * from \"./onInit\";\nexport * from \"./onDestroy\";\nexport * from \"./children\";\n","import { letState } from \"./letState.function\";\nimport { watch } from \"./watch.function\";\n/**\n * Enables the ability to maintain a change to a props value until the prop itself changes\n * @param prop typically the name of an existing prop\n * @returns immediately call the returned function: letProp(y)(x => [y, y=x])\n */\nexport function letProp(prop) {\n return getSetProp => {\n let myProp = letState(prop)(getSetProp);\n watch([prop], () => getSetProp(myProp = prop));\n getSetProp(myProp);\n return myProp;\n };\n}\n","import { getStateValue } from './state.utils';\nimport { setUse } from './setUse.function';\n/** Used for variables that need to remain the same variable during render passes */\nexport function letState(defaultValue) {\n const config = setUse.memory.stateConfig;\n const rearray = config.rearray;\n let getSetMethod;\n const restate = rearray[config.array.length];\n if (restate) {\n let oldValue = getStateValue(restate);\n getSetMethod = ((x) => [oldValue, oldValue = x]);\n const push = {\n get: () => getStateValue(push),\n callback: getSetMethod,\n lastValue: oldValue,\n defaultValue: restate.defaultValue,\n };\n config.array.push(push);\n return makeStateResult(oldValue, push);\n }\n // State first time run\n const defaultFn = defaultValue instanceof Function ? defaultValue : () => defaultValue;\n let initValue = defaultFn();\n getSetMethod = ((x) => [initValue, initValue = x]);\n const push = {\n get: () => getStateValue(push),\n callback: getSetMethod,\n lastValue: initValue,\n defaultValue: initValue,\n };\n config.array.push(push);\n return makeStateResult(initValue, push);\n}\nfunction makeStateResult(initValue, push) {\n // return initValue\n const result = (y) => {\n push.callback = y || (x => [initValue, initValue = x]);\n return initValue;\n };\n return result;\n}\n","import { setUse } from \"./setUse.function\";\nfunction setCurrentTagSupport(support) {\n setUse.memory.destroyCurrentSupport = support;\n}\nexport function onDestroy(callback) {\n const tagSupport = setUse.memory.destroyCurrentSupport;\n tagSupport.global.destroyCallback = callback;\n}\nsetUse({\n beforeRender: tagSupport => setCurrentTagSupport(tagSupport),\n beforeRedraw: tagSupport => setCurrentTagSupport(tagSupport),\n beforeDestroy: (tagSupport) => {\n const callback = tagSupport.global.destroyCallback;\n if (callback) {\n callback();\n }\n }\n});\n","import { setUse } from \"./setUse.function\";\nfunction setCurrentTagSupport(support) {\n setUse.memory.currentSupport = support;\n}\nexport function onInit(callback) {\n const tagSupport = setUse.memory.currentSupport;\n if (!tagSupport.global.init) {\n tagSupport.global.init = callback;\n callback(); // fire init\n }\n}\nsetUse({\n beforeRender: tagSupport => setCurrentTagSupport(tagSupport),\n beforeRedraw: tagSupport => setCurrentTagSupport(tagSupport),\n});\n","import { deepClone, deepEqual } from '../deepFunctions';\nimport { renderTagSupport } from '../tag/render/renderTagSupport.function';\nexport function providersChangeCheck(tagSupport) {\n const global = tagSupport.global;\n const providersWithChanges = global.providers.filter(provider => !deepEqual(provider.instance, provider.clone));\n // reset clones\n for (let index = providersWithChanges.length - 1; index >= 0; --index) {\n const provider = providersWithChanges[index];\n const appSupport = tagSupport.getAppTagSupport();\n handleProviderChanges(appSupport, provider);\n provider.clone = deepClone(provider.instance);\n }\n}\nfunction handleProviderChanges(appSupport, provider) {\n const tagsWithProvider = getTagsWithProvider(appSupport, provider);\n for (let index = tagsWithProvider.length - 1; index >= 0; --index) {\n const { tagSupport, renderCount, provider } = tagsWithProvider[index];\n if (tagSupport.global.deleted) {\n continue; // i was deleted after another tag processed\n }\n const notRendered = renderCount === tagSupport.global.renderCount;\n if (notRendered) {\n provider.clone = deepClone(provider.instance);\n renderTagSupport(tagSupport, false);\n continue;\n }\n }\n}\n/** Updates and returns memory of tag providers */\nfunction getTagsWithProvider(tagSupport, provider, memory = []) {\n const global = tagSupport.global;\n const compare = global.providers;\n const hasProvider = compare.find(xProvider => xProvider.constructMethod.compareTo === provider.constructMethod.compareTo);\n if (hasProvider) {\n memory.push({\n tagSupport,\n renderCount: global.renderCount,\n provider: hasProvider,\n });\n }\n const childTags = tagSupport.childTags;\n for (let index = childTags.length - 1; index >= 0; --index) {\n getTagsWithProvider(childTags[index], provider, memory);\n }\n return memory;\n}\n","import { deepClone } from '../deepFunctions';\nimport { setUse } from './setUse.function';\nimport { state } from './state.function';\nsetUse.memory.providerConfig = {\n providers: [],\n ownerSupport: undefined,\n};\nexport const providers = {\n create: (constructMethod) => {\n const stateDiffMemory = state(() => ({ stateDiff: 0, provider: undefined }));\n // mimic how many states were called the first time\n if (stateDiffMemory.stateDiff) {\n for (let x = stateDiffMemory.stateDiff; x > 0; --x) {\n state(undefined);\n }\n const result = state(undefined);\n // stateDiffMemory.provider.constructMethod.compareTo = compareTo\n return result;\n }\n const result = state(() => {\n const memory = setUse.memory;\n const stateConfig = memory.stateConfig;\n const oldStateCount = stateConfig.array.length;\n // Providers with provider requirements just need to use providers.create() and providers.inject()\n const instance = 'prototype' in constructMethod ? new constructMethod() : constructMethod();\n const stateDiff = stateConfig.array.length - oldStateCount;\n const config = memory.providerConfig;\n const provider = {\n constructMethod,\n instance,\n clone: deepClone(instance),\n stateDiff,\n };\n stateDiffMemory.provider = provider;\n config.providers.push(provider);\n stateDiffMemory.stateDiff = stateDiff;\n return instance;\n });\n const cm = constructMethod;\n // const compareTo = cm.compareTo = cm.compareTo || cm.toString()\n const compareTo = cm.compareTo = cm.toString();\n stateDiffMemory.provider.constructMethod.compareTo = compareTo;\n return result;\n },\n /**\n * @template T\n * @param {(new (...args: any[]) => T) | () => T} constructor\n * @returns {T}\n */\n inject: (constructor) => {\n // find once, return same every time after\n return state(() => {\n const config = setUse.memory.providerConfig;\n const cm = constructor;\n const compareTo = cm.compareTo = cm.compareTo || constructor.toString();\n let owner = {\n ownerTagSupport: config.ownerSupport\n };\n while (owner.ownerTagSupport) {\n const ownerProviders = owner.ownerTagSupport.global.providers;\n const provider = ownerProviders.find(provider => {\n const constructorMatch = provider.constructMethod.compareTo === compareTo;\n if (constructorMatch) {\n return true;\n }\n });\n if (provider) {\n provider.clone = deepClone(provider.instance); // keep a copy of the latest before any change occur\n config.providers.push(provider);\n return provider.instance;\n }\n owner = owner.ownerTagSupport; // cause reloop checking next parent\n }\n const msg = `Could not inject provider: ${constructor.name} ${constructor}`;\n console.warn(`${msg}. Available providers`, config.providers);\n throw new Error(msg);\n });\n }\n};\nsetUse({\n beforeRender: (tagSupport, ownerSupport) => {\n run(tagSupport, ownerSupport);\n },\n beforeRedraw: (tagSupport, newTagSupport) => {\n run(tagSupport, newTagSupport.ownerTagSupport);\n },\n afterRender: (tagSupport) => {\n const config = setUse.memory.providerConfig;\n tagSupport.global.providers = [...config.providers];\n config.providers.length = 0;\n }\n});\nfunction run(tagSupport, ownerSupport) {\n const config = setUse.memory.providerConfig;\n config.ownerSupport = ownerSupport;\n if (tagSupport.global.providers.length) {\n config.providers.length = 0;\n config.providers.push(...tagSupport.global.providers);\n }\n}\n","const tagUse = [];\nexport function setUse(use) {\n // must provide defaults\n const useMe = {\n beforeRender: use.beforeRender || (() => undefined),\n beforeRedraw: use.beforeRedraw || (() => undefined),\n afterRender: use.afterRender || (() => undefined),\n beforeDestroy: use.beforeDestroy || (() => undefined),\n };\n setUse.tagUse.push(useMe);\n}\nsetUse.tagUse = tagUse;\nsetUse.memory = {};\n","import { setUse } from './setUse.function';\nimport { getStateValue } from './state.utils';\nimport { syncStates } from './syncStates.function';\n/** Used for variables that need to remain the same variable during render passes */\nexport function state(defaultValue) {\n const config = setUse.memory.stateConfig;\n let getSetMethod;\n const rearray = config.rearray;\n const restate = rearray[config.array.length];\n if (restate) {\n let oldValue = getStateValue(restate);\n getSetMethod = ((x) => [oldValue, oldValue = x]);\n const push = {\n get: () => getStateValue(push),\n callback: getSetMethod,\n lastValue: oldValue,\n defaultValue: restate.defaultValue,\n };\n config.array.push(push);\n return oldValue;\n }\n // State first time run\n const defaultFn = defaultValue instanceof Function ? defaultValue : () => defaultValue;\n let initValue = defaultFn();\n // the state is actually intended to be a function\n if (initValue instanceof Function) {\n const oldState = config.array;\n const tagSupport = config.tagSupport;\n const original = initValue;\n initValue = ((...args) => {\n const global = tagSupport.global;\n const newest = global.newest;\n const newState = newest.memory.state;\n syncStates(newState, oldState);\n const result = original(...args);\n syncStates(oldState, newState);\n return result;\n });\n initValue.original = original;\n }\n getSetMethod = ((x) => [initValue, initValue = x]);\n const push = {\n get: () => getStateValue(push),\n callback: getSetMethod,\n lastValue: initValue,\n defaultValue: initValue,\n };\n config.array.push(push);\n return initValue;\n}\n","import { StateMismatchError } from '../errors';\nimport { setUse } from './setUse.function';\nsetUse.memory.stateConfig = {\n array: [], // state memory on the first render\n // rearray: [] as State,\n};\nconst beforeRender = (tagSupport) => initState(tagSupport);\nsetUse({\n beforeRender,\n beforeRedraw: beforeRender,\n afterRender: (tagSupport) => {\n const memory = tagSupport.memory;\n const config = setUse.memory.stateConfig;\n const rearray = config.rearray;\n if (rearray.length) {\n if (rearray.length !== config.array.length) {\n const message = `States lengths have changed ${rearray.length} !== ${config.array.length}. State tracking requires the same amount of function calls every render. Typically this errors is thrown when a state like function call occurs only for certain conditions or when a function is intended to be wrapped with a tag() call`;\n const wrapper = tagSupport.templater?.wrapper;\n const details = {\n oldStates: config.array,\n newStates: config.rearray,\n tagFunction: wrapper.parentWrap.original,\n };\n const error = new StateMismatchError(message, details);\n console.warn(message, details);\n throw error;\n }\n }\n delete config.rearray; // clean up any previous runs\n delete config.tagSupport;\n memory.state.length = 0;\n memory.state.push(...config.array);\n const state = memory.state;\n for (let index = state.length - 1; index >= 0; --index) {\n const item = state[index];\n item.lastValue = getStateValue(item); // set last values\n }\n config.array = [];\n }\n});\nexport function getStateValue(state) {\n const callback = state.callback;\n if (!callback) {\n return state.defaultValue;\n }\n const [value, checkValue] = getCallbackValue(callback);\n if (checkValue !== StateEchoBack) {\n const message = 'State property not used correctly. Second item in array is not setting value as expected.\\n\\n' +\n 'For \"let\" state use `let name = state(default)(x => [name, name = x])`\\n\\n' +\n 'For \"const\" state use `const name = state(default)()`\\n\\n' +\n 'Problem state:\\n' + (callback ? callback.toString() : JSON.stringify(state)) + '\\n';\n console.error(message, { state, callback, value, checkValue });\n throw new Error(message);\n }\n return value;\n}\nexport class StateEchoBack {\n}\nfunction initState(tagSupport) {\n const memory = tagSupport.memory;\n const state = memory.state;\n const config = setUse.memory.stateConfig;\n // TODO: The following two blocks of code are state protects, have a production mode that removes this checks\n /*\n if (config.rearray) {\n checkStateMismatch(tagSupport, config, state)\n }\n */\n config.rearray = [];\n const stateLength = state?.length;\n if (stateLength) {\n for (let index = 0; index < stateLength; ++index) {\n getStateValue(state[index]);\n }\n config.rearray.push(...state);\n }\n config.tagSupport = tagSupport;\n}\n/*\nfunction checkStateMismatch(\n tagSupport: BaseTagSupport,\n config: Config,\n state: State,\n) {\n const wrapper = tagSupport.templater?.wrapper as Wrapper\n const wasWrapper = config.tagSupport?.templater.wrapper as Wrapper\n const message = 'last state not cleared. Possibly in the middle of rendering one component and another is trying to render'\n\n if(!wasWrapper) {\n return // its not a component or was not a component before\n }\n\n console.error(message, {\n config,\n tagFunction: wrapper.parentWrap.original,\n wasInMiddleOf: wasWrapper.parentWrap.original,\n state,\n expectedClearArray: config.rearray,\n })\n\n throw new StateMismatchError(message, {\n config,\n tagFunction: wrapper.parentWrap.original,\n state,\n expectedClearArray: config.rearray,\n })\n}\n*/\nexport function getCallbackValue(callback) {\n const oldState = callback(StateEchoBack); // get value and set to undefined\n const [value] = oldState;\n const [checkValue] = callback(value); // set back to original value\n return [value, checkValue];\n}\n","import { Subject, ValueSubject } from \"../subject\";\nimport { getSupportInCycle } from \"../tag/getSupportInCycle.function\";\nimport { setUse } from \"./setUse.function\";\nimport { state } from \"./state.function\";\nimport { syncStates } from \"./syncStates.function\";\n/** Create a Subject that on updates will sync state values to keep chained functions using latest variables */\nexport function subject(value, onSubscription) {\n const oldestState = state(() => setUse.memory.stateConfig.array);\n const nowTagSupport = getSupportInCycle();\n return state(() => {\n const subject = new Subject(value, onSubscription).pipe(x => {\n syncStates(nowTagSupport.memory.state, oldestState);\n return x;\n });\n return subject;\n });\n}\nsubject.value = (value) => {\n const oldestState = state(() => setUse.memory.stateConfig.array);\n const nowTagSupport = getSupportInCycle();\n return state(() => {\n const subject = new ValueSubject(value).pipe(x => {\n syncStates(nowTagSupport.memory.state, oldestState);\n return x;\n });\n return subject;\n });\n};\nfunction all(args) {\n const oldestState = state(() => setUse.memory.stateConfig.array);\n const nowTagSupport = getSupportInCycle();\n return Subject.all(args).pipe(x => {\n syncStates(nowTagSupport.memory.state, oldestState);\n return x;\n });\n}\nsubject.all = all;\n","export function syncStates(stateFrom, stateTo) {\n for (let index = stateFrom.length - 1; index >= 0; --index) {\n const state = stateFrom[index];\n const fromValue = state.get();\n const callback = stateTo[index].callback;\n if (callback) {\n callback(fromValue); // set the value\n }\n stateTo[index].lastValue = fromValue; // record the value\n }\n}\n","import { ValueSubject } from '../subject';\nimport { getSupportInCycle } from '../tag/getSupportInCycle.function';\nimport { setUse } from './setUse.function';\nimport { state } from './state.function';\nimport { syncStates } from './syncStates.function';\n/**\n * When an item in watch array changes, callback function will be triggered. Triggers on initial watch setup. TIP: try watch.noInit()\n * @param currentValues T[]\n * @param callback WatchCallback\n * @returns T[]\n */\nexport const watch = ((currentValues, callback) => {\n return setupWatch(currentValues, callback);\n});\nconst defaultFinally = (x) => x;\nfunction newWatch(setup) {\n const method = (currentValues, callback) => {\n return setupWatch(currentValues, callback, setup);\n };\n method.setup = setup;\n defineOnMethod(() => method, method);\n return method;\n}\n/**\n * puts above functionality together\n * @param currentValues values being watched\n * @param callback (currentValue, previousValues) => resolveToValue\n * @param param2\n * @returns\n */\nconst setupWatch = (currentValues, callback, { init, before = () => true, final = defaultFinally, } = {}) => {\n let previous = state({\n pastResult: undefined,\n values: undefined,\n });\n const previousValues = previous.values;\n // First time running watch?\n if (previousValues === undefined) {\n if (!before(currentValues)) {\n previous.values = currentValues;\n return previous.pastResult; // do not continue\n }\n const castedInit = init || callback;\n const result = castedInit(currentValues, previousValues);\n previous.pastResult = final(result);\n previous.values = currentValues;\n return previous.pastResult;\n }\n const allExact = currentValues.every((item, index) => item === previousValues[index]);\n if (allExact) {\n return previous.pastResult;\n }\n if (!before(currentValues)) {\n previous.values = currentValues;\n return previous.pastResult; // do not continue\n }\n const result = callback(currentValues, previousValues);\n previous.pastResult = final(result);\n previousValues.length = 0;\n previousValues.push(...currentValues);\n return previous.pastResult;\n};\nfunction defineOnMethod(getWatch, attachTo) {\n Object.defineProperty(attachTo, 'noInit', {\n get() {\n const watch = getWatch();\n watch.setup.init = () => undefined;\n return watch;\n },\n });\n Object.defineProperty(attachTo, 'asSubject', {\n get() {\n const oldWatch = getWatch();\n const method = (currentValues, callback) => {\n const originalState = state(() => getSupportInCycle().memory.state);\n const subject = state(() => new ValueSubject(undefined));\n setupWatch(currentValues, (currentValues, previousValues) => {\n const setTo = callback(currentValues, previousValues);\n if (originalState.length) {\n const newestState = setUse.memory.stateConfig.array;\n syncStates(newestState, originalState);\n }\n subject.set(setTo);\n }, oldWatch.setup);\n return subject;\n };\n method.setup = oldWatch.setup;\n defineOnMethod(() => method, method);\n return method;\n /*\n method.setup = setup\n \n defineOnMethod(() => method as any, method)\n \n return method as any\n \n \n const oldWatch = getWatch()\n const watch = newWatch( oldWatch.setup )\n // const watch = getWatch()\n \n const subject = state(() => new Subject())\n watch.setup.final = (x: any) => {\n subject.set(x)\n return subject\n }\n return watch\n */\n },\n });\n Object.defineProperty(attachTo, 'truthy', {\n get() {\n const watch = getWatch();\n watch.setup.before = (currentValues) => currentValues.every(x => x);\n return watch;\n },\n });\n return attachTo;\n}\ndefineOnMethod(() => newWatch({}), watch);\n","import { isSubjectInstance } from \"../isInstance\";\nimport { combineLatest } from \"./combineLatest.function\";\nimport { getSubscription, runPipedMethods } from \"./subject.utils\";\nexport class Subject {\n value;\n onSubscription;\n methods = [];\n isSubject = true;\n subscribers = [];\n subscribeWith;\n // unsubcount = 0 // 🔬 testing\n constructor(value, onSubscription) {\n this.value = value;\n this.onSubscription = onSubscription;\n }\n subscribe(callback) {\n const subscription = getSubscription(this, callback);\n // are we within a pipe?\n const subscribeWith = this.subscribeWith;\n if (subscribeWith) {\n // are we in a pipe?\n if (this.methods.length) {\n const orgCallback = callback;\n callback = (value) => {\n runPipedMethods(value, this.methods, lastValue => orgCallback(lastValue, subscription));\n };\n }\n return subscribeWith(callback);\n }\n this.subscribers.push(subscription);\n // Subject.globalSubs.push(subscription) // 🔬 testing\n const count = Subject.globalSubCount$.value;\n Subject.globalSubCount$.set(count + 1); // 🔬 testing\n if (this.onSubscription) {\n this.onSubscription(subscription);\n }\n return subscription;\n }\n set(value) {\n this.value = value;\n // Notify all subscribers with the new value\n const subs = [...this.subscribers]; // subs may change as we call callbacks\n const length = subs.length;\n for (let index = 0; index < length; ++index) {\n const sub = subs[index];\n sub.callback(value, sub);\n }\n }\n // next() is available for rxjs compatibility\n next = this.set;\n toPromise() {\n return new Promise(res => {\n this.subscribe((x, subscription) => {\n subscription.unsubscribe();\n res(x);\n });\n });\n }\n /** like toPromise but faster */\n toCallback(callback) {\n this.subscribe((x, subscription) => {\n subscription.unsubscribe();\n callback(x);\n });\n return this;\n }\n pipe(...operations) {\n const subject = new Subject(this.value);\n subject.methods = operations;\n subject.subscribeWith = (x) => this.subscribe(x);\n subject.set = x => this.set(x);\n subject.next = subject.set;\n return subject;\n }\n static all(args) {\n const switched = args.map(arg => {\n if (isSubjectInstance(arg))\n return arg;\n // Call the callback immediately with the current value\n const x = new Subject(arg, subscription => {\n subscription.next(arg);\n return subscription;\n });\n return x;\n });\n return combineLatest(switched);\n }\n static globalSubCount$ = new Subject(0); // for ease of debugging\n}\n","import { Subject } from './Subject.class';\nexport class ValueSubject extends Subject {\n value;\n constructor(value) {\n super(value);\n this.value = value;\n }\n subscribe(callback) {\n const subscription = super.subscribe(callback);\n // Call the callback immediately with the current value\n callback(this.value, subscription);\n return subscription;\n }\n}\n","import { Subject } from \"./Subject.class\";\nexport function combineLatest(subjects) {\n const output = new Subject();\n const subscribe = (callback) => {\n const valuesSeen = [];\n const values = [];\n const setValue = (x, index) => {\n valuesSeen[index] = true;\n values[index] = x;\n const countMatched = valuesSeen.length === subjects.length;\n if (!countMatched) {\n return;\n }\n for (let index = valuesSeen.length - 1; index >= 0; --index) {\n if (!valuesSeen[index]) {\n return;\n }\n }\n // everyone has reported values\n callback(values, subscription);\n };\n const clones = [...subjects];\n const firstSub = clones.shift();\n const subscription = firstSub.subscribe(x => setValue(x, 0));\n const subscriptions = clones.map((subject, index) => subject.subscribe(x => setValue(x, index + 1)));\n subscription.subscriptions = subscriptions;\n return subscription;\n };\n output.subscribeWith = subscribe;\n return output;\n}\n","export * from './Subject.class';\nexport * from './ValueSubject';\nexport * from './combineLatest.function';\nexport * from './will.functions';\n","import { Subject } from \"./Subject.class\";\nfunction removeSubFromArray(subscribers, callback) {\n const index = subscribers.findIndex(sub => sub.callback === callback);\n if (index !== -1) {\n subscribers.splice(index, 1);\n }\n}\nexport function getSubscription(subject, callback) {\n const countSubject = Subject.globalSubCount$;\n Subject.globalSubCount$.set(countSubject.value + 1);\n const subscription = () => {\n subscription.unsubscribe();\n };\n subscription.callback = callback;\n subscription.subscriptions = [];\n // Return a function to unsubscribe from the BehaviorSubject\n subscription.unsubscribe = () => {\n removeSubFromArray(subject.subscribers, callback); // each will be called when update comes in\n // removeSubFromArray(Subject.globalSubs, callback) // 🔬 testing\n Subject.globalSubCount$.set(countSubject.value - 1);\n // any double unsubscribes will be ignored\n subscription.unsubscribe = () => subscription;\n // unsubscribe from any combined subjects\n const subscriptions = subscription.subscriptions;\n for (let index = subscriptions.length - 1; index >= 0; --index) {\n subscriptions[index].unsubscribe();\n }\n return subscription;\n };\n subscription.add = (sub) => {\n subscription.subscriptions.push(sub);\n return subscription;\n };\n subscription.next = (value) => {\n callback(value, subscription);\n };\n return subscription;\n}\nexport function runPipedMethods(value, methods, onComplete) {\n const cloneMethods = [...methods];\n const firstMethod = cloneMethods.shift();\n const next = (newValue) => {\n if (cloneMethods.length) {\n return runPipedMethods(newValue, cloneMethods, onComplete);\n }\n onComplete(newValue);\n };\n let handler = next;\n const setHandler = (x) => handler = x;\n const pipeUtils = { setHandler, next };\n const methodResponse = firstMethod(value, pipeUtils);\n handler(methodResponse);\n}\n","export function willCallback(callback) {\n return ((lastValue, utils) => {\n utils.setHandler(() => {\n return undefined;\n });\n callback(lastValue, utils.next);\n });\n}\n/** .pipe( promise((x) => Promise.resolve(44)) ) */\nexport function willPromise(callback) {\n return ((lastValue, utils) => {\n utils.setHandler(() => {\n return undefined;\n }); // do nothing on initial return\n const result = callback(lastValue);\n result.then(x => utils.next(x));\n });\n}\n/** .pipe( willSubscribe((x) => new ValueSubject(44)) ) */\nexport const willSubscribe = (callback) => {\n return ((lastValue, utils) => {\n utils.setHandler(() => {\n return undefined;\n }); // do nothing on initial return\n const result = callback(lastValue);\n const subscription = result.subscribe(x => {\n subscription.unsubscribe();\n utils.next(x);\n });\n });\n};\n","export const variablePrefix = '__tagvar';\nexport const escapeVariable = '--' + variablePrefix + '--';\nexport const escapeSearch = new RegExp(escapeVariable, 'g');\nexport class Tag {\n strings;\n values;\n isTagClass = true;\n // present only when an array. Populated by Tag.key()\n memory = {};\n templater;\n constructor(strings, values) {\n this.strings = strings;\n this.values = values;\n }\n /** Used for array, such as array.map(), calls aka array.map(x => html``.key(x)) */\n key(arrayValue) {\n this.memory.arrayValue = arrayValue;\n return this;\n }\n // TODO: Is this just a fake function that can be data typed?\n children;\n html(strings, ...values) {\n this.children = { strings, values };\n return this;\n }\n}\n","import { escapeVariable, variablePrefix } from './Tag.class';\nimport { deepClone } from '../deepFunctions';\nimport { isTagComponent } from '../isInstance';\nimport { cloneValueArray } from './cloneValueArray.function';\nimport { restoreTagMarker } from './checkDestroyPrevious.function';\nimport { runBeforeDestroy } from './tagRunner';\nimport { getChildTagsToDestroy } from './destroy.support';\nimport { elementDestroyCheck } from './elementDestroyCheck.function';\nimport { updateContextItem } from './update/updateContextItem.function';\nimport { processNewValue } from './update/processNewValue.function';\nimport { setTagPlaceholder } from './setTagPlaceholder.function';\nimport { interpolateElement, interpolateString } from '../interpolations/interpolateElement';\nimport { subscribeToTemplate } from '../interpolations/interpolateTemplate';\nimport { afterInterpolateElement } from '../interpolations/afterInterpolateElement.function';\nconst prefixSearch = new RegExp(variablePrefix, 'g');\n/** used only for apps, otherwise use TagSupport */\nexport class BaseTagSupport {\n templater;\n subject;\n isApp = true;\n appElement; // only seen on this.getAppTagSupport().appElement\n strings;\n values;\n propsConfig;\n // stays with current render\n memory = {\n state: [],\n };\n clones = []; // elements on document. Needed at destroy process to know what to destroy\n // travels with all rerenderings\n global = {\n context: {}, // populated after reading interpolated.values array converted to an object {variable0, variable:1}\n providers: [],\n /** Indicator of re-rending. Saves from double rending something already rendered */\n renderCount: 0,\n deleted: false,\n subscriptions: [],\n };\n hasLiveElements = false;\n constructor(templater, subject) {\n this.templater = templater;\n this.subject = subject;\n const children = templater.children; // children tags passed in as arguments\n const kidValue = children.value;\n const props = templater.props; // natural props\n const latestCloned = props.map(props => deepClone(props));\n this.propsConfig = {\n latest: props,\n latestCloned, // assume its HTML children and then detect\n lastClonedKidValues: kidValue.map(kid => {\n const cloneValues = cloneValueArray(kid.values);\n return cloneValues;\n })\n };\n }\n /** Function that kicks off actually putting tags down as HTML elements */\n buildBeforeElement(insertBefore, options = {\n counts: { added: 0, removed: 0 },\n }) {\n const subject = this.subject;\n const global = this.global;\n global.insertBefore = insertBefore;\n if (!global.placeholder) {\n setTagPlaceholder(global);\n }\n const placeholderElm = global.placeholder;\n global.oldest = this;\n global.newest = this;\n subject.tagSupport = this;\n this.hasLiveElements = true;\n const context = this.update();\n const template = this.getTemplate();\n const elementContainer = document.createDocumentFragment();\n const tempDraw = document.createElement('template');\n tempDraw.innerHTML = template.string;\n elementContainer.appendChild(tempDraw);\n // Search/replace innerHTML variables but don't interpolate tag components just yet\n const { tagComponents } = interpolateElement(elementContainer, context, template, this, // ownerSupport,\n {\n counts: options.counts\n });\n afterInterpolateElement(elementContainer, placeholderElm, this, // ownerSupport\n context, options);\n // Any tag components that were found should be processed AFTER the owner processes its elements. Avoid double processing of elements attributes like (oninit)=${}\n const length = tagComponents.length;\n for (let index = 0; index < length; ++index) {\n const tagComponent = tagComponents[index];\n subscribeToTemplate(tagComponent.insertBefore, tagComponent.subject, tagComponent.ownerSupport, options.counts);\n afterInterpolateElement(elementContainer, tagComponent.insertBefore, tagComponent.ownerSupport, context, options);\n }\n }\n getTemplate() {\n const thisTag = this.templater.tag;\n const strings = this.strings || thisTag.strings;\n const values = this.values || thisTag.values;\n const string = strings.map((string, index) => {\n const safeString = string.replace(prefixSearch, escapeVariable);\n const endString = safeString + (values.length > index ? `{${variablePrefix}${index}}` : '');\n const trimString = endString.replace(/>\\s*/g, '>').replace(/\\s*</g, '<');\n return trimString;\n }).join('');\n const interpolation = interpolateString(string);\n return {\n interpolation,\n string: interpolation.string,\n strings,\n values,\n context: this.global.context || {},\n };\n }\n update() {\n return this.updateContext(this.global.context);\n }\n updateContext(context) {\n const thisTag = this.templater.tag;\n const strings = this.strings || thisTag.strings;\n const values = this.values || thisTag.values;\n strings.map((_string, index) => {\n const hasValue = values.length > index;\n if (!hasValue) {\n return;\n }\n const variableName = variablePrefix + index;\n const value = values[index];\n // is something already there?\n const exists = variableName in context;\n if (exists) {\n return updateContextItem(context, variableName, value);\n }\n // 🆕 First time values below\n context[variableName] = processNewValue(value, this);\n });\n return context;\n }\n}\nexport class TagSupport extends BaseTagSupport {\n templater;\n ownerTagSupport;\n subject;\n version;\n isApp = false;\n childTags = []; // tags on me\n constructor(templater, // at runtime rendering of a tag, it needs to be married to a new TagSupport()\n ownerTagSupport, subject, version = 0) {\n super(templater, subject);\n this.templater = templater;\n this.ownerTagSupport = ownerTagSupport;\n this.subject = subject;\n this.version = version;\n }\n destroy(options = {\n stagger: 0,\n byParent: false, // Only destroy clones of direct children\n }) {\n const firstDestroy = !options.byParent;\n const global = this.global;\n const subject = this.subject;\n const childTags = options.byParent ? [] : getChildTagsToDestroy(this.childTags);\n if (firstDestroy && isTagComponent(this.templater)) {\n runBeforeDestroy(this, this);\n }\n this.destroySubscriptions();\n // signify immediately child has been deleted (looked for during event processing)\n for (let index = childTags.length - 1; index >= 0; --index) {\n const child = childTags[index];\n const subGlobal = child.global;\n delete subGlobal.newest;\n subGlobal.deleted = true;\n if (isTagComponent(child.templater)) {\n runBeforeDestroy(child, child);\n }\n }\n // HTML DOM manipulation. Put back down the template tag\n const insertBefore = global.insertBefore;\n if (insertBefore.nodeName === 'TEMPLATE') {\n const placeholder = global.placeholder;\n if (placeholder && !('arrayValue' in this.memory)) {\n if (!options.byParent) {\n restoreTagMarker(this);\n }\n }\n }\n let mainPromise;\n if (this.ownerTagSupport) {\n this.ownerTagSupport.childTags = this.ownerTagSupport.childTags.filter(child => child !== this);\n }\n if (firstDestroy) {\n const { stagger, promise } = this.destroyClones(options);\n options.stagger = stagger;\n if (promise) {\n mainPromise = promise;\n }\n }\n else {\n this.destroyClones();\n }\n // data reset\n delete global.placeholder;\n global.context = {};\n delete global.oldest;\n delete global.newest;\n global.deleted = true;\n this.childTags.length = 0;\n this.hasLiveElements = false;\n delete subject.tagSupport;\n if (mainPromise) {\n mainPromise = mainPromise.then(async () => {\n const promises = childTags.map(kid => kid.destroy({ stagger: 0, byParent: true }));\n return Promise.all(promises);\n });\n }\n else {\n mainPromise = Promise.all(childTags.map(kid => kid.destroy({ stagger: 0, byParent: true })));\n }\n return mainPromise.then(() => options.stagger);\n }\n destroySubscriptions() {\n const subs = this.global.subscriptions;\n for (let index = subs.length - 1; index >= 0; --index) {\n subs[index].unsubscribe();\n }\n subs.length = 0;\n }\n destroyClones({ stagger } = {\n stagger: 0,\n }) {\n const oldClones = [...this.clones];\n this.clones.length = 0; // tag maybe used for something else\n const promises = oldClones.map(clone => this.checkCloneRemoval(clone, stagger)).filter(x => x); // only return promises\n // check subjects that may have clones attached to them\n const oldContext = this.global.context;\n for (const name in oldContext) {\n const value = oldContext[name];\n const clone = value.clone;\n if (clone?.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n }\n if (promises.length) {\n return { promise: Promise.all(promises), stagger };\n }\n return { stagger };\n }\n /** Reviews elements for the presences of ondestroy */\n checkCloneRemoval(clone, stagger) {\n let promise;\n const customElm = clone;\n if (customElm.ondestroy) {\n promise = elementDestroyCheck(customElm, stagger);\n }\n const next = () => {\n const parentNode = clone.parentNode;\n if (parentNode) {\n parentNode.removeChild(clone);\n }\n const ownerSupport = this.ownerTagSupport;\n if (ownerSupport) {\n // Sometimes my clones were first registered to my owner, remove them from owner\n ownerSupport.clones = ownerSupport.clones.filter(compareClone => compareClone !== clone);\n }\n };\n if (promise instanceof Promise) {\n return promise.then(next);\n }\n else {\n next();\n }\n return promise;\n }\n updateBy(tagSupport) {\n const tempTag = tagSupport.templater.tag;\n this.updateConfig(tempTag.strings, tempTag.values);\n }\n updateConfig(strings, values) {\n this.strings = strings;\n this.updateValues(values);\n }\n updateValues(values) {\n this.values = values;\n return this.updateContext(this.global.context);\n }\n getAppTagSupport() {\n let tag = this;\n while (tag.ownerTagSupport) {\n tag = tag.ownerTagSupport;\n }\n return tag;\n }\n}\nfunction restoreTagMarkers(support) {\n restoreTagMarker(support);\n const childTags = support.childTags;\n for (let index = childTags.length - 1; index >= 0; --index) {\n restoreTagMarkers(childTags[index].global.oldest);\n }\n}\n","import { isTag, isTagArray, isTagComponent } from '../isInstance';\nimport { isLikeTags } from './isLikeTags.function';\nimport { destroyTagMemory, destroyTagSupportPast } from './destroyTag.function';\nimport { insertAfter } from '../insertAfter.function';\nexport function checkDestroyPrevious(subject, // existing.value is the old value\nnewValue, insertBefore) {\n const displaySubject = subject;\n const hasLastValue = 'lastValue' in displaySubject;\n const lastValue = displaySubject.lastValue; // TODO: we maybe able to use displaySubject.value and remove concept of lastValue\n // was simple value but now something bigger\n if (hasLastValue && lastValue !== newValue) {\n const newType = typeof (newValue);\n if (isSimpleType(newType) && typeof (lastValue) === newType) {\n return false;\n }\n if (newValue instanceof Function && lastValue instanceof Function) {\n return false;\n }\n destroySimpleValue(insertBefore, displaySubject);\n return 'changed-simple-value';\n }\n const arraySubject = subject;\n const wasArray = arraySubject.lastArray;\n // no longer an array\n if (wasArray && !isTagArray(newValue)) {\n const placeholderElm = arraySubject.placeholder;\n delete arraySubject.lastArray;\n delete arraySubject.placeholder;\n insertAfter(insertBefore, placeholderElm);\n for (let index = wasArray.length - 1; index >= 0; --index) {\n const { tagSupport } = wasArray[index];\n destroyArrayTag(tagSupport, { added: 0, removed: 0 });\n }\n return 'array';\n }\n const tagSubject = subject;\n const lastSupport = tagSubject.tagSupport;\n // no longer tag or component?\n if (lastSupport) {\n const isValueTag = isTag(newValue);\n const isSubjectTag = isTag(subject.value);\n if (isSubjectTag && isValueTag) {\n const newTag = newValue;\n // its a different tag now\n if (!isLikeTags(newTag, lastSupport)) {\n // put template back down\n restoreTagMarker(lastSupport);\n destroyTagMemory(lastSupport);\n return 2;\n }\n return false;\n }\n const isValueTagComponent = isTagComponent(newValue);\n if (isValueTagComponent) {\n return false; // its still a tag component\n }\n if (newValue && newValue.oneRender) {\n return false;\n }\n // put template back down\n restoreTagMarker(lastSupport);\n // destroy old component, value is not a component\n destroyTagMemory(lastSupport);\n return 'different-tag';\n }\n return false;\n}\nexport function isSimpleType(value) {\n return ['string', 'number', 'boolean'].includes(value);\n}\nexport function destroyArrayTag(tagSupport, counts) {\n destroyTagSupportPast(tagSupport);\n tagSupport.destroy({\n stagger: counts.removed++,\n });\n const insertBefore = tagSupport.global.insertBefore;\n const parentNode = insertBefore.parentNode;\n parentNode.removeChild(insertBefore);\n}\nfunction destroySimpleValue(insertBefore, // always a template tag\nsubject) {\n const clone = subject.clone;\n const parent = clone.parentNode;\n // 1 put the template back down\n parent.insertBefore(insertBefore, clone);\n parent.removeChild(clone);\n delete subject.clone;\n delete subject.lastValue;\n}\nexport function restoreTagMarker(lastSupport) {\n const insertBefore = lastSupport.global.insertBefore;\n const global = lastSupport.global;\n const placeholderElm = global.placeholder;\n if (placeholderElm) {\n insertAfter(insertBefore, placeholderElm);\n delete global.placeholder;\n }\n}\n","import { deepClone } from '../deepFunctions';\nimport { isTagArray, isTagClass, isTagComponent, isTagTemplater } from '../isInstance';\nexport function cloneValueArray(values) {\n return values.map((value) => {\n const tag = value;\n if (isTagComponent(value)) {\n const tagComponent = value;\n return deepClone(tagComponent.props);\n }\n if (isTagClass(tag) || isTagTemplater(tag)) {\n return cloneValueArray(tag.values);\n }\n if (isTagArray(tag)) {\n return cloneValueArray(tag);\n }\n return deepClone(value);\n });\n}\n","export function getChildTagsToDestroy(childTags, allTags = []) {\n for (let index = childTags.length - 1; index >= 0; --index) {\n const cTag = childTags[index];\n allTags.push(cTag);\n childTags.splice(index, 1);\n getChildTagsToDestroy(cTag.childTags, allTags);\n }\n return allTags;\n}\n","export function destroyTagMemory(oldTagSupport) {\n // must destroy oldest which is tag with elements on stage\n const oldest = oldTagSupport.global.oldest;\n oldest.destroy();\n destroyTagSupportPast(oldTagSupport);\n oldTagSupport.global.context = {};\n}\nexport function destroyTagSupportPast(oldTagSupport) {\n delete oldTagSupport.global.oldest;\n delete oldTagSupport.global.newest;\n}\n","export function elementDestroyCheck(nextSibling, stagger) {\n const onDestroyDoubleWrap = nextSibling.ondestroy;\n if (!onDestroyDoubleWrap) {\n return;\n }\n const onDestroyWrap = onDestroyDoubleWrap.tagFunction;\n if (!onDestroyWrap) {\n return;\n }\n const onDestroy = onDestroyWrap.tagFunction;\n if (!onDestroy) {\n return;\n }\n const event = { target: nextSibling, stagger };\n return onDestroy(event);\n}\n","import { setUse } from '../state';\nexport function getSupportInCycle() {\n return setUse.memory.stateConfig.tagSupport;\n}\n","import { deepEqual } from \"../deepFunctions\";\n/**\n *\n * @param props\n * @param pastCloneProps\n * @returns WHEN number then props have changed. WHEN false props have not changed\n */\nexport function hasPropChanges(props, // natural props\npastCloneProps) {\n /*\n const isCommonEqual = props === undefined && props === compareToProps\n if(isCommonEqual) {\n return false\n }\n */\n let castedProps = props;\n let castedPastProps = pastCloneProps;\n // check all prop functions match\n if (typeof (props) === 'object') {\n if (!pastCloneProps) {\n return 3;\n }\n // castedProps = {...props}\n castedProps = [...props];\n // castedPastProps = {...(pastCloneProps || {})}\n castedPastProps = [...(pastCloneProps || [])];\n const allFunctionsMatch = castedProps.every((value, index) => {\n let compare = castedPastProps[index];\n if (value && typeof (value) === 'object') {\n const subCastedProps = { ...value };\n const subCompareProps = { ...compare || {} };\n const matched = Object.entries(subCastedProps).every(([key, value]) => {\n return compareProps(value, subCompareProps[key], () => {\n delete subCastedProps[key]; // its a function and not needed to be compared\n delete subCompareProps[key]; // its a function and not needed to be compared\n });\n });\n return matched;\n }\n return compareProps(value, compare, () => {\n castedProps.splice(index, 1);\n castedPastProps.splice(index, 1);\n });\n });\n if (!allFunctionsMatch) {\n return 6; // a change has been detected by function comparisons\n }\n }\n // const isEqual = deepEqual(castedPastProps, castedProps)\n // return isEqual ? false : 7 // if equal then no changes\n return false;\n}\n/** returning a number means true good comparison */\nfunction compareProps(value, compare, onDelete) {\n if (!(value instanceof Function)) {\n return deepEqual(value, compare) ? 4 : false;\n }\n const compareFn = compare;\n if (!(compareFn instanceof Function)) {\n return false; // its a function now but was not before\n }\n // ensure we are comparing apples to apples as function get wrapped\n const compareOriginal = compare?.original;\n if (compareOriginal) {\n compare = compareOriginal;\n }\n const original = value.original;\n if (original) {\n value = value.original;\n }\n const valueString = value.toString();\n const compareString = compare.toString();\n if (valueString === compareString) {\n onDelete();\n return 3; // both are function the same\n }\n onDelete();\n return 5;\n}\n","import { hasPropChanges } from \"./hasPropChanges.function\";\nexport function hasTagSupportChanged(oldTagSupport, newTagSupport, newTemplater) {\n const latestProps = newTemplater.props; // newTagSupport.propsConfig.latest\n const pastCloneProps = oldTagSupport.propsConfig.latestCloned;\n const propsChanged = hasPropChanges(latestProps, pastCloneProps);\n // if no changes detected, no need to continue to rendering further tags\n if (propsChanged) {\n return propsChanged;\n }\n const kidsChanged = hasKidsChanged(oldTagSupport, newTagSupport);\n // we already know props didn't change and if kids didn't either, than don't render\n return kidsChanged;\n}\nexport function hasKidsChanged(oldTagSupport, newTagSupport) {\n const oldCloneKidValues = oldTagSupport.propsConfig.lastClonedKidValues;\n const newClonedKidValues = newTagSupport.propsConfig.lastClonedKidValues;\n const everySame = oldCloneKidValues.every((set, index) => {\n const x = newClonedKidValues[index];\n return set.every((item, index) => item === x[index]);\n });\n return everySame ? false : 9;\n}\n","import { Tag } from \"./Tag.class\";\nexport function html(strings, ...values) {\n return new Tag(strings, values);\n}\n","export function isLikeTags(tagSupport0, // new\ntagSupport1) {\n const templater0 = tagSupport0.templater;\n const templater1 = tagSupport1.templater;\n const tag0 = templater0?.tag || tagSupport0;\n const tag1 = templater1.tag;\n const strings0 = tag0.strings;\n const strings1 = tagSupport1.strings || tag1.strings;\n if (strings0.length !== strings1.length) {\n return false;\n }\n const everyStringMatched = strings0.every((string, index) => strings1[index] === string);\n if (!everyStringMatched) {\n return false;\n }\n const values0 = tagSupport0.values || tag0.values;\n const values1 = tagSupport1.values || tag1.values;\n return isLikeValueSets(values0, values1);\n}\nexport function isLikeValueSets(values0, values1) {\n const valuesLengthsMatch = values0.length === values1.length;\n if (!valuesLengthsMatch) {\n return false;\n }\n const allVarsMatch = values1.every((value, index) => {\n const compareTo = values0[index];\n const isFunctions = value instanceof Function && compareTo instanceof Function;\n if (isFunctions) {\n const stringMatch = value.toString() === compareTo.toString();\n if (stringMatch) {\n return true;\n }\n return false;\n }\n return true; // deepEqual(value, compareTo)\n });\n if (allVarsMatch) {\n return true;\n }\n return false;\n}\n","import { providersChangeCheck } from '../../state/provider.utils';\nimport { isLikeTags } from '../isLikeTags.function';\nimport { renderWithSupport } from './renderWithSupport.function';\n/** Returns true when rendering owner is not needed. Returns false when rendering owner should occur */\nexport function renderExistingTag(oldestSupport, // oldest with elements on html\nnewSupport, // new to be rendered\nownerSupport, // ownerSupport\nsubject) {\n const lastSupport = subject.tagSupport;\n const global = lastSupport.global;\n // share point between renders\n newSupport.global = global;\n const preRenderCount = global.renderCount;\n providersChangeCheck(oldestSupport);\n // When the providers were checked, a render to myself occurred and I do not need to re-render again\n const prevSupport = global.newest;\n if (preRenderCount !== global.renderCount) {\n oldestSupport.updateBy(prevSupport);\n return prevSupport; // already rendered during triggered events\n }\n const toRedrawTag = prevSupport || lastSupport || global.oldest;\n const reSupport = renderWithSupport(newSupport, toRedrawTag, subject, ownerSupport);\n const oldest = global.oldest || oldestSupport;\n reSupport.global.oldest = oldest;\n // TODO: renderWithSupport already does an isLikeTags compare\n if (isLikeTags(prevSupport, reSupport)) {\n subject.tagSupport = reSupport;\n oldest.updateBy(reSupport);\n }\n return reSupport;\n}\n","import { renderWithSupport } from './renderWithSupport.function';\nexport function renderSubjectComponent(subject, reSupport, ownerSupport) {\n const preClones = ownerSupport.clones.map(clone => clone);\n reSupport = renderWithSupport(reSupport, subject.tagSupport, // existing tag\n subject, ownerSupport);\n reSupport.global.newest = reSupport;\n if (ownerSupport.clones.length > preClones.length) {\n const myClones = ownerSupport.clones.filter(fClone => !preClones.find(clone => clone === fClone));\n reSupport.clones.push(...myClones);\n }\n ownerSupport.childTags.push(reSupport);\n return reSupport;\n}\n","import { runBeforeRedraw, runBeforeRender } from '../tagRunner';\nimport { setUse } from '../../state';\nimport { runAfterRender } from '../tagRunner';\nexport function renderTagOnly(newTagSupport, lastSupport, subject, ownerSupport) {\n const oldRenderCount = newTagSupport.global.renderCount;\n beforeWithRender(newTagSupport, ownerSupport, lastSupport);\n const templater = newTagSupport.templater;\n // NEW TAG CREATED HERE\n const wrapper = templater.wrapper;\n let reSupport = wrapper(newTagSupport, subject);\n /* AFTER */\n runAfterRender(newTagSupport, ownerSupport);\n // When we rendered, only 1 render should have taken place OTHERWISE rendering caused another render and that is the latest instead\n if (reSupport.global.renderCount > oldRenderCount + 1) {\n return newTagSupport.global.newest;\n }\n newTagSupport.global.newest = reSupport;\n return reSupport;\n}\nfunction beforeWithRender(tagSupport, // new\nownerSupport, lastSupport) {\n const lastOwnerSupport = lastSupport?.ownerTagSupport;\n const runtimeOwnerSupport = lastOwnerSupport || ownerSupport;\n if (lastSupport) {\n const lastState = lastSupport.memory.state;\n const memory = tagSupport.memory;\n // memory.state.length = 0\n // memory.state.push(...lastState)\n memory.state = [...lastState];\n tagSupport.global = lastSupport.global;\n runBeforeRedraw(tagSupport, lastSupport);\n }\n else {\n // first time render\n runBeforeRender(tagSupport, runtimeOwnerSupport);\n // TODO: Logic below most likely could live within providers.ts inside the runBeforeRender function\n const providers = setUse.memory.providerConfig;\n providers.ownerSupport = runtimeOwnerSupport;\n }\n}\n","import { deepEqual } from '../../deepFunctions';\nimport { renderExistingTag } from './renderExistingTag.function';\n/** Main function used by all other callers to render/update display of a tag component */\nexport function renderTagSupport(tagSupport, // must be latest/newest state render\nrenderUp) {\n const global = tagSupport.global;\n const templater = tagSupport.templater;\n // is it just a vanilla tag, not component?\n if (!templater.wrapper) { // || isTagTemplater(templater) \n const ownerTag = tagSupport.ownerTagSupport;\n ++global.renderCount;\n return renderTagSupport(ownerTag, true);\n }\n const subject = tagSupport.subject;\n let ownerSupport;\n let selfPropChange = false;\n const shouldRenderUp = renderUp && tagSupport;\n if (shouldRenderUp) {\n ownerSupport = tagSupport.ownerTagSupport;\n if (ownerSupport) {\n const nowProps = templater.props;\n const latestProps = tagSupport.propsConfig.latestCloned;\n selfPropChange = !nowProps.every((props, index) => deepEqual(props, latestProps[index]));\n }\n }\n const oldest = tagSupport.global.oldest;\n const tag = renderExistingTag(oldest, tagSupport, ownerSupport, // useTagSupport,\n subject);\n const renderOwner = ownerSupport && selfPropChange;\n if (renderOwner) {\n const ownerTagSupport = ownerSupport;\n renderTagSupport(ownerTagSupport, true);\n return tag;\n }\n return tag;\n}\n","import { isLikeTags } from '../isLikeTags.function';\nimport { destroyTagMemory } from '../destroyTag.function';\nimport { renderTagOnly } from './renderTagOnly.function';\nexport function renderWithSupport(newTagSupport, lastSupport, // previous\nsubject, // events & memory\nownerSupport) {\n const reSupport = renderTagOnly(newTagSupport, lastSupport, subject, ownerSupport);\n const isLikeTag = !lastSupport || isLikeTags(lastSupport, reSupport);\n if (!isLikeTag) {\n destroyUnlikeTags(lastSupport, reSupport, subject);\n }\n const lastOwnerSupport = lastSupport?.ownerTagSupport;\n reSupport.ownerTagSupport = (ownerSupport || lastOwnerSupport);\n return reSupport;\n}\nfunction destroyUnlikeTags(lastSupport, // old\nreSupport, // new\nsubject) {\n const oldGlobal = lastSupport.global;\n const insertBefore = oldGlobal.insertBefore;\n destroyTagMemory(lastSupport);\n // when a tag is destroyed, disconnect the globals\n reSupport.global = { ...oldGlobal }; // break memory references\n const global = reSupport.global;\n global.insertBefore = insertBefore;\n global.deleted = false;\n delete global.oldest;\n delete global.newest;\n delete subject.tagSupport;\n}\n","export function setTagPlaceholder(global) {\n const insertBefore = global.insertBefore;\n return global.placeholder = swapInsertBefore(insertBefore);\n}\nexport function swapInsertBefore(insertBefore) {\n const placeholder = document.createTextNode('');\n const parentNode = insertBefore.parentNode;\n parentNode.insertBefore(placeholder, insertBefore);\n parentNode.removeChild(insertBefore);\n return placeholder;\n}\n","import { isSubjectInstance, isTagArray } from '../isInstance';\nimport { setUse } from '../state';\nimport { TemplaterResult } from '../TemplaterResult.class';\nimport { runTagCallback } from '../interpolations/bindSubjectCallback.function';\nimport { deepClone } from '../deepFunctions';\nimport { TagSupport } from './TagSupport.class';\nimport { alterProps } from '../alterProps.function';\nimport { ValueSubject } from '../subject/ValueSubject';\nimport { tags } from './tag.utils';\nlet tagCount = 0;\n/** Wraps a function tag in a state manager and calls wrapped function on event cycles\n * For single rendering, no event cycles, use: tag.renderOnce = (props) => html``\n */\nexport function tag(tagComponent) {\n /** function developer triggers */\n const parentWrap = (function tagWrapper(...props) {\n const templater = new TemplaterResult(props);\n // attach memory back to original function that contains developer display logic\n const innerTagWrap = getTagWrap(templater, parentWrap);\n if (!innerTagWrap.parentWrap) {\n innerTagWrap.parentWrap = parentWrap;\n }\n templater.tagged = true;\n templater.wrapper = innerTagWrap;\n return templater;\n }) // we override the function provided and pretend original is what's returned\n ;\n parentWrap.original = tagComponent;\n parentWrap.compareTo = tagComponent.toString();\n updateResult(parentWrap, tagComponent);\n // group tags together and have hmr pickup\n updateComponent(tagComponent);\n tags.push(parentWrap);\n return parentWrap;\n}\n/** Used to create a tag component that renders once and has no addition rendering cycles */\ntag.oneRender = (...props) => {\n throw new Error('Do not call function tag.oneRender but instead set it as: `tag.oneRender = (props) => html`` `');\n};\nObject.defineProperty(tag, 'oneRender', {\n set(oneRenderFunction) {\n oneRenderFunction.oneRender = true;\n },\n});\nexport function kidsToTagArraySubject(children) {\n if (isSubjectInstance(children)) {\n return { childSubject: children, madeSubject: false };\n }\n const kidArray = children;\n if (isTagArray(kidArray)) {\n return { childSubject: new ValueSubject(children), madeSubject: true };\n }\n const kid = children;\n if (kid) {\n kid.memory.arrayValue = 0;\n return { childSubject: new ValueSubject([kid]), madeSubject: true };\n }\n return {\n childSubject: new ValueSubject([]),\n madeSubject: true // was converted into a subject\n };\n}\nfunction updateResult(result, tagComponent) {\n result.isTag = true;\n result.original = tagComponent;\n}\nfunction updateComponent(tagComponent) {\n tagComponent.tags = tags;\n tagComponent.setUse = setUse;\n tagComponent.tagIndex = tagCount++; // needed for things like HMR\n}\n/** creates/returns a function that when called then calls the original component function\n * Gets used as templater.wrapper()\n */\nfunction getTagWrap(templater, result) {\n // this function gets called by taggedjs\n const wrapper = function (newTagSupport, subject) {\n const global = newTagSupport.global;\n ++global.renderCount;\n const childSubject = templater.children;\n const lastArray = global.oldest?.templater.children.lastArray;\n if (lastArray) {\n childSubject.lastArray = lastArray;\n }\n // result.original\n const originalFunction = result.original; // (innerTagWrap as any).original as unknown as TagComponent\n let props = templater.props;\n let castedProps = props.map(props => alterProps(props, newTagSupport.ownerTagSupport));\n const latestCloned = props.map(props => deepClone(props)); // castedProps\n // CALL ORIGINAL COMPONENT FUNCTION\n let tag = originalFunction(...castedProps);\n if (tag instanceof Function) {\n tag = tag();\n }\n tag.templater = templater;\n templater.tag = tag;\n const tagSupport = new TagSupport(templater, newTagSupport.ownerTagSupport, subject, global.renderCount);\n tagSupport.global = global;\n tagSupport.propsConfig = {\n latest: props,\n latestCloned,\n lastClonedKidValues: tagSupport.propsConfig.lastClonedKidValues,\n };\n tagSupport.memory = newTagSupport.memory; // state handover\n if (templater.madeChildIntoSubject) {\n const value = childSubject.value;\n for (let index = value.length - 1; index >= 0; --index) {\n const kid = value[index];\n const values = kid.values;\n for (let index = values.length - 1; index >= 0; --index) {\n const value = values[index];\n if (!(value instanceof Function)) {\n continue;\n }\n const valuesValue = kid.values[index];\n if (valuesValue.isChildOverride) {\n continue; // already overwritten\n }\n // all functions need to report to me\n kid.values[index] = function (...args) {\n const ownerSupport = tagSupport.ownerTagSupport;\n return runTagCallback(value, // callback\n ownerSupport, this, // bindTo\n args);\n };\n valuesValue.isChildOverride = true;\n }\n }\n }\n return tagSupport;\n };\n return wrapper;\n}\n","export const tags = [];\n","import { BaseTagSupport } from './TagSupport.class';\nimport { runAfterRender, runBeforeRender } from './tagRunner';\nimport { ValueSubject } from '../subject/ValueSubject';\nconst appElements = [];\n/**\n *\n * @param app taggedjs tag\n * @param element HTMLElement\n * @param props object\n * @returns\n */\nexport function tagElement(app, // (...args: unknown[]) => TemplaterResult,\nelement, props) {\n const appElmIndex = appElements.findIndex(appElm => appElm.element === element);\n if (appElmIndex >= 0) {\n appElements[appElmIndex].tagSupport.destroy();\n appElements.splice(appElmIndex, 1);\n // an element already had an app on it\n console.warn('Found and destroyed app element already rendered to element', { element });\n }\n // Create the app which returns [props, runOneTimeFunction]\n const wrapper = app(props);\n // have a function setup and call the tagWrapper with (props, {update, async, on})\n const tagSupport = runWrapper(wrapper);\n // TODO: is the below needed?\n tagSupport.appElement = element;\n tagSupport.isApp = true;\n tagSupport.global.isApp = true;\n const templateElm = document.createElement('template');\n templateElm.setAttribute('id', 'app-tag-' + appElements.length);\n templateElm.setAttribute('app-tag-detail', appElements.length.toString());\n const fragment = document.createDocumentFragment();\n fragment.appendChild(templateElm);\n element.destroy = async () => {\n await tagSupport.destroy();\n const insertBefore = tagSupport.global.insertBefore;\n const parentNode = insertBefore.parentNode;\n parentNode.removeChild(insertBefore);\n };\n tagSupport.buildBeforeElement(templateElm);\n tagSupport.global.oldest = tagSupport;\n tagSupport.global.newest = tagSupport;\n element.setUse = app.original.setUse;\n appElements.push({ element, tagSupport });\n element.appendChild(fragment);\n return {\n tagSupport,\n tags: app.original.tags,\n };\n}\nexport function runWrapper(templater) {\n let newSupport = {};\n const subject = new ValueSubject(newSupport);\n newSupport = new BaseTagSupport(templater, subject);\n subject.set(templater);\n subject.tagSupport = newSupport;\n runBeforeRender(newSupport, undefined);\n // Call the apps function for our tag templater\n const wrapper = templater.wrapper;\n const tagSupport = wrapper(newSupport, subject);\n runAfterRender(newSupport, tagSupport);\n return tagSupport;\n}\n","import { setUse } from '../state';\nimport { Subject } from '../subject';\nimport { getSupportInCycle } from './getSupportInCycle.function';\n// Emits event at the end of a tag being rendered. Use tagClosed$.toPromise() to render a tag after a current tag is done rendering\nsetUse.memory.tagClosed$ = new Subject(undefined, subscription => {\n if (!getSupportInCycle()) {\n subscription.next(); // we are not currently processing so process now\n }\n});\n// Life cycle 1\nexport function runBeforeRender(tagSupport, ownerSupport) {\n const tagUse = setUse.tagUse;\n const length = tagUse.length;\n for (let index = 0; index < length; ++index) {\n tagUse[index].beforeRender(tagSupport, ownerSupport);\n }\n}\n// Life cycle 2\nexport function runAfterRender(tagSupport, ownerTagSupport) {\n const tagUse = setUse.tagUse;\n const length = tagUse.length;\n for (let index = 0; index < length; ++index) {\n tagUse[index].afterRender(tagSupport, ownerTagSupport);\n }\n setUse.memory.tagClosed$.next(ownerTagSupport);\n}\n// Life cycle 3\nexport function runBeforeRedraw(tagSupport, ownerTagSupport) {\n const tagUse = setUse.tagUse;\n const length = tagUse.length;\n for (let index = 0; index < length; ++index) {\n tagUse[index].beforeRedraw(tagSupport, ownerTagSupport);\n }\n}\n// Life cycle 4 - end of life\nexport function runBeforeDestroy(tagSupport, ownerTagSupport) {\n const tagUse = setUse.tagUse;\n const length = tagUse.length;\n for (let index = 0; index < length; ++index) {\n tagUse[index].beforeDestroy(tagSupport, ownerTagSupport);\n }\n}\n","import { isSubjectInstance, isTagArray, isTagClass, isTagComponent, isTagTemplater } from '../../isInstance';\nimport { isSimpleType } from '../checkDestroyPrevious.function';\nexport var ValueTypes;\n(function (ValueTypes) {\n ValueTypes[\"unknown\"] = \"unknown\";\n ValueTypes[\"tag\"] = \"tag\";\n ValueTypes[\"templater\"] = \"templater\";\n ValueTypes[\"tagArray\"] = \"tag-array\";\n ValueTypes[\"tagComponent\"] = \"tag-component\";\n ValueTypes[\"subject\"] = \"subject\";\n ValueTypes[\"date\"] = \"date\";\n ValueTypes[\"string\"] = \"string\";\n ValueTypes[\"boolean\"] = \"boolean\";\n ValueTypes[\"function\"] = \"function\";\n ValueTypes[\"undefined\"] = \"undefined\";\n})(ValueTypes || (ValueTypes = {}));\nexport function getValueType(value) {\n if (value === undefined || value === null) {\n return ValueTypes.undefined;\n }\n if (value instanceof Date) {\n return ValueTypes.date;\n }\n if (value instanceof Function) {\n return ValueTypes.function;\n }\n const type = typeof (value);\n if (isSimpleType(type)) {\n return type;\n }\n if (isTagComponent(value)) {\n return ValueTypes.tagComponent;\n }\n if (isTagTemplater(value)) {\n return ValueTypes.templater;\n }\n if (isTagClass(value)) {\n return ValueTypes.tag;\n }\n if (isTagArray(value)) {\n return ValueTypes.tagArray;\n }\n if (isSubjectInstance(value)) {\n return ValueTypes.subject;\n }\n return ValueTypes.unknown;\n}\n","import { processSubjectComponent } from './processSubjectComponent.function';\nimport { processTagArray } from './processTagArray';\nimport { TemplaterResult } from '../../TemplaterResult.class';\nimport { processFirstRegularValue } from './processRegularValue.function';\nimport { newTagSupportByTemplater, processTag, tagFakeTemplater } from './processTag.function';\nimport { ValueTypes, getValueType } from './processFirstSubject.utils';\nimport { renderTagOnly } from '../render/renderTagOnly.function';\nexport function processFirstSubjectValue(value, subject, // could be tag via result.tag\ninsertBefore, // <template end interpolate /> (will be removed)\nownerSupport, // owner\noptions) {\n const valueType = getValueType(value);\n switch (valueType) {\n case ValueTypes.templater:\n processTag(value, insertBefore, ownerSupport, subject);\n return;\n case ValueTypes.tag:\n const tag = value;\n let templater = tag.templater;\n if (!templater) {\n templater = tagFakeTemplater(tag);\n }\n processTag(templater, insertBefore, ownerSupport, subject);\n return;\n case ValueTypes.tagArray:\n return processTagArray(subject, value, insertBefore, ownerSupport, options);\n case ValueTypes.tagComponent:\n processSubjectComponent(value, subject, insertBefore, ownerSupport, options);\n return;\n case ValueTypes.function:\n const v = value;\n if (v.oneRender) {\n const templater = new TemplaterResult([]);\n const tagSupport = newTagSupportByTemplater(templater, ownerSupport, subject);\n let tag;\n const wrap = () => {\n templater.tag = tag || (v());\n return tagSupport;\n };\n // const wrap = () => ((v as any)())\n templater.wrapper = wrap;\n wrap.parentWrap = wrap;\n wrap.oneRender = true;\n wrap.parentWrap.original = v;\n renderTagOnly(tagSupport, tagSupport, subject, ownerSupport);\n // call inner function\n // templater.tag = (v as any)() as Tag\n processTag(templater, insertBefore, ownerSupport, subject);\n return;\n }\n break;\n }\n processFirstRegularValue(value, subject, insertBefore);\n}\n","import { ValueSubject } from '../../subject/ValueSubject';\nimport { TemplaterResult } from '../../TemplaterResult.class';\nimport { TagSupport } from '../TagSupport.class';\nimport { ValueTypes, getValueType } from './processFirstSubject.utils';\nexport function processNewValue(value, ownerSupport) {\n const valueType = getValueType(value);\n switch (valueType) {\n case ValueTypes.tagComponent:\n const tagSubject = new ValueSubject(value);\n return tagSubject;\n case ValueTypes.templater:\n const templater = value;\n const tag = templater.tag;\n return processNewTag(tag, ownerSupport);\n case ValueTypes.tag:\n return processNewTag(value, ownerSupport);\n case ValueTypes.subject:\n return value;\n }\n return new ValueSubject(value);\n}\nfunction processNewTag(value, ownerSupport) {\n const tag = value;\n let templater = tag.templater;\n if (!templater) {\n templater = new TemplaterResult([]);\n templater.tag = tag;\n tag.templater = templater;\n }\n const subject = new ValueSubject(templater);\n subject.tagSupport = new TagSupport(templater, ownerSupport, subject);\n return subject;\n}\n","import { castTextValue, updateBeforeTemplate } from '../../updateBeforeTemplate.function';\nexport function processRegularValue(value, subject, // could be tag via subject.tag\ninsertBefore) {\n subject.insertBefore = insertBefore;\n const before = subject.clone || insertBefore; // Either the template is on the doc OR its the first element we last put on doc\n // matches but also was defined at some point\n if (subject.lastValue === value && 'lastValue' in subject) {\n return; // no need to update display, its the same\n }\n subject.lastValue = value;\n const castedValue = castTextValue(value);\n // replace existing string?\n const oldClone = subject.clone;\n if (oldClone) {\n oldClone.textContent = castedValue;\n return;\n }\n // Processing of regular values\n const clone = updateBeforeTemplate(castedValue, before);\n subject.clone = clone; // remember single element put down, for future updates\n}\nexport function processFirstRegularValue(value, subject, // could be tag via subject.tag\ninsertBefore) {\n subject.lastValue = value;\n const castedValue = castTextValue(value);\n // Processing of regular values\n const clone = updateBeforeTemplate(castedValue, insertBefore);\n subject.clone = clone; // remember single element put down, for future updates \n}\n","import { setUse } from '../../state';\nimport { processTagResult } from './processTagResult.function';\nimport { TagSupport } from '../TagSupport.class';\nimport { renderSubjectComponent } from '../render/renderSubjectComponent.function';\nexport function processSubjectComponent(templater, subject, insertBefore, ownerSupport, options) {\n // Check if function component is wrapped in a tag() call\n // TODO: This below check not needed in production mode\n if (templater.tagged !== true) {\n const wrapper = templater.wrapper;\n const original = wrapper.parentWrap.original;\n let name = original.name || original.constructor?.name;\n if (name === 'Function') {\n name = undefined;\n }\n const label = name || original.toString().substring(0, 120);\n const error = new Error(`Not a tag component. Wrap your function with tag(). Example tag(props => html\\`\\`) on component:\\n\\n${label}\\n\\n`);\n throw error;\n }\n const tagSupport = new TagSupport(templater, ownerSupport, subject);\n let reSupport = subject.tagSupport;\n const global = tagSupport.global = reSupport?.global || tagSupport.global;\n global.insertBefore = insertBefore;\n const providers = setUse.memory.providerConfig;\n providers.ownerSupport = ownerSupport;\n const isRender = !reSupport;\n if (isRender) {\n const support = reSupport || tagSupport;\n reSupport = renderSubjectComponent(subject, support, ownerSupport);\n }\n processTagResult(reSupport, subject, // The element set here will be removed from document. Also result.tag will be added in here\n insertBefore, // <template end interpolate /> (will be removed)\n options);\n return reSupport;\n}\n","import { TagSupport } from '../TagSupport.class';\nimport { ValueSubject } from '../../subject';\n/** Could be a regular tag or a component. Both are Tag.class */\nexport function processTag(templater, insertBefore, ownerSupport, // owner\nsubject) {\n let tagSupport = subject.tagSupport;\n // first time seeing this tag?\n if (!tagSupport) {\n tagSupport = newTagSupportByTemplater(templater, ownerSupport, subject);\n }\n subject.tagSupport = tagSupport;\n tagSupport.ownerTagSupport = ownerSupport;\n tagSupport.buildBeforeElement(insertBefore, {\n counts: { added: 0, removed: 0 },\n });\n}\nexport function setupNewTemplater(tagSupport, ownerSupport, subject) {\n tagSupport.global.oldest = tagSupport;\n tagSupport.global.newest = tagSupport;\n // asking me to render will cause my parent to render\n tagSupport.ownerTagSupport = ownerSupport;\n subject.tagSupport = tagSupport;\n}\nexport function tagFakeTemplater(tag) {\n const templater = getFakeTemplater();\n templater.tag = tag;\n tag.templater = templater;\n return templater;\n}\nexport function getFakeTemplater() {\n const fake = {\n children: new ValueSubject([]), // no children\n // props: {} as Props,\n props: [],\n isTag: true,\n isTemplater: false,\n tagged: false,\n madeChildIntoSubject: false,\n html: () => fake\n };\n return fake;\n}\nexport function newTagSupportByTemplater(templater, ownerSupport, subject) {\n const tagSupport = new TagSupport(templater, ownerSupport, subject);\n setupNewTemplater(tagSupport, ownerSupport, subject);\n ownerSupport.childTags.push(tagSupport);\n return tagSupport;\n}\n","import { ValueSubject } from '../../subject/ValueSubject';\nimport { ArrayNoKeyError } from '../../errors';\nimport { destroyArrayTag } from '../checkDestroyPrevious.function';\nimport { setupNewTemplater, tagFakeTemplater } from './processTag.function';\nimport { TagSupport } from '../TagSupport.class';\nimport { isTagClass } from '../../isInstance';\nexport function processTagArray(subject, value, // arry of Tag classes\ninsertBefore, // <template end interpolate />\nownerSupport, options) {\n const clones = ownerSupport.clones; // []\n let lastArray = subject.lastArray = subject.lastArray || [];\n if (!subject.placeholder) {\n setPlaceholderElm(insertBefore, subject);\n }\n const runtimeInsertBefore = subject.placeholder; // || insertBefore\n let removed = 0;\n /** 🗑️ remove previous items first */\n lastArray = subject.lastArray = subject.lastArray.filter((item, index) => {\n const newLength = value.length - 1;\n const at = index - removed;\n const lessLength = newLength < at;\n const subValue = value[index - removed];\n const subTag = subValue;\n // const tag = subTag?.templater.tag as Tag\n const lastTag = item.tagSupport.templater.tag;\n const newArrayValue = subTag?.memory.arrayValue;\n const lastArrayValue = lastTag.memory.arrayValue;\n const destroyItem = lessLength || !areLikeValues(newArrayValue, lastArrayValue);\n if (destroyItem) {\n const last = lastArray[index];\n const tagSupport = last.tagSupport;\n destroyArrayTag(tagSupport, options.counts);\n last.deleted = true;\n ++removed;\n ++options.counts.removed;\n return false;\n }\n return true;\n });\n const length = value.length;\n for (let index = 0; index < length; ++index) {\n const item = value[index];\n const previous = lastArray[index];\n const previousSupport = previous?.tagSupport;\n const subTag = item;\n if (isTagClass(subTag) && !subTag.templater) {\n tagFakeTemplater(subTag);\n }\n const tagSupport = new TagSupport(subTag.templater, ownerSupport, new ValueSubject(undefined));\n if (previousSupport) {\n setupNewTemplater(tagSupport, ownerSupport, previousSupport.subject);\n const global = previousSupport.global;\n tagSupport.global = global;\n global.newest = tagSupport;\n }\n // check for html``.key()\n const keySet = 'arrayValue' in subTag.memory;\n if (!keySet) {\n const details = {\n template: tagSupport.getTemplate().string,\n array: value,\n };\n const message = 'Use html`...`.key(item) instead of html`...` to template an Array';\n console.error(message, details);\n const err = new ArrayNoKeyError(message, details);\n throw err;\n }\n const couldBeSame = lastArray.length > index;\n if (couldBeSame) {\n const prevSupport = previous.tagSupport;\n const prevGlobal = prevSupport.global;\n // subTag.tagSupport = subTag.tagSupport || prevSupport\n const oldest = prevGlobal.oldest;\n oldest.updateBy(tagSupport);\n // return []\n continue;\n }\n processAddTagArrayItem(runtimeInsertBefore, tagSupport, index, options, lastArray);\n ownerSupport.childTags.push(tagSupport);\n }\n return clones;\n}\nfunction setPlaceholderElm(insertBefore, subject) {\n if (insertBefore.nodeName !== 'TEMPLATE') {\n subject.placeholder = insertBefore;\n return;\n }\n const placeholder = subject.placeholder = document.createTextNode('');\n const parentNode = insertBefore.parentNode;\n parentNode.insertBefore(placeholder, insertBefore);\n parentNode.removeChild(insertBefore);\n}\nfunction processAddTagArrayItem(before, tagSupport, index, options, lastArray) {\n const lastValue = {\n tagSupport, index\n };\n // Added to previous array\n lastArray.push(lastValue);\n const counts = {\n added: options.counts.added + index,\n removed: options.counts.removed,\n };\n const fragment = document.createDocumentFragment();\n const newTempElm = document.createElement('template');\n fragment.appendChild(newTempElm);\n tagSupport.buildBeforeElement(newTempElm, // before,\n { counts });\n const parent = before.parentNode;\n parent.insertBefore(fragment, before);\n}\n/** compare two values. If both values are arrays then the items will be compared */\nfunction areLikeValues(valueA, valueB) {\n if (valueA === valueB) {\n return true;\n }\n const bothArrays = valueA instanceof Array && valueB instanceof Array;\n const matchLengths = bothArrays && valueA.length == valueB.length;\n if (matchLengths) {\n return valueA.every((item, index) => item == valueB[index]);\n }\n return false;\n}\n","export function processTagResult(tagSupport, subject, // used for recording past and current value\ninsertBefore, // <template end interpolate />\n{ counts, }) {\n // *if appears we already have seen\n const subjectTag = subject;\n const lastSupport = subjectTag.tagSupport;\n const prevSupport = lastSupport?.global.oldest || undefined;\n const justUpdate = prevSupport;\n if (prevSupport && justUpdate) {\n return processTagResultUpdate(tagSupport, subjectTag, prevSupport);\n }\n tagSupport.buildBeforeElement(insertBefore, {\n counts,\n });\n}\nfunction processTagResultUpdate(tagSupport, subject, // used for recording past and current value\nprevSupport) {\n // components\n if (subject instanceof Function) {\n const newSupport = subject(prevSupport);\n prevSupport.updateBy(newSupport);\n subject.tagSupport = newSupport;\n return;\n }\n prevSupport.updateBy(tagSupport);\n subject.tagSupport = tagSupport;\n return;\n}\n","import { isSubjectInstance, isTagComponent } from '../../isInstance';\nimport { TagSupport } from '../TagSupport.class';\nexport function updateContextItem(context, variableName, value) {\n const subject = context[variableName];\n const tagSubject = subject;\n const tagSupport = tagSubject.tagSupport;\n if (tagSupport) {\n if (value) {\n if (isTagComponent(value)) {\n const templater = value;\n let newSupport = new TagSupport(templater, tagSupport.ownerTagSupport, subject);\n if (isTagComponent(tagSupport)) {\n shareTemplaterGlobal(tagSupport, newSupport);\n }\n }\n }\n }\n if (isSubjectInstance(value)) {\n return; // emits on its own\n }\n // listeners will evaluate updated values to possibly update display(s)\n subject.set(value);\n return;\n}\nfunction shareTemplaterGlobal(oldTagSupport, tagSupport) {\n const oldTemp = oldTagSupport.templater;\n const oldWrap = oldTemp.wrapper; // tag versus component\n const oldValueFn = oldWrap.parentWrap.original;\n const templater = tagSupport.templater;\n const newWrapper = templater.wrapper;\n const newValueFn = newWrapper?.parentWrap.original;\n const fnMatched = oldValueFn === newValueFn;\n if (fnMatched) {\n tagSupport.global = oldTagSupport.global;\n const newest = oldTagSupport.global.newest;\n if (newest) {\n const prevState = newest.memory.state;\n tagSupport.memory.state.length = 0;\n tagSupport.memory.state.push(...prevState);\n // tagSupport.memory.state = [...prevState]\n }\n }\n}\n","import { hasTagSupportChanged } from '../hasTagSupportChanged.function';\nimport { processSubjectComponent } from './processSubjectComponent.function';\nimport { destroyTagMemory } from '../destroyTag.function';\nimport { renderTagSupport } from '../render/renderTagSupport.function';\nimport { callbackPropOwner } from '../../alterProps.function';\nimport { isLikeTags } from '../isLikeTags.function';\nexport function updateExistingTagComponent(ownerSupport, tagSupport, // lastest\nsubject, insertBefore) {\n let lastSupport = subject.tagSupport?.global.newest; // || subject.tagSupport\n let oldestTag = lastSupport.global.oldest;\n const oldWrapper = lastSupport.templater.wrapper;\n const newWrapper = tagSupport.templater.wrapper;\n let isSameTag = false;\n if (oldWrapper && newWrapper) {\n const oldFunction = oldWrapper.parentWrap.original;\n const newFunction = newWrapper.parentWrap.original;\n // string compare both functions\n isSameTag = oldFunction === newFunction;\n }\n const templater = tagSupport.templater;\n if (!isSameTag) {\n const oldestSupport = lastSupport.global.oldest;\n destroyTagMemory(oldestSupport);\n return processSubjectComponent(templater, subject, insertBefore, ownerSupport, {\n counts: { added: 0, removed: 0 },\n });\n }\n else {\n const hasChanged = hasTagSupportChanged(lastSupport, tagSupport, templater);\n if (!hasChanged) {\n // if the new props are an object then implicitly since no change, the old props are an object\n const newProps = templater.props;\n syncFunctionProps(lastSupport, ownerSupport, newProps);\n return lastSupport; // its the same tag component\n }\n }\n const previous = lastSupport.global.newest;\n const newSupport = renderTagSupport(tagSupport, false);\n lastSupport = subject.tagSupport;\n const newOldest = newSupport.global.oldest;\n const hasOldest = newOldest ? true : false;\n if (!hasOldest) {\n return buildNewTag(newSupport, insertBefore, lastSupport, subject);\n }\n if (newOldest && templater.children.value.length) {\n const oldKidsSub = newOldest.templater.children;\n oldKidsSub.set(templater.children.value);\n }\n // detect if both the function is the same and the return is the same\n const isLikeTag = isSameTag && isLikeTags(previous, newSupport);\n if (isLikeTag) {\n subject.tagSupport = newSupport;\n oldestTag.updateBy(newSupport); // the oldest tag has element references\n return newSupport;\n }\n else {\n // Although function looked the same it returned a different html result\n if (isSameTag && lastSupport) {\n destroyTagMemory(lastSupport);\n newSupport.global.context = {}; // do not share previous outputs\n }\n oldestTag = undefined;\n }\n if (!oldestTag) {\n lastSupport = newSupport;\n buildNewTag(newSupport, lastSupport.global.insertBefore, lastSupport, subject);\n }\n lastSupport.global.newest = newSupport;\n return newSupport;\n}\nfunction buildNewTag(newSupport, oldInsertBefore, oldTagSupport, subject) {\n newSupport.buildBeforeElement(oldInsertBefore, {\n counts: { added: 0, removed: 0 },\n });\n newSupport.global.oldest = newSupport;\n newSupport.global.newest = newSupport;\n oldTagSupport.global.oldest = newSupport;\n oldTagSupport.global.newest = newSupport;\n subject.tagSupport = newSupport;\n return newSupport;\n}\nfunction syncFunctionProps(lastSupport, ownerSupport, newPropsArray) {\n lastSupport = lastSupport.global.newest || lastSupport;\n const priorPropConfig = lastSupport.propsConfig;\n const priorPropsArray = priorPropConfig.latestCloned;\n const prevSupport = ownerSupport.global.newest;\n for (let index = newPropsArray.length - 1; index >= 0; --index) {\n const argPosition = newPropsArray[index];\n if (typeof (argPosition) !== 'object') {\n return;\n }\n const priorProps = priorPropsArray[index];\n if (typeof (priorProps) !== 'object') {\n return;\n }\n for (const name in argPosition) {\n const value = argPosition[name];\n if (!(value instanceof Function)) {\n continue;\n }\n const newCallback = argPosition[name]; // || value\n const original = newCallback instanceof Function && newCallback.toCall;\n if (original) {\n continue; // already previously converted\n }\n // Currently, call self but over parent state changes, I may need to call a newer parent tag owner\n priorProps[name].toCall = (...args) => {\n return callbackPropOwner(newCallback, // value, // newOriginal,\n args, prevSupport);\n };\n }\n }\n}\n","import { TagSupport } from '../TagSupport.class';\nimport { TemplaterResult } from '../../TemplaterResult.class';\nimport { isTagClass, isTagTemplater } from '../../isInstance';\nimport { ValueTypes, getValueType } from './processFirstSubject.utils';\nimport { processTagArray } from './processTagArray';\nimport { updateExistingTagComponent } from './updateExistingTagComponent.function';\nimport { processRegularValue } from './processRegularValue.function';\nimport { checkDestroyPrevious, restoreTagMarker } from '../checkDestroyPrevious.function';\nimport { processSubjectComponent } from './processSubjectComponent.function';\nimport { isLikeTags } from '../isLikeTags.function';\nimport { setupNewTemplater, getFakeTemplater, processTag } from './processTag.function';\nimport { swapInsertBefore } from '../setTagPlaceholder.function';\nexport function updateExistingValue(subject, value, ownerSupport, insertBefore) {\n const subjectTag = subject;\n const valueType = getValueType(value);\n checkDestroyPrevious(subject, value, insertBefore);\n // handle already seen tag components\n if (valueType === ValueTypes.tagComponent) {\n return prepareUpdateToComponent(value, subjectTag, insertBefore, ownerSupport);\n }\n // was component but no longer\n const tagSupport = subjectTag.tagSupport;\n if (tagSupport) {\n if (valueType === ValueTypes.function) {\n return subjectTag; // its a oneRender tag\n }\n handleStillTag(subject, value, ownerSupport);\n return subjectTag;\n }\n switch (valueType) {\n case ValueTypes.tagArray:\n processTagArray(subject, value, insertBefore, // oldInsertBefore as InsertBefore,\n ownerSupport, { counts: {\n added: 0,\n removed: 0,\n } });\n return subject;\n case ValueTypes.templater:\n processTag(value, insertBefore, ownerSupport, subjectTag);\n return subjectTag;\n case ValueTypes.tag:\n const tag = value;\n let templater = tag.templater;\n if (!templater) {\n templater = getFakeTemplater();\n tag.templater = templater;\n templater.tag = tag;\n }\n processTag(templater, insertBefore, ownerSupport, subjectTag);\n return subjectTag;\n case ValueTypes.subject:\n return value;\n // now its a useless function (we don't automatically call functions)\n case ValueTypes.function:\n // const bound = bindSubjectCallback(value as Callback, ownerSupport)\n // subject.set(bound)\n if (!subject.clone) {\n subject.clone = swapInsertBefore(insertBefore);\n }\n return subject;\n }\n // This will cause all other values to render\n processRegularValue(value, subject, insertBefore);\n return subjectTag;\n}\nfunction handleStillTag(subject, value, ownerSupport) {\n const lastSupport = subject.tagSupport;\n let templater = value;\n const isClass = isTagClass(value);\n if (isClass) {\n const tag = value;\n templater = tag.templater;\n if (!templater) {\n templater = new TemplaterResult([]);\n templater.tag = tag;\n tag.templater = templater;\n }\n }\n const valueSupport = new TagSupport(templater, ownerSupport, subject);\n if (isClass) {\n valueSupport.global = lastSupport.global;\n }\n const isSameTag = value && isLikeTags(lastSupport, valueSupport);\n if (isTagTemplater(value)) {\n setupNewTemplater(valueSupport, ownerSupport, subject);\n }\n if (isSameTag) {\n lastSupport.updateBy(valueSupport);\n return;\n }\n if (isSameTag) {\n // const subjectTag = subject as TagSubject\n const global = lastSupport.global;\n const insertBefore = global.insertBefore;\n return processTag(templater, insertBefore, ownerSupport, subject);\n }\n return processRegularValue(value, subject, subject.insertBefore);\n}\nfunction prepareUpdateToComponent(templater, subjectTag, insertBefore, ownerSupport) {\n // When last value was not a component\n if (!subjectTag.tagSupport) {\n processSubjectComponent(templater, subjectTag, insertBefore, // oldInsertBefore as InsertBefore,\n ownerSupport, {\n counts: { added: 0, removed: 0 },\n });\n return subjectTag;\n }\n const tagSupport = new TagSupport(templater, ownerSupport, subjectTag);\n const subjectSup = subjectTag.tagSupport;\n const prevSupport = subjectSup.global.newest;\n if (prevSupport) {\n const newestState = prevSupport.memory.state;\n tagSupport.memory.state.length = 0;\n tagSupport.memory.state.push(...newestState);\n }\n else {\n restoreTagMarker(subjectSup);\n processSubjectComponent(templater, subjectTag, insertBefore, ownerSupport, {\n counts: { added: 0, removed: 0 },\n });\n return subjectTag;\n }\n tagSupport.global = subjectSup.global;\n subjectTag.tagSupport = tagSupport;\n updateExistingTagComponent(ownerSupport, tagSupport, // latest value\n subjectTag, insertBefore);\n return subjectTag;\n}\n","// Function to update the value of x\nexport function updateBeforeTemplate(value, // value should be casted before calling here\nlastFirstChild) {\n const parent = lastFirstChild.parentNode;\n // Insert the new value (never use innerHTML here)\n const textNode = document.createTextNode(value); // never innerHTML\n parent.insertBefore(textNode, lastFirstChild);\n /* remove existing nodes */\n parent.removeChild(lastFirstChild);\n return textNode;\n}\nexport function castTextValue(value) {\n // mimic React skipping to display EXCEPT for true does display on page\n if ([undefined, false, null].includes(value)) { // || value === true\n return '';\n }\n return value;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from \"./tag/tag\";\nexport * from \"./tag/tag.utils\";\nexport * from \"./tag/html\";\nexport * from \"./errors\";\nexport * from \"./isInstance\";\nexport * from \"./state/index\";\nexport * from \"./subject/index\";\nexport * from \"./tag/TagSupport.class\";\nexport * from \"./interpolations/ElementTargetEvent.interface\";\nexport * from \"./interpolations/interpolateElement\";\nexport { tagElement } from \"./tag/tagElement\";\nexport { Tag } from \"./tag/Tag.class\";\nexport { runBeforeRender } from \"./tag/tagRunner\";\nexport { renderTagSupport } from \"./tag/render/renderTagSupport.function\";\nexport { renderWithSupport } from \"./tag/render/renderWithSupport.function\";\nexport { isLikeValueSets } from \"./tag/isLikeTags.function\";\nimport { renderTagOnly } from \"./tag/render/renderTagOnly.function\";\nimport { renderTagSupport } from \"./tag/render/renderTagSupport.function\";\nimport { renderWithSupport } from \"./tag/render/renderWithSupport.function\";\nimport { tagElement } from \"./tag/tagElement\";\nexport const hmr = {\n tagElement, renderWithSupport, renderTagSupport,\n renderTagOnly,\n};\n"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"bundle.js","mappings":"AACA,ICDWA,EDCPC,EAAsB,CEA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,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xBnQ,EAAWod,OAAQ,EACnBpd,EAAWmD,OAAOia,OAAQ,EAC1B,MAAMyD,EAAc7Q,SAASwF,cAAc,YAC3CqL,EAAYtO,aAAa,KAAM,WAAaiO,GAAYpkB,QACxDykB,EAAYtO,aAAa,iBAAkBiO,GAAYpkB,OAAOwF,YAC9D,MAAMyT,EAAWrF,SAASsF,yBAc1B,OAbAD,EAASI,YAAYoL,GACrB1Q,EAAQ7G,QAAU4V,gBACRlf,EAAWsJ,UACjB,MAAMmB,EAAezK,EAAWmD,OAAOsH,aACpBA,EAAagE,WACrBO,YAAYvE,EAAa,EAExCzK,EAAWkT,mBAAmB2N,GAC9B7gB,EAAWmD,OAAOkG,OAASrJ,EAC3BA,EAAWmD,OAAOC,OAASpD,EAC3BmQ,EAAQtQ,OAASwgB,EAAI/d,SAASzC,OAC9B2gB,GAAYriB,KAAK,CAAEgS,UAASnQ,eAC5BmQ,EAAQsF,YAAYJ,GACb,CACHrV,aACAgO,KAAMqS,EAAI/d,SAAS0L,KAE3B,CC/BO,MAAM8S,GAAM,CACfL,WAAU,qBAAmB,mBAAkB,GAC/C5W,cAAa,G","sources":["webpack://taggedjs/webpack/bootstrap","webpack://taggedjs/./ts/tag/ValueTypes.enum.ts","webpack://taggedjs/webpack/runtime/define property getters","webpack://taggedjs/webpack/runtime/hasOwnProperty shorthand","webpack://taggedjs/./ts/tag/tag.types.ts","webpack://taggedjs/./ts/isInstance.ts","webpack://taggedjs/./ts/subject/combineLatest.function.ts","webpack://taggedjs/./ts/subject/subject.utils.ts","webpack://taggedjs/./ts/subject/Subject.class.ts","webpack://taggedjs/./ts/subject/ValueSubject.ts","webpack://taggedjs/./ts/subject/will.functions.ts","webpack://taggedjs/./ts/tag/getSupportInCycle.function.ts","webpack://taggedjs/./ts/state/setUse.function.ts","webpack://taggedjs/./ts/errors.ts","webpack://taggedjs/./ts/state/state.utils.ts","webpack://taggedjs/./ts/state/syncStates.function.ts","webpack://taggedjs/./ts/state/state.function.ts","webpack://taggedjs/./ts/state/watch.function.ts","webpack://taggedjs/./ts/state/subject.function.ts","webpack://taggedjs/./ts/state/letState.function.ts","webpack://taggedjs/./ts/state/letProp.function.ts","webpack://taggedjs/./ts/deepFunctions.ts","webpack://taggedjs/./ts/state/providers.ts","webpack://taggedjs/./ts/state/provider.utils.ts","webpack://taggedjs/./ts/tag/isLikeTags.function.ts","webpack://taggedjs/./ts/tag/destroyTag.function.ts","webpack://taggedjs/./ts/tag/tagRunner.ts","webpack://taggedjs/./ts/tag/render/renderTagOnly.function.ts","webpack://taggedjs/./ts/tag/render/renderWithSupport.function.ts","webpack://taggedjs/./ts/tag/render/renderExistingTag.function.ts","webpack://taggedjs/./ts/tag/render/renderTagSupport.function.ts","webpack://taggedjs/./ts/state/callbackMaker.function.ts","webpack://taggedjs/./ts/state/onInit.ts","webpack://taggedjs/./ts/state/onDestroy.ts","webpack://taggedjs/./ts/state/children.ts","webpack://taggedjs/./ts/tag/Tag.class.ts","webpack://taggedjs/./ts/tag/TemplaterResult.class.ts","webpack://taggedjs/./ts/tag/kidsToTagArraySubject.function.ts","webpack://taggedjs/./ts/tag/tag.utils.ts","webpack://taggedjs/./ts/interpolations/bindSubjectCallback.function.ts","webpack://taggedjs/./ts/insertAfter.function.ts","webpack://taggedjs/./ts/tag/checkDestroyPrevious.function.ts","webpack://taggedjs/./ts/tag/update/processFirstSubject.utils.ts","webpack://taggedjs/./ts/tag/cloneValueArray.function.ts","webpack://taggedjs/./ts/tag/destroy.support.ts","webpack://taggedjs/./ts/tag/update/processNewValue.function.ts","webpack://taggedjs/./ts/tag/setTagPlaceholder.function.ts","webpack://taggedjs/./ts/interpolations/inputAttribute.ts","webpack://taggedjs/./ts/interpolations/processAttribute.function.ts","webpack://taggedjs/./ts/interpolations/interpolateAttributes.ts","webpack://taggedjs/./ts/interpolations/interpolations.ts","webpack://taggedjs/./ts/tag/update/processTagResult.function.ts","webpack://taggedjs/./ts/tag/update/processSubjectComponent.function.ts","webpack://taggedjs/./ts/tag/render/renderSubjectComponent.function.ts","webpack://taggedjs/./ts/tag/update/processTag.function.ts","webpack://taggedjs/./ts/tag/update/processTagArray.ts","webpack://taggedjs/./ts/updateBeforeTemplate.function.ts","webpack://taggedjs/./ts/tag/update/processRegularValue.function.ts","webpack://taggedjs/./ts/tag/update/processFirstSubjectValue.function.ts","webpack://taggedjs/./ts/interpolations/scanTextAreaValue.function.ts","webpack://taggedjs/./ts/tag/hasPropChanges.function.ts","webpack://taggedjs/./ts/tag/hasTagSupportChanged.function.ts","webpack://taggedjs/./ts/alterProps.function.ts","webpack://taggedjs/./ts/tag/update/updateExistingTagComponent.function.ts","webpack://taggedjs/./ts/tag/update/updateExistingValue.function.ts","webpack://taggedjs/./ts/interpolations/interpolateTemplate.ts","webpack://taggedjs/./ts/interpolations/elementInitCheck.ts","webpack://taggedjs/./ts/interpolations/interpolateContentTemplates.ts","webpack://taggedjs/./ts/interpolations/interpolateElement.ts","webpack://taggedjs/./ts/interpolations/afterInterpolateElement.function.ts","webpack://taggedjs/./ts/render.ts","webpack://taggedjs/./ts/tag/TagSupport.class.ts","webpack://taggedjs/./ts/tag/update/updateContextItem.function.ts","webpack://taggedjs/./ts/tag/elementDestroyCheck.function.ts","webpack://taggedjs/./ts/tag/tag.ts","webpack://taggedjs/./ts/tag/getTagWrap.function.ts","webpack://taggedjs/./ts/tag/html.ts","webpack://taggedjs/./ts/tag/tagElement.ts","webpack://taggedjs/./ts/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","export var ValueTypes;\n(function (ValueTypes) {\n ValueTypes[\"unknown\"] = \"unknown\";\n ValueTypes[\"tag\"] = \"tag\";\n ValueTypes[\"templater\"] = \"templater\";\n ValueTypes[\"tagComponent\"] = \"tag-component\";\n ValueTypes[\"tagArray\"] = \"tag-array\";\n ValueTypes[\"subject\"] = \"subject\";\n ValueTypes[\"date\"] = \"date\";\n ValueTypes[\"string\"] = \"string\";\n ValueTypes[\"boolean\"] = \"boolean\";\n ValueTypes[\"function\"] = \"function\";\n ValueTypes[\"undefined\"] = \"undefined\";\n})(ValueTypes || (ValueTypes = {}));\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","export class RouteQuery {\n get(name) {\n return 'todo';\n }\n}\n","import { ValueTypes } from './tag/ValueTypes.enum.js';\nexport function isStaticTag(value) {\n return [\n ValueTypes.tag,\n ValueTypes.templater,\n ].includes(value?.tagJsType);\n}\nexport function isTagTemplater(value) {\n return value?.tagJsType === ValueTypes.templater;\n}\n// TODO: whats the difference between isTagClass and isTagComponent\nexport function isTagComponent(value) {\n return value?.tagJsType === ValueTypes.tagComponent;\n}\nexport function isTagClass(value) {\n return value?.tagJsType === ValueTypes.tag;\n}\n// isSubjectLike\nexport function isSubjectInstance(subject) {\n return (subject?.isSubject === true || subject?.subscribe) ? true : false; // subject?.isSubject === true || \n}\nexport function isTagArray(value) {\n return value instanceof Array && value.every(x => [\n ValueTypes.tag, ValueTypes.templater, ValueTypes.tag, ValueTypes.tagComponent\n ].includes(x?.tagJsType));\n}\n","import { Subject } from './Subject.class.js';\nexport function combineLatest(subjects) {\n const output = new Subject();\n const subscribe = (callback) => {\n const valuesSeen = [];\n const values = [];\n const setValue = (x, index) => {\n valuesSeen[index] = true;\n values[index] = x;\n const countMatched = valuesSeen.length === subjects.length;\n if (!countMatched) {\n return;\n }\n for (let index = valuesSeen.length - 1; index >= 0; --index) {\n if (!valuesSeen[index]) {\n return;\n }\n }\n // everyone has reported values\n callback(values, subscription);\n };\n const clones = [...subjects];\n const firstSub = clones.shift();\n const subscription = firstSub.subscribe(x => setValue(x, 0));\n const subscriptions = clones.map((subject, index) => subject.subscribe(x => setValue(x, index + 1)));\n subscription.subscriptions = subscriptions;\n return subscription;\n };\n output.subscribeWith = subscribe;\n return output;\n}\n","import { Subject } from './Subject.class.js';\nfunction removeSubFromArray(subscribers, callback) {\n const index = subscribers.findIndex(sub => sub.callback === callback);\n if (index !== -1) {\n subscribers.splice(index, 1);\n }\n}\nexport function getSubscription(subject, callback, subscribers) {\n const countSubject = Subject.globalSubCount$;\n Subject.globalSubCount$.next(countSubject._value + 1);\n const subscription = () => {\n subscription.unsubscribe();\n };\n subscription.callback = callback;\n subscription.subscriptions = [];\n // Return a function to unsubscribe from the BehaviorSubject\n subscription.unsubscribe = () => {\n removeSubFromArray(subscribers, callback); // each will be called when update comes in\n // removeSubFromArray(Subject.globalSubs, callback) // 🔬 testing\n Subject.globalSubCount$.next(countSubject._value - 1);\n // any double unsubscribes will be ignored\n subscription.unsubscribe = () => subscription;\n // unsubscribe from any combined subjects\n const subscriptions = subscription.subscriptions;\n for (let index = subscriptions.length - 1; index >= 0; --index) {\n subscriptions[index].unsubscribe();\n }\n return subscription;\n };\n subscription.add = (sub) => {\n subscription.subscriptions.push(sub);\n return subscription;\n };\n subscription.next = (value) => {\n callback(value, subscription);\n };\n return subscription;\n}\nexport function runPipedMethods(value, methods, onComplete) {\n const cloneMethods = [...methods];\n const firstMethod = cloneMethods.shift();\n const next = (newValue) => {\n if (cloneMethods.length) {\n return runPipedMethods(newValue, cloneMethods, onComplete);\n }\n onComplete(newValue);\n };\n let handler = next;\n const setHandler = (x) => handler = x;\n const pipeUtils = { setHandler, next };\n const methodResponse = firstMethod(value, pipeUtils);\n handler(methodResponse);\n}\n","import { isSubjectInstance } from '../isInstance.js';\nimport { combineLatest } from './combineLatest.function.js';\nimport { getSubscription, runPipedMethods } from './subject.utils.js';\nexport class Subject {\n value;\n onSubscription;\n // private?\n methods = [];\n isSubject = true;\n // private?\n subscribers = [];\n subscribeWith;\n _value;\n // this is overwritten by constructor at runtime. However having it helps editors know of its existence\n set; // `subject.set = x` equal to `subject.next(x)`\n constructor(value, \n // private?\n onSubscription) {\n this.value = value;\n this.onSubscription = onSubscription;\n this._value = value;\n defineValueOn(this);\n }\n subscribe(callback) {\n const subscription = getSubscription(this, callback, this.subscribers);\n // are we within a pipe?\n const subscribeWith = this.subscribeWith;\n if (subscribeWith) {\n // are we in a pipe?\n if (this.methods.length) {\n const orgCallback = callback;\n callback = (value) => {\n runPipedMethods(value, this.methods, lastValue => orgCallback(lastValue, subscription));\n };\n }\n return subscribeWith(callback);\n }\n this.subscribers.push(subscription);\n // Subject.globalSubs.push(subscription) // 🔬 testing\n const count = Subject.globalSubCount$.value;\n Subject.globalSubCount$.next(count + 1); // 🔬 testing\n if (this.onSubscription) {\n this.onSubscription(subscription);\n }\n return subscription;\n }\n next(value) {\n this._value = value;\n this.emit();\n }\n emit() {\n const value = this._value;\n // Notify all subscribers with the new value\n const subs = [...this.subscribers]; // subs may change as we call callbacks\n const length = subs.length;\n for (let index = 0; index < length; ++index) {\n const sub = subs[index];\n sub.callback(value, sub);\n }\n }\n toPromise() {\n return new Promise(res => {\n this.subscribe((x, subscription) => {\n subscription.unsubscribe();\n res(x);\n });\n });\n }\n /** like toPromise but faster */\n toCallback(callback) {\n this.subscribe((x, subscription) => {\n subscription.unsubscribe();\n callback(x);\n });\n return this;\n }\n pipe(...operations) {\n const subject = new Subject(this._value);\n subject.setMethods(operations);\n subject.subscribeWith = (x) => this.subscribe(x);\n subject.next = x => this.next(x);\n return subject;\n }\n setMethods(operations) {\n this.methods = operations;\n }\n static all(args) {\n const switched = args.map(arg => {\n if (isSubjectInstance(arg))\n return arg;\n // Call the callback immediately with the current value\n const x = new Subject(arg, subscription => {\n subscription.next(arg);\n return subscription;\n });\n return x;\n });\n return combineLatest(switched);\n }\n static globalSubCount$ = new Subject(0); // for ease of debugging\n}\nexport function defineValueOn(subject) {\n Object.defineProperty(subject, 'value', {\n // supports subject.value = x\n set(value) {\n subject._value = value;\n subject.emit();\n },\n // supports subject.value\n get() {\n return subject._value;\n }\n });\n Object.defineProperty(subject, 'set', {\n // supports subject.set = x\n set: (value) => subject.next(value),\n // supports subject.set(x)\n get: () => (x) => subject.next(x),\n });\n}\n","import { Subject, defineValueOn } from './Subject.class.js';\nexport class ValueSubject extends Subject {\n value;\n constructor(value) {\n super(value);\n this.value = value;\n defineValueOn(this);\n }\n subscribe(callback) {\n const subscription = super.subscribe(callback);\n // Call the callback immediately with the current value\n callback(this._value, subscription);\n return subscription;\n }\n}\n","export function willCallback(callback) {\n return ((lastValue, utils) => {\n utils.setHandler(() => {\n return undefined;\n });\n callback(lastValue, utils.next);\n });\n}\n/** .pipe( promise((x) => Promise.resolve(44)) ) */\nexport function willPromise(callback) {\n return ((lastValue, utils) => {\n utils.setHandler(() => {\n return undefined;\n }); // do nothing on initial return\n const result = callback(lastValue);\n result.then(x => utils.next(x));\n });\n}\n/** .pipe( willSubscribe((x) => new ValueSubject(44)) ) */\nexport const willSubscribe = (callback) => {\n return ((lastValue, utils) => {\n utils.setHandler(() => {\n return undefined;\n }); // do nothing on initial return\n const result = callback(lastValue);\n const subscription = result.subscribe(x => {\n subscription.unsubscribe();\n utils.next(x);\n });\n });\n};\n","import { setUse } from '../state/index.js';\nexport function getSupportInCycle() {\n return setUse.memory.stateConfig.tagSupport;\n}\n","const tagUse = [];\nexport function setUse(use) {\n // must provide defaults\n const useMe = {\n beforeRender: use.beforeRender || (() => undefined),\n beforeRedraw: use.beforeRedraw || (() => undefined),\n afterRender: use.afterRender || (() => undefined),\n beforeDestroy: use.beforeDestroy || (() => undefined),\n };\n setUse.tagUse.push(useMe);\n}\nsetUse.tagUse = tagUse;\nsetUse.memory = {};\n","export class TagError extends Error {\n details;\n constructor(message, errorCode, details = {}) {\n super(message);\n this.name = TagError.name;\n this.details = { ...details, errorCode };\n }\n}\nexport class ArrayNoKeyError extends TagError {\n constructor(message, details) {\n super(message, 'array-no-key-error', details);\n this.name = ArrayNoKeyError.name;\n }\n}\nexport class StateMismatchError extends TagError {\n constructor(message, details) {\n super(message, 'state-mismatch-error', details);\n this.name = StateMismatchError.name;\n }\n}\nexport class SyncCallbackError extends TagError {\n constructor(message, details) {\n super(message, 'sync-callback-error', details);\n this.name = SyncCallbackError.name;\n }\n}\n","import { StateMismatchError } from '../errors.js';\nimport { setUse } from './setUse.function.js';\nsetUse.memory.stateConfig = {\n array: [], // state memory on the first render\n // rearray: [] as State,\n};\nconst beforeRender = (tagSupport) => initState(tagSupport);\nsetUse({\n beforeRender,\n beforeRedraw: beforeRender,\n afterRender: (tagSupport) => {\n const memory = tagSupport.memory;\n const config = setUse.memory.stateConfig;\n const rearray = config.rearray;\n if (rearray.length) {\n if (rearray.length !== config.array.length) {\n const message = `States lengths have changed ${rearray.length} !== ${config.array.length}. State tracking requires the same amount of function calls every render. Typically this errors is thrown when a state like function call occurs only for certain conditions or when a function is intended to be wrapped with a tag() call`;\n const wrapper = tagSupport.templater?.wrapper;\n const details = {\n oldStates: config.array,\n newStates: config.rearray,\n tagFunction: wrapper.parentWrap.original,\n };\n const error = new StateMismatchError(message, details);\n console.warn(message, details);\n throw error;\n }\n }\n delete config.rearray; // clean up any previous runs\n delete config.tagSupport;\n memory.state.length = 0;\n memory.state.push(...config.array);\n const state = memory.state;\n for (let index = state.length - 1; index >= 0; --index) {\n const item = state[index];\n item.lastValue = getStateValue(item); // set last values\n }\n config.array = [];\n }\n});\nexport function getStateValue(state) {\n const callback = state.callback;\n if (!callback) {\n return state.defaultValue;\n }\n const [value, checkValue] = getCallbackValue(callback);\n if (checkValue !== StateEchoBack) {\n const message = 'State property not used correctly. Second item in array is not setting value as expected.\\n\\n' +\n 'For \"let\" state use `let name = state(default)(x => [name, name = x])`\\n\\n' +\n 'For \"const\" state use `const name = state(default)()`\\n\\n' +\n 'Problem state:\\n' + (callback ? callback.toString() : JSON.stringify(state)) + '\\n';\n console.error(message, { state, callback, value, checkValue });\n throw new Error(message);\n }\n return value;\n}\nexport class StateEchoBack {\n}\nfunction initState(tagSupport) {\n const memory = tagSupport.memory;\n const state = memory.state;\n const config = setUse.memory.stateConfig;\n // TODO: The following two blocks of code are state protects, have a production mode that removes this checks\n /*\n if (config.rearray) {\n checkStateMismatch(tagSupport, config, state)\n }\n */\n config.rearray = [];\n const stateLength = state?.length;\n if (stateLength) {\n for (let index = 0; index < stateLength; ++index) {\n getStateValue(state[index]);\n }\n config.rearray.push(...state);\n }\n config.tagSupport = tagSupport;\n}\n/*\nfunction checkStateMismatch(\n tagSupport: BaseTagSupport,\n config: Config,\n state: State,\n) {\n const wrapper = tagSupport.templater?.wrapper as Wrapper\n const wasWrapper = config.tagSupport?.templater.wrapper as Wrapper\n const message = 'last state not cleared. Possibly in the middle of rendering one component and another is trying to render'\n\n if(!wasWrapper) {\n return // its not a component or was not a component before\n }\n\n console.error(message, {\n config,\n tagFunction: wrapper.parentWrap.original,\n wasInMiddleOf: wasWrapper.parentWrap.original,\n state,\n expectedClearArray: config.rearray,\n })\n\n throw new StateMismatchError(message, {\n config,\n tagFunction: wrapper.parentWrap.original,\n state,\n expectedClearArray: config.rearray,\n })\n}\n*/\nexport function getCallbackValue(callback) {\n const oldState = callback(StateEchoBack); // get value and set to undefined\n const [value] = oldState;\n const [checkValue] = callback(value); // set back to original value\n return [value, checkValue];\n}\n","export function syncStates(stateFrom, stateTo) {\n for (let index = stateFrom.length - 1; index >= 0; --index) {\n const state = stateFrom[index];\n const fromValue = state.get();\n const callback = stateTo[index].callback;\n if (callback) {\n callback(fromValue); // set the value\n }\n stateTo[index].lastValue = fromValue; // record the value\n }\n}\n","import { setUse } from './setUse.function.js';\nimport { getStateValue } from './state.utils.js';\nimport { syncStates } from './syncStates.function.js';\n/** Used for variables that need to remain the same variable during render passes */\nexport function state(defaultValue) {\n const config = setUse.memory.stateConfig;\n let getSetMethod;\n const rearray = config.rearray;\n const restate = rearray[config.array.length];\n if (restate) {\n let oldValue = getStateValue(restate);\n getSetMethod = ((x) => [oldValue, oldValue = x]);\n const push = {\n get: () => getStateValue(push),\n callback: getSetMethod,\n lastValue: oldValue,\n defaultValue: restate.defaultValue,\n };\n config.array.push(push);\n return oldValue;\n }\n // State first time run\n const defaultFn = defaultValue instanceof Function ? defaultValue : () => defaultValue;\n let initValue = defaultFn();\n // the state is actually intended to be a function\n if (initValue instanceof Function) {\n const oldState = config.array;\n const tagSupport = config.tagSupport;\n const original = initValue;\n initValue = ((...args) => {\n const global = tagSupport.global;\n const newest = global.newest;\n const newState = newest.memory.state;\n syncStates(newState, oldState);\n const result = original(...args);\n syncStates(oldState, newState);\n return result;\n });\n initValue.original = original;\n }\n getSetMethod = ((x) => [initValue, initValue = x]);\n const push = {\n get: () => getStateValue(push),\n callback: getSetMethod,\n lastValue: initValue,\n defaultValue: initValue,\n };\n config.array.push(push);\n return initValue;\n}\n","import { ValueSubject } from '../subject/index.js';\nimport { getSupportInCycle } from '../tag/getSupportInCycle.function.js';\nimport { setUse } from './setUse.function.js';\nimport { state } from './state.function.js';\nimport { syncStates } from './syncStates.function.js';\n/**\n * When an item in watch array changes, callback function will be triggered. Triggers on initial watch setup. TIP: try watch.noInit()\n * @param currentValues T[]\n * @param callback WatchCallback\n * @returns T[]\n */\nexport const watch = ((currentValues, callback) => {\n return setupWatch(currentValues, callback);\n});\nconst defaultFinally = (x) => x;\nfunction newWatch(setup) {\n const method = (currentValues, callback) => {\n return setupWatch(currentValues, callback, setup);\n };\n method.setup = setup;\n defineOnMethod(() => method, method);\n return method;\n}\n/**\n * puts above functionality together\n * @param currentValues values being watched\n * @param callback (currentValue, previousValues) => resolveToValue\n * @param param2\n * @returns\n */\nconst setupWatch = (currentValues, callback, { init, before = () => true, final = defaultFinally, } = {}) => {\n let previous = state({\n pastResult: undefined,\n values: undefined,\n });\n const previousValues = previous.values;\n // First time running watch?\n if (previousValues === undefined) {\n if (!before(currentValues)) {\n previous.values = currentValues;\n return previous.pastResult; // do not continue\n }\n const castedInit = init || callback;\n const result = castedInit(currentValues, previousValues);\n previous.pastResult = final(result);\n previous.values = currentValues;\n return previous.pastResult;\n }\n const allExact = currentValues.every((item, index) => item === previousValues[index]);\n if (allExact) {\n return previous.pastResult;\n }\n if (!before(currentValues)) {\n previous.values = currentValues;\n return previous.pastResult; // do not continue\n }\n const result = callback(currentValues, previousValues);\n previous.pastResult = final(result);\n previousValues.length = 0;\n previousValues.push(...currentValues);\n return previous.pastResult;\n};\nfunction defineOnMethod(getWatch, attachTo) {\n Object.defineProperty(attachTo, 'noInit', {\n get() {\n const watch = getWatch();\n watch.setup.init = () => undefined;\n return watch;\n },\n });\n Object.defineProperty(attachTo, 'asSubject', {\n get() {\n const oldWatch = getWatch();\n const method = (currentValues, callback) => {\n const originalState = state(() => getSupportInCycle().memory.state);\n const subject = state(() => new ValueSubject(undefined));\n setupWatch(currentValues, (currentValues, previousValues) => {\n const setTo = callback(currentValues, previousValues);\n if (originalState.length) {\n const newestState = setUse.memory.stateConfig.array;\n syncStates(newestState, originalState);\n }\n subject.next(setTo);\n }, oldWatch.setup);\n return subject;\n };\n method.setup = oldWatch.setup;\n defineOnMethod(() => method, method);\n return method;\n },\n });\n Object.defineProperty(attachTo, 'truthy', {\n get() {\n const watch = getWatch();\n watch.setup.before = (currentValues) => currentValues.every(x => x);\n return watch;\n },\n });\n return attachTo;\n}\ndefineOnMethod(() => newWatch({}), watch);\n","import { Subject, ValueSubject } from '../subject/index.js';\nimport { getSupportInCycle } from '../tag/getSupportInCycle.function.js';\nimport { setUse } from './setUse.function.js';\nimport { state } from './state.function.js';\nimport { syncStates } from './syncStates.function.js';\n/** Create a Subject that on updates will sync state values to keep chained functions using latest variables */\nexport function subject(value, onSubscription) {\n const oldestState = state(() => setUse.memory.stateConfig.array);\n const nowTagSupport = getSupportInCycle();\n return state(() => {\n const subject = new Subject(value, onSubscription).pipe(x => {\n syncStates(nowTagSupport.memory.state, oldestState);\n return x;\n });\n return subject;\n });\n}\nsubject._value = (value) => {\n const oldestState = state(() => setUse.memory.stateConfig.array);\n const nowTagSupport = getSupportInCycle();\n return state(() => {\n const subject = new ValueSubject(value).pipe(x => {\n syncStates(nowTagSupport.memory.state, oldestState);\n return x;\n });\n return subject;\n });\n};\nfunction all(args) {\n const oldestState = state(() => setUse.memory.stateConfig.array);\n const nowTagSupport = getSupportInCycle();\n return Subject.all(args).pipe(x => {\n syncStates(nowTagSupport.memory.state, oldestState);\n return x;\n });\n}\nsubject.all = all;\n","import { getStateValue } from './state.utils.js';\nimport { setUse } from './setUse.function.js';\n/** Used for variables that need to remain the same variable during render passes */\nexport function letState(defaultValue) {\n const config = setUse.memory.stateConfig;\n const rearray = config.rearray;\n let getSetMethod;\n const restate = rearray[config.array.length];\n if (restate) {\n let oldValue = getStateValue(restate);\n getSetMethod = ((x) => [oldValue, oldValue = x]);\n const push = {\n get: () => getStateValue(push),\n callback: getSetMethod,\n lastValue: oldValue,\n defaultValue: restate.defaultValue,\n };\n config.array.push(push);\n return makeStateResult(oldValue, push);\n }\n // State first time run\n const defaultFn = defaultValue instanceof Function ? defaultValue : () => defaultValue;\n let initValue = defaultFn();\n getSetMethod = ((x) => [initValue, initValue = x]);\n const push = {\n get: () => getStateValue(push),\n callback: getSetMethod,\n lastValue: initValue,\n defaultValue: initValue,\n };\n config.array.push(push);\n return makeStateResult(initValue, push);\n}\nfunction makeStateResult(initValue, push) {\n // return initValue\n const result = (y) => {\n push.callback = y || (x => [initValue, initValue = x]);\n return initValue;\n };\n return result;\n}\n","import { letState } from './letState.function.js';\nimport { watch } from './watch.function.js';\n/**\n * Enables the ability to maintain a change to a props value until the prop itself changes\n * @param prop typically the name of an existing prop\n * @returns immediately call the returned function: letProp(y)(x => [y, y=x])\n */\nexport function letProp(prop) {\n return getSetProp => {\n let myProp = letState(prop)(getSetProp);\n watch([prop], () => getSetProp(myProp = prop));\n getSetProp(myProp);\n return myProp;\n };\n}\n","export function deepClone(obj) {\n return makeDeepClone(obj, new WeakMap());\n}\nfunction makeDeepClone(obj, visited) {\n // If obj is a primitive type or null, return it directly\n if (obj === null || typeof obj !== 'object') {\n return obj;\n }\n // If obj is already visited, return the cloned reference\n if (visited.has(obj)) {\n return visited.get(obj);\n }\n // Handle special cases like Date and RegExp\n if (obj instanceof Date) {\n return new Date(obj);\n }\n if (obj instanceof RegExp) {\n return new RegExp(obj);\n }\n // Create an empty object or array with the same prototype\n const clone = Array.isArray(obj) ? [] : Object.create(Object.getPrototypeOf(obj));\n // Register the cloned object to avoid cyclic references\n visited.set(obj, clone);\n // Clone each property or element of the object or array\n if (Array.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n clone[i] = makeDeepClone(obj[i], visited);\n }\n }\n else {\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n clone[key] = makeDeepClone(obj[key], visited);\n }\n }\n }\n return clone;\n}\nexport function deepEqual(obj1, obj2) {\n return isDeepEqual(obj1, obj2, new WeakMap());\n}\nfunction isDeepEqual(obj1, obj2, visited) {\n const directEqual = obj1 === obj2;\n if (directEqual || isSameFunctions(obj1, obj2)) {\n return true;\n }\n // If obj is already visited, return the cloned reference\n if (visited.has(obj1)) {\n return true;\n }\n if (typeof obj1 === 'object' && typeof obj2 === 'object') {\n // both are dates and were already determined not the same\n if (obj1 instanceof Date && obj2 instanceof Date) {\n return obj1.getTime() === obj2.getTime();\n }\n // Register the cloned object to avoid cyclic references\n visited.set(obj1, 0);\n // Check if obj1 and obj2 are both arrays\n if (Array.isArray(obj1) && Array.isArray(obj2)) {\n return isArrayDeepEqual(obj1, obj2, visited);\n }\n else if (Array.isArray(obj1) || Array.isArray(obj2)) {\n // One is an array, and the other is not\n return false;\n }\n return isObjectDeepEqual(obj1, obj2, visited);\n }\n return false;\n}\nfunction isObjectDeepEqual(obj1, obj2, visited) {\n const keys1 = Object.keys(obj1);\n const keys2 = Object.keys(obj2);\n if (keys1.length === 0 && keys2.length === 0) {\n return true;\n }\n if (keys1.length !== keys2.length) {\n return false;\n }\n for (const key of keys1) {\n const keyFound = keys2.includes(key);\n if (!keyFound || !isDeepEqual(obj1[key], obj2[key], visited)) {\n return false;\n }\n }\n return true;\n}\nfunction isArrayDeepEqual(obj1, obj2, visited) {\n if (obj1.length !== obj2.length) {\n return false;\n }\n for (let i = 0; i < obj1.length; i++) {\n if (!isDeepEqual(obj1[i], obj2[i], visited)) {\n return false;\n }\n }\n return true;\n}\nfunction isSameFunctions(fn0, fn1) {\n const bothFunction = fn0 instanceof Function && fn1 instanceof Function;\n return bothFunction && fn0.toString() === fn1.toString();\n}\n","import { deepClone } from '../deepFunctions.js';\nimport { setUse } from './setUse.function.js';\nimport { state } from './state.function.js';\nsetUse.memory.providerConfig = {\n providers: [],\n ownerSupport: undefined,\n};\nexport const providers = {\n create: (constructMethod) => {\n const stateDiffMemory = state(() => ({ stateDiff: 0, provider: undefined }));\n // mimic how many states were called the first time\n if (stateDiffMemory.stateDiff) {\n for (let x = stateDiffMemory.stateDiff; x > 0; --x) {\n state(undefined);\n }\n const result = state(undefined);\n // stateDiffMemory.provider.constructMethod.compareTo = compareTo\n return result;\n }\n const result = state(() => {\n const memory = setUse.memory;\n const stateConfig = memory.stateConfig;\n const oldStateCount = stateConfig.array.length;\n // Providers with provider requirements just need to use providers.create() and providers.inject()\n const instance = 'prototype' in constructMethod ? new constructMethod() : constructMethod();\n const stateDiff = stateConfig.array.length - oldStateCount;\n const config = memory.providerConfig;\n const provider = {\n constructMethod,\n instance,\n clone: deepClone(instance),\n stateDiff,\n };\n stateDiffMemory.provider = provider;\n config.providers.push(provider);\n stateDiffMemory.stateDiff = stateDiff;\n return instance;\n });\n const cm = constructMethod;\n // const compareTo = cm.compareTo = cm.compareTo || cm.toString()\n const compareTo = cm.compareTo = cm.toString();\n stateDiffMemory.provider.constructMethod.compareTo = compareTo;\n return result;\n },\n /**\n * @template T\n * @param {(new (...args: any[]) => T) | () => T} constructor\n * @returns {T}\n */\n inject: (constructor) => {\n // find once, return same every time after\n return state(() => {\n const config = setUse.memory.providerConfig;\n const cm = constructor;\n const compareTo = cm.compareTo = cm.compareTo || constructor.toString();\n let owner = {\n ownerTagSupport: config.ownerSupport\n };\n while (owner.ownerTagSupport) {\n const ownerProviders = owner.ownerTagSupport.global.providers;\n const provider = ownerProviders.find(provider => {\n const constructorMatch = provider.constructMethod.compareTo === compareTo;\n if (constructorMatch) {\n return true;\n }\n });\n if (provider) {\n provider.clone = deepClone(provider.instance); // keep a copy of the latest before any change occur\n config.providers.push(provider);\n return provider.instance;\n }\n owner = owner.ownerTagSupport; // cause reloop checking next parent\n }\n const msg = `Could not inject provider: ${constructor.name} ${constructor}`;\n console.warn(`${msg}. Available providers`, config.providers);\n throw new Error(msg);\n });\n }\n};\nsetUse({\n beforeRender: (tagSupport, ownerSupport) => {\n run(tagSupport, ownerSupport);\n },\n beforeRedraw: (tagSupport, newTagSupport) => {\n run(tagSupport, newTagSupport.ownerTagSupport);\n },\n afterRender: (tagSupport) => {\n const config = setUse.memory.providerConfig;\n tagSupport.global.providers = [...config.providers];\n config.providers.length = 0;\n }\n});\nfunction run(tagSupport, ownerSupport) {\n const config = setUse.memory.providerConfig;\n config.ownerSupport = ownerSupport;\n if (tagSupport.global.providers.length) {\n config.providers.length = 0;\n config.providers.push(...tagSupport.global.providers);\n }\n}\n","import { deepClone, deepEqual } from '../deepFunctions.js';\nimport { renderTagSupport } from '../tag/render/renderTagSupport.function.js';\nexport function providersChangeCheck(tagSupport) {\n const global = tagSupport.global;\n const providersWithChanges = global.providers.filter(provider => !deepEqual(provider.instance, provider.clone));\n // reset clones\n for (let index = providersWithChanges.length - 1; index >= 0; --index) {\n const provider = providersWithChanges[index];\n const appSupport = tagSupport.getAppTagSupport();\n handleProviderChanges(appSupport, provider);\n provider.clone = deepClone(provider.instance);\n }\n}\nfunction handleProviderChanges(appSupport, provider) {\n const tagsWithProvider = getTagsWithProvider(appSupport, provider);\n for (let index = tagsWithProvider.length - 1; index >= 0; --index) {\n const { tagSupport, renderCount, provider } = tagsWithProvider[index];\n if (tagSupport.global.deleted) {\n continue; // i was deleted after another tag processed\n }\n const notRendered = renderCount === tagSupport.global.renderCount;\n if (notRendered) {\n provider.clone = deepClone(provider.instance);\n renderTagSupport(tagSupport, false);\n continue;\n }\n }\n}\n/** Updates and returns memory of tag providers */\nfunction getTagsWithProvider(tagSupport, provider, memory = []) {\n const global = tagSupport.global;\n const compare = global.providers;\n const hasProvider = compare.find(xProvider => xProvider.constructMethod.compareTo === provider.constructMethod.compareTo);\n if (hasProvider) {\n memory.push({\n tagSupport,\n renderCount: global.renderCount,\n provider: hasProvider,\n });\n }\n const childTags = tagSupport.childTags;\n for (let index = childTags.length - 1; index >= 0; --index) {\n getTagsWithProvider(childTags[index], provider, memory);\n }\n return memory;\n}\n","export function isLikeTags(tagSupport0, // new\ntagSupport1) {\n const templater0 = tagSupport0.templater;\n const templater1 = tagSupport1.templater;\n const tag0 = templater0?.tag || tagSupport0;\n const tag1 = templater1.tag;\n const strings0 = tag0.strings;\n const strings1 = tagSupport1.strings || tag1.strings;\n if (strings0.length !== strings1.length) {\n return false;\n }\n const everyStringMatched = strings0.every((string, index) => strings1[index] === string);\n if (!everyStringMatched) {\n return false;\n }\n const values0 = tagSupport0.values || tag0.values;\n const values1 = tagSupport1.values || tag1.values;\n return isLikeValueSets(values0, values1);\n}\nexport function isLikeValueSets(values0, values1) {\n const valuesLengthsMatch = values0.length === values1.length;\n if (!valuesLengthsMatch) {\n return false;\n }\n const allVarsMatch = values1.every((value, index) => {\n const compareTo = values0[index];\n const isFunctions = value instanceof Function && compareTo instanceof Function;\n if (isFunctions) {\n const stringMatch = value.toString() === compareTo.toString();\n if (stringMatch) {\n return true;\n }\n return false;\n }\n return true; // deepEqual(value, compareTo)\n });\n if (allVarsMatch) {\n return true;\n }\n return false;\n}\n","export function destroyTagMemory(oldTagSupport) {\n // must destroy oldest which is tag with elements on stage\n const oldest = oldTagSupport.global.oldest;\n oldest.destroy();\n destroyTagSupportPast(oldTagSupport);\n oldTagSupport.global.context = {};\n}\nexport function destroyTagSupportPast(oldTagSupport) {\n delete oldTagSupport.global.oldest;\n delete oldTagSupport.global.newest;\n}\n","import { setUse } from '../state/index.js';\nimport { Subject } from '../subject/index.js';\nimport { getSupportInCycle } from './getSupportInCycle.function.js';\n// Emits event at the end of a tag being rendered. Use tagClosed$.toPromise() to render a tag after a current tag is done rendering\nsetUse.memory.tagClosed$ = new Subject(undefined, subscription => {\n if (!getSupportInCycle()) {\n subscription.next(); // we are not currently processing so process now\n }\n});\n// Life cycle 1\nexport function runBeforeRender(tagSupport, ownerSupport) {\n const tagUse = setUse.tagUse;\n const length = tagUse.length;\n for (let index = 0; index < length; ++index) {\n tagUse[index].beforeRender(tagSupport, ownerSupport);\n }\n}\n// Life cycle 2\nexport function runAfterRender(tagSupport, ownerTagSupport) {\n const tagUse = setUse.tagUse;\n const length = tagUse.length;\n for (let index = 0; index < length; ++index) {\n tagUse[index].afterRender(tagSupport, ownerTagSupport);\n }\n setUse.memory.tagClosed$.next(ownerTagSupport);\n}\n// Life cycle 3\nexport function runBeforeRedraw(tagSupport, ownerTagSupport) {\n const tagUse = setUse.tagUse;\n const length = tagUse.length;\n for (let index = 0; index < length; ++index) {\n tagUse[index].beforeRedraw(tagSupport, ownerTagSupport);\n }\n}\n// Life cycle 4 - end of life\nexport function runBeforeDestroy(tagSupport, ownerTagSupport) {\n const tagUse = setUse.tagUse;\n const length = tagUse.length;\n for (let index = 0; index < length; ++index) {\n tagUse[index].beforeDestroy(tagSupport, ownerTagSupport);\n }\n}\n","import { runBeforeRedraw, runBeforeRender } from '../tagRunner.js';\nimport { setUse } from '../../state/index.js';\nimport { runAfterRender } from '../tagRunner.js';\nexport function renderTagOnly(newTagSupport, lastSupport, subject, ownerSupport) {\n const oldRenderCount = newTagSupport.global.renderCount;\n beforeWithRender(newTagSupport, ownerSupport, lastSupport);\n const templater = newTagSupport.templater;\n // NEW TAG CREATED HERE\n const wrapper = templater.wrapper;\n let reSupport = wrapper(newTagSupport, subject);\n /* AFTER */\n runAfterRender(newTagSupport, ownerSupport);\n // When we rendered, only 1 render should have taken place OTHERWISE rendering caused another render and that is the latest instead\n if (reSupport.global.renderCount > oldRenderCount + 1) {\n return newTagSupport.global.newest;\n }\n newTagSupport.global.newest = reSupport;\n return reSupport;\n}\nfunction beforeWithRender(tagSupport, // new\nownerSupport, lastSupport) {\n const lastOwnerSupport = lastSupport?.ownerTagSupport;\n const runtimeOwnerSupport = lastOwnerSupport || ownerSupport;\n if (lastSupport) {\n const lastState = lastSupport.memory.state;\n const memory = tagSupport.memory;\n // memory.state.length = 0\n // memory.state.push(...lastState)\n memory.state = [...lastState];\n tagSupport.global = lastSupport.global;\n runBeforeRedraw(tagSupport, lastSupport);\n }\n else {\n // first time render\n runBeforeRender(tagSupport, runtimeOwnerSupport);\n // TODO: Logic below most likely could live within providers.ts inside the runBeforeRender function\n const providers = setUse.memory.providerConfig;\n providers.ownerSupport = runtimeOwnerSupport;\n }\n}\n","import { isLikeTags } from '../isLikeTags.function.js';\nimport { destroyTagMemory } from '../destroyTag.function.js';\nimport { renderTagOnly } from './renderTagOnly.function.js';\nexport function renderWithSupport(newTagSupport, lastSupport, // previous\nsubject, // events & memory\nownerSupport) {\n const reSupport = renderTagOnly(newTagSupport, lastSupport, subject, ownerSupport);\n const isLikeTag = !lastSupport || isLikeTags(lastSupport, reSupport);\n if (!isLikeTag) {\n destroyUnlikeTags(lastSupport, reSupport, subject);\n }\n const lastOwnerSupport = lastSupport?.ownerTagSupport;\n reSupport.ownerTagSupport = (ownerSupport || lastOwnerSupport);\n return reSupport;\n}\nfunction destroyUnlikeTags(lastSupport, // old\nreSupport, // new\nsubject) {\n const oldGlobal = lastSupport.global;\n const insertBefore = oldGlobal.insertBefore;\n destroyTagMemory(lastSupport);\n // when a tag is destroyed, disconnect the globals\n reSupport.global = { ...oldGlobal }; // break memory references\n const global = reSupport.global;\n global.insertBefore = insertBefore;\n global.deleted = false;\n delete global.oldest;\n delete global.newest;\n delete subject.tagSupport;\n}\n","import { providersChangeCheck } from '../../state/provider.utils.js';\nimport { isLikeTags } from '../isLikeTags.function.js';\nimport { renderWithSupport } from './renderWithSupport.function.js';\n/** Returns true when rendering owner is not needed. Returns false when rendering owner should occur */\nexport function renderExistingTag(oldestSupport, // oldest with elements on html\nnewSupport, // new to be rendered\nownerSupport, // ownerSupport\nsubject) {\n const lastSupport = subject.tagSupport;\n const global = lastSupport.global;\n // share point between renders\n newSupport.global = global;\n const preRenderCount = global.renderCount;\n providersChangeCheck(oldestSupport);\n // When the providers were checked, a render to myself occurred and I do not need to re-render again\n const prevSupport = global.newest;\n if (preRenderCount !== global.renderCount) {\n oldestSupport.updateBy(prevSupport);\n return prevSupport; // already rendered during triggered events\n }\n const toRedrawTag = prevSupport || lastSupport || global.oldest;\n const reSupport = renderWithSupport(newSupport, toRedrawTag, subject, ownerSupport);\n const oldest = global.oldest || oldestSupport;\n reSupport.global.oldest = oldest;\n // TODO: renderWithSupport already does an isLikeTags compare\n if (isLikeTags(prevSupport, reSupport)) {\n subject.tagSupport = reSupport;\n oldest.updateBy(reSupport);\n }\n return reSupport;\n}\n","import { deepEqual } from '../../deepFunctions.js';\nimport { renderExistingTag } from './renderExistingTag.function.js';\n/** Main function used by all other callers to render/update display of a tag component */\nexport function renderTagSupport(tagSupport, // must be latest/newest state render\nrenderUp) {\n const global = tagSupport.global;\n const templater = tagSupport.templater;\n // is it just a vanilla tag, not component?\n if (!templater.wrapper) { // || isTagTemplater(templater) \n const ownerTag = tagSupport.ownerTagSupport;\n ++global.renderCount;\n return renderTagSupport(ownerTag, true);\n }\n const subject = tagSupport.subject;\n let ownerSupport;\n let selfPropChange = false;\n const shouldRenderUp = renderUp && tagSupport;\n if (shouldRenderUp) {\n ownerSupport = tagSupport.ownerTagSupport;\n if (ownerSupport) {\n const nowProps = templater.props;\n const latestProps = tagSupport.propsConfig.latestCloned;\n selfPropChange = !nowProps.every((props, index) => deepEqual(props, latestProps[index]));\n }\n }\n const oldest = tagSupport.global.oldest;\n const tag = renderExistingTag(oldest, tagSupport, ownerSupport, // useTagSupport,\n subject);\n const renderOwner = ownerSupport && selfPropChange;\n if (renderOwner) {\n const ownerTagSupport = ownerSupport;\n renderTagSupport(ownerTagSupport, true);\n return tag;\n }\n return tag;\n}\n","import { setUse } from './setUse.function.js';\nimport { renderTagSupport } from '../tag/render/renderTagSupport.function.js';\nimport { SyncCallbackError } from '../errors.js';\nimport { syncStates } from './syncStates.function.js';\nimport { getSupportInCycle } from '../tag/getSupportInCycle.function.js';\nlet innerCallback = (callback) => (a, b, c, d, e, f) => {\n throw new SyncCallbackError('Callback function was called immediately in sync and must instead be call async');\n};\nexport const callbackMaker = () => innerCallback;\nconst originalGetter = innerCallback; // callbackMaker\nsetUse({\n beforeRender: (tagSupport) => initMemory(tagSupport),\n beforeRedraw: (tagSupport) => initMemory(tagSupport),\n afterRender: (tagSupport) => {\n ;\n tagSupport.global.callbackMaker = true;\n innerCallback = originalGetter; // prevent crossing callbacks with another tag\n },\n});\nexport function callback(callback) {\n const tagSupport = getSupportInCycle();\n if (!tagSupport) {\n const error = new SyncCallbackError('callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering');\n throw error;\n }\n const oldState = setUse.memory.stateConfig.array;\n const trigger = (...args) => {\n const callbackMaker = tagSupport.global.callbackMaker;\n if (callbackMaker) {\n return triggerStateUpdate(tagSupport, callback, oldState, ...args);\n }\n return callback(...args);\n };\n return trigger;\n}\nfunction initMemory(tagSupport) {\n const oldState = setUse.memory.stateConfig.array;\n innerCallback = (callback) => {\n const trigger = (...args) => {\n const callbackMaker = tagSupport.global.callbackMaker;\n if (callbackMaker) {\n return triggerStateUpdate(tagSupport, callback, oldState, ...args);\n }\n return callback(...args);\n };\n return trigger;\n };\n}\nfunction triggerStateUpdate(tagSupport, callback, oldState, ...args) {\n const state = tagSupport.memory.state;\n // ensure that the oldest has the latest values first\n syncStates(state, oldState);\n // run the callback\n const maybePromise = callback(...args);\n // send the oldest state changes into the newest\n syncStates(oldState, state);\n /*\n if(tagSupport.global.deleted) {\n return maybePromise // While running callback the tag was deleted. Often that happens\n }\n */\n renderTagSupport(tagSupport, false);\n if (maybePromise instanceof Promise) {\n maybePromise.finally(() => {\n // send the oldest state changes into the newest\n syncStates(oldState, state);\n renderTagSupport(tagSupport, false);\n });\n }\n // return undefined as T\n return maybePromise;\n}\n","import { setUse } from './setUse.function.js';\nfunction setCurrentTagSupport(support) {\n setUse.memory.currentSupport = support;\n}\nexport function onInit(callback) {\n const tagSupport = setUse.memory.currentSupport;\n if (!tagSupport.global.init) {\n tagSupport.global.init = callback;\n callback(); // fire init\n }\n}\nsetUse({\n beforeRender: tagSupport => setCurrentTagSupport(tagSupport),\n beforeRedraw: tagSupport => setCurrentTagSupport(tagSupport),\n});\n","import { setUse } from './setUse.function.js';\nfunction setCurrentTagSupport(support) {\n setUse.memory.destroyCurrentSupport = support;\n}\nexport function onDestroy(callback) {\n const tagSupport = setUse.memory.destroyCurrentSupport;\n tagSupport.global.destroyCallback = callback;\n}\nsetUse({\n beforeRender: tagSupport => setCurrentTagSupport(tagSupport),\n beforeRedraw: tagSupport => setCurrentTagSupport(tagSupport),\n beforeDestroy: (tagSupport) => {\n const callback = tagSupport.global.destroyCallback;\n if (callback) {\n callback();\n }\n }\n});\n","import { setUse } from './setUse.function.js';\nfunction setCurrentTagSupport(support) {\n setUse.memory.childrenCurrentSupport = support;\n}\nexport function children() {\n const tagSupport = setUse.memory.childrenCurrentSupport;\n const children = tagSupport.templater.children;\n return children;\n}\nsetUse({\n beforeRender: tagSupport => setCurrentTagSupport(tagSupport),\n beforeRedraw: tagSupport => setCurrentTagSupport(tagSupport),\n});\n","import { ValueTypes } from './ValueTypes.enum.js';\nexport const variablePrefix = '__tagvar';\nexport const escapeVariable = '--' + variablePrefix + '--';\nexport const escapeSearch = new RegExp(escapeVariable, 'g');\nexport class Tag {\n strings;\n values;\n tagJsType = ValueTypes.tag;\n // present only when an array. Populated by Tag.key()\n memory = {};\n templater;\n constructor(strings, values) {\n this.strings = strings;\n this.values = values;\n }\n /** Used for array, such as array.map(), calls aka array.map(x => html``.key(x)) */\n key(arrayValue) {\n this.memory.arrayValue = arrayValue;\n return this;\n }\n // TODO: Is this just a fake function that can be data typed?\n children;\n html(strings, ...values) {\n this.children = { strings, values };\n return this;\n }\n}\n","import { Tag } from './Tag.class.js';\nimport { ValueSubject } from '../subject/index.js';\nimport { kidsToTagArraySubject } from './kidsToTagArraySubject.function.js';\nexport class TemplaterResult {\n props;\n tagJsType = 'templater';\n tagged;\n wrapper;\n madeChildIntoSubject;\n tag;\n children = new ValueSubject([]);\n constructor(props) {\n this.props = props;\n }\n html(strings, ...values) {\n const children = new Tag(strings, values);\n const childSubject = kidsToTagArraySubject(children, this);\n this.children = childSubject;\n return this;\n }\n}\n","import { isSubjectInstance, isTagArray } from '../isInstance.js';\nimport { ValueSubject } from '../subject/ValueSubject.js';\nexport function kidsToTagArraySubject(children, templaterResult) {\n if (isSubjectInstance(children)) {\n return children;\n }\n const kidArray = children;\n if (isTagArray(kidArray)) {\n templaterResult.madeChildIntoSubject = true; // was converted into a subject\n return new ValueSubject(children);\n }\n const kid = children;\n if (kid) {\n templaterResult.madeChildIntoSubject = true; // was converted into a subject\n kid.memory.arrayValue = 0;\n return new ValueSubject([kid]);\n }\n templaterResult.madeChildIntoSubject = true; // was converted into a subject\n return new ValueSubject([]);\n}\n","export const tags = [];\n","/** File largely responsible for reacting to element events, such as onclick */\nimport { renderTagSupport } from '../tag/render/renderTagSupport.function.js';\nexport function bindSubjectCallback(value, tagSupport) {\n // Is this children? No override needed\n if (value.isChildOverride) {\n return value;\n }\n const subjectFunction = (element, args) => runTagCallback(value, tagSupport, element, args);\n // link back to original. Mostly used for <div oninit ondestroy> animations\n subjectFunction.tagFunction = value;\n return subjectFunction;\n}\nexport function runTagCallback(value, tagSupport, bindTo, args) {\n const myGlobal = tagSupport.global;\n const renderCount = myGlobal.renderCount;\n const method = value.bind(bindTo);\n const callbackResult = method(...args);\n const sameRenderCount = renderCount === myGlobal.renderCount;\n const skipRender = !sameRenderCount || myGlobal.deleted;\n // already rendered OR tag was deleted before event processing\n if (skipRender) {\n if (callbackResult instanceof Promise) {\n return callbackResult.then(() => {\n return 'promise-no-data-ever'; // tag was deleted during event processing\n });\n }\n return 'no-data-ever'; // already rendered\n }\n const newest = renderTagSupport(myGlobal.newest, true);\n myGlobal.newest = newest;\n if (callbackResult instanceof Promise) {\n return callbackResult.then(() => {\n if (myGlobal.deleted) {\n return 'promise-no-data-ever'; // tag was deleted during event processing\n }\n const newest = renderTagSupport(myGlobal.newest, true);\n myGlobal.newest = newest;\n return 'promise-no-data-ever';\n });\n }\n // Caller always expects a Promise\n return 'no-data-ever';\n}\n","// Function to insert element after reference element\nexport function insertAfter(newNode, referenceNode) {\n const parentNode = referenceNode.parentNode;\n parentNode.insertBefore(newNode, referenceNode.nextSibling);\n}\n","import { isStaticTag } from '../isInstance.js';\nimport { isLikeTags } from './isLikeTags.function.js';\nimport { destroyTagMemory, destroyTagSupportPast } from './destroyTag.function.js';\nimport { insertAfter } from '../insertAfter.function.js';\nimport { ValueTypes } from './ValueTypes.enum.js';\nexport function checkDestroyPrevious(subject, // existing.value is the old value\nnewValue, insertBefore, valueType) {\n const displaySubject = subject;\n const hasLastValue = 'lastValue' in displaySubject;\n const lastValue = displaySubject.lastValue; // TODO: we maybe able to use displaySubject.value and remove concept of lastValue\n // was simple value but now something bigger\n if (hasLastValue && lastValue !== newValue) {\n // below is faster than using getValueType\n const newType = typeof (newValue);\n if (isSimpleType(newType) && typeof (lastValue) === newType) {\n return false;\n }\n if (newValue instanceof Function && lastValue instanceof Function) {\n return false;\n }\n destroySimpleValue(insertBefore, displaySubject);\n return 'changed-simple-value';\n }\n const arraySubject = subject;\n const wasArray = arraySubject.lastArray;\n // no longer an array\n if (wasArray && valueType !== ValueTypes.tagArray) {\n const placeholderElm = arraySubject.placeholder;\n delete arraySubject.lastArray;\n delete arraySubject.placeholder;\n insertAfter(insertBefore, placeholderElm);\n for (let index = wasArray.length - 1; index >= 0; --index) {\n const { tagSupport } = wasArray[index];\n destroyArrayTag(tagSupport, { added: 0, removed: 0 });\n }\n return 'array';\n }\n const tagSubject = subject;\n const lastSupport = tagSubject.tagSupport;\n // no longer tag or component?\n if (lastSupport) {\n const isValueTag = isStaticTag(newValue);\n const isSubjectTag = isStaticTag(subject._value);\n if (isSubjectTag && isValueTag) {\n const newTag = newValue;\n // its a different tag now\n if (!isLikeTags(newTag, lastSupport)) {\n // put template back down\n restoreTagMarker(lastSupport);\n destroyTagMemory(lastSupport);\n return 2;\n }\n return false;\n }\n if (valueType === ValueTypes.tagComponent) {\n return false; // its still a tag component\n }\n if (newValue && newValue.oneRender) {\n return false;\n }\n // put template back down\n restoreTagMarker(lastSupport);\n // destroy old component, value is not a component\n destroyTagMemory(lastSupport);\n return 'different-tag';\n }\n return false;\n}\nexport function isSimpleType(value) {\n return ['string', 'number', 'boolean'].includes(value);\n}\nexport function destroyArrayTag(tagSupport, counts) {\n destroyTagSupportPast(tagSupport);\n tagSupport.destroy({\n stagger: counts.removed++,\n });\n const insertBefore = tagSupport.global.insertBefore;\n const parentNode = insertBefore.parentNode;\n parentNode.removeChild(insertBefore);\n}\nfunction destroySimpleValue(insertBefore, // always a template tag\nsubject) {\n const clone = subject.clone;\n const parent = clone.parentNode;\n // 1 put the template back down\n parent.insertBefore(insertBefore, clone);\n parent.removeChild(clone);\n delete subject.clone;\n delete subject.lastValue;\n}\nexport function restoreTagMarker(lastSupport) {\n const insertBefore = lastSupport.global.insertBefore;\n const global = lastSupport.global;\n const placeholderElm = global.placeholder;\n if (placeholderElm) {\n insertAfter(insertBefore, placeholderElm);\n delete global.placeholder;\n }\n}\n","import { isSubjectInstance, isTagArray } from '../../isInstance.js';\nimport { isSimpleType } from '../checkDestroyPrevious.function.js';\nimport { ValueTypes } from '../ValueTypes.enum.js';\nexport function getValueType(value) {\n if (value === undefined || value === null) {\n return ValueTypes.undefined;\n }\n const type = typeof (value);\n if (value instanceof Function) {\n return ValueTypes.function;\n }\n if (type === 'object') {\n if (value instanceof Date) {\n return ValueTypes.date;\n }\n if (isSimpleType(type)) {\n return type;\n }\n const tagJsType = value.tagJsType;\n if (tagJsType) {\n const included = [\n ValueTypes.tagComponent,\n ValueTypes.templater,\n ValueTypes.tag,\n ].includes(tagJsType);\n if (included) {\n return tagJsType;\n }\n }\n if (isTagArray(value)) {\n return ValueTypes.tagArray;\n }\n if (isSubjectInstance(value)) {\n return ValueTypes.subject;\n }\n }\n return ValueTypes.unknown;\n}\n","import { deepClone } from '../deepFunctions.js';\nimport { getValueType } from './update/processFirstSubject.utils.js';\nimport { ValueTypes } from './ValueTypes.enum.js';\nexport function cloneValueArray(values) {\n return values.map((value) => {\n const tag = value;\n switch (getValueType(value)) {\n case ValueTypes.tagComponent:\n const tagComponent = value;\n return deepClone(tagComponent.props);\n case ValueTypes.tag:\n case ValueTypes.templater:\n return cloneValueArray(tag.values);\n case ValueTypes.tagArray:\n return cloneValueArray(tag);\n }\n return deepClone(value);\n });\n}\n","export function getChildTagsToDestroy(childTags, allTags = []) {\n for (let index = childTags.length - 1; index >= 0; --index) {\n const cTag = childTags[index];\n allTags.push(cTag);\n childTags.splice(index, 1);\n getChildTagsToDestroy(cTag.childTags, allTags);\n }\n return allTags;\n}\n","import { ValueSubject } from '../../subject/ValueSubject.js';\nimport { TemplaterResult } from '../TemplaterResult.class.js';\nimport { TagSupport } from '../TagSupport.class.js';\nimport { getValueType } from './processFirstSubject.utils.js';\nimport { ValueTypes } from '../ValueTypes.enum.js';\nexport function processNewValue(value, ownerSupport) {\n const valueType = getValueType(value);\n switch (valueType) {\n case ValueTypes.tagComponent:\n const tagSubject = new ValueSubject(value);\n return tagSubject;\n case ValueTypes.templater:\n const templater = value;\n const tag = templater.tag;\n return processNewTag(tag, ownerSupport);\n case ValueTypes.tag:\n return processNewTag(value, ownerSupport);\n case ValueTypes.subject:\n return value;\n }\n return new ValueSubject(value);\n}\nfunction processNewTag(value, ownerSupport) {\n const tag = value;\n let templater = tag.templater;\n if (!templater) {\n templater = new TemplaterResult([]);\n templater.tag = tag;\n tag.templater = templater;\n }\n const subject = new ValueSubject(templater);\n subject.tagSupport = new TagSupport(templater, ownerSupport, subject);\n return subject;\n}\n","export function setTagPlaceholder(global) {\n const insertBefore = global.insertBefore;\n return global.placeholder = swapInsertBefore(insertBefore);\n}\nexport function swapInsertBefore(insertBefore) {\n const placeholder = document.createTextNode('');\n const parentNode = insertBefore.parentNode;\n parentNode.insertBefore(placeholder, insertBefore);\n parentNode.removeChild(insertBefore);\n return placeholder;\n}\n","export function inputAttribute(name, value, element) {\n const names = name.split('.');\n // style.position = \"absolute\"\n if (names[0] === 'style') {\n element.style[names[1]] = value;\n }\n // Example: class.width-full = \"true\"\n if (names[0] === 'class') {\n names.shift();\n if (value) {\n for (let index = 0; index < names.length; ++index) {\n element.classList.add(names[index]);\n }\n }\n else {\n for (let index = 0; index < names.length; ++index) {\n element.classList.remove(names[index]);\n }\n }\n }\n}\n","import { inputAttribute } from './inputAttribute.js';\nimport { isSubjectInstance } from '../isInstance.js';\nimport { bindSubjectCallback } from './bindSubjectCallback.function.js';\nconst startRegX = /^\\s*{__tagvar/;\nconst endRegX = /}\\s*$/;\nfunction isTagVar(value) {\n return value && value.search(startRegX) >= 0 && value.search(endRegX) >= 0;\n}\nexport function processAttribute(attrName, value, child, scope, ownerSupport, howToSet) {\n if (isTagVar(value)) {\n return processScopedNameValueAttr(attrName, value, child, scope, ownerSupport, howToSet);\n }\n if (isTagVar(attrName)) {\n const contextValueSubject = getContextValueByVarString(scope, attrName);\n let lastValue;\n // the above callback gets called immediately since its a ValueSubject()\n const sub = contextValueSubject.subscribe((value) => {\n processNameOnlyAttr(value, lastValue, child, ownerSupport, howToSet);\n lastValue = value;\n });\n ownerSupport.global.subscriptions.push(sub); // this is where unsubscribe is picked up\n child.removeAttribute(attrName);\n return;\n }\n // Non dynamic\n const isSpecial = isSpecialAttr(attrName);\n if (isSpecial) {\n return inputAttribute(attrName, value, child);\n }\n}\nfunction processScopedNameValueAttr(attrName, value, // {__tagVarN}\nchild, scope, ownerSupport, howToSet) {\n // get the code inside the brackets like \"variable0\" or \"{variable0}\"\n const result = getContextValueByVarString(scope, value);\n return processNameValueAttr(attrName, result, child, ownerSupport, howToSet);\n}\nfunction getContextValueByVarString(scope, value) {\n const code = value.replace('{', '').split('').reverse().join('').replace('}', '').split('').reverse().join('');\n return scope[code];\n}\nfunction processNameOnlyAttr(attrValue, lastValue, child, ownerSupport, howToSet) {\n if (lastValue && lastValue != attrValue) {\n if (typeof (lastValue) === 'string') {\n child.removeAttribute(lastValue);\n }\n else if (lastValue instanceof Object) {\n for (const name in lastValue) {\n child.removeAttribute(name);\n }\n }\n }\n if (typeof (attrValue) === 'string') {\n if (!attrValue.length) {\n return;\n }\n processNameValueAttr(attrValue, '', child, ownerSupport, howToSet);\n return;\n }\n if (attrValue instanceof Object) {\n for (const name in attrValue) {\n processNameValueAttr(name, attrValue[name], child, ownerSupport, howToSet);\n }\n }\n}\nfunction processNameValueAttr(attrName, result, child, ownerSupport, howToSet) {\n const isSpecial = isSpecialAttr(attrName);\n if (result instanceof Function) {\n const action = function (...args) {\n const result2 = result(child, args);\n return result2;\n };\n child[attrName].action = action;\n }\n // Most every variable comes in here since everything is made a ValueSubject\n if (isSubjectInstance(result)) {\n child.removeAttribute(attrName);\n const callback = (newAttrValue) => {\n // should the function be wrapped so every time its called we re-render?\n if (newAttrValue instanceof Function) {\n const wrapper = ownerSupport.templater.wrapper;\n const parentWrap = wrapper?.parentWrap;\n const oneRender = parentWrap?.oneRender;\n if (!oneRender) {\n newAttrValue = bindSubjectCallback(newAttrValue, ownerSupport);\n }\n }\n return processAttributeSubjectValue(newAttrValue, child, attrName, isSpecial, howToSet);\n };\n // 🗞️ Subscribe. Above callback called immediately since its a ValueSubject()\n const sub = result.subscribe(callback);\n // Record subscription for later unsubscribe when element destroyed\n ownerSupport.global.subscriptions.push(sub);\n return;\n }\n howToSet(child, attrName, result);\n // child.setAttribute(attrName, result.value)\n return;\n}\nfunction processAttributeSubjectValue(newAttrValue, child, attrName, isSpecial, howToSet) {\n if (newAttrValue instanceof Function) {\n const fun = function (...args) {\n return newAttrValue(child, args);\n };\n // access to original function\n fun.tagFunction = newAttrValue;\n child[attrName] = fun;\n return;\n }\n if (isSpecial) {\n inputAttribute(attrName, newAttrValue, child);\n return;\n }\n if (newAttrValue) {\n howToSet(child, attrName, newAttrValue);\n return;\n }\n const isDeadValue = [undefined, false, null].includes(newAttrValue);\n if (isDeadValue) {\n child.removeAttribute(attrName);\n return;\n }\n // value is 0\n howToSet(child, attrName, newAttrValue);\n}\n/** Looking for (class | style) followed by a period */\nfunction isSpecialAttr(attrName) {\n return attrName.search(/^(class|style)(\\.)/) >= 0;\n}\n","import { processAttribute } from './processAttribute.function.js';\nfunction howToSetAttribute(element, name, value) {\n element.setAttribute(name, value);\n}\nfunction howToSetInputValue(element, name, value) {\n element[name] = value;\n}\nexport function interpolateAttributes(child, scope, ownerSupport) {\n const attrNames = child.getAttributeNames();\n let howToSet = howToSetAttribute;\n for (let index = 0; index < attrNames.length; ++index) {\n const attrName = attrNames[index];\n if (child.nodeName === 'INPUT' && attrName === 'value') {\n howToSet = howToSetInputValue;\n }\n const value = child.getAttribute(attrName);\n processAttribute(attrName, value, child, scope, ownerSupport, howToSet);\n howToSet = howToSetAttribute; // put back\n }\n}\n","// support arrow functions in attributes\nexport const interpolateReplace = /(?:<[^>]*?(?:(?:\\s+\\w+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^>\\s]+)))*\\s*)\\/?>)|({__tagvar[^}]+})/g;\n/** replaces ${x} with <template id=\"x-start\"></template><template id=\"x-end\"></template> */\nexport function interpolateToTemplates(template) {\n const keys = [];\n const string = template.replace(interpolateReplace, (match, expression) => {\n if (match.startsWith('<')) {\n // If the match is an HTML tag, don't replace\n return match;\n }\n const noBraces = expression.substring(1, expression.length - 1);\n const id = noBraces;\n keys.push(id);\n return `<template interpolate end id=\"${id}\"></template>`;\n });\n return { string, keys };\n}\n","export function processTagResult(tagSupport, subject, // used for recording past and current value\ninsertBefore, // <template end interpolate />\n{ counts, }) {\n // *if appears we already have seen\n const subjectTag = subject;\n const lastSupport = subjectTag.tagSupport;\n const prevSupport = lastSupport?.global.oldest || undefined;\n const justUpdate = prevSupport;\n if (prevSupport && justUpdate) {\n return processTagResultUpdate(tagSupport, subjectTag, prevSupport);\n }\n tagSupport.buildBeforeElement(insertBefore, {\n counts,\n });\n}\nfunction processTagResultUpdate(tagSupport, subject, // used for recording past and current value\nprevSupport) {\n // components\n if (subject instanceof Function) {\n const newSupport = subject(prevSupport);\n prevSupport.updateBy(newSupport);\n subject.tagSupport = newSupport;\n return;\n }\n prevSupport.updateBy(tagSupport);\n subject.tagSupport = tagSupport;\n return;\n}\n","import { setUse } from '../../state/index.js';\nimport { processTagResult } from './processTagResult.function.js';\nimport { TagSupport } from '../TagSupport.class.js';\nimport { renderSubjectComponent } from '../render/renderSubjectComponent.function.js';\nexport function processSubjectComponent(templater, subject, insertBefore, ownerSupport, options) {\n // Check if function component is wrapped in a tag() call\n // TODO: This below check not needed in production mode\n if (templater.tagged !== true) {\n const wrapper = templater.wrapper;\n const original = wrapper.parentWrap.original;\n let name = original.name || original.constructor?.name;\n if (name === 'Function') {\n name = undefined;\n }\n const label = name || original.toString().substring(0, 120);\n const error = new Error(`Not a tag component. Wrap your function with tag(). Example tag(props => html\\`\\`) on component:\\n\\n${label}\\n\\n`);\n throw error;\n }\n const tagSupport = new TagSupport(templater, ownerSupport, subject);\n let reSupport = subject.tagSupport;\n const global = tagSupport.global = reSupport?.global || tagSupport.global;\n global.insertBefore = insertBefore;\n const providers = setUse.memory.providerConfig;\n providers.ownerSupport = ownerSupport;\n const isRender = !reSupport;\n if (isRender) {\n const support = reSupport || tagSupport;\n reSupport = renderSubjectComponent(subject, support, ownerSupport);\n }\n processTagResult(reSupport, subject, // The element set here will be removed from document. Also result.tag will be added in here\n insertBefore, // <template end interpolate /> (will be removed)\n options);\n return reSupport;\n}\n","import { renderWithSupport } from './renderWithSupport.function.js';\nexport function renderSubjectComponent(subject, reSupport, ownerSupport) {\n const preClones = ownerSupport.clones.map(clone => clone);\n reSupport = renderWithSupport(reSupport, subject.tagSupport, // existing tag\n subject, ownerSupport);\n reSupport.global.newest = reSupport;\n if (ownerSupport.clones.length > preClones.length) {\n const myClones = ownerSupport.clones.filter(fClone => !preClones.find(clone => clone === fClone));\n reSupport.clones.push(...myClones);\n }\n ownerSupport.childTags.push(reSupport);\n return reSupport;\n}\n","import { TagSupport } from '../TagSupport.class.js';\nimport { ValueSubject } from '../../subject/index.js';\n/** Could be a regular tag or a component. Both are Tag.class */\nexport function processTag(templater, insertBefore, ownerSupport, // owner\nsubject) {\n let tagSupport = subject.tagSupport;\n // first time seeing this tag?\n if (!tagSupport) {\n tagSupport = newTagSupportByTemplater(templater, ownerSupport, subject);\n }\n subject.tagSupport = tagSupport;\n tagSupport.ownerTagSupport = ownerSupport;\n tagSupport.buildBeforeElement(insertBefore, {\n counts: { added: 0, removed: 0 },\n });\n}\nexport function tagFakeTemplater(tag) {\n const templater = getFakeTemplater();\n templater.tag = tag;\n tag.templater = templater;\n return templater;\n}\nexport function getFakeTemplater() {\n const fake = {\n children: new ValueSubject([]), // no children\n // props: {} as Props,\n props: [],\n isTag: true,\n tagJsType: 'templater',\n tagged: false,\n madeChildIntoSubject: false, // TODO this can be removed\n html: () => fake\n };\n return fake;\n}\nexport function newTagSupportByTemplater(templater, ownerSupport, subject) {\n const tagSupport = new TagSupport(templater, ownerSupport, subject);\n setupNewTemplater(tagSupport, ownerSupport, subject);\n ownerSupport.childTags.push(tagSupport);\n return tagSupport;\n}\nexport function setupNewTemplater(tagSupport, ownerSupport, subject) {\n tagSupport.global.oldest = tagSupport;\n tagSupport.global.newest = tagSupport;\n // asking me to render will cause my parent to render\n tagSupport.ownerTagSupport = ownerSupport;\n subject.tagSupport = tagSupport;\n}\n","import { ValueSubject } from '../../subject/ValueSubject.js';\nimport { ArrayNoKeyError } from '../../errors.js';\nimport { destroyArrayTag } from '../checkDestroyPrevious.function.js';\nimport { setupNewTemplater, tagFakeTemplater } from './processTag.function.js';\nimport { TagSupport } from '../TagSupport.class.js';\nimport { isTagClass } from '../../isInstance.js';\nexport function processTagArray(subject, value, // arry of Tag classes\ninsertBefore, // <template end interpolate />\nownerSupport, options) {\n const clones = ownerSupport.clones; // []\n let lastArray = subject.lastArray = subject.lastArray || [];\n if (!subject.placeholder) {\n setPlaceholderElm(insertBefore, subject);\n }\n const runtimeInsertBefore = subject.placeholder; // || insertBefore\n let removed = 0;\n /** 🗑️ remove previous items first */\n lastArray = subject.lastArray = subject.lastArray.filter((item, index) => {\n const newLength = value.length - 1;\n const at = index - removed;\n const lessLength = newLength < at;\n const subValue = value[index - removed];\n const subTag = subValue;\n // const tag = subTag?.templater.tag as Tag\n const lastTag = item.tagSupport.templater.tag;\n const newArrayValue = subTag?.memory.arrayValue;\n const lastArrayValue = lastTag.memory.arrayValue;\n const destroyItem = lessLength || !areLikeValues(newArrayValue, lastArrayValue);\n if (destroyItem) {\n const last = lastArray[index];\n const tagSupport = last.tagSupport;\n destroyArrayTag(tagSupport, options.counts);\n last.deleted = true;\n ++removed;\n ++options.counts.removed;\n return false;\n }\n return true;\n });\n const length = value.length;\n for (let index = 0; index < length; ++index) {\n const item = value[index];\n const previous = lastArray[index];\n const previousSupport = previous?.tagSupport;\n const subTag = item;\n if (isTagClass(subTag) && !subTag.templater) {\n tagFakeTemplater(subTag);\n }\n const tagSupport = new TagSupport(subTag.templater, ownerSupport, new ValueSubject(undefined));\n if (previousSupport) {\n setupNewTemplater(tagSupport, ownerSupport, previousSupport.subject);\n const global = previousSupport.global;\n tagSupport.global = global;\n global.newest = tagSupport;\n }\n // check for html``.key()\n const keySet = 'arrayValue' in subTag.memory;\n if (!keySet) {\n const details = {\n template: tagSupport.getTemplate().string,\n array: value,\n };\n const message = 'Use html`...`.key(item) instead of html`...` to template an Array';\n console.error(message, details);\n const err = new ArrayNoKeyError(message, details);\n throw err;\n }\n const couldBeSame = lastArray.length > index;\n if (couldBeSame) {\n const prevSupport = previous.tagSupport;\n const prevGlobal = prevSupport.global;\n // subTag.tagSupport = subTag.tagSupport || prevSupport\n const oldest = prevGlobal.oldest;\n oldest.updateBy(tagSupport);\n // return []\n continue;\n }\n processAddTagArrayItem(runtimeInsertBefore, tagSupport, index, options, lastArray);\n ownerSupport.childTags.push(tagSupport);\n }\n return clones;\n}\nfunction setPlaceholderElm(insertBefore, subject) {\n if (insertBefore.nodeName !== 'TEMPLATE') {\n subject.placeholder = insertBefore;\n return;\n }\n const placeholder = subject.placeholder = document.createTextNode('');\n const parentNode = insertBefore.parentNode;\n parentNode.insertBefore(placeholder, insertBefore);\n parentNode.removeChild(insertBefore);\n}\nfunction processAddTagArrayItem(before, tagSupport, index, options, lastArray) {\n const lastValue = {\n tagSupport, index\n };\n // Added to previous array\n lastArray.push(lastValue);\n const counts = {\n added: options.counts.added + index,\n removed: options.counts.removed,\n };\n const fragment = document.createDocumentFragment();\n const newTempElm = document.createElement('template');\n fragment.appendChild(newTempElm);\n tagSupport.buildBeforeElement(newTempElm, // before,\n { counts });\n const parent = before.parentNode;\n parent.insertBefore(fragment, before);\n}\n/** compare two values. If both values are arrays then the items will be compared */\nfunction areLikeValues(valueA, valueB) {\n if (valueA === valueB) {\n return true;\n }\n const bothArrays = valueA instanceof Array && valueB instanceof Array;\n const matchLengths = bothArrays && valueA.length == valueB.length;\n if (matchLengths) {\n return valueA.every((item, index) => item == valueB[index]);\n }\n return false;\n}\n","// Function to update the value of x\nexport function updateBeforeTemplate(value, // value should be casted before calling here\nlastFirstChild) {\n const parent = lastFirstChild.parentNode;\n // Insert the new value (never use innerHTML here)\n const textNode = document.createTextNode(value); // never innerHTML\n parent.insertBefore(textNode, lastFirstChild);\n /* remove existing nodes */\n parent.removeChild(lastFirstChild);\n return textNode;\n}\nexport function castTextValue(value) {\n // mimic React skipping to display EXCEPT for true does display on page\n if ([undefined, false, null].includes(value)) { // || value === true\n return '';\n }\n return value;\n}\n","import { castTextValue, updateBeforeTemplate } from '../../updateBeforeTemplate.function.js';\nexport function processRegularValue(value, subject, // could be tag via subject.tag\ninsertBefore) {\n subject.insertBefore = insertBefore;\n const before = subject.clone || insertBefore; // Either the template is on the doc OR its the first element we last put on doc\n // matches but also was defined at some point\n if (subject.lastValue === value && 'lastValue' in subject) {\n return; // no need to update display, its the same\n }\n subject.lastValue = value;\n const castedValue = castTextValue(value);\n // replace existing string?\n const oldClone = subject.clone;\n if (oldClone) {\n oldClone.textContent = castedValue;\n return;\n }\n // Processing of regular values\n const clone = updateBeforeTemplate(castedValue, before);\n subject.clone = clone; // remember single element put down, for future updates\n}\nexport function processFirstRegularValue(value, subject, // could be tag via subject.tag\ninsertBefore) {\n subject.lastValue = value;\n const castedValue = castTextValue(value);\n // Processing of regular values\n const clone = updateBeforeTemplate(castedValue, insertBefore);\n subject.clone = clone; // remember single element put down, for future updates \n}\n","import { processSubjectComponent } from './processSubjectComponent.function.js';\nimport { processTagArray } from './processTagArray.js';\nimport { TemplaterResult } from '../TemplaterResult.class.js';\nimport { processFirstRegularValue } from './processRegularValue.function.js';\nimport { newTagSupportByTemplater, processTag, tagFakeTemplater } from './processTag.function.js';\nimport { getValueType } from './processFirstSubject.utils.js';\nimport { renderTagOnly } from '../render/renderTagOnly.function.js';\nimport { ValueTypes } from '../ValueTypes.enum.js';\nexport function processFirstSubjectValue(value, subject, // could be tag via result.tag\ninsertBefore, // <template end interpolate /> (will be removed)\nownerSupport, // owner\noptions) {\n const valueType = getValueType(value);\n switch (valueType) {\n case ValueTypes.templater:\n processTag(value, insertBefore, ownerSupport, subject);\n return;\n case ValueTypes.tag:\n const tag = value;\n let templater = tag.templater;\n if (!templater) {\n templater = tagFakeTemplater(tag);\n }\n processTag(templater, insertBefore, ownerSupport, subject);\n return;\n case ValueTypes.tagArray:\n return processTagArray(subject, value, insertBefore, ownerSupport, options);\n case ValueTypes.tagComponent:\n processSubjectComponent(value, subject, insertBefore, ownerSupport, options);\n return;\n case ValueTypes.function:\n const v = value;\n if (v.oneRender) {\n const tagSupport = oneRenderToTagSupport(v, subject, ownerSupport);\n renderTagOnly(tagSupport, tagSupport, subject, ownerSupport);\n processTag(tagSupport.templater, insertBefore, ownerSupport, subject);\n return;\n }\n break;\n }\n processFirstRegularValue(value, subject, insertBefore);\n}\nexport function oneRenderToTagSupport(wrapper, subject, ownerSupport) {\n const templater = new TemplaterResult([]);\n templater.tagJsType = 'oneRender';\n const tagSupport = newTagSupportByTemplater(templater, ownerSupport, subject);\n let tag;\n const wrap = () => {\n templater.tag = tag || (wrapper());\n return tagSupport;\n };\n templater.wrapper = wrap;\n wrap.parentWrap = wrap;\n wrap.oneRender = true;\n wrap.parentWrap.original = wrapper;\n return tagSupport;\n}\n","import { processAttribute } from './processAttribute.function.js';\nconst search = new RegExp('\\\\s*<template interpolate end id=\"__tagvar(\\\\d{1,4})\"([^>]*)></template>(\\\\s*)');\nexport function scanTextAreaValue(textarea, context, ownerSupport) {\n const value = textarea.value;\n if (value.search(search) >= 0) {\n const match = value.match(/__tagvar(\\d{1,4})/);\n const token = match ? match[0] : '';\n const dynamic = '{' + token + '}';\n textarea.value = '';\n textarea.setAttribute('text-var-value', dynamic);\n const howToSet = (_elm, _name, value) => textarea.value = value;\n processAttribute('text-var-value', dynamic, // realValue, // context[token].value,\n textarea, context, ownerSupport, howToSet);\n }\n}\n","import { deepEqual } from '../deepFunctions.js';\n/**\n *\n * @param props\n * @param pastCloneProps\n * @returns WHEN number then props have changed. WHEN false props have not changed\n */\nexport function hasPropChanges(props, // natural props\npastCloneProps) {\n /*\n const isCommonEqual = props === undefined && props === compareToProps\n if(isCommonEqual) {\n return false\n }\n */\n let castedProps = props;\n let castedPastProps = pastCloneProps;\n // check all prop functions match\n if (typeof (props) === 'object') {\n if (!pastCloneProps) {\n return 3;\n }\n // castedProps = {...props}\n castedProps = [...props];\n // castedPastProps = {...(pastCloneProps || {})}\n castedPastProps = [...(pastCloneProps || [])];\n const allFunctionsMatch = castedProps.every((value, index) => {\n let compare = castedPastProps[index];\n if (value && typeof (value) === 'object') {\n const subCastedProps = { ...value };\n const subCompareProps = { ...compare || {} };\n const matched = Object.entries(subCastedProps).every(([key, value]) => {\n return compareProps(value, subCompareProps[key], () => {\n delete subCastedProps[key]; // its a function and not needed to be compared\n delete subCompareProps[key]; // its a function and not needed to be compared\n });\n });\n return matched;\n }\n return compareProps(value, compare, () => {\n castedProps.splice(index, 1);\n castedPastProps.splice(index, 1);\n });\n });\n if (!allFunctionsMatch) {\n return 6; // a change has been detected by function comparisons\n }\n }\n // const isEqual = deepEqual(castedPastProps, castedProps)\n // return isEqual ? false : 7 // if equal then no changes\n return false;\n}\n/** returning a number means true good comparison */\nfunction compareProps(value, compare, onDelete) {\n if (!(value instanceof Function)) {\n return deepEqual(value, compare) ? 4 : false;\n }\n const compareFn = compare;\n if (!(compareFn instanceof Function)) {\n return false; // its a function now but was not before\n }\n // ensure we are comparing apples to apples as function get wrapped\n const compareOriginal = compare?.original;\n if (compareOriginal) {\n compare = compareOriginal;\n }\n const original = value.original;\n if (original) {\n value = value.original;\n }\n const valueString = value.toString();\n const compareString = compare.toString();\n if (valueString === compareString) {\n onDelete();\n return 3; // both are function the same\n }\n onDelete();\n return 5;\n}\n","import { hasPropChanges } from './hasPropChanges.function.js';\nexport function hasTagSupportChanged(oldTagSupport, newTagSupport, newTemplater) {\n const latestProps = newTemplater.props; // newTagSupport.propsConfig.latest\n const pastCloneProps = oldTagSupport.propsConfig.latestCloned;\n const propsChanged = hasPropChanges(latestProps, pastCloneProps);\n // if no changes detected, no need to continue to rendering further tags\n if (propsChanged) {\n return propsChanged;\n }\n const kidsChanged = hasKidsChanged(oldTagSupport, newTagSupport);\n // we already know props didn't change and if kids didn't either, than don't render\n return kidsChanged;\n}\nexport function hasKidsChanged(oldTagSupport, newTagSupport) {\n const oldCloneKidValues = oldTagSupport.propsConfig.lastClonedKidValues;\n const newClonedKidValues = newTagSupport.propsConfig.lastClonedKidValues;\n const everySame = oldCloneKidValues.every((set, index) => {\n const x = newClonedKidValues[index];\n return set.every((item, index) => item === x[index]);\n });\n return everySame ? false : 9;\n}\n","import { deepClone, deepEqual } from './deepFunctions.js';\nimport { isStaticTag } from './isInstance.js';\nimport { renderTagSupport } from './tag/render/renderTagSupport.function.js';\nimport { setUse } from './state/index.js';\nimport { getSupportInCycle } from './tag/getSupportInCycle.function.js';\n/* Used to rewrite props that are functions. When they are called it should cause parent rendering */\nexport function alterProps(props, ownerSupport) {\n const isPropTag = isStaticTag(props);\n const watchProps = isPropTag ? 0 : props;\n const newProps = resetFunctionProps(watchProps, ownerSupport);\n return newProps;\n}\nfunction resetFunctionProps(newProps, ownerSupport) {\n if (typeof (newProps) !== 'object' || !ownerSupport) {\n return newProps;\n }\n // BELOW: Do not clone because if first argument is object, the memory ref back is lost\n // const newProps = {...props} \n for (const name in newProps) {\n const value = newProps[name];\n if (!(value instanceof Function)) {\n continue;\n }\n const toCall = newProps[name].toCall;\n if (toCall) {\n continue; // already previously converted\n }\n newProps[name] = (...args) => newProps[name].toCall(...args); // what gets called can switch over parent state changes\n // Currently, call self but over parent state changes, I may need to call a newer parent tag owner\n newProps[name].toCall = (...args) => callbackPropOwner(value, args, ownerSupport);\n newProps[name].original = value;\n }\n return newProps;\n}\nexport function callbackPropOwner(toCall, callWith, ownerSupport) {\n // const renderCount = ownerSupport.global.renderCount\n const cycle = getSupportInCycle();\n const result = toCall(...callWith);\n const run = () => {\n const lastestOwner = ownerSupport.global.newest;\n if (cycle) {\n // appears a prop function was called sync/immediately so lets see if owner changed state\n const allMatched = lastestOwner.memory.state.every(state => {\n const lastValue = state.lastValue;\n const get = state.get();\n const equal = deepEqual(deepClone(lastValue), get);\n return equal;\n });\n if (allMatched) {\n return result; // owner did not change\n }\n }\n const newest = renderTagSupport(lastestOwner, true);\n lastestOwner.global.newest = newest;\n return result;\n };\n if (!cycle) {\n return run();\n }\n setUse.memory.tagClosed$.toCallback(run);\n return result;\n}\n","import { hasTagSupportChanged } from '../hasTagSupportChanged.function.js';\nimport { processSubjectComponent } from './processSubjectComponent.function.js';\nimport { destroyTagMemory } from '../destroyTag.function.js';\nimport { renderTagSupport } from '../render/renderTagSupport.function.js';\nimport { callbackPropOwner } from '../../alterProps.function.js';\nimport { isLikeTags } from '../isLikeTags.function.js';\nexport function updateExistingTagComponent(ownerSupport, tagSupport, // lastest\nsubject, insertBefore) {\n let lastSupport = subject.tagSupport?.global.newest; // || subject.tagSupport\n let oldestTag = lastSupport.global.oldest;\n const oldWrapper = lastSupport.templater.wrapper;\n const newWrapper = tagSupport.templater.wrapper;\n let isSameTag = false;\n if (oldWrapper && newWrapper) {\n const oldFunction = oldWrapper.parentWrap.original;\n const newFunction = newWrapper.parentWrap.original;\n // string compare both functions\n isSameTag = oldFunction === newFunction;\n }\n const templater = tagSupport.templater;\n if (!isSameTag) {\n const oldestSupport = lastSupport.global.oldest;\n destroyTagMemory(oldestSupport);\n return processSubjectComponent(templater, subject, insertBefore, ownerSupport, {\n counts: { added: 0, removed: 0 },\n });\n }\n else {\n const hasChanged = hasTagSupportChanged(lastSupport, tagSupport, templater);\n if (!hasChanged) {\n // if the new props are an object then implicitly since no change, the old props are an object\n const newProps = templater.props;\n syncFunctionProps(lastSupport, ownerSupport, newProps);\n return lastSupport; // its the same tag component\n }\n }\n const previous = lastSupport.global.newest;\n const newSupport = renderTagSupport(tagSupport, false);\n lastSupport = subject.tagSupport;\n const newOldest = newSupport.global.oldest;\n const hasOldest = newOldest ? true : false;\n if (!hasOldest) {\n return buildNewTag(newSupport, insertBefore, lastSupport, subject);\n }\n if (newOldest && templater.children._value.length) {\n const oldKidsSub = newOldest.templater.children;\n oldKidsSub.next(templater.children._value);\n }\n // detect if both the function is the same and the return is the same\n const isLikeTag = isSameTag && isLikeTags(previous, newSupport);\n if (isLikeTag) {\n subject.tagSupport = newSupport;\n oldestTag.updateBy(newSupport); // the oldest tag has element references\n return newSupport;\n }\n else {\n // Although function looked the same it returned a different html result\n if (isSameTag && lastSupport) {\n destroyTagMemory(lastSupport);\n newSupport.global.context = {}; // do not share previous outputs\n }\n oldestTag = undefined;\n }\n if (!oldestTag) {\n lastSupport = newSupport;\n buildNewTag(newSupport, lastSupport.global.insertBefore, lastSupport, subject);\n }\n lastSupport.global.newest = newSupport;\n return newSupport;\n}\nfunction buildNewTag(newSupport, oldInsertBefore, oldTagSupport, subject) {\n newSupport.buildBeforeElement(oldInsertBefore, {\n counts: { added: 0, removed: 0 },\n });\n newSupport.global.oldest = newSupport;\n newSupport.global.newest = newSupport;\n oldTagSupport.global.oldest = newSupport;\n oldTagSupport.global.newest = newSupport;\n subject.tagSupport = newSupport;\n return newSupport;\n}\nfunction syncFunctionProps(lastSupport, ownerSupport, newPropsArray) {\n lastSupport = lastSupport.global.newest || lastSupport;\n const priorPropConfig = lastSupport.propsConfig;\n const priorPropsArray = priorPropConfig.latestCloned;\n const prevSupport = ownerSupport.global.newest;\n for (let index = newPropsArray.length - 1; index >= 0; --index) {\n const argPosition = newPropsArray[index];\n if (typeof (argPosition) !== 'object') {\n return;\n }\n const priorProps = priorPropsArray[index];\n if (typeof (priorProps) !== 'object') {\n return;\n }\n for (const name in argPosition) {\n const value = argPosition[name];\n if (!(value instanceof Function)) {\n continue;\n }\n const newCallback = argPosition[name]; // || value\n const original = newCallback instanceof Function && newCallback.toCall;\n if (original) {\n continue; // already previously converted\n }\n // Currently, call self but over parent state changes, I may need to call a newer parent tag owner\n priorProps[name].toCall = (...args) => {\n return callbackPropOwner(newCallback, // value, // newOriginal,\n args, prevSupport);\n };\n }\n }\n}\n","import { TagSupport } from '../TagSupport.class.js';\nimport { TemplaterResult } from '../TemplaterResult.class.js';\nimport { isTagClass, isTagTemplater } from '../../isInstance.js';\nimport { getValueType } from './processFirstSubject.utils.js';\nimport { processTagArray } from './processTagArray.js';\nimport { updateExistingTagComponent } from './updateExistingTagComponent.function.js';\nimport { processRegularValue } from './processRegularValue.function.js';\nimport { checkDestroyPrevious, restoreTagMarker } from '../checkDestroyPrevious.function.js';\nimport { processSubjectComponent } from './processSubjectComponent.function.js';\nimport { isLikeTags } from '../isLikeTags.function.js';\nimport { setupNewTemplater, getFakeTemplater, processTag } from './processTag.function.js';\nimport { swapInsertBefore } from '../setTagPlaceholder.function.js';\nimport { ValueTypes } from '../ValueTypes.enum.js';\nexport function updateExistingValue(subject, value, ownerSupport, insertBefore) {\n const subjectTag = subject;\n const valueType = getValueType(value);\n checkDestroyPrevious(subject, value, insertBefore, valueType);\n // handle already seen tag components\n if (valueType === ValueTypes.tagComponent) {\n return prepareUpdateToComponent(value, subjectTag, insertBefore, ownerSupport);\n }\n // was component but no longer\n const tagSupport = subjectTag.tagSupport;\n if (tagSupport) {\n if (valueType === ValueTypes.function) {\n return subjectTag; // its a oneRender tag\n }\n handleStillTag(subject, value, ownerSupport);\n return subjectTag;\n }\n switch (valueType) {\n case ValueTypes.tagArray:\n processTagArray(subject, value, insertBefore, // oldInsertBefore as InsertBefore,\n ownerSupport, { counts: {\n added: 0,\n removed: 0,\n } });\n return subject;\n case ValueTypes.templater:\n processTag(value, insertBefore, ownerSupport, subjectTag);\n return subjectTag;\n case ValueTypes.tag:\n const tag = value;\n let templater = tag.templater;\n if (!templater) {\n templater = getFakeTemplater();\n tag.templater = templater;\n templater.tag = tag;\n }\n processTag(templater, insertBefore, ownerSupport, subjectTag);\n return subjectTag;\n case ValueTypes.subject:\n return value;\n // now its a useless function (we don't automatically call functions)\n case ValueTypes.function:\n if (!subject.clone) {\n subject.clone = swapInsertBefore(insertBefore);\n }\n return subject;\n }\n // This will cause all other values to render\n processRegularValue(value, subject, insertBefore);\n return subjectTag;\n}\nfunction handleStillTag(subject, value, ownerSupport) {\n const lastSupport = subject.tagSupport;\n let templater = value;\n const isClass = isTagClass(value);\n if (isClass) {\n const tag = value;\n templater = tag.templater;\n if (!templater) {\n templater = new TemplaterResult([]);\n templater.tag = tag;\n tag.templater = templater;\n }\n }\n const valueSupport = new TagSupport(templater, ownerSupport, subject);\n if (isClass) {\n valueSupport.global = lastSupport.global;\n }\n const isSameTag = value && isLikeTags(lastSupport, valueSupport);\n if (isTagTemplater(value)) {\n setupNewTemplater(valueSupport, ownerSupport, subject);\n }\n if (isSameTag) {\n lastSupport.updateBy(valueSupport);\n return;\n }\n if (isSameTag) {\n // const subjectTag = subject as TagSubject\n const global = lastSupport.global;\n const insertBefore = global.insertBefore;\n return processTag(templater, insertBefore, ownerSupport, subject);\n }\n return processRegularValue(value, subject, subject.insertBefore);\n}\nfunction prepareUpdateToComponent(templater, subjectTag, insertBefore, ownerSupport) {\n // When last value was not a component\n if (!subjectTag.tagSupport) {\n processSubjectComponent(templater, subjectTag, insertBefore, // oldInsertBefore as InsertBefore,\n ownerSupport, {\n counts: { added: 0, removed: 0 },\n });\n return subjectTag;\n }\n const tagSupport = new TagSupport(templater, ownerSupport, subjectTag);\n const subjectSup = subjectTag.tagSupport;\n const prevSupport = subjectSup.global.newest;\n if (prevSupport) {\n const newestState = prevSupport.memory.state;\n tagSupport.memory.state.length = 0;\n tagSupport.memory.state.push(...newestState);\n }\n else {\n restoreTagMarker(subjectSup);\n processSubjectComponent(templater, subjectTag, insertBefore, ownerSupport, {\n counts: { added: 0, removed: 0 },\n });\n return subjectTag;\n }\n tagSupport.global = subjectSup.global;\n subjectTag.tagSupport = tagSupport;\n updateExistingTagComponent(ownerSupport, tagSupport, // latest value\n subjectTag, insertBefore);\n return subjectTag;\n}\n","import { variablePrefix } from '../tag/Tag.class.js';\nimport { elementInitCheck } from './elementInitCheck.js';\nimport { processFirstSubjectValue } from '../tag/update/processFirstSubjectValue.function.js';\nimport { isTagArray, isTagComponent } from '../isInstance.js';\nimport { scanTextAreaValue } from './scanTextAreaValue.function.js';\nimport { updateExistingValue } from '../tag/update/updateExistingValue.function.js';\nimport { swapInsertBefore } from '../tag/setTagPlaceholder.function.js';\nexport function interpolateTemplate(insertBefore, // <template end interpolate /> (will be removed)\ncontext, // variable scope of {`__tagvar${index}`:'x'}\nownerSupport, // Tag class\ncounts, // used for animation stagger computing\noptions) {\n // TODO: THe clones array is useless here\n const clones = [];\n if (!insertBefore.hasAttribute('end')) {\n return { clones }; // only care about <template end>\n }\n const variableName = insertBefore.getAttribute('id');\n if (variableName?.substring(0, variablePrefix.length) !== variablePrefix) {\n return { clones }; // ignore, not a tagVar\n }\n const existingSubject = context[variableName];\n const isDynamic = isTagComponent(existingSubject._value) || isTagArray(existingSubject.value);\n // process dynamics later\n if (isDynamic) {\n return {\n clones,\n tagComponent: {\n variableName,\n ownerSupport,\n subject: existingSubject,\n insertBefore\n }\n };\n }\n subscribeToTemplate(insertBefore, existingSubject, ownerSupport, counts);\n return { clones };\n}\nexport function subscribeToTemplate(insertBefore, subject, ownerSupport, counts) {\n let called = false;\n const onValue = (value) => {\n if (called) {\n updateExistingValue(subject, value, ownerSupport, insertBefore);\n return;\n }\n const templater = value;\n processFirstSubjectValue(templater, subject, insertBefore, ownerSupport, {\n counts: { ...counts },\n });\n called = true;\n };\n let mutatingCallback = onValue;\n const callback = (value) => mutatingCallback(value);\n const sub = subject.subscribe(callback);\n // on subscribe, the Subject did NOT emit immediately. Lets pull the template off the document\n if (insertBefore.parentNode) {\n const clone = subject.clone = swapInsertBefore(insertBefore);\n mutatingCallback = v => {\n const parentNode = clone.parentNode;\n parentNode.insertBefore(insertBefore, clone);\n parentNode.removeChild(clone);\n delete subject.clone;\n mutatingCallback = onValue; // all future calls will just produce value\n onValue(v); // calls for rending\n };\n }\n ownerSupport.global.subscriptions.push(sub);\n}\nexport function afterElmBuild(elm, options, context, ownerSupport) {\n if (!elm.getAttribute) {\n return;\n }\n const tagName = elm.nodeName; // elm.tagName\n if (tagName === 'TEXTAREA') {\n scanTextAreaValue(elm, context, ownerSupport);\n }\n let diff = options.counts.added;\n diff = elementInitCheck(elm, options.counts) - diff;\n if (elm.children) {\n const children = elm.children;\n for (let index = children.length - 1; index >= 0; --index) {\n const child = children[index];\n const subOptions = {\n ...options,\n counts: options.counts,\n };\n return afterElmBuild(child, subOptions, context, ownerSupport);\n }\n }\n}\n","export function elementInitCheck(nextSibling, counts) {\n const onInitDoubleWrap = nextSibling.oninit;\n if (!onInitDoubleWrap) {\n return counts.added;\n }\n const onInitWrap = onInitDoubleWrap.tagFunction;\n if (!onInitWrap) {\n return counts.added;\n }\n const onInit = onInitWrap.tagFunction;\n if (!onInit) {\n return counts.added;\n }\n const event = { target: nextSibling, stagger: counts.added };\n onInit(event);\n return ++counts.added;\n}\n","import { interpolateTemplate } from './interpolateTemplate.js';\nexport function interpolateContentTemplates(context, tagSupport, options, children) {\n // counting for animation stagger computing\n const counts = options.counts;\n const clones = [];\n const tagComponents = [];\n const childLength = children.length;\n for (let index = childLength - 1; index >= 0; --index) {\n const child = children[index];\n const { clones: nextClones, tagComponent } = interpolateTemplate(child, context, tagSupport, counts, options);\n clones.push(...nextClones);\n if (tagComponent) {\n tagComponents.push(tagComponent);\n continue;\n }\n if (child.children) {\n for (let index = child.children.length - 1; index >= 0; --index) {\n const subChild = child.children[index];\n // IF <template end /> its a variable to be processed\n if (isRenderEndTemplate(subChild)) {\n const { tagComponent } = interpolateTemplate(subChild, context, tagSupport, counts, options);\n if (tagComponent) {\n tagComponents.push(tagComponent);\n }\n }\n const { clones: nextClones, tagComponents: nextTagComponent } = interpolateContentTemplates(context, tagSupport, options, subChild.children);\n clones.push(...nextClones);\n tagComponents.push(...nextTagComponent);\n }\n }\n }\n return { clones, tagComponents };\n}\nfunction isRenderEndTemplate(child) {\n const isTemplate = child.tagName === 'TEMPLATE';\n return isTemplate &&\n child.getAttribute('interpolate') !== undefined &&\n child.getAttribute('end') !== undefined;\n}\n","import { interpolateAttributes } from './interpolateAttributes.js';\nimport { interpolateToTemplates } from './interpolations.js';\nimport { interpolateContentTemplates } from './interpolateContentTemplates.js';\nimport { escapeSearch, variablePrefix } from '../tag/Tag.class.js';\n/** Review elements within an element */\nexport function interpolateElement(container, // element containing innerHTML to review interpolations\ncontext, // variables used to evaluate\ninterpolatedTemplates, ownerSupport, options) {\n const clones = [];\n const tagComponents = [];\n const result = interpolatedTemplates.interpolation;\n const template = container.children[0];\n const children = template.content.children;\n if (result.keys.length) {\n const { clones: nextClones, tagComponents: nextTagComponents } = interpolateContentTemplates(context, ownerSupport, options, children);\n clones.push(...nextClones);\n tagComponents.push(...nextTagComponents);\n }\n interpolateAttributes(template, context, ownerSupport);\n processChildrenAttributes(children, context, ownerSupport);\n return { clones, tagComponents };\n}\nfunction processChildrenAttributes(children, context, ownerSupport) {\n for (let index = children.length - 1; index >= 0; --index) {\n const child = children[index];\n interpolateAttributes(child, context, ownerSupport);\n if (child.children) {\n processChildrenAttributes(child.children, context, ownerSupport);\n }\n }\n}\nexport function interpolateString(string) {\n const result = interpolateToTemplates(string);\n result.string = result.string.replace(escapeSearch, variablePrefix);\n return result;\n}\n","import { buildClones } from '../render.js';\nimport { afterElmBuild } from './interpolateTemplate.js';\nexport function afterInterpolateElement(container, insertBefore, tagSupport, context, options) {\n const clones = buildClones(container, insertBefore);\n if (!clones.length) {\n return clones;\n }\n for (let index = clones.length - 1; index >= 0; --index) {\n const clone = clones[index];\n afterElmBuild(clone, options, context, tagSupport);\n tagSupport.clones.push(clone);\n }\n return clones;\n}\n","export function buildClones(temporary, insertBefore) {\n const clones = [];\n const template = temporary.children[0];\n let nextSibling = template.content.firstChild;\n const fragment = document.createDocumentFragment();\n while (nextSibling) {\n const nextNextSibling = nextSibling.nextSibling;\n clones.push(nextSibling);\n fragment.appendChild(nextSibling);\n nextSibling = nextNextSibling;\n }\n if (insertBefore.parentNode) {\n const parentNode = insertBefore.parentNode;\n parentNode.insertBefore(fragment, insertBefore);\n }\n return clones;\n}\n","import { escapeVariable, variablePrefix } from './Tag.class.js';\nimport { deepClone } from '../deepFunctions.js';\nimport { isTagComponent } from '../isInstance.js';\nimport { cloneValueArray } from './cloneValueArray.function.js';\nimport { restoreTagMarker } from './checkDestroyPrevious.function.js';\nimport { runBeforeDestroy } from './tagRunner.js';\nimport { getChildTagsToDestroy } from './destroy.support.js';\nimport { elementDestroyCheck } from './elementDestroyCheck.function.js';\nimport { updateContextItem } from './update/updateContextItem.function.js';\nimport { processNewValue } from './update/processNewValue.function.js';\nimport { setTagPlaceholder } from './setTagPlaceholder.function.js';\nimport { interpolateElement, interpolateString } from '../interpolations/interpolateElement.js';\nimport { subscribeToTemplate } from '../interpolations/interpolateTemplate.js';\nimport { afterInterpolateElement } from '../interpolations/afterInterpolateElement.function.js';\nconst prefixSearch = new RegExp(variablePrefix, 'g');\n/** used only for apps, otherwise use TagSupport */\nexport class BaseTagSupport {\n templater;\n subject;\n isApp = true;\n appElement; // only seen on this.getAppTagSupport().appElement\n strings;\n values;\n propsConfig;\n // stays with current render\n memory = {\n state: [],\n };\n clones = []; // elements on document. Needed at destroy process to know what to destroy\n // travels with all rerenderings\n global = {\n context: {}, // populated after reading interpolated.values array converted to an object {variable0, variable:1}\n providers: [],\n /** Indicator of re-rending. Saves from double rending something already rendered */\n renderCount: 0,\n deleted: false,\n subscriptions: [],\n };\n hasLiveElements = false;\n childTags = []; // tags on me\n constructor(templater, subject) {\n this.templater = templater;\n this.subject = subject;\n const children = templater.children; // children tags passed in as arguments\n const kidValue = children.value;\n const props = templater.props; // natural props\n const latestCloned = props.map(props => deepClone(props));\n this.propsConfig = {\n latest: props,\n latestCloned, // assume its HTML children and then detect\n lastClonedKidValues: kidValue.map(kid => {\n const cloneValues = cloneValueArray(kid.values);\n return cloneValues;\n })\n };\n }\n /** Function that kicks off actually putting tags down as HTML elements */\n buildBeforeElement(insertBefore, options = {\n counts: { added: 0, removed: 0 },\n }) {\n const subject = this.subject;\n const global = this.global;\n global.insertBefore = insertBefore;\n if (!global.placeholder) {\n setTagPlaceholder(global);\n }\n const placeholderElm = global.placeholder;\n global.oldest = this;\n global.newest = this;\n subject.tagSupport = this;\n this.hasLiveElements = true;\n const context = this.update();\n const template = this.getTemplate();\n const elementContainer = document.createDocumentFragment();\n const tempDraw = document.createElement('template');\n tempDraw.innerHTML = template.string;\n elementContainer.appendChild(tempDraw);\n // Search/replace innerHTML variables but don't interpolate tag components just yet\n const { tagComponents } = interpolateElement(elementContainer, context, template, this, // ownerSupport,\n {\n counts: options.counts\n });\n afterInterpolateElement(elementContainer, placeholderElm, this, // ownerSupport\n context, options);\n // Any tag components that were found should be processed AFTER the owner processes its elements. Avoid double processing of elements attributes like (oninit)=${}\n const length = tagComponents.length;\n for (let index = 0; index < length; ++index) {\n const tagComponent = tagComponents[index];\n subscribeToTemplate(tagComponent.insertBefore, tagComponent.subject, tagComponent.ownerSupport, options.counts);\n afterInterpolateElement(elementContainer, tagComponent.insertBefore, tagComponent.ownerSupport, context, options);\n }\n }\n getTemplate() {\n const thisTag = this.templater.tag;\n const strings = this.strings || thisTag.strings;\n const values = this.values || thisTag.values;\n const string = strings.map((string, index) => {\n const safeString = string.replace(prefixSearch, escapeVariable);\n const endString = safeString + (values.length > index ? `{${variablePrefix}${index}}` : '');\n const trimString = endString.replace(/>\\s*/g, '>').replace(/\\s*</g, '<');\n return trimString;\n }).join('');\n const interpolation = interpolateString(string);\n return {\n interpolation,\n string: interpolation.string,\n strings,\n values,\n context: this.global.context || {},\n };\n }\n update() {\n return this.updateContext(this.global.context);\n }\n updateContext(context) {\n const thisTag = this.templater.tag;\n const strings = this.strings || thisTag.strings;\n const values = this.values || thisTag.values;\n strings.map((_string, index) => {\n const hasValue = values.length > index;\n if (!hasValue) {\n return;\n }\n const variableName = variablePrefix + index;\n const value = values[index];\n // is something already there?\n const exists = variableName in context;\n if (exists) {\n return updateContextItem(context, variableName, value);\n }\n // 🆕 First time values below\n context[variableName] = processNewValue(value, this);\n });\n return context;\n }\n updateBy(tagSupport) {\n const tempTag = tagSupport.templater.tag;\n this.updateConfig(tempTag.strings, tempTag.values);\n }\n updateConfig(strings, values) {\n this.strings = strings;\n this.updateValues(values);\n }\n updateValues(values) {\n this.values = values;\n return this.updateContext(this.global.context);\n }\n}\nexport class TagSupport extends BaseTagSupport {\n templater;\n ownerTagSupport;\n subject;\n version;\n isApp = false;\n constructor(templater, // at runtime rendering of a tag, it needs to be married to a new TagSupport()\n ownerTagSupport, subject, version = 0) {\n super(templater, subject);\n this.templater = templater;\n this.ownerTagSupport = ownerTagSupport;\n this.subject = subject;\n this.version = version;\n }\n destroy(options = {\n stagger: 0,\n byParent: false, // Only destroy clones of direct children\n }) {\n const firstDestroy = !options.byParent;\n const global = this.global;\n const subject = this.subject;\n const childTags = options.byParent ? [] : getChildTagsToDestroy(this.childTags);\n if (firstDestroy && isTagComponent(this.templater)) {\n runBeforeDestroy(this, this);\n }\n this.destroySubscriptions();\n // signify immediately child has been deleted (looked for during event processing)\n for (let index = childTags.length - 1; index >= 0; --index) {\n const child = childTags[index];\n const subGlobal = child.global;\n delete subGlobal.newest;\n subGlobal.deleted = true;\n if (isTagComponent(child.templater)) {\n runBeforeDestroy(child, child);\n }\n }\n // HTML DOM manipulation. Put back down the template tag\n const insertBefore = global.insertBefore;\n if (insertBefore.nodeName === 'TEMPLATE') {\n const placeholder = global.placeholder;\n if (placeholder && !('arrayValue' in this.memory)) {\n if (!options.byParent) {\n restoreTagMarker(this);\n }\n }\n }\n let mainPromise;\n if (this.ownerTagSupport) {\n this.ownerTagSupport.childTags = this.ownerTagSupport.childTags.filter(child => child !== this);\n }\n if (firstDestroy) {\n const { stagger, promise } = this.destroyClones(options);\n options.stagger = stagger;\n if (promise) {\n mainPromise = promise;\n }\n }\n else {\n this.destroyClones();\n }\n // data reset\n delete global.placeholder;\n global.context = {};\n delete global.oldest;\n delete global.newest;\n global.deleted = true;\n this.childTags.length = 0;\n this.hasLiveElements = false;\n delete subject.tagSupport;\n if (mainPromise) {\n mainPromise = mainPromise.then(async () => {\n const promises = childTags.map(kid => kid.destroy({ stagger: 0, byParent: true }));\n return Promise.all(promises);\n });\n }\n else {\n mainPromise = Promise.all(childTags.map(kid => kid.destroy({ stagger: 0, byParent: true })));\n }\n return mainPromise.then(() => options.stagger);\n }\n destroySubscriptions() {\n const subs = this.global.subscriptions;\n for (let index = subs.length - 1; index >= 0; --index) {\n subs[index].unsubscribe();\n }\n subs.length = 0;\n }\n destroyClones({ stagger } = {\n stagger: 0,\n }) {\n const oldClones = [...this.clones];\n this.clones.length = 0; // tag maybe used for something else\n const promises = oldClones.map(clone => this.checkCloneRemoval(clone, stagger)).filter(x => x); // only return promises\n // check subjects that may have clones attached to them\n const oldContext = this.global.context;\n for (const name in oldContext) {\n const value = oldContext[name];\n const clone = value.clone;\n if (clone?.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n }\n if (promises.length) {\n return { promise: Promise.all(promises), stagger };\n }\n return { stagger };\n }\n /** Reviews elements for the presences of ondestroy */\n checkCloneRemoval(clone, stagger) {\n let promise;\n const customElm = clone;\n if (customElm.ondestroy) {\n promise = elementDestroyCheck(customElm, stagger);\n }\n const next = () => {\n const parentNode = clone.parentNode;\n if (parentNode) {\n parentNode.removeChild(clone);\n }\n const ownerSupport = this.ownerTagSupport;\n if (ownerSupport) {\n // Sometimes my clones were first registered to my owner, remove them from owner\n ownerSupport.clones = ownerSupport.clones.filter(compareClone => compareClone !== clone);\n }\n };\n if (promise instanceof Promise) {\n return promise.then(next);\n }\n else {\n next();\n }\n return promise;\n }\n getAppTagSupport() {\n let tag = this;\n while (tag.ownerTagSupport) {\n tag = tag.ownerTagSupport;\n }\n return tag;\n }\n}\nfunction restoreTagMarkers(support) {\n restoreTagMarker(support);\n const childTags = support.childTags;\n for (let index = childTags.length - 1; index >= 0; --index) {\n restoreTagMarkers(childTags[index].global.oldest);\n }\n}\n","import { isSubjectInstance, isTagComponent } from '../../isInstance.js';\nimport { TagSupport } from '../TagSupport.class.js';\nexport function updateContextItem(context, variableName, value) {\n const subject = context[variableName];\n const tagSubject = subject;\n const tagSupport = tagSubject.tagSupport;\n if (tagSupport) {\n if (value) {\n if (isTagComponent(value)) {\n const templater = value;\n let newSupport = new TagSupport(templater, tagSupport.ownerTagSupport, subject);\n // TODO: Need to review if this is used\n if (isTagComponent(tagSupport)) {\n console.warn('👉 deprecated code is being used #shareTemplaterGlobal 👈');\n shareTemplaterGlobal(tagSupport, newSupport);\n }\n }\n }\n }\n if (isSubjectInstance(value)) {\n return; // emits on its own\n }\n // listeners will evaluate updated values to possibly update display(s)\n subject.next(value);\n return;\n}\nfunction shareTemplaterGlobal(oldTagSupport, tagSupport) {\n const oldTemp = oldTagSupport.templater;\n const oldWrap = oldTemp.wrapper; // tag versus component\n const oldValueFn = oldWrap.parentWrap.original;\n const templater = tagSupport.templater;\n const newWrapper = templater.wrapper;\n const newValueFn = newWrapper?.parentWrap.original;\n const fnMatched = oldValueFn === newValueFn;\n if (fnMatched) {\n tagSupport.global = oldTagSupport.global;\n const newest = oldTagSupport.global.newest;\n if (newest) {\n const prevState = newest.memory.state;\n tagSupport.memory.state.length = 0;\n tagSupport.memory.state.push(...prevState);\n // tagSupport.memory.state = [...prevState]\n }\n }\n}\n","export function elementDestroyCheck(nextSibling, stagger) {\n const onDestroyDoubleWrap = nextSibling.ondestroy;\n if (!onDestroyDoubleWrap) {\n return;\n }\n const onDestroyWrap = onDestroyDoubleWrap.tagFunction;\n if (!onDestroyWrap) {\n return;\n }\n const onDestroy = onDestroyWrap.tagFunction;\n if (!onDestroy) {\n return;\n }\n const event = { target: nextSibling, stagger };\n return onDestroy(event);\n}\n","import { setUse } from '../state/index.js';\nimport { TemplaterResult } from './TemplaterResult.class.js';\nimport { tags } from './tag.utils.js';\nimport { getTagWrap } from './getTagWrap.function.js';\nimport { ValueTypes } from './ValueTypes.enum.js';\nlet tagCount = 0;\n/** Wraps a function tag in a state manager and calls wrapped function on event cycles\n * For single rendering, no event cycles, use: tag.renderOnce = (props) => html``\n */\nexport function tag(tagComponent) {\n /** function developer triggers */\n const parentWrap = (function tagWrapper(...props) {\n const templater = new TemplaterResult(props);\n templater.tagJsType = ValueTypes.tagComponent;\n // attach memory back to original function that contains developer display logic\n const innerTagWrap = getTagWrap(templater, parentWrap);\n if (!innerTagWrap.parentWrap) {\n innerTagWrap.parentWrap = parentWrap;\n }\n templater.tagged = true;\n templater.wrapper = innerTagWrap;\n return templater;\n }) // we override the function provided and pretend original is what's returned\n ;\n parentWrap.original = tagComponent;\n parentWrap.compareTo = tagComponent.toString();\n const tag = tagComponent;\n parentWrap.isTag = true;\n parentWrap.original = tag;\n // group tags together and have hmr pickup\n tag.tags = tags;\n tag.setUse = setUse;\n tag.tagIndex = tagCount++; // needed for things like HMR\n tags.push(parentWrap);\n return parentWrap;\n}\n/** Used to create a tag component that renders once and has no addition rendering cycles */\ntag.oneRender = (...props) => {\n throw new Error('Do not call function tag.oneRender but instead set it as: `(props) => tag.oneRender = (state) => html`` `');\n};\n/** Use to structure and define a browser tag route handler\n * Example: export default tag.route = (routeProps: RouteProps) => (state) => html``\n */\ntag.route = (routeProps) => {\n throw new Error('Do not call function tag.route but instead set it as: `tag.route = (routeProps: RouteProps) => (state) => html`` `');\n};\n/** Use to structure and define a browser tag route handler\n * Example: export default tag.route = (routeProps: RouteProps) => (state) => html``\n */\ntag.app = (routeTag) => {\n throw new Error('Do not call function tag.route but instead set it as: `tag.route = (routeProps: RouteProps) => (state) => html`` `');\n};\nObject.defineProperty(tag, 'oneRender', {\n set(oneRenderFunction) {\n oneRenderFunction.oneRender = true;\n },\n});\n","import { runTagCallback } from '../interpolations/bindSubjectCallback.function.js';\nimport { deepClone } from '../deepFunctions.js';\nimport { TagSupport } from './TagSupport.class.js';\nimport { alterProps } from '../alterProps.function.js';\n/** creates/returns a function that when called then calls the original component function\n * Gets used as templater.wrapper()\n */\nexport function getTagWrap(templater, result) {\n // this function gets called by taggedjs\n const wrapper = function (newTagSupport, subject) {\n const global = newTagSupport.global;\n ++global.renderCount;\n const childSubject = templater.children;\n const lastArray = global.oldest?.templater.children.lastArray;\n if (lastArray) {\n childSubject.lastArray = lastArray;\n }\n // result.original\n const originalFunction = result.original; // (innerTagWrap as any).original as unknown as TagComponent\n let props = templater.props;\n let castedProps = props.map(props => alterProps(props, newTagSupport.ownerTagSupport));\n const latestCloned = props.map(props => deepClone(props)); // castedProps\n // CALL ORIGINAL COMPONENT FUNCTION\n let tag = originalFunction(...castedProps);\n if (tag instanceof Function) {\n tag = tag();\n }\n tag.templater = templater;\n templater.tag = tag;\n const tagSupport = new TagSupport(templater, newTagSupport.ownerTagSupport, subject, global.renderCount);\n tagSupport.global = global;\n tagSupport.propsConfig = {\n latest: props,\n latestCloned,\n lastClonedKidValues: tagSupport.propsConfig.lastClonedKidValues,\n };\n tagSupport.memory = newTagSupport.memory; // state handover\n if (templater.madeChildIntoSubject) {\n const value = childSubject.value;\n for (let index = value.length - 1; index >= 0; --index) {\n const kid = value[index];\n const values = kid.values;\n for (let index = values.length - 1; index >= 0; --index) {\n const value = values[index];\n if (!(value instanceof Function)) {\n continue;\n }\n const valuesValue = kid.values[index];\n if (valuesValue.isChildOverride) {\n continue; // already overwritten\n }\n // all functions need to report to me\n kid.values[index] = function (...args) {\n const ownerSupport = tagSupport.ownerTagSupport;\n return runTagCallback(value, // callback\n ownerSupport, this, // bindTo\n args);\n };\n valuesValue.isChildOverride = true;\n }\n }\n }\n return tagSupport;\n };\n return wrapper;\n}\n","import { Tag } from './Tag.class.js';\nexport function html(strings, ...values) {\n return new Tag(strings, values);\n}\n","import { BaseTagSupport } from './TagSupport.class.js';\nimport { runAfterRender, runBeforeRender } from './tagRunner.js';\nimport { ValueSubject } from '../subject/ValueSubject.js';\nconst appElements = [];\n/**\n *\n * @param app taggedjs tag\n * @param element HTMLElement\n * @param props object\n * @returns\n */\nexport function tagElement(app, // (...args: unknown[]) => TemplaterResult,\nelement, props) {\n const appElmIndex = appElements.findIndex(appElm => appElm.element === element);\n if (appElmIndex >= 0) {\n appElements[appElmIndex].tagSupport.destroy();\n appElements.splice(appElmIndex, 1);\n // an element already had an app on it\n console.warn('Found and destroyed app element already rendered to element', { element });\n }\n // Create the app which returns [props, runOneTimeFunction]\n const wrapper = app(props);\n // have a function setup and call the tagWrapper with (props, {update, async, on})\n const tagSupport = runWrapper(wrapper);\n // TODO: is the below needed?\n tagSupport.appElement = element;\n tagSupport.isApp = true;\n tagSupport.global.isApp = true;\n const templateElm = document.createElement('template');\n templateElm.setAttribute('id', 'app-tag-' + appElements.length);\n templateElm.setAttribute('app-tag-detail', appElements.length.toString());\n const fragment = document.createDocumentFragment();\n fragment.appendChild(templateElm);\n element.destroy = async () => {\n await tagSupport.destroy();\n const insertBefore = tagSupport.global.insertBefore;\n const parentNode = insertBefore.parentNode;\n parentNode.removeChild(insertBefore);\n };\n tagSupport.buildBeforeElement(templateElm);\n tagSupport.global.oldest = tagSupport;\n tagSupport.global.newest = tagSupport;\n element.setUse = app.original.setUse;\n appElements.push({ element, tagSupport });\n element.appendChild(fragment);\n return {\n tagSupport,\n tags: app.original.tags,\n };\n}\nexport function runWrapper(templater) {\n let newSupport = {};\n const subject = new ValueSubject(newSupport);\n newSupport = new BaseTagSupport(templater, subject);\n subject.next(templater);\n subject.tagSupport = newSupport;\n runBeforeRender(newSupport, undefined);\n // Call the apps function for our tag templater\n const wrapper = templater.wrapper;\n const tagSupport = wrapper(newSupport, subject);\n runAfterRender(newSupport, tagSupport);\n return tagSupport;\n}\n","export * from './tag/index.js';\nexport * from './errors.js';\nexport * from './isInstance.js';\nexport * from './state/index.js';\nexport * from './subject/index.js';\nexport * from './tag/TagSupport.class.js';\nexport * from './interpolations/ElementTargetEvent.interface.js';\nexport * from './interpolations/interpolateElement.js';\nexport { tagElement } from './tag/tagElement.js';\nexport { Tag, variablePrefix } from './tag/Tag.class.js';\nexport { runBeforeRender } from './tag/tagRunner.js';\nexport { renderTagSupport } from './tag/render/renderTagSupport.function.js';\nexport { renderWithSupport } from './tag/render/renderWithSupport.function.js';\nexport { isLikeValueSets } from './tag/isLikeTags.function.js';\nimport { renderTagOnly } from './tag/render/renderTagOnly.function.js';\nimport { renderTagSupport } from './tag/render/renderTagSupport.function.js';\nimport { renderWithSupport } from './tag/render/renderWithSupport.function.js';\nimport { tagElement } from './tag/tagElement.js';\nexport const hmr = {\n tagElement, renderWithSupport, renderTagSupport,\n renderTagOnly,\n};\n"],"names":["ValueTypes","__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","RouteQuery","name","isStaticTag","value","tag","templater","includes","tagJsType","isTagTemplater","isTagComponent","tagComponent","isTagClass","isSubjectInstance","subject","isSubject","subscribe","isTagArray","Array","every","x","combineLatest","subjects","output","Subject","subscribeWith","callback","valuesSeen","values","setValue","index","length","subscription","clones","shift","subscriptions","map","runPipedMethods","methods","onComplete","cloneMethods","firstMethod","next","newValue","handler","methodResponse","setHandler","onSubscription","subscribers","_value","set","constructor","this","defineValueOn","countSubject","globalSubCount$","unsubscribe","findIndex","sub","splice","removeSubFromArray","add","push","getSubscription","orgCallback","lastValue","count","emit","subs","toPromise","Promise","res","toCallback","pipe","operations","setMethods","all","args","arg","static","ValueSubject","super","willCallback","utils","willPromise","then","willSubscribe","getSupportInCycle","setUse","memory","stateConfig","tagSupport","use","useMe","beforeRender","beforeRedraw","afterRender","beforeDestroy","tagUse","TagError","Error","details","message","errorCode","ArrayNoKeyError","StateMismatchError","SyncCallbackError","array","state","config","rearray","stateLength","getStateValue","initState","defaultValue","checkValue","oldState","StateEchoBack","getCallbackValue","toString","JSON","stringify","console","error","wrapper","oldStates","newStates","tagFunction","parentWrap","original","warn","item","syncStates","stateFrom","stateTo","fromValue","getSetMethod","restate","oldValue","initValue","Function","newState","global","newest","result","watch","currentValues","setupWatch","defaultFinally","init","before","final","previous","pastResult","undefined","previousValues","defineOnMethod","getWatch","attachTo","setup","oldWatch","method","originalState","setTo","oldestState","nowTagSupport","letState","makeStateResult","y","letProp","getSetProp","myProp","deepClone","makeDeepClone","WeakMap","visited","has","Date","RegExp","clone","isArray","create","getPrototypeOf","i","deepEqual","obj1","obj2","isDeepEqual","fn0","fn1","getTime","isArrayDeepEqual","keys1","keys","keys2","isObjectDeepEqual","newWatch","providerConfig","providers","ownerSupport","constructMethod","stateDiffMemory","stateDiff","provider","oldStateCount","instance","cm","compareTo","inject","owner","ownerTagSupport","find","msg","run","handleProviderChanges","appSupport","tagsWithProvider","getTagsWithProvider","renderCount","deleted","renderTagSupport","hasProvider","xProvider","childTags","isLikeTags","tagSupport0","tagSupport1","templater0","templater1","tag0","tag1","strings0","strings","strings1","string","isLikeValueSets","values0","values1","destroyTagMemory","oldTagSupport","oldest","destroy","destroyTagSupportPast","context","runBeforeRender","runAfterRender","tagClosed$","runBeforeDestroy","renderTagOnly","newTagSupport","lastSupport","oldRenderCount","lastOwnerSupport","runtimeOwnerSupport","lastState","runBeforeRedraw","beforeWithRender","reSupport","renderWithSupport","oldGlobal","insertBefore","destroyUnlikeTags","renderExistingTag","oldestSupport","newSupport","preRenderCount","providersWithChanges","filter","getAppTagSupport","providersChangeCheck","prevSupport","updateBy","renderUp","ownerTag","selfPropChange","nowProps","props","latestProps","propsConfig","latestCloned","innerCallback","a","b","c","d","e","f","callbackMaker","originalGetter","triggerStateUpdate","initMemory","maybePromise","finally","setCurrentTagSupport","support","currentSupport","onInit","destroyCurrentSupport","onDestroy","destroyCallback","childrenCurrentSupport","children","variablePrefix","escapeVariable","escapeSearch","Tag","arrayValue","html","TemplaterResult","tagged","madeChildIntoSubject","childSubject","templaterResult","kid","kidsToTagArraySubject","tags","runTagCallback","bindTo","myGlobal","callbackResult","bind","insertAfter","newNode","referenceNode","parentNode","nextSibling","isSimpleType","destroyArrayTag","counts","stagger","removed","removeChild","placeholderElm","placeholder","getValueType","type","function","date","tagArray","unknown","cloneValueArray","getChildTagsToDestroy","allTags","cTag","processNewTag","TagSupport","swapInsertBefore","document","createTextNode","inputAttribute","element","names","split","style","classList","remove","startRegX","endRegX","isTagVar","search","processAttribute","attrName","child","scope","howToSet","getContextValueByVarString","processNameValueAttr","processScopedNameValueAttr","attrValue","removeAttribute","processNameOnlyAttr","isSpecialAttr","replace","reverse","join","isSpecial","action","newAttrValue","oneRender","isChildOverride","subjectFunction","bindSubjectCallback","fun","isDeadValue","processAttributeSubjectValue","howToSetAttribute","setAttribute","howToSetInputValue","interpolateAttributes","attrNames","getAttributeNames","nodeName","getAttribute","interpolateReplace","processTagResult","subjectTag","processTagResultUpdate","buildBeforeElement","processSubjectComponent","options","label","substring","preClones","myClones","fClone","renderSubjectComponent","processTag","newTagSupportByTemplater","added","tagFakeTemplater","getFakeTemplater","fake","isTag","setupNewTemplater","processTagArray","lastArray","setPlaceholderElm","runtimeInsertBefore","lessLength","subTag","lastTag","newArrayValue","lastArrayValue","destroyItem","valueA","valueB","areLikeValues","last","previousSupport","template","getTemplate","processAddTagArrayItem","fragment","createDocumentFragment","newTempElm","createElement","appendChild","updateBeforeTemplate","lastFirstChild","parent","textNode","castTextValue","processRegularValue","castedValue","oldClone","textContent","processFirstSubjectValue","v","wrap","oneRenderToTagSupport","processFirstRegularValue","compareProps","compare","onDelete","compareOriginal","hasTagSupportChanged","newTemplater","propsChanged","pastCloneProps","castedProps","castedPastProps","subCastedProps","subCompareProps","matched","entries","hasPropChanges","kidsChanged","oldCloneKidValues","lastClonedKidValues","newClonedKidValues","hasKidsChanged","alterProps","newProps","toCall","callbackPropOwner","resetFunctionProps","callWith","cycle","lastestOwner","allMatched","updateExistingTagComponent","oldestTag","oldWrapper","newWrapper","isSameTag","newPropsArray","priorPropConfig","priorPropsArray","argPosition","priorProps","newCallback","syncFunctionProps","newOldest","buildNewTag","oldInsertBefore","updateExistingValue","valueType","displaySubject","hasLastValue","newType","destroySimpleValue","arraySubject","wasArray","isValueTag","checkDestroyPrevious","subjectSup","newestState","prepareUpdateToComponent","isClass","valueSupport","handleStillTag","interpolateTemplate","hasAttribute","variableName","existingSubject","subscribeToTemplate","called","onValue","mutatingCallback","afterElmBuild","elm","textarea","match","dynamic","_elm","_name","scanTextAreaValue","diff","onInitDoubleWrap","oninit","onInitWrap","target","elementInitCheck","interpolateContentTemplates","tagComponents","nextClones","subChild","isRenderEndTemplate","nextTagComponent","tagName","interpolateElement","container","interpolatedTemplates","interpolation","content","nextTagComponents","processChildrenAttributes","interpolateString","expression","startsWith","id","interpolateToTemplates","afterInterpolateElement","temporary","firstChild","nextNextSibling","buildClones","prefixSearch","BaseTagSupport","isApp","appElement","hasLiveElements","kidValue","latest","setTagPlaceholder","update","elementContainer","tempDraw","innerHTML","thisTag","updateContext","_string","oldValueFn","newValueFn","prevState","shareTemplaterGlobal","updateContextItem","processNewValue","tempTag","updateConfig","updateValues","version","byParent","firstDestroy","destroySubscriptions","subGlobal","mainPromise","promise","destroyClones","async","promises","oldClones","checkCloneRemoval","oldContext","customElm","ondestroy","onDestroyDoubleWrap","onDestroyWrap","elementDestroyCheck","compareClone","tagCount","innerTagWrap","originalFunction","valuesValue","getTagWrap","tagIndex","route","routeProps","app","routeTag","oneRenderFunction","appElements","tagElement","appElmIndex","appElm","runWrapper","templateElm","hmr"],"sourceRoot":""}