1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5277],{86262:function(e,t,n){var o=n(85893),l=n(20929),r=n(36808),i=n.n(r),d=n(39666),a=n(20299),s=n(59888),u=n(94205);let c=e=>{let{type:t,customImage:n}=e;return n?(0,o.jsx)(o.Fragment,{children:n}):(0,o.jsx)("svg",{className:"block text-brand-lighter text-center fill-current h-12 w-12 overflow-visible",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M19.511 17.98L10.604 1.348a.697.697 0 0 0-1.208 0L.49 17.98a.675.675 0 0 0 .005.68c.125.211.352.34.598.34h17.814a.694.694 0 0 0 .598-.34.677.677 0 0 0 .006-.68zM11 17H9v-2h2v2zm0-3.5H9V7h2v6.5z"})})};t.Z=e=>{var t,n;let{type:r,title:v,message:p,addContactInfo:m=!0,customImage:h,hideImage:f,tryAgain:g,errorInfo:b,errorCode:y,showSignout:x=!1,...w}=e,{supportEmail:_}=(0,u.Z)();404!=y&&"Not logged in!"!==b&&(null===(n=window)||void 0===n?void 0:null===(t=n.location)||void 0===t?void 0:t.hostname)!=="localhost"&&l.fy.logger.error("User encountered the following error: ".concat(p),{details:{message:p,errorInfo:b,errorCode:y}});let{resetClient:k}=(0,a.X)();return(0,o.jsxs)("div",{className:"flex flex-col m-12 items-center py-4 px-2 border rounded shadow-md",children:[f?null:(0,o.jsx)(c,{type:r,customImage:h}),(0,o.jsx)("div",{className:"text-brand text-xl font-medium my-2",children:v}),(0,o.jsx)("div",{className:"text-oldGray-600",children:p}),x&&(0,o.jsx)("div",{children:(0,o.jsx)("button",{className:"text-brand my-4 font-semibold underline",onClick:()=>{i().remove("token"),i().remove("isPlanner"),k(),(0,d.e)(e=>e.setUser(null)),(0,s.Z)("/signin")},children:"Click here to sign out"})}),m&&_&&(0,o.jsxs)("div",{className:"text-oldGray-600 mt-1",children:[g&&"Try again or ","Contact"," ",(0,o.jsx)("a",{className:"text-brand",href:"mailto:".concat(_),children:_})," ","for help"]}),g&&!m&&(0,o.jsx)("div",{className:"text-oldGray-600 mt-1",children:"Please try again later."})]})}},79074:function(e,t,n){var o=n(85893),l=n(67294),r=n(5865),i=n(16722),d=n(56066),a=n(46488);let s=r.hj.create({name:"PresetRecommendations",addOptions:()=>({commands:[],filterCommands:(e,t)=>e.filter(e=>{var n,o;return null==e?void 0:null===(o=e.title)||void 0===o?void 0:null===(n=o.toLowerCase())||void 0===n?void 0:n.includes(null==t?void 0:t.toLowerCase())}),component:null,suggestion:{char:"/",startOfLine:!0}}),addProseMirrorPlugins(){return[(0,i.ZP)({editor:this.editor,...this.options.suggestion,items:e=>{let{query:t}=e;return this.options.filterCommands(this.options.commands,t)},command:e=>{let{editor:t,range:n,props:o}=e;o.command({editor:t,range:n})},render:()=>{let e,t;return{onStart:n=>{e=new d.M_(u,{editor:n.editor,props:{...n,component:this.options.component}}),t=(0,a.ZP)("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:n=>{e.updateProps({...n,component:this.options.component}),t[0]&&t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(t){var n;return null==e?void 0:null===(n=e.ref)||void 0===n?void 0:n.onKeyDown(t)},onExit(){t[0]&&t[0].destroy(),e.destroy()}}}})]}});class u extends l.Component{onKeyDown(e){let{event:t}=e;return"ArrowUp"===t.key?(this.upHandler(),!0):"ArrowDown"===t.key?(this.downHandler(),!0):"Enter"===t.key&&(this.enterHandler(),!0)}upHandler(){this.setState({selectedIndex:(this.state.selectedIndex+this.props.items.length-1)%this.props.items.length})}downHandler(){this.setState({selectedIndex:(this.state.selectedIndex+1)%this.props.items.length})}enterHandler(){this.selectItem(this.state.selectedIndex)}selectItem(e){let t=this.props.items[e];t&&this.props.command(t),(0,a.Bn)()}componentDidUpdate(e,t){e.items.length!==this.props.items.length&&this.setState({selectedIndex:0})}render(){let{items:e,component:t}=this.props,{selectedIndex:n}=this.state;return(0,o.jsx)(t,{items:e,selectedIndex:n,selectItem:this.selectItem})}constructor(){super(),this.state={selectedIndex:0},this.selectItem=this.selectItem.bind(this)}}t.Z=s},82502:function(e,t,n){var o=n(85893);n(67294);var l=n(74931);t.Z=e=>{if(null===e.helpLink||void 0===e.helpLink)return null;let t=void 0!==e.helpLink.mode?e.helpLink.mode:"BEACON";return(0,o.jsx)("div",{className:"".concat(void 0===e.positionStyle?"absolute top-0 right-0 p-1":e.positionStyle),children:(0,o.jsxs)("a",{className:"flex flex-row items-center cursor-pointer",href:"BEACON"===t?void 0:e.helpLink.href,onClick:"BEACON"===t?()=>{try{Beacon("article",e.helpLink.articleID,{type:"modal"})}catch(e){(null==e?void 0:e.message)==="Beacon is not defined"&&l.ZP.error("Help popup blocked by ad-blocker.\nPlease disable ad-blocker or visit help.adviice.ca",{duration:7e3})}}:void 0,target:"BEACON"===t?void 0:"".concat(!0===e.helpLink.redirect?"_self":"_blank"),children:[(0,o.jsx)("span",{children:e.text}),(0,o.jsx)("svg",{className:"overflow-show inline-block p-1 fill-current text-brand opacity-75 h-8 w-8",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",children:(0,o.jsx)("path",{d:"M9.45 16h2.1v-2h-2.1v2zM10.5 0C4.704 0 0 4.48 0 10s4.704 10 10.5 10S21 15.52 21 10 16.296 0 10.5 0zm0 18c-4.6305 0-8.4-3.59-8.4-8s3.7695-8 8.4-8c4.6305 0 8.4 3.59 8.4 8s-3.7695 8-8.4 8zm0-14C8.1795 4 6.3 5.79 6.3 8h2.1c0-1.1.945-2 2.1-2 1.155 0 2.1.9 2.1 2 0 2-3.15 1.75-3.15 5h2.1c0-2.25 3.15-2.5 3.15-5 0-2.21-1.8795-4-4.2-4z"})})]})})}},14201:function(e,t,n){n.d(t,{Z:function(){return Z}});var o=n(37340),l=n(85893),r=n(67294),i=n(26997),d=n(92432),a=n(36808),s=n.n(a),u=n(23824),c=n(74931),v=n(39666);function p(){let e=(0,o._)(["\n mutation ($action: String, $reportSlug: UUID, $metaData: GenericScalar, $section: String) {\n reportMutation(action: $action, reportSlug: $reportSlug, metaData: $metaData, section: $section) {\n ok\n message\n status\n report {\n slug\n publishedAt\n createdAt\n updatedAt\n }\n }\n }\n"]);return p=function(){return e},e}function m(){let e=(0,o._)(["\n mutation ($action: String, $reportSlug: UUID, $blockSlug: UUID, $content: String) {\n reportContentBlockMutation(action: $action, reportSlug: $reportSlug, blockSlug: $blockSlug, content: $content) {\n ok\n message\n status\n }\n }\n"]);return m=function(){return e},e}function h(){let e=(0,o._)(["\n mutation ($section: String) {\n sendPlannerReportEmail(section: $section) {\n ok\n status\n message\n }\n }\n"]);return h=function(){return e},e}let f=(0,i.Ps)(p()),g=(0,i.Ps)(m()),b=(0,i.Ps)(h());var y=e=>{let{reportType:t,selectedReport:n,setSlug:o,slug:r,refetchReportsList:i,hasChanges:a,setHasChanges:s,editor:u,...p}=e,[,m]=(0,d.Db)(f),[,h]=(0,d.Db)(g),[y,x]=(0,d.Db)(b),w=async()=>{var e,o;let l=c.ZP.loading("Publishing report");(null===(o=(await m({action:"publish",section:t,reportSlug:n.slug},{additionalTypenames:["ReportType"]})).data)||void 0===o?void 0:null===(e=o.reportMutation)||void 0===e?void 0:e.ok)?c.ZP.success("Report published!",{id:l}):c.ZP.error("Error publishing report",{id:l})},_=async()=>{try{var e,t,o,l;let r=null==u?void 0:u.getHTML(),i=null==n?void 0:null===(t=n.reportContentBlocks)||void 0===t?void 0:null===(e=t[0])||void 0===e?void 0:e.slug,d=await h({action:"save",reportSlug:null==n?void 0:n.slug,blockSlug:i,content:r});(null===(l=d.data)||void 0===l?void 0:null===(o=l.reportContentBlockMutation)||void 0===o?void 0:o.ok)?s(!1):c.ZP.error("Error saving report")}catch(e){console.warn(e),(0,v.Tb)(e)}};return(0,l.jsxs)("div",{className:"flex flex-col md:flex-row print:hidden flex-grow",children:[(0,l.jsx)("button",{disabled:null===n||""===r||null!==n.publishedAt,className:"btn text-brand border rounded hover:bg-brand hover:text-white w-full md:w-auto mt-2 md:mt-0 md:ml-2",onClick:async()=>{confirm("Are you sure you want to publish this draft report?")&&(a&&await _(),await w())},children:"Publish Report"}),(0,l.jsx)("button",{disabled:null===n||""===r||null===n.publishedAt,onClick:async()=>{var e,n;let o=await x({section:t},{additionalTypenames:["UserType"]});(null==o?void 0:null===(n=o.data)||void 0===n?void 0:null===(e=n.sendPlannerReportEmail)||void 0===e?void 0:e.ok)===!0&&c.ZP.success("Email sent!")},className:"btn md:rounded text-brand btn border md:w-auto mt-2 md:mt-0 md:ml-2 hover:bg-brand hover:text-white",type:"button",children:"Send Email"}),(0,l.jsx)("button",{className:"btn text-brand border rounded hover:bg-brand hover:text-white w-full md:w-auto mt-2 md:mt-0 md:ml-2",onClick:async()=>{var e,n,l,r,d,a,u,v,p;let h=await m({action:"create",section:t},{additionalTypenames:["ReportType","ReportType[]"]});(null==h?void 0:null===(n=h.data)||void 0===n?void 0:null===(e=n.reportMutation)||void 0===e?void 0:e.ok)?(o(null!==(a=null==h?void 0:null===(d=h.data)||void 0===d?void 0:null===(r=d.reportMutation)||void 0===r?void 0:null===(l=r.report)||void 0===l?void 0:l.slug)&&void 0!==a?a:""),i(),s(!1)):c.ZP.error(null!==(p=null==h?void 0:null===(v=h.data)||void 0===v?void 0:null===(u=v.reportMutation)||void 0===u?void 0:u.message)&&void 0!==p?p:"Error creating report")},children:"Create Report"}),(0,l.jsx)("button",{disabled:null===n||""===r,className:"btn text-brand border rounded hover:bg-red-700 hover:text-white w-full md:w-auto mt-2 md:mt-0 md:ml-2",onClick:async()=>{var e,l,r,i,d,a;let u=n.publishedAt?"Are you sure you want to delete the Report Published: ".concat(null!==(e=n.publishedAt)&&void 0!==e?e:"Unpublished","?"):"Are you sure you want to delete this draft report?";if(confirm(u)){let e=await m({action:"delete",section:t,reportSlug:n.slug},{additionalTypenames:["ReportType"]});(null==e?void 0:null===(r=e.data)||void 0===r?void 0:null===(l=r.reportMutation)||void 0===l?void 0:l.ok)===!1&&c.ZP.error(null!==(a=null==e?void 0:null===(d=e.data)||void 0===d?void 0:null===(i=d.reportMutation)||void 0===i?void 0:i.message)&&void 0!==a?a:"Unable to delete report"),o(""),s(!1)}},children:"Delete Report"}),(0,l.jsx)("button",{disabled:null===n||""===r,onClick:_,tabIndex:1,className:"block ml-auto btn border rounded w-full md:w-auto mt-2 md:mt-0 ".concat(a?"border-brand text-white bg-brand hover:bg-brand-dark":"border-oldGray-600 text-oldGray-600 hover:bg-oldGray-400 bg-white"),children:a?"Save Changes":"Changes Saved"})]})},x=n(22075),w=n(91333),_=n(11163),k=n.n(_),C=n(94205);function j(){let e=(0,o._)(["\n query ($section: String!) {\n me {\n family {\n responseId\n recommendationCommands(section: $section)\n }\n }\n company {\n id\n slug\n }\n }\n"]);return j=function(){return e},e}function S(){let e=(0,o._)(["\n query ($reportType: String!, $reportSlug: String!) {\n report(reportType: $reportType, reportSlug: $reportSlug) {\n slug\n publishedAt\n createdAt\n updatedAt\n reportContentBlocks {\n slug\n content\n }\n }\n }\n"]);return S=function(){return e},e}function T(){let e=(0,o._)(["\n query ($reportType: String!) {\n reportsList(reportType: $reportType) {\n slug\n publishedAt\n createdAt\n updatedAt\n }\n }\n"]);return T=function(){return e},e}let A=(0,i.Ps)(j()),N=(0,i.Ps)(S()),P=(0,i.Ps)(T());var Z=e=>{var t,n,o,i,a,c,v,p,m,h,f,g,b,_,j,S;let{reportType:T,hasChanges:Z,setHasChanges:L,...M}=e,{companySlug:R}=(0,C.Z)(),[$,I]=(0,r.useState)(""),[E,D]=(0,r.useState)(null);s().get("isPlanner");let[U]=(0,d.aM)({query:A,variables:{section:T},requestPolicy:"network-only"}),[H]=(0,d.aM)({query:N,variables:{reportType:T,reportSlug:$},requestPolicy:"network-only",pause:""===$}),[B,q]=(0,d.aM)({query:P,variables:{reportType:T},requestPolicy:"network-only"});if((0,r.useEffect)(()=>
1{if(!B.fetching){var e,t,n,o;let l=null===(t=B.data)||void 0===t?void 0:null===(e=t.reportsList)||void 0===e?void 0:e.sort(w.z);I(null!==(o=null==l?void 0:null===(n=l[0])||void 0===n?void 0:n.slug)&&void 0!==o?o:"")}},[B,I]),(0,r.useEffect)(()=>{let e=e=>{Z&&(e.preventDefault(),e.returnValue="")},t=()=>{if(Z&&!confirm("Changes you made may not be saved."))throw k().events.emit("routeChangeError"),"Unsaved report navigation abort, can safely ignore. NextJS needs this throw for aborting the route change"};return window.addEventListener("beforeunload",e),k().events.on("routeChangeStart",t),()=>{window.removeEventListener("beforeunload",e),k().events.off("routeChangeStart",t)}},[Z]),U.fetching||H.fetching||B.fetching)return null;let z=!1;return"final_plan"===T&&(z=!0),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsxs)("div",{className:"flex flex-col space-y-4 md:space-y-0 md:flex-row md:items-center mb-4",children:[(0,l.jsx)(u.Z,{reportType:T,slug:$,setSlug:I,reportsList:null!==(b=null==B?void 0:null===(t=B.data)||void 0===t?void 0:t.reportsList)&&void 0!==b?b:[],setHasChanges:L}),(0,l.jsx)(y,{reportType:T,selectedReport:null!==(_=null==H?void 0:null===(n=H.data)||void 0===n?void 0:n.report)&&void 0!==_?_:null,setSlug:I,slug:$,refetchReportsList:q,hasChanges:Z,setHasChanges:L,editor:E})]}),(null==B?void 0:null===(i=B.data)||void 0===i?void 0:null===(o=i.reportsList)||void 0===o?void 0:o.length)===0?(0,l.jsx)("div",{className:"bg-oldGray-100 shadow rounded border p-10 text-center",children:(0,l.jsx)("div",{children:'Click "Create Report" to create your first report.'})}):(0,l.jsx)(l.Fragment,{children:(null==H?void 0:null===(a=H.data)||void 0===a?void 0:a.report)!==void 0&&(0,l.jsx)(x.Z,{reportType:T,selectedReport:null!==(j=null==H?void 0:null===(c=H.data)||void 0===c?void 0:c.report)&&void 0!==j?j:null,readOnly:!1,recommendationCommands:null!==(S=null==U?void 0:null===(m=U.data)||void 0===m?void 0:null===(p=m.me)||void 0===p?void 0:null===(v=p.family)||void 0===v?void 0:v.recommendationCommands)&&void 0!==S?S:[],hasChanges:Z,setHasChanges:L,setEditor:D,context:{company_slug:R,family_response_id:null==U?void 0:null===(g=U.data)||void 0===g?void 0:null===(f=g.me)||void 0===f?void 0:null===(h=f.family)||void 0===h?void 0:h.responseId,report_type:z?"planning":"foundation",report_slug:$}})})]})}},23824:function(e,t,n){var o=n(85893);n(67294);var l=n(91333),r=n(42298),i=n(23855);t.Z=e=>{let{reportsList:t,reportType:n,slug:d,setSlug:a,setHasChanges:s,...u}=e;return(0,o.jsx)("div",{className:"print:hidden",children:(0,o.jsxs)("select",{className:"form-select brand-dropdown md:w-auto h-[42px]",name:"selectedSlug",value:d,onChange:e=>{a(e.target.value),s(!1)},children:[(null==t?void 0:t.length)===0&&(0,o.jsx)("option",{disabled:!0,children:"No Reports Found"}),(0,o.jsx)("option",{value:"",disabled:!0,hidden:!0,children:"Select Report"}),null==t?void 0:t.sort(l.z).map(e=>(0,o.jsx)("option",{value:e.slug,children:e.publishedAt?(0,r.Z)((0,i.Z)(e.publishedAt),"yyyy-MM-dd"):"Unpublished Report"},e.slug))]})})}},22075:function(e,t,n){var o=n(85893),l=n(67294),r=n(56066),i=n(23621),d=n(22773),a=n(20752),s=n(81677),u=n(96279),c=n(57672),v=n(29762),p=n(19675),m=n(54633),h=n(40038),f=n(39445),g=n(26761),b=n(9305),y=n(79074),x=n(93237);t.Z=e=>{var t,n,w,_,k,C,j,S,T,A,N,P,Z,L,M;let{reportType:R,selectedReport:$,readOnly:I,recommendationCommands:E=[],hasChanges:D=!1,setHasChanges:U=()=>{},setEditor:H=()=>{},context:B={},enableUploadImage:q=!0,...z}=e,{state:G}=(0,h.Z)(),O=e=>{D||U(!0)},F=(0,l.useMemo)(()=>{var e,t,n;let o=[];for(let l of Object.keys(null!==(e=null==G?void 0:G.reportScenarioInfo)&&void 0!==e?e:{})){let e=null!==(n=null==G?void 0:null===(t=G.reportScenarioInfo)||void 0===t?void 0:t[l])&&void 0!==n?n:{};o.push({id:e.id,name:e.name,description:e.description,locked_at:e.locked_at,base_scenario:e.base_scenario})}return o},[null==G?void 0:G.reportScenarioInfo]),V=(0,l.useMemo)(()=>(null==E?void 0:E.sort((e,t)=>e.order-t.order))||[],[E]),K=(0,l.useMemo)(()=>{let e=[];return V.forEach(t=>{e.push("".concat(t.html))}),e.join(" ")},[V]),J=(0,l.useMemo)(()=>{var e,t,n,o,l,r;return{primary:null!==(Z=null==G?void 0:null===(n=G.me)||void 0===n?void 0:null===(t=n.family)||void 0===t?void 0:null===(e=t.primaryProfileData)||void 0===e?void 0:e.profile__name__primary)&&void 0!==Z?Z:"Primary User",secondary:null!==(L=null==G?void 0:null===(r=G.me)||void 0===r?void 0:null===(l=r.fam
1ily)||void 0===l?void 0:null===(o=l.secondaryProfileData)||void 0===o?void 0:o.profile__name__secondary)&&void 0!==L?L:"Secondary User"}},[null==G?void 0:null===(w=G.me)||void 0===w?void 0:null===(n=w.family)||void 0===n?void 0:null===(t=n.primaryProfileData)||void 0===t?void 0:t.profile__name__primary,null==G?void 0:null===(C=G.me)||void 0===C?void 0:null===(k=C.family)||void 0===k?void 0:null===(_=k.secondaryProfileData)||void 0===_?void 0:_.profile__name__secondary]),W=(0,l.useCallback)(e=>{var t,n;p.cc.showModal(m.Z,{scenarios:F,editor:e,userNames:J,isCoupleFamily:(null==G?void 0:null===(n=G.me)||void 0===n?void 0:null===(t=n.family)||void 0===t?void 0:t.familyType)==="COUPLE"})},[F,J,null==G?void 0:null===(S=G.me)||void 0===S?void 0:null===(j=S.family)||void 0===j?void 0:j.familyType]),X=(0,l.useMemo)(()=>{let e=[s.Z.configure({bulletList:{HTMLAttributes:{class:"list-disc pl-10"}},orderedList:{HTMLAttributes:{class:"list-decimal pl-10"}},undoRedo:{depth:100,newGroupDelay:500},horizontalRule:{HTMLAttributes:{class:"print:break-after-page print:invisible ".concat(I?"invisible":"")}}}),x.Z.configure({placeholder:"Type / to bring up a list of report presets."}),a.N,a.A,i.Bf,i.pn,i.Il,g.ZP.configure({allowBase64:!0}),u.Z.configure({types:["heading","paragraph"]}),d.iA.configure({resizable:!0}),d.SC,d.xD,d.pj,v.Z,f.Z];return I||e.push(y.Z.configure({commands:[{title:"Add Chart/Table",command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).run(),W(t)}},{title:"ALL",command:e=>{let{editor:t,range:n}=e;t.chain().focus().deleteRange(n).insertContent(K).run()}},...V.map(e=>({title:e.name,command:t=>{let{editor:n,range:o}=t;n.chain().focus().deleteRange(o).insertContent(e.html).run()}}))],component:b.Z})),e},[K,I,F,V,null==G?void 0:null===(A=G.me)||void 0===A?void 0:null===(T=A.family)||void 0===T?void 0:T.familyType,J]),Y=(0,r.jE)({editable:!I,extensions:X,immediatelyRender:!1,content:null!==(M=null==$?void 0:null===(P=$.reportContentBlocks)||void 0===P?void 0:null===(N=P[0])||void 0===N?void 0:N.content)&&void 0!==M?M:"",onUpdate:e=>{let{editor:t}=e;O(t)},onCreate:e=>{let{editor:t}=e;H(t)},editorProps:{attributes:{class:"p-1 outline-none ".concat(I?"h-fit tiptap-view":"h-[70vh]")}}},[]);return((0,l.useEffect)(()=>{let e;if(!D)return Y&&(e=setTimeout(()=>{var e,t,n;Y.commands.setContent(null!==(n=null==$?void 0:null===(t=$.reportContentBlocks)||void 0===t?void 0:null===(e=t[0])||void 0===e?void 0:e.content)&&void 0!==n?n:"")}),U(!1)),()=>clearTimeout(e)},[$]),null===$)?null:null===Y?(0,o.jsxs)("div",{className:"flex flex-col h-screen -mt-15 justify-center items-center",children:[(0,o.jsx)("div",{children:(0,o.jsxs)("svg",{className:"animate-spin h-10 w-10 text-brand",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,o.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,o.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),(0,o.jsx)("div",{className:"text-sm text-brand font-medium mt-1",children:"Loading"})]}):(0,o.jsxs)("div",{className:"mt-4 overflow-hidden ".concat(I?"":"border rounded"),children:[!I&&(0,o.jsx)("div",{className:"p-1 border-b overflow-hidden",children:(0,o.jsx)(c.Z,{editor:Y,menuExtras:[],context:B,enableUploadImage:q,addChartTable:W})}),(0,o.jsx)("div",{className:"p-1 bg-white overflow-auto",children:(0,o.jsx)(r.kg,{editor:Y})})]})}},4722:function(e,t,n){var o=n(37340),l=n(85893),r=n(67294),i=n(26997),d=n(92432),a=n(23824),s=n(91333),u=n(22075);function c(){let e=(0,o._)(["\n query ($reportType: String!, $reportSlug: String!) {\n report(reportType: $reportType, reportSlug: $reportSlug) {\n slug\n publishedAt\n createdAt\n updatedAt\n reportContentBlocks {\n slug\n content\n }\n }\n }\n"]);return c=function(){return e},e}function v(){let e=(0,o._)(["\n query ($reportType: String!) {\n reportsList(reportType: $reportType) {\n slug\n publishedAt\n createdAt\n updatedAt\n }\n }\n"]);return v=function(){return e},e}let p=(0,i.Ps)(c()),m=(0,i.Ps)(v());t.Z=e=>{var t,n,o,i,c,v,h,f;let{reportType:g,...b}=e,[y,x]=(0,r.useState)(""),[w,_]=(0,d.aM)({query:p,variables:{reportType:g,reportSlug:y},requestPolicy:"network-only",pause:""===y}),[k]=(0,d.aM)({query:m,variables:{reportType:g},requestPolicy:"network-only"});(0,r.useEffect)(()=>
1{if(!k.fetching){var e,t,n,o;let l=null===(t=k.data)||void 0===t?void 0:null===(e=t.reportsList)||void 0===e?void 0:e.sort(s.z);x(null!==(o=null==l?void 0:null===(n=l[0])||void 0===n?void 0:n.slug)&&void 0!==o?o:"")}},[k,x]);let C=()=>{window.print()};return(null==k?void 0:null===(n=k.data)||void 0===n?void 0:null===(t=n.reportsList)||void 0===t?void 0:t.length)===0?(0,l.jsxs)("div",{className:"bg-oldGray-100 shadow rounded border p-10 text-center",children:[(0,l.jsx)("p",{className:"pb-5",children:"No reports have been created for you yet."}),(0,l.jsx)("div",{children:"Please check back later."})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-row space-x-2 print:hidden",children:[(0,l.jsx)(a.Z,{reportType:g,slug:y,setSlug:x,reportsList:null!==(h=null==k?void 0:null===(o=k.data)||void 0===o?void 0:o.reportsList)&&void 0!==h?h:[],setHasChanges:()=>{}}),(null==w?void 0:null===(i=w.data)||void 0===i?void 0:i.report)!==void 0&&(0,l.jsx)("button",{className:"btn px-4 mb-4 border border-brand-lightest rounded-md text-brand hover:bg-brand hover:text-white print:hidden",onClick:()=>C(),children:"Print PDF"})]}),(null==w?void 0:null===(c=w.data)||void 0===c?void 0:c.report)!==void 0&&(0,l.jsx)(u.Z,{reportType:g,selectedReport:null!==(f=null==w?void 0:null===(v=w.data)||void 0===v?void 0:v.report)&&void 0!==f?f:null,readOnly:!0})]})}},9305:function(e,t,n){var o=n(85893);n(67294),t.Z=e=>{let{items:t,selectedIndex:n,selectItem:l}=e;return(0,o.jsxs)("div",{style:{height:"300px",width:"400px"},className:"overflow-y-auto break-all border rounded shadow-md bg-white",children:[(null==t?void 0:t.length)===0&&(0,o.jsx)("div",{className:"text-center p-1 mx-2",children:"No commands found with that name."}),t.map((e,r)=>{let{title:i}=e,d="";switch(r){case 0:d="rounded-t";break;case t.length-1:d="rounded-b";break;default:d="border-b-0"}return(0,o.jsx)("button",{onClick:()=>l(r),tabIndex:0,className:"p-1 block w-full border-t text-left hover:bg-oldGray-200 hover:pointer-cursor ".concat(r===n?"bg-oldGray-200":"bg-white"," ").concat(d),children:i},r)})]})}},91333:function(e,t,n){n.d(t,{z:function(){return d}});var o=n(19013),l=n(13882);function r(e,t){(0,l.Z)(2,arguments);var n=(0,o.Z)(e),r=(0,o.Z)(t),i=n.getTime()-r.getTime();return i>0?-1:i<0?1:i}var i=n(70722);let d=(e,t)=>null===e.publishedAt&&null===t.publishedAt?r((0,i.utcToZonedTime)(e.createdAt,"UTC"),(0,i.utcToZonedTime)(t.createdAt,"UTC")):null===e.publishedAt?null===t.publishedAt?0:-1:null===t.publishedAt?1:r((0,i.utcToZonedTime)(e.publishedAt,"UTC"),(0,i.utcToZonedTime)(t.publishedAt,"UTC"))},99141:function(e,t,n){function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return null==e?"":e.length<=t?e:e.slice(0,t-n.length)+n}function l(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.constants,o={};for(let e in n)t?o[e.slice(0,-6)]={primary:n[e],secondary:n[e]}:o[e.slice(0,-6)]=n[e];return o}function r(e){return null==e?"":e.charAt(0).toUpperCase()+e.slice(1)}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e||0).toFixed(t).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")}function d(e){return null===e||""===e}function a(e){return e.split("_").map(e=>{var t;return"".concat(null===(t=e[0])||void 0===t?void 0:t.toUpperCase()).concat(e.slice(1)," ")})}function s(e,t,n){let o={},l=null==n?void 0:n.financial_profile__home_owner,r=null==n?void 0:n.financial_profile__future_home_purchase,i=null==n?void 0:n.financial_profile__cottage_or_vacation_property,d=parseInt(null==n?void 0:n.financial_profile__number_of_rental_properties);(l||!l&&r)&&(o.house="House"),l&&r&&(o.new_house="New House"),i&&(o.cottage_or_vacation="Cottage Or Vacation");for(let e=1;e<d+1;e++)o["rental_".concat(e)]="Rental ".concat(e);return o}function u(e){var t,n;null===(n=window)||void 0===n||null===(t=n.grecaptcha)||void 0===t||t.ready(function(){var t;null===(t=window)||void 0===t||t.grecaptcha.execute("6Lc2lAMqAAAAAD9AybDMuEgsr23RVojhAmG5TRcg",{action:"submit"}).then(e)})}
1function c(e,t,n){let o=s(e,t,n),l=[{text:"Don't Link",value:null}];for(let e in o)l.push({text:o[e],value:e});for(let e of["house","new_house","cottage_or_vacation","rental_1","rental_2","rental_3","rental_4","rental_5"]){let t=o[e];void 0===t&&l.push({text:a(e),value:e,hidden:!0,disabled:!0})}return l}n.d(t,{Ap:function(){return i},Eb:function(){return r},V0:function(){return c},kY:function(){return o},lF:function(){return d},lU:function(){return u},m7:function(){return s},qI:function(){return l},uD:function(){return a}})}}]);
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.