@nice2dev/ui-api 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { jsxs as n, jsx as e, Fragment as B } from "react/jsx-runtime";
2
- import { NiceAppShell as be, NiceButton as j, NiceTextInput as K, NiceTextArea as ae, NiceSelect as te, NiceCheckbox as ve, NiceIcon as Z } from "@nice2dev/ui";
3
- import { NiceTutorialButton as se, resolveTutorial as re, NiceIcon as z, createId as ee } from "@nice2dev/ui-core";
4
- import { useState as k, useCallback as I, useRef as ue, useEffect as we, forwardRef as Ce, useMemo as ke } from "react";
5
- const Te = [
1
+ import { jsxs as n, jsx as e, Fragment as Q } from "react/jsx-runtime";
2
+ import { NiceAppShell as ye, NiceButton as U, NiceTextInput as L, NiceTextArea as oe, NiceSelect as se, NiceCheckbox as fe, NiceIcon as ee } from "@nice2dev/ui";
3
+ import { useNiceTranslation as $, NiceTutorialButton as ce, resolveTutorial as le, NiceIcon as B, createId as re } from "@nice2dev/ui-core";
4
+ import { useState as C, useCallback as I, useRef as de, useEffect as Ne, forwardRef as Ce, useMemo as Se } from "react";
5
+ const Ee = [
6
6
  {
7
7
  target: ".nice-api-designer",
8
8
  titleKey: "tutorial.apiDesigner.intro.title",
@@ -11,7 +11,7 @@ const Te = [
11
11
  content: "Define endpoints, parameters, request/response schemas and security for your OpenAPI document.",
12
12
  placement: "auto"
13
13
  }
14
- ], he = {
14
+ ], ge = {
15
15
  openapi: "3.0.3",
16
16
  info: {
17
17
  title: "Pet Store API",
@@ -113,253 +113,257 @@ const Te = [
113
113
  }
114
114
  },
115
115
  tags: [{ name: "pets", description: "Pet operations" }]
116
- }, ye = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"], Ee = [
116
+ }, we = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"], Pe = [
117
117
  "object",
118
118
  "array",
119
119
  "string",
120
120
  "number",
121
121
  "integer",
122
122
  "boolean"
123
- ], Se = ["query", "path", "header", "cookie"], Pe = ["apiKey", "http", "oauth2", "openIdConnect"];
124
- function le(t) {
123
+ ], De = ["query", "path", "header", "cookie"], Ae = ["apiKey", "http", "oauth2", "openIdConnect"];
124
+ function ue(t) {
125
125
  var o, i;
126
126
  const a = [];
127
- return t.openapi || a.push({ path: "openapi", message: "OpenAPI version is required", severity: "error" }), (o = t.info) != null && o.title || a.push({ path: "info.title", message: "API title is required", severity: "error" }), (i = t.info) != null && i.version || a.push({ path: "info.version", message: "API version is required", severity: "error" }), Object.entries(t.paths || {}).forEach(([c, l]) => {
128
- c.startsWith("/") || a.push({ path: `paths.${c}`, message: "Path must start with /", severity: "error" }), ye.forEach((d) => {
129
- const p = l[d.toLowerCase()];
130
- p && !p.responses && a.push({
131
- path: `paths.${c}.${d.toLowerCase()}.responses`,
127
+ return t.openapi || a.push({ path: "openapi", message: "OpenAPI version is required", severity: "error" }), (o = t.info) != null && o.title || a.push({ path: "info.title", message: "API title is required", severity: "error" }), (i = t.info) != null && i.version || a.push({ path: "info.version", message: "API version is required", severity: "error" }), Object.entries(t.paths || {}).forEach(([r, c]) => {
128
+ r.startsWith("/") || a.push({ path: `paths.${r}`, message: "Path must start with /", severity: "error" }), we.forEach((l) => {
129
+ const d = c[l.toLowerCase()];
130
+ d && !d.responses && a.push({
131
+ path: `paths.${r}.${l.toLowerCase()}.responses`,
132
132
  message: "Responses are required",
133
133
  severity: "error"
134
134
  });
135
135
  });
136
136
  }), a;
137
137
  }
138
- const me = Ee.map((t) => ({ value: String(t), label: String(t) }));
139
- function st({
138
+ const _e = /* @__PURE__ */ Pe.map((t) => ({
139
+ value: String(t),
140
+ label: String(t)
141
+ }));
142
+ function ot({
140
143
  schema: t,
141
144
  onChange: a,
142
145
  onSave: o,
143
146
  readOnly: i = !1,
144
- className: c = "",
145
- tutorial: l
147
+ className: r = "",
148
+ tutorial: c
146
149
  }) {
147
- var H, M;
148
- const [d, p] = k(t || he), [g, u] = k("/pets"), [f, _] = k("get"), [b, N] = k("paths"), [m, T] = k(
149
- () => le(t || he)
150
- ), y = I(
151
- (w) => {
152
- p((v) => {
153
- const x = w(v);
154
- return a == null || a(x), T(le(x)), x;
150
+ var V, G;
151
+ const { t: l } = $(), [d, p] = C(t || ge), [v, u] = C("/pets"), [N, b] = C("get"), [y, T] = C("paths"), [m, S] = C(
152
+ () => ue(t || ge)
153
+ ), w = I(
154
+ (k) => {
155
+ p((f) => {
156
+ const x = k(f);
157
+ return a == null || a(x), S(ue(x)), x;
155
158
  });
156
159
  },
157
160
  [a]
158
161
  ), A = I(() => {
159
- const w = "/new-endpoint";
160
- y((v) => ({
161
- ...v,
162
+ const k = "/new-endpoint";
163
+ w((f) => ({
164
+ ...f,
162
165
  paths: {
163
- ...v.paths,
164
- [w]: {
165
- ...v.paths[w],
166
+ ...f.paths,
167
+ [k]: {
168
+ ...f.paths[k],
166
169
  get: { summary: "New endpoint", responses: { 200: { description: "Success" } } }
167
170
  }
168
171
  }
169
- })), u(w), _("get");
170
- }, [y]), U = I(
171
- (w) => {
172
- y((v) => {
173
- const { [w]: x, ...D } = v.paths;
174
- return { ...v, paths: D };
175
- }), u(null), _(null);
172
+ })), u(k), b("get");
173
+ }, [w]), J = I(
174
+ (k) => {
175
+ w((f) => {
176
+ const { [k]: x, ...j } = f.paths;
177
+ return { ...f, paths: j };
178
+ }), u(null), b(null);
176
179
  },
177
- [y]
178
- ), F = I(() => {
179
- let w = "NewSchema";
180
- y((v) => {
181
- var D, L, $;
180
+ [w]
181
+ ), te = I(() => {
182
+ let k = "NewSchema";
183
+ w((f) => {
184
+ var j, F, R;
182
185
  let x = 1;
183
- for (; (L = (D = v.components) == null ? void 0 : D.schemas) != null && L[w]; )
184
- w = `NewSchema${x++}`;
186
+ for (; (F = (j = f.components) == null ? void 0 : j.schemas) != null && F[k]; )
187
+ k = `NewSchema${x++}`;
185
188
  return {
186
- ...v,
189
+ ...f,
187
190
  components: {
188
- ...v.components,
189
- schemas: { ...($ = v.components) == null ? void 0 : $.schemas, [w]: { type: "object", properties: {} } }
191
+ ...f.components,
192
+ schemas: { ...(R = f.components) == null ? void 0 : R.schemas, [k]: { type: "object", properties: {} } }
190
193
  }
191
194
  };
192
195
  });
193
- }, [y]), R = I(() => {
194
- const w = le(d);
195
- T(w), w.filter((v) => v.severity === "error").length === 0 && (o == null || o(d));
196
- }, [d, o]), O = Object.entries(d.paths).flatMap(
197
- ([w, v]) => ye.filter((x) => v[x.toLowerCase()]).map(
196
+ }, [w]), z = I(() => {
197
+ const k = ue(d);
198
+ S(k), k.filter((f) => f.severity === "error").length === 0 && (o == null || o(d));
199
+ }, [d, o]), M = Object.entries(d.paths).flatMap(
200
+ ([k, f]) => we.filter((x) => f[x.toLowerCase()]).map(
198
201
  (x) => ({
199
- path: w,
202
+ path: k,
200
203
  method: x,
201
- operation: v[x.toLowerCase()]
204
+ operation: f[x.toLowerCase()]
202
205
  })
203
206
  )
204
- ), q = ["info", "paths", "schemas", "security", "preview"];
207
+ ), O = ["info", "paths", "schemas", "security", "preview"];
205
208
  return /* @__PURE__ */ n("div", { style: { position: "relative", height: "100%" }, children: [
206
- l && /* @__PURE__ */ e("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ e(se, { steps: re(l, Te) }) }),
209
+ c && /* @__PURE__ */ e("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ e(ce, { steps: le(c, Ee) }) }),
207
210
  /* @__PURE__ */ e(
208
- be,
211
+ ye,
209
212
  {
210
213
  flush: !0,
211
- className: `nice-api-designer ${c}`,
214
+ className: `nice-api-designer ${r}`,
212
215
  height: "100%",
213
216
  style: { minHeight: 600 },
214
217
  toolbar: /* @__PURE__ */ n("div", { className: "nice-api-designer__toolbar", children: [
215
- /* @__PURE__ */ e("div", { className: "nice-api-designer__tabs", children: q.map((w) => /* @__PURE__ */ e(
216
- j,
218
+ /* @__PURE__ */ e("div", { className: "nice-api-designer__tabs", children: O.map((k) => /* @__PURE__ */ e(
219
+ U,
217
220
  {
218
221
  size: "sm",
219
- variant: b === w ? "primary" : "ghost",
220
- onClick: () => N(w),
221
- children: w.charAt(0).toUpperCase() + w.slice(1)
222
+ variant: y === k ? "primary" : "ghost",
223
+ onClick: () => T(k),
224
+ children: k.charAt(0).toUpperCase() + k.slice(1)
222
225
  },
223
- w
226
+ k
224
227
  )) }),
225
228
  !i && /* @__PURE__ */ e(
226
- j,
229
+ U,
227
230
  {
228
231
  size: "sm",
229
232
  variant: "primary",
230
- leftIcon: /* @__PURE__ */ e(z, { name: "check", size: 14 }),
231
- onClick: R,
232
- children: "Save"
233
+ leftIcon: /* @__PURE__ */ e(B, { name: "check", size: 14 }),
234
+ onClick: z,
235
+ children: l("apiDesigner.save", "Save")
233
236
  }
234
237
  )
235
238
  ] }),
236
- bottomPanel: m.length > 0 ? /* @__PURE__ */ e("div", { className: "nice-api-designer__errors", children: m.map((w, v) => /* @__PURE__ */ n(
239
+ bottomPanel: m.length > 0 ? /* @__PURE__ */ e("div", { className: "nice-api-designer__errors", children: m.map((k, f) => /* @__PURE__ */ n(
237
240
  "div",
238
241
  {
239
- className: `nice-api-designer__error nice-api-designer__error--${w.severity}`,
242
+ className: `nice-api-designer__error nice-api-designer__error--${k.severity}`,
240
243
  children: [
241
244
  /* @__PURE__ */ n("strong", { children: [
242
- w.path,
245
+ k.path,
243
246
  ":"
244
247
  ] }),
245
248
  " ",
246
- w.message
249
+ k.message
247
250
  ]
248
251
  },
249
- v
252
+ f
250
253
  )) }) : void 0,
251
254
  children: /* @__PURE__ */ n("div", { className: "nice-api-designer__content", children: [
252
- b === "info" && /* @__PURE__ */ e(Ae, { schema: d, onChange: y, readOnly: i }),
253
- b === "paths" && /* @__PURE__ */ e(
254
- xe,
255
+ y === "info" && /* @__PURE__ */ e(xe, { schema: d, onChange: w, readOnly: i }),
256
+ y === "paths" && /* @__PURE__ */ e(
257
+ Ie,
255
258
  {
256
- endpoints: O,
259
+ endpoints: M,
257
260
  schema: d,
258
- selectedPath: g,
259
- selectedMethod: f,
260
- onSelectEndpoint: (w, v) => {
261
- u(w), _(v);
261
+ selectedPath: v,
262
+ selectedMethod: N,
263
+ onSelectEndpoint: (k, f) => {
264
+ u(k), b(f);
262
265
  },
263
266
  onAdd: A,
264
- onDelete: U,
265
- onChange: y,
267
+ onDelete: J,
268
+ onChange: w,
266
269
  readOnly: i
267
270
  }
268
271
  ),
269
- b === "schemas" && /* @__PURE__ */ e(
270
- Ie,
272
+ y === "schemas" && /* @__PURE__ */ e(
273
+ Re,
271
274
  {
272
- schemas: ((H = d.components) == null ? void 0 : H.schemas) || {},
273
- onAdd: F,
274
- onChange: (w) => y((v) => ({
275
- ...v,
276
- components: { ...v.components, schemas: w }
275
+ schemas: ((V = d.components) == null ? void 0 : V.schemas) || {},
276
+ onAdd: te,
277
+ onChange: (k) => w((f) => ({
278
+ ...f,
279
+ components: { ...f.components, schemas: k }
277
280
  })),
278
281
  readOnly: i
279
282
  }
280
283
  ),
281
- b === "security" && /* @__PURE__ */ e(
282
- $e,
284
+ y === "security" && /* @__PURE__ */ e(
285
+ qe,
283
286
  {
284
- schemes: ((M = d.components) == null ? void 0 : M.securitySchemes) || {},
285
- onChange: (w) => y((v) => ({
286
- ...v,
287
- components: { ...v.components, securitySchemes: w }
287
+ schemes: ((G = d.components) == null ? void 0 : G.securitySchemes) || {},
288
+ onChange: (k) => w((f) => ({
289
+ ...f,
290
+ components: { ...f.components, securitySchemes: k }
288
291
  })),
289
292
  readOnly: i
290
293
  }
291
294
  ),
292
- b === "preview" && /* @__PURE__ */ e(Re, { schema: d })
295
+ y === "preview" && /* @__PURE__ */ e($e, { schema: d })
293
296
  ] })
294
297
  }
295
298
  )
296
299
  ] });
297
300
  }
298
- function Ae({ schema: t, onChange: a, readOnly: o }) {
301
+ function xe({ schema: t, onChange: a, readOnly: o }) {
302
+ const { t: i } = $();
299
303
  return /* @__PURE__ */ n("div", { className: "nice-api-designer__info-editor", children: [
300
- /* @__PURE__ */ e("h3", { children: "API information" }),
304
+ /* @__PURE__ */ e("h3", { children: i("apiDesigner.apiInformation", "API information") }),
301
305
  /* @__PURE__ */ e(
302
- K,
306
+ L,
303
307
  {
304
- label: "Title",
308
+ label: i("apiDesigner.title", "Title"),
305
309
  value: t.info.title,
306
- onChange: (i) => a((c) => ({ ...c, info: { ...c.info, title: i } })),
310
+ onChange: (r) => a((c) => ({ ...c, info: { ...c.info, title: r } })),
307
311
  readOnly: o
308
312
  }
309
313
  ),
310
314
  /* @__PURE__ */ e(
311
- K,
315
+ L,
312
316
  {
313
- label: "Version",
317
+ label: i("apiDesigner.version", "Version"),
314
318
  value: t.info.version,
315
- onChange: (i) => a((c) => ({ ...c, info: { ...c.info, version: i } })),
319
+ onChange: (r) => a((c) => ({ ...c, info: { ...c.info, version: r } })),
316
320
  readOnly: o
317
321
  }
318
322
  ),
319
323
  /* @__PURE__ */ e(
320
- ae,
324
+ oe,
321
325
  {
322
- label: "Description",
326
+ label: i("apiDesigner.description", "Description"),
323
327
  value: t.info.description || "",
324
- onChange: (i) => a((c) => ({ ...c, info: { ...c.info, description: i } })),
328
+ onChange: (r) => a((c) => ({ ...c, info: { ...c.info, description: r } })),
325
329
  readOnly: o,
326
330
  rows: 4
327
331
  }
328
332
  ),
329
- /* @__PURE__ */ e("h4", { children: "Servers" }),
330
- (t.servers || []).map((i, c) => /* @__PURE__ */ n("div", { className: "nice-api-designer__server", children: [
333
+ /* @__PURE__ */ e("h4", { children: i("apiDesigner.servers", "Servers") }),
334
+ (t.servers || []).map((r, c) => /* @__PURE__ */ n("div", { className: "nice-api-designer__server", children: [
331
335
  /* @__PURE__ */ e(
332
- K,
336
+ L,
333
337
  {
334
- value: i.url,
335
- placeholder: "Server URL",
338
+ value: r.url,
339
+ placeholder: i("apiDesigner.serverUrl", "Server URL"),
336
340
  onChange: (l) => a((d) => {
337
341
  var p;
338
342
  return {
339
343
  ...d,
340
- servers: (p = d.servers) == null ? void 0 : p.map((g, u) => u === c ? { ...g, url: l } : g)
344
+ servers: (p = d.servers) == null ? void 0 : p.map((v, u) => u === c ? { ...v, url: l } : v)
341
345
  };
342
346
  }),
343
347
  readOnly: o
344
348
  }
345
349
  ),
346
350
  /* @__PURE__ */ e(
347
- K,
351
+ L,
348
352
  {
349
- value: i.description || "",
350
- placeholder: "Description",
353
+ value: r.description || "",
354
+ placeholder: i("apiDesigner.description", "Description"),
351
355
  onChange: (l) => a((d) => {
352
356
  var p;
353
357
  return {
354
358
  ...d,
355
- servers: (p = d.servers) == null ? void 0 : p.map((g, u) => u === c ? { ...g, description: l } : g)
359
+ servers: (p = d.servers) == null ? void 0 : p.map((v, u) => u === c ? { ...v, description: l } : v)
356
360
  };
357
361
  }),
358
362
  readOnly: o
359
363
  }
360
364
  ),
361
365
  !o && /* @__PURE__ */ e(
362
- j,
366
+ U,
363
367
  {
364
368
  size: "sm",
365
369
  variant: "ghost",
@@ -367,67 +371,68 @@ function Ae({ schema: t, onChange: a, readOnly: o }) {
367
371
  var d;
368
372
  return {
369
373
  ...l,
370
- servers: (d = l.servers) == null ? void 0 : d.filter((p, g) => g !== c)
374
+ servers: (d = l.servers) == null ? void 0 : d.filter((p, v) => v !== c)
371
375
  };
372
376
  }),
373
- "aria-label": "Remove server",
374
- children: /* @__PURE__ */ e(z, { name: "close", size: 14 })
377
+ "aria-label": i("apiDesigner.removeServer", "Remove server"),
378
+ children: /* @__PURE__ */ e(B, { name: "close", size: 14 })
375
379
  }
376
380
  )
377
381
  ] }, c)),
378
382
  !o && /* @__PURE__ */ e(
379
- j,
383
+ U,
380
384
  {
381
385
  size: "sm",
382
386
  variant: "outline",
383
- leftIcon: /* @__PURE__ */ e(z, { name: "plus", size: 14 }),
384
- onClick: () => a((i) => ({
385
- ...i,
386
- servers: [...i.servers || [], { url: "https://api.example.com" }]
387
+ leftIcon: /* @__PURE__ */ e(B, { name: "plus", size: 14 }),
388
+ onClick: () => a((r) => ({
389
+ ...r,
390
+ servers: [...r.servers || [], { url: "https://api.example.com" }]
387
391
  })),
388
- children: "Add server"
392
+ children: i("apiDesigner.addServer", "Add server")
389
393
  }
390
394
  )
391
395
  ] });
392
396
  }
393
- function xe({
397
+ function Ie({
394
398
  endpoints: t,
395
399
  schema: a,
396
400
  selectedPath: o,
397
401
  selectedMethod: i,
398
- onSelectEndpoint: c,
399
- onAdd: l,
400
- onDelete: d,
401
- onChange: p,
402
- readOnly: g
402
+ onSelectEndpoint: r,
403
+ onAdd: c,
404
+ onDelete: l,
405
+ onChange: d,
406
+ readOnly: p
403
407
  }) {
404
- var b;
405
- const u = o && i ? (b = a.paths[o]) == null ? void 0 : b[i] : null, f = (N) => {
406
- !o || !i || !u || p((m) => ({
408
+ var y;
409
+ const { t: v } = $(), u = o && i ? (y = a.paths[o]) == null ? void 0 : y[i] : null, N = (T) => {
410
+ !o || !i || !u || d((m) => ({
407
411
  ...m,
408
412
  paths: {
409
413
  ...m.paths,
410
414
  [o]: {
411
415
  ...m.paths[o],
412
- [i]: { ...u, ...N }
416
+ [i]: { ...u, ...T }
413
417
  }
414
418
  }
415
419
  }));
416
- }, _ = (u == null ? void 0 : u.parameters) ?? [];
420
+ }, b = (u == null ? void 0 : u.parameters) ?? [];
417
421
  return /* @__PURE__ */ n("div", { className: "nice-api-designer__paths-editor", children: [
418
422
  /* @__PURE__ */ n("div", { className: "nice-api-designer__endpoints-list", children: [
419
423
  /* @__PURE__ */ n("div", { className: "nice-api-designer__list-header", children: [
420
- /* @__PURE__ */ e("h3", { children: "Endpoints" }),
421
- !g && /* @__PURE__ */ n(j, { size: "sm", variant: "ghost", onClick: l, children: [
422
- /* @__PURE__ */ e(z, { name: "plus", size: 14 }),
423
- " Add"
424
+ /* @__PURE__ */ e("h3", { children: v("apiDesigner.endpoints", "Endpoints") }),
425
+ !p && /* @__PURE__ */ n(U, { size: "sm", variant: "ghost", onClick: c, children: [
426
+ /* @__PURE__ */ e(B, { name: "plus", size: 14 }),
427
+ " ",
428
+ v("apiDesigner.add", "Add")
424
429
  ] })
425
430
  ] }),
426
- t.map(({ path: N, method: m }) => /* @__PURE__ */ n(
431
+ t.map(({ path: T, method: m }) => /* @__PURE__ */ n(
427
432
  "div",
428
433
  {
429
- className: `nice-api-designer__endpoint ${o === N && i === m.toLowerCase() ? "nice-api-designer__endpoint--selected" : ""}`,
430
- onClick: () => c(N, m.toLowerCase()),
434
+ className: `nice-api-designer__endpoint ${o === T && i === m.toLowerCase() ? "nice-api-designer__endpoint--selected" : ""}`,
435
+ onClick: () => r(T, m.toLowerCase()),
431
436
  children: [
432
437
  /* @__PURE__ */ e(
433
438
  "span",
@@ -436,10 +441,10 @@ function xe({
436
441
  children: m
437
442
  }
438
443
  ),
439
- /* @__PURE__ */ e("span", { className: "nice-api-designer__path", children: N })
444
+ /* @__PURE__ */ e("span", { className: "nice-api-designer__path", children: T })
440
445
  ]
441
446
  },
442
- `${m}-${N}`
447
+ `${m}-${T}`
443
448
  ))
444
449
  ] }),
445
450
  u && o && i && /* @__PURE__ */ n("div", { className: "nice-api-designer__operation-editor", children: [
@@ -455,254 +460,263 @@ function xe({
455
460
  o
456
461
  ] }),
457
462
  /* @__PURE__ */ e(
458
- K,
463
+ L,
459
464
  {
460
- label: "Summary",
465
+ label: v("apiDesigner.summary", "Summary"),
461
466
  value: u.summary || "",
462
- onChange: (N) => f({ summary: N }),
463
- readOnly: g
467
+ onChange: (T) => N({ summary: T }),
468
+ readOnly: p
464
469
  }
465
470
  ),
466
471
  /* @__PURE__ */ e(
467
- ae,
472
+ oe,
468
473
  {
469
- label: "Description",
474
+ label: v("apiDesigner.description", "Description"),
470
475
  value: u.description || "",
471
- onChange: (N) => f({ description: N }),
472
- readOnly: g,
476
+ onChange: (T) => N({ description: T }),
477
+ readOnly: p,
473
478
  rows: 3
474
479
  }
475
480
  ),
476
481
  /* @__PURE__ */ e(
477
- K,
482
+ L,
478
483
  {
479
- label: "Operation ID",
484
+ label: v("apiDesigner.operationId", "Operation ID"),
480
485
  value: u.operationId || "",
481
- onChange: (N) => f({ operationId: N }),
482
- readOnly: g
486
+ onChange: (T) => N({ operationId: T }),
487
+ readOnly: p
483
488
  }
484
489
  ),
485
490
  /* @__PURE__ */ n("div", { className: "nice-api-designer__subhead", children: [
486
- /* @__PURE__ */ e("h4", { children: "Parameters" }),
487
- !g && /* @__PURE__ */ n(
488
- j,
491
+ /* @__PURE__ */ e("h4", { children: v("apiDesigner.parameters", "Parameters") }),
492
+ !p && /* @__PURE__ */ n(
493
+ U,
489
494
  {
490
495
  size: "sm",
491
496
  variant: "ghost",
492
- onClick: () => f({
497
+ onClick: () => N({
493
498
  parameters: [
494
- ..._,
499
+ ...b,
495
500
  { name: "param", in: "query", required: !1, schema: { type: "string" } }
496
501
  ]
497
502
  }),
498
503
  children: [
499
- /* @__PURE__ */ e(z, { name: "plus", size: 14 }),
500
- " Add"
504
+ /* @__PURE__ */ e(B, { name: "plus", size: 14 }),
505
+ " ",
506
+ v("apiDesigner.add", "Add")
501
507
  ]
502
508
  }
503
509
  )
504
510
  ] }),
505
- _.length === 0 && /* @__PURE__ */ e("p", { className: "nice-api-designer__muted", children: "No parameters." }),
506
- _.map((N, m) => /* @__PURE__ */ n("div", { className: "nice-api-designer__param-row", children: [
511
+ b.length === 0 && /* @__PURE__ */ e("p", { className: "nice-api-designer__muted", children: v("apiDesigner.noParameters", "No parameters.") }),
512
+ b.map((T, m) => /* @__PURE__ */ n("div", { className: "nice-api-designer__param-row", children: [
507
513
  /* @__PURE__ */ e(
508
- K,
514
+ L,
509
515
  {
510
516
  size: "sm",
511
- value: N.name,
517
+ value: T.name,
512
518
  placeholder: "name",
513
- onChange: (T) => f({ parameters: _.map((y, A) => A === m ? { ...y, name: T } : y) }),
514
- readOnly: g
519
+ onChange: (S) => N({ parameters: b.map((w, A) => A === m ? { ...w, name: S } : w) }),
520
+ readOnly: p
515
521
  }
516
522
  ),
517
523
  /* @__PURE__ */ e(
518
- te,
524
+ se,
519
525
  {
520
526
  size: "sm",
521
- value: N.in,
522
- options: Se.map((T) => ({ value: String(T), label: String(T) })),
523
- onChange: (T) => f({
524
- parameters: _.map(
525
- (y, A) => A === m ? { ...y, in: T } : y
527
+ value: T.in,
528
+ options: De.map((S) => ({ value: String(S), label: String(S) })),
529
+ onChange: (S) => N({
530
+ parameters: b.map(
531
+ (w, A) => A === m ? { ...w, in: S } : w
526
532
  )
527
533
  })
528
534
  }
529
535
  ),
530
536
  /* @__PURE__ */ e(
531
- ve,
537
+ fe,
532
538
  {
533
- checked: !!N.required,
534
- onChange: (T) => f({
535
- parameters: _.map((y, A) => A === m ? { ...y, required: T } : y)
539
+ checked: !!T.required,
540
+ onChange: (S) => N({
541
+ parameters: b.map((w, A) => A === m ? { ...w, required: S } : w)
536
542
  }),
537
543
  label: "required"
538
544
  }
539
545
  ),
540
- !g && /* @__PURE__ */ e(
541
- j,
546
+ !p && /* @__PURE__ */ e(
547
+ U,
542
548
  {
543
549
  size: "sm",
544
550
  variant: "ghost",
545
- onClick: () => f({ parameters: _.filter((T, y) => y !== m) }),
546
- "aria-label": `Remove ${N.name}`,
547
- children: /* @__PURE__ */ e(z, { name: "close", size: 14 })
551
+ onClick: () => N({ parameters: b.filter((S, w) => w !== m) }),
552
+ "aria-label": v("apiDesigner.remove", "Remove {name}").replace(
553
+ "{name}",
554
+ String(T.name)
555
+ ),
556
+ children: /* @__PURE__ */ e(B, { name: "close", size: 14 })
548
557
  }
549
558
  )
550
559
  ] }, m)),
551
- !g && /* @__PURE__ */ e(
552
- j,
560
+ !p && /* @__PURE__ */ e(
561
+ U,
553
562
  {
554
563
  className: "nice-api-designer__delete-btn",
555
564
  size: "sm",
556
565
  variant: "danger",
557
- leftIcon: /* @__PURE__ */ e(z, { name: "trash", size: 14 }),
558
- onClick: () => d(o),
559
- children: "Delete endpoint"
566
+ leftIcon: /* @__PURE__ */ e(B, { name: "trash", size: 14 }),
567
+ onClick: () => l(o),
568
+ children: v("apiDesigner.deleteEndpoint", "Delete endpoint")
560
569
  }
561
570
  )
562
571
  ] })
563
572
  ] });
564
573
  }
565
- function Ie({
574
+ function Re({
566
575
  schemas: t,
567
576
  onAdd: a,
568
577
  onChange: o,
569
578
  readOnly: i
570
579
  }) {
571
- const c = Object.keys(t), [l, d] = k(c[0] ?? null), p = l ? t[l] : null, g = (p == null ? void 0 : p.properties) ?? {}, u = (_) => {
572
- !l || !p || o({ ...t, [l]: { ...p, ..._ } });
573
- }, f = (_, b) => {
574
- u({ properties: { ...g, [_]: b } });
580
+ const { t: r } = $(), c = Object.keys(t), [l, d] = C(c[0] ?? null), p = l ? t[l] : null, v = (p == null ? void 0 : p.properties) ?? {}, u = (b) => {
581
+ !l || !p || o({ ...t, [l]: { ...p, ...b } });
582
+ }, N = (b, y) => {
583
+ u({ properties: { ...v, [b]: y } });
575
584
  };
576
585
  return /* @__PURE__ */ n("div", { className: "nice-api-designer__schemas-editor", children: [
577
586
  /* @__PURE__ */ n("div", { className: "nice-api-designer__schemas-list", children: [
578
587
  /* @__PURE__ */ n("div", { className: "nice-api-designer__list-header", children: [
579
- /* @__PURE__ */ e("h3", { children: "Schemas" }),
580
- !i && /* @__PURE__ */ n(j, { size: "sm", variant: "ghost", onClick: a, children: [
581
- /* @__PURE__ */ e(z, { name: "plus", size: 14 }),
582
- " Add"
588
+ /* @__PURE__ */ e("h3", { children: r("apiDesigner.schemas", "Schemas") }),
589
+ !i && /* @__PURE__ */ n(U, { size: "sm", variant: "ghost", onClick: a, children: [
590
+ /* @__PURE__ */ e(B, { name: "plus", size: 14 }),
591
+ " ",
592
+ r("apiDesigner.add", "Add")
583
593
  ] })
584
594
  ] }),
585
- c.map((_) => /* @__PURE__ */ e(
595
+ c.map((b) => /* @__PURE__ */ e(
586
596
  "div",
587
597
  {
588
- className: `nice-api-designer__schema-item ${l === _ ? "nice-api-designer__schema-item--selected" : ""}`,
589
- onClick: () => d(_),
590
- children: _
598
+ className: `nice-api-designer__schema-item ${l === b ? "nice-api-designer__schema-item--selected" : ""}`,
599
+ onClick: () => d(b),
600
+ children: b
591
601
  },
592
- _
602
+ b
593
603
  ))
594
604
  ] }),
595
605
  l && p && /* @__PURE__ */ n("div", { className: "nice-api-designer__schema-editor", children: [
596
606
  /* @__PURE__ */ e("h3", { children: l }),
597
607
  /* @__PURE__ */ e(
598
- te,
608
+ se,
599
609
  {
600
- label: "Type",
610
+ label: r("apiDesigner.type", "Type"),
601
611
  value: p.type || "object",
602
- options: me,
603
- onChange: (_) => u({ type: _ })
612
+ options: _e,
613
+ onChange: (b) => u({ type: b })
604
614
  }
605
615
  ),
606
616
  /* @__PURE__ */ e(
607
- ae,
617
+ oe,
608
618
  {
609
- label: "Description",
619
+ label: r("apiDesigner.description", "Description"),
610
620
  value: p.description || "",
611
- onChange: (_) => u({ description: _ }),
621
+ onChange: (b) => u({ description: b }),
612
622
  readOnly: i,
613
623
  rows: 2
614
624
  }
615
625
  ),
616
626
  /* @__PURE__ */ n("div", { className: "nice-api-designer__subhead", children: [
617
- /* @__PURE__ */ e("h4", { children: "Properties" }),
627
+ /* @__PURE__ */ e("h4", { children: r("apiDesigner.properties", "Properties") }),
618
628
  !i && /* @__PURE__ */ n(
619
- j,
629
+ U,
620
630
  {
621
631
  size: "sm",
622
632
  variant: "ghost",
623
633
  onClick: () => {
624
- let _ = "field", b = 1;
625
- for (; g[_]; )
626
- _ = `field${b++}`;
627
- f(_, { type: "string" });
634
+ let b = "field", y = 1;
635
+ for (; v[b]; )
636
+ b = `field${y++}`;
637
+ N(b, { type: "string" });
628
638
  },
629
639
  children: [
630
- /* @__PURE__ */ e(z, { name: "plus", size: 14 }),
631
- " Add"
640
+ /* @__PURE__ */ e(B, { name: "plus", size: 14 }),
641
+ " ",
642
+ r("apiDesigner.add", "Add")
632
643
  ]
633
644
  }
634
645
  )
635
646
  ] }),
636
- Object.keys(g).length === 0 && /* @__PURE__ */ e("p", { className: "nice-api-designer__muted", children: "No properties." }),
637
- Object.entries(g).map(([_, b]) => {
638
- const N = (p.required || []).includes(_);
647
+ Object.keys(v).length === 0 && /* @__PURE__ */ e("p", { className: "nice-api-designer__muted", children: r("apiDesigner.noProperties", "No properties.") }),
648
+ Object.entries(v).map(([b, y]) => {
649
+ const T = (p.required || []).includes(b);
639
650
  return /* @__PURE__ */ n("div", { className: "nice-api-designer__param-row", children: [
640
651
  /* @__PURE__ */ e(
641
- K,
652
+ L,
642
653
  {
643
654
  size: "sm",
644
- value: _,
655
+ value: b,
645
656
  onChange: (m) => {
646
- if (!m || m === _ || g[m])
657
+ if (!m || m === b || v[m])
647
658
  return;
648
- const T = {};
649
- Object.entries(g).forEach(([y, A]) => {
650
- T[y === _ ? m : y] = A;
659
+ const S = {};
660
+ Object.entries(v).forEach(([w, A]) => {
661
+ S[w === b ? m : w] = A;
651
662
  }), u({
652
- properties: T,
653
- required: (p.required || []).map((y) => y === _ ? m : y)
663
+ properties: S,
664
+ required: (p.required || []).map((w) => w === b ? m : w)
654
665
  });
655
666
  },
656
667
  readOnly: i
657
668
  }
658
669
  ),
659
670
  /* @__PURE__ */ e(
660
- te,
671
+ se,
661
672
  {
662
673
  size: "sm",
663
- value: b.type || "string",
664
- options: me,
665
- onChange: (m) => f(_, { ...b, type: m })
674
+ value: y.type || "string",
675
+ options: _e,
676
+ onChange: (m) => N(b, { ...y, type: m })
666
677
  }
667
678
  ),
668
679
  /* @__PURE__ */ e(
669
- ve,
680
+ fe,
670
681
  {
671
- checked: N,
682
+ checked: T,
672
683
  onChange: (m) => u({
673
- required: m ? [...p.required || [], _] : (p.required || []).filter((T) => T !== _)
684
+ required: m ? [...p.required || [], b] : (p.required || []).filter((S) => S !== b)
674
685
  }),
675
686
  label: "required"
676
687
  }
677
688
  ),
678
689
  !i && /* @__PURE__ */ e(
679
- j,
690
+ U,
680
691
  {
681
692
  size: "sm",
682
693
  variant: "ghost",
683
694
  onClick: () => {
684
- const { [_]: m, ...T } = g;
695
+ const { [b]: m, ...S } = v;
685
696
  u({
686
- properties: T,
687
- required: (p.required || []).filter((y) => y !== _)
697
+ properties: S,
698
+ required: (p.required || []).filter((w) => w !== b)
688
699
  });
689
700
  },
690
- "aria-label": `Remove ${_}`,
691
- children: /* @__PURE__ */ e(z, { name: "close", size: 14 })
701
+ "aria-label": r("apiDesigner.remove2", "Remove {propName}").replace(
702
+ "{propName}",
703
+ String(b)
704
+ ),
705
+ children: /* @__PURE__ */ e(B, { name: "close", size: 14 })
692
706
  }
693
707
  )
694
- ] }, _);
708
+ ] }, b);
695
709
  }),
696
710
  /* @__PURE__ */ n("details", { className: "nice-api-designer__raw", children: [
697
- /* @__PURE__ */ e("summary", { children: "Raw JSON schema" }),
711
+ /* @__PURE__ */ e("summary", { children: r("apiDesigner.rawJsonSchema", "Raw JSON schema") }),
698
712
  /* @__PURE__ */ e(
699
- ae,
713
+ oe,
700
714
  {
701
715
  value: JSON.stringify(p, null, 2),
702
- onChange: (_) => {
716
+ onChange: (b) => {
703
717
  try {
704
- const b = JSON.parse(_);
705
- o({ ...t, [l]: b });
718
+ const y = JSON.parse(b);
719
+ o({ ...t, [l]: y });
706
720
  } catch {
707
721
  }
708
722
  },
@@ -715,13 +729,13 @@ function Ie({
715
729
  ] })
716
730
  ] });
717
731
  }
718
- function $e({ schemes: t, onChange: a, readOnly: o }) {
719
- const i = (c, l) => a({ ...t, [c]: l });
732
+ function qe({ schemes: t, onChange: a, readOnly: o }) {
733
+ const { t: i } = $(), r = (c, l) => a({ ...t, [c]: l });
720
734
  return /* @__PURE__ */ n("div", { className: "nice-api-designer__security-editor", children: [
721
735
  /* @__PURE__ */ n("div", { className: "nice-api-designer__list-header", children: [
722
- /* @__PURE__ */ e("h3", { children: "Security schemes" }),
736
+ /* @__PURE__ */ e("h3", { children: i("apiDesigner.securitySchemes", "Security schemes") }),
723
737
  !o && /* @__PURE__ */ n(
724
- j,
738
+ U,
725
739
  {
726
740
  size: "sm",
727
741
  variant: "ghost",
@@ -729,11 +743,12 @@ function $e({ schemes: t, onChange: a, readOnly: o }) {
729
743
  let c = "newScheme", l = 1;
730
744
  for (; t[c]; )
731
745
  c = `newScheme${l++}`;
732
- i(c, { type: "apiKey", name: "X-API-Key", in: "header" });
746
+ r(c, { type: "apiKey", name: "X-API-Key", in: "header" });
733
747
  },
734
748
  children: [
735
- /* @__PURE__ */ e(z, { name: "plus", size: 14 }),
736
- " Add"
749
+ /* @__PURE__ */ e(B, { name: "plus", size: 14 }),
750
+ " ",
751
+ i("apiDesigner.add", "Add")
737
752
  ]
738
753
  }
739
754
  )
@@ -742,7 +757,7 @@ function $e({ schemes: t, onChange: a, readOnly: o }) {
742
757
  /* @__PURE__ */ n("div", { className: "nice-api-designer__subhead", children: [
743
758
  /* @__PURE__ */ e("h4", { children: c }),
744
759
  !o && /* @__PURE__ */ e(
745
- j,
760
+ U,
746
761
  {
747
762
  size: "sm",
748
763
  variant: "ghost",
@@ -750,85 +765,89 @@ function $e({ schemes: t, onChange: a, readOnly: o }) {
750
765
  const { [c]: d, ...p } = t;
751
766
  a(p);
752
767
  },
753
- "aria-label": `Remove ${c}`,
754
- children: /* @__PURE__ */ e(z, { name: "close", size: 14 })
768
+ "aria-label": i("apiDesigner.remove", "Remove {name}").replace(
769
+ "{name}",
770
+ String(c)
771
+ ),
772
+ children: /* @__PURE__ */ e(B, { name: "close", size: 14 })
755
773
  }
756
774
  )
757
775
  ] }),
758
776
  /* @__PURE__ */ n("div", { className: "nice-api-designer__param-row", children: [
759
777
  /* @__PURE__ */ e(
760
- te,
778
+ se,
761
779
  {
762
780
  size: "sm",
763
781
  value: l.type,
764
- options: Pe.map((d) => ({ value: String(d), label: String(d) })),
765
- onChange: (d) => i(c, { ...l, type: d })
782
+ options: Ae.map((d) => ({ value: String(d), label: String(d) })),
783
+ onChange: (d) => r(c, { ...l, type: d })
766
784
  }
767
785
  ),
768
- l.type === "apiKey" && /* @__PURE__ */ n(B, { children: [
786
+ l.type === "apiKey" && /* @__PURE__ */ n(Q, { children: [
769
787
  /* @__PURE__ */ e(
770
- K,
788
+ L,
771
789
  {
772
790
  size: "sm",
773
791
  value: l.name || "",
774
- placeholder: "header/param name",
775
- onChange: (d) => i(c, { ...l, name: d }),
792
+ placeholder: i("apiDesigner.headerParamName", "header/param name"),
793
+ onChange: (d) => r(c, { ...l, name: d }),
776
794
  readOnly: o
777
795
  }
778
796
  ),
779
797
  /* @__PURE__ */ e(
780
- te,
798
+ se,
781
799
  {
782
800
  size: "sm",
783
801
  value: l.in || "header",
784
802
  options: ["header", "query", "cookie"].map((d) => ({ value: d, label: d })),
785
- onChange: (d) => i(c, { ...l, in: d })
803
+ onChange: (d) => r(c, { ...l, in: d })
786
804
  }
787
805
  )
788
806
  ] }),
789
- l.type === "http" && /* @__PURE__ */ n(B, { children: [
807
+ l.type === "http" && /* @__PURE__ */ n(Q, { children: [
790
808
  /* @__PURE__ */ e(
791
- K,
809
+ L,
792
810
  {
793
811
  size: "sm",
794
812
  value: l.scheme || "",
795
- placeholder: "scheme (bearer/basic)",
796
- onChange: (d) => i(c, { ...l, scheme: d }),
813
+ placeholder: i("apiDesigner.schemeBearerBasic", "scheme (bearer/basic)"),
814
+ onChange: (d) => r(c, { ...l, scheme: d }),
797
815
  readOnly: o
798
816
  }
799
817
  ),
800
818
  /* @__PURE__ */ e(
801
- K,
819
+ L,
802
820
  {
803
821
  size: "sm",
804
822
  value: l.bearerFormat || "",
805
- placeholder: "bearerFormat (JWT)",
806
- onChange: (d) => i(c, { ...l, bearerFormat: d }),
823
+ placeholder: i("apiDesigner.bearerformatJwt", "bearerFormat (JWT)"),
824
+ onChange: (d) => r(c, { ...l, bearerFormat: d }),
807
825
  readOnly: o
808
826
  }
809
827
  )
810
828
  ] })
811
829
  ] }),
812
830
  /* @__PURE__ */ e(
813
- K,
831
+ L,
814
832
  {
815
833
  size: "sm",
816
834
  value: l.description || "",
817
- placeholder: "Description",
818
- onChange: (d) => i(c, { ...l, description: d }),
835
+ placeholder: i("apiDesigner.description", "Description"),
836
+ onChange: (d) => r(c, { ...l, description: d }),
819
837
  readOnly: o
820
838
  }
821
839
  )
822
840
  ] }, c))
823
841
  ] });
824
842
  }
825
- function Re({ schema: t }) {
843
+ function $e({ schema: t }) {
844
+ const { t: a } = $();
826
845
  return /* @__PURE__ */ n("div", { className: "nice-api-designer__json-preview", children: [
827
- /* @__PURE__ */ e("h3", { children: "OpenAPI specification" }),
846
+ /* @__PURE__ */ e("h3", { children: a("apiDesigner.openapiSpecification", "OpenAPI specification") }),
828
847
  /* @__PURE__ */ e("pre", { className: "nice-api-designer__code", children: JSON.stringify(t, null, 2) })
829
848
  ] });
830
849
  }
831
- const qe = [
850
+ const Be = [
832
851
  {
833
852
  target: ".nice-api-tester",
834
853
  titleKey: "tutorial.apiTester.intro.title",
@@ -837,7 +856,7 @@ const qe = [
837
856
  content: "Build requests with collections and environment variables, send them and assert on the responses.",
838
857
  placement: "auto"
839
858
  }
840
- ], De = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"], ze = {
859
+ ], ze = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"], Oe = {
841
860
  id: "",
842
861
  name: "New Request",
843
862
  method: "GET",
@@ -845,138 +864,138 @@ const qe = [
845
864
  headers: {},
846
865
  queryParams: {}
847
866
  };
848
- function de(t, a) {
867
+ function he(t, a) {
849
868
  return t.replace(/\{\{(\w+)\}\}/g, (o, i) => a[i] || `{{${i}}}`);
850
869
  }
851
870
  function je(t, a) {
852
- const o = Object.entries(a).filter(([, i]) => i).map(([i, c]) => `${encodeURIComponent(i)}=${encodeURIComponent(c)}`).join("&");
871
+ const o = Object.entries(a).filter(([, i]) => i).map(([i, r]) => `${encodeURIComponent(i)}=${encodeURIComponent(r)}`).join("&");
853
872
  return o ? `${t}?${o}` : t;
854
873
  }
855
- function rt({
874
+ function ct({
856
875
  collections: t = [],
857
876
  environments: a = [],
858
877
  onRequest: o,
859
878
  onSaveCollection: i,
860
- className: c = "",
861
- tutorial: l
879
+ className: r = "",
880
+ tutorial: c
862
881
  }) {
863
- const [d, p] = k(t), [g, u] = k(a), [f, _] = k(
882
+ const { t: l } = $(), [d, p] = C(t), [v, u] = C(a), [N, b] = C(
864
883
  a.find((s) => s.isActive) || null
865
- ), [b, N] = k({
866
- ...ze,
867
- id: ee()
868
- }), [m, T] = k(null), [y, A] = k(!1), [U, F] = k("none"), [R, O] = k(
884
+ ), [y, T] = C({
885
+ ...Oe,
886
+ id: re()
887
+ }), [m, S] = C(null), [w, A] = C(!1), [J, te] = C("none"), [z, M] = C(
869
888
  "params"
870
- ), [q, H] = k("body"), [M, w] = k(""), [v, x] = k(""), [D, L] = k([]), [$, J] = k([]), V = ue(null), Y = I(async () => {
871
- var S;
872
- if (!b.url)
889
+ ), [O, V] = C("body"), [G, k] = C(""), [f, x] = C(""), [j, F] = C([]), [R, ie] = C([]), K = de(null), Y = I(async () => {
890
+ var H;
891
+ if (!y.url)
873
892
  return;
874
- A(!0), T(null), L([]);
893
+ A(!0), S(null), F([]);
875
894
  const s = Object.fromEntries(
876
- Object.entries((f == null ? void 0 : f.variables) || {}).map(([E, P]) => [E, P.value])
877
- ), r = {
878
- ...b,
879
- url: de(b.url, s),
895
+ Object.entries((N == null ? void 0 : N.variables) || {}).map(([E, _]) => [E, _.value])
896
+ ), g = {
897
+ ...y,
898
+ url: he(y.url, s),
880
899
  headers: Object.fromEntries(
881
- Object.entries(b.headers).map(([E, P]) => [E, de(P, s)])
900
+ Object.entries(y.headers).map(([E, _]) => [E, he(_, s)])
882
901
  ),
883
902
  queryParams: Object.fromEntries(
884
- Object.entries(b.queryParams).map(([E, P]) => [
903
+ Object.entries(y.queryParams).map(([E, _]) => [
885
904
  E,
886
- de(P, s)
905
+ he(_, s)
887
906
  ])
888
907
  )
889
- }, C = performance.now();
908
+ }, P = performance.now();
890
909
  try {
891
910
  let E;
892
911
  if (o)
893
- E = await o(r);
912
+ E = await o(g);
894
913
  else {
895
- V.current = new AbortController();
896
- const P = { ...r.headers };
897
- b.auth && Oe(P, b.auth);
898
- const ie = je(r.url, r.queryParams), G = {
899
- method: r.method,
900
- headers: P,
901
- signal: V.current.signal
914
+ K.current = new AbortController();
915
+ const _ = { ...g.headers };
916
+ y.auth && Ke(_, y.auth);
917
+ const D = je(g.url, g.queryParams), q = {
918
+ method: g.method,
919
+ headers: _,
920
+ signal: K.current.signal
902
921
  };
903
- ["POST", "PUT", "PATCH"].includes(r.method) && ((S = b.body) != null && S.content) && (G.body = typeof b.body.content == "string" ? b.body.content : JSON.stringify(b.body.content), b.body.type === "json" && (P["Content-Type"] = "application/json"));
904
- const ne = await fetch(ie, G), oe = await ne.text();
905
- let ce;
922
+ ["POST", "PUT", "PATCH"].includes(g.method) && ((H = y.body) != null && H.content) && (q.body = typeof y.body.content == "string" ? y.body.content : JSON.stringify(y.body.content), y.body.type === "json" && (_["Content-Type"] = "application/json"));
923
+ const W = await fetch(D, q), X = await W.text();
924
+ let pe;
906
925
  try {
907
- ce = JSON.parse(oe);
926
+ pe = JSON.parse(X);
908
927
  } catch {
909
- ce = oe;
928
+ pe = X;
910
929
  }
911
- const Ne = performance.now();
930
+ const ke = performance.now();
912
931
  E = {
913
- status: ne.status,
914
- statusText: ne.statusText,
915
- headers: Object.fromEntries(ne.headers.entries()),
916
- body: ce,
917
- time: Math.round(Ne - C),
918
- size: new Blob([oe]).size,
932
+ status: W.status,
933
+ statusText: W.statusText,
934
+ headers: Object.fromEntries(W.headers.entries()),
935
+ body: pe,
936
+ time: Math.round(ke - P),
937
+ size: new Blob([X]).size,
919
938
  timestamp: /* @__PURE__ */ new Date()
920
939
  };
921
940
  }
922
- if (T(E), J(
923
- (P) => [...P, { request: b, response: E }].slice(-50)
924
- ), v) {
925
- const P = He(v, E);
926
- L(P);
941
+ if (S(E), ie(
942
+ (_) => [..._, { request: y, response: E }].slice(-50)
943
+ ), f) {
944
+ const _ = Ue(f, E);
945
+ F(_);
927
946
  }
928
947
  } catch (E) {
929
- E.name !== "AbortError" && T({
948
+ E.name !== "AbortError" && S({
930
949
  status: 0,
931
950
  statusText: "Error",
932
951
  headers: {},
933
952
  body: { error: E.message },
934
- time: Math.round(performance.now() - C),
953
+ time: Math.round(performance.now() - P),
935
954
  size: 0,
936
955
  timestamp: /* @__PURE__ */ new Date()
937
956
  });
938
957
  } finally {
939
- A(!1), V.current = null;
958
+ A(!1), K.current = null;
940
959
  }
941
- }, [b, f, o, v]), W = I(() => {
960
+ }, [y, N, o, f]), ne = I(() => {
942
961
  var s;
943
- (s = V.current) == null || s.abort(), A(!1);
944
- }, []), X = I(() => {
945
- N((s) => ({
962
+ (s = K.current) == null || s.abort(), A(!1);
963
+ }, []), Z = I(() => {
964
+ T((s) => ({
946
965
  ...s,
947
966
  headers: { ...s.headers, "": "" }
948
967
  }));
949
- }, []), Q = I(() => {
950
- N((s) => ({
968
+ }, []), ae = I(() => {
969
+ T((s) => ({
951
970
  ...s,
952
971
  queryParams: { ...s.queryParams, "": "" }
953
972
  }));
954
973
  }, []), h = I(() => {
955
974
  if (d.length === 0) {
956
975
  const s = {
957
- id: ee(),
976
+ id: re(),
958
977
  name: "My Collection",
959
- requests: [b]
978
+ requests: [y]
960
979
  };
961
980
  p([s]), i == null || i(s);
962
981
  } else {
963
982
  const s = {
964
983
  ...d[0],
965
- requests: [...d[0].requests, b]
984
+ requests: [...d[0].requests, y]
966
985
  };
967
- p((r) => [s, ...r.slice(1)]), i == null || i(s);
986
+ p((g) => [s, ...g.slice(1)]), i == null || i(s);
968
987
  }
969
- }, [d, b, i]);
970
- return /* @__PURE__ */ n("div", { className: `nice-api-tester ${c}`, style: { position: "relative" }, children: [
971
- l && /* @__PURE__ */ e("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ e(se, { steps: re(l, qe) }) }),
988
+ }, [d, y, i]);
989
+ return /* @__PURE__ */ n("div", { className: `nice-api-tester ${r}`, style: { position: "relative" }, children: [
990
+ c && /* @__PURE__ */ e("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ e(ce, { steps: le(c, Be) }) }),
972
991
  /* @__PURE__ */ e("div", { className: "nice-api-tester__toolbar", children: /* @__PURE__ */ e("div", { className: "nice-api-tester__env-selector", children: /* @__PURE__ */ n(
973
992
  "select",
974
993
  {
975
- value: (f == null ? void 0 : f.id) || "",
976
- onChange: (s) => _(g.find((r) => r.id === s.target.value) || null),
994
+ value: (N == null ? void 0 : N.id) || "",
995
+ onChange: (s) => b(v.find((g) => g.id === s.target.value) || null),
977
996
  children: [
978
- /* @__PURE__ */ e("option", { value: "", children: "No Environment" }),
979
- g.map((s) => /* @__PURE__ */ e("option", { value: s.id, children: s.name }, s.id))
997
+ /* @__PURE__ */ e("option", { value: "", children: l("apiTester.noEnvironment", "No Environment") }),
998
+ v.map((s) => /* @__PURE__ */ e("option", { value: s.id, children: s.name }, s.id))
980
999
  ]
981
1000
  }
982
1001
  ) }) }),
@@ -984,91 +1003,91 @@ function rt({
984
1003
  /* @__PURE__ */ e(
985
1004
  "select",
986
1005
  {
987
- value: b.method,
988
- onChange: (s) => N((r) => ({
989
- ...r,
1006
+ value: y.method,
1007
+ onChange: (s) => T((g) => ({
1008
+ ...g,
990
1009
  method: s.target.value
991
1010
  })),
992
- className: `nice-api-tester__method nice-api-tester__method--${b.method.toLowerCase()}`,
993
- children: De.map((s) => /* @__PURE__ */ e("option", { value: s, children: s }, s))
1011
+ className: `nice-api-tester__method nice-api-tester__method--${y.method.toLowerCase()}`,
1012
+ children: ze.map((s) => /* @__PURE__ */ e("option", { value: s, children: s }, s))
994
1013
  }
995
1014
  ),
996
1015
  /* @__PURE__ */ e(
997
1016
  "input",
998
1017
  {
999
1018
  type: "text",
1000
- value: b.url,
1001
- onChange: (s) => N((r) => ({ ...r, url: s.target.value })),
1002
- placeholder: "Enter request URL",
1019
+ value: y.url,
1020
+ onChange: (s) => T((g) => ({ ...g, url: s.target.value })),
1021
+ placeholder: l("apiTester.enterRequestUrl", "Enter request URL"),
1003
1022
  className: "nice-api-tester__url-input"
1004
1023
  }
1005
1024
  ),
1006
1025
  /* @__PURE__ */ e(
1007
1026
  "button",
1008
1027
  {
1009
- onClick: y ? W : Y,
1010
- className: `nice-api-tester__send-btn ${y ? "nice-api-tester__send-btn--loading" : ""}`,
1011
- children: y ? "Cancel" : "Send"
1028
+ onClick: w ? ne : Y,
1029
+ className: `nice-api-tester__send-btn ${w ? "nice-api-tester__send-btn--loading" : ""}`,
1030
+ children: w ? l("apiTester.cancel", "Cancel") : l("apiTester.send", "Send")
1012
1031
  }
1013
1032
  ),
1014
- /* @__PURE__ */ e("button", { onClick: h, className: "nice-api-tester__save-btn", children: "Save" })
1033
+ /* @__PURE__ */ e("button", { onClick: h, className: "nice-api-tester__save-btn", children: l("apiTester.save", "Save") })
1015
1034
  ] }),
1016
1035
  /* @__PURE__ */ n("div", { className: "nice-api-tester__main", children: [
1017
1036
  /* @__PURE__ */ n("div", { className: "nice-api-tester__request-panel", children: [
1018
1037
  /* @__PURE__ */ e("div", { className: "nice-api-tester__tabs", children: ["params", "headers", "body", "auth", "tests"].map((s) => /* @__PURE__ */ e(
1019
1038
  "button",
1020
1039
  {
1021
- className: `nice-api-tester__tab ${R === s ? "nice-api-tester__tab--active" : ""}`,
1022
- onClick: () => O(s),
1040
+ className: `nice-api-tester__tab ${z === s ? "nice-api-tester__tab--active" : ""}`,
1041
+ onClick: () => M(s),
1023
1042
  children: s.charAt(0).toUpperCase() + s.slice(1)
1024
1043
  },
1025
1044
  s
1026
1045
  )) }),
1027
1046
  /* @__PURE__ */ n("div", { className: "nice-api-tester__tab-content", children: [
1028
- R === "params" && /* @__PURE__ */ e(
1029
- Le,
1047
+ z === "params" && /* @__PURE__ */ e(
1048
+ Me,
1030
1049
  {
1031
- params: b.queryParams,
1032
- onChange: (s) => N((r) => ({ ...r, queryParams: s })),
1033
- onAdd: Q
1050
+ params: y.queryParams,
1051
+ onChange: (s) => T((g) => ({ ...g, queryParams: s })),
1052
+ onAdd: ae
1034
1053
  }
1035
1054
  ),
1036
- R === "headers" && /* @__PURE__ */ e(
1037
- Ue,
1055
+ z === "headers" && /* @__PURE__ */ e(
1056
+ Le,
1038
1057
  {
1039
- headers: b.headers,
1040
- onChange: (s) => N((r) => ({ ...r, headers: s })),
1041
- onAdd: X
1058
+ headers: y.headers,
1059
+ onChange: (s) => T((g) => ({ ...g, headers: s })),
1060
+ onAdd: Z
1042
1061
  }
1043
1062
  ),
1044
- R === "body" && /* @__PURE__ */ e(
1045
- Me,
1063
+ z === "body" && /* @__PURE__ */ e(
1064
+ Ve,
1046
1065
  {
1047
- body: b.body,
1048
- bodyTab: U,
1049
- onBodyTabChange: F,
1050
- onChange: (s) => N((r) => ({ ...r, body: s }))
1066
+ body: y.body,
1067
+ bodyTab: J,
1068
+ onBodyTabChange: te,
1069
+ onChange: (s) => T((g) => ({ ...g, body: s }))
1051
1070
  }
1052
1071
  ),
1053
- R === "auth" && /* @__PURE__ */ e(
1054
- Be,
1072
+ z === "auth" && /* @__PURE__ */ e(
1073
+ Fe,
1055
1074
  {
1056
- auth: b.auth,
1057
- onChange: (s) => N((r) => ({ ...r, auth: s }))
1075
+ auth: y.auth,
1076
+ onChange: (s) => T((g) => ({ ...g, auth: s }))
1058
1077
  }
1059
1078
  ),
1060
- R === "tests" && /* @__PURE__ */ e(
1061
- Ve,
1079
+ z === "tests" && /* @__PURE__ */ e(
1080
+ Je,
1062
1081
  {
1063
- preRequestScript: M,
1064
- testScript: v,
1065
- onPreRequestChange: w,
1082
+ preRequestScript: G,
1083
+ testScript: f,
1084
+ onPreRequestChange: k,
1066
1085
  onTestChange: x
1067
1086
  }
1068
1087
  )
1069
1088
  ] })
1070
1089
  ] }),
1071
- /* @__PURE__ */ e("div", { className: "nice-api-tester__response-panel", children: m ? /* @__PURE__ */ n(B, { children: [
1090
+ /* @__PURE__ */ e("div", { className: "nice-api-tester__response-panel", children: m ? /* @__PURE__ */ n(Q, { children: [
1072
1091
  /* @__PURE__ */ n("div", { className: "nice-api-tester__response-meta", children: [
1073
1092
  /* @__PURE__ */ n(
1074
1093
  "span",
@@ -1085,52 +1104,52 @@ function rt({
1085
1104
  m.time,
1086
1105
  "ms"
1087
1106
  ] }),
1088
- /* @__PURE__ */ e("span", { className: "nice-api-tester__size", children: Ke(m.size) })
1107
+ /* @__PURE__ */ e("span", { className: "nice-api-tester__size", children: He(m.size) })
1089
1108
  ] }),
1090
1109
  /* @__PURE__ */ e("div", { className: "nice-api-tester__tabs", children: ["body", "headers", "tests"].map((s) => /* @__PURE__ */ n(
1091
1110
  "button",
1092
1111
  {
1093
- className: `nice-api-tester__tab ${q === s ? "nice-api-tester__tab--active" : ""}`,
1094
- onClick: () => H(s),
1112
+ className: `nice-api-tester__tab ${O === s ? "nice-api-tester__tab--active" : ""}`,
1113
+ onClick: () => V(s),
1095
1114
  children: [
1096
1115
  s.charAt(0).toUpperCase() + s.slice(1),
1097
- s === "tests" && D.length > 0 && /* @__PURE__ */ n("span", { className: "nice-api-tester__test-badge", children: [
1098
- D.filter((r) => r.passed).length,
1116
+ s === "tests" && j.length > 0 && /* @__PURE__ */ n("span", { className: "nice-api-tester__test-badge", children: [
1117
+ j.filter((g) => g.passed).length,
1099
1118
  "/",
1100
- D.length
1119
+ j.length
1101
1120
  ] })
1102
1121
  ]
1103
1122
  },
1104
1123
  s
1105
1124
  )) }),
1106
1125
  /* @__PURE__ */ n("div", { className: "nice-api-tester__response-content", children: [
1107
- q === "body" && /* @__PURE__ */ e("pre", { className: "nice-api-tester__response-body", children: typeof m.body == "string" ? m.body : JSON.stringify(m.body, null, 2) }),
1108
- q === "headers" && /* @__PURE__ */ e("div", { className: "nice-api-tester__response-headers", children: Object.entries(m.headers).map(([s, r]) => /* @__PURE__ */ n("div", { className: "nice-api-tester__header-row", children: [
1126
+ O === "body" && /* @__PURE__ */ e("pre", { className: "nice-api-tester__response-body", children: typeof m.body == "string" ? m.body : JSON.stringify(m.body, null, 2) }),
1127
+ O === "headers" && /* @__PURE__ */ e("div", { className: "nice-api-tester__response-headers", children: Object.entries(m.headers).map(([s, g]) => /* @__PURE__ */ n("div", { className: "nice-api-tester__header-row", children: [
1109
1128
  /* @__PURE__ */ e("span", { className: "nice-api-tester__header-key", children: s }),
1110
- /* @__PURE__ */ e("span", { className: "nice-api-tester__header-value", children: r })
1129
+ /* @__PURE__ */ e("span", { className: "nice-api-tester__header-value", children: g })
1111
1130
  ] }, s)) }),
1112
- q === "tests" && /* @__PURE__ */ e("div", { className: "nice-api-tester__test-results", children: D.map((s, r) => /* @__PURE__ */ n(
1131
+ O === "tests" && /* @__PURE__ */ e("div", { className: "nice-api-tester__test-results", children: j.map((s, g) => /* @__PURE__ */ n(
1113
1132
  "div",
1114
1133
  {
1115
1134
  className: `nice-api-tester__test-result nice-api-tester__test-result--${s.passed ? "pass" : "fail"}`,
1116
1135
  children: [
1117
- /* @__PURE__ */ e("span", { className: "nice-api-tester__test-icon", children: /* @__PURE__ */ e(z, { name: s.passed ? "check" : "close", size: 14 }) }),
1136
+ /* @__PURE__ */ e("span", { className: "nice-api-tester__test-icon", children: /* @__PURE__ */ e(B, { name: s.passed ? "check" : "close", size: 14 }) }),
1118
1137
  /* @__PURE__ */ e("span", { className: "nice-api-tester__test-name", children: s.name }),
1119
1138
  s.message && /* @__PURE__ */ e("span", { className: "nice-api-tester__test-message", children: s.message })
1120
1139
  ]
1121
1140
  },
1122
- r
1141
+ g
1123
1142
  )) })
1124
1143
  ] })
1125
- ] }) : /* @__PURE__ */ e("div", { className: "nice-api-tester__empty-response", children: y ? "Loading..." : "Send a request to see the response" }) })
1144
+ ] }) : /* @__PURE__ */ e("div", { className: "nice-api-tester__empty-response", children: w ? l("apiTester.loading", "Loading...") : l("apiTester.sendARequestToSee", "Send a request to see the response") }) })
1126
1145
  ] }),
1127
- $.length > 0 && /* @__PURE__ */ n("div", { className: "nice-api-tester__history", children: [
1128
- /* @__PURE__ */ e("h4", { children: "History" }),
1129
- /* @__PURE__ */ e("div", { className: "nice-api-tester__history-list", children: $.slice().reverse().map(({ request: s, response: r }, C) => /* @__PURE__ */ n(
1146
+ R.length > 0 && /* @__PURE__ */ n("div", { className: "nice-api-tester__history", children: [
1147
+ /* @__PURE__ */ e("h4", { children: l("apiTester.history", "History") }),
1148
+ /* @__PURE__ */ e("div", { className: "nice-api-tester__history-list", children: R.slice().reverse().map(({ request: s, response: g }, P) => /* @__PURE__ */ n(
1130
1149
  "div",
1131
1150
  {
1132
1151
  className: "nice-api-tester__history-item",
1133
- onClick: () => N(s),
1152
+ onClick: () => T(s),
1134
1153
  children: [
1135
1154
  /* @__PURE__ */ e(
1136
1155
  "span",
@@ -1144,36 +1163,36 @@ function rt({
1144
1163
  "span",
1145
1164
  {
1146
1165
  className: `nice-api-tester__status nice-api-tester__status--${Math.floor(
1147
- r.status / 100
1166
+ g.status / 100
1148
1167
  )}`,
1149
- children: r.status
1168
+ children: g.status
1150
1169
  }
1151
1170
  )
1152
1171
  ]
1153
1172
  },
1154
- C
1173
+ P
1155
1174
  )) })
1156
1175
  ] })
1157
1176
  ] });
1158
1177
  }
1159
- function Oe(t, a) {
1160
- var o, i, c, l, d;
1178
+ function Ke(t, a) {
1179
+ var o, i, r, c, l;
1161
1180
  switch (a.type) {
1162
1181
  case "bearer":
1163
1182
  t.Authorization = `${((o = a.bearer) == null ? void 0 : o.prefix) || "Bearer"} ${(i = a.bearer) == null ? void 0 : i.token}`;
1164
1183
  break;
1165
1184
  case "basic":
1166
- t.Authorization = `Basic ${btoa(`${(c = a.basic) == null ? void 0 : c.username}:${(l = a.basic) == null ? void 0 : l.password}`)}`;
1185
+ t.Authorization = `Basic ${btoa(`${(r = a.basic) == null ? void 0 : r.username}:${(c = a.basic) == null ? void 0 : c.password}`)}`;
1167
1186
  break;
1168
1187
  case "api-key":
1169
- ((d = a.apiKey) == null ? void 0 : d.in) === "header" && (t[a.apiKey.key] = a.apiKey.value);
1188
+ ((l = a.apiKey) == null ? void 0 : l.in) === "header" && (t[a.apiKey.key] = a.apiKey.value);
1170
1189
  break;
1171
1190
  }
1172
1191
  }
1173
- function Ke(t) {
1192
+ function He(t) {
1174
1193
  return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
1175
1194
  }
1176
- function He(t, a) {
1195
+ function Ue(t, a) {
1177
1196
  const o = [], i = {
1178
1197
  response: {
1179
1198
  code: a.status,
@@ -1183,35 +1202,35 @@ function He(t, a) {
1183
1202
  text: () => typeof a.body == "string" ? a.body : JSON.stringify(a.body),
1184
1203
  responseTime: a.time
1185
1204
  },
1186
- test: (c, l) => {
1187
- const d = performance.now();
1205
+ test: (r, c) => {
1206
+ const l = performance.now();
1188
1207
  try {
1189
- l(), o.push({ name: c, passed: !0, duration: performance.now() - d });
1190
- } catch (p) {
1208
+ c(), o.push({ name: r, passed: !0, duration: performance.now() - l });
1209
+ } catch (d) {
1191
1210
  o.push({
1192
- name: c,
1211
+ name: r,
1193
1212
  passed: !1,
1194
- message: p.message,
1195
- duration: performance.now() - d
1213
+ message: d.message,
1214
+ duration: performance.now() - l
1196
1215
  });
1197
1216
  }
1198
1217
  },
1199
- expect: (c) => ({
1218
+ expect: (r) => ({
1200
1219
  to: {
1201
- equal: (l) => {
1202
- if (c !== l)
1203
- throw new Error(`Expected ${l} but got ${c}`);
1220
+ equal: (c) => {
1221
+ if (r !== c)
1222
+ throw new Error(`Expected ${c} but got ${r}`);
1204
1223
  },
1205
1224
  be: {
1206
- oneOf: (l) => {
1207
- if (!l.includes(c))
1208
- throw new Error(`Expected ${c} to be one of ${l}`);
1225
+ oneOf: (c) => {
1226
+ if (!c.includes(r))
1227
+ throw new Error(`Expected ${r} to be one of ${c}`);
1209
1228
  }
1210
1229
  },
1211
1230
  have: {
1212
- property: (l) => {
1213
- if (typeof c != "object" || c === null || !(l in c))
1214
- throw new Error(`Expected object to have property ${l}`);
1231
+ property: (c) => {
1232
+ if (typeof r != "object" || r === null || !(c in r))
1233
+ throw new Error(`Expected object to have property ${c}`);
1215
1234
  }
1216
1235
  }
1217
1236
  }
@@ -1219,34 +1238,35 @@ function He(t, a) {
1219
1238
  };
1220
1239
  try {
1221
1240
  new Function("pm", t)(i);
1222
- } catch (c) {
1241
+ } catch (r) {
1223
1242
  o.push({
1224
1243
  name: "Script Error",
1225
1244
  passed: !1,
1226
- message: c.message,
1245
+ message: r.message,
1227
1246
  duration: 0
1228
1247
  });
1229
1248
  }
1230
1249
  return o;
1231
1250
  }
1232
- function fe({
1251
+ function Te({
1233
1252
  items: t,
1234
1253
  onChange: a,
1235
1254
  onAdd: o,
1236
- keyPlaceholder: i = "Key",
1237
- valuePlaceholder: c = "Value"
1255
+ keyPlaceholder: i,
1256
+ valuePlaceholder: r
1238
1257
  }) {
1258
+ const { t: c } = $(), l = i ?? c("apiTester.key", "Key"), d = r ?? c("apiTester.value", "Value");
1239
1259
  return /* @__PURE__ */ n("div", { className: "nice-api-tester__kv-editor", children: [
1240
- Object.entries(t).map(([l, d], p) => /* @__PURE__ */ n("div", { className: "nice-api-tester__kv-row", children: [
1260
+ Object.entries(t).map(([p, v], u) => /* @__PURE__ */ n("div", { className: "nice-api-tester__kv-row", children: [
1241
1261
  /* @__PURE__ */ e(
1242
1262
  "input",
1243
1263
  {
1244
1264
  type: "text",
1245
- value: l,
1246
- placeholder: i,
1247
- onChange: (g) => {
1248
- const u = Object.entries(t);
1249
- u[p] = [g.target.value, d], a(Object.fromEntries(u));
1265
+ value: p,
1266
+ placeholder: l,
1267
+ onChange: (N) => {
1268
+ const b = Object.entries(t);
1269
+ b[u] = [N.target.value, v], a(Object.fromEntries(b));
1250
1270
  }
1251
1271
  }
1252
1272
  ),
@@ -1254,32 +1274,33 @@ function fe({
1254
1274
  "input",
1255
1275
  {
1256
1276
  type: "text",
1257
- value: d,
1258
- placeholder: c,
1259
- onChange: (g) => a({ ...t, [l]: g.target.value })
1277
+ value: v,
1278
+ placeholder: d,
1279
+ onChange: (N) => a({ ...t, [p]: N.target.value })
1260
1280
  }
1261
1281
  ),
1262
1282
  /* @__PURE__ */ e(
1263
1283
  "button",
1264
1284
  {
1285
+ "aria-label": c("apiTester.close", "Close"),
1265
1286
  onClick: () => {
1266
- const { [l]: g, ...u } = t;
1267
- a(u);
1287
+ const { [p]: N, ...b } = t;
1288
+ a(b);
1268
1289
  },
1269
- children: "×"
1290
+ children: /* @__PURE__ */ e(B, { name: "close", size: 14 })
1270
1291
  }
1271
1292
  )
1272
- ] }, p)),
1273
- /* @__PURE__ */ e("button", { onClick: o, className: "nice-api-tester__add-btn", children: "+ Add" })
1293
+ ] }, u)),
1294
+ /* @__PURE__ */ e("button", { onClick: o, className: "nice-api-tester__add-btn", children: c("apiTester.add", "+ Add") })
1274
1295
  ] });
1275
1296
  }
1276
- function Le({
1297
+ function Me({
1277
1298
  params: t,
1278
1299
  onChange: a,
1279
1300
  onAdd: o
1280
1301
  }) {
1281
1302
  return /* @__PURE__ */ e(
1282
- fe,
1303
+ Te,
1283
1304
  {
1284
1305
  items: t,
1285
1306
  onChange: a,
@@ -1289,13 +1310,13 @@ function Le({
1289
1310
  }
1290
1311
  );
1291
1312
  }
1292
- function Ue({
1313
+ function Le({
1293
1314
  headers: t,
1294
1315
  onChange: a,
1295
1316
  onAdd: o
1296
1317
  }) {
1297
1318
  return /* @__PURE__ */ e(
1298
- fe,
1319
+ Te,
1299
1320
  {
1300
1321
  items: t,
1301
1322
  onChange: a,
@@ -1305,12 +1326,13 @@ function Ue({
1305
1326
  }
1306
1327
  );
1307
1328
  }
1308
- function Me({
1329
+ function Ve({
1309
1330
  body: t,
1310
1331
  bodyTab: a,
1311
1332
  onBodyTabChange: o,
1312
1333
  onChange: i
1313
1334
  }) {
1335
+ const { t: r } = $();
1314
1336
  return /* @__PURE__ */ n("div", { className: "nice-api-tester__body-editor", children: [
1315
1337
  /* @__PURE__ */ e("div", { className: "nice-api-tester__body-tabs", children: ["none", "json", "form-data", "raw"].map((c) => /* @__PURE__ */ n("label", { children: [
1316
1338
  /* @__PURE__ */ e(
@@ -1330,76 +1352,77 @@ function Me({
1330
1352
  {
1331
1353
  value: typeof (t == null ? void 0 : t.content) == "string" ? t.content : JSON.stringify(t == null ? void 0 : t.content, null, 2),
1332
1354
  onChange: (c) => i({ type: a, content: c.target.value }),
1333
- placeholder: a === "json" ? '{ "key": "value" }' : "Enter body content",
1355
+ placeholder: a === "json" ? '{ "key": "value" }' : r("apiTester.enterBodyContent", "Enter body content"),
1334
1356
  rows: 10,
1335
1357
  className: "nice-api-tester__body-textarea"
1336
1358
  }
1337
1359
  )
1338
1360
  ] });
1339
1361
  }
1340
- function Be({
1362
+ function Fe({
1341
1363
  auth: t,
1342
1364
  onChange: a
1343
1365
  }) {
1344
- var o, i, c, l, d, p;
1366
+ var i, r, c, l, d, p;
1367
+ const { t: o } = $();
1345
1368
  return /* @__PURE__ */ n("div", { className: "nice-api-tester__auth-editor", children: [
1346
1369
  /* @__PURE__ */ n("div", { className: "nice-api-tester__field", children: [
1347
- /* @__PURE__ */ e("label", { children: "Type" }),
1370
+ /* @__PURE__ */ e("label", { children: o("apiTester.type", "Type") }),
1348
1371
  /* @__PURE__ */ n(
1349
1372
  "select",
1350
1373
  {
1351
1374
  value: (t == null ? void 0 : t.type) || "none",
1352
- onChange: (g) => a({ type: g.target.value }),
1375
+ onChange: (v) => a({ type: v.target.value }),
1353
1376
  children: [
1354
- /* @__PURE__ */ e("option", { value: "none", children: "No Auth" }),
1355
- /* @__PURE__ */ e("option", { value: "api-key", children: "API Key" }),
1356
- /* @__PURE__ */ e("option", { value: "bearer", children: "Bearer Token" }),
1357
- /* @__PURE__ */ e("option", { value: "basic", children: "Basic Auth" }),
1358
- /* @__PURE__ */ e("option", { value: "oauth2", children: "OAuth 2.0" })
1377
+ /* @__PURE__ */ e("option", { value: "none", children: o("apiTester.noAuth", "No Auth") }),
1378
+ /* @__PURE__ */ e("option", { value: "api-key", children: o("apiTester.apiKey", "API Key") }),
1379
+ /* @__PURE__ */ e("option", { value: "bearer", children: o("apiTester.bearerToken", "Bearer Token") }),
1380
+ /* @__PURE__ */ e("option", { value: "basic", children: o("apiTester.basicAuth", "Basic Auth") }),
1381
+ /* @__PURE__ */ e("option", { value: "oauth2", children: o("apiTester.oauth20", "OAuth 2.0") })
1359
1382
  ]
1360
1383
  }
1361
1384
  )
1362
1385
  ] }),
1363
- (t == null ? void 0 : t.type) === "api-key" && /* @__PURE__ */ n(B, { children: [
1386
+ (t == null ? void 0 : t.type) === "api-key" && /* @__PURE__ */ n(Q, { children: [
1364
1387
  /* @__PURE__ */ n("div", { className: "nice-api-tester__field", children: [
1365
- /* @__PURE__ */ e("label", { children: "Key" }),
1388
+ /* @__PURE__ */ e("label", { children: o("apiTester.key", "Key") }),
1366
1389
  /* @__PURE__ */ e(
1367
1390
  "input",
1368
1391
  {
1369
1392
  type: "text",
1370
- value: ((o = t.apiKey) == null ? void 0 : o.key) || "",
1371
- onChange: (g) => {
1372
- var u, f;
1393
+ value: ((i = t.apiKey) == null ? void 0 : i.key) || "",
1394
+ onChange: (v) => {
1395
+ var u, N;
1373
1396
  return a({
1374
1397
  ...t,
1375
1398
  apiKey: {
1376
1399
  ...t.apiKey,
1377
- key: g.target.value,
1400
+ key: v.target.value,
1378
1401
  value: ((u = t.apiKey) == null ? void 0 : u.value) || "",
1379
- in: ((f = t.apiKey) == null ? void 0 : f.in) || "header"
1402
+ in: ((N = t.apiKey) == null ? void 0 : N.in) || "header"
1380
1403
  }
1381
1404
  });
1382
1405
  },
1383
- placeholder: "X-API-Key"
1406
+ placeholder: o("apiTester.xApiKey", "X-API-Key")
1384
1407
  }
1385
1408
  )
1386
1409
  ] }),
1387
1410
  /* @__PURE__ */ n("div", { className: "nice-api-tester__field", children: [
1388
- /* @__PURE__ */ e("label", { children: "Value" }),
1411
+ /* @__PURE__ */ e("label", { children: o("apiTester.value", "Value") }),
1389
1412
  /* @__PURE__ */ e(
1390
1413
  "input",
1391
1414
  {
1392
1415
  type: "text",
1393
- value: ((i = t.apiKey) == null ? void 0 : i.value) || "",
1394
- onChange: (g) => {
1395
- var u, f;
1416
+ value: ((r = t.apiKey) == null ? void 0 : r.value) || "",
1417
+ onChange: (v) => {
1418
+ var u, N;
1396
1419
  return a({
1397
1420
  ...t,
1398
1421
  apiKey: {
1399
1422
  ...t.apiKey,
1400
- value: g.target.value,
1423
+ value: v.target.value,
1401
1424
  key: ((u = t.apiKey) == null ? void 0 : u.key) || "",
1402
- in: ((f = t.apiKey) == null ? void 0 : f.in) || "header"
1425
+ in: ((N = t.apiKey) == null ? void 0 : N.in) || "header"
1403
1426
  }
1404
1427
  });
1405
1428
  },
@@ -1408,58 +1431,58 @@ function Be({
1408
1431
  )
1409
1432
  ] }),
1410
1433
  /* @__PURE__ */ n("div", { className: "nice-api-tester__field", children: [
1411
- /* @__PURE__ */ e("label", { children: "Add to" }),
1434
+ /* @__PURE__ */ e("label", { children: o("apiTester.addTo", "Add to") }),
1412
1435
  /* @__PURE__ */ n(
1413
1436
  "select",
1414
1437
  {
1415
1438
  value: ((c = t.apiKey) == null ? void 0 : c.in) || "header",
1416
- onChange: (g) => {
1417
- var u, f;
1439
+ onChange: (v) => {
1440
+ var u, N;
1418
1441
  return a({
1419
1442
  ...t,
1420
1443
  apiKey: {
1421
1444
  ...t.apiKey,
1422
- in: g.target.value,
1445
+ in: v.target.value,
1423
1446
  key: ((u = t.apiKey) == null ? void 0 : u.key) || "",
1424
- value: ((f = t.apiKey) == null ? void 0 : f.value) || ""
1447
+ value: ((N = t.apiKey) == null ? void 0 : N.value) || ""
1425
1448
  }
1426
1449
  });
1427
1450
  },
1428
1451
  children: [
1429
- /* @__PURE__ */ e("option", { value: "header", children: "Header" }),
1430
- /* @__PURE__ */ e("option", { value: "query", children: "Query Params" })
1452
+ /* @__PURE__ */ e("option", { value: "header", children: o("apiTester.header", "Header") }),
1453
+ /* @__PURE__ */ e("option", { value: "query", children: o("apiTester.queryParams", "Query Params") })
1431
1454
  ]
1432
1455
  }
1433
1456
  )
1434
1457
  ] })
1435
1458
  ] }),
1436
1459
  (t == null ? void 0 : t.type) === "bearer" && /* @__PURE__ */ n("div", { className: "nice-api-tester__field", children: [
1437
- /* @__PURE__ */ e("label", { children: "Token" }),
1460
+ /* @__PURE__ */ e("label", { children: o("apiTester.token", "Token") }),
1438
1461
  /* @__PURE__ */ e(
1439
1462
  "input",
1440
1463
  {
1441
1464
  type: "text",
1442
1465
  value: ((l = t.bearer) == null ? void 0 : l.token) || "",
1443
- onChange: (g) => a({ ...t, bearer: { token: g.target.value } }),
1466
+ onChange: (v) => a({ ...t, bearer: { token: v.target.value } }),
1444
1467
  placeholder: "your-bearer-token"
1445
1468
  }
1446
1469
  )
1447
1470
  ] }),
1448
- (t == null ? void 0 : t.type) === "basic" && /* @__PURE__ */ n(B, { children: [
1471
+ (t == null ? void 0 : t.type) === "basic" && /* @__PURE__ */ n(Q, { children: [
1449
1472
  /* @__PURE__ */ n("div", { className: "nice-api-tester__field", children: [
1450
- /* @__PURE__ */ e("label", { children: "Username" }),
1473
+ /* @__PURE__ */ e("label", { children: o("apiTester.username", "Username") }),
1451
1474
  /* @__PURE__ */ e(
1452
1475
  "input",
1453
1476
  {
1454
1477
  type: "text",
1455
1478
  value: ((d = t.basic) == null ? void 0 : d.username) || "",
1456
- onChange: (g) => {
1479
+ onChange: (v) => {
1457
1480
  var u;
1458
1481
  return a({
1459
1482
  ...t,
1460
1483
  basic: {
1461
1484
  ...t.basic,
1462
- username: g.target.value,
1485
+ username: v.target.value,
1463
1486
  password: ((u = t.basic) == null ? void 0 : u.password) || ""
1464
1487
  }
1465
1488
  });
@@ -1468,19 +1491,19 @@ function Be({
1468
1491
  )
1469
1492
  ] }),
1470
1493
  /* @__PURE__ */ n("div", { className: "nice-api-tester__field", children: [
1471
- /* @__PURE__ */ e("label", { children: "Password" }),
1494
+ /* @__PURE__ */ e("label", { children: o("apiTester.password", "Password") }),
1472
1495
  /* @__PURE__ */ e(
1473
1496
  "input",
1474
1497
  {
1475
1498
  type: "password",
1476
1499
  value: ((p = t.basic) == null ? void 0 : p.password) || "",
1477
- onChange: (g) => {
1500
+ onChange: (v) => {
1478
1501
  var u;
1479
1502
  return a({
1480
1503
  ...t,
1481
1504
  basic: {
1482
1505
  ...t.basic,
1483
- password: g.target.value,
1506
+ password: v.target.value,
1484
1507
  username: ((u = t.basic) == null ? void 0 : u.username) || ""
1485
1508
  }
1486
1509
  });
@@ -1491,15 +1514,16 @@ function Be({
1491
1514
  ] })
1492
1515
  ] });
1493
1516
  }
1494
- function Ve({
1517
+ function Je({
1495
1518
  preRequestScript: t,
1496
1519
  testScript: a,
1497
1520
  onPreRequestChange: o,
1498
1521
  onTestChange: i
1499
1522
  }) {
1523
+ const { t: r } = $();
1500
1524
  return /* @__PURE__ */ n("div", { className: "nice-api-tester__tests-editor", children: [
1501
1525
  /* @__PURE__ */ n("div", { className: "nice-api-tester__script-section", children: [
1502
- /* @__PURE__ */ e("h4", { children: "Pre-request Script" }),
1526
+ /* @__PURE__ */ e("h4", { children: r("apiTester.preRequestScript", "Pre-request Script") }),
1503
1527
  /* @__PURE__ */ e(
1504
1528
  "textarea",
1505
1529
  {
@@ -1511,7 +1535,7 @@ function Ve({
1511
1535
  )
1512
1536
  ] }),
1513
1537
  /* @__PURE__ */ n("div", { className: "nice-api-tester__script-section", children: [
1514
- /* @__PURE__ */ e("h4", { children: "Tests" }),
1538
+ /* @__PURE__ */ e("h4", { children: r("apiTester.tests", "Tests") }),
1515
1539
  /* @__PURE__ */ e(
1516
1540
  "textarea",
1517
1541
  {
@@ -1526,7 +1550,7 @@ function Ve({
1526
1550
  ] })
1527
1551
  ] });
1528
1552
  }
1529
- const Fe = [
1553
+ const We = [
1530
1554
  {
1531
1555
  target: ".nice-integration-builder",
1532
1556
  titleKey: "tutorial.integrationBuilder.intro.title",
@@ -1535,7 +1559,7 @@ const Fe = [
1535
1559
  content: "Wire a flow of nodes (triggers → actions → error handling) and connect them to build an integration.",
1536
1560
  placement: "auto"
1537
1561
  }
1538
- ], pe = [
1562
+ ], me = [
1539
1563
  { type: "trigger", label: "Trigger", icon: "zap", category: "Control" },
1540
1564
  { type: "http-request", label: "HTTP Request", icon: "globe", category: "Actions" },
1541
1565
  { type: "transform", label: "Transform", icon: "shuffle", category: "Data" },
@@ -1549,7 +1573,7 @@ const Fe = [
1549
1573
  { type: "webhook", label: "Webhook", icon: "link", category: "Actions" },
1550
1574
  { type: "function", label: "Function", icon: "code", category: "Actions" },
1551
1575
  { type: "error-handler", label: "Error Handler", icon: "warning", category: "Control" }
1552
- ], Je = {
1576
+ ], Ge = {
1553
1577
  id: "",
1554
1578
  name: "New Flow",
1555
1579
  nodes: [],
@@ -1558,125 +1582,125 @@ const Fe = [
1558
1582
  triggers: [],
1559
1583
  errorHandling: { strategy: "stop" }
1560
1584
  };
1561
- function ot({
1585
+ function lt({
1562
1586
  flow: t,
1563
1587
  connectors: a = [],
1564
1588
  onChange: o,
1565
1589
  onSave: i,
1566
- onRun: c,
1567
- className: l = "",
1568
- tutorial: d
1590
+ onRun: r,
1591
+ className: c = "",
1592
+ tutorial: l
1569
1593
  }) {
1570
- const [p, g] = k(
1571
- t || { ...Je, id: ee() }
1572
- ), [u, f] = k(null), [_, b] = k(!0), [N, m] = k("canvas"), [T, y] = k(!1), [A, U] = k(null), [F, R] = k(!1), [O, q] = k(null), [H, M] = k(!1), w = ue(null), v = I(
1594
+ const { t: d } = $(), [p, v] = C(
1595
+ t || { ...Ge, id: re() }
1596
+ ), [u, N] = C(null), [b, y] = C(!0), [T, m] = C("canvas"), [S, w] = C(!1), [A, J] = C(null), [te, z] = C(!1), [M, O] = C(null), [V, G] = C(!1), k = de(null), f = I(
1573
1597
  (h) => {
1574
- g((s) => {
1575
- const r = h(s);
1576
- return o == null || o(r), r;
1598
+ v((s) => {
1599
+ const g = h(s);
1600
+ return o == null || o(g), g;
1577
1601
  });
1578
1602
  },
1579
1603
  [o]
1580
1604
  ), x = I(
1581
1605
  (h, s) => {
1582
- var C;
1583
- const r = {
1584
- id: ee(),
1606
+ var P;
1607
+ const g = {
1608
+ id: re(),
1585
1609
  type: h,
1586
- name: ((C = pe.find((S) => S.type === h)) == null ? void 0 : C.label) || h,
1610
+ name: ((P = me.find((H) => H.type === h)) == null ? void 0 : P.label) || h,
1587
1611
  position: s,
1588
- config: We(h),
1612
+ config: Ye(h),
1589
1613
  inputs: h !== "trigger" ? ["input"] : [],
1590
1614
  outputs: ["output"]
1591
1615
  };
1592
- v((S) => ({
1593
- ...S,
1594
- nodes: [...S.nodes, r]
1595
- })), f(r);
1616
+ f((H) => ({
1617
+ ...H,
1618
+ nodes: [...H.nodes, g]
1619
+ })), N(g);
1596
1620
  },
1597
- [v]
1598
- ), D = I(
1621
+ [f]
1622
+ ), j = I(
1599
1623
  (h) => {
1600
- v((s) => ({
1624
+ f((s) => ({
1601
1625
  ...s,
1602
- nodes: s.nodes.filter((r) => r.id !== h),
1626
+ nodes: s.nodes.filter((g) => g.id !== h),
1603
1627
  connections: s.connections.filter(
1604
- (r) => r.sourceNodeId !== h && r.targetNodeId !== h
1628
+ (g) => g.sourceNodeId !== h && g.targetNodeId !== h
1605
1629
  )
1606
- })), f(null);
1630
+ })), N(null);
1607
1631
  },
1608
- [v]
1609
- ), L = I(
1632
+ [f]
1633
+ ), F = I(
1610
1634
  (h, s) => {
1611
- v((r) => ({
1612
- ...r,
1613
- nodes: r.nodes.map((C) => C.id === h ? { ...C, ...s } : C)
1614
- })), (u == null ? void 0 : u.id) === h && f((r) => r ? { ...r, ...s } : null);
1635
+ f((g) => ({
1636
+ ...g,
1637
+ nodes: g.nodes.map((P) => P.id === h ? { ...P, ...s } : P)
1638
+ })), (u == null ? void 0 : u.id) === h && N((g) => g ? { ...g, ...s } : null);
1615
1639
  },
1616
- [v, u]
1617
- ), $ = I(
1618
- (h, s, r, C) => {
1619
- h === r || p.connections.some(
1620
- (E) => E.sourceNodeId === h && E.targetNodeId === r && E.sourceOutput === s && E.targetInput === C
1621
- ) || v((E) => ({
1640
+ [f, u]
1641
+ ), R = I(
1642
+ (h, s, g, P) => {
1643
+ h === g || p.connections.some(
1644
+ (E) => E.sourceNodeId === h && E.targetNodeId === g && E.sourceOutput === s && E.targetInput === P
1645
+ ) || f((E) => ({
1622
1646
  ...E,
1623
1647
  connections: [
1624
1648
  ...E.connections,
1625
1649
  {
1626
- id: ee(),
1650
+ id: re(),
1627
1651
  sourceNodeId: h,
1628
1652
  sourceOutput: s,
1629
- targetNodeId: r,
1630
- targetInput: C
1653
+ targetNodeId: g,
1654
+ targetInput: P
1631
1655
  }
1632
1656
  ]
1633
1657
  }));
1634
1658
  },
1635
- [p.connections, v]
1636
- ), J = I(
1659
+ [p.connections, f]
1660
+ ), ie = I(
1637
1661
  (h) => {
1638
- v((s) => ({
1662
+ f((s) => ({
1639
1663
  ...s,
1640
- connections: s.connections.filter((r) => r.id !== h)
1664
+ connections: s.connections.filter((g) => g.id !== h)
1641
1665
  }));
1642
1666
  },
1643
- [v]
1644
- ), V = I(
1667
+ [f]
1668
+ ), K = I(
1645
1669
  (h) => {
1646
- if (h.preventDefault(), !A || !w.current)
1670
+ if (h.preventDefault(), !A || !k.current)
1647
1671
  return;
1648
- const s = w.current.getBoundingClientRect(), r = h.clientX - s.left, C = h.clientY - s.top;
1649
- x(A, { x: r, y: C }), y(!1), U(null);
1672
+ const s = k.current.getBoundingClientRect(), g = h.clientX - s.left, P = h.clientY - s.top;
1673
+ x(A, { x: g, y: P }), w(!1), J(null);
1650
1674
  },
1651
1675
  [A, x]
1652
1676
  ), Y = I(async () => {
1653
- if (c) {
1654
- M(!0);
1677
+ if (r) {
1678
+ G(!0);
1655
1679
  try {
1656
- await c(p);
1680
+ await r(p);
1657
1681
  } finally {
1658
- M(!1);
1682
+ G(!1);
1659
1683
  }
1660
1684
  }
1661
- }, [p, c]), W = I(() => {
1685
+ }, [p, r]), ne = I(() => {
1662
1686
  i == null || i(p);
1663
- }, [p, i]), X = _ && N === "canvas" ? /* @__PURE__ */ n("div", { className: "nice-integration-builder__palette", children: [
1664
- /* @__PURE__ */ e("h4", { children: "Nodes" }),
1687
+ }, [p, i]), Z = b && T === "canvas" ? /* @__PURE__ */ n("div", { className: "nice-integration-builder__palette", children: [
1688
+ /* @__PURE__ */ e("h4", { children: d("integrationBuilder.nodes", "Nodes") }),
1665
1689
  ["Control", "Actions", "Data"].map((h) => /* @__PURE__ */ n("div", { className: "nice-integration-builder__category", children: [
1666
1690
  /* @__PURE__ */ e("h5", { children: h }),
1667
- pe.filter((s) => s.category === h).map((s) => /* @__PURE__ */ n(
1691
+ me.filter((s) => s.category === h).map((s) => /* @__PURE__ */ n(
1668
1692
  "div",
1669
1693
  {
1670
1694
  className: "nice-integration-builder__palette-item",
1671
1695
  draggable: !0,
1672
1696
  onDragStart: () => {
1673
- y(!0), U(s.type);
1697
+ w(!0), J(s.type);
1674
1698
  },
1675
1699
  onDragEnd: () => {
1676
- y(!1), U(null);
1700
+ w(!1), J(null);
1677
1701
  },
1678
1702
  children: [
1679
- /* @__PURE__ */ e("span", { className: "nice-integration-builder__palette-icon", children: /* @__PURE__ */ e(Z, { name: s.icon, size: 14 }) }),
1703
+ /* @__PURE__ */ e("span", { className: "nice-integration-builder__palette-icon", children: /* @__PURE__ */ e(ee, { name: s.icon, size: 14 }) }),
1680
1704
  /* @__PURE__ */ e("span", { children: s.label })
1681
1705
  ]
1682
1706
  },
@@ -1684,45 +1708,45 @@ function ot({
1684
1708
  ))
1685
1709
  ] }, h)),
1686
1710
  a.length > 0 && /* @__PURE__ */ n("div", { className: "nice-integration-builder__category", children: [
1687
- /* @__PURE__ */ e("h5", { children: "Connectors" }),
1711
+ /* @__PURE__ */ e("h5", { children: d("integrationBuilder.connectors", "Connectors") }),
1688
1712
  a.map((h) => /* @__PURE__ */ n("div", { className: "nice-integration-builder__palette-item", children: [
1689
- /* @__PURE__ */ e("span", { className: "nice-integration-builder__palette-icon", children: /* @__PURE__ */ e(Z, { name: "plug", size: 14 }) }),
1713
+ /* @__PURE__ */ e("span", { className: "nice-integration-builder__palette-icon", children: /* @__PURE__ */ e(ee, { name: "plug", size: 14 }) }),
1690
1714
  /* @__PURE__ */ e("span", { children: h.name })
1691
1715
  ] }, h.id))
1692
1716
  ] })
1693
- ] }) : void 0, Q = u && N === "canvas" ? /* @__PURE__ */ e(
1694
- Ye,
1717
+ ] }) : void 0, ae = u && T === "canvas" ? /* @__PURE__ */ e(
1718
+ Qe,
1695
1719
  {
1696
1720
  node: u,
1697
- onChange: (h) => L(u.id, h),
1698
- onClose: () => f(null)
1721
+ onChange: (h) => F(u.id, h),
1722
+ onClose: () => N(null)
1699
1723
  }
1700
1724
  ) : void 0;
1701
1725
  return /* @__PURE__ */ n("div", { style: { position: "relative", height: "100%" }, children: [
1702
- d && /* @__PURE__ */ e("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ e(se, { steps: re(d, Fe) }) }),
1726
+ l && /* @__PURE__ */ e("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ e(ce, { steps: le(l, We) }) }),
1703
1727
  /* @__PURE__ */ n(
1704
- be,
1728
+ ye,
1705
1729
  {
1706
1730
  flush: !0,
1707
- className: `nice-integration-builder ${l}`,
1731
+ className: `nice-integration-builder ${c}`,
1708
1732
  height: "100%",
1709
1733
  style: { minHeight: 600 },
1710
- sidebar: X,
1711
- rightSidebar: Q,
1734
+ sidebar: Z,
1735
+ rightSidebar: ae,
1712
1736
  toolbar: /* @__PURE__ */ n("div", { className: "nice-integration-builder__toolbar", children: [
1713
1737
  /* @__PURE__ */ e(
1714
1738
  "input",
1715
1739
  {
1716
1740
  type: "text",
1717
1741
  value: p.name,
1718
- onChange: (h) => v((s) => ({ ...s, name: h.target.value })),
1742
+ onChange: (h) => f((s) => ({ ...s, name: h.target.value })),
1719
1743
  className: "nice-integration-builder__name-input"
1720
1744
  }
1721
1745
  ),
1722
1746
  /* @__PURE__ */ e("div", { className: "nice-integration-builder__tabs", children: ["canvas", "code", "variables", "settings"].map((h) => /* @__PURE__ */ e(
1723
1747
  "button",
1724
1748
  {
1725
- className: `nice-integration-builder__tab ${N === h ? "nice-integration-builder__tab--active" : ""}`,
1749
+ className: `nice-integration-builder__tab ${T === h ? "nice-integration-builder__tab--active" : ""}`,
1726
1750
  onClick: () => m(h),
1727
1751
  children: h.charAt(0).toUpperCase() + h.slice(1)
1728
1752
  },
@@ -1733,79 +1757,83 @@ function ot({
1733
1757
  "button",
1734
1758
  {
1735
1759
  onClick: Y,
1736
- disabled: H,
1760
+ disabled: V,
1737
1761
  className: "nice-integration-builder__run-btn",
1738
1762
  children: [
1739
- /* @__PURE__ */ e(Z, { name: H ? "clock" : "play", size: 14 }),
1763
+ /* @__PURE__ */ e(ee, { name: V ? "clock" : "play", size: 14 }),
1740
1764
  " ",
1741
- H ? "Running..." : "Run"
1765
+ V ? d("integrationBuilder.running", "Running...") : d("integrationBuilder.run", "Run")
1742
1766
  ]
1743
1767
  }
1744
1768
  ),
1745
- /* @__PURE__ */ n("button", { onClick: W, className: "nice-integration-builder__save-btn", children: [
1746
- /* @__PURE__ */ e(Z, { name: "save", size: 14 }),
1747
- " Save"
1769
+ /* @__PURE__ */ n("button", { onClick: ne, className: "nice-integration-builder__save-btn", children: [
1770
+ /* @__PURE__ */ e(ee, { name: "save", size: 14 }),
1771
+ " ",
1772
+ d("integrationBuilder.save", "Save")
1748
1773
  ] })
1749
1774
  ] })
1750
1775
  ] }),
1751
1776
  children: [
1752
- N === "canvas" && /* @__PURE__ */ n(
1777
+ T === "canvas" && /* @__PURE__ */ n(
1753
1778
  "div",
1754
1779
  {
1755
- ref: w,
1756
- className: `nice-integration-builder__canvas ${T ? "nice-integration-builder__canvas--dragging" : ""}`,
1780
+ ref: k,
1781
+ className: `nice-integration-builder__canvas ${S ? "nice-integration-builder__canvas--dragging" : ""}`,
1757
1782
  onDragOver: (h) => h.preventDefault(),
1758
- onDrop: V,
1759
- onClick: () => f(null),
1783
+ onDrop: K,
1784
+ onClick: () => N(null),
1760
1785
  children: [
1761
1786
  /* @__PURE__ */ e("svg", { className: "nice-integration-builder__connections", children: p.connections.map((h) => {
1762
- const s = p.nodes.find((G) => G.id === h.sourceNodeId), r = p.nodes.find((G) => G.id === h.targetNodeId);
1763
- if (!s || !r)
1787
+ const s = p.nodes.find((q) => q.id === h.sourceNodeId), g = p.nodes.find((q) => q.id === h.targetNodeId);
1788
+ if (!s || !g)
1764
1789
  return null;
1765
- const C = s.position.x + 150, S = s.position.y + 30, E = r.position.x, P = r.position.y + 30, ie = (C + E) / 2;
1766
- return /* @__PURE__ */ e("g", { onClick: () => J(h.id), children: /* @__PURE__ */ e(
1790
+ const P = s.position.x + 150, H = s.position.y + 30, E = g.position.x, _ = g.position.y + 30, D = (P + E) / 2;
1791
+ return /* @__PURE__ */ e("g", { onClick: () => ie(h.id), children: /* @__PURE__ */ e(
1767
1792
  "path",
1768
1793
  {
1769
- d: `M ${C} ${S} C ${ie} ${S}, ${ie} ${P}, ${E} ${P}`,
1794
+ d: `M ${P} ${H} C ${D} ${H}, ${D} ${_}, ${E} ${_}`,
1770
1795
  className: "nice-integration-builder__connection"
1771
1796
  }
1772
1797
  ) }, h.id);
1773
1798
  }) }),
1774
1799
  p.nodes.map((h) => /* @__PURE__ */ e(
1775
- Ge,
1800
+ Xe,
1776
1801
  {
1777
1802
  node: h,
1778
1803
  isSelected: (u == null ? void 0 : u.id) === h.id,
1779
- onSelect: () => f(h),
1780
- onDelete: () => D(h.id),
1781
- onPositionChange: (s) => L(h.id, { position: s }),
1804
+ onSelect: () => N(h),
1805
+ onDelete: () => j(h.id),
1806
+ onPositionChange: (s) => F(h.id, { position: s }),
1782
1807
  onStartConnection: (s) => {
1783
- R(!0), q({ nodeId: h.id, output: s });
1808
+ z(!0), O({ nodeId: h.id, output: s });
1784
1809
  },
1785
1810
  onEndConnection: (s) => {
1786
- O && $(O.nodeId, O.output, h.id, s), R(!1), q(null);
1811
+ M && R(M.nodeId, M.output, h.id, s), z(!1), O(null);
1787
1812
  }
1788
1813
  },
1789
1814
  h.id
1790
1815
  )),
1791
- p.nodes.length === 0 && /* @__PURE__ */ e("div", { className: "nice-integration-builder__empty", children: "Drag nodes from the palette to build your flow" })
1816
+ p.nodes.length === 0 && /* @__PURE__ */ e("div", { className: "nice-integration-builder__empty", children: d(
1817
+ "integrationBuilder.dragNodesFromThePalette",
1818
+ "Drag nodes from the palette to build your flow"
1819
+ ) })
1792
1820
  ]
1793
1821
  }
1794
1822
  ),
1795
- N === "code" && /* @__PURE__ */ e("div", { className: "nice-integration-builder__code-view", children: /* @__PURE__ */ e("pre", { children: JSON.stringify(p, null, 2) }) }),
1796
- N === "variables" && /* @__PURE__ */ e(
1797
- Xe,
1823
+ T === "code" && /* @__PURE__ */ e("div", { className: "nice-integration-builder__code-view", children: /* @__PURE__ */ e("pre", { children: JSON.stringify(p, null, 2) }) }),
1824
+ T === "variables" && /* @__PURE__ */ e(
1825
+ Ze,
1798
1826
  {
1799
1827
  variables: p.variables,
1800
- onChange: (h) => v((s) => ({ ...s, variables: h }))
1828
+ onChange: (h) => f((s) => ({ ...s, variables: h }))
1801
1829
  }
1802
1830
  ),
1803
- N === "settings" && /* @__PURE__ */ e(
1804
- Qe,
1831
+ T === "settings" && /* @__PURE__ */ e(
1832
+ et,
1805
1833
  {
1806
1834
  errorHandling: p.errorHandling,
1807
1835
  schedule: p.schedule,
1808
- onChange: (h, s) => v((r) => ({ ...r, errorHandling: h, schedule: s }))
1836
+ onChange: (h, s) => f((g) => ({ ...g, errorHandling: h, schedule: s }))
1809
1837
  }
1810
1838
  )
1811
1839
  ]
@@ -1813,7 +1841,7 @@ function ot({
1813
1841
  )
1814
1842
  ] });
1815
1843
  }
1816
- function We(t) {
1844
+ function Ye(t) {
1817
1845
  switch (t) {
1818
1846
  case "http-request":
1819
1847
  return { method: "GET", url: "", headers: {}, body: "" };
@@ -1844,57 +1872,58 @@ return input;` };
1844
1872
  return {};
1845
1873
  }
1846
1874
  }
1847
- function Ge({
1875
+ function Xe({
1848
1876
  node: t,
1849
1877
  isSelected: a,
1850
1878
  onSelect: o,
1851
1879
  onDelete: i,
1852
- onPositionChange: c,
1853
- onStartConnection: l,
1854
- onEndConnection: d
1880
+ onPositionChange: r,
1881
+ onStartConnection: c,
1882
+ onEndConnection: l
1855
1883
  }) {
1856
- const [p, g] = k(!1), [u, f] = k({ x: 0, y: 0 }), _ = ue(null), b = pe.find((m) => m.type === t.type), N = (m) => {
1857
- m.button === 0 && (m.stopPropagation(), g(!0), f({
1884
+ const { t: d } = $(), [p, v] = C(!1), [u, N] = C({ x: 0, y: 0 }), b = de(null), y = me.find((m) => m.type === t.type), T = (m) => {
1885
+ m.button === 0 && (m.stopPropagation(), v(!0), N({
1858
1886
  x: m.clientX - t.position.x,
1859
1887
  y: m.clientY - t.position.y
1860
1888
  }), o());
1861
1889
  };
1862
- return we(() => {
1890
+ return Ne(() => {
1863
1891
  if (!p)
1864
1892
  return;
1865
- const m = (y) => {
1866
- c({
1867
- x: y.clientX - u.x,
1868
- y: y.clientY - u.y
1893
+ const m = (w) => {
1894
+ r({
1895
+ x: w.clientX - u.x,
1896
+ y: w.clientY - u.y
1869
1897
  });
1870
- }, T = () => {
1871
- g(!1);
1898
+ }, S = () => {
1899
+ v(!1);
1872
1900
  };
1873
- return window.addEventListener("mousemove", m), window.addEventListener("mouseup", T), () => {
1874
- window.removeEventListener("mousemove", m), window.removeEventListener("mouseup", T);
1901
+ return window.addEventListener("mousemove", m), window.addEventListener("mouseup", S), () => {
1902
+ window.removeEventListener("mousemove", m), window.removeEventListener("mouseup", S);
1875
1903
  };
1876
- }, [p, u, c]), /* @__PURE__ */ n(
1904
+ }, [p, u, r]), /* @__PURE__ */ n(
1877
1905
  "div",
1878
1906
  {
1879
- ref: _,
1907
+ ref: b,
1880
1908
  className: `nice-integration-builder__node nice-integration-builder__node--${t.type} ${a ? "nice-integration-builder__node--selected" : ""}`,
1881
1909
  style: {
1882
1910
  left: t.position.x,
1883
1911
  top: t.position.y
1884
1912
  },
1885
- onMouseDown: N,
1913
+ onMouseDown: T,
1886
1914
  children: [
1887
1915
  /* @__PURE__ */ n("div", { className: "nice-integration-builder__node-header", children: [
1888
- /* @__PURE__ */ e("span", { className: "nice-integration-builder__node-icon", children: /* @__PURE__ */ e(Z, { name: (b == null ? void 0 : b.icon) || "box", size: 14 }) }),
1916
+ /* @__PURE__ */ e("span", { className: "nice-integration-builder__node-icon", children: /* @__PURE__ */ e(ee, { name: (y == null ? void 0 : y.icon) || "box", size: 14 }) }),
1889
1917
  /* @__PURE__ */ e("span", { className: "nice-integration-builder__node-name", children: t.name }),
1890
1918
  /* @__PURE__ */ e(
1891
1919
  "button",
1892
1920
  {
1921
+ "aria-label": d("integrationBuilder.close", "Close"),
1893
1922
  className: "nice-integration-builder__node-delete",
1894
1923
  onClick: (m) => {
1895
1924
  m.stopPropagation(), i();
1896
1925
  },
1897
- children: "×"
1926
+ children: /* @__PURE__ */ e(ee, { name: "close", size: 14 })
1898
1927
  }
1899
1928
  )
1900
1929
  ] }),
@@ -1902,7 +1931,7 @@ function Ge({
1902
1931
  "div",
1903
1932
  {
1904
1933
  className: "nice-integration-builder__port nice-integration-builder__port--input",
1905
- onMouseUp: () => d(m),
1934
+ onMouseUp: () => l(m),
1906
1935
  children: [
1907
1936
  /* @__PURE__ */ e("span", { className: "nice-integration-builder__port-dot" }),
1908
1937
  /* @__PURE__ */ e("span", { className: "nice-integration-builder__port-label", children: m })
@@ -1914,8 +1943,8 @@ function Ge({
1914
1943
  "div",
1915
1944
  {
1916
1945
  className: "nice-integration-builder__port nice-integration-builder__port--output",
1917
- onMouseDown: (T) => {
1918
- T.stopPropagation(), l(m);
1946
+ onMouseDown: (S) => {
1947
+ S.stopPropagation(), c(m);
1919
1948
  },
1920
1949
  children: [
1921
1950
  /* @__PURE__ */ e("span", { className: "nice-integration-builder__port-label", children: m }),
@@ -1928,37 +1957,38 @@ function Ge({
1928
1957
  }
1929
1958
  );
1930
1959
  }
1931
- function Ye({
1960
+ function Qe({
1932
1961
  node: t,
1933
1962
  onChange: a,
1934
1963
  onClose: o
1935
1964
  }) {
1965
+ const { t: i } = $();
1936
1966
  return /* @__PURE__ */ n("div", { className: "nice-integration-builder__properties", children: [
1937
1967
  /* @__PURE__ */ n("div", { className: "nice-integration-builder__properties-header", children: [
1938
1968
  /* @__PURE__ */ e("h4", { children: t.name }),
1939
- /* @__PURE__ */ e("button", { onClick: o, children: "×" })
1969
+ /* @__PURE__ */ e("button", { "aria-label": i("integrationBuilder.close", "Close"), onClick: o, children: /* @__PURE__ */ e(ee, { name: "close", size: 14 }) })
1940
1970
  ] }),
1941
1971
  /* @__PURE__ */ n("div", { className: "nice-integration-builder__properties-content", children: [
1942
1972
  /* @__PURE__ */ n("div", { className: "nice-integration-builder__field", children: [
1943
- /* @__PURE__ */ e("label", { children: "Name" }),
1973
+ /* @__PURE__ */ e("label", { children: i("integrationBuilder.name", "Name") }),
1944
1974
  /* @__PURE__ */ e(
1945
1975
  "input",
1946
1976
  {
1947
1977
  type: "text",
1948
1978
  value: t.name,
1949
- onChange: (i) => a({ name: i.target.value })
1979
+ onChange: (r) => a({ name: r.target.value })
1950
1980
  }
1951
1981
  )
1952
1982
  ] }),
1953
- t.type === "http-request" && /* @__PURE__ */ n(B, { children: [
1983
+ t.type === "http-request" && /* @__PURE__ */ n(Q, { children: [
1954
1984
  /* @__PURE__ */ n("div", { className: "nice-integration-builder__field", children: [
1955
- /* @__PURE__ */ e("label", { children: "Method" }),
1985
+ /* @__PURE__ */ e("label", { children: i("integrationBuilder.method", "Method") }),
1956
1986
  /* @__PURE__ */ e(
1957
1987
  "select",
1958
1988
  {
1959
1989
  value: t.config.method || "GET",
1960
- onChange: (i) => a({ config: { ...t.config, method: i.target.value } }),
1961
- children: ["GET", "POST", "PUT", "PATCH", "DELETE"].map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
1990
+ onChange: (r) => a({ config: { ...t.config, method: r.target.value } }),
1991
+ children: ["GET", "POST", "PUT", "PATCH", "DELETE"].map((r) => /* @__PURE__ */ e("option", { value: r, children: r }, r))
1962
1992
  }
1963
1993
  )
1964
1994
  ] }),
@@ -1969,89 +1999,89 @@ function Ye({
1969
1999
  {
1970
2000
  type: "text",
1971
2001
  value: t.config.url || "",
1972
- onChange: (i) => a({ config: { ...t.config, url: i.target.value } }),
2002
+ onChange: (r) => a({ config: { ...t.config, url: r.target.value } }),
1973
2003
  placeholder: "https://api.example.com/endpoint"
1974
2004
  }
1975
2005
  )
1976
2006
  ] })
1977
2007
  ] }),
1978
2008
  t.type === "delay" && /* @__PURE__ */ n("div", { className: "nice-integration-builder__field", children: [
1979
- /* @__PURE__ */ e("label", { children: "Duration (ms)" }),
2009
+ /* @__PURE__ */ e("label", { children: i("integrationBuilder.durationMs", "Duration (ms)") }),
1980
2010
  /* @__PURE__ */ e(
1981
2011
  "input",
1982
2012
  {
1983
2013
  type: "number",
1984
2014
  value: t.config.duration || 1e3,
1985
- onChange: (i) => a({ config: { ...t.config, duration: parseInt(i.target.value, 10) } })
2015
+ onChange: (r) => a({ config: { ...t.config, duration: parseInt(r.target.value, 10) } })
1986
2016
  }
1987
2017
  )
1988
2018
  ] }),
1989
- t.type === "set-variable" && /* @__PURE__ */ n(B, { children: [
2019
+ t.type === "set-variable" && /* @__PURE__ */ n(Q, { children: [
1990
2020
  /* @__PURE__ */ n("div", { className: "nice-integration-builder__field", children: [
1991
- /* @__PURE__ */ e("label", { children: "Variable Name" }),
2021
+ /* @__PURE__ */ e("label", { children: i("integrationBuilder.variableName", "Variable Name") }),
1992
2022
  /* @__PURE__ */ e(
1993
2023
  "input",
1994
2024
  {
1995
2025
  type: "text",
1996
2026
  value: t.config.name || "",
1997
- onChange: (i) => a({ config: { ...t.config, name: i.target.value } })
2027
+ onChange: (r) => a({ config: { ...t.config, name: r.target.value } })
1998
2028
  }
1999
2029
  )
2000
2030
  ] }),
2001
2031
  /* @__PURE__ */ n("div", { className: "nice-integration-builder__field", children: [
2002
- /* @__PURE__ */ e("label", { children: "Value" }),
2032
+ /* @__PURE__ */ e("label", { children: i("integrationBuilder.value", "Value") }),
2003
2033
  /* @__PURE__ */ e(
2004
2034
  "input",
2005
2035
  {
2006
2036
  type: "text",
2007
2037
  value: t.config.value || "",
2008
- onChange: (i) => a({ config: { ...t.config, value: i.target.value } })
2038
+ onChange: (r) => a({ config: { ...t.config, value: r.target.value } })
2009
2039
  }
2010
2040
  )
2011
2041
  ] })
2012
2042
  ] }),
2013
2043
  t.type === "function" && /* @__PURE__ */ n("div", { className: "nice-integration-builder__field", children: [
2014
- /* @__PURE__ */ e("label", { children: "Code" }),
2044
+ /* @__PURE__ */ e("label", { children: i("integrationBuilder.code", "Code") }),
2015
2045
  /* @__PURE__ */ e(
2016
2046
  "textarea",
2017
2047
  {
2018
2048
  value: t.config.code || "",
2019
- onChange: (i) => a({ config: { ...t.config, code: i.target.value } }),
2049
+ onChange: (r) => a({ config: { ...t.config, code: r.target.value } }),
2020
2050
  rows: 10,
2021
2051
  className: "nice-integration-builder__code-input"
2022
2052
  }
2023
2053
  )
2024
2054
  ] }),
2025
- t.type === "email" && /* @__PURE__ */ n(B, { children: [
2055
+ t.type === "email" && /* @__PURE__ */ n(Q, { children: [
2026
2056
  /* @__PURE__ */ n("div", { className: "nice-integration-builder__field", children: [
2027
- /* @__PURE__ */ e("label", { children: "To" }),
2057
+ /* @__PURE__ */ e("label", { children: i("integrationBuilder.to", "To") }),
2028
2058
  /* @__PURE__ */ e(
2029
2059
  "input",
2030
2060
  {
2031
2061
  type: "text",
2032
2062
  value: t.config.to || "",
2033
- onChange: (i) => a({ config: { ...t.config, to: i.target.value } })
2063
+ onChange: (r) => a({ config: { ...t.config, to: r.target.value } })
2034
2064
  }
2035
2065
  )
2036
2066
  ] }),
2037
2067
  /* @__PURE__ */ n("div", { className: "nice-integration-builder__field", children: [
2038
- /* @__PURE__ */ e("label", { children: "Subject" }),
2068
+ /* @__PURE__ */ e("label", { children: i("integrationBuilder.subject", "Subject") }),
2039
2069
  /* @__PURE__ */ e(
2040
2070
  "input",
2041
2071
  {
2042
2072
  type: "text",
2043
2073
  value: t.config.subject || "",
2044
- onChange: (i) => a({ config: { ...t.config, subject: i.target.value } })
2074
+ onChange: (r) => a({ config: { ...t.config, subject: r.target.value } })
2045
2075
  }
2046
2076
  )
2047
2077
  ] }),
2048
2078
  /* @__PURE__ */ n("div", { className: "nice-integration-builder__field", children: [
2049
- /* @__PURE__ */ e("label", { children: "Body" }),
2079
+ /* @__PURE__ */ e("label", { children: i("integrationBuilder.body", "Body") }),
2050
2080
  /* @__PURE__ */ e(
2051
2081
  "textarea",
2052
2082
  {
2053
2083
  value: t.config.body || "",
2054
- onChange: (i) => a({ config: { ...t.config, body: i.target.value } }),
2084
+ onChange: (r) => a({ config: { ...t.config, body: r.target.value } }),
2055
2085
  rows: 5
2056
2086
  }
2057
2087
  )
@@ -2060,23 +2090,23 @@ function Ye({
2060
2090
  ] })
2061
2091
  ] });
2062
2092
  }
2063
- function Xe({ variables: t, onChange: a }) {
2064
- const o = () => {
2093
+ function Ze({ variables: t, onChange: a }) {
2094
+ const { t: o } = $(), i = () => {
2065
2095
  a({ ...t, newVariable: "" });
2066
2096
  };
2067
2097
  return /* @__PURE__ */ n("div", { className: "nice-integration-builder__variables", children: [
2068
- /* @__PURE__ */ e("h4", { children: "Flow Variables" }),
2069
- /* @__PURE__ */ e("div", { className: "nice-integration-builder__variables-list", children: Object.entries(t).map(([i, c]) => /* @__PURE__ */ n("div", { className: "nice-integration-builder__variable-row", children: [
2098
+ /* @__PURE__ */ e("h4", { children: o("integrationBuilder.flowVariables", "Flow Variables") }),
2099
+ /* @__PURE__ */ e("div", { className: "nice-integration-builder__variables-list", children: Object.entries(t).map(([r, c]) => /* @__PURE__ */ n("div", { className: "nice-integration-builder__variable-row", children: [
2070
2100
  /* @__PURE__ */ e(
2071
2101
  "input",
2072
2102
  {
2073
2103
  type: "text",
2074
- value: i,
2104
+ value: r,
2075
2105
  onChange: (l) => {
2076
- const { [i]: d, ...p } = t;
2106
+ const { [r]: d, ...p } = t;
2077
2107
  a({ ...p, [l.target.value]: c });
2078
2108
  },
2079
- placeholder: "Name"
2109
+ placeholder: o("integrationBuilder.name", "Name")
2080
2110
  }
2081
2111
  ),
2082
2112
  /* @__PURE__ */ e(
@@ -2084,100 +2114,102 @@ function Xe({ variables: t, onChange: a }) {
2084
2114
  {
2085
2115
  type: "text",
2086
2116
  value: String(c),
2087
- onChange: (l) => a({ ...t, [i]: l.target.value }),
2088
- placeholder: "Value"
2117
+ onChange: (l) => a({ ...t, [r]: l.target.value }),
2118
+ placeholder: o("integrationBuilder.value", "Value")
2089
2119
  }
2090
2120
  ),
2091
2121
  /* @__PURE__ */ e(
2092
2122
  "button",
2093
2123
  {
2124
+ "aria-label": o("integrationBuilder.close", "Close"),
2094
2125
  onClick: () => {
2095
- const { [i]: l, ...d } = t;
2126
+ const { [r]: l, ...d } = t;
2096
2127
  a(d);
2097
2128
  },
2098
- children: "×"
2129
+ children: /* @__PURE__ */ e(ee, { name: "close", size: 14 })
2099
2130
  }
2100
2131
  )
2101
- ] }, i)) }),
2102
- /* @__PURE__ */ e("button", { onClick: o, children: "+ Add Variable" })
2132
+ ] }, r)) }),
2133
+ /* @__PURE__ */ e("button", { onClick: i, children: o("integrationBuilder.addVariable", "+ Add Variable") })
2103
2134
  ] });
2104
2135
  }
2105
- function Qe({
2136
+ function et({
2106
2137
  errorHandling: t,
2107
2138
  schedule: a,
2108
2139
  onChange: o
2109
2140
  }) {
2141
+ const { t: i } = $();
2110
2142
  return /* @__PURE__ */ n("div", { className: "nice-integration-builder__settings", children: [
2111
- /* @__PURE__ */ e("h4", { children: "Error Handling" }),
2143
+ /* @__PURE__ */ e("h4", { children: i("integrationBuilder.errorHandling", "Error Handling") }),
2112
2144
  /* @__PURE__ */ n("div", { className: "nice-integration-builder__field", children: [
2113
- /* @__PURE__ */ e("label", { children: "Strategy" }),
2145
+ /* @__PURE__ */ e("label", { children: i("integrationBuilder.strategy", "Strategy") }),
2114
2146
  /* @__PURE__ */ n(
2115
2147
  "select",
2116
2148
  {
2117
2149
  value: t.strategy,
2118
- onChange: (i) => o(
2119
- { ...t, strategy: i.target.value },
2150
+ onChange: (r) => o(
2151
+ { ...t, strategy: r.target.value },
2120
2152
  a
2121
2153
  ),
2122
2154
  children: [
2123
- /* @__PURE__ */ e("option", { value: "stop", children: "Stop on error" }),
2124
- /* @__PURE__ */ e("option", { value: "continue", children: "Continue on error" }),
2125
- /* @__PURE__ */ e("option", { value: "retry", children: "Retry on error" })
2155
+ /* @__PURE__ */ e("option", { value: "stop", children: i("integrationBuilder.stopOnError", "Stop on error") }),
2156
+ /* @__PURE__ */ e("option", { value: "continue", children: i("integrationBuilder.continueOnError", "Continue on error") }),
2157
+ /* @__PURE__ */ e("option", { value: "retry", children: i("integrationBuilder.retryOnError", "Retry on error") })
2126
2158
  ]
2127
2159
  }
2128
2160
  )
2129
2161
  ] }),
2130
- t.strategy === "retry" && /* @__PURE__ */ n(B, { children: [
2162
+ t.strategy === "retry" && /* @__PURE__ */ n(Q, { children: [
2131
2163
  /* @__PURE__ */ n("div", { className: "nice-integration-builder__field", children: [
2132
- /* @__PURE__ */ e("label", { children: "Max Retries" }),
2164
+ /* @__PURE__ */ e("label", { children: i("integrationBuilder.maxRetries", "Max Retries") }),
2133
2165
  /* @__PURE__ */ e(
2134
2166
  "input",
2135
2167
  {
2136
2168
  type: "number",
2137
2169
  value: t.maxRetries || 3,
2138
- onChange: (i) => o({ ...t, maxRetries: parseInt(i.target.value, 10) }, a)
2170
+ onChange: (r) => o({ ...t, maxRetries: parseInt(r.target.value, 10) }, a)
2139
2171
  }
2140
2172
  )
2141
2173
  ] }),
2142
2174
  /* @__PURE__ */ n("div", { className: "nice-integration-builder__field", children: [
2143
- /* @__PURE__ */ e("label", { children: "Retry Delay (ms)" }),
2175
+ /* @__PURE__ */ e("label", { children: i("integrationBuilder.retryDelayMs", "Retry Delay (ms)") }),
2144
2176
  /* @__PURE__ */ e(
2145
2177
  "input",
2146
2178
  {
2147
2179
  type: "number",
2148
2180
  value: t.retryDelay || 1e3,
2149
- onChange: (i) => o({ ...t, retryDelay: parseInt(i.target.value, 10) }, a)
2181
+ onChange: (r) => o({ ...t, retryDelay: parseInt(r.target.value, 10) }, a)
2150
2182
  }
2151
2183
  )
2152
2184
  ] })
2153
2185
  ] }),
2154
- /* @__PURE__ */ e("h4", { children: "Schedule" }),
2186
+ /* @__PURE__ */ e("h4", { children: i("integrationBuilder.schedule", "Schedule") }),
2155
2187
  /* @__PURE__ */ e("div", { className: "nice-integration-builder__field", children: /* @__PURE__ */ n("label", { children: [
2156
2188
  /* @__PURE__ */ e(
2157
2189
  "input",
2158
2190
  {
2159
2191
  type: "checkbox",
2160
2192
  checked: (a == null ? void 0 : a.enabled) || !1,
2161
- onChange: (i) => o(t, { ...a, enabled: i.target.checked })
2193
+ onChange: (r) => o(t, { ...a, enabled: r.target.checked })
2162
2194
  }
2163
2195
  ),
2164
- "Enable scheduled execution"
2196
+ i("integrationBuilder.enableScheduledExecution", "Enable scheduled execution")
2165
2197
  ] }) }),
2166
2198
  (a == null ? void 0 : a.enabled) && /* @__PURE__ */ n("div", { className: "nice-integration-builder__field", children: [
2167
- /* @__PURE__ */ e("label", { children: "Cron Expression" }),
2199
+ /* @__PURE__ */ e("label", { children: i("integrationBuilder.cronExpression", "Cron Expression") }),
2168
2200
  /* @__PURE__ */ e(
2169
2201
  "input",
2170
2202
  {
2171
2203
  type: "text",
2172
2204
  value: a.cron || "",
2173
- onChange: (i) => o(t, { ...a, cron: i.target.value }),
2205
+ onChange: (r) => o(t, { ...a, cron: r.target.value }),
2174
2206
  placeholder: "0 0 * * *"
2175
2207
  }
2176
2208
  )
2177
2209
  ] })
2178
2210
  ] });
2179
2211
  }
2180
- const Ze = [
2212
+ const tt = [
2181
2213
  {
2182
2214
  target: ".nice-webhook-tester",
2183
2215
  titleKey: "tutorial.webhookTester.intro.title",
@@ -2187,96 +2219,98 @@ const Ze = [
2187
2219
  placement: "auto"
2188
2220
  }
2189
2221
  ];
2190
- function ge(t) {
2222
+ function be(t) {
2191
2223
  return t ? Object.entries(t).map(([a, o]) => ({ key: a, value: o })) : [];
2192
2224
  }
2193
- function _e(t) {
2225
+ function ve(t) {
2194
2226
  const a = {};
2195
2227
  for (const o of t)
2196
2228
  o.key.trim() !== "" && (a[o.key] = o.value);
2197
2229
  return a;
2198
2230
  }
2199
- async function et(t, a) {
2200
- var d;
2201
- const o = (d = globalThis.crypto) == null ? void 0 : d.subtle;
2231
+ async function it(t, a) {
2232
+ var l;
2233
+ const o = (l = globalThis.crypto) == null ? void 0 : l.subtle;
2202
2234
  if (!o)
2203
2235
  throw new Error("Web Crypto (crypto.subtle) is unavailable in this environment");
2204
- const i = new TextEncoder(), c = await o.importKey(
2236
+ const i = new TextEncoder(), r = await o.importKey(
2205
2237
  "raw",
2206
2238
  i.encode(t),
2207
2239
  { name: "HMAC", hash: "SHA-256" },
2208
2240
  !1,
2209
2241
  ["sign"]
2210
- ), l = await o.sign("HMAC", c, i.encode(a));
2211
- return [...new Uint8Array(l)].map((p) => p.toString(16).padStart(2, "0")).join("");
2242
+ ), c = await o.sign("HMAC", r, i.encode(a));
2243
+ return [...new Uint8Array(c)].map((d) => d.toString(16).padStart(2, "0")).join("");
2212
2244
  }
2213
- const ct = Ce(
2245
+ const dt = /* @__PURE__ */ Ce(
2214
2246
  function(a, o) {
2215
- const {
2216
- url: i = "",
2247
+ const { t: i } = $(), {
2248
+ url: r = "",
2217
2249
  method: c = "POST",
2218
2250
  headers: l,
2219
2251
  payload: d = "",
2220
2252
  samples: p = [],
2221
- onSend: g,
2253
+ onSend: v,
2222
2254
  signing: u,
2223
- onSaveSample: f,
2224
- tutorial: _,
2225
- className: b,
2226
- style: N,
2255
+ onSaveSample: N,
2256
+ tutorial: b,
2257
+ className: y,
2258
+ style: T,
2227
2259
  id: m,
2228
- "data-testid": T
2229
- } = a, [y, A] = k(i), [U, F] = k(c), [R, O] = k(() => ge(l)), [q, H] = k(d), [M, w] = k(""), [v, x] = k(!1), [D, L] = k(null), [$, J] = k(null), V = ke(() => {
2230
- const r = /* @__PURE__ */ new Map();
2231
- for (const C of p)
2232
- r.set(C.id, C);
2233
- return r;
2234
- }, [p]), Y = (r) => {
2235
- w(r);
2236
- const C = V.get(r);
2237
- C && (H(C.payload), C.headers && O(ge(C.headers)));
2238
- }, W = (r, C) => {
2239
- O((S) => S.map((E, P) => P === r ? { ...E, ...C } : E));
2240
- }, X = async () => {
2241
- x(!0), L(null), J(null);
2260
+ "data-testid": S
2261
+ } = a, [w, A] = C(r), [J, te] = C(c), [z, M] = C(() => be(l)), [O, V] = C(d), [G, k] = C(""), [f, x] = C(!1), [j, F] = C(null), [R, ie] = C(null), [K, Y] = C(null), ne = de(null), Z = K !== null;
2262
+ Ne(() => {
2263
+ var _;
2264
+ Z && ((_ = ne.current) == null || _.focus());
2265
+ }, [Z]);
2266
+ const ae = Se(() => {
2267
+ const _ = /* @__PURE__ */ new Map();
2268
+ for (const D of p)
2269
+ _.set(D.id, D);
2270
+ return _;
2271
+ }, [p]), h = (_) => {
2272
+ k(_);
2273
+ const D = ae.get(_);
2274
+ D && (V(D.payload), D.headers && M(be(D.headers)));
2275
+ }, s = (_, D) => {
2276
+ M((q) => q.map((W, X) => X === _ ? { ...W, ...D } : W));
2277
+ }, g = async () => {
2278
+ x(!0), F(null), ie(null);
2242
2279
  try {
2243
- const r = _e(R);
2280
+ const _ = ve(z);
2244
2281
  if (u && u.secret) {
2245
- const P = await et(u.secret, q);
2246
- r[u.header] = `${u.prefix ?? ""}${P}`;
2282
+ const X = await it(u.secret, O);
2283
+ _[u.header] = `${u.prefix ?? ""}${X}`;
2247
2284
  }
2248
- const C = typeof performance < "u" ? performance.now() : Date.now(), S = await g({ url: y, method: U ?? "POST", headers: r, body: q }), E = Math.round(
2249
- (typeof performance < "u" ? performance.now() : Date.now()) - C
2285
+ const D = typeof performance < "u" ? performance.now() : Date.now(), q = await v({ url: w, method: J ?? "POST", headers: _, body: O }), W = Math.round(
2286
+ (typeof performance < "u" ? performance.now() : Date.now()) - D
2250
2287
  );
2251
- J({ ...S, durationMs: S.durationMs ?? E });
2252
- } catch (r) {
2253
- L(r instanceof Error ? r.message : String(r));
2288
+ ie({ ...q, durationMs: q.durationMs ?? W });
2289
+ } catch (_) {
2290
+ F(_ instanceof Error ? _.message : String(_));
2254
2291
  } finally {
2255
2292
  x(!1);
2256
2293
  }
2257
- }, Q = () => {
2258
- var C;
2259
- if (!f)
2260
- return;
2261
- const r = typeof window < "u" && ((C = window.prompt) == null ? void 0 : C.call(window, "Sample name")) || "";
2262
- r && f({
2294
+ }, P = () => {
2295
+ const _ = K == null ? void 0 : K.trim();
2296
+ !N || !_ || (N({
2263
2297
  id: `sample_${Date.now().toString(36)}`,
2264
- name: r,
2265
- payload: q,
2266
- headers: _e(R)
2267
- });
2268
- }, h = $ == null ? "" : $.status >= 200 && $.status < 300 ? " nice-webhook-tester__status--ok" : " nice-webhook-tester__status--error", s = "nice-webhook-tester" + (b ? ` ${b}` : "");
2269
- return /* @__PURE__ */ n("div", { ref: o, id: m, className: s, style: N, "data-testid": T, children: [
2270
- _ && /* @__PURE__ */ e("div", { className: "nice-webhook-tester__tutorial", children: /* @__PURE__ */ e(se, { steps: re(_, Ze) }) }),
2298
+ name: _,
2299
+ payload: O,
2300
+ headers: ve(z)
2301
+ }), Y(null));
2302
+ }, H = R == null ? "" : R.status >= 200 && R.status < 300 ? " nice-webhook-tester__status--ok" : " nice-webhook-tester__status--error", E = "nice-webhook-tester" + (y ? ` ${y}` : "");
2303
+ return /* @__PURE__ */ n("div", { ref: o, id: m, className: E, style: T, "data-testid": S, children: [
2304
+ b && /* @__PURE__ */ e("div", { className: "nice-webhook-tester__tutorial", children: /* @__PURE__ */ e(ce, { steps: le(b, tt) }) }),
2271
2305
  /* @__PURE__ */ n("div", { className: "nice-webhook-tester__bar", children: [
2272
2306
  /* @__PURE__ */ e(
2273
2307
  "select",
2274
2308
  {
2275
2309
  className: "nice-webhook-tester__method",
2276
- value: U,
2277
- onChange: (r) => F(r.target.value),
2278
- "aria-label": "Method",
2279
- children: ["POST", "PUT", "GET", "PATCH", "DELETE"].map((r) => /* @__PURE__ */ e("option", { value: r, children: r }, r))
2310
+ value: J,
2311
+ onChange: (_) => te(_.target.value),
2312
+ "aria-label": i("webhookTester.method", "Method"),
2313
+ children: ["POST", "PUT", "GET", "PATCH", "DELETE"].map((_) => /* @__PURE__ */ e("option", { value: _, children: _ }, _))
2280
2314
  }
2281
2315
  ),
2282
2316
  /* @__PURE__ */ e(
@@ -2284,10 +2318,10 @@ const ct = Ce(
2284
2318
  {
2285
2319
  type: "text",
2286
2320
  className: "nice-webhook-tester__url",
2287
- value: y,
2321
+ value: w,
2288
2322
  placeholder: "https://example.com/api/payments/stripe/webhook",
2289
- onChange: (r) => A(r.target.value),
2290
- "aria-label": "URL"
2323
+ onChange: (_) => A(_.target.value),
2324
+ "aria-label": i("webhookTester.url", "URL")
2291
2325
  }
2292
2326
  ),
2293
2327
  /* @__PURE__ */ e(
@@ -2295,108 +2329,147 @@ const ct = Ce(
2295
2329
  {
2296
2330
  type: "button",
2297
2331
  className: "nice-webhook-tester__send",
2298
- onClick: () => void X(),
2299
- disabled: v || y.trim() === "",
2300
- children: v ? "Sending…" : "Send"
2332
+ onClick: () => void g(),
2333
+ disabled: f || w.trim() === "",
2334
+ children: f ? i("webhookTester.sending", "Sending…") : i("webhookTester.send", "Send")
2301
2335
  }
2302
2336
  )
2303
2337
  ] }),
2304
2338
  p.length > 0 && /* @__PURE__ */ e("div", { className: "nice-webhook-tester__samples", children: /* @__PURE__ */ n("label", { children: [
2305
- "Sample:",
2339
+ i("webhookTester.sample", "Sample:"),
2306
2340
  " ",
2307
- /* @__PURE__ */ n("select", { value: M, onChange: (r) => Y(r.target.value), children: [
2308
- /* @__PURE__ */ e("option", { value: "", children: "— choose a saved payload —" }),
2309
- p.map((r) => /* @__PURE__ */ e("option", { value: r.id, children: r.name }, r.id))
2341
+ /* @__PURE__ */ n("select", { value: G, onChange: (_) => h(_.target.value), children: [
2342
+ /* @__PURE__ */ e("option", { value: "", children: i("webhookTester.chooseASavedPayload", "— choose a saved payload —") }),
2343
+ p.map((_) => /* @__PURE__ */ e("option", { value: _.id, children: _.name }, _.id))
2310
2344
  ] })
2311
2345
  ] }) }),
2312
2346
  /* @__PURE__ */ n("div", { className: "nice-webhook-tester__headers", children: [
2313
2347
  /* @__PURE__ */ n("div", { className: "nice-webhook-tester__section-label", children: [
2314
- "Headers",
2348
+ i("webhookTester.headers", "Headers"),
2315
2349
  u && /* @__PURE__ */ n("span", { className: "nice-webhook-tester__signed", children: [
2316
2350
  " ",
2317
- "· auto-signs ",
2351
+ i("webhookTester.autoSigns", "· auto-signs"),
2352
+ " ",
2318
2353
  /* @__PURE__ */ e("code", { children: u.header })
2319
2354
  ] })
2320
2355
  ] }),
2321
- R.map((r, C) => /* @__PURE__ */ n("div", { className: "nice-webhook-tester__header-row", children: [
2356
+ z.map((_, D) => /* @__PURE__ */ n("div", { className: "nice-webhook-tester__header-row", children: [
2322
2357
  /* @__PURE__ */ e(
2323
2358
  "input",
2324
2359
  {
2325
2360
  type: "text",
2326
- value: r.key,
2327
- placeholder: "Header",
2328
- onChange: (S) => W(C, { key: S.target.value }),
2329
- "aria-label": "Header name"
2361
+ value: _.key,
2362
+ placeholder: i("webhookTester.header", "Header"),
2363
+ onChange: (q) => s(D, { key: q.target.value }),
2364
+ "aria-label": i("webhookTester.headerName", "Header name")
2330
2365
  }
2331
2366
  ),
2332
2367
  /* @__PURE__ */ e(
2333
2368
  "input",
2334
2369
  {
2335
2370
  type: "text",
2336
- value: r.value,
2337
- placeholder: "Value",
2338
- onChange: (S) => W(C, { value: S.target.value }),
2339
- "aria-label": "Header value"
2371
+ value: _.value,
2372
+ placeholder: i("webhookTester.value", "Value"),
2373
+ onChange: (q) => s(D, { value: q.target.value }),
2374
+ "aria-label": i("webhookTester.headerValue", "Header value")
2340
2375
  }
2341
2376
  ),
2342
2377
  /* @__PURE__ */ e(
2343
2378
  "button",
2344
2379
  {
2345
2380
  type: "button",
2346
- onClick: () => O((S) => S.filter((E, P) => P !== C)),
2347
- "aria-label": "Remove header",
2348
- children: /* @__PURE__ */ e(z, { name: "close", size: 12 })
2381
+ onClick: () => M((q) => q.filter((W, X) => X !== D)),
2382
+ "aria-label": i("webhookTester.removeHeader", "Remove header"),
2383
+ children: /* @__PURE__ */ e(B, { name: "close", size: 12 })
2349
2384
  }
2350
2385
  )
2351
- ] }, C)),
2386
+ ] }, D)),
2352
2387
  /* @__PURE__ */ e(
2353
2388
  "button",
2354
2389
  {
2355
2390
  type: "button",
2356
2391
  className: "nice-webhook-tester__add-header",
2357
- onClick: () => O((r) => [...r, { key: "", value: "" }]),
2358
- children: "+ Header"
2392
+ onClick: () => M((_) => [..._, { key: "", value: "" }]),
2393
+ children: i("webhookTester.header2", "+ Header")
2359
2394
  }
2360
2395
  )
2361
2396
  ] }),
2362
2397
  /* @__PURE__ */ n("div", { className: "nice-webhook-tester__payload", children: [
2363
2398
  /* @__PURE__ */ n("div", { className: "nice-webhook-tester__section-label", children: [
2364
- "Payload",
2365
- f && /* @__PURE__ */ e("button", { type: "button", className: "nice-webhook-tester__save", onClick: Q, children: "Save as sample" })
2399
+ i("webhookTester.payload", "Payload"),
2400
+ N && /* @__PURE__ */ e(
2401
+ "button",
2402
+ {
2403
+ type: "button",
2404
+ className: "nice-webhook-tester__save",
2405
+ onClick: () => Y(""),
2406
+ "aria-expanded": Z,
2407
+ children: i("webhookTester.saveAsSample", "Save as sample")
2408
+ }
2409
+ )
2410
+ ] }),
2411
+ N && Z && /* @__PURE__ */ n("div", { className: "nice-webhook-tester__header-row", children: [
2412
+ /* @__PURE__ */ e(
2413
+ "input",
2414
+ {
2415
+ ref: ne,
2416
+ type: "text",
2417
+ value: K,
2418
+ placeholder: i("webhookTester.sampleNamePrompt", "Sample name"),
2419
+ "aria-label": i("webhookTester.sampleNamePrompt", "Sample name"),
2420
+ onChange: (_) => Y(_.target.value),
2421
+ onKeyDown: (_) => {
2422
+ _.key === "Enter" ? (_.preventDefault(), P()) : _.key === "Escape" && Y(null);
2423
+ }
2424
+ }
2425
+ ),
2426
+ /* @__PURE__ */ e("button", { type: "button", onClick: P, disabled: !K.trim(), children: i("save", "Save") }),
2427
+ /* @__PURE__ */ e(
2428
+ "button",
2429
+ {
2430
+ type: "button",
2431
+ onClick: () => Y(null),
2432
+ "aria-label": i("cancel", "Cancel"),
2433
+ children: /* @__PURE__ */ e(B, { name: "close", size: 12 })
2434
+ }
2435
+ )
2366
2436
  ] }),
2367
2437
  /* @__PURE__ */ e(
2368
2438
  "textarea",
2369
2439
  {
2370
2440
  className: "nice-webhook-tester__textarea",
2371
- value: q,
2441
+ value: O,
2372
2442
  spellCheck: !1,
2373
2443
  rows: 8,
2374
- placeholder: '{ "type": "payment.succeeded", "data": { ... } }',
2375
- onChange: (r) => H(r.target.value),
2376
- "aria-label": "Payload"
2444
+ placeholder: i(
2445
+ "webhookTester.typePaymentSucceededData",
2446
+ '{ "type": "payment.succeeded", "data": { ... } }'
2447
+ ),
2448
+ onChange: (_) => V(_.target.value),
2449
+ "aria-label": i("webhookTester.payload", "Payload")
2377
2450
  }
2378
2451
  )
2379
2452
  ] }),
2380
- D && /* @__PURE__ */ e("div", { className: "nice-webhook-tester__error", children: D }),
2381
- $ && /* @__PURE__ */ n("div", { className: "nice-webhook-tester__response", children: [
2453
+ j && /* @__PURE__ */ e("div", { className: "nice-webhook-tester__error", children: j }),
2454
+ R && /* @__PURE__ */ n("div", { className: "nice-webhook-tester__response", children: [
2382
2455
  /* @__PURE__ */ n("div", { className: "nice-webhook-tester__section-label", children: [
2383
- "Response",
2456
+ i("webhookTester.response", "Response"),
2384
2457
  " ",
2385
- /* @__PURE__ */ e("span", { className: "nice-webhook-tester__status" + h, children: $.status }),
2386
- $.durationMs != null && /* @__PURE__ */ n("span", { className: "nice-webhook-tester__time", children: [
2458
+ /* @__PURE__ */ e("span", { className: "nice-webhook-tester__status" + H, children: R.status }),
2459
+ R.durationMs != null && /* @__PURE__ */ n("span", { className: "nice-webhook-tester__time", children: [
2387
2460
  " · ",
2388
- $.durationMs,
2461
+ R.durationMs,
2389
2462
  " ms"
2390
2463
  ] })
2391
2464
  ] }),
2392
- $.body != null && /* @__PURE__ */ e("pre", { className: "nice-webhook-tester__response-body", children: $.body })
2465
+ R.body != null && /* @__PURE__ */ e("pre", { className: "nice-webhook-tester__response-body", children: R.body })
2393
2466
  ] })
2394
2467
  ] });
2395
2468
  }
2396
2469
  );
2397
2470
  export {
2398
- st as NiceAPIDesigner,
2399
- rt as NiceAPITester,
2400
- ot as NiceIntegrationBuilder,
2401
- ct as NiceWebhookTester
2471
+ ot as NiceAPIDesigner,
2472
+ ct as NiceAPITester,
2473
+ lt as NiceIntegrationBuilder,
2474
+ dt as NiceWebhookTester
2402
2475
  };