@machinerd/js-module 0.0.11 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,497 @@
1
+ import * as react3 from "react";
2
+ import React$1, { ComponentProps, HTMLAttributes } from "react";
3
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
4
+ import { VariantProps } from "class-variance-authority";
5
+ import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
6
+ import * as class_variance_authority_types3 from "class-variance-authority/types";
7
+
8
+ //#region src/ui/bottom-app-bar/bottom-app-bar.d.ts
9
+ interface BottomAppBarProps<T> extends React$1.HTMLAttributes<HTMLElement> {
10
+ items: T[];
11
+ render: (item: T) => React$1.ReactNode;
12
+ }
13
+ /**
14
+ * @param items - Items to render
15
+ * @param render - Render function
16
+ */
17
+ declare function BottomAppBar<T>({
18
+ className,
19
+ items,
20
+ render,
21
+ ...props
22
+ }: BottomAppBarProps<T>): React$1.ReactNode;
23
+ //#endregion
24
+ //#region src/ui/button/button.d.ts
25
+ declare const classes$5: (props?: ({
26
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "base" | null | undefined;
27
+ gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
28
+ outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
29
+ rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "2.5xl" | null | undefined;
30
+ variant?: "default" | "ghost" | "white" | "blue" | "night" | "charcoal" | "slate" | "red" | "yellow" | "black" | null | undefined;
31
+ } & class_variance_authority_types3.ClassProp) | undefined) => string;
32
+ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'suffix' | 'prefix'>, VariantProps<typeof classes$5> {
33
+ /**
34
+ * @param size - Height of the button
35
+ * @default md - 40px
36
+ * @property
37
+ * - xs: 30px
38
+ * - sm: 32px
39
+ * - base: 36px
40
+ * - md: 40px
41
+ * - lg: 44px
42
+ * - xl: 48px
43
+ * - 2xl: 52px
44
+ * - 3xl: 56px
45
+ */
46
+ size?: VariantProps<typeof classes$5>['size'];
47
+ /**
48
+ * @param gap - Gap between the button and the content
49
+ * @default sm - 8px
50
+ * @property
51
+ * - none: 0
52
+ * - xs: 4px
53
+ * - sm: 8px
54
+ * - md: 12px
55
+ * - lg: 16px
56
+ * - xl: 20px
57
+ */
58
+ gap?: VariantProps<typeof classes$5>['gap'];
59
+ /**
60
+ * @param rounded - Border radius of the button
61
+ * @default sm
62
+ * @property
63
+ * - none: 0
64
+ * - sm: 2px
65
+ * - md: 6px
66
+ * - lg: 8px
67
+ * - xl: 12px
68
+ * - 2xl: 16px
69
+ * - 2.5xl: 20px
70
+ * - 3xl: 24px
71
+ * - full: 100%
72
+ */
73
+ rounded?: VariantProps<typeof classes$5>['rounded'];
74
+ /**
75
+ * @param variant - Variant of the button
76
+ * @default blue
77
+ * @property
78
+ * - default
79
+ * - ghost
80
+ * - white
81
+ * - blue
82
+ * - night
83
+ * - charcoal
84
+ * - slate
85
+ * - red
86
+ * - yellow
87
+ * - black
88
+ */
89
+ variant?: VariantProps<typeof classes$5>['variant'];
90
+ disabled?: boolean;
91
+ children?: React.ReactNode;
92
+ }
93
+ /**
94
+ * @param size - Size of the button
95
+ * @param gap - Gap between the button and the content
96
+ * @param outline - Outline of the button
97
+ * @param rounded - Border radius of the button
98
+ * @param variant - Variant of the button
99
+ */
100
+ declare const Button: react3.ForwardRefExoticComponent<ButtonProps & react3.RefAttributes<HTMLButtonElement>>;
101
+ //#endregion
102
+ //#region src/ui/carousel/carousel-context.d.ts
103
+ type CarouselApi = UseEmblaCarouselType[1];
104
+ type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
105
+ type CarouselOptions = UseCarouselParameters[0];
106
+ type CarouselPlugin = UseCarouselParameters[1];
107
+ interface CarouselProps {
108
+ options?: CarouselOptions;
109
+ plugins?: CarouselPlugin;
110
+ orientation?: 'horizontal' | 'vertical';
111
+ setApi?: (api: CarouselApi) => void;
112
+ }
113
+ type CarouselContextProps = {
114
+ carouselRef: ReturnType<typeof useEmblaCarousel>[0];
115
+ api: ReturnType<typeof useEmblaCarousel>[1];
116
+ scrollPrev: () => void;
117
+ scrollNext: () => void;
118
+ canScrollPrev: boolean;
119
+ canScrollNext: boolean;
120
+ } & CarouselProps;
121
+ //#endregion
122
+ //#region src/ui/carousel/carousel.d.ts
123
+ interface CarouselProps$1 extends ComponentProps<'div'>, CarouselProps {
124
+ /**
125
+ * @param orientation - Orientation of the carousel
126
+ * @default horizontal
127
+ * @property
128
+ * - horizontal
129
+ * - vertical
130
+ */
131
+ orientation?: 'horizontal' | 'vertical';
132
+ /**
133
+ * @param options - Options of the carousel
134
+ * @default {}
135
+ */
136
+ options?: CarouselProps['options'];
137
+ /**
138
+ * @param setApi - Set the API of the carousel
139
+ * @default undefined
140
+ */
141
+ setApi?: CarouselProps['setApi'];
142
+ /**
143
+ * @param plugins - Plugins of the carousel
144
+ * @default []
145
+ */
146
+ plugins?: CarouselProps['plugins'];
147
+ }
148
+ declare function Carousel({
149
+ orientation,
150
+ options,
151
+ setApi,
152
+ plugins,
153
+ className,
154
+ children,
155
+ ...props
156
+ }: CarouselProps$1): react_jsx_runtime6.JSX.Element;
157
+ //#endregion
158
+ //#region src/ui/carousel/carousel-wrapper.d.ts
159
+ declare function CarouselWrapper({
160
+ className,
161
+ ...props
162
+ }: React$1.ComponentProps<'div'>): react_jsx_runtime6.JSX.Element;
163
+ //#endregion
164
+ //#region src/ui/carousel/carousel-item.d.ts
165
+ declare function CarouselItem({
166
+ className,
167
+ ...props
168
+ }: React$1.ComponentProps<'div'>): react_jsx_runtime6.JSX.Element;
169
+ //#endregion
170
+ //#region src/ui/carousel/carousel-previous.d.ts
171
+ declare function CarouselPrevious({
172
+ children,
173
+ className,
174
+ ...props
175
+ }: React$1.ComponentProps<'button'>): react_jsx_runtime6.JSX.Element;
176
+ //#endregion
177
+ //#region src/ui/carousel/carousel-next.d.ts
178
+ declare function CarouselNext({
179
+ children,
180
+ className,
181
+ ...props
182
+ }: React$1.ComponentProps<'button'>): react_jsx_runtime6.JSX.Element;
183
+ //#endregion
184
+ //#region src/ui/conditional-wrapper/conditional-wrapper.d.ts
185
+ interface ConditionalWrapperProps {
186
+ condition: boolean;
187
+ wrapper: (children: React.ReactNode) => React.ReactNode;
188
+ children: React.ReactNode;
189
+ }
190
+ /**
191
+ * @param condition - Condition to wrap the children
192
+ * @param wrapper - Wrapper function
193
+ * @param children - Children to wrap
194
+ */
195
+ declare function ConditionalWrapper({
196
+ condition,
197
+ wrapper,
198
+ children
199
+ }: ConditionalWrapperProps): react3.ReactNode;
200
+ //#endregion
201
+ //#region src/ui/footer/footer.d.ts
202
+ declare const classes$4: (props?: ({
203
+ maxWidth?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "full" | null | undefined;
204
+ } & class_variance_authority_types3.ClassProp) | undefined) => string;
205
+ interface FooterProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes$4> {
206
+ /**
207
+ * @param maxWidth - Maximum width of the footer
208
+ * @default full
209
+ * @property
210
+ * - none: 0
211
+ * - xs: 320px
212
+ * - sm: 384px
213
+ * - md: 448px
214
+ * - lg: 512px
215
+ * - xl: 576px
216
+ * - 2xl: 672px
217
+ * - 3xl: 768px
218
+ * - 4xl: 896px
219
+ * - 5xl: 1024px
220
+ * - 6xl: 1152px
221
+ * - 7xl: 1280px
222
+ * - full: 100%
223
+ */
224
+ maxWidth?: VariantProps<typeof classes$4>['maxWidth'];
225
+ }
226
+ declare function Footer({
227
+ className,
228
+ children,
229
+ maxWidth,
230
+ ...props
231
+ }: FooterProps): react_jsx_runtime6.JSX.Element;
232
+ //#endregion
233
+ //#region src/ui/header/header.d.ts
234
+ declare const classes$3: (props?: ({
235
+ maxWidth?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "full" | "8xl" | null | undefined;
236
+ size?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "full" | "8xl" | "4.25xl" | null | undefined;
237
+ } & class_variance_authority_types3.ClassProp) | undefined) => string;
238
+ interface HeaderProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes$3> {
239
+ children?: React.ReactNode;
240
+ /**
241
+ * @param maxWidth - Maximum width of the header
242
+ * @default full
243
+ * @property
244
+ * - none: 0
245
+ * - xs: 320px
246
+ * - sm: 384px
247
+ * - md: 448px
248
+ * - lg: 512px
249
+ * - xl: 576px
250
+ * - 2xl: 672px
251
+ * - 3xl: 768px
252
+ * - 4xl: 896px
253
+ * - 5xl: 1024px
254
+ * - 6xl: 1152px
255
+ * - 7xl: 1280px
256
+ * - 8xl: 1320px
257
+ * - full: 100%
258
+ */
259
+ maxWidth?: VariantProps<typeof classes$3>['maxWidth'];
260
+ /**
261
+ * @param size - Size of the header
262
+ * @default xl
263
+ * @property
264
+ * - sm: 40px
265
+ * - md: 48px
266
+ * - lg: 56px
267
+ * - xl: 64px
268
+ * - 2xl: 72px
269
+ * - 3xl: 88px
270
+ * - 4xl: 80px
271
+ * - 4.25xl: 90px
272
+ * - 5xl: 96px
273
+ * - 6xl: 104px
274
+ * - 7xl: 112px
275
+ * - 8xl: 120px
276
+ * - full: 100%
277
+ */
278
+ size?: VariantProps<typeof classes$3>['size'];
279
+ }
280
+ declare function Header({
281
+ children,
282
+ maxWidth,
283
+ size,
284
+ className,
285
+ ...props
286
+ }: HeaderProps): react_jsx_runtime6.JSX.Element;
287
+ //#endregion
288
+ //#region src/ui/input/input.d.ts
289
+ declare const classes$2: (props?: ({
290
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "base" | null | undefined;
291
+ gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
292
+ outline?: "line" | "solid" | "clear" | "dashed" | "dotted" | null | undefined;
293
+ rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
294
+ } & class_variance_authority_types3.ClassProp) | undefined) => string;
295
+ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'surffix' | 'size'>, VariantProps<typeof classes$2> {
296
+ /**
297
+ * @param size - Height of the input
298
+ * @default lg - 44px
299
+ * @property
300
+ * - xs: 30px
301
+ * - sm: 32px
302
+ * - base: 36px
303
+ * - md: 40px
304
+ * - lg: 44px
305
+ * - xl: 48px
306
+ * - 2xl: 52px
307
+ * - 3xl: 56px
308
+ */
309
+ size?: VariantProps<typeof classes$2>['size'];
310
+ /**
311
+ * @param gap - Gap between the input and the prefix/suffix
312
+ * @default xl - 20px
313
+ * @property
314
+ * - none: 0
315
+ * - xs: 4px
316
+ * - sm: 8px
317
+ * - md: 12px
318
+ * - lg: 16px
319
+ * - xl: 20px
320
+ */
321
+ gap?: VariantProps<typeof classes$2>['gap'];
322
+ outline?: VariantProps<typeof classes$2>['outline'];
323
+ /**
324
+ * @param rounded - Border radius of the input
325
+ * @default lg
326
+ * @property
327
+ * - none: 0
328
+ * - sm: 2px
329
+ * - md: 6px
330
+ * - lg: 8px
331
+ * - xl: 12px
332
+ * - 2xl: 16px
333
+ */
334
+ rounded?: VariantProps<typeof classes$2>['rounded'];
335
+ prefix?: React.ReactNode;
336
+ surffix?: React.ReactNode;
337
+ }
338
+ /**
339
+ * @param prefix - Prefix of the input
340
+ * @param surffix - Surffix of the input
341
+ * @param size - Size of the input
342
+ * @param gap - Gap between the input and the prefix/suffix
343
+ * @param outline - Outline of the input
344
+ * @param rounded - Border radius of the input
345
+ */
346
+ declare const Input: react3.ForwardRefExoticComponent<InputProps & react3.RefAttributes<HTMLInputElement>>;
347
+ //#endregion
348
+ //#region src/ui/layout/layout.d.ts
349
+ declare const classes$1: (props?: ({
350
+ type?: "content" | "main" | null | undefined;
351
+ maxWidth?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
352
+ } & class_variance_authority_types3.ClassProp) | undefined) => string;
353
+ interface LayoutProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes$1> {
354
+ /**
355
+ * @param type - Type of the layout
356
+ * @default main
357
+ * @property
358
+ * - main: flex column
359
+ * - content: grow my-0
360
+ */
361
+ type?: VariantProps<typeof classes$1>['type'];
362
+ /**
363
+ * @param maxWidth - Maximum width of the layout
364
+ * @default full
365
+ * @property
366
+ * - none: 0
367
+ * - xs: 320px (>=1280px: 100%)
368
+ * - sm: 384px (>=1280px: 100%)
369
+ * - md: 448px (>=1280px: 100%)
370
+ * - lg: 512px (>=1280px: 100%)
371
+ * - xl: 576px (>=1280px: 100%)
372
+ * - 2xl: 672px (>=1280px: 100%)
373
+ * - 3xl: 768px (>=1280px: 100%)
374
+ * - full: 100%
375
+ */
376
+ maxWidth?: VariantProps<typeof classes$1>['maxWidth'];
377
+ }
378
+ declare function Layout({
379
+ children,
380
+ className,
381
+ type,
382
+ maxWidth,
383
+ ...props
384
+ }: LayoutProps): react_jsx_runtime6.JSX.Element;
385
+ //#endregion
386
+ //#region src/ui/skeleton/skeleton.d.ts
387
+ declare const classes: (props?: ({
388
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "square" | null | undefined;
389
+ rounded?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
390
+ } & class_variance_authority_types3.ClassProp) | undefined) => string;
391
+ interface SkeletonProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof classes> {
392
+ /**
393
+ * @param width - Width of the skeleton
394
+ * @description string or number, number unit is px
395
+ * @default 100
396
+ */
397
+ width?: string | number;
398
+ /**
399
+ * @param height - Height of the skeleton
400
+ * @description string or number, number unit is px
401
+ * @default 100
402
+ */
403
+ height?: string | number;
404
+ /**
405
+ * @param size - Size of the skeleton (height)
406
+ * @default sm
407
+ * @property
408
+ * - xs: 4px
409
+ * - sm: 8px
410
+ * - md: 12px
411
+ * - lg: 16px
412
+ * - xl: 20px
413
+ * - 2xl: 24px
414
+ * - 3xl: 28px
415
+ * - square: 100%
416
+ * - full: 100%
417
+ */
418
+ size?: VariantProps<typeof classes>['size'];
419
+ /**
420
+ * @param rounded - Rounded of the skeleton
421
+ * @default sm
422
+ * @property
423
+ * - none: 0
424
+ * - sm: 2px
425
+ * - md: 6px
426
+ * - lg: 8px
427
+ * - xl: 12px
428
+ * - 2xl: 16px
429
+ * - 3xl: 20px
430
+ * - full: 100%
431
+ */
432
+ rounded?: VariantProps<typeof classes>['rounded'];
433
+ }
434
+ /**
435
+ * @param size - Size of the skeleton (height)
436
+ * @param rounded - Rounded of the skeleton
437
+ * @param width - Width of the skeleton
438
+ * @param height - Height of the skeleton
439
+ */
440
+ declare function Skeleton({
441
+ size,
442
+ rounded,
443
+ width,
444
+ height,
445
+ className,
446
+ ...props
447
+ }: SkeletonProps): react_jsx_runtime6.JSX.Element;
448
+ //#endregion
449
+ //#region src/ui/tooltip/tooltip-container.d.ts
450
+ type SubPlacement = 'start' | 'end';
451
+ type MainPlacement = 'top' | 'bottom' | 'left' | 'right';
452
+ type TooltipPlacement = MainPlacement | `${MainPlacement}-${SubPlacement}`;
453
+ interface TooltipContainerProps extends HTMLAttributes<HTMLDivElement> {
454
+ /**
455
+ * @param children - Trigger element
456
+ */
457
+ children: React.ReactNode;
458
+ /**
459
+ * @param content - Tooltip content
460
+ */
461
+ content: string;
462
+ /**
463
+ * @param placement - Placement of the tooltip
464
+ * @default top
465
+ * @property
466
+ * - top
467
+ * - bottom
468
+ * - left
469
+ * - right
470
+ * - top-start
471
+ * - top-end
472
+ * - bottom-start
473
+ * - bottom-end
474
+ * - left-start
475
+ * - left-end
476
+ * - right-start
477
+ * - right-end
478
+ */
479
+ placement?: TooltipPlacement;
480
+ /**
481
+ * @param defaultOpen - Default open state of the tooltip
482
+ * @default false
483
+ * @property
484
+ * - true: Open the tooltip
485
+ * - false: Close the tooltip
486
+ */
487
+ defaultOpen?: boolean;
488
+ }
489
+ /**
490
+ * @param children - Trigger element
491
+ * @param content - Tooltip content
492
+ * @param defaultOpen - Default open state of the tooltip
493
+ * @param placement - Placement of the tooltip
494
+ */
495
+ declare const TooltipContainer: react3.ForwardRefExoticComponent<TooltipContainerProps & react3.RefAttributes<HTMLDivElement>>;
496
+ //#endregion
497
+ export { BottomAppBar, type BottomAppBarProps, Button, type ButtonProps, Carousel, type CarouselApi, type CarouselContextProps, CarouselItem, CarouselNext, type CarouselOptions, type CarouselPlugin, CarouselPrevious, type CarouselProps, CarouselWrapper, ConditionalWrapper, type ConditionalWrapperProps, Footer, type FooterProps, Header, type HeaderProps, Input, type InputProps, Layout, type LayoutProps, Skeleton, type SkeletonProps, TooltipContainer as Tooltip, type TooltipContainerProps as TooltipProps };
@@ -0,0 +1 @@
1
+ import{f as e}from"../util-DCPr_-5a.mjs";import{t}from"../hooks-5I2NBtcY.mjs";import{debounce as n}from"lodash-es";import r from"clsx";import i,{forwardRef as a,useCallback as o,useEffect as s,useMemo as c,useRef as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{cva as p}from"class-variance-authority";import m from"embla-carousel-react";import{createPortal as h}from"react-dom";function g({className:e,items:t,render:n,...a}){return d(`nav`,{"data-komc":!0,className:r(`komc:fixed komc:bottom-0 komc:left-0 komc:right-0`,`komc:border-t komc:border-neutral-200 komc:bg-white komc:z-10`,e),...a,children:d(`div`,{className:`komc:grid komc:min-h-15`,style:{gridTemplateColumns:`repeat(${t.length}, 1fr)`},children:t.map((e,t)=>d(i.Fragment,{children:n(e)},t))})})}const _=p(e(`komc:inline-flex komc:justify-center komc:items-center komc:w-full`,`komc:transition-colors komc:duration-200 komc:relative`,`komc:*:transition-colors komc:*:duration-200`,`komc:disabled:cursor-default komc:disabled:opacity-50 komc:disabled:pointer-events-none`,`komc:whitespace-nowrap komc:shrink-0 komc:outline-none`),{variants:{size:{xs:`komc:h-7.5`,sm:`komc:h-8`,base:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`},gap:{none:`komc:gap-0`,xs:`komc:gap-1`,sm:`komc:gap-2`,md:`komc:gap-3`,lg:`komc:gap-4`,xl:`komc:gap-5`},outline:{line:`komc:border`,solid:`komc:border-transparent`,clear:`komc:border-none`,dashed:`komc:border-dashed`,dotted:`komc:border-dotted`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"2.5xl":`komc:rounded-[20px]`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`},variant:{default:``,ghost:`komc:bg-transparent komc:text-neutral-900`,white:`komc:bg-white komc:text-neutral-900 komc:hover:bg-neutral-100`,blue:`komc:bg-blue-500 komc:text-white komc:hover:bg-blue-600`,night:`komc:bg-[#2c5cb7] komc:text-white komc:hover:bg-[#26539F]`,charcoal:`komc:bg-[#36454F] komc:text-white komc:hover:bg-[#2E3A43]`,slate:`komc:bg-[#4A5565] komc:text-white komc:hover:bg-[#424A57]`,red:`komc:bg-[#C8313A] komc:text-white komc:hover:bg-[#B02B33]`,yellow:`komc:bg-[#E7FF14] komc:text-black komc:hover:bg-[#D4E600]`,black:`komc:bg-[rgb(95,95,96)] komc:text-white komc:hover:bg-[rgb(76,76,77)] komc:active:bg-[rgb(76,76,77)]`}},defaultVariants:{size:void 0,outline:void 0,rounded:void 0,variant:void 0}});var v=a(({children:e=`button`,type:t=`button`,size:n=`md`,gap:r=`sm`,outline:i=`line`,rounded:a=`sm`,variant:o=`blue`,className:s,...c},l)=>d(`button`,{ref:l,type:t,"data-komc":!0,className:_({size:n,outline:i,gap:r,rounded:a,variant:o,className:s}),...c,children:e}));const y=i.createContext(null);function b(){let e=i.useContext(y);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}function x({orientation:t=`horizontal`,options:n,setApi:r,plugins:i,className:a,children:c,...l}){let[f,p]=m({...n,axis:t===`horizontal`?`x`:`y`},i),[h,g]=u(!1),[_,v]=u(!1),b=o(e=>{e&&(g(e.canScrollPrev()),v(e.canScrollNext()))},[]),x=o(()=>{p?.scrollPrev()},[p]),S=o(()=>{p?.scrollNext()},[p]),C=o(e=>{e.key===`ArrowLeft`?(e.preventDefault(),x()):e.key===`ArrowRight`&&(e.preventDefault(),S())},[x,S]);return s(()=>{!p||!r||r(p)},[p,r]),s(()=>{if(p)return b(p),p.on(`reInit`,b),p.on(`select`,b),()=>{p?.off(`select`,b)}},[p,b]),d(y.Provider,{value:{carouselRef:f,api:p,options:n,orientation:t||(n?.axis===`y`?`vertical`:`horizontal`),scrollPrev:x,scrollNext:S,canScrollPrev:h,canScrollNext:_},children:d(`div`,{"data-komc":!0,onKeyDownCapture:C,className:e(`komc:relative`,a),...l,children:c})})}function S({className:t,...n}){let{carouselRef:r,orientation:i}=b();return d(`div`,{ref:r,"data-komc":!0,className:`komc:h-full komc:overflow-hidden`,children:d(`div`,{className:e(`komc:flex komc:h-full`,i===`horizontal`?`komc:-ml-4`:`komc:-mt-4 komc:flex-col`,t),...n})})}function C({className:t,...n}){let{orientation:r}=b();return d(`div`,{"data-komc":!0,className:e(`komc:min-w-0 komc:shrink-0 komc:grow-0 komc:basis-full`,r===`horizontal`?`komc:pl-4`:`komc:pt-4`,t),...n})}function w({children:e,className:t,...n}){let{scrollPrev:i,canScrollPrev:a}=b();return d(`button`,{type:`button`,"data-komc":!0,disabled:!a,className:r(`komc:w-full`,t),onClick:i,...n,children:e})}function T({children:e,className:t,...n}){let{scrollNext:i,canScrollNext:a}=b();return d(`button`,{type:`button`,"data-komc":!0,disabled:!a,className:r(`komc:w-full`,t),onClick:i,...n,children:e})}function E({condition:e,wrapper:t,children:n}){return e?t(n):n}const D=p(`komc:flex komc:flex-col komc:w-full komc:max-w-7xl komc:mx-auto`,{variants:{maxWidth:{none:``,xs:`komc:max-w-xs`,sm:`komc:max-w-sm`,md:`komc:max-w-md`,lg:`komc:max-w-lg`,xl:`komc:max-w-xl`,"2xl":`komc:max-w-2xl`,"3xl":`komc:max-w-3xl`,"4xl":`komc:max-w-4xl`,"5xl":`komc:max-w-5xl`,"6xl":`komc:max-w-6xl`,"7xl":`komc:max-w-7xl`,full:`komc:max-w-full`}},defaultVariants:{maxWidth:`full`}});function O({className:e,children:t,maxWidth:n,...i}){return d(`footer`,{"data-komc":!0,className:r(`komc:block komc:w-full komc:h-full`,`komc:bg-white komc:border-t komc:border-neutral-200`,e),...i,children:d(`div`,{className:D({maxWidth:n}),children:t})})}const k=p(e(`komc:flex komc:items-center`,`komc:mx-auto komc:min-h-10`),{variants:{maxWidth:{none:``,sm:`komc:max-w-sm`,md:`komc:max-w-md`,lg:`komc:max-w-lg`,xl:`komc:max-w-xl`,"2xl":`komc:max-w-2xl`,"3xl":`komc:max-w-3xl`,"4xl":`komc:max-w-4xl`,"5xl":`komc:max-w-5xl`,"6xl":`komc:max-w-6xl`,"7xl":`komc:max-w-7xl`,"8xl":`komc:max-w-330`,full:`komc:max-w-full`},size:{sm:`komc:h-10`,md:`komc:h-12`,lg:`komc:h-14`,xl:`komc:h-16`,"2xl":`komc:h-18`,"3xl":`komc:h-20`,"4xl":`komc:h-22`,"4.25xl":`komc:h-22.5`,"5xl":`komc:h-24`,"6xl":`komc:h-26`,"7xl":`komc:h-28`,"8xl":`komc:h-30`,full:`komc:h-full`}},defaultVariants:{maxWidth:`full`,size:`xl`}});function A({children:e,maxWidth:t,size:n,className:i,...a}){return d(`header`,{"data-komc":!0,className:r(`komc:w-full komc:sticky komc:top-0 komc:z-1000 komc:bg-white`,`komc:transition-all komc:duration-200`,i),...a,children:d(`div`,{className:k({maxWidth:t,size:n}),children:e})})}const j=p(e(`komc:flex komc:items-center komc:w-full komc:px-2`,`komc:[&>input]:outline-none komc:[&>input]:w-full`,`komc:[&>input]:focus:ring-0 komc:[&>input]:focus:ring-offset-0`,`komc:[&>input]:h-full`),{variants:{size:{xs:`komc:h-7.5`,sm:`komc:h-8`,base:`komc:h-9`,md:`komc:h-10`,lg:`komc:h-11`,xl:`komc:h-12`,"2xl":`komc:h-13`,"3xl":`komc:h-14`},gap:{none:`komc:gap-0`,xs:`komc:gap-1`,sm:`komc:gap-2`,md:`komc:gap-3`,lg:`komc:gap-4`,xl:`komc:gap-5`},outline:{line:`komc:border`,solid:`komc:border-transparent`,clear:`komc:border-none`,dashed:`komc:border-dashed`,dotted:`komc:border-dotted`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`}}});var M=a(({prefix:e=null,surffix:t=null,size:n=`lg`,gap:r=`xl`,outline:i=`line`,rounded:a=`lg`,className:o,...s},c)=>f(`div`,{"data-komc":!0,className:j({size:n,gap:r,outline:i,rounded:a,className:o}),children:[e,d(`input`,{ref:c,type:`text`,...s}),t]}));const N=p(`komc:w-full komc:mx-auto komc:relative`,{variants:{type:{main:`komc:flex komc:flex-col`,content:`komc:grow komc:my-0`},maxWidth:{none:``,xs:`komc:max-w-xs komc:xl:max-w-full`,sm:`komc:max-w-sm komc:xl:max-w-full`,md:`komc:max-w-md komc:xl:max-w-full`,lg:`komc:max-w-lg komc:xl:max-w-full`,xl:`komc:max-w-xl komc:xl:max-w-full`,"2xl":`komc:max-w-2xl komc:xl:max-w-full`,"3xl":`komc:max-w-3xl komc:xl:max-w-full`,full:`komc:max-w-full`}},defaultVariants:{type:`main`,maxWidth:`full`}});function P({children:e,className:t,type:n,maxWidth:r,...i}){return d(`div`,{"data-komc":!0,className:N({type:n,maxWidth:r,className:t}),...i,children:e})}const F=p(e(`komc:w-full komc:animate-pulse komc:bg-gray-200`),{variants:{size:{xs:`komc:h-4`,sm:`komc:h-8`,md:`komc:h-12`,lg:`komc:h-16`,xl:`komc:h-20`,"2xl":`komc:h-24`,"3xl":`komc:h-28`,square:`komc:h-auto komc:aspect-square`,full:`komc:h-full`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`}},defaultVariants:{size:`sm`,rounded:`sm`}});function I({size:e,rounded:t,width:n,height:r,className:i,...a}){let o=n?typeof n==`string`?n:`${n}px`:void 0,s=r?typeof r==`string`?r:`${r}px`:void 0;return d(`div`,{"data-komc":!0,className:F({size:e,rounded:t,className:i}),style:{width:o,height:s},...a})}function L({children:e,setOpen:t}){return d(`div`,{"data-komc":!0,className:r(`komc:inline-flex komc:shrink-0 komc:justify-center`,`komc:items-center komc:outline-none`),onMouseLeave:()=>t(!1),onMouseOver:()=>t(!0),onFocus:()=>t(!0),onBlur:()=>t(!1),onClick:()=>t(!0),children:e})}const R=p(e(`komc:absolute komc:z-99 komc:w-max komc:max-w-70 komc:p-2 komc:rounded-md`,`komc:break-all komc:transition-opacity komc:duration-300 komc:bg-white`,`komc:drop-shadow-[0px_0.5px_3px_rgba(0,0,0,0.2)] komc:text-xs`),{variants:{portal:{true:``,false:``},placement:{top:``,bottom:``,left:``,right:``,"top-start":``,"top-end":``,"bottom-start":``,"bottom-end":``,"left-start":``,"left-end":``,"right-start":``,"right-end":``}},compoundVariants:[{portal:!0,placement:`top`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom`,className:`komc:translate-y-2`},{portal:!0,placement:`left`,className:`komc:-translate-x-2`},{portal:!0,placement:`right`,className:`komc:translate-x-2`},{portal:!0,placement:`top-start`,className:`komc:-translate-y-2`},{portal:!0,placement:`top-end`,className:`komc:-translate-y-2`},{portal:!0,placement:`bottom-start`,className:`komc:translate-y-2`},{portal:!0,placement:`bottom-end`,className:`komc:translate-y-2`},{portal:!0,placement:`left-start`,className:`komc:-translate-x-2`},{portal:!0,placement:`left-end`,className:`komc:-translate-x-2`},{portal:!0,placement:`right-start`,className:`komc:translate-x-2`},{portal:!0,placement:`right-end`,className:`komc:translate-x-2`},{portal:!1,placement:`top`,className:`komc:bottom-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`bottom`,className:`komc:top-full komc:left-1/2 komc:-translate-x-1/2`},{portal:!1,placement:`left`,className:`komc:right-full komc:top-1/2 komc:-translate-y-1/2`},{portal:!1,placement:`right`,className:`komc:left-full komc:top-1/2 komc:-translate-y-1/2`},{portal:!1,placement:`top-start`,className:`komc:bottom-full komc:left-0`},{portal:!1,placement:`top-end`,className:`komc:bottom-full komc:right-0`},{portal:!1,placement:`bottom-start`,className:`komc:top-full komc:left-0`},{portal:!1,placement:`bottom-end`,className:`komc:top-full komc:right-0`},{portal:!1,placement:`left-start`,className:`komc:right-full komc:top-0`},{portal:!1,placement:`left-end`,className:`komc:right-full komc:bottom-0`},{portal:!1,placement:`right-start`,className:`komc:left-full komc:top-0`},{portal:!1,placement:`right-end`,className:`komc:left-full komc:bottom-0`}],defaultVariants:{placement:`top`,portal:!1}});var z=a(({portal:e,children:t,className:n,placement:r,...i},a)=>d(`div`,{ref:a,"data-komc":!0,role:`tooltip`,className:R({portal:e,placement:r,className:n}),...i,children:t}));const B=p(e(`komc:absolute komc:w-2 komc:h-2 komc:bg-inherit`,`komc:transition-opacity komc:duration-300`),{variants:{placement:{top:e(`komc:top-full komc:-mt-1 komc:left-1/2`),bottom:e(`komc:bottom-full komc:-mb-1 komc:left-1/2`),left:e(`komc:left-full komc:-ml-1 komc:top-1/2`),right:e(`komc:right-full komc:-mr-1 komc:top-1/2`),"top-start":e(`komc:top-full komc:-mt-1 komc:left-5`),"top-end":e(`komc:top-full komc:-mt-1 komc:right-5`),"bottom-start":e(`komc:bottom-full komc:-mb-1 komc:left-5`),"bottom-end":e(`komc:bottom-full komc:-mb-1 komc:right-5`),"left-start":e(`komc:left-full komc:-ml-1 komc:top-3`),"left-end":e(`komc:left-full komc:-ml-1 komc:bottom-3`),"right-start":e(`komc:right-full komc:-mr-1 komc:top-3`),"right-end":e(`komc:right-full komc:-mr-1 komc:bottom-3`)}},defaultVariants:{placement:`top`}});var V=({placement:e,className:t,offset:n,style:r,...i})=>{let a=c(()=>{switch(e){case`top`:return`rotate(45deg)`;case`bottom`:return`rotate(225deg)`;case`left`:return`rotate(-45deg)`;case`right`:return`rotate(135deg)`;case`top-start`:return`rotate(45deg)`;case`top-end`:return`rotate(45deg)`;case`bottom-start`:return`rotate(225deg)`;case`bottom-end`:return`rotate(225deg)`;case`left-start`:return`rotate(-45deg)`;case`left-end`:return`rotate(-45deg)`;case`right-start`:return`rotate(135deg)`;case`right-end`:return`rotate(135deg)`;default:return`rotate(45deg)`}},[e]);return d(`div`,{className:B({placement:e,className:t}),style:{transform:`translate(${n?.x}px, ${n?.y}px) ${a}`},...i})};const H=(e,t)=>{let[,n]=e.split(`-`);return n?`${t}-${n}`:t};function U({placement:e,className:t,content:i,open:a,hiddenRef:c,containerRef:p}){let[m,g]=u(!1),_=l(null),[v,y]=u(e),[b,x]=u({top:0,left:0}),[S,C]=u({x:0,y:0}),w=o(n(()=>{let e=p?.current,t=c.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.scrollY||document.documentElement.scrollTop,a=window.scrollX||document.documentElement.scrollLeft,[o,s]=v.split(`-`),l=i+n.top,u=a+n.left+n.width/2-r.width/2;switch(o){case`top`:l-=r.height;break;case`bottom`:l+=n.height;break;case`left`:l+=n.height/2-r.height/2,u-=r.width/2+n.width/2;break;case`right`:l+=n.height/2-r.height/2,u+=r.width/2+n.width/2;break}if([`top`,`bottom`].includes(o))switch(s){case`start`:u+=r.width/2-24;break;case`end`:u-=r.width/2-24;break}if([`left`,`right`].includes(o))switch(s){case`start`:l+=r.height/2+n.height/2-24;break;case`end`:l-=r.height/2+n.height/2-24;break}let d=u,f=window.innerWidth;d+r.width>f-4&&(d=f-r.width-4),d<4&&(d=4),x({top:l,left:d}),C({x:u-d,y:0})},50),[v]),T=o(n(()=>{if(!c.current)return;let{top:t,height:n}=c.current.getBoundingClientRect();y(r=>{let i=e;return t+n>=window.innerHeight?i=H(r,`top`):t<0&&(i=H(r,`bottom`)),i})},50),[e]);return s(()=>(g(!0),T(),window.addEventListener(`scroll`,w,{passive:!0}),window.addEventListener(`resize`,w),window.addEventListener(`scroll`,T,{passive:!0}),window.addEventListener(`resize`,T),()=>{window.removeEventListener(`scroll`,w),window.removeEventListener(`resize`,w),window.removeEventListener(`scroll`,T),window.removeEventListener(`resize`,T)}),[w,T]),s(()=>{m&&w()},[m,w]),m?h(f(z,{ref:_,portal:!0,"data-komc":!0,placement:v,className:r(t,a?`komc:visible komc:opacity-100`:`komc:opacity-0 komc:invisible`),style:{...b},children:[d(`span`,{children:i}),d(V,{placement:v,offset:S})]}),document.body):null}var W=a(({children:e,content:n,defaultOpen:i=!1,className:a,placement:o=`top`},s)=>{let[c,p]=u(i),m=l(null),h=l(null);return t({ref:m,setOpen:p}),f(`div`,{ref:m,"data-komc":!0,className:`komc:flex komc:shrink-0 komc:relative komc:overflow-hidden komc:w-fit komc:h-fit`,children:[d(L,{setOpen:p,children:e}),d(U,{placement:o,className:a,open:c,content:n,hiddenRef:h,containerRef:m}),d(z,{ref:h,role:`presentation`,placement:o,className:r(`komc:opacity-0 komc:invisible`,a),children:d(`span`,{children:n})})]})});export{g as BottomAppBar,v as Button,x as Carousel,C as CarouselItem,T as CarouselNext,w as CarouselPrevious,S as CarouselWrapper,E as ConditionalWrapper,O as Footer,A as Header,M as Input,P as Layout,I as Skeleton,W as Tooltip};
@@ -1 +1 @@
1
- const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`js-cookie`);t=e.t(t);let n=require(`query-string`);n=e.t(n);let r=require(`lodash-es`),i=require(`slug`);i=e.t(i);let a=require(`google-libphonenumber`);a=e.t(a);let o=require(`dayjs`);o=e.t(o),require(`dayjs/locale/ko.js`);let s=require(`dayjs/plugin/relativeTime.js`);s=e.t(s);let c=require(`nanoid`);const l=e=>t.default.get(e),u=(e,n,r)=>t.default.set(e,n,r),d=()=>typeof window>`u`?[]:JSON.parse(localStorage.getItem(`search-history`)||`[]`),f=e=>{let t=(0,r.uniq)([e,...d()]).slice(0,10);return localStorage.setItem(`search-history`,JSON.stringify(t)),t},p=e=>{let t=d();return t.splice(e,1),localStorage.setItem(`search-history`,JSON.stringify(t)),t},m=()=>{localStorage.setItem(`search-history`,JSON.stringify([]))},h=e=>e.endsWith(`/search`),g=e=>h(e)?e:`${e}/search`.replace(`//`,`/`),_=e=>e.replace(`/search`,``).replace(`//`,`/`),v=(e,t)=>{let n=new URLSearchParams(e);return n.delete(t),Object.fromEntries(n)},y=a.default.PhoneNumberFormat,b=a.default.PhoneNumberUtil.getInstance();i.default.extend({'"':`-`,"”":`-`,"“":`-`,"•":`----`}),i.default.setLocale(`en`);const x=(e,t=[])=>{if(typeof window>`u`)return``;let{hash:r,search:i}=window.location,a=n.default.parse(i);Object.keys(e).forEach(t=>{e[t]?a[t]=e[t]:delete a[t]});let o={...a};return Object.keys(a).forEach(e=>{t.includes(e)&&delete o[e]}),`?${n.default.stringify(o,{encode:!0})}${r}`},S=(e,t)=>{let n=0;return e%t===0&&(n=e/t),n=Math.ceil(e/t),n<1&&(n=1),n},C=e=>{let t=[...e];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t},w=e=>{let t=document.getElementById(`naverMapLib`);if(!t){let t=document.createElement(`script`);t.src=`https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=ecs1pyoo9b`,t.id=`naverMapLib`,document.body.appendChild(t),t.onload=()=>{e&&e()}}t&&e&&e()},T=(e,t,n)=>t?e===`ko`&&n&&n!==`82`||e!==`ko`&&n?`+${n}-${t.replace(/^0/,``)}`:t:`-`,E=({phone:e,country:t={callingCode:`82`,alpha2Code:`KR`},format:n=y.INTERNATIONAL,locale:r})=>{if(!e||e===`-`)return`-`;try{let i=b.parseAndKeepRawInput(e,t?.alpha2Code||`KR`),a=i.getCountryCode();return r===`ko`&&t?.alpha2Code===`KR`&&a===82?b.format(i,y.NATIONAL):b.format(i,n)}catch{return T(r||`en`,e,t?.callingCode)}},D=(e,...t)=>{let n=`${e}`;return t.forEach(e=>{e&&(n=`${n}-${(0,i.default)(e)}`)}),n},O=e=>{let t=[];e.i18n?.forEach(e=>{e.locale===`en`&&e.name&&t.push(e.name)});let n=e.series?.i18n.find(e=>e.locale===`en`);return n?.name&&t.push(n.name.toLowerCase()),e.stockNo&&t.push(e.stockNo[0]),D(e.id,...t)},k=e=>{let t=e;return t.length>0?t[0].trim():``},A=(e=`en`,t,n)=>{if(!t||!n||t.length<=0)return``;let r=[...t].sort(M);if(e){let t=r.findIndex(t=>t.locale===e);if(t){let e=r.splice(t,1);r.unshift(e[0])}}for(let e of r){let t=e[n];if(!(Array.isArray(t)&&t.length===0)&&t)return t}return``},j=(e,t,n)=>{if(!t||!n||t.length<=0)return``;let r=[...t].sort(M);if(e){let t=r.findIndex(t=>t.locale===e);if(t){let e=r.splice(t,1);r.unshift(e[0])}}let i=``;for(let e of r){let t=e[n];if(t){i=String(t);break}}return i},M=(e,t)=>e.priority<t.priority?-1:e.priority>t.priority?1:0,N=(e,t,n)=>{if(e){let r;r=Array.isArray(e)?e[0]:e;try{return t(r)}catch{return n}}return n},P=(e,t)=>{let{[t]:n,...r}=e;return r},F=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!t.includes(e))),I=(e,t)=>(0,r.intersection)(e,t).length>0,L=e=>e.split(`:`).pop()?.split(`.`).pop(),R=(e,...t)=>[e,t].flat().join(`.`).replace(`:.`,`.`),z=(e=`en`,t)=>{if(t.length<=0)return`-`;let n=t[0];return n?B(e,n.i18n):`-`},B=(e=`en`,t)=>{if(t.length===0)return``;let n=A(e,t,`address1`)?.replace(`대한민국`,``)||``,r=t.find(t=>t.locale===e)?.address2,i=[n];return e===`ko`?i.push(r):i.unshift(r),i.filter(Boolean).join(`, `).trim()},V=e=>{let t=0;for(let n of e)t+=n.weight;let n=Math.random()*t,r=0;for(let t of e)if(r+=t.weight,n<r)return t;return e[e.length-1]},H=e=>new Promise(t=>setTimeout(t,e));function U(e,t=0){if(e==0)return`0 Bytes`;let n=1024,r=t,i=[`Bytes`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],a=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/n**+a).toFixed(r))+` `+i[a]}const W=e=>e.split(`.`).slice(0,-1).join(`.`),G=e=>e.split(`.`).pop(),K=(e,t)=>{let n={directory:``,filename:``,extension:``,filenameWithoutExtension:``},r=e.lastIndexOf(`/`),i=r>=0?e.substring(r+1):e,a=i.lastIndexOf(`.`),o=a>0?i.substring(a+1):``,s=a>0?i.substring(0,a):i;if(n.filename=i,n.extension=o,n.filenameWithoutExtension=s,e.startsWith(`http`)){let r=t?`/static/`:`/media/`,i=e.indexOf(r);if(i!==-1){let t=e.substring(i+r.length),a=t.lastIndexOf(`/`);return n.directory=a===-1?``:t.substring(0,a),n}}return n.directory=r===-1?``:e.substring(0,r),n};o.default.extend(s.default);const q=(e,t=`YYYY-MM-DD`,n=`en`)=>{let r=(0,o.default)(e).locale(n);return(0,o.default)().diff(r,`hour`)<12?r.fromNow():r.format(t)},J=(e,t)=>{let n=[];for(let r=e;r<t;r++)n.push(r);return n},Y=(e,t,n=1)=>{let r=[],i=J(e,t);for(;r.length<n;){let t=Math.ceil(e),n=Math.floor(i.length),a=Math.floor(Math.random()*(n-t))+t,o=i.splice(a,1);r.push(o[0])}return[...r]},X=()=>(0,c.customAlphabet)(`0123456789abcdefghijklmnopqrstuvwxyz`,5)(),Z=e=>{for(let t=0;t<e;t++)console.log(X())};exports.appendSearchPath=g,exports.calcPageCount=S,exports.clearQueryByKey=v,exports.clearSearchPath=_,exports.comparePriorityAsc=M,exports.composeKey=R,exports.deleteAllSearchHistory=m,exports.deleteSearchHistory=p,exports.displayDatetime=q,exports.existLeastOne=I,exports.formatBytes=U,exports.formatI18nNumber=E,exports.genNanoID=X,exports.getCookie=l,exports.getFileExtension=G,exports.getFilename=W,exports.getFirstLocationAddress=z,exports.getFullAddress=B,exports.getI18nKey=L,exports.getI18nValue=j,exports.getI18nValues=A,exports.getModelName=k,exports.getSearchHistory=d,exports.insertSearchHistory=f,exports.isSearchPage=h,exports.link=x,exports.loadExLib=w,exports.parsePath=K,exports.parseQuery=N,exports.printNanoID=Z,exports.productSlugify=O,exports.randomNum=Y,exports.recomposeI18nNumber=T,exports.selectItemByWeight=V,exports.setCookies=u,exports.shuffle=C,exports.sleep=H,exports.slugify=D,exports.withoutProperties=F,exports.withoutProperty=P;
1
+ const e=require(`../util-CDkao6z3.cjs`);exports.appendSearchPath=e.P,exports.calcPageCount=e.d,exports.clearQueryByKey=e.F,exports.clearSearchPath=e.I,exports.cn=e.f,exports.comparePriorityAsc=e.p,exports.composeKey=e.m,exports.deleteAllSearchHistory=e.L,exports.deleteSearchHistory=e.R,exports.displayDatetime=e.o,exports.existLeastOne=e.h,exports.formatBytes=e.s,exports.formatI18nNumber=e.g,exports.genNanoID=e.t,exports.generatePage=e.n,exports.generatePageGroup=e.r,exports.getCookie=e.z,exports.getFileExtension=e.c,exports.getFilename=e.l,exports.getFirstLocationAddress=e._,exports.getFullAddress=e.v,exports.getI18nKey=e.y,exports.getI18nValue=e.b,exports.getI18nValues=e.x,exports.getModelName=e.S,exports.getSearchHistory=e.B,exports.insertSearchHistory=e.V,exports.isSearchPage=e.H,exports.link=e.C,exports.loadExLib=e.w,exports.parsePath=e.u,exports.parseQuery=e.T,exports.printNanoID=e.i,exports.productSlugify=e.E,exports.randomNum=e.a,exports.recomposeI18nNumber=e.D,exports.selectItemByWeight=e.O,exports.setCookies=e.U,exports.shuffle=e.k,exports.sleep=e.A,exports.slugify=e.j,exports.withoutProperties=e.M,exports.withoutProperty=e.N;
@@ -62,7 +62,7 @@ declare const getI18nValue: <T extends {
62
62
  }>(locale?: string, values?: T[], key?: keyof T) => string;
