pubuilder 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,31 +1,31 @@
1
1
  "use client";
2
- import { jsxs as d, jsx as n, Fragment as ee } from "react/jsx-runtime";
3
- import { createContext as ae, memo as ce, useRef as D, useState as _, useEffect as R, useMemo as V, useContext as te, useLayoutEffect as ie } from "react";
4
- import { createPortal as se } from "react-dom";
5
- import { normalizeIA as de } from "./config.js";
6
- import { defineIA as Xe } from "./config.js";
7
- import { create as ue } from "zustand";
8
- import { Handle as J, Position as j, ReactFlow as pe } from "@xyflow/react";
9
- const be = "http://localhost:4816";
10
- class oe extends Error {
11
- constructor(t, r) {
12
- super(t), this.code = r, this.name = "ApiError";
2
+ import { jsxs as a, jsx as e, Fragment as ne } from "react/jsx-runtime";
3
+ import { createContext as se, memo as de, useRef as H, useState as v, useEffect as A, useMemo as K, useContext as le, useLayoutEffect as ue } from "react";
4
+ import { createPortal as pe } from "react-dom";
5
+ import { normalizeIA as be } from "./config.js";
6
+ import { defineIA as et } from "./config.js";
7
+ import { create as fe } from "zustand";
8
+ import { Handle as Q, Position as V, ReactFlow as he } from "@xyflow/react";
9
+ const ge = "http://localhost:4816";
10
+ class J extends Error {
11
+ constructor(o, n) {
12
+ super(o), this.code = n, this.name = "ApiError";
13
13
  }
14
14
  }
15
- class re {
16
- constructor(t = be) {
17
- this.baseUrl = t;
15
+ class ae {
16
+ constructor(o = ge) {
17
+ this.baseUrl = o;
18
18
  }
19
- async request(t, r) {
20
- const o = await fetch(`${this.baseUrl}${t}`, {
21
- ...r,
22
- headers: { "content-type": "application/json", ...r?.headers }
19
+ async request(o, n) {
20
+ const r = await fetch(`${this.baseUrl}${o}`, {
21
+ ...n,
22
+ headers: { "content-type": "application/json", ...n?.headers }
23
23
  });
24
- if (!o.ok) {
25
- const l = await o.json().catch(() => ({}));
26
- throw new oe(l.message ?? `요청 실패 (${o.status})`, l.code);
24
+ if (!r.ok) {
25
+ const l = await r.json().catch(() => ({}));
26
+ throw new J(l.message ?? `요청 실패 (${r.status})`, l.code);
27
27
  }
28
- return o.status === 204 ? void 0 : await o.json();
28
+ return r.status === 204 ? void 0 : await r.json();
29
29
  }
30
30
  async isAlive() {
31
31
  try {
@@ -37,47 +37,47 @@ class re {
37
37
  listSkills() {
38
38
  return this.request("/api/skills");
39
39
  }
40
- toggleSkill(t, r) {
41
- return this.request(`/api/skills/${encodeURIComponent(t)}`, { method: "PATCH", body: JSON.stringify({ enabled: r }) });
40
+ toggleSkill(o, n) {
41
+ return this.request(`/api/skills/${encodeURIComponent(o)}`, { method: "PATCH", body: JSON.stringify({ enabled: n }) });
42
42
  }
43
- uploadSkill(t, r) {
44
- return this.request("/api/skills", { method: "POST", body: JSON.stringify({ filename: t, content: r }) });
43
+ uploadSkill(o, n) {
44
+ return this.request("/api/skills", { method: "POST", body: JSON.stringify({ filename: o, content: n }) });
45
45
  }
46
- removeSkill(t) {
47
- return this.request(`/api/skills/${encodeURIComponent(t)}`, { method: "DELETE" });
46
+ removeSkill(o) {
47
+ return this.request(`/api/skills/${encodeURIComponent(o)}`, { method: "DELETE" });
48
48
  }
49
49
  tokenStatus() {
50
50
  return this.request("/api/settings/figma-token");
51
51
  }
52
- saveToken(t) {
53
- return this.request("/api/settings/figma-token", { method: "PUT", body: JSON.stringify({ token: t }) });
52
+ saveToken(o) {
53
+ return this.request("/api/settings/figma-token", { method: "PUT", body: JSON.stringify({ token: o }) });
54
54
  }
55
55
  deleteToken() {
56
56
  return this.request("/api/settings/figma-token", { method: "DELETE" });
57
57
  }
58
- startPublish(t) {
59
- return this.request("/api/publish", { method: "POST", body: JSON.stringify(t) });
58
+ startPublish(o) {
59
+ return this.request("/api/publish", { method: "POST", body: JSON.stringify(o) });
60
60
  }
61
- cancelPublish(t) {
62
- return this.request(`/api/publish/${t}`, { method: "DELETE" });
61
+ cancelPublish(o) {
62
+ return this.request(`/api/publish/${o}`, { method: "DELETE" });
63
63
  }
64
64
  /** SSE 구독 — 반환값 호출로 해제 */
65
- subscribePublish(t, r) {
66
- const o = new EventSource(`${this.baseUrl}/api/publish/${t}/events`);
65
+ subscribePublish(o, n) {
66
+ const r = new EventSource(`${this.baseUrl}/api/publish/${o}/events`);
67
67
  let l = !1;
68
- return o.onmessage = (a) => {
69
- const i = JSON.parse(a.data);
70
- (i.type === "done" || i.type === "error") && (l = !0), r(i);
71
- }, o.onerror = () => {
72
- o.close(), l || (l = !0, r({ type: "error", text: "서버 연결이 끊겼어요. pubuilder serve 상태를 확인해주세요" }));
73
- }, () => o.close();
68
+ return r.onmessage = (s) => {
69
+ const c = JSON.parse(s.data);
70
+ (c.type === "done" || c.type === "error") && (l = !0), n(c);
71
+ }, r.onerror = () => {
72
+ r.close(), l || (l = !0, n({ type: "error", text: "서버 연결이 끊겼어요. pubuilder serve 상태를 확인해주세요" }));
73
+ }, () => r.close();
74
74
  }
75
75
  }
76
- const Y = ae(new re());
77
- function fe() {
76
+ const Z = se(new ae());
77
+ function xe() {
78
78
  return typeof process < "u" && process.env.NODE_ENV === "production";
79
79
  }
80
- const y = ue((e) => ({
80
+ const k = fe((t) => ({
81
81
  isMapOpen: !1,
82
82
  viewerPath: null,
83
83
  granularity: "section",
@@ -85,15 +85,15 @@ const y = ue((e) => ({
85
85
  selection: null,
86
86
  selectedOuterHTML: null,
87
87
  skillDrawerOpen: !1,
88
- openMap: () => e({ isMapOpen: !0 }),
89
- closeMap: () => e({ isMapOpen: !1, viewerPath: null, selection: null, selectedOuterHTML: null }),
90
- openViewer: (t) => e({ viewerPath: t, selection: null, selectedOuterHTML: null }),
91
- closeViewer: () => e({ viewerPath: null, selection: null, selectedOuterHTML: null }),
92
- setGranularity: (t) => e({ granularity: t }),
93
- setInspectEnabled: (t) => e({ inspectEnabled: t }),
94
- setSelectionWithHTML: (t, r) => e({ selection: t, selectedOuterHTML: r }),
95
- toggleSkillDrawer: () => e((t) => ({ skillDrawerOpen: !t.skillDrawerOpen }))
96
- })), ge = ".react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}", he = "pubuilder-styles", me = "pubuilder-xyflow-styles", xe = (
88
+ openMap: () => t({ isMapOpen: !0 }),
89
+ closeMap: () => t({ isMapOpen: !1, viewerPath: null, selection: null, selectedOuterHTML: null }),
90
+ openViewer: (o) => t({ viewerPath: o, selection: null, selectedOuterHTML: null }),
91
+ closeViewer: () => t({ viewerPath: null, selection: null, selectedOuterHTML: null }),
92
+ setGranularity: (o) => t({ granularity: o }),
93
+ setInspectEnabled: (o) => t({ inspectEnabled: o }),
94
+ setSelectionWithHTML: (o, n) => t({ selection: o, selectedOuterHTML: n }),
95
+ toggleSkillDrawer: () => t((o) => ({ skillDrawerOpen: !o.skillDrawerOpen }))
96
+ })), me = ".react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}", we = "pubuilder-styles", ye = "pubuilder-xyflow-styles", ve = (
97
97
  /* css */
98
98
  `
99
99
  .pbu-fab {
@@ -341,7 +341,14 @@ const y = ue((e) => ({
341
341
  flex-direction: column;
342
342
  gap: 8px;
343
343
  }
344
- .pbu-publish > label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #8c8c8c; }
344
+ .pbu-publish-heading {
345
+ display: flex;
346
+ align-items: center;
347
+ justify-content: space-between;
348
+ gap: 8px;
349
+ }
350
+ .pbu-publish-heading > label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #8c8c8c; }
351
+ .pbu-skill-entry { white-space: nowrap; }
345
352
  .pbu-publish input {
346
353
  background: #1e1e1e;
347
354
  border: 1px solid #3c3c3c;
@@ -368,6 +375,43 @@ const y = ue((e) => ({
368
375
  .pbu-log-tool { color: #8c8c8c; }
369
376
  .pbu-log-error { color: #f2b3b3; }
370
377
  .pbu-log-done { color: #89d185; font-weight: 600; }
378
+ .pbu-publish-reply {
379
+ padding-top: 8px;
380
+ border-top: 1px solid #3c3c3c;
381
+ display: flex;
382
+ flex-direction: column;
383
+ gap: 6px;
384
+ }
385
+ .pbu-publish-reply > label {
386
+ color: #cccccc;
387
+ font-size: 11px;
388
+ font-weight: 600;
389
+ }
390
+ .pbu-publish-reply textarea {
391
+ width: 100%;
392
+ min-height: 62px;
393
+ resize: vertical;
394
+ box-sizing: border-box;
395
+ background: #1e1e1e;
396
+ border: 1px solid #4b4b4b;
397
+ border-radius: 2px;
398
+ color: #e6e6e6;
399
+ font: 11px/1.5 ui-monospace, Menlo, monospace;
400
+ padding: 7px 8px;
401
+ outline: none;
402
+ }
403
+ .pbu-publish-reply textarea:focus {
404
+ border-color: #3794ff;
405
+ box-shadow: 0 0 0 1px #3794ff;
406
+ }
407
+ .pbu-publish-reply textarea::placeholder { color: #6f6f6f; }
408
+ .pbu-publish-reply-actions {
409
+ display: flex;
410
+ align-items: center;
411
+ justify-content: space-between;
412
+ gap: 8px;
413
+ }
414
+ .pbu-publish-reply-actions > span { color: #777; font-size: 9px; }
371
415
 
372
416
  .pbu-drawer {
373
417
  position: fixed;
@@ -394,6 +438,50 @@ const y = ue((e) => ({
394
438
  padding-bottom: 8px;
395
439
  border-bottom: 1px solid #3c3c3c;
396
440
  }
441
+ .pbu-drawer-header > div { display: flex; flex-direction: column; gap: 2px; }
442
+ .pbu-drawer-kicker { color: #858585; font-size: 9px; letter-spacing: 0.04em; }
443
+ .pbu-drawer-guide {
444
+ background: #1e1e1e;
445
+ border: 1px solid #3c3c3c;
446
+ border-left: 2px solid #3794ff;
447
+ padding: 10px;
448
+ display: flex;
449
+ flex-direction: column;
450
+ gap: 5px;
451
+ line-height: 1.45;
452
+ }
453
+ .pbu-drawer-guide strong { color: #e5e5e5; font-size: 11px; }
454
+ .pbu-drawer-guide > span { color: #9d9d9d; font-size: 10px; }
455
+ .pbu-guide-status { color: #cccccc; font-size: 10px; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
456
+ .pbu-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #777; }
457
+ .pbu-status-dot-on { background: #73c991; box-shadow: 0 0 0 2px rgba(115, 201, 145, 0.12); }
458
+ .pbu-drawer-section-head {
459
+ margin-top: 4px;
460
+ padding-bottom: 7px;
461
+ border-bottom: 1px solid #3c3c3c;
462
+ display: flex;
463
+ align-items: flex-start;
464
+ justify-content: space-between;
465
+ gap: 8px;
466
+ }
467
+ .pbu-drawer-section-head > div { display: flex; flex-direction: column; gap: 2px; }
468
+ .pbu-drawer-section-head strong { color: #e5e5e5; font-size: 11px; }
469
+ .pbu-drawer-section-head div > span { color: #858585; font-size: 9px; line-height: 1.4; }
470
+ .pbu-drawer-section-head-skills { margin-top: 10px; }
471
+ .pbu-status-badge, .pbu-skill-state {
472
+ flex: none;
473
+ border: 1px solid #4a4a4a;
474
+ border-radius: 999px;
475
+ padding: 1px 6px;
476
+ color: #8c8c8c;
477
+ font-size: 9px;
478
+ line-height: 1.5;
479
+ }
480
+ .pbu-status-on, .pbu-skill-state-on { border-color: #3e7651; background: #23362a; color: #89d185; }
481
+ .pbu-status-off { border-color: #765f3e; background: #382f22; color: #cca96a; }
482
+ .pbu-skill-source { margin: 8px 0 4px; display: flex; flex-direction: column; gap: 1px; }
483
+ .pbu-skill-source strong { color: #cccccc; font-size: 10px; }
484
+ .pbu-skill-source span { color: #777; font-size: 9px; line-height: 1.35; }
397
485
  .pbu-drawer-group {
398
486
  display: flex;
399
487
  align-items: center;
@@ -458,119 +546,118 @@ const y = ue((e) => ({
458
546
  }
459
547
  `
460
548
  );
461
- function X(e, t) {
462
- if (document.getElementById(e)) return;
463
- const r = document.createElement("style");
464
- r.id = e, r.textContent = t, document.head.appendChild(r);
465
- }
466
- function we() {
467
- typeof document > "u" || (X(me, ge), X(he, xe));
468
- }
469
- function ye(e, t, r, o = 140, l = 48) {
470
- const a = /* @__PURE__ */ new Map();
471
- for (const u of e) {
472
- const w = a.get(u.parentId) ?? [];
473
- w.push(u), a.set(u.parentId, w);
549
+ function ee(t, o) {
550
+ if (document.getElementById(t)) return;
551
+ const n = document.createElement("style");
552
+ n.id = t, n.textContent = o, document.head.appendChild(n);
553
+ }
554
+ function ke() {
555
+ typeof document > "u" || (ee(ye, me), ee(we, ve));
556
+ }
557
+ function _e(t, o, n, r = 140, l = 48) {
558
+ const s = /* @__PURE__ */ new Map();
559
+ for (const g of t) {
560
+ const p = s.get(g.parentId) ?? [];
561
+ p.push(g), s.set(g.parentId, p);
474
562
  }
475
- const i = /* @__PURE__ */ new Map();
476
- let c = 0;
477
- const h = (u) => {
478
- const w = a.get(u.id) ?? [], f = u.depth * (t + o);
479
- let v;
480
- if (w.length === 0)
481
- v = c, c += r + l;
563
+ const c = /* @__PURE__ */ new Map();
564
+ let i = 0;
565
+ const f = (g) => {
566
+ const p = s.get(g.id) ?? [], m = g.depth * (o + r);
567
+ let _;
568
+ if (p.length === 0)
569
+ _ = i, i += n + l;
482
570
  else {
483
- const N = w.map(h);
484
- v = (Math.min(...N) + Math.max(...N)) / 2;
571
+ const d = p.map(f);
572
+ _ = (Math.min(...d) + Math.max(...d)) / 2;
485
573
  }
486
- return i.set(u.id, { x: f, y: v }), v;
574
+ return c.set(g.id, { x: m, y: _ }), _;
487
575
  };
488
- for (const u of a.get(null) ?? []) h(u);
489
- return e.map((u) => ({ ...u, ...i.get(u.id) }));
490
- }
491
- const ve = ce(function(t) {
492
- const { page: r, viewport: o, thumbWidth: l, bodyHeight: a } = t.data, i = y((v) => v.openViewer), c = D(null), [h, u] = _(!1);
493
- R(() => {
494
- const v = c.current;
495
- if (!v || r.external) return;
496
- const N = new IntersectionObserver(([g]) => {
497
- g.isIntersecting && (u(!0), N.disconnect());
576
+ for (const g of s.get(null) ?? []) f(g);
577
+ return t.map((g) => ({ ...g, ...c.get(g.id) }));
578
+ }
579
+ const Ne = de(function(o) {
580
+ const { page: n, viewport: r, thumbWidth: l, bodyHeight: s } = o.data, c = k((_) => _.openViewer), i = H(null), [f, g] = v(!1);
581
+ A(() => {
582
+ const _ = i.current;
583
+ if (!_ || n.external) return;
584
+ const d = new IntersectionObserver(([C]) => {
585
+ C.isIntersecting && (g(!0), d.disconnect());
498
586
  });
499
- return N.observe(v), () => N.disconnect();
500
- }, [r.external]);
501
- const w = l / o.width;
502
- return /* @__PURE__ */ d("div", { ref: c, className: "pbu-node", style: { width: l }, onClick: () => {
503
- r.external ? window.open(r.path, "_blank", "noopener") : i(r.path);
587
+ return d.observe(_), () => d.disconnect();
588
+ }, [n.external]);
589
+ const p = l / r.width;
590
+ return /* @__PURE__ */ a("div", { ref: i, className: "pbu-node", style: { width: l }, onClick: () => {
591
+ n.external ? window.open(n.path, "_blank", "noopener") : c(n.path);
504
592
  }, children: [
505
- /* @__PURE__ */ n(J, { type: "target", position: j.Left, className: "pbu-handle", isConnectable: !1 }),
506
- /* @__PURE__ */ d("div", { className: "pbu-node-header", children: [
507
- /* @__PURE__ */ n("span", { className: "pbu-node-title", children: r.title }),
508
- /* @__PURE__ */ n("span", { className: "pbu-node-path", children: r.external ? "외부 ↗" : r.path })
593
+ /* @__PURE__ */ e(Q, { type: "target", position: V.Left, className: "pbu-handle", isConnectable: !1 }),
594
+ /* @__PURE__ */ a("div", { className: "pbu-node-header", children: [
595
+ /* @__PURE__ */ e("span", { className: "pbu-node-title", children: n.title }),
596
+ /* @__PURE__ */ e("span", { className: "pbu-node-path", children: n.external ? "외부 ↗" : n.path })
509
597
  ] }),
510
- /* @__PURE__ */ d("div", { className: "pbu-node-body", style: { height: a }, children: [
511
- r.external ? /* @__PURE__ */ n("div", { className: "pbu-node-placeholder", children: "↗ 외부 링크" }) : h ? /* @__PURE__ */ n(
598
+ /* @__PURE__ */ a("div", { className: "pbu-node-body", style: { height: s }, children: [
599
+ n.external ? /* @__PURE__ */ e("div", { className: "pbu-node-placeholder", children: "↗ 외부 링크" }) : f ? /* @__PURE__ */ e(
512
600
  "iframe",
513
601
  {
514
602
  className: "pbu-node-iframe",
515
- src: r.path,
516
- title: `${r.title} 미리보기`,
603
+ src: n.path,
604
+ title: `${n.title} 미리보기`,
517
605
  loading: "lazy",
518
606
  tabIndex: -1,
519
607
  style: {
520
- width: o.width,
521
- height: o.height,
522
- transform: `scale(${w})`
608
+ width: r.width,
609
+ height: r.height,
610
+ transform: `scale(${p})`
523
611
  }
524
612
  }
525
- ) : /* @__PURE__ */ n("div", { className: "pbu-node-placeholder", children: "…" }),
526
- /* @__PURE__ */ n("div", { className: "pbu-node-shield" })
613
+ ) : /* @__PURE__ */ e("div", { className: "pbu-node-placeholder", children: "…" }),
614
+ /* @__PURE__ */ e("div", { className: "pbu-node-shield" })
527
615
  ] }),
528
- /* @__PURE__ */ n(J, { type: "source", position: j.Right, className: "pbu-handle", isConnectable: !1 })
616
+ /* @__PURE__ */ e(Q, { type: "source", position: V.Right, className: "pbu-handle", isConnectable: !1 })
529
617
  ] });
530
- }), ke = { page: ve }, G = 260, _e = 30;
531
- function Ne({ ia: e }) {
532
- const t = y((a) => a.closeMap), r = y((a) => a.toggleSkillDrawer), { nodes: o, edges: l } = V(() => {
533
- const a = G / e.viewport.width, i = Math.round(e.viewport.height * a), c = i + _e, h = ye(e.nodes, G, c), u = h.map((f) => ({
534
- id: f.id,
618
+ }), ze = { page: Ne }, Y = 260, Ce = 30;
619
+ function Ee({ ia: t }) {
620
+ const o = k((l) => l.closeMap), { nodes: n, edges: r } = K(() => {
621
+ const l = Y / t.viewport.width, s = Math.round(t.viewport.height * l), c = s + Ce, i = _e(t.nodes, Y, c), f = i.map((p) => ({
622
+ id: p.id,
535
623
  type: "page",
536
- position: { x: f.x, y: f.y },
624
+ position: { x: p.x, y: p.y },
537
625
  data: {
538
- page: f,
539
- viewport: e.viewport,
540
- thumbWidth: G,
541
- bodyHeight: i
626
+ page: p,
627
+ viewport: t.viewport,
628
+ thumbWidth: Y,
629
+ bodyHeight: s
542
630
  },
543
- sourcePosition: j.Right,
544
- targetPosition: j.Left
545
- })), w = h.filter((f) => f.parentId).map((f) => ({
546
- id: `${f.parentId}->${f.id}`,
547
- source: f.parentId,
548
- target: f.id,
631
+ sourcePosition: V.Right,
632
+ targetPosition: V.Left
633
+ })), g = i.filter((p) => p.parentId).map((p) => ({
634
+ id: `${p.parentId}->${p.id}`,
635
+ source: p.parentId,
636
+ target: p.id,
549
637
  type: "smoothstep"
550
638
  }));
551
- return { nodes: u, edges: w };
552
- }, [e]);
553
- return R(() => {
554
- const a = (i) => {
555
- if (i.key !== "Escape") return;
556
- const c = y.getState();
557
- c.viewerPath || c.skillDrawerOpen || t();
639
+ return { nodes: f, edges: g };
640
+ }, [t]);
641
+ return A(() => {
642
+ const l = (s) => {
643
+ if (s.key !== "Escape") return;
644
+ const c = k.getState();
645
+ c.viewerPath || c.skillDrawerOpen || o();
558
646
  };
559
- return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
560
- }, [t]), /* @__PURE__ */ d("div", { className: "pbu-overlay", children: [
561
- /* @__PURE__ */ d("div", { className: "pbu-bar", children: [
562
- /* @__PURE__ */ n("span", { className: "pbu-logo", children: "pubuilder" }),
563
- /* @__PURE__ */ n("span", { className: "pbu-hint", children: "노드 클릭 → 페이지 확대 · 스크롤 줌 · 드래그 팬 · Esc 닫기" }),
564
- /* @__PURE__ */ n("span", { className: "pbu-spacer" }),
565
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: r, children: "🧰 스킬함" }),
566
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: t, "aria-label": "닫기", children: "✕" })
647
+ return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
648
+ }, [o]), /* @__PURE__ */ a("div", { className: "pbu-overlay", children: [
649
+ /* @__PURE__ */ a("div", { className: "pbu-bar", children: [
650
+ /* @__PURE__ */ e("span", { className: "pbu-logo", children: "pubuilder" }),
651
+ /* @__PURE__ */ e("span", { className: "pbu-hint", children: "노드 클릭 → 페이지 확대 · 스크롤 줌 · 드래그 팬 · Esc 닫기" }),
652
+ /* @__PURE__ */ e("span", { className: "pbu-spacer" }),
653
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-icon-btn", onClick: o, "aria-label": "닫기", children: "✕" })
567
654
  ] }),
568
- /* @__PURE__ */ n("div", { className: "pbu-canvas", children: /* @__PURE__ */ n(
569
- pe,
655
+ /* @__PURE__ */ e("div", { className: "pbu-canvas", children: /* @__PURE__ */ e(
656
+ he,
570
657
  {
571
- nodes: o,
572
- edges: l,
573
- nodeTypes: ke,
658
+ nodes: n,
659
+ edges: r,
660
+ nodeTypes: ze,
574
661
  fitView: !0,
575
662
  fitViewOptions: { padding: 0.15, maxZoom: 1 },
576
663
  minZoom: 0.05,
@@ -582,25 +669,25 @@ function Ne({ ia: e }) {
582
669
  ) })
583
670
  ] });
584
671
  }
585
- function ze() {
586
- const e = y((o) => o.isMapOpen), t = y((o) => o.openMap), r = y((o) => o.closeMap);
587
- return /* @__PURE__ */ n(
672
+ function Se() {
673
+ const t = k((r) => r.isMapOpen), o = k((r) => r.openMap), n = k((r) => r.closeMap);
674
+ return /* @__PURE__ */ e(
588
675
  "button",
589
676
  {
590
677
  type: "button",
591
678
  className: "pbu-fab",
592
679
  title: "Page Map (pubuilder)",
593
680
  "aria-label": "페이지 맵 열기",
594
- onClick: () => e ? r() : t(),
595
- children: /* @__PURE__ */ d("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
596
- /* @__PURE__ */ n("polygon", { points: "3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21" }),
597
- /* @__PURE__ */ n("line", { x1: "9", y1: "3", x2: "9", y2: "18" }),
598
- /* @__PURE__ */ n("line", { x1: "15", y1: "6", x2: "15", y2: "21" })
681
+ onClick: () => t ? n() : o(),
682
+ children: /* @__PURE__ */ a("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
683
+ /* @__PURE__ */ e("polygon", { points: "3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21" }),
684
+ /* @__PURE__ */ e("line", { x1: "9", y1: "3", x2: "9", y2: "18" }),
685
+ /* @__PURE__ */ e("line", { x1: "15", y1: "6", x2: "15", y2: "21" })
599
686
  ] })
600
687
  }
601
688
  );
602
689
  }
603
- const Ce = /* @__PURE__ */ new Set([
690
+ const Te = /* @__PURE__ */ new Set([
604
691
  "section",
605
692
  "header",
606
693
  "footer",
@@ -609,7 +696,7 @@ const Ce = /* @__PURE__ */ new Set([
609
696
  "article",
610
697
  "aside",
611
698
  "form"
612
- ]), Ee = /* @__PURE__ */ new Set([
699
+ ]), Me = /* @__PURE__ */ new Set([
613
700
  "a",
614
701
  "button",
615
702
  "input",
@@ -629,640 +716,724 @@ const Ce = /* @__PURE__ */ new Set([
629
716
  "p",
630
717
  "label"
631
718
  ]);
632
- function ne(e, t) {
633
- const r = [];
634
- let o = e;
635
- for (; o && o !== t.body && o !== t.documentElement; )
636
- r.push(o), o = o.parentElement;
637
- return r;
638
- }
639
- function Se(e, t) {
640
- const r = ne(e, t);
641
- if (r.length === 0) return null;
642
- const o = r.find((i) => {
643
- const c = i.tagName.toLowerCase();
644
- return Ce.has(c) && c !== "main";
719
+ function ce(t, o) {
720
+ const n = [];
721
+ let r = t;
722
+ for (; r && r !== o.body && r !== o.documentElement; )
723
+ n.push(r), r = r.parentElement;
724
+ return n;
725
+ }
726
+ function Le(t, o) {
727
+ const n = ce(t, o);
728
+ if (n.length === 0) return null;
729
+ const r = n.find((c) => {
730
+ const i = c.tagName.toLowerCase();
731
+ return Te.has(i) && i !== "main";
645
732
  });
646
- if (o) return o;
647
- const l = r.find((i) => i.tagName.toLowerCase() === "main");
733
+ if (r) return r;
734
+ const l = n.find((c) => c.tagName.toLowerCase() === "main");
648
735
  if (l) return l;
649
- const a = t.body.scrollHeight || 1;
650
- for (let i = r.length - 1; i >= 0; i--) {
651
- const c = r[i].getBoundingClientRect();
652
- if (c.height > 0 && c.height < a * 0.8) return r[i];
736
+ const s = o.body.scrollHeight || 1;
737
+ for (let c = n.length - 1; c >= 0; c--) {
738
+ const i = n[c].getBoundingClientRect();
739
+ if (i.height > 0 && i.height < s * 0.8) return n[c];
653
740
  }
654
- return r[r.length - 1];
655
- }
656
- function Te(e, t) {
657
- const r = ne(e, t);
658
- for (const o of r) {
659
- if (Ee.has(o.tagName.toLowerCase())) return o;
660
- const l = o.getBoundingClientRect(), a = o.children.length > 0 || (o.textContent ?? "").trim().length > 0;
661
- if (l.width >= 40 && l.height >= 24 && a) return o;
741
+ return n[n.length - 1];
742
+ }
743
+ function Pe(t, o) {
744
+ const n = ce(t, o);
745
+ for (const r of n) {
746
+ if (Me.has(r.tagName.toLowerCase())) return r;
747
+ const l = r.getBoundingClientRect(), s = r.children.length > 0 || (r.textContent ?? "").trim().length > 0;
748
+ if (l.width >= 40 && l.height >= 24 && s) return r;
662
749
  }
663
- return r[0] ?? null;
664
- }
665
- function Le(e, t, r) {
666
- return r === "all" ? t.body : r === "section" ? Se(e, t) : Te(e, t);
667
- }
668
- function Me(e) {
669
- const r = e.querySelector("h1, h2, h3, h4, h5, h6")?.textContent?.trim();
670
- if (r) return B(r);
671
- const o = e.getAttribute("aria-label");
672
- if (o) return B(o);
673
- const l = e.getAttribute("alt");
674
- if (l) return B(l);
675
- const a = (e.textContent ?? "").trim().replace(/\s+/g, " ");
676
- return a ? B(a) : `<${e.tagName.toLowerCase()}>`;
677
- }
678
- function B(e, t = 30) {
679
- return e.length > t ? `${e.slice(0, t)}…` : e;
680
- }
681
- function Pe(e, t) {
682
- if (e.id) return `#${CSS.escape(e.id)}`;
683
- const r = [];
684
- let o = e;
685
- for (; o && o !== t.body && r.length < 8; ) {
686
- if (o.id)
687
- return r.unshift(`#${CSS.escape(o.id)}`), r.join(" > ");
688
- const l = o.tagName.toLowerCase(), a = o.parentElement;
689
- let i = l;
690
- if (a) {
691
- const c = Array.from(a.children).filter(
692
- (h) => h.tagName === o.tagName
750
+ return n[0] ?? null;
751
+ }
752
+ function Oe(t, o, n) {
753
+ return n === "all" ? o.body : n === "section" ? Le(t, o) : Pe(t, o);
754
+ }
755
+ function Ie(t) {
756
+ const n = t.querySelector("h1, h2, h3, h4, h5, h6")?.textContent?.trim();
757
+ if (n) return q(n);
758
+ const r = t.getAttribute("aria-label");
759
+ if (r) return q(r);
760
+ const l = t.getAttribute("alt");
761
+ if (l) return q(l);
762
+ const s = (t.textContent ?? "").trim().replace(/\s+/g, " ");
763
+ return s ? q(s) : `<${t.tagName.toLowerCase()}>`;
764
+ }
765
+ function q(t, o = 30) {
766
+ return t.length > o ? `${t.slice(0, o)}…` : t;
767
+ }
768
+ function Re(t, o) {
769
+ if (t.id) return `#${CSS.escape(t.id)}`;
770
+ const n = [];
771
+ let r = t;
772
+ for (; r && r !== o.body && n.length < 8; ) {
773
+ if (r.id)
774
+ return n.unshift(`#${CSS.escape(r.id)}`), n.join(" > ");
775
+ const l = r.tagName.toLowerCase(), s = r.parentElement;
776
+ let c = l;
777
+ if (s) {
778
+ const i = Array.from(s.children).filter(
779
+ (f) => f.tagName === r.tagName
693
780
  );
694
- c.length > 1 && (i += `:nth-of-type(${c.indexOf(o) + 1})`);
781
+ i.length > 1 && (c += `:nth-of-type(${i.indexOf(r) + 1})`);
695
782
  }
696
- r.unshift(i), o = a;
783
+ n.unshift(c), r = s;
697
784
  }
698
- return r.join(" > ");
785
+ return n.join(" > ");
699
786
  }
700
- function K(e, t, r) {
701
- const o = e.createElement("div");
702
- o.setAttribute("data-pubuilder", "highlight"), Object.assign(o.style, {
787
+ function te(t, o, n) {
788
+ const r = t.createElement("div");
789
+ r.setAttribute("data-pubuilder", "highlight"), Object.assign(r.style, {
703
790
  position: "fixed",
704
791
  top: "0",
705
792
  left: "0",
706
793
  display: "none",
707
- border: `1px solid ${t}`,
708
- background: r,
794
+ border: `1px solid ${o}`,
795
+ background: n,
709
796
  borderRadius: "0",
710
797
  pointerEvents: "none",
711
798
  zIndex: "2147483647",
712
799
  boxSizing: "border-box"
713
800
  });
714
- const l = e.createElement("div");
801
+ const l = t.createElement("div");
715
802
  return Object.assign(l.style, {
716
803
  position: "absolute",
717
804
  left: "-1px",
718
805
  top: "-22px",
719
806
  padding: "2px 7px",
720
- background: t,
807
+ background: o,
721
808
  color: "#fff",
722
809
  font: "600 10px/16px system-ui, sans-serif",
723
810
  borderRadius: "0",
724
811
  whiteSpace: "nowrap",
725
812
  pointerEvents: "none"
726
- }), o.appendChild(l), { root: o, label: l };
813
+ }), r.appendChild(l), { root: r, label: l };
727
814
  }
728
- function Z(e, t, r, o) {
729
- const l = t.getBoundingClientRect(), a = o ?? -1 / 0, i = Math.max(l.top, a), c = l.bottom - i;
730
- if (c <= 2) {
731
- W(e);
815
+ function oe(t, o, n, r) {
816
+ const l = o.getBoundingClientRect(), s = r ?? -1 / 0, c = Math.max(l.top, s), i = l.bottom - c;
817
+ if (i <= 2) {
818
+ X(t);
732
819
  return;
733
820
  }
734
- e.root.style.display = "block", e.root.style.transform = `translate(${l.x}px, ${i}px)`, e.root.style.width = `${l.width}px`, e.root.style.height = `${c}px`, e.label.textContent = r, e.label.style.top = i < 30 || i - 24 < a ? "2px" : "-24px";
821
+ t.root.style.display = "block", t.root.style.transform = `translate(${l.x}px, ${c}px)`, t.root.style.width = `${l.width}px`, t.root.style.height = `${i}px`, t.label.textContent = n, t.label.style.top = c < 30 || c - 24 < s ? "2px" : "-24px";
735
822
  }
736
- function W(e) {
737
- e.root.style.display = "none";
823
+ function X(t) {
824
+ t.root.style.display = "none";
738
825
  }
739
- function Q(e) {
740
- const t = e.getBoundingClientRect();
741
- return `${e.tagName.toLowerCase()} · ${Math.round(t.width)}×${Math.round(t.height)}`;
826
+ function re(t) {
827
+ const o = t.getBoundingClientRect();
828
+ return `${t.tagName.toLowerCase()} · ${Math.round(o.width)}×${Math.round(o.height)}`;
742
829
  }
743
- function Oe(e, t) {
744
- let r = null;
830
+ function $e(t, o) {
831
+ let n = null;
745
832
  try {
746
- r = e.contentDocument;
833
+ n = t.contentDocument;
747
834
  } catch {
748
835
  return null;
749
836
  }
750
- const o = e.contentWindow;
751
- if (!r || !r.body || !o) return null;
752
- const l = r;
753
- let a = t.granularity, i = t.enabled, c = null, h = null;
754
- const u = K(l, "rgba(14,99,156,0.95)", "rgba(14,99,156,0.10)"), w = K(l, "rgba(35,134,54,0.95)", "rgba(35,134,54,0.07)");
755
- l.body.appendChild(u.root), l.body.appendChild(w.root);
756
- let f = [], v = 0;
757
- const N = () => {
758
- f = [];
759
- for (const p of Array.from(l.body.querySelectorAll("*"))) {
760
- if (p === u.root || p === w.root || u.root.contains(p) || w.root.contains(p)) continue;
761
- const k = o.getComputedStyle(p).position;
762
- if (k !== "fixed" && k !== "sticky") continue;
763
- const m = p.getBoundingClientRect();
764
- m.width === 0 || m.height === 0 || m.top <= 1 && m.height < o.innerHeight * 0.5 && f.push({ el: p, rect: m });
837
+ const r = t.contentWindow;
838
+ if (!n || !n.body || !r) return null;
839
+ const l = n;
840
+ let s = o.granularity, c = o.enabled, i = null, f = null;
841
+ const g = te(l, "rgba(14,99,156,0.95)", "rgba(14,99,156,0.10)"), p = te(l, "rgba(35,134,54,0.95)", "rgba(35,134,54,0.07)");
842
+ l.body.appendChild(g.root), l.body.appendChild(p.root);
843
+ let m = [], _ = 0;
844
+ const d = () => {
845
+ m = [];
846
+ for (const b of Array.from(l.body.querySelectorAll("*"))) {
847
+ if (b === g.root || b === p.root || g.root.contains(b) || p.root.contains(b)) continue;
848
+ const y = r.getComputedStyle(b).position;
849
+ if (y !== "fixed" && y !== "sticky") continue;
850
+ const w = b.getBoundingClientRect();
851
+ w.width === 0 || w.height === 0 || w.top <= 1 && w.height < r.innerHeight * 0.5 && m.push({ el: b, rect: w });
765
852
  }
766
- }, g = () => {
767
- const p = Date.now();
768
- p - v < 500 || (v = p, N());
769
- }, E = (p) => {
770
- const k = p.getBoundingClientRect();
771
- let m = null;
772
- for (const z of f)
773
- z.el === p || z.el.contains(p) || p.contains(z.el) || !(k.left < z.rect.right && k.right > z.rect.left) || (m === null || z.rect.bottom > m) && (m = z.rect.bottom);
774
- return m;
775
- }, S = () => {
776
- c && i && c.isConnected ? Z(u, c, Q(c), E(c)) : W(u), h && h.isConnected ? Z(w, h, `선택됨 · ${Q(h)}`, E(h)) : W(w);
777
- }, L = (p) => {
778
- if (a === "all") return l.body;
779
- if (h && h.isConnected && h.contains(p)) {
780
- if (h === p) return h;
781
- let k = p;
782
- for (; k.parentElement && k.parentElement !== h; )
783
- k = k.parentElement;
784
- return k;
853
+ }, C = () => {
854
+ const b = Date.now();
855
+ b - _ < 500 || (_ = b, d());
856
+ }, E = (b) => {
857
+ const y = b.getBoundingClientRect();
858
+ let w = null;
859
+ for (const S of m)
860
+ S.el === b || S.el.contains(b) || b.contains(S.el) || !(y.left < S.rect.right && y.right > S.rect.left) || (w === null || S.rect.bottom > w) && (w = S.rect.bottom);
861
+ return w;
862
+ }, P = () => {
863
+ i && c && i.isConnected ? oe(g, i, re(i), E(i)) : X(g), f && f.isConnected ? oe(p, f, `선택됨 · ${re(f)}`, E(f)) : X(p);
864
+ }, T = (b) => {
865
+ if (s === "all") return l.body;
866
+ if (f && f.isConnected && f.contains(b)) {
867
+ if (f === b) return f;
868
+ let y = b;
869
+ for (; y.parentElement && y.parentElement !== f; )
870
+ y = y.parentElement;
871
+ return y;
785
872
  }
786
- return Le(p, l, a);
787
- }, I = (p) => {
788
- if (!i) return;
789
- g();
790
- const k = p.target;
791
- if (!k || !l.body.contains(k)) return;
792
- const m = L(k);
793
- m !== c && (c = m, S());
794
- }, M = (p) => {
795
- if (!i) return;
796
- p.preventDefault(), p.stopPropagation(), N(), v = Date.now();
797
- const k = p.target;
798
- if (!k) return;
799
- const m = L(k);
800
- if (!m) return;
801
- h = m, S();
802
- const z = m.getBoundingClientRect();
803
- t.onSelect(
873
+ return Oe(b, l, s);
874
+ }, j = (b) => {
875
+ if (!c) return;
876
+ C();
877
+ const y = b.target;
878
+ if (!y || !l.body.contains(y)) return;
879
+ const w = T(y);
880
+ w !== i && (i = w, P());
881
+ }, O = (b) => {
882
+ if (!c) return;
883
+ b.preventDefault(), b.stopPropagation(), d(), _ = Date.now();
884
+ const y = b.target;
885
+ if (!y) return;
886
+ const w = T(y);
887
+ if (!w) return;
888
+ f = w, P();
889
+ const S = w.getBoundingClientRect();
890
+ o.onSelect(
804
891
  {
805
- pagePath: t.pagePath,
806
- selector: Pe(m, l),
807
- tag: m.tagName.toLowerCase(),
808
- label: Me(m),
892
+ pagePath: o.pagePath,
893
+ selector: Re(w, l),
894
+ tag: w.tagName.toLowerCase(),
895
+ label: Ie(w),
809
896
  rect: {
810
- x: z.x + o.scrollX,
811
- y: z.y + o.scrollY,
812
- width: z.width,
813
- height: z.height
897
+ x: S.x + r.scrollX,
898
+ y: S.y + r.scrollY,
899
+ width: S.width,
900
+ height: S.height
814
901
  },
815
- granularity: a
902
+ granularity: s
816
903
  },
817
- m
904
+ w
818
905
  );
819
- }, T = () => {
820
- c = null, S();
821
- }, O = () => S(), P = () => {
822
- N(), S();
906
+ }, M = () => {
907
+ i = null, P();
908
+ }, $ = () => P(), I = () => {
909
+ d(), P();
823
910
  };
824
- return N(), l.addEventListener("mousemove", I, !0), l.addEventListener("click", M, !0), l.documentElement.addEventListener("mouseleave", T), o.addEventListener("scroll", O, !0), o.addEventListener("resize", P), {
911
+ return d(), l.addEventListener("mousemove", j, !0), l.addEventListener("click", O, !0), l.documentElement.addEventListener("mouseleave", M), r.addEventListener("scroll", $, !0), r.addEventListener("resize", I), {
825
912
  destroy() {
826
913
  try {
827
- l.removeEventListener("mousemove", I, !0), l.removeEventListener("click", M, !0), l.documentElement.removeEventListener("mouseleave", T), o.removeEventListener("scroll", O, !0), o.removeEventListener("resize", P), u.root.remove(), w.root.remove();
914
+ l.removeEventListener("mousemove", j, !0), l.removeEventListener("click", O, !0), l.documentElement.removeEventListener("mouseleave", M), r.removeEventListener("scroll", $, !0), r.removeEventListener("resize", I), g.root.remove(), p.root.remove();
828
915
  } catch {
829
916
  }
830
917
  },
831
- setGranularity(p) {
832
- a = p, c = null, S();
918
+ setGranularity(b) {
919
+ s = b, i = null, P();
833
920
  },
834
- setEnabled(p) {
835
- i = p, p || (c = null), S();
921
+ setEnabled(b) {
922
+ c = b, b || (i = null), P();
836
923
  }
837
924
  };
838
925
  }
839
- const Re = {
926
+ const De = {
840
927
  log: "💬",
841
928
  tool: "🔧",
842
929
  error: "⛔",
843
930
  done: "✅"
844
931
  };
845
- function Ie() {
846
- const e = te(Y), t = y((s) => s.selection), r = y((s) => s.selectedOuterHTML), o = y((s) => s.toggleSkillDrawer), [l, a] = _(""), [i, c] = _("idle"), [h, u] = _(null), [w, f] = _([]), [v, N] = _(!1), [g, E] = _(!1), [S, L] = _(null), [I, M] = _(null), [T, O] = _(!1), [P, p] = _(!1), k = D(null), m = D(null), z = D(0);
847
- R(() => {
848
- z.current++, m.current?.(), m.current = null, c("idle"), u(null), f([]), N(!1), E(!1), O(!1), L(null), M(null), a("");
849
- }, [t?.selector]), R(() => {
850
- const s = k.current;
851
- s && (s.scrollTop = s.scrollHeight);
852
- }, [w]), R(() => () => {
853
- z.current++, m.current?.(), m.current = null;
932
+ function Ae() {
933
+ const t = le(Z), o = k((u) => u.selection), n = k((u) => u.selectedOuterHTML), r = k((u) => u.toggleSkillDrawer), [l, s] = v(""), [c, i] = v("idle"), [f, g] = v(null), [p, m] = v([]), [_, d] = v(!1), [C, E] = v(!1), [P, T] = v(null), [j, O] = v(null), [M, $] = v(!1), [I, b] = v(!1), [y, w] = v(""), S = H(null), R = H(null), D = H(0);
934
+ A(() => {
935
+ D.current++, R.current?.(), R.current = null, i("idle"), g(null), m([]), d(!1), E(!1), $(!1), T(null), O(null), s(""), w("");
936
+ }, [o?.selector]), A(() => {
937
+ const u = S.current;
938
+ u && (u.scrollTop = u.scrollHeight);
939
+ }, [p]), A(() => () => {
940
+ D.current++, R.current?.(), R.current = null;
854
941
  }, []);
855
- const A = (s) => {
856
- m.current = e.subscribePublish(s, (C) => {
857
- f(($) => [...$, C]), C.type === "done" ? (c("done"), u(null), O(!1), m.current?.(), m.current = null) : C.type === "error" && (c("error"), L(C.text), u(null), O(!1), m.current?.(), m.current = null);
942
+ const F = (u) => {
943
+ R.current = t.subscribePublish(u, (z) => {
944
+ m((L) => [...L, z]), z.type === "done" ? (i("done"), g(null), $(!1), R.current?.(), R.current = null) : z.type === "error" && (i("error"), T(z.text), g(null), $(!1), R.current?.(), R.current = null);
858
945
  });
859
- }, F = async () => {
860
- if (!t || i === "running" || g) return;
861
- const s = z.current;
862
- N(!1), L(null), M(null), E(!0);
946
+ }, W = async () => {
947
+ if (!o || c === "running" || C) return;
948
+ const u = D.current;
949
+ d(!1), T(null), O(null), E(!0);
863
950
  try {
864
- const C = await e.isAlive();
865
- if (s !== z.current) return;
866
- if (!C) {
867
- N(!0);
951
+ const z = await t.isAlive();
952
+ if (u !== D.current) return;
953
+ if (!z) {
954
+ d(!0);
868
955
  return;
869
956
  }
870
- const { jobId: $ } = await e.startPublish({
871
- selection: t,
872
- outerHTML: r ?? "",
957
+ const { jobId: L } = await t.startPublish({
958
+ selection: o,
959
+ outerHTML: n ?? "",
873
960
  figmaUrl: l
874
961
  });
875
- if (s !== z.current) {
876
- e.cancelPublish($).catch(() => {
962
+ if (u !== D.current) {
963
+ t.cancelPublish(L).catch(() => {
877
964
  });
878
965
  return;
879
966
  }
880
- u($), f([]), c("running"), A($);
881
- } catch (C) {
882
- if (s !== z.current) return;
883
- c("error"), L(C instanceof Error ? C.message : String(C)), M(C instanceof oe ? C.code ?? null : null);
967
+ g(L), m([]), i("running"), F(L);
968
+ } catch (z) {
969
+ if (u !== D.current) return;
970
+ i("error"), T(z instanceof Error ? z.message : String(z)), O(z instanceof J ? z.code ?? null : null);
884
971
  } finally {
885
972
  E(!1);
886
973
  }
887
974
  }, U = async () => {
888
- if (!(!h || T)) {
889
- O(!0);
975
+ if (!(!f || M)) {
976
+ $(!0);
890
977
  try {
891
- await e.cancelPublish(h);
892
- } catch (s) {
893
- L(s instanceof Error ? s.message : String(s)), O(!1);
978
+ await t.cancelPublish(f);
979
+ } catch (u) {
980
+ T(u instanceof Error ? u.message : String(u)), $(!1);
981
+ }
982
+ }
983
+ }, G = async () => {
984
+ const u = y.trim();
985
+ if (!o || !u || C || N) return;
986
+ const z = D.current;
987
+ E(!0), T(null);
988
+ try {
989
+ const { jobId: L } = await t.startPublish({
990
+ selection: o,
991
+ outerHTML: n ?? "",
992
+ figmaUrl: l,
993
+ instruction: u
994
+ });
995
+ if (z !== D.current) {
996
+ t.cancelPublish(L).catch(() => {
997
+ });
998
+ return;
894
999
  }
1000
+ m((ie) => [...ie, { type: "log", text: `내 답변: ${u}` }]), w(""), g(L), i("running"), F(L);
1001
+ } catch (L) {
1002
+ if (z !== D.current) return;
1003
+ i("error"), T(L instanceof Error ? L.message : String(L)), O(L instanceof J ? L.code ?? null : null);
1004
+ } finally {
1005
+ E(!1);
895
1006
  }
896
- }, q = async () => {
897
- await navigator.clipboard.writeText("npx pubuilder serve"), p(!0), setTimeout(() => p(!1), 1200);
898
- }, H = async () => {
1007
+ }, h = async () => {
1008
+ await navigator.clipboard.writeText("npx pubuilder serve"), b(!0), setTimeout(() => b(!1), 1200);
1009
+ }, x = async () => {
899
1010
  E(!0);
900
1011
  try {
901
- const s = await e.isAlive();
902
- N(!s);
1012
+ const u = await t.isAlive();
1013
+ d(!u);
903
1014
  } finally {
904
1015
  E(!1);
905
1016
  }
906
- }, b = i === "running";
907
- return /* @__PURE__ */ d("div", { className: "pbu-publish", children: [
908
- /* @__PURE__ */ n("label", { children: "Figma 노드 링크" }),
909
- /* @__PURE__ */ n(
1017
+ }, N = c === "running";
1018
+ return /* @__PURE__ */ a("div", { className: "pbu-publish", children: [
1019
+ /* @__PURE__ */ a("div", { className: "pbu-publish-heading", children: [
1020
+ /* @__PURE__ */ e("label", { htmlFor: "pbu-figma-url", children: "Figma 노드 링크" }),
1021
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-btn pbu-skill-entry", onClick: r, children: "🧰 스킬함 · 설정" })
1022
+ ] }),
1023
+ /* @__PURE__ */ e(
910
1024
  "input",
911
1025
  {
1026
+ id: "pbu-figma-url",
912
1027
  value: l,
913
- onChange: (s) => a(s.target.value),
914
- disabled: b,
1028
+ onChange: (u) => s(u.target.value),
1029
+ disabled: N,
915
1030
  placeholder: "https://www.figma.com/design/..."
916
1031
  }
917
1032
  ),
918
- v && /* @__PURE__ */ d("div", { className: "pbu-panel-empty", children: [
1033
+ _ && /* @__PURE__ */ a("div", { className: "pbu-panel-empty", children: [
919
1034
  "컴패니언 서버가 꺼져 있어요",
920
- /* @__PURE__ */ d("div", { className: "pbu-drawer-code", children: [
921
- /* @__PURE__ */ n("code", { children: "npx pubuilder serve" }),
922
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: q, children: P ? "복사됨 ✓" : "복사" })
1035
+ /* @__PURE__ */ a("div", { className: "pbu-drawer-code", children: [
1036
+ /* @__PURE__ */ e("code", { children: "npx pubuilder serve" }),
1037
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-btn", onClick: h, children: I ? "복사됨 ✓" : "복사" })
923
1038
  ] }),
924
- /* @__PURE__ */ n("div", { className: "pbu-hint", children: 'package.json의 dev 스크립트를 "pubuilder dev -- <기존 명령>"으로 감싸면 자동 실행돼요' }),
925
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: g, onClick: H, children: "다시 확인" })
1039
+ /* @__PURE__ */ e("div", { className: "pbu-hint", children: 'package.json의 dev 스크립트를 "pubuilder dev -- <기존 명령>"으로 감싸면 자동 실행돼요' }),
1040
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-btn", disabled: C, onClick: x, children: "다시 확인" })
926
1041
  ] }),
927
- S && !v && /* @__PURE__ */ d("div", { className: "pbu-drawer-error", children: [
928
- /* @__PURE__ */ n("span", { children: S }),
929
- (I === "NO_FIGMA_TOKEN" || I === "FIGMA_API_ERROR") && /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: o, children: "스킬함 열기" })
1042
+ P && !_ && /* @__PURE__ */ a("div", { className: "pbu-drawer-error", children: [
1043
+ /* @__PURE__ */ e("span", { children: P }),
1044
+ (j === "NO_FIGMA_TOKEN" || j === "FIGMA_API_ERROR") && /* @__PURE__ */ e("button", { type: "button", className: "pbu-btn", onClick: r, children: "스킬함 열기" })
930
1045
  ] }),
931
- b ? /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: T, onClick: U, children: T ? "중단 중..." : "중단" }) : /* @__PURE__ */ n(
1046
+ N ? /* @__PURE__ */ e("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: M, onClick: U, children: M ? "중단 중..." : "중단" }) : /* @__PURE__ */ e(
932
1047
  "button",
933
1048
  {
934
1049
  type: "button",
935
1050
  className: "pbu-btn pbu-btn-primary",
936
- disabled: g || !t,
937
- onClick: F,
1051
+ disabled: C || !o,
1052
+ onClick: W,
938
1053
  children: "이 블록 퍼블리싱"
939
1054
  }
940
1055
  ),
941
- (w.length > 0 || b) && /* @__PURE__ */ d("div", { className: "pbu-publish-log", ref: k, children: [
942
- b && w.length === 0 && /* @__PURE__ */ n("div", { className: "pbu-log-line pbu-log-tool", children: "실행 중..." }),
943
- w.map((s, C) => /* @__PURE__ */ d(
1056
+ (p.length > 0 || N) && /* @__PURE__ */ a("div", { className: "pbu-publish-log", ref: S, children: [
1057
+ N && p.length === 0 && /* @__PURE__ */ e("div", { className: "pbu-log-line pbu-log-tool", children: "실행 중..." }),
1058
+ p.map((u, z) => /* @__PURE__ */ a(
944
1059
  "div",
945
1060
  {
946
- className: s.type === "error" ? "pbu-log-line pbu-log-error" : s.type === "done" ? "pbu-log-line pbu-log-done" : s.type === "tool" ? "pbu-log-line pbu-log-tool" : "pbu-log-line",
1061
+ className: u.type === "error" ? "pbu-log-line pbu-log-error" : u.type === "done" ? "pbu-log-line pbu-log-done" : u.type === "tool" ? "pbu-log-line pbu-log-tool" : "pbu-log-line",
947
1062
  children: [
948
- /* @__PURE__ */ n("span", { children: Re[s.type] }),
1063
+ /* @__PURE__ */ e("span", { children: De[u.type] }),
949
1064
  " ",
950
- /* @__PURE__ */ n("span", { children: s.text })
1065
+ /* @__PURE__ */ e("span", { children: u.text })
951
1066
  ]
952
1067
  },
953
- C
1068
+ z
954
1069
  ))
1070
+ ] }),
1071
+ c === "done" && /* @__PURE__ */ a("div", { className: "pbu-publish-reply", children: [
1072
+ /* @__PURE__ */ e("label", { htmlFor: "pbu-publish-reply", children: "AI에게 이어서 답하기" }),
1073
+ /* @__PURE__ */ e(
1074
+ "textarea",
1075
+ {
1076
+ id: "pbu-publish-reply",
1077
+ value: y,
1078
+ onChange: (u) => w(u.target.value),
1079
+ onKeyDown: (u) => {
1080
+ (u.metaKey || u.ctrlKey) && u.key === "Enter" && G();
1081
+ },
1082
+ placeholder: "예: B 방향으로 진행해줘. 공지와 알림은 유지해.",
1083
+ rows: 3
1084
+ }
1085
+ ),
1086
+ /* @__PURE__ */ a("div", { className: "pbu-publish-reply-actions", children: [
1087
+ /* @__PURE__ */ e("span", { children: "⌘/Ctrl + Enter" }),
1088
+ /* @__PURE__ */ e(
1089
+ "button",
1090
+ {
1091
+ type: "button",
1092
+ className: "pbu-btn pbu-btn-primary",
1093
+ disabled: C || !y.trim(),
1094
+ onClick: G,
1095
+ children: C ? "전송 중..." : "답변 전송"
1096
+ }
1097
+ )
1098
+ ] })
955
1099
  ] })
956
1100
  ] });
957
1101
  }
958
- function De() {
959
- const e = y((l) => l.selection), [t, r] = _(!1), o = async () => {
960
- e && (await navigator.clipboard.writeText(e.selector), r(!0), setTimeout(() => r(!1), 1200));
1102
+ function je() {
1103
+ const t = k((l) => l.selection), [o, n] = v(!1), r = async () => {
1104
+ t && (await navigator.clipboard.writeText(t.selector), n(!0), setTimeout(() => n(!1), 1200));
961
1105
  };
962
- return /* @__PURE__ */ d("aside", { className: "pbu-panel", children: [
963
- /* @__PURE__ */ n("div", { className: "pbu-panel-title", children: "선택된 블록" }),
964
- e ? /* @__PURE__ */ d(ee, { children: [
965
- /* @__PURE__ */ d("div", { className: "pbu-field", children: [
966
- /* @__PURE__ */ n("label", { children: "페이지" }),
967
- /* @__PURE__ */ n("code", { children: e.pagePath })
1106
+ return /* @__PURE__ */ a("aside", { className: "pbu-panel", children: [
1107
+ /* @__PURE__ */ e("div", { className: "pbu-panel-title", children: "선택된 블록" }),
1108
+ t ? /* @__PURE__ */ a(ne, { children: [
1109
+ /* @__PURE__ */ a("div", { className: "pbu-field", children: [
1110
+ /* @__PURE__ */ e("label", { children: "페이지" }),
1111
+ /* @__PURE__ */ e("code", { children: t.pagePath })
968
1112
  ] }),
969
- /* @__PURE__ */ d("div", { className: "pbu-field", children: [
970
- /* @__PURE__ */ n("label", { children: "블록" }),
971
- /* @__PURE__ */ d("div", { children: [
972
- /* @__PURE__ */ n("span", { className: "pbu-chip", children: e.tag }),
973
- /* @__PURE__ */ n("span", { children: e.label })
1113
+ /* @__PURE__ */ a("div", { className: "pbu-field", children: [
1114
+ /* @__PURE__ */ e("label", { children: "블록" }),
1115
+ /* @__PURE__ */ a("div", { children: [
1116
+ /* @__PURE__ */ e("span", { className: "pbu-chip", children: t.tag }),
1117
+ /* @__PURE__ */ e("span", { children: t.label })
974
1118
  ] })
975
1119
  ] }),
976
- /* @__PURE__ */ d("div", { className: "pbu-field", children: [
977
- /* @__PURE__ */ n("label", { children: "Selector" }),
978
- /* @__PURE__ */ n("code", { className: "pbu-selector", children: e.selector }),
979
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: o, children: t ? "복사됨 ✓" : "Selector 복사" })
1120
+ /* @__PURE__ */ a("div", { className: "pbu-field", children: [
1121
+ /* @__PURE__ */ e("label", { children: "Selector" }),
1122
+ /* @__PURE__ */ e("code", { className: "pbu-selector", children: t.selector }),
1123
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-btn", onClick: r, children: o ? "복사됨 ✓" : "Selector 복사" })
980
1124
  ] }),
981
- /* @__PURE__ */ d("div", { className: "pbu-field", children: [
982
- /* @__PURE__ */ n("label", { children: "크기" }),
983
- /* @__PURE__ */ d("span", { children: [
984
- Math.round(e.rect.width),
1125
+ /* @__PURE__ */ a("div", { className: "pbu-field", children: [
1126
+ /* @__PURE__ */ e("label", { children: "크기" }),
1127
+ /* @__PURE__ */ a("span", { children: [
1128
+ Math.round(t.rect.width),
985
1129
  " × ",
986
- Math.round(e.rect.height),
1130
+ Math.round(t.rect.height),
987
1131
  "px"
988
1132
  ] })
989
1133
  ] }),
990
- /* @__PURE__ */ d("div", { className: "pbu-field", children: [
991
- /* @__PURE__ */ n("label", { children: "단위" }),
992
- /* @__PURE__ */ n("span", { children: e.granularity === "all" ? "전체" : e.granularity === "section" ? "섹션" : "유닛" })
1134
+ /* @__PURE__ */ a("div", { className: "pbu-field", children: [
1135
+ /* @__PURE__ */ e("label", { children: "단위" }),
1136
+ /* @__PURE__ */ e("span", { children: t.granularity === "all" ? "전체" : t.granularity === "section" ? "섹션" : "유닛" })
993
1137
  ] }),
994
- /* @__PURE__ */ n(Ie, {})
995
- ] }) : /* @__PURE__ */ d("div", { className: "pbu-panel-empty", children: [
1138
+ /* @__PURE__ */ e(Ae, {})
1139
+ ] }) : /* @__PURE__ */ a("div", { className: "pbu-panel-empty", children: [
996
1140
  "화면에서 블록에 마우스를 올리고 클릭해 선택하세요.",
997
- /* @__PURE__ */ n("br", {}),
1141
+ /* @__PURE__ */ e("br", {}),
998
1142
  "상단 토글로 ",
999
- /* @__PURE__ */ n("b", { children: "전체 / 섹션 / 유닛" }),
1143
+ /* @__PURE__ */ e("b", { children: "전체 / 섹션 / 유닛" }),
1000
1144
  " 단위를 바꿀 수 있어요."
1001
1145
  ] })
1002
1146
  ] });
1003
1147
  }
1004
- function $e({ ia: e }) {
1005
- const t = y((g) => g.viewerPath), r = y((g) => g.closeViewer), o = y((g) => g.granularity), l = y((g) => g.setGranularity), a = y((g) => g.inspectEnabled), i = y((g) => g.setInspectEnabled), c = y((g) => g.toggleSkillDrawer), h = D(null), u = D(null), [w, f] = _(!1), v = e.nodes.find((g) => g.path === t), N = () => {
1006
- u.current?.destroy(), u.current = null;
1007
- const g = h.current;
1008
- if (!g || !t) return;
1009
- const E = y.getState(), S = Oe(g, {
1010
- pagePath: t,
1011
- granularity: E.granularity,
1012
- enabled: E.inspectEnabled,
1013
- onSelect: (L, I) => (
1148
+ function He({ ia: t }) {
1149
+ const o = k((d) => d.viewerPath), n = k((d) => d.closeViewer), r = k((d) => d.granularity), l = k((d) => d.setGranularity), s = k((d) => d.inspectEnabled), c = k((d) => d.setInspectEnabled), i = H(null), f = H(null), [g, p] = v(!1), m = t.nodes.find((d) => d.path === o), _ = () => {
1150
+ f.current?.destroy(), f.current = null;
1151
+ const d = i.current;
1152
+ if (!d || !o) return;
1153
+ const C = k.getState(), E = $e(d, {
1154
+ pagePath: o,
1155
+ granularity: C.granularity,
1156
+ enabled: C.inspectEnabled,
1157
+ onSelect: (P, T) => (
1014
1158
  // 20K 상한 — 프롬프트 비대화 방지
1015
- y.getState().setSelectionWithHTML(L, I.outerHTML.slice(0, 2e4))
1159
+ k.getState().setSelectionWithHTML(P, T.outerHTML.slice(0, 2e4))
1016
1160
  )
1017
1161
  });
1018
- if (!S) {
1019
- f(!0);
1162
+ if (!E) {
1163
+ p(!0);
1020
1164
  return;
1021
1165
  }
1022
- f(!1), u.current = S;
1166
+ p(!1), f.current = E;
1023
1167
  };
1024
- return R(() => () => u.current?.destroy(), []), R(() => {
1025
- u.current?.setGranularity(o);
1026
- }, [o]), R(() => {
1027
- u.current?.setEnabled(a);
1028
- }, [a]), R(() => {
1029
- const g = (E) => {
1030
- E.key === "Escape" && (y.getState().skillDrawerOpen || r());
1168
+ return A(() => () => f.current?.destroy(), []), A(() => {
1169
+ f.current?.setGranularity(r);
1170
+ }, [r]), A(() => {
1171
+ f.current?.setEnabled(s);
1172
+ }, [s]), A(() => {
1173
+ const d = (C) => {
1174
+ C.key === "Escape" && (k.getState().skillDrawerOpen || n());
1031
1175
  };
1032
- return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
1033
- }, [r]), v ? /* @__PURE__ */ d("div", { className: "pbu-viewer", children: [
1034
- /* @__PURE__ */ d("div", { className: "pbu-bar", children: [
1035
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: r, children: "← 맵으로" }),
1036
- /* @__PURE__ */ d("span", { className: "pbu-viewer-title", children: [
1037
- v.title,
1038
- /* @__PURE__ */ n("code", { children: v.path })
1176
+ return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
1177
+ }, [n]), m ? /* @__PURE__ */ a("div", { className: "pbu-viewer", children: [
1178
+ /* @__PURE__ */ a("div", { className: "pbu-bar", children: [
1179
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-btn", onClick: n, children: "← 맵으로" }),
1180
+ /* @__PURE__ */ a("span", { className: "pbu-viewer-title", children: [
1181
+ m.title,
1182
+ /* @__PURE__ */ e("code", { children: m.path })
1039
1183
  ] }),
1040
- /* @__PURE__ */ n("span", { className: "pbu-spacer" }),
1041
- w && /* @__PURE__ */ n("span", { className: "pbu-hint", children: "⚠ 이 페이지는 검사할 수 없어요" }),
1042
- /* @__PURE__ */ d("div", { className: "pbu-seg", role: "group", "aria-label": "블록 단위", children: [
1043
- /* @__PURE__ */ n(
1184
+ /* @__PURE__ */ e("span", { className: "pbu-spacer" }),
1185
+ g && /* @__PURE__ */ e("span", { className: "pbu-hint", children: "⚠ 이 페이지는 검사할 수 없어요" }),
1186
+ /* @__PURE__ */ a("div", { className: "pbu-seg", role: "group", "aria-label": "블록 단위", children: [
1187
+ /* @__PURE__ */ e(
1044
1188
  "button",
1045
1189
  {
1046
1190
  type: "button",
1047
- className: o === "all" ? "pbu-on" : "",
1191
+ className: r === "all" ? "pbu-on" : "",
1048
1192
  onClick: () => l("all"),
1049
1193
  children: "전체"
1050
1194
  }
1051
1195
  ),
1052
- /* @__PURE__ */ n(
1196
+ /* @__PURE__ */ e(
1053
1197
  "button",
1054
1198
  {
1055
1199
  type: "button",
1056
- className: o === "section" ? "pbu-on" : "",
1200
+ className: r === "section" ? "pbu-on" : "",
1057
1201
  onClick: () => l("section"),
1058
1202
  children: "섹션"
1059
1203
  }
1060
1204
  ),
1061
- /* @__PURE__ */ n(
1205
+ /* @__PURE__ */ e(
1062
1206
  "button",
1063
1207
  {
1064
1208
  type: "button",
1065
- className: o === "unit" ? "pbu-on" : "",
1209
+ className: r === "unit" ? "pbu-on" : "",
1066
1210
  onClick: () => l("unit"),
1067
1211
  children: "유닛"
1068
1212
  }
1069
1213
  )
1070
1214
  ] }),
1071
- /* @__PURE__ */ d("label", { className: "pbu-toggle", children: [
1072
- /* @__PURE__ */ n(
1215
+ /* @__PURE__ */ a("label", { className: "pbu-toggle", children: [
1216
+ /* @__PURE__ */ e(
1073
1217
  "input",
1074
1218
  {
1075
1219
  type: "checkbox",
1076
- checked: a,
1077
- onChange: (g) => i(g.target.checked)
1220
+ checked: s,
1221
+ onChange: (d) => c(d.target.checked)
1078
1222
  }
1079
1223
  ),
1080
1224
  "검사 모드"
1081
1225
  ] }),
1082
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: c, children: "🧰 스킬함" }),
1083
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: r, "aria-label": "닫기", children: "✕" })
1226
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-icon-btn", onClick: n, "aria-label": "닫기", children: "✕" })
1084
1227
  ] }),
1085
- /* @__PURE__ */ d("div", { className: "pbu-viewer-body", children: [
1086
- /* @__PURE__ */ n("div", { className: "pbu-viewer-frame-wrap", children: /* @__PURE__ */ n(
1228
+ /* @__PURE__ */ a("div", { className: "pbu-viewer-body", children: [
1229
+ /* @__PURE__ */ e("div", { className: "pbu-viewer-frame-wrap", children: /* @__PURE__ */ e(
1087
1230
  "iframe",
1088
1231
  {
1089
- ref: h,
1232
+ ref: i,
1090
1233
  className: "pbu-viewer-iframe",
1091
- src: v.path,
1092
- title: v.title,
1093
- onLoad: N
1234
+ src: m.path,
1235
+ title: m.title,
1236
+ onLoad: _
1094
1237
  }
1095
1238
  ) }),
1096
- /* @__PURE__ */ n(De, {})
1239
+ /* @__PURE__ */ e(je, {})
1097
1240
  ] })
1098
1241
  ] }) : null;
1099
1242
  }
1100
- const Ae = {
1243
+ const Be = {
1101
1244
  project: "프로젝트",
1102
1245
  global: "글로벌",
1103
1246
  uploaded: "업로드"
1104
- }, He = ["project", "global", "uploaded"];
1105
- function Be() {
1106
- const e = y((b) => b.toggleSkillDrawer), t = te(Y), [r, o] = _(!0), [l, a] = _(!1), [i, c] = _([]), [h, u] = _(null), [w, f] = _(""), [v, N] = _(!1), [g, E] = _(null), [S, L] = _(!1), I = D(null), M = D(0), [T, O] = _(null), P = async () => {
1107
- const b = ++M.current;
1108
- o(!0), E(null);
1247
+ }, Fe = {
1248
+ project: "현재 프로젝트에서 발견한 스킬 · 여기서는 삭제할 수 없어요",
1249
+ global: "내 전역 환경에 설치된 공용 스킬 · 여기서는 삭제할 없어요",
1250
+ uploaded: "이 스킬함에 직접 올린 Markdown 스킬 · 삭제할 수 있어요"
1251
+ }, Ue = ["project", "global", "uploaded"];
1252
+ function Ge() {
1253
+ const t = k((h) => h.toggleSkillDrawer), o = le(Z), [n, r] = v(!0), [l, s] = v(!1), [c, i] = v([]), [f, g] = v(null), [p, m] = v(""), [_, d] = v(!1), [C, E] = v(null), [P, T] = v(!1), j = H(null), O = H(0), [M, $] = v(null), I = async () => {
1254
+ const h = ++O.current;
1255
+ r(!0), E(null);
1109
1256
  try {
1110
- const x = await t.isAlive();
1111
- if (b !== M.current || (a(x), !x)) return;
1112
- const [s, C] = await Promise.all([t.listSkills(), t.tokenStatus()]);
1113
- if (b !== M.current) return;
1114
- c(s), u(C), N(!C.configured);
1257
+ const x = await o.isAlive();
1258
+ if (h !== O.current || (s(x), !x)) return;
1259
+ const [N, B] = await Promise.all([o.listSkills(), o.tokenStatus()]);
1260
+ if (h !== O.current) return;
1261
+ i(N), g(B), d(!B.configured);
1115
1262
  } catch (x) {
1116
- if (b !== M.current) return;
1263
+ if (h !== O.current) return;
1117
1264
  E(x instanceof Error ? x.message : String(x));
1118
1265
  } finally {
1119
- b === M.current && o(!1);
1266
+ h === O.current && r(!1);
1120
1267
  }
1121
1268
  };
1122
- R(() => {
1123
- P();
1124
- }, []), R(() => {
1125
- const b = (x) => {
1126
- x.key === "Escape" && e();
1269
+ A(() => {
1270
+ I();
1271
+ }, []), A(() => {
1272
+ const h = (x) => {
1273
+ x.key === "Escape" && t();
1127
1274
  };
1128
- return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
1129
- }, [e]);
1130
- const p = async (b, x) => {
1131
- if (!T) {
1132
- O(b);
1275
+ return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
1276
+ }, [t]);
1277
+ const b = async (h, x) => {
1278
+ if (!M) {
1279
+ $(h);
1133
1280
  try {
1134
1281
  await x();
1135
- } catch (s) {
1136
- E(s instanceof Error ? s.message : String(s));
1282
+ } catch (N) {
1283
+ E(N instanceof Error ? N.message : String(N));
1137
1284
  } finally {
1138
- O(null);
1285
+ $(null);
1139
1286
  }
1140
1287
  }
1141
- }, k = (b, x) => p(`toggle:${b}`, async () => {
1142
- await t.toggleSkill(b, x), await P();
1143
- }), m = (b, x) => {
1144
- window.confirm(`"${x}" 스킬을 삭제할까요?`) && p(`remove:${b}`, async () => {
1145
- await t.removeSkill(b), await P();
1288
+ }, y = (h, x) => b(`toggle:${h}`, async () => {
1289
+ await o.toggleSkill(h, x), await I();
1290
+ }), w = (h, x) => {
1291
+ window.confirm(`"${x}" 스킬을 삭제할까요?`) && b(`remove:${h}`, async () => {
1292
+ await o.removeSkill(h), await I();
1146
1293
  });
1147
- }, z = () => I.current?.click(), A = (b) => {
1148
- const x = b.target.files?.[0];
1149
- b.target.value = "", x && p("upload", async () => {
1150
- const s = new FileReader(), C = await new Promise(($, le) => {
1151
- s.onload = () => $(String(s.result ?? "")), s.onerror = () => le(s.error ?? new Error("파일을 읽을 수 없어요")), s.readAsText(x);
1294
+ }, S = () => j.current?.click(), R = (h) => {
1295
+ const x = h.target.files?.[0];
1296
+ h.target.value = "", x && b("upload", async () => {
1297
+ const N = new FileReader(), B = await new Promise((u, z) => {
1298
+ N.onload = () => u(String(N.result ?? "")), N.onerror = () => z(N.error ?? new Error("파일을 읽을 수 없어요")), N.readAsText(x);
1152
1299
  });
1153
- await t.uploadSkill(x.name, C), await P();
1300
+ await o.uploadSkill(x.name, B), await I();
1154
1301
  });
1155
- }, F = () => p("token:save", async () => {
1156
- w.trim() && (await t.saveToken(w.trim()), f(""), await P());
1157
- }), U = () => p("token:delete", async () => {
1158
- await t.deleteToken(), f(""), await P();
1159
- }), q = async () => {
1160
- await navigator.clipboard.writeText("npx pubuilder serve"), L(!0), setTimeout(() => L(!1), 1200);
1161
- }, H = He.map((b) => ({
1162
- source: b,
1163
- label: Ae[b],
1164
- items: i.filter((x) => x.source === b)
1165
- })).filter((b) => b.items.length > 0);
1166
- return /* @__PURE__ */ d("aside", { className: "pbu-drawer", children: [
1167
- /* @__PURE__ */ d("div", { className: "pbu-drawer-header", children: [
1168
- /* @__PURE__ */ n("span", { className: "pbu-panel-title", children: "스킬함" }),
1169
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: e, "aria-label": "닫기", children: "" })
1302
+ }, D = () => b("token:save", async () => {
1303
+ p.trim() && (await o.saveToken(p.trim()), m(""), await I());
1304
+ }), F = () => b("token:delete", async () => {
1305
+ await o.deleteToken(), m(""), await I();
1306
+ }), W = async () => {
1307
+ await navigator.clipboard.writeText("npx pubuilder serve"), T(!0), setTimeout(() => T(!1), 1200);
1308
+ }, U = Ue.map((h) => ({
1309
+ source: h,
1310
+ label: Be[h],
1311
+ items: c.filter((x) => x.source === h)
1312
+ })).filter((h) => h.items.length > 0), G = c.filter((h) => h.enabled).length;
1313
+ return /* @__PURE__ */ a("aside", { className: "pbu-drawer", children: [
1314
+ /* @__PURE__ */ a("div", { className: "pbu-drawer-header", children: [
1315
+ /* @__PURE__ */ a("div", { children: [
1316
+ /* @__PURE__ */ e("span", { className: "pbu-panel-title", children: "스킬함" }),
1317
+ /* @__PURE__ */ e("span", { className: "pbu-drawer-kicker", children: "퍼블리싱 실행 설정" })
1318
+ ] }),
1319
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-icon-btn", onClick: t, "aria-label": "닫기", children: "✕" })
1320
+ ] }),
1321
+ /* @__PURE__ */ a("div", { className: "pbu-drawer-guide", children: [
1322
+ /* @__PURE__ */ e("strong", { children: "다음 퍼블리싱에 적용할 규칙을 고르세요." }),
1323
+ /* @__PURE__ */ e("span", { children: "체크된 스킬의 지침만 AI에게 전달됩니다. 변경 사항은 다음 실행부터 적용돼요." }),
1324
+ !n && l && /* @__PURE__ */ a("div", { className: "pbu-guide-status", children: [
1325
+ /* @__PURE__ */ e("span", { className: "pbu-status-dot pbu-status-dot-on" }),
1326
+ c.length > 0 ? `${G}/${c.length}개 스킬 사용 중` : "사용 가능한 스킬 없음"
1327
+ ] })
1170
1328
  ] }),
1171
- g && /* @__PURE__ */ d("div", { className: "pbu-drawer-error", children: [
1172
- /* @__PURE__ */ n("span", { children: g }),
1173
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: () => E(null), "aria-label": "닫기", children: "✕" })
1329
+ C && /* @__PURE__ */ a("div", { className: "pbu-drawer-error", children: [
1330
+ /* @__PURE__ */ e("span", { children: C }),
1331
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-icon-btn", onClick: () => E(null), "aria-label": "닫기", children: "✕" })
1174
1332
  ] }),
1175
- r ? /* @__PURE__ */ n("div", { className: "pbu-panel-empty", children: "불러오는 중..." }) : l ? /* @__PURE__ */ d(ee, { children: [
1176
- /* @__PURE__ */ n("div", { className: "pbu-drawer-group", children: "토큰" }),
1177
- h?.configured && !v ? /* @__PURE__ */ d("div", { className: "pbu-field", children: [
1178
- /* @__PURE__ */ n("span", { className: "pbu-token-masked", children: h.masked }),
1179
- /* @__PURE__ */ d("div", { children: [
1180
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick: () => N(!0), children: "재입력" }),
1181
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick: U, children: "삭제" })
1333
+ n ? /* @__PURE__ */ e("div", { className: "pbu-panel-empty", children: "불러오는 중..." }) : l ? /* @__PURE__ */ a(ne, { children: [
1334
+ /* @__PURE__ */ a("div", { className: "pbu-drawer-section-head", children: [
1335
+ /* @__PURE__ */ a("div", { children: [
1336
+ /* @__PURE__ */ e("strong", { children: "Figma 연결" }),
1337
+ /* @__PURE__ */ e("span", { children: "노드 링크에서 시안 이미지와 구조 정보를 읽을 때 사용해요." })
1338
+ ] }),
1339
+ /* @__PURE__ */ e("span", { className: `pbu-status-badge ${f?.configured ? "pbu-status-on" : "pbu-status-off"}`, children: f?.configured ? "연결됨" : "연결 필요" })
1340
+ ] }),
1341
+ f?.configured && !_ ? /* @__PURE__ */ a("div", { className: "pbu-field", children: [
1342
+ /* @__PURE__ */ e("span", { className: "pbu-token-masked", children: f.masked }),
1343
+ /* @__PURE__ */ a("div", { children: [
1344
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-btn", disabled: M !== null, onClick: () => d(!0), children: "재입력" }),
1345
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-btn", disabled: M !== null, onClick: F, children: "삭제" })
1182
1346
  ] })
1183
- ] }) : /* @__PURE__ */ d("div", { className: "pbu-field", children: [
1184
- /* @__PURE__ */ n(
1347
+ ] }) : /* @__PURE__ */ a("div", { className: "pbu-field", children: [
1348
+ /* @__PURE__ */ e(
1185
1349
  "input",
1186
1350
  {
1187
1351
  type: "password",
1188
- value: w,
1189
- onChange: (b) => f(b.target.value),
1352
+ value: p,
1353
+ onChange: (h) => m(h.target.value),
1190
1354
  placeholder: "Figma 토큰"
1191
1355
  }
1192
1356
  ),
1193
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: T !== null, onClick: F, children: "저장" })
1357
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: M !== null, onClick: D, children: "저장" })
1194
1358
  ] }),
1195
- /* @__PURE__ */ d("div", { className: "pbu-drawer-group", children: [
1196
- "스킬 목록",
1197
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick: z, children: "업로드" }),
1198
- /* @__PURE__ */ n(
1359
+ /* @__PURE__ */ a("div", { className: "pbu-drawer-section-head pbu-drawer-section-head-skills", children: [
1360
+ /* @__PURE__ */ a("div", { children: [
1361
+ /* @__PURE__ */ e("strong", { children: "AI 작업 스킬" }),
1362
+ /* @__PURE__ */ e("span", { children: "스킬은 AI에게 전달되는 작업 규칙이 담긴 Markdown 파일이에요." })
1363
+ ] }),
1364
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-btn", disabled: M !== null, onClick: S, children: "업로드" }),
1365
+ /* @__PURE__ */ e(
1199
1366
  "input",
1200
1367
  {
1201
- ref: I,
1368
+ ref: j,
1202
1369
  type: "file",
1203
1370
  accept: ".md",
1204
1371
  style: { display: "none" },
1205
- onChange: A
1372
+ onChange: R
1206
1373
  }
1207
1374
  )
1208
1375
  ] }),
1209
- H.length === 0 ? /* @__PURE__ */ n("div", { className: "pbu-panel-empty", children: "등록된 스킬이 없어요." }) : H.map((b) => /* @__PURE__ */ d("div", { children: [
1210
- /* @__PURE__ */ n("div", { className: "pbu-drawer-group", children: b.label }),
1211
- b.items.map((x) => /* @__PURE__ */ d("div", { className: "pbu-skill-row", children: [
1212
- /* @__PURE__ */ d("label", { className: "pbu-toggle", children: [
1213
- /* @__PURE__ */ n(
1376
+ U.length === 0 ? /* @__PURE__ */ e("div", { className: "pbu-panel-empty", children: "등록된 스킬이 없어요." }) : U.map((h) => /* @__PURE__ */ a("div", { children: [
1377
+ /* @__PURE__ */ a("div", { className: "pbu-skill-source", children: [
1378
+ /* @__PURE__ */ e("strong", { children: h.label }),
1379
+ /* @__PURE__ */ e("span", { children: Fe[h.source] })
1380
+ ] }),
1381
+ h.items.map((x) => /* @__PURE__ */ a("div", { className: "pbu-skill-row", children: [
1382
+ /* @__PURE__ */ a("label", { className: "pbu-toggle", children: [
1383
+ /* @__PURE__ */ e(
1214
1384
  "input",
1215
1385
  {
1216
1386
  type: "checkbox",
1217
1387
  checked: x.enabled,
1218
- disabled: T !== null,
1219
- onChange: (s) => k(x.id, s.target.checked)
1388
+ disabled: M !== null,
1389
+ onChange: (N) => y(x.id, N.target.checked)
1220
1390
  }
1221
1391
  ),
1222
1392
  x.name
1223
1393
  ] }),
1224
- /* @__PURE__ */ n("span", { className: "pbu-hint", title: x.description, children: x.description }),
1225
- x.source === "uploaded" && /* @__PURE__ */ n(
1394
+ /* @__PURE__ */ e("span", { className: "pbu-hint", title: x.description, children: x.description }),
1395
+ /* @__PURE__ */ e("span", { className: `pbu-skill-state ${x.enabled ? "pbu-skill-state-on" : ""}`, children: M === `toggle:${x.id}` ? "변경 중" : x.enabled ? "사용 중" : "제외됨" }),
1396
+ x.source === "uploaded" && /* @__PURE__ */ e(
1226
1397
  "button",
1227
1398
  {
1228
1399
  type: "button",
1229
1400
  className: "pbu-icon-btn",
1230
- disabled: T !== null,
1231
- onClick: () => m(x.id, x.name),
1401
+ disabled: M !== null,
1402
+ onClick: () => w(x.id, x.name),
1232
1403
  "aria-label": "삭제",
1233
1404
  children: "🗑"
1234
1405
  }
1235
1406
  )
1236
1407
  ] }, x.id))
1237
- ] }, b.source))
1238
- ] }) : /* @__PURE__ */ d("div", { className: "pbu-panel-empty", children: [
1408
+ ] }, h.source))
1409
+ ] }) : /* @__PURE__ */ a("div", { className: "pbu-panel-empty", children: [
1239
1410
  "컴패니언 서버가 꺼져 있어요",
1240
- /* @__PURE__ */ d("div", { className: "pbu-drawer-code", children: [
1241
- /* @__PURE__ */ n("code", { children: "npx pubuilder serve" }),
1242
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: q, children: S ? "복사됨 ✓" : "복사" })
1411
+ /* @__PURE__ */ a("div", { className: "pbu-drawer-code", children: [
1412
+ /* @__PURE__ */ e("code", { children: "npx pubuilder serve" }),
1413
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-btn", onClick: W, children: P ? "복사됨 ✓" : "복사" })
1243
1414
  ] }),
1244
- /* @__PURE__ */ n("div", { className: "pbu-hint", children: 'package.json의 dev 스크립트를 "pubuilder dev -- <기존 명령>"으로 감싸면 자동 실행돼요' }),
1245
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: P, children: "다시 확인" })
1415
+ /* @__PURE__ */ e("div", { className: "pbu-hint", children: 'package.json의 dev 스크립트를 "pubuilder dev -- <기존 명령>"으로 감싸면 자동 실행돼요' }),
1416
+ /* @__PURE__ */ e("button", { type: "button", className: "pbu-btn", onClick: I, children: "다시 확인" })
1246
1417
  ] })
1247
1418
  ] });
1248
1419
  }
1249
- function We({ config: e, enabled: t = !0, serverUrl: r }) {
1250
- const o = t && !fe(), [l, a] = _(!1), i = y((f) => f.isMapOpen), c = y((f) => f.viewerPath), h = y((f) => f.skillDrawerOpen), u = V(() => de(e), [e]), w = V(() => new re(r), [r]);
1251
- return ie(() => {
1252
- o && window.self === window.top && (we(), a(!0));
1253
- }, [o]), !l || !o ? null : se(
1254
- /* @__PURE__ */ d(Y.Provider, { value: w, children: [
1255
- /* @__PURE__ */ n(ze, {}),
1256
- i && /* @__PURE__ */ n(Ne, { ia: u }),
1257
- c && /* @__PURE__ */ n($e, { ia: u }),
1258
- h && /* @__PURE__ */ n(Be, {})
1420
+ function Xe({ config: t, enabled: o = !0, serverUrl: n }) {
1421
+ const r = o && !xe(), [l, s] = v(!1), c = k((m) => m.isMapOpen), i = k((m) => m.viewerPath), f = k((m) => m.skillDrawerOpen), g = K(() => be(t), [t]), p = K(() => new ae(n), [n]);
1422
+ return ue(() => {
1423
+ r && window.self === window.top && (ke(), s(!0));
1424
+ }, [r]), !l || !r ? null : pe(
1425
+ /* @__PURE__ */ a(Z.Provider, { value: p, children: [
1426
+ /* @__PURE__ */ e(Se, {}),
1427
+ c && /* @__PURE__ */ e(Ee, { ia: g }),
1428
+ i && /* @__PURE__ */ e(He, { ia: g }),
1429
+ f && /* @__PURE__ */ e(Ge, {})
1259
1430
  ] }),
1260
1431
  document.body
1261
1432
  );
1262
1433
  }
1263
1434
  export {
1264
- We as PageMap,
1265
- Xe as defineIA,
1266
- de as normalizeIA
1435
+ Xe as PageMap,
1436
+ et as defineIA,
1437
+ be as normalizeIA
1267
1438
  };
1268
1439
  //# sourceMappingURL=index.js.map