(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1979],{15143:function(e,n,r){Promise.resolve().then(r.bind(r,37492))},25512:function(e,n,r){"use strict";r.d(n,{P:function(){return t.Z},Q:function(){return l.Z}});var t=r(27281),l=r(57365)},37492:function(e,n,r){"use strict";r.r(n);var t=r(57437),l=r(66600),o=r(39760);n.default=()=>{let{token:e,accessToken:n,userRole:r,userId:a,premiumUser:i}=(0,o.Z)();return(0,t.jsx)(l.Z,{accessToken:n,token:e,userRole:r,userID:a,premiumUser:i})}},39760:function(e,n,r){"use strict";var t=r(2265),l=r(99376),o=r(14474),a=r(3914),i=r(19250);n.Z=()=>{var e,n,r,u,s,c;let d=(0,l.useRouter)(),m="undefined"!=typeof document?(0,a.e)("token"):null;(0,t.useEffect)(()=>{m||d.replace("".concat((0,i.getProxyBaseUrl)(),"/ui/login"))},[m,d]);let f=(0,t.useMemo)(()=>{if(!m)return null;try{return(0,o.o)(m)}catch(e){return(0,a.b)(),d.replace("".concat((0,i.getProxyBaseUrl)(),"/ui/login")),null}},[m,d]);return{token:m,accessToken:null!==(e=null==f?void 0:f.key)&&void 0!==e?e:null,userId:null!==(n=null==f?void 0:f.user_id)&&void 0!==n?n:null,userEmail:null!==(r=null==f?void 0:f.user_email)&&void 0!==r?r:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(u=null==f?void 0:f.user_role)&&void 0!==u?u:null),premiumUser:null!==(s=null==f?void 0:f.premium_user)&&void 0!==s?s:null,disabledPersonalKeyCreation:null!==(c=null==f?void 0:f.disabled_non_admin_personal_key_creation)&&void 0!==c?c:null,showSSOBanner:(null==f?void 0:f.login_method)==="username_password"}}},10703:function(e,n,r){"use strict";r.d(n,{p:function(){return l}});var t=r(19250);let l=async e=>{try{let n=await (0,t.modelHubCall)(e);if(console.log("model_info:",n),(null==n?void 0:n.data.length)>0){let e=n.data.map(e=>({model_group:e.model_group,mode:null==e?void 0:e.mode}));return e.sort((e,n)=>e.model_group.localeCompare(n.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}}},24199:function(e,n,r){"use strict";r.d(n,{Z:function(){return o}});var t=r(57437);r(2265);var l=r(30150),o=e=>{let{step:n=.01,style:r={width:"100%"},placeholder:o="Enter a numerical value",min:a,max:i,onChange:u,...s}=e;return(0,t.jsx)(l.Z,{onWheel:e=>e.currentTarget.blur(),step:n,style:r,placeholder:o,min:a,max:i,onChange:u,...s})}},39789:function(e,n,r){"use strict";r.d(n,{Z:function(){return i}});var t=r(57437),l=r(2265),o=r(88237),a=r(84264),i=e=>{let{value:n,onValueChange:r,label:i="Select Time Range",className:u="",showTimeRange:s=!0}=e,[c,d]=(0,l.useState)(!1),m=(0,l.useRef)(null),f=(0,l.useCallback)(e=>{d(!0),setTimeout(()=>d(!1),1500),r(e),requestIdleCallback(()=>{if(e.from){let n;let t={...e},l=new Date(e.from);n=new Date(e.to?e.to:e.from),l.toDateString(),n.toDateString(),l.setHours(0,0,0,0),n.setHours(23,59,59,999),t.from=l,t.to=n,r(t)}},{timeout:100})},[r]),h=(0,l.useCallback)((e,n)=>{if(!e||!n)return"";let r=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==n.toDateString())return"".concat(r(e)," - ").concat(r(n));{let r=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),t=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),l=n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(r,": ").concat(t," - ").concat(l)}},[]);return(0,t.jsxs)("div",{className:u,children:[i&&(0,t.jsx)(a.Z,{className:"mb-2",children:i}),(0,t.jsxs)("div",{className:"relative w-fit",children:[(0,t.jsx)("div",{ref:m,children:(0,t.jsx)(o.Z,{enableSelect:!0,value:n,onValueChange:f,placeholder:"Select date range",enableClear:!1,style:{zIndex:100}})}),c&&(0,t.jsx)("div",{className:"absolute top-1/2 animate-pulse",style:{left:"calc(100% + 8px)",transform:"translateY(-50%)",zIndex:110},children:(0,t.jsxs)("div",{className:"flex items-center gap-1 text-green-600 text-sm font-medium bg-white px-2 py-1 rounded-full border border-green-200 shadow-sm whitespace-nowrap",children:[(0,t.jsx)("div",{className:"w-3 h-3 bg-green-500 text-white rounded-full flex items-center justify-center text-xs",children:"✓"}),(0,t.jsx)("span",{className:"text-xs",children:"Selected"})]})})]}),s&&n.from&&n.to&&(0,t.jsx)(a.Z,{className:"mt-2 text-xs text-gray-500",children:h(n.from,n.to)})]})}}},function(e){e.O(0,[1047,9028,9409,4865,1442,2926,5333,7996,9611,8237,2377,8049,6600,2971,2117,1744],function(){return e(e.s=15143)}),_N_E=e.O()}]);