import{A as M,a4 as w,B as o,j as e,T as S,D as s,au as v,a5 as b}from"./main-crazy-owls-work.js";import{$ as I}from"./useSocialTemplates-Dcb3t5jQ.js";import{u as P,a as j}from"./useMemoDebounce-BIwvA9Mb.js";import{u as L}from"./useUpdateSocialTemplates-BBEsnaqI.js";import{L as A}from"./LinePreview-BJX8PZgy.js";import{T as x,p as h}from"./TemplateDocLink-C5Om0X4f.js";import{I as k}from"./index-Bm9W7Nqt.js";import{M as $}from"./AiPromptConfigModal-BrZd34tw.js";import{p as D}from"./optionsHelper-B_8X5Dll.js";import{s as F}from"./index-C903bx6G.js";import{R as N,C as g}from"./row-DAt4Bs0l.js";import{C as a}from"./index-9x8aFyWV.js";import{F as p}from"./index-DLeF0Q26.js";import{S as B}from"./index-CV7ZrOqa.js";import{S as R}from"./index-Uj_IJMNj.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"./mediaQueryUtil-BSyvLspT.js";import"./EllipsisOutlined-7nGPDvd9.js";import"./Dropdown-D0863Mnh.js";import"./move-ULSkkuK6.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,i){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,i),i)}};const{Title:d}=S;function he(){const{token:r}=M.useToken(),[i,f]=w(I),{isTemplatesUpdateSuccessfully:u,updateSocialTemplates:y}=L(),[T,C]=F.useMessage();P(async()=>{const{status:t}=await y(i);u&&t&&j(T,t)},400,[i]);const n=(t,m)=>{f(l=>b(l,c=>{t==="postingType"&&l.line.postingType==="isPromptImage"&&m!=="isPromptImage"&&(c.line.promptImage=""),c.line[t]=m}))};return o(a,{style:{backgroundColor:r.colorFillAlter},children:[C,o(N,{gutter:20,children:[o(g,{span:14,children:[o(d,{level:4,children:[s("Line Template Settings")," "]}),e(x,{platform:"Line"}),o(a,{children:[e(a.Meta,{description:s("Custom message settings."),title:s("Custom Message")}),e("div",{children:e($,{onChange:t=>n("content",t),rows:5,style:{minWidth:200},value:i.line.content,wordCount:h.line.content.length})})]}),e(a,{style:{marginTop:10},children:o(p,{gap:20,justify:"space-between",children:[e(a.Meta,{description:s("Post styling and type setup."),title:s("Posting type")}),e("div",{children:e(B,{onChange:t=>n("postingType",t),options:D,style:{minWidth:200},value:i.line.postingType})})]})}),i.line.postingType==="isPromptImage"&&e(a,{style:{marginTop:10},children:o(p,{gap:20,justify:"space-between",children:[e(a.Meta,{description:s("Select an AI prompt for image generation."),title:s("Prompt Name")}),e("div",{children:e(k,{onChange:t=>n("promptImage",t),value:i.line.promptImage})})]})}),e(a,{style:{marginTop:10},children:o(p,{gap:20,justify:"space-between",children:[e(a.Meta,{description:v(s("Line restricts the length of a post to %1$d characters. If you enable this option, the first %1$d characters of your personalized message will be shared; if not, the limit prevents the post from being shared"),h.line.content.length),title:s("Trim Message")}),e("div",{children:e(R,{checked:i.line.trimMessage,onChange:t=>n("trimMessage",t)})})]})})]}),o(g,{span:10,children:[o(d,{level:5,children:[" ",s("Preview")," "]}),e(A,{message:i.line.content,type:i.line.postingType})]})]})]})}export{he as default};
