import{r as e,j as t}from"./react-B_SyE9nW.js";import{o,O as r,B as s,j as i,n as a,N as n,m as p}from"./index-Flm6m8Wj.js";import{I as m,M as x}from"./index-C6Ujt1Uk.js";import{s as l,a as g,b as c,C as d}from"./CloseManageList-CSuJPE3H.js";import{B as C}from"./BtnSave-CKs5DUDn.js";import{F as h,P as u,C as j}from"./PhotoUpIco-bSYKiGLb.js";import{F as f}from"./FldSwitch-DCTvKDJD.js";import{F as S}from"./FldTextArea-DGnBCJc0.js";import{P as I}from"./PictureBox-DPAYvVY_.js";import{T as w}from"./TrashIco-CShefd42.js";import{B as k}from"./RatingReviewTitle-Bqj_kx7V.js";import{U as M}from"./ItemLoading-wir9MCjq.js";import{S as b}from"./Stack-CZ7Wid7r.js";const D={"&":{position:"relative"}};const L=o((function(){const o=e.useRef({}),[x,d]=e.useState(null),L=e.useContext(k),R=e.useContext(M),{src:v,item_identifier:F}=r((()=>L.getElement)).get();e.useEffect((()=>{d(o.current.offsetWidth)}),[]);const P=e.useMemo((()=>L.getCropperStore.getImgsToCrop.find((e=>e.id===L.getCropperStore.getCurrentCropImage))),[L.getCropperStore.getCurrentCropImage,L.getCropperStore.getImgsToCrop]);return t.jsxs(b,{sx:D,ref:o,children:[t.jsx(I,{sx:{maxWidth:"none"},width:x,height:200,src:v}),t.jsx(s,{sx:l,children:t.jsx(h,{onChange:e=>{p.setPrevious(p.current),L.onHandleUploadClick(e)},children:t.jsx(u,{sx:{color:i.white,width:"auto",height:"20px"}})})}),t.jsxs(b,{sx:{...g,maxHeight:"unset",backgroundColor:i.white,mb:"0",pb:"20px"},children:[t.jsx(S,{fieldState:L.getName,minRows:1,maxRows:2,placeholder:a("listName"),required:!0}),t.jsx(S,{fieldState:L.getDescription,minRows:2,maxRows:3,placeholder:a("listDescription"),sx:c}),t.jsx(f,{fieldState:L.getVisibility,label:a("privateList"),sx:{"&&":{m:"10px 0 15px","& span.MuiSwitch-root":{mb:"-1px"}}}}),t.jsx(C,{onClick:L.onClickUpdateList}),t.jsxs(m,{onClick:()=>{R.onClickRemoveList(F)},sx:{mt:"20px",mb:"-10px"},children:[t.jsx(w,{sx:{width:"auto",height:"14px",ml:"10px"}}),t.jsx(n,{margin:"0 auto 0 5px",size:"minis",color:"red",children:a("removeList")})]})]}),t.jsx(j,{onClickAccept:L.onClickAcceptImage,src:P,extension:L.getCropperStore.getExtension,images:L.getCropperStore.getImgsToCrop,onDelete:L.getCropperStore.deleteImageFromCrops,onChange:L.getCropperStore.setCurrentCropImage,onCropImage:L.getCropperStore.onHandleCropImage,limit:1,onClose:L.getCropperStore.onHandleDeleteAllImages,forOneImage:!0})]})})),R={p:0,"& .MuiDialogContent-root":{p:0},".MuiDialog-container":{".MuiPaper-root":{backgroundColor:"transparent"}},"@media(min-width:768px)":{".MuiDialog-container":{width:"479px",m:"auto",".MuiPaper-root":{maxWidth:"unset",width:"100%",maxHeight:"680px",height:"fit-content",".MuiDialogContent-root":{p:"0"}}}}};const v=o((function(){return t.jsxs(x,{open:p.isEditList,keepMounted:!1,sx:R,children:[t.jsx(d,{isForm:!0}),t.jsx(L,{})]})}));export{v as E};