chordia-ui 4.0.4 → 4.0.5

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.
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),f=require("react"),m=require("lucide-react"),w=require("./useMediaQuery.cjs.js");function S({open:t,onClose:n,title:r,subtitle:i,children:a,footer:s,width:p=515,height:y=762,toggleLabel:x,toggleChecked:c,onToggle:u,topOffset:d}){const b=f.useRef(null),o=w.useMediaQuery("(max-width: 640px)"),h=d!=null,g=typeof d=="number"?`${d}px`:d;return f.useEffect(()=>{if(!t)return;const l=v=>{v.key==="Escape"&&(n==null||n())};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,n]),t?e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:n,style:{position:"fixed",inset:0,zIndex:1200,background:"rgba(0, 0, 0, 0.20)"}}),e.jsxs("div",{ref:b,style:{position:"fixed",top:o?0:h?g:"50%",right:0,transform:o||h?"none":"translateY(-50%)",zIndex:1201,display:"flex",width:o?"100vw":p,maxWidth:"100vw",height:o?"100dvh":y,maxHeight:o?"100dvh":h?`calc(100vh - ${g})`:"100vh",padding:"20px",boxSizing:o?"border-box":void 0,flexDirection:"column",alignItems:"flex-start",gap:"20px",borderRadius:o?0:"12px 0 0 12px",background:"#FFF",boxShadow:"648px 0 100px 0 rgba(0, 0, 0, 0.20)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",flexShrink:0},children:[e.jsx("h2",{style:{fontSize:"24px",fontWeight:600,fontStyle:"normal",color:"var(--Grey-3, #252525)",margin:0,lineHeight:"normal"},children:r}),e.jsx("button",{onClick:n,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",color:"var(--Grey-Strong, #808183)",cursor:"pointer",borderRadius:"4px",transition:"background 0.15s ease"},onMouseEnter:l=>{l.currentTarget.style.background="#ECEEF2"},onMouseLeave:l=>{l.currentTarget.style.background="transparent"},children:e.jsx(m.X,{size:20,strokeWidth:2})})]}),e.jsx("div",{style:{width:"100%",height:"1px",background:"#ECEEF2",flexShrink:0}}),(i||x)&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:"12px",flexShrink:0},children:[i&&e.jsx("p",{style:{fontSize:"13px",fontStyle:"normal",fontWeight:400,lineHeight:"140%",color:"#0B0B0B",margin:0,flex:1},children:i}),x&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[e.jsx("button",{onClick:()=>u==null?void 0:u(!c),style:{position:"relative",width:"40px",height:"22px",borderRadius:"11px",border:"none",background:c?"var(--Base-Strong, #0B0B0B)":"var(--Base-Faint, #D9D9D9)",cursor:"pointer",transition:"background 0.2s ease",padding:0,flexShrink:0},children:e.jsx("div",{style:{position:"absolute",top:"2px",left:c?"20px":"2px",width:"18px",height:"18px",borderRadius:"50%",background:"#FFF",transition:"left 0.2s ease",boxShadow:"0 1px 3px rgba(0,0,0,0.15)"}})}),e.jsx("span",{style:{fontSize:"13px",fontWeight:500,color:"var(--Base-Strong, #1E1E1E)",lineHeight:1.4},children:x})]})]}),e.jsx("div",{style:{flex:1,width:"100%",overflowY:"auto",display:"flex",flexDirection:"column",gap:"16px",minHeight:0},children:a}),s&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{width:"100%",height:"1px",background:"#ECEEF2",flexShrink:0}}),e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"12px",width:"100%",flexShrink:0},children:s})]})]})]}):null}function k({label:t,variant:n="secondary",onClick:r,disabled:i}){const a=n==="primary";return e.jsx("button",{onClick:r,disabled:i,style:{display:"flex",height:"36px",padding:"0 20px",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:"6px",border:a?"none":"1px solid #D9D9D9",background:a?"var(--Base-Strong, #0B0B0B)":"var(--Base-White, #FFF)",color:a?"#FFF":"var(--Base-Strong, #1E1E1E)",fontSize:"16px",fontWeight:600,cursor:i?"default":"pointer",opacity:i?.5:1,transition:"all 0.15s ease"},onMouseEnter:s=>{!i&&!a&&(s.currentTarget.style.background="#ECEEF2")},onMouseLeave:s=>{!i&&!a&&(s.currentTarget.style.background="var(--Base-White, #FFF)")},children:t})}function j({children:t,htmlFor:n}){return e.jsx("label",{htmlFor:n,style:{display:"block",color:"var(--Base-Strong, #2E3236)",fontSize:"16px",fontStyle:"normal",fontWeight:400,lineHeight:"normal",marginBottom:"6px"},children:t})}function F(t){return e.jsx("input",{...t,style:{width:"100%",padding:"10px 12px",borderRadius:"6px",border:"1px solid #D9D9D9",color:"var(--Base-Strong, #2E3236)",fontSize:"16px",fontStyle:"normal",fontWeight:400,lineHeight:"normal",outline:"none",boxSizing:"border-box",background:"#FFF",transition:"border-color 0.15s ease",...t.style},onFocus:n=>{var r;n.currentTarget.style.borderColor="#808183",(r=t.onFocus)==null||r.call(t,n)},onBlur:n=>{var r;n.currentTarget.style.borderColor="#D9D9D9",(r=t.onBlur)==null||r.call(t,n)}})}exports.DrawerButton=k;exports.DrawerInput=F;exports.DrawerLabel=j;exports.SideDrawer=S;
1
+ "use strict";const e=require("react/jsx-runtime"),p=require("react"),m=require("lucide-react"),w=require("./useMediaQuery.cjs.js");function S({open:t,onClose:n,title:r,subtitle:i,children:x,footer:a,width:l=515,height:y=762,toggleLabel:c,toggleChecked:u,onToggle:h,topOffset:d}){const b=p.useRef(null),o=w.useMediaQuery("(max-width: 640px)"),g=d!=null,f=typeof d=="number"?`${d}px`:d;return p.useEffect(()=>{if(!t)return;const s=v=>{v.key==="Escape"&&(n==null||n())};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[t,n]),t?e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:n,style:{position:"fixed",inset:0,zIndex:1200,background:"rgba(0, 0, 0, 0.20)"}}),e.jsxs("div",{ref:b,style:{position:"fixed",top:o?0:g?f:"50%",right:0,transform:o||g?"none":"translateY(-50%)",zIndex:1201,display:"flex",width:o?"100vw":l,maxWidth:"100vw",height:o?"100dvh":y,maxHeight:o?"100dvh":g?`calc(100vh - ${f})`:"100vh",padding:"20px",boxSizing:o?"border-box":void 0,flexDirection:"column",alignItems:"flex-start",gap:"20px",borderRadius:o?0:"12px 0 0 12px",background:"#FFF",boxShadow:"648px 0 100px 0 rgba(0, 0, 0, 0.20)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",flexShrink:0},children:[e.jsx("h2",{style:{fontSize:"24px",fontWeight:600,fontStyle:"normal",color:"var(--Grey-3, #252525)",margin:0,lineHeight:"normal"},children:r}),e.jsx("button",{onClick:n,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",color:"var(--Grey-Strong, #808183)",cursor:"pointer",borderRadius:"4px",transition:"background 0.15s ease"},onMouseEnter:s=>{s.currentTarget.style.background="#ECEEF2"},onMouseLeave:s=>{s.currentTarget.style.background="transparent"},children:e.jsx(m.X,{size:20,strokeWidth:2})})]}),e.jsx("div",{style:{width:"100%",height:"1px",background:"#ECEEF2",flexShrink:0}}),(i||c)&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:"12px",flexShrink:0},children:[i&&e.jsx("p",{style:{fontSize:"13px",fontStyle:"normal",fontWeight:400,lineHeight:"140%",color:"#0B0B0B",margin:0,flex:1},children:i}),c&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[e.jsx("button",{onClick:()=>h==null?void 0:h(!u),style:{position:"relative",width:"40px",height:"22px",borderRadius:"11px",border:"none",background:u?"var(--Base-Strong, #0B0B0B)":"var(--Base-Faint, #D9D9D9)",cursor:"pointer",transition:"background 0.2s ease",padding:0,flexShrink:0},children:e.jsx("div",{style:{position:"absolute",top:"2px",left:u?"20px":"2px",width:"18px",height:"18px",borderRadius:"50%",background:"#FFF",transition:"left 0.2s ease",boxShadow:"0 1px 3px rgba(0,0,0,0.15)"}})}),e.jsx("span",{style:{fontSize:"13px",fontWeight:500,color:"var(--Base-Strong, #1E1E1E)",lineHeight:1.4},children:c})]})]}),e.jsx("div",{style:{flex:1,width:"100%",overflowY:"auto",display:"flex",flexDirection:"column",gap:"16px",minHeight:0},children:x}),a&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{width:"100%",height:"1px",background:"#ECEEF2",flexShrink:0}}),e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"12px",width:"100%",flexShrink:0},children:a})]})]})]}):null}function k({label:t,variant:n="secondary",onClick:r,disabled:i,style:x}){const a=n==="primary";return e.jsx("button",{onClick:r,disabled:i,style:{display:"flex",height:"36px",padding:"0 20px",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:"6px",border:a?"none":"1px solid #D9D9D9",background:a?"var(--Base-Strong, #0B0B0B)":"var(--Base-White, #FFF)",color:a?"#FFF":"var(--Base-Strong, #1E1E1E)",fontSize:"16px",fontWeight:600,cursor:i?"default":"pointer",opacity:i?.5:1,transition:"all 0.15s ease",...x},onMouseEnter:l=>{!i&&!a&&(l.currentTarget.style.background="#ECEEF2")},onMouseLeave:l=>{!i&&!a&&(l.currentTarget.style.background="var(--Base-White, #FFF)")},children:t})}function j({children:t,htmlFor:n}){return e.jsx("label",{htmlFor:n,style:{display:"block",color:"var(--Base-Strong, #2E3236)",fontSize:"16px",fontStyle:"normal",fontWeight:400,lineHeight:"normal",marginBottom:"6px"},children:t})}function F(t){return e.jsx("input",{...t,style:{width:"100%",padding:"10px 12px",borderRadius:"6px",border:"1px solid #D9D9D9",color:"var(--Base-Strong, #2E3236)",fontSize:"16px",fontStyle:"normal",fontWeight:400,lineHeight:"normal",outline:"none",boxSizing:"border-box",background:"#FFF",transition:"border-color 0.15s ease",...t.style},onFocus:n=>{var r;n.currentTarget.style.borderColor="#808183",(r=t.onFocus)==null||r.call(t,n)},onBlur:n=>{var r;n.currentTarget.style.borderColor="#D9D9D9",(r=t.onBlur)==null||r.call(t,n)}})}exports.DrawerButton=k;exports.DrawerInput=F;exports.DrawerLabel=j;exports.SideDrawer=S;
2
2
  //# sourceMappingURL=SideDrawer.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SideDrawer.cjs.js","sources":["../src/components/common/SideDrawer.jsx"],"sourcesContent":["\"use client\";\n\nimport React, { useEffect, useRef } from \"react\";\nimport { X } from \"lucide-react\";\nimport { useMediaQuery } from \"../../utils/useMediaQuery\";\n\n/**\n * SideDrawer — slide-in panel from the right edge.\n *\n * Props:\n * - open boolean Whether the drawer is visible\n * - onClose function Close callback\n * - title string Header title\n * - subtitle string Optional description below the divider\n * - children ReactNode Drawer body content\n * - footer ReactNode Optional fixed footer (e.g. Cancel/Save buttons)\n * - width number|string Drawer width (default 515)\n * - height number|string Drawer height (default 762)\n * - toggleLabel string Optional toggle label (right side of subtitle row)\n * - toggleChecked boolean Toggle state\n * - onToggle function Toggle callback\n * - topOffset number|string Optional top offset (e.g. below navbar)\n */\nexport default function SideDrawer({\n open,\n onClose,\n title,\n subtitle,\n children,\n footer,\n width = 515,\n height = 762,\n toggleLabel,\n toggleChecked,\n onToggle,\n topOffset,\n}) {\n const drawerRef = useRef(null);\n const isPhone = useMediaQuery(\"(max-width: 640px)\");\n const hasTopOffset = topOffset !== undefined && topOffset !== null;\n const normalizedTopOffset = typeof topOffset === \"number\" ? `${topOffset}px` : topOffset;\n\n // Close on Escape key\n useEffect(() => {\n if (!open) return;\n const handleKey = (e) => {\n if (e.key === \"Escape\") onClose?.();\n };\n document.addEventListener(\"keydown\", handleKey);\n return () => document.removeEventListener(\"keydown\", handleKey);\n }, [open, onClose]);\n\n if (!open) return null;\n\n return (\n <>\n {/* Backdrop */}\n <div\n onClick={onClose}\n style={{\n position: \"fixed\",\n inset: 0,\n zIndex: 1200,\n background: \"rgba(0, 0, 0, 0.20)\",\n }}\n />\n\n {/* Drawer panel */}\n <div\n ref={drawerRef}\n style={{\n position: \"fixed\",\n // On phones the drawer fills the screen so its content isn't clipped\n // off the left edge by a fixed width wider than the viewport.\n top: isPhone ? 0 : hasTopOffset ? normalizedTopOffset : \"50%\",\n right: 0,\n transform: isPhone ? \"none\" : hasTopOffset ? \"none\" : \"translateY(-50%)\",\n zIndex: 1201,\n display: \"flex\",\n width: isPhone ? \"100vw\" : width,\n maxWidth: \"100vw\",\n height: isPhone ? \"100dvh\" : height,\n maxHeight: isPhone ? \"100dvh\" : hasTopOffset ? `calc(100vh - ${normalizedTopOffset})` : \"100vh\",\n padding: \"20px\",\n // border-box only on phones (full-screen) so the desktop drawer keeps\n // its original content-box width (515px content + padding).\n boxSizing: isPhone ? \"border-box\" : undefined,\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: \"20px\",\n borderRadius: isPhone ? 0 : \"12px 0 0 12px\",\n background: \"#FFF\",\n boxShadow: \"648px 0 100px 0 rgba(0, 0, 0, 0.20)\",\n }}\n >\n {/* Header: Title + Close */}\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n width: \"100%\",\n flexShrink: 0,\n }}\n >\n <h2\n style={{\n fontSize: \"24px\",\n fontWeight: 600,\n fontStyle: \"normal\",\n color: \"var(--Grey-3, #252525)\",\n margin: 0,\n lineHeight: \"normal\",\n }}\n >\n {title}\n </h2>\n <button\n onClick={onClose}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"28px\",\n height: \"28px\",\n border: \"none\",\n background: \"transparent\",\n color: \"var(--Grey-Strong, #808183)\",\n cursor: \"pointer\",\n borderRadius: \"4px\",\n transition: \"background 0.15s ease\",\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.background = \"#ECEEF2\";\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = \"transparent\";\n }}\n >\n <X size={20} strokeWidth={2} />\n </button>\n </div>\n\n {/* Divider */}\n <div\n style={{\n width: \"100%\",\n height: \"1px\",\n background: \"#ECEEF2\",\n flexShrink: 0,\n }}\n />\n\n {/* Subtitle row with optional toggle */}\n {(subtitle || toggleLabel) && (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n width: \"100%\",\n gap: \"12px\",\n flexShrink: 0,\n }}\n >\n {subtitle && (\n <p\n style={{\n fontSize: \"13px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"140%\",\n color: \"#0B0B0B\",\n margin: 0,\n flex: 1,\n }}\n >\n {subtitle}\n </p>\n )}\n {toggleLabel && (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"8px\",\n flexShrink: 0,\n }}\n >\n {/* Toggle switch */}\n <button\n onClick={() => onToggle?.(!toggleChecked)}\n style={{\n position: \"relative\",\n width: \"40px\",\n height: \"22px\",\n borderRadius: \"11px\",\n border: \"none\",\n background: toggleChecked\n ? \"var(--Base-Strong, #0B0B0B)\"\n : \"var(--Base-Faint, #D9D9D9)\",\n cursor: \"pointer\",\n transition: \"background 0.2s ease\",\n padding: 0,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n top: \"2px\",\n left: toggleChecked ? \"20px\" : \"2px\",\n width: \"18px\",\n height: \"18px\",\n borderRadius: \"50%\",\n background: \"#FFF\",\n transition: \"left 0.2s ease\",\n boxShadow: \"0 1px 3px rgba(0,0,0,0.15)\",\n }}\n />\n </button>\n <span\n style={{\n fontSize: \"13px\",\n fontWeight: 500,\n color: \"var(--Base-Strong, #1E1E1E)\",\n lineHeight: 1.4,\n }}\n >\n {toggleLabel}\n </span>\n </div>\n )}\n </div>\n )}\n\n {/* Body content — scrollable */}\n <div\n style={{\n flex: 1,\n width: \"100%\",\n overflowY: \"auto\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"16px\",\n minHeight: 0,\n }}\n >\n {children}\n </div>\n\n {/* Footer */}\n {footer && (\n <>\n <div\n style={{\n width: \"100%\",\n height: \"1px\",\n background: \"#ECEEF2\",\n flexShrink: 0,\n }}\n />\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n gap: \"12px\",\n width: \"100%\",\n flexShrink: 0,\n }}\n >\n {footer}\n </div>\n </>\n )}\n </div>\n </>\n );\n}\n\n/**\n * DrawerButton — standard button for use in SideDrawer footer.\n *\n * Props:\n * - label string\n * - variant \"primary\" | \"secondary\" (default \"secondary\")\n * - onClick function\n * - disabled boolean\n */\nexport function DrawerButton({\n label,\n variant = \"secondary\",\n onClick,\n disabled,\n}) {\n const isPrimary = variant === \"primary\";\n\n return (\n <button\n onClick={onClick}\n disabled={disabled}\n style={{\n display: \"flex\",\n height: \"36px\",\n padding: \"0 20px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"8px\",\n borderRadius: \"6px\",\n border: isPrimary ? \"none\" : \"1px solid #D9D9D9\",\n background: isPrimary\n ? \"var(--Base-Strong, #0B0B0B)\"\n : \"var(--Base-White, #FFF)\",\n color: isPrimary ? \"#FFF\" : \"var(--Base-Strong, #1E1E1E)\",\n fontSize: \"16px\",\n fontWeight: 600,\n cursor: disabled ? \"default\" : \"pointer\",\n opacity: disabled ? 0.5 : 1,\n transition: \"all 0.15s ease\",\n }}\n onMouseEnter={(e) => {\n if (!disabled && !isPrimary) {\n e.currentTarget.style.background = \"#ECEEF2\";\n }\n }}\n onMouseLeave={(e) => {\n if (!disabled && !isPrimary) {\n e.currentTarget.style.background = \"var(--Base-White, #FFF)\";\n }\n }}\n >\n {label}\n </button>\n );\n}\n\n/**\n * DrawerLabel — form label for use inside SideDrawer.\n *\n * Props:\n * - children ReactNode\n * - htmlFor string\n */\nexport function DrawerLabel({ children, htmlFor }) {\n return (\n <label\n htmlFor={htmlFor}\n style={{\n display: \"block\",\n color: \"var(--Base-Strong, #2E3236)\",\n fontSize: \"16px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"normal\",\n marginBottom: \"6px\",\n }}\n >\n {children}\n </label>\n );\n}\n\n/**\n * DrawerInput — text input for use inside SideDrawer.\n *\n * Props:\n * - All standard <input> props (type, placeholder, value, onChange, etc.)\n */\nexport function DrawerInput(props) {\n return (\n <input\n {...props}\n style={{\n width: \"100%\",\n padding: \"10px 12px\",\n borderRadius: \"6px\",\n border: \"1px solid #D9D9D9\",\n color: \"var(--Base-Strong, #2E3236)\",\n fontSize: \"16px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"normal\",\n outline: \"none\",\n boxSizing: \"border-box\",\n background: \"#FFF\",\n transition: \"border-color 0.15s ease\",\n ...props.style,\n }}\n onFocus={(e) => {\n e.currentTarget.style.borderColor = \"#808183\";\n props.onFocus?.(e);\n }}\n onBlur={(e) => {\n e.currentTarget.style.borderColor = \"#D9D9D9\";\n props.onBlur?.(e);\n }}\n />\n );\n}\n"],"names":["SideDrawer","open","onClose","title","subtitle","children","footer","width","height","toggleLabel","toggleChecked","onToggle","topOffset","drawerRef","useRef","isPhone","useMediaQuery","hasTopOffset","normalizedTopOffset","useEffect","handleKey","e","jsxs","Fragment","jsx","X","DrawerButton","label","variant","onClick","disabled","isPrimary","DrawerLabel","htmlFor","DrawerInput","props","_a"],"mappings":"mIAuBA,SAAwBA,EAAW,CACjC,KAAAC,EACA,QAAAC,EACA,MAAAC,EACA,SAAAC,EACA,SAAAC,EACA,OAAAC,EACA,MAAAC,EAAQ,IACR,OAAAC,EAAS,IACT,YAAAC,EACA,cAAAC,EACA,SAAAC,EACA,UAAAC,CACF,EAAG,CACK,MAAAC,EAAYC,SAAO,IAAI,EACvBC,EAAUC,gBAAc,oBAAoB,EAC5CC,EAA0CL,GAAc,KACxDM,EAAsB,OAAON,GAAc,SAAW,GAAGA,CAAS,KAAOA,EAY/E,OATAO,EAAAA,UAAU,IAAM,CACd,GAAI,CAAClB,EAAM,OACL,MAAAmB,EAAaC,GAAM,CACnBA,EAAE,MAAQ,WAAoBnB,GAAA,MAAAA,IAAA,EAE3B,gBAAA,iBAAiB,UAAWkB,CAAS,EACvC,IA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,OAAAX,EAAA,IAAC,QAAA,CACE,GAAGW,EACJ,MAAO,CACL,MAAO,OACP,QAAS,YACT,aAAc,MACd,OAAQ,oBACR,MAAO,8BACP,SAAU,OACV,UAAW,SACX,WAAY,IACZ,WAAY,SACZ,QAAS,OACT,UAAW,aACX,WAAY,OACZ,WAAY,0BACZ,GAAGA,EAAM,KACX,EACA,QAAUd,GAAM,OACZA,EAAA,cAAc,MAAM,YAAc,WACpCe,EAAAD,EAAM,UAAN,MAAAC,EAAA,KAAAD,EAAgBd,EAClB,EACA,OAASA,GAAM,OACXA,EAAA,cAAc,MAAM,YAAc,WACpCe,EAAAD,EAAM,SAAN,MAAAC,EAAA,KAAAD,EAAed,EACjB,CAAA,CAAA,CAGN"}
1
+ {"version":3,"file":"SideDrawer.cjs.js","sources":["../src/components/common/SideDrawer.jsx"],"sourcesContent":["\"use client\";\n\nimport React, { useEffect, useRef } from \"react\";\nimport { X } from \"lucide-react\";\nimport { useMediaQuery } from \"../../utils/useMediaQuery\";\n\n/**\n * SideDrawer — slide-in panel from the right edge.\n *\n * Props:\n * - open boolean Whether the drawer is visible\n * - onClose function Close callback\n * - title string Header title\n * - subtitle string Optional description below the divider\n * - children ReactNode Drawer body content\n * - footer ReactNode Optional fixed footer (e.g. Cancel/Save buttons)\n * - width number|string Drawer width (default 515)\n * - height number|string Drawer height (default 762)\n * - toggleLabel string Optional toggle label (right side of subtitle row)\n * - toggleChecked boolean Toggle state\n * - onToggle function Toggle callback\n * - topOffset number|string Optional top offset (e.g. below navbar)\n */\nexport default function SideDrawer({\n open,\n onClose,\n title,\n subtitle,\n children,\n footer,\n width = 515,\n height = 762,\n toggleLabel,\n toggleChecked,\n onToggle,\n topOffset,\n}) {\n const drawerRef = useRef(null);\n const isPhone = useMediaQuery(\"(max-width: 640px)\");\n const hasTopOffset = topOffset !== undefined && topOffset !== null;\n const normalizedTopOffset = typeof topOffset === \"number\" ? `${topOffset}px` : topOffset;\n\n // Close on Escape key\n useEffect(() => {\n if (!open) return;\n const handleKey = (e) => {\n if (e.key === \"Escape\") onClose?.();\n };\n document.addEventListener(\"keydown\", handleKey);\n return () => document.removeEventListener(\"keydown\", handleKey);\n }, [open, onClose]);\n\n if (!open) return null;\n\n return (\n <>\n {/* Backdrop */}\n <div\n onClick={onClose}\n style={{\n position: \"fixed\",\n inset: 0,\n zIndex: 1200,\n background: \"rgba(0, 0, 0, 0.20)\",\n }}\n />\n\n {/* Drawer panel */}\n <div\n ref={drawerRef}\n style={{\n position: \"fixed\",\n // On phones the drawer fills the screen so its content isn't clipped\n // off the left edge by a fixed width wider than the viewport.\n top: isPhone ? 0 : hasTopOffset ? normalizedTopOffset : \"50%\",\n right: 0,\n transform: isPhone ? \"none\" : hasTopOffset ? \"none\" : \"translateY(-50%)\",\n zIndex: 1201,\n display: \"flex\",\n width: isPhone ? \"100vw\" : width,\n maxWidth: \"100vw\",\n height: isPhone ? \"100dvh\" : height,\n maxHeight: isPhone ? \"100dvh\" : hasTopOffset ? `calc(100vh - ${normalizedTopOffset})` : \"100vh\",\n padding: \"20px\",\n // border-box only on phones (full-screen) so the desktop drawer keeps\n // its original content-box width (515px content + padding).\n boxSizing: isPhone ? \"border-box\" : undefined,\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: \"20px\",\n borderRadius: isPhone ? 0 : \"12px 0 0 12px\",\n background: \"#FFF\",\n boxShadow: \"648px 0 100px 0 rgba(0, 0, 0, 0.20)\",\n }}\n >\n {/* Header: Title + Close */}\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n width: \"100%\",\n flexShrink: 0,\n }}\n >\n <h2\n style={{\n fontSize: \"24px\",\n fontWeight: 600,\n fontStyle: \"normal\",\n color: \"var(--Grey-3, #252525)\",\n margin: 0,\n lineHeight: \"normal\",\n }}\n >\n {title}\n </h2>\n <button\n onClick={onClose}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"28px\",\n height: \"28px\",\n border: \"none\",\n background: \"transparent\",\n color: \"var(--Grey-Strong, #808183)\",\n cursor: \"pointer\",\n borderRadius: \"4px\",\n transition: \"background 0.15s ease\",\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.background = \"#ECEEF2\";\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = \"transparent\";\n }}\n >\n <X size={20} strokeWidth={2} />\n </button>\n </div>\n\n {/* Divider */}\n <div\n style={{\n width: \"100%\",\n height: \"1px\",\n background: \"#ECEEF2\",\n flexShrink: 0,\n }}\n />\n\n {/* Subtitle row with optional toggle */}\n {(subtitle || toggleLabel) && (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n width: \"100%\",\n gap: \"12px\",\n flexShrink: 0,\n }}\n >\n {subtitle && (\n <p\n style={{\n fontSize: \"13px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"140%\",\n color: \"#0B0B0B\",\n margin: 0,\n flex: 1,\n }}\n >\n {subtitle}\n </p>\n )}\n {toggleLabel && (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"8px\",\n flexShrink: 0,\n }}\n >\n {/* Toggle switch */}\n <button\n onClick={() => onToggle?.(!toggleChecked)}\n style={{\n position: \"relative\",\n width: \"40px\",\n height: \"22px\",\n borderRadius: \"11px\",\n border: \"none\",\n background: toggleChecked\n ? \"var(--Base-Strong, #0B0B0B)\"\n : \"var(--Base-Faint, #D9D9D9)\",\n cursor: \"pointer\",\n transition: \"background 0.2s ease\",\n padding: 0,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n top: \"2px\",\n left: toggleChecked ? \"20px\" : \"2px\",\n width: \"18px\",\n height: \"18px\",\n borderRadius: \"50%\",\n background: \"#FFF\",\n transition: \"left 0.2s ease\",\n boxShadow: \"0 1px 3px rgba(0,0,0,0.15)\",\n }}\n />\n </button>\n <span\n style={{\n fontSize: \"13px\",\n fontWeight: 500,\n color: \"var(--Base-Strong, #1E1E1E)\",\n lineHeight: 1.4,\n }}\n >\n {toggleLabel}\n </span>\n </div>\n )}\n </div>\n )}\n\n {/* Body content — scrollable */}\n <div\n style={{\n flex: 1,\n width: \"100%\",\n overflowY: \"auto\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"16px\",\n minHeight: 0,\n }}\n >\n {children}\n </div>\n\n {/* Footer */}\n {footer && (\n <>\n <div\n style={{\n width: \"100%\",\n height: \"1px\",\n background: \"#ECEEF2\",\n flexShrink: 0,\n }}\n />\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n gap: \"12px\",\n width: \"100%\",\n flexShrink: 0,\n }}\n >\n {footer}\n </div>\n </>\n )}\n </div>\n </>\n );\n}\n\n/**\n * DrawerButton — standard button for use in SideDrawer footer.\n *\n * Props:\n * - label string\n * - variant \"primary\" | \"secondary\" (default \"secondary\")\n * - onClick function\n * - disabled boolean\n */\nexport function DrawerButton({\n label,\n variant = \"secondary\",\n onClick,\n disabled,\n style,\n}) {\n const isPrimary = variant === \"primary\";\n\n return (\n <button\n onClick={onClick}\n disabled={disabled}\n style={{\n display: \"flex\",\n height: \"36px\",\n padding: \"0 20px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"8px\",\n borderRadius: \"6px\",\n border: isPrimary ? \"none\" : \"1px solid #D9D9D9\",\n background: isPrimary\n ? \"var(--Base-Strong, #0B0B0B)\"\n : \"var(--Base-White, #FFF)\",\n color: isPrimary ? \"#FFF\" : \"var(--Base-Strong, #1E1E1E)\",\n fontSize: \"16px\",\n fontWeight: 600,\n cursor: disabled ? \"default\" : \"pointer\",\n opacity: disabled ? 0.5 : 1,\n transition: \"all 0.15s ease\",\n ...style,\n }}\n onMouseEnter={(e) => {\n if (!disabled && !isPrimary) {\n e.currentTarget.style.background = \"#ECEEF2\";\n }\n }}\n onMouseLeave={(e) => {\n if (!disabled && !isPrimary) {\n e.currentTarget.style.background = \"var(--Base-White, #FFF)\";\n }\n }}\n >\n {label}\n </button>\n );\n}\n\n/**\n * DrawerLabel — form label for use inside SideDrawer.\n *\n * Props:\n * - children ReactNode\n * - htmlFor string\n */\nexport function DrawerLabel({ children, htmlFor }) {\n return (\n <label\n htmlFor={htmlFor}\n style={{\n display: \"block\",\n color: \"var(--Base-Strong, #2E3236)\",\n fontSize: \"16px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"normal\",\n marginBottom: \"6px\",\n }}\n >\n {children}\n </label>\n );\n}\n\n/**\n * DrawerInput — text input for use inside SideDrawer.\n *\n * Props:\n * - All standard <input> props (type, placeholder, value, onChange, etc.)\n */\nexport function DrawerInput(props) {\n return (\n <input\n {...props}\n style={{\n width: \"100%\",\n padding: \"10px 12px\",\n borderRadius: \"6px\",\n border: \"1px solid #D9D9D9\",\n color: \"var(--Base-Strong, #2E3236)\",\n fontSize: \"16px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"normal\",\n outline: \"none\",\n boxSizing: \"border-box\",\n background: \"#FFF\",\n transition: \"border-color 0.15s ease\",\n ...props.style,\n }}\n onFocus={(e) => {\n e.currentTarget.style.borderColor = \"#808183\";\n props.onFocus?.(e);\n }}\n onBlur={(e) => {\n e.currentTarget.style.borderColor = \"#D9D9D9\";\n props.onBlur?.(e);\n }}\n />\n );\n}\n"],"names":["SideDrawer","open","onClose","title","subtitle","children","footer","width","height","toggleLabel","toggleChecked","onToggle","topOffset","drawerRef","useRef","isPhone","useMediaQuery","hasTopOffset","normalizedTopOffset","useEffect","handleKey","e","jsxs","Fragment","jsx","X","DrawerButton","label","variant","onClick","disabled","style","isPrimary","DrawerLabel","htmlFor","DrawerInput","props","_a"],"mappings":"mIAuBA,SAAwBA,EAAW,CACjC,KAAAC,EACA,QAAAC,EACA,MAAAC,EACA,SAAAC,EACA,SAAAC,EACA,OAAAC,EACA,MAAAC,EAAQ,IACR,OAAAC,EAAS,IACT,YAAAC,EACA,cAAAC,EACA,SAAAC,EACA,UAAAC,CACF,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,CAACS,GAAY,CAACE,IACdX,EAAA,cAAc,MAAM,WAAa,0BAEvC,EAEC,SAAAM,CAAA,CAAA,CAGP,CASO,SAASM,EAAY,CAAE,SAAA5B,EAAU,QAAA6B,GAAW,CAE/C,OAAAV,EAAA,IAAC,QAAA,CACC,QAAAU,EACA,MAAO,CACL,QAAS,QACT,MAAO,8BACP,SAAU,OACV,UAAW,SACX,WAAY,IACZ,WAAY,SACZ,aAAc,KAChB,EAEC,SAAA7B,CAAA,CAAA,CAGP,CAQO,SAAS8B,EAAYC,EAAO,CAE/B,OAAAZ,EAAA,IAAC,QAAA,CACE,GAAGY,EACJ,MAAO,CACL,MAAO,OACP,QAAS,YACT,aAAc,MACd,OAAQ,oBACR,MAAO,8BACP,SAAU,OACV,UAAW,SACX,WAAY,IACZ,WAAY,SACZ,QAAS,OACT,UAAW,aACX,WAAY,OACZ,WAAY,0BACZ,GAAGA,EAAM,KACX,EACA,QAAUf,GAAM,OACZA,EAAA,cAAc,MAAM,YAAc,WACpCgB,EAAAD,EAAM,UAAN,MAAAC,EAAA,KAAAD,EAAgBf,EAClB,EACA,OAASA,GAAM,OACXA,EAAA,cAAc,MAAM,YAAc,WACpCgB,EAAAD,EAAM,SAAN,MAAAC,EAAA,KAAAD,EAAef,EACjB,CAAA,CAAA,CAGN"}
@@ -1,4 +1,4 @@
1
- import { jsxs as s, Fragment as g, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as d, Fragment as y, jsx as n } from "react/jsx-runtime";
2
2
  import { useRef as S, useEffect as k } from "react";
3
3
  import { X as w } from "lucide-react";
4
4
  import { u as E } from "./useMediaQuery.es.js";
@@ -7,24 +7,24 @@ function I({
7
7
  onClose: t,
8
8
  title: r,
9
9
  subtitle: i,
10
- children: o,
11
- footer: l,
12
- width: y = 515,
10
+ children: x,
11
+ footer: o,
12
+ width: s = 515,
13
13
  height: b = 762,
14
- toggleLabel: x,
15
- toggleChecked: u,
16
- onToggle: h,
14
+ toggleLabel: u,
15
+ toggleChecked: h,
16
+ onToggle: f,
17
17
  topOffset: c
18
18
  }) {
19
- const m = S(null), a = E("(max-width: 640px)"), f = c != null, p = typeof c == "number" ? `${c}px` : c;
19
+ const m = S(null), a = E("(max-width: 640px)"), p = c != null, g = typeof c == "number" ? `${c}px` : c;
20
20
  return k(() => {
21
21
  if (!e)
22
22
  return;
23
- const d = (v) => {
23
+ const l = (v) => {
24
24
  v.key === "Escape" && (t == null || t());
25
25
  };
26
- return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
27
- }, [e, t]), e ? /* @__PURE__ */ s(g, { children: [
26
+ return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
27
+ }, [e, t]), e ? /* @__PURE__ */ d(y, { children: [
28
28
  /* @__PURE__ */ n(
29
29
  "div",
30
30
  {
@@ -37,7 +37,7 @@ function I({
37
37
  }
38
38
  }
39
39
  ),
40
- /* @__PURE__ */ s(
40
+ /* @__PURE__ */ d(
41
41
  "div",
42
42
  {
43
43
  ref: m,
@@ -45,15 +45,15 @@ function I({
45
45
  position: "fixed",
46
46
  // On phones the drawer fills the screen so its content isn't clipped
47
47
  // off the left edge by a fixed width wider than the viewport.
48
- top: a ? 0 : f ? p : "50%",
48
+ top: a ? 0 : p ? g : "50%",
49
49
  right: 0,
50
- transform: a || f ? "none" : "translateY(-50%)",
50
+ transform: a || p ? "none" : "translateY(-50%)",
51
51
  zIndex: 1201,
52
52
  display: "flex",
53
- width: a ? "100vw" : y,
53
+ width: a ? "100vw" : s,
54
54
  maxWidth: "100vw",
55
55
  height: a ? "100dvh" : b,
56
- maxHeight: a ? "100dvh" : f ? `calc(100vh - ${p})` : "100vh",
56
+ maxHeight: a ? "100dvh" : p ? `calc(100vh - ${g})` : "100vh",
57
57
  padding: "20px",
58
58
  // border-box only on phones (full-screen) so the desktop drawer keeps
59
59
  // its original content-box width (515px content + padding).
@@ -66,7 +66,7 @@ function I({
66
66
  boxShadow: "648px 0 100px 0 rgba(0, 0, 0, 0.20)"
67
67
  },
68
68
  children: [
69
- /* @__PURE__ */ s(
69
+ /* @__PURE__ */ d(
70
70
  "div",
71
71
  {
72
72
  style: {
@@ -108,11 +108,11 @@ function I({
108
108
  borderRadius: "4px",
109
109
  transition: "background 0.15s ease"
110
110
  },
111
- onMouseEnter: (d) => {
112
- d.currentTarget.style.background = "#ECEEF2";
111
+ onMouseEnter: (l) => {
112
+ l.currentTarget.style.background = "#ECEEF2";
113
113
  },
114
- onMouseLeave: (d) => {
115
- d.currentTarget.style.background = "transparent";
114
+ onMouseLeave: (l) => {
115
+ l.currentTarget.style.background = "transparent";
116
116
  },
117
117
  children: /* @__PURE__ */ n(w, { size: 20, strokeWidth: 2 })
118
118
  }
@@ -131,7 +131,7 @@ function I({
131
131
  }
132
132
  }
133
133
  ),
134
- (i || x) && /* @__PURE__ */ s(
134
+ (i || u) && /* @__PURE__ */ d(
135
135
  "div",
136
136
  {
137
137
  style: {
@@ -158,7 +158,7 @@ function I({
158
158
  children: i
159
159
  }
160
160
  ),
161
- x && /* @__PURE__ */ s(
161
+ u && /* @__PURE__ */ d(
162
162
  "div",
163
163
  {
164
164
  style: {
@@ -171,14 +171,14 @@ function I({
171
171
  /* @__PURE__ */ n(
172
172
  "button",
173
173
  {
174
- onClick: () => h == null ? void 0 : h(!u),
174
+ onClick: () => f == null ? void 0 : f(!h),
175
175
  style: {
176
176
  position: "relative",
177
177
  width: "40px",
178
178
  height: "22px",
179
179
  borderRadius: "11px",
180
180
  border: "none",
181
- background: u ? "var(--Base-Strong, #0B0B0B)" : "var(--Base-Faint, #D9D9D9)",
181
+ background: h ? "var(--Base-Strong, #0B0B0B)" : "var(--Base-Faint, #D9D9D9)",
182
182
  cursor: "pointer",
183
183
  transition: "background 0.2s ease",
184
184
  padding: 0,
@@ -190,7 +190,7 @@ function I({
190
190
  style: {
191
191
  position: "absolute",
192
192
  top: "2px",
193
- left: u ? "20px" : "2px",
193
+ left: h ? "20px" : "2px",
194
194
  width: "18px",
195
195
  height: "18px",
196
196
  borderRadius: "50%",
@@ -211,7 +211,7 @@ function I({
211
211
  color: "var(--Base-Strong, #1E1E1E)",
212
212
  lineHeight: 1.4
213
213
  },
214
- children: x
214
+ children: u
215
215
  }
216
216
  )
217
217
  ]
@@ -232,10 +232,10 @@ function I({
232
232
  gap: "16px",
233
233
  minHeight: 0
234
234
  },
235
- children: o
235
+ children: x
236
236
  }
237
237
  ),
238
- l && /* @__PURE__ */ s(g, { children: [
238
+ o && /* @__PURE__ */ d(y, { children: [
239
239
  /* @__PURE__ */ n(
240
240
  "div",
241
241
  {
@@ -258,7 +258,7 @@ function I({
258
258
  width: "100%",
259
259
  flexShrink: 0
260
260
  },
261
- children: l
261
+ children: o
262
262
  }
263
263
  )
264
264
  ] })
@@ -271,7 +271,8 @@ function W({
271
271
  label: e,
272
272
  variant: t = "secondary",
273
273
  onClick: r,
274
- disabled: i
274
+ disabled: i,
275
+ style: x
275
276
  }) {
276
277
  const o = t === "primary";
277
278
  return /* @__PURE__ */ n(
@@ -294,13 +295,14 @@ function W({
294
295
  fontWeight: 600,
295
296
  cursor: i ? "default" : "pointer",
296
297
  opacity: i ? 0.5 : 1,
297
- transition: "all 0.15s ease"
298
+ transition: "all 0.15s ease",
299
+ ...x
298
300
  },
299
- onMouseEnter: (l) => {
300
- !i && !o && (l.currentTarget.style.background = "#ECEEF2");
301
+ onMouseEnter: (s) => {
302
+ !i && !o && (s.currentTarget.style.background = "#ECEEF2");
301
303
  },
302
- onMouseLeave: (l) => {
303
- !i && !o && (l.currentTarget.style.background = "var(--Base-White, #FFF)");
304
+ onMouseLeave: (s) => {
305
+ !i && !o && (s.currentTarget.style.background = "var(--Base-White, #FFF)");
304
306
  },
305
307
  children: e
306
308
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SideDrawer.es.js","sources":["../src/components/common/SideDrawer.jsx"],"sourcesContent":["\"use client\";\n\nimport React, { useEffect, useRef } from \"react\";\nimport { X } from \"lucide-react\";\nimport { useMediaQuery } from \"../../utils/useMediaQuery\";\n\n/**\n * SideDrawer — slide-in panel from the right edge.\n *\n * Props:\n * - open boolean Whether the drawer is visible\n * - onClose function Close callback\n * - title string Header title\n * - subtitle string Optional description below the divider\n * - children ReactNode Drawer body content\n * - footer ReactNode Optional fixed footer (e.g. Cancel/Save buttons)\n * - width number|string Drawer width (default 515)\n * - height number|string Drawer height (default 762)\n * - toggleLabel string Optional toggle label (right side of subtitle row)\n * - toggleChecked boolean Toggle state\n * - onToggle function Toggle callback\n * - topOffset number|string Optional top offset (e.g. below navbar)\n */\nexport default function SideDrawer({\n open,\n onClose,\n title,\n subtitle,\n children,\n footer,\n width = 515,\n height = 762,\n toggleLabel,\n toggleChecked,\n onToggle,\n topOffset,\n}) {\n const drawerRef = useRef(null);\n const isPhone = useMediaQuery(\"(max-width: 640px)\");\n const hasTopOffset = topOffset !== undefined && topOffset !== null;\n const normalizedTopOffset = typeof topOffset === \"number\" ? `${topOffset}px` : topOffset;\n\n // Close on Escape key\n useEffect(() => {\n if (!open) return;\n const handleKey = (e) => {\n if (e.key === \"Escape\") onClose?.();\n };\n document.addEventListener(\"keydown\", handleKey);\n return () => document.removeEventListener(\"keydown\", handleKey);\n }, [open, onClose]);\n\n if (!open) return null;\n\n return (\n <>\n {/* Backdrop */}\n <div\n onClick={onClose}\n style={{\n position: \"fixed\",\n inset: 0,\n zIndex: 1200,\n background: \"rgba(0, 0, 0, 0.20)\",\n }}\n />\n\n {/* Drawer panel */}\n <div\n ref={drawerRef}\n style={{\n position: \"fixed\",\n // On phones the drawer fills the screen so its content isn't clipped\n // off the left edge by a fixed width wider than the viewport.\n top: isPhone ? 0 : hasTopOffset ? normalizedTopOffset : \"50%\",\n right: 0,\n transform: isPhone ? \"none\" : hasTopOffset ? \"none\" : \"translateY(-50%)\",\n zIndex: 1201,\n display: \"flex\",\n width: isPhone ? \"100vw\" : width,\n maxWidth: \"100vw\",\n height: isPhone ? \"100dvh\" : height,\n maxHeight: isPhone ? \"100dvh\" : hasTopOffset ? `calc(100vh - ${normalizedTopOffset})` : \"100vh\",\n padding: \"20px\",\n // border-box only on phones (full-screen) so the desktop drawer keeps\n // its original content-box width (515px content + padding).\n boxSizing: isPhone ? \"border-box\" : undefined,\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: \"20px\",\n borderRadius: isPhone ? 0 : \"12px 0 0 12px\",\n background: \"#FFF\",\n boxShadow: \"648px 0 100px 0 rgba(0, 0, 0, 0.20)\",\n }}\n >\n {/* Header: Title + Close */}\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n width: \"100%\",\n flexShrink: 0,\n }}\n >\n <h2\n style={{\n fontSize: \"24px\",\n fontWeight: 600,\n fontStyle: \"normal\",\n color: \"var(--Grey-3, #252525)\",\n margin: 0,\n lineHeight: \"normal\",\n }}\n >\n {title}\n </h2>\n <button\n onClick={onClose}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"28px\",\n height: \"28px\",\n border: \"none\",\n background: \"transparent\",\n color: \"var(--Grey-Strong, #808183)\",\n cursor: \"pointer\",\n borderRadius: \"4px\",\n transition: \"background 0.15s ease\",\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.background = \"#ECEEF2\";\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = \"transparent\";\n }}\n >\n <X size={20} strokeWidth={2} />\n </button>\n </div>\n\n {/* Divider */}\n <div\n style={{\n width: \"100%\",\n height: \"1px\",\n background: \"#ECEEF2\",\n flexShrink: 0,\n }}\n />\n\n {/* Subtitle row with optional toggle */}\n {(subtitle || toggleLabel) && (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n width: \"100%\",\n gap: \"12px\",\n flexShrink: 0,\n }}\n >\n {subtitle && (\n <p\n style={{\n fontSize: \"13px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"140%\",\n color: \"#0B0B0B\",\n margin: 0,\n flex: 1,\n }}\n >\n {subtitle}\n </p>\n )}\n {toggleLabel && (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"8px\",\n flexShrink: 0,\n }}\n >\n {/* Toggle switch */}\n <button\n onClick={() => onToggle?.(!toggleChecked)}\n style={{\n position: \"relative\",\n width: \"40px\",\n height: \"22px\",\n borderRadius: \"11px\",\n border: \"none\",\n background: toggleChecked\n ? \"var(--Base-Strong, #0B0B0B)\"\n : \"var(--Base-Faint, #D9D9D9)\",\n cursor: \"pointer\",\n transition: \"background 0.2s ease\",\n padding: 0,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n top: \"2px\",\n left: toggleChecked ? \"20px\" : \"2px\",\n width: \"18px\",\n height: \"18px\",\n borderRadius: \"50%\",\n background: \"#FFF\",\n transition: \"left 0.2s ease\",\n boxShadow: \"0 1px 3px rgba(0,0,0,0.15)\",\n }}\n />\n </button>\n <span\n style={{\n fontSize: \"13px\",\n fontWeight: 500,\n color: \"var(--Base-Strong, #1E1E1E)\",\n lineHeight: 1.4,\n }}\n >\n {toggleLabel}\n </span>\n </div>\n )}\n </div>\n )}\n\n {/* Body content — scrollable */}\n <div\n style={{\n flex: 1,\n width: \"100%\",\n overflowY: \"auto\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"16px\",\n minHeight: 0,\n }}\n >\n {children}\n </div>\n\n {/* Footer */}\n {footer && (\n <>\n <div\n style={{\n width: \"100%\",\n height: \"1px\",\n background: \"#ECEEF2\",\n flexShrink: 0,\n }}\n />\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n gap: \"12px\",\n width: \"100%\",\n flexShrink: 0,\n }}\n >\n {footer}\n </div>\n </>\n )}\n </div>\n </>\n );\n}\n\n/**\n * DrawerButton — standard button for use in SideDrawer footer.\n *\n * Props:\n * - label string\n * - variant \"primary\" | \"secondary\" (default \"secondary\")\n * - onClick function\n * - disabled boolean\n */\nexport function DrawerButton({\n label,\n variant = \"secondary\",\n onClick,\n disabled,\n}) {\n const isPrimary = variant === \"primary\";\n\n return (\n <button\n onClick={onClick}\n disabled={disabled}\n style={{\n display: \"flex\",\n height: \"36px\",\n padding: \"0 20px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"8px\",\n borderRadius: \"6px\",\n border: isPrimary ? \"none\" : \"1px solid #D9D9D9\",\n background: isPrimary\n ? \"var(--Base-Strong, #0B0B0B)\"\n : \"var(--Base-White, #FFF)\",\n color: isPrimary ? \"#FFF\" : \"var(--Base-Strong, #1E1E1E)\",\n fontSize: \"16px\",\n fontWeight: 600,\n cursor: disabled ? \"default\" : \"pointer\",\n opacity: disabled ? 0.5 : 1,\n transition: \"all 0.15s ease\",\n }}\n onMouseEnter={(e) => {\n if (!disabled && !isPrimary) {\n e.currentTarget.style.background = \"#ECEEF2\";\n }\n }}\n onMouseLeave={(e) => {\n if (!disabled && !isPrimary) {\n e.currentTarget.style.background = \"var(--Base-White, #FFF)\";\n }\n }}\n >\n {label}\n </button>\n );\n}\n\n/**\n * DrawerLabel — form label for use inside SideDrawer.\n *\n * Props:\n * - children ReactNode\n * - htmlFor string\n */\nexport function DrawerLabel({ children, htmlFor }) {\n return (\n <label\n htmlFor={htmlFor}\n style={{\n display: \"block\",\n color: \"var(--Base-Strong, #2E3236)\",\n fontSize: \"16px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"normal\",\n marginBottom: \"6px\",\n }}\n >\n {children}\n </label>\n );\n}\n\n/**\n * DrawerInput — text input for use inside SideDrawer.\n *\n * Props:\n * - All standard <input> props (type, placeholder, value, onChange, etc.)\n */\nexport function DrawerInput(props) {\n return (\n <input\n {...props}\n style={{\n width: \"100%\",\n padding: \"10px 12px\",\n borderRadius: \"6px\",\n border: \"1px solid #D9D9D9\",\n color: \"var(--Base-Strong, #2E3236)\",\n fontSize: \"16px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"normal\",\n outline: \"none\",\n boxSizing: \"border-box\",\n background: \"#FFF\",\n transition: \"border-color 0.15s ease\",\n ...props.style,\n }}\n onFocus={(e) => {\n e.currentTarget.style.borderColor = \"#808183\";\n props.onFocus?.(e);\n }}\n onBlur={(e) => {\n e.currentTarget.style.borderColor = \"#D9D9D9\";\n props.onBlur?.(e);\n }}\n />\n );\n}\n"],"names":["SideDrawer","open","onClose","title","subtitle","children","footer","width","height","toggleLabel","toggleChecked","onToggle","topOffset","drawerRef","useRef","isPhone","useMediaQuery","hasTopOffset","normalizedTopOffset","useEffect","handleKey","e","jsxs","Fragment","jsx","X","DrawerButton","label","variant","onClick","disabled","isPrimary","DrawerLabel","htmlFor","DrawerInput","props","_a"],"mappings":";;;;AAuBA,SAAwBA,EAAW;AAAA,EACjC,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AACF,GAAG;AACK,QAAAC,IAAYC,EAAO,IAAI,GACvBC,IAAUC,EAAc,oBAAoB,GAC5CC,IAA0CL,KAAc,MACxDM,IAAsB,OAAON,KAAc,WAAW,GAAGA,CAAS,OAAOA;AAY/E,SATAO,EAAU,MAAM;AACd,QAAI,CAAClB;AAAM;AACL,UAAAmB,IAAY,CAACC,MAAM;AACvB,MAAIA,EAAE,QAAQ,aAAoBnB,KAAA,QAAAA;AAAA,IAAA;AAE3B,oBAAA,iBAAiB,WAAWkB,CAAS,GACvC,MAAM,SAAS,oBAAoB,WAAWA,CAAS;AAAA,EAAA,GAC7D,CAACnB,GAAMC,CAAO,CAAC,GAEbD,IAKD,gBAAAqB,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAStB;AAAA,QACT,OAAO;AAAA,UACL,UAAU;AAAA,UAC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;AAAA,MACA,cAAc,CAACA,MAAM;AACf,QAAA,CAACS,KAAY,CAACC,MACdV,EAAA,cAAc,MAAM,aAAa;AAAA,MAEvC;AAAA,MAEC,UAAAM;AAAA,IAAA;AAAA,EAAA;AAGP;AASO,SAASK,EAAY,EAAE,UAAA3B,GAAU,SAAA4B,KAAW;AAE/C,SAAA,gBAAAT;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,SAAAS;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,QACT,OAAO;AAAA,QACP,UAAU;AAAA,QACV,WAAW;AAAA,QACX,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,cAAc;AAAA,MAChB;AAAA,MAEC,UAAA5B;AAAA,IAAA;AAAA,EAAA;AAGP;AAQO,SAAS6B,EAAYC,GAAO;AAE/B,SAAA,gBAAAX;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGW;AAAA,MACJ,OAAO;AAAA,QACL,OAAO;AAAA,QACP,SAAS;AAAA,QACT,cAAc;AAAA,QACd,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,UAAU;AAAA,QACV,WAAW;AAAA,QACX,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,WAAW;AAAA,QACX,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,GAAGA,EAAM;AAAA,MACX;AAAA,MACA,SAAS,CAACd,MAAM;;AACZ,QAAAA,EAAA,cAAc,MAAM,cAAc,YACpCe,IAAAD,EAAM,YAAN,QAAAC,EAAA,KAAAD,GAAgBd;AAAA,MAClB;AAAA,MACA,QAAQ,CAACA,MAAM;;AACX,QAAAA,EAAA,cAAc,MAAM,cAAc,YACpCe,IAAAD,EAAM,WAAN,QAAAC,EAAA,KAAAD,GAAed;AAAA,MACjB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"SideDrawer.es.js","sources":["../src/components/common/SideDrawer.jsx"],"sourcesContent":["\"use client\";\n\nimport React, { useEffect, useRef } from \"react\";\nimport { X } from \"lucide-react\";\nimport { useMediaQuery } from \"../../utils/useMediaQuery\";\n\n/**\n * SideDrawer — slide-in panel from the right edge.\n *\n * Props:\n * - open boolean Whether the drawer is visible\n * - onClose function Close callback\n * - title string Header title\n * - subtitle string Optional description below the divider\n * - children ReactNode Drawer body content\n * - footer ReactNode Optional fixed footer (e.g. Cancel/Save buttons)\n * - width number|string Drawer width (default 515)\n * - height number|string Drawer height (default 762)\n * - toggleLabel string Optional toggle label (right side of subtitle row)\n * - toggleChecked boolean Toggle state\n * - onToggle function Toggle callback\n * - topOffset number|string Optional top offset (e.g. below navbar)\n */\nexport default function SideDrawer({\n open,\n onClose,\n title,\n subtitle,\n children,\n footer,\n width = 515,\n height = 762,\n toggleLabel,\n toggleChecked,\n onToggle,\n topOffset,\n}) {\n const drawerRef = useRef(null);\n const isPhone = useMediaQuery(\"(max-width: 640px)\");\n const hasTopOffset = topOffset !== undefined && topOffset !== null;\n const normalizedTopOffset = typeof topOffset === \"number\" ? `${topOffset}px` : topOffset;\n\n // Close on Escape key\n useEffect(() => {\n if (!open) return;\n const handleKey = (e) => {\n if (e.key === \"Escape\") onClose?.();\n };\n document.addEventListener(\"keydown\", handleKey);\n return () => document.removeEventListener(\"keydown\", handleKey);\n }, [open, onClose]);\n\n if (!open) return null;\n\n return (\n <>\n {/* Backdrop */}\n <div\n onClick={onClose}\n style={{\n position: \"fixed\",\n inset: 0,\n zIndex: 1200,\n background: \"rgba(0, 0, 0, 0.20)\",\n }}\n />\n\n {/* Drawer panel */}\n <div\n ref={drawerRef}\n style={{\n position: \"fixed\",\n // On phones the drawer fills the screen so its content isn't clipped\n // off the left edge by a fixed width wider than the viewport.\n top: isPhone ? 0 : hasTopOffset ? normalizedTopOffset : \"50%\",\n right: 0,\n transform: isPhone ? \"none\" : hasTopOffset ? \"none\" : \"translateY(-50%)\",\n zIndex: 1201,\n display: \"flex\",\n width: isPhone ? \"100vw\" : width,\n maxWidth: \"100vw\",\n height: isPhone ? \"100dvh\" : height,\n maxHeight: isPhone ? \"100dvh\" : hasTopOffset ? `calc(100vh - ${normalizedTopOffset})` : \"100vh\",\n padding: \"20px\",\n // border-box only on phones (full-screen) so the desktop drawer keeps\n // its original content-box width (515px content + padding).\n boxSizing: isPhone ? \"border-box\" : undefined,\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: \"20px\",\n borderRadius: isPhone ? 0 : \"12px 0 0 12px\",\n background: \"#FFF\",\n boxShadow: \"648px 0 100px 0 rgba(0, 0, 0, 0.20)\",\n }}\n >\n {/* Header: Title + Close */}\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n width: \"100%\",\n flexShrink: 0,\n }}\n >\n <h2\n style={{\n fontSize: \"24px\",\n fontWeight: 600,\n fontStyle: \"normal\",\n color: \"var(--Grey-3, #252525)\",\n margin: 0,\n lineHeight: \"normal\",\n }}\n >\n {title}\n </h2>\n <button\n onClick={onClose}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"28px\",\n height: \"28px\",\n border: \"none\",\n background: \"transparent\",\n color: \"var(--Grey-Strong, #808183)\",\n cursor: \"pointer\",\n borderRadius: \"4px\",\n transition: \"background 0.15s ease\",\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.background = \"#ECEEF2\";\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = \"transparent\";\n }}\n >\n <X size={20} strokeWidth={2} />\n </button>\n </div>\n\n {/* Divider */}\n <div\n style={{\n width: \"100%\",\n height: \"1px\",\n background: \"#ECEEF2\",\n flexShrink: 0,\n }}\n />\n\n {/* Subtitle row with optional toggle */}\n {(subtitle || toggleLabel) && (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n width: \"100%\",\n gap: \"12px\",\n flexShrink: 0,\n }}\n >\n {subtitle && (\n <p\n style={{\n fontSize: \"13px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"140%\",\n color: \"#0B0B0B\",\n margin: 0,\n flex: 1,\n }}\n >\n {subtitle}\n </p>\n )}\n {toggleLabel && (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"8px\",\n flexShrink: 0,\n }}\n >\n {/* Toggle switch */}\n <button\n onClick={() => onToggle?.(!toggleChecked)}\n style={{\n position: \"relative\",\n width: \"40px\",\n height: \"22px\",\n borderRadius: \"11px\",\n border: \"none\",\n background: toggleChecked\n ? \"var(--Base-Strong, #0B0B0B)\"\n : \"var(--Base-Faint, #D9D9D9)\",\n cursor: \"pointer\",\n transition: \"background 0.2s ease\",\n padding: 0,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n top: \"2px\",\n left: toggleChecked ? \"20px\" : \"2px\",\n width: \"18px\",\n height: \"18px\",\n borderRadius: \"50%\",\n background: \"#FFF\",\n transition: \"left 0.2s ease\",\n boxShadow: \"0 1px 3px rgba(0,0,0,0.15)\",\n }}\n />\n </button>\n <span\n style={{\n fontSize: \"13px\",\n fontWeight: 500,\n color: \"var(--Base-Strong, #1E1E1E)\",\n lineHeight: 1.4,\n }}\n >\n {toggleLabel}\n </span>\n </div>\n )}\n </div>\n )}\n\n {/* Body content — scrollable */}\n <div\n style={{\n flex: 1,\n width: \"100%\",\n overflowY: \"auto\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"16px\",\n minHeight: 0,\n }}\n >\n {children}\n </div>\n\n {/* Footer */}\n {footer && (\n <>\n <div\n style={{\n width: \"100%\",\n height: \"1px\",\n background: \"#ECEEF2\",\n flexShrink: 0,\n }}\n />\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n gap: \"12px\",\n width: \"100%\",\n flexShrink: 0,\n }}\n >\n {footer}\n </div>\n </>\n )}\n </div>\n </>\n );\n}\n\n/**\n * DrawerButton — standard button for use in SideDrawer footer.\n *\n * Props:\n * - label string\n * - variant \"primary\" | \"secondary\" (default \"secondary\")\n * - onClick function\n * - disabled boolean\n */\nexport function DrawerButton({\n label,\n variant = \"secondary\",\n onClick,\n disabled,\n style,\n}) {\n const isPrimary = variant === \"primary\";\n\n return (\n <button\n onClick={onClick}\n disabled={disabled}\n style={{\n display: \"flex\",\n height: \"36px\",\n padding: \"0 20px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"8px\",\n borderRadius: \"6px\",\n border: isPrimary ? \"none\" : \"1px solid #D9D9D9\",\n background: isPrimary\n ? \"var(--Base-Strong, #0B0B0B)\"\n : \"var(--Base-White, #FFF)\",\n color: isPrimary ? \"#FFF\" : \"var(--Base-Strong, #1E1E1E)\",\n fontSize: \"16px\",\n fontWeight: 600,\n cursor: disabled ? \"default\" : \"pointer\",\n opacity: disabled ? 0.5 : 1,\n transition: \"all 0.15s ease\",\n ...style,\n }}\n onMouseEnter={(e) => {\n if (!disabled && !isPrimary) {\n e.currentTarget.style.background = \"#ECEEF2\";\n }\n }}\n onMouseLeave={(e) => {\n if (!disabled && !isPrimary) {\n e.currentTarget.style.background = \"var(--Base-White, #FFF)\";\n }\n }}\n >\n {label}\n </button>\n );\n}\n\n/**\n * DrawerLabel — form label for use inside SideDrawer.\n *\n * Props:\n * - children ReactNode\n * - htmlFor string\n */\nexport function DrawerLabel({ children, htmlFor }) {\n return (\n <label\n htmlFor={htmlFor}\n style={{\n display: \"block\",\n color: \"var(--Base-Strong, #2E3236)\",\n fontSize: \"16px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"normal\",\n marginBottom: \"6px\",\n }}\n >\n {children}\n </label>\n );\n}\n\n/**\n * DrawerInput — text input for use inside SideDrawer.\n *\n * Props:\n * - All standard <input> props (type, placeholder, value, onChange, etc.)\n */\nexport function DrawerInput(props) {\n return (\n <input\n {...props}\n style={{\n width: \"100%\",\n padding: \"10px 12px\",\n borderRadius: \"6px\",\n border: \"1px solid #D9D9D9\",\n color: \"var(--Base-Strong, #2E3236)\",\n fontSize: \"16px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"normal\",\n outline: \"none\",\n boxSizing: \"border-box\",\n background: \"#FFF\",\n transition: \"border-color 0.15s ease\",\n ...props.style,\n }}\n onFocus={(e) => {\n e.currentTarget.style.borderColor = \"#808183\";\n props.onFocus?.(e);\n }}\n onBlur={(e) => {\n e.currentTarget.style.borderColor = \"#D9D9D9\";\n props.onBlur?.(e);\n }}\n />\n );\n}\n"],"names":["SideDrawer","open","onClose","title","subtitle","children","footer","width","height","toggleLabel","toggleChecked","onToggle","topOffset","drawerRef","useRef","isPhone","useMediaQuery","hasTopOffset","normalizedTopOffset","useEffect","handleKey","e","jsxs","Fragment","jsx","X","DrawerButton","label","variant","onClick","disabled","style","isPrimary","DrawerLabel","htmlFor","DrawerInput","props","_a"],"mappings":";;;;AAuBA,SAAwBA,EAAW;AAAA,EACjC,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AACF,GAAG;AACK,QAAAC,IAAYC,EAAO,IAAI,GACvBC,IAAUC,EAAc,oBAAoB,GAC5CC,IAA0CL,KAAc,MACxDM,IAAsB,OAAON,KAAc,WAAW,GAAGA,CAAS,OAAOA;AAY/E,SATAO,EAAU,MAAM;AACd,QAAI,CAAClB;AAAM;AACL,UAAAmB,IAAY,CAACC,MAAM;AACvB,MAAIA,EAAE,QAAQ,aAAoBnB,KAAA,QAAAA;AAAA,IAAA;AAE3B,oBAAA,iBAAiB,WAAWkB,CAAS,GACvC,MAAM,SAAS,oBAAoB,WAAWA,CAAS;AAAA,EAAA,GAC7D,CAACnB,GAAMC,CAAO,CAAC,GAEbD,IAKD,gBAAAqB,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC;AAAA,M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A;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),v=require("../sortable.esm.cjs.js"),F=require("lucide-react"),rt=require("react-dom"),nt=require("../CustomFilterChips.cjs.js"),Et=require("../useMediaQuery.cjs.js"),$e=require("../DataTable2.cjs.js");require("motion/react");require("recharts");require("../AgentLiftAnalysisCard.cjs.js");require("../TourGuideTooltip.cjs.js");function Te(){return t.jsx("div",{style:{height:1,background:"rgba(52,58,64,0.08)"}})}function Ft({size:p=10,color:c="currentColor"}){return t.jsxs("svg",{width:p,height:p,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"},"aria-hidden":"true",children:[t.jsx("path",{d:"M3.5 8H12.5",stroke:c,strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M5 6.5L3.5 8L5 9.5",stroke:c,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M11 6.5L12.5 8L11 9.5",stroke:c,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M6.8 3V13",stroke:c,strokeWidth:"1.2",strokeLinecap:"round"}),t.jsx("path",{d:"M9.2 3V13",stroke:c,strokeWidth:"1.2",strokeLinecap:"round"})]})}const Lt=()=>({userData:{email:"anonymous"}}),Oe=p=>t.jsx("img",{...p});function Wt({children:p,content:c,direction:w="top",align:d="center",styling:j,indicatorColor:D}){const I=typeof c=="string"?c:c!=null?String(c):"",S=typeof D=="string"&&(D.startsWith("#")||D.startsWith("rgb")||D.startsWith("hsl")||D.startsWith("var("))?D:"var(--Grey-Strong, #2E3236)",[L,U]=i.useState(!1),[P,le]=i.useState(!1),[N,g]=i.useState({top:0,left:0,arrowLeft:0,placement:"top"}),x=i.useRef(null),M=i.useRef(null);if(!I)return p;i.useEffect(()=>{le(!0)},[]);const z=i.useCallback(()=>{if(!x.current||!M.current||typeof window>"u")return;const h=x.current.getBoundingClientRect(),k=M.current.getBoundingClientRect(),je=window.innerWidth,te=window.innerHeight,A=8,_=10,X=k.width,re=k.height,E=h.top,G=te-h.bottom,C=w==="bottom"?"bottom":"top";let J=C;C==="top"&&E<re+_+A&&G>E?J="bottom":C==="bottom"&&G<re+_+A&&E>G&&(J="top");let W=h.left+h.width/2;d==="start"&&(W=h.left),d==="end"&&(W=h.right);let B=J==="top"?h.top-re-_:h.bottom+_,R=d==="start"?W:d==="end"?W-X:W-X/2;B=Math.max(A,Math.min(B,te-re-A)),R=Math.max(A,Math.min(R,je-X-A));const Se=Math.max(10,Math.min(W-R,X-10));g({top:B,left:R,arrowLeft:Se,placement:J})},[d,w]);return i.useEffect(()=>{if(!L||!P)return;z();const h=()=>z();return window.addEventListener("resize",h),window.addEventListener("scroll",h,!0),()=>{window.removeEventListener("resize",h),window.removeEventListener("scroll",h,!0)}},[L,P,z]),t.jsxs("span",{ref:x,style:{display:"block",width:"100%"},onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!1),children:[p,L&&P&&rt.createPortal(t.jsxs("span",{ref:M,style:{position:"fixed",top:`${N.top}px`,left:`${N.left}px`,background:"var(--Grey-Strong, #2E3236)",color:"var(--Grey-White, #FFF)",fontSize:"12px",lineHeight:1.3,fontWeight:500,padding:"8px 10px",borderRadius:"6px",whiteSpace:"normal",maxWidth:"320px",width:"max-content",boxShadow:"0 6px 18px rgba(0, 0, 0, 0.2)",zIndex:99999,pointerEvents:"none",...typeof j=="object"?j:{}},children:[I,t.jsx("span",{style:{position:"absolute",left:`${N.arrowLeft}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",...N.placement==="top"?{top:"100%",borderTop:`7px solid ${S}`}:{bottom:"100%",borderBottom:`7px solid ${S}`}}})]}),document.body)]})}function Rt({data:p=[],columns:c=[],initialPageSize:w=10,onRowClick:d,totalCount:j=null,page:D=null,pageSize:I=null,onPageChange:S=null,onPageSizeChange:L=null,onFilterChange:U=null,columnFilters:P=null,onMaxColumnsError:le=null,onSort:N=null,sortFields:g=[],tableId:x=null,isLoading:M=!1,filtersConfig:z=null,columnResizeMinWidth:h=100,columnResizeMaxWidth:k=280,enableMobileCards:je=!0,onLoadMore:te=null,hasMore:A=null,mobileColumns:_=null,mobileFullLoading:X=!1}){var tt;const re=Et.useMediaQuery("(max-width: 640px)"),E=je&&re,{userData:G}=Lt(),C=(G==null?void 0:G.email)||"anonymous",J=i.memo(({children:e,content:r,className:n=""})=>{const s=i.useRef(null),[o,l]=i.useState(!1);i.useEffect(()=>{const u=()=>{if(s.current){const T=s.current.scrollWidth>s.current.clientWidth;l(T)}};u();const K=setTimeout(u,0);return window.addEventListener("resize",u),()=>{clearTimeout(K),window.removeEventListener("resize",u)}},[e,r]);const a=t.jsx("span",{className:`truncate block ${n}`,ref:s,children:e});return o&&r?t.jsx(Wt,{content:r,styling:"bg-green-2 text-gray-900 px-3 py-2 text-sm rounded-lg shadow-md border border-gray-300 max-w-xs whitespace-normal",indicatorColor:"bg-green-2",direction:"top",children:a}):a});J.displayName="TruncatedCell";const W=j!==null&&S!==null,B=U!==null,R=N!==null,[Se,ke]=i.useState(1),[st,ot]=i.useState(w),Ce=D!==null?D:Se,pe=I!==null?I:st,fe=e=>{S?S(e):ke(e)},Ie=e=>{L?L(e):ot(e)},V=9,b="action",Q=i.useRef(!1),ne=i.useMemo(()=>x?`dataTable_columns_${x}:${C}`:`dataTable_columns_${c.map(r=>r.id||r.key).sort().join("_")}:${C}`,[x,c,C]),se=i.useMemo(()=>x?`dataTable_manual_change_${x}:${C}`:null,[x,C]);i.useCallback((e,r)=>{if(typeof window>"u"||!e||!r||r.length===0)return null;try{const n=localStorage.getItem(e);if(n){const o=JSON.parse(n).filter(l=>r.some(a=>(a.id||a.key)===l));if(o.length>0)return o}}catch(n){console.warn("Failed to load saved columns from localStorage:",n)}return null},[]);const[Y,Pe]=i.useState({}),[Ae,it]=i.useState(null),[_e,Be]=i.useState("asc"),Ve=i.useCallback(e=>!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([,r])=>r==null?!1:typeof r=="string"?r.trim()!=="":!0)),[]),He=i.useCallback((e,r)=>{const n=Object.keys(e||{}),s=Object.keys(r||{});return n.length!==s.length?!1:n.every(o=>e[o]===r[o])},[]);i.useEffect(()=>{if(!B||P===null)return;const e=Ve(P);Pe(r=>He(r,e)?r:e)},[B,P,Ve,He]),i.useCallback((e,r)=>e==="csat_score"&&r==="evaluation.csat_score"?r:e,[]);const ce=R&&g.length>0?g[0][0]:Ae,xe=R&&g.length>0?g[0][1]:_e,[$t,qe]=i.useState(()=>c.map(e=>e.id||e.key)),H=i.useCallback(e=>{if(!e||e.length===0)return e;let r=Array.from(new Set(e));r.length>V&&(r=r.slice(0,V));const s=c.map(a=>a.id||a.key).includes(b);return!r.includes(b)&&s&&(r.length>=V?r=[...r.slice(0,V-1),b]:r=[...r,b]),[...r.filter(a=>a!==b),b]},[c]),[f,Z]=i.useState(()=>{if(typeof window<"u"&&x)try{if(localStorage.getItem(`dataTable_manual_change_${x}:${C}`)==="true"){const s=localStorage.getItem(`dataTable_columns_${x}:${C}`);if(s){const o=JSON.parse(s);if(Array.isArray(o)&&o.length>0){Q.current=!0;const l=o.filter(a=>c.some(u=>(u.id||u.key)===a));if(l.length>0)return l.slice(0,V)}}}}catch(n){console.warn("Failed to load saved columns from localStorage:",n)}const r=c.map(n=>n.id||n.key).slice(0,V);return H(r)}),[O,Ke]=i.useState(!1),[De,at]=i.useState({top:0,left:0,width:0}),[lt,Ue]=i.useState(new Set),[Xe,Ge]=i.useState(new Set),[q,Me]=i.useState(null),[ct,ge]=i.useState(null),oe=i.useRef(null),Ne=i.useRef(null),ie=i.useRef(null),[Je,ze]=i.useState(null),[Ee,dt]=i.useState({}),ut=i.useRef(null),he=i.useRef(null),y=e=>e.id||e.key,me=i.useCallback(e=>{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){const r=e.trim();if(r.endsWith("px")){const s=parseFloat(r);return Number.isFinite(s)?s:null}const n=parseFloat(r);return Number.isFinite(n)&&`${n}`===r?n:null}return null},[]),Fe=i.useCallback((e,r)=>Ee[e]!=null?`${Ee[e]}px`:typeof r=="number"?`${r}px`:r||"auto",[Ee]),be=i.useCallback(e=>{if(!he.current)return;const{columnId:r,startX:n,startWidth:s,minWidth:o,maxWidth:l}=he.current,a=e.clientX-n,u=Math.round(s+a),K=Math.min(l,Math.max(o,u));dt(T=>({...T,[r]:K}))},[]),de=i.useCallback(()=>{he.current=null,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",be),document.removeEventListener("mouseup",de)},[be]),pt=i.useCallback((e,r,n)=>{var ee;e.preventDefault(),e.stopPropagation();const s=r.id||r.key,o=me(r.minWidth)??h,l=me(r.maxWidth)??k,a=Math.min(o,l),u=Math.max(o,l),K=((ee=e.currentTarget.closest("th"))==null?void 0:ee.getBoundingClientRect().width)||0,T=me(n),ue=T??Math.max(a,Math.round(K)||a),Re=Math.min(u,Math.max(a,ue));he.current={columnId:s,startX:e.clientX,startWidth:Re,minWidth:a,maxWidth:u},document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",be),document.addEventListener("mouseup",de)},[k,h,be,de,me]);i.useEffect(()=>()=>de(),[de]);const ft=v.useSensors(v.useSensor(v.PointerSensor),v.useSensor(v.KeyboardSensor,{coordinateGetter:v.sortableKeyboardCoordinates})),xt=e=>{const{active:r,over:n}=e;if(n&&r.id!==n.id){if(r.id===b||n.id===b){Ye("Cannot drop columns on the Action column"),ze(null);return}Q.current=!0,Z(s=>{const o=s.indexOf(r.id),l=s.indexOf(n.id);if(o!==-1&&l!==-1){const a=v.arrayMove(s,o,l),u=H(a);return we(u),u}return s}),qe(s=>{const o=s.indexOf(r.id),l=s.indexOf(n.id);return v.arrayMove(s,o,l)})}ze(null)},gt=e=>{ze(e.active.id)},ye=i.useMemo(()=>B?p||[]:!p||p.length===0?[]:p.filter(e=>Object.keys(Y).every(r=>{const n=Y[r];if(!n||n.trim()==="")return!0;const s=e[r];if(s==null)return!1;const o=String(s).toLowerCase();return n.toLowerCase().trim().split(/\s+/).filter(u=>u.length>0).every(u=>o.includes(u))})),[p,Y,B]),ve=i.useMemo(()=>R||!ce?ye:[...ye].sort((e,r)=>{const n=e[ce],s=r[ce];if(n==null)return 1;if(s==null)return-1;if(typeof n=="number"&&typeof s=="number")return xe==="asc"?n-s:s-n;const o=String(n).toLowerCase(),l=String(s).toLowerCase();return xe==="asc"?o.localeCompare(l):l.localeCompare(o)}),[ye,ce,xe,R]),ae=i.useMemo(()=>{if(W)return p||[];{const e=(Ce-1)*pe,r=e+pe;return ve.slice(e,r)}},[p,ve,Ce,pe,W]),ht=e=>{R&&N?(N(e),S?S(1):ke(1)):(Ae===e?Be(_e==="asc"?"desc":"asc"):(it(e),Be("asc")),fe(1))},Qe=(e,r)=>{const n=r&&r.trim()!==""?{...Y,[e]:r}:Object.fromEntries(Object.entries(Y).filter(([s])=>s!==e));Pe(n),B&&U&&U(n),S?S(1):ke(1)},Ye=e=>{ie.current||(typeof le=="function"&&le(e),ie.current=setTimeout(()=>{ie.current=null},3e3))},we=i.useCallback(e=>{if(typeof window<"u"&&ne&&e.length>0&&Q.current)try{localStorage.setItem(ne,JSON.stringify(e)),se&&localStorage.setItem(se,"true")}catch(r){console.warn("Failed to save columns to localStorage:",r)}},[ne,se]),Le=e=>{e!==b&&(Q.current=!0,Z(r=>r.includes(e)?(ie.current&&(clearTimeout(ie.current),ie.current=null),r.length===1||(Ge(n=>new Set(n).add(e)),setTimeout(()=>{Z(n=>{const s=n.filter(l=>l!==e),o=H(s);return we(o),o}),Ge(n=>{const s=new Set(n);return s.delete(e),s})},200)),r):r.length>=V?(Ye("Maximum 9 column selection allowed"),r):(Ue(n=>new Set(n).add(e)),setTimeout(()=>{Z(n=>{const s=n.includes(e)?n:[...n,e],o=H(s);return we(o),o}),Ue(n=>{const s=new Set(n);return s.delete(e),s})},200),r)))},mt=(e,r)=>{f[r]!==b&&Me(r)},bt=()=>{Me(null),ge(null)},yt=(e,r)=>{e.preventDefault(),q!==null&&q!==r&&ge(r)},vt=()=>{ge(null)},wt=(e,r)=>{e.preventDefault(),q!==null&&q!==r&&f[r]!==b&&f[q]!==b&&(Q.current=!0,Z(n=>{const s=v.arrayMove(n,q,r),o=H(s);return we(o),o})),Me(null),ge(null)};i.useEffect(()=>{qe(e=>{const r=f.filter(o=>e.includes(o)),n=f.filter(o=>!e.includes(o)),s=e.filter(o=>!f.includes(o));return[...r,...n,...s]})},[f]),i.useEffect(()=>{if(typeof window<"u"&&ne&&f.length>0&&Q.current)try{const e=H(f);localStorage.setItem(ne,JSON.stringify(e)),se&&localStorage.setItem(se,"true")}catch(e){console.warn("Failed to save columns to localStorage:",e)}},[f,ne,se]),i.useEffect(()=>{if(c.length>0&&f.length===0){if(typeof window<"u"&&x)try{if(localStorage.getItem(`dataTable_manual_change_${x}:${C}`)==="true"){const n=localStorage.getItem(`dataTable_columns_${x}:${C}`);if(n){const s=JSON.parse(n);if(Array.isArray(s)&&s.length>0){const o=s.filter(l=>c.some(a=>(a.id||a.key)===l));if(o.length>0){Q.current=!0,Z(o.slice(0,V));return}}}}}catch(r){console.warn("Failed to load saved columns from localStorage:",r)}const e=c.map(r=>r.id||r.key);Z(H(e.slice(0,V)))}},[c,x,C,H]);const $=i.useMemo(()=>{const e=f.map(r=>c.find(n=>y(n)===r)).filter(Boolean);return H(e.map(y)).map(r=>c.find(n=>y(n)===r)).filter(Boolean)},[c,f]),jt=i.useMemo(()=>$.some(e=>e.filterable===!0),[$]),St=i.useMemo(()=>Array.isArray(_)&&_.length>0?_.filter(e=>y(e)!==b):$.filter(e=>y(e)!==b),[_,$]),kt=i.useRef(null),Ze=i.useRef(null),We=E&&typeof te=="function"&&(A!==null?A:j!==null&&((p==null?void 0:p.length)||0)<j);i.useEffect(()=>{if(!E||!We)return;const e=Ze.current;if(!e||typeof IntersectionObserver>"u")return;const r=new IntersectionObserver(n=>{var s;(s=n[0])!=null&&s.isIntersecting&&!M&&te()},{root:null,rootMargin:"120px"});return r.observe(e),()=>r.disconnect()},[E,We,M,te,p==null?void 0:p.length]),i.useEffect(()=>{if(!O||!oe.current)return;const e=()=>{if(oe.current){const r=oe.current.getBoundingClientRect();at({top:r.bottom,left:r.left,width:Math.max(r.width||220,220)})}};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[O]),i.useEffect(()=>{const e=r=>{O&&oe.current&&!oe.current.contains(r.target)&&Ne.current&&!Ne.current.contains(r.target)&&Ke(!1)};if(O)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[O]);const Ct=f.length===1?((tt=c.find(e=>(e.id||e.key)===f[0]))==null?void 0:tt.label)||"1 selected":`${f.length} selected`;function Dt({column:e,isHeaderRow:r=!0}){const n=y(e),s=n===b,o=Fe(n,e.width),{attributes:l,listeners:a,setNodeRef:u,transform:K,transition:T,isDragging:ue}=v.useSortable({id:n}),Re={transform:v.CSS.Transform.toString(K),transition:T,opacity:ue?.5:1,width:o,minWidth:o};let ee=!1;if(R&&g.length>0){const m=g[0][0];(m===n||m==="csat_score"&&n==="evaluation.csat_score")&&(ee=!0)}else ee=ce===n;const Nt=xe==="asc",zt=e.filterable===!0;return r?t.jsx("th",{ref:u,style:{...Re,padding:"12px 14px",textAlign:s?"center":"left",fontWeight:650,fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"rgba(30, 33, 37, 0.62)",cursor:e.sortable!==!1?"pointer":"default",width:o,borderRight:"1px solid rgba(52, 58, 64, 0.06)",userSelect:"none",background:"var(--primary-foreground)",borderBottom:"1px solid rgba(52, 58, 64, 0.12)",position:"sticky",top:0,zIndex:10,fontFamily:"var(--font-sans)"},children:t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",justifyContent:s?"center":"flex-start",position:"relative",minHeight:20},children:[!s&&t.jsx("div",{...l,...a,style:{cursor:"grab",color:"rgba(30, 33, 37, 0.32)"},children:t.jsx(F.GripVertical,{size:12})}),t.jsx("span",{onClick:()=>e.sortable!==!1&&ht(n),style:{cursor:e.sortable!==!1?"pointer":"default"},children:e.label.toUpperCase()}),e.sortable!==!1&&ee&&t.jsx("span",{children:Nt?t.jsx(F.ChevronUp,{size:12}):t.jsx(F.ChevronDown,{size:12})}),!s&&t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize ${e.label||n} column`,title:"Drag to resize column",onMouseDown:m=>pt(m,e,o),onClick:m=>m.stopPropagation(),style:{position:"absolute",top:0,right:-1,width:14,height:"100%",cursor:"col-resize",zIndex:4,display:"flex",alignItems:"center",justifyContent:"center",color:"rgba(30, 33, 37, 0.56)"},onMouseEnter:m=>{m.currentTarget.style.background="rgba(30, 33, 37, 0.08)",m.currentTarget.style.color="rgba(30, 33, 37, 0.86)"},onMouseLeave:m=>{m.currentTarget.style.background="transparent",m.currentTarget.style.color="rgba(30, 33, 37, 0.56)"},children:t.jsx(Ft,{size:10,color:"currentColor"})})]})}):t.jsx("th",{style:{width:o,minWidth:o,backgroundColor:"var(--primary-foreground)"},className:"sticky top-[57px] z-10 border-b border-[var(--border-strong)] px-4 py-2 text-left",children:zt?t.jsxs("div",{className:"relative",children:[t.jsx(F.Filter,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--text-faint)] pointer-events-none"}),t.jsx("input",{type:"text",placeholder:"Filter...",value:Y[n]||"",onChange:m=>{m.stopPropagation(),Qe(n,m.target.value)},onKeyDown:m=>m.stopPropagation(),onMouseDown:m=>m.stopPropagation(),className:"w-full pl-7 pr-2 py-1.5 text-xs border border-[var(--border)] rounded text-[var(--text-ink)] placeholder:text-[var(--text-faint)] focus:outline-none focus:border-[var(--border-hover)] focus:ring-1 focus:ring-[var(--focus)] transition-colors",style:{fontFamily:"var(--font-sans)",backgroundColor:"var(--primary-foreground)"},autoComplete:"off"})]}):t.jsx("div",{className:"h-[34px]"})})}const et=Je?c.find(e=>y(e)===Je):null,Mt=O?t.jsxs("div",{ref:Ne,className:"flex flex-col overflow-auto z-[49] min-w-[220px]",style:{position:"fixed",top:`${De.top}px`,left:`${De.left}px`,width:De.width||220,maxHeight:"400px",fontFamily:"var(--font-sans)",backgroundColor:"var(--primary-foreground)",borderRadius:"0 0 8px 8px",boxShadow:"4px 4px 6px 0px #6D70681A, -4px 0px 6px 0px #6D70681A",border:"1px solid rgba(52, 58, 64, 0.12)",borderTop:"none"},children:[f.map((e,r)=>{const n=c.find(u=>y(u)===e);if(!n)return null;const s=f.indexOf(e),o=q===s,l=ct===s,a=e===b;return t.jsxs(i.Fragment,{children:[t.jsxs("div",{draggable:!a,onDragStart:a?void 0:u=>mt(u,s),onDragEnd:a?void 0:bt,onDragOver:a?void 0:u=>yt(u,s),onDragLeave:a?void 0:vt,onDrop:a?void 0:u=>wt(u,s),className:`flex items-center gap-2 px-3 py-2 rounded transition-all ${a?"cursor-default opacity-100":"cursor-move"} ${!a&&o?"opacity-50":""} ${!a&&l&&q!==null&&q!==s?"ring-2 ring-green-2 ring-offset-1":""}`,children:[!a&&t.jsx("svg",{className:"h-4 w-4 text-gray-600 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8h16M4 12h16M4 16h16"})}),t.jsx("button",{type:"button",onClick:u=>{u.preventDefault(),u.stopPropagation(),a||Le(e)},className:`h-4 w-4 rounded-[2px] border flex items-center justify-center transition-colors flex-shrink-0 ${a?"bg-green-2 border-green-2 cursor-default":Xe.has(e)?"bg-white border-gray-300":"bg-green-2 border-green-2"}`,children:!Xe.has(e)&&t.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:3,style:{color:"#1E2125"},children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),t.jsx("span",{className:"text-sm text-gray-900 flex-1",style:{fontFamily:"var(--font-sans)"},children:n.label})]}),r<f.length-1&&t.jsx(Te,{})]},`selected-${e}-${r}`)}),c.filter(e=>!f.includes(y(e))).map((e,r)=>{const n=y(e),s=lt.has(n),o=c.filter(l=>!f.includes(y(l))).indexOf(e);return t.jsxs(i.Fragment,{children:[f.length>0&&o===0&&t.jsx(Te,{}),t.jsxs("label",{className:"flex items-center gap-2 px-3 py-2 hover:bg-gray-50 rounded cursor-pointer transition-colors",onClick:l=>{l.preventDefault(),Le(n)},children:[t.jsx("button",{type:"button",onClick:l=>{l.preventDefault(),l.stopPropagation(),Le(n)},className:`h-4 w-4 rounded-[2px] border flex items-center justify-center transition-colors flex-shrink-0 ${s?"bg-green-2 border-green-2":"bg-white border-gray-300"}`,children:s&&t.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:3,style:{color:"#1E2125"},children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),t.jsx("span",{className:"text-sm text-gray-900 flex-1",children:e.label})]}),o<c.filter(l=>!f.includes(y(l))).length-1&&t.jsx(Te,{})]},`unselected-${n}`)})]}):null;return t.jsxs("div",{className:"w-full",style:{backgroundColor:"var(--primary-foreground)",...E?{}:{top:"130px",position:"sticky",zIndex:35}},children:[!E&&c.length>0&&t.jsx("div",{className:"pt-2 pb-1",style:{position:"sticky",zIndex:35,backgroundColor:"var(--primary-foreground)"},children:t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t.jsxs("div",{className:"flex-shrink-0",children:[t.jsx("div",{className:"mb-1 ml-1.5",children:t.jsx("p",{className:"text-xs font-medium text-gray-600",style:{fontFamily:"var(--font-sans)"},children:"Select Columns"})}),t.jsxs("div",{ref:oe,className:"inline-flex items-center justify-between gap-2 px-4 py-2.5 cursor-pointer transition-colors text-sm font-medium text-gray-900 border border-gray-300 min-w-[220px]",onClick:()=>Ke(!O),style:{fontFamily:"var(--font-sans)",backgroundColor:"var(--primary-foreground)",borderRadius:O?"8px 8px 0 0":"8px"},children:[t.jsx("span",{children:Ct}),O?t.jsx(F.ChevronUp,{size:16}):t.jsx(F.ChevronDown,{size:16})]}),O&&rt.createPortal(Mt,document.body)]}),z&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"h-9 mt-[1.5rem] w-px bg-gray-300 flex-shrink-0"}),t.jsx("div",{className:"flex-shrink-0 mt-[1.5rem]",children:t.jsx($e.DataTableFilters,{dateRangePicker:z.dateRangePicker,onWeekToDate:z.onWeekToDate,exportConfig:z.exportConfig,filterChipsConfig:z.filterChipsConfig,trailingActions:z.trailingActions})})]})]})}),E&&c.length>0&&$.length>0&&t.jsxs("div",{ref:kt,className:"custom-thin-scrollbar-hidden",style:{marginTop:"0.5rem",overflowX:"clip",display:"flex",flexDirection:"column",gap:"12px",width:"100%",maxWidth:"100%",minWidth:0,boxSizing:"border-box"},children:[X?t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10px",padding:"56px 0"},children:[t.jsx(Oe,{src:"/BrandLoading.gif",alt:"Loading",width:48,height:48,unoptimized:!0}),t.jsx("span",{style:{fontSize:"12px",color:"rgba(30, 33, 37, 0.5)",fontFamily:"var(--font-sans)"},children:"Loading..."})]}):!M&&ae.length===0?t.jsx("div",{style:{padding:"32px",textAlign:"center",color:"rgba(30, 33, 37, 0.42)",fontSize:"13px",fontFamily:"var(--font-sans)"},children:"No results found"}):ae.map((e,r)=>t.jsx("div",{"data-row-id":e.id||r,onClick:d?n=>{n.stopPropagation(),d(e,r)}:void 0,style:{border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"14px",background:"var(--primary-foreground)",padding:"14px 16px",cursor:d?"pointer":"default",fontFamily:"var(--font-sans)",width:"100%",maxWidth:"100%",minWidth:0,boxSizing:"border-box"},children:t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px",minWidth:0},children:St.map(n=>{const s=y(n),o=e[s],l=n.render?n.render(o,e):o;return t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px"},children:[t.jsx("span",{style:{flexShrink:0,fontSize:"11px",fontWeight:650,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgba(30, 33, 37, 0.55)"},children:n.label}),t.jsx("span",{style:{flex:1,minWidth:0,textAlign:"right",fontSize:n.mobileEmphasis?"14px":"13px",fontWeight:n.mobileEmphasis?600:400,color:n.mobileEmphasis?"rgba(30, 33, 37, 0.95)":"rgba(30, 33, 37, 0.85)",wordBreak:"break-word",overflowWrap:"anywhere"},children:l})]},s)})})},e.id||r)),!X&&We&&t.jsx("div",{ref:Ze,style:{height:"1px"}}),!X&&M&&t.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"16px"},children:t.jsx(Oe,{src:"/BrandLoading.gif",alt:"Loading",width:36,height:36,unoptimized:!0})})]}),!E&&c.length>0&&$.length>0?t.jsxs(v.DndContext,{sensors:ft,collisionDetection:v.closestCenter,onDragStart:gt,onDragEnd:xt,children:[t.jsxs("div",{className:"rounded-[14px]",style:{border:"1px solid rgba(52, 58, 64, 0.12)",borderBottom:"1px solid rgba(52, 58, 64, 0.12)",overflow:"hidden",background:"var(--primary-foreground)",position:"relative",top:"0.5rem"},children:[M&&t.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(2px)",zIndex:20,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"14px"},children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px"},children:[t.jsx("p",{style:{fontSize:"13px",color:"rgba(30, 33, 37, 0.6)",margin:0},children:"Loading..."}),t.jsx(Oe,{src:"/BrandLoading.gif",alt:"Loading",width:50,height:50,unoptimized:!0,className:"mt-1"})]})}),t.jsx("div",{className:"overflow-x-auto custom-thin-scrollbar-hidden",ref:ut,style:{maxHeight:"500px",overflowY:"auto",position:"relative",zIndex:1},children:t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px",fontFamily:"var(--font-sans)"},children:[t.jsxs("thead",{children:[t.jsx("tr",{children:t.jsx(v.SortableContext,{items:f,strategy:v.horizontalListSortingStrategy,children:$.map(e=>t.jsx(Dt,{column:e,isHeaderRow:!0},`header-${y(e)}`))})}),jt&&t.jsx("tr",{children:$.map(e=>{const r=y(e),n=Fe(r,e.width),s=e.filterable===!0;return t.jsx("th",{style:{padding:"8px 14px",background:"var(--primary-foreground)",borderBottom:"1px solid rgba(52, 58, 64, 0.10)",position:"sticky",top:"41px",zIndex:10,width:n,fontFamily:"var(--font-sans)"},children:s?t.jsxs("div",{style:{position:"relative"},children:[t.jsx("input",{type:"text",placeholder:"Filter...",value:Y[r]||"",onChange:o=>{o.stopPropagation(),Qe(r,o.target.value)},onKeyDown:o=>o.stopPropagation(),onMouseDown:o=>o.stopPropagation(),style:{width:"100%",padding:"4px 8px 4px 26px",fontSize:"11.5px",border:"1px solid rgba(52, 58, 64, 0.16)",borderRadius:"6px",background:"var(--primary-foreground)",color:"rgba(30, 33, 37, 0.78)",outline:"none",fontFamily:"var(--font-sans)"},onFocus:o=>{o.target.style.borderColor="rgba(231, 212, 162, 0.65)",o.target.style.background="var(--primary-foreground)"},onBlur:o=>{o.target.style.borderColor="rgba(52, 58, 64, 0.16)",o.target.style.background="var(--primary-foreground)"},autoComplete:"off"}),t.jsx(F.Filter,{size:11,style:{position:"absolute",left:"8px",top:"50%",transform:"translateY(-50%)",color:"rgba(30, 33, 37, 0.42)",pointerEvents:"none"}})]}):t.jsx("div",{className:"h-[34px]"})},`filter-${r}`)})})]}),t.jsx("tbody",{children:!M&&ae.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:$.length,style:{padding:"32px",textAlign:"center",color:"rgba(30, 33, 37, 0.42)",fontSize:"12px",fontFamily:"var(--font-sans)"},children:"No results found"})}):!M&&ae.length>0?ae.map((e,r)=>t.jsx("tr",{"data-row-id":e.id||r,style:{borderBottom:"1px solid rgba(52, 58, 64, 0.08)",cursor:d?"pointer":"default",transition:"background 0.15s ease"},onClick:d?n=>{n.stopPropagation(),d(e,r)}:void 0,onMouseEnter:n=>{n.currentTarget.style.background="rgba(231, 212, 162, 0.12)"},onMouseLeave:n=>{n.currentTarget.style.background="transparent"},children:$.map(n=>{const s=y(n),o=Fe(s,n.width),l=e[s],a=n.render?n.render(l,e):l,u=o&&o!=="auto",K=typeof a=="string"&&a.trim()!=="",T=u&&K,ue=T?t.jsx(J,{content:a,children:a}):a;return t.jsx("td",{style:{padding:"10px 14px",color:"rgba(30, 33, 37, 0.78)",fontSize:"13px",borderRight:"1px solid rgba(52, 58, 64, 0.04)",width:o,fontFamily:"var(--font-sans)",...T&&{maxWidth:o||"200px"}},children:ue},s)})},r)):null})]})})]}),t.jsx(v.DragOverlay,{children:et?t.jsx("div",{className:"bg-[var(--paper-high)] border border-[var(--border-strong)] rounded px-4 py-2 shadow-lg",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(F.GripVertical,{size:14,className:"text-[var(--text-faint)]"}),t.jsx("span",{className:"text-sm font-semibold text-[var(--text-ink)]",children:et.label})]})}):null})]}):null,!E&&(W?j>0:ve.length>0)&&t.jsx("div",{className:"border-t border-gray-200 rounded-b-[14px]",style:{backgroundColor:"var(--primary-foreground)"},children:t.jsx(nt.Pagination,{page:Ce,pageSizeOptions:[5,10,20,50,100],pageSize:pe,totalCount:W?j:ve.length,currentDataLength:ae.length,onPageChange:fe,onPageSizeChange:L?e=>{Ie(e),fe(1)}:e=>{Ie(e),fe(1)},showPageSizeSelector:!0})})]})}function Tt({dateRangePicker:p,onWeekToDate:c,exportConfig:w,filterChipsConfig:d,trailingActions:j}){const[D,I]=i.useState(!1),S=i.useRef(null),L=i.useRef(null);i.useEffect(()=>{const g=x=>{L.current&&!L.current.contains(x.target)&&S.current&&!S.current.contains(x.target)&&I(!1)};if(D)return document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[D]);const U=()=>{I(g=>!g)},P=g=>{I(!1),w!=null&&w.onExport&&w.onExport(g)},N=(()=>{if(!(d!=null&&d.filters))return!1;const g=d.filters,x=d.customFilters||[],M=Object.entries(g).some(([h,k])=>!!(Array.isArray(k)&&k.length||typeof k=="string"&&k.trim()!==""||k&&typeof k=="object"&&(k.min!=null||k.max!=null))),z=x.some(h=>h.active);return M||z})();return t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c&&t.jsxs("button",{onClick:c,className:"inline-flex items-center gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 transition-colors hover:bg-white text-sm font-medium text-gray-900",style:{fontFamily:"var(--font-sans)"},children:[t.jsx(F.CalendarClock,{size:16}),t.jsx("span",{children:"Week to Date"})]}),p&&t.jsx(i.Suspense,{fallback:t.jsxs("div",{className:"inline-flex items-center gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 text-sm font-medium text-gray-400",children:[t.jsx(F.CalendarClock,{size:16}),t.jsx("span",{children:"Loading..."})]}),children:p}),w&&t.jsxs("div",{className:"relative",children:[t.jsxs("button",{ref:S,onClick:U,disabled:w.isExporting,className:"inline-flex items-center justify-between gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 transition-colors hover:bg-white text-sm font-medium text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed min-w-[120px]",style:{fontFamily:"var(--font-sans)"},children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(F.Download,{size:16}),t.jsx("span",{children:w.isExporting?"Exporting...":"Export"})]}),t.jsx(F.ChevronDown,{size:16})]}),D&&t.jsx("div",{ref:L,className:"absolute top-full right-0 mt-2 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50 min-w-[120px]",children:(w.types||["csv"]).map(g=>t.jsxs("button",{onClick:()=>P(g),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",style:{fontFamily:"var(--font-sans)"},children:["Export ",g.toUpperCase()]},g))})]}),(N||j)&&t.jsxs(t.Fragment,{children:[N&&t.jsx("div",{className:"h-9 mt-1 w-px bg-gray-300 flex-shrink-0"}),t.jsxs("div",{className:"flex items-center gap-3 justify-end",children:[N&&d&&t.jsx(nt.CustomFilterChips,{filters:d.filters,onChange:d.onChange,onClear:d.onClear,customFilters:d.customFilters||[],fieldOptions:d.fieldOptions||{}}),j&&t.jsx("div",{className:"flex-shrink-0",children:j})]})]})]})}function Ot({title:p="Summary stats",stats:c=[],columns:w=2}){return t.jsxs("div",{style:{fontFamily:"system-ui, -apple-system, sans-serif"},children:[t.jsx("div",{className:"text-[11px] tracking-[0.14em] uppercase mb-[10px]",style:{color:"rgba(30, 33, 37, 0.42)",fontWeight:650},children:p}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${w}, minmax(0, 1fr))`,gap:"10px"},children:c.map((d,j)=>t.jsxs("div",{style:{position:"relative",border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"12px",background:"rgba(255, 255, 255, 0.72)",padding:d.accentColor?"10px 10px 10px 14px":"10px",minHeight:"62px",display:"flex",flexDirection:"column",justifyContent:"center",gap:"5px",overflow:"hidden"},children:[d.accentColor&&t.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:"4px",background:d.accentColor,borderTopLeftRadius:"12px",borderBottomLeftRadius:"12px"}}),t.jsx("div",{className:"text-[10px] tracking-[0.14em] uppercase",style:{color:"rgba(30, 33, 37, 0.42)",fontWeight:650,lineHeight:1.1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d.label}),t.jsx("div",{style:{fontSize:"13px",color:d.valueStyle==="muted"?"rgba(30, 33, 37, 0.56)":"rgba(30, 33, 37, 0.78)",fontWeight:700,lineHeight:1.15,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:d.valueStyle==="mono"?"ui-monospace, monospace":"inherit"},children:d.value}),d.subtext&&t.jsx("div",{style:{fontSize:"11px",color:"rgba(30, 33, 37, 0.52)",lineHeight:1.15,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d.subtext})]},j))})]})}exports.DataTable2=$e.DataTable2;exports.DataTableFilters=$e.DataTableFilters;exports.DataTable=Rt;exports.DataTableFilters2=Tt;exports.SummaryStatsPanel=Ot;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("react"),w=require("../sortable.esm.cjs.js"),M=require("lucide-react"),ft=require("react-dom"),gt=require("../CustomFilterChips.cjs.js"),Ht=require("../useMediaQuery.cjs.js"),Ke=require("../DataTable2.cjs.js");require("motion/react");require("recharts");require("../AgentLiftAnalysisCard.cjs.js");require("../TourGuideTooltip.cjs.js");function He(){return r.jsx("div",{style:{height:1,background:"rgba(52,58,64,0.08)"}})}function qt({size:p=10,color:c="currentColor"}){return r.jsxs("svg",{width:p,height:p,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"},"aria-hidden":"true",children:[r.jsx("path",{d:"M3.5 8H12.5",stroke:c,strokeWidth:"1.4",strokeLinecap:"round"}),r.jsx("path",{d:"M5 6.5L3.5 8L5 9.5",stroke:c,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("path",{d:"M11 6.5L12.5 8L11 9.5",stroke:c,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("path",{d:"M6.8 3V13",stroke:c,strokeWidth:"1.2",strokeLinecap:"round"}),r.jsx("path",{d:"M9.2 3V13",stroke:c,strokeWidth:"1.2",strokeLinecap:"round"})]})}const Kt=()=>({userData:{email:"anonymous"}}),qe=p=>r.jsx("img",{...p});function Ut({children:p,content:c,direction:j="top",align:u="center",styling:C,indicatorColor:z}){const $=typeof c=="string"?c:c!=null?String(c):"",D=typeof z=="string"&&(z.startsWith("#")||z.startsWith("rgb")||z.startsWith("hsl")||z.startsWith("var("))?z:"var(--Grey-Strong, #2E3236)",[W,U]=i.useState(!1),[I,pe]=i.useState(!1),[L,g]=i.useState({top:0,left:0,arrowLeft:0,placement:"top"}),f=i.useRef(null),E=i.useRef(null);if(!$)return p;i.useEffect(()=>{pe(!0)},[]);const b=i.useCallback(()=>{if(!f.current||!E.current||typeof window>"u")return;const h=f.current.getBoundingClientRect(),F=E.current.getBoundingClientRect(),Le=window.innerWidth,se=window.innerHeight,B=8,_=10,X=F.width,R=F.height,Q=h.top,T=se-h.bottom,Y=j==="bottom"?"bottom":"top";let oe=Y;Y==="top"&&Q<R+_+B&&T>Q?oe="bottom":Y==="bottom"&&T<R+_+B&&Q>T&&(oe="top");let S=h.left+h.width/2;u==="start"&&(S=h.left),u==="end"&&(S=h.right);let Z=oe==="top"?h.top-R-_:h.bottom+_,k=u==="start"?S:u==="end"?S-X:S-X/2;Z=Math.max(B,Math.min(Z,se-R-B)),k=Math.max(B,Math.min(k,Le-X-B));const me=Math.max(10,Math.min(S-k,X-10));g({top:Z,left:k,arrowLeft:me,placement:oe})},[u,j]);return i.useEffect(()=>{if(!W||!I)return;b();const h=()=>b();return window.addEventListener("resize",h),window.addEventListener("scroll",h,!0),()=>{window.removeEventListener("resize",h),window.removeEventListener("scroll",h,!0)}},[W,I,b]),r.jsxs("span",{ref:f,style:{display:"block",width:"100%"},onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!1),children:[p,W&&I&&ft.createPortal(r.jsxs("span",{ref:E,style:{position:"fixed",top:`${L.top}px`,left:`${L.left}px`,background:"var(--Grey-Strong, #2E3236)",color:"var(--Grey-White, #FFF)",fontSize:"12px",lineHeight:1.3,fontWeight:500,padding:"8px 10px",borderRadius:"6px",whiteSpace:"normal",maxWidth:"320px",width:"max-content",boxShadow:"0 6px 18px rgba(0, 0, 0, 0.2)",zIndex:99999,pointerEvents:"none",...typeof C=="object"?C:{}},children:[$,r.jsx("span",{style:{position:"absolute",left:`${L.arrowLeft}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",...L.placement==="top"?{top:"100%",borderTop:`7px solid ${D}`}:{bottom:"100%",borderBottom:`7px solid ${D}`}}})]}),document.body)]})}function Xt({data:p=[],columns:c=[],initialPageSize:j=10,onRowClick:u,totalCount:C=null,page:z=null,pageSize:$=null,onPageChange:D=null,onPageSizeChange:W=null,onFilterChange:U=null,columnFilters:I=null,onMaxColumnsError:pe=null,onSort:L=null,sortFields:g=[],tableId:f=null,isLoading:E=!1,filtersConfig:b=null,columnResizeMinWidth:h=100,columnResizeMaxWidth:F=280,enableMobileCards:Le=!0,onLoadMore:se=null,hasMore:B=null,mobileColumns:_=null,mobileFullLoading:X=!1,selectable:R=!1,selectedRowIds:Q=null,onSelectionChange:T=null,getRowId:Y=null}){var xt;const oe=Ht.useMediaQuery("(max-width: 640px)"),S=Le&&oe,{userData:Z}=Kt(),k=(Z==null?void 0:Z.email)||"anonymous",me=i.memo(({children:e,content:t,className:s=""})=>{const o=i.useRef(null),[n,l]=i.useState(!1);i.useEffect(()=>{const d=()=>{if(o.current){const P=o.current.scrollWidth>o.current.clientWidth;l(P)}};d();const N=setTimeout(d,0);return window.addEventListener("resize",d),()=>{clearTimeout(N),window.removeEventListener("resize",d)}},[e,t]);const a=r.jsx("span",{className:`truncate block ${s}`,ref:o,children:e});return n&&t?r.jsx(Ut,{content:t,styling:"bg-green-2 text-gray-900 px-3 py-2 text-sm rounded-lg shadow-md border border-gray-300 max-w-xs whitespace-normal",indicatorColor:"bg-green-2",direction:"top",children:a}):a});me.displayName="TruncatedCell";const be=C!==null&&D!==null,xe=U!==null,ie=L!==null,[ht,We]=i.useState(1),[mt,bt]=i.useState(j),Re=z!==null?z:ht,ye=$!==null?$:mt,ve=e=>{D?D(e):We(e)},Ue=e=>{W?W(e):bt(e)},V=9,y="action",ee=i.useRef(!1),ae=i.useMemo(()=>f?`dataTable_columns_${f}:${k}`:`dataTable_columns_${c.map(t=>t.id||t.key).sort().join("_")}:${k}`,[f,c,k]),le=i.useMemo(()=>f?`dataTable_manual_change_${f}:${k}`:null,[f,k]);i.useCallback((e,t)=>{if(typeof window>"u"||!e||!t||t.length===0)return null;try{const s=localStorage.getItem(e);if(s){const n=JSON.parse(s).filter(l=>t.some(a=>(a.id||a.key)===l));if(n.length>0)return n}}catch(s){console.warn("Failed to load saved columns from localStorage:",s)}return null},[]);const[te,Xe]=i.useState({}),[Ge,yt]=i.useState(null),[Je,Qe]=i.useState("asc"),Ye=i.useCallback(e=>!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([,t])=>t==null?!1:typeof t=="string"?t.trim()!=="":!0)),[]),Ze=i.useCallback((e,t)=>{const s=Object.keys(e||{}),o=Object.keys(t||{});return s.length!==o.length?!1:s.every(n=>e[n]===t[n])},[]);i.useEffect(()=>{if(!xe||I===null)return;const e=Ye(I);Xe(t=>Ze(t,e)?t:e)},[xe,I,Ye,Ze]),i.useCallback((e,t)=>e==="csat_score"&&t==="evaluation.csat_score"?t:e,[]);const fe=ie&&g.length>0?g[0][0]:Ge,we=ie&&g.length>0?g[0][1]:Je,[Qt,et]=i.useState(()=>c.map(e=>e.id||e.key)),H=i.useCallback(e=>{if(!e||e.length===0)return e;let t=Array.from(new Set(e));t.length>V&&(t=t.slice(0,V));const o=c.map(a=>a.id||a.key).includes(y);return!t.includes(y)&&o&&(t.length>=V?t=[...t.slice(0,V-1),y]:t=[...t,y]),[...t.filter(a=>a!==y),y]},[c]),[x,re]=i.useState(()=>{if(typeof window<"u"&&f)try{if(localStorage.getItem(`dataTable_manual_change_${f}:${k}`)==="true"){const o=localStorage.getItem(`dataTable_columns_${f}:${k}`);if(o){const n=JSON.parse(o);if(Array.isArray(n)&&n.length>0){ee.current=!0;const l=n.filter(a=>c.some(d=>(d.id||d.key)===a));if(l.length>0)return l.slice(0,V)}}}}catch(s){console.warn("Failed to load saved columns from localStorage:",s)}const t=c.map(s=>s.id||s.key).slice(0,V);return H(t)}),[O,tt]=i.useState(!1),[Te,vt]=i.useState({top:0,left:0,width:0}),[wt,rt]=i.useState(new Set),[nt,st]=i.useState(new Set),[q,Oe]=i.useState(null),[jt,je]=i.useState(null),ce=i.useRef(null),Ae=i.useRef(null),de=i.useRef(null),[ot,Pe]=i.useState(null),[$e,St]=i.useState({}),kt=i.useRef(null),Se=i.useRef(null),v=e=>e.id||e.key,ke=i.useCallback(e=>{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){const t=e.trim();if(t.endsWith("px")){const o=parseFloat(t);return Number.isFinite(o)?o:null}const s=parseFloat(t);return Number.isFinite(s)&&`${s}`===t?s:null}return null},[]),Ie=i.useCallback((e,t)=>$e[e]!=null?`${$e[e]}px`:typeof t=="number"?`${t}px`:t||"auto",[$e]),Ce=i.useCallback(e=>{if(!Se.current)return;const{columnId:t,startX:s,startWidth:o,minWidth:n,maxWidth:l}=Se.current,a=e.clientX-s,d=Math.round(o+a),N=Math.min(l,Math.max(n,d));St(P=>({...P,[t]:N}))},[]),ge=i.useCallback(()=>{Se.current=null,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",Ce),document.removeEventListener("mouseup",ge)},[Ce]),Ct=i.useCallback((e,t,s)=>{var K;e.preventDefault(),e.stopPropagation();const o=t.id||t.key,n=ke(t.minWidth)??h,l=ke(t.maxWidth)??F,a=Math.min(n,l),d=Math.max(n,l),N=((K=e.currentTarget.closest("th"))==null?void 0:K.getBoundingClientRect().width)||0,P=ke(s),he=P??Math.max(a,Math.round(N)||a),ue=Math.min(d,Math.max(a,he));Se.current={columnId:o,startX:e.clientX,startWidth:ue,minWidth:a,maxWidth:d},document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",Ce),document.addEventListener("mouseup",ge)},[F,h,Ce,ge,ke]);i.useEffect(()=>()=>ge(),[ge]);const Dt=w.useSensors(w.useSensor(w.PointerSensor),w.useSensor(w.KeyboardSensor,{coordinateGetter:w.sortableKeyboardCoordinates})),Ft=e=>{const{active:t,over:s}=e;if(s&&t.id!==s.id){if(t.id===y||s.id===y){ct("Cannot drop columns on the Action column"),Pe(null);return}ee.current=!0,re(o=>{const n=o.indexOf(t.id),l=o.indexOf(s.id);if(n!==-1&&l!==-1){const a=w.arrayMove(o,n,l),d=H(a);return Ne(d),d}return o}),et(o=>{const n=o.indexOf(t.id),l=o.indexOf(s.id);return w.arrayMove(o,n,l)})}Pe(null)},Mt=e=>{Pe(e.active.id)},De=i.useMemo(()=>xe?p||[]:!p||p.length===0?[]:p.filter(e=>Object.keys(te).every(t=>{const s=te[t];if(!s||s.trim()==="")return!0;const o=e[t];if(o==null)return!1;const n=String(o).toLowerCase();return s.toLowerCase().trim().split(/\s+/).filter(d=>d.length>0).every(d=>n.includes(d))})),[p,te,xe]),Fe=i.useMemo(()=>ie||!fe?De:[...De].sort((e,t)=>{const s=e[fe],o=t[fe];if(s==null)return 1;if(o==null)return-1;if(typeof s=="number"&&typeof o=="number")return we==="asc"?s-o:o-s;const n=String(s).toLowerCase(),l=String(o).toLowerCase();return we==="asc"?n.localeCompare(l):l.localeCompare(n)}),[De,fe,we,ie]),G=i.useMemo(()=>{if(be)return p||[];{const e=(Re-1)*ye,t=e+ye;return Fe.slice(e,t)}},[p,Fe,Re,ye,be]),Me=i.useCallback((e,t)=>Y?Y(e,t):(e==null?void 0:e.id)??t,[Y]),J=i.useMemo(()=>new Set(Array.isArray(Q)?Q:[]),[Q]),ne=i.useMemo(()=>G.map((e,t)=>Me(e,t)),[G,Me]),it=i.useMemo(()=>ne.reduce((e,t)=>J.has(t)?e+1:e,0),[ne,J]),ze=ne.length>0&&it===ne.length,zt=it>0&&!ze,at=i.useCallback(e=>{if(!T)return;const t=new Set(J);t.has(e)?t.delete(e):t.add(e),T(Array.from(t))},[T,J]),Et=i.useCallback(()=>{if(!T)return;const e=new Set(J);ze?ne.forEach(t=>e.delete(t)):ne.forEach(t=>e.add(t)),T(Array.from(e))},[T,J,ze,ne]),Be=({checked:e,indeterminate:t=!1,onToggle:s,ariaLabel:o})=>r.jsx("span",{role:"checkbox","aria-checked":t?"mixed":e,"aria-label":o,tabIndex:0,onClick:n=>{n.stopPropagation(),s()},onKeyDown:n=>{(n.key===" "||n.key==="Enter")&&(n.preventDefault(),n.stopPropagation(),s())},style:{width:16,height:16,borderRadius:4,display:"inline-flex",alignItems:"center",justifyContent:"center",background:e||t?"#0B0B0B":"#FFFFFF",border:`1px solid ${e||t?"#0B0B0B":"#676767"}`,cursor:"pointer",flexShrink:0},children:t?r.jsx(M.Minus,{size:11,color:"#FFFFFF",strokeWidth:3}):e?r.jsx(M.Check,{size:11,color:"#FFFFFF",strokeWidth:3}):null}),Ee=20,Nt=e=>{ie&&L?(L(e),D?D(1):We(1)):(Ge===e?Qe(Je==="asc"?"desc":"asc"):(yt(e),Qe("asc")),ve(1))},lt=(e,t)=>{const s=t&&t.trim()!==""?{...te,[e]:t}:Object.fromEntries(Object.entries(te).filter(([o])=>o!==e));Xe(s),xe&&U&&U(s),D?D(1):We(1)},ct=e=>{de.current||(typeof pe=="function"&&pe(e),de.current=setTimeout(()=>{de.current=null},3e3))},Ne=i.useCallback(e=>{if(typeof window<"u"&&ae&&e.length>0&&ee.current)try{localStorage.setItem(ae,JSON.stringify(e)),le&&localStorage.setItem(le,"true")}catch(t){console.warn("Failed to save columns to localStorage:",t)}},[ae,le]),_e=e=>{e!==y&&(ee.current=!0,re(t=>t.includes(e)?(de.current&&(clearTimeout(de.current),de.current=null),t.length===1||(st(s=>new Set(s).add(e)),setTimeout(()=>{re(s=>{const o=s.filter(l=>l!==e),n=H(o);return Ne(n),n}),st(s=>{const o=new Set(s);return o.delete(e),o})},200)),t):t.length>=V?(ct("Maximum 9 column selection allowed"),t):(rt(s=>new Set(s).add(e)),setTimeout(()=>{re(s=>{const o=s.includes(e)?s:[...s,e],n=H(o);return Ne(n),n}),rt(s=>{const o=new Set(s);return o.delete(e),o})},200),t)))},Lt=(e,t)=>{x[t]!==y&&Oe(t)},Wt=()=>{Oe(null),je(null)},Rt=(e,t)=>{e.preventDefault(),q!==null&&q!==t&&je(t)},Tt=()=>{je(null)},Ot=(e,t)=>{e.preventDefault(),q!==null&&q!==t&&x[t]!==y&&x[q]!==y&&(ee.current=!0,re(s=>{const o=w.arrayMove(s,q,t),n=H(o);return Ne(n),n})),Oe(null),je(null)};i.useEffect(()=>{et(e=>{const t=x.filter(n=>e.includes(n)),s=x.filter(n=>!e.includes(n)),o=e.filter(n=>!x.includes(n));return[...t,...s,...o]})},[x]),i.useEffect(()=>{if(typeof window<"u"&&ae&&x.length>0&&ee.current)try{const e=H(x);localStorage.setItem(ae,JSON.stringify(e)),le&&localStorage.setItem(le,"true")}catch(e){console.warn("Failed to save columns to localStorage:",e)}},[x,ae,le]),i.useEffect(()=>{if(c.length>0&&x.length===0){if(typeof window<"u"&&f)try{if(localStorage.getItem(`dataTable_manual_change_${f}:${k}`)==="true"){const s=localStorage.getItem(`dataTable_columns_${f}:${k}`);if(s){const o=JSON.parse(s);if(Array.isArray(o)&&o.length>0){const n=o.filter(l=>c.some(a=>(a.id||a.key)===l));if(n.length>0){ee.current=!0,re(n.slice(0,V));return}}}}}catch(t){console.warn("Failed to load saved columns from localStorage:",t)}const e=c.map(t=>t.id||t.key);re(H(e.slice(0,V)))}},[c,f,k,H]);const A=i.useMemo(()=>{const e=x.map(t=>c.find(s=>v(s)===t)).filter(Boolean);return H(e.map(v)).map(t=>c.find(s=>v(s)===t)).filter(Boolean)},[c,x]),dt=i.useMemo(()=>A.some(e=>e.filterable===!0),[A]),At=i.useMemo(()=>Array.isArray(_)&&_.length>0?_.filter(e=>v(e)!==y):A.filter(e=>v(e)!==y),[_,A]),Pt=i.useRef(null),ut=i.useRef(null),Ve=S&&typeof se=="function"&&(B!==null?B:C!==null&&((p==null?void 0:p.length)||0)<C);i.useEffect(()=>{if(!S||!Ve)return;const e=ut.current;if(!e||typeof IntersectionObserver>"u")return;const t=new IntersectionObserver(s=>{var o;(o=s[0])!=null&&o.isIntersecting&&!E&&se()},{root:null,rootMargin:"120px"});return t.observe(e),()=>t.disconnect()},[S,Ve,E,se,p==null?void 0:p.length]),i.useEffect(()=>{if(!O||!ce.current)return;const e=()=>{if(ce.current){const t=ce.current.getBoundingClientRect();vt({top:t.bottom,left:t.left,width:Math.max(t.width||220,220)})}};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[O]),i.useEffect(()=>{const e=t=>{O&&ce.current&&!ce.current.contains(t.target)&&Ae.current&&!Ae.current.contains(t.target)&&tt(!1)};if(O)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[O]);const $t=x.length===1?((xt=c.find(e=>(e.id||e.key)===x[0]))==null?void 0:xt.label)||"1 selected":`${x.length} selected`;function It({column:e,isHeaderRow:t=!0}){const s=v(e),o=s===y,n=Ie(s,e.width),{attributes:l,listeners:a,setNodeRef:d,transform:N,transition:P,isDragging:he}=w.useSortable({id:s}),ue={transform:w.CSS.Transform.toString(N),transition:P,opacity:he?.5:1,width:n,minWidth:n};let K=!1;if(ie&&g.length>0){const m=g[0][0];(m===s||m==="csat_score"&&s==="evaluation.csat_score")&&(K=!0)}else K=fe===s;const _t=we==="asc",Vt=e.filterable===!0;return t?r.jsx("th",{ref:d,style:{...ue,padding:"12px 14px",textAlign:o?"center":"left",fontWeight:650,fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"rgba(30, 33, 37, 0.62)",cursor:e.sortable!==!1?"pointer":"default",width:n,borderRight:"1px solid rgba(52, 58, 64, 0.06)",userSelect:"none",background:"var(--primary-foreground)",borderBottom:"1px solid rgba(52, 58, 64, 0.12)",position:"sticky",top:0,zIndex:10,fontFamily:"var(--font-sans)"},children:r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",justifyContent:o?"center":"flex-start",position:"relative",minHeight:20},children:[!o&&r.jsx("div",{...l,...a,style:{cursor:"grab",color:"rgba(30, 33, 37, 0.32)"},children:r.jsx(M.GripVertical,{size:12})}),r.jsx("span",{onClick:()=>e.sortable!==!1&&Nt(s),style:{cursor:e.sortable!==!1?"pointer":"default"},children:e.label.toUpperCase()}),e.sortable!==!1&&K&&r.jsx("span",{children:_t?r.jsx(M.ChevronUp,{size:12}):r.jsx(M.ChevronDown,{size:12})}),!o&&r.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize ${e.label||s} column`,title:"Drag to resize column",onMouseDown:m=>Ct(m,e,n),onClick:m=>m.stopPropagation(),style:{position:"absolute",top:0,right:-1,width:14,height:"100%",cursor:"col-resize",zIndex:4,display:"flex",alignItems:"center",justifyContent:"center",color:"rgba(30, 33, 37, 0.56)"},onMouseEnter:m=>{m.currentTarget.style.background="rgba(30, 33, 37, 0.08)",m.currentTarget.style.color="rgba(30, 33, 37, 0.86)"},onMouseLeave:m=>{m.currentTarget.style.background="transparent",m.currentTarget.style.color="rgba(30, 33, 37, 0.56)"},children:r.jsx(qt,{size:10,color:"currentColor"})})]})}):r.jsx("th",{style:{width:n,minWidth:n,backgroundColor:"var(--primary-foreground)"},className:"sticky top-[57px] z-10 border-b border-[var(--border-strong)] px-4 py-2 text-left",children:Vt?r.jsxs("div",{className:"relative",children:[r.jsx(M.Filter,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--text-faint)] pointer-events-none"}),r.jsx("input",{type:"text",placeholder:"Filter...",value:te[s]||"",onChange:m=>{m.stopPropagation(),lt(s,m.target.value)},onKeyDown:m=>m.stopPropagation(),onMouseDown:m=>m.stopPropagation(),className:"w-full pl-7 pr-2 py-1.5 text-xs border border-[var(--border)] rounded text-[var(--text-ink)] placeholder:text-[var(--text-faint)] focus:outline-none focus:border-[var(--border-hover)] focus:ring-1 focus:ring-[var(--focus)] transition-colors",style:{fontFamily:"var(--font-sans)",backgroundColor:"var(--primary-foreground)"},autoComplete:"off"})]}):r.jsx("div",{className:"h-[34px]"})})}const pt=ot?c.find(e=>v(e)===ot):null,Bt=O?r.jsxs("div",{ref:Ae,className:"flex flex-col overflow-auto z-[49] min-w-[220px]",style:{position:"fixed",top:`${Te.top}px`,left:`${Te.left}px`,width:Te.width||220,maxHeight:"400px",fontFamily:"var(--font-sans)",backgroundColor:"var(--primary-foreground)",borderRadius:"0 0 8px 8px",boxShadow:"4px 4px 6px 0px #6D70681A, -4px 0px 6px 0px #6D70681A",border:"1px solid rgba(52, 58, 64, 0.12)",borderTop:"none"},children:[x.map((e,t)=>{const s=c.find(d=>v(d)===e);if(!s)return null;const o=x.indexOf(e),n=q===o,l=jt===o,a=e===y;return r.jsxs(i.Fragment,{children:[r.jsxs("div",{draggable:!a,onDragStart:a?void 0:d=>Lt(d,o),onDragEnd:a?void 0:Wt,onDragOver:a?void 0:d=>Rt(d,o),onDragLeave:a?void 0:Tt,onDrop:a?void 0:d=>Ot(d,o),className:`flex items-center gap-2 px-3 py-2 rounded transition-all ${a?"cursor-default opacity-100":"cursor-move"} ${!a&&n?"opacity-50":""} ${!a&&l&&q!==null&&q!==o?"ring-2 ring-green-2 ring-offset-1":""}`,children:[!a&&r.jsx("svg",{className:"h-4 w-4 text-gray-600 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8h16M4 12h16M4 16h16"})}),r.jsx("button",{type:"button",onClick:d=>{d.preventDefault(),d.stopPropagation(),a||_e(e)},className:`h-4 w-4 rounded-[2px] border flex items-center justify-center transition-colors flex-shrink-0 ${a?"bg-green-2 border-green-2 cursor-default":nt.has(e)?"bg-white border-gray-300":"bg-green-2 border-green-2"}`,children:!nt.has(e)&&r.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:3,style:{color:"#1E2125"},children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),r.jsx("span",{className:"text-sm text-gray-900 flex-1",style:{fontFamily:"var(--font-sans)"},children:s.label})]}),t<x.length-1&&r.jsx(He,{})]},`selected-${e}-${t}`)}),c.filter(e=>!x.includes(v(e))).map((e,t)=>{const s=v(e),o=wt.has(s),n=c.filter(l=>!x.includes(v(l))).indexOf(e);return r.jsxs(i.Fragment,{children:[x.length>0&&n===0&&r.jsx(He,{}),r.jsxs("label",{className:"flex items-center gap-2 px-3 py-2 hover:bg-gray-50 rounded cursor-pointer transition-colors",onClick:l=>{l.preventDefault(),_e(s)},children:[r.jsx("button",{type:"button",onClick:l=>{l.preventDefault(),l.stopPropagation(),_e(s)},className:`h-4 w-4 rounded-[2px] border flex items-center justify-center transition-colors flex-shrink-0 ${o?"bg-green-2 border-green-2":"bg-white border-gray-300"}`,children:o&&r.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:3,style:{color:"#1E2125"},children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),r.jsx("span",{className:"text-sm text-gray-900 flex-1",children:e.label})]}),n<c.filter(l=>!x.includes(v(l))).length-1&&r.jsx(He,{})]},`unselected-${s}`)})]}):null;return r.jsxs("div",{className:"w-full",style:{backgroundColor:"var(--primary-foreground)",...S?{}:{top:"130px",position:"sticky",zIndex:35}},children:[!S&&c.length>0&&r.jsx("div",{className:"pt-2 pb-1",style:{position:"sticky",zIndex:35,backgroundColor:"var(--primary-foreground)"},children:r.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[r.jsxs("div",{className:"flex-shrink-0",children:[r.jsx("div",{className:"mb-1 ml-1.5",children:r.jsx("p",{className:"text-xs font-medium text-gray-600",style:{fontFamily:"var(--font-sans)"},children:"Select Columns"})}),r.jsxs("div",{ref:ce,className:"inline-flex items-center justify-between gap-2 px-4 py-2.5 cursor-pointer transition-colors text-sm font-medium text-gray-900 border border-gray-300 min-w-[220px]",onClick:()=>tt(!O),style:{fontFamily:"var(--font-sans)",backgroundColor:"var(--primary-foreground)",borderRadius:O?"8px 8px 0 0":"8px"},children:[r.jsx("span",{children:$t}),O?r.jsx(M.ChevronUp,{size:16}):r.jsx(M.ChevronDown,{size:16})]}),O&&ft.createPortal(Bt,document.body)]}),b&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-9 mt-[1.5rem] w-px bg-gray-300 flex-shrink-0"}),r.jsx("div",{className:"flex-shrink-0 mt-[1.5rem]",children:r.jsx(Ke.DataTableFilters,{dateRangePicker:b.dateRangePicker,onWeekToDate:b.onWeekToDate,exportConfig:b.exportConfig,filterChipsConfig:b.filterChipsConfig,trailingActions:b.trailingActions})})]}),(b==null?void 0:b.rightActions)&&r.jsx("div",{className:"ml-auto mt-[1.5rem] flex items-center gap-3 flex-shrink-0",children:b.rightActions})]})}),S&&c.length>0&&A.length>0&&r.jsxs("div",{ref:Pt,className:"custom-thin-scrollbar-hidden",style:{marginTop:"0.5rem",overflowX:"clip",display:"flex",flexDirection:"column",gap:"12px",width:"100%",maxWidth:"100%",minWidth:0,boxSizing:"border-box"},children:[X?r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10px",padding:"56px 0"},children:[r.jsx(qe,{src:"/BrandLoading.gif",alt:"Loading",width:48,height:48,unoptimized:!0}),r.jsx("span",{style:{fontSize:"12px",color:"rgba(30, 33, 37, 0.5)",fontFamily:"var(--font-sans)"},children:"Loading..."})]}):!E&&G.length===0?r.jsx("div",{style:{padding:"32px",textAlign:"center",color:"rgba(30, 33, 37, 0.42)",fontSize:"13px",fontFamily:"var(--font-sans)"},children:"No results found"}):G.map((e,t)=>{const s=Me(e,t),o=R&&J.has(s);return r.jsxs("div",{"data-row-id":e.id||t,onClick:u?n=>{n.stopPropagation(),u(e,t)}:void 0,style:{border:o?"1px solid rgba(52, 58, 64, 0.35)":"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"14px",background:o?"rgba(231, 212, 162, 0.18)":"var(--primary-foreground)",padding:"14px 16px",cursor:u?"pointer":"default",fontFamily:"var(--font-sans)",width:"100%",maxWidth:"100%",minWidth:0,boxSizing:"border-box"},children:[R&&r.jsx("div",{onClick:n=>n.stopPropagation(),style:{display:"flex",justifyContent:"flex-end",marginBottom:"10px"},children:r.jsx(Be,{checked:o,onToggle:()=>at(s),ariaLabel:"Select row"})}),r.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px",minWidth:0},children:At.map(n=>{const l=v(n),a=e[l],d=n.render?n.render(a,e):a;return r.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px"},children:[r.jsx("span",{style:{flexShrink:0,fontSize:"11px",fontWeight:650,letterSpacing:"0.08em",textTransform:"uppercase",color:"rgba(30, 33, 37, 0.55)"},children:n.label}),r.jsx("span",{style:{flex:1,minWidth:0,textAlign:"right",fontSize:n.mobileEmphasis?"14px":"13px",fontWeight:n.mobileEmphasis?600:400,color:n.mobileEmphasis?"rgba(30, 33, 37, 0.95)":"rgba(30, 33, 37, 0.85)",wordBreak:"break-word",overflowWrap:"anywhere"},children:d})]},l)})})]},e.id||t)}),!X&&Ve&&r.jsx("div",{ref:ut,style:{height:"1px"}}),!X&&E&&r.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"16px"},children:r.jsx(qe,{src:"/BrandLoading.gif",alt:"Loading",width:36,height:36,unoptimized:!0})})]}),!S&&c.length>0&&A.length>0?r.jsxs(w.DndContext,{sensors:Dt,collisionDetection:w.closestCenter,onDragStart:Mt,onDragEnd:Ft,children:[r.jsxs("div",{className:"rounded-[14px]",style:{border:"1px solid rgba(52, 58, 64, 0.12)",borderBottom:"1px solid rgba(52, 58, 64, 0.12)",overflow:"hidden",background:"var(--primary-foreground)",position:"relative",top:"0.5rem"},children:[E&&r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(2px)",zIndex:20,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"14px"},children:r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px"},children:[r.jsx("p",{style:{fontSize:"13px",color:"rgba(30, 33, 37, 0.6)",margin:0},children:"Loading..."}),r.jsx(qe,{src:"/BrandLoading.gif",alt:"Loading",width:50,height:50,unoptimized:!0,className:"mt-1"})]})}),r.jsx("div",{className:"overflow-x-auto custom-thin-scrollbar-hidden",ref:kt,style:{maxHeight:"500px",overflowY:"auto",position:"relative",zIndex:1},children:r.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px",fontFamily:"var(--font-sans)"},children:[r.jsxs("thead",{children:[r.jsxs("tr",{children:[R&&r.jsx("th",{rowSpan:dt?2:1,style:{width:Ee,minWidth:Ee,padding:"10px 4px",textAlign:"center",background:"var(--primary-foreground)",borderBottom:"1px solid rgba(52, 58, 64, 0.10)",borderRight:"1px solid rgba(52, 58, 64, 0.04)",position:"sticky",top:0,zIndex:11,boxSizing:"border-box",verticalAlign:"middle"},children:r.jsx("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},children:r.jsx(Be,{checked:ze,indeterminate:zt,onToggle:Et,ariaLabel:"Select all rows on this page"})})}),r.jsx(w.SortableContext,{items:x,strategy:w.horizontalListSortingStrategy,children:A.map(e=>r.jsx(It,{column:e,isHeaderRow:!0},`header-${v(e)}`))})]}),dt&&r.jsx("tr",{children:A.map(e=>{const t=v(e),s=Ie(t,e.width),o=e.filterable===!0;return r.jsx("th",{style:{padding:"8px 14px",background:"var(--primary-foreground)",borderBottom:"1px solid rgba(52, 58, 64, 0.10)",position:"sticky",top:"41px",zIndex:10,width:s,fontFamily:"var(--font-sans)"},children:o?r.jsxs("div",{style:{position:"relative"},children:[r.jsx("input",{type:"text",placeholder:"Filter...",value:te[t]||"",onChange:n=>{n.stopPropagation(),lt(t,n.target.value)},onKeyDown:n=>n.stopPropagation(),onMouseDown:n=>n.stopPropagation(),style:{width:"100%",padding:"4px 8px 4px 26px",fontSize:"11.5px",border:"1px solid rgba(52, 58, 64, 0.16)",borderRadius:"6px",background:"var(--primary-foreground)",color:"rgba(30, 33, 37, 0.78)",outline:"none",fontFamily:"var(--font-sans)"},onFocus:n=>{n.target.style.borderColor="rgba(231, 212, 162, 0.65)",n.target.style.background="var(--primary-foreground)"},onBlur:n=>{n.target.style.borderColor="rgba(52, 58, 64, 0.16)",n.target.style.background="var(--primary-foreground)"},autoComplete:"off"}),r.jsx(M.Filter,{size:11,style:{position:"absolute",left:"8px",top:"50%",transform:"translateY(-50%)",color:"rgba(30, 33, 37, 0.42)",pointerEvents:"none"}})]}):r.jsx("div",{className:"h-[34px]"})},`filter-${t}`)})})]}),r.jsx("tbody",{children:!E&&G.length===0?r.jsx("tr",{children:r.jsx("td",{colSpan:A.length+(R?1:0),style:{padding:"32px",textAlign:"center",color:"rgba(30, 33, 37, 0.42)",fontSize:"12px",fontFamily:"var(--font-sans)"},children:"No results found"})}):!E&&G.length>0?G.map((e,t)=>{const s=Me(e,t),o=R&&J.has(s);return r.jsxs("tr",{"data-row-id":e.id||t,style:{borderBottom:"1px solid rgba(52, 58, 64, 0.08)",cursor:u?"pointer":"default",transition:"background 0.15s ease",background:o?"rgba(231, 212, 162, 0.18)":"transparent"},onClick:u?n=>{n.stopPropagation(),u(e,t)}:void 0,onMouseEnter:n=>{n.currentTarget.style.background="rgba(231, 212, 162, 0.12)"},onMouseLeave:n=>{n.currentTarget.style.background=o?"rgba(231, 212, 162, 0.18)":"transparent"},children:[R&&r.jsx("td",{onClick:n=>n.stopPropagation(),style:{width:Ee,minWidth:Ee,padding:"10px 4px",textAlign:"center",borderRight:"1px solid rgba(52, 58, 64, 0.04)",boxSizing:"border-box"},children:r.jsx("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},children:r.jsx(Be,{checked:o,onToggle:()=>at(s),ariaLabel:"Select row"})})}),A.map(n=>{const l=v(n),a=Ie(l,n.width),d=e[l],N=n.render?n.render(d,e):d,P=a&&a!=="auto",he=typeof N=="string"&&N.trim()!=="",ue=P&&he,K=ue?r.jsx(me,{content:N,children:N}):N;return r.jsx("td",{style:{padding:"10px 14px",color:"rgba(30, 33, 37, 0.78)",fontSize:"13px",borderRight:"1px solid rgba(52, 58, 64, 0.04)",width:a,fontFamily:"var(--font-sans)",...ue&&{maxWidth:a||"200px"}},children:K},l)})]},t)}):null})]})})]}),r.jsx(w.DragOverlay,{children:pt?r.jsx("div",{className:"bg-[var(--paper-high)] border border-[var(--border-strong)] rounded px-4 py-2 shadow-lg",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(M.GripVertical,{size:14,className:"text-[var(--text-faint)]"}),r.jsx("span",{className:"text-sm font-semibold text-[var(--text-ink)]",children:pt.label})]})}):null})]}):null,!S&&(be?C>0:Fe.length>0)&&r.jsx("div",{className:"border-t border-gray-200 rounded-b-[14px]",style:{backgroundColor:"var(--primary-foreground)"},children:r.jsx(gt.Pagination,{page:Re,pageSizeOptions:[5,10,20,50,100],pageSize:ye,totalCount:be?C:Fe.length,currentDataLength:G.length,onPageChange:ve,onPageSizeChange:W?e=>{Ue(e),ve(1)}:e=>{Ue(e),ve(1)},showPageSizeSelector:!0})})]})}function Gt({dateRangePicker:p,onWeekToDate:c,exportConfig:j,filterChipsConfig:u,trailingActions:C}){const[z,$]=i.useState(!1),D=i.useRef(null),W=i.useRef(null);i.useEffect(()=>{const g=f=>{W.current&&!W.current.contains(f.target)&&D.current&&!D.current.contains(f.target)&&$(!1)};if(z)return document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[z]);const U=()=>{$(g=>!g)},I=g=>{$(!1),j!=null&&j.onExport&&j.onExport(g)},L=(()=>{if(!(u!=null&&u.filters))return!1;const g=u.filters,f=u.customFilters||[],E=Object.entries(g).some(([h,F])=>!!(Array.isArray(F)&&F.length||typeof F=="string"&&F.trim()!==""||F&&typeof F=="object"&&(F.min!=null||F.max!=null))),b=f.some(h=>h.active);return E||b})();return r.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c&&r.jsxs("button",{onClick:c,className:"inline-flex items-center gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 transition-colors hover:bg-white text-sm font-medium text-gray-900",style:{fontFamily:"var(--font-sans)"},children:[r.jsx(M.CalendarClock,{size:16}),r.jsx("span",{children:"Week to Date"})]}),p&&r.jsx(i.Suspense,{fallback:r.jsxs("div",{className:"inline-flex items-center gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 text-sm font-medium text-gray-400",children:[r.jsx(M.CalendarClock,{size:16}),r.jsx("span",{children:"Loading..."})]}),children:p}),j&&r.jsxs("div",{className:"relative",children:[r.jsxs("button",{ref:D,onClick:U,disabled:j.isExporting,className:"inline-flex items-center justify-between gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 transition-colors hover:bg-white text-sm font-medium text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed min-w-[120px]",style:{fontFamily:"var(--font-sans)"},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(M.Download,{size:16}),r.jsx("span",{children:j.isExporting?"Exporting...":"Export"})]}),r.jsx(M.ChevronDown,{size:16})]}),z&&r.jsx("div",{ref:W,className:"absolute top-full right-0 mt-2 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50 min-w-[120px]",children:(j.types||["csv"]).map(g=>r.jsxs("button",{onClick:()=>I(g),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",style:{fontFamily:"var(--font-sans)"},children:["Export ",g.toUpperCase()]},g))})]}),(L||C)&&r.jsxs(r.Fragment,{children:[L&&r.jsx("div",{className:"h-9 mt-1 w-px bg-gray-300 flex-shrink-0"}),r.jsxs("div",{className:"flex items-center gap-3 justify-end",children:[L&&u&&r.jsx(gt.CustomFilterChips,{filters:u.filters,onChange:u.onChange,onClear:u.onClear,customFilters:u.customFilters||[],fieldOptions:u.fieldOptions||{}}),C&&r.jsx("div",{className:"flex-shrink-0",children:C})]})]})]})}function Jt({title:p="Summary stats",stats:c=[],columns:j=2}){return r.jsxs("div",{style:{fontFamily:"system-ui, -apple-system, sans-serif"},children:[r.jsx("div",{className:"text-[11px] tracking-[0.14em] uppercase mb-[10px]",style:{color:"rgba(30, 33, 37, 0.42)",fontWeight:650},children:p}),r.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${j}, minmax(0, 1fr))`,gap:"10px"},children:c.map((u,C)=>r.jsxs("div",{style:{position:"relative",border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"12px",background:"rgba(255, 255, 255, 0.72)",padding:u.accentColor?"10px 10px 10px 14px":"10px",minHeight:"62px",display:"flex",flexDirection:"column",justifyContent:"center",gap:"5px",overflow:"hidden"},children:[u.accentColor&&r.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:"4px",background:u.accentColor,borderTopLeftRadius:"12px",borderBottomLeftRadius:"12px"}}),r.jsx("div",{className:"text-[10px] tracking-[0.14em] uppercase",style:{color:"rgba(30, 33, 37, 0.42)",fontWeight:650,lineHeight:1.1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:u.label}),r.jsx("div",{style:{fontSize:"13px",color:u.valueStyle==="muted"?"rgba(30, 33, 37, 0.56)":"rgba(30, 33, 37, 0.78)",fontWeight:700,lineHeight:1.15,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:u.valueStyle==="mono"?"ui-monospace, monospace":"inherit"},children:u.value}),u.subtext&&r.jsx("div",{style:{fontSize:"11px",color:"rgba(30, 33, 37, 0.52)",lineHeight:1.15,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:u.subtext})]},C))})]})}exports.DataTable2=Ke.DataTable2;exports.DataTableFilters=Ke.DataTableFilters;exports.DataTable=Xt;exports.DataTableFilters2=Gt;exports.SummaryStatsPanel=Jt;
2
2
  //# sourceMappingURL=data.cjs.js.map