import{c as i,r as s,j as e,R as x,q as R}from"./index-DdrMvM2x.js";import{L as b}from"./loader-circle-UOilDOaP.js";/**
* @license lucide-react v0.507.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const f=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],y=i("check-check",f);/**
* @license lucide-react v0.507.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const j=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],F=i("copy",j);/**
* @license lucide-react v0.507.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const w=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],v=i("download",w);function k(){const[r,p]=s.useState(""),[g,h]=s.useState(!0),[c,S]=s.useState(""),[o,n]=s.useState(!1),l=`${window.location.origin}/rss`;s.useEffect(()=>{(async()=>{try{const{data:a,error:t}=await window.ezsite.apis.run({path:"generateRSSFeed",methodName:"generateRSSFeed",param:[]});if(t)throw new Error(t);p(a)}catch(a){console.error("Error fetching RSS:",a),S(a instanceof Error?a.message:"Failed to load RSS feed")}finally{h(!1)}})()},[]);const m=()=>{const d=new Blob([r],{type:"application/rss+xml"}),a=URL.createObjectURL(d),t=document.createElement("a");t.href=a,t.download="feed.xml",document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(a)},u=async()=>{try{await navigator.clipboard.writeText(l),n(!0),setTimeout(()=>n(!1),2e3)}catch(d){console.error("Failed to copy:",d)}};return g?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-orange-50 via-white to-gray-50","data-id":"nhx6calco","data-path":"src/pages/RSSFeedPage.tsx",children:e.jsxs("div",{className:"text-center","data-id":"7pj9kl3ca","data-path":"src/pages/RSSFeedPage.tsx",children:[e.jsx(b,{className:"w-10 h-10 animate-spin text-orange-500 mx-auto mb-3","data-id":"dtkmi8p7f","data-path":"src/pages/RSSFeedPage.tsx"}),e.jsx("p",{className:"text-gray-600","data-id":"889yynea7","data-path":"src/pages/RSSFeedPage.tsx",children:"Loading RSS feed..."})]})}):c?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-red-50 via-white to-gray-50","data-id":"0kkzcxd56","data-path":"src/pages/RSSFeedPage.tsx",children:e.jsxs("div",{className:"text-center max-w-md px-4","data-id":"5s8b71cr4","data-path":"src/pages/RSSFeedPage.tsx",children:[e.jsx("div",{className:"w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4","data-id":"3vcbiu3yl","data-path":"src/pages/RSSFeedPage.tsx",children:e.jsx(x,{className:"w-8 h-8 text-red-500","data-id":"1cbe9sf4s","data-path":"src/pages/RSSFeedPage.tsx"})}),e.jsx("h1",{className:"text-2xl font-bold text-red-600 mb-2","data-id":"mxfavvnvj","data-path":"src/pages/RSSFeedPage.tsx",children:"RSS Feed Error"}),e.jsx("p",{className:"text-gray-600","data-id":"t5hbxphdv","data-path":"src/pages/RSSFeedPage.tsx",children:c})]})}):e.jsxs(e.Fragment,{children:[e.jsxs(R,{"data-id":"kszqf8vzv","data-path":"src/pages/RSSFeedPage.tsx",children:[e.jsx("title",{"data-id":"xzkuvj6va","data-path":"src/pages/RSSFeedPage.tsx",children:"RSS Feed - Construction & Renovation Loans"}),e.jsx("meta",{name:"description",content:"Subscribe to our RSS feed for the latest construction and renovation loan news and blog posts.","data-id":"xueaa2vt5","data-path":"src/pages/RSSFeedPage.tsx"}),e.jsx("link",{rel:"alternate",type:"application/rss+xml",title:"Construction & Renovation Loans RSS Feed",href:"/rss","data-id":"of8a4p23x","data-path":"src/pages/RSSFeedPage.tsx"})]}),e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-orange-50 via-white to-gray-50 py-12 px-4","data-id":"icoo76gob","data-path":"src/pages/RSSFeedPage.tsx",children:e.jsxs("div",{className:"max-w-4xl mx-auto","data-id":"wea445drm","data-path":"src/pages/RSSFeedPage.tsx",children:[e.jsxs("div",{className:"text-center mb-8","data-id":"aa428nioi","data-path":"src/pages/RSSFeedPage.tsx",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-orange-100 rounded-full mb-4","data-id":"fhygj6n28","data-path":"src/pages/RSSFeedPage.tsx",children:e.jsx(x,{className:"w-8 h-8 text-orange-500","data-id":"e4213cqwb","data-path":"src/pages/RSSFeedPage.tsx"})}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2","data-id":"2mxis6kpp","data-path":"src/pages/RSSFeedPage.tsx",children:"RSS Feed"}),e.jsx("p",{className:"text-gray-600 max-w-xl mx-auto","data-id":"qy79j18pf","data-path":"src/pages/RSSFeedPage.tsx",children:"Subscribe to our RSS feed to stay updated with the latest blog posts about construction and renovation loans."})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-lg overflow-hidden","data-id":"up3wnth9d","data-path":"src/pages/RSSFeedPage.tsx",children:[e.jsxs("div",{className:"p-6 border-b border-gray-100","data-id":"mfnj5z26u","data-path":"src/pages/RSSFeedPage.tsx",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide mb-2","data-id":"g13czsy5r","data-path":"src/pages/RSSFeedPage.tsx",children:"Feed URL"}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap","data-id":"9vv3woxst","data-path":"src/pages/RSSFeedPage.tsx",children:[e.jsx("code",{className:"flex-1 min-w-0 block bg-gray-50 border border-gray-200 px-4 py-2.5 rounded-lg text-sm text-gray-800 break-all","data-id":"u35h1tx32","data-path":"src/pages/RSSFeedPage.tsx",children:l}),e.jsxs("div",{className:"flex gap-2 flex-shrink-0","data-id":"30xqjhmyw","data-path":"src/pages/RSSFeedPage.tsx",children:[e.jsxs("button",{onClick:u,className:"inline-flex items-center gap-2 px-4 py-2.5 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg transition-colors text-sm font-medium","aria-label":"Copy RSS feed URL","data-id":"8h01tqxkq","data-path":"src/pages/RSSFeedPage.tsx",children:[o?e.jsx(y,{className:"w-4 h-4 text-green-600","data-id":"7zync41be","data-path":"src/pages/RSSFeedPage.tsx"}):e.jsx(F,{className:"w-4 h-4","data-id":"p6b2pw5xu","data-path":"src/pages/RSSFeedPage.tsx"}),o?"Copied!":"Copy URL"]}),e.jsxs("button",{onClick:m,disabled:!r,className:"inline-flex items-center gap-2 px-4 py-2.5 bg-orange-500 hover:bg-orange-600 text-white rounded-lg transition-colors text-sm font-medium disabled:opacity-50","aria-label":"Download RSS feed as XML file","data-id":"uu8k4n9s9","data-path":"src/pages/RSSFeedPage.tsx",children:[e.jsx(v,{className:"w-4 h-4","data-id":"8nwkdxeut","data-path":"src/pages/RSSFeedPage.tsx"}),"Download XML"]})]})]}),e.jsx("p",{className:"text-xs text-gray-500 mt-2","data-id":"oo0ri4gdo","data-path":"src/pages/RSSFeedPage.tsx",children:"Paste this URL into your favourite RSS reader (Feedly, Inoreader, NetNewsWire, etc.) to subscribe."})]}),e.jsxs("div",{className:"p-6","data-id":"qvem4cb04","data-path":"src/pages/RSSFeedPage.tsx",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide mb-3","data-id":"4gp7pnku9","data-path":"src/pages/RSSFeedPage.tsx",children:"Feed Content (RSS 2.0 XML)"}),e.jsx("pre",{className:"bg-gray-900 text-green-400 p-5 rounded-lg overflow-x-auto text-xs leading-relaxed whitespace-pre font-mono max-h-[600px] overflow-y-auto","data-id":"8zumb0kzt","data-path":"src/pages/RSSFeedPage.tsx",children:r})]})]}),e.jsxs("div",{className:"mt-6 bg-orange-50 border border-orange-100 rounded-xl p-6","data-id":"zcssuxisf","data-path":"src/pages/RSSFeedPage.tsx",children:[e.jsx("h2",{className:"font-semibold text-orange-900 mb-2","data-id":"moym1ztf6","data-path":"src/pages/RSSFeedPage.tsx",children:"How to Subscribe"}),e.jsxs("ol",{className:"text-sm text-orange-800 space-y-1 list-decimal list-inside","data-id":"agp48qcff","data-path":"src/pages/RSSFeedPage.tsx",children:[e.jsx("li",{"data-id":"s8g1sn8jh","data-path":"src/pages/RSSFeedPage.tsx",children:"Copy the feed URL above."}),e.jsx("li",{"data-id":"hrqd41usw","data-path":"src/pages/RSSFeedPage.tsx",children:"Open your RSS reader (e.g. Feedly, Inoreader, NetNewsWire, or any RSS app)."}),e.jsxs("li",{"data-id":"096skoomt","data-path":"src/pages/RSSFeedPage.tsx",children:["Choose ",e.jsx("strong",{"data-id":"5zu3cymkw","data-path":"src/pages/RSSFeedPage.tsx",children:'"Add feed"'})," or ",e.jsx("strong",{"data-id":"53155khcy","data-path":"src/pages/RSSFeedPage.tsx",children:'"Subscribe"'})," and paste the URL."]}),e.jsx("li",{"data-id":"cv3ueizc1","data-path":"src/pages/RSSFeedPage.tsx",children:"You'll automatically receive new blog posts as they're published."})]})]})]})})]})}export{k as default};