3 lines
9.0 KiB
JavaScript
3 lines
9.0 KiB
JavaScript
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("preact/hooks"),require("preact")):"function"==typeof define&&define.amd?define(["exports","preact/hooks","preact"],t):t(n.preactCompat={},n.preactHooks,n.preact)}(this,function(n,t,e){function u(n,t){for(var e in t)n[e]=t[e];return n}function r(n,t){for(var e in n)if("__source"!==e&&!(e in t))return!0;for(var u in t)if("__source"!==u&&n[u]!==t[u])return!0;return!1}function i(n){this.props=n}function o(n,t){function u(n){var e=this.props.ref,u=e==n.ref;return!u&&e&&(e.call?e(null):e.current=null),t?!t(this.props,n)||!u:r(this.props,n)}function i(t){return this.shouldComponentUpdate=u,e.createElement(n,t)}return i.displayName="Memo("+(n.displayName||n.name)+")",i.prototype.isReactComponent=!0,i.__f=!0,i}(i.prototype=new e.Component).isPureReactComponent=!0,i.prototype.shouldComponentUpdate=function(n,t){return r(this.props,n)||r(this.state,t)};var l=e.options.__b;e.options.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),l&&l(n)};var f="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function c(n){function t(t){var e=u({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=f,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var a=function(n,t){return null==n?null:e.toChildArray(e.toChildArray(n).map(t))},s={map:a,forEach:a,count:function(n){return n?e.toChildArray(n).length:0},only:function(n){var t=e.toChildArray(n);if(1!==t.length)throw"Children.only";return t[0]},toArray:e.toChildArray},h=e.options.__e;e.options.__e=function(n,t,e,u){if(n.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),r.__c(n,t);h(n,t,e,u)};var d=e.options.unmount;function v(){this.__u=0,this.t=null,this.__b=null}function p(n){var t=n.__.__c;return t&&t.__e&&t.__e(n)}function m(n){var t,u,r;function i(i){if(t||(t=n()).then(function(n){u=n.default||n},function(n){r=n}),r)throw r;if(!u)throw t;return e.createElement(u,i)}return i.displayName="Lazy",i.__f=!0,i}function y(){this.u=null,this.i=null}e.options.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),d&&d(n)},(v.prototype=new e.Component).__c=function(n,t){var e=t.__c,u=this;null==u.t&&(u.t=[]),u.t.push(e);var r=p(u.__v),i=!1,o=function(){i||(i=!0,e.__R=null,r?r(l):l())};e.__R=o;var l=function(){if(!--u.__u){if(u.state.__e){var n=u.state.__e;u.__v.__k[0]=function n(t,e,u){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return n(t,e,u)}),t.__c&&t.__c.__P===e&&(t.__e&&u.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=u)),t}(n,n.__c.__P,n.__c.__O)}var t;for(u.setState({__e:u.__b=null});t=u.t.pop();)t.forceUpdate()}},f=!0===t.__h;u.__u++||f||u.setState({__e:u.__b=u.__v.__k[0]}),n.then(o,o)},v.prototype.componentWillUnmount=function(){this.t=[]},v.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=function n(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c()}),t.__c.__H=null),null!=(t=u({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)})),t}(this.__b,r,i.__O=i.__P)}this.__b=null}var o=t.__e&&e.createElement(e.Fragment,null,n.fallback);return o&&(o.__h=null),[e.createElement(e.Fragment,null,t.__e?null:n.children),o]};var b=function(n,t,e){if(++e[1]===e[0]&&n.i.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.i.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2]}};function _(n){return this.getChildContext=function(){return n.context},n.children}function S(n){var t=this,u=n.o;t.componentWillUnmount=function(){e.render(null,t.l),t.l=null,t.o=null},t.o&&t.o!==u&&t.componentWillUnmount(),n.__v?(t.l||(t.o=u,t.l={nodeType:1,parentNode:u,childNodes:[],appendChild:function(n){this.childNodes.push(n),t.o.appendChild(n)},insertBefore:function(n,e){this.childNodes.push(n),t.o.appendChild(n)},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t.o.removeChild(n)}}),e.render(e.createElement(_,{context:t.context},n.__v),t.l)):t.l&&t.componentWillUnmount()}function C(n,t){var u=e.createElement(S,{__v:n,o:t});return u.containerInfo=t,u}(y.prototype=new e.Component).__e=function(n){var t=this,e=p(t.__v),u=t.i.get(n);return u[0]++,function(r){var i=function(){t.props.revealOrder?(u.push(r),b(t,n,u)):r()};e?e(i):i()}},y.prototype.render=function(n){this.u=null,this.i=new Map;var t=e.toChildArray(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var u=t.length;u--;)this.i.set(t[u],this.u=[1,0,this.u]);return n.children},y.prototype.componentDidUpdate=y.prototype.componentDidMount=function(){var n=this;this.i.forEach(function(t,e){b(n,e,t)})};var w="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,g=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|shape|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,E="undefined"!=typeof document,R=function(n){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function x(n,t,u){return null==t.__k&&(t.textContent=""),e.render(n,t),"function"==typeof u&&u(),n?n.__c:null}function N(n,t,u){return e.hydrate(n,t),"function"==typeof u&&u(),n?n.__c:null}e.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(e.Component.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t})}})});var k=e.options.event;function O(){}function A(){return this.cancelBubble}function L(){return this.defaultPrevented}e.options.event=function(n){return k&&(n=k(n)),n.persist=O,n.isPropagationStopped=A,n.isDefaultPrevented=L,n.nativeEvent=n};var U,M={configurable:!0,get:function(){return this.class}},T=e.options.vnode;e.options.vnode=function(n){var t=n.type,u=n.props,r=u;if("string"==typeof t){var i=-1===t.indexOf("-");for(var o in r={},u){var l=u[o];E&&"children"===o&&"noscript"===t||"value"===o&&"defaultValue"in u&&null==l||("defaultValue"===o&&"value"in u&&null==u.value?o="value":"download"===o&&!0===l?l="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!R(u.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(o)?o=o.toLowerCase():i&&g.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===l&&(l=void 0),/^oninput$/i.test(o)&&(o=o.toLowerCase(),r[o]&&(o="oninputCapture")),r[o]=l)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=e.toChildArray(u.children).forEach(function(n){n.props.selected=-1!=r.value.indexOf(n.props.value)})),"select"==t&&null!=r.defaultValue&&(r.value=e.toChildArray(u.children).forEach(function(n){n.props.selected=r.multiple?-1!=r.defaultValue.indexOf(n.props.value):r.defaultValue==n.props.value})),n.props=r,u.class!=u.className&&(M.enumerable="className"in u,null!=u.className&&(r.class=u.className),Object.defineProperty(r,"className",M))}n.$$typeof=w,T&&T(n)};var j=e.options.__r;e.options.__r=function(n){j&&j(n),U=n.__c};var D={ReactCurrentDispatcher:{current:{readContext:function(n){return U.__n[n.__c].props.value}}}};function F(n){return e.createElement.bind(null,n)}function I(n){return!!n&&n.$$typeof===w}function W(n){return I(n)?e.cloneElement.apply(null,arguments):n}function P(n){return!!n.__k&&(e.render(null,n),!0)}function V(n){return n&&(n.base||1===n.nodeType&&n)||null}var $=function(n,t){return n(t)},z=function(n,t){return n(t)},B=e.Fragment,q={useState:t.useState,useReducer:t.useReducer,useEffect:t.useEffect,useLayoutEffect:t.useLayoutEffect,useRef:t.useRef,useImperativeHandle:t.useImperativeHandle,useMemo:t.useMemo,useCallback:t.useCallback,useContext:t.useContext,useDebugValue:t.useDebugValue,version:"17.0.2",Children:s,render:x,hydrate:N,unmountComponentAtNode:P,createPortal:C,createElement:e.createElement,createContext:e.createContext,createFactory:F,cloneElement:W,createRef:e.createRef,Fragment:e.Fragment,isValidElement:I,findDOMNode:V,Component:e.Component,PureComponent:i,memo:o,forwardRef:c,flushSync:z,unstable_batchedUpdates:$,StrictMode:B,Suspense:v,SuspenseList:y,lazy:m,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:D};Object.keys(t).forEach(function(e){n[e]=t[e]}),n.createElement=e.createElement,n.createContext=e.createContext,n.createRef=e.createRef,n.Fragment=e.Fragment,n.Component=e.Component,n.version="17.0.2",n.Children=s,n.render=x,n.hydrate=N,n.unmountComponentAtNode=P,n.createPortal=C,n.createFactory=F,n.cloneElement=W,n.isValidElement=I,n.findDOMNode=V,n.PureComponent=i,n.memo=o,n.forwardRef=c,n.flushSync=z,n.unstable_batchedUpdates=$,n.StrictMode=B,n.Suspense=v,n.SuspenseList=y,n.lazy=m,n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,n.default=q});
|
|
//# sourceMappingURL=compat.umd.js.map
|