3 lines
11 KiB
JavaScript
3 lines
11 KiB
JavaScript
|
|
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n||self).preact={})}(this,function(n){var t,i,e,r,o,f,u,c,s,a,h,p,l,y,v,d,w="http://www.w3.org/2000/svg",_="http://www.w3.org/1999/xhtml",g=null,m=void 0,b={},k=[],x=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,M=Array.isArray;function S(n,t){for(var i in t)n[i]=t[i];return n}function T(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function $(n,i,e){var r,o,f,u={};for(f in i)"key"==f?r=i[f]:"ref"==f?o=i[f]:u[f]=i[f];if(arguments.length>2&&(u.children=arguments.length>3?t.call(arguments,2):e),"function"==typeof n&&n.defaultProps!=g)for(f in n.defaultProps)u[f]===m&&(u[f]=n.defaultProps[f]);return C(n,u,r,o,g)}function C(n,t,r,o,f){var u={type:n,props:t,key:r,ref:o,__k:g,__:g,__b:0,__e:g,__c:g,constructor:m,__v:f==g?++e:f,__i:-1,__u:0};return f==g&&i.vnode!=g&&i.vnode(u),u}function I(n){return n.children}function P(n,t){this.props=n,this.context=t}function j(n,t){if(t==g)return n.__?j(n.__,n.__i+1):g;for(var i;t<n.__k.length;t++)if((i=n.__k[t])!=g&&i.__e!=g)return i.__e;return"function"==typeof n.type?j(n):g}function A(n){if(n.__P&&n.__d){var t=n.__v,e=t.__e,r=[],o=[],f=S({},t);f.__v=t.__v+1,i.vnode&&i.vnode(f),E(n.__P,f,t,n.__n,n.__P.namespaceURI,32&t.__u?[e]:g,r,e==g?j(t):e,!!(32&t.__u),o),f.__v=t.__v,f.__.__k[f.__i]=f,J(r,f,o),t.__e=t.__=null,f.__e!=e&&H(f)}}function H(n){if((n=n.__)!=g&&n.__c!=g)return n.__e=n.__c.base=g,n.__k.some(function(t){if(t!=g&&t.__e!=g)return n.__e=n.__c.base=t.__e}),H(n)}function L(n){(!n.__d&&(n.__d=!0)&&o.push(n)&&!F.__r++||f!=i.debounceRendering)&&((f=i.debounceRendering)||u)(F)}function F(){try{for(var n,t=1;o.length;)o.length>t&&o.sort(c),n=o.shift(),t=o.length,A(n)}finally{o.length=F.__r=0}}function O(n,t,i,e,r,o,f,u,c,s,a){var h,p,l,y,v,d,w,_=e&&e.__k||k,x=t.length;for(c=z(i,t,_,c,x),h=0;h<x;h++)(l=i.__k[h])!=g&&(p=-1!=l.__i&&_[l.__i]||b,l.__i=h,d=E(n,l,p,r,o,f,u,c,s,a),y=l.__e,l.ref&&p.ref!=l.ref&&(p.ref&&R(p.ref,g,l),a.push(l.ref,l.__c||y,l)),v==g&&y!=g&&(v=y),(w=!!(4&l.__u))||p.__k===l.__k?(c=N(l,c,n,w),w&&p.__e&&(p.__e=g)):"function"==typeof l.type&&d!==m?c=d:y&&(c=y.nextSibling),l.__u&=-7);return i.__e=v,c}function z(n,t,i,e,r){var o,f,u,c,s,a=i.length,h=a,p=0;for(n.__k=new Array(r),o=0;o<r;o++)(f=t[o])!=g&&"boolean"!=typeof f&&"function"!=typeof f?("string"==typeof f||"number"==typeof f||"bigint"==typeof f||f.constructor==String?f=n.__k[o]=C(g,f,g,g,g):M(f)?f=n.__k[o]=C(I,{children:f},g,g,g):f.constructor===m&&f.__b>0?f=n.__k[o]=C(f.type,f.props,f.key,f.ref?f.ref:g,f.__v):n.__k[o]=f,c=o+p,f.__=n,f.__b=n.__b+1,s=f.__i=V(f,i,c,h),u=g,-1!=s&&(h--,(u=i[s])&&(u.__u|=2)),u==g||u.__v==g?(-1==s&&(r>a?p--:r<a&&p++),"function"!=typeof f.type&&(f.__u|=4)):s!=c&&(s==c-1?p--:s==c+1?p++:(s>c?p--:p++,f.__u|=4))):n.__k[o]=g;if(h)for(o=0;o<a;o++)(u=i[o])!=g&&0==(2&u.__u)&&(u.__e==e&&(e=j(u)),U(u,u));return e}function N(n,t,i,e){var r,o;if("function"==typeof n.type){for(r=n.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=n,t=N(r[o],t,i,e));return t}n.__e!=t&&(e&&(t&&n.type&&!t.parentNode&&(t=j(n)),i.insertBefore(n.__e,t||g)),t=n.__e);do{t=t&&t.nextSibling}while(t!=g&&8==t.nodeType);return t}function V(n,t,i,e){var r,o,f,u=n.key,c=n.type,s=t[i],a=s!=g&&0==(2&s.__u);if(s===g&&null==u||a&&u==s.key&&c==s.type)return i;if(e>(a?1:0))for(r=i-1,o=i+1;r>=0||o<t.length;)if((s=t[f=r>=0?r--:o++])!=g&&0==(2&s.__u)&&u==s.key&&c==s.type)return f;return-1}function q(n,t,i){"-"==t[0]?n.setProperty(t,i==g?"":i):n[t]=i==g?"":"number"!=typeof i||x.test(t)?i:i+"px"}function B(n,t,i,e,r){var o,f;n:if("style"==t)if("string"==typeof i)n.style.cssText=i;else{if("string"==typeof e&&(n.style.cssText=e=""),e)for(t in e)i&&t in i||q(n.style,t,"");if(i)for(t in i)e&&i[t]==e[t]||q(n.style,t,i[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(p,"$1")),f=t.toLowerCase(),t=f in n||"onFocusOut"==t||"onFocusIn"==t?f.slice(2):t.slice(2),n.l||(n.l={}),n.l[t+o]=i,i?e?i[h]=e[h]:(i[h]=l,n.addEventListener(t,o?v:y,o)):n.removeEventListener(t,o?v:y,o);else{if(r==w)t=t.replace(/xli
|
||
|
|
//# sourceMappingURL=preact.umd.js.map
|