@devtable/settings-form 9.6.0 → 9.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(P,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react"),require("@mantine/core"),require("@mantine/notifications"),require("tabler-icons-react"),require("axios"),require("crypto-js"),require("lodash"),require("react-hook-form"),require("ahooks"),require("@monaco-editor/react"),require("@mantine/modals")):typeof define=="function"&&define.amd?define(["exports","react","@mantine/core","@mantine/notifications","tabler-icons-react","axios","crypto-js","lodash","react-hook-form","ahooks","@monaco-editor/react","@mantine/modals"],E):(P=typeof globalThis<"u"?globalThis:P||self,E(P["settings-form"]={},P.react,P["@mantine/core"],P["@mantine/notifications"],P["tabler-icons-react"],P.axios,P.CryptoJS,P._,P["react-hook-form"],P.ahooks,P["@monaco-editor/react"],P["@mantine/modals"]))})(this,function(P,E,o,R,N,gt,ht,mt,_,U,te,K){"use strict";function vt(n){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const i in n)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(r,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}return r.default=n,Object.freeze(r)}const J=vt(E);var X={},bt={get exports(){return X},set exports(n){X=n}},Q={};/**
1
+ (function(T,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("@mantine/core"),require("@mantine/notifications"),require("tabler-icons-react"),require("axios"),require("crypto-js"),require("lodash"),require("react-hook-form"),require("ahooks"),require("@monaco-editor/react"),require("@mantine/modals"),require("@tabler/icons")):typeof define=="function"&&define.amd?define(["exports","react","@mantine/core","@mantine/notifications","tabler-icons-react","axios","crypto-js","lodash","react-hook-form","ahooks","@monaco-editor/react","@mantine/modals","@tabler/icons"],x):(T=typeof globalThis<"u"?globalThis:T||self,x(T["settings-form"]={},T.react,T["@mantine/core"],T["@mantine/notifications"],T["tabler-icons-react"],T.axios,T.CryptoJS,T._,T["react-hook-form"],T.ahooks,T["@monaco-editor/react"],T["@mantine/modals"],T["@tabler/icons"]))})(this,function(T,x,i,E,B,gt,ht,mt,y,G,te,J,$){"use strict";var X={},vt={get exports(){return X},set exports(n){X=n}},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 _e;function wt(){if(_e)return Q;_e=1;var n=E,r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,u=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(f,g,w){var p,m={},C=null,I=null;w!==void 0&&(C=""+w),g.key!==void 0&&(C=""+g.key),g.ref!==void 0&&(I=g.ref);for(p in g)s.call(g,p)&&!l.hasOwnProperty(p)&&(m[p]=g[p]);if(f&&f.defaultProps)for(p in g=f.defaultProps,g)m[p]===void 0&&(m[p]=g[p]);return{$$typeof:r,type:f,key:C,ref:I,props:m,_owner:u.current}}return Q.Fragment=i,Q.jsx=c,Q.jsxs=c,Q}var Z={};/**
9
+ */var _e;function bt(){if(_e)return Q;_e=1;var n=x,r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,u=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(f,h,S){var p,v={},P=null,j=null;S!==void 0&&(P=""+S),h.key!==void 0&&(P=""+h.key),h.ref!==void 0&&(j=h.ref);for(p in h)s.call(h,p)&&!l.hasOwnProperty(p)&&(v[p]=h[p]);if(f&&f.defaultProps)for(p in h=f.defaultProps,h)v[p]===void 0&&(v[p]=h[p]);return{$$typeof:r,type:f,key:P,ref:j,props:v,_owner:u.current}}return Q.Fragment=o,Q.jsx=c,Q.jsxs=c,Q}var Z={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,16 +14,18 @@
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 Ce;function yt(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var n=E,r=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),q=Symbol.iterator,fe="@@iterator";function pe(e){if(e===null||typeof e!="object")return null;var a=q&&e[q]||e[fe];return typeof a=="function"?a:null}var $=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function A(e){{for(var a=arguments.length,d=new Array(a>1?a-1:0),h=1;h<a;h++)d[h-1]=arguments[h];Gt("error",e,d)}}function Gt(e,a,d){{var h=$.ReactDebugCurrentFrame,S=h.getStackAddendum();S!==""&&(a+="%s",d=d.concat([S]));var T=d.map(function(y){return String(y)});T.unshift("Warning: "+a),Function.prototype.apply.call(console[e],console,T)}}var Wt=!1,Yt=!1,Kt=!1,Jt=!1,Xt=!1,Ve;Ve=Symbol.for("react.module.reference");function Qt(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===l||Xt||e===u||e===w||e===p||Jt||e===I||Wt||Yt||Kt||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===m||e.$$typeof===c||e.$$typeof===f||e.$$typeof===g||e.$$typeof===Ve||e.getModuleId!==void 0))}function Zt(e,a,d){var h=e.displayName;if(h)return h;var S=a.displayName||a.name||"";return S!==""?d+"("+S+")":d}function Ge(e){return e.displayName||"Context"}function B(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 s:return"Fragment";case i:return"Portal";case l:return"Profiler";case u:return"StrictMode";case w:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case f:var a=e;return Ge(a)+".Consumer";case c:var d=e;return Ge(d._context)+".Provider";case g:return Zt(e,e.render,"ForwardRef");case m:var h=e.displayName||null;return h!==null?h:B(e.type)||"Memo";case C:{var S=e,T=S._payload,y=S._init;try{return B(y(T))}catch{return null}}}return null}var G=Object.assign,H=0,We,Ye,Ke,Je,Xe,Qe,Ze;function He(){}He.__reactDisabledLog=!0;function Ht(){{if(H===0){We=console.log,Ye=console.info,Ke=console.warn,Je=console.error,Xe=console.group,Qe=console.groupCollapsed,Ze=console.groupEnd;var e={configurable:!0,enumerable:!0,value:He,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}H++}}function en(){{if(H--,H===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:G({},e,{value:We}),info:G({},e,{value:Ye}),warn:G({},e,{value:Ke}),error:G({},e,{value:Je}),group:G({},e,{value:Xe}),groupCollapsed:G({},e,{value:Qe}),groupEnd:G({},e,{value:Ze})})}H<0&&A("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ge=$.ReactCurrentDispatcher,he;function ae(e,a,d){{if(he===void 0)try{throw Error()}catch(S){var h=S.stack.trim().match(/\n( *(at )?)/);he=h&&h[1]||""}return`
18
- `+he+e}}var me=!1,oe;{var tn=typeof WeakMap=="function"?WeakMap:Map;oe=new tn}function et(e,a){if(!e||me)return"";{var d=oe.get(e);if(d!==void 0)return d}var h;me=!0;var S=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var T;T=ge.current,ge.current=null,Ht();try{if(a){var y=function(){throw Error()};if(Object.defineProperty(y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(y,[])}catch(M){h=M}Reflect.construct(e,[],y)}else{try{y.call()}catch(M){h=M}e.call(y.prototype)}}else{try{throw Error()}catch(M){h=M}e()}}catch(M){if(M&&h&&typeof M.stack=="string"){for(var b=M.stack.split(`
19
- `),D=h.stack.split(`
20
- `),x=b.length-1,O=D.length-1;x>=1&&O>=0&&b[x]!==D[O];)O--;for(;x>=1&&O>=0;x--,O--)if(b[x]!==D[O]){if(x!==1||O!==1)do if(x--,O--,O<0||b[x]!==D[O]){var k=`
21
- `+b[x].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&oe.set(e,k),k}while(x>=1&&O>=0);break}}}finally{me=!1,ge.current=T,en(),Error.prepareStackTrace=S}var Y=e?e.displayName||e.name:"",pt=Y?ae(Y):"";return typeof e=="function"&&oe.set(e,pt),pt}function nn(e,a,d){return et(e,!1)}function rn(e){var a=e.prototype;return!!(a&&a.isReactComponent)}function se(e,a,d){if(e==null)return"";if(typeof e=="function")return et(e,rn(e));if(typeof e=="string")return ae(e);switch(e){case w:return ae("Suspense");case p:return ae("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case g:return nn(e.render);case m:return se(e.type,a,d);case C:{var h=e,S=h._payload,T=h._init;try{return se(T(S),a,d)}catch{}}}return""}var le=Object.prototype.hasOwnProperty,tt={},nt=$.ReactDebugCurrentFrame;function ce(e){if(e){var a=e._owner,d=se(e.type,e._source,a?a.type:null);nt.setExtraStackFrame(d)}else nt.setExtraStackFrame(null)}function an(e,a,d,h,S){{var T=Function.call.bind(le);for(var y in e)if(T(e,y)){var b=void 0;try{if(typeof e[y]!="function"){var D=Error((h||"React class")+": "+d+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw D.name="Invariant Violation",D}b=e[y](a,y,h,d,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(x){b=x}b&&!(b instanceof Error)&&(ce(S),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).",h||"React class",d,y,typeof b),ce(null)),b instanceof Error&&!(b.message in tt)&&(tt[b.message]=!0,ce(S),A("Failed %s type: %s",d,b.message),ce(null))}}}var on=Array.isArray;function ve(e){return on(e)}function sn(e){{var a=typeof Symbol=="function"&&Symbol.toStringTag,d=a&&e[Symbol.toStringTag]||e.constructor.name||"Object";return d}}function ln(e){try{return rt(e),!1}catch{return!0}}function rt(e){return""+e}function it(e){if(ln(e))return A("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",sn(e)),rt(e)}var ee=$.ReactCurrentOwner,cn={key:!0,ref:!0,__self:!0,__source:!0},at,ot,be;be={};function un(e){if(le.call(e,"ref")){var a=Object.getOwnPropertyDescriptor(e,"ref").get;if(a&&a.isReactWarning)return!1}return e.ref!==void 0}function dn(e){if(le.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function fn(e,a){if(typeof e.ref=="string"&&ee.current&&a&&ee.current.stateNode!==a){var d=B(ee.current.type);be[d]||(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',B(ee.current.type),e.ref),be[d]=!0)}}function pn(e,a){{var d=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))};d.isReactWarning=!0,Object.defineProperty(e,"key",{get:d,configurable:!0})}}function gn(e,a){{var d=function(){ot||(ot=!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))};d.isReactWarning=!0,Object.defineProperty(e,"ref",{get:d,configurable:!0})}}var hn=function(e,a,d,h,S,T,y){var b={$$typeof:r,type:e,key:a,ref:d,props:y,_owner:T};return b._store={},Object.defineProperty(b._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(b,"_self",{configurable:!1,enumerable:!1,writable:!1,value:h}),Object.defineProperty(b,"_source",{configurable:!1,enumerable:!1,writable:!1,value:S}),Object.freeze&&(Object.freeze(b.props),Object.freeze(b)),b};function mn(e,a,d,h,S){{var T,y={},b=null,D=null;d!==void 0&&(it(d),b=""+d),dn(a)&&(it(a.key),b=""+a.key),un(a)&&(D=a.ref,fn(a,S));for(T in a)le.call(a,T)&&!cn.hasOwnProperty(T)&&(y[T]=a[T]);if(e&&e.defaultProps){var x=e.defaultProps;for(T in x)y[T]===void 0&&(y[T]=x[T])}if(b||D){var O=typeof e=="function"?e.displayName||e.name||"Unknown":e;b&&pn(y,O),D&&gn(y,O)}return hn(e,b,D,S,h,ee.current,y)}}var we=$.ReactCurrentOwner,st=$.ReactDebugCurrentFrame;function W(e){if(e){var a=e._owner,d=se(e.type,e._source,a?a.type:null);st.setExtraStackFrame(d)}else st.setExtraStackFrame(null)}var ye;ye=!1;function Se(e){return typeof e=="object"&&e!==null&&e.$$typeof===r}function lt(){{if(we.current){var e=B(we.current.type);if(e)return`
17
+ */var Te;function wt(){return Te||(Te=1,process.env.NODE_ENV!=="production"&&function(){var n=x,r=Symbol.for("react.element"),o=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),v=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),j=Symbol.for("react.offscreen"),L=Symbol.iterator,fe="@@iterator";function pe(e){if(e===null||typeof e!="object")return null;var a=L&&e[L]||e[fe];return typeof a=="function"?a:null}var V=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function O(e){{for(var a=arguments.length,d=new Array(a>1?a-1:0),g=1;g<a;g++)d[g-1]=arguments[g];Yt("error",e,d)}}function Yt(e,a,d){{var g=V.ReactDebugCurrentFrame,_=g.getStackAddendum();_!==""&&(a+="%s",d=d.concat([_]));var C=d.map(function(w){return String(w)});C.unshift("Warning: "+a),Function.prototype.apply.call(console[e],console,C)}}var Kt=!1,Jt=!1,Xt=!1,Qt=!1,Zt=!1,Ge;Ge=Symbol.for("react.module.reference");function Ht(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===l||Zt||e===u||e===S||e===p||Qt||e===j||Kt||Jt||Xt||typeof e=="object"&&e!==null&&(e.$$typeof===P||e.$$typeof===v||e.$$typeof===c||e.$$typeof===f||e.$$typeof===h||e.$$typeof===Ge||e.getModuleId!==void 0))}function en(e,a,d){var g=e.displayName;if(g)return g;var _=a.displayName||a.name||"";return _!==""?d+"("+_+")":d}function $e(e){return e.displayName||"Context"}function M(e){if(e==null)return null;if(typeof e.tag=="number"&&O("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 s:return"Fragment";case o:return"Portal";case l:return"Profiler";case u:return"StrictMode";case S:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case f:var a=e;return $e(a)+".Consumer";case c:var d=e;return $e(d._context)+".Provider";case h:return en(e,e.render,"ForwardRef");case v:var g=e.displayName||null;return g!==null?g:M(e.type)||"Memo";case P:{var _=e,C=_._payload,w=_._init;try{return M(w(C))}catch{return null}}}return null}var W=Object.assign,H=0,We,Ye,Ke,Je,Xe,Qe,Ze;function He(){}He.__reactDisabledLog=!0;function tn(){{if(H===0){We=console.log,Ye=console.info,Ke=console.warn,Je=console.error,Xe=console.group,Qe=console.groupCollapsed,Ze=console.groupEnd;var e={configurable:!0,enumerable:!0,value:He,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}H++}}function nn(){{if(H--,H===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},e,{value:We}),info:W({},e,{value:Ye}),warn:W({},e,{value:Ke}),error:W({},e,{value:Je}),group:W({},e,{value:Xe}),groupCollapsed:W({},e,{value:Qe}),groupEnd:W({},e,{value:Ze})})}H<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ge=V.ReactCurrentDispatcher,he;function oe(e,a,d){{if(he===void 0)try{throw Error()}catch(_){var g=_.stack.trim().match(/\n( *(at )?)/);he=g&&g[1]||""}return`
18
+ `+he+e}}var me=!1,se;{var rn=typeof WeakMap=="function"?WeakMap:Map;se=new rn}function et(e,a){if(!e||me)return"";{var d=se.get(e);if(d!==void 0)return d}var g;me=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var C;C=ge.current,ge.current=null,tn();try{if(a){var w=function(){throw Error()};if(Object.defineProperty(w.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(w,[])}catch(F){g=F}Reflect.construct(e,[],w)}else{try{w.call()}catch(F){g=F}e.call(w.prototype)}}else{try{throw Error()}catch(F){g=F}e()}}catch(F){if(F&&g&&typeof F.stack=="string"){for(var b=F.stack.split(`
19
+ `),I=g.stack.split(`
20
+ `),R=b.length-1,A=I.length-1;R>=1&&A>=0&&b[R]!==I[A];)A--;for(;R>=1&&A>=0;R--,A--)if(b[R]!==I[A]){if(R!==1||A!==1)do if(R--,A--,A<0||b[R]!==I[A]){var q=`
21
+ `+b[R].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),typeof e=="function"&&se.set(e,q),q}while(R>=1&&A>=0);break}}}finally{me=!1,ge.current=C,nn(),Error.prepareStackTrace=_}var K=e?e.displayName||e.name:"",pt=K?oe(K):"";return typeof e=="function"&&se.set(e,pt),pt}function an(e,a,d){return et(e,!1)}function on(e){var a=e.prototype;return!!(a&&a.isReactComponent)}function le(e,a,d){if(e==null)return"";if(typeof e=="function")return et(e,on(e));if(typeof e=="string")return oe(e);switch(e){case S:return oe("Suspense");case p:return oe("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case h:return an(e.render);case v:return le(e.type,a,d);case P:{var g=e,_=g._payload,C=g._init;try{return le(C(_),a,d)}catch{}}}return""}var ue=Object.prototype.hasOwnProperty,tt={},nt=V.ReactDebugCurrentFrame;function ce(e){if(e){var a=e._owner,d=le(e.type,e._source,a?a.type:null);nt.setExtraStackFrame(d)}else nt.setExtraStackFrame(null)}function sn(e,a,d,g,_){{var C=Function.call.bind(ue);for(var w in e)if(C(e,w)){var b=void 0;try{if(typeof e[w]!="function"){var I=Error((g||"React class")+": "+d+" type `"+w+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[w]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw I.name="Invariant Violation",I}b=e[w](a,w,g,d,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){b=R}b&&!(b instanceof Error)&&(ce(_),O("%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",d,w,typeof b),ce(null)),b instanceof Error&&!(b.message in tt)&&(tt[b.message]=!0,ce(_),O("Failed %s type: %s",d,b.message),ce(null))}}}var ln=Array.isArray;function ve(e){return ln(e)}function un(e){{var a=typeof Symbol=="function"&&Symbol.toStringTag,d=a&&e[Symbol.toStringTag]||e.constructor.name||"Object";return d}}function cn(e){try{return rt(e),!1}catch{return!0}}function rt(e){return""+e}function it(e){if(cn(e))return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",un(e)),rt(e)}var ee=V.ReactCurrentOwner,dn={key:!0,ref:!0,__self:!0,__source:!0},at,ot,be;be={};function fn(e){if(ue.call(e,"ref")){var a=Object.getOwnPropertyDescriptor(e,"ref").get;if(a&&a.isReactWarning)return!1}return e.ref!==void 0}function pn(e){if(ue.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function gn(e,a){if(typeof e.ref=="string"&&ee.current&&a&&ee.current.stateNode!==a){var d=M(ee.current.type);be[d]||(O('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',M(ee.current.type),e.ref),be[d]=!0)}}function hn(e,a){{var d=function(){at||(at=!0,O("%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))};d.isReactWarning=!0,Object.defineProperty(e,"key",{get:d,configurable:!0})}}function mn(e,a){{var d=function(){ot||(ot=!0,O("%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))};d.isReactWarning=!0,Object.defineProperty(e,"ref",{get:d,configurable:!0})}}var vn=function(e,a,d,g,_,C,w){var b={$$typeof:r,type:e,key:a,ref:d,props:w,_owner:C};return b._store={},Object.defineProperty(b._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(b,"_self",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.defineProperty(b,"_source",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.freeze&&(Object.freeze(b.props),Object.freeze(b)),b};function bn(e,a,d,g,_){{var C,w={},b=null,I=null;d!==void 0&&(it(d),b=""+d),pn(a)&&(it(a.key),b=""+a.key),fn(a)&&(I=a.ref,gn(a,_));for(C in a)ue.call(a,C)&&!dn.hasOwnProperty(C)&&(w[C]=a[C]);if(e&&e.defaultProps){var R=e.defaultProps;for(C in R)w[C]===void 0&&(w[C]=R[C])}if(b||I){var A=typeof e=="function"?e.displayName||e.name||"Unknown":e;b&&hn(w,A),I&&mn(w,A)}return vn(e,b,I,_,g,ee.current,w)}}var we=V.ReactCurrentOwner,st=V.ReactDebugCurrentFrame;function Y(e){if(e){var a=e._owner,d=le(e.type,e._source,a?a.type:null);st.setExtraStackFrame(d)}else st.setExtraStackFrame(null)}var ye;ye=!1;function Se(e){return typeof e=="object"&&e!==null&&e.$$typeof===r}function lt(){{if(we.current){var e=M(we.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function vn(e){{if(e!==void 0){var a=e.fileName.replace(/^.*[\\\/]/,""),d=e.lineNumber;return`
23
+ Check the render method of \``+e+"`."}return""}}function wn(e){{if(e!==void 0){var a=e.fileName.replace(/^.*[\\\/]/,""),d=e.lineNumber;return`
24
24
 
25
- Check your code at `+a+":"+d+"."}return""}}var ct={};function bn(e){{var a=lt();if(!a){var d=typeof e=="string"?e:e.displayName||e.name;d&&(a=`
25
+ Check your code at `+a+":"+d+"."}return""}}var ut={};function yn(e){{var a=lt();if(!a){var d=typeof e=="string"?e:e.displayName||e.name;d&&(a=`
26
26
 
27
- Check the top-level render call using <`+d+">.")}return a}}function ut(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var d=bn(a);if(ct[d])return;ct[d]=!0;var h="";e&&e._owner&&e._owner!==we.current&&(h=" It was passed a child from "+B(e._owner.type)+"."),W(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.',d,h),W(null)}}function dt(e,a){{if(typeof e!="object")return;if(ve(e))for(var d=0;d<e.length;d++){var h=e[d];Se(h)&&ut(h,a)}else if(Se(e))e._store&&(e._store.validated=!0);else if(e){var S=pe(e);if(typeof S=="function"&&S!==e.entries)for(var T=S.call(e),y;!(y=T.next()).done;)Se(y.value)&&ut(y.value,a)}}}function wn(e){{var a=e.type;if(a==null||typeof a=="string")return;var d;if(typeof a=="function")d=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===g||a.$$typeof===m))d=a.propTypes;else return;if(d){var h=B(a);an(d,e.props,"prop",h,e)}else if(a.PropTypes!==void 0&&!ye){ye=!0;var S=B(a);A("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",S||"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 yn(e){{for(var a=Object.keys(e.props),d=0;d<a.length;d++){var h=a[d];if(h!=="children"&&h!=="key"){W(e),A("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",h),W(null);break}}e.ref!==null&&(W(e),A("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function ft(e,a,d,h,S,T){{var y=Qt(e);if(!y){var b="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(b+=" 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 D=vn(S);D?b+=D:b+=lt();var x;e===null?x="null":ve(e)?x="array":e!==void 0&&e.$$typeof===r?(x="<"+(B(e.type)||"Unknown")+" />",b=" Did you accidentally export a JSX literal instead of a component?"):x=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",x,b)}var O=mn(e,a,d,S,T);if(O==null)return O;if(y){var k=a.children;if(k!==void 0)if(h)if(ve(k)){for(var Y=0;Y<k.length;Y++)dt(k[Y],e);Object.freeze&&Object.freeze(k)}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 dt(k,e)}return e===s?yn(O):wn(O),O}}function Sn(e,a,d){return ft(e,a,d,!0)}function _n(e,a,d){return ft(e,a,d,!1)}var Cn=_n,Pn=Sn;Z.Fragment=s,Z.jsx=Cn,Z.jsxs=Pn}()),Z}(function(n){process.env.NODE_ENV==="production"?n.exports=wt():n.exports=yt()})(bt);const L=X.Fragment,t=X.jsx,v=X.jsxs;function St(n){n=n||{};const r=Object.keys(n).sort(),i=[];for(let s=0;s<r.length;s++){const u=r[s];if(u!="authentication"&&n[u])i.push(r[s]+"="+(typeof n[u]=="object"?JSON.stringify(n[u]):n[u]));else{const l=Object.keys(n[u]).sort();for(let c=0;c<l.length;c++){const f=l[c];f!="sign"&&n[u][f]&&i.push(l[c]+"="+(typeof n[u][f]=="object"?JSON.stringify(n[u][f]):n[u][f]))}}}return i.sort().join("&")}function _t(n,r){let i=St(n);return i+="&key="+r,ht.MD5(i).toString().toUpperCase()}const z={baseURL:"http://localhost:31200",app_id:"",app_secret:"",getAuthentication(n){if(!this.app_id||!this.app_secret)return;const r=new Date().getTime().toString();return{app_id:this.app_id,nonce_str:r,sign:_t({app_id:this.app_id,nonce_str:r,...n},this.app_secret)}},getRequest(n){return(r,i,s={})=>{const u=window.localStorage.getItem("token"),l={"X-Requested-With":"XMLHttpRequest","Content-Type":s.string?"application/x-www-form-urlencoded":"application/json",authorization:u?`bearer ${u}`:"",...s.headers},c={baseURL:this.baseURL,method:n,url:r,params:n==="GET"?i:s.params,headers:l};return["POST","PUT"].includes(n)&&(c.data=s.string?JSON.stringify(i):i,c.data.authentication=this.getAuthentication(c.data)),gt(c).then(f=>f.data).catch(f=>mt.has(f,"response.data.detail.message")?Promise.reject(new Error(f.response.data.detail.message)):Promise.reject(f))}}};function ne(n){z.baseURL!==n.apiBaseURL&&(z.baseURL=n.apiBaseURL),n.app_id&&(z.app_id=n.app_id),n.app_secret&&(z.app_secret=n.app_secret)}const j={datasource:{list:async()=>await z.getRequest("POST")("/datasource/list",{filter:{},sort:[{field:"create_time",order:"ASC"}],pagination:{page:1,pagesize:100}}),create:async(n,r,i)=>await z.getRequest("POST")("/datasource/create",{type:n,key:r,config:i}),delete:async n=>{await z.getRequest("POST")("/datasource/delete",{id:n})}},account:{login:async(n,r)=>{const i={name:n,password:r};return await z.getRequest("POST")("/account/login",i)},list:async()=>await z.getRequest("POST")("/account/list",{filter:{},sort:[{field:"name",order:"ASC"}],pagination:{page:1,pagesize:100}}),get:async()=>await z.getRequest("GET")("/account/get",{}),update:async(n,r)=>{const i={name:n,email:r};return await z.getRequest("PUT")("/account/update",i)},changepassword:async(n,r)=>{const i={old_password:n,new_password:r};return await z.getRequest("POST")("/account/changepassword",i)},create:async(n,r,i,s)=>await z.getRequest("POST")("/account/create",{name:n,email:r,password:i,role_id:s}),edit:async n=>(n.reset_password||(n.new_password=void 0),await z.getRequest("PUT")("/account/edit",n)),delete:async n=>{if(n)return z.getRequest("POST")("/account/delete",{id:n})}},role:{list:async()=>await z.getRequest("GET")("/role/list",{})},api_key:{list:async()=>await z.getRequest("POST")("/api/key/list",{filter:{search:""},sort:[{field:"name",order:"ASC"}],pagination:{page:1,pagesize:100}}),create:async(n,r)=>z.getRequest("POST")("/api/key/create",{name:n,role_id:r}),delete:async n=>{if(n)return z.getRequest("POST")("/api/key/delete",{id:n})}}},V={size:"sm",spacing:"md",button:{size:"xs"}};function Ct({submit:n,styles:r=V,type:i}){const{control:s,setValue:u,handleSubmit:l}=_.useForm({defaultValues:{type:i,key:"",config:{host:"",port:5432,username:"",password:"",database:""}}});return E.useEffect(()=>{u("type",i)},[u,i]),t(o.Box,{mx:"auto",children:v("form",{onSubmit:l(n),children:[t(_.Controller,{name:"key",control:s,render:({field:c})=>t(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Name",placeholder:"A unique name",...c})}),t(o.Divider,{label:"Connection Info",labelPosition:"center"}),v(o.Group,{grow:!0,children:[t(_.Controller,{name:"config.host",control:s,render:({field:c})=>t(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Host",sx:{flexGrow:1},...c})}),t(_.Controller,{name:"config.port",control:s,render:({field:c})=>t(o.NumberInput,{mb:r.spacing,size:r.size,required:!0,label:"Port",hideControls:!0,sx:{width:"8em"},...c})})]}),t(_.Controller,{name:"config.username",control:s,render:({field:c})=>t(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Username",...c})}),t(_.Controller,{name:"config.password",control:s,render:({field:c})=>t(o.PasswordInput,{mb:r.spacing,size:r.size,required:!0,label:"Password",...c})}),t(_.Controller,{name:"config.database",control:s,render:({field:c})=>t(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Database",...c})}),t(o.Group,{position:"right",mt:r.spacing,children:t(o.Button,{type:"submit",size:r.button.size,children:"Save"})})]})})}const Pt=({value:n,onChange:r})=>{const i=s=>{s&&r(s)};return t(o.Box,{sx:{position:"relative"},children:t(te,{height:"500px",defaultLanguage:"javascript",value:n,onChange:i,theme:"vs-dark",options:{minimap:{enabled:!1}}})})},Pe=E.forwardRef(({value:n,onChange:r,label:i,modalTitle:s,defaultValue:u,styles:l},c)=>{const[f,{setTrue:g,setFalse:w}]=U.useBoolean(),[p,m]=E.useState(n),C=()=>{w(),r(p)},I=()=>{w(),m(n)},q=()=>{m(u)};return E.useEffect(()=>{m(n)},[n]),v(L,{children:[t(o.Button,{variant:"filled",size:l.button.size,onClick:g,sx:{flexGrow:1},children:i}),t(o.Modal,{size:800,title:s,opened:f,onClose:w,closeOnClickOutside:!1,withCloseButton:!1,children:f&&v(o.Stack,{children:[t(Pt,{value:p,onChange:m}),v(o.Group,{position:"apart",children:[t(o.Button,{onClick:q,color:"red",leftIcon:t(N.Recycle,{size:20}),children:"Rest"}),v(o.Group,{position:"right",children:[t(o.Button,{onClick:I,variant:"subtle",children:"Cancel"}),t(o.Button,{onClick:C,children:"OK"})]})]})]})})]})}),re={pre:["function pre_process({ method, url, params, headers, data }, utils) {"," // your code goes here"," return { method, url, params, headers, data }","}"].join(`
27
+ Check the top-level render call using <`+d+">.")}return a}}function ct(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var d=yn(a);if(ut[d])return;ut[d]=!0;var g="";e&&e._owner&&e._owner!==we.current&&(g=" It was passed a child from "+M(e._owner.type)+"."),Y(e),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',d,g),Y(null)}}function dt(e,a){{if(typeof e!="object")return;if(ve(e))for(var d=0;d<e.length;d++){var g=e[d];Se(g)&&ct(g,a)}else if(Se(e))e._store&&(e._store.validated=!0);else if(e){var _=pe(e);if(typeof _=="function"&&_!==e.entries)for(var C=_.call(e),w;!(w=C.next()).done;)Se(w.value)&&ct(w.value,a)}}}function Sn(e){{var a=e.type;if(a==null||typeof a=="string")return;var d;if(typeof a=="function")d=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===h||a.$$typeof===v))d=a.propTypes;else return;if(d){var g=M(a);sn(d,e.props,"prop",g,e)}else if(a.PropTypes!==void 0&&!ye){ye=!0;var _=M(a);O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",_||"Unknown")}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _n(e){{for(var a=Object.keys(e.props),d=0;d<a.length;d++){var g=a[d];if(g!=="children"&&g!=="key"){Y(e),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",g),Y(null);break}}e.ref!==null&&(Y(e),O("Invalid attribute `ref` supplied to `React.Fragment`."),Y(null))}}function ft(e,a,d,g,_,C){{var w=Ht(e);if(!w){var b="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(b+=" 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 I=wn(_);I?b+=I:b+=lt();var R;e===null?R="null":ve(e)?R="array":e!==void 0&&e.$$typeof===r?(R="<"+(M(e.type)||"Unknown")+" />",b=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,b)}var A=bn(e,a,d,_,C);if(A==null)return A;if(w){var q=a.children;if(q!==void 0)if(g)if(ve(q)){for(var K=0;K<q.length;K++)dt(q[K],e);Object.freeze&&Object.freeze(q)}else O("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 dt(q,e)}return e===s?_n(A):Sn(A),A}}function Tn(e,a,d){return ft(e,a,d,!0)}function Pn(e,a,d){return ft(e,a,d,!1)}var Cn=Pn,En=Tn;Z.Fragment=s,Z.jsx=Cn,Z.jsxs=En}()),Z}(function(n){process.env.NODE_ENV==="production"?n.exports=bt():n.exports=wt()})(vt);const k=X.Fragment,t=X.jsx,m=X.jsxs;function yt(n){n=n||{};const r=Object.keys(n).sort(),o=[];for(let s=0;s<r.length;s++){const u=r[s];if(u!="authentication"&&n[u])o.push(r[s]+"="+(typeof n[u]=="object"?JSON.stringify(n[u]):n[u]));else{const l=Object.keys(n[u]).sort();for(let c=0;c<l.length;c++){const f=l[c];f!="sign"&&n[u][f]&&o.push(l[c]+"="+(typeof n[u][f]=="object"?JSON.stringify(n[u][f]):n[u][f]))}}}return o.sort().join("&")}function St(n,r){let o=yt(n);return o+="&key="+r,ht.MD5(o).toString().toUpperCase()}const z={baseURL:"http://localhost:31200",app_id:"",app_secret:"",getAuthentication(n){if(!this.app_id||!this.app_secret)return;const r=new Date().getTime().toString();return{app_id:this.app_id,nonce_str:r,sign:St({app_id:this.app_id,nonce_str:r,...n},this.app_secret)}},getRequest(n){return(r,o,s={})=>{const u=window.localStorage.getItem("token"),l={"X-Requested-With":"XMLHttpRequest","Content-Type":s.string?"application/x-www-form-urlencoded":"application/json",authorization:u?`bearer ${u}`:"",...s.headers},c={baseURL:this.baseURL,method:n,url:r,params:n==="GET"?o:s.params,headers:l};return["POST","PUT"].includes(n)&&(c.data=s.string?JSON.stringify(o):o,c.data.authentication=this.getAuthentication(c.data)),gt(c).then(f=>f.data).catch(f=>mt.has(f,"response.data.detail.message")?Promise.reject(new Error(f.response.data.detail.message)):Promise.reject(f))}}};function ne(n){z.baseURL!==n.apiBaseURL&&(z.baseURL=n.apiBaseURL),n.app_id&&(z.app_id=n.app_id),n.app_secret&&(z.app_secret=n.app_secret)}const D={datasource:{list:async()=>await z.getRequest("POST")("/datasource/list",{filter:{},sort:[{field:"create_time",order:"ASC"}],pagination:{page:1,pagesize:100}}),create:async(n,r,o)=>await z.getRequest("POST")("/datasource/create",{type:n,key:r,config:o}),update:async(n,r)=>await z.getRequest("PUT")("/datasource/update",{id:n,config:r}),delete:async n=>{await z.getRequest("POST")("/datasource/delete",{id:n})}},account:{login:async(n,r)=>{const o={name:n,password:r};return await z.getRequest("POST")("/account/login",o)},list:async()=>await z.getRequest("POST")("/account/list",{filter:{},sort:[{field:"name",order:"ASC"}],pagination:{page:1,pagesize:100}}),get:async()=>await z.getRequest("GET")("/account/get",{}),update:async(n,r)=>{const o={name:n.trim(),email:r.trim()};return await z.getRequest("PUT")("/account/update",o)},changepassword:async(n,r)=>{const o={old_password:n.trim(),new_password:r.trim()};return await z.getRequest("POST")("/account/changepassword",o)},create:async(n,r,o,s)=>await z.getRequest("POST")("/account/create",{name:n.trim(),email:r.trim(),password:o.trim(),role_id:s}),edit:async n=>(n.reset_password||(n.new_password=void 0),await z.getRequest("PUT")("/account/edit",n)),delete:async n=>{if(n)return z.getRequest("POST")("/account/delete",{id:n})}},role:{list:async()=>await z.getRequest("GET")("/role/list",{})},api_key:{list:async()=>await z.getRequest("POST")("/api/key/list",{filter:{search:""},sort:[{field:"name",order:"ASC"}],pagination:{page:1,pagesize:100}}),create:async(n,r)=>z.getRequest("POST")("/api/key/create",{name:n,role_id:r}),delete:async n=>{if(n)return z.getRequest("POST")("/api/key/delete",{id:n})}}},N={size:"sm",spacing:"md",button:{size:"xs"}};function _t({submit:n,styles:r=N,type:o}){const{control:s,setValue:u,handleSubmit:l}=y.useForm({defaultValues:{type:o,key:"",config:{host:"",port:5432,username:"",password:"",database:""}}});return x.useEffect(()=>{u("type",o)},[u,o]),t(i.Box,{mx:"auto",children:m("form",{onSubmit:l(n),children:[t(y.Controller,{name:"key",control:s,render:({field:c})=>t(i.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Name",placeholder:"A unique name",...c})}),t(i.Divider,{label:"Connection Info",labelPosition:"center"}),m(i.Group,{grow:!0,children:[t(y.Controller,{name:"config.host",control:s,render:({field:c})=>t(i.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Host",sx:{flexGrow:1},...c})}),t(y.Controller,{name:"config.port",control:s,render:({field:c})=>t(i.NumberInput,{mb:r.spacing,size:r.size,required:!0,label:"Port",hideControls:!0,sx:{width:"8em"},...c})})]}),t(y.Controller,{name:"config.username",control:s,render:({field:c})=>t(i.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Username",...c})}),t(y.Controller,{name:"config.password",control:s,render:({field:c})=>t(i.PasswordInput,{mb:r.spacing,size:r.size,required:!0,label:"Password",...c})}),t(y.Controller,{name:"config.database",control:s,render:({field:c})=>t(i.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Database",...c})}),t(i.Group,{position:"right",mt:r.spacing,children:t(i.Button,{type:"submit",size:r.button.size,children:"Save"})})]})})}const Tt=({value:n,onChange:r})=>{const o=s=>{s&&r(s)};return t(i.Box,{sx:{position:"relative"},children:t(te,{height:"500px",defaultLanguage:"javascript",value:n,onChange:o,theme:"vs-dark",options:{minimap:{enabled:!1}}})})},re=x.forwardRef(({value:n,onChange:r,label:o,modalTitle:s,defaultValue:u,styles:l},c)=>{const[f,{setTrue:h,setFalse:S}]=G.useBoolean(),[p,v]=x.useState(n),P=()=>{S(),r(p)},j=()=>{S(),v(n)},L=()=>{v(u)};return x.useEffect(()=>{v(n)},[n]),m(k,{children:[t(i.Button,{variant:"filled",size:l.button.size,onClick:h,sx:{flexGrow:1},children:o}),t(i.Modal,{size:800,title:s,opened:f,onClose:S,closeOnClickOutside:!1,withCloseButton:!1,children:f&&m(i.Stack,{children:[t(Tt,{value:p,onChange:v}),m(i.Group,{position:"apart",children:[t(i.Button,{onClick:L,color:"red",leftIcon:t(B.Recycle,{size:20}),children:"Rest"}),m(i.Group,{position:"right",children:[t(i.Button,{onClick:j,variant:"subtle",children:"Cancel"}),t(i.Button,{onClick:P,children:"OK"})]})]})]})})]})}),ie={pre:["function pre_process({ method, url, params, headers, data }, utils) {"," // your code goes here"," return { method, url, params, headers, data }","}"].join(`
28
28
  `),post:["function post_process(res, utils) {"," // your code goes here"," return data","}"].join(`
29
- `)};function Tt({submit:n,styles:r=V}){const{control:i,setValue:s,handleSubmit:u}=_.useForm({defaultValues:{type:"http",key:"",config:{host:"",processing:{pre:re.pre,post:re.post}}}});return t(o.Box,{mx:"auto",children:v("form",{onSubmit:u(n),children:[t(_.Controller,{name:"key",control:i,render:({field:l})=>t(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Name",placeholder:"A unique name",...l})}),t(o.Divider,{label:"Connection Info",labelPosition:"center"}),t(_.Controller,{name:"config.host",control:i,render:({field:l})=>t(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Base URL",sx:{flexGrow:1},...l})}),v(o.Group,{grow:!0,children:[t(_.Controller,{name:"config.processing.pre",control:i,render:({field:l})=>t(Pe,{label:"Pre Processing",modalTitle:"This function will run before sending the request (for scenarios like encryption)",defaultValue:re.pre,...l,styles:r})}),t(_.Controller,{name:"config.processing.post",control:i,render:({field:l})=>t(Pe,{label:"Post Processing",modalTitle:"This function will run after sending the request (for scenarios like decryption)",defaultValue:re.post,...l,styles:r})})]}),t(o.Group,{position:"right",mt:r.spacing,children:t(o.Button,{type:"submit",size:r.button.size,children:"Save"})})]})})}function Rt({styles:n=V}){return t(o.Box,{mx:"auto",children:v(o.Alert,{mt:n.spacing,icon:t(N.AlertCircle,{size:16}),children:["Only ",t("b",{children:"SELECT"})," privilege is needed."]})})}function Et({postSubmit:n,styles:r=V}){const[i,s]=E.useState("postgresql"),u=async({type:f,key:g,config:w})=>{R.showNotification({id:"for-creating",title:"Pending",message:"Adding data source...",loading:!0});try{console.log({type:f,key:g,config:w}),await j.datasource.create(f,g,w),R.updateNotification({id:"for-creating",title:"Successful",message:"Data source is added",color:"green"}),n()}catch(p){R.updateNotification({id:"for-creating",title:"Failed",message:p.message,color:"red"})}},l=i==="postgresql"||i==="mysql",c=i==="http";return v(o.Box,{mx:"auto",children:[t(o.SegmentedControl,{fullWidth:!0,mb:r.spacing,size:r.size,data:[{label:"PostgreSQL",value:"postgresql"},{label:"MySQL",value:"mysql"},{label:"HTTP",value:"http"}],value:i,onChange:f=>s(f)}),l&&t(Rt,{styles:r}),l&&t(Ct,{submit:u,styles:r,type:i}),c&&t(Tt,{submit:u,styles:r})]})}function Te({onSuccess:n,styles:r=V}){const[i,s]=E.useState(!1),u=()=>s(!0),l=()=>s(!1),c=()=>{n(),l()};return v(L,{children:[t(o.Modal,{overflow:"inside",opened:i,onClose:()=>s(!1),title:"Add a data source",trapFocus:!0,onDragStart:f=>{f.stopPropagation()},children:t(Et,{postSubmit:c,styles:r})}),t(o.Button,{size:r.button.size,onClick:u,leftIcon:t(N.PlaylistAdd,{size:20}),children:"Add a Data Source"})]})}const xt=n=>n.replace(/([^:])(\/\/+)/g,"$1/");function Ot(n){E.useEffect(()=>{if(te.loader.__getMonacoInstance())return;console.log("loading monaco for @devtable/settings-form");const i=xt(n);te.loader.config({paths:{vs:i}}),te.loader.init().then(s=>console.log("monaco instance:",s))},[])}function ue(){return ue=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},ue.apply(this,arguments)}function zt(n,r){if(n==null)return{};var i,s,u=function(c,f){if(c==null)return{};var g,w,p={},m=Object.keys(c);for(w=0;w<m.length;w++)g=m[w],f.indexOf(g)>=0||(p[g]=c[g]);return p}(n,r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(n);for(s=0;s<l.length;s++)i=l[s],r.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(n,i)&&(u[i]=n[i])}return u}var At=["size","color","stroke"];function Dt(n){var r=n.size,i=r===void 0?24:r,s=n.color,u=s===void 0?"currentColor":s,l=n.stroke,c=l===void 0?2:l,f=zt(n,At);return J.createElement("svg",ue({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-lock",width:i,height:i,viewBox:"0 0 24 24",strokeWidth:c,stroke:u,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},f),J.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),J.createElement("rect",{x:5,y:11,width:14,height:10,rx:2}),J.createElement("circle",{cx:12,cy:16,r:1}),J.createElement("path",{d:"M8 11v-4a4 4 0 0 1 8 0v4"}))}function Re({id:n,name:r,isProtected:i,onSuccess:s,styles:u=V}){const l=K.useModals(),c=async()=>{n&&(R.showNotification({id:"for-deleting",title:"Pending",message:"Deleting data source...",loading:!0}),await j.datasource.delete(n),R.updateNotification({id:"for-deleting",title:"Successful",message:`Data source [${r}] is deleted`,color:"green"}),s())},f=()=>l.openConfirmModal({title:"Delete this data source?",children:t(o.Text,{size:u.size,children:"This action won't affect your database."}),labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:c}),g=o.useMantineTheme();return i?t(o.Tooltip,{withArrow:!0,events:{hover:!0,touch:!1,focus:!1},label:"This is a preset datasource, it can not be deleted",children:t("span",{children:t(Dt,{size:16,color:g.colors.gray[7]})})}):t(o.Button,{size:u.button.size,color:"red",onClick:f,leftIcon:t(N.Trash,{size:20}),children:"Delete"})}function jt({styles:n=V,config:r}){Ot(r.monacoPath),ne(r);const{data:i=[],loading:s,refresh:u}=U.useRequest(async()=>{const{data:l}=await j.datasource.list();return l},{refreshDeps:[]});return v(L,{children:[t(o.Group,{pt:n.spacing,position:"right",children:t(Te,{onSuccess:u})}),v(o.Box,{mt:n.spacing,sx:{position:"relative"},children:[t(o.LoadingOverlay,{visible:s}),v(o.Table,{horizontalSpacing:n.spacing,verticalSpacing:n.spacing,fontSize:n.size,highlightOnHover:!0,children:[t("thead",{children:v("tr",{children:[t("th",{children:"Type"}),t("th",{children:"Name"}),t("th",{children:"Action"})]})}),t("tbody",{children:i.map(({id:l,key:c,type:f,is_preset:g})=>v("tr",{children:[t("td",{width:200,children:f}),t("td",{children:c}),t("td",{width:200,children:t(o.Group,{position:"left",children:t(Re,{isProtected:g,id:l,name:c,onSuccess:u})})})]},c))})]})]})]})}const It=E.forwardRef(({label:n,value:r,description:i,...s},u)=>v(o.Stack,{spacing:2,ref:u,...s,children:[t(o.Text,{size:"sm",children:n}),t(o.Text,{size:"xs",color:"dimmed",className:"role-description",children:i})]})),de=E.forwardRef(({styles:n,value:r,onChange:i},s)=>{const{data:u=[],loading:l}=U.useRequest(async()=>(await j.role.list()).map(f=>({label:f.name,value:f.id,description:f.description,disabled:f.id===50})),{refreshDeps:[]});return t(o.Select,{ref:s,mb:n.spacing,size:n.size,required:!0,label:"Role",itemComponent:It,data:u,disabled:l,styles:()=>({item:{"&[data-selected]":{"&, &:hover":{".role-description":{color:"rgba(255,255,255,.8)"}}}}}),value:r,onChange:i})}),F={size:"sm",spacing:"md",button:{size:"xs"}};function kt({postSubmit:n,styles:r=F,initialRoleID:i}){const{control:s,handleSubmit:u}=_.useForm({defaultValues:{name:"",email:"",role_id:i,password:""}}),l=async({name:c,email:f,password:g,role_id:w})=>{try{R.showNotification({id:"for-creating",title:"Pending",message:"Adding account...",loading:!0}),await j.account.create(c,f,g,w),R.updateNotification({id:"for-creating",title:"Successful",message:"Account is added",color:"green"}),n()}catch(p){R.updateNotification({id:"for-creating",title:"Failed",message:p.message,color:"red"})}};return t(o.Box,{mx:"auto",children:v("form",{onSubmit:u(l),children:[t(_.Controller,{name:"name",control:s,render:({field:c})=>t(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Username",...c})}),t(_.Controller,{name:"email",control:s,render:({field:c})=>t(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Email",...c})}),t(_.Controller,{name:"password",control:s,render:({field:c})=>t(o.PasswordInput,{mb:r.spacing,size:r.size,required:!0,label:"Password",description:"Password must be at least 8 characters long",...c})}),t(_.Controller,{name:"role_id",control:s,render:({field:c})=>t(de,{styles:r,...c})}),t(o.Group,{position:"right",mt:r.spacing,children:t(o.Button,{type:"submit",size:r.button.size,children:"Save"})})]})})}function Ee({onSuccess:n,styles:r=F,initialRoleID:i}){const[s,u]=E.useState(!1),l=()=>u(!0),c=()=>u(!1),f=()=>{n(),c()};return v(L,{children:[t(o.Modal,{overflow:"inside",opened:s,onClose:()=>u(!1),title:"Add an Account",trapFocus:!0,onDragStart:g=>{g.stopPropagation()},children:t(kt,{postSubmit:f,styles:r,initialRoleID:i})}),t(o.Button,{size:r.button.size,onClick:l,leftIcon:t(N.PlaylistAdd,{size:20}),children:"Add an Account"})]})}function xe({id:n,name:r,onSuccess:i,styles:s=F}){const u=K.useModals(),l=async()=>{if(n){R.showNotification({id:"for-deleting",title:"Pending",message:"Deleting account...",loading:!0});try{await j.account.delete(n),R.updateNotification({id:"for-deleting",title:"Successful",message:`Account [${r}] is deleted`,color:"green"}),i()}catch(f){R.updateNotification({id:"for-deleting",title:"Failed",message:f.message,color:"red"})}}},c=()=>u.openConfirmModal({title:"Delete this account?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:l});return t(o.Button,{size:s.button.size,color:"red",onClick:c,leftIcon:t(N.Trash,{size:20}),children:"Delete"})}function qt({id:n,name:r,email:i,role_id:s,postSubmit:u,styles:l=F}){const{control:c,handleSubmit:f,watch:g}=_.useForm({defaultValues:{name:r,email:i,role_id:s,reset_password:!1,new_password:""}}),w=async({name:C,email:I,role_id:q,reset_password:fe,new_password:pe})=>{try{R.showNotification({id:"for-updating",title:"Pending",message:"Updating account...",loading:!0}),await j.account.edit({id:n,name:C,email:I,role_id:q,reset_password:fe,new_password:pe}),R.updateNotification({id:"for-updating",title:"Successful",message:"Account is updated",color:"green"}),u()}catch($){R.updateNotification({id:"for-updating",title:"Failed",message:$.message,color:"red"})}},[p,m]=g(["reset_password","new_password"]);return t(o.Box,{mx:"auto",children:v("form",{onSubmit:f(w),children:[t(_.Controller,{name:"name",control:c,render:({field:C})=>t(o.TextInput,{mb:l.spacing,size:l.size,required:!0,label:"Username",...C})}),t(_.Controller,{name:"email",control:c,render:({field:C})=>t(o.TextInput,{mb:l.spacing,size:l.size,required:!0,label:"Email",...C})}),t(_.Controller,{name:"role_id",control:c,render:({field:C})=>t(de,{styles:l,...C})}),t(o.Divider,{my:20,variant:"dashed",label:"",labelPosition:"center"}),t(_.Controller,{name:"reset_password",control:c,render:({field:C})=>t(o.Switch,{mb:l.spacing,size:l.size,label:"Reset password",checked:C.value,onChange:I=>C.onChange(I.currentTarget.checked),styles:{label:{verticalAlign:"middle"}}})}),p&&t(_.Controller,{name:"new_password",control:c,render:({field:C})=>t(o.PasswordInput,{autoComplete:"off",mb:l.spacing,size:l.size,required:!0,description:"Password must be at least 8 characters long",label:"New Password",...C})}),t(o.Group,{position:"right",mt:l.spacing,children:t(o.Button,{type:"submit",size:l.button.size,children:"Submit"})})]})})}function Nt({account:n,onSuccess:r,styles:i=F}){const[s,u]=E.useState(!1),l=()=>u(!0),c=()=>u(!1),f=()=>{r(),c()};return v(L,{children:[t(o.Modal,{overflow:"inside",opened:s,onClose:()=>u(!1),title:`Editing ${n.name}`,trapFocus:!0,onDragStart:g=>{g.stopPropagation()},children:t(qt,{...n,postSubmit:f,styles:i})}),t(o.Button,{size:i.button.size,onClick:l,leftIcon:t(N.Edit,{size:20}),children:"Edit"})]})}function Lt({styles:n=F,config:r}){var w;ne(r);const{data:i=[],loading:s,refresh:u}=U.useRequest(async()=>{const{data:p}=await j.account.list();return p},{refreshDeps:[]}),{data:l=[],loading:c}=U.useRequest(async()=>(await j.role.list()).map(m=>({label:m.name,value:m.id,description:m.description,disabled:m.id===50})),{refreshDeps:[]}),f=E.useMemo(()=>l.reduce((p,m)=>(p.set(m.value,m.label),p),new Map),[l]),g=p=>f.get(p)??p;return v(L,{children:[t(o.Group,{pt:n.spacing,position:"right",children:t(Ee,{onSuccess:u,initialRoleID:((w=l==null?void 0:l[0])==null?void 0:w.value)??0})}),v(o.Box,{mt:n.spacing,sx:{position:"relative"},children:[t(o.LoadingOverlay,{visible:s||c}),v(o.Table,{horizontalSpacing:n.spacing,verticalSpacing:n.spacing,fontSize:n.size,highlightOnHover:!0,children:[t("thead",{children:v("tr",{children:[t("th",{children:"Username"}),t("th",{children:"Email"}),t("th",{children:"Role"}),t("th",{children:"Action"})]})}),t("tbody",{children:i.map(p=>{const{id:m,name:C,email:I,role_id:q}=p;return v("tr",{children:[t("td",{width:200,children:C}),t("td",{width:200,children:I}),t("td",{width:200,children:g(q)}),t("td",{width:200,children:v(o.Group,{position:"left",children:[t(Nt,{account:p,onSuccess:u}),t(xe,{id:m,name:C,onSuccess:u})]})})]},m)})})]})]})]})}function Bt({postSubmit:n,styles:r=F}){const{control:i,handleSubmit:s}=_.useForm({defaultValues:{name:"",password:""}}),u=async({name:l,password:c})=>{try{R.showNotification({id:"for-login",title:"Pending",message:"Loggin in...",loading:!0});const f=await j.account.login(l,c);window.localStorage.setItem("token",f.token),R.updateNotification({id:"for-login",title:"Successful",message:"Logged in",color:"green"}),n(f)}catch(f){R.updateNotification({id:"for-login",title:"Login Failed",message:f.message,color:"red"})}};return t(o.Box,{mx:"auto",children:v("form",{onSubmit:s(u),children:[t(_.Controller,{name:"name",control:i,render:({field:l})=>t(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Username",...l})}),t(_.Controller,{name:"password",control:i,render:({field:l})=>t(o.PasswordInput,{mb:r.spacing,size:r.size,required:!0,label:"Password",...l})}),t(o.Group,{position:"right",mt:r.spacing,children:t(o.Button,{type:"submit",size:r.button.size,children:"Submit"})})]})})}function Mt({styles:n=F,config:r,onSuccess:i}){return ne(r),t(L,{children:t(o.Box,{mt:n.spacing,sx:{position:"relative"},children:t(Bt,{styles:n,postSubmit:i})})})}const ie={size:"sm",spacing:"md",button:{size:"xs"}};function Ft({postSubmit:n,styles:r=ie,initialRoleID:i}){const{control:s,handleSubmit:u}=_.useForm({defaultValues:{name:"",role_id:i}}),l=async({name:c,role_id:f})=>{try{R.showNotification({id:"for-creating",title:"Pending",message:"Adding API Key...",loading:!0});const{app_id:g,app_secret:w}=await j.api_key.create(c,f);R.updateNotification({id:"for-creating",title:"Successful",message:"API Key is added",color:"green"}),n(g,w)}catch(g){R.updateNotification({id:"for-creating",title:"Failed",message:g.message,color:"red"})}};return t(o.Box,{mx:"auto",children:v("form",{onSubmit:u(l),children:[t(_.Controller,{name:"name",control:s,render:({field:c})=>t(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Name",...c})}),t(_.Controller,{name:"role_id",control:s,render:({field:c})=>t(de,{styles:r,...c})}),t(o.Group,{position:"right",mt:r.spacing,children:t(o.Button,{type:"submit",size:r.button.size,children:"Save"})})]})})}function Oe({onSuccess:n,styles:r=ie,initialRoleID:i}){const s=K.useModals(),[u,l]=E.useState(!1),c=()=>l(!0),f=()=>l(!1),g=(w,p)=>{f(),s.openModal({title:"API Key is generated",children:v(o.Stack,{children:[t(o.Text,{color:"dimmed",children:"Make sure you save it - you won't be able to access it again."}),t(o.TextInput,{defaultValue:w,disabled:!0,label:"APP ID",styles:{input:{cursor:"text !important"}}}),t(o.TextInput,{defaultValue:p,disabled:!0,label:"APP Secret",styles:{input:{cursor:"text !important"}}}),t(o.Button,{size:"sm",onClick:()=>{K.closeAllModals()},children:"I've saved this API Key"})]}),onClose:()=>{n()}})};return v(L,{children:[t(o.Modal,{overflow:"inside",opened:u,onClose:()=>l(!1),title:"Add an API Key",trapFocus:!0,onDragStart:w=>{w.stopPropagation()},children:t(Ft,{postSubmit:g,styles:r,initialRoleID:i})}),t(o.Button,{size:r.button.size,onClick:c,leftIcon:t(N.PlaylistAdd,{size:20}),children:"Add an API Key"})]})}function ze({id:n,name:r,onSuccess:i,styles:s=ie}){const u=K.useModals(),l=async()=>{if(n){R.showNotification({id:"for-deleting",title:"Pending",message:"Deleting API Key...",loading:!0});try{await j.api_key.delete(n),R.updateNotification({id:"for-deleting",title:"Successful",message:`API Key [${r}] is deleted`,color:"green"}),i()}catch(f){R.updateNotification({id:"for-deleting",title:"Failed",message:f.message,color:"red"})}}},c=()=>u.openConfirmModal({title:"Delete this api-key?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:l});return t(o.Button,{size:s.button.size,color:"red",onClick:c,leftIcon:t(N.Trash,{size:20}),children:"Delete"})}function $t({styles:n=ie,config:r}){var w;ne(r);const{data:i=[],loading:s,refresh:u}=U.useRequest(async()=>{const{data:p}=await j.api_key.list();return p},{refreshDeps:[]}),{data:l=[],loading:c}=U.useRequest(async()=>(await j.role.list()).map(m=>({label:m.name,value:m.id,description:m.description,disabled:m.id===50})),{refreshDeps:[]}),f=E.useMemo(()=>l.reduce((p,m)=>(p.set(m.value,m.label),p),new Map),[l]),g=p=>f.get(p)??p;return v(L,{children:[t(o.Group,{pt:n.spacing,position:"right",children:t(Oe,{onSuccess:u,initialRoleID:((w=l==null?void 0:l[0])==null?void 0:w.value)??0})}),v(o.Box,{mt:n.spacing,sx:{position:"relative"},children:[t(o.LoadingOverlay,{visible:s||c}),v(o.Table,{horizontalSpacing:n.spacing,verticalSpacing:n.spacing,fontSize:n.size,highlightOnHover:!0,children:[t("thead",{children:v("tr",{children:[t("th",{children:"Name"}),t("th",{children:"APP ID"}),t("th",{children:"Role"}),t("th",{children:"Action"})]})}),t("tbody",{children:i.map(p=>{const{id:m,name:C,app_id:I,role_id:q}=p;return v("tr",{children:[t("td",{width:200,children:C}),t("td",{width:200,children:I}),t("td",{width:200,children:g(q)}),t("td",{width:200,children:t(o.Group,{position:"left",children:t(ze,{id:m,name:C,onSuccess:u})})})]},m)})})]})]})]})}const Ut=()=>Promise.resolve().then(()=>Vt).then(({version:n})=>(console.log(`[@devtable/dashboard] version: ${n}`),n)),Ae="@devtable/settings-form",De="9.6.0",je="Apache-2.0",Ie={access:"public",registry:"https://registry.npmjs.org/"},ke=["dist"],qe="./dist/settings-form.umd.js",Ne="./dist/settings-form.es.js",Le="./dist/index.d.ts",Be={".":{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"},Fe={"@monaco-editor/react":"4.4.6","monaco-editor":"0.36.0"},$e={"@emotion/babel-plugin":"11.10.6","@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","vite-plugin-static-copy":"0.13.1"},Ue={"@emotion/react":"11.10.6","@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"},Vt=Object.freeze(Object.defineProperty({__proto__:null,default:{name:Ae,version:De,license:je,publishConfig:Ie,files:ke,main:qe,module:Ne,types:Le,exports:Be,scripts:Me,dependencies:Fe,devDependencies:$e,peerDependencies:Ue},dependencies:Fe,devDependencies:$e,exports:Be,files:ke,license:je,main:qe,module:Ne,name:Ae,peerDependencies:Ue,publishConfig:Ie,scripts:Me,types:Le,version:De},Symbol.toStringTag,{value:"Module"}));P.APIKeyList=$t,P.AccountList=Lt,P.AddAPIKey=Oe,P.AddAccount=Ee,P.AddDataSource=Te,P.DataSourceList=jt,P.DeleteAPIKey=ze,P.DeleteAccount=xe,P.DeleteDataSource=Re,P.Login=Mt,P.getVersion=Ut,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
29
+ `)};function Pt({submit:n,styles:r=N}){const{control:o,setValue:s,handleSubmit:u}=y.useForm({defaultValues:{type:"http",key:"",config:{host:"",processing:{pre:ie.pre,post:ie.post}}}});return t(i.Box,{mx:"auto",children:m("form",{onSubmit:u(n),children:[t(y.Controller,{name:"key",control:o,render:({field:l})=>t(i.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Name",placeholder:"A unique name",...l})}),t(i.Divider,{label:"Connection Info",labelPosition:"center"}),t(y.Controller,{name:"config.host",control:o,render:({field:l})=>t(i.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Base URL",sx:{flexGrow:1},...l})}),m(i.Group,{grow:!0,children:[t(y.Controller,{name:"config.processing.pre",control:o,render:({field:l})=>t(re,{label:"Pre Processing",modalTitle:"This function will run before sending the request (for scenarios like encryption)",defaultValue:ie.pre,...l,styles:r})}),t(y.Controller,{name:"config.processing.post",control:o,render:({field:l})=>t(re,{label:"Post Processing",modalTitle:"This function will run after sending the request (for scenarios like decryption)",defaultValue:ie.post,...l,styles:r})})]}),t(i.Group,{position:"right",mt:r.spacing,children:t(i.Button,{type:"submit",size:r.button.size,children:"Save"})})]})})}function Ct({styles:n=N}){return t(i.Box,{mx:"auto",children:m(i.Alert,{mt:n.spacing,icon:t(B.AlertCircle,{size:16}),children:["Only ",t("b",{children:"SELECT"})," privilege is needed."]})})}function Et({postSubmit:n,styles:r=N}){const[o,s]=x.useState("postgresql"),u=async({type:f,key:h,config:S})=>{E.showNotification({id:"for-creating",title:"Pending",message:"Adding data source...",loading:!0});try{console.log({type:f,key:h,config:S}),await D.datasource.create(f,h,S),E.updateNotification({id:"for-creating",title:"Successful",message:"Data source is added",color:"green"}),n()}catch(p){E.updateNotification({id:"for-creating",title:"Failed",message:p.message,color:"red"})}},l=o==="postgresql"||o==="mysql",c=o==="http";return m(i.Box,{mx:"auto",children:[t(i.SegmentedControl,{fullWidth:!0,mb:r.spacing,size:r.size,data:[{label:"PostgreSQL",value:"postgresql"},{label:"MySQL",value:"mysql"},{label:"HTTP",value:"http"}],value:o,onChange:f=>s(f)}),l&&t(Ct,{styles:r}),l&&t(_t,{submit:u,styles:r,type:o}),c&&t(Pt,{submit:u,styles:r})]})}function Pe({onSuccess:n,styles:r=N}){const[o,s]=x.useState(!1),u=()=>s(!0),l=()=>s(!1),c=()=>{n(),l()};return m(k,{children:[t(i.Modal,{overflow:"inside",opened:o,onClose:()=>s(!1),title:"Add a data source",trapFocus:!0,onDragStart:f=>{f.stopPropagation()},children:t(Et,{postSubmit:c,styles:r})}),t(i.Button,{size:r.button.size,onClick:u,leftIcon:t(B.PlaylistAdd,{size:20}),children:"Add a Data Source"})]})}const xt=n=>n.replace(/([^:])(\/\/+)/g,"$1/");function Rt(n){x.useEffect(()=>{if(te.loader.__getMonacoInstance())return;console.log("loading monaco for @devtable/settings-form");const o=xt(n);te.loader.config({paths:{vs:o}}),te.loader.init().then(s=>console.log("monaco instance:",s))},[])}function Ce({id:n,name:r,isProtected:o,onSuccess:s,styles:u=N}){const l=J.useModals(),c=async()=>{n&&(E.showNotification({id:"for-deleting",title:"Pending",message:"Deleting data source...",loading:!0}),await D.datasource.delete(n),E.updateNotification({id:"for-deleting",title:"Successful",message:`Data source [${r}] is deleted`,color:"green"}),s())},f=()=>l.openConfirmModal({title:"Delete this data source?",children:t(i.Text,{size:u.size,children:"This action won't affect your database."}),labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:c});return o?t(i.Tooltip,{withArrow:!0,events:{hover:!0,touch:!1,focus:!1},label:"This is a preset datasource, it can not be deleted",children:t(i.Button,{size:u.button.size,color:"gray",variant:"light",leftIcon:t($.IconLock,{size:16}),sx:{transform:"none !important"},children:"Delete"})}):t(i.Button,{size:u.button.size,color:"red",onClick:f,leftIcon:t(B.Trash,{size:16}),children:"Delete"})}const Ee={pre:["function pre_process({ method, url, params, headers, data }, utils) {"," // your code goes here"," return { method, url, params, headers, data }","}"].join(`
30
+ `),post:["function post_process(res, utils) {"," // your code goes here"," return data","}"].join(`
31
+ `)};function zt({name:n,config:r,submit:o,styles:s=N}){const{control:u,handleSubmit:l}=y.useForm({defaultValues:{config:r}});return t(i.Box,{mx:"auto",children:m("form",{onSubmit:l(o),children:[t(i.TextInput,{mb:s.spacing,size:s.size,required:!0,label:"Name",value:n,readOnly:!0}),t(i.Divider,{label:"Connection Info",labelPosition:"center"}),t(y.Controller,{name:"config.host",control:u,render:({field:c})=>t(i.TextInput,{mb:s.spacing,size:s.size,required:!0,label:"Base URL",sx:{flexGrow:1},...c})}),m(i.Group,{grow:!0,children:[t(y.Controller,{name:"config.processing.pre",control:u,render:({field:c})=>t(re,{label:"Pre Processing",modalTitle:"This function will run before sending the request (for scenarios like encryption)",defaultValue:Ee.pre,...c,styles:s})}),t(y.Controller,{name:"config.processing.post",control:u,render:({field:c})=>t(re,{label:"Post Processing",modalTitle:"This function will run after sending the request (for scenarios like decryption)",defaultValue:Ee.post,...c,styles:s})})]}),t(i.Group,{position:"right",mt:s.spacing,children:t(i.Button,{type:"submit",size:s.button.size,children:"Save"})})]})})}function At({dataSource:n,postSubmit:r,styles:o=N}){const s=async({config:u})=>{E.showNotification({id:"for-updating",title:"Pending",message:"Editing data source...",loading:!0});try{console.log({config:u}),await D.datasource.update(n.id,u),E.updateNotification({id:"for-updating",title:"Successful",message:"Data source is updated",color:"green"}),r()}catch(l){E.updateNotification({id:"for-updating",title:"Failed",message:l.message,color:"red"})}};return n.config?t(i.Box,{mx:"auto",children:t(zt,{name:n.key,config:n.config,submit:s,styles:o})}):(console.error(new Error("unexpected empty config of a http datasource")),null)}function Dt({dataSource:n,onSuccess:r,styles:o=N}){const[s,u]=x.useState(!1),l=()=>u(!0),c=()=>u(!1),f=()=>{r(),c()};return n.is_preset?t(i.Tooltip,{withArrow:!0,events:{hover:!0,touch:!1,focus:!1},label:"This is a preset datasource, it can not be changed",children:t(i.Button,{size:o.button.size,color:"gray",variant:"light",leftIcon:t($.IconLock,{size:16}),sx:{transform:"none !important"},children:"Edit"})}):n.type!=="http"?t(i.Tooltip,{withArrow:!0,events:{hover:!0,touch:!1,focus:!1},label:"Only HTTP datasources can be edited",children:t(i.Button,{size:o.button.size,color:"gray",variant:"light",leftIcon:t($.IconEdit,{size:16}),sx:{transform:"none !important"},children:"Edit"})}):m(k,{children:[t(i.Modal,{overflow:"inside",opened:s,onClose:()=>u(!1),title:"Add a data source",trapFocus:!0,onDragStart:h=>{h.stopPropagation()},children:t(At,{dataSource:n,postSubmit:f,styles:o})}),t(i.Button,{size:o.button.size,color:"blue",onClick:l,leftIcon:t($.IconEdit,{size:16}),children:"Edit"})]})}const Ot={http:"HTTP",mysql:"MySQL",postgresql:"PostgreSQL"},It={http:t($.IconNetwork,{}),mysql:t($.IconBrandMysql,{}),postgresql:t($.IconDatabase,{})};function jt({type:n}){return m(i.Group,{children:[t(i.ActionIcon,{size:"xs",sx:{transform:"none !important"},children:It[n]}),t(i.Text,{sx:{cusor:"default",userSelect:"none"},children:Ot[n]})]})}function qt({styles:n=N,config:r}){Rt(r.monacoPath),ne(r);const{data:o=[],loading:s,refresh:u}=G.useRequest(async()=>{const{data:l}=await D.datasource.list();return l},{refreshDeps:[]});return m(k,{children:[t(i.Group,{pt:n.spacing,position:"right",children:t(Pe,{onSuccess:u})}),m(i.Box,{mt:n.spacing,sx:{position:"relative"},children:[t(i.LoadingOverlay,{visible:s}),m(i.Table,{horizontalSpacing:n.spacing,verticalSpacing:n.spacing,fontSize:n.size,highlightOnHover:!0,children:[t("thead",{children:m("tr",{children:[t("th",{children:"Type"}),t("th",{children:"Name"}),t("th",{children:"Action"})]})}),t("tbody",{children:o.map(l=>{const{id:c,key:f,type:h,is_preset:S}=l;return m("tr",{children:[t("td",{width:200,children:t(jt,{type:h})}),t("td",{children:f}),t("td",{width:400,children:m(i.Group,{position:"left",children:[t(Dt,{dataSource:l,onSuccess:u,styles:n}),t(Ce,{isProtected:S,id:c,name:f,onSuccess:u,styles:n})]})})]},f)})})]})]})]})}const kt=x.forwardRef(({label:n,value:r,description:o,...s},u)=>m(i.Stack,{spacing:2,ref:u,...s,children:[t(i.Text,{size:"sm",children:n}),t(i.Text,{size:"xs",color:"dimmed",className:"role-description",children:o})]})),de=x.forwardRef(({styles:n,value:r,onChange:o},s)=>{const{data:u=[],loading:l}=G.useRequest(async()=>(await D.role.list()).map(f=>({label:f.name,value:f.id,description:f.description,disabled:f.id===50})),{refreshDeps:[]});return t(i.Select,{ref:s,mb:n.spacing,size:n.size,required:!0,label:"Role",itemComponent:kt,data:u,disabled:l,styles:()=>({item:{"&[data-selected]":{"&, &:hover":{".role-description":{color:"rgba(255,255,255,.8)"}}}}}),value:r,onChange:o})}),U={size:"sm",spacing:"md",button:{size:"xs"}};function Nt({postSubmit:n,styles:r=U,initialRoleID:o}){const{control:s,handleSubmit:u}=y.useForm({defaultValues:{name:"",email:"",role_id:o,password:""}}),l=async({name:c,email:f,password:h,role_id:S})=>{try{E.showNotification({id:"for-creating",title:"Pending",message:"Adding account...",loading:!0}),await D.account.create(c,f,h,S),E.updateNotification({id:"for-creating",title:"Successful",message:"Account is added",color:"green"}),n()}catch(p){E.updateNotification({id:"for-creating",title:"Failed",message:p.message,color:"red"})}};return t(i.Box,{mx:"auto",children:m("form",{onSubmit:u(l),children:[t(y.Controller,{name:"name",control:s,render:({field:c})=>t(i.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Username",...c})}),t(y.Controller,{name:"email",control:s,render:({field:c})=>t(i.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Email",...c})}),t(y.Controller,{name:"password",control:s,render:({field:c})=>t(i.PasswordInput,{mb:r.spacing,size:r.size,required:!0,label:"Password",description:"Password must be at least 8 characters long",...c})}),t(y.Controller,{name:"role_id",control:s,render:({field:c})=>t(de,{styles:r,...c})}),t(i.Group,{position:"right",mt:r.spacing,children:t(i.Button,{type:"submit",size:r.button.size,children:"Save"})})]})})}function xe({onSuccess:n,styles:r=U,initialRoleID:o}){const[s,u]=x.useState(!1),l=()=>u(!0),c=()=>u(!1),f=()=>{n(),c()};return m(k,{children:[t(i.Modal,{overflow:"inside",opened:s,onClose:()=>u(!1),title:"Add an Account",trapFocus:!0,onDragStart:h=>{h.stopPropagation()},children:t(Nt,{postSubmit:f,styles:r,initialRoleID:o})}),t(i.Button,{size:r.button.size,onClick:l,leftIcon:t(B.PlaylistAdd,{size:20}),children:"Add an Account"})]})}function Re({id:n,name:r,onSuccess:o,styles:s=U}){const u=J.useModals(),l=async()=>{if(n){E.showNotification({id:"for-deleting",title:"Pending",message:"Deleting account...",loading:!0});try{await D.account.delete(n),E.updateNotification({id:"for-deleting",title:"Successful",message:`Account [${r}] is deleted`,color:"green"}),o()}catch(f){E.updateNotification({id:"for-deleting",title:"Failed",message:f.message,color:"red"})}}},c=()=>u.openConfirmModal({title:"Delete this account?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:l});return t(i.Button,{size:s.button.size,color:"red",onClick:c,leftIcon:t(B.Trash,{size:20}),children:"Delete"})}function Lt({id:n,name:r,email:o,role_id:s,postSubmit:u,styles:l=U}){const{control:c,handleSubmit:f,watch:h}=y.useForm({defaultValues:{name:r,email:o,role_id:s,reset_password:!1,new_password:""}}),S=async({name:P,email:j,role_id:L,reset_password:fe,new_password:pe})=>{try{E.showNotification({id:"for-updating",title:"Pending",message:"Updating account...",loading:!0}),await D.account.edit({id:n,name:P.trim(),email:j.trim(),role_id:L,reset_password:fe,new_password:pe.trim()}),E.updateNotification({id:"for-updating",title:"Successful",message:"Account is updated",color:"green"}),u()}catch(V){E.updateNotification({id:"for-updating",title:"Failed",message:V.message,color:"red"})}},[p,v]=h(["reset_password","new_password"]);return t(i.Box,{mx:"auto",children:m("form",{onSubmit:f(S),children:[t(y.Controller,{name:"name",control:c,render:({field:P})=>t(i.TextInput,{mb:l.spacing,size:l.size,required:!0,label:"Username",...P})}),t(y.Controller,{name:"email",control:c,render:({field:P})=>t(i.TextInput,{mb:l.spacing,size:l.size,required:!0,label:"Email",...P})}),t(y.Controller,{name:"role_id",control:c,render:({field:P})=>t(de,{styles:l,...P})}),t(i.Divider,{my:20,variant:"dashed",label:"",labelPosition:"center"}),t(y.Controller,{name:"reset_password",control:c,render:({field:P})=>t(i.Switch,{mb:l.spacing,size:l.size,label:"Reset password",checked:P.value,onChange:j=>P.onChange(j.currentTarget.checked),styles:{label:{verticalAlign:"middle"}}})}),p&&t(y.Controller,{name:"new_password",control:c,render:({field:P})=>t(i.PasswordInput,{autoComplete:"off",mb:l.spacing,size:l.size,required:!0,description:"Password must be at least 8 characters long",label:"New Password",...P})}),t(i.Group,{position:"right",mt:l.spacing,children:t(i.Button,{type:"submit",size:l.button.size,children:"Submit"})})]})})}function Bt({account:n,onSuccess:r,styles:o=U}){const[s,u]=x.useState(!1),l=()=>u(!0),c=()=>u(!1),f=()=>{r(),c()};return m(k,{children:[t(i.Modal,{overflow:"inside",opened:s,onClose:()=>u(!1),title:`Editing ${n.name}`,trapFocus:!0,onDragStart:h=>{h.stopPropagation()},children:t(Lt,{...n,postSubmit:f,styles:o})}),t(i.Button,{size:o.button.size,onClick:l,leftIcon:t(B.Edit,{size:20}),children:"Edit"})]})}function Mt({styles:n=U,config:r}){var S;ne(r);const{data:o=[],loading:s,refresh:u}=G.useRequest(async()=>{const{data:p}=await D.account.list();return p},{refreshDeps:[]}),{data:l=[],loading:c}=G.useRequest(async()=>(await D.role.list()).map(v=>({label:v.name,value:v.id,description:v.description,disabled:v.id===50})),{refreshDeps:[]}),f=x.useMemo(()=>l.reduce((p,v)=>(p.set(v.value,v.label),p),new Map),[l]),h=p=>f.get(p)??p;return m(k,{children:[t(i.Group,{pt:n.spacing,position:"right",children:t(xe,{onSuccess:u,initialRoleID:((S=l==null?void 0:l[0])==null?void 0:S.value)??0})}),m(i.Box,{mt:n.spacing,sx:{position:"relative"},children:[t(i.LoadingOverlay,{visible:s||c}),m(i.Table,{horizontalSpacing:n.spacing,verticalSpacing:n.spacing,fontSize:n.size,highlightOnHover:!0,children:[t("thead",{children:m("tr",{children:[t("th",{children:"Username"}),t("th",{children:"Email"}),t("th",{children:"Role"}),t("th",{children:"Action"})]})}),t("tbody",{children:o.map(p=>{const{id:v,name:P,email:j,role_id:L}=p;return m("tr",{children:[t("td",{width:200,children:P}),t("td",{width:200,children:j}),t("td",{width:200,children:h(L)}),t("td",{width:200,children:m(i.Group,{position:"left",children:[t(Bt,{account:p,onSuccess:u}),t(Re,{id:v,name:P,onSuccess:u})]})})]},v)})})]})]})]})}function Ft({postSubmit:n,styles:r=U}){const{control:o,handleSubmit:s}=y.useForm({defaultValues:{name:"",password:""}}),u=async({name:l,password:c})=>{try{E.showNotification({id:"for-login",title:"Pending",message:"Loggin in...",loading:!0});const f=await D.account.login(l.trim(),c.trim());window.localStorage.setItem("token",f.token),E.updateNotification({id:"for-login",title:"Successful",message:"Logged in",color:"green"}),n(f)}catch(f){E.updateNotification({id:"for-login",title:"Login Failed",message:f.message,color:"red"})}};return t(i.Box,{mx:"auto",children:m("form",{onSubmit:s(u),children:[t(y.Controller,{name:"name",control:o,render:({field:l})=>t(i.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Username",...l})}),t(y.Controller,{name:"password",control:o,render:({field:l})=>t(i.PasswordInput,{mb:r.spacing,size:r.size,required:!0,label:"Password",...l})}),t(i.Group,{position:"right",mt:r.spacing,children:t(i.Button,{type:"submit",size:r.button.size,children:"Submit"})})]})})}function Ut({styles:n=U,config:r,onSuccess:o}){return ne(r),t(k,{children:t(i.Box,{mt:n.spacing,sx:{position:"relative"},children:t(Ft,{styles:n,postSubmit:o})})})}const ae={size:"sm",spacing:"md",button:{size:"xs"}};function Vt({postSubmit:n,styles:r=ae,initialRoleID:o}){const{control:s,handleSubmit:u}=y.useForm({defaultValues:{name:"",role_id:o}}),l=async({name:c,role_id:f})=>{try{E.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);E.updateNotification({id:"for-creating",title:"Successful",message:"API Key is added",color:"green"}),n(h,S)}catch(h){E.updateNotification({id:"for-creating",title:"Failed",message:h.message,color:"red"})}};return t(i.Box,{mx:"auto",children:m("form",{onSubmit:u(l),children:[t(y.Controller,{name:"name",control:s,render:({field:c})=>t(i.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Name",...c})}),t(y.Controller,{name:"role_id",control:s,render:({field:c})=>t(de,{styles:r,...c})}),t(i.Group,{position:"right",mt:r.spacing,children:t(i.Button,{type:"submit",size:r.button.size,children:"Save"})})]})})}function ze({onSuccess:n,styles:r=ae,initialRoleID:o}){const s=J.useModals(),[u,l]=x.useState(!1),c=()=>l(!0),f=()=>l(!1),h=(S,p)=>{f(),s.openModal({title:"API Key is generated",children:m(i.Stack,{children:[t(i.Text,{color:"dimmed",children:"Make sure you save it - you won't be able to access it again."}),t(i.TextInput,{defaultValue:S,disabled:!0,label:"APP ID",styles:{input:{cursor:"text !important"}}}),t(i.TextInput,{defaultValue:p,disabled:!0,label:"APP Secret",styles:{input:{cursor:"text !important"}}}),t(i.Button,{size:"sm",onClick:()=>{J.closeAllModals()},children:"I've saved this API Key"})]}),onClose:()=>{n()}})};return m(k,{children:[t(i.Modal,{overflow:"inside",opened:u,onClose:()=>l(!1),title:"Add an API Key",trapFocus:!0,onDragStart:S=>{S.stopPropagation()},children:t(Vt,{postSubmit:h,styles:r,initialRoleID:o})}),t(i.Button,{size:r.button.size,onClick:c,leftIcon:t(B.PlaylistAdd,{size:20}),children:"Add an API Key"})]})}function Ae({id:n,name:r,onSuccess:o,styles:s=ae}){const u=J.useModals(),l=async()=>{if(n){E.showNotification({id:"for-deleting",title:"Pending",message:"Deleting API Key...",loading:!0});try{await D.api_key.delete(n),E.updateNotification({id:"for-deleting",title:"Successful",message:`API Key [${r}] is deleted`,color:"green"}),o()}catch(f){E.updateNotification({id:"for-deleting",title:"Failed",message:f.message,color:"red"})}}},c=()=>u.openConfirmModal({title:"Delete this api-key?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:l});return t(i.Button,{size:s.button.size,color:"red",onClick:c,leftIcon:t(B.Trash,{size:20}),children:"Delete"})}function Gt({styles:n=ae,config:r}){var S;ne(r);const{data:o=[],loading:s,refresh:u}=G.useRequest(async()=>{const{data:p}=await D.api_key.list();return p},{refreshDeps:[]}),{data:l=[],loading:c}=G.useRequest(async()=>(await D.role.list()).map(v=>({label:v.name,value:v.id,description:v.description,disabled:v.id===50})),{refreshDeps:[]}),f=x.useMemo(()=>l.reduce((p,v)=>(p.set(v.value,v.label),p),new Map),[l]),h=p=>f.get(p)??p;return m(k,{children:[t(i.Group,{pt:n.spacing,position:"right",children:t(ze,{onSuccess:u,initialRoleID:((S=l==null?void 0:l[0])==null?void 0:S.value)??0})}),m(i.Box,{mt:n.spacing,sx:{position:"relative"},children:[t(i.LoadingOverlay,{visible:s||c}),m(i.Table,{horizontalSpacing:n.spacing,verticalSpacing:n.spacing,fontSize:n.size,highlightOnHover:!0,children:[t("thead",{children:m("tr",{children:[t("th",{children:"Name"}),t("th",{children:"APP ID"}),t("th",{children:"Role"}),t("th",{children:"Action"})]})}),t("tbody",{children:o.map(p=>{const{id:v,name:P,app_id:j,role_id:L}=p;return m("tr",{children:[t("td",{width:200,children:P}),t("td",{width:200,children:j}),t("td",{width:200,children:h(L)}),t("td",{width:200,children:t(i.Group,{position:"left",children:t(Ae,{id:v,name:P,onSuccess:u})})})]},v)})})]})]})]})}const $t=()=>Promise.resolve().then(()=>Wt).then(({version:n})=>(console.log(`[@devtable/dashboard] version: ${n}`),n)),De="@devtable/settings-form",Oe="9.7.0",Ie="Apache-2.0",je={access:"public",registry:"https://registry.npmjs.org/"},qe=["dist"],ke="./dist/settings-form.umd.js",Ne="./dist/settings-form.es.js",Le="./dist/index.d.ts",Be={".":{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"},Fe={"@monaco-editor/react":"4.4.6","@tabler/icons":"1.119.0","monaco-editor":"0.36.0"},Ue={"@emotion/babel-plugin":"11.10.6","@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","vite-plugin-static-copy":"0.13.1"},Ve={"@emotion/react":"11.10.6","@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"},Wt=Object.freeze(Object.defineProperty({__proto__:null,default:{name:De,version:Oe,license:Ie,publishConfig:je,files:qe,main:ke,module:Ne,types:Le,exports:Be,scripts:Me,dependencies:Fe,devDependencies:Ue,peerDependencies:Ve},dependencies:Fe,devDependencies:Ue,exports:Be,files:qe,license:Ie,main:ke,module:Ne,name:De,peerDependencies:Ve,publishConfig:je,scripts:Me,types:Le,version:Oe},Symbol.toStringTag,{value:"Module"}));T.APIKeyList=Gt,T.AccountList=Mt,T.AddAPIKey=ze,T.AddAccount=xe,T.AddDataSource=Pe,T.DataSourceList=qt,T.DeleteAPIKey=Ae,T.DeleteAccount=Re,T.DeleteDataSource=Ce,T.Login=Ut,T.getVersion=$t,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtable/settings-form",
3
- "version": "9.6.0",
3
+ "version": "9.7.0",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -29,6 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@monaco-editor/react": "4.4.6",
32
+ "@tabler/icons": "1.119.0",
32
33
  "monaco-editor": "0.36.0"
33
34
  },
34
35
  "devDependencies": {