@aeriz/wysiwyg 1.0.0 → 1.0.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.
@@ -1,7 +1,7 @@
1
- var Ue = Object.defineProperty;
2
- var We = (n, e, t) => e in n ? Ue(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var w = (n, e, t) => We(n, typeof e != "symbol" ? e + "" : e, t);
4
- const Ke = {
1
+ var Ke = Object.defineProperty;
2
+ var Ve = (n, e, t) => e in n ? Ke(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var w = (n, e, t) => Ve(n, typeof e != "symbol" ? e + "" : e, t);
4
+ const Ye = {
5
5
  items: [
6
6
  // undo / redo 는 브라우저 네이티브 (Ctrl+Z / Ctrl+Y) 가 처리하므로 기본
7
7
  // 툴바에서 제외. ToolbarItemName 멤버는 유지 — 커스텀 toolbar 에서
@@ -70,7 +70,7 @@ const Ke = {
70
70
  cellBg: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="1.5"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="12" y1="3" x2="12" y2="21"/><rect x="3" y="3" width="9" height="9" fill="currentColor" opacity="0.35" stroke="none"/></svg>',
71
71
  tableMenu: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="1.5"/><line x1="3" y1="9" x2="21" y2="9"/><line x1="3" y1="15" x2="21" y2="15"/><line x1="9" y1="3" x2="9" y2="21"/><line x1="15" y1="3" x2="15" y2="21"/></svg>',
72
72
  codeLang: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/><line x1="14" y1="4" x2="10" y2="20"/></svg>'
73
- }, Ye = {
73
+ }, Ge = {
74
74
  undo: { name: "undo", label: "되돌리기", icon: "undo", shortcut: "Ctrl+Z" },
75
75
  redo: { name: "redo", label: "다시 실행", icon: "redo", shortcut: "Ctrl+Y" },
76
76
  blockType: { name: "blockType", label: "블록 유형", icon: "blockType", hasDropdown: !0 },
@@ -96,7 +96,7 @@ const Ke = {
96
96
  hr: { name: "hr", label: "구분선", icon: "hr" },
97
97
  clearFormat: { name: "clearFormat", label: "서식 지우기", icon: "clearFormat", shortcut: "Ctrl+\\" }
98
98
  };
99
- class Ve {
99
+ class Ze {
100
100
  constructor(e, t) {
101
101
  w(this, "element");
102
102
  w(this, "buttons", /* @__PURE__ */ new Map());
@@ -108,7 +108,7 @@ class Ve {
108
108
  o = this.createGroup(), this.element.appendChild(o);
109
109
  continue;
110
110
  }
111
- const i = Ye[l];
111
+ const i = Ge[l];
112
112
  if (!i) continue;
113
113
  const r = this.createButton(i, t);
114
114
  this.buttons.set(i.name, r), o.appendChild(r);
@@ -170,17 +170,17 @@ function P(n, e) {
170
170
  r.type = "button", r.className = "aw-dialog-close", r.setAttribute("aria-label", "닫기"), r.innerHTML = E.close, l.appendChild(i), l.appendChild(r);
171
171
  const s = document.createElement("div");
172
172
  s.className = "aw-dialog-body";
173
- const c = document.createElement("div");
174
- c.className = "aw-dialog-footer", o.appendChild(l), o.appendChild(s), o.appendChild(c), t.appendChild(o);
175
- const a = () => t.remove();
176
- return r.addEventListener("click", a), t.addEventListener("click", (d) => {
177
- d.target === t && a();
173
+ const a = document.createElement("div");
174
+ a.className = "aw-dialog-footer", o.appendChild(l), o.appendChild(s), o.appendChild(a), t.appendChild(o);
175
+ const c = () => t.remove();
176
+ return r.addEventListener("click", c), t.addEventListener("click", (d) => {
177
+ d.target === t && c();
178
178
  }), document.addEventListener(
179
179
  "keydown",
180
180
  function d(u) {
181
- u.key === "Escape" && (a(), document.removeEventListener("keydown", d));
181
+ u.key === "Escape" && (c(), document.removeEventListener("keydown", d));
182
182
  }
183
- ), { overlay: t, body: s, footer: c, close: a };
183
+ ), { overlay: t, body: s, footer: a, close: c };
184
184
  }
185
185
  function R(n, e) {
186
186
  const t = document.createElement("div");
@@ -188,88 +188,88 @@ function R(n, e) {
188
188
  const o = document.createElement("label");
189
189
  return o.className = "aw-field-label", o.textContent = n, t.appendChild(o), t.appendChild(e), t;
190
190
  }
191
- function Ge(n = {}, e) {
191
+ function Xe(n = {}, e) {
192
192
  return new Promise((t) => {
193
193
  const { overlay: o, body: l, footer: i, close: r } = P("링크 삽입", e), s = document.createElement("input");
194
194
  s.type = "text", s.className = "aw-input", s.placeholder = "링크에 표시할 텍스트", s.value = n.text ?? "";
195
- const c = document.createElement("input");
196
- c.type = "url", c.className = "aw-input", c.placeholder = "https://example.com", c.value = n.href ?? "";
197
- const a = document.createElement("label");
198
- a.className = "aw-checkbox";
195
+ const a = document.createElement("input");
196
+ a.type = "url", a.className = "aw-input", a.placeholder = "https://example.com", a.value = n.href ?? "";
197
+ const c = document.createElement("label");
198
+ c.className = "aw-checkbox";
199
199
  const d = document.createElement("input");
200
200
  d.type = "checkbox", d.checked = n.newWindow ?? !1;
201
201
  const u = document.createElement("span");
202
- u.textContent = "새 창에서 열기", a.appendChild(d), a.appendChild(u), l.appendChild(R("표시할 텍스트", s)), l.appendChild(R("URL", c)), l.appendChild(a);
202
+ u.textContent = "새 창에서 열기", c.appendChild(d), c.appendChild(u), l.appendChild(R("표시할 텍스트", s)), l.appendChild(R("URL", a)), l.appendChild(c);
203
203
  const m = document.createElement("button");
204
204
  m.type = "button", m.className = "aw-btn aw-btn-ghost", m.textContent = "취소";
205
- const f = document.createElement("button");
206
- f.type = "button", f.className = "aw-btn aw-btn-primary", f.textContent = "확인", i.appendChild(m), i.appendChild(f), m.addEventListener("click", () => {
205
+ const h = document.createElement("button");
206
+ h.type = "button", h.className = "aw-btn aw-btn-primary", h.textContent = "확인", i.appendChild(m), i.appendChild(h), m.addEventListener("click", () => {
207
207
  r(), t({ confirmed: !1 });
208
- }), f.addEventListener("click", () => {
208
+ }), h.addEventListener("click", () => {
209
209
  r(), t({
210
210
  confirmed: !0,
211
211
  text: s.value,
212
- href: c.value,
212
+ href: a.value,
213
213
  newWindow: d.checked
214
214
  });
215
- }), document.body.appendChild(o), setTimeout(() => c.focus(), 0);
215
+ }), document.body.appendChild(o), setTimeout(() => a.focus(), 0);
216
216
  });
217
217
  }
218
- function Ze(n = {}, e) {
218
+ function Qe(n = {}, e) {
219
219
  return new Promise((t) => {
220
220
  const { overlay: o, body: l, footer: i, close: r } = P("이미지", e), s = document.createElement("div");
221
221
  s.className = "aw-tabs";
222
- const c = document.createElement("button");
223
- c.type = "button", c.className = "aw-tab", c.textContent = "임베드", c.title = "base64 데이터로 본문에 직접 삽입";
224
222
  const a = document.createElement("button");
225
- a.type = "button", a.className = "aw-tab", a.textContent = "URL", a.title = "이미지 URL 입력";
223
+ a.type = "button", a.className = "aw-tab", a.textContent = "임베드", a.title = "base64 데이터로 본문에 직접 삽입";
224
+ const c = document.createElement("button");
225
+ c.type = "button", c.className = "aw-tab", c.textContent = "URL", c.title = "이미지 URL 입력";
226
226
  const d = document.createElement("button");
227
227
  d.type = "button", d.className = "aw-tab", d.textContent = "업로드";
228
228
  const u = !!n.onUpload;
229
- u ? d.title = "서버 API 로 업로드 후 결과 URL 사용" : (d.disabled = !0, d.classList.add("aw-tab-disabled"), d.title = "개체 생성시 등록된 API 주소가 없습니다."), s.appendChild(c), s.appendChild(a), s.appendChild(d), l.appendChild(s);
229
+ u ? d.title = "서버 API 로 업로드 후 결과 URL 사용" : (d.disabled = !0, d.classList.add("aw-tab-disabled"), d.title = "개체 생성시 등록된 API 주소가 없습니다."), s.appendChild(a), s.appendChild(c), s.appendChild(d), l.appendChild(s);
230
230
  const m = document.createElement("div");
231
231
  m.className = "aw-pane";
232
- const f = me("이미지 파일 선택 (base64 임베드)"), p = document.createElement("div");
233
- p.className = "aw-preview", p.style.display = "none", m.appendChild(f.dropzone), m.appendChild(p);
234
- const h = document.createElement("div");
235
- h.className = "aw-pane";
236
- const b = document.createElement("input");
237
- b.type = "url", b.className = "aw-input", b.placeholder = "https://example.com/image.jpg", h.appendChild(R("이미지 URL", b));
238
- const v = document.createElement("div");
239
- if (v.className = "aw-pane", u) {
240
- const g = me("서버 업로드용 이미지 선택"), x = document.createElement("div");
241
- x.className = "aw-preview", x.style.display = "none", v.appendChild(g.dropzone), v.appendChild(x), g.input.addEventListener("change", async () => {
242
- var $;
243
- const B = ($ = g.input.files) == null ? void 0 : $[0];
244
- if (!(!B || !n.onUpload))
232
+ const h = me("이미지 파일 선택 (base64 임베드)"), f = document.createElement("div");
233
+ f.className = "aw-preview", f.style.display = "none", m.appendChild(h.dropzone), m.appendChild(f);
234
+ const p = document.createElement("div");
235
+ p.className = "aw-pane";
236
+ const g = document.createElement("input");
237
+ g.type = "url", g.className = "aw-input", g.placeholder = "https://example.com/image.jpg", p.appendChild(R("이미지 URL", g));
238
+ const b = document.createElement("div");
239
+ if (b.className = "aw-pane", u) {
240
+ const y = me("서버 업로드용 이미지 선택"), x = document.createElement("div");
241
+ x.className = "aw-preview", x.style.display = "none", b.appendChild(y.dropzone), b.appendChild(x), y.input.addEventListener("change", async () => {
242
+ var z;
243
+ const $ = (z = y.input.files) == null ? void 0 : z[0];
244
+ if (!(!$ || !n.onUpload))
245
245
  try {
246
- g.dropzone.classList.add("aw-dropzone-loading");
247
- const K = await n.onUpload(B);
248
- y = K, x.style.backgroundImage = `url(${JSON.stringify(K)})`, x.style.display = "block";
246
+ y.dropzone.classList.add("aw-dropzone-loading");
247
+ const K = await n.onUpload($);
248
+ C = K, x.style.backgroundImage = `url(${JSON.stringify(K)})`, x.style.display = "block";
249
249
  } catch (K) {
250
250
  console.error(K);
251
251
  } finally {
252
- g.dropzone.classList.remove("aw-dropzone-loading"), g.input.value = "";
252
+ y.dropzone.classList.remove("aw-dropzone-loading"), y.input.value = "";
253
253
  }
254
254
  });
255
255
  } else {
256
- const g = document.createElement("div");
257
- g.className = "aw-pane-notice", g.textContent = "개체 생성시 등록된 API 주소가 없습니다.", v.appendChild(g);
256
+ const y = document.createElement("div");
257
+ y.className = "aw-pane-notice", y.textContent = "개체 생성시 등록된 API 주소가 없습니다.", b.appendChild(y);
258
258
  }
259
- l.appendChild(m), l.appendChild(h), l.appendChild(v);
260
- let k = "embed", T, y;
261
- const L = (g) => {
262
- g === "upload" && !u || (k = g, c.classList.toggle("aw-tab-active", g === "embed"), a.classList.toggle("aw-tab-active", g === "url"), d.classList.toggle("aw-tab-active", g === "upload"), m.style.display = g === "embed" ? "block" : "none", h.style.display = g === "url" ? "block" : "none", v.style.display = g === "upload" ? "block" : "none");
259
+ l.appendChild(m), l.appendChild(p), l.appendChild(b);
260
+ let v = "embed", T, C;
261
+ const L = (y) => {
262
+ y === "upload" && !u || (v = y, a.classList.toggle("aw-tab-active", y === "embed"), c.classList.toggle("aw-tab-active", y === "url"), d.classList.toggle("aw-tab-active", y === "upload"), m.style.display = y === "embed" ? "block" : "none", p.style.display = y === "url" ? "block" : "none", b.style.display = y === "upload" ? "block" : "none");
263
263
  };
264
- L(k), c.addEventListener("click", () => L("embed")), a.addEventListener("click", () => L("url")), d.addEventListener("click", () => L("upload")), f.input.addEventListener("change", () => {
265
- var B;
266
- const g = (B = f.input.files) == null ? void 0 : B[0];
267
- if (!g) return;
264
+ L(v), a.addEventListener("click", () => L("embed")), c.addEventListener("click", () => L("url")), d.addEventListener("click", () => L("upload")), h.input.addEventListener("change", () => {
265
+ var $;
266
+ const y = ($ = h.input.files) == null ? void 0 : $[0];
267
+ if (!y) return;
268
268
  const x = new FileReader();
269
269
  x.onload = () => {
270
- const $ = String(x.result ?? "");
271
- T = $, p.style.backgroundImage = `url(${JSON.stringify($)})`, p.style.display = "block", f.input.value = "";
272
- }, x.readAsDataURL(g);
270
+ const z = String(x.result ?? "");
271
+ T = z, f.style.backgroundImage = `url(${JSON.stringify(z)})`, f.style.display = "block", h.input.value = "";
272
+ }, x.readAsDataURL(y);
273
273
  });
274
274
  const A = document.createElement("button");
275
275
  A.type = "button", A.className = "aw-btn aw-btn-ghost", A.textContent = "취소";
@@ -277,10 +277,10 @@ function Ze(n = {}, e) {
277
277
  M.type = "button", M.className = "aw-btn aw-btn-primary", M.textContent = "확인", i.appendChild(A), i.appendChild(M), A.addEventListener("click", () => {
278
278
  r(), t({ confirmed: !1 });
279
279
  }), M.addEventListener("click", () => {
280
- let g;
281
- k === "embed" ? g = T : k === "url" ? g = b.value || void 0 : k === "upload" && (g = y), r();
280
+ let y;
281
+ v === "embed" ? y = T : v === "url" ? y = g.value || void 0 : v === "upload" && (y = C), r();
282
282
  const x = { confirmed: !0 };
283
- g && (x.src = g), t(x);
283
+ y && (x.src = y), t(x);
284
284
  }), document.body.appendChild(o);
285
285
  });
286
286
  }
@@ -293,7 +293,7 @@ function me(n) {
293
293
  const t = document.createElement("input");
294
294
  return t.type = "file", t.accept = "image/*", t.style.display = "none", e.appendChild(t), { dropzone: e, input: t };
295
295
  }
296
- function Xe(n) {
296
+ function Je(n) {
297
297
  return new Promise((e) => {
298
298
  const { overlay: t, body: o, footer: l, close: i } = P("HTML", n), r = document.createElement("input");
299
299
  r.type = "file", r.accept = ".html,.htm,text/html", r.style.display = "none";
@@ -302,49 +302,49 @@ function Xe(n) {
302
302
  ${E.importHtml}
303
303
  <div class="aw-dropzone-text">HTML 파일 선택<br/>드래그 앤 드롭 또는 클릭</div>
304
304
  `, s.appendChild(r);
305
- const c = document.createElement("div");
306
- c.className = "aw-dialog-hint", c.textContent = "선택된 파일 없음";
307
- const a = document.createElement("textarea");
308
- a.className = "aw-input aw-textarea", a.placeholder = "또는 HTML 을 직접 붙여넣기…", a.rows = 8, o.appendChild(s), o.appendChild(c), o.appendChild(R("직접 붙여넣기", a));
305
+ const a = document.createElement("div");
306
+ a.className = "aw-dialog-hint", a.textContent = "선택된 파일 없음";
307
+ const c = document.createElement("textarea");
308
+ c.className = "aw-input aw-textarea", c.placeholder = "또는 HTML 을 직접 붙여넣기…", c.rows = 8, o.appendChild(s), o.appendChild(a), o.appendChild(R("직접 붙여넣기", c));
309
309
  const d = document.createElement("div");
310
310
  d.className = "aw-dialog-hint", d.textContent = "iframe 으로 로드한 후 모든 스타일을 인라인으로 합쳐 가져옵니다.", o.appendChild(d);
311
311
  let u;
312
312
  r.addEventListener("change", () => {
313
- var b;
314
- const p = (b = r.files) == null ? void 0 : b[0];
315
- if (!p) return;
316
- const h = new FileReader();
317
- h.onload = () => {
318
- u = String(h.result ?? ""), a.value = u, c.textContent = `${p.name} (${p.size.toLocaleString()} bytes)`, r.value = "";
319
- }, h.readAsText(p);
320
- }), s.addEventListener("dragover", (p) => {
321
- p.preventDefault(), s.classList.add("aw-dropzone-loading");
313
+ var g;
314
+ const f = (g = r.files) == null ? void 0 : g[0];
315
+ if (!f) return;
316
+ const p = new FileReader();
317
+ p.onload = () => {
318
+ u = String(p.result ?? ""), c.value = u, a.textContent = `${f.name} (${f.size.toLocaleString()} bytes)`, r.value = "";
319
+ }, p.readAsText(f);
320
+ }), s.addEventListener("dragover", (f) => {
321
+ f.preventDefault(), s.classList.add("aw-dropzone-loading");
322
322
  }), s.addEventListener("dragleave", () => {
323
323
  s.classList.remove("aw-dropzone-loading");
324
- }), s.addEventListener("drop", (p) => {
325
- var v, k;
326
- p.preventDefault(), s.classList.remove("aw-dropzone-loading");
327
- const h = (k = (v = p.dataTransfer) == null ? void 0 : v.files) == null ? void 0 : k[0];
328
- if (!h) return;
329
- const b = new FileReader();
330
- b.onload = () => {
331
- u = String(b.result ?? ""), a.value = u, c.textContent = `${h.name} (${h.size.toLocaleString()} bytes)`;
332
- }, b.readAsText(h);
324
+ }), s.addEventListener("drop", (f) => {
325
+ var b, v;
326
+ f.preventDefault(), s.classList.remove("aw-dropzone-loading");
327
+ const p = (v = (b = f.dataTransfer) == null ? void 0 : b.files) == null ? void 0 : v[0];
328
+ if (!p) return;
329
+ const g = new FileReader();
330
+ g.onload = () => {
331
+ u = String(g.result ?? ""), c.value = u, a.textContent = `${p.name} (${p.size.toLocaleString()} bytes)`;
332
+ }, g.readAsText(p);
333
333
  });
334
334
  const m = document.createElement("button");
335
335
  m.type = "button", m.className = "aw-btn aw-btn-ghost", m.textContent = "취소";
336
- const f = document.createElement("button");
337
- f.type = "button", f.className = "aw-btn aw-btn-primary", f.textContent = "가져오기", l.appendChild(m), l.appendChild(f), m.addEventListener("click", () => {
336
+ const h = document.createElement("button");
337
+ h.type = "button", h.className = "aw-btn aw-btn-primary", h.textContent = "가져오기", l.appendChild(m), l.appendChild(h), m.addEventListener("click", () => {
338
338
  i(), e({ confirmed: !1 });
339
- }), f.addEventListener("click", () => {
340
- const p = a.value.trim();
339
+ }), h.addEventListener("click", () => {
340
+ const f = c.value.trim();
341
341
  i();
342
- const h = { confirmed: !0 };
343
- p.length > 0 && (h.html = p), e(h);
342
+ const p = { confirmed: !0 };
343
+ f.length > 0 && (p.html = f), e(p);
344
344
  }), document.body.appendChild(t);
345
345
  });
346
346
  }
347
- function Qe(n) {
347
+ function et(n) {
348
348
  return new Promise((e) => {
349
349
  const { overlay: t, body: o, footer: l, close: i } = P("Markdown", n), r = document.createElement("input");
350
350
  r.type = "file", r.accept = ".md,.markdown,text/markdown,text/plain", r.style.display = "none";
@@ -353,34 +353,34 @@ function Qe(n) {
353
353
  ${E.importMarkdown}
354
354
  <div class="aw-dropzone-text">Markdown 파일 선택<br/>드래그 앤 드롭 또는 클릭</div>
355
355
  `, s.appendChild(r);
356
- const c = document.createElement("div");
357
- c.className = "aw-dialog-hint", c.textContent = "선택된 파일 없음";
358
- const a = document.createElement("textarea");
359
- a.className = "aw-input aw-textarea", a.placeholder = "또는 Markdown 을 직접 붙여넣기…", a.rows = 8, o.appendChild(s), o.appendChild(c), o.appendChild(R("직접 붙여넣기", a));
356
+ const a = document.createElement("div");
357
+ a.className = "aw-dialog-hint", a.textContent = "선택된 파일 없음";
358
+ const c = document.createElement("textarea");
359
+ c.className = "aw-input aw-textarea", c.placeholder = "또는 Markdown 을 직접 붙여넣기…", c.rows = 8, o.appendChild(s), o.appendChild(a), o.appendChild(R("직접 붙여넣기", c));
360
360
  const d = document.createElement("div");
361
361
  d.className = "aw-dialog-hint", d.textContent = "CommonMark 기본 문법(제목/목록/링크/코드/표/인용 등) 지원", o.appendChild(d), r.addEventListener("change", () => {
362
- var h;
363
- const f = (h = r.files) == null ? void 0 : h[0];
362
+ var p;
363
+ const h = (p = r.files) == null ? void 0 : p[0];
364
+ if (!h) return;
365
+ const f = new FileReader();
366
+ f.onload = () => {
367
+ const g = String(f.result ?? "");
368
+ c.value = g, a.textContent = `${h.name} (${h.size.toLocaleString()} bytes)`, r.value = "";
369
+ }, f.readAsText(h);
370
+ }), s.addEventListener("dragover", (h) => {
371
+ h.preventDefault(), s.classList.add("aw-dropzone-loading");
372
+ }), s.addEventListener("dragleave", () => {
373
+ s.classList.remove("aw-dropzone-loading");
374
+ }), s.addEventListener("drop", (h) => {
375
+ var g, b;
376
+ h.preventDefault(), s.classList.remove("aw-dropzone-loading");
377
+ const f = (b = (g = h.dataTransfer) == null ? void 0 : g.files) == null ? void 0 : b[0];
364
378
  if (!f) return;
365
379
  const p = new FileReader();
366
380
  p.onload = () => {
367
- const b = String(p.result ?? "");
368
- a.value = b, c.textContent = `${f.name} (${f.size.toLocaleString()} bytes)`, r.value = "";
381
+ const v = String(p.result ?? "");
382
+ c.value = v, a.textContent = `${f.name} (${f.size.toLocaleString()} bytes)`;
369
383
  }, p.readAsText(f);
370
- }), s.addEventListener("dragover", (f) => {
371
- f.preventDefault(), s.classList.add("aw-dropzone-loading");
372
- }), s.addEventListener("dragleave", () => {
373
- s.classList.remove("aw-dropzone-loading");
374
- }), s.addEventListener("drop", (f) => {
375
- var b, v;
376
- f.preventDefault(), s.classList.remove("aw-dropzone-loading");
377
- const p = (v = (b = f.dataTransfer) == null ? void 0 : b.files) == null ? void 0 : v[0];
378
- if (!p) return;
379
- const h = new FileReader();
380
- h.onload = () => {
381
- const k = String(h.result ?? "");
382
- a.value = k, c.textContent = `${p.name} (${p.size.toLocaleString()} bytes)`;
383
- }, h.readAsText(p);
384
384
  });
385
385
  const u = document.createElement("button");
386
386
  u.type = "button", u.className = "aw-btn aw-btn-ghost", u.textContent = "취소";
@@ -388,115 +388,115 @@ function Qe(n) {
388
388
  m.type = "button", m.className = "aw-btn aw-btn-primary", m.textContent = "가져오기", l.appendChild(u), l.appendChild(m), u.addEventListener("click", () => {
389
389
  i(), e({ confirmed: !1 });
390
390
  }), m.addEventListener("click", () => {
391
- const f = a.value.trim();
391
+ const h = c.value.trim();
392
392
  i();
393
- const p = { confirmed: !0 };
394
- f.length > 0 && (p.markdown = f), e(p);
393
+ const f = { confirmed: !0 };
394
+ h.length > 0 && (f.markdown = h), e(f);
395
395
  }), document.body.appendChild(t);
396
396
  });
397
397
  }
398
- function Je(n = {}, e) {
398
+ function tt(n = {}, e) {
399
399
  return new Promise((t) => {
400
400
  const { overlay: o, body: l, footer: i, close: r } = P("파일 첨부", e), s = document.createElement("div");
401
401
  s.className = "aw-tabs";
402
- const c = document.createElement("button");
403
- c.type = "button", c.className = "aw-tab", c.textContent = "URL", c.title = "이미 호스팅된 파일의 URL 직접 입력";
404
402
  const a = document.createElement("button");
405
- a.type = "button", a.className = "aw-tab", a.textContent = "업로드";
403
+ a.type = "button", a.className = "aw-tab", a.textContent = "URL", a.title = "이미 호스팅된 파일의 URL 직접 입력";
404
+ const c = document.createElement("button");
405
+ c.type = "button", c.className = "aw-tab", c.textContent = "업로드";
406
406
  const d = !!n.onUpload;
407
- d ? a.title = "서버 API 로 업로드 후 응답 URL 사용" : (a.disabled = !0, a.classList.add("aw-tab-disabled"), a.title = "개체 생성시 등록된 파일 업로드 API 가 없습니다."), s.appendChild(c), s.appendChild(a), l.appendChild(s);
407
+ d ? c.title = "서버 API 로 업로드 후 응답 URL 사용" : (c.disabled = !0, c.classList.add("aw-tab-disabled"), c.title = "개체 생성시 등록된 파일 업로드 API 가 없습니다."), s.appendChild(a), s.appendChild(c), l.appendChild(s);
408
408
  const u = document.createElement("div");
409
409
  u.className = "aw-pane";
410
410
  const m = document.createElement("input");
411
411
  m.type = "url", m.className = "aw-input", m.placeholder = "https://example.com/files/report.pdf", u.appendChild(R("파일 URL", m));
412
- const f = document.createElement("input");
413
- f.type = "text", f.className = "aw-input", f.placeholder = "표시할 파일명 (예: report.pdf)", u.appendChild(R("파일명", f));
414
- const p = document.createElement("div");
415
- p.className = "aw-pane";
416
- let h;
412
+ const h = document.createElement("input");
413
+ h.type = "text", h.className = "aw-input", h.placeholder = "표시할 파일명 (예: report.pdf)", u.appendChild(R("파일명", h));
414
+ const f = document.createElement("div");
415
+ f.className = "aw-pane";
416
+ let p;
417
417
  if (d) {
418
- const y = document.createElement("label");
419
- y.className = "aw-dropzone", y.innerHTML = `
418
+ const C = document.createElement("label");
419
+ C.className = "aw-dropzone", C.innerHTML = `
420
420
  ${E.upload}
421
421
  <div class="aw-dropzone-text">서버 업로드용 파일 선택<br/>드래그 앤 드롭 또는 클릭</div>
422
422
  `;
423
423
  const L = document.createElement("input");
424
- L.type = "file", L.style.display = "none", y.appendChild(L);
424
+ L.type = "file", L.style.display = "none", C.appendChild(L);
425
425
  const A = document.createElement("div");
426
- A.className = "aw-dialog-hint", A.textContent = "선택된 파일 없음", p.appendChild(y), p.appendChild(A);
427
- const M = async (g) => {
426
+ A.className = "aw-dialog-hint", A.textContent = "선택된 파일 없음", f.appendChild(C), f.appendChild(A);
427
+ const M = async (y) => {
428
428
  if (n.onUpload)
429
429
  try {
430
- y.classList.add("aw-dropzone-loading"), h = {
431
- src: await n.onUpload(g),
432
- name: g.name,
433
- size: g.size,
434
- type: g.type || ""
435
- }, A.textContent = `${g.name} (${g.size.toLocaleString()} bytes) — 업로드 완료`;
430
+ C.classList.add("aw-dropzone-loading"), p = {
431
+ src: await n.onUpload(y),
432
+ name: y.name,
433
+ size: y.size,
434
+ type: y.type || ""
435
+ }, A.textContent = `${y.name} (${y.size.toLocaleString()} bytes) — 업로드 완료`;
436
436
  } catch (x) {
437
437
  console.error(x), A.textContent = `업로드 실패: ${x instanceof Error ? x.message : String(x)}`;
438
438
  } finally {
439
- y.classList.remove("aw-dropzone-loading"), L.value = "";
439
+ C.classList.remove("aw-dropzone-loading"), L.value = "";
440
440
  }
441
441
  };
442
442
  L.addEventListener("change", () => {
443
443
  var x;
444
- const g = (x = L.files) == null ? void 0 : x[0];
445
- g && M(g);
446
- }), y.addEventListener("dragover", (g) => {
447
- g.preventDefault(), y.classList.add("aw-dropzone-loading");
448
- }), y.addEventListener("dragleave", () => {
449
- y.classList.remove("aw-dropzone-loading");
450
- }), y.addEventListener("drop", (g) => {
451
- var B, $;
452
- g.preventDefault();
453
- const x = ($ = (B = g.dataTransfer) == null ? void 0 : B.files) == null ? void 0 : $[0];
444
+ const y = (x = L.files) == null ? void 0 : x[0];
445
+ y && M(y);
446
+ }), C.addEventListener("dragover", (y) => {
447
+ y.preventDefault(), C.classList.add("aw-dropzone-loading");
448
+ }), C.addEventListener("dragleave", () => {
449
+ C.classList.remove("aw-dropzone-loading");
450
+ }), C.addEventListener("drop", (y) => {
451
+ var $, z;
452
+ y.preventDefault();
453
+ const x = (z = ($ = y.dataTransfer) == null ? void 0 : $.files) == null ? void 0 : z[0];
454
454
  x && M(x);
455
455
  });
456
456
  } else {
457
- const y = document.createElement("div");
458
- y.className = "aw-pane-notice", y.textContent = "개체 생성시 등록된 파일 업로드 API 가 없습니다.", p.appendChild(y);
457
+ const C = document.createElement("div");
458
+ C.className = "aw-pane-notice", C.textContent = "개체 생성시 등록된 파일 업로드 API 가 없습니다.", f.appendChild(C);
459
459
  }
460
- l.appendChild(u), l.appendChild(p);
461
- let b = "url";
462
- const v = (y) => {
463
- y === "upload" && !d || (b = y, c.classList.toggle("aw-tab-active", y === "url"), a.classList.toggle("aw-tab-active", y === "upload"), u.style.display = y === "url" ? "block" : "none", p.style.display = y === "upload" ? "block" : "none");
460
+ l.appendChild(u), l.appendChild(f);
461
+ let g = "url";
462
+ const b = (C) => {
463
+ C === "upload" && !d || (g = C, a.classList.toggle("aw-tab-active", C === "url"), c.classList.toggle("aw-tab-active", C === "upload"), u.style.display = C === "url" ? "block" : "none", f.style.display = C === "upload" ? "block" : "none");
464
464
  };
465
- v(b), c.addEventListener("click", () => v("url")), a.addEventListener("click", () => v("upload"));
466
- const k = document.createElement("button");
467
- k.type = "button", k.className = "aw-btn aw-btn-ghost", k.textContent = "취소";
465
+ b(g), a.addEventListener("click", () => b("url")), c.addEventListener("click", () => b("upload"));
466
+ const v = document.createElement("button");
467
+ v.type = "button", v.className = "aw-btn aw-btn-ghost", v.textContent = "취소";
468
468
  const T = document.createElement("button");
469
- T.type = "button", T.className = "aw-btn aw-btn-primary", T.textContent = "확인", i.appendChild(k), i.appendChild(T), k.addEventListener("click", () => {
469
+ T.type = "button", T.className = "aw-btn aw-btn-primary", T.textContent = "확인", i.appendChild(v), i.appendChild(T), v.addEventListener("click", () => {
470
470
  r(), t({ confirmed: !1 });
471
471
  }), T.addEventListener("click", () => {
472
- const y = { confirmed: !0 };
473
- if (b === "url") {
474
- const L = m.value.trim(), A = f.value.trim();
475
- L.length > 0 && (y.src = L), A.length > 0 && (y.name = A);
476
- } else h && (y.src = h.src, y.name = h.name, y.size = h.size, h.type && (y.type = h.type));
477
- r(), t(y);
472
+ const C = { confirmed: !0 };
473
+ if (g === "url") {
474
+ const L = m.value.trim(), A = h.value.trim();
475
+ L.length > 0 && (C.src = L), A.length > 0 && (C.name = A);
476
+ } else p && (C.src = p.src, C.name = p.name, C.size = p.size, p.type && (C.type = p.type));
477
+ r(), t(C);
478
478
  }), document.body.appendChild(o);
479
479
  });
480
480
  }
481
- function et(n) {
481
+ function nt(n) {
482
482
  return new Promise((e) => {
483
483
  const { overlay: t, body: o, footer: l, close: i } = P("유튜브 임베드", n), r = document.createElement("input");
484
484
  r.type = "url", r.className = "aw-input", r.placeholder = "https://www.youtube.com/watch?v=…", o.appendChild(R("YouTube URL", r));
485
485
  const s = document.createElement("div");
486
486
  s.className = "aw-dialog-hint", s.textContent = "youtu.be / youtube.com/watch / /embed / /shorts 형식 모두 지원", o.appendChild(s);
487
- const c = document.createElement("button");
488
- c.type = "button", c.className = "aw-btn aw-btn-ghost", c.textContent = "취소";
489
487
  const a = document.createElement("button");
490
- a.type = "button", a.className = "aw-btn aw-btn-primary", a.textContent = "확인", l.appendChild(c), l.appendChild(a), c.addEventListener("click", () => {
488
+ a.type = "button", a.className = "aw-btn aw-btn-ghost", a.textContent = "취소";
489
+ const c = document.createElement("button");
490
+ c.type = "button", c.className = "aw-btn aw-btn-primary", c.textContent = "확인", l.appendChild(a), l.appendChild(c), a.addEventListener("click", () => {
491
491
  i(), e({ confirmed: !1 });
492
- }), a.addEventListener("click", () => {
492
+ }), c.addEventListener("click", () => {
493
493
  i(), e({ confirmed: !0, url: r.value });
494
494
  }), document.body.appendChild(t), setTimeout(() => r.focus(), 0);
495
495
  });
496
496
  }
497
- const tt = "system", W = [
497
+ const ot = "system", W = [
498
498
  {
499
- id: tt,
499
+ id: ot,
500
500
  label: "시스템 기본",
501
501
  stack: '-apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif'
502
502
  },
@@ -554,7 +554,7 @@ const tt = "system", W = [
554
554
  for (const e of W) n[e.id] = e;
555
555
  return n;
556
556
  })();
557
- const nt = [
557
+ const lt = [
558
558
  12,
559
559
  13,
560
560
  14,
@@ -568,7 +568,7 @@ const nt = [
568
568
  40,
569
569
  48
570
570
  ];
571
- function ot(n) {
571
+ function it(n) {
572
572
  if (!n) return null;
573
573
  const e = n.trim(), t = /^(\d+(?:\.\d+)?)px$/i.exec(e);
574
574
  if (t && t[1]) return Math.round(Number(t[1]));
@@ -576,7 +576,7 @@ function ot(n) {
576
576
  return o && o[1] ? Math.round(Number(o[1]) * 16) : null;
577
577
  }
578
578
  let fe = !1;
579
- function lt() {
579
+ function rt() {
580
580
  if (fe || (fe = !0, typeof document > "u")) return;
581
581
  const n = W.map((e) => e.googleFonts).filter((e) => typeof e == "string" && e.length > 0);
582
582
  if (n.length > 0) {
@@ -593,7 +593,7 @@ function ge(n) {
593
593
  const t = document.createElement("link");
594
594
  t.rel = "stylesheet", t.href = n, document.head.appendChild(t);
595
595
  }
596
- function it(n) {
596
+ function st(n) {
597
597
  var o;
598
598
  if (!n) return null;
599
599
  const e = be(n);
@@ -610,11 +610,11 @@ function be(n) {
610
610
  const e = (t = n.split(",")[0]) == null ? void 0 : t.trim();
611
611
  return e ? e.replace(/^["']|["']$/g, "") : null;
612
612
  }
613
- const N = {
613
+ const B = {
614
614
  lineComment: "//",
615
615
  blockComment: { start: "/*", end: "*/" },
616
616
  stringDelims: ['"', "'"]
617
- }, Te = /* @__PURE__ */ new Set([
617
+ }, Me = /* @__PURE__ */ new Set([
618
618
  "abstract",
619
619
  "arguments",
620
620
  "async",
@@ -669,8 +669,8 @@ const N = {
669
669
  "while",
670
670
  "with",
671
671
  "yield"
672
- ]), rt = /* @__PURE__ */ new Set([
673
- ...Te,
672
+ ]), at = /* @__PURE__ */ new Set([
673
+ ...Me,
674
674
  "any",
675
675
  "as",
676
676
  "asserts",
@@ -693,7 +693,7 @@ const N = {
693
693
  "type",
694
694
  "unique",
695
695
  "unknown"
696
- ]), st = /* @__PURE__ */ new Set([
696
+ ]), ct = /* @__PURE__ */ new Set([
697
697
  "False",
698
698
  "None",
699
699
  "True",
@@ -729,7 +729,7 @@ const N = {
729
729
  "while",
730
730
  "with",
731
731
  "yield"
732
- ]), at = /* @__PURE__ */ new Set([
732
+ ]), dt = /* @__PURE__ */ new Set([
733
733
  "abs",
734
734
  "all",
735
735
  "any",
@@ -757,7 +757,7 @@ const N = {
757
757
  "zip",
758
758
  "self",
759
759
  "cls"
760
- ]), Ne = /* @__PURE__ */ new Set([
760
+ ]), Be = /* @__PURE__ */ new Set([
761
761
  "auto",
762
762
  "break",
763
763
  "case",
@@ -794,8 +794,8 @@ const N = {
794
794
  "restrict",
795
795
  "_Bool",
796
796
  "NULL"
797
- ]), ct = /* @__PURE__ */ new Set([
798
- ...Ne,
797
+ ]), ut = /* @__PURE__ */ new Set([
798
+ ...Be,
799
799
  "class",
800
800
  "new",
801
801
  "delete",
@@ -829,7 +829,7 @@ const N = {
829
829
  "noexcept",
830
830
  "final",
831
831
  "auto"
832
- ]), dt = /* @__PURE__ */ new Set([
832
+ ]), pt = /* @__PURE__ */ new Set([
833
833
  "abstract",
834
834
  "async",
835
835
  "await",
@@ -914,7 +914,7 @@ const N = {
914
914
  "init",
915
915
  "nameof",
916
916
  "when"
917
- ]), ut = /* @__PURE__ */ new Set([
917
+ ]), ht = /* @__PURE__ */ new Set([
918
918
  "abstract",
919
919
  "assert",
920
920
  "boolean",
@@ -974,7 +974,7 @@ const N = {
974
974
  "sealed",
975
975
  "permits",
976
976
  "non-sealed"
977
- ]), pt = /* @__PURE__ */ new Set([
977
+ ]), mt = /* @__PURE__ */ new Set([
978
978
  "abstract",
979
979
  "actual",
980
980
  "annotation",
@@ -1041,7 +1041,7 @@ const N = {
1041
1041
  "when",
1042
1042
  "where",
1043
1043
  "while"
1044
- ]), ht = /* @__PURE__ */ new Set([
1044
+ ]), ft = /* @__PURE__ */ new Set([
1045
1045
  "break",
1046
1046
  "case",
1047
1047
  "chan",
@@ -1071,7 +1071,7 @@ const N = {
1071
1071
  "false",
1072
1072
  "nil",
1073
1073
  "iota"
1074
- ]), mt = /* @__PURE__ */ new Set([
1074
+ ]), gt = /* @__PURE__ */ new Set([
1075
1075
  "as",
1076
1076
  "async",
1077
1077
  "await",
@@ -1120,7 +1120,7 @@ const N = {
1120
1120
  "unsized",
1121
1121
  "virtual",
1122
1122
  "yield"
1123
- ]), ft = /* @__PURE__ */ new Set([
1123
+ ]), bt = /* @__PURE__ */ new Set([
1124
1124
  "if",
1125
1125
  "then",
1126
1126
  "else",
@@ -1151,7 +1151,7 @@ const N = {
1151
1151
  "source",
1152
1152
  "true",
1153
1153
  "false"
1154
- ]), gt = /* @__PURE__ */ new Set([
1154
+ ]), yt = /* @__PURE__ */ new Set([
1155
1155
  "select",
1156
1156
  "from",
1157
1157
  "where",
@@ -1220,7 +1220,7 @@ const N = {
1220
1220
  "max",
1221
1221
  "asc",
1222
1222
  "desc"
1223
- ]), bt = /* @__PURE__ */ new Set(["true", "false", "null"]), Me = [
1223
+ ]), wt = /* @__PURE__ */ new Set(["true", "false", "null"]), $e = [
1224
1224
  {
1225
1225
  id: "plaintext",
1226
1226
  label: "Plain Text",
@@ -1229,54 +1229,54 @@ const N = {
1229
1229
  {
1230
1230
  id: "javascript",
1231
1231
  label: "JavaScript",
1232
- keywords: Te,
1233
- ...N,
1232
+ keywords: Me,
1233
+ ...B,
1234
1234
  stringDelims: ['"', "'", "`"]
1235
1235
  },
1236
1236
  {
1237
1237
  id: "typescript",
1238
1238
  label: "TypeScript",
1239
- keywords: rt,
1240
- ...N,
1239
+ keywords: at,
1240
+ ...B,
1241
1241
  stringDelims: ['"', "'", "`"]
1242
1242
  },
1243
1243
  {
1244
1244
  id: "python",
1245
1245
  label: "Python",
1246
- keywords: st,
1247
- builtins: at,
1246
+ keywords: ct,
1247
+ builtins: dt,
1248
1248
  lineComment: "#",
1249
1249
  stringDelims: ['"', "'"]
1250
1250
  },
1251
1251
  {
1252
1252
  id: "json",
1253
1253
  label: "JSON",
1254
- keywords: bt,
1254
+ keywords: wt,
1255
1255
  stringDelims: ['"']
1256
1256
  },
1257
1257
  {
1258
1258
  id: "html",
1259
1259
  label: "HTML",
1260
1260
  keywords: /* @__PURE__ */ new Set(),
1261
- custom: (n) => Ct(n)
1261
+ custom: (n) => Et(n)
1262
1262
  },
1263
1263
  {
1264
1264
  id: "css",
1265
1265
  label: "CSS",
1266
1266
  keywords: /* @__PURE__ */ new Set(),
1267
- custom: (n) => Et(n)
1267
+ custom: (n) => At(n)
1268
1268
  },
1269
1269
  {
1270
1270
  id: "bash",
1271
1271
  label: "Bash",
1272
- keywords: ft,
1272
+ keywords: bt,
1273
1273
  lineComment: "#",
1274
1274
  stringDelims: ['"', "'"]
1275
1275
  },
1276
1276
  {
1277
1277
  id: "sql",
1278
1278
  label: "SQL",
1279
- keywords: gt,
1279
+ keywords: yt,
1280
1280
  caseInsensitiveKeywords: !0,
1281
1281
  lineComment: "--",
1282
1282
  blockComment: { start: "/*", end: "*/" },
@@ -1286,26 +1286,26 @@ const N = {
1286
1286
  id: "markdown",
1287
1287
  label: "Markdown",
1288
1288
  keywords: /* @__PURE__ */ new Set(),
1289
- custom: (n) => Lt(n)
1289
+ custom: (n) => St(n)
1290
1290
  },
1291
- { id: "c", label: "C", keywords: Ne, ...N },
1292
- { id: "cpp", label: "C++", keywords: ct, ...N },
1293
- { id: "csharp", label: "C#", keywords: dt, ...N },
1294
- { id: "java", label: "Java", keywords: ut, ...N },
1295
- { id: "kotlin", label: "Kotlin", keywords: pt, ...N },
1296
- { id: "go", label: "Go", keywords: ht, ...N },
1297
- { id: "rust", label: "Rust", keywords: mt, ...N }
1298
- ], yt = (() => {
1291
+ { id: "c", label: "C", keywords: Be, ...B },
1292
+ { id: "cpp", label: "C++", keywords: ut, ...B },
1293
+ { id: "csharp", label: "C#", keywords: pt, ...B },
1294
+ { id: "java", label: "Java", keywords: ht, ...B },
1295
+ { id: "kotlin", label: "Kotlin", keywords: mt, ...B },
1296
+ { id: "go", label: "Go", keywords: ft, ...B },
1297
+ { id: "rust", label: "Rust", keywords: gt, ...B }
1298
+ ], kt = (() => {
1299
1299
  const n = /* @__PURE__ */ new Map();
1300
- for (const e of Me) n.set(e.id, e);
1300
+ for (const e of $e) n.set(e.id, e);
1301
1301
  return n;
1302
1302
  })();
1303
- function wt(n, e) {
1304
- if (!e) return C(n);
1305
- const t = yt.get(e);
1306
- return t ? t.custom ? t.custom(n) : kt(n, t) : C(n);
1303
+ function vt(n, e) {
1304
+ if (!e) return k(n);
1305
+ const t = kt.get(e);
1306
+ return t ? t.custom ? t.custom(n) : Ct(n, t) : k(n);
1307
1307
  }
1308
- function kt(n, e) {
1308
+ function Ct(n, e) {
1309
1309
  var r, s;
1310
1310
  const t = !!e.caseInsensitiveKeywords;
1311
1311
  let o = "", l = 0;
@@ -1314,128 +1314,128 @@ function kt(n, e) {
1314
1314
  if (e.lineComment && n.startsWith(e.lineComment, l)) {
1315
1315
  const d = n.indexOf(`
1316
1316
  `, l), u = d === -1 ? i : d;
1317
- o += `<span class="hl-comment">${C(n.slice(l, u))}</span>`, l = u;
1317
+ o += `<span class="hl-comment">${k(n.slice(l, u))}</span>`, l = u;
1318
1318
  continue;
1319
1319
  }
1320
1320
  if (e.blockComment && n.startsWith(e.blockComment.start, l)) {
1321
1321
  const d = n.indexOf(e.blockComment.end, l + e.blockComment.start.length), u = d === -1 ? i : d + e.blockComment.end.length;
1322
- o += `<span class="hl-comment">${C(n.slice(l, u))}</span>`, l = u;
1322
+ o += `<span class="hl-comment">${k(n.slice(l, u))}</span>`, l = u;
1323
1323
  continue;
1324
1324
  }
1325
- const c = (r = e.stringDelims) == null ? void 0 : r.find((d) => n.startsWith(d, l));
1326
- if (c) {
1327
- let d = l + c.length;
1325
+ const a = (r = e.stringDelims) == null ? void 0 : r.find((d) => n.startsWith(d, l));
1326
+ if (a) {
1327
+ let d = l + a.length;
1328
1328
  for (; d < i; ) {
1329
1329
  const u = n[d] ?? "";
1330
1330
  if (u === "\\") {
1331
1331
  d += 2;
1332
1332
  continue;
1333
1333
  }
1334
- if (n.startsWith(c, d)) {
1335
- d += c.length;
1334
+ if (n.startsWith(a, d)) {
1335
+ d += a.length;
1336
1336
  break;
1337
1337
  }
1338
1338
  if (u === `
1339
- ` && c !== "`") break;
1339
+ ` && a !== "`") break;
1340
1340
  d++;
1341
1341
  }
1342
- o += `<span class="hl-string">${C(n.slice(l, d))}</span>`, l = d;
1342
+ o += `<span class="hl-string">${k(n.slice(l, d))}</span>`, l = d;
1343
1343
  continue;
1344
1344
  }
1345
- const a = n[l] ?? "";
1346
- if (/[0-9]/.test(a)) {
1347
- const d = vt.exec(n.slice(l));
1345
+ const c = n[l] ?? "";
1346
+ if (/[0-9]/.test(c)) {
1347
+ const d = xt.exec(n.slice(l));
1348
1348
  if (d) {
1349
- o += `<span class="hl-number">${C(d[0])}</span>`, l += d[0].length;
1349
+ o += `<span class="hl-number">${k(d[0])}</span>`, l += d[0].length;
1350
1350
  continue;
1351
1351
  }
1352
1352
  }
1353
- if (/[a-zA-Z_$]/.test(a)) {
1353
+ if (/[a-zA-Z_$]/.test(c)) {
1354
1354
  let d = l + 1;
1355
1355
  for (; d < i && /[a-zA-Z0-9_$]/.test(n[d] ?? ""); ) d++;
1356
1356
  const u = n.slice(l, d), m = t ? u.toLowerCase() : u;
1357
1357
  if (e.keywords.has(m))
1358
- o += `<span class="hl-keyword">${C(u)}</span>`;
1358
+ o += `<span class="hl-keyword">${k(u)}</span>`;
1359
1359
  else if ((s = e.builtins) != null && s.has(m))
1360
- o += `<span class="hl-builtin">${C(u)}</span>`;
1360
+ o += `<span class="hl-builtin">${k(u)}</span>`;
1361
1361
  else {
1362
- let f = d;
1363
- for (; f < i && (n[f] === " " || n[f] === " "); ) f++;
1364
- n[f] === "(" ? o += `<span class="hl-fn">${C(u)}</span>` : o += C(u);
1362
+ let h = d;
1363
+ for (; h < i && (n[h] === " " || n[h] === " "); ) h++;
1364
+ n[h] === "(" ? o += `<span class="hl-fn">${k(u)}</span>` : o += k(u);
1365
1365
  }
1366
1366
  l = d;
1367
1367
  continue;
1368
1368
  }
1369
- o += C(a), l++;
1369
+ o += k(c), l++;
1370
1370
  }
1371
1371
  return o;
1372
1372
  }
1373
- const vt = /^(0[xX][0-9a-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|[0-9][0-9_]*(?:\.[0-9_]+)?(?:[eE][-+]?[0-9_]+)?)[a-zA-Z]*/;
1374
- function Ct(n) {
1373
+ const xt = /^(0[xX][0-9a-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|[0-9][0-9_]*(?:\.[0-9_]+)?(?:[eE][-+]?[0-9_]+)?)[a-zA-Z]*/;
1374
+ function Et(n) {
1375
1375
  let e = "", t = 0;
1376
1376
  const o = n.length;
1377
1377
  for (; t < o; ) {
1378
1378
  if (n.startsWith("<!--", t)) {
1379
1379
  const l = n.indexOf("-->", t + 4), i = l === -1 ? o : l + 3;
1380
- e += `<span class="hl-comment">${C(n.slice(t, i))}</span>`, t = i;
1380
+ e += `<span class="hl-comment">${k(n.slice(t, i))}</span>`, t = i;
1381
1381
  continue;
1382
1382
  }
1383
1383
  if (n[t] === "<") {
1384
1384
  const l = n.indexOf(">", t);
1385
1385
  if (l === -1) {
1386
- e += C(n.slice(t));
1386
+ e += k(n.slice(t));
1387
1387
  break;
1388
1388
  }
1389
1389
  const i = n.slice(t, l + 1);
1390
- e += xt(i), t = l + 1;
1390
+ e += Lt(i), t = l + 1;
1391
1391
  continue;
1392
1392
  }
1393
- e += C(n[t] ?? ""), t++;
1393
+ e += k(n[t] ?? ""), t++;
1394
1394
  }
1395
1395
  return e;
1396
1396
  }
1397
- function xt(n) {
1397
+ function Lt(n) {
1398
1398
  const e = n.slice(1, -1);
1399
1399
  let t = '<span class="hl-punct">&lt;</span>';
1400
1400
  const o = /^\/?[a-zA-Z][a-zA-Z0-9-]*/.exec(e);
1401
1401
  if (o) {
1402
- t += `<span class="hl-tag">${C(o[0])}</span>`;
1402
+ t += `<span class="hl-tag">${k(o[0])}</span>`;
1403
1403
  let l = e.slice(o[0].length);
1404
1404
  const i = /\s+([a-zA-Z_:][a-zA-Z0-9_:.-]*)(\s*=\s*("([^"]*)"|'([^']*)'|([^\s>]+)))?/g;
1405
1405
  let r = 0, s;
1406
1406
  for (; s = i.exec(l); ) {
1407
- t += C(l.slice(r, s.index)), t += C(l.slice(s.index, s.index + s[0].indexOf(s[1] ?? ""))), t += `<span class="hl-attr">${C(s[1] ?? "")}</span>`;
1408
- const c = l.slice(s.index + (s[0].indexOf(s[1] ?? "") + (s[1] ?? "").length), s.index + s[0].length);
1409
- if (c.includes("=")) {
1410
- const a = c.indexOf("=");
1411
- t += C(c.slice(0, a + 1));
1412
- const d = c.slice(a + 1);
1413
- t += `<span class="hl-string">${C(d)}</span>`;
1407
+ t += k(l.slice(r, s.index)), t += k(l.slice(s.index, s.index + s[0].indexOf(s[1] ?? ""))), t += `<span class="hl-attr">${k(s[1] ?? "")}</span>`;
1408
+ const a = l.slice(s.index + (s[0].indexOf(s[1] ?? "") + (s[1] ?? "").length), s.index + s[0].length);
1409
+ if (a.includes("=")) {
1410
+ const c = a.indexOf("=");
1411
+ t += k(a.slice(0, c + 1));
1412
+ const d = a.slice(c + 1);
1413
+ t += `<span class="hl-string">${k(d)}</span>`;
1414
1414
  }
1415
1415
  r = s.index + s[0].length;
1416
1416
  }
1417
- t += C(l.slice(r));
1417
+ t += k(l.slice(r));
1418
1418
  } else
1419
- t += C(e);
1419
+ t += k(e);
1420
1420
  return t += '<span class="hl-punct">&gt;</span>', t;
1421
1421
  }
1422
- function Et(n) {
1422
+ function At(n) {
1423
1423
  let e = "", t = 0;
1424
1424
  const o = n.length;
1425
1425
  let l = !1;
1426
1426
  for (; t < o; ) {
1427
1427
  if (n.startsWith("/*", t)) {
1428
1428
  const r = n.indexOf("*/", t + 2), s = r === -1 ? o : r + 2;
1429
- e += `<span class="hl-comment">${C(n.slice(t, s))}</span>`, t = s;
1429
+ e += `<span class="hl-comment">${k(n.slice(t, s))}</span>`, t = s;
1430
1430
  continue;
1431
1431
  }
1432
1432
  const i = n[t] ?? "";
1433
1433
  if (i === "{") {
1434
- l = !0, e += C(i), t++;
1434
+ l = !0, e += k(i), t++;
1435
1435
  continue;
1436
1436
  }
1437
1437
  if (i === "}") {
1438
- l = !1, e += C(i), t++;
1438
+ l = !1, e += k(i), t++;
1439
1439
  continue;
1440
1440
  }
1441
1441
  if (i === '"' || i === "'") {
@@ -1443,7 +1443,7 @@ function Et(n) {
1443
1443
  let s = t + 1;
1444
1444
  for (; s < o && n[s] !== r; )
1445
1445
  n[s] === "\\" ? s += 2 : s++;
1446
- s = Math.min(s + 1, o), e += `<span class="hl-string">${C(n.slice(t, s))}</span>`, t = s;
1446
+ s = Math.min(s + 1, o), e += `<span class="hl-string">${k(n.slice(t, s))}</span>`, t = s;
1447
1447
  continue;
1448
1448
  }
1449
1449
  if (/[a-zA-Z_-]/.test(i) || i === "@" || i === "#" || i === "." || i === ":") {
@@ -1451,51 +1451,51 @@ function Et(n) {
1451
1451
  for (; r < o && /[a-zA-Z0-9_-]/.test(n[r] ?? ""); ) r++;
1452
1452
  const s = n.slice(t, r);
1453
1453
  if (i === "@")
1454
- e += `<span class="hl-keyword">${C(s)}</span>`;
1454
+ e += `<span class="hl-keyword">${k(s)}</span>`;
1455
1455
  else if (l && /^[a-zA-Z-]+$/.test(s)) {
1456
- let c = r;
1457
- for (; c < o && (n[c] === " " || n[c] === " "); ) c++;
1458
- n[c] === ":" ? e += `<span class="hl-prop">${C(s)}</span>` : e += C(s);
1456
+ let a = r;
1457
+ for (; a < o && (n[a] === " " || n[a] === " "); ) a++;
1458
+ n[a] === ":" ? e += `<span class="hl-prop">${k(s)}</span>` : e += k(s);
1459
1459
  } else
1460
- e += `<span class="hl-tag">${C(s)}</span>`;
1460
+ e += `<span class="hl-tag">${k(s)}</span>`;
1461
1461
  t = r;
1462
1462
  continue;
1463
1463
  }
1464
1464
  if (/[0-9]/.test(i)) {
1465
1465
  const r = /^[0-9.]+(px|em|rem|%|vh|vw|s|ms|deg|fr)?/.exec(n.slice(t));
1466
1466
  if (r) {
1467
- e += `<span class="hl-number">${C(r[0])}</span>`, t += r[0].length;
1467
+ e += `<span class="hl-number">${k(r[0])}</span>`, t += r[0].length;
1468
1468
  continue;
1469
1469
  }
1470
1470
  }
1471
- e += C(i), t++;
1471
+ e += k(i), t++;
1472
1472
  }
1473
1473
  return e;
1474
1474
  }
1475
- function Lt(n) {
1475
+ function St(n) {
1476
1476
  return n.split(`
1477
- `).map(At).join(`
1477
+ `).map(Tt).join(`
1478
1478
  `);
1479
1479
  }
1480
- function At(n) {
1480
+ function Tt(n) {
1481
1481
  const e = /^(#{1,6})\s+(.*)$/.exec(n);
1482
1482
  if (e)
1483
- return `<span class="hl-keyword">${C(e[1] ?? "")}</span> <span class="hl-tag">${ee(e[2] ?? "")}</span>`;
1483
+ return `<span class="hl-keyword">${k(e[1] ?? "")}</span> <span class="hl-tag">${ee(e[2] ?? "")}</span>`;
1484
1484
  if (n.startsWith(">"))
1485
- return `<span class="hl-comment">${C(n)}</span>`;
1485
+ return `<span class="hl-comment">${k(n)}</span>`;
1486
1486
  if (n.startsWith("```"))
1487
- return `<span class="hl-keyword">${C(n)}</span>`;
1487
+ return `<span class="hl-keyword">${k(n)}</span>`;
1488
1488
  const t = /^(\s*)([-*+]|\d+\.)\s+(.*)$/.exec(n);
1489
- return t ? `${t[1] ?? ""}<span class="hl-keyword">${C(t[2] ?? "")}</span> ${ee(t[3] ?? "")}` : ee(n);
1489
+ return t ? `${t[1] ?? ""}<span class="hl-keyword">${k(t[2] ?? "")}</span> ${ee(t[3] ?? "")}` : ee(n);
1490
1490
  }
1491
1491
  function ee(n) {
1492
- let e = C(n);
1492
+ let e = k(n);
1493
1493
  return e = e.replace(/\*\*([^*]+)\*\*/g, '<span class="hl-keyword">**$1**</span>'), e = e.replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)", "g"), '<span class="hl-string">*$1*</span>'), e = e.replace(/`([^`]+)`/g, '<span class="hl-builtin">`$1`</span>'), e = e.replace(
1494
1494
  /\[([^\]]+)\]\(([^)]+)\)/g,
1495
1495
  '<span class="hl-tag">[$1]</span><span class="hl-string">($2)</span>'
1496
1496
  ), e;
1497
1497
  }
1498
- function C(n) {
1498
+ function k(n) {
1499
1499
  return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1500
1500
  }
1501
1501
  function S(n) {
@@ -1520,7 +1520,7 @@ const ae = [
1520
1520
  "#1098ad"
1521
1521
  ];
1522
1522
  function te(n, e, t = []) {
1523
- z();
1523
+ D();
1524
1524
  const o = document.createElement("div");
1525
1525
  o.className = "aw-popover aw-color-popover", o.dataset.popover = "true", S(o);
1526
1526
  const l = (d) => {
@@ -1539,14 +1539,14 @@ function te(n, e, t = []) {
1539
1539
  s.type = "button", s.className = "aw-popover-action", s.textContent = "기본색", S(s), s.addEventListener("click", (d) => {
1540
1540
  d.stopPropagation(), l(null);
1541
1541
  });
1542
- const c = document.createElement("button");
1543
- c.type = "button", c.className = "aw-popover-action", c.textContent = "사용자 지정", S(c);
1544
- const a = document.createElement("input");
1545
- if (a.type = "color", a.tabIndex = -1, a.setAttribute("aria-hidden", "true"), a.style.position = "absolute", a.style.left = "-9999px", a.style.width = "0", a.style.height = "0", a.style.opacity = "0", a.style.pointerEvents = "none", a.addEventListener("change", () => {
1546
- l(a.value);
1547
- }), c.addEventListener("click", (d) => {
1548
- d.stopPropagation(), a.click();
1549
- }), o.appendChild(s), o.appendChild(c), o.appendChild(a), t.length > 0) {
1542
+ const a = document.createElement("button");
1543
+ a.type = "button", a.className = "aw-popover-action", a.textContent = "사용자 지정", S(a);
1544
+ const c = document.createElement("input");
1545
+ if (c.type = "color", c.tabIndex = -1, c.setAttribute("aria-hidden", "true"), c.style.position = "absolute", c.style.left = "-9999px", c.style.width = "0", c.style.height = "0", c.style.opacity = "0", c.style.pointerEvents = "none", c.addEventListener("change", () => {
1546
+ l(c.value);
1547
+ }), a.addEventListener("click", (d) => {
1548
+ d.stopPropagation(), c.click();
1549
+ }), o.appendChild(s), o.appendChild(a), o.appendChild(c), t.length > 0) {
1550
1550
  const d = document.createElement("div");
1551
1551
  d.className = "aw-color-section", d.textContent = "최근 사용", o.appendChild(d);
1552
1552
  const u = document.createElement("div");
@@ -1557,7 +1557,7 @@ function te(n, e, t = []) {
1557
1557
  }
1558
1558
  I(o, n);
1559
1559
  }
1560
- const St = [
1560
+ const Nt = [
1561
1561
  { label: "본문", kind: "paragraph", attrs: {}, glyph: "¶" },
1562
1562
  { label: "제목 1", kind: "heading", attrs: { level: 1 }, glyph: "H1", weight: "700" },
1563
1563
  { label: "제목 2", kind: "heading", attrs: { level: 2 }, glyph: "H2", weight: "700" },
@@ -1654,11 +1654,11 @@ const St = [
1654
1654
  glyphIsSvg: !0
1655
1655
  }
1656
1656
  ];
1657
- function Tt(n, e) {
1658
- z();
1657
+ function Mt(n, e) {
1658
+ D();
1659
1659
  const t = document.createElement("div");
1660
1660
  t.className = "aw-popover aw-block-type-popover", t.dataset.popover = "true", S(t);
1661
- for (const o of St) {
1661
+ for (const o of Nt) {
1662
1662
  if (o.divider) {
1663
1663
  const s = document.createElement("div");
1664
1664
  s.className = "aw-popover-divider", t.appendChild(s);
@@ -1674,8 +1674,8 @@ function Tt(n, e) {
1674
1674
  }
1675
1675
  I(t, n);
1676
1676
  }
1677
- function Nt(n, e) {
1678
- z();
1677
+ function Bt(n, e) {
1678
+ D();
1679
1679
  const t = document.createElement("div");
1680
1680
  t.className = "aw-popover aw-align-popover", t.dataset.popover = "true", S(t);
1681
1681
  const o = [
@@ -1692,8 +1692,8 @@ function Nt(n, e) {
1692
1692
  }
1693
1693
  I(t, n);
1694
1694
  }
1695
- function Mt(n, e, t) {
1696
- lt(), z();
1695
+ function $t(n, e, t) {
1696
+ rt(), D();
1697
1697
  const o = document.createElement("div");
1698
1698
  o.className = "aw-popover aw-font-family-popover", o.dataset.popover = "true", S(o);
1699
1699
  for (const l of W) {
@@ -1702,17 +1702,17 @@ function Mt(n, e, t) {
1702
1702
  const r = document.createElement("span");
1703
1703
  r.className = "aw-font-family-name", r.textContent = l.label;
1704
1704
  const s = document.createElement("span");
1705
- s.className = "aw-font-family-preview", s.textContent = "가A", s.style.fontFamily = l.stack, i.appendChild(r), i.appendChild(s), S(i), i.addEventListener("click", (c) => {
1706
- c.stopPropagation(), o.remove(), e({ id: l.id, label: l.label, stack: l.stack });
1705
+ s.className = "aw-font-family-preview", s.textContent = "가A", s.style.fontFamily = l.stack, i.appendChild(r), i.appendChild(s), S(i), i.addEventListener("click", (a) => {
1706
+ a.stopPropagation(), o.remove(), e({ id: l.id, label: l.label, stack: l.stack });
1707
1707
  }), o.appendChild(i);
1708
1708
  }
1709
1709
  I(o, n);
1710
1710
  }
1711
- function Bt(n, e, t) {
1712
- z();
1711
+ function zt(n, e, t) {
1712
+ D();
1713
1713
  const o = document.createElement("div");
1714
1714
  o.className = "aw-popover aw-code-lang-popover", o.dataset.popover = "true", S(o);
1715
- for (const l of Me) {
1715
+ for (const l of $e) {
1716
1716
  const i = document.createElement("button");
1717
1717
  i.type = "button", i.className = "aw-popover-item aw-code-lang-item", t === l.id && i.classList.add("aw-popover-item-active"), i.title = l.label;
1718
1718
  const r = document.createElement("span");
@@ -1722,7 +1722,7 @@ function Bt(n, e, t) {
1722
1722
  }
1723
1723
  I(o, n);
1724
1724
  }
1725
- const $t = [
1725
+ const Rt = [
1726
1726
  { action: "rowAbove", label: "위에 행 추가" },
1727
1727
  { action: "rowBelow", label: "아래에 행 추가" },
1728
1728
  { action: "colLeft", label: "왼쪽에 열 추가", divider: !0 },
@@ -1730,11 +1730,11 @@ const $t = [
1730
1730
  { action: "deleteRow", label: "행 삭제", divider: !0 },
1731
1731
  { action: "deleteCol", label: "열 삭제" }
1732
1732
  ];
1733
- function Rt(n, e) {
1734
- z();
1733
+ function It(n, e) {
1734
+ D();
1735
1735
  const t = document.createElement("div");
1736
1736
  t.className = "aw-popover aw-table-menu-popover", t.dataset.popover = "true", S(t);
1737
- for (const o of $t) {
1737
+ for (const o of Rt) {
1738
1738
  if (o.divider) {
1739
1739
  const i = document.createElement("div");
1740
1740
  i.className = "aw-popover-divider", t.appendChild(i);
@@ -1746,11 +1746,11 @@ function Rt(n, e) {
1746
1746
  }
1747
1747
  I(t, n);
1748
1748
  }
1749
- function It(n, e, t) {
1750
- z();
1749
+ function Dt(n, e, t) {
1750
+ D();
1751
1751
  const o = document.createElement("div");
1752
1752
  o.className = "aw-popover aw-font-size-popover", o.dataset.popover = "true", S(o);
1753
- for (const l of nt) {
1753
+ for (const l of lt) {
1754
1754
  const i = document.createElement("button");
1755
1755
  i.type = "button", i.className = "aw-popover-item aw-font-size-item", t === l && i.classList.add("aw-popover-item-active"), i.title = `${l}px`;
1756
1756
  const r = document.createElement("span");
@@ -1760,174 +1760,332 @@ function It(n, e, t) {
1760
1760
  }
1761
1761
  I(o, n);
1762
1762
  }
1763
- function zt(n, e) {
1764
- z();
1763
+ function Ht(n, e) {
1764
+ D();
1765
1765
  const t = 2, o = 12, l = document.createElement("div");
1766
1766
  l.className = "aw-popover aw-table-popover", l.dataset.popover = "true";
1767
1767
  const i = document.createElement("div");
1768
1768
  i.className = "aw-table-picker-grid";
1769
1769
  const r = document.createElement("div");
1770
1770
  r.className = "aw-table-status";
1771
- let s = t, c = t, a = 0, d = 0;
1771
+ let s = t, a = t, c = 0, d = 0;
1772
1772
  const u = [];
1773
1773
  function m() {
1774
- for (let h = 0; h < u.length; h++) {
1775
- const b = u[h];
1776
- if (b)
1777
- for (let v = 0; v < b.length; v++) {
1778
- const k = b[v];
1779
- k && k.classList.toggle("aw-table-cell-active", h < a && v < d);
1774
+ for (let p = 0; p < u.length; p++) {
1775
+ const g = u[p];
1776
+ if (g)
1777
+ for (let b = 0; b < g.length; b++) {
1778
+ const v = g[b];
1779
+ v && v.classList.toggle("aw-table-cell-active", p < c && b < d);
1780
1780
  }
1781
1781
  }
1782
- r.textContent = a > 0 && d > 0 ? `${a} × ${d} 표` : "크기를 선택하세요";
1783
- }
1784
- function f() {
1785
- i.innerHTML = "", i.style.gridTemplateColumns = `repeat(${c}, 18px)`, i.style.gridTemplateRows = `repeat(${s}, 18px)`, u.length = 0;
1786
- for (let h = 0; h < s; h++) {
1787
- const b = [];
1788
- for (let v = 0; v < c; v++) {
1789
- const k = document.createElement("div");
1790
- k.className = "aw-table-cell", k.dataset.row = String(h + 1), k.dataset.col = String(v + 1), i.appendChild(k), b.push(k);
1782
+ r.textContent = c > 0 && d > 0 ? `${c} × ${d} 표` : "크기를 선택하세요";
1783
+ }
1784
+ function h() {
1785
+ i.innerHTML = "", i.style.gridTemplateColumns = `repeat(${a}, 18px)`, i.style.gridTemplateRows = `repeat(${s}, 18px)`, u.length = 0;
1786
+ for (let p = 0; p < s; p++) {
1787
+ const g = [];
1788
+ for (let b = 0; b < a; b++) {
1789
+ const v = document.createElement("div");
1790
+ v.className = "aw-table-cell", v.dataset.row = String(p + 1), v.dataset.col = String(b + 1), i.appendChild(v), g.push(v);
1791
1791
  }
1792
- u.push(b);
1792
+ u.push(g);
1793
1793
  }
1794
1794
  m();
1795
1795
  }
1796
- f(), i.addEventListener("mousemove", (h) => {
1797
- const b = h.target;
1798
- if (!b.classList.contains("aw-table-cell")) return;
1799
- const v = parseInt(b.dataset.row ?? "0", 10), k = parseInt(b.dataset.col ?? "0", 10);
1800
- a = v, d = k;
1796
+ h(), i.addEventListener("mousemove", (p) => {
1797
+ const g = p.target;
1798
+ if (!g.classList.contains("aw-table-cell")) return;
1799
+ const b = parseInt(g.dataset.row ?? "0", 10), v = parseInt(g.dataset.col ?? "0", 10);
1800
+ c = b, d = v;
1801
1801
  let T = !1;
1802
- v >= s && s < o && (s = Math.min(o, v + 1), T = !0), k >= c && c < o && (c = Math.min(o, k + 1), T = !0), T ? f() : m();
1803
- }), i.addEventListener("click", (h) => {
1804
- const b = h.target;
1805
- if (!b.classList.contains("aw-table-cell")) return;
1806
- const v = parseInt(b.dataset.row ?? "0", 10), k = parseInt(b.dataset.col ?? "0", 10);
1807
- v > 0 && k > 0 && (e({ rows: v, cols: k }), l.remove());
1802
+ b >= s && s < o && (s = Math.min(o, b + 1), T = !0), v >= a && a < o && (a = Math.min(o, v + 1), T = !0), T ? h() : m();
1803
+ }), i.addEventListener("click", (p) => {
1804
+ const g = p.target;
1805
+ if (!g.classList.contains("aw-table-cell")) return;
1806
+ const b = parseInt(g.dataset.row ?? "0", 10), v = parseInt(g.dataset.col ?? "0", 10);
1807
+ b > 0 && v > 0 && (e({ rows: b, cols: v }), l.remove());
1808
1808
  });
1809
- function p(h) {
1810
- h.key === "Escape" && (l.remove(), document.removeEventListener("keydown", p));
1809
+ function f(p) {
1810
+ p.key === "Escape" && (l.remove(), document.removeEventListener("keydown", f));
1811
1811
  }
1812
- document.addEventListener("keydown", p), l.appendChild(i), l.appendChild(r), I(l, n);
1812
+ document.addEventListener("keydown", f), l.appendChild(i), l.appendChild(r), I(l, n);
1813
1813
  }
1814
1814
  function I(n, e) {
1815
1815
  const t = e.closest(".aeriz-wysiwyg"), o = t == null ? void 0 : t.dataset.theme;
1816
1816
  o && (n.dataset.theme = o), n.style.position = "fixed";
1817
1817
  const l = () => {
1818
- const a = e.getBoundingClientRect();
1819
- n.style.top = `${a.bottom + 4}px`, n.style.left = `${a.left}px`;
1818
+ const c = e.getBoundingClientRect();
1819
+ n.style.top = `${c.bottom + 4}px`, n.style.left = `${c.left}px`;
1820
1820
  };
1821
1821
  l(), document.body.appendChild(n);
1822
1822
  const i = () => l(), r = () => l();
1823
1823
  window.addEventListener("scroll", i, !0), window.addEventListener("resize", r);
1824
- function s(a) {
1825
- !n.contains(a.target) && !e.contains(a.target) && n.remove();
1824
+ function s(c) {
1825
+ !n.contains(c.target) && !e.contains(c.target) && n.remove();
1826
1826
  }
1827
1827
  setTimeout(() => {
1828
1828
  document.addEventListener("click", s);
1829
1829
  }, 0);
1830
- const c = n.remove.bind(n);
1830
+ const a = n.remove.bind(n);
1831
1831
  n.remove = function() {
1832
- window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", r), document.removeEventListener("click", s), c();
1832
+ window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", r), document.removeEventListener("click", s), a();
1833
1833
  };
1834
1834
  }
1835
- function z() {
1835
+ function D() {
1836
1836
  document.querySelectorAll('[data-popover="true"]').forEach((n) => n.remove());
1837
1837
  }
1838
- const Ht = ["script", "noscript", "meta", "link", "style", "base"];
1839
- async function Dt(n, e = {}) {
1840
- const t = e.settleMs ?? 1e3, o = e.timeoutMs ?? 3e4, l = e.width ?? 1024;
1841
- return new Promise((i, r) => {
1842
- const s = document.createElement("iframe");
1843
- s.setAttribute("aria-hidden", "true"), s.setAttribute("tabindex", "-1"), s.style.position = "fixed", s.style.left = "-99999px", s.style.top = "0", s.style.width = `${l}px`, s.style.height = "768px", s.style.border = "0", s.style.opacity = "0", s.style.pointerEvents = "none";
1838
+ const Ft = ["script", "noscript", "meta", "link", "style", "base"], Pt = /* @__PURE__ */ new Set([
1839
+ // CSS 2.1
1840
+ "border-collapse",
1841
+ "border-spacing",
1842
+ "caption-side",
1843
+ "color",
1844
+ "cursor",
1845
+ "direction",
1846
+ "empty-cells",
1847
+ "font-family",
1848
+ "font-size",
1849
+ "font-style",
1850
+ "font-variant",
1851
+ "font-weight",
1852
+ "letter-spacing",
1853
+ "line-height",
1854
+ "list-style",
1855
+ "list-style-image",
1856
+ "list-style-position",
1857
+ "list-style-type",
1858
+ "orphans",
1859
+ "quotes",
1860
+ "text-align",
1861
+ "text-indent",
1862
+ "text-transform",
1863
+ "visibility",
1864
+ "white-space",
1865
+ "widows",
1866
+ "word-spacing",
1867
+ // CSS 3+
1868
+ "caret-color",
1869
+ "font",
1870
+ "font-feature-settings",
1871
+ "font-kerning",
1872
+ "font-language-override",
1873
+ "font-optical-sizing",
1874
+ "font-palette",
1875
+ "font-size-adjust",
1876
+ "font-stretch",
1877
+ "font-synthesis",
1878
+ "font-synthesis-weight",
1879
+ "font-synthesis-style",
1880
+ "font-synthesis-small-caps",
1881
+ "font-variant-alternates",
1882
+ "font-variant-caps",
1883
+ "font-variant-east-asian",
1884
+ "font-variant-emoji",
1885
+ "font-variant-ligatures",
1886
+ "font-variant-numeric",
1887
+ "font-variant-position",
1888
+ "font-variation-settings",
1889
+ "hanging-punctuation",
1890
+ "hyphens",
1891
+ "image-rendering",
1892
+ "line-break",
1893
+ "overflow-wrap",
1894
+ "pointer-events",
1895
+ "ruby-align",
1896
+ "ruby-position",
1897
+ "tab-size",
1898
+ "text-align-last",
1899
+ "text-combine-upright",
1900
+ "text-decoration-color",
1901
+ "text-emphasis",
1902
+ "text-emphasis-color",
1903
+ "text-emphasis-position",
1904
+ "text-emphasis-style",
1905
+ "text-justify",
1906
+ "text-orientation",
1907
+ "text-rendering",
1908
+ "text-shadow",
1909
+ "text-size-adjust",
1910
+ "text-underline-offset",
1911
+ "text-underline-position",
1912
+ "white-space-collapse",
1913
+ "word-break",
1914
+ "word-wrap",
1915
+ "writing-mode",
1916
+ "color-scheme",
1917
+ "print-color-adjust",
1918
+ // Vendor
1919
+ "-webkit-font-smoothing",
1920
+ "-moz-osx-font-smoothing",
1921
+ "-webkit-locale",
1922
+ "-webkit-text-fill-color",
1923
+ "-webkit-text-stroke",
1924
+ "-webkit-text-stroke-color",
1925
+ "-webkit-text-stroke-width",
1926
+ "-webkit-print-color-adjust",
1927
+ // SVG
1928
+ "clip-rule",
1929
+ "color-interpolation",
1930
+ "color-interpolation-filters",
1931
+ "color-rendering",
1932
+ "fill",
1933
+ "fill-opacity",
1934
+ "fill-rule",
1935
+ "marker",
1936
+ "marker-end",
1937
+ "marker-mid",
1938
+ "marker-start",
1939
+ "paint-order",
1940
+ "shape-rendering",
1941
+ "stroke",
1942
+ "stroke-dasharray",
1943
+ "stroke-dashoffset",
1944
+ "stroke-linecap",
1945
+ "stroke-linejoin",
1946
+ "stroke-miterlimit",
1947
+ "stroke-opacity",
1948
+ "stroke-width",
1949
+ "text-anchor"
1950
+ ]);
1951
+ async function qt(n, e = {}) {
1952
+ const t = e.settleMs ?? 1e3, o = e.timeoutMs ?? 3e4, l = e.width ?? 1024, i = e.mountTarget ?? null;
1953
+ return new Promise((r, s) => {
1954
+ const a = document.createElement("iframe");
1955
+ a.setAttribute("aria-hidden", "true"), a.setAttribute("tabindex", "-1"), a.style.position = "fixed", a.style.left = "-99999px", a.style.top = "0", a.style.width = `${l}px`, a.style.height = "768px", a.style.border = "0", a.style.opacity = "0", a.style.pointerEvents = "none";
1844
1956
  let c = !1;
1845
- const a = () => {
1846
- s.parentNode && s.parentNode.removeChild(s);
1847
- }, d = (p) => {
1848
- c || (c = !0, a(), r(p));
1957
+ const d = () => {
1958
+ a.parentNode && a.parentNode.removeChild(a);
1849
1959
  }, u = (p) => {
1850
- c || (c = !0, a(), i(p));
1851
- }, m = window.setTimeout(() => {
1852
- d(new Error("HTML 로드 시간 초과"));
1960
+ c || (c = !0, d(), s(p));
1961
+ }, m = (p) => {
1962
+ c || (c = !0, d(), r(p));
1963
+ }, h = window.setTimeout(() => {
1964
+ u(new Error("HTML 로드 시간 초과"));
1853
1965
  }, o), f = () => {
1854
- var k;
1855
- const p = s.contentDocument;
1966
+ var T;
1967
+ const p = a.contentDocument;
1856
1968
  if (!p || !p.body || p.body.children.length === 0 && (p.body.textContent ?? "").trim() === "")
1857
1969
  return;
1858
- const h = s.contentWindow, b = (h == null ? void 0 : h.requestAnimationFrame) ?? window.requestAnimationFrame;
1859
- (p.fonts && typeof ((k = p.fonts.ready) == null ? void 0 : k.then) == "function" ? p.fonts.ready : Promise.resolve()).then(() => {
1860
- const T = () => {
1970
+ const g = a.contentWindow, b = (g == null ? void 0 : g.requestAnimationFrame) ?? window.requestAnimationFrame;
1971
+ (p.fonts && typeof ((T = p.fonts.ready) == null ? void 0 : T.then) == "function" ? p.fonts.ready : Promise.resolve()).then(() => {
1972
+ const C = () => {
1861
1973
  window.setTimeout(() => {
1862
1974
  if (!c)
1863
1975
  try {
1864
- const y = s.contentWindow, L = s.contentDocument;
1865
- if (!y || !L || !L.body) {
1866
- window.clearTimeout(m), d(new Error("iframe document 접근 실패"));
1976
+ const L = a.contentWindow, A = a.contentDocument;
1977
+ if (!L || !A || !A.body) {
1978
+ window.clearTimeout(h), u(new Error("iframe document 접근 실패"));
1867
1979
  return;
1868
1980
  }
1869
- const A = Ft(L.body, y);
1870
- window.clearTimeout(m), u(A);
1871
- } catch (y) {
1872
- window.clearTimeout(m), d(y instanceof Error ? y : new Error(String(y)));
1981
+ const M = Ot(A.body, L, i);
1982
+ window.clearTimeout(h), m(M);
1983
+ } catch (L) {
1984
+ window.clearTimeout(h), u(L instanceof Error ? L : new Error(String(L)));
1873
1985
  }
1874
1986
  }, t);
1875
1987
  };
1876
- b(() => b(T));
1988
+ b(() => b(C));
1877
1989
  });
1878
1990
  };
1879
- s.addEventListener("load", f), s.srcdoc = n, document.body.appendChild(s);
1991
+ a.addEventListener("load", f), a.srcdoc = n, document.body.appendChild(a);
1880
1992
  });
1881
1993
  }
1882
- function Ft(n, e) {
1883
- var l;
1884
- const t = document.createElement("div");
1885
- for (let i = 0; i < n.attributes.length; i++) {
1886
- const r = n.attributes.item(i);
1887
- r && r.name !== "style" && t.setAttribute(r.name, r.value);
1888
- }
1889
- const o = Be(n, e);
1890
- o.length > 0 && t.setAttribute("style", o);
1891
- for (const i of Array.from(n.children)) {
1892
- const r = document.importNode(i, !0);
1893
- $e(i, r, e), t.appendChild(r);
1994
+ function Ot(n, e, t) {
1995
+ var r;
1996
+ const o = n.ownerDocument;
1997
+ if (!o) throw new Error("body has no ownerDocument");
1998
+ const l = document.createElement("div"), i = _t(o, e, t);
1999
+ try {
2000
+ for (let a = 0; a < n.attributes.length; a++) {
2001
+ const c = n.attributes.item(a);
2002
+ c && c.name !== "style" && l.setAttribute(c.name, c.value);
2003
+ }
2004
+ const s = ze(n, null, "div", i.get, e);
2005
+ s.length > 0 && l.setAttribute("style", s);
2006
+ for (const a of Array.from(n.children)) {
2007
+ const c = document.importNode(a, !0);
2008
+ Re(a, c, n, i.get, e), l.appendChild(c);
2009
+ }
2010
+ } finally {
2011
+ i.cleanup();
1894
2012
  }
1895
- for (const i of Ht)
1896
- for (const r of Array.from(t.querySelectorAll(i)))
1897
- (l = r.parentNode) == null || l.removeChild(r);
1898
- return t.style.width = "auto", t.style.maxWidth = "none", t.style.height = "auto", t.style.maxHeight = "none", t.setAttribute("data-imported-html", "true"), [t];
2013
+ for (const s of Ft)
2014
+ for (const a of Array.from(l.querySelectorAll(s)))
2015
+ (r = a.parentNode) == null || r.removeChild(a);
2016
+ return l.style.width = "auto", l.style.maxWidth = "none", l.style.height = "auto", l.style.maxHeight = "none", l.setAttribute("data-imported-html", "true"), [l];
1899
2017
  }
1900
- function Be(n, e) {
1901
- const t = e.getComputedStyle(n);
1902
- let o = "";
1903
- for (let l = 0; l < t.length; l++) {
1904
- const i = t.item(l);
1905
- if (!i) continue;
1906
- const r = t.getPropertyValue(i);
1907
- r && r.length > 0 && (o += `${i}:${r};`);
2018
+ function _t(n, e, t) {
2019
+ var d;
2020
+ let o, l, i;
2021
+ const r = ((d = t == null ? void 0 : t.ownerDocument) == null ? void 0 : d.defaultView) ?? null;
2022
+ if (t && r) {
2023
+ o = t.ownerDocument, l = r;
2024
+ const u = o.createElement("div");
2025
+ u.setAttribute("data-imported-html", "true"), u.setAttribute("aria-hidden", "true"), u.style.cssText = "position:absolute;left:-99999px;top:0;visibility:hidden;pointer-events:none;", t.appendChild(u), i = u;
2026
+ } else {
2027
+ o = n, l = e;
2028
+ const u = o.createElement("div");
2029
+ u.setAttribute("aria-hidden", "true"), u.style.cssText = "position:absolute;left:-99999px;top:0;width:0;height:0;overflow:hidden;visibility:hidden;", o.body.appendChild(u), i = u;
2030
+ }
2031
+ const s = /* @__PURE__ */ new Map();
2032
+ return { get: (u) => {
2033
+ const m = s.get(u);
2034
+ if (m) return m;
2035
+ const h = o.createElement(u);
2036
+ i.appendChild(h);
2037
+ const f = l.getComputedStyle(h), p = /* @__PURE__ */ new Map();
2038
+ for (let g = 0; g < f.length; g++) {
2039
+ const b = f.item(g);
2040
+ b && p.set(b, f.getPropertyValue(b));
2041
+ }
2042
+ return i.removeChild(h), s.set(u, p), p;
2043
+ }, cleanup: () => {
2044
+ i.parentNode && i.parentNode.removeChild(i);
2045
+ } };
2046
+ }
2047
+ function ze(n, e, t, o, l) {
2048
+ const i = l.getComputedStyle(n), r = e ? l.getComputedStyle(e) : null, s = o(t);
2049
+ let a = "";
2050
+ for (let c = 0; c < i.length; c++) {
2051
+ const d = i.item(c);
2052
+ if (!d) continue;
2053
+ const u = i.getPropertyValue(d);
2054
+ if (u) {
2055
+ if (Pt.has(d)) {
2056
+ if (r && r.getPropertyValue(d) === u) continue;
2057
+ } else if (s.get(d) === u) continue;
2058
+ a += `${d}:${u};`;
2059
+ }
1908
2060
  }
1909
- return o;
2061
+ return a;
1910
2062
  }
1911
- function $e(n, e, t) {
2063
+ function Re(n, e, t, o, l) {
1912
2064
  if (n.nodeType === 1 && e.nodeType === 1) {
1913
- const r = Be(n, t);
1914
- r.length > 0 && e.setAttribute("style", r);
2065
+ const a = ze(
2066
+ n,
2067
+ t,
2068
+ n.tagName.toLowerCase(),
2069
+ o,
2070
+ l
2071
+ );
2072
+ a.length > 0 ? e.setAttribute("style", a) : e.hasAttribute("style") && e.removeAttribute("style");
1915
2073
  }
1916
- const o = n.children, l = e.children, i = Math.min(o.length, l.length);
1917
- for (let r = 0; r < i; r++) {
1918
- const s = o[r], c = l[r];
1919
- s && c && $e(s, c, t);
2074
+ const i = n.children, r = e.children, s = Math.min(i.length, r.length);
2075
+ for (let a = 0; a < s; a++) {
2076
+ const c = i[a], d = r[a];
2077
+ c && d && Re(c, d, n, o, l);
1920
2078
  }
1921
2079
  }
1922
- function Pt(n) {
1923
- const e = qt(n), t = document.createElement("div");
2080
+ function jt(n) {
2081
+ const e = Ut(n), t = document.createElement("div");
1924
2082
  t.innerHTML = e;
1925
2083
  const o = [];
1926
2084
  for (const l of Array.from(t.children))
1927
2085
  l instanceof HTMLElement && o.push(l);
1928
2086
  return o;
1929
2087
  }
1930
- function qt(n) {
2088
+ function Ut(n) {
1931
2089
  const t = n.replace(/\r\n?/g, `
1932
2090
  `).replace(/\s+$/, "").split(`
1933
2091
  `), o = [];
@@ -1940,11 +2098,11 @@ function qt(n) {
1940
2098
  }
1941
2099
  const r = /^```\s*([\w-]*)\s*$/.exec(i);
1942
2100
  if (r) {
1943
- const a = r[1] ?? "", d = [];
2101
+ const c = r[1] ?? "", d = [];
1944
2102
  for (l++; l < t.length && !/^```\s*$/.test(t[l] ?? ""); )
1945
2103
  d.push(t[l] ?? ""), l++;
1946
2104
  l < t.length && l++;
1947
- const u = a ? ` data-language="${j(a)}"` : "";
2105
+ const u = c ? ` data-language="${j(c)}"` : "";
1948
2106
  o.push(
1949
2107
  `<pre><code${u}>${X(d.join(`
1950
2108
  `))}</code></pre>`
@@ -1953,64 +2111,64 @@ function qt(n) {
1953
2111
  }
1954
2112
  const s = /^(#{1,6})\s+(.+?)\s*#*\s*$/.exec(i);
1955
2113
  if (s) {
1956
- const a = (s[1] ?? "#").length;
1957
- o.push(`<h${a}>${D(s[2] ?? "")}</h${a}>`), l++;
2114
+ const c = (s[1] ?? "#").length;
2115
+ o.push(`<h${c}>${H(s[2] ?? "")}</h${c}>`), l++;
1958
2116
  continue;
1959
2117
  }
1960
2118
  if (/^[\s]*([-*_])(\s*\1){2,}[\s]*$/.test(i)) {
1961
2119
  o.push("<hr>"), l++;
1962
2120
  continue;
1963
2121
  }
1964
- if (Re(i, t[l + 1] ?? "")) {
1965
- const a = [i];
1966
- for (l++, a.push(t[l] ?? ""), l++; l < t.length && (t[l] ?? "").includes("|") && (t[l] ?? "").trim() !== ""; )
1967
- a.push(t[l] ?? ""), l++;
1968
- o.push(_t(a));
2122
+ if (Ie(i, t[l + 1] ?? "")) {
2123
+ const c = [i];
2124
+ for (l++, c.push(t[l] ?? ""), l++; l < t.length && (t[l] ?? "").includes("|") && (t[l] ?? "").trim() !== ""; )
2125
+ c.push(t[l] ?? ""), l++;
2126
+ o.push(Kt(c));
1969
2127
  continue;
1970
2128
  }
1971
2129
  if (i.startsWith(">")) {
1972
- const a = [];
2130
+ const c = [];
1973
2131
  for (; l < t.length && (t[l] ?? "").startsWith(">"); )
1974
- a.push((t[l] ?? "").replace(/^>\s?/, "")), l++;
1975
- const d = D(a.join(" ").trim());
2132
+ c.push((t[l] ?? "").replace(/^>\s?/, "")), l++;
2133
+ const d = H(c.join(" ").trim());
1976
2134
  o.push(`<blockquote><p>${d}</p></blockquote>`);
1977
2135
  continue;
1978
2136
  }
1979
2137
  if (/^[\s]*[-*+]\s+/.test(i)) {
1980
- const a = ye(t, l, /^[\s]*[-*+]\s+(.*)$/);
1981
- l = a.next, o.push(`<ul>${a.html}</ul>`);
2138
+ const c = ye(t, l, /^[\s]*[-*+]\s+(.*)$/);
2139
+ l = c.next, o.push(`<ul>${c.html}</ul>`);
1982
2140
  continue;
1983
2141
  }
1984
2142
  if (/^[\s]*\d+\.\s+/.test(i)) {
1985
- const a = ye(t, l, /^[\s]*\d+\.\s+(.*)$/);
1986
- l = a.next, o.push(`<ol>${a.html}</ol>`);
2143
+ const c = ye(t, l, /^[\s]*\d+\.\s+(.*)$/);
2144
+ l = c.next, o.push(`<ol>${c.html}</ol>`);
1987
2145
  continue;
1988
2146
  }
1989
- const c = [];
1990
- for (; l < t.length && (t[l] ?? "").trim() !== "" && !Ot(t[l] ?? "", t[l + 1] ?? ""); )
1991
- c.push(t[l] ?? ""), l++;
1992
- c.length > 0 && o.push(`<p>${D(jt(c))}</p>`);
2147
+ const a = [];
2148
+ for (; l < t.length && (t[l] ?? "").trim() !== "" && !Wt(t[l] ?? "", t[l + 1] ?? ""); )
2149
+ a.push(t[l] ?? ""), l++;
2150
+ a.length > 0 && o.push(`<p>${H(Vt(a))}</p>`);
1993
2151
  }
1994
2152
  return o.join(`
1995
2153
  `);
1996
2154
  }
1997
- function Ot(n, e) {
1998
- return /^#{1,6}\s/.test(n) || /^[\s]*[-*+]\s+/.test(n) || /^[\s]*\d+\.\s+/.test(n) || n.startsWith(">") || /^```/.test(n) || /^[\s]*([-*_])(\s*\1){2,}[\s]*$/.test(n) || Re(n, e);
2155
+ function Wt(n, e) {
2156
+ return /^#{1,6}\s/.test(n) || /^[\s]*[-*+]\s+/.test(n) || /^[\s]*\d+\.\s+/.test(n) || n.startsWith(">") || /^```/.test(n) || /^[\s]*([-*_])(\s*\1){2,}[\s]*$/.test(n) || Ie(n, e);
1999
2157
  }
2000
- function Re(n, e) {
2158
+ function Ie(n, e) {
2001
2159
  return n.includes("|") ? /^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/.test(e) : !1;
2002
2160
  }
2003
- function _t(n) {
2161
+ function Kt(n) {
2004
2162
  if (n.length < 2) return "";
2005
2163
  const e = ne(n[0] ?? ""), o = ne(n[1] ?? "").map((s) => {
2006
- const c = s.trim(), a = c.startsWith(":"), d = c.endsWith(":");
2007
- return a && d ? "center" : d ? "right" : a ? "left" : null;
2008
- }), l = n.slice(2).map(ne), i = e.map((s, c) => {
2009
- const a = o[c];
2010
- return `<th${a ? ` style="text-align:${a}"` : ""}>${D(s.trim())}</th>`;
2011
- }).join(""), r = l.map((s) => `<tr>${s.map((a, d) => {
2164
+ const a = s.trim(), c = a.startsWith(":"), d = a.endsWith(":");
2165
+ return c && d ? "center" : d ? "right" : c ? "left" : null;
2166
+ }), l = n.slice(2).map(ne), i = e.map((s, a) => {
2167
+ const c = o[a];
2168
+ return `<th${c ? ` style="text-align:${c}"` : ""}>${H(s.trim())}</th>`;
2169
+ }).join(""), r = l.map((s) => `<tr>${s.map((c, d) => {
2012
2170
  const u = o[d];
2013
- return `<td${u ? ` style="text-align:${u}"` : ""}>${D(a.trim())}</td>`;
2171
+ return `<td${u ? ` style="text-align:${u}"` : ""}>${H(c.trim())}</td>`;
2014
2172
  }).join("")}</tr>`).join("");
2015
2173
  return `<table><thead><tr>${i}</tr></thead><tbody>${r}</tbody></table>`;
2016
2174
  }
@@ -2032,11 +2190,11 @@ function ye(n, e, t) {
2032
2190
  }
2033
2191
  const r = t.exec(i);
2034
2192
  if (!r) break;
2035
- o.push(`<li>${D(r[1] ?? "")}</li>`), l++;
2193
+ o.push(`<li>${H(r[1] ?? "")}</li>`), l++;
2036
2194
  }
2037
2195
  return { html: o.join(""), next: l };
2038
2196
  }
2039
- function jt(n) {
2197
+ function Vt(n) {
2040
2198
  const e = [];
2041
2199
  for (let t = 0; t < n.length; t++) {
2042
2200
  const o = n[t] ?? "", l = t === n.length - 1;
@@ -2046,7 +2204,7 @@ function jt(n) {
2046
2204
  }
2047
2205
  return e.join("");
2048
2206
  }
2049
- function D(n) {
2207
+ function H(n) {
2050
2208
  const e = [];
2051
2209
  let t = n.replace(/(`+)([\s\S]+?)\1/g, (o, l, i) => `\0CODE${e.push(`<code>${X(i)}</code>`) - 1}\0`);
2052
2210
  return t = X(t), t = t.replace(
@@ -2074,64 +2232,81 @@ const Q = [
2074
2232
  "italic",
2075
2233
  "underline",
2076
2234
  "strike"
2077
- ], Ut = {
2235
+ ], Yt = {
2078
2236
  kind: "paragraph",
2079
2237
  label: "단락",
2080
2238
  allowsInlineFormat: !0,
2081
2239
  allowedMarks: Q,
2240
+ allowsColor: !0,
2241
+ allowsFontSize: !0,
2082
2242
  matches: (n) => n.tagName === "P" ? { kind: "paragraph", attrs: {} } : null,
2083
2243
  create: () => J(document.createElement("p")),
2084
2244
  isEmpty: (n) => q(n)
2085
- }, Wt = {
2245
+ }, Gt = {
2086
2246
  kind: "heading",
2087
2247
  label: "제목",
2088
2248
  allowsInlineFormat: !0,
2089
2249
  // 사용자 지정 — 제목은 italic 만 허용. (bold 는 heading 자체가 굵으므로
2090
2250
  // 중복, underline / strike 는 가독성/시맨틱 면에서 부적합.)
2091
2251
  allowedMarks: ["italic"],
2252
+ // 글자색/배경색은 시맨틱 헤딩 톤 보존을 위해 X.
2253
+ allowsColor: !1,
2254
+ // 글자 크기는 heading level (h1~h6) 로 결정되므로 X.
2255
+ allowsFontSize: !1,
2092
2256
  matches: (n) => {
2093
2257
  const e = /^H([1-6])$/.exec(n.tagName);
2094
2258
  return e ? { kind: "heading", attrs: { level: Number(e[1]) } } : null;
2095
2259
  },
2096
2260
  create: (n) => {
2097
- const e = wn(n == null ? void 0 : n.level);
2261
+ const e = En(n == null ? void 0 : n.level);
2098
2262
  return J(document.createElement(`h${e}`));
2099
2263
  },
2100
2264
  isEmpty: (n) => q(n)
2101
- }, Kt = {
2265
+ }, Zt = {
2102
2266
  kind: "bulletList",
2103
2267
  label: "글머리 목록",
2104
2268
  allowsInlineFormat: !0,
2105
2269
  allowedMarks: Q,
2270
+ allowsColor: !0,
2271
+ allowsFontSize: !0,
2106
2272
  matches: (n) => n.tagName === "UL" ? { kind: "bulletList", attrs: {} } : null,
2107
- create: () => _e("ul"),
2108
- isEmpty: (n) => je(n)
2109
- }, Yt = {
2273
+ create: () => Ue("ul"),
2274
+ isEmpty: (n) => We(n)
2275
+ }, Xt = {
2110
2276
  kind: "orderedList",
2111
2277
  label: "번호 매기기 목록",
2112
2278
  allowsInlineFormat: !0,
2113
2279
  allowedMarks: Q,
2280
+ allowsColor: !0,
2281
+ allowsFontSize: !0,
2114
2282
  matches: (n) => n.tagName === "OL" ? { kind: "orderedList", attrs: {} } : null,
2115
- create: () => _e("ol"),
2116
- isEmpty: (n) => je(n)
2117
- }, Vt = {
2283
+ create: () => Ue("ol"),
2284
+ isEmpty: (n) => We(n)
2285
+ }, Qt = {
2118
2286
  kind: "blockquote",
2119
2287
  label: "인용구",
2120
2288
  allowsInlineFormat: !0,
2121
2289
  // 사용자 지정 — 인용구는 italic 제외(인용 자체가 이미 italic 으로 렌더되어
2122
2290
  // 중복). bold / underline / strike 만 허용.
2123
2291
  allowedMarks: ["bold", "underline", "strike"],
2292
+ // 인용구 자체의 톤(이탤릭/주변 색조) 을 보존.
2293
+ allowsColor: !1,
2294
+ allowsFontSize: !0,
2124
2295
  matches: (n) => n.tagName === "BLOCKQUOTE" ? { kind: "blockquote", attrs: {} } : null,
2125
2296
  create: () => {
2126
2297
  const n = document.createElement("blockquote");
2127
2298
  return n.appendChild(J(document.createElement("p"))), n;
2128
2299
  },
2129
2300
  isEmpty: (n) => q(n)
2130
- }, Gt = {
2301
+ }, Jt = {
2131
2302
  kind: "codeBlock",
2132
2303
  label: "코드 블록",
2133
2304
  allowsInlineFormat: !1,
2134
2305
  allowedMarks: [],
2306
+ // 코드 블록은 인라인 서식은 막혀 있지만 글자 크기 조정은 (가독성) 의미가
2307
+ // 있어 예외적으로 허용. 색은 syntax highlight 와 충돌하므로 X.
2308
+ allowsColor: !1,
2309
+ allowsFontSize: !0,
2135
2310
  matches: (n) => {
2136
2311
  if (n.tagName !== "PRE") return null;
2137
2312
  const e = n.querySelector(":scope > code"), t = e == null ? void 0 : e.getAttribute("data-language");
@@ -2142,17 +2317,19 @@ const Q = [
2142
2317
  return n != null && n.language && t.setAttribute("data-language", n.language), e.appendChild(t), e;
2143
2318
  },
2144
2319
  isEmpty: (n) => q(n)
2145
- }, Zt = {
2320
+ }, en = {
2146
2321
  kind: "image",
2147
2322
  label: "이미지",
2148
2323
  allowsInlineFormat: !1,
2149
2324
  allowedMarks: [],
2325
+ allowsColor: !1,
2326
+ allowsFontSize: !1,
2150
2327
  matches: (n) => {
2151
2328
  if (n.tagName === "FIGURE") {
2152
- const e = n.querySelector(":scope > img"), t = Ce(e), o = n.getAttribute("style");
2329
+ const e = n.querySelector(":scope > img"), t = Ee(e), o = n.getAttribute("style");
2153
2330
  return o && (t.wrapperStyle = o), { kind: "image", attrs: t };
2154
2331
  }
2155
- return n.tagName === "IMG" ? { kind: "image", attrs: Ce(n) } : null;
2332
+ return n.tagName === "IMG" ? { kind: "image", attrs: Ee(n) } : null;
2156
2333
  },
2157
2334
  create: (n) => {
2158
2335
  const e = document.createElement("figure");
@@ -2174,19 +2351,21 @@ function he() {
2174
2351
  n.className = "aw-block-align-controls", n.setAttribute("contenteditable", "false"), n.setAttribute("aria-hidden", "true");
2175
2352
  for (const e of ["left", "center", "right"]) {
2176
2353
  const t = document.createElement("button");
2177
- t.type = "button", t.className = "aw-block-align-btn", t.dataset.align = e, t.title = e === "left" ? "왼쪽 정렬" : e === "center" ? "가운데 정렬" : "오른쪽 정렬", t.setAttribute("aria-label", t.title), t.innerHTML = Xt[e], n.appendChild(t);
2354
+ t.type = "button", t.className = "aw-block-align-btn", t.dataset.align = e, t.title = e === "left" ? "왼쪽 정렬" : e === "center" ? "가운데 정렬" : "오른쪽 정렬", t.setAttribute("aria-label", t.title), t.innerHTML = tn[e], n.appendChild(t);
2178
2355
  }
2179
2356
  return n;
2180
2357
  }
2181
- const Xt = {
2358
+ const tn = {
2182
2359
  left: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="17" y1="10" x2="3" y2="10"/><line x1="21" y1="6" x2="3" y2="6"/><line x1="21" y1="14" x2="3" y2="14"/><line x1="17" y1="18" x2="3" y2="18"/></svg>',
2183
2360
  center: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="10" x2="6" y2="10"/><line x1="21" y1="6" x2="3" y2="6"/><line x1="21" y1="14" x2="3" y2="14"/><line x1="18" y1="18" x2="6" y2="18"/></svg>',
2184
2361
  right: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="21" y1="10" x2="7" y2="10"/><line x1="21" y1="6" x2="3" y2="6"/><line x1="21" y1="14" x2="3" y2="14"/><line x1="21" y1="18" x2="7" y2="18"/></svg>'
2185
- }, Qt = {
2362
+ }, nn = {
2186
2363
  kind: "table",
2187
2364
  label: "표",
2188
2365
  allowsInlineFormat: !0,
2189
2366
  allowedMarks: Q,
2367
+ allowsColor: !0,
2368
+ allowsFontSize: !0,
2190
2369
  matches: (n) => {
2191
2370
  var l;
2192
2371
  if (n.tagName !== "TABLE") return null;
@@ -2198,30 +2377,34 @@ const Xt = {
2198
2377
  for (let i = 0; i < e; i++) {
2199
2378
  const r = document.createElement("tr");
2200
2379
  for (let s = 0; s < t; s++) {
2201
- const c = document.createElement("td");
2202
- c.appendChild(document.createElement("br")), r.appendChild(c);
2380
+ const a = document.createElement("td");
2381
+ a.appendChild(document.createElement("br")), r.appendChild(a);
2203
2382
  }
2204
2383
  l.appendChild(r);
2205
2384
  }
2206
2385
  return o.appendChild(l), o;
2207
2386
  },
2208
2387
  isEmpty: (n) => n.querySelectorAll(":scope tr").length === 0
2209
- }, Jt = {
2388
+ }, on = {
2210
2389
  kind: "hr",
2211
2390
  label: "구분선",
2212
2391
  allowsInlineFormat: !1,
2213
2392
  allowedMarks: [],
2393
+ allowsColor: !1,
2394
+ allowsFontSize: !1,
2214
2395
  matches: (n) => n.tagName === "HR" ? { kind: "hr", attrs: {} } : null,
2215
2396
  create: () => {
2216
2397
  const n = document.createElement("hr");
2217
2398
  return n.setAttribute("contenteditable", "false"), n;
2218
2399
  },
2219
2400
  isEmpty: () => !1
2220
- }, en = {
2401
+ }, ln = {
2221
2402
  kind: "youtube",
2222
2403
  label: "유튜브",
2223
2404
  allowsInlineFormat: !1,
2224
2405
  allowedMarks: [],
2406
+ allowsColor: !1,
2407
+ allowsFontSize: !1,
2225
2408
  matches: (n) => {
2226
2409
  if (n.tagName !== "DIV" || !n.classList.contains("aw-youtube-embed")) return null;
2227
2410
  const e = n.getAttribute("data-youtube-id") ?? void 0, t = {};
@@ -2239,56 +2422,60 @@ const Xt = {
2239
2422
  ), o.setAttribute("allowfullscreen", ""), o.setAttribute("frameborder", "0"), o.setAttribute("referrerpolicy", "strict-origin-when-cross-origin"), t.appendChild(o), t.appendChild(he()), t.appendChild(pe()), t;
2240
2423
  },
2241
2424
  isEmpty: (n) => !n.getAttribute("data-youtube-id")
2242
- }, tn = {
2425
+ }, rn = {
2243
2426
  kind: "linkCard",
2244
2427
  label: "링크",
2245
2428
  allowsInlineFormat: !1,
2246
2429
  allowedMarks: [],
2430
+ allowsColor: !1,
2431
+ allowsFontSize: !1,
2247
2432
  matches: (n) => {
2248
- var s, c, a, d, u;
2433
+ var s, a, c, d, u;
2249
2434
  if (n.tagName !== "A" || !n.classList.contains("aw-link-card")) return null;
2250
- const e = n.getAttribute("href") ?? void 0, t = ((s = n.querySelector(":scope > .aw-link-card-body > .aw-link-card-title")) == null ? void 0 : s.textContent) ?? ((c = n.querySelector(":scope > .aw-link-card-text")) == null ? void 0 : c.textContent) ?? void 0, o = ((a = n.querySelector(":scope > .aw-link-card-body > .aw-link-card-desc")) == null ? void 0 : a.textContent) ?? void 0, l = ((d = n.querySelector(":scope > .aw-link-card-image")) == null ? void 0 : d.getAttribute("src")) ?? void 0, i = ((u = n.querySelector(":scope .aw-link-card-favicon")) == null ? void 0 : u.getAttribute("src")) ?? void 0, r = {};
2435
+ const e = n.getAttribute("href") ?? void 0, t = ((s = n.querySelector(":scope > .aw-link-card-body > .aw-link-card-title")) == null ? void 0 : s.textContent) ?? ((a = n.querySelector(":scope > .aw-link-card-text")) == null ? void 0 : a.textContent) ?? void 0, o = ((c = n.querySelector(":scope > .aw-link-card-body > .aw-link-card-desc")) == null ? void 0 : c.textContent) ?? void 0, l = ((d = n.querySelector(":scope > .aw-link-card-image")) == null ? void 0 : d.getAttribute("src")) ?? void 0, i = ((u = n.querySelector(":scope .aw-link-card-favicon")) == null ? void 0 : u.getAttribute("src")) ?? void 0, r = {};
2251
2436
  return e && (r.href = e), t && (r.text = t), o && (r.description = o), l && (r.image = l), i && (r.favicon = i), { kind: "linkCard", attrs: r };
2252
2437
  },
2253
2438
  create: (n) => {
2254
- const e = (n == null ? void 0 : n.href) ?? "#", t = n != null && n.text && n.text.length > 0 ? n.text : Ie(e) || e, o = (n == null ? void 0 : n.description) ?? "", l = (n == null ? void 0 : n.image) ?? "", i = (n == null ? void 0 : n.favicon) ?? nn(e), r = document.createElement("a");
2439
+ const e = (n == null ? void 0 : n.href) ?? "#", t = n != null && n.text && n.text.length > 0 ? n.text : De(e) || e, o = (n == null ? void 0 : n.description) ?? "", l = (n == null ? void 0 : n.image) ?? "", i = (n == null ? void 0 : n.favicon) ?? sn(e), r = document.createElement("a");
2255
2440
  if (r.className = "aw-link-card", l && r.classList.add("aw-link-card-with-image"), r.href = e, r.target = "_blank", r.rel = "noopener", r.setAttribute("contenteditable", "false"), l) {
2256
2441
  const u = document.createElement("img");
2257
2442
  u.className = "aw-link-card-image", u.src = l, u.alt = "", u.loading = "lazy", r.appendChild(u);
2258
2443
  }
2259
2444
  const s = document.createElement("span");
2260
2445
  s.className = "aw-link-card-body";
2261
- const c = document.createElement("span");
2262
- if (c.className = "aw-link-card-title", c.textContent = t, s.appendChild(c), o) {
2446
+ const a = document.createElement("span");
2447
+ if (a.className = "aw-link-card-title", a.textContent = t, s.appendChild(a), o) {
2263
2448
  const u = document.createElement("span");
2264
2449
  u.className = "aw-link-card-desc", u.textContent = o, s.appendChild(u);
2265
2450
  }
2266
- const a = document.createElement("span");
2267
- if (a.className = "aw-link-card-url", i) {
2451
+ const c = document.createElement("span");
2452
+ if (c.className = "aw-link-card-url", i) {
2268
2453
  const u = document.createElement("img");
2269
- u.className = "aw-link-card-favicon", u.src = i, u.alt = "", u.loading = "lazy", a.appendChild(u);
2454
+ u.className = "aw-link-card-favicon", u.src = i, u.alt = "", u.loading = "lazy", c.appendChild(u);
2270
2455
  }
2271
2456
  const d = document.createElement("span");
2272
- return d.className = "aw-link-card-url-text", d.textContent = e, a.appendChild(d), s.appendChild(a), r.appendChild(s), r;
2457
+ return d.className = "aw-link-card-url-text", d.textContent = e, c.appendChild(d), s.appendChild(c), r.appendChild(s), r;
2273
2458
  },
2274
2459
  isEmpty: (n) => !n.getAttribute("href")
2275
2460
  };
2276
- function Ie(n) {
2461
+ function De(n) {
2277
2462
  try {
2278
2463
  return new URL(n).hostname;
2279
2464
  } catch {
2280
2465
  return "";
2281
2466
  }
2282
2467
  }
2283
- function nn(n) {
2284
- const e = Ie(n);
2468
+ function sn(n) {
2469
+ const e = De(n);
2285
2470
  return e ? `https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64` : "";
2286
2471
  }
2287
- const on = {
2472
+ const an = {
2288
2473
  kind: "file",
2289
2474
  label: "파일",
2290
2475
  allowsInlineFormat: !1,
2291
2476
  allowedMarks: [],
2477
+ allowsColor: !1,
2478
+ allowsFontSize: !1,
2292
2479
  matches: (n) => {
2293
2480
  if (n.tagName !== "A" || !n.classList.contains("aw-file-attachment")) return null;
2294
2481
  const e = n.getAttribute("href") ?? void 0, t = n.getAttribute("data-file-name") ?? void 0, o = n.getAttribute("data-file-size"), l = o ? Number(o) : void 0, i = n.getAttribute("data-file-type") ?? void 0, r = {};
@@ -2303,20 +2490,20 @@ const on = {
2303
2490
  o.className = "aw-file-meta";
2304
2491
  const l = document.createElement("span");
2305
2492
  l.className = "aw-file-name", l.textContent = (n == null ? void 0 : n.fileName) ?? "파일", o.appendChild(l);
2306
- const i = [], r = rn(n == null ? void 0 : n.fileName, n == null ? void 0 : n.fileType);
2307
- if (r && i.push(r), (n == null ? void 0 : n.fileSize) !== void 0 && i.push(ln(n.fileSize)), i.length > 0) {
2308
- const c = document.createElement("span");
2309
- c.className = "aw-file-info", c.textContent = i.join(" · "), o.appendChild(c);
2493
+ const i = [], r = dn(n == null ? void 0 : n.fileName, n == null ? void 0 : n.fileType);
2494
+ if (r && i.push(r), (n == null ? void 0 : n.fileSize) !== void 0 && i.push(cn(n.fileSize)), i.length > 0) {
2495
+ const a = document.createElement("span");
2496
+ a.className = "aw-file-info", a.textContent = i.join(" · "), o.appendChild(a);
2310
2497
  }
2311
2498
  const s = document.createElement("span");
2312
2499
  return s.className = "aw-file-action", s.setAttribute("aria-hidden", "true"), s.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>', e.appendChild(t), e.appendChild(o), e.appendChild(s), e;
2313
2500
  },
2314
2501
  isEmpty: (n) => !n.getAttribute("href")
2315
2502
  };
2316
- function ln(n) {
2503
+ function cn(n) {
2317
2504
  return n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${(n / 1024).toFixed(1)} KB` : n < 1024 * 1024 * 1024 ? `${(n / 1024 / 1024).toFixed(1)} MB` : `${(n / 1024 / 1024 / 1024).toFixed(1)} GB`;
2318
2505
  }
2319
- function rn(n, e) {
2506
+ function dn(n, e) {
2320
2507
  if (n) {
2321
2508
  const t = n.lastIndexOf(".");
2322
2509
  if (t > 0 && t < n.length - 1)
@@ -2324,11 +2511,13 @@ function rn(n, e) {
2324
2511
  }
2325
2512
  return e ? (e.split("/").pop() ?? "").toUpperCase() : "";
2326
2513
  }
2327
- const sn = {
2514
+ const un = {
2328
2515
  kind: "importedHtml",
2329
2516
  label: "HTML",
2330
2517
  allowsInlineFormat: !1,
2331
2518
  allowedMarks: [],
2519
+ allowsColor: !1,
2520
+ allowsFontSize: !1,
2332
2521
  matches: (n) => {
2333
2522
  if (n.tagName !== "DIV" || n.getAttribute("data-imported-html") !== "true") return null;
2334
2523
  const e = {}, t = n.getAttribute("style");
@@ -2341,42 +2530,44 @@ const sn = {
2341
2530
  return e.setAttribute("data-imported-html", "true"), n != null && n.importedStyle && e.setAttribute("style", n.importedStyle), n != null && n.importedClass && e.setAttribute("class", n.importedClass), e;
2342
2531
  },
2343
2532
  isEmpty: () => !1
2344
- }, ze = {
2533
+ }, He = {
2345
2534
  kind: "unknown",
2346
2535
  label: "알 수 없음",
2347
2536
  allowsInlineFormat: !1,
2348
2537
  allowedMarks: [],
2538
+ allowsColor: !1,
2539
+ allowsFontSize: !1,
2349
2540
  matches: () => null,
2350
2541
  create: () => J(document.createElement("p")),
2351
2542
  isEmpty: (n) => q(n)
2352
- }, He = [
2353
- Ut,
2354
- Wt,
2355
- Kt,
2543
+ }, Fe = [
2356
2544
  Yt,
2357
- Vt,
2358
2545
  Gt,
2359
2546
  Zt,
2547
+ Xt,
2360
2548
  Qt,
2361
2549
  Jt,
2362
- tn,
2363
2550
  en,
2551
+ nn,
2364
2552
  on,
2365
- sn
2366
- ], H = (() => {
2367
- const n = { unknown: ze };
2368
- for (const e of He) n[e.kind] = e;
2553
+ rn,
2554
+ ln,
2555
+ an,
2556
+ un
2557
+ ], N = (() => {
2558
+ const n = { unknown: He };
2559
+ for (const e of Fe) n[e.kind] = e;
2369
2560
  return n;
2370
2561
  })();
2371
2562
  function U(n) {
2372
- for (const e of He) {
2563
+ for (const e of Fe) {
2373
2564
  const t = e.matches(n);
2374
2565
  if (t) return { type: e, match: t };
2375
2566
  }
2376
- return { type: ze, match: { kind: "unknown", attrs: {} } };
2567
+ return { type: He, match: { kind: "unknown", attrs: {} } };
2377
2568
  }
2378
2569
  const F = "data-block-id";
2379
- class De {
2570
+ class Pe {
2380
2571
  constructor() {
2381
2572
  w(this, "counter", 0);
2382
2573
  w(this, "seen", /* @__PURE__ */ new Set());
@@ -2445,7 +2636,7 @@ function we(n) {
2445
2636
  for (const e of Array.from(n.querySelectorAll("figure, div.aw-youtube-embed")))
2446
2637
  e instanceof HTMLElement && (e.querySelector(":scope > .aw-block-align-controls") || e.appendChild(he()), e.querySelector(":scope > .aw-resize-handle") || e.appendChild(pe()));
2447
2638
  }
2448
- function an(n) {
2639
+ function pn(n) {
2449
2640
  switch (n.kind) {
2450
2641
  case "paragraph":
2451
2642
  return "단락";
@@ -2477,7 +2668,7 @@ function an(n) {
2477
2668
  return "?";
2478
2669
  }
2479
2670
  }
2480
- function cn(n) {
2671
+ function hn(n) {
2481
2672
  return {
2482
2673
  id: n.id,
2483
2674
  kind: n.kind,
@@ -2485,17 +2676,17 @@ function cn(n) {
2485
2676
  html: n.element.innerHTML
2486
2677
  };
2487
2678
  }
2488
- function Fe(n) {
2489
- return n.map(cn);
2679
+ function qe(n) {
2680
+ return n.map(hn);
2490
2681
  }
2491
- function dn(n) {
2492
- const t = (H[n.kind] ?? H.unknown).create(n.attrs);
2682
+ function mn(n) {
2683
+ const t = (N[n.kind] ?? N.unknown).create(n.attrs);
2493
2684
  return t.setAttribute(F, n.id), n.html.length > 0 && (t.innerHTML = n.html), t;
2494
2685
  }
2495
- function un(n, e) {
2686
+ function fn(n, e) {
2496
2687
  for (; n.firstChild; ) n.removeChild(n.firstChild);
2497
2688
  for (const t of e)
2498
- n.appendChild(dn(t));
2689
+ n.appendChild(mn(t));
2499
2690
  }
2500
2691
  function de(n, e) {
2501
2692
  const t = [];
@@ -2527,7 +2718,7 @@ function ue(n, e, t) {
2527
2718
  }
2528
2719
  return null;
2529
2720
  }
2530
- function pn(n) {
2721
+ function gn(n) {
2531
2722
  const e = n.element;
2532
2723
  switch (n.kind) {
2533
2724
  case "paragraph":
@@ -2557,7 +2748,7 @@ function ke(n) {
2557
2748
  for (const l of Array.from(t.childNodes)) e.push(l);
2558
2749
  }), e;
2559
2750
  }
2560
- function hn(n, e, t) {
2751
+ function bn(n, e, t) {
2561
2752
  if (t.length === 0) return;
2562
2753
  let o = null;
2563
2754
  switch (e) {
@@ -2578,13 +2769,50 @@ function hn(n, e, t) {
2578
2769
  default:
2579
2770
  return;
2580
2771
  }
2581
- if (o) {
2582
- for (; o.firstChild; ) o.removeChild(o.firstChild);
2583
- for (const l of t) o.appendChild(l);
2772
+ if (!o) return;
2773
+ for (; o.firstChild; ) o.removeChild(o.firstChild);
2774
+ for (const i of t) o.appendChild(i);
2775
+ const l = N[e];
2776
+ l && yn(o, l);
2777
+ }
2778
+ function yn(n, e) {
2779
+ const t = new Set(e.allowedMarks);
2780
+ for (const o of Array.from(n.querySelectorAll("*"))) {
2781
+ if (!(o instanceof HTMLElement) || !o.parentNode) continue;
2782
+ const l = o.tagName.toLowerCase();
2783
+ if ((l === "b" || l === "strong") && !t.has("bold") || (l === "i" || l === "em") && !t.has("italic") || l === "u" && !t.has("underline") || (l === "s" || l === "strike" || l === "del") && !t.has("strike")) {
2784
+ ve(o);
2785
+ continue;
2786
+ }
2787
+ if (l === "span" || l === "font") {
2788
+ const i = o.style;
2789
+ if (!t.has("bold")) {
2790
+ const c = i.fontWeight;
2791
+ (c === "bold" || c === "bolder" || /^[7-9]\d{2}$|^1000$/.test(c)) && i.removeProperty("font-weight");
2792
+ }
2793
+ !t.has("italic") && i.fontStyle === "italic" && i.removeProperty("font-style");
2794
+ const r = i.textDecorationLine || i.textDecoration || "";
2795
+ if (r) {
2796
+ const c = r.split(/\s+/), d = c.filter((u) => !(u === "underline" && !t.has("underline") || u === "line-through" && !t.has("strike")));
2797
+ d.length !== c.length && (i.removeProperty("text-decoration"), i.removeProperty("text-decoration-line"), d.length > 0 && (i.textDecoration = d.join(" ")));
2798
+ }
2799
+ e.allowsColor || (i.removeProperty("color"), i.removeProperty("background-color"), l === "font" && o.removeAttribute("color")), e.allowsFontSize || (i.removeProperty("font-size"), l === "font" && o.removeAttribute("size")), e.allowsInlineFormat || (i.removeProperty("font-family"), l === "font" && o.removeAttribute("face"));
2800
+ const s = i.cssText.trim().length > 0, a = Array.from(o.attributes).some(
2801
+ (c) => c.name !== "style"
2802
+ );
2803
+ !s && !a && ve(o);
2804
+ }
2805
+ }
2806
+ }
2807
+ function ve(n) {
2808
+ const e = n.parentNode;
2809
+ if (e) {
2810
+ for (; n.firstChild; ) e.insertBefore(n.firstChild, n);
2811
+ e.removeChild(n);
2584
2812
  }
2585
2813
  }
2586
- function mn(n = {}) {
2587
- const e = n.fg || "currentColor", t = n.bg || "transparent", o = n.mode === "dark" ? !0 : n.mode === "light" ? !1 : fn(e, t);
2814
+ function wn(n = {}) {
2815
+ const e = n.fg || "currentColor", t = n.bg || "transparent", o = n.mode === "dark" ? !0 : n.mode === "light" ? !1 : kn(e, t);
2588
2816
  return {
2589
2817
  primary: n.primary || "#64c8ff",
2590
2818
  fg: e,
@@ -2594,13 +2822,13 @@ function mn(n = {}) {
2594
2822
  isDark: o
2595
2823
  };
2596
2824
  }
2597
- function fn(n, e) {
2598
- const t = ve(n);
2825
+ function kn(n, e) {
2826
+ const t = Ce(n);
2599
2827
  if (t !== null) return t > 0.5;
2600
- const o = ve(e);
2828
+ const o = Ce(e);
2601
2829
  return o !== null ? o < 0.5 : !0;
2602
2830
  }
2603
- function ve(n) {
2831
+ function Ce(n) {
2604
2832
  if (!n) return null;
2605
2833
  const e = n.trim();
2606
2834
  let t = -1, o = -1, l = -1;
@@ -2614,14 +2842,14 @@ function ve(n) {
2614
2842
  }
2615
2843
  return t < 0 ? null : (0.299 * t + 0.587 * o + 0.114 * l) / 255;
2616
2844
  }
2617
- function Pe(n) {
2618
- const e = getComputedStyle(n), t = (a) => {
2619
- const d = e.getPropertyValue(a).trim();
2845
+ function Oe(n) {
2846
+ const e = getComputedStyle(n), t = (c) => {
2847
+ const d = e.getPropertyValue(c).trim();
2620
2848
  return d.length > 0 ? d : void 0;
2621
- }, o = {}, l = t("--aw-primary"), i = t("--aw-fg"), r = t("--aw-bg"), s = t("--aw-border"), c = t("--aw-fg-muted");
2622
- return l && (o.primary = l), i && (o.fg = i), r && (o.bg = r), s && (o.border = s), c && (o.fgMuted = c), o;
2849
+ }, o = {}, l = t("--aw-primary"), i = t("--aw-fg"), r = t("--aw-bg"), s = t("--aw-border"), a = t("--aw-fg-muted");
2850
+ return l && (o.primary = l), i && (o.fg = i), r && (o.bg = r), s && (o.border = s), a && (o.fgMuted = a), o;
2623
2851
  }
2624
- function gn(n) {
2852
+ function vn(n) {
2625
2853
  const e = `color-mix(in srgb, ${n.primary} 8%, transparent)`, t = `color-mix(in srgb, ${n.fg} 6%, ${n.bg})`;
2626
2854
  return `${n.fg}${n.bg}`, {
2627
2855
  H1: `font-size:1.875rem;font-weight:700;line-height:1.3;margin:.6em 0 .4em;padding-bottom:.25em;border-bottom:1px solid ${n.border};color:${n.fg};`,
@@ -2641,7 +2869,7 @@ function gn(n) {
2641
2869
  A: `display:block;text-decoration:none;margin:1em 0;padding:12px 16px;border:1px solid ${n.border};border-radius:8px;background-color:${e};color:${n.fg};`
2642
2870
  };
2643
2871
  }
2644
- function bn(n) {
2872
+ function Cn(n) {
2645
2873
  const e = `color-mix(in srgb, ${n.fg} 5%, ${n.bg})`, t = `color-mix(in srgb, ${n.primary} 12%, transparent)`;
2646
2874
  return {
2647
2875
  "pre > code": "background:transparent;padding:0;font:inherit;color:inherit;display:block;",
@@ -2675,8 +2903,8 @@ function bn(n) {
2675
2903
  "pre > code .hl-punct": `color:${n.fgMuted};`
2676
2904
  };
2677
2905
  }
2678
- function qe(n, e = {}) {
2679
- const t = mn(e), o = gn(t), l = bn(t);
2906
+ function _e(n, e = {}) {
2907
+ const t = wn(e), o = vn(t), l = Cn(t);
2680
2908
  for (const i of Array.from(n.children)) {
2681
2909
  if (!(i instanceof HTMLElement) || i.getAttribute("data-imported-html") === "true") continue;
2682
2910
  if (i.tagName === "A" && i.classList.contains("aw-file-attachment")) {
@@ -2696,13 +2924,28 @@ function qe(n, e = {}) {
2696
2924
  function oe(n, e) {
2697
2925
  const t = (n.getAttribute("style") ?? "").trim();
2698
2926
  if (!t) {
2699
- n.setAttribute("style", e);
2927
+ const s = e.replace(/;\s*$/, "").trim();
2928
+ s && n.setAttribute("style", s);
2700
2929
  return;
2701
2930
  }
2702
- const o = e.replace(/;\s*$/, ""), l = t.replace(/;\s*$/, "");
2703
- n.setAttribute("style", `${o};${l}`);
2931
+ const o = xe(t), l = new Set(o.map((s) => s.prop)), r = [...xe(e).filter(
2932
+ (s) => !l.has(s.prop)
2933
+ ), ...o].map((s) => `${s.prop}:${s.value}`).join(";");
2934
+ r ? n.setAttribute("style", r) : n.removeAttribute("style");
2704
2935
  }
2705
- function Oe(n) {
2936
+ function xe(n) {
2937
+ const e = [];
2938
+ for (const t of n.split(";")) {
2939
+ const o = t.trim();
2940
+ if (!o) continue;
2941
+ const l = o.indexOf(":");
2942
+ if (l <= 0) continue;
2943
+ const i = o.slice(0, l).trim().toLowerCase(), r = o.slice(l + 1).trim();
2944
+ !i || !r || e.push({ prop: i, value: r });
2945
+ }
2946
+ return e;
2947
+ }
2948
+ function je(n) {
2706
2949
  for (const e of Array.from(n.querySelectorAll("[data-block-kind]")))
2707
2950
  e.removeAttribute("data-block-kind");
2708
2951
  for (const e of Array.from(n.querySelectorAll("[data-block-label]")))
@@ -2719,12 +2962,12 @@ function O(n) {
2719
2962
  if (n.tagName === "HR")
2720
2963
  t.setStartAfter(n);
2721
2964
  else {
2722
- const o = yn(n);
2965
+ const o = xn(n);
2723
2966
  t.selectNodeContents(o), t.collapse(!0);
2724
2967
  }
2725
2968
  e.removeAllRanges(), e.addRange(t);
2726
2969
  }
2727
- function yn(n) {
2970
+ function xn(n) {
2728
2971
  switch (n.tagName) {
2729
2972
  case "UL":
2730
2973
  case "OL": {
@@ -2750,32 +2993,32 @@ function yn(n) {
2750
2993
  function J(n) {
2751
2994
  return n.appendChild(document.createElement("br")), n;
2752
2995
  }
2753
- function _e(n) {
2996
+ function Ue(n) {
2754
2997
  const e = document.createElement(n), t = document.createElement("li");
2755
2998
  return t.appendChild(document.createElement("br")), e.appendChild(t), e;
2756
2999
  }
2757
- function je(n) {
3000
+ function We(n) {
2758
3001
  const e = n.querySelectorAll(":scope > li");
2759
3002
  return e.length === 0 ? !0 : e.length === 1 ? q(e[0]) : !1;
2760
3003
  }
2761
3004
  function q(n) {
2762
3005
  return (n.textContent ?? "").replace(/​/g, "").trim().length === 0;
2763
3006
  }
2764
- function wn(n) {
3007
+ function En(n) {
2765
3008
  return n === void 0 || n < 1 ? 1 : n > 6 ? 6 : n;
2766
3009
  }
2767
- function Ce(n) {
3010
+ function Ee(n) {
2768
3011
  if (!n) return {};
2769
3012
  const e = {}, t = n.getAttribute("src"), o = n.getAttribute("alt");
2770
3013
  return t && (e.src = t), o && (e.alt = o), e;
2771
3014
  }
2772
- const xe = {
3015
+ const Le = {
2773
3016
  bulletList: "bulletList",
2774
3017
  orderedList: "orderedList",
2775
3018
  blockquote: "blockquote",
2776
3019
  codeBlock: "codeBlock"
2777
3020
  }, le = "application/x-aeriz-block";
2778
- class $n {
3021
+ class In {
2779
3022
  constructor(e) {
2780
3023
  w(this, "root");
2781
3024
  w(this, "content");
@@ -2792,12 +3035,12 @@ class $n {
2792
3035
  w(this, "statusSourceEl");
2793
3036
  w(this, "options");
2794
3037
  w(this, "observer");
2795
- w(this, "blockIds", new De());
3038
+ w(this, "blockIds", new Pe());
2796
3039
  w(this, "idFor", (e) => this.blockIds.ensure(e));
2797
3040
  w(this, "listeners", /* @__PURE__ */ new Set());
2798
3041
  w(this, "handleSelectionChange", () => this.queueSync());
2799
3042
  w(this, "handleResize", () => this.repositionHandles());
2800
- w(this, "state", Tn());
3043
+ w(this, "state", Bn());
2801
3044
  w(this, "destroyed", !1);
2802
3045
  w(this, "syncQueued", !1);
2803
3046
  w(this, "lastSerialized", "");
@@ -2815,9 +3058,9 @@ class $n {
2815
3058
  if (!(e.element instanceof HTMLElement))
2816
3059
  throw new TypeError("AerizEditor: options.element must be an HTMLElement");
2817
3060
  if (this.options = e, e.locale && (e.locale, void 0), this.root = document.createElement("div"), this.root.className = "aeriz-wysiwyg", e.theme && (this.root.dataset.theme = e.theme), e.toolbar !== !1) {
2818
- const r = e.toolbar ?? Ke;
2819
- this.toolbar = new Ve(r, {
2820
- onAction: (s, c) => this.handleToolbarAction(s, c)
3061
+ const r = e.toolbar ?? Ye;
3062
+ this.toolbar = new Ze(r, {
3063
+ onAction: (s, a) => this.handleToolbarAction(s, a)
2821
3064
  }), this.root.appendChild(this.toolbar.element);
2822
3065
  }
2823
3066
  this.contentWrap = document.createElement("div"), this.contentWrap.className = "aw-content-wrap", this.content = document.createElement("div"), this.content.className = "aw-content", this.content.contentEditable = "true", this.content.setAttribute("role", "textbox"), this.content.setAttribute("aria-multiline", "true"), e.placeholder && (this.content.dataset.placeholder = e.placeholder), this.content.innerHTML = e.initialHTML ?? "<p><br></p>", we(this.content), ce(this.content, this.blockIds), this.lastSerialized = this.content.innerHTML, this.contentWrap.appendChild(this.content), this.handlesLayer = document.createElement("div"), this.handlesLayer.className = "aw-block-handles", this.contentWrap.appendChild(this.handlesLayer), this.dropIndicator = document.createElement("div"), this.dropIndicator.className = "aw-block-drop-indicator", this.dropIndicator.style.display = "none", this.contentWrap.appendChild(this.dropIndicator), this.blockLabelPill = document.createElement("button"), this.blockLabelPill.type = "button", this.blockLabelPill.className = "aw-block-label-pill", this.blockLabelPill.style.display = "none", this.blockLabelPill.title = "블록 유형 변경", this.blockLabelPill.addEventListener("mousedown", (r) => r.preventDefault()), this.blockLabelPill.addEventListener("click", (r) => {
@@ -2827,9 +3070,9 @@ class $n {
2827
3070
  }), this.contentWrap.appendChild(this.blockLabelPill), this.root.appendChild(this.contentWrap), this.statusBar = document.createElement("div"), this.statusBar.className = "aw-status-bar";
2828
3071
  const t = document.createElement("div");
2829
3072
  t.className = "aw-status-left";
2830
- const o = Se("되돌리기 (Ctrl+Z)", E.undo, () => {
3073
+ const o = Ne("되돌리기 (Ctrl+Z)", E.undo, () => {
2831
3074
  this.content.focus(), document.execCommand("undo");
2832
- }), l = Se("다시 실행 (Ctrl+Y)", E.redo, () => {
3075
+ }), l = Ne("다시 실행 (Ctrl+Y)", E.redo, () => {
2833
3076
  this.content.focus(), document.execCommand("redo");
2834
3077
  });
2835
3078
  this.statusBlockEl = document.createElement("span"), this.statusBlockEl.className = "aw-status-item", t.appendChild(o), t.appendChild(l), t.appendChild(this.statusBlockEl);
@@ -2855,8 +3098,8 @@ class $n {
2855
3098
  * data-block-id 는 보존.
2856
3099
  */
2857
3100
  getHTML() {
2858
- const e = this.content.cloneNode(!0), t = Pe(this.root), o = this.currentTheme();
2859
- return o && (t.mode = o), qe(e, t), Oe(e), e.innerHTML;
3101
+ const e = this.content.cloneNode(!0), t = Oe(this.root), o = this.currentTheme();
3102
+ return o && (t.mode = o), _e(e, t), je(e), e.innerHTML;
2860
3103
  }
2861
3104
  /** 가공 없는 원본 innerHTML. 직렬화 검증/디버그 용도. */
2862
3105
  getRawHTML() {
@@ -2882,7 +3125,7 @@ class $n {
2882
3125
  * AerizViewer.setBlocks(snapshots) 가 받아 동일한 트리를 렌더할 수 있다.
2883
3126
  */
2884
3127
  serialize() {
2885
- return Fe(this.getBlocks());
3128
+ return qe(this.getBlocks());
2886
3129
  }
2887
3130
  /**
2888
3131
  * data-block-id 로 본문에서 블록을 찾아 반환. 없으면 null.
@@ -2904,14 +3147,14 @@ class $n {
2904
3147
  * - 미지정 시 현재 active block 사용. 둘 다 없으면 본문 끝에 새 블록 추가.
2905
3148
  */
2906
3149
  setBlockType(e, t, o) {
2907
- const l = H[e];
3150
+ const l = N[e];
2908
3151
  if (!l) return;
2909
3152
  const i = o ? this.findBlockById(o) : this.getActiveBlock(), r = i ? this.replaceBlock(i, l, t) : this.appendBlock(l, t);
2910
3153
  this.flush(), this.content.focus(), O(r);
2911
3154
  }
2912
3155
  replaceBlock(e, t, o) {
2913
- const l = pn(e), i = t.create(o);
2914
- return hn(i, t.kind, l), i.setAttribute("data-block-explicit", "true"), e.element.replaceWith(i), i;
3156
+ const l = gn(e), i = t.create(o);
3157
+ return bn(i, t.kind, l), i.setAttribute("data-block-explicit", "true"), e.element.replaceWith(i), i;
2915
3158
  }
2916
3159
  appendBlock(e, t) {
2917
3160
  const o = e.create(t);
@@ -2944,9 +3187,9 @@ class $n {
2944
3187
  break;
2945
3188
  }
2946
3189
  case "fontFamily": {
2947
- if (!Ee(this.getActiveBlock())) return;
3190
+ if (!Ae(this.getActiveBlock())) return;
2948
3191
  const o = this.detectActiveFontId();
2949
- Mt(
3192
+ $t(
2950
3193
  t,
2951
3194
  (l) => this.applyFontFamily(l.stack),
2952
3195
  o ?? void 0
@@ -2954,9 +3197,9 @@ class $n {
2954
3197
  break;
2955
3198
  }
2956
3199
  case "fontSize": {
2957
- if (!Le(this.getActiveBlock())) return;
3200
+ if (!Se(this.getActiveBlock())) return;
2958
3201
  const o = this.detectActiveFontSize();
2959
- It(
3202
+ Dt(
2960
3203
  t,
2961
3204
  (l) => this.applyFontSize(l.px),
2962
3205
  o ?? void 0
@@ -2964,7 +3207,7 @@ class $n {
2964
3207
  break;
2965
3208
  }
2966
3209
  case "color": {
2967
- if (!Y(this.getActiveBlock())) return;
3210
+ if (!V(this.getActiveBlock())) return;
2968
3211
  te(
2969
3212
  t,
2970
3213
  (o) => this.handleColorPick(o, "foreColor"),
@@ -2973,7 +3216,7 @@ class $n {
2973
3216
  break;
2974
3217
  }
2975
3218
  case "backgroundColor": {
2976
- if (!Y(this.getActiveBlock())) return;
3219
+ if (!V(this.getActiveBlock())) return;
2977
3220
  te(
2978
3221
  t,
2979
3222
  (o) => this.handleColorPick(o, "hiliteColor"),
@@ -2983,11 +3226,11 @@ class $n {
2983
3226
  }
2984
3227
  case "align": {
2985
3228
  if (!ie(this.getActiveBlock())) return;
2986
- Nt(t, (o) => this.applyAlign(o));
3229
+ Bt(t, (o) => this.applyAlign(o));
2987
3230
  break;
2988
3231
  }
2989
3232
  case "cellBg": {
2990
- if (!V(this.getActiveBlock())) return;
3233
+ if (!Y(this.getActiveBlock())) return;
2991
3234
  const o = this.getSelectedTableCells();
2992
3235
  if (o.length === 0) return;
2993
3236
  te(
@@ -2998,15 +3241,15 @@ class $n {
2998
3241
  break;
2999
3242
  }
3000
3243
  case "tableMenu": {
3001
- if (!V(this.getActiveBlock())) return;
3002
- Rt(t, (o) => this.runTableMenu(o));
3244
+ if (!Y(this.getActiveBlock())) return;
3245
+ It(t, (o) => this.runTableMenu(o));
3003
3246
  break;
3004
3247
  }
3005
3248
  case "codeLang": {
3006
3249
  const o = this.getActiveBlock();
3007
3250
  if (!o || o.kind !== "codeBlock") return;
3008
3251
  const l = o.element.querySelector(":scope > code"), i = (l == null ? void 0 : l.getAttribute("data-language")) ?? void 0;
3009
- Bt(
3252
+ zt(
3010
3253
  t,
3011
3254
  (r) => this.applyCodeLanguage(o.element, r.id),
3012
3255
  i
@@ -3223,8 +3466,8 @@ class $n {
3223
3466
  for (const r of Array.from(i.querySelectorAll("tr"))) {
3224
3467
  const s = r.children[l];
3225
3468
  if (!s) continue;
3226
- const c = s.tagName.toLowerCase(), a = document.createElement(c);
3227
- a.appendChild(document.createElement("br")), e === "left" ? r.insertBefore(a, s) : r.insertBefore(a, s.nextSibling);
3469
+ const a = s.tagName.toLowerCase(), c = document.createElement(a);
3470
+ c.appendChild(document.createElement("br")), e === "left" ? r.insertBefore(c, s) : r.insertBefore(c, s.nextSibling);
3228
3471
  }
3229
3472
  this.flush();
3230
3473
  }
@@ -3262,8 +3505,8 @@ class $n {
3262
3505
  * code 안에 있다면 textContent offset 으로 caret 위치 보존.
3263
3506
  */
3264
3507
  rehighlightCode(e, t) {
3265
- const o = e.textContent ?? "", l = xn(e);
3266
- e.innerHTML = wt(o, t), l && En(e, l);
3508
+ const o = e.textContent ?? "", l = An(e);
3509
+ e.innerHTML = vt(o, t), l && Sn(e, l);
3267
3510
  }
3268
3511
  /**
3269
3512
  * 본문에서 모든 codeBlock 을 순회하며 highlight 적용. setHTML / 초기 로드
@@ -3306,7 +3549,7 @@ class $n {
3306
3549
  this.content.style.cursor = "";
3307
3550
  return;
3308
3551
  }
3309
- const o = Ae(t, e.clientX, e.clientY);
3552
+ const o = Te(t, e.clientX, e.clientY);
3310
3553
  this.content.style.cursor = o === "right" ? "col-resize" : o === "bottom" ? "row-resize" : "";
3311
3554
  }
3312
3555
  /**
@@ -3315,27 +3558,27 @@ class $n {
3315
3558
  * - 이미지·유튜브: 우하단 `.aw-resize-handle` element (corner resize)
3316
3559
  */
3317
3560
  handleTableResizeStart(e) {
3318
- var c;
3561
+ var a;
3319
3562
  if (e.button !== 0) return;
3320
3563
  const t = e.target, o = t == null ? void 0 : t.closest(".aw-resize-handle");
3321
3564
  if (o instanceof HTMLElement) {
3322
- const a = o.parentElement;
3323
- if (a instanceof HTMLElement && (a.tagName === "FIGURE" || a.tagName === "DIV" && a.classList.contains("aw-youtube-embed"))) {
3324
- e.preventDefault(), e.stopPropagation(), this.startBlockResize(a, e.clientX);
3565
+ const c = o.parentElement;
3566
+ if (c instanceof HTMLElement && (c.tagName === "FIGURE" || c.tagName === "DIV" && c.classList.contains("aw-youtube-embed"))) {
3567
+ e.preventDefault(), e.stopPropagation(), this.startBlockResize(c, e.clientX);
3325
3568
  return;
3326
3569
  }
3327
3570
  }
3328
- const l = (c = t == null ? void 0 : t.closest) == null ? void 0 : c.call(t, "td, th");
3571
+ const l = (a = t == null ? void 0 : t.closest) == null ? void 0 : a.call(t, "td, th");
3329
3572
  if (!(l instanceof HTMLTableCellElement)) return;
3330
- const i = Ae(l, e.clientX, e.clientY);
3573
+ const i = Te(l, e.clientX, e.clientY);
3331
3574
  if (!i) return;
3332
3575
  if (e.preventDefault(), e.stopPropagation(), i === "right") {
3333
- const a = l.closest("tr"), d = a ? Array.from(a.children).indexOf(l) : -1, u = l.closest("table");
3576
+ const c = l.closest("tr"), d = c ? Array.from(c.children).indexOf(l) : -1, u = l.closest("table");
3334
3577
  if (!u || d < 0) return;
3335
3578
  const m = [];
3336
- for (const f of Array.from(u.querySelectorAll("tr"))) {
3337
- const p = f.children[d];
3338
- p instanceof HTMLTableCellElement && m.push(p);
3579
+ for (const h of Array.from(u.querySelectorAll("tr"))) {
3580
+ const f = h.children[d];
3581
+ f instanceof HTMLTableCellElement && m.push(f);
3339
3582
  }
3340
3583
  this.tableResize = {
3341
3584
  kind: "col",
@@ -3346,18 +3589,18 @@ class $n {
3346
3589
  targetRow: null
3347
3590
  }, document.body.style.cursor = "col-resize";
3348
3591
  } else {
3349
- const a = l.closest("tr");
3350
- if (!(a instanceof HTMLTableRowElement)) return;
3592
+ const c = l.closest("tr");
3593
+ if (!(c instanceof HTMLTableRowElement)) return;
3351
3594
  this.tableResize = {
3352
3595
  kind: "row",
3353
3596
  startX: e.clientX,
3354
3597
  startY: e.clientY,
3355
- initialSize: a.getBoundingClientRect().height,
3598
+ initialSize: c.getBoundingClientRect().height,
3356
3599
  targetCells: [],
3357
- targetRow: a
3600
+ targetRow: c
3358
3601
  }, document.body.style.cursor = "row-resize";
3359
3602
  }
3360
- const r = (a) => this.handleTableResizeMove(a), s = () => {
3603
+ const r = (c) => this.handleTableResizeMove(c), s = () => {
3361
3604
  document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", s), document.body.style.cursor = "", this.tableResize = null, this.flush();
3362
3605
  };
3363
3606
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", s);
@@ -3396,8 +3639,8 @@ class $n {
3396
3639
  const o = e.getBoundingClientRect().width;
3397
3640
  document.body.style.cursor = "nwse-resize", e.classList.add("aw-resizing");
3398
3641
  const l = (r) => {
3399
- const s = r.clientX - t, c = Math.max(80, o + s);
3400
- e.style.width = `${Math.round(c)}px`;
3642
+ const s = r.clientX - t, a = Math.max(80, o + s);
3643
+ e.style.width = `${Math.round(a)}px`;
3401
3644
  }, i = () => {
3402
3645
  document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", i), document.body.style.cursor = "", e.classList.remove("aw-resizing"), this.flush();
3403
3646
  };
@@ -3426,7 +3669,7 @@ class $n {
3426
3669
  let t = e.getRangeAt(0).startContainer;
3427
3670
  if (!t || !this.content.contains(t) || (t.nodeType !== Node.ELEMENT_NODE && (t = t.parentElement), !(t instanceof Element))) return null;
3428
3671
  const o = getComputedStyle(t).fontFamily;
3429
- return it(o);
3672
+ return st(o);
3430
3673
  }
3431
3674
  /**
3432
3675
  * 선택 영역에 글자 크기를 적용한다. execCommand('fontSize') 는 1~7 만 받기
@@ -3449,11 +3692,11 @@ class $n {
3449
3692
  }
3450
3693
  const o = document.getSelection();
3451
3694
  if (o && o.rangeCount > 0 && !o.getRangeAt(0).collapsed) {
3452
- const s = o.getRangeAt(0), c = G(s.startContainer), a = G(s.endContainer);
3453
- if (c && a && c !== a && this.content.contains(c) && this.content.contains(a)) {
3454
- const d = c.closest("table");
3695
+ const s = o.getRangeAt(0), a = G(s.startContainer), c = G(s.endContainer);
3696
+ if (a && c && a !== c && this.content.contains(a) && this.content.contains(c)) {
3697
+ const d = a.closest("table");
3455
3698
  if (d instanceof HTMLTableElement) {
3456
- this.applyFontSizeToCells(re(d, c, a), e);
3699
+ this.applyFontSizeToCells(re(d, a, c), e);
3457
3700
  return;
3458
3701
  }
3459
3702
  }
@@ -3472,8 +3715,8 @@ class $n {
3472
3715
  try {
3473
3716
  i.surroundContents(r);
3474
3717
  } catch {
3475
- const c = i.extractContents();
3476
- r.appendChild(c), i.insertNode(r);
3718
+ const a = i.extractContents();
3719
+ r.appendChild(a), i.insertNode(r);
3477
3720
  }
3478
3721
  l.removeAllRanges();
3479
3722
  const s = document.createRange();
@@ -3492,7 +3735,7 @@ class $n {
3492
3735
  let t = e.getRangeAt(0).startContainer;
3493
3736
  if (!t || !this.content.contains(t) || (t.nodeType !== Node.ELEMENT_NODE && (t = t.parentElement), !(t instanceof Element))) return null;
3494
3737
  const o = getComputedStyle(t).fontSize;
3495
- return ot(o);
3738
+ return it(o);
3496
3739
  }
3497
3740
  /**
3498
3741
  * 블록 유형 드롭다운을 열어 사용자 선택 결과를 처리한다.
@@ -3500,7 +3743,7 @@ class $n {
3500
3743
  * 로직(리치 블록 다이얼로그 분기 + targetId 보존) 을 공유한다.
3501
3744
  */
3502
3745
  openBlockTypeMenu(e, t) {
3503
- Tt(e, (o) => {
3746
+ Mt(e, (o) => {
3504
3747
  if (o.kind === "linkCard") {
3505
3748
  this.openLinkDialogAndApply(t);
3506
3749
  return;
@@ -3514,7 +3757,7 @@ class $n {
3514
3757
  return;
3515
3758
  }
3516
3759
  if (o.kind === "table") {
3517
- zt(e, (l) => {
3760
+ Ht(e, (l) => {
3518
3761
  this.setBlockType(
3519
3762
  "table",
3520
3763
  { rows: l.rows, cols: l.cols },
@@ -3544,7 +3787,7 @@ class $n {
3544
3787
  * 그 id 의 블록을 정확히 변환 대상으로 삼는다.
3545
3788
  */
3546
3789
  openLinkDialogAndApply(e) {
3547
- Ge({}, this.currentTheme()).then((t) => {
3790
+ Xe({}, this.currentTheme()).then((t) => {
3548
3791
  var r;
3549
3792
  if (!t.confirmed || !t.href) return;
3550
3793
  const o = t.href, l = ((r = t.text) == null ? void 0 : r.trim()) ?? "", i = l.length > 0 ? l : o;
@@ -3557,7 +3800,7 @@ class $n {
3557
3800
  */
3558
3801
  openImageDialogAndApply(e) {
3559
3802
  const t = this.resolveImageUploadFn();
3560
- Ze(
3803
+ Qe(
3561
3804
  { ...t ? { onUpload: t } : {} },
3562
3805
  this.currentTheme()
3563
3806
  ).then((o) => {
@@ -3569,9 +3812,9 @@ class $n {
3569
3812
  * 변환/추가. 잘못된 URL 이면 무시.
3570
3813
  */
3571
3814
  openYouTubeDialogAndApply(e) {
3572
- et(this.currentTheme()).then((t) => {
3815
+ nt(this.currentTheme()).then((t) => {
3573
3816
  if (!t.confirmed || !t.url) return;
3574
- const o = Ln(t.url);
3817
+ const o = Tn(t.url);
3575
3818
  o && this.setBlockType("youtube", { videoId: o }, e);
3576
3819
  });
3577
3820
  }
@@ -3583,7 +3826,7 @@ class $n {
3583
3826
  * - 삽입된 element 는 MutationObserver flush 가 새 data-block-id 를 발급.
3584
3827
  */
3585
3828
  openImportHtmlDialogAndApply(e) {
3586
- Xe(this.currentTheme()).then(async (t) => {
3829
+ Je(this.currentTheme()).then(async (t) => {
3587
3830
  if (!t.confirmed) return;
3588
3831
  if (!t.html || t.html.length === 0) {
3589
3832
  window.alert("가져올 HTML 이 비어 있습니다.");
@@ -3591,11 +3834,13 @@ class $n {
3591
3834
  }
3592
3835
  let o;
3593
3836
  try {
3594
- o = await Dt(t.html);
3837
+ o = await qt(t.html, {
3838
+ mountTarget: this.content
3839
+ });
3595
3840
  } catch (s) {
3596
3841
  console.error("HTML 가져오기 실패:", s);
3597
- const c = s instanceof Error ? s.message : String(s);
3598
- window.alert(`HTML 가져오기 실패: ${c}`);
3842
+ const a = s instanceof Error ? s.message : String(s);
3843
+ window.alert(`HTML 가져오기 실패: ${a}`);
3599
3844
  return;
3600
3845
  }
3601
3846
  if (o.length === 0) {
@@ -3604,25 +3849,25 @@ class $n {
3604
3849
  }
3605
3850
  const l = e ? this.content.querySelector(`[data-block-id="${e}"]`) : null, i = [];
3606
3851
  for (const s of o) {
3607
- const c = Mn(s.tagName) ? s : (() => {
3608
- const a = document.createElement("p");
3609
- return a.appendChild(s), a;
3852
+ const a = zn(s.tagName) ? s : (() => {
3853
+ const c = document.createElement("p");
3854
+ return c.appendChild(s), c;
3610
3855
  })();
3611
- c.setAttribute("data-block-explicit", "true"), i.push(c);
3856
+ a.setAttribute("data-block-explicit", "true"), i.push(a);
3612
3857
  }
3613
3858
  if (l)
3614
3859
  if (l.tagName === "P" && (l.textContent ?? "").trim().length === 0 && i.length > 0) {
3615
- const c = i[0];
3616
- l.replaceWith(c);
3617
- let a = c;
3860
+ const a = i[0];
3861
+ l.replaceWith(a);
3862
+ let c = a;
3618
3863
  for (let d = 1; d < i.length; d++) {
3619
3864
  const u = i[d];
3620
- a.after(u), a = u;
3865
+ c.after(u), c = u;
3621
3866
  }
3622
3867
  } else {
3623
- let c = l;
3624
- for (const a of i)
3625
- c.after(a), c = a;
3868
+ let a = l;
3869
+ for (const c of i)
3870
+ a.after(c), a = c;
3626
3871
  }
3627
3872
  else
3628
3873
  for (const s of i) this.content.appendChild(s);
@@ -3636,7 +3881,7 @@ class $n {
3636
3881
  * 본문에 element 들을 삽입한다. importHtml 과 동일한 삽입 정책을 따른다.
3637
3882
  */
3638
3883
  openMarkdownImportDialogAndApply(e) {
3639
- Qe(this.currentTheme()).then((t) => {
3884
+ et(this.currentTheme()).then((t) => {
3640
3885
  if (!t.confirmed) return;
3641
3886
  if (!t.markdown || t.markdown.length === 0) {
3642
3887
  window.alert("가져올 Markdown 이 비어 있습니다.");
@@ -3644,7 +3889,7 @@ class $n {
3644
3889
  }
3645
3890
  let o;
3646
3891
  try {
3647
- o = Pt(t.markdown);
3892
+ o = jt(t.markdown);
3648
3893
  } catch (r) {
3649
3894
  console.error("Markdown 파싱 실패:", r);
3650
3895
  const s = r instanceof Error ? r.message : String(r);
@@ -3661,15 +3906,15 @@ class $n {
3661
3906
  if (l.tagName === "P" && (l.textContent ?? "").trim().length === 0 && o.length > 0) {
3662
3907
  const s = o[0];
3663
3908
  l.replaceWith(s);
3664
- let c = s;
3665
- for (let a = 1; a < o.length; a++) {
3666
- const d = o[a];
3667
- c.after(d), c = d;
3909
+ let a = s;
3910
+ for (let c = 1; c < o.length; c++) {
3911
+ const d = o[c];
3912
+ a.after(d), a = d;
3668
3913
  }
3669
3914
  } else {
3670
3915
  let s = l;
3671
- for (const c of o)
3672
- s.after(c), s = c;
3916
+ for (const a of o)
3917
+ s.after(a), s = a;
3673
3918
  }
3674
3919
  else
3675
3920
  for (const r of o) this.content.appendChild(r);
@@ -3685,7 +3930,7 @@ class $n {
3685
3930
  */
3686
3931
  openFileAttachmentDialogAndApply(e) {
3687
3932
  const t = this.resolveFileUploadFn();
3688
- Je(
3933
+ tt(
3689
3934
  { ...t ? { onUpload: t } : {} },
3690
3935
  this.currentTheme()
3691
3936
  ).then((o) => {
@@ -3694,7 +3939,7 @@ class $n {
3694
3939
  window.alert("파일 URL 이 비어 있습니다.");
3695
3940
  return;
3696
3941
  }
3697
- const l = { fileSrc: o.src }, i = o.name && o.name.length > 0 ? o.name : An(o.src);
3942
+ const l = { fileSrc: o.src }, i = o.name && o.name.length > 0 ? o.name : Nn(o.src);
3698
3943
  i && (l.fileName = i), o.size !== void 0 && (l.fileSize = o.size), o.type && (l.fileType = o.type), this.setBlockType("file", l, e);
3699
3944
  });
3700
3945
  }
@@ -3921,8 +4166,8 @@ class $n {
3921
4166
  const i = e.element.getBoundingClientRect(), r = this.contentWrap.getBoundingClientRect(), s = Math.max(
3922
4167
  0,
3923
4168
  i.top - r.top + this.contentWrap.scrollTop - 12
3924
- ), c = i.left - r.left + 4;
3925
- this.blockLabelPill.style.top = `${s}px`, this.blockLabelPill.style.left = `${c}px`;
4169
+ ), a = i.left - r.left + 4;
4170
+ this.blockLabelPill.style.top = `${s}px`, this.blockLabelPill.style.left = `${a}px`;
3926
4171
  }
3927
4172
  /**
3928
4173
  * 하단 Status Bar 갱신.
@@ -3932,19 +4177,19 @@ class $n {
3932
4177
  syncStatusBar(e, t) {
3933
4178
  if (e) {
3934
4179
  const { type: r, match: s } = U(e.element);
3935
- let c = se(e.element, r, s);
4180
+ let a = se(e.element, r, s);
3936
4181
  if (e.kind === "codeBlock") {
3937
- const a = e.element.querySelector(":scope > code"), d = a == null ? void 0 : a.getAttribute("data-language");
3938
- d && (c += ` · ${d}`);
4182
+ const c = e.element.querySelector(":scope > code"), d = c == null ? void 0 : c.getAttribute("data-language");
4183
+ d && (a += ` · ${d}`);
3939
4184
  }
3940
- this.statusBlockEl.textContent = c;
4185
+ this.statusBlockEl.textContent = a;
3941
4186
  } else
3942
4187
  this.statusBlockEl.textContent = "— 선택된 블록 없음";
3943
4188
  this.statusBlocksEl.textContent = `${t.length} 블록`;
3944
4189
  const o = (this.content.textContent ?? "").replace(/\s+/g, ""), l = Array.from(o).length;
3945
4190
  this.statusCharsEl.textContent = `텍스트 ${l} 자`;
3946
4191
  const i = this.content.innerHTML.length;
3947
- this.statusSourceEl.textContent = `소스 ${Sn(i)}`;
4192
+ this.statusSourceEl.textContent = `소스 ${Mn(i)}`;
3948
4193
  }
3949
4194
  syncBlockMarkers(e) {
3950
4195
  for (const t of Array.from(this.content.children)) {
@@ -3959,53 +4204,39 @@ class $n {
3959
4204
  applyToolbarState(e, t) {
3960
4205
  if (this.toolbar) {
3961
4206
  this.toolbar.setActive("bold", e.inline.bold), this.toolbar.setActive("italic", e.inline.italic), this.toolbar.setActive("underline", e.inline.underline), this.toolbar.setActive("strike", e.inline.strike);
3962
- for (const o of Object.keys(xe)) {
3963
- const l = xe[o];
4207
+ for (const o of Object.keys(Le)) {
4208
+ const l = Le[o];
3964
4209
  this.toolbar.setActive(o, (t == null ? void 0 : t.kind) === l);
3965
4210
  }
3966
- this.toolbar.setVisible("bold", _(t, "bold")), this.toolbar.setVisible("italic", _(t, "italic")), this.toolbar.setVisible("underline", _(t, "underline")), this.toolbar.setVisible("strike", _(t, "strike")), this.toolbar.setVisible("fontFamily", Ee(t)), this.toolbar.setVisible("fontSize", Le(t)), this.toolbar.setVisible("color", Y(t)), this.toolbar.setVisible("backgroundColor", Y(t)), this.toolbar.setVisible("align", ie(t)), this.toolbar.setVisible("cellBg", V(t)), this.toolbar.setVisible("tableMenu", V(t)), this.toolbar.setVisible("codeLang", (t == null ? void 0 : t.kind) === "codeBlock"), this.toolbar.syncGroupVisibility();
4211
+ this.toolbar.setVisible("bold", _(t, "bold")), this.toolbar.setVisible("italic", _(t, "italic")), this.toolbar.setVisible("underline", _(t, "underline")), this.toolbar.setVisible("strike", _(t, "strike")), this.toolbar.setVisible("fontFamily", Ae(t)), this.toolbar.setVisible("fontSize", Se(t)), this.toolbar.setVisible("color", V(t)), this.toolbar.setVisible("backgroundColor", V(t)), this.toolbar.setVisible("align", ie(t)), this.toolbar.setVisible("cellBg", Y(t)), this.toolbar.setVisible("tableMenu", Y(t)), this.toolbar.setVisible("codeLang", (t == null ? void 0 : t.kind) === "codeBlock"), this.toolbar.syncGroupVisibility();
3967
4212
  }
3968
4213
  }
3969
4214
  }
3970
4215
  function _(n, e) {
3971
- return n ? (H[n.kind] ?? H.unknown).allowedMarks.includes(e) : !1;
4216
+ return n ? (N[n.kind] ?? N.unknown).allowedMarks.includes(e) : !1;
3972
4217
  }
3973
- function Ee(n) {
3974
- return n ? (H[n.kind] ?? H.unknown).allowsInlineFormat : !1;
4218
+ function Ae(n) {
4219
+ return n ? (N[n.kind] ?? N.unknown).allowsInlineFormat : !1;
3975
4220
  }
3976
- const kn = /* @__PURE__ */ new Set([
3977
- "paragraph",
3978
- "bulletList",
3979
- "orderedList",
3980
- "blockquote",
3981
- "codeBlock",
3982
- "table"
3983
- ]);
3984
- function Le(n) {
3985
- return n ? kn.has(n.kind) : !1;
4221
+ function Se(n) {
4222
+ return n ? (N[n.kind] ?? N.unknown).allowsFontSize : !1;
3986
4223
  }
3987
- const vn = /* @__PURE__ */ new Set([
3988
- "paragraph",
3989
- "bulletList",
3990
- "orderedList",
3991
- "table"
3992
- ]);
3993
- function Y(n) {
3994
- return n ? vn.has(n.kind) : !1;
4224
+ function V(n) {
4225
+ return n ? (N[n.kind] ?? N.unknown).allowsColor : !1;
3995
4226
  }
3996
- const Cn = /* @__PURE__ */ new Set([
4227
+ const Ln = /* @__PURE__ */ new Set([
3997
4228
  "paragraph",
3998
4229
  "heading",
3999
4230
  "blockquote",
4000
4231
  "table"
4001
4232
  ]);
4002
4233
  function ie(n) {
4003
- return n ? Cn.has(n.kind) : !1;
4234
+ return n ? Ln.has(n.kind) : !1;
4004
4235
  }
4005
- function V(n) {
4236
+ function Y(n) {
4006
4237
  return (n == null ? void 0 : n.kind) === "table";
4007
4238
  }
4008
- function xn(n) {
4239
+ function An(n) {
4009
4240
  const e = document.getSelection();
4010
4241
  if (!e || e.rangeCount === 0) return null;
4011
4242
  const t = e.getRangeAt(0);
@@ -4017,23 +4248,23 @@ function xn(n) {
4017
4248
  const i = o.toString().length;
4018
4249
  return { start: l, end: i };
4019
4250
  }
4020
- function En(n, e) {
4251
+ function Sn(n, e) {
4021
4252
  var u;
4022
4253
  const t = document.createTreeWalker(n, NodeFilter.SHOW_TEXT);
4023
- let o = 0, l = null, i = 0, r = null, s = 0, c = t.nextNode();
4024
- for (; c; ) {
4025
- const m = ((u = c.textContent) == null ? void 0 : u.length) ?? 0;
4026
- if (!l && o + m >= e.start && (l = c, i = e.start - o), !r && o + m >= e.end) {
4027
- r = c, s = e.end - o;
4254
+ let o = 0, l = null, i = 0, r = null, s = 0, a = t.nextNode();
4255
+ for (; a; ) {
4256
+ const m = ((u = a.textContent) == null ? void 0 : u.length) ?? 0;
4257
+ if (!l && o + m >= e.start && (l = a, i = e.start - o), !r && o + m >= e.end) {
4258
+ r = a, s = e.end - o;
4028
4259
  break;
4029
4260
  }
4030
- o += m, c = t.nextNode();
4261
+ o += m, a = t.nextNode();
4031
4262
  }
4032
4263
  if (!l || !r) return;
4033
- const a = document.createRange();
4034
- a.setStart(l, i), a.setEnd(r, s);
4264
+ const c = document.createRange();
4265
+ c.setStart(l, i), c.setEnd(r, s);
4035
4266
  const d = document.getSelection();
4036
- d == null || d.removeAllRanges(), d == null || d.addRange(a);
4267
+ d == null || d.removeAllRanges(), d == null || d.addRange(c);
4037
4268
  }
4038
4269
  function G(n) {
4039
4270
  let e = n;
@@ -4047,27 +4278,27 @@ function re(n, e, t) {
4047
4278
  return [e];
4048
4279
  const i = Array.from(n.querySelectorAll("tr")), r = i.indexOf(o), s = i.indexOf(l);
4049
4280
  if (r < 0 || s < 0) return [e];
4050
- const c = Math.min(r, s), a = Math.max(r, s), d = Array.from(o.children).indexOf(e), u = Array.from(l.children).indexOf(t);
4281
+ const a = Math.min(r, s), c = Math.max(r, s), d = Array.from(o.children).indexOf(e), u = Array.from(l.children).indexOf(t);
4051
4282
  if (d < 0 || u < 0) return [e];
4052
- const m = Math.min(d, u), f = Math.max(d, u), p = [];
4053
- for (let h = c; h <= a; h++) {
4054
- const b = i[h];
4055
- if (b)
4056
- for (let v = m; v <= f; v++) {
4057
- const k = b.children[v];
4058
- k instanceof HTMLTableCellElement && p.push(k);
4283
+ const m = Math.min(d, u), h = Math.max(d, u), f = [];
4284
+ for (let p = a; p <= c; p++) {
4285
+ const g = i[p];
4286
+ if (g)
4287
+ for (let b = m; b <= h; b++) {
4288
+ const v = g.children[b];
4289
+ v instanceof HTMLTableCellElement && f.push(v);
4059
4290
  }
4060
4291
  }
4061
- return p;
4292
+ return f;
4062
4293
  }
4063
- function Ae(n, e, t) {
4294
+ function Te(n, e, t) {
4064
4295
  const o = n.getBoundingClientRect(), l = 6;
4065
4296
  return e < o.left - l || e > o.right + l || t < o.top - l || t > o.bottom + l ? null : e >= o.right - l ? "right" : t >= o.bottom - l ? "bottom" : null;
4066
4297
  }
4067
4298
  function se(n, e, t) {
4068
- return n.getAttribute("data-block-explicit") === "true" || !e.isEmpty(n) ? t.kind === "unknown" ? n.tagName.toLowerCase() : an(t) : "?";
4299
+ return n.getAttribute("data-block-explicit") === "true" || !e.isEmpty(n) ? t.kind === "unknown" ? n.tagName.toLowerCase() : pn(t) : "?";
4069
4300
  }
4070
- function Ln(n) {
4301
+ function Tn(n) {
4071
4302
  const e = n.trim();
4072
4303
  if (!e) return null;
4073
4304
  let t;
@@ -4085,7 +4316,7 @@ function Ln(n) {
4085
4316
  }
4086
4317
  return null;
4087
4318
  }
4088
- function An(n) {
4319
+ function Nn(n) {
4089
4320
  var e;
4090
4321
  try {
4091
4322
  const l = new URL(n, "http://localhost").pathname.split("/").filter(Boolean).pop();
@@ -4094,14 +4325,14 @@ function An(n) {
4094
4325
  return (((e = n.split("?")[0]) == null ? void 0 : e.split("#")[0]) ?? "").split("/").filter(Boolean).pop() ?? "";
4095
4326
  }
4096
4327
  }
4097
- function Sn(n) {
4328
+ function Mn(n) {
4098
4329
  return n >= 1e6 ? `${(n / 1e6).toFixed(1)}M` : n >= 1e3 ? `${(n / 1e3).toFixed(1)}K` : `${n}`;
4099
4330
  }
4100
- function Se(n, e, t) {
4331
+ function Ne(n, e, t) {
4101
4332
  const o = document.createElement("button");
4102
4333
  return o.type = "button", o.className = "aw-status-action", o.title = n, o.setAttribute("aria-label", n), o.innerHTML = e, o.addEventListener("mousedown", (l) => l.preventDefault()), o.addEventListener("click", t), o;
4103
4334
  }
4104
- function Tn() {
4335
+ function Bn() {
4105
4336
  return {
4106
4337
  blocks: [],
4107
4338
  activeBlockId: null,
@@ -4115,7 +4346,7 @@ function Z(n) {
4115
4346
  return !1;
4116
4347
  }
4117
4348
  }
4118
- const Nn = /* @__PURE__ */ new Set([
4349
+ const $n = /* @__PURE__ */ new Set([
4119
4350
  "P",
4120
4351
  "DIV",
4121
4352
  "SECTION",
@@ -4147,14 +4378,14 @@ const Nn = /* @__PURE__ */ new Set([
4147
4378
  "FIELDSET",
4148
4379
  "ADDRESS"
4149
4380
  ]);
4150
- function Mn(n) {
4151
- return Nn.has(n.toUpperCase());
4381
+ function zn(n) {
4382
+ return $n.has(n.toUpperCase());
4152
4383
  }
4153
- class Rn {
4384
+ class Dn {
4154
4385
  constructor(e) {
4155
4386
  w(this, "root");
4156
4387
  w(this, "content");
4157
- w(this, "blockIds", new De());
4388
+ w(this, "blockIds", new Pe());
4158
4389
  w(this, "idFor", (e) => this.blockIds.ensure(e));
4159
4390
  w(this, "destroyed", !1);
4160
4391
  if (!(e.element instanceof HTMLElement))
@@ -4169,11 +4400,11 @@ class Rn {
4169
4400
  * 경로를 거치지 않는다.
4170
4401
  */
4171
4402
  setBlocks(e) {
4172
- un(this.content, e), ce(this.content, this.blockIds);
4403
+ fn(this.content, e), ce(this.content, this.blockIds);
4173
4404
  }
4174
4405
  /** 현재 본문의 BlockSnapshot 배열을 반환한다. */
4175
4406
  getBlocks() {
4176
- return Fe(this.listBlocksInternal());
4407
+ return qe(this.listBlocksInternal());
4177
4408
  }
4178
4409
  /** 임의의 노드를 받아 그 노드가 속한 블록을 반환한다. 본문 밖이면 null. */
4179
4410
  getBlockOf(e) {
@@ -4184,8 +4415,8 @@ class Rn {
4184
4415
  * 보이도록 portable 인라인 스타일을 입힌 자급자족적 HTML 을 반환한다.
4185
4416
  */
4186
4417
  getHTML() {
4187
- const e = this.content.cloneNode(!0), t = Pe(this.root), o = this.root.dataset.theme;
4188
- return (o === "light" || o === "dark") && (t.mode = o), qe(e, t), Oe(e), e.innerHTML;
4418
+ const e = this.content.cloneNode(!0), t = Oe(this.root), o = this.root.dataset.theme;
4419
+ return (o === "light" || o === "dark") && (t.mode = o), _e(e, t), je(e), e.innerHTML;
4189
4420
  }
4190
4421
  setTheme(e) {
4191
4422
  this.root.dataset.theme = e;
@@ -4200,28 +4431,28 @@ class Rn {
4200
4431
  typeof globalThis.AerizWysiwyg == "object" && (globalThis.AerizEditor = globalThis.AerizWysiwyg.AerizEditor, globalThis.AerizViewer = globalThis.AerizWysiwyg.AerizViewer);
4201
4432
  export {
4202
4433
  Q as ALL_INLINE_MARKS,
4203
- $n as AerizEditor,
4204
- Rn as AerizViewer,
4434
+ In as AerizEditor,
4435
+ Dn as AerizViewer,
4205
4436
  F as BLOCK_ID_ATTR,
4206
- He as BLOCK_TYPES,
4207
- H as BLOCK_TYPE_BY_KIND,
4208
- De as BlockIdRegistry,
4209
- Ke as DEFAULT_TOOLBAR,
4210
- qe as applyBlockInlineStyles,
4437
+ Fe as BLOCK_TYPES,
4438
+ N as BLOCK_TYPE_BY_KIND,
4439
+ Pe as BlockIdRegistry,
4440
+ Ye as DEFAULT_TOOLBAR,
4441
+ _e as applyBlockInlineStyles,
4211
4442
  ce as assignMissingIds,
4212
4443
  U as classifyBlockElement,
4213
- pn as extractInlineContent,
4214
- hn as fillInlineContent,
4444
+ gn as extractInlineContent,
4445
+ bn as fillInlineContent,
4215
4446
  ue as findBlockFrom,
4216
- an as getBlockLabel,
4447
+ pn as getBlockLabel,
4217
4448
  q as isElementBlank,
4218
4449
  de as listBlocks,
4219
4450
  we as normalizeContent,
4220
4451
  O as placeCaretAtStart,
4221
- Pe as readBlockStyleTheme,
4222
- dn as renderBlock,
4223
- un as renderBlocks,
4224
- cn as serializeBlock,
4225
- Fe as serializeBlocks,
4226
- Oe as stripEditorOnlyAttrs
4452
+ Oe as readBlockStyleTheme,
4453
+ mn as renderBlock,
4454
+ fn as renderBlocks,
4455
+ hn as serializeBlock,
4456
+ qe as serializeBlocks,
4457
+ je as stripEditorOnlyAttrs
4227
4458
  };