1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[839],{7483:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/portfolio/[id]",function(){return s(1279)}])},3860:function(e,t,s){"use strict";var a=s(5893),r=s(7294),l=s(5152);s.n(l)()(()=>Promise.all([s.e(279),s.e(229)]).then(s.bind(s,7229)),{loadableGenerated:{webpack:()=>[7229]},ssr:!1}),t.Z=()=>{let[e,t]=(0,r.useState)({series:[{name:"Product One",data:[23,11,22,27,13,22,37,21,44,22,30,45]},{name:"Product Two",data:[30,25,36,30,45,35,64,52,59,36,39,51]}]});return(0,a.jsxs)("div",{className:"mt-4 md:mt-6 2xl:mt-7.5 col-span-12 rounded-sm border border-stroke bg-white px-5 pt-7.5 pb-5 shadow-default dark:border-strokedark dark:bg-boxdark sm:px-7.5 xl:col-span-8",children:[(0,a.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-3 sm:flex-nowrap"}),(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center w-full h-[355px]",children:[(0,a.jsx)("img",{className:"w-80",src:"/assets/stock-graph.svg",alt:"dividend growth graph"}),(0,a.jsx)("p",{className:"dark:text-white mt-16",children:"Add holdings to see your historic price chart"})]})})]})}},1082:function(e,t,s){"use strict";s.d(t,{Z:function(){return i}});var a=s(5893);s(7294);var r=e=>{let{title:t,total:s,rate:r,levelUp:l,levelDown:i,children:n}=e;return(0,a.jsxs)("div",{className:"rounded-sm border border-stroke bg-white py-6 px-7.5 shadow-default dark:border-strokedark dark:bg-boxdark",children:[(0,a.jsx)("div",{className:"flex h-11.5 w-11.5 items-center justify-center rounded-full bg-meta-2 dark:bg-meta-4",children:n}),(0,a.jsxs)("div",{className:"mt-4 flex items-end justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"text-title-md font-bold text-black dark:text-white",children:s}),(0,a.jsx)("span",{className:"text-sm font-medium dark:text-white",children:t})]}),(0,a.jsxs)("span",{className:"flex items-center gap-1 text-sm font-medium ".concat(l&&"text-meta-3"," ").concat(i&&"text-meta-5"," "),children:[r,l&&(0,a.jsx)("svg",{className:"fill-meta-3",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M4.35716 2.47737L0.908974 5.82987L5.0443e-07 4.94612L5 0.0848689L10 4.94612L9.09103 5.82987L5.64284 2.47737L5.64284 10.0849L4.35716 10.0849L4.35716 2.47737Z",fill:""})}),i&&(0,a.jsx)("svg",{className:"fill-meta-5",width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M5.64284 7.69237L9.09102 4.33987L10 5.22362L5 10.0849L-8.98488e-07 5.22362L0.908973 4.33987L4.35716 7.69237L4.35716 0.0848701L5.64284 0.0848704L5.64284 7.69237Z",fill:""})})]})]})]})},l=s(2844),i=e=>{let{portfolio:t}=e;return(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 pt-7.5 md:grid-cols-2 md:gap-6 xl:grid-cols-4 2xl:gap-7.5",children:[(0,a.jsx)(r,{title:"Portfolio Yield",total:"".concat(t.yield.toFixed(2).toString(),"%"),rate:"",children:(0,a.jsxs)("svg",{className:"fill-primary dark:fill-white",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{d:"M11 15.1156C4.19376 15.1156 0.825012 8.61876 0.687512 8.34376C0.584387 8.13751 0.584387 7.86251 0.687512 7.65626C0.825012 7.38126 4.19376 0.918762 11 0.918762C17.8063 0.918762 21.175 7.38126 21.3125 7.65626C21.4156 7.86251 21.4156 8.13751 21.3125 8.34376C21.175 8.61876 17.8063 15.1156 11 15.1156ZM2.26876 8.00001C3.02501 9.27189 5.98126 13.5688 11 13.5688C16.0188 13.5688 18.975 9.27189 19.7313 8.00001C18.975 6.72814 16.0188 2.43126 11 2.43126C5.98126 2.43126 3.02501 6.72814 2.26876 8.00001Z",fill:""}),(0,a.jsx)("path",{d:"M11 10.9219C9.38438 10.9219 8.07812 9.61562 8.07812 8C8.07812 6.38438 9.38438 5.07812 11 5.07812C12.6156 5.07812 13.9219 6.38438 13.9219 8C13.9219 9.61562 12.6156 10.9219 11 10.9219ZM11 6.625C10.2437 6.625 9.625 7.24375 9.625 8C9.625 8.75625 10.2437 9.375 11 9.375C11.7563 9.375 12.375 8.75625 12.375 8C12.375 7.24375 11.7563 6.625 11 6.625Z",fill:""})]})}),(0,a.jsx)(r,{title:"Yield On Cost",total:"".concat(t.yieldOnCost.toFixed(2).toString(),"%"),rate:"",children:(0,a.jsxs)("svg",{className:"fill-primary dark:fill-white",width:"20",height:"22",viewBox:"0 0 20 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{d:"M11.7531 16.4312C10.3781 16.4312 9.27808 17.5312 9.27808 18.9062C9.27808 20.2812 10.3781 21.3812 11.7531 21.3812C13.1281 21.3812 14.2281 20.2812 14.2281 18.9062C14.228
11 17.5656 13.0937 16.4312 11.7531 16.4312ZM11.7531 19.8687C11.2375 19.8687 10.825 19.4562 10.825 18.9406C10.825 18.425 11.2375 18.0125 11.7531 18.0125C12.2687 18.0125 12.6812 18.425 12.6812 18.9406C12.6812 19.4219 12.2343 19.8687 11.7531 19.8687Z",fill:""}),(0,a.jsx)("path",{d:"M5.22183 16.4312C3.84683 16.4312 2.74683 17.5312 2.74683 18.9062C2.74683 20.2812 3.84683 21.3812 5.22183 21.3812C6.59683 21.3812 7.69683 20.2812 7.69683 18.9062C7.69683 17.5656 6.56245 16.4312 5.22183 16.4312ZM5.22183 19.8687C4.7062 19.8687 4.2937 19.4562 4.2937 18.9406C4.2937 18.425 4.7062 18.0125 5.22183 18.0125C5.73745 18.0125 6.14995 18.425 6.14995 18.9406C6.14995 19.4219 5.73745 19.8687 5.22183 19.8687Z",fill:""}),(0,a.jsx)("path",{d:"M19.0062 0.618744H17.15C16.325 0.618744 15.6031 1.23749 15.5 2.06249L14.95 6.01562H1.37185C1.0281 6.01562 0.684353 6.18749 0.443728 6.46249C0.237478 6.73749 0.134353 7.11562 0.237478 7.45937C0.237478 7.49374 0.237478 7.49374 0.237478 7.52812L2.36873 13.9562C2.50623 14.4375 2.9531 14.7812 3.46873 14.7812H12.9562C14.2281 14.7812 15.3281 13.8187 15.5 12.5469L16.9437 2.26874C16.9437 2.19999 17.0125 2.16562 17.0812 2.16562H18.9375C19.35 2.16562 19.7281 1.82187 19.7281 1.37499C19.7281 0.928119 19.4187 0.618744 19.0062 0.618744ZM14.0219 12.3062C13.9531 12.8219 13.5062 13.2 12.9906 13.2H3.7781L1.92185 7.56249H14.7094L14.0219 12.3062Z",fill:""})]})}),(0,a.jsx)(r,{title:"Annual Income",total:"".concat((0,l.R)(t.annualIncome)),rate:"",children:(0,a.jsxs)("svg",{className:"fill-primary dark:fill-white",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{d:"M21.1063 18.0469L19.3875 3.23126C19.2157 1.71876 17.9438 0.584381 16.3969 0.584381H5.56878C4.05628 0.584381 2.78441 1.71876 2.57816 3.23126L0.859406 18.0469C0.756281 18.9063 1.03128 19.7313 1.61566 20.3844C2.20003 21.0375 2.99066 21.3813 3.85003 21.3813H18.1157C18.975 21.3813 19.8 21.0031 20.35 20.3844C20.9 19.7656 21.2094 18.9063 21.1063 18.0469ZM19.2157 19.3531C18.9407 19.6625 18.5625 19.8344 18.15 19.8344H3.85003C3.43753 19.8344 3.05941 19.6625 2.78441 19.3531C2.50941 19.0438 2.37191 18.6313 2.44066 18.2188L4.12503 3.43751C4.19378 2.71563 4.81253 2.16563 5.56878 2.16563H16.4313C17.1532 2.16563 17.7719 2.71563 17.875 3.43751L19.5938 18.2531C19.6282 18.6656 19.4907 19.0438 19.2157 19.3531Z",fill:""}),(0,a.jsx)("path",{d:"M14.3345 5.29375C13.922 5.39688 13.647 5.80938 13.7501 6.22188C13.7845 6.42813 13.8189 6.63438 13.8189 6.80625C13.8189 8.35313 12.547 9.625 11.0001 9.625C9.45327 9.625 8.1814 8.35313 8.1814 6.80625C8.1814 6.6 8.21577 6.42813 8.25015 6.22188C8.35327 5.80938 8.07827 5.39688 7.66577 5.29375C7.25327 5.19063 6.84077 5.46563 6.73765 5.87813C6.6689 6.1875 6.63452 6.49688 6.63452 6.80625C6.63452 9.2125 8.5939 11.1719 11.0001 11.1719C13.4064 11.1719 15.3658 9.2125 15.3658 6.80625C15.3658 6.49688 15.3314 6.1875 15.2626 5.87813C15.1595 5.46563 14.747 5.225 14.3345 5.29375Z",fill:""})]})}),(0,a.jsx)(r,{title:"Portfolio Beta",total:"".concat(t.beta.toFixed(2).toString()),rate:"",children:(0,a.jsxs)("svg",{className:"fill-primary dark:fill-white",width:"22",height:"18",viewBox:"0 0 22 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{d:"M7.18418 8.03751C9.31543 8.03751 11.0686 6.35313 11.0686 4.25626C11.0686 2.15938 9.31543 0.475006 7.18418 0.475006C5.05293 0.475006 3.2998 2.15938 3.2998 4.25626C3.2998 6.35313 5.05293 8.03751 7.18418 8.03751ZM7.18418 2.05626C8.45605 2.05626 9.52168 3.05313 9.52168 4.29063C9.52168 5.52813 8.49043 6.52501 7.18418 6.52501C5.87793 6.52501 4.84668 5.52813 4.84668 4.29063C4.84668 3.05313 5.9123 2.05626 7.18418 2.05626Z",fill:""}),(0,a.jsx)("path",{d:"M15.8124 9.6875C17.6687 9.6875 19.1468 8.24375 19.1468 6.42188C19.1468 4.6 17.6343 3.15625 15.8124 3.15625C13.9905 3.15625 12.478 4.6 12.478 6.42188C12.478 8.24375 13.9905 9.6875 15.8124 9.6875ZM15.8124 4.7375C16.8093 4.7375 17.5999 5.49375 17.5999 6.45625C17.5999 7.41875 16.8093 8.175 15.8124 8.175C14.8155 8.175 14.0249 7.41875 14.0249 6.45625C14.0249 5.49375 14.8155 4.7375 15.8124 4.7375Z",fill:""}),(0,a.jsx)("path",{d:"M15.9843 10.0313H15.6749C14.6437 10.0313 13.6468 10.3406 12.7874 10.8563C11.8593 9.61876 10.3812 8.79376 8.73115 8.79376H5.67178C2.85303 8.82814 0.618652 11.0625 0.618652 13.8469V16.3219C0.618652 16.975 1.13428 17.4906 1.7874 17.4906H20.2468C20.8999 17.4906 21.4499 16.9406 21.4499 16.2875V15.4625C21.4155 12.4719 18.9749 10.0313 15.9843 10.0313ZM2.16553 15.9438V13.8469C2.16553 11.9219 3.74678 10.3406 5.67178 10.3406H8.73115C10.6562 10.3406 12.2374 11.9219 12.2374 13.8469V15.9438H2.16553V15.9438ZM19.8687 15.9438H13.7499V13.8469C13.7499 13.2969 13.6468 12.7469 13.4749 12.2313C14.0937 11.7844 14.8499 11.5781 15.6405 11.5781H15.9499C18.0812 11.5781 19.8343 13.3313 19.8343 15.4625V15.9438H19.8687Z",fill:""})]})})]})}},2844:function(e,t,s){"use strict";function a(e){return"".concat("https://dividendtracker.netlify.app").concat(e)}s.d(t,{G:function(){return a},R:function(){return r}});let r=e=>
1e.toLocaleString("en-US",{currency:"USD",style:"currency",minimumFractionDigits:2,maximumFractionDigits:2})},4802:function(e,t,s){"use strict";function a(e){return 0===Object.keys(e).length}s.d(t,{x:function(){return a}})},1279:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSP:function(){return V},default:function(){return O}});var a=s(5893),r=s(7294),l=s(2844),i=s(4080),n=s(9117),d=s(6154),c=s(7536),o=s(8767),x=s(7087),m=s(2920);s(1399);var h=e=>{let{portfolio:t,open:s,setOpen:l,session:h,refetch:p,csrfToken:u}=e,f=(0,r.useRef)(null),g={input:e=>({...e,"input:focus":{boxShadow:"none"}}),control:()=>({})},{control:b,register:j,handleSubmit:k,reset:w}=(0,c.cI)(),y=(0,o.useQuery)(["tickers"],async()=>{let e=await d.Z.get("/api/tickers");return e.data}),N=async e=>{try{await d.Z.post("/api/add-holding",{method:"POST",headers:{"Content-Type":"application/json"},holding:{userId:h.user.id,portfolioId:t.id,ticker:e.ticker,shares:e.shares,cost:e.cost}}),l(!1),w(),p()}catch(e){w(),(0,m.Am)(e.response.data.message,{type:"error"})}},v=y.isSuccess?y.data.map(e=>({value:e.ticker,label:"".concat(e.ticker," - ").concat(e.name)})):[];return(0,a.jsxs)(a.Fragment,{children:[y.isSuccess&&(0,a.jsx)(i.u.Root,{show:s,as:r.Fragment,children:(0,a.jsxs)(n.V,{as:"div",className:"relative z-999",initialFocus:f,onClose:l,children:[(0,a.jsx)(i.u.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})}),(0,a.jsx)("div",{className:"fixed inset-0 z-10 w-screen overflow-y-auto",children:(0,a.jsx)("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:(0,a.jsx)(i.u.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,a.jsx)(n.V.Panel,{className:"relative transform overflow-visible rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",children:(0,a.jsxs)("form",{onSubmit:k(N),children:[(0,a.jsx)("div",{className:"bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4 dark:bg-boxdark",children:(0,a.jsx)("div",{className:"sm:flex sm:items-start",children:(0,a.jsxs)("div",{className:"mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left w-full",children:[(0,a.jsx)(n.V.Title,{as:"h3",className:"text-base font-semibold leading-6 text-gray-900 dark:text-whiter",children:"Add Holding"}),(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsx)("input",{name:"csrfToken",...j("csrfToken"),type:"hidden",defaultValue:u,hidden:!0}),(0,a.jsxs)("div",{className:"",children:[(0,a.jsx)("label",{htmlFor:"name",className:"block text-sm dark:text-neutral-400",children:"Ticker"}),(0,a.jsx)("div",{className:"mt-1",children:(0,a.jsx)(c.Qr,{control:b,defaultValue:"",name:"ticker",render:e=>{let{field:{onChange:t,value:s}}=e;return(0,a.jsx)(x.ZP,{classNames:{control:()=>"border border-gray-100 dark:text-whiten dark:border-[#6b7280] bg-transparent rounded",input:()=>"dark:text-whiten",singleValue:()=>"dark:text-whiten"},styles:g,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null},options:v,value:v.find(e=>e.value===s),onChange:e=>t(e.value)})}})})]}),(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("label",{htmlFor:"name",className:"block text-sm dark:text-neutral-400",children:"Shares"}),(0,a.jsx)("div",{className:"mt-1 flex",children:(0,a.jsx)("input",{id:"shares",name:"shares",type:"number",step:"any",required:!0,...j("shares"),className:"rounded appearance-none w-full font-medium py-2 border-gray-100 outline-none text-xl leading-6 bg-transparent placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 transition duration-150 ease-in-out dark:text-whiten dark:border-[#6b7280]"})})]}),(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("label",{htmlFor:"name",className:"block text-sm dark:text-neutral-400",children:"Cost per share"}),(0,a.jsx)("div",{className:"mt-1 flex",children:(0,a.jsx)("input",{id:"cost",name:"cost",type:"number",step:"any",required:!0,...j("cost"),className:"rounded appearance-none w-full font-medium py-2 border-gray-100 outline-none text-xl leading-6 bg-transparent placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 transition duration-150 ease-in-out dark:text-whiten dark:border-[#6b7280]"})})]})]})]})})}),(0,a.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:flex sm:flex-row-reverse sm:px-6 dark:bg-boxdark-2",children:[(0,a.jsx)("button",{type:"submit",className:"inline-flex w-full justify-center rounded-md bg-green-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-green-500 sm:ml-3 sm:w-auto",children:(0,a.jsx)("p",{children:"+ Add Holding"})}),(0,a.jsx)("button",{type:"button",className:"mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:mt-0 sm:w-auto",onClick:()=>l(!1),ref:f,children:"Cancel"})]})]})})})})})]})}),(0,a.jsx)(m.Ix,{})]})},p=e=>{let{portfolio:t,session:s,refetch:i,csrfToken:n}=e,[d,c]=(0,r.useState)(""),[o,x]=(0,r.useState)(!1),m=e=>e.timestamps[0].stocks.filter(e=>e.stock.name.toUpperCase().includes(d.toUpperCase())||e.stock.ticker.toUpperCase().includes(d.toUpperCase()));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h,{open:o,setOpen:x,session:s,portfolio:t,refetch:i,csrfToken:n}),(0,a.jsxs)("div",{className:"rounded-sm border border-stroke bg-white px-5 pt-6 pb-2.5 shadow-default dark:border-strokedark dark:bg-boxdark sm:px-7.5 xl:pb-1 mb
1-6",children:[(0,a.jsxs)("div",{className:"w-full flex justify-between relative",children:[(0,a.jsx)("div",{className:"absolute inset-y-0 rtl:inset-r-0 start-0 flex items-center ps-3 pointer-events-none",children:(0,a.jsx)("svg",{className:"w-4 h-4 text-gray-500 dark:text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"})})}),(0,a.jsx)("input",{type:"text",id:"filter",placeholder:"Search for stock",className:"ps-10 rounded w-1/2 appearance-none py-2 border-gray-100 outline-none leading-6 bg-transparent placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 transition duration-150 ease-in-out dark:text-whiten dark:border-[#6b7280]",onChange:e=>c(e.target.value)}),(0,a.jsx)("button",{className:"py-3 lg:py-4 lg:px-12 px-4 text-white rounded-lg bg-primary hover:bg-secondary transition-all outline-none text-sm",onClick:()=>x(!0),children:(0,a.jsx)("p",{children:"+ Add Holding"})})]}),(0,a.jsxs)("table",{className:"flex flex-col mt-2 overflow-x-auto sortable",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"grid grid-cols-[repeat(10,minmax(100px,1fr))] rounded-sm text-sm ",children:[(0,a.jsx)("th",{className:"p-2.5 text-center xl:p-5 bg-gray-2 dark:bg-meta-4",children:(0,a.jsx)("h5",{className:"text-sm font-medium uppercase xsm:text-base dark:text-white ",children:"Ticker"})}),(0,a.jsx)("th",{className:"p-2.5 text-center xl:p-5 bg-gray-2 dark:bg-meta-4",children:(0,a.jsx)("h5",{className:"text-sm font-medium uppercase xsm:text-base dark:text-white",children:"Shares"})}),(0,a.jsx)("th",{className:"p-2.5 text-center xl:p-5 bg-gray-2 dark:bg-meta-4",children:(0,a.jsx)("h5",{className:"text-sm font-medium uppercase xsm:text-base dark:text-white",children:"Price"})}),(0,a.jsx)("th",{className:"p-2.5 text-center xl:p-5 bg-gray-2 dark:bg-meta-4",children:(0,a.jsx)("h5",{className:"text-sm font-medium uppercase xsm:text-base dark:text-white",children:"Change"})}),(0,a.jsx)("th",{className:"p-2.5 text-center xl:p-5 bg-gray-2 dark:bg-meta-4",children:(0,a.jsx)("h5",{className:"text-sm font-medium uppercase xsm:text-base dark:text-white",children:"Average Cost"})}),(0,a.jsx)("th",{className:"p-2.5 text-center xl:p-5 bg-gray-2 dark:bg-meta-4",children:(0,a.jsx)("h5",{className:"text-sm font-medium uppercase xsm:text-base dark:text-white",children:"Profit / Loss"})}),(0,a.jsx)("th",{className:"p-2.5 text-center xl:p-5 bg-gray-2 dark:bg-meta-4",children:(0,a.jsx)("h5",{className:"text-sm font-medium uppercase xsm:text-base dark:text-white",children:"Dividend Yield"})}),(0,a.jsx)("th",{className:"p-2.5 text-center xl:p-5 bg-gray-2 dark:bg-meta-4",children:(0,a.jsx)("h5",{className:"text-sm font-medium uppercase xsm:text-base dark:text-white",children:"Yield On Cost"})}),(0,a.jsx)("th",{className:"p-2.5 text-center xl:p-5 bg-gray-2 dark:bg-meta-4",children:(0,a.jsx)("h5",{className:"text-sm font-medium uppercase xsm:text-base dark:text-white",children:"Annual Income"})}),(0,a.jsx)("th",{className:"p-2.5 text-center xl:p-5 bg-gray-2 dark:bg-meta-4",children:(0,a.jsx)("h5",{className:"text-sm font-medium uppercase xsm:text-base dark:text-white",children:"Dividend Score"})})]})}),(0,a.jsx)("tbody",{children:m(t).length?m(t).map((e,s)=>(0,a.jsxs)("tr",{className:"grid grid-cols-[repeat(10,minmax(100px,1fr))] ".concat(s===t.timestamps[0].stocks.length-1?"":"border-b border-stroke dark:border-strokedark"),children:[(0,a.jsx)("td",{className:"flex items-center justify-center p-2.5 xl:p-5",children:(0,a.jsx)("p",{className:"text-black dark:text-white",children:e.stock.ticker})}),(0,a.jsx)("td",{className:"flex items-center justify-center p-2.5 xl:p-5",children:(0,a.jsx)("p",{className:"text-black dark:text-white",children:e.shares.toFixed(2)})}),(0,a.jsx)("td",{className:"flex items-center justify-center p-2.5 xl:p-5",children:(0,a.jsx)("p",{className:"text-black dark:text-white",children:(0,l.R)(e.stock.price)})}),(0,a.jsx)("td",{className:"flex items-center justify-center p-2.5 xl:p-5",children:(0,a.jsx)("p",{className:"".concat(e.stock.change>0?"text-meta-3":"text-meta-1"),children:(0,l.R)(e.stock.change)})}),(0,a.jsx)("td",{className:"flex items-center justify-center p-2.5 xl:p-5",children:(0,a.jsx)("p",{className:"text-black dark:text-white",children:(0,l.R)(e.averageCost)})}),(0,a.jsx)("td",{className:"flex items-center justify-center p-2.5 xl:p-5",children:(0,a.jsx)("p",{className:"".concat(e.stock.price*e.shares-e.averageCost*e.shares>0?"text-meta-3":"text-meta-1"),children:(0,l.R)(e.stock.price*e.shares-e.averageCost*e.shares)})}),(0,a.jsx)("td",{className:"flex items-center justify-center p-2.5 xl:p-5",children:(0,a.jsxs)("p",{className:"text-black dark:text-white",children:[e.stock.yield.toFixed(2),"%"]})}),(0,a.jsx)("td",{className:"flex items-center justify-center p-2.5 xl:p-5",children:(0,a.jsxs)("p",{className:"text-black dark:text-white",children:[e.yieldOnCost.toFixed(2),"%"]})}),(0,a.jsx)("td",{className:"flex items-center justify-center p-2.5 xl:p-5",children:(0,a.jsx)("p",{className:"text-black dark:text-white",children:(0,l.R)(e.stock.price*e.shares*(e.stock.yield/100))})}),(0,a.jsx)("td",{className:"flex items-center justify-center p-2.5 xl:p-5",children:(0,a.jsx)("p",{className:"text-black dark:text-white",children:e.stock.dividendScore})})]},s)):(0,a.jsxs)("div",{className:"mb-12 flex flex-col w-full justify-center items-center",children:[(0,a.jsx)("img",{className:"mt-4 w-80 h-80",src:"/assets/add-stock.svg",alt:"add stock icon"}),(0,a.jsx)("p",{className:"dark:text-white",children:"Could not find any stocks"})]})})]})]})]})},u=s(1082),f=s(4184),g=s.n(f),b=e=>{let{id:t}=e;return(0,a.jsxs)("div",{className:"flex flex-col mt-4",children:[(0,a.jsx)("label",{htmlFor:"public",className:"block text-sm dark:text-neutral-400 mb-1",children:"Copy Link"}),(0,a.jsx)("input",{className:"rounded appearance-none w-full font-medium py-2 border-gray-100 outline-none text-xl leading-6 bg-transparent placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 transition duration-150 ease-in-out dark:text-whiten dark:border-[#6b7280]",value:(0,l.G)("portfolio/share/".concat(t))})]})},j=e=>{let{refetch:t,open:s,csrfToken:l,portfoliosRefetch:o,setOpen:x,session:h,portfolio:p}=e,u=(0,r.useRef)(null),[f,j]=(0,r.useState)(p.public),{register:k,handleSubmit:w,reset:y}
1=(0,c.cI)({defaultValues:{updateType:"manual",name:p.name,public:p.public}}),N=async e=>{try{let s=await d.Z.put("/api/portfolio/edit",{method:"PUT",headers:{"Content-Type":"application/json"},portfolio:{id:p.id,userId:h.user.id,name:e.name,updateType:e.updateType,public:e.public}});x(!1),s&&(t(),o())}catch(e){y(),(0,m.Am)(e.response.data.message,{type:"error"})}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.u.Root,{show:s,as:r.Fragment,children:(0,a.jsxs)(n.V,{as:"div",className:"relative z-999",initialFocus:u,onClose:x,children:[(0,a.jsx)(i.u.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})}),(0,a.jsx)("div",{className:"fixed inset-0 z-10 w-screen overflow-y-auto",children:(0,a.jsx)("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:(0,a.jsx)(i.u.Child,{as:r.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,a.jsx)(n.V.Panel,{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg",children:(0,a.jsxs)("form",{onSubmit:w(N),children:[(0,a.jsx)("div",{className:"bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4 dark:bg-boxdark",children:(0,a.jsx)("div",{className:"sm:flex sm:items-start",children:(0,a.jsxs)("div",{className:"mt-3 sm:ml-4 sm:mt-0 sm:text-left w-full",children:[(0,a.jsx)(n.V.Title,{as:"h3",className:"font-semibold leading-6 text-gray-900 dark:text-whiter text-center sm:text-left text-xl",children:"Edit Portfolio"}),(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsx)("input",{name:"csrfToken",...k("csrfToken"),type:"hidden",defaultValue:l,hidden:!0}),(0,a.jsxs)("div",{className:"",children:[(0,a.jsx)("label",{htmlFor:"name",className:"block text-sm dark:text-neutral-400",children:"Account Name"}),(0,a.jsx)("div",{className:"mt-1",children:(0,a.jsx)("input",{id:"name",name:"name",required:!0,...k("name"),className:"rounded appearance-none w-full font-medium py-2 border-gray-100 outline-none text-xl leading-6 bg-transparent placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 transition duration-150 ease-in-out dark:text-whiten dark:border-[#6b7280]"})})]}),(0,a.jsxs)("div",{className:"mt-4 flex",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"name",className:"block text-sm dark:text-neutral-400",children:"Update Type"}),(0,a.jsxs)("div",{className:"mt-1 flex",children:[(0,a.jsxs)("div",{className:"flex items-center dark:text-white",children:[(0,a.jsx)("input",{type:"radio",placeholder:"Manual",value:"manual",...k("updateType"),className:"mx-2 md:mx-3"}),(0,a.jsx)("label",{children:"Manual"})]}),(0,a.jsxs)("div",{className:"flex items-center dark:text-white",children:[(0,a.jsx)("input",{type:"radio",placeholder:"Automatic",value:"automatic",...k("updateType"),className:g()(h.user.stripePriceId?"":"opacity-50 bg-gray-600","mx-2 md:mx-3"),disabled:!h.user.stripePriceId}),(0,a.jsx)("label",{className:g()(h.user.stripePriceId?"":"opacity-50 text-gray-600"),children:"Automatic"})]})]})]}),(0,a.jsxs)("div",{className:"mx-auto",children:[(0,a.jsx)("label",{htmlFor:"public",className:"block text-sm dark:text-neutral-400 mb-1",children:"Public"}),(0,a.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",className:"sr-only peer",...k("public"),onChange:e=>j(e.target.checked)}),(0,a.jsx)("div",{className:"w-11 h-6 bg-gray-200 rounded-full peer peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"})]})]})]}),f?(0,a.jsx)(b,{id:p.id}):(0,a.jsx)(a.Fragment,{})]})]})})}),(0,a.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:flex sm:flex-row-reverse sm:px-6 dark:bg-boxdark-2",children:[(0,a.jsx)("button",{type:"submit",className:"inline-flex w-full justify-center rounded-md bg-green-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-green-500 sm:ml-3 sm:w-auto",children:(0,a.jsx)("p",{children:"Update Portfolio"})}),(0,a.jsx)("button",{type:"button",className:"mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:mt-0 sm:w-auto",onClick:()=>x(!1),ref:u,children:"Cancel"})]})]})})})})})]})}),(0,a.jsx)(m.Ix,{})]})},k=s(9006),w=e=>{let{portfolio:t,session:s,refetch:i,csrfToken:n,portfoliosRefetch:d}=e,[c,o]=(0,r.useState)(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"rounded-sm border border-stroke bg-white py-12 px-7.5 shadow-default dark:border-strokedark dark:bg-boxdark xl:col-span-4",children:(0,a.jsxs)("div",{className:"flex h-11.5 items-center dark:bg-boxdark w-full justify-between align-middle",children:[(0,a.jsx)("p",{className:"dark:text-white lg:text-title-xl text-title-lg font-bold",children:(0,l.R)(t.value)}),(0,a.jsx)("div",{className:"flex flex-col",children:(0,a.jsx)("button",{className:"inline-flex items-center justify-center w-10 h-10 text-indigo-100 transition-colors duration-150 bg-primary rounded-full focus:shadow-outline hover:bg-secondary",onClick:()=>o(!0),children:(0,a.jsx)(k.Z,{})})})]})}),(0,a.jsx)(j,{refetch:i,portfoliosRefetch:d,open:c,setOpen:o,session:s,portfolio:t,csrfToken:n})]})},y=s(5152),N=s.n(y);let v=N()(()=>Promise.all([s.e(279),s.e(229)]).then(s.bind(s,7229)),{loadableGenerated:{webpack:()=>[7229]},ssr:!1});var C=e=>{let{id:t}=e,[s,l]=(0,r.useState)("week"),[i,n]=(0,r.useState)({series:[{name:"Value",data:[30,25,36,30,45,35,64,52,59,36,39,51]}]});return(0,o.useQuery)(["portfolioData"],async()=>{let e=await d.Z.get("/api/portfolio/data/".concat(t));return e.data}),(0,a.jsxs)("div",{className:"mt-4 md:mt-6 2xl:mt-7.5 col-span-12 rounded-sm border border-stroke bg-white px-5 pt-7.5 pb-5 shadow-default dark:border-strokedark dark:bg-boxdark sm:px-7.5 xl:col-span-8",children:[(0,a.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-3 sm:flex-nowrap",children:(0,a.jsx)("div",{className:"flex w-full max-w-45 justify-end",children:(0,a.jsxs)("div",{className:"inline-flex items-center rounded-md bg-whiter p-1.5 dark:bg-meta-4",children:[(0,a.jsx)("button",{onClick:()=>l("week"),className:g()("week"===s?"bg-white shadow-card":"","rounded py-1 px-3 text-xs font-medium text-black hover:bg-white hover:shadow-card dark:bg-boxdark dark:text-white dark:hover:bg-boxdark"),children:"Week"}),(0,a.jsx)("button",{onClick:()=>l("month"),className:g()("month"===s?"bg-white shadow-card":"","rounded py-1 px-3 text-xs font-medium text-black hover:bg-white hover:shadow-card dark:bg-boxdark dark:text-white dark:hover:bg-boxdark"),children:"Month"}),(0,a.jsx)("button",{onClick:()=>l("year"),className:g()("year"===s?"bg-white shadow-card":"","rounded py-1 px-3 text-xs font-medium text-black hover:bg-white hover:shadow-card dark:bg-boxdark dark:text-white dark:hover:bg-boxdark"),children:"Year"})]})})}),(0,a.jsx)("div",{children:(0,a.jsx)("div",{id:"chartOne",className:"-ml-5 h-[355px] w-[105%]",children:(0,a.jsx)(v,{options:{legend:{show:!1,position:"top",horizontalAlign:"left"},colors:["#3C50E0","#80CAEE"],chart:{fontFamily:"Satoshi, sans-serif",height:335,type:"area",dropShadow:{enabled:!0,color:"#623CEA14",top:10,blur:4,left:0,opacity:.1},toolbar:{show:!1}},responsive:[{breakpoint:1024,options:{chart:{height:300}}},{breakpoint:1366,options:{chart:{height:350}}}],stroke:{width:[2,2],curve:"straight"},grid:{xaxis:{lines:{show:!0}},yaxis:{lines:{show:!0}}},dataLabels:{enabled:!1},markers:{size:4,colors:"#fff",strokeColors:["#3056D3","#80CAEE"],strokeWidth:3,strokeOpacity:.9,strokeDashArray:0,fillOpacity:1,discrete:[],hover:{size:void 0,sizeOffset:5}},xaxis:{type:"category",categories:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],axisBorder:{show:!1},axisTicks:{show:!1}},yaxis:{title:{style:{fontSize:"0px"}}}},series:i.series,type:"area",width:"99%",height:"100%"})})})]})},F=s(3860),Z=e=>{let{portfolio:t,session:s,csrfToken:r,refetch:l,portfoliosRefetch:i}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w,{portfolio:t,session:s,refetch:l,csrfToken:r,portfoliosRefetch:i}),(0,a.jsx)(u.Z,{portfolio:t}),t.timestamps[0].stocks.length>0?(0,a.jsx)(C,{id:t.id}):(0,a.jsx)(F.Z,{}),(0,a.jsx)("div",{className:"mt-4 grid grid-cols-12 gap-4 md:mt-6 md:gap-6 2xl:mt-7.5 2xl:gap-7.5",children:(0,a.jsx)("div",{className:"col-span-12",children:(0,a.jsx)(p,{portfolio:t,session:s,refetch:l,csrfToken:r})})})]})},T=s(8346),S=s(1305),L=s(5510),M=s(4802),P=s(3299),H=s(1163);let A=e=>{let{csrfToken:t}=e,[s,l]=(0,r.useState)(!1),{status:i,data:n}=(0,P.useSession)({required:!0}),c=(0,H.useRouter)(),{id:x}=c.query,m=(0,o.useQuery)(["portfolios"],async()=>{let e=await d.Z.get("/api/portfolios");return e.data}),h=(0,o.useQuery)(["portfolio-".concat(x)],async()=>{let e=await d.Z.get("/api/portfolio/".concat(x));return e.data});return"loading"===i||m.isLoading||h.isLoading?(0,a.jsx)("div",{className:"h-screen w-screen flex flex-col justify-center content-center items-center dark:bg-boxdark-2",children:(0,a.jsx)(S.Z,{className:"h-6 w-6"})}):h.isSuccess&&h.isSuccess?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L.Z,{title:"Portfolio - ".concat(h.data.name)}),(0,a.jsx)(T.Z,{refetch:m.refetch,portfolios:m.data,open:s,setModalOpen:l,session:n,csrfToken:t,children:(0,M.x)(h.data)?(0,a.jsx)("div",{className:"h-screen w-screen flex flex-col justify-center content-center items-center dark:bg-boxdark-2",children:(0,a.jsx)(S.Z,{className:"h-6 w-6"})}):(0,a.jsx)(Z,{portfolio:h.data,session:n,refetch:h.refetch,portfoliosRefetch:m.refetch,csrfToken:t})})]}):(0,a.jsx)("div",{className:"h-screen w-screen flex flex-col justify-center content-center items-center dark:bg-boxdark-2",children:(0,a.jsx)(S.Z,{className:"h-6 w-6"})})};A.auth={redirectTo:"/sign-in"};var V=!0,O=A}},function(e){e.O(0,[664,355,576,852,703,759,774,888,179],function(){return e(e.s=7483)}),_N_E=e.O()}]);
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.