@obb871001/api-integration-sdk 1.0.27 → 1.0.29
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/index.cjs +10 -10
- package/dist/index.js +209 -212
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("@tanstack/react-query"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("@tanstack/react-query"),C=require("react"),pr=require("axios"),Z=C.createContext(null),je=()=>{const s=C.useContext(Z);if(!s)throw new Error("useApiContext must be used within ApiProvider");return s};function yr({baseURL:s,getToken:p,timeoutMs:R=15e3,currency:b="TWD",lng:m="tw",onError:w}={}){const v=pr.create({baseURL:s,timeout:R,headers:{"Content-Type":"application/json"}});return v.interceptors.request.use(async c=>{if(c.headers=c.headers||{},p){const f=await p();f&&(c.headers.Authorization=`Bearer ${f}`)}return c.headers.Currency=b,c.headers["currency-code"]=b,c.headers.lang=m,c}),v.interceptors.response.use(c=>c,c=>w?w(c,{instance:v}):Promise.reject(c)),v}const hr=()=>{const{client:s}=je(),p=C.useCallback(async v=>{const{mac_address:c="",app_version:f="",anydesk_id:P=""}=v,{data:y}=await s.post("/cash-register/login",{mac_address:c,app_version:f,anydesk_id:P});return y},[s]),R=C.useCallback(async()=>{if(!s)throw new Error("Axios client not available - make sure you are using ApiProvider");return s.get("/getMemberInfo")},[s]),b=C.useCallback(async()=>{const{data:v}=await s.get("/getGameList");return v},[s]),m=C.useCallback(async()=>{const{data:v}=await s.get("/getNowCurrencyExchange");return v},[s]),w=C.useCallback(async()=>{const{data:v}=await s.get("/getFavoriteGame");return v},[s]);return{machineLoginApi:p,userInfoApi:R,userGameListApi:b,userFavoriteGameApi:w,userCurrencyExchangeApi:m}},gr=()=>{const{userInfoApi:s}=hr(),p=H.useQueries({queries:[{queryKey:["getMemberInfo"],queryFn:async()=>await s(),refetchInterval:5e4}]}),{data:R,isFetching:b,error:m}=p[0]||{};return{data:R,isFetching:b,error:m}};var V={exports:{}},$={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Pe;function
|
|
9
|
+
*/var Pe;function br(){if(Pe)return $;Pe=1;var s=C,p=Symbol.for("react.element"),R=Symbol.for("react.fragment"),b=Object.prototype.hasOwnProperty,m=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w={key:!0,ref:!0,__self:!0,__source:!0};function v(c,f,P){var y,T={},x=null,Y=null;P!==void 0&&(x=""+P),f.key!==void 0&&(x=""+f.key),f.ref!==void 0&&(Y=f.ref);for(y in f)b.call(f,y)&&!w.hasOwnProperty(y)&&(T[y]=f[y]);if(c&&c.defaultProps)for(y in f=c.defaultProps,f)T[y]===void 0&&(T[y]=f[y]);return{$$typeof:p,type:c,key:x,ref:Y,props:T,_owner:m.current}}return $.Fragment=R,$.jsx=v,$.jsxs=v,$}var W={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Oe;function
|
|
18
|
-
`+J+e}}var B=!1,
|
|
19
|
-
`),
|
|
20
|
-
`),l=a.length-1,
|
|
21
|
-
`+a[l].replace(" at new "," at ");return e.displayName&&
|
|
17
|
+
*/var Oe;function Er(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&(function(){var s=C,p=Symbol.for("react.element"),R=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),ee=Symbol.iterator,ke="@@iterator";function Ae(e){if(e===null||typeof e!="object")return null;var r=ee&&e[ee]||e[ke];return typeof r=="function"?r:null}var k=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Fe("error",e,t)}}function Fe(e,r,t){{var n=k.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var u=t.map(function(i){return String(i)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var De=!1,Ie=!1,$e=!1,We=!1,Ye=!1,re;re=Symbol.for("react.module.reference");function Me(e){return!!(typeof e=="string"||typeof e=="function"||e===b||e===w||Ye||e===m||e===P||e===y||We||e===Y||De||Ie||$e||typeof e=="object"&&e!==null&&(e.$$typeof===x||e.$$typeof===T||e.$$typeof===v||e.$$typeof===c||e.$$typeof===f||e.$$typeof===re||e.getModuleId!==void 0))}function Le(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function te(e){return e.displayName||"Context"}function O(e){if(e==null)return null;if(typeof e.tag=="number"&&h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case b:return"Fragment";case R:return"Portal";case w:return"Profiler";case m:return"StrictMode";case P:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c:var r=e;return te(r)+".Consumer";case v:var t=e;return te(t._context)+".Provider";case f:return Le(e,e.render,"ForwardRef");case T:var n=e.displayName||null;return n!==null?n:O(e.type)||"Memo";case x:{var o=e,u=o._payload,i=o._init;try{return O(i(u))}catch{return null}}}return null}var S=Object.assign,D=0,ne,ae,ie,oe,ue,se,ce;function le(){}le.__reactDisabledLog=!0;function Ue(){{if(D===0){ne=console.log,ae=console.info,ie=console.warn,oe=console.error,ue=console.group,se=console.groupCollapsed,ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:le,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}D++}}function qe(){{if(D--,D===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:S({},e,{value:ne}),info:S({},e,{value:ae}),warn:S({},e,{value:ie}),error:S({},e,{value:oe}),group:S({},e,{value:ue}),groupCollapsed:S({},e,{value:se}),groupEnd:S({},e,{value:ce})})}D<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var N=k.ReactCurrentDispatcher,J;function M(e,r,t){{if(J===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);J=n&&n[1]||""}return`
|
|
18
|
+
`+J+e}}var B=!1,L;{var Ve=typeof WeakMap=="function"?WeakMap:Map;L=new Ve}function fe(e,r){if(!e||B)return"";{var t=L.get(e);if(t!==void 0)return t}var n;B=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=N.current,N.current=null,Ue();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(E){n=E}Reflect.construct(e,[],i)}else{try{i.call()}catch(E){n=E}e.call(i.prototype)}}else{try{throw Error()}catch(E){n=E}e()}}catch(E){if(E&&n&&typeof E.stack=="string"){for(var a=E.stack.split(`
|
|
19
|
+
`),g=n.stack.split(`
|
|
20
|
+
`),l=a.length-1,d=g.length-1;l>=1&&d>=0&&a[l]!==g[d];)d--;for(;l>=1&&d>=0;l--,d--)if(a[l]!==g[d]){if(l!==1||d!==1)do if(l--,d--,d<0||a[l]!==g[d]){var _=`
|
|
21
|
+
`+a[l].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,_),_}while(l>=1&&d>=0);break}}}finally{B=!1,N.current=u,qe(),Error.prepareStackTrace=o}var F=e?e.displayName||e.name:"",j=F?M(F):"";return typeof e=="function"&&L.set(e,j),j}function Ne(e,r,t){return fe(e,!1)}function Je(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function U(e,r,t){if(e==null)return"";if(typeof e=="function")return fe(e,Je(e));if(typeof e=="string")return M(e);switch(e){case P:return M("Suspense");case y:return M("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Ne(e.render);case T:return U(e.type,r,t);case x:{var n=e,o=n._payload,u=n._init;try{return U(u(o),r,t)}catch{}}}return""}var I=Object.prototype.hasOwnProperty,de={},ve=k.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);ve.setExtraStackFrame(t)}else ve.setExtraStackFrame(null)}function Be(e,r,t,n,o){{var u=Function.call.bind(I);for(var i in e)if(u(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var g=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw g.name="Invariant Violation",g}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(q(o),h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),q(null)),a instanceof Error&&!(a.message in de)&&(de[a.message]=!0,q(o),h("Failed %s type: %s",t,a.message),q(null))}}}var Ge=Array.isArray;function G(e){return Ge(e)}function Ke(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Qe(e){try{return pe(e),!1}catch{return!0}}function pe(e){return""+e}function ye(e){if(Qe(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ke(e)),pe(e)}var he=k.ReactCurrentOwner,ze={key:!0,ref:!0,__self:!0,__source:!0},ge,be;function Xe(e){if(I.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function He(e){if(I.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ze(e,r){typeof e.ref=="string"&&he.current}function er(e,r){{var t=function(){ge||(ge=!0,h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){be||(be=!0,h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,n,o,u,i){var a={$$typeof:p,type:e,key:r,ref:t,props:i,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nr(e,r,t,n,o){{var u,i={},a=null,g=null;t!==void 0&&(ye(t),a=""+t),He(r)&&(ye(r.key),a=""+r.key),Xe(r)&&(g=r.ref,Ze(r,o));for(u in r)I.call(r,u)&&!ze.hasOwnProperty(u)&&(i[u]=r[u]);if(e&&e.defaultProps){var l=e.defaultProps;for(u in l)i[u]===void 0&&(i[u]=l[u])}if(a||g){var d=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&er(i,d),g&&rr(i,d)}return tr(e,a,g,o,n,he.current,i)}}var K=k.ReactCurrentOwner,Ee=k.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var Q;Q=!1;function z(e){return typeof e=="object"&&e!==null&&e.$$typeof===p}function me(){{if(K.current){var e=O(K.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function ar(e){return""}var
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function ar(e){return""}var _e={};function ir(e){{var r=me();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+t+">.")}return r}}function Re(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ir(r);if(
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function Re(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ir(r);if(_e[t])return;_e[t]=!0;var n="";e&&e._owner&&e._owner!==K.current&&(n=" It was passed a child from "+O(e._owner.type)+"."),A(e),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),A(null)}}function Ce(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];z(n)&&Re(n,r)}else if(z(e))e._store&&(e._store.validated=!0);else if(e){var o=Ae(e);if(typeof o=="function"&&o!==e.entries)for(var u=o.call(e),i;!(i=u.next()).done;)z(i.value)&&Re(i.value,r)}}}function or(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===T))t=r.propTypes;else return;if(t){var n=O(r);Be(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Q){Q=!0;var o=O(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ur(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}var we={};function Te(e,r,t,n,o,u){{var i=Me(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var g=ar();g?a+=g:a+=me();var l;e===null?l="null":G(e)?l="array":e!==void 0&&e.$$typeof===p?(l="<"+(O(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var d=nr(e,r,t,o,u);if(d==null)return d;if(i){var _=r.children;if(_!==void 0)if(n)if(G(_)){for(var F=0;F<_.length;F++)Ce(_[F],e);Object.freeze&&Object.freeze(_)}else h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ce(_,e)}if(I.call(r,"key")){var j=O(e),E=Object.keys(r).filter(function(vr){return vr!=="key"}),X=E.length>0?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}";if(!we[j+X]){var dr=E.length>0?"{"+E.join(": ..., ")+": ...}":"{}";h(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,X,j,dr,j),
|
|
30
|
+
<%s key={someKey} {...props} />`,X,j,dr,j),we[j+X]=!0}}return e===b?ur(d):or(d),d}}function sr(e,r,t){return Te(e,r,t,!0)}function cr(e,r,t){return Te(e,r,t,!1)}var lr=cr,fr=sr;W.Fragment=b,W.jsx=lr,W.jsxs=fr})()),W}var xe;function mr(){return xe||(xe=1,process.env.NODE_ENV==="production"?V.exports=br():V.exports=Er()),V.exports}var Se=mr();function _r({children:s,...p}){const R=C.useMemo(()=>yr(p),[p]),m=C.useMemo(()=>new H.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),[]);return Se.jsx(H.QueryClientProvider,{client:m,children:Se.jsx(Z.Provider,{value:{client:R},children:s})})}exports.ApiCtx=Z;exports.ApiProvider=_r;exports.useApiContext=je;exports.usePeriodicDataUpdater=gr;
|
package/dist/index.js
CHANGED
|
@@ -1,56 +1,81 @@
|
|
|
1
|
-
import { useQueries as pr, QueryClient as yr, QueryClientProvider as
|
|
2
|
-
import Se, { createContext as
|
|
1
|
+
import { useQueries as pr, QueryClient as yr, QueryClientProvider as hr } from "@tanstack/react-query";
|
|
2
|
+
import Se, { createContext as gr, useContext as mr, useCallback as I, useMemo as we } from "react";
|
|
3
3
|
import br from "axios";
|
|
4
|
-
const je =
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
4
|
+
const je = gr(null), Er = () => {
|
|
5
|
+
const s = mr(je);
|
|
6
|
+
if (!s)
|
|
7
7
|
throw new Error("useApiContext must be used within ApiProvider");
|
|
8
|
-
return
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
return s;
|
|
9
|
+
};
|
|
10
|
+
function _r({
|
|
11
|
+
baseURL: s,
|
|
12
|
+
getToken: p,
|
|
13
|
+
timeoutMs: R = 15e3,
|
|
14
|
+
currency: m = "TWD",
|
|
15
|
+
lng: E = "tw",
|
|
16
|
+
onError: C
|
|
17
|
+
} = {}) {
|
|
18
|
+
const v = br.create({
|
|
19
|
+
baseURL: s,
|
|
20
|
+
timeout: R,
|
|
21
|
+
headers: { "Content-Type": "application/json" }
|
|
22
|
+
});
|
|
23
|
+
return v.interceptors.request.use(async (c) => {
|
|
24
|
+
if (c.headers = c.headers || {}, p) {
|
|
25
|
+
const f = await p();
|
|
26
|
+
f && (c.headers.Authorization = `Bearer ${f}`);
|
|
27
|
+
}
|
|
28
|
+
return c.headers.Currency = m, c.headers["currency-code"] = m, c.headers.lang = E, c;
|
|
29
|
+
}), v.interceptors.response.use(
|
|
30
|
+
(c) => c,
|
|
31
|
+
(c) => C ? C(c, { instance: v }) : Promise.reject(c)
|
|
32
|
+
), v;
|
|
33
|
+
}
|
|
34
|
+
const Rr = () => {
|
|
35
|
+
const { client: s } = Er(), p = I(
|
|
13
36
|
async (v) => {
|
|
14
|
-
const { mac_address:
|
|
15
|
-
mac_address:
|
|
16
|
-
app_version:
|
|
17
|
-
anydesk_id:
|
|
37
|
+
const { mac_address: c = "", app_version: f = "", anydesk_id: T = "" } = v, { data: y } = await s.post("/cash-register/login", {
|
|
38
|
+
mac_address: c,
|
|
39
|
+
app_version: f,
|
|
40
|
+
anydesk_id: T
|
|
18
41
|
});
|
|
19
42
|
return y;
|
|
20
43
|
},
|
|
21
|
-
[
|
|
22
|
-
),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
44
|
+
[s]
|
|
45
|
+
), R = I(async () => {
|
|
46
|
+
if (!s)
|
|
47
|
+
throw new Error(
|
|
48
|
+
"Axios client not available - make sure you are using ApiProvider"
|
|
49
|
+
);
|
|
50
|
+
return s.get("/getMemberInfo");
|
|
51
|
+
}, [s]), m = I(async () => {
|
|
52
|
+
const { data: v } = await s.get("/getGameList");
|
|
26
53
|
return v;
|
|
27
|
-
}, [
|
|
28
|
-
const { data: v } = await
|
|
54
|
+
}, [s]), E = I(async () => {
|
|
55
|
+
const { data: v } = await s.get("/getNowCurrencyExchange");
|
|
29
56
|
return v;
|
|
30
|
-
}, [
|
|
31
|
-
const { data: v } = await
|
|
57
|
+
}, [s]), C = I(async () => {
|
|
58
|
+
const { data: v } = await s.get("/getFavoriteGame");
|
|
32
59
|
return v;
|
|
33
|
-
}, [
|
|
60
|
+
}, [s]);
|
|
34
61
|
return {
|
|
35
|
-
machineLoginApi:
|
|
36
|
-
userInfoApi:
|
|
37
|
-
userGameListApi:
|
|
38
|
-
userFavoriteGameApi:
|
|
62
|
+
machineLoginApi: p,
|
|
63
|
+
userInfoApi: R,
|
|
64
|
+
userGameListApi: m,
|
|
65
|
+
userFavoriteGameApi: C,
|
|
39
66
|
userCurrencyExchangeApi: E
|
|
40
67
|
};
|
|
41
68
|
}, Sr = () => {
|
|
42
|
-
const { userInfoApi:
|
|
69
|
+
const { userInfoApi: s } = Rr(), p = pr({
|
|
43
70
|
queries: [
|
|
44
71
|
{
|
|
45
72
|
queryKey: ["getMemberInfo"],
|
|
46
|
-
queryFn: async () => await
|
|
73
|
+
queryFn: async () => await s(),
|
|
47
74
|
refetchInterval: 5e4
|
|
48
75
|
}
|
|
49
76
|
]
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const { data: _, isFetching: b, error: E } = d[0] || {};
|
|
53
|
-
return { data: _, isFetching: b, error: E };
|
|
77
|
+
}), { data: R, isFetching: m, error: E } = p[0] || {};
|
|
78
|
+
return { data: R, isFetching: m, error: E };
|
|
54
79
|
};
|
|
55
80
|
var q = { exports: {} }, $ = {};
|
|
56
81
|
/**
|
|
@@ -63,18 +88,18 @@ var q = { exports: {} }, $ = {};
|
|
|
63
88
|
* LICENSE file in the root directory of this source tree.
|
|
64
89
|
*/
|
|
65
90
|
var Te;
|
|
66
|
-
function
|
|
91
|
+
function Cr() {
|
|
67
92
|
if (Te) return $;
|
|
68
93
|
Te = 1;
|
|
69
|
-
var
|
|
70
|
-
function v(
|
|
94
|
+
var s = Se, p = Symbol.for("react.element"), R = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, E = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, C = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
95
|
+
function v(c, f, T) {
|
|
71
96
|
var y, w = {}, P = null, Y = null;
|
|
72
|
-
|
|
73
|
-
for (y in
|
|
74
|
-
if (
|
|
75
|
-
return { $$typeof:
|
|
97
|
+
T !== void 0 && (P = "" + T), f.key !== void 0 && (P = "" + f.key), f.ref !== void 0 && (Y = f.ref);
|
|
98
|
+
for (y in f) m.call(f, y) && !C.hasOwnProperty(y) && (w[y] = f[y]);
|
|
99
|
+
if (c && c.defaultProps) for (y in f = c.defaultProps, f) w[y] === void 0 && (w[y] = f[y]);
|
|
100
|
+
return { $$typeof: p, type: c, key: P, ref: Y, props: w, _owner: E.current };
|
|
76
101
|
}
|
|
77
|
-
return $.Fragment =
|
|
102
|
+
return $.Fragment = R, $.jsx = v, $.jsxs = v, $;
|
|
78
103
|
}
|
|
79
104
|
var W = {};
|
|
80
105
|
/**
|
|
@@ -87,17 +112,17 @@ var W = {};
|
|
|
87
112
|
* LICENSE file in the root directory of this source tree.
|
|
88
113
|
*/
|
|
89
114
|
var Oe;
|
|
90
|
-
function
|
|
115
|
+
function wr() {
|
|
91
116
|
return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
92
|
-
var
|
|
93
|
-
function
|
|
117
|
+
var s = Se, p = Symbol.for("react.element"), R = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), v = Symbol.for("react.provider"), c = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), Y = Symbol.for("react.offscreen"), H = Symbol.iterator, Ae = "@@iterator";
|
|
118
|
+
function ke(e) {
|
|
94
119
|
if (e === null || typeof e != "object")
|
|
95
120
|
return null;
|
|
96
|
-
var r = H && e[H] || e[
|
|
121
|
+
var r = H && e[H] || e[Ae];
|
|
97
122
|
return typeof r == "function" ? r : null;
|
|
98
123
|
}
|
|
99
|
-
var j =
|
|
100
|
-
function
|
|
124
|
+
var j = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
125
|
+
function h(e) {
|
|
101
126
|
{
|
|
102
127
|
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
103
128
|
t[n - 1] = arguments[n];
|
|
@@ -106,18 +131,18 @@ function Cr() {
|
|
|
106
131
|
}
|
|
107
132
|
function Fe(e, r, t) {
|
|
108
133
|
{
|
|
109
|
-
var n = j.ReactDebugCurrentFrame,
|
|
110
|
-
|
|
111
|
-
var
|
|
112
|
-
return String(
|
|
134
|
+
var n = j.ReactDebugCurrentFrame, o = n.getStackAddendum();
|
|
135
|
+
o !== "" && (r += "%s", t = t.concat([o]));
|
|
136
|
+
var u = t.map(function(i) {
|
|
137
|
+
return String(i);
|
|
113
138
|
});
|
|
114
|
-
|
|
139
|
+
u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
|
|
115
140
|
}
|
|
116
141
|
}
|
|
117
142
|
var De = !1, Ie = !1, $e = !1, We = !1, Ye = !1, Z;
|
|
118
143
|
Z = Symbol.for("react.module.reference");
|
|
119
144
|
function Le(e) {
|
|
120
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
145
|
+
return !!(typeof e == "string" || typeof e == "function" || e === m || e === C || Ye || e === E || e === T || e === y || We || e === Y || De || Ie || $e || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === w || e.$$typeof === v || e.$$typeof === c || e.$$typeof === f || // This needs to include all possible module reference object
|
|
121
146
|
// types supported by any Flight configuration anywhere since
|
|
122
147
|
// we don't know which Flight build this will end up being used
|
|
123
148
|
// with.
|
|
@@ -127,8 +152,8 @@ function Cr() {
|
|
|
127
152
|
var n = e.displayName;
|
|
128
153
|
if (n)
|
|
129
154
|
return n;
|
|
130
|
-
var
|
|
131
|
-
return
|
|
155
|
+
var o = r.displayName || r.name || "";
|
|
156
|
+
return o !== "" ? t + "(" + o + ")" : t;
|
|
132
157
|
}
|
|
133
158
|
function ee(e) {
|
|
134
159
|
return e.displayName || "Context";
|
|
@@ -136,41 +161,41 @@ function Cr() {
|
|
|
136
161
|
function O(e) {
|
|
137
162
|
if (e == null)
|
|
138
163
|
return null;
|
|
139
|
-
if (typeof e.tag == "number" &&
|
|
164
|
+
if (typeof e.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
140
165
|
return e.displayName || e.name || null;
|
|
141
166
|
if (typeof e == "string")
|
|
142
167
|
return e;
|
|
143
168
|
switch (e) {
|
|
144
|
-
case
|
|
169
|
+
case m:
|
|
145
170
|
return "Fragment";
|
|
146
|
-
case
|
|
171
|
+
case R:
|
|
147
172
|
return "Portal";
|
|
148
|
-
case
|
|
173
|
+
case C:
|
|
149
174
|
return "Profiler";
|
|
150
175
|
case E:
|
|
151
176
|
return "StrictMode";
|
|
152
|
-
case
|
|
177
|
+
case T:
|
|
153
178
|
return "Suspense";
|
|
154
179
|
case y:
|
|
155
180
|
return "SuspenseList";
|
|
156
181
|
}
|
|
157
182
|
if (typeof e == "object")
|
|
158
183
|
switch (e.$$typeof) {
|
|
159
|
-
case
|
|
184
|
+
case c:
|
|
160
185
|
var r = e;
|
|
161
186
|
return ee(r) + ".Consumer";
|
|
162
187
|
case v:
|
|
163
188
|
var t = e;
|
|
164
189
|
return ee(t._context) + ".Provider";
|
|
165
|
-
case
|
|
190
|
+
case f:
|
|
166
191
|
return Me(e, e.render, "ForwardRef");
|
|
167
192
|
case w:
|
|
168
193
|
var n = e.displayName || null;
|
|
169
194
|
return n !== null ? n : O(e.type) || "Memo";
|
|
170
195
|
case P: {
|
|
171
|
-
var
|
|
196
|
+
var o = e, u = o._payload, i = o._init;
|
|
172
197
|
try {
|
|
173
|
-
return O(
|
|
198
|
+
return O(i(u));
|
|
174
199
|
} catch {
|
|
175
200
|
return null;
|
|
176
201
|
}
|
|
@@ -178,14 +203,14 @@ function Cr() {
|
|
|
178
203
|
}
|
|
179
204
|
return null;
|
|
180
205
|
}
|
|
181
|
-
var x = Object.assign, F = 0, re, te, ne, ae,
|
|
206
|
+
var x = Object.assign, F = 0, re, te, ne, ae, ie, oe, ue;
|
|
182
207
|
function se() {
|
|
183
208
|
}
|
|
184
209
|
se.__reactDisabledLog = !0;
|
|
185
210
|
function Ue() {
|
|
186
211
|
{
|
|
187
212
|
if (F === 0) {
|
|
188
|
-
re = console.log, te = console.info, ne = console.warn, ae = console.error,
|
|
213
|
+
re = console.log, te = console.info, ne = console.warn, ae = console.error, ie = console.group, oe = console.groupCollapsed, ue = console.groupEnd;
|
|
189
214
|
var e = {
|
|
190
215
|
configurable: !0,
|
|
191
216
|
enumerable: !0,
|
|
@@ -227,17 +252,17 @@ function Cr() {
|
|
|
227
252
|
value: ae
|
|
228
253
|
}),
|
|
229
254
|
group: x({}, e, {
|
|
230
|
-
value:
|
|
255
|
+
value: ie
|
|
231
256
|
}),
|
|
232
257
|
groupCollapsed: x({}, e, {
|
|
233
|
-
value:
|
|
258
|
+
value: oe
|
|
234
259
|
}),
|
|
235
260
|
groupEnd: x({}, e, {
|
|
236
261
|
value: ue
|
|
237
262
|
})
|
|
238
263
|
});
|
|
239
264
|
}
|
|
240
|
-
F < 0 &&
|
|
265
|
+
F < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
241
266
|
}
|
|
242
267
|
}
|
|
243
268
|
var N = j.ReactCurrentDispatcher, J;
|
|
@@ -246,8 +271,8 @@ function Cr() {
|
|
|
246
271
|
if (J === void 0)
|
|
247
272
|
try {
|
|
248
273
|
throw Error();
|
|
249
|
-
} catch (
|
|
250
|
-
var n =
|
|
274
|
+
} catch (o) {
|
|
275
|
+
var n = o.stack.trim().match(/\n( *(at )?)/);
|
|
251
276
|
J = n && n[1] || "";
|
|
252
277
|
}
|
|
253
278
|
return `
|
|
@@ -269,65 +294,65 @@ function Cr() {
|
|
|
269
294
|
}
|
|
270
295
|
var n;
|
|
271
296
|
B = !0;
|
|
272
|
-
var
|
|
297
|
+
var o = Error.prepareStackTrace;
|
|
273
298
|
Error.prepareStackTrace = void 0;
|
|
274
|
-
var
|
|
275
|
-
|
|
299
|
+
var u;
|
|
300
|
+
u = N.current, N.current = null, Ue();
|
|
276
301
|
try {
|
|
277
302
|
if (r) {
|
|
278
|
-
var
|
|
303
|
+
var i = function() {
|
|
279
304
|
throw Error();
|
|
280
305
|
};
|
|
281
|
-
if (Object.defineProperty(
|
|
306
|
+
if (Object.defineProperty(i.prototype, "props", {
|
|
282
307
|
set: function() {
|
|
283
308
|
throw Error();
|
|
284
309
|
}
|
|
285
310
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
286
311
|
try {
|
|
287
|
-
Reflect.construct(
|
|
288
|
-
} catch (
|
|
289
|
-
n =
|
|
312
|
+
Reflect.construct(i, []);
|
|
313
|
+
} catch (b) {
|
|
314
|
+
n = b;
|
|
290
315
|
}
|
|
291
|
-
Reflect.construct(e, [],
|
|
316
|
+
Reflect.construct(e, [], i);
|
|
292
317
|
} else {
|
|
293
318
|
try {
|
|
294
|
-
|
|
295
|
-
} catch (
|
|
296
|
-
n =
|
|
319
|
+
i.call();
|
|
320
|
+
} catch (b) {
|
|
321
|
+
n = b;
|
|
297
322
|
}
|
|
298
|
-
e.call(
|
|
323
|
+
e.call(i.prototype);
|
|
299
324
|
}
|
|
300
325
|
} else {
|
|
301
326
|
try {
|
|
302
327
|
throw Error();
|
|
303
|
-
} catch (
|
|
304
|
-
n =
|
|
328
|
+
} catch (b) {
|
|
329
|
+
n = b;
|
|
305
330
|
}
|
|
306
331
|
e();
|
|
307
332
|
}
|
|
308
|
-
} catch (
|
|
309
|
-
if (
|
|
310
|
-
for (var a =
|
|
311
|
-
`),
|
|
312
|
-
`), l = a.length - 1,
|
|
313
|
-
|
|
314
|
-
for (; l >= 1 &&
|
|
315
|
-
if (a[l] !==
|
|
316
|
-
if (l !== 1 ||
|
|
333
|
+
} catch (b) {
|
|
334
|
+
if (b && n && typeof b.stack == "string") {
|
|
335
|
+
for (var a = b.stack.split(`
|
|
336
|
+
`), g = n.stack.split(`
|
|
337
|
+
`), l = a.length - 1, d = g.length - 1; l >= 1 && d >= 0 && a[l] !== g[d]; )
|
|
338
|
+
d--;
|
|
339
|
+
for (; l >= 1 && d >= 0; l--, d--)
|
|
340
|
+
if (a[l] !== g[d]) {
|
|
341
|
+
if (l !== 1 || d !== 1)
|
|
317
342
|
do
|
|
318
|
-
if (l--,
|
|
319
|
-
var
|
|
343
|
+
if (l--, d--, d < 0 || a[l] !== g[d]) {
|
|
344
|
+
var _ = `
|
|
320
345
|
` + a[l].replace(" at new ", " at ");
|
|
321
|
-
return e.displayName &&
|
|
346
|
+
return e.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, _), _;
|
|
322
347
|
}
|
|
323
|
-
while (l >= 1 &&
|
|
348
|
+
while (l >= 1 && d >= 0);
|
|
324
349
|
break;
|
|
325
350
|
}
|
|
326
351
|
}
|
|
327
352
|
} finally {
|
|
328
|
-
B = !1, N.current =
|
|
353
|
+
B = !1, N.current = u, Ve(), Error.prepareStackTrace = o;
|
|
329
354
|
}
|
|
330
|
-
var
|
|
355
|
+
var k = e ? e.displayName || e.name : "", S = k ? L(k) : "";
|
|
331
356
|
return typeof e == "function" && M.set(e, S), S;
|
|
332
357
|
}
|
|
333
358
|
function Ne(e, r, t) {
|
|
@@ -345,21 +370,21 @@ function Cr() {
|
|
|
345
370
|
if (typeof e == "string")
|
|
346
371
|
return L(e);
|
|
347
372
|
switch (e) {
|
|
348
|
-
case
|
|
373
|
+
case T:
|
|
349
374
|
return L("Suspense");
|
|
350
375
|
case y:
|
|
351
376
|
return L("SuspenseList");
|
|
352
377
|
}
|
|
353
378
|
if (typeof e == "object")
|
|
354
379
|
switch (e.$$typeof) {
|
|
355
|
-
case
|
|
380
|
+
case f:
|
|
356
381
|
return Ne(e.render);
|
|
357
382
|
case w:
|
|
358
383
|
return U(e.type, r, t);
|
|
359
384
|
case P: {
|
|
360
|
-
var n = e,
|
|
385
|
+
var n = e, o = n._payload, u = n._init;
|
|
361
386
|
try {
|
|
362
|
-
return U(
|
|
387
|
+
return U(u(o), r, t);
|
|
363
388
|
} catch {
|
|
364
389
|
}
|
|
365
390
|
}
|
|
@@ -374,22 +399,22 @@ function Cr() {
|
|
|
374
399
|
} else
|
|
375
400
|
fe.setExtraStackFrame(null);
|
|
376
401
|
}
|
|
377
|
-
function Be(e, r, t, n,
|
|
402
|
+
function Be(e, r, t, n, o) {
|
|
378
403
|
{
|
|
379
|
-
var
|
|
380
|
-
for (var
|
|
381
|
-
if (
|
|
404
|
+
var u = Function.call.bind(D);
|
|
405
|
+
for (var i in e)
|
|
406
|
+
if (u(e, i)) {
|
|
382
407
|
var a = void 0;
|
|
383
408
|
try {
|
|
384
|
-
if (typeof e[
|
|
385
|
-
var
|
|
386
|
-
throw
|
|
409
|
+
if (typeof e[i] != "function") {
|
|
410
|
+
var g = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
411
|
+
throw g.name = "Invariant Violation", g;
|
|
387
412
|
}
|
|
388
|
-
a = e[
|
|
413
|
+
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
389
414
|
} catch (l) {
|
|
390
415
|
a = l;
|
|
391
416
|
}
|
|
392
|
-
a && !(a instanceof Error) && (V(
|
|
417
|
+
a && !(a instanceof Error) && (V(o), h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), V(null)), a instanceof Error && !(a.message in le) && (le[a.message] = !0, V(o), h("Failed %s type: %s", t, a.message), V(null));
|
|
393
418
|
}
|
|
394
419
|
}
|
|
395
420
|
}
|
|
@@ -415,14 +440,14 @@ function Cr() {
|
|
|
415
440
|
}
|
|
416
441
|
function ve(e) {
|
|
417
442
|
if (ze(e))
|
|
418
|
-
return
|
|
443
|
+
return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)), de(e);
|
|
419
444
|
}
|
|
420
445
|
var pe = j.ReactCurrentOwner, Qe = {
|
|
421
446
|
key: !0,
|
|
422
447
|
ref: !0,
|
|
423
448
|
__self: !0,
|
|
424
449
|
__source: !0
|
|
425
|
-
}, ye,
|
|
450
|
+
}, ye, he;
|
|
426
451
|
function Xe(e) {
|
|
427
452
|
if (D.call(e, "ref")) {
|
|
428
453
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
@@ -445,7 +470,7 @@ function Cr() {
|
|
|
445
470
|
function er(e, r) {
|
|
446
471
|
{
|
|
447
472
|
var t = function() {
|
|
448
|
-
ye || (ye = !0,
|
|
473
|
+
ye || (ye = !0, h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
449
474
|
};
|
|
450
475
|
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
451
476
|
get: t,
|
|
@@ -456,7 +481,7 @@ function Cr() {
|
|
|
456
481
|
function rr(e, r) {
|
|
457
482
|
{
|
|
458
483
|
var t = function() {
|
|
459
|
-
|
|
484
|
+
he || (he = !0, h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
460
485
|
};
|
|
461
486
|
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
462
487
|
get: t,
|
|
@@ -464,17 +489,17 @@ function Cr() {
|
|
|
464
489
|
});
|
|
465
490
|
}
|
|
466
491
|
}
|
|
467
|
-
var tr = function(e, r, t, n,
|
|
492
|
+
var tr = function(e, r, t, n, o, u, i) {
|
|
468
493
|
var a = {
|
|
469
494
|
// This tag allows us to uniquely identify this as a React Element
|
|
470
|
-
$$typeof:
|
|
495
|
+
$$typeof: p,
|
|
471
496
|
// Built-in properties that belong on the element
|
|
472
497
|
type: e,
|
|
473
498
|
key: r,
|
|
474
499
|
ref: t,
|
|
475
|
-
props:
|
|
500
|
+
props: i,
|
|
476
501
|
// Record the component responsible for creating this element.
|
|
477
|
-
_owner:
|
|
502
|
+
_owner: u
|
|
478
503
|
};
|
|
479
504
|
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
480
505
|
configurable: !1,
|
|
@@ -490,39 +515,39 @@ function Cr() {
|
|
|
490
515
|
configurable: !1,
|
|
491
516
|
enumerable: !1,
|
|
492
517
|
writable: !1,
|
|
493
|
-
value:
|
|
518
|
+
value: o
|
|
494
519
|
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
495
520
|
};
|
|
496
|
-
function nr(e, r, t, n,
|
|
521
|
+
function nr(e, r, t, n, o) {
|
|
497
522
|
{
|
|
498
|
-
var
|
|
499
|
-
t !== void 0 && (ve(t), a = "" + t), He(r) && (ve(r.key), a = "" + r.key), Xe(r) && (
|
|
500
|
-
for (
|
|
501
|
-
D.call(r,
|
|
523
|
+
var u, i = {}, a = null, g = null;
|
|
524
|
+
t !== void 0 && (ve(t), a = "" + t), He(r) && (ve(r.key), a = "" + r.key), Xe(r) && (g = r.ref, Ze(r, o));
|
|
525
|
+
for (u in r)
|
|
526
|
+
D.call(r, u) && !Qe.hasOwnProperty(u) && (i[u] = r[u]);
|
|
502
527
|
if (e && e.defaultProps) {
|
|
503
528
|
var l = e.defaultProps;
|
|
504
|
-
for (
|
|
505
|
-
|
|
529
|
+
for (u in l)
|
|
530
|
+
i[u] === void 0 && (i[u] = l[u]);
|
|
506
531
|
}
|
|
507
|
-
if (a ||
|
|
508
|
-
var
|
|
509
|
-
a && er(
|
|
532
|
+
if (a || g) {
|
|
533
|
+
var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
534
|
+
a && er(i, d), g && rr(i, d);
|
|
510
535
|
}
|
|
511
|
-
return tr(e, a,
|
|
536
|
+
return tr(e, a, g, o, n, pe.current, i);
|
|
512
537
|
}
|
|
513
538
|
}
|
|
514
|
-
var K = j.ReactCurrentOwner,
|
|
515
|
-
function
|
|
539
|
+
var K = j.ReactCurrentOwner, ge = j.ReactDebugCurrentFrame;
|
|
540
|
+
function A(e) {
|
|
516
541
|
if (e) {
|
|
517
542
|
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
|
518
|
-
|
|
543
|
+
ge.setExtraStackFrame(t);
|
|
519
544
|
} else
|
|
520
|
-
|
|
545
|
+
ge.setExtraStackFrame(null);
|
|
521
546
|
}
|
|
522
547
|
var z;
|
|
523
548
|
z = !1;
|
|
524
549
|
function Q(e) {
|
|
525
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
550
|
+
return typeof e == "object" && e !== null && e.$$typeof === p;
|
|
526
551
|
}
|
|
527
552
|
function me() {
|
|
528
553
|
{
|
|
@@ -540,7 +565,7 @@ Check the render method of \`` + e + "`.";
|
|
|
540
565
|
return "";
|
|
541
566
|
}
|
|
542
567
|
var be = {};
|
|
543
|
-
function
|
|
568
|
+
function ir(e) {
|
|
544
569
|
{
|
|
545
570
|
var r = me();
|
|
546
571
|
if (!r) {
|
|
@@ -557,12 +582,12 @@ Check the top-level render call using <` + t + ">.");
|
|
|
557
582
|
if (!e._store || e._store.validated || e.key != null)
|
|
558
583
|
return;
|
|
559
584
|
e._store.validated = !0;
|
|
560
|
-
var t =
|
|
585
|
+
var t = ir(r);
|
|
561
586
|
if (be[t])
|
|
562
587
|
return;
|
|
563
588
|
be[t] = !0;
|
|
564
589
|
var n = "";
|
|
565
|
-
e && e._owner && e._owner !== K.current && (n = " It was passed a child from " + O(e._owner.type) + "."),
|
|
590
|
+
e && e._owner && e._owner !== K.current && (n = " It was passed a child from " + O(e._owner.type) + "."), A(e), h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), A(null);
|
|
566
591
|
}
|
|
567
592
|
}
|
|
568
593
|
function _e(e, r) {
|
|
@@ -577,14 +602,14 @@ Check the top-level render call using <` + t + ">.");
|
|
|
577
602
|
else if (Q(e))
|
|
578
603
|
e._store && (e._store.validated = !0);
|
|
579
604
|
else if (e) {
|
|
580
|
-
var
|
|
581
|
-
if (typeof
|
|
582
|
-
for (var
|
|
583
|
-
Q(
|
|
605
|
+
var o = ke(e);
|
|
606
|
+
if (typeof o == "function" && o !== e.entries)
|
|
607
|
+
for (var u = o.call(e), i; !(i = u.next()).done; )
|
|
608
|
+
Q(i.value) && Ee(i.value, r);
|
|
584
609
|
}
|
|
585
610
|
}
|
|
586
611
|
}
|
|
587
|
-
function
|
|
612
|
+
function or(e) {
|
|
588
613
|
{
|
|
589
614
|
var r = e.type;
|
|
590
615
|
if (r == null || typeof r == "string")
|
|
@@ -592,7 +617,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
592
617
|
var t;
|
|
593
618
|
if (typeof r == "function")
|
|
594
619
|
t = r.propTypes;
|
|
595
|
-
else if (typeof r == "object" && (r.$$typeof ===
|
|
620
|
+
else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
|
|
596
621
|
// Inner props are checked in the reconciler.
|
|
597
622
|
r.$$typeof === w))
|
|
598
623
|
t = r.propTypes;
|
|
@@ -603,10 +628,10 @@ Check the top-level render call using <` + t + ">.");
|
|
|
603
628
|
Be(t, e.props, "prop", n, e);
|
|
604
629
|
} else if (r.PropTypes !== void 0 && !z) {
|
|
605
630
|
z = !0;
|
|
606
|
-
var
|
|
607
|
-
|
|
631
|
+
var o = O(r);
|
|
632
|
+
h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
|
|
608
633
|
}
|
|
609
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
634
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
610
635
|
}
|
|
611
636
|
}
|
|
612
637
|
function ur(e) {
|
|
@@ -614,48 +639,48 @@ Check the top-level render call using <` + t + ">.");
|
|
|
614
639
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
615
640
|
var n = r[t];
|
|
616
641
|
if (n !== "children" && n !== "key") {
|
|
617
|
-
|
|
642
|
+
A(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), A(null);
|
|
618
643
|
break;
|
|
619
644
|
}
|
|
620
645
|
}
|
|
621
|
-
e.ref !== null && (
|
|
646
|
+
e.ref !== null && (A(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), A(null));
|
|
622
647
|
}
|
|
623
648
|
}
|
|
624
649
|
var Re = {};
|
|
625
|
-
function Ce(e, r, t, n,
|
|
650
|
+
function Ce(e, r, t, n, o, u) {
|
|
626
651
|
{
|
|
627
|
-
var
|
|
628
|
-
if (!
|
|
652
|
+
var i = Le(e);
|
|
653
|
+
if (!i) {
|
|
629
654
|
var a = "";
|
|
630
655
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
631
|
-
var
|
|
632
|
-
|
|
656
|
+
var g = ar();
|
|
657
|
+
g ? a += g : a += me();
|
|
633
658
|
var l;
|
|
634
|
-
e === null ? l = "null" : G(e) ? l = "array" : e !== void 0 && e.$$typeof ===
|
|
659
|
+
e === null ? l = "null" : G(e) ? l = "array" : e !== void 0 && e.$$typeof === p ? (l = "<" + (O(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
|
|
635
660
|
}
|
|
636
|
-
var
|
|
637
|
-
if (
|
|
638
|
-
return
|
|
639
|
-
if (
|
|
640
|
-
var
|
|
641
|
-
if (
|
|
661
|
+
var d = nr(e, r, t, o, u);
|
|
662
|
+
if (d == null)
|
|
663
|
+
return d;
|
|
664
|
+
if (i) {
|
|
665
|
+
var _ = r.children;
|
|
666
|
+
if (_ !== void 0)
|
|
642
667
|
if (n)
|
|
643
|
-
if (G(
|
|
644
|
-
for (var
|
|
645
|
-
_e(
|
|
646
|
-
Object.freeze && Object.freeze(
|
|
668
|
+
if (G(_)) {
|
|
669
|
+
for (var k = 0; k < _.length; k++)
|
|
670
|
+
_e(_[k], e);
|
|
671
|
+
Object.freeze && Object.freeze(_);
|
|
647
672
|
} else
|
|
648
|
-
|
|
673
|
+
h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
649
674
|
else
|
|
650
|
-
_e(
|
|
675
|
+
_e(_, e);
|
|
651
676
|
}
|
|
652
677
|
if (D.call(r, "key")) {
|
|
653
|
-
var S = O(e),
|
|
678
|
+
var S = O(e), b = Object.keys(r).filter(function(vr) {
|
|
654
679
|
return vr !== "key";
|
|
655
|
-
}), X =
|
|
680
|
+
}), X = b.length > 0 ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
656
681
|
if (!Re[S + X]) {
|
|
657
|
-
var dr =
|
|
658
|
-
|
|
682
|
+
var dr = b.length > 0 ? "{" + b.join(": ..., ") + ": ...}" : "{}";
|
|
683
|
+
h(`A props object containing a "key" prop is being spread into JSX:
|
|
659
684
|
let props = %s;
|
|
660
685
|
<%s {...props} />
|
|
661
686
|
React keys must be passed directly to JSX without using spread:
|
|
@@ -663,7 +688,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
663
688
|
<%s key={someKey} {...props} />`, X, S, dr, S), Re[S + X] = !0;
|
|
664
689
|
}
|
|
665
690
|
}
|
|
666
|
-
return e ===
|
|
691
|
+
return e === m ? ur(d) : or(d), d;
|
|
667
692
|
}
|
|
668
693
|
}
|
|
669
694
|
function sr(e, r, t) {
|
|
@@ -673,44 +698,16 @@ React keys must be passed directly to JSX without using spread:
|
|
|
673
698
|
return Ce(e, r, t, !1);
|
|
674
699
|
}
|
|
675
700
|
var lr = cr, fr = sr;
|
|
676
|
-
W.Fragment =
|
|
701
|
+
W.Fragment = m, W.jsx = lr, W.jsxs = fr;
|
|
677
702
|
})()), W;
|
|
678
703
|
}
|
|
679
704
|
var Pe;
|
|
680
|
-
function
|
|
681
|
-
return Pe || (Pe = 1, process.env.NODE_ENV === "production" ? q.exports =
|
|
682
|
-
}
|
|
683
|
-
var xe = wr();
|
|
684
|
-
function Tr({
|
|
685
|
-
baseURL: c,
|
|
686
|
-
getToken: d,
|
|
687
|
-
timeoutMs: _ = 15e3,
|
|
688
|
-
axiosInstance: b,
|
|
689
|
-
currency: E,
|
|
690
|
-
lng: T,
|
|
691
|
-
onError: v
|
|
692
|
-
} = {}) {
|
|
693
|
-
const p = b ?? br.create({
|
|
694
|
-
baseURL: c,
|
|
695
|
-
timeout: _,
|
|
696
|
-
headers: { "Content-Type": "application/json" }
|
|
697
|
-
});
|
|
698
|
-
return p.interceptors.request.use(async (i) => {
|
|
699
|
-
if (d) {
|
|
700
|
-
const C = await d();
|
|
701
|
-
C && (i.headers = i.headers || {}, i.headers.Authorization = `Bearer ${C}`);
|
|
702
|
-
}
|
|
703
|
-
return i;
|
|
704
|
-
}), p.interceptors.request.use((i) => {
|
|
705
|
-
i.headers.Currency = E, i.headers["currency-code"] = E, i.headers.lang = T;
|
|
706
|
-
}), p.interceptors.response.use(
|
|
707
|
-
(i) => i,
|
|
708
|
-
(i) => v ? v(i, { instance: p }) : Promise.reject(i)
|
|
709
|
-
), p;
|
|
705
|
+
function Tr() {
|
|
706
|
+
return Pe || (Pe = 1, process.env.NODE_ENV === "production" ? q.exports = Cr() : q.exports = wr()), q.exports;
|
|
710
707
|
}
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
const
|
|
708
|
+
var xe = Tr();
|
|
709
|
+
function jr({ children: s, ...p }) {
|
|
710
|
+
const R = we(() => _r(p), [p]), E = we(
|
|
714
711
|
() => new yr({
|
|
715
712
|
defaultOptions: {
|
|
716
713
|
queries: {
|
|
@@ -721,7 +718,7 @@ function jr({ children: c, ...d }) {
|
|
|
721
718
|
}),
|
|
722
719
|
[]
|
|
723
720
|
);
|
|
724
|
-
return /* @__PURE__ */ xe.jsx(
|
|
721
|
+
return /* @__PURE__ */ xe.jsx(hr, { client: E, children: /* @__PURE__ */ xe.jsx(je.Provider, { value: { client: R }, children: s }) });
|
|
725
722
|
}
|
|
726
723
|
export {
|
|
727
724
|
je as ApiCtx,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obb871001/api-integration-sdk",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.29",
|
|
5
5
|
"description": "集成API",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"README.md"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
|
-
"dev": "vite",
|
|
20
|
+
"dev": "vite --mode development",
|
|
21
|
+
"dev:app": "vite dev --open src/App.jsx",
|
|
21
22
|
"build": "vite build",
|
|
22
23
|
"build:lib": "vite build --mode lib",
|
|
23
24
|
"lint": "eslint .",
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
"@tanstack/react-query": ">=4.0.0"
|
|
51
52
|
},
|
|
52
53
|
"dependencies": {
|
|
53
|
-
"axios": "^1.
|
|
54
|
+
"axios": "^1.4.0",
|
|
54
55
|
"lodash": "^4.17.21"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|