preact.module-c336cfe0.js 9.9 KB

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