1import{r as x,j as e,eA as z,L as y,eQ as _,eR as B,i as H,eS as F,eT as I,eU as E,v as $,ej as D}from"./main-Bo0oayNO.js";import{P as R,C as U}from"./PageLayout-BjI6KKxV.js";import{f as C}from"./ui-utils-CNoARbDA.js";function q({source:s="sidebar",compact:t=!1}){const[a,d]=x.useState(""),[l,n]=x.useState(""),[u,r]=x.useState("idle"),[i,c]=x.useState(""),m=async h=>{if(h.preventDefault(),!a.trim()){r("error"),c("Please enter your email address");return}r("loading"),c("");try{const o=await z({data:{email:a,name:l||void 0,source:s}});o.success?(r("success"),c(o.message||"Please check your email to confirm your subscription"),d(""),n("")):(r("error"),c(o.error||"Something went wrong. Please try again."))}catch{r("error"),c("Something went wrong. Please try again.")}};return u==="success"?e.jsx("div",{className:`bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4 ${t?"":"p-6"}`,children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("svg",{className:"w-5 h-5 text-green-500 mr-2 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),e.jsx("p",{className:"text-green-700 dark:text-green-300 text-sm",children:i})]})}):t?e.jsxs("form",{onSubmit:m,className:"space-y-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"email",value:a,onChange:h=>d(h.target.value),placeholder:"Your email",className:"flex-1 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 text-sm focus:ring-2 focus:ring-primary-500 focus:border-primary-500",disabled:u==="loading"}),e.jsx("button",{type:"submit",disabled:u==="loading",className:"px-4 py-2 bg-primary-600 hover:bg-primary-700 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50",children:u==="loading"?"...":"Subscribe"})]}),u==="error"&&e.jsx("p",{className:"text-red-600 dark:text-red-400 text-xs",children:i})]}):e.jsxs("div",{className:"bg-linear-to-br from-primary-50 to-primary-100 dark:from-primary-900/20 dark:to-primary-800/20 border border-primary-200 dark:border-primary-700 rounded-lg p-6",children:[e.jsxs("div",{className:"flex items-center mb-3",children:[e.jsx("svg",{className:"w-6 h-6 text-primary-600 dark:text-primary-400 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Subscribe to Newsletter"})]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-300 text-sm mb-4",children:"Get the latest posts delivered right to your inbox."}),e.jsxs("form",{onSubmit:m,className:"space-y-3",children:[e.jsx("input",{type:"text",value:l,onChange:h=>n(h.target.value),placeholder:"Your name (optional)",className:"w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:ring-2 focus:ring-primary-500 focus:border-primary-500",disabled:u==="loading"}),e.jsx("input",{type:"email",value:a,onChange:h=>d(h.target.value),placeholder:"Your email address",required:!0,className:"w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:ring-2 focus:ring-primary-500 focus:border-primary-500",disabled:u==="loading"}),e.jsx("button",{type:"submit",disabled:u==="loading",className:"w-full px-4 py-2 bg-primary-600 hover:bg-primary-700 text-white font-medium rounded-lg transition-colors disabled:opacity-50",children:u==="loading"?"Subscribing...":"Subscribe"}),u==="error"&&e.jsx("p",{className:"text-red-600 dark:text-red-400 text-sm",children:i}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-xs text-center",children:"We respect your privacy. Unsubscribe at any time."})]})]})}function J({title:s="Search",placeholder:t="Search posts...",searchQuery:a="",onSearch:d}){const[l,n]=x.useState(a),u=r=>{r.preventDefault(),d&&d(l.trim())};return e.jsx(g,{title:s,children:e.jsxs("form",{className:"relative",onSubmit:u,children:[e.jsx("input",{type:"text",placeholder:t,value:l,onCh
1ange:r=>n(r.target.value),className:"w-full px-4 py-2 pl-10 pr-10 border border-border rounded-theme bg-background text-foreground placeholder:text-foreground-muted focus:outline-hidden focus:ring-2 focus:ring-primary/20 focus:border-primary"}),e.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-foreground-muted pointer-events-none",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),e.jsx("button",{type:"submit","aria-label":"Search",className:"absolute right-2 top-1/2 -translate-y-1/2 px-2 py-1 text-sm text-foreground-muted hover:text-foreground cursor-pointer",children:"Go"})]})})}function O({title:s="Recent Posts",count:t=5,showDate:a=!0}){const[d,l]=x.useState([]),[n,u]=x.useState(!0);return x.useEffect(()=>{async function r(){try{const i=await _({data:{count:t}});l(i)}catch(i){console.error("Failed to load recent posts:",i)}finally{u(!1)}}r()},[t]),n?e.jsx(g,{title:s,children:e.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((r,i)=>e.jsxs("div",{className:"animate-pulse flex gap-3",children:[e.jsx("div",{className:"w-16 h-12 bg-gray-200 rounded-sm shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-4 bg-gray-200 rounded-sm w-3/4 mb-1"}),e.jsx("div",{className:"h-3 bg-gray-100 rounded-sm w-1/4"})]})]},i))})}):d.length===0?e.jsx(g,{title:s,children:e.jsx("p",{className:"text-foreground-muted text-sm",children:"No posts yet."})}):e.jsx(g,{title:s,children:e.jsx("ul",{className:"space-y-3",children:d.map(r=>e.jsx("li",{children:e.jsxs(y,{to:"/posts/$slug",params:{slug:r.slug},className:"flex gap-3 group",children:[r.featuredImageUrl&&e.jsx("img",{src:r.featuredImageUrl,alt:r.title,className:"w-16 h-12 object-cover rounded-sm shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-sm text-foreground group-hover:text-primary transition-colors line-clamp-2 block",children:r.title}),a&&r.publishedAt&&e.jsx("span",{className:"text-xs text-foreground-muted",children:C(r.publishedAt)})]})]})},r.id))})})}function V({title:s="Categories",categories:t=[],activeCategory:a,showCount:d=!1,maxVisible:l=8}){const[n,u]=x.useState(""),[r,i]=x.useState(!1),c=x.useMemo(()=>{if(!n.trim())return t;const b=n.toLowerCase();return t.filter(j=>j.name.toLowerCase().includes(b))},[t,n]),m=r?c:c.slice(0,l),h=c.length>l,o=c.length-l,p=t.length>l;return t.length===0?e.jsx(g,{title:s,children:e.jsx("p",{className:"text-foreground-muted text-sm",children:"No categories yet."})}):e.jsxs(g,{title:s,children:[p&&e.jsxs("div",{className:"relative mb-3",children:[e.jsx("input",{type:"text",value:n,onChange:b=>{u(b.target.value),b.target.value&&!r&&i(!0)},placeholder:"Search categories...",className:"w-full px-3 py-1.5 pr-8 text-sm border border-border rounded-theme bg-background text-foreground placeholder-foreground-muted focus:ring-1 focus:ring-primary focus:border-primary"}),n&&e.jsx("button",{type:"button",onClick:()=>u(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-foreground-muted hover:text-foreground",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("ul",{className:"space-y-2",children:m.map(b=>e.jsx("li",{children:e.jsx(y,{to:"/posts",search:{page:void 0,category:b.slug,tag:void 0,q:void 0},className:`block text-sm transition-colors ${a===b.slug?"text-primary font-medium":"text-foreground-muted hover:text-primary"}`,children:b.name})},b.id))}),c.length===0&&n&&e.jsx("p",{className:"text-sm text-foreground-muted py-2",children:"No matches found"}),h&&!n&&e.jsx("button",{type:"button",onClick:()=>i(!r),className:"mt-3 text-sm text-primary hover:text-primary-dark font-medium flex items-center gap-1",children:r?e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})}),"Show less"]}):e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),"Show ",o," more"]})})]})}function Y({title:s="Tags",tags:t=[],activeTag:a,maxTags:d=50,maxVisible:l=12}){const[n,u]=x.useState(""),[r,i]=x.useState(!1),c=t.slice(0,d),m=x.useMemo(()=>
1{if(!n.trim())return c;const j=n.toLowerCase();return c.filter(f=>f.name.toLowerCase().includes(j))},[c,n]),h=r?m:m.slice(0,l),o=m.length>l,p=m.length-l,b=c.length>l;return c.length===0?e.jsx(g,{title:s,children:e.jsx("p",{className:"text-foreground-muted text-sm",children:"No tags yet."})}):e.jsxs(g,{title:s,children:[b&&e.jsxs("div",{className:"relative mb-3",children:[e.jsx("input",{type:"text",value:n,onChange:j=>{u(j.target.value),j.target.value&&!r&&i(!0)},placeholder:"Search tags...",className:"w-full px-3 py-1.5 pr-8 text-sm border border-border rounded-theme bg-background text-foreground placeholder-foreground-muted focus:ring-1 focus:ring-primary focus:border-primary"}),n&&e.jsx("button",{type:"button",onClick:()=>u(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-foreground-muted hover:text-foreground",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:h.map(j=>e.jsxs(y,{to:"/posts",search:{page:void 0,category:void 0,tag:j.slug,q:void 0},className:`px-3 py-1 text-sm rounded-full transition-colors ${a===j.slug?"bg-primary text-white":"bg-background-alt text-foreground-muted hover:bg-primary/10 hover:text-primary"}`,children:["#",j.name]},j.id))}),m.length===0&&n&&e.jsx("p",{className:"text-sm text-foreground-muted py-2",children:"No matches found"}),o&&!n&&e.jsx("button",{type:"button",onClick:()=>i(!r),className:"mt-3 text-sm text-primary hover:text-primary-dark font-medium flex items-center gap-1",children:r?e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})}),"Show less"]}):e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),"Show ",p," more"]})})]})}function G({title:s="Newsletter",description:t="Subscribe to get the latest posts delivered to your inbox."}){const[a,d]=x.useState(""),[l,n]=x.useState("idle"),[u,r]=x.useState(""),i=async c=>{if(c.preventDefault(),!!a.trim()){n("loading");try{const m=await fetch("/api/newsletter/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:a})});if(m.ok)n("success"),r("Thanks for subscribing! Check your email to confirm."),d("");else{const h=await m.json();n("error"),r(h.error||"Something went wrong. Please try again.")}}catch{n("error"),r("Something went wrong. Please try again.")}}};return e.jsxs(g,{title:s,children:[t&&e.jsx("p",{className:"text-foreground-muted text-sm mb-4",children:t}),l==="success"?e.jsx("div",{className:"p-3 bg-green-50 text-green-800 rounded-theme text-sm",children:u}):e.jsxs("form",{onSubmit:i,className:"space-y-3",children:[e.jsx("input",{type:"email",placeholder:"Your email address",value:a,onChange:c=>d(c.target.value),className:"w-full px-4 py-2 border border-border rounded-theme bg-background text-foreground placeholder:text-foreground-muted focus:outline-hidden focus:ring-2 focus:ring-primary/20 focus:border-primary",required:!0}),e.jsx("button",{type:"submit",disabled:l==="loading",className:"w-full px-4 py-2 bg-primary text-white rounded-theme hover:bg-primary-dark transition-colors disabled:opacity-50",children:l==="loading"?"Subscribing...":"Subscribe"}),l==="error"&&e.jsx("p",{className:"text-red-600 text-sm",children:u})]})]})}function Q({title:s,content:t=""}){return t?e.jsx(g,{title:s,children:e.jsx("div",{className:"prose prose-sm max-w-none dark:prose-invert",dangerouslySetInnerHTML:{__html:B(t)}})}):null}const k={twitter:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z",github:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z",linkedin:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z",facebook:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z",instagram:"M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24
112 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z",youtube:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z",rss:"M6.503 20.752c0 1.794-1.456 3.248-3.251 3.248-1.796 0-3.252-1.454-3.252-3.248 0-1.794 1.456-3.248 3.252-3.248 1.795.001 3.251 1.454 3.251 3.248zm-6.503-12.572v4.811c6.05.062 10.96 4.966 11.022 11.009h4.817c-.062-8.71-7.118-15.758-15.839-15.82zm0-3.368c10.58.046 19.152 8.594 19.183 19.188h4.817c-.03-13.231-10.755-23.954-24-24v4.812z"};function K({title:s="Follow Us",links:t=[]}){return t.length===0?null:e.jsx(g,{title:s,children:e.jsx("div",{className:"flex flex-wrap gap-3",children:t.map((a,d)=>{const l=k[a.platform.toLowerCase()];return e.jsx("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"p-2 rounded-full bg-background-alt text-foreground-muted hover:text-primary hover:bg-primary/10 transition-colors",title:a.label||a.platform,children:e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:l||k.rss})})},d)})})})}function X({imageUrl:s,content:t="",badge:a}){return e.jsxs("div",{className:"rounded-theme shadow-xs border border-border overflow-hidden",children:[s&&e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:s,alt:"About",className:"w-full object-cover"}),a&&e.jsx("div",{className:"absolute -bottom-3 right-3",children:e.jsx("span",{className:"bg-accent text-primary-dark text-xs font-bold px-3 py-1.5 rounded-lg shadow-md",children:a})})]}),t&&e.jsx("div",{className:"bg-background-alt p-5 pt-6 text-sm text-foreground-muted prose prose-sm dark:prose-invert [&_a]:text-primary [&_a]:font-medium [&_a]:no-underline [&_a]:hover:text-primary-dark [&_h3]:text-base [&_h3]:font-bold [&_h3]:font-heading [&_h3]:text-primary [&_h3]:mb-1 [&_h3]:not-prose",dangerouslySetInnerHTML:{__html:H(t)}})]})}function Z({title:s="Archives",displayType:t="list",showPostCount:a=!0,limit:d=12}){const[l,n]=x.useState([]),[u,r]=x.useState(!0),[i,c]=x.useState("");x.useEffect(()=>{async function o(){try{const p=await F({data:{limit:d}});n(p)}catch(p){console.error("Failed to load archives:",p)}finally{r(!1)}}o()},[d]);const m=(o,p)=>new Date(o,p-1).toLocaleDateString("en-US",{year:"numeric",month:"long"}),h=(o,p)=>`/posts/archive#${o}-${p-1}`;return u?e.jsx(g,{title:s,children:e.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((o,p)=>e.jsx("div",{className:"animate-pulse h-4 bg-gray-200 rounded-sm w-3/4"},p))})}):l.length===0?e.jsx(g,{title:s,children:e.jsx("p",{className:"text-foreground-muted text-sm",children:"No archives yet."})}):t==="dropdown"?e.jsx(g,{title:s,children:e.jsxs("select",{value:i,onChange:o=>{c(o.target.value),o.target.value&&(window.location.href=o.target.value)},className:"input w-full",children:[e.jsx("option",{value:"",children:"Select Month"}),l.map(o=>e.jsxs("option",{value:h(o.year,o.month),children:[m(o.year,o.month),a&&` (${o.count})`]},`${o.year}-${o.month}`))]})}):e.jsxs(g,{title:s,children:[e.jsx("ul",{className:"space-y-2",children:l.map(o=>e.jsx("li",{children:e.jsxs("a",{href:h(o.year,o.month),className:"flex justify-between text-foreground-muted hover:text-primary transition-colors",children:[e.jsx("span",{children:m(o.year,o.month)}),a&&e.jsxs("span",{className:"text-sm",children:["(",o.count,")"]})]})},`${o.year}-${o.month}`))}),e.jsx("div",{className:"mt-3 pt-3 border-t border-border",children:e.jsx(y,{to:"/posts/archive",className:"text-sm text-primary hover:text-primary-dark",children:"View all ar
1chives"})})]})}function ee({title:s="Links",links:t=[]}){return t.length===0?e.jsx(g,{title:s,children:e.jsx("p",{className:"text-foreground-muted text-sm",children:"No links configured."})}):e.jsx(g,{title:s,children:e.jsx("ul",{className:"space-y-2",children:t.map((a,d)=>e.jsx("li",{children:e.jsxs("a",{href:a.url,target:a.openInNewTab?"_blank":void 0,rel:a.openInNewTab?"noopener noreferrer":void 0,className:"flex items-center gap-2 text-foreground-muted hover:text-primary transition-colors",children:[e.jsx("span",{children:a.label}),a.openInNewTab&&e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})},d))})})}function re({title:s="Popular Posts",count:t=5,showDate:a=!0,showThumbnail:d=!1}){const[l,n]=x.useState([]),[u,r]=x.useState(!0);return x.useEffect(()=>{async function i(){try{const c=await I({data:{count:t}});n(c)}catch(c){console.error("Failed to load popular posts:",c)}finally{r(!1)}}i()},[t]),u?e.jsx(g,{title:s,children:e.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((i,c)=>e.jsxs("div",{className:"animate-pulse flex gap-3",children:[d&&e.jsx("div",{className:"w-16 h-12 bg-gray-200 rounded-sm shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-4 bg-gray-200 rounded-sm w-3/4 mb-1"}),e.jsx("div",{className:"h-3 bg-gray-100 rounded-sm w-1/4"})]})]},c))})}):l.length===0?e.jsx(g,{title:s,children:e.jsx("p",{className:"text-foreground-muted text-sm",children:"No posts yet."})}):e.jsx(g,{title:s,children:e.jsx("ul",{className:"space-y-3",children:l.map(i=>e.jsx("li",{children:e.jsxs(y,{to:"/posts/$slug",params:{slug:i.slug},className:"flex gap-3 group",children:[d&&i.featuredImageUrl&&e.jsx("img",{src:i.featuredImageUrl,alt:i.title,className:"w-16 h-12 object-cover rounded-sm shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-sm text-foreground group-hover:text-primary transition-colors line-clamp-2 block",children:i.title}),a&&i.publishedAt&&e.jsx("span",{className:"text-xs text-foreground-muted",children:C(i.publishedAt)})]})]})},i.id))})})}function se({widget:s,categories:t,tags:a,activeCategory:d,activeTag:l,searchQuery:n,onSearch:u}){if(!s.isEnabled)return null;const r=s.settings||{};switch(s.type){case"search":return e.jsx(J,{title:s.title,placeholder:r.placeholder,searchQuery:n,onSearch:u});case"recent-posts":return e.jsx(O,{title:s.title,count:r.count,showDate:r.showDate});case"categories":return e.jsx(V,{title:s.title,categories:t,activeCategory:d,showCount:r.showCount});case"tags":return e.jsx(Y,{title:s.title,tags:a,activeTag:l,maxTags:r.maxTags});case"newsletter":return e.jsx(G,{title:s.title||r.title,description:r.description});case"text":return e.jsx(Q,{title:s.title,content:r.content});case"social-links":return e.jsx(K,{title:s.title,links:r.links});case"about":return e.jsx(X,{title:s.title,imageUrl:r.imageUrl,content:r.content,showSocialLinks:r.showSocialLinks,badge:r.badge});case"archive":return e.jsx(Z,{title:s.title,displayType:r.displayType,showPostCount:r.showPostCount,limit:r.limit});case"custom-links":return e.jsx(ee,{title:s.title,links:r.links});case"popular-posts":return e.jsx(re,{title:s.title,count:r.count,showDate:r.showDate,showThumbnail:r.showThumbnail});default:return null}}function g({title:s,children:t}){return e.jsxs("div",{className:"rounded-theme shadow-xs border border-border overflow-hidden",children:[s&&e.jsx("div",{className:"bg-primary px-6 py-3",children:e.jsx("h3",{className:"text-lg font-semibold text-white font-heading",children:s})}),e.jsx("div",{className:"bg-background-alt p-6",children:t})]})}function S({items:s,activeSlug:t,title:a,maxVisible:d=8,renderLink:l,variant:n="list",showHashPrefix:u=!1}){const[r,i]=x.useState(""),[c,m]=x.useState(!1),h=x.useMemo(()=>{if(!r.trim())return s;const f=r.toLowerCase();return s.filter(v=>v.name.toLowerCase().includes(f))},[s,r]),o=c?h:h.slice(0,d),p=h.length>d,b=h.length-d,j=s.length>d;return s.length===0?null:e.jsxs("div",{className:"bg-background rounded-theme shadow-xs border border-border p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-4 font-heading",children:a}),j&&e.jsxs("div",{className:"relative mb-3",children:[e.jsx("input",{type:"text",value:r,onChange:f=>
1{i(f.target.value),f.target.value&&!c&&m(!0)},placeholder:`Search ${a.toLowerCase()}...`,className:"w-full px-3 py-1.5 pr-8 text-sm border border-border rounded-theme bg-background text-foreground placeholder-foreground-muted focus:ring-1 focus:ring-primary focus:border-primary"}),r&&e.jsx("button",{type:"button",onClick:()=>i(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-foreground-muted hover:text-foreground",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),n==="list"?e.jsx("ul",{className:"space-y-2",children:o.map(f=>{const v=t===f.slug;return e.jsx("li",{children:l(f,v,f.name)},f.id)})}):e.jsx("div",{className:"flex flex-wrap gap-2",children:o.map(f=>{const v=t===f.slug;return l(f,v,e.jsxs(e.Fragment,{children:[u?"#":"",f.name]}))})}),h.length===0&&r&&e.jsx("p",{className:"text-sm text-foreground-muted py-2",children:"No matches found"}),p&&!r&&e.jsx("button",{type:"button",onClick:()=>m(!c),className:"mt-3 text-sm text-primary hover:text-primary-dark font-medium flex items-center gap-1",children:c?e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})}),"Show less"]}):e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),"Show ",b," more"]})})]})}function te(){const{authorPageUrl:s}=$();return e.jsxs("div",{className:"bg-background rounded-theme shadow-xs border border-border overflow-hidden",children:[e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:"/uploads/jeff-harvie-registered-migration-agent.jpg",alt:"Jeff Harvie - Registered Migration Agent",className:"w-full object-cover"}),e.jsx("div",{className:"absolute -bottom-3 right-3",children:e.jsx("span",{className:"bg-accent text-primary-dark text-xs font-bold px-3 py-1.5 rounded-lg shadow-md",children:"MARN 0959797"})})]}),e.jsxs("div",{className:"p-5 pt-6",children:[e.jsx("h3",{className:"text-base font-bold font-heading text-primary mb-1",children:"The RMA who cares about couples!"}),e.jsx("p",{className:"text-sm text-foreground-muted mb-3",children:"Jeff Harvie â Registered Migration Agent since 2009. Based in Manila with local expertise. Thousands of successful visa applications helping AustralianâSouth East Asian couples achieve their dreams."}),e.jsxs(y,{to:s,className:"text-primary hover:text-primary-dark font-medium transition-colors inline-flex items-center gap-1 text-sm",children:["Learn More About Jeff",e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})}function ae({categories:s=[],tags:t=[],activeCategory:a,activeTag:d,searchQuery:l="",onSearch:n,showNewsletter:u=!0}){const r=E(),i=x.useRef(null),c=()=>{n&&n(i.current?.value??"")};return r&&r.length>0?e.jsx("aside",{className:"space-y-6",children:r.map(m=>e.jsx(se,{widget:m,categories:s,tags:t,activeCategory:a,activeTag:d,searchQuery:l,onSearch:n},m.id))}):e.jsxs("aside",{className:"space-y-6",children:[e.jsx(te,{}),n&&e.jsxs("div",{className:"bg-background rounded-theme shadow-xs border border-border p-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-4 font-heading",children:"Search"}),e.jsxs("form",{className:"relative",onSubmit:m=>{m.preventDefault(),c()},children:[e.jsx("input",{ref:i,type:"text",defaultValue:l,placeholder:"Search posts...",className:"w-full px-4 py-2 pr-10 border border-border rounded-theme bg-background text-foreground placeholder-foreground-muted focus:ring-2 focus:ring-primary focus:border-primary"}),e.jsx("button",{type:"submit","aria-label":"Search",className:"absolute right-2 top-1/2 -translate-y-1/2 text-foreground-muted hover:text-foreground cursor-pointer",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})})]})]}),e.jsx(S,{items:s,activeSlug:a,title:"Categories",variant:"list",maxVisible:8,renderLink:(m,h,o)=>e.jsx(y,{to:"/posts",search:{page:void 0,category:m.slug,tag:void 0,q:void 0},className:`block text-sm transition-colors ${h?"text-primary font-medium":"text-foreground-muted hover:text-primary"}`,children:o},m.id)}),e.jsx(S,{items:t,activeSlug:d,title:"Tags",variant:"pills",showHashPrefix:!0,maxVisible:12,renderLink:(m,h,o)=>e.jsx(y,{to:"/posts",search:{page:void 0,category:void 0,tag:m.slug,q:void 0},className:`inline-block px-3 py-1 rounded-full text-sm transition-colors ${h?"bg-foreground text-background":"bg-background-alt text-foreground-muted hover:bg-border"}`,children:o},m.id)}),u&&e.jsx(q,{source:"sidebar"})]})}function ie({children:s,siteTitle:t="Down Under Visa",categories:a=[],tags:d=[],activeCategory:l,activeTag:n,searchQuery:u,onSearch:r,showSidebar:i,sidebarPosition:c="right",layout:m,variant:h,showHero:o,hideCta:p,headerProps:b,footerProps:j,sidebar:f,secondarySidebar:v,allCategories:L,allTags:M}){const W=D();let N;m?N=m:i!==void 0?i?N=c==="left"?"sidebar-left":"sidebar-right":N="full-width":N=W.defaultLayout||"sidebar-right";const A=a.length>0?a:L||[],P=d.length>0?d:M||[],w=f||e.jsx(ae,{categories:A,tags:P,activeCategory:l,activeTag:n,searchQuery:u,onSearch:r}),T=()=>{switch(N){case"full-width":return e.jsx("div",{className:"w-full",children:s});case"sidebar-left":return e.jsxs("div",{className:"flex flex-col lg:flex-row gap-8",children:[e.jsx("aside",{className:"lg:w-72 flex-shrink-0 order-2 lg:order-1",children:w}),e.jsx("main",{className:"flex-1 min-w-0 order-1 lg:order-2",children:s})]});case"sidebar-right":return e.jsxs("div",{className:"flex flex-col lg:flex-row gap-8",children:[e.jsx("main",{className:"flex-1 min-w-0",children:s}),e.jsx("aside",{className:"lg:w-72 flex-shrink-0",children:w})]});case"sidebar-both":return e.jsxs("div",{className:"flex flex-col lg:flex-row gap-8",children:[e.jsx("aside",{className:"lg:w-64 flex-shrink-0 order-2 lg:order-1",children:w}),e.jsx("main",{className:"flex-1 min-w-0 order-1 lg:order-2",children:s}),e.jsx("aside",{className:"lg:w-64 flex-shrink-0 order-3",children:v||e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"bg-background-alt rounded-lg p-4",children:[e.jsx("h3",{className:"font-semibold text-foreground mb-3",children:"Qu
1ick Links"}),e.jsx("p",{className:"text-sm text-foreground-muted",children:"Add custom widgets or content for this sidebar area."})]})})})]});default:return e.jsxs("div",{className:"flex flex-col lg:flex-row gap-8",children:[e.jsx("main",{className:"flex-1 min-w-0",children:s}),e.jsx("aside",{className:"lg:w-72 flex-shrink-0",children:w})]})}};return e.jsx(R,{siteTitle:t,variant:h,showHero:o,hideCta:p,headerProps:b,footerProps:j,children:e.jsx(U,{className:"py-12",children:T()})})}export{ie as B,q as N};
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.