|
|
- /* Riot v4.8.6, @license MIT */
- var t,e;t=this,e=function(t){"use strict";const e=new Map,n=Symbol("riot-component"),r=new Set,o="mount",s="update",i="unmount",u=Symbol.for("pure"),a=Symbol("parent"),c=Symbol("attributes"),l=Symbol("template");var h=Object.freeze({__proto__:null,COMPONENTS_IMPLEMENTATION_MAP:e,DOM_COMPONENT_INSTANCE_PROPERTY:n,PLUGINS_SET:r,IS_DIRECTIVE:"is",VALUE_ATTRIBUTE:"value",MOUNT_METHOD_KEY:o,UPDATE_METHOD_KEY:s,UNMOUNT_METHOD_KEY:i,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:u,PARENT_KEY_SYMBOL:a,ATTRIBUTES_KEY_SYMBOL:c,TEMPLATE_KEY_SYMBOL:l});function p(t){return"function"==typeof t}function d(){return this}function f(t){return p(t)?t.prototype&&t.prototype.constructor?new t:t():t}function m(t){Array.from(t).forEach(b)}function b(t){const{parentNode:e}=t;t.remove?t.remove():e&&e.removeChild(t)}var O={EACH:0,IF:1,SIMPLE:2,TAG:3,SLOT:4},g={ATTRIBUTE:0,EVENT:1,TEXT:2,VALUE:3};const{indexOf:E}=[],v=(t,e,n,r,o,s)=>{const i="selectedIndex"in e;let u=i;for(;r<o;){const o=t(n[r],1);if(e.insertBefore(o,s),i&&u&&o.selected){u=!u;let{selectedIndex:t}=e;e.selectedIndex=t<0?r:E.call(e.querySelectorAll("option"),o)}r++}},N=(t,e)=>t==e,T=t=>t,y=(t,e,n,r,o,s,i)=>{const u=s-o;if(u<1)return-1;for(;n-e>=u;){let u=e,a=o;for(;u<n&&a<s&&i(t[u],r[a]);)u++,a++;if(a===s)return e;e=u+1}return-1},M=(t,e,n,r,o)=>n<r?t(e[n],0):0<n?t(e[n-1],-0).nextSibling:o,j=(t,e,n,r)=>{for(;n<r;)w(t(e[n++],-1))},_=(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},A=(t,e,n,r,o,s,i,u,a,c,l,h,p)=>{((t,e,n,r,o,s,i,u,a)=>{const c=[],l=t.length;let h=i,p=0;for(;p<l;)switch(t[p++]){case 0:o++,h++;break;case 1:c.push(r[o]),v(e,n,r,o++,o,h<u?e(s[h],0):a);break;case-1:h++}for(p=0;p<l;)switch(t[p++]){case 0:i++;break;case-1:-1<c.indexOf(s[i])?i++:j(e,s,i++,i)}})(((t,e,n,r,o,s,i)=>{const u=n+s,a=[];let c,l,h,p,d,f,m;t:for(c=0;c<=u;c++){if(c>50)return null;for(m=c-1,d=c?a[c-1]:[0,0],f=a[c]=[],l=-c;l<=c;l+=2){for(p=l===-c||l!==c&&d[m+l-1]<d[m+l+1]?d[m+l+1]:d[m+l-1]+1,h=p-l;p<s&&h<n&&i(r[o+p],t[e+h]);)p++,h++;if(p===s&&h===n)break t;f[c+l]=p}}const b=Array(c/2+u/2);let O=b.length-1;for(c=a.length-1;c>=0;c--){for(;p>0&&h>0&&i(r[o+p-1],t[e+h-1]);)b[O--]=0,p--,h--;if(!c)break;m=c-1,d=c?a[c-1]:[0,0],l=p-h,l===-c||l!==c&&d[m+l-1]<d[m+l+1]?(h--,b[O--]=1):(p--,b[O--]=-1)}return b})(n,r,s,i,u,c,h)||((t,e,n,r,o,s,i,u)=>{let a=0,c=r<u?r:u;const l=Array(c++),h=Array(c);h[0]=-1;for(let t=1;t<c;t++)h[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;a=_(h,c,t),-1<a&&(h[a]=t,l[a]={newi:r,oldi:t,prev:l[a-1]})}}for(a=--c,--i;h[a]>i;)--a;c=u+r-a;const d=Array(c);let f=l[a];for(--n;f;){const{newi:t,oldi:e}=f;for(;n>t;)d[--c]=1,--n;for(;i>e;)d[--c]=-1,--i;d[--c]=0,--n,--i,f=f.prev}for(;n>=e;)d[--c]=1,--n;for(;i>=s;)d[--c]=-1,--i;return d})(n,r,o,s,i,u,a,c),t,e,n,r,i,u,l,p)},w=t=>(t.remove||S).call(t);function S(){const{parentNode:t}=this;t&&t.removeChild(this)}
- /*! (c) 2018 Andrea Giammarchi (ISC) */function x(t,e){return typeof t===e}function U(t){const e=t.ownerSVGElement;return!!e||null===e}function P(t){return!I(t.content)}function C(t){return x(t,"function")}function D(t){return!I(t)&&x(t,"object")}function I(t){return null==t}const B=Symbol("unmount"),Y=Object.seal({nodes:[],mount(t,e){return this.update(t,e)},update(t,e){const{placeholder:n,nodes:r,childrenMap:o}=this,s=t===B?null:this.evaluate(t),i=s?Array.from(s):[],u=n.parentNode,{newChildrenMap:a,batches:c,futureNodes:l}=function(t,e,n,r){const{condition:o,template:s,childrenMap:i,itemName:u,getKey:a,indexName:c,root:l,isTemplateTag:h}=r,p=new Map,d=[],f=[];return t.forEach((t,r)=>{const m=function(t,e){let{itemName:n,indexName:r,index:o,item:s}=e;return t[n]=s,r&&(t[r]=o),t}(Object.create(e),{itemName:u,indexName:c,index:r,item:t}),b=a?a(m):r,O=i.get(b);if(function(t,e){return!!t&&!1===Boolean(t(e))}(o,m))return;const g=O?O.template:s.clone(),E=O?g.el:l.cloneNode(),v=!O,N=h&&v?function(t){const e=t.dom.cloneNode(!0);return{avoidDOMInjection:!0,fragment:e,children:Array.from(e.childNodes)}}(g):{};if(v?d.push(()=>g.mount(E,m,n,N)):d.push(()=>g.update(m,n)),h){const t=N.children||g.children;f.push(...t),t.forEach(t=>p.set(t,null))}else f.push(E);i.delete(b),p.set(b,{template:g,context:m,index:r})}),{newChildrenMap:p,batches:d,futureNodes:f}}(i,t,e,this);return((t,e,n,r)=>{r||(r={});const o=r.compare||N,s=r.node||T,i=null==r.before?null:s(r.before,0),u=e.length;let a=u,c=0,l=n.length,h=0;for(;c<a&&h<l&&o(e[c],n[h]);)c++,h++;for(;c<a&&h<l&&o(e[a-1],n[l-1]);)a--,l--;const p=c===a,d=h===l;if(p&&d)return n;if(p&&h<l)return v(s,t,n,h,l,M(s,e,c,u,i)),n;if(d&&c<a)return j(s,e,c,a),n;const f=a-c,m=l-h;let b=-1;if(f<m){if(b=y(n,h,l,e,c,a,o),-1<b)return v(s,t,n,h,b,s(e[c],0)),v(s,t,n,b+f,l,M(s,e,a,u,i)),n}else if(m<f&&(b=y(e,c,a,n,h,l,o),-1<b))return j(s,e,c,b),j(s,e,b+m,a),n;f<2||m<2?(v(s,t,n,h,l,s(e[c],0)),j(s,e,c,a)):f===m&&((t,e,n,r,o,s)=>{for(;r<o&&s(n[r],t[e-1]);)r++,e--;return 0===e})(n,l,e,c,a,o)?v(s,t,n,h,l,M(s,e,a,u,i)):A(s,t,n,h,l,m,e,c,a,f,u,o,i)})(u,r,l,{before:n,node:L(Array.from(o.values()),e)}),c.forEach(t=>t()),this.childrenMap=a,this.nodes=l,this},unmount(t,e){return this.update(B,e),this}});function L(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 K=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}}),k="undefined"==typeof Element?{}:Element.prototype,R=function(t){const e=new Map,n=n=>e.has(n)?e.get(n):e.set(n,t.call(this,n))&&e.get(n);return n.cache=e,n}(t=>k.hasOwnProperty(t));function $(t,e,n,r){let{name:o}=e;o?(!R(o)&&(function(t){return x(t,"boolean")}(n)||D(n)||C(n))&&(t[o]=n),t[function(t){return I(t)||!1===t||""===t||D(t)||C(t)?"removeAttribute":"setAttribute"}(n)](o,function(t,e){return!0===e?t:e}(o,n))):n?function(t,e){Object.entries(e).forEach(e=>{let[n,r]=e;return $(t,{name:n},r)})}(t,n):r&&function(t,e){Object.keys(e).forEach(e=>t.removeAttribute(e))}(t,r)}const z=/^on/;function H(t){return I(t)?"":t}const F=(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 V={0:$,1:function(t,e,n,r){let{name:o}=e;const s=o.replace(z,"");r&&t.removeEventListener(s,r),n&&t.addEventListener(s,n,!1)},2:function(t,e,n){t.data=H(n)},3:function(t,e,n){t.value=H(n)}};const G=Object.seal({mount(t){return this.value=this.evaluate(t),q(this,this.value),this},update(t){const e=this.evaluate(t);return this.value!==e&&(q(this,e),this.value=e),this},unmount(){return 1===this.type&&q(this,null),this}});function q(t,e){return V[t.type](t.node,t,e,t.value)}function W
|