PageSourceSearch

https://yamaejubu.com/_/fo-shopping/assets/free-ship-notify-CUB3603p.js

js yamaejubu.com collected 2026-10-02 01:52:54 UTC 16,892 bytes, 126 lines download raw bytes

1import{r as o,c as A,b as r,F as ee}from"./client-BLZHgAOY.js";import{u as h}from"./index-Cu0hS8cE.js";import{f as L,h as ye,i as le,c as de,u as ue,j as Ce,F as Z,l as Se,k as xe,m as ve,n as _e,d as Te,b as Ee,a as ke,o as Fe,p as Pe,M as Ie}from"./grim-icon-gray-image-Bi3STd6L.js";import{i as Le,j as Re,r as te,k as De,l as $e,b as Be}from"./brandscope-DaTyj9sL.js";import{E,r as W,h as Me}from"./chunk-7GDEU6E6-D02sElHM.js";import{P as Oe}from"./plus-CS8upfQp.js";import{C as Ue}from"./chunk-ZCF3P36E-yd1pWhXG.js";import{t as re}from"./index-DphZSdzt.js";import{f as Ae}from"./format-currency-vS79YReB.js";const oe=.8,je=500;function ie({name:t,priceText:u,accentColor:d,onProductClick:f,onAddClick:l,isAddedFeedback:k=!1,thumbUrl:R,designType:D="vertical",cartButtonType:$,cartCount:c=0,trackLoading:w=!1,tracking:b,viewTracking:x}){const v=D==="horizontal",V=v?"48px":"80px",_=He($,D),[y,C]=o.useState(!1),B=o.useRef(null),X=o.useRef(null),j=o.useRef(x);j.current=x,o.useEffect(()=>{const S=X.current;if(!S||typeof IntersectionObserver>"u")return;let g=null,G=!1;const U=new IntersectionObserver(Y=>{const P=Y[0];!P||G||(P.intersectionRatio>=oe?g===null&&(g=window.setTimeout(()=>{G=!0,j.current&&Le(j.current),U.disconnect(),g=null},je)):g!==null&&(window.clearTimeout(g),g=null))},{threshold:[oe]});return U.observe(S),()=>{U.disconnect(),g!==null&&window.clearTimeout(g)}},[]),o.useEffect(()=>{if(!w||!y)return;if(B.current!==null&&c!==B.current){B.current=null,C(!1);return}const S=window.setTimeout(()=>{B.current=null,C(!1)},5e3);return()=>window.clearTimeout(S)},[c,y,w]);const K=()=>{if(b&&Re(b),!w){l?.();return}y||(B.current=c,C(!0),l?.())},T=c>0?{backgroundColor:d,color:"#FFFFFF"}:{backgroundColor:"#FFFFFF",border:`0.5px solid ${d}`,color:d},F={...T,'&[data-imweb-loading="true"]':T},m=r(Me,{variant:"secondary",rounded:!0,"data-free-ship-notify-add-button":"true","aria-label":`${t} 담기`,icon:k?r(se,{accentColor:d}):c>0?r(E,{width:"16px",alignItems:"center",justifyContent:"center",flexShrink:0,children:r(W,{variant:"label-small-bold",colorToken:"textOn",children:c})}):r(Oe,{size:"small"}),size:"tiny",onClick:K,isLoading:w&&y,sx:F}),q=r(Ye,{type:"button","data-free-ship-notify-add-button":"true",onClick:K,disabled:w&&y,"aria-label":`${t} 담기`,children:k?r(se,{accentColor:d}):A(ee,{children:[r(Ne,{}),r("span",{children:"담기"})]})}),M=R?r("img",{src:R,alt:t,draggable:!1,style:{width:"100%",height:"100%",objectFit:"cover",userSelect:"none"}}):r(E,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",background:h.semantic.color.surfaceSub,children:r("img",{src:ye,alt:"",width:32,height:32,draggable:!1})}),O=A(ze,{$size:V,children:[f?r(We,{type:"button",onClick:f,"aria-label":`${t} 상세 보기`,children:M}):r(Ve,{children:M}),!v&&_==="image"&&r(E,{position:"absolute",bottom:h.spacing[15],right:h.spacing[15],children:m})]}),J=A(ee,{children:[r(W,{variant:"body-small",numOfLine:2,children:t}),r(W,{variant:"label-small-bold",children:u})]}),H=f?r(qe,{type:"button",onClick:f,"aria-label":`${t} 상세 보기`,children:J}):r(Xe,{children:J});return v?A(E,{ref:X,gap:h.spacing[2],alignItems:"center",justifyContent:"space-between",flexGrow:0,flexShrink:0,width:"224px",padding:h.spacing[3],borderRadius:h.rounded.medium,border:`1px solid ${h.semantic.color.border}`,children:[A(E,{gap:h.spacing[2],alignItems:"center",children:[O,H]}),_!=="none"&&m]}):A(E.Column,{ref:X,gap:h.spacing[15],width:"80px",children:[O,_==="bottom"&&q,H]})}function He(t,u){return t==="image"||t==="none"||t==="bottom"&&u==="vertical"?t:u==="horizontal"?"image":"bottom"}function Ne(){return r("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:r("path",{d:"M10.6669 6V4C10.6669 2.52724 9.47301 1.33333 8.00025 1.33333C6.52749 1.33333 5.33358 2.52724 5.33358 4V6M2.39491 6.90131L1.99492 11.168C1.88118 12.3811 1.82432 12.9877 2.02561 13.4562C2.20244 13.8678 2.51233 14.208 2.90559 14.4225C3.35326 14.6667 3.96249 14.6667 5.18094 14.6667H10.8195C12.038 14.6667 12.6472 14.6667 13.0949 14.4225C13.4882 14.208 13.798 13.8678 13.9749 13.4562C14.1762 12.9877 14.1193 12.3811 14.0056 11.168L13.6056 6.90131C13.5095 5.8769 13.4615 5.36469 13.2311 4.97744C13.0282 4.63639 12.7285 4.36341 12.37 4.19323C11.9629 4 11.4485 4 10.4195 4L5.58094 4C4.55204 4 4.03759 4 3.63053 4.19323C3.27202 4.36341 2.97225 4.63639 2.76935 4.97744C2.53897 5.36469 2.49095 5.8769 2.39491 6.90131Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2"})})}function se({accentColor:t}
1){return r(Ge,{viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,$accentColor:t,children:r("path",{d:"M5.5 12.5L10 17L18.5 7.5"})})}const ze=L.div`
2  position: relative;
3  width: ${({$size:t})=>t};
4  height: ${({$size:t})=>t};
5  border-radius: 6px;
6  overflow: hidden;
7  flex-shrink: 0;
8`,We=L.button`
9  width: 100%;
10  height: 100%;
11  display: block;
12  padding: 0;
13  border: 0;
14  background: transparent;
15  cursor: pointer;
16`,Ve=L.div`
17  width: 100%;
18  height: 100%;
19`,Xe=L.div`
20  min-width: 0;
21  display: flex;
22  flex-direction: column;
23  gap: ${h.spacing["05"]};
24`,qe=L.button`
25  min-width: 0;
26  display: flex;
27  flex-direction: column;
28  gap: ${h.spacing["05"]};
29  padding: 0;
30  border: 0;
31  background: transparent;
32  text-align: left;
33  cursor: pointer;
34`,Ge=L.svg`
35  width: 20px;
36  height: 20px;
37  color: ${({$accentColor:t})=>t};
38  animation: recommendation-added-pop 180ms ease-out;
39
40  path {
41    stroke: currentColor;
42    stroke-width: 2;
43    stroke-linecap: round;
44    stroke-linejoin: round;
45    stroke-dasharray: 22;
46    stroke-dashoffset: 22;
47    animation: recommendation-check-draw 360ms ease-out forwards;
48  }
49
50  @keyframes recommendation-added-pop {
51    from {
52      opacity: 0;
53      transform: scale(0.72);
54    }
55
56    to {
57      opacity: 1;
58      transform: scale(1);
59    }
60  }
61
62  @keyframes recommendation-check-draw {
63    to {
64      stroke-dashoffset: 0;
65    }
66  }
67`,Ye=L.button`
68  width: 100%;
69  height: 28px;
70  display: flex;
71  align-items: center;
72  justify-content: center;
73  gap: 4px;
74  border: 1px solid #dbdee3;
75  border-radius: 6px;
76  background: #ffffff;
77  color: var(--text-secondary, #4B515B);
78  text-align: center;
79  font-family: var(--typeface-base, "imweb Sans");
80  font-size: var(--scale-text-xsmall, 12px);
81  font-style: normal;
82  font-weight: var(--weight-font-semibold, 600);
83  line-height: var(--leading-4, 16px);
84  cursor: pointer;
85
86  &:disabled {
87    cursor: wait;
88    opacity: 0.6;
89  }
90`,Ke=5,pe="/shop_view/";function Je(t,u){const d=t?.free_shipping_price??t?.total_price??u,f=typeof d=="number"?d:Number(d);return Number.isFinite(f)&&f>0?f:0}function Ze({accentColor:t,freeShippingThreshold:u,currentTotal:d=0,remainingAmount:f,onUpsellAvailabilityChange:l}){const{context:k,placement:R,prodIdx:D,upsellProdDesignType:$,cartButtonType:c}=le(),w=k==="cart"?"shop_cart":"shop_view",b=de(),x=ue(),v=k==="cart"?x?.shopCartStyle?te({context:"cart",shopCartStyle:x.shopCartStyle}):null:x?.shopDetailStyle?te({context:"prod",shopDetailStyle:x.shopDetailStyle}):null,V=b.designType??x?.upsellProdDesignType??$,_=b.cartButtonType??x?.cartButtonType??c,y=Ce(),C=o.useRef(null),[B,X]=o.useState(!1),[j,K]=o.useState(!1),T=o.useRef({isPointerDown:!1,pointerId:0,startX:0,scrollLeft:0,hasDragged:!1}),F=o.useRef(!1),[m,q]=o.useState([]),[M,O]=o.useState(!1),[J,H]=o.useState({}),S=o.useRef({}),g=o.useRef({}),[G,U]=o.useState(!1);o.useEffect(()=>{const e=n=>{const i=n.detail??{};ve(i)&&(q(i.recommendations?.prod_list??[]),O(!0))};return window.addEventListener(Z.recommendationsUpdate,e),()=>{window.removeEventListener(Z.recommendationsUpdate,e)}},[]),o.useEffect(()=>{l?.(M&&m.length>0)},[M,m.length,l]),o.useEffect(()=>()=>{Object.values(g.current).forEach(clearTimeout),Object.values(S.current).forEach(clearTimeout)},[]);const Y=e=>{const n=e.code,i=S.current[n];i&&clearTimeout(i),H(s=>({...s,[n]:!0})),S.current={...S.current,[n]:setTimeout(()=>{H(s=>{const z={...s};return delete z[n],z}),delete S.current[n]},1e3)}},P=(e,n=0)=>{const i=e.code,s=g.current[i];if(s&&clearTimeout(s),n<=0){Y(e);return}g.current={...g.current,[i]:setTimeout(()=>{Y(e),delete g.current[i]},n)}},a=o.useRef({componentType:v,pageType:w,freeShippingThreshold:u,remainingAmount:f,recommendedProducts:m});a.current={componentType:v,pageType:w,freeShippingThreshold:u,remainingAmount:f,recommendedProducts:m},o.useEffect(()=>{const e=n=>{const i=n.detail;if(!i)return;const s=a.current,z=s.recommendedProducts.findIndex(we=>we.prod_idx===i.prodIdx);if(z<0)return;const I=s.recommendedProducts[z];I&&(I.has_required_options&&P(I,180),s.componentType&&De({prod_code:I.code,is_option:I.has_required_options,slot_index:z+1,item_price:I.price,component_type:s.componentType,page_type:s.pageType,free_shipping_threshold:s.freeShippingThreshold,remaining_amount:s.remainingAmou
90nt}))};return window.addEventListener(Z.additionalProductAdded,e),()=>{window.removeEventListener(Z.additionalProductAdded,e)}},[]);const p=b.upsellProductCodes?JSON.stringify(b.upsellProductCodes):null;o.useEffect(()=>{if(p!==null){const e=JSON.parse(p);if(e.length===0){q([]),O(!0);return}Se(e);return}xe(k==="cart"?void 0:D??void 0)},[p,k,D]);const N=e=>{window.location.href=et(pe,e.prod_idx)},fe=e=>{const n=R==="modal"?"cart":k;_e(e.prod_idx,n,(i,s,z)=>{if(i){if(n==="cart"){const I=Je(z,e.price);I>0&&(Te(d+I),window.IMWEB_SHOP_FREE_SHIP_NOTIFY_SDK?.setCartFreeShippingRemainingPrice?.(Math.max(0,f-I)))}e.has_required_options||P(e),n==="cart"&&window.dispatchEvent(new CustomEvent("imweb:cart:invalidated",{detail:{cart_type:"normal"}}))}})},he=e=>{const n=C.current;n&&(ae(e.target)||e.pointerType!=="mouse"||e.button!==0||n.scrollWidth<=n.clientWidth||(F.current=!1,U(!1),T.current={isPointerDown:!0,pointerId:e.pointerId,startX:e.clientX,scrollLeft:n.scrollLeft,hasDragged:!1}))},ge=e=>{const n=C.current,i=T.current;if(!n||!i.isPointerDown||i.pointerId!==e.pointerId)return;const s=e.clientX-i.startX;!i.hasDragged&&Math.abs(s)<Ke||(e.preventDefault(),n.hasPointerCapture(e.pointerId)||n.setPointerCapture(e.pointerId),i.hasDragged=!0,F.current=!0,U(!0),n.scrollLeft=i.scrollLeft-s)},Q=e=>{const n=C.current,i=T.current;if(!i.isPointerDown||i.pointerId!==e.pointerId)return;const s=i.hasDragged;if(n?.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),T.current={isPointerDown:!1,pointerId:0,startX:0,scrollLeft:0,hasDragged:!1},U(!1),s){window.setTimeout(()=>{F.current=!1},0);return}F.current=!1},me=e=>{const n=T.current;!n.isPointerDown||n.hasDragged||Q(e)},be=e=>{ae(e.target)||F.current&&(e.preventDefault(),e.stopPropagation(),F.current=!1)};o.useEffect(()=>{const e=()=>{const s=C.current;s&&(X(s.scrollLeft>0),K(s.scrollLeft+s.clientWidth<s.scrollWidth-1))},n=requestAnimationFrame(e),i=C.current;return i&&(i.addEventListener("scroll",e),window.addEventListener("resize",e)),()=>{cancelAnimationFrame(n),i&&i.removeEventListener("scroll",e),window.removeEventListener("resize",e)}},[m.length]);const ne=b.upsellProductCodes?.length===0;return M&&m.length===0&&!ne?null:A(Qe,{children:[r(tt,{ref:C,onPointerDown:he,onPointerMove:ge,onPointerUp:Q,onPointerLeave:me,onPointerCancel:Q,onLostPointerCapture:Q,onClickCapture:be,$isDragging:G,children:ne?Array.from({length:10},(e,n)=>r(ie,{name:"상품명",priceText:"0원",accentColor:t,designType:V,cartButtonType:_},`dummy-${n}`)):m.length>0?m.map((e,n)=>r(ie,{name:e.name,priceText:e.price_text,onProductClick:()=>N(e),onAddClick:()=>fe(e),isAddedFeedback:J[e.code]??!1,thumbUrl:e.thumb_url,designType:V,cartButtonType:_,cartCount:y[e.code]??0,trackLoading:!0,accentColor:t,tracking:v?{prod_code:e.code,is_option:e.has_required_options,slot_index:n+1,item_price:e.price,component_type:v,page_type:w,free_shipping_threshold:u,remaining_amount:f}:void 0,viewTracking:v?{prod_code:e.code,slot_index:n+1,item_price:e.price,component_type:v,page_type:w,free_shipping_threshold:u,remaining_amount:f}:void 0},e.prod_idx)):r(E,{width:"100%",justifyContent:"center",padding:h.spacing[5],children:r(Ue,{size:"medium"})})}),B&&r(ce,{position:"left"}),j&&r(ce,{position:"right"})]})}const Qe=L.div`
91  position: relative;
92  width: 100%;
93`;function et(t,u){try{const d=new URL(t,window.location.origin);return d.searchParams.set("idx",String(u)),`${d.pathname}${d.search}${d.hash}`}catch{return`${pe}?idx=${u}`}}function ae(t){return t instanceof HTMLElement&&t.closest('[data-free-ship-notify-add-button="true"]')!==null}const tt=L.div`
94  display: flex;
95  gap: ${h.spacing[3]};
96  overflow-x: auto;
97  padding: ${h.spacing[1]} 0;
98  cursor: ${({$isDragging:t})=>t?"grabbing":"grab"};
99  user-select: none;
100
101  &::-webkit-scrollbar {
102    display: none;
103  }
104  -ms-overflow-style: none;
105  scrollbar-width: none;
106`,ce=L.div`
107  position: absolute;
108  top: 0;
109  ${({position:t})=>t}: 0;
110  width: 40px;
111  height: 100%;
112  pointer-events: none;
113  z-index: 1;
114  background: linear-gradient(
115    270deg,
116    #FFFFFF 0%,
117    rgba(255, 255, 255, 0.95) 25%,
118    rgba(255, 255, 255, 0.85) 41.02%,
119    rgba(255, 255, 255, 0.78) 50.13%,
120    rgba(255, 255, 255, 0.65) 61.75%,
121    rgba(255, 255, 255, 0.45) 73.87%,
122    rgba(255, 255, 255, 0.25) 86.25%,
123    rgba(255, 255, 255, 0.00) 100%
124  );
125  ${({position:t})=>t==="left"&&"transform: scaleX(-1);"}
126`;function rt({freeShippingThreshold:t,onUpsellAvailabilityChange:u}){const[d,f]=o.useState(t);o.useEffect(()=>{f(t)},[t]),o.useEffect(()=>{const a=p=>{const N=p.detail;typeof N?.threshold=="number"&&f(N.threshold)};return window.addEventListener("imweb:freeShipNotify:freeShippingThreshold:update",a),()=>window.removeEventListener("imweb:freeShipNotify:freeShippingThreshold:update",a)},[]);const l=le(),k=l.placement==="modal"?"cart":l.context,R=Ee(k),D=ke(),$=de(),c=ue();o.useEffect(()=>{if(l.context==="cart")return;const a=p=>{const N=p.detail;Pe(N?.counts??{})};return window.addEventListener(Z.cartItemsUpdate,a),()=>window.removeEventListener(Z.cartItemsUpdate,a)},[l.context]);const w=l.context==="prod"&&$.useShopDetail===!1||l.context==="cart"&&$.useShopCart===!1,b=Fe($.accentColor??c?.accentColor??l.accentColor??"var(--free-ship-notify-accent, var(--unit-style-button_sb_background_color, var(--unit-style-brand_color, #15181E)))"),x=($.recommendationEnabled??c?.recommendationEnabled??l.recommendationEnabled)!==!1,V=l.context==="cart"&&D!==null,_=V?Math.max(0,D):Math.max(0,d-R),y=V?D+R:d,C=y>0?Math.min(100,R/y*100):0,B=_<=0,X=Ae(_,{currency:c?.currency??void 0,formatTemplate:c?.currencyFormatText??void 0,thousandChar:c?.thousandChar??void 0,decimalChar:c?.decimalChar??void 0,decimalCount:c?.decimalCount??void 0}),j="{amount}",K=$.guideMessage??c?.freeShippingText??l.guideMessage??void 0,T=(K||re("설명_n더주문하면무료배송",j)).split(j),F=re("타이틀_무료배송"),m=re("설명_지금구매하면n","%1").split("%1"),q=m[0]??"",M=m[1]??"",O=l.context==="cart"?c?.shopCartStyle?te({context:"cart",shopCartStyle:c.shopCartStyle}):null:c?.shopDetailStyle?te({context:"prod",shopDetailStyle:c.shopDetailStyle}):null,J=l.context==="cart"?"shop_cart":"shop_view",H=o.useRef(null),[S,g]=o.useState(!1),[G,U]=o.useState(!1),Y=o.useRef(!1),P=o.useRef(null);return P.current=O?{is_prod_upsell:S,component_type:O,page_type:J,free_shipping_threshold:y,remaining_amount:_}:null,o.useEffect(()=>{const a=H.current;if(!a||typeof IntersectionObserver>"u")return;const p=new IntersectionObserver(N=>{N[0]?.isIntersecting&&(U(!0),p.disconnect())});return p.observe(a),()=>p.disconnect()},[]),o.useEffect(()=>{Y.current||G&&P.current&&(Y.current=!0,$e(P.current))},[G,O]),o.useEffect(()=>{if(l.placement!=="modal")return;const a=window.IMWEB_SHOP_FREE_SHIP_NOTIFY_SDK;if(a?.setCloseTracker)return a.setCloseTracker(async()=>{const p=P.current;p&&await Be(p)}),()=>{a.setCloseTracker?.(null)}},[l.placement]),A(E.Column,{ref:H,gap:h.spacing[3],display:w?"none":"flex",children:[r(E,{children:B?A(ee,{children:[q&&r(W,{variant:"label-large",sx:{whiteSpace:"pre-wrap"},children:q}),r(W,{variant:"label-large-bold",sx:{color:b},children:F}),M&&r(W,{variant:"label-large",sx:{whiteSpace:"pre-wrap"},children:M})]}):r(ee,{children:T.flatMap((a,p)=>[a&&r(W,{variant:"label-large",sx:{whiteSpace:"pre-wrap"},children:a},`text-${p}`),p<T.length-1&&r(W,{variant:"label-large-bold",sx:{color:b},children:X},`price-${p}`)])})}),r(E,{width:"100%",height:"8px",position:"relative",overflow:"hidden",borderRadius:h.rounded.medium,background:h.semantic.color.surfaceSlateSecondary,children:r(E,{width:`${C}%`,height:"100%",position:"absolute",top:0,left:0,background:b,sx:{transition:"width 0.3s ease-in-out"}})}),x&&r(Ze,{accentColor:b,freeShippingThreshold:y,currentTotal:R,remainingAmount:_,onUpsellAvailabilityChange:a=>{g(a),u?.(a)}})]})}function pt({magnetShellData:t,onUpsellAvailabilityChange:u}){return r(Ie,{value:t,children:r(rt,{freeShippingThreshold:t.freeShippingThreshold,onUpsellAvailabilityChange:u})})}export{pt as F,rt as P};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.