@cyberskill/shared 1.61.0 → 1.62.0
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.
- package/dist/_tsup-dts-rollup.d.cts +85 -68
- package/dist/_tsup-dts-rollup.d.ts +85 -68
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/configs/graphql/graphql-codegen.cjs +1 -1
- package/dist/configs/graphql/graphql-codegen.js +1 -1
- package/dist/configs/graphql/index.cjs +1 -1
- package/dist/configs/graphql/index.js +1 -1
- package/dist/configs/index.cjs +1 -1
- package/dist/configs/index.js +1 -1
- package/dist/configs/vitest/react/unit.cjs +1 -1
- package/dist/configs/vitest/react/unit.js +1 -1
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/constants/path.cjs +1 -1
- package/dist/constants/path.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/react/apollo-client.cjs +1 -1
- package/dist/react/apollo-client.js +1 -1
- package/dist/react/apollo-error.cjs +1 -1
- package/dist/react/apollo-error.js +1 -1
- package/dist/react/apollo-error.module.scss +2 -8
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/next-intl.cjs +1 -1
- package/dist/react/next-intl.js +1 -1
- package/dist/react/storage.cjs +1 -1
- package/dist/react/storage.js +1 -1
- package/dist/typescript/command.cjs +1 -1
- package/dist/typescript/command.d.cts +2 -3
- package/dist/typescript/command.d.ts +2 -3
- package/dist/typescript/command.js +1 -1
- package/dist/typescript/index.cjs +1 -1
- package/dist/typescript/index.d.cts +4 -4
- package/dist/typescript/index.d.ts +4 -4
- package/dist/typescript/index.js +1 -1
- package/dist/typescript/log.d.cts +2 -1
- package/dist/typescript/log.d.ts +2 -1
- package/dist/utils/command.cjs +1 -1
- package/dist/utils/command.d.cts +0 -1
- package/dist/utils/command.d.ts +0 -1
- package/dist/utils/command.js +1 -1
- package/dist/utils/fs.cjs +1 -1
- package/dist/utils/fs.d.cts +1 -1
- package/dist/utils/fs.d.ts +1 -1
- package/dist/utils/fs.js +1 -1
- package/dist/utils/index-nodejs.cjs +1 -1
- package/dist/utils/index-nodejs.d.cts +3 -3
- package/dist/utils/index-nodejs.d.ts +3 -3
- package/dist/utils/index-nodejs.js +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/log.cjs +1 -1
- package/dist/utils/log.d.cts +2 -1
- package/dist/utils/log.d.ts +2 -1
- package/dist/utils/log.js +1 -1
- package/dist/utils/package.cjs +1 -1
- package/dist/utils/package.js +1 -1
- package/dist/utils/path.cjs +1 -1
- package/dist/utils/path.js +1 -1
- package/dist/utils/storage-client.cjs +1 -1
- package/dist/utils/storage-client.js +1 -1
- package/dist/utils/storage-server.cjs +1 -1
- package/dist/utils/storage-server.js +1 -1
- package/package.json +2 -2
package/dist/react/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function r(e){if(Array.isArray(e))return e}function n(r){if(Array.isArray(r))return e(r)}function t(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,r,n,t,o,i,u){try{var a=e[i](u);var l=a.value}catch(e){n(e);return}if(a.done){r(l)}else{Promise.resolve(l).then(t,o)}}function i(e){return function(){var r=this,n=arguments;return new Promise(function(t,i){var u=e.apply(r,n);function a(e){o(u,t,i,a,l,"next",e)}function l(e){o(u,t,i,a,l,"throw",e)}a(undefined)})}}function u(e,r,n){r=f(r);return E(e,L()?Reflect.construct(r,n||[],f(e).constructor):r.apply(e,n))}function a(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function l(e,r){for(var n=0;n<r.length;n++){var t=r[n];t.enumerable=t.enumerable||false;t.configurable=true;if("value"in t)t.writable=true;Object.defineProperty(e,t.key,t)}}function s(e,r,n){if(r)l(e.prototype,r);if(n)l(e,n);return e}function c(e,r,n){if(r in e){Object.defineProperty(e,r,{value:n,enumerable:true,configurable:true,writable:true})}else{e[r]=n}return e}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function d(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:true,configurable:true}});if(r)k(e,r)}function v(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function p(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function h(e,r){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var t=[];var o=true;var i=false;var u,a;try{for(n=n.call(e);!(o=(u=n.next()).done);o=true){t.push(u.value);if(r&&t.length===r)break}}catch(e){i=true;a=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return t}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};var t=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){t=t.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}t.forEach(function(r){c(e,r,n[r])})}return e}function b(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);if(r){t=t.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})}n.push.apply(n,t)}return n}function w(e,r){r=r!=null?r:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{b(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function x(e,r){if(e==null)return{};var n=j(e,r);var t,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++){t=i[o];if(r.indexOf(t)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,t))continue;n[t]=e[t]}}return n}function j(e,r){if(e==null)return{};var n={};var t=Object.keys(e);var o,i;for(i=0;i<t.length;i++){o=t[i];if(r.indexOf(o)>=0)continue;n[o]=e[o]}return n}function E(e,r){if(r&&(P(r)==="object"||typeof r==="function")){return r}return t(e)}function k(e,r){k=Object.setPrototypeOf||function e(e,r){e.__proto__=r;return e};return k(e,r)}function O(e,n){return r(e)||h(e,n)||S(e,n)||m()}function N(e){return n(e)||p(e)||S(e)||g()}function P(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function S(r,n){if(!r)return;if(typeof r==="string")return e(r,n);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor)t=r.constructor.name;if(t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return e(r,n)}function L(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(L=function(){return!!e})()}function A(e,r){var n,t,o,i,u={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),"throw":a(1),"return":a(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(r){return l([e,r])}}function l(i){if(n)throw new TypeError("Generator is already executing.");while(u)try{if(n=1,t&&(o=i[0]&2?t["return"]:i[0]?t["throw"]||((o=t["return"])&&o.call(t),0):t.next)&&!(o=o.call(t,i[1])).done)return o;if(t=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:u.label++;return{value:i[1],done:false};case 5:u.label++;t=i[1];i=[0];continue;case 7:i=u.ops.pop();u.trys.pop();continue;default:if(!(o=u.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){u=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(i[0]===6&&u.label<o[1]){u.label=o[1];o=i;break}if(o&&u.label<o[2]){u.label=o[2];u.ops.push(i);break}if(o[2])u.ops.pop();u.trys.pop();continue}i=r.call(e,u)}catch(e){i=[6,e];t=0}finally{n=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var I=Object.create;var C=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var V=function(e,r){for(var n in r)C(e,n,{get:r[n],enumerable:!0})},D=function(e,r,n,t){var o=true,i=false,u=undefined;if(r&&(typeof r==="undefined"?"undefined":P(r))=="object"||typeof r=="function")try{var a=function(){var o=s.value;!T.call(e,o)&&o!==n&&C(e,o,{get:function(){return r[o]},enumerable:!(t=q(r,o))||t.enumerable})};for(var l=_(r)[Symbol.iterator](),s;!(o=(s=l.next()).done);o=true)a()}catch(e){i=true;u=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(i){throw u}}}return e};var U=function(e,r,n){return n=e!=null?I(M(e)):{},D(r||!e||!e.__esModule?C(n,"default",{value:e,enumerable:!0}):n,e)},G=function(e){return D(C({},"__esModule",{value:!0}),e)};var Q={};V(Q,{ApolloErrorViewerModal:function(){return ea},ApolloErrorViewerProvider:function(){return eu},ApolloProvider:function(){return ef},Loading:function(){return ey},LoadingContext:function(){return em},LoadingProvider:function(){return eb},NextIntlContext:function(){return eS},NextIntlProvider:function(){return e_},registerApolloErrorViewerCallback:function(){return eo},showGlobalApolloError:function(){return ei},useApolloErrorViewer:function(){return en},useLoading:function(){return eg},useNextIntl:function(){return eL},useStorage:function(){return eN},useTranslateNextIntl:function(){return eA},withNextIntl:function(){return eI}});module.exports=G(Q);var R=require("@apollo/client"),z=require("@apollo/client/link/error"),J=require("@apollo/client/link/remove-typename"),F=require("@apollo/client/link/subscriptions"),H=require("@apollo/client/utilities"),W=require("graphql-ws"),B=require("react"),Z=require("react-hot-toast"),$=require("react-icons/fa6");var K="/graphql";var X=require("react"),Y=U(require("./apollo-error.module.scss"),1),ee=require("react/jsx-runtime"),er=(0,X.createContext)(void 0);function en(){var e=(0,X.use)(er);if(!e)throw new Error("useApolloErrorViewer must be used within ApolloErrorViewerProvider");return e}var et=null;function eo(e){et=e}function ei(e){et&&et(e)}function eu(e){var r=e.children;var n=O((0,X.useState)(null),2),t=n[0],o=n[1];(0,X.useEffect)(function(){eo(o)},[]);var i=(0,X.useMemo)(function(){return{error:t,showError:o,hideError:function(){return o(null)}}},[t]);return(0,ee.jsx)(er,{value:i,children:r})}function ea(){var e,r,n;var t=(0,X.use)(er);if(!t||!t.error)return null;var o=t.error,i=t.hideError;return(0,ee.jsx)("div",{className:Y.default["modal-backdrop"],onClick:i,children:(0,ee.jsxs)("div",{className:Y.default["modal-content"],children:[(0,ee.jsx)("button",{type:"button",className:Y.default["btn-close"],onClick:i,children:"✕"}),(0,ee.jsx)("div",{className:Y.default["error-title"],children:"\uD83D\uDEA8 Something went wrong"}),(0,ee.jsx)("p",{className:Y.default["error-text"],children:"A problem occurred while communicating with the server."}),(0,ee.jsxs)("div",{className:Y.default["error-details"],children:[(0,ee.jsxs)("pre",{className:"main",children:[(0,ee.jsx)("strong",{children:"Main Error:"})," ",o.message]}),o.networkError&&(0,ee.jsxs)("pre",{className:"network",children:[(0,ee.jsx)("strong",{children:"Network Error:"})," ",o.networkError.message]}),((e=o.graphQLErrors)===null||e===void 0?void 0:e.length)>0&&(0,ee.jsxs)("div",{children:[(0,ee.jsx)("strong",{children:"GraphQL Errors:"}),(0,ee.jsx)("ul",{children:o.graphQLErrors.map(function(e){return(0,ee.jsx)("li",{children:e.message},e.message)})})]}),((r=o.protocolErrors)===null||r===void 0?void 0:r.length)>0&&(0,ee.jsxs)("div",{children:[(0,ee.jsx)("strong",{children:"Protocol Errors:"}),(0,ee.jsx)("ul",{children:o.protocolErrors.map(function(e){return(0,ee.jsx)("li",{children:e.message},e.message)})})]}),((n=o.clientErrors)===null||n===void 0?void 0:n.length)>0&&(0,ee.jsxs)("div",{children:[(0,ee.jsx)("strong",{children:"Client Errors:"}),(0,ee.jsx)("ul",{children:o.clientErrors.map(function(e){return(0,ee.jsx)("li",{children:e.message},e.message)})})]}),o.extraInfo&&(0,ee.jsxs)("pre",{className:"extra",children:[(0,ee.jsx)("strong",{children:"Extra Info:"})," ",JSON.stringify(o.extraInfo,null,4)]})]}),(0,ee.jsx)("button",{type:"button",className:Y.default["btn-retry"],onClick:function(){return window.location.reload()},children:"\uD83D\uDD04 Retry"})]})})}var el=require("react/jsx-runtime"),es=/*#__PURE__*/function(e){d(r,e);function r(){a(this,r);var e;e=u(this,r,arguments);e.count=0;return e}s(r,[{key:"request",value:function e(e,r){var n=this;var t=Date.now();return this.count+=1,r(e).map(function(r){var o=Date.now()-t,i=e.operationName||"Unnamed";return console.info("[Apollo] #".concat(n.count,": ").concat(i," (").concat(o,"ms)")),r})}}]);return r}(R.ApolloLink);function ec(e){var r=e||{},n=r.uri,t=r.wsUrl,o=r.customLinks,i=new es,u=(0,z.onError)(function(e){var r=e.graphQLErrors,n=e.networkError,t=e.protocolErrors,o=e.operation;var i=(o===null||o===void 0?void 0:o.operationName)||"Unknown";if(r&&r.forEach(function(e){var r=e.message,n=e.locations,t=e.path;console.error("[GraphQL error] ".concat(i,": ").concat(r,", Location: ").concat(JSON.stringify(n),", Path: ").concat(t))}),t&&t.forEach(function(e){var r=e.message,n=e.extensions;console.error("[Protocol error]: ".concat(r,", Extensions: ").concat(JSON.stringify(n)))}),n&&console.error("[Network error]: ".concat(n)),r||t||n){var u,a;var l=(r===null||r===void 0?void 0:(u=r[0])===null||u===void 0?void 0:u.message)||(t===null||t===void 0?void 0:(a=t[0])===null||a===void 0?void 0:a.message)||(n===null||n===void 0?void 0:n.message)||"Unexpected error",s=new R.ApolloError({graphQLErrors:r||[],protocolErrors:t||[],clientErrors:[],networkError:n||null,errorMessage:l,extraInfo:{operation:o}});Z.toast.error(function(e){return(0,el.jsxs)(el.Fragment,{children:[l,"\xa0",(0,el.jsx)($.FaQuestion,{onClick:function(){setTimeout(function(){ei(s)},0),Z.toast.dismiss(e.id)}})]})})}}),a=(0,J.removeTypenameFromVariables)();n||console.warn('[Apollo] No GraphQL URI provided — using "'.concat(K,'" as default'));var l=new R.HttpLink({uri:n!==null&&n!==void 0?n:K,credentials:"include"});t||console.warn("[Apollo] No WebSocket URL provided — subscriptions will use HTTP only");var s=t?new F.GraphQLWsLink((0,W.createClient)({url:t})):R.ApolloLink.empty(),c=v(s,R.ApolloLink)?(0,R.split)(function(e){var r=e.query;var n=(0,H.getMainDefinition)(r);return n.kind==="OperationDefinition"&&n.operation==="subscription"},s,l):l;return c===l&&t&&console.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[i,u,a].concat(N(o!==null&&o!==void 0?o:[]),[c])}function ef(e){var r=e.isNextJS,n=e.options,t=e.children,o=e.client,i=e.provider,u=e.cache;var a=n||{},l=a.uri,s=a.wsUrl,c=a.customLinks,f=x(a,["uri","wsUrl","customLinks"]);if(typeof(o!==null&&o!==void 0?o:R.ApolloClient)!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var d=i||R.ApolloProvider,p=(0,B.useMemo)(function(){return(0,R.from)(ec({uri:l,wsUrl:s,customLinks:c}))},[l,s,c]),h=(0,B.useMemo)(function(){return new R.ApolloClient(y({link:p,cache:v(u,R.InMemoryCache)?u:new R.InMemoryCache},f))},[p,u,f]),m=r?(0,el.jsx)(d,{makeClient:function(){return h},children:t}):(0,el.jsx)(d,{client:h,children:t});return r?(0,el.jsx)(d,{makeClient:function(){return h},children:t}):(0,el.jsxs)(el.Fragment,{children:[(0,el.jsxs)(eu,{children:[m,(0,el.jsx)(ea,{})]}),(0,el.jsx)(Z.Toaster,{position:"top-right"})]})}var ed=U(require("classnames"),1),ev=require("react"),ep=U(require("./loading.module.scss"),1),eh=require("react/jsx-runtime"),em=(0,ev.createContext)(void 0);function eg(){var e=(0,ev.use)(em);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}function ey(e){var r=e.full,n=r===void 0?!1:r,t=e.block,o=t===void 0?!1:t,i=e.className,u=i===void 0?"":i,a=e.message,l=a===void 0?"Loading":a,s=x(e,["full","block","className","message"]);function c(){return(0,eh.jsxs)("div",w(y({className:ep.default.container},s),{children:[(0,eh.jsx)("div",{className:ep.default.ring}),(0,eh.jsx)("div",{className:ep.default.ring}),(0,eh.jsx)("div",{className:ep.default.ring}),(0,eh.jsx)("div",{className:ep.default.ring}),l&&(0,eh.jsx)("div",{className:ep.default.message,children:l})]}))}return n?(0,eh.jsx)("div",{className:(0,ed.default)(ep.default.fullscreen,u),children:c()}):o?(0,eh.jsx)("div",{className:(0,ed.default)(ep.default.block,u),children:c()}):c()}function eb(e){var r=e.children;var n=O((0,ev.useState)(!1),2),t=n[0],o=n[1],i=O((0,ev.useState)(!1),2),u=i[0],a=i[1],l=(0,ev.useCallback)(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;o(!0),a(e)},[]),s=(0,ev.useCallback)(function(){o(!1),a(!1)},[]),c=(0,ev.useMemo)(function(){return{isLoading:t,isGlobalLoading:u,showLoading:l,hideLoading:s}},[t,u,l,s]);return(0,eh.jsx)(em,{value:c,children:t?(0,eh.jsx)(ey,{full:u}):r})}var ew=require("next-intl"),ex=require("react");var ej=require("react");var eE={serialize:function(e){return JSON.stringify(e,function(e,r){return v(r,Date)?{__type:"Date",value:r.toISOString()}:r})},deserialize:function(e){return JSON.parse(e,function(e,r){return(r===null||r===void 0?void 0:r.__type)==="Date"?new Date(r.value):r})}};var ek=U(require("localforage"),1),eO={get:function e(e){return i(function(){var r;return A(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,ek.default.getItem(e)];case 1:return[2,n.sent()];case 2:r=n.sent();return[2,(console.error('❌ [Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,r){return i(function(){var n;return A(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,ek.default.setItem(e,r)];case 1:t.sent();return[3,3];case 2:n=t.sent();console.error('❌ [Storage:set] Error setting key "'.concat(e,'":'),n);return[3,3];case 3:return[2]}})})()},remove:function e(e){return i(function(){var r;return A(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,ek.default.removeItem(e)];case 1:n.sent();return[3,3];case 2:r=n.sent();console.error('❌ [Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return i(function(){var e,r;return A(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,ek.default.keys()];case 1:return[2,(e=n.sent())!==null&&e!==void 0?e:[]];case 2:r=n.sent();return[2,(console.error("❌ [Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};function eN(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:eE;var t=O((0,ej.useState)(r),2),o=t[0],u=t[1],a=O((0,ej.useState)(!1),2),l=a[0],s=a[1];(0,ej.useEffect)(function(){var t=!0;return i(function(){var o,i,a,l;return A(this,function(c){switch(c.label){case 0:c.trys.push([0,6,7,8]);return[4,eO.get(e)];case 1:o=c.sent();if(!t)return[3,5];if(!(o!==null))return[3,2];i=n.deserialize(o);u(i);return[3,5];case 2:if(!(r!==void 0))return[3,4];a=n.serialize(r);return[4,eO.set(e,a)];case 3:c.sent(),u(r);return[3,5];case 4:u(void 0);c.label=5;case 5:return[3,8];case 6:l=c.sent();console.error('Error loading value for key "'.concat(e,'":'),l),t&&u(r);return[3,8];case 7:t&&s(!0);return[7];case 8:return[2]}})})(),function(){t=!1,s(!1)}},[e,r,n]),(0,ej.useEffect)(function(){if(!l)return;i(function(){var r,t;return A(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);if(!(o!==void 0))return[3,2];r=n.serialize(o);return[4,eO.set(e,r)];case 1:i.sent();i.label=2;case 2:return[3,4];case 3:t=i.sent();console.error('Error saving value for key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},[o,e,n,l]);var c=(0,ej.useCallback)(function(e){u(function(r){return typeof e=="function"?e(r):e})},[]),f=(0,ej.useCallback)(/*#__PURE__*/i(function(){var r;return A(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,eO.remove(e)];case 1:n.sent(),u(void 0);return[3,3];case 2:r=n.sent();console.error('Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})}),[e]);return{value:o,set:c,remove:f}}var eP=require("react/jsx-runtime"),eS=(0,ex.createContext)(void 0);function eL(){var e=(0,ex.use)(eS);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}var eA=ew.useTranslations;function eI(e){var r=function(r){var n;var t=eL(),o=t.currentLanguage,i=r.messages,u=r.languages,a="en",l=i[(o===null||o===void 0?void 0:o.value)||a],s=(n=u.find(function(e){return e.value===(o===null||o===void 0?void 0:o.value)}))===null||n===void 0?void 0:n.timezone;return i?(0,eP.jsx)(ew.NextIntlClientProvider,{locale:(o===null||o===void 0?void 0:o.value)||a,messages:l,timeZone:s,children:(0,eP.jsx)(e,y({},r))}):(console.warn("Missing messages for language: ".concat((o===null||o===void 0?void 0:o.value)||a)),null)};return r.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),r}function eC(e){var r=e.children;return(0,eP.jsx)(eP.Fragment,{children:r})}var eq=eI(eC);function e_(e){var r=e.children,n=e.languages,t=e.messages;var o;var i=eN("lang",(o=n===null||n===void 0?void 0:n[0])!==null&&o!==void 0?o:{}),u=i.value,a=i.set,l=(0,ex.useMemo)(function(){return{languages:n,currentLanguage:u,setCurrentLanguage:a}},[n,a,u]);return(0,eP.jsx)(eS,{value:l,children:(0,eP.jsx)(eq,{languages:n,messages:t,children:r})})}0&&(module.exports={ApolloErrorViewerModal:ApolloErrorViewerModal,ApolloErrorViewerProvider:ApolloErrorViewerProvider,ApolloProvider:ApolloProvider,Loading:Loading,LoadingContext:LoadingContext,LoadingProvider:LoadingProvider,NextIntlContext:NextIntlContext,NextIntlProvider:NextIntlProvider,registerApolloErrorViewerCallback:registerApolloErrorViewerCallback,showGlobalApolloError:showGlobalApolloError,useApolloErrorViewer:useApolloErrorViewer,useLoading:useLoading,useNextIntl:useNextIntl,useStorage:useStorage,useTranslateNextIntl:useTranslateNextIntl,withNextIntl:withNextIntl});
|
|
1
|
+
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(r){if(Array.isArray(r))return e(r)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function o(e,r,t,n,o,i,a){try{var u=e[i](a);var l=u.value}catch(e){t(e);return}if(u.done){r(l)}else{Promise.resolve(l).then(n,o)}}function i(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var a=e.apply(r,t);function u(e){o(a,n,i,u,l,"next",e)}function l(e){o(a,n,i,u,l,"throw",e)}u(undefined)})}}function a(e,r,t){r=f(r);return E(e,L()?Reflect.construct(r,t||[],f(e).constructor):r.apply(e,t))}function u(e,r){if(!(e instanceof r)){throw new TypeError("Cannot call a class as a function")}}function l(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function c(e,r,t){if(r)l(e.prototype,r);if(t)l(e,t);return e}function s(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function f(e){f=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return f(e)}function d(e,r){if(typeof r!=="function"&&r!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:true,configurable:true}});if(r)k(e,r)}function v(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function p(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function g(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var i=false;var a,u;try{for(t=t.call(e);!(o=(a=t.next()).done);o=true){n.push(a.value);if(r&&n.length===r)break}}catch(e){i=true;u=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(i)throw u}}return n}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){s(e,r,t[r])})}return e}function b(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(r){n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})}t.push.apply(t,n)}return t}function w(e,r){r=r!=null?r:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{b(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function x(e,r){if(e==null)return{};var t=j(e,r);var n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++){n=i[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function j(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,i;for(i=0;i<n.length;i++){o=n[i];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function E(e,r){if(r&&(P(r)==="object"||typeof r==="function")){return r}return n(e)}function k(e,r){k=Object.setPrototypeOf||function e(e,r){e.__proto__=r;return e};return k(e,r)}function O(e,t){return r(e)||g(e,t)||S(e,t)||h()}function N(e){return t(e)||p(e)||S(e)||m()}function P(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function S(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function L(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(L=function(){return!!e})()}function A(e,r){var t,n,o,i,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),"throw":u(1),"return":u(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(e){return function(r){return l([e,r])}}function l(i){if(t)throw new TypeError("Generator is already executing.");while(a)try{if(t=1,n&&(o=i[0]&2?n["return"]:i[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;if(n=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;n=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e];n=0}finally{t=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var I=Object.create;var C=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var T=function(e,r){for(var t in r)C(e,t,{get:r[t],enumerable:!0})},V=function(e,r,t,n){var o=true,i=false,a=undefined;if(r&&(typeof r==="undefined"?"undefined":P(r))=="object"||typeof r=="function")try{var u=function(){var o=c.value;!D.call(e,o)&&o!==t&&C(e,o,{get:function(){return r[o]},enumerable:!(n=q(r,o))||n.enumerable})};for(var l=_(r)[Symbol.iterator](),c;!(o=(c=l.next()).done);o=true)u()}catch(e){i=true;a=e}finally{try{if(!o&&l.return!=null){l.return()}}finally{if(i){throw a}}}return e};var U=function(e,r,t){return t=e!=null?I(M(e)):{},V(r||!e||!e.__esModule?C(t,"default",{value:e,enumerable:!0}):t,e)},G=function(e){return V(C({},"__esModule",{value:!0}),e)};var Q={};T(Q,{ApolloErrorViewerModal:function(){return eg},ApolloErrorViewerProvider:function(){return ep},ApolloProvider:function(){return eb},Loading:function(){return eN},LoadingContext:function(){return ek},LoadingProvider:function(){return eP},NextIntlContext:function(){return eD},NextIntlProvider:function(){return eR},registerApolloErrorViewerCallback:function(){return ed},showGlobalApolloError:function(){return ev},useApolloErrorViewer:function(){return es},useLoading:function(){return eO},useNextIntl:function(){return eT},useStorage:function(){return e_},useTranslateNextIntl:function(){return eV},withNextIntl:function(){return eU}});module.exports=G(Q);var R=require("@apollo/client"),F=require("@apollo/client/link/error"),z=require("@apollo/client/link/remove-typename"),J=require("@apollo/client/link/subscriptions"),B=require("@apollo/client/utilities"),H=require("graphql-ws"),W=require("react"),Z=require("react-hot-toast"),$=require("react-icons/fa6");var K="/graphql";var X=U(require("chalk"),1),Y=U(require("consola"),1),ee=require("graphql");var er=U(require("process"),1);var et=er.default.env.DEBUG==="true";et||(Y.default.level=4);function en(e){var r=X.default[e];return typeof r=="function"?r:X.default.green}var eo={silent:Y.default.silent,level:Y.default.level,fatal:Y.default.fatal,error:Y.default.error,warn:Y.default.warn,log:Y.default.log,info:Y.default.info,success:Y.default.success,ready:Y.default.ready,start:Y.default.start,box:Y.default.box,debug:Y.default.debug,trace:Y.default.trace,verbose:Y.default.verbose,printBoxedLog:function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(r===null||r===void 0?void 0:r.length)){Y.default.box(X.default.green(e));return}r.forEach(function(e){var r=e.file,n=e.position,o=e.rule,i=e.message;Y.default.log("".concat(X.default.gray("File:")," ").concat(X.default.blue("".concat(r).concat(n?":".concat(n):"")))),o&&Y.default.log(" ".concat(en(t)("Rule:")," ").concat(o)),Y.default.log(" ".concat(en(t)("Message:")," ").concat(i))}),Y.default.box(en(t)("".concat(e," : ").concat(r.length))),Y.default.log(X.default.gray("─".repeat(40)))}};var ei=require("react"),ea=require("react-icons/fa6"),eu=U(require("./apollo-error.module.scss"),1),el=require("react/jsx-runtime"),ec=(0,ei.createContext)(void 0);function es(){var e=(0,ei.use)(ec);if(!e)throw new Error("useApolloErrorViewer must be used within ApolloErrorViewerProvider");return e}var ef=null;function ed(e){ef=e}function ev(e){ef&&ef(e)}function ep(e){var r=e.children;var t=O((0,ei.useState)(null),2),n=t[0],o=t[1];(0,ei.useEffect)(function(){ed(o)},[]);var i=(0,ei.useMemo)(function(){return{error:n,showError:o,hideError:function(){return o(null)}}},[n]);return(0,el.jsx)(ec,{value:i,children:r})}function eg(){var e,r,t;var n=(0,ei.use)(ec);if(!n||!n.error)return null;var o=n.error,i=n.hideError;return(0,el.jsx)("div",{className:eu.default["modal-backdrop"],children:(0,el.jsxs)("div",{className:eu.default["modal-content"],children:[(0,el.jsx)("button",{type:"button",className:eu.default["btn-close"],onClick:i,children:"✕"}),(0,el.jsx)("div",{className:eu.default["error-title"],children:o.message}),(0,el.jsxs)("div",{className:eu.default["error-details"],children:[o.networkError&&(0,el.jsxs)("pre",{className:"network",children:[(0,el.jsx)("strong",{children:"Network Error:"}),"\xa0",o.networkError.message]}),((e=o.graphQLErrors)===null||e===void 0?void 0:e.length)>0&&(0,el.jsxs)("div",{children:[(0,el.jsx)("strong",{children:"GraphQL Errors:"}),(0,el.jsx)("ul",{children:o.graphQLErrors.map(function(e){return(0,el.jsx)("li",{children:e.message},e.message)})})]}),((r=o.protocolErrors)===null||r===void 0?void 0:r.length)>0&&(0,el.jsxs)("div",{children:[(0,el.jsx)("strong",{children:"Protocol Errors:"}),(0,el.jsx)("ul",{children:o.protocolErrors.map(function(e){return(0,el.jsx)("li",{children:e.message},e.message)})})]}),((t=o.clientErrors)===null||t===void 0?void 0:t.length)>0&&(0,el.jsxs)("div",{children:[(0,el.jsx)("strong",{children:"Client Errors:"}),(0,el.jsx)("ul",{children:o.clientErrors.map(function(e){return(0,el.jsx)("li",{children:e.message},e.message)})})]}),o.extraInfo&&(0,el.jsxs)("pre",{className:"extra",children:[(0,el.jsx)("strong",{children:"Extra Info:"}),"\xa0",JSON.stringify(o.extraInfo,null,4)]})]}),(0,el.jsx)("button",{type:"button",className:eu.default["btn-retry"],onClick:function(){return window.location.reload()},children:(0,el.jsx)(ea.FaRepeat,{})})]})})}var eh=require("react/jsx-runtime"),em=/*#__PURE__*/function(e){d(r,e);function r(){u(this,r);var e;e=a(this,r,arguments);e.count=0;return e}c(r,[{key:"request",value:function e(e,r){var t=this;var n=Date.now();return this.count+=1,r(e).map(function(r){var o=Date.now()-n,i=e.operationName||"Unnamed";return eo.info("[Apollo] #".concat(t.count,": ").concat(i," (").concat(o,"ms)")),r})}}]);return r}(R.ApolloLink);function ey(e){var r=e||{},t=r.uri,n=r.wsUrl,o=r.customLinks,i=new em,a=(0,F.onError)(function(e){var r=e.graphQLErrors,t=e.networkError,n=e.protocolErrors,o=e.operation;var i=(o===null||o===void 0?void 0:o.operationName)||"Unknown";if(r&&r.forEach(function(e){var r=e.message,t=e.locations,n=e.path;eo.error("[GraphQL error] ".concat(i,": ").concat(r,", Location: ").concat(JSON.stringify(t),", Path: ").concat(n))}),n&&n.forEach(function(e){var r=e.message,t=e.extensions;eo.error("[Protocol error]: ".concat(r,", Extensions: ").concat(JSON.stringify(t)))}),t&&eo.error("[Network error]: ".concat(t)),r||n||t){var a,u;var l=(r===null||r===void 0?void 0:(a=r[0])===null||a===void 0?void 0:a.message)||(n===null||n===void 0?void 0:(u=n[0])===null||u===void 0?void 0:u.message)||(t===null||t===void 0?void 0:t.message)||"Unexpected error",c=new R.ApolloError({graphQLErrors:r||[],protocolErrors:n||[],clientErrors:[],networkError:t||null,errorMessage:l,extraInfo:{operation:o}});Z.toast.error(function(e){return(0,eh.jsxs)(eh.Fragment,{children:[l,"\xa0",(0,eh.jsx)($.FaQuestion,{onClick:function(){setTimeout(function(){ev(c)},0),Z.toast.dismiss(e.id)}})]})})}}),u=(0,z.removeTypenameFromVariables)();t||eo.warn('[Apollo] No GraphQL URI provided — using "'.concat(K,'" as default'));var l=new R.HttpLink({uri:t!==null&&t!==void 0?t:K,credentials:"include"}),c=n?new J.GraphQLWsLink((0,H.createClient)({url:n})):R.ApolloLink.empty(),s=v(c,R.ApolloLink)?(0,R.split)(function(e){var r=e.query;var t=(0,B.getMainDefinition)(r);return t.kind==="OperationDefinition"&&t.operation==="subscription"},c,l):l;return s===l&&n&&eo.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[i,a,u].concat(N(o!==null&&o!==void 0?o:[]),[s])}function eb(e){var r=e.isNextJS,t=e.options,n=e.children,o=e.client,i=e.provider,a=e.cache;var u=t||{},l=u.uri,c=u.wsUrl,s=u.customLinks,f=x(u,["uri","wsUrl","customLinks"]);if(typeof(o!==null&&o!==void 0?o:R.ApolloClient)!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var d=i||R.ApolloProvider,p=(0,W.useMemo)(function(){return(0,R.from)(ey({uri:l,wsUrl:c,customLinks:s}))},[l,c,s]),g=(0,W.useMemo)(function(){return new R.ApolloClient(y({link:p,cache:v(a,R.InMemoryCache)?a:new R.InMemoryCache},f))},[p,a,f]),h=r?(0,eh.jsx)(d,{makeClient:function(){return g},children:n}):(0,eh.jsx)(d,{client:g,children:n});return r?(0,eh.jsx)(d,{makeClient:function(){return g},children:n}):(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsxs)(ep,{children:[h,(0,eh.jsx)(eg,{})]}),(0,eh.jsx)(Z.Toaster,{position:"top-right"})]})}var ew=U(require("classnames"),1),ex=require("react"),ej=U(require("./loading.module.scss"),1),eE=require("react/jsx-runtime"),ek=(0,ex.createContext)(void 0);function eO(){var e=(0,ex.use)(ek);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}function eN(e){var r=e.full,t=r===void 0?!1:r,n=e.block,o=n===void 0?!1:n,i=e.className,a=i===void 0?"":i,u=e.message,l=u===void 0?"Loading":u,c=x(e,["full","block","className","message"]);function s(){return(0,eE.jsxs)("div",w(y({className:ej.default.container},c),{children:[(0,eE.jsx)("div",{className:ej.default.ring}),(0,eE.jsx)("div",{className:ej.default.ring}),(0,eE.jsx)("div",{className:ej.default.ring}),(0,eE.jsx)("div",{className:ej.default.ring}),l&&(0,eE.jsx)("div",{className:ej.default.message,children:l})]}))}return t?(0,eE.jsx)("div",{className:(0,ew.default)(ej.default.fullscreen,a),children:s()}):o?(0,eE.jsx)("div",{className:(0,ew.default)(ej.default.block,a),children:s()}):s()}function eP(e){var r=e.children;var t=O((0,ex.useState)(!1),2),n=t[0],o=t[1],i=O((0,ex.useState)(!1),2),a=i[0],u=i[1],l=(0,ex.useCallback)(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;o(!0),u(e)},[]),c=(0,ex.useCallback)(function(){o(!1),u(!1)},[]),s=(0,ex.useMemo)(function(){return{isLoading:n,isGlobalLoading:a,showLoading:l,hideLoading:c}},[n,a,l,c]);return(0,eE.jsx)(ek,{value:s,children:n?(0,eE.jsx)(eN,{full:a}):r})}var eS=require("next-intl"),eL=require("react");var eA=require("react");var eI={serialize:function(e){return JSON.stringify(e,function(e,r){return v(r,Date)?{__type:"Date",value:r.toISOString()}:r})},deserialize:function(e){return JSON.parse(e,function(e,r){return(r===null||r===void 0?void 0:r.__type)==="Date"?new Date(r.value):r})}};var eC=U(require("localforage"),1);var eq={get:function e(e){return i(function(){var r;return A(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,eC.default.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,(eo.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,r){return i(function(){var t;return A(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,eC.default.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();eo.error('[Storage:set] Error setting key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return i(function(){var r;return A(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,eC.default.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();eo.error('[Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return i(function(){var e,r;return A(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,eC.default.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,(eo.error("[Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};function e_(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:eI;var n=O((0,eA.useState)(r),2),o=n[0],a=n[1],u=O((0,eA.useState)(!1),2),l=u[0],c=u[1];(0,eA.useEffect)(function(){var n=!0;return i(function(){var o,i,u,l;return A(this,function(s){switch(s.label){case 0:s.trys.push([0,6,7,8]);return[4,eq.get(e)];case 1:o=s.sent();if(!n)return[3,5];if(!(o!==null))return[3,2];i=t.deserialize(o);a(i);return[3,5];case 2:if(!(r!==void 0))return[3,4];u=t.serialize(r);return[4,eq.set(e,u)];case 3:s.sent(),a(r);return[3,5];case 4:a(void 0);s.label=5;case 5:return[3,8];case 6:l=s.sent();eo.error('Error loading value for key "'.concat(e,'":'),l),n&&a(r);return[3,8];case 7:n&&c(!0);return[7];case 8:return[2]}})})(),function(){n=!1,c(!1)}},[e,r,t]),(0,eA.useEffect)(function(){if(!l)return;i(function(){var r,n;return A(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);if(!(o!==void 0))return[3,2];r=t.serialize(o);return[4,eq.set(e,r)];case 1:i.sent();i.label=2;case 2:return[3,4];case 3:n=i.sent();eo.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},[o,e,t,l]);var s=(0,eA.useCallback)(function(e){a(function(r){return typeof e=="function"?e(r):e})},[]),f=(0,eA.useCallback)(/*#__PURE__*/i(function(){var r;return A(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,eq.remove(e)];case 1:t.sent(),a(void 0);return[3,3];case 2:r=t.sent();eo.error('Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})}),[e]);return{value:o,set:s,remove:f}}var eM=require("react/jsx-runtime"),eD=(0,eL.createContext)(void 0);function eT(){var e=(0,eL.use)(eD);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}var eV=eS.useTranslations;function eU(e){var r=function(r){var t;var n=eT(),o=n.currentLanguage,i=r.messages,a=r.languages,u="en",l=i[(o===null||o===void 0?void 0:o.value)||u],c=(t=a.find(function(e){return e.value===(o===null||o===void 0?void 0:o.value)}))===null||t===void 0?void 0:t.timezone;return i?(0,eM.jsx)(eS.NextIntlClientProvider,{locale:(o===null||o===void 0?void 0:o.value)||u,messages:l,timeZone:c,children:(0,eM.jsx)(e,y({},r))}):(eo.warn("Missing messages for language: ".concat((o===null||o===void 0?void 0:o.value)||u)),null)};return r.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),r}function eG(e){var r=e.children;return(0,eM.jsx)(eM.Fragment,{children:r})}var eQ=eU(eG);function eR(e){var r=e.children,t=e.languages,n=e.messages;var o;var i=e_("lang",(o=t===null||t===void 0?void 0:t[0])!==null&&o!==void 0?o:{}),a=i.value,u=i.set,l=(0,eL.useMemo)(function(){return{languages:t,currentLanguage:a,setCurrentLanguage:u}},[t,u,a]);return(0,eM.jsx)(eD,{value:l,children:(0,eM.jsx)(eQ,{languages:t,messages:n,children:r})})}0&&(module.exports={ApolloErrorViewerModal:ApolloErrorViewerModal,ApolloErrorViewerProvider:ApolloErrorViewerProvider,ApolloProvider:ApolloProvider,Loading:Loading,LoadingContext:LoadingContext,LoadingProvider:LoadingProvider,NextIntlContext:NextIntlContext,NextIntlProvider:NextIntlProvider,registerApolloErrorViewerCallback:registerApolloErrorViewerCallback,showGlobalApolloError:showGlobalApolloError,useApolloErrorViewer:useApolloErrorViewer,useLoading:useLoading,useNextIntl:useNextIntl,useStorage:useStorage,useTranslateNextIntl:useTranslateNextIntl,withNextIntl:withNextIntl});
|
package/dist/react/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function r(r,e){if(e==null||e>r.length)e=r.length;for(var n=0,t=new Array(e);n<e;n++)t[n]=r[n];return t}function e(r){if(Array.isArray(r))return r}function n(e){if(Array.isArray(e))return r(e)}function t(r){if(r===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r}function o(r,e,n,t,o,i,a){try{var s=r[i](a);var l=s.value}catch(r){n(r);return}if(s.done){e(l)}else{Promise.resolve(l).then(t,o)}}function i(r){return function(){var e=this,n=arguments;return new Promise(function(t,i){var a=r.apply(e,n);function s(r){o(a,t,i,s,l,"next",r)}function l(r){o(a,t,i,s,l,"throw",r)}s(undefined)})}}function a(r,e,n){e=f(e);return O(r,L()?Reflect.construct(e,n||[],f(r).constructor):e.apply(r,n))}function s(r,e){if(!(r instanceof e)){throw new TypeError("Cannot call a class as a function")}}function l(r,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||false;t.configurable=true;if("value"in t)t.writable=true;Object.defineProperty(r,t.key,t)}}function u(r,e,n){if(e)l(r.prototype,e);if(n)l(r,n);return r}function c(r,e,n){if(e in r){Object.defineProperty(r,e,{value:n,enumerable:true,configurable:true,writable:true})}else{r[e]=n}return r}function f(r){f=Object.setPrototypeOf?Object.getPrototypeOf:function r(r){return r.__proto__||Object.getPrototypeOf(r)};return f(r)}function d(r,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function")}r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:true,configurable:true}});if(e)x(r,e)}function v(r,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](r)}else{return r instanceof e}}function p(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function m(r,e){var n=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(n==null)return;var t=[];var o=true;var i=false;var a,s;try{for(n=n.call(r);!(o=(a=n.next()).done);o=true){t.push(a.value);if(e&&t.length===e)break}}catch(r){i=true;s=r}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(i)throw s}}return t}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(r){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};var t=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){t=t.concat(Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))}t.forEach(function(e){c(r,e,n[e])})}return r}function b(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);if(e){t=t.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})}n.push.apply(n,t)}return n}function w(r,e){e=e!=null?e:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(r,Object.getOwnPropertyDescriptors(e))}else{b(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function E(r,e){if(r==null)return{};var n=k(r,e);var t,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(o=0;o<i.length;o++){t=i[o];if(e.indexOf(t)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(r,t))continue;n[t]=r[t]}}return n}function k(r,e){if(r==null)return{};var n={};var t=Object.keys(r);var o,i;for(i=0;i<t.length;i++){o=t[i];if(e.indexOf(o)>=0)continue;n[o]=r[o]}return n}function O(r,e){if(e&&(S(e)==="object"||typeof e==="function")){return e}return t(r)}function x(r,e){x=Object.setPrototypeOf||function r(r,e){r.__proto__=e;return r};return x(r,e)}function N(r,n){return e(r)||m(r,n)||P(r,n)||h()}function j(r){return n(r)||p(r)||P(r)||g()}function S(r){"@swc/helpers - typeof";return r&&typeof Symbol!=="undefined"&&r.constructor===Symbol?"symbol":typeof r}function P(e,n){if(!e)return;if(typeof e==="string")return r(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor)t=e.constructor.name;if(t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r(e,n)}function L(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(L=function(){return!!r})()}function I(r,e){var n,t,o,i,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),"throw":s(1),"return":s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(r){return function(e){return l([r,e])}}function l(i){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,t&&(o=i[0]&2?t["return"]:i[0]?t["throw"]||((o=t["return"])&&o.call(t),0):t.next)&&!(o=o.call(t,i[1])).done)return o;if(t=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:a.label++;return{value:i[1],done:false};case 5:a.label++;t=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=e.call(r,a)}catch(r){i=[6,r];t=0}finally{n=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}import{ApolloClient as A,ApolloError as C,ApolloLink as _,ApolloProvider as T,from as D,HttpLink as U,InMemoryCache as M,split as R}from"@apollo/client";import{onError as Q}from"@apollo/client/link/error";import{removeTypenameFromVariables as z}from"@apollo/client/link/remove-typename";import{GraphQLWsLink as G}from"@apollo/client/link/subscriptions";import{getMainDefinition as J}from"@apollo/client/utilities";import{createClient as V}from"graphql-ws";import{useMemo as q}from"react";import{toast as F,Toaster as H}from"react-hot-toast";import{FaQuestion as W}from"react-icons/fa6";var B="/graphql";import{createContext as X,use as Y,useEffect as Z,useMemo as $,useState as K}from"react";import rr from"./apollo-error.module.scss";import{jsx as re,jsxs as rn}from"react/jsx-runtime";var rt=X(void 0);function ro(){var r=Y(rt);if(!r)throw new Error("useApolloErrorViewer must be used within ApolloErrorViewerProvider");return r}var ri=null;function ra(r){ri=r}function rs(r){ri&&ri(r)}function rl(r){var e=r.children;var n=N(K(null),2),t=n[0],o=n[1];Z(function(){ra(o)},[]);var i=$(function(){return{error:t,showError:o,hideError:function(){return o(null)}}},[t]);return re(rt,{value:i,children:e})}function ru(){var r,e,n;var t=Y(rt);if(!t||!t.error)return null;var o=t.error,i=t.hideError;return re("div",{className:rr["modal-backdrop"],onClick:i,children:rn("div",{className:rr["modal-content"],children:[re("button",{type:"button",className:rr["btn-close"],onClick:i,children:"✕"}),re("div",{className:rr["error-title"],children:"\uD83D\uDEA8 Something went wrong"}),re("p",{className:rr["error-text"],children:"A problem occurred while communicating with the server."}),rn("div",{className:rr["error-details"],children:[rn("pre",{className:"main",children:[re("strong",{children:"Main Error:"})," ",o.message]}),o.networkError&&rn("pre",{className:"network",children:[re("strong",{children:"Network Error:"})," ",o.networkError.message]}),((r=o.graphQLErrors)===null||r===void 0?void 0:r.length)>0&&rn("div",{children:[re("strong",{children:"GraphQL Errors:"}),re("ul",{children:o.graphQLErrors.map(function(r){return re("li",{children:r.message},r.message)})})]}),((e=o.protocolErrors)===null||e===void 0?void 0:e.length)>0&&rn("div",{children:[re("strong",{children:"Protocol Errors:"}),re("ul",{children:o.protocolErrors.map(function(r){return re("li",{children:r.message},r.message)})})]}),((n=o.clientErrors)===null||n===void 0?void 0:n.length)>0&&rn("div",{children:[re("strong",{children:"Client Errors:"}),re("ul",{children:o.clientErrors.map(function(r){return re("li",{children:r.message},r.message)})})]}),o.extraInfo&&rn("pre",{className:"extra",children:[re("strong",{children:"Extra Info:"})," ",JSON.stringify(o.extraInfo,null,4)]})]}),re("button",{type:"button",className:rr["btn-retry"],onClick:function(){return window.location.reload()},children:"\uD83D\uDD04 Retry"})]})})}import{Fragment as rc,jsx as rf,jsxs as rd}from"react/jsx-runtime";var rv=/*#__PURE__*/function(r){"use strict";d(e,r);function e(){s(this,e);var r;r=a(this,e,arguments);r.count=0;return r}u(e,[{key:"request",value:function r(r,e){var n=this;var t=Date.now();return this.count+=1,e(r).map(function(e){var o=Date.now()-t,i=r.operationName||"Unnamed";return console.info("[Apollo] #".concat(n.count,": ").concat(i," (").concat(o,"ms)")),e})}}]);return e}(_);function rp(r){var e=r||{},n=e.uri,t=e.wsUrl,o=e.customLinks,i=new rv,a=Q(function(r){var e=r.graphQLErrors,n=r.networkError,t=r.protocolErrors,o=r.operation;var i=(o===null||o===void 0?void 0:o.operationName)||"Unknown";if(e&&e.forEach(function(r){var e=r.message,n=r.locations,t=r.path;console.error("[GraphQL error] ".concat(i,": ").concat(e,", Location: ").concat(JSON.stringify(n),", Path: ").concat(t))}),t&&t.forEach(function(r){var e=r.message,n=r.extensions;console.error("[Protocol error]: ".concat(e,", Extensions: ").concat(JSON.stringify(n)))}),n&&console.error("[Network error]: ".concat(n)),e||t||n){var a,s;var l=(e===null||e===void 0?void 0:(a=e[0])===null||a===void 0?void 0:a.message)||(t===null||t===void 0?void 0:(s=t[0])===null||s===void 0?void 0:s.message)||(n===null||n===void 0?void 0:n.message)||"Unexpected error",u=new C({graphQLErrors:e||[],protocolErrors:t||[],clientErrors:[],networkError:n||null,errorMessage:l,extraInfo:{operation:o}});F.error(function(r){return rd(rc,{children:[l,"\xa0",rf(W,{onClick:function(){setTimeout(function(){rs(u)},0),F.dismiss(r.id)}})]})})}}),s=z();n||console.warn('[Apollo] No GraphQL URI provided — using "'.concat(B,'" as default'));var l=new U({uri:n!==null&&n!==void 0?n:B,credentials:"include"});t||console.warn("[Apollo] No WebSocket URL provided — subscriptions will use HTTP only");var u=t?new G(V({url:t})):_.empty(),c=v(u,_)?R(function(r){var e=r.query;var n=J(e);return n.kind==="OperationDefinition"&&n.operation==="subscription"},u,l):l;return c===l&&t&&console.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[i,a,s].concat(j(o!==null&&o!==void 0?o:[]),[c])}function rm(r){var e=r.isNextJS,n=r.options,t=r.children,o=r.client,i=r.provider,a=r.cache;var s=n||{},l=s.uri,u=s.wsUrl,c=s.customLinks,f=E(s,["uri","wsUrl","customLinks"]);if(typeof(o!==null&&o!==void 0?o:A)!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var d=i||T,p=q(function(){return D(rp({uri:l,wsUrl:u,customLinks:c}))},[l,u,c]),m=q(function(){return new A(y({link:p,cache:v(a,M)?a:new M},f))},[p,a,f]),h=e?rf(d,{makeClient:function(){return m},children:t}):rf(d,{client:m,children:t});return e?rf(d,{makeClient:function(){return m},children:t}):rd(rc,{children:[rd(rl,{children:[h,rf(ru,{})]}),rf(H,{position:"top-right"})]})}import rh from"classnames";import{createContext as rg,use as ry,useCallback as rb,useMemo as rw,useState as rE}from"react";import rk from"./loading.module.scss";import{jsx as rO,jsxs as rx}from"react/jsx-runtime";var rN=rg(void 0);function rj(){var r=ry(rN);if(!r)throw new Error("useLoading must be used within a LoadingProvider");return r}function rS(r){var e=r.full,n=e===void 0?!1:e,t=r.block,o=t===void 0?!1:t,i=r.className,a=i===void 0?"":i,s=r.message,l=s===void 0?"Loading":s,u=E(r,["full","block","className","message"]);function c(){return rx("div",w(y({className:rk.container},u),{children:[rO("div",{className:rk.ring}),rO("div",{className:rk.ring}),rO("div",{className:rk.ring}),rO("div",{className:rk.ring}),l&&rO("div",{className:rk.message,children:l})]}))}return n?rO("div",{className:rh(rk.fullscreen,a),children:c()}):o?rO("div",{className:rh(rk.block,a),children:c()}):c()}function rP(r){var e=r.children;var n=N(rE(!1),2),t=n[0],o=n[1],i=N(rE(!1),2),a=i[0],s=i[1],l=rb(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;o(!0),s(r)},[]),u=rb(function(){o(!1),s(!1)},[]),c=rw(function(){return{isLoading:t,isGlobalLoading:a,showLoading:l,hideLoading:u}},[t,a,l,u]);return rO(rN,{value:c,children:t?rO(rS,{full:a}):e})}import{NextIntlClientProvider as rL,useTranslations as rI}from"next-intl";import{createContext as rA,use as rC,useMemo as r_}from"react";import{useCallback as rT,useEffect as rD,useState as rU}from"react";var rM={serialize:function(r){return JSON.stringify(r,function(r,e){return v(e,Date)?{__type:"Date",value:e.toISOString()}:e})},deserialize:function(r){return JSON.parse(r,function(r,e){return(e===null||e===void 0?void 0:e.__type)==="Date"?new Date(e.value):e})}};import rR from"localforage";var rQ={get:function r(r){return i(function(){var e;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rR.getItem(r)];case 1:return[2,n.sent()];case 2:e=n.sent();return[2,(console.error('❌ [Storage:get] Error getting key "'.concat(r,'":'),e),null)];case 3:return[2]}})})()},set:function r(r,e){return i(function(){var n;return I(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,rR.setItem(r,e)];case 1:t.sent();return[3,3];case 2:n=t.sent();console.error('❌ [Storage:set] Error setting key "'.concat(r,'":'),n);return[3,3];case 3:return[2]}})})()},remove:function r(r){return i(function(){var e;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rR.removeItem(r)];case 1:n.sent();return[3,3];case 2:e=n.sent();console.error('❌ [Storage:remove] Error removing key "'.concat(r,'":'),e);return[3,3];case 3:return[2]}})})()},keys:function r(){return i(function(){var r,e;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rR.keys()];case 1:return[2,(r=n.sent())!==null&&r!==void 0?r:[]];case 2:e=n.sent();return[2,(console.error("❌ [Storage:keys] Error getting keys:",e),[])];case 3:return[2]}})})()}};function rz(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:rM;var t=N(rU(e),2),o=t[0],a=t[1],s=N(rU(!1),2),l=s[0],u=s[1];rD(function(){var t=!0;return i(function(){var o,i,s,l;return I(this,function(c){switch(c.label){case 0:c.trys.push([0,6,7,8]);return[4,rQ.get(r)];case 1:o=c.sent();if(!t)return[3,5];if(!(o!==null))return[3,2];i=n.deserialize(o);a(i);return[3,5];case 2:if(!(e!==void 0))return[3,4];s=n.serialize(e);return[4,rQ.set(r,s)];case 3:c.sent(),a(e);return[3,5];case 4:a(void 0);c.label=5;case 5:return[3,8];case 6:l=c.sent();console.error('Error loading value for key "'.concat(r,'":'),l),t&&a(e);return[3,8];case 7:t&&u(!0);return[7];case 8:return[2]}})})(),function(){t=!1,u(!1)}},[r,e,n]),rD(function(){if(!l)return;i(function(){var e,t;return I(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);if(!(o!==void 0))return[3,2];e=n.serialize(o);return[4,rQ.set(r,e)];case 1:i.sent();i.label=2;case 2:return[3,4];case 3:t=i.sent();console.error('Error saving value for key "'.concat(r,'":'),t);return[3,4];case 4:return[2]}})})()},[o,r,n,l]);var c=rT(function(r){a(function(e){return typeof r=="function"?r(e):r})},[]),f=rT(/*#__PURE__*/i(function(){var e;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rQ.remove(r)];case 1:n.sent(),a(void 0);return[3,3];case 2:e=n.sent();console.error('Error removing key "'.concat(r,'":'),e);return[3,3];case 3:return[2]}})}),[r]);return{value:o,set:c,remove:f}}import{Fragment as rG,jsx as rJ}from"react/jsx-runtime";var rV=rA(void 0);function rq(){var r=rC(rV);if(!r)throw new Error("useNextIntl must be used within a NextIntlProvider");return r}var rF=rI;function rH(r){var e=function(e){var n;var t=rq(),o=t.currentLanguage,i=e.messages,a=e.languages,s="en",l=i[(o===null||o===void 0?void 0:o.value)||s],u=(n=a.find(function(r){return r.value===(o===null||o===void 0?void 0:o.value)}))===null||n===void 0?void 0:n.timezone;return i?rJ(rL,{locale:(o===null||o===void 0?void 0:o.value)||s,messages:l,timeZone:u,children:rJ(r,y({},e))}):(console.warn("Missing messages for language: ".concat((o===null||o===void 0?void 0:o.value)||s)),null)};return e.displayName="withNextIntl(".concat(r.displayName||r.name||"Component",")"),e}function rW(r){var e=r.children;return rJ(rG,{children:e})}var rB=rH(rW);function rX(r){var e=r.children,n=r.languages,t=r.messages;var o;var i=rz("lang",(o=n===null||n===void 0?void 0:n[0])!==null&&o!==void 0?o:{}),a=i.value,s=i.set,l=r_(function(){return{languages:n,currentLanguage:a,setCurrentLanguage:s}},[n,s,a]);return rJ(rV,{value:l,children:rJ(rB,{languages:n,messages:t,children:e})})}export{ru as ApolloErrorViewerModal,rl as ApolloErrorViewerProvider,rm as ApolloProvider,rS as Loading,rN as LoadingContext,rP as LoadingProvider,rV as NextIntlContext,rX as NextIntlProvider,ra as registerApolloErrorViewerCallback,rs as showGlobalApolloError,ro as useApolloErrorViewer,rj as useLoading,rq as useNextIntl,rz as useStorage,rF as useTranslateNextIntl,rH as withNextIntl};
|
|
1
|
+
function r(r,e){if(e==null||e>r.length)e=r.length;for(var n=0,t=new Array(e);n<e;n++)t[n]=r[n];return t}function e(r){if(Array.isArray(r))return r}function n(e){if(Array.isArray(e))return r(e)}function t(r){if(r===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return r}function o(r,e,n,t,o,a,i){try{var s=r[a](i);var l=s.value}catch(r){n(r);return}if(s.done){e(l)}else{Promise.resolve(l).then(t,o)}}function a(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var i=r.apply(e,n);function s(r){o(i,t,a,s,l,"next",r)}function l(r){o(i,t,a,s,l,"throw",r)}s(undefined)})}}function i(r,e,n){e=f(e);return O(r,L()?Reflect.construct(e,n||[],f(r).constructor):e.apply(r,n))}function s(r,e){if(!(r instanceof e)){throw new TypeError("Cannot call a class as a function")}}function l(r,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||false;t.configurable=true;if("value"in t)t.writable=true;Object.defineProperty(r,t.key,t)}}function u(r,e,n){if(e)l(r.prototype,e);if(n)l(r,n);return r}function c(r,e,n){if(e in r){Object.defineProperty(r,e,{value:n,enumerable:true,configurable:true,writable:true})}else{r[e]=n}return r}function f(r){f=Object.setPrototypeOf?Object.getPrototypeOf:function r(r){return r.__proto__||Object.getPrototypeOf(r)};return f(r)}function v(r,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function")}r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:true,configurable:true}});if(e)x(r,e)}function d(r,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](r)}else{return r instanceof e}}function p(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function m(r,e){var n=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(n==null)return;var t=[];var o=true;var a=false;var i,s;try{for(n=n.call(r);!(o=(i=n.next()).done);o=true){t.push(i.value);if(e&&t.length===e)break}}catch(r){a=true;s=r}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(a)throw s}}return t}function h(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(r){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};var t=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){t=t.concat(Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))}t.forEach(function(e){c(r,e,n[e])})}return r}function b(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);if(e){t=t.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})}n.push.apply(n,t)}return n}function w(r,e){e=e!=null?e:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(r,Object.getOwnPropertyDescriptors(e))}else{b(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function E(r,e){if(r==null)return{};var n=k(r,e);var t,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(o=0;o<a.length;o++){t=a[o];if(e.indexOf(t)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(r,t))continue;n[t]=r[t]}}return n}function k(r,e){if(r==null)return{};var n={};var t=Object.keys(r);var o,a;for(a=0;a<t.length;a++){o=t[a];if(e.indexOf(o)>=0)continue;n[o]=r[o]}return n}function O(r,e){if(e&&(S(e)==="object"||typeof e==="function")){return e}return t(r)}function x(r,e){x=Object.setPrototypeOf||function r(r,e){r.__proto__=e;return r};return x(r,e)}function j(r,n){return e(r)||m(r,n)||P(r,n)||h()}function N(r){return n(r)||p(r)||P(r)||g()}function S(r){"@swc/helpers - typeof";return r&&typeof Symbol!=="undefined"&&r.constructor===Symbol?"symbol":typeof r}function P(e,n){if(!e)return;if(typeof e==="string")return r(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor)t=e.constructor.name;if(t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r(e,n)}function L(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(r){}return(L=function(){return!!r})()}function I(r,e){var n,t,o,a,i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),"throw":s(1),"return":s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(r){return function(e){return l([r,e])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,t&&(o=a[0]&2?t["return"]:a[0]?t["throw"]||((o=t["return"])&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;if(t=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;t=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(a[0]===6&&i.label<o[1]){i.label=o[1];o=a;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(a);break}if(o[2])i.ops.pop();i.trys.pop();continue}a=e.call(r,i)}catch(r){a=[6,r];t=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}import{ApolloClient as C,ApolloError as A,ApolloLink as _,ApolloProvider as D,from as U,HttpLink as T,InMemoryCache as M,split as Q}from"@apollo/client";import{onError as G}from"@apollo/client/link/error";import{removeTypenameFromVariables as R}from"@apollo/client/link/remove-typename";import{GraphQLWsLink as V}from"@apollo/client/link/subscriptions";import{getMainDefinition as q}from"@apollo/client/utilities";import{createClient as z}from"graphql-ws";import{useMemo as F}from"react";import{toast as J,Toaster as B}from"react-hot-toast";import{FaQuestion as H}from"react-icons/fa6";var W="/graphql";import $ from"chalk";import K from"consola";import{GraphQLError as X}from"graphql";import Z from"node:process";var Y=Z.env.DEBUG==="true";Y||(K.level=4);function rr(r){var e=$[r];return typeof e=="function"?e:$.green}var re={silent:K.silent,level:K.level,fatal:K.fatal,error:K.error,warn:K.warn,log:K.log,info:K.info,success:K.success,ready:K.ready,start:K.start,box:K.box,debug:K.debug,trace:K.trace,verbose:K.verbose,printBoxedLog:function r(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(e===null||e===void 0?void 0:e.length)){K.box($.green(r));return}e.forEach(function(r){var e=r.file,t=r.position,o=r.rule,a=r.message;K.log("".concat($.gray("File:")," ").concat($.blue("".concat(e).concat(t?":".concat(t):"")))),o&&K.log(" ".concat(rr(n)("Rule:")," ").concat(o)),K.log(" ".concat(rr(n)("Message:")," ").concat(a))}),K.box(rr(n)("".concat(r," : ").concat(e.length))),K.log($.gray("─".repeat(40)))}};import{createContext as rn,use as rt,useEffect as ro,useMemo as ra,useState as ri}from"react";import{FaRepeat as rs}from"react-icons/fa6";import rl from"./apollo-error.module.scss";import{jsx as ru,jsxs as rc}from"react/jsx-runtime";var rf=rn(void 0);function rv(){var r=rt(rf);if(!r)throw new Error("useApolloErrorViewer must be used within ApolloErrorViewerProvider");return r}var rd=null;function rp(r){rd=r}function rm(r){rd&&rd(r)}function rh(r){var e=r.children;var n=j(ri(null),2),t=n[0],o=n[1];ro(function(){rp(o)},[]);var a=ra(function(){return{error:t,showError:o,hideError:function(){return o(null)}}},[t]);return ru(rf,{value:a,children:e})}function rg(){var r,e,n;var t=rt(rf);if(!t||!t.error)return null;var o=t.error,a=t.hideError;return ru("div",{className:rl["modal-backdrop"],children:rc("div",{className:rl["modal-content"],children:[ru("button",{type:"button",className:rl["btn-close"],onClick:a,children:"✕"}),ru("div",{className:rl["error-title"],children:o.message}),rc("div",{className:rl["error-details"],children:[o.networkError&&rc("pre",{className:"network",children:[ru("strong",{children:"Network Error:"}),"\xa0",o.networkError.message]}),((r=o.graphQLErrors)===null||r===void 0?void 0:r.length)>0&&rc("div",{children:[ru("strong",{children:"GraphQL Errors:"}),ru("ul",{children:o.graphQLErrors.map(function(r){return ru("li",{children:r.message},r.message)})})]}),((e=o.protocolErrors)===null||e===void 0?void 0:e.length)>0&&rc("div",{children:[ru("strong",{children:"Protocol Errors:"}),ru("ul",{children:o.protocolErrors.map(function(r){return ru("li",{children:r.message},r.message)})})]}),((n=o.clientErrors)===null||n===void 0?void 0:n.length)>0&&rc("div",{children:[ru("strong",{children:"Client Errors:"}),ru("ul",{children:o.clientErrors.map(function(r){return ru("li",{children:r.message},r.message)})})]}),o.extraInfo&&rc("pre",{className:"extra",children:[ru("strong",{children:"Extra Info:"}),"\xa0",JSON.stringify(o.extraInfo,null,4)]})]}),ru("button",{type:"button",className:rl["btn-retry"],onClick:function(){return window.location.reload()},children:ru(rs,{})})]})})}import{Fragment as ry,jsx as rb,jsxs as rw}from"react/jsx-runtime";var rE=/*#__PURE__*/function(r){"use strict";v(e,r);function e(){s(this,e);var r;r=i(this,e,arguments);r.count=0;return r}u(e,[{key:"request",value:function r(r,e){var n=this;var t=Date.now();return this.count+=1,e(r).map(function(e){var o=Date.now()-t,a=r.operationName||"Unnamed";return re.info("[Apollo] #".concat(n.count,": ").concat(a," (").concat(o,"ms)")),e})}}]);return e}(_);function rk(r){var e=r||{},n=e.uri,t=e.wsUrl,o=e.customLinks,a=new rE,i=G(function(r){var e=r.graphQLErrors,n=r.networkError,t=r.protocolErrors,o=r.operation;var a=(o===null||o===void 0?void 0:o.operationName)||"Unknown";if(e&&e.forEach(function(r){var e=r.message,n=r.locations,t=r.path;re.error("[GraphQL error] ".concat(a,": ").concat(e,", Location: ").concat(JSON.stringify(n),", Path: ").concat(t))}),t&&t.forEach(function(r){var e=r.message,n=r.extensions;re.error("[Protocol error]: ".concat(e,", Extensions: ").concat(JSON.stringify(n)))}),n&&re.error("[Network error]: ".concat(n)),e||t||n){var i,s;var l=(e===null||e===void 0?void 0:(i=e[0])===null||i===void 0?void 0:i.message)||(t===null||t===void 0?void 0:(s=t[0])===null||s===void 0?void 0:s.message)||(n===null||n===void 0?void 0:n.message)||"Unexpected error",u=new A({graphQLErrors:e||[],protocolErrors:t||[],clientErrors:[],networkError:n||null,errorMessage:l,extraInfo:{operation:o}});J.error(function(r){return rw(ry,{children:[l,"\xa0",rb(H,{onClick:function(){setTimeout(function(){rm(u)},0),J.dismiss(r.id)}})]})})}}),s=R();n||re.warn('[Apollo] No GraphQL URI provided — using "'.concat(W,'" as default'));var l=new T({uri:n!==null&&n!==void 0?n:W,credentials:"include"}),u=t?new V(z({url:t})):_.empty(),c=d(u,_)?Q(function(r){var e=r.query;var n=q(e);return n.kind==="OperationDefinition"&&n.operation==="subscription"},u,l):l;return c===l&&t&&re.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[a,i,s].concat(N(o!==null&&o!==void 0?o:[]),[c])}function rO(r){var e=r.isNextJS,n=r.options,t=r.children,o=r.client,a=r.provider,i=r.cache;var s=n||{},l=s.uri,u=s.wsUrl,c=s.customLinks,f=E(s,["uri","wsUrl","customLinks"]);if(typeof(o!==null&&o!==void 0?o:C)!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var v=a||D,p=F(function(){return U(rk({uri:l,wsUrl:u,customLinks:c}))},[l,u,c]),m=F(function(){return new C(y({link:p,cache:d(i,M)?i:new M},f))},[p,i,f]),h=e?rb(v,{makeClient:function(){return m},children:t}):rb(v,{client:m,children:t});return e?rb(v,{makeClient:function(){return m},children:t}):rw(ry,{children:[rw(rh,{children:[h,rb(rg,{})]}),rb(B,{position:"top-right"})]})}import rx from"classnames";import{createContext as rj,use as rN,useCallback as rS,useMemo as rP,useState as rL}from"react";import rI from"./loading.module.scss";import{jsx as rC,jsxs as rA}from"react/jsx-runtime";var r_=rj(void 0);function rD(){var r=rN(r_);if(!r)throw new Error("useLoading must be used within a LoadingProvider");return r}function rU(r){var e=r.full,n=e===void 0?!1:e,t=r.block,o=t===void 0?!1:t,a=r.className,i=a===void 0?"":a,s=r.message,l=s===void 0?"Loading":s,u=E(r,["full","block","className","message"]);function c(){return rA("div",w(y({className:rI.container},u),{children:[rC("div",{className:rI.ring}),rC("div",{className:rI.ring}),rC("div",{className:rI.ring}),rC("div",{className:rI.ring}),l&&rC("div",{className:rI.message,children:l})]}))}return n?rC("div",{className:rx(rI.fullscreen,i),children:c()}):o?rC("div",{className:rx(rI.block,i),children:c()}):c()}function rT(r){var e=r.children;var n=j(rL(!1),2),t=n[0],o=n[1],a=j(rL(!1),2),i=a[0],s=a[1],l=rS(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;o(!0),s(r)},[]),u=rS(function(){o(!1),s(!1)},[]),c=rP(function(){return{isLoading:t,isGlobalLoading:i,showLoading:l,hideLoading:u}},[t,i,l,u]);return rC(r_,{value:c,children:t?rC(rU,{full:i}):e})}import{NextIntlClientProvider as rM,useTranslations as rQ}from"next-intl";import{createContext as rG,use as rR,useMemo as rV}from"react";import{useCallback as rq,useEffect as rz,useState as rF}from"react";var rJ={serialize:function(r){return JSON.stringify(r,function(r,e){return d(e,Date)?{__type:"Date",value:e.toISOString()}:e})},deserialize:function(r){return JSON.parse(r,function(r,e){return(e===null||e===void 0?void 0:e.__type)==="Date"?new Date(e.value):e})}};import rB from"localforage";var rH={get:function r(r){return a(function(){var e;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rB.getItem(r)];case 1:return[2,n.sent()];case 2:e=n.sent();return[2,(re.error('[Storage:get] Error getting key "'.concat(r,'":'),e),null)];case 3:return[2]}})})()},set:function r(r,e){return a(function(){var n;return I(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,rB.setItem(r,e)];case 1:t.sent();return[3,3];case 2:n=t.sent();re.error('[Storage:set] Error setting key "'.concat(r,'":'),n);return[3,3];case 3:return[2]}})})()},remove:function r(r){return a(function(){var e;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rB.removeItem(r)];case 1:n.sent();return[3,3];case 2:e=n.sent();re.error('[Storage:remove] Error removing key "'.concat(r,'":'),e);return[3,3];case 3:return[2]}})})()},keys:function r(){return a(function(){var r,e;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rB.keys()];case 1:return[2,(r=n.sent())!==null&&r!==void 0?r:[]];case 2:e=n.sent();return[2,(re.error("[Storage:keys] Error getting keys:",e),[])];case 3:return[2]}})})()}};function rW(r,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:rJ;var t=j(rF(e),2),o=t[0],i=t[1],s=j(rF(!1),2),l=s[0],u=s[1];rz(function(){var t=!0;return a(function(){var o,a,s,l;return I(this,function(c){switch(c.label){case 0:c.trys.push([0,6,7,8]);return[4,rH.get(r)];case 1:o=c.sent();if(!t)return[3,5];if(!(o!==null))return[3,2];a=n.deserialize(o);i(a);return[3,5];case 2:if(!(e!==void 0))return[3,4];s=n.serialize(e);return[4,rH.set(r,s)];case 3:c.sent(),i(e);return[3,5];case 4:i(void 0);c.label=5;case 5:return[3,8];case 6:l=c.sent();re.error('Error loading value for key "'.concat(r,'":'),l),t&&i(e);return[3,8];case 7:t&&u(!0);return[7];case 8:return[2]}})})(),function(){t=!1,u(!1)}},[r,e,n]),rz(function(){if(!l)return;a(function(){var e,t;return I(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);if(!(o!==void 0))return[3,2];e=n.serialize(o);return[4,rH.set(r,e)];case 1:a.sent();a.label=2;case 2:return[3,4];case 3:t=a.sent();re.error('Error saving value for key "'.concat(r,'":'),t);return[3,4];case 4:return[2]}})})()},[o,r,n,l]);var c=rq(function(r){i(function(e){return typeof r=="function"?r(e):r})},[]),f=rq(/*#__PURE__*/a(function(){var e;return I(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,rH.remove(r)];case 1:n.sent(),i(void 0);return[3,3];case 2:e=n.sent();re.error('Error removing key "'.concat(r,'":'),e);return[3,3];case 3:return[2]}})}),[r]);return{value:o,set:c,remove:f}}import{Fragment as r$,jsx as rK}from"react/jsx-runtime";var rX=rG(void 0);function rZ(){var r=rR(rX);if(!r)throw new Error("useNextIntl must be used within a NextIntlProvider");return r}var rY=rQ;function r0(r){var e=function(e){var n;var t=rZ(),o=t.currentLanguage,a=e.messages,i=e.languages,s="en",l=a[(o===null||o===void 0?void 0:o.value)||s],u=(n=i.find(function(r){return r.value===(o===null||o===void 0?void 0:o.value)}))===null||n===void 0?void 0:n.timezone;return a?rK(rM,{locale:(o===null||o===void 0?void 0:o.value)||s,messages:l,timeZone:u,children:rK(r,y({},e))}):(re.warn("Missing messages for language: ".concat((o===null||o===void 0?void 0:o.value)||s)),null)};return e.displayName="withNextIntl(".concat(r.displayName||r.name||"Component",")"),e}function r2(r){var e=r.children;return rK(r$,{children:e})}var r1=r0(r2);function r3(r){var e=r.children,n=r.languages,t=r.messages;var o;var a=rW("lang",(o=n===null||n===void 0?void 0:n[0])!==null&&o!==void 0?o:{}),i=a.value,s=a.set,l=rV(function(){return{languages:n,currentLanguage:i,setCurrentLanguage:s}},[n,s,i]);return rK(rX,{value:l,children:rK(r1,{languages:n,messages:t,children:e})})}export{rg as ApolloErrorViewerModal,rh as ApolloErrorViewerProvider,rO as ApolloProvider,rU as Loading,r_ as LoadingContext,rT as LoadingProvider,rX as NextIntlContext,r3 as NextIntlProvider,rp as registerApolloErrorViewerCallback,rm as showGlobalApolloError,rv as useApolloErrorViewer,rD as useLoading,rZ as useNextIntl,rW as useStorage,rY as useTranslateNextIntl,r0 as withNextIntl};
|
package/dist/react/next-intl.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(e,r,t,n,u,o
|
|
1
|
+
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(e,r,t,n,u,a,o){try{var l=e[a](o);var i=l.value}catch(e){t(e);return}if(l.done){r(i)}else{Promise.resolve(i).then(n,u)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(u,a){var o=e.apply(r,n);function l(e){t(o,u,a,l,i,"next",e)}function i(e){t(o,u,a,l,i,"throw",e)}l(undefined)})}}function u(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function a(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function o(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var u=true;var a=false;var o,l;try{for(t=t.call(e);!(u=(o=t.next()).done);u=true){n.push(o.value);if(r&&n.length===r)break}}catch(e){a=true;l=e}finally{try{if(!u&&t["return"]!=null)t["return"]()}finally{if(a)throw l}}return n}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){u(e,r,t[r])})}return e}function c(e,t){return r(e)||o(e,t)||f(e,t)||l()}function s(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function v(e,r){var t,n,u,a,o={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]};return a={next:l(0),"throw":l(1),"return":l(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(e){return function(r){return i([e,r])}}function i(a){if(t)throw new TypeError("Generator is already executing.");while(o)try{if(t=1,n&&(u=a[0]&2?n["return"]:a[0]?n["throw"]||((u=n["return"])&&u.call(n),0):n.next)&&!(u=u.call(n,a[1])).done)return u;if(n=0,u)a=[a[0]&2,u.value];switch(a[0]){case 0:case 1:u=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(u=o.trys,u=u.length>0&&u[u.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!u||a[1]>u[0]&&a[1]<u[3])){o.label=a[1];break}if(a[0]===6&&o.label<u[1]){o.label=u[1];u=a;break}if(u&&o.label<u[2]){o.label=u[2];o.ops.push(a);break}if(u[2])o.ops.pop();o.trys.pop();continue}a=r.call(e,o)}catch(e){a=[6,e];n=0}finally{t=u=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var d=Object.create;var y=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var m=function(e,r){for(var t in r)y(e,t,{get:r[t],enumerable:!0})},x=function(e,r,t,n){var u=true,a=false,o=undefined;if(r&&(typeof r==="undefined"?"undefined":s(r))=="object"||typeof r=="function")try{var l=function(){var u=c.value;!p.call(e,u)&&u!==t&&y(e,u,{get:function(){return r[u]},enumerable:!(n=g(r,u))||n.enumerable})};for(var i=b(r)[Symbol.iterator](),c;!(u=(c=i.next()).done);u=true)l()}catch(e){a=true;o=e}finally{try{if(!u&&i.return!=null){i.return()}}finally{if(a){throw o}}}return e};var w=function(e,r,t){return t=e!=null?d(h(e)):{},x(r||!e||!e.__esModule?y(t,"default",{value:e,enumerable:!0}):t,e)},I=function(e){return x(y({},"__esModule",{value:!0}),e)};var S={};m(S,{NextIntlContext:function(){return U},NextIntlProvider:function(){return Z},useNextIntl:function(){return B},useTranslateNextIntl:function(){return F},withNextIntl:function(){return G}});module.exports=I(S);var N=require("next-intl"),O=require("react");var j=w(require("chalk"),1),k=w(require("consola"),1),P=require("graphql");var E=w(require("process"),1);var _=E.default.env.DEBUG==="true";_||(k.default.level=4);function q(e){var r=j.default[e];return typeof r=="function"?r:j.default.green}var C={silent:k.default.silent,level:k.default.level,fatal:k.default.fatal,error:k.default.error,warn:k.default.warn,log:k.default.log,info:k.default.info,success:k.default.success,ready:k.default.ready,start:k.default.start,box:k.default.box,debug:k.default.debug,trace:k.default.trace,verbose:k.default.verbose,printBoxedLog:function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(r===null||r===void 0?void 0:r.length)){k.default.box(j.default.green(e));return}r.forEach(function(e){var r=e.file,n=e.position,u=e.rule,a=e.message;k.default.log("".concat(j.default.gray("File:")," ").concat(j.default.blue("".concat(r).concat(n?":".concat(n):"")))),u&&k.default.log(" ".concat(q(t)("Rule:")," ").concat(u)),k.default.log(" ".concat(q(t)("Message:")," ").concat(a))}),k.default.box(q(t)("".concat(e," : ").concat(r.length))),k.default.log(j.default.gray("─".repeat(40)))}};var D=require("react");var z={serialize:function(e){return JSON.stringify(e,function(e,r){return a(r,Date)?{__type:"Date",value:r.toISOString()}:r})},deserialize:function(e){return JSON.parse(e,function(e,r){return(r===null||r===void 0?void 0:r.__type)==="Date"?new Date(r.value):r})}};var A=w(require("localforage"),1);var M={get:function e(e){return n(function(){var r;return v(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,A.default.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,(C.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,r){return n(function(){var t;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,A.default.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();C.error('[Storage:set] Error setting key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return n(function(){var r;return v(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,A.default.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();C.error('[Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return n(function(){var e,r;return v(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,A.default.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,(C.error("[Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};function T(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:z;var u=c((0,D.useState)(r),2),a=u[0],o=u[1],l=c((0,D.useState)(!1),2),i=l[0],s=l[1];(0,D.useEffect)(function(){var u=!0;return n(function(){var n,a,l,i;return v(this,function(c){switch(c.label){case 0:c.trys.push([0,6,7,8]);return[4,M.get(e)];case 1:n=c.sent();if(!u)return[3,5];if(!(n!==null))return[3,2];a=t.deserialize(n);o(a);return[3,5];case 2:if(!(r!==void 0))return[3,4];l=t.serialize(r);return[4,M.set(e,l)];case 3:c.sent(),o(r);return[3,5];case 4:o(void 0);c.label=5;case 5:return[3,8];case 6:i=c.sent();C.error('Error loading value for key "'.concat(e,'":'),i),u&&o(r);return[3,8];case 7:u&&s(!0);return[7];case 8:return[2]}})})(),function(){u=!1,s(!1)}},[e,r,t]),(0,D.useEffect)(function(){if(!i)return;n(function(){var r,n;return v(this,function(u){switch(u.label){case 0:u.trys.push([0,3,,4]);if(!(a!==void 0))return[3,2];r=t.serialize(a);return[4,M.set(e,r)];case 1:u.sent();u.label=2;case 2:return[3,4];case 3:n=u.sent();C.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},[a,e,t,i]);var f=(0,D.useCallback)(function(e){o(function(r){return typeof e=="function"?e(r):e})},[]),d=(0,D.useCallback)(/*#__PURE__*/n(function(){var r;return v(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,M.remove(e)];case 1:t.sent(),o(void 0);return[3,3];case 2:r=t.sent();C.error('Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})}),[e]);return{value:a,set:f,remove:d}}var L=require("react/jsx-runtime"),U=(0,O.createContext)(void 0);function B(){var e=(0,O.use)(U);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}var F=N.useTranslations;function G(e){var r=function(r){var t;var n=B(),u=n.currentLanguage,a=r.messages,o=r.languages,l="en",c=a[(u===null||u===void 0?void 0:u.value)||l],s=(t=o.find(function(e){return e.value===(u===null||u===void 0?void 0:u.value)}))===null||t===void 0?void 0:t.timezone;return a?(0,L.jsx)(N.NextIntlClientProvider,{locale:(u===null||u===void 0?void 0:u.value)||l,messages:c,timeZone:s,children:(0,L.jsx)(e,i({},r))}):(C.warn("Missing messages for language: ".concat((u===null||u===void 0?void 0:u.value)||l)),null)};return r.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),r}function J(e){var r=e.children;return(0,L.jsx)(L.Fragment,{children:r})}var R=G(J);function Z(e){var r=e.children,t=e.languages,n=e.messages;var u;var a=T("lang",(u=t===null||t===void 0?void 0:t[0])!==null&&u!==void 0?u:{}),o=a.value,l=a.set,i=(0,O.useMemo)(function(){return{languages:t,currentLanguage:o,setCurrentLanguage:l}},[t,l,o]);return(0,L.jsx)(U,{value:i,children:(0,L.jsx)(R,{languages:t,messages:n,children:r})})}0&&(module.exports={NextIntlContext:NextIntlContext,NextIntlProvider:NextIntlProvider,useNextIntl:useNextIntl,useTranslateNextIntl:useTranslateNextIntl,withNextIntl:withNextIntl});
|
package/dist/react/next-intl.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(e,r,t,n,a,u
|
|
1
|
+
function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(e,r,t,n,a,o,u){try{var i=e[o](u);var s=i.value}catch(e){t(e);return}if(i.done){r(s)}else{Promise.resolve(s).then(n,a)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(a,o){var u=e.apply(r,n);function i(e){t(u,a,o,i,s,"next",e)}function s(e){t(u,a,o,i,s,"throw",e)}i(undefined)})}}function a(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function o(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function u(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var a=true;var o=false;var u,i;try{for(t=t.call(e);!(a=(u=t.next()).done);a=true){n.push(u.value);if(r&&n.length===r)break}}catch(e){o=true;i=e}finally{try{if(!a&&t["return"]!=null)t["return"]()}finally{if(o)throw i}}return n}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){a(e,r,t[r])})}return e}function c(e,t){return r(e)||u(e,t)||l(e,t)||i()}function l(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function f(e,r){var t,n,a,o,u={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]};return o={next:i(0),"throw":i(1),"return":i(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function i(e){return function(r){return s([e,r])}}function s(o){if(t)throw new TypeError("Generator is already executing.");while(u)try{if(t=1,n&&(a=o[0]&2?n["return"]:o[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;if(n=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:u.label++;return{value:o[1],done:false};case 5:u.label++;n=o[1];o=[0];continue;case 7:o=u.ops.pop();u.trys.pop();continue;default:if(!(a=u.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){u=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){u.label=o[1];break}if(o[0]===6&&u.label<a[1]){u.label=a[1];a=o;break}if(a&&u.label<a[2]){u.label=a[2];u.ops.push(o);break}if(a[2])u.ops.pop();u.trys.pop();continue}o=r.call(e,u)}catch(e){o=[6,e];n=0}finally{t=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}import{NextIntlClientProvider as v,useTranslations as g}from"next-intl";import{createContext as y,use as d,useMemo as h}from"react";import m from"chalk";import p from"consola";import{GraphQLError as b}from"graphql";import w from"node:process";var x=w.env.DEBUG==="true";x||(p.level=4);function S(e){var r=m[e];return typeof r=="function"?r:m.green}var I={silent:p.silent,level:p.level,fatal:p.fatal,error:p.error,warn:p.warn,log:p.log,info:p.info,success:p.success,ready:p.ready,start:p.start,box:p.box,debug:p.debug,trace:p.trace,verbose:p.verbose,printBoxedLog:function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(r===null||r===void 0?void 0:r.length)){p.box(m.green(e));return}r.forEach(function(e){var r=e.file,n=e.position,a=e.rule,o=e.message;p.log("".concat(m.gray("File:")," ").concat(m.blue("".concat(r).concat(n?":".concat(n):"")))),a&&p.log(" ".concat(S(t)("Rule:")," ").concat(a)),p.log(" ".concat(S(t)("Message:")," ").concat(o))}),p.box(S(t)("".concat(e," : ").concat(r.length))),p.log(m.gray("─".repeat(40)))}};import{useCallback as k,useEffect as E,useState as N}from"react";var O={serialize:function(e){return JSON.stringify(e,function(e,r){return o(r,Date)?{__type:"Date",value:r.toISOString()}:r})},deserialize:function(e){return JSON.parse(e,function(e,r){return(r===null||r===void 0?void 0:r.__type)==="Date"?new Date(r.value):r})}};import j from"localforage";var P={get:function e(e){return n(function(){var r;return f(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,j.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,(I.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,r){return n(function(){var t;return f(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,j.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();I.error('[Storage:set] Error setting key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return n(function(){var r;return f(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,j.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();I.error('[Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return n(function(){var e,r;return f(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,j.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,(I.error("[Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};function _(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:O;var a=c(N(r),2),o=a[0],u=a[1],i=c(N(!1),2),s=i[0],l=i[1];E(function(){var a=!0;return n(function(){var n,o,i,s;return f(this,function(c){switch(c.label){case 0:c.trys.push([0,6,7,8]);return[4,P.get(e)];case 1:n=c.sent();if(!a)return[3,5];if(!(n!==null))return[3,2];o=t.deserialize(n);u(o);return[3,5];case 2:if(!(r!==void 0))return[3,4];i=t.serialize(r);return[4,P.set(e,i)];case 3:c.sent(),u(r);return[3,5];case 4:u(void 0);c.label=5;case 5:return[3,8];case 6:s=c.sent();I.error('Error loading value for key "'.concat(e,'":'),s),a&&u(r);return[3,8];case 7:a&&l(!0);return[7];case 8:return[2]}})})(),function(){a=!1,l(!1)}},[e,r,t]),E(function(){if(!s)return;n(function(){var r,n;return f(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);if(!(o!==void 0))return[3,2];r=t.serialize(o);return[4,P.set(e,r)];case 1:a.sent();a.label=2;case 2:return[3,4];case 3:n=a.sent();I.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},[o,e,t,s]);var v=k(function(e){u(function(r){return typeof e=="function"?e(r):e})},[]),g=k(/*#__PURE__*/n(function(){var r;return f(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,P.remove(e)];case 1:t.sent(),u(void 0);return[3,3];case 2:r=t.sent();I.error('Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})}),[e]);return{value:o,set:v,remove:g}}import{Fragment as C,jsx as z}from"react/jsx-runtime";var A=y(void 0);function D(){var e=d(A);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}var L=g;function G(e){var r=function(r){var t;var n=D(),a=n.currentLanguage,o=r.messages,u=r.languages,i="en",c=o[(a===null||a===void 0?void 0:a.value)||i],l=(t=u.find(function(e){return e.value===(a===null||a===void 0?void 0:a.value)}))===null||t===void 0?void 0:t.timezone;return o?z(v,{locale:(a===null||a===void 0?void 0:a.value)||i,messages:c,timeZone:l,children:z(e,s({},r))}):(I.warn("Missing messages for language: ".concat((a===null||a===void 0?void 0:a.value)||i)),null)};return r.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),r}function M(e){var r=e.children;return z(C,{children:r})}var T=G(M);function U(e){var r=e.children,t=e.languages,n=e.messages;var a;var o=_("lang",(a=t===null||t===void 0?void 0:t[0])!==null&&a!==void 0?a:{}),u=o.value,i=o.set,s=h(function(){return{languages:t,currentLanguage:u,setCurrentLanguage:i}},[t,i,u]);return z(A,{value:s,children:z(T,{languages:t,messages:n,children:r})})}export{A as NextIntlContext,U as NextIntlProvider,D as useNextIntl,L as useTranslateNextIntl,G as withNextIntl};
|
package/dist/react/storage.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(e,r,t,n,u,o
|
|
1
|
+
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(e,r,t,n,u,a,o){try{var l=e[a](o);var c=l.value}catch(e){t(e);return}if(l.done){r(c)}else{Promise.resolve(c).then(n,u)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(u,a){var o=e.apply(r,n);function l(e){t(o,u,a,l,c,"next",e)}function c(e){t(o,u,a,l,c,"throw",e)}l(undefined)})}}function u(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function a(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var u=true;var a=false;var o,l;try{for(t=t.call(e);!(u=(o=t.next()).done);u=true){n.push(o.value);if(r&&n.length===r)break}}catch(e){a=true;l=e}finally{try{if(!u&&t["return"]!=null)t["return"]()}finally{if(a)throw l}}return n}function o(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e,t){return r(e)||a(e,t)||i(e,t)||o()}function c(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function i(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function s(e,r){var t,n,u,a,o={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]};return a={next:l(0),"throw":l(1),"return":l(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(e){return function(r){return c([e,r])}}function c(a){if(t)throw new TypeError("Generator is already executing.");while(o)try{if(t=1,n&&(u=a[0]&2?n["return"]:a[0]?n["throw"]||((u=n["return"])&&u.call(n),0):n.next)&&!(u=u.call(n,a[1])).done)return u;if(n=0,u)a=[a[0]&2,u.value];switch(a[0]){case 0:case 1:u=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(u=o.trys,u=u.length>0&&u[u.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!u||a[1]>u[0]&&a[1]<u[3])){o.label=a[1];break}if(a[0]===6&&o.label<u[1]){o.label=u[1];u=a;break}if(u&&o.label<u[2]){o.label=u[2];o.ops.push(a);break}if(u[2])o.ops.pop();o.trys.pop();continue}a=r.call(e,o)}catch(e){a=[6,e];n=0}finally{t=u=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var f=Object.create;var v=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var h=function(e,r){for(var t in r)v(e,t,{get:r[t],enumerable:!0})},g=function(e,r,t,n){var u=true,a=false,o=undefined;if(r&&(typeof r==="undefined"?"undefined":c(r))=="object"||typeof r=="function")try{var l=function(){var u=s.value;!p.call(e,u)&&u!==t&&v(e,u,{get:function(){return r[u]},enumerable:!(n=d(r,u))||n.enumerable})};for(var i=y(r)[Symbol.iterator](),s;!(u=(s=i.next()).done);u=true)l()}catch(e){a=true;o=e}finally{try{if(!u&&i.return!=null){i.return()}}finally{if(a){throw o}}}return e};var m=function(e,r,t){return t=e!=null?f(b(e)):{},g(r||!e||!e.__esModule?v(t,"default",{value:e,enumerable:!0}):t,e)},w=function(e){return g(v({},"__esModule",{value:!0}),e)};var S={};h(S,{useStorage:function(){return z}});module.exports=w(S);var k=require("react");var O=m(require("chalk"),1),E=m(require("consola"),1),x=require("graphql");var _=m(require("process"),1);var j=_.default.env.DEBUG==="true";j||(E.default.level=4);function I(e){var r=O.default[e];return typeof r=="function"?r:O.default.green}var P={silent:E.default.silent,level:E.default.level,fatal:E.default.fatal,error:E.default.error,warn:E.default.warn,log:E.default.log,info:E.default.info,success:E.default.success,ready:E.default.ready,start:E.default.start,box:E.default.box,debug:E.default.debug,trace:E.default.trace,verbose:E.default.verbose,printBoxedLog:function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(r===null||r===void 0?void 0:r.length)){E.default.box(O.default.green(e));return}r.forEach(function(e){var r=e.file,n=e.position,u=e.rule,a=e.message;E.default.log("".concat(O.default.gray("File:")," ").concat(O.default.blue("".concat(r).concat(n?":".concat(n):"")))),u&&E.default.log(" ".concat(I(t)("Rule:")," ").concat(u)),E.default.log(" ".concat(I(t)("Message:")," ").concat(a))}),E.default.box(I(t)("".concat(e," : ").concat(r.length))),E.default.log(O.default.gray("─".repeat(40)))}};var q={serialize:function(e){return JSON.stringify(e,function(e,r){return u(r,Date)?{__type:"Date",value:r.toISOString()}:r})},deserialize:function(e){return JSON.parse(e,function(e,r){return(r===null||r===void 0?void 0:r.__type)==="Date"?new Date(r.value):r})}};var A=m(require("localforage"),1);var D={get:function e(e){return n(function(){var r;return s(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,A.default.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,(P.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,r){return n(function(){var t;return s(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,A.default.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();P.error('[Storage:set] Error setting key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return n(function(){var r;return s(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,A.default.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();P.error('[Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return n(function(){var e,r;return s(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,A.default.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,(P.error("[Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};function z(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:q;var u=l((0,k.useState)(r),2),a=u[0],o=u[1],c=l((0,k.useState)(!1),2),i=c[0],f=c[1];(0,k.useEffect)(function(){var u=!0;return n(function(){var n,a,l,c;return s(this,function(i){switch(i.label){case 0:i.trys.push([0,6,7,8]);return[4,D.get(e)];case 1:n=i.sent();if(!u)return[3,5];if(!(n!==null))return[3,2];a=t.deserialize(n);o(a);return[3,5];case 2:if(!(r!==void 0))return[3,4];l=t.serialize(r);return[4,D.set(e,l)];case 3:i.sent(),o(r);return[3,5];case 4:o(void 0);i.label=5;case 5:return[3,8];case 6:c=i.sent();P.error('Error loading value for key "'.concat(e,'":'),c),u&&o(r);return[3,8];case 7:u&&f(!0);return[7];case 8:return[2]}})})(),function(){u=!1,f(!1)}},[e,r,t]),(0,k.useEffect)(function(){if(!i)return;n(function(){var r,n;return s(this,function(u){switch(u.label){case 0:u.trys.push([0,3,,4]);if(!(a!==void 0))return[3,2];r=t.serialize(a);return[4,D.set(e,r)];case 1:u.sent();u.label=2;case 2:return[3,4];case 3:n=u.sent();P.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},[a,e,t,i]);var v=(0,k.useCallback)(function(e){o(function(r){return typeof e=="function"?e(r):e})},[]),d=(0,k.useCallback)(/*#__PURE__*/n(function(){var r;return s(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,D.remove(e)];case 1:t.sent(),o(void 0);return[3,3];case 2:r=t.sent();P.error('Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})}),[e]);return{value:a,set:v,remove:d}}0&&(module.exports={useStorage:useStorage});
|
package/dist/react/storage.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(r){if(Array.isArray(r))return r}function t(r,e,t,n,o,a,u){try{var c=r[a](u);var i=c.value}catch(r){t(r);return}if(c.done){e(i)}else{Promise.resolve(i).then(n,o)}}function n(r){return function(){var e=this,n=arguments;return new Promise(function(o,a){var u=r.apply(e,n);function c(r){t(u,o,a,c,i,"next",r)}function i(r){t(u,o,a,c,i,"throw",r)}c(undefined)})}}function o(r,e){if(e!=null&&typeof Symbol!=="undefined"&&e[Symbol.hasInstance]){return!!e[Symbol.hasInstance](r)}else{return r instanceof e}}function a(r,e){var t=r==null?null:typeof Symbol!=="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(t==null)return;var n=[];var o=true;var a=false;var u,c;try{for(t=t.call(r);!(o=(u=t.next()).done);o=true){n.push(u.value);if(e&&n.length===e)break}}catch(r){a=true;c=r}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(a)throw c}}return n}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(r,t){return e(r)||a(r,t)||i(r,t)||u()}function i(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}function s(r,e){var t,n,o,a,u={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),"throw":c(1),"return":c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(r){return function(e){return i([r,e])}}function i(a){if(t)throw new TypeError("Generator is already executing.");while(u)try{if(t=1,n&&(o=a[0]&2?n["return"]:a[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;if(n=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:u.label++;return{value:a[1],done:false};case 5:u.label++;n=a[1];a=[0];continue;case 7:a=u.ops.pop();u.trys.pop();continue;default:if(!(o=u.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){u=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(a[0]===6&&u.label<o[1]){u.label=o[1];o=a;break}if(o&&u.label<o[2]){u.label=o[2];u.ops.push(a);break}if(o[2])u.ops.pop();u.trys.pop();continue}a=e.call(r,u)}catch(r){a=[6,r];n=0}finally{t=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}import{useCallback as l,useEffect as f,useState as v}from"react";import y from"chalk";import h from"consola";import{GraphQLError as p}from"graphql";import g from"node:process";var b=g.env.DEBUG==="true";b||(h.level=4);function d(r){var e=y[r];return typeof e=="function"?e:y.green}var m={silent:h.silent,level:h.level,fatal:h.fatal,error:h.error,warn:h.warn,log:h.log,info:h.info,success:h.success,ready:h.ready,start:h.start,box:h.box,debug:h.debug,trace:h.trace,verbose:h.verbose,printBoxedLog:function r(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(e===null||e===void 0?void 0:e.length)){h.box(y.green(r));return}e.forEach(function(r){var e=r.file,n=r.position,o=r.rule,a=r.message;h.log("".concat(y.gray("File:")," ").concat(y.blue("".concat(e).concat(n?":".concat(n):"")))),o&&h.log(" ".concat(d(t)("Rule:")," ").concat(o)),h.log(" ".concat(d(t)("Message:")," ").concat(a))}),h.box(d(t)("".concat(r," : ").concat(e.length))),h.log(y.gray("─".repeat(40)))}};var w={serialize:function(r){return JSON.stringify(r,function(r,e){return o(e,Date)?{__type:"Date",value:e.toISOString()}:e})},deserialize:function(r){return JSON.parse(r,function(r,e){return(e===null||e===void 0?void 0:e.__type)==="Date"?new Date(e.value):e})}};import S from"localforage";var k={get:function r(r){return n(function(){var e;return s(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,S.getItem(r)];case 1:return[2,t.sent()];case 2:e=t.sent();return[2,(m.error('[Storage:get] Error getting key "'.concat(r,'":'),e),null)];case 3:return[2]}})})()},set:function r(r,e){return n(function(){var t;return s(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,S.setItem(r,e)];case 1:n.sent();return[3,3];case 2:t=n.sent();m.error('[Storage:set] Error setting key "'.concat(r,'":'),t);return[3,3];case 3:return[2]}})})()},remove:function r(r){return n(function(){var e;return s(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,S.removeItem(r)];case 1:t.sent();return[3,3];case 2:e=t.sent();m.error('[Storage:remove] Error removing key "'.concat(r,'":'),e);return[3,3];case 3:return[2]}})})()},keys:function r(){return n(function(){var r,e;return s(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,S.keys()];case 1:return[2,(r=t.sent())!==null&&r!==void 0?r:[]];case 2:e=t.sent();return[2,(m.error("[Storage:keys] Error getting keys:",e),[])];case 3:return[2]}})})()}};function E(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:w;var o=c(v(e),2),a=o[0],u=o[1],i=c(v(!1),2),y=i[0],h=i[1];f(function(){var o=!0;return n(function(){var n,a,c,i;return s(this,function(s){switch(s.label){case 0:s.trys.push([0,6,7,8]);return[4,k.get(r)];case 1:n=s.sent();if(!o)return[3,5];if(!(n!==null))return[3,2];a=t.deserialize(n);u(a);return[3,5];case 2:if(!(e!==void 0))return[3,4];c=t.serialize(e);return[4,k.set(r,c)];case 3:s.sent(),u(e);return[3,5];case 4:u(void 0);s.label=5;case 5:return[3,8];case 6:i=s.sent();m.error('Error loading value for key "'.concat(r,'":'),i),o&&u(e);return[3,8];case 7:o&&h(!0);return[7];case 8:return[2]}})})(),function(){o=!1,h(!1)}},[r,e,t]),f(function(){if(!y)return;n(function(){var e,n;return s(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);if(!(a!==void 0))return[3,2];e=t.serialize(a);return[4,k.set(r,e)];case 1:o.sent();o.label=2;case 2:return[3,4];case 3:n=o.sent();m.error('Error saving value for key "'.concat(r,'":'),n);return[3,4];case 4:return[2]}})})()},[a,r,t,y]);var p=l(function(r){u(function(e){return typeof r=="function"?r(e):r})},[]),g=l(/*#__PURE__*/n(function(){var e;return s(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,k.remove(r)];case 1:t.sent(),u(void 0);return[3,3];case 2:e=t.sent();m.error('Error removing key "'.concat(r,'":'),e);return[3,3];case 3:return[2]}})}),[r]);return{value:a,set:p,remove:g}}export{E as useStorage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function
|
|
1
|
+
"use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var r=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var t=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var u=function(e,n){for(var t in n)r(e,t,{get:n[t],enumerable:!0})},a=function(u,a,f,i){var c=true,y=false,l=undefined;if(a&&(typeof a==="undefined"?"undefined":e(a))=="object"||typeof a=="function")try{var _=function(){var e=s.value;!o.call(u,e)&&e!==f&&r(u,e,{get:function(){return a[e]},enumerable:!(i=n(a,e))||i.enumerable})};for(var p=t(a)[Symbol.iterator](),s;!(c=(s=p.next()).done);c=true)_()}catch(e){y=true;l=e}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(y){throw l}}}return u};var f=function(e){return a(r({},"__esModule",{value:!0}),e)};var i={};u(i,{E_CommandType:function(){return y},E_IssueType:function(){return c}});module.exports=f(i);var c=function(e){return e.Error="error",e.Warning="warning",e}(c||{}),y=function(e){return e.PNPM_ADD_AND_EXEC="PNPM_ADD_AND_EXEC",e.PNPM_ADD_DEV_AND_EXEC="PNPM_ADD_DEV_AND_EXEC",e.RAW="RAW",e}(y||{});0&&(module.exports={E_CommandType:E_CommandType,E_IssueType:E_IssueType});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { E_IssueType_alias_1 as E_IssueType } from '../_tsup-dts-rollup.cjs';
|
|
2
|
+
export { I_IssueEntry_alias_1 as I_IssueEntry } from '../_tsup-dts-rollup.cjs';
|
|
3
3
|
export { I_EslintError_alias_1 as I_EslintError } from '../_tsup-dts-rollup.cjs';
|
|
4
|
-
export { I_BoxedLogOptions_alias_1 as I_BoxedLogOptions } from '../_tsup-dts-rollup.cjs';
|
|
5
4
|
export { I_CommandContext_alias_1 as I_CommandContext } from '../_tsup-dts-rollup.cjs';
|
|
6
5
|
export { I_Command_alias_1 as I_Command } from '../_tsup-dts-rollup.cjs';
|
|
7
6
|
export { T_CommandFunction_alias_1 as T_CommandFunction } from '../_tsup-dts-rollup.cjs';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { E_IssueType_alias_1 as E_IssueType } from '../_tsup-dts-rollup.js';
|
|
2
|
+
export { I_IssueEntry_alias_1 as I_IssueEntry } from '../_tsup-dts-rollup.js';
|
|
3
3
|
export { I_EslintError_alias_1 as I_EslintError } from '../_tsup-dts-rollup.js';
|
|
4
|
-
export { I_BoxedLogOptions_alias_1 as I_BoxedLogOptions } from '../_tsup-dts-rollup.js';
|
|
5
4
|
export { I_CommandContext_alias_1 as I_CommandContext } from '../_tsup-dts-rollup.js';
|
|
6
5
|
export { I_Command_alias_1 as I_Command } from '../_tsup-dts-rollup.js';
|
|
7
6
|
export { T_CommandFunction_alias_1 as T_CommandFunction } from '../_tsup-dts-rollup.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _=function(_){return _.Error="error",_.Warning="warning",_}(_||{}),r=function(_){return _.PNPM_ADD_AND_EXEC="PNPM_ADD_AND_EXEC",_.PNPM_ADD_DEV_AND_EXEC="PNPM_ADD_DEV_AND_EXEC",_.RAW="RAW",_}(r||{});export{r as E_CommandType,_ as E_IssueType};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function t(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function
|
|
1
|
+
"use strict";function t(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function e(t,e,n){e=r(e);return u(t,f()?Reflect.construct(e,n||[],r(t).constructor):e.apply(t,n))}function n(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function r(t){r=Object.setPrototypeOf?Object.getPrototypeOf:function t(t){return t.__proto__||Object.getPrototypeOf(t)};return r(t)}function o(t,e){if(typeof e!=="function"&&e!==null){throw new TypeError("Super expression must either be null or a function")}t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:true,configurable:true}});if(e)i(t,e)}function u(e,n){if(n&&(c(n)==="object"||typeof n==="function")){return n}return t(e)}function i(t,e){i=Object.setPrototypeOf||function t(t,e){t.__proto__=e;return t};return i(t,e)}function c(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function f(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(f=function(){return!!t})()}var _=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var p=function(t,e){for(var n in e)_(t,n,{get:e[n],enumerable:!0})},y=function(t,e,n,r){var o=true,u=false,i=undefined;if(e&&(typeof e==="undefined"?"undefined":c(e))=="object"||typeof e=="function")try{var f=function(){var o=y.value;!s.call(t,o)&&o!==n&&_(t,o,{get:function(){return e[o]},enumerable:!(r=a(e,o))||r.enumerable})};for(var p=l(e)[Symbol.iterator](),y;!(o=(y=p.next()).done);o=true)f()}catch(t){u=true;i=t}finally{try{if(!o&&p.return!=null){p.return()}}finally{if(u){throw i}}}return t};var E=function(t){return y(_({},"__esModule",{value:!0}),t)};var C={};p(C,{C_Collection:function(){return O},C_Db:function(){return T},C_Document:function(){return h},C_Model:function(){return P},E_CommandType:function(){return d},E_ConfigType:function(){return m},E_IssueType:function(){return b}});module.exports=E(C);var b=function(t){return t.Error="error",t.Warning="warning",t}(b||{}),d=function(t){return t.PNPM_ADD_AND_EXEC="PNPM_ADD_AND_EXEC",t.PNPM_ADD_DEV_AND_EXEC="PNPM_ADD_DEV_AND_EXEC",t.RAW="RAW",t}(d||{});var m=function(t){return t.ESLINT="eslint",t.COMMITLINT="commitlint",t.LINT_STAGED="lint-staged",t.VITEST_REACT_E2E="vitest-react-e2e",t.VITEST_REACT_UNIT="vitest-react-unit",t}(m||{});var D=require("mongodb"),v=require("mongoose"),T=/*#__PURE__*/function(t){o(r,t);function r(){n(this,r);return e(this,r,arguments)}return r}(D.Db),h=/*#__PURE__*/function(t){o(r,t);function r(){n(this,r);return e(this,r,arguments)}return r}(v.Document),P=/*#__PURE__*/function(t){o(r,t);function r(){n(this,r);return e(this,r,arguments)}return r}(v.Model),O=/*#__PURE__*/function(t){o(r,t);function r(){n(this,r);return e(this,r,arguments)}return r}(D.Collection);0&&(module.exports={C_Collection:C_Collection,C_Db:C_Db,C_Document:C_Document,C_Model:C_Model,E_CommandType:E_CommandType,E_ConfigType:E_ConfigType,E_IssueType:E_IssueType});
|
|
@@ -6,10 +6,9 @@ export { I_ApolloProviderProps_alias_2 as I_ApolloProviderProps } from '../_tsup
|
|
|
6
6
|
export { ApolloCache_alias_2 as ApolloCache } from '../_tsup-dts-rollup.cjs';
|
|
7
7
|
export { ApolloClient_alias_2 as ApolloClient } from '../_tsup-dts-rollup.cjs';
|
|
8
8
|
export { ApolloClientOptions_alias_2 as ApolloClientOptions } from '../_tsup-dts-rollup.cjs';
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
9
|
+
export { E_IssueType_alias_2 as E_IssueType } from '../_tsup-dts-rollup.cjs';
|
|
10
|
+
export { I_IssueEntry_alias_2 as I_IssueEntry } from '../_tsup-dts-rollup.cjs';
|
|
11
11
|
export { I_EslintError_alias_2 as I_EslintError } from '../_tsup-dts-rollup.cjs';
|
|
12
|
-
export { I_BoxedLogOptions_alias_2 as I_BoxedLogOptions } from '../_tsup-dts-rollup.cjs';
|
|
13
12
|
export { I_CommandContext_alias_2 as I_CommandContext } from '../_tsup-dts-rollup.cjs';
|
|
14
13
|
export { I_Command_alias_2 as I_Command } from '../_tsup-dts-rollup.cjs';
|
|
15
14
|
export { T_CommandFunction_alias_2 as T_CommandFunction } from '../_tsup-dts-rollup.cjs';
|
|
@@ -23,7 +22,8 @@ export { T_ConfigType_alias_2 as T_ConfigType } from '../_tsup-dts-rollup.cjs';
|
|
|
23
22
|
export { T_ConfigHandler_alias_2 as T_ConfigHandler } from '../_tsup-dts-rollup.cjs';
|
|
24
23
|
export { I_GraphqlCodegenConfig_alias_2 as I_GraphqlCodegenConfig } from '../_tsup-dts-rollup.cjs';
|
|
25
24
|
export { I_LoadingProps_alias_1 as I_LoadingProps } from '../_tsup-dts-rollup.cjs';
|
|
26
|
-
export {
|
|
25
|
+
export { T_ThrowError_alias_1 as T_ThrowError } from '../_tsup-dts-rollup.cjs';
|
|
26
|
+
export { I_Log_alias_1 as I_Log } from '../_tsup-dts-rollup.cjs';
|
|
27
27
|
export { C_Db_alias_1 as C_Db } from '../_tsup-dts-rollup.cjs';
|
|
28
28
|
export { T_Filter_alias_1 as T_Filter } from '../_tsup-dts-rollup.cjs';
|
|
29
29
|
export { T_InsertOneResult_alias_1 as T_InsertOneResult } from '../_tsup-dts-rollup.cjs';
|
|
@@ -6,10 +6,9 @@ export { I_ApolloProviderProps_alias_2 as I_ApolloProviderProps } from '../_tsup
|
|
|
6
6
|
export { ApolloCache_alias_2 as ApolloCache } from '../_tsup-dts-rollup.js';
|
|
7
7
|
export { ApolloClient_alias_2 as ApolloClient } from '../_tsup-dts-rollup.js';
|
|
8
8
|
export { ApolloClientOptions_alias_2 as ApolloClientOptions } from '../_tsup-dts-rollup.js';
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
9
|
+
export { E_IssueType_alias_2 as E_IssueType } from '../_tsup-dts-rollup.js';
|
|
10
|
+
export { I_IssueEntry_alias_2 as I_IssueEntry } from '../_tsup-dts-rollup.js';
|
|
11
11
|
export { I_EslintError_alias_2 as I_EslintError } from '../_tsup-dts-rollup.js';
|
|
12
|
-
export { I_BoxedLogOptions_alias_2 as I_BoxedLogOptions } from '../_tsup-dts-rollup.js';
|
|
13
12
|
export { I_CommandContext_alias_2 as I_CommandContext } from '../_tsup-dts-rollup.js';
|
|
14
13
|
export { I_Command_alias_2 as I_Command } from '../_tsup-dts-rollup.js';
|
|
15
14
|
export { T_CommandFunction_alias_2 as T_CommandFunction } from '../_tsup-dts-rollup.js';
|
|
@@ -23,7 +22,8 @@ export { T_ConfigType_alias_2 as T_ConfigType } from '../_tsup-dts-rollup.js';
|
|
|
23
22
|
export { T_ConfigHandler_alias_2 as T_ConfigHandler } from '../_tsup-dts-rollup.js';
|
|
24
23
|
export { I_GraphqlCodegenConfig_alias_2 as I_GraphqlCodegenConfig } from '../_tsup-dts-rollup.js';
|
|
25
24
|
export { I_LoadingProps_alias_1 as I_LoadingProps } from '../_tsup-dts-rollup.js';
|
|
26
|
-
export {
|
|
25
|
+
export { T_ThrowError_alias_1 as T_ThrowError } from '../_tsup-dts-rollup.js';
|
|
26
|
+
export { I_Log_alias_1 as I_Log } from '../_tsup-dts-rollup.js';
|
|
27
27
|
export { C_Db_alias_1 as C_Db } from '../_tsup-dts-rollup.js';
|
|
28
28
|
export { T_Filter_alias_1 as T_Filter } from '../_tsup-dts-rollup.js';
|
|
29
29
|
export { T_InsertOneResult_alias_1 as T_InsertOneResult } from '../_tsup-dts-rollup.js';
|
package/dist/typescript/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function n(t,n,
|
|
1
|
+
function t(t){if(t===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function n(t,n,e){n=r(n);return u(t,s()?Reflect.construct(n,e||[],r(t).constructor):n.apply(t,e))}function e(t,n){if(!(t instanceof n)){throw new TypeError("Cannot call a class as a function")}}function r(t){r=Object.setPrototypeOf?Object.getPrototypeOf:function t(t){return t.__proto__||Object.getPrototypeOf(t)};return r(t)}function o(t,n){if(typeof n!=="function"&&n!==null){throw new TypeError("Super expression must either be null or a function")}t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:true,configurable:true}});if(n)i(t,n)}function u(n,e){if(e&&(c(e)==="object"||typeof e==="function")){return e}return t(n)}function i(t,n){i=Object.setPrototypeOf||function t(t,n){t.__proto__=n;return t};return i(t,n)}function c(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(s=function(){return!!t})()}var f=function(t){return t.Error="error",t.Warning="warning",t}(f||{}),_=function(t){return t.PNPM_ADD_AND_EXEC="PNPM_ADD_AND_EXEC",t.PNPM_ADD_DEV_AND_EXEC="PNPM_ADD_DEV_AND_EXEC",t.RAW="RAW",t}(_||{});var a=function(t){return t.ESLINT="eslint",t.COMMITLINT="commitlint",t.LINT_STAGED="lint-staged",t.VITEST_REACT_E2E="vitest-react-e2e",t.VITEST_REACT_UNIT="vitest-react-unit",t}(a||{});import{Collection as l,Db as p}from"mongodb";import{Document as E,Model as y}from"mongoose";var D=/*#__PURE__*/function(t){"use strict";o(r,t);function r(){e(this,r);return n(this,r,arguments)}return r}(p),T=/*#__PURE__*/function(t){"use strict";o(r,t);function r(){e(this,r);return n(this,r,arguments)}return r}(E),b=/*#__PURE__*/function(t){"use strict";o(r,t);function r(){e(this,r);return n(this,r,arguments)}return r}(y),h=/*#__PURE__*/function(t){"use strict";o(r,t);function r(){e(this,r);return n(this,r,arguments)}return r}(l);export{h as C_Collection,D as C_Db,T as C_Document,b as C_Model,_ as E_CommandType,a as E_ConfigType,f as E_IssueType};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { T_ThrowError_alias_2 as T_ThrowError } from '../_tsup-dts-rollup.cjs';
|
|
2
|
+
export { I_Log_alias_2 as I_Log } from '../_tsup-dts-rollup.cjs';
|
package/dist/typescript/log.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { T_ThrowError_alias_2 as T_ThrowError } from '../_tsup-dts-rollup.js';
|
|
2
|
+
export { I_Log_alias_2 as I_Log } from '../_tsup-dts-rollup.js';
|