@fluidattacks/design 3.13.4 → 3.13.5-pr
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/components/@core/index.js +1 -1
- package/dist/components/accordion/accordion-content/index.js +1 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/card/card-header/index.js +1 -1
- package/dist/components/card/card-with-image/index.js +1 -1
- package/dist/components/card/card-with-input/index.js +1 -1
- package/dist/components/card/card-with-options/index.js +1 -1
- package/dist/components/card/card-with-selector/index.js +1 -1
- package/dist/components/card/card-with-switch/index.js +1 -1
- package/dist/components/card/index.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/cloud-image/index.js +1 -1
- package/dist/components/code-snippet/index.js +1 -1
- package/dist/components/code-snippet/location-code/index.js +1 -1
- package/dist/components/colors/index.js +1 -1
- package/dist/components/confirm-dialog/index.js +1 -1
- package/dist/components/container/index.js +1 -1
- package/dist/components/content-card/category-tag/index.js +1 -1
- package/dist/components/content-card/event-date/index.js +1 -1
- package/dist/components/content-card/index.js +1 -1
- package/dist/components/content-card-carousel/index.js +1 -1
- package/dist/components/content-card-carousel/scroll-buttons/index.js +1 -1
- package/dist/components/divider/index.js +1 -1
- package/dist/components/empty-state/empty-button/index.js +1 -1
- package/dist/components/empty-state/index.js +1 -1
- package/dist/components/file-preview/index.js +1 -1
- package/dist/components/form/index.js +1 -1
- package/dist/components/form/inner-form/index.js +1 -1
- package/dist/components/grid-container/index.js +1 -1
- package/dist/components/group-selector/index.js +1 -1
- package/dist/components/group-selector/option-container/index.js +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/indicator-card/index.js +1 -1
- package/dist/components/info-sidebar/index.js +1 -1
- package/dist/components/inputs/fields/combobox/field/index.js +1 -1
- package/dist/components/inputs/fields/combobox/index.js +1 -1
- package/dist/components/inputs/fields/combobox/option/index.js +1 -1
- package/dist/components/inputs/fields/date/calendar/cell/index.js +1 -1
- package/dist/components/inputs/fields/date/calendar/grid/index.js +1 -1
- package/dist/components/inputs/fields/date/calendar/header/index.js +1 -1
- package/dist/components/inputs/fields/date/calendar/index.js +1 -1
- package/dist/components/inputs/fields/date/index.js +1 -1
- package/dist/components/inputs/fields/date-range/calendar/index.js +1 -1
- package/dist/components/inputs/fields/date-range/index.js +1 -1
- package/dist/components/inputs/fields/date-time/calendar/index.js +1 -1
- package/dist/components/inputs/fields/date-time/index.js +1 -1
- package/dist/components/inputs/fields/editable/index.js +1 -1
- package/dist/components/inputs/fields/input/index.js +1 -1
- package/dist/components/inputs/fields/input-file/index.js +1 -1
- package/dist/components/inputs/fields/input-tags/field/index.js +1 -1
- package/dist/components/inputs/fields/input-tags/index.js +1 -1
- package/dist/components/inputs/fields/number/index.js +1 -1
- package/dist/components/inputs/fields/number-range/index.js +1 -1
- package/dist/components/inputs/fields/phone/index.js +1 -1
- package/dist/components/inputs/fields/text-area/index.js +1 -1
- package/dist/components/inputs/index.js +1 -1
- package/dist/components/inputs/label/index.js +1 -1
- package/dist/components/inputs/outline-container/index.js +1 -1
- package/dist/components/inputs/utils/action-button/index.js +1 -1
- package/dist/components/inputs/utils/calendar-button/index.js +1 -1
- package/dist/components/inputs/utils/date-selector/index.js +1 -1
- package/dist/components/inputs/utils/date-time-field/index.js +1 -1
- package/dist/components/inputs/utils/dialog/index.js +1 -1
- package/dist/components/inputs/utils/number-field/index.js +1 -1
- package/dist/components/inputs/utils/popover/index.js +1 -1
- package/dist/components/interactive-card/icon/index.js +1 -1
- package/dist/components/interactive-card/index.js +1 -1
- package/dist/components/language-selector/index.js +1 -1
- package/dist/components/language-selector/item-list/index.js +1 -1
- package/dist/components/layout/categories/buttons/index.js +1 -1
- package/dist/components/layout/categories/column/index.js +1 -1
- package/dist/components/layout/categories/gap/index.js +1 -1
- package/dist/components/layout/categories/row/index.js +1 -1
- package/dist/components/layout/index.js +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/list-item/index.js +1 -1
- package/dist/components/little-flag/index.js +1 -1
- package/dist/components/loading/index.js +1 -1
- package/dist/components/logo/index.js +1 -1
- package/dist/components/logo-carousel/index.js +1 -1
- package/dist/components/menu/index.js +1 -1
- package/dist/components/message-banner/index.js +1 -1
- package/dist/components/modal/columns-modal/index.js +1 -1
- package/dist/components/modal/columns-modal/preview-panel/index.js +1 -1
- package/dist/components/modal/columns-modal/search-panel/index.js +1 -1
- package/dist/components/modal/filters-modal/applied-filter/index.js +1 -1
- package/dist/components/modal/filters-modal/applied-filters/index.js +1 -1
- package/dist/components/modal/filters-modal/filter-control/index.js +1 -1
- package/dist/components/modal/filters-modal/filter-form/form-content/index.js +1 -1
- package/dist/components/modal/filters-modal/filter-form/hooks/index.js +1 -1
- package/dist/components/modal/filters-modal/filter-form/index.js +1 -1
- package/dist/components/modal/filters-modal/filters-list/index.js +1 -1
- package/dist/components/modal/filters-modal/index.js +1 -1
- package/dist/components/modal/filters-modal/single-column-filters/index.js +1 -1
- package/dist/components/modal/filters-modal/two-columns-filters/index.js +1 -1
- package/dist/components/modal/footer/index.js +1 -1
- package/dist/components/modal/header/index.js +1 -1
- package/dist/components/modal/index.js +1 -1
- package/dist/components/modal/modal-confirm/index.js +1 -1
- package/dist/components/notification/index.js +1 -1
- package/dist/components/notification-sign/index.js +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/oauth-selector/index.js +1 -1
- package/dist/components/oauth-selector/option-container/index.js +1 -1
- package/dist/components/plan-card/index.js +1 -1
- package/dist/components/plan-card/recommended-tag/index.js +1 -1
- package/dist/components/pop-up/description/index.js +1 -1
- package/dist/components/pop-up/index.js +1 -1
- package/dist/components/premium-feature/index.js +1 -1
- package/dist/components/priority-score/index.js +1 -1
- package/dist/components/progress/index.js +1 -1
- package/dist/components/progress-bar/index.js +1 -1
- package/dist/components/radio-button/index.js +1 -1
- package/dist/components/scroll-button/index.js +1 -1
- package/dist/components/search/index.js +1 -1
- package/dist/components/search-bar/index.js +1 -1
- package/dist/components/search-bar/item-searching/index.js +1 -1
- package/dist/components/severity-badge/index.js +1 -1
- package/dist/components/severity-overview/badge/index.js +1 -1
- package/dist/components/severity-overview/index.js +1 -1
- package/dist/components/show-on-hover/index.js +1 -1
- package/dist/components/slide-out-menu/index.js +1 -1
- package/dist/components/slide-out-menu/menu-item/index.js +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/thumb/index.js +1 -1
- package/dist/components/step-lapse/index.js +1 -1
- package/dist/components/table-button/index.js +1 -1
- package/dist/components/tabs/fixed-tabs/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/tab/index.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/timeline/card/index.js +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/toggle/index.js +1 -1
- package/dist/components/toggle-buttons/index.js +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tour/index.js +1 -1
- package/dist/components/typography/heading/index.js +1 -1
- package/dist/components/typography/index.js +1 -1
- package/dist/components/typography/span/index.js +1 -1
- package/dist/components/typography/text/index.js +1 -1
- package/dist/components/web-form/index.js +1 -1
- package/dist/{components-ChZYiAEU.js → components-Br_7aMEg.js} +17 -17
- package/dist/{components-DGnRFNpO.mjs → components-DVPK7fgI.mjs} +172 -172
- package/dist/hooks/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),u=require("react"),s=require("./vendor-Fd8GJpo1.js"),U=require("react-dom"),Le=require("react-router-dom"),Y=e=>({getVariant:(i,n)=>e(i)[n]}),ft=["padding","px","py","pl","pr","pt","pb","margin","mx","my","ml","mr","mt","mb","zIndex","position","top","right","bottom","left","border","borderTop","borderRight","borderBottom","borderLeft","borderColor","borderRadius","scroll","visibility","display","height","width","maxHeight","maxWidth","minHeight","minWidth","shadow","bgColor","bgGradient","gap","flexDirection","flexGrow","justify","justifySelf","alignItems","alignSelf","wrap","color","fontFamily","fontSize","fontWeight","textAlign","whiteSpace","letterSpacing","lineSpacing","textDecoration","textOverflow","whiteSpace","wordBreak","wordWrap","cursor","transition","borderColorHover","bgColorHover","shadowHover"],ki={25:"#fcfcfd",50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#2f394b",800:"#212a36",900:"#161b25"},Ci={25:"#fef2f3",50:"#fddfe2",100:"#fbbac0",200:"#f9959e",300:"#f65e6a",400:"#f32637",500:"#bf0b1a",600:"#ac0a17",700:"#9a0915",800:"#870812",900:"#750710"},Si={25:"",50:"",100:"#ffe6ff",200:"",300:"#b8075d",400:"",500:"#7f0540",600:"",700:"#59042d",800:"",900:"#460323"},zi={25:"",50:"#fef3f2",100:"",200:"#fecdca",300:"",400:"",500:"#f04438",600:"",700:"#b42318",800:"",900:""},Ii={25:"",50:"#fffaeb",100:"",200:"#fef0c7",300:"",400:"#ffd562",500:"#fdb022",600:"#dc6803",700:"#b54708",800:"",900:""},Ti={25:"",50:"#f6fef9",100:"",200:"#a6f4c5",300:"",400:"",500:"#12b76a",600:"",700:"#027a48",800:"",900:""},Fi={25:"",50:"#eff8ff",100:"",200:"#b2ddff",300:"",400:"",500:"#2e90fa",600:"",700:"#175cd3",800:"",900:""},Ni={"01":"linear-gradient(45deg, #f32637 0%, #b8075d 100%)","02":"linear-gradient(45deg, #fcfcfd 0%, #667085 100%)"},Ei={type:{primary:"Roboto, sans-serif",poppins:"'Poppins', sans-serif",mono:"'Space Mono', monospace"},heading:{xxl:"64px",xl:"48px",lg:"32px",md:"24px",sm:"20px",xs:"16px"},text:{xl:"20px",lg:"18px",md:"16px",sm:"14px",xs:"12px"},weight:{bold:"700",semibold:"600",regular:"400"}},Ri={none:"none",sm:"0px 1px 2px 0px rgba(16, 24, 40, 0.15)",md:"0px 4px 6px 0px rgba(16, 24, 40, 0.15)",lg:"0px 8px 24px 0px rgba(16, 24, 40, 0.15)"},Di={mobile:"480px",tablet:"960px",sm:"1024px",md:"1440px",lg:"1920px"},Li={0:"0rem",.125:"0.125rem",.188:"0.188rem",.25:"0.25rem",.5:"0.5rem",.625:"0.625rem",.75:"0.75rem",1:"1rem",1.25:"1.25rem",1.5:"1.5rem",1.75:"1.75rem",2:"2rem",2.25:"2.25rem",2.5:"2.5rem",3:"3rem",3.5:"3.5rem",4:"4rem",4.5:"4.5rem",5:"5rem",6:"6rem"},Pi=["lock-keyhole","bars-sort","bolt","books","brain-circuit","briefcase","bug","buildings","bullseye-pointer","calendar-clock","calendar-xmark","chart-network","clipboard-check","comment","envelope","eye","file","flag","globe","hand-holding-dollar","hands-clapping","headset","hexagon-exclamation","light-emergency-on","magnifying-glass","pen-line","plane-departure","screwdriver-wrench","sensor-triangle-exclamation","shield-check","sidebar","skull","sliders","star-christmas","telescope","trash","unlock","user-group","user-hoodie","xmark"],Wi=[["fal","arrow-down"],["fal","arrow-left"],["fal","arrow-right"],["fal","arrow-up"],["fal","plus"],["fal","minus"],["fas","check"],["fas","circle-question"]],S={typography:Ei,shadows:Ri,breakpoints:Di,spacing:Li,palette:{primary:Ci,complementary:Si,error:zi,info:Fi,warning:Ii,success:Ti,black:"#0c111d",white:"#ffffff",gray:ki,gradients:Ni}},Ai=({children:e})=>t.jsx(s.ot,{theme:S,children:e}),
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),u=require("react"),s=require("./vendor-Fd8GJpo1.js"),U=require("react-dom"),Le=require("react-router-dom"),Y=e=>({getVariant:(i,n)=>e(i)[n]}),ft=["padding","px","py","pl","pr","pt","pb","margin","mx","my","ml","mr","mt","mb","zIndex","position","top","right","bottom","left","border","borderTop","borderRight","borderBottom","borderLeft","borderColor","borderRadius","scroll","visibility","display","height","width","maxHeight","maxWidth","minHeight","minWidth","shadow","bgColor","bgGradient","gap","flexDirection","flexGrow","justify","justifySelf","alignItems","alignSelf","wrap","color","fontFamily","fontSize","fontWeight","textAlign","whiteSpace","letterSpacing","lineSpacing","textDecoration","textOverflow","whiteSpace","wordBreak","wordWrap","cursor","transition","borderColorHover","bgColorHover","shadowHover"],ki={25:"#fcfcfd",50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#2f394b",800:"#212a36",900:"#161b25"},Ci={25:"#fef2f3",50:"#fddfe2",100:"#fbbac0",200:"#f9959e",300:"#f65e6a",400:"#f32637",500:"#bf0b1a",600:"#ac0a17",700:"#9a0915",800:"#870812",900:"#750710"},Si={25:"",50:"",100:"#ffe6ff",200:"",300:"#b8075d",400:"",500:"#7f0540",600:"",700:"#59042d",800:"",900:"#460323"},zi={25:"",50:"#fef3f2",100:"",200:"#fecdca",300:"",400:"",500:"#f04438",600:"",700:"#b42318",800:"",900:""},Ii={25:"",50:"#fffaeb",100:"",200:"#fef0c7",300:"",400:"#ffd562",500:"#fdb022",600:"#dc6803",700:"#b54708",800:"",900:""},Ti={25:"",50:"#f6fef9",100:"",200:"#a6f4c5",300:"",400:"",500:"#12b76a",600:"",700:"#027a48",800:"",900:""},Fi={25:"",50:"#eff8ff",100:"",200:"#b2ddff",300:"",400:"",500:"#2e90fa",600:"",700:"#175cd3",800:"",900:""},Ni={"01":"linear-gradient(45deg, #f32637 0%, #b8075d 100%)","02":"linear-gradient(45deg, #fcfcfd 0%, #667085 100%)"},Ei={type:{primary:"Roboto, sans-serif",poppins:"'Poppins', sans-serif",mono:"'Space Mono', monospace"},heading:{xxl:"64px",xl:"48px",lg:"32px",md:"24px",sm:"20px",xs:"16px"},text:{xl:"20px",lg:"18px",md:"16px",sm:"14px",xs:"12px"},weight:{bold:"700",semibold:"600",regular:"400"}},Ri={none:"none",sm:"0px 1px 2px 0px rgba(16, 24, 40, 0.15)",md:"0px 4px 6px 0px rgba(16, 24, 40, 0.15)",lg:"0px 8px 24px 0px rgba(16, 24, 40, 0.15)"},Di={mobile:"480px",tablet:"960px",sm:"1024px",md:"1440px",lg:"1920px"},Li={0:"0rem",.125:"0.125rem",.188:"0.188rem",.25:"0.25rem",.5:"0.5rem",.625:"0.625rem",.75:"0.75rem",1:"1rem",1.25:"1.25rem",1.5:"1.5rem",1.75:"1.75rem",2:"2rem",2.25:"2.25rem",2.5:"2.5rem",3:"3rem",3.5:"3.5rem",4:"4rem",4.5:"4.5rem",5:"5rem",6:"6rem"},Pi=["lock-keyhole","bars-sort","bolt","books","brain-circuit","briefcase","bug","buildings","bullseye-pointer","calendar-clock","calendar-xmark","chart-network","clipboard-check","comment","envelope","eye","file","flag","globe","hand-holding-dollar","hands-clapping","headset","hexagon-exclamation","light-emergency-on","magnifying-glass","pen-line","plane-departure","screwdriver-wrench","sensor-triangle-exclamation","shield-check","sidebar","skull","sliders","star-christmas","telescope","trash","unlock","user-group","user-hoodie","xmark"],Wi=[["fal","arrow-down"],["fal","arrow-left"],["fal","arrow-right"],["fal","arrow-up"],["fal","plus"],["fal","minus"],["fas","check"],["fas","circle-question"]],S={typography:Ei,shadows:Ri,breakpoints:Di,spacing:Li,palette:{primary:Ci,complementary:Si,error:zi,info:Fi,warning:Ii,success:Ti,black:"#0c111d",white:"#ffffff",gray:ki,gradients:Ni}},Ai=({children:e})=>t.jsx(s.ot,{theme:S,children:e}),F=(e,i)=>i===void 0?"":`${e}: ${i};`,le=e=>{const i=e.py??e.pt??0,n=e.px??e.pr??0,a=e.py??e.pb??0,r=e.px??e.pl??0;if(e.padding){const[o,l,c,d]=e.padding;return`padding: ${S.spacing[o]} ${S.spacing[l]} ${S.spacing[c]} ${S.spacing[d]};`}return`padding: ${S.spacing[i]} ${S.spacing[n]} ${S.spacing[a]} ${S.spacing[r]};`},ce=e=>{const i=e.my??e.mt??0,n=e.mx??e.mr??0,a=e.my??e.mb??0,r=e.mx??e.ml??0;if(e.margin){const[o,l,c,d]=e.margin;return`margin: ${S.spacing[o]} ${S.spacing[l]} ${S.spacing[c]} ${S.spacing[d]};`}return`margin: ${S.spacing[i]} ${S.spacing[n]} ${S.spacing[a]} ${S.spacing[r]};`},de=e=>{const i=F("position",e.position),n=F("top",e.top),a=F("right",e.right),r=F("bottom",e.bottom),o=F("left",e.left),l=F("z-index",e.zIndex);return`
|
|
2
2
|
${i}
|
|
3
3
|
${n}
|
|
4
4
|
${a}
|
|
5
5
|
${r}
|
|
6
6
|
${o}
|
|
7
7
|
${l}
|
|
8
|
-
`},pe=e=>{const i=
|
|
8
|
+
`},pe=e=>{const i=F("border",e.border),n=F("border-top",e.borderTop),a=F("border-right",e.borderRight),r=F("border-bottom",e.borderBottom),o=F("border-left",e.borderLeft),l=F("border-color",e.borderColor),c=F("border-radius",e.borderRadius);return`
|
|
9
9
|
${i}
|
|
10
10
|
${n}
|
|
11
11
|
${a}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
`},Bi=e=>e.includes("x")?"overflow-x: auto;":"",_i=e=>e.includes("y")?"overflow-y: auto;":"",ge=e=>{const i=e.scroll?`
|
|
17
17
|
${Bi(e.scroll)}
|
|
18
18
|
${_i(e.scroll)}
|
|
19
|
-
`:"",n=
|
|
19
|
+
`:"",n=F("visibility",e.visibility),a=F("display",e.display),r=F("height",e.height),o=F("width",e.width),l=F("max-height",e.maxHeight),c=F("max-width",e.maxWidth),d=F("min-height",e.minHeight),p=F("min-width",e.minWidth),g=F("box-shadow",e.shadow?S.shadows[e.shadow]:void 0),x=F("gap",e.gap===void 0?void 0:S.spacing[e.gap]),f=F("background-color",e.bgColor),h=F("background",e.bgGradient),y=F("flex-direction",e.flexDirection),b=F("flex-grow",e.flexGrow),m=F("justify-content",e.justify),w=F("justify-self",e.justifySelf),j=F("align-items",e.alignItems),I=F("align-self",e.alignSelf),z=F("flex-wrap",e.wrap);return`
|
|
20
20
|
${i}
|
|
21
21
|
${n}
|
|
22
22
|
${a}
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
${j}
|
|
38
38
|
${I}
|
|
39
39
|
${z}
|
|
40
|
-
`},ue=e=>{const i=
|
|
40
|
+
`},ue=e=>{const i=F("color",e.color),n=F("font-family",e.fontFamily),a=F("font-size",e.fontSize),r=F("font-weight",e.fontWeight),o=F("line-spacing",e.letterSpacing),l=F("line-height",e.lineSpacing),c=F("text-align",e.textAlign),d=F("text-decoration",e.textDecoration),p=F("text-overflow",e.textOverflow),g=F("white-space",e.whiteSpace),x=F("word-break",e.wordBreak),f=F("word-wrap",e.wordWrap);return`
|
|
41
41
|
${i}
|
|
42
42
|
${n}
|
|
43
43
|
${a}
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
${g}
|
|
51
51
|
${x}
|
|
52
52
|
${f}
|
|
53
|
-
`},xe=e=>{const i=
|
|
53
|
+
`},xe=e=>{const i=F("cursor",e.cursor),n=F("border-color",e.borderColorHover),a=F("background-color",e.bgColorHover),r=F("box-shadow",e.shadowHover===void 0?void 0:S.shadows[e.shadowHover]),o=F("transition",e.transition);return`
|
|
54
54
|
${i}
|
|
55
55
|
|
|
56
56
|
&:hover {
|
|
@@ -414,7 +414,7 @@
|
|
|
414
414
|
width: max-content;
|
|
415
415
|
z-index: 999999;
|
|
416
416
|
`}
|
|
417
|
-
`,V=({children:e,disabled:i=!1,display:n="inline-block",height:a,icon:r,iconColor:o,iconSize:l,id:c,maxWidth:d,nodeTip:p,place:g="bottom",tip:x="",title:f="",hide:h=x===""&&f===""&&p===void 0,width:y})=>{const b=s.nt(),[m,w]=u.useState(!1),{refs:j,floatingStyles:I,context:z}=s.useFloating({middleware:[s.flip({fallbackAxisSideDirection:"start"}),s.offset({mainAxis:10}),s.shift()],onOpenChange:w,open:m,placement:g,whileElementsMounted:s.autoUpdate}),v=s.useHover(z,{delay:{close:0,open:500},move:!1}),N=s.useFocus(z),
|
|
417
|
+
`,V=({children:e,disabled:i=!1,display:n="inline-block",height:a,icon:r,iconColor:o,iconSize:l,id:c,maxWidth:d,nodeTip:p,place:g="bottom",tip:x="",title:f="",hide:h=x===""&&f===""&&p===void 0,width:y})=>{const b=s.nt(),[m,w]=u.useState(!1),{refs:j,floatingStyles:I,context:z}=s.useFloating({middleware:[s.flip({fallbackAxisSideDirection:"start"}),s.offset({mainAxis:10}),s.shift()],onOpenChange:w,open:m,placement:g,whileElementsMounted:s.autoUpdate}),v=s.useHover(z,{delay:{close:0,open:500},move:!1}),N=s.useFocus(z),T=s.useRole(z,{role:r?"label":"tooltip"}),{getReferenceProps:P,getFloatingProps:W}=s.useInteractions([v,N,T]);return i?t.jsx(u.StrictMode,{children:e}):t.jsxs(t.Fragment,{children:[t.jsx(Qi,{...P(),display:n,height:a,id:c,ref:j.setReference,width:y,children:r?t.jsx(C,{clickable:!0,disabled:i,icon:r,iconColor:o,iconSize:l??"xxs",iconType:m?"fa-solid":"fa-light"}):e}),m&&!h&&U.createPortal(t.jsxs(en,{...W(),$maxWidth:d,id:`floating-${c}`,ref:j.setFloating,style:I,children:[s.lodashExports.isEmpty(f)?void 0:t.jsx(k,{color:b.palette.white,fontWeight:"bold",lineSpacing:1.5,size:"sm",textAlign:"start",wordWrap:"break-word",children:f}),s.lodashExports.isEmpty(x)?void 0:t.jsx(k,{color:b.palette.gray[100],lineSpacing:1.5,size:"sm",textAlign:"start",wordWrap:"break-word",children:x}),s.lodashExports.isEmpty(p)?void 0:p]}),document.getElementById("root")??document.body)]})},B=u.forwardRef(function({borderRadius:i,disabled:n,icon:a,iconColor:r,iconSize:o="xxs",iconTransform:l,iconType:c,id:d,justify:p="center",onClick:g,px:x,py:f,type:h="button",tooltip:y,tooltipPlace:b,value:m,variant:w="primary",...j},I){const z=t.jsx(Ji,{$borderRadius:i,$px:x,$py:f,$variant:w,"aria-disabled":n,"aria-label":d,borderRadius:i,disabled:n,id:d,justify:p,onClick:g,ref:I,type:h,value:m,...j,children:t.jsx(C,{clickable:!1,icon:a,iconColor:r,iconSize:o,iconTransform:l,iconType:c})}),N=(h+(w??"")+(d??a)).replace(/ /u,"_");return y===void 0?z:t.jsx(V,{id:`${N}-tooltip`,place:b,tip:y,children:z})}),tn=u.forwardRef(function({autoHide:i=!1,children:n,closable:a=!1,onTimeOut:r,show:o=!0,time:l=8,variant:c="error",id:d,...p},g){const[x,f]=u.useState(o),h=u.useCallback(()=>{f(!1)},[]);return u.useEffect(()=>{const y=setTimeout(()=>{r==null||r(!0),i&&h()},l*1e3);return()=>{clearTimeout(y)}},[i,h,l,r]),u.useEffect(()=>{f(o)},[o,f]),t.jsx($,{display:x?"block":"none",ref:g,role:"alert",...p,children:t.jsxs(qi,{$variant:c,id:d,children:[t.jsx(C,{clickable:!1,icon:Yi(c),iconSize:"xs",iconType:"fa-light"}),t.jsx(Xi,{children:n}),a?t.jsx(B,{height:"fit-content",icon:"close",iconSize:"xs",iconType:"fa-light",onClick:h,px:.125,py:.125,variant:"ghost"}):void 0]})})}),at=s.dt.div`
|
|
418
418
|
${({theme:e})=>`
|
|
419
419
|
align-items: center;
|
|
420
420
|
background-color: ${e.palette.gray[200]};
|
|
@@ -632,7 +632,7 @@
|
|
|
632
632
|
${yt}
|
|
633
633
|
`,ln=s.dt(Le.Link)`
|
|
634
634
|
${yt}
|
|
635
|
-
`,X=({children:e,color:i,download:n,href:a,iconPosition:r="right",onClick:o,target:l,variant:c="lowRelevance"})=>{const d=a.startsWith("https://"),p=t.jsx(C,{icon:n===void 0?"arrow-up-right-from-square":"arrow-down-to-bracket",iconSize:"xxs",iconType:"fa-regular",ml:.25,mr:.25});return d?t.jsxs(sn,{$color:i,$variant:c,download:n,href:a,onClick:o,rel:"nofollow noopener noreferrer",target:l??"_blank",children:[r==="left"?p:void 0,e,r==="right"?p:void 0]}):t.jsxs(ln,{$variant:c,download:n,onClick:o,rel:"nofollow noopener noreferrer",target:l,to:a,children:[l!==void 0&&r==="left"?p:void 0,e,l!==void 0&&r==="right"?p:void 0]})},K=({disabled:e,icon:i,iconColor:n="inherit",iconType:a="fa-light",id:r="close-tag",filterValues:o="",fontSize:l,href:c,linkLabel:d,onClose:p,priority:g="default",tagTitle:x="",tagLabel:f,variant:h="default"})=>{const y=f.length>25&&s.lodashExports.isEmpty(x+o),b=`${f.slice(0,25)}...`;return t.jsxs(re,{className:"gap-0.5",display:c===void 0?"initial":"flex",size:"sm",children:[t.jsxs(rn,{$fontSize:l,$variant:h,className:g,children:[i&&t.jsx(C,{icon:i,iconColor:n,iconSize:"xxs",iconType:a}),t.jsxs("span",{children:[t.jsx("strong",{children:x}),t.jsx("span",{children:y?b:f}),t.jsx("strong",{children:o})]}),p?t.jsx(B,{disabled:e,icon:"xmark",iconSize:"xxs",iconType:"fa-light",id:r,onClick:p,px:.125,py:.125,variant:"ghost"}):void 0]}),c===void 0?void 0:t.jsx(X,{href:c,children:d})]})},cn=(e,i=!0)=>{const n=window.open(e,i?void 0:"_self","noopener,noreferrer,");s.lodashExports.isObject(n)&&(n.opener=null)},R=u.forwardRef(function({children:i,disabled:n=!1,external:a=!1,fontSize:r,href:o,id:l,icon:c,name:d,onClick:p,showArrow:g=!1,tag:x,type:f="button",tooltip:h,tooltipPlace:y="bottom",underline:b=!1,value:m,variant:w="primary",...j},I){const z=h!==void 0,v=`${l}-tooltip`,N=u.useCallback(()=>{o&&cn(o,a)},[a,o])
|
|
635
|
+
`,X=({children:e,color:i,download:n,href:a,iconPosition:r="right",onClick:o,target:l,variant:c="lowRelevance"})=>{const d=a.startsWith("https://"),p=t.jsx(C,{icon:n===void 0?"arrow-up-right-from-square":"arrow-down-to-bracket",iconSize:"xxs",iconType:"fa-regular",ml:.25,mr:.25});return d?t.jsxs(sn,{$color:i,$variant:c,download:n,href:a,onClick:o,rel:"nofollow noopener noreferrer",target:l??"_blank",children:[r==="left"?p:void 0,e,r==="right"?p:void 0]}):t.jsxs(ln,{$variant:c,download:n,onClick:o,rel:"nofollow noopener noreferrer",target:l,to:a,children:[l!==void 0&&r==="left"?p:void 0,e,l!==void 0&&r==="right"?p:void 0]})},K=({disabled:e,icon:i,iconColor:n="inherit",iconType:a="fa-light",id:r="close-tag",filterValues:o="",fontSize:l,href:c,linkLabel:d,onClose:p,priority:g="default",tagTitle:x="",tagLabel:f,variant:h="default"})=>{const y=f.length>25&&s.lodashExports.isEmpty(x+o),b=`${f.slice(0,25)}...`;return t.jsxs(re,{className:"gap-0.5",display:c===void 0?"initial":"flex",size:"sm",children:[t.jsxs(rn,{$fontSize:l,$variant:h,className:g,children:[i&&t.jsx(C,{icon:i,iconColor:n,iconSize:"xxs",iconType:a}),t.jsxs("span",{children:[t.jsx("strong",{children:x}),t.jsx("span",{children:y?b:f}),t.jsx("strong",{children:o})]}),p?t.jsx(B,{disabled:e,icon:"xmark",iconSize:"xxs",iconType:"fa-light",id:r,onClick:p,px:.125,py:.125,variant:"ghost"}):void 0]}),c===void 0?void 0:t.jsx(X,{href:c,children:d})]})},cn=(e,i=!0)=>{const n=window.open(e,i?void 0:"_self","noopener,noreferrer,");s.lodashExports.isObject(n)&&(n.opener=null)},R=u.forwardRef(function({children:i,disabled:n=!1,external:a=!1,fontSize:r,href:o,id:l,icon:c,name:d,onClick:p,showArrow:g=!1,tag:x,type:f="button",tooltip:h,tooltipPlace:y="bottom",underline:b=!1,value:m,variant:w="primary",...j},I){const z=h!==void 0,v=`${l}-tooltip`,N=u.useCallback(()=>{o&&cn(o,a)},[a,o]),T=t.jsxs($t,{$size:r,$variant:w,"aria-disabled":n,className:b?"underline":void 0,disabled:n,id:l,name:d,onClick:w==="link"?N:p,ref:I,type:f,value:m,...z?{"data-tooltip-id":v}:{},...j,children:[c!==void 0&&t.jsx(C,{icon:c,iconSize:"xs",iconType:"fa-light"}),i,(g||w==="link")&&t.jsx(C,{icon:"arrow-right",iconSize:"xs",iconType:"fa-light"}),x===void 0?null:t.jsx(K,{tagLabel:x,variant:"inactive"})]});return z?t.jsx(V,{disabled:!z,id:v,place:y,tip:h,children:T}):T}),dn=u.forwardRef(function({children:i,onClick:n,userName:a,showIcon:r=!1,showUsername:o=!1},l){const c=!!n;return t.jsx($,{id:"navbar-user-profile",ref:l,zIndex:9999,children:t.jsxs($,{alignItems:"end",display:"flex",flexDirection:"column",position:"relative",zIndex:30,children:[c?t.jsxs(R,{onClick:n,pb:.5,pl:.5,pr:.5,pt:.5,variant:"ghost",children:[t.jsx(at,{children:a[0].toUpperCase()}),o?t.jsx(k,{color:"#1d2939",display:"inline",ml:.5,size:"sm",children:a.split(" ")[0]}):void 0,r?t.jsx(C,{clickable:!1,icon:"ellipsis-v",iconSize:"xxss",ml:.5}):void 0]}):t.jsxs($,{alignItems:"center",display:"flex",px:.5,py:.5,children:[t.jsx(at,{children:a[0].toUpperCase()}),o?t.jsxs(k,{color:"#1d2939",display:"inline",ml:.5,size:"sm",children:["Hi ",a.split(" ")[0],"!"]}):void 0,r?t.jsx(C,{clickable:!1,icon:"ellipsis-v",iconSize:"xxss",ml:.5}):void 0]}),t.jsx(nn,{children:i})]})})}),ze=({authorEmail:e,date:i,description:n,descriptionColor:a,id:r,title:o,titleColor:l,textAlign:c,textSpacing:d=0,tooltip:p})=>{const g=s.nt();return t.jsxs($,{width:"100%",children:[typeof o=="string"?t.jsx(k,{color:l??g.palette.gray[800],fontWeight:"bold",mb:d,size:"sm",textAlign:c,wordBreak:"break-word",children:o}):o,t.jsxs($,{alignItems:"start",display:"flex",flexDirection:"column",gap:.25,children:[n&&t.jsx(k,{color:a??g.palette.gray[800],fontWeight:n===void 0?"bold":"regular",size:"sm",textAlign:c,wordBreak:"break-word",children:n}),i&&t.jsx(k,{color:g.palette.gray[800],fontWeight:"bold",size:"sm",textAlign:c,wordBreak:"break-word",children:`Date: ${i.split(" ")[0]}`}),e&&t.jsx(k,{color:g.palette.gray[800],fontWeight:"bold",size:"sm",textAlign:c,wordBreak:"break-word",children:`Author: ${e}`}),p&&t.jsx(V,{icon:"circle-info",id:r,tip:p})]})]})},rt=s.dt($).attrs(({...e})=>({display:"inline-block",position:"relative",...e}))`
|
|
636
636
|
& img {
|
|
637
637
|
display: block;
|
|
638
638
|
}
|
|
@@ -855,7 +855,7 @@
|
|
|
855
855
|
}
|
|
856
856
|
}
|
|
857
857
|
`}
|
|
858
|
-
`,wt=({item:e,state:i})=>{const n=s.nt(),a=u.useRef(null),{optionProps:r,isSelected:o,isFocused:l,isDisabled:c}=s.$293f70390ea03370$export$497855f14858aa34({key:e.key},i,a),d=[o?"selected":"",l?"focused":"",c?"disabled":""].join(" ");return t.jsxs(bn,{...r,className:d,ref:a,children:[t.jsx(k,{color:n.palette.gray[800],size:"sm",textOverflow:"ellipsis",whiteSpace:"nowrap",children:e.rendered}),o?t.jsx(C,{icon:"check",iconSize:"xxs",iconType:"fa-light"}):void 0]})},Pe=({field:e,disabled:i=!1,error:n,helpLink:a,helpLinkText:r,helpText:o,label:l,loadingItems:c,name:d,items:p,onBlur:g,onChange:x,placeholder:f,required:h,tooltip:y,value:b,weight:m})=>{var nt;const w=s.nt(),j=i?void 0:n,I=(e==null?void 0:e.value)??b,[z,v]=u.useState(((nt=p.find(L=>L.value===I))==null?void 0:nt.name)??""),[N,
|
|
858
|
+
`,wt=({item:e,state:i})=>{const n=s.nt(),a=u.useRef(null),{optionProps:r,isSelected:o,isFocused:l,isDisabled:c}=s.$293f70390ea03370$export$497855f14858aa34({key:e.key},i,a),d=[o?"selected":"",l?"focused":"",c?"disabled":""].join(" ");return t.jsxs(bn,{...r,className:d,ref:a,children:[t.jsx(k,{color:n.palette.gray[800],size:"sm",textOverflow:"ellipsis",whiteSpace:"nowrap",children:e.rendered}),o?t.jsx(C,{icon:"check",iconSize:"xxs",iconType:"fa-light"}):void 0]})},Pe=({field:e,disabled:i=!1,error:n,helpLink:a,helpLinkText:r,helpText:o,label:l,loadingItems:c,name:d,items:p,onBlur:g,onChange:x,placeholder:f,required:h,tooltip:y,value:b,weight:m})=>{var nt;const w=s.nt(),j=i?void 0:n,I=(e==null?void 0:e.value)??b,[z,v]=u.useState(((nt=p.find(L=>L.value===I))==null?void 0:nt.name)??""),[N,T]=u.useState(I),[P,W]=u.useState(p),[D,E]=u.useState(!1),{contains:_}=s.$bb77f239b46e8c72$export$3274cf84b703fff({sensitivity:"base"}),M=u.useRef(null),te=u.useRef(null),Re=u.useRef(null),et=u.useRef(null),tt=u.useRef(null),fi=u.useMemo(()=>p.map(L=>_(L.name,z)||D?t.jsx(s.$c1d7fb2ec91bae71$export$6d08773d2e66f8f2,{children:L.name},L.value):null),[_,z,p,D]),hi=u.useCallback(L=>{v(L),L===""?E(!0):(E(!1),T(H=>{const me=L===""?"":H;return e&&e.onChange(me),x&&x(L),me}),W(p.filter(H=>_(H.name,L))))},[_,p,e,x]),bi=u.useCallback(L=>{var H;v(((H=p.find(me=>me.value===L))==null?void 0:H.name)??""),T(L?String(L):""),e&&e.onChange(L),x&&x(L?String(L):""),W(p)},[p,e,x]),it=u.useCallback(L=>{L.key==="Enter"&&L.preventDefault(),E(!1)},[]),$i=u.useCallback(()=>{g&&g(),e&&e.onBlur()},[e,g]),q=s.$a9e7382a7d111cb5$export$b453a3bfd4a5fa9e({allowsEmptyCollection:!0,inputValue:z,items:P,menuTrigger:"focus",shouldCloseOnBlur:!0,selectedKey:N,onBlur:$i,onInputChange:hi,onKeyDown:it,onKeyUp:()=>{E(!0)},onOpenChange(L,H){E(L&&(H==="manual"||H==="focus"))},onSelectionChange:bi,children:fi}),{buttonProps:yi,inputProps:mi,listBoxProps:wi}=s.$c350ade66beef0af$export$8c18d1b4f7232bbf({inputValue:z,buttonRef:te,id:d,inputRef:M,label:l??d,listBoxRef:Re,name:d,placeholder:f,popoverRef:tt},q),{listBoxProps:ji}=s.$c132121280ec012d$export$50eacbbf140a3141(wi,q,Re),{buttonProps:vi}=s.$701a24aa0da5b062$export$ea18c227d4417cc3(yi,te);return u.useEffect(()=>{var L;(c===!1||!I)&&v(((L=p.find(H=>H.value===I))==null?void 0:L.name)??"")},[I,p,c]),t.jsxs(O,{error:j,helpLink:a,helpLinkText:r,helpText:o,htmlFor:d,label:l,required:h,tooltip:y,weight:m,children:[t.jsxs(Z,{className:`${i?"disabled":""} ${j?"error":""}`,ref:et,children:[t.jsx("input",{...mi,"aria-invalid":j?"true":"false","aria-label":d,onKeyDown:it,ref:M}),j?t.jsx(C,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:w.palette.error[500],iconSize:"xs"}):void 0,t.jsx(B,{...vi,className:"action",icon:q.isOpen?"chevron-up":"chevron-down",iconColor:w.palette.gray[400],iconSize:"xxs",iconType:"fa-light",px:.125,py:.125,ref:te,type:"button",variant:"ghost"})]}),q.isOpen&&q.collection.size>0&&!i?t.jsx(he,{className:"dropdown",offset:4,placement:"bottom start",popoverRef:tt,state:q,triggerRef:et,children:t.jsx(hn,{...ji,ref:Re,children:[...q.collection].map(L=>t.jsx(wt,{item:L,state:q},L.key))})}):null]})},jt=({control:e,disabled:i=!1,error:n,helpLink:a,helpLinkText:r,helpText:o,label:l,loadingItems:c,name:d,items:p,onBlur:g,onChange:x,placeholder:f,required:h,tooltip:y,value:b,weight:m})=>e?t.jsx(s.Controller,{control:e,name:d,render:({field:w})=>t.jsx(Pe,{disabled:i,error:n,field:w,helpLink:a,helpLinkText:r,helpText:o,items:p,label:l,loadingItems:c,name:d,onBlur:g,onChange:x,placeholder:f,required:h,tooltip:y,value:b,weight:m}),rules:{required:h}}):t.jsx(Pe,{disabled:i,error:n,helpLink:a,helpLinkText:r,helpText:o,items:p,label:l,loadingItems:c,name:d,onBlur:g,onChange:x,placeholder:f,required:h,tooltip:y,value:b,weight:m}),$n=s.dt.div`
|
|
859
859
|
${({theme:e})=>`
|
|
860
860
|
align-items: center;
|
|
861
861
|
color: ${e.palette.gray[800]};
|
|
@@ -1087,7 +1087,7 @@
|
|
|
1087
1087
|
font-weight: ${e.typography.weight.bold};
|
|
1088
1088
|
}
|
|
1089
1089
|
`}
|
|
1090
|
-
`,ve=({disabled:e=!1,icon:i,props:n})=>{const a=u.useRef(null),{buttonProps:r}=s.$701a24aa0da5b062$export$ea18c227d4417cc3(n,a);return t.jsx(Cn,{...r,$disabled:e,$focus:!!r["aria-expanded"],$header:i==="calendar"||i==="calendar-clock",disabled:e,ref:a,type:"button",children:t.jsx(C,{icon:i,iconColor:S.palette.gray[e?400:700],iconSize:"xs",iconType:"fa-light"})})},Te=({state:e,prevButtonProps:i,nextButtonProps:n,title:a})=>{const r=e.focusedDate,o=u.useCallback(()=>{e.setFocusedDate(r.add({years:1}))},[r,e]),l=u.useCallback(()=>{e.setFocusedDate(r.subtract({years:1}))},[r,e]);return t.jsxs("div",{className:"header flex items-start",children:[t.jsx(ve,{icon:"chevron-left",props:i}),t.jsxs($n,{children:[a,t.jsxs(yn,{children:[t.jsx(st,{"aria-label":"top",onClick:o,children:t.jsx(C,{icon:"caret-up",iconClass:"fa-sharp",iconSize:"xxss"})}),t.jsx(st,{"aria-label":"bottom",onClick:l,children:t.jsx(C,{icon:"caret-down",iconClass:"fa-sharp",iconSize:"xxss"})})]})]}),t.jsx(ve,{icon:"chevron-right",props:n})]})},Ct=({onClose:e,props:i})=>{const{locale:n}=s.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),a=s.$131cf43a05231e1e$export$6d095e787d2b5e1f({...i,createCalendar:s.$64244302c3013299$export$dd0bbc9b26defe37,locale:n}),{prevButtonProps:r,nextButtonProps:o,title:l}=s.$9942cad8a072a530$export$3ee915f8151bd4f1(i,a);return t.jsxs("div",{className:"calendar",children:[t.jsx(Te,{nextButtonProps:o,prevButtonProps:r,state:a,title:l}),t.jsx(Ie,{state:a}),t.jsx(qe,{children:t.jsx(R,{onClick:e,variant:"ghost",children:"Cancel"})})]})},St=({segment:e,state:i})=>{const n=s.nt(),a=u.useRef(null),o={...e,placeholder:{day:"dd",dayPeriod:"(AM/PM)",era:"",hour:"hh",literal:"",minute:"mm",month:"mm",second:"",timeZoneName:"",year:"yyyy"}[e.type]},{segmentProps:l}=s.$32489daedd52963e$export$1315d136e6f7581(o,i,a),c=n.palette.gray[o.isEditable?800:500];return t.jsx("div",{...o.type!=="literal"&&{...l,className:"segment-cell"},ref:a,style:o.type==="literal"?void 0:{color:o.isPlaceholder?n.palette.gray[400]:c},children:o.isPlaceholder?o.placeholder:o.text})},zt=({disabled:e,error:i=!1,props:n})=>{const a=s.nt(),r=u.useRef(null),o=s.$3c0fc76039f1c516$export$60e84778edff6d26({...n,createCalendar:s.$64244302c3013299$export$dd0bbc9b26defe37,locale:"en-US"}),{fieldProps:l}=s.$16f0b7bb276bc17e$export$5591b0b878c1a989(n,o,r),c=u.useCallback(d=>{const p=document.getElementsByClassName("segment-cell"),g=d.currentTarget;Object.values(p).some(x=>x.contains(g))||(d.preventDefault(),d.stopPropagation())},[]);return t.jsxs(Sn,{...l,onClick:c,children:[t.jsx("div",{className:"flex flex-row",style:{color:a.palette.gray[s.lodashExports.isNil(o.value)?400:800]},tabIndex:-1,children:o.segments.map((d,p)=>{const g=`key_${p}`;return t.jsx(St,{segment:{...d,isEditable:!e},state:o},g)})}),i?t.jsx(C,{icon:"exclamation-circle",iconColor:a.palette.error[500],iconSize:"xs"}):void 0]})},It=e=>{const i=u.useRef(null),n=s.$eff5d8ee529ac4bb$export$fd53cef0cc796101({...e,locale:"en-US",shouldForceLeadingZeros:!0}),{timeValue:a}=n,r=!s.lodashExports.isNil(a)&&a.hour<12?"AM":"PM",[o,l]=u.useState(s.lodashExports.isNil(a)?"AM":r),{fieldProps:c}=s.$16f0b7bb276bc17e$export$4c842f6a241dc825(e,n,i),d=u.useCallback(p=>{const g=p.currentTarget.name;g!==o&&(s.lodashExports.isNil(a)||(g==="AM"?n.setSegment("dayPeriod",0):g==="PM"&&n.setSegment("dayPeriod",12))),l(g)},[o,n,a]);return t.jsxs(zn,{children:[t.jsx(lt,{...c,ref:i,children:n.segments.slice(0,-2).map((p,g)=>{const x=`key_${g}`;return t.jsx(St,{segment:p,state:n},x)})}),t.jsxs(lt,{children:[t.jsx(ct,{id:o==="AM"?"active":"",name:"AM",onClick:d,type:"button",children:"AM"}),t.jsx(ct,{id:o==="PM"?"active":"",name:"PM",onClick:d,type:"button",children:"PM"})]})]})},ke=e=>e&&e!=="-"?s.dayjs(e).format("YYYY-MM-DD"):"-",In=e=>e&&e!=="-"?s.dayjs(e).format("YYYY-MM-DD hh:mm A"):"-",Tn=e=>e&&e!=="-"?s.dayjs(e).format("YYYY/MM/DD hh:mm A"):"-",oe=({error:e,buttonProps:i,datePickerRef:n,disabled:a=!1,granularity:r="day",fieldProps:o,groupProps:l,name:c,register:d,required:p,setValue:g,value:x})=>{const f=u.useCallback(h=>{const y=r==="day"?ke(String(h)):In(String(h));o.onChange&&o.onChange(h??null),g&&g(c,y)},[o,r,c,g]);return t.jsxs(Z,{...l,className:`${a?"disabled":""} ${e?"error":""}`,ref:n,children:[t.jsx(zt,{disabled:a,error:e!=null,props:{...o,autoFocus:!1,granularity:r,onChange:f,shouldForceLeadingZeros:!0}}),t.jsx(ve,{disabled:a,icon:r==="minute"?"calendar-clock":"calendar",props:i}),t.jsx("input",{...d==null?void 0:d(c,{required:p}),"aria-label":c,className:"date-input",disabled:a,id:c,name:c,type:"text",value:x??""})]})},Fe=({children:e,...i})=>{const n=u.useRef(null),{dialogProps:a}=s.$40df3f8667284809$export$d55e7ee900f34e93(i,n);return t.jsx(kn,{...a,ref:n,children:e})},Tt=({disabled:e=!1,error:i,helpLink:n,helpLinkText:a,helpText:r,required:o,label:l,name:c,register:d,setValue:p,tooltip:g,watch:x,...f})=>{const h=u.useRef(null),y=x==null?void 0:x(c),b=u.useCallback(
|
|
1090
|
+
`,ve=({disabled:e=!1,icon:i,props:n})=>{const a=u.useRef(null),{buttonProps:r}=s.$701a24aa0da5b062$export$ea18c227d4417cc3(n,a);return t.jsx(Cn,{...r,$disabled:e,$focus:!!r["aria-expanded"],$header:i==="calendar"||i==="calendar-clock",disabled:e,ref:a,type:"button",children:t.jsx(C,{icon:i,iconColor:S.palette.gray[e?400:700],iconSize:"xs",iconType:"fa-light"})})},Te=({state:e,prevButtonProps:i,nextButtonProps:n,title:a})=>{const r=e.focusedDate,o=u.useCallback(()=>{e.setFocusedDate(r.add({years:1}))},[r,e]),l=u.useCallback(()=>{e.setFocusedDate(r.subtract({years:1}))},[r,e]);return t.jsxs("div",{className:"header flex items-start",children:[t.jsx(ve,{icon:"chevron-left",props:i}),t.jsxs($n,{children:[a,t.jsxs(yn,{children:[t.jsx(st,{"aria-label":"top",onClick:o,children:t.jsx(C,{icon:"caret-up",iconClass:"fa-sharp",iconSize:"xxss"})}),t.jsx(st,{"aria-label":"bottom",onClick:l,children:t.jsx(C,{icon:"caret-down",iconClass:"fa-sharp",iconSize:"xxss"})})]})]}),t.jsx(ve,{icon:"chevron-right",props:n})]})},Ct=({onClose:e,props:i})=>{const{locale:n}=s.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),a=s.$131cf43a05231e1e$export$6d095e787d2b5e1f({...i,createCalendar:s.$64244302c3013299$export$dd0bbc9b26defe37,locale:n}),{prevButtonProps:r,nextButtonProps:o,title:l}=s.$9942cad8a072a530$export$3ee915f8151bd4f1(i,a);return t.jsxs("div",{className:"calendar",children:[t.jsx(Te,{nextButtonProps:o,prevButtonProps:r,state:a,title:l}),t.jsx(Ie,{state:a}),t.jsx(qe,{children:t.jsx(R,{onClick:e,variant:"ghost",children:"Cancel"})})]})},St=({segment:e,state:i})=>{const n=s.nt(),a=u.useRef(null),o={...e,placeholder:{day:"dd",dayPeriod:"(AM/PM)",era:"",hour:"hh",literal:"",minute:"mm",month:"mm",second:"",timeZoneName:"",year:"yyyy"}[e.type]},{segmentProps:l}=s.$32489daedd52963e$export$1315d136e6f7581(o,i,a),c=n.palette.gray[o.isEditable?800:500];return t.jsx("div",{...o.type!=="literal"&&{...l,className:"segment-cell"},ref:a,style:o.type==="literal"?void 0:{color:o.isPlaceholder?n.palette.gray[400]:c},children:o.isPlaceholder?o.placeholder:o.text})},zt=({disabled:e,error:i=!1,props:n})=>{const a=s.nt(),r=u.useRef(null),o=s.$3c0fc76039f1c516$export$60e84778edff6d26({...n,createCalendar:s.$64244302c3013299$export$dd0bbc9b26defe37,locale:"en-US"}),{fieldProps:l}=s.$16f0b7bb276bc17e$export$5591b0b878c1a989(n,o,r),c=u.useCallback(d=>{const p=document.getElementsByClassName("segment-cell"),g=d.currentTarget;Object.values(p).some(x=>x.contains(g))||(d.preventDefault(),d.stopPropagation())},[]);return t.jsxs(Sn,{...l,onClick:c,children:[t.jsx("div",{className:"flex flex-row",style:{color:a.palette.gray[s.lodashExports.isNil(o.value)?400:800]},tabIndex:-1,children:o.segments.map((d,p)=>{const g=`key_${p}`;return t.jsx(St,{segment:{...d,isEditable:!e},state:o},g)})}),i?t.jsx(C,{icon:"exclamation-circle",iconColor:a.palette.error[500],iconSize:"xs"}):void 0]})},It=e=>{const i=u.useRef(null),n=s.$eff5d8ee529ac4bb$export$fd53cef0cc796101({...e,locale:"en-US",shouldForceLeadingZeros:!0}),{timeValue:a}=n,r=!s.lodashExports.isNil(a)&&a.hour<12?"AM":"PM",[o,l]=u.useState(s.lodashExports.isNil(a)?"AM":r),{fieldProps:c}=s.$16f0b7bb276bc17e$export$4c842f6a241dc825(e,n,i),d=u.useCallback(p=>{const g=p.currentTarget.name;g!==o&&(s.lodashExports.isNil(a)||(g==="AM"?n.setSegment("dayPeriod",0):g==="PM"&&n.setSegment("dayPeriod",12))),l(g)},[o,n,a]);return t.jsxs(zn,{children:[t.jsx(lt,{...c,ref:i,children:n.segments.slice(0,-2).map((p,g)=>{const x=`key_${g}`;return t.jsx(St,{segment:p,state:n},x)})}),t.jsxs(lt,{children:[t.jsx(ct,{id:o==="AM"?"active":"",name:"AM",onClick:d,type:"button",children:"AM"}),t.jsx(ct,{id:o==="PM"?"active":"",name:"PM",onClick:d,type:"button",children:"PM"})]})]})},ke=e=>e&&e!=="-"?s.dayjs(e).format("YYYY-MM-DD"):"-",In=e=>e&&e!=="-"?s.dayjs(e).format("YYYY-MM-DD hh:mm A"):"-",Tn=e=>e&&e!=="-"?s.dayjs(e).format("YYYY/MM/DD hh:mm A"):"-",oe=({error:e,buttonProps:i,datePickerRef:n,disabled:a=!1,granularity:r="day",fieldProps:o,groupProps:l,name:c,register:d,required:p,setValue:g,value:x})=>{const f=u.useCallback(h=>{const y=r==="day"?ke(String(h)):In(String(h));o.onChange&&o.onChange(h??null),g&&g(c,y)},[o,r,c,g]);return t.jsxs(Z,{...l,className:`${a?"disabled":""} ${e?"error":""}`,ref:n,children:[t.jsx(zt,{disabled:a,error:e!=null,props:{...o,autoFocus:!1,granularity:r,onChange:f,shouldForceLeadingZeros:!0}}),t.jsx(ve,{disabled:a,icon:r==="minute"?"calendar-clock":"calendar",props:i}),t.jsx("input",{...d==null?void 0:d(c,{required:p}),"aria-label":c,className:"date-input",disabled:a,id:c,name:c,type:"text",value:x??""})]})},Fe=({children:e,...i})=>{const n=u.useRef(null),{dialogProps:a}=s.$40df3f8667284809$export$d55e7ee900f34e93(i,n);return t.jsx(kn,{...a,ref:n,children:e})},Tt=({disabled:e=!1,error:i,helpLink:n,helpLinkText:a,helpText:r,required:o,label:l,name:c,register:d,setValue:p,tooltip:g,watch:x,...f})=>{const h=u.useRef(null),y=x==null?void 0:x(c),b=u.useCallback(T=>{p&&T&&p(c,ke(String(T)))},[c,p]),m=s.$ab5bf3f618090389$export$87194bb378cc3ac2({...f,onChange(T){b(T)},value:s._.isNil(y)||s._.isEmpty(y)||y==="-"?null:s.$fae977aafc393c5c$export$6b862160d295c8e(y.replace(/\//gu,"-"))}),{close:w}=m,{groupProps:j,fieldProps:I,buttonProps:z,dialogProps:v,calendarProps:N}=s.$6057a3d2a53a12fd$export$42df105a73306d51({...f,"aria-label":l??c,name:c},m,h);return t.jsxs(O,{error:i,helpLink:n,helpLinkText:a,helpText:r,htmlFor:c,label:l,required:o,tooltip:g,children:[t.jsx(oe,{buttonProps:z,datePickerRef:h,disabled:e,error:i,fieldProps:I,groupProps:j,name:c,register:d,required:o,setValue:p,value:y}),m.isOpen&&!e?t.jsx(he,{offset:8,placement:"bottom start",state:m,triggerRef:h,children:t.jsx(Fe,{...v,children:t.jsx(Ct,{onClose:w,props:N})})}):null]})},Ft=({onClose:e,props:i})=>{const{locale:n}=s.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),a=u.useRef(null),r=s.$9a36b6ba2fb1a7c5$export$9a987164d97ecc90({...i,createCalendar:s.$64244302c3013299$export$dd0bbc9b26defe37,locale:n}),{prevButtonProps:o,nextButtonProps:l,title:c}=s.$46a4342aab3d8076$export$87e0539f600c24e5(i,r,a);return t.jsxs("div",{className:"calendar-range",ref:a,children:[t.jsx(Te,{nextButtonProps:l,prevButtonProps:o,state:r,title:c}),t.jsx(Ie,{state:r}),t.jsx(qe,{children:t.jsx(R,{onClick:e,variant:"ghost",children:"Cancel"})})]})},Fn=s.dt.div`
|
|
1091
1091
|
${({theme:e,$disabled:i,$show:n})=>`
|
|
1092
1092
|
border-color: ${n?e.palette.error[500]:e.palette.gray[300]};
|
|
1093
1093
|
display: flex;
|
|
@@ -1098,7 +1098,7 @@
|
|
|
1098
1098
|
background: ${i?e.palette.gray[200]:e.palette.white};
|
|
1099
1099
|
}
|
|
1100
1100
|
`}
|
|
1101
|
-
`,Nt=({disabled:e=!1,error:i,label:n,name:a,required:r,tooltip:o,register:l,setValue:c,propsMax:d,propsMin:p,...g})=>{const x=`${a}Max`,f=`${a}Min`,h=u.useRef(null),y=u.useCallback(
|
|
1101
|
+
`,Nt=({disabled:e=!1,error:i,label:n,name:a,required:r,tooltip:o,register:l,setValue:c,propsMax:d,propsMin:p,...g})=>{const x=`${a}Max`,f=`${a}Min`,h=u.useRef(null),y=u.useCallback(T=>{c&&T&&(c((d==null?void 0:d.name)??x,ke(String(T.end))),c((p==null?void 0:p.name)??f,ke(String(T.start))))},[x,f,c,d,p]),b=s.$93c38a5e28be6249$export$e50a61c1de9f574({...g,endName:(d==null?void 0:d.name)??x,startName:(p==null?void 0:p.name)??f,onChange(T){y(T)}}),{close:m}=b,{groupProps:w,startFieldProps:j,endFieldProps:I,buttonProps:z,dialogProps:v,calendarProps:N}=s.$887cac91b7cc8801$export$12fd5f0e9f4bb192({...g,"aria-label":n??a},b,h);return t.jsxs(O,{error:i,htmlFor:a,label:n,required:r,tooltip:o,children:[t.jsxs(Fn,{$disabled:e,$show:i!==void 0,ref:h,style:{flexDirection:"column"},children:[t.jsx(oe,{buttonProps:z,datePickerRef:h,disabled:e,error:i,fieldProps:{...j,"aria-label":`${j["aria-label"]} ${a}`,validate:T=>I.value&&T>I.value?"Start date must be less than or equal to end date":null},groupProps:w,name:(p==null?void 0:p.name)??f,register:l,setValue:c,value:p==null?void 0:p.value}),t.jsx(oe,{buttonProps:z,datePickerRef:h,disabled:e,error:i,fieldProps:{...I,"aria-label":`${I["aria-label"]} ${a}`,validate:T=>j.value&&T<j.value?"End date must be greater than or equal to start date":null},groupProps:w,name:(d==null?void 0:d.name)??x,register:l,setValue:c,value:d==null?void 0:d.value})]}),b.isOpen&&!e?t.jsx(he,{offset:8,placement:"bottom start",state:b,triggerRef:h,children:t.jsx(Fe,{...v,children:t.jsx(Ft,{onClose:m,props:N})})}):null]})},Nn=s.dt.div`
|
|
1102
1102
|
${({theme:e})=>`
|
|
1103
1103
|
align-items: center;
|
|
1104
1104
|
border-top: 1px solid ${e.palette.gray[200]};
|
|
@@ -1113,9 +1113,9 @@
|
|
|
1113
1113
|
gap: ${({theme:e})=>e.spacing[.5]};
|
|
1114
1114
|
justify-content: flex-end;
|
|
1115
1115
|
flex: 1 0 0;
|
|
1116
|
-
`,Et=({handleTimeChange:e,onClose:i,props:n,timeState:a})=>{const r=s.nt(),{locale:o}=s.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),l=s.$131cf43a05231e1e$export$6d095e787d2b5e1f({...n,createCalendar:s.$64244302c3013299$export$dd0bbc9b26defe37,locale:o}),{prevButtonProps:c,nextButtonProps:d,title:p}=s.$9942cad8a072a530$export$3ee915f8151bd4f1(n,l);return t.jsxs("div",{className:"calendar",children:[t.jsx(Te,{nextButtonProps:d,prevButtonProps:c,state:l,title:p}),t.jsx(Ie,{state:l}),t.jsxs(Nn,{children:[t.jsx(k,{color:r.palette.gray[800],fontWeight:"bold",size:"sm",children:"Time"}),t.jsx(En,{children:t.jsx(It,{hourCycle:12,label:"time-field",onChange:e,value:a.timeValue})})]}),t.jsx(qe,{children:t.jsx(R,{onClick:i,variant:"ghost",children:"Cancel"})})]})},Rn=e=>{const{disabled:i=!1,error:n,required:a,label:r,name:o,tooltip:l,register:c,setValue:d,watch:p}=e,g=p==null?void 0:p(o),x=u.useRef(null),f=s.$ab5bf3f618090389$export$87194bb378cc3ac2({...e,granularity:"minute",hourCycle:12,isDisabled:i,isRequired:a,shouldCloseOnSelect:!1,value:s._.isNil(g)||s._.isEmpty(g)||g==="-"?null:s.$fae977aafc393c5c$export$588937bcd60ade55(g.replace(/\//gu,"-"))}),{close:h}=f,{groupProps:y,fieldProps:b,buttonProps:m,dialogProps:w,calendarProps:j}=s.$6057a3d2a53a12fd$export$42df105a73306d51(e,f,x),I=u.useCallback(v=>{j.onChange&&j.onChange(v),d==null||d(o,Tn(String(v).replace(/-/gu,"/")))},[j,o,d]),z=u.useCallback(v=>{v&&f.setTimeValue(v)},[f]);return t.jsxs(O,{error:n,htmlFor:o,label:r,required:a,tooltip:l,children:[t.jsx(oe,{buttonProps:m,datePickerRef:x,disabled:i,error:n,fieldProps:b,granularity:"minute",groupProps:y,name:o,register:c,setValue:d,value:g}),f.isOpen&&!i?t.jsx(he,{offset:8,placement:"bottom start",state:f,triggerRef:x,children:t.jsx(Fe,{...w,children:t.jsx(Et,{handleTimeChange:z,onClose:h,props:{...j,onChange:I},timeState:f})})}):null]})},Dn=({children:e,currentValue:i,externalLink:n,isEditing:a,label:r,name:o,tooltip:l})=>{if(a)return t.jsx("div",{children:e});const c=s.lodashExports.isNil(i)?"":i,d=String(n??c);return t.jsxs($,{children:[t.jsx(Ke,{htmlFor:o,label:r,tooltip:l,weight:"bold"}),d.startsWith("https://")?t.jsx(X,{href:d,children:c}):t.jsx(k,{size:"md",children:c})]})},Xe=({disabled:e=!1,hasIcon:i=!1,helpLink:n,helpLinkText:a,helpText:r,error:o,isValid:l,isTouched:c,label:d,linkPosition:p,name:g,maskValue:x=!1,onPaste:f,placeholder:h,register:y,tooltip:b,type:m="text",weight:w,...j})=>{const{required:I,onBlur:z,onChange:v}=j,N=s.nt(),
|
|
1117
|
-
${e?"disabled":""} ${
|
|
1118
|
-
`,children:[i?t.jsx(C,{icon:"user",iconSize:"sm",iconType:"fa-light"}):void 0,t.jsx("input",{"aria-hidden":!1,"aria-invalid":
|
|
1116
|
+
`,Et=({handleTimeChange:e,onClose:i,props:n,timeState:a})=>{const r=s.nt(),{locale:o}=s.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),l=s.$131cf43a05231e1e$export$6d095e787d2b5e1f({...n,createCalendar:s.$64244302c3013299$export$dd0bbc9b26defe37,locale:o}),{prevButtonProps:c,nextButtonProps:d,title:p}=s.$9942cad8a072a530$export$3ee915f8151bd4f1(n,l);return t.jsxs("div",{className:"calendar",children:[t.jsx(Te,{nextButtonProps:d,prevButtonProps:c,state:l,title:p}),t.jsx(Ie,{state:l}),t.jsxs(Nn,{children:[t.jsx(k,{color:r.palette.gray[800],fontWeight:"bold",size:"sm",children:"Time"}),t.jsx(En,{children:t.jsx(It,{hourCycle:12,label:"time-field",onChange:e,value:a.timeValue})})]}),t.jsx(qe,{children:t.jsx(R,{onClick:i,variant:"ghost",children:"Cancel"})})]})},Rn=e=>{const{disabled:i=!1,error:n,required:a,label:r,name:o,tooltip:l,register:c,setValue:d,watch:p}=e,g=p==null?void 0:p(o),x=u.useRef(null),f=s.$ab5bf3f618090389$export$87194bb378cc3ac2({...e,granularity:"minute",hourCycle:12,isDisabled:i,isRequired:a,shouldCloseOnSelect:!1,value:s._.isNil(g)||s._.isEmpty(g)||g==="-"?null:s.$fae977aafc393c5c$export$588937bcd60ade55(g.replace(/\//gu,"-"))}),{close:h}=f,{groupProps:y,fieldProps:b,buttonProps:m,dialogProps:w,calendarProps:j}=s.$6057a3d2a53a12fd$export$42df105a73306d51(e,f,x),I=u.useCallback(v=>{j.onChange&&j.onChange(v),d==null||d(o,Tn(String(v).replace(/-/gu,"/")))},[j,o,d]),z=u.useCallback(v=>{v&&f.setTimeValue(v)},[f]);return t.jsxs(O,{error:n,htmlFor:o,label:r,required:a,tooltip:l,children:[t.jsx(oe,{buttonProps:m,datePickerRef:x,disabled:i,error:n,fieldProps:b,granularity:"minute",groupProps:y,name:o,register:c,setValue:d,value:g}),f.isOpen&&!i?t.jsx(he,{offset:8,placement:"bottom start",state:f,triggerRef:x,children:t.jsx(Fe,{...w,children:t.jsx(Et,{handleTimeChange:z,onClose:h,props:{...j,onChange:I},timeState:f})})}):null]})},Dn=({children:e,currentValue:i,externalLink:n,isEditing:a,label:r,name:o,tooltip:l})=>{if(a)return t.jsx("div",{children:e});const c=s.lodashExports.isNil(i)?"":i,d=String(n??c);return t.jsxs($,{children:[t.jsx(Ke,{htmlFor:o,label:r,tooltip:l,weight:"bold"}),d.startsWith("https://")?t.jsx(X,{href:d,children:c}):t.jsx(k,{size:"md",children:c})]})},Xe=({disabled:e=!1,hasIcon:i=!1,helpLink:n,helpLinkText:a,helpText:r,error:o,isValid:l,isTouched:c,label:d,linkPosition:p,name:g,maskValue:x=!1,onPaste:f,placeholder:h,register:y,tooltip:b,type:m="text",weight:w,...j})=>{const{required:I,onBlur:z,onChange:v}=j,N=s.nt(),T=e?void 0:o,P=l&&c&&!e,W=u.useCallback(D=>{D.key==="Enter"&&D.preventDefault()},[]);return t.jsx(O,{error:T,helpLink:n,helpLinkText:a,helpText:r,htmlFor:g,label:d,linkPosition:p,required:I,tooltip:b,weight:w,children:t.jsxs(Z,{className:`
|
|
1117
|
+
${e?"disabled":""} ${T?"error":""} ${P?"success":""}
|
|
1118
|
+
`,children:[i?t.jsx(C,{icon:"user",iconSize:"sm",iconType:"fa-light"}):void 0,t.jsx("input",{"aria-hidden":!1,"aria-invalid":T?"true":"false","aria-label":g,"aria-required":I,autoComplete:"off",className:x?"sr-block":"","data-testid":`${g}-input`,disabled:e,id:g,onKeyDown:W,onPaste:f,placeholder:h,type:m,...y?y(g,{required:I,onBlur:z,onChange:v}):{...j}}),T?t.jsx(C,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:N.palette.error[500],iconSize:"xs"}):void 0,P?t.jsx(C,{icon:"check-circle",iconClass:"success-icon",iconColor:N.palette.success[500],iconSize:"xs"}):void 0]})})},Ln=s.dt(ht)`
|
|
1119
1119
|
white-space: nowrap;
|
|
1120
1120
|
margin-right: ${({theme:e})=>e.spacing[.25]};
|
|
1121
1121
|
text-overflow: ellipsis;
|
|
@@ -1126,13 +1126,13 @@
|
|
|
1126
1126
|
position: absolute;
|
|
1127
1127
|
visibility: hidden;
|
|
1128
1128
|
width: 0;
|
|
1129
|
-
`,We=(e,i,n)=>{const a=new Event(e);return Object.defineProperty(a,"target",{value:{name:i,value:n}}),a},Wn=e=>{const i=e;return i?Array.from(i).map(n=>n.name).join(", "):""},An=({accept:e,disabled:i=!1,error:n,label:a,helpLink:r,helpText:o,id:l,multiple:c,name:d,onChange:p,required:g,register:x,setValue:f,tooltip:h,watch:y,weight:b})=>{const m=s.nt(),w=i?void 0:n,j=u.useRef(null),I=y==null?void 0:y(d),z=Wn(I),v=x==null?void 0:x(d,{required:g}),N=u.useCallback(()=>{const W=We("change",d,void 0);f&&f(d,""),v&&v.onChange(W)},[v,d,f]),
|
|
1129
|
+
`,We=(e,i,n)=>{const a=new Event(e);return Object.defineProperty(a,"target",{value:{name:i,value:n}}),a},Wn=e=>{const i=e;return i?Array.from(i).map(n=>n.name).join(", "):""},An=({accept:e,disabled:i=!1,error:n,label:a,helpLink:r,helpText:o,id:l,multiple:c,name:d,onChange:p,required:g,register:x,setValue:f,tooltip:h,watch:y,weight:b})=>{const m=s.nt(),w=i?void 0:n,j=u.useRef(null),I=y==null?void 0:y(d),z=Wn(I),v=x==null?void 0:x(d,{required:g}),N=u.useCallback(()=>{const W=We("change",d,void 0);f&&f(d,""),v&&v.onChange(W)},[v,d,f]),T=u.useCallback(W=>{const{files:D}=W.currentTarget,E=We("change",d,D&&D.length>0?D:void 0);p==null||p(E),v&&v.onChange(E)},[v,d,p]),P=u.useCallback(W=>{i?W.preventDefault():j.current&&j.current.click()},[i]);return t.jsxs(O,{error:w,helpLink:r,helpText:o,htmlFor:l??d,label:a,required:g,tooltip:h,weight:b,children:[t.jsxs(Z,{className:`${i?"disabled":""} ${w?"error":""}`,children:[t.jsx(Ln,{$size:"xs",children:z}),t.jsxs($,{alignItems:"center",display:"flex",gap:.625,children:[s.lodashExports.isEmpty(z)?void 0:t.jsx(B,{color:m.palette.gray[400],height:"20px",icon:"xmark",iconSize:"lg",iconType:"fa-light",onClick:N,variant:"ghost",width:"20px"}),w&&t.jsx(C,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:m.palette.error[500],iconSize:"xs"}),t.jsxs(R,{border:i?`1px solid ${m.palette.gray[300]} !important`:"",borderRadius:"0px 8px 8px 0px !important",disabled:i,height:"40px",onClick:P,variant:"primary",width:"96px",children:[t.jsx(C,{icon:"search",iconSize:"sm",mr:.5}),"Add file"]})]})]}),t.jsx(Pn,{...v&&{ref:v.ref,onBlur:v.onBlur},accept:e,"aria-label":d,"data-testid":d,disabled:i,id:l??d,multiple:c,name:d,onChange:T,onClick:N,ref:j,required:void 0,type:"file",value:void 0})]})},Bn=s.dt.input`
|
|
1130
1130
|
border: none;
|
|
1131
1131
|
background: transparent;
|
|
1132
1132
|
min-width: 15rem;
|
|
1133
1133
|
padding: 0;
|
|
1134
1134
|
flex: 1;
|
|
1135
|
-
`,Ae=({disabled:e=!1,error:i,field:n,helpLink:a,helpLinkText:r,helpText:o,label:l,name:c="input-tag",onChange:d,onRemove:p,placeholder:g,required:x,tooltip:f,value:h,weight:y})=>{const b=s.nt(),m=e?void 0:i,[w,j]=u.useState(""),I=d?h:n==null?void 0:n.value,z=u.useMemo(()=>I&&typeof I=="string"?I.split(",").filter(Boolean):[],[I]),v=u.useCallback(D=>{const _=[...new Set(D.filter(Boolean))].join(","),M=We("change",c,_);n&&n.onChange(M),d&&d(M)},[n,c,d]),N=u.useCallback(D=>{j(D.target.value)},[]),
|
|
1135
|
+
`,Ae=({disabled:e=!1,error:i,field:n,helpLink:a,helpLinkText:r,helpText:o,label:l,name:c="input-tag",onChange:d,onRemove:p,placeholder:g,required:x,tooltip:f,value:h,weight:y})=>{const b=s.nt(),m=e?void 0:i,[w,j]=u.useState(""),I=d?h:n==null?void 0:n.value,z=u.useMemo(()=>I&&typeof I=="string"?I.split(",").filter(Boolean):[],[I]),v=u.useCallback(D=>{const _=[...new Set(D.filter(Boolean))].join(","),M=We("change",c,_);n&&n.onChange(M),d&&d(M)},[n,c,d]),N=u.useCallback(D=>{j(D.target.value)},[]),T=u.useCallback(D=>{const E=w.trim();E.length&&!z.includes(E)&&(D.preventDefault(),v([...z,E]),j("")),n&&n.onBlur()},[w,n,v,z]),P=u.useCallback(D=>{const E=w.trim();D.key==="Enter"&&E.length===0&&D.preventDefault(),["Enter",","].includes(D.key)&&E.length>0&&!z.includes(E)?(D.preventDefault(),v([...z,E]),j("")):D.key==="Backspace"&&!E.length&&z.length&&(D.preventDefault(),p==null||p(z[z.length-1]),v(z.slice(0,-1)))},[w,p,v,z]),W=u.useCallback(D=>()=>{p==null||p(D),v(z.filter(E=>E!==D))},[p,v,z]);return t.jsx(O,{error:m,helpLink:a,helpLinkText:r,helpText:o,htmlFor:c,label:l,required:x,tooltip:f,weight:y,children:t.jsxs(Z,{$overflowX:"auto",className:`${e?"disabled":""} ${m?"error":""}`,children:[z.map(D=>t.jsx(K,{disabled:e,onClose:W(D),tagLabel:D},D)),t.jsx(Bn,{"aria-hidden":!1,"aria-invalid":m?"true":"false","aria-label":c,"aria-required":x,autoComplete:"off",id:c,onBlur:T,onChange:N,onKeyDown:P,placeholder:z.length===0?g:void 0,ref:n==null?void 0:n.ref,type:"text",value:w}),m?t.jsx(C,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:b.palette.error[500],iconSize:"xs"}):void 0]})})},_n=({disabled:e=!1,control:i,error:n,helpLink:a,helpLinkText:r,helpText:o,label:l,name:c="input-tag",onChange:d,onRemove:p,placeholder:g,required:x,tooltip:f,value:h,weight:y})=>i?t.jsx(s.Controller,{control:i,name:c,render:({field:b})=>t.jsx(Ae,{disabled:e,error:n,field:b,helpLink:a,helpLinkText:r,helpText:o,label:l,name:c,onRemove:p,placeholder:g,required:x,tooltip:f,weight:y}),rules:{required:x}}):t.jsx(Ae,{disabled:e,error:n,helpLink:a,helpLinkText:r,helpText:o,label:l,name:c,onChange:d,onRemove:p,placeholder:g,required:x,tooltip:f,value:h,weight:y}),Be=u.forwardRef(function({disabled:i,icon:n,margin:a,onClick:r,...o},l){return t.jsx(vn,{$margin:a,"aria-label":n,className:"action-btn",disabled:i,onClick:r,ref:l,type:"button",...o,children:t.jsx(C,{icon:n,iconClass:"action",iconSize:"xs",iconType:"fa-light"})})}),Ce=({error:e,decimalPlaces:i=0,disabled:n=!1,id:a,maxLength:r,max:o=1/0,min:l=0,name:c,onChange:d,placeholder:p,register:g,required:x,setValue:f,value:h})=>{const y=s.nt(),b=n?void 0:e,m=u.useMemo(()=>i<0?0:i,[i]),[w,j]=u.useState(h?s._.toNumber(h):0),I=u.useCallback(()=>{const T=(w-10**-m).toFixed(m),P=Math.max(Number(l),Number(T));f&&f(c,P),j(P)},[m,w,l,c,f]),z=u.useCallback(()=>{const T=(w+10**-m).toFixed(m),P=Math.min(Number(o),Number(T)>Number(l)?Number(T):Number(l));f&&f(c,P),j(P)},[m,w,o,l,c,f]),v=u.useCallback(T=>{const{value:P}=T.target,W=/\d+/u.test(P)&&!s._.isEmpty(P);f&&f(c,W?Number(P):void 0),d&&d(T)},[c,d,f]),N=u.useCallback(T=>{T.key==="Enter"&&T.preventDefault()},[]);return t.jsxs(Z,{className:`${n?"disabled":""} ${b?"error":""}`,children:[t.jsx("input",{"aria-hidden":!1,"aria-invalid":b?"true":"false","aria-label":c,"aria-required":x,autoComplete:"off",disabled:n,id:a??c,max:o,min:l,onKeyDown:N,placeholder:p,required:x,step:10**-m,type:"number",...g==null?void 0:g(c,{required:x,maxLength:r,max:o,min:l,onChange:v})}),b&&t.jsx(C,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:y.palette.error[500],iconSize:"xs"}),t.jsx(Be,{borderLeft:"inherit",borderRight:"inherit",disabled:n,icon:"minus",margin:"0 -0.625rem 0 0",onClick:I,px:.75,py:.75}),t.jsx(Be,{borderRadius:`0 ${y.spacing[.5]} ${y.spacing[.5]} 0`,disabled:n,icon:"plus",onClick:z,px:.75,py:.75})]})},Rt=({decimalPlaces:e,disabled:i=!1,error:n,helpLink:a,helpText:r,id:o,label:l,linkPosition:c,maxLength:d,max:p,min:g,name:x,onChange:f,placeholder:h,register:y,required:b,setValue:m,tooltip:w,value:j,watch:I,weight:z})=>t.jsx(O,{error:i?void 0:n,helpLink:a,helpText:r,htmlFor:x,label:l,linkPosition:c,maxLength:d,required:b,tooltip:w,weight:z,children:t.jsx(Ce,{decimalPlaces:e,disabled:i,error:n,id:o,max:p,maxLength:d,min:g,name:x,onChange:f,placeholder:h,register:y,required:b,setValue:m,value:f?j:I==null?void 0:I(x)})}),Dt=({disabled:e=!1,error:i,name:n,label:a,propsMax:r,propsMin:o,required:l,tooltip:c})=>{const d=`${n}Max`,p=`${n}Min`;return t.jsx(O,{error:i,htmlFor:n,label:a,required:l,tooltip:c,children:t.jsxs($,{display:"flex",flexDirection:"column",gap:.25,width:"100%",children:[t.jsx(Ce,{...o,disabled:e,error:i,name:o.name??p}),t.jsx(Ce,{...r,disabled:e,error:i,name:r.name??d})]})})},On=s.dt.div`
|
|
1136
1136
|
${({theme:e})=>`
|
|
1137
1137
|
align-items: flex-start;
|
|
1138
1138
|
align-self: stretch;
|
|
@@ -1225,7 +1225,7 @@
|
|
|
1225
1225
|
overflow: hidden;
|
|
1226
1226
|
text-overflow: ellipsis;
|
|
1227
1227
|
white-space: nowrap;
|
|
1228
|
-
`,ee=(e,i,n=!1)=>{u.useEffect(()=>{var r;const a=o=>{e&&!e.contains(o.target)&&i()};return n?(document.addEventListener("click",a,!0),()=>{document.removeEventListener("click",a,!0)}):((r=document.getElementById("root"))==null||r.addEventListener("click",a,!0),()=>{var o;(o=document.getElementById("root"))==null||o.removeEventListener("click",a,!0)})},[n,e,i])},Un=({disabled:e,error:i,label:n,name:a,placeholder:r,required:o,register:l,tooltip:c,value:d,weight:p})=>{const g=s.nt(),x=u.useRef(null),f=e?void 0:i,[h,y]=u.useState(!1),[b,m]=u.useState(""),{refs:w,floatingStyles:j}=s.useFloating$1({placement:"bottom-start",whileElementsMounted:s.autoUpdate}),{inputValue:I,handlePhoneValueChange:z,country:v,setCountry:N}=s.ee({countries:s.R,defaultCountry:"us",forceDialCode:!0,value:d?String(d):void 0}),
|
|
1228
|
+
`,ee=(e,i,n=!1)=>{u.useEffect(()=>{var r;const a=o=>{e&&!e.contains(o.target)&&i()};return n?(document.addEventListener("click",a,!0),()=>{document.removeEventListener("click",a,!0)}):((r=document.getElementById("root"))==null||r.addEventListener("click",a,!0),()=>{var o;(o=document.getElementById("root"))==null||o.removeEventListener("click",a,!0)})},[n,e,i])},Un=({disabled:e,error:i,label:n,name:a,placeholder:r,required:o,register:l,tooltip:c,value:d,weight:p})=>{const g=s.nt(),x=u.useRef(null),f=e?void 0:i,[h,y]=u.useState(!1),[b,m]=u.useState(""),{refs:w,floatingStyles:j}=s.useFloating$1({placement:"bottom-start",whileElementsMounted:s.autoUpdate}),{inputValue:I,handlePhoneValueChange:z,country:v,setCountry:N}=s.ee({countries:s.R,defaultCountry:"us",forceDialCode:!0,value:d?String(d):void 0}),T=u.useCallback(()=>{y(E=>!E),h||m("")},[h]),P=u.useCallback(E=>()=>{N(E),y(!1),m("")},[N,y]),W=u.useCallback(E=>{E.key.length===1?m(_=>_+E.key):E.key==="Backspace"&&m(_=>_.slice(0,-1))},[]),D=s.R.filter(E=>{const{name:_}=s.M(E);return _.toLowerCase().includes(b.toLowerCase())});return ee(w.floating.current,()=>{y(!1),m("")},!0),t.jsx(O,{error:f,htmlFor:a,label:n,required:o,tooltip:c,weight:p,children:t.jsxs(On,{className:`${e?"disabled":""} ${f?"error":""}`,ref:x,children:[t.jsxs(Hn,{"aria-label":"country-selector","data-testid":"country-selector",disabled:e,id:"country-selector",onClick:T,onKeyDown:W,ref:w.setReference,children:[t.jsx(s.q,{iso2:v.iso2,size:"16px"}),t.jsx(C,{icon:"angle-down",iconColor:g.palette.gray[400],iconSize:"xs",iconType:"fa-light"})]}),t.jsxs(Z,{className:`${e?"disabled":""} ${f?"error":""}`,children:[t.jsx("input",{"aria-hidden":!1,"aria-invalid":f?"true":"false","aria-label":a,"aria-required":o,autoComplete:"off","data-testid":`${a}-input`,disabled:e,id:a,name:a,placeholder:r,type:"tel",value:I,...l==null?void 0:l(a,{required:o,onChange:z})}),f?t.jsx(C,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:g.palette.error[500],iconSize:"xs"}):void 0]}),h&&U.createPortal(t.jsx(Mn,{ref:w.setFloating,style:j,children:D.map(E=>{const{dialCode:_,iso2:M,name:te}=s.M(E);return t.jsxs(Vn,{onClick:P(M),value:M,children:[t.jsx(s.q,{iso2:M,size:"16px"}),t.jsx(Gn,{children:te}),t.jsx(k,{color:g.palette.gray[400],size:"sm",sizeSm:"xs",textAlign:"end",children:"+"+_})]},M)})}),document.getElementById("root")??document.body)]})})},Yn=({disabled:e=!1,error:i,helpLink:n,helpText:a,isTouched:r,isValid:o,label:l,name:c="input-text",id:d,maskValue:p=!1,maxLength:g,placeholder:x,register:f,required:h,rows:y,tooltip:b,watch:m,weight:w})=>{const j=s.nt(),I=m==null?void 0:m(c),z=o&&r&&!e,v=e?void 0:i;return t.jsx(O,{error:v,helpLink:n,helpText:a,htmlFor:c,label:l,maxLength:g,required:h,tooltip:b,value:I?String(I):void 0,weight:w,children:t.jsxs(Z,{className:`
|
|
1229
1229
|
${e?"disabled":""} ${v?"error":""} ${z?"success":""}
|
|
1230
1230
|
`,children:[t.jsx("textarea",{"aria-hidden":!1,"aria-invalid":v?"true":"false","aria-label":c,"aria-required":h,className:p?"sr-block":"","data-testid":`${c}-text-area`,disabled:e,id:d??c,maxLength:g,placeholder:x,rows:y,...f==null?void 0:f(c,{required:h})}),v?t.jsx(C,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:j.palette.error[500],iconSize:"xs"}):void 0,z?t.jsx(C,{icon:"check-circle",iconClass:"success-icon",iconColor:j.palette.success[500],iconSize:"xs"}):void 0]})})},Kn=({description:e,disabled:i,id:n,align:a,inputType:r="text",inputNumberProps:o,minHeight:l,minWidth:c,name:d,placeholder:p,tooltip:g,title:x})=>{const f=u.useMemo(()=>{if(r==="text")return t.jsx(Xe,{disabled:i,name:d,placeholder:p});if(r==="date")return t.jsx(Tt,{disabled:i,name:d});const{decimalPlaces:h,max:y,min:b}=o??{};return t.jsx(Rt,{decimalPlaces:h,disabled:i,max:y,min:b,name:d,placeholder:p})},[i,o,r,d,p]);return t.jsxs(xn,{$align:a,$minHeight:l,$minWidth:c,children:[t.jsx(ze,{description:e,id:n,title:x,tooltip:g}),f]})},qn=s.dt.label`
|
|
1231
1231
|
${({theme:e})=>`
|
|
@@ -1914,7 +1914,7 @@ ${h[8]}...`:(h.length<8&&d(!1),i)},[o,i,e]),x=u.useMemo(g,[g]),f=u.useCallback(a
|
|
|
1914
1914
|
`,Zt=s.dt(B)`
|
|
1915
1915
|
background-color: ${({theme:e})=>e.palette.white};
|
|
1916
1916
|
color: ${({theme:e})=>e.palette.gray[400]};
|
|
1917
|
-
`,Jt=({control:e,option:i,register:n,setValue:a})=>{var r,o,l,c,d;switch(i.type){case"checkboxes":return t.jsx("div",{style:{overflowX:"hidden",overflowY:"auto",maxHeight:"280px"},children:(r=i.options)==null?void 0:r.map(g=>t.jsx(dt,{value:g.value,width:"content",children:t.jsx(Ne,{...n("checkbox"),label:g.label,value:g.value})},`li-checkbox-${g.value}`))});case"radioButton":return t.jsx("div",{style:{overflowX:"hidden",overflowY:"auto",maxHeight:"280px"},children:(o=i.options)==null?void 0:o.map(g=>t.jsx(dt,{value:g.value,width:"content",children:t.jsx(Ze,{...n("radio"),label:g.label,value:g.value})},`li-radio-${g.value}`))});case"select":return t.jsx(jt,{control:e,items:((l=i.options)==null?void 0:l.map(g=>({name:g.label??"",value:g.value})))??[],label:i.label,name:`text.${String(i.key)}-${i.filterFn??"caseInsensitive"}`,value:i.value});case"text":const p=`text.${String(i.key)}-${i.filterFn??"caseInsensitive"}`;return t.jsx(Xe,{label:i.label,name:p,register:n,value:i.value});case"numberRange":return t.jsx(Dt,{label:i.label,name:String(i.key),propsMax:{placeholder:"Max",register:n,name:"maxValue",value:i.maxValue,setValue:a},propsMin:{placeholder:"Min",register:n,name:"minValue",value:i.minValue,setValue:a}});case"dateRange":return t.jsx(Nt,{label:i.label,name:String(i.key),propsMax:{name:"maxValue",value:(c=i.maxValue)==null?void 0:c.toString()},propsMin:{name:"minValue",value:(d=i.minValue)==null?void 0:d.toString()},register:n,setValue:a});default:return t.jsx("div",{})}},Qt=({control:e,items:i,register:n,setValue:a})=>t.jsx(t.Fragment,{children:i.map((r,o)=>{const l=`${r.type}-${r.value}-${r.filterFn??"default"}`;return t.jsxs("div",{children:[t.jsx(Jt,{control:e,option:r,register:n,setValue:a}),o<i.length-1&&t.jsx("hr",{style:{margin:"1.25rem 0 0.625rem"}})]},l)})}),ei=e=>{var c,d,p,g,x;const[i,n]=u.useState([...e]),{control:a,register:r,handleSubmit:o,setValue:l}=s.useForm({defaultValues:{checkbox:e.filter(f=>f.type==="checkboxes").flatMap(f=>{var h;return((h=f.options)==null?void 0:h.filter(y=>y.checked).map(y=>y.value))??[]}),radio:((p=(d=(c=e.find(f=>f.type==="radioButton"))==null?void 0:c.options)==null?void 0:d.find(({checked:f})=>f))==null?void 0:p.value)??"",text:e.filter(f=>["text","select"].includes(f.type)).reduce((f,h)=>({...f,[`${String(h.key)}-${h.filterFn??"caseInsensitive"}`]:h.value??""}),{}),minValue:(g=e.find(f=>["numberRange","dateRange"].includes(f.type)))==null?void 0:g.minValue,maxValue:(x=e.find(f=>["numberRange","dateRange"].includes(f.type)))==null?void 0:x.maxValue}});return{control:a,items:i,setItems:n,register:r,handleSubmit:o,setValue:l}},Ra=(e,i)=>{var n,a,r,o,l;i("checkbox",e.filter(c=>c.type==="checkboxes").flatMap(c=>{var d;return((d=c.options)==null?void 0:d.filter(p=>p.checked).map(p=>p.value))??[]})),i("radio",((r=(a=(n=e.find(c=>c.type==="radioButton"))==null?void 0:n.options)==null?void 0:a.find(({checked:c})=>c))==null?void 0:r.value)??""),i("text",e.filter(c=>["text","select"].includes(c.type)).reduce((c,d)=>({...c,[`${String(d.key)}-${d.filterFn??"caseInsensitive"}`]:d.value??""}),{})),i("minValue",(o=e.find(c=>["numberRange","dateRange"].includes(c.type)))==null?void 0:o.minValue),i("maxValue",(l=e.find(c=>["numberRange","dateRange"].includes(c.type)))==null?void 0:l.maxValue)},Da=(e,i)=>e.map(n=>{var a;return n.type==="checkboxes"?{...n,options:(a=n.options)==null?void 0:a.filter(r=>{var o;return((o=r.label)==null?void 0:o.toLowerCase().includes(i.toLowerCase()))??r.value.toLowerCase().includes(i.toLowerCase())})}:n}),_e=({options:e,onSubmit:i,id:n,open:a})=>{const{control:r,items:o,setItems:l,register:c,handleSubmit:d,setValue:p}=ei(e),g=e.some(y=>y.type==="checkboxes"),x=u.useCallback(y=>{const{value:b}=y.target,m=Da(e,b);l(m)},[e,l]),f=u.useCallback(y=>{i&&i(y)},[i]);u.useEffect(()=>{l(e),Ra(e,p)},[e,l,p]);const h=t.jsx(be,{$bgColor:"transparent",children:t.jsxs($e,{$size:"fixed",flexDirection:"column",gap:1.25,style:{overflow:"hidden"},children:[g&&t.jsx(se,{onChange:x}),t.jsxs("form",{id:n,onSubmit:d(f),children:[t.jsx(Qt,{control:r,items:o,register:c,setValue:p}),t.jsx(R,{mt:1,type:"submit",children:"Apply"})]})]})});return a?U.createPortal(h,document.getElementById("portals")??document.body):t.jsx("div",{})},Se=({options:e,variant:i,onApplyFilters:n})=>{const a=s.nt(),[r,o]=u.useState(e),[l,c]=u.useState([]),[d,p]=u.useState({}),[g,x]=u.useState(""),f=u.useCallback(b=>()=>{const m=r.find(w=>w.label===b);x(b),c((m==null?void 0:m.filterOptions)??[])},[r]),h=u.useCallback(b=>{const m=[...b.checkbox,...Object.values(b.text??{}),...b.radio?[b.radio]:[],...b.minValue?[String(b.minValue)]:[],...b.maxValue?[String(b.maxValue)]:[]];p(v=>m.length>0?{...v,[g]:m}:v);const w=v=>{var N,F;return{...v,options:(N=v.options)==null?void 0:N.map(P=>({...P,checked:b.checkbox.includes(P.value)||b.radio===P.value})),value:["text","select"].includes(v.type)?((F=b.text)==null?void 0:F[`${String(v.key)}-${v.filterFn??"caseInsensitive"}`])??v.value:v.value,minValue:["numberRange","dateRange"].includes(v.type)?b.minValue:v.minValue,maxValue:["numberRange","dateRange"].includes(v.type)?b.maxValue:v.maxValue}},j=v=>v.label===g?{...v,filterOptions:v.filterOptions.map(w)}:v,I=r.map(j);o(v=>v.map(j));const z=I.flatMap(({filterOptions:v})=>v);n(z),c([])},[r,n,g]),y=u.useCallback((b,m)=>{const w=`li-filter-option-${b}`;return t.jsxs(Ea,{icon:m,onClick:f(b),style:{minWidth:"180px"},value:w,width:"100%",children:[b,d[b]===void 0?void 0:t.jsx(K,{tagLabel:d[b].length.toString()})]},w)},[d,f]);return u.useEffect(()=>{const b=e.reduce((m,{label:w,filterOptions:j})=>{const I=j.flatMap(({value:N,minValue:F,maxValue:P})=>[F,P,N]).filter(Boolean),z=j.flatMap(({options:N})=>N??[]).filter(({checked:N=!1})=>N).map(({value:N})=>N),v=[...I,...z];return v.length===0?m:{...m,[w]:v}},{});p(b)},[e]),i==="grouped"?t.jsxs($,{display:"flex",flexDirection:"column",flexGrow:1,maxHeight:"360px",position:"relative",style:{columnGap:"10px"},wrap:"wrap",children:[Object.entries(qt(e)).map(([b,m])=>t.jsxs($,{children:[t.jsx(k,{color:a.palette.gray[400],mb:.25,size:"sm",children:b}),m.map(({label:w,icon:j="filter-list"})=>y(w,j))]},b)),t.jsx(_e,{id:"filters-options",onSubmit:h,open:l.length>0,options:l})]}):t.jsxs($,{display:"flex",flexDirection:"column",flexGrow:1,maxHeight:"200px",style:{columnGap:"10px"},wrap:"wrap",children:[e.map(({label:b,icon:m="filter-list"})=>y(b,m)),t.jsx(_e,{id:"filters-options",onSubmit:h,open:l.length>0,options:l})]})},ti=({_containerId:e="portals",options:i,onApplyFilters:n,modalRef:a,variant:r})=>a.isOpen?U.createPortal(t.jsx(be,{$bgColor:"transparent","aria-label":a.name,"aria-modal":"true",children:t.jsxs($e,{$size:"fixed",alignItems:"start",display:"flex",flexDirection:"row",gap:.5,position:"relative",px:1.25,py:1.25,style:{width:"auto"},children:[t.jsx(Se,{onApplyFilters:n,options:i,variant:r}),t.jsx(Zt,{icon:"close",iconSize:"xs",iconTransform:"grow-2",iconType:"fa-light",id:"modal-close",onClick:a.close,variant:"ghost"})]})}),document.getElementById(e)??document.body):t.jsx("div",{}),La=({_containerId:e="portals",rightColumnOptions:i,leftColumnOptions:n,variant:a,onApplyFilters:r,modalRef:o})=>o.isOpen?U.createPortal(t.jsx(be,{$bgColor:"transparent","aria-label":o.name,"aria-modal":"true",children:t.jsxs($e,{$size:"lg",alignItems:"start",flexDirection:"row",gap:1,position:"relative",px:1.25,py:1.25,children:[t.jsxs($,{display:"flex",flexGrow:1,gap:1,justify:"space-between",children:[t.jsx(Se,{onApplyFilters:r,options:n,variant:a}),t.jsx(Se,{onApplyFilters:r,options:i,variant:a})]}),t.jsx(Zt,{icon:"close",iconSize:"xs",iconTransform:"grow-2",iconType:"fa-light",id:"modal-close",onClick:o.close,variant:"ghost"})]})}),document.getElementById(e)??document.body):t.jsx("div",{});function Pa(e){if(e)return e}function Wa(e){if(!e||e.length===0)return;const i=e.filter(a=>a.checked).map(a=>a.value);return i.length===0?void 0:i.join(", ")}function Aa(e,i){const n=s._.isEmpty(e)&&typeof e!="number"?void 0:Number(e),a=s._.isEmpty(i)&&typeof i!="number"?void 0:Number(String(i));if(!s._.isUndefined(n)&&!s._.isUndefined(a))return`${n} - ${a}`;if(!s._.isUndefined(n))return`Min ${n}`;if(!s._.isUndefined(a))return`Max ${a}`}function Ba(e,i){if(s.dayjs_minExports.extend(s.localizedFormat),!(s._.isUndefined(e)||s._.isUndefined(i))){if(e!==""&&i!=="")return`${s.dayjs(e).format("LL")} - ${s.dayjs(i).format("LL")}`;if(e!=="")return`From ${s.dayjs(e).format("LL")}`;if(i!=="")return`To ${s.dayjs(i).format("LL")}`}}function _a(e,i,n){return e==="select"?i:`${i} ${n==="includesInsensitive"?"contains":"is"}`}const ne=({filter:e,icon:i="filter-list",label:n,onClose:a,filterValue:r})=>s._.isNil(r)||s._.isEmpty(String(r))?null:t.jsx($,{pr:.25,children:t.jsx(K,{filterValues:r,icon:i,id:"remove-filter",onClose:a(e),tagLabel:`${n} `})},n),ii=({options:e,onClose:i})=>{const n=e.flatMap(a=>a.filterOptions.map(r=>{const{filterFn:o,label:l,type:c,value:d,options:p,minValue:g,maxValue:x}=r;switch(c){case"numberRange":{const f=Aa(g,x);return t.jsx(ne,{filter:r,filterValue:f,icon:a.icon,label:a.label,onClose:i},l)}case"dateRange":{const f=Ba(g==null?void 0:g.toString(),x==null?void 0:x.toString());return t.jsx(ne,{filter:r,filterValue:f,icon:a.icon,label:a.label,onClose:i},l)}case"radioButton":case"checkboxes":{const f=Wa(p);return t.jsx(ne,{filter:r,filterValue:f,icon:a.icon,label:a.label,onClose:i},l)}case void 0:case"select":case"text":default:{const f=Pa(d),h=_a(c,a.label,o);return t.jsx(ne,{filter:r,filterValue:f,icon:a.icon,label:h,onClose:i},l)}}})).filter(a=>{if(a===null)return!1;const{filterValue:r}=a.props;return!s._.isNil(r)&&!s._.isEmpty(String(r))});return t.jsx($,{display:"flex",children:n})},Oa=(e,i)=>{function n(l,c){if(c.value===""||c.value===void 0||s._.defaultTo(c.isBackFilter,!1))return!0;switch(c.filterFn){case"includesInsensitive":return String(l[c.key]).toLowerCase().includes(c.value.toLowerCase());case"caseInsensitive":case void 0:default:return String(l[c.key]).toLowerCase()===c.value.toLowerCase()}}function a(l,c){if(!c.options||c.options.length===0)return!0;const d=c.options.filter(p=>p.checked).map(p=>p.value);return d.length===0?!0:d.includes(String(l[c.key]))}function r(l,c,d){const p=d(String(l[c.key])),{minValue:g,maxValue:x}=c,f=s._.isEmpty(g)&&typeof g!="number"?void 0:d(String(g)),h=s._.isEmpty(x)&&typeof x!="number"?void 0:d(String(x));return s._.isUndefined(f)&&s._.isUndefined(h)?!0:(f??-1/0)<=p&&p<=(h??1/0)}function o(l){return i.every(c=>{if(typeof c.key=="function")return c.key(l,c.value);switch(c.type){case"radioButton":case"checkboxes":return a(l,c);case"numberRange":return r(l,c,Number);case"dateRange":return r(l,c,d=>new Date(d));case"select":case"text":default:return n(l,c)}})}return e.filter(o)},pt=e=>[...e.flatMap(({options:n})=>n).filter(n=>n==null?void 0:n.checked),...e.flatMap(n=>[n.value,n.maxValue,n.minValue]).filter(Boolean)].length,Ha=e=>{var n;const i=((n=e.options)==null?void 0:n.map(a=>({...a,checked:void 0})))??void 0;return{...e,minValue:void 0,maxValue:void 0,value:void 0,options:i}},Ma=({dataset:e,key:i,options:n,setFilteredDataset:a,variant:r="ungrouped"})=>{const o=Ee("filters-modal"),[l,c]=u.useState([]),[d,p]=u.useState(pt(l)),g=n.map(h=>({...h,filterOptions:h.filterOptions.map(y=>l.find(m=>m.key===y.key&&m.type===y.type&&m.filterFn===y.filterFn)??{...y})})),x=u.useCallback(h=>{c([...h]),localStorage.setItem(i,JSON.stringify(h))},[c,i]),f=u.useCallback(h=>()=>{const y=l.map(b=>b.key===h.key&&b.type===h.type&&b.filterFn===h.filterFn?Ha(b):b);c(y),localStorage.setItem(i,JSON.stringify(y))},[l,i]);return u.useEffect(()=>{const h=localStorage.getItem(i),y=h?JSON.parse(h):n.flatMap(b=>b.filterOptions);c(y)},[i,n,c]),u.useEffect(()=>{a(Oa(e,l)),p(pt(l))},[e,l,a,p]),t.jsxs(u.Fragment,{children:[t.jsx($,{alignItems:"center",display:"flex",gap:.25,maxWidth:"100%",wrap:"wrap",children:t.jsxs($,{pr:.25,children:[t.jsx(R,{icon:"filter",id:"filterBtn",onClick:o.toggle,tag:d.toString(),variant:"ghost"}),t.jsx(ii,{onClose:f,options:g})]})}),t.jsx(ti,{modalRef:o,onApplyFilters:x,options:g,variant:r})]})},ni=({_portal:e=!0,alert:i,cancelButton:n=void 0,children:a=void 0,confirmButton:r=void 0,content:o=void 0,description:l=void 0,modalRef:c,otherActions:d=void 0,onClose:p=void 0,tabItems:g=void 0,title:x=void 0,size:f,id:h="modal-container"})=>{const y=s.nt(),b=t.jsx(be,{"aria-label":c.name,"aria-modal":"true",id:"modal-wrapper",children:t.jsxs($e,{$size:f,"data-testid":h,flexDirection:"column",id:h,children:[!s._.isEmpty(x)&&t.jsx(Mt,{description:l,modalRef:c,onClose:p,otherActions:d,title:x}),g&&t.jsx($,{borderTop:`1px solid ${y.palette.gray[300]}`,display:"block",mb:1.25,position:"sticky",children:t.jsx(Je,{items:g})}),(s._.isObject(o)||a)&&t.jsxs(xa,{children:[a,s._.isObject(o)&&s._.isString(o.imageSrc)&&t.jsx($a,{$framed:o.imageFramed,children:t.jsx(G,{alt:"modal-img",publicId:o.imageSrc})}),s._.isObject(o)&&s._.isString(o.imageText)&&t.jsx(k,{size:"sm",children:o.imageText})]}),t.jsx(Ht,{alert:i,cancelButton:n,confirmButton:r,modalRef:c})]})});return e&&c.isOpen?U.createPortal(b,document.getElementById("portals")??document.body):c.isOpen?b:null},Va=()=>{const[e,i]=u.useState(!1),[n,a]=u.useState(),r=u.useRef(null),o=Ee("confirm-dialog-modal"),l=u.useCallback(async g=>(a(g),i(!0),new Promise(x=>{r.current=x})),[]),c=u.useCallback(()=>{var g;i(!1),a(void 0),(g=r.current)==null||g.call(r,!0)},[]),d=u.useCallback(()=>{var g;i(!1),a(void 0),(g=r.current)==null||g.call(r,!1)},[]);return u.useEffect(()=>{o.setIsOpen(e)},[e,o]),{ConfirmDialog:({id:g="confirm-dialog-modal",children:x})=>t.jsx(ni,{description:n==null?void 0:n.message,id:g,modalRef:{...o,close:d},size:"sm",title:n==null?void 0:n.title,children:t.jsxs($,{display:"flex",flexDirection:"column",children:[x,t.jsx(Vt,{id:n==null?void 0:n.id,onCancel:d,onConfirm:c})]})}),confirm:l}},Ga=s.dt.button`
|
|
1917
|
+
`,Jt=({control:e,option:i,register:n,setValue:a})=>{var r,o,l,c,d;switch(i.type){case"checkboxes":return t.jsx("div",{style:{overflowX:"hidden",overflowY:"auto",maxHeight:"280px"},children:(r=i.options)==null?void 0:r.map(g=>t.jsx(dt,{value:g.value,width:"content",children:t.jsx(Ne,{...n("checkbox"),label:g.label,value:g.value})},`li-checkbox-${g.value}`))});case"radioButton":return t.jsx("div",{style:{overflowX:"hidden",overflowY:"auto",maxHeight:"280px"},children:(o=i.options)==null?void 0:o.map(g=>t.jsx(dt,{value:g.value,width:"content",children:t.jsx(Ze,{...n("radio"),label:g.label,value:g.value})},`li-radio-${g.value}`))});case"select":return t.jsx(jt,{control:e,items:((l=i.options)==null?void 0:l.map(g=>({name:g.label??"",value:g.value})))??[],label:i.label,name:`text.${String(i.key)}-${i.filterFn??"caseInsensitive"}`,value:i.value});case"text":const p=`text.${String(i.key)}-${i.filterFn??"caseInsensitive"}`;return t.jsx(Xe,{label:i.label,name:p,register:n,value:i.value});case"numberRange":return t.jsx(Dt,{label:i.label,name:String(i.key),propsMax:{placeholder:"Max",register:n,name:"maxValue",value:i.maxValue,setValue:a},propsMin:{placeholder:"Min",register:n,name:"minValue",value:i.minValue,setValue:a}});case"dateRange":return t.jsx(Nt,{label:i.label,name:String(i.key),propsMax:{name:"maxValue",value:(c=i.maxValue)==null?void 0:c.toString()},propsMin:{name:"minValue",value:(d=i.minValue)==null?void 0:d.toString()},register:n,setValue:a});default:return t.jsx("div",{})}},Qt=({control:e,items:i,register:n,setValue:a})=>t.jsx(t.Fragment,{children:i.map((r,o)=>{const l=`${r.type}-${r.value}-${r.filterFn??"default"}`;return t.jsxs("div",{children:[t.jsx(Jt,{control:e,option:r,register:n,setValue:a}),o<i.length-1&&t.jsx("hr",{style:{margin:"1.25rem 0 0.625rem"}})]},l)})}),ei=e=>{var c,d,p,g,x;const[i,n]=u.useState([...e]),{control:a,register:r,handleSubmit:o,setValue:l}=s.useForm({defaultValues:{checkbox:e.filter(f=>f.type==="checkboxes").flatMap(f=>{var h;return((h=f.options)==null?void 0:h.filter(y=>y.checked).map(y=>y.value))??[]}),radio:((p=(d=(c=e.find(f=>f.type==="radioButton"))==null?void 0:c.options)==null?void 0:d.find(({checked:f})=>f))==null?void 0:p.value)??"",text:e.filter(f=>["text","select"].includes(f.type)).reduce((f,h)=>({...f,[`${String(h.key)}-${h.filterFn??"caseInsensitive"}`]:h.value??""}),{}),minValue:(g=e.find(f=>["numberRange","dateRange"].includes(f.type)))==null?void 0:g.minValue,maxValue:(x=e.find(f=>["numberRange","dateRange"].includes(f.type)))==null?void 0:x.maxValue}});return{control:a,items:i,setItems:n,register:r,handleSubmit:o,setValue:l}},Ra=(e,i)=>{var n,a,r,o,l;i("checkbox",e.filter(c=>c.type==="checkboxes").flatMap(c=>{var d;return((d=c.options)==null?void 0:d.filter(p=>p.checked).map(p=>p.value))??[]})),i("radio",((r=(a=(n=e.find(c=>c.type==="radioButton"))==null?void 0:n.options)==null?void 0:a.find(({checked:c})=>c))==null?void 0:r.value)??""),i("text",e.filter(c=>["text","select"].includes(c.type)).reduce((c,d)=>({...c,[`${String(d.key)}-${d.filterFn??"caseInsensitive"}`]:d.value??""}),{})),i("minValue",(o=e.find(c=>["numberRange","dateRange"].includes(c.type)))==null?void 0:o.minValue),i("maxValue",(l=e.find(c=>["numberRange","dateRange"].includes(c.type)))==null?void 0:l.maxValue)},Da=(e,i)=>e.map(n=>{var a;return n.type==="checkboxes"?{...n,options:(a=n.options)==null?void 0:a.filter(r=>{var o;return((o=r.label)==null?void 0:o.toLowerCase().includes(i.toLowerCase()))??r.value.toLowerCase().includes(i.toLowerCase())})}:n}),_e=({options:e,onSubmit:i,id:n,open:a})=>{const{control:r,items:o,setItems:l,register:c,handleSubmit:d,setValue:p}=ei(e),g=e.some(y=>y.type==="checkboxes"),x=u.useCallback(y=>{const{value:b}=y.target,m=Da(e,b);l(m)},[e,l]),f=u.useCallback(y=>{i&&i(y)},[i]);u.useEffect(()=>{l(e),Ra(e,p)},[e,l,p]);const h=t.jsx(be,{$bgColor:"transparent",children:t.jsxs($e,{$size:"fixed",flexDirection:"column",gap:1.25,style:{overflow:"hidden"},children:[g&&t.jsx(se,{onChange:x}),t.jsxs("form",{id:n,onSubmit:d(f),children:[t.jsx(Qt,{control:r,items:o,register:c,setValue:p}),t.jsx(R,{mt:1,type:"submit",children:"Apply"})]})]})});return a?U.createPortal(h,document.getElementById("portals")??document.body):t.jsx("div",{})},Se=({options:e,variant:i,onApplyFilters:n})=>{const a=s.nt(),[r,o]=u.useState(e),[l,c]=u.useState([]),[d,p]=u.useState({}),[g,x]=u.useState(""),f=u.useCallback(b=>()=>{const m=r.find(w=>w.label===b);x(b),c((m==null?void 0:m.filterOptions)??[])},[r]),h=u.useCallback(b=>{const m=[...b.checkbox,...Object.values(b.text??{}),...b.radio?[b.radio]:[],...b.minValue?[String(b.minValue)]:[],...b.maxValue?[String(b.maxValue)]:[]];p(v=>m.length>0?{...v,[g]:m}:v);const w=v=>{var N,T;return{...v,options:(N=v.options)==null?void 0:N.map(P=>({...P,checked:b.checkbox.includes(P.value)||b.radio===P.value})),value:["text","select"].includes(v.type)?((T=b.text)==null?void 0:T[`${String(v.key)}-${v.filterFn??"caseInsensitive"}`])??v.value:v.value,minValue:["numberRange","dateRange"].includes(v.type)?b.minValue:v.minValue,maxValue:["numberRange","dateRange"].includes(v.type)?b.maxValue:v.maxValue}},j=v=>v.label===g?{...v,filterOptions:v.filterOptions.map(w)}:v,I=r.map(j);o(v=>v.map(j));const z=I.flatMap(({filterOptions:v})=>v);n(z),c([])},[r,n,g]),y=u.useCallback((b,m)=>{const w=`li-filter-option-${b}`;return t.jsxs(Ea,{icon:m,onClick:f(b),style:{minWidth:"180px"},value:w,width:"100%",children:[b,d[b]===void 0?void 0:t.jsx(K,{tagLabel:d[b].length.toString()})]},w)},[d,f]);return u.useEffect(()=>{const b=e.reduce((m,{label:w,filterOptions:j})=>{const I=j.flatMap(({value:N,minValue:T,maxValue:P})=>[T,P,N]).filter(Boolean),z=j.flatMap(({options:N})=>N??[]).filter(({checked:N=!1})=>N).map(({value:N})=>N),v=[...I,...z];return v.length===0?m:{...m,[w]:v}},{});p(b)},[e]),i==="grouped"?t.jsxs($,{display:"flex",flexDirection:"column",flexGrow:1,maxHeight:"360px",position:"relative",style:{columnGap:"10px"},wrap:"wrap",children:[Object.entries(qt(e)).map(([b,m])=>t.jsxs($,{children:[t.jsx(k,{color:a.palette.gray[400],mb:.25,size:"sm",children:b}),m.map(({label:w,icon:j="filter-list"})=>y(w,j))]},b)),t.jsx(_e,{id:"filters-options",onSubmit:h,open:l.length>0,options:l})]}):t.jsxs($,{display:"flex",flexDirection:"column",flexGrow:1,maxHeight:"200px",style:{columnGap:"10px"},wrap:"wrap",children:[e.map(({label:b,icon:m="filter-list"})=>y(b,m)),t.jsx(_e,{id:"filters-options",onSubmit:h,open:l.length>0,options:l})]})},ti=({_containerId:e="portals",options:i,onApplyFilters:n,modalRef:a,variant:r})=>a.isOpen?U.createPortal(t.jsx(be,{$bgColor:"transparent","aria-label":a.name,"aria-modal":"true",children:t.jsxs($e,{$size:"fixed",alignItems:"start",display:"flex",flexDirection:"row",gap:.5,position:"relative",px:1.25,py:1.25,style:{width:"auto"},children:[t.jsx(Se,{onApplyFilters:n,options:i,variant:r}),t.jsx(Zt,{icon:"close",iconSize:"xs",iconTransform:"grow-2",iconType:"fa-light",id:"modal-close",onClick:a.close,variant:"ghost"})]})}),document.getElementById(e)??document.body):t.jsx("div",{}),La=({_containerId:e="portals",rightColumnOptions:i,leftColumnOptions:n,variant:a,onApplyFilters:r,modalRef:o})=>o.isOpen?U.createPortal(t.jsx(be,{$bgColor:"transparent","aria-label":o.name,"aria-modal":"true",children:t.jsxs($e,{$size:"lg",alignItems:"start",flexDirection:"row",gap:1,position:"relative",px:1.25,py:1.25,children:[t.jsxs($,{display:"flex",flexGrow:1,gap:1,justify:"space-between",children:[t.jsx(Se,{onApplyFilters:r,options:n,variant:a}),t.jsx(Se,{onApplyFilters:r,options:i,variant:a})]}),t.jsx(Zt,{icon:"close",iconSize:"xs",iconTransform:"grow-2",iconType:"fa-light",id:"modal-close",onClick:o.close,variant:"ghost"})]})}),document.getElementById(e)??document.body):t.jsx("div",{});function Pa(e){if(e)return e}function Wa(e){if(!e||e.length===0)return;const i=e.filter(a=>a.checked).map(a=>a.value);return i.length===0?void 0:i.join(", ")}function Aa(e,i){const n=s._.isEmpty(e)&&typeof e!="number"?void 0:Number(e),a=s._.isEmpty(i)&&typeof i!="number"?void 0:Number(String(i));if(!s._.isUndefined(n)&&!s._.isUndefined(a))return`${n} - ${a}`;if(!s._.isUndefined(n))return`Min ${n}`;if(!s._.isUndefined(a))return`Max ${a}`}function Ba(e,i){if(s.dayjs_minExports.extend(s.localizedFormat),!(s._.isUndefined(e)||s._.isUndefined(i))){if(e!==""&&i!=="")return`${s.dayjs(e).format("LL")} - ${s.dayjs(i).format("LL")}`;if(e!=="")return`From ${s.dayjs(e).format("LL")}`;if(i!=="")return`To ${s.dayjs(i).format("LL")}`}}function _a(e,i,n){return e==="select"?i:`${i} ${n==="includesInsensitive"?"contains":"is"}`}const ne=({filter:e,icon:i="filter-list",label:n,onClose:a,filterValue:r})=>s._.isNil(r)||s._.isEmpty(String(r))?null:t.jsx($,{pr:.25,children:t.jsx(K,{filterValues:r,icon:i,id:"remove-filter",onClose:a(e),tagLabel:`${n} `})},n),ii=({options:e,onClose:i})=>{const n=e.flatMap(a=>a.filterOptions.map(r=>{const{filterFn:o,label:l,type:c,value:d,options:p,minValue:g,maxValue:x}=r;switch(c){case"numberRange":{const f=Aa(g,x);return t.jsx(ne,{filter:r,filterValue:f,icon:a.icon,label:a.label,onClose:i},l)}case"dateRange":{const f=Ba(g==null?void 0:g.toString(),x==null?void 0:x.toString());return t.jsx(ne,{filter:r,filterValue:f,icon:a.icon,label:a.label,onClose:i},l)}case"radioButton":case"checkboxes":{const f=Wa(p);return t.jsx(ne,{filter:r,filterValue:f,icon:a.icon,label:a.label,onClose:i},l)}case void 0:case"select":case"text":default:{const f=Pa(d),h=_a(c,a.label,o);return t.jsx(ne,{filter:r,filterValue:f,icon:a.icon,label:h,onClose:i},l)}}})).filter(a=>{if(a===null)return!1;const{filterValue:r}=a.props;return!s._.isNil(r)&&!s._.isEmpty(String(r))});return t.jsx($,{display:"flex",children:n})},Oa=(e,i)=>{function n(l,c){if(c.value===""||c.value===void 0||s._.defaultTo(c.isBackFilter,!1))return!0;switch(c.filterFn){case"includesInsensitive":return String(l[c.key]).toLowerCase().includes(c.value.toLowerCase());case"caseInsensitive":case void 0:default:return String(l[c.key]).toLowerCase()===c.value.toLowerCase()}}function a(l,c){if(!c.options||c.options.length===0)return!0;const d=c.options.filter(p=>p.checked).map(p=>p.value);return d.length===0?!0:d.includes(String(l[c.key]))}function r(l,c,d){const p=d(String(l[c.key])),{minValue:g,maxValue:x}=c,f=s._.isEmpty(g)&&typeof g!="number"?void 0:d(String(g)),h=s._.isEmpty(x)&&typeof x!="number"?void 0:d(String(x));return s._.isUndefined(f)&&s._.isUndefined(h)?!0:(f??-1/0)<=p&&p<=(h??1/0)}function o(l){return i.every(c=>{if(typeof c.key=="function")return c.key(l,c.value);switch(c.type){case"radioButton":case"checkboxes":return a(l,c);case"numberRange":return r(l,c,Number);case"dateRange":return r(l,c,d=>new Date(d));case"select":case"text":default:return n(l,c)}})}return e.filter(o)},pt=e=>[...e.flatMap(({options:n})=>n).filter(n=>n==null?void 0:n.checked),...e.flatMap(n=>[n.value,n.maxValue,n.minValue]).filter(Boolean)].length,Ha=e=>{var n;const i=((n=e.options)==null?void 0:n.map(a=>({...a,checked:void 0})))??void 0;return{...e,minValue:void 0,maxValue:void 0,value:void 0,options:i}},Ma=({dataset:e,key:i,options:n,setFilteredDataset:a,variant:r="ungrouped"})=>{const o=Ee("filters-modal"),[l,c]=u.useState([]),[d,p]=u.useState(pt(l)),g=n.map(h=>({...h,filterOptions:h.filterOptions.map(y=>l.find(m=>m.key===y.key&&m.type===y.type&&m.filterFn===y.filterFn)??{...y})})),x=u.useCallback(h=>{c([...h]),localStorage.setItem(i,JSON.stringify(h))},[c,i]),f=u.useCallback(h=>()=>{const y=l.map(b=>b.key===h.key&&b.type===h.type&&b.filterFn===h.filterFn?Ha(b):b);c(y),localStorage.setItem(i,JSON.stringify(y))},[l,i]);return u.useEffect(()=>{const h=localStorage.getItem(i),y=h?JSON.parse(h):n.flatMap(b=>b.filterOptions);c(y)},[i,n,c]),u.useEffect(()=>{a(Oa(e,l)),p(pt(l))},[e,l,a,p]),t.jsxs(u.Fragment,{children:[t.jsx($,{alignItems:"center",display:"flex",gap:.25,maxWidth:"100%",wrap:"wrap",children:t.jsxs($,{pr:.25,children:[t.jsx(R,{icon:"filter",id:"filterBtn",onClick:o.toggle,tag:d.toString(),variant:"ghost"}),t.jsx(ii,{onClose:f,options:g})]})}),t.jsx(ti,{modalRef:o,onApplyFilters:x,options:g,variant:r})]})},ni=({_portal:e=!0,alert:i,cancelButton:n=void 0,children:a=void 0,confirmButton:r=void 0,content:o=void 0,description:l=void 0,modalRef:c,otherActions:d=void 0,onClose:p=void 0,tabItems:g=void 0,title:x=void 0,size:f,id:h="modal-container"})=>{const y=s.nt(),b=t.jsx(be,{"aria-label":c.name,"aria-modal":"true",id:"modal-wrapper",children:t.jsxs($e,{$size:f,"data-testid":h,flexDirection:"column",id:h,children:[!s._.isEmpty(x)&&t.jsx(Mt,{description:l,modalRef:c,onClose:p,otherActions:d,title:x}),g&&t.jsx($,{borderTop:`1px solid ${y.palette.gray[300]}`,display:"block",mb:1.25,position:"sticky",children:t.jsx(Je,{items:g})}),(s._.isObject(o)||a)&&t.jsxs(xa,{children:[a,s._.isObject(o)&&s._.isString(o.imageSrc)&&t.jsx($a,{$framed:o.imageFramed,children:t.jsx(G,{alt:"modal-img",publicId:o.imageSrc})}),s._.isObject(o)&&s._.isString(o.imageText)&&t.jsx(k,{size:"sm",children:o.imageText})]}),t.jsx(Ht,{alert:i,cancelButton:n,confirmButton:r,modalRef:c})]})});return e&&c.isOpen?U.createPortal(b,document.getElementById("portals")??document.body):c.isOpen?b:null},Va=()=>{const[e,i]=u.useState(!1),[n,a]=u.useState(),r=u.useRef(null),o=Ee("confirm-dialog-modal"),l=u.useCallback(async g=>(a(g),i(!0),new Promise(x=>{r.current=x})),[]),c=u.useCallback(()=>{var g;i(!1),a(void 0),(g=r.current)==null||g.call(r,!0)},[]),d=u.useCallback(()=>{var g;i(!1),a(void 0),(g=r.current)==null||g.call(r,!1)},[]);return u.useEffect(()=>{o.setIsOpen(e)},[e,o]),{ConfirmDialog:({id:g="confirm-dialog-modal",children:x})=>t.jsx(ni,{description:n==null?void 0:n.message,id:g,modalRef:{...o,close:d},size:"sm",title:n==null?void 0:n.title,children:t.jsxs($,{display:"flex",flexDirection:"column",children:[x,t.jsx(Vt,{id:n==null?void 0:n.id,onCancel:d,onConfirm:c})]})}),confirm:l}},Ga=s.dt.button`
|
|
1918
1918
|
display: flex;
|
|
1919
1919
|
position: relative;
|
|
1920
1920
|
height: 32px;
|