taggedjs 2.8.29 → 2.8.30
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/README.md +19 -0
- package/bundle.js +1 -1
- package/bundle.js.map +1 -1
- package/js/alterProp.function.d.ts +5 -3
- package/js/alterProp.function.js +22 -9
- package/js/alterProp.function.js.map +1 -1
- package/js/castTextValue.function.d.ts +4 -0
- package/js/castTextValue.function.js +11 -0
- package/js/castTextValue.function.js.map +1 -0
- package/js/index.d.ts +8 -8
- package/js/index.js +8 -8
- package/js/index.js.map +1 -1
- package/js/interpolations/attributes/bindSubjectCallback.function.js +1 -1
- package/js/interpolations/attributes/bindSubjectCallback.function.js.map +1 -1
- package/js/interpolations/attributes/getUpTags.function.js +1 -1
- package/js/interpolations/attributes/getUpTags.function.js.map +1 -1
- package/js/interpolations/attributes/howToSetInputValue.function.js +2 -4
- package/js/interpolations/attributes/howToSetInputValue.function.js.map +1 -1
- package/js/interpolations/attributes/processAttribute.function.js +18 -8
- package/js/interpolations/attributes/processAttribute.function.js.map +1 -1
- package/js/interpolations/attributes/processNameValueAttribute.function.d.ts +1 -1
- package/js/interpolations/attributes/processNameValueAttribute.function.js +1 -1
- package/js/interpolations/attributes/processNameValueAttribute.function.js.map +1 -1
- package/js/interpolations/attributes/renderTagArray.function.js +2 -2
- package/js/interpolations/attributes/renderTagArray.function.js.map +1 -1
- package/js/interpolations/attributes/specialAttribute.d.ts +1 -1
- package/js/interpolations/attributes/specialAttribute.js +2 -2
- package/js/interpolations/attributes/specialAttribute.js.map +1 -1
- package/js/interpolations/attributes/updateAttribute.function.js +2 -2
- package/js/interpolations/attributes/updateAttribute.function.js.map +1 -1
- package/js/interpolations/index.d.ts +0 -1
- package/js/interpolations/index.js +0 -1
- package/js/interpolations/index.js.map +1 -1
- package/js/interpolations/optimizers/ObjectNode.types.d.ts +1 -1
- package/js/interpolations/optimizers/attachDomElements.function.js +12 -10
- package/js/interpolations/optimizers/attachDomElements.function.js.map +1 -1
- package/js/interpolations/optimizers/attachDynamicDom.function.js +8 -8
- package/js/interpolations/optimizers/attachDynamicDom.function.js.map +1 -1
- package/js/interpolations/optimizers/domProcessContextItem.function.d.ts +1 -1
- package/js/interpolations/optimizers/domProcessContextItem.function.js +3 -3
- package/js/interpolations/optimizers/domProcessContextItem.function.js.map +1 -1
- package/js/interpolations/optimizers/htmlInterpolationToDomMeta.function.js +11 -5
- package/js/interpolations/optimizers/htmlInterpolationToDomMeta.function.js.map +1 -1
- package/js/interpolations/optimizers/parseHTML.function.js +9 -6
- package/js/interpolations/optimizers/parseHTML.function.js.map +1 -1
- package/js/interpolations/optimizers/replacePlaceholders.function.js +9 -5
- package/js/interpolations/optimizers/replacePlaceholders.function.js.map +1 -1
- package/js/isInstance.d.ts +1 -0
- package/js/isInstance.js +1 -0
- package/js/isInstance.js.map +1 -1
- package/js/render/afterRender.function.d.ts +6 -0
- package/js/render/afterRender.function.js +21 -0
- package/js/render/afterRender.function.js.map +1 -0
- package/js/render/attributes/processAttribute.function.d.ts +20 -0
- package/js/render/attributes/processAttribute.function.js +157 -0
- package/js/render/attributes/processAttribute.function.js.map +1 -0
- package/js/render/attributes/processUpdateAttrContext.function.d.ts +3 -0
- package/js/render/attributes/processUpdateAttrContext.function.js +17 -0
- package/js/render/attributes/processUpdateAttrContext.function.js.map +1 -0
- package/js/render/buildBeforeElement.function.d.ts +9 -0
- package/js/render/buildBeforeElement.function.js +49 -0
- package/js/render/buildBeforeElement.function.js.map +1 -0
- package/js/render/destroySupport.function.d.ts +3 -0
- package/js/render/destroySupport.function.js +17 -0
- package/js/render/destroySupport.function.js.map +1 -0
- package/js/render/dom/attachDomElements.function.d.ts +12 -0
- package/js/render/dom/attachDomElements.function.js +87 -0
- package/js/render/dom/attachDomElements.function.js.map +1 -0
- package/js/render/executeWrap.function.d.ts +5 -0
- package/js/render/executeWrap.function.js +26 -0
- package/js/render/executeWrap.function.js.map +1 -0
- package/js/render/index.d.ts +5 -0
- package/js/render/index.js +6 -0
- package/js/render/index.js.map +1 -0
- package/js/render/paint.function.d.ts +18 -0
- package/js/render/paint.function.js +61 -0
- package/js/render/paint.function.js.map +1 -0
- package/js/render/registerNewTagElement.function.d.ts +4 -0
- package/js/render/registerNewTagElement.function.js +35 -0
- package/js/render/registerNewTagElement.function.js.map +1 -0
- package/js/render/renderExistingTag.function.d.ts +6 -0
- package/js/render/renderExistingTag.function.js +20 -0
- package/js/render/renderExistingTag.function.js.map +1 -0
- package/js/render/renderSupport.function.d.ts +9 -0
- package/js/render/renderSupport.function.js +81 -0
- package/js/render/renderSupport.function.js.map +1 -0
- package/js/render/renderTagElement.function.d.ts +22 -0
- package/js/render/renderTagElement.function.js +80 -0
- package/js/render/renderTagElement.function.js.map +1 -0
- package/js/render/renderTagOnly.function.d.ts +4 -0
- package/js/render/renderTagOnly.function.js +37 -0
- package/js/render/renderTagOnly.function.js.map +1 -0
- package/js/render/renderWithSupport.function.d.ts +9 -0
- package/js/render/renderWithSupport.function.js +51 -0
- package/js/render/renderWithSupport.function.js.map +1 -0
- package/js/render/softDestroySupport.function.d.ts +3 -0
- package/js/render/softDestroySupport.function.js +27 -0
- package/js/render/softDestroySupport.function.js.map +1 -0
- package/js/render/update/processRenderOnceInit.function.d.ts +8 -0
- package/js/render/update/processRenderOnceInit.function.js +17 -0
- package/js/render/update/processRenderOnceInit.function.js.map +1 -0
- package/js/render/update/processTag.function.d.ts +18 -0
- package/js/render/update/processTag.function.js +41 -0
- package/js/render/update/processTag.function.js.map +1 -0
- package/js/render/update/updateExistingTagComponent.function.d.ts +8 -0
- package/js/render/update/updateExistingTagComponent.function.js +118 -0
- package/js/render/update/updateExistingTagComponent.function.js.map +1 -0
- package/js/render/update/updateSupportBy.function.d.ts +3 -0
- package/js/render/update/updateSupportBy.function.js +19 -0
- package/js/render/update/updateSupportBy.function.js.map +1 -0
- package/js/state/callbackStateUpdate.function.js +4 -5
- package/js/state/callbackStateUpdate.function.js.map +1 -1
- package/js/state/handleProviderChanges.function.d.ts +1 -2
- 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/providers.d.ts +2 -1
- package/js/state/providers.js +43 -39
- package/js/state/providers.js.map +1 -1
- package/js/state/providersChangeCheck.function.js +4 -1
- package/js/state/providersChangeCheck.function.js.map +1 -1
- package/js/state/states.utils.js +5 -4
- package/js/state/states.utils.js.map +1 -1
- package/js/state/subscribe.function.d.ts +2 -0
- package/js/state/subscribe.function.js +1 -0
- package/js/state/subscribe.function.js.map +1 -1
- package/js/state/subscribeWith.function.d.ts +3 -0
- package/js/state/subscribeWith.function.js +16 -0
- package/js/state/subscribeWith.function.js.map +1 -0
- package/js/state/syncStates.function.js +22 -18
- package/js/state/syncStates.function.js.map +1 -1
- package/js/tag/Context.types.d.ts +18 -10
- package/js/tag/buildBeforeElement.function.js +3 -3
- package/js/tag/buildBeforeElement.function.js.map +1 -1
- package/js/tag/checkDestroyPrevious.function.d.ts +0 -2
- package/js/tag/checkDestroyPrevious.function.js +0 -18
- package/js/tag/checkDestroyPrevious.function.js.map +1 -1
- package/js/tag/checkSimpleValueChange.function.d.ts +3 -0
- package/js/tag/checkSimpleValueChange.function.js +27 -0
- package/js/tag/checkSimpleValueChange.function.js.map +1 -0
- package/js/tag/checkTagValueChange.function.d.ts +1 -1
- package/js/tag/checkTagValueChange.function.js +10 -15
- package/js/tag/checkTagValueChange.function.js.map +1 -1
- package/js/tag/clonePropsBy.function.js +8 -2
- package/js/tag/clonePropsBy.function.js.map +1 -1
- package/js/tag/createHtmlSupport.function.d.ts +3 -3
- package/js/tag/createHtmlSupport.function.js +1 -1
- package/js/tag/createHtmlSupport.function.js.map +1 -1
- package/js/tag/destroyContext.function.d.ts +2 -1
- package/js/tag/destroyContext.function.js +14 -4
- package/js/tag/destroyContext.function.js.map +1 -1
- package/js/tag/destroySupport.function.js +1 -1
- package/js/tag/destroySupport.function.js.map +1 -1
- package/js/tag/findValuePath.function.d.ts +3 -0
- package/js/tag/findValuePath.function.js +24 -0
- package/js/tag/findValuePath.function.js.map +1 -0
- package/js/tag/getStringsId.function.js +4 -1
- package/js/tag/getStringsId.function.js.map +1 -1
- package/js/tag/getTagWrap.function.js +3 -3
- package/js/tag/getTagWrap.function.js.map +1 -1
- package/js/tag/hasPropChanges.function.js +2 -2
- package/js/tag/hasPropChanges.function.js.map +1 -1
- package/js/tag/hasSupportChanged.function.d.ts +1 -0
- package/js/tag/hasSupportChanged.function.js +1 -0
- package/js/tag/hasSupportChanged.function.js.map +1 -1
- package/js/tag/index.d.ts +3 -6
- package/js/tag/index.js +3 -6
- package/js/tag/index.js.map +1 -1
- package/js/tag/isLikeTags.function.js +1 -1
- package/js/tag/isLikeTags.function.js.map +1 -1
- package/js/tag/loadNewBaseSupport.function.d.ts +4 -0
- package/js/tag/loadNewBaseSupport.function.js +11 -0
- package/js/tag/loadNewBaseSupport.function.js.map +1 -0
- package/js/tag/output.function.d.ts +2 -0
- package/js/tag/output.function.js +29 -0
- package/js/tag/output.function.js.map +1 -0
- package/js/tag/paint.function.d.ts +8 -4
- package/js/tag/paint.function.js +17 -16
- package/js/tag/paint.function.js.map +1 -1
- package/js/tag/processUpdateContext.function.d.ts +0 -3
- package/js/tag/processUpdateContext.function.js +1 -1
- package/js/tag/processUpdateContext.function.js.map +1 -1
- package/js/tag/props/alterProp.function.d.ts +29 -0
- package/js/tag/props/alterProp.function.js +149 -0
- package/js/tag/props/alterProp.function.js.map +1 -0
- package/js/tag/props/clonePropsBy.function.d.ts +6 -0
- package/js/tag/props/clonePropsBy.function.js +33 -0
- package/js/tag/props/clonePropsBy.function.js.map +1 -0
- package/js/tag/props/output.function.d.ts +1 -0
- package/js/tag/props/output.function.js +15 -0
- package/js/tag/props/output.function.js.map +1 -0
- package/js/tag/render/afterRender.function.d.ts +6 -0
- package/js/tag/render/afterRender.function.js +21 -0
- package/js/tag/render/afterRender.function.js.map +1 -0
- package/js/tag/render/renderTagOnly.function.js +1 -1
- package/js/tag/render/renderTagOnly.function.js.map +1 -1
- package/js/tag/render/softDestroySupport.function.js +2 -2
- package/js/tag/render/softDestroySupport.function.js.map +1 -1
- package/js/tag/smartRemoveKids.function.js +32 -22
- package/js/tag/smartRemoveKids.function.js.map +1 -1
- package/js/tag/tag.function.js +1 -1
- package/js/tag/tag.function.js.map +1 -1
- package/js/tag/tagElement.d.ts +4 -3
- package/js/tag/tagElement.js +6 -115
- package/js/tag/tagElement.js.map +1 -1
- package/js/tag/update/compareArrayItems.function.d.ts +1 -1
- package/js/tag/update/compareArrayItems.function.js +6 -3
- package/js/tag/update/compareArrayItems.function.js.map +1 -1
- package/js/tag/update/createAndProcessContextItem.function.d.ts +3 -3
- package/js/tag/update/createAndProcessContextItem.function.js +10 -11
- package/js/tag/update/createAndProcessContextItem.function.js.map +1 -1
- package/js/tag/update/forceUpdateExistingValue.function.d.ts +2 -2
- package/js/tag/update/forceUpdateExistingValue.function.js.map +1 -1
- package/js/tag/update/handleStillTag.function.js +1 -1
- package/js/tag/update/handleStillTag.function.js.map +1 -1
- package/js/tag/update/oneRenderToSupport.function.js +1 -1
- package/js/tag/update/oneRenderToSupport.function.js.map +1 -1
- package/js/tag/update/processDomTagInit.function.js +1 -1
- package/js/tag/update/processDomTagInit.function.js.map +1 -1
- package/js/tag/update/processFirstSubjectComponent.function.js +1 -1
- package/js/tag/update/processFirstSubjectComponent.function.js.map +1 -1
- package/js/tag/update/processFirstSubjectValue.function.js +13 -4
- package/js/tag/update/processFirstSubjectValue.function.js.map +1 -1
- package/js/tag/update/processNewSubjectTag.function.js +13 -13
- package/js/tag/update/processNewSubjectTag.function.js.map +1 -1
- package/js/tag/update/processRegularValue.function.js +18 -5
- package/js/tag/update/processRegularValue.function.js.map +1 -1
- package/js/tag/update/processSubscribe.function.d.ts +3 -1
- package/js/tag/update/processSubscribe.function.js +9 -0
- package/js/tag/update/processSubscribe.function.js.map +1 -1
- package/js/tag/update/processTagArray.js +4 -5
- package/js/tag/update/processTagArray.js.map +1 -1
- package/js/tag/update/processTagInit.function.js +1 -1
- package/js/tag/update/processTagInit.function.js.map +1 -1
- package/js/tag/update/processTagResult.function.js +6 -6
- package/js/tag/update/processTagResult.function.js.map +1 -1
- package/js/tag/update/setupSubscribe.function.d.ts +8 -8
- package/js/tag/update/setupSubscribe.function.js +61 -39
- package/js/tag/update/setupSubscribe.function.js.map +1 -1
- package/js/tag/update/syncPriorPropFunction.function.d.ts +1 -1
- package/js/tag/update/syncPriorPropFunction.function.js +1 -1
- package/js/tag/update/syncPriorPropFunction.function.js.map +1 -1
- package/js/tag/update/tagValueUpdateHandler.function.d.ts +9 -0
- package/js/tag/update/tagValueUpdateHandler.function.js +25 -0
- package/js/tag/update/tagValueUpdateHandler.function.js.map +1 -0
- package/js/tag/update/tryUpdateToTag.function.js +2 -2
- package/js/tag/update/tryUpdateToTag.function.js.map +1 -1
- package/js/tag/update/updateExistingArray.function.d.ts +1 -1
- package/js/tag/update/updateExistingObject.function.d.ts +1 -1
- package/js/tag/update/updateExistingValue.function.js +1 -1
- package/js/tag/update/updateExistingValue.function.js.map +1 -1
- package/js/updateBeforeTemplate.function.d.ts +3 -2
- package/js/updateBeforeTemplate.function.js +5 -7
- package/js/updateBeforeTemplate.function.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
# taggedjs
|
|
2
2
|
tagged template reactive html
|
|
3
|
+
|
|
4
|
+
### Props
|
|
5
|
+
|
|
6
|
+
Rendering back to calling/parent tag will only occur for root and level 1 function props
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
// ✅
|
|
10
|
+
const component = tag((onchange) => html`<textarea onchange=${onchange}></textarea>`)
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
// ✅
|
|
15
|
+
const component = tag(({onchange}) => html`<textarea onchange=${onchange}></textarea>`)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
// ❌
|
|
20
|
+
const component = tag(({textarea:{onchange}}) => html`<textarea onchange=${onchange}></textarea>`)
|
|
21
|
+
```
|
package/bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function n(t){return t.renderCount=t.renderCount||0,t.global={}}t.d(e,{W9:()=>fe,cg:()=>c,m0:()=>s,rS:()=>ke,Y2:()=>r,ei:()=>de,B7:()=>R,TU:()=>L,XF:()=>ge,PC:()=>pe,Ot:()=>un,Mj:()=>ln,tD:()=>a,j8:()=>Qt,um:()=>qt,E2:()=>Sn,OH:()=>jn,TB:()=>Jt,Ii:()=>Nt,yV:()=>oe,zV:()=>I,pf:()=>Xe,ze:()=>Tn,WJ:()=>M,Ng:()=>Wt,VI:()=>se,aZ:()=>It,O:()=>Ot,Ie:()=>o,B4:()=>Ze,Az:()=>or,Xi:()=>Wn,Ah:()=>n,ck:()=>Nn,Gk:()=>ue,zC:()=>Be,cF:()=>fr,jU:()=>Q,PB:()=>q,qy:()=>sr,cy:()=>S,Tn:()=>C,Gv:()=>k,yL:()=>w,D8:()=>b,Ze:()=>m,_4:()=>y,mn:()=>v,z:()=>Cn,sA:()=>An,MG:()=>xn,PL:()=>le,nI:()=>h,PZ:()=>_t,N_:()=>pr,r5:()=>kn,uc:()=>Le,pG:()=>ve,QB:()=>Ve,R6:()=>ir,Ll:()=>B,vP:()=>cn,wk:()=>gn,xP:()=>wn,bc:()=>yn,B1:()=>On,ag:()=>En,Tc:()=>Se,Hf:()=>ar,_A:()=>ie,Ag:()=>Ge,NU:()=>Jn,hW:()=>In,wB:()=>hn,id:()=>pn,MC:()=>fn,SZ:()=>dn});class r{get(t){return"todo"}}const o="";var s,c;!function(t){t.string="string",t.number="number",t.boolean="boolean",t[void 0]="undefined"}(s||(s={})),function(t){t.function="function",t.date="date",t.unknown="unknown",t.object="object"}(c||(c={}));const a={tag:"html",dom:"dom",templater:"templater",tagComponent:"tagComponent",tagArray:"tagArray",subscribe:"subscribe",signal:"signal",renderOnce:"renderOnce",stateRender:"stateRender",version:Date.now()};let u=[],i=[],l=[],p=[],f=[],d=[];const g={locks:0};function h(){if(!(g.locks>0)){for(let t=u.length-1;t>=0;--t){const e=u[t];e.parentNode.removeChild(e)}for(const t of i)t();for(const[t,e]of l)e.textContent=t;for(const t of p)t.relative.appendChild(t.element);for(const{element:t,relative:e}of f)e.parentNode.insertBefore(t,e);u=[],i=[],p=[],f=[],l=[];for(const t of d)t();d=[]}}function b(t){switch(t){case s.string:case s.number:case s.boolean:return!0}return!1}function m(t){if(!t)return!1;switch(t.tagJsType){case a.dom:case a.tag:case a.templater:return!0}return!1}function v(t){const e=t?.tagJsType;return e===a.tagComponent||e===a.stateRender}function y(t){return k(t)&&typeof t.subscribe===c.function}function w(t){return t&&C(t.then)}function C(t){return typeof t===c.function}function k(t){return typeof t===c.object&&null!==t}function S(t){return Array.isArray(t)}function T(t){let e=t;for(;e.ownerSupport&&!v(e.templater);)e=e.ownerSupport;return e.subject.global.newest||e}function j(t){const e=B.stateConfig;return e.states[e.statesIndex]=t,++e.statesIndex,t(((...t)=>t))}function E(t){const e=B.stateConfig,n=e.statesIndex,r=T(e.prevSupport).states[n];let o=[];r((function(...t){return o=t,t}));return e.states[e.statesIndex]=t,++e.statesIndex,t(((...t)=>o))}function x(t,e){e.handlers.handler=J,e.handlers.statesHandler=j,e.rearray=[],e.stateArray=[],e.states=[],e.statesIndex=0,e.support=t}function A(t,e,n,r){n.rearray=r,n.stateArray=[],n.states=[],n.statesIndex=0,n.handlers.handler=V,n.handlers.statesHandler=E,n.prevSupport=e}class O{}function P(t){const e=t.callback;if(!e)return t.defaultValue;const[n]=function(t){const[e]=t(O),[n]=t(e);return[e,n]}(e);return n}function V(){const t=B.stateConfig,e=t.rearray[t.stateArray.length];return t.stateArray.push(e),e.defaultValue}function J(t){const e=B.stateConfig;let n=t;if(typeof t===c.function&&(n=t()),typeof n===c.function){const t=n;n=function(...e){return t(...e)},n.original=t}const r={get:function(){return P(r)},defaultValue:n};return e.stateArray.push(r),n}function I(t){const e=new R;return e.subscribeWith=e=>{const n=[],r=[],o=(o,s)=>{n[s]=!0,r[s]=o;if(n.length===t.length){for(const t of n)if(!t)return;e(r,c)}},s=[...t],c=s.shift().subscribe((t=>o(t,0))),a=s.map(((t,e)=>t.subscribe((t=>o(t,e+1)))));return c.subscriptions=a,c},e}function N(t,e,n){const r=R.globalSubCount$;R.globalSubCount$.next(r.value+1);const o=function(){o.unsubscribe()};return o.callback=e,o.subscriptions=[],o.unsubscribe=function(){return function(t,e,n){!function(t,e){const n=t.findIndex((t=>t.callback===e));-1!==n&&t.splice(n,1)}(e,n);const r=R.globalSubCount$;R.globalSubCount$.next(r.value-1),t.unsubscribe=()=>t;const o=t.subscriptions;for(const t of o)t.unsubscribe();return t}(o,n,e)},o.add=t=>(o.subscriptions.push(t),o),o.next=t=>{e(t,o)},o}function W(t,e,n){const r=[...e],o=r.shift(),s=t=>{if(r.length)return W(t,r,n);n(t)};let c=s;const a=o(t,{setHandler:t=>c=t,next:s});c(a)}class R{value;onSubscription;methods=[];isSubject=!0;subscribers=[];subscribeWith;constructor(t,e){this.value=t,this.onSubscription=e}subscribe(t){const e=N(0,t,this.subscribers),n=this.subscribeWith;if(n){if(this.methods.length){const n=t;t=t=>{W(t,this.methods,(t=>n(t,e)))}}return n(t)}return this.subscribers.push(e),this.onSubscription&&this.onSubscription(e),e}next(t){this.value=t,this.emit()}set=this.next.bind(this);emit(){const t=this.value,e=this.subscribers;for(const n of e)n.callback(t,n)}toPromise(){return new Promise((t=>{this.subscribe(((e,n)=>{n.unsubscribe(),t(e)}))}))}toCallback(t){const e=this.subscribe(((n,r)=>{const o=r?.unsubscribe;o?o():setTimeout((()=>e.unsubscribe()),0),t(n)}));return this}pipe(...t){const e=new R(this.value);return e.setMethods(t),e.subscribeWith=t=>this.subscribe(t),e.next=t=>this.next(t),e}setMethods(t){this.methods=t}static all(t){return I(t.map((t=>{if(y(t))return t;return new R(t,(e=>(e.next(t),e)))})))}static globalSubCount$=new R(0)}class L extends R{value;onSubscription;_value;constructor(t,e){super(t,e),this.value=t,this.onSubscription=e,this._value=t,M(this)}next(t){this._value=t,this.emit()}emit(){const t=this._value,e=this.subscribers;for(const n of e)n.callback(t,n)}}function M(t){Object.defineProperty(t,"value",{set(e){t._value=e,t.emit()},get:()=>t._value})}const D=new R(void 0,(function(t){Pn()||t.next()})),B={stateConfig:{stateArray:[],version:Date.now(),handlers:{handler:J,statesHandler:j}},tagClosed$:D};function $(t,e){for(let n=0;n<t.length;++n){_(t[n],e[n])}}function _(t,e){let n;t(((...t)=>(n=t,t)),1),e((()=>n),2)}function H(t,e,n,r){for(let n=t.length-1;n>=0;--n){const r=t[n].get(),o=e[n].callback;o&&o(r)}for(let t=r.length-1;t>=0;--t){const e=[],o=(...t)=>(e.push(t),t);(0,r[t])(o);let s=0;const c=(...t)=>e[s++];n[t](c)}}function U(t,e){return F(t,e)}function F(t,e){if(null===t||typeof t!==c.object)return t;if(e<0)return t;if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);const n=S(t)?[]:Object.create(Object.getPrototypeOf(t));if(S(t))for(let r=0;r<t.length;r++)n[r]=F(t[r],e-1);else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=F(t[r],e-1));return n}function z(t,e,n){return Z(t,e,n)}function Z(t,e,n){return!(t!==e&&(r=t,o=e,!C(r)||!C(o)||r.toString()!==o.toString()))||(n<0||typeof t===c.object&&typeof e===c.object&&(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():S(t)&&S(e)?function(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!Z(t[r],e[r],n-1))return!1;return!0}(t,e,n-1):!S(t)&&!S(e)&&function(t,e,n){const r=Object.keys(t),o=Object.keys(e);if(0===r.length&&0===o.length)return!0;if(r.length!==o.length)return!1;for(const s of r){if(!o.includes(s)||!Z(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var r,o}function G(t){return t.map(X)}function X(t,e){const n=t,r=t?.tagJsType;if(r)switch(r){case a.signal:case a.subscribe:case a.stateRender:return;case a.dom:case a.tag:case a.templater:return G(n.values)}return S(t)?G(n):U(t,e)}function q(t,e,n){i.push((()=>{Q(t,e,n)}))}function Q(t,e,n){void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}function Y(t,e,n,r,o,s){switch(r){case"init":{const t=s.added;return void d.push((()=>{e({target:n,stagger:t})}))}case"destroy":{const t=++s.removed,r=o.subject.global;return r.destroys=r.destroys||[],void r.destroys.push((()=>e({target:n,stagger:t})))}case"autofocus":return void d.push((()=>n.focus()));case"autoselect":return void d.push((()=>n.select()));case"style":{const r=t.split(".");return void i.push((()=>n.style[r[1]]=e))}case"class":return void function(t,e,n){const r=t.split(".");if(r.shift(),e){for(const t of r)i.push((()=>n.classList.add(t)));return}for(const t of r)i.push((()=>n.classList.remove(t)))}(t,e,n)}throw new Error(`Invalid special attribute of ${r}. ${t}`)}function K(t,e){const n=function(t,e,n=[]){const r=t.subject;n.push({support:t,renderCount:r.renderCount,provider:e});const o=e.children;for(let t=o.length-1;t>=0;--t){const r=o[t],s=r.subject;n.push({support:r,renderCount:s.renderCount,provider:e})}return n}(t,e);return n}function tt(t,e=[]){const n=t.subject.global,r=Re(t.templater),o=t.ownerSupport;if(n.locked)return e.push(t),e;if(r)return tt(o,e);const s=t,c=v(s.templater),u=t.templater.tagJsType,i=o&&u!==a.stateRender&&(!c||function(t,e,n){const r=function(t,e){const n=t.props,r=e.propsConfig,o=r.latest;if(De(n,o))return!0;switch(t.propWatch){case ke.IMMUTABLE:return _e(n,o);case ke.SHALLOW:return He(n,o)}return!z(n,o,Fe)}(e,n);if(t&&r)return!0;return!1}(o,s.templater,s)),l=function(t){const e=t.subject.global.providers;if(!e)return[];const n=[];for(const t of e){const e=K(t.owner,t);n.push(...e.map((t=>t.support)))}return n}(s);return e.push(...l),i?(tt(o,e),c&&e.push(s),e):(e.push(s),e)}function et(t){++g.locks,t.forEach(nt),--g.locks,h()}function nt(t){const e=t.subject.global;e&&Le(e.newest)}const rt="no-data-ever",ot="promise-no-data-ever";function st(t,e){const n=e.subject.global,r=function(t,e){if(!0!==n.deleted)return function(t,e,n,r,o){const s=T(e),c=s.subject,a=c.global;a.locked=!0;const u=t.apply(r,o);delete a.locked;const i=function(t,e){const n=e.subject.global;return function(t,e,n){return et(tt(t)),function(t,e,n){if(w(t)){return e.subject.global.locked=!0,t.then((()=>{if(!0===n.deleted)return ot;delete e.subject.global.locked;return et(tt(e)),ot}))}return rt}(e,t,n)}(e,t,n)}(u,s);return i}(r.tagFunction,r.support,r.states,t,e)};r.tagFunction=t;const o=T(e);r.support=e;const s=o.states;return r.states=s,r}const ct=["init","destroy"];function at(t,e,n,r,o,s,c){if(c)return Y(t,e,n,c,s,o);r(n,t,e)}function ut(t,e,n,r){const o=t.appElement;"blur"===e&&(e="focusout");const s="_"+e,c=t.subject.global.events;if(!c[e]){const t=function(t){t.originalStopPropagation=t.stopPropagation,it(t,s,t.target)};c[e]=t,o.addEventListener(e,t)}n[s]=r,n[e]=r}function it(t,e,n){const r=n[e];if(r){let e=!1;if(t.stopPropagation=function(){e=!0,t.originalStopPropagation.call(t)},r(t),t.defaultPrevented||e)return}const o=n.parentNode;o&&it(t,e,o)}function lt(t,e,n,r){const o=function(...e){return o.tagFunction(t,e)};o.tagFunction=e,o.support=n,ut(n.appSupport,r,t,o)}function pt(t){if(t.startsWith("class."))return"class";const e=function(t){switch(t){case"autoselect":return"autoselect";case"autofocus":return"autofocus";case"oninit":case"init":return"oninit";case"ondestroy":case"destroy":return"destroy"}return!1}(t);return!1!==e||!!t.startsWith("style.")&&"style"}const ft={added:0,removed:0};function dt(t,e,n,r){if(n.isNameOnly)return function(t,e,n,r,o,s,a,u){if(n){if(wt(e))return void r.removeAttribute(n);if(typeof n===c.object)if(typeof e===c.object)for(const t in n)t in e||i.push((function(){r.removeAttribute(t)}));else for(const t in n)i.push((function(){r.removeAttribute(t)}))}ht(t,e,r,o,s,a,u)}(r,t,n.value,n.element,e,n.howToSet,[],ft),void(n.value=t);const o=n.element;bt(t,n.attrName,n,o,e,n.howToSet,n.isSpecial,ft),n.value=t}function gt(t,e,n,r,o,s,a,u,l){const p=yt(e);if(p>=0){const e=t[p],c=Qt(e,s,!0);return c.isAttr=!0,c.element=n,c.howToSet=o,c.isNameOnly=!0,c.handler=dt,void ht(t,e,n,r,o,s,u)}const f=yt(l);if(f>=0){const l=t[f],p={isAttr:!0,element:n,attrName:e,checkValueChange:Nt,delete:Wt,withinOwnerElement:!0};s.push(p);return y(p.value)?function(t,e,n,r,o,s,c){s&&i.push((function(){n.removeAttribute(t)}));const a=e.value;if(y(a)){e.handler=Ft;const u=function(a){bt(a,t,e,n,r,o,s,c)},i=a.subscribe(u),l=e.global;(l.subscriptions=l.subscriptions||[]).push(i)}return void bt(e.value,t,e,n,r,o,s,c)}(e,p,n,r,o,a,u):(p.handler=dt,function(t,e,n,r,o,s,a,u){n.attrName=t,n.element=r,n.howToSet=o,typeof e===c.function?u&&ct.includes(t)?Y(t,e,r,t,s,a):vt(n,e,s,t,r):(n.attrName=t,n.element=r,n.howToSet=o,n.isSpecial=u,at(t,e,r,o,a,s,u))}(e,l,p,n,o,r,u,a),void(p.value=l))}return at(e,l,n,o,u,r,a)}function ht(t,e,n,r,s,a,u){if(!wt(e))if(typeof e!==c.object)0!==e.length&&s(n,e,o);else for(const o in e){const c=e[o];gt(t,o,n,r,s,a,pt(o),u,c)}}function bt(t,e,n,r,o,s,c,u){return C(t)?function(t,e,n,r,o,s,c,u){const i=t.templater.wrapper;if((i?.tagJsType||i?.original?.tagJsType)!==a.renderOnce)return vt(c,e,t,r,n);return mt(e,n,r,o,s,t,u)}(o,t,r,e,c,s,n,u):mt(t,r,e,c,s,o,u)}function mt(t,e,n,r,o,s,c){if(!1===r){switch(t){case void 0:case!1:case null:return void i.push((function(){e.removeAttribute(n)}))}if(C(t))return lt(e,t,s,n);o(e,n,t)}else Y(n,t,e,r,s,c)}function vt(t,e,n,r,o){return lt(o,e=st(e,n),n,r)}function yt(t){return k(t)&&"tagJsVar"in t?t.tagJsVar:-1}function wt(t){return null==t||!1===t}function Ct(t,e){const n=document.createTextNode(t);return f.push({element:n,relative:e}),n}function kt(t){switch(t){case void 0:case!1:case null:return o}return t}function St(t,e){const n=e.providers;if(n)for(const t of n)for(let n=t.children.length-1;n>=0;--n){t.children[n].subject.global===e&&t.children.splice(n,1)}e.destroy$&&e.destroy$.next(),t.subject.renderCount=0}function Tt(t){for(const e of t){const t=e.lastArray;if(t){Tt(t);continue}const n=e.global;if(!n)continue;const r=n.newest,o=n.subscriptions;o&&o.forEach((t=>t.unsubscribe())),v(r.templater)&&St(r,n);Tt(n.context)}}function jt(t,e=[],n=[]){for(const r of t){const t=r.global;if(!t)continue;const o=t.newest;if(o){e.push(o);const r=t.subscriptions;r&&n.push(...r)}const s=t.context;s&&jt(s,e,n)}return{tags:e,subs:n}}function Et(t,e){const n=t.context,r=t.destroys;if(r)return function(t,e,n){const r=[];if(t.forEach((t=>{const e=t();e instanceof Promise&&r.push(e)})),r.length){const t=Promise.all(r).then((()=>{++g.locks,xt(e.context,n),At(e),--g.locks,h()}));return void n.push(t)}++g.locks,xt(e.context,n),At(e),--g.locks,h()}(r,t,e);xt(n,e),At(t)}function xt(t,e){for(const n of t){if(n.withinOwnerElement)continue;const t=n.lastArray;if(t){It(n,t);continue}const r=n.simpleValueElm;if(r){delete n.simpleValueElm,u.push(r);continue}const o=n.global;if(void 0===o)continue;if(!0===o.deleted)continue;o.deleted=!0;o.oldest&&Et(o,e)}}function At(t){t.htmlDomMeta.forEach((t=>{const e=t.marker;e&&u.push(e);const n=t.domElement;n&&u.push(n)}))}function Ot(t,e){const n=t.subject;e.deleted=!0,n.renderCount=0;const r=[];return Tt(e.context),e.destroy$&&St(t,e),Et(e,r),r}function Pt(t,e,n,r,o){const s=t.length-1,c=e-r,a=c<0||s<c,u=n[e];if(a)return Vt(u,o),1;const i=function(t,e,n,r,o,s){const c=e&&t!==e.arrayValue;if(c)return Vt(n,r),o.splice(s,1),2;return 0}(u.value.arrayValue,t[e],u,o,n,e);return i}function Vt(t,e){!function(t,e){if(t){Ot(t.oldest,t)}else{const t=e.simpleValueElm;delete e.simpleValueElm,u.push(t)}}(t.global,t),++e.removed}function Jt(t,e){if(!S(t)){return It(e,e.lastArray),9}return!1}function It(t,e){const n={added:0,removed:0};for(let t=0;t<e.length;++t)Vt(e[t],n);delete t.lastArray}function Nt(t,e){return null==t||typeof t!==c.object?(function(t,e){const n=kt(t),r=e.simpleValueElm;l.push([n,r])}(t,e),-1):(Wt(e),6)}function Wt(t){const e=t.simpleValueElm;delete t.simpleValueElm,u.push(e)}function Rt(t,e,n,r,o){const s=Ze(t,r,o);return s.ownerSupport=e,Ge(t,s,n,o)}function Lt(t,e,n){t!==n.value&&nn(n,t,e)}function Mt(t,e,r){if(!e.global.newest)return void Ee(t,e,r,{added:0,removed:0});!function(t,e,r){const o=r.global,s=o.newest,c=s.templater.wrapper,u=e.templater.wrapper;let i=!1;const l=e.templater.tagJsType,p=a.stateRender===l||a.renderOnce===l;if(p)i=e.templater.tagJsType===a.renderOnce||re(s,e);else if(c&&u){i=c.original===u.original}const f=e.templater;if(!i)return void function(t,e,r){const o=t.global,s=o.oldest;Ot(s,o),n(t);const c=Ee(e,t,r,{added:0,removed:0})}(r,f,t);const d=p||function(t,e){const n=e.props,r=t.propsConfig,o=r.latest,s=Be(n,o,t.templater.propWatch);return s}(s,f);if(!d){return void function(t,e,n,r,o){const s=t.props,c=Ae(e,n,r,s,o),a=e.propsConfig;a.castProps=c;const u=n.propsConfig;u.latest=a.latest}(f,e,s,t,f.propWatch===ke.DEEP?Fe:Ue)}if(o.locked)return void o.blocked.push(e);Le(e),++r.renderCount}(r,Rt(t,r,r.appSupport,e),e)}function Dt(t,e,n,r,o,s){const c=document.createTextNode(""),a={value:t,checkValueChange:r,delete:Wt,withinOwnerElement:!1,placeholder:c};return n.added=n.added+1,s||f.push({element:c,relative:o}),Ht(t,a,e,n,s,o),s&&p.push({element:c,relative:s}),a}function Bt(t,e,n,r,o){const s=void 0===t.lastArray;s&&(t.lastArray=[]);const c=t.lastArray;let a=t.placeholder,u=0;const i=[];if(!s){for(let t=0;t<c.length;++t){const n=c[t],o=Pt(e,t,c,u,r);0!==o?2!==o?u+=o:t-=1:i.push(n)}t.lastArray=i}const l=e.length;for(let s=0;s<l;++s){a=$t(e,s,t.lastArray,n,a,r,o).placeholder}}function $t(t,e,n,r,o,s,c){const a=t[e],u=n[e];if(u)return function(t,e,n,r,o,s,c,a){const u=n.length>o;if(u)return Lt(t,r,e),e;const i=Dt(t,r,c,Nt,s,a);return n.push(i),i}(a,u,n,r,e,o,s,c);const i=Dt(a,r,s,Nt,o,c);return n.push(i),i}function _t(t,e,n,r,o,s){const c=t?.tagJsType;return c?t.processInit(t,e,n,r,o,s):S(t)?(Bt(e,t,n,r,o),void(e.checkValueChange=Jt)):void function(t,e,n){const r=kt(t),o=Ct(r,n);e.simpleValueElm=o,e.checkValueChange=Nt}(t,e,e.placeholder)}function Ht(t,e,n,r,o,s){e.handler=Lt;n.subject.global.locked=!0,_t(t,e,n,r,o,s);delete n.subject.global.locked,e.value=t}function Ut(t,e,n,r,s,c,a){const u=document.createTextNode(o),i=Qt(t,e,s>0);i.placeholder=u,c?p.push({relative:c,element:u}):f.push({relative:a,element:u}),Ht(t,i,n,r,c,a)}const Ft=()=>{},zt="object"==typeof document&&document.createElement("div");function Zt(t,e,n,r,s,c,a,u){const i=[];a&&void 0===u&&(u=document.createTextNode(o),p.push({element:u,relative:a}),a=void 0);for(let o=0;o<t.length;++o){const l=t[o],p=l.v;if(!isNaN(p)){Ut(e[s.length],s,n,r,c,a,u);continue}const f={};if(i.push(f),"text"===l.nn){Xt(f,l,a,u);continue}const d=Gt(f,l,e,n,s,r,a,u);l.ch&&(f.ch=Zt(l.ch,e,n,r,s,c+1,d,u).dom)}return{dom:i,context:s}}function Gt(t,e,n,r,o,s,c,a){const u=t.domElement=document.createElement(e.nn);return e.at&&e.at.forEach((t=>{const e=t[0],c=t[1],a=t[2]||!1;gt(n,e,u,r,Q,o,a,s,c)})),c?p.push({element:u,relative:c}):f.push({element:u,relative:a}),u}function Xt(t,e,n,r){const o=t,s=o.tc=e.tc;zt.innerHTML=s;const c=o.domElement=document.createTextNode(zt.innerText);n?p.push({element:c,relative:n}):f.push({element:c,relative:r})}function qt(t,e,n,r){const o=t.subject;o.delete=se;const s=o.global;s.oldest=t,s.newest=t,++g.locks;const c=function(t,e,n,r){const o=function(t){const e=t.templater,n=e.tag;if(n.tagJsType===a.dom)return n.dom;const r=n.strings;return or(r,n.values)}(t),s=t.templater.tag,c=s.values,u=[],i=t.subject.global;i.context=u;const l=Zt(o,c,t,e,u,0,n,r);return l}(t,e,n,r);return s.htmlDomMeta=c.dom,--g.locks,c}function Qt(t,e,n){const r={value:t,checkValueChange:Nt,delete:Wt,withinOwnerElement:n};return e.push(r),r}function Yt(t,e,n){return t.map((t=>function(t,e,n,r){if(m(t)||!t)return t;if(!e)return t;return Kt(t,e,n,r)}(t,e.ownerSupport,e,n)))}function Kt(t,e,n,r,o){if(!t)return t;if(t.tagJsType)return t;if(typeof t===c.function)return function(t,e,n){const r=t.mem;if(r)return t;const o=function(...t){return o.toCall(...t)};return o.original=t,o.mem=t,o.toCall=function(...t){return function(t,e,n,r){const o=r.subject.global,s=o?.newest||r,c=void 0===Pn(),a=t.apply(e,n),u=function(){const t=s.subject.global;return t&&!0!==t.locked?(function(t,e){const n=t.subject,r=Re(t.templater);if(r){return Me(e,t)}const o=n.global;o.locked=!0,We(o.newest,t,e,n),delete o.locked}(s,r),a):a};if(c)return u();return B.tagClosed$.toCallback(u),a}(o.mem,e,t,n)},Object.assign(o,t),o}(t,o,e);if(r===Fe)return t;return ee(t)?t:S(t)?function(t,e,n,r){for(let o=t.length-1;o>=0;--o){const s=t[o];if(t[o]=Kt(s,n,e,r+1,t),typeof s===c.function){if(s.mem)continue;te(r+1,o,s,t,e)}}return t}(t,n,e,r):function(t,e,n,r){const o=Object.keys(t);for(const s of o){const o=t[s],a=Kt(o,n,e,r+1,t);if(t[s]===a)continue;const u=Object.getOwnPropertyDescriptor(t,s);if(!(u?.get||u?.set)&&(t[s]=a,typeof a===c.function)){if(o.mem)continue;te(r+1,s,o,t,e)}}return t}(t,n,e,r)}function te(t,e,n,r,o){if(t>0){const t=o.subject.global;r[e].subscription=t.destroy$.toCallback((function(){r[e]=n}))}}function ee(t){return typeof t!==c.object||!t||t.tagJsType}function ne(t,e,n,r){const o=e.original,s=t.tagJsType===a.stateRender,u=B.stateConfig;let i;return u.support=n,s?i=t():(i=o(...r),typeof i===c.function&&(i=i())),i.templater=t,t.tag=i,n.state=u.stateArray,n.states=u.states,n}function re(t,e){const n=t.templater,r=e.templater,o=n?.tag||t,s=r.tag;if(n?.tagJsType===a.stateRender)return n.dom===r.dom;switch(o.tagJsType){case a.dom:return s?.tagJsType===a.dom&&function(t,e){const n=t.dom,r=e.dom;return n===r}(o,s);case a.tag:{const n=function(t,e,n,r){const o=t.strings,s=e.strings;if(o.length!==s.length)return!1;if(!o.every(((t,e)=>s[e].length===t.length)))return!1;const a=n.templater.values||t.values,u=r.templater.values||e.values;return function(t,e){const n=t.length===e.length;if(!n)return!1;const r=e.every(((e,n)=>{const r=t[n];if(typeof e===c.function&&typeof r===c.function){return!!(e.toString()===r.toString())}return!0}));if(r)return!0;return!1}(a,u)}(o,s,t,e);return n}}throw new Error(`unknown tagJsType of ${o.tagJsType}`)}function oe(t,e){const r=e.global,o=r?.newest;if(m(t)){return!re(t,o)&&(Ot(o,r),n(e),7)}const s=t?.tagJsType;if(s){return!0===tn(e,t,r.newest.ownerSupport)&&-1}return 0===o.subject.renderCount?(delete e.global,e.renderCount=0,d.push((()=>{Ot(o,r),d.shift(),h()})),8):(se(e),8)}function se(t){const e=t.global,n=e?.newest;Ot(n,e),delete t.global,t.renderCount=0}function ce(t,e,n,r,o,s){e.checkValueChange=oe;const c=Ye(t,n,e);c.ownerSupport=n;const a=qt(c,r,o,o?void 0:s);for(const t of a.dom)t.marker&&(o?p.push({element:t.marker,relative:o}):f.push({element:t.marker,relative:s})),t.domElement&&(o?p.push({element:t.domElement,relative:o}):f.push({element:t.domElement,relative:s}));return c}function ae(t,e,n,r,o,s){return e.checkValueChange=oe,o?ce(t,e,n,r,o,s):qe(n,e,r)}function ue(t,e){const n={tagJsType:a.templater,processInit:ae,propWatch:t,props:e,key:function(t){return n.arrayValue=t,n}};return n}const ie=[];function le(t,e,n){const r=ue(ke.DEEP);r.tagJsType=t.tagJsType;const o=Ye(r,n,e);function s(){return r.tag=t(),o}return r.wrapper=s,s.tagJsType=t.tagJsType,s.original=t.original||t,o}class pe extends Error{details;constructor(t,e,n={}){super(t),this.name=pe.name,this.details={...n,errorCode:e}}}class fe extends pe{constructor(t,e){super(t,"array-no-key-error",e),this.name=fe.name}}class de extends pe{constructor(t,e){super(t,"state-mismatch-error",e),this.name=de.name}}class ge extends pe{constructor(t,e){super(t,"sync-callback-error",e),this.name=ge.name}}function he(t,e){const n=t.rearray;n.length&&n.length!==t.stateArray.length&&function(t,e,n){const r=`Saved states between renders are inconsistent. Expected ${t.length} states got ${n.stateArray.length}.`,o=e.templater?.wrapper;let s=o;(o?.original||o?.original)&&(s=o.original);const c={oldStates:n.stateArray,newStates:n.rearray,tagFunction:s,templater:e.templater},a=new de(r,c);throw console.error(be,c),a}(n,e,t)}const be="State tracking requires same number of state calls on every render. This error typically occurs when a state call is only reachable behind a condition. Also, wrapping tags that have state, with tag(), often helps when tag is only reachable by a condition.";function me(t,e){const n=t.subject;++n.renderCount;const r=B.stateConfig;t.state=r.stateArray,t.states=r.states,n.global.newest=t,he(r,t),delete r.prevSupport,delete r.support,delete r.stateArray,delete r.states,B.tagClosed$.next(e)}function ve(t,e,n,r){const o=e?.state,s=B.stateConfig;o?A(0,e,B.stateConfig,o):x(t,s);const c=t.templater;let u;if(c.tagJsType===a.stateRender){const e=c;u=Rt(c,r,t.appSupport,n),ne(c,e,u)}else{u=(0,c.wrapper)(t,n,e)}return me(u,r),u}function ye(t,e,r,o,s,c){n(e);const a=le(t,e,r);ve(a,void 0,e,r);const u=ce(a.templater,e,r,o,s,c);return e.checkValueChange=oe,u}function we(t,e,r,o,s){if(n(e),e.checkValueChange=oe,s){const n=function(t,e,n,r,o){const s=Rt(t,n,n.appSupport,e),c=s.propsConfig;if(c){const e=t.tagJsType!==a.tagComponent?[]:je(t,s);c.castProps=e}const u=e.global,{support:i}=Ve(s,u.newest,e,n);return function(t,e,n){let r=p.length;const o=qt(t,e,n,void 0);for(const t of o.dom)t.domElement&&p.splice(r++,0,{element:t.domElement,relative:n}),t.marker&&p.splice(r++,0,{element:t.marker,relative:n})}(i,r,o),i}(t,e,r,o,s);return n}return Ee(t,e,r,o)}let Ce=0;var ke;function Se(t,e=ke.SHALLOW){const n=function(...r){const o=ue(e,r);o.tagJsType=a.tagComponent,o.processInit=we;const s=function(t,e){const n=function(n,r,o){const s=je(t,n,o),c=n.ownerSupport,a=Rt(t,c,n.appSupport,r,s);return ne(t,e,a,s)};return n}(o,n);return s.original=t,o.wrapper=s,o},r=t;return n.original=t,r.tags=ie,r.setUse=B,r.ValueTypes=a,r.tagIndex=Ce++,ie.push(n),n}function Te(){throw new Error("Do not call tag.use as a function but instead set it as: `(props) => tag.use = (use) => html`` `")}function je(t,e,n){const r=t.propWatch===ke.DEEP?Fe:Ue,o=t.props,s=e.propsConfig;let c=s.castProps;const a=n?.propsConfig,u=a?.castProps;u&&(s.castProps=u,c=Ae(e,n,n.ownerSupport,o,r));return c||Yt(o,e,0)}function Ee(t,e,n,r){const o=Rt(t,n,n.appSupport,e),s=o.propsConfig;if(s){const e=t.tagJsType!==a.tagComponent?[]:je(t,o);s.castProps=e}const c=e.global,{support:u}=Ve(o,c.newest,e,n);return function(t,e,n){n.checkValueChange=oe,qt(t,e,void 0,n.placeholder)}(u,r,e),u}function xe(t,e,n,r,o,s){return null==t||s>o?e:typeof t===c.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):ee(e)?e:S(e)?function(t,e,n,r,o,s){for(let c=t.length-1;c>=0;--c){const a=t[c],u=e[c];t[c]=xe(u,a,n,r,s,o+1)}return t}(e,t,n,r,s,o):function(t,e,n,r,o,s){const c=Object.keys(t);for(const a of c){const c=t[a],u=xe(e[a],c,n,r,s,o+1);if(c===u)continue;const i=Object.getOwnPropertyDescriptor(t,a)?.set;i||(t[a]=u)}return t}(e,t,n,r,s,o)}function Ae(t,e,n,r,o,s=-1){if(0===o)throw new Error("before here");const c=e.subject.global.newest;if(!c){const e=Yt(r,t,s);r.push(...e);return t.propsConfig.castProps=e,r}const a=(e=c||e).propsConfig.castProps,u=[];for(let e=0;e<r.length;++e){const c=r[e],i=xe(a[e],c,t,n,o,s+1);u.push(i)}return t.propsConfig.castProps=u,u}function Oe(t){const e=t.subject,r=e.global,{subs:o,tags:s}=jt(r.context);Pe(r);for(const t of s){const e=t.subject.global;if(!0===e.deleted)return;Pe(e)}r.subscriptions&&o.forEach((t=>t.unsubscribe())),n(e)}function Pe(t){t.deleted=!0,Et(t,[])}function Ve(t,e,n,r){const o=e?.templater,s=o?.tag,c=ve(t,e,n,r),u=!e||re(e,c);if(u){if(e){const t=e.templater.tag;t&&n.renderCount>0&&function(t,e,n){if(t.tagJsType===a.dom){const r=n?.dom;return void(r!==t.dom&&Oe(e))}if(n){const r=n.strings;if(r){const n=r?.length;n!==t.strings.length&&Oe(e)}}}(t,e,s)}}else{!function(t,e){const n=t.subject.global;let r=-1;const o=n.providers=n.providers||[],s=o.length-1;for(;r++<s;){const t=o[r];let s=-1;const c=t.children.length-1;for(;s++<c;)if(n===t.children[s].subject.global)return t.children.splice(s,1),void t.children.push(e)}}(e,c),Oe(e);const t=c.subject.global;t.oldest=c,t.newest=c}const i=e?.ownerSupport;return c.ownerSupport=r||i,{support:c,wasLikeTags:u}}function Je(t,e,n,r){const o=t[e],s=n[e];if(o===s.value)return;(0,s.handler)(o,r,s,t),s.value=o}function Ie(t,e){const n=t.subject.global.context;!function(t,e){const n=e.templater,r=e.templater.tag,o=n.values||r.values,s=t.templater.tag;s.values=o}(t,e),++g.locks,function(t,e){const n=t.templater.tag.values;let r=0;const o=n.length;for(;r<o;)Je(n,r,e,t),++r}(t,n),--g.locks,h()}!function(t){t.DEEP="deep",t.SHALLOW="shallow",t.NONE="none",t.IMMUTABLE="immutable"}(ke||(ke={})),Se.renderOnce=function(){throw new Error("Do not call tag.renderOnce as a function but instead set it as: `(props) => tag.renderOnce = () => html`` `")},Se.state=Te,Se.use=Te,Se.route=function(t){throw new Error("Do not call tag.route as a function but instead set it as: `tag.route = (routeProps: RouteProps) => (state) => html`` `")},Se.app=function(t){throw new Error("Do not call tag.route as a function but instead set it as: `tag.route = (routeProps: RouteProps) => (state) => html`` `")},Se.deepPropWatch=Se,Se.immutableProps=function(t){return Se(t,ke.IMMUTABLE)},Se.watchProps=function(t){return Se(t,ke.SHALLOW)},Object.defineProperty(Se,"renderOnce",{set(t){t.tagJsType=a.renderOnce,t.processInit=ye}}),Object.defineProperty(Se,"state",{set(t){t.original={setUse:B,tags:ie},t.tagJsType=a.stateRender,t.processInit=we}}),Object.defineProperty(Se,"use",{set(t){t.original={setUse:B,tags:ie},t.tagJsType=a.stateRender,t.processInit=we}});const Ne={added:0,removed:0};function We(t,e,n,r){const o=r.global,{support:s,wasLikeTags:c}=Ve(e,t,r,n);return c?(Ie(o.oldest,s),s):(qe(n,r,Ne),s)}function Re(t){return a.templater===t.tagJsType}function Le(t){const e=t.subject.global,n=Re(t.templater),r=t.ownerSupport;if(e.locked)return e.blocked.push(t),t;if(n){return Me(r,t)}e.locked=!0;const o=t.subject;e.blocked.length&&(t=e.blocked.pop(),e.blocked=[]);const s=We(e.newest,t,r,o);return delete e.locked,s}function Me(t,e){const n=t.subject.global;if(!n||!0===n.deleted)return e;return Le(n.newest||t)}function De(t,e){return t.length!==e.length}function Be(t,e,n){if(De(t,e))return 11;switch(n){case ke.NONE:return 1;case ke.SHALLOW:return He(t,e);case ke.IMMUTABLE:return _e(t,e)}return function(t,e){let n=t,r=e;n=[...t],r=[...e||[]];if(!n.every(((t,e)=>function(t,e,n,r){const o=r[e];if(typeof t===c.object){const e={...t},n={...o||{}},r=Object.entries(e).every((([t,r])=>$e(r,n[t],(()=>{delete e[t],delete n[t]}))));return r}return $e(t,o,(()=>{n.splice(e,1),r.splice(e,1)}))}(t,e,n,r))))return 7;return!1}(t,e)}function $e(t,e,n){if(typeof t!==c.function)return!!z(t,e,Fe)&&4;if(typeof e!==c.function)return!1;const r=e?.original;r&&(e=r);t.original&&(t=t.original);return t.toString()===e.toString()?(n(),5):(n(),6)}function _e(t,e){const n=t.length;for(let r=0;r<n;++r){if(t[r]!==e[r])return 2}return!1}function He(t,e){const n=t.length;for(let r=0;r<n;++r){const n=t[r],o=e[r];if(S(n)&&S(o)){if(n===o)continue;return 3}if(typeof n!==c.function||typeof o!==c.function)if(typeof n!==c.object){if(n!==o)return 3.3}else if(typeof e===c.object){const t=Object.entries(n);for(const e of t){if(!ze(e,o))return 3.1}}}return!1}const Ue=3,Fe=10;function ze([t,e],n){const r=n[t];return typeof e===c.function&&typeof r===c.function||r===e}function Ze(t,e,n){const r={templater:t,subject:e,castedProps:n,appSupport:void 0},o=e.global;return o.blocked=[],o.destroy$=new R,r}function Ge(t,e,n,r){e.appSupport=n;const o=t.props;return o&&(e.propsConfig=function(t,e,n){const r=t.templater;if(r.tagJsType!==a.stateRender){switch(r.propWatch){case ke.IMMUTABLE:return t.propsConfig={latest:e,castProps:n};case ke.SHALLOW:return t.propsConfig={latest:e.map((t=>X(t,Ue))),castProps:n}}return t.propsConfig={latest:e.map((t=>X(t,Fe))),castProps:n}}}(e,o,r)),e}function Xe(t,e,n,r,o){const s={templater:t,subject:r,castedProps:o,appSupport:void 0};return s.ownerSupport=e,s.appSupport=n,s}function qe(t,e,n){const r=e.global.newest;r.ownerSupport=t,e.checkValueChange=oe;return qt(r,n,void 0,e.placeholder),r}function Qe(){return{tagJsType:a.templater,processInit:ae}}function Ye(t,e,n){const r=Xe(t,e,e.appSupport,n);return n.global.context=[],r}const Ke={added:0,removed:0};function tn(t,e,r){const o=e.tagJsType;if(v(e))return void 0===t.global&&n(t),Mt(e,t,r),!0;const s=t.global;if(s){const n=s.newest;if(n)return typeof e===c.function||function(t,e,n,r){const o=Rt(n.templater||n,r,r.appSupport,e);Ie(t.subject.global.oldest,o)}(n,t,e,r),!0}switch(o){case a.templater:return qe(r,t,Ke),!0;case a.tag:case a.dom:return function(t,e,r){const o=t;let s=o.templater;s||(s=Qe(),o.templater=s,s.tag=o);const c=e.global?e.global:n(e);c.newest=Ye(s,r,e),qe(r,e,Ke)}(e,t,r),!0;case a.subscribe:return e.processInit(e,t,r,{added:0,removed:0},void 0,t.placeholder),!0}return!1}function en(t,e,n,r){const o=t&&t.tagJsType;if(o){if(o===a.renderOnce)return;tn(e,t,n)}else S(t)?Bt(e,t,n,{added:0,removed:0}):typeof t!==c.function?r&&function(t,e){e.checkValueChange=Nt;const n=e.placeholder,r=kt(t);e.simpleValueElm=Ct(r,n)}(t,e):e.value=t}function nn(t,e,n){const r=t.checkValueChange(e,t);-1!==r&&en(e,t,n,r)}function rn(t,e,n,r,o,s,c){let u;s&&(u=c=document.createTextNode(""),p.push({element:c,relative:s}));const i=function(t,e,n,r,o,s){const c=T(n);let a;let u=function(t){l.hasEmitted=!0,l.contextItem=Dt(t,n,r,void 0,s),u=function(t){nn(l.contextItem,t,n),p||B.stateConfig.support||h()}};const i=function(t){a=t;const e=c.subject.global.newest;var n;n=c,$(e.states,n.states),l.callback&&(t=l.callback(t)),u(t)},l={hasEmitted:!1,handler:i,getLastValue:()=>a,callback:o,states:c.states};e.subscription=l;let p=!0;return l.subscription=t.subscribe(i),p=!1,l}(t,e,n,r,o,c);e.delete=()=>{if(console.log("🗑️ delete subscribe"),i.contextItem.delete(i.contextItem),i.subscription.unsubscribe(),u){u.parentNode.removeChild(u)}},e.handler=(t,e,n)=>{!function(t,e,n,r){if(!t||!t.tagJsType||t.tagJsType!==a.subscribe)return n.delete(n),99;if(!r.hasEmitted)return-1;r.callback=t.callback,r.handler(r.getLastValue());const o=T(e);r.states=o.states}(t,e,n,i)}}function on(t,e,n,r,o,s){return rn(t.Observable,e,n,r,t.callback,o,s)}function sn(t,e,n,r,o){rn(t,e,n,r,void 0,o)}function cn(t){return Pn()?gn((()=>an(t))):an(t)}function an(t){let e=t;const n=new Set;return{tagJsType:a.signal,processInit:sn,get value(){return e},set value(t){e!==t&&(e=t,n.forEach((e=>e(t))))},subscribe(t){t(e),n.add(t);const r=()=>n.delete(t);return r.unsubscribe=r,r}}}class un extends R{value;constructor(t){super(t),this.value=t}subscribe(t){const e=super.subscribe(t);return t(this.value,e),e}}class ln extends R{value;constructor(t){super(t),this.value=t,this._value=t,M(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function pn(t){return(e,n)=>{n.setHandler((()=>{})),t(e,n.next)}}function fn(t){return(e,n)=>{n.setHandler((()=>{}));t(e).then((t=>n.next(t)))}}const dn=t=>(e,n)=>{n.setHandler((()=>{}));const r=t(e).subscribe((t=>{r.unsubscribe(),n.next(t)}))};function gn(t){return B.stateConfig.handlers.handler(t)}const hn=(t,e)=>mn(t,e),bn=t=>t;const mn=(t,e,{init:n,before:r,final:o=bn}={})=>{const s=gn({pastResult:void 0,values:void 0}),c=s.values;if(void 0===c){if(r&&!r(t))return s.values=t,s.pastResult;const a=(n||e)(t,c);return s.pastResult=o(a),s.values=t,s.pastResult}if(t.every(((t,e)=>t===c[e])))return s.pastResult;if(r&&!r(t))return s.values=t,s.pastResult;const a=e(t,c);return s.pastResult=o(a),c.length=0,c.push(...t),s.pastResult};function vn(t,e){return Object.defineProperty(e,"noInit",{get(){const e=t();return e.setup.init=()=>{},e}}),Object.defineProperty(e,"asSubject",{get(){const e=t(),n=gn((()=>Pn())),r=gn((()=>new un(void 0))),o=gn((()=>({stateArray:B.stateConfig.stateArray,states:B.stateConfig.states}))),s=(t,s)=>(mn(t,((t,e)=>{const c=Pn(),a=s(t,e);if(c!==n){const t=o.stateArray,e=n.subject.global.oldest;H(t,e.state,o.states,e.states)}r.next(a)}),e.setup),r);return s.setup=e.setup,vn((()=>s),s),s}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function yn(t){return Pn()?gn((()=>new R(t))):new R(t)}function wn(t){return B.stateConfig.handlers.statesHandler(t)}function Cn(t){const e=cn([]),n=cn(0),r=cn(0);let o=[],s=0;return r.value=n.value,t(((...t)=>(o=t,e.value))),hn(o,(()=>{++s,e.value=o,t((()=>o))})),wn(((o,c)=>{if(s)return t(((...t)=>(c&&1!==c||(e.value=t),e.value))),r.value=n.value,void++n.value;t((()=>e.value))})),++s,e.value}vn((()=>function(t){const e=(e,n)=>mn(e,n,t);return e.setup=t,vn((()=>e),e),e}({})),hn),yn._value=t=>{const e=gn((function(){return{stateArray:B.stateConfig.stateArray,states:B.stateConfig.states}})),n=Pn();return gn((function(){return new un(t).pipe((t=>(H(n.state,e.stateArray,n.states,e.states),t)))}))},yn.all=function(t){const e=gn((()=>({stateArray:B.stateConfig.stateArray,states:B.stateConfig.states}))),n=Pn();return R.all(t).pipe((t=>(H(n.state,e.stateArray,n.states,e.states),t)))};const kn={create:t=>{const e=gn((()=>({stateDiff:0,provider:void 0})));if(e.stateDiff){let t=e.stateDiff;for(;t--;)gn(void 0);return gn(void 0)}const n=gn((()=>{const n=B.stateConfig,r=n.stateArray.length,o=t.prototype?new t:t(),s=n.support,c=n.stateArray.length-r,a={constructMethod:t,instance:o,stateDiff:c,owner:s,children:[]};e.provider=a;const u=s.subject.global;return(u.providers=u.providers||[]).push(a),e.stateDiff=c,o})),r=t,o=r.compareTo=r.toString();return e.provider.constructMethod.compareTo=o,n},inject:t=>gn((()=>{const e=t,n=e.compareTo=e.compareTo||t.toString(),r=Pn(),o=[];let s={ownerSupport:r.ownerSupport};for(;s.ownerSupport;){const t=s.ownerSupport.subject.global.providers;if(!t){s=s.ownerSupport;continue}const e=t.find((t=>{o.push(t);if(t.constructMethod.compareTo===n)return!0}));if(e){const t=r.subject.global;return(t.providers=t.providers||[]).push(e),e.children.push(r),e.instance}s=s.ownerSupport}const c=`Could not inject provider: ${t.name} ${t}`;throw console.warn(`${c}. Available providers`,o),new Error(c)}))};function Sn(t){const e=Pn();if(!e)throw En;return Tn(e,B.stateConfig,t)}function Tn(t,e,n){const r=e.states;return function(...e){return t.subject.renderCount>0?function(t,e,n,...r){const o=t.subject.global.newest;$(o.states,e);const s=n(...r);return $(e,o.states),Le(o),w(s)&&s.finally((()=>{$(e,o.states),Le(o)})),s}(t,r,n,...e):n(...e)}}const jn=()=>{const t=Pn();if(!t)throw En;const e=B.stateConfig;return function(n){return Tn(t,e,n)}},En=new ge("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function xn(t){gn(t)}function An(t){gn((function(){Pn().subject.global.destroy$.toCallback(t)}))}function On(t,e){return{tagJsType:a.subscribe,processInit:on,Observable:t,callback:e,states:T(Pn()).states}}function Pn(){return B.stateConfig.support}function Vn(t,e,r,o,s,c){e.checkValueChange=oe;const a=t;let u=a.templater;u||(u=function(t){const e=Qe();return e.tag=t,t.templater=e,e}(a));const i=n(e);return s?ce(u,e,r,o,s,c):(i.newest=Ye(u,r,e),e.checkValueChange=oe,qe(r,e,o))}const Jn=":tagvar",In=":";function Nn(t,e){const n={values:e,ownerSupport:Pn(),tagJsType:a.tag,processInit:Vn,strings:t,key:t=>(n.arrayValue=t,n),html:function(t,e){return n.children={strings:t,values:e},n}};return n}function Wn(t,e){const n={values:e,ownerSupport:Pn(),dom:t,tagJsType:a.dom,processInit:Vn,key:function(t){return n.arrayValue=t,n},html:{dom:function(t,e){return n.children={dom:t,values:e},n}}};return n}const Rn=/(:tagvar\d+:)/,Ln="ondoubleclick",Mn=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,Dn=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:*][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function Bn(t){const e=[],n=[],r=[];let o=null,s=-1,c=0;const a=new RegExp(Dn,"g");for(t=function(t){return t.replace($n,(function(t){return t.replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]").replace(/</g,"[l t]").replace(/>/g,"[g t]")}))}(t);c<t.length;){const u=a.exec(t);if(!u)break;const[i,l,p]=u,f=i.startsWith("</"),d=i.endsWith("/>");if(c<u.index){const e=t.slice(c,u.index);if(e.trim()){Fn(e).forEach((t=>{t.startsWith(Jn)&&(t=Jn+ ++s+In),Hn(o,n,t)}))}}if(c=u.index+i.length,f){o=r.pop()||null;continue}const g=[];let h;for(;null!==(h=Mn.exec(p));){const t=h[1]||h[3]||h[5];let n=h[2]||h[4]||h[6];if(void 0===t)continue;const r=""!==h[2],o=void 0===n&&r,c=t.toLowerCase(),a=c.startsWith("on")?_n(c):c;if(o){if(t.slice(0,Jn.length)===Jn){const t=Jn+ ++s+In;e.push(["at",t]),g.push([t]);continue}if(h[0].startsWith(t)&&h[0].slice(t.length,h[0].length).search(/\s+$/)>=0){g.push([a]);continue}n=Jn+ ++s+In}r||(n=h[2]);const u=[a,n],i=pt(c);i&&u.push(i),g.push(u)}const b={nn:l};g.length&&(b.at=g),o?(o.ch||(o.ch=[]),o.ch.push(b)):n.push(b),d||(r.push(o),o=b)}if(c<t.length){const e=t.slice(c);if(e.trim()){Fn(e).forEach((t=>(t.startsWith(Jn)&&++s,Hn(o,n,t))))}}return n}const $n=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function _n(t){if(t.startsWith("on")){return t.length===Ln.length&&t===Ln?"dblclick":t.slice(2,t.length)}return t}function Hn(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:Un(n)})}function Un(t){return t.replace(/(\[l t\]!--[\s\S]*?--\[g t\])/g,(function(t){return t.replace(/\[l t\]/g,"<").replace(/\[g t\]/g,">").replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]")}))}function Fn(t){return t.split(Rn).filter((t=>""!==t))}const zn=/(^:tagvar\d+:|:tagvar\d+:$)/g,Zn="__safeTagVar";function Gn(t,e){return function(t,e){const n=t.map(((t,n)=>n<e.length?t+Jn+n+In:t));return function(t,e,n){const r=n.length-e.length;if(r>0)for(let n=r;n>0;--n)t.push(Jn+(e.length+n-1)+In)}(n,t,e),n}(t.map((t=>t.replace(zn,((t,e)=>Zn+e)))),e)}const Xn=new RegExp(Jn+"(\\d+)"+In,"g"),qn="ch";function Qn(t,e,n=[],r=[]){const o=t;for(let t=0;t<o.length;t++){const s=[...r,t],c=o[t];if(c.at){const t=c.at;c.at=Kn(t,e)}if(c.ch){const t=c.ch,r=[...s,qn];c.ch=Qn(t,e,n,r)}t=Yn(c,e,o,t)}return o}function Yn(t,e,n,r){if("text"!==t.nn)return r;const o=t;let c,a=o.tc;if(typeof a!==s.string)return r;for(;null!==(c=Xn.exec(a));){const t=c[1],o=parseInt(t,10);if(!isNaN(o)&&o<e){const t=Jn+o+In,e=a.slice(c.index+t.length);n.splice(r,1,{nn:"text",v:o}),a=e,Xn.lastIndex=0}}return o.tc=a,r}function Kn(t,e){return t.map((t=>{const[n,r,o]=t;if(n.startsWith(Jn)){const t=parseInt(n.replace(Jn,""),10);if(!isNaN(t)&&t<e)return[{tagJsVar:t}]}if(typeof r===s.string&&r.startsWith(Jn)){const t=parseInt(r.replace(Jn,""),10);if(!isNaN(t)&&t<e)return[n,{tagJsVar:t},o]}return t}))}const tr="__safeTagVar";const er=/__safeTagVar(\d+)/g;function nr(t){if(t.at&&(t.at=t.at?t.at.map((t=>{if(1===t.length)return t;const[,e]=t;if(typeof e===s.string&&e.startsWith(tr)){const n=parseInt(e.replace(tr,""),10);t[1]=Jn+n+In}return t})):[]),t.ch){const e=t.ch;for(let t=0;t<e.length;t++){const n=e[t];if("text"===n.nn){if(typeof n.tc!==s.string)return;n.tc=n.tc.replace(er,((t,e)=>Jn+e+In))}nr(n)}0===e.length&&delete t.ch}}const rr={};function or(t,e){const n=function(t){const e=t.map((t=>t.length));return e.push(t.length),Number(e.join(""))}(t),r=rr[n],o=r&&function(t,e,n){if(n&&n.strings.length===t.length&&n.strings.every(((e,n)=>e===t[n]))&&n.values.length===e.length)return!0;return!1}(t,e,r);if(o)return r.domMetaMap;const s=function(t,e){return Gn(t,e),Bn(Gn(t,e).join(""))}(t,e),c=Qn(s,e.length);c.forEach(nr);const a={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:c};return rr[n]=a,c}function sr(t,...e){const n=Nn(t,e),r=ue(ke.NONE);return r.tag=n,n.templater=r,n}sr.dom=function(t,...e){return Wn(t,e)};const cr=[];function ar(t,e,r){const o=cr.findIndex((t=>t.element===e));if(o>=0){const t=cr[o].support;Ot(t,t.subject.global),cr.splice(o,1),console.warn("Found and destroyed app element already rendered to element",{element:e})}let s=()=>l(r);s.propWatch=ke.NONE,s.tagJsType=a.stateRender,s.props=[r],s.isApp=!0;const u=function(t,e){const r={value:t,checkValueChange:oe,delete:se,withinOwnerElement:!1,renderCount:0,global:void 0},o=n(r);return o.events={},ur(t,r,e),r}(s,e),i=u.global;x(i.newest,B.stateConfig);let l=t(r);const p=typeof l==c.function;p||(v(l)?(i.newest.propsConfig={latest:[r],castProps:[r]},s.propWatch=l.propWatch,s.tagJsType=l.tagJsType,s.wrapper=l.wrapper,s=l):(s.tag=l,l=t));const f=document.createTextNode("");ie.push(s.wrapper||{original:s});const d=ir(s,f,e,u,p);if(i.isApp=!0,p&&(l.tag=d.templater.tag),!e)throw new Error(`Cannot tagElement, element received is type ${typeof e} and not type Element`);e.destroy=function(){const t=i.events;for(const n in t){const r=t[n];e.removeEventListener(n,r)}i.events={},++g.locks;const n=Ot(d,i);return--g.locks,h(),n},++g.locks;const b=function(t,e,n,r,o,s){const c=qt(t,{added:0,removed:0},e,void 0);n.oldest=t,n.newest=t;let u=r.setUse;if(r.tagJsType!==a.stateRender){const t=o.original;u=t.setUse,t.isApp=!0}e.setUse=u,e.ValueTypes=a,cr.push({element:e,support:t});const i=document.createDocumentFragment();i.appendChild(s);for(const t of c.dom)lr(t,i);return i}(d,e,i,s,t,f);return--g.locks,h(),e.appendChild(b),{support:d,tags:ie,ValueTypes:a}}function ur(t,e,n){const r=e.global,o=Ze(t,e);return Ge(t,o,o),o.appElement=n,r.oldest=r.oldest||o,r.newest=o,o}function ir(t,e,n,r,o){r.placeholder=e;const s=r.global,c=s.oldest,u=s.newest===c,i=Rt(t,s.newest,s.newest.appSupport,r);if(u||A(0,s.newest,B.stateConfig,c.state),t.tagJsType===a.stateRender)return function(t,e,n,r,o){const s=t.wrapper||{original:t};if(!e){const e=ur(t,r,o);return me(e),e}return ne(t,s,n),me(n),n}(t,o,i,r,n);const l=(0,t.wrapper)(i,r);return me(i),l}function lr(t,e){t.domElement&&e.appendChild(t.domElement),t.marker&&e.appendChild(t.marker)}function pr(t,e,n){n.subject.global.deleted||(Lt(t,n,e),B.stateConfig.support||h())}const fr={tagElement:ar,renderWithSupport:Ve,renderSupport:Le,renderTagOnly:ve,paint:h};var dr=e.W9,gr=e.cg,hr=e.m0,br=e.rS,mr=e.Y2,vr=e.ei,yr=e.B7,wr=e.TU,Cr=e.XF,kr=e.PC,Sr=e.Ot,Tr=e.Mj,jr=e.tD,Er=e.j8,xr=e.um,Ar=e.E2,Or=e.OH,Pr=e.TB,Vr=e.Ii,Jr=e.yV,Ir=e.zV,Nr=e.pf,Wr=e.ze,Rr=e.WJ,Lr=e.Ng,Mr=e.VI,Dr=e.aZ,Br=e.O,$r=e.Ie,_r=e.B4,Hr=e.Az,Ur=e.Xi,Fr=e.Ah,zr=e.ck,Zr=e.Gk,Gr=e.zC,Xr=e.cF,qr=e.jU,Qr=e.PB,Yr=e.qy,Kr=e.cy,to=e.Tn,eo=e.Gv,no=e.yL,ro=e.D8,oo=e.Ze,so=e._4,co=e.mn,ao=e.z,uo=e.sA,io=e.MG,lo=e.PL,po=e.nI,fo=e.PZ,go=e.N_,ho=e.r5,bo=e.uc,mo=e.pG,vo=e.QB,yo=e.R6,wo=e.Ll,Co=e.vP,ko=e.wk,So=e.xP,To=e.bc,jo=e.B1,Eo=e.ag,xo=e.Tc,Ao=e.Hf,Oo=e._A,Po=e.Ag,Vo=e.NU,Jo=e.hW,Io=e.wB,No=e.id,Wo=e.MC,Ro=e.SZ;export{dr as ArrayNoKeyError,gr as BasicTypes,hr as ImmutableTypes,br as PropWatches,mr as RouteQuery,vr as StateMismatchError,yr as Subject,wr as Subjective,Cr as SyncCallbackError,kr as TagError,Sr as ValueSubject,Tr as ValueSubjective,jr as ValueTypes,Er as addOneContext,xr as buildBeforeElement,Ar as callback,Or as callbackMaker,Pr as checkArrayValueChange,Vr as checkSimpleValueChange,Jr as checkTagValueChange,Ir as combineLatest,Nr as createHtmlSupport,Wr as createTrigger,Rr as defineValueOn,Lr as deleteSimpleValue,Mr as destorySupportByContextItem,Dr as destroyArray,Br as destroySupport,$r as empty,_r as getBaseSupport,Hr as getDomMeta,Ur as getDomTag,Fr as getNewGlobal,zr as getStringTag,Zr as getTemplaterResult,Gr as hasPropChanges,Xr as hmr,qr as howToSetFirstInputValue,Qr as howToSetInputValue,Yr as html,Kr as isArray,to as isFunction,eo as isObject,no as isPromise,ro as isSimpleType,oo as isStaticTag,so as isSubjectInstance,co as isTagComponent,ao as letProp,uo as onDestroy,io as onInit,lo as oneRenderToSupport,po as paint,fo as processFirstSubjectValue,go as processSubUpdate,ho as providers,bo as renderSupport,mo as renderTagOnly,vo as renderWithSupport,yo as runWrapper,wo as setUseMemory,Co as signal,ko as state,So as states,To as subject,jo as subscribe,Eo as syncError,xo as tag,Ao as tagElement,Oo as tags,Po as upgradeBaseToSupport,Vo as variablePrefix,Jo as variableSuffix,Io as watch,No as willCallback,Wo as willPromise,Ro as willSubscribe};
|
|
1
|
+
var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function n(t){return t.renderCount=t.renderCount||0,t.global={}}t.d(e,{W9:()=>Xt,cg:()=>c,m0:()=>s,rS:()=>se,Y2:()=>r,ei:()=>qt,B7:()=>z,TU:()=>G,XF:()=>Qt,PC:()=>Zt,Ot:()=>In,Mj:()=>Wn,tD:()=>a,j8:()=>K,xe:()=>Dr,um:()=>Y,E2:()=>Zn,OH:()=>qn,TB:()=>O,Ii:()=>At,yV:()=>$t,zV:()=>_,pf:()=>Q,ze:()=>Xn,WJ:()=>Z,Ng:()=>Ot,VI:()=>Ht,aZ:()=>P,O:()=>R,Ie:()=>o,B4:()=>X,Az:()=>Ir,Xi:()=>ar,Ah:()=>n,ck:()=>cr,Gk:()=>Ft,zC:()=>ue,cF:()=>$r,jU:()=>i,PB:()=>u,qy:()=>Wr,cy:()=>y,Tn:()=>b,Gv:()=>m,yL:()=>h,D8:()=>p,Ze:()=>f,_4:()=>g,mn:()=>d,z:()=>Fn,sA:()=>Kn,MG:()=>Yn,PL:()=>Gt,CG:()=>Br,nI:()=>an,PZ:()=>Pt,r5:()=>Gn,uc:()=>Se,pG:()=>ee,QB:()=>ve,Ll:()=>Ct,vP:()=>Vn,wk:()=>Dn,xP:()=>Un,bc:()=>_n,B1:()=>tr,RX:()=>er,ag:()=>Qn,Tc:()=>ce,Hf:()=>Lr,_A:()=>zt,Ag:()=>q,NU:()=>or,hW:()=>sr,wB:()=>Ln,id:()=>Mn,MC:()=>Nn,SZ:()=>Rn});class r{get(t){return"todo"}}const o="";var s,c;!function(t){t.string="string",t.number="number",t.boolean="boolean",t[void 0]="undefined"}(s||(s={})),function(t){t.function="function",t.date="date",t.unknown="unknown",t.object="object"}(c||(c={}));const a={tag:"html",dom:"dom",templater:"templater",tagComponent:"tagComponent",tagArray:"tagArray",subscribe:"subscribe",signal:"signal",renderOnce:"renderOnce",stateRender:"stateRender",version:Date.now()};function u(t,e,n){nn.push((()=>i(t,e,n)))}function i(t,e,n){void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}function l(t,e,n,r,o,s){switch(r){case"init":{const t=s.added;return void sn.push((function(){e({target:n,stagger:t})}))}case"destroy":{const t=++s.removed,r=o.subject.global;return r.destroys=r.destroys||[],void r.destroys.push((()=>e({target:n,stagger:t})))}case"autofocus":return void sn.push((()=>n.focus()));case"autoselect":return void sn.push((()=>n.select()));case"style":{const r=t.split(".");return void nn.push((()=>n.style[r[1]]=e))}case"class":return void function(t,e,n){const r=t.split(".");if(r.shift(),e){for(const t of r)nn.push((()=>n.classList.add(t)));return}for(const t of r)nn.push((()=>n.classList.remove(t)))}(t,e,n)}throw new Error(`Invalid special attribute of ${r}. ${t}`)}function p(t){switch(t){case s.string:case s.number:case s.boolean:return!0}return!1}function f(t){if(!t)return!1;switch(t.tagJsType){case a.dom:case a.tag:case a.templater:return!0}return!1}function d(t){const e=t?.tagJsType;return e===a.tagComponent||e===a.stateRender}function g(t){return m(t)&&typeof t.subscribe===c.function}function h(t){return t&&b(t.then)}function b(t){return typeof t===c.function}function m(t){return typeof t===c.object&&null!==t}function y(t){return Array.isArray(t)}function v(t,e){return w(t,e)}function w(t,e){if(null===t||typeof t!==c.object)return t;if(e<0)return t;if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);const n=y(t)?[]:Object.create(Object.getPrototypeOf(t));if(y(t))for(let r=0;r<t.length;r++)n[r]=w(t[r],e-1);else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=w(t[r],e-1));return n}function k(t,e,n){return C(t,e,n)}function C(t,e,n){return!(t!==e&&(r=t,o=e,!b(r)||!b(o)||r.toString()!==o.toString()))||(n<0||typeof t===c.object&&typeof e===c.object&&(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():y(t)&&y(e)?function(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!C(t[r],e[r],n-1))return!1;return!0}(t,e,n-1):!y(t)&&!y(e)&&function(t,e,n){const r=Object.keys(t),o=Object.keys(e);if(0===r.length&&0===o.length)return!0;if(r.length!==o.length)return!1;for(const s of r){if(!o.includes(s)||!C(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var r,o}function S(t,e){const n=e.providers;if(n)for(const t of n)for(let n=t.children.length-1;n>=0;--n){t.children[n].subject.global===e&&t.children.splice(n,1)}e.destroy$&&e.destroy$.next(),t.subject.renderCount=0}function T(t,e){for(const n of t){const t=n.lastArray;if(t){T(t,e);continue}if(n.value?.tagJsType===a.subscribe){n.delete(n,e);continue}const r=n.global;if(!r)continue;const o=r.newest,s=r.subscriptions;s&&s.forEach(E),d(o.templater)&&S(o,r);T(r.context,o)}}function j(t,e=[],n=[]){for(const r of t){const t=r.global;if(!t)continue;const o=t.newest;if(o){e.push(o);const r=t.subscriptions;r&&n.push(...r)}const s=t.context;s&&j(s,e,n)}return{tags:e,subs:n}}function E(t){t.unsubscribe()}function x(t,e,n,r,o){const s=t.length-1,c=e-r,a=c<0||s<c,u=n[e];if(a)return A(u,o),1;const i=function(t,e,n,r,o,s){const c=e&&t!==e.arrayValue;if(c)return A(n,r),o.splice(s,1),2;return 0}(u.value.arrayValue,t[e],u,o,n,e);return i}function A(t,e){!function(t,e){if(t){R(t.oldest,t)}else{const t=e.simpleValueElm;delete e.simpleValueElm,en.push({processor:un,args:[t]})}}(t.global,t),++e.removed}function O(t,e){if(!y(t)){return P(e,e.lastArray),9}return!1}function P(t,e){const n={added:0,removed:0};for(let t=0;t<e.length;++t)A(e[t],n);delete t.lastArray}function V(t,e){const n=t.context,r=t.destroys;if(r)return function(t,e,n){if(J.length=0,t.forEach(I),J.length){const t=Promise.all(J).then((()=>{++cn.locks,W(e.context,n),M(e),--cn.locks,an()}));return void n.push(t)}++cn.locks,W(e.context,n),M(e),--cn.locks,an()}(r,t,e);W(n,e),M(t)}const J=[];function I(t){const e=t();e instanceof Promise&&J.push(e)}function W(t,e){for(const n of t){if(n.withinOwnerElement)continue;const t=n.lastArray;if(t){P(n,t);continue}const r=n.simpleValueElm;if(r){delete n.simpleValueElm,en.push({processor:un,args:[r]});continue}const o=n.global;if(void 0===o)continue;if(!0===o.deleted)continue;o.deleted=!0;o.oldest&&V(o,e)}}function M(t){t.htmlDomMeta.forEach(N)}function N(t){const e=t.marker;e&&en.push({processor:un,args:[e]});const n=t.domElement;n&&en.push({processor:un,args:[n]})}function R(t,e){const n=t.subject;e.deleted=!0,n.renderCount=0;const r=[];return T(e.context,t),e.destroy$&&S(t,e),V(e,r),r}function D(t,e){const n=t.templater,r=e.templater,o=n?.tag||t,s=r.tag;if(n?.tagJsType===a.stateRender)return n.dom===r.dom;switch(o.tagJsType){case a.dom:return s?.tagJsType===a.dom&&function(t,e){const n=t.dom,r=e.dom;return n===r}(o,s);case a.tag:{const n=function(t,e,n,r){const o=t.strings,s=e.strings;if(o.length!==s.length)return!1;if(!o.every(((t,e)=>s[e].length===t.length)))return!1;const a=n.templater.values||t.values,u=r.templater.values||e.values;return function(t,e){const n=t.length===e.length;if(!n)return!1;const r=e.every((function(e,n){const r=t[n];if(typeof e===c.function&&typeof r===c.function){return!!(e.toString()===r.toString())}return!0}));if(r)return!0;return!1}(a,u)}(o,s,t,e);return n}}throw new Error(`unknown tagJsType of ${o.tagJsType}`)}function L(t){return t.map(B)}function B(t,e){const n=t,r=t?.tagJsType;if(r)switch(r){case a.signal:case a.subscribe:case a.stateRender:return;case a.dom:case a.tag:case a.templater:return L(n.values)}return y(t)?L(n):v(t,e)}function $(t){return B(t,fe)}function H(t){return B(t,de)}function _(t){const e=new z;return e.subscribeWith=e=>{const n=[],r=[],o=(o,s)=>{n[s]=!0,r[s]=o;if(n.length===t.length){for(const t of n)if(!t)return;e(r,c)}},s=[...t],c=s.shift().subscribe((t=>o(t,0))),a=s.map(((t,e)=>t.subscribe((t=>o(t,e+1)))));return c.subscriptions=a,c},e}function U(t,e,n){const r=z.globalSubCount$;z.globalSubCount$.next(r.value+1);const o=function(){o.unsubscribe()};return o.callback=e,o.subscriptions=[],o.unsubscribe=function(){return function(t,e,n){!function(t,e){const n=t.findIndex((t=>t.callback===e));-1!==n&&t.splice(n,1)}(e,n);const r=z.globalSubCount$;z.globalSubCount$.next(r.value-1),t.unsubscribe=()=>t;const o=t.subscriptions;for(const t of o)t.unsubscribe();return t}(o,n,e)},o.add=t=>(o.subscriptions.push(t),o),o.next=t=>{e(t,o)},o}function F(t,e,n){const r=[...e],o=r.shift(),s=t=>{if(r.length)return F(t,r,n);n(t)};let c=s;const a=o(t,{setHandler:t=>c=t,next:s});c(a)}class z{value;onSubscription;methods=[];isSubject=!0;subscribers=[];subscribeWith;constructor(t,e){this.value=t,this.onSubscription=e}subscribe(t){const e=U(0,t,this.subscribers),n=this.subscribeWith;if(n){if(this.methods.length){const n=t;t=t=>{F(t,this.methods,(t=>n(t,e)))}}return n(t)}return this.subscribers.push(e),this.onSubscription&&this.onSubscription(e),e}next(t){this.value=t,this.emit()}set=this.next.bind(this);emit(){const t=this.value,e=this.subscribers;for(const n of e)n.callback(t,n)}toPromise(){return new Promise((t=>{this.subscribe(((e,n)=>{n.unsubscribe(),t(e)}))}))}toCallback(t){const e=this.subscribe(((n,r)=>{const o=r?.unsubscribe;o?o():setTimeout((()=>e.unsubscribe()),0),t(n)}));return this}pipe(...t){const e=new z(this.value);return e.setMethods(t),e.subscribeWith=t=>this.subscribe(t),e.next=t=>this.next(t),e}setMethods(t){this.methods=t}static all(t){return _(t.map((t=>{if(g(t))return t;return new z(t,(e=>(e.next(t),e)))})))}static globalSubCount$=new z(0)}class G extends z{value;onSubscription;_value;constructor(t,e){super(t,e),this.value=t,this.onSubscription=e,this._value=t,Z(this)}next(t){this._value=t,this.emit()}emit(){const t=this._value,e=this.subscribers;for(const n of e)n.callback(t,n)}}function Z(t){Object.defineProperty(t,"value",{set(e){t._value=e,t.emit()},get:()=>t._value})}function X(t,e,n){const r={templater:t,subject:e,castedProps:n,appSupport:void 0},o=e.global;return o.blocked=[],o.destroy$=new z,r}function q(t,e,n,r){e.appSupport=n;const o=t.props;return o&&(e.propsConfig=function(t,e,n){const r=t.templater;if(r.tagJsType!==a.stateRender){switch(r.propWatch){case se.IMMUTABLE:return t.propsConfig={latest:e,castProps:n};case se.SHALLOW:return t.propsConfig={latest:e.map($),castProps:n}}return t.propsConfig={latest:e.map(H),castProps:n}}}(e,o,r)),e}function Q(t,e,n,r,o){const s={templater:t,subject:r,castedProps:o,appSupport:void 0};return s.ownerSupport=e,s.appSupport=n,s}function Y(t,e,n,r){const o=t.subject;o.delete=Ht;const s=o.global;s.oldest=t,s.newest=t,++cn.locks;const c=function(t,e,n,r){const o=function(t){const e=t.templater,n=e.tag;if(n.tagJsType===a.dom)return n.dom;const r=n.strings;return Ir(r,n.values)}(t),s=t.templater.tag,c=s.values,u=[],i=t.subject.global;i.context=u;const l=Ye(o,c,t,e,u,0,n,r);return l}(t,e,n,r);return s.htmlDomMeta=c.dom,--cn.locks,c}function K(t,e,n){const r={value:t,checkValueChange:void 0,delete:void 0,withinOwnerElement:n};return e.push(r),r}function tt(t,e,n){const r=e.global.newest;r.ownerSupport=t,e.checkValueChange=$t;return Y(r,n,void 0,e.placeholder),r}function et(){return{tagJsType:a.templater,processInit:Ut}}function nt(t,e,n){const r=Q(t,e,e.appSupport,n);return n.global.context=[],r}function rt(t,e,n,r){const o=t[e],s=n[e];if(o===s.value)return;(0,s.handler)(o,r,s,t),s.value=o}function ot(t,e){const n=t.subject.global.context;!function(t,e){const n=e.templater,r=e.templater.tag,o=n.values||r.values,s=t.templater.tag;s.values=o}(t,e),++cn.locks,function(t,e){const n=t.templater.tag.values;let r=0;const o=n.length;for(;r<o;)rt(n,r,e,t),++r}(t,n),--cn.locks,an()}function st(t,e,n,r,o){const s=X(t,r,o);return s.ownerSupport=e,q(t,s,n,o)}function ct(t,e,n){return t.map((function(t){return function(t,e,n,r){if(f(t)||!t)return t;if(!e)return t;return at(t,e,n,r)}(t,e.ownerSupport,e,n)}))}function at(t,e,n,r,o,s){if(!t)return t;if(t.tagJsType)return t;if(typeof t===c.function)return r<=1?function(t,e,n,r){const o=t.mem;if(o)return t;const s=function(...t){return function(t,e,n,r,o){const s=r.subject.global,c=s?.newest||r,a=void 0===nr(),u=t.apply(e,n),i=function(){const t=c.subject.global;return t&&!0!==t.locked?(lt(c,r),u):u};if(a)return i();return Ct.tagClosed$.toCallback(i),u}(s.mem,e,t,n)};return s.original=t,s.mem=t,Object.assign(s,t),s}(t,o,e):t;if(r===de)return t;return it(t)?t:y(t)?function(t,e,n,r){for(let o=t.length-1;o>=0;--o){const s=t[o];if(t[o]=at(s,n,e,r+1,t),typeof s===c.function){if(s.mem)continue;ut(r+1,o,s,t,e)}}return t}(t,n,e,r):function(t,e,n,r){const o=Object.keys(t);for(const s of o){const o=t[s],a=at(o,n,e,r+1,t,s);if(t[s]===a)continue;const u=Object.getOwnPropertyDescriptor(t,s);if(!(u?.get||u?.set)&&(t[s]=a,typeof a===c.function)){if(o.mem)continue;ut(r+1,s,o,t,e)}}return t}(t,n,e,r)}function ut(t,e,n,r,o){if(t>0){const t=o.subject.global;r[e].subscription=t.destroy$.toCallback((function(){r[e]=n}))}}function it(t){return typeof t!==c.object||!t||t.tagJsType}function lt(t,e){const n=t.subject;if(Ce(t.templater)){return Te(e,t)}const r=n.global;r.locked=!0,ke(r.newest,t,e,n),delete r.locked}function pt(t){let e=t;for(;e.ownerSupport&&!d(e.templater);)e=e.ownerSupport;return e.subject.global.newest||e}function ft(...t){return t}function dt(t){const e=Ct.stateConfig;return e.states[e.statesIndex]=t,++e.statesIndex,t(ft)}function gt(t){const e=Ct.stateConfig,n=e.statesIndex,r=pt(e.prevSupport).states[n];let o=[];r((function(...t){return o=t,t}));return e.states[e.statesIndex]=t,++e.statesIndex,t((function(...t){return o}))}function ht(t,e){e.handlers.handler=wt,e.handlers.statesHandler=dt,e.rearray=[],e.stateArray=[],e.states=[],e.statesIndex=0,e.support=t}function bt(t,e,n,r){n.rearray=r,n.stateArray=[],n.states=[],n.statesIndex=0,n.handlers.handler=vt,n.handlers.statesHandler=gt,n.prevSupport=e}class mt{}function yt(t){const e=t.callback;if(!e)return t.defaultValue;const[n]=function(t){const[e]=t(mt),[n]=t(e);return[e,n]}(e);return n}function vt(){const t=Ct.stateConfig,e=t.rearray[t.stateArray.length];return t.stateArray.push(e),e.defaultValue}function wt(t){const e=Ct.stateConfig;let n=t;if(typeof t===c.function&&(n=t()),typeof n===c.function){const t=n;n=function(...e){return t(...e)},n.original=t}const r={get:function(){return yt(r)},defaultValue:n};return e.stateArray.push(r),n}const kt=new z(void 0,(function(t){nr()||t.next()})),Ct={stateConfig:{stateArray:[],version:Date.now(),handlers:{handler:wt,statesHandler:dt}},tagClosed$:kt};function St(t,e,n,r){const o=e.original,s=t.tagJsType===a.stateRender,u=Ct.stateConfig;let i;return u.support=n,s?i=t():(i=o(...r),typeof i===c.function&&(i=i())),i.templater=t,t.tag=i,n.state=u.stateArray,n.states=u.states,n}function Tt(t,e,n){const r=t.propWatch===se.DEEP?de:fe,o=t.props,s=e.propsConfig;let c=s.castProps;const a=n?.propsConfig,u=a?.castProps;u&&(s.castProps=u,c=be(e,n,n.ownerSupport,o,r));return c||ct(o,e,0)}function jt(t,e,n,r){const o=st(t,n,n.appSupport,e),s=o.propsConfig;if(s){const e=t.tagJsType!==a.tagComponent?[]:Tt(t,o);s.castProps=e}const c=e.global,{support:u}=ve(o,c.newest,e,n);return function(t,e,n){n.checkValueChange=$t,Y(t,e,void 0,n.placeholder)}(u,r,e),u}function Et(t,e,n,r,o){const s=st(t,n,n.appSupport,e),c=s.propsConfig;if(c){const e=t.tagJsType!==a.tagComponent?[]:Tt(t,s);c.castProps=e}const u=e.global,{support:i}=ve(s,u.newest,e,n);return function(t,e,n){let r=on.length;const o=Y(t,e,n,void 0);for(const t of o.dom)t.domElement&&on.splice(r++,0,{args:[n,t.domElement],processor:pn}),t.marker&&on.splice(r++,0,{args:[n,t.marker],processor:pn})}(i,r,o),i}function xt(t){switch(t){case void 0:case!1:case null:return o}return t}function At(t,e){return null==t||typeof t!==c.object?(function(t,e){const n=xt(t);if(e.paint)return void(e.paint.args[1]=n);const r=e.simpleValueElm;rn.push([n,r])}(t,e),-1):(Ot(e),6)}function Ot(t){const e=t.simpleValueElm;if(delete t.simpleValueElm,delete t.checkValueChange,!e)throw new Error("how does this happen?");en.push({processor:un,args:[e]})}function Pt(t,e,n,r,o,s){const c=t?.tagJsType;return c?t.processInit(t,e,n,r,o,s):y(t)?(It(e,t,n,r,o),void(e.checkValueChange=O)):void function(t,e,n){const r=xt(t),o=e.paint={processor:dn,args:[n,r,t=>{e.simpleValueElm=t,delete e.paint}]};en.push(o),e.checkValueChange=At,e.delete=Ot}(t,e,e.placeholder)}function Vt(t,e,n,r,o,s){n.handler=Rt;e.subject.global.locked=!0,Pt(t,n,e,r,o,s);delete e.subject.global.locked,n.value=t}function Jt(t,e,n,r,o){const s=document.createTextNode(""),c={value:t,checkValueChange:void 0,delete:void 0,withinOwnerElement:!1,placeholder:s};return n.added=n.added+1,o||en.push({processor:ln,args:[r,s]}),Vt(t,e,c,n,o,r),o&&on.push({processor:pn,args:[o,s]}),c}function It(t,e,n,r,o){const s=void 0===t.lastArray;s&&(t.lastArray=[]);const c=t.lastArray;let a=t.placeholder,u=0;const i=[];if(!s){for(let t=0;t<c.length;++t){const n=c[t],o=x(e,t,c,u,r);0!==o?2!==o?u+=o:t-=1:i.push(n)}t.lastArray=i}const l=e.length;for(let s=0;s<l;++s){a=Wt(e,s,t.lastArray,n,a,r,o).placeholder}}function Wt(t,e,n,r,o,s,c){const a=t[e],u=n[e];if(u)return function(t,e,n,r,o,s,c,a){const u=n.length>o;if(u)return Rt(t,r,e),e;const i=Jt(t,r,c,s,a);return n.push(i),i}(a,u,n,r,e,o,s,c);const i=Jt(a,r,s,o,c);return n.push(i),i}function Mt(t,e,n,r){const o=t&&t.tagJsType;if(o){if(o===a.renderOnce)return;Bt(e,t,n)}else y(t)?It(e,t,n,{added:0,removed:0}):typeof t!==c.function?r&&function(t,e){e.checkValueChange=At,e.delete=Ot;const n=e.placeholder,r=xt(t),o=e.paint={processor:dn,args:[n,r,t=>{e.simpleValueElm=t,e.simpleValueElm=t,delete e.paint}]};en.push(o)}(t,e):e.value=t}function Nt(t,e,n){const r=t.checkValueChange(e,t);-1!==r&&Mt(e,t,n,r)}function Rt(t,e,n){t!==n.value&&Nt(n,t,e)}function Dt(t,e,r){if(!e.global.newest)return void jt(t,e,r,{added:0,removed:0});!function(t,e,r){const o=r.global,s=o.newest,c=s.templater.wrapper,u=e.templater.wrapper;let i=!1;const l=e.templater.tagJsType,p=a.stateRender===l||a.renderOnce===l;if(p)i=e.templater.tagJsType===a.renderOnce||D(s,e);else if(c&&u){i=c.original===u.original}const f=e.templater;if(!i)return void function(t,e,r){const o=t.global,s=o.oldest;R(s,o),n(t);const c=jt(e,t,r,{added:0,removed:0})}(r,f,t);const d=p||function(t,e){const n=e.props,r=t.propsConfig,o=r.latest,s=ue(n,o,t.templater.propWatch);return s}(s,f);if(!d){return void function(t,e,n,r,o){const s=t.props,c=be(e,n,r,s,o),a=e.propsConfig;a.castProps=c;const u=n.propsConfig;u.latest=a.latest}(f,e,s,t,f.propWatch===se.DEEP?de:fe)}if(o.locked)return void o.blocked.push(e);Se(e),++r.renderCount}(r,st(t,r,r.appSupport,e),e)}const Lt={added:0,removed:0};function Bt(t,e,r){const o=e.tagJsType;if(d(e))return void 0===t.global&&n(t),Dt(e,t,r),!0;const s=t.global;if(s){const n=s.newest;if(n)return typeof e===c.function||function(t,e,n,r){const o=st(n.templater||n,r,r.appSupport,e);ot(t.subject.global.oldest,o)}(n,t,e,r),!0}switch(o){case a.templater:return tt(r,t,Lt),!0;case a.tag:case a.dom:return function(t,e,r){const o=t;let s=o.templater;s||(s=et(),o.templater=s,s.tag=o);const c=e.global?e.global:n(e);c.newest=nt(s,r,e),tt(r,e,Lt)}(e,t,r),!0;case a.subscribe:return e.processInit(e,t,r,{added:0,removed:0},void 0,t.placeholder),!0}return!1}function $t(t,e){const r=e.global;if(!r)return 663;const o=r?.newest;if(f(t)){return D(t,o)?77:(R(o,r),n(e),7)}const s=t?.tagJsType;if(s){return!0===Bt(e,t,r.newest.ownerSupport)?-1:88}return Ht(e),8}function Ht(t){const e=t.global,n=e?.newest;R(n,e),delete t.global,t.renderCount=0}function _t(t,e,n,r,o,s){e.checkValueChange=$t;const c=nt(t,n,e);c.ownerSupport=n;const a=Y(c,r,o,o?void 0:s);for(const t of a.dom)t.marker&&(o?on.push({args:[o,t.marker],processor:pn}):en.push({processor:ln,args:[s,t.marker]})),t.domElement&&(o?on.push({args:[o,t.domElement],processor:pn}):en.push({processor:ln,args:[s,t.domElement]}));return c}function Ut(t,e,n,r,o,s){return e.checkValueChange=$t,o?_t(t,e,n,r,o,s):tt(n,e,r)}function Ft(t,e){const n={tagJsType:a.templater,processInit:Ut,propWatch:t,props:e,key:function(t){return n.arrayValue=t,n}};return n}const zt=[];function Gt(t,e,n){const r=Ft(se.DEEP);r.tagJsType=t.tagJsType;const o=nt(r,n,e);function s(){return r.tag=t(),o}return r.wrapper=s,s.tagJsType=t.tagJsType,s.original=t.original||t,o}class Zt extends Error{details;constructor(t,e,n={}){super(t),this.name=Zt.name,this.details={...n,errorCode:e}}}class Xt extends Zt{constructor(t,e){super(t,"array-no-key-error",e),this.name=Xt.name}}class qt extends Zt{constructor(t,e){super(t,"state-mismatch-error",e),this.name=qt.name}}class Qt extends Zt{constructor(t,e){super(t,"sync-callback-error",e),this.name=Qt.name}}function Yt(t,e){const n=t.rearray;n.length&&n.length!==t.stateArray.length&&function(t,e,n){const r=`Saved states between renders are inconsistent. Expected ${t.length} states got ${n.stateArray.length}.`,o=e.templater?.wrapper;let s=o;(o?.original||o?.original)&&(s=o.original);const c={oldStates:n.stateArray,newStates:n.rearray,tagFunction:s,templater:e.templater},a=new qt(r,c);throw console.error(Kt,c),a}(n,e,t)}const Kt="State tracking requires same number of state calls on every render. This error typically occurs when a state call is only reachable behind a condition. Also, wrapping tags that have state, with tag(), often helps when tag is only reachable by a condition.";function te(t,e){const n=t.subject;++n.renderCount;const r=Ct.stateConfig;t.state=r.stateArray,t.states=r.states,n.global.newest=t,Yt(r,t),delete r.prevSupport,delete r.support,delete r.stateArray,delete r.states,Ct.tagClosed$.next(e)}function ee(t,e,n,r){!function(t,e){const n=e?.state,r=Ct.stateConfig;if(n)return void bt(0,e,Ct.stateConfig,n);ht(t,r)}(t,e);const o=t.templater;let s;if(o.tagJsType===a.stateRender){const e=o;s=st(o,r,t.appSupport,n),St(o,e,s)}else{s=(0,o.wrapper)(t,n,e)}return te(s,r),s}function ne(t,e,r,o,s,c){n(e);const a=Gt(t,e,r);ee(a,void 0,e,r);const u=_t(a.templater,e,r,o,s,c);return e.checkValueChange=$t,u}function re(t,e,r,o,s){if(n(e),e.checkValueChange=$t,s){return Et(t,e,r,o,s)}return jt(t,e,r,o)}let oe=0;var se;function ce(t,e=se.SHALLOW){const n=function(...r){const o=Ft(e,r);o.tagJsType=a.tagComponent,o.processInit=re;const s=function(t,e){return function(n,r,o){const s=Tt(t,n,o),c=n.ownerSupport,a=st(t,c,n.appSupport,r,s);return St(t,e,a,s)}}(o,n);return s.original=t,o.wrapper=s,o},r=t;return n.original=t,r.tags=zt,r.setUse=Ct,r.ValueTypes=a,r.tagIndex=oe++,zt.push(n),n}function ae(){throw new Error("Do not call tag.use as a function but instead set it as: `(props) => tag.use = (use) => html`` `")}function ue(t,e,n){if(Ee(t,e))return 11;switch(n){case se.NONE:return 1;case se.SHALLOW:return pe(t,e);case se.IMMUTABLE:return le(t,e)}return function(t,e){let n=t,r=e;n=[...t],r=[...e||[]];if(!n.every(((t,e)=>function(t,e,n,r){const o=r[e];if(typeof t===c.object){const e={...t},n={...o||{}},r=Object.entries(e).every((([t,r])=>ie(r,n[t],(()=>{delete e[t],delete n[t]}))));return r}return ie(t,o,(function(){n.splice(e,1),r.splice(e,1)}))}(t,e,n,r))))return 7;return!1}(t,e)}function ie(t,e,n){if(typeof t!==c.function)return!!k(t,e,de)&&4;if(typeof e!==c.function)return!1;const r=e?.original;r&&(e=r);t.original&&(t=t.original);return t.toString()===e.toString()?(n(),5):(n(),6)}function le(t,e){const n=t.length;for(let r=0;r<n;++r){if(t[r]!==e[r])return 2}return!1}function pe(t,e){const n=t.length;for(let r=0;r<n;++r){const n=t[r],o=e[r];if(y(n)&&y(o)){if(n===o)continue;return 3}if(typeof n!==c.function||typeof o!==c.function)if(typeof n!==c.object){if(n!==o)return 3.3}else if(typeof e===c.object){const t=Object.entries(n);for(const e of t){if(!ge(e,o))return 3.1}}}return!1}!function(t){t.DEEP="deep",t.SHALLOW="shallow",t.NONE="none",t.IMMUTABLE="immutable"}(se||(se={})),ce.renderOnce=function(){throw new Error("Do not call tag.renderOnce as a function but instead set it as: `(props) => tag.renderOnce = () => html`` `")},ce.state=ae,ce.use=ae,ce.route=function(t){throw new Error("Do not call tag.route as a function but instead set it as: `tag.route = (routeProps: RouteProps) => (state) => html`` `")},ce.app=function(t){throw new Error("Do not call tag.route as a function but instead set it as: `tag.route = (routeProps: RouteProps) => (state) => html`` `")},ce.deepPropWatch=ce,ce.immutableProps=function(t){return ce(t,se.IMMUTABLE)},ce.watchProps=function(t){return ce(t,se.SHALLOW)},Object.defineProperty(ce,"renderOnce",{set(t){t.tagJsType=a.renderOnce,t.processInit=ne}}),Object.defineProperty(ce,"state",{set(t){t.original={setUse:Ct,tags:zt},t.tagJsType=a.stateRender,t.processInit=re}}),Object.defineProperty(ce,"use",{set(t){t.original={setUse:Ct,tags:zt},t.tagJsType=a.stateRender,t.processInit=re}});const fe=3,de=10;function ge([t,e],n){const r=n[t];return typeof e===c.function&&typeof r===c.function||r===e}function he(t,e,n,r,o,s){return null==t||s>o?e:typeof t===c.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):it(e)?e:y(e)?function(t,e,n,r,o,s){for(let c=t.length-1;c>=0;--c){const a=t[c],u=e[c];t[c]=he(u,a,n,r,s,o+1)}return t}(e,t,n,r,s,o):function(t,e,n,r,o,s){const c=Object.keys(t);for(const a of c){const c=t[a],u=he(e[a],c,n,r,s,o+1);if(c===u)continue;const i=Object.getOwnPropertyDescriptor(t,a)?.set;i||(t[a]=u)}return t}(e,t,n,r,s,o)}function be(t,e,n,r,o,s=-1){const c=e.subject.global.newest;if(!c){const e=ct(r,t,s);r.push(...e);return t.propsConfig.castProps=e,r}const a=(e=c||e).propsConfig.castProps,u=[];for(let e=0;e<r.length;++e){const c=r[e],i=he(a[e],c,t,n,o,s+1);u.push(i)}return t.propsConfig.castProps=u,u}function me(t){const e=t.subject,r=e.global,{subs:o,tags:s}=j(r.context);ye(r);for(const t of s){const e=t.subject.global;if(!0===e.deleted)return;ye(e)}r.subscriptions&&o.forEach(E),n(e)}function ye(t){t.deleted=!0,V(t,[])}function ve(t,e,n,r){const o=e?.templater,s=o?.tag,c=ee(t,e,n,r),u=!e||D(e,c);if(u){if(e){const t=e.templater.tag;t&&n.renderCount>0&&function(t,e,n){if(t.tagJsType===a.dom){const r=n?.dom;return void(r!==t.dom&&me(e))}if(n){const r=n.strings;if(r){const n=r?.length;n!==t.strings.length&&me(e)}}}(t,e,s)}}else{!function(t,e){const n=t.subject.global;let r=-1;const o=n.providers=n.providers||[],s=o.length-1;for(;r++<s;){const t=o[r];let s=-1;const c=t.children.length-1;for(;s++<c;)if(n===t.children[s].subject.global)return t.children.splice(s,1),void t.children.push(e)}}(e,c),me(e);const t=c.subject.global;t.oldest=c,t.newest=c}const i=e?.ownerSupport;return c.ownerSupport=r||i,{support:c,wasLikeTags:u}}const we={added:0,removed:0};function ke(t,e,n,r){const o=r.global,{support:s,wasLikeTags:c}=ve(e,t,r,n);return c?(ot(o.oldest,s),s):(tt(n,r,we),s)}function Ce(t){return a.templater===t.tagJsType}function Se(t){const e=t.subject.global,n=Ce(t.templater),r=t.ownerSupport;if(e.locked)return e.blocked.push(t),t;if(n){return Te(r,t)}e.locked=!0;const o=t.subject;e.blocked.length&&(t=e.blocked.pop(),e.blocked=[]);const s=ke(e.newest,t,r,o);return delete e.locked,s}function Te(t,e){const n=t.subject.global;if(!n||!0===n.deleted)return e;return Se(n.newest||t)}function je(t,e,n){const r=function(t,e){const n=t.props,r=e.propsConfig,o=r.latest;if(Ee(n,o))return!0;switch(t.propWatch){case se.IMMUTABLE:return le(n,o);case se.SHALLOW:return pe(n,o)}return!k(n,o,de)}(e,n);return!(!t||!r)}function Ee(t,e){return t.length!==e.length}function xe(t,e){const n=function(t,e,n=[]){const r=t.subject;n.push({support:t,renderCount:r.renderCount,provider:e});const o=e.children;for(let t=o.length-1;t>=0;--t){const r=o[t],s=r.subject;n.push({support:r,renderCount:s.renderCount,provider:e})}return n}(t,e);return n}function Ae(t){return t.support}function Oe(t,e=[]){const n=t.subject.global,r=Ce(t.templater),o=t.ownerSupport;if(n.locked)return e.push(t),e;if(r)return Oe(o,e);const s=t,c=d(s.templater),u=t.templater.tagJsType,i=o&&u!==a.stateRender&&(!c||je(o,s.templater,s)),l=function(t){const e=t.subject.global.providers;if(!e)return[];const n=[];for(const t of e){const e=xe(t.owner,t);n.push(...e.map(Ae))}return n}(s);return e.push(...l),i?(Oe(o,e),c&&e.push(s),e):(e.push(s),e)}function Pe(t){++cn.locks,t.forEach(Ve),--cn.locks,an()}function Ve(t){const e=t.subject.global;e&&Se(e.newest)}const Je="no-data-ever",Ie="promise-no-data-ever";function We(t,e){const n=e.subject.global,r=function(t,e){if(!0!==n.deleted)return function(t,e,n,r,o){const s=pt(e),c=s.subject,a=c.global;a.locked=!0;const u=t.apply(r,o);delete a.locked;const i=function(t,e){const n=e.subject.global;return function(t,e,n){return Pe(Oe(t)),function(t,e,n){if(h(t)){return e.subject.global.locked=!0,t.then((()=>{if(!0===n.deleted)return Ie;delete e.subject.global.locked;return Pe(Oe(e)),Ie}))}return Je}(e,t,n)}(e,t,n)}(u,s);return i}(r.tagFunction,r.support,r.states,t,e)};r.tagFunction=t;const o=pt(e);r.support=e;const s=o.states;return r.states=s,r}const Me=["init","destroy"];function Ne(t,e,n,r,o,s,c){if(c)return l(t,e,n,c,s,o);r(n,t,e)}function Re(t,e,n,r){const o=t.appElement;"blur"===e&&(e="focusout");const s="_"+e,c=t.subject.global.events;if(!c[e]){const t=function(t){t.originalStopPropagation=t.stopPropagation,De(t,s,t.target)};c[e]=t,o.addEventListener(e,t)}n[s]=r,n[e]=r}function De(t,e,n){const r=n[e];if(r){let e=!1;if(t.stopPropagation=function(){e=!0,t.originalStopPropagation.call(t)},r(t),t.defaultPrevented||e)return}const o=n.parentNode;o&&De(t,e,o)}function Le(t,e,n,r){const o=function(...e){return o.tagFunction(t,e)};o.tagFunction=e,o.support=n,Re(n.appSupport,r,t,o)}function Be(t){if(t.startsWith("class."))return"class";const e=function(t){switch(t){case"autoselect":return"autoselect";case"autofocus":return"autofocus";case"oninit":case"init":return"oninit";case"ondestroy":case"destroy":return"destroy"}return!1}(t);return!1!==e||!!t.startsWith("style.")&&"style"}const $e={added:0,removed:0};function He(t,e,n,r){if(n.isNameOnly)return function(t,e,n,r,o,s,a,u){if(n){if(Xe(e))return void r.removeAttribute(n);if(typeof n===c.object)if(typeof e===c.object)for(const t in n)t in e||nn.push((function(){r.removeAttribute(t)}));else for(const t in n)nn.push((function(){r.removeAttribute(t)}))}Ue(t,e,r,o,s,a,u)}(r,t,n.value,n.element,e,n.howToSet,[],$e),void(n.value=t);const o=n.element;Fe(t,n.attrName,n,o,e,n.howToSet,n.isSpecial,$e),n.value=t}function _e(t,e,n,r,o,s,a,u,i){const p=Ze(e);if(p>=0){const e=t[p],c=K(e,s,!0);return c.isAttr=!0,c.element=n,c.howToSet=o,c.isNameOnly=!0,c.handler=He,void Ue(t,e,n,r,o,s,u)}const f=Ze(i);if(f>=0){const i=t[f],p={isAttr:!0,element:n,attrName:e,withinOwnerElement:!0};return s.push(p),p.handler=He,function(t,e,n,r,o,s,a,u){n.attrName=t,n.element=r,n.howToSet=o,typeof e===c.function?u&&Me.includes(t)?l(t,e,r,t,s,a):Ge(n,e,s,t,r):(n.attrName=t,n.element=r,n.howToSet=o,n.isSpecial=u,Ne(t,e,r,o,a,s,u))}(e,i,p,n,o,r,u,a),void(p.value=i)}return Ne(e,i,n,o,u,r,a)}function Ue(t,e,n,r,s,a,u){if(!Xe(e))if(typeof e!==c.object)0!==e.length&&s(n,e,o);else for(const o in e){const c=e[o];_e(t,o,n,r,s,a,Be(o),u,c)}}function Fe(t,e,n,r,o,s,c,u){return b(t)?function(t,e,n,r,o,s,c,u){const i=t.templater.wrapper;if((i?.tagJsType||i?.original?.tagJsType)!==a.renderOnce)return Ge(c,e,t,r,n);return ze(e,n,r,o,s,t,u)}(o,t,r,e,c,s,n,u):ze(t,r,e,c,s,o,u)}function ze(t,e,n,r,o,s,c){if(!1===r){switch(t){case void 0:case!1:case null:return void nn.push((function(){e.removeAttribute(n)}))}if(b(t))return Le(e,t,s,n);o(e,n,t)}else l(n,t,e,r,s,c)}function Ge(t,e,n,r,o){return Le(o,e=We(e,n),n,r)}function Ze(t){return m(t)&&"tagJsVar"in t?t.tagJsVar:-1}function Xe(t){return null==t||!1===t}function qe(t,e,n,r,s,c,a){const u=document.createTextNode(o),i=K(t,e,s>0);i.placeholder=u,c?on.push({processor:pn,args:[c,u]}):en.push({processor:ln,args:[a,u]}),Vt(t,n,i,r,c,a)}const Qe=function(){};function Ye(t,e,n,r,s,c,a,u){const i=[];a&&void 0===u&&(u=document.createTextNode(o),on.push({args:[a,u],processor:pn}),a=void 0);for(let o=0;o<t.length;++o){const l=t[o],p=l.v;if(!isNaN(p)){qe(e[s.length],s,n,r,c,a,u);continue}const f={};if(i.push(f),"text"===l.nn){tn(f,l,a,u);continue}const d=Ke(f,l,e,n,s,r,a,u);l.ch&&(f.ch=Ye(l.ch,e,n,r,s,c+1,d,u).dom)}return{dom:i,context:s}}function Ke(t,e,n,r,o,s,c,a){const u=t.domElement=document.createElement(e.nn);if(e.at)for(const t of e.at){const e=t[0],c=t[1];_e(n,e,u,r,i,o,t[2]||!1,s,c)}return c?on.push({args:[c,u],processor:pn}):en.push({processor:ln,args:[a,u]}),u}function tn(t,e,n,r){const o=t,s=o.tc=e.tc;n?on.push({processor:gn,args:[n,s,t=>o.domElement=t]}):en.push({processor:dn,args:[r,s,t=>o.domElement=t]})}let en=[],nn=[],rn=[],on=[],sn=[];const cn={locks:0};function an(){if(!(cn.locks>0)){for(const t of nn)t();for(const[t,e]of rn)e.textContent=t;for(const t of on)t.processor(...t.args);for(const t of en)t.processor(...t.args);en=[],nn=[],on=[],rn=[];for(const t of sn)t();sn=[]}}function un(t){t.parentNode.removeChild(t)}function ln(t,e){t.parentNode.insertBefore(e,t)}function pn(t,e){t.appendChild(e)}const fn="object"==typeof document&&document.createElement("div");function dn(t,e,n=Qe){fn.innerHTML=e;const r=document.createTextNode(fn.innerHTML);ln(t,r),n(r)}function gn(t,e,n){fn.innerHTML=e;const r=document.createTextNode(fn.textContent);pn(t,r),n(r)}function hn(t,e){for(let n=0;n<t.length;++n){vn(t[n],e[n])}}let bn;function mn(...t){return bn=t,t}function yn(){return bn}function vn(t,e){t(mn,1),e(yn,2)}function wn(t,e,n,r){for(let n=t.length-1;n>=0;--n){const r=t[n].get(),o=e[n].callback;o&&o(r)}for(let t=r.length-1;t>=0;--t){Cn.length=0,kn=0;(0,r[t])(Sn),n[t](Tn)}}let kn=0;const Cn=[];function Sn(...t){return Cn.push(t),t}function Tn(...t){return Cn[kn++]}function jn(t,e,n,r,s,c,a){let u;c&&(u=a=document.createTextNode(o),on.push({processor:pn,args:[c,a]}));const i=function(t,e,n,r,o){const s=pt(e);let c=function(t){i.hasEmitted=!0,i.contextItem=Jt(t,e,n,o),c=function(t){Nt(i.contextItem,t,e),u||Ct.stateConfig.support||an()}};const a=function(t){i.lastValue=t;const e=s.subject.global.newest;var n;n=s,hn(e.states,n.states),i.callback&&(t=i.callback(t)),c(t)};let u=!0;const i={hasEmitted:!1,handler:a,callback:r,states:s.states,lastValue:void 0,subscription:void 0};return i.subscription=t.subscribe(a),u=!1,i}(t,n,r,s,a);return i.appendMarker=u,e.subscription=i,e.delete=xn,e.handler=En,i}function En(t,e,n){if(!t||!t.tagJsType||t.tagJsType!==a.subscribe)return n.delete(n,e),Mt(t,n,e,99),99;const r=n.subscription;if(!r.hasEmitted)return-1;r.callback=t.callback,r.handler(r.lastValue);const o=pt(e);return r.states=o.states,-1}function xn(t,e){const n=t.subscription;n.deleted=!0,delete t.subscription,n.subscription.unsubscribe();const r=n.appendMarker;if(r&&(en.push({processor:un,args:[r]}),delete n.appendMarker),delete t.delete,t.handler=Rt,n.hasEmitted)return n.contextItem.delete(n.contextItem,e),77}function An(t,e,n,r,o,s){return jn(t.Observable,e,n,r,t.callback,o,s)}function On(t,e,n,r,o,s){const c=t.Observable,a=jn(c,e,n,r,t.callback,o,s);return a.hasEmitted||a.handler(c.value||t.withDefault),a}function Pn(t,e,n,r,o){jn(t,e,n,r,void 0,o)}function Vn(t){return nr()?Dn((()=>Jn(t))):Jn(t)}function Jn(t){let e=t;const n=new Set;return{tagJsType:a.signal,processInit:Pn,get value(){return e},set value(t){e!==t&&(e=t,n.forEach((e=>e(t))))},subscribe(t){t(e),n.add(t);const r=()=>n.delete(t);return r.unsubscribe=r,r}}}class In extends z{value;constructor(t){super(t),this.value=t}subscribe(t){const e=super.subscribe(t);return t(this.value,e),e}}class Wn extends z{value;constructor(t){super(t),this.value=t,this._value=t,Z(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function Mn(t){return(e,n)=>{n.setHandler((()=>{})),t(e,n.next)}}function Nn(t){return(e,n)=>{n.setHandler((()=>{}));t(e).then((t=>n.next(t)))}}const Rn=t=>(e,n)=>{n.setHandler((()=>{}));const r=t(e).subscribe((t=>{r.unsubscribe(),n.next(t)}))};function Dn(t){return Ct.stateConfig.handlers.handler(t)}const Ln=(t,e)=>$n(t,e),Bn=t=>t;const $n=(t,e,{init:n,before:r,final:o=Bn}={})=>{const s=Dn({pastResult:void 0,values:void 0}),c=s.values;if(void 0===c){if(r&&!r(t))return s.values=t,s.pastResult;const a=(n||e)(t,c);return s.pastResult=o(a),s.values=t,s.pastResult}if(t.every(((t,e)=>t===c[e])))return s.pastResult;if(r&&!r(t))return s.values=t,s.pastResult;const a=e(t,c);return s.pastResult=o(a),c.length=0,c.push(...t),s.pastResult};function Hn(t,e){return Object.defineProperty(e,"noInit",{get(){const e=t();return e.setup.init=()=>{},e}}),Object.defineProperty(e,"asSubject",{get(){const e=t(),n=Dn((()=>nr())),r=Dn((()=>new In(void 0))),o=Dn((()=>({stateArray:Ct.stateConfig.stateArray,states:Ct.stateConfig.states}))),s=(t,s)=>($n(t,((t,e)=>{const c=nr(),a=s(t,e);if(c!==n){const t=o.stateArray,e=n.subject.global.oldest;wn(t,e.state,o.states,e.states)}r.next(a)}),e.setup),r);return s.setup=e.setup,Hn((()=>s),s),s}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function _n(t){return nr()?Dn((()=>new z(t))):new z(t)}function Un(t){return Ct.stateConfig.handlers.statesHandler(t)}function Fn(t){const e=Vn([]),n=Vn(0),r=Vn(0);let o=[],s=0;return r.value=n.value,t(((...t)=>(o=t,e.value))),Ln(o,(()=>{++s,e.value=o,t((()=>o))})),Un(((o,c)=>{if(s)return t(((...t)=>(c&&1!==c||(e.value=t),e.value))),r.value=n.value,void++n.value;t((()=>e.value))})),++s,e.value}function zn(){return{stateDiff:0,provider:void 0}}Hn((()=>function(t){const e=(e,n)=>$n(e,n,t);return e.setup=t,Hn((()=>e),e),e}({})),Ln),_n._value=t=>{const e=Dn((function(){return{stateArray:Ct.stateConfig.stateArray,states:Ct.stateConfig.states}})),n=nr();return Dn((function(){return new In(t).pipe((t=>(wn(n.state,e.stateArray,n.states,e.states),t)))}))},_n.all=function(t){const e=Dn((()=>({stateArray:Ct.stateConfig.stateArray,states:Ct.stateConfig.states}))),n=nr();return z.all(t).pipe((t=>(wn(n.state,e.stateArray,n.states,e.states),t)))};const Gn={create:t=>{const e=Dn(zn);if(e.stateDiff){let t=e.stateDiff;for(;t--;)Dn(void 0);return Dn(void 0)}const n=Dn((()=>{const n=Ct.stateConfig,r=n.stateArray.length,o=t.prototype?new t:t(),s=n.support,c=n.stateArray.length-r,a={constructMethod:t,instance:o,stateDiff:c,owner:s,children:[]};e.provider=a;const u=s.subject.global;return(u.providers=u.providers||[]).push(a),e.stateDiff=c,o})),r=t,o=r.compareTo=r.toString();return e.provider.constructMethod.compareTo=o,n},inject:function(t){return Dn((function(){const e=t,n=e.compareTo=e.compareTo||t.toString(),r=nr(),o=[];let s={ownerSupport:r.ownerSupport};for(;s.ownerSupport;){const t=s.ownerSupport.subject.global.providers;if(!t){s=s.ownerSupport;continue}const e=t.find((t=>{o.push(t);if(t.constructMethod.compareTo===n)return!0}));if(e){const t=r.subject.global;return(t.providers=t.providers||[]).push(e),e.children.push(r),e.instance}s=s.ownerSupport}const c=`Could not inject provider: ${t.name} ${t}`;throw console.warn(`${c}. Available providers`,o),new Error(c)}))}};function Zn(t){const e=nr();if(!e)throw Qn;return Xn(e,Ct.stateConfig,t)}function Xn(t,e,n){const r=e.states;return function(...e){return t.subject.renderCount>0?function(t,e,n,...r){const o=t.subject.global.newest,s=n(...r);return Se(o),h(s)&&s.finally((()=>{Se(o)})),s}(t,r,n,...e):n(...e)}}const qn=()=>{const t=nr();if(!t)throw Qn;const e=Ct.stateConfig;return function(n){return Xn(t,e,n)}},Qn=new Qt("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function Yn(t){Dn(t)}function Kn(t){Dn((function(){nr().subject.global.destroy$.toCallback(t)}))}function tr(t,e){return{tagJsType:a.subscribe,processInit:An,Observable:t,callback:e,states:pt(nr()).states}}function er(t,e,n){return{tagJsType:a.subscribe,processInit:On,Observable:t,callback:n,withDefault:e,states:pt(nr()).states}}function nr(){return Ct.stateConfig.support}function rr(t,e,r,o,s,c){e.checkValueChange=$t;const a=t;let u=a.templater;u||(u=function(t){const e=et();return e.tag=t,t.templater=e,e}(a));const i=n(e);return s?_t(u,e,r,o,s,c):(i.newest=nt(u,r,e),e.checkValueChange=$t,tt(r,e,o))}const or=":tagvar",sr=":";function cr(t,e){const n={values:e,ownerSupport:nr(),tagJsType:a.tag,processInit:rr,strings:t,key:t=>(n.arrayValue=t,n),html:function(t,e){return n.children={strings:t,values:e},n}};return n}function ar(t,e){const n={values:e,ownerSupport:nr(),dom:t,tagJsType:a.dom,processInit:rr,key:function(t){return n.arrayValue=t,n},html:{dom:function(t,e){return n.children={dom:t,values:e},n}}};return n}const ur=/(:tagvar\d+:)/,ir="ondoubleclick",lr=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,pr=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:*][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function fr(t){const e=[],n=[],r=[];let o=null,s=-1,c=0;const a=new RegExp(pr,"g");for(t=function(t){return t.replace(dr,(function(t){return t.replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]").replace(/</g,"[l t]").replace(/>/g,"[g t]")}))}(t);c<t.length;){const u=a.exec(t);if(!u)break;const[i,l,p]=u,f=i.startsWith("</"),d=i.endsWith("/>");if(c<u.index){const e=t.slice(c,u.index);if(e.trim()){const t=mr(e);for(let e of t)e.startsWith(or)&&(e=or+ ++s+sr),hr(o,n,e)}}if(c=u.index+i.length,f){o=r.pop()||null;continue}const g=[];let h;for(;null!==(h=lr.exec(p));){const t=h[1]||h[3]||h[5];let n=h[2]||h[4]||h[6];if(void 0===t)continue;const r=""!==h[2],o=void 0===n&&r,c=t.toLowerCase(),a=c.startsWith("on")?gr(c):c;if(o){if(t.slice(0,or.length)===or){const t=or+ ++s+sr;e.push(["at",t]),g.push([t]);continue}if(h[0].startsWith(t)&&h[0].slice(t.length,h[0].length).search(/\s+$/)>=0){g.push([a]);continue}n=or+ ++s+sr}r||(n=h[2]);const u=[a,n],i=Be(c);i&&u.push(i),g.push(u)}const b={nn:l};g.length&&(b.at=g),o?(o.ch||(o.ch=[]),o.ch.push(b)):n.push(b),d||(r.push(o),o=b)}if(c<t.length){const e=t.slice(c);if(e.trim()){const t=mr(e);for(const e of t)e.startsWith(or)&&++s,hr(o,n,e)}}return n}const dr=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function gr(t){if(t.startsWith("on")){return t.length===ir.length&&t===ir?"dblclick":t.slice(2,t.length)}return t}function hr(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:br(n)})}function br(t){return t.replace(/(\[l t\]!--[\s\S]*?--\[g t\])/g,(function(t){return t.replace(/\[l t\]/g,"<").replace(/\[g t\]/g,">").replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]")}))}function mr(t){return t.split(ur).filter(yr)}function yr(t){return""!==t}const vr=/(^:tagvar\d+:|:tagvar\d+:$)/g,wr="__safeTagVar";function kr(t,e){return function(t,e){const n=[];for(let r=0;r<t.length;++r){const o=t[r];r<e.length?n.push(o+or+r+sr):n.push(o)}return function(t,e,n){const r=n.length-e.length;if(r>0)for(let n=r;n>0;--n)t.push(or+(e.length+n-1)+sr)}(n,t,e),n}(t.map(Cr),e)}function Cr(t){return t.replace(vr,((t,e)=>wr+e))}const Sr=new RegExp(or+"(\\d+)"+sr,"g"),Tr="ch";function jr(t,e,n=[],r=[]){const o=t;for(let t=0;t<o.length;t++){const s=[...r,t],c=o[t];if(c.at){const t=c.at;c.at=xr(t,e)}if(c.ch){const t=c.ch,r=[...s,Tr];c.ch=jr(t,e,n,r)}t=Er(c,e,o,t)}return o}function Er(t,e,n,r){if("text"!==t.nn)return r;const o=t;let c,a=o.tc;if(typeof a!==s.string)return r;for(;null!==(c=Sr.exec(a));){const t=c[1],o=parseInt(t,10);if(!isNaN(o)&&o<e){const t=or+o+sr,e=a.slice(c.index+t.length);n.splice(r,1,{nn:"text",v:o}),a=e,Sr.lastIndex=0}}return o.tc=a,r}function xr(t,e){const n=[];for(const r of t){const[t,o,c]=r;if(t.startsWith(or)){const r=parseInt(t.replace(or,""),10);if(!isNaN(r)&&r<e){n.push([{tagJsVar:r}]);continue}}if(typeof o===s.string&&o.startsWith(or)){const r=parseInt(o.replace(or,""),10);if(!isNaN(r)&&r<e){n.push([t,{tagJsVar:r},c]);continue}}n.push(r)}return n}const Ar="__safeTagVar";const Or=/__safeTagVar(\d+)/g;function Pr(t){if(t.at&&(t.at=t.at?t.at.map((t=>{if(1===t.length)return t;const[,e]=t;if(typeof e===s.string&&e.startsWith(Ar)){const n=parseInt(e.replace(Ar,""),10);t[1]=or+n+sr}return t})):[]),t.ch){const e=t.ch;for(let t=0;t<e.length;t++){const n=e[t];if("text"===n.nn){if(typeof n.tc!==s.string)return;n.tc=n.tc.replace(Or,((t,e)=>or+e+sr))}Pr(n)}0===e.length&&delete t.ch}}function Vr(t){return t.length}const Jr={};function Ir(t,e){const n=function(t){const e=t.map(Vr);return e.push(t.length),Number(e.join(""))}(t),r=Jr[n],o=r&&function(t,e,n){if(n&&n.strings.length===t.length&&n.strings.every(((e,n)=>e===t[n]))&&n.values.length===e.length)return!0;return!1}(t,e,r);if(o)return r.domMetaMap;const s=function(t,e){return kr(t,e),fr(kr(t,e).join(""))}(t,e),c=jr(s,e.length);c.forEach(Pr);const a={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:c};return Jr[n]=a,c}function Wr(t,...e){const n=cr(t,e),r=Ft(se.NONE);return r.tag=n,n.templater=r,n}function Mr(t,e){t.domElement&&e.appendChild(t.domElement),t.marker&&e.appendChild(t.marker)}function Nr(t,e,n){const r=e.global,o=X(t,e);return q(t,o,o),o.appElement=n,r.oldest=r.oldest||o,r.newest=o,o}function Rr(t,e,n,r,o,s,c){const u=document.createTextNode("");zt.push(n.wrapper||{original:n});const i=function(t,e,n,r,o){r.placeholder=e;const s=r.global,c=s.oldest,u=s.newest===c,i=st(t,s.newest,s.newest.appSupport,r);u||bt(0,s.newest,Ct.stateConfig,c.state);if(t.tagJsType===a.stateRender)return function(t,e,n,r,o){const s=t.wrapper||{original:t};if(!e){const e=Nr(t,r,o);return te(e),e}return St(t,s,n),te(n),n}(t,o,i,r,n);const l=t.wrapper,p=l(i,r);return te(i),p}(n,u,o,s,c);if(e.isApp=!0,c&&(r.tag=i.templater.tag),!o)throw new Error(`Cannot tagElement, element received is type ${typeof o} and not type Element`);o.destroy=function(){const t=e.events;for(const e in t){const n=t[e];o.removeEventListener(e,n)}e.events={},++cn.locks;const n=R(i,e);return--cn.locks,an(),n},++cn.locks;const l=function(t,e,n,r,o,s){console.debug("🏷️ Building element into tag...",{element:e,app:o});const c=Y(t,{added:0,removed:0},e,void 0);n.oldest=t,n.newest=t;let u=r.setUse;if(r.tagJsType!==a.stateRender){const t=o.original;u=t.setUse,t.isApp=!0}e.setUse=u,e.ValueTypes=a,Dr.push({element:e,support:t});const i=document.createDocumentFragment();i.appendChild(s);for(const t of c.dom)Mr(t,i);return console.debug("🏷️ Element Tag DOM built ✅"),i}(i,o,e,n,t,u);return--cn.locks,an(),o.appendChild(l),{support:i,tags:zt,ValueTypes:a}}Wr.dom=function(t,...e){return ar(t,e)};const Dr=[];function Lr(t,e,r){const o=Dr.findIndex((t=>t.element===e));if(o>=0){const t=Dr[o].support;R(t,t.subject.global),Dr.splice(o,1),console.warn("Found and destroyed app element already rendered to element",{element:e})}let s=()=>l(r);s.propWatch=se.NONE,s.tagJsType=a.stateRender,s.props=[r],s.isApp=!0;const u=function(t,e){const r={value:t,checkValueChange:$t,delete:Ht,withinOwnerElement:!1,renderCount:0,global:void 0},o=n(r);return o.events={},Nr(t,r,e),r}(s,e),i=u.global;ht(i.newest,Ct.stateConfig);let l=t(r);const p=typeof l==c.function;return p||(d(l)?(i.newest.propsConfig={latest:[r],castProps:[r]},s.propWatch=l.propWatch,s.tagJsType=l.tagJsType,s.wrapper=l.wrapper,s=l):(s.tag=l,l=t)),Rr(t,i,s,l,e,u,p)}function Br(t){if(!t)return Qe;const e=nr();if(!e)throw new Error("output must be used in render sync fashion");return(...n)=>{const r=e.ownerSupport,o=r.subject.global.newest;hn(o.states,r.states);const s=t(...n);hn(r.states,o.states);return lt(o,o.ownerSupport.subject.global.newest),s}}const $r={tagElement:Lr,renderWithSupport:ve,renderSupport:Se,renderTagOnly:ee,paint:an};var Hr=e.W9,_r=e.cg,Ur=e.m0,Fr=e.rS,zr=e.Y2,Gr=e.ei,Zr=e.B7,Xr=e.TU,qr=e.XF,Qr=e.PC,Yr=e.Ot,Kr=e.Mj,to=e.tD,eo=e.j8,no=e.xe,ro=e.um,oo=e.E2,so=e.OH,co=e.TB,ao=e.Ii,uo=e.yV,io=e.zV,lo=e.pf,po=e.ze,fo=e.WJ,go=e.Ng,ho=e.VI,bo=e.aZ,mo=e.O,yo=e.Ie,vo=e.B4,wo=e.Az,ko=e.Xi,Co=e.Ah,So=e.ck,To=e.Gk,jo=e.zC,Eo=e.cF,xo=e.jU,Ao=e.PB,Oo=e.qy,Po=e.cy,Vo=e.Tn,Jo=e.Gv,Io=e.yL,Wo=e.D8,Mo=e.Ze,No=e._4,Ro=e.mn,Do=e.z,Lo=e.sA,Bo=e.MG,$o=e.PL,Ho=e.CG,_o=e.nI,Uo=e.PZ,Fo=e.r5,zo=e.uc,Go=e.pG,Zo=e.QB,Xo=e.Ll,qo=e.vP,Qo=e.wk,Yo=e.xP,Ko=e.bc,ts=e.B1,es=e.RX,ns=e.ag,rs=e.Tc,os=e.Hf,ss=e._A,cs=e.Ag,as=e.NU,us=e.hW,is=e.wB,ls=e.id,ps=e.MC,fs=e.SZ;export{Hr as ArrayNoKeyError,_r as BasicTypes,Ur as ImmutableTypes,Fr as PropWatches,zr as RouteQuery,Gr as StateMismatchError,Zr as Subject,Xr as Subjective,qr as SyncCallbackError,Qr as TagError,Yr as ValueSubject,Kr as ValueSubjective,to as ValueTypes,eo as addOneContext,no as appElements,ro as buildBeforeElement,oo as callback,so as callbackMaker,co as checkArrayValueChange,ao as checkSimpleValueChange,uo as checkTagValueChange,io as combineLatest,lo as createHtmlSupport,po as createTrigger,fo as defineValueOn,go as deleteSimpleValue,ho as destorySupportByContextItem,bo as destroyArray,mo as destroySupport,yo as empty,vo as getBaseSupport,wo as getDomMeta,ko as getDomTag,Co as getNewGlobal,So as getStringTag,To as getTemplaterResult,jo as hasPropChanges,Eo as hmr,xo as howToSetFirstInputValue,Ao as howToSetInputValue,Oo as html,Po as isArray,Vo as isFunction,Jo as isObject,Io as isPromise,Wo as isSimpleType,Mo as isStaticTag,No as isSubjectInstance,Ro as isTagComponent,Do as letProp,Lo as onDestroy,Bo as onInit,$o as oneRenderToSupport,Ho as output,_o as paint,Uo as processFirstSubjectValue,Fo as providers,zo as renderSupport,Go as renderTagOnly,Zo as renderWithSupport,Xo as setUseMemory,qo as signal,Qo as state,Yo as states,Ko as subject,ts as subscribe,es as subscribeWith,ns as syncError,rs as tag,os as tagElement,ss as tags,cs as upgradeBaseToSupport,as as variablePrefix,us as variableSuffix,is as watch,ls as willCallback,ps as willPromise,fs as willSubscribe};
|
|
2
2
|
//# sourceMappingURL=bundle.js.map
|