taggedjs 2.6.9 → 2.6.10

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