@pop-ui/core 0.1.0 → 0.1.1

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,8 +1,8 @@
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`
1
+ (function(C,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):(C=typeof globalThis<"u"?globalThis:C||self,a(C.Core={},C.jsxRuntime,C.MantineCore,C.React,C.notifications,C.foundation,C.dates,C.dayjs,null,C.customParseFormat,C.core$1,C.sortable,C.dropzone,C.Cropper,C.utilities,C.Lottie))})(this,function(C,a,P,f,le,D,me,z,pr,rt,ee,te,fe,nt,Le,ot){"use strict";const at={sm:14,md:16,lg:18},Z={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-"},he={inner:Z.Button__Inner,label:Z.Button__Label,section:Z.Button__Section,loader:Z.Button__Loader},st={sm:Z["Button--Small"],md:Z["Button--Medium"],lg:Z["Button--Large"]},lt={primary:Z["Button--Primary"],primaryLine:Z["Button--PrimaryLine"],basic:Z["Button--Basic"],danger:Z["Button--Danger"],setting:Z["Button--Setting"],warning:Z["Button--Warning"],ghost:Z["Button--Ghost"]},it=(...e)=>e.filter(Boolean).join(" ")||void 0,ct=e=>{const r=(n,t)=>{const o=Object.keys(n).reduce((l,s)=>{const i=s,c=[n[i],t[i]].filter(Boolean).join(" ");return c&&(l[i]=c),l},{});return Object.keys(t).forEach(l=>{const s=l;!(s in n)&&t[s]&&(o[s]=t[s])}),o};return typeof e=="function"?(n,t,o)=>r(he,e(n,t,o)):typeof e=="object"&&e!==null&&!Array.isArray(e)?r(he,e):he};function ie({children:e,size:r="md",variant:n="primary",isLoading:t=!1,hideLabelOnLoading:o=!1,disabled:l=!1,className:s,classNames:i,loaderProps:c,...m}){const d=at[r],_=t,u=l||_;return a.jsxs(P.Button,{type:"button",unstyled:!0,className:it(Z.Button,l?Z.Button__Disabled:"",st[r],lt[n],s),classNames:ct(i),...m,disabled:u,children:[_&&a.jsx(P.Loader,{color:"currentColor",size:d,...c}),a.jsx("span",{className:Z.Button__Label,children:_&&o?null:e})]})}const ge={"Checkbox--Small":"styles-module__Checkbox--Small___VZGlw","Checkbox--Medium":"styles-module__Checkbox--Medium___Vwpa3","Checkbox--Large":"styles-module__Checkbox--Large___ybTGE"},_t={sm:ge["Checkbox--Small"],md:ge["Checkbox--Medium"],lg:ge["Checkbox--Large"]},dt={sm:18,md:24,lg:32},ut=({size:e="md",...r})=>{const n=_t[e],t=dt[e];return a.jsx(P.Checkbox,{className:n,size:e,styles:{inner:{width:t,height:t}},...r})},K={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"},pt=({excludedDays:e=[],excludedDates:r=[]})=>{const n=[],t=[];for(const s of r)typeof s=="string"?n.push(s):t.push(s);const o=n.map(s=>z(s)).filter(s=>s.isValid()).map(s=>s.format("YYYY-MM-DD")),l=t.map(([s,i])=>[z(s),z(i)]).filter(([s,i])=>s.isValid()&&i.isValid());return s=>{const i=z(s);if(!i.isValid())return!1;if(Array.isArray(e)&&e.includes(i.day())||o.includes(i.format("YYYY-MM-DD")))return!0;for(const[c,m]of l)if((i.isSame(c,"day")||i.isAfter(c,"day"))&&(i.isSame(m,"day")||i.isBefore(m,"day")))return!0;return!1}},mt=(e,r,n,t)=>{const o=z(e),l=z(r);for(const s of n)if(Array.isArray(s)){const i=z(s[0]),c=z(s[1]);if(!i.isValid()||!c.isValid())continue;if(!(l.isBefore(i,"day")||o.isAfter(c,"day")))return!0}for(const s of n)if(typeof s=="string"){const i=z(s);if(!i.isValid())continue;if((i.isSame(o,"day")||i.isAfter(o,"day"))&&(i.isSame(l,"day")||i.isBefore(l,"day")))return!0}if(t.length>0){let s=o;for(;s.isBefore(l,"day")||s.isSame(l,"day");){if(t.includes(s.day()))return!0;s=s.add(1,"day")}}return!1},ne=(e="default")=>{switch(e){case"range":return[null,null];case"multiple":return[];default:return null}},Be=(e="default",r)=>r==null?ne(e):e==="range"?Array.isArray(r)?r:ne("range"):e==="multiple"?Array.isArray(r)?r:ne("multiple"):Array.isArray(r)?r[0]??null:r,ve=({type:e,externalValue:r,internalValue:n})=>r!==void 0?Be(e,r):n!==void 0?Be(e,n):ne(e),ye=(e,r)=>{const n=(t,o)=>{const l=Object.keys(t).reduce((s,i)=>{const c=i,m=t[c],d=o[c],_=[m,d].filter(Boolean).join(" ");return _&&(s[c]=_),s},{});return Object.keys(o).forEach(s=>{const i=s,c=o[i];!(i in t)&&c&&(l[i]=c)}),l};return typeof r=="function"?(t,o,l)=>n(e,r(t,o,l)):typeof r=="object"&&r!==null&&!Array.isArray(r)?n(e,r):e},ft=e=>{if(e==null)return null;if(Array.isArray(e)){for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(n instanceof Date)return z(n).format("YYYY-MM-DD")}return null}return e instanceof Date?z(e).format("YYYY-MM-DD"):null},ht={levelsGroup:K.CalendarDatePicker__Wrapper,calendarHeader:K.CalendarDatePicker__Header,calendarHeaderLevel:K.CalendarDatePicker__HeaderLevel,calendarHeaderControl:K.CalendarDatePicker__HeaderControl,calendarHeaderControlIcon:K.CalendarDatePicker__HeaderControlIcon,month:K.CalendarDatePicker__Month,monthCell:K.CalendarDatePicker__MonthCell,day:K.CalendarDatePicker__Day,monthRow:K.CalendarDatePicker__MonthRow,weekdaysRow:K.CalendarDatePicker__WeekdaysRow,weekday:K.CalendarDatePicker__Weekday},Ee=({excludedDates:e=[],excludedDays:r=[],type:n="default",value:t,onChange:o,highlightToday:l=!1,...s})=>{const{classNames:i,date:c,defaultDate:m,onDateChange:d,getDayProps:_,...u}=s,[p,h]=f.useState(()=>t??ne(n)),[g,y]=f.useState(()=>c||m||(ft(t??ne(n))??new Date)),k=f.useMemo(()=>pt({excludedDays:r,excludedDates:e}),[r,e]),S=f.useCallback(x=>{c===void 0&&y(x),d?.(x)},[c,d]),I=x=>{if(n==="range"&&Array.isArray(x)&&x.length===2){const[v,O]=x;if(v&&O&&mt(v,O,e,r)){const w=ne("range");h(w),o?.(w);return}}h(x),o?.(x)},$=ve({type:n,externalValue:t,internalValue:p}),N=f.useCallback(x=>{const v=z(x).date(),w=z(x).isSame(z(),"day")&&l;return a.jsxs("span",{className:K.CalendarDatePicker__DayContent,children:[a.jsx("span",{className:K.CalendarDatePicker__DayLabel,children:v}),w&&a.jsx("span",{className:K.CalendarDatePicker__TodayIndicator,children:"오늘"})]})},[l]),U=ye(ht,i),H=c??g,B=z(H??new Date).format("YYYY-MM"),T=f.useCallback(x=>{const v=_?.(x)??{},O=z(x).format("YYYY-MM")!==B;return{...v,onClick:w=>{v.onClick?.(w),O&&S(x)}}},[B,_,S]);return a.jsx(me.DatePicker,{locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 M월",maxLevel:"month",type:n,previousIcon:a.jsx(D.IconChevronLeft,{}),nextIcon:a.jsx(D.IconChevronRight,{}),...u,size:"lg",onChange:I,weekendDays:[0],highlightToday:l,classNames:U,defaultDate:c===void 0?m:void 0,date:H,onDateChange:S,getDayProps:T,value:$,excludeDate:k,renderDay:N})},b={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"};z.extend(rt);const gt={wrapper:b.DatePicker__Wrapper,input:b.DatePicker__Input,section:b.DatePicker__Section,placeholder:b.DatePicker__Placeholder,datePickerRoot:b.DatePicker__Root,levelsGroup:b.DatePicker__LevelsGroup,calendarHeader:b.DatePicker__CalendarHeader,calendarHeaderLevel:b.DatePicker__CalendarHeaderLevel,calendarHeaderControl:b.DatePicker__CalendarHeaderControl,calendarHeaderControlIcon:b.DatePicker__CalendarHeaderControlIcon,month:b.DatePicker__Month,weekdaysRow:b.DatePicker__WeekdaysRow,weekday:b.DatePicker__Weekday,monthRow:b.DatePicker__MonthRow,monthCell:b.DatePicker__MonthCell,day:b.DatePicker__Day,timeWrapper:b.DatePicker__TimeWrapper,timeInput:b.DatePicker__TimeInput,submitButton:b.DatePicker__SubmitButton},yt={dropdown:b.DatePicker__Dropdown,arrow:b.DatePicker__DropdownArrow},Ae=(...e)=>e.filter(Boolean).join(" ")||void 0,_e=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},kt=({size:e="md",type:r="default",withTime:n,className:t,popoverProps:o,rightSection:l,rightSectionWidth:s,value:i,defaultValue:c,onChange:m,placeholder:d,disabled:_,minDate:u,maxDate:p,displayValueFormat:h="YYYY년 MM월 DD일",valueFormat:g,excludedDates:y,excludedDays:k,highlightToday:S})=>{const I=g??(n?"YYYY-MM-DD HH:mm":"YYYY-MM-DD"),[$,N]=f.useState(!1),[U,H]=f.useState(()=>D.parseDateValue(i??c,r,I)??ne(r));let B=b["DatePicker--Medium"],T=18,x=42;e==="sm"?(B=b["DatePicker--Small"],T=14,x=34):e==="lg"&&(B=b["DatePicker--Large"],T=24,x=50);const v=ye(yt,o?.classNames),O=l??a.jsx("span",{"aria-hidden":"true",className:b.DatePicker__Icon,children:a.jsx(D.IconCalendar,{size:T})});if(n){const E=M=>{if(!M)return null;const F=z(M,I,!0);return F.isValid()?F.toDate():null},W=i!==void 0,q=W?E(i):null,L=E(c);return a.jsx(me.DateTimePicker,{className:Ae(b.DatePickerBase,b.DatePickerRoot,B,t),classNames:ye(gt,void 0),size:e,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD | a hh:mm",rightSection:O,rightSectionWidth:s??x,popoverProps:{offset:8,position:"bottom-start",withArrow:!0,arrowSize:10,arrowOffset:20,...o,classNames:v},value:W?q:void 0,defaultValue:W?void 0:L,onChange:M=>{m?.(M?z(M).format(I):null)},placeholder:d,disabled:_,minDate:u,maxDate:p})}const w=i!=null?D.parseDateValue(i,r,I):void 0,A=ve({type:r,externalValue:w,internalValue:U}),Y=D.formatDateDisplay(A,r,h),G=E=>{let W;if(r==="range"&&Array.isArray(E)){const q=E;W=[_e(q[0]??null),_e(q[1]??null)]}else r==="multiple"&&Array.isArray(E)?W=E.map(q=>_e(q)).filter(q=>q!==null):W=_e(E);H(W),m?.(D.toValueString(W,r,I)),r==="default"&&W!=null&&N(!1),r==="range"&&Array.isArray(W)&&W[0]&&W[1]&&N(!1)};return a.jsx("div",{className:Ae(b.DatePickerBase,b.DatePickerRoot,B,t),children:a.jsxs(P.Popover,{opened:$,onClose:()=>N(!1),offset:8,position:"bottom-start",withArrow:!0,arrowSize:10,arrowOffset:20,...o,classNames:v,children:[a.jsx(P.Popover.Target,{children:a.jsx("div",{className:b.DatePicker__Wrapper,"data-expanded":$?!0:void 0,"data-disabled":_?!0:void 0,children:a.jsx(P.Input,{component:"button",type:"button",classNames:{input:b.DatePicker__Input,section:b.DatePicker__Section},onClick:()=>!_&&N(E=>!E),disabled:_,rightSection:O,rightSectionWidth:s??x,"data-expanded":$?!0:void 0,"data-disabled":_?!0:void 0,children:Y?a.jsx("span",{children:Y}):a.jsx("span",{className:b.DatePicker__Placeholder,children:d})})})}),a.jsx(P.Popover.Dropdown,{children:a.jsx(Ee,{type:r,value:A,onChange:G,excludedDates:y,excludedDays:k,highlightToday:S,minDate:u,maxDate:p})})]})})},J={"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"},Ct=({label:e,labelPosition:r="top",size:n="md",required:t,tooltip:o,tooltipPosition:l="top",errorMsg:s,description:i,...c})=>{const[m,d]=f.useState(!1);let _=J["Dropdown__Label--Medium"],u=J["Dropdown--Medium"],p=J["Dropdown__Tooltip--Medium"],h=18;return n==="sm"?(_=J["Dropdown__Label--Small"],u=J["Dropdown--Small"],p=J["Dropdown__Tooltip--Small"],h=14):n==="lg"&&(_=J["Dropdown__Label--Large"],u=J["Dropdown--Large"],p=J["Dropdown__Tooltip--Large"],h=24),a.jsxs("div",{className:r==="top"?J["Dropdown--TopLabel"]:J["Dropdown--LeftLabel"],children:[a.jsxs("div",{children:[e&&a.jsx(P.Input.Label,{required:t,className:_,children:e}),o&&a.jsx(P.Tooltip,{label:o,position:l,children:a.jsx("div",{className:p,children:a.jsx(D.IconInfoCircle,{size:n==="sm"?14:n==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx(P.Select,{...c,size:n,error:s,className:u,rightSection:m?a.jsx(D.IconChevronUp,{size:h}):a.jsx(D.IconChevronDown,{size:h}),onDropdownOpen:()=>d(!0),onDropdownClose:()=>d(!1),styles:{option:{"&[data-selected]":{"&, &:hover":{backgroundColor:"#e7e7e7",color:"#000000"}}}}}),i&&a.jsx(P.Input.Description,{className:J.Dropdown__Description,children:i}),s&&a.jsx(P.Input.Error,{className:J.Dropdown__ErrorMsg,children:s})]})]})};function de(){return crypto.randomUUID()}function Dt(e,r,n){const t=[...e],[o]=t.splice(r,1);return t.splice(n,0,o),t}function Pt(e,r,n){return n!=null&&e.length>=n?0:r!=null&&e.length<r?r-e.length:1}function xt(e,r,n){return e.map(t=>{const o=t.position;return o==null?t:o===r?{...t,position:n}:r<n&&o>r&&o<=n?{...t,position:o-1}:r>n&&o>=n&&o<r?{...t,position:o+1}:t})}function St(e,r,n){const t=[...r].sort((i,c)=>i.name.localeCompare(c.name)),o=n!=null?n-e.length:1/0,s=t.slice(0,o).map(i=>({id:de(),file:i,url:URL.createObjectURL(i)}));return[...e,...s]}function Mt(e,r){const n=e.find(t=>t.id===r);return n?.url?.startsWith("blob:")&&URL.revokeObjectURL(n.url),e.filter(t=>t.id!==r)}function Ne(e,r,n){return e.map(t=>t.id!==r?t:(t.url?.startsWith("blob:")&&URL.revokeObjectURL(t.url),{...t,file:n,url:URL.createObjectURL(n)}))}function Tt(e,r,n){return Ne(e,r,n)}function bt(e,r,n){const t={id:de(),file:r,url:URL.createObjectURL(r),position:n};return[...e,t]}function It(e){for(const r of e)r.url?.startsWith("blob:")&&URL.revokeObjectURL(r.url)}const Fe=({size:e="md",width:r,withCloseButton:n=!1,...t})=>{let o=768;return e==="xs"?o=360:e==="sm"?o=544:e==="lg"?o=1e3:e==="xl"&&(o=1200),a.jsx(P.Modal,{size:r||o,styles:{content:{borderRadius:"12px"},title:{fontSize:"16px",fontWeight:"700",lineHeight:"150%",color:D.ColorGray900},header:{padding:"16px"},body:{paddingLeft:"0px",paddingRight:"0px"}},withCloseButton:n,closeButtonProps:{icon:a.jsx(D.IconX,{size:18,color:D.ColorGray600})},...t})};async function wt(e,r){const n=e.url??"";if(!n)return null;const t=await new Promise((i,c)=>{const m=new Image;m.crossOrigin="anonymous",m.onload=()=>i(m),m.onerror=c,m.src=n}),o=document.createElement("canvas");o.width=r.width,o.height=r.height;const l=o.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,c)=>{o.toBlob(m=>{m?i(new File([m],`cropped_${s}`,{type:"image/jpeg"})):c(new Error("Failed to create blob"))},"image/jpeg")})}function Lt({item:e,isOpen:r,aspect:n=1,onClose:t,onSubmit:o}){const[l,s]=f.useState({x:0,y:0}),[i,c]=f.useState(1),[m,d]=f.useState(null),[_,u]=f.useState(!1),p=async()=>{if(!(!m||!e)){u(!0);try{const h=await wt(e,m);h&&o(h)}finally{u(!1)}}};return a.jsx(Fe,{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(nt,{image:e?.url??"",crop:l,zoom:i,aspect:n,minZoom:.5,maxZoom:10,objectFit:"cover",onCropChange:s,onZoomChange:c,onCropComplete:(h,g)=>d(g),style:{containerStyle:{backgroundColor:"#ffffff"}}})}),a.jsxs(P.Group,{justify:"flex-end",style:{padding:"0 16px"},children:[a.jsx(ie,{variant:"basic",onClick:t,children:"취소"}),a.jsx(ie,{variant:"primary",isLoading:_,onClick:p,children:"적용하기"})]})]})},e?.id)}const ae={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"},Q={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 ue({width:e,height:r,isError:n,isLoading:t,accept:o,multiple:l,onDrop:s,children:i}){return a.jsx("div",{className:Q.DropzoneOuter,children:a.jsx(fe.Dropzone,{onDrop:s,accept:o,multiple:l,disabled:t,className:n?Q.PlaceholderError:Q.Placeholder,style:{width:e,height:r},children:i})})}const Bt=e=>{const{isSorting:r,wasDragging:n}=e;return r||n?!1:te.defaultAnimateLayoutChanges(e)};function Oe({id:e,children:r}){const{setNodeRef:n,transform:t,transition:o,isOver:l}=te.useSortable({id:e,animateLayoutChanges:Bt});return a.jsx("div",{ref:n,style:{transform:Le.CSS.Transform.toString(t),transition:o,opacity:l?.7:1},children:r})}function $e({id:e,totalCount:r,width:n,height:t,readOnly:o,isLoading:l,itemIsLoading:s,canDelete:i,hasLink:c,linkUrl:m,onLinkClick:d,onDelete:_,deleteAriaLabel:u="삭제",actionBarExtra:p,onTileClick:h,children:g}){const y=T=>{const{isSorting:x,wasDragging:v}=T;return x||v?!1:te.defaultAnimateLayoutChanges(T)},{attributes:k,listeners:S,setNodeRef:I,transform:$,transition:N,isDragging:U}=te.useSortable({id:e,disabled:o,animateLayoutChanges:y}),H=!o&&r>1||c&&!!m&&!!d||!!p,B=o||l||s||!h?"default":"pointer";return a.jsxs("div",{ref:I,className:Q.TileContainer,style:{transform:Le.CSS.Transform.toString($),transition:N,opacity:U?.4:1},children:[!o&&i&&!l&&a.jsx("button",{type:"button",className:Q.DeleteButton,onClick:_,"aria-label":u,children:a.jsx(D.IconXCircle,{size:24})}),a.jsxs("div",{className:Q.Tile,style:{width:n,height:t,cursor:B},onClick:()=>!o&&!l&&!s&&h?.(),children:[g,(l||s)&&a.jsx("div",{className:Q.LoadingOverlay,children:a.jsx(P.Loader,{size:n/6,color:D.ColorAqua500})})]}),H&&a.jsxs("div",{className:Q.ActionBar,children:[!o&&r>1&&a.jsx("button",{type:"button",className:Q.DragHandle,...k,...S,"aria-label":"드래그로 순서 변경",children:a.jsx(D.IconDragMenu,{size:20,color:"#808080"})}),c&&m&&d&&a.jsx("button",{type:"button",className:Q.LinkButton,onClick:d,children:"링크"}),p]})]})}function vt({items:e,onReorder:r}){return{sensors:ee.useSensors(ee.useSensor(ee.PointerSensor,{activationConstraint:{distance:8}}),ee.useSensor(ee.KeyboardSensor,{coordinateGetter:te.sortableKeyboardCoordinates})),handleDragEnd:o=>{const{active:l,over:s}=o;if(!s||l.id===s.id)return;const i=e.findIndex(m=>m.id===l.id),c=e.findIndex(m=>m.id===s.id);i!==-1&&c!==-1&&r(i,c)}}}const ke="__slot-";function ze({value:e,length:r,minLength:n,maxLength:t,onChange:o}){const l=r??n,s=r??t,i=l!=null&&s!=null&&l===s,c=i?0:Pt(e,l,s),m=i?Array.from({length:s},(y,k)=>`${ke}${k}`):[],d=i?m:e.map(y=>y.id),{sensors:_,handleDragEnd:u}=vt({items:e,onReorder:(y,k)=>{const S=Dt(e,y,k),I=e[y];o?.(S,{action:"reorder",itemId:I.id,index:k,previousIndex:y,nextIndex:k})}});return{isPositionMode:i,resolvedMinLength:l,resolvedMaxLength:s,placeholderCount:c,slotIds:m,sortableItems:d,sensors:_,handleDragEnd:i?y=>{const{active:k,over:S}=y;if(!S||k.id===S.id)return;const I=Number(String(k.id).replace(ke,"")),$=Number(String(S.id).replace(ke,"")),N=e.find(H=>H.position===I);if(!N)return;const U=xt(e,I,$);o?.(U,{action:"reorder",itemId:N.id,index:$,previousIndex:I,nextIndex:$})}:u,getMetaIndex:y=>{const k=e.find(S=>S.id===y);return i&&k?k.position??0:e.findIndex(S=>S.id===y)}}}function Et(e){return e?e.join(","):"image/*"}function He({item:e,sortableId:r,index:n,totalCount:t,width:o,height:l,accept:s,canDelete:i,hasLink:c,hasEdit:m,readOnly:d,isLoading:_,onLinkClick:u,onDelete:p,onReplace:h,onEdit:g}){const y=f.useRef(null);return a.jsxs($e,{id:r??e.id,totalCount:t,width:o,height:l,readOnly:d,isLoading:_,itemIsLoading:e.isLoading,canDelete:i,hasLink:c,linkUrl:e.url,onLinkClick:u?()=>u(e):void 0,onDelete:()=>p(e.id),deleteAriaLabel:"이미지 삭제",onTileClick:()=>y.current?.click(),actionBarExtra:!d&&m?a.jsx(ie,{variant:"basic",size:"sm","aria-label":"이미지 편집",className:ae.EditButton,onClick:()=>g(e),children:"편집"}):void 0,children:[a.jsx("input",{ref:y,type:"file",accept:Et(s),style:{display:"none"},onChange:k=>{const S=k.target.files?.[0];S&&h(e.id,S),k.target.value=""}}),a.jsx("img",{src:e.url,alt:e.file?.name??`이미지 ${n+1}`,className:ae.TileImage})]})}const At=({value:e=[],onChange:r,accept:n,length:t,width:o=160,height:l=200,placeholder:s="이미지를 넣어주세요",hasIcon:i=!0,hasLink:c=!1,onLinkClick:m,hasEdit:d=!1,canDelete:_=!0,minLength:u,maxLength:p,errorMsg:h,isLoading:g,readOnly:y,gap:k=8})=>{process.env.NODE_ENV!=="production"&&t!=null&&(u!=null||p!=null)&&console.warn("ImageInput: length와 minLength/maxLength가 동시에 지정되었습니다. length가 우선 적용됩니다.");const{isPositionMode:S,resolvedMaxLength:I,placeholderCount:$,slotIds:N,sortableItems:U,sensors:H,handleDragEnd:B,getMetaIndex:T}=ze({value:e,length:t,minLength:u,maxLength:p,onChange:r}),x=!!h,[v,O]=f.useState(null),w=f.useRef(e);f.useEffect(()=>{w.current=e},[e]),f.useEffect(()=>()=>It(w.current),[]);const A=L=>{if(y)return;const M=e.length,F=St(e,L,I);F.length!==M&&r?.(F,{action:"create",itemId:F[M].id,index:M})},Y=(L,M)=>{if(y)return;const F=M[0];if(!F)return;const X=bt(e,F,L);r?.(X,{action:"create",itemId:X[X.length-1].id,index:L})},G=L=>{if(y)return;const M=T(L),F=Mt(e,L);r?.(F,{action:"delete",itemId:L,index:M})},E=(L,M)=>{if(y)return;const F=T(L),X=Ne(e,L,M);r?.(X,{action:"replace",itemId:L,index:F})},W=L=>{if(!v)return;const M=v.id,F=T(M),X=Tt(e,M,L);O(null),r?.(X,{action:"crop",itemId:M,index:F})},q=L=>{const M=typeof s=="function"?s(L):s;return typeof M!="string"?M:M.split(`
2
+ `).map((F,X)=>a.jsx("span",{children:F},X))};return a.jsxs("div",{children:[a.jsx(ee.DndContext,{sensors:H,collisionDetection:ee.closestCenter,onDragEnd:B,children:a.jsx(te.SortableContext,{items:U,strategy:te.rectSortingStrategy,children:a.jsx("div",{className:ae.Container,style:{gap:k},children:S?Array.from({length:I},(L,M)=>{const F=N[M],X=e.find(we=>we.position===M);return X?a.jsx(He,{item:X,sortableId:F,index:M,totalCount:I,width:o,height:l,accept:n,canDelete:_,hasLink:c,hasEdit:d,readOnly:y??!1,isLoading:g,onLinkClick:m,onDelete:G,onReplace:E,onEdit:O},F):!y&&a.jsx(Oe,{id:F,children:a.jsxs(ue,{onDrop:we=>Y(M,we),accept:n??fe.IMAGE_MIME_TYPE,multiple:!1,isLoading:g,isError:x,width:o,height:l,children:[i&&a.jsx(D.IconPhoto,{size:36,color:x?"#e03131":"#07a3c6"}),s&&a.jsx("div",{className:`${ae.PlaceholderText}${x?` ${ae.PlaceholderTextError}`:""}`,children:q(M)})]})},F)}):a.jsxs(a.Fragment,{children:[e.map((L,M)=>a.jsx(He,{item:L,index:M,totalCount:e.length,width:o,height:l,accept:n,canDelete:_,hasLink:c,hasEdit:d,readOnly:y??!1,isLoading:g,onLinkClick:m,onDelete:G,onReplace:E,onEdit:O},L.id)),!y&&Array.from({length:$},(L,M)=>a.jsxs(ue,{onDrop:A,accept:n??fe.IMAGE_MIME_TYPE,multiple:I!==1,isLoading:g,isError:x,width:o,height:l,children:[i&&a.jsx(D.IconPhoto,{size:36,color:x?"#e03131":"#07a3c6"}),s&&a.jsx("div",{className:`${ae.PlaceholderText}${x?` ${ae.PlaceholderTextError}`:""}`,children:q(M)})]},`placeholder-${M}`))]})})})}),x&&a.jsx(P.Input.Error,{mt:8,children:h}),d&&a.jsx(Lt,{item:v,isOpen:!!v,onClose:()=>O(null),onSubmit:W})]})};function Ye(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 Ce(e){return new Promise(r=>{const n=new FileReader;n.onload=t=>{try{const o=JSON.parse(t.target?.result);r(Ye(o)?o:null)}catch{r(null)}},n.onerror=()=>r(null),n.readAsText(e)})}function Nt(e,r,n){const t=[...r].sort((i,c)=>i.name.localeCompare(c.name)),o=n!=null?n-e.length:1/0,s=t.slice(0,o).map(i=>({id:de(),file:i}));return[...e,...s]}function Ft(e,r){return e.filter(n=>n.id!==r)}function Ot(e,r,n){const t={id:de(),file:r,position:n};return[...e,t]}const se={Container:"styles-module__Container___cJqG-",Empty:"styles-module__Empty___gexrS",PlaceholderText:"styles-module__PlaceholderText___x2ya0",PlaceholderTextError:"styles-module__PlaceholderTextError___i8VXv"},pe={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"},We=e=>typeof e=="string"?{message:e}:e,Ze=(e,r)=>{const{autoClose:n,icon:t,message:o}=We(e);return{id:r,message:a.jsx("div",{className:pe.Toast__Message,children:o}),icon:t,autoClose:n,classNames:{root:pe.Toast,body:pe.Toast__Body,icon:pe.Toast__Icon},withCloseButton:!1,withBorder:!1}},oe=e=>{const r=We(e);le.notifications.show(Ze(e,r.id))};oe.update=(e,r)=>{le.notifications.update(Ze(r,e))},oe.hide=e=>{le.notifications.hide(e)},oe.clean=()=>{le.notifications.clean()};const Ve={"application/json":[".json"]};function Ue({item:e,sortableId:r,totalCount:n,width:t,height:o,readOnly:l,isLoading:s,canDelete:i,hasLink:c,onLinkClick:m,onDelete:d}){const u=!e.animationData&&!!(e.file||e.url)?`${e.id}|${e.file?`${e.file.name}:${e.file.size}`:e.url??""}`:"",[p,h]=f.useState({key:"",data:null}),g=e.animationData??(p.key===u?p.data:null),y=!!u&&p.key!==u;return f.useEffect(()=>{if(!u)return;let k=!1;return(e.file?Ce(e.file):fetch(e.url).then(I=>I.json()).then(I=>Ye(I)?I:null)).then(I=>{k||h({key:u,data:I})}).catch(()=>{k||h({key:u,data:null})}),()=>{k=!0}},[u,e.file]),a.jsx($e,{id:r??e.id,totalCount:n,width:t,height:o,readOnly:l,isLoading:s,itemIsLoading:e.isLoading||y,canDelete:i,hasLink:c,linkUrl:e.url,onLinkClick:m?()=>m(e):void 0,onDelete:()=>d(e.id),deleteAriaLabel:"Lottie 삭제",children:g?a.jsx(ot,{animationData:g,loop:!0,autoplay:!0,style:{width:t,height:o,display:"block"}}):a.jsx("div",{className:se.Empty,style:{width:t,height:o}})})}const $t=({value:e=[],onChange:r,width:n=160,height:t=200,placeholder:o="Lottie JSON 파일을 넣어주세요",hasIcon:l=!0,hasLink:s=!1,onLinkClick:i,length:c,minLength:m,maxLength:d,errorMsg:_,isLoading:u,readOnly:p,gap:h=8,canDelete:g=!0})=>{process.env.NODE_ENV!=="production"&&c!=null&&(m!=null||d!=null)&&console.warn("LottieInput: length와 minLength/maxLength가 동시에 지정되었습니다. length가 우선 적용됩니다.");const{isPositionMode:y,resolvedMaxLength:k,placeholderCount:S,slotIds:I,sortableItems:$,sensors:N,handleDragEnd:U,getMetaIndex:H}=ze({value:e,length:c,minLength:m,maxLength:d,onChange:r}),B=!!_,T=async w=>{if(p)return;const A=[...w].sort((L,M)=>L.name.localeCompare(M.name)),Y=await Promise.all(A.map(Ce));let G=0;const E=A.filter((L,M)=>Y[M]!==null?!0:(G++,!1));if(G>0&&oe({id:"invalid-lottie-files",message:G===1?"유효하지 않은 Lottie JSON 파일입니다":`${G}개의 파일이 유효하지 않은 Lottie JSON입니다`}),E.length===0)return;const W=e.length,q=Nt(e,E,k);q.length!==W&&r?.(q,{action:"create",itemId:q[W].id,index:W})},x=async(w,A)=>{if(p)return;const Y=A[0];if(!Y)return;if(!await Ce(Y)){oe({id:"invalid-lottie-files",message:"유효하지 않은 Lottie JSON 파일입니다"});return}const E=Ot(e,Y,w);r?.(E,{action:"create",itemId:E[E.length-1].id,index:w})},v=w=>{if(p)return;const A=H(w),Y=Ft(e,w);r?.(Y,{action:"delete",itemId:w,index:A})},O=w=>{const A=typeof o=="function"?o(w):o;return typeof A!="string"?A:A.split(`
3
+ `).map((Y,G)=>a.jsx("span",{children:Y},G))};return a.jsxs("div",{children:[a.jsx(ee.DndContext,{sensors:N,collisionDetection:ee.closestCenter,onDragEnd:U,children:a.jsx(te.SortableContext,{items:$,strategy:te.rectSortingStrategy,children:a.jsx("div",{className:se.Container,style:{gap:h},children:y?Array.from({length:k},(w,A)=>{const Y=I[A],G=e.find(E=>E.position===A);return G?a.jsx(Ue,{item:G,sortableId:Y,totalCount:k,width:n,height:t,readOnly:p??!1,isLoading:u,canDelete:g,hasLink:s,onLinkClick:i,onDelete:v},Y):!p&&a.jsx(Oe,{id:Y,children:a.jsxs(ue,{onDrop:E=>x(A,E),accept:Ve,multiple:!1,isLoading:u,isError:B,width:n,height:t,children:[l&&a.jsx(D.IconPhoto,{size:36,color:B?"#e03131":"#07a3c6"}),o&&a.jsx("div",{className:`${se.PlaceholderText}${B?` ${se.PlaceholderTextError}`:""}`,children:O(A)})]})},Y)}):a.jsxs(a.Fragment,{children:[e.map(w=>a.jsx(Ue,{item:w,totalCount:e.length,width:n,height:t,readOnly:p??!1,isLoading:u,canDelete:g,hasLink:s,onLinkClick:i,onDelete:v},w.id)),!p&&Array.from({length:S},(w,A)=>a.jsxs(ue,{onDrop:T,accept:Ve,multiple:k!==1,isLoading:u,isError:B,width:n,height:t,children:[l&&a.jsx(D.IconPhoto,{size:36,color:B?"#e03131":"#07a3c6"}),o&&a.jsx("div",{className:`${se.PlaceholderText}${B?` ${se.PlaceholderTextError}`:""}`,children:O(A)})]},`placeholder-${A}`))]})})})}),B&&a.jsx(P.Input.Error,{mt:8,children:_})]})},ce={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"},zt=({currentPageIdx:e,rowsPerPage:r,totalLength:n,paginationSize:t,onPageChange:o,...l})=>{const[s,i]=f.useState(e),c=r||50,m=n||1,d=t||5;f.useEffect(()=>{i(e)},[e]);const _=()=>{o&&o(s-(s%d+1)),i(p=>p-(p%d+1))},u=()=>{o&&o(s+d-s%d),i(p=>p+d-p%d)};return a.jsxs("div",{...l,className:ce.Pagination,children:[s>=d?a.jsx("button",{className:ce.Pagination__Arrow,onClick:_,children:a.jsx(D.IconChevronLeft,{size:20})}):null,new Array(d).fill(0).map((p,h)=>{const g=Math.floor(s/d)*d+h+1;if(!(g>Math.ceil(m/c)))return a.jsx("button",{className:s===g-1?ce["Pagination__PageIndex--Active"]:ce.Pagination__PageIndex,onClick:()=>{i(g-1),o&&o(g-1)},children:g},`pagination_${h}`)}),Math.floor(s/d)*d+d<Math.ceil(m/c)?a.jsx("button",{className:ce.Pagination__Arrow,onClick:u,children:a.jsx(D.IconChevronRight,{size:20})}):null]})},De={"Radio--Small":"styles-module__Radio--Small___izWI2","Radio--Medium":"styles-module__Radio--Medium___dwZfV","Radio--Large":"styles-module__Radio--Large___1gLra"},Ht={sm:De["Radio--Small"],md:De["Radio--Medium"],lg:De["Radio--Large"]},Yt={sm:18,md:24,lg:32},Wt=({size:e="md",...r})=>{const n=Ht[e],t=Yt[e];return a.jsx(P.Radio,{className:n,size:e,styles:{inner:{width:t,height:t}},...r})},j={"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"},Zt=({label:e,labelPosition:r="top",size:n="md",required:t,tooltip:o,tooltipPosition:l="top",errorMsg:s,description:i,onChange:c,onClear:m,...d})=>{const[_,u]=f.useState(0);let p=j["SearchBar__Label--Medium"],h=j["SearchBar--Medium"],g=j["SearchBar__Tooltip--Medium"];n==="sm"?(p=j["SearchBar__Label--Small"],h=j["SearchBar--Small"],g=j["SearchBar__Tooltip--Small"]):n==="lg"&&(p=j["SearchBar__Label--Large"],h=j["SearchBar--Large"],g=j["SearchBar__Tooltip--Large"]);const y=f.useCallback(k=>{c&&(u(k?.length),c(k))},[c]);return a.jsxs("div",{className:r==="top"?j["SearchBar--TopLabel"]:j["SearchBar--LeftLabel"],children:[a.jsxs("div",{children:[e&&a.jsx(P.Input.Label,{required:t,className:p,children:e}),o&&a.jsx(P.Tooltip,{label:o,position:l,children:a.jsx("div",{className:g,children:a.jsx(D.IconInfoCircle,{size:n==="sm"?14:n==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx("div",{className:j.SearchBar__Wrapper,children:a.jsx(P.Autocomplete,{...d,size:n,error:s,className:h,onChange:y,leftSection:a.jsx(D.IconSearch,{size:n==="sm"?16:n==="lg"?24:20}),rightSection:m&&_>0?a.jsx("div",{className:j.SearchBar__ClearButton,onClick:m,children:a.jsx(D.IconX,{size:n==="sm"?16:n==="lg"?24:20})}):void 0})}),i&&a.jsx(P.Input.Description,{className:j.SearchBar__Description,children:i}),s&&a.jsx(P.Input.Error,{className:j.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,...n})=>{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,...n})},je={Tab__TitleList:"styles-module__Tab__TitleList___urHWH",Tab__BorderBottom:"styles-module__Tab__BorderBottom___eMTpl"},Ut=({tabList:e=[],containerPaddingTop:r,...n})=>a.jsxs(P.Tabs,{...n,children:[a.jsx(P.Tabs.List,{className:je.Tab__TitleList,children:e?.map((t,o)=>a.jsxs(P.Tabs.Tab,{value:t.value,leftSection:t.icon,children:[t.title,a.jsx("div",{className:je.Tab__BorderBottom})]},`tab_${o}`))}),e?.map((t,o)=>a.jsx(P.Tabs.Panel,{value:t.value,pt:r,children:t.body},`tab_panel_${o}`))]}),V={"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"},jt=e=>typeof e=="string"?e.length:typeof e=="number"?String(e).length:Array.isArray(e)?e.join("").length:0,Gt=e=>{const{label:r,labelPosition:n="top",size:t="md",required:o,tooltip:l,tooltipPosition:s="top",errorMsg:i,description:c,textarea:m=!1,maxTextCount:d,onChange:_,onClear:u,...p}=e,h="minRows"in e?e.minRows:void 0,{value:g,defaultValue:y,...k}=p,S=g!==void 0,[I,$]=f.useState(String(g??y??"")),N=S?g:I,U=jt(N);let H=V["TextField__Label--Medium"],B=V["TextField--Medium"],T=V["TextField__Tooltip--Medium"];t==="sm"?(H=V["TextField__Label--Small"],B=V["TextField--Small"],T=V["TextField__Tooltip--Small"]):t==="lg"&&(H=V["TextField__Label--Large"],B=V["TextField--Large"],T=V["TextField__Tooltip--Large"]);const x=f.useCallback(O=>{const w=O.currentTarget.value;d&&w.length>d||(S||$(w),_&&_(O))},[S,d,_]),v=f.useCallback(()=>{S||$(""),u?.()},[S,u]);return a.jsxs("div",{className:n==="top"?V["TextField--TopLabel"]:V["TextField--LeftLabel"],children:[a.jsxs("div",{children:[r&&a.jsx(P.Input.Label,{required:o,className:H,children:r}),l&&a.jsx(P.Tooltip,{label:l,position:s,children:a.jsx("div",{className:T,children:a.jsx(D.IconInfoCircle,{size:t==="sm"?14:t==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:V.TextField__Wrapper,children:[m?a.jsx(P.Textarea,{className:V["TextField--Textarea"],size:t,minRows:h,error:i,onChange:x,value:N,...k}):a.jsx(P.Input,{className:B,error:i,onChange:x,value:N,rightSection:u&&U>0?a.jsx("button",{type:"button",className:V.TextField__ClearButton,"aria-label":"입력 내용 지우기",onClick:v,children:a.jsx(D.IconX,{size:t==="sm"?16:t==="lg"?24:20})}):void 0,...k}),d&&d>0&&a.jsx("span",{className:V.TextField__TextCounter,children:`${U}/${d}`})]}),c&&a.jsx(P.Input.Description,{className:V.TextField__Description,children:c}),i&&a.jsx(P.Input.Error,{className:V.TextField__ErrorMsg,children:i})]})]})},xe={"TimePicker--Small":"styles-module__TimePicker--Small___nHQa1","TimePicker--Medium":"styles-module__TimePicker--Medium___E9-rF","TimePicker--Large":"styles-module__TimePicker--Large___I0M7V"},qt=({size:e="md",...r})=>{const n=f.useRef(null);let t=xe["TimePicker--Medium"],o=18;return e==="sm"?(t=xe["TimePicker--Small"],o=14):e==="lg"&&(t=xe["TimePicker--Large"],o=24),a.jsx(me.TimeInput,{ref:n,className:t,size:e,...r,rightSection:a.jsx(P.ActionIcon,{bg:"transparent",onClick:()=>{n.current?.showPicker?.()},children:a.jsx(D.IconClock,{size:o})})})},Se={"Toggle--Small":"styles-module__Toggle--Small___sOjUd","Toggle--Medium":"styles-module__Toggle--Medium___yIb8v","Toggle--Large":"styles-module__Toggle--Large___ZOJj1"},Kt=({size:e="md",labelPosition:r="right",disabled:n,onChange:t,...o})=>{const[l,s]=f.useState(o?.checked||!1);let i=Se["Toggle--Medium"],c=50;e==="sm"?(i=Se["Toggle--Small"],c=38):e==="lg"&&(i=Se["Toggle--Large"],c=67);const m=f.useCallback(d=>{t&&t(d),s(d?.target?.checked)},[t]);return a.jsx(P.Switch,{className:i,size:e,labelPosition:r,disabled:n,onChange:m,styles:()=>({track:{backgroundColor:!n&&l?"#0fd3d8 !important":void 0,borderColor:!n&&l?"#0fd3d8 !important":void 0,width:c}}),...o})},Me={Tooltip__Body:"styles-module__Tooltip__Body___i1OTG",Tooltip__Title:"styles-module__Tooltip__Title___E0LoV",Tooltip__Content:"styles-module__Tooltip__Content___lU5gr"},Jt=({title:e,content:r,maw:n=280,multiline:t=!0,...o})=>a.jsx(P.Tooltip,{...o,maw:n,multiline:t,label:a.jsxs("div",{className:Me.Tooltip__Body,children:[e&&a.jsx("span",{className:Me.Tooltip__Title,children:e}),a.jsx("span",{className:Me.Tooltip__Content,children:r})]})}),Xt=e=>{const{name:r,icon:n}=e;return`
4
4
  <div class="pin-marker">
