1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9578],{17982:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(22222).A)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},49319:(e,t,a)=>{a.d(t,{F2:()=>D,_V:()=>b,cw:()=>j,et:()=>y,sM:()=>g,z6:()=>v});var l=a(73154),s=a(96810),n=a(39156),r=a(97638),o=a(86843),d=a(55247),i=a(72764),c=a(18799),u=a(93367),m=a(92125),f=a(90270),h=a(70883),p=a(62583),x=a(41659);function y(e){let{variant:t,itemId:a,projectId:u,isTableAction:p=!1,scope:x,invalidateFunc:y,redirectUrl:v,deleteConfirmation:g,icon:j=!1,enabled:b=!0,captureDeleteOpen:D,captureDeleteSuccess:w,entityToDeleteName:N,executeDeleteMutation:M,isDeleteMutationLoading:C,customDeletePrompt:k}=e,[_,P]=(0,s.useState)(!1),B=(0,n.useRouter)(),A=(0,m.B)(),[F,S]=(0,s.useState)(""),T=(0,c.lp)({projectId:u,scope:x}),U=(0,s.useMemo)(()=>()=>{P(!0),w(A,p),!p&&v?B.push(v):y()},[p,v,y,B,w,A]);return(0,l.jsxs)(r.AM,{"data-sentry-element":"Popover","data-sentry-component":"DeleteButton","data-sentry-source-file":"deleteButton.tsx",children:[(0,l.jsx)(r.Wv,{asChild:!0,"data-sentry-element":"PopoverTrigger","data-sentry-source-file":"deleteButton.tsx",children:(0,l.jsx)(o.$,{variant:null!=t?t:j?"outline":"ghost",size:j?"icon":"default",disabled:!T||!b,onClick:e=>{e.stopPropagation(),D(A,p)},"data-sentry-element":"Button","data-sentry-source-file":"deleteButton.tsx",children:j?(0,l.jsx)(d.A,{className:"h-4 w-4"}):(0,l.jsxs)(l.Fragment,{children:[T?(0,l.jsx)(d.A,{className:"mr-2 h-4 w-4"}):(0,l.jsx)(i.A,{className:"mr-2 h-4 w-4"}),"Delete"]})})}),(0,l.jsxs)(r.hl,{onClick:e=>e.stopPropagation(),"data-sentry-element":"PopoverContent","data-sentry-source-file":"deleteButton.tsx",children:[(0,l.jsx)("h2",{className:"text-md mb-3 font-semibold",children:"Please confirm"}),(0,l.jsx)("p",{className:"mb-3 max-w-72 text-sm",children:null!=k?k:"This action cannot be undone. It removes all the data associated with\n this ".concat(N,". If this is the project default, it will be deleted for all users.")}),g&&(0,l.jsxs)("div",{className:"mb-4 grid w-full gap-1.5",children:[(0,l.jsxs)(h.J,{htmlFor:"delete-confirmation",children:['Type "',g,'" to confirm']}),(0,l.jsx)(f.p,{id:"delete-confirmation",value:F,onChange:e=>S(e.target.value)})]}),(0,l.jsx)("div",{className:"flex justify-end space-x-4",children:(0,l.jsxs)(o.$,{type:"button",variant:"destructive",loading:C||_,onClick:()=>{if(g&&F!==g)return void alert("Please type the correct confirmation");M(U)},"data-sentry-element":"Button","data-sentry-source-file":"deleteButton.tsx",children:["Delete ",N]})})]})]},null!=a?a:"delete-action")}function v(e){let t=u.FH.useUtils(),{itemId:a,projectId:s,scope:n="traces:delete",invalidateFunc:r=()=>void t.traces.all.invalidate()}=e,o=u.FH.traces.deleteMany.useMutation(),d=async e=>{try{await o.mutateAsync({traceIds:[a],projectId:s})}catch(e){return Promise.reject(e)}(0,p.G)({title:"Trace deleted",description:"Selected trace will be deleted. Traces are removed asynchronously and may continue to be visible for up to 24 hours."}),e()},i=(0,x.Jz)("trace-deletion");return(0,l.jsx)(y,{...e,scope:n,invalidateFunc:r,captureDeleteOpen:(e,t)=>e("trace:delete_form_open",{source:t?"table-single-row":"trace detail"}),captureDeleteSuccess:(e,t)=>e("trace:delete",{source:t?"table-single-row":"trace"}),entityToDeleteName:"trace",executeDeleteMutation:d,isDeleteMutationLoading:o.isPending,enabled:i,"data-sentry-element":"DeleteButton","data-sentry-component":"DeleteTraceButton","data-sentry-source-file":"deleteButton.tsx"})}function g(e){let t=u.FH.useUtils(),{itemId:a,projectId:s,scope:n="datasets:CUD",invali
1dateFunc:r=()=>void t.datasets.invalidate()}=e,o=u.FH.datasets.deleteDataset.useMutation(),d=async e=>{try{await o.mutateAsync({datasetId:a,projectId:s})}catch(e){return Promise.reject(e)}e()};return(0,l.jsx)(y,{...e,scope:n,invalidateFunc:r,captureDeleteOpen:(e,t)=>e("datasets:delete_form_open",{source:t?"table-single-row":"dataset"}),captureDeleteSuccess:(e,t)=>e("datasets:delete_dataset_button_click",{source:t?"table-single-row":"dataset"}),entityToDeleteName:"dataset",executeDeleteMutation:d,isDeleteMutationLoading:o.isPending,"data-sentry-element":"DeleteButton","data-sentry-component":"DeleteDatasetButton","data-sentry-source-file":"deleteButton.tsx"})}function j(e){let t=u.FH.useUtils(),{itemId:a,projectId:s,scope:n="dashboards:CUD",invalidateFunc:r=()=>void t.dashboard.invalidate()}=e,o=u.FH.dashboard.delete.useMutation(),d=async e=>{try{await o.mutateAsync({dashboardId:a,projectId:s})}catch(e){return Promise.reject(e)}(0,p.G)({title:"Dashboard deleted",description:"The dashboard has been deleted successfully"}),e()};return(0,l.jsx)(y,{...e,scope:n,invalidateFunc:r,captureDeleteOpen:e=>e("dashboard:delete_dashboard_form_open"),captureDeleteSuccess:e=>e("dashboard:delete_dashboard_button_click"),entityToDeleteName:"dashboard",executeDeleteMutation:d,isDeleteMutationLoading:o.isPending,"data-sentry-element":"DeleteButton","data-sentry-component":"DeleteDashboardButton","data-sentry-source-file":"deleteButton.tsx"})}function b(e){let t=u.FH.useUtils(),{itemId:a,projectId:s,scope:n="evalJob:CUD",invalidateFunc:r=()=>void t.evals.invalidate()}=e,o=u.FH.evals.deleteEvalJob.useMutation({onSuccess:()=>{(0,p.G)({title:"Running evaluator deleted",description:"The running evaluator has been deleted successfully"}),t.evals.invalidate()}}),d=async e=>{try{await o.mutateAsync({evalConfigId:a,projectId:s}),e()}catch(e){return Promise.reject(e)}};return(0,l.jsx)(y,{...e,scope:n,invalidateFunc:r,captureDeleteOpen:(e,t)=>e("eval_config:delete_form_open",{source:t?"table-single-row":"eval config detail"}),captureDeleteSuccess:(e,t)=>e("eval_config:delete_evaluator_button_click",{source:t?"table-single-row":"eval config detail"}),customDeletePrompt:"This action cannot be undone and removes all logs associated with this running evaluator. Scores produced by this evaluator will not be deleted.",entityToDeleteName:"running evaluator",executeDeleteMutation:d,isDeleteMutationLoading:o.isPending,"data-sentry-element":"DeleteButton","data-sentry-component":"DeleteEvalConfigButton","data-sentry-source-file":"deleteButton.tsx"})}function D(e){let t=u.FH.useUtils(),{projectId:a,scope:s="evalDefaultModel:CUD",invalidateFunc:n=()=>void t.defaultLlmModel.invalidate()}=e,{mutateAsync:r,isPending:o}=u.FH.defaultLlmModel.deleteDefaultModel.useMutation({onSuccess:()=>{(0,p.G)({title:"Default evaluation model deleted",description:"The default evaluation model has been deleted. Any running evaluations relying on the default model will be inactivated. Queued jobs will fail."}),t.defaultLlmModel.fetchDefaultModel.invalidate({projectId:a})}}),d=async e=>{try{await r({projectId:a})}catch(e){return Promise.reject(e)}e()};return(0,l.jsx)(y,{...e,variant:"outline",scope:s,invalidateFunc:n,captureDeleteOpen:(e,t)=>e("eval_config:delete_form_open",{source:t?"table-single-row":"evaluator"}),captureDeleteSuccess:(e,t)=>e("eval_config:delete_evaluator_button_click",{source:t?"table-single-row":"evaluator"}),entityToDeleteName:"default evaluation model",customDeletePrompt:"Deleting this model might cause running evaluators to fail. Please make sure you have no running evaluators relying on this model.",deleteConfirmation:"delete",executeDeleteMutation:d,isDeleteMutationLoading:o,"data-sentry-element":"DeleteButton","data-sentry-component":"DeleteEvaluationModelButton","data-sentry-source-file":"deleteButton.tsx"})}},55247:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(22222).A)("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},59649:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(22222).A)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]])},62583:(e,t,a)=>{a.d(t,{G:()=>i});var l=a(73154),s=a(54433),n=a(68048),r=a(43035),o=a(41641);let d=e=>{let{title:t,description:a,onDismiss:s,link:d}=e;return(0,l.jsxs)("div",{className:"flex justify-between","data-sentry-component":"SuccessNotification","data-sentry-source-file":"SuccessNotification.tsx",children:[(0,l.jsxs)("div",{className:"flex min-w-[300px] flex-1 flex-col gap-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(r.A,{size:20,className:"text-primary-foreground","data-sentry-element":"BadgeCheck","data-sentry-source-file":"SuccessNotification.tsx"}),(0,l.jsx)("div",{className:"m-0 text-sm font-medium leading-tight text-primary-foreground",children:t})]}),a&&(0,l.jsx)("div",{className:"text-sm leading-tight text-primary-foreground",children:a}),d&&(0,l.jsx)(n.r,{href:d.href,size:"sm",variant:"secondary",className:"self-start",children:d.text})]}),(0,l.jsx)("button",{className:"flex h-6 w-6 cursor-pointer items-start justify-end border-none bg-transparent p-0 text-primary-foreground transition-colors duration-200",onClick:s,"aria-label":"Close",children:(0,l.jsx)(o.A,{size:14,"data-sentry-element":"X","data-sentry-source-file":"SuccessNotification.tsx"})})]})},i=e=>{let{duration:t=5e3,...a}=e;s.oR.custom(e=>(0,l.jsx)(d,{...a,onDismiss:()=>s.oR.dismiss(e)}),{duration:t,style:{padding:"1rem",border:"1px solid hsl(var(--dark-green))",borderRadius:"0.5rem",backgroundColor:"hsl(var(--dark-green))"}})}},68048:(e,t,a)=>{a.d(t,{r:()=>p});var l=a(73154),s=a(96810),n=a(72764),r=a(36932),o=a(12407),d=a(86843),i=a(97898),c=a(45103),u=a(68389),m=a.n(u),f=a(92125);let h={limitReached:(e,t)=>"You have reached the limit (".concat(e,"/").concat(t,") for this resource at your current plan. Upgrade your plan to increase the limit."),noAccess:"You do not have access to this resource, please ask your admin to grant you access.",entitlement:"This feature is not available in your current plan."},p=s.forwardRef(function(e,t){let{loading:a=!1,hasAccess:s=!0,hasEntitlement:n=!0,limitValue:r,limit:o=!1,disabled:d=!1,children:u,icon:m,className:p,href:v,trackingEventName:g,trackingProps:j,...b}=e,D=(0,f.B)(),w="number"==typeof o&&void 0!==r&&r>=o,N=d||!s||!n||w,M=s?n?w&&"number"==typeof o&&void 0!==r?h.limitReached(r,o):null:h.entitlement:h.noAccess,C=(0,l.jsx)(y,{ref:t,icon:m,isDisabled:N,loading:a,hasAccess:s,hasEntitlement:n,hasReachedLimit:w,className:p,buttonProps:b,href:v,onLinkClick:()=>{g&&v&&x(v)&&D(g,null!=j?j:null)},children:u});return N&&M?(0,l.jsxs)(i.jc,{openDelay:200,children:[(0,l.jsx)(i.d0,{asChild:!0,children:(0,l.jsx)("span",{children:C})}),(0,l.jsx)(c.HP,{children:(0,l.jsx)(i.Et,{className:"w-80 text-sm",children:M})})]}):C}),x=e=>e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//"),y=s.forwardRef(function(e,t){let{icon:a,isDisabled:s,loading:i,hasAccess:c,hasEntitlement:u,hasReachedLimit:f,className:h,buttonProps:p,children:y,href:v,onLinkClick:g}=e,j=(0,l.jsxs)(l.Fragment,{children:[c?u?f?(0,l.jsx)(o.A,{className:"mr-1 h-4 w-4"}):a?(0,l.jsx)("div",{className:"mr-1",children:a}):null:(0,l.jsx)(r.A,{className:"mr-1 h-4 w-4"}):(0,l.jsx)(n.A,{className:"mr-1 h-4 w-4"}),y]}),b=v&&!s,D=v&&x(v);return(0,l.jsx)(d.$,{ref:t,disabled:s,loading:i,className:h,...p,asChild:!!b||void 0,children:b?(0,l.jsx)(m(),{href:v,target:D?"_blank":void 0,rel:D?"noopener noreferrer":void 0,onClick:g,children:j}):j})})},70890:(e,t,a)=>{a.d(t,{c:()=>D});var l=a(73154),s=a(18799),n=a(4198),r=a(25277),o=a(20192),d=a(86843),i=a(93367),c=a(62583),u=a(84750),m=a(69706),f=a(49319),h=a(51776),p=a(96810),x=a(14183),y=a(26946),v=a(17982),g=a(97638),j=a(70883),b=a(90270);function D(e){let{projectId:t}=e,a=i.FH.useUtils(),[g,j]=(0,p.useState)(!1),[b,D]=(0,p.useState)(null),N=(0,s.lp)({projectId:t,scope:"evalDefaultModel:CUD"}),{modelParams:M,setModelParams:C,updateModelParamValue:k,setModelParamEnabled:_,availableModels:P,providerModelCombinations:B,availableProviders:A}=(0,o.n)(),{selectedModel:F,isDefaultModelLoading:S}=(0,m.N)(t,C),{mutateAsync:T,isPending:U}=i.FH.defaultLlmModel.upsertDefaultModel.useMutation({onSuccess:()=>{(0,c.G)({title:"Default evaluation model updated",description:"All running evaluators will use the new model."}
1),a.defaultLlmModel.fetchDefaultModel.invalidate({projectId:t}),D(null),j(!1)},onError:e=>{D(e.message)}}),H=async()=>{await T({projectId:t,provider:M.provider.value,adapter:M.adapter.value,model:M.model.value,modelParams:(0,y._)(M)})};return S?(0,l.jsx)(u.E,{className:"h-[500px] w-full"}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.Zp,{className:"mt-3 flex flex-col gap-6","data-sentry-element":"Card","data-sentry-source-file":"default-eval-model-setup.tsx",children:(0,l.jsxs)(r.Wu,{"data-sentry-element":"CardContent","data-sentry-source-file":"default-eval-model-setup.tsx",children:[(0,l.jsx)("p",{className:"my-2 text-lg font-semibold",children:"Default model"}),(0,l.jsx)(h.k,{projectId:t,variant:"color-coded",setUpMessage:"No default model set. Set up default evaluation model",className:"text-sm font-normal",showEditButton:!1,"data-sentry-element":"ManageDefaultEvalModel","data-sentry-source-file":"default-eval-model-setup.tsx"})]})}),(0,l.jsxs)("div",{className:"mt-2 flex justify-end gap-2",children:[F&&(0,l.jsx)(f.F2,{projectId:t,scope:"evalDefaultModel:CUD"}),(0,l.jsxs)(x.lG,{open:g,onOpenChange:e=>{j(e),e||D(null)},"data-sentry-element":"Dialog","data-sentry-source-file":"default-eval-model-setup.tsx",children:[(0,l.jsx)(x.zM,{asChild:!0,"data-sentry-element":"DialogTrigger","data-sentry-source-file":"default-eval-model-setup.tsx",children:(0,l.jsxs)(d.$,{disabled:!N,onClick:()=>{j(!0)},"data-sentry-element":"Button","data-sentry-source-file":"default-eval-model-setup.tsx",children:[(0,l.jsx)(v.A,{className:"mr-2 h-4 w-4","data-sentry-element":"Pencil","data-sentry-source-file":"default-eval-model-setup.tsx"}),F?"Edit":"Set up"]})}),(0,l.jsxs)(x.Cf,{className:"px-3 py-10","data-sentry-element":"DialogContent","data-sentry-source-file":"default-eval-model-setup.tsx",children:[(0,l.jsx)(n.s,{customHeader:(0,l.jsx)("p",{className:"font-medium leading-none",children:"Default model configuration"}),modelParams:M,availableModels:P,providerModelCombinations:B,availableProviders:A,updateModelParamValue:k,setModelParamEnabled:_,formDisabled:!N,"data-sentry-element":"ModelParameters","data-sentry-source-file":"default-eval-model-setup.tsx"}),(0,l.jsx)("div",{className:"my-2 text-xs text-muted-foreground",children:"Select a model which supports function calling."}),(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"mt-2 flex justify-end gap-2",children:[(0,l.jsx)(d.$,{variant:"outline",onClick:()=>j(!1),"data-sentry-element":"Button","data-sentry-source-file":"default-eval-model-setup.tsx",children:"Cancel"}),F?(0,l.jsx)(w,{projectId:t,isLoading:U,executeUpsertMutation:H}):(0,l.jsx)(d.$,{disabled:!N||!M.provider.value,onClick:H,children:"Save"})]}),b?(0,l.jsxs)("p",{className:"text-red w-full text-center",children:[(0,l.jsx)("span",{className:"font-bold",children:"Error:"})," ",b]}):null]})]})]})]})]})}function w(e){let{projectId:t,isLoading:a,executeUpsertMutation:n}=e,[r,o]=(0,p.useState)(""),i=(0,s.lp)({projectId:t,scope:"evalDefaultModel:CUD"}),c="update";return(0,l.jsxs)(g.AM,{"data-sentry-element":"Popover","data-sentry-component":"UpdateButton","data-sentry-source-file":"default-eval-model-setup.tsx",children:[(0,l.jsx)(g.Wv,{asChild:!0,"data-sentry-element":"PopoverTrigger","data-sentry-source-file":"default-eval-model-setup.tsx",children:(0,l.jsx)(d.$,{disabled:!i,onClick:e=>{e.stopPropagation()},"data-sentry-element":"Button","data-sentry-source-file":"default-eval-model-setup.tsx",children:"Update"})}),(0,l.jsxs)(g.hl,{onClick:e=>e.stopPropagation(),className:"w-fit max-w-[500px]","data-sentry-element":"PopoverContent","data-sentry-source-file":"default-eval-model-setup.tsx",children:[(0,l.jsx)("h2",{className:"text-md mb-3 font-semibold",children:"Please confirm"}),(0,l.jsx)("p",{className:"mb-3 text-sm",children:"Updating the default model will impact any currently running evaluators that use it. Please confirm that you want to proceed with this change."}),(0,l.jsxs)("div",{className:"mb-4 grid w-full gap-1.5",children:[(0,l.jsxs)(j.J,{htmlFor:"update-confirmation","data-sentry-element":"Label","data-sentry-source-file":"default-eval-model-setup.tsx",children:['Type "',c,'" to confirm']}),(0,l.jsx)(b.p,{id:"update-confirmation",value:r,onChange:e=>o(e.target.value),"data-sentry-element":"Input","data-sentry-source-file":"default-eval-model-setup.tsx"})]}),(0,l.jsx)("div",{className:"flex justify-end space-x-4",children:(0,l.jsx)(d.$,{type:"button",loading:a,onClick:()=>
1{if(r!==c)return void alert("Please type the correct confirmation");n()},"data-sentry-element":"Button","data-sentry-source-file":"default-eval-model-setup.tsx",children:"Confirm"})})]})]},"update-action")}},72764:(e,t,a)=>{a.d(t,{A:()=>l});let l=(0,a(22222).A)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.