chordia-ui 3.6.4 → 3.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Toast.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";const e=require("react/jsx-runtime"),x=require("react"),j=require("motion/react"),y=require("lucide-react"),z=require("./ChartRenderer.cjs.js"),M=require("./TextInput.cjs.js"),D=require("./SmallButton.cjs.js");function R({size:t=48,isHovered:n=!1}){return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flexShrink:0,display:"block"},children:[e.jsx(j.motion.rect,{width:"48",height:"48",fill:"#2E3236",initial:{rx:12},animate:{rx:n?24:12},transition:{type:"spring",stiffness:400,damping:30}}),e.jsx("path",{d:"M42.7803 24.0713C42.7803 19.3098 41.002 14.9639 38.0723 11.6611C34.6441 7.7964 29.6419 5.36331 24.0713 5.36328C18.5958 5.36328 13.6718 7.71492 10.249 11.4648C7.2131 14.7919 5.36329 19.2146 5.36328 24.0723C5.36328 29.4538 7.63513 34.3049 11.2744 37.7188L11.5918 38.0098C14.9101 40.9752 19.4232 42.7803 24.0723 42.7803C28.8742 42.7803 33.2527 40.9725 36.5654 37.998C40.3821 34.5709 42.7803 29.6014 42.7803 24.0713ZM44.1436 24.0713C44.1435 30.0044 41.5678 35.3371 37.4756 39.0117C33.9225 42.202 29.2231 44.1436 24.0723 44.1436C18.919 44.1436 13.9333 42.0823 10.3418 38.7129C6.43938 35.0522 4 29.8457 4 24.0723C4.00001 18.8616 5.98619 14.1142 9.24219 10.5459C12.9121 6.52517 18.1968 4 24.0713 4C30.0479 4.00003 35.416 6.61368 39.0918 10.7578C42.2339 14.3002 44.1436 18.964 44.1436 24.0713Z",fill:"#E8D4A3"}),e.jsx("path",{d:"M40.333 24.0725C40.333 19.8532 38.7227 16.0102 36.083 13.1252L36.0811 13.1233C33.1126 9.85842 28.832 7.80986 24.0713 7.80981C19.3005 7.80981 15.0105 9.86403 12.0352 13.137C9.40921 16.0256 7.80859 19.8614 7.80859 24.0725C7.80864 28.7008 10.0684 32.4554 13.2617 35.4573C16.2162 38.2352 19.9065 40.3342 24.0713 40.3342C28.2888 40.3342 32.1311 38.7277 35.0195 36.093L35.3223 35.8108C38.4111 32.852 40.333 28.6868 40.333 24.0725ZM41.5254 24.0725C41.5253 29.185 39.3252 33.7854 35.8223 36.9749C32.7229 39.8016 28.5972 41.5266 24.0713 41.5266C19.4923 41.5266 15.5242 39.2213 12.4453 36.3264C9.09752 33.1794 6.61724 29.1313 6.61719 24.0725C6.61719 19.5535 8.33492 15.4346 11.1523 12.3352C14.3441 8.82416 18.9506 6.61841 24.0713 6.61841C29.1808 6.61845 33.7769 8.81742 36.9619 12.3196C39.7951 15.4158 41.5254 19.5436 41.5254 24.0725Z",fill:"#C1D89F"}),e.jsx("path",{d:"M37.8867 24.0725C37.8867 20.3937 36.437 17.0596 34.0918 14.5842C31.5737 11.9261 28.02 10.2561 24.0713 10.2561C20.0051 10.2561 16.3493 12.0119 13.8213 14.8079C11.6042 17.2591 10.2549 20.508 10.2549 24.0725C10.255 27.9518 12.4926 30.595 15.251 33.1965C17.8271 35.6258 20.5283 37.8879 24.0713 37.8879C27.7054 37.8879 31.0113 36.4826 33.4756 34.1868C36.1894 31.6665 37.8867 28.0684 37.8867 24.0725ZM38.9092 24.0725C38.9091 28.3641 37.084 32.2294 34.1709 34.9348C31.525 37.3999 27.9741 38.9104 24.0713 38.9104C20.0772 38.9104 17.1052 36.3484 14.5508 33.9397H14.5498C11.7673 31.3154 9.23347 28.4104 9.2334 24.0725C9.2334 20.245 10.683 16.7541 13.0635 14.1223L13.3213 13.845C16.0229 11.0055 19.8407 9.23462 24.0713 9.23462C28.315 9.23466 32.1331 11.03 34.834 13.8811C37.3496 16.5365 38.9092 20.1189 38.9092 24.0725Z",fill:"#9BDB9C"}),e.jsx("path",{d:"M35.4395 24.0713C35.4395 20.934 34.1591 18.1016 32.1025 16.0439C30.0461 13.9864 27.2106 12.7022 24.0713 12.7021H23.9922C20.6631 12.7245 17.6733 14.1772 15.6074 16.4785C13.8003 18.4924 12.7012 21.1526 12.7012 24.0713C12.7012 25.6404 13.254 26.8046 14.0918 27.8496C14.9513 28.9216 16.0706 29.8274 17.2393 30.9336C17.7745 31.4407 18.2978 31.9913 18.8096 32.5107C19.3268 33.0357 19.84 33.5376 20.3809 33.9746C21.458 34.8449 22.6194 35.4414 24.0703 35.4414C27.1211 35.4413 29.8896 34.2382 31.9297 32.2812V32.2803C34.0921 30.2141 35.4394 27.2081 35.4395 24.0713ZM36.291 24.0713C36.291 27.341 34.9333 30.4712 32.7334 32.6846L32.5186 32.8955C30.3264 34.9983 27.3496 36.2929 24.0703 36.293C22.3559 36.293 21.0106 35.5779 19.8457 34.6367C19.2657 34.1681 18.7249 33.638 18.2031 33.1084C17.6759 32.5733 17.1754 32.0455 16.6543 31.5518V31.5527C15.5515 30.5088 14.3349 29.5146 13.4268 28.3818C12.497 27.2221 11.8497 25.8757 11.8496 24.0713C11.8496 20.9343 13.0317 18.0732 14.9736 15.9092H14.9746C17.2113 13.4178 20.4583 11.8496 24.0703 11.8496H24.2461L24.249 11.8535C27.5552 11.9012 30.5353 13.2725 32.7041 15.4424L33.1084 15.8662C35.079 18.0332 36.291 20.9074 36.291 24.0713Z",fill:"#74DF98"}),e.jsx("path",{d:"M32.9941 24.0725C32.9941 21.4749 31.8844 19.1375 30.1133 17.5061C28.5336 16.0513 26.4292 15.1609 24.1152 15.1497H24.0703C21.4136 15.1497 19.0292 16.3095 17.3945 18.1516C15.996 19.7271 15.1475 21.8001 15.1475 24.0725C15.1475 25.2559 15.6746 25.9577 16.4512 26.5891C16.8499 26.9133 17.2998 27.2072 17.7852 27.5413C18.2636 27.8706 18.7652 28.2327 19.2285 28.6741C19.6676 29.0922 20.0478 29.5868 20.4033 30.0774C20.7649 30.5763 21.0959 31.0625 21.458 31.5051C22.1753 32.3819 22.9426 32.9954 24.0703 32.9954C26.5368 32.9953 28.7688 31.9943 30.3848 30.3762C31.9974 28.7615 32.9941 26.5337 32.9941 24.0725ZM33.6748 24.0725C33.6747 26.7213 32.6022 29.1203 30.8672 30.8577C29.1287 32.5985 26.725 33.6759 24.0703 33.676C22.6373 33.676 21.6959 32.872 20.9307 31.9368C20.5517 31.4735 20.1972 30.9548 19.8516 30.4778C19.5877 30.1137 19.325 29.7684 19.0449 29.4612L18.7588 29.1672C18.3364 28.7649 17.8721 28.4281 17.3994 28.1028C16.934 27.7824 16.4479 27.4651 16.0215 27.1184C15.1475 26.4078 14.4659 25.5291 14.4658 24.0725C14.4658 21.6272 15.3799 19.3948 16.8848 17.6995L17.2236 17.3362C18.9317 15.6 21.2965 14.5141 23.916 14.4729L23.9209 14.467H24.0713C26.5802 14.4671 28.8638 15.4298 30.5742 17.0051C32.4796 18.7601 33.6748 21.2765 33.6748 24.0725Z",fill:"#4DE294"})]})}function W({size:t=48}){return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flexShrink:0,display:"block",aspectRatio:"1/1"},children:[e.jsx("path",{d:"M46.3699 23.9994C46.3699 18.306 44.2436 13.1097 40.7405 9.16048C36.6415 4.53939 30.6603 1.63013 23.9994 1.63009C17.4524 1.63009 11.5646 4.44196 7.47201 8.92578C3.84193 12.904 1.6301 18.1922 1.63009 24.0006C1.63009 30.4354 4.34656 36.2358 8.69808 40.3178L9.07758 40.6658C13.0453 44.2116 18.4416 46.3699 24.0006 46.3699C29.7423 46.3699 34.9777 44.2084 38.9388 40.6518C43.5023 36.5539 46.3699 30.6118 46.3699 23.9994ZM48 23.9994C48 31.0937 44.9202 37.4701 40.0271 41.8638C35.7786 45.6785 30.1595 48 24.0006 48C17.8388 48 11.8773 45.5353 7.58294 41.5065C2.91679 37.1294 0 30.9039 0 24.0006C1.39062e-05 17.7702 2.37491 12.0936 6.26813 7.82699C10.6563 3.01936 16.9753 0 23.9994 0C31.1457 3.78892e-05 37.5643 3.1252 41.9596 8.08038C45.7166 12.316 48 17.8926 48 23.9994Z",fill:"#E8D4A3"}),e.jsx("path",{d:"M43.4432 24.0009C43.4432 18.9559 41.5178 14.3607 38.3614 10.9111L38.3591 10.9088C34.8097 7.00497 29.6913 4.55549 23.9989 4.55543C18.2944 4.55543 13.1649 7.01168 9.60722 10.9252C6.46736 14.3791 4.55348 18.9657 4.55348 24.0009C4.55354 29.535 7.25552 34.0243 11.0738 37.6137C14.6065 40.9353 19.0191 43.4452 23.9989 43.4452C29.0418 43.4451 33.6361 41.5242 37.0898 38.3739L37.4518 38.0364C41.1451 34.4986 43.4432 29.5182 43.4432 24.0009ZM44.8689 24.0009C44.8689 30.1139 42.2382 35.6146 38.0497 39.4283C34.3437 42.8083 29.4106 44.8709 23.9989 44.8709C18.5237 44.8709 13.7791 42.1144 10.0976 38.653C6.09466 34.8901 3.12896 30.0497 3.12891 24.0009C3.12891 18.5975 5.18282 13.6724 8.55163 9.96648C12.3681 5.76829 17.876 3.13086 23.9989 3.13086C30.1084 3.13091 35.604 5.76024 39.4124 9.9478C42.8001 13.6499 44.8689 18.5856 44.8689 24.0009Z",fill:"#C1D89F"}),e.jsx("path",{d:"M40.5188 24.0008C40.5188 19.602 38.7853 15.6155 35.9812 12.6556C32.9704 9.47725 28.7211 7.48048 23.9996 7.48043C19.1376 7.48043 14.7663 9.5798 11.7436 12.923C9.09255 15.8539 7.47921 19.7387 7.47921 24.0008C7.4793 28.6393 10.1548 31.7998 13.4531 34.9105C16.5334 37.8152 19.7632 40.5201 23.9996 40.5201C28.3449 40.52 32.2979 38.8397 35.2444 36.0945C38.4893 33.0811 40.5188 28.7787 40.5188 24.0008ZM41.7414 24.0008C41.7413 29.1323 39.559 33.754 36.0758 36.989C32.9121 39.9365 28.6662 41.7426 23.9996 41.7426C19.2238 41.7426 15.6702 38.6792 12.6159 35.7991H12.6147C9.28764 32.6613 6.2579 29.1876 6.25781 24.0008C6.25781 19.4242 7.99112 15.2501 10.8375 12.1033L11.1457 11.7717C14.376 8.37646 18.941 6.25903 23.9996 6.25903C29.0739 6.25908 33.6392 8.40576 36.8687 11.8149C39.8766 14.9899 41.7414 19.2735 41.7414 24.0008Z",fill:"#9BDB9C"}),e.jsx("path",{d:"M37.5923 23.9993C37.5923 20.2481 36.0614 16.8614 33.6023 14.4009C31.1434 11.9407 27.753 10.4052 23.9993 10.4051H23.9047C19.9241 10.4318 16.3492 12.1689 13.879 14.9206C11.7182 17.3286 10.404 20.5094 10.404 23.9993C10.404 25.8755 11.065 27.2676 12.0667 28.5171C13.0945 29.7989 14.4328 30.8819 15.8302 32.2046C16.4702 32.811 17.0959 33.4693 17.7078 34.0904C18.3263 34.7181 18.9399 35.3182 19.5866 35.8408C20.8746 36.8814 22.2632 37.5947 23.9981 37.5947C26.9471 37.5946 29.6159 33.4731 31.5481 31.5384C33.4763 29.6076 34.6681 26.9438 34.6681 24.001ZM35.482 24.001C35.4819 27.1682 34.1995 30.0367 32.1249 32.114C30.0462 34.1956 27.1721 35.4839 23.9978 35.484C22.2843 35.484 21.1587 34.5226 20.2437 33.4043C19.7906 32.8504 19.3668 32.2301 18.9535 31.6598C18.638 31.2245 18.3238 30.8116 17.9889 30.4443L17.6468 30.0928C17.1418 29.6117 16.5865 29.209 16.0214 28.82C15.4649 28.437 14.8837 28.0575 14.3738 27.643C13.3287 26.7933 12.5138 25.7426 12.5137 24.001C12.5137 21.0771 13.6066 18.4078 15.406 16.3807L15.8112 15.9463C17.8536 13.8703 20.6812 12.5718 23.8134 12.5226L23.8192 12.5156H23.999C26.9989 12.5157 29.7294 13.6668 31.7746 15.5504C34.053 17.6489 35.482 20.6577 35.482 24.001Z",fill:"#74DF98"}),e.jsx("path",{d:"M34.6681 24.001C34.6681 20.895 33.3413 18.1002 31.2235 16.1495C29.3347 14.4099 26.8184 13.3452 24.0516 13.3318H23.9978C20.8212 13.3318 17.9701 14.7186 16.0156 16.9213C14.3434 18.8051 13.3287 21.2838 13.3287 24.001C13.3288 25.4159 13.959 26.2551 14.8876 27.0101C15.3643 27.3977 15.9022 27.7491 16.4826 28.1486C17.0547 28.5424 17.6545 28.9754 18.2085 29.5031C18.7335 30.003 19.1881 30.5945 19.6132 31.1811C20.0455 31.7776 20.4414 32.359 20.8743 32.8882C21.732 33.9366 22.6494 34.6701 23.9978 34.6701C26.9471 34.67 29.6159 33.4731 31.5481 31.5384C33.4763 29.6076 34.6681 26.9438 34.6681 24.001ZM35.482 24.001C35.4819 27.1682 34.1995 30.0367 32.1249 32.114C30.0462 34.1956 27.1721 35.4839 23.9978 35.484C22.2843 35.484 21.1587 34.5226 20.2437 33.4043C19.7906 32.8504 19.3668 32.2301 18.9535 31.6598C18.638 31.2245 18.3238 30.8116 17.9889 30.4443L17.6468 30.0928C17.1418 29.6117 16.5865 29.209 16.0214 28.82C15.4649 28.437 14.8837 28.0575 14.3738 27.643C13.3287 26.7933 12.5138 25.7426 12.5137 24.001C12.5137 21.0771 13.6066 18.4078 15.406 16.3807L15.8112 15.9463C17.8536 13.8703 20.6812 12.5718 23.8134 12.5226L23.8192 12.5156H23.999C26.9989 12.5157 29.7294 13.6668 31.7746 15.5504C34.053 17.6489 35.482 20.6577 35.482 24.001Z",fill:"#4DE294"})]})}function H({onSend:t,onHistoryClick:n,messages:r=[],loading:o=!1,statusLabel:d}){const[a,l]=x.useState(""),f=x.useRef(null);x.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},[r]);const i=()=>{const s=a.trim();!s||o||(t==null||t(s),l(""))},C=s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),i())},u=r.length>0;return e.jsxs(j.motion.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{type:"spring",stiffness:400,damping:30},style:{display:"flex",width:360,height:709,padding:24,flexDirection:"column",justifyContent:"space-between",borderRadius:16,border:"2px solid var(--Rail-Surface-2, #E3E1D7)",background:"var(--Grey-White, #FFF)",boxSizing:"border-box"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("div",{style:{display:"flex",width:34,height:34,justifyContent:"center",alignItems:"center",aspectRatio:"1/1",borderRadius:9999,background:"#F3F7F7"},children:e.jsx(y.MessageCircleQuestion,{size:20,style:{color:"var(--Grey-Strong, #2E3236)"}})}),e.jsx("span",{style:{fontSize:16,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:"120%"},children:"Ask Compass"})]}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:8},children:e.jsxs("button",{onClick:n,style:{display:"flex",height:28,padding:"8px 12px",justifyContent:"center",alignItems:"center",gap:8,borderRadius:10,border:"1px solid var(--Neutral-250, #BFBFBF)",background:"none",cursor:"pointer",color:"var(--Grey-Strong, #2E3236)",boxSizing:"border-box"},children:[e.jsx(y.History,{size:16}),e.jsx("span",{style:{fontSize:12,fontWeight:500,lineHeight:"120%"},children:"History"})]})})]}),e.jsxs("div",{ref:f,style:{flex:1,display:"flex",flexDirection:"column",justifyContent:u?"flex-start":"center",alignItems:u?"stretch":"center",gap:12,overflow:"auto",marginTop:16,marginBottom:16},children:[u?r.map((s,h)=>{var b;return e.jsxs(x.Fragment,{children:[e.jsx("div",{style:{display:"flex",justifyContent:s.role==="user"?"flex-end":"flex-start"},children:e.jsx("div",{style:{maxWidth:"85%",padding:"10px 14px",borderRadius:s.role==="user"?"14px 14px 4px 14px":"14px 14px 14px 4px",background:s.role==="user"?"var(--Rail-Surface-2, #E3E1D7)":"#F3F7F7",fontSize:14,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:"140%",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s.content})}),(b=s.charts)==null?void 0:b.map((m,v)=>e.jsx("div",{style:{width:"100%",marginTop:8,overflowX:"auto",overflowY:"hidden"},children:e.jsx("div",{style:{width:520,transform:"scale(0.85)",transformOrigin:"top left",marginBottom:-40},children:e.jsx(z.ChartRenderer,{chartType:m.chartType,title:m.title,xLabel:m.xLabel,yLabel:m.yLabel,series:m.series})})},`chart-${v}`))]},h)}):e.jsxs(e.Fragment,{children:[e.jsx(W,{size:48}),e.jsx("span",{style:{alignSelf:"stretch",color:"var(--Grey-Muted, #808183)",textAlign:"center",fontSize:16,fontWeight:400,lineHeight:"120%"},children:"Hello! I'm here to assist you. How can I help you today?"})]}),o&&e.jsx("div",{style:{display:"flex",justifyContent:"flex-start"},children:e.jsx("div",{style:{padding:"10px 14px",borderRadius:"14px 14px 14px 4px",background:"#F3F7F7",fontSize:14,color:"var(--Grey-Muted, #808183)"},children:d||"Thinking..."})})]}),e.jsxs("div",{style:{display:"flex",padding:12,alignItems:"center",gap:8,alignSelf:"stretch",borderRadius:8,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxSizing:"border-box"},children:[e.jsx("input",{type:"text",value:a,onChange:s=>l(s.target.value),onKeyDown:C,placeholder:"Ask a Question",disabled:o,style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:15,fontWeight:400,color:"var(--Base-Strong, #2E3236)",lineHeight:"normal"}}),e.jsx("button",{onClick:i,disabled:!a.trim()||o,style:{display:"flex",height:28,padding:"8px 12px",justifyContent:"center",alignItems:"center",gap:8,borderRadius:10,border:"none",background:"var(--Neutral-850, #272727)",color:"#fff",fontSize:12,fontWeight:500,cursor:a.trim()&&!o?"pointer":"default",opacity:a.trim()&&!o?1:.4,flexShrink:0,boxSizing:"border-box"},children:"Send"})]})]})}function G({onSend:t,onHistoryClick:n,messages:r=[],loading:o=!1,statusLabel:d,className:a=""}){const[l,f]=x.useState(!1),[i,C]=x.useState(!1),u=x.useRef(null);return x.useEffect(()=>{if(!i)return;const s=h=>{u.current&&!u.current.contains(h.target)&&C(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[i]),e.jsxs("div",{ref:u,className:a,style:{position:"fixed",bottom:24,right:24,zIndex:1e3,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:12},children:[e.jsx(j.AnimatePresence,{children:i&&e.jsx(H,{onSend:t,onHistoryClick:n,messages:r,loading:o,statusLabel:d})}),e.jsx("div",{style:{width:48,height:48},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:e.jsxs(j.motion.button,{onClick:()=>C(s=>!s),initial:!1,animate:{width:l||i?166:48,height:l||i?56:48,borderRadius:l||i?30:12,background:l||i?"var(--Rail-Surface-2, #E3E1D7)":"rgba(0,0,0,0)"},transition:{type:"spring",stiffness:400,damping:30},style:{position:"absolute",right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",gap:l||i?10:0,padding:l||i?"0 0 0 16px":0,border:"none",outline:"none",cursor:"pointer",overflow:"hidden",whiteSpace:"nowrap",boxSizing:"border-box"},children:[e.jsx(j.AnimatePresence,{children:(l||i)&&e.jsx(j.motion.span,{initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.15,ease:"easeOut"},style:{flexShrink:0,fontSize:14,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:"120%",overflow:"hidden"},children:"Ask Compass"})}),e.jsx(R,{size:48,isHovered:l||i})]})})]})}const T=({options:t=[],value:n=null,onChange:r,placeholder:o="Search...",disabled:d=!1,showSuggestions:a=!0,styling:l,isAddNew:f=!1})=>{const[i,C]=x.useState(""),[u,s]=x.useState(!1),[h,b]=x.useState(null),m=x.useRef(null),v=x.useMemo(()=>{if(!a)return[];const c=i.toLowerCase();return t.filter(p=>{if(!p)return!1;const w=p.label||"",E=p.value||"";return(w.toLowerCase().includes(c)||E.toLowerCase().includes(c))&&(!h||p.value!==h.value)})},[i,t,a,h]),k=x.useMemo(()=>{if(!f)return!1;const c=i.toLowerCase();return t.some(p=>{if(!p)return!1;const w=p.label||"",E=p.value||"";return w.toLowerCase()===c||E.toLowerCase()===c})},[t,i,f]);x.useEffect(()=>{if(!u)return;const c=p=>{m.current&&!m.current.contains(p.target)&&s(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[u]);const g=c=>{r==null||r(c),C(""),s(!1),b(null)},F=()=>{const c={label:i,value:i};b(c),r==null||r(c),s(!1),C("")},S=()=>{r==null||r(null),C(""),s(!1),b(null)},B=c=>{const p=c.target.value;a?(C(p),s(!0)):f?(C(p),s(p.length>=3)):r==null||r(p)},I=()=>{(a||f)&&s(!0)},L=u&&!n&&i.length>=3;return e.jsxs("div",{className:"relative w-full",ref:m,children:[e.jsxs("div",{className:l||"flex items-center gap-2 border rounded-md px-3 py-2 bg-white shadow-sm",children:[e.jsx(y.Search,{className:"w-4 h-4 text-gray-400"}),e.jsx("div",{className:"flex-1",children:a&&n?e.jsx("div",{className:"text-gray-800 truncate",title:n.label,style:{fontSize:"var(--text-sm)",fontWeight:"var(--font-medium)",letterSpacing:"var(--tracking-normal)",lineHeight:"var(--leading-normal)",textTransform:"none",textDecoration:"none",fontFamily:"var(--font-sans)"},children:n.label}):e.jsx(M.TextInput,{value:a||f?i:n||"",onChange:c=>B({target:{value:c}}),placeholder:o,disabled:d,style:{border:"none",boxShadow:"none",padding:0,backgroundColor:"transparent"},onFocus:I})}),(n||h)&&e.jsx(D.SmallButton,{type:"button",variant:"ghost",size:"sm",onClick:S,style:{padding:0,width:20,height:20,border:"none",backgroundColor:"transparent",color:"rgba(107,114,128,1)"},children:e.jsx(y.X,{className:"w-3 h-3"})})]}),L&&e.jsxs("div",{className:"absolute w-full rounded-md border border-gray-300 bg-white shadow-lg custom-thin-scrollbar-library",style:{maxHeight:240,overflowY:"auto",zIndex:30},children:[v.length>0&&e.jsx("ul",{className:"m-0 p-0 list-none",children:v.map(c=>e.jsx("li",{onClick:()=>g(c),onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--hover-warm)"},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent"},className:"cursor-pointer px-4 py-2",title:c.label,children:e.jsx("span",{className:"truncate block w-full",style:{fontFamily:"var(--font-sans)",color:"var(--text-base)",fontSize:"var(--text-sm)",fontWeight:"var(--font-medium)",letterSpacing:"var(--tracking-normal)",lineHeight:"var(--leading-normal)",textTransform:"none",textDecoration:"none"},children:c.label})},c.value))}),f&&!k&&!h&&i.length>=3&&e.jsxs(D.SmallButton,{type:"button",variant:"secondary",onClick:F,style:{width:"100%",justifyContent:"space-between",padding:"8px 10px",border:"none",borderTop:"1px solid rgba(229, 231, 235, 1)",borderRadius:0,backgroundColor:"transparent",color:"rgba(107,114,128,1)"},children:[e.jsx("span",{children:`Add "${i}"`}),e.jsx(y.PlusCircle,{className:"w-5 h-5 text-green-500"})]})]})]})};function A({open:t,onClose:n,title:r,subtitle:o,children:d,footer:a,width:l=515,height:f=762,toggleLabel:i,toggleChecked:C,onToggle:u}){const s=x.useRef(null);return x.useEffect(()=>{if(!t)return;const h=b=>{b.key==="Escape"&&(n==null||n())};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[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:s,style:{position:"fixed",top:"50%",right:0,transform:"translateY(-50%)",zIndex:1201,display:"flex",width:l,height:f,maxHeight:"100vh",padding:"20px",flexDirection:"column",alignItems:"flex-start",gap:"20px",borderRadius:"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:h=>{h.currentTarget.style.background="#ECEEF2"},onMouseLeave:h=>{h.currentTarget.style.background="transparent"},children:e.jsx(y.X,{size:20,strokeWidth:2})})]}),e.jsx("div",{style:{width:"100%",height:"1px",background:"#ECEEF2",flexShrink:0}}),(o||i)&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:"12px",flexShrink:0},children:[o&&e.jsx("p",{style:{fontSize:"13px",fontStyle:"normal",fontWeight:400,lineHeight:"140%",color:"#0B0B0B",margin:0,flex:1},children:o}),i&&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:i})]})]}),e.jsx("div",{style:{flex:1,width:"100%",overflowY:"auto",display:"flex",flexDirection:"column",gap:"16px",minHeight:0},children:d}),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 Z({label:t,variant:n="secondary",onClick:r,disabled:o}){const d=n==="primary";return e.jsx("button",{onClick:r,disabled:o,style:{display:"flex",height:"36px",padding:"0 20px",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:"6px",border:d?"none":"1px solid #D9D9D9",background:d?"var(--Base-Strong, #0B0B0B)":"var(--Base-White, #FFF)",color:d?"#FFF":"var(--Base-Strong, #1E1E1E)",fontSize:"16px",fontWeight:600,cursor:o?"default":"pointer",opacity:o?.5:1,transition:"all 0.15s ease"},onMouseEnter:a=>{!o&&!d&&(a.currentTarget.style.background="#ECEEF2")},onMouseLeave:a=>{!o&&!d&&(a.currentTarget.style.background="var(--Base-White, #FFF)")},children:t})}function O({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 N(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)}})}function q({size:t=48}){return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{animation:"file-upload-spin 1.2s linear infinite"},children:[e.jsx("path",{d:"M43 24C43 26.4951 42.5086 28.9658 41.5537 31.271C40.5989 33.5762 39.1993 35.6707 37.435 37.435C35.6707 39.1993 33.5762 40.5989 31.271 41.5537C28.9658 42.5086 26.4951 43 24 43C21.5049 43 19.0342 42.5086 16.729 41.5537C14.4238 40.5989 12.3293 39.1993 10.565 37.435C8.80066 35.6707 7.40113 33.5762 6.44629 31.271C5.49145 28.9658 5 26.4951 5 24",stroke:"#F3E7C7",strokeWidth:"4",strokeLinecap:"round"}),e.jsx("path",{d:"M12 24C12 22.4241 12.3104 20.8637 12.9134 19.4078C13.5165 17.9519 14.4004 16.629 15.5147 15.5147C16.629 14.4004 17.9519 13.5165 19.4078 12.9134C20.8637 12.3104 22.4241 12 24 12C25.5759 12 27.1363 12.3104 28.5922 12.9134C30.0481 13.5165 31.371 14.4004 32.4853 15.5147C33.5996 16.629 34.4835 17.9519 35.0866 19.4078C35.6896 20.8637 36 22.4241 36 24",stroke:"#00A66E",strokeWidth:"4",strokeLinecap:"round"}),e.jsx("path",{d:"M20 24C20 24.5253 20.1035 25.0454 20.3045 25.5307C20.5055 26.016 20.8001 26.457 21.1716 26.8284C21.543 27.1999 21.984 27.4945 22.4693 27.6955C22.9546 27.8965 23.4747 28 24 28C24.5253 28 25.0454 27.8965 25.5307 27.6955C26.016 27.4945 26.457 27.1999 26.8284 26.8284C27.1999 26.457 27.4945 26.016 27.6955 25.5307C27.8965 25.0454 28 24.5253 28 24",stroke:"#F3E7C7",strokeWidth:"4",strokeLinecap:"round"})]})}function U({title:t="Uploading your file...",subtitle:n="Please wait while we process your file",progress:r,width:o=648,height:d=281}){return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
1
+ "use strict";const e=require("react/jsx-runtime"),u=require("react"),j=require("motion/react"),y=require("lucide-react"),z=require("./ChartRenderer.cjs.js"),L=require("./TextInput.cjs.js"),D=require("./SmallButton.cjs.js");function R({size:t=48,isHovered:i=!1}){return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flexShrink:0,display:"block"},children:[e.jsx(j.motion.rect,{width:"48",height:"48",fill:"#2E3236",initial:{rx:12},animate:{rx:i?24:12},transition:{duration:.8,ease:[.16,1,.3,1]}}),e.jsx("path",{d:"M42.7803 24.0713C42.7803 19.3098 41.002 14.9639 38.0723 11.6611C34.6441 7.7964 29.6419 5.36331 24.0713 5.36328C18.5958 5.36328 13.6718 7.71492 10.249 11.4648C7.2131 14.7919 5.36329 19.2146 5.36328 24.0723C5.36328 29.4538 7.63513 34.3049 11.2744 37.7188L11.5918 38.0098C14.9101 40.9752 19.4232 42.7803 24.0723 42.7803C28.8742 42.7803 33.2527 40.9725 36.5654 37.998C40.3821 34.5709 42.7803 29.6014 42.7803 24.0713ZM44.1436 24.0713C44.1435 30.0044 41.5678 35.3371 37.4756 39.0117C33.9225 42.202 29.2231 44.1436 24.0723 44.1436C18.919 44.1436 13.9333 42.0823 10.3418 38.7129C6.43938 35.0522 4 29.8457 4 24.0723C4.00001 18.8616 5.98619 14.1142 9.24219 10.5459C12.9121 6.52517 18.1968 4 24.0713 4C30.0479 4.00003 35.416 6.61368 39.0918 10.7578C42.2339 14.3002 44.1436 18.964 44.1436 24.0713Z",fill:"#E8D4A3"}),e.jsx("path",{d:"M40.333 24.0725C40.333 19.8532 38.7227 16.0102 36.083 13.1252L36.0811 13.1233C33.1126 9.85842 28.832 7.80986 24.0713 7.80981C19.3005 7.80981 15.0105 9.86403 12.0352 13.137C9.40921 16.0256 7.80859 19.8614 7.80859 24.0725C7.80864 28.7008 10.0684 32.4554 13.2617 35.4573C16.2162 38.2352 19.9065 40.3342 24.0713 40.3342C28.2888 40.3342 32.1311 38.7277 35.0195 36.093L35.3223 35.8108C38.4111 32.852 40.333 28.6868 40.333 24.0725ZM41.5254 24.0725C41.5253 29.185 39.3252 33.7854 35.8223 36.9749C32.7229 39.8016 28.5972 41.5266 24.0713 41.5266C19.4923 41.5266 15.5242 39.2213 12.4453 36.3264C9.09752 33.1794 6.61724 29.1313 6.61719 24.0725C6.61719 19.5535 8.33492 15.4346 11.1523 12.3352C14.3441 8.82416 18.9506 6.61841 24.0713 6.61841C29.1808 6.61845 33.7769 8.81742 36.9619 12.3196C39.7951 15.4158 41.5254 19.5436 41.5254 24.0725Z",fill:"#C1D89F"}),e.jsx("path",{d:"M37.8867 24.0725C37.8867 20.3937 36.437 17.0596 34.0918 14.5842C31.5737 11.9261 28.02 10.2561 24.0713 10.2561C20.0051 10.2561 16.3493 12.0119 13.8213 14.8079C11.6042 17.2591 10.2549 20.508 10.2549 24.0725C10.255 27.9518 12.4926 30.595 15.251 33.1965C17.8271 35.6258 20.5283 37.8879 24.0713 37.8879C27.7054 37.8879 31.0113 36.4826 33.4756 34.1868C36.1894 31.6665 37.8867 28.0684 37.8867 24.0725ZM38.9092 24.0725C38.9091 28.3641 37.084 32.2294 34.1709 34.9348C31.525 37.3999 27.9741 38.9104 24.0713 38.9104C20.0772 38.9104 17.1052 36.3484 14.5508 33.9397H14.5498C11.7673 31.3154 9.23347 28.4104 9.2334 24.0725C9.2334 20.245 10.683 16.7541 13.0635 14.1223L13.3213 13.845C16.0229 11.0055 19.8407 9.23462 24.0713 9.23462C28.315 9.23466 32.1331 11.03 34.834 13.8811C37.3496 16.5365 38.9092 20.1189 38.9092 24.0725Z",fill:"#9BDB9C"}),e.jsx("path",{d:"M35.4395 24.0713C35.4395 20.934 34.1591 18.1016 32.1025 16.0439C30.0461 13.9864 27.2106 12.7022 24.0713 12.7021H23.9922C20.6631 12.7245 17.6733 14.1772 15.6074 16.4785C13.8003 18.4924 12.7012 21.1526 12.7012 24.0713C12.7012 25.6404 13.254 26.8046 14.0918 27.8496C14.9513 28.9216 16.0706 29.8274 17.2393 30.9336C17.7745 31.4407 18.2978 31.9913 18.8096 32.5107C19.3268 33.0357 19.84 33.5376 20.3809 33.9746C21.458 34.8449 22.6194 35.4414 24.0703 35.4414C27.1211 35.4413 29.8896 34.2382 31.9297 32.2812V32.2803C34.0921 30.2141 35.4394 27.2081 35.4395 24.0713ZM36.291 24.0713C36.291 27.341 34.9333 30.4712 32.7334 32.6846L32.5186 32.8955C30.3264 34.9983 27.3496 36.2929 24.0703 36.293C22.3559 36.293 21.0106 35.5779 19.8457 34.6367C19.2657 34.1681 18.7249 33.638 18.2031 33.1084C17.6759 32.5733 17.1754 32.0455 16.6543 31.5518V31.5527C15.5515 30.5088 14.3349 29.5146 13.4268 28.3818C12.497 27.2221 11.8497 25.8757 11.8496 24.0713C11.8496 20.9343 13.0317 18.0732 14.9736 15.9092H14.9746C17.2113 13.4178 20.4583 11.8496 24.0703 11.8496H24.2461L24.249 11.8535C27.5552 11.9012 30.5353 13.2725 32.7041 15.4424L33.1084 15.8662C35.079 18.0332 36.291 20.9074 36.291 24.0713Z",fill:"#74DF98"}),e.jsx("path",{d:"M32.9941 24.0725C32.9941 21.4749 31.8844 19.1375 30.1133 17.5061C28.5336 16.0513 26.4292 15.1609 24.1152 15.1497H24.0703C21.4136 15.1497 19.0292 16.3095 17.3945 18.1516C15.996 19.7271 15.1475 21.8001 15.1475 24.0725C15.1475 25.2559 15.6746 25.9577 16.4512 26.5891C16.8499 26.9133 17.2998 27.2072 17.7852 27.5413C18.2636 27.8706 18.7652 28.2327 19.2285 28.6741C19.6676 29.0922 20.0478 29.5868 20.4033 30.0774C20.7649 30.5763 21.0959 31.0625 21.458 31.5051C22.1753 32.3819 22.9426 32.9954 24.0703 32.9954C26.5368 32.9953 28.7688 31.9943 30.3848 30.3762C31.9974 28.7615 32.9941 26.5337 32.9941 24.0725ZM33.6748 24.0725C33.6747 26.7213 32.6022 29.1203 30.8672 30.8577C29.1287 32.5985 26.725 33.6759 24.0703 33.676C22.6373 33.676 21.6959 32.872 20.9307 31.9368C20.5517 31.4735 20.1972 30.9548 19.8516 30.4778C19.5877 30.1137 19.325 29.7684 19.0449 29.4612L18.7588 29.1672C18.3364 28.7649 17.8721 28.4281 17.3994 28.1028C16.934 27.7824 16.4479 27.4651 16.0215 27.1184C15.1475 26.4078 14.4659 25.5291 14.4658 24.0725C14.4658 21.6272 15.3799 19.3948 16.8848 17.6995L17.2236 17.3362C18.9317 15.6 21.2965 14.5141 23.916 14.4729L23.9209 14.467H24.0713C26.5802 14.4671 28.8638 15.4298 30.5742 17.0051C32.4796 18.7601 33.6748 21.2765 33.6748 24.0725Z",fill:"#4DE294"})]})}function M({size:t=48}){return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flexShrink:0,display:"block",aspectRatio:"1/1"},children:[e.jsx("path",{d:"M46.3699 23.9994C46.3699 18.306 44.2436 13.1097 40.7405 9.16048C36.6415 4.53939 30.6603 1.63013 23.9994 1.63009C17.4524 1.63009 11.5646 4.44196 7.47201 8.92578C3.84193 12.904 1.6301 18.1922 1.63009 24.0006C1.63009 30.4354 4.34656 36.2358 8.69808 40.3178L9.07758 40.6658C13.0453 44.2116 18.4416 46.3699 24.0006 46.3699C29.7423 46.3699 34.9777 44.2084 38.9388 40.6518C43.5023 36.5539 46.3699 30.6118 46.3699 23.9994ZM48 23.9994C48 31.0937 44.9202 37.4701 40.0271 41.8638C35.7786 45.6785 30.1595 48 24.0006 48C17.8388 48 11.8773 45.5353 7.58294 41.5065C2.91679 37.1294 0 30.9039 0 24.0006C1.39062e-05 17.7702 2.37491 12.0936 6.26813 7.82699C10.6563 3.01936 16.9753 0 23.9994 0C31.1457 3.78892e-05 37.5643 3.1252 41.9596 8.08038C45.7166 12.316 48 17.8926 48 23.9994Z",fill:"#E8D4A3"}),e.jsx("path",{d:"M43.4432 24.0009C43.4432 18.9559 41.5178 14.3607 38.3614 10.9111L38.3591 10.9088C34.8097 7.00497 29.6913 4.55549 23.9989 4.55543C18.2944 4.55543 13.1649 7.01168 9.60722 10.9252C6.46736 14.3791 4.55348 18.9657 4.55348 24.0009C4.55354 29.535 7.25552 34.0243 11.0738 37.6137C14.6065 40.9353 19.0191 43.4452 23.9989 43.4452C29.0418 43.4451 33.6361 41.5242 37.0898 38.3739L37.4518 38.0364C41.1451 34.4986 43.4432 29.5182 43.4432 24.0009ZM44.8689 24.0009C44.8689 30.1139 42.2382 35.6146 38.0497 39.4283C34.3437 42.8083 29.4106 44.8709 23.9989 44.8709C18.5237 44.8709 13.7791 42.1144 10.0976 38.653C6.09466 34.8901 3.12896 30.0497 3.12891 24.0009C3.12891 18.5975 5.18282 13.6724 8.55163 9.96648C12.3681 5.76829 17.876 3.13086 23.9989 3.13086C30.1084 3.13091 35.604 5.76024 39.4124 9.9478C42.8001 13.6499 44.8689 18.5856 44.8689 24.0009Z",fill:"#C1D89F"}),e.jsx("path",{d:"M40.5188 24.0008C40.5188 19.602 38.7853 15.6155 35.9812 12.6556C32.9704 9.47725 28.7211 7.48048 23.9996 7.48043C19.1376 7.48043 14.7663 9.5798 11.7436 12.923C9.09255 15.8539 7.47921 19.7387 7.47921 24.0008C7.4793 28.6393 10.1548 31.7998 13.4531 34.9105C16.5334 37.8152 19.7632 40.5201 23.9996 40.5201C28.3449 40.52 32.2979 38.8397 35.2444 36.0945C38.4893 33.0811 40.5188 28.7787 40.5188 24.0008ZM41.7414 24.0008C41.7413 29.1323 39.559 33.754 36.0758 36.989C32.9121 39.9365 28.6662 41.7426 23.9996 41.7426C19.2238 41.7426 15.6702 38.6792 12.6159 35.7991H12.6147C9.28764 32.6613 6.2579 29.1876 6.25781 24.0008C6.25781 19.4242 7.99112 15.2501 10.8375 12.1033L11.1457 11.7717C14.376 8.37646 18.941 6.25903 23.9996 6.25903C29.0739 6.25908 33.6392 8.40576 36.8687 11.8149C39.8766 14.9899 41.7414 19.2735 41.7414 24.0008Z",fill:"#9BDB9C"}),e.jsx("path",{d:"M37.5923 23.9993C37.5923 20.2481 36.0614 16.8614 33.6023 14.4009C31.1434 11.9407 27.753 10.4052 23.9993 10.4051H23.9047C19.9241 10.4318 16.3492 12.1689 13.879 14.9206C11.7182 17.3286 10.404 20.5094 10.404 23.9993C10.404 25.8755 11.065 27.2676 12.0667 28.5171C13.0945 29.7989 14.4328 30.8819 15.8302 32.2046C16.4702 32.811 17.0959 33.4693 17.7078 34.0904C18.3263 34.7181 18.9399 35.3182 19.5866 35.8408C20.8746 36.8814 22.2632 37.5947 23.9981 37.5947C26.9471 37.5946 29.6159 33.4731 31.5481 31.5384C33.4763 29.6076 34.6681 26.9438 34.6681 24.001ZM35.482 24.001C35.4819 27.1682 34.1995 30.0367 32.1249 32.114C30.0462 34.1956 27.1721 35.4839 23.9978 35.484C22.2843 35.484 21.1587 34.5226 20.2437 33.4043C19.7906 32.8504 19.3668 32.2301 18.9535 31.6598C18.638 31.2245 18.3238 30.8116 17.9889 30.4443L17.6468 30.0928C17.1418 29.6117 16.5865 29.209 16.0214 28.82C15.4649 28.437 14.8837 28.0575 14.3738 27.643C13.3287 26.7933 12.5138 25.7426 12.5137 24.001C12.5137 21.0771 13.6066 18.4078 15.406 16.3807L15.8112 15.9463C17.8536 13.8703 20.6812 12.5718 23.8134 12.5226L23.8192 12.5156H23.999C26.9989 12.5157 29.7294 13.6668 31.7746 15.5504C34.053 17.6489 35.482 20.6577 35.482 24.001Z",fill:"#74DF98"}),e.jsx("path",{d:"M34.6681 24.001C34.6681 20.895 33.3413 18.1002 31.2235 16.1495C29.3347 14.4099 26.8184 13.3452 24.0516 13.3318H23.9978C20.8212 13.3318 17.9701 14.7186 16.0156 16.9213C14.3434 18.8051 13.3287 21.2838 13.3287 24.001C13.3288 25.4159 13.959 26.2551 14.8876 27.0101C15.3643 27.3977 15.9022 27.7491 16.4826 28.1486C17.0547 28.5424 17.6545 28.9754 18.2085 29.5031C18.7335 30.003 19.1881 30.5945 19.6132 31.1811C20.0455 31.7776 20.4414 32.359 20.8743 32.8882C21.732 33.9366 22.6494 34.6701 23.9978 34.6701C26.9471 34.67 29.6159 33.4731 31.5481 31.5384C33.4763 29.6076 34.6681 26.9438 34.6681 24.001ZM35.482 24.001C35.4819 27.1682 34.1995 30.0367 32.1249 32.114C30.0462 34.1956 27.1721 35.4839 23.9978 35.484C22.2843 35.484 21.1587 34.5226 20.2437 33.4043C19.7906 32.8504 19.3668 32.2301 18.9535 31.6598C18.638 31.2245 18.3238 30.8116 17.9889 30.4443L17.6468 30.0928C17.1418 29.6117 16.5865 29.209 16.0214 28.82C15.4649 28.437 14.8837 28.0575 14.3738 27.643C13.3287 26.7933 12.5138 25.7426 12.5137 24.001C12.5137 21.0771 13.6066 18.4078 15.406 16.3807L15.8112 15.9463C17.8536 13.8703 20.6812 12.5718 23.8134 12.5226L23.8192 12.5156H23.999C26.9989 12.5157 29.7294 13.6668 31.7746 15.5504C34.053 17.6489 35.482 20.6577 35.482 24.001Z",fill:"#4DE294"})]})}function W({onSend:t,onHistoryClick:i,messages:n=[],loading:a=!1,statusLabel:c}){const[o,l]=u.useState(""),p=u.useRef(null),s=u.useRef(null);u.useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},[n]),u.useEffect(()=>{const r=s.current;if(!r)return;r.style.height="auto";const m=140;r.style.height=Math.min(r.scrollHeight,m)+"px",r.style.overflowY=r.scrollHeight>m?"auto":"hidden"},[o]);const h=()=>{const r=o.trim();!r||a||(t==null||t(r),l(""))},C=r=>{if(r.key==="Enter"){if(r.metaKey||r.ctrlKey||r.shiftKey)return;r.preventDefault(),h()}},d=n.length>0;return e.jsxs(j.motion.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{type:"spring",stiffness:400,damping:30},style:{display:"flex",width:360,height:709,padding:24,flexDirection:"column",justifyContent:"space-between",borderRadius:16,border:"2px solid var(--Rail-Surface-2, #E3E1D7)",background:"var(--Grey-White, #FFF)",boxSizing:"border-box"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",alignSelf:"stretch"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("div",{style:{display:"flex",width:34,height:34,justifyContent:"center",alignItems:"center",aspectRatio:"1/1",borderRadius:9999,background:"#F3F7F7"},children:e.jsx(y.MessageCircleQuestion,{size:20,style:{color:"var(--Grey-Strong, #2E3236)"}})}),e.jsx("span",{style:{fontSize:16,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:"120%"},children:"Ask Compass"})]}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:8},children:e.jsxs("button",{onClick:i,style:{display:"flex",height:28,padding:"8px 12px",justifyContent:"center",alignItems:"center",gap:8,borderRadius:10,border:"1px solid var(--Neutral-250, #BFBFBF)",background:"none",cursor:"pointer",color:"var(--Grey-Strong, #2E3236)",boxSizing:"border-box"},children:[e.jsx(y.History,{size:16}),e.jsx("span",{style:{fontSize:12,fontWeight:500,lineHeight:"120%"},children:"History"})]})})]}),e.jsxs("div",{ref:p,style:{flex:1,display:"flex",flexDirection:"column",justifyContent:d?"flex-start":"center",alignItems:d?"stretch":"center",gap:12,overflow:"auto",marginTop:16,marginBottom:16},children:[d?n.map((r,m)=>{var v;return e.jsxs(u.Fragment,{children:[e.jsx("div",{style:{display:"flex",justifyContent:r.role==="user"?"flex-end":"flex-start"},children:e.jsx("div",{style:{maxWidth:"85%",padding:"10px 14px",borderRadius:r.role==="user"?"14px 14px 4px 14px":"14px 14px 14px 4px",background:r.role==="user"?"var(--Rail-Surface-2, #E3E1D7)":"#F3F7F7",fontSize:14,fontWeight:400,color:"var(--Grey-Strong, #2E3236)",lineHeight:"140%",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:r.content})}),(v=r.charts)==null?void 0:v.map((b,S)=>e.jsx("div",{style:{width:"100%",marginTop:8,overflowX:"auto",overflowY:"hidden"},children:e.jsx("div",{style:{width:520,transform:"scale(0.85)",transformOrigin:"top left",marginBottom:-40},children:e.jsx(z.ChartRenderer,{chartType:b.chartType,title:b.title,xLabel:b.xLabel,yLabel:b.yLabel,series:b.series})})},`chart-${S}`))]},m)}):e.jsxs(e.Fragment,{children:[e.jsx(M,{size:48}),e.jsx("span",{style:{alignSelf:"stretch",color:"var(--Grey-Muted, #808183)",textAlign:"center",fontSize:16,fontWeight:400,lineHeight:"120%"},children:"Hello! I'm here to assist you. How can I help you today?"})]}),a&&e.jsx("div",{style:{display:"flex",justifyContent:"flex-start"},children:e.jsx("div",{style:{padding:"10px 14px",borderRadius:"14px 14px 14px 4px",background:"#F3F7F7",fontSize:14,color:"var(--Grey-Muted, #808183)"},children:c||"Thinking..."})})]}),e.jsxs("div",{style:{display:"flex",padding:12,alignItems:"flex-end",gap:8,alignSelf:"stretch",borderRadius:8,border:"1px solid var(--Grey-absent, #D9D9D9)",background:"var(--Grey-White, #FFF)",boxSizing:"border-box"},children:[e.jsx("textarea",{ref:s,value:o,onChange:r=>l(r.target.value),onKeyDown:C,placeholder:"Ask a Question",disabled:a,rows:1,style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:15,fontWeight:400,color:"var(--Base-Strong, #2E3236)",lineHeight:"1.4",resize:"none",fontFamily:"inherit",padding:0,minHeight:21,maxHeight:140,overflowY:"hidden"}}),e.jsx("button",{onClick:h,disabled:!o.trim()||a,style:{display:"flex",height:28,padding:"8px 12px",justifyContent:"center",alignItems:"center",gap:8,borderRadius:10,border:"none",background:"var(--Neutral-850, #272727)",color:"#fff",fontSize:12,fontWeight:500,cursor:o.trim()&&!a?"pointer":"default",opacity:o.trim()&&!a?1:.4,flexShrink:0,boxSizing:"border-box"},children:"Send"})]})]})}function G({onSend:t,onHistoryClick:i,messages:n=[],loading:a=!1,statusLabel:c,className:o=""}){const[l,p]=u.useState(!1),[s,h]=u.useState(!1),C=u.useRef(null);return u.useEffect(()=>{if(!s)return;const d=r=>{C.current&&!C.current.contains(r.target)&&h(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[s]),e.jsxs("div",{ref:C,className:o,style:{position:"fixed",bottom:24,right:24,zIndex:1e3,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:12},children:[e.jsx(j.AnimatePresence,{children:s&&e.jsx(W,{onSend:t,onHistoryClick:i,messages:n,loading:a,statusLabel:c})}),e.jsx("div",{style:{width:48,height:48},onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:e.jsxs(j.motion.button,{onClick:()=>h(d=>!d),initial:!1,animate:{width:l||s?166:48,height:l||s?56:48,borderRadius:l||s?30:12,background:l||s?"var(--Rail-Surface-2, #E3E1D7)":"rgba(0,0,0,0)"},transition:{duration:.8,ease:[.16,1,.3,1]},style:{position:"absolute",right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",gap:l||s?10:0,padding:l||s?"0 0 0 16px":0,border:"none",outline:"none",cursor:"pointer",overflow:"hidden",whiteSpace:"nowrap",boxSizing:"border-box"},children:[e.jsx(j.AnimatePresence,{children:(l||s)&&e.jsx(j.motion.span,{initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.6,ease:[.16,1,.3,1]},style:{flexShrink:0,fontSize:14,fontWeight:600,color:"var(--Grey-Strong, #2E3236)",lineHeight:"120%",overflow:"hidden"},children:"Ask Compass"})}),e.jsx(R,{size:48,isHovered:l||s})]})})]})}const T=({options:t=[],value:i=null,onChange:n,placeholder:a="Search...",disabled:c=!1,showSuggestions:o=!0,styling:l,isAddNew:p=!1})=>{const[s,h]=u.useState(""),[C,d]=u.useState(!1),[r,m]=u.useState(null),v=u.useRef(null),b=u.useMemo(()=>{if(!o)return[];const x=s.toLowerCase();return t.filter(f=>{if(!f)return!1;const F=f.label||"",E=f.value||"";return(F.toLowerCase().includes(x)||E.toLowerCase().includes(x))&&(!r||f.value!==r.value)})},[s,t,o,r]),S=u.useMemo(()=>{if(!p)return!1;const x=s.toLowerCase();return t.some(f=>{if(!f)return!1;const F=f.label||"",E=f.value||"";return F.toLowerCase()===x||E.toLowerCase()===x})},[t,s,p]);u.useEffect(()=>{if(!C)return;const x=f=>{v.current&&!v.current.contains(f.target)&&d(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[C]);const g=x=>{n==null||n(x),h(""),d(!1),m(null)},w=()=>{const x={label:s,value:s};m(x),n==null||n(x),d(!1),h("")},k=()=>{n==null||n(null),h(""),d(!1),m(null)},B=x=>{const f=x.target.value;o?(h(f),d(!0)):p?(h(f),d(f.length>=3)):n==null||n(f)},I=()=>{(o||p)&&d(!0)},H=C&&!i&&s.length>=3;return e.jsxs("div",{className:"relative w-full",ref:v,children:[e.jsxs("div",{className:l||"flex items-center gap-2 border rounded-md px-3 py-2 bg-white shadow-sm",children:[e.jsx(y.Search,{className:"w-4 h-4 text-gray-400"}),e.jsx("div",{className:"flex-1",children:o&&i?e.jsx("div",{className:"text-gray-800 truncate",title:i.label,style:{fontSize:"var(--text-sm)",fontWeight:"var(--font-medium)",letterSpacing:"var(--tracking-normal)",lineHeight:"var(--leading-normal)",textTransform:"none",textDecoration:"none",fontFamily:"var(--font-sans)"},children:i.label}):e.jsx(L.TextInput,{value:o||p?s:i||"",onChange:x=>B({target:{value:x}}),placeholder:a,disabled:c,style:{border:"none",boxShadow:"none",padding:0,backgroundColor:"transparent"},onFocus:I})}),(i||r)&&e.jsx(D.SmallButton,{type:"button",variant:"ghost",size:"sm",onClick:k,style:{padding:0,width:20,height:20,border:"none",backgroundColor:"transparent",color:"rgba(107,114,128,1)"},children:e.jsx(y.X,{className:"w-3 h-3"})})]}),H&&e.jsxs("div",{className:"absolute w-full rounded-md border border-gray-300 bg-white shadow-lg custom-thin-scrollbar-library",style:{maxHeight:240,overflowY:"auto",zIndex:30},children:[b.length>0&&e.jsx("ul",{className:"m-0 p-0 list-none",children:b.map(x=>e.jsx("li",{onClick:()=>g(x),onMouseEnter:f=>{f.currentTarget.style.backgroundColor="var(--hover-warm)"},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent"},className:"cursor-pointer px-4 py-2",title:x.label,children:e.jsx("span",{className:"truncate block w-full",style:{fontFamily:"var(--font-sans)",color:"var(--text-base)",fontSize:"var(--text-sm)",fontWeight:"var(--font-medium)",letterSpacing:"var(--tracking-normal)",lineHeight:"var(--leading-normal)",textTransform:"none",textDecoration:"none"},children:x.label})},x.value))}),p&&!S&&!r&&s.length>=3&&e.jsxs(D.SmallButton,{type:"button",variant:"secondary",onClick:w,style:{width:"100%",justifyContent:"space-between",padding:"8px 10px",border:"none",borderTop:"1px solid rgba(229, 231, 235, 1)",borderRadius:0,backgroundColor:"transparent",color:"rgba(107,114,128,1)"},children:[e.jsx("span",{children:`Add "${s}"`}),e.jsx(y.PlusCircle,{className:"w-5 h-5 text-green-500"})]})]})]})};function A({open:t,onClose:i,title:n,subtitle:a,children:c,footer:o,width:l=515,height:p=762,toggleLabel:s,toggleChecked:h,onToggle:C}){const d=u.useRef(null);return u.useEffect(()=>{if(!t)return;const r=m=>{m.key==="Escape"&&(i==null||i())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t,i]),t?e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:i,style:{position:"fixed",inset:0,zIndex:1200,background:"rgba(0, 0, 0, 0.20)"}}),e.jsxs("div",{ref:d,style:{position:"fixed",top:"50%",right:0,transform:"translateY(-50%)",zIndex:1201,display:"flex",width:l,height:p,maxHeight:"100vh",padding:"20px",flexDirection:"column",alignItems:"flex-start",gap:"20px",borderRadius:"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:n}),e.jsx("button",{onClick:i,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:r=>{r.currentTarget.style.background="#ECEEF2"},onMouseLeave:r=>{r.currentTarget.style.background="transparent"},children:e.jsx(y.X,{size:20,strokeWidth:2})})]}),e.jsx("div",{style:{width:"100%",height:"1px",background:"#ECEEF2",flexShrink:0}}),(a||s)&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:"12px",flexShrink:0},children:[a&&e.jsx("p",{style:{fontSize:"13px",fontStyle:"normal",fontWeight:400,lineHeight:"140%",color:"#0B0B0B",margin:0,flex:1},children:a}),s&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[e.jsx("button",{onClick:()=>C==null?void 0:C(!h),style:{position:"relative",width:"40px",height:"22px",borderRadius:"11px",border:"none",background:h?"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:h?"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:s})]})]}),e.jsx("div",{style:{flex:1,width:"100%",overflowY:"auto",display:"flex",flexDirection:"column",gap:"16px",minHeight:0},children:c}),o&&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:o})]})]})]}):null}function Z({label:t,variant:i="secondary",onClick:n,disabled:a}){const c=i==="primary";return e.jsx("button",{onClick:n,disabled:a,style:{display:"flex",height:"36px",padding:"0 20px",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:"6px",border:c?"none":"1px solid #D9D9D9",background:c?"var(--Base-Strong, #0B0B0B)":"var(--Base-White, #FFF)",color:c?"#FFF":"var(--Base-Strong, #1E1E1E)",fontSize:"16px",fontWeight:600,cursor:a?"default":"pointer",opacity:a?.5:1,transition:"all 0.15s ease"},onMouseEnter:o=>{!a&&!c&&(o.currentTarget.style.background="#ECEEF2")},onMouseLeave:o=>{!a&&!c&&(o.currentTarget.style.background="var(--Base-White, #FFF)")},children:t})}function O({children:t,htmlFor:i}){return e.jsx("label",{htmlFor:i,style:{display:"block",color:"var(--Base-Strong, #2E3236)",fontSize:"16px",fontStyle:"normal",fontWeight:400,lineHeight:"normal",marginBottom:"6px"},children:t})}function N(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:i=>{var n;i.currentTarget.style.borderColor="#808183",(n=t.onFocus)==null||n.call(t,i)},onBlur:i=>{var n;i.currentTarget.style.borderColor="#D9D9D9",(n=t.onBlur)==null||n.call(t,i)}})}function q({size:t=48}){return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{animation:"file-upload-spin 1.2s linear infinite"},children:[e.jsx("path",{d:"M43 24C43 26.4951 42.5086 28.9658 41.5537 31.271C40.5989 33.5762 39.1993 35.6707 37.435 37.435C35.6707 39.1993 33.5762 40.5989 31.271 41.5537C28.9658 42.5086 26.4951 43 24 43C21.5049 43 19.0342 42.5086 16.729 41.5537C14.4238 40.5989 12.3293 39.1993 10.565 37.435C8.80066 35.6707 7.40113 33.5762 6.44629 31.271C5.49145 28.9658 5 26.4951 5 24",stroke:"#F3E7C7",strokeWidth:"4",strokeLinecap:"round"}),e.jsx("path",{d:"M12 24C12 22.4241 12.3104 20.8637 12.9134 19.4078C13.5165 17.9519 14.4004 16.629 15.5147 15.5147C16.629 14.4004 17.9519 13.5165 19.4078 12.9134C20.8637 12.3104 22.4241 12 24 12C25.5759 12 27.1363 12.3104 28.5922 12.9134C30.0481 13.5165 31.371 14.4004 32.4853 15.5147C33.5996 16.629 34.4835 17.9519 35.0866 19.4078C35.6896 20.8637 36 22.4241 36 24",stroke:"#00A66E",strokeWidth:"4",strokeLinecap:"round"}),e.jsx("path",{d:"M20 24C20 24.5253 20.1035 25.0454 20.3045 25.5307C20.5055 26.016 20.8001 26.457 21.1716 26.8284C21.543 27.1999 21.984 27.4945 22.4693 27.6955C22.9546 27.8965 23.4747 28 24 28C24.5253 28 25.0454 27.8965 25.5307 27.6955C26.016 27.4945 26.457 27.1999 26.8284 26.8284C27.1999 26.457 27.4945 26.016 27.6955 25.5307C27.8965 25.0454 28 24.5253 28 24",stroke:"#F3E7C7",strokeWidth:"4",strokeLinecap:"round"})]})}function K({title:t="Uploading your file...",subtitle:i="Please wait while we process your file",progress:n,width:a=648,height:c=281}){return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
2
2
  @keyframes file-upload-spin {
3
3
  from { transform: rotate(0deg); }
4
4
  to { transform: rotate(360deg); }
5
5
  }
6
- `}),e.jsxs("div",{style:{display:"flex",width:o,height:d,padding:"88px 64px 64px 64px",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:"12px",border:"2px dashed #D9D9D9",background:"var(--Grey-White, #FFF)",boxSizing:"border-box"},children:[e.jsx(q,{size:48}),e.jsx("p",{style:{fontSize:"16px",fontWeight:600,color:"var(--Base-Strong, #2E3236)",margin:0,lineHeight:"normal",textAlign:"center"},children:t}),e.jsx("p",{style:{fontSize:"13px",fontWeight:400,color:"var(--Grey-Strong, #808183)",margin:0,lineHeight:"140%",textAlign:"center"},children:n}),r!==void 0&&e.jsx("div",{style:{width:"200px",height:"4px",borderRadius:"2px",background:"#ECEEF2",marginTop:"8px",overflow:"hidden"},children:e.jsx("div",{style:{width:`${Math.min(100,Math.max(0,r))}%`,height:"100%",borderRadius:"2px",background:"var(--Green-Primary, #00A66E)",transition:"width 0.3s ease"}})})]})]})}function X({title:t="File uploaded successfully!",subtitle:n="Redirecting...",actionLabel:r="Add more files",onAction:o,width:d=648,height:a=281}){return e.jsxs("div",{style:{display:"flex",width:d,height:a,padding:"88px 64px 64px 64px",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:"12px",border:"1px solid #D9D9D9",background:"var(--Grey-White, #FFF)",boxSizing:"border-box"},children:[e.jsx("div",{style:{display:"flex",width:"64px",height:"64px",justifyContent:"center",alignItems:"center",borderRadius:"9999px",background:"var(--Focus-2, #FAF5E9)",flexShrink:0,marginBottom:"8px"},children:e.jsx(y.FolderCheck,{size:24,strokeWidth:2,color:"var(--Base-Strong, #2E3236)"})}),e.jsx("p",{style:{fontSize:"16px",fontWeight:600,color:"var(--Base-Strong, #2E3236)",margin:0,lineHeight:"normal",textAlign:"center"},children:t}),e.jsx("p",{style:{fontSize:"14px",fontWeight:500,color:"var(--Grey-Strong, #808183)",margin:0,lineHeight:"140%",textAlign:"center"},children:n}),r&&o&&e.jsx("button",{onClick:o,style:{display:"flex",padding:"8px 20px",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:"6px",border:"1px solid #D9D9D9",background:"var(--Base-White, #FFF)",color:"var(--Grey-Strong, #808183)",fontSize:"14px",fontWeight:500,cursor:"pointer",marginTop:"8px",transition:"all 0.15s ease"},onMouseEnter:l=>{l.currentTarget.style.background="#ECEEF2"},onMouseLeave:l=>{l.currentTarget.style.background="var(--Base-White, #FFF)"},children:r})]})}const K={success:y.CircleCheck,information:y.Info,warning:y.OctagonAlert,error:y.AlertTriangle},V=({variant:t="success",message:n="",showClose:r,autoClose:o,onClose:d,actions:a})=>{const[l,f]=x.useState(!0),i=t==="error",C=r!==void 0?r:!0,u=o!==void 0?o:5e3,s=x.useCallback(()=>{f(!1),d==null||d()},[d]);if(x.useEffect(()=>{if(!u||!l)return;const g=setTimeout(s,u);return()=>clearTimeout(g)},[u,l,s]),!l)return null;const h=K[t]||y.CircleCheck,b={display:"inline-flex",width:"fit-content",padding:"8px 12px",alignItems:"center",gap:10,borderRadius:12,fontFamily:"var(--default-font-family)",fontSize:14,fontWeight:600,lineHeight:"normal",transition:"opacity 0.2s",boxSizing:"border-box",...i?{background:"var(--Grey-Strong, #2E3236)",color:"var(--Grey-White, #FFF)",border:"1px solid var(--Grey-Strong, #2E3236)"}:{background:"var(--Grey-Hover, #F3F7F7)",color:"var(--Grey-Strong, #2E3236)",border:"1px solid var(--Grey-Faint, #ACADAD)"}},m=i?"#FFF":"var(--Grey-Strong, #2E3236)",v=g=>({display:"flex",padding:"4px 12px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:g?600:400,fontFamily:"var(--default-font-family)",lineHeight:"150%",border:"none",borderRadius:6,cursor:"pointer",transition:"background 0.15s",...i?{background:g?"var(--Grey-White, #FFF)":"transparent",color:g?"var(--Grey-Strong, #2E3236)":"var(--Grey-White, #FFF)"}:{background:g?"var(--Grey-Strong, #2E3236)":"transparent",color:g?"var(--Grey-White, #FFF)":"var(--Grey-Strong, #2E3236)"}}),k={display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:2,marginLeft:4,flexShrink:0};return e.jsxs("div",{style:b,children:[e.jsx(h,{size:16,color:m,strokeWidth:2,style:{flexShrink:0}}),e.jsx("span",{children:n}),a&&a.length>0&&e.jsx("div",{style:{display:"flex",alignItems:"center",gap:4,marginLeft:8},children:a.map((g,F)=>e.jsx("button",{type:"button",onClick:()=>{var S;(S=g.onClick)==null||S.call(g),g.dismissOnClick!==!1&&s()},style:v(!!g.primary),children:g.label},F))}),C&&e.jsx("button",{type:"button",onClick:s,style:k,children:e.jsx(y.X,{size:16,color:i?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",strokeWidth:2})})]})},Y=({children:t})=>e.jsx("div",{style:{position:"fixed",bottom:32,left:"50%",transform:"translateX(-50%)",zIndex:9999,display:"flex",flexDirection:"column",alignItems:"center",gap:8,pointerEvents:"none"},children:e.jsx("div",{style:{pointerEvents:"auto"},children:t})});exports.AskCompass=G;exports.AutoSearch=T;exports.DrawerButton=Z;exports.DrawerInput=N;exports.DrawerLabel=O;exports.FileUploadSuccessState=X;exports.FileUploadingState=U;exports.SideDrawer=A;exports.Toast=V;exports.ToastContainer=Y;
6
+ `}),e.jsxs("div",{style:{display:"flex",width:a,height:c,padding:"88px 64px 64px 64px",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:"12px",border:"2px dashed #D9D9D9",background:"var(--Grey-White, #FFF)",boxSizing:"border-box"},children:[e.jsx(q,{size:48}),e.jsx("p",{style:{fontSize:"16px",fontWeight:600,color:"var(--Base-Strong, #2E3236)",margin:0,lineHeight:"normal",textAlign:"center"},children:t}),e.jsx("p",{style:{fontSize:"13px",fontWeight:400,color:"var(--Grey-Strong, #808183)",margin:0,lineHeight:"140%",textAlign:"center"},children:i}),n!==void 0&&e.jsx("div",{style:{width:"200px",height:"4px",borderRadius:"2px",background:"#ECEEF2",marginTop:"8px",overflow:"hidden"},children:e.jsx("div",{style:{width:`${Math.min(100,Math.max(0,n))}%`,height:"100%",borderRadius:"2px",background:"var(--Green-Primary, #00A66E)",transition:"width 0.3s ease"}})})]})]})}function Y({title:t="File uploaded successfully!",subtitle:i="Redirecting...",actionLabel:n="Add more files",onAction:a,width:c=648,height:o=281}){return e.jsxs("div",{style:{display:"flex",width:c,height:o,padding:"88px 64px 64px 64px",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:"12px",border:"1px solid #D9D9D9",background:"var(--Grey-White, #FFF)",boxSizing:"border-box"},children:[e.jsx("div",{style:{display:"flex",width:"64px",height:"64px",justifyContent:"center",alignItems:"center",borderRadius:"9999px",background:"var(--Focus-2, #FAF5E9)",flexShrink:0,marginBottom:"8px"},children:e.jsx(y.FolderCheck,{size:24,strokeWidth:2,color:"var(--Base-Strong, #2E3236)"})}),e.jsx("p",{style:{fontSize:"16px",fontWeight:600,color:"var(--Base-Strong, #2E3236)",margin:0,lineHeight:"normal",textAlign:"center"},children:t}),e.jsx("p",{style:{fontSize:"14px",fontWeight:500,color:"var(--Grey-Strong, #808183)",margin:0,lineHeight:"140%",textAlign:"center"},children:i}),n&&a&&e.jsx("button",{onClick:a,style:{display:"flex",padding:"8px 20px",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:"6px",border:"1px solid #D9D9D9",background:"var(--Base-White, #FFF)",color:"var(--Grey-Strong, #808183)",fontSize:"14px",fontWeight:500,cursor:"pointer",marginTop:"8px",transition:"all 0.15s ease"},onMouseEnter:l=>{l.currentTarget.style.background="#ECEEF2"},onMouseLeave:l=>{l.currentTarget.style.background="var(--Base-White, #FFF)"},children:n})]})}const U={success:y.CircleCheck,information:y.Info,warning:y.OctagonAlert,error:y.AlertTriangle},X=({variant:t="success",message:i="",showClose:n,autoClose:a,onClose:c,actions:o})=>{const[l,p]=u.useState(!0),s=t==="error",h=n!==void 0?n:!0,C=a!==void 0?a:5e3,d=u.useCallback(()=>{p(!1),c==null||c()},[c]);if(u.useEffect(()=>{if(!C||!l)return;const g=setTimeout(d,C);return()=>clearTimeout(g)},[C,l,d]),!l)return null;const r=U[t]||y.CircleCheck,m={display:"inline-flex",width:"fit-content",padding:"8px 12px",alignItems:"center",gap:10,borderRadius:12,fontFamily:"var(--default-font-family)",fontSize:14,fontWeight:600,lineHeight:"normal",transition:"opacity 0.2s",boxSizing:"border-box",...s?{background:"var(--Grey-Strong, #2E3236)",color:"var(--Grey-White, #FFF)",border:"1px solid var(--Grey-Strong, #2E3236)"}:{background:"var(--Grey-Hover, #F3F7F7)",color:"var(--Grey-Strong, #2E3236)",border:"1px solid var(--Grey-Faint, #ACADAD)"}},v=s?"#FFF":"var(--Grey-Strong, #2E3236)",b=g=>({display:"flex",padding:"4px 12px",justifyContent:"center",alignItems:"center",fontSize:13,fontWeight:g?600:400,fontFamily:"var(--default-font-family)",lineHeight:"150%",border:"none",borderRadius:6,cursor:"pointer",transition:"background 0.15s",...s?{background:g?"var(--Grey-White, #FFF)":"transparent",color:g?"var(--Grey-Strong, #2E3236)":"var(--Grey-White, #FFF)"}:{background:g?"var(--Grey-Strong, #2E3236)":"transparent",color:g?"var(--Grey-White, #FFF)":"var(--Grey-Strong, #2E3236)"}}),S={display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",padding:2,marginLeft:4,flexShrink:0};return e.jsxs("div",{style:m,children:[e.jsx(r,{size:16,color:v,strokeWidth:2,style:{flexShrink:0}}),e.jsx("span",{children:i}),o&&o.length>0&&e.jsx("div",{style:{display:"flex",alignItems:"center",gap:4,marginLeft:8},children:o.map((g,w)=>e.jsx("button",{type:"button",onClick:()=>{var k;(k=g.onClick)==null||k.call(g),g.dismissOnClick!==!1&&d()},style:b(!!g.primary),children:g.label},w))}),h&&e.jsx("button",{type:"button",onClick:d,style:S,children:e.jsx(y.X,{size:16,color:s?"var(--Grey-White, #FFF)":"var(--Grey-Muted, #808183)",strokeWidth:2})})]})},V=({children:t})=>e.jsx("div",{style:{position:"fixed",bottom:32,left:"50%",transform:"translateX(-50%)",zIndex:9999,display:"flex",flexDirection:"column",alignItems:"center",gap:8,pointerEvents:"none"},children:e.jsx("div",{style:{pointerEvents:"auto"},children:t})});exports.AskCompass=G;exports.AutoSearch=T;exports.DrawerButton=Z;exports.DrawerInput=N;exports.DrawerLabel=O;exports.FileUploadSuccessState=Y;exports.FileUploadingState=K;exports.SideDrawer=A;exports.Toast=X;exports.ToastContainer=V;
7
7
  //# sourceMappingURL=Toast.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.cjs.js","sources":["../src/components/common/AskCompass.jsx","../src/components/common/AutoSearch.jsx","../src/components/common/SideDrawer.jsx","../src/components/common/FileUploadingState.jsx","../src/components/common/Toast.jsx"],"sourcesContent":["\"use client\";\n\nimport React, { useState, useRef, useEffect } from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { History, MessageCircleQuestion } from \"lucide-react\";\nimport ChartRenderer from \"../chat/ChartRenderer.jsx\";\n\n/*\n * AskCompass — floating action button + AI chat panel\n *\n * Props:\n * onSend — (query: string) => void, called when user sends a message\n * onHistoryClick — () => void, called when History button is clicked (e.g. navigate to insights)\n * messages — [{ role: \"user\" | \"assistant\", content: string }], chat messages to display\n * loading — boolean, whether AI is generating a response\n * className — string, optional additional CSS classes\n */\n\nfunction CompassIcon({ size = 48, isHovered = false }) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={{ flexShrink: 0, display: \"block\" }}\n >\n <motion.rect\n width=\"48\"\n height=\"48\"\n fill=\"#2E3236\"\n initial={{ rx: 12 }}\n animate={{ rx: isHovered ? 24 : 12 }}\n transition={{ type: \"spring\", stiffness: 400, damping: 30 }}\n />\n <path d=\"M42.7803 24.0713C42.7803 19.3098 41.002 14.9639 38.0723 11.6611C34.6441 7.7964 29.6419 5.36331 24.0713 5.36328C18.5958 5.36328 13.6718 7.71492 10.249 11.4648C7.2131 14.7919 5.36329 19.2146 5.36328 24.0723C5.36328 29.4538 7.63513 34.3049 11.2744 37.7188L11.5918 38.0098C14.9101 40.9752 19.4232 42.7803 24.0723 42.7803C28.8742 42.7803 33.2527 40.9725 36.5654 37.998C40.3821 34.5709 42.7803 29.6014 42.7803 24.0713ZM44.1436 24.0713C44.1435 30.0044 41.5678 35.3371 37.4756 39.0117C33.9225 42.202 29.2231 44.1436 24.0723 44.1436C18.919 44.1436 13.9333 42.0823 10.3418 38.7129C6.43938 35.0522 4 29.8457 4 24.0723C4.00001 18.8616 5.98619 14.1142 9.24219 10.5459C12.9121 6.52517 18.1968 4 24.0713 4C30.0479 4.00003 35.416 6.61368 39.0918 10.7578C42.2339 14.3002 44.1436 18.964 44.1436 24.0713Z\" fill=\"#E8D4A3\" />\n <path d=\"M40.333 24.0725C40.333 19.8532 38.7227 16.0102 36.083 13.1252L36.0811 13.1233C33.1126 9.85842 28.832 7.80986 24.0713 7.80981C19.3005 7.80981 15.0105 9.86403 12.0352 13.137C9.40921 16.0256 7.80859 19.8614 7.80859 24.0725C7.80864 28.7008 10.0684 32.4554 13.2617 35.4573C16.2162 38.2352 19.9065 40.3342 24.0713 40.3342C28.2888 40.3342 32.1311 38.7277 35.0195 36.093L35.3223 35.8108C38.4111 32.852 40.333 28.6868 40.333 24.0725ZM41.5254 24.0725C41.5253 29.185 39.3252 33.7854 35.8223 36.9749C32.7229 39.8016 28.5972 41.5266 24.0713 41.5266C19.4923 41.5266 15.5242 39.2213 12.4453 36.3264C9.09752 33.1794 6.61724 29.1313 6.61719 24.0725C6.61719 19.5535 8.33492 15.4346 11.1523 12.3352C14.3441 8.82416 18.9506 6.61841 24.0713 6.61841C29.1808 6.61845 33.7769 8.81742 36.9619 12.3196C39.7951 15.4158 41.5254 19.5436 41.5254 24.0725Z\" fill=\"#C1D89F\" />\n <path d=\"M37.8867 24.0725C37.8867 20.3937 36.437 17.0596 34.0918 14.5842C31.5737 11.9261 28.02 10.2561 24.0713 10.2561C20.0051 10.2561 16.3493 12.0119 13.8213 14.8079C11.6042 17.2591 10.2549 20.508 10.2549 24.0725C10.255 27.9518 12.4926 30.595 15.251 33.1965C17.8271 35.6258 20.5283 37.8879 24.0713 37.8879C27.7054 37.8879 31.0113 36.4826 33.4756 34.1868C36.1894 31.6665 37.8867 28.0684 37.8867 24.0725ZM38.9092 24.0725C38.9091 28.3641 37.084 32.2294 34.1709 34.9348C31.525 37.3999 27.9741 38.9104 24.0713 38.9104C20.0772 38.9104 17.1052 36.3484 14.5508 33.9397H14.5498C11.7673 31.3154 9.23347 28.4104 9.2334 24.0725C9.2334 20.245 10.683 16.7541 13.0635 14.1223L13.3213 13.845C16.0229 11.0055 19.8407 9.23462 24.0713 9.23462C28.315 9.23466 32.1331 11.03 34.834 13.8811C37.3496 16.5365 38.9092 20.1189 38.9092 24.0725Z\" fill=\"#9BDB9C\" />\n <path d=\"M35.4395 24.0713C35.4395 20.934 34.1591 18.1016 32.1025 16.0439C30.0461 13.9864 27.2106 12.7022 24.0713 12.7021H23.9922C20.6631 12.7245 17.6733 14.1772 15.6074 16.4785C13.8003 18.4924 12.7012 21.1526 12.7012 24.0713C12.7012 25.6404 13.254 26.8046 14.0918 27.8496C14.9513 28.9216 16.0706 29.8274 17.2393 30.9336C17.7745 31.4407 18.2978 31.9913 18.8096 32.5107C19.3268 33.0357 19.84 33.5376 20.3809 33.9746C21.458 34.8449 22.6194 35.4414 24.0703 35.4414C27.1211 35.4413 29.8896 34.2382 31.9297 32.2812V32.2803C34.0921 30.2141 35.4394 27.2081 35.4395 24.0713ZM36.291 24.0713C36.291 27.341 34.9333 30.4712 32.7334 32.6846L32.5186 32.8955C30.3264 34.9983 27.3496 36.2929 24.0703 36.293C22.3559 36.293 21.0106 35.5779 19.8457 34.6367C19.2657 34.1681 18.7249 33.638 18.2031 33.1084C17.6759 32.5733 17.1754 32.0455 16.6543 31.5518V31.5527C15.5515 30.5088 14.3349 29.5146 13.4268 28.3818C12.497 27.2221 11.8497 25.8757 11.8496 24.0713C11.8496 20.9343 13.0317 18.0732 14.9736 15.9092H14.9746C17.2113 13.4178 20.4583 11.8496 24.0703 11.8496H24.2461L24.249 11.8535C27.5552 11.9012 30.5353 13.2725 32.7041 15.4424L33.1084 15.8662C35.079 18.0332 36.291 20.9074 36.291 24.0713Z\" fill=\"#74DF98\" />\n <path d=\"M32.9941 24.0725C32.9941 21.4749 31.8844 19.1375 30.1133 17.5061C28.5336 16.0513 26.4292 15.1609 24.1152 15.1497H24.0703C21.4136 15.1497 19.0292 16.3095 17.3945 18.1516C15.996 19.7271 15.1475 21.8001 15.1475 24.0725C15.1475 25.2559 15.6746 25.9577 16.4512 26.5891C16.8499 26.9133 17.2998 27.2072 17.7852 27.5413C18.2636 27.8706 18.7652 28.2327 19.2285 28.6741C19.6676 29.0922 20.0478 29.5868 20.4033 30.0774C20.7649 30.5763 21.0959 31.0625 21.458 31.5051C22.1753 32.3819 22.9426 32.9954 24.0703 32.9954C26.5368 32.9953 28.7688 31.9943 30.3848 30.3762C31.9974 28.7615 32.9941 26.5337 32.9941 24.0725ZM33.6748 24.0725C33.6747 26.7213 32.6022 29.1203 30.8672 30.8577C29.1287 32.5985 26.725 33.6759 24.0703 33.676C22.6373 33.676 21.6959 32.872 20.9307 31.9368C20.5517 31.4735 20.1972 30.9548 19.8516 30.4778C19.5877 30.1137 19.325 29.7684 19.0449 29.4612L18.7588 29.1672C18.3364 28.7649 17.8721 28.4281 17.3994 28.1028C16.934 27.7824 16.4479 27.4651 16.0215 27.1184C15.1475 26.4078 14.4659 25.5291 14.4658 24.0725C14.4658 21.6272 15.3799 19.3948 16.8848 17.6995L17.2236 17.3362C18.9317 15.6 21.2965 14.5141 23.916 14.4729L23.9209 14.467H24.0713C26.5802 14.4671 28.8638 15.4298 30.5742 17.0051C32.4796 18.7601 33.6748 21.2765 33.6748 24.0725Z\" fill=\"#4DE294\" />\n </svg>\n );\n}\n\nfunction CompassRingsIcon({ size = 48 }) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={{ flexShrink: 0, display: \"block\", aspectRatio: \"1/1\" }}\n >\n <path d=\"M46.3699 23.9994C46.3699 18.306 44.2436 13.1097 40.7405 9.16048C36.6415 4.53939 30.6603 1.63013 23.9994 1.63009C17.4524 1.63009 11.5646 4.44196 7.47201 8.92578C3.84193 12.904 1.6301 18.1922 1.63009 24.0006C1.63009 30.4354 4.34656 36.2358 8.69808 40.3178L9.07758 40.6658C13.0453 44.2116 18.4416 46.3699 24.0006 46.3699C29.7423 46.3699 34.9777 44.2084 38.9388 40.6518C43.5023 36.5539 46.3699 30.6118 46.3699 23.9994ZM48 23.9994C48 31.0937 44.9202 37.4701 40.0271 41.8638C35.7786 45.6785 30.1595 48 24.0006 48C17.8388 48 11.8773 45.5353 7.58294 41.5065C2.91679 37.1294 0 30.9039 0 24.0006C1.39062e-05 17.7702 2.37491 12.0936 6.26813 7.82699C10.6563 3.01936 16.9753 0 23.9994 0C31.1457 3.78892e-05 37.5643 3.1252 41.9596 8.08038C45.7166 12.316 48 17.8926 48 23.9994Z\" fill=\"#E8D4A3\" />\n <path d=\"M43.4432 24.0009C43.4432 18.9559 41.5178 14.3607 38.3614 10.9111L38.3591 10.9088C34.8097 7.00497 29.6913 4.55549 23.9989 4.55543C18.2944 4.55543 13.1649 7.01168 9.60722 10.9252C6.46736 14.3791 4.55348 18.9657 4.55348 24.0009C4.55354 29.535 7.25552 34.0243 11.0738 37.6137C14.6065 40.9353 19.0191 43.4452 23.9989 43.4452C29.0418 43.4451 33.6361 41.5242 37.0898 38.3739L37.4518 38.0364C41.1451 34.4986 43.4432 29.5182 43.4432 24.0009ZM44.8689 24.0009C44.8689 30.1139 42.2382 35.6146 38.0497 39.4283C34.3437 42.8083 29.4106 44.8709 23.9989 44.8709C18.5237 44.8709 13.7791 42.1144 10.0976 38.653C6.09466 34.8901 3.12896 30.0497 3.12891 24.0009C3.12891 18.5975 5.18282 13.6724 8.55163 9.96648C12.3681 5.76829 17.876 3.13086 23.9989 3.13086C30.1084 3.13091 35.604 5.76024 39.4124 9.9478C42.8001 13.6499 44.8689 18.5856 44.8689 24.0009Z\" fill=\"#C1D89F\" />\n <path d=\"M40.5188 24.0008C40.5188 19.602 38.7853 15.6155 35.9812 12.6556C32.9704 9.47725 28.7211 7.48048 23.9996 7.48043C19.1376 7.48043 14.7663 9.5798 11.7436 12.923C9.09255 15.8539 7.47921 19.7387 7.47921 24.0008C7.4793 28.6393 10.1548 31.7998 13.4531 34.9105C16.5334 37.8152 19.7632 40.5201 23.9996 40.5201C28.3449 40.52 32.2979 38.8397 35.2444 36.0945C38.4893 33.0811 40.5188 28.7787 40.5188 24.0008ZM41.7414 24.0008C41.7413 29.1323 39.559 33.754 36.0758 36.989C32.9121 39.9365 28.6662 41.7426 23.9996 41.7426C19.2238 41.7426 15.6702 38.6792 12.6159 35.7991H12.6147C9.28764 32.6613 6.2579 29.1876 6.25781 24.0008C6.25781 19.4242 7.99112 15.2501 10.8375 12.1033L11.1457 11.7717C14.376 8.37646 18.941 6.25903 23.9996 6.25903C29.0739 6.25908 33.6392 8.40576 36.8687 11.8149C39.8766 14.9899 41.7414 19.2735 41.7414 24.0008Z\" fill=\"#9BDB9C\" />\n <path d=\"M37.5923 23.9993C37.5923 20.2481 36.0614 16.8614 33.6023 14.4009C31.1434 11.9407 27.753 10.4052 23.9993 10.4051H23.9047C19.9241 10.4318 16.3492 12.1689 13.879 14.9206C11.7182 17.3286 10.404 20.5094 10.404 23.9993C10.404 25.8755 11.065 27.2676 12.0667 28.5171C13.0945 29.7989 14.4328 30.8819 15.8302 32.2046C16.4702 32.811 17.0959 33.4693 17.7078 34.0904C18.3263 34.7181 18.9399 35.3182 19.5866 35.8408C20.8746 36.8814 22.2632 37.5947 23.9981 37.5947C26.9471 37.5946 29.6159 33.4731 31.5481 31.5384C33.4763 29.6076 34.6681 26.9438 34.6681 24.001ZM35.482 24.001C35.4819 27.1682 34.1995 30.0367 32.1249 32.114C30.0462 34.1956 27.1721 35.4839 23.9978 35.484C22.2843 35.484 21.1587 34.5226 20.2437 33.4043C19.7906 32.8504 19.3668 32.2301 18.9535 31.6598C18.638 31.2245 18.3238 30.8116 17.9889 30.4443L17.6468 30.0928C17.1418 29.6117 16.5865 29.209 16.0214 28.82C15.4649 28.437 14.8837 28.0575 14.3738 27.643C13.3287 26.7933 12.5138 25.7426 12.5137 24.001C12.5137 21.0771 13.6066 18.4078 15.406 16.3807L15.8112 15.9463C17.8536 13.8703 20.6812 12.5718 23.8134 12.5226L23.8192 12.5156H23.999C26.9989 12.5157 29.7294 13.6668 31.7746 15.5504C34.053 17.6489 35.482 20.6577 35.482 24.001Z\" fill=\"#74DF98\" />\n <path d=\"M34.6681 24.001C34.6681 20.895 33.3413 18.1002 31.2235 16.1495C29.3347 14.4099 26.8184 13.3452 24.0516 13.3318H23.9978C20.8212 13.3318 17.9701 14.7186 16.0156 16.9213C14.3434 18.8051 13.3287 21.2838 13.3287 24.001C13.3288 25.4159 13.959 26.2551 14.8876 27.0101C15.3643 27.3977 15.9022 27.7491 16.4826 28.1486C17.0547 28.5424 17.6545 28.9754 18.2085 29.5031C18.7335 30.003 19.1881 30.5945 19.6132 31.1811C20.0455 31.7776 20.4414 32.359 20.8743 32.8882C21.732 33.9366 22.6494 34.6701 23.9978 34.6701C26.9471 34.67 29.6159 33.4731 31.5481 31.5384C33.4763 29.6076 34.6681 26.9438 34.6681 24.001ZM35.482 24.001C35.4819 27.1682 34.1995 30.0367 32.1249 32.114C30.0462 34.1956 27.1721 35.4839 23.9978 35.484C22.2843 35.484 21.1587 34.5226 20.2437 33.4043C19.7906 32.8504 19.3668 32.2301 18.9535 31.6598C18.638 31.2245 18.3238 30.8116 17.9889 30.4443L17.6468 30.0928C17.1418 29.6117 16.5865 29.209 16.0214 28.82C15.4649 28.437 14.8837 28.0575 14.3738 27.643C13.3287 26.7933 12.5138 25.7426 12.5137 24.001C12.5137 21.0771 13.6066 18.4078 15.406 16.3807L15.8112 15.9463C17.8536 13.8703 20.6812 12.5718 23.8134 12.5226L23.8192 12.5156H23.999C26.9989 12.5157 29.7294 13.6668 31.7746 15.5504C34.053 17.6489 35.482 20.6577 35.482 24.001Z\" fill=\"#4DE294\" />\n </svg>\n );\n}\n\n/* ─── AI Panel ─── */\nfunction AskCompassPanel({ onSend, onHistoryClick, messages = [], loading = false, statusLabel }) {\n const [query, setQuery] = useState(\"\");\n const chatRef = useRef(null);\n\n useEffect(() => {\n if (chatRef.current) {\n chatRef.current.scrollTop = chatRef.current.scrollHeight;\n }\n }, [messages]);\n\n const handleSubmit = () => {\n const trimmed = query.trim();\n if (!trimmed || loading) return;\n onSend?.(trimmed);\n setQuery(\"\");\n };\n\n const handleKeyDown = (e) => {\n if (e.key === \"Enter\" && !e.shiftKey) {\n e.preventDefault();\n handleSubmit();\n }\n };\n\n const hasMessages = messages.length > 0;\n\n return (\n <motion.div\n initial={{ opacity: 0, y: 20, scale: 0.95 }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{ opacity: 0, y: 20, scale: 0.95 }}\n transition={{ type: \"spring\", stiffness: 400, damping: 30 }}\n style={{\n display: \"flex\",\n width: 360,\n height: 709,\n padding: 24,\n flexDirection: \"column\",\n justifyContent: \"space-between\",\n borderRadius: 16,\n border: \"2px solid var(--Rail-Surface-2, #E3E1D7)\",\n background: \"var(--Grey-White, #FFF)\",\n boxSizing: \"border-box\",\n }}\n >\n {/* ─── Header ─── */}\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n alignSelf: \"stretch\",\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 8 }}>\n <div\n style={{\n display: \"flex\",\n width: 34,\n height: 34,\n justifyContent: \"center\",\n alignItems: \"center\",\n aspectRatio: \"1/1\",\n borderRadius: 9999,\n background: \"#F3F7F7\",\n }}\n >\n <MessageCircleQuestion size={20} style={{ color: \"var(--Grey-Strong, #2E3236)\" }} />\n </div>\n <span\n style={{\n fontSize: 16,\n fontWeight: 400,\n color: \"var(--Grey-Strong, #2E3236)\",\n lineHeight: \"120%\",\n }}\n >\n Ask Compass\n </span>\n </div>\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 8 }}>\n <button\n onClick={onHistoryClick}\n style={{\n display: \"flex\",\n height: 28,\n padding: \"8px 12px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: 8,\n borderRadius: 10,\n border: \"1px solid var(--Neutral-250, #BFBFBF)\",\n background: \"none\",\n cursor: \"pointer\",\n color: \"var(--Grey-Strong, #2E3236)\",\n boxSizing: \"border-box\",\n }}\n >\n <History size={16} />\n <span style={{ fontSize: 12, fontWeight: 500, lineHeight: \"120%\" }}>History</span>\n </button>\n </div>\n </div>\n\n {/* ─── Chat area ─── */}\n <div\n ref={chatRef}\n style={{\n flex: 1,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: hasMessages ? \"flex-start\" : \"center\",\n alignItems: hasMessages ? \"stretch\" : \"center\",\n gap: 12,\n overflow: \"auto\",\n marginTop: 16,\n marginBottom: 16,\n }}\n >\n {!hasMessages ? (\n <>\n <CompassRingsIcon size={48} />\n <span\n style={{\n alignSelf: \"stretch\",\n color: \"var(--Grey-Muted, #808183)\",\n textAlign: \"center\",\n fontSize: 16,\n fontWeight: 400,\n lineHeight: \"120%\",\n }}\n >\n Hello! I'm here to assist you. How can I help you today?\n </span>\n </>\n ) : (\n messages.map((msg, i) => (\n <React.Fragment key={i}>\n <div\n style={{\n display: \"flex\",\n justifyContent: msg.role === \"user\" ? \"flex-end\" : \"flex-start\",\n }}\n >\n <div\n style={{\n maxWidth: \"85%\",\n padding: \"10px 14px\",\n borderRadius: msg.role === \"user\" ? \"14px 14px 4px 14px\" : \"14px 14px 14px 4px\",\n background: msg.role === \"user\" ? \"var(--Rail-Surface-2, #E3E1D7)\" : \"#F3F7F7\",\n fontSize: 14,\n fontWeight: 400,\n color: \"var(--Grey-Strong, #2E3236)\",\n lineHeight: \"140%\",\n whiteSpace: \"pre-wrap\",\n wordBreak: \"break-word\",\n }}\n >\n {msg.content}\n </div>\n </div>\n {msg.charts?.map((chart, ci) => (\n <div\n key={`chart-${ci}`}\n style={{\n width: \"100%\",\n marginTop: 8,\n overflowX: \"auto\",\n overflowY: \"hidden\",\n }}\n >\n <div\n style={{\n width: 520,\n transform: \"scale(0.85)\",\n transformOrigin: \"top left\",\n marginBottom: -40,\n }}\n >\n <ChartRenderer\n chartType={chart.chartType}\n title={chart.title}\n xLabel={chart.xLabel}\n yLabel={chart.yLabel}\n series={chart.series}\n />\n </div>\n </div>\n ))}\n </React.Fragment>\n ))\n )}\n {loading && (\n <div style={{ display: \"flex\", justifyContent: \"flex-start\" }}>\n <div\n style={{\n padding: \"10px 14px\",\n borderRadius: \"14px 14px 14px 4px\",\n background: \"#F3F7F7\",\n fontSize: 14,\n color: \"var(--Grey-Muted, #808183)\",\n }}\n >\n {statusLabel || \"Thinking...\"}\n </div>\n </div>\n )}\n </div>\n\n {/* ─── Input area ─── */}\n <div\n style={{\n display: \"flex\",\n padding: 12,\n alignItems: \"center\",\n gap: 8,\n alignSelf: \"stretch\",\n borderRadius: 8,\n border: \"1px solid var(--Grey-absent, #D9D9D9)\",\n background: \"var(--Grey-White, #FFF)\",\n boxSizing: \"border-box\",\n }}\n >\n <input\n type=\"text\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder=\"Ask a Question\"\n disabled={loading}\n style={{\n flex: 1,\n border: \"none\",\n outline: \"none\",\n background: \"transparent\",\n fontSize: 15,\n fontWeight: 400,\n color: \"var(--Base-Strong, #2E3236)\",\n lineHeight: \"normal\",\n }}\n />\n <button\n onClick={handleSubmit}\n disabled={!query.trim() || loading}\n style={{\n display: \"flex\",\n height: 28,\n padding: \"8px 12px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: 8,\n borderRadius: 10,\n border: \"none\",\n background: \"var(--Neutral-850, #272727)\",\n color: \"#fff\",\n fontSize: 12,\n fontWeight: 500,\n cursor: query.trim() && !loading ? \"pointer\" : \"default\",\n opacity: query.trim() && !loading ? 1 : 0.4,\n flexShrink: 0,\n boxSizing: \"border-box\",\n }}\n >\n Send\n </button>\n </div>\n </motion.div>\n );\n}\n\n/* ─── Main Component ─── */\nexport default function AskCompass({\n onSend,\n onHistoryClick,\n messages = [],\n loading = false,\n statusLabel,\n className = \"\",\n}) {\n const [isHovered, setIsHovered] = useState(false);\n const [isOpen, setIsOpen] = useState(false);\n const wrapperRef = useRef(null);\n\n useEffect(() => {\n if (!isOpen) return;\n const handleClickOutside = (e) => {\n if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {\n setIsOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => document.removeEventListener(\"mousedown\", handleClickOutside);\n }, [isOpen]);\n\n return (\n <div\n ref={wrapperRef}\n className={className}\n style={{\n position: \"fixed\",\n bottom: 24,\n right: 24,\n zIndex: 1000,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-end\",\n gap: 12,\n }}\n >\n {/* Panel */}\n <AnimatePresence>\n {isOpen && (\n <AskCompassPanel\n onSend={onSend}\n onHistoryClick={onHistoryClick}\n messages={messages}\n loading={loading}\n statusLabel={statusLabel}\n />\n )}\n </AnimatePresence>\n\n {/* FAB */}\n <div\n style={{ width: 48, height: 48 }}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n <motion.button\n onClick={() => setIsOpen((prev) => !prev)}\n initial={false}\n animate={{\n width: isHovered || isOpen ? 166 : 48,\n height: isHovered || isOpen ? 56 : 48,\n borderRadius: isHovered || isOpen ? 30 : 12,\n background:\n isHovered || isOpen\n ? \"var(--Rail-Surface-2, #E3E1D7)\"\n : \"rgba(0,0,0,0)\",\n }}\n transition={{ type: \"spring\", stiffness: 400, damping: 30 }}\n style={{\n position: \"absolute\",\n right: 0,\n bottom: 0,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: isHovered || isOpen ? 10 : 0,\n padding: isHovered || isOpen ? \"0 0 0 16px\" : 0,\n border: \"none\",\n outline: \"none\",\n cursor: \"pointer\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n boxSizing: \"border-box\",\n }}\n >\n <AnimatePresence>\n {(isHovered || isOpen) && (\n <motion.span\n initial={{ opacity: 0, width: 0 }}\n animate={{ opacity: 1, width: \"auto\" }}\n exit={{ opacity: 0, width: 0 }}\n transition={{ duration: 0.15, ease: \"easeOut\" }}\n style={{\n flexShrink: 0,\n fontSize: 14,\n fontWeight: 600,\n color: \"var(--Grey-Strong, #2E3236)\",\n lineHeight: \"120%\",\n overflow: \"hidden\",\n }}\n >\n Ask Compass\n </motion.span>\n )}\n </AnimatePresence>\n\n <CompassIcon size={48} isHovered={isHovered || isOpen} />\n </motion.button>\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport React, { useState, useMemo, useRef, useEffect } from \"react\";\nimport { X, Search, PlusCircle } from \"lucide-react\";\nimport TextInput from \"../primitives/TextInput\";\nimport SmallButton from \"../primitives/SmallButton\";\n\nconst AutoSearch = ({\n options = [],\n value = null,\n onChange,\n placeholder = \"Search...\",\n disabled = false,\n showSuggestions = true,\n styling,\n isAddNew = false,\n}) => {\n const [search, setSearch] = useState(\"\");\n const [isOpen, setIsOpen] = useState(false);\n const [addedOption, setAddedOption] = useState(null);\n\n const containerRef = useRef(null);\n\n const filteredOptions = useMemo(() => {\n if (!showSuggestions) return [];\n const lower = search.toLowerCase();\n\n return options.filter((opt) => {\n if (!opt) return false;\n const label = opt.label || \"\";\n const val = opt.value || \"\";\n return (\n (label.toLowerCase().includes(lower) ||\n val.toLowerCase().includes(lower)) &&\n (!addedOption || opt.value !== addedOption.value)\n );\n });\n }, [search, options, showSuggestions, addedOption]);\n\n const exactMatchExists = useMemo(() => {\n if (!isAddNew) return false;\n const lower = search.toLowerCase();\n return options.some((opt) => {\n if (!opt) return false;\n const label = opt.label || \"\";\n const val = opt.value || \"\";\n return label.toLowerCase() === lower || val.toLowerCase() === lower;\n });\n }, [options, search, isAddNew]);\n\n // Close dropdown on outside click\n useEffect(() => {\n if (!isOpen) return;\n const handleClickOutside = (event) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target)\n ) {\n setIsOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => document.removeEventListener(\"mousedown\", handleClickOutside);\n }, [isOpen]);\n\n const handleSelect = (opt) => {\n onChange?.(opt);\n setSearch(\"\");\n setIsOpen(false);\n setAddedOption(null);\n };\n\n const handleAddNew = () => {\n const newOpt = { label: search, value: search };\n setAddedOption(newOpt);\n onChange?.(newOpt);\n setIsOpen(false);\n setSearch(\"\");\n };\n\n const handleClear = () => {\n onChange?.(null);\n setSearch(\"\");\n setIsOpen(false);\n setAddedOption(null);\n };\n\n const handleInputChange = (e) => {\n const newValue = e.target.value;\n if (showSuggestions) {\n setSearch(newValue);\n setIsOpen(true);\n } else if (isAddNew) {\n setSearch(newValue);\n setIsOpen(newValue.length >= 3);\n } else {\n onChange?.(newValue);\n }\n };\n\n const handleInputFocus = () => {\n if (showSuggestions || isAddNew) {\n setIsOpen(true);\n }\n };\n\n const shouldShowDropdown =\n isOpen && !value && (showSuggestions ? search.length >= 3 : search.length >= 3);\n\n return (\n <div className=\"relative w-full\" ref={containerRef}>\n <div\n className={\n styling\n ? styling\n : \"flex items-center gap-2 border rounded-md px-3 py-2 bg-white shadow-sm\"\n }\n >\n <Search className=\"w-4 h-4 text-gray-400\" />\n <div className=\"flex-1\">\n {showSuggestions && value ? (\n <div\n className=\"text-gray-800 truncate\"\n title={value.label}\n style={{\n fontSize: 'var(--text-sm)',\n fontWeight: 'var(--font-medium)',\n letterSpacing: 'var(--tracking-normal)',\n lineHeight: 'var(--leading-normal)',\n textTransform: 'none',\n textDecoration: 'none',\n fontFamily: 'var(--font-sans)',\n }}\n >\n {value.label}\n </div>\n ) : (\n <TextInput\n value={showSuggestions || isAddNew ? search : value || \"\"}\n onChange={(val) =>\n handleInputChange({ target: { value: val } })\n }\n placeholder={placeholder}\n disabled={disabled}\n style={{\n border: \"none\",\n boxShadow: \"none\",\n padding: 0,\n backgroundColor: \"transparent\",\n }}\n onFocus={handleInputFocus}\n />\n )}\n </div>\n {(value || addedOption) && (\n <SmallButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleClear}\n style={{\n padding: 0,\n width: 20,\n height: 20,\n border: \"none\",\n backgroundColor: \"transparent\",\n color: \"rgba(107,114,128,1)\",\n }}\n >\n <X className=\"w-3 h-3\" />\n </SmallButton>\n )}\n </div>\n\n {shouldShowDropdown && (\n <div\n className=\"absolute w-full rounded-md border border-gray-300 bg-white shadow-lg custom-thin-scrollbar-library\"\n style={{\n maxHeight: 240,\n overflowY: \"auto\",\n zIndex: 30,\n }}\n >\n {filteredOptions.length > 0 && (\n <ul className=\"m-0 p-0 list-none\">\n {filteredOptions.map((opt) => (\n <li\n key={opt.value}\n onClick={() => handleSelect(opt)}\n onMouseEnter={(e) => {\n e.currentTarget.style.backgroundColor = \"var(--hover-warm)\";\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.backgroundColor = \"transparent\";\n }}\n className=\"cursor-pointer px-4 py-2\"\n title={opt.label}\n >\n <span\n className=\"truncate block w-full\"\n style={{\n fontFamily: \"var(--font-sans)\",\n color: \"var(--text-base)\",\n fontSize: \"var(--text-sm)\",\n fontWeight: \"var(--font-medium)\",\n letterSpacing: \"var(--tracking-normal)\",\n lineHeight: \"var(--leading-normal)\",\n textTransform: \"none\",\n textDecoration: \"none\",\n }}\n >\n {opt.label}\n </span>\n </li>\n ))}\n </ul>\n )}\n\n {isAddNew &&\n !exactMatchExists &&\n !addedOption &&\n search.length >= 3 && (\n <SmallButton\n type=\"button\"\n variant=\"secondary\"\n onClick={handleAddNew}\n style={{\n width: \"100%\",\n justifyContent: \"space-between\",\n padding: \"8px 10px\",\n border: \"none\",\n borderTop: \"1px solid rgba(229, 231, 235, 1)\",\n borderRadius: 0,\n backgroundColor: \"transparent\",\n color: \"rgba(107,114,128,1)\",\n }}\n >\n <span>{`Add \"${search}\"`}</span>\n <PlusCircle className=\"w-5 h-5 text-green-500\" />\n </SmallButton>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default AutoSearch;\n\n","\"use client\";\n\nimport React, { useEffect, useRef } from \"react\";\nimport { X } from \"lucide-react\";\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 */\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}) {\n const drawerRef = useRef(null);\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 top: \"50%\",\n right: 0,\n transform: \"translateY(-50%)\",\n zIndex: 1201,\n display: \"flex\",\n width,\n height,\n maxHeight: \"100vh\",\n padding: \"20px\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: \"20px\",\n borderRadius: \"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","\"use client\";\n\nimport React from \"react\";\nimport { FolderCheck } from \"lucide-react\";\n\n/**\n * ThreeCirclesSpinner — animated concentric spinner matching the Figma asset.\n * Three arcs (outer gold, middle green, inner gold) rotating at different speeds.\n */\nfunction ThreeCirclesSpinner({ size = 48 }) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={{ animation: \"file-upload-spin 1.2s linear infinite\" }}\n >\n <path\n d=\"M43 24C43 26.4951 42.5086 28.9658 41.5537 31.271C40.5989 33.5762 39.1993 35.6707 37.435 37.435C35.6707 39.1993 33.5762 40.5989 31.271 41.5537C28.9658 42.5086 26.4951 43 24 43C21.5049 43 19.0342 42.5086 16.729 41.5537C14.4238 40.5989 12.3293 39.1993 10.565 37.435C8.80066 35.6707 7.40113 33.5762 6.44629 31.271C5.49145 28.9658 5 26.4951 5 24\"\n stroke=\"#F3E7C7\"\n strokeWidth=\"4\"\n strokeLinecap=\"round\"\n />\n <path\n d=\"M12 24C12 22.4241 12.3104 20.8637 12.9134 19.4078C13.5165 17.9519 14.4004 16.629 15.5147 15.5147C16.629 14.4004 17.9519 13.5165 19.4078 12.9134C20.8637 12.3104 22.4241 12 24 12C25.5759 12 27.1363 12.3104 28.5922 12.9134C30.0481 13.5165 31.371 14.4004 32.4853 15.5147C33.5996 16.629 34.4835 17.9519 35.0866 19.4078C35.6896 20.8637 36 22.4241 36 24\"\n stroke=\"#00A66E\"\n strokeWidth=\"4\"\n strokeLinecap=\"round\"\n />\n <path\n d=\"M20 24C20 24.5253 20.1035 25.0454 20.3045 25.5307C20.5055 26.016 20.8001 26.457 21.1716 26.8284C21.543 27.1999 21.984 27.4945 22.4693 27.6955C22.9546 27.8965 23.4747 28 24 28C24.5253 28 25.0454 27.8965 25.5307 27.6955C26.016 27.4945 26.457 27.1999 26.8284 26.8284C27.1999 26.457 27.4945 26.016 27.6955 25.5307C27.8965 25.0454 28 24.5253 28 24\"\n stroke=\"#F3E7C7\"\n strokeWidth=\"4\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\n/**\n * FileUploadingState — shows file upload progress with spinner.\n *\n * Props:\n * - title string Main message (default \"Uploading your file...\")\n * - subtitle string Secondary message (default \"Please wait while we process your file\")\n * - progress number Optional progress percentage (0-100)\n * - width number|string Container width (default 648)\n * - height number|string Container height (default 281)\n */\nexport default function FileUploadingState({\n title = \"Uploading your file...\",\n subtitle = \"Please wait while we process your file\",\n progress,\n width = 648,\n height = 281,\n}) {\n return (\n <>\n <style>{`\n @keyframes file-upload-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n `}</style>\n\n <div\n style={{\n display: \"flex\",\n width,\n height,\n padding: \"88px 64px 64px 64px\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"8px\",\n borderRadius: \"12px\",\n border: \"2px dashed #D9D9D9\",\n background: \"var(--Grey-White, #FFF)\",\n boxSizing: \"border-box\",\n }}\n >\n {/* Spinner */}\n <ThreeCirclesSpinner size={48} />\n\n {/* Title */}\n <p\n style={{\n fontSize: \"16px\",\n fontWeight: 600,\n color: \"var(--Base-Strong, #2E3236)\",\n margin: 0,\n lineHeight: \"normal\",\n textAlign: \"center\",\n }}\n >\n {title}\n </p>\n\n {/* Subtitle */}\n <p\n style={{\n fontSize: \"13px\",\n fontWeight: 400,\n color: \"var(--Grey-Strong, #808183)\",\n margin: 0,\n lineHeight: \"140%\",\n textAlign: \"center\",\n }}\n >\n {subtitle}\n </p>\n\n {/* Optional progress bar */}\n {progress !== undefined && (\n <div\n style={{\n width: \"200px\",\n height: \"4px\",\n borderRadius: \"2px\",\n background: \"#ECEEF2\",\n marginTop: \"8px\",\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n width: `${Math.min(100, Math.max(0, progress))}%`,\n height: \"100%\",\n borderRadius: \"2px\",\n background: \"var(--Green-Primary, #00A66E)\",\n transition: \"width 0.3s ease\",\n }}\n />\n </div>\n )}\n </div>\n </>\n );\n}\n\n/**\n * FileUploadSuccessState — shows upload complete with folder-check icon.\n *\n * Props:\n * - title string Main message (default \"File uploaded successfully!\")\n * - subtitle string Secondary message (default \"13 files have been uploaded to your project\")\n * - actionLabel string Button label (default \"Add more files\")\n * - onAction function Button click callback\n * - width number|string Container width (default 648)\n * - height number|string Container height (default 281)\n */\nexport function FileUploadSuccessState({\n title = \"File uploaded successfully!\",\n subtitle = \"Redirecting...\",\n actionLabel = \"Add more files\",\n onAction,\n width = 648,\n height = 281,\n}) {\n return (\n <div\n style={{\n display: \"flex\",\n width,\n height,\n padding: \"88px 64px 64px 64px\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"8px\",\n borderRadius: \"12px\",\n border: \"1px solid #D9D9D9\",\n background: \"var(--Grey-White, #FFF)\",\n boxSizing: \"border-box\",\n }}\n >\n {/* Icon circle */}\n <div\n style={{\n display: \"flex\",\n width: \"64px\",\n height: \"64px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: \"9999px\",\n background: \"var(--Focus-2, #FAF5E9)\",\n flexShrink: 0,\n marginBottom: \"8px\",\n }}\n >\n <FolderCheck size={24} strokeWidth={2} color=\"var(--Base-Strong, #2E3236)\" />\n </div>\n\n {/* Title */}\n <p\n style={{\n fontSize: \"16px\",\n fontWeight: 600,\n color: \"var(--Base-Strong, #2E3236)\",\n margin: 0,\n lineHeight: \"normal\",\n textAlign: \"center\",\n }}\n >\n {title}\n </p>\n\n {/* Subtitle */}\n <p\n style={{\n fontSize: \"14px\",\n fontWeight: 500,\n color: \"var(--Grey-Strong, #808183)\",\n margin: 0,\n lineHeight: \"140%\",\n textAlign: \"center\",\n }}\n >\n {subtitle}\n </p>\n\n {/* Action button */}\n {actionLabel && onAction && (\n <button\n onClick={onAction}\n style={{\n display: \"flex\",\n padding: \"8px 20px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"8px\",\n borderRadius: \"6px\",\n border: \"1px solid #D9D9D9\",\n background: \"var(--Base-White, #FFF)\",\n color: \"var(--Grey-Strong, #808183)\",\n fontSize: \"14px\",\n fontWeight: 500,\n cursor: \"pointer\",\n marginTop: \"8px\",\n transition: \"all 0.15s ease\",\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.background = \"#ECEEF2\";\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = \"var(--Base-White, #FFF)\";\n }}\n >\n {actionLabel}\n </button>\n )}\n </div>\n );\n}\n","import React, { useState, useEffect, useCallback } from 'react';\nimport { CircleCheck, Info, AlertTriangle, OctagonAlert, X } from 'lucide-react';\n\n/*\n * Toast — transient feedback notification\n *\n * Variants:\n * \"success\" — light theme, check icon\n * \"information\" — light theme, info icon\n * \"warning\" — light theme, shield alert icon\n * \"alert\" — dark theme, triangle icon\n *\n * Props:\n * variant — \"success\" | \"information\" | \"warning\" | \"alert\"\n * message — string, the toast message\n * showClose — boolean, show X close button (default: true)\n * autoClose — number | false, ms before auto-dismiss (default: 5000)\n * onClose — () => void, called when toast is dismissed\n * actions — [{ label, onClick, primary }], optional action buttons\n */\n\nconst ICONS = {\n success: CircleCheck,\n information: Info,\n warning: OctagonAlert,\n error: AlertTriangle,\n};\n\nconst Toast = ({\n variant = 'success',\n message = '',\n showClose: showCloseProp,\n autoClose: autoCloseProp,\n onClose,\n actions,\n}) => {\n const [visible, setVisible] = useState(true);\n\n // Theme is fixed per variant: alert = dark, success/information = light\n const isDark = variant === 'error';\n\n // Resolve showClose — default true\n const showClose = showCloseProp !== undefined ? showCloseProp : true;\n\n // Resolve autoClose — default 5s\n const autoClose = autoCloseProp !== undefined ? autoCloseProp : 5000;\n\n const handleClose = useCallback(() => {\n setVisible(false);\n onClose?.();\n }, [onClose]);\n\n // Auto-dismiss\n useEffect(() => {\n if (!autoClose || !visible) return;\n const timer = setTimeout(handleClose, autoClose);\n return () => clearTimeout(timer);\n }, [autoClose, visible, handleClose]);\n\n if (!visible) return null;\n\n const Icon = ICONS[variant] || CircleCheck;\n\n // Container\n const containerStyle = {\n display: 'inline-flex',\n width: 'fit-content',\n padding: '8px 12px',\n alignItems: 'center',\n gap: 10,\n borderRadius: 12,\n fontFamily: 'var(--default-font-family)',\n fontSize: 14,\n fontWeight: 600,\n lineHeight: 'normal',\n transition: 'opacity 0.2s',\n boxSizing: 'border-box',\n ...(isDark\n ? {\n background: 'var(--Grey-Strong, #2E3236)',\n color: 'var(--Grey-White, #FFF)',\n border: '1px solid var(--Grey-Strong, #2E3236)',\n }\n : {\n background: 'var(--Grey-Hover, #F3F7F7)',\n color: 'var(--Grey-Strong, #2E3236)',\n border: '1px solid var(--Grey-Faint, #ACADAD)',\n }),\n };\n\n const iconColor = isDark ? '#FFF' : 'var(--Grey-Strong, #2E3236)';\n\n const actionBtnStyle = (isPrimary) => ({\n display: 'flex',\n padding: '4px 12px',\n justifyContent: 'center',\n alignItems: 'center',\n fontSize: 13,\n fontWeight: isPrimary ? 600 : 400,\n fontFamily: 'var(--default-font-family)',\n lineHeight: '150%',\n border: 'none',\n borderRadius: 6,\n cursor: 'pointer',\n transition: 'background 0.15s',\n ...(isDark\n ? {\n background: isPrimary ? 'var(--Grey-White, #FFF)' : 'transparent',\n color: isPrimary ? 'var(--Grey-Strong, #2E3236)' : 'var(--Grey-White, #FFF)',\n }\n : {\n background: isPrimary ? 'var(--Grey-Strong, #2E3236)' : 'transparent',\n color: isPrimary ? 'var(--Grey-White, #FFF)' : 'var(--Grey-Strong, #2E3236)',\n }),\n });\n\n const closeBtnStyle = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n background: 'none',\n border: 'none',\n cursor: 'pointer',\n padding: 2,\n marginLeft: 4,\n flexShrink: 0,\n };\n\n return (\n <div style={containerStyle}>\n <Icon\n size={16}\n color={iconColor}\n strokeWidth={2}\n style={{ flexShrink: 0 }}\n />\n\n <span>{message}</span>\n\n {/* Action buttons */}\n {actions && actions.length > 0 && (\n <div style={{ display: 'flex', alignItems: 'center', gap: 4, marginLeft: 8 }}>\n {actions.map((action, i) => (\n <button\n key={i}\n type=\"button\"\n onClick={() => { action.onClick?.(); if (action.dismissOnClick !== false) handleClose(); }}\n style={actionBtnStyle(!!action.primary)}\n >\n {action.label}\n </button>\n ))}\n </div>\n )}\n\n {/* Close button */}\n {showClose && (\n <button\n type=\"button\"\n onClick={handleClose}\n style={closeBtnStyle}\n >\n <X\n size={16}\n color={isDark ? 'var(--Grey-White, #FFF)' : 'var(--Grey-Muted, #808183)'}\n strokeWidth={2}\n />\n </button>\n )}\n </div>\n );\n};\n\n/*\n * ToastContainer — fixed bottom-center wrapper for positioning toasts\n *\n * Usage:\n * <ToastContainer>\n * <Toast variant=\"success\" message=\"Saved!\" />\n * </ToastContainer>\n *\n * Or use Toast directly with position=\"fixed\" for standalone:\n * <Toast variant=\"success\" message=\"Saved!\" position=\"fixed\" />\n */\nconst ToastContainer = ({ children }) => (\n <div\n style={{\n position: 'fixed',\n bottom: 32,\n left: '50%',\n transform: 'translateX(-50%)',\n zIndex: 9999,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n gap: 8,\n pointerEvents: 'none',\n }}\n >\n <div style={{ pointerEvents: 'auto' }}>\n {children}\n </div>\n </div>\n);\n\nexport default Toast;\nexport { ToastContainer };\n"],"names":["CompassIcon","size","isHovered","jsxs","jsx","motion","CompassRingsIcon","AskCompassPanel","onSend","onHistoryClick","messages","loading","statusLabel","query","setQuery","useState","chatRef","useRef","useEffect","handleSubmit","trimmed","handleKeyDown","e","hasMessages","MessageCircleQuestion","History","msg","i","React","_a","chart","ci","ChartRenderer","Fragment","AskCompass","className","setIsHovered","isOpen","setIsOpen","wrapperRef","handleClickOutside","AnimatePresence","prev","AutoSearch","options","value","onChange","placeholder","disabled","showSuggestions","styling","isAddNew","search","setSearch","addedOption","setAddedOption","containerRef","filteredOptions","useMemo","lower","opt","label","val","exactMatchExists","event","handleSelect","handleAddNew","newOpt","handleClear","handleInputChange","newValue","handleInputFocus","shouldShowDropdown","Search","TextInput","SmallButton","X","PlusCircle","SideDrawer","open","onClose","title","subtitle","children","footer","width","height","toggleLabel","toggleChecked","onToggle","drawerRef","handleKey","DrawerButton","variant","onClick","isPrimary","DrawerLabel","htmlFor","DrawerInput","props","ThreeCirclesSpinner","FileUploadingState","progress","FileUploadSuccessState","actionLabel","onAction","FolderCheck","ICONS","CircleCheck","Info","OctagonAlert","AlertTriangle","Toast","message","showCloseProp","autoCloseProp","actions","visible","setVisible","isDark","showClose","autoClose","handleClose","useCallback","timer","Icon","containerStyle","iconColor","actionBtnStyle","closeBtnStyle","action","ToastContainer"],"mappings":"+NAkBA,SAASA,EAAY,CAAE,KAAAC,EAAO,GAAI,UAAAC,EAAY,IAAS,CAEnD,OAAAC,EAAA,KAAC,MAAA,CACC,MAAOF,EACP,OAAQA,EACR,QAAQ,YACR,KAAK,OACL,MAAM,6BACN,MAAO,CAAE,WAAY,EAAG,QAAS,OAAQ,EAEzC,SAAA,CAAAG,EAAA,IAACC,EAAAA,OAAO,KAAP,CACC,MAAM,KACN,OAAO,KACP,KAAK,UACL,QAAS,CAAE,GAAI,EAAG,EAClB,QAAS,CAAE,GAAIH,EAAY,GAAK,EAAG,EACnC,WAAY,CAAE,KAAM,SAAU,UAAW,IAAK,QAAS,EAAG,CAAA,CAC5D,EACCE,EAAA,IAAA,OAAA,CAAK,EAAE,oxBAAoxB,KAAK,UAAU,EAC1yBA,EAAA,IAAA,OAAA,CAAK,EAAE,2zBAA2zB,KAAK,UAAU,EACj1BA,EAAA,IAAA,OAAA,CAAK,EAAE,2yBAA2yB,KAAK,UAA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,MAAI,CAAA,MAAO,CAAE,cAAe,QAC1B,SAAA+E,EACH,CAAA,CACF"}
1
+ {"version":3,"file":"Toast.cjs.js","sources":["../src/components/common/AskCompass.jsx","../src/components/common/AutoSearch.jsx","../src/components/common/SideDrawer.jsx","../src/components/common/FileUploadingState.jsx","../src/components/common/Toast.jsx"],"sourcesContent":["\"use client\";\n\nimport React, { useState, useRef, useEffect } from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { History, MessageCircleQuestion } from \"lucide-react\";\nimport ChartRenderer from \"../chat/ChartRenderer.jsx\";\n\n/*\n * AskCompass — floating action button + AI chat panel\n *\n * Props:\n * onSend — (query: string) => void, called when user sends a message\n * onHistoryClick — () => void, called when History button is clicked (e.g. navigate to insights)\n * messages — [{ role: \"user\" | \"assistant\", content: string }], chat messages to display\n * loading — boolean, whether AI is generating a response\n * className — string, optional additional CSS classes\n */\n\nfunction CompassIcon({ size = 48, isHovered = false }) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={{ flexShrink: 0, display: \"block\" }}\n >\n <motion.rect\n width=\"48\"\n height=\"48\"\n fill=\"#2E3236\"\n initial={{ rx: 12 }}\n animate={{ rx: isHovered ? 24 : 12 }}\n transition={{ duration: 0.8, ease: [0.16, 1, 0.3, 1] }}\n />\n <path d=\"M42.7803 24.0713C42.7803 19.3098 41.002 14.9639 38.0723 11.6611C34.6441 7.7964 29.6419 5.36331 24.0713 5.36328C18.5958 5.36328 13.6718 7.71492 10.249 11.4648C7.2131 14.7919 5.36329 19.2146 5.36328 24.0723C5.36328 29.4538 7.63513 34.3049 11.2744 37.7188L11.5918 38.0098C14.9101 40.9752 19.4232 42.7803 24.0723 42.7803C28.8742 42.7803 33.2527 40.9725 36.5654 37.998C40.3821 34.5709 42.7803 29.6014 42.7803 24.0713ZM44.1436 24.0713C44.1435 30.0044 41.5678 35.3371 37.4756 39.0117C33.9225 42.202 29.2231 44.1436 24.0723 44.1436C18.919 44.1436 13.9333 42.0823 10.3418 38.7129C6.43938 35.0522 4 29.8457 4 24.0723C4.00001 18.8616 5.98619 14.1142 9.24219 10.5459C12.9121 6.52517 18.1968 4 24.0713 4C30.0479 4.00003 35.416 6.61368 39.0918 10.7578C42.2339 14.3002 44.1436 18.964 44.1436 24.0713Z\" fill=\"#E8D4A3\" />\n <path d=\"M40.333 24.0725C40.333 19.8532 38.7227 16.0102 36.083 13.1252L36.0811 13.1233C33.1126 9.85842 28.832 7.80986 24.0713 7.80981C19.3005 7.80981 15.0105 9.86403 12.0352 13.137C9.40921 16.0256 7.80859 19.8614 7.80859 24.0725C7.80864 28.7008 10.0684 32.4554 13.2617 35.4573C16.2162 38.2352 19.9065 40.3342 24.0713 40.3342C28.2888 40.3342 32.1311 38.7277 35.0195 36.093L35.3223 35.8108C38.4111 32.852 40.333 28.6868 40.333 24.0725ZM41.5254 24.0725C41.5253 29.185 39.3252 33.7854 35.8223 36.9749C32.7229 39.8016 28.5972 41.5266 24.0713 41.5266C19.4923 41.5266 15.5242 39.2213 12.4453 36.3264C9.09752 33.1794 6.61724 29.1313 6.61719 24.0725C6.61719 19.5535 8.33492 15.4346 11.1523 12.3352C14.3441 8.82416 18.9506 6.61841 24.0713 6.61841C29.1808 6.61845 33.7769 8.81742 36.9619 12.3196C39.7951 15.4158 41.5254 19.5436 41.5254 24.0725Z\" fill=\"#C1D89F\" />\n <path d=\"M37.8867 24.0725C37.8867 20.3937 36.437 17.0596 34.0918 14.5842C31.5737 11.9261 28.02 10.2561 24.0713 10.2561C20.0051 10.2561 16.3493 12.0119 13.8213 14.8079C11.6042 17.2591 10.2549 20.508 10.2549 24.0725C10.255 27.9518 12.4926 30.595 15.251 33.1965C17.8271 35.6258 20.5283 37.8879 24.0713 37.8879C27.7054 37.8879 31.0113 36.4826 33.4756 34.1868C36.1894 31.6665 37.8867 28.0684 37.8867 24.0725ZM38.9092 24.0725C38.9091 28.3641 37.084 32.2294 34.1709 34.9348C31.525 37.3999 27.9741 38.9104 24.0713 38.9104C20.0772 38.9104 17.1052 36.3484 14.5508 33.9397H14.5498C11.7673 31.3154 9.23347 28.4104 9.2334 24.0725C9.2334 20.245 10.683 16.7541 13.0635 14.1223L13.3213 13.845C16.0229 11.0055 19.8407 9.23462 24.0713 9.23462C28.315 9.23466 32.1331 11.03 34.834 13.8811C37.3496 16.5365 38.9092 20.1189 38.9092 24.0725Z\" fill=\"#9BDB9C\" />\n <path d=\"M35.4395 24.0713C35.4395 20.934 34.1591 18.1016 32.1025 16.0439C30.0461 13.9864 27.2106 12.7022 24.0713 12.7021H23.9922C20.6631 12.7245 17.6733 14.1772 15.6074 16.4785C13.8003 18.4924 12.7012 21.1526 12.7012 24.0713C12.7012 25.6404 13.254 26.8046 14.0918 27.8496C14.9513 28.9216 16.0706 29.8274 17.2393 30.9336C17.7745 31.4407 18.2978 31.9913 18.8096 32.5107C19.3268 33.0357 19.84 33.5376 20.3809 33.9746C21.458 34.8449 22.6194 35.4414 24.0703 35.4414C27.1211 35.4413 29.8896 34.2382 31.9297 32.2812V32.2803C34.0921 30.2141 35.4394 27.2081 35.4395 24.0713ZM36.291 24.0713C36.291 27.341 34.9333 30.4712 32.7334 32.6846L32.5186 32.8955C30.3264 34.9983 27.3496 36.2929 24.0703 36.293C22.3559 36.293 21.0106 35.5779 19.8457 34.6367C19.2657 34.1681 18.7249 33.638 18.2031 33.1084C17.6759 32.5733 17.1754 32.0455 16.6543 31.5518V31.5527C15.5515 30.5088 14.3349 29.5146 13.4268 28.3818C12.497 27.2221 11.8497 25.8757 11.8496 24.0713C11.8496 20.9343 13.0317 18.0732 14.9736 15.9092H14.9746C17.2113 13.4178 20.4583 11.8496 24.0703 11.8496H24.2461L24.249 11.8535C27.5552 11.9012 30.5353 13.2725 32.7041 15.4424L33.1084 15.8662C35.079 18.0332 36.291 20.9074 36.291 24.0713Z\" fill=\"#74DF98\" />\n <path d=\"M32.9941 24.0725C32.9941 21.4749 31.8844 19.1375 30.1133 17.5061C28.5336 16.0513 26.4292 15.1609 24.1152 15.1497H24.0703C21.4136 15.1497 19.0292 16.3095 17.3945 18.1516C15.996 19.7271 15.1475 21.8001 15.1475 24.0725C15.1475 25.2559 15.6746 25.9577 16.4512 26.5891C16.8499 26.9133 17.2998 27.2072 17.7852 27.5413C18.2636 27.8706 18.7652 28.2327 19.2285 28.6741C19.6676 29.0922 20.0478 29.5868 20.4033 30.0774C20.7649 30.5763 21.0959 31.0625 21.458 31.5051C22.1753 32.3819 22.9426 32.9954 24.0703 32.9954C26.5368 32.9953 28.7688 31.9943 30.3848 30.3762C31.9974 28.7615 32.9941 26.5337 32.9941 24.0725ZM33.6748 24.0725C33.6747 26.7213 32.6022 29.1203 30.8672 30.8577C29.1287 32.5985 26.725 33.6759 24.0703 33.676C22.6373 33.676 21.6959 32.872 20.9307 31.9368C20.5517 31.4735 20.1972 30.9548 19.8516 30.4778C19.5877 30.1137 19.325 29.7684 19.0449 29.4612L18.7588 29.1672C18.3364 28.7649 17.8721 28.4281 17.3994 28.1028C16.934 27.7824 16.4479 27.4651 16.0215 27.1184C15.1475 26.4078 14.4659 25.5291 14.4658 24.0725C14.4658 21.6272 15.3799 19.3948 16.8848 17.6995L17.2236 17.3362C18.9317 15.6 21.2965 14.5141 23.916 14.4729L23.9209 14.467H24.0713C26.5802 14.4671 28.8638 15.4298 30.5742 17.0051C32.4796 18.7601 33.6748 21.2765 33.6748 24.0725Z\" fill=\"#4DE294\" />\n </svg>\n );\n}\n\nfunction CompassRingsIcon({ size = 48 }) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={{ flexShrink: 0, display: \"block\", aspectRatio: \"1/1\" }}\n >\n <path d=\"M46.3699 23.9994C46.3699 18.306 44.2436 13.1097 40.7405 9.16048C36.6415 4.53939 30.6603 1.63013 23.9994 1.63009C17.4524 1.63009 11.5646 4.44196 7.47201 8.92578C3.84193 12.904 1.6301 18.1922 1.63009 24.0006C1.63009 30.4354 4.34656 36.2358 8.69808 40.3178L9.07758 40.6658C13.0453 44.2116 18.4416 46.3699 24.0006 46.3699C29.7423 46.3699 34.9777 44.2084 38.9388 40.6518C43.5023 36.5539 46.3699 30.6118 46.3699 23.9994ZM48 23.9994C48 31.0937 44.9202 37.4701 40.0271 41.8638C35.7786 45.6785 30.1595 48 24.0006 48C17.8388 48 11.8773 45.5353 7.58294 41.5065C2.91679 37.1294 0 30.9039 0 24.0006C1.39062e-05 17.7702 2.37491 12.0936 6.26813 7.82699C10.6563 3.01936 16.9753 0 23.9994 0C31.1457 3.78892e-05 37.5643 3.1252 41.9596 8.08038C45.7166 12.316 48 17.8926 48 23.9994Z\" fill=\"#E8D4A3\" />\n <path d=\"M43.4432 24.0009C43.4432 18.9559 41.5178 14.3607 38.3614 10.9111L38.3591 10.9088C34.8097 7.00497 29.6913 4.55549 23.9989 4.55543C18.2944 4.55543 13.1649 7.01168 9.60722 10.9252C6.46736 14.3791 4.55348 18.9657 4.55348 24.0009C4.55354 29.535 7.25552 34.0243 11.0738 37.6137C14.6065 40.9353 19.0191 43.4452 23.9989 43.4452C29.0418 43.4451 33.6361 41.5242 37.0898 38.3739L37.4518 38.0364C41.1451 34.4986 43.4432 29.5182 43.4432 24.0009ZM44.8689 24.0009C44.8689 30.1139 42.2382 35.6146 38.0497 39.4283C34.3437 42.8083 29.4106 44.8709 23.9989 44.8709C18.5237 44.8709 13.7791 42.1144 10.0976 38.653C6.09466 34.8901 3.12896 30.0497 3.12891 24.0009C3.12891 18.5975 5.18282 13.6724 8.55163 9.96648C12.3681 5.76829 17.876 3.13086 23.9989 3.13086C30.1084 3.13091 35.604 5.76024 39.4124 9.9478C42.8001 13.6499 44.8689 18.5856 44.8689 24.0009Z\" fill=\"#C1D89F\" />\n <path d=\"M40.5188 24.0008C40.5188 19.602 38.7853 15.6155 35.9812 12.6556C32.9704 9.47725 28.7211 7.48048 23.9996 7.48043C19.1376 7.48043 14.7663 9.5798 11.7436 12.923C9.09255 15.8539 7.47921 19.7387 7.47921 24.0008C7.4793 28.6393 10.1548 31.7998 13.4531 34.9105C16.5334 37.8152 19.7632 40.5201 23.9996 40.5201C28.3449 40.52 32.2979 38.8397 35.2444 36.0945C38.4893 33.0811 40.5188 28.7787 40.5188 24.0008ZM41.7414 24.0008C41.7413 29.1323 39.559 33.754 36.0758 36.989C32.9121 39.9365 28.6662 41.7426 23.9996 41.7426C19.2238 41.7426 15.6702 38.6792 12.6159 35.7991H12.6147C9.28764 32.6613 6.2579 29.1876 6.25781 24.0008C6.25781 19.4242 7.99112 15.2501 10.8375 12.1033L11.1457 11.7717C14.376 8.37646 18.941 6.25903 23.9996 6.25903C29.0739 6.25908 33.6392 8.40576 36.8687 11.8149C39.8766 14.9899 41.7414 19.2735 41.7414 24.0008Z\" fill=\"#9BDB9C\" />\n <path d=\"M37.5923 23.9993C37.5923 20.2481 36.0614 16.8614 33.6023 14.4009C31.1434 11.9407 27.753 10.4052 23.9993 10.4051H23.9047C19.9241 10.4318 16.3492 12.1689 13.879 14.9206C11.7182 17.3286 10.404 20.5094 10.404 23.9993C10.404 25.8755 11.065 27.2676 12.0667 28.5171C13.0945 29.7989 14.4328 30.8819 15.8302 32.2046C16.4702 32.811 17.0959 33.4693 17.7078 34.0904C18.3263 34.7181 18.9399 35.3182 19.5866 35.8408C20.8746 36.8814 22.2632 37.5947 23.9981 37.5947C26.9471 37.5946 29.6159 33.4731 31.5481 31.5384C33.4763 29.6076 34.6681 26.9438 34.6681 24.001ZM35.482 24.001C35.4819 27.1682 34.1995 30.0367 32.1249 32.114C30.0462 34.1956 27.1721 35.4839 23.9978 35.484C22.2843 35.484 21.1587 34.5226 20.2437 33.4043C19.7906 32.8504 19.3668 32.2301 18.9535 31.6598C18.638 31.2245 18.3238 30.8116 17.9889 30.4443L17.6468 30.0928C17.1418 29.6117 16.5865 29.209 16.0214 28.82C15.4649 28.437 14.8837 28.0575 14.3738 27.643C13.3287 26.7933 12.5138 25.7426 12.5137 24.001C12.5137 21.0771 13.6066 18.4078 15.406 16.3807L15.8112 15.9463C17.8536 13.8703 20.6812 12.5718 23.8134 12.5226L23.8192 12.5156H23.999C26.9989 12.5157 29.7294 13.6668 31.7746 15.5504C34.053 17.6489 35.482 20.6577 35.482 24.001Z\" fill=\"#74DF98\" />\n <path d=\"M34.6681 24.001C34.6681 20.895 33.3413 18.1002 31.2235 16.1495C29.3347 14.4099 26.8184 13.3452 24.0516 13.3318H23.9978C20.8212 13.3318 17.9701 14.7186 16.0156 16.9213C14.3434 18.8051 13.3287 21.2838 13.3287 24.001C13.3288 25.4159 13.959 26.2551 14.8876 27.0101C15.3643 27.3977 15.9022 27.7491 16.4826 28.1486C17.0547 28.5424 17.6545 28.9754 18.2085 29.5031C18.7335 30.003 19.1881 30.5945 19.6132 31.1811C20.0455 31.7776 20.4414 32.359 20.8743 32.8882C21.732 33.9366 22.6494 34.6701 23.9978 34.6701C26.9471 34.67 29.6159 33.4731 31.5481 31.5384C33.4763 29.6076 34.6681 26.9438 34.6681 24.001ZM35.482 24.001C35.4819 27.1682 34.1995 30.0367 32.1249 32.114C30.0462 34.1956 27.1721 35.4839 23.9978 35.484C22.2843 35.484 21.1587 34.5226 20.2437 33.4043C19.7906 32.8504 19.3668 32.2301 18.9535 31.6598C18.638 31.2245 18.3238 30.8116 17.9889 30.4443L17.6468 30.0928C17.1418 29.6117 16.5865 29.209 16.0214 28.82C15.4649 28.437 14.8837 28.0575 14.3738 27.643C13.3287 26.7933 12.5138 25.7426 12.5137 24.001C12.5137 21.0771 13.6066 18.4078 15.406 16.3807L15.8112 15.9463C17.8536 13.8703 20.6812 12.5718 23.8134 12.5226L23.8192 12.5156H23.999C26.9989 12.5157 29.7294 13.6668 31.7746 15.5504C34.053 17.6489 35.482 20.6577 35.482 24.001Z\" fill=\"#4DE294\" />\n </svg>\n );\n}\n\n/* ─── AI Panel ─── */\nfunction AskCompassPanel({ onSend, onHistoryClick, messages = [], loading = false, statusLabel }) {\n const [query, setQuery] = useState(\"\");\n const chatRef = useRef(null);\n const textareaRef = useRef(null);\n\n useEffect(() => {\n if (chatRef.current) {\n chatRef.current.scrollTop = chatRef.current.scrollHeight;\n }\n }, [messages]);\n\n useEffect(() => {\n const ta = textareaRef.current;\n if (!ta) return;\n ta.style.height = \"auto\";\n const max = 140;\n ta.style.height = Math.min(ta.scrollHeight, max) + \"px\";\n ta.style.overflowY = ta.scrollHeight > max ? \"auto\" : \"hidden\";\n }, [query]);\n\n const handleSubmit = () => {\n const trimmed = query.trim();\n if (!trimmed || loading) return;\n onSend?.(trimmed);\n setQuery(\"\");\n };\n\n const handleKeyDown = (e) => {\n if (e.key === \"Enter\") {\n if (e.metaKey || e.ctrlKey || e.shiftKey) {\n // Allow newline insertion (default textarea behavior)\n return;\n }\n e.preventDefault();\n handleSubmit();\n }\n };\n\n const hasMessages = messages.length > 0;\n\n return (\n <motion.div\n initial={{ opacity: 0, y: 20, scale: 0.95 }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{ opacity: 0, y: 20, scale: 0.95 }}\n transition={{ type: \"spring\", stiffness: 400, damping: 30 }}\n style={{\n display: \"flex\",\n width: 360,\n height: 709,\n padding: 24,\n flexDirection: \"column\",\n justifyContent: \"space-between\",\n borderRadius: 16,\n border: \"2px solid var(--Rail-Surface-2, #E3E1D7)\",\n background: \"var(--Grey-White, #FFF)\",\n boxSizing: \"border-box\",\n }}\n >\n {/* ─── Header ─── */}\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n alignSelf: \"stretch\",\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 8 }}>\n <div\n style={{\n display: \"flex\",\n width: 34,\n height: 34,\n justifyContent: \"center\",\n alignItems: \"center\",\n aspectRatio: \"1/1\",\n borderRadius: 9999,\n background: \"#F3F7F7\",\n }}\n >\n <MessageCircleQuestion size={20} style={{ color: \"var(--Grey-Strong, #2E3236)\" }} />\n </div>\n <span\n style={{\n fontSize: 16,\n fontWeight: 400,\n color: \"var(--Grey-Strong, #2E3236)\",\n lineHeight: \"120%\",\n }}\n >\n Ask Compass\n </span>\n </div>\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 8 }}>\n <button\n onClick={onHistoryClick}\n style={{\n display: \"flex\",\n height: 28,\n padding: \"8px 12px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: 8,\n borderRadius: 10,\n border: \"1px solid var(--Neutral-250, #BFBFBF)\",\n background: \"none\",\n cursor: \"pointer\",\n color: \"var(--Grey-Strong, #2E3236)\",\n boxSizing: \"border-box\",\n }}\n >\n <History size={16} />\n <span style={{ fontSize: 12, fontWeight: 500, lineHeight: \"120%\" }}>History</span>\n </button>\n </div>\n </div>\n\n {/* ─── Chat area ─── */}\n <div\n ref={chatRef}\n style={{\n flex: 1,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: hasMessages ? \"flex-start\" : \"center\",\n alignItems: hasMessages ? \"stretch\" : \"center\",\n gap: 12,\n overflow: \"auto\",\n marginTop: 16,\n marginBottom: 16,\n }}\n >\n {!hasMessages ? (\n <>\n <CompassRingsIcon size={48} />\n <span\n style={{\n alignSelf: \"stretch\",\n color: \"var(--Grey-Muted, #808183)\",\n textAlign: \"center\",\n fontSize: 16,\n fontWeight: 400,\n lineHeight: \"120%\",\n }}\n >\n Hello! I'm here to assist you. How can I help you today?\n </span>\n </>\n ) : (\n messages.map((msg, i) => (\n <React.Fragment key={i}>\n <div\n style={{\n display: \"flex\",\n justifyContent: msg.role === \"user\" ? \"flex-end\" : \"flex-start\",\n }}\n >\n <div\n style={{\n maxWidth: \"85%\",\n padding: \"10px 14px\",\n borderRadius: msg.role === \"user\" ? \"14px 14px 4px 14px\" : \"14px 14px 14px 4px\",\n background: msg.role === \"user\" ? \"var(--Rail-Surface-2, #E3E1D7)\" : \"#F3F7F7\",\n fontSize: 14,\n fontWeight: 400,\n color: \"var(--Grey-Strong, #2E3236)\",\n lineHeight: \"140%\",\n whiteSpace: \"pre-wrap\",\n wordBreak: \"break-word\",\n }}\n >\n {msg.content}\n </div>\n </div>\n {msg.charts?.map((chart, ci) => (\n <div\n key={`chart-${ci}`}\n style={{\n width: \"100%\",\n marginTop: 8,\n overflowX: \"auto\",\n overflowY: \"hidden\",\n }}\n >\n <div\n style={{\n width: 520,\n transform: \"scale(0.85)\",\n transformOrigin: \"top left\",\n marginBottom: -40,\n }}\n >\n <ChartRenderer\n chartType={chart.chartType}\n title={chart.title}\n xLabel={chart.xLabel}\n yLabel={chart.yLabel}\n series={chart.series}\n />\n </div>\n </div>\n ))}\n </React.Fragment>\n ))\n )}\n {loading && (\n <div style={{ display: \"flex\", justifyContent: \"flex-start\" }}>\n <div\n style={{\n padding: \"10px 14px\",\n borderRadius: \"14px 14px 14px 4px\",\n background: \"#F3F7F7\",\n fontSize: 14,\n color: \"var(--Grey-Muted, #808183)\",\n }}\n >\n {statusLabel || \"Thinking...\"}\n </div>\n </div>\n )}\n </div>\n\n {/* ─── Input area ─── */}\n <div\n style={{\n display: \"flex\",\n padding: 12,\n alignItems: \"flex-end\",\n gap: 8,\n alignSelf: \"stretch\",\n borderRadius: 8,\n border: \"1px solid var(--Grey-absent, #D9D9D9)\",\n background: \"var(--Grey-White, #FFF)\",\n boxSizing: \"border-box\",\n }}\n >\n <textarea\n ref={textareaRef}\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder=\"Ask a Question\"\n disabled={loading}\n rows={1}\n style={{\n flex: 1,\n border: \"none\",\n outline: \"none\",\n background: \"transparent\",\n fontSize: 15,\n fontWeight: 400,\n color: \"var(--Base-Strong, #2E3236)\",\n lineHeight: \"1.4\",\n resize: \"none\",\n fontFamily: \"inherit\",\n padding: 0,\n minHeight: 21,\n maxHeight: 140,\n overflowY: \"hidden\",\n }}\n />\n <button\n onClick={handleSubmit}\n disabled={!query.trim() || loading}\n style={{\n display: \"flex\",\n height: 28,\n padding: \"8px 12px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: 8,\n borderRadius: 10,\n border: \"none\",\n background: \"var(--Neutral-850, #272727)\",\n color: \"#fff\",\n fontSize: 12,\n fontWeight: 500,\n cursor: query.trim() && !loading ? \"pointer\" : \"default\",\n opacity: query.trim() && !loading ? 1 : 0.4,\n flexShrink: 0,\n boxSizing: \"border-box\",\n }}\n >\n Send\n </button>\n </div>\n </motion.div>\n );\n}\n\n/* ─── Main Component ─── */\nexport default function AskCompass({\n onSend,\n onHistoryClick,\n messages = [],\n loading = false,\n statusLabel,\n className = \"\",\n}) {\n const [isHovered, setIsHovered] = useState(false);\n const [isOpen, setIsOpen] = useState(false);\n const wrapperRef = useRef(null);\n\n useEffect(() => {\n if (!isOpen) return;\n const handleClickOutside = (e) => {\n if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {\n setIsOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => document.removeEventListener(\"mousedown\", handleClickOutside);\n }, [isOpen]);\n\n return (\n <div\n ref={wrapperRef}\n className={className}\n style={{\n position: \"fixed\",\n bottom: 24,\n right: 24,\n zIndex: 1000,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-end\",\n gap: 12,\n }}\n >\n {/* Panel */}\n <AnimatePresence>\n {isOpen && (\n <AskCompassPanel\n onSend={onSend}\n onHistoryClick={onHistoryClick}\n messages={messages}\n loading={loading}\n statusLabel={statusLabel}\n />\n )}\n </AnimatePresence>\n\n {/* FAB */}\n <div\n style={{ width: 48, height: 48 }}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n <motion.button\n onClick={() => setIsOpen((prev) => !prev)}\n initial={false}\n animate={{\n width: isHovered || isOpen ? 166 : 48,\n height: isHovered || isOpen ? 56 : 48,\n borderRadius: isHovered || isOpen ? 30 : 12,\n background:\n isHovered || isOpen\n ? \"var(--Rail-Surface-2, #E3E1D7)\"\n : \"rgba(0,0,0,0)\",\n }}\n transition={{ duration: 0.8, ease: [0.16, 1, 0.3, 1] }}\n style={{\n position: \"absolute\",\n right: 0,\n bottom: 0,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: isHovered || isOpen ? 10 : 0,\n padding: isHovered || isOpen ? \"0 0 0 16px\" : 0,\n border: \"none\",\n outline: \"none\",\n cursor: \"pointer\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n boxSizing: \"border-box\",\n }}\n >\n <AnimatePresence>\n {(isHovered || isOpen) && (\n <motion.span\n initial={{ opacity: 0, width: 0 }}\n animate={{ opacity: 1, width: \"auto\" }}\n exit={{ opacity: 0, width: 0 }}\n transition={{ duration: 0.6, ease: [0.16, 1, 0.3, 1] }}\n style={{\n flexShrink: 0,\n fontSize: 14,\n fontWeight: 600,\n color: \"var(--Grey-Strong, #2E3236)\",\n lineHeight: \"120%\",\n overflow: \"hidden\",\n }}\n >\n Ask Compass\n </motion.span>\n )}\n </AnimatePresence>\n\n <CompassIcon size={48} isHovered={isHovered || isOpen} />\n </motion.button>\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport React, { useState, useMemo, useRef, useEffect } from \"react\";\nimport { X, Search, PlusCircle } from \"lucide-react\";\nimport TextInput from \"../primitives/TextInput\";\nimport SmallButton from \"../primitives/SmallButton\";\n\nconst AutoSearch = ({\n options = [],\n value = null,\n onChange,\n placeholder = \"Search...\",\n disabled = false,\n showSuggestions = true,\n styling,\n isAddNew = false,\n}) => {\n const [search, setSearch] = useState(\"\");\n const [isOpen, setIsOpen] = useState(false);\n const [addedOption, setAddedOption] = useState(null);\n\n const containerRef = useRef(null);\n\n const filteredOptions = useMemo(() => {\n if (!showSuggestions) return [];\n const lower = search.toLowerCase();\n\n return options.filter((opt) => {\n if (!opt) return false;\n const label = opt.label || \"\";\n const val = opt.value || \"\";\n return (\n (label.toLowerCase().includes(lower) ||\n val.toLowerCase().includes(lower)) &&\n (!addedOption || opt.value !== addedOption.value)\n );\n });\n }, [search, options, showSuggestions, addedOption]);\n\n const exactMatchExists = useMemo(() => {\n if (!isAddNew) return false;\n const lower = search.toLowerCase();\n return options.some((opt) => {\n if (!opt) return false;\n const label = opt.label || \"\";\n const val = opt.value || \"\";\n return label.toLowerCase() === lower || val.toLowerCase() === lower;\n });\n }, [options, search, isAddNew]);\n\n // Close dropdown on outside click\n useEffect(() => {\n if (!isOpen) return;\n const handleClickOutside = (event) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target)\n ) {\n setIsOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => document.removeEventListener(\"mousedown\", handleClickOutside);\n }, [isOpen]);\n\n const handleSelect = (opt) => {\n onChange?.(opt);\n setSearch(\"\");\n setIsOpen(false);\n setAddedOption(null);\n };\n\n const handleAddNew = () => {\n const newOpt = { label: search, value: search };\n setAddedOption(newOpt);\n onChange?.(newOpt);\n setIsOpen(false);\n setSearch(\"\");\n };\n\n const handleClear = () => {\n onChange?.(null);\n setSearch(\"\");\n setIsOpen(false);\n setAddedOption(null);\n };\n\n const handleInputChange = (e) => {\n const newValue = e.target.value;\n if (showSuggestions) {\n setSearch(newValue);\n setIsOpen(true);\n } else if (isAddNew) {\n setSearch(newValue);\n setIsOpen(newValue.length >= 3);\n } else {\n onChange?.(newValue);\n }\n };\n\n const handleInputFocus = () => {\n if (showSuggestions || isAddNew) {\n setIsOpen(true);\n }\n };\n\n const shouldShowDropdown =\n isOpen && !value && (showSuggestions ? search.length >= 3 : search.length >= 3);\n\n return (\n <div className=\"relative w-full\" ref={containerRef}>\n <div\n className={\n styling\n ? styling\n : \"flex items-center gap-2 border rounded-md px-3 py-2 bg-white shadow-sm\"\n }\n >\n <Search className=\"w-4 h-4 text-gray-400\" />\n <div className=\"flex-1\">\n {showSuggestions && value ? (\n <div\n className=\"text-gray-800 truncate\"\n title={value.label}\n style={{\n fontSize: 'var(--text-sm)',\n fontWeight: 'var(--font-medium)',\n letterSpacing: 'var(--tracking-normal)',\n lineHeight: 'var(--leading-normal)',\n textTransform: 'none',\n textDecoration: 'none',\n fontFamily: 'var(--font-sans)',\n }}\n >\n {value.label}\n </div>\n ) : (\n <TextInput\n value={showSuggestions || isAddNew ? search : value || \"\"}\n onChange={(val) =>\n handleInputChange({ target: { value: val } })\n }\n placeholder={placeholder}\n disabled={disabled}\n style={{\n border: \"none\",\n boxShadow: \"none\",\n padding: 0,\n backgroundColor: \"transparent\",\n }}\n onFocus={handleInputFocus}\n />\n )}\n </div>\n {(value || addedOption) && (\n <SmallButton\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleClear}\n style={{\n padding: 0,\n width: 20,\n height: 20,\n border: \"none\",\n backgroundColor: \"transparent\",\n color: \"rgba(107,114,128,1)\",\n }}\n >\n <X className=\"w-3 h-3\" />\n </SmallButton>\n )}\n </div>\n\n {shouldShowDropdown && (\n <div\n className=\"absolute w-full rounded-md border border-gray-300 bg-white shadow-lg custom-thin-scrollbar-library\"\n style={{\n maxHeight: 240,\n overflowY: \"auto\",\n zIndex: 30,\n }}\n >\n {filteredOptions.length > 0 && (\n <ul className=\"m-0 p-0 list-none\">\n {filteredOptions.map((opt) => (\n <li\n key={opt.value}\n onClick={() => handleSelect(opt)}\n onMouseEnter={(e) => {\n e.currentTarget.style.backgroundColor = \"var(--hover-warm)\";\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.backgroundColor = \"transparent\";\n }}\n className=\"cursor-pointer px-4 py-2\"\n title={opt.label}\n >\n <span\n className=\"truncate block w-full\"\n style={{\n fontFamily: \"var(--font-sans)\",\n color: \"var(--text-base)\",\n fontSize: \"var(--text-sm)\",\n fontWeight: \"var(--font-medium)\",\n letterSpacing: \"var(--tracking-normal)\",\n lineHeight: \"var(--leading-normal)\",\n textTransform: \"none\",\n textDecoration: \"none\",\n }}\n >\n {opt.label}\n </span>\n </li>\n ))}\n </ul>\n )}\n\n {isAddNew &&\n !exactMatchExists &&\n !addedOption &&\n search.length >= 3 && (\n <SmallButton\n type=\"button\"\n variant=\"secondary\"\n onClick={handleAddNew}\n style={{\n width: \"100%\",\n justifyContent: \"space-between\",\n padding: \"8px 10px\",\n border: \"none\",\n borderTop: \"1px solid rgba(229, 231, 235, 1)\",\n borderRadius: 0,\n backgroundColor: \"transparent\",\n color: \"rgba(107,114,128,1)\",\n }}\n >\n <span>{`Add \"${search}\"`}</span>\n <PlusCircle className=\"w-5 h-5 text-green-500\" />\n </SmallButton>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default AutoSearch;\n\n","\"use client\";\n\nimport React, { useEffect, useRef } from \"react\";\nimport { X } from \"lucide-react\";\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 */\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}) {\n const drawerRef = useRef(null);\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 top: \"50%\",\n right: 0,\n transform: \"translateY(-50%)\",\n zIndex: 1201,\n display: \"flex\",\n width,\n height,\n maxHeight: \"100vh\",\n padding: \"20px\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: \"20px\",\n borderRadius: \"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","\"use client\";\n\nimport React from \"react\";\nimport { FolderCheck } from \"lucide-react\";\n\n/**\n * ThreeCirclesSpinner — animated concentric spinner matching the Figma asset.\n * Three arcs (outer gold, middle green, inner gold) rotating at different speeds.\n */\nfunction ThreeCirclesSpinner({ size = 48 }) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 48 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={{ animation: \"file-upload-spin 1.2s linear infinite\" }}\n >\n <path\n d=\"M43 24C43 26.4951 42.5086 28.9658 41.5537 31.271C40.5989 33.5762 39.1993 35.6707 37.435 37.435C35.6707 39.1993 33.5762 40.5989 31.271 41.5537C28.9658 42.5086 26.4951 43 24 43C21.5049 43 19.0342 42.5086 16.729 41.5537C14.4238 40.5989 12.3293 39.1993 10.565 37.435C8.80066 35.6707 7.40113 33.5762 6.44629 31.271C5.49145 28.9658 5 26.4951 5 24\"\n stroke=\"#F3E7C7\"\n strokeWidth=\"4\"\n strokeLinecap=\"round\"\n />\n <path\n d=\"M12 24C12 22.4241 12.3104 20.8637 12.9134 19.4078C13.5165 17.9519 14.4004 16.629 15.5147 15.5147C16.629 14.4004 17.9519 13.5165 19.4078 12.9134C20.8637 12.3104 22.4241 12 24 12C25.5759 12 27.1363 12.3104 28.5922 12.9134C30.0481 13.5165 31.371 14.4004 32.4853 15.5147C33.5996 16.629 34.4835 17.9519 35.0866 19.4078C35.6896 20.8637 36 22.4241 36 24\"\n stroke=\"#00A66E\"\n strokeWidth=\"4\"\n strokeLinecap=\"round\"\n />\n <path\n d=\"M20 24C20 24.5253 20.1035 25.0454 20.3045 25.5307C20.5055 26.016 20.8001 26.457 21.1716 26.8284C21.543 27.1999 21.984 27.4945 22.4693 27.6955C22.9546 27.8965 23.4747 28 24 28C24.5253 28 25.0454 27.8965 25.5307 27.6955C26.016 27.4945 26.457 27.1999 26.8284 26.8284C27.1999 26.457 27.4945 26.016 27.6955 25.5307C27.8965 25.0454 28 24.5253 28 24\"\n stroke=\"#F3E7C7\"\n strokeWidth=\"4\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\n/**\n * FileUploadingState — shows file upload progress with spinner.\n *\n * Props:\n * - title string Main message (default \"Uploading your file...\")\n * - subtitle string Secondary message (default \"Please wait while we process your file\")\n * - progress number Optional progress percentage (0-100)\n * - width number|string Container width (default 648)\n * - height number|string Container height (default 281)\n */\nexport default function FileUploadingState({\n title = \"Uploading your file...\",\n subtitle = \"Please wait while we process your file\",\n progress,\n width = 648,\n height = 281,\n}) {\n return (\n <>\n <style>{`\n @keyframes file-upload-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n `}</style>\n\n <div\n style={{\n display: \"flex\",\n width,\n height,\n padding: \"88px 64px 64px 64px\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"8px\",\n borderRadius: \"12px\",\n border: \"2px dashed #D9D9D9\",\n background: \"var(--Grey-White, #FFF)\",\n boxSizing: \"border-box\",\n }}\n >\n {/* Spinner */}\n <ThreeCirclesSpinner size={48} />\n\n {/* Title */}\n <p\n style={{\n fontSize: \"16px\",\n fontWeight: 600,\n color: \"var(--Base-Strong, #2E3236)\",\n margin: 0,\n lineHeight: \"normal\",\n textAlign: \"center\",\n }}\n >\n {title}\n </p>\n\n {/* Subtitle */}\n <p\n style={{\n fontSize: \"13px\",\n fontWeight: 400,\n color: \"var(--Grey-Strong, #808183)\",\n margin: 0,\n lineHeight: \"140%\",\n textAlign: \"center\",\n }}\n >\n {subtitle}\n </p>\n\n {/* Optional progress bar */}\n {progress !== undefined && (\n <div\n style={{\n width: \"200px\",\n height: \"4px\",\n borderRadius: \"2px\",\n background: \"#ECEEF2\",\n marginTop: \"8px\",\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n width: `${Math.min(100, Math.max(0, progress))}%`,\n height: \"100%\",\n borderRadius: \"2px\",\n background: \"var(--Green-Primary, #00A66E)\",\n transition: \"width 0.3s ease\",\n }}\n />\n </div>\n )}\n </div>\n </>\n );\n}\n\n/**\n * FileUploadSuccessState — shows upload complete with folder-check icon.\n *\n * Props:\n * - title string Main message (default \"File uploaded successfully!\")\n * - subtitle string Secondary message (default \"13 files have been uploaded to your project\")\n * - actionLabel string Button label (default \"Add more files\")\n * - onAction function Button click callback\n * - width number|string Container width (default 648)\n * - height number|string Container height (default 281)\n */\nexport function FileUploadSuccessState({\n title = \"File uploaded successfully!\",\n subtitle = \"Redirecting...\",\n actionLabel = \"Add more files\",\n onAction,\n width = 648,\n height = 281,\n}) {\n return (\n <div\n style={{\n display: \"flex\",\n width,\n height,\n padding: \"88px 64px 64px 64px\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"8px\",\n borderRadius: \"12px\",\n border: \"1px solid #D9D9D9\",\n background: \"var(--Grey-White, #FFF)\",\n boxSizing: \"border-box\",\n }}\n >\n {/* Icon circle */}\n <div\n style={{\n display: \"flex\",\n width: \"64px\",\n height: \"64px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: \"9999px\",\n background: \"var(--Focus-2, #FAF5E9)\",\n flexShrink: 0,\n marginBottom: \"8px\",\n }}\n >\n <FolderCheck size={24} strokeWidth={2} color=\"var(--Base-Strong, #2E3236)\" />\n </div>\n\n {/* Title */}\n <p\n style={{\n fontSize: \"16px\",\n fontWeight: 600,\n color: \"var(--Base-Strong, #2E3236)\",\n margin: 0,\n lineHeight: \"normal\",\n textAlign: \"center\",\n }}\n >\n {title}\n </p>\n\n {/* Subtitle */}\n <p\n style={{\n fontSize: \"14px\",\n fontWeight: 500,\n color: \"var(--Grey-Strong, #808183)\",\n margin: 0,\n lineHeight: \"140%\",\n textAlign: \"center\",\n }}\n >\n {subtitle}\n </p>\n\n {/* Action button */}\n {actionLabel && onAction && (\n <button\n onClick={onAction}\n style={{\n display: \"flex\",\n padding: \"8px 20px\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"8px\",\n borderRadius: \"6px\",\n border: \"1px solid #D9D9D9\",\n background: \"var(--Base-White, #FFF)\",\n color: \"var(--Grey-Strong, #808183)\",\n fontSize: \"14px\",\n fontWeight: 500,\n cursor: \"pointer\",\n marginTop: \"8px\",\n transition: \"all 0.15s ease\",\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.background = \"#ECEEF2\";\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.background = \"var(--Base-White, #FFF)\";\n }}\n >\n {actionLabel}\n </button>\n )}\n </div>\n );\n}\n","import React, { useState, useEffect, useCallback } from 'react';\nimport { CircleCheck, Info, AlertTriangle, OctagonAlert, X } from 'lucide-react';\n\n/*\n * Toast — transient feedback notification\n *\n * Variants:\n * \"success\" — light theme, check icon\n * \"information\" — light theme, info icon\n * \"warning\" — light theme, shield alert icon\n * \"alert\" — dark theme, triangle icon\n *\n * Props:\n * variant — \"success\" | \"information\" | \"warning\" | \"alert\"\n * message — string, the toast message\n * showClose — boolean, show X close button (default: true)\n * autoClose — number | false, ms before auto-dismiss (default: 5000)\n * onClose — () => void, called when toast is dismissed\n * actions — [{ label, onClick, primary }], optional action buttons\n */\n\nconst ICONS = {\n success: CircleCheck,\n information: Info,\n warning: OctagonAlert,\n error: AlertTriangle,\n};\n\nconst Toast = ({\n variant = 'success',\n message = '',\n showClose: showCloseProp,\n autoClose: autoCloseProp,\n onClose,\n actions,\n}) => {\n const [visible, setVisible] = useState(true);\n\n // Theme is fixed per variant: alert = dark, success/information = light\n const isDark = variant === 'error';\n\n // Resolve showClose — default true\n const showClose = showCloseProp !== undefined ? showCloseProp : true;\n\n // Resolve autoClose — default 5s\n const autoClose = autoCloseProp !== undefined ? autoCloseProp : 5000;\n\n const handleClose = useCallback(() => {\n setVisible(false);\n onClose?.();\n }, [onClose]);\n\n // Auto-dismiss\n useEffect(() => {\n if (!autoClose || !visible) return;\n const timer = setTimeout(handleClose, autoClose);\n return () => clearTimeout(timer);\n }, [autoClose, visible, handleClose]);\n\n if (!visible) return null;\n\n const Icon = ICONS[variant] || CircleCheck;\n\n // Container\n const containerStyle = {\n display: 'inline-flex',\n width: 'fit-content',\n padding: '8px 12px',\n alignItems: 'center',\n gap: 10,\n borderRadius: 12,\n fontFamily: 'var(--default-font-family)',\n fontSize: 14,\n fontWeight: 600,\n lineHeight: 'normal',\n transition: 'opacity 0.2s',\n boxSizing: 'border-box',\n ...(isDark\n ? {\n background: 'var(--Grey-Strong, #2E3236)',\n color: 'var(--Grey-White, #FFF)',\n border: '1px solid var(--Grey-Strong, #2E3236)',\n }\n : {\n background: 'var(--Grey-Hover, #F3F7F7)',\n color: 'var(--Grey-Strong, #2E3236)',\n border: '1px solid var(--Grey-Faint, #ACADAD)',\n }),\n };\n\n const iconColor = isDark ? '#FFF' : 'var(--Grey-Strong, #2E3236)';\n\n const actionBtnStyle = (isPrimary) => ({\n display: 'flex',\n padding: '4px 12px',\n justifyContent: 'center',\n alignItems: 'center',\n fontSize: 13,\n fontWeight: isPrimary ? 600 : 400,\n fontFamily: 'var(--default-font-family)',\n lineHeight: '150%',\n border: 'none',\n borderRadius: 6,\n cursor: 'pointer',\n transition: 'background 0.15s',\n ...(isDark\n ? {\n background: isPrimary ? 'var(--Grey-White, #FFF)' : 'transparent',\n color: isPrimary ? 'var(--Grey-Strong, #2E3236)' : 'var(--Grey-White, #FFF)',\n }\n : {\n background: isPrimary ? 'var(--Grey-Strong, #2E3236)' : 'transparent',\n color: isPrimary ? 'var(--Grey-White, #FFF)' : 'var(--Grey-Strong, #2E3236)',\n }),\n });\n\n const closeBtnStyle = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n background: 'none',\n border: 'none',\n cursor: 'pointer',\n padding: 2,\n marginLeft: 4,\n flexShrink: 0,\n };\n\n return (\n <div style={containerStyle}>\n <Icon\n size={16}\n color={iconColor}\n strokeWidth={2}\n style={{ flexShrink: 0 }}\n />\n\n <span>{message}</span>\n\n {/* Action buttons */}\n {actions && actions.length > 0 && (\n <div style={{ display: 'flex', alignItems: 'center', gap: 4, marginLeft: 8 }}>\n {actions.map((action, i) => (\n <button\n key={i}\n type=\"button\"\n onClick={() => { action.onClick?.(); if (action.dismissOnClick !== false) handleClose(); }}\n style={actionBtnStyle(!!action.primary)}\n >\n {action.label}\n </button>\n ))}\n </div>\n )}\n\n {/* Close button */}\n {showClose && (\n <button\n type=\"button\"\n onClick={handleClose}\n style={closeBtnStyle}\n >\n <X\n size={16}\n color={isDark ? 'var(--Grey-White, #FFF)' : 'var(--Grey-Muted, #808183)'}\n strokeWidth={2}\n />\n </button>\n )}\n </div>\n );\n};\n\n/*\n * ToastContainer — fixed bottom-center wrapper for positioning toasts\n *\n * Usage:\n * <ToastContainer>\n * <Toast variant=\"success\" message=\"Saved!\" />\n * </ToastContainer>\n *\n * Or use Toast directly with position=\"fixed\" for standalone:\n * <Toast variant=\"success\" message=\"Saved!\" position=\"fixed\" />\n */\nconst ToastContainer = ({ children }) => (\n <div\n style={{\n position: 'fixed',\n bottom: 32,\n left: '50%',\n transform: 'translateX(-50%)',\n zIndex: 9999,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n gap: 8,\n pointerEvents: 'none',\n }}\n >\n <div style={{ pointerEvents: 'auto' }}>\n {children}\n </div>\n </div>\n);\n\nexport default Toast;\nexport { ToastContainer };\n"],"names":["CompassIcon","size","isHovered","jsxs","jsx","motion","CompassRingsIcon","AskCompassPanel","onSend","onHistoryClick","messages","loading","statusLabel","query","setQuery","useState","chatRef","useRef","textareaRef","useEffect","ta","max","handleSubmit","trimmed","handleKeyDown","e","hasMessages","MessageCircleQuestion","History","msg","i","React","_a","chart","ci","ChartRenderer","Fragment","AskCompass","className","setIsHovered","isOpen","setIsOpen","wrapperRef","handleClickOutside","AnimatePresence","prev","AutoSearch","options","value","onChange","placeholder","disabled","showSuggestions","styling","isAddNew","search","setSearch","addedOption","setAddedOption","containerRef","filteredOptions","useMemo","lower","opt","label","val","exactMatchExists","event","handleSelect","handleAddNew","newOpt","handleClear","handleInputChange","newValue","handleInputFocus","shouldShowDropdown","Search","TextInput","SmallButton","X","PlusCircle","SideDrawer","open","onClose","title","subtitle","children","footer","width","height","toggleLabel","toggleChecked","onToggle","drawerRef","handleKey","DrawerButton","variant","onClick","isPrimary","DrawerLabel","htmlFor","DrawerInput","props","ThreeCirclesSpinner","FileUploadingState","progress","FileUploadSuccessState","actionLabel","onAction","FolderCheck","ICONS","CircleCheck","Info","OctagonAlert","AlertTriangle","Toast","message","showCloseProp","autoCloseProp","actions","visible","setVisible","isDark","showClose","autoClose","handleClose","useCallback","timer","Icon","containerStyle","iconColor","actionBtnStyle","closeBtnStyle","action","ToastContainer"],"mappings":"+NAkBA,SAASA,EAAY,CAAE,KAAAC,EAAO,GAAI,UAAAC,EAAY,IAAS,CAEnD,OAAAC,EAAA,KAAC,MAAA,CACC,MAAOF,EACP,OAAQA,EACR,QAAQ,YACR,KAAK,OACL,MAAM,6BACN,MAAO,CAAE,WAAY,EAAG,QAAS,OAAQ,EAEzC,SAAA,CAAAG,EAAA,IAACC,EAAAA,OAAO,KAAP,CACC,MAAM,KACN,OAAO,KACP,KAAK,UACL,QAAS,CAAE,GAAI,EAAG,EAClB,QAAS,CAAE,GAAIH,EAAY,GAAK,EAAG,EACnC,WAAY,CAAE,SAAU,GAAK,KAAM,CAAC,IAAM,EAAG,GAAK,CAAC,CAAE,CAAA,CACvD,EACCE,EAAA,IAAA,OAAA,CAAK,EAAE,oxBAAoxB,KAAK,UAAU,EAC1yBA,EAAA,IAAA,OAAA,CAAK,EAAE,2zBAA2zB,KAAK,UAAU,EACj1BA,EAAA,IAAA,OAAA,CAAK,EAAE,2yBAA2yB,KAAK,UAAU,EACj0BA,EAAA,IAAA,OAAA,CAAK,EAAE,6oCAA6oC,KAAK,UAAU,EACnqCA,EAAA,IAAA,OAAA,CAAK,EAAE,wtCAAwtC,KAAK,UAAU,CAA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