6 lines
4.3 KiB
JavaScript
6 lines
4.3 KiB
JavaScript
"use strict";(this.webpackChunkdiscord_app=this.webpackChunkdiscord_app||[]).push([[79730],{979730:(t,e,r)=>{r.d(e,{tJ:()=>d});function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,
|
|
Object.prototype.propertyIsEnumerable;var i=Object.defineProperty,a=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,l=function(t,e,r){return e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},s=function(t,e){for(var r in e||(e={}))u.call(e,r)&&l(t,r,e[r]);var n=!0,o=!1,i=void 0;if(a)try{for(var s,f=a(e)[Symbol.iterator]();!(n=(s=f.next()).done);n=!0){r=s.value;c.call(e,r)&&l(t,r,e[r])}}catch(t){o=!0;i=t}finally{try{n||null==f.return||f.return()}finally{if(o)throw i}}return t},f=function(t){return function(e){try{var r=t(e);return r instanceof Promise?r:{then:function(t){return f(t)(r)},catch:function(t){return this}}}catch(t){return{then:function(t){return this},catch:function(e){return f(e)(t)}}}}},d=function(t,e){return function(r,n,i){var a=s({getStorage:function(){return localStorage},serialize:JSON.stringify,deserialize:JSON.parse,partialize:function(t){return t},version:0,merge:function(t,e){
|
|
return s(s({},e),t)}},e);(a.blacklist||a.whitelist)&&console.warn("The ".concat(a.blacklist?"blacklist":"whitelist"," option is deprecated and will be removed in the next version. Please use the 'partialize' option instead."));var u,c=!1,l=new Set,d=new Set;try{u=a.getStorage()}catch(t){}if(!u)return t((function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];console.warn("[zustand persist middleware] Unable to update item '".concat(a.name,"', the given storage is currently unavailable."));r.apply(void 0,o(e))}),n,i);u.removeItem||console.warn("[zustand persist middleware] The given storage for item '".concat(a.name,"' does not contain a 'removeItem' method, which will be required in v4."));var h=f(a.serialize),p=function(){var t,e=a.partialize(s({},n()));a.whitelist&&Object.keys(e).forEach((function(t){var r;!(null==(r=a.whitelist)?void 0:r.includes(t))&&delete e[t]}));a.blacklist&&a.blacklist.forEach((function(t){return delete e[t]}));var r=h({state:e,
|
|
version:a.version}).then((function(t){return u.setItem(a.name,t)})).catch((function(e){t=e}));if(t)throw t;return r},v=i.setState;i.setState=function(t,e){v(t,e);p()};var y,m=t((function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];r.apply(void 0,o(e));p()}),n,i),b=function(){var t;if(u){c=!1;l.forEach((function(t){return t(n())}));var e=(null==(t=a.onRehydrateStorage)?void 0:t.call(a,n()))||void 0;return f(u.getItem.bind(u))(a.name).then((function(t){if(t)return a.deserialize(t)})).then((function(t){if(t){if("number"!=typeof t.version||t.version===a.version)return t.state;if(a.migrate)return a.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((function(t){var e;y=a.merge(t,null!=(e=n())?e:m);r(y,!0);return p()})).then((function(){null==e||e(y,void 0);c=!0;d.forEach((function(t){return t(y)}))})).catch((function(t){null==e||e(void 0,t)}))}};i.persist={
|
|
setOptions:function(t){a=s(s({},a),t);t.getStorage&&(u=t.getStorage())},clearStorage:function(){var t;null==(t=null==u?void 0:u.removeItem)||t.call(u,a.name)},rehydrate:function(){return b()},hasHydrated:function(){return c},onHydrate:function(t){l.add(t);return function(){l.delete(t)}},onFinishHydration:function(t){d.add(t);return function(){d.delete(t)}}};b();return y||m}}}}]);
|
|
//# sourceMappingURL=a48ac06ae30799d7d07a.js.map
|