@pop-ui/core 2.3.0 → 2.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @pop-ui/core
2
2
 
3
+ ## 2.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 0e36119: ImageInput 항목(`IImageInputItem`)에 `canDelete` 를 추가했습니다. 항목별로 삭제 버튼 노출을 정할 수 있고, 없으면 컴포넌트의 `canDelete` 를 따릅니다.
8
+ - Updated dependencies [0e36119]
9
+ - @pop-ui/foundation@2.3.1
10
+
3
11
  ## 2.3.0
4
12
 
5
13
  ### Minor Changes
package/dist/core.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(k,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@mantine/core"),require("@mantine/dates"),require("@pop-ui/foundation"),require("dayjs"),require("dayjs/locale/ko.js"),require("react"),require("dayjs/plugin/customParseFormat.js"),require("@dnd-kit/core"),require("@dnd-kit/sortable"),require("@mantine/dropzone"),require("react-easy-crop"),require("@dnd-kit/utilities"),require("@mantine/notifications")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@mantine/core","@mantine/dates","@pop-ui/foundation","dayjs","dayjs/locale/ko.js","react","dayjs/plugin/customParseFormat.js","@dnd-kit/core","@dnd-kit/sortable","@mantine/dropzone","react-easy-crop","@dnd-kit/utilities","@mantine/notifications"],a):(k=typeof globalThis<"u"?globalThis:k||self,a(k.Core={},k.jsxRuntime,k.MantineCore,k.dates,k.foundation,k.dayjs,null,k.React,k.customParseFormat,k.core$1,k.sortable,k.dropzone,k.Cropper,k.utilities,k.notifications))})(this,function(k,a,P,Ce,h,Y,Pr,f,it,oe,ne,ke,_t,Ae,pe){"use strict";const ct={sm:14,md:16,lg:18},U={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-"},De={inner:U.Button__Inner,label:U.Button__Label,section:U.Button__Section,loader:U.Button__Loader},dt={sm:U["Button--Small"],md:U["Button--Medium"],lg:U["Button--Large"]},ut={primary:U["Button--Primary"],primaryLine:U["Button--PrimaryLine"],basic:U["Button--Basic"],danger:U["Button--Danger"],setting:U["Button--Setting"],warning:U["Button--Warning"],ghost:U["Button--Ghost"]},pt=(...e)=>e.filter(Boolean).join(" ")||void 0,mt=e=>{const r=(o,t)=>{const n=Object.keys(o).reduce((l,s)=>{const i=s,c=[o[i],t[i]].filter(Boolean).join(" ");return c&&(l[i]=c),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(De,e(o,t,n)):typeof e=="object"&&e!==null&&!Array.isArray(e)?r(De,e):De};function ue({children:e,size:r="md",variant:o="primary",type:t="button",isLoading:n=!1,loading:l=!1,hideLabelOnLoading:s=!0,disabled:i=!1,className:c,classNames:u,loaderProps:p,..._}){const m=ct[r],d=n||l,g=i||d;return a.jsxs(P.Button,{type:t,unstyled:!0,className:pt(U.Button,i?U.Button__Disabled:"",dt[r],ut[o],c),classNames:mt(u),disabled:g,..._,children:[d&&a.jsx(P.Loader,{color:"currentColor",size:m,...p}),a.jsx("span",{className:U.Button__Label,children:d&&s?null:e})]})}const Se={"Checkbox--Small":"styles-module__Checkbox--Small___VZGlw","Checkbox--Medium":"styles-module__Checkbox--Medium___Vwpa3","Checkbox--Large":"styles-module__Checkbox--Large___ybTGE"},ft={sm:Se["Checkbox--Small"],md:Se["Checkbox--Medium"],lg:Se["Checkbox--Large"]},ht={sm:18,md:24,lg:32},gt=({size:e="md",...r})=>{const o=ft[e],t=ht[e];return a.jsx(P.Checkbox,{className:o,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"},yt=({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=>Y(s)).filter(s=>s.isValid()).map(s=>s.format("YYYY-MM-DD")),l=t.map(([s,i])=>[Y(s),Y(i)]).filter(([s,i])=>s.isValid()&&i.isValid());return s=>{const i=Y(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[c,u]of l)if((i.isSame(c,"day")||i.isAfter(c,"day"))&&(i.isSame(u,"day")||i.isBefore(u,"day")))return!0;return!1}},Ct=(e,r,o,t)=>{const n=Y(e),l=Y(r);for(const s of o)if(Array.isArray(s)){const i=Y(s[0]),c=Y(s[1]);if(!i.isValid()||!c.isValid())continue;if(!(l.isBefore(i,"day")||n.isAfter(c,"day")))return!0}for(const s of o)if(typeof s=="string"){const i=Y(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},le=(e="default")=>{switch(e){case"range":return[null,null];case"multiple":return[];default:return null}},Oe=(e="default",r)=>r==null?le(e):e==="range"?Array.isArray(r)?r:le("range"):e==="multiple"?Array.isArray(r)?r:le("multiple"):Array.isArray(r)?r[0]??null:r,Fe=({type:e,externalValue:r,internalValue:o})=>r!==void 0?Oe(e,r):o!==void 0?Oe(e,o):le(e),Pe=(e,r)=>{const o=(t,n)=>{const l=Object.keys(t).reduce((s,i)=>{const c=i,u=t[c],p=n[c],_=[u,p].filter(Boolean).join(" ");return _&&(s[c]=_),s},{});return Object.keys(n).forEach(s=>{const i=s,c=n[i];!(i in t)&&c&&(l[i]=c)}),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},kt=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 Y(o).format("YYYY-MM-DD")}return null}return e instanceof Date?Y(e).format("YYYY-MM-DD"):null},Dt={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},$e=({excludedDates:e=[],excludedDays:r=[],type:o="default",value:t,onChange:n,highlightToday:l=!1,...s})=>{const{classNames:i,date:c,defaultDate:u,onDateChange:p,getDayProps:_,...m}=s,[d,g]=f.useState(()=>t??le(o)),[C,y]=f.useState(()=>c||u||(kt(t??le(o))??new Date)),D=f.useMemo(()=>yt({excludedDays:r,excludedDates:e}),[r,e]),S=f.useCallback(b=>{c===void 0&&y(b),p?.(b)},[c,p]),x=b=>{if(o==="range"&&Array.isArray(b)&&b.length===2){const[O,F]=b;if(O&&F&&Ct(O,F,e,r)){const W=le("range");g(W),n?.(W);return}}g(b),n?.(b)},I=Fe({type:o,externalValue:t,internalValue:d}),H=f.useCallback(b=>{const O=Y(b).date(),W=Y(b).isSame(Y(),"day")&&l;return a.jsxs("span",{className:K.CalendarDatePicker__DayContent,children:[a.jsx("span",{className:K.CalendarDatePicker__DayLabel,children:O}),W&&a.jsx("span",{className:K.CalendarDatePicker__TodayIndicator,children:"오늘"})]})},[l]),G=Pe(Dt,i),V=c??C,Z=Y(V??new Date).format("YYYY-MM"),M=f.useCallback(b=>{const O=_?.(b)??{},F=Y(b).format("YYYY-MM")!==Z;return{...O,onClick:W=>{O.onClick?.(W),F&&S(b)}}},[Z,_,S]);return a.jsx(Ce.DatePicker,{locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 M월",maxLevel:"month",type:o,previousIcon:a.jsx(h.IconChevronLeft,{}),nextIcon:a.jsx(h.IconChevronRight,{}),...m,size:"lg",onChange:x,weekendDays:[0],highlightToday:l,classNames:G,defaultDate:c===void 0?u:void 0,date:V,onDateChange:S,getDayProps:M,value:I,excludeDate:D,renderDay:H})},v={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"};Y.extend(it);const St={wrapper:v.DatePicker__Wrapper,input:v.DatePicker__Input,section:v.DatePicker__Section,placeholder:v.DatePicker__Placeholder,datePickerRoot:v.DatePicker__Root,levelsGroup:v.DatePicker__LevelsGroup,calendarHeader:v.DatePicker__CalendarHeader,calendarHeaderLevel:v.DatePicker__CalendarHeaderLevel,calendarHeaderControl:v.DatePicker__CalendarHeaderControl,calendarHeaderControlIcon:v.DatePicker__CalendarHeaderControlIcon,month:v.DatePicker__Month,weekdaysRow:v.DatePicker__WeekdaysRow,weekday:v.DatePicker__Weekday,monthRow:v.DatePicker__MonthRow,monthCell:v.DatePicker__MonthCell,day:v.DatePicker__Day,timeWrapper:v.DatePicker__TimeWrapper,timeInput:v.DatePicker__TimeInput,submitButton:v.DatePicker__SubmitButton},Pt={dropdown:v.DatePicker__Dropdown,arrow:v.DatePicker__DropdownArrow},ze=(...e)=>e.filter(Boolean).join(" ")||void 0,fe=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},xt=({size:e="md",type:r="default",withTime:o,className:t,popoverProps:n,rightSection:l,rightSectionWidth:s,value:i,defaultValue:c,onChange:u,placeholder:p,disabled:_,minDate:m,maxDate:d,displayValueFormat:g="YYYY년 MM월 DD일",valueFormat:C,excludedDates:y,excludedDays:D,highlightToday:S})=>{const x=C??(o?"YYYY-MM-DD HH:mm":"YYYY-MM-DD"),[I,H]=f.useState(!1),[G,V]=f.useState(()=>h.parseDateValue(i??c,r,x)??le(r));let Z=v["DatePicker--Medium"],M=18,b=42;e==="sm"?(Z=v["DatePicker--Small"],M=14,b=34):e==="lg"&&(Z=v["DatePicker--Large"],M=24,b=50);const O=Pe(Pt,n?.classNames),F=l??a.jsx("span",{"aria-hidden":"true",className:v.DatePicker__Icon,children:a.jsx(h.IconCalendar,{size:M})});if(o){const E=ee=>{if(!ee)return null;const se=Y(ee,x,!0);return se.isValid()?se.toDate():null},B=i!==void 0,w=B?E(i):null,Q=E(c);return a.jsx(Ce.DateTimePicker,{className:ze(v.DatePickerBase,v.DatePickerRoot,Z,t),classNames:Pe(St,void 0),size:e,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD | a hh:mm",rightSection:F,rightSectionWidth:s??b,popoverProps:{offset:8,position:"bottom-start",withArrow:!0,arrowSize:10,arrowOffset:20,...n,classNames:O},value:B?w:void 0,defaultValue:B?void 0:Q,onChange:ee=>{u?.(ee?Y(ee).format(x):null)},placeholder:p,disabled:_,minDate:m,maxDate:d})}const W=i!=null?h.parseDateValue(i,r,x):void 0,N=Fe({type:r,externalValue:W,internalValue:G}),T=h.formatDateDisplay(N,r,g),$=E=>{let B;if(r==="range"&&Array.isArray(E)){const w=E;B=[fe(w[0]??null),fe(w[1]??null)]}else r==="multiple"&&Array.isArray(E)?B=E.map(w=>fe(w)).filter(w=>w!==null):B=fe(E);V(B),u?.(h.toValueString(B,r,x)),r==="default"&&B!=null&&H(!1),r==="range"&&Array.isArray(B)&&B[0]&&B[1]&&H(!1)};return a.jsx("div",{className:ze(v.DatePickerBase,v.DatePickerRoot,Z,t),children:a.jsxs(P.Popover,{opened:I,onClose:()=>H(!1),offset:8,position:"bottom-start",withArrow:!0,arrowSize:10,arrowOffset:20,...n,classNames:O,children:[a.jsx(P.Popover.Target,{children:a.jsx("div",{className:v.DatePicker__Wrapper,"data-expanded":I?!0:void 0,"data-disabled":_?!0:void 0,children:a.jsx(P.Input,{component:"button",type:"button",classNames:{input:v.DatePicker__Input,section:v.DatePicker__Section},onClick:()=>!_&&H(E=>!E),disabled:_,rightSection:F,rightSectionWidth:s??b,"data-expanded":I?!0:void 0,"data-disabled":_?!0:void 0,children:T?a.jsx("span",{children:T}):a.jsx("span",{className:v.DatePicker__Placeholder,children:p})})})}),a.jsx(P.Popover.Dropdown,{children:a.jsx($e,{type:r,value:N,onChange:$,excludedDates:y,excludedDays:D,highlightToday:S,minDate:m,maxDate:d})})]})})},X={"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"},bt=({label:e,labelPosition:r="top",size:o="md",required:t,tooltip:n,tooltipPosition:l="top",errorMsg:s,description:i,...c})=>{const[u,p]=f.useState(!1);let _=X["Dropdown__Label--Medium"],m=X["Dropdown--Medium"],d=X["Dropdown__Tooltip--Medium"],g=18;return o==="sm"?(_=X["Dropdown__Label--Small"],m=X["Dropdown--Small"],d=X["Dropdown__Tooltip--Small"],g=14):o==="lg"&&(_=X["Dropdown__Label--Large"],m=X["Dropdown--Large"],d=X["Dropdown__Tooltip--Large"],g=24),a.jsxs("div",{className:r==="top"?X["Dropdown--TopLabel"]:X["Dropdown--LeftLabel"],children:[a.jsxs("div",{children:[e&&a.jsx(P.Input.Label,{required:t,className:_,children:e}),n&&a.jsx(P.Tooltip,{label:n,position:l,children:a.jsx("div",{className:d,children:a.jsx(h.IconInfoCircle,{size:o==="sm"?14:o==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx(P.Select,{...c,size:o,error:s,className:m,rightSection:u?a.jsx(h.IconChevronUp,{size:g}):a.jsx(h.IconChevronDown,{size:g}),onDropdownOpen:()=>p(!0),onDropdownClose:()=>p(!1),styles:{option:{"&[data-selected]":{"&, &:hover":{backgroundColor:h.ColorGray100,color:h.ColorBlack}}}}}),i&&a.jsx(P.Input.Description,{className:X.Dropdown__Description,children:i}),s&&a.jsx(P.Input.Error,{className:X.Dropdown__ErrorMsg,children:s})]})]})},Mt=e=>({...e?{}:{content:{borderRadius:"12px"}},title:{fontSize:"16px",fontWeight:"700",lineHeight:"150%",color:h.ColorGray900},header:{padding:"16px"},body:{paddingInline:0}}),vt=(e,r)=>{if(typeof e=="function")return e;const o=Mt(r),t={...o,...e};return Object.keys(o).forEach(n=>{t[n]={...o[n],...e?.[n]}}),t},xe=({size:e="md",width:r,withCloseButton:o=!1,fullScreen:t=!1,styles:n,...l})=>{let s=768;return e==="xs"?s=360:e==="sm"?s=544:e==="lg"?s=1e3:e==="xl"&&(s=1200),a.jsx(P.Modal,{size:r||s,fullScreen:t,styles:vt(n,t),withCloseButton:o,closeButtonProps:{icon:a.jsx(h.IconX,{size:18,color:h.ColorGray600})},...l})};function he(){return crypto.randomUUID()}function Tt(e,r,o){const t=[...e],[n]=t.splice(r,1);return t.splice(o,0,n),t}function It(e,r,o){return o!=null&&e.length>=o?0:r!=null&&e.length<r?r-e.length:1}function wt(e,r,o){return e.map(t=>{const n=t.position;return n==null?t:n===r?{...t,position:o}:r<o&&n>r&&n<=o?{...t,position:n-1}:r>o&&n>=o&&n<r?{...t,position:n+1}:t})}function Bt(e,r,o){const t=[...r].sort((i,c)=>i.name.localeCompare(c.name)),n=o!=null?o-e.length:1/0,s=t.slice(0,n).map(i=>({id:he(),file:i,url:URL.createObjectURL(i)}));return[...e,...s]}function Lt(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 He(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 Nt(e,r,o){return He(e,r,o)}function Et(e,r,o){const t={id:he(),file:r,url:URL.createObjectURL(r),position:o};return[...e,t]}function At(e){for(const r of e)r.url?.startsWith("blob:")&&URL.revokeObjectURL(r.url)}async function Ot(e,r){const o=e.url??"";if(!o)return null;const t=await new Promise((i,c)=>{const u=new Image;u.crossOrigin="anonymous",u.onload=()=>i(u),u.onerror=c,u.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,c)=>{n.toBlob(u=>{u?i(new File([u],`cropped_${s}`,{type:"image/jpeg"})):c(new Error("Failed to create blob"))},"image/jpeg")})}function Ft({item:e,isOpen:r,aspect:o=1,onClose:t,onSubmit:n}){const[l,s]=f.useState({x:0,y:0}),[i,c]=f.useState(1),[u,p]=f.useState(null),[_,m]=f.useState(!1),d=async()=>{if(!(!u||!e)){m(!0);try{const g=await Ot(e,u);g&&n(g)}finally{m(!1)}}};return a.jsx(xe,{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:h.ColorWhite},children:a.jsx(_t,{image:e?.url??"",crop:l,zoom:i,aspect:o,minZoom:.5,maxZoom:10,objectFit:"cover",onCropChange:s,onZoomChange:c,onCropComplete:(g,C)=>p(C),style:{containerStyle:{backgroundColor:h.ColorWhite}}})}),a.jsxs(P.Group,{justify:"flex-end",style:{padding:"0 16px"},children:[a.jsx(ue,{variant:"basic",onClick:t,children:"취소"}),a.jsx(ue,{variant:"primary",isLoading:_,onClick:d,children:"적용하기"})]})]})},e?.id)}const q={Container:"styles-module__Container___ZyeJM",TileContent:"styles-module__TileContent___Ofq9-",TileImage:"styles-module__TileImage___6aKmW",OverlayButton:"styles-module__OverlayButton___AYBJ0",OverlayButtonLeft:"styles-module__OverlayButtonLeft___t8SaP",OverlayButtonRight:"styles-module__OverlayButtonRight___IOvjw",PreviewControls:"styles-module__PreviewControls___iu0Yk",PreviewContent:"styles-module__PreviewContent___8f8d2",PreviewViewport:"styles-module__PreviewViewport___7-I5L",PreviewOriginal:"styles-module__PreviewOriginal___PgXTM",PlaceholderText:"styles-module__PlaceholderText___nhLhy",PlaceholderTextError:"styles-module__PlaceholderTextError___jYZ8j"},R={TileContainer:"styles-module__TileContainer___5-y01",DeleteButton:"styles-module__DeleteButton___0zsXm",Tile:"styles-module__Tile___3Cezo",TileDragOver:"styles-module__TileDragOver___e7GXF",LoadingOverlay:"styles-module__LoadingOverlay___4CyDQ",ActionBar:"styles-module__ActionBar___mJYpe",DragHandle:"styles-module__DragHandle___lzKhb",DragHandleOverlay:"styles-module__DragHandleOverlay___0nlt3",LinkButton:"styles-module__LinkButton___bISyz",DropzoneOuter:"styles-module__DropzoneOuter___BIO2N",Placeholder:"styles-module__Placeholder___q30Yw",PlaceholderError:"styles-module__PlaceholderError___fCOYe"};function ge({width:e,height:r,isError:o,isLoading:t,accept:n,multiple:l,onDrop:s,children:i}){return a.jsx("div",{className:R.DropzoneOuter,children:a.jsx(ke.Dropzone,{onDrop:s,accept:n,multiple:l,disabled:t,className:o?R.PlaceholderError:R.Placeholder,style:{width:e,height:r},children:i})})}const $t=e=>{const{isSorting:r,wasDragging:o}=e;return r||o?!1:ne.defaultAnimateLayoutChanges(e)};function We({id:e,children:r}){const{setNodeRef:o,transform:t,transition:n,isOver:l}=ne.useSortable({id:e,animateLayoutChanges:$t});return a.jsx("div",{ref:o,style:{transform:Ae.CSS.Transform.toString(t),transition:n,opacity:l?.7:1},children:r})}function Ye({id:e,totalCount:r,width:o,height:t,readOnly:n,isLoading:l,itemIsLoading:s,canDelete:i,hasLink:c,isDragHandleOverlay:u=!1,linkUrl:p,onLinkClick:_,onDelete:m,deleteAriaLabel:d="삭제",actionBarExtra:g,onTileClick:C,onFileDrop:y,children:D}){const[S,x]=f.useState(!1),I=w=>{!y||n||l||s||w.preventDefault()},H=w=>{!y||n||l||s||(w.preventDefault(),x(!0))},G=w=>{w.currentTarget.contains(w.relatedTarget)||x(!1)},V=w=>{if(w.preventDefault(),x(!1),!y||n||l||s)return;const Q=w.dataTransfer.files[0];Q&&y(Q)},Z=w=>{const{isSorting:Q,wasDragging:ee}=w;return Q||ee?!1:ne.defaultAnimateLayoutChanges(w)},{attributes:M,listeners:b,setActivatorNodeRef:O,setNodeRef:F,transform:W,transition:N,isDragging:T}=ne.useSortable({id:e,disabled:n,animateLayoutChanges:Z}),$=!n&&r>1&&a.jsx("button",{type:"button",className:u?R.DragHandleOverlay:R.DragHandle,ref:O,...M,...b,"aria-label":"드래그로 순서 변경",disabled:u&&(!!l||!!s),onClick:u?w=>w.stopPropagation():void 0,children:a.jsx(h.IconDragMenu,{size:20,color:h.ColorGray600})}),E=!u&&!!$||c&&!!p&&!!_||!!g,B=n||l||s||!C?"default":"pointer";return a.jsxs("div",{ref:F,className:R.TileContainer,style:{transform:Ae.CSS.Transform.toString(W),transition:N,opacity:T?.4:1},children:[!n&&i&&!l&&a.jsx("button",{type:"button",className:R.DeleteButton,onClick:m,"aria-label":d,children:a.jsx(h.IconXCircle,{size:24})}),a.jsxs("div",{className:`${R.Tile}${S?` ${R.TileDragOver}`:""}`,style:{width:o,height:t,cursor:B},onClick:()=>!n&&!l&&!s&&C?.(),onDragOver:I,onDragEnter:H,onDragLeave:G,onDrop:V,children:[D,u&&$,(l||s)&&a.jsx("div",{className:R.LoadingOverlay,children:a.jsx(P.Loader,{size:o/6,color:h.ColorAqua500})})]}),E&&a.jsxs("div",{className:R.ActionBar,children:[!u&&$,c&&p&&_&&a.jsx("button",{type:"button",className:R.LinkButton,onClick:_,children:"링크"}),g]})]})}function zt({items:e,onReorder:r}){return{sensors:oe.useSensors(oe.useSensor(oe.PointerSensor,{activationConstraint:{distance:8}}),oe.useSensor(oe.KeyboardSensor,{coordinateGetter:ne.sortableKeyboardCoordinates})),handleDragEnd:n=>{const{active:l,over:s}=n;if(!s||l.id===s.id)return;const i=e.findIndex(u=>u.id===l.id),c=e.findIndex(u=>u.id===s.id);i!==-1&&c!==-1&&r(i,c)}}}const be="__slot-";function Ve({value:e,length:r,minLength:o,maxLength:t,onChange:n}){const l=r??o,s=r??t,i=l!=null&&s!=null&&l===s,c=i?0:It(e,l,s),u=i?Array.from({length:s},(y,D)=>`${be}${D}`):[],p=i?u:e.map(y=>y.id),{sensors:_,handleDragEnd:m}=zt({items:e,onReorder:(y,D)=>{const S=Tt(e,y,D),x=e[y];n?.(S,{action:"reorder",itemId:x.id,index:D,previousIndex:y,nextIndex:D})}});return{isPositionMode:i,resolvedMinLength:l,resolvedMaxLength:s,placeholderCount:c,slotIds:u,sortableItems:p,sensors:_,handleDragEnd:i?y=>{const{active:D,over:S}=y;if(!S||D.id===S.id)return;const x=Number(String(D.id).replace(be,"")),I=Number(String(S.id).replace(be,"")),H=e.find(V=>V.position===x);if(!H)return;const G=wt(e,x,I);n?.(G,{action:"reorder",itemId:H.id,index:I,previousIndex:x,nextIndex:I})}:m,getMetaIndex:y=>{const D=e.find(S=>S.id===y);return i&&D?D.position??0:e.findIndex(S=>S.id===y)}}}function Ze(e){if(!e)return!1;try{const r=new URL(e).protocol;return r==="http:"||r==="https:"}catch{return!1}}function Ht(e){Ze(e)&&window.open(e,"_blank","noopener,noreferrer")}function Wt(e){return e?e.join(","):"image/*"}function Ue({item:e,sortableId:r,index:o,totalCount:t,width:n,height:l,accept:s,canDelete:i,hasLink:c,hasEdit:u,readOnly:p,isLoading:_,onLinkClick:m,onDelete:d,onReplace:g,onEdit:C,onPreview:y}){const D=f.useRef(null),S=m?!!e.url:Ze(e.url);return a.jsxs(Ye,{id:r??e.id,totalCount:t,width:n,height:l,readOnly:p,isLoading:_,itemIsLoading:e.isLoading,canDelete:i,isDragHandleOverlay:!0,hasLink:c&&S,linkUrl:e.url,onLinkClick:c&&S?()=>m?m(e):e.url&&Ht(e.url):void 0,onDelete:()=>d(e.id),deleteAriaLabel:"이미지 삭제",onTileClick:()=>D.current?.click(),onFileDrop:x=>{if(s){if(!s.includes(x.type))return}else if(!x.type.startsWith("image/"))return;g(e.id,x)},children:[a.jsx("input",{ref:D,type:"file",accept:Wt(s),style:{display:"none"},onChange:x=>{const I=x.target.files?.[0];I&&g(e.id,I),x.target.value=""}}),a.jsxs("div",{className:q.TileContent,children:[a.jsx("img",{src:e.url,alt:e.file?.name??`이미지 ${o+1}`,className:q.TileImage}),u&&!p&&a.jsx("button",{type:"button",className:`${q.OverlayButton} ${q.OverlayButtonLeft}`,"aria-label":"이미지 편집",title:"편집",disabled:_||e.isLoading,onClick:x=>{x.stopPropagation(),C(e)},children:a.jsx(h.IconEdit,{size:18})}),e.url&&a.jsx("button",{type:"button",className:`${q.OverlayButton} ${q.OverlayButtonRight}`,"aria-label":"이미지 확대보기",title:"크게 보기",disabled:_||e.isLoading,onClick:x=>{x.stopPropagation(),y(e)},children:a.jsx(h.IconOpenInFull,{size:18,color:h.ColorGray900})})]})]})}const Yt=({value:e=[],onChange:r,accept:o,length:t,width:n=160,height:l=200,placeholder:s="이미지를 넣어주세요",hasIcon:i=!0,hasLink:c=!1,onLinkClick:u,hasEdit:p=!1,canDelete:_=!0,minLength:m,maxLength:d,errorMsg:g,isLoading:C,readOnly:y,gap:D=8})=>{const{isPositionMode:S,resolvedMaxLength:x,placeholderCount:I,slotIds:H,sortableItems:G,sensors:V,handleDragEnd:Z,getMetaIndex:M}=Ve({value:e,length:t,minLength:m,maxLength:d,onChange:r}),b=!!g,[O,F]=f.useState(null),[W,N]=f.useState(null),T=W?e.find(A=>A.id===W.id&&A.url===W.url)??null:null;W&&!T&&N(null);const $=f.useRef(e);f.useEffect(()=>{$.current=e},[e]),f.useEffect(()=>()=>At($.current),[]);const E=A=>{if(y)return;const L=e.length,z=Bt(e,A,x);z.length!==L&&r?.(z,{action:"create",itemId:z[L].id,index:L})},B=(A,L)=>{if(y)return;const z=L[0];if(!z)return;const te=Et(e,z,A);r?.(te,{action:"create",itemId:te[te.length-1].id,index:A})},w=A=>{if(y)return;const L=M(A),z=Lt(e,A);r?.(z,{action:"delete",itemId:A,index:L})},Q=(A,L)=>{if(y)return;const z=M(A),te=He(e,A,L);r?.(te,{action:"replace",itemId:A,index:z})},ee=A=>{if(!O)return;const L=O.id,z=M(L),te=Nt(e,L,A);F(null),r?.(te,{action:"crop",itemId:L,index:z})},se=A=>{const L=typeof s=="function"?s(A):s;return typeof L!="string"?L:L.split(`
1
+ (function(k,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("@mantine/core"),require("@mantine/dates"),require("@pop-ui/foundation"),require("dayjs"),require("dayjs/locale/ko.js"),require("react"),require("dayjs/plugin/customParseFormat.js"),require("@dnd-kit/core"),require("@dnd-kit/sortable"),require("@mantine/dropzone"),require("react-easy-crop"),require("@dnd-kit/utilities"),require("@mantine/notifications")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@mantine/core","@mantine/dates","@pop-ui/foundation","dayjs","dayjs/locale/ko.js","react","dayjs/plugin/customParseFormat.js","@dnd-kit/core","@dnd-kit/sortable","@mantine/dropzone","react-easy-crop","@dnd-kit/utilities","@mantine/notifications"],a):(k=typeof globalThis<"u"?globalThis:k||self,a(k.Core={},k.jsxRuntime,k.MantineCore,k.dates,k.foundation,k.dayjs,null,k.React,k.customParseFormat,k.core$1,k.sortable,k.dropzone,k.Cropper,k.utilities,k.notifications))})(this,function(k,a,P,Ce,h,Y,Pr,f,it,oe,ne,ke,_t,Ae,pe){"use strict";const ct={sm:14,md:16,lg:18},U={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-"},De={inner:U.Button__Inner,label:U.Button__Label,section:U.Button__Section,loader:U.Button__Loader},dt={sm:U["Button--Small"],md:U["Button--Medium"],lg:U["Button--Large"]},ut={primary:U["Button--Primary"],primaryLine:U["Button--PrimaryLine"],basic:U["Button--Basic"],danger:U["Button--Danger"],setting:U["Button--Setting"],warning:U["Button--Warning"],ghost:U["Button--Ghost"]},pt=(...e)=>e.filter(Boolean).join(" ")||void 0,mt=e=>{const r=(o,t)=>{const n=Object.keys(o).reduce((l,s)=>{const i=s,c=[o[i],t[i]].filter(Boolean).join(" ");return c&&(l[i]=c),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(De,e(o,t,n)):typeof e=="object"&&e!==null&&!Array.isArray(e)?r(De,e):De};function ue({children:e,size:r="md",variant:o="primary",type:t="button",isLoading:n=!1,loading:l=!1,hideLabelOnLoading:s=!0,disabled:i=!1,className:c,classNames:u,loaderProps:p,..._}){const m=ct[r],d=n||l,g=i||d;return a.jsxs(P.Button,{type:t,unstyled:!0,className:pt(U.Button,i?U.Button__Disabled:"",dt[r],ut[o],c),classNames:mt(u),disabled:g,..._,children:[d&&a.jsx(P.Loader,{color:"currentColor",size:m,...p}),a.jsx("span",{className:U.Button__Label,children:d&&s?null:e})]})}const Se={"Checkbox--Small":"styles-module__Checkbox--Small___VZGlw","Checkbox--Medium":"styles-module__Checkbox--Medium___Vwpa3","Checkbox--Large":"styles-module__Checkbox--Large___ybTGE"},ft={sm:Se["Checkbox--Small"],md:Se["Checkbox--Medium"],lg:Se["Checkbox--Large"]},ht={sm:18,md:24,lg:32},gt=({size:e="md",...r})=>{const o=ft[e],t=ht[e];return a.jsx(P.Checkbox,{className:o,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"},yt=({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=>Y(s)).filter(s=>s.isValid()).map(s=>s.format("YYYY-MM-DD")),l=t.map(([s,i])=>[Y(s),Y(i)]).filter(([s,i])=>s.isValid()&&i.isValid());return s=>{const i=Y(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[c,u]of l)if((i.isSame(c,"day")||i.isAfter(c,"day"))&&(i.isSame(u,"day")||i.isBefore(u,"day")))return!0;return!1}},Ct=(e,r,o,t)=>{const n=Y(e),l=Y(r);for(const s of o)if(Array.isArray(s)){const i=Y(s[0]),c=Y(s[1]);if(!i.isValid()||!c.isValid())continue;if(!(l.isBefore(i,"day")||n.isAfter(c,"day")))return!0}for(const s of o)if(typeof s=="string"){const i=Y(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},le=(e="default")=>{switch(e){case"range":return[null,null];case"multiple":return[];default:return null}},Oe=(e="default",r)=>r==null?le(e):e==="range"?Array.isArray(r)?r:le("range"):e==="multiple"?Array.isArray(r)?r:le("multiple"):Array.isArray(r)?r[0]??null:r,Fe=({type:e,externalValue:r,internalValue:o})=>r!==void 0?Oe(e,r):o!==void 0?Oe(e,o):le(e),Pe=(e,r)=>{const o=(t,n)=>{const l=Object.keys(t).reduce((s,i)=>{const c=i,u=t[c],p=n[c],_=[u,p].filter(Boolean).join(" ");return _&&(s[c]=_),s},{});return Object.keys(n).forEach(s=>{const i=s,c=n[i];!(i in t)&&c&&(l[i]=c)}),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},kt=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 Y(o).format("YYYY-MM-DD")}return null}return e instanceof Date?Y(e).format("YYYY-MM-DD"):null},Dt={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},$e=({excludedDates:e=[],excludedDays:r=[],type:o="default",value:t,onChange:n,highlightToday:l=!1,...s})=>{const{classNames:i,date:c,defaultDate:u,onDateChange:p,getDayProps:_,...m}=s,[d,g]=f.useState(()=>t??le(o)),[C,y]=f.useState(()=>c||u||(kt(t??le(o))??new Date)),D=f.useMemo(()=>yt({excludedDays:r,excludedDates:e}),[r,e]),S=f.useCallback(b=>{c===void 0&&y(b),p?.(b)},[c,p]),x=b=>{if(o==="range"&&Array.isArray(b)&&b.length===2){const[O,F]=b;if(O&&F&&Ct(O,F,e,r)){const W=le("range");g(W),n?.(W);return}}g(b),n?.(b)},I=Fe({type:o,externalValue:t,internalValue:d}),H=f.useCallback(b=>{const O=Y(b).date(),W=Y(b).isSame(Y(),"day")&&l;return a.jsxs("span",{className:K.CalendarDatePicker__DayContent,children:[a.jsx("span",{className:K.CalendarDatePicker__DayLabel,children:O}),W&&a.jsx("span",{className:K.CalendarDatePicker__TodayIndicator,children:"오늘"})]})},[l]),G=Pe(Dt,i),V=c??C,Z=Y(V??new Date).format("YYYY-MM"),M=f.useCallback(b=>{const O=_?.(b)??{},F=Y(b).format("YYYY-MM")!==Z;return{...O,onClick:W=>{O.onClick?.(W),F&&S(b)}}},[Z,_,S]);return a.jsx(Ce.DatePicker,{locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 M월",maxLevel:"month",type:o,previousIcon:a.jsx(h.IconChevronLeft,{}),nextIcon:a.jsx(h.IconChevronRight,{}),...m,size:"lg",onChange:x,weekendDays:[0],highlightToday:l,classNames:G,defaultDate:c===void 0?u:void 0,date:V,onDateChange:S,getDayProps:M,value:I,excludeDate:D,renderDay:H})},v={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"};Y.extend(it);const St={wrapper:v.DatePicker__Wrapper,input:v.DatePicker__Input,section:v.DatePicker__Section,placeholder:v.DatePicker__Placeholder,datePickerRoot:v.DatePicker__Root,levelsGroup:v.DatePicker__LevelsGroup,calendarHeader:v.DatePicker__CalendarHeader,calendarHeaderLevel:v.DatePicker__CalendarHeaderLevel,calendarHeaderControl:v.DatePicker__CalendarHeaderControl,calendarHeaderControlIcon:v.DatePicker__CalendarHeaderControlIcon,month:v.DatePicker__Month,weekdaysRow:v.DatePicker__WeekdaysRow,weekday:v.DatePicker__Weekday,monthRow:v.DatePicker__MonthRow,monthCell:v.DatePicker__MonthCell,day:v.DatePicker__Day,timeWrapper:v.DatePicker__TimeWrapper,timeInput:v.DatePicker__TimeInput,submitButton:v.DatePicker__SubmitButton},Pt={dropdown:v.DatePicker__Dropdown,arrow:v.DatePicker__DropdownArrow},ze=(...e)=>e.filter(Boolean).join(" ")||void 0,fe=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},xt=({size:e="md",type:r="default",withTime:o,className:t,popoverProps:n,rightSection:l,rightSectionWidth:s,value:i,defaultValue:c,onChange:u,placeholder:p,disabled:_,minDate:m,maxDate:d,displayValueFormat:g="YYYY년 MM월 DD일",valueFormat:C,excludedDates:y,excludedDays:D,highlightToday:S})=>{const x=C??(o?"YYYY-MM-DD HH:mm":"YYYY-MM-DD"),[I,H]=f.useState(!1),[G,V]=f.useState(()=>h.parseDateValue(i??c,r,x)??le(r));let Z=v["DatePicker--Medium"],M=18,b=42;e==="sm"?(Z=v["DatePicker--Small"],M=14,b=34):e==="lg"&&(Z=v["DatePicker--Large"],M=24,b=50);const O=Pe(Pt,n?.classNames),F=l??a.jsx("span",{"aria-hidden":"true",className:v.DatePicker__Icon,children:a.jsx(h.IconCalendar,{size:M})});if(o){const E=ee=>{if(!ee)return null;const se=Y(ee,x,!0);return se.isValid()?se.toDate():null},B=i!==void 0,w=B?E(i):null,Q=E(c);return a.jsx(Ce.DateTimePicker,{className:ze(v.DatePickerBase,v.DatePickerRoot,Z,t),classNames:Pe(St,void 0),size:e,locale:"ko",firstDayOfWeek:0,monthLabelFormat:"YYYY년 MM월",valueFormat:"YYYY-MM-DD | a hh:mm",rightSection:F,rightSectionWidth:s??b,popoverProps:{offset:8,position:"bottom-start",withArrow:!0,arrowSize:10,arrowOffset:20,...n,classNames:O},value:B?w:void 0,defaultValue:B?void 0:Q,onChange:ee=>{u?.(ee?Y(ee).format(x):null)},placeholder:p,disabled:_,minDate:m,maxDate:d})}const W=i!=null?h.parseDateValue(i,r,x):void 0,N=Fe({type:r,externalValue:W,internalValue:G}),T=h.formatDateDisplay(N,r,g),$=E=>{let B;if(r==="range"&&Array.isArray(E)){const w=E;B=[fe(w[0]??null),fe(w[1]??null)]}else r==="multiple"&&Array.isArray(E)?B=E.map(w=>fe(w)).filter(w=>w!==null):B=fe(E);V(B),u?.(h.toValueString(B,r,x)),r==="default"&&B!=null&&H(!1),r==="range"&&Array.isArray(B)&&B[0]&&B[1]&&H(!1)};return a.jsx("div",{className:ze(v.DatePickerBase,v.DatePickerRoot,Z,t),children:a.jsxs(P.Popover,{opened:I,onClose:()=>H(!1),offset:8,position:"bottom-start",withArrow:!0,arrowSize:10,arrowOffset:20,...n,classNames:O,children:[a.jsx(P.Popover.Target,{children:a.jsx("div",{className:v.DatePicker__Wrapper,"data-expanded":I?!0:void 0,"data-disabled":_?!0:void 0,children:a.jsx(P.Input,{component:"button",type:"button",classNames:{input:v.DatePicker__Input,section:v.DatePicker__Section},onClick:()=>!_&&H(E=>!E),disabled:_,rightSection:F,rightSectionWidth:s??b,"data-expanded":I?!0:void 0,"data-disabled":_?!0:void 0,children:T?a.jsx("span",{children:T}):a.jsx("span",{className:v.DatePicker__Placeholder,children:p})})})}),a.jsx(P.Popover.Dropdown,{children:a.jsx($e,{type:r,value:N,onChange:$,excludedDates:y,excludedDays:D,highlightToday:S,minDate:m,maxDate:d})})]})})},X={"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"},bt=({label:e,labelPosition:r="top",size:o="md",required:t,tooltip:n,tooltipPosition:l="top",errorMsg:s,description:i,...c})=>{const[u,p]=f.useState(!1);let _=X["Dropdown__Label--Medium"],m=X["Dropdown--Medium"],d=X["Dropdown__Tooltip--Medium"],g=18;return o==="sm"?(_=X["Dropdown__Label--Small"],m=X["Dropdown--Small"],d=X["Dropdown__Tooltip--Small"],g=14):o==="lg"&&(_=X["Dropdown__Label--Large"],m=X["Dropdown--Large"],d=X["Dropdown__Tooltip--Large"],g=24),a.jsxs("div",{className:r==="top"?X["Dropdown--TopLabel"]:X["Dropdown--LeftLabel"],children:[a.jsxs("div",{children:[e&&a.jsx(P.Input.Label,{required:t,className:_,children:e}),n&&a.jsx(P.Tooltip,{label:n,position:l,children:a.jsx("div",{className:d,children:a.jsx(h.IconInfoCircle,{size:o==="sm"?14:o==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx(P.Select,{...c,size:o,error:s,className:m,rightSection:u?a.jsx(h.IconChevronUp,{size:g}):a.jsx(h.IconChevronDown,{size:g}),onDropdownOpen:()=>p(!0),onDropdownClose:()=>p(!1),styles:{option:{"&[data-selected]":{"&, &:hover":{backgroundColor:h.ColorGray100,color:h.ColorBlack}}}}}),i&&a.jsx(P.Input.Description,{className:X.Dropdown__Description,children:i}),s&&a.jsx(P.Input.Error,{className:X.Dropdown__ErrorMsg,children:s})]})]})},Mt=e=>({...e?{}:{content:{borderRadius:"12px"}},title:{fontSize:"16px",fontWeight:"700",lineHeight:"150%",color:h.ColorGray900},header:{padding:"16px"},body:{paddingInline:0}}),vt=(e,r)=>{if(typeof e=="function")return e;const o=Mt(r),t={...o,...e};return Object.keys(o).forEach(n=>{t[n]={...o[n],...e?.[n]}}),t},xe=({size:e="md",width:r,withCloseButton:o=!1,fullScreen:t=!1,styles:n,...l})=>{let s=768;return e==="xs"?s=360:e==="sm"?s=544:e==="lg"?s=1e3:e==="xl"&&(s=1200),a.jsx(P.Modal,{size:r||s,fullScreen:t,styles:vt(n,t),withCloseButton:o,closeButtonProps:{icon:a.jsx(h.IconX,{size:18,color:h.ColorGray600})},...l})};function he(){return crypto.randomUUID()}function Tt(e,r,o){const t=[...e],[n]=t.splice(r,1);return t.splice(o,0,n),t}function It(e,r,o){return o!=null&&e.length>=o?0:r!=null&&e.length<r?r-e.length:1}function wt(e,r,o){return e.map(t=>{const n=t.position;return n==null?t:n===r?{...t,position:o}:r<o&&n>r&&n<=o?{...t,position:n-1}:r>o&&n>=o&&n<r?{...t,position:n+1}:t})}function Bt(e,r,o){const t=[...r].sort((i,c)=>i.name.localeCompare(c.name)),n=o!=null?o-e.length:1/0,s=t.slice(0,n).map(i=>({id:he(),file:i,url:URL.createObjectURL(i)}));return[...e,...s]}function Lt(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 He(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 Nt(e,r,o){return He(e,r,o)}function Et(e,r,o){const t={id:he(),file:r,url:URL.createObjectURL(r),position:o};return[...e,t]}function At(e){for(const r of e)r.url?.startsWith("blob:")&&URL.revokeObjectURL(r.url)}async function Ot(e,r){const o=e.url??"";if(!o)return null;const t=await new Promise((i,c)=>{const u=new Image;u.crossOrigin="anonymous",u.onload=()=>i(u),u.onerror=c,u.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,c)=>{n.toBlob(u=>{u?i(new File([u],`cropped_${s}`,{type:"image/jpeg"})):c(new Error("Failed to create blob"))},"image/jpeg")})}function Ft({item:e,isOpen:r,aspect:o=1,onClose:t,onSubmit:n}){const[l,s]=f.useState({x:0,y:0}),[i,c]=f.useState(1),[u,p]=f.useState(null),[_,m]=f.useState(!1),d=async()=>{if(!(!u||!e)){m(!0);try{const g=await Ot(e,u);g&&n(g)}finally{m(!1)}}};return a.jsx(xe,{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:h.ColorWhite},children:a.jsx(_t,{image:e?.url??"",crop:l,zoom:i,aspect:o,minZoom:.5,maxZoom:10,objectFit:"cover",onCropChange:s,onZoomChange:c,onCropComplete:(g,C)=>p(C),style:{containerStyle:{backgroundColor:h.ColorWhite}}})}),a.jsxs(P.Group,{justify:"flex-end",style:{padding:"0 16px"},children:[a.jsx(ue,{variant:"basic",onClick:t,children:"취소"}),a.jsx(ue,{variant:"primary",isLoading:_,onClick:d,children:"적용하기"})]})]})},e?.id)}const q={Container:"styles-module__Container___ZyeJM",TileContent:"styles-module__TileContent___Ofq9-",TileImage:"styles-module__TileImage___6aKmW",OverlayButton:"styles-module__OverlayButton___AYBJ0",OverlayButtonLeft:"styles-module__OverlayButtonLeft___t8SaP",OverlayButtonRight:"styles-module__OverlayButtonRight___IOvjw",PreviewControls:"styles-module__PreviewControls___iu0Yk",PreviewContent:"styles-module__PreviewContent___8f8d2",PreviewViewport:"styles-module__PreviewViewport___7-I5L",PreviewOriginal:"styles-module__PreviewOriginal___PgXTM",PlaceholderText:"styles-module__PlaceholderText___nhLhy",PlaceholderTextError:"styles-module__PlaceholderTextError___jYZ8j"},R={TileContainer:"styles-module__TileContainer___5-y01",DeleteButton:"styles-module__DeleteButton___0zsXm",Tile:"styles-module__Tile___3Cezo",TileDragOver:"styles-module__TileDragOver___e7GXF",LoadingOverlay:"styles-module__LoadingOverlay___4CyDQ",ActionBar:"styles-module__ActionBar___mJYpe",DragHandle:"styles-module__DragHandle___lzKhb",DragHandleOverlay:"styles-module__DragHandleOverlay___0nlt3",LinkButton:"styles-module__LinkButton___bISyz",DropzoneOuter:"styles-module__DropzoneOuter___BIO2N",Placeholder:"styles-module__Placeholder___q30Yw",PlaceholderError:"styles-module__PlaceholderError___fCOYe"};function ge({width:e,height:r,isError:o,isLoading:t,accept:n,multiple:l,onDrop:s,children:i}){return a.jsx("div",{className:R.DropzoneOuter,children:a.jsx(ke.Dropzone,{onDrop:s,accept:n,multiple:l,disabled:t,className:o?R.PlaceholderError:R.Placeholder,style:{width:e,height:r},children:i})})}const $t=e=>{const{isSorting:r,wasDragging:o}=e;return r||o?!1:ne.defaultAnimateLayoutChanges(e)};function We({id:e,children:r}){const{setNodeRef:o,transform:t,transition:n,isOver:l}=ne.useSortable({id:e,animateLayoutChanges:$t});return a.jsx("div",{ref:o,style:{transform:Ae.CSS.Transform.toString(t),transition:n,opacity:l?.7:1},children:r})}function Ye({id:e,totalCount:r,width:o,height:t,readOnly:n,isLoading:l,itemIsLoading:s,canDelete:i,hasLink:c,isDragHandleOverlay:u=!1,linkUrl:p,onLinkClick:_,onDelete:m,deleteAriaLabel:d="삭제",actionBarExtra:g,onTileClick:C,onFileDrop:y,children:D}){const[S,x]=f.useState(!1),I=w=>{!y||n||l||s||w.preventDefault()},H=w=>{!y||n||l||s||(w.preventDefault(),x(!0))},G=w=>{w.currentTarget.contains(w.relatedTarget)||x(!1)},V=w=>{if(w.preventDefault(),x(!1),!y||n||l||s)return;const Q=w.dataTransfer.files[0];Q&&y(Q)},Z=w=>{const{isSorting:Q,wasDragging:ee}=w;return Q||ee?!1:ne.defaultAnimateLayoutChanges(w)},{attributes:M,listeners:b,setActivatorNodeRef:O,setNodeRef:F,transform:W,transition:N,isDragging:T}=ne.useSortable({id:e,disabled:n,animateLayoutChanges:Z}),$=!n&&r>1&&a.jsx("button",{type:"button",className:u?R.DragHandleOverlay:R.DragHandle,ref:O,...M,...b,"aria-label":"드래그로 순서 변경",disabled:u&&(!!l||!!s),onClick:u?w=>w.stopPropagation():void 0,children:a.jsx(h.IconDragMenu,{size:20,color:h.ColorGray600})}),E=!u&&!!$||c&&!!p&&!!_||!!g,B=n||l||s||!C?"default":"pointer";return a.jsxs("div",{ref:F,className:R.TileContainer,style:{transform:Ae.CSS.Transform.toString(W),transition:N,opacity:T?.4:1},children:[!n&&i&&!l&&a.jsx("button",{type:"button",className:R.DeleteButton,onClick:m,"aria-label":d,children:a.jsx(h.IconXCircle,{size:24})}),a.jsxs("div",{className:`${R.Tile}${S?` ${R.TileDragOver}`:""}`,style:{width:o,height:t,cursor:B},onClick:()=>!n&&!l&&!s&&C?.(),onDragOver:I,onDragEnter:H,onDragLeave:G,onDrop:V,children:[D,u&&$,(l||s)&&a.jsx("div",{className:R.LoadingOverlay,children:a.jsx(P.Loader,{size:o/6,color:h.ColorAqua500})})]}),E&&a.jsxs("div",{className:R.ActionBar,children:[!u&&$,c&&p&&_&&a.jsx("button",{type:"button",className:R.LinkButton,onClick:_,children:"링크"}),g]})]})}function zt({items:e,onReorder:r}){return{sensors:oe.useSensors(oe.useSensor(oe.PointerSensor,{activationConstraint:{distance:8}}),oe.useSensor(oe.KeyboardSensor,{coordinateGetter:ne.sortableKeyboardCoordinates})),handleDragEnd:n=>{const{active:l,over:s}=n;if(!s||l.id===s.id)return;const i=e.findIndex(u=>u.id===l.id),c=e.findIndex(u=>u.id===s.id);i!==-1&&c!==-1&&r(i,c)}}}const be="__slot-";function Ve({value:e,length:r,minLength:o,maxLength:t,onChange:n}){const l=r??o,s=r??t,i=l!=null&&s!=null&&l===s,c=i?0:It(e,l,s),u=i?Array.from({length:s},(y,D)=>`${be}${D}`):[],p=i?u:e.map(y=>y.id),{sensors:_,handleDragEnd:m}=zt({items:e,onReorder:(y,D)=>{const S=Tt(e,y,D),x=e[y];n?.(S,{action:"reorder",itemId:x.id,index:D,previousIndex:y,nextIndex:D})}});return{isPositionMode:i,resolvedMinLength:l,resolvedMaxLength:s,placeholderCount:c,slotIds:u,sortableItems:p,sensors:_,handleDragEnd:i?y=>{const{active:D,over:S}=y;if(!S||D.id===S.id)return;const x=Number(String(D.id).replace(be,"")),I=Number(String(S.id).replace(be,"")),H=e.find(V=>V.position===x);if(!H)return;const G=wt(e,x,I);n?.(G,{action:"reorder",itemId:H.id,index:I,previousIndex:x,nextIndex:I})}:m,getMetaIndex:y=>{const D=e.find(S=>S.id===y);return i&&D?D.position??0:e.findIndex(S=>S.id===y)}}}function Ze(e){if(!e)return!1;try{const r=new URL(e).protocol;return r==="http:"||r==="https:"}catch{return!1}}function Ht(e){Ze(e)&&window.open(e,"_blank","noopener,noreferrer")}function Wt(e){return e?e.join(","):"image/*"}function Ue({item:e,sortableId:r,index:o,totalCount:t,width:n,height:l,accept:s,canDelete:i,hasLink:c,hasEdit:u,readOnly:p,isLoading:_,onLinkClick:m,onDelete:d,onReplace:g,onEdit:C,onPreview:y}){const D=f.useRef(null),S=m?!!e.url:Ze(e.url);return a.jsxs(Ye,{id:r??e.id,totalCount:t,width:n,height:l,readOnly:p,isLoading:_,itemIsLoading:e.isLoading,canDelete:e.canDelete??i,isDragHandleOverlay:!0,hasLink:c&&S,linkUrl:e.url,onLinkClick:c&&S?()=>m?m(e):e.url&&Ht(e.url):void 0,onDelete:()=>d(e.id),deleteAriaLabel:"이미지 삭제",onTileClick:()=>D.current?.click(),onFileDrop:x=>{if(s){if(!s.includes(x.type))return}else if(!x.type.startsWith("image/"))return;g(e.id,x)},children:[a.jsx("input",{ref:D,type:"file",accept:Wt(s),style:{display:"none"},onChange:x=>{const I=x.target.files?.[0];I&&g(e.id,I),x.target.value=""}}),a.jsxs("div",{className:q.TileContent,children:[a.jsx("img",{src:e.url,alt:e.file?.name??`이미지 ${o+1}`,className:q.TileImage}),u&&!p&&a.jsx("button",{type:"button",className:`${q.OverlayButton} ${q.OverlayButtonLeft}`,"aria-label":"이미지 편집",title:"편집",disabled:_||e.isLoading,onClick:x=>{x.stopPropagation(),C(e)},children:a.jsx(h.IconEdit,{size:18})}),e.url&&a.jsx("button",{type:"button",className:`${q.OverlayButton} ${q.OverlayButtonRight}`,"aria-label":"이미지 확대보기",title:"크게 보기",disabled:_||e.isLoading,onClick:x=>{x.stopPropagation(),y(e)},children:a.jsx(h.IconOpenInFull,{size:18,color:h.ColorGray900})})]})]})}const Yt=({value:e=[],onChange:r,accept:o,length:t,width:n=160,height:l=200,placeholder:s="이미지를 넣어주세요",hasIcon:i=!0,hasLink:c=!1,onLinkClick:u,hasEdit:p=!1,canDelete:_=!0,minLength:m,maxLength:d,errorMsg:g,isLoading:C,readOnly:y,gap:D=8})=>{const{isPositionMode:S,resolvedMaxLength:x,placeholderCount:I,slotIds:H,sortableItems:G,sensors:V,handleDragEnd:Z,getMetaIndex:M}=Ve({value:e,length:t,minLength:m,maxLength:d,onChange:r}),b=!!g,[O,F]=f.useState(null),[W,N]=f.useState(null),T=W?e.find(A=>A.id===W.id&&A.url===W.url)??null:null;W&&!T&&N(null);const $=f.useRef(e);f.useEffect(()=>{$.current=e},[e]),f.useEffect(()=>()=>At($.current),[]);const E=A=>{if(y)return;const L=e.length,z=Bt(e,A,x);z.length!==L&&r?.(z,{action:"create",itemId:z[L].id,index:L})},B=(A,L)=>{if(y)return;const z=L[0];if(!z)return;const te=Et(e,z,A);r?.(te,{action:"create",itemId:te[te.length-1].id,index:A})},w=A=>{if(y)return;const L=M(A),z=Lt(e,A);r?.(z,{action:"delete",itemId:A,index:L})},Q=(A,L)=>{if(y)return;const z=M(A),te=He(e,A,L);r?.(te,{action:"replace",itemId:A,index:z})},ee=A=>{if(!O)return;const L=O.id,z=M(L),te=Nt(e,L,A);F(null),r?.(te,{action:"crop",itemId:L,index:z})},se=A=>{const L=typeof s=="function"?s(A):s;return typeof L!="string"?L:L.split(`
2
2
  `).map((z,te)=>a.jsx("span",{children:z},te))};return a.jsxs("div",{children:[a.jsx(oe.DndContext,{sensors:V,collisionDetection:oe.closestCenter,onDragEnd:Z,children:a.jsx(ne.SortableContext,{items:G,strategy:ne.rectSortingStrategy,children:a.jsx("div",{className:q.Container,style:{gap:D},children:S?Array.from({length:x},(A,L)=>{const z=H[L],te=e.find(de=>de.position===L);return te?a.jsx(Ue,{item:te,sortableId:z,index:L,totalCount:x,width:n,height:l,accept:o,canDelete:_,hasLink:c,hasEdit:p,readOnly:y??!1,isLoading:C,onLinkClick:u,onDelete:w,onReplace:Q,onEdit:F,onPreview:de=>{de.url&&N({id:de.id,url:de.url})}},z):!y&&a.jsx(We,{id:z,children:a.jsxs(ge,{onDrop:de=>B(L,de),accept:o??ke.IMAGE_MIME_TYPE,multiple:!1,isLoading:C,isError:b,width:n,height:l,children:[i&&a.jsx(h.IconPhoto,{size:36,color:b?h.ColorRed700:h.ColorAqua700}),s&&a.jsx("div",{className:`${q.PlaceholderText}${b?` ${q.PlaceholderTextError}`:""}`,children:se(L)})]})},z)}):a.jsxs(a.Fragment,{children:[e.map((A,L)=>a.jsx(Ue,{item:A,index:L,totalCount:e.length,width:n,height:l,accept:o,canDelete:_,hasLink:c,hasEdit:p,readOnly:y??!1,isLoading:C,onLinkClick:u,onDelete:w,onReplace:Q,onEdit:F,onPreview:z=>{z.url&&N({id:z.id,url:z.url})}},A.id)),!y&&Array.from({length:I},(A,L)=>a.jsxs(ge,{onDrop:E,accept:o??ke.IMAGE_MIME_TYPE,multiple:x!==1,isLoading:C,isError:b,width:n,height:l,children:[i&&a.jsx(h.IconPhoto,{size:36,color:b?h.ColorRed700:h.ColorAqua700}),s&&a.jsx("div",{className:`${q.PlaceholderText}${b?` ${q.PlaceholderTextError}`:""}`,children:se(L)})]},`placeholder-${L}`))]})})})}),b&&a.jsx(P.Input.Error,{mt:8,children:g}),p&&a.jsx(Ft,{item:O,isOpen:!!O,onClose:()=>F(null),onSubmit:ee}),a.jsx(xe,{opened:!!T,onClose:()=>N(null),title:T?.file?.name??"이미지 미리보기",size:"xl",centered:!0,xOffset:16,yOffset:16,withCloseButton:!0,closeButtonProps:{"aria-label":"이미지 미리보기 닫기",icon:a.jsx(h.IconX,{size:18,color:h.ColorGray600})},styles:{content:{flex:"0 1 auto",width:"fit-content",maxWidth:"calc(100vw - 32px)",maxHeight:"calc(100dvh - 32px)"},body:{padding:"16px"}},children:T&&a.jsx(Vt,{item:T},`${T.id}:${T.url}`)})]})};function Vt({item:e}){const[r,o]=f.useState(!1);return a.jsxs("div",{className:q.PreviewContent,children:[a.jsxs("div",{className:q.PreviewControls,role:"group","aria-label":"이미지 크기 보기",children:[a.jsx(ue,{variant:r?"basic":"primary",size:"sm","aria-label":"화면에 맞춤","aria-pressed":!r,onClick:()=>o(!1),children:"화면에 맞춤"}),a.jsx(ue,{variant:r?"primary":"basic",size:"sm","aria-label":"원본 크기 (100%)","aria-pressed":r,onClick:()=>o(!0),children:"원본 크기 (100%)"})]}),a.jsx("div",{"data-size-mode":r?"original":"fit",className:`${q.PreviewViewport}${r?` ${q.PreviewOriginal}`:""}`,children:a.jsx("img",{src:e.url,alt:e.file?.name??"이미지 미리보기"})})]})}function je(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 Me(e){return new Promise(r=>{const o=new FileReader;o.onload=t=>{try{const n=JSON.parse(t.target?.result);r(je(n)?n:null)}catch{r(null)}},o.onerror=()=>r(null),o.readAsText(e)})}function Zt(e,r,o){const t=[...r].sort((i,c)=>i.name.localeCompare(c.name)),n=o!=null?o-e.length:1/0,s=t.slice(0,n).map(i=>({id:he(),file:i}));return[...e,...s]}function Ut(e,r){return e.filter(o=>o.id!==r)}function jt(e,r,o){const t={id:he(),file:r,position:o};return[...e,t]}const ce={Container:"styles-module__Container___cJqG-",Stage:"styles-module__Stage___zAHL-",Empty:"styles-module__Empty___gexrS",PlaceholderText:"styles-module__PlaceholderText___x2ya0",PlaceholderTextError:"styles-module__PlaceholderTextError___i8VXv"},ye={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"},Ge=e=>typeof e=="string"?{message:e}:e,qe=(e,r)=>{const{autoClose:o,icon:t,message:n}=Ge(e);return{id:r,message:a.jsx("div",{className:ye.Toast__Message,children:n}),icon:t,autoClose:o,classNames:{root:ye.Toast,body:ye.Toast__Body,icon:ye.Toast__Icon},withCloseButton:!1,withBorder:!1}},ie=e=>{const r=Ge(e);pe.notifications.show(qe(e,r.id))};ie.update=(e,r)=>{pe.notifications.update(qe(r,e))},ie.hide=e=>{pe.notifications.hide(e)},ie.clean=()=>{pe.notifications.clean()};const Gt=f.lazy(()=>import("lottie-react").then(e=>{const r=e.default;return{default:typeof r=="function"?r:r.default}})),Je={"application/json":[".json"]};function Ke({item:e,sortableId:r,totalCount:o,width:t,height:n,readOnly:l,isLoading:s,canDelete:i,hasLink:c,backgroundImage:u,onLinkClick:p,onDelete:_}){const d=!e.animationData&&!!(e.file||e.url)?`${e.id}|${e.file?`${e.file.name}:${e.file.size}`:e.url??""}`:"",[g,C]=f.useState({key:"",data:null}),y=e.animationData??(g.key===d?g.data:null),D=!!d&&g.key!==d;return f.useEffect(()=>{if(!d)return;let S=!1;return(e.file?Me(e.file):fetch(e.url).then(I=>I.json()).then(I=>je(I)?I:null)).then(I=>{S||C({key:d,data:I})}).catch(()=>{S||C({key:d,data:null})}),()=>{S=!0}},[d,e.file,e.url]),a.jsx(Ye,{id:r??e.id,totalCount:o,width:t,height:n,readOnly:l,isLoading:s,itemIsLoading:e.isLoading||D,canDelete:i,hasLink:c,linkUrl:e.url,onLinkClick:p?()=>p(e):void 0,onDelete:()=>_(e.id),deleteAriaLabel:"Lottie 삭제",children:a.jsx("div",{className:ce.Stage,style:u?{backgroundImage:`url(${JSON.stringify(u)})`}:void 0,children:y?a.jsx(f.Suspense,{fallback:a.jsx("div",{style:{width:t,height:n,display:"block"}}),children:a.jsx(Gt,{animationData:y,loop:!0,autoplay:!0,style:{width:t,height:n,display:"block"}})}):a.jsx("div",{className:u?void 0:ce.Empty,style:{width:t,height:n}})})})}const qt=({value:e=[],onChange:r,width:o=160,height:t=200,placeholder:n="Lottie JSON 파일을 넣어주세요",hasIcon:l=!0,hasLink:s=!1,onLinkClick:i,length:c,minLength:u,maxLength:p,errorMsg:_,isLoading:m,readOnly:d,gap:g=8,canDelete:C=!0,backgroundImage:y})=>{const{isPositionMode:D,resolvedMaxLength:S,placeholderCount:x,slotIds:I,sortableItems:H,sensors:G,handleDragEnd:V,getMetaIndex:Z}=Ve({value:e,length:c,minLength:u,maxLength:p,onChange:r}),M=!!_,b=async N=>{if(d)return;const T=[...N].sort((ee,se)=>ee.name.localeCompare(se.name)),$=await Promise.all(T.map(Me));let E=0;const B=T.filter((ee,se)=>$[se]!==null?!0:(E++,!1));if(E>0&&ie({id:"invalid-lottie-files",message:E===1?"유효하지 않은 Lottie JSON 파일입니다":`${E}개의 파일이 유효하지 않은 Lottie JSON입니다`}),B.length===0)return;const w=e.length,Q=Zt(e,B,S);Q.length!==w&&r?.(Q,{action:"create",itemId:Q[w].id,index:w})},O=async(N,T)=>{if(d)return;const $=T[0];if(!$)return;if(!await Me($)){ie({id:"invalid-lottie-files",message:"유효하지 않은 Lottie JSON 파일입니다"});return}const B=jt(e,$,N);r?.(B,{action:"create",itemId:B[B.length-1].id,index:N})},F=N=>{if(d)return;const T=Z(N),$=Ut(e,N);r?.($,{action:"delete",itemId:N,index:T})},W=N=>{const T=typeof n=="function"?n(N):n;return typeof T!="string"?T:T.split(`
3
3
  `).map(($,E)=>a.jsx("span",{children:$},E))};return a.jsxs("div",{children:[a.jsx(oe.DndContext,{sensors:G,collisionDetection:oe.closestCenter,onDragEnd:V,children:a.jsx(ne.SortableContext,{items:H,strategy:ne.rectSortingStrategy,children:a.jsx("div",{className:ce.Container,style:{gap:g},children:D?Array.from({length:S},(N,T)=>{const $=I[T],E=e.find(B=>B.position===T);return E?a.jsx(Ke,{item:E,sortableId:$,totalCount:S,width:o,height:t,readOnly:d??!1,isLoading:m,canDelete:C,hasLink:s,backgroundImage:y,onLinkClick:i,onDelete:F},$):!d&&a.jsx(We,{id:$,children:a.jsxs(ge,{onDrop:B=>O(T,B),accept:Je,multiple:!1,isLoading:m,isError:M,width:o,height:t,children:[l&&a.jsx(h.IconPhoto,{size:36,color:M?h.ColorRed700:h.ColorAqua700}),n&&a.jsx("div",{className:`${ce.PlaceholderText}${M?` ${ce.PlaceholderTextError}`:""}`,children:W(T)})]})},$)}):a.jsxs(a.Fragment,{children:[e.map(N=>a.jsx(Ke,{item:N,totalCount:e.length,width:o,height:t,readOnly:d??!1,isLoading:m,canDelete:C,hasLink:s,backgroundImage:y,onLinkClick:i,onDelete:F},N.id)),!d&&Array.from({length:x},(N,T)=>a.jsxs(ge,{onDrop:b,accept:Je,multiple:S!==1,isLoading:m,isError:M,width:o,height:t,children:[l&&a.jsx(h.IconPhoto,{size:36,color:M?h.ColorRed700:h.ColorAqua700}),n&&a.jsx("div",{className:`${ce.PlaceholderText}${M?` ${ce.PlaceholderTextError}`:""}`,children:W(T)})]},`placeholder-${T}`))]})})})}),M&&a.jsx(P.Input.Error,{mt:8,children:_})]})},me={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"},Jt=({currentPageIdx:e,rowsPerPage:r,totalLength:o,paginationSize:t,onPageChange:n,...l})=>{const[s,i]=f.useState(e),c=r||50,u=o||1,p=t||5;f.useEffect(()=>{i(e)},[e]);const _=()=>{n&&n(s-(s%p+1)),i(d=>d-(d%p+1))},m=()=>{n&&n(s+p-s%p),i(d=>d+p-d%p)};return a.jsxs("div",{...l,className:me.Pagination,children:[s>=p?a.jsx("button",{className:me.Pagination__Arrow,onClick:_,children:a.jsx(h.IconChevronLeft,{size:20})}):null,new Array(p).fill(0).map((d,g)=>{const C=Math.floor(s/p)*p+g+1;if(!(C>Math.ceil(u/c)))return a.jsx("button",{className:s===C-1?me["Pagination__PageIndex--Active"]:me.Pagination__PageIndex,onClick:()=>{i(C-1),n&&n(C-1)},children:C},`pagination_${g}`)}),Math.floor(s/p)*p+p<Math.ceil(u/c)?a.jsx("button",{className:me.Pagination__Arrow,onClick:m,children:a.jsx(h.IconChevronRight,{size:20})}):null]})},ve={"Radio--Small":"styles-module__Radio--Small___izWI2","Radio--Medium":"styles-module__Radio--Medium___dwZfV","Radio--Large":"styles-module__Radio--Large___1gLra"},Kt={sm:ve["Radio--Small"],md:ve["Radio--Medium"],lg:ve["Radio--Large"]},Xt={sm:18,md:24,lg:32},Qt=({size:e="md",...r})=>{const o=Kt[e],t=Xt[e];return a.jsx(P.Radio,{className:o,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"},Rt=({label:e,labelPosition:r="top",size:o="md",required:t,tooltip:n,tooltipPosition:l="top",errorMsg:s,description:i,onChange:c,onClear:u,...p})=>{const[_,m]=f.useState(0);let d=J["SearchBar__Label--Medium"],g=J["SearchBar--Medium"],C=J["SearchBar__Tooltip--Medium"];o==="sm"?(d=J["SearchBar__Label--Small"],g=J["SearchBar--Small"],C=J["SearchBar__Tooltip--Small"]):o==="lg"&&(d=J["SearchBar__Label--Large"],g=J["SearchBar--Large"],C=J["SearchBar__Tooltip--Large"]);const y=f.useCallback(D=>{c&&(m(D?.length),c(D))},[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:d,children:e}),n&&a.jsx(P.Tooltip,{label:n,position:l,children:a.jsx("div",{className:C,children:a.jsx(h.IconInfoCircle,{size:o==="sm"?14:o==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsx("div",{className:J.SearchBar__Wrapper,children:a.jsx(P.Autocomplete,{...p,size:o,error:s,className:g,onChange:y,leftSection:a.jsx(h.IconSearch,{size:o==="sm"?16:o==="lg"?24:20}),rightSection:u&&_>0?a.jsx("div",{className:J.SearchBar__ClearButton,onClick:u,children:a.jsx(h.IconX,{size:o==="sm"?16:o==="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})]})]})},Te={"SegmentButton--Small":"styles-module__SegmentButton--Small___o0Y3t","SegmentButton--Medium":"styles-module__SegmentButton--Medium___EgCJm","SegmentButton--Large":"styles-module__SegmentButton--Large___Ym86C"},er=({size:e="md",radius:r=h.BorderRadius150,...o})=>{let t=Te["SegmentButton--Medium"];return e==="sm"?t=Te["SegmentButton--Small"]:e==="lg"&&(t=Te["SegmentButton--Large"]),a.jsx(P.SegmentedControl,{className:t,size:e,radius:r,withItemsBorders:!1,...o})},_e={StepNavigation:"styles-module__StepNavigation___ZjuVV",StepNavigation__Steps:"styles-module__StepNavigation__Steps___q7Ha9",StepNavigation__Separator:"styles-module__StepNavigation__Separator___Ncya0",StepNavigation__Step:"styles-module__StepNavigation__Step___kPz8V",StepNavigation__StepLabel:"styles-module__StepNavigation__StepLabel___bR06B",StepNavigation__StepBody:"styles-module__StepNavigation__StepBody___AXzjN",StepNavigation__StepIcon:"styles-module__StepNavigation__StepIcon___TRcPN",StepNavigation__CompletedIcon:"styles-module__StepNavigation__CompletedIcon___4-Mgd"},tr=({steps:e,value:r,onChange:o,ariaLabel:t,className:n})=>{const l=e.findIndex(s=>s.value===r);return a.jsx("nav",{"aria-label":t,className:[_e.StepNavigation,n].filter(Boolean).join(" "),children:a.jsx(P.Stepper,{active:l,onStepClick:s=>{const i=e[s];i&&!i.disabled&&i.value!==r&&o(i.value)},allowNextStepsSelect:!0,wrap:!1,iconSize:28,completedIcon:({step:s})=>s+1,classNames:{steps:_e.StepNavigation__Steps,separator:_e.StepNavigation__Separator,step:_e.StepNavigation__Step,stepBody:_e.StepNavigation__StepBody,stepLabel:_e.StepNavigation__StepLabel,stepIcon:_e.StepNavigation__StepIcon,stepCompletedIcon:_e.StepNavigation__CompletedIcon},children:e.map((s,i)=>a.jsx(P.Stepper.Step,{disabled:s.disabled,"aria-current":i===l?"step":void 0,label:a.jsxs(a.Fragment,{children:[s.label,i<e.length-1&&a.jsx(h.IconChevronRight,{size:24,color:i===l?h.ColorAqua800:h.ColorGray300,"aria-hidden":"true"})]})},s.value))})})},Xe={Tab__TitleList:"styles-module__Tab__TitleList___urHWH",Tab__BorderBottom:"styles-module__Tab__BorderBottom___eMTpl"},rr=({tabList:e=[],containerPaddingTop:r,...o})=>a.jsxs(P.Tabs,{...o,children:[a.jsx(P.Tabs.List,{className:Xe.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:Xe.Tab__BorderBottom})]},`tab_${n}`))}),e?.map((t,n)=>a.jsx(P.Tabs.Panel,{value:t.value,pt:r,children:t.body},`tab_panel_${n}`))]}),j={"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"},or=e=>typeof e=="string"?e.length:typeof e=="number"?String(e).length:Array.isArray(e)?e.join("").length:0,nr=e=>{const{label:r,labelPosition:o="top",size:t="md",required:n,tooltip:l,tooltipPosition:s="top",errorMsg:i,description:c,textarea:u=!1,maxTextCount:p,onChange:_,onClear:m,...d}=e,g="minRows"in e?e.minRows:void 0,{value:C,defaultValue:y,...D}=d,S=C!==void 0,[x,I]=f.useState(String(C??y??"")),H=S?C:x,G=or(H);let V=j["TextField__Label--Medium"],Z=j["TextField--Medium"],M=j["TextField__Tooltip--Medium"];t==="sm"?(V=j["TextField__Label--Small"],Z=j["TextField--Small"],M=j["TextField__Tooltip--Small"]):t==="lg"&&(V=j["TextField__Label--Large"],Z=j["TextField--Large"],M=j["TextField__Tooltip--Large"]);const b=f.useCallback(F=>{const W=F.currentTarget.value;p&&W.length>p||(S||I(W),_&&_(F))},[S,p,_]),O=f.useCallback(()=>{S||I(""),m?.()},[S,m]);return a.jsxs("div",{className:o==="top"?j["TextField--TopLabel"]:j["TextField--LeftLabel"],children:[a.jsxs("div",{children:[r&&a.jsx(P.Input.Label,{required:n,className:V,children:r}),l&&a.jsx(P.Tooltip,{label:l,position:s,children:a.jsx("div",{className:M,children:a.jsx(h.IconInfoCircle,{size:t==="sm"?14:t==="lg"?20:16})})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:j.TextField__Wrapper,children:[u?a.jsx(P.Textarea,{className:j["TextField--Textarea"],size:t,minRows:g,error:i,onChange:b,value:H,...D}):a.jsx(P.Input,{className:Z,error:i,onChange:b,value:H,rightSection:m&&G>0?a.jsx("button",{type:"button",className:j.TextField__ClearButton,"aria-label":"입력 내용 지우기",onClick:O,children:a.jsx(h.IconX,{size:t==="sm"?16:t==="lg"?24:20})}):void 0,...D}),p&&p>0&&a.jsx("span",{className:j.TextField__TextCounter,children:`${G}/${p}`})]}),c&&a.jsx(P.Input.Description,{className:j.TextField__Description,children:c}),i&&a.jsx(P.Input.Error,{className:j.TextField__ErrorMsg,children:i})]})]})},Ie={"TimePicker--Small":"styles-module__TimePicker--Small___nHQa1","TimePicker--Medium":"styles-module__TimePicker--Medium___E9-rF","TimePicker--Large":"styles-module__TimePicker--Large___I0M7V"},ar=({size:e="md",...r})=>{const o=f.useRef(null);let t=Ie["TimePicker--Medium"],n=18;return e==="sm"?(t=Ie["TimePicker--Small"],n=14):e==="lg"&&(t=Ie["TimePicker--Large"],n=24),a.jsx(Ce.TimeInput,{ref:o,className:t,size:e,...r,rightSection:a.jsx(P.ActionIcon,{bg:"transparent",onClick:()=>{o.current?.showPicker?.()},children:a.jsx(h.IconClock,{size:n})})})},we={"Toggle--Small":"styles-module__Toggle--Small___sOjUd","Toggle--Medium":"styles-module__Toggle--Medium___yIb8v","Toggle--Large":"styles-module__Toggle--Large___ZOJj1"},sr=({size:e="md",labelPosition:r="right",disabled:o,checked:t,defaultChecked:n,onChange:l,...s})=>{const i=t!==void 0,[c,u]=f.useState(n??!1),p=i?t:c;let _=we["Toggle--Medium"],m=50;e==="sm"?(_=we["Toggle--Small"],m=38):e==="lg"&&(_=we["Toggle--Large"],m=67);const d=f.useCallback(g=>{l&&l(g),i||u(g?.target?.checked)},[i,l]);return a.jsx(P.Switch,{className:_,size:e,labelPosition:r,disabled:o,checked:t,defaultChecked:n,onChange:d,styles:()=>({track:{backgroundColor:!o&&p?`${h.ColorAqua500} !important`:void 0,borderColor:!o&&p?`${h.ColorAqua500} !important`:void 0,width:m}}),...s})},Be={Tooltip__Body:"styles-module__Tooltip__Body___i1OTG",Tooltip__Title:"styles-module__Tooltip__Title___E0LoV",Tooltip__Content:"styles-module__Tooltip__Content___lU5gr"},lr=({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:Be.Tooltip__Body,children:[e&&a.jsx("span",{className:Be.Tooltip__Title,children:e}),a.jsx("span",{className:Be.Tooltip__Content,children:r})]})}),ir=e=>{const{name:r,icon:o}=e;return`
4
4
  <div class="pin-marker">
@@ -14,7 +14,7 @@ import s from "./styles.module.scss.js";
14
14
  import { PlaceholderDropzone as q } from "../shared/MultiItemInput/Dropzone.js";
15
15
  import { SortableEmptySlot as Ce } from "../shared/MultiItemInput/SortableEmptySlot.js";
16
16
  import { TileShell as $e } from "../shared/MultiItemInput/TileShell.js";
17
- import { usePositionGrid as we } from "../shared/MultiItemInput/usePositionGrid.js";
17
+ import { usePositionGrid as De } from "../shared/MultiItemInput/usePositionGrid.js";
18
18
  function J(e) {
19
19
  if (!e) return !1;
20
20
  try {
@@ -24,10 +24,10 @@ function J(e) {
24
24
  return !1;
25
25
  }
26
26
  }
27
- function Ee(e) {
27
+ function we(e) {
28
28
  J(e) && window.open(e, "_blank", "noopener,noreferrer");
29
29
  }
30
- function Se(e) {
30
+ function Ee(e) {
31
31
  return e ? e.join(",") : "image/*";
32
32
  }
33
33
  function X({
@@ -40,7 +40,7 @@ function X({
40
40
  accept: u,
41
41
  canDelete: $,
42
42
  hasLink: P,
43
- hasEdit: w,
43
+ hasEdit: D,
44
44
  readOnly: g,
45
45
  isLoading: b,
46
46
  onLinkClick: v,
@@ -49,7 +49,7 @@ function X({
49
49
  onEdit: y,
50
50
  onPreview: c
51
51
  }) {
52
- const E = Y(null), S = v ? !!e.url : J(e.url);
52
+ const w = Y(null), E = v ? !!e.url : J(e.url);
53
53
  return /* @__PURE__ */ f(
54
54
  $e,
55
55
  {
@@ -60,14 +60,14 @@ function X({
60
60
  readOnly: g,
61
61
  isLoading: b,
62
62
  itemIsLoading: e.isLoading,
63
- canDelete: $,
63
+ canDelete: e.canDelete ?? $,
64
64
  isDragHandleOverlay: !0,
65
- hasLink: P && S,
65
+ hasLink: P && E,
66
66
  linkUrl: e.url,
67
- onLinkClick: P && S ? () => v ? v(e) : e.url && Ee(e.url) : void 0,
67
+ onLinkClick: P && E ? () => v ? v(e) : e.url && we(e.url) : void 0,
68
68
  onDelete: () => B(e.id),
69
69
  deleteAriaLabel: "이미지 삭제",
70
- onTileClick: () => E.current?.click(),
70
+ onTileClick: () => w.current?.click(),
71
71
  onFileDrop: (i) => {
72
72
  if (u) {
73
73
  if (!u.includes(i.type)) return;
@@ -78,13 +78,13 @@ function X({
78
78
  /* @__PURE__ */ r(
79
79
  "input",
80
80
  {
81
- ref: E,
81
+ ref: w,
82
82
  type: "file",
83
- accept: Se(u),
83
+ accept: Ee(u),
84
84
  style: { display: "none" },
85
85
  onChange: (i) => {
86
- const D = i.target.files?.[0];
87
- D && C(e.id, D), i.target.value = "";
86
+ const S = i.target.files?.[0];
87
+ S && C(e.id, S), i.target.value = "";
88
88
  }
89
89
  }
90
90
  ),
@@ -97,7 +97,7 @@ function X({
97
97
  className: s.TileImage
98
98
  }
99
99
  ),
100
- w && !g && /* @__PURE__ */ r(
100
+ D && !g && /* @__PURE__ */ r(
101
101
  "button",
102
102
  {
103
103
  type: "button",
@@ -140,7 +140,7 @@ const Ve = ({
140
140
  placeholder: u = "이미지를 넣어주세요",
141
141
  hasIcon: $ = !0,
142
142
  hasLink: P = !1,
143
- onLinkClick: w,
143
+ onLinkClick: D,
144
144
  hasEdit: g = !1,
145
145
  canDelete: b = !0,
146
146
  minLength: v,
@@ -148,18 +148,18 @@ const Ve = ({
148
148
  errorMsg: C,
149
149
  isLoading: y,
150
150
  readOnly: c,
151
- gap: E = 8
151
+ gap: w = 8
152
152
  }) => {
153
153
  const {
154
- isPositionMode: S,
154
+ isPositionMode: E,
155
155
  resolvedMaxLength: i,
156
- placeholderCount: D,
156
+ placeholderCount: S,
157
157
  slotIds: K,
158
158
  sortableItems: Q,
159
159
  sensors: Z,
160
160
  handleDragEnd: ee,
161
161
  getMetaIndex: M
162
- } = we({ value: e, length: A, minLength: v, maxLength: B, onChange: l }), p = !!C, [z, N] = O(null), [T, R] = O(null), m = T ? e.find((n) => n.id === T.id && n.url === T.url) ?? null : null;
162
+ } = De({ value: e, length: A, minLength: v, maxLength: B, onChange: l }), p = !!C, [z, N] = O(null), [T, R] = O(null), m = T ? e.find((n) => n.id === T.id && n.url === T.url) ?? null : null;
163
163
  T && !m && R(null);
164
164
  const k = Y(e);
165
165
  V(() => {
@@ -201,7 +201,7 @@ const Ve = ({
201
201
  `).map((o, a) => /* @__PURE__ */ r("span", { children: o }, a));
202
202
  };
203
203
  return /* @__PURE__ */ f("div", { children: [
204
- /* @__PURE__ */ r(le, { sensors: Z, collisionDetection: ie, onDragEnd: ee, children: /* @__PURE__ */ r(se, { items: Q, strategy: ae, children: /* @__PURE__ */ r("div", { className: s.Container, style: { gap: E }, children: S ? Array.from({ length: i }, (n, t) => {
204
+ /* @__PURE__ */ r(le, { sensors: Z, collisionDetection: ie, onDragEnd: ee, children: /* @__PURE__ */ r(se, { items: Q, strategy: ae, children: /* @__PURE__ */ r("div", { className: s.Container, style: { gap: w }, children: E ? Array.from({ length: i }, (n, t) => {
205
205
  const o = K[t], a = e.find((I) => I.position === t);
206
206
  return a ? /* @__PURE__ */ r(
207
207
  X,
@@ -218,7 +218,7 @@ const Ve = ({
218
218
  hasEdit: g,
219
219
  readOnly: c ?? !1,
220
220
  isLoading: y,
221
- onLinkClick: w,
221
+ onLinkClick: D,
222
222
  onDelete: U,
223
223
  onReplace: _,
224
224
  onEdit: N,
@@ -264,7 +264,7 @@ const Ve = ({
264
264
  hasEdit: g,
265
265
  readOnly: c ?? !1,
266
266
  isLoading: y,
267
- onLinkClick: w,
267
+ onLinkClick: D,
268
268
  onDelete: U,
269
269
  onReplace: _,
270
270
  onEdit: N,
@@ -274,7 +274,7 @@ const Ve = ({
274
274
  },
275
275
  n.id
276
276
  )),
277
- !c && Array.from({ length: D }, (n, t) => /* @__PURE__ */ f(
277
+ !c && Array.from({ length: S }, (n, t) => /* @__PURE__ */ f(
278
278
  q,
279
279
  {
280
280
  onDrop: te,
@@ -332,12 +332,12 @@ const Ve = ({
332
332
  },
333
333
  body: { padding: "16px" }
334
334
  },
335
- children: m && /* @__PURE__ */ r(De, { item: m }, `${m.id}:${m.url}`)
335
+ children: m && /* @__PURE__ */ r(Se, { item: m }, `${m.id}:${m.url}`)
336
336
  }
337
337
  )
338
338
  ] });
339
339
  };
340
- function De({ item: e }) {
340
+ function Se({ item: e }) {
341
341
  const [l, d] = O(!1);
342
342
  return /* @__PURE__ */ f("div", { className: s.PreviewContent, children: [
343
343
  /* @__PURE__ */ f("div", { className: s.PreviewControls, role: "group", "aria-label": "이미지 크기 보기", children: [
@@ -169,6 +169,8 @@ export declare interface IImageInputItem {
169
169
  file?: File;
170
170
  isLoading?: boolean;
171
171
  position?: number;
172
+ /** 이 항목만 삭제 버튼 노출 여부를 따로 정한다. 없으면 컴포넌트의 `canDelete` 를 따른다. */
173
+ canDelete?: boolean;
172
174
  }
173
175
 
174
176
  export declare interface IImageInputProps {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pop-ui/core",
3
3
  "type": "module",
4
- "version": "2.3.0",
4
+ "version": "2.3.1",
5
5
  "main": "./dist/core.umd.cjs",
6
6
  "module": "./dist/core.js",
7
7
  "types": "./dist/types/index.d.ts",
@@ -47,7 +47,7 @@
47
47
  "@dnd-kit/core": "^6.3.1",
48
48
  "@dnd-kit/sortable": "^10.0.0",
49
49
  "@dnd-kit/utilities": "^3.2.2",
50
- "@pop-ui/foundation": "2.3.0",
50
+ "@pop-ui/foundation": "2.3.1",
51
51
  "dayjs": "^1.11.18",
52
52
  "lottie-react": "^2.4.1",
53
53
  "react-easy-crop": "^5.5.3"