Files
website/node_modules/preact/dist/preact.js
2024-05-06 17:15:30 -04:00

3 lines
11 KiB
JavaScript

var n,l,u,t,i,o,r,e,f,c,s,a,p={},h=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function d(n,l){for(var u in l)n[u]=l[u];return n}function _(n){var l=n.parentNode;l&&l.removeChild(n)}function x(l,u,t){var i,o,r,e={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:e[r]=u[r];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===e[r]&&(e[r]=l.defaultProps[r]);return g(l,e,i,o,null)}function g(n,t,i,o,r){var e={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(e),e}function k(n){return n.children}function b(n,l){this.props=n,this.context=l}function w(n,l){if(null==l)return n.__?w(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?w(n):null}function m(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return m(n)}}function C(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!P.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(P)}function P(){var n,u,t,o,r,f,c,s;for(i.sort(e);n=i.shift();)n.__d&&(u=i.length,o=void 0,f=(r=(t=n).__v).__e,c=[],s=[],t.__P&&((o=d({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),L(t.__P,o,r,t.__n,void 0!==t.__P.ownerSVGElement,32&r.__u?[f]:null,c,null==f?w(r):f,!!(32&r.__u),s),o.__v=r.__v,o.__.__k[o.__i]=o,M(c,o,s),o.__e!=f&&m(o)),i.length>u&&i.sort(e));P.__r=0}function S(n,l,u,t,i,o,r,e,f,c,s){var a,v,y,d,_,x=t&&t.__k||h,g=l.length;for(u.__d=f,$(u,l,x),f=u.__d,a=0;a<g;a++)null!=(y=u.__k[a])&&"boolean"!=typeof y&&"function"!=typeof y&&(v=-1===y.__i?p:x[y.__i]||p,y.__i=a,L(n,y,v,i,o,r,e,f,c,s),d=y.__e,y.ref&&v.ref!=y.ref&&(v.ref&&j(v.ref,null,y),s.push(y.ref,y.__c||d,y)),null==_&&null!=d&&(_=d),65536&y.__u||v.__k===y.__k?(f&&!f.isConnected&&(f=w(v)),f=I(y,f,n)):"function"==typeof y.type&&void 0!==y.__d?f=y.__d:d&&(f=d.nextSibling),y.__d=void 0,y.__u&=-196609);u.__d=f,u.__e=_}function $(n,l,u){var t,i,o,r,e,f=l.length,c=u.length,s=c,a=0;for(n.__k=[],t=0;t<f;t++)r=t+a,null!=(i=n.__k[t]=null==(i=l[t])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?g(null,i,null,null,null):y(i)?g(k,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?g(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=n,i.__b=n.__b+1,e=H(i,u,r,s),i.__i=e,o=null,-1!==e&&(s--,(o=u[e])&&(o.__u|=131072)),null==o||null===o.__v?(-1==e&&a--,"function"!=typeof i.type&&(i.__u|=65536)):e!==r&&(e===r+1?a++:e>r?s>f-r?a+=e-r:a--:e<r?e==r-1&&(a=e-r):a=0,e!==t+a&&(i.__u|=65536))):(o=u[r])&&null==o.key&&o.__e&&0==(131072&o.__u)&&(o.__e==n.__d&&(n.__d=w(o)),z(o,o,!1),u[r]=null,s--);if(s)for(t=0;t<c;t++)null!=(o=u[t])&&0==(131072&o.__u)&&(o.__e==n.__d&&(n.__d=w(o)),z(o,o))}function I(n,l,u){var t,i;if("function"==typeof n.type){for(t=n.__k,i=0;t&&i<t.length;i++)t[i]&&(t[i].__=n,l=I(t[i],l,u));return l}n.__e!=l&&(u.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8===l.nodeType);return l}function H(n,l,u,t){var i=n.key,o=n.type,r=u-1,e=u+1,f=l[u];if(null===f||f&&i==f.key&&o===f.type&&0==(131072&f.__u))return u;if(t>(null!=f&&0==(131072&f.__u)?1:0))for(;r>=0||e<l.length;){if(r>=0){if((f=l[r])&&0==(131072&f.__u)&&i==f.key&&o===f.type)return r;r--}if(e<l.length){if((f=l[e])&&0==(131072&f.__u)&&i==f.key&&o===f.type)return e;e++}}return-1}function T(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||v.test(l)?u:u+"px"}function A(n,l,u,t,i){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||T(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/i,"$1")),l=l.toLowerCase()in n||"onFocusOut"===l||"onFocusIn"===l?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=f,n.addEventListener(l,o?s:c,o)):n.removeEventListener(l,o?s:c,o);else{if(i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u))}}function F(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=f++;else if(u.t<t.u)return;return t(l.event?l.event(u):u)}}}function L(n,u,t,i,o,r,e,f,c,s){var a,p,h,v,_,x,g,w,m,C,P,$,I,H,T,A=u.type;if(void 0!==u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),r=[f=u.__e=t.__e]),(a=l.__b)&&a(u);n:if("function"==typeof A)try{if(w=u.props,m=(a=A.contextType)&&i[a.__c],C=a?m?m.props.value:a.__:i,t.__c?g=(p=u.__c=t.__c).__=p.__E:("prototype"in A&&A.prototype.render?u.__c=p=new A(w,C):(u.__c=p=new b(w,C),p.constructor=A,p.render=N),m&&m.sub(p),p.props=w,p.state||(p.state={}),p.context=C,p.__n=i,h=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=A.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=d({},p.__s)),d(p.__s,A.getDerivedStateFromProps(w,p.__s))),v=p.props,_=p.state,p.__v=u,h)null==A.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==A.getDerivedStateFromProps&&w!==v&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,C),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,C)||u.__v===t.__v)){for(u.__v!==t.__v&&(p.props=w,p.state=p.__s,p.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.forEach(function(n){n&&(n.__=u)}),P=0;P<p._sb.length;P++)p.__h.push(p._sb[P]);p._sb=[],p.__h.length&&e.push(p);break n}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,C),null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(v,_,x)})}if(p.context=C,p.props=w,p.__P=n,p.__e=!1,$=l.__r,I=0,"prototype"in A&&A.prototype.render){for(p.state=p.__s,p.__d=!1,$&&$(u),a=p.render(p.props,p.state,p.context),H=0;H<p._sb.length;H++)p.__h.push(p._sb[H]);p._sb=[]}else do{p.__d=!1,$&&$(u),a=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++I<25);p.state=p.__s,null!=p.getChildContext&&(i=d(d({},i),p.getChildContext())),h||null==p.getSnapshotBeforeUpdate||(x=p.getSnapshotBeforeUpdate(v,_)),S(n,y(T=null!=a&&a.type===k&&null==a.key?a.props.children:a)?T:[T],u,t,i,o,r,e,f,c,s),p.base=u.__e,u.__u&=-161,p.__h.length&&e.push(p),g&&(p.__E=p.__=null)}catch(n){u.__v=null,c||null!=r?(u.__e=f,u.__u|=c?160:32,r[r.indexOf(f)]=null):(u.__e=t.__e,u.__k=t.__k),l.__e(n,u,t)}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):u.__e=O(t.__e,u,t,i,o,r,e,c,s);(a=l.diffed)&&a(u)}function M(n,u,t){u.__d=void 0;for(var i=0;i<t.length;i++)j(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function O(l,u,t,i,o,r,e,f,c){var s,a,h,v,d,x,g,k=t.props,b=u.props,m=u.type;if("svg"===m&&(o=!0),null!=r)for(s=0;s<r.length;s++)if((d=r[s])&&"setAttribute"in d==!!m&&(m?d.localName===m:3===d.nodeType)){l=d,r[s]=null;break}if(null==l){if(null===m)return document.createTextNode(b);l=o?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,b.is&&b),r=null,f=!1}if(null===m)k===b||f&&l.data===b||(l.data=b);else{if(r=r&&n.call(l.childNodes),k=t.props||p,!f&&null!=r)for(k={},s=0;s<l.attributes.length;s++)k[(d=l.attributes[s]).name]=d.value;for(s in k)if(d=k[s],"children"==s);else if("dangerouslySetInnerHTML"==s)h=d;else if("key"!==s&&!(s in b)){if("value"==s&&"defaultValue"in b||"checked"==s&&"defaultChecked"in b)continue;A(l,s,null,d,o)}for(s in b)d=b[s],"children"==s?v=d:"dangerouslySetInnerHTML"==s?a=d:"value"==s?x=d:"checked"==s?g=d:"key"===s||f&&"function"!=typeof d||k[s]===d||A(l,s,d,k[s],o);if(a)f||h&&(a.__html===h.__html||a.__html===l.innerHTML)||(l.innerHTML=a.__html),u.__k=[];else if(h&&(l.innerHTML=""),S(l,y(v)?v:[v],u,t,i,o&&"foreignObject"!==m,r,e,r?r[0]:t.__k&&w(t,0),f,c),null!=r)for(s=r.length;s--;)null!=r[s]&&_(r[s]);f||(s="value",void 0!==x&&(x!==l[s]||"progress"===m&&!x||"option"===m&&x!==k[s])&&A(l,s,x,k[s],!1),s="checked",void 0!==g&&g!==l[s]&&A(l,s,g,k[s],!1))}return l}function j(n,u,t){try{"function"==typeof n?n(u):n.current=u}catch(n){l.__e(n,t)}}function z(n,u,t){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||j(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&z(i[o],u,t||"function"!=typeof n.type);t||null==n.__e||_(n.__e),n.__c=n.__=n.__e=n.__d=void 0}function N(n,l,u){return this.constructor(n,u)}function V(u,t,i){var o,r,e,f;l.__&&l.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,e=[],f=[],L(t,u=(!o&&i||t).__k=x(k,null,[u]),r||p,p,void 0!==t.ownerSVGElement,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,e,!o&&i?i:r?r.__e:t.firstChild,o,f),M(e,u,f)}n=h.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},b.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof n&&(n=n(d({},u),this.props)),n&&d(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),C(this))},b.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),C(this))},b.prototype.render=k,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,f=0,c=F(!1),s=F(!0),a=0,exports.Component=b,exports.Fragment=k,exports.cloneElement=function(l,u,t){var i,o,r,e,f=d({},l.props);for(r in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=void 0===u[r]&&void 0!==e?e[r]:u[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),g(l.type,f,i||l.key,o||l.ref,null)},exports.createContext=function(n,l){var u={__c:l="__cC"+a++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,C(n)})},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u},exports.createElement=x,exports.createRef=function(){return{current:null}},exports.h=x,exports.hydrate=function n(l,u){V(l,u,n)},exports.isValidElement=t,exports.options=l,exports.render=V,exports.toChildArray=function n(l,u){return u=u||[],null==l||"boolean"==typeof l||(y(l)?l.some(function(l){n(l,u)}):u.push(l)),u};
//# sourceMappingURL=preact.js.map