PageSourceSearch

https://app.avance.ai/_next/static/chunks/e5d89fbb0c5df440.js

js avance.ai collected 2026-10-05 13:30:23 UTC 13,267 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,419829,e=>{"use strict";e.s(["CHART_ERROR",0,"#ef4444","CHART_INFO",0,"#3b82f6","CHART_SUCCESS",0,"#22c55e","CHART_WARNING",0,"#f59e0b","COLORS",0,["#3b82f6","#22c55e","#ef4444","#a855f7","#f97316","#06b6d4","#6366f1","#ec4899"],"PICKER_SWATCH_COLORS",0,["#E11D48","#DB2777","#C026D3","#9333EA","#7C3AED","#4F46E5","#2563EB","#0284C7","#0891B2","#0D9488","#059669","#16A34A","#65A30D","#CA8A04","#D97706","#EA580C","#DC2626","#FFFFFF","#FAFAFA","#F5F5F5","#E5E5E5","#D4D4D4","#A3A3A3","#737373","#525252","#404040","#262626","#171717","#0A0A0A","#000000"]])},346392,e=>{"use strict";var a=e.i(435564),i=e.i(581509);function l({title:e,description:l,actions:t,notice:n,children:r}){return(0,a.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-3 overflow-hidden",children:[(0,a.jsx)(i.PageHeader,{title:e,description:l,actions:t,className:"min-h-10 items-center border-b pb-2"}),n?(0,a.jsx)("div",{className:"min-w-0 shrink-0",children:n}):null,r]})}e.s(["ClinicalPageShell",()=>l])},559395,e=>{"use strict";e.i(773931);var a=e.i(957655),i=e.i(810847);function l(e,l,t){return(0,i.normalizeAppError)(e,{messageMap:{...l,[a.CanonicalErrorCode.SYSTEM_UNEXPECTED]:t,FALLBACK:t}}).userMessage}e.s(["resolveClinicalUserMessage",()=>l])},256824,e=>{"use strict";var a=e.i(435564),i=e.i(318869),l=e.i(188575);let t={wrapper:(0,i.cn)("relative w-full",l.APP_LAYOUT.embeddedCollectionBody),table:"min-w-full text-left text-sm",head:"text-xs font-medium text-muted-foreground",headCell:"px-3 py-2 font-medium",row:"border-t",cell:"px-3 py-2"};function n({children:e,className:l,tableClassName:n,...r}){return(0,a.jsx)("div",{className:(0,i.cn)(t.wrapper,l),children:(0,a.jsx)("table",{className:(0,i.cn)(t.table,"[&>thead]:sticky [&>thead]:top-0 [&>thead]:z-10 [&>thead]:bg-card",n),...r,children:e})})}e.s(["CLINICAL_TABLE",0,t,"ClinicalTable",()=>n])},55624,e=>{"use strict";let a=["#3b82f6","#14b8a6","#f97316","#a855f7","#22c55e","#ef4444"];function i(e){return e.color?e.color:a[function(e){let a=0;for(let i=0;i<e.length;i+=1)a=31*a+e.charCodeAt(i)>>>0;return a}(e.id)%a.length]}e.s(["payerBadgeColor",()=>i])},323637,e=>{"use strict";var a=e.i(435564);e.i(450946);var i=e.i(679089),l=e.i(917987);e.i(525334);var t=e.i(581947);e.i(745276);var n=e.i(538373);e.i(210957);var r=e.i(699474),s=e.i(661835),d=e.i(987299),c=e.i(372057),o=e.i(17460),u=e.i(975031),m=e.i(994988),p=e.i(318869),h=e.i(726436),x=e.i(426844),y=e.i(239553);e.i(984124);var C=e.i(84422),S=e.i(48693),f=e.i(539282),b=e.i(987708),N=e.i(419829),v=e.i(986759),g=e.i(97873),j=e.i(850310),I=e.i(471135),T=e.i(396725),A=e.i(487268),E=e.i(539946),L=e.i(193506),_=e.i(424149),F=e.i(530863),P=e.i(782635),w=e.i(346392),k=e.i(256824),B=e.i(559395),U=e.i(864716),R=e.i(55624);let O="flex flex-col gap-1",$=N.COLORS,D={"#3b82f6":"blue","#22c55e":"green","#ef4444":"red","#a855f7":"purple","#f97316":"orange","#06b6d4":"cyan","#6366f1":"indigo","#ec4899":"pink"};function G({value:e,onChange:i,label:l,testIdPrefix:t,colorNames:n}){return(0,a.jsxs)("div",{className:O,children:[(0,a.jsx)("p",{className:(0,p.cn)(C.SETTINGS_UI.actionTitle,"leading-none"),children:l}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2","data-testid":`${t}-presets`,children:$.map(l=>(0,a.jsx)("button",{type:"button","data-testid":`${t}-${l}`,"aria-label":n[D[l]],className:(0,p.cn)("h-8 w-8 rounded-full border-2 transition-all",e===l?"border-foreground ring-2 ring-ring ring-offset-1":"border-transparent"),style:{backgroundColor:l},onClick:()=>i(l)},l))})]})}function K(e,a){if(null==e.data)throw Error(a);return e.data}function M({className:e}){let i=(0,F.useClinicalTranslations)().payers,{contactFieldsText:l}={...(0,u.useTranslations)(),...(0,_.useClinicalModuleTranslations)()},N=(0,g.useAppErrorToast)(),$=(0,v.useAppErrorCatalog)(),{locationId:D}=(0,y.useAuth)(),{vertical:M}=(0,x.useEntitlements)(),{subject:H}=(0,h.usePermissionsContext)(),Y=H.meets(n.SETTINGS_FEATURE_PERMISSIONS[n.SettingsFeature.PAYERS].write),V=M===s.LocationVertical.CLINICAL,{payers:z,status:q,reload:W}=(0,U.usePayers)(D,V),X="complete"===q.availability||"complete-empty"===q.availability?"ready":"error"===q.refresh||"denied"===q.availability?"error":"loading",[J,Q]=(0,o.useState)(""),[Z,ee]=(0,o.useState)(t.ClinicalPayerKind.INSURANCE),[ea,ei]=(0,o.useState)(""),[el,et]=(0,o.useState)(""),[en,er]=(0,o.useState)(null),[es,ed]=(0,o.useState)(null),[ec,eo]=(0,o.useState)(null),[eu,em]=(0,o.useState)(!1),[ep,eh]=(0,o.useState)(null),[ex,ey]=(0,o.useState)(null),[eC,eS]=(0,o.useState)(""),[ef,eb]=(0,o.useState)(""),[eN,ev]=(0,o.useState)(""),[eg,ej]=(0,o.useState)(""),[eI,eT]=(0,o.useState)(null),eA=async e=>{if(e.preventDefault(),!D||!Y)return;let a=J.trim();if(!a)return void ed(i.nameRequired);ed(null),eh(null),em(!0);try{K(await d.ClinicalPayersService.createPayerForLocation(D,{name:a,kind:Z,isActive:!0,...en?{color:en}:{},...ea?{identificationType:ea}:{},...el.trim()?{identificationNumber:el.trim()}:{}}),i.saveFailed),await W(),Q(""),ee(t.ClinicalPayerKind.INSURANCE),ei(""),et(""),er(null)}catch(e){N({error:e,context:"clinical.payers.create"}),eh((0,B.resolveClinicalUserMessage)(e,$,i.saveFailed))}finally{em(!1)}},eE=async e=>{if(!D||!Y)return;let a=eC.trim();if(!a)return void eo(i.nameRequired);eo(null),eh(null),eT(e.id);try{K(await d.ClinicalPayersService.updatePayerForLocation(D,e.id,{name:a,color:ef,identificationType:eN||null,identificationNumber:eg.trim()||null}),i.saveFailed),await W(),ey(null)}catch(e){N({error:e,context:"clinical.payers.rename"}),eh((0,B.resolveClinicalUserMessage)(e,$,i.saveFailed))}finally{eT(null)}},eL=async e=>{if(D&&Y){eh(null),eT(e.id);try{K(await d.ClinicalPayersService.updatePayerForLocation(D,e.id,{isActive:!e.isActive}),i.saveFailed),await W()}catch(e){N({error:e,context:"clinical.payers.toggle"}),eh((0,B.resolveClinicalUserMessage)(e,$,i.saveFailed))}finally{eT(null)}}};
1return(0,a.jsx)(w.ClinicalPageShell,{title:i.title,description:i.description,children:(0,a.jsx)(j.PageScrollArea,{children:(0,a.jsxs)(S.SettingsPanel,{className:(0,p.cn)("min-w-0",e),bodyClassName:"min-w-0",icon:c.IdCard,title:i.listTitle,children:[V?null:(0,a.jsx)(f.SettingsState,{status:"empty",message:i.notAvailable,description:i.notAvailableDescription}),V&&"loading"===X?(0,a.jsx)(f.SettingsState,{status:"loading",message:i.loading}):null,V&&"error"===X?(0,a.jsx)(f.SettingsState,{status:"error",message:i.loadFailed,onRetry:()=>{W()},retryLabel:i.retry}):null,V&&"ready"===X?(0,a.jsxs)("div",{className:"space-y-3","data-testid":"payers-settings-page",children:[0===z.length?(0,a.jsx)(f.SettingsState,{status:"empty",message:i.empty}):(0,a.jsxs)(k.ClinicalTable,{"data-testid":"payers-table",...(0,P.clinicalAnchor)("insurers-table"),children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:k.CLINICAL_TABLE.head,children:[(0,a.jsx)("th",{className:k.CLINICAL_TABLE.headCell,children:i.columns.name}),(0,a.jsx)("th",{className:k.CLINICAL_TABLE.headCell,children:i.columns.kind}),(0,a.jsx)("th",{className:k.CLINICAL_TABLE.headCell,children:i.columns.active})]})}),(0,a.jsx)("tbody",{children:z.map(e=>{let t=ex===e.id,n=eI===e.id;return(0,a.jsxs)("tr",{className:k.CLINICAL_TABLE.row,"data-testid":`payer-row-${e.id}`,children:[(0,a.jsx)("td",{className:(0,p.cn)(k.CLINICAL_TABLE.cell,"align-middle"),children:t?(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,a.jsx)(T.Input,{className:(0,p.cn)(C.SETTINGS_UI.control,"w-40"),value:eC,"aria-invalid":!!ec||void 0,"aria-describedby":ec?`payer-rename-error-${e.id}`:void 0,onChange:e=>{eS(e.target.value),ec&&eo(null)},"aria-label":i.nameLabel,"data-testid":`payer-rename-input-${e.id}`}),(0,a.jsxs)("div",{className:O,children:[(0,a.jsx)(A.Label,{htmlFor:`payer-edit-id-type-${e.id}`,children:i.identificationTypeLabel}),(0,a.jsxs)(E.Select,{value:eN||void 0,onValueChange:e=>{let a=Object.values(r.IdentificationType).find(a=>a===e);a&&ev(a)},children:[(0,a.jsx)(E.SelectTrigger,{id:`payer-edit-id-type-${e.id}`,className:C.SETTINGS_UI.control,"data-testid":`payer-edit-id-type-${e.id}`,children:(0,a.jsx)(E.SelectValue,{})}),(0,a.jsx)(E.SelectContent,{children:Object.values(r.IdentificationType).map(e=>(0,a.jsx)(E.SelectItem,{value:e,children:l[m.IDENTIFICATION_TYPE_LABEL_KEYS[e]]},e))})]})]}),(0,a.jsxs)("div",{className:O,children:[(0,a.jsx)(A.Label,{htmlFor:`payer-edit-id-number-${e.id}`,children:i.identificationNumberLabel}),(0,a.jsx)(T.Input,{id:`payer-edit-id-number-${e.id}`,className:C.SETTINGS_UI.control,value:eg,onChange:e=>ej(e.target.value),"data-testid":`payer-edit-id-number-${e.id}`})]}),(0,a.jsx)(G,{value:ef,onChange:eb,label:i.colorLabel,testIdPrefix:`payer-edit-color-${e.id}`,colorNames:i.colorNames}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,a.jsx)(I.Button,{type:"button",size:"sm",className:C.SETTINGS_UI.control,disabled:n,"data-testid":`payer-rename-save-${e.id}`,onClick:()=>{eE(e)},children:n?i.renaming:i.saveRename}),(0,a.jsx)(I.Button,{type:"button",size:"sm",variant:"outline",className:C.SETTINGS_UI.control,disabled:n,onClick:()=>{ey(null),eo(null)},children:i.cancel})]})]}),ec?(0,a.jsx)("p",{id:`payer-rename-error-${e.id}`,className:"text-xs text-feedback-danger-foreground","data-testid":`payer-rename-error-${e.id}`,children:ec}):null]}):(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"inline-block h-4 w-4 shrink-0 rounded-full border",style:{backgroundColor:(0,R.payerBadgeColor)(e)},"data-testid":`payer-swatch-${e.id}`,"aria-hidden":!0}),(0,a.jsx)("span",{children:e.name}),Y?(0,a.jsx)(I.Button,{type:"button",size:"sm",variant:"ghost",className:C.SETTINGS_UI.control,"data-testid":`payer-rename-${e.id}`,onClick:()=>{ey(e.id),eS(e.name),eb(e.color??(0,R.payerBadgeColor)(e)),ev(e.identificationType??""),ej(e.identificationNumber??""),eo(null)},children:i.rename}):null]})}),(0,a.jsx)("td",{className:(0,p.cn)(k.CLINICAL_TABLE.cell,"align-middle text-muted-foreground"),children:i.kinds[e.kind]}),(0,a.jsx)("td",{className:(0,p.cn)(k.CLINICAL_TABLE.cell,"align-middle"),children:(0,a.jsx)(L.Switch,{checked:e.isActive,disabled:!Y||n,"aria-label":e.isActive?i.activeOn:i.activeOff,"data-testid":`payer-active-${e.id}`,onCheckedChange:()=>{eL(e)}})})]},e.id)})})]}),Y?(0,a.jsxs)("form",{className:C.SETTINGS_UI.section,"data-testid":"payer-add-form",...(0,P.clinicalAnchor)("insurers-add-form"),onSubmit:e=>{eA(e)}
1,children:[(0,a.jsx)(b.SettingsSubsectionHeader,{title:i.addTitle}),(0,a.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,a.jsxs)("div",{className:O,children:[(0,a.jsx)(A.Label,{htmlFor:"payer-name",children:i.nameLabel}),(0,a.jsx)(T.Input,{id:"payer-name",className:C.SETTINGS_UI.control,value:J,"aria-invalid":!!es||void 0,"aria-describedby":es?"payer-name-error":void 0,onChange:e=>{Q(e.target.value),es&&ed(null)},"data-testid":"payer-name-input"})]}),(0,a.jsxs)("div",{className:O,children:[(0,a.jsx)(A.Label,{htmlFor:"payer-id-type",children:i.identificationTypeLabel}),(0,a.jsxs)(E.Select,{value:ea||void 0,onValueChange:e=>{let a=Object.values(r.IdentificationType).find(a=>a===e);a&&ei(a)},children:[(0,a.jsx)(E.SelectTrigger,{id:"payer-id-type",className:C.SETTINGS_UI.control,"data-testid":"payer-id-type-select",children:(0,a.jsx)(E.SelectValue,{})}),(0,a.jsx)(E.SelectContent,{children:Object.values(r.IdentificationType).map(e=>(0,a.jsx)(E.SelectItem,{value:e,children:l[m.IDENTIFICATION_TYPE_LABEL_KEYS[e]]},e))})]})]}),(0,a.jsxs)("div",{className:O,children:[(0,a.jsx)(A.Label,{htmlFor:"payer-id-number",children:i.identificationNumberLabel}),(0,a.jsx)(T.Input,{id:"payer-id-number",className:C.SETTINGS_UI.control,value:el,onChange:e=>et(e.target.value),"data-testid":"payer-id-number-input"})]}),(0,a.jsxs)("div",{className:O,children:[(0,a.jsx)(A.Label,{htmlFor:"payer-kind",children:i.kindLabel}),(0,a.jsxs)(E.Select,{value:Z,onValueChange:e=>{let a=Object.values(t.ClinicalPayerKind).find(a=>a===e);a&&ee(a)},children:[(0,a.jsx)(E.SelectTrigger,{id:"payer-kind",className:C.SETTINGS_UI.control,"data-testid":"payer-kind-select",children:(0,a.jsx)(E.SelectValue,{})}),(0,a.jsxs)(E.SelectContent,{children:[(0,a.jsx)(E.SelectItem,{value:t.ClinicalPayerKind.SELF_PAY,children:i.kinds.self_pay}),(0,a.jsx)(E.SelectItem,{value:t.ClinicalPayerKind.INSURANCE,children:i.kinds.insurance}),(0,a.jsx)(E.SelectItem,{value:t.ClinicalPayerKind.OTHER,children:i.kinds.other})]})]})]}),(0,a.jsx)(G,{value:en,onChange:er,label:i.colorLabel,testIdPrefix:"payer-color",colorNames:i.colorNames}),(0,a.jsx)(I.Button,{type:"submit",size:"sm",className:C.SETTINGS_UI.control,disabled:eu,"data-testid":"payer-add-submit",children:eu?i.adding:i.addButton})]}),es?(0,a.jsx)("p",{id:"payer-name-error",className:"text-xs text-feedback-danger-foreground",children:es}):null]}):null,ep?(0,a.jsx)("p",{className:"text-xs text-feedback-danger-foreground","data-testid":"payers-action-error",children:ep}):null]}):null]})})})}function H(){return(0,a.jsx)(i.PageFrame,{children:(0,a.jsx)(l.ClinicalTranslationBoundary,{children:(0,a.jsx)(M,{})})})}e.s(["default",()=>H],323637)}]);

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.