"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4909],{71854:function(e,t){t.Z=60},83375:function(e,t,n){n.d(t,{Z:function(){return d}});var i=n(57437);n(2265);var o=n(88862),r=n(33145);let l=o.ZP.div.withConfig({componentId:"sc-bc9b20f0-0"})(["display:flex;align-items:center;justify-content:center;width:34px;height:34px;position:absolute;top:-15px;right:-12px;background-color:#ff7777;border-radius:50%;font-size:16px;font-weight:500;line-height:19.09px;text-align:center;color:white;"]);var a=e=>{let{cartCount:t}=e,n=t>99?"99+":t;return(0,i.jsx)(i.Fragment,{children:0!==n&&(0,i.jsx)(l,{children:n})})},d=e=>{let{backgroundColor:t="rgba(41, 43, 92, 1)",hoverColor:n="rgba(104, 100, 208, 1)",prevSrc:o,prevSrcWidth:r=30,nextSrc:l,content:d,subContent:x="",width:v=100,mWidth:b=50,height:w=40,onClick:y,isClicked:j=!1,cartCount:I=null,mContentVisible:C="none",hasUnreadNotifications:k=!1,disabled:P=!1,contentColor:S="#f2f2f3",borderColor:Z,hoverTextColor:A="#ffffff"}=e;return(0,i.jsxs)(c,{$width:v,$mWidth:b,$height:w,$backgroundColor:t,$hoverColor:n,$isClicked:j,$disabled:P,$borderColor:Z,$hoverTextColor:A,onClick:y,children:[o&&(0,i.jsx)(u,{children:(0,i.jsx)(p,{src:o,alt:"Previous",width:r,height:30})}),(0,i.jsxs)(h,{children:[d&&(0,i.jsx)(s,{$mContentVisible:C,$contentColor:S,children:d}),x&&(0,i.jsx)(g,{$mContentVisible:C,children:x})]}),l&&(0,i.jsx)(u,{children:(0,i.jsx)(f,{src:l,alt:"Next",width:30,height:30})}),null!==I&&(0,i.jsx)(a,{cartCount:I}),k&&(0,i.jsx)(m,{})]})};let s=o.ZP.div.withConfig({componentId:"sc-dd1101fc-0"})(["color:",";font-size:16px;font-weight:600;line-height:17px;text-align:center;@media (max-width:768px){display:",";}"],e=>{let{$contentColor:t}=e;return t},e=>{let{$mContentVisible:t}=e;return t}),c=o.ZP.div.withConfig({componentId:"sc-dd1101fc-1"})(["display:flex;position:relative;align-items:center;justify-content:center;width:",";height:",";gap:12px;border-radius:8px;padding:10px;background-color:",";border:",";transition:background-color 0.3s ease,opacity 0.3s ease;cursor:",";opacity:",";pointer-events:",";&:hover{background-color:",";","{color:",";}}@media (max-width:768px){width:",";padding:5px;}"],e=>{let{$width:t}=e;return"number"==typeof t?"".concat(t,"px"):t},e=>{let{$height:t}=e;return"".concat(t,"px")},e=>{let{$isClicked:t,$backgroundColor:n}=e;return t?"rgba(101, 103, 169, 1)":n},e=>{let{$borderColor:t}=e;return t?"1px solid ".concat(t):"none"},e=>{let{$disabled:t}=e;return t?"not-allowed":"pointer"},e=>{let{$disabled:t}=e;return t?.5:1},e=>{let{$disabled:t}=e;return t?"none":"auto"},e=>{let{$hoverColor:t,$disabled:n}=e;return n?void 0:t},s,e=>{let{$hoverTextColor:t}=e;return t},e=>{let{$mWidth:t}=e;return"number"==typeof t?"".concat(t,"px"):t}),u=o.ZP.div.withConfig({componentId:"sc-dd1101fc-2"})(["display:flex;align-items:center;"]),p=(0,o.ZP)(r.default).withConfig({componentId:"sc-dd1101fc-3"})([""]),f=(0,o.ZP)(r.default).withConfig({componentId:"sc-dd1101fc-4"})([""]),h=o.ZP.div.withConfig({componentId:"sc-dd1101fc-5"})(["display:flex;align-items:center;"]),g=o.ZP.div.withConfig({componentId:"sc-dd1101fc-6"})(["color:#f2f2f3;font-size:14px;font-weight:400;line-height:17px;text-align:center;@media (max-width:768px){display:",";}"],e=>{let{$mContentVisible:t}=e;return t}),m=o.ZP.div.withConfig({componentId:"sc-dd1101fc-7"})(["position:absolute;top:-3px;right:6px;width:10px;height:10px;background-color:#ff7777;border-radius:50%;"])},60185:function(e,t,n){n.d(t,{Z:function(){return c}});var i=n(57437),o=n(2265),r=n(54887),l=n(88862),a=n(43618),d=n(50194),s=n(39026);function c(e){let{onClose:t,mainContent:n,sideContent:l,mainWidth:c="90%",sideWidth:g="10%",containerStyle:j,sideContainerStyle:I,backgroundColor:C="#fff",sideHeaderText:k="최근 본 상품",sideOnRight:P=!1,pickerOpen:S=!1}=e,Z=(0,a.Zl)(d.Z),A=(0,s.eA)(()=>{Z(!1),t&&t()}),[E,z]=o.useState(()=>window.matchMedia("(max-width: 1400px)").matches);o.useEffect(()=>{var e;let t=window.matchMedia("(max-width: 1400px)"),n=()=>z(t.matches);return n(),null===(e=t.addEventListener)||void 0===e||e.call(t,"change",n),window.addEventListener("resize",n),()=>{var e;null===(e=t.removeEventListener)||void 0===e||e.call(t,"change",n),window.removeEventListener("resize",n)}},[]);let M=S&&E,D=document.getElementById("modal-root");if(!D)return null;let L=e=>{Z(!1),e.stopPropagation()},N=!!l,R=N?(0,i.jsxs)(m,{...A.contentProps,style:I,width:g,$pickerOpen:M,backgroundColor:C,onClick:L,children:[(0,i.jsx)(x,{children:k}),(0,i.jsx)(v,{children:l})]}):null,F=N?(0,i.jsx)(y,{width:g,style:I,"aria-hidden":"true"}):null,T=(0,i.jsx)(w,{"data-picker-slot":!0,width:g,$pickerOpen:M,style:I,"aria-hidden":"true"});return(0,r.createPortal)((0,i.jsx)(u,{$reflow:M,onMouseDown:e=>{A.onMouseDown(e),Z(!1)},onClick:A.onClick,children:(0,i.jsx)(p,{children:(0,i.jsxs)(h,{$pickerOpen:M,children:[P?T:R,(0,i.jsxs)(b,{...A.contentProps,role:"dialog","aria-modal":"true","data-dual-main":!0,"data-reflow":M?"true":void 0,style:j,width:c,$pickerOpen:M,backgroundColor:C,onClick:L,children:[t&&(0,i.jsx)(f,{onClick:e=>{e.stopPropagation(),t()},onMouseDown:L,"aria-label":"닫기",type:"button",children:(0,i.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:[(0,i.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),(0,i.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]})}),n]}),P?R:F]})})}),D)}let u=l.ZP.div.withConfig({componentId:"sc-5c02639d-0"})(["position:fixed;inset:0;background:rgba(0,0,0,0.5);display:flex;justify-content:center;align-items:center;z-index:2147483646;overflow-y:auto;overflow-x:hidden;@media (max-width:768px){align-items:flex-start;padding:0;padding-bottom:64px;background:#ffffff;}html.su-plugin &{align-items:"," !important;padding:"," !important;background:rgba(0,0,0,0.5) !important;}"],e=>{let{$reflow:t}=e;return t?"flex-start":"center"},e=>{let{$reflow:t}=e;return t?"16px 0":"0"}),p=l.ZP.div.withConfig({componentId:"sc-5c02639d-1"})(["position:relative;display:flex;flex-direction:column;gap:16px;max-width:1200px;width:100%;background:transparent;html.su-plugin &{zoom:0.85;}@media (min-width:769px) and (max-width:1440px){zoom:0.85;}"]),f=l.ZP.button.withConfig({componentId:"sc-5c02639d-2"})(["position:absolute;top:3px;right:3px;width:32px;height:32px;&::before{content:'';position:absolute;inset:-12px;}border:0;background:transparent;box-shadow:none;color:#333;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:2147483647;transition:transform 120ms ease;&:hover{transform:scale(0.95);}&:focus-visible{outline:2px solid #111;outline-offset:2px;}svg{width:22px;height:22px;}@media (max-width:768px){width:28px;height:28px;top:8px;right:8px;}"]),h=l.ZP.div.withConfig({componentId:"sc-5c02639d-3"})(["display:flex;gap:24px;width:100%;align-items:flex-start;justify-content:center;position:relative;@media (max-width:768px){gap:12px;}html.su-plugin &{gap:6px;justify-content:flex-end;}@media (min-width:769px) and (max-width:1440px){gap:6px;}",""],e=>{let{$pickerOpen:t}=e;return t&&(0,l.iv)(["html.su-plugin &{justify-content:center;}"])}),g="\n border-radius: 12px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);\n overflow-y: auto;\n overflow-x: hidden;\n",m=l.ZP.div.withConfig({componentId:"sc-5c02639d-4"})([""," background-color:#f6f7f9;width:",";flex-shrink:0;position:relative;display:flex;flex-direction:column;transition:flex-basis 0.2s ease;"," @media (max-width:768px){display:none;}"],g,e=>{let{width:t}=e;return t||"15%"},e=>{let{$pickerOpen:t}=e;return t&&"\n flex-shrink: 1;\n min-width: 120px;\n "}),x=l.ZP.div.withConfig({componentId:"sc-5c02639d-5"})(["position:sticky;top:0;background:#f6f7f9;color:#111;height:44px;display:flex;align-items:center;justify-content:center;text-align:center;padding:0 16px;font-weight:600;font-size:0.95rem;z-index:2;flex-shrink:0;box-sizing:border-box;border-top-left-radius:12px;border-top-right-radius:12px;border-bottom:1px solid #dfe1e6;"]),v=l.ZP.div.withConfig({componentId:"sc-5c02639d-6"})(["padding:12px;"]),b=l.ZP.div.withConfig({componentId:"sc-5c02639d-7"})([""," position:relative;background-color:",";width:",";flex-shrink:0;margin:0 auto;max-width:100%;transition:flex-basis 0.2s ease;"," html.su-plugin &{margin:0;}@media (min-width:769px) and (max-width:1440px){margin:0;}padding:24px;box-sizing:border-box;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;overflow-wrap:anywhere;word-break:break-word;pre,code{white-space:pre-wrap;}img,video,canvas,iframe{display:block;max-width:100%;height:auto;}table{width:100%;table-layout:fixed;border-collapse:collapse;}th,td{word-break:break-word;}@media (max-width:768px){width:100%;max-width:none;max-height:calc( 100dvh - 24px * 2 - env(safe-area-inset-top,0px) - env( safe-area-inset-bottom,0px ) - 40px );margin-top:32px;}"],g,e=>{let{backgroundColor:t}=e;return t||"#fff"},e=>{let{width:t}=e;return t||"85%"},e=>{let{$pickerOpen:t}=e;return t&&"\n flex: 0 1 auto;\n width: auto;\n min-width: 0;\n padding: 12px 4px;\n "}),w=l.ZP.div.withConfig({componentId:"sc-5c02639d-8"})(["width:",";flex-shrink:0;position:relative;align-self:stretch;transition:width 0.24s ease;@media (max-width:768px){display:none;}html.su-plugin &{width:",";}@media (min-width:769px) and (max-width:1440px){width:",";}"],e=>{let{$pickerOpen:t,width:n}=e;return t?"220px":n||"15%"},e=>{let{$pickerOpen:t,width:n}=e;return t?"220px":"calc(".concat(n||"7.5%"," / 2)")},e=>{let{$pickerOpen:t,width:n}=e;return t?"220px":"calc(".concat(n||"7.5%"," / 2)")}),y=l.ZP.div.withConfig({componentId:"sc-5c02639d-9"})(["width:",";flex-shrink:0;visibility:hidden;position:relative;max-height:650px;@media (max-width:768px){display:none;}html.su-plugin &{width:",";}@media (min-width:769px) and (max-width:1440px){width:",";}"],e=>{let{width:t}=e;return t||"15%"},e=>{let{width:t}=e;return"calc(".concat(t||"7.5%"," / 2)")},e=>{let{width:t}=e;return"calc(".concat(t||"7.5%"," / 2)")})},42405:function(e,t,n){var i=n(57437);n(2265);var o=n(88862),r=n(98346),l=n(33145),a=n(43618),d=n(2711);let s=(0,o.F4)(["0%{transform:rotate(0deg);}100%{transform:rotate(-360deg);}"]),c=o.ZP.div.withConfig({componentId:"sc-b8476d88-0"})(["margin:20px 0;@media (max-width:1024px){position:fixed;inset:0;margin:0;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:50;}"]),u=(0,o.ZP)(l.default).withConfig({componentId:"sc-b8476d88-1"})(["width:100px;height:100px;animation:"," 2s linear infinite;@media (max-width:1024px){width:50px;height:50px;}"],s),p=o.ZP.div.withConfig({componentId:"sc-b8476d88-2"})(["display:flex;flex-direction:column;align-items:center;border-radius:50%;"]);t.Z=()=>{let[e,t]=(0,a.FV)(d.Z);return e?(0,i.jsx)(c,{children:(0,i.jsx)(p,{onClick:e=>e.stopPropagation(),children:(0,i.jsx)(u,{src:r.Z,alt:"Loading spinner"})})}):null}},48570:function(e,t,n){n.d(t,{u:function(){return d}});var i=n(57437);n(2265);var o=n(33145),r=n(88862),l=n(17553);let a=r.ZP.div.withConfig({componentId:"sc-b0640c18-0"})(["display:flex;flex-direction:column;gap:12px;position:fixed;bottom:25px;right:25px;z-index:10;@media screen and (max-width:500px){bottom:50px;right:15px;}"]),d=r.ZP.a.withConfig({componentId:"sc-b0640c18-1"})(["box-sizing:border-box;aspect-ratio:1 / 1;"," display:flex;justify-content:center;align-items:center;width:56px;height:56px;border-radius:50%;background:",";border:1px solid ",";box-shadow:0 2px 6px rgba(16,24,40,0.1),0 10px 28px rgba(16,24,40,0.18);color:",";font-size:14px;font-weight:400;line-height:normal;letter-spacing:-0.6px;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:box-shadow 180ms ease,transform 180ms ease;&:hover{box-shadow:0 4px 10px rgba(16,24,40,0.12),0 16px 36px rgba(16,24,40,0.22);}&:active{transform:scale(0.98);box-shadow:0 2px 4px rgba(16,24,40,0.1),0 8px 20px rgba(16,24,40,0.18);}@media screen and (max-width:1440px){width:40px;height:40px;font-size:12px;img{width:28px;height:28px;}}html.su-plugin &{width:40px;height:40px;font-size:11px;img{width:26px;height:26px;}}"],e=>{let{$hideOnMobile:t}=e;return t&&"@media (max-width: 768px) { display: none !important; }"},e=>{let{$purple:t}=e;return t?"#413D7D":"#ffffff"},e=>{let{$purple:t}=e;return t?"rgba(65, 61, 125, 0.6)":"rgba(255, 255, 255, 0.92)"},e=>{let{$purple:t}=e;return t?"#ffffff":"#1b2c33"}),s=(0,r.ZP)(d).withConfig({componentId:"sc-b0640c18-2"})(["@media screen and (max-width:1023px){display:none;}",""],e=>{let{$showInPlugin:t}=e;return t&&"\n html.su-plugin & {\n display: flex;\n }\n "});t.Z=e=>{let{onClickTop:t,ctaHref:n="/associate",ctaLabel:r,ctaAriaLabel:c="입점 신청",hideCtaOnMobile:u=!1,liftForBottomNav:p=!1,showTopInPlugin:f=!1}=e;return(0,i.jsxs)(a,{$lift:p,children:[(0,i.jsx)(s,{as:"button",onClick:t,type:"button","aria-label":"맨 위로",$showInPlugin:f,children:(0,i.jsx)(o.default,{src:l.Z,alt:"Scroll to top",width:35,height:35})}),(0,i.jsx)(d,{as:"a",href:n,"aria-label":c,$purple:!0,$hideOnMobile:u,children:null!=r?r:(0,i.jsxs)(i.Fragment,{children:["입점",(0,i.jsx)("br",{}),"신청"]})})]})}},44026:function(e,t,n){n.d(t,{F0:function(){return r},aV:function(){return l}});var i=n(88862);let o="#F2F2F3",r=i.ZP.div.withConfig({componentId:"sc-b0eba74f-0"})(["flex-direction:column;width:85%;height:90%;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);max-height:90vh;overflow-y:auto;background-color:",";box-shadow:0px 0px 10px 0px rgba(0,0,0,0.5);z-index:2147483645;display:flex;flex-direction:row;border-radius:8px;padding:45px 15px;@media (max-width:768px){width:100vw;height:calc(100dvh - 64px);max-height:calc(100dvh - 64px);top:0;left:0;transform:none;padding:0;overflow-y:auto;border-radius:0;box-shadow:none;}@media (min-width:769px) and (max-width:1440px){width:100vw;height:100vh;max-height:100vh;top:0;left:0;transform:none;padding:0;overflow-y:auto;border-radius:0;box-shadow:none;z-index:2147483645;}html.su-plugin &{width:100vw !important;height:100vh !important;max-height:100vh !important;top:0 !important;left:0 !important;transform:none !important;padding:0 !important;border-radius:0 !important;box-shadow:none !important;z-index:2147483645 !important;}"],o),l=i.ZP.div.withConfig({componentId:"sc-b0eba74f-1"})(["position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.5);z-index:2147483644;html.su-plugin &{z-index:2147483644 !important;}@media (min-width:769px) and (max-width:1440px){z-index:2147483644;}"]);i.ZP.div.withConfig({componentId:"sc-b0eba74f-2"})(["flex-direction:column;height:450px;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background-color:",";box-shadow:0px 0px 10px 0px rgba(0,0,0,0.5);z-index:1003;display:flex;border-radius:20px;@media (max-width:768px){width:90%;top:31%;left:50%;transform:translate(-50%,-50%);}"],o),i.ZP.div.withConfig({componentId:"sc-b0eba74f-3"})(["position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,0.5);z-index:1000;"])},69881:function(e,t,n){var i=n(86484),o=n(29918),r=n(43618),l=n(77209);t.Z=e=>{let{onSuccess:t,onError:n}=e,a=(0,i.useQueryClient)(),[d,s]=(0,r.FV)(l.Z),[c,u]=(0,r.FV)(l.G),p=(0,i.useMutation)(async e=>{let t=localStorage.getItem("TOKEN");if(!t)throw Error("로그인이 필요합니다.");return(await o.et.delete("/boards/".concat(e),{headers:{Authorization:"Bearer ".concat(t)}})).data.deletedId},{onError:e=>{var t;let i=null===(t=e.response)||void 0===t?void 0:t.data.message;n(Array.isArray(i)?i.join(", "):i||"알 수 없는 오류")},onSuccess:e=>{s(t=>t.filter(t=>t.id!==e)),u(t=>t.filter(t=>t.id!==e)),a.invalidateQueries("boards"),t(e)}});return{mutate:p.mutate,isLoading:p.isLoading,error:p.error}}},98849:function(e,t,n){var i=n(86484),o=n(29918);t.Z=function(){let{onError:e,onSuccess:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(0,i.useQueryClient)(),r=(0,i.useMutation)(async e=>{let{boardId:t,name:n}=e,i=localStorage.getItem("TOKEN");if(!i)throw Error("로그인이 필요합니다.");return(await o.et.patch("/boards/".concat(t),{name:n},{headers:{Authorization:"Bearer ".concat(i)}})).data},{onError:t=>{var n,i;let o=null===(i=t.response)||void 0===i?void 0:null===(n=i.data)||void 0===n?void 0:n.message;null==e||e(Array.isArray(o)?o.join(", "):o)},onSuccess:()=>{n.invalidateQueries("boards"),null==t||t()}});return{updateBoard:(e,t)=>r.mutate({boardId:e,name:t}),isUpdating:r.isLoading}}},42103:function(e,t,n){n.d(t,{Z:function(){return ep}});var i=n(57437),o=n(2265),r=n(99376),l=n(43618),a=n(88862),d=n(7261),s=n(87530),c=n(26437),u=n(22445),p=n(77047),f=n(19783),h=n(32806),g=n(17140),m=n(2132),x=n(31133),v=n(3169),b=n(64744),w=n(35775),y=n(98849),j=n(69881),I=e=>{let{size:t=13}=e;return(0,i.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,i.jsx)("path",{d:"M10 13a5 5 0 0 0 7.07 0l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),(0,i.jsx)("path",{d:"M14 11a5 5 0 0 0-7.07 0l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})},C=n(86484),k=n(78155),P=n(42742);function S(e){let{title:t,lines:n=[],confirmLabel:o="삭제",cancelLabel:r="취소",onConfirm:l,onClose:a}=e;return(0,i.jsxs)(k.Z,{onClose:a,containerWidth:"400px",children:[(0,i.jsx)(Z,{children:t}),n.length>0&&(0,i.jsx)(A,{children:n.map((e,t)=>(0,i.jsx)("li",{children:e},t))}),(0,i.jsxs)(P.nK,{children:[(0,i.jsx)(P.zx,{$outline:!0,onClick:()=>{l(),a()},children:o}),(0,i.jsx)(P.zx,{onClick:a,children:r})]})]})}let Z=a.ZP.div.withConfig({componentId:"sc-e1c1d926-0"})(["display:flex;justify-content:center;text-align:center;font-size:0.95rem;font-weight:600;line-height:1.5;"]),A=a.ZP.ul.withConfig({componentId:"sc-e1c1d926-1"})(["margin:14px auto 0;padding:0;max-width:320px;list-style:none;color:#6b7280;font-size:13px;line-height:1.6;li{position:relative;padding-left:12px;}li::before{content:'\xb7';position:absolute;left:2px;}"]),E=a.ZP.aside.withConfig({componentId:"sc-ea9ab539-0"})(["position:relative;display:flex;flex-direction:column;flex:0 0 ","px;width:","px;border-right:1px solid #e4e6ea;background:#f6f7f9;padding:0 0 40px;overflow:hidden;user-select:none;@media (max-width:768px){display:none;}",""],e=>{let{$w:t}=e;return t},e=>{let{$w:t}=e;return t},e=>{let{$picker:t}=e;return t&&(0,a.iv)(["flex:1 1 auto;width:100%;border-right:none;background:transparent;padding:0;min-height:0;"])}),z=a.ZP.div.withConfig({componentId:"sc-ea9ab539-1"})(["display:flex;gap:6px;padding:8px 6px 2px;button{flex:1;padding:8px 4px;border:1px dashed #c3c3cc;border-radius:8px;background:#fff;color:#413d7d;font-size:12px;font-weight:600;cursor:pointer;white-space:nowrap;}button:hover{background:#f7f7fb;}"]),M=a.ZP.div.withConfig({componentId:"sc-ea9ab539-2"})(["position:absolute;top:0;right:-3px;width:7px;height:100%;cursor:col-resize;z-index:30;&::after{content:'';position:absolute;left:3px;top:0;width:1px;height:100%;background:transparent;transition:background 0.12s,width 0.12s,left 0.12s;}&:hover::after{background:#413d7d;}&.drag::after{background:#413d7d;width:2px;left:2px;}"]),D=(0,a.vJ)(["body.mcd-tree-resizing,body.mcd-tree-resizing *{cursor:col-resize !important;user-select:none !important;}"]),L=a.ZP.div.withConfig({componentId:"sc-ea9ab539-3"})(["flex:0 0 auto;font-size:14px;font-weight:bold;padding:8px 16px;border-bottom:1px solid #e4e6ea;cursor:pointer;user-select:none;outline:none !important;-webkit-tap-highlight-color:transparent;&:focus,&:focus-visible{outline:none !important;box-shadow:none !important;}&:hover{background:#ebedf1;}@media (max-width:768px){display:none;}html.su-plugin &{font-size:14px;padding:8px 16px;}"]),N="\n display: flex;\n align-items: center;\n gap: 6px;\n /* \uD83C\uDD95 행간(세로 간격) 절반 — 8px→4px(요청 '너무 넓어'). 좌우 16px 은 유지. */\n padding: 4px 16px;\n cursor: pointer;\n user-select: none;\n min-width: 0;\n\n &:hover {\n background: #ebedf1;\n }\n\n html.su-plugin &,\n html.su-plugin & * {\n font-size: 13px;\n }\n html.su-plugin & {\n padding: 4px 16px;\n }\n @media (min-width: 769px) and (max-width: 1440px) {\n &,\n & * {\n font-size: 13px;\n }\n padding: 4px 16px;\n }\n",R=a.ZP.div.withConfig({componentId:"sc-ea9ab539-4"})([""," justify-content:center;background:",";color:#2f3038;font-weight:bold;"," &:hover{background:",";}"],N,e=>{let{$on:t}=e;return t?"#c9e2f7":"#e5e8ed"},e=>{let{$static:t}=e;return t?"cursor: default;":"cursor: pointer;"},e=>{let{$on:t,$static:n}=e;return n?"#e5e8ed":t?"#c9e2f7":"#dbdfe6"}),F=a.ZP.span.withConfig({componentId:"sc-ea9ab539-5"})(["flex-shrink:0;position:relative;display:inline-flex;align-items:center;justify-content:center;padding:2px 8px;border-radius:999px;background:",";color:#ffffff;font-size:11px;font-weight:700;line-height:1.2;letter-spacing:-0.02em;cursor:pointer;html.su-plugin &{padding:1px 6px;font-size:11px !important;}"],e=>{let{$recv:t}=e;return t?"#7a8699":"#4c6ef5"}),T=a.ZP.div.withConfig({componentId:"sc-ea9ab539-6"})(["padding:8px 0;flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:rgba(0,0,0,0.22) transparent;&::-webkit-scrollbar{width:8px;}&::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.22);border-radius:8px;border:2px solid transparent;background-clip:content-box;}&::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,0.36);background-clip:content-box;}&::-webkit-scrollbar-track{background:transparent;}"]),B=(0,a.F4)(["0%,100%{box-shadow:inset 0 0 0 1.5px rgba(13,153,255,0.35);}50%{box-shadow:inset 0 0 0 1.5px rgba(13,153,255,1);}"]),O=a.ZP.div.withConfig({componentId:"sc-ea9ab539-7"})([""," background:",";font-weight:",";opacity:",";&:hover{background:",";}"," ",""],N,e=>{let{$on:t,$sel:n}=e;return n?"#dbe4ff":t?"#e3f2fd":"transparent"},e=>{let{$on:t}=e;return t?"bold":"normal"},e=>{let{$dragging:t}=e;return t?.45:1},e=>{let{$on:t,$sel:n}=e;return n?"#dbe4ff":t?"#e3f2fd":"#ebedf1"},e=>{let{$drop:t}=e;return t?"background:#e3f2fd;outline:2px dashed #413d7d;outline-offset:-2px;":""},e=>{let{$live:t,$drop:n}=e;return t&&!n?(0,a.iv)(["animation:"," 1.4s ease-in-out infinite;@media (prefers-reduced-motion:reduce){animation:none;box-shadow:inset 0 0 0 1.5px rgba(13,153,255,0.85);}"],B):""}),W=a.ZP.span.withConfig({componentId:"sc-ea9ab539-8"})(["width:12px;height:24px;display:inline-flex;align-items:center;justify-content:center;color:#8a8b94;flex-shrink:0;svg{flex-shrink:0;transition:transform 0.15s;transform:rotate(","deg);}"],e=>{let{$open:t}=e;return t?90:0}),_=()=>(0,i.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,i.jsx)("polyline",{points:"9 5 16 12 9 19"})}),H=a.ZP.span.withConfig({componentId:"sc-ea9ab539-9"})(["width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;color:",";svg{display:block;}html.su-plugin &{width:16px;height:16px;}@media (min-width:769px) and (max-width:1440px){width:16px;height:16px;}"],e=>{let{$c:t}=e;return null!=t?t:"#8a8b94"}),U=()=>(0,i.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,i.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h3.6a2 2 0 0 1 1.4.6L11.4 7H19a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"})}),Q=()=>(0,i.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,i.jsx)("path",{d:"M12 2.6 3.2 7v10L12 21.4 20.8 17V7z"}),(0,i.jsx)("path",{d:"M3.2 7 12 11.5 20.8 7"}),(0,i.jsx)("path",{d:"M12 11.5v9.9"})]}),$=()=>(0,i.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,i.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),(0,i.jsx)("path",{d:"M14 3v5h5"})]}),K=()=>(0,i.jsx)(H,{$c:"#d9a441","aria-label":"아카이브",children:(0,i.jsx)(U,{})}),V=e=>{let{su:t}=e;return t?(0,i.jsx)(H,{$c:"#6f5ce6","aria-label":"SketchUp 보드",children:(0,i.jsx)(Q,{})}):(0,i.jsx)(H,{$c:"#9498a3","aria-label":"웹 보드",children:(0,i.jsx)($,{})})},G=a.ZP.span.withConfig({componentId:"sc-ea9ab539-10"})(["flex:1;min-width:0;overflow-wrap:anywhere;word-break:break-word;line-height:1.3;"]),Y=a.ZP.div.withConfig({componentId:"sc-ea9ab539-11"})(["position:relative;padding-left:15px;display:",";&::before{content:'';position:absolute;left:14px;top:0;bottom:0;width:1px;background:#e5e5e5;pointer-events:none;}"],e=>{let{$open:t}=e;return t?"block":"none"}),q=(0,a.ZP)(O).withConfig({componentId:"sc-ea9ab539-12"})(["align-items:center;"]),J=a.ZP.div.withConfig({componentId:"sc-ea9ab539-13"})(["display:",";",""],e=>{let{$open:t}=e;return t?"block":"none"},e=>{let{$indent:t}=e;return t?"\n position: relative;\n padding-left: 15px;\n &::before {\n content: '';\n position: absolute;\n left: 14px;\n top: 0;\n bottom: 0;\n width: 1px;\n background: #e5e5e5;\n pointer-events: none;\n }\n ":""}),X=a.ZP.div.withConfig({componentId:"sc-ea9ab539-14"})(["display:flex;align-items:center;gap:6px;padding:3px 16px;border-radius:6px;user-select:none;cursor:",";opacity:",";background:",";&:hover{background:",";}html.su-plugin &,html.su-plugin & *{font-size:12px;}"],e=>{let{$draggable:t}=e;return t?"grab":"default"},e=>{let{$dragging:t}=e;return t?.45:1},e=>{let{$selected:t}=e;return t?"#e3f2fd":"transparent"},e=>{let{$selected:t}=e;return t?"#e3f2fd":"#eef0f3"}),ee=a.ZP.span.withConfig({componentId:"sc-ea9ab539-15"})(["flex:0 0 auto;width:6px;height:6px;margin-left:6px;border-radius:50%;background:#c3c6cf;"]),et=a.ZP.span.withConfig({componentId:"sc-ea9ab539-16"})(["flex:0 1 auto;min-width:0;color:#a0a1aa;overflow-wrap:anywhere;word-break:break-word;"]),en=a.ZP.span.withConfig({componentId:"sc-ea9ab539-17"})(["color:#222;"]),ei=a.ZP.div.withConfig({componentId:"sc-ea9ab539-18"})(["padding:3px 16px;color:#a0a1aa;font-size:12px;"]),eo=a.ZP.span.withConfig({componentId:"sc-ea9ab539-19"})(["flex:0 0 auto;margin-left:auto;padding-left:8px;display:inline-flex;align-items:center;color:#6f5ce6;"]),er=(0,a.F4)(["0%,100%{transform:scale(1);filter:drop-shadow(0 0 1px rgba(13,153,255,0.95)) drop-shadow(0 0 2px rgba(13,153,255,0.55));}50%{transform:scale(1.18);filter:drop-shadow(0 0 5px rgba(13,153,255,1)) drop-shadow(0 0 10px rgba(13,153,255,0.9));}"]),el=a.ZP.span.withConfig({componentId:"sc-ea9ab539-20"})(["flex:0 0 auto;padding-left:6px;display:inline-flex;align-items:center;color:#6f5ce6;",""],e=>{let{$live:t}=e;return t&&(0,a.iv)(["color:#0d99ff;transform-origin:center;animation:"," 1.2s ease-in-out infinite;@media (prefers-reduced-motion:reduce){animation:none;filter:drop-shadow(0 0 3px rgba(13,153,255,0.95));}"],er)}),ea=a.ZP.div.withConfig({componentId:"sc-ea9ab539-21"})(["height:2px;background:#413d7d;border-radius:2px;margin:1px 8px;box-shadow:0 0 0 2px rgba(65,61,125,0.15);"]),ed=a.ZP.input.withConfig({componentId:"sc-ea9ab539-22"})(["flex:1;min-width:0;user-select:text;-webkit-user-select:text;cursor:text;border:1px solid #413d7d;border-radius:6px;padding:3px 6px;font-size:inherit;font-family:inherit;"]),es=a.ZP.div.withConfig({componentId:"sc-ea9ab539-23"})(["position:absolute;z-index:3200;background:#fff;border:1px solid #dcdde3;border-radius:11px;box-shadow:0 12px 32px rgba(18,19,26,0.2);padding:6px;min-width:180px;button{display:flex;align-items:center;gap:9px;width:100%;border:0;background:none;border-radius:8px;padding:4px 11px;font-size:12.5px;color:#3d3e47;text-align:left;cursor:pointer;font-family:inherit;&:hover{background:#f7f8fa;}&.danger{color:#c4554d;}}"]),ec=a.ZP.div.withConfig({componentId:"sc-ea9ab539-24"})(["height:1px;background:#ebecf0;margin:2px 6px;"]),eu=e=>null!=e.boardId?{kind:"board",boardId:e.boardId}:null!=e.projectId?{kind:"folder",projectId:e.projectId}:{kind:"root"};function ep(){var e,t,n,a,k,P;let{pickerMode:Z=!1,selectedBoardId:A=null,onPickBoard:N,selectedFolderId:B=null,onPickFolder:H}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},U=(0,r.useRouter)(),Q=(0,r.usePathname)(),$=(0,r.useSearchParams)(),er=(0,l.Zl)(s.WL),[ep,ef]=(0,l.FV)(u.V),[eh,eg]=(0,l.FV)(p.X),{data:em}=(0,v.pg)(),{createProject:ex,moveProject:ev,reorderContainer:eb,renameProject:ew,deleteProject:ey,leaveProject:ej,deleteRoom:eI,moveBoard:eC,moveProduct:ek,copyProduct:eP,reorderProducts:eS,unplaceProduct:eZ}=(0,v.S)(),eA=(0,C.useQueryClient)(),{updateBoard:eE}=(0,y.Z)({onError:e=>d.Am.error(e||"이름 변경에 실패했습니다."),onSuccess:()=>eA.invalidateQueries(v.ow)}),{mutate:ez}=(0,j.Z)({onSuccess:()=>{eA.invalidateQueries(v.ow)},onError:e=>d.Am.error(e||"삭제에 실패했습니다.")}),eM=(0,o.useMemo)(()=>{var e;return null!==(e=null==em?void 0:em.projects)&&void 0!==e?e:[]},[em]),eD=(0,o.useMemo)(()=>{var e;return null!==(e=null==em?void 0:em.rootBoards)&&void 0!==e?e:[]},[em]),eL=(0,o.useMemo)(()=>{var e;return null!==(e=eD.find(e=>e.isDefault))&&void 0!==e?e:null},[eD]),eN=(0,o.useMemo)(()=>eD.filter(e=>!e.isDefault),[eD]),eR=(0,v.pW)({root:!0}),eF=(0,v.pW)({boardId:null==eL?void 0:eL.id},{enabled:!!eL}),eT=(0,o.useMemo)(()=>{var e;let t=(null!==(e=null==$?void 0:$.get("project"))&&void 0!==e?e:"").trim(),n=Number(t);return t&&Number.isFinite(n)?n:null},[$]),eB=(0,o.useMemo)(()=>{var e;let t=(null!==(e=null==$?void 0:$.get("board"))&&void 0!==e?e:"").trim(),n=Number(t);return t&&Number.isFinite(n)?n:null},[$]),[eO,eW]=(0,o.useState)(250),e_=(0,o.useRef)(null),[eH,eU]=(0,o.useState)({}),eQ=function(e){var t;let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return null!==(t=eH[e])&&void 0!==t?t:n},e$=(0,w.Z)(),[eK,eV]=(0,o.useState)(null),eG=(0,o.useRef)(null),[eY,eq]=(0,o.useState)([]),[eJ,eX]=(0,o.useState)(null),[e0,e1]=(0,o.useState)(null),e2=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!eJ)return;let e=e=>{let t=e.target;e2.current&&e2.current.contains(t)||eX(null)},t=()=>eX(null);return document.addEventListener("mousedown",e,!0),document.addEventListener("scroll",t,!0),()=>{document.removeEventListener("mousedown",e,!0),document.removeEventListener("scroll",t,!0)}},[eJ]);let[e6,e8]=(0,o.useState)(null),[e4,e5]=(0,o.useState)(null),[e3,e9]=(0,o.useState)(null),[e7,te]=(0,o.useState)(null),[tt,tn]=(0,o.useState)(null),[ti,to]=(0,o.useState)(null),[tr,tl]=(0,o.useState)(null),[ta,td]=(0,o.useState)(null),[ts,tc]=(0,o.useState)(null),tu=()=>{e8(null),e5(null),e9(null),to(null),tl(null),td(null),te(null),tn(null)},tp=()=>{let e=document.querySelector("[data-board-scroll]");null==e||e.scrollTo({top:0,behavior:"auto"}),window.scrollTo(0,0)},tf=(0,o.useCallback)((e,t)=>{var n;if(Z){null!=t&&(null==N||N(t));return}tp();let i=new URLSearchParams(null!==(n=null==$?void 0:$.toString())&&void 0!==n?n:"");e?i.set("project",String(e)):i.delete("project"),t?i.set("board",String(t)):i.delete("board");let o=i.toString();U.push(o?"".concat(Q,"?").concat(o):null!=Q?Q:"/board",{scroll:!0})},[U,Q,$,Z,N]),th=(0,o.useRef)(null),tg=e=>{let t=th.current;if(!t)return{x:e.clientX,y:e.clientY};let n=t.getBoundingClientRect(),i=t.offsetWidth?n.width/t.offsetWidth:1;return{x:(e.clientX-n.left)/(i||1),y:(e.clientY-n.top)/(i||1)}},tm=(0,o.useMemo)(()=>{let e=[],t=n=>{for(let o of n){var i;e.push(o),(null===(i=o.children)||void 0===i?void 0:i.length)&&t(o.children)}};return t(eM),e},[eM]),tx=(0,o.useMemo)(()=>new Map(tm.map(e=>[e.id,e])),[tm]),tv=e=>{var t,n;return null==e?eM:null!==(n=null===(t=tx.get(e))||void 0===t?void 0:t.children)&&void 0!==n?n:[]},tb=e=>{var t,n,i,o;let r=[],l=null!==(n=null===(t=tx.get(e))||void 0===t?void 0:t.parentId)&&void 0!==n?n:null;for(;null!=l;)r.push("p".concat(l)),l=null!==(o=null===(i=tx.get(l))||void 0===i?void 0:i.parentId)&&void 0!==o?o:null;return r},tw=(e,t)=>eU(()=>{let n={[e]:!0};if(e.startsWith("p"))for(let t of tb(Number(e.slice(1))))n[t]=!0;else if(e.startsWith("b")&&null!=t)for(let e of(n["p".concat(t)]=!0,tb(t)))n[e]=!0;return n}),ty=e=>eU(t=>({...t,[e]:!1})),tj=(0,o.useMemo)(()=>{var e;let t=new Map;for(let n of(t.set("root",eN),tm))t.set("p".concat(n.id),null!==(e=n.boards)&&void 0!==e?e:[]);return t},[tm,eN]),tI=e=>"root"===e?{projectId:null,roomId:null}:{projectId:Number(e.slice(1)),roomId:null},tC=e=>{var t,n;return null!==(n=null===(t=Array.from(tj.values()).reduce((e,t)=>e.concat(t),[]).find(t=>t.id===e))||void 0===t?void 0:t.projectId)&&void 0!==n?n:null},tk=async(e,t)=>{let n=0;for(let i=0;i0&&d.Am.error("".concat(n,"개는 옮기지 못했습니다(기본 내보드 등)."),{position:"bottom-center",autoClose:2500})},tP=e=>{let t=[...eY];ex.mutate(null!=e?{name:"아카이브",parentId:e}:"아카이브",{onSuccess:async n=>{var i;let o=null==n?void 0:null===(i=n.data)||void 0===i?void 0:i.id;o&&(eU(t=>({...t,...null!=e?{["p".concat(e)]:!0}:{},["p".concat(o)]:!0})),t.length>1&&await tk({projectId:o,roomId:null},t),eq([]),eV({kind:"prj",id:o,blank:!0}))}})},[tS,tZ]=(0,l.FV)(c.H),tA=(0,o.useRef)(0);(0,o.useEffect)(()=>{var e;!Z&&tS&&tS.nonce!==tA.current&&(tA.current=tS.nonce,tP(null!==(e=tS.projectId)&&void 0!==e?e:void 0),tZ(null))},[tS]);let tE=async(e,t,n)=>{var i,o,r,l;let a=tI(t),d=null!==(i=tj.get(t))&&void 0!==i?i:[],s=null!==(o=d.find(t=>t.id===e))&&void 0!==o?o:Array.from(tj.values()).reduce((e,t)=>e.concat(t),[]).find(t=>t.id===e);if(!s)return tu();let c=eY.includes(e)&&eY.length>1?eY:[e],u=Array.from(tj.values()).reduce((e,t)=>e.concat(t),[]),p=c.map(e=>u.find(t=>t.id===e)).filter(Boolean);p.length||p.push(s);let f=new Set(p.map(e=>e.id)),h=d.filter(e=>!f.has(e.id)),g=Math.max(0,Math.min(n,h.length)),m=[...h.slice(0,g),...p,...h.slice(g)];tu(),eq([]);for(let e=0;e{var n;let i=null!==(n=tj.get(t))&&void 0!==n?n:[];tE(e,t,i.length)},tM=(e,t)=>{let n=tx.get(e),i=0;for(;n&&null!=n.parentId&&i<50;){if(n.parentId===t)return!0;n=tx.get(n.parentId),i+=1}return!1},tD=e=>"folder"===e?0:"board"===e?1:2,tL=(e,t)=>{var n,i,o;let r=(e,t,n)=>{var i;return{kind:"product",id:e.id,orderIndex:null!==(i=e.orderIndex)&&void 0!==i?i:0,leaf:e,loc:t,productBoardId:n}};if("root"===t){let e=(null!==(n=eR.data)&&void 0!==n?n:[]).map(e=>r(e,{root:!0}));if(eL)for(let t of null!==(i=eF.data)&&void 0!==i?i:[])e.push(r(t,{boardId:eL.id},eL.id));return e}return(null!==(o=t$[t])&&void 0!==o?o:[]).map(t=>r(t,{projectId:null!=e?e:void 0}))},tN=(e,t)=>{var n;return[...tv(e).map(e=>{var t;return{kind:"folder",id:e.id,orderIndex:null!==(t=e.orderIndex)&&void 0!==t?t:0}}),...(null!==(n=tj.get(t))&&void 0!==n?n:[]).map(e=>{var t;return{kind:"board",id:e.id,orderIndex:null!==(t=e.orderIndex)&&void 0!==t?t:0}}),...tL(e,t)].sort((e,t)=>e.orderIndex-t.orderIndex||tD(e.kind)-tD(t.kind)||e.id-t.id)},tR=(e,t)=>{var n,i,o;if(null!=e6)return(null!==(i=tj.get(t))&&void 0!==i?i:[]).some(e=>e.id===e6);if(null!=e7)return(null!==(o=null===(n=tx.get(e7))||void 0===n?void 0:n.parentId)&&void 0!==o?o:null)===e;if(null!=ti){let n=ti.loc;return"root"===t?!!n.root||!!eL&&n.boardId===eL.id:n.projectId===e}return!1},tF=async(e,t)=>{let n;let i=tI(e).projectId,o=tN(i,e);if(null!=e6)n=(eY.includes(e6)&&eY.length>1?eY:[e6]).map(e=>({kind:"board",id:e,orderIndex:0}));else if(null!=e7)n=[{kind:"folder",id:e7,orderIndex:0}];else if(null!=ti)n=[{kind:"product",id:ti.productId,orderIndex:0,productBoardId:eL&&ti.loc.boardId===eL.id?eL.id:void 0}];else{tu();return}tu(),eq([]);let r=e=>"".concat(e.kind,"-").concat(e.id),l=new Set(n.map(r)),a=o.filter(e=>!l.has(r(e))),d=Math.max(0,Math.min(t,a.length)),s=[...a.slice(0,d),...n,...a.slice(d)];try{await eb.mutateAsync({projectId:i,items:s.map(e=>({kind:e.kind,id:e.id,..."product"===e.kind&&null!=e.productBoardId?{boardId:e.productBoardId}:{}}))}),"root"===e?eA.invalidateQueries("tree-leaves"):tq(e,{projectId:null!=i?i:void 0})}catch(e){}},tT=(e,t)=>{if(null!=e6){tz(e6,t);return}if(null!=e7){if(tu(),e===e7||null!=e&&tM(e,e7))return;ev.mutateAsync({projectId:e7,parentId:e}).catch(()=>void 0);return}null!=ti&&ne("root"===t?{root:!0}:{projectId:null!=e?e:void 0})},tB=async(e,t)=>{if(tu(),!(e===t||tM(t,e)))try{await ev.mutateAsync({projectId:e,parentId:t})}catch(e){}},tO=null!==(n=null==e$?void 0:e$.id)&&void 0!==n?n:null,tW=e=>null==tO||e.ownerId===tO,t_=e=>e.isOwner,tH=!Z&&null!=ep,tU=e=>Z?A===e:!tH&&eB===e,tQ=e=>{var t,n;return null!==(n=null===(t=e.members.find(t=>t.companyId===e.ownerId))||void 0===t?void 0:t.name)&&void 0!==n?n:"다른 사용자"},[t$,tK]=(0,o.useState)({}),[tV,tG]=(0,o.useState)({}),tY=(e,t)=>{var n,i;if(!((null!==(i=null===(n=t$[e])||void 0===n?void 0:n.length)&&void 0!==i?i:0)>0)&&!tV[e]){if(void 0!==t$[e]){(0,v.fW)(t).then(t=>tK(n=>({...n,[e]:t}))).catch(()=>{});return}tG(t=>({...t,[e]:!0})),(0,v.fW)(t).then(t=>tK(n=>({...n,[e]:t}))).catch(()=>tK(t=>({...t,[e]:[]}))).finally(()=>tG(t=>({...t,[e]:!1})))}},tq=(e,t)=>{tG(t=>({...t,[e]:!0})),(0,v.fW)(t).then(t=>tK(n=>({...n,[e]:t}))).catch(()=>{}).finally(()=>tG(t=>({...t,[e]:!1})))},tJ=(e,t)=>{(0,v.fW)(t).then(t=>tK(n=>({...n,[e]:t}))).catch(()=>{})};(0,o.useEffect)(()=>{let e=new Map;for(let t of Object.keys(t$))t.startsWith("b")?e.set(t,{boardId:Number(t.slice(1))}):t.startsWith("p")&&e.set(t,{projectId:Number(t.slice(1))});for(let[t,n]of Object.entries(eH))n&&(t.startsWith("b")?e.set(t,{boardId:Number(t.slice(1))}):t.startsWith("p")&&e.set(t,{projectId:Number(t.slice(1))}));if(null!=eB&&e.set("b".concat(eB),{boardId:eB}),null!=eT&&e.set("p".concat(eT),{projectId:eT}),0===e.size)return;let t=window.setInterval(()=>{e.forEach((e,t)=>tJ(t,e))},4e3);return()=>window.clearInterval(t)},[eH,eB,eT]);let tX=e=>null!=e.boardId?"b".concat(e.boardId):null!=e.projectId?"p".concat(e.projectId):"root",t0=(0,l.sJ)(f.O),t1=(0,l.sJ)(h.Z),t2=(0,l.sJ)(g.Z),t6=(0,l.sJ)(m.Z),t8=(0,o.useMemo)(()=>(0,x.oZ)(eM,eD,t2,t6,t1),[eM,eD,t2,t6,t1]),t4=(0,o.useMemo)(()=>(0,x.Eh)(eM,eD,t2,t6,t1),[eM,eD,t2,t6,t1]);(0,o.useEffect)(()=>{var e,t,n,i,o,r;if(!t0||Z)return;let l=null!=t0.productId,a=null!==(e=t0.projectId)&&void 0!==e?e:null,d=null!==(t=t0.boardId)&&void 0!==t?t:null,s={};if(null!=d){if(eL&&d===eL.id)d=null;else{let e=Array.from(tj.values()).reduce((e,t)=>e.concat(t),[]).concat(eD).find(e=>e.id===d);(null==e?void 0:e.projectId)&&(a=e.projectId),l&&(s["b".concat(d)]=!0,tY("b".concat(d),{boardId:d}))}}if(null!=a){s["p".concat(a)]=!0,tY("p".concat(a),{projectId:a});let e=null!==(i=null===(n=tx.get(a))||void 0===n?void 0:n.parentId)&&void 0!==i?i:null;for(;null!=e;)s["p".concat(e)]=!0,e=null!==(r=null===(o=tx.get(e))||void 0===o?void 0:o.parentId)&&void 0!==r?r:null}eU(s)},[null==t0?void 0:t0.n]),(0,o.useEffect)(()=>{var e,t,n,i,o,r;if(Z)return;let l=null;if(null==eB||eL&&eB===eL.id?null!=eT&&(l=null!==(i=null===(n=tx.get(eT))||void 0===n?void 0:n.parentId)&&void 0!==i?i:null):l=null!==(t=null===(e=Array.from(tj.values()).reduce((e,t)=>e.concat(t),[]).concat(eD).find(e=>e.id===eB))||void 0===e?void 0:e.projectId)&&void 0!==t?t:null,null==l)return;let a={},d=l;for(;null!=d;)a["p".concat(d)]=!0,d=null!==(r=null===(o=tx.get(d))||void 0===o?void 0:o.parentId)&&void 0!==r?r:null;eU(e=>Object.keys(a).some(t=>!e[t])?{...e,...a}:e)},[eB,eT,em]);let t5=e=>!!e.root||null!=e.boardId&&e.boardId===(null==eL?void 0:eL.id),t3=e=>{if(t5(e)){eA.invalidateQueries("tree-leaves");return}tq(tX(e),{boardId:e.boardId,projectId:e.projectId,root:e.root})},t9=(e,t)=>{let n=eu(t);eZ.mutate({productId:e,...n},{onSuccess:()=>t3(t)})},t7=(e,t)=>{var n,i,o,r;let l=eu(e),a=eu(t);return l.kind===a.kind&&(null!==(n=l.boardId)&&void 0!==n?n:null)===(null!==(i=a.boardId)&&void 0!==i?i:null)&&(null!==(o=l.projectId)&&void 0!==o?o:null)===(null!==(r=a.projectId)&&void 0!==r?r:null)},ne=e=>{if(tu(),!ti||t7(ti.loc,e))return;let t=eu(ti.loc),n=eu(e);ek.mutate({productId:ti.productId,fromKind:t.kind,fromBoardId:t.boardId,fromProjectId:t.projectId,toKind:n.kind,toBoardId:n.boardId,toProjectId:n.projectId},{onSuccess:t=>{var n;if(null==t?void 0:null===(n=t.data)||void 0===n?void 0:n.duplicate){d.Am.error("이미 담긴 제품입니다.",{position:"bottom-center",autoClose:2e3});return}t3(ti.loc),t3(e),null!=e.boardId?eU(t=>({...t,["b".concat(e.boardId)]:!0})):null!=e.projectId&&eU(t=>({...t,["p".concat(e.projectId)]:!0}))}})},nt=e=>{if(eg(null),tu(),!eh||t7(eh.from,e))return;let t=eu(eh.from),n=eu(e);ek.mutate({productId:eh.productId,fromKind:t.kind,fromBoardId:t.boardId,fromProjectId:t.projectId,toKind:n.kind,toBoardId:n.boardId,toProjectId:n.projectId},{onSuccess:t=>{var n;if(null==t?void 0:null===(n=t.data)||void 0===n?void 0:n.duplicate){d.Am.error("이미 담긴 제품입니다.",{position:"bottom-center",autoClose:2e3});return}t3(eh.from),t3(e),null!=e.boardId?eU(t=>({...t,["b".concat(e.boardId)]:!0})):null!=e.projectId&&eU(t=>({...t,["p".concat(e.projectId)]:!0}))}})},nn=(e,t,n,i)=>{var o,r,l;if(tu(),t===n)return;let a=tX(e),d=(e.root?null!==(o=eR.data)&&void 0!==o?o:[]:eL&&e.boardId===eL.id?null!==(r=eF.data)&&void 0!==r?r:[]:null!==(l=t$[a])&&void 0!==l?l:[]).map(e=>e.id).filter(e=>e!==t),s=d.indexOf(n);s<0&&(s=d.length),i&&(s+=1),d=[...d.slice(0,s),t,...d.slice(s)],eS.mutate(null!=e.boardId?{kind:"board",boardId:e.boardId,orderedProductIds:d}:e.root?{kind:"root",orderedProductIds:d}:{kind:"folder",projectId:e.projectId,orderedProductIds:d},{onSuccess:()=>t3(e)})},ni=e=>{if(tc(null),eX(null),!ts)return;let t=eu(e);eP.mutate({productId:ts.productId,...t},{onSuccess:t=>{var n;if((null==t?void 0:null===(n=t.data)||void 0===n?void 0:n.added)===!1){d.Am.error("이미 담긴 제품입니다.",{position:"bottom-center",autoClose:2e3});return}t3(e),null!=e.boardId?eU(t=>({...t,["b".concat(e.boardId)]:!0})):null!=e.projectId&&eU(t=>({...t,["p".concat(e.projectId)]:!0}))}})},no=(e,t)=>{if(!Z){if(null!=t.boardId){if(eL&&t.boardId===eL.id)tf(null,null);else{var n,i;let e=null!==(n=Array.from(tj.values()).reduce((e,t)=>e.concat(t),[]).find(e=>e.id===t.boardId))&&void 0!==n?n:null;tf(null!==(i=null==e?void 0:e.projectId)&&void 0!==i?i:null,t.boardId)}}else null!=t.projectId?tf(t.projectId,null):tf(null,null);ef({productId:e,key:tX(t)}),(0,b.kT)()&&(0,b.h)(e)}},nr=(e,t,n)=>{let r=e.category||"",l=tX(t),a=(null==ta?void 0:ta.key)===l&&ta.targetId===e.id&&!ta.after,d=(null==ta?void 0:ta.key)===l&&ta.targetId===e.id&&ta.after,s=n=>{if(null==ti||!t7(ti.loc,t)||ti.productId===e.id)return null;n.preventDefault(),n.stopPropagation();let i=n.currentTarget.getBoundingClientRect();return n.clientY>i.top+i.height/2};return(0,i.jsxs)(o.Fragment,{children:[!n&&a&&(0,i.jsx)(ea,{}),(0,i.jsxs)(X,{"data-leaf-id":e.id,title:e.name,$draggable:!0,$dragging:(null==ti?void 0:ti.productId)===e.id,$selected:!Z&&(null==ep?void 0:ep.productId)===e.id&&(null==ep?void 0:ep.key)===tX(t),draggable:!0,onDragStart:n=>{to({productId:e.id,loc:t,su:!!e.su}),n.dataTransfer.effectAllowed="move",n.dataTransfer.setData("text/plain",String(e.id))},onDragEnd:tu,onDragOver:i=>{if(n){if(null!=ti||null!=e7||null!=e6||null!=eh){i.preventDefault(),i.stopPropagation(),i.dataTransfer.dropEffect="move";let e=i.currentTarget.getBoundingClientRect(),t=i.clientY>e.top+e.height/2;tl(null),e5(null),tn(null),e9({parent:n.containerKey,index:n.index+(t?1:0)})}return}let o=s(i);if(null!==o){tl(null),td({key:l,targetId:e.id,after:o});return}if(null!=ti&&!t7(ti.loc,t)||null!=eh){i.preventDefault(),i.stopPropagation(),i.dataTransfer.dropEffect="move";let t=i.currentTarget.getBoundingClientRect();td({key:l,targetId:e.id,after:i.clientY>t.top+t.height/2})}},onDrop:i=>{if(n){let e=i.currentTarget.getBoundingClientRect(),t=i.clientY>e.top+e.height/2,r=n.index+(t?1:0);if(null!=eh){var o;i.preventDefault(),i.stopPropagation(),nt("root"===n.containerKey?{root:!0}:{projectId:null!==(o=n.parentId)&&void 0!==o?o:void 0});return}(null!=ti||null!=e7||null!=e6)&&(i.preventDefault(),i.stopPropagation(),tR(n.parentId,n.containerKey)?tF(n.containerKey,r):tT(n.parentId,n.containerKey));return}let r=s(i);if(null!==r){nn(t,ti.productId,e.id,r);return}if(null!=ti&&!t7(ti.loc,t)){i.preventDefault(),i.stopPropagation(),ne(t);return}if(null!=eh){i.preventDefault(),i.stopPropagation(),nt(t);return}},onClick:n=>{n.stopPropagation(),no(e.id,t)},onContextMenu:n=>{n.preventDefault(),n.stopPropagation(),eX({kind:"leaf",productId:e.id,loc:t,su:!!e.su,name:e.name,...tg(n)})},children:[(0,i.jsx)(ee,{}),(0,i.jsxs)(et,{children:[r&&(0,i.jsxs)(en,{children:[r," / "]}),e.name]}),e.su&&(0,i.jsx)(eo,{title:"SketchUp 연동 제품",children:(0,i.jsx)(I,{})})]}),!n&&d&&(0,i.jsx)(ea,{})]},"leaf-".concat(e.id))},nl=e=>{var t,n;return(null!==(n=null===(t=t$[e])||void 0===t?void 0:t.length)&&void 0!==n?n:0)>0||!!tV[e]},na=(e,t)=>{var n,o,r;return(0,i.jsxs)(Y,{$open:!0,children:[(null!==(o=t$[e])&&void 0!==o?o:[]).map(e=>nr(e,t)),tV[e]&&(0,i.jsx)(ei,{children:"불러오는 중…"}),!tV[e]&&(null!==(r=null===(n=t$[e])||void 0===n?void 0:n.length)&&void 0!==r?r:0)===0&&(0,i.jsx)(ei,{children:"담긴 자재 없음"})]})},nd=(e,t,n)=>{var r,l;let a="b".concat(e.id),d=(null!==(r=e.productCount)&&void 0!==r?r:0)>0||nl(a),s=eQ(a,!1);return(0,i.jsxs)(o.Fragment,{children:[(0,i.jsxs)(q,{"data-tree-row":!0,"data-file-id":e.id,$on:tU(e.id),$live:t4.has(Number(e.id)),$sel:eY.includes(e.id),$drop:tr==="b".concat(e.id),$dragging:e6===e.id||null!=e6&&eY.length>1&&eY.includes(e.id),draggable:!((null==eK?void 0:eK.kind)==="file"&&eK.id===e.id),title:e.name,onDragStart:t=>{e8(e.id),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",String(e.id))},onDragEnd:tu,onDragOver:i=>{if(null==e6&&null==e7&&null==ti&&null==eh)return;i.preventDefault(),i.stopPropagation(),i.dataTransfer.dropEffect="move";let o=i.currentTarget.getBoundingClientRect(),r=(i.clientY-o.top)/o.height;(null!=ti||null!=eh)&&r>=.3&&r<=.7?(e9(null),e5(null),tn(null),tl("b".concat(e.id))):(tl(null),e5(null),tn(null),e9({parent:t,index:n+(r>.5?1:0)}))},onDrop:i=>{if(null==e6&&null==e7&&null==ti&&null==eh)return;if(i.preventDefault(),i.stopPropagation(),tr==="b".concat(e.id)){null!=ti?ne({boardId:e.id}):null!=eh&&nt({boardId:e.id});return}let o=i.currentTarget.getBoundingClientRect(),r=n+(i.clientY>o.top+o.height/2?1:0),l=tI(t).projectId;if(null!=eh){nt("root"===t?{root:!0}:{projectId:null!=l?l:void 0});return}tR(l,t)?tF(t,r):tT(l,t)},onClick:t=>{if(t.stopPropagation(),t.ctrlKey||t.metaKey){eq(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]);return}eq([]),Z||ef(null),d&&tU(e.id)&&(eQ(a,!1)?ty(a):(tw(a,e.projectId),tY(a,{boardId:e.id}))),tf(e.projectId,e.id)},onDoubleClick:t=>{t.stopPropagation(),tW(e)&&!e.projectGuid&&eV({kind:"file",id:e.id})},onContextMenu:n=>{n.preventDefault(),n.stopPropagation(),eY.includes(e.id)||eq([e.id]),eX({kind:"file",id:e.id,name:e.name,parentKey:t,...tg(n)})},children:[d?(0,i.jsx)(W,{$open:s,onClick:t=>{t.stopPropagation(),s?ty(a):(tw(a,e.projectId),tY(a,{boardId:e.id}))},children:(0,i.jsx)(_,{})}):(0,i.jsx)(W,{"aria-hidden":!0}),e.projectGuid?(0,i.jsx)(V,{su:!0}):(0,i.jsx)(K,{}),(null==eK?void 0:eK.kind)==="file"&&eK.id===e.id?(0,i.jsx)(ed,{autoFocus:!0,defaultValue:eK.blank?"":e.name,placeholder:e.name,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),onBlur:t=>{let n=t.target.value.trim();n&&n!==e.name&&eE(e.id,n),eV(null)},onKeyDown:e=>{"Enter"===e.key&&e.target.blur(),"Escape"===e.key&&eV(null)}}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(G,{children:e.name}),!!e.projectGuid&&(0,i.jsx)(el,{$live:t4.has(Number(e.id)),title:t4.has(Number(e.id))?"SketchUp 에서 지금 열려 연동 중인 파일":"SketchUp 연동 보드 — 이름은 SketchUp 파일명과 연동(이동은 가능)",children:(0,i.jsx)(I,{})})]})]}),((null!==(l=e.productCount)&&void 0!==l?l:0)>0||nl("b".concat(e.id)))&&eQ("b".concat(e.id),!1)&&na("b".concat(e.id),{boardId:e.id})]},"".concat(t,"-").concat(e.id))},ns=(()=>{if(!eJ||"blank"===eJ.kind)return!1;if("prj"===eJ.kind){let e=tx.get(eJ.id);return!!e&&t_(e)}if("room"===eJ.kind){let e=tx.get(eJ.projectId);return!!e&&t_(e)}if("leaf"===eJ.kind)return!1;let e=Array.from(tj.values()).reduce((e,t)=>e.concat(t),[]).find(e=>e.id===eJ.id);return!!e&&tW(e)})(),nc=(null==eJ?void 0:eJ.kind)==="file"&&!!(null===(P=Array.from(tj.values()).reduce((e,t)=>e.concat(t),[]).find(e=>e.id===eJ.id))||void 0===P?void 0:P.projectGuid),nu=(e,t,n)=>{let o="p".concat(e.id),r=eQ(o,!1),l=null!=e7&&e7!==e.id,a=tI(n).projectId,d=!((null==eK?void 0:eK.kind)==="prj"&&eK.id===e.id);return(0,i.jsxs)("div",{children:[(0,i.jsxs)(O,{"data-tree-row":!0,$on:Z?B===e.id:!tH&&eT===e.id&&null===eB,$live:t8.has(Number(e.id)),$drop:e4===o||tr===o||tt===e.id,draggable:d,onDragStart:t=>{d&&(t.stopPropagation(),te(e.id),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain","p".concat(e.id)))},onDragEnd:tu,onDragOver:i=>{if(null==e7&&null==e6&&null==ti&&null==eh||null!=e7&&!l)return;i.preventDefault(),i.stopPropagation(),i.dataTransfer.dropEffect="move";let r=i.currentTarget.getBoundingClientRect(),a=(i.clientY-r.top)/r.height;a<.3||a>.7?(tn(null),e5(null),tl(null),e9({parent:n,index:t+(a>.7?1:0)})):(e9(null),null!=e7?(e5(null),tl(null),tn(e.id)):null!=e6?(tn(null),tl(null),e5(o)):(tn(null),e5(null),tl(o)))},onDragLeave:()=>{e5(e=>e===o?null:e),tl(e=>e===o?null:e),tn(t=>t===e.id?null:t)},onDrop:i=>{if(null==e7&&null==e6&&null==ti&&null==eh)return;if(i.preventDefault(),i.stopPropagation(),tt===e.id||e4===o||tr===o){eU(e=>({...e,[o]:!0})),null!=e7?tB(e7,e.id):null!=e6?tz(e6,o):null!=ti?ne({projectId:e.id}):null!=eh&&nt({projectId:e.id});return}let r=i.currentTarget.getBoundingClientRect(),l=t+(i.clientY>r.top+r.height/2?1:0);if(null!=eh){nt("root"===n?{root:!0}:{projectId:null!=a?a:void 0});return}tR(a,n)?tF(n,l):tT(a,n)},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),eX({kind:"prj",id:e.id,...tg(t)})},onClick:()=>{var t,n;if(Z){null==H||H(e.id),eQ(o,!1)?ty(o):(tw(o),(null!==(t=e.productCount)&&void 0!==t?t:0)>0&&tY("p".concat(e.id),{projectId:e.id}));return}ef(null),eq([]),eQ(o,!1)?ty(o):(tw(o),(null!==(n=e.productCount)&&void 0!==n?n:0)>0&&tY("p".concat(e.id),{projectId:e.id})),tf(e.id,null)},onDoubleClick:t=>{t.stopPropagation(),t_(e)&&eV({kind:"prj",id:e.id})},children:[(0,i.jsx)(W,{$open:r,onClick:t=>{var n;t.stopPropagation(),eQ(o,!1)?ty(o):tw(o),(null!==(n=e.productCount)&&void 0!==n?n:0)>0&&tY("p".concat(e.id),{projectId:e.id})},children:(0,i.jsx)(_,{})}),(0,i.jsx)(K,{}),(null==eK?void 0:eK.kind)==="prj"&&eK.id===e.id?(0,i.jsx)(ed,{autoFocus:!0,defaultValue:eK.blank?"":e.name,placeholder:e.name,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),onBlur:t=>{let n=t.target.value.trim();n&&n!==e.name&&ew.mutate({projectId:e.id,name:n}),eV(null)},onKeyDown:e=>{"Enter"===e.key&&e.target.blur(),"Escape"===e.key&&eV(null)}}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(G,{title:e.name,children:e.name}),e.isSharedRoot&&(0,i.jsx)(F,{role:"button",$recv:e.isShared,title:e.isShared?"".concat(tQ(e),"님이 공유한 보드"):"내가 공유한 보드 \xb7 공유 설정",onClick:t=>{t.stopPropagation(),er(e.id)},children:e.isShared?"공유받음":"공유중"})]})]}),(0,i.jsxs)(Y,{$open:r,children:[np(e.id,o),tV["p".concat(e.id)]&&(0,i.jsx)(ei,{children:"불러오는 중…"})]})]},e.id)},np=(e,t)=>{var n;let r=tN(e,t),l=new Map((null!==(n=tj.get(t))&&void 0!==n?n:[]).map(e=>[e.id,e]));return(0,i.jsxs)(i.Fragment,{children:[r.map((n,r)=>(0,i.jsxs)(o.Fragment,{children:[(null==e3?void 0:e3.parent)===t&&e3.index===r&&(0,i.jsx)(ea,{}),"folder"===n.kind?nu(tx.get(n.id),r,t):"board"===n.kind?l.get(n.id)?nd(l.get(n.id),t,r):null:n.leaf?nr(n.leaf,n.loc,{containerKey:t,index:r,parentId:e}):null]},"".concat(n.kind,"-").concat(n.id))),(null==e3?void 0:e3.parent)===t&&e3.index===r.length&&(0,i.jsx)(ea,{})]})};return(0,i.jsxs)(E,{ref:th,$w:eO,$picker:Z,children:[(0,i.jsx)(D,{}),!Z&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(L,{role:"button",tabIndex:0,onClick:()=>U.push("/home"),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&U.push("/home")},title:"디지털 샘플실로 이동",children:"← 디지털 샘플실"}),(0,i.jsx)(R,{$on:!tH&&null===eT&&null===eB,role:"button",tabIndex:0,title:"My 아카이브 라이브러리 — 전체 보기",onClick:()=>{ef(null),eU({}),tf(null,null)},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(ef(null),eU({}),tf(null,null))},children:"My 아카이브 라이브러리"})]}),(0,i.jsx)(T,{ref:eG,onDragOver:e=>{if(null!=e7){e.preventDefault(),e.dataTransfer.dropEffect="move",tn(null),e9({parent:"root",index:tN(null,"root").length});return}if(null!=ti||null!=eh){e.preventDefault(),e.dataTransfer.dropEffect="move",e9(null),tl("root");return}null!=e6&&(e.preventDefault(),e.dataTransfer.dropEffect="move",e5(null),e9({parent:"root",index:eN.length}))},onDrop:e=>{if(null!=e7){var t;e.preventDefault(),tF("root",null!==(t=null==e3?void 0:e3.index)&&void 0!==t?t:tN(null,"root").length);return}if(null!=ti){e.preventDefault(),ne({root:!0});return}if(null!=eh){e.preventDefault(),nt({root:!0});return}null!=e6&&(e.preventDefault(),tE(e6,"root",eN.length))},onContextMenu:e=>{e.preventDefault(),eX({kind:"blank",...tg(e)})},children:(0,i.jsx)(J,{$open:!0,children:np(null,"root")})}),Z&&(0,i.jsxs)(z,{children:[(0,i.jsx)("button",{type:"button",onClick:()=>{let e;if(null!=B)e=B;else if(null!=A){var t,n;e=null!==(n=null===(t=Array.from(tj.values()).reduce((e,t)=>e.concat(t),[]).find(e=>e.id===A))||void 0===t?void 0:t.projectId)&&void 0!==n?n:void 0}tP(e)},children:"+ 아카이브 추가"}),(0,i.jsx)("button",{type:"button",onClick:()=>U.push("/board"),children:"My 아카이브 이동"})]}),!Z&&(0,i.jsx)(M,{ref:e_,onPointerDown:e=>{var t;e.preventDefault();let n=e.clientX;null===(t=e_.current)||void 0===t||t.classList.add("drag"),document.body.classList.add("mcd-tree-resizing");try{e.currentTarget.setPointerCapture(e.pointerId)}catch(e){}let i=e=>eW(Math.max(250,Math.min(420,eO+e.clientX-n))),o=()=>{var e;null===(e=e_.current)||void 0===e||e.classList.remove("drag"),document.body.classList.remove("mcd-tree-resizing"),document.removeEventListener("pointermove",i),document.removeEventListener("pointerup",o)};document.addEventListener("pointermove",i),document.addEventListener("pointerup",o)},onDoubleClick:()=>eW(250),title:"드래그로 폭 조절 \xb7 더블클릭 초기화"}),eJ&&(0,i.jsxs)(es,{ref:e2,style:{left:Math.max(4,Math.min(eJ.x,(null!==(a=null===(e=th.current)||void 0===e?void 0:e.offsetWidth)&&void 0!==a?a:300)-190)),top:Math.max(4,Math.min(eJ.y,(null!==(k=null===(t=th.current)||void 0===t?void 0:t.offsetHeight)&&void 0!==k?k:420)-210))},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.preventDefault(),children:["leaf"===eJ.kind&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{type:"button",onClick:()=>{let{productId:e,name:t}=eJ;eX(null),tc({productId:e,name:t}),d.Am.info("복사됨 — 붙여넣을 폴더/보드를 우클릭하세요",{position:"bottom-center",autoClose:2e3})},children:"복사"}),(0,i.jsx)(ec,{}),(0,i.jsx)("button",{type:"button",onClick:()=>{var e;let t=eJ.loc;eX(null),tP(null!=t.projectId?t.projectId:null!=t.boardId&&null!==(e=tC(t.boardId))&&void 0!==e?e:void 0)},children:"아카이브 추가"}),!Z&&(0,i.jsx)("button",{type:"button",onClick:()=>{let e=eJ.productId,t=eJ.loc,n=(eJ.name||"아카이브").trim();if(eX(null),null!=t.projectId){er(t.projectId);return}if(null!=t.boardId){let e=t.boardId,i=tC(e);if(null!=i){er(i);return}ex.mutate({name:n},{onSuccess:async t=>{var n;let i=null==t?void 0:null===(n=t.data)||void 0===n?void 0:n.id;i&&(await eC.mutateAsync({boardId:e,projectId:i,roomId:null}),er(i))}});return}ex.mutate({name:n},{onSuccess:async t=>{var n;let i=null==t?void 0:null===(n=t.data)||void 0===n?void 0:n.id;i&&(await ek.mutateAsync({productId:e,fromKind:"root",toKind:"folder",toProjectId:i}),er(i))}})},children:"공유하기"}),(0,i.jsx)(ec,{}),(0,i.jsx)("button",{type:"button",className:"danger",onClick:()=>{let e=eJ.productId,t=eJ.loc,n=eJ.su,i=eJ.name;eX(null),e1({title:n?"스케치업 파일과 연동 제품 1개가 있습니다. 정말 삭제하시겠습니까?":'"'.concat(i,'"을(를) 삭제하시겠습니까?'),confirmLabel:"삭제",onConfirm:()=>t9(e,t)})},children:"삭제"})]}),ts&&("prj"===eJ.kind||"file"===eJ.kind||"blank"===eJ.kind)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{type:"button",onClick:()=>ni("prj"===eJ.kind?{projectId:eJ.id}:"file"===eJ.kind?{boardId:eJ.id}:{root:!0}),children:"여기에 붙여넣기"}),(0,i.jsx)(ec,{})]}),("prj"===eJ.kind||"blank"===eJ.kind||"file"===eJ.kind)&&(0,i.jsx)("button",{type:"button",onClick:()=>{var e;let t="prj"===eJ.kind?eJ.id:"file"===eJ.kind&&null!==(e=tI(eJ.parentKey).projectId)&&void 0!==e?e:void 0;eX(null),tP(t)},children:eY.length>1?"아카이브 추가 (".concat(eY.length,"개 담기)"):"아카이브 추가"}),!Z&&("prj"===eJ.kind||"file"===eJ.kind)&&ns&&(0,i.jsx)("button",{type:"button",onClick:()=>{if(eX(null),"prj"===eJ.kind){er(eJ.id);return}let e=tI(eJ.parentKey).projectId;if(null!=e){er(e);return}ex.mutate({name:(eJ.name||"아카이브").trim()},{onSuccess:async e=>{var t;let n=null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.id;n&&(await eC.mutateAsync({boardId:eJ.id,projectId:n,roomId:null}),er(n))}})},children:"공유하기"}),"blank"!==eJ.kind&&"leaf"!==eJ.kind&&ns&&!nc&&(0,i.jsx)("button",{type:"button",onClick:()=>{"prj"===eJ.kind?(eU(e=>({...e,["p".concat(eJ.id)]:!0})),eV({kind:"prj",id:eJ.id})):"room"===eJ.kind?eV({kind:"room",id:eJ.id}):eV({kind:"file",id:eJ.id}),eX(null)},children:"이름 변경"}),"blank"!==eJ.kind&&"leaf"!==eJ.kind&&ns&&(0,i.jsx)(ec,{}),"blank"!==eJ.kind&&"leaf"!==eJ.kind&&ns&&(0,i.jsx)("button",{type:"button",className:"danger",onClick:()=>{if("prj"===eJ.kind){var e,t;let n=eJ.id,i=tx.get(n),o=Math.max(0,(null!==(e=null==i?void 0:i.memberCount)&&void 0!==e?e:1)-1);e1({title:'"'.concat(null!==(t=null==i?void 0:i.name)&&void 0!==t?t:"",'" 아카이브를 삭제할까요?'),lines:o>0?["안의 항목은 삭제되지 않고 상위로 나옵니다.","멤버 ".concat(o,"명과의 공유가 해제되고, 이 아카이브에 남긴 의견도 함께 정리됩니다.")]:["안의 항목은 삭제되지 않고 상위로 나옵니다."],confirmLabel:"삭제",onConfirm:()=>{ey.mutate(n),eT===n&&tf(null,null)}})}else if("room"===eJ.kind)eI.mutate(eJ.id);else{let e=eJ.id,t=eJ.name;e1({title:'"'.concat(t,'" 을(를) 삭제할까요?'),confirmLabel:"삭제",onConfirm:()=>{ez(e),eB===e&&tf(eT,null)}})}eX(null)},children:"삭제"}),"prj"===eJ.kind&&(()=>{let e=tx.get(eJ.id);return!!e&&e.isShared})()&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec,{}),(0,i.jsx)("button",{type:"button",className:"danger",onClick:()=>{var e;let t=eJ.id,n=tx.get(t);e1({title:'"'.concat(null!==(e=null==n?void 0:n.name)&&void 0!==e?e:"",'" 공유에서 나갈까요?'),lines:["내 목록에서만 사라지고, 원본과 다른 멤버는 그대로 유지됩니다."],confirmLabel:"나가기",onConfirm:()=>{ej.mutate(t),eT===t&&tf(null,null)}}),eX(null)},children:"공유 나가기"})]})]}),e0&&(0,i.jsx)(S,{title:e0.title,lines:e0.lines,confirmLabel:e0.confirmLabel,onConfirm:e0.onConfirm,onClose:()=>e1(null)})]})}},31133:function(e,t,n){function i(e,t,n,i){var o,r,l;let a=(null!==(o=null==e?void 0:e.fileKey)&&void 0!==o?o:"").trim(),d=(null!=t?t:"").trim(),s=(null!=n?n:"").trim(),c=String(null!==(r=null==e?void 0:e.name)&&void 0!==r?r:"").trim();if(d&&a)return a===d&&(!s||c===s);let u=(null!=i?i:"").trim();return!!u&&(null!==(l=null==e?void 0:e.projectGuid)&&void 0!==l?l:"")===u&&(!s||c===s)}function o(e,t,n,o,r){let l=[],a=(e,t)=>{var d,s,c;let u=!!(null!==(d=null==e?void 0:e.isOwner)&&void 0!==d?d:t);for(let t of null!==(s=null==e?void 0:e.boards)&&void 0!==s?s:[])i(t,n,o,r)&&l.push({id:Number(t.id),owned:u});for(let t of null!==(c=null==e?void 0:e.children)&&void 0!==c?c:[])a(t,u)};for(let t of null!=e?e:[])a(t,!!(null==t?void 0:t.isOwner));for(let e of null!=t?t:[])i(e,n,o,r)&&l.push({id:Number(e.id),owned:!0});let d=l.some(e=>e.owned),s=new Set;for(let e of l)(!d||e.owned)&&s.add(e.id);return s}function r(e,t,n,o,r){let l=new Set,a=(null!=n?n:"").trim(),d=(null!=r?r:"").trim();if(!a&&!d)return l;let s=(null!=t?t:[]).some(e=>i(e,n,o,r)),c=e=>{var t,l;for(let a of((null==e?void 0:e.isOwner)&&(null!==(t=null==e?void 0:e.boards)&&void 0!==t?t:[]).some(e=>i(e,n,o,r))&&(s=!0),null!==(l=null==e?void 0:e.children)&&void 0!==l?l:[]))c(a)};for(let t of null!=e?e:[])c(t);let u=e=>{var t,a;let d=(!s||(null==e?void 0:e.isOwner))&&(null!==(t=null==e?void 0:e.boards)&&void 0!==t?t:[]).some(e=>i(e,n,o,r)),c=!1;for(let t of null!==(a=null==e?void 0:e.children)&&void 0!==a?a:[])u(t)&&(c=!0);return(!!d||!!c)&&(l.add(Number(e.id)),!0)};for(let t of null!=e?e:[])u(t);return l}n.d(t,{Eh:function(){return o},ON:function(){return i},oZ:function(){return r}})},64744:function(e,t,n){n.d(t,{Ap:function(){return s},JW:function(){return d},Qq:function(){return o},YZ:function(){return a},bW:function(){return r},h:function(){return l},kT:function(){return i}});let i=()=>!!window.sketchup||"undefined"!=typeof document&&document.documentElement.classList.contains("su-plugin"),o=e=>{try{var t,n,i;null===(i=window)||void 0===i||null===(n=i.sketchup)||void 0===n||null===(t=n.highlightProduct)||void 0===t||t.call(n,e)}catch(e){}},r=()=>{try{var e,t,n;null===(n=window)||void 0===n||null===(t=n.sketchup)||void 0===t||null===(e=t.clearHighlight)||void 0===e||e.call(t)}catch(e){}},l=e=>{try{var t,n,i;null===(i=window)||void 0===i||null===(n=i.sketchup)||void 0===n||null===(t=n.selectMaterial)||void 0===t||t.call(n,e)}catch(e){}},a=e=>{try{var t;let n=null===(t=window)||void 0===t?void 0:t.sketchup;if(!(null==n?void 0:n.setProductMeta))return;let i={};e.forEach(e=>{var t,n;let o=Number(null==e?void 0:e.id);Number.isFinite(o)&&0!==o&&(i[String(o)]={b:null!==(t=e.store)&&void 0!==t?t:"",c:[e.category,e.subCategory].filter(Boolean).join("/"),n:null!==(n=e.name)&&void 0!==n?n:"",p:"number"==typeof e.price?e.price:null})}),n.setProductMeta(JSON.stringify(i))}catch(e){}},d=()=>{try{var e,t,n;null===(n=window)||void 0===n||null===(t=n.sketchup)||void 0===t||null===(e=t.captureScenePicker)||void 0===e||e.call(t)}catch(e){}},s=()=>{try{var e,t,n;null===(n=window)||void 0===n||null===(t=n.sketchup)||void 0===t||null===(e=t.syncBoardNow)||void 0===e||e.call(t)}catch(e){}}},48615:function(e,t,n){var i=n(86484),o=n(29918),r=n(72044),l=n(43618),a=n(76904);t.Z=e=>{let{onError:t,onSuccess:n}=e,d=(0,i.useQueryClient)(),s=(0,r.Z)(),[c,u]=(0,l.FV)(a.Z),p=async(e,t)=>{let n=localStorage.getItem("TOKEN");if(!n)throw Error("로그인이 필요합니다.");return(await o.et.post("/cart/".concat(e),t,{headers:{Authorization:"Bearer ".concat(n)}})).data},{mutate:f,isLoading:h,error:g}=(0,i.useMutation)(e=>{let{productId:t,data:n}=e;return p(t,n)},{onError:e=>{var n;t(null===(n=e.response)||void 0===n?void 0:n.data.message)},onSuccess:e=>{d.invalidateQueries("cart/list"),u(e),n()}});return{addCart:(e,t)=>{s||f({productId:e,data:t})},loading:h,error:g}}},62691:function(e,t,n){var i=n(86484),o=n(29918),r=n(72044);let l=async e=>{let t=localStorage.getItem("TOKEN");if(!t)throw Error("로그인이 필요합니다.");return(await o.et.delete("/cart",{headers:{Authorization:"Bearer ".concat(t)},data:{productIds:e}})).data};t.Z=e=>{let{onSuccess:t,onError:n}=e;return(0,r.Z)(),(0,i.useMutation)(e=>l(e),{onSuccess:t,onError:e=>{var t;n((null===(t=e.response)||void 0===t?void 0:t.data.message)||"알 수 없는 오류가 발생했습니다.")}})}},1332:function(e,t,n){var i=n(2265),o=n(29918);t.Z=e=>{let{onError:t,onSuccess:n}=e;(0,i.useEffect)(()=>{o.Wg.get("category").then(e=>{n(JSON.parse(JSON.stringify(e.data)))}).catch(e=>{var n;console.error("Error fetching data:",e);let i=null==e?void 0:null===(n=e.response)||void 0===n?void 0:n.data;i?t([i.statusCode,i.message,i.error].filter(Boolean)):t([(null==e?void 0:e.message)||"Network error"])})},[])}},81431:function(e,t,n){n.d(t,{eN:function(){return l},i0:function(){return a},i_:function(){return r}});var i=n(29918);function o(){let e=localStorage.getItem("TOKEN");return e?(i.et.defaults.headers.common.Authorization="Bearer ".concat(e),i.et):i.Wg}async function r(e){let t={};return e.mainTask&&(t.mainTask=e.mainTask),null!=e.categoryId&&(t.categoryId=String(e.categoryId)),e.limit&&(t.limit=String(e.limit)),(await o().get("/coordinator/ranks",{params:t})).data}async function l(e){return(await o().get("/coordinator/space-type-categories",{params:e?{mainTask:e}:{}})).data}function a(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];e&&o().post("/coordinator/download-click",{productId:e,kind:t,blocked:n}).catch(()=>{})}},53652:function(e,t,n){n.d(t,{Kj:function(){return l}});var i,o,r,l,a=n(2265),d=n(29918);(i=r||(r={})).CREDIT="CREDIT",i.DEBIT="DEBIT",(o=l||(l={})).SAMPLE_REQUEST="SAMPLE_REQUEST",o.IMAGE_DOWNLOAD="IMAGE_DOWNLOAD",o.SPECBOOK_DOWNLOAD="SPECBOOK_DOWNLOAD",o.IMAGE_DOWNLOAD_SEAMLESS="IMAGE_DOWNLOAD_SEAMLESS",o.LINK_COMPANY="LINK_COMPANY",t.ZP=()=>{let[e,t]=(0,a.useState)([]),[n,i]=(0,a.useState)(!1),[o,r]=(0,a.useState)(null),[l,s]=(0,a.useState)(!0);return{pointHistory:e,loading:n,error:o,fetchPointHistory:(0,a.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=arguments.length>2?arguments[2]:void 0,l=arguments.length>3?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=localStorage.getItem("TOKEN");if(!c){r("로그인이 필요합니다.");return}i(!0),r(null);try{let i=new URLSearchParams;i.append("page",e.toString()),i.append("limit",n.toString()),o&&i.append("transactionType",o),l&&i.append("usageType",l);let{data:r}=await d.et.get("/points/history?".concat(i.toString()),{headers:{Authorization:"Bearer ".concat(c)}});a?t(r):t(e=>[...e,...r]),r.lengthlocalStorage.getItem("TOKEN"),a=e=>"".concat(e,"|").concat(l()?"auth":"anon");function d(e){let t=a(e),n=o.get(t);if(n){if(Date.now()-n.at>3e5){o.delete(t);return}return n.data}}function s(e){let t=a(e),n=d(e);if(n)return Promise.resolve(n);let s=r.get(t);if(s)return s;let c=l(),u=(c?i.et:i.Wg).post("/product/mytexture/detail",{id:e},c?{headers:{Authorization:"Bearer ".concat(c)}}:void 0).then(e=>{var n;let i=null!==(n=null==e?void 0:e.data)&&void 0!==n?n:{};return o.set(t,{data:i,at:Date.now()}),i}).finally(()=>{r.delete(t)});return r.set(t,u),u}function c(e){e&&!(e>=0)&&(d(e)||s(e).catch(()=>{}))}function u(e){o.delete("".concat(e,"|auth")),o.delete("".concat(e,"|anon"))}},57138:function(e,t,n){var i=n(29918),o=n(86484);let r=e=>{if(!e)return;let t=e.trim();if(t)return/^https?:\/\//i.test(t)?t:"https://".concat(t)},l=e=>{if(!e)return!1;let t="number"==typeof e.id&&Number.isFinite(e.id),n="string"==typeof e.url&&e.url.trim().length>0;return t||n};t.Z=e=>{let{onError:t,onSuccess:n}=e||{};return(0,o.useMutation)(async e=>{if(!l(e))throw Error("id 또는 url 중 하나는 필수입니다.");let t=localStorage.getItem("TOKEN"),n={id:null==e?void 0:e.id,filename:null==e?void 0:e.filename,url:r(null==e?void 0:e.url)};return(await i.Cq.post("/product/link",n,{headers:{"Content-Type":"application/json",...t?{Authorization:"Bearer ".concat(t)}:{}}})).data},{onSuccess:()=>{null==n||n()},onError:e=>{var n,i;let o=(null==e?void 0:null===(i=e.response)||void 0===i?void 0:null===(n=i.data)||void 0===n?void 0:n.message)||(null==e?void 0:e.message)||"An error occurred";null==t||t(o)}})}},7944:function(e,t,n){n.d(t,{Z:function(){return tB}});var i=n(57437),o=n(2265),r=n(8978),l=n(94013),a=n(88862),d=n(99376),s=n(7261);n(2648);var c=n(44053),u=n(3169),p=n(86484),f=n(29918),h=n(72044);let g=async()=>{let e=localStorage.getItem("TOKEN");if(!e)throw Error("로그인이 필요합니다.");return(await f.et.get("/boards/last-saved",{headers:{Authorization:"Bearer ".concat(e)}})).data};var m=()=>{let e=(0,h.Z)();return(0,p.useQuery)(["boards","last-saved"],g,{enabled:!e,retry:!1})},x=n(78155),v=e=>{let{onError:t,onSuccess:n}=e;return(0,p.useMutation)(e=>f.Cq.post("/product/excel/download",e,{headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(localStorage.getItem("TOKEN"))}}),{onSuccess:e=>{if(201===e.status){n();let t=e.data.split("/"),i=t[t.length-1],o=document.createElement("a");o.href=e.data,o.download=i,document.body.appendChild(o),o.click(),document.body.removeChild(o)}},onError:e=>{var n,i;t((null===(i=e.response)||void 0===i?void 0:null===(n=i.data)||void 0===n?void 0:n.message)||"An error occurred")}})},b=e=>{let{onError:t,onSuccess:n}=e;return(0,p.useMutation)(async e=>{let t="undefined"!=typeof navigator&&navigator.userAgent||"",n=!!window.sketchup||/SketchUp/i.test(t);return await f.Cq.post("/product/img/download",{...e,isPlugin:n},{headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(localStorage.getItem("TOKEN")),...n?{"X-Client-Platform":"plugin"}:{}},responseType:"blob"})},{onSuccess:e=>{let t="undefined"!=typeof navigator&&navigator.userAgent||"";if(!(window.sketchup||/SketchUp/i.test(t))){let t=new Blob([e.data],{type:e.headers["content-type"]}),n=window.URL.createObjectURL(t),i=e.headers["content-disposition"],o="downloaded_image.jpg";if(i){let e=i.match(/filename\*=UTF-8''([^;]+)|filename="?([^";]+)"?/);e&&(o=decodeURIComponent(e[1]||e[2]||o))}let r=document.createElement("a");r.href=n,r.download=o,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n)}n()},onError:async e=>{var n;let i="An error occurred",o=null===(n=e.response)||void 0===n?void 0:n.data;try{if(o instanceof Blob){let e=JSON.parse(await o.text());i=(null==e?void 0:e.message)||i}else(null==o?void 0:o.message)&&(i=o.message)}catch(e){}t(i)}})},w=n(43618),y=n(13786),j=n(19966),I=n(26163),C=n(42385),k=n(71670),P=n(9927),S=n(81431);let Z="mcd_dl_count",A="이미지를 받으셨네요! 신규 브랜드가 등록되면 가장 먼저 알려드릴까요?";function E(){if("undefined"==typeof localStorage)return 0;try{let e=(parseInt(localStorage.getItem(Z)||"0",10)||0)+1;return localStorage.setItem(Z,String(e)),e}catch(e){return 0}}let z=()=>{var e,t;let[n,i]=(0,o.useState)("idle"),r=(0,o.useRef)(null),l=(0,o.useCallback)(()=>{i("done"),r.current&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>i("idle"),1200)},[]),{userMe:a,ensureUserLoggedIn:d,ensurePhoneAuth:c}=(0,j.C)(),u=(0,w.sJ)(I.Tq),f=!!(null==u?void 0:null===(e=u.activeId)||void 0===e?void 0:e.color),h=!!(null==u?void 0:null===(t=u.activeId)||void 0===t?void 0:t.isSeamless),g=(0,C.E)(null==u?void 0:u.activeId),m=b({onSuccess:()=>{},onError:e=>s.Am.error("string"==typeof e?e:"이미지 다운로드에 실패했습니다.",{position:"bottom-center",autoClose:2e3})}),x=(0,p.useQueryClient)(),v=()=>{(0,P.q)()},Z=(e,t,n)=>{if(e>=0&&!n&&!t)return;let i=t?2:1,o=["user/me",localStorage.getItem("TOKEN")];x.setQueryData(o,e=>{var t,n;if(!e)return e;let o=null!==(t=e.premiumSheets)&&void 0!==t?t:0,r=null!==(n=e.freeSheets)&&void 0!==n?n:0,l=Math.min(o,i);return{...e,premiumSheets:o-l,freeSheets:Math.max(0,r-(i-l))}}),window.setTimeout(()=>x.invalidateQueries(o),1500)};return{run:async e=>{var t,n,o,r,s;let{productId:u,sizeId:p=0,isSeamless:x=!1,isPBR:b=!1,source:w,owned:j=!1}=e;if(!d())return;if((u<0||!0===x||!0===b)&&!j&&a&&!a.premiumUnlimited){let e=b?2:1;if((null!==(t=a.premiumSheets)&&void 0!==t?t:0)+(null!==(n=a.freeSheets)&&void 0!==n?n:0)=3&&(0,k.fH)(A);return}if(!c()){i("idle");return}await new Promise(t=>{m.mutate({id:u,sizeId:p,isSeamless:x,isPBR:b,source:"grid"===w||"detail"===w?w:void 0,colorFilter:f,seamlessToggle:h,usedFilters:g},{onSuccess:()=>{var n;(0,y.sendGTMEvent)({event:"download-img",value:"download-img",source:w,gtm:{elementId:"download-img"}}),null===(n=e.onWebSuccess)||void 0===n||n.call(e),j||Z(u,b,x),l(),E()>=3&&(0,k.eP)(A),t()},onError:()=>{i("idle"),t()}})})},state:n}};var M=e=>{let{onError:t,onSuccess:n}=e,i=(0,p.useQueryClient)(),o=(0,h.Z)(),r=(0,p.useMutation)(async e=>{let{boardId:t,productId:n}=e;if(o)throw Error("토큰을 확인 중입니다.");let i=localStorage.getItem("TOKEN");if(!i)throw Error("로그인이 필요합니다.");return(await f.et.post("/boards/".concat(t,"/products/").concat(n),null,{headers:{Authorization:"Bearer ".concat(i)}})).data},{onError:e=>{var n;t(null===(n=e.response)||void 0===n?void 0:n.data.message)},onSuccess:()=>{i.invalidateQueries("boards"),i.invalidateQueries(["boards","products"]),(0,y.sendGTMEvent)({id:"click-board",event:"click-board",value:"click-board",gtm:{elementId:"click-board"}}),n()}});return{addBoardToProduct:(e,t)=>{r.mutate({boardId:e,productId:t})},loading:r.isLoading,error:r.error}},D=n(57138),L=n(48615),N=n(62691),R={src:"/_next/static/media/confirm.e5258269.svg",height:15,width:15,blurWidth:0,blurHeight:0};function F(e){return 0===Number(e)?"별도문의":"₩"+e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}var T=n(92443),B=n(33145),O=n(79006);let W=a.ZP.div.withConfig({componentId:"sc-284588ab-0"})(["position:relative;display:flex;flex-direction:column;width:100%;height:100%;[data-reflow] &{height:auto;}"]),_=a.ZP.div.withConfig({componentId:"sc-284588ab-1"})([""]),H=a.ZP.div.withConfig({componentId:"sc-284588ab-2"})(["position:relative;z-index:2;display:flex;width:300px;justify-content:space-between;align-items:center;font-weight:800;padding:2.5px 10px;margin:14px 0 3px;p{font-weight:400;font-size:10px;}[data-reflow] &{width:280px;padding:1px 8px;margin:6px 0 2px;}"]),U=a.ZP.div.withConfig({componentId:"sc-284588ab-3"})(["display:flex;width:300px;justify-content:space-between;align-items:flex-start;gap:8px;font-weight:800;padding:3px 10px;font-size:14px;[data-reflow] &{width:280px;padding:1px 8px;}"," &:nth-of-type(odd){background-color:#f5f5f5;}p{font-weight:400;font-size:10px;overflow:hidden;}"],e=>e.$stacked&&"\n flex-direction: column;\n align-items: stretch;\n gap: 4px;\n ");a.ZP.div.withConfig({componentId:"sc-284588ab-4"})(["width:100%;white-space:nowrap;overflow-x:auto;overflow-y:hidden;text-align:left;font-size:14px;color:#000;padding-bottom:2px;scrollbar-width:thin;&::-webkit-scrollbar{height:4px;}&::-webkit-scrollbar-thumb{background:#cfcfcf;border-radius:2px;}"]);let Q=a.ZP.div.withConfig({componentId:"sc-284588ab-5"})(["display:flex;align-items:center;flex-shrink:0;font-weight:400;white-space:nowrap;color:#6e6e73;font-size:14px;p{font-weight:400;font-size:10px;}"]),$=a.ZP.div.withConfig({componentId:"sc-284588ab-6"})(["flex:1;min-width:0;display:flex;align-items:center;justify-content:flex-end;font-weight:400;font-size:14px;transition:transform 0.3s ease;color:#000;white-space:normal;word-break:keep-all;text-align:right;"]),K=a.ZP.div.withConfig({componentId:"sc-284588ab-7"})(["display:flex;flex-direction:column;width:300px;margin-bottom:5px;padding:5px 10px;[data-reflow] &{width:280px;margin-bottom:2px;padding:2px 8px;}"]),V=(0,a.ZP)(B.default).withConfig({componentId:"sc-284588ab-8"})(["margin-left:5px;"]),G=a.ZP.div.withConfig({componentId:"sc-284588ab-9"})(["position:absolute;background-color:rgba(255,255,255,1);border:1px solid rgba(233,233,233,1);border-radius:10px;padding:11px 8px;font-size:12px;font-weight:400;line-height:1.45;word-break:keep-all;box-shadow:0px 0px 10px rgba(0,0,0,0.1);z-index:10;top:220px;left:100px;width:max-content;max-width:230px;height:auto;"]);a.ZP.div.withConfig({componentId:"sc-284588ab-10"})(["filter:blur(5px);pointer-events:none;"]),a.ZP.div.withConfig({componentId:"sc-284588ab-11"})(["position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(255,255,255,0.7);display:flex;justify-content:center;align-items:center;z-index:1;"]),a.ZP.div.withConfig({componentId:"sc-284588ab-12"})(["font-size:16px;font-weight:bold;text-align:center;"]),a.ZP.span.withConfig({componentId:"sc-284588ab-13"})(["color:blue;font-size:16px;font-weight:bold;cursor:pointer;&:hover{text-decoration:underline;}"]),(0,a.ZP)(O.u).withConfig({componentId:"sc-284588ab-14"})(["line-height:1.5;width:100%;font-size:14px;font-weight:400;margin:5px 0 0 0;border-radius:0;border:none;color:#000;background:transparent;&:focus-visible{outline:0;}[data-reflow] &{max-height:3em;overflow-y:auto;margin-top:2px;}"]);let Y=a.ZP.div.withConfig({componentId:"sc-284588ab-15"})(["line-height:1.5;width:100%;font-size:14px;font-weight:400;margin:5px 0 0 0;color:",";white-space:pre-wrap;word-break:break-word;max-height:4.5em;min-height:4.5em;overflow-y:auto;[data-reflow] &{max-height:3em;min-height:3em;margin-top:2px;}"],e=>e.$empty?"#999":"#000");var q=n(97494),J=n(89723),X=n(60162),ee=n(55161),et=n(35775);let en=a.ZP.div.withConfig({componentId:"sc-7ff6608-0"})(["position:relative;flex:1;min-width:0;display:flex;justify-content:flex-end;"]),ei=a.ZP.button.withConfig({componentId:"sc-7ff6608-1"})(["display:inline-flex;align-items:center;gap:4px;max-width:100%;cursor:pointer;padding:0;border:0;background:none;span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:400;color:#000;text-decoration:",";text-underline-offset:2px;text-decoration-color:#c7c7cc;}&:hover span{text-decoration:underline;text-underline-offset:2px;text-decoration-color:#c7c7cc;}"],e=>e.$open?"underline":"none"),eo=a.ZP.span.withConfig({componentId:"sc-7ff6608-2"})(["flex-shrink:0;color:#8e8e93;font-size:13px;font-weight:400;"]),er=a.ZP.span.withConfig({componentId:"sc-7ff6608-3"})(["flex-shrink:0;font-size:11px;color:#b0b0b5;transition:transform 0.15s ease;transform:rotate(",");"],e=>e.$open?"180deg":"0deg"),el=a.ZP.div.withConfig({componentId:"sc-7ff6608-4"})(["position:absolute;top:calc(100% + 4px);right:0;z-index:30;width:max-content;max-width:240px;max-height:220px;overflow-y:auto;background:#fff;border:1px solid #e5e5ea;border-radius:8px;box-shadow:0 6px 18px rgba(0,0,0,0.12);padding:4px 0;"]),ea=a.ZP.button.withConfig({componentId:"sc-7ff6608-5"})(["display:block;width:100%;border:0;background:",";padding:8px 14px;font-size:14px;font-weight:400;color:#000;white-space:nowrap;text-align:left;cursor:pointer;&:hover{background:#f5f5f5;}"],e=>e.$selected?"#f0edff":"none"),ed=ee.cs,es=e=>{if(!e)return"";let t=Number(e.unitAreaM2),n=!!t&&!Number.isNaN(t);return"BOX"===e.packUnit&&e.piecesPerBox?"1박스 ".concat(e.piecesPerBox,"매").concat(n?" (".concat(t,"㎡)"):""):"ROLL"===e.packUnit&&n?"1롤 (".concat(t,"㎡)"):"SHEET"===e.packUnit&&n?"1장 (".concat(t,"㎡)"):"SET"===e.packUnit&&n?"1set (".concat(t,"㎡)"):""},ec=e=>{let t=e.replace(/[\n\r\t]+/g," / ").replace(/※\s*/g,"").replace(/\s*\/\s*\+\s*/g," + ");for(let e of[/1\s*파렛트[^/]*/gi,/\(?\s*\d+\s*pcs\s*[\/·]?\s*box\s*\)?/gi,/1\s*박스[^/]*?(?:\d+\s*(?:장|매|ea|pcs)|\([^)]*\))[^/]*/gi,/1\s*box[^/]*?(?:\d+\s*(?:장|매|ea|pcs)|\([^)]*\))[^/]*/gi,/1\s*롤[^/]*/gi,/1\s*(?:set|세트)\s*=?\s*[\d.]+\s*(?:㎡|m2|m²)[^/]*/gi,/\d+\s*(?:장|매)\s*\(?\s*[\d.]+\s*(?:㎡|m2|m²)\s*\)?/gi,/[\d.]+\s*(?:㎡|m2|m²)\s*(?:\/\s*(?:장|매))?/gi])t=t.replace(e,"");return t.split("/").map(e=>e.trim()).filter(Boolean).join(" / ")},eu=e=>e.replace(/[\n\r\t]+/g," / ").replace(/※\s*/g,"").replace(/\s*\/\s*\+\s*/g," + ").split("/").map(e=>e.trim()).filter(Boolean).join(" / "),ep=(e,t)=>{let n=es(e),i=t||"",o=n?ec(i):eu(i);return[n,o].filter(Boolean).join(" / ")||"특징 정보가 없습니다"},ef=e=>{var t;let{raw:n,productId:r}=e,[l,a]=(0,o.useState)(!1),d=(0,o.useRef)(null),s=(0,o.useMemo)(()=>ed(n),[n]),[c,u]=(0,w.FV)(X.Z),p=null!=r?c[r]:void 0;if((0,o.useEffect)(()=>{if(!l)return;let e=e=>{d.current&&!d.current.contains(e.target)&&a(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[l]),s.length<=1)return(0,i.jsx)($,{children:null!==(t=s[0])&&void 0!==t?t:n});let f=e=>{null!=r&&u(t=>({...t,[r]:e})),a(!1)};return(0,i.jsxs)(en,{ref:d,children:[(0,i.jsxs)(ei,{type:"button",$open:l,onClick:()=>a(e=>!e),"aria-expanded":l,title:"".concat(s.length,"개 사이즈 — 클릭해 선택"),children:[(0,i.jsx)("span",{children:null!=p?p:s[0]}),(0,i.jsx)(eo,{children:p?"변경":"외 ".concat(s.length-1)}),(0,i.jsx)(er,{$open:l,children:"▾"})]}),l&&(0,i.jsx)(el,{role:"listbox",children:s.map((e,t)=>(0,i.jsx)(ea,{type:"button",$selected:e===p,onClick:()=>f(e),children:e},"".concat(e,"-").concat(t)))})]})},eh=e=>{var t,n,r;let{productDetail:l,category:a,isTooltipVisible:s,setIsTooltipVisible:c,setIsNoDataModalOpen:u,isNoDataModalOpen:p,isMember:f,isContract:h,isDetailPending:g=!1}=e,[m,v]=(0,o.useState)(""),b=(0,d.useRouter)(),w=(0,o.useCallback)(()=>b.push("/login"),[b]);(0,o.useEffect)(()=>{var e;(null===(e=l[0])||void 0===e?void 0:e.feature)&&v(l[0].feature)},[l]);let y=F(l[0].price),j=(0,et.Z)(),I=!!(null==j?void 0:j.premiumUnlimited)&&!!(null==j?void 0:j.freeSampleAllowed),C=Number(null!==(r=null===(t=l[0])||void 0===t?void 0:t.salePrice)&&void 0!==r?r:0);l[0].price;let[k,P]=(0,o.useState)(!1),S=(0,o.useCallback)(()=>b.push("/premium?src=detail_price"),[b]),Z=(e,t)=>{let n=e=>String(null!=e?e:"").normalize("NFC").trim(),i=n(e),o=n(t);return i&&o?i===o?i:"".concat(i," / ").concat(o):i||o||""},A=[{label:"상품코드",value:l[0].code},{label:"구분",value:l[0].category},{label:"종류",value:l[0].subCategory},{label:"사이즈(mm)",value:l[0].size},{label:"원산지",value:l[0].country},{label:"광택도",value:l[0].glossiness},{label:"브랜드",value:(()=>{var e,t,n;let i=String(null!==(e=l[0].manufacturer)&&void 0!==e?e:"").normalize("NFC").trim(),o=String(null!==(t=l[0].series)&&void 0!==t?t:"").normalize("NFC").trim(),r=String(null!==(n=l[0].brand)&&void 0!==n?n:"").normalize("NFC").trim();return r?Z(r,o):o?Z(i,o):i})()}],E=A.findIndex(e=>"브랜드"===e.label);return E>0&&(null===(n=A[E-1])||void 0===n||n.label),(0,i.jsxs)(_,{children:[A.map((e,t)=>{let{label:n,value:r}=e,a="사이즈(mm)"===n&&"string"==typeof r&&r.includes(",");return(0,i.jsxs)(o.Fragment,{children:[(0,i.jsxs)(U,{children:[(0,i.jsx)(Q,{children:n}),a?(0,i.jsx)(ef,{raw:r,productId:l[0].id}):"브랜드"===n&&!f&&r?(0,i.jsx)(eA,{type:"button",onClick:w,children:"\uD83D\uDD12 로그인 후 확인"}):"사이즈"===n&&"제품문의"===r?(0,i.jsx)($,{onClick:()=>u(!0),style:{cursor:"pointer",textDecoration:"underline"},children:r}):g?(0,i.jsx)(eb,{"aria-hidden":!0}):(0,i.jsx)($,{children:"사이즈(mm)"===n&&"string"==typeof r?(0,ee.Hz)(r.replace(/\s/g,"").trim()):r})]}),null]},"".concat(n,"-").concat(t))}),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(U,{children:[(0,i.jsxs)(Q,{children:["설계 단가(m\xb2)",(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(V,{src:R,alt:"ConfirmSvg",style:{padding:"12px",margin:"-12px",boxSizing:"content-box",cursor:"pointer"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)}),s&&(0,i.jsxs)(G,{children:["* 판매사에게 제공받은 판매가,",(0,i.jsx)("br",{})," 시중 유통가와 유사한 설계 단가"]})]})]}),g?(0,i.jsx)(eb,{"aria-hidden":!0}):f?(0,i.jsx)($,{children:y}):(0,i.jsx)(eA,{type:"button",onClick:w,children:"\uD83D\uDD12 로그인 후 확인"})]}),f&&!g&&(0,i.jsxs)(em,{$lead:!I,onClick:I?void 0:S,role:I?void 0:"button",tabIndex:I?void 0:0,onKeyDown:I?void 0:e=>{("Enter"===e.key||" "===e.key)&&S()},children:[(0,i.jsxs)(Q,{children:["제휴 단가(m\xb2)",(0,i.jsxs)(ey,{onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),children:[(0,i.jsx)(V,{src:R,alt:"ConfirmSvg",style:{cursor:"pointer",marginLeft:0}}),k&&(0,i.jsxs)(ej,{children:["* 제휴기업에게 제공되는 특판가,",(0,i.jsx)("br",{})," 유통사 비교를 통한 최저 단가"]})]})]}),I?(0,i.jsxs)(eC,{children:[(0,i.jsx)(eI,{"aria-hidden":!0,children:"\uD83D\uDC51"}),C>0?F(String(C)):"15% 할인가"]}):(0,i.jsx)(ex,{children:"\uD83D\uDD12 특판가 열람 ›"})]})]}),(0,i.jsx)("div",{style:{fontSize:"11px",color:"#9a9a9a",lineHeight:1.3,margin:"2px 0 0",textAlign:"right"},children:"* 부가세 별도"}),(0,i.jsx)(q.Z,{style:{padding:0,margin:"1px 0 4px"}}),(0,i.jsxs)(K,{children:[(0,i.jsx)(Q,{children:"상세정보"}),g?(0,i.jsx)(ew,{"aria-hidden":!0}):(0,i.jsx)(Y,{$empty:!m,"aria-label":"상세정보",children:ep(null==l?void 0:l[0],m)})]}),p&&(0,i.jsx)(x.Z,{containerWidth:"440px",onClose:()=>u(!1),children:(0,i.jsx)(T.Z,{productName:l[0].name,productId:l[0].id,isModal:!0,onClose:()=>u(!1)})})]})};var eg=e=>{var t,n,r,l,a;let{productDetail:s,setIsNoDataModalOpen:c,isNoDataModalOpen:u,isDetailPending:p=!1}=e,f=(0,w.sJ)(J.Z),[h,g]=(0,o.useState)(!1);if((0,d.useRouter)(),!s||0===s.length)return null;let m=s[0],x=m.category,v=(()=>{var e;let t=m.isContract;return"number"==typeof t?1===t:"boolean"==typeof t?t:(null===(e=m.Store)||void 0===e?void 0:e.contractStatus)==="ACTIVE"})();return null!==(l=m.storeId)&&void 0!==l||null===(t=m.Store)||void 0===t||t.id,null!==(a=m.storeLogo)&&void 0!==a||(null===(n=m.Store)||void 0===n?void 0:n.contractStatus)==="ACTIVE"&&(null===(r=m.Store)||void 0===r?void 0:r.mLogoImg)&&m.Store.mLogoImg,(0,i.jsxs)(W,{children:[(0,i.jsx)(ek,{children:(0,i.jsx)(eP,{children:(0,i.jsxs)(H,{children:[(0,i.jsx)(eS,{children:"제품명"}),(0,i.jsx)(eZ,{title:m.name,children:m.name})]})})}),(0,i.jsx)(eh,{productDetail:s,category:x,isTooltipVisible:h,setIsTooltipVisible:g,setIsNoDataModalOpen:c,isNoDataModalOpen:u,isMember:f.isLogin,isContract:v,isDetailPending:p})]})};let em=(0,a.ZP)(U).withConfig({componentId:"sc-7ff6608-6"})(["&&{background-color:#f5f5f5;}",""],e=>e.$lead&&"cursor: pointer;"),ex=a.ZP.span.withConfig({componentId:"sc-7ff6608-7"})(["flex:none;font-size:13px;font-weight:700;color:#413d7d;letter-spacing:-0.02em;white-space:nowrap;"]),ev=(0,a.F4)(["0%{background-position:100% 0;}100%{background-position:-100% 0;}"]),eb=a.ZP.span.withConfig({componentId:"sc-7ff6608-8"})(["display:inline-block;width:84px;height:13px;border-radius:3px;background:linear-gradient(90deg,#eeeeee 25%,#f7f7f7 50%,#eeeeee 75%);background-size:200% 100%;animation:"," 1.1s linear infinite;"],ev),ew=a.ZP.div.withConfig({componentId:"sc-7ff6608-9"})(["width:100%;height:66px;border-radius:4px;background:linear-gradient(90deg,#eeeeee 25%,#f7f7f7 50%,#eeeeee 75%);background-size:200% 100%;animation:"," 1.1s linear infinite;"],ev),ey=a.ZP.span.withConfig({componentId:"sc-7ff6608-10"})(["position:relative;display:inline-flex;align-items:center;"]),ej=a.ZP.div.withConfig({componentId:"sc-7ff6608-11"})(["position:absolute;left:100%;bottom:100%;margin-left:-4px;margin-bottom:-2px;width:max-content;max-width:230px;padding:11px 8px;border:1px solid #e9e9e9;border-radius:10px;background:#fff;box-shadow:0 0 10px rgba(0,0,0,0.1);font-size:12px;font-weight:400;line-height:1.45;color:#111;white-space:normal;word-break:keep-all;z-index:10;pointer-events:none;"]),eI=a.ZP.span.withConfig({componentId:"sc-7ff6608-12"})(["flex:none;font-size:12px;line-height:1;"]),eC=a.ZP.span.withConfig({componentId:"sc-7ff6608-13"})(["display:inline-flex;align-items:baseline;gap:6px;font-weight:800;color:#2e2a5f;white-space:nowrap;"]),ek=a.ZP.div.withConfig({componentId:"sc-7ff6608-14"})(["display:flex;align-items:center;gap:10px;min-height:36px;"]),eP=a.ZP.div.withConfig({componentId:"sc-7ff6608-15"})(["flex:1 1 auto;min-width:0;padding-top:2px;"]),eS=a.ZP.div.withConfig({componentId:"sc-7ff6608-16"})(["flex:none;font-weight:400;font-size:14px;color:#6e6e73;white-space:nowrap;"]),eZ=a.ZP.div.withConfig({componentId:"sc-7ff6608-17"})(["font-size:16px;line-height:1.35;font-weight:700;color:#1b1e27;flex:1;min-width:0;text-align:right;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:normal;word-break:keep-all;"]);a.ZP.div.withConfig({componentId:"sc-7ff6608-18"})(["flex:0 0 36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;outline:none;&:focus-visible{outline:2px solid rgba(17,24,39,0.6);outline-offset:2px;border-radius:50%;}"]),a.ZP.div.withConfig({componentId:"sc-7ff6608-19"})(["--size:36px;position:relative;width:var(--size);height:var(--size);flex:0 0 var(--size);border-radius:50%;background:#fff;overflow:hidden;"]),a.ZP.div.withConfig({componentId:"sc-7ff6608-20"})(["position:absolute;inset:0;border-radius:50%;overflow:hidden;background:#fff;"]);let eA=a.ZP.button.withConfig({componentId:"sc-7ff6608-21"})(["flex:0 0 auto;padding:3px 10px;font-size:13px;font-weight:700;line-height:1;color:#413d7d;background:#f5f3ff;border:1px solid #ddd6fe;border-radius:6px;cursor:pointer;white-space:nowrap;transition:background-color 0.18s ease,color 0.18s ease;&:hover{background:#413d7d;color:#fff;}"]),eE=(a.ZP.div.withConfig({componentId:"sc-7ff6608-22"})(["position:relative;"]),(0,a.ZP)(U).withConfig({componentId:"sc-7ff6608-23"})(["visibility:hidden;"]),a.ZP.div.withConfig({componentId:"sc-7ff6608-24"})(["position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;"]),a.ZP.div.withConfig({componentId:"sc-7ff6608-25"})([""]));(0,a.ZP)(eE).withConfig({componentId:"sc-7ff6608-26"})(["width:100%;margin:0 8px;padding:12px 14px;color:#6e6e73;font-size:14px;line-height:1.35;font-weight:400;text-align:center;"]),n(53652);var ez=n(88385),eM=n(54887),eD=n(42103),eL=e=>{var t;let{productId:n,isOpen:r,onClose:l,orderedBoards:a,isBoardSaved:c,onSaveItem:p,savedInRoot:f}=e,[h,g]=(0,o.useState)(null),[m,x]=(0,o.useState)(null);(0,o.useEffect)(()=>{r&&(g(null),x(null))},[r,n]);let[v,b]=(0,o.useState)(null);(0,o.useEffect)(()=>{b(document.querySelector("[data-picker-slot]"))},[r]);let y=(0,o.useRef)({}),j=(0,o.useRef)(void 0);(0,o.useEffect)(()=>{if(j.current!==n){j.current=n;let e={};a.forEach(t=>{e[t.id]=c(t)}),y.current=e;return}a.forEach(e=>{var t;let n=c(e),i=Object.prototype.hasOwnProperty.call(y.current,e.id),o=null!==(t=y.current[e.id])&&void 0!==t&&t;i&&!o&&n&&!e.isDefault&&s.Am.success("[".concat(e.name,"] 보드에 저장되었습니다."),{position:"bottom-center",autoClose:2e3}),y.current[e.id]=n})},[a,c,n]);let I=(0,d.useRouter)(),C=(0,w.sJ)(J.Z),{placeProduct:k}=(0,u.S)(),P=null!==(t=a.find(e=>e.id===h))&&void 0!==t?t:null,S=null==m&&(null==h?f:!!(P&&c(P)));return v?(0,eM.createPortal)((0,i.jsxs)(eN,{$open:r,role:"dialog","aria-label":"저장할 보드 선택",children:[(0,i.jsxs)(eR,{children:[(0,i.jsx)(eF,{children:"My 아카이브 라이브러리"}),(0,i.jsx)(eT,{type:"button",onClick:l,"aria-label":"닫기",children:"✕"})]}),(0,i.jsx)(eB,{children:(0,i.jsx)(eD.Z,{pickerMode:!0,selectedBoardId:h,onPickBoard:e=>{g(e),x(null)},selectedFolderId:m,onPickFolder:e=>{x(e),g(null)}})}),(0,i.jsxs)(eO,{children:[(0,i.jsx)(eW,{type:"button",onClick:()=>{if(!(null==C?void 0:C.isLogin)){I.push("/login");return}if(null!=h){p(h);return}if(null==n){s.Am.error("저장할 제품이 없습니다.",{position:"bottom-center"});return}let e=null!=m?"보드에 저장되었습니다.":"전체 프로젝트에 저장되었습니다.",t=null!=m?"이미 이 보드에 담긴 제품입니다.":"이미 전체 프로젝트에 담긴 제품입니다.";k.mutate({productId:n,...null!=m?{kind:"folder",projectId:m}:{kind:"root"}},{onSuccess:n=>{var i;if((null==n?void 0:null===(i=n.data)||void 0===i?void 0:i.added)===!1){s.Am.error(t,{position:"bottom-center",autoClose:2e3});return}s.Am.success(e,{position:"bottom-center",autoClose:2e3})},onError:()=>{s.Am.error("저장에 실패했습니다.",{position:"bottom-center"})}})},disabled:S,$saved:S,children:S?"저장됨":"저장"}),(0,i.jsx)(e_,{children:S?null==h?"이미 My 아카이브에 있습니다.":"이미 이 보드에 있습니다.":null!=m?"선택한 보드에 담깁니다.":null!=h?"선택한 보드에 담깁니다.":"선택 안 하면 My 아카이브에 담깁니다."})]})]}),v):null};let eN=a.ZP.aside.withConfig({componentId:"sc-2cbf5446-0"})(["position:absolute;top:0;bottom:0;right:0;width:220px;max-width:86vw;z-index:50;display:flex;flex-direction:column;gap:0;padding:0;overflow:hidden;box-sizing:border-box;background:#f6f7f9;border:1px solid #e4e6ea;border-radius:12px;box-shadow:0 8px 28px rgba(0,0,0,0.18);opacity:",";transform:translateX(",");pointer-events:",";transition:opacity 0.2s ease,transform 0.24s ease;@media (max-width:768px){display:none;}"],e=>{let{$open:t}=e;return t?1:0},e=>{let{$open:t}=e;return t?"0":"18px"},e=>{let{$open:t}=e;return t?"auto":"none"}),eR=a.ZP.div.withConfig({componentId:"sc-2cbf5446-1"})(["position:relative;flex:0 0 auto;height:44px;display:flex;align-items:center;justify-content:center;border-bottom:1px solid #dfe1e6;"]),eF=a.ZP.h2.withConfig({componentId:"sc-2cbf5446-2"})(["font-size:0.95rem;font-weight:600;color:#111;"]),eT=a.ZP.button.withConfig({componentId:"sc-2cbf5446-3"})(["position:absolute;right:8px;top:50%;transform:translateY(-50%);width:26px;height:26px;border:none;border-radius:8px;background:transparent;color:#888;font-size:14px;cursor:pointer;&:hover{background:#eceef2;color:#333;}"]),eB=a.ZP.div.withConfig({componentId:"sc-2cbf5446-4"})(["flex:1 1 auto;min-height:0;display:flex;flex-direction:column;"]),eO=a.ZP.div.withConfig({componentId:"sc-2cbf5446-5"})(["display:flex;flex-direction:column;gap:6px;padding:10px 12px 12px;border-top:1px solid #e4e6ea;flex:0 0 auto;"]),eW=a.ZP.button.withConfig({componentId:"sc-2cbf5446-6"})(["width:100%;padding:11px;border:none;border-radius:8px;background:",";color:#fff;font-size:14px;font-weight:700;cursor:",";"],e=>{let{$saved:t}=e;return t?"#c3c6cf":"#413d7d"},e=>{let{$saved:t}=e;return t?"default":"pointer"}),e_=a.ZP.div.withConfig({componentId:"sc-2cbf5446-7"})(["text-align:center;font-size:11px;color:#9a9aa4;"]);var eH=n(21198),eU=n(64779);let eQ=a.ZP.div.withConfig({componentId:"sc-da81fd77-0"})(["padding:10px;background-color:#f9f9f9;border-radius:8px;@media (max-width:640px){display:none;}"]),e$=a.ZP.div.withConfig({componentId:"sc-da81fd77-1"})(["font-weight:600;margin:0 0 0 20px;font-size:16px;"]),eK=a.ZP.div.withConfig({componentId:"sc-da81fd77-2"})(["display:flex;flex-wrap:wrap;gap:12px;justify-content:",";min-height:172px;[data-reflow] &{gap:8px;min-height:0;}html.su-plugin &{flex-wrap:nowrap;overflow:hidden;justify-content:center;min-height:0;}[data-reflow] &{justify-content:flex-start;padding-left:14px;}"],e=>{let{leftAlign:t}=e;return t?"flex-start":"center"}),eV=a.ZP.div.withConfig({componentId:"sc-da81fd77-3"})(["display:flex;flex-direction:column;cursor:",";border-radius:6px;padding:6px;background:#ffffff;border:1px solid #f0f0f0;flex:0 0 130px;width:130px;min-height:160px;box-shadow:0 1px 3px rgba(0,0,0,0.08);&:hover{background:",";}[data-reflow] &{flex:0 0 110px;width:110px;min-height:140px;}"],e=>{let{onClick:t}=e;return t?"pointer":"default"},e=>{let{onClick:t}=e;return t?"#f8f8f8":"#ffffff"}),eG=a.ZP.div.withConfig({componentId:"sc-da81fd77-4"})(["position:relative;width:100%;aspect-ratio:1 / 1;border-radius:4px;overflow:hidden;background:#fafafa;"]),eY=a.ZP.div.withConfig({componentId:"sc-da81fd77-5"})(["position:absolute;top:6px;left:6px;width:32px;height:32px;z-index:2;"]);a.ZP.div.withConfig({componentId:"sc-da81fd77-6"})(["position:absolute;top:4px;left:4px;z-index:2;pointer-events:none;width:28px;height:28px;"]);let eq=a.ZP.div.withConfig({componentId:"sc-da81fd77-7"})(["position:absolute;top:0;left:0;width:100%;height:100%;background:#e0e0e0;"]),eJ=a.ZP.div.withConfig({componentId:"sc-da81fd77-8"})(["width:",";height:",";background:#e0e0e0;border-radius:4px;margin-top:",";"],e=>{let{width:t}=e;return t},e=>{let{height:t}=e;return t},e=>{let{marginTop:t}=e;return t||"0"}),eX=a.ZP.div.withConfig({componentId:"sc-da81fd77-9"})(["font-size:14px;margin-top:6px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"]),e0=a.ZP.div.withConfig({componentId:"sc-da81fd77-10"})(["font-size:12px;margin-top:2px;line-height:1.1;color:#6b7280;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"]),e1=a.ZP.div.withConfig({componentId:"sc-da81fd77-11"})(["width:100%;text-align:center;color:red;font-size:14px;padding:20px 0;"]),e2=e=>{let{item:t,onClick:n}=e,[r,l]=(0,o.useState)(!1);return(0,i.jsxs)(eV,{onMouseEnter:()=>(0,eH.Xm)(Number(null==t?void 0:t.id)),onFocus:()=>(0,eH.Xm)(Number(null==t?void 0:t.id)),onClick:()=>null==n?void 0:n(t),children:[(0,i.jsxs)(eG,{children:[!r&&(0,i.jsx)(eq,{}),(0,i.jsx)(B.default,{src:t.img,width:150,height:150,alt:t.name,onLoadingComplete:()=>l(!0),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",opacity:r?1:0,transition:"opacity 0.3s ease-in-out"}}),t.isHighQuality||t.hasSeamless&&t.hasPBR?(0,i.jsx)(eY,{children:(0,i.jsx)(eU.vW,{size:32})}):t.hasSeamless?(0,i.jsx)(eY,{children:(0,i.jsx)(eU.BD,{size:32})}):null]}),(0,i.jsx)(eX,{children:t.name}),(0,i.jsxs)(e0,{children:[t.category||"카테고리 없음"," /"," ",t.subCategory||"서브카테고리 없음"]})]})};var e6=e=>{let{items:t,isLoading:n,error:r,onItemClick:l}=e,a=n||0===t.length,s=!a&&t.length<6,c=(0,d.useRouter)(),u=(0,d.usePathname)(),p=(0,d.useSearchParams)(),f=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new URLSearchParams(null==p?void 0:p.toString());i.set(e,String(t));let o="".concat(u,"?").concat(i.toString());n?c.replace(o,{scroll:!1}):c.push(o,{scroll:!1})},h=(0,o.useMemo)(()=>null==p?void 0:p.has("pid"),[p]),g=e=>{null==l||l(e),f("pid",e.id,h)};return(0,i.jsxs)(eQ,{children:[(0,i.jsx)(e$,{children:"AI Recommendations"}),r?(0,i.jsx)(e1,{children:r}):(0,i.jsx)(eK,{leftAlign:s,children:a?Array.from({length:6}).map((e,t)=>(0,i.jsxs)(eV,{children:[(0,i.jsx)(eG,{children:(0,i.jsx)(eq,{})}),(0,i.jsx)(eJ,{width:"80%",height:"12px",marginTop:"6px"}),(0,i.jsx)(eJ,{width:"60%",height:"10px",marginTop:"2px"})]},"skeleton-".concat(t))):t.map(e=>(0,i.jsx)(e2,{item:e,onClick:g},e.id))})]})},e8=n(5537),e4={src:"/_next/static/media/img-down.5e6e7f12.svg",height:20,width:22,blurWidth:0,blurHeight:0},e5={src:"/_next/static/media/spec-down.980f2b34.svg",height:18,width:17,blurWidth:0,blurHeight:0},e3={src:"/_next/static/media/view.90c66383.svg",height:24,width:24,blurWidth:0,blurHeight:0};let e9=a.ZP.div.withConfig({componentId:"sc-4f829ba8-0"})(["display:flex;justify-content:center;align-items:center;font-size:16px;gap:12px;@media (max-width:768px){font-size:14px;gap:10px;}"]),e7=a.ZP.div.withConfig({componentId:"sc-4f829ba8-1"})(["display:flex;justify-content:center;align-items:center;font-size:inherit;gap:5px;"]);var te=e=>{let{productDetail:t,isHeartFull:n}=e,o=t[0];return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(ez.c7,{children:(0,i.jsxs)(e9,{children:[(0,i.jsxs)(e7,{children:[(0,i.jsx)(B.default,{src:e3,alt:"view-svg",width:19,height:19}),null==o?void 0:o.viewCount]}),(0,i.jsxs)(e7,{children:[(0,i.jsx)(B.default,{src:e4,alt:"img-svg",width:19,height:19}),null==o?void 0:o.imgCount]}),(0,i.jsxs)(e7,{children:[(0,i.jsx)(B.default,{src:e5,alt:"spec-svg",width:17,height:17}),null==o?void 0:o.specCount]})]})})})},tt=n(68402);let tn=(0,a.vJ)([".macodi-tooltip,.macodi-tooltip *{color:#fff !important;}.macodi-tooltip{background-color:rgba(97,97,97,0.92) !important;text-align:center !important;}.macodi-arrow{color:rgba(97,97,97,0.92) !important;}"]),ti=a.ZP.div.withConfig({componentId:"sc-7d58bb5e-0"})(["display:flex;flex-direction:column;width:100%;gap:8px;[data-reflow] &{gap:5px;}"]),to=a.ZP.div.withConfig({componentId:"sc-7d58bb5e-1"})(["display:flex;align-items:stretch;width:100%;gap:8px;& > *{flex:1 1 0;min-width:0;}"]),tr=a.ZP.span.withConfig({componentId:"sc-7d58bb5e-2"})(["display:inline-flex;width:100%;"]),tl=a.ZP.span.withConfig({componentId:"sc-7d58bb5e-3"})(["font-size:14px;line-height:1;"]),ta=a.ZP.button.withConfig({componentId:"sc-7d58bb5e-4"})(["width:100%;height:40px;padding:0;border:none;background:transparent;cursor:pointer;perspective:600px;margin-bottom:4px;[data-reflow] &{height:32px;margin-bottom:2px;}"]),td=a.ZP.span.withConfig({componentId:"sc-7d58bb5e-5"})(["position:relative;display:block;width:100%;height:100%;transition:transform 0.45s ease;transform-style:preserve-3d;",":hover &{transform:rotateX(180deg);}"],ta),ts=a.ZP.span.withConfig({componentId:"sc-7d58bb5e-6"})(["position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:6px;padding:0 10px;border:1px solid #ddd6fe;border-radius:8px;font-size:13px;font-weight:600;letter-spacing:-0.01em;backface-visibility:hidden;-webkit-backface-visibility:hidden;"]),tc=(0,a.ZP)(ts).withConfig({componentId:"sc-7d58bb5e-7"})(["background:linear-gradient(90deg,#f5f3ff 0%,#ede9fe 100%);color:#413d7d;b{font-weight:800;color:#2e2a5f;}"]),tu=(0,a.ZP)(ts).withConfig({componentId:"sc-7d58bb5e-8"})(["background:#413d7d;color:#fff;font-weight:700;transform:rotateX(180deg);"]);var tp=e=>{var t,n,r,l,a,s;let{isBoard:c,handleCartClick:u,handleSpecDownloadButtonClick:p,currentProductDetail:f,userMe:h}=e,g=null==f?void 0:f[0],m=(0,w.sJ)(J.Z),x=(0,d.useRouter)(),v=!!(null!==(n=null==m?void 0:m.islogin)&&void 0!==n?n:null==m?void 0:m.isLogin),b=!!(null==h?void 0:h.premiumUnlimited)&&!!(null==h?void 0:h.freeSampleAllowed),[y,j]=(0,o.useState)(!1);(0,o.useEffect)(()=>{"undefined"!=typeof document&&j(document.documentElement.classList.contains("su-plugin"))},[]);let I=(0,o.useCallback)(()=>{x.push("/login")},[x]),[C,k]=(0,o.useState)(!1),P=e=>{e.currentTarget.style.backgroundColor="#f0f0f0"},S=e=>{e.currentTarget.style.backgroundColor="white"},Z={width:"100%",height:y?30:38,backgroundColor:"white",border:"1px solid #1B2C34",transition:"background-color 0.2s ease",padding:"0px",cursor:"pointer",height:40,minHeight:40,border:"1px solid #ddd6fe",borderRadius:8,fontSize:13,fontWeight:700},A=null!==(l=null!==(r=null==g?void 0:g.name)&&void 0!==r?r:null==g?void 0:g.title)&&void 0!==l?l:"",[E,z]=(0,o.useState)(!1),M=(0,o.useCallback)(()=>{(null==g?void 0:g.id)&&z(!0)},[null==g?void 0:g.id]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(ti,{children:[(0,i.jsx)(tn,{}),(0,i.jsx)(i.Fragment,{}),(0,i.jsx)(ta,{type:"button",onClick:M,"aria-label":"견적 문의하기",children:(0,i.jsxs)(td,{children:[(0,i.jsxs)(tc,{children:["\uD83D\uDCB0 스펙인 시 자재금액의 ",(0,i.jsx)("b",{children:"3~6% 설계 지원금"})]}),(0,i.jsx)(tu,{children:b?"특판가 견적 및 지원금 신청 ›":"견적 및 지원금 신청 ›"})]})}),(0,i.jsxs)(to,{children:[(0,i.jsx)(tr,{children:(0,i.jsx)(tt.Z,{id:v?"sample-request":"guest-sample-request",value:"sample",selected:!0,style:Z,onMouseOver:P,onMouseOut:S,onClick:()=>v?u():I(),children:(0,i.jsxs)(ez.Qb,{style:{fontSize:13,fontWeight:800},children:[(0,i.jsx)(tl,{children:"\uD83D\uDCE6"}),"샘플 담기"]})})}),(0,i.jsx)(tr,{children:(0,i.jsx)(tt.Z,{id:"spec-download",value:"spec",selected:!0,style:Z,onMouseOver:P,onMouseOut:S,onClick:()=>v?u():I(),children:(0,i.jsxs)(ez.Qb,{style:{fontSize:13,fontWeight:800},children:[(0,i.jsx)(tl,{children:"\uD83D\uDCCB"}),"스펙북 담기"]})})})]})]}),(0,i.jsx)(e8.c,{open:E,onClose:()=>z(!1),productId:(null==g?void 0:g.id)?Number(g.id):void 0,productName:A,productImage:null==g?void 0:g.image,productCategory:null==g?void 0:g.category,productSubCategory:null==g?void 0:g.subCategory,storeName:null!==(s=null!==(a=null==g?void 0:null===(t=g.Store)||void 0===t?void 0:t.companyName)&&void 0!==a?a:null==g?void 0:g.storeName)&&void 0!==s?s:void 0})]})},tf=n(28432),th=e=>{let{isOpen:t,onClose:n,title:o,modalAction:r,POINT_PRICE_SPECBOOK_DOWNLOAD:l,POINT_PRICE_IMAGE_DOWNLOAD:a,POINT_PRICE_LINK_COMPANY:d,POINT_PRICE_IMAGE_DOWNLOAD_SEAMLESS:s,handleConfirmYes:c,handleConfirmNo:u}=e;return(0,i.jsx)(tf.Z,{isOpen:t,onClose:n,title:o,body:"specdownload"===r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("p",{style:{fontWeight:600,fontSize:18},children:[l,"p가 차감됩니다."]}),(0,i.jsx)("p",{style:{fontWeight:500,fontSize:14},children:"스펙북 다운로드를 진행하시겠습니까?"})]}):"imgdownload"===r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("p",{style:{fontWeight:600,fontSize:18},children:[a,"p가 차감됩니다."]}),(0,i.jsx)("p",{style:{fontWeight:500,fontSize:14},children:"이미지 다운로드를 진행하시겠습니까?"})]}):"imgdownloadseamless"===r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("p",{style:{fontWeight:600,fontSize:18},children:[s,"p가 차감됩니다."]}),(0,i.jsx)("p",{style:{fontWeight:500,fontSize:14},children:"심리스 이미지 다운로드를 진행하시겠습니까?"})]}):"linkclick"===r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("p",{style:{fontWeight:600,fontSize:18},children:[d,"p가 차감됩니다."]}),(0,i.jsx)("p",{style:{fontWeight:500,fontSize:14},children:"링크로 이동하시겠습니까?"})]}):"imgdownloadboard"===r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{style:{fontWeight:600,fontSize:18},children:"보드에 저장하시겠습니까?"}),(0,i.jsx)("p",{style:{fontWeight:500,fontSize:14},children:"보드를 만들어 편리하게 관리하세요."})]}):null,footer:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tf.m,{bgColor:"#333333",hoverColor:"#4C48A3",onClick:c,textColor:"#ffffff",children:"네"}),(0,i.jsx)(tf.m,{bgColor:"white",hoverColor:"white",onClick:()=>{u(),n()},textColor:"black",children:"아니오"})]})})},tg=n(41659),tm=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],[i,r]=(0,o.useState)([]),[l,a]=(0,o.useState)(!1),[d,s]=(0,o.useState)("");return(0,o.useEffect)(()=>{if(null==e){r([]),a(!1),s("");return}let i=new AbortController;return(async()=>{r([]),a(!0),s("");try{let l=localStorage.getItem("TOKEN"),a=(await f.Wg.post("product/similar",{productId:e},{headers:{"Content-Type":"application/json",...l?{Authorization:"Bearer ".concat(l)}:{}},signal:i.signal})).data,d=Array.isArray(a)?a:Array.isArray(null==a?void 0:a.data)?a.data:[];if(!Array.isArray(d))throw Error("유사 제품 응답 형식이 올바르지 않습니다.");let s=d.map(e=>({...e,id:e.id,categoryId:e.categoryId,category:e.category,subCategory:e.subCategory,img:e.img,name:e.name,isNew:"number"==typeof e.isNew?e.isNew:Number(e.isNew||0),isContract:!0===e.isContract,isHighQuality:!0===e.isHighQuality,hasSeamless:!0===e.hasSeamless,isSeamless:!0===e.isSeamless})).filter(t=>t.id!==e).filter((e,t,n)=>n.findIndex(t=>t.id===e.id)===t);if(n&&s.length>0){let e=s.map(e=>e.id).filter(e=>Number.isFinite(e));if(e.length>0)try{let t=await f.Wg.post("product/seamless-map",{ids:e},{signal:i.signal}),n=(null==t?void 0:t.data)&&"object"==typeof t.data?t.data:{};s=s.map(e=>{let t=n[e.id];return t?{...e,img:t.img||e.img,hasSeamless:t.hasSeamless||e.hasSeamless,hasPBR:t.hasPBR||e.hasPBR,isHighQuality:t.isHighQuality||e.isHighQuality}:e})}catch(e){}s=s.filter(e=>e.isHighQuality||e.hasSeamless||e.isSeamless||e.hasPBR)}let c=s.slice(0,6);if(c.length<6&&null!=t)try{var o;let r=localStorage.getItem("TOKEN"),l=await f.Wg.post("product",n?{page:1,categories:[t],isSeamless:!0}:{page:1,categories:[t]},{headers:r?{Authorization:"Bearer ".concat(r)}:{},signal:i.signal}),a=Array.isArray(null===(o=l.data)||void 0===o?void 0:o.products)?l.data.products:[],d=new Set([e,...c.map(e=>e.id)]),s=6-c.length,u=a.filter(e=>(null==e?void 0:e.id)!=null&&!d.has(Number(e.id))).slice(0,s).map(e=>{var t;return{...e,id:Number(e.id),categoryId:Number(e.categoryId),category:"string"==typeof e.category?e.category:(null===(t=e.category)||void 0===t?void 0:t.name)||"",subCategory:"string"==typeof e.subCategory?e.subCategory:"",img:(0,tg.U)(e.img,400),name:e.name,isNew:"number"==typeof e.isNew?e.isNew:Number(e.isNew||0),isContract:!0===e.isContract}});c=[...c,...u]}catch(e){}let u=c.map(e=>e.id).filter(e=>Number.isFinite(e));if(u.length>0)try{let[e,t]=await Promise.all([f.Wg.post("product/contract-map",{ids:u}),f.Wg.post("product/seamless-map",{ids:u}).catch(()=>({data:{}}))]),n=(null==e?void 0:e.data)&&"object"==typeof e.data?e.data:{},i=(null==t?void 0:t.data)&&"object"==typeof t.data?t.data:{},o=c.map(e=>{let t=!0===n[e.id]?{...e,isContract:!0}:{...e},o=i[e.id];return o&&(t={...t,img:o.img||t.img,hasSeamless:o.hasSeamless||t.hasSeamless,hasPBR:o.hasPBR||t.hasPBR,isHighQuality:o.isHighQuality||t.isHighQuality}),t});r(o)}catch(e){r(c)}else r(c)}catch(e){if("CanceledError"===e.name)return;s(e.message||"유사 제품 검색 실패"),r([])}finally{a(!1)}})(),()=>{i.abort()}},[e,t,n]),{similarItems:i,isLoading:l,error:d}};let tx=(0,w.cn)({key:"isItemDetailLoadingAtom",default:!0});var tv=n(3699),tb=n(98346);let tw=(0,a.F4)(["0%{transform:rotate(0deg);}100%{transform:rotate(-360deg);}"]),ty=a.ZP.div.withConfig({componentId:"sc-f04827ce-0"})(["position:fixed;inset:0;background:rgba(255,255,255,0.85);display:flex;justify-content:center;align-items:center;z-index:1000;"]),tj=(0,a.ZP)(B.default).withConfig({componentId:"sc-f04827ce-1"})(["width:100px;height:100px;animation:"," 2s linear infinite;"],tw),tI=a.ZP.div.withConfig({componentId:"sc-f04827ce-2"})(["display:flex;flex-direction:column;align-items:center;"]);var tC=()=>{let[e]=(0,w.FV)(tx);return e?(0,i.jsx)(ty,{"aria-label":"상품 상세 로딩 중",children:(0,i.jsx)(tI,{children:(0,i.jsx)(tj,{src:tb.Z,alt:"Loading spinner"})})}):null};let tk=e=>{var t,n;return(null==e?void 0:null===(n=e.response)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.message)||(null==e?void 0:e.message)||"에러가 발생했습니다."};function tP(e,t){var n,i,o,r,l,a,d,s,c,u,p,f,h,g,m,x,v,b,w,y,j,I,C,k,P,S,Z,A,E,z,M,D,L,N,R,F,T,B,O,W,_,H,U,Q,$;return{...e,image:t.detailImg||t.img||e.image,libThumb:null!==(r=null!==(o=null!==(i=null!==(n=t.img)&&void 0!==n?n:t.image)&&void 0!==i?i:e.libThumb)&&void 0!==o?o:e.img)&&void 0!==r?r:null,ownedSeamless:null!==(a=null!==(l=t.ownedSeamless)&&void 0!==l?l:e.ownedSeamless)&&void 0!==a&&a,ownedPbr:null!==(s=null!==(d=t.ownedPbr)&&void 0!==d?d:e.ownedPbr)&&void 0!==s&&s,subCategory:null!==(c=t.subCategory)&&void 0!==c?c:e.subCategory,name:e.name&&String(e.name).trim()?e.name:null!==(p=null!==(u=t.name)&&void 0!==u?u:e.name)&&void 0!==p?p:"",category:e.category&&String(e.category).trim()?e.category:null!==(h=null!==(f=t.category)&&void 0!==f?f:e.category)&&void 0!==h?h:"",size:null!==(m=null!==(g=t.size)&&void 0!==g?g:e.size)&&void 0!==m?m:"",feature:null!==(v=null!==(x=t.feature)&&void 0!==x?x:e.feature)&&void 0!==v?v:"",packUnit:null!==(w=null!==(b=t.packUnit)&&void 0!==b?b:e.packUnit)&&void 0!==w?w:null,piecesPerBox:null!==(j=null!==(y=t.piecesPerBox)&&void 0!==y?y:e.piecesPerBox)&&void 0!==j?j:null,unitAreaM2:null!==(C=null!==(I=t.unitAreaM2)&&void 0!==I?I:e.unitAreaM2)&&void 0!==C?C:null,unitPyeong:null!==(P=null!==(k=t.unitPyeong)&&void 0!==k?k:e.unitPyeong)&&void 0!==P?P:null,code:null!==(S=t.code)&&void 0!==S?S:e.code,manufacturer:null!==(Z=t.store)&&void 0!==Z?Z:e.manufacturer,brand:null!==(E=null!==(A=t.brand)&&void 0!==A?A:e.brand)&&void 0!==E?E:null,series:null!==(M=null!==(z=t.series)&&void 0!==z?z:e.series)&&void 0!==M?M:null,origin:null!==(L=null!==(D=t.origin)&&void 0!==D?D:e.origin)&&void 0!==L?L:"",country:null!==(R=null!==(N=t.country)&&void 0!==N?N:e.country)&&void 0!==R?R:"",glossiness:null!==(T=null!==(F=t.glossiness)&&void 0!==F?F:e.glossiness)&&void 0!==T?T:"",price:null!==(O=null!==(B=t.price)&&void 0!==B?B:e.price)&&void 0!==O?O:0,salePrice:null!==(W=t.salePrice)&&void 0!==W?W:null,__mtLoaded:!0,url:null!==(H=null!==(_=t.url)&&void 0!==_?_:e.url)&&void 0!==H?H:null,isContract:null!==(Q=null!==(U=t.isContract)&&void 0!==U?U:e.isContract)&&void 0!==Q&&Q,mytextureCases:Array.isArray(t.cases)?t.cases:[],viewCount:null!==($=t.viewCount)&&void 0!==$?$:e.viewCount,imgCount:"number"==typeof t.imgCount?t.imgCount:e.imgCount,specCount:"number"==typeof t.specCount?t.specCount:e.specCount}}let tS=a.ZP.div.withConfig({componentId:"sc-80e59f3e-0"})(["display:flex;gap:12px;width:100%;position:relative;"]),tZ=a.ZP.div.withConfig({componentId:"sc-80e59f3e-1"})(["flex:0 0 auto;display:flex;align-items:center;"]),tA=a.ZP.button.withConfig({componentId:"sc-80e59f3e-2"})(["display:inline-flex;align-items:center;gap:4px;height:30px;padding:0 12px;border-radius:8px;font-size:14px;font-weight:700;cursor:pointer;white-space:nowrap;border:1px solid #413d7d;background:#413d7d;color:#fff;transition:background 0.15s ease,border-color 0.15s ease;&:hover{opacity:0.92;}@media (max-width:768px){display:none;}"]),tE=a.ZP.div.withConfig({componentId:"sc-80e59f3e-3"})(["flex:1 1 auto;"]),tz=a.ZP.div.withConfig({componentId:"sc-80e59f3e-4"})(["margin-top:10px;"]),tM=a.ZP.div.withConfig({componentId:"sc-80e59f3e-5"})(["margin-top:2px;[data-reflow] &{flex:1 1 auto;}"]),tD=a.ZP.div.withConfig({componentId:"sc-80e59f3e-6"})(["display:flex;justify-content:space-between;align-items:center;padding:5px 0;@media (max-width:768px){padding:0 56px 0 0;}"]),tL=a.ZP.div.withConfig({componentId:"sc-80e59f3e-7"})(["padding:8px 4px 0 4px;min-width:320px;max-width:520px;"]),tN=a.ZP.h3.withConfig({componentId:"sc-80e59f3e-8"})(["margin:0 0 12px;font-size:18px;font-weight:600;"]),tR=a.ZP.div.withConfig({componentId:"sc-80e59f3e-9"})(["display:flex;justify-content:flex-end;gap:8px;margin-top:16px;"]);var tF=e=>{var t,n,a,p;let{userId:h,productDetail:g,selProductId:I,selSizeIdArr:C,isBoard:k,setSelProductId:P,GetProductDetail:S,filterSnapshot:Z,onOptimisticPreview:A}=e;parseInt("6500",10);let E=parseInt("0",10);parseInt("300",10);let R=parseInt("0",10),F=parseInt("0",10),{userMe:T,authState:B,ensureUserLoggedIn:O,ensurePhoneAuth:W,performActionWithPoints:_}=(0,j.C)(),{modalOpen:H,setModalOpen:U,modalAction:Q,setModalAction:$,pendingSeamless:K,setPendingSeamless:V,boardSaveOnly:G,setBoardSaveOnly:Y}=function(){let[e,t]=(0,o.useState)(!1),[n,i]=(0,o.useState)(null),[r,l]=(0,o.useState)(!1),[a,d]=(0,o.useState)(!1);return{modalOpen:e,setModalOpen:t,modalAction:n,setModalAction:i,pendingSeamless:r,setPendingSeamless:l,boardSaveOnly:a,setBoardSaveOnly:d}}(),[q,J]=(0,o.useState)(g);(0,o.useEffect)(()=>{let e=null==g?void 0:g[0];if(!e||!(e.id<0||!0===e.isHighQuality))return;let t=null==q?void 0:q[0];if((null==t?void 0:t.id)===e.id&&(null==t?void 0:t.__mtLoaded))return;let n=(0,eH.sk)(e.id);n&&J(e=>e&&e[0]?[tP(e[0],n)]:e)},[g]),(0,o.useEffect)(()=>{var e,t,n,i;if(!g||0===g.length)return;if((null===(e=g[0])||void 0===e?void 0:e.id)!==(null==q?void 0:null===(t=q[0])||void 0===t?void 0:t.id)){J(g);return}let o=!(null==q?void 0:null===(n=q[0])||void 0===n?void 0:n.price),r=!!(null===(i=g[0])||void 0===i?void 0:i.price);o&&r&&J(g)},[g]),(0,o.useEffect)(()=>{let e=null==g?void 0:g[0];if(!e||!(e.id<0||!0===e.isHighQuality))return;let t=null==q?void 0:q[0];if((null==t?void 0:t.id)===e.id&&(null==t?void 0:t.__mtLoaded))return;let n=!0;return(0,eH.aX)(e.id).then(t=>{if(!n)return;let i=t||{};J(t=>[tP(t&&t[0]||e,i)])}).catch(()=>{n&&J(e=>e&&e[0]?[{...e[0],__mtLoaded:!0}]:e)}),()=>{n=!1}},[g]);let[X,ee]=(0,o.useState)([]);(0,o.useEffect)(()=>{let e=null==g?void 0:g[0];if(!e)return;if(!(e.id<0||!0===e.isHighQuality)){ee([]);return}let t=!0,n=new AbortController,i=e=>(null==e?void 0:e.isHighQuality)||(null==e?void 0:e.hasSeamless)||(null==e?void 0:e.isSeamless)||(null==e?void 0:e.hasPBR);return(async()=>{try{let r=localStorage.getItem("TOKEN"),l=await f.Wg.post("/product/mytexture/similar",{id:e.id,category:e.category},{signal:n.signal,...r?{headers:{Authorization:"Bearer ".concat(r)}}:{}}),a=Array.isArray(l.data)?l.data:[];if((null==Z?void 0:Z.isSeamless)&&(a=a.filter(i).slice(0,6)).length<6)try{var o;let t=await f.Wg.post("product",{page:1,isSeamless:!0},{signal:n.signal}),i=Array.isArray(null===(o=t.data)||void 0===o?void 0:o.products)?t.data.products:[],r=new Set([Number(e.id),...a.map(e=>Number(e.id))]),l=i.filter(e=>(null==e?void 0:e.id)!=null&&!r.has(Number(e.id))).slice(0,6-a.length).map(e=>({...e,img:(0,tg.U)(e.img,400)}));a=[...a,...l]}catch(e){}t&&ee(a)}catch(e){}})(),()=>{t=!1,n.abort()}},[g,Z]);let[et,en]=(0,o.useState)(!1),[ei,eo]=(0,o.useState)(!1),[er,el]=(0,o.useState)(null),[ea,ed]=(0,o.useState)(!1),[es,ec]=(0,o.useState)(!1),[eu,ep]=(0,o.useState)(null),[ef,eh]=(0,o.useState)(!1),em=(0,w.Zl)(tv.Z);(0,o.useEffect)(()=>{em(ef)},[ef,em]),(0,o.useEffect)(()=>()=>em(!1),[em]);let[ex,ev]=(0,o.useState)(null),[eb,ew]=(0,o.useState)(!1),[ey,ej]=(0,o.useState)(!1),[eI,eC]=(0,o.useState)(""),[ek,eP]=(0,w.FV)(tx),[eS,eZ]=(0,o.useState)(!1);(0,d.useRouter)(),(0,d.usePathname)();let{mutateAsync:eA}=(0,D.Z)({onError:e=>{s.Am.error(e,{position:"bottom-center",autoClose:2e3,pauseOnHover:!1})},onSuccess:()=>{}}),{data:eE}=(0,c.Z)({includeShared:!0}),{data:eM}=m(),eD=(0,o.useMemo)(()=>{if(!eE)return[];let e=eE.find(e=>e.isDefault),t=eE.filter(e=>!e.isDefault);return e?[e,...t]:eE},[eE]),eN=(0,o.useRef)(!0);(0,o.useEffect)(()=>{eN.current&&(eN.current=!1,eM?ep(eM.id):eD.length>0&&ep(eD[0].id))},[eM,eD]);let eR=v({onSuccess:()=>{if(q&&q[0]){let e=[...q];e[0].specCount+=1,J(e)}},onError:e=>{let t=tk(e)||"스펙북 다운로드에 실패했습니다.";s.Am.error(t,{position:"bottom-center",autoClose:2e3,pauseOnHover:!1})}});b({onSuccess:()=>{(0,y.sendGTMEvent)({event:"download-img",value:"download-img",source:"detail",gtm:{elementId:"download-img"}})},onError:e=>{s.Am.error("string"==typeof e&&e&&"An error occurred"!==e?e:"이미지 다운로드에 실패했습니다.",{position:"bottom-center",autoClose:2e3})}});let{run:eF,state:eT}=z(),{addBoardToProduct:eB,loading:eO,error:eW}=M({onSuccess:()=>{if(!es&&q&&q[0]){let e=[...q];e[0].boardCount=(e[0].boardCount||0)+1,J(e),ec(!0)}},onError:e=>{s.Am.error(e||"보드 저장에 실패했습니다.",{position:"bottom-center",autoClose:2e3})}}),{addCart:e_}=(0,L.Z)({onSuccess:()=>{s.Am.success("샘플\xb7스펙북에 담겼습니다!",{position:"bottom-center",autoClose:2e3})},onError:e=>{s.Am.error(e,{position:"bottom-center",autoClose:2e3})}}),{mutate:eU}=(0,N.Z)({onSuccess:()=>{s.Am.success("샘플\xb7스펙북에서 제거되었습니다!",{position:"bottom-center",autoClose:2e3})},onError:e=>{s.Am.error(tk(e)||"샘플\xb7스펙북에서 제거에 실패했습니다.",{position:"bottom-center",autoClose:2e3})}});(0,o.useEffect)(()=>{if(!g||0===g.length)return;let e=g[0];J(t=>{let n=null==t?void 0:t[0];return n&&n.id===(null==e?void 0:e.id)&&n.__mtLoaded&&!e.__mtLoaded?t:g}),ec(!1)},[g]),(0,o.useEffect)(()=>{q&&0!==q.length?eP(!1):eP(!0)},[q,eP]),(0,o.useEffect)(()=>{/Mobi|Android/i.test(window.navigator.userAgent)},[]);let eQ=null!==(a=null==q?void 0:null===(t=q[0])||void 0===t?void 0:t.id)&&void 0!==a?a:null,{similarItems:e$,isLoading:eK,error:eV}=tm(null!=eQ&&eQ<0?null:eQ,null!==(p=null==q?void 0:null===(n=q[0])||void 0===n?void 0:n.categoryId)&&void 0!==p?p:null,!!(null==Z?void 0:Z.isSeamless)),{data:eG}=(0,u.pW)({root:!0});if(!q||0===q.length)return(0,i.jsx)(tC,{});let eY=q[0],eq=((null==eY?void 0:eY.id)<0||(null==eY?void 0:eY.isHighQuality)===!0)&&!(null==eY?void 0:eY.__mtLoaded),eJ=async(e,t,n)=>{if(!O()||!W())return;let i=(n||"").trim();if(!i){s.Am.error("프로젝트명을 입력해 주세요.",{position:"bottom-center",autoClose:2e3});return}eR.mutate({id:e,sizeId:t,projectName:i}),(0,y.sendGTMEvent)({event:"download-spec",value:"download-spec",gtm:{elementId:"download-spec"}})},eX=async()=>{O()&&W()&&(eC((null==eY?void 0:eY.name)?"".concat(eY.name):""),ej(!0))},e0=async()=>{await eJ(I,C,eI),ej(!1)},e1=async e=>{e.preventDefault(),O()&&W()&&await e7()},e2=async()=>{ei&&window.sketchup&&"function"==typeof window.sketchup.downComplete&&window.sketchup.downComplete(h,I,eS?"seamless":"jpg")},e4=async()=>{O()&&(ed(!0),V(!1),await e9(!1))},e5=async()=>{O()&&(ed(!0),V(!0),await e9(!0),V(!1))},e3=async()=>{O()&&(ed(!0),V(!1),await e9(!1,!0))},e9=async function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];eZ(!!e),el(n?"pbr":e?"seamless":"jpg");let i=null!==(t=null==q?void 0:q[0])&&void 0!==t?t:{},o=n?!!i.ownedPbr:!!i.ownedSeamless,r=t=>({...t,...n?{ownedPbr:!0}:e?{ownedSeamless:!0}:{}});0>Number(I)&&(0,eH.py)(Number(I)),await eF({productId:I,sizeId:C,isSeamless:e,isPBR:n,source:"detail",owned:o,userId:h,onPluginApplied:()=>{J(e=>e&&e[0]?[r(e[0]),...e.slice(1)]:e),eo(!0)},onWebSuccess:()=>{J(e=>{if(!e||!e[0])return e;let t=r(e[0]);return t.imgCount=(e[0].imgCount||0)+1,[t,...e.slice(1)]}),eo(!0)}})},e7=async()=>{let e=q[0];try{await eA({id:e.id,url:e.url})}catch(e){}(0,y.sendGTMEvent)({event:"link-to-company",value:"link-to-company",gtm:{elementId:"link-to-company"}}),window.open(e.url,"_blank")},tt=async()=>{if(U(!1),"imgdownloadboard"===Q){null!=eu&&(ev(eu),eB(eu,eY.id)),await e9(!!K),V(!1);return}"imgdownload"===Q?await e9(!1):"imgdownloadseamless"===Q?(await e9(!0),V(!1)):"linkclick"===Q&&await e7()},tn=async()=>{U(!1),"imgdownloadboard"===Q?(await e9(!!K),V(!1)):"linkclick"===Q&&await e7()},ti="string"==typeof q[0].seamlessImage?q[0].seamlessImage.trim().length>0:!!q[0].seamlessImage,to=!!(null==eY?void 0:eY.id)&&(null!=eG?eG:[]).some(e=>Number(e.id)===Number(eY.id)),tr=null==q?void 0:q[0],tl=!!tr&&(tr.id<0||!0===tr.isHighQuality),ta=Array.from(new Set((tr?tl?[tr.image,tr.libThumb,...tr.mytextureCases||[]]:[tr.detailImg||tr.image,tr.image,...tr.cases||[]]:[]).filter(Boolean)));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(tS,{children:[(0,i.jsx)(eL,{productId:eY.id,isOpen:ef,onClose:()=>eh(!1),orderedBoards:eD,isBoardSaved:e=>{var t;return null===(t=e.products)||void 0===t?void 0:t.some(e=>e.id===eY.id)},onSaveItem:e=>{null!=eY.id&&(ep(e),ev(e),eB(e,eY.id))},savedInRoot:to}),(0,i.jsxs)(tE,{children:[(0,i.jsxs)(ez.W2,{children:[(0,i.jsxs)(tz,{children:[(0,i.jsxs)(tD,{children:[(0,i.jsx)(tA,{type:"button",onClick:()=>eh(e=>!e),children:ef?"> My 아카이브 닫기":"< My 아카이브 열기"}),(0,i.jsx)(tZ,{children:(0,i.jsx)(te,{productDetail:q,isHeartFull:et})})]}),(0,i.jsx)(e8.Z,{handleSeamlessImageButtonClick:e5,productDetail:q,handleLinkClick:e1,userMe:null!=T?T:void 0,POINT_PRICE_LINK_COMPANY:F.toString(),POINT_PRICE_IMAGE_DOWNLOAD:E.toString(),POINT_PRICE_IMAGE_DOWNLOAD_SEAMLESS:"0",handleImageButtonClick:e4,handlePbrImageButtonClick:e3,dlMode:er,addBoardToProduct:eB,addBoardLoading:eO,isSeamless:ti,imgDownloadState:eT,mytextureImages:ta,mytextureId:tl?tr.id:void 0})]}),(0,i.jsxs)(ez.Mv,{children:[(0,i.jsx)(eg,{isDetailPending:eq,productDetail:q,isNoDataModalOpen:eb,setIsNoDataModalOpen:ew}),(0,i.jsx)(ez.iz,{}),(0,i.jsx)(tM,{}),(0,i.jsx)(tp,{isBoard:k,handleSpecDownloadButtonClick:eX,handleBoardButtonClick:e2,handleCartClick:()=>{var e,t;let n;if(!O())return;let i=null==q?void 0:null===(e=q[0])||void 0===e?void 0:e.id;if(null!=i){try{(null!==(t=sessionStorage.getItem("mcd_viewsrc:".concat(i)))&&void 0!==t?t:"").startsWith("board")&&(n="board_detail")}catch(e){}e_(i,n?{source:n}:void 0)}},userMe:T,currentProductDetail:q,POINT_PRICE_SPECBOOK_DOWNLOAD:R,POINT_PRICE_IMAGE_DOWNLOAD:E,isNoDataModalOpen:eb,setIsNoDataModalOpen:ew})]})]}),(0,i.jsx)(e6,{items:tl?X:e$,isLoading:!tl&&eK,error:tl?void 0:eV,onItemClick:e=>{(0,y.sendGTMEvent)({event:"click-similar",value:"click-similar",gtm:{elementId:"click-similar"}}),null==A||A({id:e.id,name:e.name,img:e.img,category:e.category,subCategory:e.subCategory,categoryId:e.categoryId,isNew:e.isNew,isContract:e.isContract,code:e.code,store:e.store,detailImg:e.detailImg,size:e.size,country:e.country,origin:e.origin,glossiness:e.glossiness,feature:e.feature,price:e.price,manufacturer:e.manufacturer,brand:e.brand,series:e.series,salePrice:e.salePrice,isHighQuality:e.isHighQuality,isPBR:e.isPBR,isSeamless:e.isSeamless}),P(e.id),S(h,e.id,!0,"ai_reco")}}),(0,i.jsx)(th,{isOpen:H,onClose:()=>U(!1),title:"linkclick"===Q?"링크 이동":"imgdownloadboard"===Q?"보드 저장":"포인트 사용",modalAction:Q,POINT_PRICE_SPECBOOK_DOWNLOAD:R,POINT_PRICE_IMAGE_DOWNLOAD:E,POINT_PRICE_LINK_COMPANY:F,POINT_PRICE_IMAGE_DOWNLOAD_SEAMLESS:0,handleConfirmYes:tt,handleConfirmNo:tn})]})]}),ey&&(0,i.jsx)(x.Z,{onClose:()=>ej(!1),containerWidth:"min(92vw, 480px)",children:(0,i.jsxs)(tL,{children:[(0,i.jsx)(tN,{children:"프로젝트명 입력"}),(0,i.jsx)(r.Z,{autoFocus:!0,margin:"dense",label:"프로젝트명을 정확히 입력해주세요",fullWidth:!0,onChange:e=>eC(e.target.value),onKeyDown:e=>{"Enter"===e.key&&e0()}}),(0,i.jsxs)(tR,{children:[(0,i.jsx)(l.Z,{onClick:()=>ej(!1),children:"취소"}),(0,i.jsx)(l.Z,{variant:"contained",onClick:e0,children:"다운로드"})]})]})})]})},tT=n(26123),tB=e=>{let{isModal:t,detailRef:n,imgListArrGrid:o,handleDetailClose:r,userId:l,selectedDetail:a,selProductId:d,setSelProductId:s,GetProductDetail:c,isSampleContentVisible:u,handleCloseSampleContent:p,filterSnapshot:f,onOptimisticPreview:h}=e;return(0,i.jsx)(tT.Vm,{imgListArrGrid:o,ref:n,children:(0,i.jsx)(tT.Mv,{isModal:t,showDetail:!0,children:(0,i.jsx)(tF,{userId:l,productDetail:a,selProductId:d,selSizeIdArr:0,isBoard:!1,setSelProductId:s,GetProductDetail:c,filterSnapshot:f,onOptimisticPreview:h})})})}},18980:function(e,t,n){var i=n(57437),o=n(2265),r=n(88862),l=n(21198),a=n(33145),d=n(99376),s=n(41659),c=n(64779);let u=r.ZP.div.withConfig({componentId:"sc-e4f9812d-0"})(["display:flex;flex-direction:column;gap:",";padding:",";box-sizing:border-box;background:#f6f7f9;width:100%;max-width:150px;position:relative;height:","px;"],e=>{let{isModal:t}=e;return t?"8px":"12px"},e=>{let{isModal:t}=e;return t?"6px":"10px"},e=>{let{fixedHeight:t}=e;return t}),p=r.ZP.div.withConfig({componentId:"sc-e4f9812d-1"})(["overflow:hidden;position:relative;flex:1;"]),f=r.ZP.div.withConfig({componentId:"sc-e4f9812d-2"})(["display:flex;flex-direction:column;gap:8px;transition:transform 0.25s ease;transform:translateY(","px);padding:4px 0;"],e=>{let{translateY:t}=e;return t}),h=r.ZP.div.withConfig({componentId:"sc-e4f9812d-3"})(["display:flex;flex-direction:column;cursor:pointer;border-radius:6px;padding:",";background:",";border:",";transition:background 0.15s,border 0.15s;position:relative;min-height:80px;"," &:hover{background:",";}html.su-plugin &{outline:none !important;-webkit-tap-highlight-color:transparent;}html.su-plugin &:focus,html.su-plugin &:focus-visible,html.su-plugin &:active{outline:none !important;box-shadow:none;}"],e=>{let{isModal:t}=e;return t?"4px":"6px"},e=>{let{selected:t}=e;return t?"#eef6ff":"#ffffff"},e=>{let{selected:t}=e;return t?"1px solid #538bff":"1px solid #f0f0f0"},e=>{let{isModal:t}=e;return t?(0,r.iv)(["box-shadow:none;"]):(0,r.iv)(["box-shadow:0 1px 3px rgba(0,0,0,0.08);"])},e=>{let{selected:t}=e;return t?"#e5efff":"#f8f8f8"}),g=r.ZP.div.withConfig({componentId:"sc-e4f9812d-4"})(["position:relative;width:100%;aspect-ratio:1 / 1;border-radius:4px;overflow:hidden;background:#fafafa;"]),m=r.ZP.div.withConfig({componentId:"sc-e4f9812d-5"})(["position:absolute;top:",";left:",";z-index:2;pointer-events:none;line-height:0;"],e=>{let{isModal:t}=e;return t?"3px":"4px"},e=>{let{isModal:t}=e;return t?"3px":"4px"}),x=r.ZP.div.withConfig({componentId:"sc-e4f9812d-6"})(["position:absolute;top:0;left:0;width:100%;height:100%;background:#e0e0e0;"]),v=r.ZP.div.withConfig({componentId:"sc-e4f9812d-7"})(["font-size:",";margin-top:4px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"],e=>{let{isModal:t}=e;return"14px"}),b=r.ZP.div.withConfig({componentId:"sc-e4f9812d-8"})(["font-size:",";margin-top:2px;line-height:1.1;color:#6b7280;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"],e=>{let{isModal:t}=e;return"12px"}),w=r.ZP.button.withConfig({componentId:"sc-e4f9812d-9"})(["position:absolute;left:50%;transform:translateX(-50%);width:32px;height:32px;padding:6px;border-radius:50%;border:1px solid #d1d5db;background:#ffffff;display:flex;align-items:center;justify-content:center;cursor:pointer;user-select:none;box-shadow:0 2px 6px rgba(0,0,0,0.08);transition:background 0.15s,opacity 0.15s;z-index:2;"," "," &:hover:not(:disabled){background:#f5f7fa;}&:disabled{cursor:not-allowed;opacity:0.4;}"],e=>{let{top:t}=e;return t&&(0,r.iv)(["top:6px;transform:translate(-50%,-50%);"])},e=>{let{bottom:t}=e;return t&&(0,r.iv)(["bottom:4px;transform:translate(-50%,0);"])});t.Z=e=>{let{recentPreview:t,selProductId:n,onRecentClick:r,isModal:y=!1,syncQueryParam:j=!0}=e,I=(0,o.useRef)(null),C=(0,o.useRef)(0),[k,P]=(0,o.useState)(570);(0,o.useLayoutEffect)(()=>{let e=null,t=0,n=e=>P(Math.max(360,e.offsetHeight-68)),i=()=>{let o=document.querySelector("[data-dual-main]");if(!o){t=requestAnimationFrame(i);return}n(o),e||(e=new ResizeObserver(()=>n(o))).observe(o)};return i(),window.addEventListener("resize",i),()=>{t&&cancelAnimationFrame(t),e&&e.disconnect(),window.removeEventListener("resize",i)}},[t]);let[S,Z]=(0,o.useState)(0),[A,E]=(0,o.useState)(0),[z,M]=(0,o.useState)({}),D=(0,d.useRouter)(),L=(0,d.usePathname)(),N=(0,d.useSearchParams)(),R=e=>{if(!j)return;let t=new URLSearchParams(null==N?void 0:N.toString());t.set("pid",String(e));let n="".concat(L,"?").concat(t.toString());D.replace(n,{scroll:!1})},F=(0,o.useRef)(null);(0,o.useEffect)(()=>{let e=t.findIndex(e=>e.id===n);-1!==e&&F.current!==n&&(F.current=n,Z(t=>e=t+4?e-4+1:t))},[n,t]),(0,o.useEffect)(()=>{if(I.current){let e=I.current.querySelector('[data-item-index="0"]');e&&E(e.getBoundingClientRect().height+8)}},[y,t]);let T=S>0,B=S+4{T&&Z(e=>Math.max(0,e-1))},[T]),W=(0,o.useCallback)(()=>{B&&Z(e=>Math.min(t.length-4,e+1))},[B,t.length]),_=(0,o.useCallback)(e=>{e.preventDefault(),A&&(C.current+=e.deltaY,C.current>=A?(W(),C.current=0):C.current<=-A&&(O(),C.current=0))},[A,W,O]),H=e=>{r(e),R(e.id)};return(0,i.jsxs)(u,{isModal:y,fixedHeight:k,children:[(0,i.jsx)(w,{onClick:O,disabled:!T,"aria-label":"이전 상품 보기",top:!0,children:(0,i.jsx)(a.default,{src:"/images/modal/upper.svg",alt:"위로",width:16,height:16,"aria-hidden":"true"})}),(0,i.jsx)(p,{onKeyDown:e=>{"ArrowUp"===e.key?O():"ArrowDown"===e.key&&W()},onWheel:_,tabIndex:0,children:(0,i.jsx)(f,{ref:e=>{I.current=e},translateY:-(A||0)*S,"aria-live":"polite",children:t.map((e,t)=>(0,i.jsxs)(h,{"data-item-index":t,onMouseEnter:()=>(0,l.Xm)(Number(e.id)),onClick:()=>H(e),selected:e.id===n,isModal:y,"aria-label":"최근 본 상품 ".concat(e.name),children:[(0,i.jsxs)(g,{isModal:y,children:[!z[e.id]&&(0,i.jsx)(x,{}),(0,i.jsx)(a.default,{src:(0,s.U)(e.image,200),alt:e.name,fill:!0,sizes:y?"60px":"80px",onLoadingComplete:()=>M(t=>({...t,[e.id]:!0})),style:{position:"absolute",top:0,left:0,objectFit:"cover",opacity:z[e.id]?1:0,transition:"opacity 0.3s ease-in-out"},priority:!1}),e.isHighQuality||e.hasSeamless&&e.hasPBR?(0,i.jsx)(m,{isModal:y,children:(0,i.jsx)(c.vW,{size:y?22:28})}):e.hasSeamless?(0,i.jsx)(m,{isModal:y,children:(0,i.jsx)(c.BD,{size:y?22:28})}):null]}),(0,i.jsx)(v,{isModal:y,children:e.name}),(0,i.jsxs)(b,{isModal:y,children:[e.category," / ",e.subCategory]})]},e.id))})}),(0,i.jsx)(w,{onClick:W,disabled:!B,"aria-label":"다음 상품 보기",bottom:!0,children:(0,i.jsx)(a.default,{src:"/images/modal/down.svg",alt:"아래로",width:16,height:16,"aria-hidden":"true"})})]})}},45658:function(e,t,n){n.d(t,{Z:function(){return s}});var i=n(57437);n(2265);var o=n(43618),r=n(3699),l=n(60185),a=n(7944),d=n(18980);function s(e){var t;let{onClose:n,detailRef:s,imgListArrGrid:c,userId:u,selectedDetail:p,selProductId:f,setSelProductId:h,GetProductDetail:g,isSampleContentVisible:m,handleCloseSampleContent:x,recentPreviewList:v,onRecentClick:b,filterSnapshot:w,onOptimisticPreview:y}=e,j=(null!==(t=null==v?void 0:v.length)&&void 0!==t?t:0)>0,I=(0,o.sJ)(r.Z);return(0,i.jsx)(l.Z,{onClose:n,pickerOpen:I,mainContent:(0,i.jsx)(a.Z,{isModal:!0,detailRef:s,imgListArrGrid:c,handleDetailClose:n,userId:u,selectedDetail:p,selProductId:f,isSampleContentVisible:m,handleCloseSampleContent:x,setSelProductId:h,GetProductDetail:g,filterSnapshot:w,onOptimisticPreview:y}),sideContent:j?(0,i.jsx)(d.Z,{recentPreview:v,selProductId:f,onRecentClick:b}):void 0,mainWidth:"75%",sideWidth:"15%",sideOnRight:!0,containerStyle:{borderRadius:20,padding:0},sideContainerStyle:{maxWidth:"400px"}})}},19966:function(e,t,n){n.d(t,{C:function(){return d}});var i=n(7261),o=n(43618),r=n(89723),l=n(35775),a=n(99376);let d=()=>{let e=(0,l.Z)(),t=(0,o.sJ)(r.Z),n=(0,a.useRouter)();return{userMe:e,authState:t,ensureUserLoggedIn:()=>!!e||(n.push("/login"),!1),ensurePhoneAuth:()=>!!t.isPhoneAuth||(i.Am.error("프로필 정보 입력 후 가능합니다.",{position:"bottom-center",autoClose:2e3,pauseOnHover:!0}),!1),performActionWithPoints:async(e,t,n)=>{await n()}}}},33905:function(e,t,n){var i=n(57437),o=n(2265),r=n(88862);let l="undefined"!=typeof WeakMap?new WeakMap:null,a=null;function d(e){let t=(0,o.useRef)(null),n=(0,o.useRef)(null),[i,r]=(0,o.useState)(0);return(0,o.useEffect)(()=>{let e=t.current,i=n.current;if(!e||!i)return;let o=()=>{let t=i.scrollWidth-e.clientWidth,n=t>2?t:0;r(e=>e===n?e:n)},d="undefined"==typeof ResizeObserver?null:(a||(a=new ResizeObserver(e=>{var t;for(let n of e)null==l||null===(t=l.get(n.target))||void 0===t||t()})),a);if(!d||!l){o();return}return l.set(e,o),d.observe(e),()=>{d.unobserve(e),l.delete(e)}},[e]),{wrapRef:t,innerRef:n,overflow:i}}let s=e=>{let{text:t}=e,{wrapRef:n,innerRef:o,overflow:r}=d(t);return(0,i.jsx)(p,{ref:n,title:t,$hasOverflow:r>0,children:(0,i.jsx)(f,{ref:o,$distance:r,style:{"--marquee-d":"-".concat(r,"px")},children:t})})},c=e=>{let{text:t}=e,{wrapRef:n,innerRef:o,overflow:r}=d(t);return(0,i.jsx)(h,{ref:n,title:t,$hasOverflow:r>0,children:(0,i.jsx)(g,{ref:o,style:{"--marquee-d":"-".concat(r,"px")},children:t})})};t.Z=e=>{let{name:t,category:n,subCategory:o}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s,{text:t}),(0,i.jsx)(c,{text:"".concat(null!=n?n:"").concat(o?" / ".concat(o):"")})]})};let u=(0,r.F4)(["0%,12%{transform:translateX(0);}88%,100%{transform:translateX(var(--marquee-d,0px));}"]),p=r.ZP.div.withConfig({componentId:"sc-7a91df64-0"})(["width:100%;margin-top:3px;overflow:hidden;white-space:nowrap;font-size:13px;font-weight:600;color:#111;line-height:1.1;",""],e=>{let{$hasOverflow:t}=e;return t&&(0,r.iv)(["mask-image:linear-gradient( to right,#000 calc(100% - 16px),transparent 100% );-webkit-mask-image:linear-gradient( to right,#000 calc(100% - 16px),transparent 100% );[data-product-card]:hover & span{will-change:transform;animation:"," 2.5s ease-in-out infinite;}"],u)}),f=r.ZP.span.withConfig({componentId:"sc-7a91df64-1"})(["display:inline-block;white-space:nowrap;"]),h=r.ZP.span.withConfig({componentId:"sc-7a91df64-2"})(["font-size:13px;line-height:1.1;color:#888381;display:block;width:100%;max-width:100%;overflow:hidden;white-space:nowrap;min-width:0;",""],e=>{let{$hasOverflow:t}=e;return t?(0,r.iv)(["mask-image:linear-gradient( to right,#000 calc(100% - 16px),transparent 100% );-webkit-mask-image:linear-gradient( to right,#000 calc(100% - 16px),transparent 100% );[data-product-card]:hover & span{will-change:transform;animation:"," 2.5s ease-in-out infinite;}"],u):(0,r.iv)(["text-overflow:ellipsis;"])}),g=r.ZP.span.withConfig({componentId:"sc-7a91df64-3"})(["display:inline-block;white-space:nowrap;"])},32839:function(e,t,n){var i=n(57437),o=n(2265),r=n(88862);t.Z=e=>{let{count:t}=e,[n,r]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{r("undefined"!=typeof document&&document.documentElement.classList.contains("su-plugin"))},[]),(0,i.jsx)(d,{"aria-busy":"true","aria-label":"제품 목록 불러오는 중",children:Array.from({length:null!=t?t:n?9:36}).map((e,t)=>(0,i.jsxs)(s,{style:{animationDelay:"".concat(t%6*.06,"s")},children:[(0,i.jsx)(c,{}),(0,i.jsxs)(u,{children:[(0,i.jsx)(p,{$w:"82%"}),(0,i.jsx)(p,{$w:"56%"})]})]},t))})};let l=(0,r.F4)(["0%{background-position:-200px 0;}100%{background-position:calc(200px + 100%) 0;}"]),a=(0,r.iv)(["background:#eef0f3;background-image:linear-gradient(90deg,#eef0f3 0px,#f7f8fa 60px,#eef0f3 120px);background-size:200px 100%;background-repeat:no-repeat;animation:"," 1.4s ease-in-out infinite;"],l),d=r.ZP.div.withConfig({componentId:"sc-76df08f8-0"})(["display:grid;justify-content:start;align-content:start;width:100%;padding:0.5rem;grid-template-columns:repeat(auto-fill,minmax(220px,220px));gap:0rem 0.5rem;@media (max-width:768px){grid-template-columns:repeat(2,1fr);}@media (min-width:769px) and (max-width:1440px){grid-template-columns:repeat(auto-fill,minmax(165px,165px));gap:10px 8px;}html.su-plugin &{grid-template-columns:repeat(auto-fill,minmax(165px,1fr));gap:5px 8px;}"]),s=r.ZP.div.withConfig({componentId:"sc-76df08f8-1"})(["display:flex;flex-direction:column;padding:6px 0;min-width:0;html.su-plugin &{padding:3px 0;}"]),c=r.ZP.div.withConfig({componentId:"sc-76df08f8-2"})(["position:relative;width:100%;padding-bottom:100%;border-radius:4px;"," @media (max-width:768px){padding-bottom:75%;}html.su-plugin &{padding-bottom:100%;}"],a),u=r.ZP.div.withConfig({componentId:"sc-76df08f8-3"})(["padding:3px 7px 0;display:flex;flex-direction:column;gap:5px;@media (max-width:768px){padding:3px 7px 0;}"]),p=r.ZP.div.withConfig({componentId:"sc-76df08f8-4"})(["height:12px;width:",";border-radius:6px;"," @media (max-width:768px){height:11px;}"],e=>{let{$w:t}=e;return null!=t?t:"70%"},a)},89892:function(e,t,n){n.d(t,{Z:function(){return p}});var i=n(57437),o=n(2265),r=n(88862);let l=(0,r.iv)(["position:relative;border-radius:12px;overflow:hidden;transition:box-shadow 0.2s ease;&::after{content:'';position:absolute;inset:0;border-radius:inherit;border:1px solid #e0e0e0;pointer-events:none;z-index:1;transition:border-color 0.2s ease;}& [role='img']{transition:transform 0.4s ease;}&:hover{box-shadow:0 20px 25px -5px rgba(0,0,0,0.1),0 8px 10px -6px rgba(0,0,0,0.1);}&:hover::after{border-color:#000000;}&:hover [role='img']{transform:scale(1.1);}"]);var a=n(41659);let d="undefined"!=typeof WeakMap?new WeakMap:null,s=null,c=r.ZP.div.withConfig({componentId:"sc-9eb1f7f5-0"})(["position:relative;width:100%;padding-bottom:100%;background:#efece6;"," @media (max-width:768px){padding-bottom:75%;}html.su-plugin &{padding-bottom:100% !important;background:transparent !important;}"],l),u=r.ZP.div.withConfig({componentId:"sc-9eb1f7f5-1"})(["position:absolute;inset:0;background-size:cover;background-position:center;background-repeat:no-repeat;opacity:",";transition:opacity 0.2s ease;"],e=>{let{$loaded:t}=e;return t?1:0});var p=e=>{let{img:t,alt:n,children:r,className:l,onClick:p}=e,f=(0,o.useRef)(null),[h,g]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=f.current,t="undefined"==typeof IntersectionObserver?null:(s||(s=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting)continue;let e=null==d?void 0:d.get(t.target);e&&e(),null==s||s.unobserve(t.target),null==d||d.delete(t.target)}},{rootMargin:"800px 0px"})),s);if(!e||!t||!d){g(!0);return}return d.set(e,()=>g(!0)),t.observe(e),()=>{t.unobserve(e),d.delete(e)}},[]);let m=h?(0,a.U)(t,400):void 0;return(0,i.jsxs)(c,{className:l,"data-product-thumb":!0,onClick:p,ref:f,children:[r,(0,i.jsx)(u,{role:"img","aria-label":n,$loaded:!!m,style:{backgroundImage:m?'url("'.concat(m,'")'):void 0}})]})}},15218:function(e,t,n){n.d(t,{Z:function(){return D}});var i=n(57437),o=n(2265),r=n(43618),l=n(99376),a=n(57643),d=n(29918),s=n(98773),c=n(82156),u=n(32839),p=n(71854),f=n(13786),h=n(26123),g=n(89723),m=n(27171),x=n(15949),v=n(2711),b=n(94891),w=n(26163),y=n(88862),j=n(21198),I=n(64779),C=n(89892),k=n(33905),P=o.memo(e=>{let{product:t,index:n,isModal:r,clickedIndex:a,aiClickedIndex:d,handleCardClick:s,sendGTMEvent:c}=e,u=(0,l.usePathname)()||"";(0,l.useRouter)();let p=u.startsWith("/magam")||u.startsWith("/board"),f=r&&d===n||!r&&p&&a===n,h=(0,o.useCallback)(()=>{(0,j.Xm)(Number(null==t?void 0:t.id))},[null==t?void 0:t.id]);return(0,i.jsxs)(S,{type:"button",onMouseEnter:h,onFocus:h,onClick:()=>{s(n),c({id:"click-product-card",event:"click-product-card",value:"click-product-card",gtm:{elementId:"click-product-card"}})},"data-current":f,"data-product-card":!0,"data-card-index":n,children:[(0,i.jsx)(C.Z,{img:t.img,alt:t.name,children:(0,i.jsx)(Z,{children:t.isHighQuality||t.hasSeamless&&t.hasPBR?(0,i.jsx)(A,{children:(0,i.jsx)(I.vW,{size:38})}):t.hasSeamless?(0,i.jsx)(A,{children:(0,i.jsx)(I.BD,{size:38})}):t.isSeamless?(0,i.jsx)(E,{children:"심리스"}):null})}),(0,i.jsx)(k.Z,{name:t.name,category:t.category,subCategory:t.subCategory})]})},(e,t)=>{let n=e.product,i=t.product;return(n===i||n.id===i.id&&n.img===i.img&&n.name===i.name&&n.category===i.category&&n.subCategory===i.subCategory&&n.isHighQuality===i.isHighQuality&&n.hasSeamless===i.hasSeamless&&n.hasPBR===i.hasPBR&&n.isSeamless===i.isSeamless&&n.storeId===i.storeId)&&e.index===t.index&&e.isModal===t.isModal&&(e.isModal?e.aiClickedIndex===e.index:e.clickedIndex===e.index)==(t.isModal?t.aiClickedIndex===t.index:t.clickedIndex===t.index)});let S=y.ZP.button.withConfig({componentId:"sc-fcac4f0f-0"})(["display:flex;flex-direction:column;background:transparent;border:0;padding:6px 0;text-align:left;cursor:pointer;min-width:0;html.su-plugin &:focus,html.su-plugin &:focus-visible{outline:none;}html.su-plugin &{padding:3px 0;}"]),Z=y.ZP.div.withConfig({componentId:"sc-fcac4f0f-1"})(["position:absolute;top:8px;left:8px;display:flex;flex-direction:column;gap:3px;z-index:2;@media (max-width:768px){gap:2px;}html.su-plugin &{top:5px;left:5px;gap:2px;}"]),A=y.ZP.div.withConfig({componentId:"sc-fcac4f0f-2"})(["width:38px;height:38px;position:relative;img{width:100% !important;height:100% !important;}@media (max-width:768px){width:32px;height:32px;}@media (min-width:769px) and (max-width:1440px){width:25px;height:25px;}html.su-plugin &{width:24px;height:24px;}"]),E=y.ZP.div.withConfig({componentId:"sc-fcac4f0f-3"})(["width:38px;height:38px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:linear-gradient(180deg,#7f4bff 0%,#8f57ff 100%);color:#fff;font-size:10px;font-weight:700;box-shadow:0 2px 6px rgba(127,75,255,0.35);user-select:none;text-align:center;line-height:1.05;@media (max-width:768px){width:32px;height:32px;font-size:9px;}@media (min-width:769px) and (max-width:1440px){width:25px;height:25px;font-size:8px;}html.su-plugin &{width:24px;height:24px;font-size:7px;}"]);(0,y.ZP)(E).withConfig({componentId:"sc-fcac4f0f-4"})(["background:linear-gradient(180deg,#1f9d8f 0%,#25b3a3 100%);box-shadow:0 2px 6px rgba(31,157,143,0.35);"]);var z=n(45658),M=n(92443),D=e=>{let{isModal:t,products:n,userId:y,productDetail:j,selProductId:I,setSelProductId:C,imgListArrGrid:k,handleObserver:S,productPage:Z,isEntireItemLoading:A,GetProductDetail:E,hasMore:D,onRenderedFully:L,enableLibraryInjectPreview:N,onInjectedLoadMore:R}=e,F=(0,r.sJ)(g.Z),[T,B]=(0,r.FV)(m.Z),O=(0,c.Z)("(max-width: 768px)"),[W,_]=(0,o.useState)(!1);(0,o.useEffect)(()=>{"undefined"!=typeof document&&_(document.documentElement.classList.contains("su-plugin"))},[]);let H=!W&&O,[U,Q]=(0,r.FV)(x.Z),[$,K]=(0,o.useState)(!1),[V,G]=(0,o.useState)(null),Y=(0,r.sJ)(b.Z),q=(0,r.sJ)(v.Z),[J,X]=(0,o.useState)(!0),[ee,et]=(0,o.useState)(!1),[en,ei]=(0,o.useState)(null),[eo,er]=(0,o.useState)(!0),[el,ea]=(0,o.useState)({}),[ed,es]=(0,o.useState)(null),[ec,eu]=(0,o.useState)(window.innerHeight-p.Z),ep=(0,o.useRef)(null),ef=(0,o.useRef)(null),eh=(0,o.useRef)(null),eg=(0,o.useRef)(null),em=(0,o.useRef)(!1),ex=(0,r.sJ)(w.Tq),ev=(0,o.useRef)(ex);(0,o.useEffect)(()=>{ev.current=ex},[ex]);let eb=(0,o.useRef)(T),ew=(0,o.useRef)(U),[ey,ej]=(0,o.useState)(null);(0,o.useEffect)(()=>{let e=eb.current;null===e&&null!==T?ej(ev.current.activeId):null===T&&null!==e&&ej(null),eb.current=T},[T]),(0,o.useEffect)(()=>{let e=ew.current;null===e&&null!==U?ej(ev.current.activeId):null===U&&null!==e&&ej(null),ew.current=U},[U]);let eI=(0,o.useRef)("");(0,o.useEffect)(()=>{let e=JSON.stringify(ex.activeId);if(""===eI.current){eI.current=e;return}eI.current===e||(eI.current=e,null===T||t||(B(null),eO("pid",!1)))},[ex]);let[eC,ek]=(0,o.useState)(0),eP=(0,o.useRef)(0);(0,o.useEffect)(()=>{if(!H)return;let e=document.querySelector("[data-scroll-grid]");if(null!==T||$){var t;eP.current=null!==(t=null==e?void 0:e.scrollTop)&&void 0!==t?t:0,e&&(e.scrollTop=0);let n=requestAnimationFrame(()=>{let e=0;eg.current&&(e=Math.max(e,Math.round(eg.current.getBoundingClientRect().top)));let t=document.querySelector("[data-mobile-filter-bar]");t&&(e=Math.max(e,Math.round(t.getBoundingClientRect().bottom))),ek(Math.max(0,e))});return()=>cancelAnimationFrame(n)}e&&eP.current>0&&(e.scrollTop=eP.current,eP.current=0)},[H,T,$]),(0,o.useEffect)(()=>{if(!H||null===T&&!$)return;let e=()=>{let e=0;eg.current&&(e=Math.max(e,Math.round(eg.current.getBoundingClientRect().top)));let t=document.querySelector("[data-mobile-filter-bar]");t&&(e=Math.max(e,Math.round(t.getBoundingClientRect().bottom))),ek(Math.max(0,e))};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[H,T,$]);let eS=(0,l.useRouter)(),eZ=(0,l.usePathname)(),eA=(0,l.useSearchParams)(),eE=void 0===F.isLogin,ez=t?$||null!==U:$||null!==T,eM=e=>{let t={};if(!e)return t;for(let n of Object.keys(e)){let i=e[n];null!=i&&""!==i&&(t[n]=i)}return t},[eD,eL]=(0,o.useState)([]);(0,o.useEffect)(()=>{eL((0,s.F)())},[]);let eN=j&&j.length>0?j[0]:null,eR=eN&&Array.isArray(eN.recentProductsSummary)?eN.recentProductsSummary:[],eF=new Map(eR.map(e=>[Number(e.id),e])),eT=[...eD.map(e=>{let t=eF.get(Number(e.id));return t?{...t,...e,...eM(t)}:e}),...eR].filter((e,t,n)=>e&&n.findIndex(t=>t.id===e.id)===t).map(e=>0>Number(e.id)&&!e.isHighQuality?{...e,isHighQuality:!0}:e).sort((e,t)=>e.id===I?-1:t.id===I?1:0).slice(0,16),eB=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new URLSearchParams((null==eA?void 0:eA.toString())||"");i.set(e,String(t));let o="".concat(eZ,"?").concat(i.toString());n?eS.replace(o,{scroll:!1}):eS.push(o,{scroll:!1})},eO=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new URLSearchParams((null==eA?void 0:eA.toString())||"");n.delete(e);let i=n.toString(),o=i?"".concat(eZ,"?").concat(i):"".concat(eZ);t?eS.replace(o,{scroll:!1}):eS.push(o,{scroll:!1})},eW=(0,o.useMemo)(()=>{let e=null==eA?void 0:eA.get("pid");return e?Number(e):null},[eA]);(0,o.useEffect)(()=>{ea(e=>{let t={...e};return n.forEach(e=>{var n;void 0===t[e.id]&&(t[e.id]=null!==(n=e.isAddBoard)&&void 0!==n&&n)}),t})},[n]),(0,o.useEffect)(()=>{0===ec&&eu(window.innerHeight-p.Z)},[ec]),(0,o.useEffect)(()=>{if(!ef.current)return;let e=new IntersectionObserver(S,{threshold:0,rootMargin:"800px 0px"});return e.observe(ef.current),eh.current=e,()=>{ef.current&&e.unobserve(ef.current),e.disconnect(),eh.current=null}},[S]),(0,o.useEffect)(()=>{if(!ef.current)return;let e=!1,t=0,n=()=>{e=!1,t="undefined"!=typeof performance?performance.now():Date.now();let n=ef.current;if(!n)return;let i=n.getBoundingClientRect(),o=window.innerHeight||0;i.top-o<1200&&S([{isIntersecting:!0}],null)},i=()=>{!e&&(("undefined"!=typeof performance?performance.now():Date.now())-t<150||(e=!0,requestAnimationFrame(n)))};return document.addEventListener("scroll",i,{capture:!0,passive:!0}),i(),()=>document.removeEventListener("scroll",i,{capture:!0})},[S]),(0,o.useEffect)(()=>{if(q||!D||0===n.length)return;let e=eh.current,t=ef.current;e&&t&&(e.unobserve(t),e.observe(t))},[q,D,n.length]),(0,o.useEffect)(()=>{let e=t?U:T;if(null!==e&&e!==V){var n;null===(n=ep.current)||void 0===n||n.scrollIntoView({block:"start"}),G(e)}},[U,T]);let e_=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(t)return;if(null==eW){K(!1),B(null),Q(null);return}C(eW);let e=n.findIndex(e=>e.id===eW);if(-1!==e?(Q(null),B(e)):K(!0),e_.current!==eW){e_.current=eW;let e="detail";try{e=new URLSearchParams(window.location.search).get("via")||sessionStorage.getItem("mcd_viewsrc:".concat(eW))||"detail"}catch(e){}E(y,eW,t,e)}},[eW,n,t]),(0,o.useEffect)(()=>{if(t||null==eW||eW>=0||null!=I&&I!==eW||en&&en.id===eW)return;let e=n.find(e=>e.id===eW);if(e){ei(e);return}let i=!0;return d.Wg.post("/product/mytexture/detail",{id:eW}).then(e=>{if(!i)return;let t=(null==e?void 0:e.data)||{};t&&t.name&&ei({...t,id:eW,name:t.name,img:t.img,isHighQuality:!0,isPBR:!0===t.isPBR,isSeamless:!0===t.isSeamless})}).catch(()=>{}),()=>{i=!1}},[t,eW,n,en,I]);let eH=()=>new Promise(e=>{let t=eg.current;if(!t)return e();let n=Array.from(t.querySelectorAll("img"));if(0===n.length)return e();let i=0,o=()=>{(i+=1)>=n.length&&e()};n.forEach(e=>{e.complete&&e.naturalWidth>0?o():(e.addEventListener("load",o,{once:!0}),e.addEventListener("error",o,{once:!0}))}),setTimeout(()=>e(),3e3)});(0,o.useEffect)(()=>{D&&(em.current=!1)},[D]),(0,o.useEffect)(()=>{(async()=>{D||q||!(n.length>0)||!L||em.current||(await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e))),await eH(),em.current=!0,L())})()},[D,q,n.length,L]),(0,o.useEffect)(()=>{!L||t||A||!Y||em.current||(em.current=!0,L())},[L,t,A,Y]);let eU=async e=>{K(!1),t?(B(null),Q(e)):(Q(null),B(e));let i=n[e],o=i.id;ei(i),t||(e_.current=o,eB("pid",o,!1)),C(o),await E(y,o,t,"grid")},eQ=()=>{K(!1),t?Q(null):B(null),ei(null),e_.current=null,t||eO("pid",!1)},e$=async e=>{if(!e)return;e_.current=e,eB("pid",e,!1);let t=n.find(t=>t.id===e);t&&ei(t),C(e),await E(y,e,!1,"ai_reco")},eK=(0,o.useMemo)(()=>{var e,t,n;return j&&j.length>0&&(null===(e=j[0])||void 0===e?void 0:e.id)===I?j:en&&en.id===I?[{id:en.id,name:en.name,code:en.code||"",category:en.category,categoryId:en.categoryId,subCategory:en.subCategory,size:en.size||"",country:en.country||"",glossiness:en.glossiness||"",feature:en.feature||"",price:null!==(t=en.price)&&void 0!==t?t:"",salePrice:null!==(n=en.salePrice)&&void 0!==n?n:null,image:en.detailImg||en.img,isNew:en.isNew?1:0,isContract:!0===en.isContract,isPinned:!0===en.isPinned,isHighQuality:!0===en.isHighQuality,isPBR:!0===en.isPBR,store:en.store,brand:en.brand,libThumb:en.img,sampleInquiry:0,cartCount:0,bookCount:0,viewCount:"0",manufacturer:en.isHighQuality?en.store||"":en.manufacturer||"",url:"",sizeIdArr:0,managerNumber:"",isFreeImage:!1,imgCount:0,specCount:0,boardCount:0}]:void 0},[j,en,I]);if((0,o.useEffect)(()=>{let e=null==eK?void 0:eK[0];e&&e.id&&e.name&&((0,s.O)({id:e.id,name:e.name,image:e.libThumb||e.image||e.detailImg||"",category:e.category||"",subCategory:e.subCategory||"",isHighQuality:0>Number(e.id)||!0===e.isHighQuality,hasSeamless:!!e.hasSeamless,hasPBR:!!e.hasPBR}),eL((0,s.F)()))},[eK]),eE)return(0,i.jsx)("div",{children:"Loading..."});let eV=0===n.length&&(q||A),eG=n.length>0&&q&&Z>1;return(0,i.jsxs)(i.Fragment,{children:[eV?(0,i.jsx)(u.Z,{}):(0,i.jsx)(h.PQ,{ref:eg,isEntireItemLoading:A,imgListArrGrid:k,isBlurred:!1,"data-product-grid":!0,children:(()=>{if(Y&&!t)return(0,i.jsx)(h.w8,{children:(0,i.jsx)(M.Z,{isModal:!1})});let e=H&&!t&&(null!==T||$)&&!!eK&&eK.length>0,r=n.map((e,n)=>(0,i.jsx)(o.Fragment,{children:(0,i.jsx)(P,{product:e,index:n,isModal:t,clickedIndex:T,aiClickedIndex:U,handleCardClick:()=>eU(n),sendGTMEvent:f.sendGTMEvent,hoveredHeartId:ed,setHoveredHeartId:es,boardStatus:el,setBoardStatus:ea,auth:F})},e.id));if(e){let e=N?n:void 0;return[(0,i.jsx)(a.Z,{detail:eK[0],onClose:eQ,onSimilarClick:e$,layerTop:eC,filterSnapshot:ey,injectedItems:e,injectedHasMore:N?D:void 0,injectedLoadMore:N?R:void 0,injectedLoading:N?q:void 0},"__inline_preview"),...r]}return r})()}),(0,i.jsx)(h.eo,{ref:ef,id:"observer"}),eG&&(0,i.jsx)(u.Z,{count:6}),ez&&!H&&eK&&eK.length>0&&(0,i.jsx)(z.Z,{onClose:eQ,detailRef:ep,imgListArrGrid:k,userId:y,selectedDetail:eK,selProductId:I,setSelProductId:C,GetProductDetail:E,isSampleContentVisible:eo,handleCloseSampleContent:()=>er(!1),recentPreviewList:eT,onRecentClick:e=>{e.name&&e.image&&ei({...e,id:e.id,name:e.name,img:e.image}),t||(e_.current=e.id,eB("pid",e.id,!1)),C(e.id),K(!0),E(y,e.id,!0,"recent")},filterSnapshot:ey,onOptimisticPreview:e=>ei(e)})]})}},92443:function(e,t,n){n.d(t,{Z:function(){return Q}});var i=n(57437),o=n(2265),r=n(88862),l=n(99376),a=n(43618),d=n(83375),s=n(78155),c=n(42742),u=n(89723),p=n(22545),f=n(35775),h=n(47466),g=e=>{let{introTitle:t,compact:n,productBrandMode:o,inquirySource:r,submitLabel:l,title:a,subtitle:d,privacyNote:s,successMsg:c,eyebrow:u,showInquiryType:p}=e;return(0,i.jsx)(m,{$compact:!!n,children:(0,i.jsx)(v,{children:(0,i.jsxs)(x,{children:[t&&(0,i.jsx)(b,{children:t}),(0,i.jsx)(h.Z,{title:null!=a?a:"찾으시는 제품이 없나요?",subtitle:d,compact:!!n,productBrandMode:o,inquirySource:r,submitLabel:l,privacyNote:s,successMsg:c,eyebrow:u,showInquiryType:p})]})})})};let m=r.ZP.section.withConfig({componentId:"sc-99c27ff4-0"})(["position:relative;background:transparent;color:",";padding:",";overflow:hidden;text-align:left;span,em,strong,b,i,small{font-size:inherit;font-weight:inherit;line-height:inherit;letter-spacing:inherit;}strong,b{font-weight:700;}@media (max-width:1024px){padding:60px 0;}@media (max-width:980px){padding:48px 0;}"],"#111111",e=>{let{$compact:t}=e;return t?"30px 0":"120px 0"}),x=r.ZP.div.withConfig({componentId:"sc-99c27ff4-1"})(["max-width:720px;margin:0 auto;"]),v=r.ZP.div.withConfig({componentId:"sc-99c27ff4-2"})(["position:relative;max-width:1240px;margin:0 auto;padding:0 28px;@media (max-width:768px){padding:0 16px;}@media (max-width:360px){padding:0 12px;}"]),b=r.ZP.h2.withConfig({componentId:"sc-99c27ff4-3"})(["font-size:clamp(17px,1.6vw,22px);font-weight:700;letter-spacing:-0.01em;color:rgba(255,255,255,0.92);line-height:1.45;margin:0 0 20px;text-align:left;word-break:keep-all;@media (max-width:560px){font-size:16px;margin-bottom:14px;}"]);var w=n(71670);let y=r.ZP.div.withConfig({componentId:"sc-6835e499-0"})(["width:100%;align-self:stretch;display:flex;justify-content:center;"]),j=(0,r.F4)(["from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:translateY(0);}"]),I=r.ZP.div.withConfig({componentId:"sc-6835e499-1"})(["width:100%;max-width:600px;margin:20px auto;padding:38px 34px 32px;border-radius:24px;background:#fff;border:1px solid #ece9f7;box-shadow:0 10px 34px rgba(108,43,217,0.09);text-align:center;animation:"," 0.35s ease both;@media (max-width:768px){padding:28px 20px 24px;border-radius:20px;}"],j),C=r.ZP.div.withConfig({componentId:"sc-6835e499-2"})(["display:inline-block;font-size:13px;font-weight:600;color:#8a7fb8;background:#f5f2fc;border-radius:999px;padding:6px 14px;margin-bottom:16px;"]),k=r.ZP.h2.withConfig({componentId:"sc-6835e499-3"})(["margin:0 0 14px;font-size:30px;font-weight:800;line-height:1.32;color:#1a1a1a;letter-spacing:-0.015em;span{font-size:inherit;font-weight:inherit;line-height:inherit;letter-spacing:inherit;}@media (max-width:768px){font-size:23px;}"]),P=r.ZP.p.withConfig({componentId:"sc-6835e499-4"})(["margin:0 auto 24px;max-width:470px;font-size:15px;line-height:1.6;color:#666;b{font-weight:700;color:#1a1a1a;font-size:inherit;}@media (max-width:768px){font-size:13.5px;}"]),S=r.ZP.span.withConfig({componentId:"sc-6835e499-5"})(["color:#6c2bd9;font-size:inherit;font-weight:inherit;line-height:inherit;"]),Z=r.ZP.b.withConfig({componentId:"sc-6835e499-6"})(["font-weight:800;color:#1a1a1a;font-size:inherit;"]),A=r.ZP.ul.withConfig({componentId:"sc-6835e499-7"})(["display:inline-flex;flex-direction:column;gap:12px;margin:0 auto 28px;padding:0;list-style:none;text-align:left;"]),E=r.ZP.li.withConfig({componentId:"sc-6835e499-8"})(["display:flex;align-items:center;gap:11px;font-size:15px;color:#333;@media (max-width:768px){font-size:13.5px;}"]),z=r.ZP.span.withConfig({componentId:"sc-6835e499-9"})(["flex-shrink:0;width:22px;height:22px;border-radius:50%;background:#f2ecfb;color:#6c2bd9;font-size:12px;font-weight:800;display:flex;align-items:center;justify-content:center;"]),M=r.ZP.button.withConfig({componentId:"sc-6835e499-10"})(["width:100%;max-width:360px;height:54px;border:none;border-radius:14px;background:#6c2bd9;color:#fff;font-size:16.5px;font-weight:700;cursor:pointer;box-shadow:0 6px 18px rgba(108,43,217,0.28);transition:background 0.15s,transform 0.1s;&:hover{background:#5a1fbf;}&:active{transform:translateY(1px);}"]),D=r.ZP.div.withConfig({componentId:"sc-6835e499-11"})(["margin-top:14px;font-size:12.5px;color:#999;"]),L=r.ZP.div.withConfig({componentId:"sc-6835e499-12"})(["width:100%;"]),N=r.ZP.div.withConfig({componentId:"sc-6835e499-13"})(["display:inline-block;font-size:13px;font-weight:700;color:#6c2bd9;background:#f2ecfb;border:1px solid #e3d8f7;border-radius:999px;padding:6px 16px;"]),R=r.ZP.div.withConfig({componentId:"sc-6835e499-14"})(["width:",";height:",";border:",";border-radius:20px;padding:",";display:flex;flex-direction:column;justify-content:center;gap:10px;max-height:600px;"],e=>e.isModal?"100%":"440px",e=>(e.isModal,"100%"),e=>e.isModal?"none":"1px solid #d9d9d9;",e=>e.isModal?"6px":"30px"),F=r.ZP.div.withConfig({componentId:"sc-6835e499-15"})(["font-size:24px;font-weight:600;color:#333;text-align:start;"]),T=r.ZP.span.withConfig({componentId:"sc-6835e499-16"})(["color:#413d7d;font-size:32px;font-weight:700;margin-bottom:20px;text-align:start;"]),B=r.ZP.div.withConfig({componentId:"sc-6835e499-17"})(["margin-bottom:4px;font-size:16px;color:#000000;line-height:140%;text-align:start;"]),O=r.ZP.div.withConfig({componentId:"sc-6835e499-18"})(["margin-left:10px;margin-bottom:20px;font-size:14px;color:#666;line-height:120%;text-align:start;font-weight:400;"]),W=r.ZP.span.withConfig({componentId:"sc-6835e499-19"})(["color:#413d7d;font-weight:bold;cursor:pointer;font-size:18px;"]),_=r.ZP.div.withConfig({componentId:"sc-6835e499-20"})(["margin:8px;font-size:16px;font-weight:bold;color:#333;text-align:start;"]),H=r.ZP.textarea.withConfig({componentId:"sc-6835e499-21"})(["width:100%;height:100px;border-radius:4px;border:1px solid #d9d9d9;padding:10px;font-size:14px;margin-bottom:20px;resize:none;"]),U=r.ZP.div.withConfig({componentId:"sc-6835e499-22"})(["padding:15px;text-align:center;"]);var Q=e=>{var t;let{isModal:n,productName:r,productId:h,onClose:m}=e,x=(0,l.useSearchParams)(),v=(0,l.useRouter)(),b=(0,l.usePathname)(),j=(null==x?void 0:null===(t=x.get("q"))||void 0===t?void 0:t.trim())||"",Q=(0,a.sJ)(u.Z),$=(0,f.Z)(),K=(null==$?void 0:$.premiumUnlimited)===!0,[V,G]=(0,o.useState)(""),[Y,q]=(0,o.useState)(null),[J,X]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(n)return;let e=window.setTimeout(()=>{(0,w.eP)("찾으시는 자재가 입고되면 가장 먼저 알림으로 알려드릴까요?")},1500);return()=>window.clearTimeout(e)},[n]);let ee=j.length>12?"".concat(j.slice(0,12),"..."):j,et=ee.length>0,en=V.trim().length>0,{submitInquiry:ei,loading:eo}=(0,p.Z)({onError:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;q("string"==typeof e?e:Array.isArray(e)?e.join(", "):"알 수 없는 오류")},onSuccess:()=>{q(null),X(!0),G("")}}),er=(0,o.useCallback)(()=>{ei({productId:h,content:V.trim()})},[h,V,ei]);return n?(0,i.jsxs)(R,{isModal:n,children:[(0,i.jsx)(F,{children:n?(0,i.jsxs)(i.Fragment,{children:["아래 제품을 찾으시나요?",(0,i.jsx)("br",{})," ",(0,i.jsxs)(T,{children:["‘",r,"’"]})]}):et?(0,i.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,i.jsx)(F,{children:"검색어가 아래와 같은가요?"}),(0,i.jsxs)(T,{children:["‘",ee,"‘"]})]}):"검색된 결과가 없습니다"}),Q.isLogin?(0,i.jsxs)(i.Fragment,{children:[n&&(0,i.jsxs)("div",{children:[(0,i.jsx)(_,{children:" \xb7 적용하는 현장의 정보를 아래에 작성해 주세요."}),(0,i.jsx)(O,{children:"*마코디가 확인 후 연락 드리겠습니다."})]}),!n&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{style:{textAlign:"start",marginBottom:20,fontSize:16},children:"제안:"}),(0,i.jsx)(B,{children:"\xb7 공백 없이 검색해 보세요."}),(0,i.jsx)(B,{children:"\xb7 필터를 확인해 주세요."}),(0,i.jsx)(B,{children:"\xb7 그래도 없다면 사용하시는 제품을 아래로 문의 주세요."}),(0,i.jsx)(O,{children:"*마코디가 원하시는 제품을 찾아 연락 드릴게요."})]})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(_,{children:"지원금 문의"}),(0,i.jsx)(H,{placeholder:n?"ex) 적용 면적(수량) / 희망 수급 일자 / 사이즈 / 기타 문의":"ex) 00브랜드 00제품 600 x 600각 문의드립니다.",value:V,onChange:e=>G(e.target.value)})]}),(0,i.jsx)(d.Z,{content:"문의하기",width:"100%",backgroundColor:"#000",mContentVisible:"flex",mWidth:150,disabled:!en||eo,onClick:er}),Y&&(0,i.jsxs)(B,{style:{color:"red",marginTop:8},children:["문의 요청 중 오류가 발생했습니다: ",Y]})]}):n?(0,i.jsxs)(B,{children:["별도 문의를 진행하시려면\xa0",(0,i.jsx)(W,{onClick:()=>v.push("/login"),children:"로그인"}),"\xa0해주세요"]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(B,{children:"다른 키워드로 다시 시도하시거나,"}),(0,i.jsxs)(B,{children:["[문의하기]를 진행하시려면\xa0",(0,i.jsx)(W,{onClick:()=>v.push("/login"),children:"로그인"}),"\xa0해주세요"]})]}),J&&(0,i.jsx)(s.Z,{containerWidth:"none",onClose:()=>X(!1),children:(0,i.jsxs)(U,{children:[(0,i.jsx)("p",{style:{fontWeight:600,fontSize:20,marginBottom:26},children:"지원금 신청 완료"}),(0,i.jsx)("p",{style:{fontWeight:400,fontSize:16,marginBottom:30},children:"담당 파트너가 1분 이내에 연락 드리겠습니다."}),(0,i.jsx)(c.nK,{children:(0,i.jsx)(c.zx,{onClick:()=>{X(!1),null==m||m(),b&&v.push(b)},children:"확인"})})]})})]}):K?(0,i.jsx)(y,{children:(0,i.jsx)(L,{children:(0,i.jsx)(g,{compact:!0,productBrandMode:!0,showInquiryType:!0,inquirySource:"엔터프라이즈 요청",eyebrow:(0,i.jsx)(N,{children:"\uD83D\uDC51 엔터프라이즈 전용"}),title:"찾으시는 제품, 파트너님께 직접 찾아드려요",subtitle:"이미지\xb7실물 샘플로 제공하는 엔터프라이즈 전용 서비스예요.",submitLabel:"제품 찾아달라고 요청하기 →",privacyNote:"신청 정보는 제품 확보\xb7안내 목적으로만 사용됩니다.",successMsg:"\uD83C\uDF89 제품 요청 완료\n\uD83D\uDCE9 담당 파트너가 이미지\xb7샘플을 확인해 연락드립니다"})})}):(0,i.jsx)(y,{children:(0,i.jsxs)(I,{children:[(0,i.jsx)(C,{children:et?"\uD83D\uDD0E ‘".concat(ee,"’ 검색 결과가 없어요"):"\uD83D\uDD0E 검색 결과가 없어요"}),(0,i.jsxs)(k,{children:["마코디에 없는 제품도,",(0,i.jsx)("br",{}),(0,i.jsx)(S,{children:"이미지\xb7샘플까지 무료"}),"로 드려요"]}),(0,i.jsxs)(P,{children:["지금 쓰시는 그 제품이 아직 등록 전이어도 괜찮아요.",(0,i.jsx)("br",{}),"국내 수급 가능한 모든 마감재, ",(0,i.jsx)("b",{children:"제휴 파트너사"}),"에게 이렇게 지원합니다."]}),(0,i.jsxs)(A,{children:[(0,i.jsxs)(E,{children:[(0,i.jsx)(z,{children:"✓"}),"고품질 ",(0,i.jsx)(Z,{children:"심리스/PBR 이미지 모두 무료"})," ","제공"]}),(0,i.jsxs)(E,{children:[(0,i.jsx)(z,{children:"✓"}),"매주 업데이트 — ",(0,i.jsx)(Z,{children:"제휴사 요청 제품 최우선 등록"})]}),(0,i.jsxs)(E,{children:[(0,i.jsx)(z,{children:"✓"}),"원하는 모든 브랜드 제품의 ",(0,i.jsx)(Z,{children:"실물 샘플"})," ","무료 제공"]})]}),(0,i.jsx)(M,{type:"button",onClick:()=>v.push("/premium?src=search"),children:"무료 제휴로 전부 받기 →"}),(0,i.jsx)(D,{children:"전문가 인증 후 이용 \xb7 비용 0원"})]})})}},26123:function(e,t,n){n.d(t,{Mv:function(){return s},PQ:function(){return p},UE:function(){return a},Vm:function(){return d},W2:function(){return r},_L:function(){return c},eo:function(){return u},w8:function(){return l}});var i=n(88862),o=n(33145);let r=i.ZP.div.withConfig({componentId:"sc-69977d90-0"})(["display:",";justify-content:start;align-content:start;align-items:start;width:100%;position:relative;padding:0.5rem;"," html.su-plugin &{grid-template-columns:repeat(auto-fill,minmax(165px,1fr));gap:5px 8px;}@media (min-width:769px) and (max-width:1440px){grid-template-columns:repeat(auto-fill,minmax(165px,1fr));gap:10px 8px;}"],e=>e.isEntireItemLoading?"flex":"grid",e=>!e.isEntireItemLoading&&"\n /* 좌우 여백 고정 + 썸네일 신축(1fr) — 창을 넓혀도 우측 빈 공간 없이 채우고, 새 컬럼이 들어갈\n 만큼 넓어지면 그때 컬럼 추가(코디존 TOP 그리드와 동일 규칙 → 크기\xb7위치 일치).\n (예전 220px 고정은 우측 빈공간을 남겨 FilterBar를 grid-right-offset으로 보정했으나,\n 1fr로 채우면 빈공간이 없어 offset=0 이면 됨.) */\n grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));\n grid-template-rows: auto;\n gap: 0rem 0.5rem;\n\n @media (max-width: 768px) {\n /* 모바일에서는 두 칼럼로 꽉 차게 */\n grid-template-columns: repeat(2, 1fr);\n }\n "),l=i.ZP.div.withConfig({componentId:"sc-69977d90-1"})(["grid-column:1 / -1;text-align:center;font-size:25px;color:gray;display:flex;justify-content:center;align-items:center;"]);i.ZP.div.withConfig({componentId:"sc-69977d90-2"})(["background-color:",";padding:10px 7px;@media (max-width:768px){padding:9px 7px;}p{color:",";font-weight:400;@media (max-width:768px){font-size:12px;}}"],e=>e.isClicked?"#6864D1":"",e=>e.isClicked?"#FFFFFF":"black"),i.ZP.div.withConfig({componentId:"sc-69977d90-3"})(["cursor:pointer;width:220px;height:280px;@media (max-width:768px){width:100%;height:230px;}html.su-plugin &{width:100%;height:auto;}"]),i.ZP.div.withConfig({componentId:"sc-69977d90-4"})(["width:220px;height:200px;position:relative;overflow:hidden;@media (max-width:768px){width:100%;height:75%;}html.su-plugin &{width:100%;height:0;padding-bottom:100%;border-radius:12px;overflow:hidden;background:#efece6;}@media (max-height:700px){height:180px;}"]);let a=i.ZP.div.withConfig({componentId:"sc-69977d90-5"})(["width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:all 0.3s ease;@media (max-width:768px){height:230px;}"]);i.ZP.div.withConfig({componentId:"sc-69977d90-6"})(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:all 0.3s ease;color:",";font-weight:600;font-size:16px;@media (max-width:768px){font-size:14px;}@media (max-height:700px){font-size:15px;}"],e=>e.isClicked?"#FFFFFF":"black");let d=i.ZP.div.withConfig({componentId:"sc-69977d90-7"})(["grid-column:1 / -1;display:flex;grid-template-columns:repeat(",",1fr);justify-content:center;align-items:center;"],e=>e.imgListArrGrid),s=i.ZP.div.withConfig({componentId:"sc-69977d90-8"})(["display:",";grid-column:1 / -1;width:1000px;margin:0 auto;z-index:",";position:relative;@media (max-width:768px){width:100%;}html.su-plugin &{width:100%;}"],e=>e.showDetail?"block":"none",e=>e.isModal?"3":"1"),c=i.ZP.div.withConfig({componentId:"sc-69977d90-9"})(["display:flex;flex-direction:column;position:relative;width:100%;margin:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:all 0.3s ease;box-shadow:0px 1px 2px 1px rgba(0,0,0,0.3);border-radius:5px;cursor:pointer;@media (min-width:769px){width:220px;height:270px;}&:hover .overlay{opacity:1;}@media (max-width:768px){width:100%;height:auto;margin:0;border-radius:12px;box-shadow:none;}@media (max-height:700px) and (min-width:769px){height:250px;}html.su-plugin &{width:100%;height:auto;margin:0;box-shadow:none;border-radius:0;background:transparent;padding:6px 0;transition:none;}"]);i.ZP.div.withConfig({componentId:"sc-69977d90-10"})(["position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.4);color:white;display:flex;justify-content:center;align-items:center;opacity:0;transition:",";z-index:1;"],e=>e.isModal?"none":"opacity 0.3s ease"),i.ZP.div.withConfig({componentId:"sc-69977d90-11"})(["position:absolute;right:10px;top:10px;z-index:2;.checkbox{background-color:white;transition:background-color 0.3s ease;width:20px;height:20px;border-radius:4px;&:hover{background-color:rgba(0,0,0,0.4);}}"]),i.ZP.div.withConfig({componentId:"sc-69977d90-12"})(["margin-left:10px;text-align:left;"]),i.ZP.div.withConfig({componentId:"sc-69977d90-13"})(["margin-left:10px;margin-right:10px;text-align:left;overflow:hidden;"]);let u=i.ZP.div.withConfig({componentId:"sc-69977d90-14"})(["height:2px;"]);i.ZP.div.withConfig({componentId:"sc-69977d90-15"})(["z-index:9;position:absolute;display:flex;align-items:center;flex-direction:column;padding:5px;"]),i.ZP.div.withConfig({componentId:"sc-69977d90-16"})(["position:absolute;display:flex;align-items:center;flex-direction:column;padding:5px;right:5px;top:5px;cursor:pointer;@media (max-width:768px){right:0;}"]);let p=(0,i.ZP)(r).withConfig({componentId:"sc-69977d90-17"})([""]);i.ZP.div.withConfig({componentId:"sc-69977d90-18"})(["position:absolute;top:50%;left:50%;z-index:9999;background-color:white;width:300px;height:50px;border-radius:10px;display:flex;justify-content:center;align-items:center;@media (max-width:768px){"," ","}@media (max-height:700px){height:45px;}"],e=>"100%"===e.leftWidth&&"display: none;",e=>e.isModal&&"left: 7%;"),i.ZP.div.withConfig({componentId:"sc-69977d90-19"})(["z-index:99;position:fixed;bottom:0;left:32.2%;width:40%;height:40px;background-color:#ff7777;display:flex;justify-content:center;align-items:center;cursor:pointer;border-top-left-radius:10px;border-top-right-radius:10px;border-bottom-left-radius:0;border-bottom-right-radius:0;&.slide-up{animation:slideUp 1s ease forwards;}&.slide-down{animation:slideDown 1s ease forwards;}@keyframes slideUp{from{transform:translateY(100%);}to{transform:translateY(0);}}@keyframes slideDown{from{transform:translateY(0);}to{transform:translateY(100%);}}@media (max-width:768px){height:30px;}@media (max-height:700px){height:40px;}"]),i.ZP.div.withConfig({componentId:"sc-69977d90-20"})(["font-size:18px;font-weight:600;color:white;@media (max-width:768px){font-size:14px;font-weight:400;}"]),i.ZP.div.withConfig({componentId:"sc-69977d90-21"})(["position:absolute;top:7px;right:7px;cursor:pointer;"]),(0,i.ZP)(o.default).withConfig({componentId:"sc-69977d90-22"})(["@media (max-width:768px){width:30px;height:30px;}"]),i.ZP.div.withConfig({componentId:"sc-69977d90-23"})(["display:flex;justify-content:center;align-items:center;height:100%;"]),(0,i.ZP)(o.default).withConfig({componentId:"sc-69977d90-24"})(["object-fit:cover;object-position:center;"])},73997:function(e,t,n){var i=n(29918);let o=new Map;t.Z=(e,t)=>{var n;let{onSuccess:r,onError:l}=t,a={...e,txtSearch:(null===(n=e.txtSearch)||void 0===n?void 0:n.trim())||void 0},d=JSON.stringify(a),s=o.get(d);if(s){s.listeners.push({onSuccess:r,onError:l});return}o.set(d,{listeners:[{onSuccess:r,onError:l}]});let c=localStorage.getItem("TOKEN");i.Wg.post("product",a,{headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json",...c?{Authorization:"Bearer ".concat(c)}:{}}}).then(e=>{var t,n,i,r;let l=null!==(i=null===(t=e.data)||void 0===t?void 0:t.products)&&void 0!==i?i:[],a=null!==(r=null===(n=e.data)||void 0===n?void 0:n.total)&&void 0!==r?r:0,s=o.get(d);s&&s.listeners.forEach(e=>e.onSuccess(l,a))}).catch(e=>{let t=(null==e?void 0:e.message)?[e.message]:["UNKNOWN_ERROR"],n=o.get(d);n&&n.listeners.forEach(e=>e.onError(t))}).finally(()=>{o.delete(d)})}},39754:function(e,t,n){n.d(t,{Z:function(){return e2}});var i=n(57437),o=n(2265),r=n(33145),l=n(99376),a=n(43618),d=n(37065),s=n.n(d),c=n(60331),u=n(73997),p=n(1050),f=n(29918);let h=(0,a.cn)({key:"imgSrc",default:""});var g=n(72513),m=n(73536);let x=(0,a.cn)({key:"isAiItemLoadingAtom",default:!1});var v=n(9607),b=n(15949),w=n(55140),y=n(50703),j=n(88862),I=n(84745),C=n(19144),k=n(16210),P=n(59832),S=n(85229);function Z(e){return(0,i.jsx)("div",{onClick:()=>e.onClick(),children:(0,i.jsx)(P.Z,{"aria-label":"arrowback",size:"large",children:(0,i.jsx)(S.Z,{color:"action"})})})}(0,k.ZP)(C.Z)(e=>{let{theme:t}=e;return{"& .MuiBadge-badge":{right:-3,top:13,border:"2px solid ".concat(t.palette.background.paper),padding:"0 4px"}}});let A=j.ZP.div.withConfig({componentId:"sc-e97d17a9-0"})(["display:flex;align-items:center;justify-content:",";padding:",";height:",";position:absolute;top:15px;left:",";html.su-plugin &{top:25px !important;left:"," !important;height:30px !important;align-items:center;justify-content:flex-start !important;padding:0 !important;z-index:9999 !important;}html.su-plugin & button,html.su-plugin & .MuiIconButton-root{padding:4px !important;width:30px !important;height:30px !important;}html.su-plugin & svg{width:22px !important;height:22px !important;font-size:22px !important;}@media (min-width:769px) and (max-width:1440px){top:25px !important;left:"," !important;height:30px !important;align-items:center;justify-content:flex-start !important;padding:0 !important;z-index:9999 !important;& button,& .MuiIconButton-root{padding:4px !important;width:30px !important;height:30px !important;}& svg{width:22px !important;height:22px !important;font-size:22px !important;}}"],e=>"0%"===e.leftWidth?"":"flex-end",e=>"0%"===e.leftWidth?"0":"0 1rem",e=>"0%"===e.leftWidth?"0%":"2%",e=>"40%"===e.leftWidth?"36%":"46%",e=>"0%"===e.leftWidth?"15px":"calc(".concat(e.leftWidth," - 35px)"),e=>"0%"===e.leftWidth?"15px":"calc(".concat(e.leftWidth," - 35px)")),E=j.ZP.div.withConfig({componentId:"sc-e97d17a9-1"})(["flex-shrink:0;z-index:50;"]);var z=e=>{let{isBackShow:t,onClickBack:n,onClickForward:o,leftWidth:r}=e;return(0,i.jsx)(A,{leftWidth:r,children:t?(0,i.jsx)(E,{children:(0,i.jsx)(I.Z,{sx:{fontSize:"1.5rem",padding:"1rem",minWidth:"150px"},onClick:n})}):(0,i.jsx)(Z,{onClick:o})})},M=n(15218),D=n(14599),L=n(22574);n(83814);var N=n(81929);let R=j.ZP.div.withConfig({componentId:"sc-e8939766-0"})(["display:flex;justify-content:center;align-items:center;html.su-plugin &{display:none !important;}"]),F=j.ZP.hr.withConfig({componentId:"sc-e8939766-1"})(["flex-grow:1;border:none;border-bottom:2px solid ",";"],N.Z.black["20%"]);var T=()=>(0,i.jsx)(R,{children:(0,i.jsx)(F,{})}),B=()=>(0,i.jsxs)(O,{children:[(0,i.jsx)(W,{children:"이미지를 업로드하고 \xa0"}),(0,i.jsx)(_,{children:"AI와 함께 마감재를 찾아보세요."})]});let O=j.ZP.div.withConfig({componentId:"sc-72752fca-0"})(["display:flex;margin:10px 0;align-items:center;justify-content:center;@media (max-width:768px){flex-direction:column;}html.su-plugin &{display:none !important;}@media (min-width:769px) and (max-width:1440px){display:none !important;}"]),W=j.ZP.div.withConfig({componentId:"sc-72752fca-1"})(["font-size:20px;"]),_=j.ZP.div.withConfig({componentId:"sc-72752fca-2"})(["font-size:20px;font-weight:bold;"]);var H=n(13786),U=n(86484),Q=()=>{(0,U.useQueryClient)();let e=async e=>{let t=new FormData;t.append("file",e);let{data:n}=await f.et.post("/scene",t,{headers:{"Content-Type":"multipart/form-data"}});return n},{mutate:t}=(0,U.useMutation)(e,{onSuccess:()=>{},onError:e=>{var t;alert((null===(t=e.response)||void 0===t?void 0:t.data.message)||"이미지 업로드 중 오류가 발생했습니다.")}});return t},$=()=>{let e=(0,U.useQueryClient)(),t=async e=>{let{data:t}=await f.et.delete("/scene",{data:{sceneId:e}});return t},{mutateAsync:n}=(0,U.useMutation)(t,{onSuccess:t=>(e.invalidateQueries("scenes"),t),onError:e=>{var t;alert((null===(t=e.response)||void 0===t?void 0:t.data.message)||"씬 삭제 중 오류가 발생했습니다.")}});return n},K=n(35775);let V=(0,a.cn)({key:"isImageLoaded",default:!1});var G=n(89723);let Y=e=>{let{setSceneIdArr:t,index:n,imgArr:o,sceneIdArr:l,setImgSrc:d,setIsImgUploaded:s,setImgArr:c}=e,[u,p]=(0,a.FV)(G.Z),[f,h]=(0,a.FV)(V),g=$(),m=(e,t)=>{let n=atob(e),i=Array(n.length);for(let e=0;e{try{let t;let i=o[n].toString();if(i.startsWith("data:image/")){var e;let n=i.split(",")[1],o=(null===(e=i.match(/^data:(.*);base64,/))||void 0===e?void 0:e[1])||"image/png",r=m(n,o);t=URL.createObjectURL(r)}else{let e="".concat(i,"?t=").concat(new Date().getTime()),n=await fetch(e,{mode:"cors"}),o=await n.blob();t=URL.createObjectURL(o)}d(t),s(!0)}catch(e){}},v=async()=>{if(u.isLogin){let e=l[n];if(null!=e)try{await g(e);let i=o.filter((e,t)=>t!==n),r=l.filter((e,t)=>t!==n);c(i),t(r)}catch(e){}}else c(o.filter((e,t)=>t!==n)),d(""),s(!1)};return(0,i.jsxs)(J,{children:[(0,i.jsx)("img",{src:o[n].toString(),alt:"Image ".concat(n),onClick:x}),(0,i.jsx)(X,{onClick:v,children:(0,i.jsx)(r.default,{width:10,height:10,src:y.Z,alt:"delete"})})]})},q=e=>{let{setImgSrc:t,setIsImgUploaded:n,setImgArr:o,imgArr:r}=e,l=Q(),a=(0,K.Z)();return(0,i.jsxs)(ee,{children:[(0,i.jsx)(et,{id:"file",type:"file",accept:"image/*",onChange:e=>{if(e.target.files&&e.target.files.length>0){let i=e.target.files[0],d=new FileReader;d.addEventListener("load",()=>{var e;let s=(null===(e=d.result)||void 0===e?void 0:e.toString())||"";t(s),n(!0),o([s,...r]),a&&l(i),(0,H.sendGTMEvent)({id:"img-upload",event:"upload",value:"img-upload",gtm:{elementId:"img-upload"}})}),d.readAsDataURL(i)}}}),(0,i.jsx)("label",{htmlFor:"file",style:{fontSize:17},children:"+"})]})},J=j.ZP.div.withConfig({componentId:"sc-7d553569-0"})(["background-color:#e9e9eb;display:flex;align-items:center;justify-content:center;min-width:110px;min-height:63px;width:110px;height:63px;position:relative;font-size:20px;cursor:pointer;& > img{position:relative;min-width:110px;min-height:63px;width:110px;height:63px;object-fit:contain;background-color:#e9e9eb;border-radius:5px;border:1px solid ",";}"],N.Z.black["40%"]),X=j.ZP.button.withConfig({componentId:"sc-7d553569-1"})(["position:absolute;top:2px;right:2px;border:none;border-radius:3px;padding:2px 5px;font-size:12px;cursor:pointer;"]),ee=j.ZP.label.withConfig({componentId:"sc-7d553569-2"})(["background-color:white;border:2px dashed ",";display:flex;align-items:center;justify-content:center;width:110px;height:63px;border-radius:5%;font-size:20px;cursor:pointer;"],N.Z.black["40%"]),et=j.ZP.input.withConfig({componentId:"sc-7d553569-3"})(["display:none;cursor:pointer;"]),en=j.ZP.div.withConfig({componentId:"sc-c865bcd2-0"})(["display:flex;width:100%;flex-direction:column;height:100%;align-items:center;overflow:",";@media (max-width:768px){}html.su-plugin &{flex:0 0 auto;max-height:220px;overflow-y:auto;}@media (min-width:769px) and (max-width:1440px){flex:0 0 auto;max-height:220px;overflow-y:auto;}"],e=>"100%"===e.leftWidth?"scroll":"auto"),ei=j.ZP.div.withConfig({componentId:"sc-c865bcd2-1"})(["display:grid;justify-content:space-around;grid-template-columns:repeat(auto-fill,110px);grid-auto-rows:70px;max-height:250px;min-height:",";width:100%;@media (max-width:768px){max-height:200px;min-height:200px;overflow-x:auto;}html.su-plugin &{grid-template-columns:repeat(auto-fill,110px) !important;grid-auto-rows:70px !important;max-height:220px !important;min-height:0 !important;}@media (min-width:769px) and (max-width:1440px){grid-template-columns:repeat(auto-fill,110px) !important;grid-auto-rows:70px !important;max-height:220px !important;min-height:0 !important;}"],e=>e.imgListArrGridHeight);var eo=e=>{let{setSceneIdArr:t,imgArr:n,sceneIdArr:o,setImgArr:r,setIsImgUploaded:l,setImgSrc:a,imgListArrGrid:d,imgListArrGridHeight:s,leftWidth:c}=e;return(0,K.Z)(),(0,i.jsx)(en,{leftWidth:c,children:(0,i.jsxs)(ei,{imgListArrGrid:d,imgListArrGridHeight:s,children:[(0,i.jsx)(q,{imgArr:n,setImgArr:r,setIsImgUploaded:l,setImgSrc:a,index:0},0),n.length>0&&n.map((e,d)=>(0,i.jsx)(Y,{setSceneIdArr:t,setImgArr:r,index:d,imgArr:n,sceneIdArr:o,setImgSrc:a,setIsImgUploaded:l},d))]})})},er=n(52482),el=n(42405),ea=e=>{var t,n,r,l,d,s,c,u;let{setCropAreaState:p,imgRef:f,imgSrc:h,drawPreview:g,onImageLoad:m,imgWidth:x,imgHeight:v}=e,[,b]=(0,a.FV)(er.Z),[w,y]=(0,a.FV)(V),[j,I]=(0,o.useState)([]),C=(0,o.useRef)(!1),[k,P]=(0,o.useState)(null),S=(0,o.useRef)(null),Z=(0,o.useRef)(null);(0,o.useEffect)(()=>{P(null),I([]),S.current=null},[h]);let A=(0,o.useRef)(null),[E,z]=(0,o.useState)(0),M=(0,o.useRef)(null),D=(0,o.useRef)(null),L=(0,o.useRef)(null);(0,o.useEffect)(()=>{M.current=k},[k]),(0,o.useEffect)(()=>{let e=f.current;if(!e||"undefined"==typeof ResizeObserver)return;let t=new ResizeObserver(()=>{let t=e.clientWidth,n=e.clientHeight,i=A.current;if(i&&i.w>0&&i.h>0&&(i.w!==t||i.h!==n)&&t>0&&n>0){let e=t/i.w,o=n/i.h,r=M.current;if(r){let t={x:r.x*e,y:r.y*o,w:r.w*e,h:r.h*o};P(t),M.current=t,D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{let e=M.current,t=L.current;e&&e.w>1&&e.h>1&&t&&t(e)},250)}}A.current={w:t,h:n},z(e=>e+1)});return t.observe(e),()=>{t.disconnect(),D.current&&clearTimeout(D.current)}},[h]);let N=e=>{b("none"),p({unit:"px",x:e.x,y:e.y,width:e.w,height:e.h}),g(e.x,e.y,e.w,e.h)};L.current=N;let R=()=>{C.current&&(C.current=!1,I(e=>{let t=f.current;if(!t||e.length<5)return[];let n=1/0,i=1/0,o=-1/0,r=-1/0;for(let t of e)t.xo&&(o=t.x),t.yr&&(r=t.y);let l={x:Math.max(0,n),y:Math.max(0,i),w:Math.min(t.width,o)-Math.max(0,n),h:Math.min(t.height,r)-Math.max(0,i)};return l.w>0&&l.h>0&&(P(l),N(l)),[]}))},F=e=>t=>{if(k){t.stopPropagation(),S.current={corner:e,startX:t.clientX,startY:t.clientY,startBox:{...k}};try{t.currentTarget.setPointerCapture(t.pointerId)}catch(e){}}},T=e=>{var t,n,i,o;if(!S.current)return;e.stopPropagation();let{corner:r,startX:l,startY:a,startBox:d}=S.current,s=e.clientX-l,c=e.clientY-a,u=null!==(i=null===(t=f.current)||void 0===t?void 0:t.width)&&void 0!==i?i:0,p=null!==(o=null===(n=f.current)||void 0===n?void 0:n.height)&&void 0!==o?o:0,h=d.x,g=d.y,m=d.w,x=d.h;"tl"===r||"bl"===r?(h=d.x+s,m=d.w-s):m=d.w+s,"tl"===r||"tr"===r?(g=d.y+c,x=d.h-c):x=d.h+c,m<30&&(("tl"===r||"bl"===r)&&(h=d.x+d.w-30),m=30),x<30&&(("tl"===r||"tr"===r)&&(g=d.y+d.h-30),x=30),h<0&&(m+=h,h=0),g<0&&(x+=g,g=0),h+m>u&&(m=u-h),g+x>p&&(x=p-g),P({x:h,y:g,w:m,h:x})},B=e=>{S.current&&(e.stopPropagation(),S.current=null,k&&N(k))},O=e=>{Z.current&&(e.stopPropagation(),Z.current=null,k&&N(k))},W=null!==(d=null===(t=f.current)||void 0===t?void 0:t.width)&&void 0!==d?d:0,_=null!==(s=null===(n=f.current)||void 0===n?void 0:n.height)&&void 0!==s?s:0,H=null!==(c=null===(r=f.current)||void 0===r?void 0:r.offsetLeft)&&void 0!==c?c:0,U=null!==(u=null===(l=f.current)||void 0===l?void 0:l.offsetTop)&&void 0!==u?u:0,Q=C.current&&j.length>1,$=Q?"M "+j.map(e=>"".concat(e.x,",").concat(e.y)).join(" L "):"";return(0,i.jsxs)(ed,{children:[!w&&(0,i.jsx)(el.Z,{}),(0,i.jsxs)(es,{onPointerDown:e=>{if(S.current)return;let t=f.current;if(!t)return;k&&P(null);let n=t.getBoundingClientRect(),i=e.clientX-n.left,o=e.clientY-n.top;C.current=!0,I([{x:i,y:o}]);try{e.currentTarget.setPointerCapture(e.pointerId)}catch(e){}},onPointerMove:e=>{if(!C.current)return;let t=f.current;if(!t)return;let n=t.getBoundingClientRect(),i=e.clientX-n.left,o=e.clientY-n.top;I(e=>[...e,{x:i,y:o}])},onPointerUp:R,onPointerCancel:R,children:[(0,i.jsx)("img",{ref:f,src:h,onLoad:e=>{y(!0),m(e);let{width:t,height:n}=e.currentTarget,i=.4*Math.min(t,n),o={x:(t-i)/2,y:(n-i)/2,w:i,h:i};P(o),N(o)},onError:()=>{y(!1)},crossOrigin:"anonymous",alt:"Crop image",draggable:!1,style:{width:x,height:v,objectFit:"contain",display:w?"block":"none",pointerEvents:"none",userSelect:"none"}}),w&&W>0&&(Q||k)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(ec,{style:{width:W,height:_,left:H,top:U},viewBox:"0 0 ".concat(W," ").concat(_),children:[(0,i.jsxs)("defs",{children:[(0,i.jsxs)("linearGradient",{id:"dt-rainbow-stroke",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,i.jsx)("stop",{offset:"0%",stopColor:"#4f7cff"}),(0,i.jsx)("stop",{offset:"20%",stopColor:"#8a5cf6"}),(0,i.jsx)("stop",{offset:"40%",stopColor:"#ec4899"}),(0,i.jsx)("stop",{offset:"60%",stopColor:"#f97316"}),(0,i.jsx)("stop",{offset:"80%",stopColor:"#facc15"}),(0,i.jsx)("stop",{offset:"100%",stopColor:"#4ade80"})]}),k&&(0,i.jsxs)("mask",{id:"dt-box-mask",children:[(0,i.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),(0,i.jsx)("rect",{x:k.x,y:k.y,width:k.w,height:k.h,fill:"black",rx:10,ry:10})]})]}),k&&(0,i.jsx)("rect",{width:"100%",height:"100%",fill:"rgba(0,0,0,0.55)",mask:"url(#dt-box-mask)"}),Q&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("path",{d:$,stroke:"url(#dt-rainbow-stroke)",strokeWidth:14,strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:.55,style:{filter:"blur(8px)"}}),(0,i.jsx)("path",{d:$,stroke:"url(#dt-rainbow-stroke)",strokeWidth:7,strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:.85,style:{filter:"blur(3px)"}}),(0,i.jsx)("path",{d:$,stroke:"#ffffff",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]})]}),k&&(0,i.jsxs)(eh,{style:{left:H+k.x,top:U+k.y,width:k.w,height:k.h},children:[(0,i.jsx)(ef,{onPointerDown:e=>{if(k){e.stopPropagation(),Z.current={startX:e.clientX,startY:e.clientY,startBox:{...k}};try{e.currentTarget.setPointerCapture(e.pointerId)}catch(e){}}},onPointerMove:e=>{var t,n,i,o;if(!Z.current)return;e.stopPropagation();let{startX:r,startY:l,startBox:a}=Z.current,d=e.clientX-r,s=e.clientY-l,c=null!==(i=null===(t=f.current)||void 0===t?void 0:t.width)&&void 0!==i?i:0,u=null!==(o=null===(n=f.current)||void 0===n?void 0:n.height)&&void 0!==o?o:0,p=a.x+d,h=a.y+s;p<0&&(p=0),h<0&&(h=0),p+a.w>c&&(p=c-a.w),h+a.h>u&&(h=u-a.h),P({x:p,y:h,w:a.w,h:a.h})},onPointerUp:O,onPointerCancel:O}),["tl","tr","bl","br"].map(e=>(0,i.jsx)("span",{className:"bracket ".concat(e),onPointerDown:F(e),onPointerMove:T,onPointerUp:B,onPointerCancel:B},e))]})]})]})]})};let ed=j.ZP.div.withConfig({componentId:"sc-8858191a-0"})(["html.su-plugin &{flex:1 1 0 !important;min-height:0 !important;display:flex !important;flex-direction:column !important;width:100% !important;}@media (min-width:769px) and (max-width:1440px){flex:1 1 0 !important;min-height:0 !important;display:flex !important;flex-direction:column !important;width:100% !important;}"]),es=j.ZP.div.withConfig({componentId:"sc-8858191a-1"})(["position:relative;display:inline-block;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;html.su-plugin &{display:block !important;width:100% !important;flex:1 1 0 !important;min-height:0 !important;}html.su-plugin & > img{width:100% !important;height:100% !important;max-width:100% !important;object-fit:contain !important;}@media (min-width:769px) and (max-width:1440px){display:block !important;width:100% !important;flex:1 1 0 !important;min-height:0 !important;& > img{width:100% !important;height:100% !important;max-width:100% !important;object-fit:contain !important;}}"]),ec=j.ZP.svg.withConfig({componentId:"sc-8858191a-2"})(["position:absolute;pointer-events:none;overflow:visible;"]),eu=(0,j.F4)(["0%{opacity:0;transform:scale(0.88);}60%{opacity:1;transform:scale(1.04);}100%{opacity:1;transform:scale(1);}"]),ep=(0,j.F4)(["0%{opacity:0;transform:scale(0.4);}100%{opacity:1;transform:scale(1);}"]),ef=j.ZP.div.withConfig({componentId:"sc-8858191a-3"})(["position:absolute;inset:0;pointer-events:auto;touch-action:none;cursor:move;border-radius:12px;"]),eh=j.ZP.div.withConfig({componentId:"sc-8858191a-4"})(["position:absolute;pointer-events:none;border-radius:12px;animation:"," 0.34s cubic-bezier(0.2,0.8,0.2,1) both;.bracket{position:absolute;width:28px;height:28px;border-color:#ffffff;border-style:solid;border-width:0;animation:"," 0.3s cubic-bezier(0.2,0.8,0.2,1) 0.08s both;filter:drop-shadow(0 0 6px rgba(255,255,255,0.85));pointer-events:auto;touch-action:none;cursor:grab;&:active{cursor:grabbing;}&::before{content:'';position:absolute;inset:-10px;}}.bracket.tl{top:-2px;left:-2px;border-top-width:4px;border-left-width:4px;border-top-left-radius:12px;}.bracket.tr{top:-2px;right:-2px;border-top-width:4px;border-right-width:4px;border-top-right-radius:12px;}.bracket.bl{bottom:-2px;left:-2px;border-bottom-width:4px;border-left-width:4px;border-bottom-left-radius:12px;}.bracket.br{bottom:-2px;right:-2px;border-bottom-width:4px;border-right-width:4px;border-bottom-right-radius:12px;}"],eu,ep);var eg={src:"/_next/static/media/upload.f57867e7.png",height:512,width:512,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAHlBMVEU/P0pNTVVLS1RISFJOTlZISFdMTFRPT1hNTVZMTFY8+hisAAAACnRSTlMBM0EMThVgicCk+5gzGwAAAAlwSFlzAAALEwAACxMBAJqcGAAAADJJREFUeJw1wbkBwEAQArEB9rv+G3ZkiXR3AtjSjMAEl0A9VRKUsd6ZKWnvLaSTPfH7ABl7ALNMoJkeAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8},em=e=>{let{setImgArr:t,setIsImgUploaded:n,setImgSrc:l,imgArr:a}=e,[d,s]=(0,o.useState)(!1),c=Q(),u=(0,K.Z)(),p=e=>{let i=new FileReader;i.addEventListener("load",()=>{var o;let r=(null===(o=i.result)||void 0===o?void 0:o.toString())||"";l(r),n(!0),t([r,...a]),u&&c(e)}),i.readAsDataURL(e),(0,H.sendGTMEvent)({id:"img-upload",event:"upload",value:"img-upload",gtm:{elementId:"img-upload"}})};return(0,i.jsxs)(ev,{isDragging:d,onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),s(!0)},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),s(!1)},onDrop:e=>{e.preventDefault(),e.stopPropagation(),s(!1),e.dataTransfer.files&&e.dataTransfer.files.length>0&&(p(e.dataTransfer.files[0]),e.dataTransfer.clearData())},children:[(0,i.jsx)(ew,{id:"file",type:"file",accept:"image/*",onChange:e=>{e.target.files&&e.target.files.length>0&&p(e.target.files[0])}}),(0,i.jsx)(ex,{children:(0,i.jsx)(r.default,{src:eg,alt:"",width:100})}),(0,i.jsx)(eb,{htmlFor:"file",children:"이미지를 선택하거나 \xa0"}),(0,i.jsx)(eb,{htmlFor:"file",children:"드레그해서 끌어다 놓으세요."})]})};let ex=j.ZP.div.withConfig({componentId:"sc-a129ffff-0"})(["html.su-plugin & img{width:50px !important;height:auto !important;}@media (min-width:769px) and (max-width:1440px){& img{width:50px !important;height:auto !important;}}"]),ev=j.ZP.label.withConfig({componentId:"sc-a129ffff-1"})(["display:flex;background-color:white;width:100%;height:1000px;border-radius:20px;border:3px dashed ",";justify-content:center;align-items:center;cursor:pointer;flex-direction:column;background-color:",";@media (max-width:768px){height:300px;}html.su-plugin &{background:transparent !important;height:auto !important;flex:1 1 0 !important;min-height:0 !important;width:100% !important;}@media (min-width:769px) and (max-width:1440px){background:transparent !important;height:auto !important;flex:1 1 0 !important;min-height:0 !important;width:100% !important;}"],N.Z.black["40%"],e=>{let{isDragging:t}=e;return t?N.Z.black["20%"]:"white"}),eb=j.ZP.label.withConfig({componentId:"sc-a129ffff-2"})(["font-size:17px;html.su-plugin &{font-size:13px;}@media (min-width:769px) and (max-width:1440px){font-size:13px;}"]),ew=j.ZP.input.withConfig({componentId:"sc-a129ffff-3"})(["display:none;"]);var ey=n(15312);let ej=async()=>{let{data:e}=await f.et.get("/scene");return e};var eI=()=>(0,U.useQuery)("scenes",ej,{staleTime:3e5});let eC=j.zo.div.withConfig({componentId:"sc-397bf6dc-0"})(["display:flex;flex-direction:column;align-items:center;width:100%;height:100%;color:rgb(254,255,255);@media (max-width:768px){overflow:hidden;}html.su-plugin & > .MuiStack-root{height:100% !important;}@media (min-width:769px) and (max-width:1440px){& > .MuiStack-root{height:100% !important;}}"]),ek=j.zo.div.withConfig({componentId:"sc-397bf6dc-1"})(["width:100%;@media (max-width:768px){display:",";}"],e=>{let{hideOnMobile:t}=e;return t?"none":"block"}),eP=j.zo.div.withConfig({componentId:"sc-397bf6dc-2"})(["width:100%;height:30%;@media (max-width:768px){display:",";}html.su-plugin &{flex:0 0 auto;height:auto;}@media (min-width:769px) and (max-width:1440px){flex:0 0 auto;height:auto;}"],e=>{let{hideOnMobileModal:t,hasCropImage:n,forceShow:i}=e;return i?"block":t&&n?"none":"block"});var eS=e=>{let{imgSrc:t,setImgSrc:n,onHandleCrop:r,imgWidth:l,imgHeight:d,imgListArrGrid:s,imgListArrGridHeight:c,setAiProductPage:u,storeQuery:p,leftWidth:f,isModal:h,forceShowListWrapper:g}=e,[m,x]=(0,o.useState)({x:0,y:0,width:504,height:118,unit:"px"}),v=(0,o.useRef)(null),[b,w]=(0,o.useState)(),[y,j]=(0,o.useState)([]),[I,C]=(0,o.useState)([]),[k,P]=(0,o.useState)(1),[S,Z]=(0,o.useState)(""),[A,E]=(0,o.useState)(""),z=(0,o.useRef)(null);(0,o.useRef)(null);let{data:M,isLoading:N}=eI(),[R,F]=(0,a.FV)(V);function O(e,t,n){return(0,L._H)((0,L.YG)({unit:"px",width:200},n,e,t),e,t)}function W(e){let t=e.toString(16);return 1===t.length?"0"+t:t}async function _(e,t,n,i){if(R&&v.current&&0!==v.current.naturalWidth&&z.current&&v.current){let o=v.current,l=z.current,a=o.naturalWidth/o.width,d=o.naturalHeight/o.height,s=n*a,c=i*d,u=Math.min(1,512/Math.max(s,c,1)),f=Math.max(1,Math.round(s*u)),h=Math.max(1,Math.round(c*u));l.width=f,l.height=h;let g=null==l?void 0:l.getContext("2d");if(g){g.clearRect(0,0,l.width,l.height);try{g.drawImage(o,e*a,t*d,s,c,0,0,f,h)}catch(e){return}let n=g.canvas.toDataURL();Z(n);try{let[e,t,i]=await (0,ey._)(n),o="#"+W(e)+W(t)+W(i);E(o),r({rgb_r:e,rgb_g:t,rgb_b:i,page:1,categories:[],cropdata:n,companyName:"",txtSearch:"",isRandom:0,storeName:p})}catch(e){}}}}return(0,o.useEffect)(()=>{if(M&&M.length>0){let e=M.map(e=>e.image),t=M.map(e=>e.id);j(e),C(t)}},[M]),(0,o.useRef)(null),o.useRef(!1),(0,o.useEffect)(()=>{b&&R&&_(b.x,b.y,b.width,b.height)},[b,t,R]),(0,o.useEffect)(()=>{if(v.current&&8!==s&&R){let{width:e,height:t}=v.current,n=O(e,t,k);x(n),w(n)}},[s,R]),(0,i.jsxs)(eC,{leftWidth:f,children:[(0,i.jsx)(ek,{hideOnMobile:R,children:(0,i.jsx)(B,{})}),(0,i.jsxs)(D.Z,{style:{width:"95%",height:"90%",gap:10},children:[(0,i.jsx)(D.Z,{direction:"row",style:{width:"100%"},alignItems:"center",justifyContent:"center"}),R?(0,i.jsx)(ea,{cropAreaState:m,setCropAreaState:x,imgRef:v,imgSrc:t,drawPreview:_,onImageLoad:function(e){u(1),F(!0);let{width:t,height:n}=e.currentTarget;if(k&&R){let e=O(t,n,k);x(e),w(e)}},imgWidth:l,imgHeight:d}):(0,i.jsx)(em,{setImgArr:j,setIsImgUploaded:F,setImgSrc:n,imgArr:y||[]}),(0,i.jsx)(T,{}),(0,i.jsx)(eP,{hideOnMobileModal:!!h,hasCropImage:!!S,forceShow:!!g,children:(0,i.jsx)(eo,{leftWidth:f,setSceneIdArr:C,imgArr:y,sceneIdArr:I,setImgArr:j,imgListArrGrid:s,imgListArrGridHeight:c,setIsImgUploaded:F,setImgSrc:n})}),(0,i.jsx)("div",{style:{display:"none"},children:(0,i.jsx)("canvas",{ref:z})})]})]})},eZ=n(54887),eA=n(1332),eE=n(2711),ez=e=>{let{FetchTextSearch:t=()=>{},setSearchKeyword:n=()=>{},FetchImgSearchProducts:r=()=>{},searchKeyword:l="",productPage:d=1,setAiProductPage:s=()=>{},cropdata:c="",rankedCategoryIds:u=[]}=e,[,p]=(0,a.FV)(b.Z),[f,h]=(0,o.useState)([]),[,g]=(0,o.useState)(null),[x,w]=(0,a.FV)(m.Z),[,y]=(0,a.FV)(eE.Z),[,j]=(0,a.FV)(v.Z),[I,C]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if("undefined"==typeof document)return;let e=()=>{let e=document.documentElement.classList.contains("su-plugin"),t=window.innerWidth;C(e||t>=769&&t<=1440)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let[k,P]=(0,o.useState)(8),S=I?k:8,[Z,A]=(0,o.useState)(!1),[E,z]=(0,o.useState)(!1),[M,D]=(0,o.useState)(""),L=(0,o.useRef)(null),N=(0,o.useRef)(null),[R,F]=(0,o.useState)(null);(0,eA.Z)({onSuccess:e=>h(e),onError:e=>g(e||"Unknown error")});let T=(e,t,n)=>{w(t=>{if(null===e)return[];let n=e.toString();return t.includes(n)?t.filter(e=>e!==n):[...t,n]}),y(!0),j(!0),setTimeout(()=>{y(!1),j(!1)},1e3),p(null),s(1)},B=(0,o.useMemo)(()=>{if(!f.length)return[];let e=new Map;x.forEach((t,n)=>e.set(String(t),n));let t=f.filter(t=>e.has(String(t.id)));t.sort((t,n)=>{var i,o;return(null!==(i=e.get(String(t.id)))&&void 0!==i?i:0)-(null!==(o=e.get(String(n.id)))&&void 0!==o?o:0)});let n=f.filter(t=>!e.has(String(t.id)));if(I)return n.sort((e,t)=>e.name.localeCompare(t.name,"ko")),[...t,...n];let i=new Map;u.forEach((e,t)=>i.set(String(e),t));let o=n.filter(e=>i.has(String(e.id))),r=n.filter(e=>!i.has(String(e.id)));return o.sort((e,t)=>{var n,o;return(null!==(n=i.get(String(e.id)))&&void 0!==n?n:999)-(null!==(o=i.get(String(t.id)))&&void 0!==o?o:999)}),r.sort((e,t)=>e.name.localeCompare(t.name,"ko")),[...t,...o,...r]},[f,u,I,x]);(0,o.useEffect)(()=>{if(!I||"undefined"==typeof ResizeObserver)return;let e=N.current;if(!e)return;let t=()=>{P(Math.max(2,Math.floor(Math.max(0,e.clientWidth-170)/60)))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[I]);let O=(0,o.useMemo)(()=>B.slice(0,S),[B,S]),W=(0,o.useMemo)(()=>B.slice(S),[B,S]),_=(0,o.useCallback)(()=>{var e;let t=null!==(e=N.current)&&void 0!==e?e:L.current;if(!t)return null;let n=t.getBoundingClientRect(),i=n.left+8;return{top:n.bottom+8,left:i,width:Math.max(0,n.width-16)}},[]),H=(0,o.useCallback)(()=>{F(_()),A(!0),requestAnimationFrame(()=>z(!0))},[_]),U=(0,o.useCallback)(()=>{z(!1),setTimeout(()=>A(!1),180)},[]),Q=(0,o.useCallback)(()=>{Z&&E?U():H()},[Z,E,H,U]);(0,o.useLayoutEffect)(()=>{if(!Z)return;let e=()=>F(_());return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[Z,_]),(0,o.useEffect)(()=>{if(!Z)return;let e=e=>{"Escape"===e.key&&U()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[Z,U]);let $=M.trim()?B:W,K=(0,o.useMemo)(()=>{let e=M.trim().toLowerCase();return e?$.filter(t=>t.name.toLowerCase().includes(e)):$},[M,$]);(0,o.useEffect)(()=>{c?r(1,x,c,l):t(x,l,1,c)},[x]);let V=Z&&R?(0,eZ.createPortal)((0,i.jsx)(eR,{$visible:E,onClick:U,"aria-hidden":!E,children:(0,i.jsxs)(eF,{role:"dialog","aria-label":"추가 카테고리",$visible:E,style:{position:"fixed",top:R.top,left:R.left,width:R.width,zIndex:2147483647},onClick:e=>e.stopPropagation(),children:[(0,i.jsx)(eT,{placeholder:"카테고리 검색…",value:M,onChange:e=>D(e.target.value),autoFocus:!0}),(0,i.jsxs)(eB,{children:[(0,i.jsx)(eO,{children:(0,i.jsx)(eW,{$active:0===x.length,onClick:()=>{T(null,d,c)},children:"전체보기"})},"all"),K.map(e=>(0,i.jsx)(eO,{children:(0,i.jsx)(eW,{$active:x.includes(e.id.toString()),onClick:()=>{T(e.id,d,c)},children:e.name})},e.id)),0===K.length&&(0,i.jsx)(e_,{children:"일치하는 카테고리가 없어요"})]})]})}),document.body):null;return(0,i.jsx)(eM,{children:(0,i.jsxs)(eD,{ref:N,children:[(0,i.jsx)(eL,{$active:0===x.length,onClick:()=>T(null,d,c),title:"전체보기",children:"전체보기"}),O.map(e=>(0,i.jsx)(eL,{$active:x.includes(e.id.toString()),onClick:()=>T(e.id,d,c),title:e.name,children:e.name},e.id)),W.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eN,{children:(0,i.jsxs)(eL,{ref:L,onClick:Q,title:"더 보기",children:["+",W.length]})}),V]})]})})};let eM=j.ZP.div.withConfig({componentId:"sc-2fbe16b6-0"})(["width:100%;background:#fff;border-bottom:1px solid #eef2f6;overflow:hidden;@media (min-width:769px) and (max-width:1440px){position:relative;background:#fff;border-bottom:none;padding:25px 0 0 0;min-height:55px;overflow:visible;}html.su-plugin &{position:relative;background:#fff !important;border-bottom:none !important;padding:25px 0 0 0 !important;min-height:55px;overflow:visible;}"]),eD=j.ZP.div.withConfig({componentId:"sc-2fbe16b6-1"})(["position:relative;display:flex;align-items:center;flex-wrap:nowrap;gap:8px;padding:8px 12px;width:100%;min-width:0;overflow:hidden;html.su-plugin &{padding-left:20px !important;padding-right:80px;overflow:visible;}@media (min-width:769px) and (max-width:1440px){padding-left:20px !important;padding-right:80px;overflow:visible;}"]),eL=j.ZP.button.withConfig({componentId:"sc-2fbe16b6-2"})(["flex:0 1 auto;min-width:0;max-width:14ch;border:1px solid ",";background:",";color:",";border-radius:999px;padding:6px 10px;font-size:13px;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;&:hover{background:#f9fafb;}html.su-plugin &{flex:0 0 auto;max-width:none;padding:5px 8px;font-size:12px;background:"," !important;}@media (min-width:769px) and (max-width:1440px){flex:0 0 auto;max-width:none;padding:5px 8px;font-size:12px;background:"," !important;}"],e=>{let{$active:t}=e;return t?"#2E90FA":"#E4E7EC"},e=>{let{$active:t}=e;return t?"#EFF8FF":"#FFF"},e=>{let{$active:t}=e;return t?"#1E6AFF":"#344054"},e=>{let{$active:t}=e;return t?"#EFF8FF":"transparent"},e=>{let{$active:t}=e;return t?"#EFF8FF":"transparent"}),eN=j.ZP.div.withConfig({componentId:"sc-2fbe16b6-3"})(["position:relative;flex:0 0 auto;html.su-plugin &{position:fixed !important;top:27px !important;right:0 !important;flex:initial !important;margin-left:0 !important;background:#fff !important;padding:2px 14px 2px 4px !important;border-radius:4px 0 0 4px !important;z-index:10000 !important;}@media (min-width:769px) and (max-width:1440px){position:fixed !important;top:27px !important;right:0 !important;flex:initial !important;margin-left:0 !important;background:#fff !important;padding:2px 14px 2px 4px !important;border-radius:4px 0 0 4px !important;z-index:10000 !important;}"]),eR=j.ZP.div.withConfig({componentId:"sc-2fbe16b6-4"})(["position:fixed;inset:0;background:transparent;z-index:",";pointer-events:",";"],2147483646,e=>{let{$visible:t}=e;return t?"auto":"none"}),eF=j.ZP.div.withConfig({componentId:"sc-2fbe16b6-5"})(["max-height:65vh;overflow:auto;background:#fff;border:1px solid #e4e7ec;border-radius:12px;box-shadow:0 12px 32px rgba(0,0,0,0.12);padding:12px;transform-origin:top center;transform:",";opacity:",";transition:transform ","ms ease,opacity ","ms ease;"],e=>{let{$visible:t}=e;return t?"scaleY(1)":"scaleY(0.98)"},e=>{let{$visible:t}=e;return t?1:0},180,180),eT=j.ZP.input.withConfig({componentId:"sc-2fbe16b6-6"})(["width:100%;height:36px;border:1px solid #d0d5dd;border-radius:8px;padding:0 10px;outline:none;font-size:13px;margin-bottom:10px;&:focus{border-color:#2e90fa;box-shadow:0 0 0 4px rgba(46,144,250,0.15);}"]),eB=j.ZP.ul.withConfig({componentId:"sc-2fbe16b6-7"})(["list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px;"]),eO=j.ZP.li.withConfig({componentId:"sc-2fbe16b6-8"})([""]),eW=j.ZP.button.withConfig({componentId:"sc-2fbe16b6-9"})(["width:100%;text-align:left;border:1px solid ",";background:",";color:",";border-radius:8px;padding:8px 10px;font-size:13px;cursor:pointer;&:hover{background:#f9fafb;}"],e=>{let{$active:t}=e;return t?"#2E90FA":"#E4E7EC"},e=>{let{$active:t}=e;return t?"#EFF8FF":"#FFF"},e=>{let{$active:t}=e;return t?"#1E6AFF":"#344054"}),e_=j.ZP.div.withConfig({componentId:"sc-2fbe16b6-10"})(["grid-column:1 / -1;padding:16px;color:#98a2b3;text-align:center;"]);var eH=n(92489),eU={src:"/_next/static/media/ai-icon.6cb93f79.png",height:152,width:155,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAP1BMVEVMaXHCw9AWFhZ7fJv7+/l5eYb39/f+/v/IyMvQ0NKXl6/Pz9wUFD5AQm6Mjaa8vczp6e719ffb2+Ts7PDq6u/m0/dUAAAAFXRSTlMA/gb9wge6/iky/v4l58b9/fz8/vzuD4HCAAAACXBIWXMAACxLAAAsSwGlPZapAAAAPUlEQVR4nBXLSRKAIBAEwWKze0DF7f9vNThnJNDCGcCb+hnApu8dx451lTRHYM3Sk2LR/ahmcJWqV2t2gx898wGmxtdCQQAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8},eQ=n(26123);let e$=j.ZP.div.withConfig({componentId:"sc-2c14c508-0"})(["width:100%;height:100%;display:flex;flex-direction:row;@media (max-width:768px){height:",";flex-direction:column;}"],e=>{let{leftWidth:t}=e;return"100%"===t?"100%":"91%"}),eK=j.ZP.button.withConfig({componentId:"sc-2c14c508-1"})(["position:absolute;top:10px;right:10px;background:transparent;border:none;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;width:24px;height:24px;&:hover{opacity:0.7;}html.su-plugin &{display:none !important;}@media (min-width:769px) and (max-width:1440px){display:none !important;}"]),eV=j.ZP.div.withConfig({componentId:"sc-2c14c508-2"})(["display:flex;flex-direction:column;width:",";@media (max-width:768px){margin-top:30px;}html.su-plugin &{padding-top:60px !important;box-sizing:border-box;}html.su-plugin & img{border-radius:12px;}html.su-plugin & label{border-radius:12px !important;}@media (min-width:769px) and (max-width:1440px){padding-top:60px !important;box-sizing:border-box;& img{border-radius:12px;}& label{border-radius:12px !important;}}"],e=>{let{leftWidth:t}=e;return t}),eG=j.ZP.div.withConfig({componentId:"sc-2c14c508-3"})(["width:",";height:91.5%;@media (max-width:768px){width:100%;display:",";flex-direction:column;position:fixed;left:0;right:0;bottom:0;height:","vh;transition:",";background:#fff;border-top-left-radius:16px;border-top-right-radius:16px;box-shadow:0 -8px 24px rgba(0,0,0,0.12);z-index:5;overflow:hidden;}html.su-plugin &{background:#fff !important;}html.su-plugin & ","{grid-template-columns:repeat(auto-fill,minmax(165px,1fr)) !important;gap:10px 8px !important;}html.su-plugin & ","{border-bottom:none !important;background:transparent !important;padding:0 !important;}@media (min-width:769px) and (max-width:1440px){background:#fff;& ","{grid-template-columns:repeat(auto-fill,minmax(165px,1fr)) !important;gap:10px 8px !important;}& ","{border-bottom:none !important;background:transparent !important;padding:0 !important;}}"],e=>{let{rightWidth:t}=e;return t},e=>{let{hideOnMobileModalNoImg:t,hideOnMobileByBack:n}=e;return t||n?"none":"flex"},e=>{let{sheetHeight:t}=e;return t},e=>{let{isDragging:t}=e;return t?"none":"height 200ms ease"},eQ.W2,w.Fq,eQ.W2,w.Fq),eY=j.ZP.div.withConfig({componentId:"sc-2c14c508-4"})(["display:none;@media (max-width:768px){display:flex;justify-content:center;padding:20px 0 10px;touch-action:none;-webkit-user-select:none;user-select:none;}"]),eq=j.ZP.div.withConfig({componentId:"sc-2c14c508-5"})(["width:36px;height:5px;border-radius:999px;background:#d0d5dd;"]),eJ=j.ZP.div.withConfig({componentId:"sc-2c14c508-6"})(["display:none;@media (max-width:768px){display:",";position:absolute;top:48px;left:0;right:0;bottom:0;z-index:6;background:transparent;touch-action:none;}"],e=>{let{visible:t}=e;return t?"block":"none"}),eX=j.ZP.button.withConfig({componentId:"sc-2c14c508-7"})(["display:none;@media (max-width:768px){display:",";position:absolute;top:10px;left:10px;background:transparent;border:none;cursor:pointer;padding:0;align-items:center;justify-content:center;width:24px;height:24px;&:hover{opacity:0.7;}}"],e=>{let{visible:t}=e;return t?"flex":"none"}),e0=j.ZP.button.withConfig({componentId:"sc-2c14c508-8"})(["display:none;html.su-plugin &{display:flex !important;position:absolute !important;top:25px !important;left:25px !important;z-index:9999 !important;background:transparent !important;border:none !important;cursor:pointer !important;padding:4px 8px !important;align-items:center !important;justify-content:center !important;height:30px !important;color:#344054 !important;font-size:13px !important;font-weight:500 !important;white-space:nowrap !important;line-height:1 !important;}html.su-plugin &:hover{color:#1e6aff !important;}@media (min-width:769px) and (max-width:1440px){display:flex !important;position:absolute !important;top:25px !important;left:25px !important;z-index:9999 !important;background:transparent !important;border:none !important;cursor:pointer !important;padding:4px 8px !important;align-items:center !important;justify-content:center !important;height:30px !important;color:#344054 !important;font-size:13px !important;font-weight:500 !important;white-space:nowrap !important;line-height:1 !important;}@media (min-width:769px) and (max-width:1440px){&:hover{color:#1e6aff !important;}}"]),e1=j.ZP.button.withConfig({componentId:"sc-2c14c508-9"})(["display:none;@media (max-width:768px){display:",";position:absolute;top:5px;left:5px;background:transparent;border:none;cursor:pointer;padding:0;align-items:center;justify-content:center;width:35px;height:35px;&:hover{opacity:0.7;}}"],e=>{let{visible:t}=e;return t?"flex":"none"});var e2=e=>{let{onClickCloseModal:t,isModal:n,userId:d,selSceneId:j,storeQuery:I}=e,[C,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=()=>k(window.innerWidth<=768);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let P=(0,a.Zl)(g.Z);(0,o.useEffect)(()=>{if(n)return P(!0),()=>P(!1)},[n,P]);let S=(0,l.useRouter)(),Z=(0,o.useRef)(null),A=(0,o.useCallback)(()=>{t(),S.push("/home")},[t,S]),[E,D]=(0,o.useState)("40%"),[L,N]=(0,o.useState)("60%"),[R,F]=(0,o.useState)(!1),[T,B]=(0,o.useState)(!0),[O,W]=(0,o.useState)("600px"),[_,H]=(0,o.useState)("450px"),[U,Q]=(0,o.useState)(4),[$,K]=(0,o.useState)("300px"),[V,G]=(0,o.useState)({xs:2,sm:3,md:4,lg:5,xl:6}),[Y,q]=(0,o.useState)({xs:8,sm:8,md:10,lg:10,xl:17}),[J,X]=(0,o.useState)({xs:2,sm:3,md:3,lg:4,xl:4}),ee=(0,o.useRef)(0),[et,en]=(0,a.FV)(h),[ei,eo]=(0,a.FV)(h),[er,el]=(0,o.useState)(1),[ea,ed]=(0,o.useState)([]),[es,ec]=(0,o.useState)({rgb_r:0,rgb_g:0,rgb_b:0,page:1,categories:[],companyName:"",cropdata:"",txtSearch:"",isRandom:0,storeName:""}),[eu,ep]=(0,o.useState)(""),[ef,eh]=(0,o.useState)(""),[eg,em]=(0,a.FV)(m.Z),[ex,ev]=(0,a.FV)(v.Z),[eb,ew]=(0,a.FV)(x),[ey,ej]=(0,o.useState)(0),[eI,eC]=(0,a.FV)(b.Z),[ek,eP]=(0,o.useState)(),[eZ,eA]=(0,o.useState)(!0),[eE,eM]=(0,o.useState)(!0),[eD,eL]=(0,o.useState)(33),[eN,eR]=(0,o.useState)(!1),eF=(0,o.useRef)(0),eT=(0,o.useRef)(33),eB=(0,o.useRef)(0),eO=(0,o.useRef)(!1),[eW,e_]=(0,o.useState)(!1),eQ=!(eW&&80===eD),e2=(0,o.useRef)(0),e6=()=>(e2.current+=1,e2.current),e8=(0,o.useRef)(0),e4=e=>e===e2.current,e5=(0,o.useRef)(!1),e3=(0,o.useRef)(!1),e9=()=>{let e=Z.current;if(e)try{e.scrollTo({top:0,behavior:"auto"})}catch(t){e.scrollTop=0}},[e7,te]=(0,o.useState)([]),tt=C?12:20;(0,o.useEffect)(()=>{if(eg.length>0)return;let e=new Map;for(let t of ea)(Array.isArray(t.categoryIds)?t.categoryIds:"number"==typeof t.categoryId||"string"==typeof t.categoryId?[t.categoryId]:t.category&&("number"==typeof t.category.id||"string"==typeof t.category.id)?[t.category.id]:Array.isArray(t.categories)?t.categories.map(e=>e&&void 0!==e.id?e.id:e).filter(e=>"number"==typeof e||"string"==typeof e):[]).forEach(t=>{var n;let i=String(t);e.set(i,(null!==(n=e.get(i))&&void 0!==n?n:0)+1)});te(Array.from(e.entries()).sort((e,t)=>t[1]-e[1]).map(e=>{let[t]=e;return t}))},[ea,eg]),(0,o.useEffect)(()=>{C?(D("100%"),N("0%"),B(!1),eL(33)):(D("40%"),N("60%"),B(!0))},[C]);let{mutate:tn}=(0,p.Z)({onSuccess:e=>{ew(!1),ej(ee.current),eP(e)},onError:()=>{ew(!1)}}),ti=async(e,t,n)=>{e4(e)&&(1===t?ed(n):ed(e=>[...e,...n]),ew(!1),ev(!1),n.length<30?eA(!1):eA(!0))},to=e=>{e4(e)&&(ew(!1),ev(!1))},tr=()=>{ed([]),eP(void 0),ej(0),null!=eI&&eC(null)},tl=(e,t)=>{let n=e6();if(!e.cropdata||""===e.cropdata.trim()){var i,o;e8.current||(e8.current=Math.floor(2147483647*Math.random())+1);let r=(null!==(o=e.categories)&&void 0!==o?o:[]).map(e=>Number(e)).filter(e=>Number.isFinite(e));(0,u.Z)({page:t,categories:r.length?r:void 0,txtSearch:(null===(i=e.txtSearch)||void 0===i?void 0:i.trim())||void 0,store:e.storeName||void 0,randSeed:e8.current},{onSuccess:e=>{ti(n,t,e)},onError:()=>{to(n)}});return}(0,c.Z)(e,{onSuccess:e=>{ti(n,t,e)},onError:()=>{to(n)}})},ta=(e,t,i)=>{ev(!0),ew(!0),el(1),eA(!0),e9(),tr();let o={rgb_r:e.rgb_r,rgb_g:e.rgb_g,rgb_b:e.rgb_b,page:1,categories:t,companyName:"",cropdata:e.cropdata,txtSearch:n?"":i,isRandom:0,storeName:I};ec(o),tl(o,1)},td=e=>{ew(!0),1===e?ev(!0):ev(!1)},ts=e=>{td(e),eA(!0);let t={rgb_r:0,rgb_g:0,rgb_b:0,page:e,categories:[],companyName:"",cropdata:"",txtSearch:"",isRandom:0,storeName:I};1===e&&(e9(),tr(),ec(t)),tl(t,e)},tc=(e,t,n)=>{td(e),eA(!0);let i={rgb_r:0,rgb_g:0,rgb_b:0,page:e,categories:t,companyName:"",cropdata:"",txtSearch:n,isRandom:0,storeName:I};1===e&&(e9(),tr(),ec(i)),tl(i,e)},tu=(e,t,n,i)=>{td(e),eA(!0);let o={rgb_r:es.rgb_r,rgb_g:es.rgb_g,rgb_b:es.rgb_b,page:e,categories:t,companyName:"",cropdata:n,txtSearch:i,isRandom:0,storeName:I};1===e&&(e9(),tr(),ec(o)),tl(o,e)};(0,o.useEffect)(()=>{1!==er&&(es.cropdata?tu(er,eg,es.cropdata,eu):0!==eg.length||""!==eu.trim()?tc(er,eg,eu):ts(er))},[er]),(0,o.useEffect)(()=>{if(!e3.current){e3.current=!0;return}if(e5.current){e5.current=!1;return}eu!==ef&&(eh(eu),el(1),eA(!0),e9(),tr(),es.cropdata?tu(1,eg,es.cropdata,eu):0!==eg.length||""!==eu.trim()?tc(1,eg,eu):ts(1))},[eu]);let tp=(0,o.useCallback)(s()(e=>{e[0].isIntersecting&&!eb&&eZ&&!ex&&el(e=>e+1)},300),[eb,eZ,ex]),tf=C&&n&&!ei;(0,o.useEffect)(()=>{C?eM(!tf):eM(!0)},[C,tf]);let th=e=>{C&&(eR(!0),eF.current=e.touches[0].clientY,eT.current=eD,eB.current=0)},tg=e=>{if(!C||!eN||!eW)return;let t=e.touches[0].clientY,n=eF.current-t;eB.current=n;let i=window.innerHeight||1,o=eT.current+n/i*100;o<33&&(o=33),o>80&&(o=80),eL(o)},tm=()=>{if(!C)return;eR(!1);let e=eT.current>=79.5;if(!eW||!e){eL(80),e_(!0);return}eB.current<-2?eL(33):eL(80)};return(0,i.jsxs)(e$,{leftWidth:E,children:[(0,i.jsxs)("div",{children:[!C&&(0,i.jsx)(z,{isBackShow:R,onClickForward:function(){if(C){D("0%"),N("100%"),B(!1),F(!0);return}F(!0),D("50%"),N("50%"),W("900px"),H("500px"),Q(3),K("200px"),G({...V,xl:4}),q({...Y,xl:8}),X({...J,xl:6,lg:8}),B(!0)},onClickBack:function(){if(C){D("100%"),N("0%"),B(!1),F(!1);return}F(!1),D("40%"),N("60%"),W("600px"),H("450px"),Q(4),K("300px"),G({...V,xl:6}),q({...Y,xl:12}),X({...J,xl:4,lg:6}),B(!0)},leftWidth:E}),(0,i.jsx)(eX,{visible:C&&eE,onClick:()=>eM(!1),children:(0,i.jsx)(eH.Z,{})}),(0,i.jsx)(e1,{visible:C&&!eE&&!!ei,onClick:()=>eM(!0),children:(0,i.jsx)(r.default,{src:eU,alt:"ai-icon",width:35,height:35})}),(0,i.jsx)(eK,{onClick:t,children:(0,i.jsx)(r.default,{src:y.Z,alt:"close-button",width:13,height:13})}),(0,i.jsxs)(e0,{onClick:A,children:[(0,i.jsx)("span",{style:{fontSize:"22px",lineHeight:1,marginRight:"6px"},children:"←"}),"라이브러리로 돌아가기"]})]}),(0,i.jsx)(eV,{leftWidth:E,children:(0,i.jsx)(eS,{onHandleCrop:e=>{e5.current=!0,ew(!0),ev(!0),el(1),eA(!0),e9(),tr(),ec({rgb_r:e.rgb_r,rgb_g:e.rgb_g,rgb_b:e.rgb_b,page:1,categories:e.categories,companyName:e.companyName,cropdata:e.cropdata,txtSearch:e.txtSearch,isRandom:e.isRandom,storeName:I}),ta(e,eg,eu)},imgSrc:ei,setImgSrc:eo,imgWidth:O,imgHeight:_,imgListArrGrid:U,imgListArrGridHeight:$,setAiProductPage:el,storeQuery:I,leftWidth:E,isModal:n,forceShowListWrapper:!eE})}),(0,i.jsxs)(eG,{rightWidth:L,hideOnMobileModalNoImg:tf,hideOnMobileByBack:!eE,sheetHeight:eD,isDragging:eN,onTouchStartCapture:e=>{var t,n;if(!C)return;let i=null!==(n=null===(t=Z.current)||void 0===t?void 0:t.scrollTop)&&void 0!==n?n:0;eO.current=eW&&80===eD&&i<=0,eO.current&&(eR(!0),eF.current=e.touches[0].clientY,eT.current=eD,eB.current=0)},onTouchMoveCapture:e=>{if(!C||!eO.current||!eN)return;let t=e.touches[0].clientY,n=eF.current-t;if(eB.current=n,n<0){e.preventDefault();let t=window.innerHeight||1,i=eT.current+n/t*100;i<33&&(i=33),i>80&&(i=80),eL(i)}},onTouchEndCapture:()=>{C&&eO.current&&(eR(!1),eB.current<-2?eL(33):eL(80),eO.current=!1)},children:[(0,i.jsx)(eY,{onTouchStart:th,onTouchMove:tg,onTouchEnd:tm,role:"button","aria-label":"Drag to resize",children:(0,i.jsx)(eq,{})}),(0,i.jsx)(eJ,{visible:eQ,onTouchStart:th,onTouchMove:tg,onTouchEnd:tm}),(0,i.jsx)(w.Fq,{isModal:n,children:I?null:(0,i.jsx)(ez,{setAiProductPage:el,setSearchKeyword:ep,FetchTextSearch:(e,t,n,i)=>{let o=0===e.length&&""===t.trim()&&""===i.trim();if(ew(!0),ev(!0),el(1),eA(!0),e9(),tr(),o){let e={rgb_r:0,rgb_g:0,rgb_b:0,page:1,categories:[],companyName:"",cropdata:"",txtSearch:"",isRandom:0,storeName:I};ec(e),tl(e,1);return}let r={rgb_r:0,rgb_g:0,rgb_b:0,page:n,categories:e,companyName:"",cropdata:i,txtSearch:t,isRandom:0,storeName:I};ec(r),tl(r,n)},FetchImgSearchProducts:tu,cropdata:null==es?void 0:es.cropdata,productPage:er,searchKeyword:eu,rankedCategoryIds:e7.slice(0,tt)})}),(0,i.jsx)(w.fx,{storeQuery:I,isModal:n,ref:Z,children:(0,i.jsx)(M.Z,{isModal:n,products:ea,imgListArrGrid:U,userId:d,GetProductDetail:(e,t)=>{if(ee.current=t,t<0){ew(!1),f.Wg.post("/product/view",{productId:t,source:"ai_search"}).catch(()=>{});return}ew(!0),tn({userId:e,productId:t,productCode:"",source:"ai"})},productDetail:ek,selProductId:ey,setSelProductId:ej,handleObserver:tp,productPage:er,isEntireItemLoading:ex,hasMore:!1})})]})]})}},67028:function(e,t,n){n.d(t,{s:function(){return a}});var i=n(2265),o=n(99376),r=n(43618),l=n(26163);function a(){var e,t;let n=(0,o.useSearchParams)(),a=null!==(e=null==n?void 0:n.get("store"))&&void 0!==e?e:"",d=null!==(t=null==n?void 0:n.get("q"))&&void 0!==t?t:"",s=(0,r.sJ)(l.ot),[c,u]=(0,i.useState)(d);return(0,i.useEffect)(()=>{var e;u(null!==(e=null==n?void 0:n.get("q"))&&void 0!==e?e:"")},[null==n?void 0:n.toString()]),{searchKeyword:c,setSearchKeyword:u,filters:s,storeQuery:a}}},27872:function(e,t,n){n.d(t,{P1:function(){return a},Ri:function(){return s}});var i=n(2265),o=n(8668),r=n(54843);let l="mcd_push_dismissed";function a(){if(!(0,o.kV)()||!("Notification"in window)||"default"!==Notification.permission)return!1;try{if("1"===localStorage.getItem(l))return!1}catch(e){}return!0}function d(){try{localStorage.setItem(l,"1")}catch(e){}}function s(){return{request:(0,i.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"web";if(!(0,o.kV)()||!("Notification"in window))return"unsupported";let t=await Notification.requestPermission();return"granted"===t?await (0,r.D4)(e):d(),t},[]),isPromptable:a,markDismissed:d}}},8668:function(e,t,n){n.d(t,{WM:function(){return s},ft:function(){return l},kV:function(){return a},qe:function(){return r}});var i=n(738),o=n(27012);let r={apiKey:"AIzaSyCB--2xNFu3z2hbFS2G1_g1j1aLSioAKaY",authDomain:"macodi-push.firebaseapp.com",projectId:"macodi-push",storageBucket:"macodi-push.firebasestorage.app",messagingSenderId:"356231351762",appId:"1:356231351762:web:78c09b0b0659109649cc0b"},l="BACTfl27sU62pBBcFg3NOPx9mVlMyfSrbPOY7QuygpNQfViiZtIomLTkS1T6IQgE_IPHzGHJLYqq54kpZLgYk-M",a=()=>!!r.apiKey&&!!r.projectId&&!!r.appId&&!!r.messagingSenderId&&!!l,d=null;async function s(){if(!a())return null;try{if(!await (0,o.Gb)())return null;let e=a()?(d||(d=(0,i.C6)().length?(0,i.Mq)():(0,i.ZF)(r)),d):null;if(!e)return null;return(0,o.KL)(e)}catch(e){return null}}},54843:function(e,t,n){n.d(t,{D4:function(){return d},o2:function(){return c},yA:function(){return a}});var i=n(27012),o=n(8668),r=n(45209);let l=null;async function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"web";"Notification"in window&&"granted"===Notification.permission&&await d(e)}async function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"web",t=await (0,o.WM)();if(!t)return!1;let n=await ("undefined"!=typeof navigator&&"serviceWorker"in navigator&&(0,o.kV)()?(l||(l=navigator.serviceWorker.register(function(){let e=new URLSearchParams(Object.entries(o.qe).filter(e=>{let[,t]=e;return"string"==typeof t&&t.length>0})).toString();return"".concat("/firebase-messaging-sw.js","?").concat(e)}(),{scope:"/"}).catch(()=>null)),l):Promise.resolve(null));if(!n)return!1;try{let l=await (0,i.LP)(t,{vapidKey:o.ft,serviceWorkerRegistration:n});if(!l)return!1;return await (0,r.Us)(l,e)}catch(e){return!1}}let s=!1;async function c(){if(s)return;let e=await (0,o.WM)();e&&(s=!0,(0,i.ps)(e,e=>{let t=e.data||{},n=t.title||"마코디 신제품",i=t.url||"/home";"Notification"in window&&"granted"===Notification.permission&&(new Notification(n,{body:t.body||"",icon:t.icon||"/images/push-icon.png",data:{url:i}}).onclick=()=>{window.focus(),window.location.href=i})}))}},45209:function(e,t,n){n.d(t,{Sv:function(){return r},Us:function(){return o}});var i=n(29918);async function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"web";try{return await i.et.post("/push/subscribe",{token:e,platform:t}),!0}catch(e){return!1}}async function r(){try{var e;let t=await i.et.get("/push/status");return!!(null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.active)}catch(e){return!1}}},71670:function(e,t,n){n.d(t,{Rw:function(){return d},Zd:function(){return l},eP:function(){return s},fH:function(){return c},iv:function(){return a}});var i=n(27872),o=n(8668),r=n(45209);let l="mcd:push-prompt",a="mcd:plugin-push-prompt",d="mcd:push-granted-info";function s(e){(0,i.P1)()&&window.dispatchEvent(new CustomEvent(l,{detail:{message:e}}))}async function c(e){if(function(){try{if(window.sketchup||document.documentElement.classList.contains("su-plugin")||"1"===sessionStorage.getItem("__mcd_su"))return!0}catch(e){}return!1}()&&(0,o.kV)()){try{if("1"===localStorage.getItem("mcd_plugin_pushopt_dismissed"))return}catch(e){}try{if(await (0,r.Sv)())return}catch(e){}window.dispatchEvent(new CustomEvent(a,{detail:{message:e}}))}}},9927:function(e,t,n){n.d(t,{L:function(){return i},q:function(){return o}});let i="mcd:exhausted-sheet";function o(){window.dispatchEvent(new CustomEvent(i))}},72513:function(e,t,n){let i=(0,n(43618).cn)({key:"aiModalOpenAtom",default:!1});t.Z=i},87530:function(e,t,n){n.d(t,{DX:function(){return h},HG:function(){return r},Sh:function(){return p},WL:function(){return m},_t:function(){return l},bo:function(){return s},ce:function(){return x},d5:function(){return g},es:function(){return a},nX:function(){return o},oL:function(){return d},p_:function(){return c},rc:function(){return u},sd:function(){return f}});var i=n(43618);let o=(0,i.cn)({key:"boardCollabTool",default:"sel"}),r=(0,i.cn)({key:"boardSceneTool",default:"none"}),l=(0,i.cn)({key:"boardSceneShape",default:"rect"}),a=(0,i.cn)({key:"boardSceneUploadTick",default:0}),d=(0,i.cn)({key:"boardPendingSceneId",default:null}),s=(0,i.cn)({key:"boardPendingCommentPopover",default:null}),c=(0,i.cn)({key:"boardCollabCommentTarget",default:null}),u=(0,i.cn)({key:"boardCollabComposer",default:null}),p=(0,i.cn)({key:"boardCollabDrawerOpen",default:!1}),f=(0,i.cn)({key:"boardCollabDrawerSwap",default:!1}),h=(0,i.cn)({key:"boardCollabDrawerMounted",default:!1}),g=(0,i.cn)({key:"boardCollabPopover",default:null}),m=(0,i.cn)({key:"boardCollabShareProjectId",default:null}),x=(0,i.cn)({key:"boardCollabShareCommand",default:0})},3699:function(e,t,n){let i=(0,n(43618).cn)({key:"boardPickerOpenAtom",default:!1});t.Z=i},22445:function(e,t,n){n.d(t,{V:function(){return i},k:function(){return o}});let i=(0,n(43618).cn)({key:"boardSelectedProductAtom",default:null}),o=e=>(null==e?void 0:e.boardId)!=null?"b".concat(e.boardId):(null==e?void 0:e.projectId)!=null?"p".concat(e.projectId):"root"},26437:function(e,t,n){n.d(t,{H:function(){return i}});let i=(0,n(43618).cn)({key:"boardTreeCommandAtom",default:null})},77047:function(e,t,n){n.d(t,{X:function(){return i}});let i=(0,n(43618).cn)({key:"boardTreeDragProductAtom",default:null})},19783:function(e,t,n){n.d(t,{O:function(){return i}});let i=(0,n(43618).cn)({key:"boardTreeFocusAtom",default:null})},76904:function(e,t,n){let i=(0,n(43618).cn)({key:"cart",default:[]});t.Z=i},17140:function(e,t,n){let i=(0,n(43618).cn)({key:"currentFileKey",default:""});t.Z=i},2132:function(e,t,n){let i=(0,n(43618).cn)({key:"currentFileName",default:""});t.Z=i},32806:function(e,t,n){let i=(0,n(43618).cn)({key:"currentProjectGuid",default:""});t.Z=i},2711:function(e,t,n){let i=(0,n(43618).cn)({key:"isItemLoadingAtom",default:!1});t.Z=i},15949:function(e,t,n){let i=(0,n(43618).cn)({key:"isShowAiDetailIndex",default:null});t.Z=i},52482:function(e,t,n){let i=(0,n(43618).cn)({key:"isShowDetail",default:"none"});t.Z=i},94891:function(e,t,n){let i=(0,n(43618).cn)({key:"showNoDataMessage",default:!1});t.Z=i},98773:function(e,t,n){n.d(t,{F:function(){return o},O:function(){return r}});let i="mcd_recent_viewed";function o(){try{let e=JSON.parse(localStorage.getItem(i)||"[]");return Array.isArray(e)?e.filter(e=>e&&e.id&&e.name):[]}catch(e){return[]}}function r(e){if(e&&e.id&&e.name)try{var t,n,r,l,a,d;let s=o(),c=s.find(t=>t.id===e.id),u=s.filter(t=>t.id!==e.id);u.unshift({id:e.id,name:e.name||(null==c?void 0:c.name)||"",image:e.image||(null==c?void 0:c.image)||"",category:e.category||(null==c?void 0:c.category)||"",subCategory:e.subCategory||(null==c?void 0:c.subCategory)||"",isHighQuality:null!==(n=null!==(t=e.isHighQuality)&&void 0!==t?t:null==c?void 0:c.isHighQuality)&&void 0!==n&&n,hasSeamless:null!==(l=null!==(r=e.hasSeamless)&&void 0!==r?r:null==c?void 0:c.hasSeamless)&&void 0!==l&&l,hasPBR:null!==(d=null!==(a=e.hasPBR)&&void 0!==a?a:null==c?void 0:c.hasPBR)&&void 0!==d&&d}),localStorage.setItem(i,JSON.stringify(u.slice(0,16)))}catch(e){}}},55161:function(e,t,n){function i(e){let t=e.split("*").map(e=>e.trim()).filter(Boolean),n=t.length;return t.map((e,t)=>{if(!/\d/.test(e))return e;let i=/T$/i.test(e),o=e.replace(/T$/i,""),r=parseFloat(o);return(i?"T":1===n?!isNaN(r)&&r<100?"T":"W":2===n?0===t?"W":o.includes(".")||!isNaN(r)&&r<60?"T":"L":["W","L","T"][t]||"T")+o}).join("*")}function o(e){let t=e.split("*").map(e=>e.trim()).filter(Boolean),n=t.length,i={W:null,H:null,T:null};return t.forEach((e,t)=>{var o;if(!/\d/.test(e))return;let r=/T$/i.test(e),l=e.replace(/T$/i,""),a=parseFloat(l);isNaN(a)||(i[r?"T":1===n?a<100?"T":"W":2===n?0===t?"W":l.includes(".")||a<60?"T":"H":null!==(o=["W","H","T"][t])&&void 0!==o?o:"T"]=a)}),i}n.d(t,{CC:function(){return r},Hz:function(){return i},cs:function(){return l},jx:function(){return o}});let r=e=>e>=100?100*Math.round(e/100):10*Math.round(e/10);function l(e){let t=e.match(/\d{1,5}(?:\.\d+)?\s*\*\s*\d{1,5}(?:\.\d+)?(?:\s*\*\s*\d{1,5}(?:\.\d+)?)?/g);return Array.from(new Set((t&&t.length?t:e.split(",")).map(e=>i(e.replace(/\s/g,"").trim())).filter(Boolean)))}},98346:function(e,t){t.Z={src:"/_next/static/media/Property 1=Frame 29.82d7a163.png",height:584,width:584,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAUVBMVEVMaXFjYMgyMmw2NnVIRpYxM21dWr1HR5RXVLJMTKZgXcVBQYpERJBYVK1JSJdSUKpRTqY2NnU/P581N3QnKlo5O3xfXL9AQIZhX8U6O31uatzG98lxAAAAGXRSTlMA8youmvOaK/oGKrTwLfnws5YItLmWsfa5Mk/zZAAAAAlwSFlzAAAsSwAALEsBpT2WqQAAAD9JREFUeJwVx8URwDAQALE1nJnCcfovNOOfBPoM35vAiFinVOUQDUndzI0YcYF5EfeF/HjwYWBKsbb3tdzaqPxOSQI49aRxeQAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8}},17553:function(e,t){t.Z={src:"/_next/static/media/arrowTop.940fead8.svg",height:40,width:40,blurWidth:0,blurHeight:0}}}]);