63
63
  declare const comparePriorityAsc: <T extends {
64
64
  priority: number;
65
- }>(a: T, b: T) => 1 | 0 | -1;
65
+ }>(a: T, b: T) => 0 | 1 | -1;
66
66
  declare const parseQuery: <T, F = T>(q: string | string[] | undefined | null, conv: (v: string) => T, fallback: F) => T | F;
67
67
  declare const withoutProperty: <T>(obj: T, property: keyof T) => Omit<T, keyof T>;
68
68
  declare const withoutProperties: <T extends Record<string, unknown>>(obj: T, properties: Array<keyof T>) => T;
@@ -82,6 +82,7 @@ declare const selectItemByWeight: <T extends {
82
82
  weight: number;
83
83
  }>(itemsWithWeights: T[]) => T;
84
84
  declare const sleep: (ms: number) => Promise<unknown>;
85
+ declare const cn: (...classes: Array<string | false | null | undefined>) => string;
85
86
  //#endregion
86
87
  //#region src/util/file.d.ts
87
88
  declare function formatBytes(bytes: number, decimals?: number): string;
@@ -93,7 +94,7 @@ interface PathInfo {
93
94
  extension: string;
94
95
  filenameWithoutExtension: string;
95
96
  }
96
- declare const parsePath: (filepath: string, isStatic?: boolean) => PathInfo;
97
+ declare const parsePath: (filepath: string, folder?: string) => PathInfo;
97
98
  //#endregion
