@devtable/settings-form 6.27.0 → 6.28.1
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.d.ts
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
const e = "@devtable/settings-form", s = "6.28.1", t = "Apache-2.0", i = {
|
|
2
|
+
access: "public",
|
|
3
|
+
registry: "https://registry.npmjs.org/"
|
|
4
|
+
}, n = [
|
|
5
|
+
"dist"
|
|
6
|
+
], o = "./dist/settings-form.umd.js", c = "./dist/settings-form.es.js", r = "./dist/index.d.ts", d = {
|
|
7
|
+
".": {
|
|
8
|
+
import: "./dist/settings-form.es.js",
|
|
9
|
+
require: "./dist/settings-form.umd.js"
|
|
10
|
+
},
|
|
11
|
+
"./dist/style.css": {
|
|
12
|
+
import: "./dist/style.css",
|
|
13
|
+
require: "./dist/style.css"
|
|
14
|
+
}
|
|
15
|
+
}, p = {
|
|
16
|
+
"dev-build": "tsc && vite build --watch",
|
|
17
|
+
build: "tsc && vite build",
|
|
18
|
+
preview: "vite preview"
|
|
19
|
+
}, a = {}, l = {
|
|
20
|
+
"@types/crypto-js": "v4.1.1",
|
|
21
|
+
"@types/lodash": "^4.14.182",
|
|
22
|
+
"@types/react": "^18.0.0",
|
|
23
|
+
"@types/react-dom": "^18.0.0",
|
|
24
|
+
"@types/react-grid-layout": "^1.3.2",
|
|
25
|
+
"rollup-plugin-visualizer": "5.6.0",
|
|
26
|
+
typescript: "^4.6.3"
|
|
27
|
+
}, m = {
|
|
28
|
+
"@emotion/react": "11.10.0",
|
|
29
|
+
"@mantine/core": "5.9.5",
|
|
30
|
+
"@mantine/hooks": "5.9.5",
|
|
31
|
+
"@mantine/modals": "5.9.5",
|
|
32
|
+
"@mantine/notifications": "5.9.5",
|
|
33
|
+
ahooks: "^3.3.11",
|
|
34
|
+
axios: "^0.27.2",
|
|
35
|
+
"crypto-js": "^4.1.1",
|
|
36
|
+
lodash: "^4.17.21",
|
|
37
|
+
react: "^16.8.0 || 17.x || 18.x",
|
|
38
|
+
"react-dom": "^16.8.0 || 17.x || 18.x",
|
|
39
|
+
"react-hook-form": "^7.31.2",
|
|
40
|
+
"tabler-icons-react": "^1.48.0"
|
|
41
|
+
}, u = {
|
|
42
|
+
name: e,
|
|
43
|
+
version: s,
|
|
44
|
+
license: t,
|
|
45
|
+
publishConfig: i,
|
|
46
|
+
files: n,
|
|
47
|
+
main: o,
|
|
48
|
+
module: c,
|
|
49
|
+
types: r,
|
|
50
|
+
exports: d,
|
|
51
|
+
scripts: p,
|
|
52
|
+
dependencies: a,
|
|
53
|
+
devDependencies: l,
|
|
54
|
+
peerDependencies: m
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
u as default,
|
|
58
|
+
a as dependencies,
|
|
59
|
+
l as devDependencies,
|
|
60
|
+
d as exports,
|
|
61
|
+
n as files,
|
|
62
|
+
t as license,
|
|
63
|
+
o as main,
|
|
64
|
+
c as module,
|
|
65
|
+
e as name,
|
|
66
|
+
m as peerDependencies,
|
|
67
|
+
i as publishConfig,
|
|
68
|
+
p as scripts,
|
|
69
|
+
r as types,
|
|
70
|
+
s as version
|
|
71
|
+
};
|
package/dist/settings-form.es.js
CHANGED
|
@@ -2088,6 +2088,7 @@ function Dt({
|
|
|
2088
2088
|
})]
|
|
2089
2089
|
});
|
|
2090
2090
|
}
|
|
2091
|
+
const jt = () => import("./package.782554cf.mjs").then(({ version: t }) => (console.log(`[@devtable/dashboard] version: ${t}`), t));
|
|
2091
2092
|
export {
|
|
2092
2093
|
Dt as APIKeyList,
|
|
2093
2094
|
xt as AccountList,
|
|
@@ -2098,5 +2099,6 @@ export {
|
|
|
2098
2099
|
wt as DeleteAPIKey,
|
|
2099
2100
|
pt as DeleteAccount,
|
|
2100
2101
|
lt as DeleteDataSource,
|
|
2101
|
-
kt as Login
|
|
2102
|
+
kt as Login,
|
|
2103
|
+
jt as getVersion
|
|
2102
2104
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(R,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@mantine/core"),require("@mantine/notifications"),require("react"),require("react-hook-form"),require("tabler-icons-react"),require("axios"),require("crypto-js"),require("lodash"),require("ahooks"),require("@mantine/modals")):typeof define=="function"&&define.amd?define(["exports","@mantine/core","@mantine/notifications","react","react-hook-form","tabler-icons-react","axios","crypto-js","lodash","ahooks","@mantine/modals"],s):(R=typeof globalThis<"u"?globalThis:R||self,s(R["settings-form"]={},R["@mantine/core"],R["@mantine/notifications"],R.React,R["react-hook-form"],R["tabler-icons-react"],R.axios,R["crypto-js"],R._,R.ahooks,R["@mantine/modals"]))})(this,function(R,s,T,W,C,F,pt,gt,ht,V,J){"use strict";const te=t=>t&&typeof t=="object"&&"default"in t?t:{default:t};function mt(t){if(t&&t.__esModule)return t;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,l.get?l:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const Y=te(W),X=mt(W),vt=te(pt),bt=te(gt),yt=te(ht);function wt(t){t=t||{};const n=Object.keys(t).sort(),o=[];for(let l=0;l<n.length;l++){const d=n[l];if(d!="authentication"&&t[d])o.push(n[l]+"="+(typeof t[d]=="object"?JSON.stringify(t[d]):t[d]));else{const i=Object.keys(t[d]).sort();for(let u=0;u<i.length;u++){const f=i[u];f!="sign"&&t[d][f]&&o.push(i[u]+"="+(typeof t[d][f]=="object"?JSON.stringify(t[d][f]):t[d][f]))}}}return o.sort().join("&")}function _t(t,n){let o=wt(t);return o+="&key="+n,bt.default.MD5(o).toString().toUpperCase()}const O={baseURL:"http://localhost:31200",app_id:"",app_secret:"",getAuthentication(t){if(!this.app_id||!this.app_secret)return;const n=new Date().getTime().toString();return{app_id:this.app_id,nonce_str:n,sign:_t({app_id:this.app_id,nonce_str:n,...t},this.app_secret)}},getRequest(t){return(n,o,l={})=>{const d=window.localStorage.getItem("token"),i={"X-Requested-With":"XMLHttpRequest","Content-Type":l.string?"application/x-www-form-urlencoded":"application/json",authorization:d?`bearer ${d}`:"",...l.headers},u={baseURL:this.baseURL,method:t,url:n,params:t==="GET"?o:l.params,headers:i};return["POST","PUT"].includes(t)&&(u.data=l.string?JSON.stringify(o):o,u.data.authentication=this.getAuthentication(u.data)),vt.default(u).then(f=>f.data).catch(f=>yt.default.has(f,"response.data.detail.message")?Promise.reject(new Error(f.response.data.detail.message)):Promise.reject(f))}}};function re(t){O.baseURL!==t.apiBaseURL&&(O.baseURL=t.apiBaseURL),t.app_id&&(O.app_id=t.app_id),t.app_secret&&(O.app_secret=t.app_secret)}const D={datasource:{list:async()=>await O.getRequest("POST")("/datasource/list",{filter:{},sort:{field:"create_time",order:"ASC"},pagination:{page:1,pagesize:100}}),create:async(t,n,o)=>await O.getRequest("POST")("/datasource/create",{type:t,key:n,config:o}),delete:async t=>{await O.getRequest("POST")("/datasource/delete",{id:t})}},account:{login:async(t,n)=>{const o={name:t,password:n};return await O.getRequest("POST")("/account/login",o)},list:async()=>await O.getRequest("POST")("/account/list",{filter:{search:""},sort:{field:"name",order:"ASC"},pagination:{page:1,pagesize:100}}),get:async()=>await O.getRequest("GET")("/account/get",{}),update:async(t,n)=>{const o={name:t,email:n};return await O.getRequest("PUT")("/account/update",o)},changepassword:async(t,n)=>{const o={old_password:t,new_password:n};return await O.getRequest("POST")("/account/changepassword",o)},create:async(t,n,o,l)=>await O.getRequest("POST")("/account/create",{name:t,email:n,password:o,role_id:l}),edit:async t=>(t.reset_password||(t.new_password=void 0),await O.getRequest("PUT")("/account/edit",t)),delete:async t=>{if(!!t)return O.getRequest("POST")("/account/delete",{id:t})}},role:{list:async()=>await O.getRequest("GET")("/role/list",{})},api_key:{list:async()=>await O.getRequest("POST")("/api/key/list",{filter:{search:""},sort:{field:"name",order:"ASC"},pagination:{page:1,pagesize:100}}),create:async(t,n)=>O.getRequest("POST")("/api/key/create",{name:t,role_id:n}),delete:async t=>{if(!!t)return O.getRequest("POST")("/api/key/delete",{id:t})}}},ne={size:"sm",spacing:"md",button:{size:"xs"}};var ae={exports:{}},Q={};/**
|
|
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 Se;function
|
|
9
|
+
*/var Se;function St(){if(Se)return Q;Se=1;var t=Y.default,n=Symbol.for("react.element"),o=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,d=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function u(f,h,S){var _,m={},p=null,j=null;S!==void 0&&(p=""+S),h.key!==void 0&&(p=""+h.key),h.ref!==void 0&&(j=h.ref);for(_ in h)l.call(h,_)&&!i.hasOwnProperty(_)&&(m[_]=h[_]);if(f&&f.defaultProps)for(_ in h=f.defaultProps,h)m[_]===void 0&&(m[_]=h[_]);return{$$typeof:n,type:f,key:p,ref:j,props:m,_owner:d.current}}return Q.Fragment=o,Q.jsx=u,Q.jsxs=u,Q}var Z={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,14 +14,14 @@
|
|
|
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
|
|
18
|
-
`+he+e}}var me=!1,se;{var
|
|
17
|
+
*/var Pe;function Pt(){return Pe||(Pe=1,process.env.NODE_ENV!=="production"&&function(){var t=Y.default,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),j=Symbol.for("react.offscreen"),M=Symbol.iterator,B="@@iterator";function pe(e){if(e===null||typeof e!="object")return null;var a=M&&e[M]||e[B];return typeof a=="function"?a:null}var $=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function A(e){{for(var a=arguments.length,c=new Array(a>1?a-1:0),g=1;g<a;g++)c[g-1]=arguments[g];$t("error",e,c)}}function $t(e,a,c){{var g=$.ReactDebugCurrentFrame,y=g.getStackAddendum();y!==""&&(a+="%s",c=c.concat([y]));var P=c.map(function(b){return String(b)});P.unshift("Warning: "+a),Function.prototype.apply.call(console[e],console,P)}}var Ft=!1,Bt=!1,Ut=!1,Wt=!1,Vt=!1,Ue;Ue=Symbol.for("react.module.reference");function Yt(e){return!!(typeof e=="string"||typeof e=="function"||e===l||e===i||Vt||e===d||e===S||e===_||Wt||e===j||Ft||Bt||Ut||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===m||e.$$typeof===u||e.$$typeof===f||e.$$typeof===h||e.$$typeof===Ue||e.getModuleId!==void 0))}function Gt(e,a,c){var g=e.displayName;if(g)return g;var y=a.displayName||a.name||"";return y!==""?c+"("+y+")":c}function We(e){return e.displayName||"Context"}function k(e){if(e==null)return null;if(typeof e.tag=="number"&&A("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 l:return"Fragment";case o:return"Portal";case i:return"Profiler";case d:return"StrictMode";case S:return"Suspense";case _:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case f:var a=e;return We(a)+".Consumer";case u:var c=e;return We(c._context)+".Provider";case h:return Gt(e,e.render,"ForwardRef");case m:var g=e.displayName||null;return g!==null?g:k(e.type)||"Memo";case p:{var y=e,P=y._payload,b=y._init;try{return k(b(P))}catch{return null}}}return null}var U=Object.assign,H=0,Ve,Ye,Ge,Ke,Je,Xe,Qe;function Ze(){}Ze.__reactDisabledLog=!0;function Kt(){{if(H===0){Ve=console.log,Ye=console.info,Ge=console.warn,Ke=console.error,Je=console.group,Xe=console.groupCollapsed,Qe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ze,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}H++}}function Jt(){{if(H--,H===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},e,{value:Ve}),info:U({},e,{value:Ye}),warn:U({},e,{value:Ge}),error:U({},e,{value:Ke}),group:U({},e,{value:Je}),groupCollapsed:U({},e,{value:Xe}),groupEnd:U({},e,{value:Qe})})}H<0&&A("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ge=$.ReactCurrentDispatcher,he;function oe(e,a,c){{if(he===void 0)try{throw Error()}catch(y){var g=y.stack.trim().match(/\n( *(at )?)/);he=g&&g[1]||""}return`
|
|
18
|
+
`+he+e}}var me=!1,se;{var Xt=typeof WeakMap=="function"?WeakMap:Map;se=new Xt}function He(e,a){if(!e||me)return"";{var c=se.get(e);if(c!==void 0)return c}var g;me=!0;var y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var P;P=ge.current,ge.current=null,Kt();try{if(a){var b=function(){throw Error()};if(Object.defineProperty(b.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(b,[])}catch(q){g=q}Reflect.construct(e,[],b)}else{try{b.call()}catch(q){g=q}e.call(b.prototype)}}else{try{throw Error()}catch(q){g=q}e()}}catch(q){if(q&&g&&typeof q.stack=="string"){for(var v=q.stack.split(`
|
|
19
19
|
`),z=g.stack.split(`
|
|
20
|
-
`),E=v.length-1,
|
|
21
|
-
`+v[E].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),typeof e=="function"&&se.set(e,I),I}while(E>=1&&
|
|
20
|
+
`),E=v.length-1,x=z.length-1;E>=1&&x>=0&&v[E]!==z[x];)x--;for(;E>=1&&x>=0;E--,x--)if(v[E]!==z[x]){if(E!==1||x!==1)do if(E--,x--,x<0||v[E]!==z[x]){var I=`
|
|
21
|
+
`+v[E].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),typeof e=="function"&&se.set(e,I),I}while(E>=1&&x>=0);break}}}finally{me=!1,ge.current=P,Jt(),Error.prepareStackTrace=y}var K=e?e.displayName||e.name:"",ft=K?oe(K):"";return typeof e=="function"&&se.set(e,ft),ft}function Qt(e,a,c){return He(e,!1)}function Zt(e){var a=e.prototype;return!!(a&&a.isReactComponent)}function le(e,a,c){if(e==null)return"";if(typeof e=="function")return He(e,Zt(e));if(typeof e=="string")return oe(e);switch(e){case S:return oe("Suspense");case _:return oe("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case h:return Qt(e.render);case m:return le(e.type,a,c);case p:{var g=e,y=g._payload,P=g._init;try{return le(P(y),a,c)}catch{}}}return""}var ce=Object.prototype.hasOwnProperty,et={},tt=$.ReactDebugCurrentFrame;function ue(e){if(e){var a=e._owner,c=le(e.type,e._source,a?a.type:null);tt.setExtraStackFrame(c)}else tt.setExtraStackFrame(null)}function Ht(e,a,c,g,y){{var P=Function.call.bind(ce);for(var b in e)if(P(e,b)){var v=void 0;try{if(typeof e[b]!="function"){var z=Error((g||"React class")+": "+c+" type `"+b+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[b]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw z.name="Invariant Violation",z}v=e[b](a,b,g,c,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){v=E}v&&!(v instanceof Error)&&(ue(y),A("%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).",g||"React class",c,b,typeof v),ue(null)),v instanceof Error&&!(v.message in et)&&(et[v.message]=!0,ue(y),A("Failed %s type: %s",c,v.message),ue(null))}}}var er=Array.isArray;function ve(e){return er(e)}function tr(e){{var a=typeof Symbol=="function"&&Symbol.toStringTag,c=a&&e[Symbol.toStringTag]||e.constructor.name||"Object";return c}}function rr(e){try{return rt(e),!1}catch{return!0}}function rt(e){return""+e}function nt(e){if(rr(e))return A("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",tr(e)),rt(e)}var ee=$.ReactCurrentOwner,nr={key:!0,ref:!0,__self:!0,__source:!0},at,it,be;be={};function ar(e){if(ce.call(e,"ref")){var a=Object.getOwnPropertyDescriptor(e,"ref").get;if(a&&a.isReactWarning)return!1}return e.ref!==void 0}function ir(e){if(ce.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function or(e,a){if(typeof e.ref=="string"&&ee.current&&a&&ee.current.stateNode!==a){var c=k(ee.current.type);be[c]||(A('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',k(ee.current.type),e.ref),be[c]=!0)}}function sr(e,a){{var c=function(){at||(at=!0,A("%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)",a))};c.isReactWarning=!0,Object.defineProperty(e,"key",{get:c,configurable:!0})}}function lr(e,a){{var c=function(){it||(it=!0,A("%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)",a))};c.isReactWarning=!0,Object.defineProperty(e,"ref",{get:c,configurable:!0})}}var cr=function(e,a,c,g,y,P,b){var v={$$typeof:n,type:e,key:a,ref:c,props:b,_owner:P};return v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(v,"_self",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.defineProperty(v,"_source",{configurable:!1,enumerable:!1,writable:!1,value:y}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v};function ur(e,a,c,g,y){{var P,b={},v=null,z=null;c!==void 0&&(nt(c),v=""+c),ir(a)&&(nt(a.key),v=""+a.key),ar(a)&&(z=a.ref,or(a,y));for(P in a)ce.call(a,P)&&!nr.hasOwnProperty(P)&&(b[P]=a[P]);if(e&&e.defaultProps){var E=e.defaultProps;for(P in E)b[P]===void 0&&(b[P]=E[P])}if(v||z){var x=typeof e=="function"?e.displayName||e.name||"Unknown":e;v&&sr(b,x),z&&lr(b,x)}return cr(e,v,z,y,g,ee.current,b)}}var ye=$.ReactCurrentOwner,ot=$.ReactDebugCurrentFrame;function G(e){if(e){var a=e._owner,c=le(e.type,e._source,a?a.type:null);ot.setExtraStackFrame(c)}else ot.setExtraStackFrame(null)}var we;we=!1;function _e(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function st(){{if(ye.current){var e=k(ye.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function dr(e){{if(e!==void 0){var a=e.fileName.replace(/^.*[\\\/]/,""),c=e.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+a+":"+
|
|
25
|
+
Check your code at `+a+":"+c+"."}return""}}var lt={};function fr(e){{var a=st();if(!a){var c=typeof e=="string"?e:e.displayName||e.name;c&&(a=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+u+">.")}return a}}function Xe(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var u=Qt(a);if(Je[u])return;Je[u]=!0;var g="";e&&e._owner&&e._owner!==we.current&&(g=" It was passed a child from "+k(e._owner.type)+"."),G(e),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',u,g),G(null)}}function Qe(e,a){{if(typeof e!="object")return;if(ve(e))for(var u=0;u<e.length;u++){var g=e[u];_e(g)&&Xe(g,a)}else if(_e(e))e._store&&(e._store.validated=!0);else if(e){var w=pe(e);if(typeof w=="function"&&w!==e.entries)for(var R=w.call(e),b;!(b=R.next()).done;)_e(b.value)&&Xe(b.value,a)}}}function Zt(e){{var a=e.type;if(a==null||typeof a=="string")return;var u;if(typeof a=="function")u=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===h||a.$$typeof===m))u=a.propTypes;else return;if(u){var g=k(a);Lt(u,e.props,"prop",g,e)}else if(a.PropTypes!==void 0&&!ye){ye=!0;var w=k(a);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",w||"Unknown")}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ht(e){{for(var a=Object.keys(e.props),u=0;u<a.length;u++){var g=a[u];if(g!=="children"&&g!=="key"){G(e),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",g),G(null);break}}e.ref!==null&&(G(e),x("Invalid attribute `ref` supplied to `React.Fragment`."),G(null))}}function Ze(e,a,u,g,w,R){{var b=zt(e);if(!b){var v="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(v+=" 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 z=Xt(w);z?v+=z:v+=Ke();var E;e===null?E="null":ve(e)?E="array":e!==void 0&&e.$$typeof===n?(E="<"+(k(e.type)||"Unknown")+" />",v=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,v)}var O=Jt(e,a,u,w,R);if(O==null)return O;if(b){var I=a.children;if(I!==void 0)if(g)if(ve(I)){for(var K=0;K<I.length;K++)Qe(I[K],e);Object.freeze&&Object.freeze(I)}else x("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 Qe(I,e)}return e===l?Ht(O):Zt(O),O}}function er(e,a,u){return Ze(e,a,u,!0)}function tr(e,a,u){return Ze(e,a,u,!1)}var rr=tr,nr=er;Z.Fragment=l,Z.jsx=rr,Z.jsxs=nr}()),Z}(function(t){process.env.NODE_ENV==="production"?t.exports=ut():t.exports=ct()})(ae);const N=ae.exports.Fragment,r=ae.exports.jsx,y=ae.exports.jsxs;function dt({postSubmit:t,styles:n=ne}){const{control:o,handleSubmit:l}=C.useForm({defaultValues:{type:"postgresql",key:"",config:{host:"",port:5432,username:"",password:"",database:""}}}),d=async({type:i,key:c,config:f})=>{T.showNotification({id:"for-creating",title:"Pending",message:"Adding data source...",loading:!0});try{await D.datasource.create(i,c,f),T.updateNotification({id:"for-creating",title:"Successful",message:"Data source is added",color:"green"}),t()}catch(h){T.updateNotification({id:"for-creating",title:"Failed",message:h.message,color:"red"})}};return r(s.Box,{mx:"auto",children:y("form",{onSubmit:l(d),children:[r(C.Controller,{name:"type",control:o,render:({field:i})=>r(s.SegmentedControl,{fullWidth:!0,mb:n.spacing,size:n.size,data:[{label:"PostgreSQL",value:"postgresql"},{label:"MySQL",value:"mysql"},{label:"HTTP",value:"http",disabled:!0}],...i})}),r(C.Controller,{name:"key",control:o,render:({field:i})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Name",placeholder:"A unique name",...i})}),r(s.Divider,{label:"Connection Info",labelPosition:"center"}),y(s.Group,{grow:!0,children:[r(C.Controller,{name:"config.host",control:o,render:({field:i})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Host",sx:{flexGrow:1},...i})}),r(C.Controller,{name:"config.port",control:o,render:({field:i})=>r(s.NumberInput,{mb:n.spacing,size:n.size,required:!0,label:"Port",hideControls:!0,sx:{width:"8em"},...i})})]}),r(C.Controller,{name:"config.username",control:o,render:({field:i})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Username",...i})}),r(C.Controller,{name:"config.password",control:o,render:({field:i})=>r(s.PasswordInput,{mb:n.spacing,size:n.size,required:!0,label:"Password",...i})}),r(C.Controller,{name:"config.database",control:o,render:({field:i})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Database",...i})}),r(s.Group,{position:"right",mt:n.spacing,children:r(s.Button,{type:"submit",size:n.button.size,children:"Save"})})]})})}function Pe({onSuccess:t,styles:n=ne}){const[o,l]=Y.default.useState(!1),d=()=>l(!0),i=()=>l(!1),c=()=>{t(),i()};return y(N,{children:[r(s.Modal,{overflow:"inside",opened:o,onClose:()=>l(!1),title:"Add a data source",trapFocus:!0,onDragStart:f=>{f.stopPropagation()},children:r(dt,{postSubmit:c,styles:n})}),r(s.Button,{size:n.button.size,onClick:d,leftIcon:r(B.PlaylistAdd,{size:20}),children:"Add a Data Source"})]})}function de(){return de=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&(t[l]=o[l])}return t},de.apply(this,arguments)}function ft(t,n){if(t==null)return{};var o,l,d=function(c,f){if(c==null)return{};var h,S,_={},m=Object.keys(c);for(S=0;S<m.length;S++)h=m[S],f.indexOf(h)>=0||(_[h]=c[h]);return _}(t,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(l=0;l<i.length;l++)o=i[l],n.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(t,o)&&(d[o]=t[o])}return d}var pt=["size","color","stroke"];function gt(t){var n=t.size,o=n===void 0?24:n,l=t.color,d=l===void 0?"currentColor":l,i=t.stroke,c=i===void 0?2:i,f=ft(t,pt);return X.createElement("svg",de({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-lock",width:o,height:o,viewBox:"0 0 24 24",strokeWidth:c,stroke:d,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},f),X.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),X.createElement("rect",{x:5,y:11,width:14,height:10,rx:2}),X.createElement("circle",{cx:12,cy:16,r:1}),X.createElement("path",{d:"M8 11v-4a4 4 0 0 1 8 0v4"}))}function Ce({id:t,name:n,isProtected:o,onSuccess:l,styles:d=ne}){const i=J.useModals(),c=async()=>{!t||(T.showNotification({id:"for-deleting",title:"Pending",message:"Deleting data source...",loading:!0}),await D.datasource.delete(t),T.updateNotification({id:"for-deleting",title:"Successful",message:`Data source [${n}] is deleted`,color:"green"}),l())},f=()=>i.openConfirmModal({title:"Delete this data source?",children:r(s.Text,{size:d.size,children:"This action won't affect your database."}),labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:c}),h=s.useMantineTheme();return o?r(s.Tooltip,{withArrow:!0,events:{hover:!0,touch:!1,focus:!1},label:"This is a preset datasource, it can not be deleted",children:r("span",{children:r(gt,{size:16,color:h.colors.gray[7]})})}):r(s.Button,{size:d.button.size,color:"red",onClick:f,leftIcon:r(B.Trash,{size:20}),children:"Delete"})}function ht({styles:t=ne,config:n}){re(n);const{data:o=[],loading:l,refresh:d}=V.useRequest(async()=>{const{data:i}=await D.datasource.list();return i},{refreshDeps:[]});return y(N,{children:[r(s.Group,{pt:t.spacing,position:"right",children:r(Pe,{onSuccess:d})}),y(s.Box,{mt:t.spacing,sx:{position:"relative"},children:[r(s.LoadingOverlay,{visible:l}),y(s.Table,{horizontalSpacing:t.spacing,verticalSpacing:t.spacing,fontSize:t.size,highlightOnHover:!0,children:[r("thead",{children:y("tr",{children:[r("th",{children:"Type"}),r("th",{children:"Name"}),r("th",{children:"Action"})]})}),r("tbody",{children:o.map(({id:i,key:c,type:f,is_preset:h})=>y("tr",{children:[r("td",{width:200,children:f}),r("td",{children:c}),r("td",{width:200,children:r(s.Group,{position:"left",children:r(Ce,{isProtected:h,id:i,name:c,onSuccess:d})})})]},c))})]})]})]})}const mt=W.forwardRef(({label:t,value:n,description:o,...l},d)=>y(s.Stack,{spacing:2,ref:d,...l,children:[r(s.Text,{size:"sm",children:t}),r(s.Text,{size:"xs",color:"dimmed",className:"role-description",children:o})]})),fe=W.forwardRef(({styles:t,value:n,onChange:o},l)=>{const{data:d=[],loading:i}=V.useRequest(async()=>(await D.role.list()).map(f=>({label:f.name,value:f.id,description:f.description,disabled:f.id===50})),{refreshDeps:[]});return r(s.Select,{ref:l,mb:t.spacing,size:t.size,required:!0,label:"Role",itemComponent:mt,data:d,disabled:i,styles:()=>({item:{"&[data-selected]":{"&, &:hover":{".role-description":{color:"rgba(255,255,255,.8)"}}}}}),value:n,onChange:o})}),L={size:"sm",spacing:"md",button:{size:"xs"}};function vt({postSubmit:t,styles:n=L,initialRoleID:o}){const{control:l,handleSubmit:d}=C.useForm({defaultValues:{name:"",email:"",role_id:o,password:""}}),i=async({name:c,email:f,password:h,role_id:S})=>{try{T.showNotification({id:"for-creating",title:"Pending",message:"Adding account...",loading:!0}),await D.account.create(c,f,h,S),T.updateNotification({id:"for-creating",title:"Successful",message:"Account is added",color:"green"}),t()}catch(_){T.updateNotification({id:"for-creating",title:"Failed",message:_.message,color:"red"})}};return r(s.Box,{mx:"auto",children:y("form",{onSubmit:d(i),children:[r(C.Controller,{name:"name",control:l,render:({field:c})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Username",...c})}),r(C.Controller,{name:"email",control:l,render:({field:c})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Email",...c})}),r(C.Controller,{name:"password",control:l,render:({field:c})=>r(s.PasswordInput,{mb:n.spacing,size:n.size,required:!0,label:"Password",description:"Password must be at least 8 characters long",...c})}),r(C.Controller,{name:"role_id",control:l,render:({field:c})=>r(fe,{styles:n,...c})}),r(s.Group,{position:"right",mt:n.spacing,children:r(s.Button,{type:"submit",size:n.button.size,children:"Save"})})]})})}function Te({onSuccess:t,styles:n=L,initialRoleID:o}){const[l,d]=Y.default.useState(!1),i=()=>d(!0),c=()=>d(!1),f=()=>{t(),c()};return y(N,{children:[r(s.Modal,{overflow:"inside",opened:l,onClose:()=>d(!1),title:"Add an Account",trapFocus:!0,onDragStart:h=>{h.stopPropagation()},children:r(vt,{postSubmit:f,styles:n,initialRoleID:o})}),r(s.Button,{size:n.button.size,onClick:i,leftIcon:r(B.PlaylistAdd,{size:20}),children:"Add an Account"})]})}function Ee({id:t,name:n,onSuccess:o,styles:l=L}){const d=J.useModals(),i=async()=>{if(!!t){T.showNotification({id:"for-deleting",title:"Pending",message:"Deleting account...",loading:!0});try{await D.account.delete(t),T.updateNotification({id:"for-deleting",title:"Successful",message:`Account [${n}] is deleted`,color:"green"}),o()}catch(f){T.updateNotification({id:"for-deleting",title:"Failed",message:f.message,color:"red"})}}},c=()=>d.openConfirmModal({title:"Delete this account?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:i});return r(s.Button,{size:l.button.size,color:"red",onClick:c,leftIcon:r(B.Trash,{size:20}),children:"Delete"})}function bt({id:t,name:n,email:o,role_id:l,postSubmit:d,styles:i=L}){const{control:c,handleSubmit:f,watch:h}=C.useForm({defaultValues:{name:n,email:o,role_id:l,reset_password:!1,new_password:""}}),S=async({name:p,email:j,role_id:M,reset_password:$,new_password:pe})=>{try{T.showNotification({id:"for-updating",title:"Pending",message:"Updating account...",loading:!0}),await D.account.edit({id:t,name:p,email:j,role_id:M,reset_password:$,new_password:pe}),T.updateNotification({id:"for-updating",title:"Successful",message:"Account is updated",color:"green"}),d()}catch(F){T.updateNotification({id:"for-updating",title:"Failed",message:F.message,color:"red"})}},[_,m]=h(["reset_password","new_password"]);return r(s.Box,{mx:"auto",children:y("form",{onSubmit:f(S),children:[r(C.Controller,{name:"name",control:c,render:({field:p})=>r(s.TextInput,{mb:i.spacing,size:i.size,required:!0,label:"Username",...p})}),r(C.Controller,{name:"email",control:c,render:({field:p})=>r(s.TextInput,{mb:i.spacing,size:i.size,required:!0,label:"Email",...p})}),r(C.Controller,{name:"role_id",control:c,render:({field:p})=>r(fe,{styles:i,...p})}),r(s.Divider,{my:20,variant:"dashed",label:"",labelPosition:"center"}),r(C.Controller,{name:"reset_password",control:c,render:({field:p})=>r(s.Switch,{mb:i.spacing,size:i.size,label:"Reset password",checked:p.value,onChange:j=>p.onChange(j.currentTarget.checked),styles:{label:{verticalAlign:"middle"}}})}),_&&r(C.Controller,{name:"new_password",control:c,render:({field:p})=>r(s.PasswordInput,{autoComplete:"off",mb:i.spacing,size:i.size,required:!0,description:"Password must be at least 8 characters long",label:"New Password",...p})}),r(s.Group,{position:"right",mt:i.spacing,children:r(s.Button,{type:"submit",size:i.button.size,children:"Submit"})})]})})}function wt({account:t,onSuccess:n,styles:o=L}){const[l,d]=Y.default.useState(!1),i=()=>d(!0),c=()=>d(!1),f=()=>{n(),c()};return y(N,{children:[r(s.Modal,{overflow:"inside",opened:l,onClose:()=>d(!1),title:`Editing ${t.name}`,trapFocus:!0,onDragStart:h=>{h.stopPropagation()},children:r(bt,{...t,postSubmit:f,styles:o})}),r(s.Button,{size:o.button.size,onClick:i,leftIcon:r(B.Edit,{size:20}),children:"Edit"})]})}function yt({styles:t=L,config:n}){var S,_;re(n);const{data:o=[],loading:l,refresh:d}=V.useRequest(async()=>{const{data:m}=await D.account.list();return m},{refreshDeps:[]}),{data:i=[],loading:c}=V.useRequest(async()=>(await D.role.list()).map(p=>({label:p.name,value:p.id,description:p.description,disabled:p.id===50})),{refreshDeps:[]}),f=W.useMemo(()=>i.reduce((m,p)=>(m.set(p.value,p.label),m),new Map),[i]),h=m=>{var p;return(p=f.get(m))!=null?p:m};return y(N,{children:[r(s.Group,{pt:t.spacing,position:"right",children:r(Te,{onSuccess:d,initialRoleID:(_=(S=i==null?void 0:i[0])==null?void 0:S.value)!=null?_:0})}),y(s.Box,{mt:t.spacing,sx:{position:"relative"},children:[r(s.LoadingOverlay,{visible:l||c}),y(s.Table,{horizontalSpacing:t.spacing,verticalSpacing:t.spacing,fontSize:t.size,highlightOnHover:!0,children:[r("thead",{children:y("tr",{children:[r("th",{children:"Username"}),r("th",{children:"Email"}),r("th",{children:"Role"}),r("th",{children:"Action"})]})}),r("tbody",{children:o.map(m=>{const{id:p,name:j,email:M,role_id:$}=m;return y("tr",{children:[r("td",{width:200,children:j}),r("td",{width:200,children:M}),r("td",{width:200,children:h($)}),r("td",{width:200,children:y(s.Group,{position:"left",children:[r(wt,{account:m,onSuccess:d}),r(Ee,{id:p,name:j,onSuccess:d})]})})]},p)})})]})]})]})}function _t({postSubmit:t,styles:n=L}){const{control:o,handleSubmit:l}=C.useForm({defaultValues:{name:"",password:""}}),d=async({name:i,password:c})=>{try{T.showNotification({id:"for-login",title:"Pending",message:"Loggin in...",loading:!0});const f=await D.account.login(i,c);window.localStorage.setItem("token",f.token),T.updateNotification({id:"for-login",title:"Successful",message:"Logged in",color:"green"}),t(f)}catch(f){T.updateNotification({id:"for-login",title:"Login Failed",message:f.message,color:"red"})}};return r(s.Box,{mx:"auto",children:y("form",{onSubmit:l(d),children:[r(C.Controller,{name:"name",control:o,render:({field:i})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Username",...i})}),r(C.Controller,{name:"password",control:o,render:({field:i})=>r(s.PasswordInput,{mb:n.spacing,size:n.size,required:!0,label:"Password",...i})}),r(s.Group,{position:"right",mt:n.spacing,children:r(s.Button,{type:"submit",size:n.button.size,children:"Submit"})})]})})}function St({styles:t=L,config:n,onSuccess:o}){return re(n),r(N,{children:r(s.Box,{mt:t.spacing,sx:{position:"relative"},children:r(_t,{styles:t,postSubmit:o})})})}const ie={size:"sm",spacing:"md",button:{size:"xs"}};function Rt({postSubmit:t,styles:n=ie,initialRoleID:o}){const{control:l,handleSubmit:d}=C.useForm({defaultValues:{name:"",role_id:o}}),i=async({name:c,role_id:f})=>{try{T.showNotification({id:"for-creating",title:"Pending",message:"Adding API Key...",loading:!0});const{app_id:h,app_secret:S}=await D.api_key.create(c,f);T.updateNotification({id:"for-creating",title:"Successful",message:"API Key is added",color:"green"}),t(h,S)}catch(h){T.updateNotification({id:"for-creating",title:"Failed",message:h.message,color:"red"})}};return r(s.Box,{mx:"auto",children:y("form",{onSubmit:d(i),children:[r(C.Controller,{name:"name",control:l,render:({field:c})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Name",...c})}),r(C.Controller,{name:"role_id",control:l,render:({field:c})=>r(fe,{styles:n,...c})}),r(s.Group,{position:"right",mt:n.spacing,children:r(s.Button,{type:"submit",size:n.button.size,children:"Save"})})]})})}function Oe({onSuccess:t,styles:n=ie,initialRoleID:o}){const l=J.useModals(),[d,i]=Y.default.useState(!1),c=()=>i(!0),f=()=>i(!1),h=(S,_)=>{f(),l.openModal({title:"API Key is generated",children:y(s.Stack,{children:[r(s.Text,{color:"dimmed",children:"Make sure you save it - you won't be able to access it again."}),r(s.TextInput,{defaultValue:S,disabled:!0,label:"APP ID",styles:{input:{cursor:"text !important"}}}),r(s.TextInput,{defaultValue:_,disabled:!0,label:"APP Secret",styles:{input:{cursor:"text !important"}}}),r(s.Button,{size:"sm",onClick:()=>{J.closeAllModals()},children:"I've saved this API Key"})]}),onClose:()=>{t()}})};return y(N,{children:[r(s.Modal,{overflow:"inside",opened:d,onClose:()=>i(!1),title:"Add an API Key",trapFocus:!0,onDragStart:S=>{S.stopPropagation()},children:r(Rt,{postSubmit:h,styles:n,initialRoleID:o})}),r(s.Button,{size:n.button.size,onClick:c,leftIcon:r(B.PlaylistAdd,{size:20}),children:"Add an API Key"})]})}function Ae({id:t,name:n,onSuccess:o,styles:l=ie}){const d=J.useModals(),i=async()=>{if(!!t){T.showNotification({id:"for-deleting",title:"Pending",message:"Deleting API Key...",loading:!0});try{await D.api_key.delete(t),T.updateNotification({id:"for-deleting",title:"Successful",message:`API Key [${n}] is deleted`,color:"green"}),o()}catch(f){T.updateNotification({id:"for-deleting",title:"Failed",message:f.message,color:"red"})}}},c=()=>d.openConfirmModal({title:"Delete this api-key?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:i});return r(s.Button,{size:l.button.size,color:"red",onClick:c,leftIcon:r(B.Trash,{size:20}),children:"Delete"})}function Pt({styles:t=ie,config:n}){var S,_;re(n);const{data:o=[],loading:l,refresh:d}=V.useRequest(async()=>{const{data:m}=await D.api_key.list();return m},{refreshDeps:[]}),{data:i=[],loading:c}=V.useRequest(async()=>(await D.role.list()).map(p=>({label:p.name,value:p.id,description:p.description,disabled:p.id===50})),{refreshDeps:[]}),f=W.useMemo(()=>i.reduce((m,p)=>(m.set(p.value,p.label),m),new Map),[i]),h=m=>{var p;return(p=f.get(m))!=null?p:m};return y(N,{children:[r(s.Group,{pt:t.spacing,position:"right",children:r(Oe,{onSuccess:d,initialRoleID:(_=(S=i==null?void 0:i[0])==null?void 0:S.value)!=null?_:0})}),y(s.Box,{mt:t.spacing,sx:{position:"relative"},children:[r(s.LoadingOverlay,{visible:l||c}),y(s.Table,{horizontalSpacing:t.spacing,verticalSpacing:t.spacing,fontSize:t.size,highlightOnHover:!0,children:[r("thead",{children:y("tr",{children:[r("th",{children:"Name"}),r("th",{children:"APP ID"}),r("th",{children:"Role"}),r("th",{children:"Action"})]})}),r("tbody",{children:o.map(m=>{const{id:p,name:j,app_id:M,role_id:$}=m;return y("tr",{children:[r("td",{width:200,children:j}),r("td",{width:200,children:M}),r("td",{width:200,children:h($)}),r("td",{width:200,children:r(s.Group,{position:"left",children:r(Ae,{id:p,name:j,onSuccess:d})})})]},p)})})]})]})]})}P.APIKeyList=Pt,P.AccountList=yt,P.AddAPIKey=Oe,P.AddAccount=Te,P.AddDataSource=Pe,P.DataSourceList=ht,P.DeleteAPIKey=Ae,P.DeleteAccount=Ee,P.DeleteDataSource=Ce,P.Login=St,Object.defineProperties(P,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
27
|
+
Check the top-level render call using <`+c+">.")}return a}}function ct(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var c=fr(a);if(lt[c])return;lt[c]=!0;var g="";e&&e._owner&&e._owner!==ye.current&&(g=" It was passed a child from "+k(e._owner.type)+"."),G(e),A('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',c,g),G(null)}}function ut(e,a){{if(typeof e!="object")return;if(ve(e))for(var c=0;c<e.length;c++){var g=e[c];_e(g)&&ct(g,a)}else if(_e(e))e._store&&(e._store.validated=!0);else if(e){var y=pe(e);if(typeof y=="function"&&y!==e.entries)for(var P=y.call(e),b;!(b=P.next()).done;)_e(b.value)&&ct(b.value,a)}}}function pr(e){{var a=e.type;if(a==null||typeof a=="string")return;var c;if(typeof a=="function")c=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===h||a.$$typeof===m))c=a.propTypes;else return;if(c){var g=k(a);Ht(c,e.props,"prop",g,e)}else if(a.PropTypes!==void 0&&!we){we=!0;var y=k(a);A("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",y||"Unknown")}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&A("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function gr(e){{for(var a=Object.keys(e.props),c=0;c<a.length;c++){var g=a[c];if(g!=="children"&&g!=="key"){G(e),A("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",g),G(null);break}}e.ref!==null&&(G(e),A("Invalid attribute `ref` supplied to `React.Fragment`."),G(null))}}function dt(e,a,c,g,y,P){{var b=Yt(e);if(!b){var v="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(v+=" 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 z=dr(y);z?v+=z:v+=st();var E;e===null?E="null":ve(e)?E="array":e!==void 0&&e.$$typeof===n?(E="<"+(k(e.type)||"Unknown")+" />",v=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,v)}var x=ur(e,a,c,y,P);if(x==null)return x;if(b){var I=a.children;if(I!==void 0)if(g)if(ve(I)){for(var K=0;K<I.length;K++)ut(I[K],e);Object.freeze&&Object.freeze(I)}else A("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 ut(I,e)}return e===l?gr(x):pr(x),x}}function hr(e,a,c){return dt(e,a,c,!0)}function mr(e,a,c){return dt(e,a,c,!1)}var vr=mr,br=hr;Z.Fragment=l,Z.jsx=vr,Z.jsxs=br}()),Z}(function(t){process.env.NODE_ENV==="production"?t.exports=St():t.exports=Pt()})(ae);const N=ae.exports.Fragment,r=ae.exports.jsx,w=ae.exports.jsxs;function Rt({postSubmit:t,styles:n=ne}){const{control:o,handleSubmit:l}=C.useForm({defaultValues:{type:"postgresql",key:"",config:{host:"",port:5432,username:"",password:"",database:""}}}),d=async({type:i,key:u,config:f})=>{T.showNotification({id:"for-creating",title:"Pending",message:"Adding data source...",loading:!0});try{await D.datasource.create(i,u,f),T.updateNotification({id:"for-creating",title:"Successful",message:"Data source is added",color:"green"}),t()}catch(h){T.updateNotification({id:"for-creating",title:"Failed",message:h.message,color:"red"})}};return r(s.Box,{mx:"auto",children:w("form",{onSubmit:l(d),children:[r(C.Controller,{name:"type",control:o,render:({field:i})=>r(s.SegmentedControl,{fullWidth:!0,mb:n.spacing,size:n.size,data:[{label:"PostgreSQL",value:"postgresql"},{label:"MySQL",value:"mysql"},{label:"HTTP",value:"http",disabled:!0}],...i})}),r(C.Controller,{name:"key",control:o,render:({field:i})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Name",placeholder:"A unique name",...i})}),r(s.Divider,{label:"Connection Info",labelPosition:"center"}),w(s.Group,{grow:!0,children:[r(C.Controller,{name:"config.host",control:o,render:({field:i})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Host",sx:{flexGrow:1},...i})}),r(C.Controller,{name:"config.port",control:o,render:({field:i})=>r(s.NumberInput,{mb:n.spacing,size:n.size,required:!0,label:"Port",hideControls:!0,sx:{width:"8em"},...i})})]}),r(C.Controller,{name:"config.username",control:o,render:({field:i})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Username",...i})}),r(C.Controller,{name:"config.password",control:o,render:({field:i})=>r(s.PasswordInput,{mb:n.spacing,size:n.size,required:!0,label:"Password",...i})}),r(C.Controller,{name:"config.database",control:o,render:({field:i})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Database",...i})}),r(s.Group,{position:"right",mt:n.spacing,children:r(s.Button,{type:"submit",size:n.button.size,children:"Save"})})]})})}function Re({onSuccess:t,styles:n=ne}){const[o,l]=Y.default.useState(!1),d=()=>l(!0),i=()=>l(!1),u=()=>{t(),i()};return w(N,{children:[r(s.Modal,{overflow:"inside",opened:o,onClose:()=>l(!1),title:"Add a data source",trapFocus:!0,onDragStart:f=>{f.stopPropagation()},children:r(Rt,{postSubmit:u,styles:n})}),r(s.Button,{size:n.button.size,onClick:d,leftIcon:r(F.PlaylistAdd,{size:20}),children:"Add a Data Source"})]})}function de(){return de=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var l in o)Object.prototype.hasOwnProperty.call(o,l)&&(t[l]=o[l])}return t},de.apply(this,arguments)}function Ct(t,n){if(t==null)return{};var o,l,d=function(u,f){if(u==null)return{};var h,S,_={},m=Object.keys(u);for(S=0;S<m.length;S++)h=m[S],f.indexOf(h)>=0||(_[h]=u[h]);return _}(t,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(l=0;l<i.length;l++)o=i[l],n.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(t,o)&&(d[o]=t[o])}return d}var Tt=["size","color","stroke"];function Et(t){var n=t.size,o=n===void 0?24:n,l=t.color,d=l===void 0?"currentColor":l,i=t.stroke,u=i===void 0?2:i,f=Ct(t,Tt);return X.createElement("svg",de({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-lock",width:o,height:o,viewBox:"0 0 24 24",strokeWidth:u,stroke:d,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},f),X.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),X.createElement("rect",{x:5,y:11,width:14,height:10,rx:2}),X.createElement("circle",{cx:12,cy:16,r:1}),X.createElement("path",{d:"M8 11v-4a4 4 0 0 1 8 0v4"}))}function Ce({id:t,name:n,isProtected:o,onSuccess:l,styles:d=ne}){const i=J.useModals(),u=async()=>{!t||(T.showNotification({id:"for-deleting",title:"Pending",message:"Deleting data source...",loading:!0}),await D.datasource.delete(t),T.updateNotification({id:"for-deleting",title:"Successful",message:`Data source [${n}] is deleted`,color:"green"}),l())},f=()=>i.openConfirmModal({title:"Delete this data source?",children:r(s.Text,{size:d.size,children:"This action won't affect your database."}),labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:u}),h=s.useMantineTheme();return o?r(s.Tooltip,{withArrow:!0,events:{hover:!0,touch:!1,focus:!1},label:"This is a preset datasource, it can not be deleted",children:r("span",{children:r(Et,{size:16,color:h.colors.gray[7]})})}):r(s.Button,{size:d.button.size,color:"red",onClick:f,leftIcon:r(F.Trash,{size:20}),children:"Delete"})}function xt({styles:t=ne,config:n}){re(n);const{data:o=[],loading:l,refresh:d}=V.useRequest(async()=>{const{data:i}=await D.datasource.list();return i},{refreshDeps:[]});return w(N,{children:[r(s.Group,{pt:t.spacing,position:"right",children:r(Re,{onSuccess:d})}),w(s.Box,{mt:t.spacing,sx:{position:"relative"},children:[r(s.LoadingOverlay,{visible:l}),w(s.Table,{horizontalSpacing:t.spacing,verticalSpacing:t.spacing,fontSize:t.size,highlightOnHover:!0,children:[r("thead",{children:w("tr",{children:[r("th",{children:"Type"}),r("th",{children:"Name"}),r("th",{children:"Action"})]})}),r("tbody",{children:o.map(({id:i,key:u,type:f,is_preset:h})=>w("tr",{children:[r("td",{width:200,children:f}),r("td",{children:u}),r("td",{width:200,children:r(s.Group,{position:"left",children:r(Ce,{isProtected:h,id:i,name:u,onSuccess:d})})})]},u))})]})]})]})}const Ot=W.forwardRef(({label:t,value:n,description:o,...l},d)=>w(s.Stack,{spacing:2,ref:d,...l,children:[r(s.Text,{size:"sm",children:t}),r(s.Text,{size:"xs",color:"dimmed",className:"role-description",children:o})]})),fe=W.forwardRef(({styles:t,value:n,onChange:o},l)=>{const{data:d=[],loading:i}=V.useRequest(async()=>(await D.role.list()).map(f=>({label:f.name,value:f.id,description:f.description,disabled:f.id===50})),{refreshDeps:[]});return r(s.Select,{ref:l,mb:t.spacing,size:t.size,required:!0,label:"Role",itemComponent:Ot,data:d,disabled:i,styles:()=>({item:{"&[data-selected]":{"&, &:hover":{".role-description":{color:"rgba(255,255,255,.8)"}}}}}),value:n,onChange:o})}),L={size:"sm",spacing:"md",button:{size:"xs"}};function At({postSubmit:t,styles:n=L,initialRoleID:o}){const{control:l,handleSubmit:d}=C.useForm({defaultValues:{name:"",email:"",role_id:o,password:""}}),i=async({name:u,email:f,password:h,role_id:S})=>{try{T.showNotification({id:"for-creating",title:"Pending",message:"Adding account...",loading:!0}),await D.account.create(u,f,h,S),T.updateNotification({id:"for-creating",title:"Successful",message:"Account is added",color:"green"}),t()}catch(_){T.updateNotification({id:"for-creating",title:"Failed",message:_.message,color:"red"})}};return r(s.Box,{mx:"auto",children:w("form",{onSubmit:d(i),children:[r(C.Controller,{name:"name",control:l,render:({field:u})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Username",...u})}),r(C.Controller,{name:"email",control:l,render:({field:u})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Email",...u})}),r(C.Controller,{name:"password",control:l,render:({field:u})=>r(s.PasswordInput,{mb:n.spacing,size:n.size,required:!0,label:"Password",description:"Password must be at least 8 characters long",...u})}),r(C.Controller,{name:"role_id",control:l,render:({field:u})=>r(fe,{styles:n,...u})}),r(s.Group,{position:"right",mt:n.spacing,children:r(s.Button,{type:"submit",size:n.button.size,children:"Save"})})]})})}function Te({onSuccess:t,styles:n=L,initialRoleID:o}){const[l,d]=Y.default.useState(!1),i=()=>d(!0),u=()=>d(!1),f=()=>{t(),u()};return w(N,{children:[r(s.Modal,{overflow:"inside",opened:l,onClose:()=>d(!1),title:"Add an Account",trapFocus:!0,onDragStart:h=>{h.stopPropagation()},children:r(At,{postSubmit:f,styles:n,initialRoleID:o})}),r(s.Button,{size:n.button.size,onClick:i,leftIcon:r(F.PlaylistAdd,{size:20}),children:"Add an Account"})]})}function Ee({id:t,name:n,onSuccess:o,styles:l=L}){const d=J.useModals(),i=async()=>{if(!!t){T.showNotification({id:"for-deleting",title:"Pending",message:"Deleting account...",loading:!0});try{await D.account.delete(t),T.updateNotification({id:"for-deleting",title:"Successful",message:`Account [${n}] is deleted`,color:"green"}),o()}catch(f){T.updateNotification({id:"for-deleting",title:"Failed",message:f.message,color:"red"})}}},u=()=>d.openConfirmModal({title:"Delete this account?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:i});return r(s.Button,{size:l.button.size,color:"red",onClick:u,leftIcon:r(F.Trash,{size:20}),children:"Delete"})}function zt({id:t,name:n,email:o,role_id:l,postSubmit:d,styles:i=L}){const{control:u,handleSubmit:f,watch:h}=C.useForm({defaultValues:{name:n,email:o,role_id:l,reset_password:!1,new_password:""}}),S=async({name:p,email:j,role_id:M,reset_password:B,new_password:pe})=>{try{T.showNotification({id:"for-updating",title:"Pending",message:"Updating account...",loading:!0}),await D.account.edit({id:t,name:p,email:j,role_id:M,reset_password:B,new_password:pe}),T.updateNotification({id:"for-updating",title:"Successful",message:"Account is updated",color:"green"}),d()}catch($){T.updateNotification({id:"for-updating",title:"Failed",message:$.message,color:"red"})}},[_,m]=h(["reset_password","new_password"]);return r(s.Box,{mx:"auto",children:w("form",{onSubmit:f(S),children:[r(C.Controller,{name:"name",control:u,render:({field:p})=>r(s.TextInput,{mb:i.spacing,size:i.size,required:!0,label:"Username",...p})}),r(C.Controller,{name:"email",control:u,render:({field:p})=>r(s.TextInput,{mb:i.spacing,size:i.size,required:!0,label:"Email",...p})}),r(C.Controller,{name:"role_id",control:u,render:({field:p})=>r(fe,{styles:i,...p})}),r(s.Divider,{my:20,variant:"dashed",label:"",labelPosition:"center"}),r(C.Controller,{name:"reset_password",control:u,render:({field:p})=>r(s.Switch,{mb:i.spacing,size:i.size,label:"Reset password",checked:p.value,onChange:j=>p.onChange(j.currentTarget.checked),styles:{label:{verticalAlign:"middle"}}})}),_&&r(C.Controller,{name:"new_password",control:u,render:({field:p})=>r(s.PasswordInput,{autoComplete:"off",mb:i.spacing,size:i.size,required:!0,description:"Password must be at least 8 characters long",label:"New Password",...p})}),r(s.Group,{position:"right",mt:i.spacing,children:r(s.Button,{type:"submit",size:i.button.size,children:"Submit"})})]})})}function Dt({account:t,onSuccess:n,styles:o=L}){const[l,d]=Y.default.useState(!1),i=()=>d(!0),u=()=>d(!1),f=()=>{n(),u()};return w(N,{children:[r(s.Modal,{overflow:"inside",opened:l,onClose:()=>d(!1),title:`Editing ${t.name}`,trapFocus:!0,onDragStart:h=>{h.stopPropagation()},children:r(zt,{...t,postSubmit:f,styles:o})}),r(s.Button,{size:o.button.size,onClick:i,leftIcon:r(F.Edit,{size:20}),children:"Edit"})]})}function jt({styles:t=L,config:n}){var S,_;re(n);const{data:o=[],loading:l,refresh:d}=V.useRequest(async()=>{const{data:m}=await D.account.list();return m},{refreshDeps:[]}),{data:i=[],loading:u}=V.useRequest(async()=>(await D.role.list()).map(p=>({label:p.name,value:p.id,description:p.description,disabled:p.id===50})),{refreshDeps:[]}),f=W.useMemo(()=>i.reduce((m,p)=>(m.set(p.value,p.label),m),new Map),[i]),h=m=>{var p;return(p=f.get(m))!=null?p:m};return w(N,{children:[r(s.Group,{pt:t.spacing,position:"right",children:r(Te,{onSuccess:d,initialRoleID:(_=(S=i==null?void 0:i[0])==null?void 0:S.value)!=null?_:0})}),w(s.Box,{mt:t.spacing,sx:{position:"relative"},children:[r(s.LoadingOverlay,{visible:l||u}),w(s.Table,{horizontalSpacing:t.spacing,verticalSpacing:t.spacing,fontSize:t.size,highlightOnHover:!0,children:[r("thead",{children:w("tr",{children:[r("th",{children:"Username"}),r("th",{children:"Email"}),r("th",{children:"Role"}),r("th",{children:"Action"})]})}),r("tbody",{children:o.map(m=>{const{id:p,name:j,email:M,role_id:B}=m;return w("tr",{children:[r("td",{width:200,children:j}),r("td",{width:200,children:M}),r("td",{width:200,children:h(B)}),r("td",{width:200,children:w(s.Group,{position:"left",children:[r(Dt,{account:m,onSuccess:d}),r(Ee,{id:p,name:j,onSuccess:d})]})})]},p)})})]})]})]})}function It({postSubmit:t,styles:n=L}){const{control:o,handleSubmit:l}=C.useForm({defaultValues:{name:"",password:""}}),d=async({name:i,password:u})=>{try{T.showNotification({id:"for-login",title:"Pending",message:"Loggin in...",loading:!0});const f=await D.account.login(i,u);window.localStorage.setItem("token",f.token),T.updateNotification({id:"for-login",title:"Successful",message:"Logged in",color:"green"}),t(f)}catch(f){T.updateNotification({id:"for-login",title:"Login Failed",message:f.message,color:"red"})}};return r(s.Box,{mx:"auto",children:w("form",{onSubmit:l(d),children:[r(C.Controller,{name:"name",control:o,render:({field:i})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Username",...i})}),r(C.Controller,{name:"password",control:o,render:({field:i})=>r(s.PasswordInput,{mb:n.spacing,size:n.size,required:!0,label:"Password",...i})}),r(s.Group,{position:"right",mt:n.spacing,children:r(s.Button,{type:"submit",size:n.button.size,children:"Submit"})})]})})}function kt({styles:t=L,config:n,onSuccess:o}){return re(n),r(N,{children:r(s.Box,{mt:t.spacing,sx:{position:"relative"},children:r(It,{styles:t,postSubmit:o})})})}const ie={size:"sm",spacing:"md",button:{size:"xs"}};function qt({postSubmit:t,styles:n=ie,initialRoleID:o}){const{control:l,handleSubmit:d}=C.useForm({defaultValues:{name:"",role_id:o}}),i=async({name:u,role_id:f})=>{try{T.showNotification({id:"for-creating",title:"Pending",message:"Adding API Key...",loading:!0});const{app_id:h,app_secret:S}=await D.api_key.create(u,f);T.updateNotification({id:"for-creating",title:"Successful",message:"API Key is added",color:"green"}),t(h,S)}catch(h){T.updateNotification({id:"for-creating",title:"Failed",message:h.message,color:"red"})}};return r(s.Box,{mx:"auto",children:w("form",{onSubmit:d(i),children:[r(C.Controller,{name:"name",control:l,render:({field:u})=>r(s.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Name",...u})}),r(C.Controller,{name:"role_id",control:l,render:({field:u})=>r(fe,{styles:n,...u})}),r(s.Group,{position:"right",mt:n.spacing,children:r(s.Button,{type:"submit",size:n.button.size,children:"Save"})})]})})}function xe({onSuccess:t,styles:n=ie,initialRoleID:o}){const l=J.useModals(),[d,i]=Y.default.useState(!1),u=()=>i(!0),f=()=>i(!1),h=(S,_)=>{f(),l.openModal({title:"API Key is generated",children:w(s.Stack,{children:[r(s.Text,{color:"dimmed",children:"Make sure you save it - you won't be able to access it again."}),r(s.TextInput,{defaultValue:S,disabled:!0,label:"APP ID",styles:{input:{cursor:"text !important"}}}),r(s.TextInput,{defaultValue:_,disabled:!0,label:"APP Secret",styles:{input:{cursor:"text !important"}}}),r(s.Button,{size:"sm",onClick:()=>{J.closeAllModals()},children:"I've saved this API Key"})]}),onClose:()=>{t()}})};return w(N,{children:[r(s.Modal,{overflow:"inside",opened:d,onClose:()=>i(!1),title:"Add an API Key",trapFocus:!0,onDragStart:S=>{S.stopPropagation()},children:r(qt,{postSubmit:h,styles:n,initialRoleID:o})}),r(s.Button,{size:n.button.size,onClick:u,leftIcon:r(F.PlaylistAdd,{size:20}),children:"Add an API Key"})]})}function Oe({id:t,name:n,onSuccess:o,styles:l=ie}){const d=J.useModals(),i=async()=>{if(!!t){T.showNotification({id:"for-deleting",title:"Pending",message:"Deleting API Key...",loading:!0});try{await D.api_key.delete(t),T.updateNotification({id:"for-deleting",title:"Successful",message:`API Key [${n}] is deleted`,color:"green"}),o()}catch(f){T.updateNotification({id:"for-deleting",title:"Failed",message:f.message,color:"red"})}}},u=()=>d.openConfirmModal({title:"Delete this api-key?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:i});return r(s.Button,{size:l.button.size,color:"red",onClick:u,leftIcon:r(F.Trash,{size:20}),children:"Delete"})}function Nt({styles:t=ie,config:n}){var S,_;re(n);const{data:o=[],loading:l,refresh:d}=V.useRequest(async()=>{const{data:m}=await D.api_key.list();return m},{refreshDeps:[]}),{data:i=[],loading:u}=V.useRequest(async()=>(await D.role.list()).map(p=>({label:p.name,value:p.id,description:p.description,disabled:p.id===50})),{refreshDeps:[]}),f=W.useMemo(()=>i.reduce((m,p)=>(m.set(p.value,p.label),m),new Map),[i]),h=m=>{var p;return(p=f.get(m))!=null?p:m};return w(N,{children:[r(s.Group,{pt:t.spacing,position:"right",children:r(xe,{onSuccess:d,initialRoleID:(_=(S=i==null?void 0:i[0])==null?void 0:S.value)!=null?_:0})}),w(s.Box,{mt:t.spacing,sx:{position:"relative"},children:[r(s.LoadingOverlay,{visible:l||u}),w(s.Table,{horizontalSpacing:t.spacing,verticalSpacing:t.spacing,fontSize:t.size,highlightOnHover:!0,children:[r("thead",{children:w("tr",{children:[r("th",{children:"Name"}),r("th",{children:"APP ID"}),r("th",{children:"Role"}),r("th",{children:"Action"})]})}),r("tbody",{children:o.map(m=>{const{id:p,name:j,app_id:M,role_id:B}=m;return w("tr",{children:[r("td",{width:200,children:j}),r("td",{width:200,children:M}),r("td",{width:200,children:h(B)}),r("td",{width:200,children:r(s.Group,{position:"left",children:r(Oe,{id:p,name:j,onSuccess:d})})})]},p)})})]})]})]})}const Lt=()=>Promise.resolve().then(()=>Mt).then(({version:t})=>(console.log(`[@devtable/dashboard] version: ${t}`),t)),Ae="@devtable/settings-form",ze="6.28.1",De="Apache-2.0",je={access:"public",registry:"https://registry.npmjs.org/"},Ie=["dist"],ke="./dist/settings-form.umd.js",qe="./dist/settings-form.es.js",Ne="./dist/index.d.ts",Le={".":{import:"./dist/settings-form.es.js",require:"./dist/settings-form.umd.js"},"./dist/style.css":{import:"./dist/style.css",require:"./dist/style.css"}},Me={"dev-build":"tsc && vite build --watch",build:"tsc && vite build",preview:"vite preview"},$e={},Fe={"@types/crypto-js":"v4.1.1","@types/lodash":"^4.14.182","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","@types/react-grid-layout":"^1.3.2","rollup-plugin-visualizer":"5.6.0",typescript:"^4.6.3"},Be={"@emotion/react":"11.10.0","@mantine/core":"5.9.5","@mantine/hooks":"5.9.5","@mantine/modals":"5.9.5","@mantine/notifications":"5.9.5",ahooks:"^3.3.11",axios:"^0.27.2","crypto-js":"^4.1.1",lodash:"^4.17.21",react:"^16.8.0 || 17.x || 18.x","react-dom":"^16.8.0 || 17.x || 18.x","react-hook-form":"^7.31.2","tabler-icons-react":"^1.48.0"},Mt=Object.freeze(Object.defineProperty({__proto__:null,name:Ae,version:ze,license:De,publishConfig:je,files:Ie,main:ke,module:qe,types:Ne,exports:Le,scripts:Me,dependencies:$e,devDependencies:Fe,peerDependencies:Be,default:{name:Ae,version:ze,license:De,publishConfig:je,files:Ie,main:ke,module:qe,types:Ne,exports:Le,scripts:Me,dependencies:$e,devDependencies:Fe,peerDependencies:Be}},Symbol.toStringTag,{value:"Module"}));R.APIKeyList=Nt,R.AccountList=jt,R.AddAPIKey=xe,R.AddAccount=Te,R.AddDataSource=Re,R.DataSourceList=xt,R.DeleteAPIKey=Oe,R.DeleteAccount=Ee,R.DeleteDataSource=Ce,R.Login=kt,R.getVersion=Lt,Object.defineProperties(R,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|