@gusun/design-system 0.1.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.
Files changed (121) hide show
  1. package/README.md +16 -0
  2. package/dist-lib/Editor-wECQz1CV.js +1994 -0
  3. package/dist-lib/Editor-wECQz1CV.js.map +1 -0
  4. package/dist-lib/components/Accordion.d.ts +25 -0
  5. package/dist-lib/components/Button.d.ts +27 -0
  6. package/dist-lib/components/ButtonGroup.d.ts +18 -0
  7. package/dist-lib/components/CalendarDayButton.d.ts +39 -0
  8. package/dist-lib/components/Checkbox.d.ts +34 -0
  9. package/dist-lib/components/Chip.d.ts +12 -0
  10. package/dist-lib/components/ConditionOrderSlot.d.ts +31 -0
  11. package/dist-lib/components/DateField.d.ts +39 -0
  12. package/dist-lib/components/DatePicker.d.ts +49 -0
  13. package/dist-lib/components/Divider.d.ts +12 -0
  14. package/dist-lib/components/Editor.d.ts +23 -0
  15. package/dist-lib/components/EditorToolbar.d.ts +12 -0
  16. package/dist-lib/components/ErrorBoundary.d.ts +30 -0
  17. package/dist-lib/components/Field.d.ts +32 -0
  18. package/dist-lib/components/FileUploadButton.d.ts +22 -0
  19. package/dist-lib/components/FileUploadMenu.d.ts +24 -0
  20. package/dist-lib/components/FormTemplate.d.ts +33 -0
  21. package/dist-lib/components/ImageUploadButton.d.ts +14 -0
  22. package/dist-lib/components/ImageUploadMenu.d.ts +17 -0
  23. package/dist-lib/components/InlineFieldTrigger.d.ts +18 -0
  24. package/dist-lib/components/Input.d.ts +28 -0
  25. package/dist-lib/components/JobPositionTemplate.d.ts +41 -0
  26. package/dist-lib/components/Label.d.ts +18 -0
  27. package/dist-lib/components/List.d.ts +46 -0
  28. package/dist-lib/components/ListEmpty.d.ts +6 -0
  29. package/dist-lib/components/ListGroup.d.ts +13 -0
  30. package/dist-lib/components/MarkdownDoc.d.ts +5 -0
  31. package/dist-lib/components/MergeFieldNode.d.ts +2 -0
  32. package/dist-lib/components/Modal.d.ts +90 -0
  33. package/dist-lib/components/NoticeWritingTemplate.d.ts +38 -0
  34. package/dist-lib/components/Pagination.d.ts +27 -0
  35. package/dist-lib/components/Popover.d.ts +16 -0
  36. package/dist-lib/components/PopoverMenu.d.ts +54 -0
  37. package/dist-lib/components/Radio.d.ts +33 -0
  38. package/dist-lib/components/ScreeningBuilderTemplate.d.ts +53 -0
  39. package/dist-lib/components/ScreeningConditionCard.d.ts +56 -0
  40. package/dist-lib/components/ScreeningFormula.d.ts +17 -0
  41. package/dist-lib/components/ScreeningIndividualSettingModal.d.ts +10 -0
  42. package/dist-lib/components/ScrollArea.d.ts +30 -0
  43. package/dist-lib/components/SearchBar.d.ts +14 -0
  44. package/dist-lib/components/SegmentControl.d.ts +46 -0
  45. package/dist-lib/components/SegmentedTabs.d.ts +20 -0
  46. package/dist-lib/components/Select.d.ts +67 -0
  47. package/dist-lib/components/SelectGroup.d.ts +18 -0
  48. package/dist-lib/components/SelectOrInput.d.ts +49 -0
  49. package/dist-lib/components/SideNavigation.d.ts +33 -0
  50. package/dist-lib/components/SideNavigationTemplate.d.ts +29 -0
  51. package/dist-lib/components/Slot.d.ts +16 -0
  52. package/dist-lib/components/Switch.d.ts +6 -0
  53. package/dist-lib/components/Table.d.ts +66 -0
  54. package/dist-lib/components/TableTemplate.d.ts +52 -0
  55. package/dist-lib/components/Tabs.d.ts +40 -0
  56. package/dist-lib/components/Tag.d.ts +25 -0
  57. package/dist-lib/components/TextArea.d.ts +26 -0
  58. package/dist-lib/components/TimeField.d.ts +15 -0
  59. package/dist-lib/components/ToolBar.d.ts +5 -0
  60. package/dist-lib/components/Tooltip.d.ts +25 -0
  61. package/dist-lib/components/TruncatingText.d.ts +7 -0
  62. package/dist-lib/components/TwoDepthList.d.ts +41 -0
  63. package/dist-lib/components/UsageExample.d.ts +16 -0
  64. package/dist-lib/components/chipStyles.d.ts +11 -0
  65. package/dist-lib/components/formulaFunctions.d.ts +75 -0
  66. package/dist-lib/components/modalContext.d.ts +1 -0
  67. package/dist-lib/components/popoverLayers.d.ts +6 -0
  68. package/dist-lib/components/tableView.d.ts +17 -0
  69. package/dist-lib/components/useFocusTrap.d.ts +6 -0
  70. package/dist-lib/components/useHoverTooltip.d.ts +10 -0
  71. package/dist-lib/components/useOutsideDismiss.d.ts +9 -0
  72. package/dist-lib/components/usePanelKeyboard.d.ts +11 -0
  73. package/dist-lib/components/usePopoverPosition.d.ts +11 -0
  74. package/dist-lib/editor.d.ts +3 -0
  75. package/dist-lib/editor.js +2 -0
  76. package/dist-lib/index.d.ts +68 -0
  77. package/dist-lib/index.js +4707 -0
  78. package/dist-lib/index.js.map +1 -0
  79. package/dist-lib/navContext.d.ts +8 -0
  80. package/dist-lib/styles.css +1 -0
  81. package/dist-lib/tailwind-preset.cjs +1023 -0
  82. package/dist-lib/tailwind-preset.mjs +1000 -0
  83. package/dist-lib/tokens/border.d.ts +6 -0
  84. package/dist-lib/tokens/colors/accordionColors.d.ts +3 -0
  85. package/dist-lib/tokens/colors/builderAreaColors.d.ts +12 -0
  86. package/dist-lib/tokens/colors/buttonColors.d.ts +37 -0
  87. package/dist-lib/tokens/colors/calendarColors.d.ts +12 -0
  88. package/dist-lib/tokens/colors/checkboxColors.d.ts +12 -0
  89. package/dist-lib/tokens/colors/chipColors.d.ts +82 -0
  90. package/dist-lib/tokens/colors/conditionCardColors.d.ts +10 -0
  91. package/dist-lib/tokens/colors/conditionOrderSlotColors.d.ts +15 -0
  92. package/dist-lib/tokens/colors/dividerColors.d.ts +5 -0
  93. package/dist-lib/tokens/colors/editorColors.d.ts +30 -0
  94. package/dist-lib/tokens/colors/formulaColors.d.ts +26 -0
  95. package/dist-lib/tokens/colors/labelFieldColors.d.ts +6 -0
  96. package/dist-lib/tokens/colors/listColors.d.ts +20 -0
  97. package/dist-lib/tokens/colors/modalColors.d.ts +7 -0
  98. package/dist-lib/tokens/colors/newTagColors.d.ts +6 -0
  99. package/dist-lib/tokens/colors/radioColors.d.ts +12 -0
  100. package/dist-lib/tokens/colors/segmentedColors.d.ts +9 -0
  101. package/dist-lib/tokens/colors/sideNavColors.d.ts +13 -0
  102. package/dist-lib/tokens/colors/switchColors.d.ts +13 -0
  103. package/dist-lib/tokens/colors/tabColors.d.ts +9 -0
  104. package/dist-lib/tokens/colors/tableColors.d.ts +8 -0
  105. package/dist-lib/tokens/colors/tagColors.d.ts +10 -0
  106. package/dist-lib/tokens/colors/textFieldColors.d.ts +25 -0
  107. package/dist-lib/tokens/colors/toolbarColors.d.ts +5 -0
  108. package/dist-lib/tokens/colors.d.ts +176 -0
  109. package/dist-lib/tokens/fontIconColors.d.ts +7 -0
  110. package/dist-lib/tokens/icon.d.ts +5 -0
  111. package/dist-lib/tokens/index.d.ts +32 -0
  112. package/dist-lib/tokens/lineHeight.d.ts +11 -0
  113. package/dist-lib/tokens/radius.d.ts +14 -0
  114. package/dist-lib/tokens/spacing.d.ts +16 -0
  115. package/dist-lib/tokens/typography.d.ts +33 -0
  116. package/dist-lib/tokens-CbcaxhkP.js +583 -0
  117. package/dist-lib/tokens-CbcaxhkP.js.map +1 -0
  118. package/dist-lib/tokens.js +2 -0
  119. package/dist-lib/utils/datetime.d.ts +6 -0
  120. package/dist-lib/utils/phone.d.ts +1 -0
  121. package/package.json +163 -0
@@ -0,0 +1,4707 @@
1
+ import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, R as d, S as f, T as p, _ as m, b as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as w, m as T, o as E, p as D, r as O, s as k, t as A, u as j, v as M, w as N, x as P, y as F, z as I } from "./Editor-wECQz1CV.js";
2
+ import { A as L, C as R, D as z, E as B, F as V, M as H, N as U, O as W, P as G, S as K, T as ee, _ as q, a as J, b as Y, c as te, d as ne, f as re, g as ie, h as ae, i as oe, j as se, k as ce, l as le, m as ue, n as de, o as fe, p as pe, r as me, s as he, t as ge, u as _e, v as ve, w as ye, x as be, y as xe } from "./tokens-CbcaxhkP.js";
3
+ import { Children as Se, Component as Ce, Fragment as we, cloneElement as Te, createContext as Ee, forwardRef as De, isValidElement as Oe, useCallback as ke, useContext as Ae, useEffect as je, useImperativeHandle as Me, useLayoutEffect as Ne, useMemo as Pe, useRef as X, useState as Z } from "react";
4
+ import { Calendar as Fe, ChevronDown as Ie, ChevronLeft as Le, ChevronRight as Re, ChevronsLeft as ze, ChevronsRight as Be, Clock as Ve, Copy as He, FolderInput as Ue, FolderOutput as We, GripVertical as Ge, Image as Ke, LoaderCircle as qe, MoreVertical as Je, Paperclip as Ye, Plus as Xe, Settings as Ze, SquarePen as Qe, Trash2 as $e, Upload as et, X as tt } from "lucide-react";
5
+ import { createPortal as nt } from "react-dom";
6
+ import { Fragment as rt, jsx as Q, jsxs as $ } from "react/jsx-runtime";
7
+ //#region src/components/Divider.tsx
8
+ var it = {
9
+ subtle: "bg-divider-subtle",
10
+ default: "bg-divider-default",
11
+ strong: "bg-divider-strong"
12
+ };
13
+ function at({ direction: e = "horizontal", color: t = "default", className: n = "", ...r }) {
14
+ let i = e === "vertical";
15
+ return /* @__PURE__ */ Q("div", {
16
+ role: "separator",
17
+ "aria-orientation": i ? "vertical" : "horizontal",
18
+ className: `shrink-0 ${i ? "w-px self-stretch" : "h-px w-full"} ${it[t] ?? it.default} ${n}`,
19
+ ...r
20
+ });
21
+ }
22
+ //#endregion
23
+ //#region src/components/Accordion.tsx
24
+ function ot({ children: e, className: t = "", ...n }) {
25
+ let r = Se.toArray(e);
26
+ return /* @__PURE__ */ $("div", {
27
+ className: `flex w-full flex-col ${t}`,
28
+ ...n,
29
+ children: [/* @__PURE__ */ Q(at, {}), r.map((e) => /* @__PURE__ */ $(we, { children: [e, /* @__PURE__ */ Q(at, {})] }, e.key ?? void 0))]
30
+ });
31
+ }
32
+ function st({ title: e = "", children: t, defaultOpen: n = !1, open: r, onOpenChange: a, nameEditable: s = !1, onTitleChange: l, deletable: d = !1, deleteDisabled: f = !1, onDelete: p, keepMounted: m = !1, maxHeight: h, className: g = "", ..._ }) {
33
+ let v = r !== void 0, [y, b] = Z(n), x = v ? r : y, S = (e) => {
34
+ v || b(e), a?.(e);
35
+ }, [C, w] = Z(n || m);
36
+ x && !C && w(!0);
37
+ let T = m || C, [E, D] = Z(!1), [O, k] = Z(""), A = () => {
38
+ k(e ?? ""), D(!0);
39
+ }, j = () => D(!1), M = () => {
40
+ D(!1);
41
+ let t = O.trim();
42
+ t && t !== e && l?.(t);
43
+ };
44
+ return /* @__PURE__ */ $("div", {
45
+ className: `w-full ${g}`,
46
+ ..._,
47
+ children: [E ? /* @__PURE__ */ $("div", {
48
+ className: "flex w-full items-start gap-spacing-5 py-spacing-5",
49
+ children: [/* @__PURE__ */ Q("div", {
50
+ className: "min-w-0 flex-1",
51
+ children: /* @__PURE__ */ Q(u, {
52
+ width: "100%",
53
+ value: O,
54
+ onChange: (e) => k(e.target.value),
55
+ inputProps: {
56
+ autoFocus: !0,
57
+ onKeyDown: (e) => {
58
+ e.key === "Enter" && M(), e.key === "Escape" && j();
59
+ }
60
+ }
61
+ })
62
+ }), /* @__PURE__ */ $("div", {
63
+ className: "flex shrink-0 items-center gap-spacing-3",
64
+ children: [/* @__PURE__ */ Q(i, {
65
+ variant: "ghost",
66
+ size: "32",
67
+ onClick: j,
68
+ children: "취소"
69
+ }), /* @__PURE__ */ Q(i, {
70
+ variant: "ghost",
71
+ size: "32",
72
+ onClick: M,
73
+ children: "저장"
74
+ })]
75
+ })]
76
+ }) : /* @__PURE__ */ $("div", {
77
+ className: "flex w-full items-start gap-spacing-3 p-spacing-5",
78
+ children: [
79
+ /* @__PURE__ */ $("button", {
80
+ type: "button",
81
+ "aria-expanded": x,
82
+ onClick: () => S(!x),
83
+ className: "flex h-[32px] min-w-0 flex-1 cursor-pointer items-center gap-spacing-5 text-left",
84
+ children: [/* @__PURE__ */ Q(Ie, {
85
+ size: 16,
86
+ strokeWidth: 1.8,
87
+ className: `shrink-0 text-font-icon-5 transition-transform ${x ? "" : "rotate-180"}`
88
+ }), /* @__PURE__ */ Q(o, {
89
+ className: "min-w-0 text-14 text-accordion-list-name",
90
+ children: e
91
+ })]
92
+ }),
93
+ s && /* @__PURE__ */ Q(i, {
94
+ variant: "ghost",
95
+ icon: Qe,
96
+ "aria-label": "이름 편집",
97
+ onClick: A
98
+ }),
99
+ d && /* @__PURE__ */ Q(i, {
100
+ variant: "ghost",
101
+ icon: $e,
102
+ "aria-label": "리스트 삭제",
103
+ disabled: f,
104
+ onClick: p
105
+ })
106
+ ]
107
+ }), /* @__PURE__ */ Q("div", {
108
+ className: `grid transition-[grid-template-rows] duration-200 ${x ? "grid-rows-[1fr]" : "grid-rows-[0fr]"}`,
109
+ children: /* @__PURE__ */ Q("div", {
110
+ className: "min-h-0 overflow-hidden",
111
+ children: T && /* @__PURE__ */ Q("div", {
112
+ className: "pb-spacing-6",
113
+ children: h ? /* @__PURE__ */ Q(c, {
114
+ maxHeight: h,
115
+ children: t
116
+ }) : t
117
+ })
118
+ })
119
+ })]
120
+ });
121
+ }
122
+ //#endregion
123
+ //#region src/components/CalendarDayButton.tsx
124
+ var ct = {
125
+ default: {
126
+ left: "bg-calendar-day-bg",
127
+ right: "bg-calendar-day-bg"
128
+ },
129
+ muted: {
130
+ left: "bg-calendar-day-bg",
131
+ right: "bg-calendar-day-bg"
132
+ },
133
+ today: {
134
+ left: "bg-calendar-day-bg",
135
+ right: "bg-calendar-day-bg"
136
+ },
137
+ selected: {
138
+ left: "bg-calendar-day-bg",
139
+ right: "bg-calendar-day-bg"
140
+ },
141
+ "range-start": {
142
+ left: "bg-calendar-day-bg",
143
+ right: "bg-calendar-range-bg"
144
+ },
145
+ "range-end": {
146
+ left: "bg-calendar-range-bg",
147
+ right: "bg-calendar-day-bg"
148
+ },
149
+ "in-range": {
150
+ left: "bg-calendar-range-bg",
151
+ right: "bg-calendar-range-bg"
152
+ }
153
+ }, lt = {
154
+ default: {
155
+ circle: "bg-calendar-day-bg",
156
+ text: "text-calendar-day-text"
157
+ },
158
+ muted: {
159
+ circle: "bg-transparent",
160
+ text: "text-calendar-muted-text"
161
+ },
162
+ today: {
163
+ circle: "bg-calendar-today-bg",
164
+ text: "text-calendar-today-text"
165
+ },
166
+ selected: {
167
+ circle: "bg-calendar-selected-bg",
168
+ text: "text-calendar-selected-text"
169
+ },
170
+ "range-start": {
171
+ circle: "bg-calendar-selected-bg",
172
+ text: "text-calendar-selected-text"
173
+ },
174
+ "range-end": {
175
+ circle: "bg-calendar-selected-bg",
176
+ text: "text-calendar-selected-text"
177
+ },
178
+ "in-range": {
179
+ circle: "bg-calendar-range-bg",
180
+ text: "text-calendar-range-text"
181
+ }
182
+ }, ut = new Set(["default", "muted"]);
183
+ function dt({ children: e, state: t = "default", edge: n, disabled: r = !1, onClick: i, className: a = "", ...o }) {
184
+ let s = ct[t] ?? ct.default, c = lt[t] ?? lt.default, l = !r && ut.has(t) ? "group-hover:bg-calendar-hover-bg group-focus-visible:bg-calendar-hover-bg" : "", u = r && t !== "muted", d = n === "left" && s.left.includes("range-bg") ? "rounded-l-round-00" : "", f = n === "right" && s.right.includes("range-bg") ? "rounded-r-round-00" : "";
185
+ return /* @__PURE__ */ $("button", {
186
+ type: "button",
187
+ disabled: r,
188
+ onClick: r ? void 0 : i,
189
+ "aria-disabled": r || void 0,
190
+ className: `group relative flex h-[24px] w-[36px] items-center justify-center focus:outline-none ${r ? "cursor-not-allowed" : "cursor-pointer"} ${u ? "opacity-40" : ""} ${a}`,
191
+ ...o,
192
+ children: [
193
+ /* @__PURE__ */ Q("span", {
194
+ className: `absolute inset-y-0 left-0 w-1/2 ${s.left} ${d}`,
195
+ "aria-hidden": "true"
196
+ }),
197
+ /* @__PURE__ */ Q("span", {
198
+ className: `absolute inset-y-0 right-0 w-1/2 ${s.right} ${f}`,
199
+ "aria-hidden": "true"
200
+ }),
201
+ /* @__PURE__ */ Q("span", {
202
+ className: `relative z-10 flex size-[24px] items-center justify-center rounded-round-00 transition-colors ${c.circle} ${l}`,
203
+ children: /* @__PURE__ */ Q("span", {
204
+ className: `text-12 ${c.text}`,
205
+ children: e
206
+ })
207
+ })
208
+ ]
209
+ });
210
+ }
211
+ //#endregion
212
+ //#region src/components/Chip.tsx
213
+ function ft({ children: e, onRemove: t, onClick: n, color: r = "gray", removeAriaLabel: i = "삭제", className: a = "", ...o }) {
214
+ let c = !!n;
215
+ return /* @__PURE__ */ $("span", {
216
+ onClick: c ? n : void 0,
217
+ className: `inline-flex items-center gap-spacing-3 rounded-round-4 border pl-spacing-4 pr-spacing-3 py-spacing-1 font-pretendard font-normal text-12 transition-colors ${s[r] ?? s.gray} ${c ? "cursor-pointer" : ""} ${a}`,
218
+ ...o,
219
+ children: [/* @__PURE__ */ Q("span", {
220
+ className: "whitespace-nowrap",
221
+ children: e
222
+ }), t && /* @__PURE__ */ Q("button", {
223
+ type: "button",
224
+ "aria-label": i,
225
+ onClick: (e) => {
226
+ e.stopPropagation(), t(e);
227
+ },
228
+ className: "flex shrink-0 items-center justify-center",
229
+ children: /* @__PURE__ */ Q(tt, {
230
+ size: 12,
231
+ strokeWidth: 1.8
232
+ })
233
+ })]
234
+ });
235
+ }
236
+ //#endregion
237
+ //#region src/components/ConditionOrderSlot.tsx
238
+ function pt(e) {
239
+ return Se.map(e, (e) => Oe(e) ? e.type === we ? /* @__PURE__ */ Q(we, { children: pt(e.props.children) }) : Te(e, { disabled: !0 }) : e);
240
+ }
241
+ var mt = "border-condition-slot-card-default-line bg-condition-slot-card-default-bg text-condition-slot-card-default-text hover:border-condition-slot-card-hover-line hover:bg-condition-slot-card-hover-bg hover:text-condition-slot-card-hover-text", ht = "border-condition-slot-card-pressed-line bg-condition-slot-card-pressed-bg text-condition-slot-card-pressed-text";
242
+ function gt({ title: e = "조건 1.", enabled: t = !0, onEnabledChange: n, dragging: r = !1, width: i = 202, dragHandleProps: a = null, children: o, className: s = "", ...c }) {
243
+ return /* @__PURE__ */ $("div", {
244
+ style: { width: typeof i == "number" ? `${i}px` : i },
245
+ className: `flex shrink-0 flex-col gap-spacing-6 rounded-round-4 border p-spacing-6 shadow-[0_2px_2px_0_rgba(0,0,0,0.12)] transition-colors ${r ? ht : mt} ${s}`,
246
+ ...c,
247
+ children: [/* @__PURE__ */ $("div", {
248
+ className: "flex w-full items-center justify-between gap-spacing-4",
249
+ children: [/* @__PURE__ */ $("div", {
250
+ className: "flex min-w-0 items-center gap-spacing-4",
251
+ children: [/* @__PURE__ */ Q("span", {
252
+ "aria-label": "순서 변경",
253
+ className: "flex shrink-0 cursor-grab items-center active:cursor-grabbing",
254
+ ...a || {},
255
+ children: /* @__PURE__ */ Q(Ge, {
256
+ size: 16,
257
+ strokeWidth: 1.8
258
+ })
259
+ }), /* @__PURE__ */ Q("span", {
260
+ className: `truncate text-14 ${t ? "" : "text-font-icon-3"}`,
261
+ children: e
262
+ })]
263
+ }), /* @__PURE__ */ Q(m, {
264
+ checked: t,
265
+ onChange: (e) => n?.(e.target.checked)
266
+ })]
267
+ }), /* @__PURE__ */ Q("div", {
268
+ className: "flex w-full flex-col gap-spacing-3",
269
+ children: t ? o : pt(o)
270
+ })]
271
+ });
272
+ }
273
+ function _t({ items: e = [], direction: t = "vertical", order: n, defaultOrder: r, onOrderChange: i, enabledIds: a, onEnabledChange: o, titlePrefix: s = "조건", cardWidth: c = 202, className: l = "", ...u }) {
274
+ let d = t === "vertical", f = e.map((e) => e.id), p = n !== void 0, [m, h] = Z(r ?? null), g = p ? n : m ?? f, _ = [...g.filter((e) => f.includes(e)), ...f.filter((e) => !g.includes(e))], v = a !== void 0, [y, b] = Z([]), x = (e) => v ? a.includes(e) : !y.includes(e), S = (e, t) => {
275
+ v || b((n) => t ? n.filter((t) => t !== e) : [...n, e]);
276
+ let n = _.filter((n) => n === e ? t : x(n));
277
+ o?.(n, {
278
+ id: e,
279
+ enabled: t
280
+ });
281
+ }, [C, w] = Z(null), T = X(!1), E = (e, t) => {
282
+ if (e === t) return;
283
+ let n = _.indexOf(e), r = _.indexOf(t);
284
+ if (n < 0 || r < 0) return;
285
+ let a = _.filter((t) => t !== e), o = a.indexOf(t);
286
+ a.splice(n < r ? o + 1 : o, 0, e), p || h(a), i?.(a);
287
+ }, D = d ? Ie : Re, O = 0;
288
+ return /* @__PURE__ */ Q("div", {
289
+ className: `inline-flex ${d ? "flex-col" : "flex-row"} items-center gap-spacing-2 rounded-round-4 bg-condition-slot-slot-bg p-spacing-6 ${l}`,
290
+ ...u,
291
+ onDragOver: (e) => {
292
+ C != null && (e.preventDefault(), e.dataTransfer.dropEffect = "move");
293
+ },
294
+ onDrop: (e) => e.preventDefault(),
295
+ children: _.map((t, n) => {
296
+ let r = e.find((e) => e.id === t);
297
+ if (!r) return null;
298
+ let i = x(t), a = i ? `${s} ${++O}.` : `${s} -.`;
299
+ return /* @__PURE__ */ $("div", {
300
+ className: `flex ${d ? "flex-col" : "flex-row"} items-center gap-spacing-2`,
301
+ children: [n > 0 && /* @__PURE__ */ Q(D, {
302
+ size: 16,
303
+ strokeWidth: 1.8,
304
+ className: "shrink-0 text-condition-slot-card-default-icon"
305
+ }), /* @__PURE__ */ Q(gt, {
306
+ title: a,
307
+ enabled: i,
308
+ onEnabledChange: (e) => S(t, e),
309
+ dragging: C === t,
310
+ width: c,
311
+ dragHandleProps: {
312
+ onMouseDown: () => {
313
+ T.current = !0;
314
+ },
315
+ onMouseUp: () => {
316
+ T.current = !1;
317
+ }
318
+ },
319
+ draggable: !0,
320
+ onDragStart: (e) => {
321
+ if (!T.current) {
322
+ e.preventDefault();
323
+ return;
324
+ }
325
+ w(t), e.dataTransfer.effectAllowed = "move";
326
+ try {
327
+ e.dataTransfer.setData("text/plain", String(t));
328
+ } catch {}
329
+ },
330
+ onDragEnd: () => {
331
+ w(null), T.current = !1;
332
+ },
333
+ onDragOver: (e) => {
334
+ C != null && (e.preventDefault(), e.dataTransfer.dropEffect = "move");
335
+ },
336
+ onDrop: (e) => e.preventDefault(),
337
+ onDragEnter: () => {
338
+ C != null && C !== t && E(C, t);
339
+ },
340
+ children: r.body
341
+ })]
342
+ }, t);
343
+ })
344
+ });
345
+ }
346
+ //#endregion
347
+ //#region src/components/TwoDepthList.tsx
348
+ function vt({ options: e, value: t, onChange: n, maxVisible: r }) {
349
+ let i = X(null);
350
+ return je(() => {
351
+ (i.current?.querySelector("[aria-selected=\"true\"]"))?.scrollIntoView({ block: "nearest" });
352
+ }, [t]), /* @__PURE__ */ Q("div", {
353
+ ref: i,
354
+ className: "min-w-0 flex-1",
355
+ children: /* @__PURE__ */ Q(f, {
356
+ maxVisible: r,
357
+ children: e.map((e) => /* @__PURE__ */ Q(y, {
358
+ title: e.label,
359
+ selected: e.value === t,
360
+ disabled: e.disabled,
361
+ onClick: () => n?.(e.value),
362
+ "data-value": e.value
363
+ }, e.value))
364
+ })
365
+ });
366
+ }
367
+ var yt = (e, t) => {
368
+ let n = String(e).indexOf(t);
369
+ return n < 0 ? [String(e), ""] : [String(e).slice(0, n), String(e).slice(n + 1)];
370
+ };
371
+ function bt({ inputValue: e = "", separator: t = ":", showInput: n = !0, editable: r = !0, onInputChange: i, onInputApply: a, errorMessage: o = "형식이 올바르지 않습니다.", allowedChars: s = /\d/, inputPlaceholder: c = "", inputProps: l = {}, leftOptions: f = [], leftValue: p, onLeftChange: m, rightOptions: h = [], rightValue: g, onRightChange: _, maxVisible: v = 5, width: y = 160, className: b = "", ...x }) {
372
+ let S = typeof y == "number" ? `${y}px` : y, [C, w] = yt(c, t), [T, E] = Z(!1), [D, O] = Z(() => yt(e, t)), [k, A] = Z(null), j = X(null), M = X(null), N = X(null), P = X("left"), [F, I] = Z(null), [L, R] = Z(e);
373
+ e !== L && (R(e), T || (O(yt(e, t)), A(null)));
374
+ let z = (e, n) => `${e}${t}${n}`, B = (e) => (t) => {
375
+ let n = s ? Array.from(t.target.value).filter((e) => s.test(e)).join("") : t.target.value, r = e === "left" ? [n, D[1]] : [D[0], n];
376
+ P.current = e, O(r), i?.(t), k && A(null), (r[0] + r[1]).trim() !== "" && a?.(z(r[0], r[1]));
377
+ }, V = (e) => (t) => {
378
+ P.current = e, E(!0), l.onFocus?.(t), t.target.select();
379
+ }, H = (n) => {
380
+ if (l.onBlur?.(n), j.current?.contains(n.relatedTarget)) return;
381
+ E(!1);
382
+ let r = z(D[0].trim(), D[1].trim());
383
+ if (D[0].trim() === "" && D[1].trim() === "") {
384
+ O(yt(e, t)), A(null);
385
+ return;
386
+ }
387
+ let i = a ? a(r) : r;
388
+ if (i && !(typeof i == "object" && i.error)) O(yt(typeof i == "string" ? i : e, t)), A(null);
389
+ else {
390
+ let e = typeof i == "object" && !!i && i.error || P.current;
391
+ I((e === "right" ? N.current : M.current)?.getBoundingClientRect() ?? j.current?.getBoundingClientRect() ?? null), A({
392
+ side: e,
393
+ message: typeof i == "object" && !!i && i.message || o
394
+ });
395
+ }
396
+ }, U = (e) => {
397
+ l.onKeyDown?.(e), e.key === "Enter" && (e.preventDefault(), e.currentTarget.blur());
398
+ }, W = (n, i, a) => /* @__PURE__ */ Q("div", {
399
+ ref: n === "left" ? M : N,
400
+ className: "min-w-0 flex-1",
401
+ children: /* @__PURE__ */ Q(u, {
402
+ value: r ? i : yt(e, t)[n === "left" ? 0 : 1],
403
+ onChange: r ? B(n) : void 0,
404
+ readOnly: !r,
405
+ placeholder: a,
406
+ width: "100%",
407
+ inputProps: r ? {
408
+ ...l,
409
+ onFocus: V(n),
410
+ onBlur: H,
411
+ onKeyDown: U
412
+ } : l
413
+ })
414
+ });
415
+ return /* @__PURE__ */ $("div", {
416
+ style: { width: S },
417
+ className: `flex flex-col gap-spacing-1 overflow-hidden rounded-round-4 outline outline-1 outline-list-popover-outline bg-list-popover-bg shadow-[0px_2px_5px_0px_rgba(13,13,13,0.12)] ${b}`,
418
+ ...x,
419
+ children: [
420
+ n && /* @__PURE__ */ $("div", {
421
+ ref: j,
422
+ className: "flex w-full items-center gap-spacing-3 bg-list-group-bg p-spacing-5",
423
+ children: [
424
+ W("left", D[0], C),
425
+ /* @__PURE__ */ Q("span", {
426
+ className: "shrink-0 self-end pb-spacing-3 text-14 text-text-field-filled-text",
427
+ children: t
428
+ }),
429
+ W("right", D[1], w)
430
+ ]
431
+ }),
432
+ /* @__PURE__ */ $("div", {
433
+ className: "flex w-full gap-spacing-1",
434
+ children: [/* @__PURE__ */ Q(vt, {
435
+ options: f,
436
+ value: p,
437
+ onChange: m,
438
+ maxVisible: v
439
+ }), /* @__PURE__ */ Q(vt, {
440
+ options: h,
441
+ value: g,
442
+ onChange: _,
443
+ maxVisible: v
444
+ })]
445
+ }),
446
+ n && k && F && nt(/* @__PURE__ */ Q("div", {
447
+ className: "pointer-events-none z-[1000]",
448
+ style: {
449
+ position: "fixed",
450
+ top: F.bottom + 6,
451
+ left: F.left
452
+ },
453
+ children: /* @__PURE__ */ Q(d, {
454
+ variant: "error",
455
+ beak: "top",
456
+ children: k.message
457
+ })
458
+ }), document.body)
459
+ ]
460
+ });
461
+ }
462
+ //#endregion
463
+ //#region src/components/DatePicker.tsx
464
+ var xt = (e) => String(e).padStart(2, "0"), St = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Ct = (e, t) => !!e && !!t && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), wt = (e, t) => new Date(e.getFullYear(), e.getMonth() + t, 1), Tt = (e) => `${e.getFullYear()}.${xt(e.getMonth() + 1)}`, Et = [
465
+ "일",
466
+ "월",
467
+ "화",
468
+ "수",
469
+ "목",
470
+ "금",
471
+ "토"
472
+ ];
473
+ function Dt(e, t) {
474
+ let n = e.getFullYear(), r = e.getMonth(), i = (new Date(n, r, 1).getDay() - t + 7) % 7, a = new Date(n, r, 1 - i);
475
+ return Array.from({ length: 6 }, (e, t) => Array.from({ length: 7 }, (e, n) => new Date(a.getFullYear(), a.getMonth(), a.getDate() + t * 7 + n)));
476
+ }
477
+ var Ot = (e) => e.getDate() === 1 ? `${e.getMonth() + 1}.1` : e.getDate(), kt = (e) => e.getFullYear() * 12 + e.getMonth(), At = (e, t) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + t * 7), jt = (e, t) => {
478
+ let n = St(e), r = (n.getDay() - t + 7) % 7;
479
+ return new Date(n.getFullYear(), n.getMonth(), n.getDate() - r);
480
+ }, Mt = (e, t) => jt(new Date(e.getFullYear(), e.getMonth(), 1), t), Nt = 36, Pt = 12, Ft = 228, It = 20, Lt = 10, Rt = 160;
481
+ function zt(e, t) {
482
+ let n = Mt(e, t);
483
+ return Array.from({ length: 46 }, (e, t) => At(n, t - It));
484
+ }
485
+ function Bt({ anchorMonth: e, anchorKey: t, weekStartsOn: n, onVisibleMonthChange: r, renderDay: i }) {
486
+ let a = X(null), o = ke((e) => {
487
+ a.current = e;
488
+ }, []), [s, l] = Z(() => zt(e, n)), u = X(t), d = X("anchor"), f = X(!1);
489
+ return je(() => {
490
+ t !== u.current && (u.current = t, d.current = "anchor", l(zt(e, n)));
491
+ }, [
492
+ t,
493
+ e,
494
+ n
495
+ ]), Ne(() => {
496
+ let e = a.current;
497
+ e && (d.current === "anchor" ? e.scrollTop = It * Nt : d.current && (e.scrollTop += d.current), d.current = 0, f.current = !1);
498
+ }, [s]), /* @__PURE__ */ Q(c, {
499
+ maxHeight: Ft,
500
+ onViewport: o,
501
+ onScroll: () => {
502
+ let e = a.current;
503
+ if (!e) return;
504
+ let t = s[Math.min(Math.max(Math.floor((e.scrollTop - Pt + e.clientHeight / 2) / Nt), 0), s.length - 1)], n = new Date(t.getFullYear(), t.getMonth(), t.getDate() + 3), i = kt(n);
505
+ if (i !== u.current && (u.current = i, r(new Date(n.getFullYear(), n.getMonth(), 1))), f.current) return;
506
+ let o = Nt * 4;
507
+ e.scrollTop < o ? (f.current = !0, l((e) => {
508
+ let t = e[0], n = [...Array.from({ length: Lt }, (e, n) => At(t, n - Lt)), ...e];
509
+ return d.current = Lt * Nt, n.length > Rt && (n = n.slice(0, Rt)), n;
510
+ })) : e.scrollTop + e.clientHeight > e.scrollHeight - o && (f.current = !0, l((e) => {
511
+ let t = e[e.length - 1], n = [...e, ...Array.from({ length: Lt }, (e, n) => At(t, n + 1))];
512
+ if (n.length > Rt) {
513
+ let e = n.length - Rt;
514
+ n = n.slice(e), d.current = -e * Nt;
515
+ }
516
+ return n;
517
+ }));
518
+ },
519
+ className: "w-full bg-list-group-bg",
520
+ contentClassName: "flex select-none flex-col gap-spacing-6 overscroll-contain p-spacing-6",
521
+ children: s.map((e) => /* @__PURE__ */ Q("div", {
522
+ className: "flex items-center",
523
+ children: Array.from({ length: 7 }, (t, n) => i(new Date(e.getFullYear(), e.getMonth(), e.getDate() + n)))
524
+ }, e.getTime()))
525
+ });
526
+ }
527
+ function Vt({ icon: e, display: t, panelWidth: n = 160, placement: r = "auto-left", disabled: i = !1, ...a }) {
528
+ let [o, s] = Z(!1);
529
+ return /* @__PURE__ */ Q(E, {
530
+ placement: r,
531
+ menuWidth: n,
532
+ disabled: i,
533
+ open: o,
534
+ onOpenChange: s,
535
+ trigger: /* @__PURE__ */ Q(S, {
536
+ icon: e,
537
+ open: o,
538
+ disabled: i,
539
+ children: t
540
+ }),
541
+ children: /* @__PURE__ */ Q(bt, {
542
+ width: n,
543
+ ...a
544
+ })
545
+ });
546
+ }
547
+ function Ht({ label: e, value: t, onChange: n, hourOptions: r, minuteOptions: i, placement: a = "auto-right", disabled: o = !1, justify: s = "center" }) {
548
+ let [c = "00", l = "00"] = (t || "").split(":"), u = (e, t) => n?.(`${e}:${t}`);
549
+ return /* @__PURE__ */ $("div", {
550
+ className: `flex h-[44px] flex-1 items-center gap-spacing-6 bg-list-group-bg px-spacing-6 py-spacing-5 ${s === "between" ? "justify-between" : "justify-center"}`,
551
+ children: [/* @__PURE__ */ Q("span", {
552
+ className: `whitespace-nowrap text-12 ${o ? "text-font-icon-2" : "text-font-icon-5"}`,
553
+ children: e
554
+ }), /* @__PURE__ */ Q(Vt, {
555
+ disabled: o,
556
+ placement: a,
557
+ panelWidth: 140,
558
+ separator: ":",
559
+ display: `${c}:${l}`,
560
+ inputValue: `${c}:${l}`,
561
+ inputPlaceholder: "HH:MM",
562
+ onInputApply: (e) => {
563
+ let [t, r] = e.split(":"), i = Number(t), a = Number(r);
564
+ if (t.trim() === "" || Number.isNaN(i) || i > 23) return {
565
+ error: "left",
566
+ message: "시는 0~23으로 입력하세요"
567
+ };
568
+ if (r.trim() === "" || Number.isNaN(a) || a > 59) return {
569
+ error: "right",
570
+ message: "분은 0~59로 입력하세요"
571
+ };
572
+ let o = `${String(i).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
573
+ return n?.(o), o;
574
+ },
575
+ leftOptions: r,
576
+ leftValue: c,
577
+ onLeftChange: (e) => u(e, l),
578
+ rightOptions: i,
579
+ rightValue: l,
580
+ onRightChange: (e) => u(c, e),
581
+ maxVisible: 5
582
+ })]
583
+ });
584
+ }
585
+ function Ut({ mode: e = "single", value: t, defaultValue: n, onChange: r, disablePast: a = !1, disableFuture: o = !1, minDate: s, maxDate: c, disabledDate: l, month: u, defaultMonth: f, onMonthChange: p, showTime: m = !1, startTime: h = "00:00", endTime: g = "23:59", onStartTimeChange: _, onEndTimeChange: v, timeLabel: y = "시간 입력", weekStartsOn: b = 0, weekdayLabels: x = Et, todayLabel: S = "오늘", scrollNavigate: C = !0, rangeTooltip: w = !0, rangeStartLabel: T = "시작일", rangeEndLabel: E = "마감일", minYear: D, maxYear: O, width: A = 276, className: j = "", ...M }) {
586
+ let N = St(/* @__PURE__ */ new Date()), P = e === "range", F = t !== void 0, [I, L] = Z(n ?? (P ? {
587
+ start: null,
588
+ end: null
589
+ } : null)), R = F ? t : I, z = P ? R ?? {
590
+ start: null,
591
+ end: null
592
+ } : null, B = P ? null : R ?? null, [V, H] = Z(null), U = P && w, W = (e) => {
593
+ F || L(e), r?.(e);
594
+ }, G = f ?? (P ? z?.start : B) ?? N, [K, ee] = Z(() => St(G)), q = u ?? K, J = (e) => {
595
+ u === void 0 && ee(e), p?.(e);
596
+ }, Y = (e) => {
597
+ let t = St(e);
598
+ return a && t < N || o && t > N || s && t < St(s) || c && t > St(c) ? !0 : !!l && !!l(t);
599
+ }, te = X("start"), ne = (e) => {
600
+ let { start: t, end: n } = z;
601
+ return t ? n ? e < t ? {
602
+ start: e,
603
+ end: n
604
+ } : e > n ? {
605
+ start: t,
606
+ end: e
607
+ } : te.current === "start" ? {
608
+ start: e,
609
+ end: n
610
+ } : {
611
+ start: t,
612
+ end: e
613
+ } : e < t ? {
614
+ start: e,
615
+ end: null
616
+ } : {
617
+ start: t,
618
+ end: e
619
+ } : {
620
+ start: e,
621
+ end: null
622
+ };
623
+ }, re = (e) => {
624
+ if (Y(e)) return;
625
+ let t = St(e);
626
+ if (!P) {
627
+ W(t);
628
+ return;
629
+ }
630
+ let { start: n, end: r } = z, i = !!(n && r) && t >= n && t <= r;
631
+ W(ne(t)), te.current = i && te.current === "start" ? "end" : "start";
632
+ }, ie = (e, t = z) => {
633
+ let n = St(e), { start: r, end: i } = t;
634
+ return r ? i ? n < r ? "start" : n > i ? "end" : te.current : n < r ? "start" : "end" : "start";
635
+ }, ae = (e) => {
636
+ if (Y(e)) return "muted";
637
+ if (P) {
638
+ let { start: t, end: n } = z, r = Ct(e, t), i = Ct(e, n);
639
+ if (r && i) return "selected";
640
+ if (r) return n ? "range-start" : "selected";
641
+ if (i) return "range-end";
642
+ if (t && n && e > t && e < n) return "in-range";
643
+ } else if (Ct(e, B)) return "selected";
644
+ return Ct(e, N) ? "today" : kt(e) === kt(q) ? "default" : "muted";
645
+ }, oe = q.getFullYear(), se = Math.min(D ?? oe - 12, oe), ce = Math.max(O ?? oe + 12, oe), le = Array.from({ length: ce - se + 1 }, (e, t) => ({
646
+ value: String(se + t),
647
+ label: `${se + t}년`
648
+ })), ue = Array.from({ length: 12 }, (e, t) => ({
649
+ value: String(t + 1),
650
+ label: `${t + 1}월`
651
+ })), de = Array.from({ length: 24 }, (e, t) => ({
652
+ value: xt(t),
653
+ label: `${xt(t)}시`
654
+ })), fe = Array.from({ length: 60 }, (e, t) => ({
655
+ value: xt(t),
656
+ label: `${xt(t)}분`
657
+ })), pe = x.map((e, t) => x[(t + b) % 7]), me = typeof A == "number" ? `${A}px` : A, he = (e) => {
658
+ let t = Y(e), n = U && !t, r = (e.getDay() - b + 7) % 7, i = r === 0 ? "left" : r === 6 ? "right" : void 0;
659
+ return /* @__PURE__ */ Q(dt, {
660
+ state: ae(e),
661
+ edge: i,
662
+ disabled: t,
663
+ onClick: (r) => {
664
+ let i = n && !t ? ne(St(e)) : null;
665
+ re(e), i && H({
666
+ rect: r.currentTarget.getBoundingClientRect(),
667
+ label: ie(e, i) === "start" ? T : E
668
+ });
669
+ },
670
+ onMouseEnter: n ? (t) => H({
671
+ rect: t.currentTarget.getBoundingClientRect(),
672
+ label: ie(e) === "start" ? T : E
673
+ }) : void 0,
674
+ onMouseLeave: n ? () => H(null) : void 0,
675
+ children: Ot(e)
676
+ }, e.toISOString());
677
+ };
678
+ return /* @__PURE__ */ $("div", {
679
+ style: { width: me },
680
+ className: `flex flex-col gap-spacing-1 overflow-hidden rounded-round-4 outline outline-1 outline-list-popover-outline bg-list-popover-bg shadow-[0px_2px_5px_0px_rgba(13,13,13,0.12)] ${j}`,
681
+ ...M,
682
+ children: [
683
+ /* @__PURE__ */ $("div", {
684
+ className: "flex w-full flex-col gap-spacing-5 bg-list-group-bg p-spacing-6",
685
+ children: [/* @__PURE__ */ $("div", {
686
+ className: "flex h-[32px] items-center justify-between pl-spacing-5",
687
+ children: [/* @__PURE__ */ Q(Vt, {
688
+ icon: Fe,
689
+ separator: ".",
690
+ display: Tt(q),
691
+ inputValue: Tt(q),
692
+ inputPlaceholder: "YYYY.MM",
693
+ onInputApply: (e) => {
694
+ let [t, n] = e.split(".");
695
+ if (!/^(\d{2}|\d{4})$/.test(t.trim())) return {
696
+ error: "left",
697
+ message: "연도는 YYYY 형식으로 입력하세요 (예: 2026 · 26)"
698
+ };
699
+ let r = Number(n);
700
+ if (n.trim() === "" || Number.isNaN(r) || r < 1 || r > 12) return {
701
+ error: "right",
702
+ message: "월은 1~12로 입력하세요"
703
+ };
704
+ let i = t.trim().length === 2 ? 2e3 + Number(t) : Number(t), a = new Date(i, r - 1, 1);
705
+ return J(a), Tt(a);
706
+ },
707
+ leftOptions: le,
708
+ leftValue: String(oe),
709
+ onLeftChange: (e) => J(new Date(Number(e), q.getMonth(), 1)),
710
+ rightOptions: ue,
711
+ rightValue: String(q.getMonth() + 1),
712
+ onRightChange: (e) => J(new Date(oe, Number(e) - 1, 1)),
713
+ maxVisible: 5
714
+ }), /* @__PURE__ */ $(k, {
715
+ gap: "3",
716
+ className: "shrink-0",
717
+ children: [
718
+ /* @__PURE__ */ Q(i, {
719
+ variant: "ghost",
720
+ size: "24",
721
+ icon: Le,
722
+ "aria-label": "이전 달",
723
+ onClick: () => J(wt(q, -1))
724
+ }),
725
+ /* @__PURE__ */ Q(i, {
726
+ variant: "ghost",
727
+ size: "24",
728
+ onClick: () => J(St(/* @__PURE__ */ new Date())),
729
+ children: S
730
+ }),
731
+ /* @__PURE__ */ Q(i, {
732
+ variant: "ghost",
733
+ size: "24",
734
+ icon: Re,
735
+ "aria-label": "다음 달",
736
+ onClick: () => J(wt(q, 1))
737
+ })
738
+ ]
739
+ })]
740
+ }), /* @__PURE__ */ Q("div", {
741
+ className: "flex items-center",
742
+ children: pe.map((e) => /* @__PURE__ */ Q("div", {
743
+ className: "flex h-[24px] w-[36px] items-center justify-center",
744
+ children: /* @__PURE__ */ Q("span", {
745
+ className: "text-12 text-font-icon-5",
746
+ children: e
747
+ })
748
+ }, e))
749
+ })]
750
+ }),
751
+ C ? /* @__PURE__ */ Q(Bt, {
752
+ anchorMonth: q,
753
+ anchorKey: kt(q),
754
+ weekStartsOn: b,
755
+ onVisibleMonthChange: J,
756
+ renderDay: he
757
+ }) : /* @__PURE__ */ Q("div", {
758
+ className: "flex w-full flex-col gap-spacing-6 bg-list-group-bg p-spacing-6",
759
+ children: Dt(q, b).map((e, t) => /* @__PURE__ */ Q("div", {
760
+ className: "flex items-center",
761
+ children: e.map((e) => he(e))
762
+ }, t))
763
+ }),
764
+ m && (P ? /* @__PURE__ */ $("div", {
765
+ className: "flex w-full gap-spacing-1",
766
+ children: [/* @__PURE__ */ Q(Ht, {
767
+ label: "시작 시간",
768
+ value: h,
769
+ onChange: _,
770
+ hourOptions: de,
771
+ minuteOptions: fe,
772
+ disabled: !z?.start
773
+ }), /* @__PURE__ */ Q(Ht, {
774
+ label: "마감 시간",
775
+ value: g,
776
+ onChange: v,
777
+ hourOptions: de,
778
+ minuteOptions: fe,
779
+ disabled: !z?.end
780
+ })]
781
+ }) : /* @__PURE__ */ Q("div", {
782
+ className: "flex w-full gap-spacing-1",
783
+ children: /* @__PURE__ */ Q(Ht, {
784
+ label: y,
785
+ justify: "between",
786
+ value: h,
787
+ onChange: _,
788
+ hourOptions: de,
789
+ minuteOptions: fe,
790
+ disabled: !B
791
+ })
792
+ })),
793
+ U && V && nt(/* @__PURE__ */ Q("div", {
794
+ className: "pointer-events-none z-[1000]",
795
+ style: {
796
+ position: "fixed",
797
+ left: V.rect.left + V.rect.width / 2,
798
+ top: V.rect.top - 6,
799
+ transform: "translate(-50%, -100%)"
800
+ },
801
+ children: /* @__PURE__ */ Q(d, {
802
+ variant: "normal",
803
+ beak: "none",
804
+ children: V.label
805
+ })
806
+ }), document.body)
807
+ ]
808
+ });
809
+ }
810
+ //#endregion
811
+ //#region src/utils/datetime.ts
812
+ var Wt = (e) => String(e).padStart(2, "0"), Gt = (e) => e ? typeof e == "string" ? e : `${Wt(e.getHours())}:${Wt(e.getMinutes())}` : "";
813
+ function Kt(e) {
814
+ return e ? `${Wt(e.getFullYear() % 100)}.${Wt(e.getMonth() + 1)}.${Wt(e.getDate())}` : "";
815
+ }
816
+ function qt(e, t) {
817
+ if (!e) return "";
818
+ let n = Gt(t);
819
+ return n ? `${Kt(e)} (${n})` : Kt(e);
820
+ }
821
+ function Jt(e, t, n, r, { emptyStartLabel: i = "시작일 없음", emptyEndLabel: a = "마감일 없음" } = {}) {
822
+ let o = qt(e, t), s = qt(n, r);
823
+ return e && n ? `${o}~${s}` : e ? `${o} ~ ${a}` : n ? `${i} ~ ${s}` : "";
824
+ }
825
+ //#endregion
826
+ //#region src/components/DateField.tsx
827
+ var Yt = "ring-inset ring-text-field-hover-line hover:ring-2 focus-within:ring-2 focus-within:ring-text-field-focused-line", Xt = (e) => String(e).padStart(2, "0"), Zt = /[\d.\-/:~() ]/;
828
+ function Qt(e) {
829
+ let t = e.trim(), n = t.match(/^(\d{2}|\d{4})\D+(\d{1,2})\D+(\d{1,2})$/), r = t.match(/^(\d{4})(\d{2})(\d{2})$/), i = t.match(/^(\d{2})(\d{2})(\d{2})$/), a = t.match(/^(\d{2})(\d{2})$/), o, s, c;
830
+ if (n) o = n[1].length === 2 ? 2e3 + Number(n[1]) : Number(n[1]), s = Number(n[2]), c = Number(n[3]);
831
+ else if (r) o = Number(r[1]), s = Number(r[2]), c = Number(r[3]);
832
+ else if (i) o = 2e3 + Number(i[1]), s = Number(i[2]), c = Number(i[3]);
833
+ else if (a) o = (/* @__PURE__ */ new Date()).getFullYear(), s = Number(a[1]), c = Number(a[2]);
834
+ else return null;
835
+ if (s < 1 || s > 12 || c < 1 || c > 31) return null;
836
+ let l = new Date(o, s - 1, c);
837
+ return l.getMonth() !== s - 1 || l.getDate() !== c ? null : l;
838
+ }
839
+ function $t(e) {
840
+ let t = e.trim(), n = t.match(/^(\d{1,2}):(\d{1,2})$/), r = t.match(/^(\d{2})(\d{1,2})$/), i = n || r;
841
+ if (!i) return null;
842
+ let a = Number(i[1]), o = Number(i[2]);
843
+ return a > 23 || o > 59 ? null : `${Xt(a)}:${Xt(o)}`;
844
+ }
845
+ function en(e) {
846
+ let t = (e ?? "").trim();
847
+ if (t === "" || t === "마감일 없음" || t === "시작일 없음") return "empty";
848
+ let n = null, r = t.match(/\(([^)]*)\)\s*$/);
849
+ if (r) n = r[1].trim(), t = t.slice(0, r.index).trim();
850
+ else {
851
+ let e = t.match(/^(.*\S)\s+([\d:]+)$/);
852
+ e && (t = e[1].trim(), n = e[2]);
853
+ }
854
+ let i = Qt(t);
855
+ if (!i) return null;
856
+ let a = null;
857
+ return n && (a = $t(n), !a) ? null : {
858
+ date: i,
859
+ time: a
860
+ };
861
+ }
862
+ function tn(e, t) {
863
+ let n = e.trim();
864
+ if (!t) {
865
+ if (n === "") return { value: null };
866
+ let e = en(n);
867
+ return e === null ? null : e === "empty" ? { value: null } : {
868
+ value: e.date,
869
+ startTime: e.time
870
+ };
871
+ }
872
+ if (n === "") return { value: {
873
+ start: null,
874
+ end: null
875
+ } };
876
+ let r = n.indexOf("~"), i = r >= 0 ? n.slice(0, r) : n, a = r >= 0 ? n.slice(r + 1) : "", o = en(i), s = en(a);
877
+ return o === null || s === null ? null : {
878
+ value: {
879
+ start: o === "empty" ? null : o.date,
880
+ end: s === "empty" ? null : s.date
881
+ },
882
+ startTime: o === "empty" ? null : o.time,
883
+ endTime: s === "empty" ? null : s.time
884
+ };
885
+ }
886
+ function nn({ mode: e = "single", value: t, defaultValue: n, onChange: r, showTime: i = !1, startTime: a, defaultStartTime: o = "00:00", onStartTimeChange: s, endTime: c, defaultEndTime: l = "23:59", onEndTimeChange: u, placeholder: f = "날짜를 선택하세요", disabled: p = !1, readOnly: m = !1, error: h = !1, errorMessage: g = "", formatErrorMessage: _ = "날짜 형식이 올바르지 않습니다.", closeOnSelect: v = e !== "range", width: y, className: b = "", disablePast: x, disableFuture: S, minDate: C, maxDate: w, disabledDate: T, weekStartsOn: D, minYear: O, maxYear: k, ...A }) {
887
+ let j = e === "range", M = !p && !m, [N, P] = Z(!1), [F, I] = Z(!1), [L, R] = Z(""), [z, B] = Z(!1), V = X(!1), H = X(null), [U, W] = Z(null), G = t !== void 0, [K, ee] = Z(n ?? (j ? {
888
+ start: null,
889
+ end: null
890
+ } : null)), q = t === void 0 ? K : t, J = (e) => {
891
+ G || ee(e), r?.(e), B(!1);
892
+ }, Y = a !== void 0, [te, ne] = Z(o), re = a === void 0 ? te : a, ie = (e) => {
893
+ Y || ne(e), s?.(e);
894
+ }, ae = c !== void 0, [oe, se] = Z(l), ce = c === void 0 ? oe : c, le = (e) => {
895
+ ae || se(e), u?.(e);
896
+ }, ue = j ? Jt(q?.start, i ? re : void 0, q?.end, i ? ce : void 0) : qt(q, i ? re : void 0), de = !ue, fe = (e) => {
897
+ J(e), v && !i && (j ? e?.start && e?.end && P(!1) : P(!1));
898
+ }, pe = (e) => {
899
+ let t = tn(e, j);
900
+ if (!t) {
901
+ B(!0);
902
+ return;
903
+ }
904
+ B(!1), J(t.value), i && (t.startTime != null && ie(t.startTime), t.endTime != null && le(t.endTime));
905
+ }, me = p ? "text-text-field-disabled-text" : m ? "text-text-field-readonly-text" : "text-text-field-filled-text", he = p ? "text-text-field-disabled-icon" : m ? "text-text-field-readonly-icon" : de ? "text-text-field-default-text" : "text-font-icon-5", ge = h || z, _e = z ? _ : g, ve = y ?? (i ? 260 : 180), ye = ve === "hug", be = ve === "fill", xe = ye || be ? void 0 : typeof ve == "number" ? `${ve}px` : ve, Se = F ? L : ue, Ce = Math.max(Array.from(Se || f).reduce((e, t) => {
906
+ let n = t.charCodeAt(0);
907
+ return e + (n >= 4352 && n <= 4607 || n >= 12288 && n <= 40959 || n >= 44032 && n <= 55295 || n >= 65280 && n <= 65519 ? 2 : 1);
908
+ }, 1), 1), we = /* @__PURE__ */ $("div", {
909
+ className: `relative ${be ? "w-full" : ye ? "w-fit" : ""}`,
910
+ style: xe ? { width: xe } : void 0,
911
+ children: [
912
+ /* @__PURE__ */ $("div", {
913
+ className: `group flex min-h-[32px] ${ye ? "w-fit" : "w-full"} items-center gap-spacing-3 rounded-round-4 bg-text-field-default-bg px-spacing-6 py-spacing-3 transition-shadow ${M ? `cursor-text ${Yt}` : p ? "cursor-not-allowed" : "cursor-default"}`,
914
+ children: [/* @__PURE__ */ Q(Fe, {
915
+ size: 16,
916
+ strokeWidth: 1.8,
917
+ className: `shrink-0 ${he}`
918
+ }), /* @__PURE__ */ Q("input", {
919
+ ref: H,
920
+ type: "text",
921
+ value: F ? L : ue,
922
+ placeholder: f,
923
+ readOnly: !M,
924
+ disabled: p,
925
+ size: ye ? Ce : void 0,
926
+ "aria-invalid": ge || void 0,
927
+ onClick: (e) => e.stopPropagation(),
928
+ onMouseEnter: (e) => {
929
+ let t = e.currentTarget;
930
+ !F && ue && t.scrollWidth > t.clientWidth + 1 && W(t.getBoundingClientRect());
931
+ },
932
+ onMouseLeave: () => W(null),
933
+ onFocus: (e) => {
934
+ M && (I(!0), B(!1), W(null), R(ue), P(!0), e.target.select());
935
+ },
936
+ onChange: (e) => {
937
+ R(Array.from(e.target.value).filter((e) => Zt.test(e)).join("")), z && B(!1);
938
+ },
939
+ onBlur: () => {
940
+ if (M) {
941
+ if (I(!1), V.current) {
942
+ V.current = !1;
943
+ return;
944
+ }
945
+ pe(L);
946
+ }
947
+ },
948
+ onKeyDown: (e) => {
949
+ M && (e.key === "Enter" ? (e.preventDefault(), pe(L), P(!1), V.current = !0, e.currentTarget.blur()) : e.key === "Escape" && (R(ue), B(!1), P(!1), V.current = !0, e.currentTarget.blur()));
950
+ },
951
+ className: `bg-transparent text-14 outline-none placeholder:text-text-field-default-text disabled:cursor-not-allowed read-only:cursor-pointer ${me} ${ye ? "w-auto" : "min-w-0 flex-1 text-ellipsis"}`
952
+ })]
953
+ }),
954
+ ge && _e && !N && /* @__PURE__ */ Q("div", {
955
+ className: "absolute left-0 top-full z-10 mt-spacing-2",
956
+ children: /* @__PURE__ */ Q(d, {
957
+ variant: "error",
958
+ beak: "top",
959
+ children: _e
960
+ })
961
+ }),
962
+ U && !F && nt(/* @__PURE__ */ Q("div", {
963
+ className: "pointer-events-none z-[1000]",
964
+ style: {
965
+ position: "fixed",
966
+ left: U.left,
967
+ top: U.top > 40 ? U.top - 6 : U.bottom + 6,
968
+ transform: U.top > 40 ? "translateY(-100%)" : void 0
969
+ },
970
+ children: /* @__PURE__ */ Q(d, {
971
+ variant: "normal",
972
+ beak: "none",
973
+ children: ue
974
+ })
975
+ }), document.body)
976
+ ]
977
+ });
978
+ return /* @__PURE__ */ Q(E, {
979
+ open: N,
980
+ onOpenChange: (e) => {
981
+ P(e), !e && H.current && document.activeElement === H.current && (R(ue), B(!1), V.current = !0, H.current.blur());
982
+ },
983
+ disabled: !M,
984
+ placement: "auto",
985
+ menuWidth: 276,
986
+ trigger: we,
987
+ className: `${be ? "w-full" : ""} ${b}`,
988
+ ...A,
989
+ children: () => /* @__PURE__ */ Q(Ut, {
990
+ mode: e,
991
+ value: q,
992
+ onChange: fe,
993
+ showTime: i,
994
+ startTime: re,
995
+ onStartTimeChange: ie,
996
+ endTime: ce,
997
+ onEndTimeChange: le,
998
+ disablePast: x,
999
+ disableFuture: S,
1000
+ minDate: C,
1001
+ maxDate: w,
1002
+ disabledDate: T,
1003
+ weekStartsOn: D,
1004
+ minYear: O,
1005
+ maxYear: k
1006
+ })
1007
+ });
1008
+ }
1009
+ //#endregion
1010
+ //#region src/components/ErrorBoundary.tsx
1011
+ var rn = class extends Ce {
1012
+ constructor(e) {
1013
+ super(e), this.state = {
1014
+ error: null,
1015
+ prevResetKey: e.resetKey
1016
+ }, this.reset = this.reset.bind(this);
1017
+ }
1018
+ static getDerivedStateFromError(e) {
1019
+ return { error: e };
1020
+ }
1021
+ static getDerivedStateFromProps(e, t) {
1022
+ return e.resetKey === t.prevResetKey ? null : {
1023
+ error: null,
1024
+ prevResetKey: e.resetKey
1025
+ };
1026
+ }
1027
+ componentDidCatch(e, t) {
1028
+ console.error("[ErrorBoundary]", e, t), this.props.onError?.(e, t);
1029
+ }
1030
+ reset() {
1031
+ this.setState({ error: null });
1032
+ }
1033
+ render() {
1034
+ let { error: e } = this.state, { children: t, title: n = "페이지를 표시할 수 없습니다.", description: r = "이 페이지를 렌더하는 중 오류가 발생했습니다. 다른 메뉴는 정상적으로 이용할 수 있습니다.", fallback: a } = this.props;
1035
+ return e ? a ? a({
1036
+ error: e,
1037
+ reset: this.reset
1038
+ }) : /* @__PURE__ */ $("div", {
1039
+ className: "px-spacing-7 py-spacing-10 text-left",
1040
+ children: [
1041
+ /* @__PURE__ */ Q("h2", {
1042
+ className: "text-16 font-semibold text-font-icon-5",
1043
+ children: n
1044
+ }),
1045
+ /* @__PURE__ */ Q("p", {
1046
+ className: "mt-spacing-3 text-14 text-font-icon-3",
1047
+ children: r
1048
+ }),
1049
+ /* @__PURE__ */ Q("pre", {
1050
+ className: "mt-spacing-6 overflow-auto whitespace-pre-wrap rounded-round-4 border border-gray-200 bg-gray-50 px-spacing-6 py-spacing-5 font-mono text-12 text-font-icon-4",
1051
+ children: String(e?.message || e)
1052
+ }),
1053
+ /* @__PURE__ */ Q("div", {
1054
+ className: "mt-spacing-6",
1055
+ children: /* @__PURE__ */ Q(i, {
1056
+ variant: "line",
1057
+ size: "32",
1058
+ onClick: this.reset,
1059
+ children: "다시 시도"
1060
+ })
1061
+ })
1062
+ ]
1063
+ }) : t;
1064
+ }
1065
+ }, an = {
1066
+ 12: "text-12",
1067
+ 13: "text-13",
1068
+ 14: "text-14",
1069
+ 15: "text-15",
1070
+ 16: "text-16"
1071
+ };
1072
+ function on({ children: e, htmlFor: t, size: n = "14", required: r = !1, disabled: i = !1, className: a = "", ...o }) {
1073
+ let s = i ? "text-label-field-disabled-text" : "text-label-field-default-text";
1074
+ return /* @__PURE__ */ $("label", {
1075
+ htmlFor: t,
1076
+ className: `inline-flex items-center gap-spacing-3 font-pretendard font-normal ${an[n]} ${s} ${a}`,
1077
+ ...o,
1078
+ children: [e, r && /* @__PURE__ */ Q("span", {
1079
+ className: "h-spacing-4 w-spacing-4 shrink-0 rounded-round-00 bg-label-field-required-mark",
1080
+ "aria-hidden": "true"
1081
+ })]
1082
+ });
1083
+ }
1084
+ //#endregion
1085
+ //#region src/components/Field.tsx
1086
+ var sn = {
1087
+ "spacing-2": "gap-spacing-2",
1088
+ "spacing-3": "gap-spacing-3",
1089
+ "spacing-5": "gap-spacing-5",
1090
+ "spacing-6": "gap-spacing-6",
1091
+ "spacing-7": "gap-spacing-7"
1092
+ }, cn = {
1093
+ vertical: "spacing-3",
1094
+ horizontal: "spacing-6"
1095
+ };
1096
+ function ln({ label: e, htmlFor: t, required: n = !1, disabled: r = !1, description: i, direction: a = "vertical", controlsDirection: o = "column", labelWidth: s, labelSize: c, gap: l, className: u = "", children: d, ...f }) {
1097
+ let p = a === "horizontal", m = o === "row", h = c ?? "14", g = sn[l ?? cn[p ? "horizontal" : "vertical"]], _ = p ? `flex flex-row items-start ${g}` : `flex flex-col ${g}`, v = p && s != null ? { width: typeof s == "number" ? `${s}px` : s } : void 0;
1098
+ return /* @__PURE__ */ $("div", {
1099
+ className: `${_} ${u}`,
1100
+ ...f,
1101
+ children: [e != null && /* @__PURE__ */ Q("div", {
1102
+ style: v,
1103
+ className: p ? "shrink-0 pt-spacing-3" : void 0,
1104
+ children: /* @__PURE__ */ Q(on, {
1105
+ htmlFor: t,
1106
+ size: h,
1107
+ required: n,
1108
+ disabled: r,
1109
+ children: e
1110
+ })
1111
+ }), /* @__PURE__ */ $("div", {
1112
+ className: `flex min-w-0 flex-col gap-spacing-3 ${p ? "flex-1" : ""}`,
1113
+ children: [m ? /* @__PURE__ */ Q("div", {
1114
+ className: "flex flex-row items-start gap-spacing-5",
1115
+ children: Se.toArray(d).map((e) => /* @__PURE__ */ Q("div", {
1116
+ className: "min-w-0 flex-1",
1117
+ children: e
1118
+ }, e.key))
1119
+ }) : /* @__PURE__ */ Q("div", {
1120
+ className: "flex flex-col gap-spacing-5",
1121
+ children: d
1122
+ }), i != null && /* @__PURE__ */ Q("p", {
1123
+ className: "text-12 text-label-field-helper-text",
1124
+ children: i
1125
+ })]
1126
+ })]
1127
+ });
1128
+ }
1129
+ //#endregion
1130
+ //#region src/components/FileUploadMenu.tsx
1131
+ function un({ files: e = [], guide: t, maxCount: n = 5, accept: r, multiple: i = !0, onAdd: a, onDelete: o, findText: s = "파일 찾기", maxText: c, width: l = 420, className: u = "", ...d }) {
1132
+ let p = X(null), m = e.length >= n, h = () => p.current?.click(), g = (e) => {
1133
+ e.target.files?.length && a?.(e.target.files), e.target.value = "";
1134
+ }, _ = (e) => typeof e == "number" ? `${e}MB - ` : e ? `${e} - ` : "";
1135
+ return /* @__PURE__ */ $(N, {
1136
+ width: l,
1137
+ className: u,
1138
+ footer: !0,
1139
+ footerButtonsFill: !0,
1140
+ showCancel: !1,
1141
+ confirmText: m ? c ?? `최대 ${n}개까지 업로드할 수 있습니다` : s,
1142
+ confirmDisabled: m,
1143
+ onConfirm: h,
1144
+ ...d,
1145
+ children: [
1146
+ t != null && /* @__PURE__ */ Q("div", {
1147
+ className: "bg-list-group-bg px-spacing-6 py-spacing-5",
1148
+ children: /* @__PURE__ */ Q("p", {
1149
+ className: "whitespace-pre-line text-14 text-list-default-text",
1150
+ children: t
1151
+ })
1152
+ }),
1153
+ e.length > 0 && /* @__PURE__ */ Q(f, { children: e.map((e, t) => /* @__PURE__ */ Q(y, {
1154
+ title: `${_(e.size)}${e.name}`,
1155
+ rightButton: !0,
1156
+ rightButtonIcon: $e,
1157
+ rightButtonAriaLabel: "삭제",
1158
+ onButtonClick: () => o?.(e, t)
1159
+ }, e.id ?? `${e.name}-${t}`)) }),
1160
+ /* @__PURE__ */ Q("input", {
1161
+ ref: p,
1162
+ type: "file",
1163
+ accept: r,
1164
+ multiple: i,
1165
+ hidden: !0,
1166
+ onChange: g
1167
+ })
1168
+ ]
1169
+ });
1170
+ }
1171
+ //#endregion
1172
+ //#region src/components/FileUploadButton.tsx
1173
+ function dn({ files: e = [], triggerText: t = "파일 업로드", countSuffix: n = "개 등록됨", showCount: r = !0, buttonProps: a = {}, placement: o = "bottom-left", menuWidth: s = 420, open: c, onOpenChange: l, disabled: u = !1, className: d = "", ...f }) {
1174
+ let p = e.length, m = r && p > 0 ? `${t} (${p}${n})` : t, { leftIcon: h = et, variant: g = "line", ..._ } = a;
1175
+ return /* @__PURE__ */ Q(E, {
1176
+ placement: o,
1177
+ menuWidth: s,
1178
+ open: c,
1179
+ onOpenChange: l,
1180
+ disabled: u,
1181
+ className: d,
1182
+ trigger: /* @__PURE__ */ Q(i, {
1183
+ variant: g,
1184
+ leftIcon: h,
1185
+ disabled: u,
1186
+ ..._,
1187
+ children: m
1188
+ }),
1189
+ children: /* @__PURE__ */ Q(un, {
1190
+ files: e,
1191
+ width: "100%",
1192
+ ...f
1193
+ })
1194
+ });
1195
+ }
1196
+ //#endregion
1197
+ //#region src/components/FormTemplate.tsx
1198
+ var fn = {
1199
+ 16: "gap-x-spacing-7",
1200
+ 20: "gap-x-spacing-8",
1201
+ 24: "gap-x-spacing-9",
1202
+ 28: "gap-x-spacing-10",
1203
+ 32: "gap-x-spacing-11"
1204
+ }, pn = {
1205
+ 16: "gap-y-spacing-7",
1206
+ 20: "gap-y-spacing-8",
1207
+ 24: "gap-y-spacing-9",
1208
+ 28: "gap-y-spacing-10",
1209
+ 32: "gap-y-spacing-11"
1210
+ };
1211
+ function mn({ fields: e = [], columns: t = 1, columnGap: n = 16, rowGap: r = 16, labelSize: i, className: a = "", ...o }) {
1212
+ let s = 12 / Math.min(Math.max(t, 1), 3);
1213
+ return /* @__PURE__ */ Q("div", {
1214
+ className: `grid grid-cols-12 ${fn[n] ?? fn[16]} ${pn[r] ?? pn[16]} ${a}`,
1215
+ ...o,
1216
+ children: e.map((e) => {
1217
+ let t = Math.min(Math.max(e.span ?? s, 1), 12);
1218
+ return /* @__PURE__ */ Q("div", {
1219
+ style: { gridColumn: `span ${t} / span ${t}` },
1220
+ children: /* @__PURE__ */ Q(ln, {
1221
+ label: e.label,
1222
+ required: e.required,
1223
+ disabled: e.disabled,
1224
+ description: e.description,
1225
+ ...i ? { labelSize: i } : {},
1226
+ children: e.control
1227
+ })
1228
+ }, e.key);
1229
+ })
1230
+ });
1231
+ }
1232
+ //#endregion
1233
+ //#region src/components/ImageUploadMenu.tsx
1234
+ function hn({ image: e, guide: t, accept: n, onSelect: r, onRemove: i, findText: a = "파일 찾기", removeText: o = "파일 삭제", imageAlt: s = "업로드 이미지 미리보기", width: c = 320, className: l = "", ...u }) {
1235
+ let d = X(null), f = () => d.current?.click(), p = (e) => {
1236
+ e.target.files?.[0] && r?.(e.target.files[0]), e.target.value = "";
1237
+ };
1238
+ return /* @__PURE__ */ $(N, {
1239
+ width: c,
1240
+ className: l,
1241
+ footer: !0,
1242
+ footerButtonsFill: !0,
1243
+ showCancel: !!e,
1244
+ cancelText: o,
1245
+ onCancel: i,
1246
+ confirmText: a,
1247
+ onConfirm: f,
1248
+ ...u,
1249
+ children: [
1250
+ t != null && /* @__PURE__ */ Q("div", {
1251
+ className: "bg-list-group-bg px-spacing-6 py-spacing-5",
1252
+ children: /* @__PURE__ */ Q("p", {
1253
+ className: "whitespace-pre-line text-14 text-list-default-text",
1254
+ children: t
1255
+ })
1256
+ }),
1257
+ e && /* @__PURE__ */ Q("div", {
1258
+ className: "bg-list-group-bg p-spacing-5",
1259
+ children: /* @__PURE__ */ Q("div", {
1260
+ className: "flex max-h-[360px] w-full items-center overflow-hidden rounded-round-4",
1261
+ children: /* @__PURE__ */ Q("img", {
1262
+ src: e,
1263
+ alt: s,
1264
+ className: "block w-full shrink-0"
1265
+ })
1266
+ })
1267
+ }),
1268
+ /* @__PURE__ */ Q("input", {
1269
+ ref: d,
1270
+ type: "file",
1271
+ accept: n,
1272
+ hidden: !0,
1273
+ onChange: p
1274
+ })
1275
+ ]
1276
+ });
1277
+ }
1278
+ //#endregion
1279
+ //#region src/components/ImageUploadButton.tsx
1280
+ function gn({ triggerText: e = "이미지 등록", buttonProps: t = {}, placement: n = "bottom-left", menuWidth: r = 320, open: a, onOpenChange: o, disabled: s = !1, className: c = "", ...l }) {
1281
+ let { leftIcon: u = Ke, variant: d = "line", ...f } = t;
1282
+ return /* @__PURE__ */ Q(E, {
1283
+ placement: n,
1284
+ menuWidth: r,
1285
+ open: a,
1286
+ onOpenChange: o,
1287
+ disabled: s,
1288
+ className: c,
1289
+ trigger: /* @__PURE__ */ Q(i, {
1290
+ variant: d,
1291
+ leftIcon: u,
1292
+ disabled: s,
1293
+ ...f,
1294
+ children: e
1295
+ }),
1296
+ children: /* @__PURE__ */ Q(hn, {
1297
+ width: "100%",
1298
+ ...l
1299
+ })
1300
+ });
1301
+ }
1302
+ //#endregion
1303
+ //#region src/components/tableView.ts
1304
+ function _n(e, t) {
1305
+ if (e == null && t == null) return 0;
1306
+ if (e == null) return 1;
1307
+ if (t == null) return -1;
1308
+ let n = Number(e), r = Number(t);
1309
+ return !Number.isNaN(n) && !Number.isNaN(r) && e !== "" && t !== "" ? n - r : String(e).localeCompare(String(t), "ko");
1310
+ }
1311
+ function vn(e, t, n = {}) {
1312
+ return e.filter((e) => t.every((t) => {
1313
+ let r = n[t.key];
1314
+ return t.filter == null || r == null || r === "" || String(e[t.key]) === String(r);
1315
+ }));
1316
+ }
1317
+ function yn(e, t) {
1318
+ return t?.key == null ? e : [...e].sort((e, n) => {
1319
+ let r = _n(e[t.key], n[t.key]);
1320
+ return t.dir === "desc" ? -r : r;
1321
+ });
1322
+ }
1323
+ var bn = parseInt(oe["spacing-5-5"], 10);
1324
+ function xn(e = 1, { buttonSize: t = 24, gap: n = parseInt(oe["spacing-5"], 10) } = {}) {
1325
+ return bn * 2 + t * e + n * Math.max(0, e - 1);
1326
+ }
1327
+ //#endregion
1328
+ //#region src/components/Table.tsx
1329
+ var Sn = {
1330
+ left: "text-left justify-start",
1331
+ center: "text-center justify-center",
1332
+ right: "text-right justify-end"
1333
+ }, Cn = 44, wn = 40;
1334
+ function Tn({ column: e, sort: t, onSort: n }) {
1335
+ let r = e.headerMenu, a = r.icon ?? Je, o = t?.key === e.key ? t.dir : null, s = r.items ?? [];
1336
+ return /* @__PURE__ */ Q(E, {
1337
+ placement: "bottom-right",
1338
+ menuWidth: r.width ?? 120,
1339
+ trigger: /* @__PURE__ */ Q(i, {
1340
+ variant: "ghost",
1341
+ size: "24",
1342
+ icon: a,
1343
+ "aria-label": `${e.label ?? ""} 컬럼 메뉴`,
1344
+ showTooltip: !1
1345
+ }),
1346
+ children: (t) => /* @__PURE__ */ Q(N, {
1347
+ width: "100%",
1348
+ children: /* @__PURE__ */ $(f, { children: [r.sortable && [/* @__PURE__ */ Q(y, {
1349
+ title: "오름차순 정렬",
1350
+ selected: o === "asc",
1351
+ onClick: () => {
1352
+ n({
1353
+ key: e.key,
1354
+ dir: "asc"
1355
+ }), t();
1356
+ }
1357
+ }, "__asc"), /* @__PURE__ */ Q(y, {
1358
+ title: "내림차순 정렬",
1359
+ selected: o === "desc",
1360
+ onClick: () => {
1361
+ n({
1362
+ key: e.key,
1363
+ dir: "desc"
1364
+ }), t();
1365
+ }
1366
+ }, "__desc")], s.map((n, r) => /* @__PURE__ */ Q(y, {
1367
+ title: n.label,
1368
+ onClick: () => {
1369
+ n.onClick?.(e), t();
1370
+ }
1371
+ }, n.key ?? r))] })
1372
+ })
1373
+ });
1374
+ }
1375
+ function En({ columns: e = [], rows: t = [], rowKey: n = "id", selectable: r = !1, selectedIds: i, onSelectChange: a, filters: s, onFilterChange: u, sort: d, onSortChange: f, bordered: p = !1, wrap: m = !1, maxHeight: h, minHeight: _, minWidth: v, scrollX: y = !1, loading: b = !1, loadingMessage: x = "불러오는 중…", emptyMessage: S = "데이터가 없습니다.", onRowClick: C, className: w = "", ...T }) {
1376
+ let E = s !== void 0, [D, O] = Z({}), k = E ? s : D, A = (e, t) => {
1377
+ let n = {
1378
+ ...k,
1379
+ [e]: t
1380
+ };
1381
+ E || O(n), u?.(n);
1382
+ }, j = Pe(() => vn(t, e, k), [
1383
+ t,
1384
+ e,
1385
+ k
1386
+ ]), M = d !== void 0, [N, P] = Z(null), F = M ? d : N, I = (e) => {
1387
+ M || P(e), f?.(e);
1388
+ }, L = Pe(() => yn(j, F), [j, F]), R = i !== void 0, [z, B] = Z([]), V = R ? i : z, H = new Set(V), U = (e, t) => e[n] ?? t;
1389
+ import.meta.env?.DEV && r && t.length > 0 && t[0]?.[n] == null && console.warn(`[Table] selectable인데 rows에 rowKey('${n}')가 없어 인덱스로 선택을 추적합니다 — 정렬/필터 시 선택이 다른 행으로 이동합니다. 고유 키 필드를 지정하세요.`);
1390
+ let W = (e) => {
1391
+ R || B(e), a?.(e);
1392
+ }, G = L.map(U), K = L.length > 0 && G.every((e) => H.has(e)), ee = () => W(K ? [] : G), q = (e) => W(H.has(e) ? V.filter((t) => t !== e) : [...V, e]), J = e.length + +!!r, Y = h, te = Y === "fill", ne = Y != null, [re, ie] = Z(null), ae = e.some((e) => e.width == null), oe = (r ? Cn : 0) + e.reduce((e, t) => e + (t.width ?? wn), 0), se = y || v != null || ae, ce = se ? Math.max(v ?? 0, oe) : v, le = ne || se, ue = (e) => e ? "" : "border-r border-table-cell-line", de = (e) => e ? "" : "border-r border-table-header-line", fe = p ? "" : "border-b border-table-cell-line", pe = p ? { boxShadow: `inset 0 -1px 0 ${_e.outline}` } : void 0, me = (e, t) => p ? "" : `${e ? "rounded-l-round-4" : ""} ${t ? "rounded-r-round-4" : ""}`, he = (e, t, n) => ({
1393
+ className: `${de(t)} ${me(e, t)} pl-spacing-5-5 pr-spacing-4 h-[32px] align-middle`,
1394
+ style: {
1395
+ ...n ? { width: n } : null,
1396
+ ...pe
1397
+ }
1398
+ }), ge = (e, t, n) => /* @__PURE__ */ Q("th", {
1399
+ ...he(t, n, e.width),
1400
+ children: /* @__PURE__ */ $("div", {
1401
+ className: "flex items-center gap-spacing-3",
1402
+ children: [/* @__PURE__ */ Q("div", {
1403
+ className: `flex min-w-0 flex-1 items-center ${Sn[e.align] ?? Sn.left}`,
1404
+ children: e.renderHeader ? e.renderHeader() : e.filter ? (() => {
1405
+ let t = e.filter.allLabel ?? (e.label ? `${e.label} 전체` : "전체");
1406
+ return /* @__PURE__ */ Q(g, {
1407
+ variant: "text",
1408
+ size: "20",
1409
+ value: k[e.key] ?? "",
1410
+ onChange: (t) => A(e.key, t.target.value),
1411
+ options: [{
1412
+ value: "",
1413
+ label: t
1414
+ }, ...e.filter.options],
1415
+ placeholder: e.filter.placeholder ?? t
1416
+ });
1417
+ })() : /* @__PURE__ */ Q(o, {
1418
+ as: "span",
1419
+ className: "min-w-0 text-12 font-normal text-font-icon-5",
1420
+ children: e.label
1421
+ })
1422
+ }), e.headerMenu && (e.headerMenu.sortable || (e.headerMenu.items?.length ?? 0) > 0) && /* @__PURE__ */ Q("div", {
1423
+ className: "flex shrink-0 items-center",
1424
+ children: /* @__PURE__ */ Q(Tn, {
1425
+ column: e,
1426
+ sort: F,
1427
+ onSort: I
1428
+ })
1429
+ })]
1430
+ })
1431
+ }, e.key), ve = ne, ye = /* @__PURE__ */ $("colgroup", { children: [r && /* @__PURE__ */ Q("col", { style: { width: Cn } }), e.map((e) => /* @__PURE__ */ Q("col", { style: e.width ? { width: e.width } : void 0 }, e.key))] }), be = "w-full table-fixed border-separate", xe = {
1432
+ borderSpacing: 0,
1433
+ ...ce ? { minWidth: ce } : null
1434
+ }, Se = /* @__PURE__ */ Q("thead", { children: /* @__PURE__ */ $("tr", {
1435
+ className: "bg-table-header-bg",
1436
+ children: [r && /* @__PURE__ */ Q("th", {
1437
+ className: `${ue(!1)} ${me(!0, !1)} p-spacing-5 align-middle`,
1438
+ style: {
1439
+ width: Cn,
1440
+ ...pe
1441
+ },
1442
+ children: /* @__PURE__ */ Q("div", {
1443
+ className: "flex items-center justify-center",
1444
+ children: /* @__PURE__ */ Q(l, {
1445
+ checked: K,
1446
+ onChange: ee
1447
+ })
1448
+ })
1449
+ }), e.map((t, n) => ge(t, !r && n === 0, n === e.length - 1))]
1450
+ }) }), Ce = /* @__PURE__ */ Q("tbody", { children: b ? /* @__PURE__ */ Q("tr", {
1451
+ className: "bg-table-row-bg",
1452
+ children: /* @__PURE__ */ Q("td", {
1453
+ colSpan: J,
1454
+ className: `${fe} px-spacing-5-5 py-spacing-12`,
1455
+ children: /* @__PURE__ */ $("div", {
1456
+ className: "flex items-center justify-center gap-spacing-4 text-14 text-font-icon-3",
1457
+ children: [/* @__PURE__ */ Q(qe, {
1458
+ size: 16,
1459
+ strokeWidth: 1.8,
1460
+ className: "animate-spin"
1461
+ }), x]
1462
+ })
1463
+ })
1464
+ }) : L.length === 0 ? /* @__PURE__ */ Q("tr", {
1465
+ className: "bg-table-row-bg",
1466
+ children: /* @__PURE__ */ Q("td", {
1467
+ colSpan: J,
1468
+ className: `${fe} px-spacing-5-5 py-spacing-12 text-center text-14 text-font-icon-3`,
1469
+ children: S
1470
+ })
1471
+ }) : L.map((t, n) => {
1472
+ let i = U(t, n), a = n === L.length - 1, s = p || ne, c = s && a ? "" : "border-b border-table-cell-line";
1473
+ return /* @__PURE__ */ $("tr", {
1474
+ onClick: C ? () => C(t) : void 0,
1475
+ className: `bg-table-row-bg transition-colors hover:bg-table-row-hover-bg ${C ? "cursor-pointer" : ""}`,
1476
+ children: [r && /* @__PURE__ */ Q("td", {
1477
+ className: `${ue(!1)} ${c} h-[45px] px-spacing-5-5 py-spacing-4 align-middle`,
1478
+ children: /* @__PURE__ */ Q("div", {
1479
+ className: "flex items-center justify-center",
1480
+ children: /* @__PURE__ */ Q(l, {
1481
+ checked: H.has(i),
1482
+ onChange: () => q(i),
1483
+ onClick: (e) => e.stopPropagation()
1484
+ })
1485
+ })
1486
+ }), e.map((r, i) => {
1487
+ let a = r.cellSpan ? r.cellSpan(t, n, L) : 1;
1488
+ if (a === 0) return null;
1489
+ let c = n + Math.max(a, 1) - 1 >= L.length - 1, l = s && c ? "" : "border-b border-table-cell-line";
1490
+ return /* @__PURE__ */ Q("td", {
1491
+ rowSpan: a > 1 ? a : void 0,
1492
+ className: `${ue(i === e.length - 1)} ${l} h-[45px] px-spacing-5-5 py-spacing-4 align-middle`,
1493
+ children: /* @__PURE__ */ Q("div", {
1494
+ className: `flex items-center ${Sn[r.align] ?? Sn.left} min-w-0 text-14 text-font-icon-5`,
1495
+ children: r.render ? r.render(t) : m ? /* @__PURE__ */ Q("span", {
1496
+ className: "break-words",
1497
+ children: t[r.key]
1498
+ }) : /* @__PURE__ */ Q(o, {
1499
+ as: "span",
1500
+ className: "min-w-0",
1501
+ children: t[r.key]
1502
+ })
1503
+ })
1504
+ }, r.key);
1505
+ })]
1506
+ }, i);
1507
+ }) }), we = /* @__PURE__ */ $("table", {
1508
+ className: be,
1509
+ style: xe,
1510
+ children: [
1511
+ ye,
1512
+ Se,
1513
+ Ce
1514
+ ]
1515
+ }), Te = p ? "overflow-clip rounded-round-4 border border-table-outline" : ne ? "border-b border-table-cell-line" : "", Ee;
1516
+ if (ve) {
1517
+ let e = /* @__PURE__ */ $("table", {
1518
+ className: be,
1519
+ style: xe,
1520
+ children: [ye, Ce]
1521
+ }), t = !b && L.length > 0, n = te && t, r = _ ? { minHeight: typeof _ == "number" ? `${_}px` : _ } : void 0, i = t ? se ? n ? /* @__PURE__ */ Q("div", {
1522
+ ref: ie,
1523
+ className: "hide-native-scroll min-h-0 flex-1 overflow-y-auto",
1524
+ style: r,
1525
+ children: e
1526
+ }) : /* @__PURE__ */ Q("div", {
1527
+ ref: ie,
1528
+ className: "hide-native-scroll overflow-y-auto",
1529
+ style: {
1530
+ ...r,
1531
+ maxHeight: typeof Y == "number" ? `${Y}px` : Y
1532
+ },
1533
+ children: e
1534
+ }) : n ? /* @__PURE__ */ Q(c, {
1535
+ className: "min-h-0 flex-1",
1536
+ contentClassName: "max-h-full",
1537
+ style: r,
1538
+ children: e
1539
+ }) : /* @__PURE__ */ Q(c, {
1540
+ maxHeight: Y,
1541
+ style: r,
1542
+ children: e
1543
+ }) : /* @__PURE__ */ Q("div", { children: e }), a = /* @__PURE__ */ $("div", {
1544
+ className: n ? "flex min-h-0 flex-1 flex-col" : void 0,
1545
+ style: ce ? { minWidth: ce } : void 0,
1546
+ children: [/* @__PURE__ */ $("table", {
1547
+ className: `${be} shrink-0`,
1548
+ style: xe,
1549
+ children: [ye, Se]
1550
+ }), i]
1551
+ });
1552
+ Ee = se ? /* @__PURE__ */ Q(c, {
1553
+ horizontal: !0,
1554
+ vScrollEl: re,
1555
+ className: n ? "min-h-0 flex-1" : "",
1556
+ contentClassName: n ? "flex h-full min-h-0 flex-col" : "",
1557
+ children: a
1558
+ }) : a;
1559
+ } else Ee = le ? /* @__PURE__ */ Q(c, {
1560
+ maxHeight: Y,
1561
+ horizontal: se,
1562
+ children: we
1563
+ }) : we;
1564
+ return /* @__PURE__ */ Q("div", {
1565
+ className: `${Te} ${te && !b && L.length > 0 ? "flex min-h-0 flex-col" : ""} ${w}`,
1566
+ ...T,
1567
+ children: Ee
1568
+ });
1569
+ }
1570
+ //#endregion
1571
+ //#region src/components/JobPositionTemplate.tsx
1572
+ var Dn = () => `row-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 6)}`;
1573
+ function On({ criteriaOptions: e = [], valueOptions: t = {}, conditionCount: n = 4, defaultDisabledIds: r = [], multiLastValue: a = !1, defaultRows: o = [], onChange: s, step1Title: c = "1. 조건 조합 설정", step2Title: l = "2. 채용 직무 추가", addLabel: d = "추가", inputPlaceholder: f = "조건을 선택하세요", orderLabel: p = "순서", jobLabel: m = "채용 직무", manageLabel: h = "관리", tableHeight: _ = "fill", emptyMessage: v = "추가된 채용 직무가 없습니다.", duplicateMessage: y = "이미 추가된 조건 조합입니다.", emptyValueMessage: b = "값을 선택하세요.", ref: x, className: S = "", ...C }) {
1574
+ let T = Array.from({ length: n }, (e, t) => `cond-${t + 1}`), [E, D] = Z(T), [O, k] = Z(() => T.filter((e) => !r.includes(e))), [A, j] = Z({}), M = [...E.filter((e) => T.includes(e)), ...T.filter((e) => !E.includes(e))], N = M.filter((e) => O.includes(e)), P = N[N.length - 1], F = (e, t) => j((n) => ({
1575
+ ...n,
1576
+ [e]: {
1577
+ criteria: t,
1578
+ value: ""
1579
+ }
1580
+ })), I = (e, t) => j((n) => ({
1581
+ ...n,
1582
+ [e]: {
1583
+ ...n[e] ?? { criteria: "" },
1584
+ value: t
1585
+ }
1586
+ })), L = (e) => a && e === P, R = (e) => {
1587
+ let t = A[e]?.value;
1588
+ return L(e) ? Array.isArray(t) ? t : t ? [t] : [] : Array.isArray(t) ? "" : t ?? "";
1589
+ }, z = (e, n) => (t[e] ?? []).find((e) => e.value === n)?.label ?? "", B = (e) => {
1590
+ let t = /* @__PURE__ */ new Set();
1591
+ for (let n of M) {
1592
+ if (n === e || !O.includes(n)) continue;
1593
+ let r = A[n]?.criteria;
1594
+ r && t.add(r);
1595
+ }
1596
+ return t;
1597
+ }, V = M.filter((e) => O.includes(e)).map((e) => ({
1598
+ criteria: A[e]?.criteria,
1599
+ value: R(e)
1600
+ })).filter((e) => !!(e.criteria && (Array.isArray(e.value) ? e.value.length > 0 : e.value))), H = V.map((e) => Array.isArray(e.value) ? e.value.map((t) => z(e.criteria, t)).join(", ") : z(e.criteria, e.value)).join(" / "), [U, W] = Z(o), G = (e) => {
1601
+ W(e), s?.(e);
1602
+ }, K = (e) => e.map((e) => `${e.criteria}:${e.value}`).sort().join("|"), ee = V.length > 0 ? (() => {
1603
+ let e = V.findIndex((e) => Array.isArray(e.value));
1604
+ return e === -1 ? [V.map((e) => ({
1605
+ criteria: e.criteria,
1606
+ value: e.value
1607
+ }))] : V[e].value.map((t) => V.map((n, r) => ({
1608
+ criteria: n.criteria,
1609
+ value: r === e ? t : n.value
1610
+ })));
1611
+ })() : [], q = ee.length > 0 && ee.every((e) => U.some((t) => K(t.items) === K(e))), [J, Y] = Z(!1), te = J && q, ne = () => {
1612
+ if (V.length === 0) return;
1613
+ let e = ee.filter((e) => !U.some((t) => K(t.items) === K(e)));
1614
+ if (e.length === 0) {
1615
+ Y(!0);
1616
+ return;
1617
+ }
1618
+ Y(!1), G([...e.map((e) => ({
1619
+ id: Dn(),
1620
+ items: e
1621
+ })), ...U]);
1622
+ }, re = (e) => G(U.filter((t) => t.id !== e)), ie = (e) => G([{
1623
+ id: Dn(),
1624
+ items: e.items.map((t, n) => n === e.items.length - 1 ? {
1625
+ ...t,
1626
+ value: ""
1627
+ } : { ...t })
1628
+ }, ...U]), ae = (e, t, n) => {
1629
+ G(U.map((r) => r.id === e ? {
1630
+ ...r,
1631
+ items: r.items.map((e, r) => r === t ? {
1632
+ ...e,
1633
+ value: n
1634
+ } : e)
1635
+ } : r)), se((n) => {
1636
+ let r = `${e}:${t}`;
1637
+ if (!n.has(r)) return n;
1638
+ let i = new Set(n);
1639
+ return i.delete(r), i;
1640
+ });
1641
+ }, [oe, se] = Z(() => /* @__PURE__ */ new Set());
1642
+ Me(x, () => ({
1643
+ validate: () => {
1644
+ let e = /* @__PURE__ */ new Set();
1645
+ return U.forEach((t) => t.items.forEach((n, r) => {
1646
+ n.value || e.add(`${t.id}:${r}`);
1647
+ })), se(e), e.size === 0;
1648
+ },
1649
+ getRows: () => U
1650
+ }));
1651
+ let ce = U.map((e, t) => ({
1652
+ ...e,
1653
+ orderNo: U.length - t
1654
+ })), le = (e, t, n) => {
1655
+ let r = K(e.items.map((e, r) => r === t ? {
1656
+ ...e,
1657
+ value: n
1658
+ } : e));
1659
+ return U.some((t) => t.id !== e.id && K(t.items) === r);
1660
+ }, ue = [
1661
+ {
1662
+ key: "orderNo",
1663
+ label: p,
1664
+ width: 60
1665
+ },
1666
+ {
1667
+ key: "items",
1668
+ label: m,
1669
+ render: (e) => /* @__PURE__ */ Q("div", {
1670
+ className: "flex min-w-0 flex-wrap items-center gap-spacing-3",
1671
+ children: e.items.map((n, r) => /* @__PURE__ */ $("span", {
1672
+ className: "flex items-center gap-spacing-3",
1673
+ children: [r > 0 && /* @__PURE__ */ Q(Re, {
1674
+ size: 12,
1675
+ strokeWidth: 1.8,
1676
+ className: "shrink-0 text-font-icon-3"
1677
+ }), /* @__PURE__ */ Q(w, {
1678
+ options: (t[n.criteria] ?? []).map((t) => t.value !== n.value && le(e, r, t.value) ? {
1679
+ ...t,
1680
+ disabled: !0
1681
+ } : t),
1682
+ value: n.value,
1683
+ searchable: !0,
1684
+ searchPlaceholder: "검색어 입력",
1685
+ menuWidth: 160,
1686
+ error: oe.has(`${e.id}:${r}`),
1687
+ errorMessage: b,
1688
+ onChange: (t) => ae(e.id, r, t.target.value)
1689
+ })]
1690
+ }, `${n.criteria}-${r}`))
1691
+ })
1692
+ },
1693
+ {
1694
+ key: "manage",
1695
+ label: h,
1696
+ width: xn(2, { buttonSize: 32 }),
1697
+ render: (e) => /* @__PURE__ */ $("div", {
1698
+ className: "flex items-center gap-spacing-5",
1699
+ children: [/* @__PURE__ */ Q(i, {
1700
+ variant: "ghost",
1701
+ size: "32",
1702
+ icon: He,
1703
+ "aria-label": "복사",
1704
+ onClick: () => ie(e)
1705
+ }), /* @__PURE__ */ Q(i, {
1706
+ variant: "ghost",
1707
+ size: "32",
1708
+ icon: $e,
1709
+ "aria-label": "삭제",
1710
+ onClick: () => re(e.id)
1711
+ })]
1712
+ })
1713
+ }
1714
+ ];
1715
+ return /* @__PURE__ */ $("div", {
1716
+ className: `flex w-full items-stretch gap-spacing-7 ${S}`,
1717
+ ...C,
1718
+ children: [
1719
+ /* @__PURE__ */ $("div", {
1720
+ className: "flex shrink-0 flex-col gap-spacing-6",
1721
+ children: [/* @__PURE__ */ Q("p", {
1722
+ className: "text-14 text-font-icon-5",
1723
+ children: c
1724
+ }), /* @__PURE__ */ Q(_t, {
1725
+ items: T.map((n) => {
1726
+ let r = A[n] ?? {
1727
+ criteria: "",
1728
+ value: ""
1729
+ }, i = B(n);
1730
+ return {
1731
+ id: n,
1732
+ body: /* @__PURE__ */ $(rt, { children: [/* @__PURE__ */ Q(g, {
1733
+ width: "100%",
1734
+ options: e.map((e) => i.has(e.value) ? {
1735
+ ...e,
1736
+ disabled: !0
1737
+ } : e),
1738
+ value: r.criteria,
1739
+ label: "기준",
1740
+ placeholder: "기준 선택",
1741
+ onChange: (e) => F(n, e.target.value)
1742
+ }), /* @__PURE__ */ Q(g, {
1743
+ width: "100%",
1744
+ options: t[r.criteria] ?? [],
1745
+ label: "값",
1746
+ placeholder: "값 선택",
1747
+ disabled: !r.criteria,
1748
+ multiple: L(n),
1749
+ value: R(n),
1750
+ onChange: (e) => I(n, e.target.value)
1751
+ })] })
1752
+ };
1753
+ }),
1754
+ order: E,
1755
+ onOrderChange: D,
1756
+ enabledIds: O,
1757
+ onEnabledChange: (e, { id: t, enabled: n }) => {
1758
+ if (k(e), n) {
1759
+ let n = A[t]?.criteria;
1760
+ n && e.some((e) => e !== t && A[e]?.criteria === n) && j((e) => ({
1761
+ ...e,
1762
+ [t]: {
1763
+ criteria: "",
1764
+ value: ""
1765
+ }
1766
+ }));
1767
+ }
1768
+ }
1769
+ })]
1770
+ }),
1771
+ /* @__PURE__ */ Q(at, { direction: "vertical" }),
1772
+ /* @__PURE__ */ $("div", {
1773
+ className: "flex min-h-0 min-w-0 flex-1 flex-col gap-spacing-6",
1774
+ children: [
1775
+ /* @__PURE__ */ Q("p", {
1776
+ className: "text-14 text-font-icon-5",
1777
+ children: l
1778
+ }),
1779
+ /* @__PURE__ */ $("div", {
1780
+ className: "flex items-center gap-spacing-5",
1781
+ children: [/* @__PURE__ */ Q("div", {
1782
+ className: "min-w-0 flex-1",
1783
+ children: /* @__PURE__ */ Q(u, {
1784
+ width: "100%",
1785
+ readOnly: !0,
1786
+ value: H,
1787
+ placeholder: f,
1788
+ error: te,
1789
+ errorMessage: y
1790
+ })
1791
+ }), /* @__PURE__ */ Q(i, {
1792
+ variant: "line",
1793
+ leftIcon: Xe,
1794
+ disabled: V.length === 0,
1795
+ onClick: ne,
1796
+ children: d
1797
+ })]
1798
+ }),
1799
+ /* @__PURE__ */ Q(En, {
1800
+ columns: ue,
1801
+ rows: ce,
1802
+ rowKey: "id",
1803
+ bordered: !0,
1804
+ maxHeight: _,
1805
+ className: _ === "fill" ? "min-h-0" : "",
1806
+ emptyMessage: v
1807
+ })
1808
+ ]
1809
+ })
1810
+ ]
1811
+ });
1812
+ }
1813
+ //#endregion
1814
+ //#region src/components/useFocusTrap.ts
1815
+ var kn = [
1816
+ "a[href]",
1817
+ "button:not([disabled])",
1818
+ "input:not([disabled])",
1819
+ "select:not([disabled])",
1820
+ "textarea:not([disabled])",
1821
+ "[tabindex]:not([tabindex=\"-1\"])"
1822
+ ].join(",");
1823
+ function An(e, t, { initialFocus: n = "container" } = {}) {
1824
+ je(() => {
1825
+ if (!e) return;
1826
+ let r = t.current;
1827
+ if (!r) return;
1828
+ let i = document.activeElement, a = () => Array.from(r.querySelectorAll(kn)).filter((e) => e.offsetParent !== null);
1829
+ n === "first" ? (a()[0] ?? r).focus() : r.focus();
1830
+ let o = (e) => {
1831
+ if (e.key !== "Tab" || e.defaultPrevented) return;
1832
+ let t = a();
1833
+ if (t.length === 0) {
1834
+ e.preventDefault(), r.focus();
1835
+ return;
1836
+ }
1837
+ let n = t[0], i = t[t.length - 1], o = document.activeElement;
1838
+ o && !r.contains(o) || !e.shiftKey && o === i ? (e.preventDefault(), n.focus()) : e.shiftKey && (o === n || o === r) && (e.preventDefault(), i.focus());
1839
+ };
1840
+ return r.addEventListener("keydown", o), () => {
1841
+ r.removeEventListener("keydown", o), i && document.contains(i) && i.focus();
1842
+ };
1843
+ }, [
1844
+ e,
1845
+ t,
1846
+ n
1847
+ ]);
1848
+ }
1849
+ //#endregion
1850
+ //#region src/components/modalContext.ts
1851
+ var jn = Ee(null), Mn = [], Nn = 0, Pn = "", Fn = {
1852
+ sm: "w-[360px]",
1853
+ md: "w-[480px]",
1854
+ lg: "w-[600px]",
1855
+ xl: "w-[720px]",
1856
+ "2xl": "w-[840px]",
1857
+ "3xl": "w-[960px]",
1858
+ "4xl": "w-[1260px]",
1859
+ fill: "w-[calc(100vw-32px)]"
1860
+ };
1861
+ function In({ open: e, onClose: t, title: n, children: r, size: a = "md", placement: o = "top", showHeader: s = !0, showClose: l = !0, showFooter: u = !0, footer: d, footerStart: f = null, footerStartType: p = "text", confirmText: m = "확인", cancelText: h = "취소", onConfirm: g, onCancel: _, confirmVariant: v = "fill", confirmDisabled: y = !1, confirmLoading: b = !1, showCancel: x = !0, footerFullWidth: S = !1, closeOnOverlayClick: C = !0, closeOnEsc: w = !0, bodyMaxHeight: T = "70vh", bodyPadding: E = "p-spacing-7", footerPadding: D = null, bodyClassName: O = "", onSubmit: A, className: j = "", ...M }) {
1862
+ let N = X(null), P = X(null), F = X(null), I = X(null), L = X(null), [R, z] = Z({
1863
+ top: null,
1864
+ bodyMax: null,
1865
+ bodyInner: null
1866
+ }), B = X(w), V = X(t);
1867
+ if (je(() => {
1868
+ B.current = w, V.current = t;
1869
+ }), je(() => {
1870
+ if (!e) return;
1871
+ let t = {};
1872
+ Mn.push(t);
1873
+ let n = (e) => {
1874
+ e.key === "Escape" && Mn[Mn.length - 1] === t && B.current && V.current?.();
1875
+ };
1876
+ return document.addEventListener("keydown", n), () => {
1877
+ document.removeEventListener("keydown", n);
1878
+ let e = Mn.indexOf(t);
1879
+ e !== -1 && Mn.splice(e, 1);
1880
+ };
1881
+ }, [e]), je(() => {
1882
+ if (e) return Nn += 1, Nn === 1 && (Pn = document.body.style.overflow, document.body.style.overflow = "hidden"), () => {
1883
+ --Nn, Nn === 0 && (document.body.style.overflow = Pn);
1884
+ };
1885
+ }, [e]), An(e, N), Ne(() => {
1886
+ if (!e) return;
1887
+ let t = (e) => {
1888
+ if (e == null) return Infinity;
1889
+ if (typeof e == "number") return e;
1890
+ let t = String(e).trim();
1891
+ return t.endsWith("vh") ? window.innerHeight * parseFloat(t) / 100 : t.endsWith("px") ? parseFloat(t) : Infinity;
1892
+ }, n = () => {
1893
+ let e = window.innerHeight, n = P.current?.offsetHeight ?? 0, r = F.current?.offsetHeight ?? 0, i = I.current?.offsetHeight ?? 0, a = t(T), s = () => {
1894
+ let e = I.current;
1895
+ if (!e) return 0;
1896
+ let t = getComputedStyle(e);
1897
+ return parseFloat(t.paddingTop) + parseFloat(t.paddingBottom);
1898
+ };
1899
+ if (o === "top") {
1900
+ if (L.current == null) {
1901
+ let t = Math.max(16, e / 2 - 150), a = n + r + i, o = Math.min(1, Math.max(0, a / e)), s = t - (t - 16) * o;
1902
+ L.current = Math.round(Math.min(t, Math.max(16, s)));
1903
+ }
1904
+ let t = L.current, a = Math.max(0, e - t - 16 - n - r - 2);
1905
+ z({
1906
+ top: t,
1907
+ bodyMax: a,
1908
+ bodyInner: Math.max(0, a - s())
1909
+ });
1910
+ } else {
1911
+ let t = Math.max(0, Math.min(a, e - 32 - n - r));
1912
+ z({
1913
+ top: null,
1914
+ bodyMax: t,
1915
+ bodyInner: Math.max(0, t - s())
1916
+ });
1917
+ }
1918
+ };
1919
+ n();
1920
+ let r = new ResizeObserver(n);
1921
+ return [
1922
+ P,
1923
+ F,
1924
+ I
1925
+ ].forEach((e) => e.current && r.observe(e.current)), window.addEventListener("resize", n), () => {
1926
+ r.disconnect(), window.removeEventListener("resize", n), L.current = null;
1927
+ };
1928
+ }, [
1929
+ e,
1930
+ o,
1931
+ T
1932
+ ]), !e) return null;
1933
+ let H = /* @__PURE__ */ $(k, {
1934
+ width: S ? "fill" : "hug",
1935
+ children: [x && /* @__PURE__ */ Q(i, {
1936
+ variant: "line",
1937
+ onClick: _ ?? t,
1938
+ children: h
1939
+ }), /* @__PURE__ */ Q(i, {
1940
+ variant: v,
1941
+ type: A ? "submit" : "button",
1942
+ disabled: y,
1943
+ loading: b,
1944
+ onClick: A ? void 0 : g,
1945
+ children: m
1946
+ })]
1947
+ }), U = A ? "form" : "div", W = A ? { onSubmit: (e) => {
1948
+ e.preventDefault(), A(e);
1949
+ } } : {}, G = o === "top", K = R.top ?? Math.round(Math.max(16, (typeof window < "u" ? window.innerHeight : 800) / 2 - 150)), ee = G ? "items-start justify-center px-spacing-7" : "items-center justify-center p-spacing-7", q = G ? {
1950
+ paddingTop: K,
1951
+ paddingBottom: 16
1952
+ } : void 0, J = G ? { maxHeight: `calc(100vh - ${K + 16}px)` } : { maxHeight: "calc(100vh - 32px)" }, Y = a === "fill" ? "min-w-[1260px]" : "min-w-[360px]";
1953
+ return nt(/* @__PURE__ */ Q("div", {
1954
+ className: `fixed inset-0 z-[1000] flex bg-modal-overlay ${ee}`,
1955
+ style: q,
1956
+ onMouseDown: C ? (e) => {
1957
+ e.target === e.currentTarget && t();
1958
+ } : void 0,
1959
+ children: /* @__PURE__ */ Q("div", {
1960
+ ref: N,
1961
+ tabIndex: -1,
1962
+ role: "dialog",
1963
+ "aria-modal": "true",
1964
+ "aria-label": typeof n == "string" ? n : void 0,
1965
+ className: `flex ${Y} max-w-[calc(100vw-32px)] flex-col gap-spacing-1 overflow-hidden rounded-round-6 bg-modal-inline shadow-[0px_4px_6px_0px_rgba(0,0,0,0.08)] outline-none ring-1 ring-modal-outline ${Fn[a]} ${j}`,
1966
+ style: J,
1967
+ ...M,
1968
+ children: /* @__PURE__ */ $(U, {
1969
+ className: "flex min-h-0 flex-1 flex-col gap-spacing-1",
1970
+ ...W,
1971
+ children: [
1972
+ s && /* @__PURE__ */ $("header", {
1973
+ ref: P,
1974
+ className: "flex shrink-0 items-center justify-between bg-modal-panel-bg py-spacing-6 pl-spacing-7 pr-spacing-6",
1975
+ children: [/* @__PURE__ */ Q("h2", {
1976
+ className: "text-15 font-semibold text-font-icon-5",
1977
+ children: n
1978
+ }), l && /* @__PURE__ */ Q(i, {
1979
+ variant: "ghost",
1980
+ size: "32",
1981
+ icon: tt,
1982
+ onClick: t,
1983
+ "aria-label": "닫기",
1984
+ showTooltip: !1
1985
+ })]
1986
+ }),
1987
+ /* @__PURE__ */ Q("div", {
1988
+ className: "min-h-0 bg-modal-panel-bg",
1989
+ children: /* @__PURE__ */ Q(c, {
1990
+ maxHeight: R.bodyMax ?? T,
1991
+ children: /* @__PURE__ */ Q("div", {
1992
+ ref: I,
1993
+ className: `${E} text-14 text-font-icon-4 ${O}`,
1994
+ children: /* @__PURE__ */ Q(jn.Provider, {
1995
+ value: R.bodyInner ?? null,
1996
+ children: r
1997
+ })
1998
+ })
1999
+ })
2000
+ }),
2001
+ u && (d || f || m) && /* @__PURE__ */ $("footer", {
2002
+ ref: F,
2003
+ className: `flex shrink-0 items-center bg-modal-panel-bg ${D ?? `${p === "button" ? "pl-spacing-6" : "pl-spacing-7"} pr-spacing-6 py-spacing-6`} ${S ? "" : "justify-between"}`,
2004
+ children: [!S && /* @__PURE__ */ Q("div", {
2005
+ className: "min-w-0 flex-1 text-14 text-font-icon-5",
2006
+ children: f
2007
+ }), d ?? H]
2008
+ })
2009
+ ]
2010
+ })
2011
+ })
2012
+ }), document.body);
2013
+ }
2014
+ function Ln({ title: e, description: t, descriptionDetail: n, checkbox: r }) {
2015
+ return /* @__PURE__ */ $("div", {
2016
+ className: "flex flex-col gap-spacing-6",
2017
+ children: [e != null && /* @__PURE__ */ Q("h2", {
2018
+ className: "text-20 font-semibold text-font-icon-5",
2019
+ children: e
2020
+ }), (t != null || n != null || r != null) && /* @__PURE__ */ $("div", {
2021
+ className: "flex flex-col gap-spacing-5",
2022
+ children: [
2023
+ t != null && /* @__PURE__ */ Q("div", {
2024
+ className: "whitespace-pre-line text-14 text-font-icon-5",
2025
+ children: t
2026
+ }),
2027
+ n != null && /* @__PURE__ */ Q("div", {
2028
+ className: "whitespace-pre-line rounded-round-4 bg-modal-description-bg p-spacing-6 text-14 text-font-icon-5",
2029
+ children: n
2030
+ }),
2031
+ r
2032
+ ]
2033
+ })]
2034
+ });
2035
+ }
2036
+ function Rn({ title: e, description: t, descriptionDetail: n, confirmText: r = "확인", onConfirm: i, onClose: a, size: o = "sm", placement: s = "center", ...c }) {
2037
+ return /* @__PURE__ */ Q(In, {
2038
+ ...c,
2039
+ title: e,
2040
+ size: o,
2041
+ placement: s,
2042
+ onClose: a,
2043
+ showHeader: !1,
2044
+ showCancel: !1,
2045
+ footerFullWidth: !0,
2046
+ bodyPadding: "p-spacing-8",
2047
+ footerPadding: "px-spacing-8 py-spacing-7",
2048
+ confirmText: r,
2049
+ onConfirm: i ?? a,
2050
+ children: /* @__PURE__ */ Q(Ln, {
2051
+ title: e,
2052
+ description: t,
2053
+ descriptionDetail: n
2054
+ })
2055
+ });
2056
+ }
2057
+ function zn({ title: e, description: t, descriptionDetail: n, checkboxLabel: r, checked: i, onCheckChange: a, requireCheck: o = !0, confirmText: s = "확인", cancelText: c = "취소", onConfirm: u, onCancel: d, onClose: f, confirmVariant: p = "fill", confirmDisabled: m = !1, open: h, size: g = "sm", placement: _ = "center", ...v }) {
2058
+ let y = r != null, b = i !== void 0, [x, S] = Z(!1), C = b ? i : x, [w, T] = Z(h);
2059
+ h !== w && (T(h), h && !b && S(!1));
2060
+ let E = (e) => {
2061
+ b || S(e.target.checked), a?.(e.target.checked, e);
2062
+ }, D = y && o && !C;
2063
+ return /* @__PURE__ */ Q(In, {
2064
+ ...v,
2065
+ title: e,
2066
+ open: h,
2067
+ size: g,
2068
+ placement: _,
2069
+ onClose: f,
2070
+ showHeader: !1,
2071
+ showCancel: !0,
2072
+ footerFullWidth: !0,
2073
+ bodyPadding: "p-spacing-8",
2074
+ footerPadding: "px-spacing-8 py-spacing-7",
2075
+ confirmText: s,
2076
+ cancelText: c,
2077
+ onConfirm: u,
2078
+ onCancel: d ?? f,
2079
+ confirmVariant: p,
2080
+ confirmDisabled: m || D,
2081
+ children: /* @__PURE__ */ Q(Ln, {
2082
+ title: e,
2083
+ description: t,
2084
+ descriptionDetail: n,
2085
+ checkbox: y ? /* @__PURE__ */ Q(l, {
2086
+ checked: C,
2087
+ onChange: E,
2088
+ label: r
2089
+ }) : null
2090
+ })
2091
+ });
2092
+ }
2093
+ function Bn({ submitText: e = "저장", cancelText: t = "취소", onSubmit: n, onCancel: r, onClose: i, submitDisabled: a = !1, loading: o = !1, ...s }) {
2094
+ return /* @__PURE__ */ Q(In, {
2095
+ ...s,
2096
+ onClose: i,
2097
+ onSubmit: n,
2098
+ showCancel: !0,
2099
+ confirmText: e,
2100
+ cancelText: t,
2101
+ onCancel: r ?? i,
2102
+ confirmDisabled: a,
2103
+ confirmLoading: o
2104
+ });
2105
+ }
2106
+ //#endregion
2107
+ //#region src/components/Tabs.tsx
2108
+ function Vn({ children: e, icon: t = null, tag: n = !1, tagText: r = "태그", tagType: i = "blue", selected: a = !1, disabled: o = !1, onClick: s, className: c = "", ...l }) {
2109
+ let u;
2110
+ return u = o ? "text-tab-disabled-text border-transparent cursor-not-allowed" : a ? "text-tab-selected-text border-tab-selected-underline cursor-pointer" : "text-tab-default-text border-transparent cursor-pointer hover:text-tab-hover-text hover:border-tab-hover-underline focus-visible:text-tab-hover-text focus-visible:border-tab-hover-underline", /* @__PURE__ */ $("button", {
2111
+ type: "button",
2112
+ role: "tab",
2113
+ "aria-selected": a,
2114
+ disabled: o,
2115
+ onClick: o ? void 0 : s,
2116
+ className: `relative inline-flex h-[32px] items-center justify-center gap-spacing-4 px-spacing-5 border-b-2 -mb-px font-pretendard text-14 whitespace-nowrap transition-colors select-none focus:outline-none ${u} ${c}`,
2117
+ ...l,
2118
+ children: [
2119
+ t && /* @__PURE__ */ Q(t, {
2120
+ size: 16,
2121
+ strokeWidth: 1.8,
2122
+ className: "shrink-0"
2123
+ }),
2124
+ e,
2125
+ n && /* @__PURE__ */ Q(P, {
2126
+ color: i,
2127
+ children: r
2128
+ })
2129
+ ]
2130
+ });
2131
+ }
2132
+ function Hn({ items: e = [], value: t, defaultValue: n, onChange: r, variant: i = "hug", rightSlot: a = null, className: o = "", ...s }) {
2133
+ let c = t !== void 0, [l, u] = Z(n), d = c ? t : l ?? e[0]?.value, f = (e) => {
2134
+ c || u(e), r?.(e);
2135
+ }, p = i === "fill", m = e.map((e) => /* @__PURE__ */ Q(Vn, {
2136
+ icon: e.icon,
2137
+ tag: e.tag,
2138
+ tagText: e.tagText,
2139
+ tagType: e.tagType,
2140
+ selected: d === e.value,
2141
+ disabled: e.disabled,
2142
+ onClick: () => f(e.value),
2143
+ className: p ? "flex-1 min-w-px" : "",
2144
+ children: e.label
2145
+ }, e.value));
2146
+ return /* @__PURE__ */ $("div", {
2147
+ role: "tablist",
2148
+ className: `flex w-full border-b border-tab-group-underline ${a ? "items-center justify-between" : ""} ${o}`,
2149
+ ...s,
2150
+ children: [/* @__PURE__ */ Q("div", {
2151
+ className: `flex items-center gap-spacing-5 ${p ? "w-full" : ""}`,
2152
+ children: m
2153
+ }), a && /* @__PURE__ */ Q("div", {
2154
+ className: "flex shrink-0 items-center",
2155
+ children: a
2156
+ })]
2157
+ });
2158
+ }
2159
+ //#endregion
2160
+ //#region src/components/NoticeWritingTemplate.tsx
2161
+ var Un = [
2162
+ {
2163
+ value: "site",
2164
+ label: "채용사이트 안내문",
2165
+ titlePlaceholder: "채용 사이트안내문 제목을 입력하세요"
2166
+ },
2167
+ {
2168
+ value: "email",
2169
+ label: "이메일 안내문",
2170
+ titlePlaceholder: "이메일 안내문 제목을 입력하세요"
2171
+ },
2172
+ {
2173
+ value: "sms",
2174
+ label: "SMS 안내문"
2175
+ }
2176
+ ], Wn = "90byte를 초과(한글 45자)하면 멀티 문자로 전환되며, 발송 비용이 변경될 수 있습니다.", Gn = [
2177
+ "undo",
2178
+ "redo",
2179
+ "mergefield"
2180
+ ], Kn = () => ({
2181
+ site: [],
2182
+ email: [],
2183
+ sms: []
2184
+ });
2185
+ function qn({ channel: e, defaultChannel: t = "site", onChannelChange: n, onChange: r, showTabs: i = !0, tabVariant: a = "fill", enabledChannels: o, mergeFields: s = [], defaultBodies: c, showAttach: l = !0, maxAttachments: d = 5, attachGuide: f = "파일을 첨부하세요 (파일당 최대 10MB).", attachAccept: p, editorMinHeight: m = 360, editorMaxHeight: h, editorReadOnly: g = !1, editorPlaceholder: _, className: v = "", ...y }) {
2186
+ let b = e !== void 0, [x, S] = Z(t), C = (e) => !o || o.includes(e), w = b ? e : x, T = C(w) ? w : Un.find((e) => C(e.value))?.value ?? w, E = (e) => {
2187
+ b || S(e), n?.(e);
2188
+ }, [D, O] = Z({
2189
+ site: "",
2190
+ email: "",
2191
+ sms: ""
2192
+ }), [k, j] = Z(() => ({
2193
+ site: "",
2194
+ email: "",
2195
+ sms: "",
2196
+ ...c || {}
2197
+ })), [M, N] = Z(Kn), P = (e) => r?.({
2198
+ channel: T,
2199
+ titles: D,
2200
+ bodies: k,
2201
+ attachments: M,
2202
+ ...e
2203
+ }), F = Un.find((e) => e.value === T) ?? Un[0], I = T === "sms", L = (e) => {
2204
+ let t = {
2205
+ ...D,
2206
+ [T]: e
2207
+ };
2208
+ O(t), P({ titles: t });
2209
+ }, R = (e) => {
2210
+ let t = {
2211
+ ...k,
2212
+ [T]: e
2213
+ };
2214
+ j(t), P({ bodies: t });
2215
+ }, z = (e) => {
2216
+ let t = {
2217
+ ...M,
2218
+ [T]: [...M[T], ...Array.from(e).map((e) => ({
2219
+ name: e.name,
2220
+ size: Math.max(.1, Math.round(e.size / 1048576 * 10) / 10),
2221
+ id: `${e.name}-${e.size}-${Date.now()}`,
2222
+ file: e
2223
+ }))].slice(0, d)
2224
+ };
2225
+ N(t), P({ attachments: t });
2226
+ }, B = (e, t) => {
2227
+ let n = {
2228
+ ...M,
2229
+ [T]: M[T].filter((e, n) => n !== t)
2230
+ };
2231
+ N(n), P({ attachments: n });
2232
+ };
2233
+ return /* @__PURE__ */ $("div", {
2234
+ className: `flex w-full flex-col gap-spacing-6 ${v}`,
2235
+ ...y,
2236
+ children: [
2237
+ i && /* @__PURE__ */ Q(Hn, {
2238
+ items: Un.map(({ value: e, label: t }) => ({
2239
+ value: e,
2240
+ label: t,
2241
+ disabled: !C(e)
2242
+ })),
2243
+ value: T,
2244
+ onChange: E,
2245
+ variant: a
2246
+ }),
2247
+ I ? /* @__PURE__ */ Q("p", {
2248
+ className: "text-12 text-font-icon-4",
2249
+ children: Wn
2250
+ }) : /* @__PURE__ */ $("div", {
2251
+ className: "flex items-start gap-spacing-6",
2252
+ children: [/* @__PURE__ */ Q("div", {
2253
+ className: "min-w-0 flex-1",
2254
+ children: /* @__PURE__ */ Q(u, {
2255
+ width: "100%",
2256
+ placeholder: F.titlePlaceholder,
2257
+ value: D[T],
2258
+ onChange: (e) => L(e.target.value)
2259
+ })
2260
+ }), l && /* @__PURE__ */ Q(dn, {
2261
+ triggerText: "첨부파일",
2262
+ buttonProps: { leftIcon: Ye },
2263
+ placement: "auto-right",
2264
+ menuWidth: 320,
2265
+ files: M[T],
2266
+ guide: f,
2267
+ accept: p,
2268
+ maxCount: d,
2269
+ onAdd: z,
2270
+ onDelete: B
2271
+ })]
2272
+ }),
2273
+ /* @__PURE__ */ Q(A, {
2274
+ value: k[T],
2275
+ onChange: R,
2276
+ mergeFields: s,
2277
+ toolbar: I ? Gn : void 0,
2278
+ showSource: !I,
2279
+ minHeight: m,
2280
+ maxHeight: h,
2281
+ readOnly: g,
2282
+ ..._ ? { placeholder: _ } : {}
2283
+ })
2284
+ ]
2285
+ });
2286
+ }
2287
+ //#endregion
2288
+ //#region src/components/Pagination.tsx
2289
+ var Jn = [
2290
+ 5,
2291
+ 10,
2292
+ 20,
2293
+ 50
2294
+ ], Yn = "inline-flex items-center justify-center min-w-[24px] min-h-[24px] px-spacing-3 rounded-round-10 font-pretendard font-normal text-14 transition-colors select-none focus:outline-none", Xn = "cursor-pointer hover:bg-button-ghost-hover-bg active:bg-transparent focus-visible:bg-button-ghost-hover-bg";
2295
+ function Zn(e, t, n) {
2296
+ let r = Math.floor((e - 1) / n) * n + 1, i = Math.min(r + n - 1, t);
2297
+ return Array.from({ length: i - r + 1 }, (e, t) => r + t);
2298
+ }
2299
+ var Qn = {
2300
+ selected: "cursor-default bg-button-ghost-selected-bg text-button-ghost-selected-text",
2301
+ disabled: "cursor-not-allowed text-button-ghost-disabled-fg"
2302
+ }, $n = {
2303
+ number: "text-button-ghost-pagination-fg hover:text-button-ghost-default-fg active:text-button-ghost-default-fg focus-visible:text-button-ghost-default-fg",
2304
+ icon: "text-button-ghost-default-fg"
2305
+ };
2306
+ function er({ state: e = "default", type: t = "number", icon: n, label: r, children: i, onClick: o }) {
2307
+ let s = e === "default", c = e === "default" ? `${$n[t]} ${Xn}` : Qn[e], l = a(t === "icon" ? r : null);
2308
+ return /* @__PURE__ */ $(rt, { children: [/* @__PURE__ */ Q("button", {
2309
+ type: "button",
2310
+ className: `${Yn} ${c}`,
2311
+ "aria-current": e === "selected" ? "page" : void 0,
2312
+ "aria-label": t === "icon" ? r : void 0,
2313
+ disabled: e === "disabled",
2314
+ onClick: s ? o : void 0,
2315
+ onMouseEnter: l.onMouseEnter,
2316
+ onMouseLeave: l.onMouseLeave,
2317
+ children: t === "icon" && n ? /* @__PURE__ */ Q(n, {
2318
+ size: ge.size,
2319
+ strokeWidth: ge.strokeWidth
2320
+ }) : i
2321
+ }), l.tooltip] });
2322
+ }
2323
+ function tr({ page: e, defaultPage: t = 1, onChange: n, totalCount: r = 0, totalPages: i, pageSize: a, defaultPageSize: o = 10, onPageSizeChange: s, pageSizeOptions: c = Jn, maxButtons: l = 10, showTotal: u = !0, showPageSize: d = !0, className: f = "", ...p }) {
2324
+ let m = e !== void 0, [h, _] = Z(t), v = m ? e : h, y = a !== void 0, [b, x] = Z(o), S = y ? a : b, C = (e) => i ?? Math.max(1, Math.ceil(r / e)), w = C(S), T = (e) => {
2325
+ let t = Math.min(Math.max(e, 1), w);
2326
+ t !== v && (m || _(t), n?.(t));
2327
+ }, E = (e) => {
2328
+ let t = Number(e.target.value);
2329
+ y || x(t), s?.(t);
2330
+ let n = C(t);
2331
+ v > n && T(n);
2332
+ }, D = Zn(v, w, l), O = v <= 1, k = v >= w, A = d && !(i != null && !s), j = c.map((e) => ({
2333
+ value: e,
2334
+ label: `${e}개`
2335
+ }));
2336
+ return /* @__PURE__ */ $("div", {
2337
+ className: `grid min-h-[32px] grid-cols-3 items-center gap-spacing-9 ${f}`,
2338
+ ...p,
2339
+ children: [
2340
+ /* @__PURE__ */ Q("div", {
2341
+ className: "justify-self-start",
2342
+ children: u && /* @__PURE__ */ $("p", {
2343
+ className: "text-14 text-font-icon-5",
2344
+ children: [
2345
+ "총 ",
2346
+ r,
2347
+ "개"
2348
+ ]
2349
+ })
2350
+ }),
2351
+ /* @__PURE__ */ $("div", {
2352
+ className: "flex items-center justify-center gap-spacing-3 justify-self-center",
2353
+ children: [
2354
+ /* @__PURE__ */ Q(er, {
2355
+ type: "icon",
2356
+ icon: ze,
2357
+ label: "첫 페이지",
2358
+ state: O ? "disabled" : "default",
2359
+ onClick: () => T(1)
2360
+ }),
2361
+ /* @__PURE__ */ Q(er, {
2362
+ type: "icon",
2363
+ icon: Le,
2364
+ label: "이전 페이지",
2365
+ state: O ? "disabled" : "default",
2366
+ onClick: () => T(v - 1)
2367
+ }),
2368
+ D.map((e) => /* @__PURE__ */ Q(er, {
2369
+ state: e === v ? "selected" : "default",
2370
+ onClick: () => T(e),
2371
+ children: e
2372
+ }, e)),
2373
+ /* @__PURE__ */ Q(er, {
2374
+ type: "icon",
2375
+ icon: Re,
2376
+ label: "다음 페이지",
2377
+ state: k ? "disabled" : "default",
2378
+ onClick: () => T(v + 1)
2379
+ }),
2380
+ /* @__PURE__ */ Q(er, {
2381
+ type: "icon",
2382
+ icon: Be,
2383
+ label: "마지막 페이지",
2384
+ state: k ? "disabled" : "default",
2385
+ onClick: () => T(w)
2386
+ })
2387
+ ]
2388
+ }),
2389
+ /* @__PURE__ */ Q("div", {
2390
+ className: "flex items-center gap-spacing-5 justify-self-end",
2391
+ children: A && /* @__PURE__ */ $(rt, { children: [/* @__PURE__ */ Q("span", {
2392
+ className: "whitespace-nowrap text-14 text-font-icon-5",
2393
+ children: "페이지 행"
2394
+ }), /* @__PURE__ */ Q(g, {
2395
+ variant: "text",
2396
+ size: "24",
2397
+ placement: "auto-right",
2398
+ menuWidth: 80,
2399
+ options: j,
2400
+ value: S,
2401
+ onChange: E
2402
+ })] })
2403
+ })
2404
+ ]
2405
+ });
2406
+ }
2407
+ //#endregion
2408
+ //#region src/components/ToolBar.tsx
2409
+ function nr({ children: e, className: t = "", ...n }) {
2410
+ return /* @__PURE__ */ Q("div", {
2411
+ role: "toolbar",
2412
+ className: `inline-flex items-center gap-spacing-4 rounded-round-5 outline outline-1 outline-toolbar-line bg-gradient-to-b from-toolbar-bg-top to-toolbar-bg-bottom p-spacing-5-5 shadow-[0px_2px_5px_0px_rgba(0,0,0,0.12)] ${t}`,
2413
+ ...n,
2414
+ children: e
2415
+ });
2416
+ }
2417
+ function rr() {
2418
+ return /* @__PURE__ */ Q("span", {
2419
+ "aria-hidden": !0,
2420
+ className: "h-spacing-7 w-px shrink-0 bg-divider-strong"
2421
+ });
2422
+ }
2423
+ //#endregion
2424
+ //#region src/components/SegmentedTabs.tsx
2425
+ function ir({ items: e = [], value: t, defaultValue: n, onChange: r, width: i, className: a = "", ...s }) {
2426
+ let c = t !== void 0, [l, u] = Z(n), d = c ? t : l ?? e[0]?.value, f = e.length, p = Math.max(0, e.findIndex((e) => e.value === d)), m = (e) => {
2427
+ c || u(e), r?.(e);
2428
+ }, h = (t) => {
2429
+ if (f === 0) return;
2430
+ let n = p;
2431
+ for (let r = 0; r < f; r += 1) if (n = (n + t + f) % f, !e[n].disabled) {
2432
+ m(e[n].value);
2433
+ return;
2434
+ }
2435
+ };
2436
+ return /* @__PURE__ */ Q("div", {
2437
+ role: "tablist",
2438
+ style: { width: i == null ? void 0 : typeof i == "number" ? `${i}px` : i },
2439
+ className: `flex ${i == null ? "w-full" : ""} rounded-round-4 bg-segmented-tab-bg p-spacing-2 ${a}`,
2440
+ ...s,
2441
+ children: /* @__PURE__ */ $("div", {
2442
+ className: "relative flex min-w-0 flex-1",
2443
+ children: [f > 0 && /* @__PURE__ */ Q("span", {
2444
+ "aria-hidden": !0,
2445
+ className: "pointer-events-none absolute inset-y-0 left-0 rounded-round-3 bg-segmented-select-bg ring-1 ring-segmented-select-line shadow-[0px_2px_4px_0px_rgba(0,0,0,0.12)] transition-transform duration-200 ease-out",
2446
+ style: {
2447
+ width: `${100 / f}%`,
2448
+ transform: `translateX(${p * 100}%)`
2449
+ }
2450
+ }), e.map((e) => {
2451
+ let t = e.value === d;
2452
+ return /* @__PURE__ */ Q("button", {
2453
+ type: "button",
2454
+ role: "tab",
2455
+ "aria-selected": t,
2456
+ disabled: e.disabled,
2457
+ tabIndex: e.disabled ? -1 : 0,
2458
+ onClick: () => !e.disabled && m(e.value),
2459
+ onKeyDown: (e) => {
2460
+ e.key === "ArrowRight" ? (e.preventDefault(), h(1)) : e.key === "ArrowLeft" && (e.preventDefault(), h(-1));
2461
+ },
2462
+ className: `relative z-[1] flex min-h-[24px] min-w-0 flex-1 items-center justify-center rounded-round-3 px-spacing-5-5 font-pretendard text-14 leading-24 transition-colors focus:outline-none ${e.disabled ? "cursor-not-allowed text-segmented-disabled-text" : t ? "cursor-pointer text-segmented-select-text focus-visible:text-segmented-hover-text" : "cursor-pointer text-segmented-unselect-text hover:text-segmented-hover-text focus-visible:text-segmented-hover-text"}`,
2463
+ children: /* @__PURE__ */ Q(o, {
2464
+ as: "span",
2465
+ className: "min-w-0",
2466
+ children: e.label
2467
+ })
2468
+ }, e.value);
2469
+ })]
2470
+ })
2471
+ });
2472
+ }
2473
+ //#endregion
2474
+ //#region src/components/ScreeningIndividualSettingModal.tsx
2475
+ var ar = (e) => e.replace(/[^0-9]/g, ""), or = [{
2476
+ value: "plus",
2477
+ label: "가점"
2478
+ }, {
2479
+ value: "minus",
2480
+ label: "감점"
2481
+ }], sr = [{
2482
+ value: "fit",
2483
+ label: "적합"
2484
+ }, {
2485
+ value: "unfit",
2486
+ label: "부적합"
2487
+ }], cr = (e) => [{
2488
+ value: "points",
2489
+ label: "가점/감점",
2490
+ disabled: e
2491
+ }, {
2492
+ value: "fitness",
2493
+ label: "적합/부적합"
2494
+ }];
2495
+ function lr({ items: e = [], value: t = null, fitnessOnly: n = !1, onClose: r, onConfirm: a }) {
2496
+ let [o, s] = Z(n ? "fitness" : t?.mode ?? "points"), c = (n, r) => {
2497
+ let i = {};
2498
+ return e.forEach((e) => {
2499
+ let a = t?.mode === n ? t?.items?.[e.value] : null;
2500
+ i[e.value] = a ?? r;
2501
+ }), i;
2502
+ }, [l, d] = Z(() => c("points", {
2503
+ type: "plus",
2504
+ points: ""
2505
+ })), [f, p] = Z(() => c("fitness", { type: "fit" })), [m, h] = Z(""), [_, v] = Z(""), [y, b] = Z([]), x = (e) => {
2506
+ s(e), h(""), v("");
2507
+ }, S = o === "points", C = y.length > 0, w = (S ? !!m && !!_.trim() : !!m) && C, T = () => {
2508
+ if (!w) return;
2509
+ let e = S ? {
2510
+ type: m,
2511
+ points: _.trim()
2512
+ } : { type: m }, t = (t) => ({
2513
+ ...t,
2514
+ ...Object.fromEntries(y.map((t) => [t, { ...e }]))
2515
+ });
2516
+ S ? d(t) : p(t);
2517
+ }, E = (e, t) => S ? d((n) => ({
2518
+ ...n,
2519
+ [e]: {
2520
+ ...n[e],
2521
+ ...t
2522
+ }
2523
+ })) : p((n) => ({
2524
+ ...n,
2525
+ [e]: {
2526
+ ...n[e],
2527
+ ...t
2528
+ }
2529
+ })), D = S ? e.every((e) => !!l[e.value]?.points?.trim()) : !0, O = () => ({
2530
+ type: "individual",
2531
+ mode: o,
2532
+ items: Object.fromEntries(e.map((e) => S ? [e.value, {
2533
+ type: l[e.value].type,
2534
+ points: l[e.value].points?.trim()
2535
+ }] : [e.value, { type: f[e.value].type }]))
2536
+ }), k = [
2537
+ {
2538
+ key: "label",
2539
+ label: "항목"
2540
+ },
2541
+ {
2542
+ key: "type",
2543
+ label: "가/감점",
2544
+ width: 120,
2545
+ render: (e) => /* @__PURE__ */ Q(g, {
2546
+ variant: "text",
2547
+ width: "fill",
2548
+ options: S ? or : sr,
2549
+ value: (S ? l : f)[String(e.id)]?.type ?? "",
2550
+ onChange: (t) => E(String(e.id), { type: t.target.value }),
2551
+ menuWidth: 100
2552
+ })
2553
+ },
2554
+ ...S ? [{
2555
+ key: "points",
2556
+ label: "점수",
2557
+ width: 120,
2558
+ render: (e) => /* @__PURE__ */ $("span", {
2559
+ className: "flex items-center gap-spacing-4",
2560
+ children: [/* @__PURE__ */ Q(u, {
2561
+ size: "32",
2562
+ width: 70,
2563
+ value: l[String(e.id)]?.points ?? "",
2564
+ onChange: (t) => E(String(e.id), { points: ar(t.target.value) }),
2565
+ inputProps: { inputMode: "numeric" },
2566
+ placeholder: "입력"
2567
+ }), /* @__PURE__ */ Q("span", {
2568
+ className: "text-14 text-font-icon-5",
2569
+ children: "점"
2570
+ })]
2571
+ })
2572
+ }] : []
2573
+ ];
2574
+ return /* @__PURE__ */ Q(In, {
2575
+ open: !0,
2576
+ onClose: r,
2577
+ title: "개별설정",
2578
+ size: "lg",
2579
+ confirmText: "확인",
2580
+ cancelText: "취소",
2581
+ confirmDisabled: !D,
2582
+ onConfirm: () => a?.(O()),
2583
+ children: /* @__PURE__ */ $("div", {
2584
+ className: "flex flex-col gap-spacing-6",
2585
+ children: [/* @__PURE__ */ $("div", {
2586
+ className: "flex items-center justify-between gap-spacing-5",
2587
+ children: [/* @__PURE__ */ $("div", {
2588
+ className: "flex items-center gap-spacing-4",
2589
+ children: [S ? /* @__PURE__ */ $(rt, { children: [
2590
+ /* @__PURE__ */ Q(g, {
2591
+ width: 90,
2592
+ options: or,
2593
+ value: m,
2594
+ onChange: (e) => h(e.target.value),
2595
+ placeholder: "가/감점",
2596
+ disabled: !C
2597
+ }),
2598
+ /* @__PURE__ */ Q(u, {
2599
+ width: 70,
2600
+ value: _,
2601
+ onChange: (e) => v(ar(e.target.value)),
2602
+ inputProps: { inputMode: "numeric" },
2603
+ placeholder: "입력",
2604
+ disabled: !C
2605
+ }),
2606
+ /* @__PURE__ */ Q("span", {
2607
+ className: `text-14 ${C ? "text-font-icon-5" : "text-font-icon-2"}`,
2608
+ children: "점"
2609
+ })
2610
+ ] }) : /* @__PURE__ */ Q(g, {
2611
+ width: 110,
2612
+ options: sr,
2613
+ value: m,
2614
+ onChange: (e) => h(e.target.value),
2615
+ placeholder: "적합/부적합",
2616
+ disabled: !C
2617
+ }), /* @__PURE__ */ Q(i, {
2618
+ variant: "line",
2619
+ size: "32",
2620
+ disabled: !w,
2621
+ onClick: T,
2622
+ children: "일괄적용"
2623
+ })]
2624
+ }), /* @__PURE__ */ Q(ir, {
2625
+ width: 200,
2626
+ items: cr(n),
2627
+ value: o,
2628
+ onChange: x
2629
+ })]
2630
+ }), /* @__PURE__ */ Q(En, {
2631
+ bordered: !0,
2632
+ maxHeight: "fill",
2633
+ className: "min-h-0",
2634
+ columns: k,
2635
+ rows: e.map((e) => ({
2636
+ id: e.value,
2637
+ label: e.label
2638
+ })),
2639
+ rowKey: "id",
2640
+ selectable: !0,
2641
+ selectedIds: y,
2642
+ onSelectChange: b
2643
+ })]
2644
+ })
2645
+ });
2646
+ }
2647
+ //#endregion
2648
+ //#region src/components/formulaFunctions.ts
2649
+ var ur = {
2650
+ AND: "logical",
2651
+ OR: "logical",
2652
+ IF: "conditional",
2653
+ SUM: "aggregate",
2654
+ MAX: "aggregate",
2655
+ MIN: "aggregate",
2656
+ COUNTIF: "aggregate",
2657
+ CAPMAX: "score-limit",
2658
+ CAPMIN: "score-limit",
2659
+ FITBYSCORE: "evaluation",
2660
+ UNFITBYSCORE: "evaluation"
2661
+ }, dr = Object.keys(ur);
2662
+ function fr(e) {
2663
+ e && setTimeout(() => {
2664
+ let t = Array.from(document.querySelectorAll("[data-formula-chain]")), n = t[t.indexOf(e) + 1];
2665
+ if (!n) return;
2666
+ let r = n.matches("[tabindex]") ? n : n.querySelector("[tabindex]");
2667
+ r && (r.focus(), r.setAttribute("data-chain-focus", ""), r.addEventListener("blur", () => r.removeAttribute("data-chain-focus"), { once: !0 }));
2668
+ }, 0);
2669
+ }
2670
+ function pr(e, t, n) {
2671
+ e.defaultPrevented || (e.key === "Enter" || e.key === " " || e.key === "Tab" && !e.shiftKey && !t) && (e.preventDefault(), n());
2672
+ }
2673
+ function mr(e) {
2674
+ return e.kind === "group" ? e.children.some(mr) : e.items?.length ? e.individual?.mode === "points" : e.scoreType === "plus" || e.scoreType === "minus" || !!e.points;
2675
+ }
2676
+ var hr = "focus:outline-none focus-visible:ring-2 focus-visible:ring-text-field-focused-line data-[chain-focus]:ring-2 data-[chain-focus]:ring-text-field-focused-line";
2677
+ //#endregion
2678
+ //#region src/components/usePanelKeyboard.ts
2679
+ function gr({ complete: e, onCommit: t, onSkip: n }) {
2680
+ let r = X(null);
2681
+ je(() => {
2682
+ let e = setTimeout(() => r.current?.focus(), 0);
2683
+ return () => clearTimeout(e);
2684
+ }, []);
2685
+ let i = () => Array.from(r.current?.querySelectorAll("button:not([disabled]), input:not([disabled]), [tabindex='0']") ?? []).filter((e) => e.offsetParent !== null);
2686
+ return {
2687
+ menuRef: r,
2688
+ handleTabKey: (r) => {
2689
+ if (r.key !== "Tab" || r.defaultPrevented) return;
2690
+ let a = i();
2691
+ if (!a.length) {
2692
+ r.preventDefault(), e ? t() : n?.();
2693
+ return;
2694
+ }
2695
+ let o = a.indexOf(r.target);
2696
+ !r.shiftKey && o === a.length - 1 ? (r.preventDefault(), e ? t() : n ? n() : a[0].focus()) : r.shiftKey && o <= 0 && (r.preventDefault(), a[a.length - 1].focus());
2697
+ }
2698
+ };
2699
+ }
2700
+ //#endregion
2701
+ //#region src/components/ScreeningConditionCard.tsx
2702
+ var _r = [
2703
+ {
2704
+ value: "plus",
2705
+ label: "가점",
2706
+ hasPoints: !0
2707
+ },
2708
+ {
2709
+ value: "minus",
2710
+ label: "감점",
2711
+ hasPoints: !0
2712
+ },
2713
+ {
2714
+ value: "fit",
2715
+ label: "적합",
2716
+ hasPoints: !1
2717
+ },
2718
+ {
2719
+ value: "unfit",
2720
+ label: "부적합",
2721
+ hasPoints: !1
2722
+ }
2723
+ ], vr = Object.fromEntries(_r.map((e) => [e.value, e.label]));
2724
+ function yr({ children: e, placeholder: t, open: n }) {
2725
+ let r = e != null && e !== "";
2726
+ return /* @__PURE__ */ $("div", {
2727
+ className: `grid min-h-[32px] w-full cursor-pointer grid-cols-[minmax(0,1fr)_auto] items-center gap-spacing-4 rounded-round-4 bg-text-field-default-bg py-spacing-3 pl-spacing-6 pr-spacing-6 ring-inset ring-text-field-hover-line transition-shadow hover:ring-2 group-focus-visible/fieldstop:ring-2 group-data-[chain-focus]/fieldstop:ring-2 ${n ? "ring-2 ring-text-field-focused-line" : ""}`,
2728
+ children: [/* @__PURE__ */ Q(o, {
2729
+ className: `text-14 ${r ? "text-text-field-filled-text" : "text-text-field-default-text"}`,
2730
+ children: r ? e : t
2731
+ }), /* @__PURE__ */ Q(Ie, {
2732
+ size: 16,
2733
+ strokeWidth: 1.8,
2734
+ className: `pointer-events-none shrink-0 text-font-icon-5 transition-transform ${n ? "rotate-180" : ""}`
2735
+ })]
2736
+ });
2737
+ }
2738
+ function br({ cardName: e = "조건", conditionTabs: t = [], conditionOptionsByTab: n = {}, conditionOptions: r = [], conditionValue: a = null, onConditionChange: s, conditionPlaceholder: c = "조건을 선택하세요", scoreValue: l = null, onScoreChange: u, scorePlaceholder: d = "가/감점", onDelete: f, dragging: p = !1, dragHandleProps: m = {}, width: h = 375, className: g = "", ..._ }) {
2739
+ let v = t.length > 0, y = t.find((e) => e.multiSelect), b = y ? n[y.value] ?? [] : [], x = !!a?.items?.length, [S, C] = Z(!1), [w, T] = Z(!1), [D, O] = Z(!1), k = X(null), A = X(null), [j, M] = Z(0), N = (e) => {
2740
+ e && M(A.current?.offsetWidth ?? 0), C(e);
2741
+ }, P = (e) => t.find((t) => t.value === e)?.label, F = (e, t) => (v ? n[e] ?? [] : r).find((e) => e.value === t)?.label, I = a ? x ? b.filter((e) => a.items?.includes(e.value)).map((e) => e.label).join(", ") : v ? a.option == null ? P(a.tab) : `${P(a.tab)}, ${F(a.tab, a.option)}` : F(void 0, a.option) : null, L = l ? l.type === "plus" || l.type === "minus" ? `${vr[l.type]}, ${l.points}점` : vr[l.type] : null, R = h === "fill" ? "100%" : typeof h == "number" ? `${h}px` : h, z = X(null), B = (e) => {
2742
+ if (z.current && e.dataTransfer) try {
2743
+ e.dataTransfer.setDragImage(z.current, 16, 20);
2744
+ } catch {}
2745
+ _.onDragStart?.(e);
2746
+ };
2747
+ return /* @__PURE__ */ $("div", {
2748
+ style: { width: R },
2749
+ className: `group/card flex flex-col gap-spacing-5-5 rounded-round-4 outline outline-1 p-spacing-6 shadow-[0_2px_2px_0_rgba(0,0,0,0.12)] transition-colors outline-condition-card-default-card-line bg-condition-card-default-card-bg text-condition-card-default-card-text hover:outline-condition-card-hover-card-line hover:bg-condition-card-hover-card-bg ${g}`,
2750
+ ..._,
2751
+ onDragStart: B,
2752
+ "aria-grabbed": p || void 0,
2753
+ children: [
2754
+ /* @__PURE__ */ $("div", {
2755
+ ref: z,
2756
+ style: {
2757
+ position: "fixed",
2758
+ top: -9999,
2759
+ left: -9999
2760
+ },
2761
+ className: "inline-flex w-fit items-center gap-spacing-4 rounded-round-4 border border-condition-card-drop-outline bg-condition-card-hover-card-bg px-spacing-6 py-spacing-4 text-condition-card-drop-text shadow-[0_2px_2px_0_rgba(0,0,0,0.12)]",
2762
+ children: [/* @__PURE__ */ Q(Ge, {
2763
+ size: 16,
2764
+ strokeWidth: 1.8,
2765
+ className: "shrink-0"
2766
+ }), /* @__PURE__ */ Q("span", {
2767
+ className: "whitespace-nowrap text-14",
2768
+ children: e
2769
+ })]
2770
+ }),
2771
+ /* @__PURE__ */ $("div", {
2772
+ className: "flex w-full items-center justify-between",
2773
+ children: [/* @__PURE__ */ $("div", {
2774
+ className: "flex min-w-0 items-center gap-spacing-4",
2775
+ children: [/* @__PURE__ */ Q("span", {
2776
+ ...m,
2777
+ className: "shrink-0 cursor-grab text-condition-card-default-card-text transition-colors group-hover/card:text-condition-card-hover-card-text",
2778
+ children: /* @__PURE__ */ Q(Ge, {
2779
+ size: 16,
2780
+ strokeWidth: 1.8
2781
+ })
2782
+ }), /* @__PURE__ */ Q(o, {
2783
+ className: "min-w-0 text-14 text-condition-card-default-card-text transition-colors group-hover/card:text-condition-card-hover-card-text",
2784
+ children: e
2785
+ })]
2786
+ }), /* @__PURE__ */ Q(i, {
2787
+ variant: "ghost",
2788
+ icon: $e,
2789
+ "aria-label": "카드 삭제",
2790
+ onClick: f
2791
+ })]
2792
+ }),
2793
+ /* @__PURE__ */ $("div", {
2794
+ className: "flex w-full items-center gap-spacing-3",
2795
+ children: [/* @__PURE__ */ Q("div", {
2796
+ ref: A,
2797
+ "data-formula-chain": !0,
2798
+ className: "min-w-0 flex-1",
2799
+ children: /* @__PURE__ */ Q(E, {
2800
+ className: "group/fieldstop w-full rounded-round-4 focus:outline-none",
2801
+ tabIndex: 0,
2802
+ onKeyDown: (e) => pr(e, S, () => N(!0)),
2803
+ menuWidth: y ? 351 : "max-content",
2804
+ open: S,
2805
+ onOpenChange: N,
2806
+ trigger: /* @__PURE__ */ Q(yr, {
2807
+ open: S,
2808
+ placeholder: c,
2809
+ children: I
2810
+ }),
2811
+ children: (e) => /* @__PURE__ */ Q(xr, {
2812
+ tabs: t,
2813
+ optionsByTab: n,
2814
+ options: r,
2815
+ initialTab: a?.tab,
2816
+ initialOption: a?.option,
2817
+ initialItems: a?.items,
2818
+ style: { minWidth: j },
2819
+ onCancel: e,
2820
+ onSave: (t) => {
2821
+ s?.(t), e(), t.items ? setTimeout(() => k.current?.querySelector("button")?.focus(), 0) : T(!0);
2822
+ },
2823
+ onSkip: () => {
2824
+ e(), fr(A.current);
2825
+ }
2826
+ })
2827
+ })
2828
+ }), x ? /* @__PURE__ */ $("span", {
2829
+ ref: k,
2830
+ className: "shrink-0",
2831
+ children: [/* @__PURE__ */ Q(i, {
2832
+ variant: "line",
2833
+ size: "32",
2834
+ leftIcon: Ze,
2835
+ onClick: () => O(!0),
2836
+ children: "개별설정"
2837
+ }), D && /* @__PURE__ */ Q(lr, {
2838
+ items: b.filter((e) => a?.items?.includes(e.value)),
2839
+ value: l?.type === "individual" ? l : null,
2840
+ onClose: () => O(!1),
2841
+ onConfirm: (e) => {
2842
+ u?.(e), O(!1), fr(A.current);
2843
+ }
2844
+ })]
2845
+ }) : /* @__PURE__ */ Q(E, {
2846
+ className: "group/fieldstop w-[100px] shrink-0 rounded-round-4 focus:outline-none",
2847
+ tabIndex: 0,
2848
+ onKeyDown: (e) => pr(e, w, () => T(!0)),
2849
+ menuWidth: 200,
2850
+ placement: "auto-right",
2851
+ open: w,
2852
+ onOpenChange: T,
2853
+ trigger: /* @__PURE__ */ Q(yr, {
2854
+ open: w,
2855
+ placeholder: d,
2856
+ children: L
2857
+ }),
2858
+ children: (e) => /* @__PURE__ */ Q(Sr, {
2859
+ initialType: l?.type ?? null,
2860
+ initialPoints: l?.points ?? "",
2861
+ onCancel: e,
2862
+ onSave: (t) => {
2863
+ u?.(t), e(), fr(A.current);
2864
+ },
2865
+ onSkip: () => {
2866
+ e(), fr(A.current);
2867
+ }
2868
+ })
2869
+ })]
2870
+ })
2871
+ ]
2872
+ });
2873
+ }
2874
+ function xr({ tabs: e = [], optionsByTab: t = {}, options: n = [], initialTab: r = null, initialOption: i = null, initialItems: a = null, onSave: o, onCancel: s, onTabNext: c, onSkip: l, style: u }) {
2875
+ let d = e.length > 0, [p, m] = Z(r ?? e[0]?.value ?? null), [h, _] = Z(i), v = e.find((e) => e.multiSelect), b = v && p === v.value, [x, S] = Z(() => r === v?.value ? a ?? [] : []), C = d ? t[p] ?? [] : n, w = d && !!e.find((e) => e.value === p)?.disableOptions, T = () => v ? b ? {
2876
+ tab: p,
2877
+ option: null,
2878
+ items: x
2879
+ } : {
2880
+ tab: p,
2881
+ option: null
2882
+ } : d ? {
2883
+ tab: p,
2884
+ option: w ? null : h
2885
+ } : { option: h }, E = v ? b ? x.length > 0 : !0 : w ? !0 : !!h, { menuRef: D, handleTabKey: O } = gr({
2886
+ complete: E,
2887
+ onCommit: () => {
2888
+ o?.(T()), c?.();
2889
+ },
2890
+ onSkip: l
2891
+ });
2892
+ return /* @__PURE__ */ Q("div", {
2893
+ ref: D,
2894
+ tabIndex: -1,
2895
+ className: "outline-none",
2896
+ onKeyDown: O,
2897
+ children: /* @__PURE__ */ $(N, {
2898
+ width: v ? 351 : "auto",
2899
+ style: v ? void 0 : u,
2900
+ footer: !0,
2901
+ footerButtonsFill: !0,
2902
+ confirmText: "저장",
2903
+ confirmDisabled: !E,
2904
+ onCancel: s,
2905
+ onConfirm: () => o?.(T()),
2906
+ children: [d && /* @__PURE__ */ Q("div", {
2907
+ className: "w-full bg-list-group-bg p-spacing-5",
2908
+ children: /* @__PURE__ */ Q(ir, {
2909
+ items: e,
2910
+ value: p,
2911
+ onChange: (e) => {
2912
+ m(e), _(null);
2913
+ }
2914
+ })
2915
+ }), v ? /* @__PURE__ */ Q("div", {
2916
+ className: "w-full bg-list-group-bg p-spacing-5",
2917
+ children: /* @__PURE__ */ Q(g, {
2918
+ width: "100%",
2919
+ multiple: !0,
2920
+ confirm: !0,
2921
+ searchable: !0,
2922
+ options: t[v.value] ?? [],
2923
+ value: x,
2924
+ onChange: (e) => S(e.target.value),
2925
+ disabled: !b,
2926
+ placeholder: v.placeholder ?? "선택하세요",
2927
+ searchPlaceholder: v.searchPlaceholder ?? "검색어를 입력하세요"
2928
+ })
2929
+ }) : /* @__PURE__ */ Q(f, {
2930
+ gap: "3",
2931
+ children: C.map((e) => /* @__PURE__ */ Q(y, {
2932
+ radio: !0,
2933
+ title: e.label,
2934
+ checked: h === e.value,
2935
+ disabled: w,
2936
+ onCheckChange: () => _(e.value)
2937
+ }, e.value))
2938
+ })]
2939
+ })
2940
+ });
2941
+ }
2942
+ function Sr({ initialType: e = null, initialPoints: t = "", disablePoints: n = !1, onSave: r, onCancel: i, onTabNext: a, onSkip: o }) {
2943
+ let [s, c] = Z(e), [l, d] = Z({
2944
+ plus: e === "plus" ? t : "",
2945
+ minus: e === "minus" ? t : ""
2946
+ }), p = s === "plus" || s === "minus", m = p ? l[s] : "", h = !!s && (!p || !!m.trim()), { menuRef: g, handleTabKey: _ } = gr({
2947
+ complete: h,
2948
+ onCommit: () => {
2949
+ r?.(p ? {
2950
+ type: s,
2951
+ points: m.trim()
2952
+ } : { type: s }), a?.();
2953
+ },
2954
+ onSkip: o
2955
+ }), v = (e, t) => {
2956
+ c(e), t && setTimeout(() => g.current?.querySelector("input[inputmode]:not([disabled])")?.focus(), 0);
2957
+ }, b = (e) => /* @__PURE__ */ $("span", {
2958
+ className: "flex shrink-0 items-center gap-spacing-5",
2959
+ onClick: (e) => e.stopPropagation(),
2960
+ children: [/* @__PURE__ */ Q(u, {
2961
+ width: 56,
2962
+ value: l[e],
2963
+ disabled: s !== e,
2964
+ onChange: (t) => d((n) => ({
2965
+ ...n,
2966
+ [e]: t.target.value.replace(/[^0-9]/g, "")
2967
+ })),
2968
+ inputProps: { inputMode: "numeric" },
2969
+ placeholder: "0"
2970
+ }), /* @__PURE__ */ Q("span", {
2971
+ className: `text-14 ${s === e ? "text-list-default-text" : "text-list-disabled-text"}`,
2972
+ children: "점"
2973
+ })]
2974
+ });
2975
+ return /* @__PURE__ */ Q("div", {
2976
+ ref: g,
2977
+ tabIndex: -1,
2978
+ className: "outline-none",
2979
+ onKeyDown: _,
2980
+ children: /* @__PURE__ */ Q(N, {
2981
+ width: "100%",
2982
+ footer: !0,
2983
+ footerButtonsFill: !0,
2984
+ confirmText: "저장",
2985
+ confirmDisabled: !h,
2986
+ onCancel: i,
2987
+ onConfirm: () => r?.(p ? {
2988
+ type: s,
2989
+ points: m.trim()
2990
+ } : { type: s }),
2991
+ children: /* @__PURE__ */ Q(f, {
2992
+ gap: "3",
2993
+ children: _r.map((e) => {
2994
+ let t = n && e.hasPoints;
2995
+ return /* @__PURE__ */ Q(y, {
2996
+ radio: !0,
2997
+ title: e.label,
2998
+ checked: s === e.value,
2999
+ disabled: t,
3000
+ onCheckChange: t ? void 0 : () => v(e.value, e.hasPoints),
3001
+ rightSlot: e.hasPoints ? b(e.value) : void 0
3002
+ }, e.value);
3003
+ })
3004
+ })
3005
+ })
3006
+ });
3007
+ }
3008
+ //#endregion
3009
+ //#region src/components/ScreeningFormula.tsx
3010
+ var Cr = {
3011
+ logical: "green",
3012
+ conditional: "blue",
3013
+ aggregate: "violet",
3014
+ "score-limit": "pink",
3015
+ evaluation: "orange"
3016
+ }, wr = {
3017
+ logical: "border-formula-hover-logical-outline",
3018
+ conditional: "border-formula-hover-conditional-outline",
3019
+ aggregate: "border-formula-hover-aggregate-outline",
3020
+ "score-limit": "border-formula-hover-score-limit-outline",
3021
+ evaluation: "border-formula-hover-evaluation-outline"
3022
+ };
3023
+ function Tr({ family: e, dense: t = !1, comment: n = null, className: r = "", children: i }) {
3024
+ let [a, o] = Z(!1), s = X(null);
3025
+ return je(() => {
3026
+ let e = s.current;
3027
+ if (!e) return;
3028
+ let t = (t) => o(t.target?.closest("[data-formula-shell]") === e), n = (t) => {
3029
+ e.contains(t.relatedTarget) || o(!1);
3030
+ };
3031
+ return e.addEventListener("mouseover", t), e.addEventListener("mouseout", n), () => {
3032
+ e.removeEventListener("mouseover", t), e.removeEventListener("mouseout", n);
3033
+ };
3034
+ }, []), /* @__PURE__ */ $("div", {
3035
+ ref: s,
3036
+ "data-formula-shell": !0,
3037
+ className: `inline-flex max-w-full flex-col gap-spacing-4 rounded-round-4 border py-spacing-5 transition-colors ${t ? "px-spacing-5-5" : "px-spacing-6"} ${a ? `bg-formula-hover-bg ${wr[e] ?? "border-formula-default-outline"}` : "border-formula-default-outline bg-formula-default-bg"} ${r}`,
3038
+ children: [/* @__PURE__ */ Q("div", {
3039
+ className: "flex max-w-full flex-wrap items-center gap-spacing-4",
3040
+ children: i
3041
+ }), n && /* @__PURE__ */ $(rt, { children: [/* @__PURE__ */ Q(at, {}), /* @__PURE__ */ $("div", {
3042
+ className: "flex w-full flex-wrap items-start gap-x-spacing-4 gap-y-spacing-5",
3043
+ children: [/* @__PURE__ */ Q(P, {
3044
+ color: "black",
3045
+ children: "설명"
3046
+ }), /* @__PURE__ */ Q("p", {
3047
+ className: "min-w-0 flex-1 text-12 leading-22 text-formula-default-text",
3048
+ children: n
3049
+ })]
3050
+ })] })]
3051
+ });
3052
+ }
3053
+ var Er = ({ children: e }) => /* @__PURE__ */ Q("span", {
3054
+ className: "shrink-0 text-12 font-semibold text-formula-parentheses",
3055
+ children: e
3056
+ }), Dr = ({ children: e }) => /* @__PURE__ */ Q("span", {
3057
+ className: "shrink-0 text-12 font-semibold text-formula-comparison",
3058
+ children: e
3059
+ }), Or = ({ children: e }) => /* @__PURE__ */ Q("span", {
3060
+ className: "shrink-0 text-12 text-formula-comparison",
3061
+ children: e
3062
+ }), kr = (e, t) => e?.find((e) => e.value === t)?.label ?? "";
3063
+ function Ar(e) {
3064
+ return e.kind === "group" ? {
3065
+ ...e,
3066
+ children: e.children.map(Ar)
3067
+ } : e.items?.length ? e.individual?.mode === "points" ? {
3068
+ ...e,
3069
+ individual: null
3070
+ } : e : e.scoreType === "plus" || e.scoreType === "minus" || e.points ? {
3071
+ ...e,
3072
+ points: "",
3073
+ scoreType: null
3074
+ } : e;
3075
+ }
3076
+ function jr({ onDropLeaf: e, getDropLeaf: t, onClose: n, closable: r = !0 }) {
3077
+ let [o, s] = Z(!1), c = !!t, l = X(null), u = a("조건 카드를 드래그 앤 드롭하세요");
3078
+ return /* @__PURE__ */ $("div", {
3079
+ ref: l,
3080
+ onMouseEnter: u.onMouseEnter,
3081
+ onMouseLeave: u.onMouseLeave,
3082
+ onDragOver: (e) => {
3083
+ !c || !t?.() || (e.preventDefault(), e.stopPropagation(), e.dataTransfer.dropEffect = "move", s(!0));
3084
+ },
3085
+ onDragLeave: () => s(!1),
3086
+ onDrop: (n) => {
3087
+ if (!c) return;
3088
+ n.preventDefault(), n.stopPropagation(), s(!1);
3089
+ let r = t?.();
3090
+ r && e(r);
3091
+ },
3092
+ className: `flex h-[38px] shrink-0 items-center gap-spacing-4 rounded-round-4 border border-dashed py-spacing-5 pl-spacing-7 ${r ? "pr-spacing-5-5" : "pr-spacing-7"} text-12 font-semibold transition-colors ${o ? "border-formula-add-drop-outline bg-formula-add-drop-bg text-formula-add-drop-text" : "border-formula-add-outline bg-formula-add-bg text-formula-add-text"}`,
3093
+ children: [
3094
+ "조건 추가",
3095
+ r && /* @__PURE__ */ Q("span", {
3096
+ className: "inline-flex shrink-0 items-center",
3097
+ onMouseEnter: u.onMouseLeave,
3098
+ onMouseLeave: () => {
3099
+ l.current && u.onMouseEnter({ currentTarget: l.current });
3100
+ },
3101
+ children: /* @__PURE__ */ Q(i, {
3102
+ variant: "ghost",
3103
+ size: "18",
3104
+ icon: tt,
3105
+ "aria-label": "영역 삭제",
3106
+ onClick: n
3107
+ })
3108
+ }),
3109
+ u.tooltip
3110
+ ]
3111
+ });
3112
+ }
3113
+ var Mr = [
3114
+ {
3115
+ value: ">=",
3116
+ label: ">= (보다 크거나 같을 때)"
3117
+ },
3118
+ {
3119
+ value: ">",
3120
+ label: "> (보다 클 때)"
3121
+ },
3122
+ {
3123
+ value: "=",
3124
+ label: "= (같을 때)"
3125
+ },
3126
+ {
3127
+ value: "<=",
3128
+ label: "<= (보다 작거나 같을 때)"
3129
+ },
3130
+ {
3131
+ value: "<",
3132
+ label: "< (보다 작을 때)"
3133
+ }
3134
+ ], Nr = {
3135
+ ">=": "이상",
3136
+ ">": "초과",
3137
+ "=": "",
3138
+ "<=": "이하",
3139
+ "<": "미만"
3140
+ };
3141
+ function Pr({ tooltip: e, value: t, placeholder: n, onChange: r }) {
3142
+ let i = a(e);
3143
+ return /* @__PURE__ */ $("span", {
3144
+ className: "inline-flex shrink-0 items-center",
3145
+ onMouseEnter: i.onMouseEnter,
3146
+ onMouseLeave: i.onMouseLeave,
3147
+ children: [/* @__PURE__ */ Q(u, {
3148
+ size: "22",
3149
+ width: 40,
3150
+ value: t,
3151
+ placeholder: n,
3152
+ onChange: r,
3153
+ inputProps: {
3154
+ inputMode: "numeric",
3155
+ "aria-label": e
3156
+ }
3157
+ }), i.tooltip]
3158
+ });
3159
+ }
3160
+ function Fr({ getDropLeaf: e, onDropLeaf: t }) {
3161
+ let [n, r] = Z(!1);
3162
+ return /* @__PURE__ */ $("div", {
3163
+ onDragOver: (t) => {
3164
+ !e || !e() || (t.preventDefault(), t.stopPropagation(), t.dataTransfer.dropEffect = "move", r(!0));
3165
+ },
3166
+ onDragLeave: () => r(!1),
3167
+ onDrop: (n) => {
3168
+ if (!e) return;
3169
+ n.preventDefault(), n.stopPropagation(), r(!1);
3170
+ let i = e();
3171
+ i && t(i);
3172
+ },
3173
+ className: `flex h-[38px] w-full items-center justify-center gap-spacing-3 rounded-round-4 border border-dashed text-14 text-builder-area-add-default-text transition-colors ${n ? "border-builder-area-add-hover-outline bg-builder-area-add-hover-bg" : "border-builder-area-add-default-outline bg-builder-area-add-default-bg"}`,
3174
+ children: [/* @__PURE__ */ Q(Xe, {
3175
+ size: 16,
3176
+ strokeWidth: 1.8,
3177
+ className: "shrink-0"
3178
+ }), "다른 조건을 여기에 끌어다 놓기"]
3179
+ });
3180
+ }
3181
+ function Ir({ node: e, root: t = !1, checked: n = !1, onCheckChange: r, onChange: i, onDelete: a, getDropLeaf: o, catalog: s, variant: c = "formula", inIf: l = !1, className: u = "" }) {
3182
+ return e.kind === "group" ? /* @__PURE__ */ Q(Lr, {
3183
+ node: e,
3184
+ root: t,
3185
+ checked: n,
3186
+ onCheckChange: r,
3187
+ onChange: i,
3188
+ onDelete: a,
3189
+ getDropLeaf: o,
3190
+ catalog: s,
3191
+ variant: c,
3192
+ inIf: l,
3193
+ className: u
3194
+ }) : /* @__PURE__ */ Q(Ur, {
3195
+ node: e,
3196
+ root: t,
3197
+ checked: n,
3198
+ onCheckChange: r,
3199
+ onChange: i,
3200
+ onDelete: a,
3201
+ getDropLeaf: o,
3202
+ catalog: s,
3203
+ variant: c,
3204
+ inIf: l,
3205
+ className: u
3206
+ });
3207
+ }
3208
+ function Lr({ node: e, root: t, checked: n, onCheckChange: r, onChange: a, onDelete: o, getDropLeaf: s, catalog: c, variant: u = "formula", inIf: d = !1, className: p }) {
3209
+ let [m, h] = Z([]), g = X(0), _ = () => h((e) => [...e, `add-${++g.current}`]), v = (e) => h((t) => t.filter((t) => t !== e)), b = (t) => a?.({
3210
+ ...e,
3211
+ ...t
3212
+ }), x = ur[e.fn], S = e.fn === "IF", C = e.fn === "CAPMAX" || e.fn === "CAPMIN", T = /* @__PURE__ */ Q(Pr, {
3213
+ tooltip: e.fn === "CAPMAX" ? "최대 제한 점수" : "최소 제한 점수",
3214
+ value: e.capScore ?? "",
3215
+ placeholder: "값",
3216
+ onChange: (e) => b({ capScore: e.target.value.replace(/[^0-9]/g, "") })
3217
+ }), D = e.fn === "FITBYSCORE" || e.fn === "UNFITBYSCORE", O = /* @__PURE__ */ Q(w, {
3218
+ options: Mr,
3219
+ value: e.compareOp ?? ">=",
3220
+ onChange: (e) => b({ compareOp: e.target.value }),
3221
+ menuWidth: 210
3222
+ }), k = /* @__PURE__ */ Q(Pr, {
3223
+ tooltip: "비교 기준 점수",
3224
+ value: e.compareScore ?? "",
3225
+ placeholder: "값",
3226
+ onChange: (e) => b({ compareScore: e.target.value.replace(/[^0-9]/g, "") })
3227
+ }), A = (t) => t === "IF" ? e.children.length !== 1 || e.children.some(mr) : t === "CAPMAX" || t === "CAPMIN" || t === "FITBYSCORE" || t === "UNFITBYSCORE" ? !e.children.some(mr) : !1, j = (t, n) => /* @__PURE__ */ Q(Pr, {
3228
+ tooltip: t === "trueScore" ? "참일 때 부여 점수" : "거짓일 때 부여 점수",
3229
+ value: e[t] ?? n,
3230
+ onChange: (e) => b({ [t]: e.target.value.replace(/[^0-9]/g, "") })
3231
+ }), M = (t, n) => {
3232
+ let r = e.children.slice();
3233
+ r[t] = n, b({ children: r });
3234
+ }, P = (t) => b({ children: e.children.filter((e, n) => n !== t) }), F = t ? Vr(e, c) : null;
3235
+ return u === "natural" ? /* @__PURE__ */ $(Tr, {
3236
+ family: x,
3237
+ className: `w-full ${p}`,
3238
+ children: [
3239
+ /* @__PURE__ */ $("div", {
3240
+ className: "flex w-full items-center gap-spacing-4",
3241
+ children: [
3242
+ t && r && /* @__PURE__ */ Q(l, {
3243
+ checked: n,
3244
+ onChange: (e) => r(e.target.checked)
3245
+ }),
3246
+ /* @__PURE__ */ Q(Or, { children: "다음 조건들 중" }),
3247
+ /* @__PURE__ */ Q(w, {
3248
+ options: dr.map((e) => ({
3249
+ value: e,
3250
+ label: e,
3251
+ disabled: A(e)
3252
+ })),
3253
+ value: e.fn,
3254
+ onChange: (e) => b({ fn: e.target.value }),
3255
+ menuWidth: 140,
3256
+ color: Cr[x] ?? "gray",
3257
+ weight: "semibold"
3258
+ }),
3259
+ /* @__PURE__ */ Q(Or, { children: "반영" }),
3260
+ /* @__PURE__ */ Q(i, {
3261
+ variant: "ghost",
3262
+ size: "18",
3263
+ icon: tt,
3264
+ "aria-label": "수식 삭제",
3265
+ onClick: o
3266
+ })
3267
+ ]
3268
+ }),
3269
+ e.children.map((e, t) => /* @__PURE__ */ Q(Ir, {
3270
+ node: e,
3271
+ onChange: (e) => M(t, e),
3272
+ onDelete: () => P(t),
3273
+ getDropLeaf: s,
3274
+ catalog: c,
3275
+ variant: u,
3276
+ inIf: S || d,
3277
+ className: "w-full"
3278
+ }, e.id)),
3279
+ S ? /* @__PURE__ */ $(rt, { children: [e.children.length === 0 && /* @__PURE__ */ Q(Fr, {
3280
+ getDropLeaf: s,
3281
+ onDropLeaf: (e) => b({ children: [Ar(e)] })
3282
+ }), /* @__PURE__ */ $("div", {
3283
+ className: "flex w-full items-center gap-spacing-4",
3284
+ children: [
3285
+ /* @__PURE__ */ Q(Or, { children: "참이면" }),
3286
+ j("trueScore", "1"),
3287
+ /* @__PURE__ */ Q(Or, { children: "점, 아니면" }),
3288
+ j("falseScore", "0"),
3289
+ /* @__PURE__ */ Q(Or, { children: "점 부여" })
3290
+ ]
3291
+ })] }) : C ? /* @__PURE__ */ $(rt, { children: [e.children.length === 0 && /* @__PURE__ */ Q(Fr, {
3292
+ getDropLeaf: s,
3293
+ onDropLeaf: (e) => b({ children: [e] })
3294
+ }), /* @__PURE__ */ $("div", {
3295
+ className: "flex w-full items-center gap-spacing-4",
3296
+ children: [
3297
+ /* @__PURE__ */ Q(Or, { children: e.fn === "CAPMAX" ? "최대" : "최소" }),
3298
+ T,
3299
+ /* @__PURE__ */ Q(Or, { children: "점으로 제한" })
3300
+ ]
3301
+ })] }) : D ? /* @__PURE__ */ $(rt, { children: [e.children.length === 0 && /* @__PURE__ */ Q(Fr, {
3302
+ getDropLeaf: s,
3303
+ onDropLeaf: (e) => b({ children: [e] })
3304
+ }), /* @__PURE__ */ $("div", {
3305
+ className: "flex w-full flex-wrap items-center gap-spacing-4",
3306
+ children: [
3307
+ /* @__PURE__ */ Q(Or, { children: "점수가" }),
3308
+ O,
3309
+ k,
3310
+ /* @__PURE__ */ Q(Or, { children: `점이면 ${e.fn === "FITBYSCORE" ? "적합" : "부적합"} 처리` })
3311
+ ]
3312
+ })] }) : /* @__PURE__ */ Q(Fr, {
3313
+ getDropLeaf: s,
3314
+ onDropLeaf: (t) => b({ children: [...e.children, t] })
3315
+ })
3316
+ ]
3317
+ }) : /* @__PURE__ */ $(Tr, {
3318
+ family: x,
3319
+ comment: F,
3320
+ className: p,
3321
+ children: [
3322
+ t && r && /* @__PURE__ */ Q(l, {
3323
+ checked: n,
3324
+ onChange: (e) => r(e.target.checked)
3325
+ }),
3326
+ /* @__PURE__ */ Q(E, {
3327
+ menuWidth: 140,
3328
+ trigger: /* @__PURE__ */ Q(i, {
3329
+ variant: "underline",
3330
+ size: "24",
3331
+ weight: "semibold",
3332
+ color: Cr[x] ?? "black",
3333
+ children: e.fn
3334
+ }),
3335
+ children: (t) => /* @__PURE__ */ Q(N, {
3336
+ width: "100%",
3337
+ children: /* @__PURE__ */ Q(f, { children: dr.map((n) => /* @__PURE__ */ Q(y, {
3338
+ title: n,
3339
+ selected: n === e.fn,
3340
+ disabled: A(n),
3341
+ onClick: A(n) ? void 0 : () => {
3342
+ b({ fn: n }), t();
3343
+ }
3344
+ }, n)) })
3345
+ })
3346
+ }),
3347
+ /* @__PURE__ */ Q(Er, { children: "(" }),
3348
+ e.children.map((e, t) => /* @__PURE__ */ $("span", {
3349
+ className: "inline-flex max-w-full flex-wrap items-center gap-spacing-4",
3350
+ children: [t > 0 && /* @__PURE__ */ Q(Dr, { children: "," }), /* @__PURE__ */ Q(Ir, {
3351
+ node: e,
3352
+ onChange: (e) => M(t, e),
3353
+ onDelete: () => P(t),
3354
+ getDropLeaf: s,
3355
+ catalog: c,
3356
+ variant: u,
3357
+ inIf: S || d
3358
+ })]
3359
+ }, e.id)),
3360
+ S ? /* @__PURE__ */ $(rt, { children: [
3361
+ e.children.length === 0 && /* @__PURE__ */ Q(jr, {
3362
+ getDropLeaf: s,
3363
+ onDropLeaf: (e) => b({ children: [Ar(e)] }),
3364
+ closable: !1
3365
+ }),
3366
+ /* @__PURE__ */ Q(Dr, { children: "," }),
3367
+ j("trueScore", "1"),
3368
+ /* @__PURE__ */ Q(Dr, { children: "," }),
3369
+ j("falseScore", "0")
3370
+ ] }) : C ? /* @__PURE__ */ $(rt, { children: [
3371
+ e.children.length === 0 && /* @__PURE__ */ Q(jr, {
3372
+ getDropLeaf: s,
3373
+ onDropLeaf: (e) => b({ children: [e] }),
3374
+ closable: !1
3375
+ }),
3376
+ /* @__PURE__ */ Q(Dr, { children: "," }),
3377
+ T
3378
+ ] }) : D ? /* @__PURE__ */ $(rt, { children: [
3379
+ e.children.length === 0 && /* @__PURE__ */ Q(jr, {
3380
+ getDropLeaf: s,
3381
+ onDropLeaf: (e) => b({ children: [e] }),
3382
+ closable: !1
3383
+ }),
3384
+ /* @__PURE__ */ Q(Dr, { children: "," }),
3385
+ O,
3386
+ /* @__PURE__ */ Q(Dr, { children: "," }),
3387
+ k
3388
+ ] }) : /* @__PURE__ */ $(rt, { children: [m.map((t, n) => /* @__PURE__ */ $("span", {
3389
+ className: "inline-flex items-center gap-spacing-4",
3390
+ children: [(e.children.length > 0 || n > 0) && /* @__PURE__ */ Q(Dr, { children: "," }), /* @__PURE__ */ Q(jr, {
3391
+ getDropLeaf: s,
3392
+ onDropLeaf: (n) => {
3393
+ b({ children: [...e.children, n] }), v(t);
3394
+ },
3395
+ onClose: () => v(t)
3396
+ })]
3397
+ }, t)), /* @__PURE__ */ Q(i, {
3398
+ variant: "ghost",
3399
+ size: "18",
3400
+ icon: Xe,
3401
+ "aria-label": "조건 추가",
3402
+ onClick: _
3403
+ })] }),
3404
+ /* @__PURE__ */ Q(Er, { children: ")" }),
3405
+ /* @__PURE__ */ Q(i, {
3406
+ variant: "ghost",
3407
+ size: "18",
3408
+ icon: tt,
3409
+ "aria-label": "수식 삭제",
3410
+ onClick: o
3411
+ })
3412
+ ]
3413
+ });
3414
+ }
3415
+ var Rr = {
3416
+ fit: "적합",
3417
+ unfit: "부적합"
3418
+ }, zr = (e) => {
3419
+ let t = e?.charCodeAt(e.length - 1) ?? 0;
3420
+ return t < 44032 || t > 55203 ? "가" : (t - 44032) % 28 > 0 ? "이" : "가";
3421
+ };
3422
+ function Br(e, t) {
3423
+ let n = t?.conditionMetaByCriteria?.[e.criteria ?? ""] ?? e.conditionMetaByCriteria?.[e.criteria ?? ""] ?? { tabs: [] };
3424
+ if (e.items?.length) {
3425
+ let r = kr(t?.criteriaOptions ?? e.criteriaOptions ?? [], e.criteria);
3426
+ if (!r) return null;
3427
+ let i = n.tabs?.find((t) => t.value === e.valueTab);
3428
+ return `${r} ${i?.bundleLabel ?? i?.label ?? ""} ${e.items.length}개 조건의 점수가 합산되어 계산됨`;
3429
+ }
3430
+ let r = t?.valueOptionsByCriteria?.[e.criteria ?? ""] ?? e.valueOptionsByCriteria?.[e.criteria ?? ""] ?? e.valueOptions ?? [], i = kr(t?.criteriaOptions ?? e.criteriaOptions ?? [], e.criteria), a = n.tabs?.find((t) => t.value === e.valueTab)?.label, o = e.value == null ? a : kr(r, e.value), s = Rr[e.scoreType ?? ""], c = s ? `${s} 처리` : e.points ? String(e.points).startsWith("-") ? `감점 ${String(e.points).slice(1)}점 부여` : `가점 ${e.points}점 부여` : null;
3431
+ return !i || !o ? null : `${i}${zr(i)} ${o}일 경우${c ? ` ${c}` : ""}`;
3432
+ }
3433
+ function Vr(e, t) {
3434
+ if (e.kind === "group") {
3435
+ let n = e.children.map((e) => Vr(e, t)).filter(Boolean), r = n.length ? n.join(", ") : null;
3436
+ if (e.fn === "IF") {
3437
+ let t = `조건이 참이면 ${e.trueScore ?? "1"}점, 아니면 ${e.falseScore ?? "0"}점 부여`;
3438
+ return r ? `${r} — ${t}` : t;
3439
+ }
3440
+ if ((e.fn === "CAPMAX" || e.fn === "CAPMIN") && e.capScore) {
3441
+ let t = `점수를 ${e.fn === "CAPMAX" ? "최대" : "최소"} ${e.capScore}점으로 제한`;
3442
+ return r ? `${r} — ${t}` : t;
3443
+ }
3444
+ if ((e.fn === "FITBYSCORE" || e.fn === "UNFITBYSCORE") && e.compareScore) {
3445
+ let t = Nr[e.compareOp ?? ">="], n = `점수가 ${e.compareScore}점${t ? ` ${t}` : ""}이면 ${e.fn === "FITBYSCORE" ? "적합" : "부적합"} 처리`;
3446
+ return r ? `${r} — ${n}` : n;
3447
+ }
3448
+ return r;
3449
+ }
3450
+ return Br(e, t);
3451
+ }
3452
+ function Hr({ children: e, open: t }) {
3453
+ return /* @__PURE__ */ $("span", {
3454
+ className: `inline-flex min-w-0 cursor-pointer items-center gap-spacing-3 rounded-round-4 border pl-spacing-4 pr-spacing-3 py-spacing-1 text-12 font-normal transition-colors ${s.gray} group-focus-visible/chipstop:text-chip-gray-hover-text group-focus-visible/chipstop:border-chip-gray-hover-line group-focus-visible/chipstop:bg-chip-gray-hover-bg group-data-[chain-focus]/chipstop:text-chip-gray-hover-text group-data-[chain-focus]/chipstop:border-chip-gray-hover-line group-data-[chain-focus]/chipstop:bg-chip-gray-hover-bg`,
3455
+ children: [/* @__PURE__ */ Q("span", {
3456
+ className: "truncate",
3457
+ children: e
3458
+ }), /* @__PURE__ */ Q(Ie, {
3459
+ size: 12,
3460
+ strokeWidth: 1.8,
3461
+ className: `pointer-events-none shrink-0 transition-transform ${t ? "rotate-180" : ""}`
3462
+ })]
3463
+ });
3464
+ }
3465
+ function Ur({ node: e, root: t, checked: n, onCheckChange: r, onChange: a, onDelete: o, catalog: s, variant: c = "formula", inIf: d = !1, className: f }) {
3466
+ let p = (t) => a?.({
3467
+ ...e,
3468
+ ...t
3469
+ }), m = X(null), h = e.display === "compact", g = !!e.items?.length, [_, v] = Z(!1), [y, b] = Z(!1), x = (t, n) => {
3470
+ t.items ? (a?.({
3471
+ ...e,
3472
+ valueTab: t.tab ?? null,
3473
+ value: null,
3474
+ items: t.items
3475
+ }), n(), setTimeout(() => document.querySelector(`[data-indiv-for="${e.id}"] input`)?.focus(), 0)) : (a?.({
3476
+ ...e,
3477
+ valueTab: t.tab ?? null,
3478
+ value: t.option ?? null,
3479
+ items: void 0,
3480
+ individual: void 0
3481
+ }), n(), T(!0));
3482
+ }, S = Rr[e.scoreType ?? ""], [C, T] = Z(!1), D = e.scoreType ?? (e.points ? String(e.points).startsWith("-") ? "minus" : "plus" : null), [O, k] = Z(!1), A = s?.conditionMetaByCriteria?.[e.criteria ?? ""] ?? e.conditionMetaByCriteria?.[e.criteria ?? ""] ?? {
3483
+ tabs: [],
3484
+ optionsByTab: {},
3485
+ options: e.valueOptions ?? []
3486
+ }, j = s?.criteriaOptions ?? e.criteriaOptions ?? [], M = s?.valueOptionsByCriteria?.[e.criteria ?? ""] ?? e.valueOptionsByCriteria?.[e.criteria ?? ""] ?? e.valueOptions ?? [], N = A.tabs?.some((e) => e.multiSelect) ? 351 : "max-content", P = c === "natural" ? null : t ? Br(e, s) : null;
3487
+ return /* @__PURE__ */ $(Tr, {
3488
+ family: "conditional",
3489
+ dense: !t,
3490
+ comment: P,
3491
+ className: f,
3492
+ children: [
3493
+ t && r && /* @__PURE__ */ Q(l, {
3494
+ checked: n,
3495
+ onChange: (e) => r(e.target.checked)
3496
+ }),
3497
+ h ? /* @__PURE__ */ $("button", {
3498
+ type: "button",
3499
+ onClick: () => p({ display: "full" }),
3500
+ className: "inline-flex min-w-0 items-center gap-spacing-3 rounded-round-4 border border-formula-compact-chip-line bg-formula-default-bg py-spacing-1 pl-spacing-4 pr-spacing-3 text-12 text-formula-compact-chip-text",
3501
+ children: [/* @__PURE__ */ Q("span", {
3502
+ className: "truncate",
3503
+ children: [
3504
+ kr(j, e.criteria) || kr(e.criteriaOptions, e.criteria),
3505
+ g ? `${e.items?.length}개 조건 묶음` : kr(M, e.value),
3506
+ g ? null : S ?? e.points
3507
+ ].filter(Boolean).join(", ")
3508
+ }), /* @__PURE__ */ Q(Ie, {
3509
+ size: 12,
3510
+ strokeWidth: 1.8,
3511
+ className: "shrink-0"
3512
+ })]
3513
+ }) : /* @__PURE__ */ $(rt, { children: [
3514
+ /* @__PURE__ */ Q("span", {
3515
+ ref: m,
3516
+ "data-formula-chain": !0,
3517
+ className: "inline-flex min-w-0 items-center",
3518
+ children: g ? /* @__PURE__ */ Q(E, {
3519
+ className: "group/chipstop min-w-0 rounded-round-4 focus:outline-none",
3520
+ tabIndex: 0,
3521
+ onKeyDown: (e) => pr(e, y, () => b(!0)),
3522
+ menuWidth: N,
3523
+ open: y,
3524
+ onOpenChange: b,
3525
+ trigger: /* @__PURE__ */ Q(Hr, {
3526
+ open: y,
3527
+ children: kr(j, e.criteria) || kr(e.criteriaOptions, e.criteria) || "조건"
3528
+ }),
3529
+ children: (t) => /* @__PURE__ */ Q(xr, {
3530
+ tabs: A.tabs,
3531
+ optionsByTab: A.optionsByTab,
3532
+ options: A.options,
3533
+ initialTab: e.valueTab,
3534
+ initialItems: e.items,
3535
+ onCancel: t,
3536
+ onSave: (e) => x(e, t),
3537
+ onSkip: () => {
3538
+ t(), fr(m.current);
3539
+ }
3540
+ })
3541
+ }) : /* @__PURE__ */ Q(w, {
3542
+ options: j,
3543
+ value: e.criteria,
3544
+ onChange: (e) => p({
3545
+ criteria: e.target.value,
3546
+ value: null,
3547
+ valueTab: null,
3548
+ items: void 0,
3549
+ individual: void 0
3550
+ }),
3551
+ placeholder: "조건",
3552
+ searchable: !0,
3553
+ searchPlaceholder: "조건 카드 검색",
3554
+ menuWidth: 160,
3555
+ tabOpens: !0
3556
+ })
3557
+ }),
3558
+ c === "natural" ? /* @__PURE__ */ Q(Or, { children: "이(가)" }) : /* @__PURE__ */ Q(Dr, { children: "=" }),
3559
+ g ? (() => {
3560
+ let t = A.tabs?.find((t) => t.value === e.valueTab), n = `${t?.bundleLabel ?? t?.label ?? ""}, ${e.items?.length}개 조건 묶음`, r = (e.items ?? []).map((e) => ({
3561
+ value: e,
3562
+ label: kr(M, e) || String(e)
3563
+ }));
3564
+ return /* @__PURE__ */ $(rt, { children: [
3565
+ /* @__PURE__ */ Q(E, {
3566
+ className: "group/chipstop min-w-0 rounded-round-4 focus:outline-none",
3567
+ tabIndex: 0,
3568
+ onKeyDown: (e) => pr(e, O, () => k(!0)),
3569
+ menuWidth: N,
3570
+ open: O,
3571
+ onOpenChange: k,
3572
+ trigger: /* @__PURE__ */ Q(Hr, {
3573
+ open: O,
3574
+ children: n
3575
+ }),
3576
+ children: (t) => /* @__PURE__ */ Q(xr, {
3577
+ tabs: A.tabs,
3578
+ optionsByTab: A.optionsByTab,
3579
+ options: A.options,
3580
+ initialTab: e.valueTab,
3581
+ initialItems: e.items,
3582
+ onCancel: t,
3583
+ onSave: (e) => x(e, t),
3584
+ onSkip: () => {
3585
+ t(), fr(m.current);
3586
+ }
3587
+ })
3588
+ }),
3589
+ c === "natural" ? /* @__PURE__ */ Q(Or, { children: "이면," }) : /* @__PURE__ */ Q(Dr, { children: "→" }),
3590
+ /* @__PURE__ */ Q("span", {
3591
+ "data-indiv-for": e.id,
3592
+ className: "inline-flex shrink-0 items-center",
3593
+ children: /* @__PURE__ */ Q(u, {
3594
+ size: "22",
3595
+ width: 68,
3596
+ value: "개별설정",
3597
+ readOnly: !0,
3598
+ className: "cursor-pointer ring-inset ring-text-field-hover-line transition-shadow hover:ring-2 has-[:focus-visible]:ring-2",
3599
+ inputProps: {
3600
+ style: { cursor: "pointer" },
3601
+ onClick: () => v(!0),
3602
+ onKeyDown: (e) => {
3603
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), v(!0));
3604
+ }
3605
+ }
3606
+ })
3607
+ }),
3608
+ _ && /* @__PURE__ */ Q(lr, {
3609
+ items: r,
3610
+ value: e.individual ?? null,
3611
+ fitnessOnly: d,
3612
+ onClose: () => v(!1),
3613
+ onConfirm: (e) => {
3614
+ p({ individual: e }), v(!1), fr(m.current);
3615
+ }
3616
+ })
3617
+ ] });
3618
+ })() : /* @__PURE__ */ $(rt, { children: [
3619
+ /* @__PURE__ */ Q(E, {
3620
+ className: "group/chipstop min-w-0 rounded-round-4 focus:outline-none",
3621
+ tabIndex: 0,
3622
+ onKeyDown: (e) => pr(e, O, () => k(!0)),
3623
+ menuWidth: N,
3624
+ open: O,
3625
+ onOpenChange: k,
3626
+ trigger: /* @__PURE__ */ Q(Hr, {
3627
+ open: O,
3628
+ children: (() => {
3629
+ let t = A.tabs.find((t) => t.value === e.valueTab)?.label;
3630
+ if (e.value != null) {
3631
+ let n = kr(M, e.value);
3632
+ return (t ? `${t}, ${n}` : n) || "조건";
3633
+ }
3634
+ return t || "조건";
3635
+ })()
3636
+ }),
3637
+ children: (t) => /* @__PURE__ */ Q(xr, {
3638
+ tabs: A.tabs,
3639
+ optionsByTab: A.optionsByTab,
3640
+ options: A.options,
3641
+ initialTab: e.valueTab,
3642
+ initialOption: e.value,
3643
+ initialItems: e.items,
3644
+ onCancel: t,
3645
+ onSave: (e) => x(e, t),
3646
+ onSkip: () => {
3647
+ t(), fr(m.current);
3648
+ }
3649
+ })
3650
+ }),
3651
+ c === "natural" ? /* @__PURE__ */ Q(Or, { children: "이면," }) : /* @__PURE__ */ Q(Dr, { children: "→" }),
3652
+ /* @__PURE__ */ Q(E, {
3653
+ className: "shrink-0",
3654
+ "data-score-for": e.id,
3655
+ onKeyDown: (e) => pr(e, C, () => T(!0)),
3656
+ menuWidth: 200,
3657
+ open: C,
3658
+ onOpenChange: T,
3659
+ trigger: /* @__PURE__ */ Q(u, {
3660
+ size: "22",
3661
+ width: S ? 56 : 48,
3662
+ value: S ?? (e.points ? `${String(e.points).startsWith("-") ? "" : "+"}${e.points}점` : ""),
3663
+ readOnly: !0,
3664
+ placeholder: "값",
3665
+ className: "cursor-pointer ring-inset ring-text-field-hover-line transition-shadow hover:ring-2 has-[:focus-visible]:ring-2",
3666
+ inputProps: { style: { cursor: "pointer" } }
3667
+ }),
3668
+ children: (t) => /* @__PURE__ */ Q(Sr, {
3669
+ initialType: D,
3670
+ initialPoints: String(e.points ?? "").replace(/^-/, ""),
3671
+ disablePoints: d,
3672
+ onCancel: t,
3673
+ onSave: ({ type: e, points: n }) => {
3674
+ let r = (n ?? "").replace(/^-/, "");
3675
+ p({
3676
+ scoreType: e,
3677
+ points: e === "minus" && r ? `-${r}` : e === "plus" ? r : ""
3678
+ }), t(), fr(m.current);
3679
+ },
3680
+ onSkip: () => {
3681
+ t(), fr(m.current);
3682
+ }
3683
+ })
3684
+ }),
3685
+ c === "natural" && /* @__PURE__ */ Q(Or, { children: S ? "처리" : "부여" })
3686
+ ] })
3687
+ ] }),
3688
+ /* @__PURE__ */ Q(i, {
3689
+ variant: "ghost",
3690
+ size: "18",
3691
+ icon: tt,
3692
+ "aria-label": "수식 삭제",
3693
+ onClick: o
3694
+ })
3695
+ ]
3696
+ });
3697
+ }
3698
+ //#endregion
3699
+ //#region src/components/ScreeningBuilderTemplate.tsx
3700
+ var Wr = (e) => `${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 6)}`, Gr = (e) => e.conditionTabs?.length ? Object.values(e.conditionOptionsByTab ?? {}).flat() : e.conditionOptions ?? [], Kr = De(function({ defaultCards: e = [], onChange: t, onFormulaChange: a, cardWidth: o = 375, formulaArea: s = !0, onAddCard: l, cardMenu: u = [], boxHeight: d = 800, className: f = "", ...m }, h) {
3701
+ let [_, v] = Z(() => e.map((e) => ({
3702
+ condition: null,
3703
+ score: null,
3704
+ ...e
3705
+ }))), b = (e) => e.map(({ id: e, name: t, condition: n, score: r }) => ({
3706
+ id: e,
3707
+ name: t,
3708
+ condition: n,
3709
+ score: r
3710
+ })), x = (e) => {
3711
+ v(e), t?.(b(e));
3712
+ }, [S, C] = Z("formula"), [w, T] = Z(() => [{
3713
+ id: Wr("zone"),
3714
+ name: "수식 영역 1",
3715
+ formulas: []
3716
+ }]), [D, O] = Z([]), [k, A] = Z(null), j = (e) => {
3717
+ T(e), a?.(e.map((e) => ({
3718
+ id: e.id,
3719
+ name: e.name,
3720
+ formulas: e.formulas
3721
+ })));
3722
+ }, M = (e, t) => j(w.map((n) => n.id === e ? {
3723
+ ...n,
3724
+ formulas: t(n.formulas)
3725
+ } : n)), P = () => j([{
3726
+ id: Wr("zone"),
3727
+ name: `수식 영역 ${w.length + 1}`,
3728
+ formulas: []
3729
+ }, ...w]), F = (e, t) => j(w.map((n) => n.id === e ? {
3730
+ ...n,
3731
+ name: t
3732
+ } : n)), I = (e) => {
3733
+ let t = w.find((t) => t.id === e), n = t ? t.formulas.map((e) => e.id) : [], r = w.filter((t) => t.id !== e);
3734
+ j(r.length > 0 ? r : [{
3735
+ id: Wr("zone"),
3736
+ name: "수식 영역 1",
3737
+ formulas: []
3738
+ }]), O((e) => e.filter((e) => !n.includes(e)));
3739
+ };
3740
+ Me(h, () => ({
3741
+ getCards: () => b(_),
3742
+ addCard: (e) => x([{
3743
+ condition: null,
3744
+ score: null,
3745
+ ...e
3746
+ }, ..._]),
3747
+ getFormulas: () => w.map((e) => ({
3748
+ id: e.id,
3749
+ name: e.name,
3750
+ formulas: e.formulas
3751
+ }))
3752
+ }));
3753
+ let L = (e, t) => x(_.map((n) => n.id === e ? {
3754
+ ...n,
3755
+ ...t
3756
+ } : n)), R = (e) => x(_.filter((t) => t.id !== e)), z = () => {
3757
+ if (l) return l();
3758
+ x([{
3759
+ id: Wr("card"),
3760
+ name: "새 조건",
3761
+ condition: null,
3762
+ score: null
3763
+ }, ..._]);
3764
+ }, B = (e) => x([{
3765
+ id: Wr("card"),
3766
+ name: e.name,
3767
+ conditionTabs: e.conditionTabs,
3768
+ conditionOptionsByTab: e.conditionOptionsByTab,
3769
+ conditionOptions: e.conditionOptions,
3770
+ conditionPlaceholder: e.conditionPlaceholder,
3771
+ condition: null,
3772
+ score: null
3773
+ }, ..._]), V = u.length > 0 && /* @__PURE__ */ Q(N, {
3774
+ width: "100%",
3775
+ children: /* @__PURE__ */ Q(r, { children: u.map((e, t) => /* @__PURE__ */ Q(p, { children: e.map((t, r) => /* @__PURE__ */ Q(n, {
3776
+ title: t.title,
3777
+ grow: r === e.length - 1,
3778
+ children: t.items.map((e) => /* @__PURE__ */ Q(y, {
3779
+ title: e.name,
3780
+ rightButton: !0,
3781
+ rightButtonIcon: Xe,
3782
+ rightButtonAriaLabel: "추가",
3783
+ onClick: () => B(e),
3784
+ onButtonClick: () => B(e)
3785
+ }, e.name))
3786
+ }, t.title)) }, t)) })
3787
+ }), [H, U] = Z(null), [W, G] = Z(null), K = X(!1), ee = {
3788
+ criteriaOptions: _.map((e) => ({
3789
+ value: e.id,
3790
+ label: e.name
3791
+ })),
3792
+ valueOptionsByCriteria: Object.fromEntries(_.map((e) => [e.id, Gr(e)])),
3793
+ conditionMetaByCriteria: Object.fromEntries(_.map((e) => [e.id, {
3794
+ tabs: e.conditionTabs ?? [],
3795
+ optionsByTab: e.conditionOptionsByTab ?? {},
3796
+ options: e.conditionOptions ?? []
3797
+ }]))
3798
+ }, q = (e) => ({
3799
+ id: Wr("formula"),
3800
+ kind: "leaf",
3801
+ criteria: e.id,
3802
+ criteriaOptions: ee.criteriaOptions,
3803
+ valueOptionsByCriteria: ee.valueOptionsByCriteria,
3804
+ conditionMetaByCriteria: ee.conditionMetaByCriteria
3805
+ }), J = (e, t) => {
3806
+ let n = (t ?? "").replace(/^-/, "");
3807
+ return e === "minus" && n ? `-${n}` : e === "plus" ? n : "";
3808
+ }, Y = (e) => {
3809
+ let t = e.score?.type ?? null;
3810
+ return {
3811
+ ...q(e),
3812
+ value: e.condition?.option ?? null,
3813
+ valueTab: e.condition?.tab ?? null,
3814
+ points: J(t, e.score?.points),
3815
+ scoreType: t
3816
+ };
3817
+ }, te = (e) => {
3818
+ let t = e.condition?.items;
3819
+ return t?.length ? {
3820
+ ...q(e),
3821
+ valueTab: e.condition?.tab ?? null,
3822
+ items: [...t],
3823
+ individual: e.score?.type === "individual" ? e.score : null
3824
+ } : Y(e);
3825
+ }, ne = (e) => {
3826
+ let t = _.find((e) => e.id === H);
3827
+ t && M(e, (e) => [...e, te(t)]);
3828
+ }, re = () => {
3829
+ let e = _.find((e) => e.id === H);
3830
+ return e ? te(e) : null;
3831
+ }, ie = (e) => e.formulas.filter((e) => D.includes(e.id)).map((e) => e.id), ae = (e) => {
3832
+ let t = e.formulas.filter((e) => D.includes(e.id));
3833
+ return t.length === 1 && !mr(t[0]);
3834
+ }, oe = (e) => {
3835
+ let t = e.formulas.filter((e) => D.includes(e.id));
3836
+ return t.length >= 1 && t.every(mr);
3837
+ }, se = (e, t) => e === "IF" ? ae(t) : e === "CAPMAX" || e === "CAPMIN" || e === "FITBYSCORE" || e === "UNFITBYSCORE" ? oe(t) : !0, ce = (e) => {
3838
+ let t = w.find((t) => t.id === e);
3839
+ if (!t || k == null || !se(k, t)) return;
3840
+ let n = ie(t);
3841
+ if (n.length < 1) return;
3842
+ let r = t.formulas.filter((e) => n.includes(e.id)), i = t.formulas.filter((e) => !n.includes(e.id)), a = t.formulas.findIndex((e) => n.includes(e.id)), o = i.slice();
3843
+ o.splice(Math.min(a, o.length), 0, {
3844
+ id: Wr("group"),
3845
+ kind: "group",
3846
+ fn: k,
3847
+ children: r
3848
+ }), j(w.map((t) => t.id === e ? {
3849
+ ...t,
3850
+ formulas: o
3851
+ } : t)), O((e) => e.filter((e) => !n.includes(e))), A(null);
3852
+ }, le = (e) => {
3853
+ let t = w.find((t) => t.id === e);
3854
+ if (!t) return;
3855
+ let n = ie(t);
3856
+ j(w.map((t) => t.id === e ? {
3857
+ ...t,
3858
+ formulas: t.formulas.flatMap((e) => n.includes(e.id) && e.kind === "group" ? e.children : [e])
3859
+ } : t)), O((e) => e.filter((e) => !n.includes(e)));
3860
+ };
3861
+ return /* @__PURE__ */ Q("div", {
3862
+ style: { height: d },
3863
+ className: `relative overflow-hidden rounded-round-4 border border-builder-area-box-line bg-builder-area-box-bg ${f}`,
3864
+ ...m,
3865
+ children: /* @__PURE__ */ $("div", {
3866
+ className: "flex h-full items-stretch",
3867
+ children: [/* @__PURE__ */ $("div", {
3868
+ className: "relative shrink-0 border-r border-builder-area-box-line bg-builder-area-card-area-bg",
3869
+ onDragOver: (e) => {
3870
+ H != null && (e.preventDefault(), e.dataTransfer.dropEffect = "move");
3871
+ },
3872
+ onDrop: (e) => e.preventDefault(),
3873
+ children: [
3874
+ /* @__PURE__ */ $("div", {
3875
+ className: "pointer-events-none absolute inset-x-0 top-0 z-10 flex h-[60px] flex-col",
3876
+ children: [/* @__PURE__ */ Q("div", { className: "h-[42px] bg-builder-area-card-area-bg" }), /* @__PURE__ */ Q("div", { className: "h-[18px] bg-gradient-to-b from-builder-area-card-area-bg to-builder-area-header-fade-bottom" })]
3877
+ }),
3878
+ /* @__PURE__ */ Q("div", {
3879
+ className: "pointer-events-none absolute inset-x-0 top-0 z-10",
3880
+ children: /* @__PURE__ */ $("div", {
3881
+ className: "pointer-events-auto flex items-center justify-between px-spacing-7 pb-spacing-6 pt-spacing-7",
3882
+ children: [/* @__PURE__ */ Q("span", {
3883
+ className: "text-15 font-semibold text-font-icon-5",
3884
+ children: "조건 리스트"
3885
+ }), u.length > 0 ? /* @__PURE__ */ Q(E, {
3886
+ menuWidth: 804,
3887
+ trigger: /* @__PURE__ */ Q(i, {
3888
+ variant: "line",
3889
+ size: "32",
3890
+ leftIcon: Xe,
3891
+ children: "추가"
3892
+ }),
3893
+ children: V
3894
+ }) : /* @__PURE__ */ Q(i, {
3895
+ variant: "line",
3896
+ size: "32",
3897
+ leftIcon: Xe,
3898
+ onClick: z,
3899
+ children: "추가"
3900
+ })]
3901
+ })
3902
+ }),
3903
+ /* @__PURE__ */ $(c, {
3904
+ maxHeight: d - 2,
3905
+ children: [/* @__PURE__ */ Q("div", {
3906
+ "data-scroll-sticky-top": !0,
3907
+ className: "h-[60px]"
3908
+ }), /* @__PURE__ */ $("div", {
3909
+ className: "flex flex-col gap-spacing-6 px-spacing-7 pb-spacing-7",
3910
+ children: [_.length === 0 && /* @__PURE__ */ $("div", {
3911
+ style: {
3912
+ width: typeof o == "number" ? o : void 0,
3913
+ minHeight: d - 2 - 60 - 16
3914
+ },
3915
+ className: "flex flex-col items-center justify-center gap-spacing-5",
3916
+ children: [/* @__PURE__ */ Q("p", {
3917
+ className: "text-14 text-font-icon-3",
3918
+ children: "등록된 조건이 없습니다"
3919
+ }), u.length > 0 ? /* @__PURE__ */ Q(E, {
3920
+ menuWidth: 804,
3921
+ trigger: /* @__PURE__ */ Q(i, {
3922
+ variant: "line",
3923
+ size: "32",
3924
+ leftIcon: Xe,
3925
+ children: "조건 추가하기"
3926
+ }),
3927
+ children: V
3928
+ }) : /* @__PURE__ */ Q(i, {
3929
+ variant: "line",
3930
+ size: "32",
3931
+ leftIcon: Xe,
3932
+ onClick: z,
3933
+ children: "조건 추가하기"
3934
+ })]
3935
+ }), _.map((e) => /* @__PURE__ */ Q(br, {
3936
+ cardName: e.name,
3937
+ conditionTabs: e.conditionTabs ?? [],
3938
+ conditionOptionsByTab: e.conditionOptionsByTab ?? {},
3939
+ conditionOptions: e.conditionOptions ?? [],
3940
+ conditionPlaceholder: e.conditionPlaceholder,
3941
+ conditionValue: e.condition,
3942
+ onConditionChange: (t) => {
3943
+ let n = e.score?.type === "individual", r = !!t?.items?.length;
3944
+ L(e.id, {
3945
+ condition: t,
3946
+ ...n === r ? {} : { score: null }
3947
+ });
3948
+ },
3949
+ scoreValue: e.score,
3950
+ onScoreChange: (t) => L(e.id, { score: t }),
3951
+ onDelete: () => R(e.id),
3952
+ width: o,
3953
+ dragging: H === e.id,
3954
+ dragHandleProps: {
3955
+ onMouseDown: () => {
3956
+ K.current = !0;
3957
+ },
3958
+ onMouseUp: () => {
3959
+ K.current = !1;
3960
+ }
3961
+ },
3962
+ draggable: !0,
3963
+ onDragStart: (t) => {
3964
+ if (!K.current) {
3965
+ t.preventDefault();
3966
+ return;
3967
+ }
3968
+ U(e.id), t.dataTransfer.effectAllowed = "move";
3969
+ try {
3970
+ t.dataTransfer.setData("text/plain", String(e.id));
3971
+ } catch {}
3972
+ },
3973
+ onDragEnd: () => {
3974
+ U(null), G(null), K.current = !1;
3975
+ },
3976
+ onDragOver: (e) => {
3977
+ H != null && (e.preventDefault(), e.dataTransfer.dropEffect = "move");
3978
+ },
3979
+ onDrop: (e) => e.preventDefault()
3980
+ }, e.id))]
3981
+ })]
3982
+ })
3983
+ ]
3984
+ }), s && /* @__PURE__ */ $("div", {
3985
+ className: "relative min-w-0 flex-1",
3986
+ children: [
3987
+ /* @__PURE__ */ $("div", {
3988
+ className: "pointer-events-none absolute inset-x-0 top-0 z-10 flex h-[60px] flex-col",
3989
+ children: [/* @__PURE__ */ Q("div", { className: "h-[42px] bg-builder-area-header-fade-top" }), /* @__PURE__ */ Q("div", { className: "h-[18px] bg-gradient-to-b from-builder-area-header-fade-top to-builder-area-header-fade-bottom" })]
3990
+ }),
3991
+ /* @__PURE__ */ Q("div", {
3992
+ className: "pointer-events-none absolute inset-x-0 top-0 z-10",
3993
+ children: /* @__PURE__ */ $("div", {
3994
+ className: "pointer-events-auto flex items-center px-spacing-7 pb-spacing-6 pt-spacing-7",
3995
+ children: [/* @__PURE__ */ Q("div", {
3996
+ className: "w-[180px]",
3997
+ children: /* @__PURE__ */ Q(ir, {
3998
+ items: [{
3999
+ value: "formula",
4000
+ label: "수식 빌더"
4001
+ }, {
4002
+ value: "natural",
4003
+ label: "자연어 빌더"
4004
+ }],
4005
+ value: S,
4006
+ onChange: C
4007
+ })
4008
+ }), /* @__PURE__ */ Q(i, {
4009
+ variant: "line",
4010
+ size: "32",
4011
+ leftIcon: Xe,
4012
+ onClick: P,
4013
+ className: "ml-auto",
4014
+ children: "수식 영역 추가"
4015
+ })]
4016
+ })
4017
+ }),
4018
+ /* @__PURE__ */ $(c, {
4019
+ maxHeight: d - 2,
4020
+ children: [/* @__PURE__ */ Q("div", {
4021
+ "data-scroll-sticky-top": !0,
4022
+ className: "h-[60px]"
4023
+ }), /* @__PURE__ */ Q("div", {
4024
+ className: "flex flex-col gap-spacing-5 px-spacing-7 pb-spacing-7",
4025
+ children: /* @__PURE__ */ Q(ot, { children: w.map((e) => /* @__PURE__ */ Q(st, {
4026
+ title: e.name,
4027
+ defaultOpen: !0,
4028
+ nameEditable: !0,
4029
+ onTitleChange: (t) => F(e.id, t),
4030
+ deletable: !0,
4031
+ deleteDisabled: w.length <= 1 && e.formulas.length === 0,
4032
+ onDelete: () => I(e.id),
4033
+ children: /* @__PURE__ */ $("div", {
4034
+ className: "flex flex-col gap-spacing-5",
4035
+ children: [e.formulas.map((t, n) => /* @__PURE__ */ Q(Ir, {
4036
+ node: t,
4037
+ root: !0,
4038
+ checked: D.includes(t.id),
4039
+ onCheckChange: (e) => O((n) => e ? [...n, t.id] : n.filter((e) => e !== t.id)),
4040
+ onChange: (t) => M(e.id, (e) => e.map((e, r) => r === n ? t : e)),
4041
+ onDelete: () => {
4042
+ M(e.id, (e) => e.filter((e, t) => t !== n)), O((e) => e.filter((e) => e !== t.id));
4043
+ },
4044
+ getDropLeaf: re,
4045
+ catalog: ee,
4046
+ variant: S === "natural" ? "natural" : "formula"
4047
+ }, t.id)), /* @__PURE__ */ $("div", {
4048
+ className: "relative w-full",
4049
+ children: [/* @__PURE__ */ $("div", {
4050
+ onDragOver: (t) => {
4051
+ H != null && (t.preventDefault(), t.dataTransfer.dropEffect = "move", G(e.id));
4052
+ },
4053
+ onDragLeave: (t) => {
4054
+ t.currentTarget.contains(t.relatedTarget) || G((t) => t === e.id ? null : t);
4055
+ },
4056
+ onDrop: (t) => {
4057
+ t.preventDefault(), G(null), ne(e.id);
4058
+ },
4059
+ className: `flex h-[78px] w-full items-center justify-center gap-spacing-3 rounded-round-4 border border-dashed p-spacing-6 text-14 text-builder-area-add-default-text transition-colors ${W === e.id || e.formulas.some((e) => D.includes(e.id)) ? "border-builder-area-add-hover-outline bg-builder-area-add-hover-bg" : "border-builder-area-add-default-outline bg-builder-area-add-default-bg"}`,
4060
+ children: [/* @__PURE__ */ Q(Xe, {
4061
+ size: 16,
4062
+ strokeWidth: 1.8,
4063
+ className: "shrink-0"
4064
+ }), "다른 조건을 여기에 끌어다 놓기"]
4065
+ }), ie(e).length > 0 && /* @__PURE__ */ Q("div", {
4066
+ className: "pointer-events-none absolute inset-0 z-10 flex items-center justify-center",
4067
+ children: /* @__PURE__ */ $(nr, {
4068
+ className: "pointer-events-auto",
4069
+ children: [
4070
+ /* @__PURE__ */ Q(g, {
4071
+ width: 200,
4072
+ options: dr.map((t) => ({
4073
+ value: t,
4074
+ label: t,
4075
+ disabled: !se(t, e)
4076
+ })),
4077
+ value: k ?? "",
4078
+ onChange: (e) => A(e.target.value),
4079
+ placeholder: "함수 선택",
4080
+ disabled: ie(e).length < 1
4081
+ }),
4082
+ /* @__PURE__ */ Q(i, {
4083
+ variant: "ghost",
4084
+ size: "32",
4085
+ leftIcon: Ue,
4086
+ disabled: k == null || ie(e).length < 1 || !se(k, e),
4087
+ onClick: () => ce(e.id),
4088
+ children: "함수 적용"
4089
+ }),
4090
+ /* @__PURE__ */ Q(rr, {}),
4091
+ /* @__PURE__ */ Q(i, {
4092
+ variant: "ghost",
4093
+ size: "32",
4094
+ leftIcon: We,
4095
+ disabled: !e.formulas.some((e) => D.includes(e.id) && e.kind === "group"),
4096
+ onClick: () => le(e.id),
4097
+ children: "함수 해제"
4098
+ }),
4099
+ /* @__PURE__ */ Q(rr, {}),
4100
+ /* @__PURE__ */ Q(i, {
4101
+ variant: "ghost",
4102
+ icon: tt,
4103
+ "aria-label": "선택 해제",
4104
+ showTooltip: !1,
4105
+ onClick: () => {
4106
+ let t = ie(e);
4107
+ O((e) => e.filter((e) => !t.includes(e)));
4108
+ }
4109
+ })
4110
+ ]
4111
+ })
4112
+ })]
4113
+ })]
4114
+ })
4115
+ }, e.id)) })
4116
+ })]
4117
+ })
4118
+ ]
4119
+ })]
4120
+ })
4121
+ });
4122
+ }), qr = {
4123
+ 3: "gap-spacing-3",
4124
+ 4: "gap-spacing-4",
4125
+ 5: "gap-spacing-5",
4126
+ 6: "gap-spacing-6",
4127
+ 7: "gap-spacing-7"
4128
+ };
4129
+ function Jr(e) {
4130
+ let t = [];
4131
+ return Se.forEach(e, (e) => {
4132
+ Oe(e) && e.type === we ? t.push(...Jr(e.props.children)) : e != null && typeof e != "boolean" && t.push(e);
4133
+ }), t;
4134
+ }
4135
+ function Yr({ children: e, direction: t = "horizontal", gap: n = "5", width: r = "hug", className: i = "", ...a }) {
4136
+ let o = t === "vertical" ? "flex-col" : "flex-row", s = qr[n] ?? qr[5], c = r === "fill", l = Jr(e).map((e, t) => {
4137
+ if (!Oe(e)) return e;
4138
+ let n = e.key ?? `sg-${t}`;
4139
+ if (!c) return Te(e, { key: n });
4140
+ let r = e;
4141
+ return /* @__PURE__ */ Q("div", {
4142
+ className: "min-w-0 flex-1",
4143
+ children: e.type === g ? Te(r, { width: r.props.width ?? "100%" }) : e
4144
+ }, n);
4145
+ });
4146
+ return /* @__PURE__ */ Q("div", {
4147
+ className: `${c ? "flex w-full" : "inline-flex"} ${o} ${s} ${i}`,
4148
+ ...a,
4149
+ children: l
4150
+ });
4151
+ }
4152
+ //#endregion
4153
+ //#region src/utils/phone.ts
4154
+ function Xr(e) {
4155
+ let t = String(e).replace(/\D/g, "").slice(0, 11);
4156
+ return t ? t.startsWith("02") ? t.length <= 2 ? t : t.length <= 6 ? `${t.slice(0, 2)}-${t.slice(2)}` : t.length <= 9 ? `${t.slice(0, 2)}-${t.slice(2, 5)}-${t.slice(5)}` : `${t.slice(0, 2)}-${t.slice(2, 6)}-${t.slice(6, 10)}` : t.length <= 3 ? t : t.length <= 7 ? `${t.slice(0, 3)}-${t.slice(3)}` : t.length <= 10 ? `${t.slice(0, 3)}-${t.slice(3, 6)}-${t.slice(6)}` : `${t.slice(0, 3)}-${t.slice(3, 7)}-${t.slice(7)}` : "";
4157
+ }
4158
+ //#endregion
4159
+ //#region src/components/SelectOrInput.tsx
4160
+ function Zr({ value: e, defaultValue: t = "", onChange: n, options: r = [], showSelect: i = !0, showInput: a = !0, selectPlaceholder: o = "선택하세요", inputPlaceholder: s = "직접 입력하세요", disabled: c = !1, readOnly: l = !1, error: d = !1, errorMessage: f = "", formatInput: p, width: m = 400, selectWidth: h = 160, menuWidth: _, placement: v = "auto", searchable: y = !1, inputProps: b = {}, className: x = "", ...S }) {
4161
+ let C = Pe(() => r.map((e) => typeof e == "string" ? {
4162
+ value: e,
4163
+ label: e
4164
+ } : e), [r]), w = e !== void 0, T = (e) => e ? i ? a ? C.some((t) => t.value === e) ? "select" : "input" : "select" : "input" : null, [E, D] = Z(t), [O, k] = Z(() => T(t)), A = e === void 0 ? E : e, j = A ? a ? i ? O ?? T(A) : "input" : "select" : null, M = (e, t) => {
4165
+ let r = e ? t : null;
4166
+ k(r), w || D(e), n?.({ target: {
4167
+ value: e,
4168
+ source: r
4169
+ } });
4170
+ }, N = j === "select" ? A : "", P = j === "input" ? A : "", F = typeof m == "number" ? `${m}px` : m;
4171
+ return /* @__PURE__ */ $("div", {
4172
+ className: `flex items-start gap-spacing-5 ${x}`,
4173
+ style: { width: F },
4174
+ ...S,
4175
+ children: [i && /* @__PURE__ */ Q(g, {
4176
+ options: C,
4177
+ value: N,
4178
+ onChange: (e) => M(e.target.value, "select"),
4179
+ placeholder: o,
4180
+ width: a ? h : "100%",
4181
+ menuWidth: _,
4182
+ placement: v,
4183
+ searchable: y,
4184
+ disabled: c,
4185
+ readOnly: l,
4186
+ error: !a && d,
4187
+ errorMessage: a ? "" : f
4188
+ }), a && /* @__PURE__ */ Q("div", {
4189
+ className: "min-w-0 flex-1",
4190
+ children: /* @__PURE__ */ Q(u, {
4191
+ value: P,
4192
+ onChange: (e) => M(p ? p(e.target.value) : e.target.value, "input"),
4193
+ placeholder: s,
4194
+ width: "100%",
4195
+ disabled: c,
4196
+ readOnly: l,
4197
+ error: d,
4198
+ errorMessage: f,
4199
+ inputProps: b
4200
+ })
4201
+ })]
4202
+ });
4203
+ }
4204
+ function Qr({ selectPlaceholder: e = "이메일 선택", inputPlaceholder: t = "이메일을 직접 입력하세요", inputProps: n = {}, ...r }) {
4205
+ return /* @__PURE__ */ Q(Zr, {
4206
+ selectPlaceholder: e,
4207
+ inputPlaceholder: t,
4208
+ inputProps: {
4209
+ inputMode: "email",
4210
+ ...n
4211
+ },
4212
+ ...r
4213
+ });
4214
+ }
4215
+ function $r({ selectPlaceholder: e = "전화번호 선택", inputPlaceholder: t = "전화번호를 직접 입력하세요", formatInput: n = Xr, inputProps: r = {}, ...i }) {
4216
+ return /* @__PURE__ */ Q(Zr, {
4217
+ selectPlaceholder: e,
4218
+ inputPlaceholder: t,
4219
+ formatInput: n ?? void 0,
4220
+ inputProps: {
4221
+ inputMode: "tel",
4222
+ ...r
4223
+ },
4224
+ ...i
4225
+ });
4226
+ }
4227
+ //#endregion
4228
+ //#region src/components/SideNavigation.tsx
4229
+ var ei = {
4230
+ default: "text-side-nav-default-text hover:bg-side-nav-hover-bg hover:text-side-nav-hover-text cursor-pointer focus-visible:bg-side-nav-hover-bg focus-visible:text-side-nav-hover-text",
4231
+ select: "bg-side-nav-select-bg text-side-nav-select-text cursor-pointer",
4232
+ disabled: "text-side-nav-disabled-text cursor-not-allowed"
4233
+ };
4234
+ function ti({ children: e = "side menu", icon: t, selected: n = !1, disabled: r = !1, showNewTag: i = !1, newTagColor: a = "blue", showArrow: s = !0, overflow: c = "ellipsis", line: l = !0, onClick: u, className: d = "", ...f }) {
4235
+ let p = r ? "disabled" : n ? "select" : "default", m = l ? "rounded-l-round-4" : "rounded-round-4", g = p === "select" && l;
4236
+ return /* @__PURE__ */ $("button", {
4237
+ type: "button",
4238
+ disabled: r,
4239
+ onClick: u,
4240
+ "aria-current": n || void 0,
4241
+ className: `relative flex min-h-[32px] w-full items-center px-spacing-6 py-spacing-4 text-left transition-colors focus:outline-none ${m} ${ei[p]} ${d}`,
4242
+ ...f,
4243
+ children: [
4244
+ g && /* @__PURE__ */ Q("span", {
4245
+ "aria-hidden": !0,
4246
+ className: "pointer-events-none absolute inset-y-0 right-0 w-spacing-1 bg-side-nav-select-text"
4247
+ }),
4248
+ /* @__PURE__ */ $("span", {
4249
+ className: "flex min-w-0 flex-1 items-center gap-spacing-5",
4250
+ children: [
4251
+ t && /* @__PURE__ */ Q(t, {
4252
+ size: 16,
4253
+ strokeWidth: 1.8,
4254
+ className: "shrink-0"
4255
+ }),
4256
+ c === "wrap" ? /* @__PURE__ */ Q("span", {
4257
+ className: "min-w-0 whitespace-normal break-words text-14 leading-20",
4258
+ children: e
4259
+ }) : /* @__PURE__ */ Q(o, {
4260
+ as: "span",
4261
+ className: "truncate text-14 leading-20",
4262
+ children: e
4263
+ }),
4264
+ i && /* @__PURE__ */ Q(h, { color: a })
4265
+ ]
4266
+ }),
4267
+ s && /* @__PURE__ */ Q(Re, {
4268
+ size: 16,
4269
+ strokeWidth: 1.8,
4270
+ className: "shrink-0"
4271
+ })
4272
+ ]
4273
+ });
4274
+ }
4275
+ function ni({ children: e, width: t = 180, line: n = !0, showAdd: r = !0, addLabel: i = "add menu", addPosition: a = "bottom", onAdd: o, className: s = "", ...l }) {
4276
+ return /* @__PURE__ */ $("nav", {
4277
+ style: { width: typeof t == "number" ? `${t}px` : t },
4278
+ className: `relative flex flex-col gap-spacing-2 ${s}`,
4279
+ ...l,
4280
+ children: [
4281
+ n && /* @__PURE__ */ Q("span", {
4282
+ "aria-hidden": !0,
4283
+ className: "pointer-events-none absolute inset-y-0 right-0 w-spacing-1 bg-side-nav-right-line"
4284
+ }),
4285
+ r && a === "top" && /* @__PURE__ */ Q(ti, {
4286
+ icon: Xe,
4287
+ showArrow: !1,
4288
+ line: n,
4289
+ onClick: o,
4290
+ children: i
4291
+ }),
4292
+ /* @__PURE__ */ Q(c, {
4293
+ className: "min-h-0 flex-1",
4294
+ contentClassName: "max-h-full flex flex-col gap-spacing-2",
4295
+ children: e
4296
+ }),
4297
+ r && a === "bottom" && /* @__PURE__ */ Q(ti, {
4298
+ icon: Xe,
4299
+ showArrow: !1,
4300
+ line: n,
4301
+ onClick: o,
4302
+ children: i
4303
+ })
4304
+ ]
4305
+ });
4306
+ }
4307
+ //#endregion
4308
+ //#region src/components/SideNavigationTemplate.tsx
4309
+ function ri({ menus: e = [], selectedId: t, defaultSelectedId: n, onSelect: r, navWidth: i = 180, line: a = !0, showAdd: o = !0, addLabel: s = "add menu", addPosition: c = "top", onAdd: l, overflow: u = "ellipsis", height: d, children: f, className: p = "", ...m }) {
4310
+ let h = Ae(jn), g = d === "fill", _ = g ? h == null ? "100%" : `${h}px` : null, v = g ? null : typeof d == "number" ? `${d}px` : d, y = t !== void 0, [b, x] = Z(n), S = y ? t : b ?? e[0]?.id ?? null, C = (e) => {
4311
+ y || x(e), r?.(e);
4312
+ };
4313
+ return /* @__PURE__ */ $("div", {
4314
+ style: v ? { height: v } : _ ? { maxHeight: _ } : void 0,
4315
+ className: `flex min-h-0 items-stretch gap-spacing-7 ${p}`,
4316
+ ...m,
4317
+ children: [/* @__PURE__ */ Q(ni, {
4318
+ width: i,
4319
+ line: a,
4320
+ showAdd: o,
4321
+ addLabel: s,
4322
+ addPosition: c,
4323
+ onAdd: l,
4324
+ className: "shrink-0",
4325
+ children: e.map((e) => /* @__PURE__ */ Q(ti, {
4326
+ icon: e.icon,
4327
+ selected: S === e.id,
4328
+ disabled: e.disabled,
4329
+ showNewTag: e.showNewTag,
4330
+ newTagColor: e.newTagColor,
4331
+ overflow: u,
4332
+ line: a,
4333
+ onClick: () => C(e.id),
4334
+ children: e.count ? `${e.label} ${e.count}` : e.label
4335
+ }, e.id))
4336
+ }), /* @__PURE__ */ Q("div", {
4337
+ className: "flex min-h-0 min-w-0 flex-1 flex-col gap-spacing-6",
4338
+ children: f
4339
+ })]
4340
+ });
4341
+ }
4342
+ //#endregion
4343
+ //#region src/components/TableTemplate.tsx
4344
+ function ii({ columns: t = [], rows: n = [], rowKey: r = "id", actions: i = null, rightActions: a = null, selects: o = null, rightSelects: s = null, title: c = null, searchable: l = !0, pagination: u = !0, bordered: d = !1, selectable: f = !1, searchPlaceholder: p = "검색어를 입력하세요", searchKeys: m, searchWidth: h = 200, page: g, onPageChange: _, defaultPageSize: v = 10, pageSize: y, onPageSizeChange: b, pageSizeOptions: x, showPageSize: S = !0, showTotal: C = !0, maxButtons: w, paginationClassName: T = "", selectedIds: E, onSelectChange: D, wrap: O = !1, minWidth: A = 720, maxHeight: j, loading: M = !1, emptyMessage: N, onRowClick: P, buttonGroupGap: F = "5", selectGroupGap: I = "5", className: L = "", ...R }) {
4345
+ let [z, B] = Z(""), [V, H] = Z({}), [U, W] = Z(null), G = g !== void 0, [K, ee] = Z(1), q = G ? g : K, J = (e) => {
4346
+ G || ee(e), _?.(e);
4347
+ }, Y = y !== void 0, [te, ne] = Z(v), re = Y ? y : te, ie = (e) => {
4348
+ Y || ne(e), b?.(e), J(1);
4349
+ }, ae = E !== void 0, [oe, se] = Z([]), ce = ae ? E : oe, le = (e) => {
4350
+ ae || se(e), D?.(e);
4351
+ }, ue = Pe(() => m ?? t.filter((e) => !e.render).map((e) => e.key), [m, t]), de = Pe(() => {
4352
+ if (!l || !z) return n;
4353
+ let e = z.toLowerCase();
4354
+ return n.filter((t) => ue.some((n) => String(t[n] ?? "").toLowerCase().includes(e)));
4355
+ }, [
4356
+ n,
4357
+ z,
4358
+ l,
4359
+ ue
4360
+ ]), fe = Pe(() => yn(vn(de, t, V), U), [
4361
+ de,
4362
+ t,
4363
+ V,
4364
+ U
4365
+ ]), pe = (e) => {
4366
+ H(e), J(1);
4367
+ }, me = (e) => {
4368
+ W(e), J(1);
4369
+ }, he = fe.length, ge = Math.max(1, Math.ceil(he / re)), _e = Math.min(q, ge), ve = u ? fe.slice((_e - 1) * re, (_e - 1) * re + re) : fe, ye = {
4370
+ selectedIds: ce,
4371
+ clearSelection: () => le([]),
4372
+ visibleRows: ve,
4373
+ query: z
4374
+ }, be = typeof i == "function" ? i(ye) : i, xe = typeof a == "function" ? a(ye) : a, Se = typeof o == "function" ? o(ye) : o, Ce = typeof s == "function" ? s(ye) : s, we = !!be || l || !!c || !!xe || !!Se || !!Ce;
4375
+ return /* @__PURE__ */ $("div", {
4376
+ className: `flex flex-col gap-spacing-6 ${L}`,
4377
+ ...R,
4378
+ children: [
4379
+ we && /* @__PURE__ */ $("div", {
4380
+ className: "flex items-center justify-between gap-spacing-6",
4381
+ children: [/* @__PURE__ */ $("div", {
4382
+ className: "flex items-center gap-spacing-5",
4383
+ children: [
4384
+ c && /* @__PURE__ */ Q("h3", {
4385
+ className: "flex h-[32px] items-center text-15 font-semibold text-font-icon-5",
4386
+ children: c
4387
+ }),
4388
+ Se && /* @__PURE__ */ Q(Yr, {
4389
+ gap: I,
4390
+ children: Se
4391
+ }),
4392
+ be && /* @__PURE__ */ Q(k, {
4393
+ gap: F,
4394
+ children: be
4395
+ })
4396
+ ]
4397
+ }), (l || xe || Ce) && /* @__PURE__ */ $("div", {
4398
+ className: "flex items-center gap-spacing-5",
4399
+ children: [
4400
+ xe && /* @__PURE__ */ Q(k, {
4401
+ gap: F,
4402
+ children: xe
4403
+ }),
4404
+ Ce && /* @__PURE__ */ Q(Yr, {
4405
+ gap: I,
4406
+ children: Ce
4407
+ }),
4408
+ l && /* @__PURE__ */ Q(e, {
4409
+ value: z,
4410
+ placeholder: p,
4411
+ width: h,
4412
+ onChange: (e) => {
4413
+ B(e.target.value), J(1);
4414
+ }
4415
+ })
4416
+ ]
4417
+ })]
4418
+ }),
4419
+ /* @__PURE__ */ Q(En, {
4420
+ columns: t,
4421
+ rows: ve,
4422
+ rowKey: r,
4423
+ bordered: d,
4424
+ selectable: f,
4425
+ selectedIds: f ? ce : void 0,
4426
+ onSelectChange: f ? le : void 0,
4427
+ filters: V,
4428
+ onFilterChange: pe,
4429
+ sort: U,
4430
+ onSortChange: me,
4431
+ wrap: O,
4432
+ minWidth: A,
4433
+ maxHeight: j,
4434
+ loading: M,
4435
+ emptyMessage: N,
4436
+ onRowClick: P
4437
+ }),
4438
+ u && /* @__PURE__ */ Q(tr, {
4439
+ page: _e,
4440
+ onChange: J,
4441
+ totalCount: he,
4442
+ pageSize: re,
4443
+ pageSizeOptions: x,
4444
+ showPageSize: S,
4445
+ showTotal: C,
4446
+ maxButtons: w,
4447
+ onPageSizeChange: ie,
4448
+ className: T
4449
+ })
4450
+ ]
4451
+ });
4452
+ }
4453
+ //#endregion
4454
+ //#region src/components/TextArea.tsx
4455
+ var ai = "ring-inset ring-text-field-hover-line hover:ring-2 focus-within:ring-2 focus-within:ring-text-field-focused-line", oi = 24, si = 6, ci = {
4456
+ base: ee["scroll-bar"],
4457
+ active: ee["scroll-bar-hover"]
4458
+ };
4459
+ function li({ value: e, defaultValue: t, onChange: n, placeholder: r = "텍스트를 입력하세요", rows: i = 4, autoGrow: a = !1, maxRows: o, maxLength: s, showCount: c = !0, disabled: l = !1, readOnly: u = !1, error: f = !1, errorMessage: p = "", width: m = 320, className: h = "", textareaProps: g = {}, ..._ }) {
4460
+ let v = !l && !u, y = typeof m == "number" ? `${m}px` : m, b = X(null), x = X(!1), [S, C] = Z((t ?? "").length), w = e == null ? S : e.length, [T, E] = Z({
4461
+ pos: 0,
4462
+ size: 0,
4463
+ visible: !1
4464
+ }), [D, O] = Z(!1), k = l ? "text-text-field-disabled-text" : u ? "text-text-field-readonly-text" : "text-text-field-filled-text", A = l ? "placeholder:text-text-field-disabled-text" : "placeholder:text-text-field-default-text", j = ke(() => {
4465
+ let e = b.current;
4466
+ if (!e) return;
4467
+ let { scrollHeight: t, clientHeight: n, scrollTop: r } = e;
4468
+ if (t <= n + 1) {
4469
+ E((e) => e.visible ? {
4470
+ ...e,
4471
+ visible: !1
4472
+ } : e);
4473
+ return;
4474
+ }
4475
+ let i = n - si * 2, a = Math.max(n / t * i, oi);
4476
+ E({
4477
+ pos: si + r / (t - n) * (i - a),
4478
+ size: a,
4479
+ visible: !0
4480
+ });
4481
+ }, []), M = ke(() => {
4482
+ let e = b.current;
4483
+ if (!e) return;
4484
+ if (!a) {
4485
+ e.style.height = "";
4486
+ return;
4487
+ }
4488
+ e.style.height = "auto";
4489
+ let t = getComputedStyle(e), n = parseFloat(t.lineHeight) || 24, r = parseFloat(t.paddingTop) + parseFloat(t.paddingBottom), s = Math.max(e.scrollHeight, i * n + r);
4490
+ o != null && (s = Math.min(s, o * n + r)), e.style.height = `${s}px`;
4491
+ }, [
4492
+ a,
4493
+ o,
4494
+ i
4495
+ ]);
4496
+ Ne(() => {
4497
+ M(), j();
4498
+ let e = b.current;
4499
+ if (!e) return;
4500
+ let t = new ResizeObserver(j);
4501
+ t.observe(e);
4502
+ let n = () => {
4503
+ M(), j();
4504
+ };
4505
+ return window.addEventListener("resize", n), () => {
4506
+ t.disconnect(), window.removeEventListener("resize", n);
4507
+ };
4508
+ }, [
4509
+ M,
4510
+ j,
4511
+ e,
4512
+ i
4513
+ ]);
4514
+ let N = (t) => {
4515
+ e ?? C(t.target.value.length), M(), j(), n?.(t);
4516
+ }, P = X(null);
4517
+ je(() => () => P.current?.(), []);
4518
+ let F = (e) => {
4519
+ e.preventDefault(), e.stopPropagation();
4520
+ let t = b.current;
4521
+ if (!t) return;
4522
+ x.current = !0, O(!0);
4523
+ let n = e.clientY, r = t.scrollTop, i = t.scrollHeight - t.clientHeight, a = t.clientHeight - si * 2 - T.size, o = a > 0 ? i / a : 0, s = (e) => {
4524
+ t.scrollTop = r + (e.clientY - n) * o;
4525
+ }, c = () => {
4526
+ x.current = !1, O(!1), document.body.style.userSelect = "", window.removeEventListener("mousemove", s), window.removeEventListener("mouseup", c), P.current = null;
4527
+ };
4528
+ document.body.style.userSelect = "none", window.addEventListener("mousemove", s), window.addEventListener("mouseup", c), P.current = c;
4529
+ };
4530
+ return /* @__PURE__ */ $("div", {
4531
+ style: { width: y },
4532
+ className: `relative rounded-round-4 bg-text-field-default-bg pl-spacing-6 pr-spacing-4 transition-shadow ${v ? ai : "cursor-not-allowed"} ${h}`,
4533
+ ..._,
4534
+ children: [
4535
+ /* @__PURE__ */ Q("textarea", {
4536
+ ref: b,
4537
+ value: e,
4538
+ defaultValue: t,
4539
+ onChange: N,
4540
+ onScroll: j,
4541
+ placeholder: r,
4542
+ disabled: l,
4543
+ readOnly: u,
4544
+ rows: i,
4545
+ maxLength: s,
4546
+ "aria-invalid": f || void 0,
4547
+ className: `hide-native-scroll block w-full resize-none overflow-y-auto bg-transparent pt-spacing-4 pb-spacing-12 text-14 outline-none disabled:cursor-not-allowed read-only:cursor-default ${A} ${k}`,
4548
+ ...g
4549
+ }),
4550
+ /* @__PURE__ */ Q("div", {
4551
+ onMouseDown: F,
4552
+ onMouseEnter: () => O(!0),
4553
+ onMouseLeave: () => {
4554
+ x.current || O(!1);
4555
+ },
4556
+ className: "absolute right-spacing-3 w-spacing-4 cursor-pointer rounded-round-00 before:absolute before:-inset-spacing-2 before:content-['']",
4557
+ style: {
4558
+ top: `${T.pos}px`,
4559
+ height: `${T.size}px`,
4560
+ opacity: +!!T.visible,
4561
+ pointerEvents: T.visible ? "auto" : "none",
4562
+ backgroundColor: D ? ci.active : ci.base
4563
+ }
4564
+ }),
4565
+ c && !u && /* @__PURE__ */ $("p", {
4566
+ className: "pointer-events-none absolute bottom-spacing-4 right-spacing-6 text-12 text-font-icon-3",
4567
+ children: [w, s == null ? "" : `/${s}`]
4568
+ }),
4569
+ f && p && /* @__PURE__ */ Q("div", {
4570
+ className: "absolute left-0 top-full z-10 mt-spacing-2",
4571
+ children: /* @__PURE__ */ Q(d, {
4572
+ variant: "error",
4573
+ beak: "top",
4574
+ children: p
4575
+ })
4576
+ })
4577
+ ]
4578
+ });
4579
+ }
4580
+ //#endregion
4581
+ //#region src/components/TimeField.tsx
4582
+ var ui = "ring-inset ring-text-field-hover-line hover:ring-2 focus-within:ring-2 focus-within:ring-text-field-focused-line", di = (e) => String(e).padStart(2, "0"), fi = /[\d:]/, pi = Array.from({ length: 24 }, (e, t) => ({
4583
+ value: di(t),
4584
+ label: `${di(t)}시`
4585
+ })), mi = Array.from({ length: 60 }, (e, t) => ({
4586
+ value: di(t),
4587
+ label: `${di(t)}분`
4588
+ }));
4589
+ function hi(e) {
4590
+ let t = (e ?? "").trim(), n = t.match(/^(\d{1,2}):(\d{1,2})$/) || t.match(/^(\d{2})(\d{1,2})$/);
4591
+ if (!n) return null;
4592
+ let r = Number(n[1]), i = Number(n[2]);
4593
+ return r > 23 || i > 59 ? null : `${di(r)}:${di(i)}`;
4594
+ }
4595
+ function gi({ value: e, defaultValue: t = null, onChange: n, placeholder: r = "시간을 선택하세요", disabled: i = !1, readOnly: a = !1, error: o = !1, errorMessage: s = "", formatErrorMessage: c = "HH:MM 형식으로 입력하세요", width: l, className: u = "", ...f }) {
4596
+ let p = !i && !a, [m, h] = Z(!1), [g, _] = Z(!1), [v, y] = Z(""), [b, x] = Z(!1), S = X(!1), C = X(null), [w, T] = Z(null), D = e !== void 0, [O, k] = Z(t), A = e === void 0 ? O : e, j = (e) => {
4597
+ D || k(e), n?.(e), x(!1);
4598
+ }, M = A || "", N = !M, [P, F] = (A || "").split(":"), I = (e) => {
4599
+ let t = e.trim();
4600
+ if (t === "") {
4601
+ j(null);
4602
+ return;
4603
+ }
4604
+ let n = hi(t);
4605
+ if (!n) {
4606
+ x(!0);
4607
+ return;
4608
+ }
4609
+ j(n);
4610
+ }, L = i ? "text-text-field-disabled-text" : a ? "text-text-field-readonly-text" : "text-text-field-filled-text", R = i ? "text-text-field-disabled-icon" : a ? "text-text-field-readonly-icon" : N ? "text-text-field-default-text" : "text-font-icon-5", z = o || b, B = b ? c : s, V = l ?? 120, H = V === "hug", U = V === "fill", W = H || U ? void 0 : typeof V == "number" ? `${V}px` : V, G = Math.max(((g ? v : M) || r).length + 1, 1), K = /* @__PURE__ */ $("div", {
4611
+ className: `relative ${U ? "w-full" : H ? "w-fit" : ""}`,
4612
+ style: W ? { width: W } : void 0,
4613
+ children: [
4614
+ /* @__PURE__ */ $("div", {
4615
+ className: `group flex min-h-[32px] ${H ? "w-fit" : "w-full"} items-center gap-spacing-3 rounded-round-4 bg-text-field-default-bg px-spacing-6 py-spacing-3 transition-shadow ${p ? `cursor-text ${ui}` : i ? "cursor-not-allowed" : "cursor-default"}`,
4616
+ children: [/* @__PURE__ */ Q(Ve, {
4617
+ size: 16,
4618
+ strokeWidth: 1.8,
4619
+ className: `shrink-0 ${R}`
4620
+ }), /* @__PURE__ */ Q("input", {
4621
+ ref: C,
4622
+ type: "text",
4623
+ value: g ? v : M,
4624
+ placeholder: r,
4625
+ readOnly: !p,
4626
+ disabled: i,
4627
+ size: H ? G : void 0,
4628
+ "aria-invalid": z || void 0,
4629
+ onClick: (e) => e.stopPropagation(),
4630
+ onMouseEnter: (e) => {
4631
+ let t = e.currentTarget;
4632
+ !g && M && t.scrollWidth > t.clientWidth + 1 && T(t.getBoundingClientRect());
4633
+ },
4634
+ onMouseLeave: () => T(null),
4635
+ onFocus: (e) => {
4636
+ p && (_(!0), x(!1), T(null), y(M), h(!0), e.target.select());
4637
+ },
4638
+ onChange: (e) => {
4639
+ y(Array.from(e.target.value).filter((e) => fi.test(e)).join("")), b && x(!1);
4640
+ },
4641
+ onBlur: () => {
4642
+ if (p) {
4643
+ if (_(!1), S.current) {
4644
+ S.current = !1;
4645
+ return;
4646
+ }
4647
+ I(v);
4648
+ }
4649
+ },
4650
+ onKeyDown: (e) => {
4651
+ p && (e.key === "Enter" ? (e.preventDefault(), I(v), h(!1), S.current = !0, e.currentTarget.blur()) : e.key === "Escape" && (y(M), x(!1), h(!1), S.current = !0, e.currentTarget.blur()));
4652
+ },
4653
+ className: `bg-transparent text-14 outline-none placeholder:text-text-field-default-text disabled:cursor-not-allowed read-only:cursor-pointer ${L} ${H ? "w-auto" : "min-w-0 flex-1 text-ellipsis"}`
4654
+ })]
4655
+ }),
4656
+ z && B && !m && /* @__PURE__ */ Q("div", {
4657
+ className: "absolute left-0 top-full z-10 mt-spacing-2",
4658
+ children: /* @__PURE__ */ Q(d, {
4659
+ variant: "error",
4660
+ beak: "top",
4661
+ children: B
4662
+ })
4663
+ }),
4664
+ w && !g && nt(/* @__PURE__ */ Q("div", {
4665
+ className: "pointer-events-none z-[1000]",
4666
+ style: {
4667
+ position: "fixed",
4668
+ left: w.left,
4669
+ top: w.top > 40 ? w.top - 6 : w.bottom + 6,
4670
+ transform: w.top > 40 ? "translateY(-100%)" : void 0
4671
+ },
4672
+ children: /* @__PURE__ */ Q(d, {
4673
+ variant: "normal",
4674
+ beak: "none",
4675
+ children: M
4676
+ })
4677
+ }), document.body)
4678
+ ]
4679
+ });
4680
+ return /* @__PURE__ */ Q(E, {
4681
+ open: m,
4682
+ onOpenChange: (e) => {
4683
+ h(e), !e && C.current && document.activeElement === C.current && (y(M), x(!1), S.current = !0, C.current.blur());
4684
+ },
4685
+ disabled: !p,
4686
+ placement: "auto",
4687
+ menuWidth: 140,
4688
+ trigger: K,
4689
+ className: `${U ? "w-full" : ""} ${u}`,
4690
+ ...f,
4691
+ children: () => /* @__PURE__ */ Q(bt, {
4692
+ showInput: !1,
4693
+ width: 140,
4694
+ leftOptions: pi,
4695
+ leftValue: P,
4696
+ onLeftChange: (e) => j(`${e}:${F || "00"}`),
4697
+ rightOptions: mi,
4698
+ rightValue: F,
4699
+ onRightChange: (e) => j(`${P || "00"}:${e}`),
4700
+ maxVisible: 5
4701
+ })
4702
+ });
4703
+ }
4704
+ //#endregion
4705
+ export { ot as Accordion, st as AccordionItem, Rn as AlertModal, i as Button, k as ButtonGroup, hr as CHAIN_STOP_FOCUS, s as CHIP_COLOR_CLASS, dt as CalendarDayButton, l as Checkbox, C as CheckboxGroup, ft as Chip, _t as ConditionOrderSlot, xr as ConditionSettingMenu, gt as ConditionSlotCard, zn as ConfirmModal, nn as DateField, Ut as DatePicker, at as Divider, Qr as EmailField, rn as ErrorBoundary, ur as FORMULA_FN_FAMILY, dr as FORMULA_GROUP_FUNCTIONS, ln as Field, dn as FileUploadButton, un as FileUploadMenu, Bn as FormModal, mn as FormTemplate, gn as ImageUploadButton, hn as ImageUploadMenu, S as InlineFieldTrigger, u as Input, On as JobPositionTemplate, on as Label, y as List, t as ListEmpty, f as ListGroup, In as Modal, jn as ModalBodyMaxContext, h as NewTag, qn as NoticeWritingTemplate, tr as Pagination, $r as PhoneField, E as Popover, N as PopoverMenu, p as PopoverMenuColumn, r as PopoverMenuColumns, n as PopoverMenuSection, M as Radio, F as RadioGroup, Sr as ScoreSettingMenu, Kr as ScreeningBuilderTemplate, br as ScreeningConditionCard, Ir as ScreeningFormula, lr as ScreeningIndividualSettingModal, c as ScrollArea, e as SearchBar, O as SegmentControlButton, x as SegmentControlGroup, ir as SegmentedTabs, g as Select, w as SelectChip, Yr as SelectGroup, Zr as SelectOrInput, ni as SideNavigation, ti as SideNavigationButton, ri as SideNavigationTemplate, I as Slot, m as Switch, Vn as TabMenu, En as Table, ii as TableTemplate, Hn as Tabs, P as Tag, li as TextArea, gi as TimeField, nr as ToolBar, rr as ToolBarDivider, d as Tooltip, o as TruncatingText, bt as TwoDepthList, ie as accordionColors, vn as applyColumnFilters, yn as applySort, H as baseColors, de as borderWidth, ve as builderAreaColors, L as buttonColors, te as calendarColors, pr as chainTriggerKey, ue as checkboxColors, B as chipColors, _n as compareValues, Y as conditionCardColors, be as conditionOrderSlotColors, z as dividerColors, J as editorColors, fe as editorHighlightPalette, he as editorTextPalette, fr as focusNextChainStop, U as fontFamily, se as fontIconColors, G as fontSize, Kt as formatDate, qt as formatDateTime, Jt as formatDateTimeRange, Xr as formatPhoneNumber, xe as formulaColors, mr as hasPointsScore, j as hasPopoverLayers, xn as iconCellWidth, ge as iconTokens, _ as isTopPopoverLayer, W as labelFieldColors, V as lineHeight, ee as listColors, le as modalColors, R as newTagColors, v as pushPopoverLayer, pe as radioColors, me as radius, D as removePopoverLayer, ae as segmentedColors, K as sideNavColors, oe as spacing, re as switchColors, ne as tabColors, _e as tableColors, ye as tagColors, ce as textFieldColors, q as toolbarColors, An as useFocusTrap, a as useHoverTooltip, T as useOutsideDismiss, gr as usePanelKeyboard, b as usePopoverPosition };
4706
+
4707
+ //# sourceMappingURL=index.js.map