@kong-ui-public/monaco-editor 0.4.11-pr.2769.31aadbf56.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,49 +1,10 @@
1
- import { toValue as _, shallowRef as K, reactive as z, onMounted as $, onActivated as H, onBeforeUnmount as G, watch as j, defineComponent as U, resolveComponent as q, createBlock as E, openBlock as h, createSlots as J, withCtx as k, resolveDynamicComponent as Q, mergeModels as Y, useModel as Z, useTemplateRef as X, computed as T, createElementBlock as ee, normalizeClass as te, unref as d, createElementVNode as oe, renderSlot as F, createVNode as W, Transition as x, createCommentVNode as D } from "vue";
2
- import { ProgressIcon as re, CodeblockIcon as ae } from "@kong/icons";
3
- import * as M from "monaco-editor";
4
- import { createI18n as ne, i18nTComponent as ie } from "@kong-ui-public/i18n";
5
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
6
- const R = () => {
7
- };
8
- function se(o, t) {
9
- function e(...r) {
10
- return new Promise((n, i) => {
11
- Promise.resolve(o(() => t.apply(this, r), {
12
- fn: t,
13
- thisArg: this,
14
- args: r
15
- })).then(n).catch(i);
16
- });
17
- }
18
- return e;
19
- }
20
- function le(o, t = {}) {
21
- let e, r, n = R;
22
- const i = (l) => {
23
- clearTimeout(l), n(), n = R;
24
- };
25
- let s;
26
- return (l) => {
27
- const C = _(o), c = _(t.maxWait);
28
- return e && i(e), C <= 0 || c !== void 0 && c <= 0 ? (r && (i(r), r = void 0), Promise.resolve(l())) : new Promise((S, a) => {
29
- n = t.rejectOnCancel ? a : S, s = l, c && !r && (r = setTimeout(() => {
30
- e && i(e), r = void 0, S(s());
31
- }, c)), e = setTimeout(() => {
32
- r && i(r), r = void 0, S(l());
33
- }, C);
34
- });
35
- };
36
- }
37
- // @__NO_SIDE_EFFECTS__
38
- function ce(o, t = 200, e = {}) {
39
- return se(le(t, e), o);
40
- }
41
- function de(o) {
42
- var t;
43
- const e = _(o);
44
- return (t = e == null ? void 0 : e.$el) !== null && t !== void 0 ? t : e;
45
- }
46
- const ue = "'JetBrains Mono', Consolas, monospace", me = "12px", fe = "500", ge = "20px", ve = Object.freeze({
1
+ import { toValue as S, ref as B, reactive as D, onMounted as P, onActivated as U, onBeforeUnmount as V, watch as j, defineComponent as W, resolveComponent as K, createBlock as _, openBlock as y, createSlots as A, withCtx as b, resolveDynamicComponent as H, mergeModels as $, useModel as z, useTemplateRef as G, computed as M, createElementBlock as q, normalizeClass as J, unref as u, createElementVNode as Q, renderSlot as T, createVNode as I, Transition as k, createCommentVNode as w } from "vue";
2
+ import { ProgressIcon as Y, CodeblockIcon as Z } from "@kong/icons";
3
+ import * as m from "monaco-editor";
4
+ import { shikiToMonaco as X } from "@shikijs/monaco";
5
+ import { getSingletonHighlighter as ee, bundledLanguages as te, bundledThemes as oe } from "shiki";
6
+ import { createI18n as ne, i18nTComponent as ae } from "@kong-ui-public/i18n";
7
+ const re = "'JetBrains Mono', Consolas, monospace", ie = "12px", se = "500", le = "20px", ce = Object.freeze({
47
8
  autoClosingQuotes: "always",
48
9
  automaticLayout: !0,
49
10
  // Auto resize layout
@@ -52,10 +13,10 @@ const ue = "'JetBrains Mono', Consolas, monospace", me = "12px", fe = "500", ge
52
13
  },
53
14
  hideCursorInOverviewRuler: !0,
54
15
  // hide the cursor position in the minimap TODO: maybe hide it on first line or change it colour
55
- fontFamily: ue,
56
- fontSize: Number(me.replace("px", "")),
57
- fontWeight: fe,
58
- lineHeight: Number(ge.replace("px", "")),
16
+ fontFamily: re,
17
+ fontSize: Number(ie.replace("px", "")),
18
+ fontWeight: se,
19
+ lineHeight: Number(le.replace("px", "")),
59
20
  formatOnPaste: !0,
60
21
  formatOnType: !0,
61
22
  // Add to enable automatic formatting as the user types.
@@ -97,176 +58,174 @@ const ue = "'JetBrains Mono', Consolas, monospace", me = "12px", fe = "500", ge
97
58
  // we need this set to false to get the correct absolute position, otherwise when the search box opens the content shifts
98
59
  }
99
60
  });
