hplx-feature-library 1.0.224 → 1.0.225
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{APIAction-DLCcL2Li.js → APIAction-CTNOzVOC.js} +24 -23
- package/dist/APIAction-DB6Ulkss.cjs +1 -0
- package/dist/AllInvestigations/components/AllInvestigationsTable.d.ts +19 -0
- package/dist/AllInvestigations/index.d.ts +1 -0
- package/dist/AllInvestigations/index.js +4 -0
- package/dist/AllInvestigations/utils/test-tange-util.d.ts +8 -0
- package/dist/AllInvestigationsTable-BDLPOHjr.cjs +79 -0
- package/dist/AllInvestigationsTable-Dg-YXASz.js +17065 -0
- package/dist/Attachments/index.js +1 -1
- package/dist/{Attachments-Bf4IIvHa.js → Attachments-4FIsCWlc.js} +6179 -6296
- package/dist/Attachments-Dr6yedl9.cjs +186 -0
- package/dist/NineDots/index.js +1 -1
- package/dist/{NineDots-q--wtv3_.cjs → NineDots-BEzE3Pj8.cjs} +1 -1
- package/dist/{NineDots-gflwjmeo.js → NineDots-CCtE2t9I.js} +1 -1
- package/dist/PatientAddEdit/index.js +1 -1
- package/dist/{PatientAddEdit-DRQcxWYN.js → PatientAddEdit-9W7ONHSd.js} +7 -6
- package/dist/PatientAddEdit-DmpV8z5a.cjs +7 -0
- package/dist/PatientPopup/index.js +1 -1
- package/dist/PatientPopupContainer-B9Ev8xjs.cjs +36 -0
- package/dist/{PatientPopupContainer-B283bpwr.js → PatientPopupContainer-DpCBNO2c.js} +8 -7
- package/dist/PediatricsCalculator/index.js +1 -1
- package/dist/PediatricsCalculatorTable-B4fTy1J5.cjs +9 -0
- package/dist/{PediatricsCalculatorTable-qu37FR7D.js → PediatricsCalculatorTable-G0ttbDpi.js} +228 -236
- package/dist/{PrintModal-Bum6_fNo.js → PrintModal-BF2-PDRX.js} +9 -20
- package/dist/{PrintModal-tamolKuC.cjs → PrintModal-mNA_qJpW.cjs} +11 -11
- package/dist/{ReusableModal-2GKjVVbf.cjs → ReusableModal-CIgDYOWZ.cjs} +1 -1
- package/dist/{ReusableModal-BL_DwV8I.js → ReusableModal-CT4_gW1b.js} +1 -1
- package/dist/ReusableTable/ReusableTable.d.ts +3 -0
- package/dist/ReusableTable/ReusableTableConstants.d.ts +8 -0
- package/dist/ReusableTable/ReusableTableTypes.d.ts +96 -0
- package/dist/ReusableTable/components/EmptyTableContainer.d.ts +12 -0
- package/dist/ReusableTable/components/FilterCheckbox.d.ts +8 -0
- package/dist/ReusableTable/components/FilterDropdown.d.ts +17 -0
- package/dist/ReusableTable/components/Pagination.d.ts +2 -0
- package/dist/ReusableTable/components/TableBody.d.ts +2 -0
- package/dist/ReusableTable/components/TableCell.d.ts +3 -0
- package/dist/ReusableTable/components/TableFilterSelect.d.ts +12 -0
- package/dist/ReusableTable/components/TableHead.d.ts +2 -0
- package/dist/ReusableTable/components/TableMain.d.ts +2 -0
- package/dist/ReusableTable/components/TableRow.d.ts +3 -0
- package/dist/ReusableTable/context/TableContext.d.ts +21 -0
- package/dist/ReusableTable/context/TableContextBase.d.ts +26 -0
- package/dist/ReusableTable/context/useTableContext.d.ts +2 -0
- package/dist/SearchPatients/index.js +1 -1
- package/dist/{SearchPatients-DbYAGumB.cjs → SearchPatients-6D7IL_wj.cjs} +1 -1
- package/dist/{SearchPatients-BbtytMYS.js → SearchPatients-D7cCFV9o.js} +3 -3
- package/dist/TrendGraphs/AreaChartComponent.d.ts +9 -0
- package/dist/TrendGraphs/LineChartComponent/DataPointToolTip.d.ts +16 -0
- package/dist/TrendGraphs/LineChartComponent/LineChartBody.d.ts +2 -0
- package/dist/TrendGraphs/LineChartComponent/LineChartHeader.d.ts +2 -0
- package/dist/TrendGraphs/LineChartComponent/index.d.ts +2 -0
- package/dist/TrendGraphs/context/index.d.ts +2 -0
- package/dist/TrendGraphs/hooks/useTrendGraphContext.d.ts +2 -0
- package/dist/TrendGraphs/utils/index.d.ts +4 -0
- package/dist/UserProfile/index.js +1 -1
- package/dist/{UserProfile-D3Rhhuj9.cjs → UserProfile-4L3aOHNv.cjs} +4 -4
- package/dist/{UserProfile-jDWt9g20.js → UserProfile-D3cCwQxw.js} +9 -8
- package/dist/clsx-C11secjj.cjs +1 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/common-utils-CprPMjtz.js +1952 -0
- package/dist/common-utils-DrDXKNhv.cjs +6 -0
- package/dist/components/Modal.d.ts +5 -0
- package/dist/constants/TrendGraphsConstants.d.ts +2 -0
- package/dist/dayjs.min-D52_GdfV.js +284 -0
- package/dist/dayjs.min-DXp74Ozx.cjs +1 -0
- package/dist/hplx-feature-library.css +1 -1
- package/dist/{index-UPYT3B9g.js → index-Bd0CDVpH.js} +3 -2
- package/dist/index-CJFGOBPb.js +122 -0
- package/dist/{index-CJ2AKRoq.cjs → index-DQlbIHh3.cjs} +26 -26
- package/dist/index-DfcUmlge.cjs +17 -0
- package/dist/{index-CRCsQdYf.cjs → index-DkA8S5IK.cjs} +1 -1
- package/dist/{index-BzwuwvT5.js → index-T1lUjzhG.js} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -13
- package/dist/print-pdf/index.js +1 -1
- package/dist/types/AllInvestigationTypes/index.js +4 -0
- package/dist/types/AllInvestigationTypes.d.ts +45 -0
- package/dist/types/TrendGraphTypes.d.ts +19 -0
- package/dist/useClickOutside-BjJyGTec.js +14 -0
- package/dist/useClickOutside-DsVG12Cs.cjs +1 -0
- package/package.json +11 -1
- package/dist/APIAction-Bev2spv1.cjs +0 -1
- package/dist/Attachments-BIIHwdo1.cjs +0 -202
- package/dist/PatientAddEdit-DtcwFtoA.cjs +0 -7
- package/dist/PatientPopupContainer-CRyDfB0s.cjs +0 -36
- package/dist/PediatricsCalculatorTable-bTvt7SWQ.cjs +0 -9
- package/dist/common-utils-BNaPcohw.cjs +0 -6
- package/dist/common-utils-BidUvSFN.js +0 -2233
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./index-CJ2AKRoq.cjs"),r=require("react"),A=require("./constants/PediatricsCalculatorConstants/index.js"),Me=require("./useOutsideClick-CicUjzPP.cjs"),_e=require("./index-CRCsQdYf.cjs"),we=r.createContext(null),Ee=()=>{const l=r.useContext(we);if(!l)throw new Error("usePediatricsCalculatorTableContext must be used inside a MedicineTableProvider");return l},Se=({effectiveEditMode:l,rowData:s,isSavedToLibrary:p,onSave:b,onCancel:g,onEdit:v,onCheckboxToggle:a})=>{const{variant:C,externallyTriggeredEditMode:w,setRowToDelete:_,openPopupForRow:k}=Ee();return C==="standard"?l?e.jsxRuntimeExports.jsxs("div",{className:"hfl-grid hfl-grid-cols-[1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg ",children:[e.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hfl-border-r-1 hover:hfl-bg-Primary-50",onClick:b,children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text xs",className:"hfl-text-Blue_gray-800",children:"Save"})}),e.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-2 hfl-text-Error-600 hover:hfl-bg-Error-50",onClick:g,children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text xs",className:"",children:"Cancel"})})]}):e.jsxRuntimeExports.jsxs("div",{className:"hfl-grid hfl-grid-cols-[1fr_1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg",children:[e.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hover:hfl-bg-Primary-50",onClick:v,children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text xs",className:"",children:"Edit"})}),e.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-2 hfl-text-Blue_gray-800 hfl-border-x-1 hover:hfl-bg-Primary-50",onClick:()=>k?.(s),children:e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text xs",className:"",children:"Copy"})}),e.jsxRuntimeExports.jsx("button",{className:"hx_delete hfl-px-3 hfl-py-2 hfl-text-Error-500 hover:hfl-bg-Error-50",onClick:()=>_?.(s.rowId)})]}):e.jsxRuntimeExports.jsx(e.Os,{disabled:!w,text:"Save this to Pediatric Calculator Library ",id:s.rowId,size:"md",onClick:a,isMarked:p??!1,checkboxClasses:"hfl-mt-2",checkBoxInnerDivClasses:"hfl-text-Blue-600 hfl-bg-Blue-50"},s.rowId)},Te=(l,s)=>{r.useEffect(()=>{const p=b=>{l.current&&!l.current.contains(b.target)&&s()};return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[l,s])};function De(l){const{options:s,selectedOption:p,onChangeHandler:b}=l;return e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-gap-2 hfl-h-full hfl-items-center hfl-px-4 hfl-justify-center hfl-py-1",children:s?.map(g=>e.jsxRuntimeExports.jsx("div",{className:"hfl-bg-White hfl-rounded-lg",children:e.jsxRuntimeExports.jsx(e.Ku,{onClick:()=>b&&b(g),hierarchy:p?.label===g.label?"Primary":"Secondary-Grey",size:"sm",textField:g.label,className:p?.label===g.label?"hfl-bg-Blue-600":""})},g.label))})}const Fe="data:image/svg+xml,%3csvg%20width='10'%20height='6'%20viewBox='0%200%2010%206'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0.480062%200.819173C0.650418%200.648817%200.92662%200.648817%201.09698%200.819173L4.71454%204.43674L8.3321%200.819173C8.50246%200.648817%208.77866%200.648817%208.94902%200.819173C9.11937%200.98953%209.11937%201.26573%208.94902%201.43609L5.023%205.36211C4.85264%205.53246%204.57644%205.53246%204.40608%205.36211L0.480062%201.43609C0.309706%201.26573%200.309706%200.98953%200.480062%200.819173Z'%20fill='%23667085'/%3e%3c/svg%3e";function T(l){const{label:s,labelClassName:p,hideDropdownIcon:b,showClearOption:g,isRequiredField:v,btnClassName:a,placeholder:C,options:w,selectedOption:_,onChangeHandler:k,inputValue:y,inputChangeHandler:L,onInputFocusOutEvent:B,inputClassName:i,isSearchable:m,inputType:$,showInput:M,inputSuffix:S,selectedLabel:U,suffixPadding:W,disableInputAutoSize:o,selectedOptions:j,isMulti:f,dropDownItemClickHandler:x,showToggle:q,toggleChangeHandler:D,selectedToggleOption:c,toggleOptionsList:n,border:N,height:E,disabled:I,fieldColor:H,errorMsg:t,showErrorMsg:d,placeholderStyle:u,onInputKeyDown:F,showEmptyDropdownPopup:z=!0,isDropdownFixed:G=!1,dropdownClassName:ie="",wrapperClass:re="",maxInputLength:ae,alternateListBgStyle:ee,showLabelTooltip:R=!1,labelToolTipContent:K="",inputContainerClasses:X="",onInputFocus:Q}=l,[Z,te]=r.useState(!1),[se,Re]=r.useState(null),oe=r.useRef(null),ce=r.useRef(null),pe=r.useRef(null),ue=r.useRef([]),Ce=r.useMemo(()=>w?.filter(h=>h?h.label.toLowerCase().includes((y??"").toLowerCase()):void 0),[y,w]),[ve,de]=r.useState(!1),Ne=()=>{te(!1),f&&L&&L(""),Re(null)},me=r.useCallback(h=>{h.stopPropagation(),I||te(O=>!O)},[I]),ge=(y?.length||0)+2+Number(W||0);Me.useOutsideClick(oe,Ne),r.useEffect(()=>{se!==null&&ue.current[se]&&ue.current[se].scrollIntoView({block:"nearest"})},[se]);const le=r.useCallback(()=>{if(G&&Z){const h=M?ce.current:pe.current,O=oe.current;if(h&&O){const J=h.getBoundingClientRect();O.style.position="fixed",O.style.top=`${window.scrollY?J.bottom+window.scrollY:J.bottom}px`,O.style.left=`${J.left}px`,O.style.width=`${J.width}px`}}},[G,Z,M]);r.useEffect(()=>{if(G)return Z?(le(),window.addEventListener("scroll",le,!0)):window.removeEventListener("scroll",le,!0),()=>{window.removeEventListener("scroll",le,!0)}},[G,le,Z]),Te(oe,()=>{ve&&B&&B()});const je=h=>{if(f&&x){const O=j?.some(J=>J.value===h.value);x(!!O,h)}},Ie=r.useCallback(async h=>{h.stopPropagation(),Z||te(!0),Q&&await Q()},[Q,Z]);return e.jsxRuntimeExports.jsxs("div",{className:`hfl-relative hfl-inline-block hfl-text-left ${re||""}`,children:[!!s&&e.jsxRuntimeExports.jsxs("div",{className:"hfl-text-Gray-700 hfl-mb-1 hfl-flex",children:[e.jsxRuntimeExports.jsx(e.bs,{type:"Text sm",variant:"Medium",className:p||"",children:`${s}`}),v&&e.jsxRuntimeExports.jsx("span",{className:"hfl-ml-1 hfl-text-Error-600",children:"*"}),R&&e.jsxRuntimeExports.jsx(e.Nu,{variant:"Right",text:K,theme:"dark",children:e.jsxRuntimeExports.jsx("i",{className:"hx_info-filled"})})]}),M?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-items-center hfl-shadow-xs hfl-px-2 ${X||""} ${N||"hfl-border-1"} hfl-rounded-lg hfl-overflow-x-auto ${t?"hfl-border-Error-300":"hfl-border-Gray-300"} ${E||"hfl-h-10"} ${I?"!hfl-bg-Gray-50 !hfl-pointer-events-none":H||"hfl-bg-White"} hover:hfl-border-Primary-300 hover:hfl-shadow-xs-primary`,onClick:I?()=>{}:me,children:[j?.map((h,O)=>e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-bg-Blue-100 hfl-mr-2 hfl-py-1 hfl-px-2 hfl-rounded-sm hfl-font-inter-0 hfl-text-nowrap",children:[e.jsxRuntimeExports.jsx("span",{className:"hfl-pointer-events-none",children:h.label}),e.jsxRuntimeExports.jsx("span",{onClick:J=>{J.stopPropagation(),je(h)},className:"hx_close hfl-text-Gray-500 hfl-my-0 hfl-text-[14px] hfl-ml-[1px] hfl-cursor-pointer"})]},`${h.label}-${O}`)),Object.keys(u||{}).length>0&&e.jsxRuntimeExports.jsx("style",{children:`
|
|
2
|
-
input.input-placeholder::placeholder {
|
|
3
|
-
font-family: ${u?.fontFamily};
|
|
4
|
-
font-weight: ${u?.fontWeight};
|
|
5
|
-
line-height: ${u?.lineHeight};
|
|
6
|
-
font-size: ${u?.fontSize};
|
|
7
|
-
color: ${u?.color};
|
|
8
|
-
}
|
|
9
|
-
`}),e.jsxRuntimeExports.jsx("input",{ref:ce,style:o?{}:{width:`${Number(y?.length)>4?(y?.length||0)+5:12}ch`},type:$,placeholder:C,value:y,className:`input-placeholder hfl-flex-1 hfl-pl-2 hfl-placeholder hfl-py-1 focus-visible:hfl-outline-0 focus-visible:hfl-outline-none hfl-border-0 focus:hfl-border-0 ${I?"!hfl-bg-Gray-50 !hfl-cursor-not-allowed":H||"hfl-bg-White"} ${i||""}`,onChange:h=>{L&&L(h.target.value),de(!0)},onClick:Ie,onKeyDown:h=>F&&F(h,te,ce),maxLength:ae??ae,...l.inputProps||{}}),!b&&!g&&e.jsxRuntimeExports.jsx("i",{className:"hx_down hfl-mx-2"}),g&&e.jsxRuntimeExports.jsx("i",{className:`${y?"hx_close hfl-cursor-pointer":"hx_down"} hfl-mx-2`,onClick:()=>{(_?.value||y)&&(L&&L(""),de(!0))}}),S?e.jsxRuntimeExports.jsx("span",{style:{left:`${ge<2?"3":ge}ch`},className:"hfl-absolute hfl-top-1/2 hfl--translate-y-1/2 hfl-pointer-events-none",children:S}):null]}),d&&e.jsxRuntimeExports.jsx("span",{className:"hfl-text-0 hfl-text-Error-600",children:t})]}):e.jsxRuntimeExports.jsxs("button",{ref:pe,onClick:me,className:`hfl-w-full hfl-bg-White hfl-py-[6px] hfl-px-4 hfl-rounded-lg hfl-inline-flex hfl-justify-between hfl-items-center ${a||""} ${N||"hfl-border-1"} ${t?"hfl-border-Error-300":"hfl-border-Gray-300"} ${E||"hfl-h-[40px]"} ${I?"!hfl-bg-Gray-50 !hfl-cursor-not-allowed":""}`,style:U||_?.label?{}:u?{fontFamily:u?.fontFamily,fontSize:u?.fontSize,fontWeight:u?.fontWeight,lineHeight:u?.lineHeight,color:u?.color}:{},children:[e.jsxRuntimeExports.jsx("span",{className:"hfl-pr-4",children:U||_?.label||C||"Select an option"}),e.jsxRuntimeExports.jsx("img",{src:Fe,alt:"down arrow"})]}),w&&w?.length>=0&&e.jsxRuntimeExports.jsxs("ul",{ref:oe,className:`custom-dropdown-menu ${Z?"hfl-visible":"hfl-invisible"} hfl-absolute hfl-z-50 hfl-grid hfl-gap-1 hfl-mt-3 hfl-w-full hfl-rounded-lg hfl-shadow-lg hfl-bg-White hfl-font-inter-0 hfl-p-1 hfl-px-2 ${f?"hfl-min-w-[20em]":"hfl-min-w-[16em]"} hfl-max-h-[330px] hfl-overflow-y-scroll ${ie}`,role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu",children:[q?e.jsxRuntimeExports.jsx(De,{onChangeHandler:D,selectedOption:c,options:n}):!1,(m?Ce:w)?.map((h,O)=>{const J=f?!!j?.some(fe=>fe.value===h?.value):!1,be=_?.value===h?.value,ke=se===O;return h?e.jsxRuntimeExports.jsx("li",{onClick:()=>{f?je(h):(k&&k(h),te(!1),de(!1))},className:`hfl-text-1 hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item ${ee?"odd:hfl-bg-Gray-100":""} ${be?"hfl-bg-Blue-50 hfl-text-Blue-500":""}`,role:"menuitem","aria-selected":be,tabIndex:ke?0:-1,ref:fe=>{ue.current[O]=fe},children:f?e.jsxRuntimeExports.jsx(e.Os,{size:"sm",disabled:!1,text:e.jsxRuntimeExports.jsx("span",{children:h.label}),secondaryText:"",id:`${h.label}-${O}`,isMarked:J}):h.label},`${h.label}-${O}`):null}),w?.length===0&&z&&e.jsxRuntimeExports.jsx("li",{className:"hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item",children:"No items found, please change the search criteria"})]})]})}var he,ye;function Oe(){if(ye)return he;ye=1;var l="Expected a function",s=NaN,p="[object Symbol]",b=/^\s+|\s+$/g,g=/^[-+]0x[0-9a-f]+$/i,v=/^0b[01]+$/i,a=/^0o[0-7]+$/i,C=parseInt,w=typeof e.commonjsGlobal=="object"&&e.commonjsGlobal&&e.commonjsGlobal.Object===Object&&e.commonjsGlobal,_=typeof self=="object"&&self&&self.Object===Object&&self,k=w||_||Function("return this")(),y=Object.prototype,L=y.toString,B=Math.max,i=Math.min,m=function(){return k.Date.now()};function $(o,j,f){var x,q,D,c,n,N,E=0,I=!1,H=!1,t=!0;if(typeof o!="function")throw new TypeError(l);j=W(j)||0,M(f)&&(I=!!f.leading,H="maxWait"in f,D=H?B(W(f.maxWait)||0,j):D,t="trailing"in f?!!f.trailing:t);function d(R){var K=x,X=q;return x=q=void 0,E=R,c=o.apply(X,K),c}function u(R){return E=R,n=setTimeout(G,j),I?d(R):c}function F(R){var K=R-N,X=R-E,Q=j-K;return H?i(Q,D-X):Q}function z(R){var K=R-N,X=R-E;return N===void 0||K>=j||K<0||H&&X>=D}function G(){var R=m();if(z(R))return ie(R);n=setTimeout(G,F(R))}function ie(R){return n=void 0,t&&x?d(R):(x=q=void 0,c)}function re(){n!==void 0&&clearTimeout(n),E=0,x=N=q=n=void 0}function ae(){return n===void 0?c:ie(m())}function ee(){var R=m(),K=z(R);if(x=arguments,q=this,N=R,K){if(n===void 0)return u(N);if(H)return n=setTimeout(G,j),d(N)}return n===void 0&&(n=setTimeout(G,j)),c}return ee.cancel=re,ee.flush=ae,ee}function M(o){var j=typeof o;return!!o&&(j=="object"||j=="function")}function S(o){return!!o&&typeof o=="object"}function U(o){return typeof o=="symbol"||S(o)&&L.call(o)==p}function W(o){if(typeof o=="number")return o;if(U(o))return s;if(M(o)){var j=typeof o.valueOf=="function"?o.valueOf():o;o=M(j)?j+"":j}if(typeof o!="string")return o===0?o:+o;o=o.replace(b,"");var f=v.test(o);return f||a.test(o)?C(o.slice(2),f?2:8):g.test(o)?s:+o}return he=$,he}var Le=Oe();const Be=e.getDefaultExportFromCjs(Le),xe=(l,s)=>{const p=parseFloat(l),b=parseFloat(s);if(!l||!s||isNaN(p)||isNaN(b)||b===0)return"";const g=p/b;return Number.isInteger(g)?g.toString(10):g.toFixed(3).replace(/\.?0+$/,"")},Y=l=>/^(\d+)?(\.)?(\d*)?$/.test(l),V=({label:l,children:s})=>e.jsxRuntimeExports.jsxs(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-grid hfl-grid-cols-2 hfl-items-center hfl-text-Blue_gray-800 hfl-justify-between hfl-gap-8",children:[e.jsxRuntimeExports.jsxs("span",{className:"hfl-flex-shrink-0",children:[l,":"]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex-1 hfl-min-w-0",children:s})]}),P=({label:l,value:s})=>e.jsxRuntimeExports.jsxs(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-flex hfl-text-Blue_gray-800 hfl-gap-1",children:[e.jsxRuntimeExports.jsxs("span",{className:"hfl-flex-shrink-0",children:[l,":"]}),e.jsxRuntimeExports.jsx(e.bs,{variant:"Bold",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-break-words hfl-min-w-0",children:s||"--"})]}),ne=({children:l,className:s=""})=>e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text sm",className:`hfl-text-Blue_gray-800 hfl-px-2 hfl-break-words hfl-overflow-wrap-anywhere hfl-min-w-0 ${s}`,children:l}),$e=r.memo(function({rowData:s,isEditing:p,setIsEditing:b,onSaveRow:g,allowCustomMedicineInput:v}){const{variant:a,externallyTriggeredEditMode:C,externallyTriggeredEditRowIds:w,getMedicineOptions:_,onRowChange:k,onRowDelete:y}=Ee(),[L,B]=r.useState([]),[i,m]=r.useState(s),[$,M]=r.useState(s.medicine_name);r.useEffect(()=>{p||M(s.medicine_name)},[s.medicine_name,p]),r.useEffect(()=>{p||m(s)},[s,p]);const S=async t=>(await _?.(t))?.map(u=>({label:u.doctorMedicineName,value:u}))||[],W=C||w?.includes(s.rowId)||p,o=r.useMemo(()=>i.out_of_range||s.out_of_range,[i.out_of_range,s.out_of_range]),j=r.useMemo(()=>i?.isDosageMismatch||s?.isDosageMismatch,[i?.isDosageMismatch,s?.isDosageMismatch]),f=r.useMemo(()=>i.calculation_type===A.C_MedicineCalculatorList[0]?i.calculation_fields:null,[i.calculation_fields,i.calculation_type]),x=r.useMemo(()=>i.calculation_type===A.C_MedicineCalculatorList[1]?i.calculation_fields:null,[i.calculation_fields,i.calculation_type]),q=(t,d)=>{let u;if(t==="calculation_type"){const F=d,z={frequency:i.calculation_fields.frequency,pedia_dosage:a==="standard"?i.calculation_fields.pedia_dosage:i.pedia_dosage};u={...i,calculation_type:F,calculation_fields:F==="mg/kg/dose"?{...A.C_DefaultMgKgFields,...z}:{...A.C_DefaultMlKgFields,...z}}}else u={...i,[t]:d};m(u),a==="prescription"&&D(u,t)},D=r.useMemo(()=>Be((t,d)=>{k?.(t,d||void 0)},500),[k]),c=r.useMemo(()=>e.jsxRuntimeExports.jsxs("div",{className:"hfl-mb-1 hfl-flex hfl-w-max hfl-items-center hfl-rounded hfl-border-1 hfl-border-Warning-400 hfl-bg-Warning-50 hfl-p-1 hfl-px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"hx_warning hfl-text-Error-400"}),e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-px-2 hfl-text-1 hfl-text-Error-500",children:"Dosage exceed safety limits"})]}),[]);r.useEffect(()=>()=>{D.cancel()},[D]);const n=r.useCallback((t,d)=>{m(u=>{let F={...u.calculation_fields,[t]:d};if(t==="frequency"&&a==="standard"){const G=A.C_FrequencyDosageMap[d]||[];G.length>0&&(F={...F,pedia_dosage:G[0]})}const z={...u,calculation_fields:F};return a==="prescription"&&D(z,t),z})},[D,a]),N=async()=>{const t={...i,calculation_fields:{...i.calculation_fields}};await g?.(t)&&D({...t,isNewlyAdded:!1,isEditing:!1})},E=async()=>{if(!s.medicine_name||s.medicine_name.trim()===""){y?.(s.rowId);return}m(s),a==="standard"&&b(!1)},I=t=>a==="prescription"&&(t==="medicine_name"||t==="generic_name"||t==="type"||t==="calculation_type")?!1:W,H=()=>{const t=!(i?.isSavedToLibrary??!1),d={...i,isSavedToLibrary:t};m(d),D(d,"isSavedToLibrary")};return e.jsxRuntimeExports.jsxs("div",{className:`medicine-row hfl-grid hfl-grid-cols-[1.36fr_1.36fr_1.02fr_1.25fr_2.27fr_1.36fr_1.36fr] hfl-gap-2 hfl-px-2 hfl-py-1 hfl-border-b-1 hfl-border-Gray-200 ${W?"hfl-bg-gradient-to-b hfl-from-White_20 hfl-to-Primary-50":""} ${a==="prescription"&&!i.pedia_data_available?"hfl-hidden":""}`,children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:I("medicine_name")?e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",inputClassName:"hfl-w-full",inputValue:i.medicine_name,showInput:!0,disableInputAutoSize:!0,inputChangeHandler:async t=>{if(q("medicine_name",t),t.trim()){const d=await S(t);B(d)}else B([])},onInputFocus:async()=>{const t=await S(i.medicine_name);B(t)},onChangeHandler:t=>{const d=t.value,u=A.C_MedicineTypeList.find(F=>F.val===d.medicineType);m(F=>({...F,medicine_name:d.doctorMedicineName,medicine_id:d.medicineId,generic_name:d.doctorGenericName,type:u?.type??""})),M(d.doctorMedicineName)},options:L,isSearchable:!0,placeholder:"Search medicine",disabled:!i?.isNewlyAdded,inputProps:{onBlur:t=>{const d=t.relatedTarget;if(!(d&&d.closest(".custom-dropdown-menu"))&&!v){const u=i.medicine_name?.trim()||"";L.some(z=>z.label===u)||m(z=>({...z,medicine_name:$}))}}}}):e.jsxRuntimeExports.jsx(ne,{children:s.medicine_name})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:I("generic_name")?e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",inputClassName:"hfl-w-full",btnClassName:"hfl-w-full",inputValue:i.generic_name,showInput:!0,disableInputAutoSize:!0,inputChangeHandler:t=>q("generic_name",t),hideDropdownIcon:!0}):e.jsxRuntimeExports.jsx(ne,{children:s.generic_name})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:I("type")?e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",placeholder:"Select",showInput:!1,disableInputAutoSize:!0,selectedOption:(()=>{const t=A.C_MedicineTypeList.find(d=>d.type===i.type);return t?{label:t.type,value:t.type}:void 0})(),options:A.C_MedicineTypeList.map(t=>({label:t.type,value:t.type})),onChangeHandler:t=>q("type",t.value)}):e.jsxRuntimeExports.jsx(ne,{children:s.type||""})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:I("calculation_type")?e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",placeholder:"Select",showInput:!1,disableInputAutoSize:!0,selectedOption:{label:i.calculation_type,value:i.calculation_type},options:A.C_MedicineCalculatorList.map(t=>({label:t,value:t})),onChangeHandler:t=>q("calculation_type",t.value)}):e.jsxRuntimeExports.jsx(ne,{children:s.calculation_type})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-w-full hfl-flex-col hfl-gap-2 hfl-py-2.5 hfl-px-2",children:I("calculation_fields")?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[f&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(V,{label:"Drug Strength",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"e.g., 250",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:f.drug_strength||"",inputChangeHandler:t=>{Y(t)&&n("drug_strength",t)}})}),e.jsxRuntimeExports.jsx(V,{label:"Dose/mg/kg",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"e.g., 15",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:f.dose_mg_kg||"",inputChangeHandler:t=>{Y(t)&&n("dose_mg_kg",t)}})}),e.jsxRuntimeExports.jsx(V,{label:"Frequency",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"Frequency",showInput:!1,selectedOption:i.calculation_fields.frequency?{label:i.calculation_fields.frequency,value:i.calculation_fields.frequency}:void 0,options:A.C_MedicineFrequencyList.map(t=>({label:t,value:t})),onChangeHandler:t=>{n("frequency",t.value)}})}),e.jsxRuntimeExports.jsx(V,{label:"Max Dose (mg)",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"Max mg/dose",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:f.max_mg_dose||"",inputChangeHandler:t=>{Y(t)&&n("max_mg_dose",t)}})}),e.jsxRuntimeExports.jsx(V,{label:"Max Day (mg)",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"Max mg/day",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:f.max_mg_day||"",inputChangeHandler:t=>{Y(t)&&n("max_mg_day",t)}})})]}),x&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(V,{label:"Drug Strength/mL",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"e.g., 250",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:x.drug_strength||"",inputChangeHandler:t=>{Y(t)&&(n("drug_strength",t),n("dose_ml_kg",xe(x.dose_mg_kg,t)))}})}),e.jsxRuntimeExports.jsx(V,{label:"Dose/mg/kg",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"e.g., 15",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:x.dose_mg_kg||"",inputChangeHandler:t=>{Y(t)&&(n("dose_mg_kg",t),n("dose_ml_kg",xe(t,x.drug_strength)))}})}),e.jsxRuntimeExports.jsx(V,{label:"Dose/mL/kg",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",disabled:!0,placeholder:"e.g., 5",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:xe(x.dose_mg_kg,x.drug_strength)||"",inputChangeHandler:t=>{Y(t)&&n("dose_ml_kg",t)}})}),e.jsxRuntimeExports.jsx(V,{label:"Frequency",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"Frequency",showInput:!1,selectedOption:i.calculation_fields.frequency?{label:i.calculation_fields.frequency,value:i.calculation_fields.frequency}:void 0,options:A.C_MedicineFrequencyList.map(t=>({label:t,value:t})),onChangeHandler:t=>{n("frequency",t.value)}})}),e.jsxRuntimeExports.jsx(V,{label:"Max Dose (mL)",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"Max mL/dose",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:x.max_ml_dose||"",inputChangeHandler:t=>{Y(t)&&n("max_ml_dose",t)}})}),e.jsxRuntimeExports.jsx(V,{label:"Max Day (mL)",children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",placeholder:"Max mL/day",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:x.max_ml_day||"",inputChangeHandler:t=>{Y(t)&&n("max_ml_day",t)}})})]})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[f&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(P,{label:"Drug Strength",value:f.drug_strength}),e.jsxRuntimeExports.jsx(P,{label:"Dose/mg/kg",value:f.dose_mg_kg}),e.jsxRuntimeExports.jsx(P,{label:"Frequency",value:f.frequency}),e.jsxRuntimeExports.jsx(P,{label:"Max Dose (mg)",value:f.max_mg_dose}),e.jsxRuntimeExports.jsx(P,{label:"Max Day (mg)",value:f.max_mg_day})]}),x&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(P,{label:"Drug Strength/mL",value:x.drug_strength}),e.jsxRuntimeExports.jsx(P,{label:"Dose/mg/kg",value:x.dose_mg_kg}),e.jsxRuntimeExports.jsx(P,{label:"Dose/mL/kg",value:x.dose_ml_kg}),e.jsxRuntimeExports.jsx(P,{label:"Frequency",value:x.frequency}),e.jsxRuntimeExports.jsx(P,{label:"Max Dose (mL)",value:x.max_ml_dose}),e.jsxRuntimeExports.jsx(P,{label:"Max Day (mL)",value:x.max_ml_day})]})]})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:I("pedia_dosage")?(()=>{const t=i.calculation_fields.frequency,d=A.C_FrequencyDosageMap[t]||[];return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(T,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",inputClassName:"hfl-w-full",placeholder:"Select",showInput:a!=="standard",disableInputAutoSize:!0,inputValue:a==="standard"?i.calculation_fields.pedia_dosage:i.pedia_dosage,inputChangeHandler:u=>a==="prescription"?q("pedia_dosage",u):n("pedia_dosage",u),selectedOption:a==="standard"?{label:i.calculation_fields.pedia_dosage,value:i.calculation_fields.pedia_dosage}:void 0,options:a!=="prescription"?d.map(u=>({label:u,value:u})):void 0,onChangeHandler:a!=="prescription"?u=>n("pedia_dosage",u.value):void 0,hideDropdownIcon:a==="prescription",showEmptyDropdownPopup:a!=="prescription",showErrorMsg:a==="prescription"?o||j:!1,errorMsg:a==="prescription"&&o?"Dosage Exceeds Safety Limits":a==="prescription"&&j?"Dosage is in mismatch with selected type of Frequency":""})})})():e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-h-full hfl-justify-between hfl-min-w-0",children:[e.jsxRuntimeExports.jsx(ne,{children:a==="prescription"?s.pedia_dosage:s.calculation_fields.pedia_dosage}),o&&c]})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:e.jsxRuntimeExports.jsx(Se,{effectiveEditMode:W,rowData:s,isSavedToLibrary:i.isSavedToLibrary??!1,onSave:N,onCancel:E,onEdit:()=>b(!0),onCheckboxToggle:H})})]})},(l,s)=>l.isEditing===s.isEditing&&l.rowData.rowId===s.rowData.rowId&&l.rowData.isEditing===s.rowData.isEditing&&l.rowData.medicine_name===s.rowData.medicine_name&&l.rowData.generic_name===s.rowData.generic_name&&l.rowData.type===s.rowData.type&&l.rowData.pedia_dosage===s.rowData.pedia_dosage&&l.rowData.calculation_type===s.rowData.calculation_type&&JSON.stringify(l.rowData.calculation_fields)===JSON.stringify(s.rowData.calculation_fields)&&l.rowData.out_of_range===s.rowData.out_of_range&&l.rowData.isDosageMismatch===s.rowData.isDosageMismatch&&l.rowData.calculation_fields.pedia_dosage===s.rowData.calculation_fields.pedia_dosage&&l.rowData?.isNewlyAdded===s.rowData?.isNewlyAdded&&l.rowData?.pedia_data_available===s.rowData?.pedia_data_available),qe=l=>{const{openState:s,closePopupCallback:p,headingIconFile:b,headingText:g,subHeadingText:v,positiveButtonText:a,negativeButtonText:C,classNamePositiveBtn:w,classNameNegativeBtn:_,positiveActionCallback:k,negativeActionCallback:y}=l;return e.jsxRuntimeExports.jsxs(_e.Modal,{isOpen:s,onRequestClose:p,shouldCloseOnOverlayClick:!1,style:{overlay:{backgroundColor:"rgba(52, 64, 84, 0.5)",position:"fixed",alignContent:"center",justifyContent:"center",zIndex:1030,display:s?"block":"none"},content:{zIndex:1030,padding:"24px",maxWidth:"750px",maxHeight:"600px",width:"400px",height:"fit-content",margin:"auto",borderRadius:"12px",overflow:"unset",display:s?"block":"none"}},children:[b=="warning"&&e.jsxRuntimeExports.jsx("div",{className:"hfl-hx_warning hfl-mb-4 hfl-flex hfl-h-12 hfl-w-12 hfl-items-center hfl-justify-center hfl-rounded-full hfl-border-8 hfl-border-Warning-50 hfl-bg-Warning-100 hfl-text-Warning-600",children:e.jsxRuntimeExports.jsx("i",{className:"hx_warning hfl-text-5"})}),e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text xl",className:"hfl-mt-5 hfl-text-Gray-900",children:g}),v&&e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-mt-1 hfl-text-Gray-500 ",children:v}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-mt-4 hfl-flex hfl-items-center hfl-justify-center hfl-gap-4",children:[C&&e.jsxRuntimeExports.jsx(e.Ku,{size:"md",textField:C,hierarchy:"Primary",className:_||"",onClick:y,"data-qa":"negative-action"}),a&&e.jsxRuntimeExports.jsx(e.Ku,{size:"md",textField:a,hierarchy:"Secondary",className:w||"",onClick:k,"data-qa":"positive-action"})]})]})},He=({open:l,onCancel:s,onCopySave:p,rowMedicineData:b,getMedicineOptions:g})=>{const[v,a]=r.useState([]),[C,w]=r.useState(""),[_,k]=r.useState([]),y=r.useCallback(async m=>{const M=(await g?.(m))?.map(S=>({label:S.doctorMedicineName,value:S}));k(M||[])},[g]);r.useEffect(()=>{l&&y(C)},[C,y,l]);const L=m=>{const $=m.value;v.some(S=>S.medicineId===$.medicineId&&S.doctorMedicineName.trim().toLowerCase()===$.doctorMedicineName.trim().toLowerCase())||a(S=>[...S,$]),w(""),k([])},B=m=>{a($=>$.filter(M=>M.medicineId!==m))},i=async()=>{C.trim()||await y("")};return e.jsxRuntimeExports.jsxs(_e.Modal,{isOpen:l,onRequestClose:s,shouldCloseOnOverlayClick:!1,style:{overlay:{backgroundColor:"rgba(52, 64, 84, 0.5)",zIndex:1030},content:{zIndex:1031,maxWidth:"600px",maxHeight:"50vh",height:"auto",margin:"auto",borderRadius:"12px",padding:"0px",display:"flex",flexDirection:"column"}},children:[e.jsxRuntimeExports.jsx(e.bs,{variant:"Bold",type:"Text lg",className:"hfl-text-White hfl-bg-gradient_primary_600_500_90 hfl-px-6 hfl-py-2",children:"Please select medicine to copy"}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-px-6 hfl-py-5 hfl-flex hfl-flex-col hfl-gap-6 hfl-overflow-y-auto hfl-flex-1",children:[e.jsxRuntimeExports.jsx(T,{inputValue:C,showInput:!0,isSearchable:!0,disableInputAutoSize:!0,inputChangeHandler:w,onChangeHandler:L,onInputFocus:i,options:_,placeholder:"Search for medicines"}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-wrap hfl-gap-2",children:v.map(m=>e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-bg-Gray-100 hfl-px-2 hfl-py-0.5 hfl-rounded-md hfl-gap-1",children:[e.jsxRuntimeExports.jsx(e.bs,{variant:"Regular",type:"Text sm",className:"hfl-text-nowrap",children:m.doctorMedicineName}),e.jsxRuntimeExports.jsx("button",{className:"hfl-text-Blue_gray-800",onClick:()=>B(m.medicineId),children:e.jsxRuntimeExports.jsx("i",{className:"hx_close"})})]},m.doctorMedicineName+m.medicineId))})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-justify-end hfl-gap-2.5 hfl-bg-Gray-50 hfl-px-7 hfl-py-3 hfl-border-t hfl-border-Gray-200",children:[e.jsxRuntimeExports.jsx(e.Ku,{size:"md",textField:"Cancel",onClick:s,hierarchy:"Secondary-Grey"}),e.jsxRuntimeExports.jsx(e.Ku,{size:"md",textField:"Save",disabled:!v||v.length==0,onClick:async()=>{await p(b,v)&&s()},className:"hfl-bg-Primary-600 hfl-text-White disabled:hfl-opacity-50 disabled:hfl-cursor-not-allowed",hierarchy:"Primary"})]})]})},ze=r.forwardRef(({data:l=[],variant:s,externallyTriggeredEditRowIds:p=[],externallyTriggeredEditMode:b=!1,allowCustomMedicineInput:g=!0,getMedicineOptions:v,onRowChange:a,onRowDelete:C,onRowCopy:w,onSaveRow:_,externalSaveTrigger:k,setSearchDisabled:y},L)=>{const[B,i]=r.useState(null),[m,$]=r.useState(!1),[M,S]=r.useState(),U=r.useCallback((c,n,N)=>{const E=l.find(H=>H.rowId===c);if(!E)return;const I={...E,...n};a?.(I,N||void 0)},[l,a]),W=r.useCallback(async()=>{const c=l.filter(n=>n.isEditing&&n.medicine_name);if(c.length!==0)try{await _?.(c)&&c.forEach(N=>{a?.({...N,isEditing:!1})})}catch(n){console.error("Bulk save failed",n)}finally{y?.(!1)}},[l,_,a,y]);r.useEffect(()=>{k&&W()},[k,W]),r.useEffect(()=>{const c=l.some(n=>n.isEditing);y?.(c)},[l,y]);const o=r.useCallback(c=>{S(c),$(!0)},[]),j=r.useCallback(async()=>{if(B)try{await C?.(B)}catch(c){console.error("Delete failed",c)}finally{i(null)}},[B,C]),f=r.useCallback(()=>{i(null)},[]),x=r.useCallback(async c=>{try{return await _?.([c])?(a?.({...c,isEditing:!1}),!0):!1}catch(n){return console.error("Save row failed",n),!1}},[_,a]),q=r.useCallback(async()=>{const c=l.filter(n=>n.isEditing&&n.medicine_name);if(c.length===0)return!0;try{const n=await _?.(c);return n&&l.map(E=>E.isEditing?{...E,isEditing:!1}:E).forEach(E=>a?.(E)),!!n}catch(n){return console.error("External bulk save failed",n),!1}},[l,_,a]);r.useImperativeHandle(L,()=>({triggerExternalSave:q}));const D={variant:s,externallyTriggeredEditMode:b,externallyTriggeredEditRowIds:p,getMedicineOptions:v,onRowChange:(c,n)=>{U(c.rowId,c,n),a?.(c,n)},onRowDelete:C,onRowCopy:w,setRowToDelete:i,openPopupForRow:o};return e.jsxRuntimeExports.jsxs("div",{className:"hfl-border-1 hfl-border-Gray-200",children:[e.jsxRuntimeExports.jsx("div",{className:"table-header hfl-grid hfl-grid-cols-[1.36fr_1.36fr_1.02fr_1.25fr_2.27fr_1.36fr_1.36fr] hfl-gap-2 hfl-py-2 hfl-px-2 hfl-font-bold hfl-border-b-1 hfl-border-Gray-200 hfl-bg-Blue_gray-50",children:A.C_Table_Column_Name.map(c=>e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text sm",className:"hfl-text-Blue_gray-600",children:c},c))}),e.jsxRuntimeExports.jsxs(we.Provider,{value:D,children:[e.jsxRuntimeExports.jsx("div",{className:"table-body",children:l.length===0?e.jsxRuntimeExports.jsx(e.bs,{variant:"Medium",type:"Text sm",className:"hfl-text-Blue_gray-600 hfl-px-2 hfl-py-3",children:"No medicines added"}):l.map(c=>e.jsxRuntimeExports.jsx($e,{rowData:c,isEditing:c.isEditing||!1,setIsEditing:n=>U(c.rowId,{isEditing:n}),onSaveRow:x,allowCustomMedicineInput:g},c.rowId))}),e.jsxRuntimeExports.jsx(qe,{headingText:"Delete Medicine",subHeadingText:"Are you sure you want to delete this medicine?",openState:!!B,positiveButtonText:"Delete",negativeButtonText:"Cancel",positiveActionCallback:j,negativeActionCallback:f,classNameNegativeBtn:"hfl-bg-Blue-600",classNamePositiveBtn:"hfl-bg-Error-500 hover:hfl-bg-Error-700 hfl-text-White",closePopupCallback:f}),e.jsxRuntimeExports.jsx(He,{open:m,onCancel:()=>$(!1),onCopySave:w,rowMedicineData:M,getMedicineOptions:v})]})]})});exports.PediatricsCalculatorTable=ze;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";const Oe=require("./CommonConstant-COHqiSWL.cjs"),Ct=require("./index-CJ2AKRoq.cjs");var nt=(e=>(e.visitpad="/md/viewPatientDashboard.php",e.consultations="/md/viewPatientList.php",e.appointments="/md/viewPatientAppointments.php",e.settings="/md/viewPreferenceSettings.php",e.privateDb="/md/viewPrivateDB.php",e.dashboardBase="/",e.referEarn="/md/inviteReferrals.php",e.teleConsults="/md/viewRemoteAppointments.php",e.pricing="/subscription/pricing",e.billSummary="/subscription/bill-summary",e.pediatricsCalculator="/md/viewPediatricCalculator.php",e))(nt||{}),rt=(e=>(e.PRODUCTION="PRODUCTION",e.STAGING="STAGING",e.DEVELOPMENT="DEVELOPMENT",e))(rt||{});function st(e,t){return function(){return e.apply(t,arguments)}}const{toString:Nt}=Object.prototype,{getPrototypeOf:Pe}=Object,{iterator:Re,toStringTag:ot}=Symbol,Te=(e=>t=>{const n=Nt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),J=e=>(e=e.toLowerCase(),t=>Te(t)===e),Ae=e=>t=>typeof t===e,{isArray:ie}=Array,se=Ae("undefined");function fe(e){return e!==null&&!se(e)&&e.constructor!==null&&!se(e.constructor)&&H(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const it=J("ArrayBuffer");function _t(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&it(e.buffer),t}const Ft=Ae("string"),H=Ae("function"),at=Ae("number"),de=e=>e!==null&&typeof e=="object",Mt=e=>e===!0||e===!1,we=e=>{if(Te(e)!=="object")return!1;const t=Pe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ot in e)&&!(Re in e)},Lt=e=>{if(!de(e)||fe(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Pt=J("Date"),kt=J("File"),Ut=J("Blob"),Bt=J("FileList"),jt=e=>de(e)&&H(e.pipe),vt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||H(e.append)&&((t=Te(e))==="formdata"||t==="object"&&H(e.toString)&&e.toString()==="[object FormData]"))},It=J("URLSearchParams"),[qt,Ht,zt,Jt]=["ReadableStream","Request","Response","Headers"].map(J),Wt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function he(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),ie(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(fe(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function ct(e,t){if(fe(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const ee=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ut=e=>!se(e)&&e!==ee;function _e(){const{caseless:e,skipUndefined:t}=ut(this)&&this||{},n={},r=(s,i)=>{const o=e&&ct(n,i)||i;we(n[o])&&we(s)?n[o]=_e(n[o],s):we(s)?n[o]=_e({},s):ie(s)?n[o]=s.slice():(!t||!se(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&he(arguments[s],r);return n}const Vt=(e,t,n,{allOwnKeys:r}={})=>(he(t,(s,i)=>{n&&H(s)?e[i]=st(s,n):e[i]=s},{allOwnKeys:r}),e),Yt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Kt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Gt=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&Pe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Xt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Zt=e=>{if(!e)return null;if(ie(e))return e;let t=e.length;if(!at(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Qt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Pe(Uint8Array)),en=(e,t)=>{const r=(e&&e[Re]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},tn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},nn=J("HTMLFormElement"),rn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),je=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),sn=J("RegExp"),lt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};he(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},on=e=>{lt(e,(t,n)=>{if(H(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(H(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},an=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return ie(e)?r(e):r(String(e).split(t)),n},cn=()=>{},un=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ln(e){return!!(e&&H(e.append)&&e[ot]==="FormData"&&e[Re])}const fn=e=>{const t=new Array(10),n=(r,s)=>{if(de(r)){if(t.indexOf(r)>=0)return;if(fe(r))return r;if(!("toJSON"in r)){t[s]=r;const i=ie(r)?[]:{};return he(r,(o,c)=>{const p=n(o,s+1);!se(p)&&(i[c]=p)}),t[s]=void 0,i}}return r};return n(e,0)},dn=J("AsyncFunction"),hn=e=>e&&(de(e)||H(e))&&H(e.then)&&H(e.catch),ft=((e,t)=>e?setImmediate:t?((n,r)=>(ee.addEventListener("message",({source:s,data:i})=>{s===ee&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),ee.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",H(ee.postMessage)),pn=typeof queueMicrotask<"u"?queueMicrotask.bind(ee):typeof process<"u"&&process.nextTick||ft,mn=e=>e!=null&&H(e[Re]),a={isArray:ie,isArrayBuffer:it,isBuffer:fe,isFormData:vt,isArrayBufferView:_t,isString:Ft,isNumber:at,isBoolean:Mt,isObject:de,isPlainObject:we,isEmptyObject:Lt,isReadableStream:qt,isRequest:Ht,isResponse:zt,isHeaders:Jt,isUndefined:se,isDate:Pt,isFile:kt,isBlob:Ut,isRegExp:sn,isFunction:H,isStream:jt,isURLSearchParams:It,isTypedArray:Qt,isFileList:Bt,forEach:he,merge:_e,extend:Vt,trim:Wt,stripBOM:Yt,inherits:Kt,toFlatObject:Gt,kindOf:Te,kindOfTest:J,endsWith:Xt,toArray:Zt,forEachEntry:en,matchAll:tn,isHTMLForm:nn,hasOwnProperty:je,hasOwnProp:je,reduceDescriptors:lt,freezeMethods:on,toObjectSet:an,toCamelCase:rn,noop:cn,toFiniteNumber:un,findKey:ct,global:ee,isContextDefined:ut,isSpecCompliantForm:ln,toJSONObject:fn,isAsyncFn:dn,isThenable:hn,setImmediate:ft,asap:pn,isIterable:mn};function R(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(R,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const dt=R.prototype,ht={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{ht[e]={value:e}});Object.defineProperties(R,ht);Object.defineProperty(dt,"isAxiosError",{value:!0});R.from=(e,t,n,r,s,i)=>{const o=Object.create(dt);a.toFlatObject(e,o,function(u){return u!==Error.prototype},l=>l!=="isAxiosError");const c=e&&e.message?e.message:"Error",p=t==null&&e?e.code:t;return R.call(o,c,p,n,r,s),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};const yn=null;function Fe(e){return a.isPlainObject(e)||a.isArray(e)}function pt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function ve(e,t,n){return e?e.concat(t).map(function(s,i){return s=pt(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function wn(e){return a.isArray(e)&&!e.some(Fe)}const bn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function De(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,w){return!a.isUndefined(w[S])});const r=n.metaTokens,s=n.visitor||u,i=n.dots,o=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function l(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!p&&a.isBlob(f))throw new R("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?p&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,S,w){let F=f;if(f&&!w&&typeof f=="object"){if(a.endsWith(S,"{}"))S=r?S:S.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&wn(f)||(a.isFileList(f)||a.endsWith(S,"[]"))&&(F=a.toArray(f)))return S=pt(S),F.forEach(function(C,k){!(a.isUndefined(C)||C===null)&&t.append(o===!0?ve([S],k,i):o===null?S:S+"[]",l(C))}),!1}return Fe(f)?!0:(t.append(ve(w,S,i),l(f)),!1)}const y=[],D=Object.assign(bn,{defaultVisitor:u,convertValue:l,isVisitable:Fe});function $(f,S){if(!a.isUndefined(f)){if(y.indexOf(f)!==-1)throw Error("Circular reference detected in "+S.join("."));y.push(f),a.forEach(f,function(F,I){(!(a.isUndefined(F)||F===null)&&s.call(t,F,a.isString(I)?I.trim():I,S,D))===!0&&$(F,S?S.concat(I):[I])}),y.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return $(e),t}function Ie(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ke(e,t){this._pairs=[],e&&De(e,this,t)}const mt=ke.prototype;mt.append=function(t,n){this._pairs.push([t,n])};mt.toString=function(t){const n=t?function(r){return t.call(this,r,Ie)}:Ie;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function gn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function yt(e,t,n){if(!t)return e;const r=n&&n.encode||gn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new ke(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class qe{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const wt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Sn=typeof URLSearchParams<"u"?URLSearchParams:ke,En=typeof FormData<"u"?FormData:null,On=typeof Blob<"u"?Blob:null,Rn={isBrowser:!0,classes:{URLSearchParams:Sn,FormData:En,Blob:On},protocols:["http","https","file","blob","url","data"]},Ue=typeof window<"u"&&typeof document<"u",Me=typeof navigator=="object"&&navigator||void 0,Tn=Ue&&(!Me||["ReactNative","NativeScript","NS"].indexOf(Me.product)<0),An=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Dn=Ue&&window.location.href||"http://localhost",xn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ue,hasStandardBrowserEnv:Tn,hasStandardBrowserWebWorkerEnv:An,navigator:Me,origin:Dn},Symbol.toStringTag,{value:"Module"})),U={...xn,...Rn};function $n(e,t){return De(e,new U.classes.URLSearchParams,{visitor:function(n,r,s,i){return U.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Cn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Nn(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function bt(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),p=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,p?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=Nn(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Cn(r),s,n,0)}),n}return null}function _n(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const pe={transitional:wt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(bt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return $n(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return De(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),_n(t)):t}],transformResponse:[function(t){const n=this.transitional||pe.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?R.from(c,R.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:U.classes.FormData,Blob:U.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{pe.headers[e]={}});const Fn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Mn=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
-
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&Fn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},He=Symbol("internals");function le(e){return e&&String(e).trim().toLowerCase()}function be(e){return e===!1||e==null?e:a.isArray(e)?e.map(be):String(e)}function Ln(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Pn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function $e(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function kn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Un(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let z=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,p,l){const u=le(p);if(!u)throw new Error("header name must be a non-empty string");const y=a.findKey(s,u);(!y||s[y]===void 0||l===!0||l===void 0&&s[y]!==!1)&&(s[y||p]=be(c))}const o=(c,p)=>a.forEach(c,(l,u)=>i(l,u,p));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!Pn(t))o(Mn(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},p,l;for(const u of t){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[l=u[0]]=(p=c[l])?a.isArray(p)?[...p,u[1]]:[p,u[1]]:u[1]}o(c,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=le(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Ln(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=le(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||$e(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=le(o),o){const c=a.findKey(r,o);c&&(!n||$e(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||$e(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=be(s),delete n[i];return}const c=t?kn(i):String(i).trim();c!==i&&delete n[i],n[c]=be(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[He]=this[He]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=le(o);r[c]||(Un(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};z.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(z.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(z);function Ce(e,t){const n=this||pe,r=t||n,s=z.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function gt(e){return!!(e&&e.__CANCEL__)}function ae(e,t,n){R.call(this,e??"canceled",R.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(ae,R,{__CANCEL__:!0});function St(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new R("Request failed with status code "+n.status,[R.ERR_BAD_REQUEST,R.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Bn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function jn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(p){const l=Date.now(),u=r[i];o||(o=l),n[s]=p,r[s]=l;let y=i,D=0;for(;y!==s;)D+=n[y++],y=y%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-o<t)return;const $=u&&l-u;return $?Math.round(D*1e3/$):void 0}}function vn(e,t){let n=0,r=1e3/t,s,i;const o=(l,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e(...l)};return[(...l)=>{const u=Date.now(),y=u-n;y>=r?o(l,u):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},r-y)))},()=>s&&o(s)]}const Ee=(e,t,n=3)=>{let r=0;const s=jn(50,250);return vn(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,p=o-r,l=s(p),u=o<=c;r=o;const y={loaded:o,total:c,progress:c?o/c:void 0,bytes:p,rate:l||void 0,estimated:l&&c&&u?(c-o)/l:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(y)},n)},ze=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Je=e=>(...t)=>a.asap(()=>e(...t)),In=U.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,U.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(U.origin),U.navigator&&/(msie|trident)/i.test(U.navigator.userAgent)):()=>!0,qn=U.hasStandardBrowserEnv?{write(e,t,n,r,s,i,o){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Hn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function zn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Et(e,t,n){let r=!Hn(t);return e&&(r||n==!1)?zn(e,t):t}const We=e=>e instanceof z?{...e}:e;function ne(e,t){t=t||{};const n={};function r(l,u,y,D){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:D},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(l,u,y,D){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l,y,D)}else return r(l,u,y,D)}function i(l,u){if(!a.isUndefined(u))return r(void 0,u)}function o(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return r(void 0,l)}else return r(void 0,u)}function c(l,u,y){if(y in t)return r(l,u);if(y in e)return r(void 0,l)}const p={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(l,u,y)=>s(We(l),We(u),y,!0)};return a.forEach(Object.keys({...e,...t}),function(u){const y=p[u]||s,D=y(e[u],t[u],u);a.isUndefined(D)&&y!==c||(n[u]=D)}),n}const Ot=e=>{const t=ne({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;if(t.headers=o=z.from(o),t.url=yt(Et(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(U.hasStandardBrowserEnv||U.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const p=n.getHeaders(),l=["content-type","content-length"];Object.entries(p).forEach(([u,y])=>{l.includes(u.toLowerCase())&&o.set(u,y)})}}if(U.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&In(t.url))){const p=s&&i&&qn.read(i);p&&o.set(s,p)}return t},Jn=typeof XMLHttpRequest<"u",Wn=Jn&&function(e){return new Promise(function(n,r){const s=Ot(e);let i=s.data;const o=z.from(s.headers).normalize();let{responseType:c,onUploadProgress:p,onDownloadProgress:l}=s,u,y,D,$,f;function S(){$&&$(),f&&f(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let w=new XMLHttpRequest;w.open(s.method.toUpperCase(),s.url,!0),w.timeout=s.timeout;function F(){if(!w)return;const C=z.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),P={data:!c||c==="text"||c==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:C,config:e,request:w};St(function(j){n(j),S()},function(j){r(j),S()},P),w=null}"onloadend"in w?w.onloadend=F:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(F)},w.onabort=function(){w&&(r(new R("Request aborted",R.ECONNABORTED,e,w)),w=null)},w.onerror=function(k){const P=k&&k.message?k.message:"Network Error",B=new R(P,R.ERR_NETWORK,e,w);B.event=k||null,r(B),w=null},w.ontimeout=function(){let k=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const P=s.transitional||wt;s.timeoutErrorMessage&&(k=s.timeoutErrorMessage),r(new R(k,P.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,e,w)),w=null},i===void 0&&o.setContentType(null),"setRequestHeader"in w&&a.forEach(o.toJSON(),function(k,P){w.setRequestHeader(P,k)}),a.isUndefined(s.withCredentials)||(w.withCredentials=!!s.withCredentials),c&&c!=="json"&&(w.responseType=s.responseType),l&&([D,f]=Ee(l,!0),w.addEventListener("progress",D)),p&&w.upload&&([y,$]=Ee(p),w.upload.addEventListener("progress",y),w.upload.addEventListener("loadend",$)),(s.cancelToken||s.signal)&&(u=C=>{w&&(r(!C||C.type?new ae(null,e,w):C),w.abort(),w=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const I=Bn(s.url);if(I&&U.protocols.indexOf(I)===-1){r(new R("Unsupported protocol "+I+":",R.ERR_BAD_REQUEST,e));return}w.send(i||null)})},Vn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(l){if(!s){s=!0,c();const u=l instanceof Error?l:this.reason;r.abort(u instanceof R?u:new ae(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,i(new R(`timeout ${t} of ms exceeded`,R.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:p}=r;return p.unsubscribe=()=>a.asap(c),p}},Yn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Kn=async function*(e,t){for await(const n of Gn(e))yield*Yn(n,t)},Gn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ve=(e,t,n,r)=>{const s=Kn(e,t);let i=0,o,c=p=>{o||(o=!0,r&&r(p))};return new ReadableStream({async pull(p){try{const{done:l,value:u}=await s.next();if(l){c(),p.close();return}let y=u.byteLength;if(n){let D=i+=y;n(D)}p.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(p){return c(p),s.return()}},{highWaterMark:2})},Ye=64*1024,{isFunction:ye}=a,Xn=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Ke,TextEncoder:Ge}=a.global,Xe=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Zn=e=>{e=a.merge.call({skipUndefined:!0},Xn,e);const{fetch:t,Request:n,Response:r}=e,s=t?ye(t):typeof fetch=="function",i=ye(n),o=ye(r);if(!s)return!1;const c=s&&ye(Ke),p=s&&(typeof Ge=="function"?(f=>S=>f.encode(S))(new Ge):async f=>new Uint8Array(await new n(f).arrayBuffer())),l=i&&c&&Xe(()=>{let f=!1;const S=new n(U.origin,{body:new Ke,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!S}),u=o&&c&&Xe(()=>a.isReadableStream(new r("").body)),y={stream:u&&(f=>f.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!y[f]&&(y[f]=(S,w)=>{let F=S&&S[f];if(F)return F.call(S);throw new R(`Response type '${f}' is not supported`,R.ERR_NOT_SUPPORT,w)})});const D=async f=>{if(f==null)return 0;if(a.isBlob(f))return f.size;if(a.isSpecCompliantForm(f))return(await new n(U.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(a.isArrayBufferView(f)||a.isArrayBuffer(f))return f.byteLength;if(a.isURLSearchParams(f)&&(f=f+""),a.isString(f))return(await p(f)).byteLength},$=async(f,S)=>{const w=a.toFiniteNumber(f.getContentLength());return w??D(S)};return async f=>{let{url:S,method:w,data:F,signal:I,cancelToken:C,timeout:k,onDownloadProgress:P,onUploadProgress:B,responseType:j,headers:X,withCredentials:V="same-origin",fetchOptions:M}=Ot(f),A=t||fetch;j=j?(j+"").toLowerCase():"text";let Y=Vn([I,C&&C.toAbortSignal()],k),K=null;const g=Y&&Y.unsubscribe&&(()=>{Y.unsubscribe()});let m;try{if(B&&l&&w!=="get"&&w!=="head"&&(m=await $(X,F))!==0){let T=new n(S,{method:"POST",body:F,duplex:"half"}),x;if(a.isFormData(F)&&(x=T.headers.get("content-type"))&&X.setContentType(x),T.body){const[N,L]=ze(m,Ee(Je(B)));F=Ve(T.body,Ye,N,L)}}a.isString(V)||(V=V?"include":"omit");const d=i&&"credentials"in n.prototype,b={...M,signal:Y,method:w.toUpperCase(),headers:X.normalize().toJSON(),body:F,duplex:"half",credentials:d?V:void 0};K=i&&new n(S,b);let h=await(i?A(K,M):A(S,b));const E=u&&(j==="stream"||j==="response");if(u&&(P||E&&g)){const T={};["status","statusText","headers"].forEach(v=>{T[v]=h[v]});const x=a.toFiniteNumber(h.headers.get("content-length")),[N,L]=P&&ze(x,Ee(Je(P),!0))||[];h=new r(Ve(h.body,Ye,N,()=>{L&&L(),g&&g()}),T)}j=j||"text";let O=await y[a.findKey(y,j)||"text"](h,f);return!E&&g&&g(),await new Promise((T,x)=>{St(T,x,{data:O,headers:z.from(h.headers),status:h.status,statusText:h.statusText,config:f,request:K})})}catch(d){throw g&&g(),d&&d.name==="TypeError"&&/Load failed|fetch/i.test(d.message)?Object.assign(new R("Network Error",R.ERR_NETWORK,f,K),{cause:d.cause||d}):R.from(d,d&&d.code,f,K)}}},Qn=new Map,Rt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o=i.length,c=o,p,l,u=Qn;for(;c--;)p=i[c],l=u.get(p),l===void 0&&u.set(p,l=c?new Map:Zn(t)),u=l;return l};Rt();const Be={http:yn,xhr:Wn,fetch:{get:Rt}};a.forEach(Be,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ze=e=>`- ${e}`,er=e=>a.isFunction(e)||e===null||e===!1;function tr(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let o=0;o<n;o++){r=e[o];let c;if(s=r,!er(r)&&(s=Be[(c=String(r)).toLowerCase()],s===void 0))throw new R(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([p,l])=>`adapter ${p} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=n?o.length>1?`since :
|
|
4
|
-
`+o.map(Ze).join(`
|
|
5
|
-
`):" "+Ze(o[0]):"as no adapter specified";throw new R("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const Tt={getAdapter:tr,adapters:Be};function Ne(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ae(null,e)}function Qe(e){return Ne(e),e.headers=z.from(e.headers),e.data=Ce.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Tt.getAdapter(e.adapter||pe.adapter,e)(e).then(function(r){return Ne(e),r.data=Ce.call(e,e.transformResponse,r),r.headers=z.from(r.headers),r},function(r){return gt(r)||(Ne(e),r&&r.response&&(r.response.data=Ce.call(e,e.transformResponse,r.response),r.response.headers=z.from(r.response.headers))),Promise.reject(r)})}const At="1.13.1",xe={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{xe[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const et={};xe.transitional=function(t,n,r){function s(i,o){return"[Axios v"+At+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new R(s(o," has been removed"+(n?" in "+n:"")),R.ERR_DEPRECATED);return n&&!et[o]&&(et[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}};xe.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function nr(e,t,n){if(typeof e!="object")throw new R("options must be an object",R.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],p=c===void 0||o(c,i,e);if(p!==!0)throw new R("option "+i+" must be "+p,R.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new R("Unknown option "+i,R.ERR_BAD_OPTION)}}const ge={assertOptions:nr,validators:xe},W=ge.validators;let te=class{constructor(t){this.defaults=t||{},this.interceptors={request:new qe,response:new qe}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
6
|
-
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ne(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&ge.assertOptions(r,{silentJSONParsing:W.transitional(W.boolean),forcedJSONParsing:W.transitional(W.boolean),clarifyTimeoutError:W.transitional(W.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ge.assertOptions(s,{encode:W.function,serialize:W.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ge.assertOptions(n,{baseUrl:W.spelling("baseURL"),withXsrfToken:W.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),n.headers=z.concat(o,i);const c=[];let p=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(p=p&&S.synchronous,c.unshift(S.fulfilled,S.rejected))});const l=[];this.interceptors.response.forEach(function(S){l.push(S.fulfilled,S.rejected)});let u,y=0,D;if(!p){const f=[Qe.bind(this),void 0];for(f.unshift(...c),f.push(...l),D=f.length,u=Promise.resolve(n);y<D;)u=u.then(f[y++],f[y++]);return u}D=c.length;let $=n;for(;y<D;){const f=c[y++],S=c[y++];try{$=f($)}catch(w){S.call(this,w);break}}try{u=Qe.call(this,$)}catch(f){return Promise.reject(f)}for(y=0,D=l.length;y<D;)u=u.then(l[y++],l[y++]);return u}getUri(t){t=ne(this.defaults,t);const n=Et(t.baseURL,t.url,t.allowAbsoluteUrls);return yt(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){te.prototype[t]=function(n,r){return this.request(ne(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(ne(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}te.prototype[t]=n(),te.prototype[t+"Form"]=n(!0)});let rr=class Dt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new ae(i,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Dt(function(s){t=s}),cancel:t}}};function sr(e){return function(n){return e.apply(null,n)}}function or(e){return a.isObject(e)&&e.isAxiosError===!0}const Le={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Le).forEach(([e,t])=>{Le[t]=e});function xt(e){const t=new te(e),n=st(te.prototype.request,t);return a.extend(n,te.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return xt(ne(e,s))},n}const _=xt(pe);_.Axios=te;_.CanceledError=ae;_.CancelToken=rr;_.isCancel=gt;_.VERSION=At;_.toFormData=De;_.AxiosError=R;_.Cancel=_.CanceledError;_.all=function(t){return Promise.all(t)};_.spread=sr;_.isAxiosError=or;_.mergeConfig=ne;_.AxiosHeaders=z;_.formToJSON=e=>bt(a.isHTMLForm(e)?new FormData(e):e);_.getAdapter=Tt.getAdapter;_.HttpStatusCode=Le;_.default=_;const{Axios:Cr,AxiosError:Nr,CanceledError:_r,isCancel:Fr,CancelToken:Mr,VERSION:Lr,all:Pr,Cancel:kr,isAxiosError:Ur,spread:Br,toFormData:jr,AxiosHeaders:vr,HttpStatusCode:Ir,formToJSON:qr,getAdapter:Hr,mergeConfig:zr}=_,$t={timeout:60*1e3,headers:{Accept:"application/json","Content-Type":"application/json"}},ir=(e="",t)=>{const n=_.create({...$t,baseURL:Oe.BASE_URLS[t].rearch_url});return n.interceptors.request.use(r=>(e&&r.headers&&(r.headers.Authorization=`Bearer ${e}`),r),r=>Promise.reject(r)),n.interceptors.response.use(r=>r,r=>{const{response:s,request:i}=r||{};return Promise.reject(s||i)}),n},ar=(e="",t)=>{const n=_.create({...$t,baseURL:Oe.BASE_URLS[t].rearch_url});return n.interceptors.request.use(r=>(e&&r.headers&&(r.headers.Authorization=`Bearer ${e}`),r),r=>Promise.reject(r)),n.interceptors.response.use(r=>r,r=>{const{response:s,request:i}=r||{};return Promise.reject(s||i)}),n};var Se={exports:{}},cr=Se.exports,tt;function ur(){return tt||(tt=1,function(e,t){(function(n,r){e.exports=r()})(cr,function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",c="minute",p="hour",l="day",u="week",y="month",D="quarter",$="year",f="date",S="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,F=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,I={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(g){var m=["th","st","nd","rd"],d=g%100;return"["+g+(m[(d-20)%10]||m[d]||m[0])+"]"}},C=function(g,m,d){var b=String(g);return!b||b.length>=m?g:""+Array(m+1-b.length).join(d)+g},k={s:C,z:function(g){var m=-g.utcOffset(),d=Math.abs(m),b=Math.floor(d/60),h=d%60;return(m<=0?"+":"-")+C(b,2,"0")+":"+C(h,2,"0")},m:function g(m,d){if(m.date()<d.date())return-g(d,m);var b=12*(d.year()-m.year())+(d.month()-m.month()),h=m.clone().add(b,y),E=d-h<0,O=m.clone().add(b+(E?-1:1),y);return+(-(b+(d-h)/(E?h-O:O-h))||0)},a:function(g){return g<0?Math.ceil(g)||0:Math.floor(g)},p:function(g){return{M:y,y:$,w:u,d:l,D:f,h:p,m:c,s:o,ms:i,Q:D}[g]||String(g||"").toLowerCase().replace(/s$/,"")},u:function(g){return g===void 0}},P="en",B={};B[P]=I;var j="$isDayjsObject",X=function(g){return g instanceof Y||!(!g||!g[j])},V=function g(m,d,b){var h;if(!m)return P;if(typeof m=="string"){var E=m.toLowerCase();B[E]&&(h=E),d&&(B[E]=d,h=E);var O=m.split("-");if(!h&&O.length>1)return g(O[0])}else{var T=m.name;B[T]=m,h=T}return!b&&h&&(P=h),h||!b&&P},M=function(g,m){if(X(g))return g.clone();var d=typeof m=="object"?m:{};return d.date=g,d.args=arguments,new Y(d)},A=k;A.l=V,A.i=X,A.w=function(g,m){return M(g,{locale:m.$L,utc:m.$u,x:m.$x,$offset:m.$offset})};var Y=function(){function g(d){this.$L=V(d.locale,null,!0),this.parse(d),this.$x=this.$x||d.x||{},this[j]=!0}var m=g.prototype;return m.parse=function(d){this.$d=function(b){var h=b.date,E=b.utc;if(h===null)return new Date(NaN);if(A.u(h))return new Date;if(h instanceof Date)return new Date(h);if(typeof h=="string"&&!/Z$/i.test(h)){var O=h.match(w);if(O){var T=O[2]-1||0,x=(O[7]||"0").substring(0,3);return E?new Date(Date.UTC(O[1],T,O[3]||1,O[4]||0,O[5]||0,O[6]||0,x)):new Date(O[1],T,O[3]||1,O[4]||0,O[5]||0,O[6]||0,x)}}return new Date(h)}(d),this.init()},m.init=function(){var d=this.$d;this.$y=d.getFullYear(),this.$M=d.getMonth(),this.$D=d.getDate(),this.$W=d.getDay(),this.$H=d.getHours(),this.$m=d.getMinutes(),this.$s=d.getSeconds(),this.$ms=d.getMilliseconds()},m.$utils=function(){return A},m.isValid=function(){return this.$d.toString()!==S},m.isSame=function(d,b){var h=M(d);return this.startOf(b)<=h&&h<=this.endOf(b)},m.isAfter=function(d,b){return M(d)<this.startOf(b)},m.isBefore=function(d,b){return this.endOf(b)<M(d)},m.$g=function(d,b,h){return A.u(d)?this[b]:this.set(h,d)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(d,b){var h=this,E=!!A.u(b)||b,O=A.p(d),T=function(Q,q){var G=A.w(h.$u?Date.UTC(h.$y,q,Q):new Date(h.$y,q,Q),h);return E?G:G.endOf(l)},x=function(Q,q){return A.w(h.toDate()[Q].apply(h.toDate("s"),(E?[0,0,0,0]:[23,59,59,999]).slice(q)),h)},N=this.$W,L=this.$M,v=this.$D,re="set"+(this.$u?"UTC":"");switch(O){case $:return E?T(1,0):T(31,11);case y:return E?T(1,L):T(0,L+1);case u:var Z=this.$locale().weekStart||0,ce=(N<Z?N+7:N)-Z;return T(E?v-ce:v+(6-ce),L);case l:case f:return x(re+"Hours",0);case p:return x(re+"Minutes",1);case c:return x(re+"Seconds",2);case o:return x(re+"Milliseconds",3);default:return this.clone()}},m.endOf=function(d){return this.startOf(d,!1)},m.$set=function(d,b){var h,E=A.p(d),O="set"+(this.$u?"UTC":""),T=(h={},h[l]=O+"Date",h[f]=O+"Date",h[y]=O+"Month",h[$]=O+"FullYear",h[p]=O+"Hours",h[c]=O+"Minutes",h[o]=O+"Seconds",h[i]=O+"Milliseconds",h)[E],x=E===l?this.$D+(b-this.$W):b;if(E===y||E===$){var N=this.clone().set(f,1);N.$d[T](x),N.init(),this.$d=N.set(f,Math.min(this.$D,N.daysInMonth())).$d}else T&&this.$d[T](x);return this.init(),this},m.set=function(d,b){return this.clone().$set(d,b)},m.get=function(d){return this[A.p(d)]()},m.add=function(d,b){var h,E=this;d=Number(d);var O=A.p(b),T=function(L){var v=M(E);return A.w(v.date(v.date()+Math.round(L*d)),E)};if(O===y)return this.set(y,this.$M+d);if(O===$)return this.set($,this.$y+d);if(O===l)return T(1);if(O===u)return T(7);var x=(h={},h[c]=r,h[p]=s,h[o]=n,h)[O]||1,N=this.$d.getTime()+d*x;return A.w(N,this)},m.subtract=function(d,b){return this.add(-1*d,b)},m.format=function(d){var b=this,h=this.$locale();if(!this.isValid())return h.invalidDate||S;var E=d||"YYYY-MM-DDTHH:mm:ssZ",O=A.z(this),T=this.$H,x=this.$m,N=this.$M,L=h.weekdays,v=h.months,re=h.meridiem,Z=function(q,G,ue,me){return q&&(q[G]||q(b,E))||ue[G].slice(0,me)},ce=function(q){return A.s(T%12||12,q,"0")},Q=re||function(q,G,ue){var me=q<12?"AM":"PM";return ue?me.toLowerCase():me};return E.replace(F,function(q,G){return G||function(ue){switch(ue){case"YY":return String(b.$y).slice(-2);case"YYYY":return A.s(b.$y,4,"0");case"M":return N+1;case"MM":return A.s(N+1,2,"0");case"MMM":return Z(h.monthsShort,N,v,3);case"MMMM":return Z(v,N);case"D":return b.$D;case"DD":return A.s(b.$D,2,"0");case"d":return String(b.$W);case"dd":return Z(h.weekdaysMin,b.$W,L,2);case"ddd":return Z(h.weekdaysShort,b.$W,L,3);case"dddd":return L[b.$W];case"H":return String(T);case"HH":return A.s(T,2,"0");case"h":return ce(1);case"hh":return ce(2);case"a":return Q(T,x,!0);case"A":return Q(T,x,!1);case"m":return String(x);case"mm":return A.s(x,2,"0");case"s":return String(b.$s);case"ss":return A.s(b.$s,2,"0");case"SSS":return A.s(b.$ms,3,"0");case"Z":return O}return null}(q)||O.replace(":","")})},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(d,b,h){var E,O=this,T=A.p(b),x=M(d),N=(x.utcOffset()-this.utcOffset())*r,L=this-x,v=function(){return A.m(O,x)};switch(T){case $:E=v()/12;break;case y:E=v();break;case D:E=v()/3;break;case u:E=(L-N)/6048e5;break;case l:E=(L-N)/864e5;break;case p:E=L/s;break;case c:E=L/r;break;case o:E=L/n;break;default:E=L}return h?E:A.a(E)},m.daysInMonth=function(){return this.endOf(y).$D},m.$locale=function(){return B[this.$L]},m.locale=function(d,b){if(!d)return this.$L;var h=this.clone(),E=V(d,b,!0);return E&&(h.$L=E),h},m.clone=function(){return A.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},g}(),K=Y.prototype;return M.prototype=K,[["$ms",i],["$s",o],["$m",c],["$H",p],["$W",l],["$M",y],["$y",$],["$D",f]].forEach(function(g){K[g[1]]=function(m){return this.$g(m,g[0],g[1])}}),M.extend=function(g,m){return g.$i||(g(m,Y,M),g.$i=!0),M},M.locale=V,M.isDayjs=X,M.unix=function(g){return M(1e3*g)},M.en=B[P],M.Ls=B,M.p={},M})}(Se)),Se.exports}var lr=ur();const oe=Ct.getDefaultExportFromCjs(lr),fr=e=>{window.location.href=e},dr=e=>{const t=[];if(e.length)for(const n of e)t.push({title:n,value:n});return t},hr=e=>{const t=[];if(e.length)for(const n of e)t.push({doctor_id:n.doctor_id?n.doctor_id:"",doctor_name:n.doctor_name?n.doctor_name:"",label:n.doctor_name?n.doctor_name:"",specialist:n.specialist||""});return t},pr=e=>{try{JSON.parse(e)}catch(t){return console.log("Error parsing JSON:",t),!1}return!0},mr=(e,t)=>{if(t?.length){const n=t.toLowerCase();if(e&&(n==="day"||n==="days"||n==="weeks"||n==="months"||n==="years")){e=e?e.toString():"";const r=oe().subtract(Number(e.replace(/[^0-9]/g,"")),n);return oe(r).format("YYYY-MM-DD")}return null}return null},yr=e=>{switch(e){case"0":return"M";case"1":return"F";case"2":return"O";default:return"O"}},wr=e=>{const t=Oe.genderList.find(n=>n.value===e);return t&&t.text?t.text.slice(0,1):""},br=e=>{let t="";return new RegExp("^[0-9]{10}$").test(e)?{isError:!1,msg:t}:(e.length<10?t="Please enter 10 digit number":e.length>10?t="Invalid phone number. Should have at most 10 digits.":/^\d+$/.test(e)?t="Please enter 10 digit number":t="Invalid phone number. Should contain only digits.",{isError:!0,msg:t})},gr=e=>e?new Date(e).toString()!=="Invalid Date":!1;function Sr(e){const t=oe(e).format("YYYY-MM-DD"),n=new Date(t),s=Math.abs(new Date().getTime()-n.getTime()),i=Math.ceil(s/(1e3*60*60*24));if(i<=7)return`${i} days`;if(i<=30)return`${Math.floor(i/7)} weeks`;if(i<=365)return`${Math.floor(i/30)} months`;{const o=Math.floor(i/365);return isNaN(o)?"":`${o} years`}}const Er=(e,t=300)=>{let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{n=null,e.apply(this,r)},t)}},Or=(e,t)=>{if(t?.length){const n=t.toLowerCase();if(e&&(n==="day"||n==="days"||n==="weeks"||n==="months"||n==="years")){e=e?e.toString():"";const r=oe().subtract(Number(e.replace(/[^0-9]/g,"")),n);return oe(r).format("YYYY-MM-DD")}return null}return null},Rr=()=>{const{title:e,subTitle:t,type:n,time:r}=Oe.UnauthorizedAccessMessage;typeof window.showToast=="function"&&window.showToast(e,t,n,r)};function Tr(e=""){return e?e.charAt(0).toUpperCase()+e.slice(1):""}const Ar=(e="",t="")=>{const n=e.split(" ")[0].toLowerCase();window.location.href=`${window.location.origin}/subscription/${n}/${t}`},Dr=(e,t="")=>{const n=t?.length&&t?.trim()?t?.trim():"";try{if(typeof e=="string"&&e?.length&&e?.trim()){const r=e.replace(/\s+/g," ").trim().split(" ");return r?.length?{duration:r[0]||"",durationType:r[1]?.length?r[1]:n||""}:{duration:"",durationType:""}}return{duration:e?`${e}`:"",durationType:n}}catch(r){return console.log(r,"getDurationFormat"),{duration:"",durationType:""}}};exports.EAPP_ROUTES=nt;exports.E_ENVIRONMENT=rt;exports.ReArchAPI=ar;exports.calculateAge=Sr;exports.calculateDOB=Or;exports.calculateDate=mr;exports.capitalizeFirstLetter=Tr;exports.dayjs=oe;exports.debounceFn=Er;exports.getDurationFormat=Dr;exports.getGender=wr;exports.getGenderKey=yr;exports.goToPage=fr;exports.handle401Status=Rr;exports.hplxAPI=ir;exports.isJson=pr;exports.isValidDate=gr;exports.parseReferredByDocList=hr;exports.parseThroughChannelList=dr;exports.redirectionToSubscription=Ar;exports.validateMobileNo=br;
|