98
99
  //#region src/util/date.d.ts
99
100
  declare const displayDatetime: (date: string, format?: string, locale?: string) => string;
@@ -102,5 +103,17 @@ declare const displayDatetime: (date: string, format?: string, locale?: string)
102
103
  declare const randomNum: (min: number, max: number, count?: number) => number[];
103
104
  declare const genNanoID: () => string;
104
105
  declare const printNanoID: (cnt: number) => void;
106
+ declare const generatePage: (count: number, page: number, pagePerView: number) => {
107
+ current: number;
108
+ start: number;
109
+ end: number;
110
+ };
111
+ declare const generatePageGroup: (count: number, page: number, pagePerView: number) => {
112
+ prev: number;
113
+ next: number;
114
+ isPrev: boolean;
115
+ isNext: boolean;
116
+ items: number[];
117
+ };
105
118
  //#endregion
106
- export { I18nNumberProps, appendSearchPath, calcPageCount, clearQueryByKey, clearSearchPath, comparePriorityAsc, composeKey, deleteAllSearchHistory, deleteSearchHistory, displayDatetime, existLeastOne, formatBytes, formatI18nNumber, genNanoID, getCookie, getFileExtension, getFilename, getFirstLocationAddress, getFullAddress, getI18nKey, getI18nValue, getI18nValues, getModelName, getSearchHistory, insertSearchHistory, isSearchPage, link, loadExLib, parsePath, parseQuery, printNanoID, productSlugify, randomNum, recomposeI18nNumber, selectItemByWeight, setCookies, shuffle, sleep, slugify, withoutProperties, withoutProperty };
119
+ export { I18nNumberProps, appendSearchPath, calcPageCount, clearQueryByKey, clearSearchPath, cn, comparePriorityAsc, composeKey, deleteAllSearchHistory, deleteSearchHistory, displayDatetime, existLeastOne, formatBytes, formatI18nNumber, genNanoID, generatePage, generatePageGroup, getCookie, getFileExtension, getFilename, getFirstLocationAddress, getFullAddress, getI18nKey, getI18nValue, getI18nValues, getModelName, getSearchHistory, insertSearchHistory, isSearchPage, link, loadExLib, parsePath, parseQuery, printNanoID, productSlugify, randomNum, recomposeI18nNumber, selectItemByWeight, setCookies, shuffle, sleep, slugify, withoutProperties, withoutProperty };
@@ -64,7 +64,7 @@ declare const getI18nValue: <T extends {
64
64
  }>(locale?: string, values?: T[], key?: keyof T) => string;
