@pop-ui/core 0.0.40 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.umd.cjs CHANGED
@@ -1,6 +1,8 @@
1
- (function(f,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@mantine/core"),require("react"),require("@pop-ui/foundation"),require("@mantine/notifications"),require("@mantine/dates"),require("dayjs"),require("dayjs/locale/ko"),require("@mantine/dropzone")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@mantine/core","react","@pop-ui/foundation","@mantine/notifications","@mantine/dates","dayjs","dayjs/locale/ko","@mantine/dropzone"],a):(f=typeof globalThis<"u"?globalThis:f||self,a(f.Core={},f.jsxRuntime,f.MantineCore,f.React,f.foundation,f.notifications,f.dates,f.dayjs,null,f.dropzone))})(this,function(f,a,x,m,i,O,z,v,ot,R){"use strict";const me={primary:i.TextColorButtonTextPrimaryDefault,primaryLine:i.TextColorButtonTextPrimarylineDefault,basic:i.TextColorButtonTextBasicDefault,danger:i.TextColorButtonTextPrimaryDefault,setting:i.TextColorButtonTextPrimaryDefault,warning:i.TextColorButtonTextPrimaryDefault},ge={primary:{default:{backgroundColor:i.BgColorButtonBgPrimaryDefault,color:i.TextColorButtonTextPrimaryDefault,border:"none"},hover:{backgroundColor:i.BgColorButtonBgPrimaryHover,color:i.TextColorButtonTextPrimaryHover},active:{backgroundColor:i.BgColorButtonBgPrimaryPressed,color:i.TextColorButtonTextPrimaryPressed},focus:{backgroundColor:i.BgColorButtonBgPrimaryFocused,color:i.TextColorButtonTextPrimaryFocused},disabled:{backgroundColor:i.BgColorButtonBgPrimaryDisabled,color:i.TextColorButtonTextPrimaryDisabled,cursor:"not-allowed"}},primaryLine:{default:{backgroundColor:i.BgColorButtonBgPrimarylineDefault,color:i.TextColorButtonTextPrimarylineDefault,border:`1px solid ${i.BorderColorButtonBorderPrimarylineDefault}`},hover:{backgroundColor:i.BgColorButtonBgPrimarylineHover,color:i.TextColorButtonTextPrimarylineHover,borderColor:i.BorderColorButtonBorderPrimarylineHover},active:{backgroundColor:i.BgColorButtonBgPrimarylinePressed,color:i.TextColorButtonTextPrimarylinePressed,borderColor:i.BorderColorButtonBorderPrimarylinePressed},focus:{backgroundColor:i.BgColorButtonBgPrimarylineFocused,color:i.TextColorButtonTextPrimarylineFocused,borderColor:i.BorderColorButtonBorderPrimarylineFocused},disabled:{backgroundColor:i.BgColorButtonBgPrimarylineDisabled,color:i.TextColorButtonTextPrimarylineDisabled,cursor:"not-allowed"}},basic:{default:{backgroundColor:i.BgColorButtonBgBasicDefault,color:i.TextColorButtonTextBasicDefault,border:`1px solid ${i.BorderColorButtonBorderBasicDefault}`},hover:{backgroundColor:i.BgColorButtonBgBasicHover,color:i.TextColorButtonTextBasicHover,borderColor:i.BorderColorButtonBorderBasicHover},active:{backgroundColor:i.BgColorButtonBgBasicPreseed,color:i.TextColorButtonTextBasicPressed,borderColor:i.BorderColorButtonBorderBasicPressed},focus:{backgroundColor:i.BgColorButtonBgBasicFocused,color:i.TextColorButtonTextBasicFocused,borderColor:i.BorderColorButtonBorderBasicFocused},disabled:{backgroundColor:i.BgColorButtonBgBasicDisabled,color:i.TextColorButtonTextBasicDisabled,cursor:"not-allowed"}},danger:{default:{backgroundColor:i.BgColorButtonBgWarningDefault,color:i.TextColorButtonTextWarningDefault,border:"none"},hover:{backgroundColor:i.BgColorButtonBgWarningHover,color:i.TextColorButtonTextWarningHover},active:{backgroundColor:i.BgColorButtonBgWarningPressed,color:i.TextColorButtonTextWarningPressed},focus:{backgroundColor:i.BgColorButtonBgWarningFocused,color:i.TextColorButtonTextWarningFocused},disabled:{backgroundColor:i.BgColorButtonBgWarningDisabled,color:i.TextColorButtonTextWarningDisabled,cursor:"not-allowed"}},setting:{default:{backgroundColor:i.BgColorButtonBgSettingDefault,color:i.TextColorButtonTextSettingDefault,border:"none"},hover:{backgroundColor:i.BgColorButtonBgSettingHover,color:i.TextColorButtonTextSettingHover},active:{backgroundColor:i.BgColorButtonBgSettingPressed,color:i.TextColorButtonTextSettingPressed},focus:{backgroundColor:i.BgColorButtonBgSettingFocused,color:i.TextColorButtonTextSettingFocused},disabled:{backgroundColor:i.BgColorButtonBgSettingDisabled,color:i.TextColorButtonTextSettingDisabled,cursor:"not-allowed"}},warning:{default:{backgroundColor:i.BgColorButtonBgWarningDefault,color:i.TextColorButtonTextWarningDefault,border:"none"},hover:{backgroundColor:i.BgColorButtonBgWarningHover,color:i.TextColorButtonTextWarningHover},active:{backgroundColor:i.BgColorButtonBgWarningPressed,color:i.TextColorButtonTextWarningPressed},focus:{backgroundColor:i.BgColorButtonBgWarningFocused,color:i.TextColorButtonTextWarningFocused},disabled:{backgroundColor:i.BgColorButtonBgWarningDisabled,color:i.TextColorButtonTextWarningDisabled,cursor:"not-allowed"}}},he={lg:{height:"50px",padding:"0 20px",fontSize:"18px",fontWeight:700,borderRadius:"6px",lineHeight:"130%",fontFamily:"Pretendard"},md:{height:"40px",padding:"0 16px",fontSize:"16px",fontWeight:600,borderRadius:"6px",lineHeight:"130%",fontFamily:"Pretendard"},sm:{height:"30px",padding:"0 12px",fontSize:"14px",fontWeight:600,borderRadius:"4px",lineHeight:"130%",fontFamily:"Pretendard"}};function fe(t,s){const r=ge[t];return{root:{...he[s],...r.default,"&:hover:not(:disabled)":r.hover,"&:active:not(:disabled)":r.active,"&:focus:not(:disabled)":r.focus,"&:disabled":r.disabled}}}function ee({children:t,size:s="md",variant:r="primary",isLoading:e=!1,disabled:o=!1,...l}){const n=m.useMemo(()=>fe(r,s),[r,s]),c=me[r],d=m.useMemo(()=>{switch(s){case"lg":return 18;case"sm":return 14;case"md":default:return 16}},[s]);return a.jsx(x.Button,{type:"button",styles:n,disabled:o||e,...l,children:e?a.jsx(x.Loader,{color:c,size:d}):t})}const U={"Checkbox--Small":"styles-module__Checkbox--Small___VZGlw","Checkbox--Medium":"styles-module__Checkbox--Medium___Vwpa3","Checkbox--Large":"styles-module__Checkbox--Large___ybTGE"},Ce=({size:t="md",...s})=>{let r=U["Checkbox--Medium"],e=24;return t==="sm"?(r=U["Checkbox--Small"],e=18):t==="lg"&&(r=U["Checkbox--Large"],e=32),a.jsx(x.Checkbox,{className:r,styles:{inner:{width:e,height:e}},...s})},P={datePickerWrapper:"styles-module__datePickerWrapper___8Bdcn",todayIndicator:"styles-module__todayIndicator___Zl0e4",day:"styles-module__day___DaYHh",calendarHeader:"styles-module__calendarHeader___9j1oi",calendarHeaderLevel:"styles-module__calendarHeaderLevel___wHs50",calendarHeaderControl:"styles-module__calendarHeaderControl___k317W",month:"styles-module__month___doF-A",monthRow:"styles-module__monthRow___ksziO",weekday:"styles-module__weekday___PVnxV"},xe=({excludedDays:t=[],excludedDates:s=[]})=>{const r=[],e=[];for(const n of s)typeof n=="string"?r.push(n):e.push(n);const o=r.map(n=>v(n)).filter(n=>n.isValid()).map(n=>n.format("YYYY-MM-DD")),l=e.map(([n,c])=>[v(n),v(c)]).filter(([n,c])=>n.isValid()&&c.isValid());return n=>{const c=v(n);if(!c.isValid())return!1;if(Array.isArray(t)&&t.includes(c.day())||o.includes(c.format("YYYY-MM-DD")))return!0;for(const[d,h]of l)if((c.isSame(d,"day")||c.isAfter(d,"day"))&&(c.isSame(h,"day")||c.isBefore(h,"day")))return!0;return!1}},ye=(t,s,r,e)=>{const o=v(t),l=v(s);for(const n of r)if(Array.isArray(n)){const c=v(n[0]),d=v(n[1]);if(!c.isValid()||!d.isValid())continue;if(!(l.isBefore(c,"day")||o.isAfter(d,"day")))return!0}for(const n of r)if(typeof n=="string"){const c=v(n);if(!c.isValid())continue;if((c.isSame(o,"day")||c.isAfter(o,"day"))&&(c.isSame(l,"day")||c.isBefore(l,"day")))return!0}if(e.length>0){let n=o;for(;n.isBefore(l,"day")||n.isSame(l,"day");){if(e.includes(n.day()))return!0;n=n.add(1,"day")}}return!1},A=(t="default")=>{switch(t){case"range":return[null,null];case"multiple":return[];default:return null}},te=(t="default",s)=>s==null?A(t):t==="range"?Array.isArray(s)?s:A("range"):t==="multiple"?Array.isArray(s)?s:A("multiple"):Array.isArray(s)?s[0]??null:s,Te=({type:t,externalValue:s,internalValue:r})=>s!==void 0?te(t,s):r!==void 0?te(t,r):A(t),Be=(t,s)=>{const r=(e,o)=>{const l=Object.keys(e).reduce((n,c)=>{const d=c,h=e[d],u=o[d],_=[h,u].filter(Boolean).join(" ");return _&&(n[d]=_),n},{});return Object.keys(o).forEach(n=>{const c=n,d=o[c];!(c in e)&&d&&(l[c]=d)}),l};return typeof s=="function"?(e,o,l)=>r(t,s(e,o,l)):typeof s=="object"&&s!==null&&!Array.isArray(s)?r(t,s):t},be={levelsGroup:P.datePickerWrapper,calendarHeader:P.calendarHeader,calendarHeaderLevel:P.calendarHeaderLevel,calendarHeaderControl:P.calendarHeaderControl,month:P.month,day:P.day,monthRow:P.monthRow,weekday:P.weekday},ke=({excludedDates:t=[],excludedDays:s=[],type:r="default",value:e,onChange:o,highlightToday:l=!1,...n})=>{const[c,d]=m.useState(()=>e??A(r)),h=m.useMemo(()=>xe({excludedDays:s,excludedDates:t}),[s,t]),u=T=>{if(r==="range"&&Array.isArray(T)&&T.length===2){const[B,S]=T;if(B&&S&&ye(B,S,t,s)){const L=A("range");d(L),o?.(L);return}}d(T),o?.(T)},_=Te({type:r,externalValue:e,internalValue:c}),g=m.useCallback(T=>{const B=v(T).date(),L=v(T).isSame(v(),"day")&&l;return a.jsxs(a.Fragment,{children:[B,L&&a.jsx("span",{className:P.todayIndicator,children:"오늘"})]})},[l]),{classNames:p,...C}=n,y=Be(be,p);return a.jsx(z.DatePicker,{locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 M월",maxLevel:"month",type:r,previousIcon:a.jsx(i.IconChevronLeft,{}),nextIcon:a.jsx(i.IconChevronRight,{}),...C,size:"lg",onChange:u,weekendDays:[0],highlightToday:l,classNames:y,value:_,excludeDate:h,renderDay:g})},Z={"DatePicker--Small":"styles-module__DatePicker--Small___m8asv","DatePicker--Medium":"styles-module__DatePicker--Medium___Po2-B","DatePicker--Large":"styles-module__DatePicker--Large___oQ6EM"},Me=({size:t="md",type:s="default",withTime:r,...e})=>{let o=Z["DatePicker--Medium"],l=18;return t==="sm"?(o=Z["DatePicker--Small"],l=14):t==="lg"&&(o=Z["DatePicker--Large"],l=24),r?a.jsx(z.DateTimePicker,{className:o,size:t,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD | a hh:mm",rightSection:a.jsx(i.IconCalendar,{size:l}),...e}):a.jsx(z.DatePickerInput,{className:o,type:s,size:t,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD",rightSection:a.jsx(i.IconCalendar,{size:l}),...e})},w={"Dropdown--LeftLabel":"styles-module__Dropdown--LeftLabel___SFObq","Dropdown--TopLabel":"styles-module__Dropdown--TopLabel___-lPhr","Dropdown__Label--Small":"styles-module__Dropdown__Label--Small___xbzOR","Dropdown__Label--Medium":"styles-module__Dropdown__Label--Medium___YtJ2-","Dropdown__Label--Large":"styles-module__Dropdown__Label--Large___sCiJv","Dropdown__Tooltip--Small":"styles-module__Dropdown__Tooltip--Small___rkmaO","Dropdown__Tooltip--Medium":"styles-module__Dropdown__Tooltip--Medium___JTfzy","Dropdown__Tooltip--Large":"styles-module__Dropdown__Tooltip--Large___W-sUq","Dropdown--Small":"styles-module__Dropdown--Small___dRIK7","Dropdown--Medium":"styles-module__Dropdown--Medium___-HZoU","Dropdown--Large":"styles-module__Dropdown--Large___BvV3M",Dropdown__Description:"styles-module__Dropdown__Description___OQ8bF",Dropdown__ErrorMsg:"styles-module__Dropdown__ErrorMsg___xTP0Y"},Se=({label:t,labelPosition:s="top",size:r="md",required:e,tooltip:o,tooltipPosition:l="top",errorMsg:n,description:c,...d})=>{const[h,u]=m.useState(!1);let _=w["Dropdown__Label--Medium"],g=w["Dropdown--Medium"],p=w["Dropdown__Tooltip--Medium"],C=18;return r==="sm"?(_=w["Dropdown__Label--Small"],g=w["Dropdown--Small"],p=w["Dropdown__Tooltip--Small"],C=14):r==="lg"&&(_=w["Dropdown__Label--Large"],g=w["Dropdown--Large"],p=w["Dropdown__Tooltip--Large"],C=24),a.jsxs("div",{className:s==="top"?w["Dropdown--TopLabel"]:w["Dropdown--LeftLabel"],children:[a.jsxs("div",{children:[t&&a.jsx(x.Input.Label,{required:e,className:_,children:t}),o&&a.jsx(x.Tooltip,{label:o,position:l,children:a.jsx("div",{className:p,children:a.jsx(i.IconInfoCircle,{size:r==="sm"?14:r==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx(x.Select,{...d,size:r,error:n,className:g,rightSection:h?a.jsx(i.IconChevronUp,{size:C}):a.jsx(i.IconChevronDown,{size:C}),onDropdownOpen:()=>u(!0),onDropdownClose:()=>u(!1),styles:{option:{"&[data-selected]":{"&, &:hover":{backgroundColor:"#e7e7e7",color:"#000000"}}}}}),c&&a.jsx(x.Input.Description,{className:w.Dropdown__Description,children:c}),n&&a.jsx(x.Input.Error,{className:w.Dropdown__ErrorMsg,children:n})]})]})},H={ImageUploader:"styles-module__ImageUploader___pO3AP",ImageUploader__Preview:"styles-module__ImageUploader__Preview___DI5K4",ImageUploader__Wrapper:"styles-module__ImageUploader__Wrapper___SpAGM",ImageUploader__FileClearButton:"styles-module__ImageUploader__FileClearButton___w1HyS"},we=({width:t,height:s,defaultMsg:r="이미지 업로드",file:e,onDrop:o,showClearButton:l,onClear:n,...c})=>{const[d,h]=m.useState(e),u=m.useCallback(()=>{h(void 0),n&&n()},[n]);return a.jsxs("div",{className:H.ImageUploader__Wrapper,children:[l&&d?a.jsx("div",{className:H.ImageUploader__FileClearButton,onClick:u,children:a.jsx(i.IconCloseCircle,{size:24})}):null,a.jsx(R.Dropzone,{...c,maxFiles:1,className:H.ImageUploader,accept:R.IMAGE_MIME_TYPE,onDrop:_=>{h(_[0]),o&&o(_)},style:{width:t,height:s},children:a.jsx(a.Fragment,{children:d?a.jsx("img",{className:H.ImageUploader__Preview,src:typeof d=="string"?d:URL.createObjectURL(d),alt:`파일명: ${typeof d=="string"?d:d.name}`,title:`파일명: ${typeof d=="string"?d:d.name}`}):a.jsxs("div",{children:[a.jsx(i.IconPhoto,{size:48}),a.jsx("span",{children:r})]})})})]})},ve=({size:t="md",width:s,withCloseButton:r=!1,...e})=>{let o=768;return t==="xs"?o=360:t==="sm"?o=544:t==="lg"?o=1e3:t==="xl"&&(o=1200),a.jsx(x.Modal,{size:s||o,withCloseButton:r,...e})},$={Pagination:"style-module__Pagination___xcR-Q",Pagination__PageIndex:"style-module__Pagination__PageIndex___50SZJ","Pagination__PageIndex--Active":"style-module__Pagination__PageIndex--Active___mSIwS",Pagination__Arrow:"style-module__Pagination__Arrow___74vp3"},Ie=({currentPageIdx:t,rowsPerPage:s,totalLength:r,paginationSize:e,onPageChange:o,...l})=>{const[n,c]=m.useState(t),d=s||50,h=r||1,u=e||5;m.useEffect(()=>{c(t)},[t]);const _=()=>{o&&o(n-(n%u+1)),c(p=>p-(p%u+1))},g=()=>{o&&o(n+u-n%u),c(p=>p+u-p%u)};return a.jsxs("div",{...l,className:$.Pagination,children:[n>=u?a.jsx("button",{className:$.Pagination__Arrow,onClick:_,children:a.jsx(i.IconChevronLeft,{size:20})}):null,new Array(u).fill(0).map((p,C)=>{const y=Math.floor(n/u)*u+C+1;if(!(y>Math.ceil(h/d)))return a.jsx("button",{className:n===y-1?$["Pagination__PageIndex--Active"]:$.Pagination__PageIndex,onClick:()=>{c(y-1),o&&o(y-1)},children:y},`pagination_${C}`)}),Math.floor(n/u)*u+u<Math.ceil(h/d)?a.jsx("button",{className:$.Pagination__Arrow,onClick:g,children:a.jsx(i.IconChevronRight,{size:20})}):null]})},Y={"Radio--Small":"styles-module__Radio--Small___izWI2","Radio--Medium":"styles-module__Radio--Medium___dwZfV","Radio--Large":"styles-module__Radio--Large___1gLra"},Le=({size:t="md",...s})=>{let r=Y["Radio--Medium"];return t==="sm"?r=Y["Radio--Small"]:t==="lg"&&(r=Y["Radio--Large"]),a.jsx(x.Radio,{className:r,size:t,...s})},k={"SearchBar--LeftLabel":"styles-module__SearchBar--LeftLabel___CeYTM","SearchBar--TopLabel":"styles-module__SearchBar--TopLabel___spN3I","SearchBar__Label--Small":"styles-module__SearchBar__Label--Small___zS1L2","SearchBar__Label--Medium":"styles-module__SearchBar__Label--Medium___Fk0Ao","SearchBar__Label--Large":"styles-module__SearchBar__Label--Large___xTOYL","SearchBar__Tooltip--Small":"styles-module__SearchBar__Tooltip--Small___YhmEr","SearchBar__Tooltip--Medium":"styles-module__SearchBar__Tooltip--Medium___4JhOv","SearchBar__Tooltip--Large":"styles-module__SearchBar__Tooltip--Large___IEoPv",SearchBar__Wrapper:"styles-module__SearchBar__Wrapper___oq49s","SearchBar--Small":"styles-module__SearchBar--Small___SY9CN","SearchBar--Medium":"styles-module__SearchBar--Medium___vLP08","SearchBar--Large":"styles-module__SearchBar--Large___JHfHP",SearchBar__Description:"styles-module__SearchBar__Description___vucS-",SearchBar__ErrorMsg:"styles-module__SearchBar__ErrorMsg___TOeoy",SearchBar__ClearButton:"styles-module__SearchBar__ClearButton___S-y4P"},Pe=({label:t,labelPosition:s="top",size:r="md",required:e,tooltip:o,tooltipPosition:l="top",errorMsg:n,description:c,onChange:d,onClear:h,...u})=>{const[_,g]=m.useState(0);let p=k["SearchBar__Label--Medium"],C=k["SearchBar--Medium"],y=k["SearchBar__Tooltip--Medium"];r==="sm"?(p=k["SearchBar__Label--Small"],C=k["SearchBar--Small"],y=k["SearchBar__Tooltip--Small"]):r==="lg"&&(p=k["SearchBar__Label--Large"],C=k["SearchBar--Large"],y=k["SearchBar__Tooltip--Large"]);const T=m.useCallback(B=>{d&&(g(B?.length),d(B))},[d]);return a.jsxs("div",{className:s==="top"?k["SearchBar--TopLabel"]:k["SearchBar--LeftLabel"],children:[a.jsxs("div",{children:[t&&a.jsx(x.Input.Label,{required:e,className:p,children:t}),o&&a.jsx(x.Tooltip,{label:o,position:l,children:a.jsx("div",{className:y,children:a.jsx(i.IconInfoCircle,{size:r==="sm"?14:r==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx("div",{className:k.SearchBar__Wrapper,children:a.jsx(x.Autocomplete,{...u,size:r,error:n,className:C,onChange:T,leftSection:a.jsx(i.IconSearch,{size:r==="sm"?16:r==="lg"?24:20}),rightSection:h&&_>0?a.jsx("div",{className:k.SearchBar__ClearButton,onClick:h,children:a.jsx(i.IconClose,{size:r==="sm"?16:r==="lg"?24:20})}):void 0})}),c&&a.jsx(x.Input.Description,{className:k.SearchBar__Description,children:c}),n&&a.jsx(x.Input.Error,{className:k.SearchBar__ErrorMsg,children:n})]})]})},V={"SegmentButton--Small":"styles-module__SegmentButton--Small___o0Y3t","SegmentButton--Medium":"styles-module__SegmentButton--Medium___EgCJm","SegmentButton--Large":"styles-module__SegmentButton--Large___Ym86C"},De=({size:t="md",radius:s=6,...r})=>{let e=V["SegmentButton--Medium"];return t==="sm"?e=V["SegmentButton--Small"]:t==="lg"&&(e=V["SegmentButton--Large"]),a.jsx(x.SegmentedControl,{className:e,size:t,radius:s,styles:{control:{borderWidth:"0 !important"}},...r})},re={Tab__TitleList:"styles-module__Tab__TitleList___urHWH",Tab__BorderBottom:"styles-module__Tab__BorderBottom___eMTpl"},Fe=({tabList:t=[],containerPaddingTop:s,...r})=>a.jsxs(x.Tabs,{...r,children:[a.jsx(x.Tabs.List,{className:re.Tab__TitleList,children:t?.map((e,o)=>a.jsxs(x.Tabs.Tab,{value:e.value,leftSection:e.icon,children:[e.title,a.jsx("div",{className:re.Tab__BorderBottom})]},`tab_${o}`))}),t?.map((e,o)=>a.jsx(x.Tabs.Panel,{value:e.value,pt:s,children:e.body},`tab_panel_${o}`))]}),b={"TextField--LeftLabel":"styles-module__TextField--LeftLabel___hiNn3","TextField--TopLabel":"styles-module__TextField--TopLabel___V2otc","TextField__Label--Small":"styles-module__TextField__Label--Small___NkKKA","TextField__Label--Medium":"styles-module__TextField__Label--Medium___IoJd-","TextField__Label--Large":"styles-module__TextField__Label--Large___GMy74","TextField__Tooltip--Small":"styles-module__TextField__Tooltip--Small___GmQHE","TextField__Tooltip--Medium":"styles-module__TextField__Tooltip--Medium___5P3nA","TextField__Tooltip--Large":"styles-module__TextField__Tooltip--Large___YSCfu",TextField__Wrapper:"styles-module__TextField__Wrapper___u6p5Z",TextField__TextCounter:"styles-module__TextField__TextCounter___u1jM5","TextField--Textarea":"styles-module__TextField--Textarea___C2DL5","TextField--Small":"styles-module__TextField--Small___iuH4t","TextField--Medium":"styles-module__TextField--Medium___snYod","TextField--Large":"styles-module__TextField--Large___JoSYk",TextField__Description:"styles-module__TextField__Description___J-kXP",TextField__ErrorMsg:"styles-module__TextField__ErrorMsg___fa6f6",TextField__ClearButton:"styles-module__TextField__ClearButton___bB5Ew"},Ee=t=>{const{label:s,labelPosition:r="top",size:e="md",required:o,tooltip:l,tooltipPosition:n="top",errorMsg:c,description:d,textarea:h=!1,maxTextCount:u,onChange:_,onClear:g,...p}=t,C="minRows"in t?t.minRows:void 0,[y,T]=m.useState(0);let B=b["TextField__Label--Medium"],S=b["TextField--Medium"],L=b["TextField__Tooltip--Medium"];e==="sm"?(B=b["TextField__Label--Small"],S=b["TextField--Small"],L=b["TextField__Tooltip--Small"]):e==="lg"&&(B=b["TextField__Label--Large"],S=b["TextField--Large"],L=b["TextField__Tooltip--Large"]);const W=m.useCallback(E=>{if(u){if(E.currentTarget?.value?.length>u)return;T(E.currentTarget?.value?.length),_&&_(E)}_&&(T(E.currentTarget?.value?.length),_(E))},[u,_]);return a.jsxs("div",{className:r==="top"?b["TextField--TopLabel"]:b["TextField--LeftLabel"],children:[a.jsxs("div",{children:[s&&a.jsx(x.Input.Label,{required:o,className:B,children:s}),l&&a.jsx(x.Tooltip,{label:l,position:n,children:a.jsx("div",{className:L,children:a.jsx(i.IconInfoCircle,{size:e==="sm"?14:e==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:b.TextField__Wrapper,children:[h?a.jsx(x.Textarea,{className:b["TextField--Textarea"],size:e,minRows:C,error:c,onChange:W,disabled:p?.disabled,...p}):a.jsx(x.Input,{className:S,error:c,onChange:W,rightSection:g&&y>0?a.jsx("div",{className:b.TextField__ClearButton,onClick:g,children:a.jsx(i.IconClose,{size:e==="sm"?16:e==="lg"?24:20})}):void 0,...p}),u&&u>0&&a.jsx("span",{className:b.TextField__TextCounter,children:`${y}/${u}`})]}),d&&a.jsx(x.Input.Description,{className:b.TextField__Description,children:d}),c&&a.jsx(x.Input.Error,{className:b.TextField__ErrorMsg,children:c})]})]})},j={"TimePicker--Small":"styles-module__TimePicker--Small___nHQa1","TimePicker--Medium":"styles-module__TimePicker--Medium___E9-rF","TimePicker--Large":"styles-module__TimePicker--Large___I0M7V"},Ae=({size:t="md",...s})=>{const r=m.useRef(null);let e=j["TimePicker--Medium"],o=18;return t==="sm"?(e=j["TimePicker--Small"],o=14):t==="lg"&&(e=j["TimePicker--Large"],o=24),a.jsx(z.TimeInput,{ref:r,className:e,size:t,...s,rightSection:a.jsx(x.ActionIcon,{onClick:()=>{r&&r?.current?.showPicker()},children:a.jsx(i.IconClock,{size:o})})})},F={Toast:"styles-module__Toast___ZqZzU",Toast__Icon:"styles-module__Toast__Icon___PWXSy",Toast__Body:"styles-module__Toast__Body___wezPs",Toast__Message:"styles-module__Toast__Message___NFsgm"},N=t=>{const s=typeof t=="string"?{message:t}:t,{message:r,id:e,icon:o,autoClose:l}=s;O.notifications.show({id:e,message:a.jsx("div",{className:F.Toast__Message,children:r}),icon:o,autoClose:l,classNames:{root:F.Toast,body:F.Toast__Body,icon:F.Toast__Icon},withCloseButton:!1,withBorder:!1})};N.update=(t,s)=>{const r=typeof s=="string"?{message:s}:s,{message:e,icon:o,autoClose:l}=r;O.notifications.update({id:t,message:a.jsx("div",{className:F.Toast__Message,children:e}),icon:o,autoClose:l,classNames:{root:F.Toast,body:F.Toast__Body,icon:F.Toast__Icon},withCloseButton:!1,withBorder:!1})},N.hide=t=>{O.notifications.hide(t)},N.clean=()=>{O.notifications.clean()};const G={"Toggle--Small":"styles-module__Toggle--Small___sOjUd","Toggle--Medium":"styles-module__Toggle--Medium___yIb8v","Toggle--Large":"styles-module__Toggle--Large___ZOJj1"},Ne=({size:t="md",labelPosition:s="right",disabled:r,onChange:e,...o})=>{const[l,n]=m.useState(o?.checked||!1);let c=G["Toggle--Medium"],d=50;t==="sm"?(c=G["Toggle--Small"],d=38):t==="lg"&&(c=G["Toggle--Large"],d=67);const h=m.useCallback(u=>{e&&e(u),n(u?.target?.checked)},[e]);return a.jsx(x.Switch,{className:c,size:t,labelPosition:s,disabled:r,onChange:h,styles:()=>({track:{backgroundColor:!r&&l?"#0fd3d8 !important":void 0,borderColor:!r&&l?"#0fd3d8 !important":void 0,width:d}}),...o})},q={Tooltip__Body:"styles-module__Tooltip__Body___i1OTG",Tooltip__Title:"styles-module__Tooltip__Title___E0LoV",Tooltip__Content:"styles-module__Tooltip__Content___lU5gr"},Oe=({title:t,content:s,maw:r=280,multiline:e=!0,...o})=>a.jsx(x.Tooltip,{...o,maw:r,multiline:e,label:a.jsxs("div",{className:q.Tooltip__Body,children:[t&&a.jsx("span",{className:q.Tooltip__Title,children:t}),a.jsx("span",{className:q.Tooltip__Content,children:s})]})}),$e=t=>{const{name:s,icon:r}=t;return`
1
+ (function(g,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@mantine/core"),require("react"),require("@mantine/notifications"),require("@pop-ui/foundation"),require("@mantine/dates"),require("dayjs"),require("dayjs/locale/ko"),require("dayjs/plugin/customParseFormat"),require("@dnd-kit/core"),require("@dnd-kit/sortable"),require("@mantine/dropzone"),require("react-easy-crop"),require("@dnd-kit/utilities"),require("lottie-react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@mantine/core","react","@mantine/notifications","@pop-ui/foundation","@mantine/dates","dayjs","dayjs/locale/ko","dayjs/plugin/customParseFormat","@dnd-kit/core","@dnd-kit/sortable","@mantine/dropzone","react-easy-crop","@dnd-kit/utilities","lottie-react"],a):(g=typeof globalThis<"u"?globalThis:g||self,a(g.Core={},g.jsxRuntime,g.MantineCore,g.React,g.notifications,g.foundation,g.dates,g.dayjs,null,g.customParseFormat,g.core$1,g.sortable,g.dropzone,g.Cropper,g.utilities,g.Lottie))})(this,function(g,a,P,h,ee,y,ie,E,or,qe,G,Q,Ce,Ke,Je,Xe){"use strict";const Qe={sm:14,md:16,lg:18},F={Button:"styles-module__Button___7ywU9",Button__Inner:"styles-module__Button__Inner___s7vuY",Button__Label:"styles-module__Button__Label___xnZNh",Button__Section:"styles-module__Button__Section___7GPRl",Button__Loader:"styles-module__Button__Loader___AZg1v","Button--Small":"styles-module__Button--Small___9VzCE","Button--Medium":"styles-module__Button--Medium___35lhd","Button--Large":"styles-module__Button--Large___fbUio","Button--Primary":"styles-module__Button--Primary___1ZKgs",Button__Disabled:"styles-module__Button__Disabled___NUWy8","Button--PrimaryLine":"styles-module__Button--PrimaryLine___76iyF","Button--Basic":"styles-module__Button--Basic___sWKzj","Button--Warning":"styles-module__Button--Warning___8gZ6-","Button--Setting":"styles-module__Button--Setting___KNjZA","Button--Danger":"styles-module__Button--Danger___m9tbm","Button--Ghost":"styles-module__Button--Ghost___-zzS-"},_e={inner:F.Button__Inner,label:F.Button__Label,section:F.Button__Section,loader:F.Button__Loader},Re={sm:F["Button--Small"],md:F["Button--Medium"],lg:F["Button--Large"]},et={primary:F["Button--Primary"],primaryLine:F["Button--PrimaryLine"],basic:F["Button--Basic"],danger:F["Button--Danger"],setting:F["Button--Setting"],warning:F["Button--Warning"],ghost:F["Button--Ghost"]},tt=(...e)=>e.filter(Boolean).join(" ")||void 0,rt=e=>{const r=(o,t)=>{const n=Object.keys(o).reduce((l,s)=>{const i=s,_=[o[i],t[i]].filter(Boolean).join(" ");return _&&(l[i]=_),l},{});return Object.keys(t).forEach(l=>{const s=l;!(s in o)&&t[s]&&(n[s]=t[s])}),n};return typeof e=="function"?(o,t,n)=>r(_e,e(o,t,n)):typeof e=="object"&&e!==null&&!Array.isArray(e)?r(_e,e):_e};function te({children:e,size:r="md",variant:o="primary",isLoading:t=!1,hideLabelOnLoading:n=!1,disabled:l=!1,className:s,classNames:i,loaderProps:_,...p}){const d=Qe[r],c=t,m=l||c;return a.jsxs(P.Button,{type:"button",unstyled:!0,className:tt(F.Button,l?F.Button__Disabled:"",Re[r],et[o],s),classNames:rt(i),...p,disabled:m,children:[c&&a.jsx(P.Loader,{color:"currentColor",size:d,..._}),a.jsx("span",{className:F.Button__Label,children:c&&n?null:e})]})}const ce={"Checkbox--Small":"styles-module__Checkbox--Small___VZGlw","Checkbox--Medium":"styles-module__Checkbox--Medium___Vwpa3","Checkbox--Large":"styles-module__Checkbox--Large___ybTGE"},ot={sm:ce["Checkbox--Small"],md:ce["Checkbox--Medium"],lg:ce["Checkbox--Large"]},nt={sm:18,md:24,lg:32},at=({size:e="md",...r})=>{const o=ot[e],t=nt[e];return a.jsx(P.Checkbox,{className:o,size:e,styles:{inner:{width:t,height:t}},...r})},W={CalendarDatePicker__Wrapper:"styles-module__CalendarDatePicker__Wrapper___n4ux3",CalendarDatePicker__DayContent:"styles-module__CalendarDatePicker__DayContent___2xr8Q",CalendarDatePicker__DayLabel:"styles-module__CalendarDatePicker__DayLabel___-4E1W",CalendarDatePicker__TodayIndicator:"styles-module__CalendarDatePicker__TodayIndicator___ij6hs",CalendarDatePicker__Day:"styles-module__CalendarDatePicker__Day___eYyiw",CalendarDatePicker__Header:"styles-module__CalendarDatePicker__Header___hGYbK",CalendarDatePicker__HeaderLevel:"styles-module__CalendarDatePicker__HeaderLevel___yuhOQ",CalendarDatePicker__HeaderControl:"styles-module__CalendarDatePicker__HeaderControl___gz5tC",CalendarDatePicker__HeaderControlIcon:"styles-module__CalendarDatePicker__HeaderControlIcon___OVuQp",CalendarDatePicker__Month:"styles-module__CalendarDatePicker__Month___8-Nvy",CalendarDatePicker__MonthRow:"styles-module__CalendarDatePicker__MonthRow___PihZV",CalendarDatePicker__MonthCell:"styles-module__CalendarDatePicker__MonthCell___bEPui",CalendarDatePicker__WeekdaysRow:"styles-module__CalendarDatePicker__WeekdaysRow___lbdgy",CalendarDatePicker__Weekday:"styles-module__CalendarDatePicker__Weekday___-Seq9"},st=({excludedDays:e=[],excludedDates:r=[]})=>{const o=[],t=[];for(const s of r)typeof s=="string"?o.push(s):t.push(s);const n=o.map(s=>E(s)).filter(s=>s.isValid()).map(s=>s.format("YYYY-MM-DD")),l=t.map(([s,i])=>[E(s),E(i)]).filter(([s,i])=>s.isValid()&&i.isValid());return s=>{const i=E(s);if(!i.isValid())return!1;if(Array.isArray(e)&&e.includes(i.day())||n.includes(i.format("YYYY-MM-DD")))return!0;for(const[_,p]of l)if((i.isSame(_,"day")||i.isAfter(_,"day"))&&(i.isSame(p,"day")||i.isBefore(p,"day")))return!0;return!1}},lt=(e,r,o,t)=>{const n=E(e),l=E(r);for(const s of o)if(Array.isArray(s)){const i=E(s[0]),_=E(s[1]);if(!i.isValid()||!_.isValid())continue;if(!(l.isBefore(i,"day")||n.isAfter(_,"day")))return!0}for(const s of o)if(typeof s=="string"){const i=E(s);if(!i.isValid())continue;if((i.isSame(n,"day")||i.isAfter(n,"day"))&&(i.isSame(l,"day")||i.isBefore(l,"day")))return!0}if(t.length>0){let s=n;for(;s.isBefore(l,"day")||s.isSame(l,"day");){if(t.includes(s.day()))return!0;s=s.add(1,"day")}}return!1},K=(e="default")=>{switch(e){case"range":return[null,null];case"multiple":return[];default:return null}},De=(e="default",r)=>r==null?K(e):e==="range"?Array.isArray(r)?r:K("range"):e==="multiple"?Array.isArray(r)?r:K("multiple"):Array.isArray(r)?r[0]??null:r,Pe=({type:e,externalValue:r,internalValue:o})=>r!==void 0?De(e,r):o!==void 0?De(e,o):K(e),de=(e,r)=>{const o=(t,n)=>{const l=Object.keys(t).reduce((s,i)=>{const _=i,p=t[_],d=n[_],c=[p,d].filter(Boolean).join(" ");return c&&(s[_]=c),s},{});return Object.keys(n).forEach(s=>{const i=s,_=n[i];!(i in t)&&_&&(l[i]=_)}),l};return typeof r=="function"?(t,n,l)=>o(e,r(t,n,l)):typeof r=="object"&&r!==null&&!Array.isArray(r)?o(e,r):e},it=e=>{if(e==null)return null;if(Array.isArray(e)){for(let r=e.length-1;r>=0;r-=1){const o=e[r];if(o instanceof Date)return E(o).format("YYYY-MM-DD")}return null}return e instanceof Date?E(e).format("YYYY-MM-DD"):null},_t={levelsGroup:W.CalendarDatePicker__Wrapper,calendarHeader:W.CalendarDatePicker__Header,calendarHeaderLevel:W.CalendarDatePicker__HeaderLevel,calendarHeaderControl:W.CalendarDatePicker__HeaderControl,calendarHeaderControlIcon:W.CalendarDatePicker__HeaderControlIcon,month:W.CalendarDatePicker__Month,monthCell:W.CalendarDatePicker__MonthCell,day:W.CalendarDatePicker__Day,monthRow:W.CalendarDatePicker__MonthRow,weekdaysRow:W.CalendarDatePicker__WeekdaysRow,weekday:W.CalendarDatePicker__Weekday},xe=({excludedDates:e=[],excludedDays:r=[],type:o="default",value:t,onChange:n,highlightToday:l=!1,...s})=>{const{classNames:i,date:_,defaultDate:p,onDateChange:d,getDayProps:c,...m}=s,[u,f]=h.useState(()=>t??K(o)),[k,M]=h.useState(()=>_||p||(it(t??K(o))??new Date)),w=h.useMemo(()=>st({excludedDays:r,excludedDates:e}),[r,e]),L=h.useCallback(T=>{_===void 0&&M(T),d?.(T)},[_,d]),A=T=>{if(o==="range"&&Array.isArray(T)&&T.length===2){const[C,D]=T;if(C&&D&&lt(C,D,e,r)){const B=K("range");f(B),n?.(B);return}}f(T),n?.(T)},z=Pe({type:o,externalValue:t,internalValue:u}),N=h.useCallback(T=>{const C=E(T).date(),B=E(T).isSame(E(),"day")&&l;return a.jsxs("span",{className:W.CalendarDatePicker__DayContent,children:[a.jsx("span",{className:W.CalendarDatePicker__DayLabel,children:C}),B&&a.jsx("span",{className:W.CalendarDatePicker__TodayIndicator,children:"오늘"})]})},[l]),b=de(_t,i),I=_??k,v=E(I??new Date).format("YYYY-MM"),x=h.useCallback(T=>{const C=c?.(T)??{},D=E(T).format("YYYY-MM")!==v;return{...C,onClick:B=>{C.onClick?.(B),D&&L(T)}}},[v,c,L]);return a.jsx(ie.DatePicker,{locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 M월",maxLevel:"month",type:o,previousIcon:a.jsx(y.IconChevronLeft,{}),nextIcon:a.jsx(y.IconChevronRight,{}),...m,size:"lg",onChange:A,weekendDays:[0],highlightToday:l,classNames:b,defaultDate:_===void 0?p:void 0,date:I,onDateChange:L,getDayProps:x,value:z,excludeDate:w,renderDay:N})},S={DatePickerBase:"styles-module__DatePickerBase___yJlGe",DatePickerRoot:"styles-module__DatePickerRoot___HG6Zb","DatePicker--Small":"styles-module__DatePicker--Small___m8asv","DatePicker--Medium":"styles-module__DatePicker--Medium___Po2-B","DatePicker--Large":"styles-module__DatePicker--Large___oQ6EM",DatePicker__Wrapper:"styles-module__DatePicker__Wrapper___7X5ke",DatePicker__Input:"styles-module__DatePicker__Input___sTaqF",DatePicker__Placeholder:"styles-module__DatePicker__Placeholder___PZnzX",DatePicker__Section:"styles-module__DatePicker__Section___waCJM",DatePicker__Icon:"styles-module__DatePicker__Icon___fceRx",DatePicker__Dropdown:"styles-module__DatePicker__Dropdown___Iy9KE",DatePicker__DropdownArrow:"styles-module__DatePicker__DropdownArrow___zeIIm",DatePicker__Root:"styles-module__DatePicker__Root___2Q8qm",DatePicker__LevelsGroup:"styles-module__DatePicker__LevelsGroup___lrWsl",DatePicker__CalendarHeader:"styles-module__DatePicker__CalendarHeader___VI-Of",DatePicker__CalendarHeaderLevel:"styles-module__DatePicker__CalendarHeaderLevel___F4DtE",DatePicker__CalendarHeaderControl:"styles-module__DatePicker__CalendarHeaderControl___72yIl",DatePicker__CalendarHeaderControlIcon:"styles-module__DatePicker__CalendarHeaderControlIcon___CnQei",DatePicker__Month:"styles-module__DatePicker__Month___W7LuG",DatePicker__WeekdaysRow:"styles-module__DatePicker__WeekdaysRow___4NdYk",DatePicker__Weekday:"styles-module__DatePicker__Weekday___tL-rR",DatePicker__MonthRow:"styles-module__DatePicker__MonthRow___NSs67",DatePicker__MonthCell:"styles-module__DatePicker__MonthCell___iGYhy",DatePicker__Day:"styles-module__DatePicker__Day___7LDrl",DatePicker__TimeWrapper:"styles-module__DatePicker__TimeWrapper___BlHZZ",DatePicker__TimeInput:"styles-module__DatePicker__TimeInput___Acg-L",DatePicker__SubmitButton:"styles-module__DatePicker__SubmitButton___6DvfS"};E.extend(qe);const ct={wrapper:S.DatePicker__Wrapper,input:S.DatePicker__Input,section:S.DatePicker__Section,placeholder:S.DatePicker__Placeholder,datePickerRoot:S.DatePicker__Root,levelsGroup:S.DatePicker__LevelsGroup,calendarHeader:S.DatePicker__CalendarHeader,calendarHeaderLevel:S.DatePicker__CalendarHeaderLevel,calendarHeaderControl:S.DatePicker__CalendarHeaderControl,calendarHeaderControlIcon:S.DatePicker__CalendarHeaderControlIcon,month:S.DatePicker__Month,weekdaysRow:S.DatePicker__WeekdaysRow,weekday:S.DatePicker__Weekday,monthRow:S.DatePicker__MonthRow,monthCell:S.DatePicker__MonthCell,day:S.DatePicker__Day,timeWrapper:S.DatePicker__TimeWrapper,timeInput:S.DatePicker__TimeInput,submitButton:S.DatePicker__SubmitButton},dt={dropdown:S.DatePicker__Dropdown,arrow:S.DatePicker__DropdownArrow},Se=(...e)=>e.filter(Boolean).join(" ")||void 0,ae=e=>{if(e==null)return null;if(e instanceof Date)return e;if(typeof e=="string"&&e){const r=e.split("-").map(Number);if(r.length===3&&r[0]&&r[1]&&r[2])return new Date(r[0],r[1]-1,r[2])}return null},ut=({size:e="md",type:r="default",withTime:o,className:t,popoverProps:n,rightSection:l,rightSectionWidth:s,value:i,defaultValue:_,onChange:p,placeholder:d,disabled:c,minDate:m,maxDate:u,displayValueFormat:f="YYYY년 MM월 DD일",valueFormat:k,excludedDates:M,excludedDays:w,highlightToday:L})=>{const A=k??(o?"YYYY-MM-DD HH:mm":"YYYY-MM-DD"),[z,N]=h.useState(!1),[b,I]=h.useState(()=>y.parseDateValue(i??_,r,A)??K(r));let v=S["DatePicker--Medium"],x=18,T=42;e==="sm"?(v=S["DatePicker--Small"],x=14,T=34):e==="lg"&&(v=S["DatePicker--Large"],x=24,T=50);const C=de(dt,n?.classNames),D=l??a.jsx("span",{"aria-hidden":"true",className:S.DatePicker__Icon,children:a.jsx(y.IconCalendar,{size:x})});if(o){const j=ne=>{if(!ne)return null;const Ge=E(ne,A,!0);return Ge.isValid()?Ge.toDate():null},Z=i!==void 0,J=Z?j(i):null,rr=j(_);return a.jsx(ie.DateTimePicker,{className:Se(S.DatePickerBase,S.DatePickerRoot,v,t),classNames:de(ct,void 0),size:e,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD | a hh:mm",rightSection:D,rightSectionWidth:s??T,popoverProps:{offset:8,position:"bottom-start",withArrow:!0,arrowSize:10,arrowOffset:20,...n,classNames:C},value:Z?J:void 0,defaultValue:Z?void 0:rr,onChange:ne=>{p?.(ne?E(ne).format(A):null)},placeholder:d,disabled:c,minDate:m,maxDate:u})}const B=i!=null?y.parseDateValue(i,r,A):void 0,H=Pe({type:r,externalValue:B,internalValue:b}),R=y.formatDateDisplay(H,r,f),tr=j=>{let Z;if(r==="range"&&Array.isArray(j)){const J=j;Z=[ae(J[0]??null),ae(J[1]??null)]}else r==="multiple"&&Array.isArray(j)?Z=j.map(J=>ae(J)).filter(J=>J!==null):Z=ae(j);I(Z),p?.(y.toValueString(Z,r,A)),r==="default"&&Z!=null&&N(!1),r==="range"&&Array.isArray(Z)&&Z[0]&&Z[1]&&N(!1)};return a.jsx("div",{className:Se(S.DatePickerBase,S.DatePickerRoot,v,t),children:a.jsxs(P.Popover,{opened:z,onClose:()=>N(!1),offset:8,position:"bottom-start",withArrow:!0,arrowSize:10,arrowOffset:20,...n,classNames:C,children:[a.jsx(P.Popover.Target,{children:a.jsx("div",{className:S.DatePicker__Wrapper,"data-expanded":z?!0:void 0,"data-disabled":c?!0:void 0,children:a.jsx(P.Input,{component:"button",type:"button",classNames:{input:S.DatePicker__Input,section:S.DatePicker__Section},onClick:()=>!c&&N(j=>!j),disabled:c,rightSection:D,rightSectionWidth:s??T,"data-expanded":z?!0:void 0,"data-disabled":c?!0:void 0,children:R?a.jsx("span",{children:R}):a.jsx("span",{className:S.DatePicker__Placeholder,children:d})})})}),a.jsx(P.Popover.Dropdown,{children:a.jsx(xe,{type:r,value:H,onChange:tr,excludedDates:M,excludedDays:w,highlightToday:L,minDate:m,maxDate:u})})]})})},Y={"Dropdown--LeftLabel":"styles-module__Dropdown--LeftLabel___SFObq","Dropdown--TopLabel":"styles-module__Dropdown--TopLabel___-lPhr","Dropdown__Label--Small":"styles-module__Dropdown__Label--Small___xbzOR","Dropdown__Label--Medium":"styles-module__Dropdown__Label--Medium___YtJ2-","Dropdown__Label--Large":"styles-module__Dropdown__Label--Large___sCiJv","Dropdown__Tooltip--Small":"styles-module__Dropdown__Tooltip--Small___rkmaO","Dropdown__Tooltip--Medium":"styles-module__Dropdown__Tooltip--Medium___JTfzy","Dropdown__Tooltip--Large":"styles-module__Dropdown__Tooltip--Large___W-sUq","Dropdown--Small":"styles-module__Dropdown--Small___dRIK7","Dropdown--Medium":"styles-module__Dropdown--Medium___-HZoU","Dropdown--Large":"styles-module__Dropdown--Large___BvV3M",Dropdown__Description:"styles-module__Dropdown__Description___OQ8bF",Dropdown__ErrorMsg:"styles-module__Dropdown__ErrorMsg___xTP0Y"},pt=({label:e,labelPosition:r="top",size:o="md",required:t,tooltip:n,tooltipPosition:l="top",errorMsg:s,description:i,..._})=>{const[p,d]=h.useState(!1);let c=Y["Dropdown__Label--Medium"],m=Y["Dropdown--Medium"],u=Y["Dropdown__Tooltip--Medium"],f=18;return o==="sm"?(c=Y["Dropdown__Label--Small"],m=Y["Dropdown--Small"],u=Y["Dropdown__Tooltip--Small"],f=14):o==="lg"&&(c=Y["Dropdown__Label--Large"],m=Y["Dropdown--Large"],u=Y["Dropdown__Tooltip--Large"],f=24),a.jsxs("div",{className:r==="top"?Y["Dropdown--TopLabel"]:Y["Dropdown--LeftLabel"],children:[a.jsxs("div",{children:[e&&a.jsx(P.Input.Label,{required:t,className:c,children:e}),n&&a.jsx(P.Tooltip,{label:n,position:l,children:a.jsx("div",{className:u,children:a.jsx(y.IconInfoCircle,{size:o==="sm"?14:o==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx(P.Select,{..._,size:o,error:s,className:m,rightSection:p?a.jsx(y.IconChevronUp,{size:f}):a.jsx(y.IconChevronDown,{size:f}),onDropdownOpen:()=>d(!0),onDropdownClose:()=>d(!1),styles:{option:{"&[data-selected]":{"&, &:hover":{backgroundColor:"#e7e7e7",color:"#000000"}}}}}),i&&a.jsx(P.Input.Description,{className:Y.Dropdown__Description,children:i}),s&&a.jsx(P.Input.Error,{className:Y.Dropdown__ErrorMsg,children:s})]})]})};function Me(){return crypto.randomUUID()}function Te(e,r,o){const t=[...e],[n]=t.splice(r,1);return t.splice(o,0,n),t}function be(e,r,o){return o!=null&&e.length>=o?0:r!=null&&e.length<r?r-e.length:1}function mt(e,r,o){const t=[...r].sort((i,_)=>i.name.localeCompare(_.name)),n=o!=null?o-e.length:1/0,s=t.slice(0,n).map(i=>({id:Me(),file:i,url:URL.createObjectURL(i)}));return[...e,...s]}function ht(e,r){const o=e.find(t=>t.id===r);return o?.url?.startsWith("blob:")&&URL.revokeObjectURL(o.url),e.filter(t=>t.id!==r)}function Ie(e,r,o){return e.map(t=>t.id!==r?t:(t.url?.startsWith("blob:")&&URL.revokeObjectURL(t.url),{...t,file:o,url:URL.createObjectURL(o)}))}function ft(e,r,o){return Ie(e,r,o)}function gt(e){for(const r of e)r.url?.startsWith("blob:")&&URL.revokeObjectURL(r.url)}const we=({size:e="md",width:r,withCloseButton:o=!1,...t})=>{let n=768;return e==="xs"?n=360:e==="sm"?n=544:e==="lg"?n=1e3:e==="xl"&&(n=1200),a.jsx(P.Modal,{size:r||n,styles:{content:{borderRadius:"12px"},title:{fontSize:"16px",fontWeight:"700",lineHeight:"150%",color:y.ColorGray900},header:{padding:"16px"},body:{paddingLeft:"0px",paddingRight:"0px"}},withCloseButton:o,closeButtonProps:{icon:a.jsx(y.IconX,{size:18,color:y.ColorGray600})},...t})};async function kt(e,r){const o=e.url??"";if(!o)return null;const t=await new Promise((i,_)=>{const p=new Image;p.crossOrigin="anonymous",p.onload=()=>i(p),p.onerror=_,p.src=o}),n=document.createElement("canvas");n.width=r.width,n.height=r.height;const l=n.getContext("2d");if(!l)return null;l.drawImage(t,r.x,r.y,r.width,r.height,0,0,r.width,r.height);const s=e.file?.name??e.url?.split("/").pop()??"image";return new Promise((i,_)=>{n.toBlob(p=>{p?i(new File([p],`cropped_${s}`,{type:"image/jpeg"})):_(new Error("Failed to create blob"))},"image/jpeg")})}function yt({item:e,isOpen:r,aspect:o=1,onClose:t,onSubmit:n}){const[l,s]=h.useState({x:0,y:0}),[i,_]=h.useState(1),[p,d]=h.useState(null),[c,m]=h.useState(!1),u=async()=>{if(!(!p||!e)){m(!0);try{const f=await kt(e,p);f&&n(f)}finally{m(!1)}}};return a.jsx(we,{opened:r&&!!e,onClose:t,size:"md",title:"이미지 수정",withCloseButton:!0,children:a.jsxs(P.Stack,{children:[a.jsx("div",{style:{position:"relative",height:320,background:"#fff"},children:a.jsx(Ke,{image:e?.url??"",crop:l,zoom:i,aspect:o,minZoom:.5,maxZoom:10,objectFit:"cover",onCropChange:s,onZoomChange:_,onCropComplete:(f,k)=>d(k),style:{containerStyle:{backgroundColor:"#ffffff"}}})}),a.jsxs(P.Group,{justify:"flex-end",style:{padding:"0 16px"},children:[a.jsx(te,{variant:"basic",onClick:t,children:"취소"}),a.jsx(te,{variant:"primary",isLoading:c,onClick:u,children:"적용하기"})]})]})},e?.id)}const re={Container:"styles-module__Container___ZyeJM",TileImage:"styles-module__TileImage___6aKmW",EditButton:"styles-module__EditButton___1Xyg9",PlaceholderText:"styles-module__PlaceholderText___nhLhy",PlaceholderTextError:"styles-module__PlaceholderTextError___jYZ8j"},V={TileContainer:"styles-module__TileContainer___5-y01",DeleteButton:"styles-module__DeleteButton___0zsXm",Tile:"styles-module__Tile___3Cezo",LoadingOverlay:"styles-module__LoadingOverlay___4CyDQ",ActionBar:"styles-module__ActionBar___mJYpe",DragHandle:"styles-module__DragHandle___lzKhb",LinkButton:"styles-module__LinkButton___bISyz",DropzoneOuter:"styles-module__DropzoneOuter___BIO2N",Placeholder:"styles-module__Placeholder___q30Yw",PlaceholderError:"styles-module__PlaceholderError___fCOYe"};function Be({width:e,height:r,isError:o,isLoading:t,accept:n,multiple:l,onDrop:s,children:i}){return a.jsx("div",{className:V.DropzoneOuter,children:a.jsx(Ce.Dropzone,{onDrop:s,accept:n,multiple:l,disabled:t,className:o?V.PlaceholderError:V.Placeholder,style:{width:e,height:r},children:i})})}function Le({id:e,totalCount:r,width:o,height:t,readOnly:n,isLoading:l,itemIsLoading:s,canDelete:i,hasLink:_,linkUrl:p,onLinkClick:d,onDelete:c,deleteAriaLabel:m="삭제",actionBarExtra:u,onTileClick:f,children:k}){const{attributes:M,listeners:w,setNodeRef:L,transform:A,transition:z,isDragging:N}=Q.useSortable({id:e,disabled:n}),b=!n&&r>1||_&&!!p&&!!d||!!u,I=n||l||s||!f?"default":"pointer";return a.jsxs("div",{ref:L,className:V.TileContainer,style:{transform:Je.CSS.Transform.toString(A),transition:z,opacity:N?.4:1},children:[!n&&i&&!l&&a.jsx("button",{type:"button",className:V.DeleteButton,onClick:c,"aria-label":m,children:a.jsx(y.IconXCircle,{size:24})}),a.jsxs("div",{className:V.Tile,style:{width:o,height:t,cursor:I},onClick:()=>!n&&!l&&!s&&f?.(),children:[k,(l||s)&&a.jsx("div",{className:V.LoadingOverlay,children:a.jsx(P.Loader,{size:o/6,color:y.ColorAqua500})})]}),b&&a.jsxs("div",{className:V.ActionBar,children:[!n&&r>1&&a.jsx("button",{type:"button",className:V.DragHandle,...M,...w,"aria-label":"드래그로 순서 변경",children:a.jsx(y.IconDragMenu,{size:20,color:"#808080"})}),_&&p&&d&&a.jsx("button",{type:"button",className:V.LinkButton,onClick:d,children:"링크"}),u]})]})}function ve({items:e,onReorder:r}){return{sensors:G.useSensors(G.useSensor(G.PointerSensor,{activationConstraint:{distance:8}}),G.useSensor(G.KeyboardSensor,{coordinateGetter:Q.sortableKeyboardCoordinates})),handleDragEnd:n=>{const{active:l,over:s}=n;if(!s||l.id===s.id)return;const i=e.findIndex(p=>p.id===l.id),_=e.findIndex(p=>p.id===s.id);i!==-1&&_!==-1&&r(i,_)}}}function Ct({item:e,index:r,totalCount:o,width:t,height:n,canDelete:l,hasLink:s,hasEdit:i,readOnly:_,isLoading:p,onLinkClick:d,onDelete:c,onReplace:m,onEdit:u}){const f=h.useRef(null);return a.jsxs(Le,{id:e.id,totalCount:o,width:t,height:n,readOnly:_,isLoading:p,itemIsLoading:e.isLoading,canDelete:l,hasLink:s,linkUrl:e.url,onLinkClick:d?()=>d(e):void 0,onDelete:()=>c(e.id),deleteAriaLabel:"이미지 삭제",onTileClick:()=>f.current?.click(),actionBarExtra:!_&&i?a.jsx(te,{variant:"basic",size:"sm","aria-label":"이미지 편집",className:re.EditButton,onClick:()=>u(e),children:"편집"}):void 0,children:[a.jsx("input",{ref:f,type:"file",accept:"image/*",style:{display:"none"},onChange:k=>{const M=k.target.files?.[0];M&&m(e.id,M),k.target.value=""}}),a.jsx("img",{src:e.url,alt:e.file?.name??`이미지 ${r+1}`,className:re.TileImage})]})}const Dt=({value:e=[],onChange:r,width:o=160,height:t=200,placeholder:n="이미지를 넣어주세요",hasIcon:l=!0,hasLink:s=!1,onLinkClick:i,hasEdit:_=!1,canDelete:p=!0,minLength:d,maxLength:c,errorMsg:m,isLoading:u,readOnly:f,gap:k=8})=>{const M=!!m,w=be(e,d,c),[L,A]=h.useState(null);h.useEffect(()=>()=>gt(e),[]);const{sensors:z,handleDragEnd:N}=ve({items:e,onReorder:(C,D)=>{const B=Te(e,C,D),H=e[C];r?.(B,{action:"reorder",itemId:H.id,index:D,previousIndex:C,nextIndex:D})}}),b=C=>{if(f)return;const D=e.length,B=mt(e,C,c);B.length!==D&&r?.(B,{action:"create",itemId:B[D].id,index:D})},I=C=>{if(f)return;const D=e.findIndex(H=>H.id===C),B=ht(e,C);r?.(B,{action:"delete",itemId:C,index:D})},v=(C,D)=>{if(f)return;const B=e.findIndex(R=>R.id===C),H=Ie(e,C,D);r?.(H,{action:"replace",itemId:C,index:B})},x=C=>{if(!L)return;const D=L.id,B=e.findIndex(R=>R.id===D),H=ft(e,D,C);A(null),r?.(H,{action:"crop",itemId:D,index:B})},T=C=>{const D=typeof n=="function"?n(C):n;return typeof D!="string"?D:D.split(`
2
+ `).map((B,H)=>a.jsx("span",{children:B},H))};return a.jsxs("div",{children:[a.jsx(G.DndContext,{sensors:z,collisionDetection:G.closestCenter,onDragEnd:N,children:a.jsx(Q.SortableContext,{items:e.map(C=>C.id),strategy:Q.rectSortingStrategy,children:a.jsxs("div",{className:re.Container,style:{gap:k},children:[e.map((C,D)=>a.jsx(Ct,{item:C,index:D,totalCount:e.length,width:o,height:t,canDelete:p,hasLink:s,hasEdit:_,readOnly:f??!1,isLoading:u,onLinkClick:i,onDelete:I,onReplace:v,onEdit:A},C.id)),!f&&Array.from({length:w},(C,D)=>a.jsxs(Be,{onDrop:b,accept:Ce.IMAGE_MIME_TYPE,multiple:c!==1,isLoading:u,isError:M,width:o,height:t,children:[l&&a.jsx(y.IconPhoto,{size:36,color:M?"#e03131":"#07a3c6"}),n&&a.jsx("div",{className:`${re.PlaceholderText}${M?` ${re.PlaceholderTextError}`:""}`,children:T(D)})]},`placeholder-${D}`))]})})}),M&&a.jsx(P.Input.Error,{mt:8,children:m}),_&&a.jsx(yt,{item:L,isOpen:!!L,onClose:()=>A(null),onSubmit:x})]})},se={Toast:"styles-module__Toast___ZqZzU",Toast__Icon:"styles-module__Toast__Icon___PWXSy",Toast__Body:"styles-module__Toast__Body___wezPs",Toast__Message:"styles-module__Toast__Message___NFsgm"},Ee=e=>typeof e=="string"?{message:e}:e,Ae=(e,r)=>{const{autoClose:o,icon:t,message:n}=Ee(e);return{id:r,message:a.jsx("div",{className:se.Toast__Message,children:n}),icon:t,autoClose:o,classNames:{root:se.Toast,body:se.Toast__Body,icon:se.Toast__Icon},withCloseButton:!1,withBorder:!1}},X=e=>{const r=Ee(e);ee.notifications.show(Ae(e,r.id))};X.update=(e,r)=>{ee.notifications.update(Ae(r,e))},X.hide=e=>{ee.notifications.hide(e)},X.clean=()=>{ee.notifications.clean()};function Ne(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const r=e;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)}function Fe(e){return new Promise(r=>{const o=new FileReader;o.onload=t=>{try{const n=JSON.parse(t.target?.result);r(Ne(n)?n:null)}catch{r(null)}},o.onerror=()=>r(null),o.readAsText(e)})}function Pt(e,r,o){const t=[...r].sort((i,_)=>i.name.localeCompare(_.name)),n=o!=null?o-e.length:1/0,s=t.slice(0,n).map(i=>({id:Me(),file:i}));return[...e,...s]}function xt(e,r){return e.filter(o=>o.id!==r)}const le={Container:"styles-module__Container___cJqG-",Empty:"styles-module__Empty___gexrS",PlaceholderText:"styles-module__PlaceholderText___x2ya0",PlaceholderTextError:"styles-module__PlaceholderTextError___i8VXv"},St={"application/json":[".json"]};function Mt({item:e,totalCount:r,width:o,height:t,readOnly:n,isLoading:l,canDelete:s,hasLink:i,onLinkClick:_,onDelete:p}){const[d,c]=h.useState(e.animationData??null),[m,u]=h.useState(!e.animationData&&!!(e.file||e.url));return h.useEffect(()=>{if(e.animationData){c(e.animationData);return}!e.file&&!e.url||(u(!0),e.file?Fe(e.file).then(f=>{c(f),u(!1)}):e.url&&fetch(e.url).then(f=>f.json()).then(f=>{c(Ne(f)?f:null),u(!1)}).catch(()=>{c(null),u(!1)}))},[e.id]),a.jsx(Le,{id:e.id,totalCount:r,width:o,height:t,readOnly:n,isLoading:l,itemIsLoading:e.isLoading||m,canDelete:s,hasLink:i,linkUrl:e.url,onLinkClick:_?()=>_(e):void 0,onDelete:()=>p(e.id),deleteAriaLabel:"Lottie 삭제",children:d?a.jsx(Xe,{animationData:d,loop:!0,autoplay:!0,style:{width:o,height:t,display:"block"}}):a.jsx("div",{className:le.Empty,style:{width:o,height:t}})})}const Tt=({value:e=[],onChange:r,width:o=160,height:t=200,placeholder:n="Lottie JSON 파일을 넣어주세요",hasIcon:l=!0,hasLink:s=!1,onLinkClick:i,minLength:_,maxLength:p,errorMsg:d,isLoading:c,readOnly:m,gap:u=8,canDelete:f=!0})=>{const k=!!d,M=be(e,_,p),{sensors:w,handleDragEnd:L}=ve({items:e,onReorder:(b,I)=>{const v=Te(e,b,I),x=e[b];r?.(v,{action:"reorder",itemId:x.id,index:I,previousIndex:b,nextIndex:I})}}),A=async b=>{if(m)return;const I=[...b].sort((B,H)=>B.name.localeCompare(H.name)),v=await Promise.all(I.map(Fe));let x=0;const T=I.filter((B,H)=>v[H]!==null?!0:(x++,!1));if(x>0&&X({id:"invalid-lottie-files",message:x===1?"유효하지 않은 Lottie JSON 파일입니다":`${x}개의 파일이 유효하지 않은 Lottie JSON입니다`}),T.length===0)return;const C=e.length,D=Pt(e,T,p);D.length!==C&&r?.(D,{action:"create",itemId:D[C].id,index:C})},z=b=>{if(m)return;const I=e.findIndex(x=>x.id===b),v=xt(e,b);r?.(v,{action:"delete",itemId:b,index:I})},N=b=>{const I=typeof n=="function"?n(b):n;return typeof I!="string"?I:I.split(`
3
+ `).map((v,x)=>a.jsx("span",{children:v},x))};return a.jsxs("div",{children:[a.jsx(G.DndContext,{sensors:w,collisionDetection:G.closestCenter,onDragEnd:L,children:a.jsx(Q.SortableContext,{items:e.map(b=>b.id),strategy:Q.rectSortingStrategy,children:a.jsxs("div",{className:le.Container,style:{gap:u},children:[e.map(b=>a.jsx(Mt,{item:b,totalCount:e.length,width:o,height:t,readOnly:m??!1,isLoading:c,canDelete:f,hasLink:s,onLinkClick:i,onDelete:z},b.id)),!m&&Array.from({length:M},(b,I)=>a.jsxs(Be,{onDrop:A,accept:St,multiple:p!==1,isLoading:c,isError:k,width:o,height:t,children:[l&&a.jsx(y.IconPhoto,{size:36,color:k?"#e03131":"#07a3c6"}),n&&a.jsx("div",{className:`${le.PlaceholderText}${k?` ${le.PlaceholderTextError}`:""}`,children:N(I)})]},`placeholder-${I}`))]})})}),k&&a.jsx(P.Input.Error,{mt:8,children:d})]})},oe={Pagination:"style-module__Pagination___xcR-Q",Pagination__PageIndex:"style-module__Pagination__PageIndex___50SZJ","Pagination__PageIndex--Active":"style-module__Pagination__PageIndex--Active___mSIwS",Pagination__Arrow:"style-module__Pagination__Arrow___74vp3"},bt=({currentPageIdx:e,rowsPerPage:r,totalLength:o,paginationSize:t,onPageChange:n,...l})=>{const[s,i]=h.useState(e),_=r||50,p=o||1,d=t||5;h.useEffect(()=>{i(e)},[e]);const c=()=>{n&&n(s-(s%d+1)),i(u=>u-(u%d+1))},m=()=>{n&&n(s+d-s%d),i(u=>u+d-u%d)};return a.jsxs("div",{...l,className:oe.Pagination,children:[s>=d?a.jsx("button",{className:oe.Pagination__Arrow,onClick:c,children:a.jsx(y.IconChevronLeft,{size:20})}):null,new Array(d).fill(0).map((u,f)=>{const k=Math.floor(s/d)*d+f+1;if(!(k>Math.ceil(p/_)))return a.jsx("button",{className:s===k-1?oe["Pagination__PageIndex--Active"]:oe.Pagination__PageIndex,onClick:()=>{i(k-1),n&&n(k-1)},children:k},`pagination_${f}`)}),Math.floor(s/d)*d+d<Math.ceil(p/_)?a.jsx("button",{className:oe.Pagination__Arrow,onClick:m,children:a.jsx(y.IconChevronRight,{size:20})}):null]})},ue={"Radio--Small":"styles-module__Radio--Small___izWI2","Radio--Medium":"styles-module__Radio--Medium___dwZfV","Radio--Large":"styles-module__Radio--Large___1gLra"},It={sm:ue["Radio--Small"],md:ue["Radio--Medium"],lg:ue["Radio--Large"]},wt={sm:18,md:24,lg:32},Bt=({size:e="md",...r})=>{const o=It[e],t=wt[e];return a.jsx(P.Radio,{className:o,size:e,styles:{inner:{width:t,height:t}},...r})},$={"SearchBar--LeftLabel":"styles-module__SearchBar--LeftLabel___CeYTM","SearchBar--TopLabel":"styles-module__SearchBar--TopLabel___spN3I","SearchBar__Label--Small":"styles-module__SearchBar__Label--Small___zS1L2","SearchBar__Label--Medium":"styles-module__SearchBar__Label--Medium___Fk0Ao","SearchBar__Label--Large":"styles-module__SearchBar__Label--Large___xTOYL","SearchBar__Tooltip--Small":"styles-module__SearchBar__Tooltip--Small___YhmEr","SearchBar__Tooltip--Medium":"styles-module__SearchBar__Tooltip--Medium___4JhOv","SearchBar__Tooltip--Large":"styles-module__SearchBar__Tooltip--Large___IEoPv",SearchBar__Wrapper:"styles-module__SearchBar__Wrapper___oq49s","SearchBar--Small":"styles-module__SearchBar--Small___SY9CN","SearchBar--Medium":"styles-module__SearchBar--Medium___vLP08","SearchBar--Large":"styles-module__SearchBar--Large___JHfHP",SearchBar__Description:"styles-module__SearchBar__Description___vucS-",SearchBar__ErrorMsg:"styles-module__SearchBar__ErrorMsg___TOeoy",SearchBar__ClearButton:"styles-module__SearchBar__ClearButton___S-y4P"},Lt=({label:e,labelPosition:r="top",size:o="md",required:t,tooltip:n,tooltipPosition:l="top",errorMsg:s,description:i,onChange:_,onClear:p,...d})=>{const[c,m]=h.useState(0);let u=$["SearchBar__Label--Medium"],f=$["SearchBar--Medium"],k=$["SearchBar__Tooltip--Medium"];o==="sm"?(u=$["SearchBar__Label--Small"],f=$["SearchBar--Small"],k=$["SearchBar__Tooltip--Small"]):o==="lg"&&(u=$["SearchBar__Label--Large"],f=$["SearchBar--Large"],k=$["SearchBar__Tooltip--Large"]);const M=h.useCallback(w=>{_&&(m(w?.length),_(w))},[_]);return a.jsxs("div",{className:r==="top"?$["SearchBar--TopLabel"]:$["SearchBar--LeftLabel"],children:[a.jsxs("div",{children:[e&&a.jsx(P.Input.Label,{required:t,className:u,children:e}),n&&a.jsx(P.Tooltip,{label:n,position:l,children:a.jsx("div",{className:k,children:a.jsx(y.IconInfoCircle,{size:o==="sm"?14:o==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx("div",{className:$.SearchBar__Wrapper,children:a.jsx(P.Autocomplete,{...d,size:o,error:s,className:f,onChange:M,leftSection:a.jsx(y.IconSearch,{size:o==="sm"?16:o==="lg"?24:20}),rightSection:p&&c>0?a.jsx("div",{className:$.SearchBar__ClearButton,onClick:p,children:a.jsx(y.IconX,{size:o==="sm"?16:o==="lg"?24:20})}):void 0})}),i&&a.jsx(P.Input.Description,{className:$.SearchBar__Description,children:i}),s&&a.jsx(P.Input.Error,{className:$.SearchBar__ErrorMsg,children:s})]})]})},pe={"SegmentButton--Small":"styles-module__SegmentButton--Small___o0Y3t","SegmentButton--Medium":"styles-module__SegmentButton--Medium___EgCJm","SegmentButton--Large":"styles-module__SegmentButton--Large___Ym86C"},vt=({size:e="md",radius:r=6,...o})=>{let t=pe["SegmentButton--Medium"];return e==="sm"?t=pe["SegmentButton--Small"]:e==="lg"&&(t=pe["SegmentButton--Large"]),a.jsx(P.SegmentedControl,{className:t,size:e,radius:r,withItemsBorders:!1,...o})},Oe={Tab__TitleList:"styles-module__Tab__TitleList___urHWH",Tab__BorderBottom:"styles-module__Tab__BorderBottom___eMTpl"},Et=({tabList:e=[],containerPaddingTop:r,...o})=>a.jsxs(P.Tabs,{...o,children:[a.jsx(P.Tabs.List,{className:Oe.Tab__TitleList,children:e?.map((t,n)=>a.jsxs(P.Tabs.Tab,{value:t.value,leftSection:t.icon,children:[t.title,a.jsx("div",{className:Oe.Tab__BorderBottom})]},`tab_${n}`))}),e?.map((t,n)=>a.jsx(P.Tabs.Panel,{value:t.value,pt:r,children:t.body},`tab_panel_${n}`))]}),O={"TextField--LeftLabel":"styles-module__TextField--LeftLabel___hiNn3","TextField--TopLabel":"styles-module__TextField--TopLabel___V2otc","TextField__Label--Small":"styles-module__TextField__Label--Small___NkKKA","TextField__Label--Medium":"styles-module__TextField__Label--Medium___IoJd-","TextField__Label--Large":"styles-module__TextField__Label--Large___GMy74","TextField__Tooltip--Small":"styles-module__TextField__Tooltip--Small___GmQHE","TextField__Tooltip--Medium":"styles-module__TextField__Tooltip--Medium___5P3nA","TextField__Tooltip--Large":"styles-module__TextField__Tooltip--Large___YSCfu",TextField__Wrapper:"styles-module__TextField__Wrapper___u6p5Z",TextField__TextCounter:"styles-module__TextField__TextCounter___u1jM5","TextField--Textarea":"styles-module__TextField--Textarea___C2DL5","TextField--Small":"styles-module__TextField--Small___iuH4t","TextField--Medium":"styles-module__TextField--Medium___snYod","TextField--Large":"styles-module__TextField--Large___JoSYk",TextField__Description:"styles-module__TextField__Description___J-kXP",TextField__ErrorMsg:"styles-module__TextField__ErrorMsg___fa6f6",TextField__ClearButton:"styles-module__TextField__ClearButton___bB5Ew"},At=e=>typeof e=="string"?e.length:typeof e=="number"?String(e).length:Array.isArray(e)?e.join("").length:0,Nt=e=>{const{label:r,labelPosition:o="top",size:t="md",required:n,tooltip:l,tooltipPosition:s="top",errorMsg:i,description:_,textarea:p=!1,maxTextCount:d,onChange:c,onClear:m,...u}=e,f="minRows"in e?e.minRows:void 0,{value:k,defaultValue:M,...w}=u,L=k!==void 0,[A,z]=h.useState(String(k??M??"")),N=L?k:A,b=At(N);let I=O["TextField__Label--Medium"],v=O["TextField--Medium"],x=O["TextField__Tooltip--Medium"];t==="sm"?(I=O["TextField__Label--Small"],v=O["TextField--Small"],x=O["TextField__Tooltip--Small"]):t==="lg"&&(I=O["TextField__Label--Large"],v=O["TextField--Large"],x=O["TextField__Tooltip--Large"]);const T=h.useCallback(D=>{const B=D.currentTarget.value;d&&B.length>d||(L||z(B),c&&c(D))},[L,d,c]),C=h.useCallback(()=>{L||z(""),m?.()},[L,m]);return a.jsxs("div",{className:o==="top"?O["TextField--TopLabel"]:O["TextField--LeftLabel"],children:[a.jsxs("div",{children:[r&&a.jsx(P.Input.Label,{required:n,className:I,children:r}),l&&a.jsx(P.Tooltip,{label:l,position:s,children:a.jsx("div",{className:x,children:a.jsx(y.IconInfoCircle,{size:t==="sm"?14:t==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:O.TextField__Wrapper,children:[p?a.jsx(P.Textarea,{className:O["TextField--Textarea"],size:t,minRows:f,error:i,onChange:T,value:N,...w}):a.jsx(P.Input,{className:v,error:i,onChange:T,value:N,rightSection:m&&b>0?a.jsx("button",{type:"button",className:O.TextField__ClearButton,"aria-label":"입력 내용 지우기",onClick:C,children:a.jsx(y.IconX,{size:t==="sm"?16:t==="lg"?24:20})}):void 0,...w}),d&&d>0&&a.jsx("span",{className:O.TextField__TextCounter,children:`${b}/${d}`})]}),_&&a.jsx(P.Input.Description,{className:O.TextField__Description,children:_}),i&&a.jsx(P.Input.Error,{className:O.TextField__ErrorMsg,children:i})]})]})},me={"TimePicker--Small":"styles-module__TimePicker--Small___nHQa1","TimePicker--Medium":"styles-module__TimePicker--Medium___E9-rF","TimePicker--Large":"styles-module__TimePicker--Large___I0M7V"},Ft=({size:e="md",...r})=>{const o=h.useRef(null);let t=me["TimePicker--Medium"],n=18;return e==="sm"?(t=me["TimePicker--Small"],n=14):e==="lg"&&(t=me["TimePicker--Large"],n=24),a.jsx(ie.TimeInput,{ref:o,className:t,size:e,...r,rightSection:a.jsx(P.ActionIcon,{bg:"transparent",onClick:()=>{o.current?.showPicker?.()},children:a.jsx(y.IconClock,{size:n})})})},he={"Toggle--Small":"styles-module__Toggle--Small___sOjUd","Toggle--Medium":"styles-module__Toggle--Medium___yIb8v","Toggle--Large":"styles-module__Toggle--Large___ZOJj1"},Ot=({size:e="md",labelPosition:r="right",disabled:o,onChange:t,...n})=>{const[l,s]=h.useState(n?.checked||!1);let i=he["Toggle--Medium"],_=50;e==="sm"?(i=he["Toggle--Small"],_=38):e==="lg"&&(i=he["Toggle--Large"],_=67);const p=h.useCallback(d=>{t&&t(d),s(d?.target?.checked)},[t]);return a.jsx(P.Switch,{className:i,size:e,labelPosition:r,disabled:o,onChange:p,styles:()=>({track:{backgroundColor:!o&&l?"#0fd3d8 !important":void 0,borderColor:!o&&l?"#0fd3d8 !important":void 0,width:_}}),...n})},fe={Tooltip__Body:"styles-module__Tooltip__Body___i1OTG",Tooltip__Title:"styles-module__Tooltip__Title___E0LoV",Tooltip__Content:"styles-module__Tooltip__Content___lU5gr"},zt=({title:e,content:r,maw:o=280,multiline:t=!0,...n})=>a.jsx(P.Tooltip,{...n,maw:o,multiline:t,label:a.jsxs("div",{className:fe.Tooltip__Body,children:[e&&a.jsx("span",{className:fe.Tooltip__Title,children:e}),a.jsx("span",{className:fe.Tooltip__Content,children:r})]})}),Ht=e=>{const{name:r,icon:o}=e;return`
2
4
  <div class="pin-marker">
3
- ${r?`<img src="${r}" alt="${s}" width="40" height="40" />`:`
5
+ ${o?`<img src="${o}" alt="${r}" width="40" height="40" />`:`
4
6
  <svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
5
7
  <g>
6
8
  <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"/>
@@ -8,40 +10,40 @@
8
10
  </g>
9
11
  </svg>
10
12
  `}
11
- <div class="pin-marker-name">${s}</div>
13
+ <div class="pin-marker-name">${r}</div>
12
14
  </div>
13
- `},ze=t=>{const{discountRate:s,price:r,originalPrice:e,category:o,active:l,title:n}=t;return`
15
+ `},$t=e=>{const{discountRate:r,price:o,originalPrice:t,category:n,active:l,title:s}=e;return`
14
16
  <div class="popdeal-marker" active="${!!l}">
15
17
  <div class="popdeal-marker-section">
16
18
  <div class="popdeal-marker-section-header">
17
- <span class="popdeal-marker-title">${n}</span>
18
- ${o?`<span class="popdeal-marker-category">${o}</span>`:""}
19
+ <span class="popdeal-marker-title">${s}</span>
20
+ ${n?`<span class="popdeal-marker-category">${n}</span>`:""}
19
21
  </div>
20
22
  <div class="popdeal-marker-section-price">
21
- ${e?`<span class="popdeal-marker-original_price">${e.toLocaleString()}원</span>`:""}
22
- ${s?`<span class="popdeal-marker-discount_rate">${s}%</span>`:""}
23
- <span class="popdeal-marker-discounted_price">${r.toLocaleString()}원</span>
23
+ ${t?`<span class="popdeal-marker-original_price">${t.toLocaleString()}원</span>`:""}
24
+ ${r?`<span class="popdeal-marker-discount_rate">${r}%</span>`:""}
25
+ <span class="popdeal-marker-discounted_price">${o.toLocaleString()}원</span>
24
26
  </div>
25
27
  </div>
26
28
  </div>
27
- `},He=t=>{const{title:s,icon:r}=t;return`
29
+ `},Wt=e=>{const{title:r,icon:o}=e;return`
28
30
  <div class="pi-marker">
29
- ${r?`<img class="pi-marker-icon" src="${r}" alt="" width="32px" height="32px" />`:""}
30
- <span class="pi-marker-text">${s}</span>
31
+ ${o?`<img class="pi-marker-icon" src="${o}" alt="" width="32px" height="32px" />`:""}
32
+ <span class="pi-marker-text">${r}</span>
31
33
  </div>
32
- `},We=t=>{const{title:s,icon:r,address:e}=t;return`
34
+ `},Yt=e=>{const{title:r,icon:o,address:t}=e;return`
33
35
  <div class="pi-expanded-marker">
34
- ${r?`<img class="pi-expanded-marker-icon" src="${r}" alt="" width="32px" height="32px" />`:""}
36
+ ${o?`<img class="pi-expanded-marker-icon" src="${o}" alt="" width="32px" height="32px" />`:""}
35
37
  <div class="pi-expanded-marker-content">
36
- <div class="pi-expanded-marker-title">${s}</div>
37
- ${e?`<div class="pi-expanded-marker-address">${e}</div>`:""}
38
+ <div class="pi-expanded-marker-title">${r}</div>
39
+ ${t?`<div class="pi-expanded-marker-address">${t}</div>`:""}
38
40
  </div>
39
41
  </div>
40
- `},Ue=t=>`
42
+ `},Zt=e=>`
41
43
  <div class="cluster-marker">
42
- <span class="cluster-marker-text">${t.count}</span>
44
+ <span class="cluster-marker-text">${e.count}</span>
43
45
  </div>
44
- `,J=t=>{switch(t.type){case"pin":return $e(t);case"popdeal":return ze(t);case"pi":return He(t);case"pi-expanded":return We(t);case"cluster":return Ue(t);default:return""}},oe=`
46
+ `,ge=e=>{switch(e.type){case"pin":return Ht(e);case"popdeal":return $t(e);case"pi":return Wt(e);case"pi-expanded":return Yt(e);case"cluster":return Zt(e);default:return""}},ze=`
45
47
  /* Common marker styles */
46
48
  [class$="marker"] {
47
49
  user-select: none;
@@ -316,13 +318,13 @@
316
318
  background: #00C4C4;
317
319
  transform: translate(-50%) rotate(45deg);
318
320
  }
319
- `,se=m.createContext(null),ne="naver-map-script",Ze=(t,s)=>new Promise((r,e)=>{if(typeof window<"u"&&window.naver?.maps){r();return}const o=document.getElementById(ne);if(o){o.addEventListener("load",()=>r()),o.addEventListener("error",()=>e(new Error("Failed to load Naver Map script")));return}const l=document.createElement("script");l.id=ne,l.src=`https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=${t}&language=${s}`,l.async=!0,l.onload=()=>{r()},l.onerror=()=>{e(new Error("Failed to load Naver Map script"))},document.head.appendChild(l)}),le=({clientId:t,language:s="ko",children:r})=>{const[e,o]=m.useState(null),[l,n]=m.useState({}),[c,d]=m.useState(null);m.useEffect(()=>{typeof window>"u"||Ze(t,s).then(()=>{window.naver&&o(window.naver)}).catch(u=>{console.error("Naver Map script loading failed:",u),d(u)})},[t,s]);const h=m.useCallback((u,_)=>{const g=e||(typeof window<"u"?window.naver:null);if(!g||(!e&&window.naver&&o(window.naver),!u.current))return null;const p=u.current;if(!p.isConnected)return null;try{const C={center:new g.maps.LatLng(37.5665,126.978),zoom:11,maxZoom:20,minZoom:11,mapTypeControl:!1,scaleControl:!1,logoControl:!1,mapDataControl:!1,zoomControl:!1,..._},y=new g.maps.Map(p,C);return n(T=>{const B=p.getAttribute("id")||"default";return{...T,[B]:y}}),y}catch(C){return console.error("Map creation error:",C),null}},[e]);return c&&console.error("NaverMapProvider error:",c),a.jsx(se.Provider,{value:{naver:e,createMap:h,maps:l},children:r})},K=()=>{const t=m.useContext(se);if(!t)throw new Error("useNaverMap must be used within NaverMapProvider");return t};function ae(t){const s=function(e){this.DEFAULT_OPTIONS={map:null,markers:[],disableClickZoom:!0,minClusterSize:2,maxZoom:13,gridSize:100,icons:[],indexGenerator:[10,100,200,500,1e3],averageCenter:!1,stylingFunction:function(){}},this._clusters=[],this._mapRelations=null,this._markerRelations=[],this.setOptions(t.maps.Util.extend({},this.DEFAULT_OPTIONS,e),!0),this.setMap(e.map||null)};t.maps.Util.ClassExtend(s,t.maps.OverlayView,{onAdd:function(){const e=this.getMap();this._mapRelations=t.maps.Event.addListener(e,"idle",t.maps.Util.bind(this._onIdle,this)),this.getMarkers().length>0&&(this._createClusters(),this._updateClusters())},draw:t.maps.Util.noop,onRemove:function(){t.maps.Event.removeListener(this._mapRelation),this._clearClusters(),this._geoTree=null,this._mapRelation=null},setOptions:function(e){const o=this;if(typeof e=="string"){const l=e,n=arguments[1];o.set(l,n)}else{const l=arguments[1];t.maps.Util.forEach(e,function(n,c){c!=="map"&&o.set(c,n)}),e.map&&!l&&o.setMap(e.map)}},getOptions:function(e){const o=this,l={};return e!==void 0?o.get(e):(t.maps.Util.forEach(o.DEFAULT_OPTIONS,function(n,c){l[c]=o.get(c)}),l)},getMinClusterSize:function(){return this.getOptions("minClusterSize")},setMinClusterSize:function(e){this.setOptions("minClusterSize",e)},getMaxZoom:function(){return this.getOptions("maxZoom")},setMaxZoom:function(e){this.setOptions("maxZoom",e)},getGridSize:function(){return this.getOptions("gridSize")},setGridSize:function(e){this.setOptions("gridSize",e)},getIndexGenerator:function(){return this.getOptions("indexGenerator")},setIndexGenerator:function(e){this.setOptions("indexGenerator",e)},getMarkers:function(){return this.getOptions("markers")},setMarkers:function(e){this.setOptions("markers",e)},getIcons:function(){return this.getOptions("icons")},setIcons:function(e){this.setOptions("icons",e)},getStylingFunction:function(){return this.getOptions("stylingFunction")},setStylingFunction:function(e){this.setOptions("stylingFunction",e)},getDisableClickZoom:function(){return this.getOptions("disableClickZoom")},setDisableClickZoom:function(e){this.setOptions("disableClickZoom",e)},getAverageCenter:function(){return this.getOptions("averageCenter")},setAverageCenter:function(e){this.setOptions("averageCenter",e)},changed:function(e,o){if(this.getMap())switch(e){case"marker":case"minClusterSize":case"gridSize":case"averageCenter":this._redraw();break;case"indexGenerator":case"icons":this._clusters.forEach(function(n){n.updateIcon()});break;case"maxZoom":this._clusters.forEach(function(n){n.getCount()>1&&n.checkByZoomAndMinClusterSize()});break;case"stylingFunction":this._clusters.forEach(function(n){n.updateCount()});break;case"disableClickZoom":let l="enableClickZoom";o&&(l="disableClickZoom"),this._clusters.forEach(function(n){n[l]()});break}},_createClusters:function(){const e=this.getMap();if(!e)return;const o=e.getBounds(),l=this.getMarkers();for(let n=0,c=l.length;n<c;n++){const d=l[n],h=d.getPosition();if(!o.hasLatLng(h))continue;this._getClosestCluster(h).addMarker(d),this._markerRelations.push(t.maps.Event.addListener(d,"dragend",t.maps.Util.bind(this._onDragEnd,this)))}},_updateClusters:function(){const e=this._clusters;for(let o=0,l=e.length;o<l;o++)e[o].updateCluster()},_clearClusters:function(){const e=this._clusters;for(let o=0,l=e.length;o<l;o++)e[o].destroy();t.maps.Event.removeListener(this._markerRelations),this._markerRelations=[],this._clusters=[]},_redraw:function(){this._clearClusters(),this._createClusters(),this._updateClusters()},_getClosestCluster:function(e){const o=this.getProjection(),l=this._clusters;let n=null,c=1/0;for(let d=0,h=l.length;d<h;d++){const u=l[d],_=u.getCenter();if(u.isInBounds(e)){const g=o.getDistance(_,e);g<c&&(c=g,n=u)}}return n||(n=new r(this),this._clusters.push(n)),n},_onIdle:function(){this._redraw()},_onDragEnd:function(){this._redraw()}});const r=function(e){this._clusterCenter=null,this._clusterBounds=null,this._clusterMarker=null,this._relation=null,this._clusterMember=[],this._markerClusters=e};return r.prototype={constructor:r,addMarker:function(e){if(!this._isMember(e)){if(!this._clusterCenter){const o=e.getPosition();this._clusterCenter=o,this._clusterBounds=this._calcBounds(o)}this._clusterMember.push(e)}},destroy:function(){t.maps.Event.removeListener(this._relation);const e=this._clusterMember;for(let o=0,l=e.length;o<l;o++)e[o].setMap(null);this._clusterMarker.setMap(null),this._clusterMarker=null,this._clusterCenter=null,this._clusterBounds=null,this._relation=null,this._clusterMember=[]},getCenter:function(){return this._clusterCenter},getBounds:function(){return this._clusterBounds},getCount:function(){return this._clusterMember.length},getClusterMember:function(){return this._clusterMember},isInBounds:function(e){return this._clusterBounds&&this._clusterBounds.hasLatLng(e)},enableClickZoom:function(){if(this._relation)return;const e=this._markerClusters.getMap();this._relation=t.maps.Event.addListener(this._clusterMarker,"click",t.maps.Util.bind(function(o){e.morph(o.coord,e.getZoom()+1)},this))},disableClickZoom:function(){this._relation&&(t.maps.Event.removeListener(this._relation),this._relation=null)},updateCluster:function(){if(!this._clusterMarker){let e;this._markerClusters.getAverageCenter()?e=this._calcAverageCenter(this._clusterMember):e=this._clusterCenter,this._clusterMarker=new t.maps.Marker({position:e,map:this._markerClusters.getMap()}),this._markerClusters.getDisableClickZoom()||this.enableClickZoom()}this.updateIcon(),this.updateCount(),this.checkByZoomAndMinClusterSize()},checkByZoomAndMinClusterSize:function(){const e=this._markerClusters,o=e.getMinClusterSize(),l=e.getMaxZoom(),n=e.getMap().getZoom();this.getCount()<o?this._showMember():(this._hideMember(),l<=n&&this._showMember())},updateCount:function(){const e=this._markerClusters.getStylingFunction();e&&e(this._clusterMarker,this.getCount())},updateIcon:function(){const e=this.getCount();let o=this._getIndex(e);const l=this._markerClusters.getIcons();o=Math.max(o,0),o=Math.min(o,l.length-1),this._clusterMarker.setIcon(l[o])},_showMember:function(){const e=this._markerClusters.getMap(),o=this._clusterMarker,l=this._clusterMember;for(let n=0,c=l.length;n<c;n++)l[n].setMap(e);o&&o.setMap(null)},_hideMember:function(){const e=this._markerClusters.getMap(),o=this._clusterMarker,l=this._clusterMember;for(let n=0,c=l.length;n<c;n++)l[n].setMap(null);o&&!o.getMap()&&o.setMap(e)},_calcBounds:function(e){const o=this._markerClusters.getMap(),l=new t.maps.LatLngBounds(e.clone(),e.clone()),n=o.getBounds(),c=o.getProjection(),d=c.fromCoordToOffset(n.getNE()),h=c.fromCoordToOffset(n.getSW()),u=c.fromCoordToOffset(l.getNE()),_=c.fromCoordToOffset(l.getSW()),g=this._markerClusters.getGridSize()/2;u.add(g,-g),_.add(-g,g);const p=Math.min(d.x,u.x),C=Math.max(d.y,u.y),y=Math.max(h.x,_.x),T=Math.min(h.y,_.y),B=c.fromOffsetToCoord(new t.maps.Point(p,C)),S=c.fromOffsetToCoord(new t.maps.Point(y,T));return new t.maps.LatLngBounds(S,B)},_getIndex:function(e){const o=this._markerClusters.getIndexGenerator();if(t.maps.Util.isFunction(o))return o(e);if(t.maps.Util.isArray(o)){let l=0;for(let n=0,c=o.length;n<c;n++){const d=o[n];if(e<d)break;l++}return l}return 0},_isMember:function(e){return this._clusterMember.indexOf(e)!==-1},_calcAverageCenter:function(e){const o=e.length,l=[0,0];for(let n=0;n<o;n++)l[0]+=e[n].position.x,l[1]+=e[n].position.y;return l[0]/=o,l[1]/=o,new t.maps.Point(l[0],l[1])}},s}const ie=t=>{const{naver:s}=K(),[r,e]=m.useState([]),o=m.useRef(new Map),l=m.useRef(null),n=m.useCallback(_=>{if(!t||!s)return null;const g=J(_),p=new s.maps.Marker({..._,position:new s.maps.LatLng(_.position.latitude,_.position.longitude),map:t,icon:{content:g}});return _.onClick&&s.maps.Event.addListener(p,"click",()=>{_.onClick(_.id)}),e(C=>[...C,p]),o.current.set(_.id,{marker:p,data:_}),p},[t,s]),c=m.useCallback((_,g)=>{const p=o.current.get(_);if(!p||!s)return;const{marker:C,data:y}=p,T={...y,...g},B=C.getElement();if(B){const S=B.querySelector(".popdeal-marker");S&&"active"in g&&S.setAttribute("active",String(!!g.active))}o.current.set(_,{marker:C,data:T})},[s]),d=m.useCallback(()=>{r.forEach(_=>{_&&_.setMap(null)}),e([]),o.current.clear(),l.current&&(l.current.setMap(null),l.current=null)},[r]),h=m.useCallback(_=>{!t||!s||t.panTo(new s.maps.LatLng(_.latitude,_.longitude))},[t,s]),u=m.useCallback(_=>{if(!t||!s||_.length===0)return;const g=new s.maps.LatLngBounds(new s.maps.LatLng(_[0].latitude,_[0].longitude),new s.maps.LatLng(_[0].latitude,_[0].longitude));_.forEach(p=>{g.extend(new s.maps.LatLng(p.latitude,p.longitude))}),t.fitBounds(g)},[t,s]);return m.useEffect(()=>{if(!s||!t||r.length===0)return;const _=ae(s),p={content:J({type:"cluster",count:0}),size:new s.maps.Size(96,96),anchor:new s.maps.Point(20,20)},C=new _({minClusterSize:2,maxZoom:17,map:t,markers:r,disableClickZoom:!1,gridSize:120,icons:[p],indexGenerator:[10,100,200,500,1e3],averageCenter:!1,stylingFunction:(y,T)=>{if(y&&typeof y.getElement=="function"){const B=y.getElement().querySelector(".cluster-marker-text");B&&(B.textContent=String(T))}}});return l.current=C,()=>{C.setMap(null)}},[s,t,r]),{addMarker:n,updateMarker:c,clearMarkers:d,panTo:h,fitBounds:u}},Q=({options:t,onLoad:s})=>{const r=m.useRef(null),e=m.useRef(null),{createMap:o}=K(),[l,n]=m.useState(null),c=ie(l),{width:d="100%",height:h="100%",...u}=t||{},_=m.useMemo(()=>u,[JSON.stringify(u)]);return m.useEffect(()=>{if(typeof document>"u"||document.getElementById("pop-ui-map-marker-styles"))return;const p=document.createElement("style");return p.id="pop-ui-map-marker-styles",p.textContent=oe,document.head.appendChild(p),e.current=p,()=>{}},[]),m.useEffect(()=>{let g=null,p=null;if(l&&(l.destroy(),n(null)),r.current&&r.current.isConnected){const C=()=>r.current&&r.current.isConnected&&(g=o(r,_),g)?(n(g),!0):!1;if(!C()){let y=0;const T=50;p=setInterval(()=>{y++,(C()||y>=T)&&p&&(clearInterval(p),p=null)},100)}return()=>{p&&clearInterval(p),g&&(g.destroy(),g=null)}}return()=>{p&&clearInterval(p),g&&(g.destroy(),g=null)}},[o,_]),m.useEffect(()=>{l&&s&&s({map:l,...c})},[l,s,c]),a.jsx("div",{ref:r,style:{width:typeof d=="number"?`${d}px`:d,height:typeof h=="number"?`${h}px`:h}})};Q.displayName="Map";const Ye="위치 정보를 불러오는 데 실패했어요.",Ve="위치 서비스 권한과 네트워크 상태를 확인해주세요.",je=({isActive:t=!1,errorMessage:s=Ye,errorDescription:r=Ve})=>{const[e,o]=m.useState(!1),[l,n]=m.useState(!1),[c,d]=m.useState(null),h=m.useRef(!1);return m.useEffect(()=>{if(t&&typeof navigator<"u"&&"geolocation"in navigator){if(h.current)return;h.current=!0,requestAnimationFrame(()=>{o(!0)});const u={enableHighAccuracy:!0,timeout:1e4,maximumAge:0};navigator.geolocation.getCurrentPosition(_=>{d({latitude:_.coords.latitude,longitude:_.coords.longitude}),o(!1),n(!1),h.current=!1},_=>{d(null),console.error("Geolocation error:",_),N({message:`${s} ${r}`}),o(!1),n(!0),h.current=!1},u)}},[t,s,r]),{position:c,isLoading:e,isError:l}},ce=(t="light")=>{const s=[];return Object.entries(i.colors).forEach(([r,e])=>{Object.entries(e).forEach(([o,l])=>{const n=i.getCSSVariableName(r,o);s.push(`${n}: ${l};`)})}),s.join(`
320
- `)},Ge=(t="light")=>{const s=document.getElementById("pop-ui-theme-vars");s&&s.remove();const r=document.createElement("style");r.id="pop-ui-theme-vars",r.textContent=`
321
+ `,He=h.createContext(null),$e="naver-map-script",Vt=(e,r)=>new Promise((o,t)=>{if(typeof window<"u"&&window.naver?.maps){o();return}const n=document.getElementById($e);if(n){n.addEventListener("load",()=>o()),n.addEventListener("error",()=>t(new Error("Failed to load Naver Map script")));return}const l=document.createElement("script");l.id=$e,l.src=`https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=${e}&language=${r}`,l.async=!0,l.onload=()=>{o()},l.onerror=()=>{t(new Error("Failed to load Naver Map script"))},document.head.appendChild(l)}),We=({clientId:e,language:r="ko",children:o})=>{const[t,n]=h.useState(null),[l,s]=h.useState({}),[i,_]=h.useState(null);h.useEffect(()=>{typeof window>"u"||Vt(e,r).then(()=>{window.naver&&n(window.naver)}).catch(d=>{console.error("Naver Map script loading failed:",d),_(d)})},[e,r]);const p=h.useCallback((d,c)=>{const m=t||(typeof window<"u"?window.naver:null);if(!m||(!t&&window.naver&&n(window.naver),!d.current))return null;const u=d.current;if(!u.isConnected)return null;try{const f={center:new m.maps.LatLng(37.5665,126.978),zoom:11,maxZoom:20,minZoom:11,mapTypeControl:!1,scaleControl:!1,logoControl:!1,mapDataControl:!1,zoomControl:!1,...c},k=new m.maps.Map(u,f);return s(M=>{const w=u.getAttribute("id")||"default";return{...M,[w]:k}}),k}catch(f){return console.error("Map creation error:",f),null}},[t]);return i&&console.error("NaverMapProvider error:",i),a.jsx(He.Provider,{value:{naver:t,createMap:p,maps:l},children:o})},ke=()=>{const e=h.useContext(He);if(!e)throw new Error("useNaverMap must be used within NaverMapProvider");return e};function Ye(e){const r=function(t){this.DEFAULT_OPTIONS={map:null,markers:[],disableClickZoom:!0,minClusterSize:2,maxZoom:13,gridSize:100,icons:[],indexGenerator:[10,100,200,500,1e3],averageCenter:!1,stylingFunction:function(){}},this._clusters=[],this._mapRelations=null,this._markerRelations=[],this.setOptions(e.maps.Util.extend({},this.DEFAULT_OPTIONS,t),!0),this.setMap(t.map||null)};e.maps.Util.ClassExtend(r,e.maps.OverlayView,{onAdd:function(){const t=this.getMap();this._mapRelations=e.maps.Event.addListener(t,"idle",e.maps.Util.bind(this._onIdle,this)),this.getMarkers().length>0&&(this._createClusters(),this._updateClusters())},draw:e.maps.Util.noop,onRemove:function(){e.maps.Event.removeListener(this._mapRelation),this._clearClusters(),this._geoTree=null,this._mapRelation=null},setOptions:function(t){const n=this;if(typeof t=="string"){const l=t,s=arguments[1];n.set(l,s)}else{const l=arguments[1];e.maps.Util.forEach(t,function(s,i){i!=="map"&&n.set(i,s)}),t.map&&!l&&n.setMap(t.map)}},getOptions:function(t){const n=this,l={};return t!==void 0?n.get(t):(e.maps.Util.forEach(n.DEFAULT_OPTIONS,function(s,i){l[i]=n.get(i)}),l)},getMinClusterSize:function(){return this.getOptions("minClusterSize")},setMinClusterSize:function(t){this.setOptions("minClusterSize",t)},getMaxZoom:function(){return this.getOptions("maxZoom")},setMaxZoom:function(t){this.setOptions("maxZoom",t)},getGridSize:function(){return this.getOptions("gridSize")},setGridSize:function(t){this.setOptions("gridSize",t)},getIndexGenerator:function(){return this.getOptions("indexGenerator")},setIndexGenerator:function(t){this.setOptions("indexGenerator",t)},getMarkers:function(){return this.getOptions("markers")},setMarkers:function(t){this.setOptions("markers",t)},getIcons:function(){return this.getOptions("icons")},setIcons:function(t){this.setOptions("icons",t)},getStylingFunction:function(){return this.getOptions("stylingFunction")},setStylingFunction:function(t){this.setOptions("stylingFunction",t)},getDisableClickZoom:function(){return this.getOptions("disableClickZoom")},setDisableClickZoom:function(t){this.setOptions("disableClickZoom",t)},getAverageCenter:function(){return this.getOptions("averageCenter")},setAverageCenter:function(t){this.setOptions("averageCenter",t)},changed:function(t,n){if(this.getMap())switch(t){case"marker":case"minClusterSize":case"gridSize":case"averageCenter":this._redraw();break;case"indexGenerator":case"icons":this._clusters.forEach(function(s){s.updateIcon()});break;case"maxZoom":this._clusters.forEach(function(s){s.getCount()>1&&s.checkByZoomAndMinClusterSize()});break;case"stylingFunction":this._clusters.forEach(function(s){s.updateCount()});break;case"disableClickZoom":let l="enableClickZoom";n&&(l="disableClickZoom"),this._clusters.forEach(function(s){s[l]()});break}},_createClusters:function(){const t=this.getMap();if(!t)return;const n=t.getBounds(),l=this.getMarkers();for(let s=0,i=l.length;s<i;s++){const _=l[s],p=_.getPosition();if(!n.hasLatLng(p))continue;this._getClosestCluster(p).addMarker(_),this._markerRelations.push(e.maps.Event.addListener(_,"dragend",e.maps.Util.bind(this._onDragEnd,this)))}},_updateClusters:function(){const t=this._clusters;for(let n=0,l=t.length;n<l;n++)t[n].updateCluster()},_clearClusters:function(){const t=this._clusters;for(let n=0,l=t.length;n<l;n++)t[n].destroy();e.maps.Event.removeListener(this._markerRelations),this._markerRelations=[],this._clusters=[]},_redraw:function(){this._clearClusters(),this._createClusters(),this._updateClusters()},_getClosestCluster:function(t){const n=this.getProjection(),l=this._clusters;let s=null,i=1/0;for(let _=0,p=l.length;_<p;_++){const d=l[_],c=d.getCenter();if(d.isInBounds(t)){const m=n.getDistance(c,t);m<i&&(i=m,s=d)}}return s||(s=new o(this),this._clusters.push(s)),s},_onIdle:function(){this._redraw()},_onDragEnd:function(){this._redraw()}});const o=function(t){this._clusterCenter=null,this._clusterBounds=null,this._clusterMarker=null,this._relation=null,this._clusterMember=[],this._markerClusters=t};return o.prototype={constructor:o,addMarker:function(t){if(!this._isMember(t)){if(!this._clusterCenter){const n=t.getPosition();this._clusterCenter=n,this._clusterBounds=this._calcBounds(n)}this._clusterMember.push(t)}},destroy:function(){e.maps.Event.removeListener(this._relation);const t=this._clusterMember;for(let n=0,l=t.length;n<l;n++)t[n].setMap(null);this._clusterMarker.setMap(null),this._clusterMarker=null,this._clusterCenter=null,this._clusterBounds=null,this._relation=null,this._clusterMember=[]},getCenter:function(){return this._clusterCenter},getBounds:function(){return this._clusterBounds},getCount:function(){return this._clusterMember.length},getClusterMember:function(){return this._clusterMember},isInBounds:function(t){return this._clusterBounds&&this._clusterBounds.hasLatLng(t)},enableClickZoom:function(){if(this._relation)return;const t=this._markerClusters.getMap();this._relation=e.maps.Event.addListener(this._clusterMarker,"click",e.maps.Util.bind(function(n){t.morph(n.coord,t.getZoom()+1)},this))},disableClickZoom:function(){this._relation&&(e.maps.Event.removeListener(this._relation),this._relation=null)},updateCluster:function(){if(!this._clusterMarker){let t;this._markerClusters.getAverageCenter()?t=this._calcAverageCenter(this._clusterMember):t=this._clusterCenter,this._clusterMarker=new e.maps.Marker({position:t,map:this._markerClusters.getMap()}),this._markerClusters.getDisableClickZoom()||this.enableClickZoom()}this.updateIcon(),this.updateCount(),this.checkByZoomAndMinClusterSize()},checkByZoomAndMinClusterSize:function(){const t=this._markerClusters,n=t.getMinClusterSize(),l=t.getMaxZoom(),s=t.getMap().getZoom();this.getCount()<n?this._showMember():(this._hideMember(),l<=s&&this._showMember())},updateCount:function(){const t=this._markerClusters.getStylingFunction();t&&t(this._clusterMarker,this.getCount())},updateIcon:function(){const t=this.getCount();let n=this._getIndex(t);const l=this._markerClusters.getIcons();n=Math.max(n,0),n=Math.min(n,l.length-1),this._clusterMarker.setIcon(l[n])},_showMember:function(){const t=this._markerClusters.getMap(),n=this._clusterMarker,l=this._clusterMember;for(let s=0,i=l.length;s<i;s++)l[s].setMap(t);n&&n.setMap(null)},_hideMember:function(){const t=this._markerClusters.getMap(),n=this._clusterMarker,l=this._clusterMember;for(let s=0,i=l.length;s<i;s++)l[s].setMap(null);n&&!n.getMap()&&n.setMap(t)},_calcBounds:function(t){const n=this._markerClusters.getMap(),l=new e.maps.LatLngBounds(t.clone(),t.clone()),s=n.getBounds(),i=n.getProjection(),_=i.fromCoordToOffset(s.getNE()),p=i.fromCoordToOffset(s.getSW()),d=i.fromCoordToOffset(l.getNE()),c=i.fromCoordToOffset(l.getSW()),m=this._markerClusters.getGridSize()/2;d.add(m,-m),c.add(-m,m);const u=Math.min(_.x,d.x),f=Math.max(_.y,d.y),k=Math.max(p.x,c.x),M=Math.min(p.y,c.y),w=i.fromOffsetToCoord(new e.maps.Point(u,f)),L=i.fromOffsetToCoord(new e.maps.Point(k,M));return new e.maps.LatLngBounds(L,w)},_getIndex:function(t){const n=this._markerClusters.getIndexGenerator();if(e.maps.Util.isFunction(n))return n(t);if(e.maps.Util.isArray(n)){let l=0;for(let s=0,i=n.length;s<i;s++){const _=n[s];if(t<_)break;l++}return l}return 0},_isMember:function(t){return this._clusterMember.indexOf(t)!==-1},_calcAverageCenter:function(t){const n=t.length,l=[0,0];for(let s=0;s<n;s++)l[0]+=t[s].position.x,l[1]+=t[s].position.y;return l[0]/=n,l[1]/=n,new e.maps.Point(l[0],l[1])}},r}const Ze=e=>{const{naver:r}=ke(),[o,t]=h.useState([]),n=h.useRef(new Map),l=h.useRef(null),s=h.useCallback(c=>{if(!e||!r)return null;const m=ge(c),u=new r.maps.Marker({...c,position:new r.maps.LatLng(c.position.latitude,c.position.longitude),map:e,icon:{content:m}});return c.onClick&&r.maps.Event.addListener(u,"click",()=>{c.onClick(c.id)}),t(f=>[...f,u]),n.current.set(c.id,{marker:u,data:c}),u},[e,r]),i=h.useCallback((c,m)=>{const u=n.current.get(c);if(!u||!r)return;const{marker:f,data:k}=u,M={...k,...m},w=f.getElement();if(w){const L=w.querySelector(".popdeal-marker");L&&"active"in m&&L.setAttribute("active",String(!!m.active))}n.current.set(c,{marker:f,data:M})},[r]),_=h.useCallback(()=>{o.forEach(c=>{c&&c.setMap(null)}),t([]),n.current.clear(),l.current&&(l.current.setMap(null),l.current=null)},[o]),p=h.useCallback(c=>{!e||!r||e.panTo(new r.maps.LatLng(c.latitude,c.longitude))},[e,r]),d=h.useCallback(c=>{if(!e||!r||c.length===0)return;const m=new r.maps.LatLngBounds(new r.maps.LatLng(c[0].latitude,c[0].longitude),new r.maps.LatLng(c[0].latitude,c[0].longitude));c.forEach(u=>{m.extend(new r.maps.LatLng(u.latitude,u.longitude))}),e.fitBounds(m)},[e,r]);return h.useEffect(()=>{if(!r||!e||o.length===0)return;const c=Ye(r),u={content:ge({type:"cluster",count:0}),size:new r.maps.Size(96,96),anchor:new r.maps.Point(20,20)},f=new c({minClusterSize:2,maxZoom:17,map:e,markers:o,disableClickZoom:!1,gridSize:120,icons:[u],indexGenerator:[10,100,200,500,1e3],averageCenter:!1,stylingFunction:(k,M)=>{if(k&&typeof k.getElement=="function"){const w=k.getElement().querySelector(".cluster-marker-text");w&&(w.textContent=String(M))}}});return l.current=f,()=>{f.setMap(null)}},[r,e,o]),{addMarker:s,updateMarker:i,clearMarkers:_,panTo:p,fitBounds:d}},ye=({options:e,onLoad:r})=>{const o=h.useRef(null),t=h.useRef(null),{createMap:n}=ke(),[l,s]=h.useState(null),i=Ze(l),{width:_="100%",height:p="100%",...d}=e||{},c=h.useMemo(()=>d,[JSON.stringify(d)]);return h.useEffect(()=>{if(typeof document>"u"||document.getElementById("pop-ui-map-marker-styles"))return;const u=document.createElement("style");return u.id="pop-ui-map-marker-styles",u.textContent=ze,document.head.appendChild(u),t.current=u,()=>{}},[]),h.useEffect(()=>{let m=null,u=null;if(l&&(l.destroy(),s(null)),o.current&&o.current.isConnected){const f=()=>o.current&&o.current.isConnected&&(m=n(o,c),m)?(s(m),!0):!1;if(!f()){let k=0;const M=50;u=setInterval(()=>{k++,(f()||k>=M)&&u&&(clearInterval(u),u=null)},100)}return()=>{u&&clearInterval(u),m&&(m.destroy(),m=null)}}return()=>{u&&clearInterval(u),m&&(m.destroy(),m=null)}},[n,c]),h.useEffect(()=>{l&&r&&r({map:l,...i})},[l,r,i]),a.jsx("div",{ref:o,style:{width:typeof _=="number"?`${_}px`:_,height:typeof p=="number"?`${p}px`:p}})};ye.displayName="Map";const Ut="위치 정보를 불러오는 데 실패했어요.",jt="위치 서비스 권한과 네트워크 상태를 확인해주세요.",Gt=({isActive:e=!1,errorMessage:r=Ut,errorDescription:o=jt})=>{const[t,n]=h.useState(!1),[l,s]=h.useState(!1),[i,_]=h.useState(null),p=h.useRef(!1);return h.useEffect(()=>{if(e&&typeof navigator<"u"&&"geolocation"in navigator){if(p.current)return;p.current=!0,requestAnimationFrame(()=>{n(!0)});const d={enableHighAccuracy:!0,timeout:1e4,maximumAge:0};navigator.geolocation.getCurrentPosition(c=>{_({latitude:c.coords.latitude,longitude:c.coords.longitude}),n(!1),s(!1),p.current=!1},c=>{_(null),console.error("Geolocation error:",c),X({message:`${r} ${o}`}),n(!1),s(!0),p.current=!1},d)}},[e,r,o]),{position:i,isLoading:t,isError:l}},Ve=(e="light")=>{const r=[];return Object.entries(y.colors).forEach(([o,t])=>{Object.entries(t).forEach(([n,l])=>{const s=y.getCSSVariableName(o,n);r.push(`${s}: ${l};`)})}),r.join(`
322
+ `)},qt=(e="light")=>{const r=document.getElementById("pop-ui-theme-vars");r&&r.remove();const o=document.createElement("style");o.id="pop-ui-theme-vars",o.textContent=`
321
323
  :root {
322
- ${ce("light")}
324
+ ${Ve("light")}
323
325
  }
324
326
 
325
327
  [data-theme="dark"] {
326
- ${ce("dark")}
328
+ ${Ve("dark")}
327
329
  }
328
- `,document.head.appendChild(r)},D=t=>{const s=i.colors[t],r=Object.keys(s).sort((o,l)=>Number(o)-Number(l));return[i.getCSSVariableRef(t,r[0]||r[r.length-1]),i.getCSSVariableRef(t,r[1]||r[r.length-1]),i.getCSSVariableRef(t,r[2]||r[r.length-1]),i.getCSSVariableRef(t,r[3]||r[r.length-1]),i.getCSSVariableRef(t,r[4]||r[r.length-1]),i.getCSSVariableRef(t,r[5]||r[r.length-1]),i.getCSSVariableRef(t,r[6]||r[r.length-1]),i.getCSSVariableRef(t,r[7]||r[r.length-1]),i.getCSSVariableRef(t,r[8]||r[r.length-1]),i.getCSSVariableRef(t,r[9]||r[r.length-1])]},qe=x.createTheme({colors:{gray:D("gray"),aqua:D("aqua"),red:D("red"),orange:D("orange"),yellow:D("yellow"),green:D("green"),blue:D("blue"),purple:D("purple"),grape:D("grape")},primaryColor:"aqua",primaryShade:5,fontFamily:'Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}),de=m.createContext(void 0),_e=m.createContext({}),Je=({children:t,defaultTheme:s="light",naverClientId:r,notificationPosition:e="bottom-center",notificationLimit:o=5,notificationAutoClose:l,notificationZIndex:n})=>{const[c,d]=m.useState(s);m.useEffect(()=>{Ge(c),document.documentElement.setAttribute("data-theme",c)},[c]);const h=()=>{d(u=>u==="light"?"dark":"light")};return a.jsx(de.Provider,{value:{theme:c,setTheme:d,toggleTheme:h},children:a.jsx(_e.Provider,{value:{naverClientId:r},children:a.jsxs(x.MantineProvider,{theme:qe,children:[a.jsx(O.Notifications,{position:e,limit:o,autoClose:l,zIndex:n}),t]})})})},Ke=()=>{const t=m.useContext(de);if(!t)throw new Error("useTheme must be used within ThemeProvider");return t},Qe=()=>m.useContext(_e),I={MapInfo:"styles-module__MapInfo___scB-5",MapInfo__NoClientId:"styles-module__MapInfo__NoClientId___YBM4o",MapInfo__Preview:"styles-module__MapInfo__Preview___FJbQN",MapInfo__ExpandButton:"styles-module__MapInfo__ExpandButton___8KySg",MapInfo__AddressBar:"styles-module__MapInfo__AddressBar___mKkK6",MapInfo__AddressContent:"styles-module__MapInfo__AddressContent___XG1Uz",MapInfo__Address:"styles-module__MapInfo__Address___iXO6N",MapInfo__DirectionLink:"styles-module__MapInfo__DirectionLink___eGnf-",MapInfo__DirectionButton:"styles-module__MapInfo__DirectionButton___gTWpj"},Xe=60,Re=({location:t,marker:s,direction:r,toast:e,naverClientId:o,onExpandRequest:l,onClick:n,height:c=200})=>{const d=Qe(),h=o||d.naverClientId,{title:u,address:_,latitude:g,longitude:p}=t,C=r?.label??"길찾기",y=e?.addressCopied??"주소 복사 완료",[T,B]=m.useState(null),S=c-Xe,L=m.useCallback(M=>{M&&M.map&&B(M)},[]),W=m.useCallback(()=>{l?.()},[l]),E=m.useCallback((M,X,tt)=>{if(M&&M.map&&g&&p)try{M.addMarker(X),tt?.()}catch(rt){console.error("Error creating map marker:",rt)}},[g,p]),ue=m.useCallback((M,X)=>{M&&M.map&&g&&p&&(M.clearMarkers(),E(M,{id:`location-marker-${u}`,type:X,position:{latitude:g,longitude:p},title:u,icon:s?.imageUrl,address:_},()=>{M.panTo({latitude:g,longitude:p})}))},[g,p,u,s?.imageUrl,_,E]);m.useEffect(()=>{g&&p&&T&&ue(T,"pi")},[T,g,p,ue]),m.useEffect(()=>()=>{B(null)},[]);const pe=m.useCallback(()=>{typeof navigator<"u"&&navigator.clipboard&&(navigator.clipboard.writeText(_),N(y))},[_,y]),et=m.useMemo(()=>r?.url?r.url:`https://map.naver.com/p/search/${encodeURIComponent(u)}`,[r?.url,u]);return h?a.jsxs("div",{className:I.MapInfo,style:{height:c},onClick:n,children:[a.jsx(le,{clientId:h,children:a.jsxs("div",{className:I.MapInfo__Preview,onClick:W,children:[a.jsx(Q,{onLoad:L,options:{width:"100%",height:`${S}px`,center:{lat:g,lng:p},zoom:15,minZoom:15,maxZoom:15,draggable:!1,keyboardShortcuts:!1,mapTypeControl:!1,scaleControl:!1,logoControl:!1,mapDataControl:!1,zoomControl:!1}}),l&&a.jsx("div",{className:I.MapInfo__ExpandButton,children:a.jsx(i.IconMap,{color:i.ColorGray800,size:18})})]})}),a.jsxs("div",{className:I.MapInfo__AddressBar,children:[a.jsxs("div",{className:I.MapInfo__AddressContent,children:[a.jsx(i.IconMapMarker,{color:i.ColorAqua500,size:24,filled:!0}),a.jsx("span",{className:I.MapInfo__Address,onClick:pe,role:"button",tabIndex:0,onKeyDown:M=>M.key==="Enter"&&pe(),children:_})]}),a.jsx("a",{className:I.MapInfo__DirectionLink,href:et,target:"_blank",rel:"noreferrer",children:a.jsx(ee,{variant:"basic",size:"sm",className:I.MapInfo__DirectionButton,children:C})})]})]}):a.jsx("div",{className:I.MapInfo,style:{height:c},children:a.jsx("div",{className:I.MapInfo__NoClientId,children:"naverClientId가 필요합니다. PopUIProvider 또는 props로 전달해주세요."})})};f.Button=ee,f.CalendarDatePicker=ke,f.Checkbox=Ce,f.DatePicker=Me,f.Dropdown=Se,f.ImageUploader=we,f.Map=Q,f.MapInfo=Re,f.Modal=ve,f.NaverMapProvider=le,f.Pagination=Ie,f.PopUiProvider=Je,f.Radio=Le,f.SearchBar=Pe,f.SegmentButton=De,f.Tab=Fe,f.TextField=Ee,f.TimePicker=Ae,f.Toggle=Ne,f.Tooltip=Oe,f.getMarkerHTML=J,f.makeMarkerClustering=ae,f.markerStyles=oe,f.toast=N,f.useLocation=je,f.useMap=ie,f.useNaverMap=K,f.useTheme=Ke,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
330
+ `,document.head.appendChild(o)},q=e=>{const r=y.colors[e],o=Object.keys(r).sort((n,l)=>Number(n)-Number(l));return[y.getCSSVariableRef(e,o[0]||o[o.length-1]),y.getCSSVariableRef(e,o[1]||o[o.length-1]),y.getCSSVariableRef(e,o[2]||o[o.length-1]),y.getCSSVariableRef(e,o[3]||o[o.length-1]),y.getCSSVariableRef(e,o[4]||o[o.length-1]),y.getCSSVariableRef(e,o[5]||o[o.length-1]),y.getCSSVariableRef(e,o[6]||o[o.length-1]),y.getCSSVariableRef(e,o[7]||o[o.length-1]),y.getCSSVariableRef(e,o[8]||o[o.length-1]),y.getCSSVariableRef(e,o[9]||o[o.length-1])]},Kt=P.createTheme({colors:{gray:q("gray"),aqua:q("aqua"),red:q("red"),orange:q("orange"),yellow:q("yellow"),green:q("green"),blue:q("blue"),purple:q("purple"),grape:q("grape")},primaryColor:"aqua",primaryShade:5,fontFamily:'Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}),Ue=h.createContext(void 0),je=h.createContext({}),Jt=({children:e,defaultTheme:r="light",naverClientId:o,notificationPosition:t="bottom-center",notificationLimit:n=5,notificationAutoClose:l,notificationZIndex:s})=>{const[i,_]=h.useState(r);h.useEffect(()=>{qt(i),document.documentElement.setAttribute("data-theme",i)},[i]);const p=()=>{_(d=>d==="light"?"dark":"light")};return a.jsx(Ue.Provider,{value:{theme:i,setTheme:_,toggleTheme:p},children:a.jsx(je.Provider,{value:{naverClientId:o},children:a.jsxs(P.MantineProvider,{theme:Kt,children:[a.jsx(ee.Notifications,{position:t,limit:n,autoClose:l,zIndex:s}),e]})})})},Xt=()=>{const e=h.useContext(Ue);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e},Qt=()=>h.useContext(je),U={MapInfo:"styles-module__MapInfo___scB-5",MapInfo__NoClientId:"styles-module__MapInfo__NoClientId___YBM4o",MapInfo__Preview:"styles-module__MapInfo__Preview___FJbQN",MapInfo__ExpandButton:"styles-module__MapInfo__ExpandButton___8KySg",MapInfo__AddressBar:"styles-module__MapInfo__AddressBar___mKkK6",MapInfo__AddressContent:"styles-module__MapInfo__AddressContent___XG1Uz",MapInfo__Address:"styles-module__MapInfo__Address___iXO6N",MapInfo__DirectionLink:"styles-module__MapInfo__DirectionLink___eGnf-",MapInfo__DirectionButton:"styles-module__MapInfo__DirectionButton___gTWpj"},Rt=60,er=({location:e,marker:r,direction:o,toast:t,naverClientId:n,onExpandRequest:l,onClick:s,height:i=200})=>{const _=Qt(),p=n||_.naverClientId,{title:d,address:c,latitude:m,longitude:u}=e,f=o?.label??"길찾기",k=t?.addressCopied??"주소 복사 완료",[M,w]=h.useState(null),L=i-Rt,A=h.useCallback(x=>{x&&x.map&&w(x)},[]),z=h.useCallback(()=>{l?.()},[l]),N=h.useCallback((x,T,C)=>{if(x&&x.map&&m&&u)try{x.addMarker(T),C?.()}catch(D){console.error("Error creating map marker:",D)}},[m,u]),b=h.useCallback((x,T)=>{x&&x.map&&m&&u&&(x.clearMarkers(),N(x,{id:`location-marker-${d}`,type:T,position:{latitude:m,longitude:u},title:d,icon:r?.imageUrl,address:c},()=>{x.panTo({latitude:m,longitude:u})}))},[m,u,d,r?.imageUrl,c,N]);h.useEffect(()=>{m&&u&&M&&b(M,"pi")},[M,m,u,b]),h.useEffect(()=>()=>{w(null)},[]);const I=h.useCallback(()=>{typeof navigator<"u"&&navigator.clipboard&&(navigator.clipboard.writeText(c),X(k))},[c,k]),v=h.useMemo(()=>o?.url?o.url:`https://map.naver.com/p/search/${encodeURIComponent(d)}`,[o?.url,d]);return p?a.jsxs("div",{className:U.MapInfo,style:{height:i},onClick:s,children:[a.jsx(We,{clientId:p,children:a.jsxs("div",{className:U.MapInfo__Preview,onClick:z,children:[a.jsx(ye,{onLoad:A,options:{width:"100%",height:`${L}px`,center:{lat:m,lng:u},zoom:15,minZoom:15,maxZoom:15,draggable:!1,keyboardShortcuts:!1,mapTypeControl:!1,scaleControl:!1,logoControl:!1,mapDataControl:!1,zoomControl:!1}}),l&&a.jsx("div",{className:U.MapInfo__ExpandButton,children:a.jsx(y.IconMap,{color:y.ColorGray800,size:18})})]})}),a.jsxs("div",{className:U.MapInfo__AddressBar,children:[a.jsxs("div",{className:U.MapInfo__AddressContent,children:[a.jsx(y.IconMapMarker,{color:y.ColorAqua500,size:24,variant:"filled"}),a.jsx("span",{className:U.MapInfo__Address,onClick:I,role:"button",tabIndex:0,onKeyDown:x=>x.key==="Enter"&&I(),children:c})]}),a.jsx("a",{className:U.MapInfo__DirectionLink,href:v,target:"_blank",rel:"noreferrer",children:a.jsx(te,{variant:"basic",size:"sm",className:U.MapInfo__DirectionButton,children:f})})]})]}):a.jsx("div",{className:U.MapInfo,style:{height:i},children:a.jsx("div",{className:U.MapInfo__NoClientId,children:"naverClientId가 필요합니다. PopUIProvider 또는 props로 전달해주세요."})})};g.Button=te,g.CalendarDatePicker=xe,g.Checkbox=at,g.DatePicker=ut,g.Dropdown=pt,g.ImageInput=Dt,g.LottieInput=Tt,g.Map=ye,g.MapInfo=er,g.Modal=we,g.NaverMapProvider=We,g.Pagination=bt,g.PopUiProvider=Jt,g.Radio=Bt,g.SearchBar=Lt,g.SegmentButton=vt,g.Tab=Et,g.TextField=Nt,g.TimePicker=Ft,g.Toggle=Ot,g.Tooltip=zt,g.getMarkerHTML=ge,g.makeMarkerClustering=Ye,g.markerStyles=ze,g.toast=X,g.useLocation=Gt,g.useMap=Ze,g.useNaverMap=ke,g.useTheme=Xt,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
@@ -1,28 +1,27 @@
1
1
  import { AutocompleteProps } from '@mantine/core';
2
2
  import { ButtonProps } from '@mantine/core';
3
3
  import { CheckboxProps } from '@mantine/core';
4
- import { DatePickerInputProps } from '@mantine/dates';
5
4
  import { DatePickerProps } from '@mantine/dates';
6
5
  import { DateValue } from '@mantine/dates';
7
6
  import { default as default_2 } from 'react';
8
- import { DropzoneProps } from '@mantine/dropzone';
9
- import { FileWithPath } from '@mantine/dropzone';
10
7
  import { HTMLAttributes } from 'react';
11
8
  import { InputProps } from '@mantine/core';
12
9
  import { JSX } from 'react/jsx-runtime';
13
10
  import { ModalProps } from '@mantine/core';
14
11
  import { NotificationsProps } from '@mantine/notifications';
12
+ import { PopoverProps } from '@mantine/core';
15
13
  import { RadioProps } from '@mantine/core';
16
14
  import { ReactNode } from 'react';
17
15
  import { SegmentedControlProps } from '@mantine/core';
18
16
  import { SelectProps } from '@mantine/core';
19
17
  import { SwitchProps } from '@mantine/core';
20
18
  import { TabsProps } from '@mantine/core';
19
+ import { TDateDisplayType } from '@pop-ui/foundation';
21
20
  import { TextareaProps } from '@mantine/core';
22
21
  import { TimeInputProps } from '@mantine/dates';
23
22
  import { TooltipProps } from '@mantine/core';
24
23
 
25
- export declare function Button({ children, size, variant, isLoading, disabled, ...props }: IButtonProps): JSX.Element;
24
+ export declare function Button({ children, size, variant, isLoading, hideLabelOnLoading, disabled, className, classNames, loaderProps, ...props }: IButtonProps): JSX.Element;
26
25
 
27
26
  /**
28
27
  * CalendarDatePicker
@@ -36,7 +35,7 @@ export declare const CalendarDatePicker: ({ excludedDates, excludedDays, type, v
36
35
 
37
36
  export declare const Checkbox: ({ size, ...props }: ICheckboxProps) => JSX.Element;
38
37
 
39
- export declare const DatePicker: ({ size, type, withTime, ...props }: IDatePickerProps) => JSX.Element;
38
+ export declare const DatePicker: ({ size, type, withTime, className, popoverProps, rightSection, rightSectionWidth, value, defaultValue, onChange, placeholder, disabled, minDate, maxDate, displayValueFormat, valueFormat, excludedDates, excludedDays, highlightToday, }: IDatePickerProps) => JSX.Element;
40
39
 
41
40
  export declare const Dropdown: ({ label, labelPosition, size, required, tooltip, tooltipPosition, errorMsg, description, ...props }: IDropdownProps) => JSX.Element;
42
41
 
@@ -54,6 +53,7 @@ declare interface IButtonProps extends Omit<ButtonProps, 'variant' | 'styles'> {
54
53
  size?: TButtonSize;
55
54
  variant?: TButtonVariant;
56
55
  isLoading?: boolean;
56
+ hideLabelOnLoading?: boolean;
57
57
  }
58
58
 
59
59
  /**
@@ -116,10 +116,30 @@ export declare interface ICoord {
116
116
  longitude: number;
117
117
  }
118
118
 
119
- declare interface IDatePickerProps extends DatePickerInputProps {
119
+ declare interface IDatePickerProps {
120
120
  size?: 'sm' | 'md' | 'lg';
121
- type?: 'default' | 'multiple' | 'range';
121
+ type?: TDateDisplayType;
122
122
  withTime?: boolean;
123
+ value?: string | null | string[] | [string | null, string | null];
124
+ defaultValue?: string | null | string[] | [string | null, string | null];
125
+ onChange?: (value: string | null | string[] | [string | null, string | null]) => void;
126
+ placeholder?: string;
127
+ label?: React.ReactNode;
128
+ description?: React.ReactNode;
129
+ error?: React.ReactNode;
130
+ disabled?: boolean;
131
+ clearable?: boolean;
132
+ minDate?: Date;
133
+ maxDate?: Date;
134
+ displayValueFormat?: string;
135
+ valueFormat?: string;
136
+ excludedDates?: (string | [string, string])[];
137
+ excludedDays?: TDayOfWeek[];
138
+ highlightToday?: boolean;
139
+ className?: string;
140
+ popoverProps?: PopoverProps;
141
+ rightSection?: React.ReactNode;
142
+ rightSectionWidth?: number;
123
143
  }
124
144
 
125
145
  declare interface IDropdownProps extends SelectProps {
@@ -132,21 +152,48 @@ declare interface IDropdownProps extends SelectProps {
132
152
  errorMsg?: string;
133
153
  }
134
154
 
135
- declare interface IImageUploaderProps extends DropzoneProps {
136
- width?: number;
137
- height?: number;
138
- defaultMsg?: ReactNode;
139
- file?: string | FileWithPath;
140
- showClearButton?: boolean;
141
- onClear?: () => void;
142
- }
143
-
144
155
  export declare interface ILocation {
145
156
  latitude?: number;
146
157
  longitude?: number;
147
158
  }
148
159
 
149
- export declare const ImageUploader: ({ width, height, defaultMsg, file, onDrop, showClearButton, onClear, ...props }: IImageUploaderProps) => JSX.Element;
160
+ export declare const ImageInput: ({ value, onChange, width, height, placeholder, hasIcon, hasLink, onLinkClick, hasEdit, canDelete, minLength, maxLength, errorMsg, isLoading, readOnly, gap, }: ImageInputProps) => JSX.Element;
161
+
162
+ export declare type ImageInputChangeAction = 'create' | 'replace' | 'delete' | 'reorder' | 'crop';
163
+
164
+ export declare interface ImageInputChangeMeta {
165
+ action: ImageInputChangeAction;
166
+ itemId: string;
167
+ index: number;
168
+ previousIndex?: number;
169
+ nextIndex?: number;
170
+ }
171
+
172
+ export declare interface ImageInputItem {
173
+ id: string;
174
+ url?: string;
175
+ file?: File;
176
+ isLoading?: boolean;
177
+ }
178
+
179
+ export declare interface ImageInputProps {
180
+ value: ImageInputItem[];
181
+ onChange?: (nextValue: ImageInputItem[], meta: ImageInputChangeMeta) => void;
182
+ width?: number;
183
+ height?: number;
184
+ placeholder?: TImageInputPlaceholder;
185
+ hasIcon?: boolean;
186
+ hasLink?: boolean;
187
+ onLinkClick?: (item: ImageInputItem) => void;
188
+ hasEdit?: boolean;
189
+ minLength?: number;
190
+ maxLength?: number;
191
+ errorMsg?: ReactNode;
192
+ isLoading?: boolean;
193
+ readOnly?: boolean;
194
+ gap?: number;
195
+ canDelete?: boolean;
196
+ }
150
197
 
151
198
  /** Direction/navigation options */
152
199
  export declare interface IMapDirection {
@@ -329,6 +376,13 @@ declare interface IToastOptions {
329
376
  autoClose?: number | false;
330
377
  }
331
378
 
379
+ declare interface IToastRuntime {
380
+ (input: TToastInput): void;
381
+ update: (id: string, input: TToastInput) => void;
382
+ hide: (id: string) => void;
383
+ clean: () => void;
384
+ }
385
+
332
386
  declare interface IToggleProps extends SwitchProps {
333
387
  size?: 'sm' | 'md' | 'lg';
334
388
  labelPosition: 'left' | 'right';
@@ -347,6 +401,44 @@ export declare interface IUseLocationOptions {
347
401
  errorDescription?: string;
348
402
  }
349
403
 
404
+ export declare const LottieInput: ({ value, onChange, width, height, placeholder, hasIcon, hasLink, onLinkClick, minLength, maxLength, errorMsg, isLoading, readOnly, gap, canDelete, }: LottieInputProps) => JSX.Element;
405
+
406
+ export declare type LottieInputChangeAction = 'create' | 'delete' | 'reorder';
407
+
408
+ export declare interface LottieInputChangeMeta {
409
+ action: LottieInputChangeAction;
410
+ itemId: string;
411
+ index: number;
412
+ previousIndex?: number;
413
+ nextIndex?: number;
414
+ }
415
+
416
+ export declare interface LottieInputItem {
417
+ id: string;
418
+ url?: string;
419
+ file?: File;
420
+ animationData?: Record<string, unknown>;
421
+ isLoading?: boolean;
422
+ }
423
+
424
+ export declare interface LottieInputProps {
425
+ value: LottieInputItem[];
426
+ onChange?: (nextValue: LottieInputItem[], meta: LottieInputChangeMeta) => void;
427
+ width?: number;
428
+ height?: number;
429
+ placeholder?: ReactNode | ((index: number) => ReactNode);
430
+ hasIcon?: boolean;
431
+ hasLink?: boolean;
432
+ onLinkClick?: (item: LottieInputItem) => void;
433
+ minLength?: number;
434
+ maxLength?: number;
435
+ errorMsg?: ReactNode;
436
+ isLoading?: boolean;
437
+ readOnly?: boolean;
438
+ gap?: number;
439
+ canDelete?: boolean;
440
+ }
441
+
350
442
  /**
351
443
  * Naver Maps Marker Clustering utility
352
444
  * Creates clustered markers when multiple markers are close together
@@ -382,14 +474,16 @@ export declare const SegmentButton: ({ size, radius, ...props }: ISegmentButtonP
382
474
 
383
475
  export declare const Tab: ({ tabList, containerPaddingTop, ...props }: ITabProps) => JSX.Element;
384
476
 
385
- declare type TButtonSize = "sm" | "md" | "lg";
477
+ declare type TButtonSize = 'sm' | 'md' | 'lg';
386
478
 
387
- declare type TButtonVariant = "primary" | "primaryLine" | "basic" | "danger" | "setting" | "warning";
479
+ declare type TButtonVariant = 'primary' | 'primaryLine' | 'basic' | 'danger' | 'setting' | 'warning' | 'ghost';
388
480
 
389
481
  export declare type TDayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
390
482
 
391
483
  export declare const TextField: (allProps: TTextFieldProps) => JSX.Element;
392
484
 
485
+ declare type TImageInputPlaceholder = ReactNode | ((index: number) => ReactNode);
486
+
393
487
  export declare const TimePicker: ({ size, ...props }: ITimePickerProps) => JSX.Element;
394
488
 
395
489
  export declare type TMarkerData = IClusterMarkerData | IPopdealMarkerData | IPinMarkerData | IPiMarkerData;
@@ -416,18 +510,14 @@ export declare type TMarkerType = 'cluster' | 'popdeal' | 'pin' | 'pi' | 'pi-exp
416
510
  * message: '저장 중...',
417
511
  * });
418
512
  *
419
- * // 같은 id로 다시 호출하면 기존 토스트가 업데이트됩니다
420
- * toast({
421
- * id: 'save-toast',
513
+ * // 업데이트는 toast.update(id, input)수행합니다
514
+ * toast.update('save-toast', {
422
515
  * message: '저장 완료!',
423
516
  * });
517
+ *
518
+ * // 런타임에서는 PopUiProvider가 Notifications 경계를 제공합니다
424
519
  */
425
- export declare const toast: {
426
- (input: TToastInput): void;
427
- update(id: string, input: TToastInput): void;
428
- hide(id: string): void;
429
- clean(): void;
430
- };
520
+ export declare const toast: IToastRuntime;
431
521
 
432
522
  export declare const Toggle: ({ size, labelPosition, disabled, onChange, ...props }: IToggleProps) => JSX.Element;
433
523