able-baker/bundled/preact/preact.js

3 lines
11 KiB
JavaScript

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