'use client';
import{jsx as e}from"react/jsx-runtime";import{useProduct as t,useEditorMode as r}from"@gem-sdk/core";import l from"../../../text/components/Text.js";import{useState as o,useEffect as n}from"react";let d=({setting:d,builderProps:i,styles:s})=>{let a=t(),m=r(),[c,u]=o(null),p=d?.label&&d.label.trim().length>0?`${d.label} ${a?.vendor??""}`:`${a?.vendor??""}`;return n(()=>{let e=localStorage.getItem("shopifyDomain");e&&u(e)},[]),e("div",{id:`vendor-${i?.uid}`,children:a?d?.url&&"edit"!==m?e("a",{href:`//${c}/collections/vendors?q=${a.vendor}`,target:`${"new-tab"===d.openIn?"_blank":"_self"}`,children:e(l,{builderProps:i,styles:s,setting:{...d,text:p,excludeFlex:!0}})}):e(l,{builderProps:i,styles:s,setting:{...d,text:p,excludeFlex:!0}}):null})};export{d as default};
