1import{_ as le}from"./CD_lHf65.js";import{_ as re}from"./D903bpXM.js";import{_ as ie}from"./BF5LdUv_.js";import{_ as de}from"./D85vAAFp.js";import{_ as ce}from"./CNfNPT-2.js";import{_ as ue}from"./xmPKV8jO.js";import{f as pe,j as he,N as ve,ac as fe,q as me,u as ge,O as xe,k as ye,n as A,H as M,J as be,r as v,$ as _e,al as we,o as r,c as d,d as z,l as t,a,ad as x,t as k,m as y,A as O,F as Q,G as U,B,e as N,K as Z,aH as W,y as ke,D as q,ag as Ce,ae as Se}from"./B7lTcWLE.js";const $e={class:"flex flex-col h-dvh overflow-hidden bg-white"},Le={class:"flex shrink-0 items-center px-4 sticky top-0 z-30 bg-white",style:{height:"52px","box-shadow":"0 1px 0 rgba(0,0,0,0.04)"}},Me={class:"px-4 py-2.5 border-b border-gray-100 shrink-0"},ze={class:"relative"},Be=["value"],Ne={class:"flex border-b border-gray-100 shrink-0"},Ie=["onClick"],Ee={class:"flex-1 overflow-hidden relative"},Pe={class:"absolute inset-0 overflow-y-auto pb-32"},Te={key:0,class:"flex flex-col items-center py-16 text-gray-400 text-[14px]"},je={key:1,class:"divide-y divide-gray-50"},Ae=["onClick"],Oe={class:"w-16 h-16 rounded-2xl overflow-hidden shrink-0 bg-gray-100",style:{border:"1px solid #F0F1F3"}},qe=["src","alt","onError"],Fe={class:"flex-1 min-w-0"},De={class:"text-[15px] font-bold text-gray-900 truncate"},He={key:0,class:"text-[13px] text-gray-400 mt-1 truncate"},Ve={key:0,class:"w-2 h-2 rounded-full bg-white"},Je={class:"absolute inset-0"},Ye={class:"fixed bottom-0 left-0 right-0 px-5 pt-4 bg-white",style:{"padding-bottom":"20px","box-shadow":"0 -4px 16px -8px rgba(0,0,0,0.10), 0 -1px 0 rgba(0,0,0,0.04)"}},Ge={class:"mb-3 flex items-center justify-center gap-1.5"},Re={class:"text-[12px] leading-[1.3] text-gray-500"},Ke=["disabled"],Qe={class:"truncate"},Ue={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round",class:"shrink-0 -mr-0.5"},st=pe({__name:"select-store",setup(Ze){const{isBrand:X,headNo:c,isApp:ee}=he(),{config:$,loadConfig:F,primaryColor:i}=ve(),{brandToken:te}=fe(),D=me(),g=v("list"),h=v(null),C=v([]),b=v(!0),H=ke(new Set);function ne(n){H.add(n)}const _=v(""),I=q(()=>{const n=_.value.trim().toLowerCase();return n?C.value.filter(e=>e.name.toLowerCase().includes(n)||(e.address??"").toLowerCase().includes(n)):C.value}),f=q(()=>C.value.find(n=>n.storeCd===h.value)??null);ge({title:q(()=>`${$.value?.appName??$.value?.name??"ë¸ëëì±"} - ê°ë§¹ì ì í`)}),xe({robots:"noindex, nofollow"});function V(){Ce()||history.pushState(null,"",location.href)}async function E(){if(c.value){b.value=!0;try{const n=await Se(c.value);if(C.value=n,n.length===1){G(n[0],!0);return}try{const e=localStorage.getItem(`wowple_brand_store_${c.value}`),p=(e?JSON.parse(e):null)?.storeCd??null;p&&n.some(s=>s.storeCd===p)&&(h.value=p)}catch{}b.value=!1}catch{b.value=!1}}}ye(async()=>{if(!X.value||!c.value){A("/brand");return}if(te.value){await F();const n=$.value?.userMngYn==="Y";try{const e=localStorage.getItem(`wowple_brand_store_${c.value}`),l=e?JSON.parse(e):null,p=l?.storeCd??null,s=l?.placeCd??null;n?A({path:"/brand/main",query:{headNo:c.value}}):p&&A({path:`/store/${p}`,query:{headNo:c.value,...s?{placeCd:s}:{}}})}catch{}if($.value?.userMngYn==="Y"||localStorage.getItem(`wowple_brand_store_${c.value}`))return}history.pushState(null,"",location.href),window.addEventListener("popstate",V),document.addEventListener("visibilitychange",J),await F(),await E()});function J(){ee.value||document.visibilityState==="visible"&&c.value&&E()}M(c,(n,e)=>{n&&n!==e&&(h.value=null,E())}),be(()=>{window.removeEventListener("popstate",V),document.removeEventListener("visibilitychange",J)});function Y(n){h.value=h.value===n?null:n}M(h,()=>{g.value==="map"&&u.value&&j(!1)}),M(_,()=>{g.value==="map"&&u.value&&j()});function G(n,e=!1){if(!c.value)return;const l=n.places??[],s=l.length>=2?null:l[0]?.placeCd??n.placeCd??null;localStorage.setItem(`wowple_brand_store_${c.value}`,JSON.stringify({storeCd:n.storeCd,placeCd:s,name:n.name,places:l,single:C.value.length===1}));const w={path:"/brand/login",query:{headNo:c.value,storeCd:n.storeCd,...s?{placeCd:s}:{}}};e?D.replace(w):D.push(w)}function oe(){f.value&&G(f.value)}const P=v(null),u=v(null),T=v([]);M([g,b],async([n,e])=>{n!=="map"||e||(await _e(),await new Promise(l=>requestAnimationFrame(()=>requestAnimationFrame(()=>l()))),u.value?window.naver?.maps?.Event?.trigger(u.value,"resize"):await ae())});async function ae(){if(P.value)try{const{$naverMaps:n}=we(),e=await n.load();u.value=new e.maps.Map(P.value,{center:new e.maps.LatLng(37.5665,126.978),zoom:12,zoomControl:!0,zoomControlOptions:{position:e.maps.Position.TOP_RIGHT}}),j()}catch(n){console.error("[BrandMap] ì´ê¸°í ì¤í¨:",n)}}function j(n=!0){const e=window.naver;if(!e?.maps||!u.value)return;T.value.forEach(s=>s.setMap(null)),T.value=[];const l=new e.maps.LatLngBounds;let p=!1;I.value.forEach(s=>{if(s.lat==null||s.lng==null)return;const w=new e.maps.LatLng(s.lat,s.lng);l.extend(w),p=!0;const m=h.value===s.storeCd,L=new e.maps.Marker({position:w,map:u.value,zIndex:m?10:1,icon:{content:`<div 2 onclick="event.stopPropagation();event.preventDefault();" 3 onmousedown="event.stopPropagation();" 4 ondblclick="event.stopPropagation();event.preventDefault();" 5 style="display:flex;flex-direction:column;align-items:center;transform:translate(-50%,-100%);cursor:pointer;" 6 > 7 <div style=" 8 background:${i.value}; 9 color:#fff; 10 border-radius:16px; 11 padding:${m?"6px 14px":"5px 12px"}; 12 font-size:${m?"14px":"13px"}; 13 font-weight:700; 14 white-space:nowrap; 15 box-shadow:0 3px 10px rgba(0,0,0,.3); 16 line-height:1.4;
17 border:${m?"2px solid #fff":"2px solid transparent"}; 18 outline:${m?"2px solid "+i.value:"none"}; 19 transform:${m?"scale(1.08)":"scale(1)"}; 20 ">${m?'<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" style="display:inline-block;vertical-align:-1px;margin-right:3px"><polyline points="20 6 9 17 4 12"></polyline></svg>':""}${s.name}</div> 21 <div style=" 22 width:0;height:0; 23 border-left:7px solid transparent; 24 border-right:7px solid transparent; 25 border-top:8px solid ${i.value}; 26 margin-top:-1px; 27 "></div> 28 </div>`,size:new e.maps.Size(10,10),origin:new e.maps.Point(0,0),anchor:new e.maps.Point(5,5)}});e.maps.Event.addListener(L,"click",()=>Y(s.storeCd)),T.value.push(L)}),p&&n&&u.value.fitBounds(l,{top:60,right:20,bottom:100,left:20})}const R=v(null),S=v(!1);function se(){navigator.geolocation&&(S.value=!0,navigator.geolocation.getCurrentPosition(({coords:n})=>{S.value=!1;const e=window.naver;if(!e?.maps||!u.value)return;const l=new e.maps.LatLng(n.latitude,n.longitude);R.value?.setMap(null),R.value=new e.maps.Marker({position:l,map:u.value,icon:{content:`<div style=" 29 width:16px;height:16px; 30 background:#2563eb; 31 border:3px solid #fff; 32 border-radius:50%; 33 box-shadow:0 0 0 4px rgba(37,99,235,.25); 34 "></div>`,size:new e.maps.Size(16,16),anchor:new e.maps.Point(8,8)},zIndex:10}),u.value.setCenter(l),u.value.setZoom(14)},()=>{S.value=!1},{enableHighAccuracy:!0,timeout:8e3}))}return(n,e)=>{const l=le,p=re,s=ie,w=de,m=ce,L=ue;return r(),d("div",$e,[z(l,{show:t(b),accent:t(i)},null,8,["show","accent"]),a("header",Le,[e[2]||(e[2]=a("h1",{class:"flex-1 text-[17px] font-bold text-gray-900"},"ê°ë§¹ì ì í",-1)),t(f)?(r(),d("span",{key:0,class:"text-[13px] font-semibold truncate max-w-[130px]",style:x({color:t(i)})},k(t(f).name),5)):y("",!0)]),a("div",Me,[a("div",ze,[z(p,{width:"16",height:"16",class:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none","aria-hidden":"true"}),a("input",{"aria-label":"ê°ë§¹ì ëª ëë 주ì ê²ì",value:t(_),type:"text",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",enterkeyhint:"search",placeholder:"ê°ë§¹ì ëª ëë 주ì ê²ì",class:"w-full pl-9 pr-9 py-2.5 bg-gray-100 rounded-xl text-[15px] text-gray-900 placeholder:text-gray-400 outline-none transition-colors focus:bg-gray-50",onInput:e[0]||(e[0]=o=>_.value=o.target.value)},null,40,Be),t(_).length>0?(r(),O(s,{key:0,class:"absolute",style:{right:"10px",top:"50%","margin-top":"-10px"},onClick:e[1]||(e[1]=o=>_.value="")})):y("",!0)])]),a("div",Ne,[(r(),d(Q,null,U([{id:"list",label:"ê°ë§¹ì 목ë¡"},{id:"map",label:"ê°ë§¹ì ìì¹"}],o=>a("button",{key:o.id,type:"button",class:B(["flex-1 py-3 text-[14px] font-semibold transition-colors relative",t(g)===o.id?"text-gray-900":"text-gray-400"]),onClick:K=>g.value=o.id},[N(k(o.label)+" ",1),t(g)===o.id?(r(),d("div",{key:0,class:"absolute bottom-0 left-4 right-4 h-[2.5px] rounded-full",style:x({backgroundColor:t(i)})},null,4)):y("",!0)],10,Ie)),64))]),a("div",Ee,[Z(a("div",Pe,[!t(b)&&t(I).length===0?(r(),d("div",Te,[z(p,{width:"32",height:"32",class:"mb-3 text-gray-200","aria-hidden":"true"}),N(" "+k(t(_)?"ê²ì ê²°ê³¼ê° ììµëë¤.":"ë±ë¡ë ê°ë§¹ì ì´ ììµëë¤."),1)])):t(b)?y("",!0):(r(),d("ul",je,[(r(!0),d(Q,null,U(t(I),o=>(r(),d("li",{key:o.storeCd,class:B(["flex items-center gap-3.5 px-4 py-4 cursor-pointer transition-colors",t(h)===o.storeCd?"bg-gray-50":"hover:bg-gray-50"]),onClick:K=>Y(o.storeCd)},[a("div",Oe,[o.thumbnail&&!t(H).has(o.storeCd)?(r(),d("img",{key:0,src:o.thumbnail,alt:o.name,class:"w-full h-full object-cover",loading:"lazy",onError:K=>ne(o.storeCd)},null,40,qe)):(r(),d("div",{key:1,class:"w-full h-full flex items-center justify-center",style:x({backgroundColor:t(i)+"14"})},[z(w,{width:"26",height:"26",style:x({color:t(i)}),"aria-hidden":"true"},null,8,["style"])],4))]),a("div",Fe,[a("p",De,k(o.name),1),o.address?(r(),d("p",He,k(o.address),1)):y("",!0)]),a("div",{class:B(["w-5 h-5 rounded-full border-2 shrink-0 flex items-center justify-center transition-all",t(h)===o.storeCd?"border-transparent":"border-gray-300"]),style:x(t(h)===o.storeCd?{backgroundColor:t(i)}:{})},[t(h)===o.storeCd?(r(),d("div",Ve)):y("",!0)],6)],10,Ae))),128))]))],512),[[W,t(g)==="list"]]),Z(a("div",Je,[a("div",{ref_key:"mapContainer",ref:P,style:{width:"100%",height:"100%","min-height":"200px"}}
34,null,512),t(u)?(r(),d("button",{key:0,type:"button",class:B(["absolute bottom-32 right-3 z-10 w-10 h-10 rounded-full bg-white shadow-lg flex items-center justify-center transition-all active:scale-95",t(S)?"opacity-60":"hover:shadow-xl"]),"aria-label":"íìì¹",onClick:se},[t(S)?(r(),O(m,{key:0,width:"18",height:"18",class:"animate-spin text-gray-400","aria-hidden":"true"})):(r(),O(L,{key:1,width:"18",height:"18",class:"text-blue-500","aria-hidden":"true"}))],2)):y("",!0)],512),[[W,t(g)==="map"]])]),a("div",Ye,[a("div",Ge,[a("span",{class:"inline-block rounded-full shrink-0",style:x([{width:"5px",height:"5px"},{background:t(i)}])},null,4),a("p",Re,[e[3]||(e[3]=N(" ì´ì© ë§¤ì¥ ë³ ",-1)),a("span",{style:x({color:t(i)}),class:"font-bold"},"ë³ë íìê°ì
",4),e[4]||(e[4]=N("ì´ íìí©ëë¤. ",-1))])]),a("button",{type:"button",class:"w-full h-[54px] rounded-2xl text-white text-[15px] font-bold transition-all active:scale-[0.985] flex items-center justify-center gap-1.5 disabled:cursor-not-allowed",style:x(t(f)?{backgroundImage:`linear-gradient(135deg, ${t(i)} 0%, ${t(i)}E0 100%)`,boxShadow:`0 8px 22px -8px ${t(i)}80, 0 2px 4px -2px ${t(i)}40`}:{backgroundColor:t(i),opacity:.5}),disabled:!t(f),onClick:oe},[a("span",Qe,k(t(f)?`${t(f).name} ì íí기`:"ê°ë§¹ì ì ì íí´ ì£¼ì¸ì"),1),t(f)?(r(),d("svg",Ue,[...e[5]||(e[5]=[a("path",{d:"M5 12h14M13 5l7 7-7 7"},null,-1)])])):y("",!0)],12,Ke)])])}}});export{st as default};
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.