Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uland

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uland - npm Package Compare versions

Comparing version 0.3.5 to 0.4.0

127

cjs/index.js
'use strict';
const {augmentor} = require('dom-augmentor');
const {hooked} = require('uhooks-dom');
const umap = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('umap'));

@@ -22,15 +22,21 @@

const cache = umap(new WeakMap);
const render = (where, what) => {
const hook = typeof what === 'function' ? what() : what;
const info = cache.get(where) || cache.set(where, createCache(null));
info.w = where;
info.W = what;
return $render(
where,
hook instanceof Hook ?
unroll(info, hook) :
(unrollHole(info, hook), hook)
);
};
const render = (where, what) => (
cache.get(where) || cache.set(where, {
c: createCache(),
h: hooked(
function (what) {
const value = typeof what === 'function' ? what() : what;
return $render(
where,
value instanceof Hook ?
unroll(this.c, value) :
(unrollHole(this.c, value), value)
);
},
where
)
})
).h(what);
exports.Component = Component;

@@ -42,52 +48,33 @@ exports.render = render;

(m => {
exports.contextual = m.contextual;
exports.useState = m.useState;
exports.useEffect = m.useEffect;
exports.createContext = m.createContext;
exports.useContext = m.useContext;
exports.createContext = m.createContext;
exports.useRef = m.useRef;
exports.useReducer = m.useReducer;
exports.useCallback = m.useCallback;
exports.useMemo = m.useMemo;
exports.useEffect = m.useEffect;
exports.useLayoutEffect = m.useLayoutEffect;
})(require('dom-augmentor'));
exports.useReducer = m.useReducer;
exports.useState = m.useState;
exports.useRef = m.useRef;
})(require('uhooks-dom'));
let update = false;
const updateEntry = (entry, node) => {
if (node !== entry.node) {
if (entry.node)
update = true;
entry.node = node;
}
};
const createHook = (info, entry) => augmentor(function () {
const hole = entry.fn.apply(null, arguments);
const createHook = (info, entry) => hooked(function () {
const hole = entry.f.apply(this, arguments);
if (hole instanceof Hole) {
unrollHole(info, hole);
updateEntry(entry, view(entry, hole));
entry.$ = view(entry, hole);
}
else
updateEntry(entry, hole);
try { return entry.node; }
finally {
if (update) {
update = false;
let p = info;
while (p.p)
p = p.p;
render(p.w, p.W);
}
}
entry.$ = hole;
return entry.$;
});
const createCache = p => ({p, stack: [], entry: null});
const createCache = () => ({s: [], e: null});
const unroll = (info, {fn, template, values}) => {
let {entry} = info;
if (!entry || entry.fn !== fn) {
info.entry = (entry = {fn, hook: null, node: null});
entry.hook = createHook(createCache(info), entry);
const unroll = (info, {f, c, a}) => {
let {e} = info;
if (!e || e.f !== f) {
info.e = (e = {f, h: null, $: null});
e.h = createHook(createCache(), e);
}
return entry.hook(template, ...values);
return e.h.apply(c, a);
};

@@ -100,30 +87,32 @@

const unrollValues = (info, values, length) => {
const {stack} = info;
const {s} = info;
for (let i = 0; i < length; i++) {
const hook = values[i];
if (hook instanceof Hook)
values[i] = unroll(stack[i] || (stack[i] = createCache(info)), hook);
values[i] = unroll(s[i] || (s[i] = createCache()), hook);
else if (hook instanceof Hole)
unrollHole(stack[i] || (stack[i] = createCache(info)), hook);
unrollHole(s[i] || (s[i] = createCache()), hook);
else if (isArray(hook))
unrollValues(stack[i] || (stack[i] = createCache(info)), hook, hook.length);
unrollValues(s[i] || (s[i] = createCache()), hook, hook.length);
else
stack[i] = null;
s[i] = null;
}
if (length < stack.length)
stack.splice(length);
if (length < s.length)
s.splice(length);
};
const view = (entry, {type, template, values}) =>
const view = (e, {type, template, values}) =>
(type === 'svg' ? $svg : $html)
.for(entry, type)(template, ...values);
.for(e, type)(template, ...values);
function Component(fn) {
return (template, ...values) => new Hook(fn, template, values);
function Component(f) {
return function () {
return new Hook(f, this, arguments);
};
}
function Hook(fn, template, values) {
this.fn = fn;
this.template = template;
this.values = values;
function Hook(f, c, a) {
this.f = f;
this.c = c;
this.a = a;
}

@@ -134,8 +123,8 @@

return (
(entry, id) => {
const store = cache.get(entry) || cache.set(entry, create(null));
const info = store[id] || (store[id] = createCache(null));
(e, id) => {
const store = cache.get(e) || cache.set(e, create(null));
const info = store[id] || (store[id] = createCache());
return (template, ...values) => {
unrollValues(info, values);
return uhtml.for(entry, id)(template, ...values);
return uhtml.for(e, id)(template, ...values);
};

@@ -142,0 +131,0 @@ }

@@ -1,7 +0,7 @@

self.uland=function(e){"use strict";var t=CustomEvent,n=WeakSet;var r="function"==typeof cancelAnimationFrame,o=r?cancelAnimationFrame:clearTimeout,l=r?requestAnimationFrame:setTimeout;function s(e){var t,n,s,a,c;return i(),function(e,r,o){return s=e,a=r,c=o,n||(n=l(u)),--t<0&&f(!0),f};function u(){i(),s.apply(a,c||[])}function i(){t=e||1/0,n=r?0:null}function f(e){var t=!!n;return t&&(o(n),e&&u()),t}}var a=e=>({get:t=>e.get(t),set:(t,n)=>(e.set(t,n),n)})
/*! (c) Andrea Giammarchi - ISC */;let c=null;const u=e=>{const t=[];return function n(){const r=c,o=[];c={hook:n,args:arguments,stack:t,i:0,length:t.length,after:o};try{return e.apply(null,arguments)}finally{c=r;for(let e=0,{length:t}=o;e<t;e++)o[e]()}}},i=a(new WeakMap),f=(e,t,n)=>{e.apply(t,n)},d={async:!1,always:!1},p=(e,t)=>"function"==typeof t?t(e):t,h=(e,t,n,r)=>{const o=c.i++,{hook:l,args:a,stack:u,length:h}=c;o===h&&(c.length=u.push({}));const g=u[o];if(g.args=a,o===h){const o="function"==typeof n,{async:a,always:c}=(o?r:n)||r||d;g.$=o?n(t):p(void 0,t),g._=a?i.get(l)||i.set(l,s()):f,g.f=t=>{const n=e(g.$,t);(c||g.$!==n)&&(g.$=n,g._(l,null,g.args))}}return[g.$,g.f]},g=new WeakMap,v=({hook:e,args:t})=>{e.apply(null,t)};function m(e){this.value!==e&&(this.value=e,g.get(this).forEach(v))}function y({hook:e}){return e===this.hook}const w=new WeakMap,k=a(w),b=()=>{},N=e=>(t,n)=>{const r=c.i++,{hook:o,after:l,stack:a,length:u}=c;if(r<u){const o=a[r],{update:s,values:c,stop:u}=o;if(!n||n.some(T,c)){o.values=n,e&&u(e);const{clean:r}=o;r&&(o.clean=null,r());const a=()=>{o.clean=t()};e?s(a):l.push(a)}}else{const r=e?s():b,u={clean:null,update:r,values:n,stop:b};c.length=a.push(u),(k.get(o)||k.set(o,[])).push(u);const i=()=>{u.clean=t()};e?u.stop=r(i):l.push(i)}},C=e=>{(w.get(e)||[]).forEach((e=>{const{clean:t,stop:n}=e;n(),t&&(e.clean=null,t())}))},$=w.has.bind(w),x=N(!0),E=N(!1),M=(e,t)=>{const n=c.i++,{stack:r,length:o}=c;return n===o?c.length=r.push({$:e(),_:t}):t&&!t.some(T,r[n]._)||(r[n]={$:e(),_:t}),r[n].$};function T(e,t){return e!==this[t]}
/*! (c) Andrea Giammarchi - ISC */const A=
/*! (c) Andrea Giammarchi */
function(e){var t=e.Event,n=e.WeakSet,r=!0,o=null;return function(e){return r&&(r=!r,o=new n,function(e){var r=new n,l=new n;try{new MutationObserver(u).observe(e,{subtree:!0,childList:!0})}catch(t){var s=0,a=[],c=function(e){a.push(e),clearTimeout(s),s=setTimeout((function(){u(a.splice(s=0,a.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){c({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){c({addedNodes:[e.target],removedNodes:[]})}),!0)}function u(e){for(var t,n=e.length,o=0;o<n;o++)i((t=e[o]).removedNodes,"disconnected",l,r),i(t.addedNodes,"connected",r,l)}function i(e,n,r,o){for(var l,s=new t(n),a=e.length,c=0;c<a;1===(l=e[c++]).nodeType&&f(l,s,n,r,o));}function f(e,t,n,r,l){o.has(e)&&!r.has(e)&&(l.delete(e),r.add(e),e.dispatchEvent(t));for(var s=e.children||[],a=s.length,c=0;c<a;f(s[c++],t,n,r,l));}}(e.ownerDocument)),o.add(e),e}}({Event:t,WeakSet:n}),L=(e,t)=>{const{nodeType:n}=e;if(n){const r=1===n?e:(e=>{let{firstChild:t}=e;for(;t&&1!==t.nodeType;)t=t.nextSibling;if(t)return t;throw"unobservable"})(e);A(r),r.addEventListener("disconnected",t,!1)}else{const n=e.valueOf();n!==e&&L(n,t)}},S=e=>{let t=null;const n=u(e);return function(){const e=n.apply(this,arguments);return $(n)&&L(e,t||(t=C.bind(null,n))),e}},O=/([^\s\\>"'=]+)\s*=\s*(['"]?)$/,W=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,_=/<[a-z][^>]+$/i,j=/>[^<>]*$/,D=/<([a-z]+[a-z0-9:._-]*)([^>]*?)(\/>)/gi,R=/\s+$/,B=(e,t)=>0<t--&&(_.test(e[t])||!j.test(e[t])&&B(e,t)),F=(e,t,n)=>W.test(t)?e:`<${t}${n.replace(R,"")}></${t}>`;const{isArray:H}=Array,{indexOf:z,slice:q}=[],P=(e,t)=>111===e.nodeType?1/t<0?t?(({firstChild:e,lastChild:t})=>{const n=document.createRange();return n.setStartAfter(e),n.setEndAfter(t),n.deleteContents(),e})(e):e.lastChild:t?e.valueOf():e.firstChild:e;
self.uland=function(e){"use strict";var t=CustomEvent;const n=(e,t,n,s)=>{const l=new WeakMap,o=new WeakMap,c=new WeakMap,a=e=>l.has(e),i=e=>{a(e)&&(u(e,e.removeEventListener,l.get(e)),l.delete(e))},u=(e,t,n)=>{t.call(e,"disconnected",n),t.call(e,"connected",n)},h=(e,t,n,r)=>{for(let{length:s}=e,l=0;l<s;l++)d(e[l],t,n,r)},d=(e,r,s,l)=>{a(e)&&!s.has(e)&&(l.delete(e),s.set(e,0),e.dispatchEvent(new(n||CustomEvent)(r))),h(e[t||"children"]||[],r,s,l)},f=new(s||MutationObserver)((e=>{for(let{length:t}=e,n=0;n<t;n++){const{removedNodes:t,addedNodes:r}=e[n];h(t,"disconnected",c,o),h(r,"connected",o,c)}}));return f.observe(e||document,{subtree:!0,childList:!0}),{has:a,connect:(e,t)=>{i(e),(t||(t={})).handleEvent||(t.handleEvent=r),u(e,e.addEventListener,t),l.set(e,t)},disconnect:i,kill(){f.disconnect()}}};function r(e){e.type in this&&this[e.type](e)}var s=Promise;let l=null,o=new Set;const c=new WeakMap,a=e=>{const{$:t,r:n,h:r}=e;m(n)&&(u.get(r).delete(e),n()),m(e.r=t())&&u.get(r).add(e)},i=()=>{const e=o;o=new Set,e.forEach(w)},u=new WeakMap,h=[],d=[];function f(e,t){return e!==this[t]}const p=e=>{const t=u.get(e);t&&b.then((()=>{t.forEach((e=>{e.r(),e.r=null})),t.clear()}))},g=()=>c.get(l),v=e=>u.has(e),m=e=>"function"==typeof e,y=e=>{const t={h:n,c:null,a:null,e:0,i:0,s:[]};return c.set(n,t),n;function n(){const r=l;l=n,t.e=t.i=0;try{return e.apply(t.c=this,t.a=arguments)}finally{l=r,h.length&&b.then(h.forEach.bind(h.splice(0),a)),d.length&&d.splice(0).forEach(a)}}},w=({h:e,c:t,a:n,e:r})=>{r&&e.apply(t,n)},b=new s((e=>e()));function $(e){const{_:t,value:n}=this;n!==e&&(this._=new Set,this.value=e,t.forEach(w))}const C=(e,t)=>{const n=g(),{i:r,s:s}=n;return r!==s.length&&t&&!t.some(f,s[r]._)||(s[r]={$:e(),_:t}),s[n.i++].$},E=e=>(t,n)=>{const r=g(),{i:s,s:l,h:o}=r,c=s===l.length;c&&(u.has(o)||u.set(o,new Set),l.push({$:t,_:n,r:null,h:o}));const a=l[r.i++];(c||!n||n.some(f,a._))&&e.push(a)},k=E(h),x=E(d),N=(e,t)=>m(t)?t(e):t,M=(e,t,n)=>{const r=g(),{i:s,s:l}=r;s===l.length&&l.push({$:m(n)?n(t):N(void 0,t),set:t=>{l[s].$=e(l[s].$,t),(e=>{o.has(e)||(e.e=1,o.add(e),b.then(i))})(r)}});const{$:c,set:a}=l[r.i++];return[c,a]};
/*! (c) Andrea Giammarchi - ISC */
self.I=function(e){var t="fragment",n="template",r="content"in l(n)?function(e){var t=l(n);return t.innerHTML=e,t.content}:function(e){var r=l(t),s=l(n),a=null;if(/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)){var c=RegExp.$1;s.innerHTML="<table>"+e+"</table>",a=s.querySelectorAll(c)}else s.innerHTML=e,a=s.childNodes;return o(r,a),r};return function(e,t){return("svg"===t?s:r)(e)};function o(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function l(n){return n===t?e.createDocumentFragment():e.createElementNS("http://www.w3.org/1999/xhtml",n)}function s(e){var n=l(t),r=l("div");return r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",o(n,r.firstChild.childNodes),n}}(document);const G=({childNodes:e},t)=>e[t],J=e=>{const t=[];let{parentNode:n}=e;for(;n;)t.push(z.call(n.childNodes,e)),n=(e=n).parentNode;return t},{createTreeWalker:K,importNode:Q}=document,U=1!=Q.length,V=U?(e,t)=>Q.call(document,I(e,t),!0):I,X=U?e=>K.call(document,e,129,null,!1):e=>K.call(document,e,129),Y=(e,t,n)=>((e,t,n,r,o)=>{const l=n.length;let s=t.length,a=l,c=0,u=0,i=null;for(;c<s||u<a;)if(s===c){const t=a<l?u?r(n[u-1],-0).nextSibling:r(n[a-u],0):o;for(;u<a;)e.insertBefore(r(n[u++],1),t)}else if(a===u)for(;c<s;)i&&i.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[u])c++,u++;else if(t[s-1]===n[a-1])s--,a--;else if(t[c]===n[a-1]&&n[u]===t[s-1]){const o=r(t[--s],-1).nextSibling;e.insertBefore(r(n[u++],1),r(t[c++],-1).nextSibling),e.insertBefore(r(n[--a],1),o),t[s]=n[a]}else{if(!i){i=new Map;let e=u;for(;e<a;)i.set(n[e],e++)}if(i.has(t[c])){const o=i.get(t[c]);if(u<o&&o<a){let l=c,f=1;for(;++l<s&&l<a&&i.get(t[l])===o+f;)f++;if(f>o-u){const l=r(t[c],0);for(;u<o;)e.insertBefore(r(n[u++],1),l)}else e.replaceChild(r(n[u++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n})(e.parentNode,t,n,P,e),Z=(e,t)=>"ref"===t?(e=>t=>{"function"==typeof t?t(e):t.current=e})(e):"aria"===t?(e=>t=>{for(const n in t){const r="role"===n?n:"aria-"+n,o=t[n];null==o?e.removeAttribute(r):e.setAttribute(r,o)}})(e):".dataset"===t?(({dataset:e})=>t=>{for(const n in t){const r=t[n];null==r?delete e[n]:e[n]=r}})(e):"."===t.slice(0,1)?((e,t)=>n=>{e[t]=n})(e,t.slice(1)):"on"===t.slice(0,2)?((e,t)=>{let n,r=t.slice(2);return!(t in e)&&t.toLowerCase()in e&&(r=r.toLowerCase()),t=>{const o=H(t)?t:[t,!1];n!==o[0]&&(n&&e.removeEventListener(r,n,o[1]),(n=o[0])&&e.addEventListener(r,n,o[1]))}})(e,t):((e,t)=>{let n,r=!0;const o=document.createAttributeNS(null,t);return t=>{n!==t&&(n=t,null==n?r||(e.removeAttributeNode(o),r=!0):(o.value=t,r&&(e.setAttributeNodeNS(o),r=!1)))}})(e,t);function ee(e){const{type:t,path:n}=e,r=n.reduceRight(G,this);return"node"===t?(e=>{let t,n,r=[];const o=l=>{switch(typeof l){case"string":case"number":case"boolean":t!==l&&(t=l,n?n.textContent=l:n=document.createTextNode(l),r=Y(e,r,[n]));break;case"object":case"undefined":if(null==l){t!=l&&(t=l,r=Y(e,r,[]));break}if(H(l)){t=l,0===l.length?r=Y(e,r,[]):"object"==typeof l[0]?r=Y(e,r,l):o(String(l));break}"ELEMENT_NODE"in l&&t!==l&&(t=l,r=Y(e,r,11===l.nodeType?q.call(l.childNodes):[l]))}};return o})(r):"attr"===t?Z(r,e.name):(e=>{let t;return n=>{t!=n&&(t=n,e.textContent=null==n?"":n)}})(r)}const te="isµ",ne=a(new WeakMap),re=(e,t)=>{const n=((e,t,n)=>{const r=[],{length:o}=e;for(let n=1;n<o;n++){const o=e[n-1];r.push(O.test(o)&&B(e,n)?o.replace(O,((e,r,o)=>`${t}${n-1}=${o||'"'}${r}${o?"":'"'}`)):`${o}\x3c!--${t}${n-1}--\x3e`)}r.push(e[o-1]);const l=r.join("").trim();return n?l:l.replace(D,F)})(t,te,"svg"===e),r=V(n,e),o=X(r),l=[],s=t.length-1;let a=0,c="isµ"+a;for(;a<s;){const e=o.nextNode();if(!e)throw"bad template: "+n;if(8===e.nodeType)e.textContent===c&&(l.push({type:"node",path:J(e)}),c="isµ"+ ++a);else{for(;e.hasAttribute(c);)l.push({type:"attr",path:J(e),name:e.getAttribute(c)}),e.removeAttribute(c),c="isµ"+ ++a;/^(?:style|textarea)$/i.test(e.tagName)&&e.textContent.trim()===`\x3c!--${c}--\x3e`&&(l.push({type:"text",path:J(e)}),c="isµ"+ ++a)}}return{content:r,nodes:l}},oe=(e,t)=>{const{content:n,nodes:r}=ne.get(t)||ne.set(t,re(e,t)),o=Q.call(document,n,!0);return{content:o,updates:r.map(ee,o)}},le=(e,{type:t,template:n,values:r})=>{const{length:o}=r;se(e,r,o);let{entry:l}=e;l&&l.template===n&&l.type===t||(e.entry=l=((e,t)=>{const{content:n,updates:r}=oe(e,t);return{type:e,template:t,content:n,updates:r,wire:null}})(t,n));const{content:s,updates:a,wire:c}=l;for(let e=0;e<o;e++)a[e](r[e]);return c||(l.wire=(e=>{const{childNodes:t}=e,{length:n}=t;if(n<2)return n?t[0]:e;const r=q.call(t,0);return{ELEMENT_NODE:1,nodeType:111,firstChild:r[0],lastChild:r[n-1],valueOf(){if(t.length!==n){let t=0;for(;t<n;)e.appendChild(r[t++])}return e}}})(s))},se=({stack:e},t,n)=>{for(let r=0;r<n;r++){const n=t[r];n instanceof ae?t[r]=le(e[r]||(e[r]={stack:[],entry:null,wire:null}),n):H(n)?se(e[r]||(e[r]={stack:[],entry:null,wire:null}),n,n.length):e[r]=null}n<e.length&&e.splice(n)};function ae(e,t,n){this.type=e,this.template=t,this.values=n}const{create:ce,defineProperties:ue}=Object,ie=e=>{const t=a(new WeakMap);return ue(((t,...n)=>new ae(e,t,n)),{for:{value(n,r){const o=t.get(n)||t.set(n,ce(null));return o[r]||(o[r]=(t=>(n,...r)=>le(t,{type:e,template:n,values:r}))({stack:[],entry:null,wire:null}))}},node:{value:(t,...n)=>le({stack:[],entry:null,wire:null},{type:e,template:t,values:n}).valueOf()}})},fe=a(new WeakMap),de=ie("html"),pe=ie("svg"),{isArray:he}=Array,{create:ge}=Object,ve=(e,...t)=>new ae("html",e,t);ve.for=Te(de);const me=(e,...t)=>new ae("svg",e,t);me.for=Te(pe);const ye=a(new WeakMap),we=(e,t)=>{const n="function"==typeof t?t():t,r=ye.get(e)||ye.set(e,Ne(null));return r.w=e,r.W=t,((e,t)=>{const n="function"==typeof t?t():t,r=fe.get(e)||fe.set(e,{stack:[],entry:null,wire:null}),o=n instanceof ae?le(r,n):n;return o!==r.wire&&(r.wire=o,e.textContent="",e.appendChild(o.valueOf())),e})(e,n instanceof Me?Ce(r,n):($e(r,n),n))};let ke=!1;const be=(e,t)=>{t!==e.node&&(e.node&&(ke=!0),e.node=t)},Ne=e=>({p:e,stack:[],entry:null}),Ce=(e,{fn:t,template:n,values:r})=>{let{entry:o}=e;return o&&o.fn===t||(e.entry=o={fn:t,hook:null,node:null},o.hook=((e,t)=>S((function(){const n=t.fn.apply(null,arguments);n instanceof ae?($e(e,n),be(t,Ee(t,n))):be(t,n);try{return t.node}finally{if(ke){ke=!1;let t=e;for(;t.p;)t=t.p;we(t.w,t.W)}}})))(Ne(e),o)),o.hook(n,...r)},$e=(e,{values:t})=>{xe(e,t,t.length)},xe=(e,t,n)=>{const{stack:r}=e;for(let o=0;o<n;o++){const n=t[o];n instanceof Me?t[o]=Ce(r[o]||(r[o]=Ne(e)),n):n instanceof ae?$e(r[o]||(r[o]=Ne(e)),n):he(n)?xe(r[o]||(r[o]=Ne(e)),n,n.length):r[o]=null}n<r.length&&r.splice(n)},Ee=(e,{type:t,template:n,values:r})=>("svg"===t?pe:de).for(e,t)(n,...r);function Me(e,t,n){this.fn=e,this.template=t,this.values=n}function Te(e){const t=a(new WeakMap);return(n,r)=>{const o=t.get(n)||t.set(n,ge(null)),l=o[r]||(o[r]=Ne(null));return(t,...o)=>(xe(l,o),e.for(n,r)(t,...o))}}return e.Component=function(e){return(t,...n)=>new Me(e,t,n)},e.contextual=e=>{let t=!0,n=null;const r=u((function(){return e.apply(n,arguments)}));return function e(){const o=r.apply(n=this,arguments);return t&&(t=!t,$(r)&&w.set(e,w.get(r))),o}},e.createContext=e=>{const t={value:e,provide:m};return g.set(t,[]),t},e.html=ve,e.render=we,e.svg=me,e.useCallback=(e,t)=>M((()=>e),t),e.useContext=e=>{const{hook:t,args:n}=c,r=g.get(e),o={hook:t,args:n};return r.some(y,o)||r.push(o),e.value},e.useEffect=x,e.useLayoutEffect=E,e.useMemo=M,e.useReducer=h,e.useRef=e=>{const t=c.i++,{stack:n,length:r}=c;return t===r&&(c.length=n.push({current:e})),n[t]},e.useState=(e,t)=>h(p,e,void 0,t),Object.defineProperty(e,"__esModule",{value:!0}),e}({});
let S=null,A=null,L=null;const T=new WeakMap,_=(e,t,n,r)=>e?[r[0],s=>{T.has(e)||(T.set(e,0),b.then((()=>{T.delete(e),e.apply(t,n)}))),r[1](s)}]:r,O=(e,t)=>y(t?function t(){const[n,r,s]=[S,A,L];[S,A,L]=[t,this,arguments];try{return e.apply(A,L)}finally{[S,A,L]=[n,r,s]}}:e);
/*! (c) Andrea Giammarchi - ISC */
let W=null;const j=({firstChild:e})=>{if(e&&1!==e.nodeType&&!(e=e.nextElementSibling))throw"unobservable";return e},R=e=>{const{nodeType:t}=e;if(t)return 1===t?e:j(e);{const t=e.valueOf();return t!==e?R(t):j(t)}},B=(e,r)=>{const s=O(e,r);return function(){const e=s.apply(this,arguments);if(v(s)){const r=R(e);W||(W=n(r.ownerDocument,"children",t)),W.has(r)||W.connect(r,{disconnected(){p(s)}})}return e}};var D=e=>({get:t=>e.get(t),set:(t,n)=>(e.set(t,n),n)});const H=/([^\s\\>"'=]+)\s*=\s*(['"]?)$/,z=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,P=/<[a-z][^>]+$/i,q=/>[^<>]*$/,F=/<([a-z]+[a-z0-9:._-]*)([^>]*?)(\/>)/gi,G=/\s+$/,I=(e,t)=>0<t--&&(P.test(e[t])||!q.test(e[t])&&I(e,t)),J=(e,t,n)=>z.test(t)?e:`<${t}${n.replace(G,"")}></${t}>`;const{isArray:K}=Array,{indexOf:Q,slice:U}=[],V=(e,t)=>111===e.nodeType?1/t<0?t?(({firstChild:e,lastChild:t})=>{const n=document.createRange();return n.setStartAfter(e),n.setEndAfter(t),n.deleteContents(),e})(e):e.lastChild:t?e.valueOf():e.firstChild:e;
/*! (c) Andrea Giammarchi - ISC */
self.X=function(e){var t="fragment",n="template",r="content"in l(n)?function(e){var t=l(n);return t.innerHTML=e,t.content}:function(e){var r=l(t),o=l(n),c=null;if(/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)){var a=RegExp.$1;o.innerHTML="<table>"+e+"</table>",c=o.querySelectorAll(a)}else o.innerHTML=e,c=o.childNodes;return s(r,c),r};return function(e,t){return("svg"===t?o:r)(e)};function s(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function l(n){return n===t?e.createDocumentFragment():e.createElementNS("http://www.w3.org/1999/xhtml",n)}function o(e){var n=l(t),r=l("div");return r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",s(n,r.firstChild.childNodes),n}}(document);const Y=({childNodes:e},t)=>e[t],Z=e=>{const t=[];let{parentNode:n}=e;for(;n;)t.push(Q.call(n.childNodes,e)),n=(e=n).parentNode;return t},{createTreeWalker:ee,importNode:te}=document,ne=1!=te.length,re=ne?(e,t)=>te.call(document,X(e,t),!0):X,se=ne?e=>ee.call(document,e,129,null,!1):e=>ee.call(document,e,129),le=(e,t,n)=>((e,t,n,r,s)=>{const l=n.length;let o=t.length,c=l,a=0,i=0,u=null;for(;a<o||i<c;)if(o===a){const t=c<l?i?r(n[i-1],-0).nextSibling:r(n[c-i],0):s;for(;i<c;)e.insertBefore(r(n[i++],1),t)}else if(c===i)for(;a<o;)u&&u.has(t[a])||e.removeChild(r(t[a],-1)),a++;else if(t[a]===n[i])a++,i++;else if(t[o-1]===n[c-1])o--,c--;else if(t[a]===n[c-1]&&n[i]===t[o-1]){const s=r(t[--o],-1).nextSibling;e.insertBefore(r(n[i++],1),r(t[a++],-1).nextSibling),e.insertBefore(r(n[--c],1),s),t[o]=n[c]}else{if(!u){u=new Map;let e=i;for(;e<c;)u.set(n[e],e++)}if(u.has(t[a])){const s=u.get(t[a]);if(i<s&&s<c){let l=a,h=1;for(;++l<o&&l<c&&u.get(t[l])===s+h;)h++;if(h>s-i){const l=r(t[a],0);for(;i<s;)e.insertBefore(r(n[i++],1),l)}else e.replaceChild(r(n[i++],1),r(t[a++],-1))}else a++}else e.removeChild(r(t[a++],-1))}return n})(e.parentNode,t,n,V,e),oe=(e,t)=>"ref"===t?(e=>t=>{"function"==typeof t?t(e):t.current=e})(e):"aria"===t?(e=>t=>{for(const n in t){const r="role"===n?n:`aria-${n}`,s=t[n];null==s?e.removeAttribute(r):e.setAttribute(r,s)}})(e):".dataset"===t?(({dataset:e})=>t=>{for(const n in t){const r=t[n];null==r?delete e[n]:e[n]=r}})(e):"."===t.slice(0,1)?((e,t)=>n=>{e[t]=n})(e,t.slice(1)):"on"===t.slice(0,2)?((e,t)=>{let n,r=t.slice(2);return!(t in e)&&t.toLowerCase()in e&&(r=r.toLowerCase()),t=>{const s=K(t)?t:[t,!1];n!==s[0]&&(n&&e.removeEventListener(r,n,s[1]),(n=s[0])&&e.addEventListener(r,n,s[1]))}})(e,t):((e,t)=>{let n,r=!0;const s=document.createAttributeNS(null,t);return t=>{n!==t&&(n=t,null==n?r||(e.removeAttributeNode(s),r=!0):(s.value=t,r&&(e.setAttributeNodeNS(s),r=!1)))}})(e,t);function ce(e){const{type:t,path:n}=e,r=n.reduceRight(Y,this);return"node"===t?(e=>{let t,n,r=[];const s=l=>{switch(typeof l){case"string":case"number":case"boolean":t!==l&&(t=l,n?n.textContent=l:n=document.createTextNode(l),r=le(e,r,[n]));break;case"object":case"undefined":if(null==l){t!=l&&(t=l,r=le(e,r,[]));break}if(K(l)){t=l,0===l.length?r=le(e,r,[]):"object"==typeof l[0]?r=le(e,r,l):s(String(l));break}"ELEMENT_NODE"in l&&t!==l&&(t=l,r=le(e,r,11===l.nodeType?U.call(l.childNodes):[l]))}};return s})(r):"attr"===t?oe(r,e.name):(e=>{let t;return n=>{t!=n&&(t=n,e.textContent=null==n?"":n)}})(r)}const ae="isµ",ie=D(new WeakMap),ue=(e,t)=>{const n=((e,t,n)=>{const r=[],{length:s}=e;for(let n=1;n<s;n++){const s=e[n-1];r.push(H.test(s)&&I(e,n)?s.replace(H,((e,r,s)=>`${t}${n-1}=${s||'"'}${r}${s?"":'"'}`)):`${s}\x3c!--${t}${n-1}--\x3e`)}r.push(e[s-1]);const l=r.join("").trim();return n?l:l.replace(F,J)})(t,ae,"svg"===e),r=re(n,e),s=se(r),l=[],o=t.length-1;let c=0,a=`isµ${c}`;for(;c<o;){const e=s.nextNode();if(!e)throw`bad template: ${n}`;if(8===e.nodeType)e.textContent===a&&(l.push({type:"node",path:Z(e)}),a="isµ"+ ++c);else{for(;e.hasAttribute(a);)l.push({type:"attr",path:Z(e),name:e.getAttribute(a)}),e.removeAttribute(a),a="isµ"+ ++c;/^(?:style|textarea)$/i.test(e.tagName)&&e.textContent.trim()===`\x3c!--${a}--\x3e`&&(e.textContent="",l.push({type:"text",path:Z(e)}),a="isµ"+ ++c)}}return{content:r,nodes:l}},he=(e,t)=>{const{content:n,nodes:r}=ie.get(t)||ie.set(t,ue(e,t)),s=te.call(document,n,!0);return{content:s,updates:r.map(ce,s)}},de=(e,{type:t,template:n,values:r})=>{const{length:s}=r;fe(e,r,s);let{entry:l}=e;l&&l.template===n&&l.type===t||(e.entry=l=((e,t)=>{const{content:n,updates:r}=he(e,t);return{type:e,template:t,content:n,updates:r,wire:null}})(t,n));const{content:o,updates:c,wire:a}=l;for(let e=0;e<s;e++)c[e](r[e]);return a||(l.wire=(e=>{const{childNodes:t}=e,{length:n}=t;if(n<2)return n?t[0]:e;const r=U.call(t,0);return{ELEMENT_NODE:1,nodeType:111,firstChild:r[0],lastChild:r[n-1],valueOf(){if(t.length!==n){let t=0;for(;t<n;)e.appendChild(r[t++])}return e}}})(o))},fe=({stack:e},t,n)=>{for(let r=0;r<n;r++){const n=t[r];n instanceof pe?t[r]=de(e[r]||(e[r]={stack:[],entry:null,wire:null}),n):K(n)?fe(e[r]||(e[r]={stack:[],entry:null,wire:null}),n,n.length):e[r]=null}n<e.length&&e.splice(n)};function pe(e,t,n){this.type=e,this.template=t,this.values=n}const{create:ge,defineProperties:ve}=Object,me=e=>{const t=D(new WeakMap);return ve(((t,...n)=>new pe(e,t,n)),{for:{value(n,r){const s=t.get(n)||t.set(n,ge(null));return s[r]||(s[r]=(t=>(n,...r)=>de(t,{type:e,template:n,values:r}))({stack:[],entry:null,wire:null}))}},node:{value:(t,...n)=>de({stack:[],entry:null,wire:null},{type:e,template:t,values:n}).valueOf()}})},ye=D(new WeakMap),we=me("html"),be=me("svg"),{isArray:$e}=Array,{create:Ce}=Object,Ee=(e,...t)=>new pe("html",e,t);Ee.for=Oe(we);const ke=(e,...t)=>new pe("svg",e,t);ke.for=Oe(be);const xe=D(new WeakMap),Ne=(e,t)=>B((function(){const n=t.f.apply(this,arguments);return n instanceof pe?(Ae(e,n),t.$=Te(t,n)):t.$=n,t.$})),Me=()=>({s:[],e:null}),Se=(e,{f:t,c:n,a:r})=>{let{e:s}=e;return s&&s.f===t||(e.e=s={f:t,h:null,$:null},s.h=Ne(Me(),s)),s.h.apply(n,r)},Ae=(e,{values:t})=>{Le(e,t,t.length)},Le=(e,t,n)=>{const{s:r}=e;for(let e=0;e<n;e++){const n=t[e];n instanceof _e?t[e]=Se(r[e]||(r[e]=Me()),n):n instanceof pe?Ae(r[e]||(r[e]=Me()),n):$e(n)?Le(r[e]||(r[e]=Me()),n,n.length):r[e]=null}n<r.length&&r.splice(n)},Te=(e,{type:t,template:n,values:r})=>("svg"===t?be:we).for(e,t)(n,...r);function _e(e,t,n){this.f=e,this.c=t,this.a=n}function Oe(e){const t=D(new WeakMap);return(n,r)=>{const s=t.get(n)||t.set(n,Ce(null)),l=s[r]||(s[r]=Me());return(t,...s)=>(Le(l,s),e.for(n,r)(t,...s))}}return e.Component=function(e){return function(){return new _e(e,this,arguments)}},e.createContext=e=>({_:new Set,provide:$,value:e}),e.html=Ee,e.render=(e,t)=>(xe.get(e)||xe.set(e,{c:Me(),h:B((function(t){const n="function"==typeof t?t():t;return((e,t)=>{const n="function"==typeof t?t():t,r=ye.get(e)||ye.set(e,{stack:[],entry:null,wire:null}),s=n instanceof pe?de(r,n):n;return s!==r.wire&&(r.wire=s,e.textContent="",e.appendChild(s.valueOf())),e})(e,n instanceof _e?Se(this.c,n):(Ae(this.c,n),n))}),e)})).h(t),e.svg=ke,e.useCallback=(e,t)=>C((()=>e),t),e.useContext=({_:e,value:t})=>(e.add(g()),t),e.useEffect=k,e.useLayoutEffect=x,e.useMemo=C,e.useReducer=(e,t,n)=>_(S,A,L,M(e,t,n)),e.useRef=e=>{const t=g(),{i:n,s:r}=t;return n===r.length&&r.push({current:e}),r[t.i++]},e.useState=e=>_(S,A,L,(e=>M(N,e))(e)),Object.defineProperty(e,"__esModule",{value:!0}),e}({});

@@ -1,2 +0,2 @@

import {augmentor} from 'dom-augmentor';
import {hooked} from 'uhooks-dom';
import umap from 'umap';

@@ -21,67 +21,50 @@

const cache = umap(new WeakMap);
const render = (where, what) => {
const hook = typeof what === 'function' ? what() : what;
const info = cache.get(where) || cache.set(where, createCache(null));
info.w = where;
info.W = what;
return $render(
where,
hook instanceof Hook ?
unroll(info, hook) :
(unrollHole(info, hook), hook)
);
};
const render = (where, what) => (
cache.get(where) || cache.set(where, {
c: createCache(),
h: hooked(
function (what) {
const value = typeof what === 'function' ? what() : what;
return $render(
where,
value instanceof Hook ?
unroll(this.c, value) :
(unrollHole(this.c, value), value)
);
},
where
)
})
).h(what);
export {Component, render, html, svg};
export {
contextual,
useState,
useEffect,
useContext, createContext,
useRef,
useReducer,
useCallback,
useMemo,
useLayoutEffect
} from 'dom-augmentor';
createContext, useContext,
useCallback, useMemo,
useEffect, useLayoutEffect,
useReducer, useState, useRef
} from 'uhooks-dom';
let update = false;
const updateEntry = (entry, node) => {
if (node !== entry.node) {
if (entry.node)
update = true;
entry.node = node;
}
};
const createHook = (info, entry) => augmentor(function () {
const hole = entry.fn.apply(null, arguments);
const createHook = (info, entry) => hooked(function () {
const hole = entry.f.apply(this, arguments);
if (hole instanceof Hole) {
unrollHole(info, hole);
updateEntry(entry, view(entry, hole));
entry.$ = view(entry, hole);
}
else
updateEntry(entry, hole);
try { return entry.node; }
finally {
if (update) {
update = false;
let p = info;
while (p.p)
p = p.p;
render(p.w, p.W);
}
}
entry.$ = hole;
return entry.$;
});
const createCache = p => ({p, stack: [], entry: null});
const createCache = () => ({s: [], e: null});
const unroll = (info, {fn, template, values}) => {
let {entry} = info;
if (!entry || entry.fn !== fn) {
info.entry = (entry = {fn, hook: null, node: null});
entry.hook = createHook(createCache(info), entry);
const unroll = (info, {f, c, a}) => {
let {e} = info;
if (!e || e.f !== f) {
info.e = (e = {f, h: null, $: null});
e.h = createHook(createCache(), e);
}
return entry.hook(template, ...values);
return e.h.apply(c, a);
};

@@ -94,30 +77,32 @@

const unrollValues = (info, values, length) => {
const {stack} = info;
const {s} = info;
for (let i = 0; i < length; i++) {
const hook = values[i];
if (hook instanceof Hook)
values[i] = unroll(stack[i] || (stack[i] = createCache(info)), hook);
values[i] = unroll(s[i] || (s[i] = createCache()), hook);
else if (hook instanceof Hole)
unrollHole(stack[i] || (stack[i] = createCache(info)), hook);
unrollHole(s[i] || (s[i] = createCache()), hook);
else if (isArray(hook))
unrollValues(stack[i] || (stack[i] = createCache(info)), hook, hook.length);
unrollValues(s[i] || (s[i] = createCache()), hook, hook.length);
else
stack[i] = null;
s[i] = null;
}
if (length < stack.length)
stack.splice(length);
if (length < s.length)
s.splice(length);
};
const view = (entry, {type, template, values}) =>
const view = (e, {type, template, values}) =>
(type === 'svg' ? $svg : $html)
.for(entry, type)(template, ...values);
.for(e, type)(template, ...values);
function Component(fn) {
return (template, ...values) => new Hook(fn, template, values);
function Component(f) {
return function () {
return new Hook(f, this, arguments);
};
}
function Hook(fn, template, values) {
this.fn = fn;
this.template = template;
this.values = values;
function Hook(f, c, a) {
this.f = f;
this.c = c;
this.a = a;
}

@@ -128,8 +113,8 @@

return (
(entry, id) => {
const store = cache.get(entry) || cache.set(entry, create(null));
const info = store[id] || (store[id] = createCache(null));
(e, id) => {
const store = cache.get(e) || cache.set(e, create(null));
const info = store[id] || (store[id] = createCache());
return (template, ...values) => {
unrollValues(info, values);
return uhtml.for(entry, id)(template, ...values);
return uhtml.for(e, id)(template, ...values);
};

@@ -136,0 +121,0 @@ }

@@ -40,5 +40,3 @@ self.uland = (function (exports) {

/*! (c) Andrea Giammarchi - ISC */
var self = null ||
/* istanbul ignore next */
{};
var self = {};
self.CustomEvent = typeof CustomEvent === 'function' ? CustomEvent : function (__p__) {

@@ -57,475 +55,389 @@ CustomEvent[__p__] = new CustomEvent('').constructor[__p__];

/*! (c) Andrea Giammarchi - ISC */
var self$1 = null ||
/* istanbul ignore next */
{};
/**
* @typedef {Object} Handler an object that handle events.
* @property {(event: Event) => void} connected an optional method triggered when node is connected.
* @property {(event: Event) => void} disconnected an optional method triggered when node is disconnected.
*/
try {
self$1.WeakSet = WeakSet;
} catch (WeakSet) {
// requires a global WeakMap (IE11+)
(function (WeakMap) {
var all = new WeakMap();
var proto = WeakSet.prototype;
/**
* @typedef {Object} UConnect an utility to connect or disconnect nodes to observe.
* @property {(node: Node, handler?: Handler) => void} connect a method to start observing a generic Node.
* @property {(node: Node) => void} disconnect a method to stop observing a generic Node.
* @property {() => void} kill a method to kill/disconnect the MutationObserver.
*/
proto.add = function (value) {
return all.get(this).set(value, 1), this;
};
/**
* Attach a MutationObserver to a generic node and returns a UConnect instance.
* @param {Node} root a DOM node to observe for mutations.
* @param {string} parse the kind of nodes to parse: children, by default, or childNodes.
* @param {Event} CE an Event/CustomEvent constructor (polyfilled in SSR).
* @param {MutationObserver} MO a MutationObserver constructor (polyfilled in SSR).
* @returns {UConnect} an utility to connect or disconnect nodes to observe.
*/
var observe = function observe(root, parse, CE, MO) {
var observed = new WeakMap(); // these two should be WeakSet but IE11 happens
proto["delete"] = function (value) {
return all.get(this)["delete"](value);
};
var wmin = new WeakMap();
var wmout = new WeakMap();
proto.has = function (value) {
return all.get(this).has(value);
};
var has = function has(node) {
return observed.has(node);
};
self$1.WeakSet = WeakSet;
function WeakSet(iterable) {
all.set(this, new WeakMap());
if (iterable) iterable.forEach(this.add, this);
var disconnect = function disconnect(node) {
if (has(node)) {
listener(node, node.removeEventListener, observed.get(node));
observed["delete"](node);
}
})(WeakMap);
}
};
var WeakSet$1 = self$1.WeakSet;
var connect = function connect(node, handler) {
disconnect(node);
if (!(handler || (handler = {})).handleEvent) handler.handleEvent = handleEvent;
listener(node, node.addEventListener, handler);
observed.set(node, handler);
};
/*! (c) Andrea Giammarchi */
function disconnected(poly) {
var listener = function listener(node, method, handler) {
method.call(node, 'disconnected', handler);
method.call(node, 'connected', handler);
};
var Event = poly.Event;
var WeakSet = poly.WeakSet;
var notObserving = true;
var observer = null;
return function observe(node) {
if (notObserving) {
notObserving = !notObserving;
observer = new WeakSet();
startObserving(node.ownerDocument);
var notifyObserved = function notifyObserved(nodes, type, wmin, wmout) {
for (var length = nodes.length, i = 0; i < length; i++) {
notifyTarget(nodes[i], type, wmin, wmout);
}
observer.add(node);
return node;
};
function startObserving(document) {
var connected = new WeakSet();
var disconnected = new WeakSet();
var notifyTarget = function notifyTarget(node, type, wmin, wmout) {
if (has(node) && !wmin.has(node)) {
wmout["delete"](node);
wmin.set(node, 0);
node.dispatchEvent(new (CE || CustomEvent)(type));
}
try {
new MutationObserver(changes).observe(document, {
subtree: true,
childList: true
});
} catch (o_O) {
var timer = 0;
var records = [];
notifyObserved(node[parse || 'children'] || [], type, wmin, wmout);
};
var reschedule = function reschedule(record) {
records.push(record);
clearTimeout(timer);
timer = setTimeout(function () {
changes(records.splice(timer = 0, records.length));
}, 0);
};
document.addEventListener('DOMNodeRemoved', function (event) {
reschedule({
addedNodes: [],
removedNodes: [event.target]
});
}, true);
document.addEventListener('DOMNodeInserted', function (event) {
reschedule({
addedNodes: [event.target],
removedNodes: []
});
}, true);
var mo = new (MO || MutationObserver)(function (nodes) {
for (var length = nodes.length, i = 0; i < length; i++) {
var _nodes$i = nodes[i],
removedNodes = _nodes$i.removedNodes,
addedNodes = _nodes$i.addedNodes;
notifyObserved(removedNodes, 'disconnected', wmout, wmin);
notifyObserved(addedNodes, 'connected', wmin, wmout);
}
function changes(records) {
for (var record, length = records.length, i = 0; i < length; i++) {
record = records[i];
dispatchAll(record.removedNodes, 'disconnected', disconnected, connected);
dispatchAll(record.addedNodes, 'connected', connected, disconnected);
}
});
mo.observe(root || document, {
subtree: true,
childList: true
});
return {
has: has,
connect: connect,
disconnect: disconnect,
kill: function kill() {
mo.disconnect();
}
};
};
function dispatchAll(nodes, type, wsin, wsout) {
for (var node, event = new Event(type), length = nodes.length, i = 0; i < length; (node = nodes[i++]).nodeType === 1 && dispatchTarget(node, event, type, wsin, wsout)) {
}
}
function dispatchTarget(node, event, type, wsin, wsout) {
if (observer.has(node) && !wsin.has(node)) {
wsout["delete"](node);
wsin.add(node);
node.dispatchEvent(event);
/*
// The event is not bubbling (perf reason: should it?),
// hence there's no way to know if
// stop/Immediate/Propagation() was called.
// Should DOM Level 0 work at all?
// I say it's a YAGNI case for the time being,
// and easy to implement in user-land.
if (!event.cancelBubble) {
var fn = node['on' + type];
if (fn)
fn.call(node, event);
}
*/
}
for (var // apparently is node.children || IE11 ... ^_^;;
// https://github.com/WebReflection/disconnected/issues/1
children = node.children || [], length = children.length, i = 0; i < length; dispatchTarget(children[i++], event, type, wsin, wsout)) {
}
}
}
function handleEvent(event) {
if (event.type in this) this[event.type](event);
}
var compat = typeof cancelAnimationFrame === 'function';
var cAF = compat ? cancelAnimationFrame : clearTimeout;
var rAF = compat ? requestAnimationFrame : setTimeout;
function reraf(limit) {
var force, timer, callback, self, args;
reset();
return function reschedule(_callback, _self, _args) {
callback = _callback;
self = _self;
args = _args;
if (!timer) timer = rAF(invoke);
if (--force < 0) stop(true);
return stop;
var Lie = typeof Promise === 'function' ? Promise : function (fn) {
var queue = [],
resolved = 0,
value;
fn(function ($) {
value = $;
resolved = 1;
queue.splice(0).forEach(then);
});
return {
then: then
};
function invoke() {
reset();
callback.apply(self, args || []);
function then(fn) {
return resolved ? setTimeout(fn, 0, value) : queue.push(fn), this;
}
};
function reset() {
force = limit || Infinity;
timer = compat ? 0 : null;
var h = null,
schedule = new Set();
var hooks = new WeakMap();
var invoke = function invoke(effect) {
var $ = effect.$,
r = effect.r,
h = effect.h;
if (isFunction(r)) {
fx.get(h)["delete"](effect);
r();
}
function stop(flush) {
var didStop = !!timer;
if (isFunction(effect.r = $())) fx.get(h).add(effect);
};
if (didStop) {
cAF(timer);
if (flush) invoke();
}
var runSchedule = function runSchedule() {
var previous = schedule;
schedule = new Set();
previous.forEach(update);
};
return didStop;
}
var fx = new WeakMap();
var effects = [];
var layoutEffects = [];
function different(value, i) {
return value !== this[i];
}
var umap = (function (_) {
return {
// About: get: _.get.bind(_)
// It looks like WebKit/Safari didn't optimize bind at all,
// so that using bind slows it down by 60%.
// Firefox and Chrome are just fine in both cases,
// so let's use the approach that works fast everywhere 👍
get: function get(key) {
return _.get(key);
},
set: function set(key, value) {
return _.set(key, value), value;
}
var dropEffect = function dropEffect(hook) {
var effects = fx.get(hook);
if (effects) wait.then(function () {
effects.forEach(function (effect) {
effect.r();
effect.r = null;
});
effects.clear();
});
};
var getInfo = function getInfo() {
return hooks.get(h);
};
var hasEffect = function hasEffect(hook) {
return fx.has(hook);
};
var isFunction = function isFunction(f) {
return typeof f === 'function';
};
var hooked = function hooked(callback) {
var info = {
h: hook,
c: null,
a: null,
e: 0,
i: 0,
s: []
};
});
hooks.set(hook, info);
return hook;
/*! (c) Andrea Giammarchi - ISC */
var state = null; // main exports
function hook() {
var p = h;
h = hook;
info.e = info.i = 0;
var augmentor = function augmentor(fn) {
var stack = [];
return function hook() {
var prev = state;
var after = [];
state = {
hook: hook,
args: arguments,
stack: stack,
i: 0,
length: stack.length,
after: after
};
try {
return fn.apply(null, arguments);
return callback.apply(info.c = this, info.a = arguments);
} finally {
state = prev;
for (var i = 0, length = after.length; i < length; i++) {
after[i]();
}
h = p;
if (effects.length) wait.then(effects.forEach.bind(effects.splice(0), invoke));
if (layoutEffects.length) layoutEffects.splice(0).forEach(invoke);
}
};
}
};
var contextual = function contextual(fn) {
var check = true;
var context = null;
var augmented = augmentor(function () {
return fn.apply(context, arguments);
});
return function hook() {
var result = augmented.apply(context = this, arguments); // perform hasEffect check only once
var reschedule = function reschedule(info) {
if (!schedule.has(info)) {
info.e = 1;
schedule.add(info);
wait.then(runSchedule);
}
};
var update = function update(_ref) {
var h = _ref.h,
c = _ref.c,
a = _ref.a,
e = _ref.e;
// avoid running schedules when the hook is
// re-executed before such schedule happens
if (e) h.apply(c, a);
};
var wait = new Lie(function ($) {
return $();
});
if (check) {
check = !check; // and copy same Array if any FX was used
if (hasEffect(augmented)) effects.set(hook, effects.get(augmented));
}
return result;
var createContext = function createContext(value) {
return {
_: new Set(),
provide: provide,
value: value
};
}; // useReducer
var updates = umap(new WeakMap());
var hookdate = function hookdate(hook, ctx, args) {
hook.apply(ctx, args);
};
var useContext = function useContext(_ref) {
var _ = _ref._,
value = _ref.value;
var defaults = {
async: false,
always: false
};
_.add(getInfo());
var getValue = function getValue(value, f) {
return typeof f == 'function' ? f(value) : f;
return value;
};
var useReducer = function useReducer(reducer, value, init, options) {
var i = state.i++;
var _state = state,
hook = _state.hook,
args = _state.args,
stack = _state.stack,
length = _state.length;
if (i === length) state.length = stack.push({});
var ref = stack[i];
ref.args = args;
function provide(newValue) {
var _ = this._,
value = this.value;
if (i === length) {
var fn = typeof init === 'function';
if (value !== newValue) {
this._ = new Set();
this.value = newValue;
var _ref = (fn ? options : init) || options || defaults,
asy = _ref.async,
always = _ref.always;
ref.$ = fn ? init(value) : getValue(void 0, value);
ref._ = asy ? updates.get(hook) || updates.set(hook, reraf()) : hookdate;
ref.f = function (value) {
var $value = reducer(ref.$, value);
if (always || ref.$ !== $value) {
ref.$ = $value;
ref._(hook, null, ref.args);
}
};
_.forEach(update);
}
}
return [ref.$, ref.f];
}; // useState
var useState = function useState(value, options) {
return useReducer(getValue, value, void 0, options);
}; // useContext
var hooks = new WeakMap();
var invoke = function invoke(_ref2) {
var hook = _ref2.hook,
args = _ref2.args;
hook.apply(null, args);
var useCallback = function useCallback(fn, guards) {
return useMemo(function () {
return fn;
}, guards);
};
var createContext = function createContext(value) {
var context = {
value: value,
provide: provide
var useMemo = function useMemo(memo, guards) {
var info = getInfo();
var i = info.i,
s = info.s;
if (i === s.length || !guards || guards.some(different, s[i]._)) s[i] = {
$: memo(),
_: guards
};
hooks.set(context, []);
return context;
return s[info.i++].$;
};
var useContext = function useContext(context) {
var _state2 = state,
hook = _state2.hook,
args = _state2.args;
var stack = hooks.get(context);
var info = {
hook: hook,
args: args
};
if (!stack.some(update, info)) stack.push(info);
return context.value;
};
function provide(value) {
if (this.value !== value) {
this.value = value;
hooks.get(this).forEach(invoke);
}
}
var createEffect = function createEffect(stack) {
return function (callback, guards) {
var info = getInfo();
var i = info.i,
s = info.s,
h = info.h;
var call = i === s.length;
function update(_ref3) {
var hook = _ref3.hook;
return hook === this.hook;
} // dropEffect, hasEffect, useEffect, useLayoutEffect
if (call) {
if (!fx.has(h)) fx.set(h, new Set());
s.push({
$: callback,
_: guards,
r: null,
h: h
});
}
var effect = s[info.i++];
if (call || !guards || guards.some(different, effect._)) stack.push(effect);
};
};
var effects = new WeakMap();
var fx = umap(effects);
var useEffect = createEffect(effects);
var useLayoutEffect = createEffect(layoutEffects);
var stop = function stop() {};
var createEffect = function createEffect(asy) {
return function (effect, guards) {
var i = state.i++;
var _state3 = state,
hook = _state3.hook,
after = _state3.after,
stack = _state3.stack,
length = _state3.length;
if (i < length) {
var info = stack[i];
var _update = info.update,
values = info.values,
_stop = info.stop;
if (!guards || guards.some(different, values)) {
info.values = guards;
if (asy) _stop(asy);
var clean = info.clean;
if (clean) {
info.clean = null;
clean();
}
var _invoke = function _invoke() {
info.clean = effect();
};
if (asy) _update(_invoke);else after.push(_invoke);
}
} else {
var _update2 = asy ? reraf() : stop;
var _info = {
clean: null,
update: _update2,
values: guards,
stop: stop
};
state.length = stack.push(_info);
(fx.get(hook) || fx.set(hook, [])).push(_info);
var _invoke2 = function _invoke2() {
_info.clean = effect();
};
if (asy) _info.stop = _update2(_invoke2);else after.push(_invoke2);
}
};
var getValue = function getValue(value, f) {
return isFunction(f) ? f(value) : f;
};
var dropEffect = function dropEffect(hook) {
(effects.get(hook) || []).forEach(function (info) {
var clean = info.clean,
stop = info.stop;
stop();
if (clean) {
info.clean = null;
clean();
var useReducer = function useReducer(reducer, value, init) {
var info = getInfo();
var i = info.i,
s = info.s;
if (i === s.length) s.push({
$: isFunction(init) ? init(value) : getValue(void 0, value),
set: function set(value) {
s[i].$ = reducer(s[i].$, value);
reschedule(info);
}
});
var _s$info$i = s[info.i++],
$ = _s$info$i.$,
set = _s$info$i.set;
return [$, set];
};
var hasEffect = effects.has.bind(effects);
var useEffect = createEffect(true);
var useLayoutEffect = createEffect(false); // useMemo, useCallback
var useMemo = function useMemo(memo, guards) {
var i = state.i++;
var _state4 = state,
stack = _state4.stack,
length = _state4.length;
if (i === length) state.length = stack.push({
$: memo(),
_: guards
});else if (!guards || guards.some(different, stack[i]._)) stack[i] = {
$: memo(),
_: guards
};
return stack[i].$;
var useState = function useState(value) {
return useReducer(getValue, value);
};
var useCallback = function useCallback(fn, guards) {
return useMemo(function () {
return fn;
}, guards);
}; // useRef
var useRef = function useRef(value) {
var i = state.i++;
var _state5 = state,
stack = _state5.stack,
length = _state5.length;
if (i === length) state.length = stack.push({
current: value
var useRef = function useRef(current) {
var info = getInfo();
var i = info.i,
s = info.s;
if (i === s.length) s.push({
current: current
});
return stack[i];
return s[info.i++];
};
function different(value, i) {
return value !== this[i];
}
/*! (c) Andrea Giammarchi - ISC */
var h$1 = null,
c = null,
a = null;
var fx$1 = new WeakMap();
var find = function find(node) {
var firstChild = node.firstChild;
var wrap = function wrap(h, c, a, reduced) {
return h ? [reduced[0], function (value) {
if (!fx$1.has(h)) {
fx$1.set(h, 0);
wait.then(function () {
fx$1["delete"](h);
h.apply(c, a);
});
}
while (firstChild && firstChild.nodeType !== 1) {
firstChild = firstChild.nextSibling;
}
reduced[1](value);
}] : reduced;
};
if (firstChild) return firstChild;
throw 'unobservable';
var hooked$1 = function hooked$1(callback, outer) {
return hooked(outer ? function hook() {
var ph = h$1,
pc = c,
pa = a;
h$1 = hook;
c = this;
a = arguments;
try {
return callback.apply(c, a);
} finally {
h$1 = ph;
c = pc;
a = pa;
}
} : callback);
};
var useReducer$1 = function useReducer$1(reducer, value, init) {
return wrap(h$1, c, a, useReducer(reducer, value, init));
};
var useState$1 = function useState$1(value) {
return wrap(h$1, c, a, useState(value));
};
var observe = disconnected({
Event: CustomEvent$1,
WeakSet: WeakSet$1
});
/*! (c) Andrea Giammarchi - ISC */
var observer = null;
var observer = function observer(element, handler) {
var nodeType = element.nodeType;
var find = function find(_ref) {
var firstChild = _ref.firstChild;
if (firstChild && firstChild.nodeType !== 1 && !(firstChild = firstChild.nextElementSibling)) throw 'unobservable';
return firstChild;
};
if (nodeType) {
var node = nodeType === 1 ? element : find(element);
observe(node);
node.addEventListener('disconnected', handler, false);
} else {
var value = element.valueOf(); // give a chance to facades to return a reasonable value
if (value !== element) observer(value, handler);
var get = function get(node) {
var nodeType = node.nodeType;
if (nodeType) return nodeType === 1 ? node : find(node);else {
// give a chance to facades to return a reasonable value
var value = node.valueOf();
return value !== node ? get(value) : find(value);
}
};
var augmentor$1 = function augmentor$1(fn) {
var handler = null;
var hook = augmentor(fn);
var hooked$2 = function hooked(fn, outer) {
var hook = hooked$1(fn, outer);
return function () {
var node = hook.apply(this, arguments);
if (hasEffect(hook)) observer(node, handler || (handler = dropEffect.bind(null, hook)));
if (hasEffect(hook)) {
var element = get(node);
if (!observer) observer = observe(element.ownerDocument, 'children', CustomEvent$1);
if (!observer.has(element)) observer.connect(element, {
disconnected: function disconnected() {
dropEffect(hook);
}
});
}
return node;

@@ -535,2 +447,18 @@ };

var umap = (function (_) {
return {
// About: get: _.get.bind(_)
// It looks like WebKit/Safari didn't optimize bind at all,
// so that using bind slows it down by 60%.
// Firefox and Chrome are just fine in both cases,
// so let's use the approach that works fast everywhere 👍
get: function get(key) {
return _.get(key);
},
set: function set(key, value) {
return _.set(key, value), value;
}
};
});
var attr = /([^\s\\>"'=]+)\s*=\s*(['"]?)$/;

@@ -918,3 +846,3 @@ var empty = /^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;

var IE = importNode.length != 1; // IE11 and old Edge discard empty nodes when cloning, potentially
var isImportNodeLengthWrong = importNode.length != 1; // IE11 and old Edge discard empty nodes when cloning, potentially
// resulting in broken paths to find updates. The workaround here

@@ -925,3 +853,3 @@ // is to import once, upfront, the fragment that will be cloned

var createFragment = IE ? function (text, type) {
var createFragment = isImportNodeLengthWrong ? function (text, type) {
return importNode.call(document, createContent(text, type), true);

@@ -932,3 +860,3 @@ } : createContent; // IE11 and old Edge have a different createTreeWalker signature that

var createWalker = IE ? function (fragment) {
var createWalker = isImportNodeLengthWrong ? function (fragment) {
return createTreeWalker.call(document, fragment, 1 | 128, null, false);

@@ -1153,2 +1081,3 @@ } : function (fragment) {

if (/^(?:style|textarea)$/i.test(node.tagName) && node.textContent.trim() === "<!--".concat(search, "-->")) {
node.textContent = '';
nodes.push({

@@ -1375,48 +1304,28 @@ type: 'text',

var render$1 = function render$1(where, what) {
var hook = typeof what === 'function' ? what() : what;
var info = cache$2.get(where) || cache$2.set(where, createCache$1(null));
info.w = where;
info.W = what;
return render(where, hook instanceof Hook ? unroll$1(info, hook) : (unrollHole(info, hook), hook));
return (cache$2.get(where) || cache$2.set(where, {
c: createCache$1(),
h: hooked$2(function (what) {
var value = typeof what === 'function' ? what() : what;
return render(where, value instanceof Hook ? unroll$1(this.c, value) : (unrollHole(this.c, value), value));
}, where)
})).h(what);
};
var update$1 = false;
var updateEntry = function updateEntry(entry, node) {
if (node !== entry.node) {
if (entry.node) update$1 = true;
entry.node = node;
}
};
var createHook = function createHook(info, entry) {
return augmentor$1(function () {
var hole = entry.fn.apply(null, arguments);
return hooked$2(function () {
var hole = entry.f.apply(this, arguments);
if (hole instanceof Hole) {
unrollHole(info, hole);
updateEntry(entry, view(entry, hole));
} else updateEntry(entry, hole);
entry.$ = view(entry, hole);
} else entry.$ = hole;
try {
return entry.node;
} finally {
if (update$1) {
update$1 = false;
var p = info;
while (p.p) {
p = p.p;
}
render$1(p.w, p.W);
}
}
return entry.$;
});
};
var createCache$1 = function createCache(p) {
var createCache$1 = function createCache() {
return {
p: p,
stack: [],
entry: null
s: [],
e: null
};

@@ -1426,19 +1335,17 @@ };

var unroll$1 = function unroll(info, _ref) {
var _entry;
var f = _ref.f,
c = _ref.c,
a = _ref.a;
var e = info.e;
var fn = _ref.fn,
template = _ref.template,
values = _ref.values;
var entry = info.entry;
if (!entry || entry.fn !== fn) {
info.entry = entry = {
fn: fn,
hook: null,
node: null
if (!e || e.f !== f) {
info.e = e = {
f: f,
h: null,
$: null
};
entry.hook = createHook(createCache$1(info), entry);
e.h = createHook(createCache$1(), e);
}
return (_entry = entry).hook.apply(_entry, [template].concat(_toConsumableArray(values)));
return e.h.apply(c, a);
};

@@ -1452,33 +1359,29 @@

var unrollValues$1 = function unrollValues(info, values, length) {
var stack = info.stack;
var s = info.s;
for (var i = 0; i < length; i++) {
var hook = values[i];
if (hook instanceof Hook) values[i] = unroll$1(stack[i] || (stack[i] = createCache$1(info)), hook);else if (hook instanceof Hole) unrollHole(stack[i] || (stack[i] = createCache$1(info)), hook);else if (isArray$1(hook)) unrollValues(stack[i] || (stack[i] = createCache$1(info)), hook, hook.length);else stack[i] = null;
if (hook instanceof Hook) values[i] = unroll$1(s[i] || (s[i] = createCache$1()), hook);else if (hook instanceof Hole) unrollHole(s[i] || (s[i] = createCache$1()), hook);else if (isArray$1(hook)) unrollValues(s[i] || (s[i] = createCache$1()), hook, hook.length);else s[i] = null;
}
if (length < stack.length) stack.splice(length);
if (length < s.length) s.splice(length);
};
var view = function view(entry, _ref3) {
var view = function view(e, _ref3) {
var type = _ref3.type,
template = _ref3.template,
values = _ref3.values;
return (type === 'svg' ? svg : html)["for"](entry, type).apply(void 0, [template].concat(_toConsumableArray(values)));
return (type === 'svg' ? svg : html)["for"](e, type).apply(void 0, [template].concat(_toConsumableArray(values)));
};
function Component(fn) {
return function (template) {
for (var _len3 = arguments.length, values = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
values[_key3 - 1] = arguments[_key3];
}
return new Hook(fn, template, values);
function Component(f) {
return function () {
return new Hook(f, this, arguments);
};
}
function Hook(fn, template, values) {
this.fn = fn;
this.template = template;
this.values = values;
function Hook(f, c, a) {
this.f = f;
this.c = c;
this.a = a;
}

@@ -1488,12 +1391,12 @@

var cache = umap(new WeakMap());
return function (entry, id) {
var store = cache.get(entry) || cache.set(entry, create$1(null));
var info = store[id] || (store[id] = createCache$1(null));
return function (e, id) {
var store = cache.get(e) || cache.set(e, create$1(null));
var info = store[id] || (store[id] = createCache$1());
return function (template) {
for (var _len4 = arguments.length, values = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
values[_key4 - 1] = arguments[_key4];
for (var _len3 = arguments.length, values = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
values[_key3 - 1] = arguments[_key3];
}
unrollValues$1(info, values);
return uhtml["for"](entry, id).apply(void 0, [template].concat(values));
return uhtml["for"](e, id).apply(void 0, [template].concat(values));
};

@@ -1504,3 +1407,2 @@ };

exports.Component = Component;
exports.contextual = contextual;
exports.createContext = createContext;

@@ -1515,5 +1417,5 @@ exports.html = html$1;

exports.useMemo = useMemo;
exports.useReducer = useReducer;
exports.useReducer = useReducer$1;
exports.useRef = useRef;
exports.useState = useState;
exports.useState = useState$1;

@@ -1520,0 +1422,0 @@ Object.defineProperty(exports, '__esModule', { value: true });

@@ -1,6 +0,2 @@

self.uland=function(e){"use strict";function t(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}
/*! (c) Andrea Giammarchi - ISC */()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var r={};r.CustomEvent="function"==typeof CustomEvent?CustomEvent:function(e){return t[e]=new t("").constructor[e],t;function t(e,t){t||(t={});var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail),n}}("prototype");var a=r.CustomEvent,o={};
/*! (c) Andrea Giammarchi - ISC */try{o.WeakSet=WeakSet}catch(e){!function(e){var t=new e,n=r.prototype;function r(n){t.set(this,new e),n&&n.forEach(this.add,this)}n.add=function(e){return t.get(this).set(e,1),this},n.delete=function(e){return t.get(this).delete(e)},n.has=function(e){return t.get(this).has(e)},o.WeakSet=r}(WeakMap)}var u=o.WeakSet;
/*! (c) Andrea Giammarchi */var i="function"==typeof cancelAnimationFrame,c=i?cancelAnimationFrame:clearTimeout,l=i?requestAnimationFrame:setTimeout;function f(e){var t,n,r,a,o;return f(),function(e,i,c){return r=e,a=i,o=c,n||(n=l(u)),--t<0&&s(!0),s};function u(){f(),r.apply(a,o||[])}function f(){t=e||1/0,n=i?0:null}function s(e){var t=!!n;return t&&(c(n),e&&u()),t}}var s=function(e){return{get:function(t){return e.get(t)},set:function(t,n){return e.set(t,n),n}}},v=null,d=function(e){var t=[];return function n(){var r=v,a=[];v={hook:n,args:arguments,stack:t,i:0,length:t.length,after:a};try{return e.apply(null,arguments)}finally{v=r;for(var o=0,u=a.length;o<u;o++)a[o]()}}},p=s(new WeakMap),h=function(e,t,n){e.apply(t,n)},g={async:!1,always:!1},y=function(e,t){return"function"==typeof t?t(e):t},m=function(e,t,n,r){var a=v.i++,o=v,u=o.hook,i=o.args,c=o.stack,l=o.length;a===l&&(v.length=c.push({}));var s=c[a];if(s.args=i,a===l){var d="function"==typeof n,m=(d?r:n)||r||g,w=m.async,b=m.always;s.$=d?n(t):y(void 0,t),s._=w?p.get(u)||p.set(u,f()):h,s.f=function(t){var n=e(s.$,t);(b||s.$!==n)&&(s.$=n,s._(u,null,s.args))}}return[s.$,s.f]},w=new WeakMap,b=function(e){var t=e.hook,n=e.args;t.apply(null,n)};
/*! (c) Andrea Giammarchi - ISC */function k(e){this.value!==e&&(this.value=e,w.get(this).forEach(b))}function C(e){return e.hook===this.hook}var A=new WeakMap,E=s(A),N=function(){},x=function(e){return function(t,n){var r=v.i++,a=v,o=a.hook,u=a.after,i=a.stack;if(r<a.length){var c=i[r],l=c.update,s=c.values,d=c.stop;if(!n||n.some($,s)){c.values=n,e&&d(e);var p=c.clean;p&&(c.clean=null,p());var h=function(){c.clean=t()};e?l(h):u.push(h)}}else{var g=e?f():N,y={clean:null,update:g,values:n,stop:N};v.length=i.push(y),(E.get(o)||E.set(o,[])).push(y);var m=function(){y.clean=t()};e?y.stop=g(m):u.push(m)}}},S=function(e){(A.get(e)||[]).forEach((function(e){var t=e.clean;(0,e.stop)(),t&&(e.clean=null,t())}))},M=A.has.bind(A),T=x(!0),O=x(!1),W=function(e,t){var n=v.i++,r=v,a=r.stack;return n===r.length?v.length=a.push({$:e(),_:t}):t&&!t.some($,a[n]._)||(a[n]={$:e(),_:t}),a[n].$};function $(e,t){return e!==this[t]}
/*! (c) Andrea Giammarchi - ISC */var L=function(e){var t=e.Event,n=e.WeakSet,r=!0,a=null;return function(e){return r&&(r=!r,a=new n,function(e){var r=new n,o=new n;try{new MutationObserver(l).observe(e,{subtree:!0,childList:!0})}catch(t){var u=0,i=[],c=function(e){i.push(e),clearTimeout(u),u=setTimeout((function(){l(i.splice(u=0,i.length))}),0)};e.addEventListener("DOMNodeRemoved",(function(e){c({addedNodes:[],removedNodes:[e.target]})}),!0),e.addEventListener("DOMNodeInserted",(function(e){c({addedNodes:[e.target],removedNodes:[]})}),!0)}function l(e){for(var t,n=e.length,a=0;a<n;a++)f((t=e[a]).removedNodes,"disconnected",o,r),f(t.addedNodes,"connected",r,o)}function f(e,n,r,a){for(var o,u=new t(n),i=e.length,c=0;c<i;1===(o=e[c++]).nodeType&&s(o,u,n,r,a));}function s(e,t,n,r,o){a.has(e)&&!r.has(e)&&(o.delete(e),r.add(e),e.dispatchEvent(t));for(var u=e.children||[],i=u.length,c=0;c<i;s(u[c++],t,n,r,o));}}(e.ownerDocument)),a.add(e),e}}({Event:a,WeakSet:u}),j=function e(t,n){var r=t.nodeType;if(r){var a=1===r?t:function(e){for(var t=e.firstChild;t&&1!==t.nodeType;)t=t.nextSibling;if(t)return t;throw"unobservable"}(t);L(a),a.addEventListener("disconnected",n,!1)}else{var o=t.valueOf();o!==t&&e(o,n)}},_=/([^\s\\>"'=]+)\s*=\s*(['"]?)$/,D=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,R=/<[a-z][^>]+$/i,B=/>[^<>]*$/,F=/<([a-z]+[a-z0-9:._-]*)([^>]*?)(\/>)/gi,H=/\s+$/,I=function e(t,n){return 0<n--&&(R.test(t[n])||!B.test(t[n])&&e(t,n))},z=function(e,t,n){return D.test(t)?e:"<".concat(t).concat(n.replace(H,""),"></").concat(t,">")},q=function(e,t,n){for(var r=[],a=e.length,o=function(n){var a=e[n-1];r.push(_.test(a)&&I(e,n)?a.replace(_,(function(e,r,a){return"".concat(t).concat(n-1,"=").concat(a||'"').concat(r).concat(a?"":'"')})):"".concat(a,"\x3c!--").concat(t).concat(n-1,"--\x3e"))},u=1;u<a;u++)o(u);r.push(e[a-1]);var i=r.join("").trim();return n?i:i.replace(F,z)},P=Array.isArray,U=[],G=U.indexOf,J=U.slice,K=function(e,t){return 111===e.nodeType?1/t<0?t?function(e){var t=e.firstChild,n=e.lastChild,r=document.createRange();return r.setStartAfter(t),r.setEndAfter(n),r.deleteContents(),t}(e):e.lastChild:t?e.valueOf():e.firstChild:e},Q=function(e){var t="fragment",n="template",r="content"in o(n)?function(e){var t=o(n);return t.innerHTML=e,t.content}:function(e){var r=o(t),u=o(n),i=null;if(/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(e)){var c=RegExp.$1;u.innerHTML="<table>"+e+"</table>",i=u.querySelectorAll(c)}else u.innerHTML=e,i=u.childNodes;return a(r,i),r};return function(e,t){return("svg"===t?u:r)(e)};function a(e,t){for(var n=t.length;n--;)e.appendChild(t[0])}function o(n){return n===t?e.createDocumentFragment():e.createElementNS("http://www.w3.org/1999/xhtml",n)}function u(e){var n=o(t),r=o("div");return r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>",a(n,r.firstChild.childNodes),n}}(document),V=function(e,t){return e.childNodes[t]},X=function(e){for(var t=[],n=e.parentNode;n;)t.push(G.call(n.childNodes,e)),n=(e=n).parentNode;return t},Y=document,Z=Y.createTreeWalker,ee=Y.importNode,te=1!=ee.length,ne=te?function(e,t){return ee.call(document,Q(e,t),!0)}:Q,re=te?function(e){return Z.call(document,e,129,null,!1)}:function(e){return Z.call(document,e,129)},ae=function(e,t,n){return function(e,t,n,r,a){for(var o=n.length,u=t.length,i=o,c=0,l=0,f=null;c<u||l<i;)if(u===c)for(var s=i<o?l?r(n[l-1],-0).nextSibling:r(n[i-l],0):a;l<i;)e.insertBefore(r(n[l++],1),s);else if(i===l)for(;c<u;)f&&f.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[l])c++,l++;else if(t[u-1]===n[i-1])u--,i--;else if(t[c]===n[i-1]&&n[l]===t[u-1]){var v=r(t[--u],-1).nextSibling;e.insertBefore(r(n[l++],1),r(t[c++],-1).nextSibling),e.insertBefore(r(n[--i],1),v),t[u]=n[i]}else{if(!f){f=new Map;for(var d=l;d<i;)f.set(n[d],d++)}if(f.has(t[c])){var p=f.get(t[c]);if(l<p&&p<i){for(var h=c,g=1;++h<u&&h<i&&f.get(t[h])===p+g;)g++;if(g>p-l)for(var y=r(t[c],0);l<p;)e.insertBefore(r(n[l++],1),y);else e.replaceChild(r(n[l++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n}(e.parentNode,t,n,K,e)},oe=function(e,t){return"ref"===t?function(e){return function(t){"function"==typeof t?t(e):t.current=e}}(e):"aria"===t?function(e){return function(t){for(var n in t){var r="role"===n?n:"aria-".concat(n),a=t[n];null==a?e.removeAttribute(r):e.setAttribute(r,a)}}}(e):".dataset"===t?function(e){var t=e.dataset;return function(e){for(var n in e){var r=e[n];null==r?delete t[n]:t[n]=r}}}(e):"."===t.slice(0,1)?function(e,t){return function(n){e[t]=n}}(e,t.slice(1)):"on"===t.slice(0,2)?function(e,t){var n,r=t.slice(2);return!(t in e)&&t.toLowerCase()in e&&(r=r.toLowerCase()),function(t){var a=P(t)?t:[t,!1];n!==a[0]&&(n&&e.removeEventListener(r,n,a[1]),(n=a[0])&&e.addEventListener(r,n,a[1]))}}(e,t):function(e,t){var n,r=!0,a=document.createAttributeNS(null,t);return function(t){n!==t&&(null==(n=t)?r||(e.removeAttributeNode(a),r=!0):(a.value=t,r&&(e.setAttributeNodeNS(a),r=!1)))}}(e,t)};function ue(e){var t=e.type,n=e.path.reduceRight(V,this);return"node"===t?function(e){var t,n,r=[];return function a(o){switch(typeof o){case"string":case"number":case"boolean":t!==o&&(t=o,n?n.textContent=o:n=document.createTextNode(o),r=ae(e,r,[n]));break;case"object":case"undefined":if(null==o){t!=o&&(t=o,r=ae(e,r,[]));break}if(P(o)){t=o,0===o.length?r=ae(e,r,[]):"object"==typeof o[0]?r=ae(e,r,o):a(String(o));break}"ELEMENT_NODE"in o&&t!==o&&(t=o,r=ae(e,r,11===o.nodeType?J.call(o.childNodes):[o]))}}}(n):"attr"===t?oe(n,e.name):function(e){var t;return function(n){t!=n&&(t=n,e.textContent=null==n?"":n)}}(n)}var ie="isµ",ce=s(new WeakMap),le=function(e,t){var n=ce.get(t)||ce.set(t,function(e,t){for(var n=q(t,ie,"svg"===e),r=ne(n,e),a=re(r),o=[],u=t.length-1,i=0,c="".concat(ie).concat(i);i<u;){var l=a.nextNode();if(!l)throw"bad template: ".concat(n);if(8===l.nodeType)l.textContent===c&&(o.push({type:"node",path:X(l)}),c="".concat(ie).concat(++i));else{for(;l.hasAttribute(c);)o.push({type:"attr",path:X(l),name:l.getAttribute(c)}),l.removeAttribute(c),c="".concat(ie).concat(++i);/^(?:style|textarea)$/i.test(l.tagName)&&l.textContent.trim()==="\x3c!--".concat(c,"--\x3e")&&(o.push({type:"text",path:X(l)}),c="".concat(ie).concat(++i))}}return{content:r,nodes:o}}(e,t)),r=n.content,a=n.nodes,o=ee.call(document,r,!0);return{content:o,updates:a.map(ue,o)}},fe=function(e,t){var n=t.type,r=t.template,a=t.values,o=a.length;se(e,a,o);var u=e.entry;u&&u.template===r&&u.type===n||(e.entry=u=function(e,t){var n=le(e,t);return{type:e,template:t,content:n.content,updates:n.updates,wire:null}}(n,r));for(var i=u,c=i.content,l=i.updates,f=i.wire,s=0;s<o;s++)l[s](a[s]);return f||(u.wire=function(e){var t=e.childNodes,n=t.length;if(n<2)return n?t[0]:e;var r=J.call(t,0);return{ELEMENT_NODE:1,nodeType:111,firstChild:r[0],lastChild:r[n-1],valueOf:function(){if(t.length!==n)for(var a=0;a<n;)e.appendChild(r[a++]);return e}}}(c))},se=function e(t,n,r){for(var a=t.stack,o=0;o<r;o++){var u=n[o];u instanceof ve?n[o]=fe(a[o]||(a[o]={stack:[],entry:null,wire:null}),u):P(u)?e(a[o]||(a[o]={stack:[],entry:null,wire:null}),u,u.length):a[o]=null}r<a.length&&a.splice(r)};function ve(e,t,n){this.type=e,this.template=t,this.values=n}var de=Object.create,pe=Object.defineProperties,he=function(e){var t=s(new WeakMap);return pe((function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return new ve(e,t,r)}),{for:{value:function(n,r){var a=t.get(n)||t.set(n,de(null));return a[r]||(a[r]=function(t){return function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return fe(t,{type:e,template:n,values:a})}}({stack:[],entry:null,wire:null}))}},node:{value:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return fe({stack:[],entry:null,wire:null},{type:e,template:t,values:r}).valueOf()}}})},ge=s(new WeakMap),ye=he("html"),me=he("svg"),we=Array.isArray,be=Object.create,ke=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new ve("html",e,n)};ke.for=je(ye);var Ce=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new ve("svg",e,n)};Ce.for=je(me);var Ae=s(new WeakMap),Ee=function(e,t){var n="function"==typeof t?t():t,r=Ae.get(e)||Ae.set(e,Me(null));return r.w=e,r.W=t,function(e,t){var n="function"==typeof t?t():t,r=ge.get(e)||ge.set(e,{stack:[],entry:null,wire:null}),a=n instanceof ve?fe(r,n):n;return a!==r.wire&&(r.wire=a,e.textContent="",e.appendChild(a.valueOf())),e}(e,n instanceof Le?Te(r,n):(Oe(r,n),n))},Ne=!1,xe=function(e,t){t!==e.node&&(e.node&&(Ne=!0),e.node=t)},Se=function(e,t){return n=null,r=d((function(){var n=t.fn.apply(null,arguments);n instanceof ve?(Oe(e,n),xe(t,$e(t,n))):xe(t,n);try{return t.node}finally{if(Ne){Ne=!1;for(var r=e;r.p;)r=r.p;Ee(r.w,r.W)}}})),function(){var e=r.apply(this,arguments);return M(r)&&j(e,n||(n=S.bind(null,r))),e};var n,r},Me=function(e){return{p:e,stack:[],entry:null}},Te=function(e,n){var r,a=n.fn,o=n.template,u=n.values,i=e.entry;return i&&i.fn===a||(e.entry=i={fn:a,hook:null,node:null},i.hook=Se(Me(e),i)),(r=i).hook.apply(r,[o].concat(t(u)))},Oe=function(e,t){var n=t.values;We(e,n,n.length)},We=function e(t,n,r){for(var a=t.stack,o=0;o<r;o++){var u=n[o];u instanceof Le?n[o]=Te(a[o]||(a[o]=Me(t)),u):u instanceof ve?Oe(a[o]||(a[o]=Me(t)),u):we(u)?e(a[o]||(a[o]=Me(t)),u,u.length):a[o]=null}r<a.length&&a.splice(r)},$e=function(e,n){var r=n.type,a=n.template,o=n.values;return("svg"===r?me:ye).for(e,r).apply(void 0,[a].concat(t(o)))};function Le(e,t,n){this.fn=e,this.template=t,this.values=n}function je(e){var t=s(new WeakMap);return function(n,r){var a=t.get(n)||t.set(n,be(null)),o=a[r]||(a[r]=Me(null));return function(t){for(var a=arguments.length,u=new Array(a>1?a-1:0),i=1;i<a;i++)u[i-1]=arguments[i];return We(o,u),e.for(n,r).apply(void 0,[t].concat(u))}}}return e.Component=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return new Le(e,t,r)}},e.contextual=function(e){var t=!0,n=null,r=d((function(){return e.apply(n,arguments)}));return function e(){var a=r.apply(n=this,arguments);return t&&(t=!t,M(r)&&A.set(e,A.get(r))),a}},e.createContext=function(e){var t={value:e,provide:k};return w.set(t,[]),t},e.html=ke,e.render=Ee,e.svg=Ce,e.useCallback=function(e,t){return W((function(){return e}),t)},e.useContext=function(e){var t=v,n=t.hook,r=t.args,a=w.get(e),o={hook:n,args:r};return a.some(C,o)||a.push(o),e.value},e.useEffect=T,e.useLayoutEffect=O,e.useMemo=W,e.useReducer=m,e.useRef=function(e){var t=v.i++,n=v,r=n.stack;return t===n.length&&(v.length=r.push({current:e})),r[t]},e.useState=function(e,t){return m(y,e,void 0,t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
self.uland=function(n){"use strict";function t(n){return function(n){if(Array.isArray(n))return e(n)}(n)||function(n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(n))return Array.from(n)}(n)||function(n,t){if(!n)return;if("string"==typeof n)return e(n,t);var r=Object.prototype.toString.call(n).slice(8,-1);"Object"===r&&n.constructor&&(r=n.constructor.name);if("Map"===r||"Set"===r)return Array.from(n);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(n,t)}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}
/*! (c) Andrea Giammarchi - ISC */()}function e(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,r=new Array(t);e<t;e++)r[e]=n[e];return r}var r={};r.CustomEvent="function"==typeof CustomEvent?CustomEvent:function(n){return t[n]=new t("").constructor[n],t;function t(n,t){t||(t={});var e=document.createEvent("CustomEvent");return e.initCustomEvent(n,!!t.bubbles,!!t.cancelable,t.detail),e}}("prototype");var u=r.CustomEvent,o=function(n,t,e,r){var u=new WeakMap,o=new WeakMap,i=new WeakMap,c=function(n){return u.has(n)},l=function(n){c(n)&&(f(n,n.removeEventListener,u.get(n)),u.delete(n))},f=function(n,t,e){t.call(n,"disconnected",e),t.call(n,"connected",e)},s=function(n,t,e,r){for(var u=n.length,o=0;o<u;o++)v(n[o],t,e,r)},v=function(n,r,u,o){c(n)&&!u.has(n)&&(o.delete(n),u.set(n,0),n.dispatchEvent(new(e||CustomEvent)(r))),s(n[t||"children"]||[],r,u,o)},h=new(r||MutationObserver)((function(n){for(var t=n.length,e=0;e<t;e++){var r=n[e],u=r.removedNodes,a=r.addedNodes;s(u,"disconnected",i,o),s(a,"connected",o,i)}}));return h.observe(n||document,{subtree:!0,childList:!0}),{has:c,connect:function(n,t){l(n),(t||(t={})).handleEvent||(t.handleEvent=a),f(n,n.addEventListener,t),u.set(n,t)},disconnect:l,kill:function(){h.disconnect()}}};function a(n){n.type in this&&this[n.type](n)}var i="function"==typeof Promise?Promise:function(n){var t,e=[],r=0;return n((function(n){t=n,r=1,e.splice(0).forEach(u)})),{then:u};function u(n){return r?setTimeout(n,0,t):e.push(n),this}},c=null,l=new Set,f=new WeakMap,s=function(n){var t=n.$,e=n.r,r=n.h;b(e)&&(h.get(r).delete(n),e()),b(n.r=t())&&h.get(r).add(n)},v=function(){var n=l;l=new Set,n.forEach(E)},h=new WeakMap,d=[],p=[];function m(n,t){return n!==this[t]}var y=function(n){var t=h.get(n);t&&C.then((function(){t.forEach((function(n){n.r(),n.r=null})),t.clear()}))},g=function(){return f.get(c)},w=function(n){return h.has(n)},b=function(n){return"function"==typeof n},E=function(n){var t=n.h,e=n.c,r=n.a;n.e&&t.apply(e,r)},C=new i((function(n){return n()}));function A(n){var t=this._;this.value!==n&&(this._=new Set,this.value=n,t.forEach(E))}var k=function(n,t){var e=g(),r=e.i,u=e.s;return r!==u.length&&t&&!t.some(m,u[r]._)||(u[r]={$:n(),_:t}),u[e.i++].$},x=function(n){return function(t,e){var r=g(),u=r.i,o=r.s,a=r.h,i=u===o.length;i&&(h.has(a)||h.set(a,new Set),o.push({$:t,_:e,r:null,h:a}));var c=o[r.i++];(i||!e||e.some(m,c._))&&n.push(c)}},N=x(d),M=x(p),S=function(n,t){return b(t)?t(n):t},$=function(n,t,e){var r=g(),u=r.i,o=r.s;u===o.length&&o.push({$:b(e)?e(t):S(void 0,t),set:function(t){o[u].$=n(o[u].$,t),function(n){l.has(n)||(n.e=1,l.add(n),C.then(v))}(r)}});var a=o[r.i++];return[a.$,a.set]},O=null,T=null,L=null,_=new WeakMap,W=function(n,t,e,r){return n?[r[0],function(u){_.has(n)||(_.set(n,0),C.then((function(){_.delete(n),n.apply(t,e)}))),r[1](u)}]:r},j=function(n,t){return function(n){var t={h:e,c:null,a:null,e:0,i:0,s:[]};return f.set(e,t),e;function e(){var r=c;c=e,t.e=t.i=0;try{return n.apply(t.c=this,t.a=arguments)}finally{c=r,d.length&&C.then(d.forEach.bind(d.splice(0),s)),p.length&&p.splice(0).forEach(s)}}}(t?function t(){var e=O,r=T,u=L;O=t,T=this,L=arguments;try{return n.apply(T,L)}finally{O=e,T=r,L=u}}:n)},R=null,B=function(n){var t=n.firstChild;if(t&&1!==t.nodeType&&!(t=t.nextElementSibling))throw"unobservable";return t},D=function n(t){var e=t.nodeType;if(e)return 1===e?t:B(t);var r=t.valueOf();return r!==t?n(r):B(r)},H=function(n,t){var e=j(n,t);return function(){var n=e.apply(this,arguments);if(w(e)){var t=D(n);R||(R=o(t.ownerDocument,"children",u)),R.has(t)||R.connect(t,{disconnected:function(){y(e)}})}return n}},P=function(n){return{get:function(t){return n.get(t)},set:function(t,e){return n.set(t,e),e}}},z=/([^\s\\>"'=]+)\s*=\s*(['"]?)$/,I=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,q=/<[a-z][^>]+$/i,F=/>[^<>]*$/,U=/<([a-z]+[a-z0-9:._-]*)([^>]*?)(\/>)/gi,G=/\s+$/,J=function n(t,e){return 0<e--&&(q.test(t[e])||!F.test(t[e])&&n(t,e))},K=function(n,t,e){return I.test(t)?n:"<".concat(t).concat(e.replace(G,""),"></").concat(t,">")},Q=function(n,t,e){for(var r=[],u=n.length,o=function(e){var u=n[e-1];r.push(z.test(u)&&J(n,e)?u.replace(z,(function(n,r,u){return"".concat(t).concat(e-1,"=").concat(u||'"').concat(r).concat(u?"":'"')})):"".concat(u,"\x3c!--").concat(t).concat(e-1,"--\x3e"))},a=1;a<u;a++)o(a);r.push(n[u-1]);var i=r.join("").trim();return e?i:i.replace(U,K)},V=Array.isArray,X=[],Y=X.indexOf,Z=X.slice,nn=function(n,t){return 111===n.nodeType?1/t<0?t?function(n){var t=n.firstChild,e=n.lastChild,r=document.createRange();return r.setStartAfter(t),r.setEndAfter(e),r.deleteContents(),t}(n):n.lastChild:t?n.valueOf():n.firstChild:n},tn=function(n){var t="fragment",e="template",r="content"in o(e)?function(n){var t=o(e);return t.innerHTML=n,t.content}:function(n){var r=o(t),a=o(e),i=null;if(/^[^\S]*?<(col(?:group)?|t(?:head|body|foot|r|d|h))/i.test(n)){var c=RegExp.$1;a.innerHTML="<table>"+n+"</table>",i=a.querySelectorAll(c)}else a.innerHTML=n,i=a.childNodes;return u(r,i),r};return function(n,t){return("svg"===t?a:r)(n)};function u(n,t){for(var e=t.length;e--;)n.appendChild(t[0])}function o(e){return e===t?n.createDocumentFragment():n.createElementNS("http://www.w3.org/1999/xhtml",e)}function a(n){var e=o(t),r=o("div");return r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+n+"</svg>",u(e,r.firstChild.childNodes),e}}(document),en=function(n,t){return n.childNodes[t]},rn=function(n){for(var t=[],e=n.parentNode;e;)t.push(Y.call(e.childNodes,n)),e=(n=e).parentNode;return t},un=document,on=un.createTreeWalker,an=un.importNode,cn=1!=an.length,ln=cn?function(n,t){return an.call(document,tn(n,t),!0)}:tn,fn=cn?function(n){return on.call(document,n,129,null,!1)}:function(n){return on.call(document,n,129)},sn=function(n,t,e){return function(n,t,e,r,u){for(var o=e.length,a=t.length,i=o,c=0,l=0,f=null;c<a||l<i;)if(a===c)for(var s=i<o?l?r(e[l-1],-0).nextSibling:r(e[i-l],0):u;l<i;)n.insertBefore(r(e[l++],1),s);else if(i===l)for(;c<a;)f&&f.has(t[c])||n.removeChild(r(t[c],-1)),c++;else if(t[c]===e[l])c++,l++;else if(t[a-1]===e[i-1])a--,i--;else if(t[c]===e[i-1]&&e[l]===t[a-1]){var v=r(t[--a],-1).nextSibling;n.insertBefore(r(e[l++],1),r(t[c++],-1).nextSibling),n.insertBefore(r(e[--i],1),v),t[a]=e[i]}else{if(!f){f=new Map;for(var h=l;h<i;)f.set(e[h],h++)}if(f.has(t[c])){var d=f.get(t[c]);if(l<d&&d<i){for(var p=c,m=1;++p<a&&p<i&&f.get(t[p])===d+m;)m++;if(m>d-l)for(var y=r(t[c],0);l<d;)n.insertBefore(r(e[l++],1),y);else n.replaceChild(r(e[l++],1),r(t[c++],-1))}else c++}else n.removeChild(r(t[c++],-1))}return e}(n.parentNode,t,e,nn,n)},vn=function(n,t){return"ref"===t?function(n){return function(t){"function"==typeof t?t(n):t.current=n}}(n):"aria"===t?function(n){return function(t){for(var e in t){var r="role"===e?e:"aria-".concat(e),u=t[e];null==u?n.removeAttribute(r):n.setAttribute(r,u)}}}(n):".dataset"===t?function(n){var t=n.dataset;return function(n){for(var e in n){var r=n[e];null==r?delete t[e]:t[e]=r}}}(n):"."===t.slice(0,1)?function(n,t){return function(e){n[t]=e}}(n,t.slice(1)):"on"===t.slice(0,2)?function(n,t){var e,r=t.slice(2);return!(t in n)&&t.toLowerCase()in n&&(r=r.toLowerCase()),function(t){var u=V(t)?t:[t,!1];e!==u[0]&&(e&&n.removeEventListener(r,e,u[1]),(e=u[0])&&n.addEventListener(r,e,u[1]))}}(n,t):function(n,t){var e,r=!0,u=document.createAttributeNS(null,t);return function(t){e!==t&&(null==(e=t)?r||(n.removeAttributeNode(u),r=!0):(u.value=t,r&&(n.setAttributeNodeNS(u),r=!1)))}}(n,t)};function hn(n){var t=n.type,e=n.path.reduceRight(en,this);return"node"===t?function(n){var t,e,r=[];return function u(o){switch(typeof o){case"string":case"number":case"boolean":t!==o&&(t=o,e?e.textContent=o:e=document.createTextNode(o),r=sn(n,r,[e]));break;case"object":case"undefined":if(null==o){t!=o&&(t=o,r=sn(n,r,[]));break}if(V(o)){t=o,0===o.length?r=sn(n,r,[]):"object"==typeof o[0]?r=sn(n,r,o):u(String(o));break}"ELEMENT_NODE"in o&&t!==o&&(t=o,r=sn(n,r,11===o.nodeType?Z.call(o.childNodes):[o]))}}}(e):"attr"===t?vn(e,n.name):function(n){var t;return function(e){t!=e&&(t=e,n.textContent=null==e?"":e)}}(e)}var dn="isµ",pn=P(new WeakMap),mn=function(n,t){var e=pn.get(t)||pn.set(t,function(n,t){for(var e=Q(t,dn,"svg"===n),r=ln(e,n),u=fn(r),o=[],a=t.length-1,i=0,c="".concat(dn).concat(i);i<a;){var l=u.nextNode();if(!l)throw"bad template: ".concat(e);if(8===l.nodeType)l.textContent===c&&(o.push({type:"node",path:rn(l)}),c="".concat(dn).concat(++i));else{for(;l.hasAttribute(c);)o.push({type:"attr",path:rn(l),name:l.getAttribute(c)}),l.removeAttribute(c),c="".concat(dn).concat(++i);/^(?:style|textarea)$/i.test(l.tagName)&&l.textContent.trim()==="\x3c!--".concat(c,"--\x3e")&&(l.textContent="",o.push({type:"text",path:rn(l)}),c="".concat(dn).concat(++i))}}return{content:r,nodes:o}}(n,t)),r=e.content,u=e.nodes,o=an.call(document,r,!0);return{content:o,updates:u.map(hn,o)}},yn=function(n,t){var e=t.type,r=t.template,u=t.values,o=u.length;gn(n,u,o);var a=n.entry;a&&a.template===r&&a.type===e||(n.entry=a=function(n,t){var e=mn(n,t);return{type:n,template:t,content:e.content,updates:e.updates,wire:null}}(e,r));for(var i=a,c=i.content,l=i.updates,f=i.wire,s=0;s<o;s++)l[s](u[s]);return f||(a.wire=function(n){var t=n.childNodes,e=t.length;if(e<2)return e?t[0]:n;var r=Z.call(t,0);return{ELEMENT_NODE:1,nodeType:111,firstChild:r[0],lastChild:r[e-1],valueOf:function(){if(t.length!==e)for(var u=0;u<e;)n.appendChild(r[u++]);return n}}}(c))},gn=function n(t,e,r){for(var u=t.stack,o=0;o<r;o++){var a=e[o];a instanceof wn?e[o]=yn(u[o]||(u[o]={stack:[],entry:null,wire:null}),a):V(a)?n(u[o]||(u[o]={stack:[],entry:null,wire:null}),a,a.length):u[o]=null}r<u.length&&u.splice(r)};function wn(n,t,e){this.type=n,this.template=t,this.values=e}var bn=Object.create,En=Object.defineProperties,Cn=function(n){var t=P(new WeakMap);return En((function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),u=1;u<e;u++)r[u-1]=arguments[u];return new wn(n,t,r)}),{for:{value:function(e,r){var u=t.get(e)||t.set(e,bn(null));return u[r]||(u[r]=function(t){return function(e){for(var r=arguments.length,u=new Array(r>1?r-1:0),o=1;o<r;o++)u[o-1]=arguments[o];return yn(t,{type:n,template:e,values:u})}}({stack:[],entry:null,wire:null}))}},node:{value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),u=1;u<e;u++)r[u-1]=arguments[u];return yn({stack:[],entry:null,wire:null},{type:n,template:t,values:r}).valueOf()}}})},An=P(new WeakMap),kn=Cn("html"),xn=Cn("svg"),Nn=Array.isArray,Mn=Object.create,Sn=function(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return new wn("html",n,e)};Sn.for=Bn(kn);var $n=function(n){for(var t=arguments.length,e=new Array(t>1?t-1:0),r=1;r<t;r++)e[r-1]=arguments[r];return new wn("svg",n,e)};$n.for=Bn(xn);var On=P(new WeakMap),Tn=function(){return{s:[],e:null}},Ln=function(n,t){var e=t.f,r=t.c,u=t.a,o=n.e;return o&&o.f===e||(n.e=o={f:e,h:null,$:null},o.h=function(n,t){return H((function(){var e=t.f.apply(this,arguments);return e instanceof wn?(_n(n,e),t.$=jn(t,e)):t.$=e,t.$}))}(Tn(),o)),o.h.apply(r,u)},_n=function(n,t){var e=t.values;Wn(n,e,e.length)},Wn=function n(t,e,r){for(var u=t.s,o=0;o<r;o++){var a=e[o];a instanceof Rn?e[o]=Ln(u[o]||(u[o]=Tn()),a):a instanceof wn?_n(u[o]||(u[o]=Tn()),a):Nn(a)?n(u[o]||(u[o]=Tn()),a,a.length):u[o]=null}r<u.length&&u.splice(r)},jn=function(n,e){var r=e.type,u=e.template,o=e.values;return("svg"===r?xn:kn).for(n,r).apply(void 0,[u].concat(t(o)))};function Rn(n,t,e){this.f=n,this.c=t,this.a=e}function Bn(n){var t=P(new WeakMap);return function(e,r){var u=t.get(e)||t.set(e,Mn(null)),o=u[r]||(u[r]=Tn());return function(t){for(var u=arguments.length,a=new Array(u>1?u-1:0),i=1;i<u;i++)a[i-1]=arguments[i];return Wn(o,a),n.for(e,r).apply(void 0,[t].concat(a))}}}return n.Component=function(n){return function(){return new Rn(n,this,arguments)}},n.createContext=function(n){return{_:new Set,provide:A,value:n}},n.html=Sn,n.render=function(n,t){return(On.get(n)||On.set(n,{c:Tn(),h:H((function(t){var e="function"==typeof t?t():t;return function(n,t){var e="function"==typeof t?t():t,r=An.get(n)||An.set(n,{stack:[],entry:null,wire:null}),u=e instanceof wn?yn(r,e):e;return u!==r.wire&&(r.wire=u,n.textContent="",n.appendChild(u.valueOf())),n}(n,e instanceof Rn?Ln(this.c,e):(_n(this.c,e),e))}),n)})).h(t)},n.svg=$n,n.useCallback=function(n,t){return k((function(){return n}),t)},n.useContext=function(n){var t=n._,e=n.value;return t.add(g()),e},n.useEffect=N,n.useLayoutEffect=M,n.useMemo=k,n.useReducer=function(n,t,e){return W(O,T,L,$(n,t,e))},n.useRef=function(n){var t=g(),e=t.i,r=t.s;return e===r.length&&r.push({current:n}),r[t.i++]},n.useState=function(n){return W(O,T,L,function(n){return $(S,n)}(n))},Object.defineProperty(n,"__esModule",{value:!0}),n}({});
{
"name": "uland",
"version": "0.3.5",
"version": "0.4.0",
"main": "./cjs/index.js",
"scripts": {
"build": "npm run cjs && npm run rollup:es && npm run rollup:babel && npm run min && npm run test && npm run size",
"cjs": "ascjs esm cjs",
"cjs": "ascjs --no-default esm cjs",
"rollup:es": "rollup --config rollup/es.config.js && sed -i.bck 's/^var /self./' es.js && rm -rf es.js.bck",

@@ -13,12 +13,18 @@ "rollup:babel": "rollup --config rollup/babel.config.js && sed -i.bck 's/^var /self./' index.js && rm -rf index.js.bck && drop-babel-typeof index.js",

},
"keywords": [],
"keywords": [
"micro",
"react",
"hooks",
"neverland",
"µland"
],
"author": "Andrea Giammarchi",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/preset-env": "^7.12.1",
"@babel/core": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@ungap/degap": "^0.2.1",
"ascjs": "^4.0.1",
"ascjs": "^4.0.3",
"drop-babel-typeof": "^1.0.3",
"rollup": "^2.32.1",
"rollup": "^2.35.1",
"rollup-plugin-babel": "^4.4.0",

@@ -28,3 +34,3 @@ "rollup-plugin-includepaths": "^0.2.4",

"rollup-plugin-terser": "^7.0.2",
"terser": "^5.3.8"
"terser": "^5.5.1"
},

@@ -39,4 +45,4 @@ "module": "./esm/index.js",

"dependencies": {
"dom-augmentor": "^2.0.8",
"uhtml": "^2.1.2",
"uhooks-dom": "^0.1.7",
"uhtml": "^2.1.4",
"umap": "^1.0.2"

@@ -43,0 +49,0 @@ },

@@ -9,2 +9,9 @@ # 🦄 <em>µ</em>land

### 📣 Community Announcement
Please ask questions in the [dedicated forum](https://webreflection.boards.net/) to help the community around this project grow ♥
---
Same API, except the exports are `{Component, render, html, svg}`, where `Component` is a function you can use either as `new Component(...)` or just `Component(...)` which is the equivalent of _neverland_ default export.

@@ -11,0 +18,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc