@pop-ui/core 2.2.3 → 2.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/core.css +1 -1
- package/dist/core.js +58 -3110
- package/dist/core.umd.cjs +3 -3
- package/dist/esm/components/Button/index.js +75 -0
- package/dist/esm/components/Button/style.js +9 -0
- package/dist/esm/components/Button/styles.module.scss.js +28 -0
- package/dist/esm/components/CalendarDatePicker/index.js +119 -0
- package/dist/esm/components/CalendarDatePicker/styles.module.scss.js +34 -0
- package/dist/esm/components/CalendarDatePicker/utils.js +82 -0
- package/dist/esm/components/Checkbox/index.js +32 -0
- package/dist/esm/components/Checkbox/styles.module.scss.js +9 -0
- package/dist/esm/components/DatePicker/index.js +203 -0
- package/dist/esm/components/DatePicker/styles.module.scss.js +57 -0
- package/dist/esm/components/Dropdown/index.js +61 -0
- package/dist/esm/components/Dropdown/styles.module.scss.js +21 -0
- package/dist/esm/components/ImageInput/ImageInputCropModal.js +91 -0
- package/dist/esm/components/ImageInput/helpers.js +46 -0
- package/dist/esm/components/ImageInput/index.js +379 -0
- package/dist/esm/components/ImageInput/styles.module.scss.js +30 -0
- package/dist/esm/components/LottieInput/helpers.js +48 -0
- package/dist/esm/components/LottieInput/index.js +233 -0
- package/dist/esm/components/LottieInput/styles.module.scss.js +14 -0
- package/dist/esm/components/Map/Map.js +48 -0
- package/dist/esm/components/Map/NaverMapContext.js +78 -0
- package/dist/esm/components/Map/markerClustering.js +305 -0
- package/dist/esm/components/Map/markerStyles.js +351 -0
- package/dist/esm/components/Map/useLocation.js +40 -0
- package/dist/esm/components/Map/useMap.js +95 -0
- package/dist/esm/components/MapInfo/index.js +120 -0
- package/dist/esm/components/MapInfo/styles.module.scss.js +24 -0
- package/dist/esm/components/Modal/index.js +52 -0
- package/dist/esm/components/Pagination/index.js +45 -0
- package/dist/esm/components/Pagination/style.module.scss.js +13 -0
- package/dist/esm/components/Radio/index.js +29 -0
- package/dist/esm/components/Radio/styles.module.scss.js +9 -0
- package/dist/esm/components/SearchBar/index.js +60 -0
- package/dist/esm/components/SearchBar/styles.module.scss.js +25 -0
- package/dist/esm/components/SegmentButton/index.js +25 -0
- package/dist/esm/components/SegmentButton/styles.module.scss.js +9 -0
- package/dist/esm/components/Tab/index.js +14 -0
- package/dist/esm/components/Tab/styles.module.scss.js +10 -0
- package/dist/esm/components/TextField/index.js +99 -0
- package/dist/esm/components/TextField/styles.module.scss.js +28 -0
- package/dist/esm/components/TimePicker/index.js +33 -0
- package/dist/esm/components/TimePicker/styles.module.scss.js +9 -0
- package/dist/esm/components/Toast/index.js +35 -0
- package/dist/esm/components/Toast/styles.module.scss.js +14 -0
- package/dist/esm/components/Toggle/index.js +48 -0
- package/dist/esm/components/Toggle/styles.module.scss.js +9 -0
- package/dist/esm/components/Tooltip/index.js +25 -0
- package/dist/esm/components/Tooltip/styles.module.scss.js +12 -0
- package/dist/esm/components/shared/MultiItemInput/Dropzone.js +30 -0
- package/dist/esm/components/shared/MultiItemInput/SortableEmptySlot.js +29 -0
- package/dist/esm/components/shared/MultiItemInput/TileShell.js +113 -0
- package/dist/esm/components/shared/MultiItemInput/helpers.js +23 -0
- package/dist/esm/components/shared/MultiItemInput/styles.module.scss.js +30 -0
- package/dist/esm/components/shared/MultiItemInput/usePositionGrid.js +49 -0
- package/dist/esm/components/shared/MultiItemInput/useSortableGrid.js +20 -0
- package/dist/esm/theme/ThemeProvider.js +46 -0
- package/dist/esm/theme/cssVariables.js +29 -0
- package/dist/esm/theme/mantineTheme.js +36 -0
- package/package.json +2 -2
package/dist/core.js
CHANGED
|
@@ -1,3113 +1,61 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import "
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"Button--Primary": "styles-module__Button--Primary___1ZKgs",
|
|
31
|
-
Button__Disabled: Mr,
|
|
32
|
-
"Button--PrimaryLine": "styles-module__Button--PrimaryLine___76iyF",
|
|
33
|
-
"Button--Basic": "styles-module__Button--Basic___sWKzj",
|
|
34
|
-
"Button--Warning": "styles-module__Button--Warning___8gZ6-",
|
|
35
|
-
"Button--Setting": "styles-module__Button--Setting___KNjZA",
|
|
36
|
-
"Button--Danger": "styles-module__Button--Danger___m9tbm",
|
|
37
|
-
"Button--Ghost": "styles-module__Button--Ghost___-zzS-"
|
|
38
|
-
}, Te = {
|
|
39
|
-
inner: U.Button__Inner,
|
|
40
|
-
label: U.Button__Label,
|
|
41
|
-
section: U.Button__Section,
|
|
42
|
-
loader: U.Button__Loader
|
|
43
|
-
}, Sr = {
|
|
44
|
-
sm: U["Button--Small"],
|
|
45
|
-
md: U["Button--Medium"],
|
|
46
|
-
lg: U["Button--Large"]
|
|
47
|
-
}, Tr = {
|
|
48
|
-
primary: U["Button--Primary"],
|
|
49
|
-
primaryLine: U["Button--PrimaryLine"],
|
|
50
|
-
basic: U["Button--Basic"],
|
|
51
|
-
danger: U["Button--Danger"],
|
|
52
|
-
setting: U["Button--Setting"],
|
|
53
|
-
warning: U["Button--Warning"],
|
|
54
|
-
ghost: U["Button--Ghost"]
|
|
55
|
-
}, wr = (...e) => e.filter(Boolean).join(" ") || void 0, vr = (e) => {
|
|
56
|
-
const r = (n, t) => {
|
|
57
|
-
const o = Object.keys(n).reduce((s, a) => {
|
|
58
|
-
const i = a, c = [n[i], t[i]].filter(Boolean).join(" ");
|
|
59
|
-
return c && (s[i] = c), s;
|
|
60
|
-
}, {});
|
|
61
|
-
return Object.keys(t).forEach((s) => {
|
|
62
|
-
const a = s;
|
|
63
|
-
!(a in n) && t[a] && (o[a] = t[a]);
|
|
64
|
-
}), o;
|
|
65
|
-
};
|
|
66
|
-
return typeof e == "function" ? (n, t, o) => r(Te, e(n, t, o)) : typeof e == "object" && e !== null && !Array.isArray(e) ? r(Te, e) : Te;
|
|
67
|
-
};
|
|
68
|
-
function me({
|
|
69
|
-
children: e,
|
|
70
|
-
size: r = "md",
|
|
71
|
-
variant: n = "primary",
|
|
72
|
-
type: t = "button",
|
|
73
|
-
isLoading: o = !1,
|
|
74
|
-
loading: s = !1,
|
|
75
|
-
hideLabelOnLoading: a = !0,
|
|
76
|
-
disabled: i = !1,
|
|
77
|
-
className: c,
|
|
78
|
-
classNames: m,
|
|
79
|
-
loaderProps: p,
|
|
80
|
-
..._
|
|
81
|
-
}) {
|
|
82
|
-
const d = kr[r], u = o || s, f = i || u;
|
|
83
|
-
return /* @__PURE__ */ D(
|
|
84
|
-
vt,
|
|
85
|
-
{
|
|
86
|
-
type: t,
|
|
87
|
-
unstyled: !0,
|
|
88
|
-
className: wr(
|
|
89
|
-
U.Button,
|
|
90
|
-
i ? U.Button__Disabled : "",
|
|
91
|
-
Sr[r],
|
|
92
|
-
Tr[n],
|
|
93
|
-
c
|
|
94
|
-
),
|
|
95
|
-
classNames: vr(m),
|
|
96
|
-
disabled: f,
|
|
97
|
-
..._,
|
|
98
|
-
children: [
|
|
99
|
-
u && /* @__PURE__ */ l(rt, { color: "currentColor", size: d, ...p }),
|
|
100
|
-
/* @__PURE__ */ l("span", { className: U.Button__Label, children: u && a ? null : e })
|
|
101
|
-
]
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
const we = {
|
|
106
|
-
"Checkbox--Small": "styles-module__Checkbox--Small___VZGlw",
|
|
107
|
-
"Checkbox--Medium": "styles-module__Checkbox--Medium___Vwpa3",
|
|
108
|
-
"Checkbox--Large": "styles-module__Checkbox--Large___ybTGE"
|
|
109
|
-
}, Ir = {
|
|
110
|
-
sm: we["Checkbox--Small"],
|
|
111
|
-
md: we["Checkbox--Medium"],
|
|
112
|
-
lg: we["Checkbox--Large"]
|
|
113
|
-
}, Br = {
|
|
114
|
-
sm: 18,
|
|
115
|
-
md: 24,
|
|
116
|
-
lg: 32
|
|
117
|
-
}, Ba = ({ size: e = "md", ...r }) => {
|
|
118
|
-
const n = Ir[e], t = Br[e];
|
|
119
|
-
return /* @__PURE__ */ l(
|
|
120
|
-
It,
|
|
121
|
-
{
|
|
122
|
-
className: n,
|
|
123
|
-
size: e,
|
|
124
|
-
styles: {
|
|
125
|
-
inner: {
|
|
126
|
-
width: t,
|
|
127
|
-
height: t
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
...r
|
|
131
|
-
}
|
|
132
|
-
);
|
|
133
|
-
}, Lr = "styles-module__CalendarDatePicker__Wrapper___n4ux3", Er = "styles-module__CalendarDatePicker__DayContent___2xr8Q", Ar = "styles-module__CalendarDatePicker__DayLabel___-4E1W", Nr = "styles-module__CalendarDatePicker__TodayIndicator___ij6hs", Or = "styles-module__CalendarDatePicker__Day___eYyiw", Fr = "styles-module__CalendarDatePicker__Header___hGYbK", $r = "styles-module__CalendarDatePicker__HeaderLevel___yuhOQ", Rr = "styles-module__CalendarDatePicker__HeaderControl___gz5tC", zr = "styles-module__CalendarDatePicker__HeaderControlIcon___OVuQp", Hr = "styles-module__CalendarDatePicker__Month___8-Nvy", Yr = "styles-module__CalendarDatePicker__MonthRow___PihZV", Wr = "styles-module__CalendarDatePicker__MonthCell___bEPui", Zr = "styles-module__CalendarDatePicker__WeekdaysRow___lbdgy", jr = "styles-module__CalendarDatePicker__Weekday___-Seq9", K = {
|
|
134
|
-
CalendarDatePicker__Wrapper: Lr,
|
|
135
|
-
CalendarDatePicker__DayContent: Er,
|
|
136
|
-
CalendarDatePicker__DayLabel: Ar,
|
|
137
|
-
CalendarDatePicker__TodayIndicator: Nr,
|
|
138
|
-
CalendarDatePicker__Day: Or,
|
|
139
|
-
CalendarDatePicker__Header: Fr,
|
|
140
|
-
CalendarDatePicker__HeaderLevel: $r,
|
|
141
|
-
CalendarDatePicker__HeaderControl: Rr,
|
|
142
|
-
CalendarDatePicker__HeaderControlIcon: zr,
|
|
143
|
-
CalendarDatePicker__Month: Hr,
|
|
144
|
-
CalendarDatePicker__MonthRow: Yr,
|
|
145
|
-
CalendarDatePicker__MonthCell: Wr,
|
|
146
|
-
CalendarDatePicker__WeekdaysRow: Zr,
|
|
147
|
-
CalendarDatePicker__Weekday: jr
|
|
148
|
-
}, Ur = ({
|
|
149
|
-
excludedDays: e = [],
|
|
150
|
-
excludedDates: r = []
|
|
151
|
-
}) => {
|
|
152
|
-
const n = [], t = [];
|
|
153
|
-
for (const a of r)
|
|
154
|
-
typeof a == "string" ? n.push(a) : t.push(a);
|
|
155
|
-
const o = n.map((a) => Y(a)).filter((a) => a.isValid()).map((a) => a.format("YYYY-MM-DD")), s = t.map(([a, i]) => [Y(a), Y(i)]).filter(([a, i]) => a.isValid() && i.isValid());
|
|
156
|
-
return (a) => {
|
|
157
|
-
const i = Y(a);
|
|
158
|
-
if (!i.isValid()) return !1;
|
|
159
|
-
if (Array.isArray(e) && e.includes(i.day()) || o.includes(i.format("YYYY-MM-DD")))
|
|
160
|
-
return !0;
|
|
161
|
-
for (const [c, m] of s)
|
|
162
|
-
if ((i.isSame(c, "day") || i.isAfter(c, "day")) && (i.isSame(m, "day") || i.isBefore(m, "day")))
|
|
163
|
-
return !0;
|
|
164
|
-
return !1;
|
|
165
|
-
};
|
|
166
|
-
}, Vr = (e, r, n, t) => {
|
|
167
|
-
const o = Y(e), s = Y(r);
|
|
168
|
-
for (const a of n)
|
|
169
|
-
if (Array.isArray(a)) {
|
|
170
|
-
const i = Y(a[0]), c = Y(a[1]);
|
|
171
|
-
if (!i.isValid() || !c.isValid()) continue;
|
|
172
|
-
if (!(s.isBefore(i, "day") || o.isAfter(c, "day")))
|
|
173
|
-
return !0;
|
|
174
|
-
}
|
|
175
|
-
for (const a of n)
|
|
176
|
-
if (typeof a == "string") {
|
|
177
|
-
const i = Y(a);
|
|
178
|
-
if (!i.isValid()) continue;
|
|
179
|
-
if ((i.isSame(o, "day") || i.isAfter(o, "day")) && (i.isSame(s, "day") || i.isBefore(s, "day")))
|
|
180
|
-
return !0;
|
|
181
|
-
}
|
|
182
|
-
if (t.length > 0) {
|
|
183
|
-
let a = o;
|
|
184
|
-
for (; a.isBefore(s, "day") || a.isSame(s, "day"); ) {
|
|
185
|
-
if (t.includes(a.day()))
|
|
186
|
-
return !0;
|
|
187
|
-
a = a.add(1, "day");
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
return !1;
|
|
191
|
-
}, se = (e = "default") => {
|
|
192
|
-
switch (e) {
|
|
193
|
-
case "range":
|
|
194
|
-
return [null, null];
|
|
195
|
-
case "multiple":
|
|
196
|
-
return [];
|
|
197
|
-
default:
|
|
198
|
-
return null;
|
|
199
|
-
}
|
|
200
|
-
}, Ue = (e = "default", r) => r == null ? se(e) : e === "range" ? Array.isArray(r) ? r : se("range") : e === "multiple" ? Array.isArray(r) ? r : se("multiple") : Array.isArray(r) ? r[0] ?? null : r, pt = ({
|
|
201
|
-
type: e,
|
|
202
|
-
externalValue: r,
|
|
203
|
-
internalValue: n
|
|
204
|
-
}) => r !== void 0 ? Ue(e, r) : n !== void 0 ? Ue(e, n) : se(e), Ne = (e, r) => {
|
|
205
|
-
const n = (t, o) => {
|
|
206
|
-
const s = Object.keys(t).reduce(
|
|
207
|
-
(a, i) => {
|
|
208
|
-
const c = i, m = t[c], p = o[c], _ = [m, p].filter(Boolean).join(" ");
|
|
209
|
-
return _ && (a[c] = _), a;
|
|
210
|
-
},
|
|
211
|
-
{}
|
|
212
|
-
);
|
|
213
|
-
return Object.keys(o).forEach((a) => {
|
|
214
|
-
const i = a, c = o[i];
|
|
215
|
-
!(i in t) && c && (s[i] = c);
|
|
216
|
-
}), s;
|
|
217
|
-
};
|
|
218
|
-
return typeof r == "function" ? (t, o, s) => n(e, r(t, o, s)) : typeof r == "object" && r !== null && !Array.isArray(r) ? n(e, r) : e;
|
|
219
|
-
}, Gr = (e) => {
|
|
220
|
-
if (e == null)
|
|
221
|
-
return null;
|
|
222
|
-
if (Array.isArray(e)) {
|
|
223
|
-
for (let r = e.length - 1; r >= 0; r -= 1) {
|
|
224
|
-
const n = e[r];
|
|
225
|
-
if (n instanceof Date)
|
|
226
|
-
return Y(n).format("YYYY-MM-DD");
|
|
227
|
-
}
|
|
228
|
-
return null;
|
|
229
|
-
}
|
|
230
|
-
return e instanceof Date ? Y(e).format("YYYY-MM-DD") : null;
|
|
231
|
-
}, Kr = {
|
|
232
|
-
levelsGroup: K.CalendarDatePicker__Wrapper,
|
|
233
|
-
calendarHeader: K.CalendarDatePicker__Header,
|
|
234
|
-
calendarHeaderLevel: K.CalendarDatePicker__HeaderLevel,
|
|
235
|
-
calendarHeaderControl: K.CalendarDatePicker__HeaderControl,
|
|
236
|
-
calendarHeaderControlIcon: K.CalendarDatePicker__HeaderControlIcon,
|
|
237
|
-
month: K.CalendarDatePicker__Month,
|
|
238
|
-
monthCell: K.CalendarDatePicker__MonthCell,
|
|
239
|
-
day: K.CalendarDatePicker__Day,
|
|
240
|
-
monthRow: K.CalendarDatePicker__MonthRow,
|
|
241
|
-
weekdaysRow: K.CalendarDatePicker__WeekdaysRow,
|
|
242
|
-
weekday: K.CalendarDatePicker__Weekday
|
|
243
|
-
}, Jr = ({
|
|
244
|
-
excludedDates: e = [],
|
|
245
|
-
excludedDays: r = [],
|
|
246
|
-
type: n = "default",
|
|
247
|
-
value: t,
|
|
248
|
-
onChange: o,
|
|
249
|
-
highlightToday: s = !1,
|
|
250
|
-
...a
|
|
251
|
-
}) => {
|
|
252
|
-
const { classNames: i, date: c, defaultDate: m, onDateChange: p, getDayProps: _, ...d } = a, [u, f] = v(
|
|
253
|
-
() => t ?? se(n)
|
|
254
|
-
), [h, g] = v(() => c || m || (Gr(t ?? se(n)) ?? /* @__PURE__ */ new Date())), y = Re(
|
|
255
|
-
() => Ur({
|
|
256
|
-
excludedDays: r,
|
|
257
|
-
excludedDates: e
|
|
258
|
-
}),
|
|
259
|
-
[r, e]
|
|
260
|
-
), x = W(
|
|
261
|
-
(C) => {
|
|
262
|
-
c === void 0 && g(C), p?.(C);
|
|
263
|
-
},
|
|
264
|
-
[c, p]
|
|
265
|
-
), k = (C) => {
|
|
266
|
-
if (n === "range" && Array.isArray(C) && C.length === 2) {
|
|
267
|
-
const [E, O] = C;
|
|
268
|
-
if (E && O && Vr(E, O, e, r)) {
|
|
269
|
-
const P = se("range");
|
|
270
|
-
f(P), o?.(P);
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
f(C), o?.(C);
|
|
275
|
-
}, N = pt({
|
|
276
|
-
type: n,
|
|
277
|
-
externalValue: t,
|
|
278
|
-
internalValue: u
|
|
279
|
-
}), $ = W(
|
|
280
|
-
(C) => {
|
|
281
|
-
const E = Y(C).date(), P = Y(C).isSame(Y(), "day") && s;
|
|
282
|
-
return /* @__PURE__ */ D("span", { className: K.CalendarDatePicker__DayContent, children: [
|
|
283
|
-
/* @__PURE__ */ l("span", { className: K.CalendarDatePicker__DayLabel, children: E }),
|
|
284
|
-
P && /* @__PURE__ */ l("span", { className: K.CalendarDatePicker__TodayIndicator, children: "오늘" })
|
|
285
|
-
] });
|
|
286
|
-
},
|
|
287
|
-
[s]
|
|
288
|
-
), Z = Ne(Kr, i), z = c ?? h, B = Y(z ?? /* @__PURE__ */ new Date()).format("YYYY-MM"), b = W(
|
|
289
|
-
(C) => {
|
|
290
|
-
const E = _?.(C) ?? {}, O = Y(C).format("YYYY-MM") !== B;
|
|
291
|
-
return {
|
|
292
|
-
...E,
|
|
293
|
-
onClick: (P) => {
|
|
294
|
-
E.onClick?.(P), O && x(C);
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
},
|
|
298
|
-
[B, _, x]
|
|
299
|
-
);
|
|
300
|
-
return /* @__PURE__ */ l(
|
|
301
|
-
Wt,
|
|
302
|
-
{
|
|
303
|
-
locale: "ko",
|
|
304
|
-
firstDayOfWeek: 0,
|
|
305
|
-
monthLabelFormat: "YYYY년 M월",
|
|
306
|
-
maxLevel: "month",
|
|
307
|
-
type: n,
|
|
308
|
-
previousIcon: /* @__PURE__ */ l(ot, {}),
|
|
309
|
-
nextIcon: /* @__PURE__ */ l(nt, {}),
|
|
310
|
-
...d,
|
|
311
|
-
size: "lg",
|
|
312
|
-
onChange: k,
|
|
313
|
-
weekendDays: [0],
|
|
314
|
-
highlightToday: s,
|
|
315
|
-
classNames: Z,
|
|
316
|
-
defaultDate: c === void 0 ? m : void 0,
|
|
317
|
-
date: z,
|
|
318
|
-
onDateChange: x,
|
|
319
|
-
getDayProps: b,
|
|
320
|
-
value: N,
|
|
321
|
-
excludeDate: y,
|
|
322
|
-
renderDay: $
|
|
323
|
-
}
|
|
324
|
-
);
|
|
325
|
-
}, qr = "styles-module__DatePickerBase___yJlGe", Xr = "styles-module__DatePickerRoot___HG6Zb", Qr = "styles-module__DatePicker__Wrapper___7X5ke", en = "styles-module__DatePicker__Input___sTaqF", tn = "styles-module__DatePicker__Placeholder___PZnzX", rn = "styles-module__DatePicker__Section___waCJM", nn = "styles-module__DatePicker__Icon___fceRx", on = "styles-module__DatePicker__Dropdown___Iy9KE", an = "styles-module__DatePicker__DropdownArrow___zeIIm", sn = "styles-module__DatePicker__Root___2Q8qm", ln = "styles-module__DatePicker__LevelsGroup___lrWsl", cn = "styles-module__DatePicker__CalendarHeader___VI-Of", _n = "styles-module__DatePicker__CalendarHeaderLevel___F4DtE", dn = "styles-module__DatePicker__CalendarHeaderControl___72yIl", un = "styles-module__DatePicker__CalendarHeaderControlIcon___CnQei", mn = "styles-module__DatePicker__Month___W7LuG", pn = "styles-module__DatePicker__WeekdaysRow___4NdYk", fn = "styles-module__DatePicker__Weekday___tL-rR", hn = "styles-module__DatePicker__MonthRow___NSs67", gn = "styles-module__DatePicker__MonthCell___iGYhy", yn = "styles-module__DatePicker__Day___7LDrl", kn = "styles-module__DatePicker__TimeWrapper___BlHZZ", Cn = "styles-module__DatePicker__TimeInput___Acg-L", Dn = "styles-module__DatePicker__SubmitButton___6DvfS", M = {
|
|
326
|
-
DatePickerBase: qr,
|
|
327
|
-
DatePickerRoot: Xr,
|
|
328
|
-
"DatePicker--Small": "styles-module__DatePicker--Small___m8asv",
|
|
329
|
-
"DatePicker--Medium": "styles-module__DatePicker--Medium___Po2-B",
|
|
330
|
-
"DatePicker--Large": "styles-module__DatePicker--Large___oQ6EM",
|
|
331
|
-
DatePicker__Wrapper: Qr,
|
|
332
|
-
DatePicker__Input: en,
|
|
333
|
-
DatePicker__Placeholder: tn,
|
|
334
|
-
DatePicker__Section: rn,
|
|
335
|
-
DatePicker__Icon: nn,
|
|
336
|
-
DatePicker__Dropdown: on,
|
|
337
|
-
DatePicker__DropdownArrow: an,
|
|
338
|
-
DatePicker__Root: sn,
|
|
339
|
-
DatePicker__LevelsGroup: ln,
|
|
340
|
-
DatePicker__CalendarHeader: cn,
|
|
341
|
-
DatePicker__CalendarHeaderLevel: _n,
|
|
342
|
-
DatePicker__CalendarHeaderControl: dn,
|
|
343
|
-
DatePicker__CalendarHeaderControlIcon: un,
|
|
344
|
-
DatePicker__Month: mn,
|
|
345
|
-
DatePicker__WeekdaysRow: pn,
|
|
346
|
-
DatePicker__Weekday: fn,
|
|
347
|
-
DatePicker__MonthRow: hn,
|
|
348
|
-
DatePicker__MonthCell: gn,
|
|
349
|
-
DatePicker__Day: yn,
|
|
350
|
-
DatePicker__TimeWrapper: kn,
|
|
351
|
-
DatePicker__TimeInput: Cn,
|
|
352
|
-
DatePicker__SubmitButton: Dn
|
|
353
|
-
};
|
|
354
|
-
Y.extend(_r);
|
|
355
|
-
const xn = {
|
|
356
|
-
wrapper: M.DatePicker__Wrapper,
|
|
357
|
-
input: M.DatePicker__Input,
|
|
358
|
-
section: M.DatePicker__Section,
|
|
359
|
-
placeholder: M.DatePicker__Placeholder,
|
|
360
|
-
datePickerRoot: M.DatePicker__Root,
|
|
361
|
-
levelsGroup: M.DatePicker__LevelsGroup,
|
|
362
|
-
calendarHeader: M.DatePicker__CalendarHeader,
|
|
363
|
-
calendarHeaderLevel: M.DatePicker__CalendarHeaderLevel,
|
|
364
|
-
calendarHeaderControl: M.DatePicker__CalendarHeaderControl,
|
|
365
|
-
calendarHeaderControlIcon: M.DatePicker__CalendarHeaderControlIcon,
|
|
366
|
-
month: M.DatePicker__Month,
|
|
367
|
-
weekdaysRow: M.DatePicker__WeekdaysRow,
|
|
368
|
-
weekday: M.DatePicker__Weekday,
|
|
369
|
-
monthRow: M.DatePicker__MonthRow,
|
|
370
|
-
monthCell: M.DatePicker__MonthCell,
|
|
371
|
-
day: M.DatePicker__Day,
|
|
372
|
-
timeWrapper: M.DatePicker__TimeWrapper,
|
|
373
|
-
timeInput: M.DatePicker__TimeInput,
|
|
374
|
-
submitButton: M.DatePicker__SubmitButton
|
|
375
|
-
}, Pn = {
|
|
376
|
-
dropdown: M.DatePicker__Dropdown,
|
|
377
|
-
arrow: M.DatePicker__DropdownArrow
|
|
378
|
-
}, Ve = (...e) => e.filter(Boolean).join(" ") || void 0, fe = (e) => {
|
|
379
|
-
if (e == null) return null;
|
|
380
|
-
if (e instanceof Date) return e;
|
|
381
|
-
if (typeof e == "string" && e) {
|
|
382
|
-
const r = e.split("-").map(Number);
|
|
383
|
-
if (r.length === 3 && r[0] && r[1] && r[2])
|
|
384
|
-
return new Date(r[0], r[1] - 1, r[2]);
|
|
385
|
-
}
|
|
386
|
-
return null;
|
|
387
|
-
}, La = ({
|
|
388
|
-
size: e = "md",
|
|
389
|
-
type: r = "default",
|
|
390
|
-
withTime: n,
|
|
391
|
-
className: t,
|
|
392
|
-
popoverProps: o,
|
|
393
|
-
rightSection: s,
|
|
394
|
-
rightSectionWidth: a,
|
|
395
|
-
value: i,
|
|
396
|
-
defaultValue: c,
|
|
397
|
-
onChange: m,
|
|
398
|
-
placeholder: p,
|
|
399
|
-
disabled: _,
|
|
400
|
-
minDate: d,
|
|
401
|
-
maxDate: u,
|
|
402
|
-
displayValueFormat: f = "YYYY년 MM월 DD일",
|
|
403
|
-
valueFormat: h,
|
|
404
|
-
excludedDates: g,
|
|
405
|
-
excludedDays: y,
|
|
406
|
-
highlightToday: x
|
|
407
|
-
}) => {
|
|
408
|
-
const k = h ?? (n ? "YYYY-MM-DD HH:mm" : "YYYY-MM-DD"), [N, $] = v(!1), [Z, z] = v(
|
|
409
|
-
() => Ye(i ?? c, r, k) ?? se(r)
|
|
410
|
-
);
|
|
411
|
-
let B = M["DatePicker--Medium"], b = 18, C = 42;
|
|
412
|
-
e === "sm" ? (B = M["DatePicker--Small"], b = 14, C = 34) : e === "lg" && (B = M["DatePicker--Large"], b = 24, C = 50);
|
|
413
|
-
const E = Ne(
|
|
414
|
-
Pn,
|
|
415
|
-
o?.classNames
|
|
416
|
-
), O = s ?? /* @__PURE__ */ l("span", { "aria-hidden": "true", className: M.DatePicker__Icon, children: /* @__PURE__ */ l(Vt, { size: b }) });
|
|
417
|
-
if (n) {
|
|
418
|
-
const L = (J) => {
|
|
419
|
-
if (!J) return null;
|
|
420
|
-
const de = Y(J, k, !0);
|
|
421
|
-
return de.isValid() ? de.toDate() : null;
|
|
422
|
-
}, R = i !== void 0, S = R ? L(i) : null, ee = L(c);
|
|
423
|
-
return /* @__PURE__ */ l(
|
|
424
|
-
Zt,
|
|
425
|
-
{
|
|
426
|
-
className: Ve(
|
|
427
|
-
M.DatePickerBase,
|
|
428
|
-
M.DatePickerRoot,
|
|
429
|
-
B,
|
|
430
|
-
t
|
|
431
|
-
),
|
|
432
|
-
classNames: Ne(
|
|
433
|
-
xn,
|
|
434
|
-
void 0
|
|
435
|
-
),
|
|
436
|
-
size: e,
|
|
437
|
-
locale: "ko",
|
|
438
|
-
firstDayOfWeek: 0,
|
|
439
|
-
monthLabelFormat: "YYYY년 MM월",
|
|
440
|
-
valueFormat: "YYYY-MM-DD | a hh:mm",
|
|
441
|
-
rightSection: O,
|
|
442
|
-
rightSectionWidth: a ?? C,
|
|
443
|
-
popoverProps: {
|
|
444
|
-
offset: 8,
|
|
445
|
-
position: "bottom-start",
|
|
446
|
-
withArrow: !0,
|
|
447
|
-
arrowSize: 10,
|
|
448
|
-
arrowOffset: 20,
|
|
449
|
-
...o,
|
|
450
|
-
classNames: E
|
|
451
|
-
},
|
|
452
|
-
value: R ? S : void 0,
|
|
453
|
-
defaultValue: R ? void 0 : ee,
|
|
454
|
-
onChange: (J) => {
|
|
455
|
-
m?.(J ? Y(J).format(k) : null);
|
|
456
|
-
},
|
|
457
|
-
placeholder: p,
|
|
458
|
-
disabled: _,
|
|
459
|
-
minDate: d,
|
|
460
|
-
maxDate: u
|
|
461
|
-
}
|
|
462
|
-
);
|
|
463
|
-
}
|
|
464
|
-
const P = i != null ? Ye(i, r, k) : void 0, T = pt({
|
|
465
|
-
type: r,
|
|
466
|
-
externalValue: P,
|
|
467
|
-
internalValue: Z
|
|
468
|
-
}), I = Ut(
|
|
469
|
-
T,
|
|
470
|
-
r,
|
|
471
|
-
f
|
|
472
|
-
), H = (L) => {
|
|
473
|
-
let R;
|
|
474
|
-
if (r === "range" && Array.isArray(L)) {
|
|
475
|
-
const S = L;
|
|
476
|
-
R = [fe(S[0] ?? null), fe(S[1] ?? null)];
|
|
477
|
-
} else r === "multiple" && Array.isArray(L) ? R = L.map((S) => fe(S)).filter((S) => S !== null) : R = fe(L);
|
|
478
|
-
z(R), m?.(Gt(R, r, k)), r === "default" && R != null && $(!1), r === "range" && Array.isArray(R) && R[0] && R[1] && $(!1);
|
|
479
|
-
};
|
|
480
|
-
return /* @__PURE__ */ l(
|
|
481
|
-
"div",
|
|
482
|
-
{
|
|
483
|
-
className: Ve(M.DatePickerBase, M.DatePickerRoot, B, t),
|
|
484
|
-
children: /* @__PURE__ */ D(
|
|
485
|
-
Se,
|
|
486
|
-
{
|
|
487
|
-
opened: N,
|
|
488
|
-
onClose: () => $(!1),
|
|
489
|
-
offset: 8,
|
|
490
|
-
position: "bottom-start",
|
|
491
|
-
withArrow: !0,
|
|
492
|
-
arrowSize: 10,
|
|
493
|
-
arrowOffset: 20,
|
|
494
|
-
...o,
|
|
495
|
-
classNames: E,
|
|
496
|
-
children: [
|
|
497
|
-
/* @__PURE__ */ l(Se.Target, { children: /* @__PURE__ */ l(
|
|
498
|
-
"div",
|
|
499
|
-
{
|
|
500
|
-
className: M.DatePicker__Wrapper,
|
|
501
|
-
"data-expanded": N ? !0 : void 0,
|
|
502
|
-
"data-disabled": _ ? !0 : void 0,
|
|
503
|
-
children: /* @__PURE__ */ l(
|
|
504
|
-
X,
|
|
505
|
-
{
|
|
506
|
-
component: "button",
|
|
507
|
-
type: "button",
|
|
508
|
-
classNames: {
|
|
509
|
-
input: M.DatePicker__Input,
|
|
510
|
-
section: M.DatePicker__Section
|
|
511
|
-
},
|
|
512
|
-
onClick: () => !_ && $((L) => !L),
|
|
513
|
-
disabled: _,
|
|
514
|
-
rightSection: O,
|
|
515
|
-
rightSectionWidth: a ?? C,
|
|
516
|
-
"data-expanded": N ? !0 : void 0,
|
|
517
|
-
"data-disabled": _ ? !0 : void 0,
|
|
518
|
-
children: I ? /* @__PURE__ */ l("span", { children: I }) : /* @__PURE__ */ l("span", { className: M.DatePicker__Placeholder, children: p })
|
|
519
|
-
}
|
|
520
|
-
)
|
|
521
|
-
}
|
|
522
|
-
) }),
|
|
523
|
-
/* @__PURE__ */ l(Se.Dropdown, { children: /* @__PURE__ */ l(
|
|
524
|
-
Jr,
|
|
525
|
-
{
|
|
526
|
-
type: r,
|
|
527
|
-
value: T,
|
|
528
|
-
onChange: H,
|
|
529
|
-
excludedDates: g,
|
|
530
|
-
excludedDays: y,
|
|
531
|
-
highlightToday: x,
|
|
532
|
-
minDate: d,
|
|
533
|
-
maxDate: u
|
|
534
|
-
}
|
|
535
|
-
) })
|
|
536
|
-
]
|
|
537
|
-
}
|
|
538
|
-
)
|
|
539
|
-
}
|
|
540
|
-
);
|
|
541
|
-
}, bn = "styles-module__Dropdown__Description___OQ8bF", Mn = "styles-module__Dropdown__ErrorMsg___xTP0Y", q = {
|
|
542
|
-
"Dropdown--LeftLabel": "styles-module__Dropdown--LeftLabel___SFObq",
|
|
543
|
-
"Dropdown--TopLabel": "styles-module__Dropdown--TopLabel___-lPhr",
|
|
544
|
-
"Dropdown__Label--Small": "styles-module__Dropdown__Label--Small___xbzOR",
|
|
545
|
-
"Dropdown__Label--Medium": "styles-module__Dropdown__Label--Medium___YtJ2-",
|
|
546
|
-
"Dropdown__Label--Large": "styles-module__Dropdown__Label--Large___sCiJv",
|
|
547
|
-
"Dropdown__Tooltip--Small": "styles-module__Dropdown__Tooltip--Small___rkmaO",
|
|
548
|
-
"Dropdown__Tooltip--Medium": "styles-module__Dropdown__Tooltip--Medium___JTfzy",
|
|
549
|
-
"Dropdown__Tooltip--Large": "styles-module__Dropdown__Tooltip--Large___W-sUq",
|
|
550
|
-
"Dropdown--Small": "styles-module__Dropdown--Small___dRIK7",
|
|
551
|
-
"Dropdown--Medium": "styles-module__Dropdown--Medium___-HZoU",
|
|
552
|
-
"Dropdown--Large": "styles-module__Dropdown--Large___BvV3M",
|
|
553
|
-
Dropdown__Description: bn,
|
|
554
|
-
Dropdown__ErrorMsg: Mn
|
|
555
|
-
}, Ea = ({
|
|
556
|
-
label: e,
|
|
557
|
-
labelPosition: r = "top",
|
|
558
|
-
size: n = "md",
|
|
559
|
-
required: t,
|
|
560
|
-
tooltip: o,
|
|
561
|
-
tooltipPosition: s = "top",
|
|
562
|
-
errorMsg: a,
|
|
563
|
-
description: i,
|
|
564
|
-
...c
|
|
565
|
-
}) => {
|
|
566
|
-
const [m, p] = v(!1);
|
|
567
|
-
let _ = q["Dropdown__Label--Medium"], d = q["Dropdown--Medium"], u = q["Dropdown__Tooltip--Medium"], f = 18;
|
|
568
|
-
return n === "sm" ? (_ = q["Dropdown__Label--Small"], d = q["Dropdown--Small"], u = q["Dropdown__Tooltip--Small"], f = 14) : n === "lg" && (_ = q["Dropdown__Label--Large"], d = q["Dropdown--Large"], u = q["Dropdown__Tooltip--Large"], f = 24), /* @__PURE__ */ D(
|
|
569
|
-
"div",
|
|
570
|
-
{
|
|
571
|
-
className: r === "top" ? q["Dropdown--TopLabel"] : q["Dropdown--LeftLabel"],
|
|
572
|
-
children: [
|
|
573
|
-
/* @__PURE__ */ D("div", { children: [
|
|
574
|
-
e && /* @__PURE__ */ l(X.Label, { required: t, className: _, children: e }),
|
|
575
|
-
o && /* @__PURE__ */ l(xe, { label: o, position: s, children: /* @__PURE__ */ l("div", { className: u, children: /* @__PURE__ */ l(Fe, { size: n === "sm" ? 14 : n === "lg" ? 20 : 16 }) }) })
|
|
576
|
-
] }),
|
|
577
|
-
/* @__PURE__ */ D("div", { children: [
|
|
578
|
-
/* @__PURE__ */ l(
|
|
579
|
-
Bt,
|
|
580
|
-
{
|
|
581
|
-
...c,
|
|
582
|
-
size: n,
|
|
583
|
-
error: a,
|
|
584
|
-
className: d,
|
|
585
|
-
rightSection: m ? /* @__PURE__ */ l(qt, { size: f }) : /* @__PURE__ */ l(Xt, { size: f }),
|
|
586
|
-
onDropdownOpen: () => p(!0),
|
|
587
|
-
onDropdownClose: () => p(!1),
|
|
588
|
-
styles: {
|
|
589
|
-
option: {
|
|
590
|
-
"&[data-selected]": {
|
|
591
|
-
"&, &:hover": {
|
|
592
|
-
backgroundColor: Jt,
|
|
593
|
-
color: Kt
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
),
|
|
600
|
-
i && /* @__PURE__ */ l(X.Description, { className: q.Dropdown__Description, children: i }),
|
|
601
|
-
a && /* @__PURE__ */ l(X.Error, { className: q.Dropdown__ErrorMsg, children: a })
|
|
602
|
-
] })
|
|
603
|
-
]
|
|
604
|
-
}
|
|
605
|
-
);
|
|
606
|
-
}, Sn = (e) => ({
|
|
607
|
-
// fullScreen이면 Mantine의 radius 0을 인라인 radius로 덮지 않는다.
|
|
608
|
-
...e ? {} : { content: { borderRadius: "12px" } },
|
|
609
|
-
title: {
|
|
610
|
-
fontSize: "16px",
|
|
611
|
-
fontWeight: "700",
|
|
612
|
-
lineHeight: "150%",
|
|
613
|
-
color: at
|
|
614
|
-
},
|
|
615
|
-
header: {
|
|
616
|
-
padding: "16px"
|
|
617
|
-
},
|
|
618
|
-
body: {
|
|
619
|
-
paddingInline: 0
|
|
620
|
-
}
|
|
621
|
-
}), Tn = (e, r) => {
|
|
622
|
-
if (typeof e == "function")
|
|
623
|
-
return e;
|
|
624
|
-
const n = Sn(r), t = { ...n, ...e };
|
|
625
|
-
return Object.keys(n).forEach((o) => {
|
|
626
|
-
t[o] = { ...n[o], ...e?.[o] };
|
|
627
|
-
}), t;
|
|
628
|
-
}, ft = ({
|
|
629
|
-
size: e = "md",
|
|
630
|
-
width: r,
|
|
631
|
-
withCloseButton: n = !1,
|
|
632
|
-
fullScreen: t = !1,
|
|
633
|
-
styles: o,
|
|
634
|
-
...s
|
|
635
|
-
}) => {
|
|
636
|
-
let a = 768;
|
|
637
|
-
return e === "xs" ? a = 360 : e === "sm" ? a = 544 : e === "lg" ? a = 1e3 : e === "xl" && (a = 1200), /* @__PURE__ */ l(
|
|
638
|
-
Lt,
|
|
639
|
-
{
|
|
640
|
-
size: r || a,
|
|
641
|
-
fullScreen: t,
|
|
642
|
-
styles: Tn(o, t),
|
|
643
|
-
withCloseButton: n,
|
|
644
|
-
closeButtonProps: {
|
|
645
|
-
icon: /* @__PURE__ */ l(Pe, { size: 18, color: $e })
|
|
646
|
-
},
|
|
647
|
-
...s
|
|
648
|
-
}
|
|
649
|
-
);
|
|
650
|
-
};
|
|
651
|
-
function Me() {
|
|
652
|
-
return crypto.randomUUID();
|
|
653
|
-
}
|
|
654
|
-
function wn(e, r, n) {
|
|
655
|
-
const t = [...e], [o] = t.splice(r, 1);
|
|
656
|
-
return t.splice(n, 0, o), t;
|
|
657
|
-
}
|
|
658
|
-
function vn(e, r, n) {
|
|
659
|
-
return n != null && e.length >= n ? 0 : r != null && e.length < r ? r - e.length : 1;
|
|
660
|
-
}
|
|
661
|
-
function In(e, r, n) {
|
|
662
|
-
return e.map((t) => {
|
|
663
|
-
const o = t.position;
|
|
664
|
-
return o == null ? t : o === r ? { ...t, position: n } : r < n && o > r && o <= n ? { ...t, position: o - 1 } : r > n && o >= n && o < r ? { ...t, position: o + 1 } : t;
|
|
665
|
-
});
|
|
666
|
-
}
|
|
667
|
-
function Bn(e, r, n) {
|
|
668
|
-
const t = [...r].sort((i, c) => i.name.localeCompare(c.name)), o = n != null ? n - e.length : 1 / 0, a = t.slice(0, o).map((i) => ({
|
|
669
|
-
id: Me(),
|
|
670
|
-
file: i,
|
|
671
|
-
url: URL.createObjectURL(i)
|
|
672
|
-
}));
|
|
673
|
-
return [...e, ...a];
|
|
674
|
-
}
|
|
675
|
-
function Ln(e, r) {
|
|
676
|
-
const n = e.find((t) => t.id === r);
|
|
677
|
-
return n?.url?.startsWith("blob:") && URL.revokeObjectURL(n.url), e.filter((t) => t.id !== r);
|
|
678
|
-
}
|
|
679
|
-
function ht(e, r, n) {
|
|
680
|
-
return e.map((t) => t.id !== r ? t : (t.url?.startsWith("blob:") && URL.revokeObjectURL(t.url), { ...t, file: n, url: URL.createObjectURL(n) }));
|
|
681
|
-
}
|
|
682
|
-
function En(e, r, n) {
|
|
683
|
-
return ht(e, r, n);
|
|
684
|
-
}
|
|
685
|
-
function An(e, r, n) {
|
|
686
|
-
const t = {
|
|
687
|
-
id: Me(),
|
|
688
|
-
file: r,
|
|
689
|
-
url: URL.createObjectURL(r),
|
|
690
|
-
position: n
|
|
691
|
-
};
|
|
692
|
-
return [...e, t];
|
|
693
|
-
}
|
|
694
|
-
function Nn(e) {
|
|
695
|
-
for (const r of e)
|
|
696
|
-
r.url?.startsWith("blob:") && URL.revokeObjectURL(r.url);
|
|
697
|
-
}
|
|
698
|
-
async function On(e, r) {
|
|
699
|
-
const n = e.url ?? "";
|
|
700
|
-
if (!n) return null;
|
|
701
|
-
const t = await new Promise((i, c) => {
|
|
702
|
-
const m = new Image();
|
|
703
|
-
m.crossOrigin = "anonymous", m.onload = () => i(m), m.onerror = c, m.src = n;
|
|
704
|
-
}), o = document.createElement("canvas");
|
|
705
|
-
o.width = r.width, o.height = r.height;
|
|
706
|
-
const s = o.getContext("2d");
|
|
707
|
-
if (!s) return null;
|
|
708
|
-
s.drawImage(
|
|
709
|
-
t,
|
|
710
|
-
r.x,
|
|
711
|
-
r.y,
|
|
712
|
-
r.width,
|
|
713
|
-
r.height,
|
|
714
|
-
0,
|
|
715
|
-
0,
|
|
716
|
-
r.width,
|
|
717
|
-
r.height
|
|
718
|
-
);
|
|
719
|
-
const a = e.file?.name ?? e.url?.split("/").pop() ?? "image";
|
|
720
|
-
return new Promise((i, c) => {
|
|
721
|
-
o.toBlob((m) => {
|
|
722
|
-
m ? i(new File([m], `cropped_${a}`, { type: "image/jpeg" })) : c(new Error("Failed to create blob"));
|
|
723
|
-
}, "image/jpeg");
|
|
724
|
-
});
|
|
725
|
-
}
|
|
726
|
-
function Fn({
|
|
727
|
-
item: e,
|
|
728
|
-
isOpen: r,
|
|
729
|
-
aspect: n = 1,
|
|
730
|
-
onClose: t,
|
|
731
|
-
onSubmit: o
|
|
732
|
-
}) {
|
|
733
|
-
const [s, a] = v({ x: 0, y: 0 }), [i, c] = v(1), [m, p] = v(null), [_, d] = v(!1), u = async () => {
|
|
734
|
-
if (!(!m || !e)) {
|
|
735
|
-
d(!0);
|
|
736
|
-
try {
|
|
737
|
-
const f = await On(e, m);
|
|
738
|
-
f && o(f);
|
|
739
|
-
} finally {
|
|
740
|
-
d(!1);
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
};
|
|
744
|
-
return /* @__PURE__ */ l(
|
|
745
|
-
ft,
|
|
746
|
-
{
|
|
747
|
-
opened: r && !!e,
|
|
748
|
-
onClose: t,
|
|
749
|
-
size: "md",
|
|
750
|
-
title: "이미지 수정",
|
|
751
|
-
withCloseButton: !0,
|
|
752
|
-
children: /* @__PURE__ */ D(Et, { children: [
|
|
753
|
-
/* @__PURE__ */ l("div", { style: { position: "relative", height: 320, background: We }, children: /* @__PURE__ */ l(
|
|
754
|
-
hr,
|
|
755
|
-
{
|
|
756
|
-
image: e?.url ?? "",
|
|
757
|
-
crop: s,
|
|
758
|
-
zoom: i,
|
|
759
|
-
aspect: n,
|
|
760
|
-
minZoom: 0.5,
|
|
761
|
-
maxZoom: 10,
|
|
762
|
-
objectFit: "cover",
|
|
763
|
-
onCropChange: a,
|
|
764
|
-
onZoomChange: c,
|
|
765
|
-
onCropComplete: (f, h) => p(h),
|
|
766
|
-
style: { containerStyle: { backgroundColor: We } }
|
|
767
|
-
}
|
|
768
|
-
) }),
|
|
769
|
-
/* @__PURE__ */ D(At, { justify: "flex-end", style: { padding: "0 16px" }, children: [
|
|
770
|
-
/* @__PURE__ */ l(me, { variant: "basic", onClick: t, children: "취소" }),
|
|
771
|
-
/* @__PURE__ */ l(me, { variant: "primary", isLoading: _, onClick: u, children: "적용하기" })
|
|
772
|
-
] })
|
|
773
|
-
] })
|
|
774
|
-
},
|
|
775
|
-
e?.id
|
|
776
|
-
);
|
|
777
|
-
}
|
|
778
|
-
const $n = "styles-module__Container___ZyeJM", Rn = "styles-module__TileContent___Ofq9-", zn = "styles-module__TileImage___6aKmW", Hn = "styles-module__OverlayButton___AYBJ0", Yn = "styles-module__OverlayButtonLeft___t8SaP", Wn = "styles-module__OverlayButtonRight___IOvjw", Zn = "styles-module__PreviewControls___iu0Yk", jn = "styles-module__PreviewContent___8f8d2", Un = "styles-module__PreviewViewport___7-I5L", Vn = "styles-module__PreviewOriginal___PgXTM", Gn = "styles-module__PlaceholderText___nhLhy", Kn = "styles-module__PlaceholderTextError___jYZ8j", G = {
|
|
779
|
-
Container: $n,
|
|
780
|
-
TileContent: Rn,
|
|
781
|
-
TileImage: zn,
|
|
782
|
-
OverlayButton: Hn,
|
|
783
|
-
OverlayButtonLeft: Yn,
|
|
784
|
-
OverlayButtonRight: Wn,
|
|
785
|
-
PreviewControls: Zn,
|
|
786
|
-
PreviewContent: jn,
|
|
787
|
-
PreviewViewport: Un,
|
|
788
|
-
PreviewOriginal: Vn,
|
|
789
|
-
PlaceholderText: Gn,
|
|
790
|
-
PlaceholderTextError: Kn
|
|
791
|
-
}, Jn = "styles-module__TileContainer___5-y01", qn = "styles-module__DeleteButton___0zsXm", Xn = "styles-module__Tile___3Cezo", Qn = "styles-module__TileDragOver___e7GXF", eo = "styles-module__LoadingOverlay___4CyDQ", to = "styles-module__ActionBar___mJYpe", ro = "styles-module__DragHandle___lzKhb", no = "styles-module__DragHandleOverlay___0nlt3", oo = "styles-module__LinkButton___bISyz", ao = "styles-module__DropzoneOuter___BIO2N", so = "styles-module__Placeholder___q30Yw", io = "styles-module__PlaceholderError___fCOYe", re = {
|
|
792
|
-
TileContainer: Jn,
|
|
793
|
-
DeleteButton: qn,
|
|
794
|
-
Tile: Xn,
|
|
795
|
-
TileDragOver: Qn,
|
|
796
|
-
LoadingOverlay: eo,
|
|
797
|
-
ActionBar: to,
|
|
798
|
-
DragHandle: ro,
|
|
799
|
-
DragHandleOverlay: no,
|
|
800
|
-
LinkButton: oo,
|
|
801
|
-
DropzoneOuter: ao,
|
|
802
|
-
Placeholder: so,
|
|
803
|
-
PlaceholderError: io
|
|
804
|
-
};
|
|
805
|
-
function De({
|
|
806
|
-
width: e,
|
|
807
|
-
height: r,
|
|
808
|
-
isError: n,
|
|
809
|
-
isLoading: t,
|
|
810
|
-
accept: o,
|
|
811
|
-
multiple: s,
|
|
812
|
-
onDrop: a,
|
|
813
|
-
children: i
|
|
814
|
-
}) {
|
|
815
|
-
return /* @__PURE__ */ l("div", { className: re.DropzoneOuter, children: /* @__PURE__ */ l(
|
|
816
|
-
fr,
|
|
817
|
-
{
|
|
818
|
-
onDrop: a,
|
|
819
|
-
accept: o,
|
|
820
|
-
multiple: s,
|
|
821
|
-
disabled: t,
|
|
822
|
-
className: n ? re.PlaceholderError : re.Placeholder,
|
|
823
|
-
style: { width: e, height: r },
|
|
824
|
-
children: i
|
|
825
|
-
}
|
|
826
|
-
) });
|
|
827
|
-
}
|
|
828
|
-
const lo = (e) => {
|
|
829
|
-
const { isSorting: r, wasDragging: n } = e;
|
|
830
|
-
return r || n ? !1 : _t(e);
|
|
831
|
-
};
|
|
832
|
-
function gt({ id: e, children: r }) {
|
|
833
|
-
const { setNodeRef: n, transform: t, transition: o, isOver: s } = ct({
|
|
834
|
-
id: e,
|
|
835
|
-
animateLayoutChanges: lo
|
|
836
|
-
});
|
|
837
|
-
return /* @__PURE__ */ l(
|
|
838
|
-
"div",
|
|
839
|
-
{
|
|
840
|
-
ref: n,
|
|
841
|
-
style: {
|
|
842
|
-
transform: mt.Transform.toString(t),
|
|
843
|
-
transition: o,
|
|
844
|
-
opacity: s ? 0.7 : 1
|
|
845
|
-
},
|
|
846
|
-
children: r
|
|
847
|
-
}
|
|
848
|
-
);
|
|
849
|
-
}
|
|
850
|
-
function yt({
|
|
851
|
-
id: e,
|
|
852
|
-
totalCount: r,
|
|
853
|
-
width: n,
|
|
854
|
-
height: t,
|
|
855
|
-
readOnly: o,
|
|
856
|
-
isLoading: s,
|
|
857
|
-
itemIsLoading: a,
|
|
858
|
-
canDelete: i,
|
|
859
|
-
hasLink: c,
|
|
860
|
-
isDragHandleOverlay: m = !1,
|
|
861
|
-
linkUrl: p,
|
|
862
|
-
onLinkClick: _,
|
|
863
|
-
onDelete: d,
|
|
864
|
-
deleteAriaLabel: u = "삭제",
|
|
865
|
-
actionBarExtra: f,
|
|
866
|
-
onTileClick: h,
|
|
867
|
-
onFileDrop: g,
|
|
868
|
-
children: y
|
|
869
|
-
}) {
|
|
870
|
-
const [x, k] = v(!1), N = (S) => {
|
|
871
|
-
!g || o || s || a || S.preventDefault();
|
|
872
|
-
}, $ = (S) => {
|
|
873
|
-
!g || o || s || a || (S.preventDefault(), k(!0));
|
|
874
|
-
}, Z = (S) => {
|
|
875
|
-
S.currentTarget.contains(S.relatedTarget) || k(!1);
|
|
876
|
-
}, z = (S) => {
|
|
877
|
-
if (S.preventDefault(), k(!1), !g || o || s || a) return;
|
|
878
|
-
const ee = S.dataTransfer.files[0];
|
|
879
|
-
ee && g(ee);
|
|
880
|
-
}, B = (S) => {
|
|
881
|
-
const { isSorting: ee, wasDragging: J } = S;
|
|
882
|
-
return ee || J ? !1 : _t(S);
|
|
883
|
-
}, {
|
|
884
|
-
attributes: b,
|
|
885
|
-
listeners: C,
|
|
886
|
-
setActivatorNodeRef: E,
|
|
887
|
-
setNodeRef: O,
|
|
888
|
-
transform: P,
|
|
889
|
-
transition: T,
|
|
890
|
-
isDragging: I
|
|
891
|
-
} = ct({ id: e, disabled: o, animateLayoutChanges: B }), H = !o && r > 1 && /* @__PURE__ */ l(
|
|
892
|
-
"button",
|
|
893
|
-
{
|
|
894
|
-
type: "button",
|
|
895
|
-
className: m ? re.DragHandleOverlay : re.DragHandle,
|
|
896
|
-
ref: E,
|
|
897
|
-
...b,
|
|
898
|
-
...C,
|
|
899
|
-
"aria-label": "드래그로 순서 변경",
|
|
900
|
-
disabled: m && (!!s || !!a),
|
|
901
|
-
onClick: m ? (S) => S.stopPropagation() : void 0,
|
|
902
|
-
children: /* @__PURE__ */ l(Qt, { size: 20, color: $e })
|
|
903
|
-
}
|
|
904
|
-
), L = !m && !!H || c && !!p && !!_ || !!f, R = o || s || a || !h ? "default" : "pointer";
|
|
905
|
-
return /* @__PURE__ */ D(
|
|
906
|
-
"div",
|
|
907
|
-
{
|
|
908
|
-
ref: O,
|
|
909
|
-
className: re.TileContainer,
|
|
910
|
-
style: {
|
|
911
|
-
transform: mt.Transform.toString(P),
|
|
912
|
-
transition: T,
|
|
913
|
-
opacity: I ? 0.4 : 1
|
|
914
|
-
},
|
|
915
|
-
children: [
|
|
916
|
-
!o && i && !s && /* @__PURE__ */ l(
|
|
917
|
-
"button",
|
|
918
|
-
{
|
|
919
|
-
type: "button",
|
|
920
|
-
className: re.DeleteButton,
|
|
921
|
-
onClick: d,
|
|
922
|
-
"aria-label": u,
|
|
923
|
-
children: /* @__PURE__ */ l(er, { size: 24 })
|
|
924
|
-
}
|
|
925
|
-
),
|
|
926
|
-
/* @__PURE__ */ D(
|
|
927
|
-
"div",
|
|
928
|
-
{
|
|
929
|
-
className: `${re.Tile}${x ? ` ${re.TileDragOver}` : ""}`,
|
|
930
|
-
style: { width: n, height: t, cursor: R },
|
|
931
|
-
onClick: () => !o && !s && !a && h?.(),
|
|
932
|
-
onDragOver: N,
|
|
933
|
-
onDragEnter: $,
|
|
934
|
-
onDragLeave: Z,
|
|
935
|
-
onDrop: z,
|
|
936
|
-
children: [
|
|
937
|
-
y,
|
|
938
|
-
m && H,
|
|
939
|
-
(s || a) && /* @__PURE__ */ l("div", { className: re.LoadingOverlay, children: /* @__PURE__ */ l(rt, { size: n / 6, color: ge }) })
|
|
940
|
-
]
|
|
941
|
-
}
|
|
942
|
-
),
|
|
943
|
-
L && /* @__PURE__ */ D("div", { className: re.ActionBar, children: [
|
|
944
|
-
!m && H,
|
|
945
|
-
c && p && _ && /* @__PURE__ */ l("button", { type: "button", className: re.LinkButton, onClick: _, children: "링크" }),
|
|
946
|
-
f
|
|
947
|
-
] })
|
|
948
|
-
]
|
|
949
|
-
}
|
|
950
|
-
);
|
|
951
|
-
}
|
|
952
|
-
function co({
|
|
953
|
-
items: e,
|
|
954
|
-
onReorder: r
|
|
955
|
-
}) {
|
|
956
|
-
return { sensors: dr(
|
|
957
|
-
Ze(ur, { activationConstraint: { distance: 8 } }),
|
|
958
|
-
Ze(mr, { coordinateGetter: pr })
|
|
959
|
-
), handleDragEnd: (o) => {
|
|
960
|
-
const { active: s, over: a } = o;
|
|
961
|
-
if (!a || s.id === a.id) return;
|
|
962
|
-
const i = e.findIndex((m) => m.id === s.id), c = e.findIndex((m) => m.id === a.id);
|
|
963
|
-
i !== -1 && c !== -1 && r(i, c);
|
|
964
|
-
} };
|
|
965
|
-
}
|
|
966
|
-
const ve = "__slot-";
|
|
967
|
-
function kt({ value: e, length: r, minLength: n, maxLength: t, onChange: o }) {
|
|
968
|
-
const s = r ?? n, a = r ?? t, i = s != null && a != null && s === a, c = i ? 0 : vn(e, s, a), m = i ? Array.from({ length: a }, (g, y) => `${ve}${y}`) : [], p = i ? m : e.map((g) => g.id), { sensors: _, handleDragEnd: d } = co({
|
|
969
|
-
items: e,
|
|
970
|
-
onReorder: (g, y) => {
|
|
971
|
-
const x = wn(e, g, y), k = e[g];
|
|
972
|
-
o?.(x, {
|
|
973
|
-
action: "reorder",
|
|
974
|
-
itemId: k.id,
|
|
975
|
-
index: y,
|
|
976
|
-
previousIndex: g,
|
|
977
|
-
nextIndex: y
|
|
978
|
-
});
|
|
979
|
-
}
|
|
980
|
-
});
|
|
981
|
-
return {
|
|
982
|
-
isPositionMode: i,
|
|
983
|
-
resolvedMinLength: s,
|
|
984
|
-
resolvedMaxLength: a,
|
|
985
|
-
placeholderCount: c,
|
|
986
|
-
slotIds: m,
|
|
987
|
-
sortableItems: p,
|
|
988
|
-
sensors: _,
|
|
989
|
-
handleDragEnd: i ? (g) => {
|
|
990
|
-
const { active: y, over: x } = g;
|
|
991
|
-
if (!x || y.id === x.id) return;
|
|
992
|
-
const k = Number(String(y.id).replace(ve, "")), N = Number(String(x.id).replace(ve, "")), $ = e.find((z) => z.position === k);
|
|
993
|
-
if (!$) return;
|
|
994
|
-
const Z = In(e, k, N);
|
|
995
|
-
o?.(Z, {
|
|
996
|
-
action: "reorder",
|
|
997
|
-
itemId: $.id,
|
|
998
|
-
index: N,
|
|
999
|
-
previousIndex: k,
|
|
1000
|
-
nextIndex: N
|
|
1001
|
-
});
|
|
1002
|
-
} : d,
|
|
1003
|
-
getMetaIndex: (g) => {
|
|
1004
|
-
const y = e.find((x) => x.id === g);
|
|
1005
|
-
return i && y ? y.position ?? 0 : e.findIndex((x) => x.id === g);
|
|
1006
|
-
}
|
|
1007
|
-
};
|
|
1008
|
-
}
|
|
1009
|
-
function Ct(e) {
|
|
1010
|
-
if (!e) return !1;
|
|
1011
|
-
try {
|
|
1012
|
-
const r = new URL(e).protocol;
|
|
1013
|
-
return r === "http:" || r === "https:";
|
|
1014
|
-
} catch {
|
|
1015
|
-
return !1;
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
function _o(e) {
|
|
1019
|
-
Ct(e) && window.open(e, "_blank", "noopener,noreferrer");
|
|
1020
|
-
}
|
|
1021
|
-
function uo(e) {
|
|
1022
|
-
return e ? e.join(",") : "image/*";
|
|
1023
|
-
}
|
|
1024
|
-
function Ge({
|
|
1025
|
-
item: e,
|
|
1026
|
-
sortableId: r,
|
|
1027
|
-
index: n,
|
|
1028
|
-
totalCount: t,
|
|
1029
|
-
width: o,
|
|
1030
|
-
height: s,
|
|
1031
|
-
accept: a,
|
|
1032
|
-
canDelete: i,
|
|
1033
|
-
hasLink: c,
|
|
1034
|
-
hasEdit: m,
|
|
1035
|
-
readOnly: p,
|
|
1036
|
-
isLoading: _,
|
|
1037
|
-
onLinkClick: d,
|
|
1038
|
-
onDelete: u,
|
|
1039
|
-
onReplace: f,
|
|
1040
|
-
onEdit: h,
|
|
1041
|
-
onPreview: g
|
|
1042
|
-
}) {
|
|
1043
|
-
const y = ie(null), x = d ? !!e.url : Ct(e.url);
|
|
1044
|
-
return /* @__PURE__ */ D(
|
|
1045
|
-
yt,
|
|
1046
|
-
{
|
|
1047
|
-
id: r ?? e.id,
|
|
1048
|
-
totalCount: t,
|
|
1049
|
-
width: o,
|
|
1050
|
-
height: s,
|
|
1051
|
-
readOnly: p,
|
|
1052
|
-
isLoading: _,
|
|
1053
|
-
itemIsLoading: e.isLoading,
|
|
1054
|
-
canDelete: i,
|
|
1055
|
-
isDragHandleOverlay: !0,
|
|
1056
|
-
hasLink: c && x,
|
|
1057
|
-
linkUrl: e.url,
|
|
1058
|
-
onLinkClick: c && x ? () => d ? d(e) : e.url && _o(e.url) : void 0,
|
|
1059
|
-
onDelete: () => u(e.id),
|
|
1060
|
-
deleteAriaLabel: "이미지 삭제",
|
|
1061
|
-
onTileClick: () => y.current?.click(),
|
|
1062
|
-
onFileDrop: (k) => {
|
|
1063
|
-
if (a) {
|
|
1064
|
-
if (!a.includes(k.type)) return;
|
|
1065
|
-
} else if (!k.type.startsWith("image/")) return;
|
|
1066
|
-
f(e.id, k);
|
|
1067
|
-
},
|
|
1068
|
-
children: [
|
|
1069
|
-
/* @__PURE__ */ l(
|
|
1070
|
-
"input",
|
|
1071
|
-
{
|
|
1072
|
-
ref: y,
|
|
1073
|
-
type: "file",
|
|
1074
|
-
accept: uo(a),
|
|
1075
|
-
style: { display: "none" },
|
|
1076
|
-
onChange: (k) => {
|
|
1077
|
-
const N = k.target.files?.[0];
|
|
1078
|
-
N && f(e.id, N), k.target.value = "";
|
|
1079
|
-
}
|
|
1080
|
-
}
|
|
1081
|
-
),
|
|
1082
|
-
/* @__PURE__ */ D("div", { className: G.TileContent, children: [
|
|
1083
|
-
/* @__PURE__ */ l(
|
|
1084
|
-
"img",
|
|
1085
|
-
{
|
|
1086
|
-
src: e.url,
|
|
1087
|
-
alt: e.file?.name ?? `이미지 ${n + 1}`,
|
|
1088
|
-
className: G.TileImage
|
|
1089
|
-
}
|
|
1090
|
-
),
|
|
1091
|
-
m && !p && /* @__PURE__ */ l(
|
|
1092
|
-
"button",
|
|
1093
|
-
{
|
|
1094
|
-
type: "button",
|
|
1095
|
-
className: `${G.OverlayButton} ${G.OverlayButtonLeft}`,
|
|
1096
|
-
"aria-label": "이미지 편집",
|
|
1097
|
-
title: "편집",
|
|
1098
|
-
disabled: _ || e.isLoading,
|
|
1099
|
-
onClick: (k) => {
|
|
1100
|
-
k.stopPropagation(), h(e);
|
|
1101
|
-
},
|
|
1102
|
-
children: /* @__PURE__ */ l(tr, { size: 18 })
|
|
1103
|
-
}
|
|
1104
|
-
),
|
|
1105
|
-
e.url && /* @__PURE__ */ l(
|
|
1106
|
-
"button",
|
|
1107
|
-
{
|
|
1108
|
-
type: "button",
|
|
1109
|
-
className: `${G.OverlayButton} ${G.OverlayButtonRight}`,
|
|
1110
|
-
"aria-label": "이미지 확대보기",
|
|
1111
|
-
title: "크게 보기",
|
|
1112
|
-
disabled: _ || e.isLoading,
|
|
1113
|
-
onClick: (k) => {
|
|
1114
|
-
k.stopPropagation(), g(e);
|
|
1115
|
-
},
|
|
1116
|
-
children: /* @__PURE__ */ l(rr, { size: 18, color: at })
|
|
1117
|
-
}
|
|
1118
|
-
)
|
|
1119
|
-
] })
|
|
1120
|
-
]
|
|
1121
|
-
}
|
|
1122
|
-
);
|
|
1123
|
-
}
|
|
1124
|
-
const Aa = ({
|
|
1125
|
-
value: e = [],
|
|
1126
|
-
onChange: r,
|
|
1127
|
-
accept: n,
|
|
1128
|
-
length: t,
|
|
1129
|
-
width: o = 160,
|
|
1130
|
-
height: s = 200,
|
|
1131
|
-
placeholder: a = "이미지를 넣어주세요",
|
|
1132
|
-
hasIcon: i = !0,
|
|
1133
|
-
hasLink: c = !1,
|
|
1134
|
-
onLinkClick: m,
|
|
1135
|
-
hasEdit: p = !1,
|
|
1136
|
-
canDelete: _ = !0,
|
|
1137
|
-
minLength: d,
|
|
1138
|
-
maxLength: u,
|
|
1139
|
-
errorMsg: f,
|
|
1140
|
-
isLoading: h,
|
|
1141
|
-
readOnly: g,
|
|
1142
|
-
gap: y = 8
|
|
1143
|
-
}) => {
|
|
1144
|
-
const {
|
|
1145
|
-
isPositionMode: x,
|
|
1146
|
-
resolvedMaxLength: k,
|
|
1147
|
-
placeholderCount: N,
|
|
1148
|
-
slotIds: $,
|
|
1149
|
-
sortableItems: Z,
|
|
1150
|
-
sensors: z,
|
|
1151
|
-
handleDragEnd: B,
|
|
1152
|
-
getMetaIndex: b
|
|
1153
|
-
} = kt({ value: e, length: t, minLength: d, maxLength: u, onChange: r }), C = !!f, [E, O] = v(null), [P, T] = v(null), I = P ? e.find((A) => A.id === P.id && A.url === P.url) ?? null : null;
|
|
1154
|
-
P && !I && T(null);
|
|
1155
|
-
const H = ie(e);
|
|
1156
|
-
Q(() => {
|
|
1157
|
-
H.current = e;
|
|
1158
|
-
}, [e]), Q(() => () => Nn(H.current), []);
|
|
1159
|
-
const L = (A) => {
|
|
1160
|
-
if (g) return;
|
|
1161
|
-
const w = e.length, F = Bn(e, A, k);
|
|
1162
|
-
F.length !== w && r?.(F, {
|
|
1163
|
-
action: "create",
|
|
1164
|
-
itemId: F[w].id,
|
|
1165
|
-
index: w
|
|
1166
|
-
});
|
|
1167
|
-
}, R = (A, w) => {
|
|
1168
|
-
if (g) return;
|
|
1169
|
-
const F = w[0];
|
|
1170
|
-
if (!F) return;
|
|
1171
|
-
const te = An(e, F, A);
|
|
1172
|
-
r?.(te, {
|
|
1173
|
-
action: "create",
|
|
1174
|
-
itemId: te[te.length - 1].id,
|
|
1175
|
-
index: A
|
|
1176
|
-
});
|
|
1177
|
-
}, S = (A) => {
|
|
1178
|
-
if (g) return;
|
|
1179
|
-
const w = b(A), F = Ln(e, A);
|
|
1180
|
-
r?.(F, { action: "delete", itemId: A, index: w });
|
|
1181
|
-
}, ee = (A, w) => {
|
|
1182
|
-
if (g) return;
|
|
1183
|
-
const F = b(A), te = ht(e, A, w);
|
|
1184
|
-
r?.(te, { action: "replace", itemId: A, index: F });
|
|
1185
|
-
}, J = (A) => {
|
|
1186
|
-
if (!E) return;
|
|
1187
|
-
const w = E.id, F = b(w), te = En(e, w, A);
|
|
1188
|
-
O(null), r?.(te, { action: "crop", itemId: w, index: F });
|
|
1189
|
-
}, de = (A) => {
|
|
1190
|
-
const w = typeof a == "function" ? a(A) : a;
|
|
1191
|
-
return typeof w != "string" ? w : w.split(`
|
|
1192
|
-
`).map((F, te) => /* @__PURE__ */ l("span", { children: F }, te));
|
|
1193
|
-
};
|
|
1194
|
-
return /* @__PURE__ */ D("div", { children: [
|
|
1195
|
-
/* @__PURE__ */ l(it, { sensors: z, collisionDetection: lt, onDragEnd: B, children: /* @__PURE__ */ l(dt, { items: Z, strategy: ut, children: /* @__PURE__ */ l("div", { className: G.Container, style: { gap: y }, children: x ? Array.from({ length: k }, (A, w) => {
|
|
1196
|
-
const F = $[w], te = e.find((le) => le.position === w);
|
|
1197
|
-
return te ? /* @__PURE__ */ l(
|
|
1198
|
-
Ge,
|
|
1199
|
-
{
|
|
1200
|
-
item: te,
|
|
1201
|
-
sortableId: F,
|
|
1202
|
-
index: w,
|
|
1203
|
-
totalCount: k,
|
|
1204
|
-
width: o,
|
|
1205
|
-
height: s,
|
|
1206
|
-
accept: n,
|
|
1207
|
-
canDelete: _,
|
|
1208
|
-
hasLink: c,
|
|
1209
|
-
hasEdit: p,
|
|
1210
|
-
readOnly: g ?? !1,
|
|
1211
|
-
isLoading: h,
|
|
1212
|
-
onLinkClick: m,
|
|
1213
|
-
onDelete: S,
|
|
1214
|
-
onReplace: ee,
|
|
1215
|
-
onEdit: O,
|
|
1216
|
-
onPreview: (le) => {
|
|
1217
|
-
le.url && T({ id: le.id, url: le.url });
|
|
1218
|
-
}
|
|
1219
|
-
},
|
|
1220
|
-
F
|
|
1221
|
-
) : !g && /* @__PURE__ */ l(gt, { id: F, children: /* @__PURE__ */ D(
|
|
1222
|
-
De,
|
|
1223
|
-
{
|
|
1224
|
-
onDrop: (le) => R(w, le),
|
|
1225
|
-
accept: n ?? je,
|
|
1226
|
-
multiple: !1,
|
|
1227
|
-
isLoading: h,
|
|
1228
|
-
isError: C,
|
|
1229
|
-
width: o,
|
|
1230
|
-
height: s,
|
|
1231
|
-
children: [
|
|
1232
|
-
i && /* @__PURE__ */ l(ye, { size: 36, color: C ? ke : Ce }),
|
|
1233
|
-
a && /* @__PURE__ */ l(
|
|
1234
|
-
"div",
|
|
1235
|
-
{
|
|
1236
|
-
className: `${G.PlaceholderText}${C ? ` ${G.PlaceholderTextError}` : ""}`,
|
|
1237
|
-
children: de(w)
|
|
1238
|
-
}
|
|
1239
|
-
)
|
|
1240
|
-
]
|
|
1241
|
-
}
|
|
1242
|
-
) }, F);
|
|
1243
|
-
}) : /* @__PURE__ */ D(tt, { children: [
|
|
1244
|
-
e.map((A, w) => /* @__PURE__ */ l(
|
|
1245
|
-
Ge,
|
|
1246
|
-
{
|
|
1247
|
-
item: A,
|
|
1248
|
-
index: w,
|
|
1249
|
-
totalCount: e.length,
|
|
1250
|
-
width: o,
|
|
1251
|
-
height: s,
|
|
1252
|
-
accept: n,
|
|
1253
|
-
canDelete: _,
|
|
1254
|
-
hasLink: c,
|
|
1255
|
-
hasEdit: p,
|
|
1256
|
-
readOnly: g ?? !1,
|
|
1257
|
-
isLoading: h,
|
|
1258
|
-
onLinkClick: m,
|
|
1259
|
-
onDelete: S,
|
|
1260
|
-
onReplace: ee,
|
|
1261
|
-
onEdit: O,
|
|
1262
|
-
onPreview: (F) => {
|
|
1263
|
-
F.url && T({ id: F.id, url: F.url });
|
|
1264
|
-
}
|
|
1265
|
-
},
|
|
1266
|
-
A.id
|
|
1267
|
-
)),
|
|
1268
|
-
!g && Array.from({ length: N }, (A, w) => /* @__PURE__ */ D(
|
|
1269
|
-
De,
|
|
1270
|
-
{
|
|
1271
|
-
onDrop: L,
|
|
1272
|
-
accept: n ?? je,
|
|
1273
|
-
multiple: k !== 1,
|
|
1274
|
-
isLoading: h,
|
|
1275
|
-
isError: C,
|
|
1276
|
-
width: o,
|
|
1277
|
-
height: s,
|
|
1278
|
-
children: [
|
|
1279
|
-
i && /* @__PURE__ */ l(ye, { size: 36, color: C ? ke : Ce }),
|
|
1280
|
-
a && /* @__PURE__ */ l(
|
|
1281
|
-
"div",
|
|
1282
|
-
{
|
|
1283
|
-
className: `${G.PlaceholderText}${C ? ` ${G.PlaceholderTextError}` : ""}`,
|
|
1284
|
-
children: de(w)
|
|
1285
|
-
}
|
|
1286
|
-
)
|
|
1287
|
-
]
|
|
1288
|
-
},
|
|
1289
|
-
`placeholder-${w}`
|
|
1290
|
-
))
|
|
1291
|
-
] }) }) }) }),
|
|
1292
|
-
C && /* @__PURE__ */ l(X.Error, { mt: 8, children: f }),
|
|
1293
|
-
p && /* @__PURE__ */ l(
|
|
1294
|
-
Fn,
|
|
1295
|
-
{
|
|
1296
|
-
item: E,
|
|
1297
|
-
isOpen: !!E,
|
|
1298
|
-
onClose: () => O(null),
|
|
1299
|
-
onSubmit: J
|
|
1300
|
-
}
|
|
1301
|
-
),
|
|
1302
|
-
/* @__PURE__ */ l(
|
|
1303
|
-
ft,
|
|
1304
|
-
{
|
|
1305
|
-
opened: !!I,
|
|
1306
|
-
onClose: () => T(null),
|
|
1307
|
-
title: I?.file?.name ?? "이미지 미리보기",
|
|
1308
|
-
size: "xl",
|
|
1309
|
-
centered: !0,
|
|
1310
|
-
xOffset: 16,
|
|
1311
|
-
yOffset: 16,
|
|
1312
|
-
withCloseButton: !0,
|
|
1313
|
-
closeButtonProps: {
|
|
1314
|
-
"aria-label": "이미지 미리보기 닫기",
|
|
1315
|
-
icon: /* @__PURE__ */ l(Pe, { size: 18, color: $e })
|
|
1316
|
-
},
|
|
1317
|
-
styles: {
|
|
1318
|
-
content: {
|
|
1319
|
-
flex: "0 1 auto",
|
|
1320
|
-
width: "fit-content",
|
|
1321
|
-
maxWidth: "calc(100vw - 32px)",
|
|
1322
|
-
maxHeight: "calc(100dvh - 32px)"
|
|
1323
|
-
},
|
|
1324
|
-
body: { padding: "16px" }
|
|
1325
|
-
},
|
|
1326
|
-
children: I && /* @__PURE__ */ l(mo, { item: I }, `${I.id}:${I.url}`)
|
|
1327
|
-
}
|
|
1328
|
-
)
|
|
1329
|
-
] });
|
|
1330
|
-
};
|
|
1331
|
-
function mo({ item: e }) {
|
|
1332
|
-
const [r, n] = v(!1);
|
|
1333
|
-
return /* @__PURE__ */ D("div", { className: G.PreviewContent, children: [
|
|
1334
|
-
/* @__PURE__ */ D("div", { className: G.PreviewControls, role: "group", "aria-label": "이미지 크기 보기", children: [
|
|
1335
|
-
/* @__PURE__ */ l(
|
|
1336
|
-
me,
|
|
1337
|
-
{
|
|
1338
|
-
variant: r ? "basic" : "primary",
|
|
1339
|
-
size: "sm",
|
|
1340
|
-
"aria-label": "화면에 맞춤",
|
|
1341
|
-
"aria-pressed": !r,
|
|
1342
|
-
onClick: () => n(!1),
|
|
1343
|
-
children: "화면에 맞춤"
|
|
1344
|
-
}
|
|
1345
|
-
),
|
|
1346
|
-
/* @__PURE__ */ l(
|
|
1347
|
-
me,
|
|
1348
|
-
{
|
|
1349
|
-
variant: r ? "primary" : "basic",
|
|
1350
|
-
size: "sm",
|
|
1351
|
-
"aria-label": "원본 크기 (100%)",
|
|
1352
|
-
"aria-pressed": r,
|
|
1353
|
-
onClick: () => n(!0),
|
|
1354
|
-
children: "원본 크기 (100%)"
|
|
1355
|
-
}
|
|
1356
|
-
)
|
|
1357
|
-
] }),
|
|
1358
|
-
/* @__PURE__ */ l(
|
|
1359
|
-
"div",
|
|
1360
|
-
{
|
|
1361
|
-
"data-size-mode": r ? "original" : "fit",
|
|
1362
|
-
className: `${G.PreviewViewport}${r ? ` ${G.PreviewOriginal}` : ""}`,
|
|
1363
|
-
children: /* @__PURE__ */ l("img", { src: e.url, alt: e.file?.name ?? "이미지 미리보기" })
|
|
1364
|
-
}
|
|
1365
|
-
)
|
|
1366
|
-
] });
|
|
1367
|
-
}
|
|
1368
|
-
function Dt(e) {
|
|
1369
|
-
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
1370
|
-
const r = e;
|
|
1371
|
-
return "v" in r && "fr" in r && "ip" in r && "op" in r && "w" in r && "h" in r && "layers" in r && Array.isArray(r.layers);
|
|
1372
|
-
}
|
|
1373
|
-
function Oe(e) {
|
|
1374
|
-
return new Promise((r) => {
|
|
1375
|
-
const n = new FileReader();
|
|
1376
|
-
n.onload = (t) => {
|
|
1377
|
-
try {
|
|
1378
|
-
const o = JSON.parse(t.target?.result);
|
|
1379
|
-
r(Dt(o) ? o : null);
|
|
1380
|
-
} catch {
|
|
1381
|
-
r(null);
|
|
1382
|
-
}
|
|
1383
|
-
}, n.onerror = () => r(null), n.readAsText(e);
|
|
1384
|
-
});
|
|
1385
|
-
}
|
|
1386
|
-
function po(e, r, n) {
|
|
1387
|
-
const t = [...r].sort((i, c) => i.name.localeCompare(c.name)), o = n != null ? n - e.length : 1 / 0, a = t.slice(0, o).map((i) => ({
|
|
1388
|
-
id: Me(),
|
|
1389
|
-
file: i
|
|
1390
|
-
}));
|
|
1391
|
-
return [...e, ...a];
|
|
1392
|
-
}
|
|
1393
|
-
function fo(e, r) {
|
|
1394
|
-
return e.filter((n) => n.id !== r);
|
|
1395
|
-
}
|
|
1396
|
-
function ho(e, r, n) {
|
|
1397
|
-
const t = {
|
|
1398
|
-
id: Me(),
|
|
1399
|
-
file: r,
|
|
1400
|
-
position: n
|
|
1401
|
-
};
|
|
1402
|
-
return [...e, t];
|
|
1403
|
-
}
|
|
1404
|
-
const go = "styles-module__Container___cJqG-", yo = "styles-module__Empty___gexrS", ko = "styles-module__PlaceholderText___x2ya0", Co = "styles-module__PlaceholderTextError___i8VXv", _e = {
|
|
1405
|
-
Container: go,
|
|
1406
|
-
Empty: yo,
|
|
1407
|
-
PlaceholderText: ko,
|
|
1408
|
-
PlaceholderTextError: Co
|
|
1409
|
-
}, Do = "styles-module__Toast___ZqZzU", xo = "styles-module__Toast__Icon___PWXSy", Po = "styles-module__Toast__Body___wezPs", bo = "styles-module__Toast__Message___NFsgm", he = {
|
|
1410
|
-
Toast: Do,
|
|
1411
|
-
Toast__Icon: xo,
|
|
1412
|
-
Toast__Body: Po,
|
|
1413
|
-
Toast__Message: bo
|
|
1414
|
-
}, xt = (e) => typeof e == "string" ? { message: e } : e, Pt = (e, r) => {
|
|
1415
|
-
const { autoClose: n, icon: t, message: o } = xt(e);
|
|
1416
|
-
return {
|
|
1417
|
-
id: r,
|
|
1418
|
-
message: /* @__PURE__ */ l("div", { className: he.Toast__Message, children: o }),
|
|
1419
|
-
icon: t,
|
|
1420
|
-
autoClose: n,
|
|
1421
|
-
classNames: {
|
|
1422
|
-
root: he.Toast,
|
|
1423
|
-
body: he.Toast__Body,
|
|
1424
|
-
icon: he.Toast__Icon
|
|
1425
|
-
},
|
|
1426
|
-
withCloseButton: !1,
|
|
1427
|
-
withBorder: !1
|
|
1428
|
-
};
|
|
1429
|
-
}, ce = (e) => {
|
|
1430
|
-
const r = xt(e);
|
|
1431
|
-
be.show(Pt(e, r.id));
|
|
1432
|
-
};
|
|
1433
|
-
ce.update = (e, r) => {
|
|
1434
|
-
be.update(Pt(r, e));
|
|
1435
|
-
};
|
|
1436
|
-
ce.hide = (e) => {
|
|
1437
|
-
be.hide(e);
|
|
1438
|
-
};
|
|
1439
|
-
ce.clean = () => {
|
|
1440
|
-
be.clean();
|
|
1441
|
-
};
|
|
1442
|
-
const Ke = { "application/json": [".json"] };
|
|
1443
|
-
function Je({
|
|
1444
|
-
item: e,
|
|
1445
|
-
sortableId: r,
|
|
1446
|
-
totalCount: n,
|
|
1447
|
-
width: t,
|
|
1448
|
-
height: o,
|
|
1449
|
-
readOnly: s,
|
|
1450
|
-
isLoading: a,
|
|
1451
|
-
canDelete: i,
|
|
1452
|
-
hasLink: c,
|
|
1453
|
-
onLinkClick: m,
|
|
1454
|
-
onDelete: p
|
|
1455
|
-
}) {
|
|
1456
|
-
const d = !e.animationData && !!(e.file || e.url) ? `${e.id}|${e.file ? `${e.file.name}:${e.file.size}` : e.url ?? ""}` : "", [u, f] = v({ key: "", data: null }), h = e.animationData ?? (u.key === d ? u.data : null), g = !!d && u.key !== d;
|
|
1457
|
-
return Q(() => {
|
|
1458
|
-
if (!d) return;
|
|
1459
|
-
let y = !1;
|
|
1460
|
-
return (e.file ? Oe(e.file) : fetch(e.url).then((k) => k.json()).then(
|
|
1461
|
-
(k) => Dt(k) ? k : null
|
|
1462
|
-
)).then((k) => {
|
|
1463
|
-
y || f({ key: d, data: k });
|
|
1464
|
-
}).catch(() => {
|
|
1465
|
-
y || f({ key: d, data: null });
|
|
1466
|
-
}), () => {
|
|
1467
|
-
y = !0;
|
|
1468
|
-
};
|
|
1469
|
-
}, [d, e.file, e.url]), /* @__PURE__ */ l(
|
|
1470
|
-
yt,
|
|
1471
|
-
{
|
|
1472
|
-
id: r ?? e.id,
|
|
1473
|
-
totalCount: n,
|
|
1474
|
-
width: t,
|
|
1475
|
-
height: o,
|
|
1476
|
-
readOnly: s,
|
|
1477
|
-
isLoading: a,
|
|
1478
|
-
itemIsLoading: e.isLoading || g,
|
|
1479
|
-
canDelete: i,
|
|
1480
|
-
hasLink: c,
|
|
1481
|
-
linkUrl: e.url,
|
|
1482
|
-
onLinkClick: m ? () => m(e) : void 0,
|
|
1483
|
-
onDelete: () => p(e.id),
|
|
1484
|
-
deleteAriaLabel: "Lottie 삭제",
|
|
1485
|
-
children: h ? /* @__PURE__ */ l(
|
|
1486
|
-
gr,
|
|
1487
|
-
{
|
|
1488
|
-
animationData: h,
|
|
1489
|
-
loop: !0,
|
|
1490
|
-
autoplay: !0,
|
|
1491
|
-
style: { width: t, height: o, display: "block" }
|
|
1492
|
-
}
|
|
1493
|
-
) : /* @__PURE__ */ l("div", { className: _e.Empty, style: { width: t, height: o } })
|
|
1494
|
-
}
|
|
1495
|
-
);
|
|
1496
|
-
}
|
|
1497
|
-
const Na = ({
|
|
1498
|
-
value: e = [],
|
|
1499
|
-
onChange: r,
|
|
1500
|
-
width: n = 160,
|
|
1501
|
-
height: t = 200,
|
|
1502
|
-
placeholder: o = "Lottie JSON 파일을 넣어주세요",
|
|
1503
|
-
hasIcon: s = !0,
|
|
1504
|
-
hasLink: a = !1,
|
|
1505
|
-
onLinkClick: i,
|
|
1506
|
-
length: c,
|
|
1507
|
-
minLength: m,
|
|
1508
|
-
maxLength: p,
|
|
1509
|
-
errorMsg: _,
|
|
1510
|
-
isLoading: d,
|
|
1511
|
-
readOnly: u,
|
|
1512
|
-
gap: f = 8,
|
|
1513
|
-
canDelete: h = !0
|
|
1514
|
-
}) => {
|
|
1515
|
-
const {
|
|
1516
|
-
isPositionMode: g,
|
|
1517
|
-
resolvedMaxLength: y,
|
|
1518
|
-
placeholderCount: x,
|
|
1519
|
-
slotIds: k,
|
|
1520
|
-
sortableItems: N,
|
|
1521
|
-
sensors: $,
|
|
1522
|
-
handleDragEnd: Z,
|
|
1523
|
-
getMetaIndex: z
|
|
1524
|
-
} = kt({ value: e, length: c, minLength: m, maxLength: p, onChange: r }), B = !!_, b = async (P) => {
|
|
1525
|
-
if (u) return;
|
|
1526
|
-
const T = [...P].sort((ee, J) => ee.name.localeCompare(J.name)), I = await Promise.all(T.map(Oe));
|
|
1527
|
-
let H = 0;
|
|
1528
|
-
const L = T.filter((ee, J) => I[J] !== null ? !0 : (H++, !1));
|
|
1529
|
-
if (H > 0 && ce({
|
|
1530
|
-
id: "invalid-lottie-files",
|
|
1531
|
-
message: H === 1 ? "유효하지 않은 Lottie JSON 파일입니다" : `${H}개의 파일이 유효하지 않은 Lottie JSON입니다`
|
|
1532
|
-
}), L.length === 0) return;
|
|
1533
|
-
const R = e.length, S = po(e, L, y);
|
|
1534
|
-
S.length !== R && r?.(S, {
|
|
1535
|
-
action: "create",
|
|
1536
|
-
itemId: S[R].id,
|
|
1537
|
-
index: R
|
|
1538
|
-
});
|
|
1539
|
-
}, C = async (P, T) => {
|
|
1540
|
-
if (u) return;
|
|
1541
|
-
const I = T[0];
|
|
1542
|
-
if (!I) return;
|
|
1543
|
-
if (!await Oe(I)) {
|
|
1544
|
-
ce({
|
|
1545
|
-
id: "invalid-lottie-files",
|
|
1546
|
-
message: "유효하지 않은 Lottie JSON 파일입니다"
|
|
1547
|
-
});
|
|
1548
|
-
return;
|
|
1549
|
-
}
|
|
1550
|
-
const L = ho(e, I, P);
|
|
1551
|
-
r?.(L, {
|
|
1552
|
-
action: "create",
|
|
1553
|
-
itemId: L[L.length - 1].id,
|
|
1554
|
-
index: P
|
|
1555
|
-
});
|
|
1556
|
-
}, E = (P) => {
|
|
1557
|
-
if (u) return;
|
|
1558
|
-
const T = z(P), I = fo(e, P);
|
|
1559
|
-
r?.(I, { action: "delete", itemId: P, index: T });
|
|
1560
|
-
}, O = (P) => {
|
|
1561
|
-
const T = typeof o == "function" ? o(P) : o;
|
|
1562
|
-
return typeof T != "string" ? T : T.split(`
|
|
1563
|
-
`).map((I, H) => /* @__PURE__ */ l("span", { children: I }, H));
|
|
1564
|
-
};
|
|
1565
|
-
return /* @__PURE__ */ D("div", { children: [
|
|
1566
|
-
/* @__PURE__ */ l(it, { sensors: $, collisionDetection: lt, onDragEnd: Z, children: /* @__PURE__ */ l(dt, { items: N, strategy: ut, children: /* @__PURE__ */ l("div", { className: _e.Container, style: { gap: f }, children: g ? Array.from({ length: y }, (P, T) => {
|
|
1567
|
-
const I = k[T], H = e.find((L) => L.position === T);
|
|
1568
|
-
return H ? /* @__PURE__ */ l(
|
|
1569
|
-
Je,
|
|
1570
|
-
{
|
|
1571
|
-
item: H,
|
|
1572
|
-
sortableId: I,
|
|
1573
|
-
totalCount: y,
|
|
1574
|
-
width: n,
|
|
1575
|
-
height: t,
|
|
1576
|
-
readOnly: u ?? !1,
|
|
1577
|
-
isLoading: d,
|
|
1578
|
-
canDelete: h,
|
|
1579
|
-
hasLink: a,
|
|
1580
|
-
onLinkClick: i,
|
|
1581
|
-
onDelete: E
|
|
1582
|
-
},
|
|
1583
|
-
I
|
|
1584
|
-
) : !u && /* @__PURE__ */ l(gt, { id: I, children: /* @__PURE__ */ D(
|
|
1585
|
-
De,
|
|
1586
|
-
{
|
|
1587
|
-
onDrop: (L) => C(T, L),
|
|
1588
|
-
accept: Ke,
|
|
1589
|
-
multiple: !1,
|
|
1590
|
-
isLoading: d,
|
|
1591
|
-
isError: B,
|
|
1592
|
-
width: n,
|
|
1593
|
-
height: t,
|
|
1594
|
-
children: [
|
|
1595
|
-
s && /* @__PURE__ */ l(ye, { size: 36, color: B ? ke : Ce }),
|
|
1596
|
-
o && /* @__PURE__ */ l(
|
|
1597
|
-
"div",
|
|
1598
|
-
{
|
|
1599
|
-
className: `${_e.PlaceholderText}${B ? ` ${_e.PlaceholderTextError}` : ""}`,
|
|
1600
|
-
children: O(T)
|
|
1601
|
-
}
|
|
1602
|
-
)
|
|
1603
|
-
]
|
|
1604
|
-
}
|
|
1605
|
-
) }, I);
|
|
1606
|
-
}) : /* @__PURE__ */ D(tt, { children: [
|
|
1607
|
-
e.map((P) => /* @__PURE__ */ l(
|
|
1608
|
-
Je,
|
|
1609
|
-
{
|
|
1610
|
-
item: P,
|
|
1611
|
-
totalCount: e.length,
|
|
1612
|
-
width: n,
|
|
1613
|
-
height: t,
|
|
1614
|
-
readOnly: u ?? !1,
|
|
1615
|
-
isLoading: d,
|
|
1616
|
-
canDelete: h,
|
|
1617
|
-
hasLink: a,
|
|
1618
|
-
onLinkClick: i,
|
|
1619
|
-
onDelete: E
|
|
1620
|
-
},
|
|
1621
|
-
P.id
|
|
1622
|
-
)),
|
|
1623
|
-
!u && Array.from({ length: x }, (P, T) => /* @__PURE__ */ D(
|
|
1624
|
-
De,
|
|
1625
|
-
{
|
|
1626
|
-
onDrop: b,
|
|
1627
|
-
accept: Ke,
|
|
1628
|
-
multiple: y !== 1,
|
|
1629
|
-
isLoading: d,
|
|
1630
|
-
isError: B,
|
|
1631
|
-
width: n,
|
|
1632
|
-
height: t,
|
|
1633
|
-
children: [
|
|
1634
|
-
s && /* @__PURE__ */ l(ye, { size: 36, color: B ? ke : Ce }),
|
|
1635
|
-
o && /* @__PURE__ */ l(
|
|
1636
|
-
"div",
|
|
1637
|
-
{
|
|
1638
|
-
className: `${_e.PlaceholderText}${B ? ` ${_e.PlaceholderTextError}` : ""}`,
|
|
1639
|
-
children: O(T)
|
|
1640
|
-
}
|
|
1641
|
-
)
|
|
1642
|
-
]
|
|
1643
|
-
},
|
|
1644
|
-
`placeholder-${T}`
|
|
1645
|
-
))
|
|
1646
|
-
] }) }) }) }),
|
|
1647
|
-
B && /* @__PURE__ */ l(X.Error, { mt: 8, children: _ })
|
|
1648
|
-
] });
|
|
1649
|
-
}, Mo = "style-module__Pagination___xcR-Q", So = "style-module__Pagination__PageIndex___50SZJ", To = "style-module__Pagination__Arrow___74vp3", ue = {
|
|
1650
|
-
Pagination: Mo,
|
|
1651
|
-
Pagination__PageIndex: So,
|
|
1652
|
-
"Pagination__PageIndex--Active": "style-module__Pagination__PageIndex--Active___mSIwS",
|
|
1653
|
-
Pagination__Arrow: To
|
|
1654
|
-
}, Oa = ({
|
|
1655
|
-
currentPageIdx: e,
|
|
1656
|
-
rowsPerPage: r,
|
|
1657
|
-
totalLength: n,
|
|
1658
|
-
paginationSize: t,
|
|
1659
|
-
onPageChange: o,
|
|
1660
|
-
...s
|
|
1661
|
-
}) => {
|
|
1662
|
-
const [a, i] = v(e), c = r || 50, m = n || 1, p = t || 5;
|
|
1663
|
-
Q(() => {
|
|
1664
|
-
i(e);
|
|
1665
|
-
}, [e]);
|
|
1666
|
-
const _ = () => {
|
|
1667
|
-
o && o(a - (a % p + 1)), i((u) => u - (u % p + 1));
|
|
1668
|
-
}, d = () => {
|
|
1669
|
-
o && o(a + p - a % p), i((u) => u + p - u % p);
|
|
1670
|
-
};
|
|
1671
|
-
return /* @__PURE__ */ D("div", { ...s, className: ue.Pagination, children: [
|
|
1672
|
-
a >= p ? /* @__PURE__ */ l("button", { className: ue.Pagination__Arrow, onClick: _, children: /* @__PURE__ */ l(ot, { size: 20 }) }) : null,
|
|
1673
|
-
new Array(p).fill(0).map((u, f) => {
|
|
1674
|
-
const h = Math.floor(a / p) * p + f + 1;
|
|
1675
|
-
if (!(h > Math.ceil(m / c)))
|
|
1676
|
-
return /* @__PURE__ */ l(
|
|
1677
|
-
"button",
|
|
1678
|
-
{
|
|
1679
|
-
className: a === h - 1 ? ue["Pagination__PageIndex--Active"] : ue.Pagination__PageIndex,
|
|
1680
|
-
onClick: () => {
|
|
1681
|
-
i(h - 1), o && o(h - 1);
|
|
1682
|
-
},
|
|
1683
|
-
children: h
|
|
1684
|
-
},
|
|
1685
|
-
`pagination_${f}`
|
|
1686
|
-
);
|
|
1687
|
-
}),
|
|
1688
|
-
Math.floor(a / p) * p + p < Math.ceil(m / c) ? /* @__PURE__ */ l("button", { className: ue.Pagination__Arrow, onClick: d, children: /* @__PURE__ */ l(nt, { size: 20 }) }) : null
|
|
1689
|
-
] });
|
|
1690
|
-
}, Ie = {
|
|
1691
|
-
"Radio--Small": "styles-module__Radio--Small___izWI2",
|
|
1692
|
-
"Radio--Medium": "styles-module__Radio--Medium___dwZfV",
|
|
1693
|
-
"Radio--Large": "styles-module__Radio--Large___1gLra"
|
|
1694
|
-
}, wo = {
|
|
1695
|
-
sm: Ie["Radio--Small"],
|
|
1696
|
-
md: Ie["Radio--Medium"],
|
|
1697
|
-
lg: Ie["Radio--Large"]
|
|
1698
|
-
}, vo = {
|
|
1699
|
-
sm: 18,
|
|
1700
|
-
md: 24,
|
|
1701
|
-
lg: 32
|
|
1702
|
-
}, Fa = ({ size: e = "md", ...r }) => {
|
|
1703
|
-
const n = wo[e], t = vo[e];
|
|
1704
|
-
return /* @__PURE__ */ l(
|
|
1705
|
-
Nt,
|
|
1706
|
-
{
|
|
1707
|
-
className: n,
|
|
1708
|
-
size: e,
|
|
1709
|
-
styles: {
|
|
1710
|
-
inner: { width: t, height: t }
|
|
1711
|
-
},
|
|
1712
|
-
...r
|
|
1713
|
-
}
|
|
1714
|
-
);
|
|
1715
|
-
}, Io = "styles-module__SearchBar__Wrapper___oq49s", Bo = "styles-module__SearchBar__Description___vucS-", Lo = "styles-module__SearchBar__ErrorMsg___TOeoy", Eo = "styles-module__SearchBar__ClearButton___S-y4P", V = {
|
|
1716
|
-
"SearchBar--LeftLabel": "styles-module__SearchBar--LeftLabel___CeYTM",
|
|
1717
|
-
"SearchBar--TopLabel": "styles-module__SearchBar--TopLabel___spN3I",
|
|
1718
|
-
"SearchBar__Label--Small": "styles-module__SearchBar__Label--Small___zS1L2",
|
|
1719
|
-
"SearchBar__Label--Medium": "styles-module__SearchBar__Label--Medium___Fk0Ao",
|
|
1720
|
-
"SearchBar__Label--Large": "styles-module__SearchBar__Label--Large___xTOYL",
|
|
1721
|
-
"SearchBar__Tooltip--Small": "styles-module__SearchBar__Tooltip--Small___YhmEr",
|
|
1722
|
-
"SearchBar__Tooltip--Medium": "styles-module__SearchBar__Tooltip--Medium___4JhOv",
|
|
1723
|
-
"SearchBar__Tooltip--Large": "styles-module__SearchBar__Tooltip--Large___IEoPv",
|
|
1724
|
-
SearchBar__Wrapper: Io,
|
|
1725
|
-
"SearchBar--Small": "styles-module__SearchBar--Small___SY9CN",
|
|
1726
|
-
"SearchBar--Medium": "styles-module__SearchBar--Medium___vLP08",
|
|
1727
|
-
"SearchBar--Large": "styles-module__SearchBar--Large___JHfHP",
|
|
1728
|
-
SearchBar__Description: Bo,
|
|
1729
|
-
SearchBar__ErrorMsg: Lo,
|
|
1730
|
-
SearchBar__ClearButton: Eo
|
|
1731
|
-
}, $a = ({
|
|
1732
|
-
label: e,
|
|
1733
|
-
labelPosition: r = "top",
|
|
1734
|
-
size: n = "md",
|
|
1735
|
-
required: t,
|
|
1736
|
-
tooltip: o,
|
|
1737
|
-
tooltipPosition: s = "top",
|
|
1738
|
-
errorMsg: a,
|
|
1739
|
-
description: i,
|
|
1740
|
-
onChange: c,
|
|
1741
|
-
onClear: m,
|
|
1742
|
-
...p
|
|
1743
|
-
}) => {
|
|
1744
|
-
const [_, d] = v(0);
|
|
1745
|
-
let u = V["SearchBar__Label--Medium"], f = V["SearchBar--Medium"], h = V["SearchBar__Tooltip--Medium"];
|
|
1746
|
-
n === "sm" ? (u = V["SearchBar__Label--Small"], f = V["SearchBar--Small"], h = V["SearchBar__Tooltip--Small"]) : n === "lg" && (u = V["SearchBar__Label--Large"], f = V["SearchBar--Large"], h = V["SearchBar__Tooltip--Large"]);
|
|
1747
|
-
const g = W(
|
|
1748
|
-
(y) => {
|
|
1749
|
-
c && (d(y?.length), c(y));
|
|
1750
|
-
},
|
|
1751
|
-
[c]
|
|
1752
|
-
);
|
|
1753
|
-
return /* @__PURE__ */ D(
|
|
1754
|
-
"div",
|
|
1755
|
-
{
|
|
1756
|
-
className: r === "top" ? V["SearchBar--TopLabel"] : V["SearchBar--LeftLabel"],
|
|
1757
|
-
children: [
|
|
1758
|
-
/* @__PURE__ */ D("div", { children: [
|
|
1759
|
-
e && /* @__PURE__ */ l(X.Label, { required: t, className: u, children: e }),
|
|
1760
|
-
o && /* @__PURE__ */ l(xe, { label: o, position: s, children: /* @__PURE__ */ l("div", { className: h, children: /* @__PURE__ */ l(Fe, { size: n === "sm" ? 14 : n === "lg" ? 20 : 16 }) }) })
|
|
1761
|
-
] }),
|
|
1762
|
-
/* @__PURE__ */ D("div", { children: [
|
|
1763
|
-
/* @__PURE__ */ l("div", { className: V.SearchBar__Wrapper, children: /* @__PURE__ */ l(
|
|
1764
|
-
Ot,
|
|
1765
|
-
{
|
|
1766
|
-
...p,
|
|
1767
|
-
size: n,
|
|
1768
|
-
error: a,
|
|
1769
|
-
className: f,
|
|
1770
|
-
onChange: g,
|
|
1771
|
-
leftSection: /* @__PURE__ */ l(nr, { size: n === "sm" ? 16 : n === "lg" ? 24 : 20 }),
|
|
1772
|
-
rightSection: m && _ > 0 ? /* @__PURE__ */ l("div", { className: V.SearchBar__ClearButton, onClick: m, children: /* @__PURE__ */ l(Pe, { size: n === "sm" ? 16 : n === "lg" ? 24 : 20 }) }) : void 0
|
|
1773
|
-
}
|
|
1774
|
-
) }),
|
|
1775
|
-
i && /* @__PURE__ */ l(X.Description, { className: V.SearchBar__Description, children: i }),
|
|
1776
|
-
a && /* @__PURE__ */ l(X.Error, { className: V.SearchBar__ErrorMsg, children: a })
|
|
1777
|
-
] })
|
|
1778
|
-
]
|
|
1779
|
-
}
|
|
1780
|
-
);
|
|
1781
|
-
}, Be = {
|
|
1782
|
-
"SegmentButton--Small": "styles-module__SegmentButton--Small___o0Y3t",
|
|
1783
|
-
"SegmentButton--Medium": "styles-module__SegmentButton--Medium___EgCJm",
|
|
1784
|
-
"SegmentButton--Large": "styles-module__SegmentButton--Large___Ym86C"
|
|
1785
|
-
}, Ra = ({
|
|
1786
|
-
size: e = "md",
|
|
1787
|
-
radius: r = or,
|
|
1788
|
-
...n
|
|
1789
|
-
}) => {
|
|
1790
|
-
let t = Be["SegmentButton--Medium"];
|
|
1791
|
-
return e === "sm" ? t = Be["SegmentButton--Small"] : e === "lg" && (t = Be["SegmentButton--Large"]), /* @__PURE__ */ l(
|
|
1792
|
-
Ft,
|
|
1793
|
-
{
|
|
1794
|
-
className: t,
|
|
1795
|
-
size: e,
|
|
1796
|
-
radius: r,
|
|
1797
|
-
withItemsBorders: !1,
|
|
1798
|
-
...n
|
|
1799
|
-
}
|
|
1800
|
-
);
|
|
1801
|
-
}, Ao = "styles-module__Tab__TitleList___urHWH", No = "styles-module__Tab__BorderBottom___eMTpl", qe = {
|
|
1802
|
-
Tab__TitleList: Ao,
|
|
1803
|
-
Tab__BorderBottom: No
|
|
1804
|
-
}, za = ({ tabList: e = [], containerPaddingTop: r, ...n }) => /* @__PURE__ */ D(pe, { ...n, children: [
|
|
1805
|
-
/* @__PURE__ */ l(pe.List, { className: qe.Tab__TitleList, children: e?.map((t, o) => /* @__PURE__ */ D(pe.Tab, { value: t.value, leftSection: t.icon, children: [
|
|
1806
|
-
t.title,
|
|
1807
|
-
/* @__PURE__ */ l("div", { className: qe.Tab__BorderBottom })
|
|
1808
|
-
] }, `tab_${o}`)) }),
|
|
1809
|
-
e?.map((t, o) => /* @__PURE__ */ l(pe.Panel, { value: t.value, pt: r, children: t.body }, `tab_panel_${o}`))
|
|
1810
|
-
] }), Oo = "styles-module__TextField__Wrapper___u6p5Z", Fo = "styles-module__TextField__TextCounter___u1jM5", $o = "styles-module__TextField__Description___J-kXP", Ro = "styles-module__TextField__ErrorMsg___fa6f6", zo = "styles-module__TextField__ClearButton___bB5Ew", j = {
|
|
1811
|
-
"TextField--LeftLabel": "styles-module__TextField--LeftLabel___hiNn3",
|
|
1812
|
-
"TextField--TopLabel": "styles-module__TextField--TopLabel___V2otc",
|
|
1813
|
-
"TextField__Label--Small": "styles-module__TextField__Label--Small___NkKKA",
|
|
1814
|
-
"TextField__Label--Medium": "styles-module__TextField__Label--Medium___IoJd-",
|
|
1815
|
-
"TextField__Label--Large": "styles-module__TextField__Label--Large___GMy74",
|
|
1816
|
-
"TextField__Tooltip--Small": "styles-module__TextField__Tooltip--Small___GmQHE",
|
|
1817
|
-
"TextField__Tooltip--Medium": "styles-module__TextField__Tooltip--Medium___5P3nA",
|
|
1818
|
-
"TextField__Tooltip--Large": "styles-module__TextField__Tooltip--Large___YSCfu",
|
|
1819
|
-
TextField__Wrapper: Oo,
|
|
1820
|
-
TextField__TextCounter: Fo,
|
|
1821
|
-
"TextField--Textarea": "styles-module__TextField--Textarea___C2DL5",
|
|
1822
|
-
"TextField--Small": "styles-module__TextField--Small___iuH4t",
|
|
1823
|
-
"TextField--Medium": "styles-module__TextField--Medium___snYod",
|
|
1824
|
-
"TextField--Large": "styles-module__TextField--Large___JoSYk",
|
|
1825
|
-
TextField__Description: $o,
|
|
1826
|
-
TextField__ErrorMsg: Ro,
|
|
1827
|
-
TextField__ClearButton: zo
|
|
1828
|
-
}, Ho = (e) => typeof e == "string" ? e.length : typeof e == "number" ? String(e).length : Array.isArray(e) ? e.join("").length : 0, Ha = (e) => {
|
|
1829
|
-
const {
|
|
1830
|
-
label: r,
|
|
1831
|
-
labelPosition: n = "top",
|
|
1832
|
-
size: t = "md",
|
|
1833
|
-
required: o,
|
|
1834
|
-
tooltip: s,
|
|
1835
|
-
tooltipPosition: a = "top",
|
|
1836
|
-
errorMsg: i,
|
|
1837
|
-
description: c,
|
|
1838
|
-
textarea: m = !1,
|
|
1839
|
-
maxTextCount: p,
|
|
1840
|
-
onChange: _,
|
|
1841
|
-
onClear: d,
|
|
1842
|
-
...u
|
|
1843
|
-
} = e, f = "minRows" in e ? e.minRows : void 0, {
|
|
1844
|
-
value: h,
|
|
1845
|
-
defaultValue: g,
|
|
1846
|
-
...y
|
|
1847
|
-
} = u, x = h !== void 0, [k, N] = v(
|
|
1848
|
-
String(h ?? g ?? "")
|
|
1849
|
-
), $ = x ? h : k, Z = Ho($);
|
|
1850
|
-
let z = j["TextField__Label--Medium"], B = j["TextField--Medium"], b = j["TextField__Tooltip--Medium"];
|
|
1851
|
-
t === "sm" ? (z = j["TextField__Label--Small"], B = j["TextField--Small"], b = j["TextField__Tooltip--Small"]) : t === "lg" && (z = j["TextField__Label--Large"], B = j["TextField--Large"], b = j["TextField__Tooltip--Large"]);
|
|
1852
|
-
const C = W(
|
|
1853
|
-
(O) => {
|
|
1854
|
-
const P = O.currentTarget.value;
|
|
1855
|
-
p && P.length > p || (x || N(P), _ && _(O));
|
|
1856
|
-
},
|
|
1857
|
-
[x, p, _]
|
|
1858
|
-
), E = W(() => {
|
|
1859
|
-
x || N(""), d?.();
|
|
1860
|
-
}, [x, d]);
|
|
1861
|
-
return /* @__PURE__ */ D(
|
|
1862
|
-
"div",
|
|
1863
|
-
{
|
|
1864
|
-
className: n === "top" ? j["TextField--TopLabel"] : j["TextField--LeftLabel"],
|
|
1865
|
-
children: [
|
|
1866
|
-
/* @__PURE__ */ D("div", { children: [
|
|
1867
|
-
r && /* @__PURE__ */ l(X.Label, { required: o, className: z, children: r }),
|
|
1868
|
-
s && /* @__PURE__ */ l(xe, { label: s, position: a, children: /* @__PURE__ */ l("div", { className: b, children: /* @__PURE__ */ l(Fe, { size: t === "sm" ? 14 : t === "lg" ? 20 : 16 }) }) })
|
|
1869
|
-
] }),
|
|
1870
|
-
/* @__PURE__ */ D("div", { children: [
|
|
1871
|
-
/* @__PURE__ */ D("div", { className: j.TextField__Wrapper, children: [
|
|
1872
|
-
m ? /* @__PURE__ */ l(
|
|
1873
|
-
$t,
|
|
1874
|
-
{
|
|
1875
|
-
className: j["TextField--Textarea"],
|
|
1876
|
-
size: t,
|
|
1877
|
-
minRows: f,
|
|
1878
|
-
error: i,
|
|
1879
|
-
onChange: C,
|
|
1880
|
-
value: $,
|
|
1881
|
-
...y
|
|
1882
|
-
}
|
|
1883
|
-
) : /* @__PURE__ */ l(
|
|
1884
|
-
X,
|
|
1885
|
-
{
|
|
1886
|
-
className: B,
|
|
1887
|
-
error: i,
|
|
1888
|
-
onChange: C,
|
|
1889
|
-
value: $,
|
|
1890
|
-
rightSection: d && Z > 0 ? /* @__PURE__ */ l(
|
|
1891
|
-
"button",
|
|
1892
|
-
{
|
|
1893
|
-
type: "button",
|
|
1894
|
-
className: j.TextField__ClearButton,
|
|
1895
|
-
"aria-label": "입력 내용 지우기",
|
|
1896
|
-
onClick: E,
|
|
1897
|
-
children: /* @__PURE__ */ l(Pe, { size: t === "sm" ? 16 : t === "lg" ? 24 : 20 })
|
|
1898
|
-
}
|
|
1899
|
-
) : void 0,
|
|
1900
|
-
...y
|
|
1901
|
-
}
|
|
1902
|
-
),
|
|
1903
|
-
p && p > 0 && /* @__PURE__ */ l(
|
|
1904
|
-
"span",
|
|
1905
|
-
{
|
|
1906
|
-
className: j.TextField__TextCounter,
|
|
1907
|
-
children: `${Z}/${p}`
|
|
1908
|
-
}
|
|
1909
|
-
)
|
|
1910
|
-
] }),
|
|
1911
|
-
c && /* @__PURE__ */ l(X.Description, { className: j.TextField__Description, children: c }),
|
|
1912
|
-
i && /* @__PURE__ */ l(X.Error, { className: j.TextField__ErrorMsg, children: i })
|
|
1913
|
-
] })
|
|
1914
|
-
]
|
|
1915
|
-
}
|
|
1916
|
-
);
|
|
1917
|
-
}, Le = {
|
|
1918
|
-
"TimePicker--Small": "styles-module__TimePicker--Small___nHQa1",
|
|
1919
|
-
"TimePicker--Medium": "styles-module__TimePicker--Medium___E9-rF",
|
|
1920
|
-
"TimePicker--Large": "styles-module__TimePicker--Large___I0M7V"
|
|
1921
|
-
}, Ya = ({ size: e = "md", ...r }) => {
|
|
1922
|
-
const n = ie(null);
|
|
1923
|
-
let t = Le["TimePicker--Medium"], o = 18;
|
|
1924
|
-
return e === "sm" ? (t = Le["TimePicker--Small"], o = 14) : e === "lg" && (t = Le["TimePicker--Large"], o = 24), /* @__PURE__ */ l(
|
|
1925
|
-
jt,
|
|
1926
|
-
{
|
|
1927
|
-
ref: n,
|
|
1928
|
-
className: t,
|
|
1929
|
-
size: e,
|
|
1930
|
-
...r,
|
|
1931
|
-
rightSection: /* @__PURE__ */ l(
|
|
1932
|
-
Rt,
|
|
1933
|
-
{
|
|
1934
|
-
bg: "transparent",
|
|
1935
|
-
onClick: () => {
|
|
1936
|
-
n.current?.showPicker?.();
|
|
1937
|
-
},
|
|
1938
|
-
children: /* @__PURE__ */ l(ar, { size: o })
|
|
1939
|
-
}
|
|
1940
|
-
)
|
|
1941
|
-
}
|
|
1942
|
-
);
|
|
1943
|
-
}, Ee = {
|
|
1944
|
-
"Toggle--Small": "styles-module__Toggle--Small___sOjUd",
|
|
1945
|
-
"Toggle--Medium": "styles-module__Toggle--Medium___yIb8v",
|
|
1946
|
-
"Toggle--Large": "styles-module__Toggle--Large___ZOJj1"
|
|
1947
|
-
}, Wa = ({
|
|
1948
|
-
size: e = "md",
|
|
1949
|
-
labelPosition: r = "right",
|
|
1950
|
-
disabled: n,
|
|
1951
|
-
checked: t,
|
|
1952
|
-
defaultChecked: o,
|
|
1953
|
-
onChange: s,
|
|
1954
|
-
...a
|
|
1955
|
-
}) => {
|
|
1956
|
-
const i = t !== void 0, [c, m] = v(o ?? !1), p = i ? t : c;
|
|
1957
|
-
let _ = Ee["Toggle--Medium"], d = 50;
|
|
1958
|
-
e === "sm" ? (_ = Ee["Toggle--Small"], d = 38) : e === "lg" && (_ = Ee["Toggle--Large"], d = 67);
|
|
1959
|
-
const u = W(
|
|
1960
|
-
(f) => {
|
|
1961
|
-
s && s(f), i || m(f?.target?.checked);
|
|
1962
|
-
},
|
|
1963
|
-
[i, s]
|
|
1964
|
-
);
|
|
1965
|
-
return /* @__PURE__ */ l(
|
|
1966
|
-
zt,
|
|
1967
|
-
{
|
|
1968
|
-
className: _,
|
|
1969
|
-
size: e,
|
|
1970
|
-
labelPosition: r,
|
|
1971
|
-
disabled: n,
|
|
1972
|
-
checked: t,
|
|
1973
|
-
defaultChecked: o,
|
|
1974
|
-
onChange: u,
|
|
1975
|
-
styles: () => ({
|
|
1976
|
-
track: {
|
|
1977
|
-
backgroundColor: !n && p ? `${ge} !important` : void 0,
|
|
1978
|
-
borderColor: !n && p ? `${ge} !important` : void 0,
|
|
1979
|
-
width: d
|
|
1980
|
-
}
|
|
1981
|
-
}),
|
|
1982
|
-
...a
|
|
1983
|
-
}
|
|
1984
|
-
);
|
|
1985
|
-
}, Yo = "styles-module__Tooltip__Body___i1OTG", Wo = "styles-module__Tooltip__Title___E0LoV", Zo = "styles-module__Tooltip__Content___lU5gr", Ae = {
|
|
1986
|
-
Tooltip__Body: Yo,
|
|
1987
|
-
Tooltip__Title: Wo,
|
|
1988
|
-
Tooltip__Content: Zo
|
|
1989
|
-
}, Za = ({
|
|
1990
|
-
title: e,
|
|
1991
|
-
content: r,
|
|
1992
|
-
maw: n = 280,
|
|
1993
|
-
multiline: t = !0,
|
|
1994
|
-
...o
|
|
1995
|
-
}) => /* @__PURE__ */ l(
|
|
1996
|
-
xe,
|
|
1997
|
-
{
|
|
1998
|
-
...o,
|
|
1999
|
-
maw: n,
|
|
2000
|
-
multiline: t,
|
|
2001
|
-
label: /* @__PURE__ */ D("div", { className: Ae.Tooltip__Body, children: [
|
|
2002
|
-
e && /* @__PURE__ */ l("span", { className: Ae.Tooltip__Title, children: e }),
|
|
2003
|
-
/* @__PURE__ */ l("span", { className: Ae.Tooltip__Content, children: r })
|
|
2004
|
-
] })
|
|
2005
|
-
}
|
|
2006
|
-
), jo = (e) => {
|
|
2007
|
-
const { name: r, icon: n } = e;
|
|
2008
|
-
return `
|
|
2009
|
-
<div class="pin-marker">
|
|
2010
|
-
${n ? `<img src="${n}" alt="${r}" width="40" height="40" />` : `
|
|
2011
|
-
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2012
|
-
<g>
|
|
2013
|
-
<path d="M18.7686 1.26235C11.6407 0.936128 5.75293 6.62941 5.75293 13.6913C5.75293 22.565 11.76 30.0415 15.1594 33.4869C16.8117 35.1766 19.5261 35.1761 21.1779 33.4854C24.318 30.2845 29.8102 23.653 30.5636 15.5539L30.5637 15.5531C31.2237 8.38935 26.1199 1.59187 18.7686 1.26235ZM18.7686 1.26235L18.7229 2.26131L18.7676 1.2623C18.768 1.26232 18.7683 1.26234 18.7686 1.26235Z" fill="#FF6C6C" stroke="white" stroke-width="2" stroke-miterlimit="10"/>
|
|
2014
|
-
<path d="M18.4084 18.2387C20.8523 18.2387 22.8334 16.2575 22.8334 13.8137C22.8334 11.3698 20.8523 9.38867 18.4084 9.38867C15.9645 9.38867 13.9834 11.3698 13.9834 13.8137C13.9834 16.2575 15.9645 18.2387 18.4084 18.2387Z" fill="white"/>
|
|
2015
|
-
</g>
|
|
2016
|
-
</svg>
|
|
2017
|
-
`}
|
|
2018
|
-
<div class="pin-marker-name">${r}</div>
|
|
2019
|
-
</div>
|
|
2020
|
-
`;
|
|
2021
|
-
}, Uo = (e) => {
|
|
2022
|
-
const { discountRate: r, price: n, originalPrice: t, category: o, active: s, title: a } = e;
|
|
2023
|
-
return `
|
|
2024
|
-
<div class="popdeal-marker" active="${!!s}">
|
|
2025
|
-
<div class="popdeal-marker-section">
|
|
2026
|
-
<div class="popdeal-marker-section-header">
|
|
2027
|
-
<span class="popdeal-marker-title">${a}</span>
|
|
2028
|
-
${o ? `<span class="popdeal-marker-category">${o}</span>` : ""}
|
|
2029
|
-
</div>
|
|
2030
|
-
<div class="popdeal-marker-section-price">
|
|
2031
|
-
${t ? `<span class="popdeal-marker-original_price">${t.toLocaleString()}원</span>` : ""}
|
|
2032
|
-
${r ? `<span class="popdeal-marker-discount_rate">${r}%</span>` : ""}
|
|
2033
|
-
<span class="popdeal-marker-discounted_price">${n.toLocaleString()}원</span>
|
|
2034
|
-
</div>
|
|
2035
|
-
</div>
|
|
2036
|
-
</div>
|
|
2037
|
-
`;
|
|
2038
|
-
}, Vo = (e) => {
|
|
2039
|
-
const { title: r, icon: n } = e;
|
|
2040
|
-
return `
|
|
2041
|
-
<div class="pi-marker">
|
|
2042
|
-
${n ? `<img class="pi-marker-icon" src="${n}" alt="" width="32px" height="32px" />` : ""}
|
|
2043
|
-
<span class="pi-marker-text">${r}</span>
|
|
2044
|
-
</div>
|
|
2045
|
-
`;
|
|
2046
|
-
}, Go = (e) => {
|
|
2047
|
-
const { title: r, icon: n, address: t } = e;
|
|
2048
|
-
return `
|
|
2049
|
-
<div class="pi-expanded-marker">
|
|
2050
|
-
${n ? `<img class="pi-expanded-marker-icon" src="${n}" alt="" width="32px" height="32px" />` : ""}
|
|
2051
|
-
<div class="pi-expanded-marker-content">
|
|
2052
|
-
<div class="pi-expanded-marker-title">${r}</div>
|
|
2053
|
-
${t ? `<div class="pi-expanded-marker-address">${t}</div>` : ""}
|
|
2054
|
-
</div>
|
|
2055
|
-
</div>
|
|
2056
|
-
`;
|
|
2057
|
-
}, Ko = (e) => `
|
|
2058
|
-
<div class="cluster-marker">
|
|
2059
|
-
<span class="cluster-marker-text">${e.count}</span>
|
|
2060
|
-
</div>
|
|
2061
|
-
`, Xe = (e) => {
|
|
2062
|
-
switch (e.type) {
|
|
2063
|
-
case "pin":
|
|
2064
|
-
return jo(e);
|
|
2065
|
-
case "popdeal":
|
|
2066
|
-
return Uo(e);
|
|
2067
|
-
case "pi":
|
|
2068
|
-
return Vo(e);
|
|
2069
|
-
case "pi-expanded":
|
|
2070
|
-
return Go(e);
|
|
2071
|
-
case "cluster":
|
|
2072
|
-
return Ko(e);
|
|
2073
|
-
default:
|
|
2074
|
-
return "";
|
|
2075
|
-
}
|
|
2076
|
-
}, Jo = `
|
|
2077
|
-
/* Common marker styles */
|
|
2078
|
-
[class$="marker"] {
|
|
2079
|
-
user-select: none;
|
|
2080
|
-
}
|
|
2081
|
-
|
|
2082
|
-
/* Pin Marker */
|
|
2083
|
-
.pin-marker {
|
|
2084
|
-
position: relative;
|
|
2085
|
-
z-index: 10;
|
|
2086
|
-
transform: translate(-50%, -100%);
|
|
2087
|
-
display: flex;
|
|
2088
|
-
flex-direction: column;
|
|
2089
|
-
align-items: center;
|
|
2090
|
-
justify-content: center;
|
|
2091
|
-
gap: 8px;
|
|
2092
|
-
}
|
|
2093
|
-
|
|
2094
|
-
.pin-marker-name {
|
|
2095
|
-
min-width: max-content;
|
|
2096
|
-
color: #1A1A1A;
|
|
2097
|
-
text-align: center;
|
|
2098
|
-
font-weight: 700;
|
|
2099
|
-
font-size: 14px;
|
|
2100
|
-
line-height: 1.4;
|
|
2101
|
-
text-shadow:
|
|
2102
|
-
-2px -2px 0 white,
|
|
2103
|
-
2px -2px 0 white,
|
|
2104
|
-
-2px 2px 0 white,
|
|
2105
|
-
2px 2px 0 white;
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
/* Popdeal Marker */
|
|
2109
|
-
.popdeal-marker {
|
|
2110
|
-
transform: translate(-50%, -100%);
|
|
2111
|
-
padding: 10px 16px;
|
|
2112
|
-
width: fit-content;
|
|
2113
|
-
max-width: 210px;
|
|
2114
|
-
position: relative;
|
|
2115
|
-
display: flex;
|
|
2116
|
-
flex-direction: column;
|
|
2117
|
-
justify-content: center;
|
|
2118
|
-
align-items: center;
|
|
2119
|
-
gap: 4px;
|
|
2120
|
-
transition: border-color 0.2s ease-in-out;
|
|
2121
|
-
word-break: keep-all;
|
|
2122
|
-
background: white;
|
|
2123
|
-
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.12);
|
|
2124
|
-
border-radius: 12px;
|
|
2125
|
-
color: #3D3D3D;
|
|
2126
|
-
}
|
|
2127
|
-
|
|
2128
|
-
.popdeal-marker:hover {
|
|
2129
|
-
z-index: 10;
|
|
2130
|
-
filter: drop-shadow(0px 4px 12px rgba(0, 0, 0, 0.12));
|
|
2131
|
-
}
|
|
2132
|
-
|
|
2133
|
-
.popdeal-marker::after {
|
|
2134
|
-
content: "";
|
|
2135
|
-
display: block;
|
|
2136
|
-
width: 12px;
|
|
2137
|
-
height: 12px;
|
|
2138
|
-
position: absolute;
|
|
2139
|
-
bottom: -7px;
|
|
2140
|
-
left: 50%;
|
|
2141
|
-
right: 50%;
|
|
2142
|
-
background: white;
|
|
2143
|
-
transform: translate(-50%) rotate(45deg);
|
|
2144
|
-
}
|
|
2145
|
-
|
|
2146
|
-
.popdeal-marker[active="true"] {
|
|
2147
|
-
z-index: 10;
|
|
2148
|
-
border: 2px solid #00C4C4;
|
|
2149
|
-
}
|
|
2150
|
-
|
|
2151
|
-
.popdeal-marker[active="true"]::after {
|
|
2152
|
-
border-right: 2px solid #00C4C4;
|
|
2153
|
-
border-bottom: 2px solid #00C4C4;
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
|
-
.popdeal-marker[active="false"] {
|
|
2157
|
-
border: 1px solid #F5F5F5;
|
|
2158
|
-
}
|
|
2159
|
-
|
|
2160
|
-
.popdeal-marker[active="false"]::after {
|
|
2161
|
-
border-right: 1px solid #F5F5F5;
|
|
2162
|
-
border-bottom: 1px solid #F5F5F5;
|
|
2163
|
-
}
|
|
2164
|
-
|
|
2165
|
-
.popdeal-marker-section {
|
|
2166
|
-
display: flex;
|
|
2167
|
-
flex-direction: column;
|
|
2168
|
-
justify-content: center;
|
|
2169
|
-
align-items: center;
|
|
2170
|
-
gap: 0;
|
|
2171
|
-
flex-wrap: nowrap;
|
|
2172
|
-
}
|
|
2173
|
-
|
|
2174
|
-
.popdeal-marker-section-header {
|
|
2175
|
-
display: flex;
|
|
2176
|
-
justify-content: center;
|
|
2177
|
-
align-items: center;
|
|
2178
|
-
gap: 4px;
|
|
2179
|
-
flex-wrap: nowrap;
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
.popdeal-marker-section-price {
|
|
2183
|
-
display: flex;
|
|
2184
|
-
justify-content: center;
|
|
2185
|
-
align-items: center;
|
|
2186
|
-
gap: 0 4px;
|
|
2187
|
-
flex-wrap: wrap;
|
|
2188
|
-
}
|
|
2189
|
-
|
|
2190
|
-
.popdeal-marker-title {
|
|
2191
|
-
font-weight: 700;
|
|
2192
|
-
font-size: 14px;
|
|
2193
|
-
text-align: center;
|
|
2194
|
-
width: 100%;
|
|
2195
|
-
display: -webkit-box;
|
|
2196
|
-
-webkit-line-clamp: 2;
|
|
2197
|
-
-webkit-box-orient: vertical;
|
|
2198
|
-
overflow: hidden;
|
|
2199
|
-
}
|
|
2200
|
-
|
|
2201
|
-
.popdeal-marker-discount_rate {
|
|
2202
|
-
color: #00C4C4;
|
|
2203
|
-
font-weight: 600;
|
|
2204
|
-
font-size: 14px;
|
|
2205
|
-
}
|
|
2206
|
-
|
|
2207
|
-
.popdeal-marker-discounted_price {
|
|
2208
|
-
color: #3D3D3D;
|
|
2209
|
-
font-weight: 600;
|
|
2210
|
-
font-size: 14px;
|
|
2211
|
-
}
|
|
2212
|
-
|
|
2213
|
-
.popdeal-marker-original_price {
|
|
2214
|
-
width: 100%;
|
|
2215
|
-
color: #B3B3B3;
|
|
2216
|
-
text-align: center;
|
|
2217
|
-
font-size: 14px;
|
|
2218
|
-
text-decoration: line-through;
|
|
2219
|
-
}
|
|
2220
|
-
|
|
2221
|
-
.popdeal-marker-category {
|
|
2222
|
-
color: #6E6E6E;
|
|
2223
|
-
font-weight: 600;
|
|
2224
|
-
font-size: 12px;
|
|
2225
|
-
}
|
|
2226
|
-
|
|
2227
|
-
.popdeal-marker-category::before {
|
|
2228
|
-
content: "|";
|
|
2229
|
-
color: #B3B3B3;
|
|
2230
|
-
margin-right: 4px;
|
|
2231
|
-
}
|
|
2232
|
-
|
|
2233
|
-
/* PI Marker */
|
|
2234
|
-
.pi-marker {
|
|
2235
|
-
transform: translate(-50%, -50%);
|
|
2236
|
-
z-index: 10;
|
|
2237
|
-
position: relative;
|
|
2238
|
-
display: flex;
|
|
2239
|
-
flex-direction: column;
|
|
2240
|
-
align-items: center;
|
|
2241
|
-
justify-content: center;
|
|
2242
|
-
gap: 4px;
|
|
2243
|
-
}
|
|
2244
|
-
|
|
2245
|
-
.pi-marker-icon {
|
|
2246
|
-
width: 32px;
|
|
2247
|
-
height: 32px;
|
|
2248
|
-
object-fit: cover;
|
|
2249
|
-
border-radius: 50%;
|
|
2250
|
-
}
|
|
2251
|
-
|
|
2252
|
-
.pi-marker-text {
|
|
2253
|
-
position: absolute;
|
|
2254
|
-
top: calc(100% + 5px);
|
|
2255
|
-
left: 50%;
|
|
2256
|
-
transform: translateX(-50%);
|
|
2257
|
-
min-width: max-content;
|
|
2258
|
-
padding: 4px 8px;
|
|
2259
|
-
background: white;
|
|
2260
|
-
font-size: 12px;
|
|
2261
|
-
border-radius: 99px;
|
|
2262
|
-
color: #3D3D3D;
|
|
2263
|
-
box-shadow: 0 0.432px 0.864px 0 rgba(0, 0, 0, 0.28);
|
|
2264
|
-
}
|
|
2265
|
-
|
|
2266
|
-
/* PI Expanded Marker */
|
|
2267
|
-
.pi-expanded-marker {
|
|
2268
|
-
transform: translate(-50%, -50%);
|
|
2269
|
-
z-index: 100;
|
|
2270
|
-
position: relative;
|
|
2271
|
-
display: flex;
|
|
2272
|
-
flex-direction: column;
|
|
2273
|
-
align-items: center;
|
|
2274
|
-
justify-content: center;
|
|
2275
|
-
gap: 4px;
|
|
2276
|
-
filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.12));
|
|
2277
|
-
}
|
|
2278
|
-
|
|
2279
|
-
.pi-expanded-marker-icon {
|
|
2280
|
-
width: 32px;
|
|
2281
|
-
height: 32px;
|
|
2282
|
-
object-fit: cover;
|
|
2283
|
-
border-radius: 50%;
|
|
2284
|
-
}
|
|
2285
|
-
|
|
2286
|
-
.pi-expanded-marker-content {
|
|
2287
|
-
position: absolute;
|
|
2288
|
-
bottom: calc(100% + 10px);
|
|
2289
|
-
left: 50%;
|
|
2290
|
-
transform: translateX(-50%);
|
|
2291
|
-
width: max-content;
|
|
2292
|
-
max-width: 200px;
|
|
2293
|
-
padding: 16px;
|
|
2294
|
-
word-break: keep-all;
|
|
2295
|
-
display: flex;
|
|
2296
|
-
flex-direction: column;
|
|
2297
|
-
align-items: center;
|
|
2298
|
-
justify-content: center;
|
|
2299
|
-
background: white;
|
|
2300
|
-
border-radius: 8px;
|
|
2301
|
-
}
|
|
2302
|
-
|
|
2303
|
-
.pi-expanded-marker-title {
|
|
2304
|
-
font-weight: 600;
|
|
2305
|
-
font-size: 14px;
|
|
2306
|
-
text-align: center;
|
|
2307
|
-
color: #1A1A1A;
|
|
2308
|
-
}
|
|
2309
|
-
|
|
2310
|
-
.pi-expanded-marker-address {
|
|
2311
|
-
font-size: 14px;
|
|
2312
|
-
color: #6E6E6E;
|
|
2313
|
-
width: 100%;
|
|
2314
|
-
text-align: center;
|
|
2315
|
-
}
|
|
2316
|
-
|
|
2317
|
-
/* Cluster Marker */
|
|
2318
|
-
.cluster-marker {
|
|
2319
|
-
width: fit-content;
|
|
2320
|
-
min-width: 52px;
|
|
2321
|
-
height: 36px;
|
|
2322
|
-
padding: 13px;
|
|
2323
|
-
position: relative;
|
|
2324
|
-
display: flex;
|
|
2325
|
-
align-items: center;
|
|
2326
|
-
justify-content: center;
|
|
2327
|
-
border-radius: 12px;
|
|
2328
|
-
background: #00C4C4;
|
|
2329
|
-
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.12);
|
|
2330
|
-
transform: translate(-50%, -50%);
|
|
2331
|
-
}
|
|
2332
|
-
|
|
2333
|
-
.cluster-marker-text {
|
|
2334
|
-
font-weight: 700;
|
|
2335
|
-
font-size: 15px;
|
|
2336
|
-
color: white;
|
|
2337
|
-
}
|
|
2338
|
-
|
|
2339
|
-
.cluster-marker::after {
|
|
2340
|
-
content: "";
|
|
2341
|
-
display: block;
|
|
2342
|
-
width: 12px;
|
|
2343
|
-
height: 12px;
|
|
2344
|
-
position: absolute;
|
|
2345
|
-
bottom: -2px;
|
|
2346
|
-
left: 50%;
|
|
2347
|
-
right: 50%;
|
|
2348
|
-
background: #00C4C4;
|
|
2349
|
-
transform: translate(-50%) rotate(45deg);
|
|
2350
|
-
}
|
|
2351
|
-
`, bt = ze(null), Qe = "naver-map-script", qo = (e, r) => new Promise((n, t) => {
|
|
2352
|
-
if (typeof window < "u" && window.naver?.maps) {
|
|
2353
|
-
n();
|
|
2354
|
-
return;
|
|
2355
|
-
}
|
|
2356
|
-
const o = document.getElementById(Qe);
|
|
2357
|
-
if (o) {
|
|
2358
|
-
o.addEventListener("load", () => n()), o.addEventListener(
|
|
2359
|
-
"error",
|
|
2360
|
-
() => t(new Error("Failed to load Naver Map script"))
|
|
2361
|
-
);
|
|
2362
|
-
return;
|
|
2363
|
-
}
|
|
2364
|
-
const s = document.createElement("script");
|
|
2365
|
-
s.id = Qe, s.src = `https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=${e}&language=${r}`, s.async = !0, s.onload = () => {
|
|
2366
|
-
n();
|
|
2367
|
-
}, s.onerror = () => {
|
|
2368
|
-
t(new Error("Failed to load Naver Map script"));
|
|
2369
|
-
}, document.head.appendChild(s);
|
|
2370
|
-
}), Xo = ({
|
|
2371
|
-
clientId: e,
|
|
2372
|
-
language: r = "ko",
|
|
2373
|
-
children: n
|
|
2374
|
-
}) => {
|
|
2375
|
-
const [t, o] = v(null), [s, a] = v({}), [i, c] = v(null);
|
|
2376
|
-
Q(() => {
|
|
2377
|
-
typeof window > "u" || qo(e, r).then(() => {
|
|
2378
|
-
window.naver && o(window.naver);
|
|
2379
|
-
}).catch((p) => {
|
|
2380
|
-
console.error("Naver Map script loading failed:", p), c(p);
|
|
2381
|
-
});
|
|
2382
|
-
}, [e, r]);
|
|
2383
|
-
const m = W(
|
|
2384
|
-
(p, _) => {
|
|
2385
|
-
const d = t || (typeof window < "u" ? window.naver : null);
|
|
2386
|
-
if (!d || (!t && window.naver && o(window.naver), !p.current))
|
|
2387
|
-
return null;
|
|
2388
|
-
const u = p.current;
|
|
2389
|
-
if (!u.isConnected)
|
|
2390
|
-
return null;
|
|
2391
|
-
try {
|
|
2392
|
-
const f = {
|
|
2393
|
-
center: new d.maps.LatLng(37.5665, 126.978),
|
|
2394
|
-
// 서울 시청 기본 좌표
|
|
2395
|
-
zoom: 11,
|
|
2396
|
-
maxZoom: 20,
|
|
2397
|
-
minZoom: 11,
|
|
2398
|
-
mapTypeControl: !1,
|
|
2399
|
-
scaleControl: !1,
|
|
2400
|
-
logoControl: !1,
|
|
2401
|
-
mapDataControl: !1,
|
|
2402
|
-
zoomControl: !1,
|
|
2403
|
-
..._
|
|
2404
|
-
}, h = new d.maps.Map(u, f);
|
|
2405
|
-
return a((g) => {
|
|
2406
|
-
const y = u.getAttribute("id") || "default";
|
|
2407
|
-
return { ...g, [y]: h };
|
|
2408
|
-
}), h;
|
|
2409
|
-
} catch (f) {
|
|
2410
|
-
return console.error("Map creation error:", f), null;
|
|
2411
|
-
}
|
|
2412
|
-
},
|
|
2413
|
-
[t]
|
|
2414
|
-
);
|
|
2415
|
-
return i && console.error("NaverMapProvider error:", i), /* @__PURE__ */ l(bt.Provider, { value: { naver: t, createMap: m, maps: s }, children: n });
|
|
2416
|
-
}, Mt = () => {
|
|
2417
|
-
const e = He(bt);
|
|
2418
|
-
if (!e)
|
|
2419
|
-
throw new Error("useNaverMap must be used within NaverMapProvider");
|
|
2420
|
-
return e;
|
|
2421
|
-
};
|
|
2422
|
-
function Qo(e) {
|
|
2423
|
-
const r = function(t) {
|
|
2424
|
-
this.DEFAULT_OPTIONS = {
|
|
2425
|
-
map: null,
|
|
2426
|
-
markers: [],
|
|
2427
|
-
disableClickZoom: !0,
|
|
2428
|
-
minClusterSize: 2,
|
|
2429
|
-
maxZoom: 13,
|
|
2430
|
-
gridSize: 100,
|
|
2431
|
-
icons: [],
|
|
2432
|
-
indexGenerator: [10, 100, 200, 500, 1e3],
|
|
2433
|
-
averageCenter: !1,
|
|
2434
|
-
stylingFunction: function() {
|
|
2435
|
-
}
|
|
2436
|
-
}, this._clusters = [], this._mapRelations = null, this._markerRelations = [], this.setOptions(e.maps.Util.extend({}, this.DEFAULT_OPTIONS, t), !0), this.setMap(t.map || null);
|
|
2437
|
-
};
|
|
2438
|
-
e.maps.Util.ClassExtend(r, e.maps.OverlayView, {
|
|
2439
|
-
onAdd: function() {
|
|
2440
|
-
const t = this.getMap();
|
|
2441
|
-
this._mapRelations = e.maps.Event.addListener(
|
|
2442
|
-
t,
|
|
2443
|
-
"idle",
|
|
2444
|
-
e.maps.Util.bind(this._onIdle, this)
|
|
2445
|
-
), this.getMarkers().length > 0 && (this._createClusters(), this._updateClusters());
|
|
2446
|
-
},
|
|
2447
|
-
draw: e.maps.Util.noop,
|
|
2448
|
-
onRemove: function() {
|
|
2449
|
-
e.maps.Event.removeListener(this._mapRelation), this._clearClusters(), this._geoTree = null, this._mapRelation = null;
|
|
2450
|
-
},
|
|
2451
|
-
setOptions: function(t) {
|
|
2452
|
-
const o = this;
|
|
2453
|
-
if (typeof t == "string") {
|
|
2454
|
-
const s = t, a = arguments[1];
|
|
2455
|
-
o.set(s, a);
|
|
2456
|
-
} else {
|
|
2457
|
-
const s = arguments[1];
|
|
2458
|
-
e.maps.Util.forEach(t, function(a, i) {
|
|
2459
|
-
i !== "map" && o.set(i, a);
|
|
2460
|
-
}), t.map && !s && o.setMap(t.map);
|
|
2461
|
-
}
|
|
2462
|
-
},
|
|
2463
|
-
getOptions: function(t) {
|
|
2464
|
-
const o = this, s = {};
|
|
2465
|
-
return t !== void 0 ? o.get(t) : (e.maps.Util.forEach(o.DEFAULT_OPTIONS, function(a, i) {
|
|
2466
|
-
s[i] = o.get(i);
|
|
2467
|
-
}), s);
|
|
2468
|
-
},
|
|
2469
|
-
getMinClusterSize: function() {
|
|
2470
|
-
return this.getOptions("minClusterSize");
|
|
2471
|
-
},
|
|
2472
|
-
setMinClusterSize: function(t) {
|
|
2473
|
-
this.setOptions("minClusterSize", t);
|
|
2474
|
-
},
|
|
2475
|
-
getMaxZoom: function() {
|
|
2476
|
-
return this.getOptions("maxZoom");
|
|
2477
|
-
},
|
|
2478
|
-
setMaxZoom: function(t) {
|
|
2479
|
-
this.setOptions("maxZoom", t);
|
|
2480
|
-
},
|
|
2481
|
-
getGridSize: function() {
|
|
2482
|
-
return this.getOptions("gridSize");
|
|
2483
|
-
},
|
|
2484
|
-
setGridSize: function(t) {
|
|
2485
|
-
this.setOptions("gridSize", t);
|
|
2486
|
-
},
|
|
2487
|
-
getIndexGenerator: function() {
|
|
2488
|
-
return this.getOptions("indexGenerator");
|
|
2489
|
-
},
|
|
2490
|
-
setIndexGenerator: function(t) {
|
|
2491
|
-
this.setOptions("indexGenerator", t);
|
|
2492
|
-
},
|
|
2493
|
-
getMarkers: function() {
|
|
2494
|
-
return this.getOptions("markers");
|
|
2495
|
-
},
|
|
2496
|
-
setMarkers: function(t) {
|
|
2497
|
-
this.setOptions("markers", t);
|
|
2498
|
-
},
|
|
2499
|
-
getIcons: function() {
|
|
2500
|
-
return this.getOptions("icons");
|
|
2501
|
-
},
|
|
2502
|
-
setIcons: function(t) {
|
|
2503
|
-
this.setOptions("icons", t);
|
|
2504
|
-
},
|
|
2505
|
-
getStylingFunction: function() {
|
|
2506
|
-
return this.getOptions("stylingFunction");
|
|
2507
|
-
},
|
|
2508
|
-
setStylingFunction: function(t) {
|
|
2509
|
-
this.setOptions("stylingFunction", t);
|
|
2510
|
-
},
|
|
2511
|
-
getDisableClickZoom: function() {
|
|
2512
|
-
return this.getOptions("disableClickZoom");
|
|
2513
|
-
},
|
|
2514
|
-
setDisableClickZoom: function(t) {
|
|
2515
|
-
this.setOptions("disableClickZoom", t);
|
|
2516
|
-
},
|
|
2517
|
-
getAverageCenter: function() {
|
|
2518
|
-
return this.getOptions("averageCenter");
|
|
2519
|
-
},
|
|
2520
|
-
setAverageCenter: function(t) {
|
|
2521
|
-
this.setOptions("averageCenter", t);
|
|
2522
|
-
},
|
|
2523
|
-
changed: function(t, o) {
|
|
2524
|
-
if (this.getMap())
|
|
2525
|
-
switch (t) {
|
|
2526
|
-
case "marker":
|
|
2527
|
-
case "minClusterSize":
|
|
2528
|
-
case "gridSize":
|
|
2529
|
-
case "averageCenter":
|
|
2530
|
-
this._redraw();
|
|
2531
|
-
break;
|
|
2532
|
-
case "indexGenerator":
|
|
2533
|
-
case "icons":
|
|
2534
|
-
this._clusters.forEach(function(a) {
|
|
2535
|
-
a.updateIcon();
|
|
2536
|
-
});
|
|
2537
|
-
break;
|
|
2538
|
-
case "maxZoom":
|
|
2539
|
-
this._clusters.forEach(function(a) {
|
|
2540
|
-
a.getCount() > 1 && a.checkByZoomAndMinClusterSize();
|
|
2541
|
-
});
|
|
2542
|
-
break;
|
|
2543
|
-
case "stylingFunction":
|
|
2544
|
-
this._clusters.forEach(function(a) {
|
|
2545
|
-
a.updateCount();
|
|
2546
|
-
});
|
|
2547
|
-
break;
|
|
2548
|
-
case "disableClickZoom":
|
|
2549
|
-
let s = "enableClickZoom";
|
|
2550
|
-
o && (s = "disableClickZoom"), this._clusters.forEach(function(a) {
|
|
2551
|
-
a[s]();
|
|
2552
|
-
});
|
|
2553
|
-
break;
|
|
2554
|
-
}
|
|
2555
|
-
},
|
|
2556
|
-
_createClusters: function() {
|
|
2557
|
-
const t = this.getMap();
|
|
2558
|
-
if (!t) return;
|
|
2559
|
-
const o = t.getBounds(), s = this.getMarkers();
|
|
2560
|
-
for (let a = 0, i = s.length; a < i; a++) {
|
|
2561
|
-
const c = s[a], m = c.getPosition();
|
|
2562
|
-
if (!o.hasLatLng(m)) continue;
|
|
2563
|
-
this._getClosestCluster(m).addMarker(c), this._markerRelations.push(
|
|
2564
|
-
e.maps.Event.addListener(
|
|
2565
|
-
c,
|
|
2566
|
-
"dragend",
|
|
2567
|
-
e.maps.Util.bind(this._onDragEnd, this)
|
|
2568
|
-
)
|
|
2569
|
-
);
|
|
2570
|
-
}
|
|
2571
|
-
},
|
|
2572
|
-
_updateClusters: function() {
|
|
2573
|
-
const t = this._clusters;
|
|
2574
|
-
for (let o = 0, s = t.length; o < s; o++)
|
|
2575
|
-
t[o].updateCluster();
|
|
2576
|
-
},
|
|
2577
|
-
_clearClusters: function() {
|
|
2578
|
-
const t = this._clusters;
|
|
2579
|
-
for (let o = 0, s = t.length; o < s; o++)
|
|
2580
|
-
t[o].destroy();
|
|
2581
|
-
e.maps.Event.removeListener(this._markerRelations), this._markerRelations = [], this._clusters = [];
|
|
2582
|
-
},
|
|
2583
|
-
_redraw: function() {
|
|
2584
|
-
this._clearClusters(), this._createClusters(), this._updateClusters();
|
|
2585
|
-
},
|
|
2586
|
-
_getClosestCluster: function(t) {
|
|
2587
|
-
const o = this.getProjection(), s = this._clusters;
|
|
2588
|
-
let a = null, i = 1 / 0;
|
|
2589
|
-
for (let c = 0, m = s.length; c < m; c++) {
|
|
2590
|
-
const p = s[c], _ = p.getCenter();
|
|
2591
|
-
if (p.isInBounds(t)) {
|
|
2592
|
-
const d = o.getDistance(_, t);
|
|
2593
|
-
d < i && (i = d, a = p);
|
|
2594
|
-
}
|
|
2595
|
-
}
|
|
2596
|
-
return a || (a = new n(this), this._clusters.push(a)), a;
|
|
2597
|
-
},
|
|
2598
|
-
_onIdle: function() {
|
|
2599
|
-
this._redraw();
|
|
2600
|
-
},
|
|
2601
|
-
_onDragEnd: function() {
|
|
2602
|
-
this._redraw();
|
|
2603
|
-
}
|
|
2604
|
-
});
|
|
2605
|
-
const n = function(t) {
|
|
2606
|
-
this._clusterCenter = null, this._clusterBounds = null, this._clusterMarker = null, this._relation = null, this._clusterMember = [], this._markerClusters = t;
|
|
2607
|
-
};
|
|
2608
|
-
return n.prototype = {
|
|
2609
|
-
constructor: n,
|
|
2610
|
-
addMarker: function(t) {
|
|
2611
|
-
if (!this._isMember(t)) {
|
|
2612
|
-
if (!this._clusterCenter) {
|
|
2613
|
-
const o = t.getPosition();
|
|
2614
|
-
this._clusterCenter = o, this._clusterBounds = this._calcBounds(o);
|
|
2615
|
-
}
|
|
2616
|
-
this._clusterMember.push(t);
|
|
2617
|
-
}
|
|
2618
|
-
},
|
|
2619
|
-
destroy: function() {
|
|
2620
|
-
e.maps.Event.removeListener(this._relation);
|
|
2621
|
-
const t = this._clusterMember;
|
|
2622
|
-
for (let o = 0, s = t.length; o < s; o++)
|
|
2623
|
-
t[o].setMap(null);
|
|
2624
|
-
this._clusterMarker.setMap(null), this._clusterMarker = null, this._clusterCenter = null, this._clusterBounds = null, this._relation = null, this._clusterMember = [];
|
|
2625
|
-
},
|
|
2626
|
-
getCenter: function() {
|
|
2627
|
-
return this._clusterCenter;
|
|
2628
|
-
},
|
|
2629
|
-
getBounds: function() {
|
|
2630
|
-
return this._clusterBounds;
|
|
2631
|
-
},
|
|
2632
|
-
getCount: function() {
|
|
2633
|
-
return this._clusterMember.length;
|
|
2634
|
-
},
|
|
2635
|
-
getClusterMember: function() {
|
|
2636
|
-
return this._clusterMember;
|
|
2637
|
-
},
|
|
2638
|
-
isInBounds: function(t) {
|
|
2639
|
-
return this._clusterBounds && this._clusterBounds.hasLatLng(t);
|
|
2640
|
-
},
|
|
2641
|
-
enableClickZoom: function() {
|
|
2642
|
-
if (this._relation) return;
|
|
2643
|
-
const t = this._markerClusters.getMap();
|
|
2644
|
-
this._relation = e.maps.Event.addListener(
|
|
2645
|
-
this._clusterMarker,
|
|
2646
|
-
"click",
|
|
2647
|
-
e.maps.Util.bind(function(o) {
|
|
2648
|
-
t.morph(o.coord, t.getZoom() + 1);
|
|
2649
|
-
}, this)
|
|
2650
|
-
);
|
|
2651
|
-
},
|
|
2652
|
-
disableClickZoom: function() {
|
|
2653
|
-
this._relation && (e.maps.Event.removeListener(this._relation), this._relation = null);
|
|
2654
|
-
},
|
|
2655
|
-
updateCluster: function() {
|
|
2656
|
-
if (!this._clusterMarker) {
|
|
2657
|
-
let t;
|
|
2658
|
-
this._markerClusters.getAverageCenter() ? t = this._calcAverageCenter(this._clusterMember) : t = this._clusterCenter, this._clusterMarker = new e.maps.Marker({
|
|
2659
|
-
position: t,
|
|
2660
|
-
map: this._markerClusters.getMap()
|
|
2661
|
-
}), this._markerClusters.getDisableClickZoom() || this.enableClickZoom();
|
|
2662
|
-
}
|
|
2663
|
-
this.updateIcon(), this.updateCount(), this.checkByZoomAndMinClusterSize();
|
|
2664
|
-
},
|
|
2665
|
-
checkByZoomAndMinClusterSize: function() {
|
|
2666
|
-
const t = this._markerClusters, o = t.getMinClusterSize(), s = t.getMaxZoom(), a = t.getMap().getZoom();
|
|
2667
|
-
this.getCount() < o ? this._showMember() : (this._hideMember(), s <= a && this._showMember());
|
|
2668
|
-
},
|
|
2669
|
-
updateCount: function() {
|
|
2670
|
-
const t = this._markerClusters.getStylingFunction();
|
|
2671
|
-
t && t(this._clusterMarker, this.getCount());
|
|
2672
|
-
},
|
|
2673
|
-
updateIcon: function() {
|
|
2674
|
-
const t = this.getCount();
|
|
2675
|
-
let o = this._getIndex(t);
|
|
2676
|
-
const s = this._markerClusters.getIcons();
|
|
2677
|
-
o = Math.max(o, 0), o = Math.min(o, s.length - 1), this._clusterMarker.setIcon(s[o]);
|
|
2678
|
-
},
|
|
2679
|
-
_showMember: function() {
|
|
2680
|
-
const t = this._markerClusters.getMap(), o = this._clusterMarker, s = this._clusterMember;
|
|
2681
|
-
for (let a = 0, i = s.length; a < i; a++)
|
|
2682
|
-
s[a].setMap(t);
|
|
2683
|
-
o && o.setMap(null);
|
|
2684
|
-
},
|
|
2685
|
-
_hideMember: function() {
|
|
2686
|
-
const t = this._markerClusters.getMap(), o = this._clusterMarker, s = this._clusterMember;
|
|
2687
|
-
for (let a = 0, i = s.length; a < i; a++)
|
|
2688
|
-
s[a].setMap(null);
|
|
2689
|
-
o && !o.getMap() && o.setMap(t);
|
|
2690
|
-
},
|
|
2691
|
-
_calcBounds: function(t) {
|
|
2692
|
-
const o = this._markerClusters.getMap(), s = new e.maps.LatLngBounds(t.clone(), t.clone()), a = o.getBounds(), i = o.getProjection(), c = i.fromCoordToOffset(a.getNE()), m = i.fromCoordToOffset(a.getSW()), p = i.fromCoordToOffset(s.getNE()), _ = i.fromCoordToOffset(s.getSW()), d = this._markerClusters.getGridSize() / 2;
|
|
2693
|
-
p.add(d, -d), _.add(-d, d);
|
|
2694
|
-
const u = Math.min(c.x, p.x), f = Math.max(c.y, p.y), h = Math.max(m.x, _.x), g = Math.min(m.y, _.y), y = i.fromOffsetToCoord(new e.maps.Point(u, f)), x = i.fromOffsetToCoord(new e.maps.Point(h, g));
|
|
2695
|
-
return new e.maps.LatLngBounds(x, y);
|
|
2696
|
-
},
|
|
2697
|
-
_getIndex: function(t) {
|
|
2698
|
-
const o = this._markerClusters.getIndexGenerator();
|
|
2699
|
-
if (e.maps.Util.isFunction(o))
|
|
2700
|
-
return o(t);
|
|
2701
|
-
if (e.maps.Util.isArray(o)) {
|
|
2702
|
-
let s = 0;
|
|
2703
|
-
for (let a = 0, i = o.length; a < i; a++) {
|
|
2704
|
-
const c = o[a];
|
|
2705
|
-
if (t < c) break;
|
|
2706
|
-
s++;
|
|
2707
|
-
}
|
|
2708
|
-
return s;
|
|
2709
|
-
}
|
|
2710
|
-
return 0;
|
|
2711
|
-
},
|
|
2712
|
-
_isMember: function(t) {
|
|
2713
|
-
return this._clusterMember.indexOf(t) !== -1;
|
|
2714
|
-
},
|
|
2715
|
-
_calcAverageCenter: function(t) {
|
|
2716
|
-
const o = t.length, s = [0, 0];
|
|
2717
|
-
for (let a = 0; a < o; a++)
|
|
2718
|
-
s[0] += t[a].position.x, s[1] += t[a].position.y;
|
|
2719
|
-
return s[0] /= o, s[1] /= o, new e.maps.Point(s[0], s[1]);
|
|
2720
|
-
}
|
|
2721
|
-
}, r;
|
|
2722
|
-
}
|
|
2723
|
-
const ea = (e) => {
|
|
2724
|
-
const { naver: r } = Mt(), [n, t] = v([]), o = ie(
|
|
2725
|
-
/* @__PURE__ */ new Map()
|
|
2726
|
-
), s = ie(null), a = W(
|
|
2727
|
-
(_) => {
|
|
2728
|
-
if (!e || !r) return null;
|
|
2729
|
-
const d = Xe(_), u = new r.maps.Marker({
|
|
2730
|
-
..._,
|
|
2731
|
-
position: new r.maps.LatLng(_.position.latitude, _.position.longitude),
|
|
2732
|
-
map: e,
|
|
2733
|
-
icon: {
|
|
2734
|
-
content: d
|
|
2735
|
-
}
|
|
2736
|
-
});
|
|
2737
|
-
return _.onClick && r.maps.Event.addListener(u, "click", () => {
|
|
2738
|
-
_.onClick(_.id);
|
|
2739
|
-
}), t((f) => [...f, u]), o.current.set(_.id, { marker: u, data: _ }), u;
|
|
2740
|
-
},
|
|
2741
|
-
[e, r]
|
|
2742
|
-
), i = W(
|
|
2743
|
-
(_, d) => {
|
|
2744
|
-
const u = o.current.get(_);
|
|
2745
|
-
if (!u || !r)
|
|
2746
|
-
return;
|
|
2747
|
-
const { marker: f, data: h } = u, g = { ...h, ...d }, y = f.getElement();
|
|
2748
|
-
if (y) {
|
|
2749
|
-
const x = y.querySelector(".popdeal-marker");
|
|
2750
|
-
x && "active" in d && x.setAttribute("active", String(!!d.active));
|
|
2751
|
-
}
|
|
2752
|
-
o.current.set(_, { marker: f, data: g });
|
|
2753
|
-
},
|
|
2754
|
-
[r]
|
|
2755
|
-
), c = W(() => {
|
|
2756
|
-
n.forEach((_) => {
|
|
2757
|
-
_ && _.setMap(null);
|
|
2758
|
-
}), t([]), o.current.clear(), s.current && (s.current.setMap(null), s.current = null);
|
|
2759
|
-
}, [n]), m = W(
|
|
2760
|
-
(_) => {
|
|
2761
|
-
!e || !r || e.panTo(new r.maps.LatLng(_.latitude, _.longitude));
|
|
2762
|
-
},
|
|
2763
|
-
[e, r]
|
|
2764
|
-
), p = W(
|
|
2765
|
-
(_) => {
|
|
2766
|
-
if (!e || !r || _.length === 0) return;
|
|
2767
|
-
const d = new r.maps.LatLngBounds(
|
|
2768
|
-
new r.maps.LatLng(_[0].latitude, _[0].longitude),
|
|
2769
|
-
new r.maps.LatLng(_[0].latitude, _[0].longitude)
|
|
2770
|
-
);
|
|
2771
|
-
_.forEach((u) => {
|
|
2772
|
-
d.extend(new r.maps.LatLng(u.latitude, u.longitude));
|
|
2773
|
-
}), e.fitBounds(d);
|
|
2774
|
-
},
|
|
2775
|
-
[e, r]
|
|
2776
|
-
);
|
|
2777
|
-
return Q(() => {
|
|
2778
|
-
if (!r || !e || n.length === 0) return;
|
|
2779
|
-
const _ = Qo(r), u = {
|
|
2780
|
-
content: Xe({
|
|
2781
|
-
type: "cluster",
|
|
2782
|
-
count: 0
|
|
2783
|
-
}),
|
|
2784
|
-
size: new r.maps.Size(96, 96),
|
|
2785
|
-
anchor: new r.maps.Point(20, 20)
|
|
2786
|
-
}, f = new _({
|
|
2787
|
-
minClusterSize: 2,
|
|
2788
|
-
maxZoom: 17,
|
|
2789
|
-
map: e,
|
|
2790
|
-
markers: n,
|
|
2791
|
-
disableClickZoom: !1,
|
|
2792
|
-
gridSize: 120,
|
|
2793
|
-
icons: [u],
|
|
2794
|
-
indexGenerator: [10, 100, 200, 500, 1e3],
|
|
2795
|
-
averageCenter: !1,
|
|
2796
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2797
|
-
// @ts-ignore
|
|
2798
|
-
stylingFunction: (h, g) => {
|
|
2799
|
-
if (h && typeof h.getElement == "function") {
|
|
2800
|
-
const y = h.getElement().querySelector(".cluster-marker-text");
|
|
2801
|
-
y && (y.textContent = String(g));
|
|
2802
|
-
}
|
|
2803
|
-
}
|
|
2804
|
-
});
|
|
2805
|
-
return s.current = f, () => {
|
|
2806
|
-
f.setMap(null);
|
|
2807
|
-
};
|
|
2808
|
-
}, [r, e, n]), { addMarker: a, updateMarker: i, clearMarkers: c, panTo: m, fitBounds: p };
|
|
2809
|
-
}, St = ({ options: e, onLoad: r }) => {
|
|
2810
|
-
const n = ie(null), t = ie(null), { createMap: o } = Mt(), [s, a] = v(null), i = ea(s), { width: c = "100%", height: m = "100%", ...p } = e || {}, _ = Re(() => p, [JSON.stringify(p)]);
|
|
2811
|
-
return Q(() => {
|
|
2812
|
-
if (typeof document > "u" || document.getElementById("pop-ui-map-marker-styles")) return;
|
|
2813
|
-
const u = document.createElement("style");
|
|
2814
|
-
return u.id = "pop-ui-map-marker-styles", u.textContent = Jo, document.head.appendChild(u), t.current = u, () => {
|
|
2815
|
-
};
|
|
2816
|
-
}, []), Q(() => {
|
|
2817
|
-
let d = null, u = null;
|
|
2818
|
-
if (s && (s.destroy(), a(null)), n.current && n.current.isConnected) {
|
|
2819
|
-
const f = () => n.current && n.current.isConnected && (d = o(n, _), d) ? (a(d), !0) : !1;
|
|
2820
|
-
if (!f()) {
|
|
2821
|
-
let h = 0;
|
|
2822
|
-
const g = 50;
|
|
2823
|
-
u = setInterval(() => {
|
|
2824
|
-
h++, (f() || h >= g) && u && (clearInterval(u), u = null);
|
|
2825
|
-
}, 100);
|
|
2826
|
-
}
|
|
2827
|
-
return () => {
|
|
2828
|
-
u && clearInterval(u), d && (d.destroy(), d = null);
|
|
2829
|
-
};
|
|
2830
|
-
}
|
|
2831
|
-
return () => {
|
|
2832
|
-
u && clearInterval(u), d && (d.destroy(), d = null);
|
|
2833
|
-
};
|
|
2834
|
-
}, [o, _]), Q(() => {
|
|
2835
|
-
s && r && r({ map: s, ...i });
|
|
2836
|
-
}, [s, r, i]), /* @__PURE__ */ l(
|
|
2837
|
-
"div",
|
|
2838
|
-
{
|
|
2839
|
-
ref: n,
|
|
2840
|
-
style: {
|
|
2841
|
-
width: typeof c == "number" ? `${c}px` : c,
|
|
2842
|
-
height: typeof m == "number" ? `${m}px` : m
|
|
2843
|
-
}
|
|
2844
|
-
}
|
|
2845
|
-
);
|
|
2846
|
-
};
|
|
2847
|
-
St.displayName = "Map";
|
|
2848
|
-
const ta = "위치 정보를 불러오는 데 실패했어요.", ra = "위치 서비스 권한과 네트워크 상태를 확인해주세요.", ja = ({
|
|
2849
|
-
isActive: e = !1,
|
|
2850
|
-
errorMessage: r = ta,
|
|
2851
|
-
errorDescription: n = ra
|
|
2852
|
-
}) => {
|
|
2853
|
-
const [t, o] = v(!1), [s, a] = v(!1), [i, c] = v(null), m = ie(!1);
|
|
2854
|
-
return Q(() => {
|
|
2855
|
-
if (e && typeof navigator < "u" && "geolocation" in navigator) {
|
|
2856
|
-
if (m.current) return;
|
|
2857
|
-
m.current = !0, requestAnimationFrame(() => {
|
|
2858
|
-
o(!0);
|
|
2859
|
-
});
|
|
2860
|
-
const p = {
|
|
2861
|
-
enableHighAccuracy: !0,
|
|
2862
|
-
timeout: 1e4,
|
|
2863
|
-
maximumAge: 0
|
|
2864
|
-
};
|
|
2865
|
-
navigator.geolocation.getCurrentPosition(
|
|
2866
|
-
(_) => {
|
|
2867
|
-
c({
|
|
2868
|
-
latitude: _.coords.latitude,
|
|
2869
|
-
longitude: _.coords.longitude
|
|
2870
|
-
}), o(!1), a(!1), m.current = !1;
|
|
2871
|
-
},
|
|
2872
|
-
(_) => {
|
|
2873
|
-
c(null), console.error("Geolocation error:", _), ce({
|
|
2874
|
-
message: `${r} ${n}`
|
|
2875
|
-
}), o(!1), a(!0), m.current = !1;
|
|
2876
|
-
},
|
|
2877
|
-
p
|
|
2878
|
-
);
|
|
2879
|
-
}
|
|
2880
|
-
}, [e, r, n]), { position: i, isLoading: t, isError: s };
|
|
2881
|
-
}, et = (e = "light") => {
|
|
2882
|
-
const r = [];
|
|
2883
|
-
return Object.entries(st).forEach(([n, t]) => {
|
|
2884
|
-
Object.entries(t).forEach(([o, s]) => {
|
|
2885
|
-
const a = sr(n, o);
|
|
2886
|
-
r.push(`${a}: ${s};`);
|
|
2887
|
-
});
|
|
2888
|
-
}), r.join(`
|
|
2889
|
-
`);
|
|
2890
|
-
}, na = (e = "light") => {
|
|
2891
|
-
const r = document.getElementById("pop-ui-theme-vars");
|
|
2892
|
-
r && r.remove();
|
|
2893
|
-
const n = document.createElement("style");
|
|
2894
|
-
n.id = "pop-ui-theme-vars", n.textContent = `
|
|
2895
|
-
:root {
|
|
2896
|
-
${et("light")}
|
|
2897
|
-
}
|
|
2898
|
-
|
|
2899
|
-
[data-theme="dark"] {
|
|
2900
|
-
${et("dark")}
|
|
2901
|
-
}
|
|
2902
|
-
`, document.head.appendChild(n);
|
|
2903
|
-
}, ae = (e) => {
|
|
2904
|
-
const r = st[e], n = Object.keys(r).sort((o, s) => Number(o) - Number(s));
|
|
2905
|
-
return [
|
|
2906
|
-
ne(e, n[0] || n[n.length - 1]),
|
|
2907
|
-
ne(e, n[1] || n[n.length - 1]),
|
|
2908
|
-
ne(e, n[2] || n[n.length - 1]),
|
|
2909
|
-
ne(e, n[3] || n[n.length - 1]),
|
|
2910
|
-
ne(e, n[4] || n[n.length - 1]),
|
|
2911
|
-
ne(e, n[5] || n[n.length - 1]),
|
|
2912
|
-
ne(e, n[6] || n[n.length - 1]),
|
|
2913
|
-
ne(e, n[7] || n[n.length - 1]),
|
|
2914
|
-
ne(e, n[8] || n[n.length - 1]),
|
|
2915
|
-
ne(e, n[9] || n[n.length - 1])
|
|
2916
|
-
];
|
|
2917
|
-
}, oa = Ht({
|
|
2918
|
-
colors: {
|
|
2919
|
-
gray: ae("gray"),
|
|
2920
|
-
aqua: ae("aqua"),
|
|
2921
|
-
red: ae("red"),
|
|
2922
|
-
orange: ae("orange"),
|
|
2923
|
-
yellow: ae("yellow"),
|
|
2924
|
-
green: ae("green"),
|
|
2925
|
-
blue: ae("blue"),
|
|
2926
|
-
purple: ae("purple"),
|
|
2927
|
-
grape: ae("grape")
|
|
2928
|
-
},
|
|
2929
|
-
primaryColor: "aqua",
|
|
2930
|
-
primaryShade: 5,
|
|
2931
|
-
fontFamily: 'Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'
|
|
2932
|
-
}), Tt = ze(void 0), wt = ze({}), Ua = ({
|
|
2933
|
-
children: e,
|
|
2934
|
-
defaultTheme: r = "light",
|
|
2935
|
-
naverClientId: n,
|
|
2936
|
-
notificationPosition: t = "bottom-center",
|
|
2937
|
-
notificationLimit: o = 5,
|
|
2938
|
-
notificationAutoClose: s,
|
|
2939
|
-
notificationZIndex: a
|
|
2940
|
-
}) => {
|
|
2941
|
-
const [i, c] = v(r);
|
|
2942
|
-
Q(() => {
|
|
2943
|
-
na(i), document.documentElement.setAttribute("data-theme", i);
|
|
2944
|
-
}, [i]);
|
|
2945
|
-
const m = () => {
|
|
2946
|
-
c((p) => p === "light" ? "dark" : "light");
|
|
2947
|
-
};
|
|
2948
|
-
return /* @__PURE__ */ l(Tt.Provider, { value: { theme: i, setTheme: c, toggleTheme: m }, children: /* @__PURE__ */ l(wt.Provider, { value: { naverClientId: n }, children: /* @__PURE__ */ D(Yt, { theme: oa, children: [
|
|
2949
|
-
/* @__PURE__ */ l(
|
|
2950
|
-
yr,
|
|
2951
|
-
{
|
|
2952
|
-
position: t,
|
|
2953
|
-
limit: o,
|
|
2954
|
-
autoClose: s,
|
|
2955
|
-
zIndex: a
|
|
2956
|
-
}
|
|
2957
|
-
),
|
|
2958
|
-
e
|
|
2959
|
-
] }) }) });
|
|
2960
|
-
}, Va = () => {
|
|
2961
|
-
const e = He(Tt);
|
|
2962
|
-
if (!e)
|
|
2963
|
-
throw new Error("useTheme must be used within ThemeProvider");
|
|
2964
|
-
return e;
|
|
2965
|
-
}, aa = () => He(wt), sa = "styles-module__MapInfo___scB-5", ia = "styles-module__MapInfo__NoClientId___YBM4o", la = "styles-module__MapInfo__Preview___FJbQN", ca = "styles-module__MapInfo__ExpandButton___8KySg", _a = "styles-module__MapInfo__AddressBar___mKkK6", da = "styles-module__MapInfo__AddressContent___XG1Uz", ua = "styles-module__MapInfo__Address___iXO6N", ma = "styles-module__MapInfo__DirectionLink___eGnf-", pa = "styles-module__MapInfo__DirectionButton___gTWpj", oe = {
|
|
2966
|
-
MapInfo: sa,
|
|
2967
|
-
MapInfo__NoClientId: ia,
|
|
2968
|
-
MapInfo__Preview: la,
|
|
2969
|
-
MapInfo__ExpandButton: ca,
|
|
2970
|
-
MapInfo__AddressBar: _a,
|
|
2971
|
-
MapInfo__AddressContent: da,
|
|
2972
|
-
MapInfo__Address: ua,
|
|
2973
|
-
MapInfo__DirectionLink: ma,
|
|
2974
|
-
MapInfo__DirectionButton: pa
|
|
2975
|
-
}, fa = 60, Ga = ({
|
|
2976
|
-
location: e,
|
|
2977
|
-
marker: r,
|
|
2978
|
-
direction: n,
|
|
2979
|
-
toast: t,
|
|
2980
|
-
naverClientId: o,
|
|
2981
|
-
onExpandRequest: s,
|
|
2982
|
-
onClick: a,
|
|
2983
|
-
height: i = 200
|
|
2984
|
-
}) => {
|
|
2985
|
-
const c = aa(), m = o || c.naverClientId, { title: p, address: _, latitude: d, longitude: u } = e, f = n?.label ?? "길찾기", h = t?.addressCopied ?? "주소 복사 완료", [g, y] = v(null), x = i - fa, k = W((b) => {
|
|
2986
|
-
b && b.map && y(b);
|
|
2987
|
-
}, []), N = W(() => {
|
|
2988
|
-
s?.();
|
|
2989
|
-
}, [s]), $ = W(
|
|
2990
|
-
(b, C, E) => {
|
|
2991
|
-
if (b && b.map && d && u)
|
|
2992
|
-
try {
|
|
2993
|
-
b.addMarker(C), E?.();
|
|
2994
|
-
} catch (O) {
|
|
2995
|
-
console.error("Error creating map marker:", O);
|
|
2996
|
-
}
|
|
2997
|
-
},
|
|
2998
|
-
[d, u]
|
|
2999
|
-
), Z = W(
|
|
3000
|
-
(b, C) => {
|
|
3001
|
-
b && b.map && d && u && (b.clearMarkers(), $(
|
|
3002
|
-
b,
|
|
3003
|
-
{
|
|
3004
|
-
id: `location-marker-${p}`,
|
|
3005
|
-
type: C,
|
|
3006
|
-
position: { latitude: d, longitude: u },
|
|
3007
|
-
title: p,
|
|
3008
|
-
icon: r?.imageUrl,
|
|
3009
|
-
address: _
|
|
3010
|
-
},
|
|
3011
|
-
() => {
|
|
3012
|
-
b.panTo({ latitude: d, longitude: u });
|
|
3013
|
-
}
|
|
3014
|
-
));
|
|
3015
|
-
},
|
|
3016
|
-
[d, u, p, r?.imageUrl, _, $]
|
|
3017
|
-
);
|
|
3018
|
-
Q(() => {
|
|
3019
|
-
d && u && g && Z(g, "pi");
|
|
3020
|
-
}, [g, d, u, Z]), Q(() => () => {
|
|
3021
|
-
y(null);
|
|
3022
|
-
}, []);
|
|
3023
|
-
const z = W(() => {
|
|
3024
|
-
typeof navigator < "u" && navigator.clipboard && (navigator.clipboard.writeText(_), ce(h));
|
|
3025
|
-
}, [_, h]), B = Re(() => n?.url ? n.url : `https://map.naver.com/p/search/${encodeURIComponent(p)}`, [n?.url, p]);
|
|
3026
|
-
return m ? /* @__PURE__ */ D("div", { className: oe.MapInfo, style: { height: i }, onClick: a, children: [
|
|
3027
|
-
/* @__PURE__ */ l(Xo, { clientId: m, children: /* @__PURE__ */ D("div", { className: oe.MapInfo__Preview, onClick: N, children: [
|
|
3028
|
-
/* @__PURE__ */ l(
|
|
3029
|
-
St,
|
|
3030
|
-
{
|
|
3031
|
-
onLoad: k,
|
|
3032
|
-
options: {
|
|
3033
|
-
width: "100%",
|
|
3034
|
-
height: `${x}px`,
|
|
3035
|
-
center: {
|
|
3036
|
-
lat: d,
|
|
3037
|
-
lng: u
|
|
3038
|
-
},
|
|
3039
|
-
zoom: 15,
|
|
3040
|
-
minZoom: 15,
|
|
3041
|
-
maxZoom: 15,
|
|
3042
|
-
draggable: !1,
|
|
3043
|
-
keyboardShortcuts: !1,
|
|
3044
|
-
mapTypeControl: !1,
|
|
3045
|
-
scaleControl: !1,
|
|
3046
|
-
logoControl: !1,
|
|
3047
|
-
mapDataControl: !1,
|
|
3048
|
-
zoomControl: !1
|
|
3049
|
-
}
|
|
3050
|
-
}
|
|
3051
|
-
),
|
|
3052
|
-
s && /* @__PURE__ */ l("div", { className: oe.MapInfo__ExpandButton, children: /* @__PURE__ */ l(ir, { color: lr, size: 18 }) })
|
|
3053
|
-
] }) }),
|
|
3054
|
-
/* @__PURE__ */ D("div", { className: oe.MapInfo__AddressBar, children: [
|
|
3055
|
-
/* @__PURE__ */ D("div", { className: oe.MapInfo__AddressContent, children: [
|
|
3056
|
-
/* @__PURE__ */ l(cr, { color: ge, size: 24, variant: "filled" }),
|
|
3057
|
-
/* @__PURE__ */ l(
|
|
3058
|
-
"span",
|
|
3059
|
-
{
|
|
3060
|
-
className: oe.MapInfo__Address,
|
|
3061
|
-
onClick: z,
|
|
3062
|
-
role: "button",
|
|
3063
|
-
tabIndex: 0,
|
|
3064
|
-
onKeyDown: (b) => b.key === "Enter" && z(),
|
|
3065
|
-
children: _
|
|
3066
|
-
}
|
|
3067
|
-
)
|
|
3068
|
-
] }),
|
|
3069
|
-
/* @__PURE__ */ l(
|
|
3070
|
-
"a",
|
|
3071
|
-
{
|
|
3072
|
-
className: oe.MapInfo__DirectionLink,
|
|
3073
|
-
href: B,
|
|
3074
|
-
target: "_blank",
|
|
3075
|
-
rel: "noreferrer",
|
|
3076
|
-
children: /* @__PURE__ */ l(me, { variant: "basic", size: "sm", className: oe.MapInfo__DirectionButton, children: f })
|
|
3077
|
-
}
|
|
3078
|
-
)
|
|
3079
|
-
] })
|
|
3080
|
-
] }) : /* @__PURE__ */ l("div", { className: oe.MapInfo, style: { height: i }, children: /* @__PURE__ */ l("div", { className: oe.MapInfo__NoClientId, children: "naverClientId가 필요합니다. PopUIProvider 또는 props로 전달해주세요." }) });
|
|
3081
|
-
};
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { Button as p } from "./esm/components/Button/index.js";
|
|
5
|
+
import { Checkbox as f } from "./esm/components/Checkbox/index.js";
|
|
6
|
+
import { CalendarDatePicker as a } from "./esm/components/CalendarDatePicker/index.js";
|
|
7
|
+
import { DatePicker as n } from "./esm/components/DatePicker/index.js";
|
|
8
|
+
import { Dropdown as s } from "./esm/components/Dropdown/index.js";
|
|
9
|
+
import { ImageInput as g } from "./esm/components/ImageInput/index.js";
|
|
10
|
+
import { LottieInput as l } from "./esm/components/LottieInput/index.js";
|
|
11
|
+
import { Modal as c } from "./esm/components/Modal/index.js";
|
|
12
|
+
import { Pagination as T } from "./esm/components/Pagination/index.js";
|
|
13
|
+
import { Radio as v } from "./esm/components/Radio/index.js";
|
|
14
|
+
import { SearchBar as h } from "./esm/components/SearchBar/index.js";
|
|
15
|
+
import { SegmentButton as D } from "./esm/components/SegmentButton/index.js";
|
|
16
|
+
import { Tab as S } from "./esm/components/Tab/index.js";
|
|
17
|
+
import { TextField as N } from "./esm/components/TextField/index.js";
|
|
18
|
+
import { TimePicker as w } from "./esm/components/TimePicker/index.js";
|
|
19
|
+
import { toast as F } from "./esm/components/Toast/index.js";
|
|
20
|
+
import { Toggle as R } from "./esm/components/Toggle/index.js";
|
|
21
|
+
import { Tooltip as q } from "./esm/components/Tooltip/index.js";
|
|
22
|
+
import { Map as A } from "./esm/components/Map/Map.js";
|
|
23
|
+
import { NaverMapProvider as G, useNaverMap as J } from "./esm/components/Map/NaverMapContext.js";
|
|
24
|
+
import { useMap as O } from "./esm/components/Map/useMap.js";
|
|
25
|
+
import { useLocation as V } from "./esm/components/Map/useLocation.js";
|
|
26
|
+
import { getMarkerHTML as X, markerStyles as Y } from "./esm/components/Map/markerStyles.js";
|
|
27
|
+
import { makeMarkerClustering as _ } from "./esm/components/Map/markerClustering.js";
|
|
28
|
+
import { MapInfo as oo } from "./esm/components/MapInfo/index.js";
|
|
29
|
+
import { PopUiProvider as eo, usePopUIConfig as to, useTheme as po } from "./esm/theme/ThemeProvider.js";
|
|
3082
30
|
export {
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
31
|
+
p as Button,
|
|
32
|
+
a as CalendarDatePicker,
|
|
33
|
+
f as Checkbox,
|
|
34
|
+
n as DatePicker,
|
|
35
|
+
s as Dropdown,
|
|
36
|
+
g as ImageInput,
|
|
37
|
+
l as LottieInput,
|
|
38
|
+
A as Map,
|
|
39
|
+
oo as MapInfo,
|
|
40
|
+
c as Modal,
|
|
41
|
+
G as NaverMapProvider,
|
|
42
|
+
T as Pagination,
|
|
43
|
+
eo as PopUiProvider,
|
|
44
|
+
v as Radio,
|
|
45
|
+
h as SearchBar,
|
|
46
|
+
D as SegmentButton,
|
|
47
|
+
S as Tab,
|
|
48
|
+
N as TextField,
|
|
49
|
+
w as TimePicker,
|
|
50
|
+
R as Toggle,
|
|
51
|
+
q as Tooltip,
|
|
52
|
+
X as getMarkerHTML,
|
|
53
|
+
_ as makeMarkerClustering,
|
|
54
|
+
Y as markerStyles,
|
|
55
|
+
F as toast,
|
|
56
|
+
V as useLocation,
|
|
57
|
+
O as useMap,
|
|
58
|
+
J as useNaverMap,
|
|
59
|
+
to as usePopUIConfig,
|
|
60
|
+
po as useTheme
|
|
3113
61
|
};
|