5
- ${o?`<img src="${o}" alt="${r}" width="40" height="40" />`:`
5
+ ${n?`<img src="${n}" alt="${r}" width="40" height="40" />`:`
6
6
  <svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
7
7
  <g>
8
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"/>
@@ -12,38 +12,38 @@
12
12
  `}
13
13
  <div class="pin-marker-name">${r}</div>
14
14
  </div>
15
- `},$t=e=>{const{discountRate:r,price:o,originalPrice:t,category:n,active:l,title:s}=e;return`
15
+ `},Qt=e=>{const{discountRate:r,price:n,originalPrice:t,category:o,active:l,title:s}=e;return`
16
16
  <div class="popdeal-marker" active="${!!l}">
17
17
  <div class="popdeal-marker-section">
18
18
  <div class="popdeal-marker-section-header">
19
19
  <span class="popdeal-marker-title">${s}</span>
20
- ${n?`<span class="popdeal-marker-category">${n}</span>`:""}
20
+ ${o?`<span class="popdeal-marker-category">${o}</span>`:""}
21
21
  </div>
22
22
  <div class="popdeal-marker-section-price">
23
23
  ${t?`<span class="popdeal-marker-original_price">${t.toLocaleString()}원</span>`:""}
24
24
  ${r?`<span class="popdeal-marker-discount_rate">${r}%</span>`:""}
25
- <span class="popdeal-marker-discounted_price">${o.toLocaleString()}원</span>
25
+ <span class="popdeal-marker-discounted_price">${n.toLocaleString()}원</span>
26
26
  </div>
27
27
  </div>
28
28
  </div>
29
- `},Wt=e=>{const{title:r,icon:o}=e;return`
29
+ `},Rt=e=>{const{title:r,icon:n}=e;return`
30
30
  <div class="pi-marker">
31
- ${o?`<img class="pi-marker-icon" src="${o}" alt="" width="32px" height="32px" />`:""}
31
+ ${n?`<img class="pi-marker-icon" src="${n}" alt="" width="32px" height="32px" />`:""}
32
32
  <span class="pi-marker-text">${r}</span>
33
33
  </div>
34
- `},Yt=e=>{const{title:r,icon:o,address:t}=e;return`
34
+ `},er=e=>{const{title:r,icon:n,address:t}=e;return`
35
35
  <div class="pi-expanded-marker">
36
- ${o?`<img class="pi-expanded-marker-icon" src="${o}" alt="" width="32px" height="32px" />`:""}
36
+ ${n?`<img class="pi-expanded-marker-icon" src="${n}" alt="" width="32px" height="32px" />`:""}
37
37
  <div class="pi-expanded-marker-content">
38
38
  <div class="pi-expanded-marker-title">${r}</div>
39
39
  ${t?`<div class="pi-expanded-marker-address">${t}</div>`:""}
40
40
  </div>
41
41
  </div>
42
- `},Zt=e=>`
42
+ `},tr=e=>`
43
43
  <div class="cluster-marker">
44
44
  <span class="cluster-marker-text">${e.count}</span>
45
45
  </div>
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=`
46
+ `,Te=e=>{switch(e.type){case"pin":return Xt(e);case"popdeal":return Qt(e);case"pi":return Rt(e);case"pi-expanded":return er(e);case"cluster":return tr(e);default:return""}},Ge=`
47
47
  /* Common marker styles */
