'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),React=require("react");const ArticleNotFound=({blogHandle:e,articlePickType:t,builderAttrs:r,children:o})=>{let i="STATIC"===core.usePageType(),n=core.useShopStore(e=>e.storefrontToken),s=core.useShopStore(e=>e.storefrontUrl),l="latest"===t,{t:d}=core.useI18nStore(),c=React.useMemo(()=>i&&!n?d("We can not get your articles from Shopify"):l?e?d("Have you add articles to this blog? We couldn’t find any."):d("Have you create blog in your store? We couldn’t find any."):d("Have you added articles to your store? We couldn’t find any."),[i,n,l,e]),a=React.useMemo(()=>l?e?d("Add articles to blog"):d("Add blog to Shopify"):d("Add articles to Shopify"),[l,e]),p=React.useMemo(()=>{if(!s)return;let e=new URL(s);return l?`${e.protocol}//${e.host}/admin/blogs`:`${e.protocol}//${e.host}/admin/articles`},[l,s]);return jsxRuntime.jsxs("div",{...r,className:"gp-relative gp-flex gp-h-[98px] gp-flex-col gp-items-center gp-justify-center gp-rounded gp-border-dotted gp-border-[#676767] gp-border",children:[jsxRuntime.jsxs("div",{className:"gp-flex gp-items-center gp-justify-center",children:[jsxRuntime.jsx("span",{className:"gp-mr-2",children:jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 21 21",fill:"none",children:[jsxRuntime.jsx("g",{clipPath:"url(#clip0_9546_221079)",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5728 3.86863C11.0976 3.04379 9.90241 3.04379 9.4272 3.86863L1.91575 16.9064C1.44289 17.7271 2.0381 18.75 2.98855 18.75H18.0114C18.9619 18.75 19.5571 17.7271 19.0842 16.9064L11.5728 3.86863ZM10.5 6.43064C10.8452 6.43064 11.125 6.7092 11.125 7.05282V12.6524C11.125 12.996 10.8452 13.2746 10.5 13.2746C10.1548 13.2746 9.875 12.996 9.875 12.6524V7.05282C9.875 6.7092 10.1548 6.43064 10.5 6.43064ZM10.5 14.7678C9.94771 14.7678 9.5 15.2135 9.5 15.7633C9.5 16.3131 9.94771 16.7588 10.5 16.7588C11.0523 16.7588 11.5 16.3131 11.5 15.7633C11.5 15.2135 11.0523 14.7678 10.5 14.7678Z",fill:"#494949"})}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_9546_221079",children:jsxRuntime.jsx("rect",{width:"20",height:"21",fill:"white",transform:"translate(0.5)"})})})]})}),jsxRuntime.jsx("span",{className:"gp-text-sm gp-font-normal gp-text-[#212121]",children:c})]}),i?jsxRuntime.jsx("div",{children:n?jsxRuntime.jsx("div",{onClick:()=>{p&&window.open(p,"_blank")},"aria-hidden":"true",className:"gp-cursor-pointer gp-text-sm gp-font-medium gp-text-[#3C67FF] gp-no-underline",children:a}):jsxRuntime.jsx("div",{onClick:()=>{window.parent.postMessage("toggleImportProductModal")},"aria-hidden":"true",className:"gp-cursor-pointer gp-text-sm gp-font-medium gp-text-[#3C67FF] gp-no-underline",children:d("Import from Shopify")})}):jsxRuntime.jsxs("div",{className:"gp-text-sm gp-font-normal gp-text-[#212121]",children:[jsxRuntime.jsx("span",{"aria-hidden":!0,onClick:()=>{p&&window.open(p,"_blank")},className:"gp-cursor-pointer gp-font-medium gp-text-[#3C67FF] hover:gp-underline",children:a})," ",l?d("or pick another blog"):d("or pick another article")]}),core.filterToolbarPreview(o,!0)]})};exports.default=ArticleNotFound;
