PageSourceSearch

https://ezioqwarks-mlfloweq-server.hf.space/static-files/static/js/5823.90f9d6e0.chunk.js

js ezioqwarks-mlfloweq-server.hf.space collected 2026-10-03 16:52:05 UTC 25,322 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunk_mlflow_mlflow=globalThis.webpackChunk_mlflow_mlflow||[]).push([[5823],{11325(e,t,s){s.d(t,{p:()=>l});var n=s(51477),i=s(69888),a=s(30594),r=s(81943),o=s(83494),d=s(92822);const l=({data:e,activeView:t,onSpec:s,enabled:l=!0})=>{const c=(0,r.x)(),[u,m]=(0,n.useState)(void 0),p=(0,n.useRef)(`cv-session-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`),f=(0,n.useMemo)(()=>(0,i.Ub)(e),[e]),g=(0,n.useRef)(s);(0,n.useEffect)(()=>{g.current=s},[s]),(0,n.useEffect)(()=>{if(l)return(0,o.Aq)({currentTemplate:null===t||void 0===t?void 0:t.template,traceSample:f,applyTarget:t?(0,a.Jz)(t):void 0})},[t,l,f]),(0,n.useEffect)(()=>{if(l)return(0,d.gr)(p.current,async e=>{try{return await g.current(e),m(void 0),{ok:!0}}catch(t){const e=t instanceof Error?t.message:"Failed to render the custom view.";return m(e),{ok:!1,error:e,retryable:t instanceof d.gY}}})},[l]);const v=(0,n.useMemo)(()=>{if(l)return c.openAssistant},[c,l]),h=(0,n.useCallback)(()=>m(void 0),[]);return{isAvailable:Boolean(v),openAssistant:v,isStreaming:l&&Boolean(c.isStreaming),isPending:l&&Boolean(c.isPending),applyError:l?u:void 0,clearApplyError:h}}},47113(e,t,s){s.d(t,{E:()=>u});var n=s(15032),i=s(45959),a=s(94206),r=s(10587),o=s(29676),d=s(63968);const l={h1:{fontSize:32,lineHeight:"40px",fontWeight:700},h2:{fontSize:26,lineHeight:"34px",fontWeight:700},h3:{fontSize:22,lineHeight:"30px",fontWeight:600},h4:{fontSize:19,lineHeight:"26px",fontWeight:600},h5:{fontSize:16,lineHeight:"22px",fontWeight:600}},c={h1:1,h2:2,h3:3,h4:4,h5:5},u=(0,i.uh)(a.Qg,({props:e})=>{const t=(0,o.o)(e.text),s="string"===typeof e.variant?e.variant:"body",i="number"===typeof e.weight?e.weight:void 0,a=void 0!==i?{flex:`${i}`,minWidth:0}:void 0;if(u=s,Object.hasOwn(l,u)){const e="h1"===s?1:"h2"===s?2:3;return(0,d.Y)(r.T.Title,{level:e,elementLevel:c[s],withoutMargins:!0,css:(0,n.AH)({...a,...l[s]},""),children:t})}var u;return"caption"===s?(0,d.Y)(r.T.Text,{size:"sm",color:"secondary",css:a,children:t}):(0,d.Y)(r.T.Text,{css:a,children:t})})},62211(e,t,s){s.d(t,{X:()=>m});var n=s(47195),i=s(9581);const a="renderIfSpan",r=new Set(["FeedbackThumbsUpDownButtons","RadioGroup","FeedbackInputText"]),o="root",d=(e,t)=>{if((0,i.I_)(e)){const n=e.$source;var s;return(0,i.uI)(n)?null!==(s=(0,i.YA)(n,t.viewData))&&void 0!==s?s:"":(0,i.qN)(n)?(0,i.Ql)(e,t.nodeMap):""}var n;return(0,i.Ej)(e)?null!==(n=(0,i.EV)(e.$spanRef,t.nodeMap))&&void 0!==n?n:"":Array.isArray(e)?e.map(e=>d(e,t)):(0,i.u4)(e)?Object.fromEntries(Object.entries(e).map(([e,s])=>[e,d(s,t)])):e},l=(e,t,s)=>"assessments"===e.$source?(0,n.bw)(s.viewData.assessmentItems,{idPrefix:`${t}__a`}):{childIds:[],components:[]},c=(e,t)=>{var s;const n="string"===typeof e.id?e.id:String(null!==(s=e.id)&&void 0!==s?s:""),r={},o=[];for(const[c,u]of Object.entries(e))if("id"!==c&&"component"!==c){if(c!==a){if((0,i.I_)(u)&&(0,i.ro)(u.$source)){const{childIds:e,components:s}=l(u,n,t);r[c]=e,o.push(...s);continue}if((0,i.Ej)(u)){const e=(0,i.EV)(u.$spanRef,t.nodeMap);e&&(r[c]=e);continue}r[c]=d(u,t)}}else r[c]=u;return{component:r,generated:o}},u=(e,t)=>{const s=Array.isArray(e.components)?e.components:[],n=((e,t)=>{const s=new Map;for(const a of e)(0,i.u4)(a)&&"string"===typeof a.id&&s.set(a.id,a);const n=new Set,o=e=>{if(n.has(e))return;n.add(e);const t=s.get(e);if(t&&("string"===typeof t.child&&o(t.child),Array.isArray(t.children)))for(const s of t.children)"string"===typeof s&&o(s)};for(const l of e){if(!(0,i.u4)(l)||"string"!==typeof l.id)continue;const e=(0,i._X)(l[a]),s=l.spanId,n=(0,i.Ej)(s)?s.$spanRef:void 0,d=a in l&&(0,i.Nv)(e)&&!(0,i.EV)(e,t),c=r.has(String(l.component))&&(0,i.Nv)(n)&&!(0,i.EV)(n,t);(d||c)&&o(l.id)}let d=!0;for(;d;){d=!1;for(const[e,t]of s)n.has(e)||"string"===typeof t.child&&n.has(t.child)&&(o(e),d=!0)}return n})(s,t.nodeMap),d=[],l=[];for(const a of s){var u;if(!(0,i.u4)(a))continue;const e="string"===typeof a.id?a.id:String(null!==(u=a.id)&&void 0!==u?u:"");if(n.has(e))continue;const s=c(a,t);d.push(s.component),l.push(...s.generated)}if(n.size>0){for(const e of d)Array.isArray(e.children)&&(e.children=e.children.filter(e=>!("string"===typeof e&&n.has(e)))),"string"===typeof e.child&&n.has(e.child)&&delete e.child;n.has(o)&&s.some(e=>(0,i.u4)(e)&&e.id===o)&&d.unshift({id:o,component:"Column",children:[]})}return[...d,...l]},m=(e,t)=>
1e.map(e=>"updateComponents"in e&&(0,i.u4)(e.updateComponents)?{...e,updateComponents:{...e.updateComponents,components:u(e.updateComponents,t)}}:e)},15823(e,t,s){s.d(t,{ModelTraceExplorerCustomView:()=>oe});var n=s(15032),i=s(51477),a=s(29942),r=s(10587),o=s(77753),d=s(56827),l=s(94716),c=s(94818),u=s(70083),m=s(45959),p=s(62049),f=s(22623),g=s(50222),v=s(92655),h=s(20252),w=s(83162),M=s(33706),b=s(27357),y=s(1665),x=s(25656),I=s(12300),A=s(67846),Y=s(69330),S=s(6688),k=s(29676),T=s(61559),C=s(63968);const E={name:"FeedbackThumbsUpDownButtons",schema:Y.Ik({label:S.Sg.describe('Optional prompt shown next to the thumbs, e.g. "Was this helpful?".').optional(),name:S.Sg.describe('The assessment name to log. Defaults to "User feedback".').optional(),value:S.vL.describe("Selected state: true = thumbs up, false = thumbs down. Bind to a /feedback/... path to reflect and seed the choice.").optional(),spanId:S.Sg.describe("Optional span id to scope the feedback to a specific span instead of the whole trace.").optional(),weight:Y.ai().describe("Relative flex weight when placed directly inside a Row/Column.").optional()}).strict()},D=(0,m.uh)(E,({props:e})=>{const{theme:t}=(0,r.u)(),s=(0,d.tz)(),{enabled:a,traceId:o}=(0,T.R)(),[l,c]=(0,i.useState)("idle"),{createAssessmentMutation:u,isLoading:m}=(0,b.A)({traceId:o,onSuccess:()=>c("success"),onError:()=>c("error")}),p="string"===typeof e.label?e.label:"",f="number"===typeof e.weight?e.weight:void 0,g=t=>{var s;if(m)return;if(e.setValue(t),!a||!o)return;c("idle");const n="string"===typeof e.name&&e.name?e.name:"User feedback",i="string"===typeof e.spanId&&e.spanId?e.spanId:void 0,r={feedback:{value:t}};u({assessment:{assessment_name:n,trace_id:o,source:{source_type:"HUMAN",source_id:null!==(s=(0,w.w)())&&void 0!==s?s:""},...i?{span_id:i}:{},...r}})},v=m;return(0,C.FD)("div",{css:(0,n.AH)({display:"flex",alignItems:"center",gap:t.spacing.sm,...void 0!==f?{flex:`${f}`,minWidth:0}:{}},""),children:[p&&(0,C.Y)(r.T.Text,{children:(0,k.o)(p)}),"success"===l?(0,C.Y)("span",{css:(0,n.AH)({display:"inline-flex",alignItems:"center",color:t.colors.textValidationSuccess},""),"aria-live":"polite",children:(0,C.Y)(r.aA,{})}):(0,C.FD)(C.FK,{children:[(0,C.Y)(r.B,{componentId:"shared.model-trace-explorer.custom-view.feedback-up",icon:(0,C.Y)(r.hD,{}),disabled:v,onClick:()=>g(!0),"aria-label":s.formatMessage({id:"TdOzAP",defaultMessage:"Thumbs up"})}),(0,C.Y)(r.B,{componentId:"shared.model-trace-explorer.custom-view.feedback-down",icon:(0,C.Y)(r.hC,{}),disabled:v,onClick:()=>g(!1),"aria-label":s.formatMessage({id:"5wqwBZ",defaultMessage:"Thumbs down"})}),"error"===l&&(0,C.Y)(r.T.Text,{color:"error",size:"sm","aria-live":"polite",children:s.formatMessage({id:"dA7hRP",defaultMessage:"Could not save. Try again."})})]})]})});var P=s(61452),R=s(13448),z=s(92397),H=s(44270),F=s(49775),V=s(13654),j=s(94939),B=s(26844),$=s(47113),_=s(46432),O=s(62211),N=s(11325),U=s(83494),W=s(47195),q=s(76329);const L=e=>`cv-${e.id}`,G=e=>{var t,s;return`${null!==(t=e.formId)&&void 0!==t?t:""}\0${e.name}\0${null!==(s=e.spanId)&&void 0!==s?s:""}`};let K=0;const X=()=>`${Date.now().toString(36)}-${(K++).toString(36)}`,J=(e,t)=>e.formId===t,Z=(e,t)=>[{version:"v0.9",createSurface:{surfaceId:e,catalogId:W.E2,sendDataModel:!0}},{version:"v0.9",updateComponents:{surfaceId:e,components:[{id:"root",component:"Text",text:t}]}}];var Q={name:"1meq2lz",styles:"height:80px;flex:1"},ee={name:"1meq2lz",styles:"height:80px;flex:1"},te={name:"1meq2lz",styles:"height:80px;flex:1"},se={name:"lm2axd",styles:"height:160px;width:100%"},ne={name:"1r86kme",styles:"height:120px;width:100%"};const ie=()=>{const{theme:e}=(0,r.u)();return(0,C.FD)("div",{css:(0,n.AH)({display:"flex",flexDirection:"column",gap:e.spacing.md,width:"100%",maxWidth:640},""),children:[(0,C.Y)(r.T.Text,{color:"secondary",children:(0,C.Y)(d.sA,{id:"iaTF+E",defaultMessage:"Building this view\u2026"})}),(0,C.FD)("div",{css:(0,n.AH)({display:"flex",gap:e.spacing.md},""),children:[(0,C.Y)(o.GenericSkeleton,{css:Q}),(0,C.Y)(o.GenericSkeleton,{css:ee}),(0,C.Y)(o.GenericSkeleton,{css:te})]}),(0,C.Y)(o.GenericSkeleton,{css:se}),(0,C.Y)(o.GenericSkeleton,{css:ne})]})};var ae={name:"5smjia",styles:"flex:1;min-height:0;overflow:auto"},re={name:"ksjaig",styles:"font-size:22px;line-height:28px;font-weight:600"};const oe=({modelTraceInfo:e})=>{const{theme:t}=(0,r.u)(),s=(0,d.tz)(),{nodeMap:Y}=(0,h.nJ)(),{setTraceExplorerDisplayMode:S}=(0,g.SO)(),k=(0,q.dD)(),E=k.activeView,K=(0,i.useMemo)(()=>new l.WC(W.E2,[$.E,m.fI,m.VP,A.Z,F.I,B.h,j.o,x.j,I.f,V.n,D,H.z,R.b,z.e],u.xV),[]),Q=(0,i.useMemo)(()=>{var t;return(0,f.gD)(e)?e.trace_id:null!==(t=e.request_id)&&void 0!==t?t:""},[e]),{createAssessmentMutation:ee}=(0,b.A)({traceId:Q}),te=(0,i.useRef)(()=>{}),se=(0,i.useRef)(new Map),ne=(0,i.useRef)(new Map),[oe,de]=(0,i.useReducer)(e=>e+1,0),[le]=(0,i.useState)(()=>new c.U([K],e=>te.current(e))),ce=e=>new Promise((t,s)=>{ee(e,{onSuccess:()=>t(),onError:e=>s(e instanceof Error?e:new Error(String(e)))})});te.current=e=>{e.name===P.T&&(e=>{var t,s;const n=null!==(t=e.context)&&void 0!==t?t:{},i="string"===typeof n.name&&n.name?n.name:void 0;if(!i)return;let a=se.current.get(e.surfaceId);a||(a=new Map,se.current.set(e.surfaceId,a));const r="string"===typeof n.spanId&&n.spanId?n.spanId:void 0,o="string"===typeof n.formId&&n.formId?n.formId:void 0,d=`${null!==o&&void 0!==o?o:""}\0${i}\0${null!==r&&void 0!==r?r:""}`,l=null!==(s=a.get(d))&&void 0!==s?s:{name:i};a.set(d,{...l,name:i,..."string"===typeof n.value?{value:n.value}:{},..."string"===typeof n.rationale?{rationale:n.rationale}:{},...r?{spanId:r}:{},...o?{formId:o}:{}}),de()})(e)};const ue=(0,y.K)(e=>e.reconstructAssessments),me=(0,y.K)(e=>e.assessmentActions[Q]),pe=(0,i.useMemo)(()=>{const t=(0,W.h6)(e,Y);if(!(0,M.F9)())return(0,W.qO)(t);const s=(0,a.uniqBy)(ue(t,me),({assessment_id:e})=>e);return(0,W.qO)(s)},[e,Y,ue,me]),fe=(0,i.useMemo)(()=>(0,W.Nm)(pe),[pe]),ge=(0,i.useMemo)(()=>(0,W.p6)(e,fe.length),[e,fe.length]),ve=(0,i.useMemo)(()=>({metrics:ge,assessmentItems:fe}),[ge,fe]),he=(0,i.useMemo)(()=>{const e=Object.values(Y);
1if(0===e.length)return{};let t=1/0;for(const a of e)a.start<t&&(t=a.start);const s={};for(const a of e){var n,i;s[String(a.key)]={name:"string"===typeof a.title?a.title:String(null!==(n=a.title)&&void 0!==n?n:"unknown"),type:null!==(i=a.type)&&void 0!==i?i:p.UG.UNKNOWN,startMs:Math.max(a.start-t,0)/1e3,endMs:Math.max(a.end-t,0)/1e3,durationMs:Math.max(a.end-a.start,0)/1e3,parentId:a.parentId?String(a.parentId):void 0,inputs:a.inputs,outputs:a.outputs}}return s},[Y]),we=(0,i.useMemo)(()=>({...ve,nodeMap:he,assessments:pe}),[ve,he,pe]),[Me,be]=(0,i.useState)(""),ye=k.isBuilding,{stopBuilding:xe}=k,[Ie,Ae]=(0,i.useState)(!1),[Ye,Se]=(0,i.useState)(""),[ke,Te]=(0,i.useState)(!1),[Ce,Ee]=(0,i.useState)(""),[De,Pe]=(0,i.useState)(void 0),[Re,ze]=(0,i.useState)(!1),He=(0,i.useRef)(new Set),Fe=(0,i.useRef)(k.activeViewId);(0,i.useEffect)(()=>{Fe.current=k.activeViewId},[k.activeViewId]);const Ve=(0,i.useRef)(void 0),[,je]=(0,i.useReducer)(e=>e+1,0),Be=(0,i.useCallback)((e,t)=>{const n=(0,_.dC)(e);if(!n.ok)return Z(t,s.formatMessage({id:"O75jRh",defaultMessage:"This view's definition couldn't be read and can't be displayed. Edit it with the assistant to rebuild it."}));const i=(0,O.X)(n.messages,{viewData:ve,nodeMap:Y}),a=(0,_.F9)(i,{surfaceId:t,catalogId:W.E2});return a.ok?a.messages:Z(t,s.formatMessage({id:"z19xIj",defaultMessage:"Could not render this view for the current trace: {error}"},{error:a.error}))},[ve,Y,s]),$e=(0,N.p)({data:we,activeView:E,enabled:k.canPersist,onSpec:e=>{var t,n,i,a,r,o,d,l,c,u,m;if(!k.canPersist)throw new Error("Custom views cannot be modified in this experiment.");const p=null!==(t=(0,U.X8)())&&void 0!==t?t:Ve.current,f=k.activeView,g=null!==(n=null!==(i=null!==(a=null===p||void 0===p?void 0:p.id)&&void 0!==a?a:null===f||void 0===f?void 0:f.id)&&void 0!==i?i:Fe.current)&&void 0!==n?n:X(),v=k.views.find(e=>e.id===g),h=null!==(r=null!==p&&void 0!==p?p:f)&&void 0!==r?r:v;let w;try{w=(e=>{const t=(0,_.dC)(e);if(!t.ok)throw new Error(t.error);return t.messages})(e)}catch(A){throw A}const M=null!==(o=null!==(d=null!==(l=null!==(c=null===p||void 0===p?void 0:p.name)&&void 0!==c?c:null===f||void 0===f?void 0:f.name)&&void 0!==l?l:null===v||void 0===v?void 0:v.name)&&void 0!==d?d:k.draftName)&&void 0!==o?o:"",b="string"===typeof e.title&&e.title.trim()?e.title.trim():(null===h||void 0===h?void 0:h.label)||(null===h||void 0===h?void 0:h.name)||M||"Custom view",y=null!==(u=null===h||void 0===h?void 0:h.createdAtMs)&&void 0!==u?u:Date.now(),x=null!==(m=null===h||void 0===h?void 0:h.instruction)&&void 0!==m?m:"",I=k.upsertViewContent({id:g,name:M,label:b,instruction:x,template:w,createdAtMs:y});if(Ve.current=void 0,!I)throw new Error(s.formatMessage({id:"PiBPUm",defaultMessage:'"{name}" was deleted while the assistant was working, so it was not updated.'},{name:M||b}));Fe.current=g}});(0,i.useEffect)(()=>{be(""),se.current.clear(),ne.current.clear(),de()},[Q]),(0,i.useEffect)(()=>{if(!k.isLoaded)return;const e=E?[E]:[],t=new Set(e.map(L));for(const s of Array.from(He.current))t.has(s)||(le.processMessages([{version:"v0.9",deleteSurface:{surfaceId:s}}]),He.current.delete(s),se.current.delete(s),ne.current.delete(s),de());for(const n of e){const e=L(n);He.current.has(e)&&le.processMessages([{version:"v0.9",deleteSurface:{surfaceId:e}}]);const t=n.unreadable?Z(e,s.formatMessage({id:"O75jRh",defaultMessage:"This view's definition couldn't be read and can't be displayed. Edit it with the assistant to rebuild it."})):n.template&&n.template.length>0?Be(n.template,e):Z(e,s.formatMessage({id:"CD9scX",defaultMessage:"This view has no content yet. Edit it with the assistant."}));le.processMessages(t),He.current.add(e)}je()},[E,k.isLoaded,le,Be,s]);(0,i.useEffect)(()=>{ye&&(!k.canPersist||E||$e.applyError)&&xe()},[ye,k.canPersist,E,$e.applyError,xe]);const _e=()=>{const e=Ye.trim();e&&(Ae(!1),k.saveActiveView(e))},Oe=()=>{const e=Ce.trim();De&&e&&(Te(!1),k.renameView(De,e))},Ne=E?L(E):"",Ue=E?le.model.getSurface(Ne):void 0,We=(0,i.useCallback)(e=>{if(!Ne)return!1;const t=se.current.get(Ne);if(!t)return!1;for(const s of t.values())if(J(s,e)&&"string"===typeof s.value&&s.value.length>0)return!0;return!1},[Ne,oe]),qe=(0,i.useCallback)((e,t="value")=>{var s,n;if(!Ne)return;const i=G(e);return null===(s=se.current.get(Ne))||void 0===s||null===(n=s.get(i))||void 0===n?void 0:n[t]},[Ne,oe]),Le=(0,i.useCallback)(e=>{var t,s;if(!Ne)return 0;const n=G(e);return null!==(t=null===(s=ne.current.get(Ne))||void 0===s?void 0:s.get(n))&&void 0!==t?t:0},[Ne,oe]),Ge=s.formatMessage({id:"+BlSFl",defaultMessage:"Untitled custom view"});return(0,C.FD)("div",{css:(0,n.AH)({display:"flex",flexDirection:"column",gap:t.spacing.sm,height:"100%",minHeight:0},""),children:[E&&(0,C.FD)("div",{css:(0,n.AH)({display:"flex",alignItems:"center",justifyContent:"flex-end",gap:t.spacing.sm,padding:t.spacing.md},""),children:[k.canPersist&&E&&k.isDirty&&(0,C.Y)(r.B,{componentId:"shared.model-trace-explorer.custom-view.save",type:"primary",onClick:()=>
1{if(E)return k.isActivePersisted?void k.saveActiveView():(Se(""),void Ae(!0))},disabled:k.isSaving,loading:k.isSaving,children:(0,C.Y)(d.sA,{id:"NRjlue",defaultMessage:"Save"})}),k.canPersist&&E&&$e.isAvailable&&(0,C.Y)(v.I,{componentId:"shared.model-trace-explorer.custom-view.edit-existing-view-button",onClick:()=>{k.canPersist&&E&&$e.openAssistant&&(Ve.current={id:E.id,name:E.name,label:E.label,instruction:E.instruction,createdAtMs:E.createdAtMs},$e.openAssistant())},disabled:k.isSaving,children:(0,C.Y)(d.sA,{id:"CMQsX4",defaultMessage:"Edit with Assistant"})}),E&&k.isActivePersisted&&k.canPersist&&(0,C.FD)(r.dr.Root,{children:[(0,C.Y)(r.dr.Trigger,{asChild:!0,children:(0,C.Y)(r.B,{componentId:"shared.model-trace-explorer.custom-view.more",icon:(0,C.Y)(r.fz,{}),"aria-label":s.formatMessage({id:"8bUJT4",defaultMessage:"More view options"}),disabled:k.isSaving})}),(0,C.FD)(r.dr.Content,{align:"end",minWidth:150,children:[(0,C.FD)(r.dr.Item,{componentId:"shared.model-trace-explorer.custom-view.rename-view-modal-open-button",onClick:()=>{var e;Pe(k.activeViewId),Ee(null!==(e=null===E||void 0===E?void 0:E.name)&&void 0!==e?e:""),Te(!0)},disabled:k.isActivePersistedUnreadable,children:[(0,C.Y)(r.dr.IconWrapper,{children:(0,C.Y)(r.fJ,{})}),(0,C.Y)(d.sA,{id:"IfYb9b",defaultMessage:"Rename view"}),k.isActivePersistedUnreadable&&(0,C.Y)(r.s,{componentId:"shared.model-trace-explorer.custom-view.rename-disabled-reason",side:"right",content:s.formatMessage({id:"Hj7ob9",defaultMessage:"Rebuild this invalid view with the assistant and save it to enable renaming."}),children:(0,C.Y)("span",{css:(0,n.AH)({display:"inline-flex",marginLeft:"auto",paddingLeft:t.spacing.xs,color:t.colors.textSecondary,pointerEvents:"all"},""),onClick:e=>e.stopPropagation(),children:(0,C.Y)(r.ez,{"aria-hidden":!0})})})]}),(0,C.FD)(r.dr.Item,{componentId:"shared.model-trace-explorer.custom-view.delete-view-modal-open-button",onClick:()=>ze(!0),children:[(0,C.Y)(r.dr.IconWrapper,{children:(0,C.Y)(r.hF,{})}),(0,C.Y)(d.sA,{id:"Aar6YZ",defaultMessage:"Delete view"})]})]})]})]}),k.canPersist&&E&&k.isDirty&&(0,C.Y)(o.Alert,{css:(0,n.AH)({marginLeft:t.spacing.md,marginRight:t.spacing.md},""),type:"info",closable:!1,componentId:"shared.model-trace-explorer.custom-view.draft-indicator",message:s.formatMessage({id:"3tPzT7",defaultMessage:"Draft - This view has unsaved changes. Save it to keep them."})}),k.saveError&&(0,C.Y)(o.Alert,{css:(0,n.AH)({marginLeft:t.spacing.md,marginRight:t.spacing.md},""),type:"error",closable:!1,componentId:"shared.model-trace-explorer.custom-view.save-error",message:k.saveError}),$e.applyError&&(0,C.Y)(o.Alert,{css:(0,n.AH)({marginLeft:t.spacing.md,marginRight:t.spacing.md},""),type:"error",closable:!1,componentId:"shared.model-trace-explorer.custom-view.apply-error",message:s.formatMessage({id:"TCq8db",defaultMessage:"Assistant: {error}"},{error:$e.applyError})}),(0,C.Y)("div",{css:ae,children:k.isLoaded?!E&&ye?(0,C.Y)("div",{css:(0,n.AH)({padding:t.spacing.lg,display:"flex",justifyContent:"center"},""),children:(0,C.Y)(ie,{})}):E||!(k.views.length>0)||k.isDraft&&k.canPersist?E||0!==k.views.length||k.canPersist?E?(0,C.FD)("div",{css:(0,n.AH)({display:"flex",flexDirection:"column",gap:t.spacing.md,padding:t.spacing.md}
1,""),children:[(0,C.Y)(r.T.Title,{level:2,withoutMargins:!0,css:re,children:E.label||Ge}),Ue&&(0,C.Y)(T.$,{value:{enabled:!0,traceId:Q,hasStagedFeedback:We,submitStagedFeedback:async e=>{const t=E?L(E):void 0,s=t?se.current.get(t):void 0;if(!t||!s||0===s.size)throw new Error("There is no staged feedback to submit.");const n=[];for(const[d,l]of s.entries()){var i;if(!J(l,e))continue;if(!("string"===typeof l.value&&l.value.length>0))continue;const t="string"===typeof l.rationale&&l.rationale.length>0,s={feedback:{value:l.value}};n.push({key:d,entry:l,payload:{assessment:{assessment_name:l.name,trace_id:Q,source:{source_type:"HUMAN",source_id:null!==(i=(0,w.w)())&&void 0!==i?i:""},...l.spanId?{span_id:l.spanId}:{},...s,...t?{rationale:l.rationale}:{}}}})}if(0===n.length)throw new Error("There is no staged feedback with a value to submit.");let a=0,r=0;for(const{key:d,entry:l,payload:c}of n)try{if(await ce(c),a+=1,se.current.get(t)===s&&s.get(d)===l){var o;s.delete(d);let e=ne.current.get(t);e||(e=new Map,ne.current.set(t,e)),e.set(d,(null!==(o=e.get(d))&&void 0!==o?o:0)+1)}}catch{r+=1}if(se.current.get(t)===s&&0===s.size&&se.current.delete(t),de(),r>0)throw new Error(a>0?"Some staged feedback requests failed.":"Every staged feedback request failed.");return{submitted:a}},getStagedFeedbackValue:qe,getFeedbackResetVersion:Le},children:(0,C.Y)(m.js,{surface:Ue},`${Ne}-${Q}`)})]}):(0,C.Y)("div",{css:(0,n.AH)({height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:t.spacing.lg},""),children:$e.isAvailable?(0,C.FD)("div",{css:(0,n.AH)({display:"flex",flexDirection:"column",gap:t.spacing.md,width:"100%",maxWidth:560},""),children:[(0,C.Y)(r.T.Title,{level:3,withoutMargins:!0,children:s.formatMessage({id:"zqCgyk",defaultMessage:"Build a custom trace view"})}),(0,C.Y)(r.T.Text,{color:"secondary",children:(0,C.Y)(d.sA,{id:"3D8+SZ",defaultMessage:"Describe how you want to view your trace data and the assistant will build it."})}),(0,C.Y)(o.Input.TextArea,{componentId:"shared.model-trace-explorer.custom-view.create-new-view-prompt-input",placeholder:s.formatMessage({id:"tGfvEG",defaultMessage:"Example: Show me all the spans in this trace with their information"}),value:Me,autoSize:{minRows:3,maxRows:8},onKeyDown:e=>e.stopPropagation(),onChange:e=>be(e.target.value)}),(0,C.FD)("div",{css:(0,n.AH)({display:"flex",alignItems:"center",gap:t.spacing.sm},""),children:[(0,C.Y)(v.I,{componentId:"shared.model-trace-explorer.custom-view.build-new-custom-view-button",disabled:!Me.trim(),onClick:()=>{var e;const t=Me.trim();if(!k.canPersist||!t||!$e.openAssistant)return;try{$e.openAssistant(t,{newSession:!0})}catch{return}const s=X();Fe.current=s,Ve.current={id:s,name:null!==(e=k.draftName)&&void 0!==e?e:"",label:void 0,instruction:t,createdAtMs:Date.now()},be(""),$e.clearApplyError(),k.startBuilding()},children:(0,C.Y)(d.sA,{id:"ORq/mQ",defaultMessage:"Build with Assistant"})}),(0,C.Y)(r.B,{componentId:"shared.model-trace-explorer.custom-view.cancel-new-custom-view-button",type:"tertiary",onClick:()=>null===S||void 0===S?void 0:S("default"),children:(0,C.Y)(r.T.Text,{color:"secondary",children:(0,C.Y)(d.sA,{id:"NZ2BmZ",defaultMessage:"Cancel"})})})]})]}):(0,C.Y)(r.ds,{title:(0,C.Y)(d.sA,{id:"sPjG+W",defaultMessage:"Assistant unavailable"}),description:(0,C.Y)(d.sA,{id:"xYzTH+",defaultMessage:"Custom views are built by the assistant, which isn\u2019t available here."})})}):(0,C.Y)("div",{css:(0,n.AH)({height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:t.spacing.lg},""),children:(0,C.Y)(r.ds,{title:s.formatMessage({id:"Fq0bjr",defaultMessage:"No custom views"}),description:s.formatMessage({id:"HNwz8s",defaultMessage:"There are no saved custom views for this experiment."})})}):(0,C.Y)("div",{css:(0,n.AH)({height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:t.spacing.lg},""),children:(0,C.Y)(r.ds,{title:s.formatMessage({id:"MGjmVz",defaultMessage:"Select a custom view"}),description:s.formatMessage({id:"m9iKMJ",defaultMessage:"Choose a saved view from the menu to render it for this trace."})})}):(0,C.Y)("div",{css:(0,n.AH)({padding:t.spacing.lg},""),children:(0,C.Y)(r.T.Text,{color:"secondary",children:(0,C.Y)(d.sA,{id:"8vtyL/",defaultMessage:"Loading saved custom views\u2026"})})})}),(0,C.Y)(r.M,{componentId:"shared.model-trace-explorer.custom-view.save-new-custom-view-with-name-modal",visible:Ie,title:s.formatMessage({id:"oJvsPU",defaultMessage:"Name this custom view"}),onCancel:()=>Ae(!1),onOk:_e,okText:s.formatMessage({id:"cVnOIo",defaultMessage:"Save"}),cancelText:s.formatMessage({id:"NWXZgq",defaultMessage:"Cancel"}),okButtonProps:{disabled:!Ye.trim()},children:(0,C.Y)(o.Input,{componentId:"shared.model-trace-explorer.custom-view.name-input",id:"custom-view-name","aria-label":s.formatMessage({id:"wp+LYU",defaultMessage:"Custom view name"}),value:Ye,placeholder:s.formatMessage({id:"g4Gj7e",defaultMessage:"Enter a name for this custom view"}),onChange:e=>Se(e.target.value),onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key&&Ye.trim()&&_e()}})}),(0,C.Y)(r.M,{componentId:"shared.model-trace-explorer.custom-view.rename-view-modal",visible:ke,title:s.formatMessage({id:"iaXe6G",defaultMessage:"Rename custom view"}),onCancel:()=>Te(!1),onOk:Oe,okText:s.formatMessage({id:"YUC+Y4",defaultMessage:"Save"}),cancelText:s.formatMessage({id:"esi0Sa",defaultMessage:"Cancel"}),okButtonProps:{disabled:!Ce.trim()},children:(0,C.Y)(o.Input,{componentId:"shared.model-trace-explorer.custom-view.rename-input",id:"custom-view-rename","aria-label":s.formatMessage({id:"zR3xau",defaultMessage:"Custom view name"}),value:Ce,placeholder:s.formatMessage({id:"z6r4hC",defaultMessage:"Enter a name for this custom view"}),onChange:e=>Ee(e.target.value),onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key&&Ce.trim()&&Oe()}})}),(0,C.Y)(r.M,{componentId:"shared.model-trace-explorer.custom-view.delete-view-modal",visible:Re,title:s.formatMessage({id:"dnoeCa",defaultMessage:"Delete view"}),onCancel:()=>ze(!1),onOk:()=>{const e=k.activeViewId;e&&(k.deleteView(e),ze(!1))},okText:s.formatMessage({id:"tcQ02J",defaultMessage:"Delete"}),cancelText:s.formatMessage({id:"WFT25v",defaultMessage:"Cancel"}),okButtonProps:{danger:!0},children:(0,C.Y)(r.T.Text,{children:null!==E&&void 0!==E&&E.name?s.formatMessage({id:"7b9zBN",defaultMessage:'Delete the view "{name}"? This removes it from the experiment for everyone.'},{name:E.name}):s.formatMessage({id:"vsxMvp",defaultMessage:"Delete this view? This removes it from the experiment for everyone."})})})]})}}}]);

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.