taggedjs 2.8.8 → 2.8.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/bundle.js +1 -1
  2. package/bundle.js.map +1 -1
  3. package/js/index.d.ts +2 -2
  4. package/js/index.js +1 -1
  5. package/js/index.js.map +1 -1
  6. package/js/interpolations/attributes/bindSubjectCallback.function.js +5 -3
  7. package/js/interpolations/attributes/bindSubjectCallback.function.js.map +1 -1
  8. package/js/interpolations/attributes/renderTagArray.function.js +0 -1
  9. package/js/interpolations/attributes/renderTagArray.function.js.map +1 -1
  10. package/js/interpolations/index.d.ts +1 -1
  11. package/js/interpolations/optimizers/attachDomElements.function.js +2 -2
  12. package/js/interpolations/optimizers/attachDomElements.function.js.map +1 -1
  13. package/js/isInstance.d.ts +1 -1
  14. package/js/state/letProp.function.d.ts +1 -1
  15. package/js/state/letProp.function.js.map +1 -1
  16. package/js/state/providers.d.ts +1 -1
  17. package/js/state/subject.function.d.ts +6 -6
  18. package/js/subject/signal.function.d.ts +2 -2
  19. package/js/tag/buildBeforeElement.function.js +4 -3
  20. package/js/tag/buildBeforeElement.function.js.map +1 -1
  21. package/js/tag/checkDestroyPrevious.function.js +1 -1
  22. package/js/tag/checkDestroyPrevious.function.js.map +1 -1
  23. package/js/tag/getDomTag.function.d.ts +11 -2
  24. package/js/tag/getDomTag.function.js +1 -0
  25. package/js/tag/getDomTag.function.js.map +1 -1
  26. package/js/tag/getTemplaterResult.function.d.ts +5 -2
  27. package/js/tag/getTemplaterResult.function.js.map +1 -1
  28. package/js/tag/html.d.ts +3 -1
  29. package/js/tag/html.js.map +1 -1
  30. package/js/tag/index.d.ts +3 -2
  31. package/js/tag/index.js.map +1 -1
  32. package/js/tag/key.d.ts +4 -2
  33. package/js/tag/key.js +4 -1
  34. package/js/tag/key.js.map +1 -1
  35. package/js/tag/paint.function.d.ts +1 -1
  36. package/js/tag/paint.function.js +6 -7
  37. package/js/tag/paint.function.js.map +1 -1
  38. package/js/tag/render/renderSupport.function.js +3 -2
  39. package/js/tag/render/renderSupport.function.js.map +1 -1
  40. package/js/tag/smartRemoveKids.function.js +20 -12
  41. package/js/tag/smartRemoveKids.function.js.map +1 -1
  42. package/js/tag/tag.d.ts +0 -1
  43. package/js/tag/tag.js +3 -2
  44. package/js/tag/tag.js.map +1 -1
  45. package/js/tag/tagElement.js +14 -8
  46. package/js/tag/tagElement.js.map +1 -1
  47. package/js/tag/update/compareArrayItems.function.d.ts +5 -0
  48. package/js/tag/update/compareArrayItems.function.js +50 -0
  49. package/js/tag/update/compareArrayItems.function.js.map +1 -0
  50. package/js/tag/update/oneRenderToSupport.function.js +1 -1
  51. package/js/tag/update/oneRenderToSupport.function.js.map +1 -1
  52. package/js/tag/update/processFirstSubjectValue.function.js +0 -3
  53. package/js/tag/update/processFirstSubjectValue.function.js.map +1 -1
  54. package/js/tag/update/processNewSubjectTag.function.js +0 -6
  55. package/js/tag/update/processNewSubjectTag.function.js.map +1 -1
  56. package/js/tag/update/processTagArray.d.ts +0 -1
  57. package/js/tag/update/processTagArray.js +4 -70
  58. package/js/tag/update/processTagArray.js.map +1 -1
  59. package/js/tag/update/updateExistingTagComponent.function.js +8 -7
  60. package/js/tag/update/updateExistingTagComponent.function.js.map +1 -1
  61. package/package.json +1 -1
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=0,t.global={}}t.d(e,{W9:()=>X,cg:()=>c,m0:()=>s,rS:()=>yt,Y2:()=>r,ei:()=>q,B7:()=>C,TU:()=>j,XF:()=>Q,PC:()=>Z,Ot:()=>k,Mj:()=>T,tD:()=>a,j8:()=>Te,um:()=>ke,E2:()=>dn,OH:()=>hn,TB:()=>Be,Ii:()=>Ue,yV:()=>zt,zV:()=>y,ze:()=>gn,WJ:()=>S,aZ:()=>He,O:()=>Ut,Ie:()=>o,B4:()=>pt,Az:()=>zn,Xi:()=>Sn,pc:()=>dt,Ah:()=>n,ck:()=>jn,k6:()=>gt,Gk:()=>nt,cF:()=>Kn,jU:()=>Zt,PB:()=>Gt,qy:()=>Gn,cy:()=>m,Tn:()=>h,Gv:()=>b,yL:()=>g,D8:()=>l,Ze:()=>p,_4:()=>d,mn:()=>f,Eb:()=>bt,z:()=>z,sA:()=>yn,MG:()=>mn,PL:()=>Fe,nI:()=>It,PZ:()=>Qe,N_:()=>Ye,r5:()=>G,uc:()=>ln,pG:()=>Xe,QB:()=>sn,R6:()=>Qn,Ll:()=>D,vP:()=>u,wk:()=>O,xP:()=>F,bc:()=>U,ag:()=>bn,Tc:()=>vt,Hf:()=>Xn,_A:()=>rt,Ag:()=>ft,NU:()=>wn,hW:()=>Cn,wB:()=>$,id:()=>E,MC:()=>A,zC:()=>x});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",subject:"subject",tagJsSubject:"tagJsSubject",renderOnce:"renderOnce",stateRender:"stateRender",version:Date.now()};function u(t){return vn()?O((()=>i(t))):i(t)}function i(t){let e=t;const n=new Set;return{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}}}function l(t){switch(t){case s.string:case s.number:case s.boolean:return!0}return!1}function p(t){if(!t)return!1;switch(t.tagJsType){case a.dom:case a.tag:case a.templater:return!0}return!1}function f(t){const e=t?.tagJsType;return e===a.tagComponent||e===a.stateRender}function d(t){return b(t)&&typeof t.subscribe===c.function}function g(t){return t&&h(t.then)}function h(t){return typeof t===c.function}function b(t){return typeof t===c.object&&null!==t}function m(t){return Array.isArray(t)}function y(t){const e=new C;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 v(t,e,n){const r=C.globalSubCount$;C.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=C.globalSubCount$;C.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 C{value;onSubscription;methods=[];isSubject=!0;subscribers=[];subscribeWith;constructor(t,e){this.value=t,this.onSubscription=e}subscribe(t){const e=v(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 C(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 y(t.map((t=>{if(d(t))return t;return new C(t,(e=>(e.next(t),e)))})))}static globalSubCount$=new C(0)}class j extends C{value;onSubscription;_value;constructor(t,e){super(t,e),this.value=t,this.onSubscription=e,this._value=t,S(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 S(t){Object.defineProperty(t,"value",{set(e){t._value=e,t.emit()},get:()=>t._value})}class k extends C{value;constructor(t){super(t),this.value=t}subscribe(t){const e=super.subscribe(t);return t(this.value,e),e}}class T extends C{value;constructor(t){super(t),this.value=t,this._value=t,S(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function E(t){return(e,n)=>{n.setHandler((()=>{})),t(e,n.next)}}function A(t){return(e,n)=>{n.setHandler((()=>{}));t(e).then((t=>n.next(t)))}}const x=t=>(e,n)=>{n.setHandler((()=>{}));const r=t(e).subscribe((t=>{r.unsubscribe(),n.next(t)}))};function O(t){return D.stateConfig.handlers.handler(t)}function P(t){const e=D.stateConfig;e.states[e.statesIndex]=t;return e.support.states[e.statesIndex]=t,++e.statesIndex,t(((...t)=>(O(t),t)))}function V(t){const e=D.stateConfig,n=e.support,r=e.statesIndex,o=e.prevSupport,s=o?.states[r],c=[];s(((...t)=>(c.push(t),t)));let a=0;return n.states[e.statesIndex]=t,++e.statesIndex,t(((...t)=>{e.stateArray.push({get:()=>t,defaultValue:t});const n=c[a];return++a,n}))}function J(t,e){e.handlers.handler=M,e.handlers.statesHandler=P,e.rearray=[],e.stateArray=[],e.states=[],e.statesIndex=0,e.support=t}function W(t,e,n,r){e.rearray=n,e.stateArray=[],e.states=r,e.statesIndex=0,e.handlers.handler=R,e.handlers.statesHandler=V,e.support=t}class N{}function I(t){const e=t.callback;if(!e)return t.defaultValue;const[n]=function(t){const e=t(N),[n]=e,[r]=t(n);return[n,r]}(e);return n}function R(){const t=D.stateConfig,e=t.rearray[t.stateArray.length];return t.stateArray.push(e),e.defaultValue}function M(t){const e=D.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 I(r)},defaultValue:n};return e.stateArray.push(r),n}const D={stateConfig:{stateArray:[],version:Date.now(),handlers:{handler:M,statesHandler:P}}};function L(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);r[t](o);let s=0;const c=t=>e[s++];n[t](c)}}const $=(t,e)=>B(t,e),_=t=>t;const B=(t,e,{init:n,before:r,final:o=_}={})=>{const s=O({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 H(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=O((()=>vn())),r=O((()=>new k(void 0))),o=O((()=>({stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}))),s=(t,s)=>(B(t,((t,e)=>{const c=vn(),a=s(t,e);if(c!==n){const t=o.stateArray,e=n.subject.global.oldest;L(t,e.state,o.states,e.states)}r.next(a)}),e.setup),r);return s.setup=e.setup,H((()=>s),s),s}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function U(t){return vn()?O((()=>new C(t))):new C(t)}function F(t){return D.stateConfig.handlers.statesHandler(t)}function z(t){const e=u([]),n=u(0),r=u(0);let o=[],s=0;return r.value=n.value,t(((...t)=>(o=t,t))),$(o,(()=>{++s,e.value=o,t((()=>o))})),F((()=>{if(s)return t(((...t)=>(e.value=t,n!=r?e.value:t))),r.value=n.value,void++n.value;t((()=>e.value))})),++s,e.value}H((()=>function(t){const e=(e,n)=>B(e,n,t);return e.setup=t,H((()=>e),e),e}({})),$),U._value=t=>{const e=O((function(){return{stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}})),n=vn();return O((function(){return new k(t).pipe((t=>(L(n.state,e.stateArray,n.states,e.states),t)))}))},U.all=function(t){const e=O((()=>({stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}))),n=vn();return C.all(t).pipe((t=>(L(n.state,e.stateArray,n.states,e.states),t)))};const G={create:t=>{const e=O((()=>({stateDiff:0,provider:void 0})));if(e.stateDiff){let t=e.stateDiff;for(;t--;)O(void 0);return O(void 0)}const n=O((()=>{const n=D.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=>O((()=>{const e=t,n=e.compareTo=e.compareTo||t.toString(),r=vn(),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)}))};class Z extends Error{details;constructor(t,e,n={}){super(t),this.name=Z.name,this.details={...n,errorCode:e}}}class X extends Z{constructor(t,e){super(t,"array-no-key-error",e),this.name=X.name}}class q extends Z{constructor(t,e){super(t,"state-mismatch-error",e),this.name=q.name}}class Q extends Z{constructor(t,e){super(t,"sync-callback-error",e),this.name=Q.name}}function Y(t,e){return K(t,e)}function K(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=m(t)?[]:Object.create(Object.getPrototypeOf(t));if(m(t))for(let r=0;r<t.length;r++)n[r]=K(t[r],e-1);else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=K(t[r],e-1));return n}function tt(t,e,n){return et(t,e,n)}function et(t,e,n){return!(t!==e&&(r=t,o=e,!h(r)||!h(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():m(t)&&m(e)?function(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!et(t[r],e[r],n-1))return!1;return!0}(t,e,n-1):!m(t)&&!m(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)||!et(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var r,o}function nt(t,e){const n={propWatch:t,props:e,tagJsType:a.templater,key:function(t){return n.arrayValue=t,n}};return n}const rt=[];function ot(t,e,n){return t.map((t=>function(t,e,n,r){if(p(t)||!t)return t;if(!e)return t;return st(t,e,n,r)}(t,e.ownerSupport,e,n)))}function st(t,e,n,r){if(!t)return t;if(t.tagJsType)return t;if(typeof t===c.function)return function(t,e){const n=t.mem;if(n)return t;const r=function(...t){return r.toCall(...t)};return r.original=t,r.mem=t,r.toCall=function(...t){return function(t,e,n){const r=n.subject.global,o=r?.newest||n,s=void 0===vn(),c=t(...e),a=function(){const t=o.subject.global;if(!1===s){if(!0===t.locked)return c}return function(t,e){const n=t.subject,r=un(t.templater);if(r){return pn(e,t)}const o=n.global;o.locked=!0,an(o.newest,t,e,n),delete o.locked}(o,n),c};if(s)return a();return D.tagClosed$.toCallback(a),c}(r.mem,t,e)},Object.assign(r,t),r}(t,e);if(r===Tt)return t;return at(t)?t:m(t)?function(t,e,n,r){for(let o=t.length-1;o>=0;--o){const s=t[o];if(t[o]=st(s,n,e,r+1),typeof s===c.function){if(s.mem)continue;ct(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=st(o,n,e,r+1);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;ct(r+1,s,o,t,e)}}return t}(t,n,e,r)}function ct(t,e,n,r,o){if(t>0){const t=o.subject.global;r[e].subscription=t.destroy$.toCallback((function(){r[e]=n}))}}function at(t){return typeof t!==c.object||!t||t.tagJsType}function ut(t,e,n,r){const o=e.original;let s;t.tagJsType===a.stateRender?s=t():(s=o(...r),typeof s===c.function&&(s=s())),s.templater=t,t.tag=s;const u=D.stateConfig;return n.state=u.stateArray,n.states=u.states,n}function it(t){return t.map(lt)}function lt(t,e){const n=t,r=t?.tagJsType;if(r)switch(r){case a.stateRender:return;case a.dom:case a.tag:case a.templater:return it(n.values)}return m(t)?it(n):Y(t,e)}function pt(t,e,n){const r={templater:t,subject:e,castedProps:n,appSupport:void 0},o=e.global;return o.blocked=[],o.destroy$=new C,r}function ft(t,e,n,r){e.state=[],e.states=[],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 yt.IMMUTABLE:return t.propsConfig={latest:e,castProps:n};case yt.SHALLOW:return t.propsConfig={latest:e.map((t=>lt(t,kt))),castProps:n}}return t.propsConfig={latest:e.map((t=>lt(t,Tt))),castProps:n}}}(e,o,r)),e}function dt(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 gt(t,e,n,r,o){const s=pt(t,r,o);return s.ownerSupport=e,ft(t,s,n,o)}function ht(t,e,n){const r=t.propWatch===yt.DEEP?Tt:kt,o=t.props,s=e.propsConfig;let c=s.castProps;const a=n?.propsConfig,u=a?.castProps;u&&(s.castProps=u,c=en(e,n,n.ownerSupport,o,r));return c||ot(o,e,0)}function bt(t){return{set html(e){e.arrayValue=t}}}let mt=0;var yt;function vt(t,e=yt.SHALLOW){const n=function(...r){const o=nt(e,r);o.tagJsType=a.tagComponent;const s=function(t,e){return function(n,r,o){const s=ht(t,n,o),c=n.ownerSupport,a=gt(t,c,n.appSupport,r,s);return ut(t,e,a,s)}}(o,n);return s.original=t,o.wrapper=s,o},r=t;return n.original=t,r.tags=rt,r.setUse=D,r.ValueTypes=a,r.tagIndex=mt++,rt.push(n),n}function wt(){throw new Error("Do not call tag.use as a function but instead set it as: `(props) => tag.use = (use) => html`` `")}function Ct(t,e){const n=function(t,e,n){const r=fn(t,e);if(r)return 11;switch(n){case yt.NONE:return 1;case yt.SHALLOW:return St(t,e);case yt.IMMUTABLE:return jt(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])=>Et(r,n[t],(()=>{delete e[t],delete n[t]}))));return r}return Et(t,o,(()=>{n.splice(e,1),r.splice(e,1)}))}(t,e,n,r))))return 7;return!1}(t,e)}(e.props,t.propsConfig.latest,t.templater.propWatch);return n}function jt(t,e){const n=t.length;for(let r=0;r<n;++r){if(t[r]!==e[r])return 2}return!1}function St(t,e){const n=t.length;for(let r=0;r<n;++r){const n=t[r],o=e[r];if(m(n)&&m(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(!At(e,o))return 3.1}}}return!1}!function(t){t.DEEP="deep",t.SHALLOW="shallow",t.NONE="none",t.IMMUTABLE="immutable"}(yt||(yt={})),vt.renderOnce=function(){throw new Error("Do not call tag.renderOnce as a function but instead set it as: `(props) => tag.renderOnce = () => html`` `")},vt.state=wt,vt.use=wt,vt.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`` `")},vt.key=bt,vt.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`` `")},vt.deepPropWatch=vt,vt.immutableProps=function(t){return vt(t,yt.IMMUTABLE)},vt.watchProps=function(t){return vt(t,yt.SHALLOW)},Object.defineProperty(vt,"renderOnce",{set(t){t.tagJsType=a.renderOnce}}),Object.defineProperty(vt,"state",{set(t){t.original={setUse:D,tags:rt},t.tagJsType=a.stateRender}}),Object.defineProperty(vt,"use",{set(t){t.original={setUse:D,tags:rt},t.tagJsType=a.stateRender}});const kt=3,Tt=10;function Et(t,e,n){if(typeof t!==c.function)return!!tt(t,e,Tt)&&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 At([t,e],n){const r=n[t];return typeof e===c.function&&typeof r===c.function||r===e}let xt=[],Ot=[],Pt=[],Vt=[],Jt=[],Wt=[];const Nt={locks:0};function It(){if(!(Nt.locks>0)){++Nt.locks;for(const t of xt){t.parentNode.removeChild(t)}for(const t of Ot)t();for(const[t,e]of Pt)e.textContent=t;for(const t of Vt)t.relative.appendChild(t.element);for(const{element:t,relative:e}of Jt)e.parentNode.insertBefore(t,e);for(const t of Wt)t();xt=[],Ot=[],Vt=[],Jt=[],Wt=[],Pt=[],--Nt.locks}}function Rt(t,e){const n=document.createTextNode(t);return Jt.push({element:n,relative:e}),n}function Mt(t){switch(t){case void 0:case!1:case null:return o}return t}function Dt(t){const e=t.subject.global,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 Lt(t){for(const e of t){const t=e.lastArray;if(t){Lt(t);continue}const n=e.global;if(!n)continue;const r=n.newest,o=n.subscriptions;o&&o.forEach((t=>t.unsubscribe())),f(r.templater)&&Dt(r);Lt(n.context)}}function $t(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&&$t(s,e,n)}return{tags:e,subs:n}}function _t(t,e){const n=t.subject.global,r=n.htmlDomMeta,o=n.context;n.deleted=!0;const s=n.destroys;if(s)return function(t,e,n,r){const o=[];if(t.forEach((t=>{const e=t();e instanceof Promise&&o.push(e)})),o.length){const t=Promise.all(o).then((()=>{Bt(e,n),Ht(r),It()}));return void n.push(t)}Bt(e,n),Ht(r),It()}(s,o,e,r);Bt(o,e),Ht(r)}function Bt(t,e){for(const n of t){if(n.withinOwnerElement)continue;const t=n.lastArray;if(t){He(n,t);continue}const r=n.simpleValueElm;if(r){delete n.simpleValueElm,xt.push(r);continue}const o=n.global;if(void 0===o)continue;if(!0===o.deleted)continue;o.deleted=!0;const s=o.oldest;s&&_t(s,e)}}function Ht(t){t.forEach((t=>{const e=t.marker;e&&xt.push(e);const n=t.domElement;n&&xt.push(n)}))}function Ut(t){const e=t.subject.global;e.deleted=!0,t.subject.renderCount=0;const n=[];return Lt(e.context),e.destroy$&&Dt(t),_t(t,n),n}function Ft(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 zt(t,e){const r=e.global,o=r?.newest;if(p(t)){return!Ft(t,o)&&(Ut(o),n(e),7)}const s=t?.tagJsType;if(s){return!0===Ie(e,t,r.newest.ownerSupport)&&-1}return Ut(o),delete e.global,e.renderCount=0,8}function Gt(t,e,n){Ot.push((()=>{Zt(t,e,n)}))}function Zt(t,e,n){void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}function Xt(t,e,n,r,o,s){switch(r){case"init":{const t=s.added;return void Wt.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 Wt.push((()=>n.focus()));case"autoselect":return void Wt.push((()=>n.select()));case"style":{const r=t.split(".");return void Ot.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)Ot.push((()=>n.classList.add(t)));return}for(const t of r)Ot.push((()=>n.classList.remove(t)))}(t,e,n)}throw new Error(`Invalid special attribute of ${r}. ${t}`)}function qt(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 Qt(t,e=[]){const n=t.subject.global,r=un(t.templater),o=t.ownerSupport;if(n.locked)return e.push(t),e;if(r)return Qt(o,e);const s=t,c=f(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(fn(n,o))return!0;switch(t.propWatch){case yt.IMMUTABLE:return jt(n,o);case yt.SHALLOW:return St(n,o)}return!tt(n,o,Tt)}(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=qt(t.owner,t);n.push(...e.map((t=>t.support)))}return n}(s);return e.push(...l),i?(Qt(o,e),c&&e.push(s),e):(e.push(s),e)}function Yt(t){++Nt.locks,t.forEach(Kt),--Nt.locks,It()}function Kt(t){const e=t.subject.global;e&&ln(e.newest)}D.tagClosed$=new C(void 0,(function(t){vn()||t.next()}));const te="no-data-ever",ee="promise-no-data-ever";function ne(t,e){const n=e.subject.global,r=function(t,e){if(!0!==n.deleted)return function(t,e,n,r){let o=e;for(;o.ownerSupport&&!f(o.templater);)o=o.ownerSupport;const s=o.subject.global;s.locked=!0;const c=t.apply(n,r);return function(t,e){const n=e.subject.global;return delete n.locked,function(t,e,n){return Yt(Qt(t)),function(t,e,n){if(g(t)){return e.subject.global.locked=!0,t.then((()=>{if(!0===n.deleted)return ee;delete e.subject.global.locked;return Yt(Qt(e)),ee}))}return te}(e,t,n)}(e,t,n)}(c,o)}(r.tagFunction,r.support,t,e)};return r.tagFunction=t,r.support=e,r}const re=["init","destroy"];function oe(t,e,n,r,o,s,c){if(c)return Xt(t,e,n,c,s,o);r(n,t,e)}function se(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,ce(t,s,t.target)};c[e]=t,o.addEventListener(e,t)}n[s]=r,n[e]=r}function ce(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&&ce(t,e,o)}function ae(t,e,n,r){const o=function(...e){return o.tagFunction(t,e)};o.tagFunction=e,o.support=n,se(n.appSupport,r,t,o)}function ue(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 ie={added:0,removed:0};function le(t,e,n,r){if(n.isNameOnly)return function(t,e,n,r,o,s,a,u){if(n){if(me(e))return void r.removeAttribute(n);if(typeof n===c.object)if(typeof e===c.object)for(const t in n)t in e||Ot.push((function(){r.removeAttribute(t)}));else for(const t in n)Ot.push((function(){r.removeAttribute(t)}))}fe(t,e,r,o,s,a,u)}(t,e,n.value,n.element,r,n.howToSet,[],ie),void(n.value=e);const o=n.element;de(e,n.attrName,n,o,r,n.howToSet,n.isSpecial,ie),n.value=e}function pe(t,e,n,r,o,s,a,u,i){const l=be(e);if(l>=0){const e=t[l],c=Te(e,s,!0);return c.isAttr=!0,c.element=n,c.howToSet=o,c.isNameOnly=!0,c.handler=(t,e)=>le(e,t,c,r),void fe(t,e,n,r,o,s,u)}const p=be(i);if(p>=0){const i=t[p],l={isAttr:!0,element:n,attrName:e,checkValueChange:Ue,withinOwnerElement:!0};s.push(l);return d(l.value)?function(t,e,n,r,o,s,c){s&&Ot.push((function(){n.removeAttribute(t)}));const a=e.value;if(d(a)){e.handler=ye;const u=function(a){de(a,t,e,n,r,o,s,c)},i=a.subscribe(u),l=e.global;(l.subscriptions=l.subscriptions||[]).push(i)}return void de(e.value,t,e,n,r,o,s,c)}(e,l,n,r,o,a,u):(l.handler=(t,e)=>le(e,t,l,r),function(t,e,n,r,o,s,a,u){n.attrName=t,n.element=r,n.howToSet=o,typeof e===c.function?u&&re.includes(t)?Xt(t,e,r,t,s,a):he(n,e,s,t,r):(n.attrName=t,n.element=r,n.howToSet=o,n.isSpecial=u,oe(t,e,r,o,a,s,u))}(e,i,l,n,o,r,u,a),void(l.value=i))}return oe(e,i,n,o,u,r,a)}function fe(t,e,n,r,s,a,u){if(!me(e))if(typeof e!==c.object)0!==e.length&&s(n,e,o);else for(const o in e){const c=e[o];pe(t,o,n,r,s,a,ue(o),u,c)}}function de(t,e,n,r,o,s,c,u){return h(t)?function(t,e,n,r,o,s,c,u){const i=t.templater.wrapper;if((i?.tagJsType||i?.original?.tagJsType)!==a.renderOnce)return he(c,e,t,r,n);return ge(e,n,r,o,s,t,u)}(o,t,r,e,c,s,n,u):ge(t,r,e,c,s,o,u)}function ge(t,e,n,r,o,s,c){if(!1===r){switch(t){case void 0:case!1:case null:return void Ot.push((function(){e.removeAttribute(n)}))}if(h(t))return ae(e,t,s,n);o(e,n,t)}else Xt(n,t,e,r,s,c)}function he(t,e,n,r,o){const s=t.value;return s&&s.tagFunction&&s.support?(s.tagFunction=e,s.support=n,s):ae(o,e=ne(e,n),n,r)}function be(t){return b(t)&&"tagJsVar"in t?t.tagJsVar:-1}function me(t){return null==t||!1===t}const ye=()=>{},ve="object"==typeof document&&document.createElement("div");function we(t,e,n,r,s,c,a,u,i=[]){const l=[];a&&void 0===u&&(u=document.createTextNode(o),Vt.push({element:u,relative:a}),a=void 0);for(let o=0;o<t.length;++o){const p=t[o],f={};l.push(f);const d=p.v;if(!isNaN(d)){const t=s.length;Se(e[t],t,s,n,i,r,c,a,u);continue}if("text"===p.nn){je(f,p,a,u);continue}const g=Ce(f,p,e,n,s,r,a,u);p.ch&&(f.ch=we(p.ch,e,n,r,s,c+1,g,u,i).dom)}return{subs:i,dom:l,context:s}}function Ce(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;pe(n,e,u,r,Zt,o,a,s,c)})),c?Vt.push({element:u,relative:c}):Jt.push({element:u,relative:a}),u}function je(t,e,n,r){const o=t,s=o.tc=e.tc;ve.innerHTML=s;const c=o.domElement=document.createTextNode(ve.innerText);n?Vt.push({element:c,relative:n}):Jt.push({element:c,relative:r})}function Se(t,e,n,r,s,c,a,u,i){const l=document.createTextNode(o),p=Te(t,n,a>0);if(p.placeholder=l,u?Vt.push({relative:u,element:l}):Jt.push({relative:i,element:l}),d(t))return s.push({insertBefore:l,appendTo:u,subject:t,support:r,counts:c,contextItem:p}),void(p.handler=ye);p.handler=(t,e,n,r)=>Je(r,t,n);r.subject.global.locked=!0,Qe(t,p,r,c,u,i);delete r.subject.global.locked,p.value=t}function ke(t,e,n,r){const o=t.subject.global;o.oldest=t,o.newest=t,++Nt.locks;const s=function(t,e,n,r){const o=function(t){const e=t.templater,n=e.tag;if(n.tagJsType===a.dom)return n.dom;return zn(n.strings,n.values)}(t),s=t.templater.tag,c=s.values,u=[],i=t.subject.global;i.context=u;const l=we(o,c,t,e,u,0,n,r);return l}(t,e,n,r);return o.htmlDomMeta=s.dom,--Nt.locks,s}function Te(t,e,n){const r={value:t,checkValueChange:Ue,withinOwnerElement:n};return e.push(r),r}function Ee(t,e,n){const r=e.global.newest;r.ownerSupport=t,e.checkValueChange=zt;const o=ke(r,n,void 0,e.placeholder);for(const t of o.subs)Ke(t);return r}function Ae(){return{tagJsType:a.templater}}function xe(t,e,n){const r=dt(t,e,e.appSupport,n);return n.global.context=[],r}function Oe(t,e,n,r){const o=t[e],s=n[e];if(o===s.value)return;(0,s.handler)(o,t,r,s),s.value=o}function Pe(t,e){const n=t.subject.global.context;!function(t,e){const n=e.templater.tag||e.templater,r=e.templater.values||n.values,o=t.templater.tag;o.values=r}(t,e),++Nt.locks,function(t,e){const n=t.templater.tag.values;let r=0;const o=n.length;for(;r<o;)Oe(n,r,e,t),++r}(t,n),--Nt.locks,It()}const Ve={added:0,removed:0};function Je(t,e,n){if(e===t.value)return;const r=t.checkValueChange(e,t);if(-1===r)return;const o=e&&e.tagJsType;if(o){if(o===a.renderOnce)return;Ie(t,e,n)}else m(e)?Me(t,e,n,{added:0,removed:0}):typeof e!==c.function?r&&function(t,e){e.checkValueChange=Ue;const n=e.placeholder,r=Mt(t);e.simpleValueElm=Rt(r,n)}(e,t):t.value=e}function We(t,e,r){if(!e.global.newest)return void tn(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||Ft(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;Ut(s),n(t);const c=tn(e,t,r,{added:0,removed:0})}(r,f,t);const d=p||Ct(s,f);if(!d){return void function(t,e,n,r,o){const s=t.props,c=en(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===yt.DEEP?Tt:kt)}if(o.locked)return void o.blocked.push(e);ln(e)}(r,gt(t,r,r.appSupport,e),e)}function Ne(t,e,n,r){typeof n!==c.function&&function(t,e,n,r){const o=gt(n.templater||n,r,r.appSupport,e);Pe(t.subject.global.oldest,o)}(t,e,n,r)}function Ie(t,e,r){const o=e.tagJsType;if(f(e))return void 0===t.global&&n(t),We(e,t,r),!0;const s=t.global;if(s){const n=s.newest;if(n)return Ne(n,t,e,r),!0}switch(o){case a.templater:return Ee(r,t,Ve),!0;case a.tag:case a.dom:return function(t,e,r){const o=t;let s=o.templater;s||(s=Ae(),o.templater=s,s.tag=o),(e.global?e.global:n(e)).newest=xe(s,r,e),Ee(r,e,Ve)}(e,t,r),!0}return!1}function Re(t,e,r){r.checkValueChange=zt;const o=t;let s=o.templater;s||(s=nt(yt.DEEP),s.tag=o,o.templater=s);const c=r.global=n(r),a=c.newest=gt(s,e,e.appSupport,r);return c.oldest=a,r}function Me(t,e,n,r,o){t.lastArray||(t.lastArray=[]);const s=t.lastArray;let c=t.placeholder,a=0;const u=[];for(let t=0;t<s.length;++t){const n=s[t],o=_e(n,e,t,s,a,r);0!==o?(a+=o,2===o&&(t-=1)):u.push(n)}t.lastArray=u;const i=o,l=e.length;for(let t=0;t<l;++t){c=De(e,t,u,n,c,r,i).placeholder}}function De(t,e,n,r,o,s,c){const a=t[e],u=n[e];return u?function(t,e,n,r,o,s,c,a){const u=n.length>o;if(u)return Je(e,t,r),e;const i=Le(t,s,r,c,n,a);return i}(a,u,n,r,e,o,s,c):Le(a,o,r,s,n,c)}function Le(t,e,n,r,o,s){const c={value:t,checkValueChange:Ue,withinOwnerElement:!1};r.added=r.added+1;const u=document.createTextNode("");return c.placeholder=u,s||Jt.push({element:u,relative:e}),function(t,e,n){const r=t.tagJsType;if(r)switch(r){case a.templater:Re(t.tag,e,n);break;case a.tag:case a.dom:Re(t,e,n)}}(t,n,c),Qe(t,c,n,r,s),c.value=t,o.push(c),s&&Vt.push({element:u,relative:s}),c}function $e(t,e){const n=t.global;if(n){const t=n.oldest;n.deleted=!0,Ut(t),n.deleted=!0}else{const e=t.simpleValueElm;delete t.simpleValueElm,xt.push(e)}++e.removed}function _e(t,e,n,r,o,s){const c=e.length-1,a=n-o,u=a<0||c<a,i=r[n];return u?($e(i,s),++o,1):r[n].value.arrayValue!==e[n].arrayValue?($e(i,s),r.splice(n,1),++o,2):0}function Be(t,e){if(!m(t)){return He(e,e.lastArray),9}return!1}function He(t,e){const n={added:0,removed:0};for(let t=0;t<e.length;++t)$e(e[t],n);delete t.lastArray}function Ue(t,e){if(null==t||typeof t!==c.object)return function(t,e){const n=Mt(t),r=e.simpleValueElm;Pt.push([n,r])}(t,e),-1;const n=e.simpleValueElm;return delete e.simpleValueElm,xt.push(n),6}function Fe(t,e,n){const r=nt(yt.DEEP);r.tagJsType=t.tagJsType;const o=xe(r,n,e);function s(){return r.tag=t(),o}return r.wrapper=s,s.tagJsType=t.tagJsType,s.original=t.original||t,o}function ze(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 q(r,c);throw console.error(Ge,c),a}(n,e,t)}const Ge="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 Ze(t,e){const n=t.subject;++n.renderCount;const r=D.stateConfig;delete r.support,t.state=r.stateArray,D.tagClosed$.next(e),ze(r,t),n.global.newest=t}function Xe(t,e,n,r){const o=n.global,s=n.renderCount,c=e?.state,u=D.stateConfig;if(c){const n=e.states;u.prevSupport=e,W(t,D.stateConfig,c,n)}else J(t,u);const i=t.templater;let l;if(i.tagJsType===a.stateRender){l=ut(i,i,gt(i,r,t.appSupport,n)),l.states=t.states}else{l=(0,i.wrapper)(t,n,e),l.states=t.states}return Ze(l,r),n.renderCount>s+1?o.newest:l}function qe(t,e,n,r,o,s){n.checkValueChange=zt;const c=xe(t,e,n);c.ownerSupport=e;const a=ke(c,r,o,o?void 0:s);for(const t of a.dom)t.marker&&(o?Vt.push({element:t.marker,relative:o}):Jt.push({element:t.marker,relative:s})),t.domElement&&(o?Vt.push({element:t.domElement,relative:o}):Jt.push({element:t.domElement,relative:s}));let u=-1;const i=a.subs.length-1;for(;u++<i;){Ke(a.subs[u])}return c}function Qe(t,e,r,o,s,c){const u=t?.tagJsType;return u?function(t,e,r,o,s,c,u){switch(t){case a.templater:return e.checkValueChange=zt,c?qe(r,o,e,s,c,u):Ee(o,e,s);case a.dom:case a.tag:{e.checkValueChange=zt;const t=r;let a=t.templater;a||(a=function(t){const e=Ae();return e.tag=t,t.templater=e,e}(t));const i=n(e);return c?qe(a,o,e,s,c,u):(i.newest=xe(a,o,e),e.checkValueChange=zt,Ee(o,e,s))}case a.stateRender:case a.tagComponent:if(n(e),e.checkValueChange=zt,c){const t=function(t,e,n,r,o){const s=gt(t,n,n.appSupport,e),c=s.propsConfig;if(c){const e=t.tagJsType!==a.tagComponent?[]:ht(t,s);c.castProps=e}const u=e.global,{support:i}=sn(s,u.newest,e,n);return function(t,e,n){let r=Vt.length;const o=ke(t,e,n,void 0);for(const t of o.dom)t.domElement&&Vt.splice(r++,0,{element:t.domElement,relative:n}),t.marker&&Vt.splice(r++,0,{element:t.marker,relative:n});const s=o.subs;for(const t of s)Ke(t)}(i,r,o),i}(r,e,o,s,c);return t}return tn(r,e,o,s);case a.renderOnce:{n(e);const t=Fe(r,e,o);Xe(t,void 0,e,o);const a=qe(t.templater,o,e,s,c,u);return e.checkValueChange=zt,a}}}(u,e,t,r,o,s,c):m(t)?(Me(e,t,r,o,s),void(e.checkValueChange=Be)):void(d(t)||function(t,e,n){const r=Mt(t),o=Rt(r,n);e.simpleValueElm=o,e.checkValueChange=Ue}(t,e,e.placeholder))}function Ye(t,e,n){t!==e.value&&(Je(e,t,n),D.stateConfig.support||It())}function Ke({subject:t,support:e,counts:n,contextItem:r,appendTo:o}){let s=function(t){Qe(t,r,e,{...n},c?o:void 0),c||D.stateConfig.support||It(),s=function(t){Ye(t,r,e)}};let c=!0;const a=t.subscribe((function(t){s(t)}));r.subject=t,c=!1;const u=e.subject.global;(u.subscriptions=u.subscriptions||[]).push(a)}function tn(t,e,n,r){const o=gt(t,n,n.appSupport,e),s=o.propsConfig;if(s){const e=t.tagJsType!==a.tagComponent?[]:ht(t,o);s.castProps=e}const c=e.global,{support:u}=sn(o,c.newest,e,n);return function(t,e,n){n.checkValueChange=zt;const r=ke(t,e,void 0,n.placeholder).subs;for(const t of r)Ke(t)}(u,r,e),u}function en(t,e,n,r,o,s=-1){const c=e.subject.global.newest;if(!c){const e=ot(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=nn(a[e],c,t,n,s+1,o);u.push(i)}return t.propsConfig.castProps=u,u}function nn(t,e,n,r,o,s){return typeof t===c.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):s===o||at(e)?e:m(e)?function(t,e,n,r,o){for(let s=t.length-1;s>=0;--s){const c=t[s];t[s]=nn(e[s],c,n,r,o+1,s)}return t}(e,t,n,r,s):void 0===t?e:function(t,e,n,r,o,s){const c=Object.keys(t);for(const a of c){const c=t[a],u=nn(e[a],c,n,r,s,o+1);if(t[a]===u)continue;const i=Object.getOwnPropertyDescriptor(t,a)?.set;i||(t[a]=u)}return t}(e,t,n,r,s,o)}function rn(t){const e=t.subject.global,{subs:r,tags:o}=$t(e.context);on(t);for(const t of o)on(t);e.subscriptions&&r.forEach((t=>t.unsubscribe())),n(t.subject)}function on(t){const e=t.subject,n=e.global;!0!==n.deleted&&(n.deleted=!0,e.renderCount=0,_t(t,[]))}function sn(t,e,n,r){const o=e?.templater,s=o?.tag,c=Xe(t,e,n,r),u=!e||Ft(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&&rn(e))}if(n){const r=n.strings;if(r){const n=r?.length;n!==t.strings.length&&rn(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),rn(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 cn={added:0,removed:0};function an(t,e,n,r){const o=r.global,{support:s,wasLikeTags:c}=sn(e,t,r,n);return c?(Pe(o.oldest,s),s):(Ee(n,r,cn),s)}function un(t){return a.templater===t.tagJsType}function ln(t){const e=t.subject.global,n=un(t.templater),r=t.ownerSupport;if(e.locked)return e.blocked.push(t),t;if(n)return pn(r,t);e.locked=!0;const o=t.subject;e.blocked.length&&(t=e.blocked.pop(),e.blocked=[]),delete e.locked;return an(e.newest,t,r,o)}function pn(t,e){const n=t.subject.global;if(!n||!0===n.deleted)return e;return ln(n.newest||t)}function fn(t,e){return t.length!==e.length}function dn(t){const e=vn();if(!e)throw bn;return gn(e,D.stateConfig,t)}function gn(t,e,n){const r=e.stateArray,o=e.states;return function(...e){return t.subject.renderCount>0?function(t,e,n,...r){const o=t.subject.global,s=(t=o.newest).state;L(s,n.stateArray,t.states,n.states);const c=e(...r);return L(n.stateArray,s,n.states,t.states),ln(t),g(c)&&c.finally((()=>{L(n.stateArray,s,n.states,t.states),ln(t)})),c}(t,n,{stateArray:r,states:o},...e):n(...e)}}const hn=()=>{const t=vn();if(!t)throw bn;const e=D.stateConfig;return function(n){return gn(t,e,n)}},bn=new Q("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function mn(t){O(t)}function yn(t){O((function(){vn().subject.global.destroy$.toCallback(t)}))}function vn(){return D.stateConfig.support}const wn=":tagvar",Cn=":";function jn(t,e){const n={values:e,ownerSupport:vn(),tagJsType:a.tag,strings:t,key:t=>(n.arrayValue=t,n),html:function(t,e){return n.children={strings:t,values:e},n}};return n}function Sn(t,e){const n={values:e,ownerSupport:vn(),dom:t,tagJsType:a.dom,key:function(t){return n.arrayValue=t,n},html:{dom:function(t,e){return n.children={dom:t,values:e},n}}};return n}const kn="ondoubleclick",Tn=/(:tagvar\d+:)/,En=/(^:tagvar\d+:|:tagvar\d+:$)/g,An="__safeTagVar",xn=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,On=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function Pn(t,e){Vn(t,e);const n=function(t){const e=[],n=[],r=[];let o=null,s=-1,c=0;const a=new RegExp(On,"g");t=function(t){return t.replace(Nn,(function(t){return t.replace(/\[l t\]/g,"[l&nbsp;t]").replace(/\[g t\]/g,"[g&nbsp;t]").replace(/</g,"[l t]").replace(/>/g,"[g t]")}))}(t);for(;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()){Jn(e).forEach((t=>{t.startsWith(wn)&&(t=wn+ ++s+Cn),Wn(o,n,t)}))}}if(c=u.index+i.length,f){o=r.pop()||null;continue}const g=[];let h;for(;null!==(h=xn.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")?Rn(c):c;if(o){if(t.slice(0,wn.length)===wn){const t=wn+ ++s+Cn;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=wn+ ++s+Cn}r||(n=h[2]);const u=[a,n],i=ue(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()){Jn(e).forEach((t=>(t.startsWith(wn)&&++s,Wn(o,n,t))))}}return n}(Vn(t,e).join(""));return n}function Vn(t,e){return function(t,e){const n=t.map(((t,n)=>n<e.length?t+wn+n+Cn:t));return function(t,e,n){const r=n.length-e.length;if(r>0)for(let n=r;n>0;--n)t.push(wn+(e.length+n-1)+Cn)}(n,t,e),n}(t.map((t=>t.replace(En,((t,e)=>An+e)))),e)}function Jn(t){return t.split(Tn).filter((t=>""!==t))}function Wn(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:In(n)})}const Nn=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function In(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&nbsp;t\]/g,"[l t]").replace(/\[g&nbsp;t\]/g,"[g t]")}))}function Rn(t){if(t.startsWith("on")){return t.length===kn.length&&t===kn?"dblclick":t.slice(2,t.length)}return t}const Mn=new RegExp(wn+"(\\d+)"+Cn,"g"),Dn="ch";function Ln(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=_n(t,e)}if(c.ch){const t=c.ch,r=[...s,Dn];c.ch=Ln(t,e,n,r)}t=$n(c,e,o,t)}return o}function $n(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=Mn.exec(a));){const t=c[1],o=parseInt(t,10);if(!isNaN(o)&&o<e){const t=wn+o+Cn,e=a.slice(c.index+t.length);n.splice(r,1,{nn:"text",v:o}),a=e,Mn.lastIndex=0}}return o.tc=a,r}function _n(t,e){return t.map((t=>{const[n,r,o]=t;if(n.startsWith(wn)){const t=parseInt(n.replace(wn,""),10);if(!isNaN(t)&&t<e)return[{tagJsVar:t}]}if(typeof r===s.string&&r.startsWith(wn)){const t=parseInt(r.replace(wn,""),10);if(!isNaN(t)&&t<e)return[n,{tagJsVar:t},o]}return t}))}const Bn="__safeTagVar";const Hn=/__safeTagVar(\d+)/g;function Un(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(Bn)){const n=parseInt(e.replace(Bn,""),10);t[1]=wn+n+Cn}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(Hn,((t,e)=>wn+e+Cn))}Un(n)}0===e.length&&delete t.ch}}const Fn={};function zn(t,e){const n=function(t){const e=t.map((t=>t.length));return e.push(t.length),Number(e.join(""))}(t),r=Fn[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=Ln(Pn(t,e),e.length);s.forEach(Un);const c={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:s};return Fn[n]=c,s}function Gn(t,...e){const n=jn(t,e),r=nt(yt.NONE);return r.tag=n,n.templater=r,n}Gn.dom=function(t,...e){return Sn(t,e)};const Zn=[];function Xn(t,e,r){const o=Zn.findIndex((t=>t.element===e));o>=0&&(Ut(Zn[o].support),Zn.splice(o,1),console.warn("Found and destroyed app element already rendered to element",{element:e}));let s=()=>l(r);s.propWatch=yt.NONE,s.tagJsType=a.stateRender,s.props=[r],s.isApp=!0;const u=function(t,e){const r={value:t,checkValueChange:zt,withinOwnerElement:!1,renderCount:0,global:void 0},o=n(r);return o.events={},qn(t,r,e),r}(s,e),i=u.global;J(i.newest,D.stateConfig);let l=t(r);const p=typeof l==c.function;p||(f(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 d=document.createTextNode("");rt.push(s.wrapper||{original:s});const g=Qn(s,d,e,u,p);if(i.isApp=!0,p&&(l.tag=g.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={};const n=Ut(g);return It(),n},++Nt.locks;const h=ke(g,{added:0,removed:0},e,void 0);i.oldest=g,i.newest=g;let b=s.setUse;if(s.tagJsType!==a.stateRender){const e=t.original;b=e.setUse,e.isApp=!0}e.setUse=b,e.ValueTypes=a,Zn.push({element:e,support:g});const m=document.createDocumentFragment();m.appendChild(d);for(const t of h.dom)Yn(t,m);for(const t of h.subs)Ke(t);return--Nt.locks,It(),e.appendChild(m),{support:g,tags:rt,ValueTypes:a}}function qn(t,e,n){const r=e.global,o=pt(t,e);return ft(t,o,o),o.appElement=n,r.oldest=r.oldest||o,r.newest=o,o}function Qn(t,e,n,r,o){r.placeholder=e;const s=r.global,c=s.newest,u=s.oldest;if(c===u||W(c,D.stateConfig,u.state,u.states),t.tagJsType===a.stateRender){const e=t.wrapper||{original:t};if(!o){const e=qn(t,r,n);return Ze(e),e}const s=ut(t,e,c);return Ze(s),s}const i=(0,t.wrapper)(c,r);return Ze(i),i}function Yn(t,e){t.domElement&&e.appendChild(t.domElement),t.marker&&e.appendChild(t.marker)}const Kn={tagElement:Xn,renderWithSupport:sn,renderSupport:ln,renderTagOnly:Xe,paint:It};var tr=e.W9,er=e.cg,nr=e.m0,rr=e.rS,or=e.Y2,sr=e.ei,cr=e.B7,ar=e.TU,ur=e.XF,ir=e.PC,lr=e.Ot,pr=e.Mj,fr=e.tD,dr=e.j8,gr=e.um,hr=e.E2,br=e.OH,mr=e.TB,yr=e.Ii,vr=e.yV,wr=e.zV,Cr=e.ze,jr=e.WJ,Sr=e.aZ,kr=e.O,Tr=e.Ie,Er=e.B4,Ar=e.Az,xr=e.Xi,Or=e.pc,Pr=e.Ah,Vr=e.ck,Jr=e.k6,Wr=e.Gk,Nr=e.cF,Ir=e.jU,Rr=e.PB,Mr=e.qy,Dr=e.cy,Lr=e.Tn,$r=e.Gv,_r=e.yL,Br=e.D8,Hr=e.Ze,Ur=e._4,Fr=e.mn,zr=e.Eb,Gr=e.z,Zr=e.sA,Xr=e.MG,qr=e.PL,Qr=e.nI,Yr=e.PZ,Kr=e.N_,to=e.r5,eo=e.uc,no=e.pG,ro=e.QB,oo=e.R6,so=e.Ll,co=e.vP,ao=e.wk,uo=e.xP,io=e.bc,lo=e.ag,po=e.Tc,fo=e.Hf,go=e._A,ho=e.Ag,bo=e.NU,mo=e.hW,yo=e.wB,vo=e.id,wo=e.MC,Co=e.zC;export{tr as ArrayNoKeyError,er as BasicTypes,nr as ImmutableTypes,rr as PropWatches,or as RouteQuery,sr as StateMismatchError,cr as Subject,ar as Subjective,ur as SyncCallbackError,ir as TagError,lr as ValueSubject,pr as ValueSubjective,fr as ValueTypes,dr as addOneContext,gr as buildBeforeElement,hr as callback,br as callbackMaker,mr as checkArrayValueChange,yr as checkSimpleValueChange,vr as checkTagValueChange,wr as combineLatest,Cr as createTrigger,jr as defineValueOn,Sr as destroyArray,kr as destroySupport,Tr as empty,Er as getBaseSupport,Ar as getDomMeta,xr as getDomTag,Or as getHtmlSupport,Pr as getNewGlobal,Vr as getStringTag,Jr as getSupport,Wr as getTemplaterResult,Nr as hmr,Ir as howToSetFirstInputValue,Rr as howToSetInputValue,Mr as html,Dr as isArray,Lr as isFunction,$r as isObject,_r as isPromise,Br as isSimpleType,Hr as isStaticTag,Ur as isSubjectInstance,Fr as isTagComponent,zr as key,Gr as letProp,Zr as onDestroy,Xr as onInit,qr as oneRenderToSupport,Qr as paint,Yr as processFirstSubjectValue,Kr as processSubUpdate,to as providers,eo as renderSupport,no as renderTagOnly,ro as renderWithSupport,oo as runWrapper,so as setUseMemory,co as signal,ao as state,uo as states,io as subject,lo as syncError,po as tag,fo as tagElement,go as tags,ho as upgradeBaseToSupport,bo as variablePrefix,mo as variableSuffix,yo as watch,vo as willCallback,wo as willPromise,Co 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=0,t.global={}}t.d(e,{W9:()=>q,cg:()=>c,m0:()=>s,rS:()=>mt,Y2:()=>r,ei:()=>X,B7:()=>C,TU:()=>j,XF:()=>K,PC:()=>Z,Ot:()=>S,Mj:()=>T,tD:()=>a,j8:()=>Pe,um:()=>Ae,E2:()=>dn,OH:()=>hn,TB:()=>Gt,Ii:()=>qt,yV:()=>Ue,zV:()=>y,ze:()=>gn,WJ:()=>k,aZ:()=>Zt,O:()=>Ht,Ie:()=>o,B4:()=>pt,Az:()=>zn,Xi:()=>kn,pc:()=>dt,Ah:()=>n,ck:()=>jn,k6:()=>gt,Gk:()=>nt,cF:()=>Yn,jU:()=>Qt,PB:()=>Kt,qy:()=>Gn,cy:()=>m,Tn:()=>h,Gv:()=>b,yL:()=>g,D8:()=>l,Ze:()=>p,_4:()=>d,mn:()=>f,z:()=>z,sA:()=>yn,MG:()=>mn,PL:()=>Fe,nI:()=>Nt,PZ:()=>Ke,N_:()=>Qe,r5:()=>G,uc:()=>ln,pG:()=>qe,QB:()=>sn,R6:()=>Kn,Ll:()=>D,vP:()=>u,wk:()=>P,xP:()=>F,bc:()=>U,ag:()=>bn,Tc:()=>yt,Hf:()=>qn,_A:()=>rt,Ag:()=>ft,NU:()=>wn,hW:()=>Cn,wB:()=>$,id:()=>E,MC:()=>x,zC:()=>A});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",subject:"subject",tagJsSubject:"tagJsSubject",renderOnce:"renderOnce",stateRender:"stateRender",version:Date.now()};function u(t){return vn()?P((()=>i(t))):i(t)}function i(t){let e=t;const n=new Set;return{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}}}function l(t){switch(t){case s.string:case s.number:case s.boolean:return!0}return!1}function p(t){if(!t)return!1;switch(t.tagJsType){case a.dom:case a.tag:case a.templater:return!0}return!1}function f(t){const e=t?.tagJsType;return e===a.tagComponent||e===a.stateRender}function d(t){return b(t)&&typeof t.subscribe===c.function}function g(t){return t&&h(t.then)}function h(t){return typeof t===c.function}function b(t){return typeof t===c.object&&null!==t}function m(t){return Array.isArray(t)}function y(t){const e=new C;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 v(t,e,n){const r=C.globalSubCount$;C.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=C.globalSubCount$;C.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 C{value;onSubscription;methods=[];isSubject=!0;subscribers=[];subscribeWith;constructor(t,e){this.value=t,this.onSubscription=e}subscribe(t){const e=v(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 C(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 y(t.map((t=>{if(d(t))return t;return new C(t,(e=>(e.next(t),e)))})))}static globalSubCount$=new C(0)}class j extends C{value;onSubscription;_value;constructor(t,e){super(t,e),this.value=t,this.onSubscription=e,this._value=t,k(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 k(t){Object.defineProperty(t,"value",{set(e){t._value=e,t.emit()},get:()=>t._value})}class S extends C{value;constructor(t){super(t),this.value=t}subscribe(t){const e=super.subscribe(t);return t(this.value,e),e}}class T extends C{value;constructor(t){super(t),this.value=t,this._value=t,k(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function E(t){return(e,n)=>{n.setHandler((()=>{})),t(e,n.next)}}function x(t){return(e,n)=>{n.setHandler((()=>{}));t(e).then((t=>n.next(t)))}}const A=t=>(e,n)=>{n.setHandler((()=>{}));const r=t(e).subscribe((t=>{r.unsubscribe(),n.next(t)}))};function P(t){return D.stateConfig.handlers.handler(t)}function O(t){const e=D.stateConfig;e.states[e.statesIndex]=t;return e.support.states[e.statesIndex]=t,++e.statesIndex,t(((...t)=>(P(t),t)))}function V(t){const e=D.stateConfig,n=e.support,r=e.statesIndex,o=e.prevSupport,s=o?.states[r],c=[];s(((...t)=>(c.push(t),t)));let a=0;return n.states[e.statesIndex]=t,++e.statesIndex,t(((...t)=>{e.stateArray.push({get:()=>t,defaultValue:t});const n=c[a];return++a,n}))}function J(t,e){e.handlers.handler=M,e.handlers.statesHandler=O,e.rearray=[],e.stateArray=[],e.states=[],e.statesIndex=0,e.support=t}function W(t,e,n,r){e.rearray=n,e.stateArray=[],e.states=r,e.statesIndex=0,e.handlers.handler=R,e.handlers.statesHandler=V,e.support=t}class N{}function I(t){const e=t.callback;if(!e)return t.defaultValue;const[n]=function(t){const e=t(N),[n]=e,[r]=t(n);return[n,r]}(e);return n}function R(){const t=D.stateConfig,e=t.rearray[t.stateArray.length];return t.stateArray.push(e),e.defaultValue}function M(t){const e=D.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 I(r)},defaultValue:n};return e.stateArray.push(r),n}const D={stateConfig:{stateArray:[],version:Date.now(),handlers:{handler:M,statesHandler:O}}};function L(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);r[t](o);let s=0;const c=t=>e[s++];n[t](c)}}const $=(t,e)=>B(t,e),_=t=>t;const B=(t,e,{init:n,before:r,final:o=_}={})=>{const s=P({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 H(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=P((()=>vn())),r=P((()=>new S(void 0))),o=P((()=>({stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}))),s=(t,s)=>(B(t,((t,e)=>{const c=vn(),a=s(t,e);if(c!==n){const t=o.stateArray,e=n.subject.global.oldest;L(t,e.state,o.states,e.states)}r.next(a)}),e.setup),r);return s.setup=e.setup,H((()=>s),s),s}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function U(t){return vn()?P((()=>new C(t))):new C(t)}function F(t){return D.stateConfig.handlers.statesHandler(t)}function z(t){const e=u([]),n=u(0),r=u(0);let o=[],s=0;return r.value=n.value,t(((...t)=>(o=t,t))),$(o,(()=>{++s,e.value=o,t((()=>o))})),F((()=>{if(s)return t(((...t)=>(e.value=t,n!=r?e.value:t))),r.value=n.value,void++n.value;t((()=>e.value))})),++s,e.value}H((()=>function(t){const e=(e,n)=>B(e,n,t);return e.setup=t,H((()=>e),e),e}({})),$),U._value=t=>{const e=P((function(){return{stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}})),n=vn();return P((function(){return new S(t).pipe((t=>(L(n.state,e.stateArray,n.states,e.states),t)))}))},U.all=function(t){const e=P((()=>({stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}))),n=vn();return C.all(t).pipe((t=>(L(n.state,e.stateArray,n.states,e.states),t)))};const G={create:t=>{const e=P((()=>({stateDiff:0,provider:void 0})));if(e.stateDiff){let t=e.stateDiff;for(;t--;)P(void 0);return P(void 0)}const n=P((()=>{const n=D.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=>P((()=>{const e=t,n=e.compareTo=e.compareTo||t.toString(),r=vn(),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)}))};class Z extends Error{details;constructor(t,e,n={}){super(t),this.name=Z.name,this.details={...n,errorCode:e}}}class q extends Z{constructor(t,e){super(t,"array-no-key-error",e),this.name=q.name}}class X extends Z{constructor(t,e){super(t,"state-mismatch-error",e),this.name=X.name}}class K extends Z{constructor(t,e){super(t,"sync-callback-error",e),this.name=K.name}}function Q(t,e){return Y(t,e)}function Y(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=m(t)?[]:Object.create(Object.getPrototypeOf(t));if(m(t))for(let r=0;r<t.length;r++)n[r]=Y(t[r],e-1);else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=Y(t[r],e-1));return n}function tt(t,e,n){return et(t,e,n)}function et(t,e,n){return!(t!==e&&(r=t,o=e,!h(r)||!h(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():m(t)&&m(e)?function(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!et(t[r],e[r],n-1))return!1;return!0}(t,e,n-1):!m(t)&&!m(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)||!et(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var r,o}function nt(t,e){const n={propWatch:t,props:e,tagJsType:a.templater,key:function(t){return n.arrayValue=t,n}};return n}const rt=[];function ot(t,e,n){return t.map((t=>function(t,e,n,r){if(p(t)||!t)return t;if(!e)return t;return st(t,e,n,r)}(t,e.ownerSupport,e,n)))}function st(t,e,n,r){if(!t)return t;if(t.tagJsType)return t;if(typeof t===c.function)return function(t,e){const n=t.mem;if(n)return t;const r=function(...t){return r.toCall(...t)};return r.original=t,r.mem=t,r.toCall=function(...t){return function(t,e,n){const r=n.subject.global,o=r?.newest||n,s=void 0===vn(),c=t(...e),a=function(){const t=o.subject.global;if(!1===s){if(!0===t.locked)return c}return function(t,e){const n=t.subject,r=un(t.templater);if(r){return pn(e,t)}const o=n.global;o.locked=!0,an(o.newest,t,e,n),delete o.locked}(o,n),c};if(s)return a();return D.tagClosed$.toCallback(a),c}(r.mem,t,e)},Object.assign(r,t),r}(t,e);if(r===St)return t;return at(t)?t:m(t)?function(t,e,n,r){for(let o=t.length-1;o>=0;--o){const s=t[o];if(t[o]=st(s,n,e,r+1),typeof s===c.function){if(s.mem)continue;ct(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=st(o,n,e,r+1);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;ct(r+1,s,o,t,e)}}return t}(t,n,e,r)}function ct(t,e,n,r,o){if(t>0){const t=o.subject.global;r[e].subscription=t.destroy$.toCallback((function(){r[e]=n}))}}function at(t){return typeof t!==c.object||!t||t.tagJsType}function ut(t,e,n,r){const o=e.original;let s;t.tagJsType===a.stateRender?s=t():(s=o(...r),typeof s===c.function&&(s=s())),s.templater=t,t.tag=s;const u=D.stateConfig;return n.state=u.stateArray,n.states=u.states,n}function it(t){return t.map(lt)}function lt(t,e){const n=t,r=t?.tagJsType;if(r)switch(r){case a.stateRender:return;case a.dom:case a.tag:case a.templater:return it(n.values)}return m(t)?it(n):Q(t,e)}function pt(t,e,n){const r={templater:t,subject:e,castedProps:n,appSupport:void 0},o=e.global;return o.blocked=[],o.destroy$=new C,r}function ft(t,e,n,r){e.state=[],e.states=[],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 mt.IMMUTABLE:return t.propsConfig={latest:e,castProps:n};case mt.SHALLOW:return t.propsConfig={latest:e.map((t=>lt(t,kt))),castProps:n}}return t.propsConfig={latest:e.map((t=>lt(t,St))),castProps:n}}}(e,o,r)),e}function dt(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 gt(t,e,n,r,o){const s=pt(t,r,o);return s.ownerSupport=e,ft(t,s,n,o)}function ht(t,e,n){const r=t.propWatch===mt.DEEP?St:kt,o=t.props,s=e.propsConfig;let c=s.castProps;const a=n?.propsConfig,u=a?.castProps;u&&(s.castProps=u,c=en(e,n,n.ownerSupport,o,r));return c||ot(o,e,0)}let bt=0;var mt;function yt(t,e=mt.SHALLOW){const n=function(...r){const o=nt(e,r);o.tagJsType=a.tagComponent;const s=function(t,e){return function(n,r,o){const s=ht(t,n,o),c=n.ownerSupport,a=gt(t,c,n.appSupport,r,s);return ut(t,e,a,s)}}(o,n);return s.original=t,o.wrapper=s,o},r=t;return n.original=t,r.tags=rt,r.setUse=D,r.ValueTypes=a,r.tagIndex=bt++,rt.push(n),n}function vt(){throw new Error("Do not call tag.use as a function but instead set it as: `(props) => tag.use = (use) => html`` `")}function wt(t,e){const n=function(t,e,n){const r=fn(t,e);if(r)return 11;switch(n){case mt.NONE:return 1;case mt.SHALLOW:return jt(t,e);case mt.IMMUTABLE:return Ct(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])=>Tt(r,n[t],(()=>{delete e[t],delete n[t]}))));return r}return Tt(t,o,(()=>{n.splice(e,1),r.splice(e,1)}))}(t,e,n,r))))return 7;return!1}(t,e)}(e.props,t.propsConfig.latest,t.templater.propWatch);return n}function Ct(t,e){const n=t.length;for(let r=0;r<n;++r){if(t[r]!==e[r])return 2}return!1}function jt(t,e){const n=t.length;for(let r=0;r<n;++r){const n=t[r],o=e[r];if(m(n)&&m(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(!Et(e,o))return 3.1}}}return!1}!function(t){t.DEEP="deep",t.SHALLOW="shallow",t.NONE="none",t.IMMUTABLE="immutable"}(mt||(mt={})),yt.renderOnce=function(){throw new Error("Do not call tag.renderOnce as a function but instead set it as: `(props) => tag.renderOnce = () => html`` `")},yt.state=vt,yt.use=vt,yt.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`` `")},yt.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`` `")},yt.deepPropWatch=yt,yt.immutableProps=function(t){return yt(t,mt.IMMUTABLE)},yt.watchProps=function(t){return yt(t,mt.SHALLOW)},Object.defineProperty(yt,"renderOnce",{set(t){t.tagJsType=a.renderOnce}}),Object.defineProperty(yt,"state",{set(t){t.original={setUse:D,tags:rt},t.tagJsType=a.stateRender}}),Object.defineProperty(yt,"use",{set(t){t.original={setUse:D,tags:rt},t.tagJsType=a.stateRender}});const kt=3,St=10;function Tt(t,e,n){if(typeof t!==c.function)return!!tt(t,e,St)&&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 Et([t,e],n){const r=n[t];return typeof e===c.function&&typeof r===c.function||r===e}let xt=[],At=[],Pt=[],Ot=[],Vt=[],Jt=[];const Wt={locks:0};function Nt(){if(!(Wt.locks>0)){for(let t=xt.length-1;t>=0;--t){const e=xt[t];e.parentNode.removeChild(e)}for(const t of At)t();for(const[t,e]of Pt)e.textContent=t;for(const t of Ot)t.relative.appendChild(t.element);for(const{element:t,relative:e}of Vt)e.parentNode.insertBefore(t,e);xt=[],At=[],Ot=[],Vt=[],Pt=[];for(const t of Jt)t();Jt=[]}}function It(t,e){const n=document.createTextNode(t);return Vt.push({element:n,relative:e}),n}function Rt(t){switch(t){case void 0:case!1:case null:return o}return t}function Mt(t){const e=t.subject.global,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 Dt(t){for(const e of t){const t=e.lastArray;if(t){Dt(t);continue}const n=e.global;if(!n)continue;const r=n.newest,o=n.subscriptions;o&&o.forEach((t=>t.unsubscribe())),f(r.templater)&&Mt(r);Dt(n.context)}}function Lt(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&&Lt(s,e,n)}return{tags:e,subs:n}}function $t(t,e){const n=t.subject,r=n.global,o=r.context,s=r.destroys;if(s)return function(t,e,n){const r=n.global,o=[];if(t.forEach((t=>{const e=t();e instanceof Promise&&o.push(e)})),o.length){const t=Promise.all(o).then((()=>{++Wt.locks,_t(r.context,e),Bt(r,n),--Wt.locks,Nt()}));return void e.push(t)}++Wt.locks,_t(r.context,e),Bt(r,n),--Wt.locks,Nt()}(s,e,n);_t(o,e),Bt(r,n)}function _t(t,e){for(const n of t){if(n.withinOwnerElement)continue;const t=n.lastArray;if(t){Zt(n,t);continue}const r=n.simpleValueElm;if(r){delete n.simpleValueElm,xt.push(r);continue}const o=n.global;if(void 0===o)continue;if(!0===o.deleted)continue;o.deleted=!0;const s=o.oldest;s&&$t(s,e)}}function Bt(t,e){t.htmlDomMeta.forEach((t=>{const e=t.marker;e&&xt.push(e);const n=t.domElement;n&&xt.push(n)}))}function Ht(t){const e=t.subject.global;e.deleted=!0,t.subject.renderCount=0;const n=[];return Dt(e.context),e.destroy$&&Mt(t),$t(t,n),n}function Ut(t,e,n,r,o,s){const c=e.length-1,a=n-o,u=a<0||c<a,i=r[n];if(u)return Ft(i,s),1;const l=r[n].value.arrayValue,p=e[n].arrayValue;return l!==p?0===i.renderCount?(console.warn("Possible array issue. Array is attempting to create/delete same items. Either html``.key is not unique or array changes with every render",{oldKey:l,newKey:p}),Jt.push((()=>{zt(i.global,i),Jt.shift(),Nt()})),1):(Ft(i,s),r.splice(n,1),2):0}function Ft(t,e){zt(t.global,t),++e.removed}function zt(t,e){if(t){Ht(t.oldest)}else{const t=e.simpleValueElm;delete e.simpleValueElm,xt.push(t)}}function Gt(t,e){if(!m(t)){return Zt(e,e.lastArray),9}return!1}function Zt(t,e){const n={added:0,removed:0};for(let t=0;t<e.length;++t)Ft(e[t],n);delete t.lastArray}function qt(t,e){if(null==t||typeof t!==c.object)return function(t,e){const n=Rt(t),r=e.simpleValueElm;Pt.push([n,r])}(t,e),-1;const n=e.simpleValueElm;return delete e.simpleValueElm,xt.push(n),6}function Xt(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 Kt(t,e,n){At.push((()=>{Qt(t,e,n)}))}function Qt(t,e,n){void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}function Yt(t,e,n,r,o,s){switch(r){case"init":{const t=s.added;return void Jt.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 Jt.push((()=>n.focus()));case"autoselect":return void Jt.push((()=>n.select()));case"style":{const r=t.split(".");return void At.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)At.push((()=>n.classList.add(t)));return}for(const t of r)At.push((()=>n.classList.remove(t)))}(t,e,n)}throw new Error(`Invalid special attribute of ${r}. ${t}`)}function te(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 ee(t,e=[]){const n=t.subject.global,r=un(t.templater),o=t.ownerSupport;if(n.locked)return e.push(t),e;if(r)return ee(o,e);const s=t,c=f(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(fn(n,o))return!0;switch(t.propWatch){case mt.IMMUTABLE:return Ct(n,o);case mt.SHALLOW:return jt(n,o)}return!tt(n,o,St)}(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=te(t.owner,t);n.push(...e.map((t=>t.support)))}return n}(s);return e.push(...l),i?(ee(o,e),c&&e.push(s),e):(e.push(s),e)}function ne(t){++Wt.locks,t.forEach(re),--Wt.locks,Nt()}function re(t){const e=t.subject.global;e&&ln(e.newest)}D.tagClosed$=new C(void 0,(function(t){vn()||t.next()}));const oe="no-data-ever",se="promise-no-data-ever";function ce(t,e){const n=e.subject.global,r=function(t,e){if(!0!==n.deleted)return function(t,e,n,r){let o=e;for(;o.ownerSupport&&!f(o.templater);)o=o.ownerSupport;const s=o.subject,c=s.global;c.locked=!0;const a=t.apply(n,r);delete c.locked;return function(t,e){const n=e.subject.global;return function(t,e,n){return ne(ee(t)),function(t,e,n){if(g(t)){return e.subject.global.locked=!0,t.then((()=>{if(!0===n.deleted)return se;delete e.subject.global.locked;return ne(ee(e)),se}))}return oe}(e,t,n)}(e,t,n)}(a,o)}(r.tagFunction,r.support,t,e)};return r.tagFunction=t,r.support=e,r}const ae=["init","destroy"];function ue(t,e,n,r,o,s,c){if(c)return Yt(t,e,n,c,s,o);r(n,t,e)}function ie(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,le(t,s,t.target)};c[e]=t,o.addEventListener(e,t)}n[s]=r,n[e]=r}function le(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&&le(t,e,o)}function pe(t,e,n,r){const o=function(...e){return o.tagFunction(t,e)};o.tagFunction=e,o.support=n,ie(n.appSupport,r,t,o)}function fe(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 de={added:0,removed:0};function ge(t,e,n,r){if(n.isNameOnly)return function(t,e,n,r,o,s,a,u){if(n){if(Ce(e))return void r.removeAttribute(n);if(typeof n===c.object)if(typeof e===c.object)for(const t in n)t in e||At.push((function(){r.removeAttribute(t)}));else for(const t in n)At.push((function(){r.removeAttribute(t)}))}be(t,e,r,o,s,a,u)}(t,e,n.value,n.element,r,n.howToSet,[],de),void(n.value=e);const o=n.element;me(e,n.attrName,n,o,r,n.howToSet,n.isSpecial,de),n.value=e}function he(t,e,n,r,o,s,a,u,i){const l=we(e);if(l>=0){const e=t[l],c=Pe(e,s,!0);return c.isAttr=!0,c.element=n,c.howToSet=o,c.isNameOnly=!0,c.handler=(t,e)=>ge(e,t,c,r),void be(t,e,n,r,o,s,u)}const p=we(i);if(p>=0){const i=t[p],l={isAttr:!0,element:n,attrName:e,checkValueChange:qt,withinOwnerElement:!0};s.push(l);return d(l.value)?function(t,e,n,r,o,s,c){s&&At.push((function(){n.removeAttribute(t)}));const a=e.value;if(d(a)){e.handler=je;const u=function(a){me(a,t,e,n,r,o,s,c)},i=a.subscribe(u),l=e.global;(l.subscriptions=l.subscriptions||[]).push(i)}return void me(e.value,t,e,n,r,o,s,c)}(e,l,n,r,o,a,u):(l.handler=(t,e)=>ge(e,t,l,r),function(t,e,n,r,o,s,a,u){n.attrName=t,n.element=r,n.howToSet=o,typeof e===c.function?u&&ae.includes(t)?Yt(t,e,r,t,s,a):ve(n,e,s,t,r):(n.attrName=t,n.element=r,n.howToSet=o,n.isSpecial=u,ue(t,e,r,o,a,s,u))}(e,i,l,n,o,r,u,a),void(l.value=i))}return ue(e,i,n,o,u,r,a)}function be(t,e,n,r,s,a,u){if(!Ce(e))if(typeof e!==c.object)0!==e.length&&s(n,e,o);else for(const o in e){const c=e[o];he(t,o,n,r,s,a,fe(o),u,c)}}function me(t,e,n,r,o,s,c,u){return h(t)?function(t,e,n,r,o,s,c,u){const i=t.templater.wrapper;if((i?.tagJsType||i?.original?.tagJsType)!==a.renderOnce)return ve(c,e,t,r,n);return ye(e,n,r,o,s,t,u)}(o,t,r,e,c,s,n,u):ye(t,r,e,c,s,o,u)}function ye(t,e,n,r,o,s,c){if(!1===r){switch(t){case void 0:case!1:case null:return void At.push((function(){e.removeAttribute(n)}))}if(h(t))return pe(e,t,s,n);o(e,n,t)}else Yt(n,t,e,r,s,c)}function ve(t,e,n,r,o){const s=t.value;return s&&s.tagFunction&&s.support?(s.tagFunction=e,s.support=n,s):pe(o,e=ce(e,n),n,r)}function we(t){return b(t)&&"tagJsVar"in t?t.tagJsVar:-1}function Ce(t){return null==t||!1===t}const je=()=>{},ke="object"==typeof document&&document.createElement("div");function Se(t,e,n,r,s,c,a,u,i=[]){const l=[];a&&void 0===u&&(u=document.createTextNode(o),Ot.push({element:u,relative:a}),a=void 0);for(let o=0;o<t.length;++o){const p=t[o],f=p.v;if(!isNaN(f)){const t=s.length;xe(e[t],t,s,n,i,r,c,a,u);continue}const d={};if(l.push(d),"text"===p.nn){Ee(d,p,a,u);continue}const g=Te(d,p,e,n,s,r,a,u);p.ch&&(d.ch=Se(p.ch,e,n,r,s,c+1,g,u,i).dom)}return{subs:i,dom:l,context:s}}function Te(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;he(n,e,u,r,Qt,o,a,s,c)})),c?Ot.push({element:u,relative:c}):Vt.push({element:u,relative:a}),u}function Ee(t,e,n,r){const o=t,s=o.tc=e.tc;ke.innerHTML=s;const c=o.domElement=document.createTextNode(ke.innerText);n?Ot.push({element:c,relative:n}):Vt.push({element:c,relative:r})}function xe(t,e,n,r,s,c,a,u,i){const l=document.createTextNode(o),p=Pe(t,n,a>0);if(p.placeholder=l,u?Ot.push({relative:u,element:l}):Vt.push({relative:i,element:l}),d(t))return s.push({insertBefore:l,appendTo:u,subject:t,support:r,counts:c,contextItem:p}),void(p.handler=je);p.handler=(t,e,n,r)=>$e(r,t,n);r.subject.global.locked=!0,Ke(t,p,r,c,u,i);delete r.subject.global.locked,p.value=t}function Ae(t,e,n,r){const o=t.subject.global;o.oldest=t,o.newest=t,++Wt.locks;const s=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 zn(r,n.values)}(t),s=t.templater.tag,c=s.values,u=[],i=t.subject.global;i.context=u;const l=Se(o,c,t,e,u,0,n,r);return l}(t,e,n,r);return o.htmlDomMeta=s.dom,--Wt.locks,s}function Pe(t,e,n){const r={value:t,checkValueChange:qt,withinOwnerElement:n};return e.push(r),r}function Oe(t,e,n){const r=e.global.newest;r.ownerSupport=t,e.checkValueChange=Ue;const o=Ae(r,n,void 0,e.placeholder);for(const t of o.subs)Ye(t);return r}function Ve(){return{tagJsType:a.templater}}function Je(t,e,n){const r=dt(t,e,e.appSupport,n);return n.global.context=[],r}function We(t,e,n,r){const o=t[e],s=n[e];if(o===s.value)return;(0,s.handler)(o,t,r,s),s.value=o}function Ne(t,e){const n=t.subject.global.context;!function(t,e){const n=e.templater.tag||e.templater,r=e.templater.values||n.values,o=t.templater.tag;o.values=r}(t,e),++Wt.locks,function(t,e){const n=t.templater.tag.values;let r=0;const o=n.length;for(;r<o;)We(n,r,e,t),++r}(t,n),--Wt.locks,Nt()}function Ie(t,e,r){r.checkValueChange=Ue;const o=t;let s=o.templater;s||(s=nt(mt.DEEP),s.tag=o,o.templater=s);const c=r.global=n(r),a=c.newest=gt(s,e,e.appSupport,r);return c.oldest=a,r}function Re(t,e,n,r,o){t.lastArray||(t.lastArray=[]);const s=t.lastArray;let c=t.placeholder,a=0;const u=[];for(let t=0;t<s.length;++t){const n=s[t],o=Ut(0,e,t,s,a,r);0!==o?(a+=o,2===o&&(t-=1)):u.push(n)}t.lastArray=u;const i=o,l=e.length;for(let t=0;t<l;++t){c=Me(e,t,u,n,c,r,i).placeholder}}function Me(t,e,n,r,o,s,c){const a=t[e],u=n[e];return u?function(t,e,n,r,o,s,c,a){const u=n.length>o;if(u)return $e(e,t,r),e;const i=De(t,s,r,c,n,a);return i}(a,u,n,r,e,o,s,c):De(a,o,r,s,n,c)}function De(t,e,n,r,o,s){const c={value:t,checkValueChange:qt,withinOwnerElement:!1};r.added=r.added+1;const u=document.createTextNode("");return c.placeholder=u,s||Vt.push({element:u,relative:e}),function(t,e,n){const r=t.tagJsType;if(r)switch(r){case a.templater:Ie(t.tag,e,n);break;case a.tag:case a.dom:Ie(t,e,n)}}(t,n,c),Ke(t,c,n,r,s),c.value=t,o.push(c),s&&Ot.push({element:u,relative:s}),c}const Le={added:0,removed:0};function $e(t,e,n){if(e===t.value)return;const r=t.checkValueChange(e,t);if(-1===r)return;const o=e&&e.tagJsType;if(o){if(o===a.renderOnce)return;He(t,e,n)}else m(e)?Re(t,e,n,{added:0,removed:0}):typeof e!==c.function?r&&function(t,e){e.checkValueChange=qt;const n=e.placeholder,r=Rt(t);e.simpleValueElm=It(r,n)}(e,t):t.value=e}function _e(t,e,r){if(!e.global.newest)return void tn(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||Xt(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;Ht(s),n(t);const c=tn(e,t,r,{added:0,removed:0})}(r,f,t);const d=p||wt(s,f);if(!d){return void function(t,e,n,r,o){const s=t.props,c=en(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===mt.DEEP?St:kt)}if(o.locked)return void o.blocked.push(e);ln(e)}(r,gt(t,r,r.appSupport,e),e)}function Be(t,e,n,r){typeof n!==c.function&&function(t,e,n,r){const o=gt(n.templater||n,r,r.appSupport,e);Ne(t.subject.global.oldest,o)}(t,e,n,r)}function He(t,e,r){const o=e.tagJsType;if(f(e))return void 0===t.global&&n(t),_e(e,t,r),!0;const s=t.global;if(s){const n=s.newest;if(n)return Be(n,t,e,r),!0}switch(o){case a.templater:return Oe(r,t,Le),!0;case a.tag:case a.dom:return function(t,e,r){const o=t;let s=o.templater;s||(s=Ve(),o.templater=s,s.tag=o),(e.global?e.global:n(e)).newest=Je(s,r,e),Oe(r,e,Le)}(e,t,r),!0}return!1}function Ue(t,e){const r=e.global,o=r?.newest;if(p(t)){return!Xt(t,o)&&(Ht(o),n(e),7)}const s=t?.tagJsType;if(s){return!0===He(e,t,r.newest.ownerSupport)&&-1}return Ht(o),delete e.global,e.renderCount=0,8}function Fe(t,e,n){const r=nt(mt.DEEP);r.tagJsType=t.tagJsType;const o=Je(r,n,e);function s(){return r.tag=t(),o}return r.wrapper=s,s.tagJsType=t.tagJsType,s.original=t.original||t,o}function ze(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 X(r,c);throw console.error(Ge,c),a}(n,e,t)}const Ge="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 Ze(t,e){const n=t.subject;++n.renderCount;const r=D.stateConfig;delete r.support,t.state=r.stateArray,D.tagClosed$.next(e),ze(r,t),n.global.newest=t}function qe(t,e,n,r){const o=n.global,s=n.renderCount,c=e?.state,u=D.stateConfig;if(c){const n=e.states;u.prevSupport=e,W(t,D.stateConfig,c,n)}else J(t,u);const i=t.templater;let l;if(i.tagJsType===a.stateRender){l=ut(i,i,gt(i,r,t.appSupport,n)),l.states=t.states}else{l=(0,i.wrapper)(t,n,e),l.states=t.states}return Ze(l,r),n.renderCount>s+1?o.newest:l}function Xe(t,e,n,r,o,s){n.checkValueChange=Ue;const c=Je(t,e,n);c.ownerSupport=e;const a=Ae(c,r,o,o?void 0:s);for(const t of a.dom)t.marker&&(o?Ot.push({element:t.marker,relative:o}):Vt.push({element:t.marker,relative:s})),t.domElement&&(o?Ot.push({element:t.domElement,relative:o}):Vt.push({element:t.domElement,relative:s}));let u=-1;const i=a.subs.length-1;for(;u++<i;){Ye(a.subs[u])}return c}function Ke(t,e,r,o,s,c){const u=t?.tagJsType;return u?function(t,e,r,o,s,c,u){switch(t){case a.templater:return e.checkValueChange=Ue,c?Xe(r,o,e,s,c,u):Oe(o,e,s);case a.dom:case a.tag:{e.checkValueChange=Ue;const t=r;let a=t.templater;a||(a=function(t){const e=Ve();return e.tag=t,t.templater=e,e}(t));const i=n(e);return c?Xe(a,o,e,s,c,u):(i.newest=Je(a,o,e),e.checkValueChange=Ue,Oe(o,e,s))}case a.stateRender:case a.tagComponent:if(n(e),e.checkValueChange=Ue,c){const t=function(t,e,n,r,o){const s=gt(t,n,n.appSupport,e),c=s.propsConfig;if(c){const e=t.tagJsType!==a.tagComponent?[]:ht(t,s);c.castProps=e}const u=e.global,{support:i}=sn(s,u.newest,e,n);return function(t,e,n){let r=Ot.length;const o=Ae(t,e,n,void 0);for(const t of o.dom)t.domElement&&Ot.splice(r++,0,{element:t.domElement,relative:n}),t.marker&&Ot.splice(r++,0,{element:t.marker,relative:n});const s=o.subs;for(const t of s)Ye(t)}(i,r,o),i}(r,e,o,s,c);return t}return tn(r,e,o,s);case a.renderOnce:{n(e);const t=Fe(r,e,o);qe(t,void 0,e,o);const a=Xe(t.templater,o,e,s,c,u);return e.checkValueChange=Ue,a}}}(u,e,t,r,o,s,c):m(t)?(Re(e,t,r,o,s),void(e.checkValueChange=Gt)):void(d(t)||function(t,e,n){const r=Rt(t),o=It(r,n);e.simpleValueElm=o,e.checkValueChange=qt}(t,e,e.placeholder))}function Qe(t,e,n){t!==e.value&&($e(e,t,n),D.stateConfig.support||Nt())}function Ye({subject:t,support:e,counts:n,contextItem:r,appendTo:o}){let s=function(t){Ke(t,r,e,{...n},c?o:void 0),c||D.stateConfig.support||Nt(),s=function(t){Qe(t,r,e)}};let c=!0;const a=t.subscribe((function(t){s(t)}));r.subject=t,c=!1;const u=e.subject.global;(u.subscriptions=u.subscriptions||[]).push(a)}function tn(t,e,n,r){const o=gt(t,n,n.appSupport,e),s=o.propsConfig;if(s){const e=t.tagJsType!==a.tagComponent?[]:ht(t,o);s.castProps=e}const c=e.global,{support:u}=sn(o,c.newest,e,n);return function(t,e,n){n.checkValueChange=Ue;const r=Ae(t,e,void 0,n.placeholder).subs;for(const t of r)Ye(t)}(u,r,e),u}function en(t,e,n,r,o,s=-1){const c=e.subject.global.newest;if(!c){const e=ot(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=nn(a[e],c,t,n,s+1,o);u.push(i)}return t.propsConfig.castProps=u,u}function nn(t,e,n,r,o,s){return void 0===t?e:typeof t===c.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):s===o||at(e)?e:m(e)?function(t,e,n,r,o){for(let s=t.length-1;s>=0;--s){const c=t[s],a=e[s];t[s]=nn(a,c,n,r,o+1,s)}return t}(e,t,n,r,s):function(t,e,n,r,o,s){const c=Object.keys(t);for(const a of c){const c=t[a],u=nn(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 rn(t){const e=t.subject.global,{subs:r,tags:o}=Lt(e.context);on(t);for(const t of o)on(t);e.subscriptions&&r.forEach((t=>t.unsubscribe())),n(t.subject)}function on(t){const e=t.subject,n=e.global;!0!==n.deleted&&(n.deleted=!0,e.renderCount=0,$t(t,[]))}function sn(t,e,n,r){const o=e?.templater,s=o?.tag,c=qe(t,e,n,r),u=!e||Xt(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&&rn(e))}if(n){const r=n.strings;if(r){const n=r?.length;n!==t.strings.length&&rn(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),rn(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 cn={added:0,removed:0};function an(t,e,n,r){const o=r.global,{support:s,wasLikeTags:c}=sn(e,t,r,n);return c?(Ne(o.oldest,s),s):(Oe(n,r,cn),s)}function un(t){return a.templater===t.tagJsType}function ln(t){const e=t.subject.global,n=un(t.templater),r=t.ownerSupport;if(e.locked)return e.blocked.push(t),t;if(n){return pn(r,t)}e.locked=!0;const o=t.subject;e.blocked.length&&(t=e.blocked.pop(),e.blocked=[]);const s=an(e.newest,t,r,o);return delete e.locked,s}function pn(t,e){const n=t.subject.global;if(!n||!0===n.deleted)return e;return ln(n.newest||t)}function fn(t,e){return t.length!==e.length}function dn(t){const e=vn();if(!e)throw bn;return gn(e,D.stateConfig,t)}function gn(t,e,n){const r=e.stateArray,o=e.states;return function(...e){return t.subject.renderCount>0?function(t,e,n,...r){const o=t.subject.global,s=(t=o.newest).state;L(s,n.stateArray,t.states,n.states);const c=e(...r);return L(n.stateArray,s,n.states,t.states),ln(t),g(c)&&c.finally((()=>{L(n.stateArray,s,n.states,t.states),ln(t)})),c}(t,n,{stateArray:r,states:o},...e):n(...e)}}const hn=()=>{const t=vn();if(!t)throw bn;const e=D.stateConfig;return function(n){return gn(t,e,n)}},bn=new K("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function mn(t){P(t)}function yn(t){P((function(){vn().subject.global.destroy$.toCallback(t)}))}function vn(){return D.stateConfig.support}const wn=":tagvar",Cn=":";function jn(t,e){const n={values:e,ownerSupport:vn(),tagJsType:a.tag,strings:t,key:t=>(n.arrayValue=t,n),html:function(t,e){return n.children={strings:t,values:e},n}};return n}function kn(t,e){const n={values:e,ownerSupport:vn(),dom:t,tagJsType:a.dom,key:function(t){return n.arrayValue=t,n},html:{dom:function(t,e){return n.children={dom:t,values:e},n}}};return n}const Sn="ondoubleclick",Tn=/(:tagvar\d+:)/,En=/(^:tagvar\d+:|:tagvar\d+:$)/g,xn="__safeTagVar",An=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,Pn=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function On(t,e){Vn(t,e);const n=function(t){const e=[],n=[],r=[];let o=null,s=-1,c=0;const a=new RegExp(Pn,"g");t=function(t){return t.replace(Nn,(function(t){return t.replace(/\[l t\]/g,"[l&nbsp;t]").replace(/\[g t\]/g,"[g&nbsp;t]").replace(/</g,"[l t]").replace(/>/g,"[g t]")}))}(t);for(;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()){Jn(e).forEach((t=>{t.startsWith(wn)&&(t=wn+ ++s+Cn),Wn(o,n,t)}))}}if(c=u.index+i.length,f){o=r.pop()||null;continue}const g=[];let h;for(;null!==(h=An.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")?Rn(c):c;if(o){if(t.slice(0,wn.length)===wn){const t=wn+ ++s+Cn;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=wn+ ++s+Cn}r||(n=h[2]);const u=[a,n],i=fe(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()){Jn(e).forEach((t=>(t.startsWith(wn)&&++s,Wn(o,n,t))))}}return n}(Vn(t,e).join(""));return n}function Vn(t,e){return function(t,e){const n=t.map(((t,n)=>n<e.length?t+wn+n+Cn:t));return function(t,e,n){const r=n.length-e.length;if(r>0)for(let n=r;n>0;--n)t.push(wn+(e.length+n-1)+Cn)}(n,t,e),n}(t.map((t=>t.replace(En,((t,e)=>xn+e)))),e)}function Jn(t){return t.split(Tn).filter((t=>""!==t))}function Wn(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:In(n)})}const Nn=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function In(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&nbsp;t\]/g,"[l t]").replace(/\[g&nbsp;t\]/g,"[g t]")}))}function Rn(t){if(t.startsWith("on")){return t.length===Sn.length&&t===Sn?"dblclick":t.slice(2,t.length)}return t}const Mn=new RegExp(wn+"(\\d+)"+Cn,"g"),Dn="ch";function Ln(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=_n(t,e)}if(c.ch){const t=c.ch,r=[...s,Dn];c.ch=Ln(t,e,n,r)}t=$n(c,e,o,t)}return o}function $n(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=Mn.exec(a));){const t=c[1],o=parseInt(t,10);if(!isNaN(o)&&o<e){const t=wn+o+Cn,e=a.slice(c.index+t.length);n.splice(r,1,{nn:"text",v:o}),a=e,Mn.lastIndex=0}}return o.tc=a,r}function _n(t,e){return t.map((t=>{const[n,r,o]=t;if(n.startsWith(wn)){const t=parseInt(n.replace(wn,""),10);if(!isNaN(t)&&t<e)return[{tagJsVar:t}]}if(typeof r===s.string&&r.startsWith(wn)){const t=parseInt(r.replace(wn,""),10);if(!isNaN(t)&&t<e)return[n,{tagJsVar:t},o]}return t}))}const Bn="__safeTagVar";const Hn=/__safeTagVar(\d+)/g;function Un(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(Bn)){const n=parseInt(e.replace(Bn,""),10);t[1]=wn+n+Cn}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(Hn,((t,e)=>wn+e+Cn))}Un(n)}0===e.length&&delete t.ch}}const Fn={};function zn(t,e){const n=function(t){const e=t.map((t=>t.length));return e.push(t.length),Number(e.join(""))}(t),r=Fn[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=Ln(On(t,e),e.length);s.forEach(Un);const c={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:s};return Fn[n]=c,s}function Gn(t,...e){const n=jn(t,e),r=nt(mt.NONE);return r.tag=n,n.templater=r,n}Gn.dom=function(t,...e){return kn(t,e)};const Zn=[];function qn(t,e,r){const o=Zn.findIndex((t=>t.element===e));o>=0&&(Ht(Zn[o].support),Zn.splice(o,1),console.warn("Found and destroyed app element already rendered to element",{element:e}));let s=()=>l(r);s.propWatch=mt.NONE,s.tagJsType=a.stateRender,s.props=[r],s.isApp=!0;const u=function(t,e){const r={value:t,checkValueChange:Ue,withinOwnerElement:!1,renderCount:0,global:void 0},o=n(r);return o.events={},Xn(t,r,e),r}(s,e),i=u.global;J(i.newest,D.stateConfig);let l=t(r);const p=typeof l==c.function;p||(f(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 d=document.createTextNode("");rt.push(s.wrapper||{original:s});const g=Kn(s,d,e,u,p);if(i.isApp=!0,p&&(l.tag=g.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={},++Wt.locks;const n=Ht(g);return--Wt.locks,Nt(),n},++Wt.locks;const h=function(t,e,n,r,o,s){const c=Ae(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,Zn.push({element:e,support:t});const i=document.createDocumentFragment();i.appendChild(s);for(const t of c.dom)Qn(t,i);for(const t of c.subs)Ye(t);return i}(g,e,i,s,t,d);return--Wt.locks,Nt(),e.appendChild(h),{support:g,tags:rt,ValueTypes:a}}function Xn(t,e,n){const r=e.global,o=pt(t,e);return ft(t,o,o),o.appElement=n,r.oldest=r.oldest||o,r.newest=o,o}function Kn(t,e,n,r,o){r.placeholder=e;const s=r.global,c=s.newest,u=s.oldest;if(c===u||W(c,D.stateConfig,u.state,u.states),t.tagJsType===a.stateRender){const e=t.wrapper||{original:t};if(!o){const e=Xn(t,r,n);return Ze(e),e}const s=ut(t,e,c);return Ze(s),s}const i=(0,t.wrapper)(c,r);return Ze(i),i}function Qn(t,e){t.domElement&&e.appendChild(t.domElement),t.marker&&e.appendChild(t.marker)}const Yn={tagElement:qn,renderWithSupport:sn,renderSupport:ln,renderTagOnly:qe,paint:Nt};var tr=e.W9,er=e.cg,nr=e.m0,rr=e.rS,or=e.Y2,sr=e.ei,cr=e.B7,ar=e.TU,ur=e.XF,ir=e.PC,lr=e.Ot,pr=e.Mj,fr=e.tD,dr=e.j8,gr=e.um,hr=e.E2,br=e.OH,mr=e.TB,yr=e.Ii,vr=e.yV,wr=e.zV,Cr=e.ze,jr=e.WJ,kr=e.aZ,Sr=e.O,Tr=e.Ie,Er=e.B4,xr=e.Az,Ar=e.Xi,Pr=e.pc,Or=e.Ah,Vr=e.ck,Jr=e.k6,Wr=e.Gk,Nr=e.cF,Ir=e.jU,Rr=e.PB,Mr=e.qy,Dr=e.cy,Lr=e.Tn,$r=e.Gv,_r=e.yL,Br=e.D8,Hr=e.Ze,Ur=e._4,Fr=e.mn,zr=e.z,Gr=e.sA,Zr=e.MG,qr=e.PL,Xr=e.nI,Kr=e.PZ,Qr=e.N_,Yr=e.r5,to=e.uc,eo=e.pG,no=e.QB,ro=e.R6,oo=e.Ll,so=e.vP,co=e.wk,ao=e.xP,uo=e.bc,io=e.ag,lo=e.Tc,po=e.Hf,fo=e._A,go=e.Ag,ho=e.NU,bo=e.hW,mo=e.wB,yo=e.id,vo=e.MC,wo=e.zC;export{tr as ArrayNoKeyError,er as BasicTypes,nr as ImmutableTypes,rr as PropWatches,or as RouteQuery,sr as StateMismatchError,cr as Subject,ar as Subjective,ur as SyncCallbackError,ir as TagError,lr as ValueSubject,pr as ValueSubjective,fr as ValueTypes,dr as addOneContext,gr as buildBeforeElement,hr as callback,br as callbackMaker,mr as checkArrayValueChange,yr as checkSimpleValueChange,vr as checkTagValueChange,wr as combineLatest,Cr as createTrigger,jr as defineValueOn,kr as destroyArray,Sr as destroySupport,Tr as empty,Er as getBaseSupport,xr as getDomMeta,Ar as getDomTag,Pr as getHtmlSupport,Or as getNewGlobal,Vr as getStringTag,Jr as getSupport,Wr as getTemplaterResult,Nr as hmr,Ir as howToSetFirstInputValue,Rr as howToSetInputValue,Mr as html,Dr as isArray,Lr as isFunction,$r as isObject,_r as isPromise,Br as isSimpleType,Hr as isStaticTag,Ur as isSubjectInstance,Fr as isTagComponent,zr as letProp,Gr as onDestroy,Zr as onInit,qr as oneRenderToSupport,Xr as paint,Kr as processFirstSubjectValue,Qr as processSubUpdate,Yr as providers,to as renderSupport,eo as renderTagOnly,no as renderWithSupport,ro as runWrapper,oo as setUseMemory,so as signal,co as state,ao as states,uo as subject,io as syncError,lo as tag,po as tagElement,fo as tags,go as upgradeBaseToSupport,ho as variablePrefix,bo as variableSuffix,mo as watch,yo as willCallback,vo as willPromise,wo as willSubscribe};
2
2
  //# sourceMappingURL=bundle.js.map