var e=(e,s,a)=>new Promise((t,l)=>{var i=e=>{try{r(a.next(e))}catch(s){l(s)}},n=e=>{try{r(a.throw(e))}catch(s){l(s)}},r=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,n);r((a=a.apply(e,s)).next())});import{_ as s}from"./supabase-C8kocL5G.js";import{j as a}from"./radix-ui-CVZWoPyd.js";import{r as t}from"./react-vendor-BmlOtb7g.js";import{B as l}from"./index-BCSgDlp8.js";import{C as i,b as n,c as r,a as c}from"./card-BrVzo7bW.js";import{B as o}from"./badge-CHmVsFC8.js";import{I as d}from"./input-DClY5yZE.js";import{S as m}from"./SEO-BGpcOjpb.js";import{A as x}from"./AppSidebar-BQ3UxiE1.js";import{a as h}from"./react-router-DzDVDRUd.js";import{B as u}from"./building-2-xmYyS5DZ.js";import{M as p}from"./map-pin-BNow_pFf.js";import{C as j}from"./wrench-n19foI4n.js";import{S as f}from"./search-Dj8gdQAd.js";import{P as b}from"./plus-DTFoGqPI.js";import{C as g}from"./circle-check-big-XRSq9IsA.js";import{E as N}from"./external-link-DuZiTz8-.js";import"./utils-Ceo22G_t.js";import"./use-mobile-onbIdywO.js";import"./CheckoutButton-BXcL0vXQ.js";import"./analytics-CgKQjs6u.js";import"./arrow-right-CcptuZBy.js";import"./x-DIEzjPMA.js";import"./log-out-DrMwdybL.js";import"./briefcase-Cj6O7NU7.js";import"./circle-plus-C5zM2HoU.js";import"./sparkles-D1jOictl.js";import"./trending-up-DMpQ-MB3.js";import"./book-open-D7nUFbtH.js";import"./settings-BQk8nNSr.js";import"./chevron-right-D_Z5YBDv.js";import"./chevron-left-D5q9zZf8.js";import"./credit-card-CUy9-vWB.js";function v(){const v=h(),[y,w]=t.useState([]),[C,k]=t.useState([]),[S,F]=t.useState([]),[P,_]=t.useState(""),[A,L]=t.useState(""),[M,T]=t.useState(""),[E,q]=t.useState(!0),[I,$]=t.useState(!1),[B,R]=t.useState(1);t.useEffect(()=>{D()},[]);const D=()=>e(this,null,function*(){try{const{getCachedAllData:a}=yield s(()=>e(this,null,function*(){const{getCachedAllData:e}=yield import("./programmaticSeoCache-DX9C344M.js");return{getCachedAllData:e}}),[]),t=yield a();w(t.businessTypes),k(t.cities),F(t.pages.financial_plan)}catch(a){console.error("Error fetching cached data:",a);try{const[e,s,a]=yield Promise.all([fetch("/api/programmatic-seo/business-types"),fetch("/api/programmatic-seo/cities"),fetch("/api/programmatic-seo/pages?type=financial_plan")]),t=yield e.json(),l=yield s.json(),i=yield a.json();t.success&&w(t.data),l.success&&k(l.data.slice(0,50)),i.success&&F(i.data)}catch(t){console.error("Error with fallback data fetch:",t)}}finally{q(!1)}}),z=S.filter(e=>{const s=e.business_types.name.toLowerCase().includes(P.toLowerCase())||e.cities.city.toLowerCase().includes(P.toLowerCase())||e.title.toLowerCase().includes(P.toLowerCase()),a=!A||e.business_types.category===A,t=!M||`${e.cities.city}, ${e.cities.state}`===M;return s&&a&&t}),G=[...new Set(y.map(e=>e.category))],O=[...new Set(S.map(e=>`${e.cities.city}, ${e.cities.state}`))],Y=z.length,V=Math.ceil(Y/50),H=50*(B-1),J=H+50,K=(e=>{const s=[...e];for(let a=s.length-1;a>0;a--){const e=Math.floor(Math.random()*(a+1));[s[a],s[e]]=[s[e],s[a]]}return s})(z).slice(H,J);t.useEffect(()=>{R(1)},[P,A,M]);const W=["5-year financial projections included","Cash flow analysis included","Break-even calculations included","Funding requirements included","Tax planning strategies included","Financial controls included","Startup cost breakdown included","Investment analysis included","Growth financing strategy included","Risk assessment included"];return E?a.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),a.jsx("p",{className:"mt-4 text-slate-600",children:"Loading financial templates..."})]})}):a.jsxs(a.Fragment,{children:[a.jsx(m,{title:"Free Financial Plan Templates by Industry & Location",description:"Get comprehensive financial plan templates for any industry and location. Complete financial projections, startup costs, and funding strategies for restaurants, gyms, salons, and more.",keywords:["financial plan templates","business financial projections","startup financial plan","financial planning examples","industry financial plans","cash flow projections","break even analysis","funding requirements"],canonical:"/financial-plan-templates"}),a.jsxs("div",{className:"flex h-screen",children:[a.jsx(x,{}),a.jsxs("div",{className:"flex-1 overflow-y-auto bg-slate-50",children:[a.jsxs("div",{className:"bg-gradient-to-br from-blue-500 to-blue-600 text-white relative overflow-hidden",children:[a.jsx("div",{className:"absolute top-0 left-1/2 transform -translate-x-1/2 w-96 h-96 bg-white/10 rounded-full blur-3xl"}),a.jsx("div",{className:"absolute top-20 right-1/4 w-64 h-64 bg-white/15 rounded-full blur-3xl"}),a.jsx("div",{className:"absolute top-40 left-1/4 w-80 h-80 bg-cyan-300/20 rounded-full blur-3xl"}),a.jsx("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-4xl lg:text-5xl font-bold mb-6",children:"Free Financial Plan Templates"}),a.jsx("p",{className:"text-xl lg:text-2xl text-blue-100 mb-8 max-w-3xl mx-auto",children:"Comprehensive financial plan templates with detailed projections, startup costs, cash flow analysis, and funding strategies for any industry and location."}),a.jsxs("div",{className:"flex flex-wrap justify-center gap-4 mb-8",children:[a.jsxs(o,{variant:"secondary",className:"bg-white/20 text-white border-white/30 text-sm px-4 py-2",children:[a.jsx(u,{className:"w-4 h-4 mr-2"}),y.length,"+ Industries"]}),a.jsxs(o,{variant:"secondary",className:"bg-white/20 text-white border-white/30 text-sm px-4 py-2",children:[a.jsx(p,{className:"w-4 h-4 mr-2"}),C.length,"+ Cities"]}),a.jsxs(o,{variant:"secondary",className:"bg-white/20 text-white border-white/30 text-sm px-4 py-2",children:[a.jsx(j,{className:"w-4 h-4 mr-2"}),S.length," Financial Plans Available"]})]}),a.jsx(l,{size:"lg",className:"bg-white text-blue-600 hover:bg-blue-50",onClick:()=>v("/questionnaire"),children:"Create Custom Financial Plan"})]})})]}),a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[a.jsxs(i,{className:"mb-8",children:[a.jsx(n,{children:a.jsxs(r,{className:"flex items-center",children:[a.jsx(f,{className:"w-5 h-5 mr-2"}),"Find Your Financial Plan Template"]})}),a.jsx(c,{children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Search Templates"}),a.jsx(d,{placeholder:"Restaurant, Chicago, Hair Salon...",value:P,onChange:e=>_(e.target.value)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Filter by Category"}),a.jsxs("select",{className:"w-full px-3 py-2 border border-slate-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",value:A,onChange:e=>L(e.target.value),children:[a.jsx("option",{value:"",children:"All Categories"}),G.map(e=>a.jsx("option",{value:e,children:e},e))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Filter by Location"}),a.jsxs("select",{className:"w-full px-3 py-2 border border-slate-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",value:M,onChange:e=>T(e.target.value),children:[a.jsx("option",{value:"",children:"All Locations"}),O.map(e=>a.jsx("option",{value:e,children:e},e))]})]})]})})]}),a.jsxs("div",{className:"mb-12",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h2",{className:"text-3xl font-bold text-slate-900",children:["Available Financial Plan Templates (",z.length,")"]}),I&&a.jsxs(o,{variant:"outline",className:"animate-pulse",children:[a.jsx(b,{className:"w-4 h-4 mr-1"}),"Generating..."]})]}),0===z.length?a.jsx(i,{className:"text-center py-12",children:a.jsxs(c,{children:[a.jsx(j,{className:"w-12 h-12 text-slate-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-slate-900 mb-2",children:"No financial plans found"}),a.jsx("p",{className:"text-slate-600 mb-4",children:"Try adjusting your search criteria or create a custom financial plan."}),a.jsx(l,{onClick:()=>v("/questionnaire"),children:"Create Custom Financial Plan"})]})}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:K.map(e=>{var s,t,d;return a.jsxs(i,{className:"hover:shadow-lg transition-shadow",children:[a.jsx(n,{children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs(r,{className:"text-lg leading-tight mb-2",children:[e.business_types.name," Financial Plan - ",e.cities.city]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(o,{variant:"outline",className:"text-xs",children:e.business_types.category}),a.jsxs(o,{variant:"outline",className:"text-xs",children:[a.jsx(p,{className:"w-3 h-3 mr-1"}),e.cities.state]})]})]}),a.jsx(j,{className:"w-5 h-5 text-blue-500 flex-shrink-0"})]})}),a.jsx(c,{children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-slate-600",children:"Startup Cost:"}),a.jsxs("span",{className:"font-medium",children:["$",(null==(s=e.business_types.avg_startup_cost)?void 0:s.toLocaleString())||"N/A"]})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-slate-600",children:"Avg. Revenue:"}),a.jsxs("span",{className:"font-medium",children:["$",(null==(t=e.business_types.avg_revenue)?void 0:t.toLocaleString())||"N/A"]})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-slate-600",children:"Population:"}),a.jsx("span",{className:"font-medium",children:null==(d=e.cities.population)?void 0:d.toLocaleString()})]}),a.jsxs("div",{className:"pt-3 border-t",children:[a.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[a.jsx(g,{className:"w-4 h-4 text-blue-500"}),a.jsx("span",{className:"text-sm text-slate-600",children:W[Math.floor(Math.random()*W.length)]})]}),a.jsxs(l,{className:"w-full bg-blue-600 hover:bg-blue-700",size:"sm",onClick:()=>v(`/${e.slug}`),children:["View Financial Plan",a.jsx(N,{className:"w-4 h-4 ml-2"})]})]})]})})]},e.id)})}),V>1&&a.jsxs("div",{className:"flex justify-center items-center mt-8 space-x-4",children:[a.jsx(l,{variant:"outline",disabled:1===B,onClick:()=>R(B-1),children:"Previous"}),a.jsx("div",{className:"flex items-center space-x-2",children:Array.from({length:Math.min(5,V)},(e,s)=>{let t;return t=V<=5||B<=3?s+1:B>=V-2?V-4+s:B-2+s,a.jsx(l,{variant:B===t?"default":"outline",size:"sm",onClick:()=>R(t),children:t},t)})}),a.jsx(l,{variant:"outline",disabled:B===V,onClick:()=>R(B+1),children:"Next"})]}),a.jsxs("div",{className:"text-center mt-4 text-sm text-slate-600",children:["Showing ",H+1,"-",Math.min(J,Y)," of ",Y," financial plans"]})]}),a.jsxs(i,{className:"mb-8",children:[a.jsx(n,{children:a.jsx(r,{className:"text-2xl",children:"What's Included in Our Financial Plan Templates?"})}),a.jsx(c,{children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(g,{className:"w-6 h-6 text-blue-500 mt-1"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-slate-900",children:"5-Year Financial Projections"}),a.jsx("p",{className:"text-slate-600",children:"Detailed revenue and expense forecasts with monthly breakdowns."})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(g,{className:"w-6 h-6 text-blue-500 mt-1"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-slate-900",children:"Startup Cost Analysis"}),a.jsx("p",{className:"text-slate-600",children:"Complete breakdown of initial investment requirements."})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(g,{className:"w-6 h-6 text-blue-500 mt-1"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-slate-900",children:"Cash Flow Management"}),a.jsx("p",{className:"text-slate-600",children:"Monthly cash flow projections and working capital analysis."})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(g,{className:"w-6 h-6 text-blue-500 mt-1"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-slate-900",children:"Break-Even Analysis"}),a.jsx("p",{className:"text-slate-600",children:"Calculate when your business will become profitable."})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(g,{className:"w-6 h-6 text-blue-500 mt-1"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-slate-900",children:"Funding Strategy"}),a.jsx("p",{className:"text-slate-600",children:"Comprehensive funding requirements and financing options."})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(g,{className:"w-6 h-6 text-blue-500 mt-1"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-slate-900",children:"Financial Controls"}),a.jsx("p",{className:"text-slate-600",children:"KPIs, monitoring systems, and risk management strategies."})]})]})]})})]}),a.jsx(i,{className:"bg-gradient-to-r from-blue-500 to-blue-600 text-white",children:a.jsxs(c,{className:"p-8 text-center",children:[a.jsx("h3",{className:"text-2xl font-bold mb-4",children:"Ready to Plan Your Finances?"}),a.jsx("p",{className:"text-lg text-blue-100 mb-6",children:"Get a comprehensive financial plan tailored to your specific industry, location, and funding goals."}),a.jsx(l,{size:"lg",className:"bg-white text-blue-600 hover:bg-blue-50",onClick:()=>v("/questionnaire"),children:"Create Custom Financial Plan"})]})})]})]})]})]})}export{v as default};