48
48
  [class$="marker"] {
49
49
  user-select: none;
@@ -318,13 +318,13 @@
318
318
  background: #00C4C4;
319
319
  transform: translate(-50%) rotate(45deg);
320
320
  }
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
+ `,qe=f.createContext(null),Ke="naver-map-script",rr=(e,r)=>new Promise((n,t)=>{if(typeof window<"u"&&window.naver?.maps){n();return}const o=document.getElementById(Ke);if(o){o.addEventListener("load",()=>n()),o.addEventListener("error",()=>t(new Error("Failed to load Naver Map script")));return}const l=document.createElement("script");l.id=Ke,l.src=`https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=${e}&language=${r}`,l.async=!0,l.onload=()=>{n()},l.onerror=()=>{t(new Error("Failed to load Naver Map script"))},document.head.appendChild(l)}),Je=({clientId:e,language:r="ko",children:n})=>{const[t,o]=f.useState(null),[l,s]=f.useState({}),[i,c]=f.useState(null);f.useEffect(()=>{typeof window>"u"||rr(e,r).then(()=>{window.naver&&o(window.naver)}).catch(d=>{console.error("Naver Map script loading failed:",d),c(d)})},[e,r]);const m=f.useCallback((d,_)=>{const u=t||(typeof window<"u"?window.naver:null);if(!u||(!t&&window.naver&&o(window.naver),!d.current))return null;const p=d.current;if(!p.isConnected)return null;try{const h={center:new u.maps.LatLng(37.5665,126.978),zoom:11,maxZoom:20,minZoom:11,mapTypeControl:!1,scaleControl:!1,logoControl:!1,mapDataControl:!1,zoomControl:!1,..._},g=new u.maps.Map(p,h);return s(y=>{const k=p.getAttribute("id")||"default";return{...y,[k]:g}}),g}catch(h){return console.error("Map creation error:",h),null}},[t]);return i&&console.error("NaverMapProvider error:",i),a.jsx(qe.Provider,{value:{naver:t,createMap:m,maps:l},children:n})},be=()=>{const e=f.useContext(qe);if(!e)throw new Error("useNaverMap must be used within NaverMapProvider");return e};function Xe(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 o=this;if(typeof t=="string"){const l=t,s=arguments[1];o.set(l,s)}else{const l=arguments[1];e.maps.Util.forEach(t,function(s,i){i!=="map"&&o.set(i,s)}),t.map&&!l&&o.setMap(t.map)}},getOptions:function(t){const o=this,l={};return t!==void 0?o.get(t):(e.maps.Util.forEach(o.DEFAULT_OPTIONS,function(s,i){l[i]=o.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,o){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";o&&(l="disableClickZoom"),this._clusters.forEach(function(s){s[l]()});break}},_createClusters:function(){const t=this.getMap();if(!t)return;const o=t.getBounds(),l=this.getMarkers();for(let s=0,i=l.length;s<i;s++){const c=l[s],m=c.getPosition();if(!o.hasLatLng(m))continue;this._getClosestCluster(m).addMarker(c),this._markerRelations.push(e.maps.Event.addListener(c,"dragend",e.maps.Util.bind(this._onDragEnd,this)))}},_updateClusters:function(){const t=this._clusters;for(let o=0,l=t.length;o<l;o++)t[o].updateCluster()},_clearClusters:function(){const t=this._clusters;for(let o=0,l=t.length;o<l;o++)t[o].destroy();e.maps.Event.removeListener(this._markerRelations),this._markerRelations=[],this._clusters=[]},_redraw:function(){this._clearClusters(),this._createClusters(),this._updateClusters()},_getClosestCluster:function(t){const o=this.getProjection(),l=this._clusters;let s=null,i=1/0;for(let c=0,m=l.length;c<m;c++){const d=l[c],_=d.getCenter();if(d.isInBounds(t)){const u=o.getDistance(_,t);u<i&&(i=u,s=d)}}return s||(s=new n(this),this._clusters.push(s)),s},_onIdle:function(){this._redraw()},_onDragEnd:function(){this._redraw()}});const n=function(t){this._clusterCenter=null,this._clusterBounds=null,this._clusterMarker=null,this._relation=null,this._clusterMember=[],this._markerClusters=t};return n.prototype={constructor:n,addMarker:function(t){if(!this._isMember(t)){if(!this._clusterCenter){const o=t.getPosition();this._clusterCenter=o,this._clusterBounds=this._calcBounds(o)}this._clusterMember.push(t)}},destroy:function(){e.maps.Event.removeListener(this._relation);const t=this._clusterMember;for(let o=0,l=t.length;o<l;o++)t[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(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(o){t.morph(o.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,o=t.getMinClusterSize(),l=t.getMaxZoom(),s=t.getMap().getZoom();this.getCount()<o?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 o=this._getIndex(t);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 t=this._markerClusters.getMap(),o=this._clusterMarker,l=this._clusterMember;for(let s=0,i=l.length;s<i;s++)l[s].setMap(t);o&&o.setMap(null)},_hideMember:function(){const t=this._markerClusters.getMap(),o=this._clusterMarker,l=this._clusterMember;for(let s=0,i=l.length;s<i;s++)l[s].setMap(null);o&&!o.getMap()&&o.setMap(t)},_calcBounds:function(t){const o=this._markerClusters.getMap(),l=new e.maps.LatLngBounds(t.clone(),t.clone()),s=o.getBounds(),i=o.getProjection(),c=i.fromCoordToOffset(s.getNE()),m=i.fromCoordToOffset(s.getSW()),d=i.fromCoordToOffset(l.getNE()),_=i.fromCoordToOffset(l.getSW()),u=this._markerClusters.getGridSize()/2;d.add(u,-u),_.add(-u,u);const p=Math.min(c.x,d.x),h=Math.max(c.y,d.y),g=Math.max(m.x,_.x),y=Math.min(m.y,_.y),k=i.fromOffsetToCoord(new e.maps.Point(p,h)),S=i.fromOffsetToCoord(new e.maps.Point(g,y));return new e.maps.LatLngBounds(S,k)},_getIndex:function(t){const o=this._markerClusters.getIndexGenerator();if(e.maps.Util.isFunction(o))return o(t);if(e.maps.Util.isArray(o)){let l=0;for(let s=0,i=o.length;s<i;s++){const c=o[s];if(t<c)break;l++}return l}return 0},_isMember:function(t){return this._clusterMember.indexOf(t)!==-1},_calcAverageCenter:function(t){const o=t.length,l=[0,0];for(let s=0;s<o;s++)l[0]+=t[s].position.x,l[1]+=t[s].position.y;return l[0]/=o,l[1]/=o,new e.maps.Point(l[0],l[1])}},r}const Qe=e=>{const{naver:r}=be(),[n,t]=f.useState([]),o=f.useRef(new Map),l=f.useRef(null),s=f.useCallback(_=>{if(!e||!r)return null;const u=Te(_),p=new r.maps.Marker({..._,position:new r.maps.LatLng(_.position.latitude,_.position.longitude),map:e,icon:{content:u}});return _.onClick&&r.maps.Event.addListener(p,"click",()=>{_.onClick(_.id)}),t(h=>[...h,p]),o.current.set(_.id,{marker:p,data:_}),p},[e,r]),i=f.useCallback((_,u)=>{const p=o.current.get(_);if(!p||!r)return;const{marker:h,data:g}=p,y={...g,...u},k=h.getElement();if(k){const S=k.querySelector(".popdeal-marker");S&&"active"in u&&S.setAttribute("active",String(!!u.active))}o.current.set(_,{marker:h,data:y})},[r]),c=f.useCallback(()=>{n.forEach(_=>{_&&_.setMap(null)}),t([]),o.current.clear(),l.current&&(l.current.setMap(null),l.current=null)},[n]),m=f.useCallback(_=>{!e||!r||e.panTo(new r.maps.LatLng(_.latitude,_.longitude))},[e,r]),d=f.useCallback(_=>{if(!e||!r||_.length===0)return;const u=new r.maps.LatLngBounds(new r.maps.LatLng(_[0].latitude,_[0].longitude),new r.maps.LatLng(_[0].latitude,_[0].longitude));_.forEach(p=>{u.extend(new r.maps.LatLng(p.latitude,p.longitude))}),e.fitBounds(u)},[e,r]);return f.useEffect(()=>{if(!r||!e||n.length===0)return;const _=Xe(r),p={content:Te({type:"cluster",count:0}),size:new r.maps.Size(96,96),anchor:new r.maps.Point(20,20)},h=new _({minClusterSize:2,maxZoom:17,map:e,markers:n,disableClickZoom:!1,gridSize:120,icons:[p],indexGenerator:[10,100,200,500,1e3],averageCenter:!1,stylingFunction:(g,y)=>{if(g&&typeof g.getElement=="function"){const k=g.getElement().querySelector(".cluster-marker-text");k&&(k.textContent=String(y))}}});return l.current=h,()=>{h.setMap(null)}},[r,e,n]),{addMarker:s,updateMarker:i,clearMarkers:c,panTo:m,fitBounds:d}},Ie=({options:e,onLoad:r})=>{const n=f.useRef(null),t=f.useRef(null),{createMap:o}=be(),[l,s]=f.useState(null),i=Qe(l),{width:c="100%",height:m="100%",...d}=e||{},_=f.useMemo(()=>d,[JSON.stringify(d)]);return f.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=Ge,document.head.appendChild(p),t.current=p,()=>{}},[]),f.useEffect(()=>{let u=null,p=null;if(l&&(l.destroy(),s(null)),n.current&&n.current.isConnected){const h=()=>n.current&&n.current.isConnected&&(u=o(n,_),u)?(s(u),!0):!1;if(!h()){let g=0;const y=50;p=setInterval(()=>{g++,(h()||g>=y)&&p&&(clearInterval(p),p=null)},100)}return()=>{p&&clearInterval(p),u&&(u.destroy(),u=null)}}return()=>{p&&clearInterval(p),u&&(u.destroy(),u=null)}},[o,_]),f.useEffect(()=>{l&&r&&r({map:l,...i})},[l,r,i]),a.jsx("div",{ref:n,style:{width:typeof c=="number"?`${c}px`:c,height:typeof m=="number"?`${m}px`:m}})};Ie.displayName="Map";const nr="위치 정보를 불러오는 데 실패했어요.",or="위치 서비스 권한과 네트워크 상태를 확인해주세요.",ar=({isActive:e=!1,errorMessage:r=nr,errorDescription:n=or})=>{const[t,o]=f.useState(!1),[l,s]=f.useState(!1),[i,c]=f.useState(null),m=f.useRef(!1);return f.useEffect(()=>{if(e&&typeof navigator<"u"&&"geolocation"in navigator){if(m.current)return;m.current=!0,requestAnimationFrame(()=>{o(!0)});const d={enableHighAccuracy:!0,timeout:1e4,maximumAge:0};navigator.geolocation.getCurrentPosition(_=>{c({latitude:_.coords.latitude,longitude:_.coords.longitude}),o(!1),s(!1),m.current=!1},_=>{c(null),console.error("Geolocation error:",_),oe({message:`${r} ${n}`}),o(!1),s(!0),m.current=!1},d)}},[e,r,n]),{position:i,isLoading:t,isError:l}},Re=(e="light")=>{const r=[];return Object.entries(D.colors).forEach(([n,t])=>{Object.entries(t).forEach(([o,l])=>{const s=D.getCSSVariableName(n,o);r.push(`${s}: ${l};`)})}),r.join(`
322
+ `)},sr=(e="light")=>{const r=document.getElementById("pop-ui-theme-vars");r&&r.remove();const n=document.createElement("style");n.id="pop-ui-theme-vars",n.textContent=`
323
323
  :root {
324
- ${Ve("light")}
324
+ ${Re("light")}
325
325
  }
