1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8585],{70798:function(e,t,n){n.d(t,{r:function(){return a}}),n(83079);var a=(0,n(12119).$)("ca799a56f94ed467c47ddf9be64094ac01c361e5")},9334:function(e,t,n){n.d(t,{Z:function(){return a}});let a=(0,n(79205).Z)("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]])},41823:function(e,t,n){n.d(t,{Z:function(){return r}});var a=n(57437),o=n(70597);function r(e){let{value:t,onChange:n,className:r=""}=e;return(0,a.jsx)("select",{value:t,onChange:e=>n(e.target.value),className:"rounded-lg border border-white/15 bg-black/30 px-3 py-2 text-sm text-white outline-none focus:border-[#f3c86a] ".concat(r),children:o.Xy.map(e=>(0,a.jsxs)("option",{value:e.value,className:"bg-zinc-900 text-white",children:[e.symbol," ",e.name]},e.code))})}},28585:function(e,t,n){n.r(t),n.d(t,{default:function(){return m}});var a=n(57437),o=n(2265),r=n(41823),l=n(63094),s=n(70597),i=n(9334),c=n(70798),u=n(14438),d=n(81952);function m(){let{isPro:e}=(0,d.p)(),[t,n]=(0,o.useState)("GBP"),[m,f]=(0,o.useState)(25e3),[b,p]=(0,o.useState)(12),[y,v]=(0,o.useState)(750),x=(0,o.useCallback)(e=>{n(e.currency),f(e.startingDebt),p(e.annualRate),v(e.monthlyPayment)},[]),g=(0,s.iD)(t),w=(0,o.useMemo)(()=>{let e=b/100/12;if(y<=m*e)return null;let t=Math.ceil(Math.log(y/(y-m*e))/Math.log(1+e)),n=t*y;return{months:t,totalInterest:n-m}},[b,y,m]),I=async()=>{if(!e){u.A.error("Pro membership required to convert to Post-Mortem");return}if(!w){u.A.error("Valid payoff required. Increase monthly payment.");return}let n=await (0,c.r)({name:"Post-Mortem: Debt Snowball - ".concat(new Date().toLocaleDateString("en-GB")),type:"DEBT_SNOWBALL",inputs:{startingDebt:m,annualRate:b,monthlyPayment:y,currency:t},results:{months:w.months,years:w.months/12,totalInterest:w.totalInterest,postMortem:!0,timestamp:new Date().toISOString()}});n.success?u.A.success("Archived to Post-Mortem Ledger. View in The Vault."):u.A.error(n.error||"Archive failed")};return(0,a.jsxs)("div",{className:"space-y-4 rounded-2xl border border-white/10 bg-black/20 p-5",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h3",{className:"text-xl font-semibold text-[#f5e6c8]",children:"Debt Snowball Tool"}),(0,a.jsx)(r.Z,{value:t,onChange:n})]}),(0,a.jsx)("p",{className:"text-sm text-white/60",children:"Estimate payoff timeline based on fixed monthly payments."}),(0,a.jsx)(l.Z,{toolId:"debt",titlePrefix:"Debt snowball",getDraft:()=>({currency:t,startingDebt:m,annualRate:b,monthlyPayment:y}),applyDraft:x}),(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,a.jsx)(h,{label:"Starting Debt (".concat(g,")"),value:m,onChange:f}),(0,a.jsx)(h,{label:"APR (%)",value:b,onChange:p}),(0,a.jsx)(h,{label:"Monthly Payment (".concat(g,")"),value:y,onChange:v})]}),(0,a.jsx)("div",{className:"rounded-xl border border-[#f3c86a]/30 bg-[#f3c86a]/10 p-4 text-sm text-[#f5e6c8]",children:w?"Estimated payoff: ".concat(w.months," months (").concat((w.months/12).toFixed(1)," years), interest: ").concat((0,s.xG)(w.totalInterest,t)):"Payment is too low to reduce principal. Increase monthly payment."}),(0,a.jsx)("div",{className:"flex justify-end pt-2",children:(0,a.jsxs)("button",{type:"button",onClick:I,disabled:!e||!w,className:"flex items-center justify-center gap-2 py-3 px-6 rounded-lg border border-white/20 bg-white/5 text-white font-medium text-sm hover:bg-white/10 hover:border-[#f3c86a]/40 transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4"}),"Convert to Post-Mortem"]})})]})}function h(e){let{label:t,value:n,onChange:o}=e;return(0,a.jsxs)("label",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-white/70",children:t}),(0,a.jsx)("input",{type:"number",value:n,onChange:e=>o(Number(e.target.value)),className:"w-full rounded-lg border border-white/15 bg-black/30 px-3 py-2 text-sm text-white outline-none focus:border-[#f3c86a]"})]})}},81952:function(e,t,n){n.d(t,{p:function(){return r}});var a=n(2265),o=n(5526);function r(){let[e,t]=(0,a.useState)(!1),[n,r]=(0,a.useState)(!1),[l,s]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{var n;let{data:{session:a}}=await o.supabase.auth.getSession();if(!e)return;if(!(null==a?void 0:null===(n=a.user)||void 0===n?void 0:n.id)){t(!1),r(!1),s(!1);return}let l={};(null==a?void 0:a.access_token)&&(l.Authorization="Bearer ".concat(a.access_token));let i=await fetch("/api/verify-pro-status",{cache:"no-store",credentials:"include",headers:l}),c=await i.json().catch(()=>({}));if(e){let e=!!((null==c?void 0:c.isEnterpriseHub)||(null==c?void 0:c.isAdmin));r(e),t(!!((null==c?void 0:c.isPro)||(null==c?void 0:c.isProByTier)||(null==c?void 0:c.isAdmin)||e))}}catch(n){e&&(t(!1),r(!1))}finally{e&&s(!1)}})(),()=>{e=!1}},[]),{isPro:e,isEnterpriseHub:n,isLoading:l}}},70597:function(e,t,n){n.d(t,{Xy:function(){return a},iD:function(){return r},jK:function(){return o},xG:function(){return l}});
1let a=[{code:"GBP",name:"British Pound",symbol:"\xa3",value:"GBP"},{code:"USD",name:"US Dollar",symbol:"$",value:"USD"},{code:"EUR",name:"Euro",symbol:"â¬",value:"EUR"},{code:"CAD",name:"Canadian Dollar",symbol:"C$",value:"CAD"},{code:"AUD",name:"Australian Dollar",symbol:"A$",value:"AUD"},{code:"JPY",name:"Japanese Yen",symbol:"\xa5",value:"JPY"},{code:"CNY",name:"Chinese Yuan",symbol:"\xa5",value:"CNY"},{code:"INR",name:"Indian Rupee",symbol:"â¹",value:"INR"},{code:"CHF",name:"Swiss Franc",symbol:"CHF",value:"CHF"}];function o(e){var t;let n=a.find(t=>t.code===e);return null!==(t=null==n?void 0:n.symbol)&&void 0!==t?t:e}function r(e){var t;let n=a.find(t=>t.code===e);return null!==(t=null==n?void 0:n.name)&&void 0!==t?t:e}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GBP",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-GB";return new Intl.NumberFormat(n,{style:"currency",currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}},5526:function(e,t,n){let a;n.r(t),n.d(t,{supabase:function(){return r}});var o=n(13053);let r=null!=a?a:a=(0,o.eI)("https://ztvfzactmyvfgzqibkkv.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp0dmZ6YWN0bXl2Zmd6cWlia2t2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzIzNjczNjQsImV4cCI6MjA4Nzk0MzM2NH0.Ps8nhejSZqF_ThayTCikpKMVtcHppe6_ZWiXySdHbDU",{global:{headers:{"X-Client-Info":"portal-supabase-browser"}},auth:{flowType:"implicit",autoRefreshToken:!0,detectSessionInUrl:!1,persistSession:!0,storage:window.localStorage}})}}]);
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.