2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("universal-cookie"),require("react")):"function"==typeof define&&define.amd?define(["universal-cookie","react"],t):(e=e||self).ReactCookie=t(e.UniversalCookie,e.React)}(this,function(l,y){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t){return e(t={exports:{}},t.exports),t.exports}l=l&&l.hasOwnProperty("default")?l.default:l,y=y&&y.hasOwnProperty("default")?y.default:y;var p=t(function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=((r=l)&&r.__esModule?r:{default:r}).default;t.default=o,e.exports=t.default});e(p);var d=t(function(e,t){function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Consumer=t.Provider=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==u(e)&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(y),n=(r=p)&&r.__esModule?r:{default:r};function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}var i=o.createContext(new n.default),a=i.Provider,c=i.Consumer;t.Consumer=c,t.Provider=a;var s=i;t.default=s});e(d);d.Consumer,d.Provider;var f=t(function(e,t){function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==u(e)&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(y),n=(r=l)&&r.__esModule?r:{default:r};function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}var i,a,c=(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});function s(e){var t=a.call(this,e)||this;return e.cookies?t.cookies=e.cookies:t.cookies=new n.default,t}var p=(a=o.Component,c(s,a),s.prototype.render=function(){return o.createElement(d.Provider,{value:this.cookies},this.props.children)},s);t.default=p,e.exports=t.default});e(f);var r=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,n=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,u=r?Symbol.for("react.strict_mode"):60108,f=r?Symbol.for("react.profiler"):60114,a=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,s=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,l=r?Symbol.for("react.forward_ref"):60112,y=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,b=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.fundamental"):60117,O=r?Symbol.for("react.responder"):60118,P=r?Symbol.for("react.scope"):60119;function h(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case s:case p:case i:case f:case u:case y:return e;default:switch(e=e&&e.$$typeof){case c:case l:case b:case m:case a:return e;default:return t}}case n:return t}}}function C(e){return h(e)===p}t.typeOf=h,t.AsyncMode=s,t.ConcurrentMode=p,t.ContextConsumer=c,t.ContextProvider=a,t.Element=o,t.ForwardRef=l,t.Fragment=i,t.Lazy=b,t.Memo=m,t.Portal=n,t.Profiler=f,t.StrictMode=u,t.Suspense=y,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===f||e===u||e===y||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===m||e.$$typeof===a||e.$$typeof===c||e.$$typeof===l||e.$$typeof===v||e.$$typeof===O||e.$$typeof===P)},t.isAsyncMode=function(e){return C(e)||h(e)===s},t.isConcurrentMode=C,t.isContextConsumer=function(e){return h(e)===c},t.isContextProvider=function(e){return h(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return h(e)===l},t.isFragment=function(e){return h(e)===i},t.isLazy=function(e){return h(e)===b},t.isMemo=function(e){return h(e)===m},t.isPortal=function(e){return h(e)===n},t.isProfiler=function(e){return h(e)===f},t.isStrictMode=function(e){return h(e)===u},t.isSuspense=function(e){return h(e)===y}});e(r);r.typeOf,r.AsyncMode,r.ConcurrentMode,r.ContextConsumer,r.ContextProvider,r.Element,r.ForwardRef,r.Fragment,r.Lazy,r.Memo,r.Portal,r.Profiler,r.StrictMode,r.Suspense,r.isValidElementType,r.isAsyncMode,r.isConcurrentMode,r.isContextConsumer,r.isContextProvider,r.isElement,r.isForwardRef,r.isFragment,r.isLazy,r.isMemo,r.isPortal,r.isProfiler,r.isStrictMode,r.isSuspense;var o=t(function(e,t){});e(o);o.typeOf,o.AsyncMode,o.ConcurrentMode,o.ContextConsumer,o.ContextProvider,o.Element,o.ForwardRef,o.Fragment,o.Lazy,o.Memo,o.Portal,o.Profiler,o.StrictMode,o.Suspense,o.isValidElementType,o.isAsyncMode,o.isConcurrentMode,o.isContextConsumer,o.isContextProvider,o.isElement,o.isForwardRef,o.isFragment,o.isLazy,o.isMemo,o.isPortal,o.isProfiler,o.isStrictMode,o.isSuspense;var n=t(function(e){e.exports=r}),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},m={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},u={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function b(e){return n.isMemo(e)?u:a[e.$$typeof]||i}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var v=Object.defineProperty,O=Object.getOwnPropertyNames,P=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,C=Object.getPrototypeOf,_=Object.prototype;var g=function e(t,r,o){if("string"!=typeof r){if(_){var n=C(r);n&&n!==_&&e(t,n,o)}var i=O(r);P&&(i=i.concat(P(r)));for(var u=b(t),f=b(r),a=0;a<i.length;++a){var c=i[a];if(!(m[c]||o&&o[c]||f&&f[c]||u&&u[c])){var s=h(r,c);try{v(t,c,s)}catch(e){}}}}return t},c=t(function(e,t){function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(i){var r=i.displayName||i.name,o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onChange=function(){e.forceUpdate()},e}return n(e,t),e.prototype.listen=function(){this.props.cookies.addChangeListener(this.onChange)},e.prototype.unlisten=function(e){(e||this.props.cookies).removeChangeListener(this.onChange)},e.prototype.componentDidMount=function(){this.listen()},e.prototype.componentDidUpdate=function(e){e.cookies!==this.props.cookies&&(this.unlisten(e.cookies),this.listen())},e.prototype.componentWillUnmount=function(){this.unlisten()},e.prototype.render=function(){var e=this.props,t=e.forwardedRef,r=e.cookies,o=s(e,["forwardedRef","cookies"]),n=r.getAll();return f.createElement(i,c({},o,{ref:t,cookies:r,allCookies:n}))},e.displayName="withCookies("+r+")",e.WrappedComponent=i,e}(f.Component),e=f.forwardRef(function(t,r){return f.createElement(d.Consumer,null,function(e){return f.createElement(o,c({cookies:e},t,{forwardedRef:r}))})});return e.displayName=o.displayName,e.WrappedComponent=o.WrappedComponent,g(e,i)};var f=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==u(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(y);function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}var o,n=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c=function(){return(c=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},s=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r};e.exports=t.default});e(c);var s=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var r=(0,y.useContext)(c.default);if(!r)throw new Error("Missing <CookiesProvider>");var e=r.getAll(),o=(0,y.useState)(e),n=o[0],i=o[1],u=(0,y.useRef)(n);(0,y.useEffect)(function(){function e(){var e=r.getAll();!function(e,t,r){if(!e)return!0;for(var o=0,n=e;o<n.length;o++){var i=n[o];if(t[i]!==r[i])return!0}return!1}(t||null,e,u.current)||i(e),u.current=e}return r.addChangeListener(e),function(){r.removeChangeListener(e)}},[r]);var f=(0,y.useMemo)(function(){return r.set.bind(r)},[r]),a=(0,y.useMemo)(function(){return r.remove.bind(r)},[r]);return[n,f,a]};var r,c=(r=d)&&r.__esModule?r:{default:r};e.exports=t.default});return e(s),e(t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Cookies",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CookiesProvider",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"withCookies",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"useCookies",{enumerable:!0,get:function(){return i.default}});var r=u(p),o=u(f),n=u(c),i=u(s);function u(e){return e&&e.__esModule?e:{default:e}}}))});
|