326
326
 
327
327
  [data-theme="dark"] {
328
- ${Ve("dark")}
328
+ ${Re("dark")}
329
329
  }
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"})});
330
+ `,document.head.appendChild(n)},re=e=>{const r=D.colors[e],n=Object.keys(r).sort((o,l)=>Number(o)-Number(l));return[D.getCSSVariableRef(e,n[0]||n[n.length-1]),D.getCSSVariableRef(e,n[1]||n[n.length-1]),D.getCSSVariableRef(e,n[2]||n[n.length-1]),D.getCSSVariableRef(e,n[3]||n[n.length-1]),D.getCSSVariableRef(e,n[4]||n[n.length-1]),D.getCSSVariableRef(e,n[5]||n[n.length-1]),D.getCSSVariableRef(e,n[6]||n[n.length-1]),D.getCSSVariableRef(e,n[7]||n[n.length-1]),D.getCSSVariableRef(e,n[8]||n[n.length-1]),D.getCSSVariableRef(e,n[9]||n[n.length-1])]},lr=P.createTheme({colors:{gray:re("gray"),aqua:re("aqua"),red:re("red"),orange:re("orange"),yellow:re("yellow"),green:re("green"),blue:re("blue"),purple:re("purple"),grape:re("grape")},primaryColor:"aqua",primaryShade:5,fontFamily:'Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}),et=f.createContext(void 0),tt=f.createContext({}),ir=({children:e,defaultTheme:r="light",naverClientId:n,notificationPosition:t="bottom-center",notificationLimit:o=5,notificationAutoClose:l,notificationZIndex:s})=>{const[i,c]=f.useState(r);f.useEffect(()=>{sr(i),document.documentElement.setAttribute("data-theme",i)},[i]);const m=()=>{c(d=>d==="light"?"dark":"light")};return a.jsx(et.Provider,{value:{theme:i,setTheme:c,toggleTheme:m},children:a.jsx(tt.Provider,{value:{naverClientId:n},children:a.jsxs(P.MantineProvider,{theme:lr,children:[a.jsx(le.Notifications,{position:t,limit:o,autoClose:l,zIndex:s}),e]})})})},cr=()=>{const e=f.useContext(et);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e},_r=()=>f.useContext(tt),R={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"},dr=60,ur=({location:e,marker:r,direction:n,toast:t,naverClientId:o,onExpandRequest:l,onClick:s,height:i=200})=>{const c=_r(),m=o||c.naverClientId,{title:d,address:_,latitude:u,longitude:p}=e,h=n?.label??"길찾기",g=t?.addressCopied??"주소 복사 완료",[y,k]=f.useState(null),S=i-dr,I=f.useCallback(T=>{T&&T.map&&k(T)},[]),$=f.useCallback(()=>{l?.()},[l]),N=f.useCallback((T,x,v)=>{if(T&&T.map&&u&&p)try{T.addMarker(x),v?.()}catch(O){console.error("Error creating map marker:",O)}},[u,p]),U=f.useCallback((T,x)=>{T&&T.map&&u&&p&&(T.clearMarkers(),N(T,{id:`location-marker-${d}`,type:x,position:{latitude:u,longitude:p},title:d,icon:r?.imageUrl,address:_},()=>{T.panTo({latitude:u,longitude:p})}))},[u,p,d,r?.imageUrl,_,N]);f.useEffect(()=>{u&&p&&y&&U(y,"pi")},[y,u,p,U]),f.useEffect(()=>()=>{k(null)},[]);const H=f.useCallback(()=>{typeof navigator<"u"&&navigator.clipboard&&(navigator.clipboard.writeText(_),oe(g))},[_,g]),B=f.useMemo(()=>n?.url?n.url:`https://map.naver.com/p/search/${encodeURIComponent(d)}`,[n?.url,d]);return m?a.jsxs("div",{className:R.MapInfo,style:{height:i},onClick:s,children:[a.jsx(Je,{clientId:m,children:a.jsxs("div",{className:R.MapInfo__Preview,onClick:$,children:[a.jsx(Ie,{onLoad:I,options:{width:"100%",height:`${S}px`,center:{lat:u,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:R.MapInfo__ExpandButton,children:a.jsx(D.IconMap,{color:D.ColorGray800,size:18})})]})}),a.jsxs("div",{className:R.MapInfo__AddressBar,children:[a.jsxs("div",{className:R.MapInfo__AddressContent,children:[a.jsx(D.IconMapMarker,{color:D.ColorAqua500,size:24,variant:"filled"}),a.jsx("span",{className:R.MapInfo__Address,onClick:H,role:"button",tabIndex:0,onKeyDown:T=>T.key==="Enter"&&H(),children:_})]}),a.jsx("a",{className:R.MapInfo__DirectionLink,href:B,target:"_blank",rel:"noreferrer",children:a.jsx(ie,{variant:"basic",size:"sm",className:R.MapInfo__DirectionButton,children:h})})]})]}):a.jsx("div",{className:R.MapInfo,style:{height:i},children:a.jsx("div",{className:R.MapInfo__NoClientId,children:"naverClientId가 필요합니다. PopUIProvider 또는 props로 전달해주세요."})})};C.Button=ie,C.CalendarDatePicker=Ee,C.Checkbox=ut,C.DatePicker=kt,C.Dropdown=Ct,C.ImageInput=At,C.LottieInput=$t,C.Map=Ie,C.MapInfo=ur,C.Modal=Fe,C.NaverMapProvider=Je,C.Pagination=zt,C.PopUiProvider=ir,C.Radio=Wt,C.SearchBar=Zt,C.SegmentButton=Vt,C.Tab=Ut,C.TextField=Gt,C.TimePicker=qt,C.Toggle=Kt,C.Tooltip=Jt,C.getMarkerHTML=Te,C.makeMarkerClustering=Xe,C.markerStyles=Ge,C.toast=oe,C.useLocation=ar,C.useMap=Qe,C.useNaverMap=be,C.useTheme=cr,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
@@ -157,7 +157,9 @@ export declare interface ILocation {
157
157
  longitude?: number;
158
158
  }
