'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("next/link"),t=require("@gem-sdk/core"),s=require("../../../link/common/helpers.js"),i=require("../../../text/components/Text.js"),d=require("@gem-sdk/system"),l=require("./common/helpers.js");exports.default=u=>{let{setting:o,builderProps:n}=u,{isPreviewSharePageMode:c}=t.useRenderMode(),a=t.useProduct(),p=c?`/products/${a?.handle}`:a?.handle?s.urlJoin("/products",a.handle):"#",m=a?.baseID?.replace("gid://shopify/Product/",""),x=t.useEditorMode(),h=()=>e.jsx(i.default,{...l.getTextProps(u,a?.title)}),j={href:p,title:a?.title},f=o?.linkProduct,q=d.createClass({"gp-product-title-link-wrapper":!0}),k=d.createAttr({id:`shopify-text-element-${n?.uid}`,...m&&{"data-product-id":m}});return e.jsx("div",{..."edit"===x&&k,children:d.Unless(!!a,"",d.If(f,e.jsx(r,{...j,className:q,children:h()}),h()))})};
