"use strict";var core=require("@gem-sdk/core"),helpers=require("../../link/common/helpers.js"),React=require("react");const useArticleLink=()=>{let e=core.useArticleStore(e=>e.article),r=core.useShopStore(e=>e.storefrontUrl),{isPreviewSharePageMode:t}=core.useRenderMode(),o=e?.handle?helpers.urlJoin("blogs",e?.blog?.handle??"",e.handle):"#",l=React.useMemo(()=>{if(t)return`/articles/${e?.handle}`;if(!r)return"#";let l=new URL(r);return e?`${l.protocol}//${l.host}/${o}`:"#"},[r,e,o,t]);return{shopifyArticleLink:l}};exports.useArticleLink=useArticleLink;
