@recombine-ai/bosun 0.20.2 → 0.20.3
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/build/_app/immutable/assets/{0.970vvoDj.css → 0.CdQBFG7k.css} +1 -1
- package/build/_app/immutable/assets/0.CdQBFG7k.css.br +0 -0
- package/build/_app/immutable/assets/0.CdQBFG7k.css.gz +0 -0
- package/build/_app/immutable/chunks/{BOZLjogl.js → BFUe72xu.js} +1 -1
- package/build/_app/immutable/chunks/BFUe72xu.js.br +0 -0
- package/build/_app/immutable/chunks/BFUe72xu.js.gz +0 -0
- package/build/_app/immutable/chunks/Bmkwccsg.js +1 -0
- package/build/_app/immutable/chunks/Bmkwccsg.js.br +0 -0
- package/build/_app/immutable/chunks/Bmkwccsg.js.gz +0 -0
- package/build/_app/immutable/chunks/CZcJNBdK.js +1 -0
- package/build/_app/immutable/chunks/CZcJNBdK.js.br +2 -0
- package/build/_app/immutable/chunks/CZcJNBdK.js.gz +0 -0
- package/build/_app/immutable/chunks/DdNCOsWe.js +3 -0
- package/build/_app/immutable/chunks/DdNCOsWe.js.br +0 -0
- package/build/_app/immutable/chunks/DdNCOsWe.js.gz +0 -0
- package/build/_app/immutable/entry/{app.Nx0-kikH.js → app.L5djN6KO.js} +2 -2
- package/build/_app/immutable/entry/app.L5djN6KO.js.br +0 -0
- package/build/_app/immutable/entry/app.L5djN6KO.js.gz +0 -0
- package/build/_app/immutable/entry/start.CGCxa4r9.js +1 -0
- package/build/_app/immutable/entry/start.CGCxa4r9.js.br +0 -0
- package/build/_app/immutable/entry/start.CGCxa4r9.js.gz +0 -0
- package/build/_app/immutable/nodes/{0.B5_ukjYU.js → 0.DxT2ZCBH.js} +1 -1
- package/build/_app/immutable/nodes/0.DxT2ZCBH.js.br +0 -0
- package/build/_app/immutable/nodes/0.DxT2ZCBH.js.gz +0 -0
- package/build/_app/immutable/nodes/{1.BnET9__M.js → 1.CuGmyB-B.js} +1 -1
- package/build/_app/immutable/nodes/1.CuGmyB-B.js.br +2 -0
- package/build/_app/immutable/nodes/1.CuGmyB-B.js.gz +0 -0
- package/build/_app/immutable/nodes/{16.C0hAGH9Y.js → 16.RilBjs7p.js} +1 -1
- package/build/_app/immutable/nodes/16.RilBjs7p.js.br +0 -0
- package/build/_app/immutable/nodes/16.RilBjs7p.js.gz +0 -0
- package/build/_app/immutable/nodes/17.lZCHazN-.js +11 -0
- package/build/_app/immutable/nodes/17.lZCHazN-.js.br +0 -0
- package/build/_app/immutable/nodes/17.lZCHazN-.js.gz +0 -0
- package/build/_app/immutable/nodes/{2.0cl8Jw4o.js → 2.47DRuv-7.js} +1 -1
- package/build/_app/immutable/nodes/2.47DRuv-7.js.br +0 -0
- package/build/_app/immutable/nodes/2.47DRuv-7.js.gz +0 -0
- package/build/_app/immutable/nodes/{3.CxkjPmTD.js → 3.BTFj2TcK.js} +1 -1
- package/build/_app/immutable/nodes/3.BTFj2TcK.js.br +0 -0
- package/build/_app/immutable/nodes/3.BTFj2TcK.js.gz +0 -0
- package/build/_app/immutable/nodes/{4.h7GzNdQ-.js → 4.D7rKFBIq.js} +1 -1
- package/build/_app/immutable/nodes/4.D7rKFBIq.js.br +0 -0
- package/build/_app/immutable/nodes/4.D7rKFBIq.js.gz +0 -0
- package/build/_app/immutable/nodes/{6.MjSRR3jo.js → 6.C7VHMxJG.js} +1 -1
- package/build/_app/immutable/nodes/6.C7VHMxJG.js.br +0 -0
- package/build/_app/immutable/nodes/6.C7VHMxJG.js.gz +0 -0
- package/build/_app/immutable/nodes/{8.BCatMgwB.js → 8.B-2mfKlr.js} +1 -1
- package/build/_app/immutable/nodes/8.B-2mfKlr.js.br +0 -0
- package/build/_app/immutable/nodes/8.B-2mfKlr.js.gz +0 -0
- package/build/_app/immutable/nodes/{9.BFI7-HIR.js → 9.DGHLzn6-.js} +1 -1
- package/build/_app/immutable/nodes/9.DGHLzn6-.js.br +0 -0
- package/build/_app/immutable/nodes/9.DGHLzn6-.js.gz +0 -0
- package/build/_app/version.json +1 -1
- package/build/_app/version.json.br +0 -0
- package/build/_app/version.json.gz +0 -0
- package/build/index.html +10 -10
- package/build/index.html.br +0 -0
- package/build/index.html.gz +0 -0
- package/package.json +1 -1
- package/build/_app/immutable/assets/0.970vvoDj.css.br +0 -0
- package/build/_app/immutable/assets/0.970vvoDj.css.gz +0 -0
- package/build/_app/immutable/chunks/BOZLjogl.js.br +0 -2
- package/build/_app/immutable/chunks/BOZLjogl.js.gz +0 -0
- package/build/_app/immutable/chunks/Byx1piFp.js +0 -3
- package/build/_app/immutable/chunks/Byx1piFp.js.br +0 -0
- package/build/_app/immutable/chunks/Byx1piFp.js.gz +0 -0
- package/build/_app/immutable/chunks/jbAfpNOj.js +0 -1
- package/build/_app/immutable/chunks/jbAfpNOj.js.br +0 -0
- package/build/_app/immutable/chunks/jbAfpNOj.js.gz +0 -0
- package/build/_app/immutable/chunks/vxN0p6wG.js +0 -1
- package/build/_app/immutable/chunks/vxN0p6wG.js.br +0 -2
- package/build/_app/immutable/chunks/vxN0p6wG.js.gz +0 -0
- package/build/_app/immutable/entry/app.Nx0-kikH.js.br +0 -0
- package/build/_app/immutable/entry/app.Nx0-kikH.js.gz +0 -0
- package/build/_app/immutable/entry/start.t9PGFpmm.js +0 -1
- package/build/_app/immutable/entry/start.t9PGFpmm.js.br +0 -1
- package/build/_app/immutable/entry/start.t9PGFpmm.js.gz +0 -0
- package/build/_app/immutable/nodes/0.B5_ukjYU.js.br +0 -0
- package/build/_app/immutable/nodes/0.B5_ukjYU.js.gz +0 -0
- package/build/_app/immutable/nodes/1.BnET9__M.js.br +0 -0
- package/build/_app/immutable/nodes/1.BnET9__M.js.gz +0 -0
- package/build/_app/immutable/nodes/16.C0hAGH9Y.js.br +0 -0
- package/build/_app/immutable/nodes/16.C0hAGH9Y.js.gz +0 -0
- package/build/_app/immutable/nodes/17.DHifdmRv.js +0 -10
- package/build/_app/immutable/nodes/17.DHifdmRv.js.br +0 -0
- package/build/_app/immutable/nodes/17.DHifdmRv.js.gz +0 -0
- package/build/_app/immutable/nodes/2.0cl8Jw4o.js.br +0 -0
- package/build/_app/immutable/nodes/2.0cl8Jw4o.js.gz +0 -0
- package/build/_app/immutable/nodes/3.CxkjPmTD.js.br +0 -0
- package/build/_app/immutable/nodes/3.CxkjPmTD.js.gz +0 -0
- package/build/_app/immutable/nodes/4.h7GzNdQ-.js.br +0 -0
- package/build/_app/immutable/nodes/4.h7GzNdQ-.js.gz +0 -0
- package/build/_app/immutable/nodes/6.MjSRR3jo.js.br +0 -0
- package/build/_app/immutable/nodes/6.MjSRR3jo.js.gz +0 -0
- package/build/_app/immutable/nodes/8.BCatMgwB.js.br +0 -0
- package/build/_app/immutable/nodes/8.BCatMgwB.js.gz +0 -0
- package/build/_app/immutable/nodes/9.BFI7-HIR.js.br +0 -0
- package/build/_app/immutable/nodes/9.BFI7-HIR.js.gz +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{B as e,Dt as t,E as n,F as r,G as i,H as a,I as o,L as s,N as c,Nt as l,O as u,Ot as d,Pt as f,S as p,V as m,a as h,at as g,b as _,dt as v,et as y,gt as b,it as x,j as S,k as C,l as w,m as ee,ot as T,pt as E,r as D,st as O,tt as k,x as te,z as A}from"../chunks/CPCsWwEy.js";import"../chunks/xihTtKlq.js";import{r as j,t as M}from"../chunks/oarl--hZ.js";import{t as N}from"../chunks/6OCsQ6r7.js";import{t as P}from"../chunks/Cf3l6QEG.js";import{t as F}from"../chunks/DWoqp3ac.js";import{t as ne}from"../chunks/B9YnyJ2j.js";import{c as re,i as I,o as ie,s as L}from"../chunks/By9tvIIw.js";import{r as ae}from"../chunks/BOHUKGg_.js";import{t as oe}from"../chunks/D3fLfD-Y.js";import{a as se,i as ce,n as le,o as ue,r as de,s as R,t as fe}from"../chunks/
|
|
1
|
+
import{B as e,Dt as t,E as n,F as r,G as i,H as a,I as o,L as s,N as c,Nt as l,O as u,Ot as d,Pt as f,S as p,V as m,a as h,at as g,b as _,dt as v,et as y,gt as b,it as x,j as S,k as C,l as w,m as ee,ot as T,pt as E,r as D,st as O,tt as k,x as te,z as A}from"../chunks/CPCsWwEy.js";import"../chunks/xihTtKlq.js";import{r as j,t as M}from"../chunks/oarl--hZ.js";import{t as N}from"../chunks/6OCsQ6r7.js";import{t as P}from"../chunks/Cf3l6QEG.js";import{t as F}from"../chunks/DWoqp3ac.js";import{t as ne}from"../chunks/B9YnyJ2j.js";import{c as re,i as I,o as ie,s as L}from"../chunks/By9tvIIw.js";import{r as ae}from"../chunks/BOHUKGg_.js";import{t as oe}from"../chunks/D3fLfD-Y.js";import{a as se,i as ce,n as le,o as ue,r as de,s as R,t as fe}from"../chunks/DdNCOsWe.js";var pe=s(`<span class="min-w-0 flex-1 truncate text-left"> </span> <!>`,1),z=s(`<div class="flex items-start gap-2"><div class="min-w-0"><div class="truncate p-1 text-sm text-rc-gray-300 group-hover:text-rc-gray-200"> </div> <div> </div></div></div>`),B=s(`<div class="mt-1 max-h-96 w-max min-w-full max-w-[min(26rem,90vw)] overflow-y-auto overflow-x-hidden rounded-lg border border-rc-gray-110 bg-rc-gray-930 backdrop-blur-2xl" role="listbox"></div>`),V=s(`<div><!> <!></div>`);function H(e,n){d(n,!0);let a=h(n,`class`,3,``),o=E(!1),s=E(null),l=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function p(){v(o,!i(o))}function m(e){n.onSelect(e),v(o,!1)}function _(e){return(e.lastMessage??``).trim()||`No messages`}function S(e,t=50,n=`…`){if(!e)return``;if(e.length<=t)return e;let r=e.slice(0,t+1),i=Math.max(r.lastIndexOf(` `),r.lastIndexOf(`\xA0`),r.lastIndexOf(` `),r.lastIndexOf(`
|
|
2
2
|
`),r.lastIndexOf(`\r`));return(i>0?r.slice(0,i):e.slice(0,t)).trimEnd()+n}function w(e){e.key===`ArrowDown`&&!i(o)?(v(o,!0),e.preventDefault()):e.key===`ArrowUp`&&i(o)&&(v(o,!1),e.preventDefault())}function ee(e){let t=e.getDate(),n=l[e.getMonth()],r=e.getHours(),i=r>=12?`PM`:`AM`;r%=12,r===0&&(r=12);let a=String(e.getMinutes()).padStart(2,`0`),o=new Date,s=e.getFullYear();return`${t} ${n}${s===o.getFullYear()?``:` ${s}`}, ${r}:${a} ${i}`}function D(e){return ee(new Date(e.createdAt))}let O=b(()=>n.conversations.find(e=>e.conversationId===n.currentConversationId)??null),k=b(()=>i(O)?D(i(O)):`History`);var A=V(),j=x(A);N(j,{variant:`ghost`,get"aria-expanded"(){return i(o)},"aria-haspopup":`listbox`,"aria-controls":`history-dropdown`,onclick:p,onkeydown:w,class:`inline-flex w-40 items-center rounded-lg border border-transparent !bg-rc-gray-700 !px-3 !pb-1 !pt-[5px] text-rc-gray-200 hover:border hover:border-rc-gray-500 focus:outline-none focus:ring-0`,get el(){return i(s)},set el(e){v(s,e,!0)},children:(e,t)=>{var n=pe(),a=g(n),s=x(a,!0);f(a);var l=T(a,2);{let e=b(()=>`size-7 shrink-0 text-rc-gray-500 transition-transform duration-200 `+(i(o)?`rotate-180`:``));P(l,{name:`chevron-down`,get class(){return i(e)}})}y(()=>c(s,i(k))),r(e,n)},$$slots:{default:!0}});var M=T(j,2);R(M,{id:`history-dropdown`,get open(){return i(o)},onClose:()=>v(o,!1),get anchorEl(){return i(s)},placement:`bottom-start`,offset:[0,1],children:e=>{var t=B();u(t,21,()=>n.conversations,C,(e,t)=>{{let a=b(()=>i(t).conversationId===n.currentConversationId);N(e,{variant:`ghost`,size:`small`,role:`option`,get"aria-selected"(){return i(a)},onclick:()=>m(i(t).conversationId),class:`group w-full rounded-none border-b border-rc-gray-110 py-2 pr-3 text-left backdrop-blur-2xl last:border-b-0 hover:bg-rc-gray-700 focus:bg-rc-gray-400`,children:(e,a)=>{var o=z(),s=x(o),l=x(s),u=x(l,!0);f(l);var d=T(l,2),p=x(d,!0);f(d),f(s),f(o),y((e,r)=>{c(u,e),te(d,1,`truncate p-1 text-base font-semibold `+(i(t).conversationId===n.currentConversationId?`text-rc-green-200`:`text-rc-gray-100`)),c(p,r)},[()=>D(i(t)),()=>S(_(i(t)))]),r(e,o)},$$slots:{default:!0}})}}),f(t),r(e,t)},$$slots:{default:!0}}),f(A),y(()=>te(A,1,`relative ${a()}`)),r(e,A),t()}var U=s(`<dialog class="dialog m-auto bg-transparent p-0 text-rc-gray-100 shadow-md svelte-jby388"><!> <!></dialog>`);function me(e,i){d(i,!0);let a,o=h(i,`showCloseButton`,3,!1),s=h(i,`onClose`,3,()=>{}),c=h(i,`onOpen`,3,()=>{}),u=h(i,`isOpen`,3,!1);k(()=>{u()?(console.log(`show`),a?.showModal(),c()()):a?.open&&(console.log(`close`),a.close())});function p(){s()()}D(()=>(a.addEventListener(`close`,p),()=>{a.removeEventListener(`close`,p)}));function g(e){e.target===a&&a.close()}var _=U(),v=x(_);n(v,()=>i.children);var y=T(v,2),b=e=>{N(e,{variant:`ghost`,onclick:()=>a.close(),class:`absolute right-2 top-2`,children:(e,t)=>{l();var n=A(`✕`);r(e,n)},$$slots:{default:!0}})};S(y,e=>{o()&&e(b)}),f(_),w(_,e=>a=e,()=>a),m(`mousedown`,_,g),r(e,_),t()}e([`mousedown`]);function he(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n.text,r=n.lastSeen,i=n.uses;if(typeof e!=`string`||typeof r!=`number`||!Number.isFinite(r)||typeof i!=`number`||!Number.isFinite(i))continue;let a=e.trim();a&&t.push({text:a,lastSeen:r,uses:i})}return t.sort((e,t)=>t.lastSeen-e.lastSeen),t}function ge(e,t,n=2e3){let r=t.trim();if(!r)return e;let i=(e[0]?.lastSeen??0)+1,a=e.findIndex(e=>e.text===r),o;if(a!==-1){let t=e[a];o=[{text:t.text,lastSeen:i,uses:(t.uses??0)+1},...e.slice(0,a),...e.slice(a+1)]}else o=[{text:r,lastSeen:i,uses:1},...e];return o.length>n?o.slice(0,n):o}function _e(e,t,n=2e3){if(!t.length)return e;if(!e.length)return t;let r=e[0]?.lastSeen??0,i=(t[0]?.lastSeen??0)>r?t:t.map((e,n)=>({...e,lastSeen:r+(t.length-n)})),a=new Map;for(let t of e)a.set(t.text,t);for(let e of i){let t=a.get(e.text);if(!t){a.set(e.text,e);continue}a.set(e.text,{text:e.text,lastSeen:Math.max(t.lastSeen,e.lastSeen),uses:t.uses+e.uses})}return Array.from(a.values()).sort((e,t)=>t.lastSeen-e.lastSeen).slice(0,n)}function ve(e,t,n=5){if(!t.length)return[];let r=e.trim().toLowerCase(),i=W(e,!1).text,a=/\s$/u.test(e);if(!W(e,!0).text)return[];let o=[];for(let e of t){let t=W(e.text);if(!t.text||e.text.trim().toLowerCase()===r)continue;let n=ye(t,e.text,i,a);n&&o.push({item:e,match:n})}return o.sort((e,t)=>e.match.kindRank===t.match.kindRank?e.match.span===t.match.span?e.match.start===t.match.start?e.item.lastSeen===t.item.lastSeen?e.item.uses===t.item.uses?e.item.text.length-t.item.text.length:t.item.uses-e.item.uses:t.item.lastSeen-e.item.lastSeen:e.match.start-t.match.start:e.match.span-t.match.span:e.match.kindRank-t.match.kindRank),o.slice(0,n).map(e=>({text:e.item.text,prefixEndIndex:e.match.prefixEndIndex,segments:xe(e.item.text,e.match.ranges)}))}function W(e,t=!0){let n=[],r=[];for(let t=0;t<e.length;t++){let i=G(e[t]);if(i===` `){if(!n.length)continue;let e=n.length-1;if(n[e]===` `){r[e][1]=t+1;continue}}n.push(i),r.push([t,t+1])}return t&&n[n.length-1]===` `&&(n.pop(),r.pop()),{text:n.join(``),ranges:r}}function G(e){if(/\s/u.test(e))return` `;try{return/[\p{P}\p{S}]/u.test(e)?` `:e.toLowerCase()}catch{return/[^a-z0-9\s]/i.test(e)?` `:e.toLowerCase()}}function ye(e,t,n,r){if(!e.text)return null;if(e.text.startsWith(n)){let e=be(t,n,r)??t.length,i=Math.max(0,Math.min(t.length,e));return{kindRank:0,start:0,span:n.length,ranges:[[0,i]],prefixEndIndex:i}}let i=e.text.indexOf(n);return i===-1?null:{kindRank:J(e.text,i,n.length),start:i,span:n.length,ranges:Y(e,i,i+n.length),prefixEndIndex:t.length}}function K(e,t){return t<=0||e[t-1]===` `}function q(e,t){return t>=e.length||e[t]===` `}function J(e,t,n){let r=K(e,t),i=q(e,t+n);return r&&i?1:r?2:3}function Y(e,t,n){let r=Math.max(0,Math.min(e.ranges.length,t)),i=Math.max(r,Math.min(e.ranges.length,n));return X(e.ranges.slice(r,i))}function be(e,t,n){if(!t)return null;let r=``,i=!0;for(let a=0;a<e.length;a++){let o=e[a],s;if(/\s/u.test(o))s=` `;else try{s=/[\p{P}\p{S}]/u.test(o)?` `:o.toLowerCase()}catch{s=/[^a-z0-9\s]/i.test(o)?` `:o.toLowerCase()}if(s===` `){if(i)continue;r+=` `,i=!0}else r+=s,i=!1;if(r.length===t.length){if(r!==t)return null;let i=a+1;if(n&&t.endsWith(` `)){let t=i;for(;t<e.length;){let n=e[t];if(/\s/u.test(n)){t+=1;continue}try{if(/[\p{P}\p{S}]/u.test(n)){t+=1;continue}}catch{if(/[^a-z0-9\s]/i.test(n)){t+=1;continue}}break}i=t}return i}if(r.length>t.length)return null}return null}function xe(e,t){let n=X(t);if(!n.length)return[{text:e,matched:!1}];let r=[],i=0;for(let[t,a]of n)t>i&&r.push({text:e.slice(i,t),matched:!1}),r.push({text:e.slice(t,a),matched:!0}),i=a;return i<e.length&&r.push({text:e.slice(i),matched:!1}),r.filter(e=>e.text.length>0)}function X(e){if(!e.length)return[];let t=e.map(([e,t])=>[Math.max(0,e),Math.max(0,t)]).filter(([e,t])=>t>e).sort((e,t)=>e[0]-t[0]||e[1]-t[1]);if(!t.length)return[];let n=[[t[0][0],t[0][1]]];for(let e=1;e<t.length;e++){let[r,i]=t[e],a=n[n.length-1];if(r<=a[1]){a[1]=Math.max(a[1],i);continue}n.push([r,i])}return n}var Se=s(`<form><h2 class="text-l mb-4 text-gray-300">Image URL</h2> <!> <!></form>`),Ce=s(`<div class="my-2 flex w-full justify-center"><div class="rounded-full border border-rc-gray-650 bg-rc-gray-800/40 px-3 py-1 text-xs text-rc-gray-200"> </div></div>`),we=s(`<div class="rounded-lg border border-rc-green-450 bg-transparent px-3 py-2 text-sm text-rc-gray-300">Generating 9 more variants…</div>`),Te=s(`<div class="rounded-lg border border-red-500/70 bg-red-950/20 px-3 py-2 text-sm text-red-200"> </div>`),Ee=s(`<button type="button"><div class="whitespace-pre-line break-words"> </div></button>`),De=s(`<div class="ml-7 mt-2 flex flex-col gap-2"><!> <!> <!></div>`),Oe=s(`<!> <div class="log-element"><div><!></div> <!></div>`,1),ke=s(`<div class="absolute bottom-2 left-2 right-2 z-10 flex items-center gap-3 rounded-lg border border-rc-green-450 bg-rc-gray-930/90 px-3 py-3 font-semibold text-rc-gray-100 shadow-inner-white-soft backdrop-blur-3xl"><span>Choose a variant above to continue</span> <button type="button" class="rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-300 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-100 focus:outline-none focus-visible:outline-none disabled:cursor-wait disabled:opacity-50">Regenerate</button> <button type="button" class="rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-300 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-100 focus:outline-none focus-visible:outline-none">Cancel</button></div>`),Ae=s(`<div class="absolute bottom-16 left-2 right-2 z-20 rounded-lg border border-red-500/60 bg-red-950/90 px-3 py-2 text-sm text-red-100 shadow-lg" role="alert"> </div>`),je=s(`<span> </span>`),Me=s(`<button type="button" role="option" tabindex="-1"></button>`),Ne=s(`<div class="absolute bottom-full left-0 right-0 mb-1 max-h-60 overflow-y-auto rounded-lg border border-rc-gray-110 bg-rc-gray-930 shadow-inner-white-soft backdrop-blur-2xl" role="listbox"></div>`),Pe=s(`<div class="pointer-events-none absolute inset-0 z-10 overflow-hidden rounded-lg" aria-hidden="true"><div class="whitespace-pre text-rc-gray-400/70"><span class="invisible"> </span><span> </span></div></div>`),Fe=s(`<!> <form><fieldset class="absolute bottom-2 left-2 right-2 z-10 flex gap-2 disabled:opacity-35"><div class="relative flex-1"><!> <!> <button type="button" class="absolute bottom-0 left-3 top-0 z-20 inline-flex items-center border-r border-rc-gray-500/70 bg-transparent pr-2 text-base font-semibold leading-6 text-rc-gray-300 transition-colors duration-75 hover:text-rc-gray-300 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50"> </button> <!></div> <!> <!></fieldset></form>`,1),Ie=s(`<div class="rc-scroll min-h-0 flex-1 overflow-y-auto pr-1"></div> <!>`,1),Le=s(`<!> <!>`,1);function Z(e,n){d(n,!0);let s=h(n,`promptEditProposalId`,3,null),D=h(n,`analyzeDisabled`,3,!1),M=h(n,`variantSourceTrace`,3,null),ae=h(n,`variantChoices`,19,()=>[]),se=h(n,`variantLoading`,3,!1),R=h(n,`variantApplyingId`,3,null),pe=h(n,`variantError`,3,null),z=O(new Set),B=E(``),V=E(``),H=E(``),U,W=E(!1),G=E(null),ye=E(``),K=E(!1),q=E(`user`),J=E(null),Y=E(O([])),be=E(null),xe=E(!1),X=E(!1),Z=E(null),Q=b(()=>ve(i(B),i(Y))),Re=b(()=>i(Z)==null?null:i(Q)[i(Z)]??null),ze=b(()=>i(Re)?i(Re).text.slice(i(Re).prefixEndIndex):``),Be=b(()=>!M()&&!i(H)&&i(B).trim().length===0);k(()=>{if(typeof window>`u`)return;if(!i(G)){v(ye,``);return}let e=window.getComputedStyle(i(G)),t=`calc(${e.paddingTop} + ${e.borderTopWidth})`,n=`calc(${e.paddingRight} + ${e.borderRightWidth})`,r=`calc(${e.paddingBottom} + ${e.borderBottomWidth})`,a=`calc(${e.paddingLeft} + ${e.borderLeftWidth})`;v(ye,[`padding:${t} ${n} ${r} ${a}`,`font:${e.font}`,`letter-spacing:${e.letterSpacing}`,`line-height:${e.lineHeight}`,`text-indent:${e.textIndent}`,`text-transform:${e.textTransform}`,`text-align:${e.textAlign}`,`box-sizing:${e.boxSizing}`].join(`;`),!0)}),k(()=>{i(Z)!=null&&i(Z)>=i(Q).length&&v(Z,null)});let Ve=b(()=>M()||!i(xe)||i(X)?!1:i(Q).length>0);function He(e){v(B,e.text,!0),v(Z,null),v(X,!0)}function Ue(){v(xe,!0),v(X,!1)}function We(){v(xe,!1),v(Z,null),v(X,!1)}function Ge(){v(Z,null),v(X,!1)}function Ke(e){if(e.key===`Escape`){i(Ve)&&e.preventDefault(),v(X,!0),v(Z,null);return}if(e.key===`ArrowUp`||e.key===`ArrowDown`){if(!i(Q).length)return;i(X)&&v(X,!1),e.preventDefault();let t=i(Q).length-1;if(i(Z)===null)v(Z,e.key===`ArrowUp`?t:0,!0);else{let n=e.key===`ArrowUp`?-1:1;v(Z,Math.max(0,Math.min(t,i(Z)+n)),!0)}return}if(e.key===`Enter`||e.key===`Tab`&&!e.shiftKey){if(i(Z)===null)return;let t=i(Q)[i(Z)];if(!t)return;e.preventDefault(),He(t);return}}let qe=null,Je=!1,Ye=0;function Xe(){typeof window>`u`||U&&(!Je&&z.has(U)||(qe??=requestAnimationFrame(()=>{if(qe=null,!U||!Je&&z.has(U))return;let e=U.scrollHeight-(U.scrollTop+U.clientHeight),t=Je||e>U.clientHeight?`auto`:`smooth`;U.scrollTo({top:U.scrollHeight,behavior:t}),Je=!1})))}k(()=>{let e=I.length;e===0&&Ye>0&&(Je=!0,U&&z.delete(U)),Ye=e,e>0&&Xe()});function Ze(e){e.scrollTop+e.clientHeight+200>e.scrollHeight?z.delete(e):z.add(e)}function Qe(e){i(K)||(i(B).trim().length>0||i(H))&&(v(Y,ge(i(Y),i(B)),!0),n.onmessage({sender:e,text:i(B),imageUrl:i(H)}),v(H,``),v(B,``),v(q,`user`),v(X,!1),v(Z,null))}function $e(e){e.preventDefault(),Qe(i(q))}function et(){v(q,i(q)===`system`?`user`:`system`,!0),requestAnimationFrame(()=>i(G)?.focus())}function tt(e){e.preventDefault(),v(H,i(V),!0),v(V,``),v(W,!1)}function nt(e){return e&&typeof e.renderedPrompt==`string`?e.renderedPrompt:null}function rt(e,t){for(let n=t-1;n>=0;n--){let t=e[n];if(re(t)&&ne(t.name)&&nt(t))return t}for(let n=t-1;n>=0;n--){let t=e[n];if(re(t)&&t.name===`prewarm`&&nt(t))return t}return null}function it(e){return(e.eventName===`received-message`||e.eventName===`llm-handler-stream-requested`)&&!String(e.content??``).trim()?!1:e.eventName===`received-message`||e.eventName===`llm-handler-stream-requested`||e.eventName===`finished-main-streaming-step`||e.eventName===`sent-message`||e.eventName===`transfer-requested`||e.eventName===`hangup-requested`}function at(e){return!!(n.agentId&&n.agentId.trim())&&e.eventName!==`transfer-requested`&&(e.eventName===`finished-main-streaming-step`||e.eventName===`sent-message`)}function ot(e){return e.role===`user`||e.eventName===`received-message`||e.eventName===`llm-handler-stream-requested`}function st(e){let t=String(e??``).trim();return!t||/^\[image\]\s+/.test(t)?``:t}function ct(e){let t=e?.bosunInputMessageSender;return t===`system`?`system`:t===`user`?`user`:e.role===`system`?`system`:`user`}function lt(e){if(!n.onRevertToState)return;let t=e?.bosunPrevStateId,r=typeof t==`string`&&t.trim().length>0?t:null;n.onRevertToState(r);let a=typeof e?.bosunUserMessage==`string`?e.bosunUserMessage:e.content;v(B,st(a),!0),v(q,ct(e),!0),v(X,!1),v(Z,null),requestAnimationFrame(()=>{try{i(G)?.focus(),i(G)?.select()}catch{}})}function ut(){n.agentType===`text`?v(W,!0):n.agentType===`voice`&&n.onHangup?.()}let dt=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function ft(e){if(typeof e!=`number`||!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function pt(e){if(typeof e!=`number`||!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:`${t.getDate()} ${dt[t.getMonth()]} ${t.getFullYear()}`}let $=b(()=>I.filter(e=>ie(e)||re(e)?!0:L(e)?it(e):!1)),mt=b(()=>I.findLast(e=>L(e))?.eventName===`hangup-requested`),ht=b(()=>{let e=i($).map((e,t)=>({entry:e,index:t})).reverse().find(({entry:e,index:t})=>!L(e)||!at(e)?!1:i($).slice(0,t).some(e=>L(e)&&ot(e)));return e&&L(e.entry)?e.entry:null}),gt=b(()=>{let e=i(ht);if(!e)return null;try{let t=_t(e);return{model:t.model,stringifiedConversation:t.stringifiedConversation,response:t.response}}catch{return null}});function _t(e){if(!(n.agentId??``).trim())throw Error(`Agent id is not available; cannot analyze`);let t=I.indexOf(e);if(t===-1)throw Error(`Could not locate trace in chat history`);let r=de(I,t,{requireRenderedPrompt:!0});if(!r)throw Error(`Could not find main step trace for this message`);let i=typeof r.renderedPrompt==`string`?r.renderedPrompt:``;if(!i.trim())throw Error(`Main step rendered prompt is missing`);let a=typeof r.stringifiedConversation==`string`&&r.stringifiedConversation.trim()?r.stringifiedConversation:ce(I,t)??``,o=String(e?.content??``);if(!o.trim())throw Error(`Message content is missing`);let s=typeof r?.model==`string`?String(r.model):void 0,c=e?.createdAt;return{trace:e,stepTrace:r,renderedPrompt:i,stringifiedConversation:a,response:o,model:s,createdAt:typeof c==`number`&&Number.isFinite(c)?c:void 0}}function vt(e){if(n.onAnalyzeTrace)try{v(J,null),n.onAnalyzeTrace(_t(e))}catch(e){console.error(e),v(J,e instanceof Error?e.message:String(e),!0)}}function yt(e){if(n.onRegenerateTrace)try{v(J,null),n.onRegenerateTrace(e)}catch(e){console.error(e),v(J,e instanceof Error?e.message:String(e),!0)}}async function bt(){if(i(K))return;let e=i(gt);if(e){v(X,!0),v(Z,null),v(K,!0);try{let t=await F.agents.generateUserResponse.mutate(e);v(B,t.text,!0),v(X,!0),v(Z,null),requestAnimationFrame(()=>{try{i(G)?.focus(),i(G)?.setSelectionRange(t.text.length,t.text.length)}catch{}})}catch(e){console.error(`Failed to generate suggested user response`,e)}finally{v(K,!1)}}}k(()=>{if(typeof window>`u`)return;let e=(n.agentId??``).trim();if(!e||e===i(be))return;v(be,e,!0),v(Y,[],!0);let t=e,r=e;F.agents.userMessageHistory.query({agentId:t}).then(e=>{if(i(be)!==r)return;let t=he(e);v(Y,_e(t,i(Y)),!0),v(Z,null)}).catch(e=>{console.error(`Failed to load user message history`,e),i(be)===r&&(v(Y,[],!0),v(Z,null))})}),k(()=>{let e=M(),t=ae().length,n=se(),r=pe(),i=R();!e&&!t&&!n&&!r&&!i||Xe()});var xt=Le(),St=g(xt);me(St,{get isOpen(){return i(W)},onClose:()=>v(W,!1),showCloseButton:!0,children:(e,t)=>{j(e,{class:`p-4`,children:(e,t)=>{var n=Se(),o=T(x(n),2);oe(o,{class:`mb-2 w-80`,get value(){return i(V)},set value(e){v(V,e,!0)}});var s=T(o,2);N(s,{variant:`secondary`,type:`submit`,class:`ml-2 p-2`,children:(e,t)=>{l();var n=A(`Attach`);r(e,n)},$$slots:{default:!0}}),f(n),a(`submit`,n,tt),r(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var Ct=T(St,2);j(Ct,{get class(){return`relative flex min-h-0 flex-col p-2 pb-16 ${n.class??``}`},children:(e,t)=>{var l=Ie(),d=g(l);u(d,21,()=>i($),C,(e,t,a)=>{let o=b(()=>ft(i(t).createdAt)),l=b(()=>a>0?ft(i($)[a-1].createdAt):null),d=b(()=>pt(i(t).createdAt));var p=Oe(),h=g(p),_=e=>{var t=Ce(),n=x(t),a=x(n,!0);f(n),f(t),y(()=>c(a,i(d))),r(e,t)};S(h,e=>{i(o)&&i(d)&&i(o)!==i(l)&&e(_)});var v=T(h,2),C=x(v),w=x(C),ee=e=>{ue(e,{get trace(){return i(t)}})},E=b(()=>ie(i(t))),O=e=>{{let r=b(()=>de(i($),a)),o=b(()=>n.onAnalyzeTrace?vt:void 0),c=b(()=>n.onRegenerateTrace?yt:void 0),l=b(()=>n.onRevertToState?lt:void 0),u=b(()=>!!n.onSeeVariants&&!M()&&i(t)===i(ht)),d=b(()=>M()&&i(t)===M()?`source`:`none`),f=b(()=>R()===null&&M()&&i(t)===M()?n.onChooseOriginalVariant:void 0),p=b(()=>!!M()&&i(t)===M());le(e,{testCreationMode:`direct`,get trace(){return i(t)},get context(){return n.context},get agentId(){return n.agentId},get promptEditProposalId(){return s()},get testSourceStep(){return i(r)},get testEntries(){return i($)},get analyzeDisabled(){return D()},get onAnalyze(){return i(o)},get onRegenerate(){return i(c)},get onRevert(){return i(l)},get showSeeVariants(){return i(u)},get onSeeVariants(){return n.onSeeVariants},get variantSelectionState(){return i(d)},get onSelectInVariantMode(){return i(f)},get suppressActionRow(){return i(p)}})}},k=b(()=>L(i(t))),A=e=>{{let r=b(()=>ce(i($),a)),o=b(()=>ne(i(t).name)?rt(i($),a):null);fe(e,{testCreationMode:`direct`,get trace(){return i(t)},get agentId(){return n.agentId},get promptEditProposalId(){return s()},get fallbackConversation(){return i(r)},get runtimeContext(){return n.context},get compareTrace(){return i(o)}})}},j=b(()=>re(i(t)));S(w,e=>{i(E)?e(ee):i(k)?e(O,1):i(j)&&e(A,2)}),f(C);var N=T(C,2),P=e=>{var t=De(),a=x(t),o=e=>{var t=we();r(e,t)};S(a,e=>{se()&&e(o)});var s=T(a,2),l=e=>{var t=Te(),n=x(t,!0);f(t),y(()=>c(n,pe())),r(e,t)};S(s,e=>{pe()&&e(l)});var d=T(s,2);u(d,17,ae,e=>e.id,(e,t)=>{var a=Ee(),o=x(a),s=x(o,!0);f(o),f(a),y(()=>{a.disabled=R()!==null,te(a,1,`w-full max-w-[83%] cursor-pointer rounded-lg border border-rc-green-450 bg-transparent p-2 pt-1 text-left text-rc-gray-100 backdrop-blur-md transition-colors hover:bg-rc-green-700 focus:outline-none focus-visible:outline-none disabled:cursor-wait disabled:opacity-70 ${R()===i(t).id?`bg-rc-green-700`:``}`),c(s,i(t).text)}),m(`click`,a,()=>n.onChooseVariant?.(i(t).id)),r(e,a)}),f(t),r(e,t)};S(N,e=>{M()&&i(t)===M()&&e(P)}),f(v),r(e,p)}),f(d),w(d,e=>U=e,()=>U);var h=T(d,2),E=e=>{var t=ke(),i=T(x(t),2),a=T(i,2);f(t),y(()=>i.disabled=!n.onRegenerateVariants||se()||R()!==null),m(`click`,i,()=>n.onRegenerateVariants?.()),m(`click`,a,()=>n.onCancelVariants?.()),r(e,t)},O=e=>{var t=Fe(),s=g(t),l=e=>{var t=Ae(),n=x(t,!0);f(t),y(()=>c(n,i(J))),r(e,t)};S(s,e=>{i(J)&&e(l)});var d=T(s,2),h=x(d),w=x(h),E=x(w),D=e=>{var t=Ne();u(t,23,()=>i(Q),e=>e.text,(e,t,n)=>{var a=Me();u(a,21,()=>i(t).segments,C,(e,t)=>{var n=je(),a=x(n,!0);f(n),y(()=>{te(n,1,p(i(t).matched?`text-rc-green-200`:``)),c(a,i(t).text)}),r(e,n)}),f(a),y(()=>{ee(a,`aria-selected`,i(Z)===i(n)),te(a,1,`w-full select-none border-b border-rc-gray-110 px-3 py-2 text-left font-semibold text-rc-gray-100 last:border-b-0 hover:bg-rc-gray-700/70 ${i(Z)===i(n)?`bg-rc-gray-700/70`:``}`)}),m(`mousedown`,a,e=>{e.preventDefault(),He(i(t))}),r(e,a)}),f(t),r(e,t)};S(E,e=>{i(Ve)&&e(D)});var O=T(E,2);{let e=b(()=>i(q)===`system`?`!border-emerald-500 !pl-[5.5rem] hover:!border-emerald-500 focus:!border-emerald-500`:`!pl-[4.25rem]`),t=b(()=>i(K)?`Generating`:`Enter message...`);oe(O,{variant:`chat`,get class(){return`!text-base !leading-6 !duration-75 ${i(e)??``}`},get placeholder(){return i(t)},autocomplete:`off`,get readonly(){return i(K)},onfocus:Ue,onblur:We,oninput:Ge,onkeydown:Ke,get value(){return i(B)},set value(e){v(B,e,!0)},get el(){return i(G)},set el(e){v(G,e,!0)}})}var k=T(O,2),A=x(k,!0);f(k);var j=T(k,2),M=e=>{var t=Pe(),n=x(t),a=x(n),o=x(a,!0);f(a);var s=T(a),l=x(s,!0);f(s),f(n),f(t),y(()=>{_(n,i(ye)),c(o,i(B)),c(l,i(ze))}),r(e,t)};S(j,e=>{i(Z)!==null&&i(ze)&&e(M)}),f(w);var F=T(w,2);{let e=b(()=>i(K)||!n.agentType);N(F,{size:`small`,variant:`secondary`,get disabled(){return i(e)},onclick:ut,children:(e,t)=>{var i=o(),a=g(i),s=e=>{P(e,{name:`paperclip`})},c=e=>{P(e,{name:`hangup`})};S(a,e=>{n.agentType===`text`?e(s):n.agentType===`voice`&&e(c,1)}),r(e,i)},$$slots:{default:!0}})}var ne=T(F,2),re=e=>{{let t=b(()=>i(K)||!i(gt));N(e,{size:`small`,type:`button`,title:`Generate response`,"aria-label":`Generate response`,get disabled(){return i(t)},class:`inline-flex !w-[59px] items-center justify-center !px-0`,onclick:e=>{e.preventDefault(),bt()},children:(e,t)=>{P(e,{name:`sparkles`})},$$slots:{default:!0}})}},I=e=>{{let t=b(()=>i(q)===`system`?`Send as system`:`Send as user`),n=b(()=>i(q)===`system`?`Send as system`:`Send as user`);N(e,{size:`small`,type:`submit`,get title(){return i(t)},get"aria-label"(){return i(n)},get disabled(){return i(K)},class:`inline-flex !w-[59px] items-center justify-center !px-0`,children:(e,t)=>{P(e,{name:`send`})},$$slots:{default:!0}})}};S(ne,e=>{i(Be)?e(re):e(I,-1)}),f(h),f(d),y(()=>{h.disabled=i(mt),ee(k,`title`,i(q)===`system`?`Switch to user`:`Switch to system`),ee(k,`aria-label`,i(q)===`system`?`Switch to user`:`Switch to system`),k.disabled=i(K),c(A,i(q)===`system`?`System`:`User`)}),a(`submit`,d,$e),m(`click`,k,e=>{e.preventDefault(),e.stopPropagation(),et()}),r(e,t)};S(h,e=>{M()?e(E):e(O,-1)}),a(`scroll`,d,e=>Ze(e.target)),r(e,l)},$$slots:{default:!0}}),r(e,xt),t()}e([`click`,`mousedown`]);var Q=s(`<div class="mt-1 w-max overflow-hidden rounded-lg border border-rc-gray-110 bg-rc-gray-930 shadow-inner-white-soft backdrop-blur-2xl" role="listbox"><!> <!> <!></div>`),Re=s(`<div class="flex h-full items-center justify-center text-sm text-rc-gray-300">Connecting…</div>`),ze=s(`<div class="flex h-full items-center justify-center text-sm text-rc-gray-300">Select an agent to start chatting</div>`),Be=s(`<div class="h-full min-h-0 p-2"><!></div>`),Ve=s(`<div class="relative flex h-full min-h-0 flex-col"><div class="flex flex-none flex-nowrap items-center gap-2 p-2"><!> <div class="ml-auto flex flex-none flex-nowrap items-center gap-2"><!> <!> <!> <!></div></div> <div class="min-h-0 flex-1"><!></div></div>`);function He(e,n){d(n,!0);let{state:a,actions:s}=M(),c=E(!1),u=E(null),p=b(()=>{let e=a.currentStep?.name;return e?Object.values(a.promptEdits).find(t=>t.agentId===a.agentId&&t.step===e)?.id??null:null}),m=E(null),h=null,_=E(!1),y=E(null);b(()=>I.reduce((e,t)=>Math.max(e,ne(t)??0),0)),k(()=>{!I.length&&!ae.length&&i(_)&&v(_,!1)});function C(e){let t=(e||``).trim();return t?t.split(`/`).at(-1)??t:`Agent`}function w(e){if(typeof e!=`number`||!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`}async function ee(e){if(i(c))return;v(c,!0);let t=s.openPopover(`analyze`),n=w(e.createdAt),r=n?` • ${n}`:``,o=`Analysis — ${C(a.agentId)}${r}`;try{let n=await F.agents.analyzeTrace.mutate({agentId:a.agentId,traceId:e.trace?.traceId,eventName:e.trace.eventName,createdAt:e.createdAt,model:e.model,renderedPrompt:e.renderedPrompt,stringifiedConversation:e.stringifiedConversation,response:e.response,stepTrace:e.stepTrace});if(a.edit.popover?.requestId!==t)return;s.setHighlightQuotes(n.quotes);let r=null;try{r=JSON.stringify(n.raw,null,2)}catch{r=null}s.setPopoverReady(t,{title:o,quotes:n.quotes,rationales:n.rationales,parallelCalls:n.parallelCalls,raw:r})}catch(e){console.error(e);let n=typeof e?.message==`string`?e.message:(()=>{try{return JSON.stringify(e)}catch{return String(e)}})();s.setPopoverError(t,n||`Failed to analyze this response`,{raw:n})}finally{v(c,!1)}}function D(e){return e?I:I.map(e=>{if(!re(e))return e;let{receivedPrompt:t,renderedPrompt:n,...r}=e;return r})}function O(e){v(m,e,!0),h&&clearTimeout(h),h=window.setTimeout(()=>{v(m,null),h=null},2e3)}async function te(){try{await navigator.clipboard.writeText(JSON.stringify(ae,null,2)),O(`logs`)}catch(e){console.error(`Failed to copy logs`,e)}}async function j(e){try{await navigator.clipboard.writeText(JSON.stringify(D(e),null,2)),O(e?`with-prompts`:`without-prompts`)}catch(e){console.error(`Failed to copy traces`,e)}}function P(){L(),s.closePopover(),s.newConversation()}function ne(e){let t=e?.bosunTurn;return typeof t==`number`&&t>0?t:null}function ie(e){L();let t=ne(e);if(!t){console.warn(`Cannot regenerate: this response has no turn metadata`);return}s.regenerateFromTurn(t)}function L(){v(u,null)}function oe(e){let t=I.indexOf(e),n=t===-1?null:de(I,t);return n&&n.receivedContext!==void 0?se(n.receivedContext):{}}function ce(e){return oe(e)}async function le(e){let t=a.conversationId;if(!t)return;let n=s.getPromptOverrides();await s.flushPromptSave(),v(u,{sourceTrace:e,choices:[],loading:!0,applyingId:null,error:null},!0);try{let r=await F.agents.generateVariants.mutate({conversationId:t,context:ce(e),promptOverrides:n,count:9});if(!i(u)||i(u).sourceTrace!==e)return;v(u,{...i(u),choices:r,loading:!1,error:null},!0)}catch(t){if(console.error(`Failed to generate variants`,t),!i(u)||i(u).sourceTrace!==e)return;v(u,{...i(u),choices:[],loading:!1,error:typeof t?.message==`string`?t.message:`Failed to generate variants`},!0)}}function ue(e){le(e)}function fe(){s.hangup()}function pe(){let e=i(u)?.sourceTrace;e&&le(e)}async function z(e){let t=a.conversationId;if(!i(u)||!t)return;let n=i(u).choices.find(t=>t.id===e);if(n){v(u,{...i(u),applyingId:e,error:null},!0);try{await F.agents.commitVariant.mutate({conversationId:t,entries:n.entries}),L(),s.selectConversation(t)}catch(e){if(console.error(`Failed to apply variant`,e),!i(u))return;v(u,{...i(u),applyingId:null,error:typeof e?.message==`string`?e.message:`Failed to apply variant`},!0)}}}function B(){L()}k(()=>{let e=i(u),t=a.agentId,n=e?.sourceTrace;!e||!n||(!t||!I.includes(n))&&v(u,null)});var V=Ve(),U=x(V),me=x(U),he=e=>{H(e,{get conversations(){return a.conversations},get currentConversationId(){return a.conversationId},class:`ml-9`,onSelect:e=>s.selectConversation(e)})};S(me,e=>{a.conversations.length>0&&e(he)});var ge=T(me,2),_e=x(ge);{let e=b(()=>!a.context);N(_e,{variant:`secondary`,size:`small`,get disabled(){return i(e)},get"aria-expanded"(){return a.contextPopoverOpen},"aria-haspopup":`dialog`,get onclick(){return s.toggleContextPopover},children:(e,t)=>{l();var n=A(`Show context`);r(e,n)},$$slots:{default:!0}})}var ve=T(_e,2);{let e=b(()=>!I.length&&!ae.length);N(ve,{variant:`secondary`,size:`small`,get disabled(){return i(e)},get"aria-expanded"(){return i(_)},"aria-haspopup":`listbox`,"aria-controls":`roleplay-copy-dropdown`,onclick:e=>{e.stopPropagation(),v(_,!i(_))},get el(){return i(y)},set el(e){v(y,e,!0)},children:(e,t)=>{var n=o(),a=g(n),s=e=>{var t=A(`Copied logs`);r(e,t)},c=e=>{var t=A(`Copied traces (with prompts)`);r(e,t)},l=e=>{var t=A(`Copied traces (without prompts)`);r(e,t)},u=e=>{var t=A(`Copy...`);r(e,t)};S(a,e=>{i(m)===`logs`?e(s):i(m)===`with-prompts`?e(c,1):i(m)===`without-prompts`?e(l,2):e(u,-1)}),r(e,n)},$$slots:{default:!0}})}var W=T(ve,2);R(W,{id:`roleplay-copy-dropdown`,get open(){return i(_)},onClose:()=>v(_,!1),get anchorEl(){return i(y)},placement:`bottom-end`,offset:[0,1],children:e=>{var t=Q(),n=x(t);{let e=b(()=>!ae.length);N(n,{variant:`ghost`,size:`small`,role:`option`,get disabled(){return i(e)},onclick:e=>{e.stopPropagation(),v(_,!1),te()},class:`block rounded-none border-b border-rc-gray-110 py-2 pr-3 text-left backdrop-blur-2xl hover:bg-rc-gray-700 focus:bg-rc-gray-400`,children:(e,t)=>{l();var n=A(`Copy logs`);r(e,n)},$$slots:{default:!0}})}var a=T(n,2);{let e=b(()=>!I.length);N(a,{variant:`ghost`,size:`small`,role:`option`,get disabled(){return i(e)},onclick:e=>{e.stopPropagation(),v(_,!1),j(!0)},class:`block rounded-none border-b border-rc-gray-110 py-2 pr-3 text-left backdrop-blur-2xl hover:bg-rc-gray-700 focus:bg-rc-gray-400`,children:(e,t)=>{l();var n=A(`Copy traces with prompts`);r(e,n)},$$slots:{default:!0}})}var o=T(a,2);{let e=b(()=>!I.length);N(o,{variant:`ghost`,size:`small`,role:`option`,get disabled(){return i(e)},onclick:e=>{e.stopPropagation(),v(_,!1),j(!1)},class:`block rounded-none py-2 pr-3 text-left backdrop-blur-2xl hover:bg-rc-gray-700 focus:bg-rc-gray-400`,children:(e,t)=>{l();var n=A(`Copy traces without prompts`);r(e,n)},$$slots:{default:!0}})}f(t),r(e,t)},$$slots:{default:!0}});var G=T(W,2);N(G,{size:`small`,onclick:P,children:(e,t)=>{l();var n=A(`New chat`);r(e,n)},$$slots:{default:!0}}),f(ge),f(U);var ye=T(U,2),K=x(ye),q=e=>{var t=Re();r(e,t)},J=e=>{var t=ze();r(e,t)},Y=e=>{var t=Be(),n=x(t);{let e=b(()=>i(u)?.sourceTrace??null),t=b(()=>i(u)?.choices??[]),r=b(()=>i(u)?.loading??!1),o=b(()=>i(u)?.applyingId??null),l=b(()=>i(u)?.error??null);Z(n,{class:`h-full min-w-0`,context:null,get agentId(){return a.agentId},get promptEditProposalId(){return i(p)},get agentType(){return a.agentType},onmessage:e=>s.sendChatMessage(e),get analyzeDisabled(){return i(c)},onAnalyzeTrace:ee,onRegenerateTrace:ie,onSeeVariants:ue,onHangup:fe,get variantSourceTrace(){return i(e)},get variantChoices(){return i(t)},get variantLoading(){return i(r)},get variantApplyingId(){return i(o)},get variantError(){return i(l)},onCancelVariants:L,onRegenerateVariants:pe,onChooseOriginalVariant:B,onChooseVariant:z})}f(t),r(e,t)};S(K,e=>{!a.wsLoaded||!a.chatReady?e(q):a.agentId?e(Y,-1):e(J,1)}),f(ye),f(V),r(e,V),t()}export{He as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/CUZn05nQ.js","../chunks/hePW80VL.js","../chunks/HclGiUj8.js","../chunks/C_yvzB4Z.js","../assets/editor.chSTM-fo.css","../assets/editor.BoJhDcRF.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{A as e,B as t,D as n,Dt as r,F as i,G as a,I as o,L as s,N as c,Nt as l,O as u,Ot as d,Pt as f,R as p,S as m,V as h,_ as g,a as _,at as v,b as ee,d as y,dt as b,et as x,f as S,g as C,gt as w,it as T,j as E,k as D,l as O,m as k,mt as A,n as j,o as M,ot as N,p as te,pt as P,q as F,r as I,st as L,tt as R,u as ne,w as re,x as z,z as B}from"../chunks/CPCsWwEy.js";import{t as V}from"../chunks/HclGiUj8.js";import"../chunks/xihTtKlq.js";import{t as H}from"../chunks/BOZLjogl.js";import{r as U,t as ie}from"../chunks/oarl--hZ.js";import{t as W}from"../chunks/6OCsQ6r7.js";import{t as ae}from"../chunks/Cf3l6QEG.js";import{n as oe,t as se}from"../chunks/BJqZY8o2.js";import{t as ce}from"../chunks/BP0Xadq7.js";import{i as le,t as ue}from"../chunks/BT98u4gR.js";import{t as G}from"../chunks/DWoqp3ac.js";import{a as de,c as fe,o as pe,r as K,s as me,t as he}from"../chunks/12bfCwgn.js";import{t as ge}from"../chunks/B9YnyJ2j.js";import{t as _e}from"../chunks/D3fLfD-Y.js";import{t as ve}from"../chunks/CL717zGu.js";var ye=/^[a-z0-9]+(-[a-z0-9]+)*$/,be=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!xe(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!xe(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!xe(e,n)?null:e}return null},xe=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function Se(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}var Ce=Object.freeze({left:0,top:0,width:16,height:16}),we=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Te=Object.freeze({...Ce,...we}),Ee=Object.freeze({...Te,body:``,hidden:!1});function De(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Oe(e,t){let n=De(e,t);for(let r in Ee)r in we?r in e&&!(r in n)&&(n[r]=we[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ke(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=Oe(r[e]||i[e],a)}return o(t),n.forEach(o),Oe(e,a)}function q(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=Se(e);for(let i in r){let a=r[i];a&&(t(i,ke(e,i,a)),n.push(i))}return n}var Ae={provider:``,aliases:{},not_found:{},...Ce};function je(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Me(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!je(e,Ae))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!je(t,Ee))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!je(t,Ee))return null}return t}var Ne=Object.create(null);function Pe(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Fe(e,t){let n=Ne[e]||(Ne[e]=Object.create(null));return n[t]||(n[t]=Pe(e,t))}function J(e,t){return Me(t)?q(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function Ie(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var Le=!1;function Re(e){return typeof e==`boolean`&&(Le=e),Le}function ze(e){let t=typeof e==`string`?be(e,!0,Le):e;if(t){let e=Fe(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function Be(e,t){let n=be(e,!0,Le);if(!n)return!1;let r=Fe(n.provider,n.prefix);return t?Ie(r,n.name,t):(r.missing.add(n.name),!0)}function Ve(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),Le&&!t&&!e.prefix){let t=!1;return Me(e)&&(e.prefix=``,q(e,(e,n)=>{Be(e,n)&&(t=!0)})),t}let n=e.prefix;return xe({prefix:n,name:`a`})?!!J(Fe(t,n),e):!1}var He=Object.freeze({width:null,height:null}),Ue=Object.freeze({...He,...we}),Y=/(-?[0-9.]*[0-9]+[0-9.]*)/g,We=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function X(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(Y);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=We.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function Ge(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function Ke(e,t){return e?`<defs>`+e+`</defs>`+t:t}function qe(e,t,n){let r=Ge(e);return Ke(r.defs,t+r.content+n)}var Z=e=>e===`unset`||e===`undefined`||e===`none`;function Je(e,t){let n={...Te,...e},r={...Ue,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`)}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=qe(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=X(d,c/l)):(u=o===`auto`?c:o,d=s===null?X(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{Z(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var Ye=/\sid="(\S+)"/g,Xe=new Map;function Ze(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=Xe.get(e)||0;return Xe.set(e,t+1),t?`${e}${t}`:e}function Qe(e){let t=[],n;for(;n=Ye.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=Ze(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}var $e=Object.create(null);function et(e,t){$e[e]=t}function tt(e){return $e[e]||$e[``]}function nt(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var rt=Object.create(null),it=[`https://api.simplesvg.com`,`https://api.unisvg.com`],at=[];it.length>0;)it.length===1||Math.random()>.5?at.push(it.shift()):at.push(it.pop());rt[``]=nt({resources:[`https://api.iconify.design`].concat(at)});function Q(e,t){let n=nt(t);return n!==null&&(rt[e]=n,!0)}function $(e){return rt[e]}var ot=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function st(e,t){let n=$(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function ct(e){return e===404}var lt=(e,t,n)=>{let r=[],i=st(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function ut(e){if(typeof e==`string`){let t=$(e);if(t)return t.path}return`/`}var dt={prepare:lt,send:(e,t,n)=>{if(!ot){n(`abort`,424);return}let r=ut(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;ot(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(ct(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function ft(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function pt(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||ft([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var mt=0;function ht(e,t,n){let r=mt++,i=ft.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function gt(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=Fe(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function _t(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?be(e,t,n):e;i&&r.push(i)}),r}var vt={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function yt(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function ee(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function y(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?b():v());return}if(m(),ee(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function b(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(ee(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{y(i,e,t)}};f.push(i),l++,d=setTimeout(b,e.rotate),n(r,t,i.callback)}return setTimeout(b),_}function bt(e){let t={...vt,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=yt(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function xt(){}var St=Object.create(null);function Ct(e){if(!St[e]){let t=$(e);if(!t)return;St[e]={config:t,redundancy:bt(t)}}return St[e]}function wt(e,t,n){let r,i;if(typeof e==`string`){let t=tt(e);if(!t)return n(void 0,424),xt;i=t.send;let a=Ct(e);a&&(r=a.redundancy)}else{let t=nt(e);if(t){r=bt(t);let n=tt(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),xt):r.query(t,i,n)().abort}function Tt(){}function Et(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,pt(e)}))}function Dt(e){let t=[],n=[];return e.forEach(e=>{(e.match(ye)?t:n).push(e)}),{valid:t,invalid:n}}function Ot(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!J(e,n).length){r();return}}catch(e){console.error(e)}r(),Et(e)}function kt(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function At(e,t){e.iconsToLoad=e.iconsToLoad?e.iconsToLoad.concat(t).sort():t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){kt(e.loadIcons(r,n,t),t=>{Ot(e,r,t)});return}if(i){r.forEach(r=>{kt(i(r,n,t),t=>{Ot(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=Dt(r);if(o.length&&Ot(e,o,null),!a.length)return;let s=n.match(ye)?tt(t):null;if(!s){Ot(e,a,null);return}s.prepare(t,n,a).forEach(n=>{wt(t,n,t=>{Ot(e,n.icons,t)})})}))}var jt=(e,t)=>{let n=gt(_t(e,!0,Re()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,Tt)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(Fe(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=Fe(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&At(e,t)}),t?ht(t,n,i):Tt};function Mt(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in He?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var Nt=/[\s,]+/;function Pt(e,t){t.split(Nt).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0}})}function Ft(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function It(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function Lt(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Rt(e){return`data:image/svg+xml,`+Lt(e)}function zt(e){return`url("`+Rt(e)+`")`}var Bt={...Ue,inline:!1},Vt={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},Ht={display:`inline-block`},Ut={"background-color":`currentColor`},Wt={"background-color":`transparent`},Gt={image:`var(--svg)`,repeat:`no-repeat`,size:`100% 100%`},Kt={"-webkit-mask":Ut,mask:Ut,background:Wt};for(let e in Kt){let t=Kt[e];for(let n in Gt)t[e+`-`+n]=Gt[n]}function qt(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}function Jt(e,t){let n=Mt(Bt,t),r=t.mode||`svg`,i=r===`svg`?{...Vt}:{};e.body.indexOf(`xlink:`)===-1&&delete i[`xmlns:xlink`];let a=typeof t.style==`string`?t.style:``;for(let e in t){let r=t[e];if(r!==void 0)switch(e){case`icon`:case`style`:case`onLoad`:case`mode`:case`ssr`:break;case`inline`:case`hFlip`:case`vFlip`:n[e]=r===!0||r===`true`||r===1;break;case`flip`:typeof r==`string`&&Pt(n,r);break;case`color`:a=a+(a.length>0&&a.trim().slice(-1)!==`;`?`;`:``)+`color: `+r+`; `;break;case`rotate`:typeof r==`string`?n[e]=Ft(r):typeof r==`number`&&(n[e]=r);break;case`ariaHidden`:case`aria-hidden`:r!==!0&&r!==`true`&&delete i[`aria-hidden`];break;default:if(e.slice(0,3)===`on:`)break;Bt[e]===void 0&&(i[e]=r)}}let o=Je(e,n),s=o.attributes;if(n.inline&&(a=`vertical-align: -0.125em; `+a),r===`svg`)return Object.assign(i,s),a!==``&&(i.style=a),{svg:!0,attributes:i,body:Qe(o.body)};let{body:c,width:l,height:u}=e,d=r===`mask`||r!==`bg`&&c.indexOf(`currentColor`)!==-1,f={"--svg":zt(It(c,{...s,width:l+``,height:u+``}))},p=e=>{let t=s[e];t&&(f[e]=qt(t))};p(`width`),p(`height`),Object.assign(f,Ht,d?Ut:Wt);let m=``;for(let e in f)m+=e+`: `+f[e]+`;`;return i.style=m+a,{svg:!1,attributes:i}}if(Re(!0),et(``,dt),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!Ve(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;Q(e,r)||console.error(n)}catch{console.error(n)}}}}function Yt(){try{return typeof window!=`object`}catch{return!0}}function Xt(e,t,n,r){function i(){t.loading&&=(t.loading.abort(),null)}if(typeof e==`object`&&e&&typeof e.body==`string`)return t.name=``,i(),{data:{...Te,...e}};let a;if(typeof e!=`string`||(a=be(e,!1,!0))===null)return i(),null;let o=ze(a);if(!o)return!Yt()&&(!t.loading||t.loading.name!==e)&&(i(),t.name=``,t.loading={name:e,abort:jt([a],n)}),null;i(),t.name!==e&&(t.name=e,r&&!t.destroyed&&setTimeout(()=>{r(e)}));let s=[`iconify`];return a.prefix!==``&&s.push(`iconify--`+a.prefix),a.provider!==``&&s.push(`iconify--`+a.provider),{data:o,classes:s}}function Zt(e,t){return e?Jt({...Te,...e},t):null}var Qt=new Set([`$$slots`,`$$events`,`$$legacy`]),$t=p(`<svg></svg>`),en=s(`<span></span>`);function tn(e,t){d(t,!0);let s={name:``,loading:null,destroyed:!1},c=M(t,Qt),l=P(0),u=w(()=>(a(l),Xt(t.icon,s,m,t.onload))),p=w(()=>{let e=a(u)?Zt(a(u).data,c):null;return e&&a(u).classes&&c.class===void 0&&(e.attributes.class=(typeof c.class==`string`?c.class+` `:``)+a(u).classes.join(` `)),e});function m(){A(l)}j(()=>{s.destroyed=!0,s.loading&&=(s.loading.abort(),null)});var h=o(),g=v(h),_=e=>{var t=o(),r=v(t),s=e=>{var t=$t();S(t,()=>({...a(p).attributes})),n(t,()=>a(p).body,!0),f(t),i(e,t)},c=e=>{var t=en();S(t,()=>({...a(p).attributes})),i(e,t)};E(r,e=>{a(p).svg?e(s):e(c,-1)}),i(e,t)};E(g,e=>{a(p)&&e(_)}),i(e,h),r()}var nn=s(`<div class="w-full"></div>`);function rn(e,t){d(t,!0);let n=P(null),o=null,s=[],c=null,l=!1,u,f=_(t,`language`,3,`plaintext`),p=_(t,`height`,3,120),m=_(t,`readOnly`,3,!1),h=null,g=P(!1),v=P(!1);function y(e){a(v)||e.stopPropagation()}I(async()=>{if(!u)return;u.addEventListener(`wheel`,y,{capture:!0,passive:!0}),me();let e=await V(()=>import(`../chunks/CUZn05nQ.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);if(l)return;c=e,pe(e);let r=f()===`json`?`json`:f()===`markdown`?`markdown`:`plaintext`;b(n,e.editor.create(u,{...de(`test-history`),value:t.value??``,language:r,readOnly:m(),domReadOnly:m()}),!0);let i=a(n);if(!i)return;o=i.getModel(),h=K(e,i),h.update(t.highlights??[]),b(g,!0),s.push(i.onDidFocusEditorText(()=>{b(v,!0)})),s.push(i.onDidChangeModelContent(()=>{try{let e=i.getValue();if(e===t.value)return;t.onChange?.(e)}catch(e){console.error(`MiniEditor change error`,e)}})),s.push(i.onDidBlurEditorText(()=>{b(v,!1);try{t.onBlur?.(i.getValue())}catch{}}));let d=i.onDidFocusEditorWidget?.(()=>{b(v,!0)});d&&s.push(d);let p=i.onDidBlurEditorWidget?.(()=>{b(v,!1);try{t.onBlur?.(i.getValue())}catch{}});p&&s.push(p)}),j(()=>{l=!0,b(g,!1);try{u.removeEventListener(`wheel`,y,{capture:!0})}catch{}for(let e of s)try{e.dispose()}catch{}s=[],h?.dispose(),h=null;let e=o;o=null;try{if(a(n)){try{a(n).setModel(null)}catch{}a(n).dispose()}}finally{b(n,null)}try{e?.dispose()}catch{}c=null}),R(()=>{if(!a(n))return;let e=f()===`json`?`json`:f()===`markdown`?`markdown`:`plaintext`,t=a(n).getModel();if(!t||t.getLanguageId()===e)return;let r=!1;return(c?Promise.resolve(c):V(()=>import(`../chunks/CUZn05nQ.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).then(n=>{if(!r)try{n.editor.setModelLanguage(t,e)}catch{}}),()=>{r=!0}}),R(()=>{let e=t.value??``,r=t.highlights??[];!a(n)||!a(g)||(e!==a(n).getValue()&&a(n).setValue(e),h?.update(r))}),R(()=>{a(n)?.updateOptions({readOnly:m(),domReadOnly:m()})});var S=nn();O(S,e=>u=e,()=>u),x(()=>ee(S,`height:${p()}px`)),i(e,S),r()}var an=s(`<button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-rc-gray-400">Fix</button>`),on=s(`<button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-rc-gray-400">Analyze</button>`),sn=s(`<div><div class="mb-1 text-xs text-rc-gray-300"> </div> <div class="whitespace-pre-wrap break-words text-rc-gray-100"> </div></div>`),cn=s(`<div class="flex flex-col gap-3"></div>`),ln=s(`<div class="p-2 text-rc-gray-300">Loading…</div>`),un=s(`<div class="p-2 text-red-400"> </div>`),dn=s(`<div class="flex h-full flex-col gap-2"><div class="grid grid-cols-2 gap-2"><div class="flex items-center justify-start"><!></div> <div class="flex items-center justify-end"><!></div></div> <!></div>`),fn=s(`<div class="h-[55vh]"><!></div>`),pn=s(`<!> <!> <!>`,1),mn=s(`<!> <div class="mt-2 h-[55vh]"><!></div>`,1),hn=s(`<div class="mt-1 flex flex-wrap items-center gap-x-2 gap-y-1"><!> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-rc-gray-400"> </button> <!> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">See variants</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Prompt</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Conversation</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Context</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Debug</button></div> <!> <!> <!>`,1);function gn(e,t){d(t,!0);let n=_(t,`actionsDisabled`,3,!1),o=_(t,`actionsInert`,3,!1),s=_(t,`addTestDisabled`,3,!1),p=_(t,`showAnalyze`,3,!0),m=_(t,`analyzeDisabled`,3,!1),g=_(t,`fixDisabled`,3,!1),ee=P(!1),y=P(!1),S=P(!1),C=P(`errors`),D=P(`prompt`),O=P(null),k=P(null),A=P(null),M=P(null),te=P(null),F=P(null),I=P(null),R=P(L({prompt:!1,conversation:!1,context:!1,errors:!1,traces:!1,logs:!1})),ne=P(L({prompt:null,conversation:null,context:null,errors:null,traces:null,logs:null})),re=0,V=P(null),H=null,U=P(`idle`),ie=null;function ae(e){try{return{raw:e,formatted:JSON.stringify(JSON.parse(e),null,2)}}catch{return{raw:e,formatted:e}}}async function le(e){return ae(await G.tests.resultEntry.query({agent:e.agent,testId:e.id,resultKey:e.key,timestamp:e.timestamp,index:e.run}))}function ue(e){return e===`prompt`?a(k)!==null&&a(O)!==null:e===`conversation`?a(A)!==null:e===`context`?a(M)!==null:e===`errors`?a(te)!==null:e===`traces`?a(F)!==null:a(I)!==null}async function de(e){if(ue(e)||a(R)[e])return;let n=re;b(R,{...a(R),[e]:!0},!0),b(ne,{...a(ne),[e]:null},!0);try{if(e===`prompt`){let[e,r]=await Promise.all([le(t.links.renderedPrompt),le(t.links.receivedPrompt)]);if(n!==re)return;b(O,e,!0),b(k,r,!0)}else{let r=await le(e===`conversation`?t.links.conversation:e===`context`?t.links.context:e===`errors`?t.links.errors:e===`traces`?t.links.traces:t.links.logs);if(n!==re)return;b(e===`conversation`?A:e===`context`?M:e===`errors`?te:e===`traces`?F:I,r,!0)}}catch(t){if(n!==re)return;console.error(t),b(ne,{...a(ne),[e]:`Failed to load content`},!0)}finally{n===re&&b(R,{...a(R),[e]:!1},!0)}}function fe(){b(O,null),b(k,null),b(A,null),b(M,null),b(te,null),b(F,null),b(I,null),b(R,{prompt:!1,conversation:!1,context:!1,errors:!1,traces:!1,logs:!1},!0),b(ne,{prompt:null,conversation:null,context:null,errors:null,traces:null,logs:null},!0)}function pe(){re+=1,b(C,`errors`),fe(),b(ee,!0),de(`errors`)}function K(e){re+=1,b(D,e,!0),fe(),b(y,!0),de(e)}function me(e){return e===`prompt`?`Prompt`:e===`conversation`?`Conversation`:`Context`}function ge(e){b(C,e,!0),de(e)}async function _e(){if(a(U)!==`adding`){b(U,`adding`);try{await t.onAddTest(),b(U,`added`)}catch(e){console.error(`Failed to add test`,e),b(U,`failed`)}ie&&clearTimeout(ie),ie=window.setTimeout(()=>{b(U,`idle`),ie=null},2500)}}async function ye(e){if(!(!a(k)||!a(O)))try{let t=e===`raw`?a(k).raw:a(O).raw;await navigator.clipboard.writeText(t),b(V,e,!0),H&&clearTimeout(H),H=window.setTimeout(()=>{b(V,null),H=null},2e3)}catch(e){console.error(`Failed to copy prompt`,e)}}j(()=>{re+=1,H&&clearTimeout(H),ie&&clearTimeout(ie)});var be=hn(),xe=v(be),Se=T(xe),Ce=e=>{var r=an();x(()=>{r.inert=o(),r.disabled=n()||g()}),h(`click`,r,function(...e){t.onFix?.apply(this,e)}),i(e,r)};E(Se,e=>{t.onFix&&e(Ce)});var we=N(Se,2),Te=T(we,!0);f(we);var Ee=N(we,2),De=e=>{var n=on();x(()=>n.disabled=m()),h(`click`,n,function(...e){t.onAnalyze?.apply(this,e)}),i(e,n)};E(Ee,e=>{p()&&e(De)});var Oe=N(Ee,2),ke=N(Oe,2),q=N(ke,2),Ae=N(q,2),je=N(Ae,2);f(xe);var Me=N(xe,2),Ne=e=>{{let n=e=>{var n=cn();u(n,21,()=>t.variants,e=>e.index,(e,n)=>{var r=sn(),o=T(r),s=T(o);f(o);var l=N(o,2),u=T(l,!0);f(l),f(r),x(()=>{z(r,1,`rounded-lg border p-3 ${a(n).index===t.runIndex?`border-rc-green-450`:`border-rc-gray-650`} ${a(n).success?`bg-rc-green-700/80`:`bg-rc-gray-900/60`}`),c(s,`Run ${a(n).index??``}${a(n).index===t.runIndex?` • selected`:``}`),c(u,a(n).text||a(n).errors||`—`)}),i(e,r)}),f(n),i(e,n)},r=w(()=>`Variants — ${t.scenario||`Test`}`);ce(e,{get title(){return a(r)},class:`!w-[80vw] !max-w-4xl`,get open(){return a(S)},set open(e){b(S,e,!0)},children:n,$$slots:{default:!0}})}};E(Me,e=>{a(S)&&e(Ne)});var Pe=N(Me,2),Fe=e=>{{let n=e=>{var t=fn(),n=T(t),r=e=>{var t=ln();i(e,t)},o=e=>{var t=un(),n=T(t,!0);f(t),x(()=>c(n,a(ne)[a(D)])),i(e,t)},s=e=>{var t=dn(),n=T(t),r=T(n),o=T(r);{let e=w(()=>!a(k).raw.trim());W(o,{variant:`secondary`,size:`small`,get disabled(){return a(e)},onclick:()=>ye(`raw`),children:(e,t)=>{l();var n=B();x(()=>c(n,a(V)===`raw`?`Copied raw prompt`:`Copy raw prompt`)),i(e,n)},$$slots:{default:!0}})}f(r);var s=N(r,2),u=T(s);{let e=w(()=>!a(O).raw.trim());W(u,{variant:`secondary`,size:`small`,get disabled(){return a(e)},onclick:()=>ye(`rendered`),children:(e,t)=>{l();var n=B();x(()=>c(n,a(V)===`rendered`?`Copied rendered prompt`:`Copy rendered prompt`)),i(e,n)},$$slots:{default:!0}})}f(s),f(n);var d=N(n,2);he(d,{variant:`generic`,get original(){return a(k).formatted},get modified(){return a(O).formatted},language:`markdown`,class:`min-h-0 flex-1`}),f(t),i(e,t)},u=e=>{{let t=w(()=>a(A).formatted||`—`);ve(e,{get value(){return a(t)},language:`text`,class:`h-full`})}},d=e=>{{let t=w(()=>a(M).formatted||`—`);ve(e,{get value(){return a(t)},language:`json`,class:`h-full`})}};E(n,e=>{a(R)[a(D)]?e(r):a(ne)[a(D)]?e(o,1):a(D)===`prompt`&&a(k)&&a(O)?e(s,2):a(D)===`conversation`&&a(A)?e(u,3):a(D)===`context`&&a(M)&&e(d,4)}),f(t),i(e,t)},r=w(()=>`${me(a(D))} — ${t.scenario||`Test`} (run ${t.runIndex})`);ce(e,{get title(){return a(r)},class:`!w-[85vw] !max-w-5xl`,get open(){return a(y)},set open(e){b(y,e,!0)},children:n,$$slots:{default:!0}})}};E(Pe,e=>{a(y)&&e(Fe)});var J=N(Pe,2),Ie=e=>{{let n=e=>{var t=mn(),n=v(t);oe(n,{get value(){return a(C)},ariaLabel:`Test run debug tabs`,onChange:({value:e})=>ge(e),children:(e,t)=>{var n=pn(),r=v(n);se(r,{value:`errors`,class:`px-3`,children:(e,t)=>{l();var n=B(`Errors`);i(e,n)},$$slots:{default:!0}});var a=N(r,2);se(a,{value:`traces`,class:`px-3`,children:(e,t)=>{l();var n=B(`Traces`);i(e,n)},$$slots:{default:!0}});var o=N(a,2);se(o,{value:`logs`,class:`px-3`,children:(e,t)=>{l();var n=B(`Logs`);i(e,n)},$$slots:{default:!0}}),i(e,n)},$$slots:{default:!0}});var r=N(n,2),o=T(r),s=e=>{var t=ln();i(e,t)},u=e=>{var t=un(),n=T(t,!0);f(t),x(()=>c(n,a(ne)[a(C)])),i(e,t)},d=e=>{{let t=w(()=>a(te).formatted||`—`);ve(e,{get value(){return a(t)},language:`text`,class:`h-full`})}},p=e=>{{let t=w(()=>a(F).formatted||`—`);ve(e,{get value(){return a(t)},language:`json`,class:`h-full`})}},m=e=>{{let t=w(()=>a(I).formatted||`—`);ve(e,{get value(){return a(t)},language:`text`,class:`h-full`})}};E(o,e=>{a(R)[a(C)]?e(s):a(ne)[a(C)]?e(u,1):a(C)===`errors`&&a(te)?e(d,2):a(C)===`traces`&&a(F)?e(p,3):a(C)===`logs`&&a(I)&&e(m,4)}),f(r),i(e,t)},r=w(()=>`Debug — ${t.scenario||`Test`} (run ${t.runIndex})`);ce(e,{get title(){return a(r)},class:`!w-[85vw] !max-w-5xl`,get open(){return a(ee)},set open(e){b(ee,e,!0)},children:n,$$slots:{default:!0}})}};E(J,e=>{a(ee)&&e(Ie)}),x(()=>{we.inert=o(),we.disabled=n()||s()||a(U)===`adding`,c(Te,a(U)===`adding`?`Adding…`:a(U)===`added`?`Added`:a(U)===`failed`?`Failed`:`Add test`)}),h(`click`,we,_e),h(`click`,Oe,()=>b(S,!0)),h(`click`,ke,()=>K(`prompt`)),h(`click`,q,()=>K(`conversation`)),h(`click`,Ae,()=>K(`context`)),h(`click`,je,pe),i(e,be),r()}t([`click`]);var _n=`Update the conversation history so it reflects behaviour that is valid under the current prompt. Preserve the test's intent and expected outcome, and make only the smallest necessary changes. Possible roles: "Agent", "User", "System"`;function vn(e,t){return[e.trim()===`LLM`?``:e.trim(),t.trim()].filter(Boolean).join(` `)}function yn(e){let t=vn(e.assertionLabel,e.assertionValue);return`You will be given the context, the conversation and the desired output and assertion about it. First, find why the prompt is not producing the correct result. It's usually one concrete instruction within the relevant section, or a contradiction. Then, change the prompt minimally so this will work, but keeping the prompt clean and comprehensive is more important. Try to provide as general solution as possible. Try to change just one part of the prompt, not multiple parts. Avoid adding exceptions and overrides. Avoid duplicating information that already exists in the prompt.
|
|
2
|
+
import{A as e,B as t,D as n,Dt as r,F as i,G as a,I as o,L as s,N as c,Nt as l,O as u,Ot as d,Pt as f,R as p,S as m,V as h,_ as g,a as _,at as v,b as ee,d as y,dt as b,et as x,f as S,g as C,gt as w,it as T,j as E,k as D,l as O,m as k,mt as A,n as j,o as M,ot as N,p as te,pt as P,q as F,r as I,st as L,tt as R,u as ne,w as re,x as z,z as B}from"../chunks/CPCsWwEy.js";import{t as V}from"../chunks/HclGiUj8.js";import"../chunks/xihTtKlq.js";import{t as H}from"../chunks/BFUe72xu.js";import{r as U,t as ie}from"../chunks/oarl--hZ.js";import{t as W}from"../chunks/6OCsQ6r7.js";import{t as ae}from"../chunks/Cf3l6QEG.js";import{n as oe,t as se}from"../chunks/BJqZY8o2.js";import{t as ce}from"../chunks/BP0Xadq7.js";import{i as le,t as ue}from"../chunks/BT98u4gR.js";import{t as G}from"../chunks/DWoqp3ac.js";import{a as de,c as fe,o as pe,r as K,s as me,t as he}from"../chunks/12bfCwgn.js";import{t as ge}from"../chunks/B9YnyJ2j.js";import{t as _e}from"../chunks/D3fLfD-Y.js";import{t as ve}from"../chunks/CL717zGu.js";var ye=/^[a-z0-9]+(-[a-z0-9]+)*$/,be=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!xe(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!xe(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!xe(e,n)?null:e}return null},xe=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function Se(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}var Ce=Object.freeze({left:0,top:0,width:16,height:16}),we=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Te=Object.freeze({...Ce,...we}),Ee=Object.freeze({...Te,body:``,hidden:!1});function De(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Oe(e,t){let n=De(e,t);for(let r in Ee)r in we?r in e&&!(r in n)&&(n[r]=we[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ke(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=Oe(r[e]||i[e],a)}return o(t),n.forEach(o),Oe(e,a)}function q(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=Se(e);for(let i in r){let a=r[i];a&&(t(i,ke(e,i,a)),n.push(i))}return n}var Ae={provider:``,aliases:{},not_found:{},...Ce};function je(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Me(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!je(e,Ae))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!je(t,Ee))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!je(t,Ee))return null}return t}var Ne=Object.create(null);function Pe(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Fe(e,t){let n=Ne[e]||(Ne[e]=Object.create(null));return n[t]||(n[t]=Pe(e,t))}function J(e,t){return Me(t)?q(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function Ie(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var Le=!1;function Re(e){return typeof e==`boolean`&&(Le=e),Le}function ze(e){let t=typeof e==`string`?be(e,!0,Le):e;if(t){let e=Fe(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function Be(e,t){let n=be(e,!0,Le);if(!n)return!1;let r=Fe(n.provider,n.prefix);return t?Ie(r,n.name,t):(r.missing.add(n.name),!0)}function Ve(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),Le&&!t&&!e.prefix){let t=!1;return Me(e)&&(e.prefix=``,q(e,(e,n)=>{Be(e,n)&&(t=!0)})),t}let n=e.prefix;return xe({prefix:n,name:`a`})?!!J(Fe(t,n),e):!1}var He=Object.freeze({width:null,height:null}),Ue=Object.freeze({...He,...we}),Y=/(-?[0-9.]*[0-9]+[0-9.]*)/g,We=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function X(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(Y);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=We.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function Ge(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function Ke(e,t){return e?`<defs>`+e+`</defs>`+t:t}function qe(e,t,n){let r=Ge(e);return Ke(r.defs,t+r.content+n)}var Z=e=>e===`unset`||e===`undefined`||e===`none`;function Je(e,t){let n={...Te,...e},r={...Ue,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`)}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=qe(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=X(d,c/l)):(u=o===`auto`?c:o,d=s===null?X(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{Z(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var Ye=/\sid="(\S+)"/g,Xe=new Map;function Ze(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=Xe.get(e)||0;return Xe.set(e,t+1),t?`${e}${t}`:e}function Qe(e){let t=[],n;for(;n=Ye.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=Ze(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}var $e=Object.create(null);function et(e,t){$e[e]=t}function tt(e){return $e[e]||$e[``]}function nt(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var rt=Object.create(null),it=[`https://api.simplesvg.com`,`https://api.unisvg.com`],at=[];it.length>0;)it.length===1||Math.random()>.5?at.push(it.shift()):at.push(it.pop());rt[``]=nt({resources:[`https://api.iconify.design`].concat(at)});function Q(e,t){let n=nt(t);return n!==null&&(rt[e]=n,!0)}function $(e){return rt[e]}var ot=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function st(e,t){let n=$(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function ct(e){return e===404}var lt=(e,t,n)=>{let r=[],i=st(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function ut(e){if(typeof e==`string`){let t=$(e);if(t)return t.path}return`/`}var dt={prepare:lt,send:(e,t,n)=>{if(!ot){n(`abort`,424);return}let r=ut(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;ot(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(ct(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function ft(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function pt(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||ft([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var mt=0;function ht(e,t,n){let r=mt++,i=ft.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function gt(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=Fe(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function _t(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?be(e,t,n):e;i&&r.push(i)}),r}var vt={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function yt(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function ee(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function y(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?b():v());return}if(m(),ee(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function b(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(ee(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{y(i,e,t)}};f.push(i),l++,d=setTimeout(b,e.rotate),n(r,t,i.callback)}return setTimeout(b),_}function bt(e){let t={...vt,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=yt(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function xt(){}var St=Object.create(null);function Ct(e){if(!St[e]){let t=$(e);if(!t)return;St[e]={config:t,redundancy:bt(t)}}return St[e]}function wt(e,t,n){let r,i;if(typeof e==`string`){let t=tt(e);if(!t)return n(void 0,424),xt;i=t.send;let a=Ct(e);a&&(r=a.redundancy)}else{let t=nt(e);if(t){r=bt(t);let n=tt(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),xt):r.query(t,i,n)().abort}function Tt(){}function Et(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,pt(e)}))}function Dt(e){let t=[],n=[];return e.forEach(e=>{(e.match(ye)?t:n).push(e)}),{valid:t,invalid:n}}function Ot(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!J(e,n).length){r();return}}catch(e){console.error(e)}r(),Et(e)}function kt(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function At(e,t){e.iconsToLoad=e.iconsToLoad?e.iconsToLoad.concat(t).sort():t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){kt(e.loadIcons(r,n,t),t=>{Ot(e,r,t)});return}if(i){r.forEach(r=>{kt(i(r,n,t),t=>{Ot(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=Dt(r);if(o.length&&Ot(e,o,null),!a.length)return;let s=n.match(ye)?tt(t):null;if(!s){Ot(e,a,null);return}s.prepare(t,n,a).forEach(n=>{wt(t,n,t=>{Ot(e,n.icons,t)})})}))}var jt=(e,t)=>{let n=gt(_t(e,!0,Re()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,Tt)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(Fe(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=Fe(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&At(e,t)}),t?ht(t,n,i):Tt};function Mt(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in He?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var Nt=/[\s,]+/;function Pt(e,t){t.split(Nt).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0}})}function Ft(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function It(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function Lt(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function Rt(e){return`data:image/svg+xml,`+Lt(e)}function zt(e){return`url("`+Rt(e)+`")`}var Bt={...Ue,inline:!1},Vt={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},Ht={display:`inline-block`},Ut={"background-color":`currentColor`},Wt={"background-color":`transparent`},Gt={image:`var(--svg)`,repeat:`no-repeat`,size:`100% 100%`},Kt={"-webkit-mask":Ut,mask:Ut,background:Wt};for(let e in Kt){let t=Kt[e];for(let n in Gt)t[e+`-`+n]=Gt[n]}function qt(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}function Jt(e,t){let n=Mt(Bt,t),r=t.mode||`svg`,i=r===`svg`?{...Vt}:{};e.body.indexOf(`xlink:`)===-1&&delete i[`xmlns:xlink`];let a=typeof t.style==`string`?t.style:``;for(let e in t){let r=t[e];if(r!==void 0)switch(e){case`icon`:case`style`:case`onLoad`:case`mode`:case`ssr`:break;case`inline`:case`hFlip`:case`vFlip`:n[e]=r===!0||r===`true`||r===1;break;case`flip`:typeof r==`string`&&Pt(n,r);break;case`color`:a=a+(a.length>0&&a.trim().slice(-1)!==`;`?`;`:``)+`color: `+r+`; `;break;case`rotate`:typeof r==`string`?n[e]=Ft(r):typeof r==`number`&&(n[e]=r);break;case`ariaHidden`:case`aria-hidden`:r!==!0&&r!==`true`&&delete i[`aria-hidden`];break;default:if(e.slice(0,3)===`on:`)break;Bt[e]===void 0&&(i[e]=r)}}let o=Je(e,n),s=o.attributes;if(n.inline&&(a=`vertical-align: -0.125em; `+a),r===`svg`)return Object.assign(i,s),a!==``&&(i.style=a),{svg:!0,attributes:i,body:Qe(o.body)};let{body:c,width:l,height:u}=e,d=r===`mask`||r!==`bg`&&c.indexOf(`currentColor`)!==-1,f={"--svg":zt(It(c,{...s,width:l+``,height:u+``}))},p=e=>{let t=s[e];t&&(f[e]=qt(t))};p(`width`),p(`height`),Object.assign(f,Ht,d?Ut:Wt);let m=``;for(let e in f)m+=e+`: `+f[e]+`;`;return i.style=m+a,{svg:!1,attributes:i}}if(Re(!0),et(``,dt),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!Ve(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;Q(e,r)||console.error(n)}catch{console.error(n)}}}}function Yt(){try{return typeof window!=`object`}catch{return!0}}function Xt(e,t,n,r){function i(){t.loading&&=(t.loading.abort(),null)}if(typeof e==`object`&&e&&typeof e.body==`string`)return t.name=``,i(),{data:{...Te,...e}};let a;if(typeof e!=`string`||(a=be(e,!1,!0))===null)return i(),null;let o=ze(a);if(!o)return!Yt()&&(!t.loading||t.loading.name!==e)&&(i(),t.name=``,t.loading={name:e,abort:jt([a],n)}),null;i(),t.name!==e&&(t.name=e,r&&!t.destroyed&&setTimeout(()=>{r(e)}));let s=[`iconify`];return a.prefix!==``&&s.push(`iconify--`+a.prefix),a.provider!==``&&s.push(`iconify--`+a.provider),{data:o,classes:s}}function Zt(e,t){return e?Jt({...Te,...e},t):null}var Qt=new Set([`$$slots`,`$$events`,`$$legacy`]),$t=p(`<svg></svg>`),en=s(`<span></span>`);function tn(e,t){d(t,!0);let s={name:``,loading:null,destroyed:!1},c=M(t,Qt),l=P(0),u=w(()=>(a(l),Xt(t.icon,s,m,t.onload))),p=w(()=>{let e=a(u)?Zt(a(u).data,c):null;return e&&a(u).classes&&c.class===void 0&&(e.attributes.class=(typeof c.class==`string`?c.class+` `:``)+a(u).classes.join(` `)),e});function m(){A(l)}j(()=>{s.destroyed=!0,s.loading&&=(s.loading.abort(),null)});var h=o(),g=v(h),_=e=>{var t=o(),r=v(t),s=e=>{var t=$t();S(t,()=>({...a(p).attributes})),n(t,()=>a(p).body,!0),f(t),i(e,t)},c=e=>{var t=en();S(t,()=>({...a(p).attributes})),i(e,t)};E(r,e=>{a(p).svg?e(s):e(c,-1)}),i(e,t)};E(g,e=>{a(p)&&e(_)}),i(e,h),r()}var nn=s(`<div class="w-full"></div>`);function rn(e,t){d(t,!0);let n=P(null),o=null,s=[],c=null,l=!1,u,f=_(t,`language`,3,`plaintext`),p=_(t,`height`,3,120),m=_(t,`readOnly`,3,!1),h=null,g=P(!1),v=P(!1);function y(e){a(v)||e.stopPropagation()}I(async()=>{if(!u)return;u.addEventListener(`wheel`,y,{capture:!0,passive:!0}),me();let e=await V(()=>import(`../chunks/CUZn05nQ.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);if(l)return;c=e,pe(e);let r=f()===`json`?`json`:f()===`markdown`?`markdown`:`plaintext`;b(n,e.editor.create(u,{...de(`test-history`),value:t.value??``,language:r,readOnly:m(),domReadOnly:m()}),!0);let i=a(n);if(!i)return;o=i.getModel(),h=K(e,i),h.update(t.highlights??[]),b(g,!0),s.push(i.onDidFocusEditorText(()=>{b(v,!0)})),s.push(i.onDidChangeModelContent(()=>{try{let e=i.getValue();if(e===t.value)return;t.onChange?.(e)}catch(e){console.error(`MiniEditor change error`,e)}})),s.push(i.onDidBlurEditorText(()=>{b(v,!1);try{t.onBlur?.(i.getValue())}catch{}}));let d=i.onDidFocusEditorWidget?.(()=>{b(v,!0)});d&&s.push(d);let p=i.onDidBlurEditorWidget?.(()=>{b(v,!1);try{t.onBlur?.(i.getValue())}catch{}});p&&s.push(p)}),j(()=>{l=!0,b(g,!1);try{u.removeEventListener(`wheel`,y,{capture:!0})}catch{}for(let e of s)try{e.dispose()}catch{}s=[],h?.dispose(),h=null;let e=o;o=null;try{if(a(n)){try{a(n).setModel(null)}catch{}a(n).dispose()}}finally{b(n,null)}try{e?.dispose()}catch{}c=null}),R(()=>{if(!a(n))return;let e=f()===`json`?`json`:f()===`markdown`?`markdown`:`plaintext`,t=a(n).getModel();if(!t||t.getLanguageId()===e)return;let r=!1;return(c?Promise.resolve(c):V(()=>import(`../chunks/CUZn05nQ.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).then(n=>{if(!r)try{n.editor.setModelLanguage(t,e)}catch{}}),()=>{r=!0}}),R(()=>{let e=t.value??``,r=t.highlights??[];!a(n)||!a(g)||(e!==a(n).getValue()&&a(n).setValue(e),h?.update(r))}),R(()=>{a(n)?.updateOptions({readOnly:m(),domReadOnly:m()})});var S=nn();O(S,e=>u=e,()=>u),x(()=>ee(S,`height:${p()}px`)),i(e,S),r()}var an=s(`<button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-rc-gray-400">Fix</button>`),on=s(`<button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-rc-gray-400">Analyze</button>`),sn=s(`<div><div class="mb-1 text-xs text-rc-gray-300"> </div> <div class="whitespace-pre-wrap break-words text-rc-gray-100"> </div></div>`),cn=s(`<div class="flex flex-col gap-3"></div>`),ln=s(`<div class="p-2 text-rc-gray-300">Loading…</div>`),un=s(`<div class="p-2 text-red-400"> </div>`),dn=s(`<div class="flex h-full flex-col gap-2"><div class="grid grid-cols-2 gap-2"><div class="flex items-center justify-start"><!></div> <div class="flex items-center justify-end"><!></div></div> <!></div>`),fn=s(`<div class="h-[55vh]"><!></div>`),pn=s(`<!> <!> <!>`,1),mn=s(`<!> <div class="mt-2 h-[55vh]"><!></div>`,1),hn=s(`<div class="mt-1 flex flex-wrap items-center gap-x-2 gap-y-1"><!> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-rc-gray-400"> </button> <!> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">See variants</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Prompt</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Conversation</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Context</button> <button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Debug</button></div> <!> <!> <!>`,1);function gn(e,t){d(t,!0);let n=_(t,`actionsDisabled`,3,!1),o=_(t,`actionsInert`,3,!1),s=_(t,`addTestDisabled`,3,!1),p=_(t,`showAnalyze`,3,!0),m=_(t,`analyzeDisabled`,3,!1),g=_(t,`fixDisabled`,3,!1),ee=P(!1),y=P(!1),S=P(!1),C=P(`errors`),D=P(`prompt`),O=P(null),k=P(null),A=P(null),M=P(null),te=P(null),F=P(null),I=P(null),R=P(L({prompt:!1,conversation:!1,context:!1,errors:!1,traces:!1,logs:!1})),ne=P(L({prompt:null,conversation:null,context:null,errors:null,traces:null,logs:null})),re=0,V=P(null),H=null,U=P(`idle`),ie=null;function ae(e){try{return{raw:e,formatted:JSON.stringify(JSON.parse(e),null,2)}}catch{return{raw:e,formatted:e}}}async function le(e){return ae(await G.tests.resultEntry.query({agent:e.agent,testId:e.id,resultKey:e.key,timestamp:e.timestamp,index:e.run}))}function ue(e){return e===`prompt`?a(k)!==null&&a(O)!==null:e===`conversation`?a(A)!==null:e===`context`?a(M)!==null:e===`errors`?a(te)!==null:e===`traces`?a(F)!==null:a(I)!==null}async function de(e){if(ue(e)||a(R)[e])return;let n=re;b(R,{...a(R),[e]:!0},!0),b(ne,{...a(ne),[e]:null},!0);try{if(e===`prompt`){let[e,r]=await Promise.all([le(t.links.renderedPrompt),le(t.links.receivedPrompt)]);if(n!==re)return;b(O,e,!0),b(k,r,!0)}else{let r=await le(e===`conversation`?t.links.conversation:e===`context`?t.links.context:e===`errors`?t.links.errors:e===`traces`?t.links.traces:t.links.logs);if(n!==re)return;b(e===`conversation`?A:e===`context`?M:e===`errors`?te:e===`traces`?F:I,r,!0)}}catch(t){if(n!==re)return;console.error(t),b(ne,{...a(ne),[e]:`Failed to load content`},!0)}finally{n===re&&b(R,{...a(R),[e]:!1},!0)}}function fe(){b(O,null),b(k,null),b(A,null),b(M,null),b(te,null),b(F,null),b(I,null),b(R,{prompt:!1,conversation:!1,context:!1,errors:!1,traces:!1,logs:!1},!0),b(ne,{prompt:null,conversation:null,context:null,errors:null,traces:null,logs:null},!0)}function pe(){re+=1,b(C,`errors`),fe(),b(ee,!0),de(`errors`)}function K(e){re+=1,b(D,e,!0),fe(),b(y,!0),de(e)}function me(e){return e===`prompt`?`Prompt`:e===`conversation`?`Conversation`:`Context`}function ge(e){b(C,e,!0),de(e)}async function _e(){if(a(U)!==`adding`){b(U,`adding`);try{await t.onAddTest(),b(U,`added`)}catch(e){console.error(`Failed to add test`,e),b(U,`failed`)}ie&&clearTimeout(ie),ie=window.setTimeout(()=>{b(U,`idle`),ie=null},2500)}}async function ye(e){if(!(!a(k)||!a(O)))try{let t=e===`raw`?a(k).raw:a(O).raw;await navigator.clipboard.writeText(t),b(V,e,!0),H&&clearTimeout(H),H=window.setTimeout(()=>{b(V,null),H=null},2e3)}catch(e){console.error(`Failed to copy prompt`,e)}}j(()=>{re+=1,H&&clearTimeout(H),ie&&clearTimeout(ie)});var be=hn(),xe=v(be),Se=T(xe),Ce=e=>{var r=an();x(()=>{r.inert=o(),r.disabled=n()||g()}),h(`click`,r,function(...e){t.onFix?.apply(this,e)}),i(e,r)};E(Se,e=>{t.onFix&&e(Ce)});var we=N(Se,2),Te=T(we,!0);f(we);var Ee=N(we,2),De=e=>{var n=on();x(()=>n.disabled=m()),h(`click`,n,function(...e){t.onAnalyze?.apply(this,e)}),i(e,n)};E(Ee,e=>{p()&&e(De)});var Oe=N(Ee,2),ke=N(Oe,2),q=N(ke,2),Ae=N(q,2),je=N(Ae,2);f(xe);var Me=N(xe,2),Ne=e=>{{let n=e=>{var n=cn();u(n,21,()=>t.variants,e=>e.index,(e,n)=>{var r=sn(),o=T(r),s=T(o);f(o);var l=N(o,2),u=T(l,!0);f(l),f(r),x(()=>{z(r,1,`rounded-lg border p-3 ${a(n).index===t.runIndex?`border-rc-green-450`:`border-rc-gray-650`} ${a(n).success?`bg-rc-green-700/80`:`bg-rc-gray-900/60`}`),c(s,`Run ${a(n).index??``}${a(n).index===t.runIndex?` • selected`:``}`),c(u,a(n).text||a(n).errors||`—`)}),i(e,r)}),f(n),i(e,n)},r=w(()=>`Variants — ${t.scenario||`Test`}`);ce(e,{get title(){return a(r)},class:`!w-[80vw] !max-w-4xl`,get open(){return a(S)},set open(e){b(S,e,!0)},children:n,$$slots:{default:!0}})}};E(Me,e=>{a(S)&&e(Ne)});var Pe=N(Me,2),Fe=e=>{{let n=e=>{var t=fn(),n=T(t),r=e=>{var t=ln();i(e,t)},o=e=>{var t=un(),n=T(t,!0);f(t),x(()=>c(n,a(ne)[a(D)])),i(e,t)},s=e=>{var t=dn(),n=T(t),r=T(n),o=T(r);{let e=w(()=>!a(k).raw.trim());W(o,{variant:`secondary`,size:`small`,get disabled(){return a(e)},onclick:()=>ye(`raw`),children:(e,t)=>{l();var n=B();x(()=>c(n,a(V)===`raw`?`Copied raw prompt`:`Copy raw prompt`)),i(e,n)},$$slots:{default:!0}})}f(r);var s=N(r,2),u=T(s);{let e=w(()=>!a(O).raw.trim());W(u,{variant:`secondary`,size:`small`,get disabled(){return a(e)},onclick:()=>ye(`rendered`),children:(e,t)=>{l();var n=B();x(()=>c(n,a(V)===`rendered`?`Copied rendered prompt`:`Copy rendered prompt`)),i(e,n)},$$slots:{default:!0}})}f(s),f(n);var d=N(n,2);he(d,{variant:`generic`,get original(){return a(k).formatted},get modified(){return a(O).formatted},language:`markdown`,class:`min-h-0 flex-1`}),f(t),i(e,t)},u=e=>{{let t=w(()=>a(A).formatted||`—`);ve(e,{get value(){return a(t)},language:`text`,class:`h-full`})}},d=e=>{{let t=w(()=>a(M).formatted||`—`);ve(e,{get value(){return a(t)},language:`json`,class:`h-full`})}};E(n,e=>{a(R)[a(D)]?e(r):a(ne)[a(D)]?e(o,1):a(D)===`prompt`&&a(k)&&a(O)?e(s,2):a(D)===`conversation`&&a(A)?e(u,3):a(D)===`context`&&a(M)&&e(d,4)}),f(t),i(e,t)},r=w(()=>`${me(a(D))} — ${t.scenario||`Test`} (run ${t.runIndex})`);ce(e,{get title(){return a(r)},class:`!w-[85vw] !max-w-5xl`,get open(){return a(y)},set open(e){b(y,e,!0)},children:n,$$slots:{default:!0}})}};E(Pe,e=>{a(y)&&e(Fe)});var J=N(Pe,2),Ie=e=>{{let n=e=>{var t=mn(),n=v(t);oe(n,{get value(){return a(C)},ariaLabel:`Test run debug tabs`,onChange:({value:e})=>ge(e),children:(e,t)=>{var n=pn(),r=v(n);se(r,{value:`errors`,class:`px-3`,children:(e,t)=>{l();var n=B(`Errors`);i(e,n)},$$slots:{default:!0}});var a=N(r,2);se(a,{value:`traces`,class:`px-3`,children:(e,t)=>{l();var n=B(`Traces`);i(e,n)},$$slots:{default:!0}});var o=N(a,2);se(o,{value:`logs`,class:`px-3`,children:(e,t)=>{l();var n=B(`Logs`);i(e,n)},$$slots:{default:!0}}),i(e,n)},$$slots:{default:!0}});var r=N(n,2),o=T(r),s=e=>{var t=ln();i(e,t)},u=e=>{var t=un(),n=T(t,!0);f(t),x(()=>c(n,a(ne)[a(C)])),i(e,t)},d=e=>{{let t=w(()=>a(te).formatted||`—`);ve(e,{get value(){return a(t)},language:`text`,class:`h-full`})}},p=e=>{{let t=w(()=>a(F).formatted||`—`);ve(e,{get value(){return a(t)},language:`json`,class:`h-full`})}},m=e=>{{let t=w(()=>a(I).formatted||`—`);ve(e,{get value(){return a(t)},language:`text`,class:`h-full`})}};E(o,e=>{a(R)[a(C)]?e(s):a(ne)[a(C)]?e(u,1):a(C)===`errors`&&a(te)?e(d,2):a(C)===`traces`&&a(F)?e(p,3):a(C)===`logs`&&a(I)&&e(m,4)}),f(r),i(e,t)},r=w(()=>`Debug — ${t.scenario||`Test`} (run ${t.runIndex})`);ce(e,{get title(){return a(r)},class:`!w-[85vw] !max-w-5xl`,get open(){return a(ee)},set open(e){b(ee,e,!0)},children:n,$$slots:{default:!0}})}};E(J,e=>{a(ee)&&e(Ie)}),x(()=>{we.inert=o(),we.disabled=n()||s()||a(U)===`adding`,c(Te,a(U)===`adding`?`Adding…`:a(U)===`added`?`Added`:a(U)===`failed`?`Failed`:`Add test`)}),h(`click`,we,_e),h(`click`,Oe,()=>b(S,!0)),h(`click`,ke,()=>K(`prompt`)),h(`click`,q,()=>K(`conversation`)),h(`click`,Ae,()=>K(`context`)),h(`click`,je,pe),i(e,be),r()}t([`click`]);var _n=`Update the conversation history so it reflects behaviour that is valid under the current prompt. Preserve the test's intent and expected outcome, and make only the smallest necessary changes. Possible roles: "Agent", "User", "System"`;function vn(e,t){return[e.trim()===`LLM`?``:e.trim(),t.trim()].filter(Boolean).join(` `)}function yn(e){let t=vn(e.assertionLabel,e.assertionValue);return`You will be given the context, the conversation and the desired output and assertion about it. First, find why the prompt is not producing the correct result. It's usually one concrete instruction within the relevant section, or a contradiction. Then, change the prompt minimally so this will work, but keeping the prompt clean and comprehensive is more important. Try to provide as general solution as possible. Try to change just one part of the prompt, not multiple parts. Avoid adding exceptions and overrides. Avoid duplicating information that already exists in the prompt.
|
|
3
3
|
|
|
4
4
|
Context:
|
|
5
5
|
${e.context.trim()}
|
|
Binary file
|
|
Binary file
|
package/build/_app/version.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1789652145769"}
|
|
Binary file
|
|
Binary file
|
package/build/index.html
CHANGED
|
@@ -4,35 +4,35 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<link rel="icon" href="/favicon.png" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<link href="/_app/immutable/entry/start.
|
|
8
|
-
<link href="/_app/immutable/chunks/
|
|
7
|
+
<link href="/_app/immutable/entry/start.CGCxa4r9.js" rel="modulepreload">
|
|
8
|
+
<link href="/_app/immutable/chunks/Bmkwccsg.js" rel="modulepreload">
|
|
9
9
|
<link href="/_app/immutable/chunks/CPCsWwEy.js" rel="modulepreload">
|
|
10
10
|
<link href="/_app/immutable/chunks/hePW80VL.js" rel="modulepreload">
|
|
11
11
|
<link href="/_app/immutable/chunks/Dt-HX3Vu.js" rel="modulepreload">
|
|
12
12
|
<link href="/_app/immutable/chunks/AvXp07rr.js" rel="modulepreload">
|
|
13
|
-
<link href="/_app/immutable/entry/app.
|
|
13
|
+
<link href="/_app/immutable/entry/app.L5djN6KO.js" rel="modulepreload">
|
|
14
14
|
<link href="/_app/immutable/chunks/HclGiUj8.js" rel="modulepreload">
|
|
15
15
|
<link href="/_app/immutable/chunks/xihTtKlq.js" rel="modulepreload">
|
|
16
|
-
<link href="/_app/immutable/nodes/0.
|
|
16
|
+
<link href="/_app/immutable/nodes/0.DxT2ZCBH.js" rel="modulepreload">
|
|
17
17
|
<link href="/_app/immutable/chunks/DDZ8GqHh.js" rel="modulepreload">
|
|
18
|
-
<link href="/_app/immutable/chunks/
|
|
19
|
-
<link href="/_app/immutable/chunks/
|
|
18
|
+
<link href="/_app/immutable/chunks/BFUe72xu.js" rel="modulepreload">
|
|
19
|
+
<link href="/_app/immutable/chunks/CZcJNBdK.js" rel="modulepreload">
|
|
20
20
|
|
|
21
|
-
<link href="/_app/immutable/assets/0.
|
|
21
|
+
<link href="/_app/immutable/assets/0.CdQBFG7k.css" rel="stylesheet">
|
|
22
22
|
</head>
|
|
23
23
|
<body data-sveltekit-preload-data="hover">
|
|
24
24
|
<div style="display: contents">
|
|
25
25
|
<script>
|
|
26
26
|
{
|
|
27
|
-
|
|
27
|
+
__sveltekit_m0k6gr = {
|
|
28
28
|
base: ""
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
const element = document.currentScript.parentElement;
|
|
32
32
|
|
|
33
33
|
Promise.all([
|
|
34
|
-
import("/_app/immutable/entry/start.
|
|
35
|
-
import("/_app/immutable/entry/app.
|
|
34
|
+
import("/_app/immutable/entry/start.CGCxa4r9.js"),
|
|
35
|
+
import("/_app/immutable/entry/app.L5djN6KO.js")
|
|
36
36
|
]).then(([kit, app]) => {
|
|
37
37
|
kit.start(app, element);
|
|
38
38
|
});
|
package/build/index.html.br
CHANGED
|
Binary file
|
package/build/index.html.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CUZn05nQ.js","./hePW80VL.js","./HclGiUj8.js","./C_yvzB4Z.js","../assets/editor.chSTM-fo.css","../assets/editor.BoJhDcRF.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{B as e,Dt as t,F as n,G as r,I as i,L as a,N as o,Nt as s,Ot as c,Pt as l,S as u,V as d,a as f,at as p,b as m,dt as h,et as g,gt as _,it as v,j as y,l as b,m as x,n as S,ot as C,pt as w,r as T,st as E,tt as D,x as O,z as k}from"./CPCsWwEy.js";import{t as A}from"./HclGiUj8.js";import"./xihTtKlq.js";import{t as j}from"./6OCsQ6r7.js";import{t as M}from"./Cf3l6QEG.js";import{n as N,t as P}from"./BJqZY8o2.js";import{t as ee}from"./BP0Xadq7.js";import{t as te}from"./DWoqp3ac.js";import{c as ne,o as F,s as I,t as L}from"./12bfCwgn.js";import{t as R}from"./B9YnyJ2j.js";import{i as z}from"./By9tvIIw.js";import{t as B}from"./CGV7fMmX.js";import{t as V}from"./CL717zGu.js";var H=a(`<div class="popover svelte-1fd3ybn" role="dialog" aria-modal="true"><div class="popover svelte-1fd3ybn" role="dialog" aria-modal="true"><!></div></div>`);function U(e,a){c(a,!0);let o=f(a,`open`,3,!1),s=f(a,`anchorEl`,3,null),u=f(a,`id`,3,``),d=f(a,`placement`,3,`bottom-start`),_=f(a,`offset`,19,()=>[0,2]),S=f(a,`flip`,3,!0),C=f(a,`preventOverflow`,3,!0),E=f(a,`onClose`,3,()=>{}),D=w(null),O=w(null);function k(){E()()}function A(e){if(o()&&r(D)&&s()){let t=e.target;!r(D).contains(t)&&!s().contains(t)&&k()}}function j(e){e.key===`Escape`&&o()&&k()}T(()=>{document.addEventListener(`click`,A,!0),document.addEventListener(`keydown`,j);let e=()=>{r(O)&&r(O).update()},t=()=>{r(O)&&r(O).update()};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,t,!0),()=>{document.removeEventListener(`click`,A,!0),document.removeEventListener(`keydown`,j),window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,t,!0)}});var M=i(),N=p(M),P=e=>{b(B(e,{get referenceEl(){return s()},get placement(){return d()},get offset(){return _()},get flip(){return S()},get preventOverflow(){return C()},children:e=>{var t=H(),i=v(t),o=v(i);a.children(o),l(i),b(i,e=>h(D,e),()=>r(D)),l(t),b(t,e=>h(D,e),()=>r(D)),g(()=>{x(t,`id`,u()),x(i,`id`,u()),m(i,`min-width:${s()?.offsetWidth??0}px`)}),n(e,t)},$$slots:{default:!0}}),e=>h(O,e,!0),()=>r(O))};y(N,e=>{o()&&s()&&e(P)}),n(e,M),t()}function re(e={}){let t=e.thresholdPx??4,n=e.dragCursor??`text`,r=0,i=0,a=!1,o=!1,s=null,c=null;function l(){o=!1,a=!1,s?.style.removeProperty(`cursor`),s=null,c?.abort(),c=null}function u(e){if(typeof window>`u`||e.button!==0)return;c?.abort(),c=null,s?.style.removeProperty(`cursor`),r=e.clientX,i=e.clientY,a=!1,o=!0,s=e.currentTarget instanceof HTMLElement?e.currentTarget:null;let l=new AbortController;c=l;let u=e=>{!o||a||Math.abs(e.clientX-r)+Math.abs(e.clientY-i)<t||(a=!0,s?.style.setProperty(`cursor`,n))},d=()=>{o=!1,s?.style.removeProperty(`cursor`),s=null,l.abort(),c===l&&(c=null)};window.addEventListener(`pointermove`,u,{signal:l.signal}),window.addEventListener(`pointerup`,d,{signal:l.signal}),window.addEventListener(`pointercancel`,d,{signal:l.signal})}function d(e){return e.detail>0&&a}return{onPointerDown:u,shouldSuppressClick:d,cleanup:l}}var W=a(`<span class="text-[13px] leading-none text-rc-gray-400"> </span>`),ie=a(`<div class="rounded-md border border-red-500 bg-red-950/40 p-3 font-mono text-sm text-red-200"> </div>`),ae=a(`<!> <!>`,1),G=a(`<div class="flex flex-col gap-3"><!> <div class="flex flex-wrap items-center justify-between gap-2 text-sm text-rc-gray-200"><div class="flex flex-wrap items-center gap-x-4 gap-y-1"><div><span class="text-rc-gray-400">Timing:</span> </div> <div><span class="text-rc-gray-400">Response time:</span> </div> <div><span class="text-rc-gray-400">URL:</span> </div></div> <!></div> <div><!> <div class="mt-2 h-[55vh]"><!></div></div></div>`),K=a(`<button type="button" class="flex w-full cursor-pointer select-text items-baseline gap-2 truncate rounded-md bg-transparent px-2 py-1 text-left text-sm text-rc-gray-200 hover:bg-rc-gray-800/40"><!> <!> <span> </span></button> <!>`,1);function q(e,i){c(i,!0);let a=w(!1),f=w(`request`),m=re();S(m.cleanup);function b(e){try{if(typeof e==`string`){let t=e.trim();if(!t)return``;let n=JSON.parse(t);return JSON.stringify(n,null,2)}}catch{}try{return JSON.stringify(e??null,null,2)}catch{return String(e)}}function x(e){return new Date(e).toISOString()}function T(e){if(typeof e!=`number`||!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`}let E=_(()=>T(i.trace.createdAt)),D=_(()=>{if(i.trace.error!=null)return i.trace.error;if(!(i.trace.ok===!1||typeof i.trace.status==`number`&&i.trace.status>=400))return;let e=i.trace.response;return e&&typeof e==`object`&&`error`in e&&e.error!=null?e.error:{status:i.trace.status,ok:i.trace.ok}}),A=_(()=>r(D)!=null),te=_(()=>`API: ${i.trace.operationName}`),ne=_(()=>i.trace.operationName),F=_(()=>typeof i.trace.createdAt==`number`?x(i.trace.createdAt):`—`);async function I(){let e=b(i.trace);try{await navigator.clipboard.writeText(e)}catch(e){console.error(`Failed to copy`,e)}}let L=_(()=>b({method:i.trace.method,path:i.trace.path,baseUrl:i.trace.baseUrl,request:i.trace.request})),R=_(()=>b({status:i.trace.status,ok:i.trace.ok,response:i.trace.response,error:r(D)})),z=_(()=>r(D)==null?``:b(r(D)));var B=K(),H=p(B),U=v(H);{let e=_(()=>r(A)?`close`:`checkmark`),t=_(()=>r(A)?`self-center text-red-400`:`self-center text-rc-green-200`);M(U,{get name(){return r(e)},width:18,height:18,get class(){return r(t)}})}var q=C(U,2),oe=e=>{var t=W(),i=v(t,!0);l(t),g(()=>o(i,r(E))),n(e,t)};y(q,e=>{r(E)&&e(oe)});var J=C(q,2),Y=v(J,!0);l(J),l(H);var X=C(H,2),Z=e=>{ee(e,{get title(){return r(te)},class:`!w-[85vw] !max-w-5xl`,get open(){return r(a)},set open(e){h(a,e,!0)},children:e=>{var t=G(),a=v(t),c=e=>{var t=ie(),i=v(t,!0);l(t),g(()=>o(i,r(z))),n(e,t)};y(a,e=>{r(z)&&e(c)});var u=C(a,2),d=v(u),m=v(d),_=C(v(m));l(m);var b=C(m,2),x=C(v(b));l(b);var S=C(b,2),w=C(v(S));l(S),l(d);var T=C(d,2);j(T,{variant:`secondary`,size:`small`,onclick:I,children:(e,t)=>{s();var r=k(`Copy raw trace`);n(e,r)},$$slots:{default:!0}}),l(u);var E=C(u,2),D=v(E);N(D,{get value(){return r(f)},ariaLabel:`API trace tabs`,onChange:({value:e})=>h(f,e,!0),children:(e,t)=>{var r=ae(),i=p(r);P(i,{value:`request`,class:`px-3`,children:(e,t)=>{s();var r=k(`Request`);n(e,r)},$$slots:{default:!0}});var a=C(i,2);P(a,{value:`response`,class:`px-3`,children:(e,t)=>{s();var r=k(`Response`);n(e,r)},$$slots:{default:!0}}),n(e,r)},$$slots:{default:!0}});var O=C(D,2),A=v(O),M=e=>{V(e,{get value(){return r(L)},language:`json`,class:`h-full`})},ee=e=>{V(e,{get value(){return r(R)},language:`json`,class:`h-full`})};y(A,e=>{r(f)===`request`?e(M):e(ee,-1)}),l(O),l(E),l(t),g(e=>{o(_,` ${r(F)??``}`),o(x,` ${e??``}`),o(w,` ${i.trace.path??``}`)},[()=>typeof i.trace.durationMs==`number`?`${Math.round(i.trace.durationMs)}ms`:`—`]),n(e,t)},$$slots:{default:!0}})};y(X,e=>{r(a)&&e(Z)}),g(()=>{O(J,1,u(r(A)?`text-red-200`:``)),o(Y,r(ne))}),d(`pointerdown`,H,function(...e){m.onPointerDown?.apply(this,e)}),d(`click`,H,e=>{m.shouldSuppressClick(e)||h(a,!0)}),n(e,B),t()}e([`pointerdown`,`click`]);function oe(e){return X(e)&&X(e.context)?Y(e.context):Y(e)}function J(e){if(!(!X(e)||!X(e.mocks)))return Y(e.mocks)}function Y(e){return X(e)?Z(e):{}}function X(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function Z(e){try{return structuredClone(e)}catch{try{return JSON.parse(JSON.stringify(e))}catch{return e}}}function se(e){return!(`operationName`in e)&&!(`eventName`in e)}function ce(e){return se(e)&&R(e.name)}function Q(e,t,n={}){if(t<0)return null;let r=e=>ce(e)?!n.requireRenderedPrompt||typeof e.renderedPrompt==`string`&&e.renderedPrompt.trim().length>0:!1;return[...e.slice(0,t)].reverse().find(r)??e.slice(t+1).find(r)??null}function le(e,t,n){if(t<0||!n.trim())return null;let r=e=>se(e)&&!R(e.name)&&e.response===n;return[...e.slice(0,t)].reverse().find(r)??e.slice(t+1).find(r)??null}function ue(e,t){return t<=0?null:[...e.slice(0,t)].reverse().map(e=>se(e)?e.stringifiedConversation?.trim():``).find(Boolean)??null}function de({entries:e,trace:t,sourceStep:n,fallbackRuntimeContext:r,requireReceivedContext:i=!1}){let a=e.indexOf(t);if(a===-1)throw Error(`Could not locate the response in its trace history`);let o=n??Q(e,a);if(i&&o?.receivedContext===void 0)throw Error(`The source step trace does not have receivedContext`);let s=typeof o?.stringifiedConversation==`string`&&o.stringifiedConversation.trim()?o.stringifiedConversation:ue(e,a)??``,c=(t.content??``).trim(),l=o&&o.receivedContext!==void 0?Y(o.receivedContext):oe(r),u=J(r),d=o?.name;return{pinned:`TRUE`,step:d&&!R(d)?d:`main`,evaluation_mode:`assertion`,context_mode:`replace`,assertion_type:`llm-rubric`,assertion_value:``,conversation:s,expected_output:c,similarity_threshold:`60`,timeout:`0`,context:l,...u===void 0?{}:{mocks:u}}}function fe(e){return e.content.trim()===`<DICTATION />`}function pe(e,{fallbackConversation:t=``,fallbackRuntimeContext:n}={}){if(e.receivedContext===void 0)throw Error(`The source step trace does not have receivedContext`);let r=(e.response??``).trim();if(!r)throw Error(`The source step trace does not have a response`);let i=e.stringifiedConversation?.trim()?e.stringifiedConversation:t??``,a=$(r)?`json-deep-equal`:`assertion`,o=J(n);return{pinned:`TRUE`,step:R(e.name)?`main`:e.name,evaluation_mode:a,context_mode:`replace`,assertion_type:`llm-rubric`,assertion_value:``,conversation:i,expected_output:r,similarity_threshold:`60`,timeout:`0`,context:Y(e.receivedContext),...o===void 0?{}:{mocks:o}}}function $(e){try{let t=JSON.parse(e);return typeof t==`object`&&!!t}catch{return!1}}var me=a(`<div><div class="h-full w-full"></div></div>`);function he(e,i){c(i,!0);let a=f(i,`language`,3,`plaintext`),o=f(i,`class`,3,``),s=w(null),u=null,d=null,p=null,m=null,_=w(!1);T(()=>{if(!r(s))return;I();let e=!1;return A(()=>import(`./CUZn05nQ.js`).then(e=>e.t).then(t=>{if(e)return;F(t),d=t,u=t.editor.createDiffEditor(r(s),{theme:`bosun-dark`,readOnly:!1,originalEditable:!1,automaticLayout:!0,lineNumbers:`on`,renderSideBySide:!0,renderIndicators:!0,ignoreTrimWhitespace:!1,diffWordWrap:`on`,diffAlgorithm:`advanced`,maxComputationTime:2e4,renderMarginRevertIcon:!1,renderGutterMenu:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,matchBrackets:`never`,bracketPairColorization:{enabled:!1},guides:{highlightActiveBracketPair:!1,bracketPairs:!1,bracketPairsHorizontal:!1},occurrencesHighlight:`off`,selectionHighlight:!1,renderLineHighlight:`none`});let n=t.editor.createModel(i.original??``,a()),o=t.editor.createModel(i.modified??``,a());p={original:n,modified:o},u.setModel(p),m=o.onDidChangeContent(()=>{let e=o.getValue();e!==i.modified&&i.onChange?.(e)}),h(_,!0)}),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).catch(e=>{console.error(`EditableMonacoDiff: failed to initialise`,e)}),()=>{if(e=!0,m?.dispose(),m=null,u){try{u.setModel(null)}catch{}u.dispose(),u=null}p?.original.dispose(),p?.modified.dispose(),p=null,d=null}}),D(()=>{if(!p||!r(_))return;let e=i.original??``,t=i.modified??``;p.original.getValue()!==e&&p.original.setValue(e),p.modified.getValue()!==t&&p.modified.setValue(t)}),D(()=>{if(!p||!r(_)||!d)return;let e=a()||`plaintext`;p.original.getLanguageId()!==e&&d.editor.setModelLanguage(p.original,e),p.modified.getLanguageId()!==e&&d.editor.setModelLanguage(p.modified,e)});var y=me(),x=v(y);b(x,e=>h(s,e),()=>r(s)),l(y),g(()=>O(y,1,`overflow-hidden rounded-md border border-rc-gray-700 ${o()}`)),n(e,y),t()}var ge=a(`<div class="flex flex-1 items-center justify-center text-rc-gray-200">Removing personal data...</div>`),_e=a(`<div class="flex flex-1 flex-col items-center justify-center gap-4"><div class="max-w-2xl text-center text-red-300"> </div> <div class="flex flex-wrap justify-center gap-2"><!> <!></div></div>`),ve=a(`<div class="text-xs text-rc-gray-500"> </div>`),ye=a(`<div class="rounded-md border border-amber-600 bg-amber-950/30 px-3 py-2 text-sm text-amber-200"> </div>`),be=a(`<!> <!> <!> <!>`,1),xe=a(`<div class="flex flex-wrap items-center justify-between gap-2 text-sm"><div class="text-rc-gray-200"><!></div> <!></div> <!> <div class="flex min-h-0 flex-1 flex-col"><!> <div class="mt-2 min-h-0 flex-1"><!></div></div>`,1),Se=a(`<div class="flex h-[70vh] min-h-[32rem] flex-col gap-3"><!></div>`),Ce=a(`<!> <!>`,1);function we(e,i){c(i,!0);let a=_(()=>ne().editable),u=f(i,`open`,15,!1),d=w(`idle`),m=w(``),b=w(``),x=w(!1),S=w(`conversation`),T=w(``),O=w(null),A=w(null),M=w(E([])),F=w(``),I=w(``),L=w(``),R=w(`{}`),z=w(`{}`),B=null,V=0,H=_(()=>r(A)?.mocks!==void 0),U=_(()=>r(M).reduce((e,t)=>e+t.paths.length,0)),re=_(()=>r(O)?.conversation??``),W=_(()=>r(O)?.expected_output??``),ie=_(()=>X(r(O)?.context??{})),ae=_(()=>X(r(O)?.mocks??{}));D(()=>{let e=u(),t=i.seed;!e||!t||B===t||(B=t,G(t))}),D(()=>{u()||(V+=1,h(d,`idle`),h(m,``),h(b,``),h(x,!1),B=null,h(T,``),h(O,null),h(A,null),h(M,[],!0),h(F,``),h(S,`conversation`))});async function G(e){let t=++V;h(d,`preparing`),h(m,``),h(b,``),h(x,!1),h(O,e,!0),h(A,null),h(T,``),h(M,[],!0);try{let n=await te.tests.createPIISanitizedTestDraft.mutate({agent:i.agent,seed:e});if(t!==V)return;if(n.status===`sanitizer-error`){h(m,n.message,!0),h(b,n.aiResponse,!0),h(d,`error`);return}q(n.draftId,n.seed,n.findings,n.model),h(d,`ready`)}catch(e){if(t!==V)return;console.error(`Failed to prepare PII-sanitised test draft`,e),h(m,Z(e,`Could not prepare a PII-sanitised test draft.`),!0),h(d,`error`)}}async function K(){if(r(b))try{await navigator.clipboard.writeText(r(b)),h(x,!0)}catch(e){console.error(`Failed to copy PII sanitiser AI response`,e),h(m,`Could not copy the AI response to the clipboard.`)}}function q(e,t,n,i=r(F)){h(T,e,!0),h(A,t,!0),h(M,n,!0),h(F,i,!0),h(I,t.conversation,!0),h(L,t.expected_output,!0),h(R,X(t.context),!0),h(z,X(t.mocks??{}),!0),r(S)===`mocks`&&t.mocks===void 0&&h(S,`conversation`)}async function oe(){if(!r(A)||!r(T)||r(d)!==`ready`)return;let e=window.open(`about:blank`,`_blank`);e&&(e.opener=null),h(d,`creating`),h(m,``);try{let t=J(),n=await te.tests.createTestFromPIISanitizedTestDraft.mutate({agent:i.agent,draftId:r(T),reviewed:t}),a=new URLSearchParams({step:n.test.step||r(A).step||`main`,test:n.test.id}),o=`/edit/${encodeURIComponent(i.agent)}/tests?${a.toString()}`;e?e.location.replace(o):window.open(o,`_blank`,`noopener`),u(!1),i.onCreated?.(n.test)}catch(t){e?.close(),console.error(`Failed to create test from PII-sanitised draft`,t),h(m,Z(t,`Could not create the test.`),!0),h(d,`ready`)}}function J(){let e=Y(r(R),`Context`),t=r(H)?Y(r(z),`Mocks`):void 0;return{conversation:r(I),expected_output:r(L),context:e,...t===void 0?{}:{mocks:t}}}function Y(e,t){let n;try{n=JSON.parse(e)}catch{throw Error(`${t} must be valid JSON.`)}if(!n||typeof n!=`object`||Array.isArray(n))throw Error(`${t} must be a JSON object.`);return n}function X(e){return JSON.stringify(e??{},null,2)}function Z(e,t){return e instanceof Error&&e.message.trim()?e.message:t}ee(e,{title:`Review test before creating`,class:`!w-[94vw] !max-w-[90rem]`,get open(){return u()},set open(e){u(e)},children:e=>{var t=Se(),a=v(t),c=e=>{var t=ge();n(e,t)},u=e=>{var t=_e(),a=v(t),c=v(a,!0);l(a);var u=C(a,2),d=v(u);j(d,{variant:`secondary`,onclick:()=>i.seed&&G(i.seed),children:(e,t)=>{s();var r=k(`Try again`);n(e,r)},$$slots:{default:!0}});var f=C(d,2),p=e=>{j(e,{variant:`secondary`,onclick:K,children:(e,t)=>{s();var i=k();g(()=>o(i,r(x)?`AI response copied`:`Copy AI response`)),n(e,i)},$$slots:{default:!0}})};y(f,e=>{r(b)&&e(p)}),l(u),l(t),g(()=>o(c,r(m))),n(e,t)},f=e=>{var t=xe(),i=p(t),a=v(i),c=v(a),u=e=>{var t=k(`No personal data replacements were proposed.`);n(e,t)},d=e=>{var t=k();g(()=>o(t,`${r(U)??``} personal data ${r(U)===1?`replacement`:`replacements`} proposed.`)),n(e,t)};y(c,e=>{r(U)===0?e(u):e(d,-1)}),l(a);var f=C(a,2),_=e=>{var t=ve(),i=v(t);l(t),g(()=>o(i,`Model: ${r(F)??``}`)),n(e,t)};y(f,e=>{r(F)&&e(_)}),l(i);var b=C(i,2),x=e=>{var t=ye(),i=v(t,!0);l(t),g(()=>o(i,r(m))),n(e,t)};y(b,e=>{r(m)&&e(x)});var w=C(b,2),T=v(w);N(T,{get value(){return r(S)},ariaLabel:`PII-sanitised test draft fields`,onChange:({value:e})=>h(S,e,!0),children:(e,t)=>{var i=be(),a=p(i);P(a,{value:`conversation`,class:`px-3`,children:(e,t)=>{s();var r=k(`Conversation`);n(e,r)},$$slots:{default:!0}});var o=C(a,2);P(o,{value:`expected_output`,class:`px-3`,children:(e,t)=>{s();var r=k(`Expected output`);n(e,r)},$$slots:{default:!0}});var c=C(o,2);P(c,{value:`context`,class:`px-3`,children:(e,t)=>{s();var r=k(`Context`);n(e,r)},$$slots:{default:!0}});var l=C(c,2),u=e=>{P(e,{value:`mocks`,class:`px-3`,children:(e,t)=>{s();var r=k(`Mocks`);n(e,r)},$$slots:{default:!0}})};y(l,e=>{r(H)&&e(u)}),n(e,i)},$$slots:{default:!0}});var E=C(T,2),D=v(E),O=e=>{he(e,{get original(){return r(re)},get modified(){return r(I)},onChange:e=>h(I,e,!0),language:`plaintext`,class:`h-full`})},A=e=>{he(e,{get original(){return r(W)},get modified(){return r(L)},onChange:e=>h(L,e,!0),language:`plaintext`,class:`h-full`})},j=e=>{he(e,{get original(){return r(ie)},get modified(){return r(R)},onChange:e=>h(R,e,!0),language:`json`,class:`h-full`})},M=e=>{he(e,{get original(){return r(ae)},get modified(){return r(z)},onChange:e=>h(z,e,!0),language:`json`,class:`h-full`})};y(D,e=>{r(S)===`conversation`?e(O):r(S)===`expected_output`?e(A,1):r(S)===`context`?e(j,2):e(M,-1)}),l(E),l(w),n(e,t)};y(a,e=>{r(d)===`preparing`?e(c):r(d)===`error`&&!r(A)?e(u,1):r(A)&&r(O)&&e(f,2)}),l(t),n(e,t)},footer:e=>{var t=Ce(),i=p(t);j(i,{variant:`secondary`,onclick:()=>u(!1),children:(e,t)=>{s();var r=k(`Cancel`);n(e,r)},$$slots:{default:!0}});var c=C(i,2);{let e=_(()=>!r(a)||!r(A)||r(d)===`preparing`||r(d)===`creating`);j(c,{get disabled(){return r(e)},onclick:oe,children:(e,t)=>{s();var i=k();g(()=>o(i,r(d)===`creating`?`Creating…`:`Create test`)),n(e,i)},$$slots:{default:!0}})}n(e,t)},$$slots:{default:!0,footer:!0}}),t()}var Te=a(`<span class="text-[13px] leading-none text-rc-gray-400"> </span>`),Ee=a(`<div class="min-w-0 break-words"> </div>`),De=a(`<div class="min-w-0 break-words">Conversation hanged up.</div>`),Oe=a(`<div class="flex w-full justify-center"><div role="button" tabindex="0"><div class="flex flex-wrap items-baseline gap-x-2 gap-y-0"><!> <!></div></div></div>`),ke=a(`<div class="mr-2 mt-1 flex h-5 w-5 shrink-0 items-center justify-center rounded-sm bg-rc-green-700 text-sm uppercase text-rc-gray-100 backdrop-blur-md"> </div>`),Ae=a(`<button type="button" title="Edit this message" class="mr-2 mt-1 shrink-0 self-start rounded p-1 text-rc-gray-500 opacity-80 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none"><!></button>`),je=a(`<div class="mt-1 text-right text-xs text-rc-gray-200/70"> </div>`),Me=a(`<button type="button"><!></button>`),Ne=a(`<button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-rc-gray-400">Analyze</button>`),Pe=a(`<button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">Regenerate</button>`),Fe=a(`<button type="button" class="inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 focus:outline-none focus-visible:outline-none">See variants</button>`),Ie=a(`<div class="mt-1 flex flex-wrap items-center gap-x-2 gap-y-1"><!> <!> <!> <!></div>`),Le=a(`<!> <!> <div><div role="button" tabindex="0" class="cursor-pointer select-text"><div><div> </div> <!></div></div> <!></div>`,1),Re=a(`<div class="rounded-md border border-red-500 bg-red-950/40 p-3 font-mono text-sm text-red-200"> </div>`),ze=a(`<!> <!>`,1),Be=a(`<div class="whitespace-pre-wrap break-words rounded-md border border-rc-gray-650 bg-rc-gray-900/60 p-3 text-sm text-rc-gray-100"> </div>`),Ve=a(`<div class="flex flex-col gap-3"><!> <div class="flex items-center justify-between gap-2 text-sm text-rc-gray-200"><div class="text-rc-gray-400"> </div> <!></div> <div><!> <div class="mt-2 h-[55vh] overflow-auto"><!></div></div></div>`),He=a(`<div><!></div> <!> <!>`,1);function Ue(e,i){c(i,!0);let a=_(()=>ne().editable),u=f(i,`promptEditProposalId`,3,null),m=f(i,`allowAddTest`,3,!0),b=f(i,`testSourceStep`,3,void 0),T=f(i,`testEntries`,3,void 0),E=f(i,`requireTestSourceStep`,3,!1),D=f(i,`analyzeDisabled`,3,!1),A=f(i,`showSeeVariants`,3,!1),F=f(i,`variantSelectionState`,3,`none`),I=f(i,`suppressActionRow`,3,!1),L=w(!1),R=w(`idle`),B=w(`content`),H=w(!1),U=w(null),W=re();S(W.cleanup);function ie(e){return e?e.split(`/`).at(-1)??e:``}function ae(e){let t=ie(e).trim().charAt(0);return t?t.toUpperCase():`?`}let G=_(()=>i.trace.eventName===`finished-main-streaming-step`||i.trace.eventName===`sent-message`?`agent`:i.trace.role===`system`||i.trace?.bosunInputMessageSender===`system`?`system`:(i.trace.role,`user`)),K=_(()=>{if(r(G)!==`system`)return b();let e=T()??z;return le(e,e.indexOf(i.trace),i.trace.content)}),q=_(()=>r(G)===`agent`?`max-w-[83%]`:r(G)===`user`?`max-w-[90%] sm:max-w-[80%] md:max-w-[70%]`:r(G)===`system`?`max-w-[90%] sm:max-w-[85%] md:max-w-[75%]`:``),oe=_(()=>(r(G)===`user`||r(G)===`system`)&&!!i.onRevert&&i.trace?.bosunPrevStateId!==void 0),J=_(()=>i.trace.error!=null),Y=_(()=>F()===`source`);function X(){h(L,!0),h(B,`content`)}function Z(e){if(!W.shouldSuppressClick(e)){if(r(Y)){i.onSelectInVariantMode?.(i.trace);return}X()}}function se(e){if(typeof e!=`number`||!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`}let ce=_(()=>se(i.trace?.createdAt));function Q(e){try{return JSON.stringify(e??null,null,2)}catch{return String(e)}}async function ue(){try{await navigator.clipboard.writeText(Q(i.trace))}catch(e){console.error(`Failed to copy`,e)}}function pe(){return m()&&!fe(i.trace)&&i.trace.eventName!==`transfer-requested`&&(r(G)===`agent`&&(i.trace.eventName===`finished-main-streaming-step`||i.trace.eventName===`sent-message`)||r(G)===`system`&&!!r(K))}function $(){return!pe()||!(i.agentId&&i.agentId.trim())?!1:!E()||!!r(K)&&r(K).receivedContext!==void 0}function me(){return r(G)===`agent`&&i.trace.eventName!==`transfer-requested`&&!!(i.agentId&&i.agentId.trim())&&(i.trace.eventName===`finished-main-streaming-step`||i.trace.eventName===`sent-message`)}function he(){return me()}async function ge(){let e=null;try{h(R,`idle`);let t=(i.agentId||``).trim();if(!t)throw Error(`Agent id is not available; cannot add test`);let n=de({entries:T()??z,trace:i.trace,sourceStep:r(K),fallbackRuntimeContext:i.context});if(i.testCreationMode===`pii-sanitized`){h(U,n,!0),h(H,!0);return}e=window.open(`about:blank`,`_blank`),e&&(e.opener=null);let a=await te.tests.addTest.mutate({agent:t,seed:n}),o=new URLSearchParams({step:n.step||`main`,test:a.id});u()&&o.set(`promptEdit`,u());let s=`/edit/${encodeURIComponent(t)}/tests?${o.toString()}`;e?e.location.replace(s):window.open(s,`_blank`,`noopener`),_e()}catch(t){e?.close(),console.error(`Failed to add test`,t),h(R,`error`),setTimeout(()=>h(R,`idle`),4e3)}}function _e(){h(R,`ok`),setTimeout(()=>h(R,`idle`),3e3)}var ve=He(),ye=p(ve);let be;var xe=v(ye),Se=e=>{var t=Oe(),a=v(t),s=v(a),c=v(s),u=e=>{var t=Te(),i=v(t,!0);l(t),g(()=>o(i,r(ce))),n(e,t)};y(c,e=>{r(ce)&&e(u)});var f=C(c,2),p=e=>{var t=Ee(),r=v(t);l(t),g(()=>o(r,`Transfer requested: ${i.trace.content??``}`)),n(e,t)},m=e=>{var t=De();n(e,t)};y(f,e=>{i.trace.eventName===`transfer-requested`?e(p):e(m,-1)}),l(s),l(a),l(t),g(()=>O(a,1,`cursor-pointer select-text rounded-full border border-rc-gray-650 bg-rc-gray-800/40 px-4 py-2 text-sm text-rc-gray-100 ${r(J)?`border-red-500 bg-red-950/30 text-red-200`:``}`)),d(`pointerdown`,a,function(...e){W.onPointerDown?.apply(this,e)}),d(`click`,a,e=>{W.shouldSuppressClick(e)||X()}),n(e,t)},Ce=e=>{var t=Le(),s=p(t),c=e=>{var t=ke(),r=v(t,!0);l(t),g((e,n)=>{x(t,`title`,e),o(r,n)},[()=>ie(i.agentId),()=>ae(i.agentId)]),n(e,t)};y(s,e=>{r(G)===`agent`&&i.agentId&&e(c)});var u=C(s,2),f=e=>{var t=Ae(),r=v(t);M(r,{name:`undo`,width:16,height:16}),l(t),d(`click`,t,e=>{e.stopPropagation(),i.onRevert?.(i.trace)}),n(e,t)};y(u,e=>{r(oe)&&e(f)});var m=C(u,2),h=v(m),b=v(h),S=v(b),w=v(S,!0);l(S);var T=C(S,2),E=e=>{var t=je(),i=v(t,!0);l(t),g(()=>o(i,r(ce))),n(e,t)};y(T,e=>{r(ce)&&e(E)}),l(b),l(h);var j=C(h,2),N=e=>{var t=Ie(),o=v(t),s=e=>{var t=Me(),i=v(t),o=e=>{var t=k(`Added`);n(e,t)},s=e=>{var t=k(`Failed`);n(e,t)},c=e=>{var t=k(`Select agent to add test`);n(e,t)},u=_(()=>!$()),f=e=>{var t=k(`Add test`);n(e,t)};y(i,e=>{r(R)===`ok`?e(o):r(R)===`error`?e(s,1):r(u)?e(c,2):e(f,-1)}),l(t),g((e,n,r)=>{t.disabled=e,x(t,`title`,n),O(t,1,`inline-flex items-center text-nowrap rounded border-0 bg-transparent px-1 py-0.5 transition-colors focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 ${r??``}`)},[()=>!r(a)||!$()||r(R)!==`idle`||r(H),()=>r(a)?$()?void 0:`Select an agent in the sidebar before adding a test`:`Bosun is running in read-only mode`,()=>r(R)!==`idle`||!$()?`cursor-default text-rc-gray-400`:`cursor-pointer text-rc-gray-400 hover:bg-rc-gray-900 hover:text-rc-gray-200`]),d(`click`,t,e=>{e.stopPropagation(),ge()}),n(e,t)},c=_(()=>pe());y(o,e=>{r(c)&&e(s)});var u=C(o,2),f=e=>{var t=Ne();g(()=>t.disabled=D()),d(`click`,t,e=>{e.stopPropagation(),i.onAnalyze(i.trace)}),n(e,t)},p=_(()=>me()&&i.onAnalyze);y(u,e=>{r(p)&&e(f)});var m=C(u,2),h=e=>{var t=Pe();d(`click`,t,e=>{e.stopPropagation(),i.onRegenerate(i.trace)}),n(e,t)},b=_(()=>he()&&i.onRegenerate);y(m,e=>{r(b)&&e(h)});var S=C(m,2),w=e=>{var t=Fe();d(`click`,t,e=>{e.stopPropagation(),i.onSeeVariants(i.trace)}),n(e,t)};y(S,e=>{A()&&i.onSeeVariants&&r(a)&&e(w)}),l(t),n(e,t)},P=_(()=>!I()&&(me()||pe()||he()&&i.onRegenerate||A()));y(j,e=>{r(P)&&e(N)}),l(m),g(()=>{O(m,1,`min-w-0 ${r(q)??``}`),O(b,1,`rounded-lg ${r(G)===`system`?`justify-between whitespace-pre-line break-words border border-emerald-500 text-emerald-500`:r(Y)?`w-full whitespace-pre-line break-words border border-rc-green-450 bg-transparent backdrop-blur-md hover:bg-rc-green-700`:r(G)===`user`?`whitespace-pre-line break-words bg-rc-gray-700`:`w-full whitespace-pre-line break-words bg-rc-green-700 backdrop-blur-md`} ${r(G)===`system`||r(Y)?``:`border-thin border-rc-gray-110`} p-2 pt-1 text-rc-gray-100 ${r(J)?`border-red-500 bg-red-950/30 text-red-200`:``}`),o(w,i.trace.content)}),d(`pointerdown`,h,function(...e){W.onPointerDown?.apply(this,e)}),d(`click`,h,Z),n(e,t)};y(xe,e=>{i.trace.eventName===`transfer-requested`||i.trace.eventName===`hangup-requested`?e(Se):e(Ce,-1)}),l(ye);var Ue=C(ye,2),We=e=>{{let t=e=>{var t=Ve(),a=v(t),c=e=>{var t=Re(),r=v(t,!0);l(t),g(e=>o(r,e),[()=>Q(i.trace.error)]),n(e,t)};y(a,e=>{r(J)&&e(c)});var u=C(a,2),d=v(u),f=v(d);l(d);var m=C(d,2);j(m,{variant:`secondary`,size:`small`,onclick:ue,children:(e,t)=>{s();var r=k(`Copy raw trace`);n(e,r)},$$slots:{default:!0}}),l(u);var b=C(u,2),x=v(b);N(x,{get value(){return r(B)},ariaLabel:`Conversational trace tabs`,onChange:({value:e})=>h(B,e,!0),children:(e,t)=>{var r=ze(),i=p(r);P(i,{value:`content`,class:`px-3`,children:(e,t)=>{s();var r=k(`Content`);n(e,r)},$$slots:{default:!0}});var a=C(i,2);P(a,{value:`raw`,class:`px-3`,children:(e,t)=>{s();var r=k(`Raw`);n(e,r)},$$slots:{default:!0}}),n(e,r)},$$slots:{default:!0}});var S=C(x,2),w=v(S),T=e=>{var t=Be(),r=v(t,!0);l(t),g(()=>o(r,i.trace.content)),n(e,t)},E=e=>{{let t=_(()=>Q(i.trace));V(e,{get value(){return r(t)},language:`json`,class:`h-full`})}};y(w,e=>{r(B)===`content`?e(T):e(E,-1)}),l(S),l(b),l(t),g(()=>o(f,`${i.trace.role??``} • ${i.trace.medium??``}`)),n(e,t)},a=_(()=>`Conversation: ${i.trace.eventName}`);ee(e,{get title(){return r(a)},class:`!w-[80vw] !max-w-4xl`,get open(){return r(L)},set open(e){h(L,e,!0)},children:t,$$slots:{default:!0}})}};y(Ue,e=>{r(L)&&e(We)});var Ge=C(Ue,2),Ke=e=>{{let t=_(()=>(i.agentId||``).trim());we(e,{get agent(){return r(t)},get seed(){return r(U)},onCreated:_e,get open(){return r(H)},set open(e){h(H,e,!0)}})}};y(Ge,e=>{r(U)&&e(Ke)}),g(()=>be=O(ye,1,`group mb-2 flex w-full items-start`,null,be,{"justify-end":r(G)===`user`||r(G)===`system`})),n(e,ve),t()}e([`pointerdown`,`click`]);var We=a(`<span class="text-[13px] leading-none text-rc-gray-400"> </span>`),Ge=a(`<span><span class="cursor-pointer" title="Show prompt-cache calc"> </span></span>`),Ke=a(`<span> </span>`),qe=a(`<div class="mb-2 ml-7 max-w-[83%]"><button type="button" class="block w-full cursor-pointer overflow-hidden rounded-lg border border-rc-gray-110 bg-rc-gray-800 p-3 text-left hover:bg-rc-gray-700"><pre class="truncate whitespace-pre font-mono text-sm text-rc-gray-100"> </pre></button> <div class="mt-1 flex items-center"><button type="button" class="inline-flex items-center rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-400 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-200 disabled:cursor-not-allowed disabled:opacity-50"> </button></div></div>`),Je=a(`<div class="rounded-md border border-red-500 bg-red-950/40 p-3 font-mono text-sm text-red-200"> </div>`),Ye=a(`<!> <!> <!> <!> <!>`,1),Xe=a(`<div class="flex h-full flex-col gap-2"><div class="grid grid-cols-2 gap-2"><div class="flex items-center justify-start"><!></div> <div class="flex items-center justify-end"><!></div></div> <!></div>`),Ze=a(`<div class="flex flex-col gap-3"><!> <div class="flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-rc-gray-200"><div><span class="text-rc-gray-400">Timing:</span> </div> <div><span class="text-rc-gray-400">Response time:</span> —</div> <div><span class="text-rc-gray-400">Model:</span> </div></div> <div><!> <div class="mt-2 h-[55vh]"><!></div></div></div>`),Qe=a(`<!> <!>`,1),$e=a(`<div class="flex h-[65vh] min-h-0 flex-col gap-2"><!> <div class="min-h-0 flex-1"><!></div></div>`),et=a(`<div class="flex w-full select-text items-baseline gap-2 truncate rounded-md bg-transparent px-2 py-1 text-left text-sm text-rc-gray-200 hover:bg-rc-gray-800/40"><button type="button" class="flex min-w-0 cursor-pointer items-baseline gap-2 truncate bg-transparent p-0 text-left text-sm text-rc-gray-200"><!> <!> <span> </span></button> <!> <!></div> <!> <!> <!> <!>`,1);function tt(e,i){c(i,!0);let a=_(()=>ne().editable),m=f(i,`promptEditProposalId`,3,null),b=f(i,`fallbackConversation`,3,null),T=w(!1),E=w(!1),D=w(`diff`),A=w(`response`),F=w(`idle`),I=w(!1),z=w(null),B=re();S(B.cleanup);function H(e){return e&&typeof e.renderedPrompt==`string`?e.renderedPrompt:null}function U(e,t){if(e===t)return e.length;let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e.charCodeAt(r)!==t.charCodeAt(r))return r;return n}function W(e,t){let n=Math.max(e.length,t.length);if(n===0)return 100;let r=U(e,t);return Math.floor(r/n*100)}function ie(e,t){let n=e.length,r=t.length,i=U(e,t),a=Math.max(n,r);return{currentLength:n,baselineLength:r,commonPrefixLength:i,denom:a,similarityPct:a===0?100:Math.floor(i/a*100)}}function ae(e,t){let n=t?.headChars??600,r=t?.tailChars??600,i=e.slice(0,n),a=e.slice(Math.max(i.length,e.length-r)),o=Math.max(0,e.length-i.length-a.length);return{length:e.length,head:i,tail:a,omittedChars:o}}function G(e){let t=e.llmUsage;return!t||typeof t.promptTokens!=`number`||!Number.isFinite(t.promptTokens)||t.promptTokens<=0||typeof t.cachedPromptTokens!=`number`||!Number.isFinite(t.cachedPromptTokens)||t.cachedPromptTokens<0?null:Math.max(0,Math.min(100,Math.floor(t.cachedPromptTokens/t.promptTokens*100)))}function K(e){let t=new WeakSet;try{return JSON.stringify(e,(e,n)=>{if(typeof n==`bigint`)return n.toString();if(n instanceof Error)return{name:n.name,message:n.message,stack:n.stack};if(typeof n==`object`&&n){if(t.has(n))return`[Circular]`;t.add(n)}return n},2)??``}catch{return String(e)}}function q(e){if(e==null)return``;if(typeof e==`string`){let t=e.trim();if(!t)return``;try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}}return K(e)}function oe(e){let t=q(e),n=t.split(`
|
|
3
|
-
`);if(n.length<=1)return t;let r=n[0]?.trim(),i=n.slice(1).find(e=>e.trim())?.trim();if(!r||!i)return t;let a=r===`[`?`]`:`}`;return n.length===3&&n.at(-1)?.trim()===a?`${r} ${i} ${a}`:`${r} ${i} …${i.endsWith(`{`)?` }`:i.endsWith(`[`)?` ]`:``} ${a}`}function J(e){return new Date(e).toISOString()}function Y(e){if(typeof e!=`number`||!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`}let X=_(()=>Y(i.trace.createdAt)),Z=_(()=>i.trace.error!=null),se=_(()=>`AI: ${i.trace.name}`),ce=_(()=>i.trace.name),Q=_(()=>{if(!R(i.trace.name))return null;let e=H(i.trace),t=H(i.compareTrace);return e==null||t==null?null:W(e,t)}),le=_(()=>R(i.trace.name)?G(i.trace):null),ue=/<break\b[^>]*\/?>/i;function de(e){return typeof e==`string`&&ue.test(e)}let fe=_(()=>R(i.trace.name)?r(le)==null?r(Q)==null?null:r(Q)>=90?{text:`${r(Q)}%`,className:`text-rc-gray-400`}:{text:`${r(Q)}% cached - move dynamic parts of prompt to the bottom`,className:`text-red-200`}:r(le)===0&&r(Q)!=null&&r(Q)>=90?{text:`0% tokens cached. Cache miss`,className:`text-red-200`}:r(le)>=90?{text:`${r(le)}% tokens cached`,className:`text-rc-gray-400`}:{text:`${r(le)}% tokens cached - move dynamic parts of prompt to the bottom`,className:`text-red-200`}:null),$=_(()=>de(i.trace.response)?{text:`LLM output has <break /> tags`,className:`text-red-200`}:null),me=_(()=>{if(!R(i.trace.name))return null;let e=H(i.trace),t=H(i.compareTrace),n=e!=null&&t!=null?ie(e,t):null,a=i.trace.llmUsage??null,o=r(le),s=o===0&&n?.similarityPct!=null&&n.similarityPct>=90;return{version:1,labelSource:o==null?r(Q)==null?`none`:`promptSimilarityFallback`:`llmUsage`,thresholds:{okPct:90,cacheMissSimilarityPct:90},inputs:{llmUsage:a,currentRenderedPrompt:e==null?null:ae(e),baselineRenderedPrompt:t==null?null:ae(t)},computed:{cachedTokensPct:o,promptSimilarityPct:n?.similarityPct??null,promptSimilarity:n,cacheMiss:s},decision:{text:r(fe)?.text??null}}}),he=_(()=>r(me)?K(r(me)):`{}`),ge=_(()=>H(i.compareTrace)??``),_e=_(()=>H(i.trace)??``),ve=_(()=>q(i.trace.response)),ye=_(()=>oe(i.trace.response)),be=_(()=>{if(typeof i.trace.response!=`string`||!i.trace.response.trim())return!1;try{let e=JSON.parse(i.trace.response);return typeof e==`object`&&!!e}catch{return!1}}),xe=_(()=>{let e=i.trace.response;if(typeof e!=`string`)return`json`;try{return JSON.parse(e),`json`}catch{return`text`}}),Se=_(()=>i.trace.stringifiedConversation??``),Ce=_(()=>q(i.trace.renderedPrompt)),Te=_(()=>q(i.trace.receivedPrompt)),Ee=_(()=>q(i.trace.receivedContext)),De=_(()=>q(i.trace.schema)),Oe=_(()=>i.trace.error?K(i.trace.error):``);function ke(e){return e==null?``:typeof e==`string`?e:K(e)}let Ae=_(()=>ke(i.trace.receivedPrompt)),je=_(()=>ke(i.trace.renderedPrompt)),Me=w(null),Ne=w(null);async function Pe(e){try{let t=r(e===`raw`?Ae:je);await navigator.clipboard.writeText(t),h(Me,e,!0),r(Ne)&&clearTimeout(r(Ne)),h(Ne,window.setTimeout(()=>{h(Me,null),h(Ne,null)},2e3),!0)}catch(e){console.error(`Failed to copy prompt`,e)}}function Fe(e,t){let n=new URLSearchParams({step:i.trace.name,test:t});return m()&&n.set(`promptEdit`,m()),`/edit/${encodeURIComponent(e)}/tests?${n.toString()}`}async function Ie(){let e=(i.agentId||``).trim();if(!e||r(F)!==`idle`)return;let t=null;try{let n=pe(i.trace,{fallbackConversation:b(),fallbackRuntimeContext:i.runtimeContext});if(i.testCreationMode===`pii-sanitized`){h(z,n,!0),h(I,!0);return}t=window.open(`about:blank`,`_blank`),t&&(t.opener=null),h(F,`adding`);let r=Fe(e,(await te.tests.addTest.mutate({agent:e,seed:n})).id);t?t.location.replace(r):window.open(r,`_blank`,`noopener`),Le()}catch(e){t?.close(),console.error(`Failed to add step test`,e),h(F,`failed`),window.setTimeout(()=>h(F,`idle`),3e3)}}function Le(){h(F,`added`),window.setTimeout(()=>h(F,`idle`),3e3)}var Re=et(),ze=p(Re),Be=v(ze),Ve=v(Be);{let e=_(()=>r(Z)?`close`:`checkmark`),t=_(()=>r(Z)?`self-center text-red-400`:`self-center text-rc-green-200`);M(Ve,{get name(){return r(e)},width:18,height:18,get class(){return r(t)}})}var He=C(Ve,2),Ue=e=>{var t=We(),i=v(t,!0);l(t),g(()=>o(i,r(X))),n(e,t)};y(He,e=>{r(X)&&e(Ue)});var tt=C(He,2),nt=v(tt);l(tt),l(Be);var rt=C(Be,2),it=e=>{var t=Ge(),i=v(t),a=v(i,!0);l(i),l(t),g(()=>{O(t,1,`shrink-0 text-xs ${r(fe).className}`),o(a,r(fe).text)}),d(`click`,i,e=>{e.stopPropagation(),!B.shouldSuppressClick(e)&&r(me)&&(h(D,`diff`),h(E,!0))}),n(e,t)};y(rt,e=>{r(fe)!=null&&e(it)});var at=C(rt,2),ot=e=>{var t=Ke();x(t,`title`,`<break /> tag disables streaming and increases latency. If pauses are not large enough, use "..." instead.`);var i=v(t,!0);l(t),g(()=>{O(t,1,`shrink-0 text-xs ${r($).className}`),o(i,r($).text)}),n(e,t)};y(at,e=>{r($)!=null&&e(ot)}),l(ze);var st=C(ze,2),ct=e=>{var t=qe(),s=v(t),c=v(s),u=v(c,!0);l(c),l(s);var f=C(s,2),p=v(f),m=v(p,!0);l(p),l(f),l(t),g(e=>{o(u,r(ye)),p.disabled=e,x(p,`title`,r(a)?void 0:`Bosun is running in read-only mode`),o(m,r(F)===`adding`?`Adding…`:r(F)===`added`?`Added`:r(F)===`failed`?`Failed`:`Add test`)},[()=>!r(a)||!i.agentId?.trim()||i.trace.receivedContext===void 0||r(F)!==`idle`||r(I)]),d(`click`,s,()=>{h(A,`response`),h(T,!0)}),d(`click`,p,Ie),n(e,t)};y(st,e=>{r(be)&&e(ct)});var lt=C(st,2),ut=e=>{{let t=_(()=>(i.agentId||``).trim());we(e,{get agent(){return r(t)},get seed(){return r(z)},onCreated:Le,get open(){return r(I)},set open(e){h(I,e,!0)}})}};y(lt,e=>{r(z)&&e(ut)});var dt=C(lt,2),ft=e=>{ee(e,{get title(){return r(se)},class:`!w-[85vw] !max-w-5xl`,get open(){return r(T)},set open(e){h(T,e,!0)},children:e=>{var t=Ze(),a=v(t),c=e=>{var t=Je(),i=v(t,!0);l(t),g(()=>o(i,r(Oe))),n(e,t)};y(a,e=>{r(Oe)&&e(c)});var u=C(a,2),d=v(u),f=C(v(d));l(d);var m=C(d,4),b=C(v(m));l(m),l(u);var x=C(u,2),S=v(x);N(S,{get value(){return r(A)},ariaLabel:`Step trace tabs`,onChange:({value:e})=>h(A,e,!0),children:(e,t)=>{var r=Ye(),i=p(r);P(i,{value:`response`,class:`px-3`,children:(e,t)=>{s();var r=k(`Response`);n(e,r)},$$slots:{default:!0}});var a=C(i,2);P(a,{value:`conversation`,class:`px-3`,children:(e,t)=>{s();var r=k(`Conversation`);n(e,r)},$$slots:{default:!0}});var o=C(a,2);P(o,{value:`prompt`,class:`px-3`,children:(e,t)=>{s();var r=k(`Prompt`);n(e,r)},$$slots:{default:!0}});var c=C(o,2);P(c,{value:`context`,class:`px-3`,children:(e,t)=>{s();var r=k(`Context`);n(e,r)},$$slots:{default:!0}});var l=C(c,2);P(l,{value:`schema`,class:`px-3`,children:(e,t)=>{s();var r=k(`Schema`);n(e,r)},$$slots:{default:!0}}),n(e,r)},$$slots:{default:!0}});var w=C(S,2),T=v(w),E=e=>{V(e,{get value(){return r(ve)},get language(){return r(xe)},class:`h-full`})},D=e=>{V(e,{get value(){return r(Se)},language:`text`,class:`h-full`})},O=e=>{var t=Xe(),i=v(t),a=v(i),c=v(a);{let e=_(()=>!r(Ae).trim());j(c,{variant:`secondary`,size:`small`,get disabled(){return r(e)},onclick:()=>Pe(`raw`),children:(e,t)=>{s();var i=k();g(()=>o(i,r(Me)===`raw`?`Copied raw prompt`:`Copy raw prompt`)),n(e,i)},$$slots:{default:!0}})}l(a);var u=C(a,2),d=v(u);{let e=_(()=>!r(je).trim());j(d,{variant:`secondary`,size:`small`,get disabled(){return r(e)},onclick:()=>Pe(`rendered`),children:(e,t)=>{s();var i=k();g(()=>o(i,r(Me)===`rendered`?`Copied rendered prompt`:`Copy rendered prompt`)),n(e,i)},$$slots:{default:!0}})}l(u),l(i);var f=C(i,2);L(f,{variant:`generic`,get original(){return r(Te)},get modified(){return r(Ce)},language:`markdown`,class:`min-h-0 flex-1`}),l(t),n(e,t)},M=e=>{V(e,{get value(){return r(Ee)},language:`json`,class:`h-full`})},ee=e=>{V(e,{get value(){return r(De)},language:`json`,class:`h-full`})};y(T,e=>{r(A)===`response`?e(E):r(A)===`conversation`?e(D,1):r(A)===`prompt`?e(O,2):r(A)===`context`?e(M,3):e(ee,-1)}),l(w),l(x),l(t),g(e=>{o(f,` ${e??``}`),o(b,` ${i.trace.model??`—`??``}`)},[()=>typeof i.trace.createdAt==`number`?J(i.trace.createdAt):`—`]),n(e,t)},$$slots:{default:!0}})};y(dt,e=>{r(T)&&e(ft)});var pt=C(dt,2),mt=e=>{ee(e,{title:`Prompt cache calc`,class:`!w-[85vw] !max-w-5xl`,get open(){return r(E)},set open(e){h(E,e,!0)},children:e=>{var t=$e(),i=v(t);N(i,{get value(){return r(D)},ariaLabel:`Prompt cache calc tabs`,onChange:({value:e})=>h(D,e,!0),children:(e,t)=>{var r=Qe(),i=p(r);P(i,{value:`diff`,class:`px-3`,children:(e,t)=>{s();var r=k(`Diff`);n(e,r)},$$slots:{default:!0}});var a=C(i,2);P(a,{value:`raw`,class:`px-3`,children:(e,t)=>{s();var r=k(`Raw`);n(e,r)},$$slots:{default:!0}}),n(e,r)},$$slots:{default:!0}});var a=C(i,2),o=v(a),c=e=>{L(e,{variant:`generic`,get original(){return r(ge)},get modified(){return r(_e)},language:`markdown`,class:`h-full`})},u=e=>{V(e,{get value(){return r(he)},language:`json`,class:`h-full`})};y(o,e=>{r(D)===`diff`?e(c):e(u,-1)}),l(a),l(t),n(e,t)},$$slots:{default:!0}})};y(pt,e=>{r(E)&&e(mt)}),g(()=>{O(tt,1,u(r(Z)?`text-red-200`:``)),o(nt,`AI: ${r(ce)??``}`)}),d(`pointerdown`,Be,function(...e){B.onPointerDown?.apply(this,e)}),d(`click`,Be,e=>{B.shouldSuppressClick(e)||h(T,!0)}),n(e,Re),t()}e([`pointerdown`,`click`]);export{Y as a,ue as i,Ue as n,q as o,Q as r,U as s,tt as t};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{G as e,J as t,K as n,St as r,dt as i,pt as a,q as o,r as s,t as c}from"./CPCsWwEy.js";import{i as l,n as u,r as d,t as f}from"./Dt-HX3Vu.js";import"./AvXp07rr.js";new URL(`sveltekit-internal://`);function p(e,t){return e===`/`||t===`ignore`?e:t===`never`?e.endsWith(`/`)?e.slice(0,-1):e:t===`always`&&!e.endsWith(`/`)?e+`/`:e}function ee(e){return e.split(`%25`).map(decodeURI).join(`%25`)}function te(e){for(let t in e)e[t]=decodeURIComponent(e[t]);return e}function m({href:e}){return e.split(`#`)[0]}function h(e,t,n,r=!1){let i=new URL(e);Object.defineProperty(i,"searchParams",{value:new Proxy(i.searchParams,{get(e,r){if(r===`get`||r===`getAll`||r===`has`)return(t,...i)=>(n(t),e[r](t,...i));t();let i=Reflect.get(e,r);return typeof i==`function`?i.bind(e):i}}),enumerable:!0,configurable:!0});let a=[`href`,`pathname`,`search`,`toString`,`toJSON`];r&&a.push(`hash`);for(let n of a)Object.defineProperty(i,n,{get(){return t(),e[n]},enumerable:!0,configurable:!0});return i}function g(){}function ne(...e){let t=5381;for(let n of e)if(typeof n==`string`){let e=n.length;for(;e;)t=t*33^n.charCodeAt(--e)}else if(ArrayBuffer.isView(n)){let e=new Uint8Array(n.buffer,n.byteOffset,n.byteLength),r=e.length;for(;r;)t=t*33^e[--r]}else throw TypeError(`value must be a string or TypedArray`);return(t>>>0).toString(36)}var re=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||`GET`)!==`GET`&&_.delete(b(e)),re(e,t));var _=new Map;function v(e,t){let n=b(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:e,...t}=JSON.parse(r.textContent);r.getAttribute(`data-b64`)!==null&&(e=f(e));let i=r.getAttribute(`data-ttl`);return i&&_.set(n,{body:e,init:t,ttl:1e3*Number(i)}),Promise.resolve(new Response(e,t))}return window.fetch(e,t)}function y(e,t,n){if(_.size>0){let t=b(e,n),r=_.get(t);if(r){if(performance.now()<r.ttl&&[`default`,`force-cache`,`only-if-cached`,void 0].includes(n?.cache))return new Response(r.body,r.init);_.delete(t)}}return window.fetch(t,n)}function b(e,t){let n=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){let e=[];t.headers&&e.push([...new Headers(t.headers)].join(`,`)),t.body&&(typeof t.body==`string`||ArrayBuffer.isView(t.body))&&e.push(t.body),n+=`[data-hash="${ne(...e)}"]`}return n}var x=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/,ie=/^\/\((?:[^)]+)\)$/;function ae(e){let t=[];return{pattern:e===`/`||ie.test(e)?/^\/$/:RegExp(`^${se(e).map(e=>{let n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(e);if(n)return t.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),`(?:/([^]*))?`;let r=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(e);if(r)return t.push({name:r[1],matcher:r[2],optional:!0,rest:!1,chained:!0}),`(?:/([^/]+))?`;if(!e)return;let i=e.split(/\[(.+?)\](?!\])/);return`/`+i.map((e,n)=>{if(n%2){if(e.startsWith(`x+`))return le(String.fromCharCode(parseInt(e.slice(2),16)));if(e.startsWith(`u+`))return le(String.fromCharCode(...e.slice(2).split(`-`).map(e=>parseInt(e,16))));let[,r,a,o,s]=x.exec(e);return t.push({name:o,matcher:s,optional:!!r,rest:!!a,chained:a?n===1&&i[0]===``:!1}),a?`([^]*?)`:r?`([^/]*)?`:`([^/]+?)`}return le(e)}).join(``)}).join(``)}/?$`),params:t}}function oe(e){return e!==``&&!/^\([^)]+\)$/.test(e)}function se(e){return e.slice(1).split(`/`).filter(oe)}function ce(e,t,n){let r={},i=e.slice(1),a=i.filter(e=>e!==void 0),o=0;for(let e=0;e<t.length;e+=1){let s=t[e],c=i[e-o];if(s.chained&&s.rest&&o&&(c=i.slice(e-o,e+1).filter(e=>e).join(`/`),o=0),c===void 0){if(s.rest)c=``;else continue}if(!s.matcher||n[s.matcher](c)){r[s.name]=c;let n=t[e+1],l=i[e+1];n&&!n.rest&&n.optional&&l&&s.chained&&(o=0),!n&&!l&&Object.keys(r).length===a.length&&(o=0);continue}if(s.optional&&s.chained){o++;continue}return}if(!o)return r}function le(e){return e.normalize().replace(/[[\]]/g,`\\$&`).replace(/%/g,`%25`).replace(/\//g,`%2[Ff]`).replace(/\?/g,`%3[Ff]`).replace(/#/g,`%23`).replace(/[.*+?^${}()|\\]/g,`\\$&`)}function ue({nodes:e,server_loads:t,dictionary:n,matchers:r}){let i=new Set(t);return Object.entries(n).map(([t,[n,i,s]])=>{let{pattern:c,params:l}=ae(t),u={id:t,exec:e=>{let t=c.exec(e);if(t)return ce(t,l,r)},errors:[1,...s||[]].map(t=>e[t]),layouts:[0,...i||[]].map(o),leaf:a(n)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function a(t){let n=t<0;return n&&(t=~t),[n,e[t]]}function o(t){return t===void 0?t:[i.has(t),e[t]]}}function de(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function fe(e,t,n=JSON.stringify){let r=n(t);try{sessionStorage[e]=r}catch{}}var S=globalThis.__sveltekit_1t8j96k?.base??``,pe=globalThis.__sveltekit_1t8j96k?.assets??S??``,me=`1789496520453`,he=`sveltekit:snapshot`,ge=`sveltekit:scroll`,_e=`sveltekit:states`,ve=`sveltekit:pageurl`,C=`sveltekit:history`,w=`sveltekit:navigation`,T={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},ye=location.origin;function be(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){let e=document.getElementsByTagName(`base`);t=e.length?e[0].href:document.URL}return new URL(e,t)}function E(){return{x:pageXOffset,y:pageYOffset}}function D(e,t){return e.getAttribute(`data-sveltekit-${t}`)}var xe={...T,"":T.hover};function Se(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Ce(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()===`A`&&e.hasAttribute(`href`))return e;e=Se(e)}}function we(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){let e=location.hash.split(`#`)[1]||`/`;r.hash=`#${e}${r.hash}`}}catch{}let i=e instanceof SVGAElement?e.target.baseVal:e.target,a=!r||!!i||k(r,t,n)||(e.getAttribute(`rel`)||``).split(/\s+/).includes(`external`),o=r?.origin===ye&&e.hasAttribute(`download`);return{url:r,external:a,target:i,download:o}}function O(e){let t=null,n=null,r=null,i=null,a=null,o=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=D(s,`preload-code`)),i===null&&(i=D(s,`preload-data`)),t===null&&(t=D(s,`keepfocus`)),n===null&&(n=D(s,`noscroll`)),a===null&&(a=D(s,`reload`)),o===null&&(o=D(s,`replacestate`)),s=Se(s);function c(e){switch(e){case``:case`true`:return!0;case`off`:case`false`:return!1;default:return}}return{preload_code:xe[r??`off`],preload_data:xe[i??`off`],keepfocus:c(t),noscroll:c(n),reload:c(a),replace_state:c(o)}}function Te(e){let t=r(e),n=!0;function i(){n=!0,t.update(e=>e)}function a(e){n=!1,t.set(e)}function o(e){let r;return t.subscribe(t=>{(r===void 0||n&&t!==r)&&e(r=t)})}return{notify:i,set:a,subscribe:o}}var Ee={v:g};function De(){let{set:e,subscribe:t}=r(!1),n;async function i(){clearTimeout(n);try{let t=await fetch(`${pe}/_app/version.json`,{headers:{pragma:`no-cache`,"cache-control":`no-cache`}});if(!t.ok)return!1;let r=(await t.json()).version!==me;return r&&(e(!0),Ee.v(),clearTimeout(n)),r}catch{return!1}}return{subscribe:t,check:i}}function k(e,t,n){return e.origin!==ye||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Oe(e){}var ke=2**32-1-1,Ae=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function je(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getPrototypeOf(t)===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Ae}function Me(e){return Object.prototype.toString.call(e).slice(8,-1)}function Ne(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)}function Pe(e){return!(!Number.isInteger(e)||e<0||e>ke)}function Fe(e){if(e.length===0||e.length>1&&e.charCodeAt(0)===48)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<48||n>57)return!1}return Pe(+e)}function Ie(e){for(var t=e.length-1;t>=0&&!Fe(e[t]);t--);return t+1}function Le(e){let t=Object.keys(e);return t.length=Ie(t),t}Uint8Array.fromBase64,typeof process==`object`&&process.versions?.node;var Re=Object.freeze({kind:`not-plain`}),ze=Object.freeze({kind:`symbol-keys`});Object.freeze({identify:e=>e,typeOf:e=>e===null?`null`:typeof e,toPrimitive:e=>e,tagOf:e=>Me(e),isThenable:e=>typeof e.then==`function`,toPromise:e=>Promise.resolve(e),unbox:e=>e.valueOf(),toISOString:e=>isNaN(e.getDate())?``:e.toISOString(),toStringValue:e=>e.toString(),regExpInfo:e=>({source:e.source,flags:e.flags}),valuesOf:e=>e,entriesOf:e=>e,viewInfo:e=>({buffer:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength,length:e.length,bufferByteLength:e.buffer.byteLength}),toArrayBuffer:e=>e,lengthOf:e=>e.length,hasOwn:(e,t)=>Object.hasOwn(e,t),indicesOf:e=>Le(e),shapeOf:e=>je(e)?Ne(e).length>0?ze:{kind:Object.getPrototypeOf(e)===null?`null-proto`:`plain`,keys:Object.keys(e)}:Re,get:(e,t)=>e[t]}),Object.freeze({fromPrimitive:e=>e,fromISOString:e=>new Date(e),fromStringValue:(e,t)=>e===`URL`?new URL(t):e===`URLSearchParams`?new URLSearchParams(t):Temporal[e.slice(9)].from(t),fromArrayBuffer:e=>e,fromRegExpInfo:(e,t)=>new RegExp(e,t),fromViewInfo:(e,t,n,r)=>{let i=globalThis[e];return n===void 0?new i(t):new i(t,n,r)},box:e=>Object(e),createArray:e=>Array(e),createSparseArray:e=>{let t=[];return t[ke]=void 0,delete t[ke],t.length=e,t},createObject:()=>({}),createNullPrototypeObject:()=>Object.create(null),createSet:()=>new Set,createMap:()=>new Map,set:(e,t,n)=>{e[t]=n},addValue:(e,t)=>{e.add(t)},addEntry:(e,t,n)=>{e.set(t,n)}});var Be=new Set([`load`,`prerender`,`csr`,`ssr`,`trailingSlash`,`config`]);[...Be],[...new Set([...Be])];function Ve(e){return e.filter(e=>e!=null)}function A(e,t){return e+`/`+t}function He(e){return e instanceof u||e instanceof l?e.status:500}function Ue(e){return e instanceof l?e.text:`Internal Error`}var j,M,We,Ge=s.toString().includes(`$$`)||/function \w+\(\) \{\}/.test(s.toString()),Ke=`a:`;Ge?(j={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Ke)},M={current:null},We={current:!1}):(j=new class{#e=a({});get data(){return e(this.#e)}set data(e){i(this.#e,e)}#t=a(null);get form(){return e(this.#t)}set form(e){i(this.#t,e)}#n=a(null);get error(){return e(this.#n)}set error(e){i(this.#n,e)}#r=a({});get params(){return e(this.#r)}set params(e){i(this.#r,e)}#i=a({id:null});get route(){return e(this.#i)}set route(e){i(this.#i,e)}#a=a({});get state(){return e(this.#a)}set state(e){i(this.#a,e)}#o=a(-1);get status(){return e(this.#o)}set status(e){i(this.#o,e)}#s=a(new URL(Ke));get url(){return e(this.#s)}set url(e){i(this.#s,e)}},M=new class{#e=a(null);get current(){return e(this.#e)}set current(e){i(this.#e,e)}},We=new class{#e=a(!1);get current(){return e(this.#e)}set current(e){i(this.#e,e)}},Ee.v=()=>We.current=!0);function qe(e){Object.assign(j,e)}var Je={spanContext(){return Ye},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Ye={traceId:``,spanId:``,traceFlags:0},{onMount:Xe,tick:Ze}=c,Qe=t??(e=>e()),$e=new Set([`icon`,`shortcut icon`,`apple-touch-icon`]),N=null,P=de(`sveltekit:scroll`)??{},F=de(`sveltekit:snapshot`)??{},I={url:Te({}),page:Te({}),navigating:r(null),updated:De()};function et(e){P[e]=E()}function tt(e,t){let n=e+1;for(;P[n];)delete P[n],n+=1;for(n=t+1;F[n];)delete F[n],n+=1}function L(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(g)}async function nt(){if(`serviceWorker`in navigator){let e=await navigator.serviceWorker.getRegistration(S||`/`);e&&await e.update()}}var rt,it,R,z,at,B,ot={},st={},V=[],ct=[],H=null;function lt(){H?.fork?.then(e=>e?.discard()),H=null,Q={element:void 0,href:void 0}}var ut=new Map,dt=new Set,ft=new Set,U=new Set,W={branch:[],error:null,url:null,nav:null},pt=!1,mt=!1,ht=!0,G=!1,K=!1,gt=!1,_t=!1,vt,q,J,Y,yt=new Set,bt=new Map,xt=new Map;async function St(e,t,n){if(globalThis.__sveltekit_1t8j96k.data){let{q:e={},p:t={},l:n={},f:r={}}=globalThis.__sveltekit_1t8j96k.data;for(let t in e)ot[t]=e[t];for(let e in n)ot[e]=n[e];for(let e in r)ot[e]=r[e];for(let e in t)st[e]=t[e]}document.URL!==location.href&&(location.href=location.href),B=e,await e.hooks.init?.(),rt=ue(e),z=document.documentElement,at=t,it=e.nodes[0],R=e.nodes[1],it(),R(),q=history.state?.[C],J=history.state?.[w],q||(q=J=Date.now(),history.replaceState({...history.state,[C]:q,[w]:J},``));let r=P[q];function i(){r&&(history.scrollRestoration=`manual`,scrollTo(r.x,r.y))}n?(i(),await Zt(at,n)):(await Z({type:`enter`,url:be(B.hash?rn(new URL(location.href)):location.href),replace_state:!0}),i()),Xt()}function Ct(){V.length=0,_t=!1}function wt(e){ct.some(e=>e?.snapshot)&&(F[e]=ct.map(e=>e?.snapshot?.capture()))}function Tt(e){F[e]?.forEach((e,t)=>{ct[t]?.snapshot?.restore(e)})}function Et(){et(q),fe(ge,P),wt(J),fe(he,F)}async function Dt(e,t,n,r){let i,a;t.invalidateAll&<(),await Z({type:`goto`,url:be(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{if(t.invalidateAll){_t=!0,i=new Set;for(let[e,t]of bt)for(let[n,r]of t)r.resource?.reset(),i.add(A(e,n));a=new Set;for(let[e,t]of xt)for(let n of t.keys())a.add(A(e,n))}t.invalidate&&t.invalidate.forEach(Jt)}}),t.invalidateAll&&o().then(o).then(()=>{for(let[e,t]of bt)for(let[n,{resource:r}]of t)i?.has(A(e,n))&&r.start();for(let[e,t]of xt)for(let[n,{resource:r}]of t)a?.has(A(e,n))&&r.reconnect()})}async function Ot(e){if(e.id!==H?.id){lt();let t={};yt.add(t),H={id:e.id,token:t,promise:Rt({...e,preload:t}).then(e=>(yt.delete(t),e.type===`loaded`&&e.state.error&<(),e)),fork:null}}return H.promise}async function kt(e){let t=(await Ht(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(e=>e[1]()))}async function At(e,t,n){let r={params:W.params,route:{id:W.route?.id??null},url:new URL(location.href)};if(W={...e.state,nav:r},qe(e.props.page),vt=new B.root({target:t,props:{...e.props,stores:I,components:ct},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),n){let e={from:null,to:{...r,scroll:P[q]??E()},willUnload:!1,type:`enter`,complete:Promise.resolve()};U.forEach(t=>t(e))}Tt(J),mt=!0}async function jt({url:e,params:t,branch:n,errors:r,status:i,error:a,route:o,form:s}){let c=`never`;if(S&&(e.pathname===S||e.pathname===S+`/`))c=`always`;else for(let e of n)e?.slash!==void 0&&(c=e.slash);e.pathname=p(e.pathname,c),e.search=e.search;let l={type:`loaded`,state:{url:e,params:t,branch:n,error:a,route:o},props:{constructors:Ve(n).map(e=>e.node.component),page:nn(j)}};s!==void 0&&(l.props.form=s);let u={},d=!j,f=0;for(let e=0;e<Math.max(n.length,W.branch.length);e+=1){let t=n[e],r=W.branch[e];t?.data!==r?.data&&(d=!0),t&&(u={...u,...t.data},d&&(l.props[`data_${f}`]=u),f+=1)}return(!W.url||e.href!==W.url.href||W.error!==a||s!==void 0&&s!==j.form||d)&&(l.props.page={error:a,params:t,route:{id:o?.id??null},state:{},status:i,url:new URL(e),form:s??null,data:d?u:j.data}),l}async function Mt({loader:e,parent:t,url:n,params:r,route:i,server_data_node:a}){let o=null,s=!0,c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},l=await e();if(l.universal?.load){function e(...e){for(let t of e){let{href:e}=new URL(t,n);c.dependencies.add(e)}}let u={tracing:{enabled:!1,root:Je,current:Je},route:new Proxy(i,{get:(e,t)=>(s&&(c.route=!0),e[t])}),params:new Proxy(r,{get:(e,t)=>(s&&c.params.add(t),e[t])}),data:a?.data??null,url:h(n,()=>{s&&(c.url=!0)},e=>{s&&c.search_params.add(e)},B.hash),async fetch(t,r){t instanceof Request&&(r={body:t.method===`GET`||t.method===`HEAD`?void 0:await t.blob(),cache:t.cache,credentials:t.credentials,headers:[...t.headers].length>0?t?.headers:void 0,integrity:t.integrity,keepalive:t.keepalive,method:t.method,mode:t.mode,redirect:t.redirect,referrer:t.referrer,referrerPolicy:t.referrerPolicy,signal:t.signal,...r});let{resolved:i,promise:a}=Nt(t,r,n);return s&&e(i.href),a},setHeaders:g,depends:e,parent(){return s&&(c.parent=!0),t()},untrack(e){s=!1;try{return e()}finally{s=!0}}};o=await l.universal.load.call(null,u)??null}return{node:l,loader:e,server:a,universal:l.universal?.load?{type:`data`,data:o,uses:c}:null,data:o??a?.data??null,slash:l.universal?.trailingSlash??a?.slash}}function Nt(e,t,n){let r=e instanceof Request?e.url:e,i=new URL(r,n);return i.origin===n.origin&&(r=i.href.slice(n.origin.length)),{resolved:i,promise:mt?y(r,i.href,t):v(r,t)}}function Pt(e,t,n,r,i,a){if(_t)return!0;if(!i)return!1;if(i.parent&&e||i.route&&t||i.url&&n)return!0;for(let e of i.search_params)if(r.has(e))return!0;for(let e of i.params)if(a[e]!==W.params[e])return!0;for(let e of i.dependencies)if(V.some(t=>t(new URL(e))))return!0;return!1}function Ft(e,t){return e?.type===`data`?e:e?.type===`skip`?t??null:null}function It(e,t){if(!e)return new Set(t.searchParams.keys());let n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(let r of n){let i=e.searchParams.getAll(r),a=t.searchParams.getAll(r);i.every(e=>a.includes(e))&&a.every(e=>i.includes(e))&&n.delete(r)}return n}function Lt({error:e,url:t,route:n,params:r}){return{type:`loaded`,state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:nn(j),constructors:[]}}}async function Rt({id:e,invalidating:t,url:n,params:r,route:i,preload:a}){if(H?.id===e)return yt.delete(H.token),H.promise;let{errors:o,layouts:s,leaf:c}=i,l=[...s,c];o.forEach(e=>e?.().catch(g)),l.forEach(e=>e?.[1]().catch(g));let f=W.url?e!==X(W.url):!1,p=W.route?i.id!==W.route.id:!1,ee=It(W.url,n),te=!1,m=l.map(async(e,t)=>{if(!e)return;let a=W.branch[t];return e[1]===a?.loader&&!Pt(te,p,f,ee,a.universal?.uses,r)?a:(te=!0,Mt({loader:e[1],url:n,params:r,route:i,parent:async()=>{let e={};for(let n=0;n<t;n+=1)Object.assign(e,(await m[n])?.data);return e},server_data_node:Ft(e[0]?{type:`skip`}:null,e[0]?a?.server:void 0)}))});for(let e of m)e.catch(g);let h=[];for(let e=0;e<l.length;e+=1)if(l[e])try{h.push(await m[e])}catch(t){if(t instanceof d)return{type:`redirect`,location:t.location};if(a&&yt.has(a))return Lt({error:await $(t,{params:r,url:n,route:{id:i.id}}),url:n,params:r,route:i});let s=He(t),c;if(t instanceof u)c=t.body;else{if(await I.updated.check())return await nt(),await L(n);c=await $(t,{params:r,url:n,route:{id:i.id}})}let l=await zt(e,h,o);return l?jt({url:n,params:r,branch:h.slice(0,l.idx).concat(l.node),errors:o,status:s,error:c,route:i}):await Gt(n,{id:i.id},c,s)}else h.push(void 0);return jt({url:n,params:r,branch:h,errors:o,status:200,error:null,route:i,form:t?void 0:null})}async function zt(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)--r;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function Bt({status:e,error:t,url:n,route:r}){let i={};try{return jt({url:n,params:i,branch:[await Mt({loader:it,url:n,params:i,route:r,parent:()=>Promise.resolve({}),server_data_node:Ft(null)}),{node:await R(),loader:R,universal:null,server:null,data:null}],status:e,error:t,errors:[],route:null})}catch(t){if(t instanceof d){await Dt(new URL(t.location,location.href),{},0);return}let a=await B.get_error_template(),o=await $(t,{url:n,params:i,route:r}),s=a({status:e,message:String(o?.message??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}),c=new DOMParser().parseFromString(s,`text/html`);throw document.documentElement.replaceChild(document.adoptNode(c.head),document.head),document.documentElement.replaceChild(document.adoptNode(c.body),document.body),t}}async function Vt(e){let t=e.href;if(ut.has(t))return ut.get(t);let n;try{let r=(async()=>{let t=await B.hooks.reroute({url:new URL(e),fetch:async(t,n)=>Nt(t,n,e).promise})??e;if(typeof t==`string`){let n=new URL(e);B.hash?n.hash=t:n.pathname=t,t=n}return t})();ut.set(t,r),n=await r}catch{ut.delete(t);return}return n}async function Ht(e,t){if(e&&!k(e,S,B.hash)){let n=await Vt(e);if(!n)return;let r=Ut(n);for(let n of rt){let i=n.exec(r);if(i)return{id:X(e),invalidating:t,route:n,params:te(i),url:e}}}}function Ut(e){return ee(B.hash?e.hash.replace(/^#/,``).replace(/[?#].+/,``):e.pathname.slice(S.length))||`/`}function X(e){return(B.hash?e.hash.replace(/^#/,``):e.pathname)+e.search}function Wt({url:e,type:t,intent:n,delta:r,event:i,scroll:a}){let o=!1,s=tn(W,n,e,t,a??null);r!==void 0&&(s.navigation.delta=r),i!==void 0&&(s.navigation.event=i);let c={...s.navigation,cancel:()=>{o=!0,s.reject(Error(`navigation cancelled`))}};return G||dt.forEach(e=>e(c)),o?null:s}async function Z({type:e,url:t,popped:r,keepfocus:i,noscroll:a,replace_state:s,state:c={},redirect_count:u=0,nav_token:d={},accept:f=g,block:p=g,event:ee}){let te=Y;Y=d;let m=await Ht(t,!1),h=e===`enter`?tn(W,m,t,e):Wt({url:t,type:e,delta:r?.delta,intent:m,scroll:r?.scroll,event:ee});if(!h){p(),Y===d&&(Y=te);return}let ne=q,re=J;f(),G=!0,mt&&h.navigation.type!==`enter`&&I.navigating.set(M.current=h.navigation);let _=m&&await Rt(m);if(!_){if(k(t,S,B.hash))return await L(t,s);_=await Gt(t,{id:null},await $(new l(404,`Not Found`,`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=m?.url||t,Y!==d){h.reject(Error(`navigation aborted`));return}if(!_)return;if(_.type===`redirect`){if(u<20){await Z({type:e,url:new URL(_.location,t),popped:r,keepfocus:i,noscroll:a,replace_state:s,state:c,redirect_count:u+1,nav_token:d}),h.fulfil(void 0);return}if(_=await Bt({status:500,error:await $(Error(`Redirect loop`),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}}),!_)return}else if(_.props.page.status>=400&&await I.updated.check())return await nt(),await L(t,s);if(Ct(),et(ne),wt(re),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),c=r?r.state:c,!r){let e=+!s,n={[C]:q+=e,[w]:J+=e,[_e]:c};(s?history.replaceState:history.pushState).call(history,n,``,t),s||tt(q,J)}let v=m&&H?.id===m.id?H.fork:null;H?.fork&&!v?lt():(H=null,Q={element:void 0,href:void 0}),_.props.page.state=c;let y;if(mt){let e=(await Promise.all(Array.from(ft,e=>e(h.navigation)))).filter(e=>typeof e==`function`);if(e.length>0){function t(){e.forEach(e=>{U.delete(e)})}e.push(t),e.forEach(e=>{U.add(e)})}let r=h.navigation.to;W={..._.state,nav:{params:r.params,route:r.route,url:r.url}},_.props.page&&(_.props.page.url=t),!i&&document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur();let a=v&&await v;a?y=a.commit():(N=null,vt.$set(_.props),N&&Object.assign(_.props.page,N),qe(_.props.page),y=n?.()),gt=!0}else await At(_,at,!1);let{activeElement:b}=document;if(await y,await o(),await o(),Y!==d){h.reject(Error(`navigation aborted`));return}_.props.page&&N&&Object.assign(_.props.page,N);let x=null;if(ht){let e=r?r.scroll:a?E():null;e?scrollTo(e.x,e.y):(x=t.hash&&document.getElementById(an(t)))?x.scrollIntoView():scrollTo(0,0)}let ie=document.activeElement!==b&&document.activeElement!==document.body;!i&&!ie&&en(t,!x),ht=!0,G=!1,h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=E()),U.forEach(e=>e(h.navigation)),e===`popstate`&&Tt(J),I.navigating.set(M.current=null)}async function Gt(e,t,n,r,i){return e.origin===ye&&e.pathname===location.pathname&&!pt?await Bt({status:r,error:n,url:e,route:t}):await L(e,i)}var Q={element:void 0,href:void 0};function Kt(){let e,t;z.addEventListener(`mousemove`,t=>{let n=t.target;clearTimeout(e),e=setTimeout(()=>{i(n,T.hover)},20)});function n(e){e.defaultPrevented||i(e.composedPath()[0],T.tap)}z.addEventListener(`mousedown`,n),z.addEventListener(`touchstart`,n,{passive:!0});let r=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&(kt(new URL(t.target.href)),r.unobserve(t.target))},{threshold:0});async function i(e,n){let r=Ce(e,z),i=r===Q.element&&r?.href===Q.href&&n>=t;if(!r||i)return;let{url:a,external:o,download:s}=we(r,S,B.hash);if(o||s)return;let c=O(r),l=a&&X(W.url)===X(a);if(!(c.reload||l)){if(n<=c.preload_data){Q={element:r,href:r.href},t=T.tap;let e=await Ht(a,!1);if(!e)return;Ot(e)}else n<=c.preload_code&&(Q={element:r,href:r.href},t=n,kt(a))}}function a(){r.disconnect();for(let e of z.querySelectorAll(`a`)){let{url:t,external:n,download:i}=we(e,S,B.hash);if(n||i)continue;let a=O(e);a.reload||(a.preload_code===T.viewport&&r.observe(e),a.preload_code===T.eager&&kt(t))}}U.add(a),a()}function $(e,t){if(e instanceof u)return e.body;let n=He(e),r=Ue(e);return B.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function qt(e,t={}){return e=new URL(be(e)),e.origin===ye?Dt(e,t,0):Promise.reject(Error(`goto: invalid URL`))}function Jt(e){if(typeof e==`function`)V.push(e);else{let{href:t}=new URL(e,location.href);V.push(e=>e.href===t)}}function Yt(e,t){let n={[C]:q,[w]:J,[ve]:j.url.href,[_e]:t};history.replaceState(n,``,be(e)),j.state=t,vt.$set({page:Qe(()=>nn(j))})}function Xt(){history.scrollRestoration=`manual`,addEventListener(`beforeunload`,e=>{let t=!1;if(Et(),!G){let e=tn(W,void 0,null,`leave`),n={...e.navigation,cancel:()=>{t=!0,e.reject(Error(`navigation cancelled`))}};dt.forEach(e=>e(n))}t?(e.preventDefault(),e.returnValue=``):history.scrollRestoration=`auto`}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&Et()}),navigator.connection?.saveData||Kt(),z.addEventListener(`click`,async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;let n=Ce(t.composedPath()[0],z);if(!n)return;let{url:r,external:i,target:a,download:o}=we(n,S,B.hash);if(!r)return;if(a===`_parent`||a===`_top`){if(window.parent!==window)return}else if(a&&a!==`_self`)return;let s=O(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&r.protocol!==`https:`&&r.protocol!==`http:`||o)return;let[c,l]=(B.hash?r.hash.replace(/^#/,``):r.href).split(`#`),u=c===m(location);if(i||s.reload&&(!u||!l)){Wt({url:r,type:`link`,event:t})?G=!0:t.preventDefault();return}if(l!==void 0&&u){let[,i]=W.url.href.split(`#`);if(i===l){if(t.preventDefault(),l===``||l===`top`&&n.ownerDocument.getElementById(`top`)===null)scrollTo({top:0});else{let e=n.ownerDocument.getElementById(decodeURIComponent(l));e&&(e.scrollIntoView(),e.focus())}return}if(K=!0,et(q),e(r),!s.replace_state)return;K=!1}t.preventDefault(),await new Promise(e=>{requestAnimationFrame(()=>{setTimeout(e,0)}),setTimeout(e,100)}),await Z({type:`link`,url:r,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??r.href===location.href,event:t})}),z.addEventListener(`submit`,e=>{if(e.defaultPrevented)return;let t=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if((n?.formTarget||t.target)===`_blank`||(n?.formMethod||t.method)!==`get`)return;let r=new URL(n?.hasAttribute(`formaction`)&&n?.formAction||t.action);if(k(r,S,!1))return;let i=e.target,a=O(i);if(a.reload)return;e.preventDefault(),e.stopPropagation();let o=new FormData(i,n);r.search=new URLSearchParams(o).toString(),Z({type:`form`,url:r,keepfocus:a.keepfocus,noscroll:a.noscroll,replace_state:a.replace_state??r.href===location.href,event:e})}),addEventListener(`popstate`,async t=>{if(!$t){if(t.state?.[`sveltekit:history`]){let n=t.state[C];if(Y={},n===q)return;let r=P[n],i=t.state[`sveltekit:states`]??{},a=new URL(t.state[`sveltekit:pageurl`]??location.href),o=t.state[w],s=W.url?m(location)===m(W.url):!1;if(o===J&&(gt||s)){i!==j.state&&(j.state=i),e(a),P[q]=E(),r&&scrollTo(r.x,r.y),q=n;return}let c=n-q;await Z({type:`popstate`,url:a,popped:{state:i,scroll:r,delta:c},accept:()=>{q=n,J=o},block:()=>{history.go(-c)},nav_token:Y,event:t})}else K||(e(new URL(location.href)),B.hash&&location.reload())}}),addEventListener(`hashchange`,()=>{K&&(K=!1,history.replaceState({...history.state,[C]:++q,[w]:J},``,location.href))});for(let e of document.querySelectorAll(`link`))$e.has(e.rel)&&(e.href=e.href);addEventListener(`pageshow`,e=>{e.persisted&&I.navigating.set(M.current=null)});function e(e){W.url=j.url=e,I.page.set(nn(j)),I.page.notify()}}async function Zt(e,{status:t=200,error:n,node_ids:r,params:i,route:a,server_route:o,data:s,form:c}){pt=!0;let l=new URL(location.href),u;({params:i={},route:a={id:null}}=await Ht(l,!1)||{}),u=rt.find(({id:e})=>e===a.id);let f,p=!0;try{let e=r.map(async(t,n)=>{let r=s[n];return r?.uses&&(r.uses=Qt(r.uses)),Mt({loader:B.nodes[t],url:l,params:i,route:a,parent:async()=>{let t={};for(let r=0;r<n;r+=1)Object.assign(t,(await e[r]).data);return t},server_data_node:Ft(r)})}),o=await Promise.all(e);if(u){let e=u.layouts;for(let t=0;t<e.length;t++)e[t]||o.splice(t,0,void 0)}f=await jt({url:l,params:i,branch:o,status:t,error:n,errors:u?.errors,form:c,route:u??null})}catch(t){if(t instanceof d)return await L(new URL(t.location,location.href));f=await Bt({status:He(t),error:await $(t,{url:l,params:i,route:a}),url:l,route:a}),e.textContent=``,p=!1}f&&(f.props.page&&(f.props.page.state={}),await At(f,e,p))}function Qt(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}var $t=!1;function en(e,t=!0){let n=document.querySelector(`[autofocus]`);if(n)n.focus();else{let n=an(e);if(n&&document.getElementById(n)){let{x:r,y:i}=E();setTimeout(()=>{let a=history.state;$t=!0,location.replace(new URL(`#${n}`,location.href)),history.replaceState(a,``,e),t&&scrollTo(r,i),$t=!1})}else{let e=document.body,t=e.getAttribute(`tabindex`);e.tabIndex=-1,e.focus({preventScroll:!0,focusVisible:!1}),t===null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,t)}let r=getSelection();if(r&&r.type!==`None`){let e=[];for(let t=0;t<r.rangeCount;t+=1)e.push(r.getRangeAt(t));setTimeout(()=>{if(r.rangeCount===e.length){for(let t=0;t<r.rangeCount;t+=1){let n=e[t],i=r.getRangeAt(t);if(n.commonAncestorContainer!==i.commonAncestorContainer||n.startContainer!==i.startContainer||n.endContainer!==i.endContainer||n.startOffset!==i.startOffset||n.endOffset!==i.endOffset)return}r.removeAllRanges()}})}}}function tn(e,t,n,r,i=null){let a,o,s=new Promise((e,t)=>{a=e,o=t});return s.catch(g),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:E()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:i},willUnload:!t,type:r,complete:s},fulfil:a,reject:o}}function nn(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function rn(e){let t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function an(e){let t;if(B.hash){let[,,n]=e.hash.split(`#`,3);t=n??``}else t=e.hash.slice(1);return decodeURIComponent(t)}export{M as a,I as i,Yt as n,j as o,St as r,Oe as s,qt as t};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./jbAfpNOj.js";
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,s as t}from"../chunks/jbAfpNOj.js";export{t as load_css,e as start};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
�(�import{r as e,s as t}from"../chunks/jbAfpNOj.js";export{t as load_css,e as start};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|