100
- let g = /* @__PURE__ */ new WeakMap();
101
- const y = /* @__PURE__ */ new Map();
102
- function O(o, t) {
103
- let e = y.get(o);
104
- if (e)
105
- return console.warn("[monaco-editor] [lifecycle] Disposable is already tracked:", o), e;
106
- const r = o.dispose;
107
- if (e = {
108
- ...o,
109
- dispose: () => (y.delete(o), r.call(o))
110
- }, t) {
111
- const n = e.dispose;
112
- e.dispose = () => {
113
- const s = g.get(t.source);
114
- return s && (s.delete(e), s.size === 0 && g.delete(t.source)), n();
115
- };
116
- const i = g.get(t.source);
117
- if (i)
118
- i.add(e);
119
- else
120
- switch (g.set(t.source, /* @__PURE__ */ new Set([e])), t.type) {
121
- case "editor":
122
- t.source.onDidDispose(() => b(t.source));
123
- break;
124
- case "model":
125
- t.source.onWillDispose(() => b(t.source));
126
- break;
127
- }
61
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
62
+ const x = () => {
63
+ };
64
+ function de(o, t) {
65
+ function e(...n) {
66
+ return new Promise((a, i) => {
67
+ Promise.resolve(o(() => t.apply(this, n), {
68
+ fn: t,
69
+ thisArg: this,
70
+ args: n
71
+ })).then(a).catch(i);
72
+ });
128
73
  }
129
- return y.set(o, e), e;
130
- }
131
- function pe(o, t) {
132
- return O(t, { type: "editor", source: o });
74
+ return e;
133
75
  }
134
- function he(o, t) {
135
- return O(t, { type: "model", source: o });
76
+ function ue(o, t = {}) {
77
+ let e, n, a = x;
78
+ const i = (l) => {
79
+ clearTimeout(l), a(), a = x;
80
+ };
81
+ let s;
82
+ return (l) => {
83
+ const v = S(o), c = S(t.maxWait);
84
+ return e && i(e), v <= 0 || c !== void 0 && c <= 0 ? (n && (i(n), n = void 0), Promise.resolve(l())) : new Promise((C, r) => {
85
+ a = t.rejectOnCancel ? r : C, s = l, c && !n && (n = setTimeout(() => {
86
+ e && i(e), n = void 0, C(s());
87
+ }, c)), e = setTimeout(() => {
88
+ n && i(n), n = void 0, C(l());
89
+ }, v);
90
+ });
91
+ };
136
92
  }
137
- function b(o) {
138
- const t = g.get(o);
139
- t && (t.forEach((e) => e.dispose()), g.delete(o));
93
+ // @__NO_SIDE_EFFECTS__
94
+ function me(o, t = 200, e = {}) {
95
+ return de(ue(t, e), o);
140
96
  }
141
- function ye() {
142
- y.forEach((o) => o.dispose()), y.clear(), g = /* @__PURE__ */ new WeakMap();
97
+ function ge(o) {
98
+ var t;
99
+ const e = S(o);
100
+ return (t = e == null ? void 0 : e.$el) !== null && t !== void 0 ? t : e;
143
101
  }
144
- const N = {
145
- track: O,
146
- trackForEditor: pe,
147
- trackForModel: he,
148
- disposeScoped: b,
149
- disposeAll: ye
150
- };
151
- let v;
152
- const B = /* @__PURE__ */ new Map();
153
- function Ce(o) {
154
- return v || (v = M), o && !B.get(o) && (B.set(o, !0), M.languages.getLanguages().some((t) => t.id === o) || M.languages.register({ id: o })), v;
102
+ const L = B(!1);
103
+ let p = null;
104
+ async function fe() {
105
+ return p || (p = (async () => {
106
+ var o, t;
107
+ try {
108
+ const e = ((o = m.json) == null ? void 0 : o.jsonDefaults) || ((t = m.languages.json) == null ? void 0 : t.jsonDefaults);
109
+ e == null || e.setModeConfiguration({ tokens: !1 });
110
+ const n = await ee(
111
+ {
112
+ themes: Object.values(oe),
113
+ langs: Object.values(te)
114
+ }
115
+ );
116
+ n.getLoadedLanguages().forEach((a) => {
117
+ m.languages.register({ id: a });
118
+ }), X(n, m), L.value = !0;
119
+ } catch (e) {
120
+ throw p = null, e;
121
+ }
122
+ })(), p);
155
123
  }
156
- function Se(o, t) {
157
- const e = K();
158
- let r = !1;
159
- const n = z({
124
+ function he(o, t) {
125
+ let e, n = !1;
126
+ const a = D({
160
127
  editorStatus: "loading",
161
128
  searchBoxIsRevealed: !1,
162
129
  hasContent: !1,
163
130
  theme: t.theme || "light"
164
- }), i = (a) => {
165
- !r || !e.value || e.value.setValue(a);
166
- }, s = (a) => {
167
- var u;
168
- return (u = e.value) == null ? void 0 : u.updateOptions({ readOnly: a });
169
- }, m = () => {
170
- var a;
171
- return (a = e.value) == null ? void 0 : a.focus();
172
- }, l = (a) => {
131
+ }), i = (r) => {
132
+ !n || !e || e.setValue(r);
133
+ }, s = (r) => e == null ? void 0 : e.updateOptions({ readOnly: r }), g = () => e == null ? void 0 : e.focus(), l = (r) => {
173
134
  try {
174
- if (!e.value || !a) return;
175
- e.value.focus(), e.value.trigger("keyboard", a, null);
176
- } catch (u) {
177
- console.error(`useMonacoEditor: Failed to trigger command: ${a}`, u);
135
+ if (!e || !r) return;
136
+ e.focus(), e.trigger("keyboard", r, null);
137
+ } catch (f) {
138
+ console.error(`useMonacoEditor: Failed to trigger command: ${r}`, f);
178
139
  }
179
- }, C = () => {
180
- var a;
140
+ }, v = () => {
141
+ var r;
181
142
  try {
182
- if (!e.value) return;
183
- if (n.searchBoxIsRevealed)
184
- return (a = e.value.getContribution("editor.contrib.findController")) == null ? void 0 : a.closeFindWidget();
143
+ if (!e) return;
144
+ if (a.searchBoxIsRevealed)
145
+ return (r = e.getContribution("editor.contrib.findController")) == null ? void 0 : r.closeFindWidget();
185
146
  l("actions.find");
186
- } catch (u) {
187
- console.error("useMonacoEditor: Failed to close findController.", u);
147
+ } catch (f) {
148
+ console.error("useMonacoEditor: Failed to close findController.", f);
188
149
  }
189
- }, c = /* @__PURE__ */ ce(() => v == null ? void 0 : v.editor.remeasureFonts(), 200);
150
+ }, c = /* @__PURE__ */ me(() => m.editor.remeasureFonts(), 200);
190
151
  return (() => {
191
- const a = Ce(t.language), u = a.Uri.parse(`inmemory://model/${t.language}-${crypto.randomUUID()}`), V = a.editor.createModel(t.code.value, t.language, u);
192
- j(() => _(o), (A) => {
193
- var I;
194
- const w = de(A);
195
- if (!(w instanceof HTMLElement)) {
196
- r = !1;
152
+ fe();
153
+ let r;
154
+ j([L, () => S(o)], ([f, R]) => {
155
+ var O;
156
+ const E = ge(R);
157
+ if (!(E instanceof HTMLElement) || !f) {
158
+ n = !1;
197
159
  return;
198
160
  }
199
- if (!r) {
200
- e.value = a.editor.create(w, {
201
- ...ve,
161
+ if (!n) {
162
+ if (!r) {
163
+ const d = m.Uri.parse(`inmemory://model/${t.language}-${crypto.randomUUID()}`);
164
+ r = m.editor.createModel(t.code.value, t.language, d);
165
+ }
166
+ e = m.editor.create(E, {
167
+ ...ce,
202
168
  readOnly: t.readOnly || !1,
203
169
  language: t.language,
204
- theme: n.theme,
205
- model: V,
170
+ theme: a.theme === "light" ? "catppuccin-latte" : "catppuccin-mocha",
171
+ model: r,
206
172
  editContext: !1,
207
173
  ...t.monacoOptions
208
- }), r = !0, n.editorStatus = "ready", n.hasContent = !!t.code.value, N.trackForEditor(
209
- e.value,
210
- e.value.onDidChangeModelContent(() => {
211
- var p;
212
- const f = e.value.getValue();
213
- n.hasContent = !!f.length, (p = t.onChanged) == null || p.call(t, f);
214
- })
215
- ), (I = t.onCreated) == null || I.call(t), c();
174
+ }), n = !0, a.editorStatus = "ready", a.hasContent = !!t.code.value, e.onDidChangeModelContent(() => {
175
+ var h;
176
+ const d = e.getValue();
177
+ a.hasContent = !!d.length, (h = t.onChanged) == null || h.call(t, d);
178
+ }), (O = t.onCreated) == null || O.call(t), c();
216
179
  try {
217
- const f = e.value.getContribution("editor.contrib.findController");
218
- if (f) {
219
- const p = f.getState();
220
- N.trackForEditor(
221
- e.value,
222
- p.onFindReplaceStateChange(() => {
223
- n.searchBoxIsRevealed = p.isRevealed;
224
- })
225
- // This returns a disposable
226
- );
180
+ const d = e.getContribution("editor.contrib.findController");
181
+ if (d) {
182
+ const h = d.getState();
183
+ h.onFindReplaceStateChange(() => {
184
+ a.searchBoxIsRevealed = h.isRevealed;
185
+ });
227
186
  }
228
- } catch (f) {
229
- console.error("useMonacoEditor: Failed to get the state of findController", f);
187
+ } catch (d) {
188
+ console.error("useMonacoEditor: Failed to get the state of findController", d);
230
189
  }
231
190
  }
232
191
  }, {
233
192
  immediate: !0,
234
193
  flush: "post"
235
194
  });
236
- })(), $(c), H(c), G(() => {
237
- if (!e.value) return;
238
- const a = e.value.getModel();
239
- e.value.dispose(), a && a.dispose();
195
+ })(), P(c), U(c), V(() => {
196
+ if (!e) return;
197
+ const r = e.getModel();
198
+ e.dispose(), r && r.dispose();
240
199
  }), {
241
200
  editor: e,
242
- editorStates: n,
201
+ editorStates: a,
243
202
  setContent: i,
244
203
  setReadOnly: s,
245
- focus: m,
204
+ focus: g,
246
205
  remeasureFonts: c,
247
- toggleSearchWidget: C,
206
+ toggleSearchWidget: v,
248
207
  triggerKeyboardCommand: l
249
208
  };
250
209
  }
251
- const _e = {
210
+ const pe = {
252
211
  messages: {
253
212
  empty_message: "The editor is currently empty. Start typing to add content.",
254
213
  empty_title: "No content available",
255
214
  loading_message: "Please wait while the {type} content is loaded.",
256
215
  loading_title: "{type} editor"
257
216
  }
258
- }, Ee = {
259
- editor: _e
217
+ }, ye = {
218
+ editor: pe
260
219
  };
261
- function Me() {
262
- const o = ne("en-us", Ee);
220
+ function ve() {
221
+ const o = ne("en-us", ye);
263
222
  return {
264
223
  i18n: o,
265
- i18nT: ie(o)
224
+ i18nT: ae(o)
266
225
  // Translation component <i18n-t>
267
226
  };
268
227
  }
269
- const ke = /* @__PURE__ */ U({
228
+ const Ce = /* @__PURE__ */ W({
270
229
  __name: "MonacoEditorStatusOverlay",
271
230
  props: {
272
231
  title: {},
@@ -275,30 +234,30 @@ const ke = /* @__PURE__ */ U({
275
234
  },
276
235
  setup(o) {
277
236
  return (t, e) => {
278
- const r = q("KEmptyState");
279
- return h(), E(r, {
237
+ const n = K("KEmptyState");
238
+ return y(), _(n, {
280
239
  class: "monaco-editor-status-overlay",
281
240
  message: o.message,
282
241
  title: o.title
283
- }, J({ _: 2 }, [
242
+ }, A({ _: 2 }, [
284
243
  o.icon ? {
285
244
  name: "icon",
286
- fn: k(() => [
287
- (h(), E(Q(o.icon), { decorative: "" }))
245
+ fn: b(() => [
246
+ (y(), _(H(o.icon), { decorative: "" }))
288
247
  ]),
289
248
  key: "0"
290
249
  } : void 0
291
250
  ]), 1032, ["message", "title"]);
292
251
  };
293
252
  }
294
- }), P = (o, t) => {
253
+ }), N = (o, t) => {
295
254
  const e = o.__vccOpts || o;
296
- for (const [r, n] of t)
297
- e[r] = n;
255
+ for (const [n, a] of t)
256
+ e[n] = a;
298
257
  return e;
299
- }, L = /* @__PURE__ */ P(ke, [["__scopeId", "data-v-062eadb5"]]), be = /* @__PURE__ */ U({
258
+ }, F = /* @__PURE__ */ N(Ce, [["__scopeId", "data-v-062eadb5"]]), Se = /* @__PURE__ */ W({
300
259
  __name: "MonacoEditor",
301
- props: /* @__PURE__ */ Y({
260
+ props: /* @__PURE__ */ $({
302
261
  theme: { default: "light" },
303
262
  language: { default: "markdown" },
304
263
  options: { default: () => {
@@ -312,62 +271,62 @@ const ke = /* @__PURE__ */ U({
312
271
  }),
313
272
  emits: ["update:modelValue"],
314
273
  setup(o) {
315
- const t = Z(o, "modelValue"), { i18n: e } = Me(), r = X("editorRef"), n = T(() => o.theme === "dark" ? "dark" : "light"), i = T(() => s.editorStates.editorStatus === "ready" && !s.editorStates.hasContent), s = Se(r, {
274
+ const t = z(o, "modelValue"), { i18n: e } = ve(), n = G("editorRef"), a = M(() => o.theme === "dark" ? "dark" : "light"), i = M(() => s.editorStates.editorStatus === "ready" && !s.editorStates.hasContent), s = he(n, {
316
275
  language: o.language,
317
276
  code: t,
318
- theme: n.value,
277
+ theme: a.value,
319
278
  monacoOptions: o.options,
320
- onChanged: (m) => {
321
- t.value = m;
279
+ onChanged: (g) => {
280
+ t.value = g;
322
281
  }
323
282
  });
324
- return (m, l) => (h(), ee("div", {
325
- class: te(["monaco-editor-container", [
326
- n.value,
327
- { loading: d(s).editorStates.editorStatus === "loading" }
283
+ return (g, l) => (y(), q("div", {
284
+ class: J(["monaco-editor-container", [
285
+ a.value,
286
+ { loading: u(s).editorStates.editorStatus === "loading" }
328
287
  ]]),
329
288
  "data-testid": "monaco-editor-container"
330
289
  }, [
331
- oe("div", {
290
+ Q("div", {
332
291
  ref_key: "editorRef",
333
- ref: r,
292
+ ref: n,
334
293
  class: "monaco-editor-target",
335
294
  "data-testid": "monaco-editor-target"
336
295
  }, null, 512),
337
- F(m.$slots, "state-loading", {
338
- isLoading: d(s).editorStates.editorStatus === "loading"
296
+ T(g.$slots, "state-loading", {
297
+ isLoading: u(s).editorStates.editorStatus === "loading"
339
298
  }, () => [
340
- W(x, { name: "fade" }, {
341
- default: k(() => [
342
- d(s).editorStates.editorStatus === "loading" ? (h(), E(L, {
299
+ I(k, { name: "fade" }, {
300
+ default: b(() => [
301
+ u(s).editorStates.editorStatus === "loading" ? (y(), _(F, {
343
302
  key: 0,
344
303
  "data-testid": "monaco-editor-status-overlay-loading",
345
- icon: d(re),
346
- message: d(e).t("editor.messages.loading_message", { type: o.language }),
347
- title: d(e).t("editor.messages.loading_title", { type: o.language })
348
- }, null, 8, ["icon", "message", "title"])) : D("", !0)
304
+ icon: u(Y),
305
+ message: u(e).t("editor.messages.loading_message", { type: o.language }),
306
+ title: u(e).t("editor.messages.loading_title", { type: o.language })
307
+ }, null, 8, ["icon", "message", "title"])) : w("", !0)
349
308
  ]),
350
309
  _: 1
351
310
  })
352
311
  ], !0),
353
- F(m.$slots, "state-empty", { isEmpty: i.value }, () => [
354
- W(x, { name: "fade" }, {
355
- default: k(() => [
356
- i.value ? (h(), E(L, {
312
+ T(g.$slots, "state-empty", { isEmpty: i.value }, () => [
313
+ I(k, { name: "fade" }, {
314
+ default: b(() => [
315
+ i.value ? (y(), _(F, {
357
316
  key: 0,
358
317
  "data-testid": "monaco-editor-status-overlay-empty",
359
- icon: d(ae),
360
- message: d(e).t("editor.messages.empty_message"),
361
- title: d(e).t("editor.messages.empty_title")
362
- }, null, 8, ["icon", "message", "title"])) : D("", !0)
318
+ icon: u(Z),
319
+ message: u(e).t("editor.messages.empty_message"),
320
+ title: u(e).t("editor.messages.empty_title")
321
+ }, null, 8, ["icon", "message", "title"])) : w("", !0)
363
322
  ]),
364
323
  _: 1
365
324
  })
366
325
  ], !0)
367
326
  ], 2));
368
327
  }
369
- }), Te = /* @__PURE__ */ P(be, [["__scopeId", "data-v-c8f35a88"]]);
328
+ }), Te = /* @__PURE__ */ N(Se, [["__scopeId", "data-v-c8f35a88"]]);
370
329
  export {
371
330
  Te as MonacoEditor,
372
- Se as useMonacoEditor
331
+ he as useMonacoEditor
373
332
  };
@@ -1 +1 @@
1
- (function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("@kong/icons"),require("monaco-editor"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","monaco-editor","@kong-ui-public/i18n"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c["kong-ui-public-monaco-editor"]={},c.Vue,c.KongIcons,c.monaco,c["kong-ui-public-i18n"]))})(this,function(c,o,O,B,b){"use strict";function U(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const k=U(B);typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const I=()=>{};function V(n,t){function e(...r){return new Promise((i,s)=>{Promise.resolve(n(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(i).catch(s)})}return e}function v(n,t={}){let e,r,i=I;const s=d=>{clearTimeout(d),i(),i=I};let l;return d=>{const S=o.toValue(n),u=o.toValue(t.maxWait);return e&&s(e),S<=0||u!==void 0&&u<=0?(r&&(s(r),r=void 0),Promise.resolve(d())):new Promise((C,a)=>{i=t.rejectOnCancel?a:C,l=d,u&&!r&&(r=setTimeout(()=>{e&&s(e),r=void 0,C(l())},u)),e=setTimeout(()=>{r&&s(r),r=void 0,C(d())},S)})}}function R(n,t=200,e={}){return V(v(t,e),n)}function K(n){var t;const e=o.toValue(n);return(t=e==null?void 0:e.$el)!==null&&t!==void 0?t:e}const L=Object.freeze({autoClosingQuotes:"always",automaticLayout:!0,bracketPairColorization:{enabled:!0},hideCursorInOverviewRuler:!0,fontFamily:"'JetBrains Mono', Consolas, monospace",fontSize:Number("12px".replace("px","")),fontWeight:"500",lineHeight:Number("20px".replace("px","")),formatOnPaste:!0,formatOnType:!0,lineNumbersMinChars:3,minimap:{enabled:!1},stickyScroll:{enabled:!0},suggest:{showWords:!1},quickSuggestions:!0,suggestOnTriggerCharacters:!0,wordBasedSuggestions:"off",overviewRulerLanes:0,renderWhitespace:"boundary",scrollBeyondLastLine:!1,roundedSelection:!1,wordWrapColumn:120,colorDecorators:!0,folding:!0,fixedOverflowWidgets:!0,tabSize:2,detectIndentation:!1,insertSpaces:!0,trimAutoWhitespace:!0,wordWrap:"bounded",find:{addExtraSpaceOnTop:!1}});let m=new WeakMap;const h=new Map;function E(n,t){let e=h.get(n);if(e)return console.warn("[monaco-editor] [lifecycle] Disposable is already tracked:",n),e;const r=n.dispose;if(e={...n,dispose:()=>(h.delete(n),r.call(n))},t){const i=e.dispose;e.dispose=()=>{const l=m.get(t.source);return l&&(l.delete(e),l.size===0&&m.delete(t.source)),i()};const s=m.get(t.source);if(s)s.add(e);else switch(m.set(t.source,new Set([e])),t.type){case"editor":t.source.onDidDispose(()=>M(t.source));break;case"model":t.source.onWillDispose(()=>M(t.source));break}}return h.set(n,e),e}function P(n,t){return E(t,{type:"editor",source:n})}function j(n,t){return E(t,{type:"model",source:n})}function M(n){const t=m.get(n);t&&(t.forEach(e=>e.dispose()),m.delete(n))}function A(){h.forEach(n=>n.dispose()),h.clear(),m=new WeakMap}const T={track:E,trackForEditor:P,trackForModel:j,disposeScoped:M,disposeAll:A};let y;const w=new Map;function H(n){return y||(y=k),n&&!w.get(n)&&(w.set(n,!0),k.languages.getLanguages().some(t=>t.id===n)||k.languages.register({id:n})),y}function F(n,t){const e=o.shallowRef();let r=!1;const i=o.reactive({editorStatus:"loading",searchBoxIsRevealed:!1,hasContent:!1,theme:t.theme||"light"}),s=a=>{!r||!e.value||e.value.setValue(a)},l=a=>{var f;return(f=e.value)==null?void 0:f.updateOptions({readOnly:a})},g=()=>{var a;return(a=e.value)==null?void 0:a.focus()},d=a=>{try{if(!e.value||!a)return;e.value.focus(),e.value.trigger("keyboard",a,null)}catch(f){console.error(`useMonacoEditor: Failed to trigger command: ${a}`,f)}},S=()=>{var a;try{if(!e.value)return;if(i.searchBoxIsRevealed)return(a=e.value.getContribution("editor.contrib.findController"))==null?void 0:a.closeFindWidget();d("actions.find")}catch(f){console.error("useMonacoEditor: Failed to close findController.",f)}},u=R(()=>y==null?void 0:y.editor.remeasureFonts(),200);return(()=>{const a=H(t.language),f=a.Uri.parse(`inmemory://model/${t.language}-${crypto.randomUUID()}`),Y=a.editor.createModel(t.code.value,t.language,f);o.watch(()=>o.toValue(n),Z=>{var W;const x=K(Z);if(!(x instanceof HTMLElement)){r=!1;return}if(!r){e.value=a.editor.create(x,{...L,readOnly:t.readOnly||!1,language:t.language,theme:i.theme,model:Y,editContext:!1,...t.monacoOptions}),r=!0,i.editorStatus="ready",i.hasContent=!!t.code.value,T.trackForEditor(e.value,e.value.onDidChangeModelContent(()=>{var _;const p=e.value.getValue();i.hasContent=!!p.length,(_=t.onChanged)==null||_.call(t,p)})),(W=t.onCreated)==null||W.call(t),u();try{const p=e.value.getContribution("editor.contrib.findController");if(p){const _=p.getState();T.trackForEditor(e.value,_.onFindReplaceStateChange(()=>{i.searchBoxIsRevealed=_.isRevealed}))}}catch(p){console.error("useMonacoEditor: Failed to get the state of findController",p)}}},{immediate:!0,flush:"post"})})(),o.onMounted(u),o.onActivated(u),o.onBeforeUnmount(()=>{if(!e.value)return;const a=e.value.getModel();e.value.dispose(),a&&a.dispose()}),{editor:e,editorStates:i,setContent:s,setReadOnly:l,focus:g,remeasureFonts:u,toggleSearchWidget:S,triggerKeyboardCommand:d}}const z={editor:{messages:{empty_message:"The editor is currently empty. Start typing to add content.",empty_title:"No content available",loading_message:"Please wait while the {type} content is loaded.",loading_title:"{type} editor"}}};function $(){const n=b.createI18n("en-us",z);return{i18n:n,i18nT:b.i18nTComponent(n)}}const q=o.defineComponent({__name:"MonacoEditorStatusOverlay",props:{title:{},message:{},icon:{}},setup(n){return(t,e)=>{const r=o.resolveComponent("KEmptyState");return o.openBlock(),o.createBlock(r,{class:"monaco-editor-status-overlay",message:n.message,title:n.title},o.createSlots({_:2},[n.icon?{name:"icon",fn:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.icon),{decorative:""}))]),key:"0"}:void 0]),1032,["message","title"])}}}),D=(n,t)=>{const e=n.__vccOpts||n;for(const[r,i]of t)e[r]=i;return e},N=D(q,[["__scopeId","data-v-062eadb5"]]),G=D(o.defineComponent({__name:"MonacoEditor",props:o.mergeModels({theme:{default:"light"},language:{default:"markdown"},options:{default:()=>{}}},{modelValue:{type:String,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const t=o.useModel(n,"modelValue"),{i18n:e}=$(),r=o.useTemplateRef("editorRef"),i=o.computed(()=>n.theme==="dark"?"dark":"light"),s=o.computed(()=>l.editorStates.editorStatus==="ready"&&!l.editorStates.hasContent),l=F(r,{language:n.language,code:t,theme:i.value,monacoOptions:n.options,onChanged:g=>{t.value=g}});return(g,d)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["monaco-editor-container",[i.value,{loading:o.unref(l).editorStates.editorStatus==="loading"}]]),"data-testid":"monaco-editor-container"},[o.createElementVNode("div",{ref_key:"editorRef",ref:r,class:"monaco-editor-target","data-testid":"monaco-editor-target"},null,512),o.renderSlot(g.$slots,"state-loading",{isLoading:o.unref(l).editorStates.editorStatus==="loading"},()=>[o.createVNode(o.Transition,{name:"fade"},{default:o.withCtx(()=>[o.unref(l).editorStates.editorStatus==="loading"?(o.openBlock(),o.createBlock(N,{key:0,"data-testid":"monaco-editor-status-overlay-loading",icon:o.unref(O.ProgressIcon),message:o.unref(e).t("editor.messages.loading_message",{type:n.language}),title:o.unref(e).t("editor.messages.loading_title",{type:n.language})},null,8,["icon","message","title"])):o.createCommentVNode("",!0)]),_:1})],!0),o.renderSlot(g.$slots,"state-empty",{isEmpty:s.value},()=>[o.createVNode(o.Transition,{name:"fade"},{default:o.withCtx(()=>[s.value?(o.openBlock(),o.createBlock(N,{key:0,"data-testid":"monaco-editor-status-overlay-empty",icon:o.unref(O.CodeblockIcon),message:o.unref(e).t("editor.messages.empty_message"),title:o.unref(e).t("editor.messages.empty_title")},null,8,["icon","message","title"])):o.createCommentVNode("",!0)]),_:1})],!0)],2))}}),[["__scopeId","data-v-c8f35a88"]]);c.MonacoEditor=G,c.useMonacoEditor=F,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
1
+ (function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@kong/icons"),require("monaco-editor"),require("@shikijs/monaco"),require("shiki"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","monaco-editor","@shikijs/monaco","shiki","@kong-ui-public/i18n"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s["kong-ui-public-monaco-editor"]={},s.Vue,s.KongIcons,s.monaco,s.monaco$1,s.shiki,s["kong-ui-public-i18n"]))})(this,function(s,e,O,N,x,S,b){"use strict";function B(n){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(o,t,a.get?a:{enumerable:!0,get:()=>n[t]})}}return o.default=n,Object.freeze(o)}const f=B(N),j=Object.freeze({autoClosingQuotes:"always",automaticLayout:!0,bracketPairColorization:{enabled:!0},hideCursorInOverviewRuler:!0,fontFamily:"'JetBrains Mono', Consolas, monospace",fontSize:Number("12px".replace("px","")),fontWeight:"500",lineHeight:Number("20px".replace("px","")),formatOnPaste:!0,formatOnType:!0,lineNumbersMinChars:3,minimap:{enabled:!1},stickyScroll:{enabled:!0},suggest:{showWords:!1},quickSuggestions:!0,suggestOnTriggerCharacters:!0,wordBasedSuggestions:"off",overviewRulerLanes:0,renderWhitespace:"boundary",scrollBeyondLastLine:!1,roundedSelection:!1,wordWrapColumn:120,colorDecorators:!0,folding:!0,fixedOverflowWidgets:!0,tabSize:2,detectIndentation:!1,insertSpaces:!0,trimAutoWhitespace:!0,wordWrap:"bounded",find:{addExtraSpaceOnTop:!1}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const k=()=>{};function L(n,o){function t(...a){return new Promise((r,c)=>{Promise.resolve(n(()=>o.apply(this,a),{fn:o,thisArg:this,args:a})).then(r).catch(c)})}return t}function U(n,o={}){let t,a,r=k;const c=d=>{clearTimeout(d),r(),r=k};let l;return d=>{const _=e.toValue(n),u=e.toValue(o.maxWait);return t&&c(t),_<=0||u!==void 0&&u<=0?(a&&(c(a),a=void 0),Promise.resolve(d())):new Promise((C,i)=>{r=o.rejectOnCancel?i:C,l=d,u&&!a&&(a=setTimeout(()=>{t&&c(t),a=void 0,C(l())},u)),t=setTimeout(()=>{a&&c(a),a=void 0,C(d())},_)})}}function V(n,o=200,t={}){return L(U(o,t),n)}function W(n){var o;const t=e.toValue(n);return(o=t==null?void 0:t.$el)!==null&&o!==void 0?o:t}const E=e.ref(!1);let h=null;async function D(){return h||(h=(async()=>{var n,o;try{const t=((n=f.json)==null?void 0:n.jsonDefaults)||((o=f.languages.json)==null?void 0:o.jsonDefaults);t==null||t.setModeConfiguration({tokens:!1});const a=await S.getSingletonHighlighter({themes:Object.values(S.bundledThemes),langs:Object.values(S.bundledLanguages)});a.getLoadedLanguages().forEach(r=>{f.languages.register({id:r})}),x.shikiToMonaco(a,f),E.value=!0}catch(t){throw h=null,t}})(),h)}function I(n,o){let t,a=!1;const r=e.reactive({editorStatus:"loading",searchBoxIsRevealed:!1,hasContent:!1,theme:o.theme||"light"}),c=i=>{!a||!t||t.setValue(i)},l=i=>t==null?void 0:t.updateOptions({readOnly:i}),g=()=>t==null?void 0:t.focus(),d=i=>{try{if(!t||!i)return;t.focus(),t.trigger("keyboard",i,null)}catch(p){console.error(`useMonacoEditor: Failed to trigger command: ${i}`,p)}},_=()=>{var i;try{if(!t)return;if(r.searchBoxIsRevealed)return(i=t.getContribution("editor.contrib.findController"))==null?void 0:i.closeFindWidget();d("actions.find")}catch(p){console.error("useMonacoEditor: Failed to close findController.",p)}},u=V(()=>f.editor.remeasureFonts(),200);return(()=>{D();let i;e.watch([E,()=>e.toValue(n)],([p,q])=>{var F;const w=W(q);if(!(w instanceof HTMLElement)||!p){a=!1;return}if(!a){if(!i){const m=f.Uri.parse(`inmemory://model/${o.language}-${crypto.randomUUID()}`);i=f.editor.createModel(o.code.value,o.language,m)}t=f.editor.create(w,{...j,readOnly:o.readOnly||!1,language:o.language,theme:r.theme==="light"?"catppuccin-latte":"catppuccin-mocha",model:i,editContext:!1,...o.monacoOptions}),a=!0,r.editorStatus="ready",r.hasContent=!!o.code.value,t.onDidChangeModelContent(()=>{var y;const m=t.getValue();r.hasContent=!!m.length,(y=o.onChanged)==null||y.call(o,m)}),(F=o.onCreated)==null||F.call(o),u();try{const m=t.getContribution("editor.contrib.findController");if(m){const y=m.getState();y.onFindReplaceStateChange(()=>{r.searchBoxIsRevealed=y.isRevealed})}}catch(m){console.error("useMonacoEditor: Failed to get the state of findController",m)}}},{immediate:!0,flush:"post"})})(),e.onMounted(u),e.onActivated(u),e.onBeforeUnmount(()=>{if(!t)return;const i=t.getModel();t.dispose(),i&&i.dispose()}),{editor:t,editorStates:r,setContent:c,setReadOnly:l,focus:g,remeasureFonts:u,toggleSearchWidget:_,triggerKeyboardCommand:d}}const P={editor:{messages:{empty_message:"The editor is currently empty. Start typing to add content.",empty_title:"No content available",loading_message:"Please wait while the {type} content is loaded.",loading_title:"{type} editor"}}};function R(){const n=b.createI18n("en-us",P);return{i18n:n,i18nT:b.i18nTComponent(n)}}const K=e.defineComponent({__name:"MonacoEditorStatusOverlay",props:{title:{},message:{},icon:{}},setup(n){return(o,t)=>{const a=e.resolveComponent("KEmptyState");return e.openBlock(),e.createBlock(a,{class:"monaco-editor-status-overlay",message:n.message,title:n.title},e.createSlots({_:2},[n.icon?{name:"icon",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.icon),{decorative:""}))]),key:"0"}:void 0]),1032,["message","title"])}}}),T=(n,o)=>{const t=n.__vccOpts||n;for(const[a,r]of o)t[a]=r;return t},M=T(K,[["__scopeId","data-v-062eadb5"]]),H=T(e.defineComponent({__name:"MonacoEditor",props:e.mergeModels({theme:{default:"light"},language:{default:"markdown"},options:{default:()=>{}}},{modelValue:{type:String,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const o=e.useModel(n,"modelValue"),{i18n:t}=R(),a=e.useTemplateRef("editorRef"),r=e.computed(()=>n.theme==="dark"?"dark":"light"),c=e.computed(()=>l.editorStates.editorStatus==="ready"&&!l.editorStates.hasContent),l=I(a,{language:n.language,code:o,theme:r.value,monacoOptions:n.options,onChanged:g=>{o.value=g}});return(g,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["monaco-editor-container",[r.value,{loading:e.unref(l).editorStates.editorStatus==="loading"}]]),"data-testid":"monaco-editor-container"},[e.createElementVNode("div",{ref_key:"editorRef",ref:a,class:"monaco-editor-target","data-testid":"monaco-editor-target"},null,512),e.renderSlot(g.$slots,"state-loading",{isLoading:e.unref(l).editorStates.editorStatus==="loading"},()=>[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(l).editorStates.editorStatus==="loading"?(e.openBlock(),e.createBlock(M,{key:0,"data-testid":"monaco-editor-status-overlay-loading",icon:e.unref(O.ProgressIcon),message:e.unref(t).t("editor.messages.loading_message",{type:n.language}),title:e.unref(t).t("editor.messages.loading_title",{type:n.language})},null,8,["icon","message","title"])):e.createCommentVNode("",!0)]),_:1})],!0),e.renderSlot(g.$slots,"state-empty",{isEmpty:c.value},()=>[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createBlock(M,{key:0,"data-testid":"monaco-editor-status-overlay-empty",icon:e.unref(O.CodeblockIcon),message:e.unref(t).t("editor.messages.empty_message"),title:e.unref(t).t("editor.messages.empty_title")},null,8,["icon","message","title"])):e.createCommentVNode("",!0)]),_:1})],!0)],2))}}),[["__scopeId","data-v-c8f35a88"]]);s.MonacoEditor=H,s.useMonacoEditor=I,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
@@ -1 +1 @@
1
- {"version":3,"file":"MonacoEditor.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/MonacoEditor.vue"],"names":[],"mappings":"AAkTA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;MAGE;IACF,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,oCAAoC,CAAC,GAAG,SAAS,CAAA;CAC3E,CAAC;AAQF;;GAEG;AACH,QAAA,MAAM,KAAK,wDAGT,CAAA;AAyBF,KAAK,gBAAgB,GAAG;IACxB;;OAEG;IACH,UAAU,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AA8IxD,QAAA,IAAI,OAAO;;CAAU,EAAE,QAAQ;;CAAY,CAAE;AAC7C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACpD;IAAE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAOtD,QAAA,MAAM,UAAU;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"MonacoEditor.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/MonacoEditor.vue"],"names":[],"mappings":"AAmTA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;MAGE;IACF,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,oCAAoC,CAAC,GAAG,SAAS,CAAA;CAC3E,CAAC;AAQF;;GAEG;AACH,QAAA,MAAM,KAAK,wDAGT,CAAA;AAyBF,KAAK,gBAAgB,GAAG;IACxB;;OAEG;IACH,UAAU,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AA+IxD,QAAA,IAAI,OAAO;;CAAU,EAAE,QAAQ;;CAAY,CAAE;AAC7C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACpD;IAAE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAOtD,QAAA,MAAM,UAAU;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MonacoEditorStatusOverlay.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/MonacoEditorStatusOverlay.vue"],"names":[],"mappings":"AAkEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,KAAK,WAAW,GAAG;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB,CAAC;AA6DF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"MonacoEditorStatusOverlay.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/MonacoEditorStatusOverlay.vue"],"names":[],"mappings":"AAmEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,KAAK,WAAW,GAAG;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB,CAAC;AA8DF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -8,7 +8,7 @@ import type { UseMonacoEditorOptions } from '../types';
8
8
  * @returns {object} An object containing the editor instance and utility methods.
9
9
  */
10
10
  export declare function useMonacoEditor<T extends MaybeElement>(target: MaybeComputedElementRef<T>, options: UseMonacoEditorOptions): {
11
- editor: import("vue").ShallowRef<monaco.editor.IStandaloneCodeEditor | undefined, monaco.editor.IStandaloneCodeEditor | undefined>;
11
+ editor: monaco.editor.IStandaloneCodeEditor | undefined;
12
12
  editorStates: {
13
13
  editorStatus: import("..").EditorStatus;
14
14
  searchBoxIsRevealed: boolean;
@@ -18,7 +18,7 @@ export declare function useMonacoEditor<T extends MaybeElement>(target: MaybeCom
18
18
  setContent: (content: string) => void;
19
19
  setReadOnly: (readOnly: boolean) => void;
20
20
  focus: () => void;
21
- remeasureFonts: import("@vueuse/core").UseDebounceFnReturn<() => void | undefined>;
21
+ remeasureFonts: import("@vueuse/core").UseDebounceFnReturn<() => void>;
22
22
  toggleSearchWidget: () => void;
23
23
  triggerKeyboardCommand: (id: string) => void;
24
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useMonacoEditor.d.ts","sourceRoot":"","sources":["../../../../src/composables/useMonacoEditor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AASvC,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACzE,OAAO,KAAK,EAAsB,sBAAsB,EAAE,MAAM,UAAU,CAAA;AA+B1E;;;;;EAKE;AACF,wBAAgB,eAAe,CAAC,CAAC,SAAS,YAAY,EACpD,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC,EAClC,OAAO,EAAE,sBAAsB;;;;;;;;0BAoBF,MAAM,KAAG,IAAI;4BAOX,OAAO,KAAG,IAAI;iBAG3B,IAAI;;8BAkBS,IAAI;iCAXC,MAAM,KAAG,IAAI;EAwIlD"}
1
+ {"version":3,"file":"useMonacoEditor.d.ts","sourceRoot":"","sources":["../../../../src/composables/useMonacoEditor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAIvC,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACzE,OAAO,KAAK,EAAsB,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAwC1E;;;;;EAKE;AACF,wBAAgB,eAAe,CAAC,CAAC,SAAS,YAAY,EACpD,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC,EAClC,OAAO,EAAE,sBAAsB;;;;;;;;0BAqBF,MAAM,KAAG,IAAI;4BAOX,OAAO,KAAG,IAAI;iBAG3B,IAAI;;8BAkBS,IAAI;iCAXC,MAAM,KAAG,IAAI;EAwIlD"}
@@ -1,5 +1,6 @@
1
1
  import type { Plugin } from 'vite';
2
2
  import type { EditorFeature, EditorLanguage, NegatedEditorFeature, IFeatureDefinition } from 'monaco-editor/esm/metadata.js';
3
+ import type { BundledLanguage, BundledTheme } from 'shiki';
3
4
  type Options = {
4
5
  /**
5
6
  * Include only a subset of the languages supported.
@@ -50,7 +51,37 @@ type Options = {
50
51
  * ```
51
52
  */
52
53
  features?: Array<EditorFeature | NegatedEditorFeature>;
54
+ /**
55
+ * Shiki configuration options.
56
+ * @type {{ themes?: BundledTheme[]; langs?: BundledLanguage[] }}
57
+ */
58
+ shiki?: {
59
+ /**
60
+ * Languages to include for Shiki syntax highlighting.
61
+ *
62
+ * @type {BundledLanguage[]}
63
+ * @defaultValue The same languages specified in the`languages` option above
64
+ * @example
65
+ * ```ts
66
+ * // Only include JavaScript and JSON support
67
+ * langs: ['javascript', 'json']
68
+ * ```
69
+ */
70
+ langs?: BundledLanguage[];
71
+ /**
72
+ * Themes to include for Shiki syntax highlighting.
73
+ *
74
+ * @type {BundledTheme[]}
75
+ * @defaultValue ['catppuccin-latte', 'catppuccin-mocha']
76
+ * @example
77
+ * ```ts
78
+ * // Include the 'nord' theme
79
+ * themes: ['nord']
80
+ * ```
81
+ */
82
+ themes?: BundledTheme[];
83
+ };
53
84
  };
54
- export default function (options?: Options): Plugin;
85
+ export default function plugin(options?: Options): Plugin;
55
86
  export {};
56
87
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../vite-plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,+BAA+B,CAAA;AAGtC,KAAK,OAAO,GAAG;IACb;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAA;IAE5B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe,CAAC,EAAE,kBAAkB,EAAE,CAAA;IAEtC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,oBAAoB,CAAC,CAAA;CACvD,CAAA;AAsGD,MAAM,CAAC,OAAO,WAAU,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAqEjD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../vite-plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAM1D,KAAK,OAAO,GAAG;IACb;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAA;IAE5B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe,CAAC,EAAE,kBAAkB,EAAE,CAAA;IAEtC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,oBAAoB,CAAC,CAAA;IAEtD;;;KAGC;IACD,KAAK,CAAC,EAAE;QACN;;;;;;;;;;UAUE;QACF,KAAK,CAAC,EAAE,eAAe,EAAE,CAAA;QAEzB;;;;;;;;;;WAUG;QACH,MAAM,CAAC,EAAE,YAAY,EAAE,CAAA;KACxB,CAAA;CACF,CAAA;AA+GD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAkFxD"}
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  const metadata_js = require("monaco-editor/esm/metadata.js");
3
+ const shikiCodegen = require("shiki-codegen");
4
+ const shiki = require("shiki");
3
5
  const WORKER_ALIASES = {
4
6
  javascript: "typescript",
5
7
  less: "css",
@@ -7,10 +9,17 @@ const WORKER_ALIASES = {
7
9
  handlebars: "html",
8
10
  razor: "html"
9
11
  };
10
- const VIRTUAL_MODULE_ID = "\0virtual:monaco-editor";
12
+ const VIRTUAL_MODULE_MONACO_ID = "\0virtual:monaco-editor";
13
+ const VIRTUAL_MODULE_SHIKI_ID = "\0virtual:shiki";
11
14
  function generateImports(entries) {
12
15
  const entryArray = Array.isArray(entries) ? entries : [entries];
13
- return entryArray.map((entry) => `import 'monaco-editor/esm/${entry}'`);
16
+ return entryArray.map((entry) => {
17
+ if (entry.endsWith("monaco.contribution")) {
18
+ const lang = entry.split("/").at(-2);
19
+ return `export * as ${lang} from 'monaco-editor/esm/${entry}'`;
20
+ }
21
+ return `import 'monaco-editor/esm/${entry}'`;
22
+ });
14
23
  }
15
24
  function resolveFeatures(requestedFeatures, allFeatureIds) {
16
25
  if (!requestedFeatures) {
@@ -66,62 +75,72 @@ function generateWorkerCode(languageIds, languagesDict, customLanguages) {
66
75
  "}"
67
76
  ];
68
77
  }
69
- function index(options) {
78
+ function plugin(options) {
70
79
  return {
71
80
  name: "vite-plugin-monaco",
72
81
  enforce: "pre",
73
82
  resolveId(id) {
74
83
  if (id === "monaco-editor") {
75
- return VIRTUAL_MODULE_ID;
84
+ return VIRTUAL_MODULE_MONACO_ID;
85
+ } else if (id === "shiki") {
86
+ return VIRTUAL_MODULE_SHIKI_ID;
76
87
  }
77
88
  },
78
89
  load(id) {
79
- if (id !== VIRTUAL_MODULE_ID) {
80
- return;
90
+ var _a, _b;
91
+ if (id === VIRTUAL_MODULE_MONACO_ID) {
92
+ const languagesDict = Object.fromEntries(
93
+ metadata_js.languages.map((lang) => [lang.label, lang])
94
+ );
95
+ const featuresDict = Object.fromEntries(
96
+ metadata_js.features.map((feat) => [feat.label, feat])
97
+ );
98
+ const featuresIds = resolveFeatures(
99
+ options == null ? void 0 : options.features,
100
+ Object.keys(featuresDict)
101
+ );
102
+ const featureImports = featuresIds.flatMap((featureId) => {
103
+ const feature = featuresDict[featureId];
104
+ if (!(feature == null ? void 0 : feature.entry)) {
105
+ return [];
106
+ }
107
+ return generateImports(feature.entry);
108
+ });
109
+ const languageIds = (options == null ? void 0 : options.languages) || Object.keys(languagesDict);
110
+ const languageImports = languageIds.flatMap((langId) => {
111
+ const lang = languagesDict[langId];
112
+ if (!(lang == null ? void 0 : lang.entry)) {
113
+ return [];
114
+ }
115
+ return generateImports(lang.entry);
116
+ });
117
+ const customLanguageImports = ((options == null ? void 0 : options.customLanguages) || []).map(
118
+ ({ entry }) => `import '${entry}'`
119
+ );
120
+ const workerCode = generateWorkerCode(
121
+ languageIds,
122
+ languagesDict,
123
+ options == null ? void 0 : options.customLanguages
124
+ );
125
+ return [
126
+ "import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'",
127
+ ...featureImports,
128
+ ...languageImports,
129
+ ...customLanguageImports,
130
+ ...workerCode,
131
+ "export * from 'monaco-editor/esm/vs/editor/editor.api'",
132
+ "export default monaco"
133
+ ].join("\n");
134
+ } else if (id === VIRTUAL_MODULE_SHIKI_ID) {
135
+ const languageIds = ((_a = options == null ? void 0 : options.shiki) == null ? void 0 : _a.langs) || ((options == null ? void 0 : options.languages) || metadata_js.languages.map((lang) => lang.label)).filter((lang) => lang in shiki.bundledLanguages);
136
+ return shikiCodegen.codegen({
137
+ themes: ((_b = options == null ? void 0 : options.shiki) == null ? void 0 : _b.themes) || ["catppuccin-latte", "catppuccin-mocha"],
138
+ engine: "javascript",
139
+ langs: languageIds,
140
+ typescript: false
141
+ });
81
142
  }
82
- const languagesDict = Object.fromEntries(
83
- metadata_js.languages.map((lang) => [lang.label, lang])
84
- );
85
- const featuresDict = Object.fromEntries(
86
- metadata_js.features.map((feat) => [feat.label, feat])
87
- );
88
- const featuresIds = resolveFeatures(
89
- options == null ? void 0 : options.features,
90
- Object.keys(featuresDict)
91
- );
92
- const featureImports = featuresIds.flatMap((featureId) => {
93
- const feature = featuresDict[featureId];
94
- if (!(feature == null ? void 0 : feature.entry)) {
95
- return [];
96
- }
97
- return generateImports(feature.entry);
98
- });
99
- const languageIds = (options == null ? void 0 : options.languages) || Object.keys(languagesDict);
100
- const languageImports = languageIds.flatMap((langId) => {
101
- const lang = languagesDict[langId];
102
- if (!(lang == null ? void 0 : lang.entry)) {
103
- return [];
104
- }
105
- return generateImports(lang.entry);
106
- });
107
- const customLanguageImports = ((options == null ? void 0 : options.customLanguages) || []).map(
108
- ({ entry }) => `import '${entry}'`
109
- );
110
- const workerCode = generateWorkerCode(
111
- languageIds,
112
- languagesDict,
113
- options == null ? void 0 : options.customLanguages
114
- );
115
- return [
116
- "import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'",
117
- ...featureImports,
118
- ...languageImports,
119
- ...customLanguageImports,
120
- ...workerCode,
121
- "export * from 'monaco-editor/esm/vs/editor/editor.api'",
122
- "export default monaco"
123
- ].join("\n");
124
143
  }
125
144
  };
126
145
  }
127
- module.exports = index;
146
+ module.exports = plugin;
@@ -1,4 +1,6 @@
1
1
  import { languages, features } from "monaco-editor/esm/metadata.js";
2
+ import { codegen } from "shiki-codegen";
3
+ import { bundledLanguages } from "shiki";
2
4
  const WORKER_ALIASES = {
3
5
  javascript: "typescript",
4
6
  less: "css",
@@ -6,10 +8,17 @@ const WORKER_ALIASES = {
6
8
  handlebars: "html",
7
9
  razor: "html"
8
10
  };
9
- const VIRTUAL_MODULE_ID = "\0virtual:monaco-editor";
11
+ const VIRTUAL_MODULE_MONACO_ID = "\0virtual:monaco-editor";
12
+ const VIRTUAL_MODULE_SHIKI_ID = "\0virtual:shiki";
10
13
  function generateImports(entries) {
11
14
  const entryArray = Array.isArray(entries) ? entries : [entries];
12
- return entryArray.map((entry) => `import 'monaco-editor/esm/${entry}'`);
15
+ return entryArray.map((entry) => {
16
+ if (entry.endsWith("monaco.contribution")) {
17
+ const lang = entry.split("/").at(-2);
18
+ return `export * as ${lang} from 'monaco-editor/esm/${entry}'`;
19
+ }
20
+ return `import 'monaco-editor/esm/${entry}'`;
21
+ });
13
22
  }
14
23
  function resolveFeatures(requestedFeatures, allFeatureIds) {
15
24
  if (!requestedFeatures) {
@@ -65,64 +74,74 @@ function generateWorkerCode(languageIds, languagesDict, customLanguages) {
65
74
  "}"
66
75
  ];
67
76
  }
68
- function index(options) {
77
+ function plugin(options) {
69
78
  return {
70
79
  name: "vite-plugin-monaco",
71
80
  enforce: "pre",
72
81
  resolveId(id) {
73
82
  if (id === "monaco-editor") {
74
- return VIRTUAL_MODULE_ID;
83
+ return VIRTUAL_MODULE_MONACO_ID;
84
+ } else if (id === "shiki") {
85
+ return VIRTUAL_MODULE_SHIKI_ID;
75
86
  }
76
87
  },
77
88
  load(id) {
78
- if (id !== VIRTUAL_MODULE_ID) {
79
- return;
89
+ var _a, _b;
90
+ if (id === VIRTUAL_MODULE_MONACO_ID) {
91
+ const languagesDict = Object.fromEntries(
92
+ languages.map((lang) => [lang.label, lang])
93
+ );
94
+ const featuresDict = Object.fromEntries(
95
+ features.map((feat) => [feat.label, feat])
96
+ );
97
+ const featuresIds = resolveFeatures(
98
+ options == null ? void 0 : options.features,
99
+ Object.keys(featuresDict)
100
+ );
101
+ const featureImports = featuresIds.flatMap((featureId) => {
102
+ const feature = featuresDict[featureId];
103
+ if (!(feature == null ? void 0 : feature.entry)) {
104
+ return [];
105
+ }
106
+ return generateImports(feature.entry);
107
+ });
108
+ const languageIds = (options == null ? void 0 : options.languages) || Object.keys(languagesDict);
109
+ const languageImports = languageIds.flatMap((langId) => {
110
+ const lang = languagesDict[langId];
111
+ if (!(lang == null ? void 0 : lang.entry)) {
112
+ return [];
113
+ }
114
+ return generateImports(lang.entry);
115
+ });
116
+ const customLanguageImports = ((options == null ? void 0 : options.customLanguages) || []).map(
117
+ ({ entry }) => `import '${entry}'`
118
+ );
119
+ const workerCode = generateWorkerCode(
120
+ languageIds,
121
+ languagesDict,
122
+ options == null ? void 0 : options.customLanguages
123
+ );
124
+ return [
125
+ "import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'",
126
+ ...featureImports,
127
+ ...languageImports,
128
+ ...customLanguageImports,
129
+ ...workerCode,
130
+ "export * from 'monaco-editor/esm/vs/editor/editor.api'",
131
+ "export default monaco"
132
+ ].join("\n");
133
+ } else if (id === VIRTUAL_MODULE_SHIKI_ID) {
134
+ const languageIds = ((_a = options == null ? void 0 : options.shiki) == null ? void 0 : _a.langs) || ((options == null ? void 0 : options.languages) || languages.map((lang) => lang.label)).filter((lang) => lang in bundledLanguages);
135
+ return codegen({
136
+ themes: ((_b = options == null ? void 0 : options.shiki) == null ? void 0 : _b.themes) || ["catppuccin-latte", "catppuccin-mocha"],
137
+ engine: "javascript",
138
+ langs: languageIds,
139
+ typescript: false
140
+ });
80
141
  }
81
- const languagesDict = Object.fromEntries(
82
- languages.map((lang) => [lang.label, lang])
83
- );
84
- const featuresDict = Object.fromEntries(
85
- features.map((feat) => [feat.label, feat])
86
- );
87
- const featuresIds = resolveFeatures(
88
- options == null ? void 0 : options.features,
89
- Object.keys(featuresDict)
90
- );
91
- const featureImports = featuresIds.flatMap((featureId) => {
92
- const feature = featuresDict[featureId];
93
- if (!(feature == null ? void 0 : feature.entry)) {
94
- return [];
95
- }
96
- return generateImports(feature.entry);
97
- });
98
- const languageIds = (options == null ? void 0 : options.languages) || Object.keys(languagesDict);
99
- const languageImports = languageIds.flatMap((langId) => {
100
- const lang = languagesDict[langId];
101
- if (!(lang == null ? void 0 : lang.entry)) {
102
- return [];
103
- }
104
- return generateImports(lang.entry);
105
- });
106
- const customLanguageImports = ((options == null ? void 0 : options.customLanguages) || []).map(
107
- ({ entry }) => `import '${entry}'`
108
- );
109
- const workerCode = generateWorkerCode(
110
- languageIds,
111
- languagesDict,
112
- options == null ? void 0 : options.customLanguages
113
- );
114
- return [
115
- "import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'",
116
- ...featureImports,
117
- ...languageImports,
118
- ...customLanguageImports,
119
- ...workerCode,
120
- "export * from 'monaco-editor/esm/vs/editor/editor.api'",
121
- "export default monaco"
122
- ].join("\n");
123
142
  }
124
143
  };
125
144
  }
126
145
  export {
127
- index as default
146
+ plugin as default
128
147
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/monaco-editor",
3
- "version": "0.4.11-pr.2769.31aadbf56.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "main": "./dist/runtime/monaco-editor.umd.js",
6
6
  "module": "./dist/runtime/monaco-editor.es.js",
@@ -46,20 +46,24 @@
46
46
  "peerDependencies": {
47
47
  "@kong/icons": "^1.41.0",
48
48
  "@kong/kongponents": ">=9.42.0 <10.0.0",
49
- "monaco-editor": ">=0.55.0 <1.0.0",
49
+ "monaco-editor": ">=0.52.0 <1.0.0",
50
+ "shiki": ">=3.0.0 <4.0.0",
50
51
  "vue": "^3.5.26",
51
52
  "@kong-ui-public/i18n": "^2.4.5"
52
53
  },
53
54
  "devDependencies": {
54
55
  "@kong/design-tokens": "1.18.2",
55
56
  "@kong/icons": "^1.41.0",
56
- "@kong/kongponents": "9.48.7",
57
+ "@kong/kongponents": "9.48.8",
57
58
  "monaco-editor": "^0.55.1",
59
+ "shiki": "^3.20.0",
58
60
  "vue": "^3.5.26",
59
61
  "@kong-ui-public/i18n": "^2.4.5"
60
62
  },
61
63
  "dependencies": {
62
- "@vueuse/core": "^14.1.0"
64
+ "@shikijs/monaco": "^3.20.0",
65
+ "@vueuse/core": "^14.1.0",
66
+ "shiki-codegen": "^3.20.0"
63
67
  },
64
68
  "scripts": {
65
69
  "dev": "cross-env USE_SANDBOX=true vite",
@@ -1,2 +0,0 @@
1
- export * from './lifecycle';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/singletons/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
@@ -1,31 +0,0 @@
1
- import type { editor as Editor, IDisposable } from 'monaco-editor';
2
- type Scope = {
3
- type: 'editor';
4
- source: Editor.ICodeEditor;
5
- } | {
6
- type: 'model';
7
- source: Editor.ITextModel;
8
- };
9
- type ScopeSource = Editor.ICodeEditor | Editor.ITextModel;
10
- /**
11
- * Track a disposable in the global scope.
12
- *
13
- * @param disposable The disposable to track
14
- */
15
- declare function track(disposable: IDisposable, scope?: Scope): IDisposable;
16
- declare function trackForEditor(editor: Editor.ICodeEditor, disposable: IDisposable): IDisposable;
17
- declare function trackForModel(model: Editor.ITextModel, disposable: IDisposable): IDisposable;
18
- declare function disposeScoped(source: ScopeSource): void;
19
- /**
20
- * Dispose all tracked disposables.
21
- */
22
- declare function disposeAll(): void;
23
- export declare const lifecycle: {
24
- readonly track: typeof track;
25
- readonly trackForEditor: typeof trackForEditor;
26
- readonly trackForModel: typeof trackForModel;
27
- readonly disposeScoped: typeof disposeScoped;
28
- readonly disposeAll: typeof disposeAll;
29
- };
30
- export {};
31
- //# sourceMappingURL=lifecycle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/singletons/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAElE,KAAK,KAAK,GACN;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAA;CAAE,GAC9C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,CAAA;AAChD,KAAK,WAAW,GAAG,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAA;AAKzD;;;;GAIG;AACH,iBAAS,KAAK,CAAC,UAAU,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,WAAW,CA+ClE;AAED,iBAAS,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,UAAU,EAAE,WAAW,GAAG,WAAW,CAExF;AAED,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,GAAG,WAAW,CAErF;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,WAAW,QAMzC;AAED;;GAEG;AACH,iBAAS,UAAU,SAIlB;AAED,eAAO,MAAM,SAAS;;;;;;CAMZ,CAAA"}