1import{b as e}from"./CzuCJjyz.js";import{Y as l,z as a,_ as t,bi as n,e as s,V as u,bj as o,bk as i,bl as r,bm as c,bn as d,bo as f,bp as m,m as p,k as g,R as v}from"#entry";import{_ as y}from"./CJTSTlNu.js";import{B as _,c as b,aG as h,aw as x,ay as k,$ as w,R as j,ap as C,aq as T,C as A,aM as V,aL as N,S,r as P,av as E,au as M,aH as U,U as I,ax as F,az as H,i as G,a0 as D,a8 as R,aQ as z,w as L}from"./nX7w3--X.js";import{a as $,V as O}from"./DUo8jQh5.js";import{V as W}from"./Ch9sftxZ.js";import{V as Y,c as B,b as K,a as q}from"./BWrehKB2.js";import{V as Q}from"./D5gjRk3K.js";import{V as X}from"./B9goy8s8.js";import{V as Z}from"./Bpq7MrYI.js";import{V as J,a as ee}from"./Ct2Z7zH4.js";import{V as le}from"./BzdmcfQK.js";import{V as ae,a as te,b as ne}from"./gjBqqy30.js";import{V as se}from"./DZ6T0PiR.js";import{V as ue}from"./CVi8ooJQ.js";import{d as oe}from"./Bo4i1EJY.js";import{u as ie}from"./inpFMjNm.js";import"./CNAuE06t.js";import"./C-u_YpPl.js";import"./CtG27aky.js";import"./CzdGDBjF.js";import"./Boy9wtnx.js";import"./Bs0o2c6W.js";import"./DeYW9Fiz.js";import"./egkXgMqP.js";import"./BCcckLnV.js";import"./CFQTgrnx.js";import"./m8SgQgoF.js";const re={class:"text-red"},ce={class:"text-red"},de=t(_({__name:"PlanSummary",setup(t){const n=l(),{currentPlan:s}=e(n),u=b({get:()=>String(Math.round(Number(s?.value?.cash_target||0))),set:e=>{s?.value&&n.updatePlanData({cash_target:`${Math.round(Number(e))}`})}}),o=b({get:()=>String(s?.value?.volunteer_target||0),set:e=>{s?.value&&n.updatePlanData({volunteer_target:`${Math.round(Number(e))}`})}});function i(e){const l=e.target;l.parentElement?.classList.toggle("edit");const a=l.nextElementSibling;a instanceof HTMLInputElement&&a.focus()}return(e,l)=>(x(),h(O,null,{default:k((()=>[w($,{class:"summary-content mt-10 mx-3"},{default:k((()=>[w(O,null,{default:k((()=>[w($,null,{default:k((()=>[...l[4]||(l[4]=[j("h4",{class:"pb-3"},"Total Giving",-1)])])),_:1})])),_:1}),w(O,null,{default:k((()=>[w($,{cols:"8",class:"align-self-center py-2"},{default:k((()=>[...l[5]||(l[5]=[j("span",null,"Goal",-1)])])),_:1}),w($,{cols:"4",class:"d-flex flex-column align-end py-2"},{default:k((()=>[j("label",{id:"tooltip-target-1",class:"cash-label",onClick:i},T(A(a)(u.value)),1),C(j("input",{id:"summary-cash-target","onUpdate:modelValue":l[0]||(l[0]=e=>u.value=e),class:S(["text-end",{"gc-wc-is-invalid":Number(u.value)<0}]),type:"number",inputmode:"decimal",min:"0",onBlur:i,onKeyup:l[1]||(l[1]=N((e=>e.target.blur()),["enter"]))},null,34),[[V,u.value,void 0,{lazy:!0}]])])),_:1})])),_:1}),w(O,null,{default:k((()=>[w($,{cols:"8",class:"align-self-center py-2"},{default:k((()=>[...l[6]||(l[6]=[j("span",null,"Planned",-1)])])),_:1}),w($,{cols:"4",class:"d-flex flex-column align-end py-2"},{default:k((()=>[j("span",null,T(A(a)(A(n).getFocusAreaTargetTotalCash)),1)])),_:1})])),_:1}),A(n).getUnallocatedCash<0?(x(),h(O,{key:0},{default:k((()=>[w($,{cols:"8",class:"align-self-center py-2"},{default:k((()=>[...l[7]||(l[7]=[j("span",{class:"text-red"},"Exceeding",-1)])])),_:1}),w($,{cols:"4",class:"d-flex flex-column align-end py-2"},{default:k((()=>[j("span",re,T(A(a)(Math.abs(A(n).getUnallocatedCash))),1)])),_:1})])),_:1})):(x(),h(O,{key:1},{default:k((()=>[w($,{cols:"8",class:"align-self-center py-2"},{default:k((()=>[...l[8]||(l[8]=[j("span",null,"Remaining",-1)])])),_:1}),w($,{cols:"4",class:"d-flex flex-column align-end py-2"},{default:k((()=>[j("span",null,T(A(a)(A(n).getUnallocatedCash)),1)])),_:1})])),_:1}))])),_:1}),w($,{class:"summary-content mt-10 mx-3"},{default:k((()=>[w(O,null,{default:k((()=>[w($,null,{default:k((()=>[...l[9]||(l[9]=[j("h4",{class:"pb-3"},"Total Volunteering",-1)])])),_:1})])),_:1}),w(O,null,{default:k((()=>[w($,{cols:"10",class:"align-self-center py-2"},{default:k((()=>[...l[10]||(l[10]=[j("span",null,"Goal",-1)])])),_:1}),w($,{cols:"2",class:"d-flex flex-column align-end py-2"},{default:k((()=>[j("label",{class:"hour-label",onClick:i},T(o.value),1),C(j("input",{id:"summary-volunteer-target","onUpdate:modelValue":l[2]||(l[2]=e=>o.value=e),class:S([{"gc-wc-is-invalid":Number(o.value)<0},"text-end"]),type:"number",inputmode:"decimal",min:"0",onBlur:i,onKeyup:l[3]||(l[3]=N((e=>e.target.blur()),["enter"]))},null,34),[[V,o.value,void 0,{lazy:!0}]])])),_:1})])),_:1}),w(O,null,{default:k((()=>[w($,{cols:"10",class:"align-self-center py-2"},{default:k((()=>[...l[11]||(l[11]=[j("span",null,"Planned",-1)])])),_:1}),w($,{cols:"2",class:"d-flex flex-column align-end py-2"},{default:k((()=>[j("span",null,T(A(n).getFocusAreaTargetTotalHours),1)])),_:1})])),_:1}),A(n).getUnallocatedHours<0?(x(),h(O,{key:0},{default:k((()=>[w($,{cols:"10",class:"align-self-center py-2"},{default:k((()=>[...l[12]||(l[12]=[j("span",{class:"text-red"},"Exceeding",-1)])])),_:1}),w($,{cols:"2",class:"d-flex flex-column align-end py-2"},{default:k((()=>[j("span",ce,T(Math.abs(A(n).getUnallocatedHours)),1)])),_:1})])),_:1})):(x(),h(O,{key:1},{default:k((()=>[w($,{cols:"10"},{default:k((()=>[...l[13]||(l[13]=[j("span",null,"Remaining",-1)])])),_:1}),w($,{cols:"2",class:"d-flex flex-column align-end py-2"},{default:k((()=>[j("span",null,T(A(n).getUnallocatedHours),1)])),_:1})])),_:1}))])),_:1})])),_:1}))}}),[["__scopeId","data-v-e1ec5f2d"]]),fe={class:"column-title"},me=["id","for"],pe=["for"],ge=["id","onUpdate:modelValue","onChange"],ve={key:2,class:"input-error"},ye=["for"],_e=["value","onChange"],be=t(_({__name:"PlanTable",props:{contributionType:{},text:{}},setup(t){const d=t,f=l(),{currentPlan:m}=e(f),p=P(!1),g=b((()=>m?.value?.focus_areas?m?.value.focus_areas.filter((e=>e.type===d.contributionType)):[])),v=b((()=>m?.value?d.contributionType===n?Number(m.value.cash_target):Number(m.value.volunteer_target):0)),y=b((()=>d.contributionType===n?f.getUnallocatedCash:f.getUnallocatedHours)),_=b((()=>d.contributionType===n?f.getFocusAreaTargetTotalCash:f.getFocusAreaTargetTotalHours)),D=b((()=>y.value>0?_.value+y.value:_.value));function R(e){return v.value>0?e/v.value:0}function z(e,l){if(!m?.value)return;const a=m.value.focus_areas.findIndex((e=>
1e.focus_area_id===l&&e.type===d.contributionType));-1!==a&&f.updatePlanData({focus_areas:[...m.value.focus_areas.slice(0,a),{...m.value.focus_areas[a],target:Math.round(Number(e)||0)},...m.value.focus_areas.slice(a+1)]})}function L(e){const l=e.target;l.parentElement?.classList.toggle("edit");const a=l.nextElementSibling;a instanceof HTMLInputElement&&(Number(a.value)<=0&&(a.value=""),a.focus())}function K(){f.openFocusAreaModal(d.contributionType)}return(e,l)=>(x(),E("div",null,[w(O,{class:"mb-3"},{default:k((()=>[w($,{cols:"9",md:"6",lg:"8"},{default:k((()=>[j("p",null,T(e.text),1)])),_:1}),w($,{cols:"3",md:"6",lg:"4",align:"end"},{default:k((()=>[C(w(s,{color:"black",class:"gc-focus-area-edit-button",flat:"","prepend-icon":"mdi-plus",rounded:"lg",onClick:K},{default:k((()=>[...l[5]||(l[5]=[j("span",{class:"d-none d-md-flex"},"ADD OR CHANGE FOCUS AREA",-1)])])),_:1},512),[[M,e.$vuetify.display.mdAndUp]]),C(w(s,{color:"black",class:"gc-focus-area-edit-button",flat:"",icon:"mdi-plus",rounded:"lg",onClick:K},null,512),[[M,e.$vuetify.display.smAndDown]])])),_:1})])),_:1}),w(O,null,{default:k((()=>[w($,{class:"pe-0 pe-sm-3"},{default:k((()=>[w(O,null,{default:k((()=>[w($,{cols:"6",sm:"5",md:"6",class:"d-flex"},{default:k((()=>[...l[6]||(l[6]=[j("span",{class:"column-title ps-4"},"Focus Area",-1)])])),_:1}),w($,{cols:"3",sm:"2",class:"d-flex justify-end justify-md-center justify-lg-end pe-lg-10"},{default:k((()=>[j("span",fe,T(e.contributionType===A(n)?"Dollars":"Hours"),1)])),_:1}),w($,{cols:"3",md:"2",class:"d-flex justify-start justify-sm-end justify-md-center"},{default:k((()=>[...l[7]||(l[7]=[j("span",{class:"column-title"},"Percent*",-1)])])),_:1}),w($,{cols:"auto",class:"d-none d-sm-flex"})])),_:1}),(x(!0),E(I,null,F(A(g),((a,t)=>(x(),h(O,{key:t,class:S(["focus-area-row justify-space-between",0===a.target&&null!==a.slug?"bg-cta-20":"bg-gc-ink-11"])},{default:k((()=>[w($,{cols:"4",class:"d-flex align-center row-name"},{default:k((()=>[H(T(a.name)+" ",1),null===a.slug?(x(),h(u,{key:0,onClick:l[0]||(l[0]=e=>p.value=!0),class:"disaster-info-icon ms-2",icon:"mdi-information",size:"small"})):U("",!0)])),_:2},1024),w($,{cols:"5",sm:"3",class:S(["d-flex justify-center flex-column",e.contributionType===A(o)?"align-end":""])},{default:k((()=>[e.contributionType===A(n)?(x(),E("label",{key:0,id:0===t?"tooltip-target-3":void 0,class:"justify-end justify-sm-space-between",for:t+e.contributionType,onClick:L},[l[8]||(l[8]=j("span",{class:"d-none d-sm-inline"},"$",-1)),H(" "+T(Number(a.target).toLocaleString("en-us")),1)],8,me)):(x(),E("label",{key:1,class:"justify-end w-50 w-lg-25",for:t+e.contributionType,onClick:L},T(Number(a.target).toLocaleString("en-us")),9,pe)),C(j("input",{id:t+e.contributionType,"onUpdate:modelValue":e=>a.target=e,type:"number",inputmode:"decimal",class:S(["text-end",Number(a.target)>=0?"":"gc-wc-is-invalid"]),onChange:()=>z(a.target,a.focus_area_id),onBlur:L,onKeyup:l[1]||(l[1]=N((e=>e.target.blur()),["enter"]))},null,42,ge),[[V,a.target]]),Number(a.target)<0?(x(),E("small",ve," Value must be 0 or greater ")):U("",!0)])),_:2},1032,["class"]),w($,{cols:"3",sm:"2",class:"d-flex justify-center flex-column percent-column ps-0 ps-sm-4"},{default:k((()=>[j("label",{for:t+e.contributionType,onClick:L,class:"overflow-hidden"},[H(T(A(i)(R(a.target)))+" ",1),l[9]||(l[9]=j("span",{class:"d-none d-sm-inline ps-2 disable-events"},"%",-1))],8,ye),j("input",{value:A(r)(R(a.target)),type:"number",inputmode:"decimal",class:"text-end",min:"0",onChange:e=>{return l=Number(e.target.value),t=a.focus_area_id,void z(function(e){return Math.ceil(e/100*v.value)}(Number(l||0)),t);var l,t},onBlur:L,onKeyup:l[2]||(l[2]=N((e=>e.target.blur()),["enter"]))},null,40,_e)])),_:2},1024),w($,{cols:"auto",class:"d-none d-sm-flex justify-end right-border"},{default:k((()=>[w(s,{class:S({hidden:!a.slug&&a.target<=0}),icon:"mdi-minus-circle-outline",size:"small",variant:"plain",onClick:e=>{return l=a.focus_area_id,void f.removeFocusArea(l);var l}},null,8,["class","onClick"])])),_:2},1024)])),_:2},1032,["class"])))),128)),A(y)>0?(x(),h(O,{key:0,class:"focus-area-row remaining"},{default:k((()=>[w($,{cols:"6",sm:"5",md:"6",xl:"5",class:"row-name"},{default:k((()=>[H(T(e.contributionType===A(n)?"Remaining Dollars":"Remaining Hours"),1)])),_:1}),w($,{cols:"3",md:"2",xl:"3",class:S([e.contributionType===A(n)?"justify-end justify-sm-center justify-xl-end pe-xl-10":"justify-end pe-sm-10","d-flex"])},{default:k((()=>[j("span",null,T(e.contributionType===A(n)?A(a)(A(y)):A(y)),1)])),_:1},8,["class"]),w($,{cols:"3",md:"2",class:"d-flex justify-end justify-sm-center"},{default:k((()=>[j("span",null,T(A(c)(R(A(y)))),1)])),_:1})])),_:1})):U("",!0),A(y)<0?(x(),h(O,{key:1,class:"focus-area-row error justify-space-between"},{default:k((()=>[w($,{class:"d-flex align-center"},{default:k((()=>[w(u,{icon:"mdi-alert",class:"exceeds-icon"}),H(" Exceeded goal totals by "+T(e.contributionType===A(n)?A(a)(Math.abs(A(y))):Math.abs(A(y)))+". Edit allocations or plan goals. ",1)])),_:1})])),_:1})):U("",!0),w(O,{class:"focus-area-row"},{default:k((()=>[w($,{cols:"6",sm:"5",md:"6",xl:"5",class:"row-name"},{default:k((()=>[...l[10]||(l[10]=[H(" Totals ",-1)])])),_:1}),w($,{cols:"3",md:"2",xl:"3",class:S(["d-flex",e.contributionType===A(n)?"justify-end justify-sm-center justify-xl-end pe-xl-10":"justify-end pe-sm-10"])},{default:k((()=>[j("span",{class:S({"text-gc-caring":A(_)>A(v)})},T(e.contributionType===A(n)?A(a)(A(D)):A(D)),3)])),_:1},8,["class"]),w($,{cols:"3",md:"2",class:"d-flex justify-end justify-sm-center"},{default:k((()=>[j("span",{class:S({"text-gc-caring":A(_)>A(v)})},T(A(c)(R(A(D)))),3)])),_:1}),w($,{cols:"auto",class:"d-none d-sm-flex"})])),_:1}),l[11]||(l[11]=j("div",{class:"d-flex justify-end"},[j("small",null,"*percentages are approximate due to rounding")],-1))])),_:1})])),_:1}),w(W,{modelValue:A(p),"onUpdate:modelValue":l[4]||(l[4]=e=>G(p)?p.value=e:null),attach:"","max-width":"548",class:"gc-info-modal"},{default:k((()=>[w(Y,{class:"pa-8 rounded-lg"},{default:k((()=>[l[13]||(l[13]=j("h2",null,"Disaster and Unplanned",-1)),l[14]||(l[14]=j("p",null," Giving Compass re
1commends allocating part of your giving and volunteering goals to unpredictable events like natural disasters and/or emergencies. You can edit these allocations at any time. If removed, values will zero-out, but remain in your plan for you to update at your convenience. ",-1)),w(B,{class:"d-flex justify-end"},{default:k((()=>[w(s,{color:"cta",rounded:"",variant:"flat",onClick:l[3]||(l[3]=e=>p.value=!1)},{default:k((()=>[...l[12]||(l[12]=[H(" GOT IT ",-1)])])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])]))}}),[["__scopeId","data-v-fabefa9e"]]),he={key:0,class:"appended-text d-none d-md-inline ms-2"},xe={key:0,class:"appended-text d-none d-md-inline ms-2"},ke="left",we="right",je=t(_({__name:"FancyToggle",props:{color:{default:"gc-gray"},defaultSelection:{default:ke},leftCallback:{type:[Function,null],default:null},leftText:{},leftTextAppend:{default:""},rightCallback:{type:[Function,null],default:null},rightText:{},rightTextAppend:{default:""}},setup(e){const l=e,a=b((()=>l.defaultSelection));function t(e){e!==a.value&&(e===ke&&l.leftCallback&&l.leftCallback(),e===we&&l.rightCallback&&l.rightCallback())}return(e,l)=>(x(),E("ul",{class:S(`${A(a)}-selected`),style:D({"--gc-fancy-toggle-color":`rgb(var(--v-theme-${e.color}))`})},[j("li",null,[w(s,{class:S(["pa-0",{"text-white":A(a)===ke}]),color:"gc-gray",flat:"",rounded:"",variant:"text",onClick:l[0]||(l[0]=e=>t(ke))},{default:k((()=>[H(T(e.leftText)+" ",1),e.leftTextAppend?(x(),E("span",he,T(e.leftTextAppend),1)):U("",!0)])),_:1},8,["class"])]),j("li",null,[w(s,{class:S(["pa-0",{"text-white":A(a)===we}]),color:"gc-gray",flat:"",rounded:"",variant:"text",onClick:l[1]||(l[1]=e=>t(we))},{default:k((()=>[H(T(e.rightText)+" ",1),e.rightTextAppend?(x(),E("span",xe,T(e.rightTextAppend),1)):U("",!0)])),_:1},8,["class"])])],6))}}),[["__scopeId","data-v-bf52da1f"]]),Ce={class:"my-8"},Te={class:"d-flex align-center mb-4"},Ae={class:"mb-4"},Ve={class:"text-medium-emphasis d-flex align-center"},Ne={key:0,class:"text-primary"},Se={class:"font-weight-bold"},Pe={key:1,class:"text-primary"},Ee={class:"font-weight-bold"},Me=t(_({__name:"NetWorth",setup(t){const n=l(),{currentPlan:s,comparisonSource:o}=e(n),i=b({get:()=>s?.value?.net_worth?.toString()||"",set:e=>{s?.value&&n.updatePlanData({net_worth:Number(e)||null})}}),r=b({get:()=>s?.value?.income?.toString()||"",set:e=>{s?.value&&n.updatePlanData({income:Number(e)||null})}}),p=b({get:()=>o?.value===d?r.value:i.value,set:e=>{o?.value===d?r.value=e:i.value=e}}),g=b({get:()=>n.$state.displayNetWorth,set:e=>{n.toggleDisplayNetWorth()}}),v=b((()=>n.getGivingRatioIncome)),y=b((()=>n.getGivingRatioNetWorth));function _(e){const l=e.target;l.parentElement?.classList.toggle("edit");const a=l.nextElementSibling;a instanceof HTMLInputElement&&(Number(a.value)<=0&&(a.value=""),a.focus())}return(e,l)=>(x(),E("div",Ce,[j("div",Te,[w(Q,{modelValue:A(g),"onUpdate:modelValue":l[0]||(l[0]=e=>G(g)?g.value=e:null),color:"primary","hide-details":"",class:"me-2"},null,8,["modelValue"]),l[3]||(l[3]=j("span",{class:"text-medium-emphasis"}," Show net worth comparison ",-1))]),A(g)?(x(),E(I,{key:0},[j("div",Ae,[j("p",Ve,[l[5]||(l[5]=H(" Enter your net worth and/
1or annual income to track giving targets and see how giving levels compare to others like you. ",-1)),w(X,{location:"right"},{activator:k((({props:e})=>[w(u,R(e,{icon:"mdi-help-circle",class:"ms-2",color:"medium-emphasis"}),null,16)])),default:k((()=>[l[4]||(l[4]=j("span",null,"Compare your giving to your net worth or annual income to understand your giving capacity.",-1))])),_:1})])]),w(O,{class:"mb-4"},{default:k((()=>[w($,{cols:"12",md:"5"},{default:k((()=>[w(je,{"left-callback":()=>A(n).setComparisonSource(A(f)),"right-callback":()=>A(n).setComparisonSource(A(d)),"left-text":"Net Worth","right-text":"Income","default-selection":A(o)===A(d)?"right":"left",color:"primary"},null,8,["left-callback","right-callback","default-selection"])])),_:1})])),_:1}),w(O,{class:"mb-4"},{default:k((()=>[w($,{cols:"12",md:"5"},{default:k((()=>[j("label",{class:"comparison-label w-100",onClick:_},T(A(p)?A(a)(A(p)):"Add "+(A(o)===A(d)?"Income":"Net Worth")),1),C(j("input",{"onUpdate:modelValue":l[1]||(l[1]=e=>G(p)?p.value=e:null),type:"number",inputmode:"decimal",class:S(["text-end w-100",{"gc-wc-is-invalid":Number(A(p))>A(m)}]),min:"0",onBlur:_,onKeyup:l[2]||(l[2]=N((e=>e.target.blur()),["enter"]))},null,34),[[V,A(p)]])])),_:1}),w($,{cols:"12",md:"7",class:"d-flex align-center"},{default:k((()=>[A(o)===A(f)&&A(p)?(x(),E("span",Ne,[l[6]||(l[6]=H(" Your giving is ",-1)),j("span",Se,T(A(c)(A(y),{fixed:1})),1),l[7]||(l[7]=H(" of your net worth. ",-1))])):U("",!0),A(o)===A(d)&&A(p)?(x(),E("span",Pe,[l[8]||(l[8]=H(" Your giving is ",-1)),j("span",Ee,T(A(c)(A(v),{fixed:1})),1),l[9]||(l[9]=H(" of your annual income. ",-1))])):U("",!0)])),_:1})])),_:1}),Number(A(i))>A(m)?(x(),h(Z,{key:0,type:"error",variant:"tonal",class:"mb-4"},{default:k((()=>[H(" Net worth exceeds maximum allowed value of "+T(A(a)(A(m)))+". ",1)])),_:1})):U("",!0),Number(A(r))>A(m)?(x(),h(Z,{key:1,type:"error",variant:"tonal",class:"mb-4"},{default:k((()=>[H(" Income exceeds maximum allowed value of "+T(A(a)(A(m)))+". ",1)])),_:1})):U("",!0)],64)):U("",!0)]))}}),[["__scopeId","data-v-da966b3a"]]),Ue={class:"pa-4"},Ie={class:"text-body-1 mb-0"},Fe={class:"d-flex justify-end"},He={class:"text-caption font-weight-bold"},Ge=t(_({__name:"FocusAreaSelectionModal",setup(a){const t=z(),n=l(),{currentPlan:o,focusAreas:i,focusAreaModal:r}=e(n),c=P([]),d=P([]),f=b({get:()=>r.value.isOpen,set:e=>{e||n.closeFocusAreaModal()}}),m=b((()=>r.value.type)),g=b((()=>c.value.length>=5)),v=b((()=>i.value.filter((e=>e.display)).map((e=>e.id)))),y=b((()=>i.value.sort(((e,l)=>e.parent===l.parent?0:e.parent?1:-1)).reduce(((e,l)=>{if(!l.display)return e;if(!l.parent)return[...e,{...l,children:[]}];const a=e.findIndex((e=>e.id===l.parent));return-1!==a&&e[a].children.push(l),e}),[]).map((e=>({...e,children:e.children.sort(((e,l)=>e.name.localeCompare(l.name)))}))).sort(((e,l)=>e.children.length>4&&l.children.length>4||e.children.length<5&&l.children.length<5?e.name.localeCompare(l.name):l.children.length-e.children.length)))),_=b((()=>y.value.reduce(((e,l)=>{const a=l.children.map((e=>e.id));if(c.value.includes(l.id))return[...e,...a];const t=[...e,...a.filter((e=>g.value&&!c.value.includes(e)))];return g.value&&!c.value.includes(l.id)&&t.push(l.id),t}),[])));function C(){c.value=[...d.value],n.closeFocusAreaModal()}function V(e,l=!1){const a=c.value.indexOf(e);if(-1===a){if(!_.value.includes(e)){if(l){const l=y.value.find((l=>l.id===e));if(l){const e=l.children.map((e=>e.id));c.value=c.value.filter((l=>!e.includes(l)))}}c.value.push(e)}}else c.value.splice(a,1)}function N(){if(!o?.value)return;const e=[...o.value.focus_areas.filter((e=>!e.slug||e.type!==m.value)),...c.value.map((e=>{const l=o.value.focus_areas.find((l=>l.focus_area_id===e&&l.type===m.value));if(l)return l;const a=i.value.find((l=>l.id===e));if(!a)throw new Error(`Focus area ${e} not found`);return{focus_area_id:e,name:a.name,plan_id:o.value.id,slug:a.slug||null,target:0,type:m.value}}))];n.updatePlanData({focus_areas:e}),n.closeFocusAreaModal()}return L([()=>r.value.isOpen,()=>r.value.type],(([e,l])=>{e&&l&&o?.value&&(c.value=[],d.value=[],o.value.focus_areas.filter((e=>
1e.type===m.value)).forEach((e=>{!c.value.includes(e.focus_area_id)&&v.value.includes(e.focus_area_id)&&(c.value.push(e.focus_area_id),d.value.push(e.focus_area_id))})))})),(e,l)=>A(r).type?(x(),h(W,{key:0,modelValue:A(f),"onUpdate:modelValue":l[0]||(l[0]=e=>G(f)?f.value=e:null),fullscreen:A(t).mdAndDown.value,scrollable:""},{default:k((()=>[w(Y,{"min-height":"600px"},{default:k((()=>[w(J,{color:"primary",density:"comfortable"},{default:k((()=>[w(ee,null,{default:k((()=>[...l[1]||(l[1]=[H("Select Focus Areas",-1)])])),_:1}),w(le),w(s,{onClick:C,icon:""},{default:k((()=>[w(u,null,{default:k((()=>[...l[2]||(l[2]=[H("mdi-close",-1)])])),_:1})])),_:1})])),_:1}),j("div",Ue,[j("p",Ie," Select up to 5 focus areas (causes) where you want to "+T("CASH"===A(m)?"give":"volunteer")+". After saving, we'll create a personalized Action Plan to connect you with "+T("CASH"===A(m)?"nonprofits, articles, and more.":"volunteer opportunities."),1),j("div",Fe,[j("span",He,T(A(c).length)+" of "+T(5),1)])]),w(K,{class:"pa-4"},{default:k((()=>[w(p,{fluid:""},{default:k((()=>[w(O,null,{default:k((()=>[(x(!0),E(I,null,F(A(y),(e=>(x(),h($,{key:e.id,cols:"12",sm:"6",md:"4",lg:"3"},{default:k((()=>[w(Y,{variant:"flat"},{default:k((()=>[w(q,{class:"text-subtitle-1 font-weight-bold"},{default:k((()=>[H(T(e.name),1)])),_:2},1024),w(ae,{density:"comfortable",class:"bg-transparent"},{default:k((()=>[(x(!0),E(I,null,F(e.children,(e=>(x(),h(te,{key:e.id,disabled:A(_).includes(e.id),active:A(c).includes(e.id),onClick:l=>V(e.id)},{prepend:k((()=>[w(se,{"model-value":A(c).includes(e.id),disabled:A(_).includes(e.id),density:"compact",color:"primary"},null,8,["model-value","disabled"])])),default:k((()=>[w(ne,null,{default:k((()=>[H(T(e.name),1)])),_:2},1024)])),_:2},1032,["disabled","active","onClick"])))),128)),"other"!==e.slug?(x(),h(te,{key:0,disabled:A(_).includes(e.id),active:A(c).includes(e.id),onClick:l=>V(e.id,!0)},{prepend:k((()=>[w(se,{"model-value":A(c).includes(e.id),disabled:A(_).includes(e.id),density:"compact",color:"primary"},null,8,["model-value","disabled"])])),default:k((()=>[w(ne,null,{default:k((()=>[H("All "+T(e.name),1)])),_:2},1024)])),_:2},1032,["disabled","active","onClick"])):U("",!0)])),_:2},1024)])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1})])),_:1}),w(ue),w(B,{class:"pa-4"},{default:k((()=>[w(le),w(s,{variant:"text",onClick:C},{default:k((()=>[...l[3]||(l[3]=[H(" Cancel ",-1)])])),_:1}),w(s,{color:"primary",onClick:N},{default:k((()=>[...l[4]||(l[4]=[H(" Save ",-1)])])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue","fullscreen"])):U("",!0)}}),[["__scopeId","data-v-798cd4e3"]]),De=t(_({__name:"edit",setup(a){oe({name:v.EditPlan});const{setSEO:t}=ie();t({title:"Edit Giving Plan",description:"Edit your personalized giving goals and philanthropic plan. Adjust your charitable commitments and impact objectives.",noIndex:!0});const n=g(),o=l(),{currentPlan:i}=e(o),r=P(!1),c=P(!1),d=P(!1),f=b((()=>{const e=document.querySelectorAll("input.gc-wc-is-invalid");return!(e&&e.length>0)&&(i?.value?.net_worth||0)<=m&&(i?.value?.income||0)<=m&&o.planChanged}));function _(){f.value?r.value=!0:C()}function C(){n.push({name:v.GivingGoals})}async function V(){d.value=!0;try{await o.savePlan()}finally{d.value=!1}}function N(){c.value=!0,C()}return(e,l)=>(x(),E(I,null,[w(p,{class:"ml-0 max-page-width"},{default:k((()=>[w(y,{"error-id":"updatePlan"},{default:k((e=>[w(K,{class:"font-weight-bold"},{default:k((()=>[j("p",null,T(e.error.message),1),j("ul",null,[(x(!0),E(I,null,F(e.error.data,(e=>(x(),E("li",{key:e.message,class:"ms-6"},T(e.message),1)))),128))])])),_:2},1024)])),_:1}),A(i)&&!A(i).current_year?(x(),h(Y,{key:0,color:"warning",class:"mb-4"},{default:k((()=>[w(K,{class:"d-flex align-center"},{default:k((()=>[w(u,{icon:"mdi-alert-circle",class:"me-2"}),l[2]||(l[2]=j("span",null,"You are editing an old plan.",-1))])),_:1})])),_:1})):U("",!0),w(O,null,{default:k((()=>[w($,null,{default:k((()=>[j("h1",null,"Edit My "+T(A(i)?.plan_year)+" Plan",1),l[3]||(l[3]=j("p",null,"Set your giving and volunteering goals for the year. Then, add and allocate to focus areas (causes) that matter to you. We'll create a personalized Action Plan to connect you with nonprofits, articles, and more.",-1)),l[4]||(l[4]=j("h2",{class:"mt-6"},"Plan My Goal",-1)),l[5]||(l[5]=j("p",null,"You can tailor your giving plan to your personal goals now and in the future.",-1)),w(de)])),_:1})])),_:1}),w(O,null,{default:k((()=>[w($,null,{default:k((()=>[...l[6]||(l[6]=[j("h3",{class:"gc-wc-subtitle"}," Plan My Giving ",-1)])])),_:1})])),_:1}),w(be,{"contribution-type":"CASH",text:"Add up to five focus areas, then edit your giving dollars or percentage to prioritize your giving."}),w(O,null,{default:k((()=>[w($,null,{default:k((()=>[...l[7]||(l[7]=[j("h3",{class:"gc-wc-subtitle"}," Plan My Volunteering ",-1)])])),_:1})])),_:1}),w(be,{"contribution-type":"VOLUNTEER",text:"Add up to five focus areas, then edit your volunteering hours or percentage to prioritize your time."}),w(Me),w(O,{class:"d-flex justify-end mb-3"},{default:k((()=>[w(s,{class:"me-2",color:"primary",variant:"text",onClick:_},{default:k((()=>[...l[8]||(l[8]=[H(" Cancel ",-1)])])),_:1}),w(s,{color:"primary",disabled:A(o).hasExceededContributionTarget||!A(f),loading:A(d),onClick:V},{default:k((()=>[...l[9]||(l[9]=[H(" Save Plan ",-1)])])),_:1},8,["disabled","loading"])])),_:1})])),_:1}),w(Ge),w(W,{modelValue:A(r),"onUpdate:modelValue":l[1]||(l[1]=e=>G(r)?r.value=e:null),"max-width":"548"},{default:k((()=>[w(Y,{class:"pa-4"},{default:k((()=>[w(q,null,{default:k((()=>[...l[10]||(l[10]=[H("You have unsaved changes.",-1)])])),_:1}),w(K,null,{default:k((()=>[...l[11]||(l[11]=[j("p",null,"Are you sure you want to leave?",-1)])])),_:1}),w(B,null,{default:k((()=>[w(le),w(s,{color:"warning",onClick:N,variant:"text",rounded:""},{default:k((()=>[...l[12]||(l[12]=[H(" Leave Page ",-1)])])),_:1}),w(s,{color:"primary",variant:"text",rounded:"",onClick:l[0]||(l[0]=e=>r.value=!1)},{default:k((()=>[...l[13]||(l[13]=[H(" Return to Editing ",-1)])])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])],64))}}),[["__scopeId","data-v-4a2eaa84"]]);export{De as default};
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.