(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6700],{61162:(e,t,s)=>{Promise.resolve().then(s.bind(s,8726))},8726:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var a=s(95155),l=s(9625),c=s(92501),r=s(62838),i=s(48617),n=s(48173),d=s.n(n),o=s(12115),h=s(83391),x=s(30814);function m(){let{selectedPolicyNo:e}=(0,h.d4)(e=>e.auth),[t,s]=(0,o.useState)(!0),[n,m]=(0,o.useState)(null);return((0,o.useEffect)(()=>{let t=async()=>{try{s(!0);let t=await r.Y.getPolicyInfo(e);200===t.status&&m(t.data)}catch(e){x.o.error(e.message||"Failed to fetch policy information")}finally{s(!1)}};e&&t()},[e]),t)?(0,a.jsx)(l.U,{title:"Policy Info",breadcrumbs:["Dashboard","Policy Info List"],children:(0,a.jsx)("div",{className:"flex justify-center items-center min-h-[400px]",children:(0,a.jsx)(c.R,{})})}):n?(0,a.jsx)(l.U,{title:"Policy Info",breadcrumbs:["Dashboard","Policy Info List"],children:(0,a.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b",children:[(0,a.jsx)("th",{className:"text-left p-4",children:"Policy No"}),(0,a.jsx)("th",{className:"text-left p-4",children:"Plan Name"}),(0,a.jsx)("th",{className:"text-left p-4",children:"Sum Assured"}),(0,a.jsx)("th",{className:"text-left p-4",children:"Total Premium"}),(0,a.jsx)("th",{className:"text-left p-4",children:"Paid Amount"}),(0,a.jsx)("th",{className:"text-left p-4",children:"Maturity Date"}),(0,a.jsx)("th",{className:"text-left p-4",children:"Actions"})]})}),(0,a.jsx)("tbody",{children:(0,a.jsxs)("tr",{className:"bg-white",children:[(0,a.jsx)("td",{className:"p-4",children:n.Policy}),(0,a.jsx)("td",{className:"p-4",children:n.PlanName}),(0,a.jsx)("td",{className:"p-4",children:n.SumAssured}),(0,a.jsx)("td",{className:"p-4",children:n.TotalPre}),(0,a.jsx)("td",{className:"p-4",children:n.PaidAmt}),(0,a.jsx)("td",{className:"p-4",children:n.MatuDate}),(0,a.jsx)("td",{className:"p-4",children:(0,a.jsxs)(d(),{href:"/policy-holder/info/policy-information/".concat(n.Policy),className:"text-blue-600 hover:text-blue-800 flex items-center gap-1",children:[(0,a.jsx)(i.A,{className:"w-4 h-4"}),"Details"]})})]})})]})})})}):(0,a.jsx)(l.U,{title:"Policy Info",breadcrumbs:["Dashboard","Policy Info List"],children:(0,a.jsx)("div",{className:"bg-white rounded-lg shadow p-6",children:(0,a.jsx)("p",{className:"text-center text-gray-500",children:"No policy data available"})})})}},53661:(e,t,s)=>{"use strict";s.d(t,{r:()=>i});var a=s(95155),l=s(76046),c=s(12115),r=s(83391);function i(e,t){return function(s){let i=(0,l.useRouter)(),{isAuthenticated:n,user:d}=(0,r.d4)(e=>e.auth);return((0,c.useEffect)(()=>{if(!n){i.replace("/login");return}(null==d?void 0:d.role)!==t&&i.replace("/login")},[n,d,i]),n&&(null==d?void 0:d.role)===t)?(0,a.jsx)(e,{...s}):null}}},9625:(e,t,s)=>{"use strict";s.d(t,{U:()=>i});var a=s(95155),l=s(53661),c=s(8368),r=s(73649);function i(e){let{children:t,title:s,breadcrumbs:l=[],className:i,actions:n}=e;return(0,a.jsx)(r.default,{userRole:"policy-holder",children:(0,a.jsxs)("div",{className:(0,c.cn)("p-6 space-y-6",i),children:[(0,a.jsx)("div",{className:"",children:(0,a.jsxs)("div",{className:"flex justify-between items-start",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-[32px] font-medium text-gray-800 mb-2",children:s}),(0,a.jsxs)("div",{className:"text-gray-500 flex items-center gap-2",children:[(0,a.jsx)("span",{children:"Dashboard"}),l.map((e,t)=>(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-gray-400",children:"›"}),(0,a.jsx)("span",{className:t===l.length-1?"text-blue-600":"text-gray-500",children:e})]},t))]})]}),n&&(0,a.jsx)("div",{className:"flex gap-3",children:n})]})}),(0,a.jsx)("div",{children:t})]})})}(0,l.r)(i,"policy-holder")},92501:(e,t,s)=>{"use strict";s.d(t,{R:()=>l});var a=s(95155);function l(){return(0,a.jsx)("div",{className:"flex items-center justify-center min-h-[700px]",children:(0,a.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900"})})}},62838:(e,t,s)=>{"use strict";s.d(t,{Y:()=>l});var a=s(14980);let l={getProfile:async e=>{try{return await a.Ay.get("/policyholder/profile/".concat(e))}catch(e){throw e}},getPolicyInfo:async e=>{try{return await a.Ay.get("/policyholder/policy/".concat(e))}catch(e){throw e}},getMaturityDetails:async e=>{try{return await a.Ay.get("/policyholder/maturity/".concat(e))}catch(e){throw e}},getPaymentHistory:async e=>{try{return await a.Ay.get("/policyholder/payments/".concat(e))}catch(e){throw e}},getNomineeInfo:async e=>{try{return await a.Ay.get("/policyholder/nominee/".concat(e))}catch(e){throw e}}}}},e=>{var t=t=>e(e.s=t);e.O(0,[9229,3391,8405,7970,1181,8173,2662,8993,4980,3649,8441,1517,7358],()=>t(61162)),_N_E=e.O()}]);