'use client';
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{usePageType as r,useShopStore as o,filterToolbarPreview as i}from"@gem-sdk/core";import{useMemo as n}from"react";let ArticleNotFound=({blogHandle:l,articlePickType:d,builderAttrs:p,children:a})=>{let c="STATIC"===r(),s=o(e=>e.storefrontToken),g=o(e=>e.storefrontUrl),m="latest"===d,h=n(()=>c&&!s?"We can not get your articles from Shopify":m?l?"Have you add articles to this blog? We couldn’t find any.":"Have you create blog in your store? We couldn’t find any.":"Have you added articles to your store? We couldn’t find any.",[c,s,m,l]),u=n(()=>m?l?"Add articles to blog":"Add blog to Shopify":"Add articles to Shopify",[m,l]),f=n(()=>{if(!g)return;let e=new URL(g);return m?`${e.protocol}//${e.host}/admin/blogs`:`${e.protocol}//${e.host}/admin/articles`},[m,g]);return e("div",{...p,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:[e("div",{className:"gp-flex gp-items-center gp-justify-center",children:[t("span",{className:"gp-mr-2",children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"21",height:"21",viewBox:"0 0 21 21",fill:"none",children:[t("g",{clipPath:"url(#clip0_9546_221079)",children:t("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"})}),t("defs",{children:t("clipPath",{id:"clip0_9546_221079",children:t("rect",{width:"20",height:"21",fill:"white",transform:"translate(0.5)"})})})]})}),t("span",{className:"gp-text-sm gp-font-normal gp-text-[#212121]",children:h})]}),c?t("div",{children:s?t("div",{onClick:()=>{f&&window.open(f,"_blank")},"aria-hidden":"true",className:"gp-cursor-pointer gp-text-sm gp-font-medium gp-text-[#3C67FF] gp-no-underline",children:u}):t("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:"Import from Shopify"})}):e("div",{className:"gp-text-sm gp-font-normal gp-text-[#212121]",children:[t("span",{"aria-hidden":!0,onClick:()=>{f&&window.open(f,"_blank")},className:"gp-cursor-pointer gp-font-medium gp-text-[#3C67FF] hover:gp-underline",children:u})," ","or pick another ",m?"blog":"article"]}),i(a,!0)]})};export{ArticleNotFound as default};
