taggedjs 2.7.6 → 2.7.8

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 (113) hide show
  1. package/bundle.js +1 -1
  2. package/bundle.js.map +1 -1
  3. package/js/index.js.map +1 -1
  4. package/js/interpolations/attributes/isSpecialAttribute.function.d.ts +1 -1
  5. package/js/interpolations/attributes/isSpecialAttribute.function.js +3 -0
  6. package/js/interpolations/attributes/isSpecialAttribute.function.js.map +1 -1
  7. package/js/interpolations/attributes/processAttribute.function.d.ts +8 -6
  8. package/js/interpolations/attributes/processAttribute.function.js +27 -25
  9. package/js/interpolations/attributes/processAttribute.function.js.map +1 -1
  10. package/js/interpolations/attributes/processNameValueAttribute.function.d.ts +3 -2
  11. package/js/interpolations/attributes/processNameValueAttribute.function.js +7 -6
  12. package/js/interpolations/attributes/processNameValueAttribute.function.js.map +1 -1
  13. package/js/interpolations/attributes/specialAttribute.d.ts +3 -1
  14. package/js/interpolations/attributes/specialAttribute.js +25 -6
  15. package/js/interpolations/attributes/specialAttribute.js.map +1 -1
  16. package/js/interpolations/index.d.ts +1 -0
  17. package/js/interpolations/index.js.map +1 -1
  18. package/js/interpolations/interpolateTemplate.d.ts +0 -3
  19. package/js/interpolations/optimizers/attachDomElements.function.js +5 -6
  20. package/js/interpolations/optimizers/attachDomElements.function.js.map +1 -1
  21. package/js/interpolations/processSubscriptionUpdate.function.js +1 -1
  22. package/js/interpolations/processSubscriptionUpdate.function.js.map +1 -1
  23. package/js/interpolations/subscribeToTemplate.function.js +1 -1
  24. package/js/interpolations/subscribeToTemplate.function.js.map +1 -1
  25. package/js/state/callback.function.js +1 -1
  26. package/js/state/callback.function.js.map +1 -1
  27. package/js/state/callbackMaker.function.js +1 -1
  28. package/js/state/callbackMaker.function.js.map +1 -1
  29. package/js/state/callbackStateUpdate.function.js +0 -1
  30. package/js/state/callbackStateUpdate.function.js.map +1 -1
  31. package/js/state/index.d.ts +1 -0
  32. package/js/state/index.js +1 -0
  33. package/js/state/index.js.map +1 -1
  34. package/js/state/letState.function.js +1 -1
  35. package/js/state/letState.function.js.map +1 -1
  36. package/js/state/letState.utils.js +1 -1
  37. package/js/state/letState.utils.js.map +1 -1
  38. package/js/state/providers.js +1 -1
  39. package/js/state/providers.js.map +1 -1
  40. package/js/state/setUse.function.d.ts +0 -1
  41. package/js/state/setUse.function.js +1 -14
  42. package/js/state/setUse.function.js.map +1 -1
  43. package/js/state/setUseMemory.object.d.ts +2 -0
  44. package/js/state/setUseMemory.object.js +15 -0
  45. package/js/state/setUseMemory.object.js.map +1 -0
  46. package/js/state/state.function.js +1 -1
  47. package/js/state/state.function.js.map +1 -1
  48. package/js/state/stateHandlers.js +1 -1
  49. package/js/state/stateHandlers.js.map +1 -1
  50. package/js/state/states.function.js +1 -1
  51. package/js/state/states.function.js.map +1 -1
  52. package/js/state/states.utils.js +1 -1
  53. package/js/state/states.utils.js.map +1 -1
  54. package/js/state/subject.function.js +1 -1
  55. package/js/state/subject.function.js.map +1 -1
  56. package/js/state/watch.function.js +1 -1
  57. package/js/state/watch.function.js.map +1 -1
  58. package/js/subject/Subject.class.js +8 -2
  59. package/js/subject/Subject.class.js.map +1 -1
  60. package/js/tag/TemplaterResult.class.d.ts +1 -0
  61. package/js/tag/TemplaterResult.class.js.map +1 -1
  62. package/js/tag/afterRender.function.js +1 -1
  63. package/js/tag/afterRender.function.js.map +1 -1
  64. package/js/tag/buildBeforeElement.function.d.ts +2 -2
  65. package/js/tag/buildBeforeElement.function.js +4 -6
  66. package/js/tag/buildBeforeElement.function.js.map +1 -1
  67. package/js/tag/checkDestroyPrevious.function.js +2 -2
  68. package/js/tag/checkDestroyPrevious.function.js.map +1 -1
  69. package/js/tag/destroySupport.function.d.ts +1 -1
  70. package/js/tag/destroySupport.function.js +5 -7
  71. package/js/tag/destroySupport.function.js.map +1 -1
  72. package/js/tag/elementDestroyCheck.function.d.ts +5 -3
  73. package/js/tag/elementDestroyCheck.function.js +1 -1
  74. package/js/tag/elementDestroyCheck.function.js.map +1 -1
  75. package/js/tag/executeWrap.function.js +1 -1
  76. package/js/tag/executeWrap.function.js.map +1 -1
  77. package/js/tag/getChildTagsToDestroy.function.d.ts +1 -1
  78. package/js/tag/getChildTagsToDestroy.function.js +3 -3
  79. package/js/tag/getChildTagsToDestroy.function.js.map +1 -1
  80. package/js/tag/processUpdateAttrContext.function.js +4 -2
  81. package/js/tag/processUpdateAttrContext.function.js.map +1 -1
  82. package/js/tag/render/renderExistingTag.function.js +2 -1
  83. package/js/tag/render/renderExistingTag.function.js.map +1 -1
  84. package/js/tag/render/renderTagOnly.function.js +1 -1
  85. package/js/tag/render/renderTagOnly.function.js.map +1 -1
  86. package/js/tag/render/softDestroySupport.function.js +2 -2
  87. package/js/tag/render/softDestroySupport.function.js.map +1 -1
  88. package/js/tag/runElementDestroyCall.function.d.ts +5 -0
  89. package/js/tag/runElementDestroyCall.function.js +14 -0
  90. package/js/tag/runElementDestroyCall.function.js.map +1 -0
  91. package/js/tag/smartRemoveKids.function.d.ts +1 -1
  92. package/js/tag/smartRemoveKids.function.js +40 -41
  93. package/js/tag/smartRemoveKids.function.js.map +1 -1
  94. package/js/tag/tagElement.d.ts +1 -1
  95. package/js/tag/tagElement.js +4 -4
  96. package/js/tag/tagElement.js.map +1 -1
  97. package/js/tag/update/processFirstSubjectValue.function.js +5 -5
  98. package/js/tag/update/processFirstSubjectValue.function.js.map +1 -1
  99. package/js/tag/update/processNewSubjectTag.function.d.ts +2 -1
  100. package/js/tag/update/processNewSubjectTag.function.js +2 -2
  101. package/js/tag/update/processNewSubjectTag.function.js.map +1 -1
  102. package/js/tag/update/processTag.function.d.ts +3 -1
  103. package/js/tag/update/processTag.function.js +3 -2
  104. package/js/tag/update/processTag.function.js.map +1 -1
  105. package/js/tag/update/processTagArray.js +1 -1
  106. package/js/tag/update/processTagArray.js.map +1 -1
  107. package/js/tag/update/processTagResult.function.js +3 -4
  108. package/js/tag/update/processTagResult.function.js.map +1 -1
  109. package/js/tag/update/updateExistingTagComponent.function.js +1 -1
  110. package/js/tag/update/updateExistingTagComponent.function.js.map +1 -1
  111. package/js/tag/update/updateExistingValue.function.js +3 -2
  112. package/js/tag/update/updateExistingValue.function.js.map +1 -1
  113. 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:()=>q,cg:()=>c,m0:()=>s,rS:()=>yt,Y2:()=>r,ei:()=>Q,B7:()=>v,TU:()=>w,XF:()=>Y,PC:()=>X,Ot:()=>S,Mj:()=>j,tD:()=>a,j8:()=>ue,um:()=>ae,E2:()=>Ye,OH:()=>tn,TB:()=>Ee,Ii:()=>Pe,yV:()=>Ve,zV:()=>b,ze:()=>Ke,WJ:()=>C,aZ:()=>Oe,O:()=>Ce,Ie:()=>o,B4:()=>at,Az:()=>Wn,Xi:()=>ln,pc:()=>it,Ah:()=>n,ck:()=>un,k6:()=>ut,Gk:()=>rt,cF:()=>Ln,PB:()=>Mt,qy:()=>Nn,cy:()=>h,Tn:()=>g,Gv:()=>d,yL:()=>f,D8:()=>u,Ze:()=>i,_4:()=>p,mn:()=>l,Eb:()=>bt,z:()=>G,bc:()=>z,sA:()=>rn,MG:()=>nn,PL:()=>Je,nI:()=>Rt,PZ:()=>Me,N_:()=>De,r5:()=>Z,uc:()=>Xe,pG:()=>Ie,QB:()=>ze,R6:()=>Mn,Ll:()=>D,wk:()=>O,xP:()=>on,uz:()=>F,ag:()=>en,Tc:()=>vt,Hf:()=>In,_A:()=>ot,NU:()=>cn,hW:()=>an,wB:()=>$,id:()=>k,MC:()=>T,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){switch(t){case s.string:case s.number:case s.boolean:return!0}return!1}function i(t){switch(t?.tagJsType){case a.dom:case a.tag:case a.templater:return!0}return!1}function l(t){const e=t?.tagJsType;return e===a.tagComponent||e===a.stateRender}function p(t){return d(t)&&typeof t.subscribe===c.function}function f(t){return t&&g(t.then)}function g(t){return typeof t===c.function}function d(t){return typeof t===c.object&&null!==t}function h(t){return Array.isArray(t)}function b(t){const e=new v;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 m(t,e,n){const r=v.globalSubCount$;v.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=v.globalSubCount$;v.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 y(t,e,n){const r=[...e],o=r.shift(),s=t=>{if(r.length)return y(t,r,n);n(t)};let c=s;const a=o(t,{setHandler:t=>c=t,next:s});c(a)}class v{value;onSubscription;methods=[];isSubject=!0;subscribers=[];subscribeWith;constructor(t,e){this.value=t,this.onSubscription=e}subscribe(t){const e=m(0,t,this.subscribers),n=this.subscribeWith;if(n){if(this.methods.length){const n=t;t=t=>{y(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)=>{e.unsubscribe(),t(n)}));return this}pipe(...t){const e=new v(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 b(t.map((t=>{if(p(t))return t;return new v(t,(e=>(e.next(t),e)))})))}static globalSubCount$=new v(0)}class w extends v{value;onSubscription;_value;constructor(t,e){super(t,e),this.value=t,this.onSubscription=e,this._value=t,C(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 C(t){Object.defineProperty(t,"value",{set(e){t._value=e,t.emit()},get:()=>t._value})}class S extends v{value;constructor(t){super(t),this.value=t}subscribe(t){const e=super.subscribe(t);return t(this.value,e),e}}class j extends v{value;constructor(t){super(t),this.value=t,this._value=t,C(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function k(t){return(e,n)=>{n.setHandler((()=>{})),t(e,n.next)}}function T(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 x(){const t=D.stateConfig,e=t.rearray[t.stateArray.length];return t.stateArray.push(e),e.defaultValue}function E(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 R(r)},defaultValue:n};return e.stateArray.push(r),n}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(O)}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=E,e.handlers.letHandler=I,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=x,e.handlers.letHandler=_,e.handlers.statesHandler=V,e.support=t}class N{}function R(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 I(t){const e=D.stateConfig,n=typeof t===c.function?t():t,r={get:function(){return R(r)},defaultValue:n};return e.stateArray.push(r),M(n,r)}function _(){const t=D.stateConfig,e=t.rearray[t.stateArray.length],n=R(e),r={get:function(){return R(r)},defaultValue:e.defaultValue};return t.stateArray.push(r),M(n,r)}function M(t,e){return function(n){return e.callback=n,t}}const D={stateConfig:{stateArray:[],version:Date.now(),handlers:{handler:E,letHandler:I,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),H=t=>t;const B=(t,e,{init:n,before:r,final:o=H}={})=>{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 U(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((()=>sn())),r=O((()=>new S(void 0))),o=O((()=>({stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}))),s=(t,s)=>(B(t,((t,e)=>{const c=sn(),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,U((()=>s),s),s}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function F(t,e){const n=O((function(){return{stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}})),r=sn();return O((function(){return new v(t,e).pipe((t=>(L(r.state,n.stateArray,r.states,n.states),t)))}))}function z(t){return D.stateConfig.handlers.letHandler(t)}function G(t){return e=>{let n=z(t)(e);return $([t],(()=>e(n=t))),e(n),n}}U((()=>function(t){const e=(e,n)=>B(e,n,t);return e.setup=t,U((()=>e),e),e}({})),$),F._value=t=>{const e=O((function(){return{stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}})),n=sn();return O((function(){return new S(t).pipe((t=>(L(n.state,e.stateArray,n.states,e.states),t)))}))},F.all=function(t){const e=O((()=>({stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}))),n=sn();return v.all(t).pipe((t=>(L(n.state,e.stateArray,n.states,e.states),t)))};const Z={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=sn(),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 X extends Error{details;constructor(t,e,n={}){super(t),this.name=X.name,this.details={...n,errorCode:e}}}class q extends X{constructor(t,e){super(t,"array-no-key-error",e),this.name=q.name}}class Q extends X{constructor(t,e){super(t,"state-mismatch-error",e),this.name=Q.name}}class Y extends X{constructor(t,e){super(t,"sync-callback-error",e),this.name=Y.name}}function K(t,e){return tt(t,e)}function tt(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=h(t)?[]:Object.create(Object.getPrototypeOf(t));if(h(t))for(let r=0;r<t.length;r++)n[r]=tt(t[r],e-1);else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=tt(t[r],e-1));return n}function et(t,e,n){return nt(t,e,n)}function nt(t,e,n){return!(t!==e&&(r=t,o=e,!g(r)||!g(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():h(t)&&h(e)?function(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!nt(t[r],e[r],n-1))return!1;return!0}(t,e,n-1):!h(t)&&!h(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)||!nt(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var r,o}function rt(t,e){const n={propWatch:t,props:e,tagJsType:a.templater,key:function(t){return n.arrayValue=t,n}};return n}const ot=[];function st(t){return t.map(ct)}function ct(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 st(n.values)}return h(t)?st(n):K(t,e)}function at(t,e,n){const r={templater:t,subject:e,castedProps:n,state:[],states:[],appSupport:void 0};r.appSupport=r;const o=e.global;o.blocked=[],o.destroy$=new v;const s=t.props;return s&&(r.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=>ct(t,kt))),castProps:n}}return t.propsConfig={latest:e.map((t=>ct(t,Tt))),castProps:n}}}(r,s,n)),r}function ut(t,e,n,r,o){const s=at(t,r,o);return s.ownerSupport=e,s.appSupport=n,s}function it(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 lt(t,e,n){return t.map((t=>function(t,e,n,r){if(i(t)||!t)return t;if(!e)return t;return pt(t,e,n,r)}(t,e.ownerSupport,e,n)))}function pt(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===sn(),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=Ze(t.templater);if(r){return qe(e,t)}const o=n.global;o.locked=!0,Ge(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 gt(t)?t:h(t)?function(t,e,n,r){for(let o=t.length-1;o>=0;--o){const s=t[o];if(t[o]=pt(s,n,e,r+1),typeof s===c.function){if(s.mem)continue;ft(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=pt(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;ft(r+1,s,o,t,e)}}return t}(t,n,e,r)}function ft(t,e,n,r,o){if(t>0){const t=o.subject.global;r[e].subscription=t.destroy$.toCallback((function(){r[e]=n}))}}function gt(t){return typeof t!==c.object||!t||t.tagJsType}function dt(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 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=He(e,n,n.ownerSupport,o,r));return c||lt(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=rt(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=ut(t,c,n.appSupport,r,s);return dt(t,e,a,s)}}(o,n);return s.original=t,o.wrapper=s,o},r=t;return n.original=t,r.tags=ot,r.setUse=D,r.ValueTypes=a,r.tagIndex=mt++,ot.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=Qe(t,e);if(r)return 11;switch(n){case yt.NONE:return 1;case yt.SHALLOW:return jt(t,e);case yt.IMMUTABLE:return St(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])=>At(r,n[t],(()=>{delete e[t],delete n[t]}))));return r}return At(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 St(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(h(n)&&h(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(!xt(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:ot},t.tagJsType=a.stateRender}}),Object.defineProperty(vt,"use",{set(t){t.original={setUse:D,tags:ot},t.tagJsType=a.stateRender}});const kt=3,Tt=10;function At(t,e,n){if(typeof t!==c.function)return!!et(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 xt([t,e],n){const r=n[t];return typeof e===c.function&&typeof r===c.function||r===e}let Et=[],Ot=[],Pt=[],Vt=[],Jt=[],Wt=[];const Nt={locks:0};function Rt(){if(!(Nt.locks>0)){++Nt.locks;for(const t of Et){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();Et=[],Ot=[],Vt=[],Jt=[],Wt=[],Pt=[],--Nt.locks}}function It(t,e){const n=document.createTextNode(t);return Jt.push({element:n,relative:e}),n}function _t(t){switch(t){case void 0:case!1:case null:return o}return t}function Mt(t,e,n){Ot.push((()=>{void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}))}function Dt(t,e,n,r){switch(r){case"oninit":case"init":return void Wt.push((()=>{e({target:n,stagger:0})}));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 Lt(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 $t(t,e=[]){const n=t.subject.global,r=Ze(t.templater),o=t.ownerSupport;if(n.locked)return e.push(t),e;if(r)return $t(o,e);const s=t,c=l(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(Qe(n,o))return!0;switch(t.propWatch){case yt.IMMUTABLE:return St(n,o);case yt.SHALLOW:return jt(n,o)}return!et(n,o,Tt)}(e,n);if(t&&r)return!0;return!1}(o,s.templater,s)),p=function(t){const e=t.subject.global.providers;if(!e)return[];const n=[];for(const t of e){const e=Lt(t.owner,t);n.push(...e.map((t=>t.support)))}return n}(s);return e.push(...p),i?($t(o,e),c&&e.push(s),e):(e.push(s),e)}function Ht(t){++Nt.locks,t.forEach(Bt),--Nt.locks,Rt()}function Bt(t){const e=t.subject.global;e&&Xe(e.newest)}const Ut="no-data-ever",Ft="promise-no-data-ever";function zt(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&&!l(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 Ht($t(t)),function(t,e,n){if(f(t)){return e.subject.global.locked=!0,t.then((()=>{if(!0===n.deleted)return Ft;delete e.subject.global.locked;return Ht($t(e)),Ft}))}return Ut}(e,t,n)}(e,t,n)}(c,o)}(r.tagFunction,r.support,t,e)};return r.tagFunction=t,r.support=e,r}function Gt(t,e,n,r,o){if(o)return Dt(t,e,n,o);r(n,t,e)}function Zt(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,Xt(t,s,t.target)};c[e]=t,o.addEventListener(e,t)}n[s]=r,n[e]=r}function Xt(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&&Xt(t,e,o)}function qt(t,e,n,r){const o=function(...e){return o.tagFunction(t,e)};o.tagFunction=e,o.support=n,Zt(n.appSupport,r,t,o)}function Qt(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"}return!1}(t);return!1!==e||!!t.startsWith("style.")&&"style"}function Yt(t,e,n,r,o,s,a,u){const i=re(e);if(i>=0){const e=t[i],c=ue(e,s,!0);return c.isAttr=!0,c.element=n,c.howToSet=o,c.isNameOnly=!0,void Kt(t,e,n,r,o,s)}const l=re(a);if(l>=0){const a=t[l],i={isAttr:!0,element:n,attrName:e,checkValueChange:Pe,withinOwnerElement:!0};s.push(i);return p(i.value)?function(t,e,n,r,o,s){s&&Ot.push((function(){n.removeAttribute(t)}));const c=e.value;if(p(c)){const a=function(c){te(c,t,e,n,r,o,s)},u=c.subscribe(a),i=e.global;(i.subscriptions=i.subscriptions||[]).push(u)}return void te(e.value,t,e,n,r,o,s)}(e,i,n,r,o,u):(function(t,e,n,r,o,s,a){n.attrName=t,n.element=r,n.howToSet=o,typeof e===c.function?a&&"init"===t?Dt(t,e,r,t):ne(n,e,s,t,r):(n.attrName=t,n.element=r,n.howToSet=o,n.isSpecial=a,Gt(t,e,r,o,a))}(e,a,i,n,o,r,u),void(i.value=a))}return Gt(e,a,n,o,u)}function Kt(t,e,n,r,s,a){if(!oe(e))if(typeof e!==c.object)0!==e.length&&s(n,e,o);else for(const o in e){Yt(t,o,n,r,s,a,e[o],Qt(o))}}function te(t,e,n,r,o,s,c){return g(t)?function(t,e,n,r,o,s,c){const u=t.templater.wrapper;if((u?.tagJsType||u?.original?.tagJsType)!==a.renderOnce)return ne(c,e,t,r,n);return ee(e,n,r,o,s,t)}(o,t,r,e,c,s,n):ee(t,r,e,c,s,o)}function ee(t,e,n,r,o,s){if(g(t))return qt(e,t,s,n);if(r)Dt(n,t,e,r);else{switch(t){case void 0:case!1:case null:return void Ot.push((function(){e.removeAttribute(n)}))}o(e,n,t)}}function ne(t,e,n,r,o){const s=t.value;return s&&s.tagFunction&&s.support?(s.tagFunction=e,s.support=n,s):qt(o,e=zt(e,n),n,r)}function re(t){return d(t)&&"tagJsVar"in t?t.tagJsVar:-1}function oe(t){return null==t||!1===t}function se(t,e,n,r,o,s,c,a,u=[]){const i=document.createElement("div"),l=[];for(const p of t){const t={};l.push(t);const f=p.v;if(!isNaN(f)){ce(e,o,c,n,u,r,s);continue}if("text"===p.nn){const n=t,r=n.tc=p.tc;i.innerHTML=r;const s=n.domElement=document.createTextNode(i.innerText);s.id=`tp_${o.length}_${e.length}`,c?Vt.push({element:s,relative:c}):Jt.push({element:s,relative:a});continue}const g=t.domElement=document.createElement(p.nn);p.at&&p.at.map((t=>{const r=t[0],s=t[1],c=t[2];Yt(e,r,g,n,Mt,o,s,c)})),c?Vt.push({element:g,relative:c}):Jt.push({element:g,relative:a}),p.ch&&(t.ch=se(p.ch,e,n,r,o,s+1,g,a,u).dom)}return{subs:u,dom:l,context:o}}function ce(t,e,n,r,s,c,a){const u=t[e.length],i=document.createTextNode(o);i.id=`dvp_${e.length}_${t.length}`;const l=ue(u,e,a>0);if(l.placeholder=i,n?Vt.push({relative:n,element:i}):Jt.push({element:i,relative:r.subject.placeholder}),p(u))return void s.push({insertBefore:i,appendTo:n,subject:u,support:r,counts:c,contextItem:l});r.subject.global.locked=!0,Me(u,l,r,c,`rvp_${e.length}_${t.length}`,n);delete r.subject.global.locked,l.value=u}function ae(t,e,n,r){const o=t.subject.global;o.oldest=t,o.newest=t,++Nt.locks;const s=function(t,e={counts:{added:0,removed:0}},n,r){const o=function(t){const e=t.templater,n=e.tag;if(n.tagJsType===a.dom)return n.dom;return Wn(n.strings,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.counts,u,0,n,r);return l}(t,r,e,n);return o.htmlDomMeta=s.dom,--Nt.locks,s}function ue(t,e,n){const r={value:t,checkValueChange:Pe,withinOwnerElement:n};return e.push(r),r}function ie(t,e){const n=e.global.newest;n.ownerSupport=t,e.checkValueChange=Ve;const r=ae(n,void 0,e.placeholder,{counts:{added:0,removed:0}});for(const t of r.subs)Le(t);return n}function le(){return{tagJsType:a.templater}}function pe(t,e,n){const r=it(t,e,e.appSupport,n);return n.global.context=[],r}function fe(t,e,n,r){if(n.isNameOnly)return function(t,e,n,r,o,s,a){if(n){if(oe(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)}))}Kt(t,e,r,o,s,a)}(t,e,n.value,n.element,r,n.howToSet,[]),void(n.value=e);const o=n.element;te(e,n.attrName,n,o,r,n.howToSet,n.isSpecial),n.value=e}function ge(t,e,n,r){const o=t[e],s=n[e];if(!p(o)){if(s.isAttr){if(o===s.value)return;fe(t,o,s,r),s.value=o}he(s,o,r),s.value=o}}function de(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;)ge(n,r,e,t),++r}(t,n),--Nt.locks,Rt()}function he(t,e,r){if(e===t.value)return;const o=t.checkValueChange(e,t);if(-1===o)return;const s=e&&e.tagJsType;if(s){if(s===a.renderOnce)return;if(l(e))return t.global||n(t),void function(t,e,r){const o=e.global;if(!o.newest)return void $e(t,e,r,{added:0,removed:0});const s=ut(t,r,r.appSupport,e);!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||xe(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;Ce(s,0),n(t);const c=$e(e,t,r,{added:0,removed:0})}(r,f,t);const g=p||Ct(s,f);if(!g){return void function(t,e,n,r,o){const s=t.props,c=He(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);Xe(e)}(r,s,e)}(e,t,r)}const u=t.global;if(u){const n=u.newest;if(n)return void function(t,e,n,r){if(typeof n===c.function)return;!function(t,e,n,r){const o=n.templater||n,s=ut(o,r,r.appSupport,e),c=t.subject.global;de(c.oldest,s)}(t,e,n,r)}(n,t,e,r)}if(s)switch(s){case a.templater:return void ie(r,t);case a.tag:case a.dom:{const o=e;let s=o.templater;s||(s=le(),o.templater=s,s.tag=o);return(t.global?t.global:n(t)).newest=pe(s,r,t),void ie(r,t)}}h(e)?Se(t,e,r,{added:0,removed:0}):typeof e!==c.function?o&&function(t,e){e.checkValueChange=Pe;const n=e.placeholder,r=_t(t);e.simpleValueElm=It(r,n)}(e,t):t.value=e}function be(t,e,r){r.checkValueChange=Ve;const o=t;let s=o.templater;s||(s=rt(yt.DEEP),s.tag=o,o.templater=s);const c=r.global=n(r),a=c.newest=ut(s,e,e.appSupport,r);return c.oldest=a,r}function me(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)}t.subject.renderCount=0}function ye(t){for(const e of t){const t=e.lastArray;if(t){ye(t);continue}const n=e.global;if(!n)continue;const r=n.newest,o=n.subscriptions;o&&o.forEach((t=>t.unsubscribe())),l(r.templater)&&me(r);ye(n.context)}}function ve(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&&ve(s,e,n)}return{tags:e,subs:n}}function we(t,e,n){const r=n,o=t.subject.global,s=o.htmlDomMeta,c=o.context;o.deleted=!0;for(const t of c){if(t.withinOwnerElement)continue;const r=t.lastArray;if(r){Oe(t,r);continue}const o=t.simpleValueElm;if(o){delete t.simpleValueElm,Et.push(o);continue}const s=t.global;if(void 0===s)continue;if(!0===s.deleted)continue;s.deleted=!0;const c=s.oldest;c&&(n+=we(c,e,n))}return function(t,e,n){const r=t.map((t=>{const n=t.marker;n&&Et.push(n);const r=t.domElement;if(r)return function(t,e){const n=t;if(n.ondestroy){const r=function(t,e){const n=t.ondestroy.tagFunction;if(!n)return;return(0,n.tagFunction)({target:t,stagger:e})}(n,e);if(f(r))return r.then((()=>{Et.push(t),Rt()}))}Et.push(t)}(r,e)})).filter((t=>t));if(r.length)return n.push(Promise.all(r)),e}(s,r,e),n}function Ce(t,e){const n=t.subject.global;n.deleted=!0,t.subject.renderCount=0;ye(n.context),n.destroy$&&(n.destroy$.next(),me(t));const r=[];return e=we(t,r,e),r.length?Promise.all(r).then((()=>e)):e}function Se(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=Ae(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=je(e,t,u,n,c,r,i).placeholder}}function je(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 he(e,t,r),e;const i=ke(t,s,r,c,n,a);return i}(a,u,n,r,e,o,s,c):ke(a,o,r,s,n,c)}function ke(t,e,n,r,o,s){const c={value:t,checkValueChange:Pe,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:be(t.tag,e,n);break;case a.tag:case a.dom:be(t,e,n)}}(t,n,c),Me(t,c,n,r,`rvp_${o.length}_array`,s),c.value=t,o.push(c),s&&Vt.push({element:u,relative:s}),c}function Te(t,e){const n=t.global;if(n){const t=n.oldest;n.deleted=!0,Ce(t,e.removed),n.deleted=!0}else{const e=t.simpleValueElm;delete t.simpleValueElm,Et.push(e)}++e.removed}function Ae(t,e,n,r,o,s){const c=e.length-1,a=n-o,u=a<0||c<a,i=r[n];return u?(Te(i,s),++o,1):r[n].value.arrayValue!==e[n].arrayValue?(Te(i,s),r.splice(n,1),++o,2):0}function xe(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 Ee(t,e){if(!h(t)){return Oe(e,e.lastArray),9}return!1}function Oe(t,e){const n={added:0,removed:0};for(let t=0;t<e.length;++t)Te(e[t],n);delete t.lastArray}function Pe(t,e){if(null==t||typeof t!==c.object)return function(t,e){const n=_t(t),r=e.simpleValueElm;Pt.push([n,r])}(t,e),-1;const n=e.simpleValueElm;return delete e.simpleValueElm,Et.push(n),6}function Ve(t,e){const r=e.global,o=r?.newest;if(i(t)){return!xe(t,o)&&(Ce(o,0),n(e),7)}const s=t?.tagJsType;return!s&&(Ce(o,0),delete e.global,e.renderCount=0,8)}function Je(t,e,n){const r=rt(yt.DEEP);r.tagJsType=t.tagJsType;const o=pe(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 We(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(Ne,c),a}(n,e,t)}D.tagClosed$=new v(void 0,(function(t){sn()||t.next()}));const Ne="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 Re(t,e){const n=t.subject;++n.renderCount;const r=D.stateConfig;delete r.support,t.state=r.stateArray,D.tagClosed$.next(e),We(r,t),n.global.newest=t}function Ie(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=dt(i,i,ut(i,r,t.appSupport,n)),l.states=t.states}else{l=(0,i.wrapper)(t,n,e),l.states=t.states}return Re(l,r),n.renderCount>s+1?o.newest:l}function _e(t,e,n,r){n.checkValueChange=Ve;const o=pe(t,e,n);o.ownerSupport=e;const s=ae(o,r,void 0,{counts:{added:0,removed:0}});for(const t of s.dom)t.marker&&Vt.push({element:t.marker,relative:r}),t.domElement&&Vt.push({element:t.domElement,relative:r});let c=-1;const a=s.subs.length-1;for(;c++<a;){Le(s.subs[c])}return o}function Me(t,e,r,o,s,c){const u=t?.tagJsType;if(u)switch(u){case a.templater:return e.checkValueChange=Ve,c?_e(t,r,e,c):ie(r,e);case a.dom:case a.tag:{e.checkValueChange=Ve;const o=t;let s=o.templater;s||(s=function(t){const e=le();return e.tag=t,t.templater=e,e}(o));const a=n(e);return c?_e(s,r,e,c):(a.newest=pe(s,r,e),e.checkValueChange=Ve,ie(r,e))}case a.stateRender:case a.tagComponent:if(n(e),e.checkValueChange=Ve,c){const n=function(t,e,n,r,o){const s=ut(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}=ze(s,u.newest,e,n);return function(t,e,n){let r=Vt.length;const o=ae(t,n,void 0,{counts:e});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)Le(t)}(i,r,o),i}(t,e,r,o,c);return n}return $e(t,e,r,o);case a.renderOnce:{n(e);const o=Je(t,e,r);Ie(o,void 0,e,r);const s=_e(o.templater,r,e,c);return e.checkValueChange=Ve,s}}if(h(t))return Se(e,t,r,o,c),void(e.checkValueChange=Ee);p(t)||function(t,e,n,r){const o=_t(t),s=It(o,n);s.id=r,e.simpleValueElm=s,e.checkValueChange=Pe}(t,e,e.placeholder,s)}function De(t,e,n){t!==e.value&&(he(e,t,n),D.stateConfig.support||Rt())}function Le({subject:t,support:e,counts:n,contextItem:r,appendTo:o}){let s=function(t){Me(t,r,e,{...n},`rvp_-1_${e.templater.tag?.values.length}`,c?o:void 0),c||D.stateConfig.support||Rt(),s=function(t){De(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 $e(t,e,n,r){const o=ut(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}=ze(o,c.newest,e,n);return function(t,e,n){n.checkValueChange=Ve;const r=ae(t,void 0,n.placeholder,{counts:e}).subs;for(const t of r)Le(t)}(u,r,e),u}function He(t,e,n,r,o,s=-1){const c=e.subject.global.newest;if(!c){const e=lt(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=Be(a[e],c,t,n,s+1,o);u.push(i)}return t.propsConfig.castProps=u,u}function Be(t,e,n,r,o,s){return typeof t===c.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):s===o||gt(e)?e:h(e)?function(t,e,n,r,o){for(let s=t.length-1;s>=0;--s){const c=t[s];t[s]=Be(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=Be(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 Ue(t){const e=t.subject.global,{subs:r,tags:o}=ve(e.context);Fe(t);for(const t of o)Fe(t);e.subscriptions&&r.forEach((t=>t.unsubscribe())),n(t.subject)}function Fe(t){const e=t.subject,n=e.global;!0!==n.deleted&&(n.deleted=!0,e.renderCount=0,we(t,[],0))}function ze(t,e,n,r){const o=e?.templater,s=o?.tag,c=Ie(t,e,n,r),u=!e||xe(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&&Ue(e))}if(n){const r=n.strings;if(r){const n=r?.length;n!==t.strings.length&&Ue(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),Ue(e);const t=c.subject.global;t.oldest=c,t.newest=c}const i=e?.ownerSupport;return c.ownerSupport=r||i,{support:c,wasLikeTags:u}}function Ge(t,e,n,r){const o=r.global,{support:s,wasLikeTags:c}=ze(e,t,r,n);return c?(de(o.oldest,s),s):(ie(n,r),s)}function Ze(t){return a.templater===t.tagJsType}function Xe(t){const e=t.subject.global,n=Ze(t.templater),r=t.ownerSupport;if(e.locked)return e.blocked.push(t),t;if(n)return qe(r,t);e.locked=!0;const o=t.subject;e.blocked.length&&(t=e.blocked.pop(),e.blocked=[]),delete e.locked;return Ge(e.newest,t,r,o)}function qe(t,e){const n=t.subject.global;if(!n||!0===n.deleted)return e;return Xe(n.newest||t)}function Qe(t,e){return t.length!==e.length}function Ye(t){const e=sn();if(!e)throw en;return Ke(e,D.stateConfig,t)}function Ke(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),Xe(t),f(c)&&c.finally((()=>{L(n.stateArray,s,n.states,t.states),Xe(t)})),c}(t,n,{stateArray:r,states:o},...e):n(...e)}}const tn=()=>{const t=sn();if(!t)throw en;const e=D.stateConfig;return function(n){return Ke(t,e,n)}},en=new Y("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function nn(t){O(t)}function rn(t){O((function(){sn().subject.global.destroy$.toCallback(t)}))}function on(t){return D.stateConfig.handlers.statesHandler(t)}function sn(){return D.stateConfig.support}const cn=":tagvar",an=":";function un(t,e){const n={values:e,ownerSupport:sn(),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 ln(t,e){const n={values:e,ownerSupport:sn(),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 pn="ondoubleclick",fn=/(:tagvar\d+:)/,gn=/(^:tagvar\d+:|:tagvar\d+:$)/g,dn="__safeTagVar",hn=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,bn=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function mn(t,e){yn(t,e);const n=function(t){const e=[],n=[],r=[];let o=null,s=-1,c=0;const a=new RegExp(bn,"g");t=function(t){return t.replace(Cn,(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("</"),g=i.endsWith("/>");if(c<u.index){const e=t.slice(c,u.index);if(e.trim()){vn(e).forEach((t=>{t.startsWith(cn)&&(t=cn+ ++s+an),wn(o,n,t)}))}}if(c=u.index+i.length,f){o=r.pop()||null;continue}const d=[];let h;for(;null!==(h=hn.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")?jn(c):c;if(o){if(t.slice(0,cn.length)===cn){const t=cn+ ++s+an;e.push(["at",t]),d.push([t]);continue}if(h[0].startsWith(t)&&h[0].slice(t.length,h[0].length).search(/\s+$/)>=0){d.push([a]);continue}n=cn+ ++s+an}r||(n=h[2]);const u=[a,n],i=Qt(c);i&&u.push(i),d.push(u)}const b={nn:l};d.length&&(b.at=d),o?(o.ch||(o.ch=[]),o.ch.push(b)):n.push(b),g||(r.push(o),o=b)}if(c<t.length){const e=t.slice(c);if(e.trim()){vn(e).forEach((t=>(t.startsWith(cn)&&++s,wn(o,n,t))))}}return n}(yn(t,e).join(""));return n}function yn(t,e){return function(t,e){const n=t.map(((t,n)=>n<e.length?t+cn+n+an:t));return function(t,e,n){const r=n.length-e.length;if(r>0)for(let n=r;n>0;--n)t.push(cn+(e.length+n-1)+an)}(n,t,e),n}(t.map((t=>t.replace(gn,((t,e)=>dn+e)))),e)}function vn(t){return t.split(fn).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:Sn(n)})}const Cn=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function Sn(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 jn(t){if(t.startsWith("on")){return t.length===pn.length&&t===pn?"dblclick":t.slice(2,t.length)}return t}const kn=new RegExp(cn+"(\\d+)"+an,"g"),Tn="ch";function An(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=En(t,e)}if(c.ch){const t=c.ch,r=[...s,Tn];c.ch=An(t,e,n,r)}t=xn(c,e,o,t)}return o}function xn(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=kn.exec(a));){const t=c[1],o=parseInt(t,10);if(!isNaN(o)&&o<e){const t=cn+o+an,e=a.slice(c.index+t.length);n.splice(r,1,{nn:"text",v:o}),a=e,kn.lastIndex=0}}return o.tc=a,r}function En(t,e){return t.map((t=>{const[n,r,o]=t;if(n.startsWith(cn)){const t=parseInt(n.replace(cn,""),10);if(!isNaN(t)&&t<e)return[{tagJsVar:t}]}if(typeof r===s.string&&r.startsWith(cn)){const t=parseInt(r.replace(cn,""),10);if(!isNaN(t)&&t<e)return[n,{tagJsVar:t},o]}return t}))}const On="__safeTagVar";const Pn=/__safeTagVar(\d+)/g;function Vn(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(On)){const n=parseInt(e.replace(On,""),10);t[1]=cn+n+an}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(Pn,((t,e)=>cn+e+an))}Vn(n)}0===e.length&&delete t.ch}}const Jn={};function Wn(t,e){const n=function(t){const e=t.map((t=>t.length));return e.push(t.length),Number(e.join(""))}(t),r=Jn[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=An(mn(t,e),e.length);s.forEach(Vn);const c={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:s};return Jn[n]=c,s}function Nn(t,...e){const n=un(t,e),r=rt(yt.NONE);return r.tag=n,n.templater=r,n}Nn.dom=function(t,...e){return ln(t,e)};const Rn=[];function In(t,e,r){const o=Rn.findIndex((t=>t.element===e));o>=0&&(Ce(Rn[o].support,0),Rn.splice(o,1),console.warn("Found and destroyed app element already rendered to element",{element:e}));let s=()=>p(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:Ve,withinOwnerElement:!1,renderCount:0,global:void 0},o=n(r);return o.events={},_n(t,r,e),r}(s,e),i=u.global;J(i.newest,D.stateConfig);let p=t(r);const f=typeof p==c.function;f||(l(p)?(i.newest.propsConfig={latest:[r],castProps:[r]},s.propWatch=p.propWatch,s.tagJsType=p.tagJsType,s.wrapper=p.wrapper,s=p):(s.tag=p,p=t));const g=document.createTextNode("");ot.push(s.wrapper||{original:s});const d=Mn(s,g,e,u,f);i.isApp=!0,f&&(p.tag=d.templater.tag),e.destroy=function(){const t=i.events;for(const n in t){const r=t[n];e.removeEventListener(n,r)}i.events={},Ce(d,0),Rt()},++Nt.locks;const h=ae(d,e);i.oldest=d,i.newest=d;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,Rn.push({element:e,support:d});const m=document.createDocumentFragment();m.appendChild(g);for(const t of h.dom)Dn(t,m);for(const t of h.subs)Le(t);return--Nt.locks,Rt(),e.appendChild(m),{support:d,tags:ot,ValueTypes:a}}function _n(t,e,n){const r=e.global,o=at(t,e);return o.appElement=n,r.oldest=r.oldest||o,r.newest=o,o}function Mn(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=_n(t,r,n);return Re(e),e}const s=dt(t,e,c);return Re(s),s}const i=(0,t.wrapper)(c,r);return Re(i),i}function Dn(t,e){t.domElement&&e.appendChild(t.domElement),t.marker&&e.appendChild(t.marker)}const Ln={tagElement:In,renderWithSupport:ze,renderSupport:Xe,renderTagOnly:Ie,paint:Rt};var $n=e.W9,Hn=e.cg,Bn=e.m0,Un=e.rS,Fn=e.Y2,zn=e.ei,Gn=e.B7,Zn=e.TU,Xn=e.XF,qn=e.PC,Qn=e.Ot,Yn=e.Mj,Kn=e.tD,tr=e.j8,er=e.um,nr=e.E2,rr=e.OH,or=e.TB,sr=e.Ii,cr=e.yV,ar=e.zV,ur=e.ze,ir=e.WJ,lr=e.aZ,pr=e.O,fr=e.Ie,gr=e.B4,dr=e.Az,hr=e.Xi,br=e.pc,mr=e.Ah,yr=e.ck,vr=e.k6,wr=e.Gk,Cr=e.cF,Sr=e.PB,jr=e.qy,kr=e.cy,Tr=e.Tn,Ar=e.Gv,xr=e.yL,Er=e.D8,Or=e.Ze,Pr=e._4,Vr=e.mn,Jr=e.Eb,Wr=e.z,Nr=e.bc,Rr=e.sA,Ir=e.MG,_r=e.PL,Mr=e.nI,Dr=e.PZ,Lr=e.N_,$r=e.r5,Hr=e.uc,Br=e.pG,Ur=e.QB,Fr=e.R6,zr=e.Ll,Gr=e.wk,Zr=e.xP,Xr=e.uz,qr=e.ag,Qr=e.Tc,Yr=e.Hf,Kr=e._A,to=e.NU,eo=e.hW,no=e.wB,ro=e.id,oo=e.MC,so=e.zC;export{$n as ArrayNoKeyError,Hn as BasicTypes,Bn as ImmutableTypes,Un as PropWatches,Fn as RouteQuery,zn as StateMismatchError,Gn as Subject,Zn as Subjective,Xn as SyncCallbackError,qn as TagError,Qn as ValueSubject,Yn as ValueSubjective,Kn as ValueTypes,tr as addOneContext,er as buildBeforeElement,nr as callback,rr as callbackMaker,or as checkArrayValueChange,sr as checkSimpleValueChange,cr as checkTagValueChange,ar as combineLatest,ur as createTrigger,ir as defineValueOn,lr as destroyArray,pr as destroySupport,fr as empty,gr as getBaseSupport,dr as getDomMeta,hr as getDomTag,br as getHtmlSupport,mr as getNewGlobal,yr as getStringTag,vr as getSupport,wr as getTemplaterResult,Cr as hmr,Sr as howToSetInputValue,jr as html,kr as isArray,Tr as isFunction,Ar as isObject,xr as isPromise,Er as isSimpleType,Or as isStaticTag,Pr as isSubjectInstance,Vr as isTagComponent,Jr as key,Wr as letProp,Nr as letState,Rr as onDestroy,Ir as onInit,_r as oneRenderToSupport,Mr as paint,Dr as processFirstSubjectValue,Lr as processSubUpdate,$r as providers,Hr as renderSupport,Br as renderTagOnly,Ur as renderWithSupport,Fr as runWrapper,zr as setUseMemory,Gr as state,Zr as states,Xr as subject,qr as syncError,Qr as tag,Yr as tagElement,Kr as tags,to as variablePrefix,eo as variableSuffix,no as watch,ro as willCallback,oo as willPromise,so 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:()=>yt,Y2:()=>r,ei:()=>Q,B7:()=>v,TU:()=>w,XF:()=>Y,PC:()=>X,Ot:()=>j,Mj:()=>S,tD:()=>a,j8:()=>le,um:()=>ie,E2:()=>sn,OH:()=>an,TB:()=>Ne,Ii:()=>Ie,yV:()=>_e,zV:()=>b,ze:()=>cn,WJ:()=>C,aZ:()=>Re,O:()=>Ee,Ie:()=>o,B4:()=>at,Az:()=>Ln,Xi:()=>mn,pc:()=>it,Ah:()=>n,ck:()=>bn,k6:()=>ut,Gk:()=>rt,cF:()=>Gn,PB:()=>Mt,qy:()=>$n,cy:()=>h,Tn:()=>d,Gv:()=>g,yL:()=>f,D8:()=>u,Ze:()=>i,_4:()=>p,mn:()=>l,Eb:()=>bt,z:()=>G,bc:()=>F,sA:()=>pn,MG:()=>ln,PL:()=>Me,nI:()=>Rt,PZ:()=>Ue,N_:()=>ze,r5:()=>Z,uc:()=>nn,pG:()=>He,QB:()=>Ye,R6:()=>zn,Ll:()=>D,wk:()=>O,xP:()=>fn,uz:()=>z,ag:()=>un,Tc:()=>vt,Hf:()=>Bn,_A:()=>ot,NU:()=>gn,hW:()=>hn,wB:()=>$,id:()=>k,MC:()=>T,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){switch(t){case s.string:case s.number:case s.boolean:return!0}return!1}function i(t){switch(t?.tagJsType){case a.dom:case a.tag:case a.templater:return!0}return!1}function l(t){const e=t?.tagJsType;return e===a.tagComponent||e===a.stateRender}function p(t){return g(t)&&typeof t.subscribe===c.function}function f(t){return t&&d(t.then)}function d(t){return typeof t===c.function}function g(t){return typeof t===c.object&&null!==t}function h(t){return Array.isArray(t)}function b(t){const e=new v;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 m(t,e,n){const r=v.globalSubCount$;v.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=v.globalSubCount$;v.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 y(t,e,n){const r=[...e],o=r.shift(),s=t=>{if(r.length)return y(t,r,n);n(t)};let c=s;const a=o(t,{setHandler:t=>c=t,next:s});c(a)}class v{value;onSubscription;methods=[];isSubject=!0;subscribers=[];subscribeWith;constructor(t,e){this.value=t,this.onSubscription=e}subscribe(t){const e=m(0,t,this.subscribers),n=this.subscribeWith;if(n){if(this.methods.length){const n=t;t=t=>{y(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 v(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 b(t.map((t=>{if(p(t))return t;return new v(t,(e=>(e.next(t),e)))})))}static globalSubCount$=new v(0)}class w extends v{value;onSubscription;_value;constructor(t,e){super(t,e),this.value=t,this.onSubscription=e,this._value=t,C(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 C(t){Object.defineProperty(t,"value",{set(e){t._value=e,t.emit()},get:()=>t._value})}class j extends v{value;constructor(t){super(t),this.value=t}subscribe(t){const e=super.subscribe(t);return t(this.value,e),e}}class S extends v{value;constructor(t){super(t),this.value=t,this._value=t,C(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function k(t){return(e,n)=>{n.setHandler((()=>{})),t(e,n.next)}}function T(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 E(){const t=D.stateConfig,e=t.rearray[t.stateArray.length];return t.stateArray.push(e),e.defaultValue}function x(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 R(r)},defaultValue:n};return e.stateArray.push(r),n}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(O)}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=x,e.handlers.letHandler=I,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=E,e.handlers.letHandler=_,e.handlers.statesHandler=V,e.support=t}class N{}function R(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 I(t){const e=D.stateConfig,n=typeof t===c.function?t():t,r={get:function(){return R(r)},defaultValue:n};return e.stateArray.push(r),M(n,r)}function _(){const t=D.stateConfig,e=t.rearray[t.stateArray.length],n=R(e),r={get:function(){return R(r)},defaultValue:e.defaultValue};return t.stateArray.push(r),M(n,r)}function M(t,e){return function(n){return e.callback=n,t}}const D={stateConfig:{stateArray:[],version:Date.now(),handlers:{handler:x,letHandler:I,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),H=t=>t;const B=(t,e,{init:n,before:r,final:o=H}={})=>{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 U(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((()=>dn())),r=O((()=>new j(void 0))),o=O((()=>({stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}))),s=(t,s)=>(B(t,((t,e)=>{const c=dn(),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,U((()=>s),s),s}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function z(t,e){const n=O((function(){return{stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}})),r=dn();return O((function(){return new v(t,e).pipe((t=>(L(r.state,n.stateArray,r.states,n.states),t)))}))}function F(t){return D.stateConfig.handlers.letHandler(t)}function G(t){return e=>{let n=F(t)(e);return $([t],(()=>e(n=t))),e(n),n}}U((()=>function(t){const e=(e,n)=>B(e,n,t);return e.setup=t,U((()=>e),e),e}({})),$),z._value=t=>{const e=O((function(){return{stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}})),n=dn();return O((function(){return new j(t).pipe((t=>(L(n.state,e.stateArray,n.states,e.states),t)))}))},z.all=function(t){const e=O((()=>({stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}))),n=dn();return v.all(t).pipe((t=>(L(n.state,e.stateArray,n.states,e.states),t)))};const Z={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=dn(),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 X extends Error{details;constructor(t,e,n={}){super(t),this.name=X.name,this.details={...n,errorCode:e}}}class q extends X{constructor(t,e){super(t,"array-no-key-error",e),this.name=q.name}}class Q extends X{constructor(t,e){super(t,"state-mismatch-error",e),this.name=Q.name}}class Y extends X{constructor(t,e){super(t,"sync-callback-error",e),this.name=Y.name}}function K(t,e){return tt(t,e)}function tt(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=h(t)?[]:Object.create(Object.getPrototypeOf(t));if(h(t))for(let r=0;r<t.length;r++)n[r]=tt(t[r],e-1);else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=tt(t[r],e-1));return n}function et(t,e,n){return nt(t,e,n)}function nt(t,e,n){return!(t!==e&&(r=t,o=e,!d(r)||!d(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():h(t)&&h(e)?function(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!nt(t[r],e[r],n-1))return!1;return!0}(t,e,n-1):!h(t)&&!h(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)||!nt(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var r,o}function rt(t,e){const n={propWatch:t,props:e,tagJsType:a.templater,key:function(t){return n.arrayValue=t,n}};return n}const ot=[];function st(t){return t.map(ct)}function ct(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 st(n.values)}return h(t)?st(n):K(t,e)}function at(t,e,n){const r={templater:t,subject:e,castedProps:n,state:[],states:[],appSupport:void 0};r.appSupport=r;const o=e.global;o.blocked=[],o.destroy$=new v;const s=t.props;return s&&(r.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=>ct(t,kt))),castProps:n}}return t.propsConfig={latest:e.map((t=>ct(t,Tt))),castProps:n}}}(r,s,n)),r}function ut(t,e,n,r,o){const s=at(t,r,o);return s.ownerSupport=e,s.appSupport=n,s}function it(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 lt(t,e,n){return t.map((t=>function(t,e,n,r){if(i(t)||!t)return t;if(!e)return t;return pt(t,e,n,r)}(t,e.ownerSupport,e,n)))}function pt(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===dn(),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=en(t.templater);if(r){return rn(e,t)}const o=n.global;o.locked=!0,tn(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 dt(t)?t:h(t)?function(t,e,n,r){for(let o=t.length-1;o>=0;--o){const s=t[o];if(t[o]=pt(s,n,e,r+1),typeof s===c.function){if(s.mem)continue;ft(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=pt(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;ft(r+1,s,o,t,e)}}return t}(t,n,e,r)}function ft(t,e,n,r,o){if(t>0){const t=o.subject.global;r[e].subscription=t.destroy$.toCallback((function(){r[e]=n}))}}function dt(t){return typeof t!==c.object||!t||t.tagJsType}function gt(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 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=Ze(e,n,n.ownerSupport,o,r));return c||lt(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=rt(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=ut(t,c,n.appSupport,r,s);return gt(t,e,a,s)}}(o,n);return s.original=t,o.wrapper=s,o},r=t;return n.original=t,r.tags=ot,r.setUse=D,r.ValueTypes=a,r.tagIndex=mt++,ot.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=on(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])=>At(r,n[t],(()=>{delete e[t],delete n[t]}))));return r}return At(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(h(n)&&h(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"}(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:ot},t.tagJsType=a.stateRender}}),Object.defineProperty(vt,"use",{set(t){t.original={setUse:D,tags:ot},t.tagJsType=a.stateRender}});const kt=3,Tt=10;function At(t,e,n){if(typeof t!==c.function)return!!et(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 Et([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 Rt(){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 It(t,e){const n=document.createTextNode(t);return Jt.push({element:n,relative:e}),n}function _t(t){switch(t){case void 0:case!1:case null:return o}return t}function Mt(t,e,n){Ot.push((()=>{void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}))}function Dt(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 Lt(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 $t(t,e=[]){const n=t.subject.global,r=en(t.templater),o=t.ownerSupport;if(n.locked)return e.push(t),e;if(r)return $t(o,e);const s=t,c=l(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(on(n,o))return!0;switch(t.propWatch){case yt.IMMUTABLE:return jt(n,o);case yt.SHALLOW:return St(n,o)}return!et(n,o,Tt)}(e,n);if(t&&r)return!0;return!1}(o,s.templater,s)),p=function(t){const e=t.subject.global.providers;if(!e)return[];const n=[];for(const t of e){const e=Lt(t.owner,t);n.push(...e.map((t=>t.support)))}return n}(s);return e.push(...p),i?($t(o,e),c&&e.push(s),e):(e.push(s),e)}function Ht(t){++Nt.locks,t.forEach(Bt),--Nt.locks,Rt()}function Bt(t){const e=t.subject.global;e&&nn(e.newest)}const Ut="no-data-ever",zt="promise-no-data-ever";function Ft(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&&!l(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 Ht($t(t)),function(t,e,n){if(f(t)){return e.subject.global.locked=!0,t.then((()=>{if(!0===n.deleted)return zt;delete e.subject.global.locked;return Ht($t(e)),zt}))}return Ut}(e,t,n)}(e,t,n)}(c,o)}(r.tagFunction,r.support,t,e)};return r.tagFunction=t,r.support=e,r}const Gt=["init","destroy"];function Zt(t,e,n,r,o,s,c){if(c)return Dt(t,e,n,c,s,o);r(n,t,e)}function Xt(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,qt(t,s,t.target)};c[e]=t,o.addEventListener(e,t)}n[s]=r,n[e]=r}function qt(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&&qt(t,e,o)}function Qt(t,e,n,r){const o=function(...e){return o.tagFunction(t,e)};o.tagFunction=e,o.support=n,Xt(n.appSupport,r,t,o)}function Yt(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"}function Kt(t,e,n,r,o,s,a,u,i){const l=oe(e);if(l>=0){const e=t[l],c=le(e,s,!0);return c.isAttr=!0,c.element=n,c.howToSet=o,c.isNameOnly=!0,void te(t,e,n,r,o,s,u)}const f=oe(i);if(f>=0){const i=t[f],l={isAttr:!0,element:n,attrName:e,checkValueChange:Ie,withinOwnerElement:!0};s.push(l);return p(l.value)?function(t,e,n,r,o,s,c){s&&Ot.push((function(){n.removeAttribute(t)}));const a=e.value;if(p(a)){const u=function(a){ee(a,t,e,n,r,o,s,c)},i=a.subscribe(u),l=e.global;(l.subscriptions=l.subscriptions||[]).push(i)}return void ee(e.value,t,e,n,r,o,s,c)}(e,l,n,r,o,a,u):(function(t,e,n,r,o,s,a,u){n.attrName=t,n.element=r,n.howToSet=o,typeof e===c.function?u&&Gt.includes(t)?Dt(t,e,r,t,s,a):re(n,e,s,t,r):(n.attrName=t,n.element=r,n.howToSet=o,n.isSpecial=u,Zt(t,e,r,o,a,s,u))}(e,i,l,n,o,r,u,a),void(l.value=i))}return Zt(e,i,n,o,u,r,a)}function te(t,e,n,r,s,a,u){if(!se(e))if(typeof e!==c.object)0!==e.length&&s(n,e,o);else for(const o in e){const c=e[o];Kt(t,o,n,r,s,a,Yt(o),u,c)}}function ee(t,e,n,r,o,s,c,u){return d(t)?function(t,e,n,r,o,s,c,u){const i=t.templater.wrapper;if((i?.tagJsType||i?.original?.tagJsType)!==a.renderOnce)return re(c,e,t,r,n);return ne(e,n,r,o,s,t,u)}(o,t,r,e,c,s,n,u):ne(t,r,e,c,s,o,u)}function ne(t,e,n,r,o,s,c){switch(t){case void 0:case!1:case null:return void Ot.push((function(){e.removeAttribute(n)}))}if(!1===r)return d(t)?Qt(e,t,s,n):void o(e,n,t);Dt(n,t,e,r,s,c)}function re(t,e,n,r,o){const s=t.value;return s&&s.tagFunction&&s.support?(s.tagFunction=e,s.support=n,s):Qt(o,e=Ft(e,n),n,r)}function oe(t){return g(t)&&"tagJsVar"in t?t.tagJsVar:-1}function se(t){return null==t||!1===t}const ce="object"==typeof document&&document.createElement("div");function ae(t,e,n,r,o,s,c,a,u=[]){const i=[];for(const l of t){const t={};i.push(t);const p=l.v;if(!isNaN(p)){ue(e,o,c,n,u,r,s);continue}if("text"===l.nn){const n=t,r=n.tc=l.tc;ce.innerHTML=r;const s=n.domElement=document.createTextNode(ce.innerText);s.id=`tp_${o.length}_${e.length}`,c?Vt.push({element:s,relative:c}):Jt.push({element:s,relative:a});continue}const f=t.domElement=document.createElement(l.nn);l.at&&l.at.map((t=>{const s=t[0],c=t[1],a=t[2]||!1;Kt(e,s,f,n,Mt,o,a,r,c)})),c?Vt.push({element:f,relative:c}):Jt.push({element:f,relative:a}),l.ch&&(t.ch=ae(l.ch,e,n,r,o,s+1,f,a,u).dom)}return{subs:u,dom:i,context:o}}function ue(t,e,n,r,s,c,a){const u=t[e.length],i=document.createTextNode(o);i.id=`dvp_${e.length}_${t.length}`;const l=le(u,e,a>0);if(l.placeholder=i,n?Vt.push({relative:n,element:i}):Jt.push({element:i,relative:r.subject.placeholder}),p(u))return void s.push({insertBefore:i,appendTo:n,subject:u,support:r,counts:c,contextItem:l});r.subject.global.locked=!0,Ue(u,l,r,c,`rvp_${e.length}_${t.length}`,n);delete r.subject.global.locked,l.value=u}function ie(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 Ln(n.strings,n.values)}(t),s=t.templater.tag,c=s.values,u=[],i=t.subject.global;i.context=u;const l=ae(o,c,t,e,u,0,n,r);return l}(t,e,n,r);return o.htmlDomMeta=s.dom,--Nt.locks,s}function le(t,e,n){const r={value:t,checkValueChange:Ie,withinOwnerElement:n};return e.push(r),r}function pe(t,e,n){const r=e.global.newest;r.ownerSupport=t,e.checkValueChange=_e;const o=ie(r,n,void 0,e.placeholder);for(const t of o.subs)Fe(t);return r}function fe(){return{tagJsType:a.templater}}function de(t,e,n){const r=it(t,e,e.appSupport,n);return n.global.context=[],r}const ge={added:0,removed:0};function he(t,e,n,r){if(n.isNameOnly)return function(t,e,n,r,o,s,a,u){if(n){if(se(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)}))}te(t,e,r,o,s,a,u)}(t,e,n.value,n.element,r,n.howToSet,[],ge),void(n.value=e);const o=n.element;ee(e,n.attrName,n,o,r,n.howToSet,n.isSpecial,ge),n.value=e}function be(t,e,n,r){const o=t[e],s=n[e];if(!p(o)){if(s.isAttr){if(o===s.value)return;he(t,o,s,r),s.value=o}ve(s,o,r),s.value=o}}function me(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;)be(n,r,e,t),++r}(t,n),--Nt.locks,Rt()}const ye={added:0,removed:0};function ve(t,e,r){if(e===t.value)return;const o=t.checkValueChange(e,t);if(-1===o)return;const s=e&&e.tagJsType;if(s){if(s===a.renderOnce)return;if(l(e))return t.global||n(t),void function(t,e,r){const o=e.global;if(!o.newest)return void Ge(t,e,r,{added:0,removed:0});const s=ut(t,r,r.appSupport,e);!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||We(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;Ee(s),n(t);const c=Ge(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=Ze(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);nn(e)}(r,s,e)}(e,t,r)}const u=t.global;if(u){const n=u.newest;if(n)return void function(t,e,n,r){if(typeof n===c.function)return;!function(t,e,n,r){const o=n.templater||n,s=ut(o,r,r.appSupport,e),c=t.subject.global;me(c.oldest,s)}(t,e,n,r)}(n,t,e,r)}if(s)switch(s){case a.templater:return void pe(r,t,ye);case a.tag:case a.dom:{const o=e;let s=o.templater;s||(s=fe(),o.templater=s,s.tag=o);return(t.global?t.global:n(t)).newest=de(s,r,t),void pe(r,t,ye)}}h(e)?xe(t,e,r,{added:0,removed:0}):typeof e!==c.function?o&&function(t,e){e.checkValueChange=Ie;const n=e.placeholder,r=_t(t);e.simpleValueElm=It(r,n)}(e,t):t.value=e}function we(t,e,r){r.checkValueChange=_e;const o=t;let s=o.templater;s||(s=rt(yt.DEEP),s.tag=o,o.templater=s);const c=r.global=n(r),a=c.newest=ut(s,e,e.appSupport,r);return c.oldest=a,r}function Ce(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)}t.subject.renderCount=0}function je(t,e){for(const n of t){const t=n.lastArray;if(t){je(t,e);continue}const r=n.global;if(!r)continue;const o=r.newest,s=r.subscriptions;s&&s.forEach((t=>t.unsubscribe())),l(o.templater)&&Ce(o);je(r.context,e)}}function Se(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&&Se(s,e,n)}return{tags:e,subs:n}}function ke(t){const e=t.subject.global,n=e.htmlDomMeta,r=e.context;e.deleted=!0;const o=e.destroys;if(o){const t=[];return o.forEach((e=>{const n=e();n instanceof Promise&&t.push(n)})),void Promise.all(t).then((()=>{Te(r),Ae(n),Rt()}))}Te(r),Ae(n)}function Te(t){for(const e of t){if(e.withinOwnerElement)continue;const t=e.lastArray;if(t){Re(e,t);continue}const n=e.simpleValueElm;if(n){delete e.simpleValueElm,xt.push(n);continue}const r=e.global;if(void 0===r)continue;if(!0===r.deleted)continue;r.deleted=!0;const o=r.oldest;o&&ke(o)}}function Ae(t){t.forEach((t=>{const e=t.marker;e&&xt.push(e);const n=t.domElement;n&&xt.push(n)}))}function Ee(t){const e=t.subject.global;e.deleted=!0,t.subject.renderCount=0;const n=[];if(je(e.context,n),e.destroy$&&(e.destroy$.next(),Ce(t)),n.length)return Promise.all(n).then((()=>ke(t)));ke(t)}function xe(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=Je(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=Oe(e,t,u,n,c,r,i).placeholder}}function Oe(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 ve(e,t,r),e;const i=Pe(t,s,r,c,n,a);return i}(a,u,n,r,e,o,s,c):Pe(a,o,r,s,n,c)}function Pe(t,e,n,r,o,s){const c={value:t,checkValueChange:Ie,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:we(t.tag,e,n);break;case a.tag:case a.dom:we(t,e,n)}}(t,n,c),Ue(t,c,n,r,`rvp_${o.length}_array`,s),c.value=t,o.push(c),s&&Vt.push({element:u,relative:s}),c}function Ve(t,e){const n=t.global;if(n){const t=n.oldest;n.deleted=!0,Ee(t),n.deleted=!0}else{const e=t.simpleValueElm;delete t.simpleValueElm,xt.push(e)}++e.removed}function Je(t,e,n,r,o,s){const c=e.length-1,a=n-o,u=a<0||c<a,i=r[n];return u?(Ve(i,s),++o,1):r[n].value.arrayValue!==e[n].arrayValue?(Ve(i,s),r.splice(n,1),++o,2):0}function We(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 Ne(t,e){if(!h(t)){return Re(e,e.lastArray),9}return!1}function Re(t,e){const n={added:0,removed:0};for(let t=0;t<e.length;++t)Ve(e[t],n);delete t.lastArray}function Ie(t,e){if(null==t||typeof t!==c.object)return function(t,e){const n=_t(t),r=e.simpleValueElm;Pt.push([n,r])}(t,e),-1;const n=e.simpleValueElm;return delete e.simpleValueElm,xt.push(n),6}function _e(t,e){const r=e.global,o=r?.newest;if(i(t)){return!We(t,o)&&(Ee(o),n(e),7)}const s=t?.tagJsType;return!s&&(Ee(o),delete e.global,e.renderCount=0,8)}function Me(t,e,n){const r=rt(yt.DEEP);r.tagJsType=t.tagJsType;const o=de(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 De(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(Le,c),a}(n,e,t)}D.tagClosed$=new v(void 0,(function(t){dn()||t.next()}));const Le="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 $e(t,e){const n=t.subject;++n.renderCount;const r=D.stateConfig;delete r.support,t.state=r.stateArray,D.tagClosed$.next(e),De(r,t),n.global.newest=t}function He(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=gt(i,i,ut(i,r,t.appSupport,n)),l.states=t.states}else{l=(0,i.wrapper)(t,n,e),l.states=t.states}return $e(l,r),n.renderCount>s+1?o.newest:l}function Be(t,e,n,r,o){n.checkValueChange=_e;const s=de(t,e,n);s.ownerSupport=e;const c=ie(s,o,r,void 0);for(const t of c.dom)t.marker&&Vt.push({element:t.marker,relative:r}),t.domElement&&Vt.push({element:t.domElement,relative:r});let a=-1;const u=c.subs.length-1;for(;a++<u;){Fe(c.subs[a])}return s}function Ue(t,e,r,o,s,c){const u=t?.tagJsType;if(u)switch(u){case a.templater:return e.checkValueChange=_e,c?Be(t,r,e,c,o):pe(r,e,o);case a.dom:case a.tag:{e.checkValueChange=_e;const s=t;let a=s.templater;a||(a=function(t){const e=fe();return e.tag=t,t.templater=e,e}(s));const u=n(e);return c?Be(a,r,e,c,o):(u.newest=de(a,r,e),e.checkValueChange=_e,pe(r,e,o))}case a.stateRender:case a.tagComponent:if(n(e),e.checkValueChange=_e,c){const n=function(t,e,n,r,o){const s=ut(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}=Ye(s,u.newest,e,n);return function(t,e,n){let r=Vt.length;const o=ie(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)Fe(t)}(i,r,o),i}(t,e,r,o,c);return n}return Ge(t,e,r,o);case a.renderOnce:{n(e);const s=Me(t,e,r);He(s,void 0,e,r);const a=Be(s.templater,r,e,c,o);return e.checkValueChange=_e,a}}if(h(t))return xe(e,t,r,o,c),void(e.checkValueChange=Ne);p(t)||function(t,e,n,r){const o=_t(t),s=It(o,n);s.id=r,e.simpleValueElm=s,e.checkValueChange=Ie}(t,e,e.placeholder,s)}function ze(t,e,n){t!==e.value&&(ve(e,t,n),D.stateConfig.support||Rt())}function Fe({subject:t,support:e,counts:n,contextItem:r,appendTo:o}){let s=function(t){Ue(t,r,e,{...n},`rvp_-1_${e.templater.tag?.values.length}`,c?o:void 0),c||D.stateConfig.support||Rt(),s=function(t){ze(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 Ge(t,e,n,r){const o=ut(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}=Ye(o,c.newest,e,n);return function(t,e,n){n.checkValueChange=_e;const r=ie(t,e,void 0,n.placeholder).subs;for(const t of r)Fe(t)}(u,r,e),u}function Ze(t,e,n,r,o,s=-1){const c=e.subject.global.newest;if(!c){const e=lt(r,t,s);r.push(...e);return t.propsConfig.castProps=e,r}const a=(e=c||e).propsConfig.castProps,u=[];for(let e=0;e<r.length;++e){const c=r[e],i=Xe(a[e],c,t,n,s+1,o);u.push(i)}return t.propsConfig.castProps=u,u}function Xe(t,e,n,r,o,s){return typeof t===c.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):s===o||dt(e)?e:h(e)?function(t,e,n,r,o){for(let s=t.length-1;s>=0;--s){const c=t[s];t[s]=Xe(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=Xe(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 qe(t){const e=t.subject.global,{subs:r,tags:o}=Se(e.context);Qe(t);for(const t of o)Qe(t);e.subscriptions&&r.forEach((t=>t.unsubscribe())),n(t.subject)}function Qe(t){const e=t.subject,n=e.global;!0!==n.deleted&&(n.deleted=!0,e.renderCount=0,ke(t))}function Ye(t,e,n,r){const o=e?.templater,s=o?.tag,c=He(t,e,n,r),u=!e||We(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&&qe(e))}if(n){const r=n.strings;if(r){const n=r?.length;n!==t.strings.length&&qe(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),qe(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 Ke={added:0,removed:0};function tn(t,e,n,r){const o=r.global,{support:s,wasLikeTags:c}=Ye(e,t,r,n);return c?(me(o.oldest,s),s):(pe(n,r,Ke),s)}function en(t){return a.templater===t.tagJsType}function nn(t){const e=t.subject.global,n=en(t.templater),r=t.ownerSupport;if(e.locked)return e.blocked.push(t),t;if(n)return rn(r,t);e.locked=!0;const o=t.subject;e.blocked.length&&(t=e.blocked.pop(),e.blocked=[]),delete e.locked;return tn(e.newest,t,r,o)}function rn(t,e){const n=t.subject.global;if(!n||!0===n.deleted)return e;return nn(n.newest||t)}function on(t,e){return t.length!==e.length}function sn(t){const e=dn();if(!e)throw un;return cn(e,D.stateConfig,t)}function cn(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),nn(t),f(c)&&c.finally((()=>{L(n.stateArray,s,n.states,t.states),nn(t)})),c}(t,n,{stateArray:r,states:o},...e):n(...e)}}const an=()=>{const t=dn();if(!t)throw un;const e=D.stateConfig;return function(n){return cn(t,e,n)}},un=new Y("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function ln(t){O(t)}function pn(t){O((function(){dn().subject.global.destroy$.toCallback(t)}))}function fn(t){return D.stateConfig.handlers.statesHandler(t)}function dn(){return D.stateConfig.support}const gn=":tagvar",hn=":";function bn(t,e){const n={values:e,ownerSupport:dn(),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 mn(t,e){const n={values:e,ownerSupport:dn(),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 yn="ondoubleclick",vn=/(:tagvar\d+:)/,wn=/(^:tagvar\d+:|:tagvar\d+:$)/g,Cn="__safeTagVar",jn=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,Sn=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function kn(t,e){Tn(t,e);const n=function(t){const e=[],n=[],r=[];let o=null,s=-1,c=0;const a=new RegExp(Sn,"g");t=function(t){return t.replace(xn,(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()){An(e).forEach((t=>{t.startsWith(gn)&&(t=gn+ ++s+hn),En(o,n,t)}))}}if(c=u.index+i.length,f){o=r.pop()||null;continue}const g=[];let h;for(;null!==(h=jn.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")?Pn(c):c;if(o){if(t.slice(0,gn.length)===gn){const t=gn+ ++s+hn;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=gn+ ++s+hn}r||(n=h[2]);const u=[a,n],i=Yt(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()){An(e).forEach((t=>(t.startsWith(gn)&&++s,En(o,n,t))))}}return n}(Tn(t,e).join(""));return n}function Tn(t,e){return function(t,e){const n=t.map(((t,n)=>n<e.length?t+gn+n+hn:t));return function(t,e,n){const r=n.length-e.length;if(r>0)for(let n=r;n>0;--n)t.push(gn+(e.length+n-1)+hn)}(n,t,e),n}(t.map((t=>t.replace(wn,((t,e)=>Cn+e)))),e)}function An(t){return t.split(vn).filter((t=>""!==t))}function En(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:On(n)})}const xn=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function On(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 Pn(t){if(t.startsWith("on")){return t.length===yn.length&&t===yn?"dblclick":t.slice(2,t.length)}return t}const Vn=new RegExp(gn+"(\\d+)"+hn,"g"),Jn="ch";function Wn(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=Rn(t,e)}if(c.ch){const t=c.ch,r=[...s,Jn];c.ch=Wn(t,e,n,r)}t=Nn(c,e,o,t)}return o}function Nn(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=Vn.exec(a));){const t=c[1],o=parseInt(t,10);if(!isNaN(o)&&o<e){const t=gn+o+hn,e=a.slice(c.index+t.length);n.splice(r,1,{nn:"text",v:o}),a=e,Vn.lastIndex=0}}return o.tc=a,r}function Rn(t,e){return t.map((t=>{const[n,r,o]=t;if(n.startsWith(gn)){const t=parseInt(n.replace(gn,""),10);if(!isNaN(t)&&t<e)return[{tagJsVar:t}]}if(typeof r===s.string&&r.startsWith(gn)){const t=parseInt(r.replace(gn,""),10);if(!isNaN(t)&&t<e)return[n,{tagJsVar:t},o]}return t}))}const In="__safeTagVar";const _n=/__safeTagVar(\d+)/g;function Mn(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(In)){const n=parseInt(e.replace(In,""),10);t[1]=gn+n+hn}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(_n,((t,e)=>gn+e+hn))}Mn(n)}0===e.length&&delete t.ch}}const Dn={};function Ln(t,e){const n=function(t){const e=t.map((t=>t.length));return e.push(t.length),Number(e.join(""))}(t),r=Dn[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=Wn(kn(t,e),e.length);s.forEach(Mn);const c={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:s};return Dn[n]=c,s}function $n(t,...e){const n=bn(t,e),r=rt(yt.NONE);return r.tag=n,n.templater=r,n}$n.dom=function(t,...e){return mn(t,e)};const Hn=[];function Bn(t,e,r){const o=Hn.findIndex((t=>t.element===e));o>=0&&(Ee(Hn[o].support),Hn.splice(o,1),console.warn("Found and destroyed app element already rendered to element",{element:e}));let s=()=>p(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:_e,withinOwnerElement:!1,renderCount:0,global:void 0},o=n(r);return o.events={},Un(t,r,e),r}(s,e),i=u.global;J(i.newest,D.stateConfig);let p=t(r);const f=typeof p==c.function;f||(l(p)?(i.newest.propsConfig={latest:[r],castProps:[r]},s.propWatch=p.propWatch,s.tagJsType=p.tagJsType,s.wrapper=p.wrapper,s=p):(s.tag=p,p=t));const d=document.createTextNode("");ot.push(s.wrapper||{original:s});const g=zn(s,d,e,u,f);i.isApp=!0,f&&(p.tag=g.templater.tag),e.destroy=function(){const t=i.events;for(const n in t){const r=t[n];e.removeEventListener(n,r)}i.events={},Ee(g),Rt()},++Nt.locks;const h=ie(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,Hn.push({element:e,support:g});const m=document.createDocumentFragment();m.appendChild(d);for(const t of h.dom)Fn(t,m);for(const t of h.subs)Fe(t);return--Nt.locks,Rt(),e.appendChild(m),{support:g,tags:ot,ValueTypes:a}}function Un(t,e,n){const r=e.global,o=at(t,e);return o.appElement=n,r.oldest=r.oldest||o,r.newest=o,o}function zn(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=Un(t,r,n);return $e(e),e}const s=gt(t,e,c);return $e(s),s}const i=(0,t.wrapper)(c,r);return $e(i),i}function Fn(t,e){t.domElement&&e.appendChild(t.domElement),t.marker&&e.appendChild(t.marker)}const Gn={tagElement:Bn,renderWithSupport:Ye,renderSupport:nn,renderTagOnly:He,paint:Rt};var Zn=e.W9,Xn=e.cg,qn=e.m0,Qn=e.rS,Yn=e.Y2,Kn=e.ei,tr=e.B7,er=e.TU,nr=e.XF,rr=e.PC,or=e.Ot,sr=e.Mj,cr=e.tD,ar=e.j8,ur=e.um,ir=e.E2,lr=e.OH,pr=e.TB,fr=e.Ii,dr=e.yV,gr=e.zV,hr=e.ze,br=e.WJ,mr=e.aZ,yr=e.O,vr=e.Ie,wr=e.B4,Cr=e.Az,jr=e.Xi,Sr=e.pc,kr=e.Ah,Tr=e.ck,Ar=e.k6,Er=e.Gk,xr=e.cF,Or=e.PB,Pr=e.qy,Vr=e.cy,Jr=e.Tn,Wr=e.Gv,Nr=e.yL,Rr=e.D8,Ir=e.Ze,_r=e._4,Mr=e.mn,Dr=e.Eb,Lr=e.z,$r=e.bc,Hr=e.sA,Br=e.MG,Ur=e.PL,zr=e.nI,Fr=e.PZ,Gr=e.N_,Zr=e.r5,Xr=e.uc,qr=e.pG,Qr=e.QB,Yr=e.R6,Kr=e.Ll,to=e.wk,eo=e.xP,no=e.uz,ro=e.ag,oo=e.Tc,so=e.Hf,co=e._A,ao=e.NU,uo=e.hW,io=e.wB,lo=e.id,po=e.MC,fo=e.zC;export{Zn as ArrayNoKeyError,Xn as BasicTypes,qn as ImmutableTypes,Qn as PropWatches,Yn as RouteQuery,Kn as StateMismatchError,tr as Subject,er as Subjective,nr as SyncCallbackError,rr as TagError,or as ValueSubject,sr as ValueSubjective,cr as ValueTypes,ar as addOneContext,ur as buildBeforeElement,ir as callback,lr as callbackMaker,pr as checkArrayValueChange,fr as checkSimpleValueChange,dr as checkTagValueChange,gr as combineLatest,hr as createTrigger,br as defineValueOn,mr as destroyArray,yr as destroySupport,vr as empty,wr as getBaseSupport,Cr as getDomMeta,jr as getDomTag,Sr as getHtmlSupport,kr as getNewGlobal,Tr as getStringTag,Ar as getSupport,Er as getTemplaterResult,xr as hmr,Or as howToSetInputValue,Pr as html,Vr as isArray,Jr as isFunction,Wr as isObject,Nr as isPromise,Rr as isSimpleType,Ir as isStaticTag,_r as isSubjectInstance,Mr as isTagComponent,Dr as key,Lr as letProp,$r as letState,Hr as onDestroy,Br as onInit,Ur as oneRenderToSupport,zr as paint,Fr as processFirstSubjectValue,Gr as processSubUpdate,Zr as providers,Xr as renderSupport,qr as renderTagOnly,Qr as renderWithSupport,Yr as runWrapper,Kr as setUseMemory,to as state,eo as states,no as subject,ro as syncError,oo as tag,so as tagElement,co as tags,ao as variablePrefix,uo as variableSuffix,io as watch,lo as willCallback,po as willPromise,fo as willSubscribe};
2
2
  //# sourceMappingURL=bundle.js.map