taggedjs 2.5.6 → 2.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.js +60 -20
- package/bundle.js.map +1 -1
- package/js/state/index.d.ts +1 -0
- package/js/state/index.js +1 -0
- package/js/state/index.js.map +1 -1
- package/js/state/letProp.function.d.ts +7 -0
- package/js/state/letProp.function.js +16 -0
- package/js/state/letProp.function.js.map +1 -0
- package/js/state/state.utils.d.ts +1 -0
- package/js/state/state.utils.js +9 -6
- package/js/state/state.utils.js.map +1 -1
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1128,13 +1128,14 @@ function children() {
|
|
|
1128
1128
|
|
|
1129
1129
|
__webpack_require__.r(__webpack_exports__);
|
|
1130
1130
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1131
|
-
/* harmony export */ callback: () => (/* reexport safe */
|
|
1132
|
-
/* harmony export */ callbackMaker: () => (/* reexport safe */
|
|
1133
|
-
/* harmony export */ children: () => (/* reexport safe */
|
|
1134
|
-
/* harmony export */
|
|
1135
|
-
/* harmony export */
|
|
1136
|
-
/* harmony export */
|
|
1137
|
-
/* harmony export */
|
|
1131
|
+
/* harmony export */ callback: () => (/* reexport safe */ _callbackMaker_function__WEBPACK_IMPORTED_MODULE_7__.callback),
|
|
1132
|
+
/* harmony export */ callbackMaker: () => (/* reexport safe */ _callbackMaker_function__WEBPACK_IMPORTED_MODULE_7__.callbackMaker),
|
|
1133
|
+
/* harmony export */ children: () => (/* reexport safe */ _children__WEBPACK_IMPORTED_MODULE_10__.children),
|
|
1134
|
+
/* harmony export */ letProp: () => (/* reexport safe */ _letProp_function__WEBPACK_IMPORTED_MODULE_4__.letProp),
|
|
1135
|
+
/* harmony export */ letState: () => (/* reexport safe */ _letState_function__WEBPACK_IMPORTED_MODULE_5__.letState),
|
|
1136
|
+
/* harmony export */ onDestroy: () => (/* reexport safe */ _onDestroy__WEBPACK_IMPORTED_MODULE_9__.onDestroy),
|
|
1137
|
+
/* harmony export */ onInit: () => (/* reexport safe */ _onInit__WEBPACK_IMPORTED_MODULE_8__.onInit),
|
|
1138
|
+
/* harmony export */ providers: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_6__.providers),
|
|
1138
1139
|
/* harmony export */ setUse: () => (/* reexport safe */ _setUse_function__WEBPACK_IMPORTED_MODULE_1__.setUse),
|
|
1139
1140
|
/* harmony export */ state: () => (/* reexport safe */ _state_function__WEBPACK_IMPORTED_MODULE_2__.state),
|
|
1140
1141
|
/* harmony export */ subject: () => (/* reexport safe */ _subject_function__WEBPACK_IMPORTED_MODULE_3__.subject),
|
|
@@ -1144,12 +1145,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1144
1145
|
/* harmony import */ var _setUse_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setUse.function */ "./ts/state/setUse.function.ts");
|
|
1145
1146
|
/* harmony import */ var _state_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./state.function */ "./ts/state/state.function.ts");
|
|
1146
1147
|
/* harmony import */ var _subject_function__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./subject.function */ "./ts/state/subject.function.ts");
|
|
1147
|
-
/* harmony import */ var
|
|
1148
|
-
/* harmony import */ var
|
|
1149
|
-
/* harmony import */ var
|
|
1150
|
-
/* harmony import */ var
|
|
1151
|
-
/* harmony import */ var
|
|
1152
|
-
/* harmony import */ var
|
|
1148
|
+
/* harmony import */ var _letProp_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./letProp.function */ "./ts/state/letProp.function.ts");
|
|
1149
|
+
/* harmony import */ var _letState_function__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./letState.function */ "./ts/state/letState.function.ts");
|
|
1150
|
+
/* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./providers */ "./ts/state/providers.ts");
|
|
1151
|
+
/* harmony import */ var _callbackMaker_function__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./callbackMaker.function */ "./ts/state/callbackMaker.function.ts");
|
|
1152
|
+
/* harmony import */ var _onInit__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./onInit */ "./ts/state/onInit.ts");
|
|
1153
|
+
/* harmony import */ var _onDestroy__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./onDestroy */ "./ts/state/onDestroy.ts");
|
|
1154
|
+
/* harmony import */ var _children__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./children */ "./ts/state/children.ts");
|
|
1155
|
+
|
|
1153
1156
|
|
|
1154
1157
|
|
|
1155
1158
|
|
|
@@ -1162,6 +1165,37 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1162
1165
|
|
|
1163
1166
|
|
|
1164
1167
|
|
|
1168
|
+
/***/ }),
|
|
1169
|
+
|
|
1170
|
+
/***/ "./ts/state/letProp.function.ts":
|
|
1171
|
+
/*!**************************************!*\
|
|
1172
|
+
!*** ./ts/state/letProp.function.ts ***!
|
|
1173
|
+
\**************************************/
|
|
1174
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1175
|
+
|
|
1176
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1177
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1178
|
+
/* harmony export */ letProp: () => (/* binding */ letProp)
|
|
1179
|
+
/* harmony export */ });
|
|
1180
|
+
/* harmony import */ var _letState_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./letState.function */ "./ts/state/letState.function.ts");
|
|
1181
|
+
/* harmony import */ var _watch_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./watch.function */ "./ts/state/watch.function.ts");
|
|
1182
|
+
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* Enables the ability to maintain a change to a props value until the prop itself changes
|
|
1186
|
+
* @param prop typically the name of an existing prop
|
|
1187
|
+
* @returns immediately call the returned function: letProp(y)(x => [y, y=x])
|
|
1188
|
+
*/
|
|
1189
|
+
function letProp(prop) {
|
|
1190
|
+
return getSetProp => {
|
|
1191
|
+
let myProp = (0,_letState_function__WEBPACK_IMPORTED_MODULE_0__.letState)(prop)(getSetProp);
|
|
1192
|
+
(0,_watch_function__WEBPACK_IMPORTED_MODULE_1__.watch)([prop], () => getSetProp(myProp = prop));
|
|
1193
|
+
getSetProp(myProp);
|
|
1194
|
+
return myProp;
|
|
1195
|
+
};
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
|
|
1165
1199
|
/***/ }),
|
|
1166
1200
|
|
|
1167
1201
|
/***/ "./ts/state/letState.function.ts":
|
|
@@ -1559,6 +1593,7 @@ function state(defaultValue) {
|
|
|
1559
1593
|
__webpack_require__.r(__webpack_exports__);
|
|
1560
1594
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1561
1595
|
/* harmony export */ StateEchoBack: () => (/* binding */ StateEchoBack),
|
|
1596
|
+
/* harmony export */ getCallbackValue: () => (/* binding */ getCallbackValue),
|
|
1562
1597
|
/* harmony export */ getStateValue: () => (/* binding */ getStateValue)
|
|
1563
1598
|
/* harmony export */ });
|
|
1564
1599
|
/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors */ "./ts/errors.ts");
|
|
@@ -1607,19 +1642,16 @@ function getStateValue(state) {
|
|
|
1607
1642
|
if (!callback) {
|
|
1608
1643
|
return state.defaultValue;
|
|
1609
1644
|
}
|
|
1610
|
-
const
|
|
1611
|
-
const [oldValue] = oldState;
|
|
1612
|
-
const [checkValue] = callback(oldValue); // set back to original value
|
|
1645
|
+
const [value, checkValue] = getCallbackValue(callback);
|
|
1613
1646
|
if (checkValue !== StateEchoBack) {
|
|
1614
1647
|
const message = 'State property not used correctly. Second item in array is not setting value as expected.\n\n' +
|
|
1615
1648
|
'For "let" state use `let name = state(default)(x => [name, name = x])`\n\n' +
|
|
1616
1649
|
'For "const" state use `const name = state(default)()`\n\n' +
|
|
1617
1650
|
'Problem state:\n' + (callback ? callback.toString() : JSON.stringify(state)) + '\n';
|
|
1618
|
-
console.error(message, { state, callback,
|
|
1651
|
+
console.error(message, { state, callback, value, checkValue });
|
|
1619
1652
|
throw new Error(message);
|
|
1620
1653
|
}
|
|
1621
|
-
|
|
1622
|
-
return oldValue;
|
|
1654
|
+
return value;
|
|
1623
1655
|
}
|
|
1624
1656
|
class StateEchoBack {
|
|
1625
1657
|
}
|
|
@@ -1670,6 +1702,12 @@ function checkStateMismatch(
|
|
|
1670
1702
|
})
|
|
1671
1703
|
}
|
|
1672
1704
|
*/
|
|
1705
|
+
function getCallbackValue(callback) {
|
|
1706
|
+
const oldState = callback(StateEchoBack); // get value and set to undefined
|
|
1707
|
+
const [value] = oldState;
|
|
1708
|
+
const [checkValue] = callback(value); // set back to original value
|
|
1709
|
+
return [value, checkValue];
|
|
1710
|
+
}
|
|
1673
1711
|
|
|
1674
1712
|
|
|
1675
1713
|
/***/ }),
|
|
@@ -4474,6 +4512,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4474
4512
|
/* harmony export */ isTagComponent: () => (/* reexport safe */ _isInstance__WEBPACK_IMPORTED_MODULE_3__.isTagComponent),
|
|
4475
4513
|
/* harmony export */ isTagTemplater: () => (/* reexport safe */ _isInstance__WEBPACK_IMPORTED_MODULE_3__.isTagTemplater),
|
|
4476
4514
|
/* harmony export */ kidsToTagArraySubject: () => (/* reexport safe */ _tag_tag__WEBPACK_IMPORTED_MODULE_0__.kidsToTagArraySubject),
|
|
4515
|
+
/* harmony export */ letProp: () => (/* reexport safe */ _state_index__WEBPACK_IMPORTED_MODULE_4__.letProp),
|
|
4477
4516
|
/* harmony export */ letState: () => (/* reexport safe */ _state_index__WEBPACK_IMPORTED_MODULE_4__.letState),
|
|
4478
4517
|
/* harmony export */ onDestroy: () => (/* reexport safe */ _state_index__WEBPACK_IMPORTED_MODULE_4__.onDestroy),
|
|
4479
4518
|
/* harmony export */ onInit: () => (/* reexport safe */ _state_index__WEBPACK_IMPORTED_MODULE_4__.onInit),
|
|
@@ -4559,6 +4598,7 @@ var __webpack_exports__isTagClass = __webpack_exports__.isTagClass;
|
|
|
4559
4598
|
var __webpack_exports__isTagComponent = __webpack_exports__.isTagComponent;
|
|
4560
4599
|
var __webpack_exports__isTagTemplater = __webpack_exports__.isTagTemplater;
|
|
4561
4600
|
var __webpack_exports__kidsToTagArraySubject = __webpack_exports__.kidsToTagArraySubject;
|
|
4601
|
+
var __webpack_exports__letProp = __webpack_exports__.letProp;
|
|
4562
4602
|
var __webpack_exports__letState = __webpack_exports__.letState;
|
|
4563
4603
|
var __webpack_exports__onDestroy = __webpack_exports__.onDestroy;
|
|
4564
4604
|
var __webpack_exports__onInit = __webpack_exports__.onInit;
|
|
@@ -4576,6 +4616,6 @@ var __webpack_exports__watch = __webpack_exports__.watch;
|
|
|
4576
4616
|
var __webpack_exports__willCallback = __webpack_exports__.willCallback;
|
|
4577
4617
|
var __webpack_exports__willPromise = __webpack_exports__.willPromise;
|
|
4578
4618
|
var __webpack_exports__willSubscribe = __webpack_exports__.willSubscribe;
|
|
4579
|
-
export { __webpack_exports__ArrayNoKeyError as ArrayNoKeyError, __webpack_exports__BaseTagSupport as BaseTagSupport, __webpack_exports__StateMismatchError as StateMismatchError, __webpack_exports__Subject as Subject, __webpack_exports__SyncCallbackError as SyncCallbackError, __webpack_exports__Tag as Tag, __webpack_exports__TagError as TagError, __webpack_exports__TagSupport as TagSupport, __webpack_exports__ValueSubject as ValueSubject, __webpack_exports__callback as callback, __webpack_exports__callbackMaker as callbackMaker, __webpack_exports__children as children, __webpack_exports__combineLatest as combineLatest, __webpack_exports__hmr as hmr, __webpack_exports__html as html, __webpack_exports__interpolateElement as interpolateElement, __webpack_exports__interpolateString as interpolateString, __webpack_exports__isLikeValueSets as isLikeValueSets, __webpack_exports__isSubjectInstance as isSubjectInstance, __webpack_exports__isTag as isTag, __webpack_exports__isTagArray as isTagArray, __webpack_exports__isTagClass as isTagClass, __webpack_exports__isTagComponent as isTagComponent, __webpack_exports__isTagTemplater as isTagTemplater, __webpack_exports__kidsToTagArraySubject as kidsToTagArraySubject, __webpack_exports__letState as letState, __webpack_exports__onDestroy as onDestroy, __webpack_exports__onInit as onInit, __webpack_exports__providers as providers, __webpack_exports__renderTagSupport as renderTagSupport, __webpack_exports__renderWithSupport as renderWithSupport, __webpack_exports__runBeforeRender as runBeforeRender, __webpack_exports__setUse as setUse, __webpack_exports__state as state, __webpack_exports__subject as subject, __webpack_exports__tag as tag, __webpack_exports__tagElement as tagElement, __webpack_exports__tags as tags, __webpack_exports__watch as watch, __webpack_exports__willCallback as willCallback, __webpack_exports__willPromise as willPromise, __webpack_exports__willSubscribe as willSubscribe };
|
|
4619
|
+
export { __webpack_exports__ArrayNoKeyError as ArrayNoKeyError, __webpack_exports__BaseTagSupport as BaseTagSupport, __webpack_exports__StateMismatchError as StateMismatchError, __webpack_exports__Subject as Subject, __webpack_exports__SyncCallbackError as SyncCallbackError, __webpack_exports__Tag as Tag, __webpack_exports__TagError as TagError, __webpack_exports__TagSupport as TagSupport, __webpack_exports__ValueSubject as ValueSubject, __webpack_exports__callback as callback, __webpack_exports__callbackMaker as callbackMaker, __webpack_exports__children as children, __webpack_exports__combineLatest as combineLatest, __webpack_exports__hmr as hmr, __webpack_exports__html as html, __webpack_exports__interpolateElement as interpolateElement, __webpack_exports__interpolateString as interpolateString, __webpack_exports__isLikeValueSets as isLikeValueSets, __webpack_exports__isSubjectInstance as isSubjectInstance, __webpack_exports__isTag as isTag, __webpack_exports__isTagArray as isTagArray, __webpack_exports__isTagClass as isTagClass, __webpack_exports__isTagComponent as isTagComponent, __webpack_exports__isTagTemplater as isTagTemplater, __webpack_exports__kidsToTagArraySubject as kidsToTagArraySubject, __webpack_exports__letProp as letProp, __webpack_exports__letState as letState, __webpack_exports__onDestroy as onDestroy, __webpack_exports__onInit as onInit, __webpack_exports__providers as providers, __webpack_exports__renderTagSupport as renderTagSupport, __webpack_exports__renderWithSupport as renderWithSupport, __webpack_exports__runBeforeRender as runBeforeRender, __webpack_exports__setUse as setUse, __webpack_exports__state as state, __webpack_exports__subject as subject, __webpack_exports__tag as tag, __webpack_exports__tagElement as tagElement, __webpack_exports__tags as tags, __webpack_exports__watch as watch, __webpack_exports__willCallback as willCallback, __webpack_exports__willPromise as willPromise, __webpack_exports__willSubscribe as willSubscribe };
|
|
4580
4620
|
|
|
4581
4621
|
//# sourceMappingURL=bundle.js.map
|
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,wBAAwB;AACxB;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;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;;;;;;;;;;;;;;;;AChEO;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,4BAA4B,mEAAa;AACzC;AACA;AACA;;;;;;;;;;;;;;;;;ACVA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACjB+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4EAAgB;AACxB,sCAAsC;AACtC,KAAK;AACL;;;;;;;;;;;;;;;;ACvB4D;AACrD;AACP;AACA,iBAAiB,iCAAiC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mCAAmC,EAAE,yEAAmB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,eAAe,EAAE,yEAAmB;AAChE;AACA;AACA;AACA;AACA,wBAAwB,sDAAsD;AAC9E;AACA;AACA,aAAa;AACb;AACA,KAAK;AACL,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACxCgE;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;AACA,QAAQ,6EAAqB;AAC7B;AACA;AACA;AACA,KAAK;AACL;AACO;AACP,mBAAmB,uEAAsB;AACzC,0CAA0C,wDAAY,EAAE,0DAAc;AACtE;AACA;;;;;;;;;;;;;;;;;;;;;;;;AClCkD;AACI;AAC2B;AACtB;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,+EAA+E,gBAAgB;AAC/F,aAAa;AACb;AACO;AACP,EAAE,gBAAgB;AAClB;AACA;AACA;AACA,YAAY,6FAAmB;AAC/B;AACA;AACA;AACA,QAAQ,6FAAmB;AAC3B,sBAAsB,WAAW;AACjC;AACA,SAAS;AACT;AACA,oCAAoC;AACpC;AACA;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;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;;;;AC7FA;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,QAAQ,8DAAiB;AACzB;AACA;AACA;AACA,+BAA+B,kFAAmB;AAClD;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;;;;;;;;;;;;;;;;ACxH+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;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP,+EAA+E;AAC/E;AACO;AACP;AACA;;;;;;;;;;;;;;;ACpBO;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;AACY;AACP;AACC;AAChB;AACG;AACD;;;;;;;;;;;;;;;;;ACTmB;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;AACA;AACA;AACA,yBAAyB,yDAAS;AAClC,KAAK;AACL;AACA;AACA;AACA,gCAAgC,mCAAmC;AACnE;AACA,oBAAoB;AACpB;AACA;AACA;AACA,6BAA6B,yDAAS;AACtC,mBAAmB,uFAAgB;AACnC;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACtC6C;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;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;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA;AACA,CAAC;AACM;AACP;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA,iCAAiC,iDAAiD;AAClF;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,mBAAmB,oDAAM;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;;;;;;;;;;;;;;;;;;;AC1GqC;AACiC;AAC3B;AACF;AACU;AAC5C;AACP,wBAAwB,sDAAK,OAAO,oDAAM;AAC1C,0BAA0B,kFAAiB;AAC3C,eAAe,6CAAO;AACtB,QAAQ,gEAAU;AAClB;AACA,KAAK;AACL;AACA;AACA,wBAAwB,sDAAK,OAAO,oDAAM;AAC1C,0BAA0B,kFAAiB;AAC3C,WAAW,6CAAO;AAClB,QAAQ,gEAAU;AAClB;AACA,KAAK;AACL;AACA;;;;;;;;;;;;;;;ACrBO;AACP;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,8CAA8C;AAC9C,KAAK;AACL;;;;;;;;;;;;;;;;;;;;ACT0C;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;AACA;AACA;AACA,SAAS;AACT;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,gBAAgB,8DAAiB;AACjC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT,eAAe,sEAAa;AAC5B;AACA,6CAA6C;AAC7C;;;;;;;;;;;;;;;;ACpF0C;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;;;;;;;;;;;;;;;;;AClDO;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;AACX;AAClF,gCAAgC,sDAAc;AAC9C;AACO;AACP;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oCAAoC;AACpC;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;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,8EAA8E,gBAAgB;AAC9F;AACA,gBAAgB,gBAAgB,EAAE,uFAAkB;AACpD;AACA;AACA;AACA,SAAS;AACT,QAAQ,0GAAuB;AAC/B;AACA;AACA;AACA,YAAY,yFAAmB,+FAA+F,gBAAgB;AAC9I,YAAY,0GAAuB;AACnC,SAAS;AACT;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;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,sDAAc;AAC/C;AACA;AACA;AACA;AACA;AACA,uBAAuB,qFAAiB;AACxC;AACA;AACA;AACA;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;AACA;AACA;AACA,gBAAgB,2DAAc;AAC9B,gBAAgB,4DAAgB;AAChC;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gFAAgB;AACpC;AACA;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;AACA;AACA;AACA,oBAAoB,UAAU;AAC9B;AACA,KAAK;AACL;AACA,gCAAgC;AAChC,wGAAwG;AACxG;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;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,6BAA6B;AAC7B,4BAA4B;AAC5B;AACA,2BAA2B,gGAAsB;AACjD;AACA;AACA;AACA,sBAAsB,sBAAsB;AAC5C,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gFAAgB;AACpB;AACA;;;;;;;;;;;;;;;;;;;;;AChTkE;AACf;AAC6B;AAC1B;AAC/C;AACP;AACA;AACA;AACA;AACA,qBAAqB,uDAAU;AAC/B;AACA;AACA;AACA,QAAQ,kEAAW;AACnB,4BAA4B,YAAY,mCAAmC,sBAAsB;AACjG;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,QAAQ,sEAAgB;AACxB;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;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;;;;;;;;;;;;;;;;;ACjF6C;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;AACvD;AACO;AACP;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;AACA;AACA;AACO;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;AACA,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;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA,+BAA+B,4FAAc;AAC7C;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACvHoD;AACU;AACP;AACvD;AACO;AACP;AACA;AACA;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;AACA,IAAI,2DAAe;AACnB;AACA;AACA;AACA,IAAI,0DAAc;AAClB;AACA;;;;;;;;;;;;;;;;;;;;;AC1DA,wDAAwD;AACtB;AACG;AAC4B;AACjE;AACA,0CAAM,yBAAyB,6CAAO;AACtC,SAAS,8EAAiB;AAC1B,6BAA6B;AAC7B;AACA,CAAC;AACD;AACO;AACP,IAAI,0CAAM;AACV;AACA;AACO;AACP,IAAI,0CAAM;AACV,IAAI,0CAAM;AACV;AACA;AACO;AACP,IAAI,0CAAM;AACV;AACA;AACO;AACP,IAAI,0CAAM;AACV;;;;;;;;;;;;;;;;;;;AC1B0D;AACuC;AACnC;AACb;AAC1C;AACP,QAAQ,2DAAc;AACtB,+BAA+B,+DAAY;AAC3C;AACA;AACA;AACA,mBAAmB,+DAAY;AAC/B;AACA;AACA,mBAAmB,+DAAY;AAC/B;AACA,QAAQ,2DAAc;AACtB;AACA;AACA;AACA;AACA,QAAQ,uDAAU;AAClB;AACA;AACA;AACA,QAAQ,8DAAiB;AACzB;AACA;AACA,eAAe,+DAAY;AAC3B;AACA;AACA;AACA;AACA;AACA,wBAAwB,mEAAe;AACvC;AACA;AACA;AACA,wBAAwB,+DAAY;AACpC,gDAAgD,yDAAU;AAC1D;AACA;;;;;;;;;;;;;;;;ACxC2E;AACpE;AACP;AACA;AACA,kDAAkD;AAClD;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,kBAAkB,oFAAoB;AACtC,2BAA2B;AAC3B;;;;;;;;;;;;;;;;;;;ACbqC;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;;;;;;;;;;;;;;;;;;;;ACjC6E;AACa;AACtC;AACiB;AACA;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;AACA,QAAQ,2DAAc;AACtB;AACA;AACA,QAAQ,2DAAc;AACtB;AACA;AACA,QAAQ,uDAAU;AAClB;AACA;AACA,QAAQ,uDAAU;AAClB;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gEAAU;AACtB;AACA;AACA;AACA;AACA;AACA,4BAA4B,sEAAgB;AAC5C;AACA,YAAY,gEAAU;AACtB;AACA;AACA,mBAAmB,iEAAe;AAClC;AACA,YAAY,0FAAuB;AACnC;AACA;AACA,IAAI,kFAAmB;AACvB;;;;;;;;;;;;;;;;;;;;ACrDiD;AACJ;AAC7C;AACO;AACP;AACA;AACA;AACA;AACA,yBAAyB,yDAAU;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC;AACA,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;;;;;;;;;;;;;;;;;;;;;AC5C0D;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;AACA;AACA;AACA,YAAY,uDAAU;AACtB,YAAY,sEAAgB;AAC5B;AACA,+BAA+B,yDAAU,qCAAqC,+DAAY;AAC1F;AACA;AACA,YAAY,uEAAiB;AAC7B;AACA;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,KAAK;AACL;AACA;AACA;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,4CAA4C;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACxHO;AACP;AACA,EAAE,uBAAuB;AACzB;AACA;AACA;AACA,iEAAiE;AACjE,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC5BqE;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,iDAAiD;AACjD;AACA;AACA;AACA;AACA,QAAQ,sEAAgB;AACxB,eAAe,0FAAuB;AACtC;AACA,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;AACA,kBAAkB,sBAAsB;AACxC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA,uBAAuB,uEAAiB;AACxC;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;;;;;;;;;;;;;;;;;;;;;;;;;AClHiD;AACa;AAC+C;AACzD;AAC+B;AACd;AACqB;AACb;AACzB;AACoC;AACA;AACjF;AACP;AACA,wBAAwB,2DAAc;AACtC,IAAI,oFAAoB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uDAAU;AAClB,QAAQ,iEAAe;AACvB,wBAAwB;AACxB;AACA;AACA,eAAe;AACf;AACA;AACA,QAAQ,2DAAc;AACtB,QAAQ,iEAAU;AAClB;AACA;AACA,QAAQ,uDAAU;AAClB;AACA;AACA;AACA,wBAAwB,uEAAgB;AACxC;AACA;AACA;AACA,QAAQ,iEAAU;AAClB;AACA;AACA;AACA,QAAQ,8DAAiB;AACzB;AACA;AACA;AACA;AACA,sBAAsB,iGAAmB;AACzC;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;AACA,sBAAsB,sBAAsB;AAC5C,SAAS;AACT;AACA;AACA,2BAA2B,yDAAU;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gFAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,0FAAuB;AAC/B;AACA,sBAAsB,sBAAsB;AAC5C,SAAS;AACT;AACA;AACA;AACA;AACA,IAAI,gGAA0B;AAC9B;AACA;AACA;;;;;;;;;;;;;;;ACvIA;AACO;AACP;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;;;;;;;SCdA;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;AACC;AACF;AACI;AACC;AACE;AACO;AACuB;AACV;AACN;AACR;AACY;AACwB;AACE;AAChB;AACQ;AACM;AACE;AAC9B;AACvC;AACP,cAAc,4EAAmB,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/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/tagElement.ts","webpack://taggedjs/./ts/tag/tagRunner.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/processSubjectValue.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 Object.entries(newProps).forEach(([name, value]) => {\n if (value instanceof Function) {\n const toCall = newProps[name].toCall;\n if (toCall) {\n return; // already previously converted\n }\n newProps[name] = (...args) => {\n return newProps[name].toCall(...args); // what gets called can switch over parent state changes\n };\n // Currently, call self but over parent state changes, I may need to call a newer parent tag owner\n newProps[name].toCall = (...args) => {\n return callbackPropOwner(value, args, ownerSupport);\n };\n newProps[name].original = value;\n return;\n }\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 clones.forEach(clone => afterElmBuild(clone, options, context, tagSupport));\n tagSupport.clones.push(...clones);\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 names.forEach(name => element.classList.add(name));\n }\n else {\n names.forEach(name => element.classList.remove(name));\n }\n return;\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 /*\n if((element as any)[name] === value) {\n return // its already the value we are setting\n }\n */\n element[name] = value;\n}\nexport function interpolateAttributes(child, scope, ownerSupport) {\n const attrNames = child.getAttributeNames();\n let howToSet = howToSetAttribute;\n attrNames.forEach(attrName => {\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(element, context, tagSupport, options, children) {\n if (!children || element.tagName === 'TEMPLATE') {\n return { clones: [], tagComponents: [] }; // done\n }\n // counting for animation stagger computing\n const counts = options.counts;\n const clones = [];\n const tagComponents = [];\n const childArray = new Array(...children);\n childArray.forEach(child => {\n const { clones: nextClones, tagComponent } = interpolateTemplate(child, context, tagSupport, counts, options);\n clones.push(...nextClones);\n if (tagComponent) {\n tagComponents.push(tagComponent);\n return;\n }\n if (child.children) {\n const nextKids = new Array(...child.children);\n nextKids.forEach((subChild, 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(subChild, 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(container, context, ownerSupport, options, children);\n clones.push(...nextClones);\n tagComponents.push(...nextTagComponents);\n }\n interpolateAttributes(container, context, ownerSupport);\n processChildrenAttributes(children, context, ownerSupport);\n return { clones, tagComponents };\n}\nfunction processChildrenAttributes(children, context, ownerSupport) {\n new Array(...children).forEach(child => {\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 { processSubjectValue } from \"../tag/update/processSubjectValue.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 let isForceElement = options.forceElement;\n subscribeToTemplate(insertBefore, existingSubject, ownerSupport, counts, { isForceElement });\n return { clones };\n}\nexport function subscribeToTemplate(insertBefore, subject, ownerSupport, counts, // used for animation stagger computing\n{ isForceElement }) {\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 processSubjectValue(templater, subject, insertBefore, ownerSupport, {\n counts: { ...counts },\n forceElement: isForceElement,\n });\n if (isForceElement) {\n isForceElement = false; // only can happen once\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 new Array(...elm.children).forEach((child, 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 Object.entries(lastValue).forEach(([name]) => child.removeAttribute(name));\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 Object.entries(attrValue).forEach(([name, value]) => processNameValueAttr(name, value, child, ownerSupport, howToSet));\n return;\n }\n}\nfunction processNameValueAttr(attrName, result, child, ownerSupport, howToSet) {\n const isSpecial = isSpecialAttr(attrName);\n // attach as callback?\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 // child.addEventListener(attrName, 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 if (newAttrValue instanceof Function) {\n newAttrValue = bindSubjectCallback(newAttrValue, ownerSupport);\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 isTagComponent(value) {\n return value?.wrapper?.parentWrap.original instanceof Function;\n}\nexport 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}\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 { letState } from \"./letState.function\";\nexport { providers } from \"./providers\";\nexport * from \"./callbackMaker.function\";\nexport * from \"./onInit\";\nexport * from \"./onDestroy\";\nexport * from \"./children\";\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 providersWithChanges.forEach(provider => {\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 tagsWithProvider.forEach(({ tagSupport, renderCount, provider }) => {\n if (tagSupport.global.deleted) {\n return; // 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 return renderTagSupport(tagSupport, false);\n }\n });\n}\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 tagSupport.childTags.forEach(child => getTagsWithProvider(child, provider, memory));\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 state: State = memory.state\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 const cTagConfig = config.tagSupport;\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 // memory.state = config.array // [...config.array]\n memory.state.forEach(item => item.lastValue = getStateValue(item)); // set last values\n config.array = [];\n }\n});\nexport function getStateValue(state) {\n const callback = state.callback;\n if (!callback) {\n return state.defaultValue;\n }\n const oldState = callback(StateEchoBack); // get value and set to undefined\n const [oldValue] = oldState;\n const [checkValue] = callback(oldValue); // set back to original value\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, oldState, oldValue, checkValue });\n throw new Error(message);\n }\n // state.lastValue = oldValue\n return oldValue;\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: This guard may no longer be needed\n /*\n if (config.rearray) {\n checkStateMismatch(tagSupport, config, state)\n }\n */\n config.rearray = [];\n if (state?.length) {\n state.forEach(state => getStateValue(state));\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*/\n","import { Subject } from \"../subject\";\nimport { getSupportInCycle } from \"../tag/getSupportInCycle.function\";\nimport { setUse } from \"./setUse.function\";\nimport { state } from \"./state.function\";\nimport { syncStates } from \"./syncStates.function\";\nexport function subject(value, onSubscription) {\n const oldestState = state(() => setUse.memory.stateConfig.array);\n const nowTagSupport = getSupportInCycle();\n return new Subject(value, onSubscription).pipe(x => {\n syncStates(nowTagSupport.memory.state, oldestState);\n return x;\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 stateFrom.forEach((state, 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 this.subscribers.forEach(sub => {\n // (sub.callback as any).value = value\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, rej) => {\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();\n subject.methods = operations;\n subject.subscribeWith = (x) => this.subscribe(x);\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 subscription.subscriptions.forEach(subscription => subscription.unsubscribe());\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 // return newValue = next\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';\nimport { renderSubjectComponent } from './render/renderSubjectComponent.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 lastTemplateString = undefined; // used to compare templates for updates\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 forceElement: false,\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 isForceElement = options.forceElement;\n const elementContainer = document.createElement('div');\n elementContainer.id = 'tag-temp-holder';\n // render content with a first child that we can know is our first element\n elementContainer.innerHTML = `<template id=\"temp-template-tag-wrap\">${template.string}</template>`;\n // Search/replace innerHTML variables but don't interpolate tag components just yet\n const { tagComponents } = interpolateElement(elementContainer, context, template, this, // ownerSupport,\n {\n forceElement: options.forceElement,\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 tagComponents.forEach(tagComponent => {\n subscribeToTemplate(tagComponent.insertBefore, tagComponent.subject, tagComponent.ownerSupport, options.counts, { isForceElement });\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 this.lastTemplateString = interpolation.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 variableName = variablePrefix + index;\n const hasValue = values.length > 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 if (!hasValue) {\n return;\n }\n // 🆕 First time values below\n context[variableName] = processNewValue(hasValue, 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 // signify immediately child has been deleted (looked for during event processing)\n childTags.forEach(child => {\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 this.destroySubscriptions();\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 global = this.global;\n global.subscriptions.forEach(cloneSub => cloneSub.unsubscribe());\n global.subscriptions.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 const oldContext = this.global.context;\n Object.values(oldContext).forEach(value => {\n const clone = value.clone;\n if (clone && 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 /** Used during HMR only where static content itself could have been edited */\n async rebuild() {\n delete this.strings; // seek the templater strings instead now\n delete this.values; // seek the templater strings instead now\n restoreTagMarkers(this);\n const newSupport = renderSubjectComponent(this.subject, this, this.ownerTagSupport);\n await this.destroy();\n newSupport.buildBeforeElement(this.global.insertBefore, {\n forceElement: true,\n counts: { added: 0, removed: 0 },\n });\n return newSupport;\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 support.childTags.forEach(childTag => restoreTagMarkers(childTag.global.oldest));\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 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 wasArray.forEach(({ tagSupport }) => destroyArrayTag(tagSupport, { added: 0, removed: 0 }));\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 // 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 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 destroySimpleValue(insertBefore, displaySubject);\n return 'changed-simple-value';\n }\n return false;\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';\n// export const tags: TagComponentBase<any>[] = []\nexport const tags = [];\nlet tagCount = 0;\n/** Wraps a tag component in a state manager and always push children to last argument as an array */\n// export function tag<T>(a: T): T;\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}\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 childSubject.value.forEach(kid => {\n kid.values.forEach((value, index) => {\n if (!(value instanceof Function)) {\n return;\n }\n const valuesValue = kid.values[index];\n if (valuesValue.isChildOverride) {\n return; // 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 { BaseTagSupport } from './TagSupport.class';\nimport { runAfterRender, runBeforeRender } from './tagRunner';\nimport { ValueSubject } from '../subject/ValueSubject';\nconst appElements = [];\nexport function tagElement(\n// app: TagComponent, // (...args: unknown[]) => TemplaterResult,\napp, // (...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 // newSupport.ownerTagSupport = newSupport\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","// TODO: This should be more like `new TaggedJs().use({})`\nimport { 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 setUse.tagUse.forEach(tagUse => tagUse.beforeRender(tagSupport, ownerSupport));\n}\n// Life cycle 2\nexport function runAfterRender(tagSupport, ownerTagSupport) {\n setUse.tagUse.forEach(tagUse => tagUse.afterRender(tagSupport, ownerTagSupport));\n setUse.memory.tagClosed$.next(ownerTagSupport);\n}\n// Life cycle 3\nexport function runBeforeRedraw(tagSupport, ownerTagSupport) {\n setUse.tagUse.forEach(tagUse => tagUse.beforeRedraw(tagSupport, ownerTagSupport));\n}\n// Life cycle 4 - end of life\nexport function runBeforeDestroy(tagSupport, ownerTagSupport) {\n setUse.tagUse.forEach(tagUse => tagUse.beforeDestroy(tagSupport, ownerTagSupport));\n}\n","import { ValueSubject } from '../../subject/ValueSubject';\nimport { isSubjectInstance, isTagClass, isTagComponent, isTagTemplater } from '../../isInstance';\nimport { TemplaterResult } from '../../TemplaterResult.class';\nimport { TagSupport } from '../TagSupport.class';\nexport function processNewValue(hasValue, value, ownerSupport) {\n if (isTagComponent(value)) {\n const tagSubject = new ValueSubject(value);\n return tagSubject;\n }\n if (value instanceof Function) {\n return new ValueSubject(value);\n }\n if (!hasValue) {\n return new ValueSubject(undefined);\n }\n if (isTagTemplater(value)) {\n const templater = value;\n const tag = templater.tag;\n return processNewTag(tag, ownerSupport);\n }\n if (isTagClass(value)) {\n return processNewTag(value, ownerSupport);\n }\n // is already a value subject?\n if (isSubjectInstance(value)) {\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 const tagSupport = subject.tagSupport = new TagSupport(templater, ownerSupport, subject);\n return subject;\n}\n","import { 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 // Processing of regular values\n const clone = updateBeforeTemplate(value, before);\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 || options.forceElement;\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 { processSubjectComponent } from './processSubjectComponent.function';\nimport { isTagArray, isTagClass, isTagComponent, isTagTemplater } from '../../isInstance';\nimport { processTagArray } from './processTagArray';\nimport { processRegularValue } from './processRegularValue.function';\nimport { processTag, tagFakeTemplater } from './processTag.function';\nvar ValueTypes;\n(function (ValueTypes) {\n ValueTypes[\"tag\"] = \"tag\";\n ValueTypes[\"templater\"] = \"templater\";\n ValueTypes[\"tagArray\"] = \"tag-array\";\n ValueTypes[\"tagComponent\"] = \"tag-component\";\n ValueTypes[\"value\"] = \"value\";\n})(ValueTypes || (ValueTypes = {}));\nfunction getValueType(value) {\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 return ValueTypes.value;\n}\n// export type ExistingValue = TemplaterResult | Tag[] | TagSupport | Function | Subject<unknown> | RegularValue | Tag\nexport function processSubjectValue(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 }\n processRegularValue(value, subject, insertBefore);\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 = new TagSupport(templater, ownerSupport, subject);\n setupNewTemplater(tagSupport, ownerSupport, subject);\n ownerSupport.childTags.push(tagSupport);\n }\n subject.tagSupport = tagSupport;\n tagSupport.ownerTagSupport = ownerSupport;\n tagSupport.buildBeforeElement(insertBefore, {\n counts: { added: 0, removed: 0 },\n forceElement: true,\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}\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 value.forEach((item, 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 // tagSupport.templater = subTag.templater\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 ownerTagContent: ownerSupport.lastTemplateString,\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 }\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, forceElement: options.forceElement });\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, forceElement, }) {\n // *if appears we already have seen\n const subjectTag = subject;\n const lastSupport = subjectTag.tagSupport;\n const prevSupport = lastSupport?.global.oldest || undefined; // || tag.tagSupport.oldest // subjectTag.tag\n const justUpdate = prevSupport; // && !forceElement\n if (prevSupport && justUpdate) {\n return processTagResultUpdate(tagSupport, subjectTag, prevSupport);\n }\n tagSupport.buildBeforeElement(insertBefore, {\n counts,\n forceElement,\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.compareTo === newFunction.compareTo // ???\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 forceElement: false,\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 forceElement: true,\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 newPropsArray.forEach((argPosition, index) => {\n if (typeof (argPosition) !== 'object') {\n return;\n }\n const priorProps = priorPropsArray[index];\n if (typeof (priorProps) !== 'object') {\n return;\n }\n Object.entries(argPosition).forEach(([name, value]) => {\n if (!(value instanceof Function)) {\n return;\n }\n const newCallback = argPosition[name]; // || value\n const original = newCallback instanceof Function && newCallback.toCall;\n if (original) {\n return; // 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 return;\n });\n });\n}\n","import { TagSupport } from '../TagSupport.class';\nimport { TemplaterResult } from '../../TemplaterResult.class';\nimport { isSubjectInstance, isTagArray, isTagClass, isTagComponent, isTagTemplater } from '../../isInstance';\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 { bindSubjectCallback } from '../../interpolations/bindSubjectCallback.function';\nimport { setupNewTemplater, getFakeTemplater, processTag } from './processTag.function';\nexport function updateExistingValue(subject, value, ownerSupport, insertBefore) {\n const subjectTag = subject;\n const isComponent = isTagComponent(value);\n checkDestroyPrevious(subject, value, insertBefore);\n // handle already seen tag components\n if (isComponent) {\n return prepareUpdateToComponent(value, subjectTag, insertBefore, ownerSupport);\n }\n // was component but no longer\n const tagSupport = subjectTag.tagSupport;\n if (tagSupport) {\n handleStillTag(subject, value, ownerSupport);\n return subjectTag;\n }\n // its another tag array\n if (isTagArray(value)) {\n processTagArray(subject, value, insertBefore, // oldInsertBefore as InsertBefore,\n ownerSupport, { counts: {\n added: 0,\n removed: 0,\n } });\n return subject;\n }\n if (isTagTemplater(value)) {\n processTag(value, insertBefore, ownerSupport, subjectTag);\n return subjectTag;\n }\n if (isTagClass(value)) {\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 }\n // we have been given a subject\n if (isSubjectInstance(value)) {\n return value;\n }\n // now its a function\n if (value instanceof Function) {\n const bound = bindSubjectCallback(value, ownerSupport);\n subject.set(bound);\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 forceElement: true,\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 = [...newestState]\n tagSupport.memory.state.length = 0;\n tagSupport.memory.state.push(...newestState);\n }\n else {\n restoreTagMarker(subjectSup);\n /*\n const placeholder = subjectSup.global.placeholder\n if(placeholder && !insertBefore.parentNode) {\n insertAfter(insertBefore,placeholder)\n delete subjectSup.global.placeholder\n }\n */\n processSubjectComponent(templater, subjectTag, insertBefore, ownerSupport, {\n forceElement: true,\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, lastFirstChild) {\n const parent = lastFirstChild.parentNode;\n let castedValue = value;\n // mimic React skipping to display EXCEPT for true does display on page\n if ([undefined, false, null].includes(value)) { // || value === true\n castedValue = '';\n }\n // Insert the new value (never use innerHTML here)\n const textNode = document.createTextNode(castedValue); // never innerHTML\n parent.insertBefore(textNode, lastFirstChild);\n /* remove existing nodes */\n parent.removeChild(lastFirstChild);\n return textNode;\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/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":";;;;;;;;;;;;;;;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,wBAAwB;AACxB;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;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;;;;;;;;;;;;;;;;AChEO;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,4BAA4B,mEAAa;AACzC;AACA;AACA;;;;;;;;;;;;;;;;;ACVA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACjB+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4EAAgB;AACxB,sCAAsC;AACtC,KAAK;AACL;;;;;;;;;;;;;;;;ACvB4D;AACrD;AACP;AACA,iBAAiB,iCAAiC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mCAAmC,EAAE,yEAAmB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,eAAe,EAAE,yEAAmB;AAChE;AACA;AACA;AACA;AACA,wBAAwB,sDAAsD;AAC9E;AACA;AACA,aAAa;AACb;AACA,KAAK;AACL,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACxCgE;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;AACA,QAAQ,6EAAqB;AAC7B;AACA;AACA;AACA,KAAK;AACL;AACO;AACP,mBAAmB,uEAAsB;AACzC,0CAA0C,wDAAY,EAAE,0DAAc;AACtE;AACA;;;;;;;;;;;;;;;;;;;;;;;;AClCkD;AACI;AAC2B;AACtB;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,+EAA+E,gBAAgB;AAC/F,aAAa;AACb;AACO;AACP,EAAE,gBAAgB;AAClB;AACA;AACA;AACA,YAAY,6FAAmB;AAC/B;AACA;AACA;AACA,QAAQ,6FAAmB;AAC3B,sBAAsB,WAAW;AACjC;AACA,SAAS;AACT;AACA,oCAAoC;AACpC;AACA;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;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;;;;AC7FA;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,QAAQ,8DAAiB;AACzB;AACA;AACA;AACA,+BAA+B,kFAAmB;AAClD;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;;;;;;;;;;;;;;;;ACxH+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;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP,+EAA+E;AAC/E;AACO;AACP;AACA;;;;;;;;;;;;;;;ACpBO;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;AACA;AACA;AACA,yBAAyB,yDAAS;AAClC,KAAK;AACL;AACA;AACA;AACA,gCAAgC,mCAAmC;AACnE;AACA,oBAAoB;AACpB;AACA;AACA;AACA,6BAA6B,yDAAS;AACtC,mBAAmB,uFAAgB;AACnC;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACtC6C;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;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;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;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;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;;;;;;;;;;;;;;;;;;;;AC7GqC;AACiC;AAC3B;AACF;AACU;AAC5C;AACP,wBAAwB,sDAAK,OAAO,oDAAM;AAC1C,0BAA0B,kFAAiB;AAC3C,eAAe,6CAAO;AACtB,QAAQ,gEAAU;AAClB;AACA,KAAK;AACL;AACA;AACA,wBAAwB,sDAAK,OAAO,oDAAM;AAC1C,0BAA0B,kFAAiB;AAC3C,WAAW,6CAAO;AAClB,QAAQ,gEAAU;AAClB;AACA,KAAK;AACL;AACA;;;;;;;;;;;;;;;ACrBO;AACP;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,8CAA8C;AAC9C,KAAK;AACL;;;;;;;;;;;;;;;;;;;;ACT0C;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;AACA;AACA;AACA,SAAS;AACT;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,gBAAgB,8DAAiB;AACjC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT,eAAe,sEAAa;AAC5B;AACA,6CAA6C;AAC7C;;;;;;;;;;;;;;;;ACpF0C;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;;;;;;;;;;;;;;;;;AClDO;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;AACX;AAClF,gCAAgC,sDAAc;AAC9C;AACO;AACP;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oCAAoC;AACpC;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;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,8EAA8E,gBAAgB;AAC9F;AACA,gBAAgB,gBAAgB,EAAE,uFAAkB;AACpD;AACA;AACA;AACA,SAAS;AACT,QAAQ,0GAAuB;AAC/B;AACA;AACA;AACA,YAAY,yFAAmB,+FAA+F,gBAAgB;AAC9I,YAAY,0GAAuB;AACnC,SAAS;AACT;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;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,sDAAc;AAC/C;AACA;AACA;AACA;AACA;AACA,uBAAuB,qFAAiB;AACxC;AACA;AACA;AACA;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;AACA;AACA;AACA,gBAAgB,2DAAc;AAC9B,gBAAgB,4DAAgB;AAChC;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gFAAgB;AACpC;AACA;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;AACA;AACA;AACA,oBAAoB,UAAU;AAC9B;AACA,KAAK;AACL;AACA,gCAAgC;AAChC,wGAAwG;AACxG;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;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,6BAA6B;AAC7B,4BAA4B;AAC5B;AACA,2BAA2B,gGAAsB;AACjD;AACA;AACA;AACA,sBAAsB,sBAAsB;AAC5C,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gFAAgB;AACpB;AACA;;;;;;;;;;;;;;;;;;;;;AChTkE;AACf;AAC6B;AAC1B;AAC/C;AACP;AACA;AACA;AACA;AACA,qBAAqB,uDAAU;AAC/B;AACA;AACA;AACA,QAAQ,kEAAW;AACnB,4BAA4B,YAAY,mCAAmC,sBAAsB;AACjG;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,QAAQ,sEAAgB;AACxB;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;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;;;;;;;;;;;;;;;;;ACjF6C;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;AACvD;AACO;AACP;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;AACA;AACA;AACO;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;AACA,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;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA,+BAA+B,4FAAc;AAC7C;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACvHoD;AACU;AACP;AACvD;AACO;AACP;AACA;AACA;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;AACA,IAAI,2DAAe;AACnB;AACA;AACA;AACA,IAAI,0DAAc;AAClB;AACA;;;;;;;;;;;;;;;;;;;;;AC1DA,wDAAwD;AACtB;AACG;AAC4B;AACjE;AACA,0CAAM,yBAAyB,6CAAO;AACtC,SAAS,8EAAiB;AAC1B,6BAA6B;AAC7B;AACA,CAAC;AACD;AACO;AACP,IAAI,0CAAM;AACV;AACA;AACO;AACP,IAAI,0CAAM;AACV,IAAI,0CAAM;AACV;AACA;AACO;AACP,IAAI,0CAAM;AACV;AACA;AACO;AACP,IAAI,0CAAM;AACV;;;;;;;;;;;;;;;;;;;AC1B0D;AACuC;AACnC;AACb;AAC1C;AACP,QAAQ,2DAAc;AACtB,+BAA+B,+DAAY;AAC3C;AACA;AACA;AACA,mBAAmB,+DAAY;AAC/B;AACA;AACA,mBAAmB,+DAAY;AAC/B;AACA,QAAQ,2DAAc;AACtB;AACA;AACA;AACA;AACA,QAAQ,uDAAU;AAClB;AACA;AACA;AACA,QAAQ,8DAAiB;AACzB;AACA;AACA,eAAe,+DAAY;AAC3B;AACA;AACA;AACA;AACA;AACA,wBAAwB,mEAAe;AACvC;AACA;AACA;AACA,wBAAwB,+DAAY;AACpC,gDAAgD,yDAAU;AAC1D;AACA;;;;;;;;;;;;;;;;ACxC2E;AACpE;AACP;AACA;AACA,kDAAkD;AAClD;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,kBAAkB,oFAAoB;AACtC,2BAA2B;AAC3B;;;;;;;;;;;;;;;;;;;ACbqC;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;;;;;;;;;;;;;;;;;;;;ACjC6E;AACa;AACtC;AACiB;AACA;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;AACA,QAAQ,2DAAc;AACtB;AACA;AACA,QAAQ,2DAAc;AACtB;AACA;AACA,QAAQ,uDAAU;AAClB;AACA;AACA,QAAQ,uDAAU;AAClB;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gEAAU;AACtB;AACA;AACA;AACA;AACA;AACA,4BAA4B,sEAAgB;AAC5C;AACA,YAAY,gEAAU;AACtB;AACA;AACA,mBAAmB,iEAAe;AAClC;AACA,YAAY,0FAAuB;AACnC;AACA;AACA,IAAI,kFAAmB;AACvB;;;;;;;;;;;;;;;;;;;;ACrDiD;AACJ;AAC7C;AACO;AACP;AACA;AACA;AACA;AACA,yBAAyB,yDAAU;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC;AACA,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;;;;;;;;;;;;;;;;;;;;;AC5C0D;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;AACA;AACA;AACA,YAAY,uDAAU;AACtB,YAAY,sEAAgB;AAC5B;AACA,+BAA+B,yDAAU,qCAAqC,+DAAY;AAC1F;AACA;AACA,YAAY,uEAAiB;AAC7B;AACA;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,KAAK;AACL;AACA;AACA;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,4CAA4C;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACxHO;AACP;AACA,EAAE,uBAAuB;AACzB;AACA;AACA;AACA,iEAAiE;AACjE,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC5BqE;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,iDAAiD;AACjD;AACA;AACA;AACA;AACA,QAAQ,sEAAgB;AACxB,eAAe,0FAAuB;AACtC;AACA,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;AACA,kBAAkB,sBAAsB;AACxC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA,uBAAuB,uEAAiB;AACxC;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;;;;;;;;;;;;;;;;;;;;;;;;;AClHiD;AACa;AAC+C;AACzD;AAC+B;AACd;AACqB;AACb;AACzB;AACoC;AACA;AACjF;AACP;AACA,wBAAwB,2DAAc;AACtC,IAAI,oFAAoB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uDAAU;AAClB,QAAQ,iEAAe;AACvB,wBAAwB;AACxB;AACA;AACA,eAAe;AACf;AACA;AACA,QAAQ,2DAAc;AACtB,QAAQ,iEAAU;AAClB;AACA;AACA,QAAQ,uDAAU;AAClB;AACA;AACA;AACA,wBAAwB,uEAAgB;AACxC;AACA;AACA;AACA,QAAQ,iEAAU;AAClB;AACA;AACA;AACA,QAAQ,8DAAiB;AACzB;AACA;AACA;AACA;AACA,sBAAsB,iGAAmB;AACzC;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;AACA,sBAAsB,sBAAsB;AAC5C,SAAS;AACT;AACA;AACA,2BAA2B,yDAAU;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gFAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,0FAAuB;AAC/B;AACA,sBAAsB,sBAAsB;AAC5C,SAAS;AACT;AACA;AACA;AACA;AACA,IAAI,gGAA0B;AAC9B;AACA;AACA;;;;;;;;;;;;;;;ACvIA;AACO;AACP;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;;;;;;;SCdA;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;AACC;AACF;AACI;AACC;AACE;AACO;AACuB;AACV;AACN;AACR;AACY;AACwB;AACE;AAChB;AACQ;AACM;AACE;AAC9B;AACvC;AACP,cAAc,4EAAmB,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/tagElement.ts","webpack://taggedjs/./ts/tag/tagRunner.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/processSubjectValue.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 Object.entries(newProps).forEach(([name, value]) => {\n if (value instanceof Function) {\n const toCall = newProps[name].toCall;\n if (toCall) {\n return; // already previously converted\n }\n newProps[name] = (...args) => {\n return newProps[name].toCall(...args); // what gets called can switch over parent state changes\n };\n // Currently, call self but over parent state changes, I may need to call a newer parent tag owner\n newProps[name].toCall = (...args) => {\n return callbackPropOwner(value, args, ownerSupport);\n };\n newProps[name].original = value;\n return;\n }\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 clones.forEach(clone => afterElmBuild(clone, options, context, tagSupport));\n tagSupport.clones.push(...clones);\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 names.forEach(name => element.classList.add(name));\n }\n else {\n names.forEach(name => element.classList.remove(name));\n }\n return;\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 /*\n if((element as any)[name] === value) {\n return // its already the value we are setting\n }\n */\n element[name] = value;\n}\nexport function interpolateAttributes(child, scope, ownerSupport) {\n const attrNames = child.getAttributeNames();\n let howToSet = howToSetAttribute;\n attrNames.forEach(attrName => {\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(element, context, tagSupport, options, children) {\n if (!children || element.tagName === 'TEMPLATE') {\n return { clones: [], tagComponents: [] }; // done\n }\n // counting for animation stagger computing\n const counts = options.counts;\n const clones = [];\n const tagComponents = [];\n const childArray = new Array(...children);\n childArray.forEach(child => {\n const { clones: nextClones, tagComponent } = interpolateTemplate(child, context, tagSupport, counts, options);\n clones.push(...nextClones);\n if (tagComponent) {\n tagComponents.push(tagComponent);\n return;\n }\n if (child.children) {\n const nextKids = new Array(...child.children);\n nextKids.forEach((subChild, 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(subChild, 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(container, context, ownerSupport, options, children);\n clones.push(...nextClones);\n tagComponents.push(...nextTagComponents);\n }\n interpolateAttributes(container, context, ownerSupport);\n processChildrenAttributes(children, context, ownerSupport);\n return { clones, tagComponents };\n}\nfunction processChildrenAttributes(children, context, ownerSupport) {\n new Array(...children).forEach(child => {\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 { processSubjectValue } from \"../tag/update/processSubjectValue.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 let isForceElement = options.forceElement;\n subscribeToTemplate(insertBefore, existingSubject, ownerSupport, counts, { isForceElement });\n return { clones };\n}\nexport function subscribeToTemplate(insertBefore, subject, ownerSupport, counts, // used for animation stagger computing\n{ isForceElement }) {\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 processSubjectValue(templater, subject, insertBefore, ownerSupport, {\n counts: { ...counts },\n forceElement: isForceElement,\n });\n if (isForceElement) {\n isForceElement = false; // only can happen once\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 new Array(...elm.children).forEach((child, 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 Object.entries(lastValue).forEach(([name]) => child.removeAttribute(name));\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 Object.entries(attrValue).forEach(([name, value]) => processNameValueAttr(name, value, child, ownerSupport, howToSet));\n return;\n }\n}\nfunction processNameValueAttr(attrName, result, child, ownerSupport, howToSet) {\n const isSpecial = isSpecialAttr(attrName);\n // attach as callback?\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 // child.addEventListener(attrName, 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 if (newAttrValue instanceof Function) {\n newAttrValue = bindSubjectCallback(newAttrValue, ownerSupport);\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 isTagComponent(value) {\n return value?.wrapper?.parentWrap.original instanceof Function;\n}\nexport 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}\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 providersWithChanges.forEach(provider => {\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 tagsWithProvider.forEach(({ tagSupport, renderCount, provider }) => {\n if (tagSupport.global.deleted) {\n return; // 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 return renderTagSupport(tagSupport, false);\n }\n });\n}\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 tagSupport.childTags.forEach(child => getTagsWithProvider(child, provider, memory));\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 state: State = memory.state\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 const cTagConfig = config.tagSupport;\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 // memory.state = config.array // [...config.array]\n memory.state.forEach(item => item.lastValue = getStateValue(item)); // set last values\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: This guard may no longer be needed\n /*\n if (config.rearray) {\n checkStateMismatch(tagSupport, config, state)\n }\n */\n config.rearray = [];\n if (state?.length) {\n state.forEach(state => getStateValue(state));\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 } from \"../subject\";\nimport { getSupportInCycle } from \"../tag/getSupportInCycle.function\";\nimport { setUse } from \"./setUse.function\";\nimport { state } from \"./state.function\";\nimport { syncStates } from \"./syncStates.function\";\nexport function subject(value, onSubscription) {\n const oldestState = state(() => setUse.memory.stateConfig.array);\n const nowTagSupport = getSupportInCycle();\n return new Subject(value, onSubscription).pipe(x => {\n syncStates(nowTagSupport.memory.state, oldestState);\n return x;\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 stateFrom.forEach((state, 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 this.subscribers.forEach(sub => {\n // (sub.callback as any).value = value\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, rej) => {\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();\n subject.methods = operations;\n subject.subscribeWith = (x) => this.subscribe(x);\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 subscription.subscriptions.forEach(subscription => subscription.unsubscribe());\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 // return newValue = next\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';\nimport { renderSubjectComponent } from './render/renderSubjectComponent.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 lastTemplateString = undefined; // used to compare templates for updates\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 forceElement: false,\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 isForceElement = options.forceElement;\n const elementContainer = document.createElement('div');\n elementContainer.id = 'tag-temp-holder';\n // render content with a first child that we can know is our first element\n elementContainer.innerHTML = `<template id=\"temp-template-tag-wrap\">${template.string}</template>`;\n // Search/replace innerHTML variables but don't interpolate tag components just yet\n const { tagComponents } = interpolateElement(elementContainer, context, template, this, // ownerSupport,\n {\n forceElement: options.forceElement,\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 tagComponents.forEach(tagComponent => {\n subscribeToTemplate(tagComponent.insertBefore, tagComponent.subject, tagComponent.ownerSupport, options.counts, { isForceElement });\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 this.lastTemplateString = interpolation.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 variableName = variablePrefix + index;\n const hasValue = values.length > 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 if (!hasValue) {\n return;\n }\n // 🆕 First time values below\n context[variableName] = processNewValue(hasValue, 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 // signify immediately child has been deleted (looked for during event processing)\n childTags.forEach(child => {\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 this.destroySubscriptions();\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 global = this.global;\n global.subscriptions.forEach(cloneSub => cloneSub.unsubscribe());\n global.subscriptions.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 const oldContext = this.global.context;\n Object.values(oldContext).forEach(value => {\n const clone = value.clone;\n if (clone && 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 /** Used during HMR only where static content itself could have been edited */\n async rebuild() {\n delete this.strings; // seek the templater strings instead now\n delete this.values; // seek the templater strings instead now\n restoreTagMarkers(this);\n const newSupport = renderSubjectComponent(this.subject, this, this.ownerTagSupport);\n await this.destroy();\n newSupport.buildBeforeElement(this.global.insertBefore, {\n forceElement: true,\n counts: { added: 0, removed: 0 },\n });\n return newSupport;\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 support.childTags.forEach(childTag => restoreTagMarkers(childTag.global.oldest));\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 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 wasArray.forEach(({ tagSupport }) => destroyArrayTag(tagSupport, { added: 0, removed: 0 }));\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 // 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 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 destroySimpleValue(insertBefore, displaySubject);\n return 'changed-simple-value';\n }\n return false;\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';\n// export const tags: TagComponentBase<any>[] = []\nexport const tags = [];\nlet tagCount = 0;\n/** Wraps a tag component in a state manager and always push children to last argument as an array */\n// export function tag<T>(a: T): T;\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}\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 childSubject.value.forEach(kid => {\n kid.values.forEach((value, index) => {\n if (!(value instanceof Function)) {\n return;\n }\n const valuesValue = kid.values[index];\n if (valuesValue.isChildOverride) {\n return; // 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 { BaseTagSupport } from './TagSupport.class';\nimport { runAfterRender, runBeforeRender } from './tagRunner';\nimport { ValueSubject } from '../subject/ValueSubject';\nconst appElements = [];\nexport function tagElement(\n// app: TagComponent, // (...args: unknown[]) => TemplaterResult,\napp, // (...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 // newSupport.ownerTagSupport = newSupport\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","// TODO: This should be more like `new TaggedJs().use({})`\nimport { 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 setUse.tagUse.forEach(tagUse => tagUse.beforeRender(tagSupport, ownerSupport));\n}\n// Life cycle 2\nexport function runAfterRender(tagSupport, ownerTagSupport) {\n setUse.tagUse.forEach(tagUse => tagUse.afterRender(tagSupport, ownerTagSupport));\n setUse.memory.tagClosed$.next(ownerTagSupport);\n}\n// Life cycle 3\nexport function runBeforeRedraw(tagSupport, ownerTagSupport) {\n setUse.tagUse.forEach(tagUse => tagUse.beforeRedraw(tagSupport, ownerTagSupport));\n}\n// Life cycle 4 - end of life\nexport function runBeforeDestroy(tagSupport, ownerTagSupport) {\n setUse.tagUse.forEach(tagUse => tagUse.beforeDestroy(tagSupport, ownerTagSupport));\n}\n","import { ValueSubject } from '../../subject/ValueSubject';\nimport { isSubjectInstance, isTagClass, isTagComponent, isTagTemplater } from '../../isInstance';\nimport { TemplaterResult } from '../../TemplaterResult.class';\nimport { TagSupport } from '../TagSupport.class';\nexport function processNewValue(hasValue, value, ownerSupport) {\n if (isTagComponent(value)) {\n const tagSubject = new ValueSubject(value);\n return tagSubject;\n }\n if (value instanceof Function) {\n return new ValueSubject(value);\n }\n if (!hasValue) {\n return new ValueSubject(undefined);\n }\n if (isTagTemplater(value)) {\n const templater = value;\n const tag = templater.tag;\n return processNewTag(tag, ownerSupport);\n }\n if (isTagClass(value)) {\n return processNewTag(value, ownerSupport);\n }\n // is already a value subject?\n if (isSubjectInstance(value)) {\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 const tagSupport = subject.tagSupport = new TagSupport(templater, ownerSupport, subject);\n return subject;\n}\n","import { 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 // Processing of regular values\n const clone = updateBeforeTemplate(value, before);\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 || options.forceElement;\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 { processSubjectComponent } from './processSubjectComponent.function';\nimport { isTagArray, isTagClass, isTagComponent, isTagTemplater } from '../../isInstance';\nimport { processTagArray } from './processTagArray';\nimport { processRegularValue } from './processRegularValue.function';\nimport { processTag, tagFakeTemplater } from './processTag.function';\nvar ValueTypes;\n(function (ValueTypes) {\n ValueTypes[\"tag\"] = \"tag\";\n ValueTypes[\"templater\"] = \"templater\";\n ValueTypes[\"tagArray\"] = \"tag-array\";\n ValueTypes[\"tagComponent\"] = \"tag-component\";\n ValueTypes[\"value\"] = \"value\";\n})(ValueTypes || (ValueTypes = {}));\nfunction getValueType(value) {\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 return ValueTypes.value;\n}\n// export type ExistingValue = TemplaterResult | Tag[] | TagSupport | Function | Subject<unknown> | RegularValue | Tag\nexport function processSubjectValue(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 }\n processRegularValue(value, subject, insertBefore);\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 = new TagSupport(templater, ownerSupport, subject);\n setupNewTemplater(tagSupport, ownerSupport, subject);\n ownerSupport.childTags.push(tagSupport);\n }\n subject.tagSupport = tagSupport;\n tagSupport.ownerTagSupport = ownerSupport;\n tagSupport.buildBeforeElement(insertBefore, {\n counts: { added: 0, removed: 0 },\n forceElement: true,\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}\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 value.forEach((item, 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 // tagSupport.templater = subTag.templater\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 ownerTagContent: ownerSupport.lastTemplateString,\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 }\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, forceElement: options.forceElement });\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, forceElement, }) {\n // *if appears we already have seen\n const subjectTag = subject;\n const lastSupport = subjectTag.tagSupport;\n const prevSupport = lastSupport?.global.oldest || undefined; // || tag.tagSupport.oldest // subjectTag.tag\n const justUpdate = prevSupport; // && !forceElement\n if (prevSupport && justUpdate) {\n return processTagResultUpdate(tagSupport, subjectTag, prevSupport);\n }\n tagSupport.buildBeforeElement(insertBefore, {\n counts,\n forceElement,\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.compareTo === newFunction.compareTo // ???\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 forceElement: false,\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 forceElement: true,\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 newPropsArray.forEach((argPosition, index) => {\n if (typeof (argPosition) !== 'object') {\n return;\n }\n const priorProps = priorPropsArray[index];\n if (typeof (priorProps) !== 'object') {\n return;\n }\n Object.entries(argPosition).forEach(([name, value]) => {\n if (!(value instanceof Function)) {\n return;\n }\n const newCallback = argPosition[name]; // || value\n const original = newCallback instanceof Function && newCallback.toCall;\n if (original) {\n return; // 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 return;\n });\n });\n}\n","import { TagSupport } from '../TagSupport.class';\nimport { TemplaterResult } from '../../TemplaterResult.class';\nimport { isSubjectInstance, isTagArray, isTagClass, isTagComponent, isTagTemplater } from '../../isInstance';\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 { bindSubjectCallback } from '../../interpolations/bindSubjectCallback.function';\nimport { setupNewTemplater, getFakeTemplater, processTag } from './processTag.function';\nexport function updateExistingValue(subject, value, ownerSupport, insertBefore) {\n const subjectTag = subject;\n const isComponent = isTagComponent(value);\n checkDestroyPrevious(subject, value, insertBefore);\n // handle already seen tag components\n if (isComponent) {\n return prepareUpdateToComponent(value, subjectTag, insertBefore, ownerSupport);\n }\n // was component but no longer\n const tagSupport = subjectTag.tagSupport;\n if (tagSupport) {\n handleStillTag(subject, value, ownerSupport);\n return subjectTag;\n }\n // its another tag array\n if (isTagArray(value)) {\n processTagArray(subject, value, insertBefore, // oldInsertBefore as InsertBefore,\n ownerSupport, { counts: {\n added: 0,\n removed: 0,\n } });\n return subject;\n }\n if (isTagTemplater(value)) {\n processTag(value, insertBefore, ownerSupport, subjectTag);\n return subjectTag;\n }\n if (isTagClass(value)) {\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 }\n // we have been given a subject\n if (isSubjectInstance(value)) {\n return value;\n }\n // now its a function\n if (value instanceof Function) {\n const bound = bindSubjectCallback(value, ownerSupport);\n subject.set(bound);\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 forceElement: true,\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 = [...newestState]\n tagSupport.memory.state.length = 0;\n tagSupport.memory.state.push(...newestState);\n }\n else {\n restoreTagMarker(subjectSup);\n /*\n const placeholder = subjectSup.global.placeholder\n if(placeholder && !insertBefore.parentNode) {\n insertAfter(insertBefore,placeholder)\n delete subjectSup.global.placeholder\n }\n */\n processSubjectComponent(templater, subjectTag, insertBefore, ownerSupport, {\n forceElement: true,\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, lastFirstChild) {\n const parent = lastFirstChild.parentNode;\n let castedValue = value;\n // mimic React skipping to display EXCEPT for true does display on page\n if ([undefined, false, null].includes(value)) { // || value === true\n castedValue = '';\n }\n // Insert the new value (never use innerHTML here)\n const textNode = document.createTextNode(castedValue); // never innerHTML\n parent.insertBefore(textNode, lastFirstChild);\n /* remove existing nodes */\n parent.removeChild(lastFirstChild);\n return textNode;\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/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":""}
|
package/js/state/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./watch.function";
|
|
|
2
2
|
export { setUse } from "./setUse.function";
|
|
3
3
|
export { state } from "./state.function";
|
|
4
4
|
export * from "./subject.function";
|
|
5
|
+
export * from "./letProp.function";
|
|
5
6
|
export { letState } from "./letState.function";
|
|
6
7
|
export { State } from "./state.utils";
|
|
7
8
|
export { providers } from "./providers";
|
package/js/state/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./watch.function";
|
|
|
2
2
|
export { setUse } from "./setUse.function";
|
|
3
3
|
export { state } from "./state.function";
|
|
4
4
|
export * from "./subject.function";
|
|
5
|
+
export * from "./letProp.function";
|
|
5
6
|
export { letState } from "./letState.function";
|
|
6
7
|
export { providers } from "./providers";
|
|
7
8
|
export * from "./callbackMaker.function";
|
package/js/state/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/state/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GetSet } from "./state.utils";
|
|
2
|
+
/**
|
|
3
|
+
* Enables the ability to maintain a change to a props value until the prop itself changes
|
|
4
|
+
* @param prop typically the name of an existing prop
|
|
5
|
+
* @returns immediately call the returned function: letProp(y)(x => [y, y=x])
|
|
6
|
+
*/
|
|
7
|
+
export declare function letProp<T>(prop: T): ((getSet: GetSet<T>) => T);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { letState } from "./letState.function";
|
|
2
|
+
import { watch } from "./watch.function";
|
|
3
|
+
/**
|
|
4
|
+
* Enables the ability to maintain a change to a props value until the prop itself changes
|
|
5
|
+
* @param prop typically the name of an existing prop
|
|
6
|
+
* @returns immediately call the returned function: letProp(y)(x => [y, y=x])
|
|
7
|
+
*/
|
|
8
|
+
export function letProp(prop) {
|
|
9
|
+
return getSetProp => {
|
|
10
|
+
let myProp = letState(prop)(getSetProp);
|
|
11
|
+
watch([prop], () => getSetProp(myProp = prop));
|
|
12
|
+
getSetProp(myProp);
|
|
13
|
+
return myProp;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=letProp.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"letProp.function.js","sourceRoot":"","sources":["../../ts/state/letProp.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAExC;;;;GAIG;AACH,MAAM,UAAU,OAAO,CACrB,IAAO;IAEP,OAAO,UAAU,CAAC,EAAE;QAClB,IAAI,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAA;QAEvC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAA;QAE9C,UAAU,CAAC,MAAM,CAAC,CAAA;QAElB,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;AACH,CAAC"}
|
package/js/state/state.utils.js
CHANGED
|
@@ -42,19 +42,16 @@ export function getStateValue(state) {
|
|
|
42
42
|
if (!callback) {
|
|
43
43
|
return state.defaultValue;
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
const [oldValue] = oldState;
|
|
47
|
-
const [checkValue] = callback(oldValue); // set back to original value
|
|
45
|
+
const [value, checkValue] = getCallbackValue(callback);
|
|
48
46
|
if (checkValue !== StateEchoBack) {
|
|
49
47
|
const message = 'State property not used correctly. Second item in array is not setting value as expected.\n\n' +
|
|
50
48
|
'For "let" state use `let name = state(default)(x => [name, name = x])`\n\n' +
|
|
51
49
|
'For "const" state use `const name = state(default)()`\n\n' +
|
|
52
50
|
'Problem state:\n' + (callback ? callback.toString() : JSON.stringify(state)) + '\n';
|
|
53
|
-
console.error(message, { state, callback,
|
|
51
|
+
console.error(message, { state, callback, value, checkValue });
|
|
54
52
|
throw new Error(message);
|
|
55
53
|
}
|
|
56
|
-
|
|
57
|
-
return oldValue;
|
|
54
|
+
return value;
|
|
58
55
|
}
|
|
59
56
|
export class StateEchoBack {
|
|
60
57
|
}
|
|
@@ -105,4 +102,10 @@ function checkStateMismatch(
|
|
|
105
102
|
})
|
|
106
103
|
}
|
|
107
104
|
*/
|
|
105
|
+
export function getCallbackValue(callback) {
|
|
106
|
+
const oldState = callback(StateEchoBack); // get value and set to undefined
|
|
107
|
+
const [value] = oldState;
|
|
108
|
+
const [checkValue] = callback(value); // set back to original value
|
|
109
|
+
return [value, checkValue];
|
|
110
|
+
}
|
|
108
111
|
//# sourceMappingURL=state.utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.utils.js","sourceRoot":"","sources":["../../ts/state/state.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAG9C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"state.utils.js","sourceRoot":"","sources":["../../ts/state/state.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAG9C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAoB1C,MAAM,CAAC,MAAM,CAAC,WAAW,GAAG;IAC1B,KAAK,EAAE,EAAW,EAAE,mCAAmC;IACvD,wBAAwB;CACf,CAAA;AAIX,MAAM,YAAY,GAAG,CAAC,UAA0B,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AAE1E,MAAM,CAAC;IACL,YAAY;IACZ,YAAY,EAAE,YAAY;IAC1B,WAAW,EAAE,CACX,UAA0B,EAC1B,EAAE;QACF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA;QAChC,oCAAoC;QACpC,MAAM,MAAM,GAAW,MAAM,CAAC,MAAM,CAAC,WAAW,CAAA;QAChD,MAAM,OAAO,GAAG,MAAM,CAAC,OAA6B,CAAA;QAEpD,IAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAClB,IAAG,OAAO,CAAC,MAAM,KAAK,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;gBAC1C,MAAM,OAAO,GAAG,+BAA+B,OAAO,CAAC,MAAM,QAAQ,MAAM,CAAC,KAAK,CAAC,MAAM,6OAA6O,CAAA;gBACrU,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,EAAE,OAAkB,CAAA;gBACxD,MAAM,OAAO,GAAG;oBACd,SAAS,EAAE,MAAM,CAAC,KAAK;oBACvB,SAAS,EAAE,MAAM,CAAC,OAAO;oBACzB,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;iBACzC,CAAA;gBACD,MAAM,KAAK,GAAG,IAAI,kBAAkB,CAAC,OAAO,EAAC,OAAO,CAAC,CAAA;gBACrD,OAAO,CAAC,IAAI,CAAC,OAAO,EAAC,OAAO,CAAC,CAAA;gBAC7B,MAAM,KAAK,CAAA;YACb,CAAC;QACH,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,UAA+B,CAAA;QACzD,OAAO,MAAM,CAAC,OAAO,CAAA,CAAC,6BAA6B;QACnD,OAAO,MAAM,CAAC,UAAU,CAAA;QAExB,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QACvB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;QAClC,mDAAmD;QACnD,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,CAAA,CAAC,kBAAkB;QAErF,MAAM,CAAC,KAAK,GAAG,EAAE,CAAA;IACnB,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,UAAU,aAAa,CAC3B,KAAyB;IAEzB,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAA;IAE/B,IAAG,CAAC,QAAQ,EAAE,CAAC;QACb,OAAO,KAAK,CAAC,YAAY,CAAA;IAC3B,CAAC;IAED,MAAM,CAAC,KAAK,EAAC,UAAU,CAAC,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAA;IAErD,IAAG,UAAU,KAAK,aAAa,EAAE,CAAC;QAChC,MAAM,OAAO,GAAG,+FAA+F;YAC/G,4EAA4E;YAC5E,2DAA2D;YAC3D,kBAAkB,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,GAAE,IAAI,CAAA;QAEnF,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,EAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAC,CAAC,CAAA;QAE5D,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAC1B,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,OAAO,aAAa;CAAG;AAE7B,SAAS,SAAS,CAChB,UAA0B;IAE1B,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA;IAChC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAc,CAAA;IACnC,MAAM,MAAM,GAAW,MAAM,CAAC,MAAM,CAAC,WAAW,CAAA;IAEhD,2CAA2C;IAC3C;;;;MAIE;IAEF,MAAM,CAAC,OAAO,GAAG,EAAE,CAAA;IACnB,IAAG,KAAK,EAAE,MAAM,EAAE,CAAC;QACjB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;QAC5C,MAAM,CAAC,OAAO,CAAC,IAAI,CAAE,GAAG,KAAK,CAAE,CAAA;IACjC,CAAC;IAED,MAAM,CAAC,UAAU,GAAG,UAAU,CAAA;AAChC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BE;AAEF,MAAM,UAAU,gBAAgB,CAC9B,QAAwB;IAExB,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAoB,CAAC,CAAA,CAAC,iCAAiC;IACjF,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAA;IACxB,MAAM,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAE,KAAK,CAAE,CAAA,CAAC,6BAA6B;IACpE,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;AAC5B,CAAC"}
|