PageSourceSearch

https://www.geocopy.io/_next/static/chunks/60615.d8f8e9ab4e1539ce.js

js geocopy.io collected 2026-10-04 23:45:42 UTC 49,658 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[60615],{32673:(e,t,a)=>{a.d(t,{bq:()=>p,eb:()=>g,gC:()=>x,l6:()=>c,s3:()=>m,yv:()=>u});var s=a(54568),r=a(7620),i=a(11494),n=a(27014),l=a(82155),o=a(44203),d=a(826);let c=i.bL,m=i.YJ,u=i.WT,p=r.forwardRef((e,t)=>{let{className:a,children:r,...l}=e;return(0,s.jsxs)(i.l9,{ref:t,className:(0,d.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...l,children:[r,(0,s.jsx)(i.In,{asChild:!0,children:(0,s.jsx)(n.a,{className:"h-4 w-4 opacity-50"})})]})});p.displayName=i.l9.displayName;let f=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.PP,{ref:t,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",a),...r,children:(0,s.jsx)(l.Z,{className:"h-4 w-4"})})});f.displayName=i.PP.displayName;let h=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.wn,{ref:t,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",a),...r,children:(0,s.jsx)(n.a,{className:"h-4 w-4"})})});h.displayName=i.wn.displayName;let x=r.forwardRef((e,t)=>{let{className:a,children:r,position:n="popper",...l}=e;return(0,s.jsx)(i.ZL,{children:(0,s.jsxs)(i.UC,{ref:t,className:(0,d.cn)("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:n,...l,children:[(0,s.jsx)(f,{}),(0,s.jsx)(i.LM,{className:(0,d.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,s.jsx)(h,{})]})})});x.displayName=i.UC.displayName,r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.JU,{ref:t,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...r})}).displayName=i.JU.displayName;let g=r.forwardRef((e,t)=>{let{className:a,children:r,...n}=e;return(0,s.jsxs)(i.q7,{ref:t,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...n,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(i.VF,{children:(0,s.jsx)(o.J,{className:"h-4 w-4"})})}),(0,s.jsx)(i.p4,{children:r})]})});g.displayName=i.q7.displayName,r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.wv,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",a),...r})}).displayName=i.wv.displayName},41626:(e,t,a)=>{a.d(t,{Separator:()=>l});var s=a(54568),r=a(7620),i=a(27996),n=a(826);let l=r.forwardRef((e,t)=>{let{className:a,orientation:r="horizontal",decorative:l=!0,...o}=e;return(0,s.jsx)(i.b,{ref:t,decorative:l,orientation:r,className:(0,n.cn)("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",a),...o})});l.displayName=i.b.displayName},53822:(e,t,a)=>{a.r(t),a.d(t,{default:()=>eR});var s=a(54568),r=a(7620),i=a(19664),n=a.n(i),l=a(826),o=a(73738),d=a(17928),c=a(39291),m=a(92345),u=a(63111),p=a(69885),f=a(94538),h=a(59939),x=a(6845);let g=["linkedin","x_thread","email","takeaways","faq_schema","substack_note"],b={linkedin:{id:"linkedin",title:"LinkedIn Post",description:"Professional insights with hooks and hashtags",tag:"LINKEDIN",maxTokens:1200,charLimit:3e3},x_thread:{id:"x_thread",title:"X Thread",description:"5-7 posts with a compelling narrative arc",tag:"X",maxTokens:1200}
1,email:{id:"email",title:"Email Blurb",description:"Newsletter-ready with subject line",tag:"EMAIL",maxTokens:900},takeaways:{id:"takeaways",title:"Key Takeaways",description:"5 actionable bullet points",tag:"GENERAL",maxTokens:1e3},faq_schema:{id:"faq_schema",title:"FAQ Schema",description:"JSON-LD for SEO rich snippets",tag:"SEO",maxTokens:2500},substack_note:{id:"substack_note",title:"Substack Note",description:"Short punchy note for Substack",tag:"SUBSTACK",maxTokens:400,charLimit:500}},j={id:"shorter",label:"Shorter",instruction:"Make it shorter while keeping the core message."},v={id:"more_data",label:"More data",instruction:"Add more specific data, statistics, or concrete examples."},N={id:"add_question",label:"Add question",instruction:"End with a compelling engagement question."},y={linkedin:[j,v,{id:"stronger_hook",label:"Stronger hook",instruction:"Rewrite the opening line to be more attention-grabbing for LinkedIn."},{id:"add_hashtags",label:"Add hashtags",instruction:"Add 3-5 relevant hashtags at the end, on their own line."},{id:"controversial",label:"More opinion",instruction:"Make the hook slightly more provocative and opinionated."},N],x_thread:[j,{id:"punchier_posts",label:"Punchier posts",instruction:"Tighten each post in the thread; keep one idea per post."},{id:"stronger_hook",label:"Stronger hook",instruction:"Rewrite post 1 to stop the scroll."},{id:"thread_cta",label:"End with CTA",instruction:"End the final post with a clear call to action or question."},v],email:[{id:"subject_line",label:"Better subject",instruction:"Improve the subject line for higher open rates; keep it under 60 characters."},j,v,{id:"clearer_cta",label:"Clearer CTA",instruction:"Make the call to action clearer and more specific."},{id:"scannable",label:"More scannable",instruction:"Use shorter paragraphs and bullets so the email is easy to skim."}],takeaways:[j,{id:"more_actionable",label:"More actionable",instruction:"Make each bullet start with a strong verb and a concrete next step."},v,{id:"add_metric",label:"Add metrics",instruction:"Where possible, add numbers or timeframes to bullets."}],faq_schema:[{id:"more_questions",label:"More Q&A",instruction:"Add 2-3 more question and answer pairs that match search intent."},{id:"shorter_answers",label:"Shorter answers",instruction:"Tighten each answer to 2-3 sentences while staying accurate."},{id:"more_specific",label:"More specific",instruction:"Make questions and answers more specific to the article topic."}],substack_note:[j,{id:"punchier_opener",label:"Punchier opener",instruction:"Rewrite the first line to be sharper and more conversational."},N,v]},w={linkedin:["bold","italic","bulletList","orderedList","heading2"],x_thread:["bold","italic","bulletList","orderedList"],email:["bold","italic","heading2","heading3","bulletList","orderedList"],takeaways:["bulletList","orderedList","bold"],faq_schema:[],substack_note:["bold","italic","bulletList","blockquote"]};var k=a(64715),C=a(95516),z=a(39175),_=a(10195),S=a(30652),R=a(89501),L=a(66233),T=a(41626),E=a(86506),A=a(90928),I=a(13973),q=a(36793),M=a(49248),P=a(84452),U=a(70741),O=a(88141),B=a(65967),H=a(6644),F=a(1034);let J=null;function V(e){return(!J&&(J=new H.A({headingStyle:"atx",codeBlockStyle:"fenced"})).use(F.Te),J).turndown(e||"")}function D(e){return e.trim()?e.split(/\n\n+/).map(e=>"<p>".concat(e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\n/g,"<br>"),"</p>")).join(""):"<p></p>"}function $(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{monospace:a=!1,streaming:s=!1}=t;if(a)return e.trim()?"<pre><code>".concat(e.replace(/&/g,"&amp;").replace(/</g,"&lt;"),"</code></pre>"):"<pre><code></code></pre>";if(s)return D(e);if(!e.trim())return"<p></p>";try{return(0,B.xx)(e)||"<p></p>"}catch(t){return D(e)}}function G(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{monospace:a=!1}=t;if(a){let t=e.match(/<pre[^>]*><code[^>]*>([\s\S]*?)<\/code><\/pre>/i);return t?t[1].replace(/&lt;/g,"<").replace(/&amp;/g,"&"):e.replace(/<[^>]+>/g,"").trim()}return V(e).trim()}function Z(e){let{feature:t,editor:a}=e;switch(t){case"bold":return(0,s.jsx)(L.l,{size:"sm",pressed:a.isActive("bold"),onPressedCh
1ange:()=>a.chain().focus().toggleBold().run(),className:"size-7",title:"Bold",children:(0,s.jsx)(E.U,{className:"size-3.5"})});case"italic":return(0,s.jsx)(L.l,{size:"sm",pressed:a.isActive("italic"),onPressedChange:()=>a.chain().focus().toggleItalic().run(),className:"size-7",title:"Italic",children:(0,s.jsx)(A.U,{className:"size-3.5"})});case"strike":return(0,s.jsx)(L.l,{size:"sm",pressed:a.isActive("strike"),onPressedChange:()=>a.chain().focus().toggleStrike().run(),className:"size-7",title:"Strikethrough",children:(0,s.jsx)(I.t,{className:"size-3.5"})});case"heading2":return(0,s.jsx)(L.l,{size:"sm",pressed:a.isActive("heading",{level:2}),onPressedChange:()=>a.chain().focus().toggleHeading({level:2}).run(),className:"size-7",title:"Heading",children:(0,s.jsx)(q.I,{className:"size-3.5"})});case"heading3":return(0,s.jsx)(L.l,{size:"sm",pressed:a.isActive("heading",{level:3}),onPressedChange:()=>a.chain().focus().toggleHeading({level:3}).run(),className:"size-7",title:"Subheading",children:(0,s.jsx)(M.U,{className:"size-3.5"})});case"bulletList":return(0,s.jsx)(L.l,{size:"sm",pressed:a.isActive("bulletList"),onPressedCh
1ange:()=>a.chain().focus().toggleBulletList().run(),className:"size-7",title:"Bullet list",children:(0,s.jsx)(P.c,{className:"size-3.5"})});case"orderedList":return(0,s.jsx)(L.l,{size:"sm",pressed:a.isActive("orderedList"),onPressedChange:()=>a.chain().focus().toggleOrderedList().run(),className:"size-7",title:"Numbered list",children:(0,s.jsx)(U.F,{className:"size-3.5"})});case"blockquote":return(0,s.jsx)(L.l,{size:"sm",pressed:a.isActive("blockquote"),onPressedChange:()=>a.chain().focus().toggleBlockquote().run(),className:"size-7",title:"Quote",children:(0,s.jsx)(O.C,{className:"size-3.5"})});default:return null}}function K(e){let{content:t,onChange:a,onBlurSave:i,placeholder:n="Content will appear here…",monospace:o=!1,streaming:d=!1,streamText:c="",className:m,readOnly:u=!1,format:p}=e,f=(0,r.useRef)(null),[h,x]=(0,r.useState)(!1),g=p?w[p]:["bold","italic","bulletList","orderedList"];(0,r.useEffect)(()=>{(0,z.Kd)().then(()=>x(!0))},[]);let b=(0,_.hG)({immediatelyRender:!1,editable:!u&&!d,extensions:[S.A.configure({heading:{levels:[2,3]},link:!1}),R.A.configure({placeholder:n})],content:$(t,{monospace:o,streaming:d}),editorProps:{attributes:{class:(0,l.cn)("prose prose-sm prose-neutral dark:prose-invert max-w-none focus:outline-none min-h-[12rem] px-4 py-3",o&&"font-mono text-xs text-foreground [&_pre]:m-0 [&_pre]:bg-transparent [&_pre]:p-0 [&_code]:block [&_code]:whitespace-pre-wrap [&_code]:break-words [&_code]:text-foreground [&_code]:bg-transparent")}},onUpdate:e=>{let{editor:t}=e,s=G(t.getHTML(),{monospace:o});a(s),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>null==i?void 0:i(s),800)},onBlur:e=>{let{editor:t}=e;null==i||i(G(t.getHTML(),{monospace:o}
1))}});if((0,r.useEffect)(()=>{b&&!d&&h&&t!==G(b.getHTML(),{monospace:o})&&b.commands.setContent($(t,{monospace:o,streaming:!1}),{emitUpdate:!1})},[t,b,h,o,d]),(0,r.useEffect)(()=>{b&&d&&b.commands.setContent($(c,{monospace:o,streaming:!0}),{emitUpdate:!1})},[b,c,d,o]),"faq_schema"===p){let e=d?c:t;return(0,s.jsxs)("div",{className:(0,l.cn)("flex min-h-0 flex-col overflow-hidden rounded-lg border border-border bg-muted/40",d&&"ring-2 ring-primary/30",m),children:[(0,s.jsx)("div",{className:"shrink-0 border-b border-border bg-muted/60 px-3 py-1.5",children:(0,s.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"JSON-LD"})}),(0,s.jsx)("textarea",{className:(0,l.cn)("min-h-[16rem] w-full flex-1 resize-y border-0 bg-muted/30 px-4 py-3 font-mono text-xs leading-relaxed text-foreground","placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0",(u||d)&&"cursor-default opacity-90"),value:e,readOnly:u||d,spellCheck:!1,placeholder:n,onChange:e=>{let t=e.target.value;a(t),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>null==i?void 0:i(t),800)},onBlur:e=>null==i?void 0:i(e.target.value)})]})}if(!b)return null;let j=!u&&!d&&g.length>0&&!o;return(0,s.jsxs)("div",{className:(0,l.cn)("flex min-h-0 flex-col rounded-lg border bg-background overflow-hidden",d&&"ring-2 ring-primary/30 shadow-[0_0_24px_-4px] shadow-primary/20",m),children:[j&&(0,s.jsx)("div",{className:"flex shrink-0 flex-wrap items-center gap-0.5 border-b px-2 py-1.5 bg-muted/30",children:g.map((e,t)=>{let a=t>0&&("bulletList"===e||"heading2"===e)&&"bulletList"!==g[t-1]&&"heading2"!==g[t-1];return(0,s.jsxs)("span",{className:"contents",children:[a&&(0,s.jsx)(T.Separator,{orientation:"vertical",className:"mx-0.5 h-5"}),(0,s.jsx)(Z,{feature:e,editor:b})]},e)})}),(0,s.jsxs)("div",{className:"relative min-h-0 flex-1 overflow-y-auto overscroll-contain",children:[d&&(0,s.jsx)("div",{className:"absolute inset-x-0 top-0 z-10 h-0.5 overflow-hidden bg-muted",children:(0,s.jsx)("div",{className:"h-full w-1/3 animate-[shimmer_1.2s_ease-in-out_infinite] bg-gradient-to-r from-transparent via-primary to-transparent"})}),(0,s.jsx)(_.$Z,{editor:b})]})]})}var Q=a(14267),W=a(5371),Y=a(40902),X=a(98597);function ee(e){var t;let{articleId:a,format:i,derivative:n,loading:o,streaming:d=!1,streamText:m="",onGenerated:u,onContentSaved:f,onRegenerate:h,onRegenerateFullRewrite:g,regenerateDisabled:j=!1}=e,v=b[i],[N,w]=(0,r.useState)(!1),[z,_]=(0,r.useState)(""),[S,R]=(0,r.useState)(!1),[L,T]=(0,r.useState)(null);(0,r.useEffect)(()=>{T(null)},[null==n?void 0:n.id,i]);let E=d?m:null!=(t=null!=L?L:null==n?void 0:n.content)?t:"",A="faq_schema"===i,I=(0,r.useCallback)(async()=>{if(E)try{await navigator.clipboard.writeText(E),p.oR.success("Copied to clipboard")}catch(e){p.oR.error("Could not copy")}},[E]),q=(0,r.useCallback)(async e=>{if(n&&!d)try{if(!(await fetch("/api/portal/articles/".concat(a,"/derivatives/content"),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({format:i,content:e})})).ok)throw Error("Save failed");null==f||f(e)}catch(e){}},[a,n,i,f,d]),M=(0,r.useCallback)(async e=>{if(e.trim()&&n){R(!0);try{var t;let s=await fetch("/api/portal/articles/".concat(a,"/derivatives/refine"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({format:i,instruction:e.trim(),baseVersion:n.version})}),r=await s.json();if(!s.ok)throw Error(null!=(t=r.error)?t:"Refine failed");T(r.content),u(r),_(""),w(!1),p.oR.success("Updated")}catch(e){p.oR.error(e instanceof Error?e.message:"Refine failed")}finally{R(!1)}}},[a,n,i,u]),P=E.length,U=y[i];return(0,s.jsxs)("div",{className:"flex h-full min-h-0 flex-1 flex-col gap-3",children:[(0,s.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:v.title}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:v.description})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-1.5",children:[n&&!d&&!o&&h&&(0,s.jsxs)(x.$,{type:"button",variant:"default",size:"sm",className:"h-8 gap-1.5 shadow-sm",disabled:j,onClick:h,children:[(0,s.jsx)(Q.P,{className:(0,l.cn)("size-3.5",j&&"animate-spin")}),"Regenerate from article"]}),n&&!d&&!o&&"faq_schema"===i&&g&&(0,s.jsx)(x.$,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5",disabled:j,onClick:g,children:"Full rewrite"}),n&&!d&&!o&&(0,s.jsxs)(C.AM,{open:N,onOpenChange:w,children:[(0,s.jsx)(C.Wv,{asChild:!0,children:(0,s.jsxs)(x.$,{variant:"outline",size:"sm",className:"gap-1.5 h-8",children:[(0,s.jsx)(W.a,{className:"size-3.5"}),"Refine"]})}),(0,s.jsxs)(C.hl,{className:"w-[min(100vw-2rem,22rem)] p-4",align:"end",children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-3",children:"What do you want to change?"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 mb-3",children:[(0,s.jsx)(k.T,{placeholder:"e.g. shorter, add stats, stronger hook…",value:z,rows:3,className:"min-h-[72px] resize-none text-sm",onKeyDown:e=>
1{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),M(z))},onChange:e=>_(e.target.value),disabled:S}),(0,s.jsx)(x.$,{size:"sm",className:"h-9 w-full",disabled:S||!z.trim(),onClick:()=>void M(z),children:S?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Y.N,{className:"size-3.5 animate-spin mr-1.5"}),"Applying…"]}):"Apply changes"})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:U.map(e=>(0,s.jsx)(x.$,{type:"button",variant:"secondary",size:"sm",className:"h-7 text-xs px-2.5",disabled:S,onClick:()=>void M(e.instruction),children:e.label},e.id))})]})]}),(0,s.jsxs)(x.$,{size:"sm",variant:"secondary",onClick:I,disabled:!E||o||d,className:"gap-1.5 h-8",children:[(0,s.jsx)(X.Q,{className:"size-3.5"}),"Copy"]})]})]}),!o||d||E?(0,s.jsx)(K,{content:E,format:i,streaming:d,streamText:m,monospace:A,readOnly:d,placeholder:"Your ".concat(v.title," will stream in here…"),onChange:T,onBlurSave:e=>{T(e),q(e)},className:"min-h-0 flex-1"}):(0,s.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 rounded-lg border border-dashed py-16",children:[(0,s.jsx)("div",{className:"relative",children:(0,s.jsx)(c.L,{className:"size-8 text-primary animate-pulse"})}),(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Generating ",v.title.toLowerCase(),"…"]})]}),(n||d)&&(0,s.jsxs)("p",{className:"shrink-0 text-[11px] text-muted-foreground tabular-nums",children:[P.toLocaleString()," characters",v.charLimit?" \xb7 ".concat(v.charLimit.toLocaleString()," max"):"",d&&(0,s.jsx)("span",{className:"ml-2 text-primary animate-pulse",children:"Writing…"})]}),"faq_schema"===i&&n&&!d&&(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"FAQ content must appear on the published page, not only in schema markup."})]})}var et=a(19590),ea=a(10825),es=a(91599),er=a(50819),ei=a(12529),en=a(36380);let el={linkedin:et.C,x_thread:ea.z,email:es.L,takeaways:P.c,faq_schema:er.C,substack_note:ei.L};async function eo(e,t){var a,s,r;let i=null==(a=e.body)?void 0:a.getReader();if(!i)throw Error("No response stream");let n=new TextDecoder,l="";for(;;){let{done:e,value:a}=await i.read();if(e)break;let o=(l+=n.decode(a,{stream:!0})).split("\n\n");for(let e of(l=null!=(s=o.pop())?s:"",o)){let a=e.trim();if(!a.startsWith("data:"))continue;let s=JSON.parse(a.replace(/^data:\s*/,""));if("delta"===s.type&&s.text&&t(s.text),"done"===s.type&&s.record)return s.record;if("error"===s.type)throw Error(null!=(r=s.message)?r:"Generation failed")}}throw Error("Stream ended without result")}function ed(e){var t;let{articleId:a,articleTitle:i}=e,[o,d]=(0,r.useState)([]),[m,u]=(0,r.useState)(null),[f,h]=(0,r.useState)(!1),[j,v]=(0,r.useState)(!1),[N,y]=(0,r.useState)(""),[w,k]=(0,r.useState)(!0),C=(0,r.useCallback)(async()=>{k(!0);try{var e;let t=await fetch("/api/portal/articles/".concat(a,"/derivatives")),s=await t.json();t.ok&&d(null!=(e=s.derivatives)?e:[])}catch(e){}finally{k(!1)}},[a]);(0,r.useEffect)(()=>{C()},[C]);let z=m&&null!=(t=o.find(e=>e.format===m))?t:null,_=(0,r.useCallback)(async(e,t)=>{v(!0),y(""),h(!0);try{let r=await fetch("/api/portal/articles/".concat(a,"/derivatives/stream"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({format:e,forceLlm:null!=t?t:"faq_schema"!==e&&void 0})});if(!r.ok){var s;let e=await r.json().catch(()=>({}));throw Error(null!=(s=e.error)?s:"Generation failed")}let i=await eo(r,e=>{y(t=>t+e)});d(t=>[...t.filter(t=>t.format!==e),i]),p.oR.success("".concat(b[e].title," ready"))}catch(t){p.oR.error(t instanceof Error?t.message:"Generation failed"),o.some(t=>t.format===e)||u(null)}finally{v(!1),h(!1)}},[a,o]),S=(0,r.useCallback)(e=>{u(e),o.find(t=>t.format===e)||_(e)},[o,_]),R=(0,r.useCallback)(()=>{m&&_(m,!0)},[m,_]);return(0,s.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Channel outputs"}),(0,s.jsxs)("h2",{className:"mt-1 text-lg font-semibold tracking-tight",children:["Repurpose “",i.length>48?"".concat(i.slice(0,48),"…"):i,"”"]}
1)]}),(0,s.jsx)(x.$,{asChild:!0,size:"sm",className:"h-9 gap-1.5 shadow-sm",children:(0,s.jsxs)(n(),{href:"/portal/integrations",children:["Publish to your site",(0,s.jsx)(en.F,{className:"size-3.5"})]})})]}),(0,s.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-sm border bg-card lg:flex-row lg:min-h-[480px]",children:[(0,s.jsx)("aside",{className:"shrink-0 border-b lg:w-52 lg:border-b-0 lg:border-r bg-muted/20",children:w?(0,s.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-muted-foreground",children:[(0,s.jsx)(Y.N,{className:"size-4 animate-spin"}),"Loading…"]}):(0,s.jsx)("ul",{className:"flex gap-1 overflow-x-auto p-2 lg:flex-col lg:overflow-visible lg:p-2",children:g.map(e=>{var t;let a=b[e],r=null!=(t=el[e])?t:P.c,i=o.some(t=>t.format===e),n=m===e,d=n&&(j||f);return(0,s.jsx)("li",{className:"shrink-0 lg:shrink",children:(0,s.jsxs)("button",{type:"button",onClick:()=>S(e),className:(0,l.cn)("relative flex w-full min-w-[130px] items-center gap-2 rounded-lg px-3 py-2.5 text-left transition-all lg:min-w-0",n?"bg-background shadow-sm ring-1 ring-primary/40":"hover:bg-background/60",d&&n&&"ring-primary/60"),children:[n&&(0,s.jsx)("span",{className:"absolute left-0 top-2 bottom-2 w-0.5 rounded-full bg-primary","aria-hidden":!0}),(0,s.jsx)(r,{className:(0,l.cn)("size-4 shrink-0",n?"text-primary":"text-muted-foreground")}),(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:(0,l.cn)("block text-sm font-medium leading-tight",n&&"text-foreground"),children:a.title}),i&&!d&&(0,s.jsx)("span",{className:"text-[10px] text-primary",children:"Ready"}),d&&(0,s.jsx)("span",{className:"text-[10px] text-primary animate-pulse",children:"Writing…"})]})]})},e)})})}),(0,s.jsx)("div",{className:"flex min-h-[360px] flex-1 flex-col overflow-hidden p-4 lg:p-5",children:m?(0,s.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,s.jsx)(ee,{articleId:a,format:m,derivative:z,loading:f&&!j&&!z,streaming:j,streamText:N,onGenerated:e=>{d(t=>[...t.filter(t=>t.format!==e.format),e])},onContentSaved:e=>{d(t=>t.map(t=>t.format===m?{...t,content:e}:t))},onRegenerate:R,onRegenerateFullRewrite:"faq_schema"===m?()=>void _("faq_schema",!0):void 0,regenerateDisabled:f||j})}):(0,s.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-6 text-center",children:[(0,s.jsx)("div",{className:"flex size-11 items-center justify-center rounded-full bg-muted",children:(0,s.jsx)(c.L,{className:"size-5 text-muted-foreground"})}),(0,s.jsxs)("div",{className:"max-w-sm space-y-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Pick a channel"}),(0,s.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"Each format opens a mini editor with the same tools as your article. Content streams in as it generates."})]})]})})]})]})}var ec=a(91926),em=a(38376),eu=a(43615),ep=a(29093),ef=a(54784),eh=a(2489),ex=a(32244),eg=a(32508),eb=a(34176),ej=a(84046),ev=a(46268);function eN(e){let{articleId:t,articleTitle:a,onCopyMarkdown:r,onPrint:i,onVersionHistory:l,onMoveToCampaign:o,trigger:d,embedContext:c}=e,m="".concat(window.location.origin,"/portal/articles/").concat(t,"/edit"),u=async()=>{try{await navigator.clipboard.writeText(m),p.oR.success("Link copied")}catch(e){p.oR.error("Could not copy link")}},f=(e,s,r)=>{let i=document.createElement("a");i.href="/api/portal/articles/".concat(t,"/export?format=").concat(e),i.download="".concat(a.slice(0,40).replace(/[^a-z0-9]+/gi,"-")||"article",".").concat(s),i.rel="noopener",document.body.appendChild(i),i.click(),i.remove(),p.oR.message("Downloading ".concat(s.toUpperCase(),"…"))};return(0,s.jsxs)(ec.rI,{children:[(0,s.jsx)(ec.ty,{asChild:!0,children:null!=d?d:(0,s.jsx)(x.$,{variant:"outline",size:"icon",className:"size-9",children:(0,s.jsx)(em.L,{className:"size-4"})})}),(0,s.jsxs)(ec.SQ,{align:"end",className:"w-56",children:[!c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ec.lp,{className:"text-[10px] text-muted-foreground font-normal uppercase tracking-wide",children:"Publish"}),(0,s.jsx)(ec._2,{asChild:!0,children:(0,s.jsxs)(n(),{href:"/portal/integrations",className:"flex items-center justify-between cursor-pointer",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)(eu.q,{className:"size-4"}),"Connect a site"]}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Setup →"})]})}),(0,s.jsx)(ec.mB,{})]}),(0,s.jsx)(ec.lp,{className:"text-[10px] text-muted-foreground font-normal uppercase tracking-wide",children:"Copy"}),(0,s.jsxs)(ec._2,{onClick:()=>void u(),children:[(0,s.jsx)(ep.N,{className:"size-4 mr-2"}),"Link"]}),(0,s.jsxs)(ec._2,{onClick:r,children:[(0,s.jsx)(ef.i,{className:"size-4 mr-2"}),"Markdown"]}),(0,s.jsx)(ec.mB,{}),(0,s.jsx)(ec.lp,{className:"text-[10px] text-muted-foreground font-normal uppercase tracking-wide",children:"Export"}),(0,s.jsxs)(ec._2,{onClick:()=>f("pdf","pdf","application/pdf"),children:[(0,s.jsx)(eh.o,{className:"size-4 mr-2"}),"PDF"]}),(0,s.jsxs)(ec._2,{onClick:()=>f("docx","docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),children:[(0,s.jsx)(ex.i,{className:"size-4 mr-2"}),"DOCX"]}),(0,s.jsxs)(ec._2,{onClick:()=>f("html","html","text/html"),children:[(0,s.jsx)(er.C,{className:"size-4 mr-2"}),"HTML"]}),(0,s.jsxs)(ec._2,{onClick:()=>f("md","md","text/markdown"),children:[(0,s.jsx)(P.c,{className:"size-4 mr-2"}),"Markdown"]}),(0,s.jsxs)(ec._2,{onClick:()=>f("images","zip","application/zip"),children:[(0,s.jsx)(eg._,{className:"size-4 mr-2","aria-hidden":!0}),"Images (.zip)"]}),(0,s.jsxs)(ec._2,{onClick:i,children:[(0,s.jsx)(eb.x,{className:"size-4 mr-2"}),"Print"]}),(0,s.jsx)(ec.mB,{}),(0,s.jsxs)(ec._2,{onClick:l,children:[(0,s.jsx)(ej.z,{className:"size-4 mr-2"}),"Version history"]}),(0,s.jsxs)(ec._2,{onClick:o,children:[(0,s.jsx)(ev.B,{className:"size-4 mr-2"}),"Move to campaign"]})]})]})}var ey=a(89150),ew=a(19298);function ek(e){let{articleId:t,open:a,onOpenChange:i,onRestore:n}=e,[l,o]=(0,r.useState)([]),[d,c]=(0,r.useState)(!1),[m,u]=(0,r.useState)(null),f=(0,r.useCallback)(async()=>{c(!0);try{var e;let a=await fetch("/api/portal/articles/".concat(t,"/versions")),s=await a.json();a.ok&&o(null!=(e=s.versions)?e:[])}finally{c(!1)}},[t]);(0,r.useEffect)(()=>{a&&f()},[a,f]);let h=async e=>{u(e);try{var a;let s=await fetch("/api/portal/articles/".concat(t,"/versions/").concat(e,"/restore"),{method:"POST"}),r=await s.json();if(!s.ok||!r.bodyHtml)throw Error(null!=(a=r.error)?a:"Restore failed");n(r.bodyHtml),p.oR.success("Version restored"),i(!1)}catch(e){p.oR.error(e instanceof Error?e.message:"Restore failed")}finally{u(null)}};return(0,s.jsx)(ey.cj,{open:a,onOpenChange:i,children:(0,s.jsxs)(ey.h,{className:"sm:max-w-md",children:[(0,s.jsxs)(ey.Fm,{children:[(0,s.jsxs)(ey.qp,{className:"flex items-center gap-2",children:[(0,s.jsx)(ej.z,{className:"size-4"}),"Version history"]}),(0,s.jsx)(ey.Qs,{children:"Snapshots created when you click Save in the editor."})]}),(0,s.jsx)("div",{className:"mt-6 space-y-2",children:d?(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground py-8",children:[(0,s.jsx)(Y.N,{className:"size-4 animate-spin"}),"Loading versions…"]}):0===l.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-8",children:"No versions yet. Use Save in the editor to create a snapshot."}):l.map(e=>{var t;return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-lg border px-3 py-2.5",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:null!=(t=e.label)?t:"Version ".concat(e.version)}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[new Date(e.createdAt).toLocaleStr
1ing(),null!=e.wordCount?" \xb7 ".concat(e.wordCount," words"):""]})]}),(0,s.jsxs)(x.$,{size:"sm",variant:"outline",className:"shrink-0 h-8 gap-1",disabled:m===e.id,onClick:()=>void h(e.id),children:[m===e.id?(0,s.jsx)(Y.N,{className:"size-3 animate-spin"}):(0,s.jsx)(ew.o,{className:"size-3"}),"Restore"]})]},e.id)})})]})})}var eC=a(58597),ez=a(32673);function e_(e){let{articleId:t,currentClusterId:a,open:i,onOpenChange:n,onAssigned:l}=e,[o,d]=(0,r.useState)([]),[c,m]=(0,r.useState)(null!=a?a:"none"),[u,f]=(0,r.useState)(!1),[h,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{i&&m(null!=a?a:"none")},[i,a]),(0,r.useEffect)(()=>{i&&(f(!0),fetch("/api/portal/research/campaigns?limit=100").then(e=>e.json()).then(e=>{var t;d(null!=(t=e.clusters)?t:[])}).catch(()=>d([])).finally(()=>f(!1)))},[i]);let b=(0,r.useCallback)(async()=>{g(!0);try{var e;let a="none"===c?null:c,s=await fetch("/api/portal/articles/".concat(t,"/cluster"),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({clusterId:a})}),r=await s.json();if(!s.ok)throw Error(null!=(e=r.error)?e:"Failed to assign campaign");p.oR.success(a?"Added to campaign":"Removed from campaign"),null==l||l(a),n(!1)}catch(e){p.oR.error(e instanceof Error?e.message:"Failed to assign")}finally{g(!1)}},[t,l,n,c]);return(0,s.jsx)(eC.lG,{open:i,onOpenChange:n,children:(0,s.jsxs)(eC.Cf,{className:"sm:max-w-md",children:[(0,s.jsxs)(eC.c7,{children:[(0,s.jsxs)(eC.L3,{className:"flex items-center gap-2",children:[(0,s.jsx)(ev.B,{className:"size-4"}),"Move to campaign"]}),(0,s.jsx)(eC.rr,{children:"Assign this article to a topic cluster (keyword campaign)."})]}),u?(0,s.jsxs)("div",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,s.jsx)(Y.N,{className:"size-4 animate-spin"}),"Loading campaigns…"]}):(0,s.jsxs)(ez.l6,{value:c,onValueChange:m,children:[(0,s.jsx)(ez.bq,{children:(0,s.jsx)(ez.yv,{placeholder:"Select campaign"})}),(0,s.jsxs)(ez.gC,{children:[(0,s.jsx)(ez.eb,{value:"none",children:"No campaign"}),o.map(e=>(0,s.jsx)(ez.eb,{value:e.id,children:e.name},e.id))]})]}),(0,s.jsxs)(eC.Es,{children:[(0,s.jsx)(x.$,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),(0,s.jsxs)(x.$,{onClick:()=>void b(),disabled:h||u,children:[h&&(0,s.jsx)(Y.N,{className:"size-4 animate-spin mr-2"}),"Save"]})]})]})})}let eS=[{id:"edit",label:"Edit",icon:o.I},{id:"preview",label:"Preview",icon:d.k},{id:"share",label:"Repurpose",icon:c.L}];function eR(e){var t;let[a,i]=(0,r.useState)("edit"),[o,d]=(0,r.useState)(e.initialHtml),[c,x]=(0,r.useState)(!1),[g,b]=(0,r.useState)(!1),[j,v]=(0,r.useState)(e.clusterId),[N,y]=(0,r.useState)(e.featuredImageUrl),[w,k]=(0,r.useState)(e.featuredImageAlt),C=(0,r.useRef)(null),z=(0,r.useCallback)(async()=>{try{let t="# ".concat(e.title,"\n\n").concat(V(o));await navigator.clipboard.writeText(t),p.oR.success("Markdown copied")}catch(e){p.oR.error("Could not copy markdown")}},[o,e.title]),_=(0,r.useCallback)(()=>{i("preview"),setTimeout(()=>window.print(),150)},[]),S=(0,r.useCallback)(e=>{var t;d(e),null==(t=C.current)||t.call(C,e)},[]),R="edit"===a||"share"===a,L=e.embedMode?"shopify"===e.embedCms?"h-[calc(100dvh-3rem)] max-h-[calc(100dvh-3rem)] overflow-hidden":"h-full max-h-full overflow-hidden":"h-[calc(100dvh-3rem)] max-h-[calc(100dvh-3rem)] overflow-hidden -mb-6 md:-mb-8";return(0,s.jsxs)("div",{className:(0,l.cn)("flex flex-col",R&&L),children:[(0,s.jsx)("header",{className:(0,l.cn)("z-30 mb-0 flex shrink-0 flex-col gap-2 bg-background pb-2 print:hidden",e.workspaceEmbedded&&"hidden",!e.workspaceEmbedded&&R?"bg-background":e.w
1orkspaceEmbedded?void 0:"sticky top-0 -mt-2 bg-background border-b border-border"),children:(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 pt-1",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.embedMode&&e.onBack?(0,s.jsxs)("button",{type:"button",onClick:e.onBack,className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,s.jsx)(m.n,{className:"size-3.5"}),"Articles"]}):(0,s.jsxs)(n(),{href:e.backHref,className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,s.jsx)(m.n,{className:"size-3.5"}),"Article"]}),(0,s.jsx)("span",{className:"text-muted-foreground/50 shrink-0","aria-hidden":!0,children:"/"}),(0,s.jsx)("h1",{className:"min-w-0 truncate text-sm font-medium leading-snug text-foreground",children:e.title})]}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,s.jsx)("nav",{className:"flex items-center gap-0.5","aria-label":"Editor mode",children:eS.map(e=>{let{id:t,label:r,icon:n}=e;return(0,s.jsxs)("button",{type:"button",onClick:()=>i(t),className:(0,l.cn)("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-all",a===t?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[(0,s.jsx)(n,{className:"size-3.5"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:r})]},t)})}),e.publishSlot?(0,s.jsx)("div",{className:"flex items-center gap-1.5 border-l pl-2",children:e.publishSlot}):null,(0,s.jsx)(eN,{articleId:e.articleId,articleTitle:e.title,embedContext:e.embedMode?null!=(t=e.embedCms)?t:"wordpress":void 0,onCopyMarkdown:()=>void z(),onPrint:_,onVersionHistory:()=>x(!0),onMoveToCampaign:()=>b(!0),trigger:(0,s.jsx)("button",{type:"button",className:"inline-flex size-8 items-center justify-center rounded-md border bg-background text-muted-foreground transition-colors hover:text-foreground","aria-label":"More actions",children:(0,s.jsx)(u.H,{className:"size-4"})})})]})]})}),(0,s.jsx)("div",{className:(0,l.cn)("edit"===a?"flex min-h-0 flex-1 flex-col overflow-hidden":"hidden print:block"),children:(0,s.jsx)(f.default,{...e,clusterId:j,featuredImageUrl:N,featuredImageAlt:w,initialInspectorTab:e.initialInspectorTab,onFeaturedImageUpdate:e=>{let{featuredImageUrl:t,featuredImageAlt:a}=e;y(t),k(a)},onHtmlChange:d,registerRestore:e=>{C.current=e},onManualSaveSnapshot:async(t,a)=>{await fetch("/api/portal/articles/".concat(e.articleId,"/versions"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({bodyHtml:t,wordCount:a,label:"Manual save"})})}})}),"preview"===a&&(0,s.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto pt-4 print:block",children:(0,s.jsx)(h.A,{html:o,featuredImageUrl:N,featuredImageAlt:w})}),"share"===a&&(0,s.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden pt-4 print:hidden",children:(0,s.jsx)(ed,{articleId:e.articleId,articleTitle:e.title})}),(0,s.jsx)(ek,{articleId:e.articleId,open:c,onOpenChange:x,onRestore:S}),(0,s.jsx)(e_,{articleId:e.articleId,currentClusterId:j,open:g,onOpenChange:b,onAssigned:v})]})}},58597:(e,t,a)=>{a.d(t,{Cf:()=>u,Es:()=>f,L3:()=>h,c7:()=>p,lG:()=>o,rr:()=>x,zM:()=>d});var s=a(54568),r=a(7620),i=a(33794),n=a(42255),l=a(826);let o=i.bL,d=i.l9,c=i.ZL;i.bm;let m=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.hJ,{ref:t,className:(0,l.cn)("fixed inset-0 z-50 bg-foreground
1/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...r})});m.displayName=i.hJ.displayName;let u=r.forwardRef((e,t)=>{let{className:a,children:r,...o}=e;return(0,s.jsxs)(c,{children:[(0,s.jsx)(m,{}),(0,s.jsxs)(i.UC,{ref:t,className:(0,l.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-parchment-md duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...o,children:[r,(0,s.jsxs)(i.bm,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-all duration-150 hover:opacity-100 hover:text-primary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,s.jsx)(n.X,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});u.displayName=i.UC.displayName;let p=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...a})};p.displayName="DialogHeader";let f=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};f.displayName="DialogFooter";let h=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.hE,{ref:t,className:(0,l.cn)("text-lg font-semibold font-serif leading-none tracking-tight",a),...r})});h.displayName=i.hE.displayName;let x=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.VY,{ref:t,className:(0,l.cn)("text-base font-serif italic text-muted-foreground",a),...r})});x.displayName=i.VY.displayName},59939:(e,t,a)=>{a.d(t,{A:()=>l});var s=a(54568),r=a(32536),i=a(826),n=a(75143);function l(e){let{html:t,featuredImageUrl:a,featuredImageAlt:l,className:o}=e;return(0,s.jsx)("div",{className:(0,i.cn)("flex flex-col gap-4",o),children:(0,s.jsxs)("article",{className:"min-h-[600px] overflow-hidden rounded-lg border bg-card",children:[a&&(0,s.jsx)("div",{className:"relative aspect-[2/1] w-full border-b bg-muted",children:(0,s.jsx)(r.default,{src:a,alt:(null==l?void 0:l.trim())||"Featured image",fill:!0,className:"object-cover",sizes:"(max-width: 768px) 100vw, 720px",unoptimized:!0,priority:!0})}),(0,s.jsx)("div",{className:(0,i.cn)(n.c,"px-8 py-6"),dangerouslySetInnerHTML:{__html:t}})]})})}},62737:(e,t,a)=>{a.d(t,{Tabs:()=>l,TabsContent:()=>c,TabsList:()=>o,TabsTrigger:()=>d});var s=a(54568),r=a(7620),i=a(20154),n=a(826);let l=i.bL,o=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.B8,{ref:t,className:(0,n.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",a),...r})});o.displayName=i.B8.displayName;let d=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.l9,{ref:t,className:(0,n.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium font-sans ring-offset-background transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-primary data-[state=active]:shadow-parchment",a),...r})});d.displayName=i.l9.displayName;let c=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.UC,{ref:t,className:(0,n.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),...r})});c.displayName=i.UC.displayName},64715:(e,t,a)=>{a.d(t,{T:()=>n});var s=a(54568),r=a(7620),i=a(826);let n=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("textarea",{className:(0,i.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...r})});n.displayName="Textarea"},66041:(e,t,a)=>{a.d(t,{Bc:()=>l,ZI:()=>c,k$:()=>d,m_:()=>o});var s=a(54568),r=a(7620),i=a(4325),n=a(826);let l=i.Kq,o=i.bL,d=i.l9,c=r.forwardRef((e,t)=>
1{let{className:a,sideOffset:r=4,...l}=e;return(0,s.jsx)(i.UC,{ref:t,sideOffset:r,className:(0,n.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",a),...l})});c.displayName=i.UC.displayName},75143:(e,t,a)=>{a.d(t,{c:()=>s,y:()=>r});let s="prose prose-neutral dark:prose-invert max-w-none prose-headings:font-bold prose-headings:tracking-tight prose-h1:text-2xl prose-h2:text-xl prose-h3:text-lg prose-p:leading-relaxed prose-li:leading-relaxed prose-a:text-primary prose-a:no-underline hover:prose-a:underline prose-table:w-full prose-table:border-collapse prose-th:border prose-th:border-border prose-th:bg-muted/50 prose-th:px-3 prose-th:py-2 prose-td:border prose-td:border-border prose-td:px-3 prose-td:py-2 prose-blockquote:border-l-4 prose-blockquote:border-border prose-blockquote:pl-4 prose-blockquote:italic prose-pre:bg-muted prose-pre:rounded-md prose-img:rounded-md prose-img:max-w-full",r="".concat(s," tiptap focus:outline-none min-h-[600px] py-6 pl-12 pr-8")},89150:(e,t,a)=>{a.d(t,{CG:()=>c,Fm:()=>h,Qs:()=>g,cj:()=>d,h:()=>f,qp:()=>x});var s=a(54568),r=a(7620),i=a(33794),n=a(54616),l=a(42255),o=a(826);let d=i.bL,c=i.l9;i.bm;let m=i.ZL,u=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.hJ,{className:(0,o.cn)("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...r,ref:t})});u.displayName=i.hJ.displayName;let p=(0,n.F)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),f=r.forwardRef((e,t)=>{let{side:a="right",className:r,children:n,...d}=e;return(0,s.jsxs)(m,{children:[(0,s.jsx)(u,{}),(0,s.jsxs)(i.UC,{ref:t,className:(0,o.cn)(p({side:a}),r),...d,children:[n,(0,s.jsxs)(i.bm,{className:"absolute right-4 top-4 roun
1ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,s.jsx)(l.X,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});f.displayName=i.UC.displayName;let h=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};h.displayName="SheetHeader";let x=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.hE,{ref:t,className:(0,o.cn)("text-lg font-semibold text-foreground",a),...r})});x.displayName=i.hE.displayName;let g=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.VY,{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",a),...r})});g.displayName=i.VY.displayName},91926:(e,t,a)=>{a.d(t,{SQ:()=>u,_2:()=>p,lp:()=>f,mB:()=>h,rI:()=>c,ty:()=>m});var s=a(54568),r=a(7620),i=a(36655),n=a(33345),l=a(44203),o=a(68456),d=a(826);let c=i.bL,m=i.l9;i.YJ,i.ZL,i.Pb,i.z6,r.forwardRef((e,t)=>{let{className:a,inset:r,children:l,...o}=e;return(0,s.jsxs)(i.ZP,{ref:t,className:(0,d.cn)("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",a),...o,children:[l,(0,s.jsx)(n.K,{className:"ml-auto"})]})}).displayName=i.ZP.displayName,r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.G5,{ref:t,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",a),...r})}).displayName=i.G5.displayName;let u=r.forwardRef((e,t)=>{let{className:a,sideOffset:r=4,...n}=e;return(0,s.jsx)(i.ZL,{children:(0,s.jsx)(i.UC,{ref:t,sideOffset:r,className:(0,d.cn)("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",a),...n})})});u.displayName=i.UC.displayName;let p=r.forwardRef((e,t)=>{let{className:a,inset:r,...n}=e;return(0,s.jsx)(i.q7,{ref:t,className:(0,d.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",a),...n})});p.displayName=i.q7.displayName,r.forwardRef((e,t)=>{let{className:a,children:r,checked:n,...o}=e;return(0,s.jsxs)(i.H_,{ref:t,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:n,...o,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(i.VF,{children:(0,s.jsx)(l.J,{className:"h-4 w-4"})})}),r]})}).displayName=i.H_.displayName,r.forwardRef((e,t)=>{let{className:a,children:r,...n}=e;return(0,s.jsxs)(i.hN,{ref:t,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...n,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(i.VF,{children:(0,s.jsx)(o.j,{className:"h-2 w-2 fill-current"})})}),r]})}).displayName=i.hN.displayName;let f=r.forwardRef((e,t)=>
1{let{className:a,inset:r,...n}=e;return(0,s.jsx)(i.JU,{ref:t,className:(0,d.cn)("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",a),...n})});f.displayName=i.JU.displayName;let h=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(i.wv,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",a),...r})});h.displayName=i.wv.displayName},92779:(e,t,a)=>{a.d(t,{p:()=>n});var s=a(54568),r=a(7620),i=a(826);let n=r.forwardRef((e,t)=>{let{className:a,type:r,...n}=e;return(0,s.jsx)("input",{type:r,className:(0,i.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base font-sans ring-offset-background placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:border-primary hover:border-primary/40 transition-all duration-150 ease-out disabled:cursor-not-allowed disabled:opacity-50 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground",a),ref:t,...n})});n.displayName="Input"},95516:(e,t,a)=>{a.d(t,{AM:()=>l,Wv:()=>o,hl:()=>d});var s=a(54568),r=a(7620),i=a(36915),n=a(826);let l=i.bL,o=i.l9,d=r.forwardRef((e,t)=>{let{className:a,align:r="center",sideOffset:l=4,...o}=e;return(0,s.jsx)(i.ZL,{children:(0,s.jsx)(i.UC,{ref:t,align:r,sideOffset:l,className:(0,n.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",a),...o})})});d.displayName=i.UC.displayName}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.