Files
aso/public/dashboard/assets/CreateUpdate.41e0c10c.js
2023-02-15 09:07:33 +07:00

55 lines
22 KiB
JavaScript

import{H as Ye}from"./HeaderBreadcrumbs.5be7a6b4.js";import{P as Ve}from"./Page.aa656a85.js";import{w as xe,v as Ce,bV as Ie,t as F,O as M,z as m,bW as Se,r as p,x as Le,y as se,X as je,j as s,f as t,D as te,E as Pe,aC as Xe,aD as Ke,bX as ie,V as ae,bY as Qe,aL as Ze,aH as Je,aO as et,bZ as ke,M as tt,Q as Ee,S as w,av as be,au as Ue,$ as oe,Y as le,a as at,b0 as nt,c as rt,d as Re,b1 as it,e as ot,F as st,T as E,R as Ae,an as ne,K as Me,h as De,b_ as ce,g as de,b$ as ue,bU as pe,c0 as fe,k as Be,o as lt,ap as ct,aT as dt,C as ut}from"./index.ef35a7e7.js";import{M as pt}from"./MuiDialog.ba489843.js";import{L as ft,a as gt}from"./LaravelTable.07d8c165.js";import{T as ve,a as j,b as S,c as o}from"./TableRow.e3e9b73a.js";import{G as re}from"./Grid.ba6e5a37.js";import{A as Ne}from"./Autocomplete.eb44dd5e.js";import"./jsx-runtime_commonjs-proxy.a0db3bf1.js";import"./DialogContent.e5ce391a.js";import"./DialogTitle.161ebb47.js";import"./BasePagination.b907cc44.js";import"./Card.cc6fb9c1.js";import"./TableContainer.d3d72d8f.js";import"./Chip.8bf36fd3.js";function ht(e){return Ce("MuiLinearProgress",e)}const mt=xe("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]),Te=mt,bt=["className","color","value","valueBuffer","variant"];let X=e=>e,Oe,we,Fe,qe,ze,Ge;const ye=4,vt=Ie(Oe||(Oe=X`
0% {
left: -35%;
right: 100%;
}
60% {
left: 100%;
right: -90%;
}
100% {
left: 100%;
right: -90%;
}
`)),yt=Ie(we||(we=X`
0% {
left: -200%;
right: 100%;
}
60% {
left: 107%;
right: -8%;
}
100% {
left: 107%;
right: -8%;
}
`)),xt=Ie(Fe||(Fe=X`
0% {
opacity: 1;
background-position: 0 -23px;
}
60% {
opacity: 0;
background-position: 0 -23px;
}
100% {
opacity: 1;
background-position: -200px -23px;
}
`)),Ct=e=>{const{classes:a,variant:n,color:i}=e,h={root:["root",`color${M(i)}`,n],dashed:["dashed",`dashedColor${M(i)}`],bar1:["bar",`barColor${M(i)}`,(n==="indeterminate"||n==="query")&&"bar1Indeterminate",n==="determinate"&&"bar1Determinate",n==="buffer"&&"bar1Buffer"],bar2:["bar",n!=="buffer"&&`barColor${M(i)}`,n==="buffer"&&`color${M(i)}`,(n==="indeterminate"||n==="query")&&"bar2Indeterminate",n==="buffer"&&"bar2Buffer"]};return Pe(h,ht,a)},$e=(e,a)=>a==="inherit"?"currentColor":e.vars?e.vars.palette.LinearProgress[`${a}Bg`]:e.palette.mode==="light"?Xe(e.palette[a].main,.62):Ke(e.palette[a].main,.5),It=F("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,a)=>{const{ownerState:n}=e;return[a.root,a[`color${M(n.color)}`],a[n.variant]]}})(({ownerState:e,theme:a})=>m({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},backgroundColor:$e(a,e.color)},e.color==="inherit"&&e.variant!=="buffer"&&{backgroundColor:"none","&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}},e.variant==="buffer"&&{backgroundColor:"transparent"},e.variant==="query"&&{transform:"rotate(180deg)"})),St=F("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,a)=>{const{ownerState:n}=e;return[a.dashed,a[`dashedColor${M(n.color)}`]]}})(({ownerState:e,theme:a})=>{const n=$e(a,e.color);return m({position:"absolute",marginTop:0,height:"100%",width:"100%"},e.color==="inherit"&&{opacity:.3},{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`,backgroundSize:"10px 10px",backgroundPosition:"0 -23px"})},Se(qe||(qe=X`
animation: ${0} 3s infinite linear;
`),xt)),Lt=F("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,a)=>{const{ownerState:n}=e;return[a.bar,a[`barColor${M(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&a.bar1Indeterminate,n.variant==="determinate"&&a.bar1Determinate,n.variant==="buffer"&&a.bar1Buffer]}})(({ownerState:e,theme:a})=>m({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",backgroundColor:e.color==="inherit"?"currentColor":(a.vars||a).palette[e.color].main},e.variant==="determinate"&&{transition:`transform .${ye}s linear`},e.variant==="buffer"&&{zIndex:1,transition:`transform .${ye}s linear`}),({ownerState:e})=>(e.variant==="indeterminate"||e.variant==="query")&&Se(ze||(ze=X`
width: auto;
animation: ${0} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
`),vt)),Pt=F("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,a)=>{const{ownerState:n}=e;return[a.bar,a[`barColor${M(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&a.bar2Indeterminate,n.variant==="buffer"&&a.bar2Buffer]}})(({ownerState:e,theme:a})=>m({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},e.variant!=="buffer"&&{backgroundColor:e.color==="inherit"?"currentColor":(a.vars||a).palette[e.color].main},e.color==="inherit"&&{opacity:.3},e.variant==="buffer"&&{backgroundColor:$e(a,e.color),transition:`transform .${ye}s linear`}),({ownerState:e})=>(e.variant==="indeterminate"||e.variant==="query")&&Se(Ge||(Ge=X`
width: auto;
animation: ${0} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
`),yt)),$t=p.exports.forwardRef(function(a,n){const i=Le({props:a,name:"MuiLinearProgress"}),{className:h,color:u="primary",value:b,valueBuffer:v,variant:x="indeterminate"}=i,L=se(i,bt),C=m({},i,{color:u,variant:x}),f=Ct(C),R=je(),$={},_={bar1:{},bar2:{}};if((x==="determinate"||x==="buffer")&&b!==void 0){$["aria-valuenow"]=Math.round(b),$["aria-valuemin"]=0,$["aria-valuemax"]=100;let d=b-100;R.direction==="rtl"&&(d=-d),_.bar1.transform=`translateX(${d}%)`}if(x==="buffer"&&v!==void 0){let d=(v||0)-100;R.direction==="rtl"&&(d=-d),_.bar2.transform=`translateX(${d}%)`}return s(It,m({className:te(f.root,h),ownerState:C,role:"progressbar"},$,{ref:n},L,{children:[x==="buffer"?t(St,{className:f.dashed,ownerState:C}):null,t(Lt,{className:f.bar1,ownerState:C,style:_.bar1}),x==="determinate"?null:t(Pt,{className:f.bar2,ownerState:C,style:_.bar2})]}))}),_t=$t;function kt(e){return Ce("MuiListItem",e)}const Rt=xe("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]),V=Rt;function At(e){return Ce("MuiListItemSecondaryAction",e)}xe("MuiListItemSecondaryAction",["root","disableGutters"]);const Mt=["className"],Dt=e=>{const{disableGutters:a,classes:n}=e;return Pe({root:["root",a&&"disableGutters"]},At,n)},Bt=F("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,a)=>{const{ownerState:n}=e;return[a.root,n.disableGutters&&a.disableGutters]}})(({ownerState:e})=>m({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},e.disableGutters&&{right:0})),We=p.exports.forwardRef(function(a,n){const i=Le({props:a,name:"MuiListItemSecondaryAction"}),{className:h}=i,u=se(i,Mt),b=p.exports.useContext(ie),v=m({},i,{disableGutters:b.disableGutters}),x=Dt(v);return t(Bt,m({className:te(x.root,h),ownerState:v,ref:n},u))});We.muiName="ListItemSecondaryAction";const Nt=We,Tt=["className"],Ot=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],wt=(e,a)=>{const{ownerState:n}=e;return[a.root,n.dense&&a.dense,n.alignItems==="flex-start"&&a.alignItemsFlexStart,n.divider&&a.divider,!n.disableGutters&&a.gutters,!n.disablePadding&&a.padding,n.button&&a.button,n.hasSecondaryAction&&a.secondaryAction]},Ft=e=>{const{alignItems:a,button:n,classes:i,dense:h,disabled:u,disableGutters:b,disablePadding:v,divider:x,hasSecondaryAction:L,selected:C}=e;return Pe({root:["root",h&&"dense",!b&&"gutters",!v&&"padding",x&&"divider",u&&"disabled",n&&"button",a==="flex-start"&&"alignItemsFlexStart",L&&"secondaryAction",C&&"selected"],container:["container"]},kt,i)},qt=F("div",{name:"MuiListItem",slot:"Root",overridesResolver:wt})(({theme:e,ownerState:a})=>m({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!a.disablePadding&&m({paddingTop:8,paddingBottom:8},a.dense&&{paddingTop:4,paddingBottom:4},!a.disableGutters&&{paddingLeft:16,paddingRight:16},!!a.secondaryAction&&{paddingRight:48}),!!a.secondaryAction&&{[`& > .${Qe.root}`]:{paddingRight:48}},{[`&.${V.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${V.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:ae(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${V.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:ae(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${V.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},a.alignItems==="flex-start"&&{alignItems:"flex-start"},a.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},a.button&&{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${V.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:ae(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:ae(e.palette.primary.main,e.palette.action.selectedOpacity)}}},a.hasSecondaryAction&&{paddingRight:48})),zt=F("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,a)=>a.container})({position:"relative"}),Gt=p.exports.forwardRef(function(a,n){const i=Le({props:a,name:"MuiListItem"}),{alignItems:h="center",autoFocus:u=!1,button:b=!1,children:v,className:x,component:L,components:C={},componentsProps:f={},ContainerComponent:R="li",ContainerProps:{className:$}={},dense:_=!1,disabled:d=!1,disableGutters:U=!1,disablePadding:D=!1,divider:c=!1,focusVisibleClassName:B,secondaryAction:N,selected:W=!1,slotProps:K={},slots:H={}}=i,q=se(i.ContainerProps,Tt),r=se(i,Ot),Y=p.exports.useContext(ie),z=p.exports.useMemo(()=>({dense:_||Y.dense||!1,alignItems:h,disableGutters:U}),[h,Y.dense,_,U]),Q=p.exports.useRef(null);Ze(()=>{u&&Q.current&&Q.current.focus()},[u]);const T=p.exports.Children.toArray(v),Z=T.length&&Je(T[T.length-1],["ListItemSecondaryAction"]),I=m({},i,{alignItems:h,autoFocus:u,button:b,dense:z.dense,disabled:d,disableGutters:U,disablePadding:D,divider:c,hasSecondaryAction:Z,selected:W}),J=Ft(I),ee=et(Q,n),G=H.root||C.Root||qt,O=K.root||f.root||{},k=m({className:te(J.root,O.className,x),disabled:d},r);let l=L||"li";return b&&(k.component=L||"div",k.focusVisibleClassName=te(V.focusVisible,B),l=tt),Z?(l=!k.component&&!L?"div":l,R==="li"&&(l==="li"?l="div":k.component==="li"&&(k.component="div")),t(ie.Provider,{value:z,children:s(zt,m({as:R,className:te(J.container,$),ref:ee,ownerState:I},q,{children:[t(G,m({},O,!ke(G)&&{as:l,ownerState:m({},I,O.ownerState)},k,{children:T})),T.pop()]}))})):t(ie.Provider,{value:z,children:s(G,m({},O,{as:l,ref:ee},!ke(G)&&{ownerState:m({},I,O.ownerState)},k,{children:[T,N&&t(Nt,{children:N})]}))})}),ge=Gt,he=Ee(t("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add"),me=Ee(t("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline");F(_t)(({theme:e})=>({height:10,borderRadius:6,[`&.${Te.colorPrimary}`]:{backgroundColor:e.palette.grey[e.palette.mode==="light"?300:800]},[`& .${Te.bar}`]:{borderRadius:6,background:"linear-gradient(270deg, #19BBBB 38.42%, #FF9565 76.21%, #FE7253 104.02%)"}}));function Et({openDialog:e,setOpenDialog:a,onSelect:n}){const[i,h]=p.exports.useState(!1),[u,b]=p.exports.useState(ft),[v,x]=p.exports.useState({search:""}),L=c=>{x({...v,search:c.target.value})},C=async(c=null)=>{h(!0);const B=c||{},N=await le.get("/members",{params:B});h(!1),b(N.data)},f=async c=>{await C(c)},R=c=>{c.preventDefault(),f(v)};p.exports.useEffect(()=>{console.log("effect openDialog")},[e]);const $=()=>{console.log("handle change")},_=c=>{var B,N,W,K,H,q,r;return t(Ue.Fragment,{children:s(S,{sx:{"& > *":{borderBottom:"unset"}},children:[t(o,{align:"left",children:c.row.member_id}),t(o,{align:"left",children:c.row.principal_id}),t(o,{align:"left",children:(N=(B=c.row.employeds)==null?void 0:B[0])==null?void 0:N.nik}),t(o,{align:"left",children:(W=c.row.current_policy)==null?void 0:W.policy_id}),t(o,{align:"left",children:(K=c.row.current_policy)==null?void 0:K.start}),t(o,{align:"left",children:c.row.name}),t(o,{align:"left",children:c.row.nric}),t(o,{align:"left",children:c.row.email}),t(o,{align:"left",children:(H=c.row.current_plan)==null?void 0:H.code}),t(o,{align:"left",children:(q=c.row.current_policy)==null?void 0:q.start}),t(o,{align:"left",children:(r=c.row.current_policy)==null?void 0:r.end}),t(o,{align:"right",style:{position:"sticky",right:0},children:t(oe,{variant:"outlined",color:"success",style:{backgroundColor:"#ffffff"},size:"small",onClick:()=>{n(c.row),a(!1)},children:"Select"})})]})})},d={fontWeight:"bold"},U=()=>s(ve,{"aria-label":"collapsible table",children:[t(j,{children:s(S,{children:[t(o,{style:d,align:"left"}),t(o,{style:d,align:"left",children:"Type"}),t(o,{style:d,align:"left",children:"Code"}),t(o,{style:d,align:"left",children:"Name"}),t(o,{style:d,align:"left",children:"Version"}),t(o,{style:d,align:"right",children:"Status"}),t(o,{style:d,align:"right",children:"Action"})]})}),i?t(j,{children:t(S,{children:t(o,{colSpan:8,align:"center",children:"Loading"})})}):u.data.length===0?t(j,{children:t(S,{children:t(o,{colSpan:8,align:"center",children:"No Data"})})}):t(j,{children:u.data.map(c=>t(_,{row:c,onSelect:!0},c.id))})]});return t(pt,{title:{name:"Select Member"},openDialog:e,setOpenDialog:a,content:(()=>s(w,{spacing:1,marginTop:2,children:[t("form",{onSubmit:R,children:t(be,{label:"Search",variant:"outlined",fullWidth:!0,onChange:L,value:v.search,autoFocus:!0})}),t(gt,{isLoading:i,lastRequest:0,data:u,handlePageChange:$,TableContent:t(U,{})})]}))(),maxWidth:"xl"})}function Ut({isEdit:e,currentClaim:a}){var J,ee,G,O,k;const n=at(),{enqueueSnackbar:i}=nt(),h=rt().shape({name:Re().required("Name is required"),code:Re().required("Corporate Code is required"),active:it().required("Corporate Status is required")}),u=p.exports.useMemo(()=>({member:(a==null?void 0:a.member)||{},member_id:(a==null?void 0:a.member_id)||null,diagnosis_id:(a==null?void 0:a.diagnosis_id)||null,total_claim:(a==null?void 0:a.total_claim)||0}),[a]),b=ot({resolver:lt(h),defaultValues:u}),{reset:v,watch:x,control:L,setValue:C,getValues:f,setError:R,handleSubmit:$,formState:{isSubmitting:_}}=b;x();const[d,U]=p.exports.useState(!1),[D,c]=p.exports.useState(!1),[B,N]=p.exports.useState([]),[W,K]=p.exports.useState([]),[H,q]=p.exports.useState(!1),[r,Y]=p.exports.useState({});p.exports.useEffect(()=>{console.log("defaultValues",u),e&&a&&(v(u),Y(u.member)),e||(v(u),Y(u.member))},[e,a]);const z=(l,P)=>{var A;const g=l.target.files,y=(A=f(`uploaded_files.${P}`))!=null?A:[];C(`uploaded_files.${P}`,[...y,...g]),console.log("currentFiles",f("uploaded_files"))},Q=l=>{Y(l)},T=async()=>{console.log("CHECKING LIMIT")},Z=async l=>{var g,y;try{if(e){const A=await le.put("/claims/"+(a==null?void 0:a.id),l)}else{const A=await le.post("/claims",l)}v(),i(e?"Organizations Udpated Successfully!":"Organizations Created Successfully!",{variant:"success"}),n("/claims")}catch(A){if(A&&A.response.status===422)for(const[He,_e]of Object.entries(A.response.data.errors))R(He,{message:_e[0]}),i((g=_e[0])!=null?g:"Failed Processing Request",{variant:"error"});else i((y=A.message)!=null?y:"Failed Processing Request",{variant:"error"})}const P=document==null?void 0:document.querySelector("ascent");P!=null&&(P.innerHTML="")},I={};return s(st,{methods:b,onSubmit:$(Z),children:[s(w,{spacing:3,children:[t(E,{variant:"h6",children:"Member"}),t(w,{spacing:2,direction:"row",children:t(re,{item:!0,xs:12,children:t(Ae,{name:"member_id",label:"Member",variant:"outlined",fullWidth:!0,value:(r==null?void 0:r.name)||"",InputProps:{readOnly:!0},onClick:()=>{e||q(!0),e&&i("Cannot Change Member",{variant:"error"})}})})}),(r==null?void 0:r.id)&&t(w,{children:s(re,{container:!0,spacing:2,children:[t(re,{item:!0,xs:12,md:6,children:t(ve,{border:"light-700",children:s(j,{children:[s(S,{children:[t(o,{style:I,align:"left",children:"Name"}),t(o,{align:"left",children:r==null?void 0:r.full_name})]}),s(S,{children:[t(o,{style:I,align:"left",children:"DOB"}),s(o,{align:"left",children:[r==null?void 0:r.birth_date," (",(r==null?void 0:r.age)+" years",")"]})]}),s(S,{children:[t(o,{style:I,align:"left",children:"Marital Status"}),t(o,{align:"left",children:r==null?void 0:r.marital_status})]}),s(S,{children:[t(o,{style:I,align:"left",children:"Record Type"}),t(o,{align:"left",children:r==null?void 0:r.record_type})]}),s(S,{children:[t(o,{style:I,align:"left",children:"Principal ID"}),s(o,{align:"left",children:[r==null?void 0:r.principal_id," (",r==null?void 0:r.relation_with_principal,")"]})]})]})})}),t(re,{item:!0,xs:12,md:6,children:t(ve,{border:"light-700",children:s(j,{children:[s(S,{children:[t(o,{style:I,align:"left",children:"Plan"}),t(o,{align:"left",children:(J=r==null?void 0:r.current_plan)==null?void 0:J.code})]}),s(S,{children:[t(o,{style:I,align:"left",children:"Active"}),s(o,{align:"left",children:[(ee=r==null?void 0:r.current_plan)==null?void 0:ee.start," -"," ",(G=r==null?void 0:r.current_plan)==null?void 0:G.end," (Active)"]})]}),s(S,{children:[t(o,{style:I,align:"left",children:"Corporate Limit"}),s(o,{align:"left",children:[ne(0)," / ",ne((O=r==null?void 0:r.current_plan)==null?void 0:O.limit_rules)]})]}),s(S,{children:[t(o,{style:I,align:"left",children:"Plan Usage"}),s(o,{align:"left",children:[ne(0)," / ",ne((k=r==null?void 0:r.current_plan)==null?void 0:k.limit_rules)]})]})]})})})]})}),t(Me,{name:"benefit",control:L,render:({field:{onChange:l,value:P}})=>t(Ne,{options:B,getOptionLabel:g=>g?`#${g.id} (${g.code}) ${g.description}`:"",value:P||"",onChange:(g,y)=>{C("benefit_id",y==null?void 0:y.id),l(y)},renderInput:g=>t(be,{name:"benefit",...g,label:"Benefit",variant:"outlined",fullWidth:!0})})}),t(Me,{name:"diagnosis",control:L,render:({field:{onChange:l,value:P}})=>t(Ne,{options:W,getOptionLabel:g=>g?`(${g.code}) ${g.name}`:"",value:P||"",onChange:(g,y)=>{C("diagnosis_id",y==null?void 0:y.id),l(y)},renderInput:g=>t(be,{name:"diagnosis",...g,label:"Diagnosis",variant:"outlined",fullWidth:!0,onKeyPress:y=>{y.key==="Enter"&&searchDiagnosis(y.target.value)}})})}),d&&t(w,{sx:{backgroundColor:"gray",paddingY:1,paddingX:1.5,mb:2,borderRadius:"3-xl"},children:s(E,{sx:{typography:"caption",display:"flex",alignItems:"center"},children:[t(De,{icon:"bxs:info-circle",width:12,height:13,sx:{color:"#424242",marginRight:"6px"}}),t(E,{variant:"caption",component:"span",children:"Please Wait, Checking Eligibilty"})]})}),!1,!d&&D!==null&&D&&s(w,{sx:{backgroundColor:"#B2E8E8",paddingY:1,paddingX:1.5,mb:2,borderRadius:"3-xl"},children:[s(E,{sx:{typography:"caption",display:"flex",alignItems:"center"},children:[t(De,{icon:"bxs:lock-alt",width:12,height:13,sx:{color:"#424242",marginRight:"6px"}}),t(E,{variant:"caption",component:"span",children:"Diagnosis is Eligible"})]}),t(E,{sx:{typography:"caption",color:"#637381"},children:"125.000.000 / 125.000.000"})]}),!d&&D!==null&&!D&&t(w,{sx:{backgroundColor:"#B2E8E8",paddingY:1,paddingX:1.5,mb:2,borderRadius:"3-xl"}}),t(Ae,{type:"number",name:"total_claim",label:"Total Claim"}),e&&s(Ue.Fragment,{children:[t(E,{variant:"h6",children:"Documents"}),t(ce,{children:(f("uploaded_files.invoice")&&f("uploaded_files.invoice").length?f("uploaded_files.invoice"):[]).map((l,P)=>s(ge,{secondaryAction:t(de,{edge:"end","aria-label":"delete",children:t(me,{})}),children:[t(ue,{children:t(pe,{children:"I"})}),t(fe,{primary:l.name,secondary:l.type})]}))}),s(oe,{variant:"outlined",startIcon:t(he,{}),component:"label",sx:{paddingY:2,width:"100%",":hover":{border:"none"}},children:["Invoice",t("input",{name:"invoice",hidden:!0,accept:"image/*,application/pdf",multiple:!0,type:"file",onChange:l=>{z(l,"invoice")}})]}),t(ce,{children:(f("uploaded_files.prescription")&&f("uploaded_files.prescription").length?f("uploaded_files.prescription"):[]).map((l,P)=>s(ge,{secondaryAction:t(de,{edge:"end","aria-label":"delete",children:t(me,{})}),children:[t(ue,{children:t(pe,{children:"P"})}),t(fe,{primary:l.name,secondary:l.type})]}))}),s(oe,{variant:"outlined",startIcon:t(he,{}),component:"label",sx:{paddingY:2,width:"100%",":hover":{border:"none"}},children:["Prescription",t("input",{name:"prescription",hidden:!0,accept:"image/*,application/pdf",multiple:!0,type:"file",onChange:l=>{z(l,"prescription")}})]}),t(ce,{children:(f("uploaded_files.diagnosis")&&f("uploaded_files.diagnosis").length?f("uploaded_files.diagnosis"):[]).map((l,P)=>s(ge,{secondaryAction:t(de,{edge:"end","aria-label":"delete",children:t(me,{})}),children:[t(ue,{children:t(pe,{children:"DR"})}),t(fe,{primary:l.name,secondary:l.type})]}))}),s(oe,{variant:"outlined",startIcon:t(he,{}),component:"label",sx:{paddingY:2,width:"100%",":hover":{border:"none"}},children:["Doctor Result",t("input",{name:"invoice",hidden:!0,accept:"image/*,application/pdf",multiple:!0,type:"file",onChange:l=>{z(l,"diagnosis")}})]})]}),D===!0?t(Be,{onClick:$(Z),variant:"contained",color:"success",style:{color:"#ffffff"},size:"large",fullWidth:!0,loading:d,children:"Create Claim"}):t(Be,{onClick:T,variant:"outlined",size:"large",fullWidth:!0,loading:d,children:"Check Limit"})]}),t(Et,{openDialog:H,setOpenDialog:q,onSelect:Q})]})}function ia(){var u;const{themeStretch:e}=ct(),{id:a}=dt(),n=!!a,[i,h]=p.exports.useState();return p.exports.useEffect(()=>{n&&le.get("/claims/"+a).then(b=>{h(b.data)})},[a]),t(Ve,{title:n?`Edit Claim : ${i==null?void 0:i.id}`:"Create New Claim",children:s(ut,{maxWidth:e?!1:"xl",children:[t(w,{direction:"row",alignItems:"center",children:t(Ye,{heading:n?`Edit Claim : ${i==null?void 0:i.code}`:"Create New Claim",links:[{name:"Dashboard",href:"/dashboard"},{name:"Claim",href:"/claims"},{name:n?(u=i==null?void 0:i.id)!=null?u:"":"Create"}]})}),t(Ut,{isEdit:n,currentClaim:i})]})})}export{ia as default};