65
65
  declare const comparePriorityAsc: <T extends {
66
66
  priority: number;
67
- }>(a: T, b: T) => 1 | 0 | -1;
67
+ }>(a: T, b: T) => 0 | 1 | -1;
68
68
  declare const parseQuery: <T, F = T>(q: string | string[] | undefined | null, conv: (v: string) => T, fallback: F) => T | F;
69
69
  declare const withoutProperty: <T>(obj: T, property: keyof T) => Omit<T, keyof T>;
70
70
  declare const withoutProperties: <T extends Record<string, unknown>>(obj: T, properties: Array<keyof T>) => T;
@@ -84,6 +84,7 @@ declare const selectItemByWeight: <T extends {
84
84
  weight: number;
85
85
  }>(itemsWithWeights: T[]) => T;
86
86
  declare const sleep: (ms: number) => Promise<unknown>;
87
+ declare const cn: (...classes: Array<string | false | null | undefined>) => string;
87
88
  //#endregion
88
89
  //#region src/util/file.d.ts
89
90
  declare function formatBytes(bytes: number, decimals?: number): string;
@@ -95,7 +96,7 @@ interface PathInfo {
95
96
  extension: string;
96
97
  filenameWithoutExtension: string;
97
98
  }
98
- declare const parsePath: (filepath: string, isStatic?: boolean) => PathInfo;
99
+ declare const parsePath: (filepath: string, folder?: string) => PathInfo;
99
100
  //#endregion
