pocketbase-react 0.1.2 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,28 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("redux"),require("@reduxjs/toolkit"),require("redux-persist"),require("react-redux"),require("@react-native-async-storage/async-storage"),require("pocketbase")):"function"==typeof define&&define.amd?define(["exports","react","redux","@reduxjs/toolkit","redux-persist","react-redux","@react-native-async-storage/async-storage","pocketbase"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).PocketbaseReact={},e.React,e.redux,e.toolkit,e.reduxPersist,e.reactRedux,e.AsyncStorage,e.Pocketbase)}(this,(function(e,t,r,n,o,a,i,c){"use strict";function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var l=s(t),d=u(i),p=u(c);const f="SET_RECORDS",y="ADD_RECORD",b="ADD_RECORDS",v="UPDATE_RECORD",h="DELETE_RECORD",m="DELETE_RECORDS",g=(e,t)=>({type:f,key:e,payload:t}),E=(e,t)=>({type:y,key:e,payload:t}),R=(e,t)=>({type:h,key:e,payload:t}),O=(e,t)=>({type:v,key:e,payload:t});var _=Object.freeze({__proto__:null,setRecords:g,addRecord:E,addRecords:(e,t)=>({type:b,key:e,payload:t}),deleteRecord:R,deleteRecords:(e,t)=>({type:m,key:e,payload:t}),updateRecord:O});function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},k.apply(this,arguments)}function w(e,t){return[...t,e]}function C(e,t){return[...t,...e]}function S(e,t){return t.map((t=>t.id===e.id?e:t))}function D(e,t){return t.filter((t=>t.id!==e.id))}function P(e,t){return t.filter((t=>!e.includes(t)))}const x=r.combineReducers({records:(e={},t)=>{var r;const n=null!=(r=e[t.key])?r:[];switch(t.type){case f:if(Array.isArray(t.payload))return k({},e,{[t.key]:t.payload});case y:return k({},e,{[t.key]:w(t.payload,n)});case b:return k({},e,{[t.key]:C(t.payload,n)});case h:return k({},e,{[t.key]:D(t.payload,n)});case m:return k({},e,{[t.key]:P(t.payload,n)});case v:return k({},e,{[t.key]:S(t.payload,n)});default:return e}}});function j(e){return function(t){var r=t.dispatch,n=t.getState;return function(t){return function(o){return"function"==typeof o?o(r,n,e):t(o)}}}}var A=j();A.withExtraArgument=j;var T=A;const I={key:"root",storage:{getItem:async(e,...t)=>"undefined"!=typeof document?(console.log("I'm on the web!"),localStorage.getItem(e)):"undefined"!=typeof navigator&&"ReactNative"===navigator.product?(console.log("I'm in react-native"),await d.default.getItem(e)):void 0,setItem:async(e,t,...r)=>"undefined"!=typeof document?localStorage.setItem(e,t):"undefined"!=typeof navigator&&"ReactNative"===navigator.product?await d.default.setItem(e,t):void 0,removeItem:async(e,...t)=>"undefined"!=typeof document?localStorage.removeItem(e):"undefined"!=typeof navigator&&"ReactNative"===navigator.product?await d.default.removeItem(e):void 0}},L=n.combineReducers({reducer:o.persistReducer(I,x)}),q=n.configureStore({reducer:L,middleware:[T]}),U=q.dispatch,z=a.useSelector,M=o.persistStore(q),N=()=>t.useContext(V),B=t.createContext(null),F=e=>{const r=N(),n=U,[o,a]=l.useState(e.collections||[]),i={subscribe:async e=>{await(null==r?void 0:r.realtime.subscribe(e,(t=>{switch(t.action){case"create":n(E(e,t.record));break;case"update":n(O(e,t.record));break;case"delete":n(R(e,t.record))}})))},unsubscribe:e=>{e?null==r||r.realtime.unsubscribe(e):null==r||r.realtime.unsubscribe()},fetch:async e=>{const t=await(null==r?void 0:r.records.getFullList(e,200));n(g(e,t))},create:async(e,t)=>{await(null==r?void 0:r.records.create(e,t))},update:async(e,t,n)=>{await(null==r?void 0:r.records.update(e,t,n))},delete:async(e,t)=>{await(null==r?void 0:r.records.delete(e,t))}};return t.useEffect((()=>(o&&o.forEach((e=>{i.fetch(e),i.subscribe(e)})),()=>i.unsubscribe())),[o]),l.createElement(B.Provider,{value:i},e.children)},V=t.createContext(null),W=e=>l.createElement(V.Provider,{value:e.client},e.children);function G(e){return G="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},G(e)}function H(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J(e,t){for(var r=0;t.length>r;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function K(e,t){return!t||"object"!==G(t)&&"function"!=typeof t?X(e):t}function Q(e){return Q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Q(e)}function X(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y(e,t){return Y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Y(e,t)}function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var $=function(e){function t(){var e,r;H(this,t);for(var n=arguments.length,o=Array(n),a=0;n>a;a++)o[a]=arguments[a];return Z(X(r=K(this,(e=Q(t)).call.apply(e,[this].concat(o)))),"state",{bootstrapped:!1}),Z(X(r),"_unsubscribe",void 0),Z(X(r),"handlePersistorState",(function(){r.props.persistor.getState().bootstrapped&&(r.props.onBeforeLift?Promise.resolve(r.props.onBeforeLift()).finally((function(){return r.setState({bootstrapped:!0})})):r.setState({bootstrapped:!0}),r._unsubscribe&&r._unsubscribe())})),r}var r,n,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Y(e,t)}(t,e),r=t,(n=[{key:"componentDidMount",value:function(){this._unsubscribe=this.props.persistor.subscribe(this.handlePersistorState),this.handlePersistorState()}},{key:"componentWillUnmount",value:function(){this._unsubscribe&&this._unsubscribe()}},{key:"render",value:function(){return"function"==typeof this.props.children?this.props.children(this.state.bootstrapped):this.state.bootstrapped?this.props.children:this.props.loading}}])&&J(r.prototype,n),o&&J(r,o),t}(t.PureComponent);Z($,"defaultProps",{children:null,loading:null});const ee=t.createContext(null);e.ADD_RECORD=y,e.ADD_RECORDS=b,e.ClientContext=V,e.ClientProvider=W,e.ContentContext=B,e.ContentProvider=F,e.DELETE_RECORD=h,e.DELETE_RECORDS=m,e.Pocketbase=e=>{const[r,n]=l.useState(null);return t.useEffect((()=>{const t=new p.default(e.serverURL);t.admins.authViaEmail(e.credentials.username,e.credentials.password).then((()=>{n(t),console.log("Pocketbase client initialized")}))}),[e.serverURL]),r?l.createElement(W,{client:r},l.createElement(a.Provider,{store:q},l.createElement($,{persistor:M},l.createElement(F,{collections:e.initialCollections},e.children)))):null},e.PocketbaseContext=ee,e.SET_RECORDS=f,e.UPDATE_RECORD=v,e.appReducer=x,e.persistConfig=I,e.persistor=M,e.recordsAction=_,e.store=q,e.useAppContent=function(e,r=!1){var n;const o=null!=(n=z((t=>t.reducer.records[e])))?n:[],a=t.useContext(B);return t.useEffect((()=>{r&&(null==a||a.fetch(e))}),[e,r]),{records:o,actions:{subscribe:async()=>await(null==a?void 0:a.subscribe(e)),unsubscribe:()=>null==a?void 0:a.unsubscribe(e),refetch:async()=>await(null==a?void 0:a.fetch(e)),create:async t=>await(null==a?void 0:a.create(e,t)),update:async(t,r)=>await(null==a?void 0:a.update(e,t,r)),delete:async t=>await(null==a?void 0:a.delete(e,t))}}},e.useAppDispatch=U,e.useAppSelector=z,e.useClientContext=N,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react-dom"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).PocketbaseReact={},t.reactDom)}(this,(function(t,e){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}
2
+ /**
3
+ * @license React
4
+ * react.production.min.js
5
+ *
6
+ * Copyright (c) Facebook, Inc. and its affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */()}},r.exports),r.exports}var o=Symbol.for("react.element"),i=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),l=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),y=Symbol.iterator;var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,m={};function g(t,e,r){this.props=t,this.context=e,this.refs=m,this.updater=r||v}function O(){}function w(t,e,r){this.props=t,this.context=e,this.refs=m,this.updater=r||v}g.prototype.isReactComponent={},g.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},g.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},O.prototype=g.prototype;var S=w.prototype=new O;S.constructor=w,b(S,g.prototype),S.isPureReactComponent=!0;var P=Array.isArray,j=Object.prototype.hasOwnProperty,E={current:null},_={key:!0,ref:!0,__self:!0,__source:!0};function C(t,e,r){var n,i={},u=null,s=null;if(null!=e)for(n in void 0!==e.ref&&(s=e.ref),void 0!==e.key&&(u=""+e.key),e)j.call(e,n)&&!_.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(1===a)i.children=r;else if(a>1){for(var c=Array(a),l=0;a>l;l++)c[l]=arguments[l+2];i.children=c}if(t&&t.defaultProps)for(n in a=t.defaultProps)void 0===i[n]&&(i[n]=a[n]);return{$$typeof:o,type:t,key:u,ref:s,props:i,_owner:E.current}}function R(t){return"object"==typeof t&&null!==t&&t.$$typeof===o}var k=/\/+/g;function x(t,e){return"object"==typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,(function(t){return e[t]}))}(""+t.key):e.toString(36)}function A(t,e,r,n,u){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var a=!1;if(null===t)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case o:case i:a=!0}}if(a)return u=u(a=t),t=""===n?"."+x(a,0):n,P(u)?(r="",null!=t&&(r=t.replace(k,"$&/")+"/"),A(u,e,r,"",(function(t){return t}))):null!=u&&(R(u)&&(u=function(t,e){return{$$typeof:o,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}(u,r+(!u.key||a&&a.key===u.key?"":(""+u.key).replace(k,"$&/")+"/")+t)),e.push(u)),1;if(a=0,n=""===n?".":n+":",P(t))for(var c=0;t.length>c;c++){var l=n+x(s=t[c],c);a+=A(s,e,r,l,u)}else if(l=function(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=y&&t[y]||t["@@iterator"])?t:null}(t),"function"==typeof l)for(t=l.call(t),c=0;!(s=t.next()).done;)a+=A(s=s.value,e,r,l=n+x(s,c++),u);else if("object"===s)throw Error("Objects are not valid as a React child (found: "+("[object Object]"===(e=t+"")?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return a}function I(t,e,r){if(null==t)return t;var n=[],o=0;return A(t,n,"","",(function(t){return e.call(r,t,o++)})),n}function T(t){if(-1===t._status){var e=t._result;(e=e()).then((function(e){0!==t._status&&-1!==t._status||(t._status=1,t._result=e)}),(function(e){0!==t._status&&-1!==t._status||(t._status=2,t._result=e)})),-1===t._status&&(t._status=0,t._result=e)}if(1===t._status)return t._result.default;throw t._result}var D={current:null},$={transition:null},N={map:I,forEach:function(t,e,r){I(t,(function(){e.apply(this,arguments)}),r)},count:function(t){var e=0;return I(t,(function(){e++})),e},toArray:function(t){return I(t,(function(t){return t}))||[]},only:function(t){if(!R(t))throw Error("React.Children.only expected to receive a single React element child.");return t}},L={Children:N,Component:g,Fragment:u,Profiler:a,PureComponent:w,StrictMode:s,Suspense:p,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:D,ReactCurrentBatchConfig:$,ReactCurrentOwner:E},cloneElement:function(t,e,r){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=b({},t.props),i=t.key,u=t.ref,s=t._owner;if(null!=e){if(void 0!==e.ref&&(u=e.ref,s=E.current),void 0!==e.key&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(c in e)j.call(e,c)&&!_.hasOwnProperty(c)&&(n[c]=void 0===e[c]&&void 0!==a?a[c]:e[c])}var c=arguments.length-2;if(1===c)n.children=r;else if(c>1){a=Array(c);for(var l=0;c>l;l++)a[l]=arguments[l+2];n.children=a}return{$$typeof:o,type:t.type,key:i,ref:u,props:n,_owner:s}},createContext:function(t){return(t={$$typeof:l,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:c,_context:t},t.Consumer=t},createElement:C,createFactory:function(t){var e=C.bind(null,t);return e.type=t,e},createRef:function(){return{current:null}},forwardRef:function(t){return{$$typeof:f,render:t}},isValidElement:R,lazy:function(t){return{$$typeof:h,_payload:{_status:-1,_result:t},_init:T}},memo:function(t,e){return{$$typeof:d,type:t,compare:void 0===e?null:e}},startTransition:function(t){var e=$.transition;$.transition={};try{t()}finally{$.transition=e}},unstable_act:function(){throw Error("act(...) is not supported in production builds of React.")},useCallback:function(t,e){return D.current.useCallback(t,e)},useContext:function(t){return D.current.useContext(t)},useDebugValue:function(){},useDeferredValue:function(t){return D.current.useDeferredValue(t)},useEffect:function(t,e){return D.current.useEffect(t,e)},useId:function(){return D.current.useId()},useImperativeHandle:function(t,e,r){return D.current.useImperativeHandle(t,e,r)},useInsertionEffect:function(t,e){return D.current.useInsertionEffect(t,e)},useLayoutEffect:function(t,e){return D.current.useLayoutEffect(t,e)},useMemo:function(t,e){return D.current.useMemo(t,e)},useReducer:function(t,e,r){return D.current.useReducer(t,e,r)},useRef:function(t){return D.current.useRef(t)},useState:function(t){return D.current.useState(t)},useSyncExternalStore:function(t,e,r){return D.current.useSyncExternalStore(t,e,r)},useTransition:function(){return D.current.useTransition()},version:"18.0.0-fc46dba67-20220329"},U=n((function(t){t.exports=L}));const M="SET_RECORDS",F="ADD_RECORD",q="ADD_RECORDS",z="UPDATE_RECORD",V="DELETE_RECORD",G="DELETE_RECORDS",J=(t,e)=>({type:M,key:t,payload:e}),K=(t,e)=>({type:F,key:t,payload:e}),W=(t,e)=>({type:V,key:t,payload:e}),B=(t,e)=>({type:z,key:t,payload:e});var H=Object.freeze({__proto__:null,setRecords:J,addRecord:K,addRecords:(t,e)=>({type:q,key:t,payload:e}),deleteRecord:W,deleteRecords:(t,e)=>({type:G,key:t,payload:e}),updateRecord:B});function X(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Y(t){for(var e=1;arguments.length>e;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Q(Object(r),!0).forEach((function(e){X(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Z(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var tt="function"==typeof Symbol&&Symbol.observable||"@@observable",et=function(){return Math.random().toString(36).substring(7).split("").join(".")},rt={INIT:"@@redux/INIT"+et(),REPLACE:"@@redux/REPLACE"+et(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+et()}};function nt(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function ot(t,e,r){var n;if("function"==typeof e&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw Error(Z(0));if("function"==typeof e&&void 0===r&&(r=e,e=void 0),void 0!==r){if("function"!=typeof r)throw Error(Z(1));return r(ot)(t,e)}if("function"!=typeof t)throw Error(Z(2));var o=t,i=e,u=[],s=u,a=!1;function c(){s===u&&(s=u.slice())}function l(){if(a)throw Error(Z(3));return i}function f(t){if("function"!=typeof t)throw Error(Z(4));if(a)throw Error(Z(5));var e=!0;return c(),s.push(t),function(){if(e){if(a)throw Error(Z(6));e=!1,c();var r=s.indexOf(t);s.splice(r,1),u=null}}}function p(t){if(!nt(t))throw Error(Z(7));if(void 0===t.type)throw Error(Z(8));if(a)throw Error(Z(9));try{a=!0,i=o(i,t)}finally{a=!1}for(var e=u=s,r=0;e.length>r;r++){(0,e[r])()}return t}function d(t){if("function"!=typeof t)throw Error(Z(10));o=t,p({type:rt.REPLACE})}function h(){var t,e=f;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw Error(Z(11));function r(){t.next&&t.next(l())}return r(),{unsubscribe:e(r)}}})[tt]=function(){return this},t}return p({type:rt.INIT}),(n={dispatch:p,subscribe:f,getState:l,replaceReducer:d})[tt]=h,n}function it(t){for(var e=Object.keys(t),r={},n=0;e.length>n;n++){var o=e[n];"function"==typeof t[o]&&(r[o]=t[o])}var i,u=Object.keys(r);try{!function(t){Object.keys(t).forEach((function(e){var r=t[e];if(void 0===r(void 0,{type:rt.INIT}))throw Error(Z(12));if(void 0===r(void 0,{type:rt.PROBE_UNKNOWN_ACTION()}))throw Error(Z(13))}))}(r)}catch(t){i=t}return function(t,e){if(void 0===t&&(t={}),i)throw i;for(var n=!1,o={},s=0;u.length>s;s++){var a=u[s],c=t[a],l=(0,r[a])(c,e);if(void 0===l)throw Error(Z(14));o[a]=l,n=n||l!==c}return(n=n||u.length!==Object.keys(t).length)?o:t}}function ut(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function st(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];return function(t){return function(){var r=t.apply(void 0,arguments),n=function(){throw Error(Z(15))},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=e.map((function(t){return t(o)}));return n=ut.apply(void 0,i)(r.dispatch),Y(Y({},r),{},{dispatch:n})}}}function at(){return at=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},at.apply(this,arguments)}function ct(t,e){return[...e,t]}function lt(t,e){return[...e,...t]}function ft(t,e){return e.map((e=>e.id===t.id?t:e))}function pt(t,e){return e.filter((e=>e.id!==t.id))}function dt(t,e){return e.filter((e=>!t.includes(e)))}const ht=it({records:(t={},e)=>{var r;const n=null!=(r=t[e.key])?r:[];switch(e.type){case M:if(Array.isArray(e.payload))return at({},t,{[e.key]:e.payload});case F:return at({},t,{[e.key]:ct(e.payload,n)});case q:return at({},t,{[e.key]:lt(e.payload,n)});case V:return at({},t,{[e.key]:pt(e.payload,n)});case G:return at({},t,{[e.key]:dt(e.payload,n)});case z:return at({},t,{[e.key]:ft(e.payload,n)});default:return t}}});function yt(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;e>n;n++)r[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function vt(t){return!!t&&!!t[re]}function bt(t){return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===ne}(t)||Array.isArray(t)||!!t[ee]||!!t.constructor[ee]||Pt(t)||jt(t))}function mt(t,e,r){void 0===r&&(r=!1),0===gt(t)?(r?Object.keys:oe)(t).forEach((function(n){r&&"symbol"==typeof n||e(n,t[n],t)})):t.forEach((function(r,n){return e(n,r,t)}))}function gt(t){var e=t[re];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Pt(t)?2:jt(t)?3:0}function Ot(t,e){return 2===gt(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function wt(t,e,r){var n=gt(t);2===n?t.set(e,r):3===n?(t.delete(e),t.add(r)):t[e]=r}function St(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function Pt(t){return Qt&&t instanceof Map}function jt(t){return Yt&&t instanceof Set}function Et(t){return t.o||t.t}function _t(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=ie(t);delete e[re];for(var r=oe(e),n=0;r.length>n;n++){var o=r[n],i=e[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(e[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[o]})}return Object.create(Object.getPrototypeOf(t),e)}function Ct(t,e){return void 0===e&&(e=!1),kt(t)||vt(t)||!bt(t)||(gt(t)>1&&(t.set=t.add=t.clear=t.delete=Rt),Object.freeze(t),e&&mt(t,(function(t,e){return Ct(e,!0)}),!0)),t}function Rt(){yt(2)}function kt(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function xt(t){var e=ue[t];return e||yt(18,t),e}function At(){return Ht}function It(t,e){e&&(xt("Patches"),t.u=[],t.s=[],t.v=e)}function Tt(t){Dt(t),t.p.forEach(Nt),t.p=null}function Dt(t){t===Ht&&(Ht=t.l)}function $t(t){return Ht={p:[],l:Ht,h:t,m:!0,_:0}}function Nt(t){var e=t[re];0===e.i||1===e.i?e.j():e.O=!0}function Lt(t,e){e._=e.p.length;var r=e.p[0],n=void 0!==t&&t!==r;return e.h.g||xt("ES5").S(e,t,n),n?(r[re].P&&(Tt(e),yt(4)),bt(t)&&(t=Ut(e,t),e.l||Ft(e,t)),e.u&&xt("Patches").M(r[re].t,t,e.u,e.s)):t=Ut(e,r,[]),Tt(e),e.u&&e.v(e.u,e.s),t!==te?t:void 0}function Ut(t,e,r){if(kt(e))return e;var n=e[re];if(!n)return mt(e,(function(o,i){return Mt(t,n,e,o,i,r)}),!0),e;if(n.A!==t)return e;if(!n.P)return Ft(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=_t(n.k):n.o;mt(3===n.i?new Set(o):o,(function(e,i){return Mt(t,n,o,e,i,r)})),Ft(t,o,!1),r&&t.u&&xt("Patches").R(n,r,t.u,t.s)}return n.o}function Mt(t,e,r,n,o,i){if(vt(o)){var u=Ut(t,o,i&&e&&3!==e.i&&!Ot(e.D,n)?i.concat(n):void 0);if(wt(r,n,u),!vt(u))return;t.m=!1}if(bt(o)&&!kt(o)){if(!t.h.F&&1>t._)return;Ut(t,o),e&&e.A.l||Ft(t,o)}}function Ft(t,e,r){void 0===r&&(r=!1),t.h.F&&t.m&&Ct(e,r)}function qt(t,e){var r=t[re];return(r?Et(r):t)[e]}function zt(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Vt(t){t.P||(t.P=!0,t.l&&Vt(t.l))}function Gt(t){t.o||(t.o=_t(t.t))}function Jt(t,e,r){var n=Pt(e)?xt("MapSet").N(e,r):jt(e)?xt("MapSet").T(e,r):t.g?function(t,e){var r=Array.isArray(t),n={i:r?1:0,A:e?e.A:At(),P:!1,I:!1,D:{},l:e,t:t,k:null,o:null,j:null,C:!1},o=n,i=se;r&&(o=[n],i=ae);var u=Proxy.revocable(o,i),s=u.revoke,a=u.proxy;return n.k=a,n.j=s,a}(e,r):xt("ES5").J(e,r);return(r?r.A:At()).p.push(n),n}function Kt(t){return vt(t)||yt(22,t),function t(e){if(!bt(e))return e;var r,n=e[re],o=gt(e);if(n){if(!n.P&&(4>n.i||!xt("ES5").K(n)))return n.t;n.I=!0,r=Wt(e,o),n.I=!1}else r=Wt(e,o);return mt(r,(function(e,o){n&&function(t,e){return 2===gt(t)?t.get(e):t[e]}(n.t,e)===o||wt(r,e,t(o))})),3===o?new Set(r):r}(t)}function Wt(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return _t(t)}var Bt,Ht,Xt="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Qt="undefined"!=typeof Map,Yt="undefined"!=typeof Set,Zt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,te=Xt?Symbol.for("immer-nothing"):((Bt={})["immer-nothing"]=!0,Bt),ee=Xt?Symbol.for("immer-draftable"):"__$immer_draftable",re=Xt?Symbol.for("immer-state"):"__$immer_state",ne=""+Object.prototype.constructor,oe="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,ie=Object.getOwnPropertyDescriptors||function(t){var e={};return oe(t).forEach((function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)})),e},ue={},se={get:function(t,e){if(e===re)return t;var r=Et(t);if(!Ot(r,e))return function(t,e,r){var n,o=zt(e,r);return o?"value"in o?o.value:null===(n=o.get)||void 0===n?void 0:n.call(t.k):void 0}(t,r,e);var n=r[e];return t.I||!bt(n)?n:n===qt(t.t,e)?(Gt(t),t.o[e]=Jt(t.A.h,n,t)):n},has:function(t,e){return e in Et(t)},ownKeys:function(t){return Reflect.ownKeys(Et(t))},set:function(t,e,r){var n=zt(Et(t),e);if(null==n?void 0:n.set)return n.set.call(t.k,r),!0;if(!t.P){var o=qt(Et(t),e),i=null==o?void 0:o[re];if(i&&i.t===r)return t.o[e]=r,t.D[e]=!1,!0;if(St(r,o)&&(void 0!==r||Ot(t.t,e)))return!0;Gt(t),Vt(t)}return t.o[e]===r&&"number"!=typeof r&&(void 0!==r||e in t.o)||(t.o[e]=r,t.D[e]=!0,!0)},deleteProperty:function(t,e){return void 0!==qt(t.t,e)||e in t.t?(t.D[e]=!1,Gt(t),Vt(t)):delete t.D[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=Et(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:n.enumerable,value:r[e]}:n},defineProperty:function(){yt(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){yt(12)}},ae={};mt(se,(function(t,e){ae[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),ae.deleteProperty=function(t,e){return ae.set.call(this,t,e,void 0)},ae.set=function(t,e,r){return se.set.call(this,t[0],e,r,t[0])};var ce=function(){function t(t){var e=this;this.g=Zt,this.F=!0,this.produce=function(t,r,n){if("function"==typeof t&&"function"!=typeof r){var o=r;r=t;var i=e;return function(t){var e=this;void 0===t&&(t=o);for(var n=arguments.length,u=Array(n>1?n-1:0),s=1;n>s;s++)u[s-1]=arguments[s];return i.produce(t,(function(t){var n;return(n=r).call.apply(n,[e,t].concat(u))}))}}var u;if("function"!=typeof r&&yt(6),void 0!==n&&"function"!=typeof n&&yt(7),bt(t)){var s=$t(e),a=Jt(e,t,void 0),c=!0;try{u=r(a),c=!1}finally{c?Tt(s):Dt(s)}return"undefined"!=typeof Promise&&u instanceof Promise?u.then((function(t){return It(s,n),Lt(t,s)}),(function(t){throw Tt(s),t})):(It(s,n),Lt(u,s))}if(!t||"object"!=typeof t){if(void 0===(u=r(t))&&(u=t),u===te&&(u=void 0),e.F&&Ct(u,!0),n){var l=[],f=[];xt("Patches").M(t,u,l,f),n(l,f)}return u}yt(21,t)},this.produceWithPatches=function(t,r){if("function"==typeof t)return function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;n>i;i++)o[i-1]=arguments[i];return e.produceWithPatches(r,(function(e){return t.apply(void 0,[e].concat(o))}))};var n,o,i=e.produce(t,r,(function(t,e){n=t,o=e}));return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(t){return[t,n,o]})):[i,n,o]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){bt(t)||yt(8),vt(t)&&(t=Kt(t));var e=$t(this),r=Jt(this,t,void 0);return r[re].C=!0,Dt(e),r},e.finishDraft=function(t,e){var r=(t&&t[re]).A;return It(r,e),Lt(void 0,r)},e.setAutoFreeze=function(t){this.F=t},e.setUseProxies=function(t){t&&!Zt&&yt(20),this.g=t},e.applyPatches=function(t,e){var r;for(r=e.length-1;r>=0;r--){var n=e[r];if(0===n.path.length&&"replace"===n.op){t=n.value;break}}r>-1&&(e=e.slice(r+1));var o=xt("Patches").$;return vt(t)?o(t,e):this.produce(t,(function(t){return o(t,e)}))},t}(),le=new ce;function fe(t){return function(e){var r=e.dispatch,n=e.getState;return function(e){return function(o){return"function"==typeof o?o(r,n,t):e(o)}}}}le.produceWithPatches.bind(le),le.setAutoFreeze.bind(le),le.setUseProxies.bind(le),le.applyPatches.bind(le),le.createDraft.bind(le),le.finishDraft.bind(le);var pe=fe();pe.withExtraArgument=fe;var de,he=pe,ye=(de=function(t,e){return de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},de(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}de(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ve=function(t,e){for(var r=0,n=e.length,o=t.length;n>r;r++,o++)t[o]=e[r];return t},be=Object.defineProperty,me=Object.getOwnPropertySymbols,ge=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,we=function(t,e,r){return e in t?be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},Se="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?ut:ut.apply(null,arguments)};var Pe=function(t){function e(){for(var r=[],n=0;arguments.length>n;n++)r[n]=arguments[n];var o=t.apply(this,r)||this;return Object.setPrototypeOf(o,e.prototype),o}return ye(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],r=0;arguments.length>r;r++)e[r]=arguments[r];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],r=0;arguments.length>r;r++)t[r]=arguments[r];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,ve([void 0],t[0].concat(this)))):new(e.bind.apply(e,ve([void 0],t.concat(this))))},e}(Array);function je(){return function(t){return function(t){void 0===t&&(t={});var e=t.thunk,r=void 0===e||e;var n=new Pe;r&&(!function(t){return"boolean"==typeof t}(r)?n.push(he.withExtraArgument(r.extraArgument)):n.push(he));return n}(t)}}!function(){function t(t,e){var r=o[t];return r?r.enumerable=e:o[t]=r={configurable:!0,enumerable:e,get:function(){return se.get(this[re],t)},set:function(e){se.set(this[re],t,e)}},r}function e(t){for(var e=t.length-1;e>=0;e--){var o=t[e][re];if(!o.P)switch(o.i){case 5:n(o)&&Vt(o);break;case 4:r(o)&&Vt(o)}}}function r(t){for(var e=t.t,r=t.k,n=oe(r),o=n.length-1;o>=0;o--){var i=n[o];if(i!==re){var u=e[i];if(void 0===u&&!Ot(e,i))return!0;var s=r[i],a=s&&s[re];if(a?a.t!==u:!St(s,u))return!0}}var c=!!e[re];return n.length!==oe(e).length+(c?0:1)}function n(t){var e=t.k;if(e.length!==t.t.length)return!0;var r=Object.getOwnPropertyDescriptor(e,e.length-1);if(r&&!r.get)return!0;for(var n=0;e.length>n;n++)if(!e.hasOwnProperty(n))return!0;return!1}var o={};!function(t,e){ue[t]||(ue[t]=e)}("ES5",{J:function(e,r){var n=Array.isArray(e),o=function(e,r){if(e){for(var n=Array(r.length),o=0;r.length>o;o++)Object.defineProperty(n,""+o,t(o,!0));return n}var i=ie(r);delete i[re];for(var u=oe(i),s=0;u.length>s;s++){var a=u[s];i[a]=t(a,e||!!i[a].enumerable)}return Object.create(Object.getPrototypeOf(r),i)}(n,e),i={i:n?5:4,A:r?r.A:At(),P:!1,I:!1,D:{},l:r,t:e,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,re,{value:i,writable:!0}),o},S:function(t,r,o){o?vt(r)&&r[re].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var r=e[re];if(r){var o=r.t,i=r.k,u=r.D,s=r.i;if(4===s)mt(i,(function(e){e!==re&&(void 0!==o[e]||Ot(o,e)?u[e]||t(i[e]):(u[e]=!0,Vt(r)))})),mt(o,(function(t){void 0!==i[t]||Ot(i,t)||(u[t]=!1,Vt(r))}));else if(5===s){if(n(r)&&(Vt(r),u.length=!0),o.length>i.length)for(var a=i.length;o.length>a;a++)u[a]=!1;else for(var c=o.length;i.length>c;c++)u[c]=!0;for(var l=Math.min(i.length,o.length),f=0;l>f;f++)i.hasOwnProperty(f)||(u[f]=!0),void 0===u[f]&&t(i[f])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?r(t):n(t)}})}();var Ee="persist:",_e="persist/FLUSH",Ce="persist/REHYDRATE",Re="persist/PAUSE",ke="persist/PERSIST",xe="persist/PURGE",Ae="persist/REGISTER";function Ie(t){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ie(t)}function Te(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function De(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $e(t,e,r,n){var o=function(t){for(var e=1;arguments.length>e;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Te(r,!0).forEach((function(e){De(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Te(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},r);return t&&"object"===Ie(t)&&Object.keys(t).forEach((function(n){"_persist"!==n&&e[n]===r[n]&&(o[n]=t[n])})),o}function Ne(t){var e,r=t.blacklist||null,n=t.whitelist||null,o=t.transforms||[],i=t.throttle||0,u="".concat(void 0!==t.keyPrefix?t.keyPrefix:Ee).concat(t.key),s=t.storage;e=!1===t.serialize?function(t){return t}:"function"==typeof t.serialize?t.serialize:Le;var a=t.writeFailHandler||null,c={},l={},f=[],p=null,d=null;function h(){if(0===f.length)return p&&clearInterval(p),void(p=null);var t=f.shift(),r=o.reduce((function(e,r){return r.in(e,t,c)}),c[t]);if(void 0!==r)try{l[t]=e(r)}catch(t){console.error("redux-persist/createPersistoid: error serializing state",t)}else delete l[t];0===f.length&&(Object.keys(l).forEach((function(t){void 0===c[t]&&delete l[t]})),d=s.setItem(u,e(l)).catch(v))}function y(t){return(!n||-1!==n.indexOf(t)||"_persist"===t)&&(!r||-1===r.indexOf(t))}function v(t){a&&a(t)}return{update:function(t){Object.keys(t).forEach((function(e){y(e)&&c[e]!==t[e]&&-1===f.indexOf(e)&&f.push(e)})),Object.keys(c).forEach((function(e){void 0===t[e]&&y(e)&&-1===f.indexOf(e)&&void 0!==c[e]&&f.push(e)})),null===p&&(p=setInterval(h,i)),c=t},flush:function(){for(;0!==f.length;)h();return d||Promise.resolve()}}}function Le(t){return JSON.stringify(t)}function Ue(t){var e,r=t.transforms||[],n="".concat(void 0!==t.keyPrefix?t.keyPrefix:Ee).concat(t.key);return e=!1===t.deserialize?function(t){return t}:"function"==typeof t.deserialize?t.deserialize:Me,t.storage.getItem(n).then((function(t){if(t)try{var n={},o=e(t);return Object.keys(o).forEach((function(t){n[t]=r.reduceRight((function(e,r){return r.out(e,t,o)}),e(o[t]))})),n}catch(t){throw t}}))}function Me(t){return JSON.parse(t)}function Fe(t){0}function qe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ze(t){for(var e=1;arguments.length>e;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qe(r,!0).forEach((function(e){Ve(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qe(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ve(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ge(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;i.length>n;n++)0>e.indexOf(r=i[n])&&(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;i.length>n;n++)0>e.indexOf(r=i[n])&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Je(t){return function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);t.length>e;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Ke(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function We(t){for(var e=1;arguments.length>e;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ke(r,!0).forEach((function(e){Be(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ke(r).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Be(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var He={registry:[],bootstrapped:!1},Xe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:He,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ae:return We({},t,{registry:[].concat(Je(t.registry),[e.key])});case Ce:var r=t.registry.indexOf(e.key),n=Je(t.registry);return n.splice(r,1),We({},t,{registry:n,bootstrapped:0===n.length});default:return t}};var Qe="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},Ye=U.useState,Ze=U.useEffect,tr=U.useLayoutEffect,er=U.useDebugValue;function rr(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Qe(t,r)}catch(t){return!0}}var nr="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var r=e(),n=Ye({inst:{value:r,getSnapshot:e}}),o=n[0].inst,i=n[1];return tr((function(){o.value=r,o.getSnapshot=e,rr(o)&&i({inst:o})}),[t,r,e]),Ze((function(){return rr(o)&&i({inst:o}),t((function(){rr(o)&&i({inst:o})}))}),[t]),er(r),r},or={useSyncExternalStore:void 0!==U.useSyncExternalStore?U.useSyncExternalStore:nr},ir=n((function(t){t.exports=or}));var ur="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},sr=ir.useSyncExternalStore,ar=U.useRef,cr=U.useEffect,lr=U.useMemo,fr=U.useDebugValue,pr={useSyncExternalStoreWithSelector:function(t,e,r,n,o){var i=ar(null);if(null===i.current){var u={hasValue:!1,value:null};i.current=u}else u=i.current;i=lr((function(){function t(t){if(!a){if(a=!0,i=t,t=n(t),void 0!==o&&u.hasValue){var e=u.value;if(o(e,t))return s=e}return s=t}if(e=s,ur(i,t))return e;var r=n(t);return void 0!==o&&o(e,r)?e:(i=t,s=r)}var i,s,a=!1,c=void 0===r?null:r;return[function(){return t(e())},null===c?void 0:function(){return t(c())}]}),[e,r,n,o]);var s=sr(t,i[0],i[1]);return cr((function(){u.hasValue=!0,u.value=s}),[s]),fr(s),s}},dr=n((function(t){t.exports=pr}));let hr=function(t){t()};const yr=()=>hr,vr=U.createContext(null);function br(){return U.useContext(vr)}let mr=()=>{throw Error("uSES not initialized!")};const gr=(t,e)=>t===e;function Or(t=vr){const e=t===vr?br:()=>U.useContext(t);return function(t,r=gr){const{store:n,subscription:o,getServerState:i}=e(),u=mr(o.addNestedSub,n.getState,i||n.getState,t,r);return U.useDebugValue(u),u}}const wr=Or();
11
+ /** @license React v16.13.1
12
+ * react-is.production.min.js
13
+ *
14
+ * Copyright (c) Facebook, Inc. and its affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var Sr="function"==typeof Symbol&&Symbol.for,Pr=Sr?Symbol.for("react.element"):60103,jr=Sr?Symbol.for("react.portal"):60106,Er=Sr?Symbol.for("react.fragment"):60107,_r=Sr?Symbol.for("react.strict_mode"):60108,Cr=Sr?Symbol.for("react.profiler"):60114,Rr=Sr?Symbol.for("react.provider"):60109,kr=Sr?Symbol.for("react.context"):60110,xr=Sr?Symbol.for("react.async_mode"):60111,Ar=Sr?Symbol.for("react.concurrent_mode"):60111,Ir=Sr?Symbol.for("react.forward_ref"):60112,Tr=Sr?Symbol.for("react.suspense"):60113,Dr=Sr?Symbol.for("react.suspense_list"):60120,$r=Sr?Symbol.for("react.memo"):60115,Nr=Sr?Symbol.for("react.lazy"):60116,Lr=Sr?Symbol.for("react.block"):60121,Ur=Sr?Symbol.for("react.fundamental"):60117,Mr=Sr?Symbol.for("react.responder"):60118,Fr=Sr?Symbol.for("react.scope"):60119;function qr(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case Pr:switch(t=t.type){case xr:case Ar:case Er:case Cr:case _r:case Tr:return t;default:switch(t=t&&t.$$typeof){case kr:case Ir:case Nr:case $r:case Rr:return t;default:return e}}case jr:return e}}}function zr(t){return qr(t)===Ar}var Vr={AsyncMode:xr,ConcurrentMode:Ar,ContextConsumer:kr,ContextProvider:Rr,Element:Pr,ForwardRef:Ir,Fragment:Er,Lazy:Nr,Memo:$r,Portal:jr,Profiler:Cr,StrictMode:_r,Suspense:Tr,isAsyncMode:function(t){return zr(t)||qr(t)===xr},isConcurrentMode:zr,isContextConsumer:function(t){return qr(t)===kr},isContextProvider:function(t){return qr(t)===Rr},isElement:function(t){return"object"==typeof t&&null!==t&&t.$$typeof===Pr},isForwardRef:function(t){return qr(t)===Ir},isFragment:function(t){return qr(t)===Er},isLazy:function(t){return qr(t)===Nr},isMemo:function(t){return qr(t)===$r},isPortal:function(t){return qr(t)===jr},isProfiler:function(t){return qr(t)===Cr},isStrictMode:function(t){return qr(t)===_r},isSuspense:function(t){return qr(t)===Tr},isValidElementType:function(t){return"string"==typeof t||"function"==typeof t||t===Er||t===Ar||t===Cr||t===_r||t===Tr||t===Dr||"object"==typeof t&&null!==t&&(t.$$typeof===Nr||t.$$typeof===$r||t.$$typeof===Rr||t.$$typeof===kr||t.$$typeof===Ir||t.$$typeof===Ur||t.$$typeof===Mr||t.$$typeof===Fr||t.$$typeof===Lr)},typeOf:qr},Gr=n((function(t){t.exports=Vr})),Jr={};Jr[Gr.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Jr[Gr.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};
19
+ /**
20
+ * @license React
21
+ * react-is.production.min.js
22
+ *
23
+ * Copyright (c) Facebook, Inc. and its affiliates.
24
+ *
25
+ * This source code is licensed under the MIT license found in the
26
+ * LICENSE file in the root directory of this source tree.
27
+ */
28
+ var Kr,Wr=Symbol.for("react.element"),Br=Symbol.for("react.portal"),Hr=Symbol.for("react.fragment"),Xr=Symbol.for("react.strict_mode"),Qr=Symbol.for("react.profiler"),Yr=Symbol.for("react.provider"),Zr=Symbol.for("react.context"),tn=Symbol.for("react.server_context"),en=Symbol.for("react.forward_ref"),rn=Symbol.for("react.suspense"),nn=Symbol.for("react.suspense_list"),on=Symbol.for("react.memo"),un=Symbol.for("react.lazy"),sn=Symbol.for("react.offscreen");function an(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case Wr:switch(t=t.type){case Hr:case Qr:case Xr:case rn:case nn:return t;default:switch(t=t&&t.$$typeof){case tn:case Zr:case en:case un:case on:case Yr:return t;default:return e}}case Br:return e}}}Kr=Symbol.for("react.module.reference");var cn={ContextConsumer:Zr,ContextProvider:Yr,Element:Wr,ForwardRef:en,Fragment:Hr,Lazy:un,Memo:on,Portal:Br,Profiler:Qr,StrictMode:Xr,Suspense:rn,SuspenseList:nn,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(t){return an(t)===Zr},isContextProvider:function(t){return an(t)===Yr},isElement:function(t){return"object"==typeof t&&null!==t&&t.$$typeof===Wr},isForwardRef:function(t){return an(t)===en},isFragment:function(t){return an(t)===Hr},isLazy:function(t){return an(t)===un},isMemo:function(t){return an(t)===on},isPortal:function(t){return an(t)===Br},isProfiler:function(t){return an(t)===Qr},isStrictMode:function(t){return an(t)===Xr},isSuspense:function(t){return an(t)===rn},isSuspenseList:function(t){return an(t)===nn},isValidElementType:function(t){return"string"==typeof t||"function"==typeof t||t===Hr||t===Qr||t===Xr||t===rn||t===nn||t===sn||"object"==typeof t&&null!==t&&(t.$$typeof===un||t.$$typeof===on||t.$$typeof===Yr||t.$$typeof===Zr||t.$$typeof===en||t.$$typeof===Kr||void 0!==t.getModuleId)},typeOf:an};n((function(t){t.exports=cn}));const ln={notify(){},get:()=>[]};function fn(t,e){let r,n=ln;function o(){u.onStateChange&&u.onStateChange()}function i(){r||(r=e?e.addNestedSub(o):t.subscribe(o),n=function(){const t=yr();let e=null,r=null;return{clear(){e=null,r=null},notify(){t((()=>{let t=e;for(;t;)t.callback(),t=t.next}))},get(){let t=[],r=e;for(;r;)t.push(r),r=r.next;return t},subscribe(t){let n=!0,o=r={callback:t,next:null,prev:r};return o.prev?o.prev.next=o:e=o,function(){n&&null!==e&&(n=!1,o.next?o.next.prev=o.prev:r=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}const u={addNestedSub:function(t){return i(),n.subscribe(t)},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:o,isSubscribed:function(){return!!r},trySubscribe:i,tryUnsubscribe:function(){r&&(r(),r=void 0,n.clear(),n=ln)},getListeners:()=>n};return u}const pn=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?U.useLayoutEffect:U.useEffect;function dn({store:t,context:e,children:r,serverState:n}){const o=U.useMemo((()=>{const e=fn(t);return{store:t,subscription:e,getServerState:n?()=>n:void 0}}),[t,n]),i=U.useMemo((()=>t.getState()),[t]);pn((()=>{const{subscription:e}=o;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),i!==t.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}}),[o,i]);return U.createElement((e||vr).Provider,{value:o},r)}mr=dr.useSyncExternalStoreWithSelector,hr=e.unstable_batchedUpdates;var hn=t=>{if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype};const{hasOwnProperty:yn}=Object.prototype,{propertyIsEnumerable:vn}=Object,bn=(t,e,r)=>Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0}),mn=r,gn={concatArrays:!1,ignoreUndefined:!1},On=t=>{const e=[];for(const r in t)yn.call(t,r)&&e.push(r);if(Object.getOwnPropertySymbols){const r=Object.getOwnPropertySymbols(t);for(const n of r)vn.call(t,n)&&e.push(n)}return e};function wn(t){return Array.isArray(t)?function(t){const e=t.slice(0,0);return On(t).forEach((r=>{bn(e,r,wn(t[r]))})),e}(t):hn(t)?function(t){const e=null===Object.getPrototypeOf(t)?Object.create(null):{};return On(t).forEach((r=>{bn(e,r,wn(t[r]))})),e}(t):t}const Sn=(t,e,r,n)=>(r.forEach((r=>{void 0===e[r]&&n.ignoreUndefined||bn(t,r,r in t&&t[r]!==Object.getPrototypeOf(t)?Pn(t[r],e[r],n):wn(e[r]))})),t);function Pn(t,e,r){return r.concatArrays&&Array.isArray(t)&&Array.isArray(e)?((t,e,r)=>{let n=t.slice(0,0),o=0;return[t,e].forEach((e=>{const i=[];for(let r=0;e.length>r;r++)yn.call(e,r)&&(i.push(r+""),bn(n,o++,e===t?e[r]:wn(e[r])));n=Sn(n,e,On(e).filter((t=>!i.includes(t))),r)})),n})(t,e,r):hn(e)&&hn(t)?Sn(t,e,On(e),r):wn(e)}const jn=function(...t){const e=Pn(wn(gn),this!==mn&&this||{},gn);let r={_:{}};for(const n of t)if(void 0!==n){if(!hn(n))throw new TypeError("`"+n+"` is not an Option Object");r=Pn(r,{_:n},e)}return r._}.bind({concatArrays:!0,ignoreUndefined:!0});function En(t,e){return new Promise(((r,n)=>{try{const n=t();null==e||e(null,n),r(n)}catch(t){null==e||e(t),n(t)}}))}function _n(t,e,r){return Promise.all(t).then((t=>{var n;const o=null!==(n=null==r?void 0:r(t))&&void 0!==n?n:null;return null==e||e(null,o),Promise.resolve(o)}),(t=>(null==e||e(t),Promise.reject(t))))}const Cn={getItem:(t,e)=>En((()=>window.localStorage.getItem(t)),e),setItem:(t,e,r)=>En((()=>window.localStorage.setItem(t,e)),r),removeItem:(t,e)=>En((()=>window.localStorage.removeItem(t)),e),mergeItem:(t,e,r)=>En((()=>function(t,e){const r=window.localStorage.getItem(t);if(r){const n=JSON.parse(r),o=JSON.parse(e),i=JSON.stringify(jn(n,o));window.localStorage.setItem(t,i)}else window.localStorage.setItem(t,e)}(t,e)),r),clear:t=>En((()=>window.localStorage.clear()),t),getAllKeys:t=>En((()=>{const t=window.localStorage.length,e=[];for(let r=0;t>r;r+=1){const t=window.localStorage.key(r)||"";e.push(t)}return e}),t),flushGetRequests:()=>{},multiGet:(t,e)=>_n(t.map((t=>Cn.getItem(t))),e,(e=>e.map(((e,r)=>[t[r],e])))),multiSet:(t,e)=>_n(t.map((t=>Cn.setItem(t[0],t[1]))),e),multiRemove:(t,e)=>_n(t.map((t=>Cn.removeItem(t))),e),multiMerge:(t,e)=>_n(t.map((t=>Cn.mergeItem(t[0],t[1]))),e)},Rn={key:"root",storage:{getItem:async(t,...e)=>"undefined"!=typeof document?localStorage.getItem(t):"undefined"!=typeof navigator&&"ReactNative"===navigator.product?await Cn.getItem(t):void 0,setItem:async(t,e,...r)=>"undefined"!=typeof document?localStorage.setItem(t,e):"undefined"!=typeof navigator&&"ReactNative"===navigator.product?await Cn.setItem(t,e):void 0,removeItem:async(t,...e)=>"undefined"!=typeof document?localStorage.removeItem(t):"undefined"!=typeof navigator&&"ReactNative"===navigator.product?await Cn.removeItem(t):void 0}},kn=it({reducer:function(t,e){var r=void 0!==t.version?t.version:-1,n=void 0===t.stateReconciler?$e:t.stateReconciler,o=t.getStoredState||Ue,i=void 0!==t.timeout?t.timeout:5e3,u=null,s=!1,a=!0,c=function(t){return t._persist.rehydrated&&u&&!a&&u.update(t),t};return function(l,f){var p=l||{},d=p._persist,h=Ge(p,["_persist"]);if(f.type===ke){var y=!1,v=function(e,r){y||(f.rehydrate(t.key,e,r),y=!0)};if(i&&setTimeout((function(){!y&&v(void 0,Error('redux-persist: persist timed out for persist key "'.concat(t.key,'"')))}),i),a=!1,u||(u=Ne(t)),d)return ze({},e(h,f),{_persist:d});if("function"!=typeof f.rehydrate||"function"!=typeof f.register)throw Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return f.register(t.key),o(t).then((function(e){var n=t.migrate||function(t,e){return Promise.resolve(t)};n(e,r).then((function(t){v(t)}),(function(t){v(void 0,t)}))}),(function(t){v(void 0,t)})),ze({},e(h,f),{_persist:{version:r,rehydrated:!1}})}if(f.type===xe)return s=!0,f.result(function(t){var e=t.storage,r="".concat(void 0!==t.keyPrefix?t.keyPrefix:Ee).concat(t.key);return e.removeItem(r,Fe)}(t)),ze({},e(h,f),{_persist:d});if(f.type===_e)return f.result(u&&u.flush()),ze({},e(h,f),{_persist:d});if(f.type===Re)a=!0;else if(f.type===Ce){if(s)return ze({},h,{_persist:ze({},d,{rehydrated:!0})});if(f.key===t.key){var b=e(h,f),m=f.payload,g=ze({},!1!==n&&void 0!==m?n(m,l,b,t):b,{_persist:ze({},d,{rehydrated:!0})});return c(g)}}if(!d)return e(l,f);var O=e(h,f);return O===h?l:c(ze({},O,{_persist:d}))}}(Rn,ht)}),xn=function(t){var e,r=je(),n=t||{},o=n.reducer,i=void 0===o?void 0:o,u=n.middleware,s=void 0===u?r():u,a=n.devTools,c=void 0===a||a,l=n.preloadedState,f=void 0===l?void 0:l,p=n.enhancers,d=void 0===p?void 0:p;if("function"==typeof i)e=i;else{if(!function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var r=e;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return e===r}(i))throw Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=it(i)}var h=s;"function"==typeof h&&(h=h(r));var y=st.apply(void 0,h),v=ut;c&&(v=Se(function(t,e){for(var r in e||(e={}))ge.call(e,r)&&we(t,r,e[r]);if(me)for(var n=0,o=me(e);o.length>n;n++)Oe.call(e,r=o[n])&&we(t,r,e[r]);return t}({trace:!1},"object"==typeof c&&c)));var b=[y];return Array.isArray(d)?b=ve([y],d):"function"==typeof d&&(b=d(b)),ot(e,f,v.apply(void 0,b))}({reducer:kn,middleware:[he]}),An=xn.dispatch,In=wr,Tn=function(t,e,r){var n=r||!1,o=ot(Xe,He,e&&e.enhancer?e.enhancer:void 0),i=function(t){o.dispatch({type:Ae,key:t})},u=function(e,r,i){var u={type:Ce,payload:r,err:i,key:e};t.dispatch(u),o.dispatch(u),n&&s.getState().bootstrapped&&(n(),n=!1)},s=We({},o,{purge:function(){var e=[];return t.dispatch({type:xe,result:function(t){e.push(t)}}),Promise.all(e)},flush:function(){var e=[];return t.dispatch({type:_e,result:function(t){e.push(t)}}),Promise.all(e)},pause:function(){t.dispatch({type:Re})},persist:function(){t.dispatch({type:ke,register:i,rehydrate:u})}});return e&&e.manualPersist||s.persist(),s}(xn),Dn=()=>U.useContext(Ln),$n=U.createContext(null),Nn=t=>{const e=Dn(),r=An,[n,o]=U.useState(t.collections||[]),i={subscribe:async t=>{await(null==e?void 0:e.realtime.subscribe(t,(e=>{switch(e.action){case"create":r(K(t,e.record));break;case"update":r(B(t,e.record));break;case"delete":r(W(t,e.record))}})))},unsubscribe:t=>{t?null==e||e.realtime.unsubscribe(t):null==e||e.realtime.unsubscribe()},fetch:async t=>{const n=await(null==e?void 0:e.records.getFullList(t,200));r(J(t,n))},create:async(t,r)=>{await(null==e?void 0:e.records.create(t,r))},update:async(t,r,n)=>{await(null==e?void 0:e.records.update(t,r,n))},delete:async(t,r)=>{await(null==e?void 0:e.records.delete(t,r))}};return U.useEffect((()=>(n&&n.forEach((t=>{i.fetch(t),i.subscribe(t)})),()=>i.unsubscribe())),[n]),U.createElement($n.Provider,{value:i},t.children)},Ln=U.createContext(null),Un=t=>U.createElement(Ln.Provider,{value:t.client},t.children);var Mn=function(t,e){return Mn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},Mn(t,e)};function Fn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}Mn(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var qn=function(){return qn=Object.assign||function(t){for(var e,r=1,n=arguments.length;n>r;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},qn.apply(this,arguments)};function zn(t,e,r,n){return new(r||(r=Promise))((function(o,i){function u(t){try{a(n.next(t))}catch(t){i(t)}}function s(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,s)}a((n=n.apply(t,e||[])).next())}))}function Vn(t,e){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&o[3]>i[1])){u.label=i[1];break}if(6===i[0]&&o[1]>u.label){u.label=o[1],o=i;break}if(o&&o[2]>u.label){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var Gn,Jn=function(t){function e(r){var n,o=this;return(o=t.call(this,"ClientResponseError")||this).url="",o.status=0,o.data={},o.isAbort=!1,o.originalError=null,Object.setPrototypeOf(o,e.prototype),r instanceof e||(o.originalError=r),null!==r&&"object"==typeof r&&(o.url="string"==typeof r.url?r.url:"",o.status="number"==typeof r.status?r.status:0,o.data=null!==r.data&&"object"==typeof r.data?r.data:{}),"undefined"!=typeof DOMException&&r instanceof DOMException&&(o.isAbort=!0),o.name="ClientResponseError "+o.status,o.message=(null===(n=o.data)||void 0===n?void 0:n.message)||"Something went wrong while processing your request.",o}return Fn(e,t),e.prototype.toJSON=function(){return qn({},this)},e}(Error),Kn=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Wn(t,e,r){var n=Object.assign({},r||{}),o=n.encode||Hn;if(!Kn.test(t))throw new TypeError("argument name is invalid");var i=o(e);if(i&&!Kn.test(i))throw new TypeError("argument val is invalid");var u=t+"="+i;if(null!=n.maxAge){var s=n.maxAge-0;if(isNaN(s)||!isFinite(s))throw new TypeError("option maxAge is invalid");u+="; Max-Age="+Math.floor(s)}if(n.domain){if(!Kn.test(n.domain))throw new TypeError("option domain is invalid");u+="; Domain="+n.domain}if(n.path){if(!Kn.test(n.path))throw new TypeError("option path is invalid");u+="; Path="+n.path}if(n.expires){if(!function(t){return"[object Date]"===Object.prototype.toString.call(t)||t instanceof Date}(n.expires)||isNaN(n.expires.valueOf()))throw new TypeError("option expires is invalid");u+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(u+="; HttpOnly"),n.secure&&(u+="; Secure"),n.priority)switch("string"==typeof n.priority?n.priority.toLowerCase():n.priority){case"low":u+="; Priority=Low";break;case"medium":u+="; Priority=Medium";break;case"high":u+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;case"none":u+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return u}function Bn(t){return-1!==t.indexOf("%")?decodeURIComponent(t):t}function Hn(t){return encodeURIComponent(t)}function Xn(t){if(t)try{var e=decodeURIComponent(Gn(t.split(".")[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(e)||{}}catch(t){}return{}}Gn="function"==typeof atob?atob:function(t){return Buffer.from(t,"base64").toString("binary")};var Qn=function(){function t(t){void 0===t&&(t={}),this.load(t||{})}return t.prototype.load=function(t){this.id=void 0!==t.id?t.id:"",this.created=void 0!==t.created?t.created:"",this.updated=void 0!==t.updated?t.updated:""},Object.defineProperty(t.prototype,"isNew",{get:function(){return!this.id||"00000000-0000-0000-0000-000000000000"===this.id},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new this.constructor(JSON.parse(JSON.stringify(this)))},t.prototype.export=function(){return Object.assign({},this)},t}(),Yn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e);for(var r=0,n=Object.entries(e);n.length>r;r++){var o=n[r];this[o[0]]=o[1]}this["@collectionId"]=void 0!==e["@collectionId"]?e["@collectionId"]:"",this["@collectionName"]=void 0!==e["@collectionName"]?e["@collectionName"]:"",this["@expand"]=void 0!==e["@expand"]?e["@expand"]:{}},e}(Qn),Zn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e),this.email="string"==typeof e.email?e.email:"",this.verified=!!e.verified,this.lastResetSentAt="string"==typeof e.lastResetSentAt?e.lastResetSentAt:"",this.lastVerificationSentAt="string"==typeof e.lastVerificationSentAt?e.lastVerificationSentAt:"",this.profile=e.profile?new Yn(e.profile):null},e}(Qn),to=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e),this.avatar="number"==typeof e.avatar?e.avatar:0,this.email="string"==typeof e.email?e.email:"",this.lastResetSentAt="string"==typeof e.lastResetSentAt?e.lastResetSentAt:""},e}(Qn),eo=function(){function t(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}return Object.defineProperty(t.prototype,"token",{get:function(){return this.baseToken},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.baseModel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isValid",{get:function(){return!function(t,e){void 0===e&&(e=0);var r=Xn(t);return!(Object.keys(r).length>0&&(!r.exp||r.exp-e>Date.now()/1e3))}(this.token)},enumerable:!1,configurable:!0}),t.prototype.save=function(t,e){this.baseToken=t||"",this.baseModel=null!==e&&"object"==typeof e?"undefined"!==(null==e?void 0:e.verified)?new Zn(e):new to(e):null,this.triggerChange()},t.prototype.clear=function(){this.baseToken="",this.baseModel=null,this.triggerChange()},t.prototype.loadFromCookie=function(t,e){void 0===e&&(e="pb_auth");var r=function(t,e){var r={};if("string"!=typeof t)return r;for(var n=Object.assign({},{}).decode||Bn,o=0;t.length>o;){var i=t.indexOf("=",o);if(-1===i)break;var u=t.indexOf(";",o);if(-1===u)u=t.length;else if(i>u){o=t.lastIndexOf(";",i-1)+1;continue}var s=t.slice(o,i).trim();if(void 0===r[s]){var a=t.slice(i+1,u).trim();34===a.charCodeAt(0)&&(a=a.slice(1,-1));try{r[s]=n(a)}catch(t){r[s]=a}}o=u+1}return r}(t||"")[e]||"",n={};try{(null===typeof(n=JSON.parse(r))||"object"!=typeof n||Array.isArray(n))&&(n={})}catch(t){}this.save(n.token||"",n.model||{})},t.prototype.exportToCookie=function(t,e){var r,n,o;void 0===e&&(e="pb_auth");var i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},u=Xn(this.token);i.expires=new Date((null==u?void 0:u.exp)?1e3*u.exp:"1970-01-01"),t=Object.assign({},i,t);var s={token:this.token,model:(null===(r=this.model)||void 0===r?void 0:r.export())||null},a=Wn(e,JSON.stringify(s),t),c="undefined"!=typeof Blob?new Blob([a]).size:a.length;return s.model&&c>4096&&(s.model={id:null===(n=null==s?void 0:s.model)||void 0===n?void 0:n.id,email:null===(o=null==s?void 0:s.model)||void 0===o?void 0:o.email},this.model instanceof Zn&&(s.model.verified=this.model.verified),a=Wn(e,JSON.stringify(s),t)),a},t.prototype.onChange=function(t){var e=this;return this._onChangeCallbacks.push(t),function(){for(var r=e._onChangeCallbacks.length-1;r>=0;r--)if(e._onChangeCallbacks[r]==t)return delete e._onChangeCallbacks[r],void e._onChangeCallbacks.splice(r,1)}},t.prototype.triggerChange=function(){for(var t=0,e=this._onChangeCallbacks;e.length>t;t++){var r=e[t];r&&r(this.token,this.model)}},t}(),ro=function(t){function e(e){void 0===e&&(e="pocketbase_auth");var r=t.call(this)||this;return r.storageFallback={},r.storageKey=e,r}return Fn(e,t),Object.defineProperty(e.prototype,"token",{get:function(){return(this._storageGet(this.storageKey)||{}).token||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){var t,e=this._storageGet(this.storageKey)||{};return null===e||"object"!=typeof e||null===e.model||"object"!=typeof e.model?null:void 0!==(null===(t=e.model)||void 0===t?void 0:t.verified)?new Zn(e.model):new to(e.model)},enumerable:!1,configurable:!0}),e.prototype.save=function(e,r){this._storageSet(this.storageKey,{token:e,model:r}),t.prototype.save.call(this,e,r)},e.prototype.clear=function(){this._storageRemove(this.storageKey),t.prototype.clear.call(this)},e.prototype._storageGet=function(t){var e;if("undefined"!=typeof window&&(null===window||void 0===window?void 0:window.localStorage)){var r=(null===(e=null===window||void 0===window?void 0:window.localStorage)||void 0===e?void 0:e.getItem(t))||"";try{return JSON.parse(r)}catch(t){return r}}return this.storageFallback[t]},e.prototype._storageSet=function(t,e){var r;if("undefined"!=typeof window&&(null===window||void 0===window?void 0:window.localStorage)){var n=e;"string"!=typeof e&&(n=JSON.stringify(e)),null===(r=null===window||void 0===window?void 0:window.localStorage)||void 0===r||r.setItem(t,n)}else this.storageFallback[t]=e},e.prototype._storageRemove=function(t){var e;"undefined"!=typeof window&&(null===(e=null===window||void 0===window?void 0:window.localStorage)||void 0===e||e.removeItem(t)),delete this.storageFallback[t]},e}(eo),no=function(t){this.client=t},oo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.getAll=function(t){return void 0===t&&(t={}),this.client.send("/api/settings",{method:"GET",params:t}).then((function(t){return t||{}}))},e.prototype.update=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.client.send("/api/settings",{method:"PATCH",params:e,body:t}).then((function(t){return t||{}}))},e.prototype.testS3=function(t){return void 0===t&&(t={}),this.client.send("/api/settings/test/s3",{method:"POST",params:t}).then((function(){return!0}))},e.prototype.testEmail=function(t,e,r){return void 0===r&&(r={}),this.client.send("/api/settings/test/email",{method:"POST",params:r,body:{email:t,template:e}}).then((function(){return!0}))},e}(no),io=function(t,e,r,n,o){this.page=t>0?t:1,this.perPage=0>e?0:e,this.totalItems=0>r?0:r,this.totalPages=0>n?0:n,this.items=o||[]},uo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype._getFullList=function(t,e,r){var n=this;void 0===e&&(e=100),void 0===r&&(r={});var o=[],i=function(u){return zn(n,void 0,void 0,(function(){return Vn(this,(function(n){return[2,this._getList(t,u,e,r).then((function(t){var e=t.items,r=t.totalItems;return o=o.concat(e),e.length&&r>o.length?i(u+1):o}))]}))}))};return i(1)},e.prototype._getList=function(t,e,r,n){var o=this;return void 0===e&&(e=1),void 0===r&&(r=30),void 0===n&&(n={}),n=Object.assign({page:e,perPage:r},n),this.client.send(t,{method:"GET",params:n}).then((function(t){var e=[];if(null==t?void 0:t.items){t.items=t.items||[];for(var r=0,n=t.items;n.length>r;r++){e.push(o.decode(n[r]))}}return new io((null==t?void 0:t.page)||1,(null==t?void 0:t.perPage)||0,(null==t?void 0:t.totalItems)||0,(null==t?void 0:t.totalPages)||0,e)}))},e.prototype._getOne=function(t,e,r){var n=this;return void 0===r&&(r={}),this.client.send(t+"/"+encodeURIComponent(e),{method:"GET",params:r}).then((function(t){return n.decode(t)}))},e.prototype._create=function(t,e,r){var n=this;return void 0===e&&(e={}),void 0===r&&(r={}),this.client.send(t,{method:"POST",params:r,body:e}).then((function(t){return n.decode(t)}))},e.prototype._update=function(t,e,r,n){var o=this;return void 0===r&&(r={}),void 0===n&&(n={}),this.client.send(t+"/"+encodeURIComponent(e),{method:"PATCH",params:n,body:r}).then((function(t){return o.decode(t)}))},e.prototype._delete=function(t,e,r){return void 0===r&&(r={}),this.client.send(t+"/"+encodeURIComponent(e),{method:"DELETE",params:r}).then((function(){return!0}))},e}(no),so=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.getFullList=function(t,e){return void 0===t&&(t=100),void 0===e&&(e={}),this._getFullList(this.baseCrudPath(),t,e)},e.prototype.getList=function(t,e,r){return void 0===t&&(t=1),void 0===e&&(e=30),void 0===r&&(r={}),this._getList(this.baseCrudPath(),t,e,r)},e.prototype.getOne=function(t,e){return void 0===e&&(e={}),this._getOne(this.baseCrudPath(),t,e)},e.prototype.create=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this._create(this.baseCrudPath(),t,e)},e.prototype.update=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),this._update(this.baseCrudPath(),t,e,r)},e.prototype.delete=function(t,e){return void 0===e&&(e={}),this._delete(this.baseCrudPath(),t,e)},e}(uo),ao=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.decode=function(t){return new to(t)},e.prototype.baseCrudPath=function(){return"/api/admins"},e.prototype.authResponse=function(t){var e=this.decode((null==t?void 0:t.admin)||{});return(null==t?void 0:t.token)&&(null==t?void 0:t.admin)&&this.client.authStore.save(t.token,e),Object.assign({},t,{token:(null==t?void 0:t.token)||"",admin:e})},e.prototype.authViaEmail=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),r=Object.assign({email:t,password:e},r),this.client.send(this.baseCrudPath()+"/auth-via-email",{method:"POST",params:n,body:r,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.refresh=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.client.send(this.baseCrudPath()+"/refresh",{method:"POST",params:e,body:t}).then(this.authResponse.bind(this))},e.prototype.requestPasswordReset=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),e=Object.assign({email:t},e),this.client.send(this.baseCrudPath()+"/request-password-reset",{method:"POST",params:r,body:e}).then((function(){return!0}))},e.prototype.confirmPasswordReset=function(t,e,r,n,o){return void 0===n&&(n={}),void 0===o&&(o={}),n=Object.assign({token:t,password:e,passwordConfirm:r},n),this.client.send(this.baseCrudPath()+"/confirm-password-reset",{method:"POST",params:o,body:n}).then(this.authResponse.bind(this))},e}(so),co=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e),this.userId="string"==typeof e.userId?e.userId:"",this.provider="string"==typeof e.provider?e.provider:"",this.providerId="string"==typeof e.providerId?e.providerId:""},e}(Qn),lo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.decode=function(t){return new Zn(t)},e.prototype.baseCrudPath=function(){return"/api/users"},e.prototype.authResponse=function(t){var e=this.decode((null==t?void 0:t.user)||{});return(null==t?void 0:t.token)&&(null==t?void 0:t.user)&&this.client.authStore.save(t.token,e),Object.assign({},t,{token:(null==t?void 0:t.token)||"",user:e})},e.prototype.listAuthMethods=function(t){return void 0===t&&(t={}),this.client.send(this.baseCrudPath()+"/auth-methods",{method:"GET",params:t}).then((function(t){return Object.assign({},t,{emailPassword:!!(null==t?void 0:t.emailPassword),authProviders:Array.isArray(null==t?void 0:t.authProviders)?null==t?void 0:t.authProviders:[]})}))},e.prototype.authViaEmail=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),r=Object.assign({email:t,password:e},r),this.client.send(this.baseCrudPath()+"/auth-via-email",{method:"POST",params:n,body:r,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.authViaOAuth2=function(t,e,r,n,o,i){return void 0===o&&(o={}),void 0===i&&(i={}),o=Object.assign({provider:t,code:e,codeVerifier:r,redirectUrl:n},o),this.client.send(this.baseCrudPath()+"/auth-via-oauth2",{method:"POST",params:i,body:o,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.refresh=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.client.send(this.baseCrudPath()+"/refresh",{method:"POST",params:e,body:t}).then(this.authResponse.bind(this))},e.prototype.requestPasswordReset=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),e=Object.assign({email:t},e),this.client.send(this.baseCrudPath()+"/request-password-reset",{method:"POST",params:r,body:e}).then((function(){return!0}))},e.prototype.confirmPasswordReset=function(t,e,r,n,o){return void 0===n&&(n={}),void 0===o&&(o={}),n=Object.assign({token:t,password:e,passwordConfirm:r},n),this.client.send(this.baseCrudPath()+"/confirm-password-reset",{method:"POST",params:o,body:n}).then(this.authResponse.bind(this))},e.prototype.requestVerification=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),e=Object.assign({email:t},e),this.client.send(this.baseCrudPath()+"/request-verification",{method:"POST",params:r,body:e}).then((function(){return!0}))},e.prototype.confirmVerification=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),e=Object.assign({token:t},e),this.client.send(this.baseCrudPath()+"/confirm-verification",{method:"POST",params:r,body:e}).then(this.authResponse.bind(this))},e.prototype.requestEmailChange=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),e=Object.assign({newEmail:t},e),this.client.send(this.baseCrudPath()+"/request-email-change",{method:"POST",params:r,body:e}).then((function(){return!0}))},e.prototype.confirmEmailChange=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),r=Object.assign({token:t,password:e},r),this.client.send(this.baseCrudPath()+"/confirm-email-change",{method:"POST",params:n,body:r}).then(this.authResponse.bind(this))},e.prototype.listExternalAuths=function(t,e){return void 0===e&&(e={}),this.client.send(this.baseCrudPath()+"/"+encodeURIComponent(t)+"/external-auths",{method:"GET",params:e}).then((function(t){var e=[];if(Array.isArray(t))for(var r=0,n=t;n.length>r;r++){e.push(new co(n[r]))}return e}))},e.prototype.unlinkExternalAuth=function(t,e,r){return void 0===r&&(r={}),this.client.send(this.baseCrudPath()+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(e),{method:"DELETE",params:r}).then((function(){return!0}))},e}(so),fo=function(){function t(t){void 0===t&&(t={}),this.load(t||{})}return t.prototype.load=function(t){this.id=void 0!==t.id?t.id:"",this.name=void 0!==t.name?t.name:"",this.type=void 0!==t.type?t.type:"text",this.system=!!t.system,this.required=!!t.required,this.unique=!!t.unique,this.options="object"==typeof t.options&&null!==t.options?t.options:{}},t}(),po=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e),this.name="string"==typeof e.name?e.name:"",this.system=!!e.system,this.listRule="string"==typeof e.listRule?e.listRule:null,this.viewRule="string"==typeof e.viewRule?e.viewRule:null,this.createRule="string"==typeof e.createRule?e.createRule:null,this.updateRule="string"==typeof e.updateRule?e.updateRule:null,this.deleteRule="string"==typeof e.deleteRule?e.deleteRule:null,e.schema=Array.isArray(e.schema)?e.schema:[],this.schema=[];for(var r=0,n=e.schema;n.length>r;r++){this.schema.push(new fo(n[r]))}},e}(Qn),ho=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.decode=function(t){return new po(t)},e.prototype.baseCrudPath=function(){return"/api/collections"},e.prototype.import=function(t,e,r){return void 0===e&&(e=!1),void 0===r&&(r={}),zn(this,void 0,void 0,(function(){return Vn(this,(function(n){return[2,this.client.send(this.baseCrudPath()+"/import",{method:"PUT",params:r,body:{collections:t,deleteMissing:e}}).then((function(){return!0}))]}))}))},e}(so),yo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.decode=function(t){return new Yn(t)},e.prototype.baseCrudPath=function(t){return"/api/collections/"+encodeURIComponent(t)+"/records"},e.prototype.getFileUrl=function(t,e,r){void 0===r&&(r={});var n=[];n.push(this.client.baseUrl.replace(/\/+$/gm,"")),n.push("api"),n.push("files"),n.push(t["@collectionId"]),n.push(t.id),n.push(e);var o=n.join("/");if(Object.keys(r).length){var i=new URLSearchParams(r);o+=(o.includes("?")?"&":"?")+i}return o},e}(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.getFullList=function(t,e,r){return void 0===e&&(e=100),void 0===r&&(r={}),this._getFullList(this.baseCrudPath(t),e,r)},e.prototype.getList=function(t,e,r,n){return void 0===e&&(e=1),void 0===r&&(r=30),void 0===n&&(n={}),this._getList(this.baseCrudPath(t),e,r,n)},e.prototype.getOne=function(t,e,r){return void 0===r&&(r={}),this._getOne(this.baseCrudPath(t),e,r)},e.prototype.create=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),this._create(this.baseCrudPath(t),e,r)},e.prototype.update=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this._update(this.baseCrudPath(t),e,r,n)},e.prototype.delete=function(t,e,r){return void 0===r&&(r={}),this._delete(this.baseCrudPath(t),e,r)},e}(uo)),vo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.load=function(e){t.prototype.load.call(this,e),e.remoteIp=e.remoteIp||e.ip,this.url="string"==typeof e.url?e.url:"",this.method="string"==typeof e.method?e.method:"GET",this.status="number"==typeof e.status?e.status:200,this.auth="string"==typeof e.auth?e.auth:"guest",this.remoteIp="string"==typeof e.remoteIp?e.remoteIp:"",this.userIp="string"==typeof e.userIp?e.userIp:"",this.referer="string"==typeof e.referer?e.referer:"",this.userAgent="string"==typeof e.userAgent?e.userAgent:"",this.meta="object"==typeof e.meta&&null!==e.meta?e.meta:{}},e}(Qn),bo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Fn(e,t),e.prototype.getRequestsList=function(t,e,r){return void 0===t&&(t=1),void 0===e&&(e=30),void 0===r&&(r={}),r=Object.assign({page:t,perPage:e},r),this.client.send("/api/logs/requests",{method:"GET",params:r}).then((function(t){var e=[];if(null==t?void 0:t.items){t.items=(null==t?void 0:t.items)||[];for(var r=0,n=t.items;n.length>r;r++){e.push(new vo(n[r]))}}return new io((null==t?void 0:t.page)||1,(null==t?void 0:t.perPage)||0,(null==t?void 0:t.totalItems)||0,(null==t?void 0:t.totalPages)||0,e)}))},e.prototype.getRequest=function(t,e){return void 0===e&&(e={}),this.client.send("/api/logs/requests/"+encodeURIComponent(t),{method:"GET",params:e}).then((function(t){return new vo(t)}))},e.prototype.getRequestsStats=function(t){return void 0===t&&(t={}),this.client.send("/api/logs/requests/stats",{method:"GET",params:t}).then((function(t){return t}))},e}(no),mo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.clientId="",e.eventSource=null,e.subscriptions={},e}return Fn(e,t),e.prototype.subscribe=function(t,e){var r;return zn(this,void 0,void 0,(function(){return Vn(this,(function(n){switch(n.label){case 0:if(!t)throw Error("subscription must be set.");return this.subscriptions[t]&&(null===(r=this.eventSource)||void 0===r||r.removeEventListener(t,this.subscriptions[t])),this.subscriptions[t]=function(t){var r,n=t;try{r=JSON.parse(null==n?void 0:n.data)}catch(t){}e(r||{})},this.eventSource?[3,1]:(this.connect(),[3,3]);case 1:return this.clientId?[4,this.submitSubscriptions()]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},e.prototype.unsubscribe=function(t){var e;return zn(this,void 0,void 0,(function(){return Vn(this,(function(r){switch(r.label){case 0:if(t){if(!this.subscriptions[t])return[2];null===(e=this.eventSource)||void 0===e||e.removeEventListener(t,this.subscriptions[t]),delete this.subscriptions[t]}else this.removeSubscriptionListeners(),this.subscriptions={};return this.clientId?[4,this.submitSubscriptions()]:[3,2];case 1:r.sent(),r.label=2;case 2:return Object.keys(this.subscriptions).length||this.disconnect(),[2]}}))}))},e.prototype.submitSubscriptions=function(){return zn(this,void 0,void 0,(function(){return Vn(this,(function(t){return this.addSubscriptionListeners(),[2,this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:Object.keys(this.subscriptions)},params:{$autoCancel:!1}}).then((function(){return!0}))]}))}))},e.prototype.addSubscriptionListeners=function(){if(this.eventSource)for(var t in this.removeSubscriptionListeners(),this.subscriptions)this.eventSource.addEventListener(t,this.subscriptions[t])},e.prototype.removeSubscriptionListeners=function(){if(this.eventSource)for(var t in this.subscriptions)this.eventSource.removeEventListener(t,this.subscriptions[t])},e.prototype.connectHandler=function(t){this.clientId=null==t?void 0:t.lastEventId,this.submitSubscriptions()},e.prototype.connect=function(){var t=this;this.disconnect(),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.addEventListener("PB_CONNECT",(function(e){return t.connectHandler(e)}))},e.prototype.disconnect=function(){var t,e,r=this;this.removeSubscriptionListeners(),null===(t=this.eventSource)||void 0===t||t.removeEventListener("PB_CONNECT",(function(t){return r.connectHandler(t)})),null===(e=this.eventSource)||void 0===e||e.close(),this.eventSource=null,this.clientId=""},e}(no),go=function(){function t(t,e,r){void 0===t&&(t="/"),void 0===e&&(e="en-US"),this.cancelControllers={},this.baseUrl=t,this.lang=e,this.authStore=r||new ro,this.admins=new ao(this),this.users=new lo(this),this.records=new yo(this),this.collections=new ho(this),this.logs=new bo(this),this.settings=new oo(this),this.realtime=new mo(this)}return Object.defineProperty(t.prototype,"AuthStore",{get:function(){return this.authStore},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Settings",{get:function(){return this.settings},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Admins",{get:function(){return this.admins},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Users",{get:function(){return this.users},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Collections",{get:function(){return this.collections},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Records",{get:function(){return this.records},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Logs",{get:function(){return this.logs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Realtime",{get:function(){return this.realtime},enumerable:!1,configurable:!0}),t.prototype.cancelRequest=function(t){return this.cancelControllers[t]&&(this.cancelControllers[t].abort(),delete this.cancelControllers[t]),this},t.prototype.cancelAllRequests=function(){for(var t in this.cancelControllers)this.cancelControllers[t].abort();return this.cancelControllers={},this},t.prototype.send=function(t,e){var r,n,o,i,u,s,a,c,l;return zn(this,void 0,void 0,(function(){var f,p,d,h,y,v,b=this;return Vn(this,(function(m){return(f=Object.assign({method:"GET"},e)).body&&"FormData"!==f.body.constructor.name&&("string"!=typeof f.body&&(f.body=JSON.stringify(f.body)),void 0===(null===(r=null==f?void 0:f.headers)||void 0===r?void 0:r["Content-Type"])&&(f.headers=Object.assign({},f.headers,{"Content-Type":"application/json"}))),void 0===(null===(n=null==f?void 0:f.headers)||void 0===n?void 0:n["Accept-Language"])&&(f.headers=Object.assign({},f.headers,{"Accept-Language":this.lang})),(null===(o=this.authStore)||void 0===o?void 0:o.token)&&void 0===(null===(i=null==f?void 0:f.headers)||void 0===i?void 0:i.Authorization)&&(p="Admin",void 0!==(null===(u=this.authStore.model)||void 0===u?void 0:u.verified)&&(p="User"),f.headers=Object.assign({},f.headers,{Authorization:p+" "+this.authStore.token})),!1!==(null===(s=f.params)||void 0===s?void 0:s.$autoCancel)&&(d=(null===(a=f.params)||void 0===a?void 0:a.$cancelKey)||(f.method||"GET")+t,this.cancelRequest(d),h=new AbortController,this.cancelControllers[d]=h,f.signal=h.signal),null===(c=f.params)||void 0===c||delete c.$autoCancel,null===(l=f.params)||void 0===l||delete l.$cancelKey,y=this.buildUrl(t),void 0!==f.params&&((v=this.serializeQueryParams(f.params))&&(y+=(y.includes("?")?"&":"?")+v),delete f.params),this.beforeSend&&(f=Object.assign({},this.beforeSend(y,f))),[2,fetch(y,f).then((function(t){return zn(b,void 0,void 0,(function(){var e;return Vn(this,(function(r){switch(r.label){case 0:e={},r.label=1;case 1:return r.trys.push([1,3,,4]),[4,t.json()];case 2:return e=r.sent(),[3,4];case 3:return r.sent(),[3,4];case 4:if(this.afterSend&&(e=this.afterSend(t,e)),t.status>=400)throw new Jn({url:t.url,status:t.status,data:e});return[2,e]}}))}))})).catch((function(t){throw new Jn(t)}))]}))}))},t.prototype.buildUrl=function(t){var e=this.baseUrl+(this.baseUrl.endsWith("/")?"":"/");return t&&(e+=t.startsWith("/")?t.substring(1):t),e},t.prototype.serializeQueryParams=function(t){var e=[];for(var r in t)if(null!==t[r]){var n=t[r],o=encodeURIComponent(r);if(Array.isArray(n))for(var i=0,u=n;u.length>i;i++){e.push(o+"="+encodeURIComponent(u[i]))}else e.push(n instanceof Date?o+"="+encodeURIComponent(n.toISOString()):null!==typeof n&&"object"==typeof n?o+"="+encodeURIComponent(JSON.stringify(n)):o+"="+encodeURIComponent(n))}return e.join("&")},t}();function Oo(t){return Oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oo(t)}function wo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function So(t,e){for(var r=0;e.length>r;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Po(t,e){return!e||"object"!==Oo(e)&&"function"!=typeof e?Eo(t):e}function jo(t){return jo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},jo(t)}function Eo(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _o(t,e){return _o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},_o(t,e)}function Co(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ro=function(t){function e(){var t,r;wo(this,e);for(var n=arguments.length,o=Array(n),i=0;n>i;i++)o[i]=arguments[i];return Co(Eo(r=Po(this,(t=jo(e)).call.apply(t,[this].concat(o)))),"state",{bootstrapped:!1}),Co(Eo(r),"_unsubscribe",void 0),Co(Eo(r),"handlePersistorState",(function(){r.props.persistor.getState().bootstrapped&&(r.props.onBeforeLift?Promise.resolve(r.props.onBeforeLift()).finally((function(){return r.setState({bootstrapped:!0})})):r.setState({bootstrapped:!0}),r._unsubscribe&&r._unsubscribe())})),r}var r,n,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_o(t,e)}(e,t),r=e,(n=[{key:"componentDidMount",value:function(){this._unsubscribe=this.props.persistor.subscribe(this.handlePersistorState),this.handlePersistorState()}},{key:"componentWillUnmount",value:function(){this._unsubscribe&&this._unsubscribe()}},{key:"render",value:function(){return"function"==typeof this.props.children?this.props.children(this.state.bootstrapped):this.state.bootstrapped?this.props.children:this.props.loading}}])&&So(r.prototype,n),o&&So(r,o),e}(U.PureComponent);Co(Ro,"defaultProps",{children:null,loading:null});const ko=U.createContext(null);t.ADD_RECORD=F,t.ADD_RECORDS=q,t.ClientContext=Ln,t.ClientProvider=Un,t.ContentContext=$n,t.ContentProvider=Nn,t.DELETE_RECORD=V,t.DELETE_RECORDS=G,t.Pocketbase=t=>{const[e,r]=U.useState(null);return U.useEffect((()=>{const e=new go(t.serverURL);e.admins.authViaEmail(t.credentials.username,t.credentials.password).then((()=>{r(e)}))}),[t.serverURL]),e?U.createElement(Un,{client:e},U.createElement(dn,{store:xn},U.createElement(Ro,{persistor:Tn},U.createElement(Nn,{collections:t.initialCollections},t.children)))):null},t.PocketbaseContext=ko,t.SET_RECORDS=M,t.UPDATE_RECORD=z,t.appReducer=ht,t.persistConfig=Rn,t.persistor=Tn,t.recordsAction=H,t.store=xn,t.useAppContent=function(t,e=!1){var r;const n=null!=(r=In((e=>e.reducer.records[t])))?r:[],o=U.useContext($n);return U.useEffect((()=>{e&&(null==o||o.fetch(t))}),[t,e]),{records:n,actions:{subscribe:async()=>await(null==o?void 0:o.subscribe(t)),unsubscribe:()=>null==o?void 0:o.unsubscribe(t),refetch:async()=>await(null==o?void 0:o.fetch(t)),create:async e=>await(null==o?void 0:o.create(t,e)),update:async(e,r)=>await(null==o?void 0:o.update(t,e,r)),delete:async e=>await(null==o?void 0:o.delete(t,e))}}},t.useAppDispatch=An,t.useAppSelector=In,t.useClientContext=Dn,Object.defineProperty(t,"__esModule",{value:!0})}));
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import PocketBase from 'pocketbase';
2
+ import PocketBase from '@tobicrain/pocketbase';
3
3
  export declare const PocketbaseContext: React.Context<PocketBase | null>;
4
4
  export declare type PocketbaseProviderProps = {
5
5
  children: React.ReactNode;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { createContext, useEffect } from 'react';
3
- import PocketBase from 'pocketbase';
3
+ import PocketBase from '@tobicrain/pocketbase';
4
4
  import { Provider } from 'react-redux';
5
5
  import { PersistGate } from 'redux-persist/integration/react';
6
6
  import * as store from '../store/store';
@@ -13,7 +13,6 @@ export const Pocketbase = props => {
13
13
  const client = new PocketBase(props.serverURL);
14
14
  client.admins.authViaEmail(props.credentials.username, props.credentials.password).then(() => {
15
15
  setClient(client);
16
- console.log('Pocketbase client initialized');
17
16
  });
18
17
  }, [props.serverURL]);
19
18
  return client ? /*#__PURE__*/React.createElement(ClientProvider, {
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import PocketBase from 'pocketbase';
2
+ import PocketBase from '@tobicrain/pocketbase';
3
3
  export declare const ClientContext: React.Context<PocketBase | null>;
4
4
  export declare type ClientProviderProps = {
5
5
  children: React.ReactNode;
@@ -16,15 +16,12 @@ export const ContentProvider = props => {
16
16
  case 'create':
17
17
  dispatch(recordsAction.addRecord(collectionName, event.record));
18
18
  break;
19
-
20
19
  case 'update':
21
20
  dispatch(recordsAction.updateRecord(collectionName, event.record));
22
21
  break;
23
-
24
22
  case 'delete':
25
23
  dispatch(recordsAction.deleteRecord(collectionName, event.record));
26
24
  break;
27
-
28
25
  default:
29
26
  break;
30
27
  }
@@ -58,7 +55,6 @@ export const ContentProvider = props => {
58
55
  actions.subscribe(collectionName);
59
56
  });
60
57
  }
61
-
62
58
  return () => actions.unsubscribe();
63
59
  }, [collections]);
64
60
  return /*#__PURE__*/React.createElement(ContentContext.Provider, {
@@ -3,7 +3,6 @@ import * as store from '../store';
3
3
  import { ContentContext } from '../context';
4
4
  export function useAppContent(collectionName, initialFetch = false) {
5
5
  var _store$useAppSelector;
6
-
7
6
  const records = (_store$useAppSelector = store.useAppSelector(state => state.reducer.records[collectionName])) != null ? _store$useAppSelector : [];
8
7
  const context = useContext(ContentContext);
9
8
  useEffect(() => {
@@ -1,2 +1,2 @@
1
- declare const useClientContext: () => import("pocketbase").default | null;
1
+ declare const useClientContext: () => import("@tobicrain/pocketbase").default | null;
2
2
  export { useClientContext };
@@ -1,9 +1,7 @@
1
1
  import { useContext } from 'react';
2
2
  import { ClientContext } from '../context';
3
-
4
3
  const useClientContext = () => {
5
4
  const context = useContext(ClientContext);
6
5
  return context;
7
6
  };
8
-
9
7
  export { useClientContext };
@@ -1,39 +1,32 @@
1
1
  import * as ReduxType from '../types';
2
-
3
2
  const setRecords = (key, payload) => ({
4
3
  type: ReduxType.SET_RECORDS,
5
4
  key,
6
5
  payload
7
6
  });
8
-
9
7
  const addRecord = (key, payload) => ({
10
8
  type: ReduxType.ADD_RECORD,
11
9
  key,
12
10
  payload
13
11
  });
14
-
15
12
  const addRecords = (key, payload) => ({
16
13
  type: ReduxType.ADD_RECORDS,
17
14
  key,
18
15
  payload
19
16
  });
20
-
21
17
  const deleteRecord = (key, payload) => ({
22
18
  type: ReduxType.DELETE_RECORD,
23
19
  key,
24
20
  payload
25
21
  });
26
-
27
22
  const deleteRecords = (key, payload) => ({
28
23
  type: ReduxType.DELETE_RECORDS,
29
24
  key,
30
25
  payload
31
26
  });
32
-
33
27
  const updateRecord = (key, payload) => ({
34
28
  type: ReduxType.UPDATE_RECORD,
35
29
  key,
36
30
  payload
37
31
  });
38
-
39
32
  export { setRecords, addRecord, addRecords, deleteRecord, deleteRecords, updateRecord };
@@ -1,37 +1,28 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as ReduxType from '../types';
3
-
4
3
  function appendRecord(record, records) {
5
4
  return [...records, record];
6
5
  }
7
-
8
6
  function appendRecords(recordsToAppend, records) {
9
7
  return [...records, ...recordsToAppend];
10
8
  }
11
-
12
9
  function updateRecord(record, records) {
13
10
  return records.map(r => {
14
11
  if (r.id === record.id) {
15
12
  return record;
16
13
  }
17
-
18
14
  return r;
19
15
  });
20
16
  }
21
-
22
17
  function deleteRecord(record, records) {
23
18
  return records.filter(r => r.id !== record.id);
24
19
  }
25
-
26
20
  function deleteRecords(recordsToDelete, records) {
27
21
  return records.filter(r => !recordsToDelete.includes(r));
28
22
  }
29
-
30
23
  export const records = (state = {}, action) => {
31
24
  var _state$action$key;
32
-
33
25
  const list = (_state$action$key = state[action.key]) != null ? _state$action$key : [];
34
-
35
26
  switch (action.type) {
36
27
  case ReduxType.SET_RECORDS:
37
28
  if (Array.isArray(action.payload)) {
@@ -39,32 +30,26 @@ export const records = (state = {}, action) => {
39
30
  [action.key]: action.payload
40
31
  });
41
32
  }
42
-
43
33
  case ReduxType.ADD_RECORD:
44
34
  return _extends({}, state, {
45
35
  [action.key]: appendRecord(action.payload, list)
46
36
  });
47
-
48
37
  case ReduxType.ADD_RECORDS:
49
38
  return _extends({}, state, {
50
39
  [action.key]: appendRecords(action.payload, list)
51
40
  });
52
-
53
41
  case ReduxType.DELETE_RECORD:
54
42
  return _extends({}, state, {
55
43
  [action.key]: deleteRecord(action.payload, list)
56
44
  });
57
-
58
45
  case ReduxType.DELETE_RECORDS:
59
46
  return _extends({}, state, {
60
47
  [action.key]: deleteRecords(action.payload, list)
61
48
  });
62
-
63
49
  case ReduxType.UPDATE_RECORD:
64
50
  return _extends({}, state, {
65
51
  [action.key]: updateRecord(action.payload, list)
66
52
  });
67
-
68
53
  default:
69
54
  return state;
70
55
  }
@@ -1,4 +1,4 @@
1
- /// <reference types="redux-persist" />
1
+ /// <reference types="redux-persist/types/persistReducer" />
2
2
  /// <reference types="redux-persist/types/types" />
3
3
  /// <reference types="redux-persist" />
4
4
  import { TypedUseSelectorHook } from 'react-redux';
package/es/store/store.js CHANGED
@@ -7,10 +7,8 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
7
7
  const CustomStorage = {
8
8
  getItem: async (_key, ..._args) => {
9
9
  if (typeof document !== 'undefined') {
10
- console.log("I'm on the web!");
11
10
  return localStorage.getItem(_key);
12
11
  } else if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
13
- console.log("I'm in react-native");
14
12
  return await AsyncStorage.getItem(_key);
15
13
  }
16
14
  },
@@ -1,38 +1,25 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  exports.__esModule = true;
6
5
  exports.PocketbaseContext = exports.Pocketbase = void 0;
7
-
8
6
  var React = _interopRequireWildcard(require("react"));
9
-
10
- var _pocketbase = _interopRequireDefault(require("pocketbase"));
11
-
7
+ var _pocketbase = _interopRequireDefault(require("@tobicrain/pocketbase"));
12
8
  var _reactRedux = require("react-redux");
13
-
14
9
  var _react2 = require("redux-persist/integration/react");
15
-
16
10
  var store = _interopRequireWildcard(require("../store/store"));
17
-
18
11
  var _client = require("./client");
19
-
20
12
  var _content = require("./content");
21
-
22
13
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
14
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
15
  const PocketbaseContext = (0, React.createContext)(null);
27
16
  exports.PocketbaseContext = PocketbaseContext;
28
-
29
17
  const Pocketbase = props => {
30
18
  const [client, setClient] = React.useState(null);
31
19
  (0, React.useEffect)(() => {
32
20
  const client = new _pocketbase.default(props.serverURL);
33
21
  client.admins.authViaEmail(props.credentials.username, props.credentials.password).then(() => {
34
22
  setClient(client);
35
- console.log('Pocketbase client initialized');
36
23
  });
37
24
  }, [props.serverURL]);
38
25
  return client ? /*#__PURE__*/React.createElement(_client.ClientProvider, {
@@ -45,5 +32,4 @@ const Pocketbase = props => {
45
32
  collections: props.initialCollections
46
33
  }, props.children)))) : null;
47
34
  };
48
-
49
35
  exports.Pocketbase = Pocketbase;
@@ -2,20 +2,14 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.ClientProvider = exports.ClientContext = void 0;
5
-
6
5
  var React = _interopRequireWildcard(require("react"));
7
-
8
6
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
9
-
10
7
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
-
12
8
  const ClientContext = (0, React.createContext)(null);
13
9
  exports.ClientContext = ClientContext;
14
-
15
10
  const ClientProvider = props => {
16
11
  return /*#__PURE__*/React.createElement(ClientContext.Provider, {
17
12
  value: props.client
18
13
  }, props.children);
19
14
  };
20
-
21
15
  exports.ClientProvider = ClientProvider;
@@ -2,22 +2,14 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.ContentProvider = exports.ContentContext = void 0;
5
-
6
5
  var store = _interopRequireWildcard(require("../store/store"));
7
-
8
6
  var React = _interopRequireWildcard(require("react"));
9
-
10
7
  var _useClientContext = require("../hooks/useClientContext");
11
-
12
8
  var _actions = require("../store/actions");
13
-
14
9
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
-
16
10
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
-
18
11
  const ContentContext = (0, React.createContext)(null);
19
12
  exports.ContentContext = ContentContext;
20
-
21
13
  const ContentProvider = props => {
22
14
  const client = (0, _useClientContext.useClientContext)();
23
15
  const dispatch = store.useAppDispatch;
@@ -30,15 +22,12 @@ const ContentProvider = props => {
30
22
  case 'create':
31
23
  dispatch(_actions.recordsAction.addRecord(collectionName, event.record));
32
24
  break;
33
-
34
25
  case 'update':
35
26
  dispatch(_actions.recordsAction.updateRecord(collectionName, event.record));
36
27
  break;
37
-
38
28
  case 'delete':
39
29
  dispatch(_actions.recordsAction.deleteRecord(collectionName, event.record));
40
30
  break;
41
-
42
31
  default:
43
32
  break;
44
33
  }
@@ -72,12 +61,10 @@ const ContentProvider = props => {
72
61
  actions.subscribe(collectionName);
73
62
  });
74
63
  }
75
-
76
64
  return () => actions.unsubscribe();
77
65
  }, [collections]);
78
66
  return /*#__PURE__*/React.createElement(ContentContext.Provider, {
79
67
  value: actions
80
68
  }, props.children);
81
69
  };
82
-
83
70
  exports.ContentProvider = ContentProvider;
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
-
5
4
  var _content = require("./content");
6
-
7
5
  Object.keys(_content).forEach(function (key) {
8
6
  if (key === "default" || key === "__esModule") return;
9
7
  if (key in exports && exports[key] === _content[key]) return;
@@ -14,9 +12,7 @@ Object.keys(_content).forEach(function (key) {
14
12
  }
15
13
  });
16
14
  });
17
-
18
15
  var _client = require("./client");
19
-
20
16
  Object.keys(_client).forEach(function (key) {
21
17
  if (key === "default" || key === "__esModule") return;
22
18
  if (key in exports && exports[key] === _client[key]) return;
@@ -27,9 +23,7 @@ Object.keys(_client).forEach(function (key) {
27
23
  }
28
24
  });
29
25
  });
30
-
31
26
  var _Pocketbase = require("./Pocketbase");
32
-
33
27
  Object.keys(_Pocketbase).forEach(function (key) {
34
28
  if (key === "default" || key === "__esModule") return;
35
29
  if (key in exports && exports[key] === _Pocketbase[key]) return;
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
-
5
4
  var _useAppContent = require("./useAppContent");
6
-
7
5
  Object.keys(_useAppContent).forEach(function (key) {
8
6
  if (key === "default" || key === "__esModule") return;
9
7
  if (key in exports && exports[key] === _useAppContent[key]) return;
@@ -14,9 +12,7 @@ Object.keys(_useAppContent).forEach(function (key) {
14
12
  }
15
13
  });
16
14
  });
17
-
18
15
  var _useClientContext = require("./useClientContext");
19
-
20
16
  Object.keys(_useClientContext).forEach(function (key) {
21
17
  if (key === "default" || key === "__esModule") return;
22
18
  if (key in exports && exports[key] === _useClientContext[key]) return;