import{T as B,A as M,a4 as I,D as t,B as a,j as e,a5 as S}from"./main-crazy-owls-work.js";import{$ as C}from"./useSocialTemplates-Dcb3t5jQ.js";import{u as O,a as w}from"./useMemoDebounce-BIwvA9Mb.js";import{u as A}from"./useUpdateSocialTemplates-BBEsnaqI.js";import{G as R}from"./GoogleBusinessProfilePreview-BZliv6yV.js";import{T as j,p as c}from"./TemplateDocLink-C5Om0X4f.js";import{I as G}from"./index-Bm9W7Nqt.js";import{M as N}from"./AiPromptConfigModal-BrZd34tw.js";import{s as x}from"./index-C903bx6G.js";import{C as i}from"./index-9x8aFyWV.js";import{F as n}from"./index-DLeF0Q26.js";import{S as u}from"./index-CV7ZrOqa.js";import{S as E}from"./index-Uj_IJMNj.js";import{C as h,R as k}from"./row-DAt4Bs0l.js";import"./PreviewCard-DAT49Z9x.js";import"./emotion-react.browser.esm-Y_LRzwGN.js";import"./index-B1hhaeCD.js";import"./index-DbMzUBXN.js";import"./AntIconWrapper-CV4oO3YH.js";import"./index-D66C40IV.js";import"./Input-DrlF5Epd.js";import"./EyeOutlined-BpDfhdMV.js";import"./context-DxDN2Q9A.js";import"./EllipsisOutlined-7nGPDvd9.js";import"./Dropdown-D0863Mnh.js";import"./move-ULSkkuK6.js";import"./mediaQueryUtil-BSyvLspT.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(l,s){return this.cache.has(l)?this.cache.get(l):(this.cache.set(l,s),s)}};const{Title:d}=B,D=[{label:"No Button",value:"none"},{label:"SIGN UP",value:"SIGN_UP"},{label:"LEARN MORE",value:"LEARN_MORE"},{label:"SHOP",value:"SHOP"},{label:"ORDER",value:"ORDER"},{label:"BOOK",value:"BOOK"}];function ge(){const{token:l}=M.useToken(),[s,f]=I(C),{isTemplatesUpdateSuccessfully:P,updateSocialTemplates:y}=A(),[b,T]=x.useMessage();O(async()=>{const{status:o}=await y(s);P&&o&&w(b,o)},400,[s]);const r=(o,p)=>{f(m=>S(m,g=>{o==="postingType"&&m.googleBusinessProfile.postingType==="isPromptImage"&&p!=="isPromptImage"&&(g.googleBusinessProfile.promptImage=""),g.googleBusinessProfile[o]=p}))},v=[{label:t("Only custom message"),value:"onlyMessage"},{label:t("Feature image"),value:"isFeaturedImage"},{label:t("Product Image"),value:"isProductImage"},{label:t("Prompt Image"),value:"isPromptImage"}];return a(k,{gutter:20,children:[T,e(h,{span:14,children:a(i,{size:"small",style:{backgroundColor:l.colorFillAlter},children:[a(d,{level:4,children:[" ",t("Google Business Profile Template Settings")," "]}),e(j,{platform:"Google Business Profile"}),a(i,{children:[e(i.Meta,{description:t("Custom message settings."),title:t("Custom Message")}),e("div",{children:e(N,{onChange:o=>r("content",o),rows:5,style:{minWidth:200},value:s.googleBusinessProfile.content})})]}),e(i,{style:{marginTop:10},children:a(n,{gap:20,justify:"space-between",children:[e(i.Meta,{description:t("Post styling and type setup."),title:t("Posting type")}),e("div",{children:e(u,{onChange:o=>r("postingType",o),options:v,style:{minWidth:200},value:s.googleBusinessProfile.postingType})})]})}),s.googleBusinessProfile.postingType==="isPromptImage"&&e(i,{style:{marginTop:10},children:a(n,{gap:20,justify:"space-between",children:[e(i.Meta,{description:t("Select an AI prompt for image generation."),title:t("Prompt Name")}),e("div",{children:e(G,{onChange:o=>r("promptImage",o),value:s.googleBusinessProfile.promptImage})})]})}),e(i,{style:{marginTop:10},children:a(n,{gap:20,justify:"space-between",children:[e(i.Meta,{description:t("Select a post link button."),title:t("Add a button")}),e("div",{children:e(u,{onChange:o=>r("button",o),options:D,style:{minWidth:200},value:s.googleBusinessProfile.button})})]})}),e(i,{style:{marginTop:10},children:a(n,{gap:20,justify:"space-between",children:[e(i.Meta,{description:`Google Business Profile restricts the length of a post to ${c.googleBusinessProfile.description.length} characters. If you enable this option, the first ${c.googleBusinessProfile.description.length} characters of your personalized message will be shared; if not, the limit prevents the post from being shared.`,title:t("Trim Message")}),e("div",{children:e(E,{checked:s.googleBusinessProfile.trimMessage,onChange:o=>r("trimMessage",o)})})]})})]})}),a(h,{span:10,children:[a(d,{level:5,children:[" ",t("Preview")," "]}),e(R,{message:s.googleBusinessProfile.content,type:s.googleBusinessProfile.postingType})]})]})}export{D as buttonOptions,ge as default};
