You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
21 KiB

!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=0)}([function(t,e,n){n(1),t.exports=n(2)},function(t,e,n){"use strict";function r(t){return t.replace(/-(\w)/g,(t,e)=>e.toUpperCase())}function o(t){Array.from(t).forEach(s)}function s(t){const{parentNode:e}=t;t.remove?t.remove():e&&e.removeChild(t)}n.r(e);var i={EACH:0,IF:1,SIMPLE:2,TAG:3,SLOT:4};var a={ATTRIBUTE:0,EVENT:1,TEXT:2,VALUE:3};const{indexOf:u,slice:c}=[],l=(t,e,n,r,o,s)=>{const i="selectedIndex"in e;let a=i;for(;r<o;){const o=t(n[r],1);if(e.insertBefore(o,s),i&&a&&o.selected){a=!a;let{selectedIndex:t}=e;e.selectedIndex=t<0?r:u.call(e.querySelectorAll("option"),o)}r++}},d=(t,e)=>t==e,p=t=>t,h=(t,e,n,r,o,s,i)=>{const a=s-o;if(a<1)return-1;for(;n-e>=a;){let a=e,u=o;for(;a<n&&u<s&&i(t[a],r[u]);)a++,u++;if(u===s)return e;e=a+1}return-1},m=(t,e,n,r,o)=>n<r?t(e[n],0):0<n?t(e[n-1],-0).nextSibling:o,f=(t,e,n,r)=>{for(;n<r;)_(t(e[n++],-1))},b=(t,e,n)=>{let r=1,o=e;for(;r<o;){const e=(r+o)/2>>>0;n<t[e]?o=e:r=e+1}return r},O=(t,e,n,r,o,s,i,a,u,c,d,p,h)=>{((t,e,n,r,o,s,i,a,u)=>{const c=[],d=t.length;let p=i,h=0;for(;h<d;)switch(t[h++]){case 0:o++,p++;break;case 1:c.push(r[o]),l(e,n,r,o++,o,p<a?e(s[p],0):u);break;case-1:p++}for(h=0;h<d;)switch(t[h++]){case 0:i++;break;case-1:-1<c.indexOf(s[i])?i++:f(e,s,i++,i)}})(((t,e,n,r,o,s,i)=>{const a=n+s,u=[];let c,l,d,p,h,m,f;t:for(c=0;c<=a;c++){if(c>50)return null;for(f=c-1,h=c?u[c-1]:[0,0],m=u[c]=[],l=-c;l<=c;l+=2){for(p=l===-c||l!==c&&h[f+l-1]<h[f+l+1]?h[f+l+1]:h[f+l-1]+1,d=p-l;p<s&&d<n&&i(r[o+p],t[e+d]);)p++,d++;if(p===s&&d===n)break t;m[c+l]=p}}const b=Array(c/2+a/2);let O=b.length-1;for(c=u.length-1;c>=0;c--){for(;p>0&&d>0&&i(r[o+p-1],t[e+d-1]);)b[O--]=0,p--,d--;if(!c)break;f=c-1,h=c?u[c-1]:[0,0],l=p-d,l===-c||l!==c&&h[f+l-1]<h[f+l+1]?(d--,b[O--]=1):(p--,b[O--]=-1)}return b})(n,r,s,i,a,c,p)||((t,e,n,r,o,s,i,a)=>{let u=0,c=r<a?r:a;const l=Array(c++),d=Array(c);d[0]=-1;for(let t=1;t<c;t++)d[t]=i;const p=o.slice(s,i);for(let r=e;r<n;r++){const e=p.indexOf(t[r]);if(-1<e){const t=e+s;u=b(d,c,t),-1<u&&(d[u]=t,l[u]={newi:r,oldi:t,prev:l[u-1]})}}for(u=--c,--i;d[u]>i;)--u;c=a+r-u;const h=Array(c);let m=l[u];for(--n;m;){const{newi:t,oldi:e}=m;for(;n>t;)h[--c]=1,--n;for(;i>e;)h[--c]=-1,--i;h[--c]=0,--n,--i,m=m.prev}for(;n>=e;)h[--c]=1,--n;for(;i>=s;)h[--c]=-1,--i;return h})(n,r,o,s,i,a,u,c),t,e,n,r,i,a,d,h)},_=t=>(t.remove||v).call(t);function v(){const{parentNode:t}=this;t&&t.removeChild(this)}function y(t,e){return typeof t===e}function E(t){const e=t.ownerSVGElement;return!!e||null===e}function g(t){return!x(t.content)}function N(t){return y(t,"function")}function T(t){return!x(t)&&y(t,"object")}function x(t){return null==t}const M=Symbol("unmount"),j=Object.seal({nodes:[],mount(t,e){return this.update(t,e)},update(t,e){const{placeholder:n,nodes:r,childrenMap:o}=this,s=t===M?null:this.evaluate(t),i=s?Array.from(s):[],a=n.parentNode,{newChildrenMap:u,batches:c,futureNodes:b}=function(t,e,n,r){const{condition:o,template:s,childrenMap:i,itemName:a,getKey:u,indexName:c,root:l,isTemplateTag:d}=r,p=new Map,h=[],m=[];return t.forEach((t,r)=>{const f=function(t,e){let{itemName:n,indexName:r,index:o,item:s}=e;t[n]=s,r&&(t[r]=o);return t}(Object.create(e),{itemName:a,indexName:c,index:r,item:t}),b=u?u(f):r,O=i.get(b);if(function(t,e){return!!t&&!1===Boolean(t(e))}(o,f))return;const _=O?O.template:s.clone(),v=O?_.el:l.cloneNode(),y=!O,E=d&&y?function(t){const e=t.dom.cloneNode(!0);return{avoidDOMInjection:!0,fragment:e,children:Array.from(e.childNodes)}}(_):{};if(y?h.push(()=>_.mount(v,f,n,E)):h.push(()=>_.update(f,n)),d){const t=E.children||_.children;m.push(...t)}else m.push(v);i.delete(b),p.set(b,{template:_,context:f,index:r})}),{newChildrenMap:p,batches:h,futureNodes:m}}(i,t,e,this);return((t,e,n,r)=>{r||(r={});const o=r.compare||d,s=r.node||p,i=null==r.before?null:s(r.before,0),a=e.length;let u=a,c=0,b=n.length,_=0;for(;c<u&&_<b&&o(e[c],n[_]);)c++,_++;for(;c<u&&_<b&&o(e[u-1],n[b-1]);)u--,b--;const v=c===u,y=_===b;if(v&&y)return n;if(v&&_<b)return l(s,t,n,_,b,m(s,e,c,a,i)),n;if(y&&c<u)return f(s,e,c,u),n;const E=u-c,g=b-_;let N=-1;if(E<g){if(N=h(n,_,b,e,c,u,o),-1<N)return l(s,t,n,_,N,s(e[c],0)),l(s,t,n,N+E,b,m(s,e,u,a,i)),n}else if(g<E&&(N=h(e,c,u,n,_,b,o),-1<N))return f(s,e,c,N),f(s,e,N+g,u),n;E<2||g<2?(l(s,t,n,_,b,s(e[c],0)),f(s,e,c,u)):E===g&&((t,e,n,r,o,s)=>{for(;r<o&&s(n[r],t[e-1]);)r++,e--;return 0===e})(n,b,e,c,u,o)?l(s,t,n,_,b,m(s,e,u,a,i)):O(s,t,n,_,b,g,e,c,u,E,a,o,i)})(a,r,b,{before:n,node:A(Array.from(o.values()),e)}),c.forEach(t=>t()),this.childrenMap=u,this.nodes=b,this},unmount(t,e){return this.update(M,e),this}});function A(t,e){return(n,r)=>{if(r<0){const n=t.pop();if(n){const{template:t,context:r}=n;t.unmount(r,e,null)}}return n}}const S=Object.seal({mount(t,e){return this.update(t,e)},update(t,e){const n=!!this.evaluate(t),r=!this.value&&n,o=this.value&&!n,s=()=>{const n=this.node.cloneNode();this.placeholder.parentNode.insertBefore(n,this.placeholder),this.template=this.template.clone(),this.template.mount(n,t,e)};switch(!0){case r:s();break;case o:this.unmount(t);break;default:n&&this.template.update(t,e)}return this.value=n,this},unmount(t,e){return this.template.unmount(t,e,!0),this}});function w(t){throw new Error(t)}function U(t){return t.reduce((t,e)=>{const{value:n,type:o}=e;switch(!0){case!e.name&&0===o:return Object.assign({},t,n);case 3===o:t.value=e.value;break;default:t[r(e.name)]=e.value}return t},{})}const P="undefined"==typeof Element?{}:Element.prototype,C=function(t){const e=new Map,n=n=>(e.has(n)||e.set(n,t.call(this,n)))&&e.get(n);return n.cache=e,n}(t=>P.hasOwnProperty(t));function D(t,e,n,r){let{name:o}=e;if(!o)return r&&function(t,e,n){const r=e?Object.keys(e):[];Object.keys(n).filter(t=>!r.includes(t)).forEach(e=>t.removeAttribute(e))}(t,n,r),void(n&&function(t,e){Object.entries(e).forEach(e=>{let[n,r]=e;return D(t,{name:n},r)})}(t,n));!C(o)&&(function(t){return y(t,"boolean")}(n)||T(n)||N(n))&&(t[o]=n),t[function(t){return x(t)||!1===t||""===t||T(t)||N(t)?"removeAttribute":"setAttribute"}(n)](o,function(t,e){return!0===e?t:e}(o,n))}const I=/^on/,L={handleEvent(t){this[t.type](t)}},B=new WeakMap;function Y(t){return x(t)?"":t}const k=(t,e)=>{const n=t.childNodes[e];if(n.nodeType===Node.COMMENT_NODE){const e=document.createTextNode("");return t.replaceChild(e,n),e}return n};var K={0:D,1:function(t,e,n){let{name:r}=e;const o=r.replace(I,""),s=B.get(t)||(t=>{const e=Object.create(L);return B.set(t,e),e})(t),[i,a]=(t=>Array.isArray(t)?t:[t,!1])(n),u=s[o],c=i&&!u;u&&!i&&t.removeEventListener(o,s),c&&t.addEventListener(o,s,a),s[o]=i},2:function(t,e,n){t.data=Y(n)},3:function(t,e,n){t.value=Y(n)}};const R=Object.seal({mount(t){return this.value=this.evaluate(t),$(this,this.value),this},update(t){const e=this.evaluate(t);return this.value!==e&&($(this,e),this.value=e),this},unmount(){return 1===this.type&&$(this,null),this}});function $(t,e){return K[t.type](t.node,t,e,t.value)}function V(t,e){return Object.assign({},R,e,{node:2===e.type?k(t,e.childNodeIndex):t})}const z=new Map,H=Symbol("riot-component"),F=new Set,G="mount",q="update",X="unmount",W=Symbol.for("pure"),Z=Symbol("parent"),J=Symbol("attributes"),Q=Symbol("template");var tt=Object.freeze({__proto__:null,COMPONENTS_IMPLEMENTATION_MAP:z,DOM_COMPONENT_INSTANCE_PROPERTY:H,PLUGINS_SET:F,IS_DIRECTIVE:"is",VALUE_ATTRIBUTE:"value",MOUNT_METHOD_KEY:G,UPDATE_METHOD_KEY:q,UNMOUNT_METHOD_KEY:X,SHOULD_UPDATE_KEY:"shouldUpdate",ON_BEFORE_MOUNT_KEY:"onBeforeMount",ON_MOUNTED_KEY:"onMounted",ON_BEFORE_UPDATE_KEY:"onBeforeUpdate",ON_UPDATED_KEY:"onUpdated",ON_BEFORE_UNMOUNT_KEY:"onBeforeUnmount",ON_UNMOUNTED_KEY:"onUnmounted",PROPS_KEY:"props",STATE_KEY:"state",SLOTS_KEY:"slots",ROOT_KEY:"root",IS_PURE_SYMBOL:W,PARENT_KEY_SYMBOL:Z,ATTRIBUTES_KEY_SYMBOL:J,TEMPLATE_KEY_SYMBOL:Q});const et=(t,e)=>t[Z]||e,nt=Object.seal({attributes:[],getTemplateScope(t,e){return function(t,e,n){if(!t||!t.length)return n;const r=t.map(t=>Object.assign({},t,{value:t.evaluate(e)}));return Object.assign(Object.create(n||null),U(r))}(this.attributes,t,e)},mount(t,e){const n=!!t.slots&&t.slots.find(t=>{let{id:e}=t;return e===this.name}),{parentNode:r}=this.node,o=et(t,e);return this.template=n&&dt(n.html,n.bindings).createDOM(r),this.template&&(this.template.mount(this.node,this.getTemplateScope(t,o),o),this.template.children=function t(e,n){void 0===n&&(n=[]);const r=e.firstChild;if(r)return e.parentNode.insertBefore(r,e),[r,...t(e)];return n}(this.node)),s(this.node),this},update(t,e){if(this.template){const n=et(t,e);this.template.update(this.getTemplateScope(t,n),n)}return this},unmount(t,e,n){return this.template&&this.template.unmount(this.getTemplateScope(t,e),null,n),this}});function rt(t){return t.reduce((t,e)=>{let{bindings:n}=e;return t.concat(n)},[])}const ot=Object.seal({mount(t){return this.update(t)},update(t,e){const n=this.evaluate(t);return n===this.name?this.tag.update(t):(this.unmount(t,e,!0),this.name=n,this.tag=function(t,e,n){return void 0===e&&(e=[]),void 0===n&&(n=[]),t?t({slots:e,attributes:n}):dt(function(t){return t.reduce((t,e)=>t+e.html,"")}(e),[...rt(e),{expressions:n.map(t=>Object.assign({type:0},t))}])}(this.getComponent(n),this.slots,this.attributes),this.tag.mount(this.node,t)),this},unmount(t,e,n){return this.tag&&this.tag.unmount(n),this}});var st={1:function(t,e){let{evaluate:n,template:r}=e;const o=t.parentNode,i=document.createTextNode("");return o.insertBefore(i,t),s(t),Object.assign({},S,{node:t,evaluate:n,placeholder:i,template:r.createDOM(t)})},2:function(t,e){let{expressions:n}=e;return Object.assign({},(r=n.map(e=>V(t,e)),["mount","update","unmount"].reduce((t,e)=>Object.assign({},t,{[e]:t=>r.map(n=>n[e](t))&&o}),{})));var r,o},0:function(t,e){let{evaluate:n,condition:r,itemName:o,indexName:i,getKey:a,template:u}=e;const c=document.createTextNode(""),l=t.parentNode,d=t.cloneNode();return l.insertBefore(c,t),s(t),Object.assign({},j,{childrenMap:new Map,node:t,root:d,condition:r,evaluate:n,isTemplateTag:g(d),template:u.createDOM(t),getKey:a,indexName:i,itemName:o,placeholder:c})},3:function(t,e){let{evaluate:n,getComponent:r,slots:o,attributes:s}=e;return Object.assign({},ot,{node:t,evaluate:n,slots:o,attributes:s,getComponent:r})},4:function(t,e){let{name:n,attributes:r}=e;return Object.assign({},nt,{attributes:r,node:t,name:n})}};function it(t,e){return t.map(t=>2===t.type?Object.assign({},t,{childNodeIndex:t.childNodeIndex+e}):t)}function at(t,e,n){const{selector:r,type:o,redundantAttribute:s,expressions:i}=e,a=r?t.querySelector(r):t;s&&a.removeAttribute(s);const u=i||[];return(st[o]||st[2])(a,Object.assign({},e,{expressions:n&&!r?it(u,n):u}))}function ut(t,e){return E(t)?function(t,e){return e.ownerDocument.importNode((new window.DOMParser).parseFromString(`<svg xmlns="http://www.w3.org/2000/svg">${t}</svg>`,"application/xml").documentElement,!0)}(e,t):function(t,e){const n=g(e)?e:document.createElement("template");return n.innerHTML=t,n.content}(e,t)}function ct(t,e){switch(!0){case E(t):!function t(e,n){e.firstChild&&(n.appendChild(e.firstChild),t(e,n))}(e,t);break;case g(t):t.parentNode.replaceChild(e,t);break;default:t.appendChild(e)}}const lt=Object.freeze({createDOM(t){return this.dom=this.dom||function(t,e){return e&&("string"==typeof e?ut(t,e):e)}(t,this.html),this},mount(t,e,n,r){if(void 0===r&&(r={}),!t)throw new Error("Please provide DOM node to mount properly your template");this.el&&this.unmount(e);const{fragment:o,children:s,avoidDOMInjection:i}=r,{parentNode:a}=s?s[0]:t,u=g(t),c=u?Math.max(Array.from(a.childNodes).indexOf(t),0):null;return this.isTemplateTag=u,this.createDOM(t),this.dom&&(this.fragment=o||this.dom.cloneNode(!0)),this.el=this.isTemplateTag?a:t,this.children=this.isTemplateTag?s||Array.from(this.fragment.childNodes):null,!i&&this.fragment&&ct(t,this.fragment),this.bindings=this.bindingsData.map(t=>at(this.el,t,c)),this.bindings.forEach(t=>t.mount(e,n)),this},update(t,e){return this.bindings.forEach(n=>n.update(t,e)),this},unmount(t,e,n){if(this.el){switch(this.bindings.forEach(r=>r.unmount(t,e,n)),!0){case this.children&&null!==n:o(this.children);break;case!0===n:s(this.el);break;case null!==n:o(this.el.childNodes)}this.el=null}return this},clone(){return Object.assign({},this,{el:null})}});function dt(t,e){return void 0===e&&(e=[]),Object.assign({},lt,{html:t,bindingsData:e})}function pt(){return this}function ht(t){return N(t)?t.prototype&&t.prototype.constructor?new t:t():t}function mt(t,e,n,r){return void 0===r&&(r={}),Object.defineProperty(t,e,Object.assign({value:n,enumerable:!1,writable:!1,configurable:!0},r)),t}function ft(t,e,n){return Object.entries(e).forEach(e=>{let[r,o]=e;mt(t,r,o,n)}),t}function bt(t,e){return Object.entries(e).forEach(e=>{let[n,r]=e;t[n]||(t[n]=r)}),t}function Ot(t){return Array.isArray(t)?t:/^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(t))&&"number"==typeof t.length?Array.from(t):[t]}function _t(t,e){return Ot("string"==typeof t?(e||document).querySelectorAll(t):t)}const vt=t=>1===t.length?t[0]:t;function yt(t,e,n){const r="object"==typeof e?e:{[e]:n},o=Object.keys(r);return Ot(t).forEach(t=>{o.forEach(e=>t.setAttribute(e,r[e]))}),t}function Et(t,e){return function(t,e,n){const r="string"==typeof e?[e]:e;return vt(Ot(t).map(t=>vt(r.map(e=>t[n](e)))))}(t,e,"getAttribute")}const gt=new Map,Nt=()=>Tt||(yt(Tt=_t("style[riot]")[0]||document.createElement("style"),"type","text/css"),Tt.parentNode||document.head.appendChild(Tt),Tt);var Tt,xt={CSS_BY_NAME:gt,add(t,e){return gt.has(t)||(gt.set(t,e),this.inject()),this},inject(){return Nt().innerHTML=[...gt.values()].join("\n"),this},remove(t){return gt.has(t)&&(gt.delete(t),this.inject()),this}};function Mt(t){return Et(t,"is")||t.tagName.toLowerCase()}const jt=Object.freeze({$(t){return _t(t,this.root)[0]},$$(t){return _t(t,this.root)}}),At=Object.freeze({[G]:pt,[q]:pt,[X]:pt}),St=Object.freeze({shouldUpdate:pt,onBeforeMount:pt,onMounted:pt,onBeforeUpdate:pt,onUpdated:pt,onBeforeUnmount:pt,onUnmounted:pt}),wt=Object.assign({},At,{clone:pt,createDOM:pt});function Ut(t,e){return void 0===e&&(e={}),Object.assign({},function(t){return Array.from(t.attributes).reduce((t,e)=>(t[r(e.name)]=e.value,t),{})}(t),ht(e))}const Pt=(t,e)=>t[H]=e;function Ct(t){return[G,q,X].reduce((e,n)=>(e[n]=t(n),e),{})}function Dt(t){let{css:e,template:n,exports:r,name:o}=t;const s=n?function(t,e){return t(dt,a,i,t=>e[t]||z.get(t))}(n,r?function(t){void 0===t&&(t={});return Object.entries(ht(t)).reduce((t,e)=>{let[n,r]=e;var o;return t[(o=n,o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())]=Dt(r),t},{})}(r.components):{}):wt;return t=>{let{slots:i,attributes:a,props:u}=t;if(r&&r[W])return function(t,e){let{slots:n,attributes:r,props:o,css:s,template:i}=e;i&&w("Pure components can not have html"),s&&w("Pure components do not have css");const a=bt(t({slots:n,attributes:r,props:o}),At);return Ct(t=>function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(t===G){const[t]=n;Pt(t,a)}return a[t](...n),a})}(r,{slots:i,attributes:a,props:u,css:e,template:n});const c=ht(r)||{},l=It({css:e,template:s,componentAPI:c,name:o})({slots:i,attributes:a,props:u});return{mount:(t,e,n)=>l.mount(t,n,e),update:(t,e)=>l.update(e,t),unmount:t=>l.unmount(t)}}}function It(t){let{css:e,template:n,componentAPI:r,name:o}=t;return e&&o&&xt.add(o,e),function t(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return function(){for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return(o=[...r,...o]).length<e.length?t(e,...o):e(...o)}}(Bt)(ft(bt(r,Object.assign({},St,{state:{}})),Object.assign({slots:null,root:null},jt,{name:o,css:e,template:n})))}function Lt(t,e){return Object.assign({},t,ht(e))}function Bt(t,e){let{slots:n,attributes:r,props:o}=e;return s=function(t){return[...F].reduce((t,e)=>e(t)||t,t)}(ft(Object.create(t),{mount(e,s,i){return void 0===s&&(s={}),this[J]=function(t,e){void 0===e&&(e=[]);const n=e.map(e=>V(t,e)),r={};return Object.assign(r,Object.assign({expressions:n},Ct(t=>e=>(n.forEach(n=>n[t](e)),r))))}(e,r).mount(i),mt(this,"props",Object.freeze(Object.assign({},Ut(e,o),U(this[J].expressions)))),this.state=Lt(this.state,s),this[Q]=this.template.createDOM(e).clone(),Pt(e,this),t.name&&function(t,e){Mt(t)!==e&&yt(t,"is",e)}(e,t.name),mt(this,"root",e),mt(this,"slots",n),this.onBeforeMount(this.props,this.state),this[Z]=i,this[Q].mount(e,this,i),this.onMounted(this.props,this.state),this},update(t,e){void 0===t&&(t={}),e&&(this[Z]=e,this[J].update(e));const n=U(this[J].expressions);if(!1!==this.shouldUpdate(n,this.props))return mt(this,"props",Object.freeze(Object.assign({},this.props,n))),this.state=Lt(this.state,t),this.onBeforeUpdate(this.props,this.state),this[Q].update(this,this[Z]),this.onUpdated(this.props,this.state),this},unmount(t){return this.onBeforeUnmount(this.props,this.state),this[J].unmount(),this[Q].unmount(this,this[Z],null===t?null:!t),this.onUnmounted(this.props,this.state),this}})),Object.keys(t).filter(e=>N(t[e])).forEach(t=>{s[t]=s[t].bind(s)}),s;var s}const{DOM_COMPONENT_INSTANCE_PROPERTY:Yt,COMPONENTS_IMPLEMENTATION_MAP:kt,PLUGINS_SET:Kt}=tt;function Rt(t,e){let{css:n,template:r,exports:o}=e;return kt.has(t)&&w(`The component "${t}" was already registered`),kt.set(t,Dt({name:t,css:n,template:r,exports:o})),kt}var $t,Vt,zt={openModal:function(t){this.__dispatchModal(t,"open")},closeModal:function(t){this.__dispatchModal(t,"close")},__dispatchModal:function(t,e){var n=document.getElementById(t);n&&n.dispatchEvent(new CustomEvent(e))}},Ht={css:null,exports:{onMounted(){this.root.addEventListener("open",this.__open),this.root.addEventListener("close",this.__close)},__open(){this.$(".modal").classList.add("modal--transition-enter"),this.$(".modal-layer").classList.add("modal-layer--transition-enter"),this.update()},__close(){this.$(".modal").classList.remove("modal--transition-enter"),this.$(".modal-layer").classList.remove("modal-layer--transition-enter"),this.update()},handleClose(t){t.preventDefault(),this.__close()}},template:function(t,e,n,r){return t('<div class="modal"><header class="modal__header"><span expr3="expr3" class="modal__title"></span><button expr4="expr4" type="button" class="modal__button">\n &#x274C;\n </button></header><div class="modal__body"><slot expr5="expr5"></slot></div></div><div expr6="expr6" class="modal-layer"></div>',[{type:n.IF,evaluate:function(t){return t.props.title},redundantAttribute:"expr3",selector:"[expr3]",template:t(" ",[{expressions:[{type:e.TEXT,childNodeIndex:0,evaluate:function(t){return[t.props.title].join("")}}]}])},{redundantAttribute:"expr4",selector:"[expr4]",expressions:[{type:e.EVENT,name:"onclick",evaluate:function(t){return t.handleClose}}]},{type:n.SLOT,attributes:[],name:"default",redundantAttribute:"expr5",selector:"[expr5]"},{redundantAttribute:"expr6",selector:"[expr6]",expressions:[{type:e.EVENT,name:"onclick",evaluate:function(t){return t.handleClose}}]}])},name:"tiny-modal"};Rt("tiny-demo",{css:null,exports:()=>({...zt}),template:function(t,e,n,r){return t('<div class="demo"><tiny-modal expr0="expr0" title="My Modal" id="my-modal"></tiny-modal><button expr2="expr2" type="button" class="button">\n Open\n </button></div>',[{type:n.TAG,getComponent:r,evaluate:function(t){return"tiny-modal"},slots:[{id:"default",html:"<pre>\n *-*,\n ,*\\/|`| \\\n \\' | |'| *,\n \\ `| | |/ )\n | |'| , /\n |'| |, /\n __|_|_|_|__\n [___________]\n | |\n | |\n | |\n |_________|\n</pre><button expr1=\"expr1\" type=\"button\">\n Cancel\n </button>",bindings:[{redundantAttribute:"expr1",selector:"[expr1]",expressions:[{type:e.EVENT,name:"onclick",evaluate:function(t){return()=>t.closeModal("my-modal")}}]}]}],attributes:[],redundantAttribute:"expr0",selector:"[expr0]"},{redundantAttribute:"expr2",selector:"[expr2]",expressions:[{type:e.EVENT,name:"onclick",evaluate:function(t){return()=>t.openModal("my-modal")}}]}])},name:"tiny-demo"}),Rt("tiny-modal",Ht),_t("tiny-demo").map(t=>function(t,e,n){const r=n||Mt(t);return z.has(r)||w(`The component named "${r}" was never registered`),z.get(r)({props:e}).mount(t)}(t,$t,Vt))},function(t,e){}]);