hyperhtml
Advanced tools
Comparing version 2.30.1 to 2.30.2
@@ -10,5 +10,5 @@ /*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(w){"use strict"; | ||
/*! (c) Andrea Giammarchi - ISC */(n);var u=[];!function e(t,n,r,i){for(var a,o,u=t.childNodes,s=u.length,l=0;l<s;){var c=u[l];switch(c.nodeType){case ee:var f=i.concat(l);ge(c,n,r,f),e(c,n,r,f);break;case Y:var h=c.textContent;if(h===U)r.shift(),n.push(ne.test(t.nodeName)?ye(t,i):(a=c,o=i.concat(l),{type:"any",node:a,path:o}));else switch(h.slice(0,2)){case"/*":if("*/"!==h.slice(-2))break;case"👻":t.removeChild(c),l--,s--}break;case te:ne.test(t.nodeName)&&Q.call(c.textContent)===X&&(r.shift(),n.push(ye(t,i)))}l++}}(n,u,f.slice(0),[]);var r={content:n,updates:function(s){for(var l=[],c=u.length,e=0,t=0;e<c;){var n=u[e++],r=pe(s,n.path);switch(n.type){case"any":l.push({fn:o.any(r,[]),sparse:!1});break;case"attr":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case"text":l.push({fn:o.text(r),sparse:!1}),r.textContent=""}}return c+=t,function(){var e=arguments.length;if(c!==e-1)throw new Error(e-1+" values instead of "+c+"\n"+f.join("${value}"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return s}}};return be.set(f,r),r}function Ee(n){return function(e){var t=we.get(n);return null!=t&&t.template===e||(t=function(e,t){var n=be.get(t)||Ne(e,t),r=K.call(w,n.content,!0),i={content:r,template:t,updates:n.updates(r)};return we.set(e,i),i}(n,e)),t.updates.apply(null,arguments),t.content}}var xe,Ce,ke=(xe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Ce=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Se(n,!0)}(e,t):Se(e.style,!1)}); | ||
/*! (c) Andrea Giammarchi - ISC */function Ae(e,t,n){return t+"-"+n.toLowerCase()}function Se(a,o){var u,s;return function(e){var t,n,r,i;switch(typeof e){case"object":if(e){if("object"===u){if(!o&&s!==e)for(n in s)n in e||(a[n]="")}else o?a.value="":a.cssText="";for(n in t=o?{}:a,e)r="number"!=typeof(i=e[n])||xe.test(n)?i:i+"px",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u="object",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Ce,Ae),":",e[t],";");return n.join("")}(s=t):s=e;break}default:s!=e&&(u="string",s=e,o?a.value=e||"":a.cssText=e||"")}}}var Te,Me,_e=(Te=[].slice,(Me=Oe.prototype).ELEMENT_NODE=1,Me.nodeType=111,Me.remove=function(e){var t=this.childNodes,n=this.firstChild,r=this.lastChild;if(this._=null,e&&2===t.length)r.parentNode.removeChild(r);else{var i=this.ownerDocument.createRange();i.setStartBefore(e?t[1]:n),i.setEndAfter(r),i.deleteContents()}return n},Me.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},Oe);function Oe(e){var t=this.childNodes=Te.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function je(e){return{html:e}}function Le(e,t){switch(e.nodeType){case Be:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Ze:return Le(e.render(),t);default:return e}}function De(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(je).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function Pe(e){return null!=e&&"then"in e}var $e,We,Re,Fe,He,ze="ownerSVGElement",Ie="connected",Ze=c.prototype.nodeType,Be=_e.prototype.nodeType,Ve=(We=($e={Event:l,WeakSet:e}).Event,Re=$e.WeakSet,Fe=!0,He=null,function(e){return Fe&&(Fe=!Fe,He=new Re,function(t){var i=new Re,a=new Re;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener("DOMNodeRemoved",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener("DOMNodeInserted",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)s((t=e[r]).removedNodes,"disconnected",a,i),s(t.addedNodes,"connected",i,a)}function s(e,t,n,r){for(var i,a=new We(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&l(i,a,t,n,r));}function l(e,t,n,r,i){He.has(e)&&!r.has(e)&&(i.delete(e),r.add(e),e.dispatchEvent(t));for(var a=e.children||[],o=a.length,u=0;u<o;l(a[u++],t,n,r,i));}}(e.ownerDocument)),He.add(e),e}),Ge=/^(?:form|list)$/i,qe=[].slice;function Je(e){return this.type=e,Ee(this)}var Ke=!(Je.prototype={attribute:function(n,r,e){var i,t=ze in n;if("style"===r)return ke(n,e,t);if(/^on/.test(r)){var a=r.slice(2);return a===Ie||"disconnected"===a?Ve(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if("data"===r||!t&&r in n&&!Ge.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]="",n.removeAttribute(r)):n[r]=e)};if(r in D.attributes)return function(e){var t=D.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o=!1,u=e.cloneNode(!0);return function(e){i!==e&&(i=e,u.value!==e&&(null==e?(o&&(o=!1,n.removeAttributeNode(u)),u.value=e):(u.value=e,o||(o=!0,n.setAttributeNode(u)))))}},any:function(n,r){var i,a={node:Le,before:n},o=ze in n?"svg":"html",u=!1;return function e(t){switch(typeof t){case"string":case"number":case"boolean":u?i!==t&&(i=t,r[0].textContent=t):(u=!0,i=t,r=s(n.parentNode,r,[function(e,t){return e.ownerDocument.createTextNode(t)}(n,t)],a));break;case"function":e(t(n));break;case"object":case"undefined":if(null==t){u=!1,r=s(n.parentNode,r,[],a);break}default:if(u=!1,P(i=t))if(0===t.length)r.length&&(r=s(n.parentNode,r,[],a));else switch(typeof t[0]){case"string":case"number":case"boolean":e({html:t});break;case"object":if(P(t[0])&&(t=t.concat.apply([],t)),Pe(t[0])){Promise.all(t).then(e);break}default:r=s(n.parentNode,r,t,a)}else!function(e){return"ELEMENT_NODE"in e}(t)?Pe(t)?t.then(e):"placeholder"in t?De(t,e):"text"in t?e(String(t.text)):"any"in t?e(t.any):"html"in t?r=s(n.parentNode,r,qe.call($([].concat(t.html).join(""),o).childNodes),a):e("length"in t?qe.call(t):D.invoke(t,e)):r=s(n.parentNode,r,11===t.nodeType?qe.call(t.childNodes):[t],a)}}},text:function(r){var i;return function e(t){if(i!==t){var n=typeof(i=t);"object"==n&&t?Pe(t)?t.then(e):"placeholder"in t?De(t,e):e("text"in t?String(t.text):"any"in t?t.any:"html"in t?[].concat(t.html).join(""):"length"in t?qe.call(t).join(""):D.invoke(t,e)):"function"==n?e(t(r)):r.textContent=null==t?"":t}}}}),Qe=function(e){var t,n=(t=(w.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(t)&&!/(Chrom|Android)\/(\d+)/.test(t)),r=!("raw"in e)||e.propertyIsEnumerable("raw")||!Object.isFrozen(e.raw);if(n||r){var i={},a=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return i[t]||(i[t]=e)};if(r)Qe=a;else{var o=new u;Qe=function(e){return o.get(e)||function(e,t){return o.set(e,t),t}(e,a(e))}}}else Ke=!0;return Ue(e)};function Ue(e){return Ke?e:Qe(e)}function Xe(e){for(var t=arguments.length,n=[Ue(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ye=new u,et=function(t){var n,r,i;return function(){var e=Xe.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Je(t),n=nt(r.apply(r,e))):r.apply(r,e),n}},tt=function(e,t){var n=t.indexOf(":"),r=Ye.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ye.set(e,r={}),r[i]||(r[i]=et(t))},nt=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new _e(t):e},rt=new u;function it(){var e=rt.get(this),t=Xe.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Je(ze in this?"svg":"html");rt.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))} | ||
/*! (c) Andrea Giammarchi - ISC */function Ae(e,t,n){return t+"-"+n.toLowerCase()}function Se(a,o){var u,s;return function(e){var t,n,r,i;switch(typeof e){case"object":if(e){if("object"===u){if(!o&&s!==e)for(n in s)n in e||(a[n]="")}else o?a.value="":a.cssText="";for(n in t=o?{}:a,e)r="number"!=typeof(i=e[n])||xe.test(n)?i:i+"px",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u="object",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Ce,Ae),":",e[t],";");return n.join("")}(s=t):s=e;break}default:s!=e&&(u="string",s=e,o?a.value=e||"":a.cssText=e||"")}}}var Te,Me,_e=(Te=[].slice,(Me=Oe.prototype).ELEMENT_NODE=1,Me.nodeType=111,Me.remove=function(e){var t=this.childNodes,n=this.firstChild,r=this.lastChild;if(this._=null,e&&2===t.length)r.parentNode.removeChild(r);else{var i=this.ownerDocument.createRange();i.setStartBefore(e?t[1]:n),i.setEndAfter(r),i.deleteContents()}return n},Me.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},Oe);function Oe(e){var t=this.childNodes=Te.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function je(e){return{html:e}}function Le(e,t){switch(e.nodeType){case Be:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Ze:return Le(e.render(),t);default:return e}}function De(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(je).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function Pe(e){return null!=e&&"then"in e}var $e,We,Re,Fe,He,ze="ownerSVGElement",Ie="connected",Ze=c.prototype.nodeType,Be=_e.prototype.nodeType,Ve=(We=($e={Event:l,WeakSet:e}).Event,Re=$e.WeakSet,Fe=!0,He=null,function(e){return Fe&&(Fe=!Fe,He=new Re,function(t){var i=new Re,a=new Re;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener("DOMNodeRemoved",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener("DOMNodeInserted",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)s((t=e[r]).removedNodes,"disconnected",a,i),s(t.addedNodes,"connected",i,a)}function s(e,t,n,r){for(var i,a=new We(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&l(i,a,t,n,r));}function l(e,t,n,r,i){He.has(e)&&!r.has(e)&&(i.delete(e),r.add(e),e.dispatchEvent(t));for(var a=e.children||[],o=a.length,u=0;u<o;l(a[u++],t,n,r,i));}}(e.ownerDocument)),He.add(e),e}),Ge=/^(?:form|list)$/i,qe=[].slice;function Je(e){return this.type=e,Ee(this)}var Ke=!(Je.prototype={attribute:function(n,r,e){var i,t=ze in n;if("style"===r)return ke(n,e,t);if(/^on/.test(r)){var a=r.slice(2);return a===Ie||"disconnected"===a?Ve(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if("data"===r||!t&&r in n&&!Ge.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]="",n.removeAttribute(r)):n[r]=e)};if(r in D.attributes)return function(e){var t=D.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o=!1,u=e.cloneNode(!0);return function(e){i!==e&&(i=e,u.value!==e&&(null==e?(o&&(o=!1,n.removeAttributeNode(u)),u.value=e):(u.value=e,o||(o=!0,n.setAttributeNode(u)))))}},any:function(n,r){var i,a={node:Le,before:n},o=ze in n?"svg":"html",u=!1;return function e(t){switch(typeof t){case"string":case"number":case"boolean":u?i!==t&&(i=t,r[0].textContent=t):(u=!0,i=t,r=s(n.parentNode,r,[function(e,t){return e.ownerDocument.createTextNode(t)}(n,t)],a));break;case"function":e(t(n));break;case"object":case"undefined":if(null==t){u=!1,r=s(n.parentNode,r,[],a);break}default:if(u=!1,P(i=t))if(0===t.length)r.length&&(r=s(n.parentNode,r,[],a));else switch(typeof t[0]){case"string":case"number":case"boolean":e({html:t});break;case"object":if(P(t[0])&&(t=t.concat.apply([],t)),Pe(t[0])){Promise.all(t).then(e);break}default:r=s(n.parentNode,r,t,a)}else!function(e){return"ELEMENT_NODE"in e}(t)?Pe(t)?t.then(e):"placeholder"in t?De(t,e):"text"in t?e(String(t.text)):"any"in t?e(t.any):"html"in t?r=s(n.parentNode,r,qe.call($([].concat(t.html).join(""),o).childNodes),a):e("length"in t?qe.call(t):D.invoke(t,e)):r=s(n.parentNode,r,11===t.nodeType?qe.call(t.childNodes):[t],a)}}},text:function(r){var i;return function e(t){if(i!==t){var n=typeof(i=t);"object"==n&&t?Pe(t)?t.then(e):"placeholder"in t?De(t,e):e("text"in t?String(t.text):"any"in t?t.any:"html"in t?[].concat(t.html).join(""):"length"in t?qe.call(t).join(""):D.invoke(t,e)):"function"==n?e(t(r)):r.textContent=null==t?"":t}}}}),Qe=function(e){var t,n=(t=(w.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(t)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(t)),r=!("raw"in e)||e.propertyIsEnumerable("raw")||!Object.isFrozen(e.raw);if(n||r){var i={},a=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return i[t]||(i[t]=e)};if(r)Qe=a;else{var o=new u;Qe=function(e){return o.get(e)||function(e,t){return o.set(e,t),t}(e,a(e))}}}else Ke=!0;return Ue(e)};function Ue(e){return Ke?e:Qe(e)}function Xe(e){for(var t=arguments.length,n=[Ue(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ye=new u,et=function(t){var n,r,i;return function(){var e=Xe.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Je(t),n=nt(r.apply(r,e))):r.apply(r,e),n}},tt=function(e,t){var n=t.indexOf(":"),r=Ye.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ye.set(e,r={}),r[i]||(r[i]=et(t))},nt=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new _e(t):e},rt=new u;function it(){var e=rt.get(this),t=Xe.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Je(ze in this?"svg":"html");rt.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))} | ||
/*! (c) Andrea Giammarchi (ISC) */.apply(this,t),this}var at,ot,ut,st,lt=D.define,ct=Je.prototype;function ft(e){return arguments.length<2?null==e?et("html"):"string"==typeof e?ft.wire(null,e):"raw"in e?et("html")(e):"nodeType"in e?ft.bind(e):tt(e,"html"):("raw"in e?et("html"):ft.wire).apply(null,arguments)}return ft.Component=c,ft.bind=function(e){return it.bind(e)},ft.define=lt,ft.diff=s,(ft.hyper=ft).observe=Ve,ft.tagger=ct,ft.wire=function(e,t){return null==e?et(t||"html"):tt(e,t||"html")},ft._={WeakMap:u,WeakSet:e},at=et,ot=new u,ut=Object.create,st=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(c,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i=t.get(e)||st(e,t);switch(typeof r){case"object":case"function":var a=i.w||(i.w=new u);return a.get(r)||function(e,t,n){return e.set(t,n),n}(a,r,new e(n));default:var o=i.p||(i.p=ut(null));return o[r]||(o[r]=new e(n))}}(this,ot.get(e)||function(e){var t=new k;return ot.set(e,t),t}(e),e,null==t?"default":t)}}}),Object.defineProperties(c.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:f("html",at),svg:f("svg",at),state:f("state",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new l(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),ft}(document); | ||
export default hyperHTML; | ||
export const {Component, bind, define, diff, hyper, wire} = hyperHTML; |
@@ -1730,3 +1730,3 @@ var hyperHTML = (function (document) { | ||
var isBroken = function isBroken(UA) { | ||
return /(Firefox|Safari)\/(\d+)/.test(UA) && !/(Chrom|Android)\/(\d+)/.test(UA); | ||
return /(Firefox|Safari)\/(\d+)/.test(UA) && !/(Chrom[eium]+|Android)\/(\d+)/.test(UA); | ||
}; | ||
@@ -1733,0 +1733,0 @@ |
@@ -10,3 +10,3 @@ /*! (c) Andrea Giammarchi (ISC) */var hyperHTML=function(w){"use strict"; | ||
/*! (c) Andrea Giammarchi - ISC */(n);var u=[];!function e(t,n,r,i){for(var a,o,u=t.childNodes,s=u.length,l=0;l<s;){var c=u[l];switch(c.nodeType){case ee:var f=i.concat(l);ge(c,n,r,f),e(c,n,r,f);break;case Y:var h=c.textContent;if(h===U)r.shift(),n.push(ne.test(t.nodeName)?ye(t,i):(a=c,o=i.concat(l),{type:"any",node:a,path:o}));else switch(h.slice(0,2)){case"/*":if("*/"!==h.slice(-2))break;case"👻":t.removeChild(c),l--,s--}break;case te:ne.test(t.nodeName)&&Q.call(c.textContent)===X&&(r.shift(),n.push(ye(t,i)))}l++}}(n,u,f.slice(0),[]);var r={content:n,updates:function(s){for(var l=[],c=u.length,e=0,t=0;e<c;){var n=u[e++],r=pe(s,n.path);switch(n.type){case"any":l.push({fn:o.any(r,[]),sparse:!1});break;case"attr":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case"text":l.push({fn:o.text(r),sparse:!1}),r.textContent=""}}return c+=t,function(){var e=arguments.length;if(c!==e-1)throw new Error(e-1+" values instead of "+c+"\n"+f.join("${value}"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return s}}};return be.set(f,r),r}function Ee(n){return function(e){var t=we.get(n);return null!=t&&t.template===e||(t=function(e,t){var n=be.get(t)||Ne(e,t),r=K.call(w,n.content,!0),i={content:r,template:t,updates:n.updates(r)};return we.set(e,i),i}(n,e)),t.updates.apply(null,arguments),t.content}}var xe,Ce,ke=(xe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Ce=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Se(n,!0)}(e,t):Se(e.style,!1)}); | ||
/*! (c) Andrea Giammarchi - ISC */function Ae(e,t,n){return t+"-"+n.toLowerCase()}function Se(a,o){var u,s;return function(e){var t,n,r,i;switch(typeof e){case"object":if(e){if("object"===u){if(!o&&s!==e)for(n in s)n in e||(a[n]="")}else o?a.value="":a.cssText="";for(n in t=o?{}:a,e)r="number"!=typeof(i=e[n])||xe.test(n)?i:i+"px",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u="object",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Ce,Ae),":",e[t],";");return n.join("")}(s=t):s=e;break}default:s!=e&&(u="string",s=e,o?a.value=e||"":a.cssText=e||"")}}}var Te,Me,_e=(Te=[].slice,(Me=Oe.prototype).ELEMENT_NODE=1,Me.nodeType=111,Me.remove=function(e){var t=this.childNodes,n=this.firstChild,r=this.lastChild;if(this._=null,e&&2===t.length)r.parentNode.removeChild(r);else{var i=this.ownerDocument.createRange();i.setStartBefore(e?t[1]:n),i.setEndAfter(r),i.deleteContents()}return n},Me.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},Oe);function Oe(e){var t=this.childNodes=Te.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function je(e){return{html:e}}function Le(e,t){switch(e.nodeType){case Be:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Ze:return Le(e.render(),t);default:return e}}function De(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(je).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function Pe(e){return null!=e&&"then"in e}var $e,We,Re,Fe,He,ze="ownerSVGElement",Ie="connected",Ze=c.prototype.nodeType,Be=_e.prototype.nodeType,Ve=(We=($e={Event:l,WeakSet:e}).Event,Re=$e.WeakSet,Fe=!0,He=null,function(e){return Fe&&(Fe=!Fe,He=new Re,function(t){var i=new Re,a=new Re;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener("DOMNodeRemoved",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener("DOMNodeInserted",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)s((t=e[r]).removedNodes,"disconnected",a,i),s(t.addedNodes,"connected",i,a)}function s(e,t,n,r){for(var i,a=new We(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&l(i,a,t,n,r));}function l(e,t,n,r,i){He.has(e)&&!r.has(e)&&(i.delete(e),r.add(e),e.dispatchEvent(t));for(var a=e.children||[],o=a.length,u=0;u<o;l(a[u++],t,n,r,i));}}(e.ownerDocument)),He.add(e),e}),Ge=/^(?:form|list)$/i,qe=[].slice;function Je(e){return this.type=e,Ee(this)}var Ke=!(Je.prototype={attribute:function(n,r,e){var i,t=ze in n;if("style"===r)return ke(n,e,t);if(/^on/.test(r)){var a=r.slice(2);return a===Ie||"disconnected"===a?Ve(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if("data"===r||!t&&r in n&&!Ge.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]="",n.removeAttribute(r)):n[r]=e)};if(r in D.attributes)return function(e){var t=D.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o=!1,u=e.cloneNode(!0);return function(e){i!==e&&(i=e,u.value!==e&&(null==e?(o&&(o=!1,n.removeAttributeNode(u)),u.value=e):(u.value=e,o||(o=!0,n.setAttributeNode(u)))))}},any:function(n,r){var i,a={node:Le,before:n},o=ze in n?"svg":"html",u=!1;return function e(t){switch(typeof t){case"string":case"number":case"boolean":u?i!==t&&(i=t,r[0].textContent=t):(u=!0,i=t,r=s(n.parentNode,r,[function(e,t){return e.ownerDocument.createTextNode(t)}(n,t)],a));break;case"function":e(t(n));break;case"object":case"undefined":if(null==t){u=!1,r=s(n.parentNode,r,[],a);break}default:if(u=!1,P(i=t))if(0===t.length)r.length&&(r=s(n.parentNode,r,[],a));else switch(typeof t[0]){case"string":case"number":case"boolean":e({html:t});break;case"object":if(P(t[0])&&(t=t.concat.apply([],t)),Pe(t[0])){Promise.all(t).then(e);break}default:r=s(n.parentNode,r,t,a)}else!function(e){return"ELEMENT_NODE"in e}(t)?Pe(t)?t.then(e):"placeholder"in t?De(t,e):"text"in t?e(String(t.text)):"any"in t?e(t.any):"html"in t?r=s(n.parentNode,r,qe.call($([].concat(t.html).join(""),o).childNodes),a):e("length"in t?qe.call(t):D.invoke(t,e)):r=s(n.parentNode,r,11===t.nodeType?qe.call(t.childNodes):[t],a)}}},text:function(r){var i;return function e(t){if(i!==t){var n=typeof(i=t);"object"==n&&t?Pe(t)?t.then(e):"placeholder"in t?De(t,e):e("text"in t?String(t.text):"any"in t?t.any:"html"in t?[].concat(t.html).join(""):"length"in t?qe.call(t).join(""):D.invoke(t,e)):"function"==n?e(t(r)):r.textContent=null==t?"":t}}}}),Qe=function(e){var t,n=(t=(w.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(t)&&!/(Chrom|Android)\/(\d+)/.test(t)),r=!("raw"in e)||e.propertyIsEnumerable("raw")||!Object.isFrozen(e.raw);if(n||r){var i={},a=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return i[t]||(i[t]=e)};if(r)Qe=a;else{var o=new u;Qe=function(e){return o.get(e)||function(e,t){return o.set(e,t),t}(e,a(e))}}}else Ke=!0;return Ue(e)};function Ue(e){return Ke?e:Qe(e)}function Xe(e){for(var t=arguments.length,n=[Ue(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ye=new u,et=function(t){var n,r,i;return function(){var e=Xe.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Je(t),n=nt(r.apply(r,e))):r.apply(r,e),n}},tt=function(e,t){var n=t.indexOf(":"),r=Ye.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ye.set(e,r={}),r[i]||(r[i]=et(t))},nt=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new _e(t):e},rt=new u;function it(){var e=rt.get(this),t=Xe.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Je(ze in this?"svg":"html");rt.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))} | ||
/*! (c) Andrea Giammarchi - ISC */function Ae(e,t,n){return t+"-"+n.toLowerCase()}function Se(a,o){var u,s;return function(e){var t,n,r,i;switch(typeof e){case"object":if(e){if("object"===u){if(!o&&s!==e)for(n in s)n in e||(a[n]="")}else o?a.value="":a.cssText="";for(n in t=o?{}:a,e)r="number"!=typeof(i=e[n])||xe.test(n)?i:i+"px",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u="object",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Ce,Ae),":",e[t],";");return n.join("")}(s=t):s=e;break}default:s!=e&&(u="string",s=e,o?a.value=e||"":a.cssText=e||"")}}}var Te,Me,_e=(Te=[].slice,(Me=Oe.prototype).ELEMENT_NODE=1,Me.nodeType=111,Me.remove=function(e){var t=this.childNodes,n=this.firstChild,r=this.lastChild;if(this._=null,e&&2===t.length)r.parentNode.removeChild(r);else{var i=this.ownerDocument.createRange();i.setStartBefore(e?t[1]:n),i.setEndAfter(r),i.deleteContents()}return n},Me.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},Oe);function Oe(e){var t=this.childNodes=Te.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function je(e){return{html:e}}function Le(e,t){switch(e.nodeType){case Be:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Ze:return Le(e.render(),t);default:return e}}function De(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(je).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function Pe(e){return null!=e&&"then"in e}var $e,We,Re,Fe,He,ze="ownerSVGElement",Ie="connected",Ze=c.prototype.nodeType,Be=_e.prototype.nodeType,Ve=(We=($e={Event:l,WeakSet:e}).Event,Re=$e.WeakSet,Fe=!0,He=null,function(e){return Fe&&(Fe=!Fe,He=new Re,function(t){var i=new Re,a=new Re;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener("DOMNodeRemoved",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener("DOMNodeInserted",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)s((t=e[r]).removedNodes,"disconnected",a,i),s(t.addedNodes,"connected",i,a)}function s(e,t,n,r){for(var i,a=new We(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&l(i,a,t,n,r));}function l(e,t,n,r,i){He.has(e)&&!r.has(e)&&(i.delete(e),r.add(e),e.dispatchEvent(t));for(var a=e.children||[],o=a.length,u=0;u<o;l(a[u++],t,n,r,i));}}(e.ownerDocument)),He.add(e),e}),Ge=/^(?:form|list)$/i,qe=[].slice;function Je(e){return this.type=e,Ee(this)}var Ke=!(Je.prototype={attribute:function(n,r,e){var i,t=ze in n;if("style"===r)return ke(n,e,t);if(/^on/.test(r)){var a=r.slice(2);return a===Ie||"disconnected"===a?Ve(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if("data"===r||!t&&r in n&&!Ge.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]="",n.removeAttribute(r)):n[r]=e)};if(r in D.attributes)return function(e){var t=D.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o=!1,u=e.cloneNode(!0);return function(e){i!==e&&(i=e,u.value!==e&&(null==e?(o&&(o=!1,n.removeAttributeNode(u)),u.value=e):(u.value=e,o||(o=!0,n.setAttributeNode(u)))))}},any:function(n,r){var i,a={node:Le,before:n},o=ze in n?"svg":"html",u=!1;return function e(t){switch(typeof t){case"string":case"number":case"boolean":u?i!==t&&(i=t,r[0].textContent=t):(u=!0,i=t,r=s(n.parentNode,r,[function(e,t){return e.ownerDocument.createTextNode(t)}(n,t)],a));break;case"function":e(t(n));break;case"object":case"undefined":if(null==t){u=!1,r=s(n.parentNode,r,[],a);break}default:if(u=!1,P(i=t))if(0===t.length)r.length&&(r=s(n.parentNode,r,[],a));else switch(typeof t[0]){case"string":case"number":case"boolean":e({html:t});break;case"object":if(P(t[0])&&(t=t.concat.apply([],t)),Pe(t[0])){Promise.all(t).then(e);break}default:r=s(n.parentNode,r,t,a)}else!function(e){return"ELEMENT_NODE"in e}(t)?Pe(t)?t.then(e):"placeholder"in t?De(t,e):"text"in t?e(String(t.text)):"any"in t?e(t.any):"html"in t?r=s(n.parentNode,r,qe.call($([].concat(t.html).join(""),o).childNodes),a):e("length"in t?qe.call(t):D.invoke(t,e)):r=s(n.parentNode,r,11===t.nodeType?qe.call(t.childNodes):[t],a)}}},text:function(r){var i;return function e(t){if(i!==t){var n=typeof(i=t);"object"==n&&t?Pe(t)?t.then(e):"placeholder"in t?De(t,e):e("text"in t?String(t.text):"any"in t?t.any:"html"in t?[].concat(t.html).join(""):"length"in t?qe.call(t).join(""):D.invoke(t,e)):"function"==n?e(t(r)):r.textContent=null==t?"":t}}}}),Qe=function(e){var t,n=(t=(w.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(t)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(t)),r=!("raw"in e)||e.propertyIsEnumerable("raw")||!Object.isFrozen(e.raw);if(n||r){var i={},a=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return i[t]||(i[t]=e)};if(r)Qe=a;else{var o=new u;Qe=function(e){return o.get(e)||function(e,t){return o.set(e,t),t}(e,a(e))}}}else Ke=!0;return Ue(e)};function Ue(e){return Ke?e:Qe(e)}function Xe(e){for(var t=arguments.length,n=[Ue(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ye=new u,et=function(t){var n,r,i;return function(){var e=Xe.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Je(t),n=nt(r.apply(r,e))):r.apply(r,e),n}},tt=function(e,t){var n=t.indexOf(":"),r=Ye.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ye.set(e,r={}),r[i]||(r[i]=et(t))},nt=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new _e(t):e},rt=new u;function it(){var e=rt.get(this),t=Xe.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Je(ze in this?"svg":"html");rt.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))} | ||
/*! (c) Andrea Giammarchi (ISC) */.apply(this,t),this}var at,ot,ut,st,lt=D.define,ct=Je.prototype;function ft(e){return arguments.length<2?null==e?et("html"):"string"==typeof e?ft.wire(null,e):"raw"in e?et("html")(e):"nodeType"in e?ft.bind(e):tt(e,"html"):("raw"in e?et("html"):ft.wire).apply(null,arguments)}return ft.Component=c,ft.bind=function(e){return it.bind(e)},ft.define=lt,ft.diff=s,(ft.hyper=ft).observe=Ve,ft.tagger=ct,ft.wire=function(e,t){return null==e?et(t||"html"):tt(e,t||"html")},ft._={WeakMap:u,WeakSet:e},at=et,ot=new u,ut=Object.create,st=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(c,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i=t.get(e)||st(e,t);switch(typeof r){case"object":case"function":var a=i.w||(i.w=new u);return a.get(r)||function(e,t,n){return e.set(t,n),n}(a,r,new e(n));default:var o=i.p||(i.p=ut(null));return o[r]||(o[r]=new e(n))}}(this,ot.get(e)||function(e){var t=new k;return ot.set(e,t),t}(e),e,null==t?"default":t)}}}),Object.defineProperties(c.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:f("html",at),svg:f("svg",at),state:f("state",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new l(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),ft}(document); |
{ | ||
"name": "hyperhtml", | ||
"version": "2.30.1", | ||
"version": "2.30.2", | ||
"description": "A Fast & Light Virtual DOM Alternative", | ||
@@ -152,3 +152,3 @@ "homepage": "https://viperhtml.js.org/hyper.html", | ||
"@ungap/is-array": "^0.1.1", | ||
"@ungap/template-tag-arguments": "^0.3.0", | ||
"@ungap/template-tag-arguments": "^0.3.1", | ||
"@ungap/weakmap": "^0.1.4", | ||
@@ -155,0 +155,0 @@ "disconnected": "^0.2.1", |
@@ -11,4 +11,4 @@ (function(A,G){if(typeof define=='function'&&define.amd)define([],G);else if(typeof module=='object'&&module.exports)module.exports=G();else A.hyperHTML=G()}(typeof self!='undefined'?self:this,function(){ | ||
/*! (c) Andrea Giammarchi - ISC */(n);var u=[];!function e(t,n,r,i){for(var a,o,u=t.childNodes,s=u.length,l=0;l<s;){var c=u[l];switch(c.nodeType){case ee:var f=i.concat(l);ge(c,n,r,f),e(c,n,r,f);break;case Y:var h=c.textContent;if(h===U)r.shift(),n.push(ne.test(t.nodeName)?ye(t,i):(a=c,o=i.concat(l),{type:"any",node:a,path:o}));else switch(h.slice(0,2)){case"/*":if("*/"!==h.slice(-2))break;case"👻":t.removeChild(c),l--,s--}break;case te:ne.test(t.nodeName)&&Q.call(c.textContent)===X&&(r.shift(),n.push(ye(t,i)))}l++}}(n,u,f.slice(0),[]);var r={content:n,updates:function(s){for(var l=[],c=u.length,e=0,t=0;e<c;){var n=u[e++],r=pe(s,n.path);switch(n.type){case"any":l.push({fn:o.any(r,[]),sparse:!1});break;case"attr":var i=n.sparse,a=o.attribute(r,n.name,n.node);null===i?l.push({fn:a,sparse:!1}):(t+=i.length-2,l.push({fn:a,sparse:!0,values:i}));break;case"text":l.push({fn:o.text(r),sparse:!1}),r.textContent=""}}return c+=t,function(){var e=arguments.length;if(c!==e-1)throw new Error(e-1+" values instead of "+c+"\n"+f.join("${value}"));for(var t=1,n=1;t<e;){var r=l[t-n];if(r.sparse){var i=r.values,a=i[0],o=1,u=i.length;for(n+=u-2;o<u;)a+=arguments[t++]+i[o++];r.fn(a)}else r.fn(arguments[t++])}return s}}};return be.set(f,r),r}function Ee(n){return function(e){var t=we.get(n);return null!=t&&t.template===e||(t=function(e,t){var n=be.get(t)||Ne(e,t),r=K.call(w,n.content,!0),i={content:r,template:t,updates:n.updates(r)};return we.set(e,i),i}(n,e)),t.updates.apply(null,arguments),t.content}}var xe,Ce,ke=(xe=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,Ce=/([^A-Z])([A-Z]+)/g,function(e,t){return"ownerSVGElement"in e?function(e,t){var n;return(n=t?t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),e.getAttributeNode("style"))).value="",e.setAttributeNode(n),Se(n,!0)}(e,t):Se(e.style,!1)}); | ||
/*! (c) Andrea Giammarchi - ISC */function Ae(e,t,n){return t+"-"+n.toLowerCase()}function Se(a,o){var u,s;return function(e){var t,n,r,i;switch(typeof e){case"object":if(e){if("object"===u){if(!o&&s!==e)for(n in s)n in e||(a[n]="")}else o?a.value="":a.cssText="";for(n in t=o?{}:a,e)r="number"!=typeof(i=e[n])||xe.test(n)?i:i+"px",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u="object",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Ce,Ae),":",e[t],";");return n.join("")}(s=t):s=e;break}default:s!=e&&(u="string",s=e,o?a.value=e||"":a.cssText=e||"")}}}var Te,Me,_e=(Te=[].slice,(Me=Oe.prototype).ELEMENT_NODE=1,Me.nodeType=111,Me.remove=function(e){var t=this.childNodes,n=this.firstChild,r=this.lastChild;if(this._=null,e&&2===t.length)r.parentNode.removeChild(r);else{var i=this.ownerDocument.createRange();i.setStartBefore(e?t[1]:n),i.setEndAfter(r),i.deleteContents()}return n},Me.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},Oe);function Oe(e){var t=this.childNodes=Te.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function je(e){return{html:e}}function Le(e,t){switch(e.nodeType){case Be:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Ze:return Le(e.render(),t);default:return e}}function De(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(je).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function Pe(e){return null!=e&&"then"in e}var $e,We,Re,Fe,He,ze="ownerSVGElement",Ie="connected",Ze=c.prototype.nodeType,Be=_e.prototype.nodeType,Ve=(We=($e={Event:l,WeakSet:e}).Event,Re=$e.WeakSet,Fe=!0,He=null,function(e){return Fe&&(Fe=!Fe,He=new Re,function(t){var i=new Re,a=new Re;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener("DOMNodeRemoved",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener("DOMNodeInserted",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)s((t=e[r]).removedNodes,"disconnected",a,i),s(t.addedNodes,"connected",i,a)}function s(e,t,n,r){for(var i,a=new We(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&l(i,a,t,n,r));}function l(e,t,n,r,i){He.has(e)&&!r.has(e)&&(i.delete(e),r.add(e),e.dispatchEvent(t));for(var a=e.children||[],o=a.length,u=0;u<o;l(a[u++],t,n,r,i));}}(e.ownerDocument)),He.add(e),e}),Ge=/^(?:form|list)$/i,qe=[].slice;function Je(e){return this.type=e,Ee(this)}var Ke=!(Je.prototype={attribute:function(n,r,e){var i,t=ze in n;if("style"===r)return ke(n,e,t);if(/^on/.test(r)){var a=r.slice(2);return a===Ie||"disconnected"===a?Ve(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if("data"===r||!t&&r in n&&!Ge.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]="",n.removeAttribute(r)):n[r]=e)};if(r in D.attributes)return function(e){var t=D.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o=!1,u=e.cloneNode(!0);return function(e){i!==e&&(i=e,u.value!==e&&(null==e?(o&&(o=!1,n.removeAttributeNode(u)),u.value=e):(u.value=e,o||(o=!0,n.setAttributeNode(u)))))}},any:function(n,r){var i,a={node:Le,before:n},o=ze in n?"svg":"html",u=!1;return function e(t){switch(typeof t){case"string":case"number":case"boolean":u?i!==t&&(i=t,r[0].textContent=t):(u=!0,i=t,r=s(n.parentNode,r,[function(e,t){return e.ownerDocument.createTextNode(t)}(n,t)],a));break;case"function":e(t(n));break;case"object":case"undefined":if(null==t){u=!1,r=s(n.parentNode,r,[],a);break}default:if(u=!1,P(i=t))if(0===t.length)r.length&&(r=s(n.parentNode,r,[],a));else switch(typeof t[0]){case"string":case"number":case"boolean":e({html:t});break;case"object":if(P(t[0])&&(t=t.concat.apply([],t)),Pe(t[0])){Promise.all(t).then(e);break}default:r=s(n.parentNode,r,t,a)}else!function(e){return"ELEMENT_NODE"in e}(t)?Pe(t)?t.then(e):"placeholder"in t?De(t,e):"text"in t?e(String(t.text)):"any"in t?e(t.any):"html"in t?r=s(n.parentNode,r,qe.call($([].concat(t.html).join(""),o).childNodes),a):e("length"in t?qe.call(t):D.invoke(t,e)):r=s(n.parentNode,r,11===t.nodeType?qe.call(t.childNodes):[t],a)}}},text:function(r){var i;return function e(t){if(i!==t){var n=typeof(i=t);"object"==n&&t?Pe(t)?t.then(e):"placeholder"in t?De(t,e):e("text"in t?String(t.text):"any"in t?t.any:"html"in t?[].concat(t.html).join(""):"length"in t?qe.call(t).join(""):D.invoke(t,e)):"function"==n?e(t(r)):r.textContent=null==t?"":t}}}}),Qe=function(e){var t,n=(t=(w.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(t)&&!/(Chrom|Android)\/(\d+)/.test(t)),r=!("raw"in e)||e.propertyIsEnumerable("raw")||!Object.isFrozen(e.raw);if(n||r){var i={},a=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return i[t]||(i[t]=e)};if(r)Qe=a;else{var o=new u;Qe=function(e){return o.get(e)||function(e,t){return o.set(e,t),t}(e,a(e))}}}else Ke=!0;return Ue(e)};function Ue(e){return Ke?e:Qe(e)}function Xe(e){for(var t=arguments.length,n=[Ue(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ye=new u,et=function(t){var n,r,i;return function(){var e=Xe.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Je(t),n=nt(r.apply(r,e))):r.apply(r,e),n}},tt=function(e,t){var n=t.indexOf(":"),r=Ye.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ye.set(e,r={}),r[i]||(r[i]=et(t))},nt=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new _e(t):e},rt=new u;function it(){var e=rt.get(this),t=Xe.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Je(ze in this?"svg":"html");rt.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))} | ||
/*! (c) Andrea Giammarchi - ISC */function Ae(e,t,n){return t+"-"+n.toLowerCase()}function Se(a,o){var u,s;return function(e){var t,n,r,i;switch(typeof e){case"object":if(e){if("object"===u){if(!o&&s!==e)for(n in s)n in e||(a[n]="")}else o?a.value="":a.cssText="";for(n in t=o?{}:a,e)r="number"!=typeof(i=e[n])||xe.test(n)?i:i+"px",!o&&/^--/.test(n)?t.setProperty(n,r):t[n]=r;u="object",o?a.value=function(e){var t,n=[];for(t in e)n.push(t.replace(Ce,Ae),":",e[t],";");return n.join("")}(s=t):s=e;break}default:s!=e&&(u="string",s=e,o?a.value=e||"":a.cssText=e||"")}}}var Te,Me,_e=(Te=[].slice,(Me=Oe.prototype).ELEMENT_NODE=1,Me.nodeType=111,Me.remove=function(e){var t=this.childNodes,n=this.firstChild,r=this.lastChild;if(this._=null,e&&2===t.length)r.parentNode.removeChild(r);else{var i=this.ownerDocument.createRange();i.setStartBefore(e?t[1]:n),i.setEndAfter(r),i.deleteContents()}return n},Me.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,i=0,a=r.length;i<a;i++)t.appendChild(r[i]);return t},Oe);function Oe(e){var t=this.childNodes=Te.call(e,0);this.firstChild=t[0],this.lastChild=t[t.length-1],this.ownerDocument=t[0].ownerDocument,this._=null}function je(e){return{html:e}}function Le(e,t){switch(e.nodeType){case Be:return 1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild;case Ze:return Le(e.render(),t);default:return e}}function De(e,t){t(e.placeholder),"text"in e?Promise.resolve(e.text).then(String).then(t):"any"in e?Promise.resolve(e.any).then(t):"html"in e?Promise.resolve(e.html).then(je).then(t):Promise.resolve(D.invoke(e,t)).then(t)}function Pe(e){return null!=e&&"then"in e}var $e,We,Re,Fe,He,ze="ownerSVGElement",Ie="connected",Ze=c.prototype.nodeType,Be=_e.prototype.nodeType,Ve=(We=($e={Event:l,WeakSet:e}).Event,Re=$e.WeakSet,Fe=!0,He=null,function(e){return Fe&&(Fe=!Fe,He=new Re,function(t){var i=new Re,a=new Re;try{new MutationObserver(u).observe(t,{subtree:!0,childList:!0})}catch(e){var n=0,r=[],o=function(e){r.push(e),clearTimeout(n),n=setTimeout(function(){u(r.splice(n=0,r.length))},0)};t.addEventListener("DOMNodeRemoved",function(e){o({addedNodes:[],removedNodes:[e.target]})},!0),t.addEventListener("DOMNodeInserted",function(e){o({addedNodes:[e.target],removedNodes:[]})},!0)}function u(e){for(var t,n=e.length,r=0;r<n;r++)s((t=e[r]).removedNodes,"disconnected",a,i),s(t.addedNodes,"connected",i,a)}function s(e,t,n,r){for(var i,a=new We(t),o=e.length,u=0;u<o;1===(i=e[u++]).nodeType&&l(i,a,t,n,r));}function l(e,t,n,r,i){He.has(e)&&!r.has(e)&&(i.delete(e),r.add(e),e.dispatchEvent(t));for(var a=e.children||[],o=a.length,u=0;u<o;l(a[u++],t,n,r,i));}}(e.ownerDocument)),He.add(e),e}),Ge=/^(?:form|list)$/i,qe=[].slice;function Je(e){return this.type=e,Ee(this)}var Ke=!(Je.prototype={attribute:function(n,r,e){var i,t=ze in n;if("style"===r)return ke(n,e,t);if(/^on/.test(r)){var a=r.slice(2);return a===Ie||"disconnected"===a?Ve(n):r.toLowerCase()in n&&(a=a.toLowerCase()),function(e){i!==e&&(i&&n.removeEventListener(a,i,!1),(i=e)&&n.addEventListener(a,e,!1))}}if("data"===r||!t&&r in n&&!Ge.test(r))return function(e){i!==e&&(i=e,n[r]!==e&&null==e?(n[r]="",n.removeAttribute(r)):n[r]=e)};if(r in D.attributes)return function(e){var t=D.attributes[r](n,e);i!==t&&(null==(i=t)?n.removeAttribute(r):n.setAttribute(r,t))};var o=!1,u=e.cloneNode(!0);return function(e){i!==e&&(i=e,u.value!==e&&(null==e?(o&&(o=!1,n.removeAttributeNode(u)),u.value=e):(u.value=e,o||(o=!0,n.setAttributeNode(u)))))}},any:function(n,r){var i,a={node:Le,before:n},o=ze in n?"svg":"html",u=!1;return function e(t){switch(typeof t){case"string":case"number":case"boolean":u?i!==t&&(i=t,r[0].textContent=t):(u=!0,i=t,r=s(n.parentNode,r,[function(e,t){return e.ownerDocument.createTextNode(t)}(n,t)],a));break;case"function":e(t(n));break;case"object":case"undefined":if(null==t){u=!1,r=s(n.parentNode,r,[],a);break}default:if(u=!1,P(i=t))if(0===t.length)r.length&&(r=s(n.parentNode,r,[],a));else switch(typeof t[0]){case"string":case"number":case"boolean":e({html:t});break;case"object":if(P(t[0])&&(t=t.concat.apply([],t)),Pe(t[0])){Promise.all(t).then(e);break}default:r=s(n.parentNode,r,t,a)}else!function(e){return"ELEMENT_NODE"in e}(t)?Pe(t)?t.then(e):"placeholder"in t?De(t,e):"text"in t?e(String(t.text)):"any"in t?e(t.any):"html"in t?r=s(n.parentNode,r,qe.call($([].concat(t.html).join(""),o).childNodes),a):e("length"in t?qe.call(t):D.invoke(t,e)):r=s(n.parentNode,r,11===t.nodeType?qe.call(t.childNodes):[t],a)}}},text:function(r){var i;return function e(t){if(i!==t){var n=typeof(i=t);"object"==n&&t?Pe(t)?t.then(e):"placeholder"in t?De(t,e):e("text"in t?String(t.text):"any"in t?t.any:"html"in t?[].concat(t.html).join(""):"length"in t?qe.call(t).join(""):D.invoke(t,e)):"function"==n?e(t(r)):r.textContent=null==t?"":t}}}}),Qe=function(e){var t,n=(t=(w.defaultView.navigator||{}).userAgent,/(Firefox|Safari)\/(\d+)/.test(t)&&!/(Chrom[eium]+|Android)\/(\d+)/.test(t)),r=!("raw"in e)||e.propertyIsEnumerable("raw")||!Object.isFrozen(e.raw);if(n||r){var i={},a=function(e){for(var t=".",n=0;n<e.length;n++)t+=e[n].length+"."+e[n];return i[t]||(i[t]=e)};if(r)Qe=a;else{var o=new u;Qe=function(e){return o.get(e)||function(e,t){return o.set(e,t),t}(e,a(e))}}}else Ke=!0;return Ue(e)};function Ue(e){return Ke?e:Qe(e)}function Xe(e){for(var t=arguments.length,n=[Ue(e)],r=1;r<t;)n.push(arguments[r++]);return n}var Ye=new u,et=function(t){var n,r,i;return function(){var e=Xe.apply(null,arguments);return i!==e[0]?(i=e[0],r=new Je(t),n=nt(r.apply(r,e))):r.apply(r,e),n}},tt=function(e,t){var n=t.indexOf(":"),r=Ye.get(e),i=t;return-1<n&&(i=t.slice(n+1),t=t.slice(0,n)||"html"),r||Ye.set(e,r={}),r[i]||(r[i]=et(t))},nt=function(e){var t=e.childNodes,n=t.length;return 1===n?t[0]:n?new _e(t):e},rt=new u;function it(){var e=rt.get(this),t=Xe.apply(null,arguments);return e&&e.template===t[0]?e.tagger.apply(null,t):function(e){var t=new Je(ze in this?"svg":"html");rt.set(this,{tagger:t,template:e}),this.textContent="",this.appendChild(t.apply(null,arguments))} | ||
/*! (c) Andrea Giammarchi (ISC) */.apply(this,t),this}var at,ot,ut,st,lt=D.define,ct=Je.prototype;function ft(e){return arguments.length<2?null==e?et("html"):"string"==typeof e?ft.wire(null,e):"raw"in e?et("html")(e):"nodeType"in e?ft.bind(e):tt(e,"html"):("raw"in e?et("html"):ft.wire).apply(null,arguments)}return ft.Component=c,ft.bind=function(e){return it.bind(e)},ft.define=lt,ft.diff=s,(ft.hyper=ft).observe=Ve,ft.tagger=ct,ft.wire=function(e,t){return null==e?et(t||"html"):tt(e,t||"html")},ft._={WeakMap:u,WeakSet:e},at=et,ot=new u,ut=Object.create,st=function(e,t){var n={w:null,p:null};return t.set(e,n),n},Object.defineProperties(c,{for:{configurable:!0,value:function(e,t){return function(e,t,n,r){var i=t.get(e)||st(e,t);switch(typeof r){case"object":case"function":var a=i.w||(i.w=new u);return a.get(r)||function(e,t,n){return e.set(t,n),n}(a,r,new e(n));default:var o=i.p||(i.p=ut(null));return o[r]||(o[r]=new e(n))}}(this,ot.get(e)||function(e){var t=new k;return ot.set(e,t),t}(e),e,null==t?"default":t)}}}),Object.defineProperties(c.prototype,{handleEvent:{value:function(e){var t=e.currentTarget;this["getAttribute"in t&&t.getAttribute("data-call")||"on"+e.type](e)}},html:f("html",at),svg:f("svg",at),state:f("state",function(){return this.defaultState}),defaultState:{get:function(){return{}}},dispatch:{value:function(e,t){var n=this._wire$;if(n){var r=new l(e,{bubbles:!0,cancelable:!0,detail:t});return r.component=this,(n.dispatchEvent?n:n.firstChild).dispatchEvent(r)}return!1}},setState:{value:function(e,t){var n=this.state,r="function"==typeof e?e.call(this,n):e;for(var i in r)n[i]=r[i];return!1!==t&&this.render(),this}}}),ft}(document); | ||
return hyperHTML})); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
199158