'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),Text=require("../../text/components/Text.js"),React=require("react"),core=require("@gem-sdk/core");const ArticleDate=({setting:e,builderProps:t,styles:r})=>{let{dateFormat:i}=e??{},s=core.useArticleStore(e=>e.article),{timezone:l}=core.useTimezone(),n=(e,t)=>{let r=t?.split(" ")?.[1]??"";return r?new Date(new Date(e).toLocaleString("en-US",{timeZone:r})):e},o=React.useMemo(()=>{let e=n(new Date(s.publishedAt),l??""),{locales:t,options:r}=JSON.parse(i??'{"locales":"en-US","options":{"month":"short","day":"2-digit","year":"numeric"}}');return e.toLocaleDateString(t,r)},[s.publishedAt,l,i]);return jsxRuntime.jsx("div",{id:`shopify-text-element-${t?.uid}`,"data-article-id":s?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:jsxRuntime.jsx(Text.default,{builderProps:t,styles:r,setting:{...e,text:o,excludeFlex:!0},disableEdit:!0})})};exports.default=ArticleDate;