100
101
  //#region src/util/date.d.ts
101
102
  declare const displayDatetime: (date: string, format?: string, locale?: string) => string;
@@ -104,5 +105,17 @@ declare const displayDatetime: (date: string, format?: string, locale?: string)
104
105
  declare const randomNum: (min: number, max: number, count?: number) => number[];
105
106
  declare const genNanoID: () => string;
106
107
  declare const printNanoID: (cnt: number) => void;
108
+ declare const generatePage: (count: number, page: number, pagePerView: number) => {
109
+ current: number;
110
+ start: number;
111
+ end: number;
112
+ };
113
+ declare const generatePageGroup: (count: number, page: number, pagePerView: number) => {
114
+ prev: number;
115
+ next: number;
116
+ isPrev: boolean;
117
+ isNext: boolean;
118
+ items: number[];
119
+ };
107
120
  //#endregion
108
- export { I18nNumberProps, appendSearchPath, calcPageCount, clearQueryByKey, clearSearchPath, comparePriorityAsc, composeKey, deleteAllSearchHistory, deleteSearchHistory, displayDatetime, existLeastOne, formatBytes, formatI18nNumber, genNanoID, getCookie, getFileExtension, getFilename, getFirstLocationAddress, getFullAddress, getI18nKey, getI18nValue, getI18nValues, getModelName, getSearchHistory, insertSearchHistory, isSearchPage, link, loadExLib, parsePath, parseQuery, printNanoID, productSlugify, randomNum, recomposeI18nNumber, selectItemByWeight, setCookies, shuffle, sleep, slugify, withoutProperties, withoutProperty };
121
+ export { I18nNumberProps, appendSearchPath, calcPageCount, clearQueryByKey, clearSearchPath, cn, comparePriorityAsc, composeKey, deleteAllSearchHistory, deleteSearchHistory, displayDatetime, existLeastOne, formatBytes, formatI18nNumber, genNanoID, generatePage, generatePageGroup, getCookie, getFileExtension, getFilename, getFirstLocationAddress, getFullAddress, getI18nKey, getI18nValue, getI18nValues, getModelName, getSearchHistory, insertSearchHistory, isSearchPage, link, loadExLib, parsePath, parseQuery, printNanoID, productSlugify, randomNum, recomposeI18nNumber, selectItemByWeight, setCookies, shuffle, sleep, slugify, withoutProperties, withoutProperty };
@@ -1 +1 @@
1
- import e from"js-cookie";import t from"query-string";import{intersection as n,uniq as r}from"lodash-es";import i from"slug";import a from"google-libphonenumber";import o from"dayjs";import"dayjs/locale/ko.js";import s from"dayjs/plugin/relativeTime.js";import{customAlphabet as c}from"nanoid";const l=t=>e.get(t),u=(t,n,r)=>e.set(t,n,r),d=()=>typeof window>`u`?[]:JSON.parse(localStorage.getItem(`search-history`)||`[]`),f=e=>{let t=r([e,...d()]).slice(0,10);return localStorage.setItem(`search-history`,JSON.stringify(t)),t},p=e=>{let t=d();return t.splice(e,1),localStorage.setItem(`search-history`,JSON.stringify(t)),t},m=()=>{localStorage.setItem(`search-history`,JSON.stringify([]))},h=e=>e.endsWith(`/search`),g=e=>h(e)?e:`${e}/search`.replace(`//`,`/`),_=e=>e.replace(`/search`,``).replace(`//`,`/`),v=(e,t)=>{let n=new URLSearchParams(e);return n.delete(t),Object.fromEntries(n)},y=a.PhoneNumberFormat,b=a.PhoneNumberUtil.getInstance();i.extend({'"':`-`,"”":`-`,"“":`-`,"•":`----`}),i.setLocale(`en`);const x=(e,n=[])=>{if(typeof window>`u`)return``;let{hash:r,search:i}=window.location,a=t.parse(i);Object.keys(e).forEach(t=>{e[t]?a[t]=e[t]:delete a[t]});let o={...a};return Object.keys(a).forEach(e=>{n.includes(e)&&delete o[e]}),`?${t.stringify(o,{encode:!0})}${r}`},S=(e,t)=>{let n=0;return e%t===0&&(n=e/t),n=Math.ceil(e/t),n<1&&(n=1),n},C=e=>{let t=[...e];for(let e=t.length-1;e>0;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t},w=e=>{let t=document.getElementById(`naverMapLib`);if(!t){let t=document.createElement(`script`);t.src=`https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=ecs1pyoo9b`,t.id=`naverMapLib`,document.body.appendChild(t),t.onload=()=>{e&&e()}}t&&e&&e()},T=(e,t,n)=>t?e===`ko`&&n&&n!==`82`||e!==`ko`&&n?`+${n}-${t.replace(/^0/,``)}`:t:`-`,E=({phone:e,country:t={callingCode:`82`,alpha2Code:`KR`},format:n=y.INTERNATIONAL,locale:r})=>{if(!e||e===`-`)return`-`;try{let i=b.parseAndKeepRawInput(e,t?.alpha2Code||`KR`),a=i.getCountryCode();return r===`ko`&&t?.alpha2Code===`KR`&&a===82?b.format(i,y.NATIONAL):b.format(i,n)}catch{return T(r||`en`,e,t?.callingCode)}},D=(e,...t)=>{let n=`${e}`;return t.forEach(e=>{e&&(n=`${n}-${i(e)}`)}),n},O=e=>{let t=[];e.i18n?.forEach(e=>{e.locale===`en`&&e.name&&t.push(e.name)});let n=e.series?.i18n.find(e=>e.locale===`en`);return n?.name&&t.push(n.name.toLowerCase()),e.stockNo&&t.push(e.stockNo[0]),D(e.id,...t)},k=e=>{let t=e;return t.length>0?t[0].trim():``},A=(e=`en`,t,n)=>{if(!t||!n||t.length<=0)return``;let r=[...t].sort(M);if(e){let t=r.findIndex(t=>t.locale===e);if(t){let e=r.splice(t,1);r.unshift(e[0])}}for(let e of r){let t=e[n];if(!(Array.isArray(t)&&t.length===0)&&t)return t}return``},j=(e,t,n)=>{if(!t||!n||t.length<=0)return``;let r=[...t].sort(M);if(e){let t=r.findIndex(t=>t.locale===e);if(t){let e=r.splice(t,1);r.unshift(e[0])}}let i=``;for(let e of r){let t=e[n];if(t){i=String(t);break}}return i},M=(e,t)=>e.priority<t.priority?-1:e.priority>t.priority?1:0,N=(e,t,n)=>{if(e){let r;r=Array.isArray(e)?e[0]:e;try{return t(r)}catch{return n}}return n},P=(e,t)=>{let{[t]:n,...r}=e;return r},F=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!t.includes(e))),I=(e,t)=>n(e,t).length>0,L=e=>e.split(`:`).pop()?.split(`.`).pop(),R=(e,...t)=>[e,t].flat().join(`.`).replace(`:.`,`.`),z=(e=`en`,t)=>{if(t.length<=0)return`-`;let n=t[0];return n?B(e,n.i18n):`-`},B=(e=`en`,t)=>{if(t.length===0)return``;let n=A(e,t,`address1`)?.replace(`대한민국`,``)||``,r=t.find(t=>t.locale===e)?.address2,i=[n];return e===`ko`?i.push(r):i.unshift(r),i.filter(Boolean).join(`, `).trim()},V=e=>{let t=0;for(let n of e)t+=n.weight;let n=Math.random()*t,r=0;for(let t of e)if(r+=t.weight,n<r)return t;return e[e.length-1]},H=e=>new Promise(t=>setTimeout(t,e));function U(e,t=0){if(e==0)return`0 Bytes`;let n=1024,r=t,i=[`Bytes`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],a=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/n**+a).toFixed(r))+` `+i[a]}const W=e=>e.split(`.`).slice(0,-1).join(`.`),G=e=>e.split(`.`).pop(),K=(e,t)=>{let n={directory:``,filename:``,extension:``,filenameWithoutExtension:``},r=e.lastIndexOf(`/`),i=r>=0?e.substring(r+1):e,a=i.lastIndexOf(`.`),o=a>0?i.substring(a+1):``,s=a>0?i.substring(0,a):i;if(n.filename=i,n.extension=o,n.filenameWithoutExtension=s,e.startsWith(`http`)){let r=t?`/static/`:`/media/`,i=e.indexOf(r);if(i!==-1){let t=e.substring(i+r.length),a=t.lastIndexOf(`/`);return n.directory=a===-1?``:t.substring(0,a),n}}return n.directory=r===-1?``:e.substring(0,r),n};o.extend(s);const q=(e,t=`YYYY-MM-DD`,n=`en`)=>{let r=o(e).locale(n);return o().diff(r,`hour`)<12?r.fromNow():r.format(t)},J=(e,t)=>{let n=[];for(let r=e;r<t;r++)n.push(r);return n},Y=(e,t,n=1)=>{let r=[],i=J(e,t);for(;r.length<n;){let t=Math.ceil(e),n=Math.floor(i.length),a=Math.floor(Math.random()*(n-t))+t,o=i.splice(a,1);r.push(o[0])}return[...r]},X=()=>c(`0123456789abcdefghijklmnopqrstuvwxyz`,5)(),Z=e=>{for(let t=0;t<e;t++)console.log(X())};export{g as appendSearchPath,S as calcPageCount,v as clearQueryByKey,_ as clearSearchPath,M as comparePriorityAsc,R as composeKey,m as deleteAllSearchHistory,p as deleteSearchHistory,q as displayDatetime,I as existLeastOne,U as formatBytes,E as formatI18nNumber,X as genNanoID,l as getCookie,G as getFileExtension,W as getFilename,z as getFirstLocationAddress,B as getFullAddress,L as getI18nKey,j as getI18nValue,A as getI18nValues,k as getModelName,d as getSearchHistory,f as insertSearchHistory,h as isSearchPage,x as link,w as loadExLib,K as parsePath,N as parseQuery,Z as printNanoID,O as productSlugify,Y as randomNum,T as recomposeI18nNumber,V as selectItemByWeight,u as setCookies,C as shuffle,H as sleep,D as slugify,F as withoutProperties,P as withoutProperty};
1
+ import{A as e,B as t,C as n,D as r,E as i,F as a,H as o,I as s,L as c,M as l,N as u,O as d,P as f,R as p,S as m,T as h,U as g,V as _,_ as v,a as y,b,c as x,d as S,f as C,g as w,h as T,i as E,j as D,k as O,l as k,m as A,n as j,o as M,p as N,r as P,s as F,t as I,u as L,v as R,w as z,x as B,y as V,z as H}from"../util-DCPr_-5a.mjs";export{f as appendSearchPath,S as calcPageCount,a as clearQueryByKey,s as clearSearchPath,C as cn,N as comparePriorityAsc,A as composeKey,c as deleteAllSearchHistory,p as deleteSearchHistory,M as displayDatetime,T as existLeastOne,F as formatBytes,w as formatI18nNumber,I as genNanoID,j as generatePage,P as generatePageGroup,H as getCookie,x as getFileExtension,k as getFilename,v as getFirstLocationAddress,R as getFullAddress,V as getI18nKey,b as getI18nValue,B as getI18nValues,m as getModelName,t as getSearchHistory,_ as insertSearchHistory,o as isSearchPage,n as link,z as loadExLib,L as parsePath,h as parseQuery,E as printNanoID,i as productSlugify,y as randomNum,r as recomposeI18nNumber,d as selectItemByWeight,g as setCookies,O as shuffle,e as sleep,D as slugify,l as withoutProperties,u as withoutProperty};