1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6183],{80277:function(e,t,r){r.d(t,{_:function(){return x}});var n=r(27324),a=r(18974),s=r(5534),o=r(76486),l=r(64852);r(32145);var i=(0,r(42653).$)("a7098996fbf282de8ba7482823d06f4568a1b477"),d=r(90058),c=r(25587),u=r(38740),m=r(96716);let f=l.Ry({entryDate:l.Z_().min(1,"Date is required"),paydexScore:l.Z_().optional().transform(e=>e?parseInt(e,10):null).pipe(l.Rx().int().min(0).max(100).nullable()),intelliscore:l.Z_().optional().transform(e=>e?parseInt(e,10):null).pipe(l.Rx().int().min(0).max(100).nullable()),commercialRiskScore:l.Z_().optional().transform(e=>e?parseInt(e,10):null).pipe(l.Rx().int().min(101).max(992).nullable()),notes:l.Z_().optional()});function x(e){let{open:t,onClose:r,applicationId:l,onSaved:x}=e,[p,g]=(0,a.useState)(!1),[h,v]=(0,a.useState)(""),y=(0,s.cI)({resolver:(0,o.F)(f),defaultValues:{entryDate:new Date().toISOString().split("T")[0],paydexScore:"",intelliscore:"",commercialRiskScore:"",notes:""}});async function b(e){g(!0),v("");try{var t,n,a;let s=f.parse(e);await i({applicationId:l,entryDate:s.entryDate,paydexScore:null!==(t=s.paydexScore)&&void 0!==t?t:null,intelliscore:null!==(n=s.intelliscore)&&void 0!==n?n:null,commercialRiskScore:null!==(a=s.commercialRiskScore)&&void 0!==a?a:null,notes:s.notes}),y.reset(),null==x||x(),r()}catch(e){v(e instanceof Error?e.message:"Failed to save score entry.")}finally{g(!1)}}return(0,n.jsx)(d.Vq,{open:t,onOpenChange:e=>!e&&r(),children:(0,n.jsxs)(d.cZ,{className:"sm:max-w-md",children:[(0,n.jsx)(d.fK,{children:(0,n.jsx)(d.$N,{className:"font-display font-bold",children:"Add Score Reading"})}),(0,n.jsx)(c.l0,{...y,children:(0,n.jsxs)("form",{onSubmit:y.handleSubmit(b),className:"space-y-4",children:[(0,n.jsx)(c.Wi,{control:y.control,name:"entryDate",render:e=>{let{field:t}=e;return(0,n.jsxs)(c.xJ,{children:[(0,n.jsx)(c.lX,{children:"Date"}),(0,n.jsx)(c.NI,{children:(0,n.jsx)(u.I,{type:"date",...t})}),(0,n.jsx)(c.zG,{})]})}}),(0,n.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,n.jsx)(c.Wi,{control:y.control,name:"paydexScore",render:e=>{let{field:t}=e;return(0,n.jsxs)(c.xJ,{children:[(0,n.jsx)(c.lX,{className:"text-xs",children:"PAYDEX"}),(0,n.jsx)(c.NI,{children:(0,n.jsx)(u.I,{type:"number",min:0,max:100,placeholder:"0â100",...t})}),(0,n.jsx)(c.zG,{})]})}}),(0,n.jsx)(c.Wi,{control:y.control,name:"intelliscore",render:e=>{let{field:t}=e;return(0,n.jsxs)(c.xJ,{children:[(0,n.jsx)(c.lX,{className:"text-xs",children:"Intelliscore"}),(0,n.jsx)(c.NI,{children:(0,n.jsx)(u.I,{type:"number",min:0,max:100,placeholder:"0â100",...t})}),(0,n.jsx)(c.zG,{})]})}}),(0,n.jsx)(c.Wi,{control:y.control,name:"commercialRiskScore",render:e=>{let{field:t}=e;return(0,n.jsxs)(c.xJ,{children:[(0,n.jsx)(c.lX,{className:"text-xs",children:"Comm. Risk"}),(0,n.jsx)(c.NI,{children:(0,n.jsx)(u.I,{type:"number",min:101,max:992,placeholder:"101â992",...t})}),(0,n.jsx)(c.zG,{})]})}})]}),(0,n.jsx)(c.Wi,{control:y.control,name:"notes",render:e=>{let{field:t}=e;return(0,n.jsxs)(c.xJ,{children:[(0,n.jsx)(c.lX,{children:"Notes (optional)"}),(0,n.jsx)(c.NI,{children:(0,n.jsx)(u.I,{placeholder:"e.g. After opening vendor account",...t})}),(0,n.jsx)(c.zG,{})]})}}),h&&(0,n.jsx)("p",{className:"text-sm text-destructive",children:h}),(0,n.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,n.jsx)(m.z,{type:"button",variant:"ghost",className:"flex-1",onClick:r,disabled:p,children:"Cancel"}),(0,n.jsx)(m.z,{type:"submit",className:"flex-1",disabled:p,children:p?"Savingâ¦":"Save Entry"})]})]})})]})})}},61736:function(e,t,r){r.d(t,{C:function(){return l}});var n=r(27324);r(18974);var a=r(42041),s=r(11410);let o=(0,a.j)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:r,...a}=e;return(0,n.jsx)("div",{className:(0,s.cn)(o({variant:r}),t),...a})}},96716:function(e,t,r){r.d(t,{z:function(){return d}});var n=r(27324),a=r(18974),s=r(22560),o=r(42041),l=r(11410);let i=(0,o.j)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef((e,t)=>
1{let{className:r,variant:a,size:o,asChild:d=!1,...c}=e,u=d?s.g7:"button";return(0,n.jsx)(u,{className:(0,l.cn)(i({variant:a,size:o,className:r})),ref:t,...c})});d.displayName="Button"},90058:function(e,t,r){r.d(t,{$N:function(){return g},Be:function(){return h},Vq:function(){return i},cN:function(){return p},cZ:function(){return f},fK:function(){return x},hg:function(){return d}});var n=r(27324),a=r(18974),s=r(68698),o=r(18059),l=r(11410);let i=s.fC,d=s.xz,c=s.h_;function u(){return a.useEffect(()=>()=>{document.body.style.removeProperty("pointer-events")},[]),null}s.x8;let m=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(s.aV,{ref:t,className:(0,l.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...a})});m.displayName=s.aV.displayName;let f=a.forwardRef((e,t)=>{let{className:r,children:a,onCloseAutoFocus:i,...d}=e;return(0,n.jsxs)(c,{children:[(0,n.jsx)(m,{}),(0,n.jsxs)(s.VY,{ref:t,className:(0,l.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),onCloseAutoFocus:null!=i?i:e=>e.preventDefault(),...d,children:[(0,n.jsx)(u,{}
1),a,(0,n.jsxs)(s.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,n.jsx)(o.Z,{className:"h-4 w-4"}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});f.displayName=s.VY.displayName;let x=e=>{let{className:t,...r}=e;return(0,n.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...r})};x.displayName="DialogHeader";let p=e=>{let{className:t,...r}=e;return(0,n.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})};p.displayName="DialogFooter";let g=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(s.Dx,{ref:t,className:(0,l.cn)("text-lg font-semibold leading-none tracking-tight",r),...a})});g.displayName=s.Dx.displayName;let h=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(s.dk,{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",r),...a})});h.displayName=s.dk.displayName},25587:function(e,t,r){r.d(t,{NI:function(){return g},Wi:function(){return u},l0:function(){return d},lX:function(){return p},xJ:function(){return x},zG:function(){return h}});var n=r(27324),a=r(18974),s=r(22560),o=r(5534),l=r(11410),i=r(39124);let d=o.RV,c=a.createContext(null),u=e=>{let{...t}=e;return(0,n.jsx)(c.Provider,{value:{name:t.name},children:(0,n.jsx)(o.Qr,{...t})})},m=()=>{let e=a.useContext(c),t=a.useContext(f),{getFieldState:r,formState:n}=(0,o.Gc)();if(!e)throw Error("useFormField should be used within <FormField>");if(!t)throw Error("useFormField should be used within <FormItem>");let s=r(e.name,n),{id:l}=t;return{id:l,name:e.name,formItemId:"".concat(l,"-form-item"),formDescriptionId:"".concat(l,"-form-item-description"),formMessageId:"".concat(l,"-form-item-message"),...s}},f=a.createContext(null),x=a.forwardRef((e,t)=>{let{className:r,...s}=e,o=a.useId();return(0,n.jsx)(f.Provider,{value:{id:o},children:(0,n.jsx)("div",{ref:t,className:(0,l.cn)("space-y-2",r),...s})})});x.displayName="FormItem";let p=a.forwardRef((e,t)=>{let{className:r,...a}=e,{error:s,formItemId:o}=m();return(0,n.jsx)(i._,{ref:t,className:(0,l.cn)(s&&"text-destructive",r),htmlFor:o,...a})});p.displayName="FormLabel";let g=a.forwardRef((e,t)=>{let{...r}=e,{error:a,formItemId:o,formDescriptionId:l,formMessageId:i}=m();return(0,n.jsx)(s.g7,{ref:t,id:o,"aria-describedby":a?"".concat(l," ").concat(i):"".concat(l),"aria-invalid":!!a,...r})});g.displayName="FormControl",a.forwardRef((e,t)=>{let{className:r,...a}=e,{formDescriptionId:s}=m();return(0,n.jsx)("p",{ref:t,id:s,className:(0,l.cn)("text-[0.8rem] text-muted-foreground",r),...a})}).displayName="FormDescription";let h=a.forwardRef((e,t)=>{var r;let{className:a,children:s,...o}=e,{error:i,formMessageId:d}=m(),c=i?String(null!==(r=null==i?void 0:i.message)&&void 0!==r?r:""):s;return c?(0,n.jsx)("p",{ref:t,id:d,className:(0,l.cn)("text-[0.8rem] font-medium text-destructive",a),...o,children:c}):null});h.displayName="FormMessage"},38740:function(e,t,r){r.d(t,{I:function(){return o}});var n=r(27324),a=r(18974),s=r(11410);let o=a.forwardRef((e,t)=>{let{className:r,type:a,...o}=e;return(0,n.jsx)("input",{type:a,className:(0,s.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:t,...o})});o.displayName="Input"},39124:function(e,t,r){r.d(t,{_:function(){return d}});var n=r(27324),a=r(18974),s=r(78100),o=r(42041),l=r(11410);let i=(0,o.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(s.f,{ref:t,className:(0,l.cn)(i(),r),...a})});d.displayName=s.f.displayName}}]);
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.