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.
10 lines
553 KiB
10 lines
553 KiB
4 years ago
|
/* Riot v4.13.1, @license MIT */
|
||
|
(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t():typeof define==="function"&&define.amd?define(t):(e=e||self,e.riot=t())})(this,(function(){"use strict";function e(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function t(e){return e.replace(/-(\w)/g,(e,t)=>t.toUpperCase())}function r(e){return Array.from(e.attributes).reduce((e,r)=>{e[t(r.name)]=r.value;return e},{})}function n(e,t){if(e.firstChild){t.appendChild(e.firstChild);n(e,t)}}function i(e){a(e.childNodes)}function a(e){Array.from(e).forEach(s)}function s(e){const{parentNode:t}=e;if(e.remove)e.remove();else if(t)t.removeChild(e)}const o=0;const l=1;const u=2;const c=3;const f=4;var h={EACH:o,IF:l,SIMPLE:u,TAG:c,SLOT:f};const p=0;const d=1;const m=2;const v=3;var g={ATTRIBUTE:p,EVENT:d,TEXT:m,VALUE:v};function y(e){const t=e.dom.cloneNode(true);return{avoidDOMInjection:true,fragment:t,children:Array.from(t.childNodes)}}const{indexOf:x,slice:E}=[];const b=(e,t,r,n,i,a)=>{const s="selectedIndex"in t;let o=s;while(n<i){const i=e(r[n],1);t.insertBefore(i,a);if(s&&o&&i.selected){o=!o;let{selectedIndex:e}=t;t.selectedIndex=e<0?n:x.call(t.querySelectorAll("option"),i)}n++}};const S=(e,t)=>e==t;const D=e=>e;const C=(e,t,r,n,i,a,s)=>{const o=a-i;if(o<1)return-1;while(r-t>=o){let o=t;let l=i;while(o<r&&l<a&&s(e[o],n[l])){o++;l++}if(l===a)return t;t=o+1}return-1};const A=(e,t,r,n,i,a)=>{while(n<i&&a(r[n],e[t-1])){n++;t--}return t===0};const w=(e,t,r,n,i)=>r<n?e(t[r],0):0<r?e(t[r-1],-0).nextSibling:i;const T=(e,t,r,n)=>{while(r<n)O(e(t[r++],-1))};const k=-1;const P=1;const _=0;const F=50;const I=(e,t,r,n,i,a,s,o)=>{let l=0;let u=n<o?n:o;const c=Array(u++);const f=Array(u);f[0]=-1;for(let e=1;e<u;e++)f[e]=s;const h=i.slice(a,s);for(let n=t;n<r;n++){const t=h.indexOf(e[n]);if(-1<t){const e=t+a;l=B(f,u,e);if(-1<l){f[l]=e;c[l]={newi:n,oldi:e,prev:c[l-1]}}}}l=--u;--s;while(f[l]>s)--l;u=o+n-l;const p=Array(u);let d=c[l];--r;while(d){const{newi:e,oldi:t}=d;while(r>e){p[--u]=P;--r}while(s>t){p[--u]=k;--s}p[--u]=_;--r;--s;d=d.prev}while(r>=t){p[--u]=P;--r}while(s>=a){p[--u]=k;--s}return p};const N=(e,t,r,n,i,a,s)=>{const o=r+a;const l=[];let u,c,f,h,p,d,m;e:for(u=0;u<=o;u++){if(u>F)return null;m=u-1;p=u?l[u-1]:[0,0];d=l[u]=[];for(c=-u;c<=u;c+=2){if(c===-u||c!==u&&p[m+c-1]<p[m+c+1]){h=p[m+c+1]}else{h=p[m+c-1]+1}f=h-c;while(h<a&&f<r&&s(n[i+h],e[t+f])){h++;f++}if(h===a&&f===r){break e}d[u+c]=h}}const v=Array(u/2+o/2);let g=v.length-1;for(u=l.length-1;u>=0;u--){while(h>0&&f>0&&s(n[i+h-1],e[t+f-1])){v[g--]=_;h--;f--}if(!u)break;m=u-1;p=u?l[u-1]:[0,0];c=h-f;if(c===-u||c!==u&&p[m+c-1]<p[m+c+1]){f--;v[g--]=P}else{h--;v[g--]=k}}return v};const M=(e,t,r,n,i,a,s,o,l)=>{const u=[];const c=e.length;let f=s;let h=0;while(h<c){switch(e[h++]){case _:i++;f++;break;case P:u.push(n[i]);b(t,r,n,i++,i,f<o?t(a[f],0):l);break;case k:f++;break}}h=0;while(h<c){switch(e[h++]){case _:s++;break;case k:if(-1<u.indexOf(a[s]))s++;else T(t,a,s++,s);break}}};const B=(e,t,r)=>{let n=1;let i=t;while(n<i){const t=(n+i)/2>>>0;if(r<e[t])i=t;else n=t+1}return n};const L=(e,t,r,n,i,a,s,o,l,u,c,f,h)=>{M(N(r,n,a,s,o,u,f)||I(r,n,i,a,s,o,l,u),e,t,r,n,s,o,c,h)};const O=e=>(e.remove||R).call(e);function R(){const{parentNode:e}=this;if(e)e.removeChild(this)}
|
||
|
/*! (c) 2018 Andrea Giammarchi (ISC) */const j=(e,t,r,n)=>{if(!n)n={};const i=n.compare||S;const a=n.node||D;const s=n.before==null?null:a(n.before,0);const o=t.length;let l=o;let u=0;let c=r.length;let f=0;while(u<l&&f<c&&i(t[u],r[f])){u++;f++}while(u<l&&f<c&&i(t[l-1],r[c-1])){l--;c--}const h=u===l;const p=f===c;if(h&&p)return r;if(h&&f<c){b(a,e,r,f,c,w(a,t,u,o,s));return r}if(p&&u<l){T(a,t,u,l);return r}const d=l-u;const m=c-f;let v=-1;if(d<m){v=C(r,f,c,t,u,l,i);if(-1<v){b(a,e,r,f,v,a(t[u],0));b(a,e,r,v+d,c,w(a,t,l,o,s));return r}}else if(m<d){v=C(t,u,l,r,f,c,i);if(-1<v){T(a,t,u,v);T(a,t,v+m,l);return r}}if(d<2||m<2){b(a,e,r,f,c,a(t[u],0));T(a,t,u,l);return r}if(d===m&&A(r,c,t,u,l,i)){b(a,e,r,f,c,w(a,t,l,o,s));return r}L(a,e,r,f,c,m,t,u,l,d,o,i,s);return r};function U(e,t){return typeof e===t}function V(e){const t=e.ownerSVGElement;return!!t||t===null}function z(e){return!q(e.content)}function G(e){return U(e,"function")}function X(e){return U(e,"boolean")}function J(e){return!q(e)&&U(e,"object")}function q(e){return e===null||e===undefined}const W=Symbol("unmount");const H=Object.seal({nodes:[],mount(e,t){return this.update(e,t)},update(e,t){const{placeholder:r,nodes:n,childrenMap:i}=this;const a=e===W?null:this.evaluate(e);const s=a?Array.from(a):[];const o=r.parentNode;const{newChildrenMap:l,batches:u,futureNodes:c}=Q(s,e,t,this);j(o,n,c,{before:r,node:K(Array.from(i.values()),t)});u.forEach(e=>e());this.childrenMap=l;this.nodes=c;return this},unmount(e,t){this.update(W,t);return this}});function K(e,t){return(r,n)=>{if(n<0){const r=e.pop();if(r){const{template:e,context:n}=r;e.unmount(n,t,null)}}return r}}function $(e,t){return e?Boolean(e(t))===false:false}function Y(e,t){let{itemName:r,indexName:n,index:i,item:a}=t;e[r]=a;if(n)e[n]=i;return e}function Q(e,t,r,n){const{condition:i,template:a,childrenMap:s,itemName:o,getKey:l,indexName:u,root:c,isTemplateTag:f}=n;const h=new Map;const p=[];const d=[];e.forEach((e,n)=>{const m=Y(Object.create(t),{itemName:o,indexName:u,index:n,item:e});const v=l?l(m):n;const g=s.get(v);if($(i,m)){return}const x=g?g.template:a.clone();const E=g?x.el:c.cloneNode();const b=!g;const S=f&&b?y(x):{};if(b){p.push(()=>x.mount(E,m,r,S))}else{p.push(()=>x.update(m,r))}if(f){const e=S.children||x.children;d.push(...e)}else{d.push(E)}s.delete(v);h.set(v,{template:x,context:m,index:n})});return{newChildrenMap:h,batches:p,futureNodes:d}}function Z(e,t){let{evaluate:r,condition:n,itemName:i,indexName:a,getKey:o,template:l}=t;const u=document.createTextNode("");const c=e.parentNode;const f=e.cloneNode();c.insertBefore(u,e);s(e);return Object.assign({},H,{childrenMap:new Map,node:e,root:f,condition:n,evaluate:r,isTemplateTag:z(f),template:l.createDOM(e),getKey:o,indexName:a,itemName:i,placeholder:u})}const ee=Object.seal({mount(e,t){return this.update(e,t)},update(e,t){const r=!!this.evaluate(e);const n=!this.value&&r;const i=this.value&&!r;const a=()=>{const r=this.node.cloneNode();this.placeholder.parentNode.insertBefore(r,this.placeholder);this.template=this.template.clone();this.template.mount(r,e,t)};switch(true){case n:a();break;case i:this.unmount(e);break;default:if(r)this.template.update(e,t)}this.value=r;return this},unmount(e,t){this.template.unmount(e,t,true);return this}});function te(e,t){let{evaluate:r,template:n}=t;const i=e.parentNode;const a=document.createTextNode("");i.insertBefore(a,e);s(e);return Object.assign({},ee,{node:e,evaluate:r,placeholder:a,template:n.createDOM(e)})}function re(e){throw new Error(e)}function ne(e){const t=new Map;const r=r=>t.has(r)?t.get(r):t.set(r,e.call(this,r))&&t.get(r);r.cache=t;return r}function ie(e){return e.reduce((e,r)=>{const{value:n,type:i}=r;switch(true){case!r.name&&i===p:return Object.assign({},e,n);case i===v:e.value=r.value;break;default:e[t(r.name)]=r.value}return e},{})}const ae="removeAttribute";const se="setAttribute";const oe=typeof Element==="undefined"?{}:Element.prototype;const le=ne(e=>oe.hasOwnProperty(e));function ue(e,t){Object.entries(t).forEach(t=>{let[r,n]=t;return fe(e,{name:r},n)})}function ce(e,t,r){const n=t?Object.
|
||
|
/*!
|
||
|
* The buffer module from node.js, for the browser.
|
||
|
*
|
||
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||
|
* @license MIT
|
||
|
*/var fe=50;de.TYPED_ARRAY_SUPPORT=yr.TYPED_ARRAY_SUPPORT!==undefined?yr.TYPED_ARRAY_SUPPORT:true;function he(){return de.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function pe(e,t){if(he()<t){throw new RangeError("Invalid typed array length")}if(de.TYPED_ARRAY_SUPPORT){e=new Uint8Array(t);e.__proto__=de.prototype}else{if(e===null){e=new de(t)}e.length=t}return e}function de(e,t,r){if(!de.TYPED_ARRAY_SUPPORT&&!(this instanceof de)){return new de(e,t,r)}if(typeof e==="number"){if(typeof t==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return ye(this,e)}return me(this,e,t,r)}de.poolSize=8192;de._augment=function(e){e.__proto__=de.prototype;return e};function me(e,t,r,n){if(typeof t==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&t instanceof ArrayBuffer){return be(e,t,r,n)}if(typeof t==="string"){return xe(e,t,r)}return Se(e,t)}de.from=function(e,t,r){return me(null,e,t,r)};if(de.TYPED_ARRAY_SUPPORT){de.prototype.__proto__=Uint8Array.prototype;de.__proto__=Uint8Array}function ve(e){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}else if(e<0){throw new RangeError('"size" argument must not be negative')}}function ge(e,t,r,n){ve(t);if(t<=0){return pe(e,t)}if(r!==undefined){return typeof n==="string"?pe(e,t).fill(r,n):pe(e,t).fill(r)}return pe(e,t)}de.alloc=function(e,t,r){return ge(null,e,t,r)};function ye(e,t){ve(t);e=pe(e,t<0?0:De(t)|0);if(!de.TYPED_ARRAY_SUPPORT){for(var r=0;r<t;++r){e[r]=0}}return e}de.allocUnsafe=function(e){return ye(null,e)};de.allocUnsafeSlow=function(e){return ye(null,e)};function xe(e,t,r){if(typeof r!=="string"||r===""){r="utf8"}if(!de.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}var n=Ae(t,r)|0;e=pe(e,n);var i=e.write(t,r);if(i!==n){e=e.slice(0,i)}return e}function Ee(e,t){var r=t.length<0?0:De(t.length)|0;e=pe(e,r);for(var n=0;n<r;n+=1){e[n]=t[n]&255}return e}function be(e,t,r,n){t.byteLength;if(r<0||t.byteLength<r){throw new RangeError("'offset' is out of bounds")}if(t.byteLength<r+(n||0)){throw new RangeError("'length' is out of bounds")}if(r===undefined&&n===undefined){t=new Uint8Array(t)}else if(n===undefined){t=new Uint8Array(t,r)}else{t=new Uint8Array(t,r,n)}if(de.TYPED_ARRAY_SUPPORT){e=t;e.__proto__=de.prototype}else{e=Ee(e,t)}return e}function Se(e,t){if(Ce(t)){var r=De(t.length)|0;e=pe(e,r);if(e.length===0){return e}t.copy(e,0,0,r);return e}if(t){if(typeof ArrayBuffer!=="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t){if(typeof t.length!=="number"||st(t.length)){return pe(e,0)}return Ee(e,t)}if(t.type==="Buffer"&&ce(t.data)){return Ee(e,t.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function De(e){if(e>=he()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+he().toString(16)+" bytes")}return e|0}de.isBuffer=ot;function Ce(e){return!!(e!=null&&e._isBuffer)}de.compare=function e(t,r){if(!Ce(t)||!Ce(r)){throw new TypeError("Arguments must be Buffers")}if(t===r)return 0;var n=t.length;var i=r.length;for(var a=0,s=Math.min(n,i);a<s;++a){if(t[a]!==r[a]){n=t[a];i=r[a];break}}if(n<i)return-1;if(i<n)return 1;return 0};de.isEncoding=function e(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};de.concat=function e(t,r){if(!ce(t)){throw new TypeError('"list" argument must be an Array of Buffers')}if(t.length===0){return de.alloc(0)}var n;if(r===undefined){r=0;for(n=0;n<t.length;++n){r+=t[n].length}}var i=de.allocUnsafe(r);var a=0;for(n=0;n<t.length;++n){var s=t[n];if(!Ce(s)){throw new TypeError('"list" argument must be an Array of Buffers')}s.copy(i,a);a+=s.length}return i};function Ae(e,t){if(Ce(e)){return e.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)){return e.byteL
|