159
159
 
160
- export declare const ImageInput: ({ value, onChange, width, height, placeholder, hasIcon, hasLink, onLinkClick, hasEdit, canDelete, minLength, maxLength, errorMsg, isLoading, readOnly, gap, }: ImageInputProps) => JSX.Element;
160
+ export declare const ImageInput: ({ value, onChange, accept, length, width, height, placeholder, hasIcon, hasLink, onLinkClick, hasEdit, canDelete, minLength, maxLength, errorMsg, isLoading, readOnly, gap, }: ImageInputProps) => JSX.Element;
161
+
162
+ export declare type ImageInputAccept = TImageMimeType[];
161
163
 
162
164
  export declare type ImageInputChangeAction = 'create' | 'replace' | 'delete' | 'reorder' | 'crop';
163
165
 
@@ -174,11 +176,14 @@ export declare interface ImageInputItem {
174
176
  url?: string;
175
177
  file?: File;
176
178
  isLoading?: boolean;
179
+ position?: number;
177
180
  }
178
181
 
179
182
  export declare interface ImageInputProps {
180
183
  value: ImageInputItem[];
181
184
  onChange?: (nextValue: ImageInputItem[], meta: ImageInputChangeMeta) => void;
185
+ accept?: ImageInputAccept;
186
+ length?: number;
182
187
  width?: number;
183
188
  height?: number;
184
189
  placeholder?: TImageInputPlaceholder;
@@ -401,7 +406,7 @@ export declare interface IUseLocationOptions {
401
406
  errorDescription?: string;
402
407
  }
403
408
 
404
- export declare const LottieInput: ({ value, onChange, width, height, placeholder, hasIcon, hasLink, onLinkClick, minLength, maxLength, errorMsg, isLoading, readOnly, gap, canDelete, }: LottieInputProps) => JSX.Element;
409
+ export declare const LottieInput: ({ value, onChange, width, height, placeholder, hasIcon, hasLink, onLinkClick, length, minLength, maxLength, errorMsg, isLoading, readOnly, gap, canDelete, }: LottieInputProps) => JSX.Element;
405
410
 
406
411
  export declare type LottieInputChangeAction = 'create' | 'delete' | 'reorder';
407
412
 
@@ -419,6 +424,7 @@ export declare interface LottieInputItem {
419
424
  file?: File;
420
425
  animationData?: Record<string, unknown>;
421
426
  isLoading?: boolean;
427
+ position?: number;
422
428
  }
423
429
 
424
430
  export declare interface LottieInputProps {
@@ -430,6 +436,7 @@ export declare interface LottieInputProps {
430
436
  hasIcon?: boolean;
431
437
  hasLink?: boolean;
432
438
  onLinkClick?: (item: LottieInputItem) => void;
439
+ length?: number;
433
440
  minLength?: number;
434
441
  maxLength?: number;
435
442
  errorMsg?: ReactNode;
@@ -484,6 +491,8 @@ export declare const TextField: (allProps: TTextFieldProps) => JSX.Element;
484
491
 
485
492
  declare type TImageInputPlaceholder = ReactNode | ((index: number) => ReactNode);
486
493
 
494
+ declare type TImageMimeType = 'image/png' | 'image/gif' | 'image/jpeg' | 'image/svg+xml' | 'image/webp' | 'image/avif' | 'image/heic' | 'image/heif';
495
+
487
496
  export declare const TimePicker: ({ size, ...props }: ITimePickerProps) => JSX.Element;
488
497
 
489
498
  export declare type TMarkerData = IClusterMarkerData | IPopdealMarkerData | IPinMarkerData | IPiMarkerData;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pop-ui/core",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "main": "./dist/core.umd.cjs",
6
6
  "module": "./dist/core.js",
7
7
  "types": "./dist/types/index.d.ts",