@epam/ai-dial-toolset-editor 1.2.0-dev.6 → 1.2.0-dev.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"ToolsetEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ToolsetEditor/ToolsetEditor.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAwC5E,uKAAuK;AACvK,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CAyWhD,CAAC"}
1
+ {"version":3,"file":"ToolsetEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ToolsetEditor/ToolsetEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAwC5E,uKAAuK;AACvK,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA+WhD,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const TOOLSET_EDITOR_CLASS: {
2
+ /** The metadata column of the editor, inside the shared editor layout. */
3
+ readonly metadataSection: "dial-toolset-editor-metadata-section";
4
+ /** The setup column beside it, holding the connection and auth forms. */
5
+ readonly setupSection: "dial-toolset-editor-setup-section";
6
+ };
7
+ //# sourceMappingURL=public-class-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-class-names.d.ts","sourceRoot":"","sources":["../../src/constants/public-class-names.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,oBAAoB;IAC/B,0EAA0E;;IAE1E,yEAAyE;;CAEjE,CAAC"}
package/index.css ADDED
@@ -0,0 +1 @@
1
+ .sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.visible{visibility:visible}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.max-w-\[1060px\]{max-width:1060px}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.items-center{align-items:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.border-0{border-width:0}.border-t{border-top-width:1px}.border-tertiary{border-color:var(--stroke-tertiary,#e0e6f0)}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.text-start{text-align:start}.text-primary{color:var(--text-primary,#161b2d)}.text-secondary{color:var(--text-secondary,#57647a)}@media (min-width:1280px){.desktop\:not-sr-only{height:auto;margin:0;overflow:visible;padding:0;position:static;width:auto;clip:auto;white-space:normal}.desktop\:p-6{padding:1.5rem}}
package/index.d.ts CHANGED
@@ -9,4 +9,5 @@ export type { ToolsetOAuthLoginHandler, ToolsetOAuthLoginRequest, ToolsetOAuthLo
9
9
  export type { DeploymentGeneralFormData, ToolsetAuthActions, ToolsetAuthFormData, ToolsetFormData, ToolsetFormErrors, ToolsetLoginRequest, ToolsetLogoutRequest, } from './models/toolset-form';
10
10
  export { AUTH_TYPE_ICONS, DEFAULT_TOOLSET_NAME, DEFAULT_TOOLSET_VERSION, ToolsetTransportType, } from './constants/toolsets';
11
11
  export { getDefaultToolsetForm, getStorageSafeUniqueToolsetName, isToolsetAuthValid, isToolsetFormValid, isValidEndpointUrl, normalizeReturnedEndpointUrl, } from './utils/toolsets';
12
+ export { TOOLSET_EDITOR_CLASS } from './constants/public-class-names';
12
13
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,YAAY,EACV,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EACV,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,YAAY,EACV,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EACV,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC"}
package/index.js CHANGED
@@ -1,17 +1,20 @@
1
1
  import { AvatarPickerModal as e, DeploymentCreationFieldErrorCode as t, DeploymentCreationForm as n, EditorLayout as r, EditorSection as i, validateDeploymentCreationFields as a } from "@epam/ai-dial-builder-form";
2
2
  import { ToolsetAuthTypes as o, ToolsetCredentialsLevel as s, WithLogin as c, dialFileToAttachment as l, getApiErrorDetails as u } from "@epam/ai-dial-chat-hooks";
3
- import { ConfirmationPopup as d, ConfirmationPopupVariant as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, Input as h, NeutralButton as g, PasswordInput as _, PrimaryButton as v, Radio as y, RadioGroup as b, SegmentedControl as ee, Select as x, TagInput as S } from "@epam/ai-dial-ui-kit";
4
- import { memo as C, useCallback as w, useEffect as T, useMemo as E, useRef as D, useState as O } from "react";
5
- import { IconBrandOauth as k, IconKey as A, IconLockOff as j, IconLogin as te, IconLogout as M } from "@tabler/icons-react";
6
- import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
7
- import { CopyButton as I, TAG_INPUT_TAG_CLASS_NAME as L, mergeClasses as R, useCodeCopy as z } from "@epam/ai-dial-chat-shared";
8
- //#region src/constants/toolsets.ts
9
- var B = /* @__PURE__ */ function(e) {
3
+ import { CopyButton as d, TAG_INPUT_TAG_CLASS_NAME as f, mergeClasses as p, useCodeCopy as m } from "@epam/ai-dial-chat-shared";
4
+ import { ConfirmationPopup as h, ConfirmationPopupVariant as g, DIAL_ICON_SIZE as _, DIAL_KIT_ICON_STROKE as v, Input as y, NeutralButton as b, PasswordInput as x, PrimaryButton as S, Radio as C, RadioGroup as w, SegmentedControl as ee, Select as T, TagInput as E } from "@epam/ai-dial-ui-kit";
5
+ import { memo as D, useCallback as O, useEffect as k, useMemo as A, useRef as j, useState as M } from "react";
6
+ import { IconBrandOauth as N, IconKey as P, IconLockOff as F, IconLogin as te, IconLogout as I } from "@tabler/icons-react";
7
+ import { Fragment as ne, jsx as L, jsxs as R } from "react/jsx-runtime";
8
+ //#region src/constants/public-class-names.ts
9
+ var z = {
10
+ metadataSection: "dial-toolset-editor-metadata-section",
11
+ setupSection: "dial-toolset-editor-setup-section"
12
+ }, B = /* @__PURE__ */ function(e) {
10
13
  return e.Http = "HTTP", e.Sse = "SSE", e;
11
14
  }({}), V = "New toolset", H = "0.0.1", U = {
12
- [o.OAuth]: k,
13
- [o.ApiKey]: A,
14
- [o.None]: j
15
+ [o.OAuth]: N,
16
+ [o.ApiKey]: P,
17
+ [o.None]: F
15
18
  }, W = ({ defaultName: e = V, existingNames: t }) => {
16
19
  let n = new Set(t);
17
20
  if (!n.has(e)) return e;
@@ -53,7 +56,7 @@ var B = /* @__PURE__ */ function(e) {
53
56
  if (q(t)) return t;
54
57
  }
55
58
  return t;
56
- }, ne = (e) => !e?.trim() || J(e), Z = (e, t = !1) => e.isLoggedIn ? !0 : e.authenticationType === o.ApiKey ? e.keyHeader?.trim() ? e.withLogin === c.WithoutLogin ? !0 : !!(e.keyHeader?.trim() && e.apiKey?.trim()) : !1 : e.authenticationType === o.OAuth && e.withLogin === c.WithConfig ? !!e.clientId?.trim() && (t || !!e.clientSecret?.trim()) && ne(e.authorizationEndpoint) && ne(e.tokenEndpoint) : !0, re = (e, t = !1) => Object.keys(a(e, { validateVersionPattern: !0 })).length === 0 && J(e.endpoint) && Z(e.auth, t), ie = {
59
+ }, Z = (e) => !e?.trim() || J(e), Q = (e, t = !1) => e.isLoggedIn ? !0 : e.authenticationType === o.ApiKey ? e.keyHeader?.trim() ? e.withLogin === c.WithoutLogin ? !0 : !!(e.keyHeader?.trim() && e.apiKey?.trim()) : !1 : e.authenticationType === o.OAuth && e.withLogin === c.WithConfig ? !!e.clientId?.trim() && (t || !!e.clientSecret?.trim()) && Z(e.authorizationEndpoint) && Z(e.tokenEndpoint) : !0, re = (e, t = !1) => Object.keys(a(e, { validateVersionPattern: !0 })).length === 0 && J(e.endpoint) && Q(e.auth, t), ie = {
57
60
  name: {
58
61
  label: "Name",
59
62
  placeholder: "Enter name"
@@ -92,7 +95,7 @@ var B = /* @__PURE__ */ function(e) {
92
95
  saveLabel: "Save"
93
96
  },
94
97
  ariaLabel: "General"
95
- }, Q = {
98
+ }, ae = {
96
99
  title: "Add avatar",
97
100
  attachLabel: "Attach",
98
101
  emptyTitle: "This folder is empty",
@@ -118,9 +121,9 @@ var B = /* @__PURE__ */ function(e) {
118
121
  deleteCancelLabel: "Cancel",
119
122
  uploadProgressTitle: "Uploading files",
120
123
  cancelLabel: "Cancel"
121
- }, ae = ({ form: t, errors: r, bucket: i, FileManagerModal: a, resolveIconUrl: o, allowedMimeTypes: s, maxFileSizeBytes: c, availableLocaleOptions: u, onChange: d, onNameBlur: f, onVersionBlur: p, labels: m }) => {
122
- let [h, g] = O(!1), _ = m?.form ?? ie, v = m?.avatarPicker ?? Q, y = E(() => o(t.iconUrl), [t.iconUrl, o]);
123
- return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(n, {
124
+ }, oe = ({ form: t, errors: r, bucket: i, FileManagerModal: a, resolveIconUrl: o, allowedMimeTypes: s, maxFileSizeBytes: c, availableLocaleOptions: u, onChange: d, onNameBlur: f, onVersionBlur: p, labels: m }) => {
125
+ let [h, g] = M(!1), _ = m?.form ?? ie, v = m?.avatarPicker ?? ae, y = A(() => o(t.iconUrl), [t.iconUrl, o]);
126
+ return /* @__PURE__ */ R(ne, { children: [/* @__PURE__ */ L(n, {
124
127
  values: {
125
128
  name: t.name,
126
129
  description: t.description,
@@ -137,7 +140,7 @@ var B = /* @__PURE__ */ function(e) {
137
140
  onAddAvatarClick: () => g(!0),
138
141
  labels: _,
139
142
  availableLocaleOptions: u
140
- }), /* @__PURE__ */ P(e, {
143
+ }), /* @__PURE__ */ L(e, {
141
144
  isOpen: h,
142
145
  onClose: () => g(!1),
143
146
  onAttach: (e) => {
@@ -152,47 +155,47 @@ var B = /* @__PURE__ */ function(e) {
152
155
  })] });
153
156
  }, $ = /* @__PURE__ */ function(e) {
154
157
  return e.Success = "success", e.Cancelled = "cancelled", e.PopupBlocked = "popup-blocked", e.InvalidConfig = "invalid-config", e.Failed = "failed", e;
155
- }({}), oe = (e, t) => e === o.None ? c.WithoutLogin : e === o.OAuth && !t ? c.WithConfig : c.WithLogin, se = (e, t) => e === o.None ? t?.typeNone ?? "Open access" : e === o.OAuth ? t?.typeOAuth ?? "OAuth" : t?.typeApiKey ?? "API Key", ce = ({ auth: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, endpoint: a, authActions: l, onOAuthLogin: v, onNotifySuccess: b, onNotifyError: x, onAuthChange: C, onEnsureSaved: w, labels: T }) => {
156
- let [E, D] = O(!1), [k, A] = O(!1), j = e.isLoggedIn || n || E, N = J(a) && Z(e, i) && !j, I = (t) => {
157
- j || t === e.authenticationType || C({
158
+ }({}), se = (e, t) => e === o.None ? c.WithoutLogin : e === o.OAuth && !t ? c.WithConfig : c.WithLogin, ce = (e, t) => e === o.None ? t?.typeNone ?? "Open access" : e === o.OAuth ? t?.typeOAuth ?? "OAuth" : t?.typeApiKey ?? "API Key", le = ({ auth: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, endpoint: a, authActions: l, onOAuthLogin: d, onNotifySuccess: p, onNotifyError: m, onAuthChange: S, onEnsureSaved: w, labels: T }) => {
159
+ let [D, O] = M(!1), [k, A] = M(!1), j = e.isLoggedIn || n || D, N = J(a) && Q(e, i) && !j, P = (t) => {
160
+ j || t === e.authenticationType || S({
158
161
  authenticationType: t,
159
- withLogin: oe(t, !!e.clientId?.trim())
162
+ withLogin: se(t, !!e.clientId?.trim())
160
163
  });
161
- }, R = (e) => {
162
- C({ withLogin: e });
163
- }, z = (e) => {
164
- switch (e.auth != null && C(e.auth), e.status) {
164
+ }, F = (e) => {
165
+ S({ withLogin: e });
166
+ }, ne = (e) => {
167
+ switch (e.auth != null && S(e.auth), e.status) {
165
168
  case $.Success:
166
- C({ isLoggedIn: !0 }), b(T?.loginSuccessMessage ?? "Successfully logged in.");
169
+ S({ isLoggedIn: !0 }), p(T?.loginSuccessMessage ?? "Successfully logged in.");
167
170
  return;
168
171
  case $.PopupBlocked:
169
- x(T?.errorPopupBlocked ?? "The login popup was blocked by your browser. Please allow popups for this site and try again.");
172
+ m(T?.errorPopupBlocked ?? "The login popup was blocked by your browser. Please allow popups for this site and try again.");
170
173
  return;
171
174
  case $.InvalidConfig:
172
- x(T?.errorOAuthConfigMissing ?? "The OAuth provider did not return a valid client configuration. Please check the endpoint or contact your administrator.");
175
+ m(T?.errorOAuthConfigMissing ?? "The OAuth provider did not return a valid client configuration. Please check the endpoint or contact your administrator.");
173
176
  return;
174
177
  case $.Failed:
175
- x(T?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", e.traceId);
178
+ m(T?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", e.traceId);
176
179
  return;
177
180
  case $.Cancelled: return;
178
181
  }
179
- }, B = async () => {
182
+ }, z = async () => {
180
183
  if (!N) return;
181
184
  if (e.authenticationType === o.OAuth) {
182
- D(!0);
185
+ O(!0);
183
186
  try {
184
- z(await v({
187
+ ne(await d({
185
188
  auth: e,
186
189
  ensureSaved: w
187
190
  }));
188
191
  } finally {
189
- D(!1);
192
+ O(!1);
190
193
  }
191
194
  return;
192
195
  }
193
196
  let t = await w();
194
197
  if (t) {
195
- D(!0);
198
+ O(!0);
196
199
  try {
197
200
  let n = {
198
201
  url: t,
@@ -200,63 +203,63 @@ var B = /* @__PURE__ */ function(e) {
200
203
  authenticationType: e.authenticationType,
201
204
  apiKey: e.apiKey?.trim()
202
205
  };
203
- await l.login(t, n), C({ isLoggedIn: !0 }), b(T?.loginSuccessMessage ?? "Successfully logged in.");
206
+ await l.login(t, n), S({ isLoggedIn: !0 }), p(T?.loginSuccessMessage ?? "Successfully logged in.");
204
207
  } catch (e) {
205
208
  let { traceId: t } = await u(e);
206
- x(T?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
209
+ m(T?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
207
210
  } finally {
208
- D(!1);
211
+ O(!1);
209
212
  }
210
213
  }
211
- }, V = async () => {
212
- D(!0);
214
+ }, B = async () => {
215
+ O(!0);
213
216
  try {
214
217
  let t = {
215
218
  url: r,
216
219
  credentialsLevel: s.User,
217
220
  authenticationType: e.authenticationType
218
221
  };
219
- await l.logout(r, t), C({ isLoggedIn: !1 }), A(!1), b(T?.logoutSuccessMessage ?? "Successfully logged out.");
222
+ await l.logout(r, t), S({ isLoggedIn: !1 }), A(!1), p(T?.logoutSuccessMessage ?? "Successfully logged out.");
220
223
  } catch (e) {
221
224
  let { traceId: t } = await u(e);
222
- x(T?.errorLogoutFailed ?? "Failed to log out. Please try again.", t);
225
+ m(T?.errorLogoutFailed ?? "Failed to log out. Please try again.", t);
223
226
  } finally {
224
- D(!1);
227
+ O(!1);
225
228
  }
226
- }, H = () => e.isLoggedIn ? /* @__PURE__ */ P("div", {
229
+ }, V = () => e.isLoggedIn ? /* @__PURE__ */ L("div", {
227
230
  className: "flex",
228
- children: /* @__PURE__ */ P(g, {
231
+ children: /* @__PURE__ */ L(b, {
229
232
  label: T?.logOutLabel ?? "Log out",
230
- iconBefore: /* @__PURE__ */ P(M, {
231
- size: p.MD,
232
- stroke: m
233
+ iconBefore: /* @__PURE__ */ L(I, {
234
+ size: _.MD,
235
+ stroke: v
233
236
  }),
234
237
  onClick: () => A(!0),
235
- disabled: n || E
238
+ disabled: n || D
236
239
  })
237
- }) : /* @__PURE__ */ P("div", {
240
+ }) : /* @__PURE__ */ L("div", {
238
241
  className: "flex",
239
- children: /* @__PURE__ */ P(g, {
242
+ children: /* @__PURE__ */ L(b, {
240
243
  label: T?.logInLabel ?? "Log in",
241
- iconBefore: /* @__PURE__ */ P(te, {
242
- size: p.MD,
243
- stroke: m
244
+ iconBefore: /* @__PURE__ */ L(te, {
245
+ size: _.MD,
246
+ stroke: v
244
247
  }),
245
- onClick: B,
248
+ onClick: z,
246
249
  disabled: !N
247
250
  })
248
251
  });
249
- return /* @__PURE__ */ F("section", {
252
+ return /* @__PURE__ */ R("section", {
250
253
  className: "flex flex-col gap-2",
251
254
  children: [
252
- /* @__PURE__ */ P("h3", {
255
+ /* @__PURE__ */ L("h3", {
253
256
  className: "dial-h3-text",
254
257
  children: T?.sectionTitle ?? "Authentication"
255
258
  }),
256
- /* @__PURE__ */ P(ee, {
259
+ /* @__PURE__ */ L(ee, {
257
260
  "aria-label": T?.sectionTitle ?? "Authentication",
258
261
  value: e.authenticationType,
259
- onChange: (e) => I(e),
262
+ onChange: (e) => P(e),
260
263
  segmentClassName: "px-2",
261
264
  items: [
262
265
  o.None,
@@ -266,56 +269,56 @@ var B = /* @__PURE__ */ function(e) {
266
269
  let n = U[t];
267
270
  return {
268
271
  value: t,
269
- label: /* @__PURE__ */ F("div", {
272
+ label: /* @__PURE__ */ R("div", {
270
273
  className: "flex items-center gap-2",
271
- children: [/* @__PURE__ */ P(n, {
274
+ children: [/* @__PURE__ */ L(n, {
272
275
  className: "shrink-0",
273
- size: p.SM,
274
- stroke: m,
276
+ size: _.SM,
277
+ stroke: v,
275
278
  "aria-hidden": !0
276
- }), /* @__PURE__ */ P("span", {
279
+ }), /* @__PURE__ */ L("span", {
277
280
  className: "sr-only desktop:not-sr-only",
278
- children: se(t, T)
281
+ children: ce(t, T)
279
282
  })]
280
283
  }),
281
284
  disabled: j && e.authenticationType !== t
282
285
  };
283
286
  })
284
287
  }),
285
- e.authenticationType === o.None && /* @__PURE__ */ P("p", {
288
+ e.authenticationType === o.None && /* @__PURE__ */ L("p", {
286
289
  className: "dial-small-text pt-2 text-secondary",
287
290
  children: T?.openAccessDescription ?? "Open endpoint, no credentials"
288
291
  }),
289
- e.authenticationType === o.OAuth && /* @__PURE__ */ F("div", {
292
+ e.authenticationType === o.OAuth && /* @__PURE__ */ R("div", {
290
293
  className: "flex flex-col gap-3 pt-2",
291
294
  children: [
292
- /* @__PURE__ */ F("div", {
295
+ /* @__PURE__ */ R("div", {
293
296
  className: "flex flex-col gap-2",
294
- children: [/* @__PURE__ */ P(y, {
297
+ children: [/* @__PURE__ */ L(C, {
295
298
  name: "oauth-login-mode",
296
299
  id: "oauth-with-login",
297
300
  value: c.WithLogin,
298
301
  labelProps: { label: T?.withLoginOAuthLabel ?? "Standard login" },
299
302
  isSelected: e.withLogin === c.WithLogin,
300
303
  disabled: j,
301
- onChange: R
302
- }), /* @__PURE__ */ P(y, {
304
+ onChange: F
305
+ }), /* @__PURE__ */ L(C, {
303
306
  name: "oauth-login-mode",
304
307
  id: "oauth-with-config",
305
308
  value: c.WithConfig,
306
309
  labelProps: { label: T?.withConfigOAuthLabel ?? "Custom login" },
307
310
  isSelected: e.withLogin === c.WithConfig,
308
311
  disabled: j,
309
- onChange: R
312
+ onChange: F
310
313
  })]
311
314
  }),
312
- e.withLogin === c.WithConfig && /* @__PURE__ */ F("div", {
315
+ e.withLogin === c.WithConfig && /* @__PURE__ */ R("div", {
313
316
  className: "flex flex-col gap-3",
314
317
  children: [
315
- /* @__PURE__ */ P(h, {
318
+ /* @__PURE__ */ L(y, {
316
319
  id: "toolset-client-id",
317
320
  value: e.clientId ?? "",
318
- onChange: (e) => C({ clientId: e ?? "" }),
321
+ onChange: (e) => S({ clientId: e ?? "" }),
319
322
  labelProps: {
320
323
  label: T?.clientIdLabel ?? "Client ID",
321
324
  required: !0
@@ -325,10 +328,10 @@ var B = /* @__PURE__ */ function(e) {
325
328
  invalid: !!t.clientId,
326
329
  disabled: j
327
330
  }),
328
- /* @__PURE__ */ P(_, {
331
+ /* @__PURE__ */ L(x, {
329
332
  id: "toolset-client-secret",
330
333
  value: e.clientSecret ?? "",
331
- onChange: (e) => C({ clientSecret: e ?? "" }),
334
+ onChange: (e) => S({ clientSecret: e ?? "" }),
332
335
  labelProps: {
333
336
  label: T?.clientSecretLabel ?? "Client secret",
334
337
  required: !i
@@ -340,69 +343,69 @@ var B = /* @__PURE__ */ function(e) {
340
343
  invalid: !!t.clientSecret,
341
344
  disabled: j
342
345
  }),
343
- /* @__PURE__ */ P(h, {
346
+ /* @__PURE__ */ L(y, {
344
347
  id: "toolset-authorization-endpoint",
345
348
  value: e.authorizationEndpoint ?? "",
346
- onChange: (e) => C({ authorizationEndpoint: e ?? "" }),
349
+ onChange: (e) => S({ authorizationEndpoint: e ?? "" }),
347
350
  labelProps: { label: T?.authorizationEndpointLabel ?? "Authorization endpoint" },
348
351
  placeholder: T?.authorizationEndpointPlaceholder ?? "Enter authorization endpoint",
349
352
  error: t.authorizationEndpoint || void 0,
350
353
  invalid: !!t.authorizationEndpoint,
351
354
  disabled: j
352
355
  }),
353
- /* @__PURE__ */ P(h, {
356
+ /* @__PURE__ */ L(y, {
354
357
  id: "toolset-token-endpoint",
355
358
  value: e.tokenEndpoint ?? "",
356
- onChange: (e) => C({ tokenEndpoint: e ?? "" }),
359
+ onChange: (e) => S({ tokenEndpoint: e ?? "" }),
357
360
  labelProps: { label: T?.tokenEndpointLabel ?? "Token endpoint" },
358
361
  placeholder: T?.tokenEndpointPlaceholder ?? "Enter token endpoint",
359
362
  error: t.tokenEndpoint || void 0,
360
363
  invalid: !!t.tokenEndpoint,
361
364
  disabled: j
362
365
  }),
363
- /* @__PURE__ */ P(S, {
366
+ /* @__PURE__ */ L(E, {
364
367
  id: "toolset-scopes",
365
368
  labelProps: { label: T?.scopesLabel ?? "Scopes" },
366
369
  placeholder: T?.scopesPlaceholder ?? "Enter scopes",
367
370
  value: e.scopes ?? [],
368
- onChange: (e) => C({ scopes: e }),
371
+ onChange: (e) => S({ scopes: e }),
369
372
  disabled: j,
370
- tagClassName: L
373
+ tagClassName: f
371
374
  })
372
375
  ]
373
376
  }),
374
- H()
377
+ V()
375
378
  ]
376
379
  }),
377
- e.authenticationType === o.ApiKey && /* @__PURE__ */ F("div", {
380
+ e.authenticationType === o.ApiKey && /* @__PURE__ */ R("div", {
378
381
  className: "flex flex-col gap-3 pt-2",
379
382
  children: [
380
- /* @__PURE__ */ F("div", {
383
+ /* @__PURE__ */ R("div", {
381
384
  className: "flex flex-col gap-2",
382
- children: [/* @__PURE__ */ P(y, {
385
+ children: [/* @__PURE__ */ L(C, {
383
386
  name: "apikey-login-mode",
384
387
  id: "apikey-with-login",
385
388
  value: c.WithLogin,
386
389
  labelProps: { label: T?.withLoginLabel ?? "With login" },
387
390
  isSelected: e.withLogin === c.WithLogin,
388
391
  disabled: j,
389
- onChange: R
390
- }), /* @__PURE__ */ P(y, {
392
+ onChange: F
393
+ }), /* @__PURE__ */ L(C, {
391
394
  name: "apikey-login-mode",
392
395
  id: "apikey-without-login",
393
396
  value: c.WithoutLogin,
394
397
  labelProps: { label: T?.withoutLoginLabel ?? "Without login" },
395
398
  isSelected: e.withLogin === c.WithoutLogin,
396
399
  disabled: j,
397
- onChange: R
400
+ onChange: F
398
401
  })]
399
402
  }),
400
- /* @__PURE__ */ F("div", {
403
+ /* @__PURE__ */ R("div", {
401
404
  className: "flex flex-col gap-3",
402
- children: [/* @__PURE__ */ P(h, {
405
+ children: [/* @__PURE__ */ L(y, {
403
406
  id: "toolset-key-header",
404
407
  value: e.keyHeader ?? "",
405
- onChange: (e) => C({ keyHeader: e ?? "" }),
408
+ onChange: (e) => S({ keyHeader: e ?? "" }),
406
409
  labelProps: {
407
410
  label: T?.keyHeaderLabel ?? "API Key parameter name",
408
411
  required: !0
@@ -411,10 +414,10 @@ var B = /* @__PURE__ */ function(e) {
411
414
  error: t.keyHeader || void 0,
412
415
  invalid: !!t.keyHeader,
413
416
  disabled: j
414
- }), e.withLogin === c.WithLogin && /* @__PURE__ */ P(_, {
417
+ }), e.withLogin === c.WithLogin && /* @__PURE__ */ L(x, {
415
418
  id: "toolset-api-key",
416
419
  value: e.apiKey ?? "",
417
- onChange: (e) => C({ apiKey: e ?? "" }),
420
+ onChange: (e) => S({ apiKey: e ?? "" }),
418
421
  labelProps: {
419
422
  label: T?.apiKeyLabel ?? "API key",
420
423
  required: !0
@@ -427,46 +430,46 @@ var B = /* @__PURE__ */ function(e) {
427
430
  disabled: j
428
431
  })]
429
432
  }),
430
- e.withLogin !== c.WithoutLogin && H()
433
+ e.withLogin !== c.WithoutLogin && V()
431
434
  ]
432
435
  }),
433
- k && /* @__PURE__ */ P(d, {
436
+ k && /* @__PURE__ */ L(h, {
434
437
  open: k,
435
438
  header: T?.logoutConfirmTitle ?? "Log out?",
436
439
  description: T?.logoutConfirmDescription ?? "Are you sure you want to log out? You will need to re-enter your credentials to use this toolset again.",
437
440
  confirmLabel: T?.logOutLabel ?? "Log out",
438
441
  cancelLabel: T?.cancelLabel ?? "Cancel",
439
- variant: f.Danger,
440
- isLoading: E,
441
- disableConfirmButton: E,
442
- onConfirm: V,
442
+ variant: g.Danger,
443
+ isLoading: D,
444
+ disableConfirmButton: D,
445
+ onConfirm: B,
443
446
  onCancel: () => A(!1),
444
447
  onClose: () => A(!1)
445
448
  })
446
449
  ]
447
450
  });
448
- }, le = C(({ url: e, className: t, labels: n }) => {
449
- let { isCopied: r, copy: i } = z(e), a = n?.copiedLabel ?? "Copied!";
450
- return /* @__PURE__ */ F("div", {
451
- className: R("flex flex-col gap-3", t),
451
+ }, ue = D(({ url: e, className: t, labels: n }) => {
452
+ let { isCopied: r, copy: i } = m(e), a = n?.copiedLabel ?? "Copied!";
453
+ return /* @__PURE__ */ R("div", {
454
+ className: p("flex flex-col gap-3", t),
452
455
  children: [
453
- /* @__PURE__ */ F("div", {
456
+ /* @__PURE__ */ R("div", {
454
457
  className: "flex flex-col gap-1",
455
- children: [/* @__PURE__ */ P("p", {
458
+ children: [/* @__PURE__ */ L("p", {
456
459
  className: "dial-body-semi-text text-start text-primary",
457
460
  children: n?.title ?? "Connect toolset"
458
- }), /* @__PURE__ */ P("p", {
461
+ }), /* @__PURE__ */ L("p", {
459
462
  className: "dial-small-text text-start text-secondary",
460
463
  children: n?.description ?? "Copy endpoint URL to easily integrate toolset into your workflows"
461
464
  })]
462
465
  }),
463
- /* @__PURE__ */ P("div", { children: /* @__PURE__ */ P(I, {
466
+ /* @__PURE__ */ L("div", { children: /* @__PURE__ */ L(d, {
464
467
  copiedLabel: a,
465
468
  copyLabel: n?.copyLabel ?? "Copy URL",
466
469
  isCopied: r,
467
470
  onClick: i
468
471
  }) }),
469
- /* @__PURE__ */ P("span", {
472
+ /* @__PURE__ */ L("span", {
470
473
  role: "status",
471
474
  "aria-live": "polite",
472
475
  className: "sr-only",
@@ -474,16 +477,16 @@ var B = /* @__PURE__ */ function(e) {
474
477
  })
475
478
  ]
476
479
  });
477
- }), ue = ({ form: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, connectUrl: a, listToolNames: o, authActions: s, onOAuthLogin: c, onNotifySuccess: l, onNotifyError: u, onChange: d, onAuthChange: f, onEnsureSaved: p, labels: m }) => {
478
- let [g, _] = O(null), v = !!a && !!r, y = E(() => [{
480
+ }), de = ({ form: e, errors: t, isSaving: n, toolsetId: r, isEditMode: i, connectUrl: a, listToolNames: o, authActions: s, onOAuthLogin: c, onNotifySuccess: l, onNotifyError: u, onChange: d, onAuthChange: p, onEnsureSaved: m, labels: h }) => {
481
+ let [g, _] = M(null), v = !!a && !!r, b = A(() => [{
479
482
  value: B.Http,
480
483
  label: "HTTP"
481
484
  }, {
482
485
  value: B.Sse,
483
486
  label: "SSE"
484
487
  }], []);
485
- return T(() => {
486
- if (!r || !o || !Z(e.auth, i)) {
488
+ return k(() => {
489
+ if (!r || !o || !Q(e.auth, i)) {
487
490
  _(null);
488
491
  return;
489
492
  }
@@ -504,56 +507,56 @@ var B = /* @__PURE__ */ function(e) {
504
507
  e.auth,
505
508
  e.endpoint,
506
509
  o
507
- ]), /* @__PURE__ */ F("div", {
510
+ ]), /* @__PURE__ */ R("div", {
508
511
  className: "flex max-w-[1060px] flex-col gap-4",
509
512
  children: [
510
- /* @__PURE__ */ P(h, {
513
+ /* @__PURE__ */ L(y, {
511
514
  id: "toolset-endpoint",
512
515
  value: e.endpoint,
513
516
  onChange: (e) => d({ endpoint: e ?? "" }),
514
517
  labelProps: {
515
- label: m?.endpointLabel ?? "Endpoint",
518
+ label: h?.endpointLabel ?? "Endpoint",
516
519
  required: !0
517
520
  },
518
- placeholder: m?.endpointPlaceholder ?? "https://...",
519
- caption: m?.endpointCaption ?? "The HTTPS address where the server accepts MCP requests. Choose the transport under Protocol below.",
521
+ placeholder: h?.endpointPlaceholder ?? "https://...",
522
+ caption: h?.endpointCaption ?? "The HTTPS address where the server accepts MCP requests. Choose the transport under Protocol below.",
520
523
  error: t.endpoint || void 0,
521
524
  invalid: !!t.endpoint
522
525
  }),
523
- /* @__PURE__ */ P(b, {
526
+ /* @__PURE__ */ L(w, {
524
527
  labelProps: {
525
- label: m?.protocolLabel ?? "Protocol",
528
+ label: h?.protocolLabel ?? "Protocol",
526
529
  required: !0
527
530
  },
528
531
  id: "toolset-protocol",
529
- items: y,
532
+ items: b,
530
533
  value: e.protocol,
531
534
  onChange: (e) => {
532
535
  d({ protocol: e });
533
536
  }
534
537
  }),
535
- g ? /* @__PURE__ */ P(x, {
538
+ g ? /* @__PURE__ */ L(T, {
536
539
  id: "toolset-allowed-tools",
537
540
  multiple: !0,
538
541
  searchable: !0,
539
542
  selectAll: !0,
540
- labelProps: { label: m?.allowedToolsLabel ?? "Allowed tools" },
541
- placeholder: m?.allowedToolsSelectPlaceholder ?? "Select allowed tools",
543
+ labelProps: { label: h?.allowedToolsLabel ?? "Allowed tools" },
544
+ placeholder: h?.allowedToolsSelectPlaceholder ?? "Select allowed tools",
542
545
  options: g.map((e) => ({
543
546
  value: e,
544
547
  label: e
545
548
  })),
546
549
  value: e.allowedTools,
547
550
  onChange: (e) => d({ allowedTools: e })
548
- }) : /* @__PURE__ */ P(S, {
551
+ }) : /* @__PURE__ */ L(E, {
549
552
  id: "toolset-allowed-tools",
550
- labelProps: { label: m?.allowedToolsLabel ?? "Allowed tools" },
551
- placeholder: m?.allowedToolsPlaceholder ?? "Add tools, comma separated",
553
+ labelProps: { label: h?.allowedToolsLabel ?? "Allowed tools" },
554
+ placeholder: h?.allowedToolsPlaceholder ?? "Add tools, comma separated",
552
555
  value: e.allowedTools,
553
556
  onChange: (e) => d({ allowedTools: e }),
554
- tagClassName: L
557
+ tagClassName: f
555
558
  }),
556
- /* @__PURE__ */ P(ce, {
559
+ /* @__PURE__ */ L(le, {
557
560
  auth: e.auth,
558
561
  errors: t,
559
562
  isSaving: n,
@@ -564,182 +567,182 @@ var B = /* @__PURE__ */ function(e) {
564
567
  onOAuthLogin: c,
565
568
  onNotifySuccess: l,
566
569
  onNotifyError: u,
567
- onAuthChange: f,
568
- onEnsureSaved: p,
569
- labels: m?.auth
570
+ onAuthChange: p,
571
+ onEnsureSaved: m,
572
+ labels: h?.auth
570
573
  }),
571
- v && /* @__PURE__ */ P(le, {
574
+ v && /* @__PURE__ */ L(ue, {
572
575
  url: a ?? "",
573
- labels: m?.connect,
576
+ labels: h?.connect,
574
577
  className: "border-t border-tertiary pt-4"
575
578
  })
576
579
  ]
577
580
  });
578
- }, de = [
581
+ }, fe = [
579
582
  "keyHeader",
580
583
  "apiKey",
581
584
  "clientId",
582
585
  "clientSecret",
583
586
  "authorizationEndpoint",
584
587
  "tokenEndpoint"
585
- ], fe = [
588
+ ], pe = [
586
589
  "name",
587
590
  "version",
588
591
  "endpoint",
589
- ...de
590
- ], pe = new Set(fe), me = (e) => {
592
+ ...fe
593
+ ], me = new Set(pe), he = (e) => {
591
594
  let t = {};
592
- for (let n of Object.keys(e)) pe.has(n) && (t[n] = !0);
595
+ for (let n of Object.keys(e)) me.has(n) && (t[n] = !0);
593
596
  return t;
594
- }, he = ({ initialForm: e, toolsetId: n, onPersist: s, onPostSaveLogin: l, onToolsetsChanged: d, onSaveSuccess: f, onSaveComplete: p, onBack: m, buildMcpUrl: h, listToolNames: _, authActions: y, onOAuthLogin: b, onNotifySuccess: ee, onNotifyError: x, bucket: S, FileManagerModal: C, resolveIconUrl: k, allowedMimeTypes: A, maxFileSizeBytes: j, availableLocaleOptions: te, labels: M }) => {
595
- let I = !!n, [L, R] = O(""), z = n || L, [B, V] = O(e), [H, U] = O(!1), [W, G] = O({}), [K, q] = O({}), Y = D(null);
596
- T(() => {
597
- V(e), Y.current = e, G({}), q({}), R("");
597
+ }, ge = ({ initialForm: e, toolsetId: n, onPersist: s, onPostSaveLogin: l, onToolsetsChanged: d, onSaveSuccess: f, onSaveComplete: m, onBack: h, buildMcpUrl: g, listToolNames: _, authActions: v, onOAuthLogin: y, onNotifySuccess: x, onNotifyError: C, bucket: w, FileManagerModal: ee, resolveIconUrl: T, allowedMimeTypes: E, maxFileSizeBytes: D, availableLocaleOptions: N, labels: P }) => {
598
+ let F = !!n, [te, I] = M(""), B = n || te, [V, H] = M(e), [U, W] = M(!1), [G, K] = M({}), [q, Y] = M({}), X = j(null);
599
+ k(() => {
600
+ H(e), X.current = e, K({}), Y({}), I("");
598
601
  }, [e]);
599
- let X = w((e) => {
600
- V((t) => ({
602
+ let Z = O((e) => {
603
+ H((t) => ({
601
604
  ...t,
602
605
  ...e
603
- })), q((t) => ({
606
+ })), Y((t) => ({
604
607
  ...t,
605
- ...me(e)
606
- })), G((t) => {
608
+ ...he(e)
609
+ })), K((t) => {
607
610
  let n = { ...t };
608
611
  for (let t of Object.keys(e)) delete n[t];
609
612
  return n;
610
613
  });
611
- }, []), ne = w((e) => {
612
- V((t) => ({
614
+ }, []), Q = O((e) => {
615
+ H((t) => ({
613
616
  ...t,
614
617
  auth: {
615
618
  ...t.auth,
616
619
  ...e
617
620
  }
618
- })), q((t) => ({
621
+ })), Y((t) => ({
619
622
  ...t,
620
- ...me(e)
621
- })), G((t) => {
623
+ ...he(e)
624
+ })), K((t) => {
622
625
  let n = { ...t };
623
- if ("authenticationType" in e || "withLogin" in e || "isLoggedIn" in e) for (let e of de) delete n[e];
626
+ if ("authenticationType" in e || "withLogin" in e || "isLoggedIn" in e) for (let e of fe) delete n[e];
624
627
  else for (let t of Object.keys(e)) delete n[t];
625
628
  return n;
626
629
  }), "isLoggedIn" in e && d();
627
- }, [d]), Z = w(async () => {
628
- if (z && Y.current != null && JSON.stringify(Y.current) === JSON.stringify(B)) return z;
629
- U(!0);
630
+ }, [d]), ie = O(async () => {
631
+ if (B && X.current != null && JSON.stringify(X.current) === JSON.stringify(V)) return B;
632
+ W(!0);
630
633
  try {
631
- let e = await s(B, z);
632
- return e ? (z || R(e), Y.current = B, await d(), e) : null;
634
+ let e = await s(V, B);
635
+ return e ? (B || I(e), X.current = V, await d(), e) : null;
633
636
  } catch {
634
637
  return null;
635
638
  } finally {
636
- U(!1);
639
+ W(!1);
637
640
  }
638
641
  }, [
642
+ V,
639
643
  B,
640
- z,
641
644
  s,
642
645
  d
643
- ]), ie = w(async () => await Z() ?? !1, [Z]), Q = w((e) => {
644
- let n = M?.validation, r = {}, i = a(e, { validateVersionPattern: !0 });
645
- return i.name === t.Required && (r.name = n?.nameRequired ?? "Name is required"), i.version === t.InvalidFormat && (r.version = n?.versionInvalid ?? "Version may only contain letters, digits, dots, underscores, and dashes"), e.endpoint.trim() ? J(e.endpoint) || (r.endpoint = n?.endpointInvalid ?? "Enter a valid http(s) URL") : r.endpoint = n?.endpointRequired ?? "Endpoint is required", e.auth.isLoggedIn || (e.auth.authenticationType === o.ApiKey && (e.auth.keyHeader?.trim() || (r.keyHeader = n?.keyHeaderRequired ?? "Key name is required"), e.auth.withLogin === c.WithLogin && !e.auth.apiKey?.trim() && (r.apiKey = n?.apiKeyRequired ?? "API key is required")), e.auth.authenticationType === o.OAuth && e.auth.withLogin === c.WithConfig && (e.auth.clientId?.trim() || (r.clientId = n?.clientIdRequired ?? "Client ID is required"), !I && !e.auth.clientSecret?.trim() && (r.clientSecret = n?.clientSecretRequired ?? "Client secret is required"), e.auth.authorizationEndpoint?.trim() && !J(e.auth.authorizationEndpoint) && (r.authorizationEndpoint = n?.endpointInvalid ?? "Enter a valid http(s) URL"), e.auth.tokenEndpoint?.trim() && !J(e.auth.tokenEndpoint) && (r.tokenEndpoint = n?.endpointInvalid ?? "Enter a valid http(s) URL"))), r;
646
- }, [M, I]), $ = w(async () => {
647
- let e = Q(B);
646
+ ]), ae = O(async () => await ie() ?? !1, [ie]), $ = O((e) => {
647
+ let n = P?.validation, r = {}, i = a(e, { validateVersionPattern: !0 });
648
+ return i.name === t.Required && (r.name = n?.nameRequired ?? "Name is required"), i.version === t.InvalidFormat && (r.version = n?.versionInvalid ?? "Version may only contain letters, digits, dots, underscores, and dashes"), e.endpoint.trim() ? J(e.endpoint) || (r.endpoint = n?.endpointInvalid ?? "Enter a valid http(s) URL") : r.endpoint = n?.endpointRequired ?? "Endpoint is required", e.auth.isLoggedIn || (e.auth.authenticationType === o.ApiKey && (e.auth.keyHeader?.trim() || (r.keyHeader = n?.keyHeaderRequired ?? "Key name is required"), e.auth.withLogin === c.WithLogin && !e.auth.apiKey?.trim() && (r.apiKey = n?.apiKeyRequired ?? "API key is required")), e.auth.authenticationType === o.OAuth && e.auth.withLogin === c.WithConfig && (e.auth.clientId?.trim() || (r.clientId = n?.clientIdRequired ?? "Client ID is required"), !F && !e.auth.clientSecret?.trim() && (r.clientSecret = n?.clientSecretRequired ?? "Client secret is required"), e.auth.authorizationEndpoint?.trim() && !J(e.auth.authorizationEndpoint) && (r.authorizationEndpoint = n?.endpointInvalid ?? "Enter a valid http(s) URL"), e.auth.tokenEndpoint?.trim() && !J(e.auth.tokenEndpoint) && (r.tokenEndpoint = n?.endpointInvalid ?? "Enter a valid http(s) URL"))), r;
649
+ }, [P, F]), se = O(async () => {
650
+ let e = $(V);
648
651
  if (Object.keys(e).length > 0) {
649
- G(e);
652
+ K(e);
650
653
  return;
651
654
  }
652
- G({}), U(!0);
655
+ K({}), W(!0);
653
656
  try {
654
- let e = await s(B, z);
657
+ let e = await s(V, B);
655
658
  if (!e) return;
656
- await d(), f(B);
659
+ await d(), f(V);
657
660
  try {
658
- await l(e, B.auth), p();
661
+ await l(e, V.auth), m();
659
662
  } catch (e) {
660
663
  let { traceId: t } = await u(e);
661
- x(M?.settings?.auth?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
664
+ C(P?.settings?.auth?.errorLoginFailed ?? "Failed to log in. Please check your credentials and try again.", t);
662
665
  }
663
666
  } catch {} finally {
664
- U(!1);
667
+ W(!1);
665
668
  }
666
669
  }, [
670
+ V,
671
+ $,
667
672
  B,
668
- Q,
669
- z,
670
673
  s,
671
674
  d,
672
675
  f,
673
- p,
676
+ m,
674
677
  l,
675
- x,
676
- M
677
- ]), oe = E(() => !re(B, I), [B, I]), se = E(() => {
678
- let e = Q(B), t = { ...W };
679
- for (let n of fe) {
680
- if (!K[n]) continue;
678
+ C,
679
+ P
680
+ ]), ce = A(() => !re(V, F), [V, F]), le = A(() => {
681
+ let e = $(V), t = { ...G };
682
+ for (let n of pe) {
683
+ if (!q[n]) continue;
681
684
  let r = e[n];
682
685
  r ? t[n] = r : delete t[n];
683
686
  }
684
687
  return t;
685
688
  }, [
686
- K,
687
- W,
688
- B,
689
- Q
690
- ]), ce = h && z ? h(z) : void 0;
691
- return /* @__PURE__ */ P(r, {
692
- title: I ? M?.layout?.editTitle ?? "Edit toolset" : M?.layout?.createTitle ?? "Create toolset",
693
- onBack: m,
694
- backAriaLabel: M?.layout?.backAriaLabel ?? "Back to catalog",
695
- isSaving: H,
696
- labels: { savingStatusLabel: M?.layout?.savingStatusLabel ?? "Saving" },
697
- actions: /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(g, {
698
- label: M?.layout?.cancelLabel ?? "Cancel",
699
- onClick: m
700
- }), /* @__PURE__ */ P(v, {
701
- label: I ? M?.layout?.saveLabel ?? "Save" : M?.layout?.createLabel ?? "Create",
702
- disabled: oe,
703
- onClick: $
689
+ q,
690
+ G,
691
+ V,
692
+ $
693
+ ]), ue = g && B ? g(B) : void 0;
694
+ return /* @__PURE__ */ L(r, {
695
+ title: F ? P?.layout?.editTitle ?? "Edit toolset" : P?.layout?.createTitle ?? "Create toolset",
696
+ onBack: h,
697
+ backAriaLabel: P?.layout?.backAriaLabel ?? "Back to catalog",
698
+ isSaving: U,
699
+ labels: { savingStatusLabel: P?.layout?.savingStatusLabel ?? "Saving" },
700
+ actions: /* @__PURE__ */ R(ne, { children: [/* @__PURE__ */ L(b, {
701
+ label: P?.layout?.cancelLabel ?? "Cancel",
702
+ onClick: h
703
+ }), /* @__PURE__ */ L(S, {
704
+ label: F ? P?.layout?.saveLabel ?? "Save" : P?.layout?.createLabel ?? "Create",
705
+ disabled: ce,
706
+ onClick: se
704
707
  })] }),
705
- leftContent: /* @__PURE__ */ P(i, {
706
- title: M?.layout?.metadataSectionTitle ?? "Metadata",
707
- className: "border-0 p-4 desktop:p-6",
708
- children: /* @__PURE__ */ P(ae, {
709
- form: B,
710
- errors: se,
711
- bucket: S,
712
- FileManagerModal: C,
713
- resolveIconUrl: k,
714
- allowedMimeTypes: A,
715
- maxFileSizeBytes: j,
716
- availableLocaleOptions: te,
717
- onChange: X,
718
- labels: M?.general
708
+ leftContent: /* @__PURE__ */ L(i, {
709
+ title: P?.layout?.metadataSectionTitle ?? "Metadata",
710
+ className: p("border-0 p-4 desktop:p-6", z.metadataSection),
711
+ children: /* @__PURE__ */ L(oe, {
712
+ form: V,
713
+ errors: le,
714
+ bucket: w,
715
+ FileManagerModal: ee,
716
+ resolveIconUrl: T,
717
+ allowedMimeTypes: E,
718
+ maxFileSizeBytes: D,
719
+ availableLocaleOptions: N,
720
+ onChange: Z,
721
+ labels: P?.general
719
722
  })
720
723
  }),
721
- rightContent: /* @__PURE__ */ P(i, {
722
- title: M?.layout?.setupSectionTitle ?? "Setup",
723
- className: "border-0 p-4 desktop:p-6",
724
- children: /* @__PURE__ */ P(ue, {
725
- form: B,
726
- errors: se,
727
- isSaving: H,
728
- toolsetId: z,
729
- isEditMode: I,
730
- connectUrl: ce,
724
+ rightContent: /* @__PURE__ */ L(i, {
725
+ title: P?.layout?.setupSectionTitle ?? "Setup",
726
+ className: p("border-0 p-4 desktop:p-6", z.setupSection),
727
+ children: /* @__PURE__ */ L(de, {
728
+ form: V,
729
+ errors: le,
730
+ isSaving: U,
731
+ toolsetId: B,
732
+ isEditMode: F,
733
+ connectUrl: ue,
731
734
  listToolNames: _,
732
- authActions: y,
733
- onOAuthLogin: b,
734
- onNotifySuccess: ee,
735
- onNotifyError: x,
736
- onChange: X,
737
- onAuthChange: ne,
738
- onEnsureSaved: ie,
739
- labels: M?.settings
735
+ authActions: v,
736
+ onOAuthLogin: y,
737
+ onNotifySuccess: x,
738
+ onNotifyError: C,
739
+ onChange: Z,
740
+ onAuthChange: Q,
741
+ onEnsureSaved: ae,
742
+ labels: P?.settings
740
743
  })
741
744
  })
742
745
  });
743
746
  };
744
747
  //#endregion
745
- export { U as AUTH_TYPE_ICONS, V as DEFAULT_TOOLSET_NAME, H as DEFAULT_TOOLSET_VERSION, ae as GeneralForm, he as ToolsetEditor, $ as ToolsetOAuthLoginStatus, B as ToolsetTransportType, K as getDefaultToolsetForm, W as getStorageSafeUniqueToolsetName, Z as isToolsetAuthValid, re as isToolsetFormValid, J as isValidEndpointUrl, X as normalizeReturnedEndpointUrl };
748
+ export { U as AUTH_TYPE_ICONS, V as DEFAULT_TOOLSET_NAME, H as DEFAULT_TOOLSET_VERSION, oe as GeneralForm, z as TOOLSET_EDITOR_CLASS, ge as ToolsetEditor, $ as ToolsetOAuthLoginStatus, B as ToolsetTransportType, K as getDefaultToolsetForm, W as getStorageSafeUniqueToolsetName, Q as isToolsetAuthValid, re as isToolsetFormValid, J as isValidEndpointUrl, X as normalizeReturnedEndpointUrl };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-toolset-editor",
3
3
  "description": "Host-agnostic form for authoring and editing a DIAL MCP toolset",
4
- "version": "1.2.0-dev.6",
4
+ "version": "1.2.0-dev.61",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -9,6 +9,7 @@
9
9
  "types": "./index.d.ts",
10
10
  "exports": {
11
11
  "./package.json": "./package.json",
12
+ "./styles.css": "./index.css",
12
13
  ".": {
13
14
  "types": "./index.d.ts",
14
15
  "import": "./index.js",
@@ -17,12 +18,12 @@
17
18
  },
18
19
  "dependencies": {
19
20
  "@tabler/icons-react": "^3.44.0",
20
- "@epam/ai-dial-builder-form": "1.2.0-dev.6"
21
+ "@epam/ai-dial-builder-form": "1.2.0-dev.61"
21
22
  },
22
23
  "peerDependencies": {
23
- "@epam/ai-dial-chat-hooks": "1.2.0-dev.6",
24
- "@epam/ai-dial-chat-shared": "1.2.0-dev.6",
25
- "@epam/ai-dial-ui-kit": "^0.14.2",
24
+ "@epam/ai-dial-chat-hooks": "1.2.0-dev.61",
25
+ "@epam/ai-dial-chat-shared": "1.2.0-dev.61",
26
+ "@epam/ai-dial-ui-kit": "^0.15.0-dev.9",
26
27
  "react": "^19.2.8"
27
28
  },
28
29
  "repository": {