Warp/node_modules/preact/dist/preact.min.umd.js
2024-01-05 19:14:38 +07:00

2 lines
11 KiB
JavaScript

!function(n){"function"==typeof define&&define.amd?define(n):n()}(function(){var n,l,t,u,i,o,r,e,f,c,a=65536,s=1<<17,h={},v=[],p=/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 t in l)n[t]=l[t];return n}function _(n){var l=n.parentNode;l&&l.removeChild(n)}function m(l,t,u){var i,o,r,e={};for(r in t)"key"==r?i=t[r]:"ref"==r?o=t[r]:e[r]=t[r];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):u),"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,u,i,o,r){var e={type:n,props:u,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++t:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(e),e}function b(n){return n.children}function k(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 t;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e)return t.__e;return"function"==typeof n.type?w(n):null}function C(n){var l,t;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e){n.__e=n.__c.base=t.__e;break}return C(n)}}function x(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!P.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(P)}function P(){var n,t,u,o,r,f,c,a,s;for(i.sort(e);n=i.shift();)n.__d&&(t=i.length,o=void 0,f=(r=(u=n).__v).__e,a=[],s=[],(c=u.__P)&&((o=d({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),L(c,o,r,u.__n,void 0!==c.ownerSVGElement,32&r.__u?[f]:null,a,null==f?w(r):f,!!(32&r.__u),s),o.__.__k[o.__i]=o,M(a,o,s),o.__e!=f&&C(o)),i.length>t&&i.sort(e));P.__r=0}function S(n,l,t,u,i,o,r,e,f,c,s){var p,y,d,_,m,g=u&&u.__k||v,b=l.length;for(t.__d=f,$(t,l,g),f=t.__d,p=0;p<b;p++)null!=(d=t.__k[p])&&"boolean"!=typeof d&&"function"!=typeof d&&(y=-1===d.__i?h:g[d.__i]||h,d.__i=p,L(n,d,y,i,o,r,e,f,c,s),_=d.__e,d.ref&&y.ref!=d.ref&&(y.ref&&z(y.ref,null,d),s.push(d.ref,d.__c||_,d)),null==m&&null!=_&&(m=_),d.__u&a||y.__k===d.__k?f=A(d,f,n):"function"==typeof d.type&&void 0!==d.__d?f=d.__d:_&&(f=_.nextSibling),d.__d=void 0,d.__u&=-196609);t.__d=f,t.__e=m}function $(n,l,t){var u,i,o,r,e,f=l.length,c=t.length,h=c,v=0;for(n.__k=[],u=0;u<f;u++)null!=(i=n.__k[u]=null==(i=l[u])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?g(null,i,null,null,i):y(i)?g(b,{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=E(i,t,r=u+v,h),i.__i=e,o=null,-1!==e&&(h--,(o=t[e])&&(o.__u|=s)),null==o||null===o.__v?(-1==e&&v--,"function"!=typeof i.type&&(i.__u|=a)):e!==r&&(e===r+1?v++:e>r?h>f-r?v+=e-r:v--:v=e<r&&e==r-1?e-r:0,e!==u+v&&(i.__u|=a))):(o=t[u])&&null==o.key&&o.__e&&(o.__e==n.__d&&(n.__d=w(o)),F(o,o,!1),t[u]=null,h--);if(h)for(u=0;u<c;u++)null!=(o=t[u])&&0==(o.__u&s)&&(o.__e==n.__d&&(n.__d=w(o)),F(o,o))}function A(n,l,t){var u,i;if("function"==typeof n.type){for(u=n.__k,i=0;u&&i<u.length;i++)u[i]&&(u[i].__=n,l=A(u[i],l,t));return l}return n.__e!=l&&(t.insertBefore(n.__e,l||null),l=n.__e),l&&l.nextSibling}function E(n,l,t,u){var i=n.key,o=n.type,r=t-1,e=t+1,f=l[t];if(null===f||f&&i==f.key&&o===f.type)return t;if(u>(null!=f&&0==(f.__u&s)?1:0))for(;r>=0||e<l.length;){if(r>=0){if((f=l[r])&&0==(f.__u&s)&&i==f.key&&o===f.type)return r;r--}if(e<l.length){if((f=l[e])&&0==(f.__u&s)&&i==f.key&&o===f.type)return e;e++}}return-1}function H(n,l,t){"-"===l[0]?n.setProperty(l,null==t?"":t):n[l]=null==t?"":"number"!=typeof t||p.test(l)?t:t+"px"}function I(n,l,t,u,i){var o;n:if("style"===l)if("string"==typeof t)n.style.cssText=t;else{if("string"==typeof u&&(n.style.cssText=u=""),u)for(l in u)t&&l in t||H(n.style,l,"");if(t)for(l in t)u&&t[l]===u[l]||H(n.style,l,t[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/,"$1")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=t,t?u?t.t=u.t:(t.t=Date.now(),n.addEventListener(l,o?D:T,o)):n.removeEventListener(l,o?D:T,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==t?"":t;break n}catch(n){}"function"==typeof t||(null==t||!1===t&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,t))}}function T(n){var t=this.l[n.type+!1];if(n.u){if(n.u<=t.t)return}else n.u=Date.now();return t(l.event?l.event(n):n)}function D(n){return this.l[n.type+!0](l.event?l.event(n):n)}function L(n,t,u,i,o,r,e,f,c,a){var s,h,v,p,_,m,g,w,C,x,P,$,A,E,H,I=t.type;if(void 0!==t.constructor)return null;128&u.__u&&(c=!!(32&u.__u),r=[f=t.__e=u.__e]),(s=l.__b)&&s(t);n:if("function"==typeof I)try{if(w=t.props,C=(s=I.contextType)&&i[s.__c],x=s?C?C.props.value:s.__:i,u.__c?g=(h=t.__c=u.__c).__=h.__E:("prototype"in I&&I.prototype.render?t.__c=h=new I(w,x):(t.__c=h=new k(w,x),h.constructor=I,h.render=N),C&&C.sub(h),h.props=w,h.state||(h.state={}),h.context=x,h.__n=i,v=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=I.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d({},h.__s)),d(h.__s,I.getDerivedStateFromProps(w,h.__s))),p=h.props,_=h.state,h.__v=t,v)null==I.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==I.getDerivedStateFromProps&&w!==p&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(w,x),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(w,h.__s,x)||t.__v===u.__v)){for(t.__v!==u.__v&&(h.props=w,h.state=h.__s,h.__d=!1),t.__e=u.__e,t.__k=u.__k,t.__k.forEach(function(n){n&&(n.__=t)}),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(w,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(p,_,m)})}if(h.context=x,h.props=w,h.__P=n,h.__e=!1,$=l.__r,A=0,"prototype"in I&&I.prototype.render){for(h.state=h.__s,h.__d=!1,$&&$(t),s=h.render(h.props,h.state,h.context),E=0;E<h._sb.length;E++)h.__h.push(h._sb[E]);h._sb=[]}else do{h.__d=!1,$&&$(t),s=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++A<25);h.state=h.__s,null!=h.getChildContext&&(i=d(d({},i),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(m=h.getSnapshotBeforeUpdate(p,_)),S(n,y(H=null!=s&&s.type===b&&null==s.key?s.props.children:s)?H:[H],t,u,i,o,r,e,f,c,a),h.base=t.__e,t.__u&=-161,h.__h.length&&e.push(h),g&&(h.__E=h.__=null)}catch(n){t.__v=null,c||null!=r?(t.__e=f,t.__u|=c?160:32,r[r.indexOf(f)]=null):(t.__e=u.__e,t.__k=u.__k),l.__e(n,t,u)}else null==r&&t.__v===u.__v?(t.__k=u.__k,t.__e=u.__e):t.__e=j(u.__e,t,u,i,o,r,e,c,a);(s=l.diffed)&&s(t)}function M(n,t,u){t.__d=void 0;for(var i=0;i<u.length;i++)z(u[i],u[++i],u[++i]);l.__c&&l.__c(t,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(n){n.call(t)})}catch(n){l.__e(n,t.__v)}})}function j(l,t,u,i,o,r,e,f,c){var a,s,v,p,d,m,g,b=u.props,k=t.props,C=t.type;if("svg"===C&&(o=!0),null!=r)for(a=0;a<r.length;a++)if((d=r[a])&&"setAttribute"in d==!!C&&(C?d.localName===C:3===d.nodeType)){l=d,r[a]=null;break}if(null==l){if(null===C)return document.createTextNode(k);l=o?document.createElementNS("http://www.w3.org/2000/svg",C):document.createElement(C,k.is&&k),r=null,f=!1}if(null===C)b===k||f&&l.data===k||(l.data=k);else{if(r=r&&n.call(l.childNodes),b=u.props||h,!f&&null!=r)for(b={},a=0;a<l.attributes.length;a++)b[(d=l.attributes[a]).name]=d.value;for(a in b)d=b[a],"children"==a||("dangerouslySetInnerHTML"==a?v=d:"key"===a||a in k||I(l,a,null,d,o));for(a in k)d=k[a],"children"==a?p=d:"dangerouslySetInnerHTML"==a?s=d:"value"==a?m=d:"checked"==a?g=d:"key"===a||f&&"function"!=typeof d||b[a]===d||I(l,a,d,b[a],o);if(s)f||v&&(s.__html===v.__html||s.__html===l.innerHTML)||(l.innerHTML=s.__html),t.__k=[];else if(v&&(l.innerHTML=""),S(l,y(p)?p:[p],t,u,i,o&&"foreignObject"!==C,r,e,r?r[0]:u.__k&&w(u,0),f,c),null!=r)for(a=r.length;a--;)null!=r[a]&&_(r[a]);f||(a="value",void 0!==m&&(m!==l[a]||"progress"===C&&!m||"option"===C&&m!==b[a])&&I(l,a,m,b[a],!1),a="checked",void 0!==g&&g!==l[a]&&I(l,a,g,b[a],!1))}return l}function z(n,t,u){try{"function"==typeof n?n(t):n.current=t}catch(n){l.__e(n,u)}}function F(n,t,u){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||z(i,null,t)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,t)}i.base=i.__P=null,n.__c=void 0}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&F(i[o],t,u||"function"!=typeof n.type);u||null==n.__e||_(n.__e),n.__=n.__e=n.__d=void 0}function N(n,l,t){return this.constructor(n,t)}function O(t,u,i){var o,r,e,f;l.__&&l.__(t,u),r=(o="function"==typeof i)?null:i&&i.__k||u.__k,e=[],f=[],L(u,t=(!o&&i||u).__k=m(b,null,[t]),r||h,h,void 0!==u.ownerSVGElement,!o&&i?[i]:r?null:u.firstChild?n.call(u.childNodes):null,e,!o&&i?i:r?r.__e:u.firstChild,o,f),M(e,t,f)}n=v.slice,l={__e:function(n,l,t,u){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,u||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},t=0,u=function(n){return null!=n&&null==n.constructor},k.prototype.setState=function(n,l){var t;t=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof n&&(n=n(d({},t),this.props)),n&&d(t,n),null!=n&&this.__v&&(l&&this._sb.push(l),x(this))},k.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),x(this))},k.prototype.render=b,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={__proto__:null,render:O,hydrate:function n(l,t){O(l,t,n)},createElement:m,h:m,Fragment:b,createRef:function(){return{current:null}},isValidElement:u,Component:k,cloneElement:function(l,t,u){var i,o,r,e,f=d({},l.props);for(r in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),t)"key"==r?i=t[r]:"ref"==r?o=t[r]:f[r]=void 0===t[r]&&void 0!==e?e[r]:t[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):u),g(l.type,f,i||l.key,o||l.ref,null)},createContext:function(n,l){var t={__c:l="__cC"+f++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var t,u;return this.getChildContext||(t=[],(u={})[l]=this,this.getChildContext=function(){return u},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&t.some(function(n){n.__e=!0,x(n)})},this.sub=function(n){t.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){t.splice(t.indexOf(n),1),l&&l.call(n)}}),n.children}};return t.Provider.__=t.Consumer.contextType=t},toChildArray:function n(l,t){return t=t||[],null==l||"boolean"==typeof l||(y(l)?l.some(function(l){n(l,t)}):t.push(l)),t},options:l},typeof module<"u"?module.exports=c:self.preact=c});
//# sourceMappingURL=preact.min.umd.js.map