clay-server 5.3.0 → 5.3.1-beta.1
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/lib/pane-session-transport.js +3 -0
- package/lib/project-worker-proposal.js +1 -2
- package/lib/public/modules/pane-activation.js +1 -0
- package/lib/public/modules/pane-header-tooltips.js +1 -1
- package/lib/public/modules/split-pane-renderer.js +5 -0
- package/lib/public/modules/worker-created-presentation.js +3 -1
- package/lib/public/pane-assets/{app-5W6KJXK5.js → app-DR227IBJ.js} +1 -1
- package/lib/public/pane-assets/{chunk-7OVNC5HT.js → chunk-3CQA7ZCS.js} +1 -1
- package/lib/public/pane-assets/chunk-3SZABBN7.js +1 -0
- package/lib/public/pane-assets/{chunk-SJTGHIN5.js → chunk-3VNXCTTY.js} +1 -1
- package/lib/public/pane-assets/{chunk-SLMAFKI2.js → chunk-4KFYASLC.js} +1 -1
- package/lib/public/pane-assets/{chunk-SJOT74VW.js → chunk-5P3D2RTQ.js} +1 -1
- package/lib/public/pane-assets/chunk-A3MDESCE.js +1 -0
- package/lib/public/pane-assets/{chunk-FQTNR4ZS.js → chunk-FK43VMMW.js} +1 -1
- package/lib/public/pane-assets/{chunk-2IJUTAB6.js → chunk-G6ZL6VPR.js} +1 -1
- package/lib/public/pane-assets/chunk-GMASVOWL.js +1 -0
- package/lib/public/pane-assets/{chunk-MZLMEXMW.js → chunk-HQUGZW4P.js} +1 -1
- package/lib/public/pane-assets/{chunk-ENPAHXLB.js → chunk-KWUKYV6X.js} +1 -1
- package/lib/public/pane-assets/{chunk-EPBGGZRT.js → chunk-LA7KKFI2.js} +1 -1
- package/lib/public/pane-assets/{chunk-VEBYD7TL.js → chunk-LLBLEJM4.js} +1 -1
- package/lib/public/pane-assets/{chunk-UPXU2IPC.js → chunk-MLNNDUPE.js} +1 -1
- package/lib/public/pane-assets/chunk-MOSMN3CU.js +1 -0
- package/lib/public/pane-assets/chunk-MUAMABNY.js +1 -0
- package/lib/public/pane-assets/chunk-TABMZ63N.js +1 -0
- package/lib/public/pane-assets/chunk-TEHDJOM4.js +1 -0
- package/lib/public/pane-assets/{chunk-OG3E5SVA.js → chunk-UNTZB4WP.js} +49 -49
- package/lib/public/pane-assets/{chunk-BQN7B62H.js → chunk-UQPN3SQX.js} +1 -1
- package/lib/public/pane-assets/{chunk-MGTFTEJP.js → chunk-WQE7BLFG.js} +1 -1
- package/lib/public/pane-assets/{chunk-XBHYNXXT.js → chunk-XFUKDMBX.js} +1 -1
- package/lib/public/pane-assets/{chunk-EMLN2Y7L.js → chunk-YU4R2HSO.js} +1 -1
- package/lib/public/pane-assets/manifest.json +378 -378
- package/package.json +1 -1
- package/lib/public/pane-assets/chunk-EYTE56IA.js +0 -1
- package/lib/public/pane-assets/chunk-L6LSA5WI.js +0 -1
- package/lib/public/pane-assets/chunk-M57UIGZV.js +0 -1
- package/lib/public/pane-assets/chunk-MMG6MYCN.js +0 -1
- package/lib/public/pane-assets/chunk-RGAFZ3T2.js +0 -1
- package/lib/public/pane-assets/chunk-RNDRURMF.js +0 -1
- package/lib/public/pane-assets/chunk-U3I5KY3B.js +0 -1
|
@@ -16,6 +16,9 @@ function run(ws, msg, dispatch) {
|
|
|
16
16
|
// provider events instead supply their authoritative source session explicitly.
|
|
17
17
|
function outbound(ws, message, sessionId) {
|
|
18
18
|
if (!message || message.paneActivation || /^pane_activation_/.test(message.type)) return message;
|
|
19
|
+
// Owner-filtered project metadata must reach panes after membership changes,
|
|
20
|
+
// including the connection whose previous binding the mutation invalidated.
|
|
21
|
+
if (message.type === 'split_groups' || message.type === 'session_list') return message;
|
|
19
22
|
var scope = requests.getStore();
|
|
20
23
|
var binding = sessionId === undefined ? scope && scope.ws === ws && scope.binding : ws._clayPaneActivation;
|
|
21
24
|
if (!binding) return message;
|
|
@@ -123,7 +123,6 @@ function attachWorkerProposal(ctx) {
|
|
|
123
123
|
var models = options.modelsByVendor[vendor] || [];
|
|
124
124
|
var model = modelIsAvailable(options, vendor, args.recommendedModel) ? (args.recommendedModel || "") : "";
|
|
125
125
|
var currentModel = session.model || (sm.defaultModelByVendor || {})[session.vendor || "claude"] || "";
|
|
126
|
-
if (vendor === session.vendor && model === currentModel) model = "";
|
|
127
126
|
if (!model && models.length > 0) {
|
|
128
127
|
for (var j = 0; j < models.length; j++) {
|
|
129
128
|
if (vendor === session.vendor && modelValue(models[j]) === currentModel) continue;
|
|
@@ -371,7 +370,7 @@ function attachWorkerProposal(ctx) {
|
|
|
371
370
|
});
|
|
372
371
|
ctx.recordGenerationStart(session, created.worker);
|
|
373
372
|
updateProposal(session, proposal, { status: "running", groupId: created.group.id, workerId: created.worker.localId });
|
|
374
|
-
|
|
373
|
+
sm.sendToSession(session, { type: "pair_session_created", ok: true, group: created.group });
|
|
375
374
|
runWorker(session, proposal).catch(function (err) {
|
|
376
375
|
updateProposal(session, proposal, { status: "error", error: err.message || String(err) });
|
|
377
376
|
resumeDriver(session, "[Split Worker execution failed]\n" + (err.message || String(err))).catch(function () {});
|
|
@@ -250,6 +250,7 @@ export function initPaneActivation() {
|
|
|
250
250
|
if (state.connected && (state.splitGroups !== previous.splitGroups || state.splitGroupsProjectSlug !== previous.splitGroupsProjectSlug || state.paneBindingSessions !== previous.paneBindingSessions || state.authIdentityLoaded !== previous.authIdentityLoaded || state.myUserId !== previous.myUserId || state.activeSessionId !== previous.activeSessionId || state.connected !== previous.connected)) {
|
|
251
251
|
queueMicrotask(function () {
|
|
252
252
|
refreshPaneActivation();
|
|
253
|
+
frame.dispatchEvent(new window.parent.CustomEvent('clay-pane-metadata-ready'));
|
|
253
254
|
if (!store.get('panePendingBinding') && !store.get('paneSuspended')) {
|
|
254
255
|
if (store.get('panePinPending')) primePaneSession();
|
|
255
256
|
else if (store.get('activeSessionId') === store.get('paneSessionId')) activatePaneSession(store.get('paneSessionId'));
|
|
@@ -4,7 +4,7 @@ import { registerTooltip, pruneTooltip } from './tooltip.js';
|
|
|
4
4
|
var HEADERS = '.split-pane-header, .tool-pane-header, .file-viewer-tabbar, .terminal-header, .shared-browser-header, .split-view-workers, #top-bar .top-bar-actions';
|
|
5
5
|
function sync(header) {
|
|
6
6
|
header.querySelectorAll('[title], button, [role="button"], a[aria-label]').forEach(function (element) {
|
|
7
|
-
var label = element.getAttribute('title') || element.getAttribute('
|
|
7
|
+
var label = element.getAttribute('title') || element.getAttribute('data-tip') || element.getAttribute('aria-label');
|
|
8
8
|
if (!label || !label.trim()) return;
|
|
9
9
|
if (element.matches('button, [role="button"], a') && (!element.hasAttribute('aria-label') || element.dataset.tooltipGeneratedLabel === 'true' && element.hasAttribute('title'))) {
|
|
10
10
|
element.dataset.tooltipGeneratedLabel = 'true';
|
|
@@ -357,6 +357,11 @@ export function createSplitPane(pane, closePane) {
|
|
|
357
357
|
}
|
|
358
358
|
frame.addEventListener('clay-pane-ready', refreshReadyHeader);
|
|
359
359
|
frame.addEventListener('clay-pane-config', refreshReadyHeader);
|
|
360
|
+
frame.addEventListener('clay-pane-metadata-ready', function () {
|
|
361
|
+
if (paneEl.hidden || paneEl.inert || paneEl.classList.contains('split-pane-cached') || !frame.dataset.requestedSessionId) return;
|
|
362
|
+
var current = sessionById(Number(frame.dataset.requestedSessionId));
|
|
363
|
+
if (current) updateSplitPaneMetadata(paneEl, { slug: frame.dataset.projectSlug, sessionId: current.id, title: current.title });
|
|
364
|
+
});
|
|
360
365
|
frame.addEventListener('clay-pane-activation-failed', function () {
|
|
361
366
|
if (paneEl.classList.contains('split-pane-cached')) return;
|
|
362
367
|
syncPaneHeaderState(paneEl);
|
|
@@ -26,7 +26,9 @@ function reconcileCreatedWorkerPresentation() {
|
|
|
26
26
|
if (state.sessionListProjectSlug !== state.currentSlug || !driver || !driver.sessionOriginId || !getWs() || getWs().readyState !== 1) return false;
|
|
27
27
|
store.set({ createdWorkerPresentation: null });
|
|
28
28
|
showCreatedWorkerViewer(pending.group);
|
|
29
|
-
|
|
29
|
+
var currentView = (state.projectSplitViews || []).find(function (item) { return item.id === state.projectSplitViewActiveId; });
|
|
30
|
+
if (currentView && currentView.sessions.some(function (ref) { return ref.id === driver.id && ref.sessionOriginId === driver.sessionOriginId; }) ||
|
|
31
|
+
state.activeSessionId === driver.id && !state.splitPanes) return true;
|
|
30
32
|
var view = (state.projectSplitViews || []).find(function (item) {
|
|
31
33
|
return item.sessions.some(function (ref) { return ref.id === driver.id && ref.sessionOriginId === driver.sessionOriginId; });
|
|
32
34
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as $e,$a as Xn,$b as _r,$c as Io,Ab as me,Ac as ao,B as tn,Bc as io,C as nn,Cc as so,D as rn,Dc as lo,E as on,Ea as jn,Eb as vr,Ec as co,F as an,Fb as br,Fc as uo,G as sn,Gb as yr,Gc as fo,H as ln,Hb as Sr,Hc as po,I as dn,Ib as wr,Ic as mo,J as F,Ja as Un,Jb as kr,Jc as go,K as cn,Ka as _n,Kb as Be,Kc as ho,Kd as jo,L as un,La as Nn,Lb as Cr,Lc as vo,M as H,Ma as On,Mb as Mr,Mc as bo,N as fn,Na as Fn,Nb as Er,Nc as yo,O as pn,Oa as Hn,Ob as Pr,Oc as So,Od as Uo,P as mn,Pa as qn,Pb as xr,Pc as wo,Q as gn,Qa as Vn,Qb as Ir,Qc as ko,Qd as _o,R as hn,Ra as Xe,Rb as Lr,S as vn,Sa as Wn,Sb as Tr,Sd as No,T as bn,Ta as zn,Tb as ge,Td as Oo,U as yn,Ua as te,Ub as Rr,Uc as Co,V as Sn,Va as Gn,Vb as je,Vc as Mo,W as wn,Wa as Kn,Wb as Dr,Wc as ne,X as kn,Xa as Yn,Xb as Ar,Xc as re,Y as Cn,Ya as Qn,Yb as Br,Yc as Eo,Z as Mn,Za as Jn,Zb as jr,Zc as Po,_ as En,_a as $n,_b as Ur,_c as xo,_d as Fo,a as Nt,aa as Pn,ab as Zn,ac as Nr,ad as Lo,b as Ot,bb as er,bc as Or,c as Ft,cb as tr,cc as Fr,d as Ht,db as Ze,dc as Hr,e as qt,eb as nr,ec as qr,f as Vt,fc as Vr,g as Wt,gb as rr,gc as Wr,h as zt,hb as or,hc as zr,i as Gt,ib as ar,j as Kt,jb as ir,k as Yt,kb as sr,lb as et,lc as Gr,ma as xn,mb as lr,mc as Kr,na as In,nb as De,nc as Yr,oa as Ln,ob as Ae,oc as Qr,od as To,pa as Tn,pb as dr,pc as Jr,pd as Ro,qa as Rn,qb as cr,qc as $r,qd as Do,r as Je,ra as Dn,rb as ur,rc as Xr,rd as Ao,sa as An,sb as fr,sc as Zr,t as Qt,ta as Bn,tb as pr,tc as eo,td as Ue,ub as mr,uc as to,v as Jt,vb as gr,vc as no,vd as nt,w as Zt,wb as hr,wd as Bo,x as en,xc as tt,yc as ro,zc as oo,zd as he}from"./chunk-OG3E5SVA.js";import"./chunk-FQTNR4ZS.js";import"./chunk-JIV7O5GN.js";import{g as $t}from"./chunk-MZLMEXMW.js";import{h as Xt}from"./chunk-BQN7B62H.js";import{A as _t,a as At,b as Bt,f as jt,w as Qe,x as Ut}from"./chunk-VEBYD7TL.js";import{a as w}from"./chunk-R7QVVFUG.js";import{d as D,e as ee}from"./chunk-2IJUTAB6.js";import{a as Dt,b as o}from"./chunk-VZ2OKDAO.js";var ve=[];function rt(){var e=o.snap(),t=e.paneDeferredBootstrap;!t||t.scheduled||!t.jobs.length||!e.connected||!e.paneReady||e.paneSuspended||(o.set({paneDeferredBootstrap:Object.assign({},t,{scheduled:!0})}),setTimeout(function(){var n=o.snap(),r=n.paneDeferredBootstrap;if(r){var a=r.jobs.slice(),s=n.connected&&n.paneReady&&!n.paneSuspended?a.shift():null;o.set({paneDeferredBootstrap:Object.assign({},r,{scheduled:!1,jobs:a})});try{if(s!==null&&ve[s]){var i=ve[s];ve[s]=null,i()}}finally{rt()}}},0))}function _e(e){if(!o.get("paneMode")){e.forEach(function(n){n()});return}var t=o.get("paneDeferredBootstrap");t||(t={jobs:[],scheduled:!1},o.subscribe(function(n,r){(n.paneReady!==r.paneReady||n.connected!==r.connected||n.paneSuspended!==r.paneSuspended)&&rt()})),o.set({paneDeferredBootstrap:Object.assign({},t,{jobs:t.jobs.concat(e.map(function(n){var r=ve.length;return ve.push(n),r}))})}),rt()}function Ho(){_t(),jt(),window.addEventListener("message",function(e){var t=e.data;if(e.origin===location.origin&&t&&t.type==="clay-studio-document-update"&&t.message){var n=Bt(t.message.path);n&&n.source===e.source&&n.descriptor.token===t.token&&Fo(t.message,n);return}!t||["clay-pane-present-markdown","clay-pane-present-wireframe"].indexOf(t.type)<0||!t.message||!t.message.controlPresentation||!Qe(e,t)||!Ut(e,t)||(t.type==="clay-pane-present-markdown"?(At(e,t,Qe(e,t)),No(t.message)):Xt(t.message))})}var ai="(max-width: 768px)",ii=["sticky-notes-toggle-btn","shared-browser-toggle-btn","terminal-toggle-btn"],si=["shared-browser-toggle-btn","terminal-toggle-btn","sticky-notes-toggle-btn"];function qo(e){var t=document.querySelector("#main-column > .title-bar-content .status"),n=document.querySelector("#top-bar .top-bar-actions"),r=document.getElementById("notif-center-btn");if(!(!t||!n))for(var a=e?ii:si,s=0;s<a.length;s++){var i=document.getElementById(a[s]);i&&(e?t.appendChild(i):n.insertBefore(i,r))}}var li=150,oe=24,be=12,Vo=null;function Wo(e,t,n){return Math.round(e.offsetWidth)+"|"+Math.round(t.offsetWidth)+"|"+Math.round(n.offsetWidth)}function zo(e){var t=document.getElementById("top-bar"),n=t&&t.querySelector(".top-bar-left-pills"),r=t&&t.querySelector(".top-bar-actions"),a=document.getElementById("cmd-palette-btn");if(!(!t||!n||!r||!a)&&t.offsetWidth&&!(!e&&Vo===Wo(t,n,r))&&getComputedStyle(a).display!=="none"){for(var s=[[],["usage-compact"],["usage-compact","usage-compact-link"]],i=null,l=0;l<s.length&&!i;l++){t.classList.remove("usage-compact","usage-compact-link","search-icon"),s[l].forEach(function(P){t.classList.add(P)}),t.style.removeProperty("--top-bar-search-width"),t.style.removeProperty("--top-bar-search-left");var c=t.getBoundingClientRect().width,d=c/2,u=t.getBoundingClientRect().left,p=n.getBoundingClientRect().right-u,m=r.getBoundingClientRect().left-u,v=Math.min(d-p,m-d)-be,y=Math.min(520,c*.4);if(2*v>=li)i={mode:"full",width:Math.min(y,2*v),left:null,level:l};else if(m-p>=oe+2*be){var M=p+be+oe/2,E=m-be-oe/2;i={mode:"icon",width:oe,left:Math.min(Math.max(d,M),E),level:l}}}i||(i={mode:"icon",width:oe,left:Math.max(n.getBoundingClientRect().right-t.getBoundingClientRect().left+be+oe/2,0),level:s.length-1}),t.classList.toggle("search-icon",i.mode==="icon"),i.mode==="full"?t.style.setProperty("--top-bar-search-width",Math.round(i.width)+"px"):t.style.setProperty("--top-bar-search-left",Math.round(i.left)+"px"),Vo=Wo(t,n,r)}}function di(){var e=document.getElementById("top-bar");if(!(!e||typeof ResizeObserver>"u")){var t=!1,n=function(a){t||(t=!0,requestAnimationFrame(function(){t=!1,zo(a===!0)}))},r=new ResizeObserver(function(){n(!1)});r.observe(e),[".top-bar-left-pills",".top-bar-actions"].forEach(function(a){var s=e.querySelector(a);s&&r.observe(s)}),new MutationObserver(function(){n(!0)}).observe(e.querySelector(".top-bar-actions"),{childList:!0,subtree:!0,characterData:!0}),zo(!0)}}function ci(){var e=document.querySelector("#main-column > .title-bar-content"),t=document.getElementById("top-bar");if(!(!e||!t)){var n=function(){t.classList.toggle("title-bar-hidden",e.classList.contains("hidden"))};n(),new MutationObserver(n).observe(e,{attributes:!0,attributeFilter:["class"]})}}function Go(){var e=window.matchMedia(ai);qo(e.matches),e.addEventListener("change",function(){qo(e.matches)}),ci(),di()}var Qo={},at={},x=null,B=null,j=null,Jo=0,$o=[],Ne={},it=null;function Ko(e){Qo[e.id]=e}function ot(e,t){at[e]=t}function Xo(e,t){var n=Qo[e];n&&(j=n,Jo=0,$o=[],it=t||null,ui(),Oe(n.steps[0].id),B.classList.remove("hidden"),x.classList.remove("hidden"),setTimeout(function(){x.focus()},50))}function ye(){B&&B.classList.add("hidden"),x&&x.classList.add("hidden");var e=it;j=null,it=null,e&&e()}function Zo(){pi(),mi()}function ui(){x||(B=document.createElement("div"),B.className="playbook-overlay hidden",B.addEventListener("click",function(e){e.target===B&&ye()}),x=document.createElement("div"),x.className="playbook-modal hidden",x.setAttribute("tabindex","-1"),x.addEventListener("keydown",function(e){e.key==="Escape"&&ye()}),B.appendChild(x),document.body.appendChild(B))}function Oe(e){if(j){for(var t=null,n=0,r=0;r<j.steps.length;r++)if(j.steps[r].id===e){t=j.steps[r],n=r;break}if(t){if(Jo=n,$o.push(e),t.condition&&t.branches){var a=t.condition(),s=t.branches[a]||t.branches.default;if(s){Oe(s);return}}fi(t)}}}function fi(e){for(var t=j,n=t.steps.filter(function(k){return!k.condition}).length,r=0,a=0,s=0;s<t.steps.length;s++)t.steps[s].condition||(a++,t.steps[s].id===e.id&&(r=a));var i="";i+='<div class="playbook-header">',i+='<div class="playbook-header-left">',i+='<span class="playbook-icon">'+(t.icon||"\u{1F4D6}")+"</span>",i+='<span class="playbook-title">'+ae(t.title)+"</span>",i+="</div>",i+='<button class="playbook-close" title="Close">×</button>',i+="</div>",i+='<div class="playbook-progress">';for(var l=0;l<n;l++){var c="playbook-progress-dot";l+1<r?c+=" done":l+1===r&&(c+=" active"),i+='<span class="'+c+'"></span>'}i+="</div>",i+='<div class="playbook-body">',i+='<h2 class="playbook-step-title">'+ae(e.title)+"</h2>";var d=typeof e.body=="function"?e.body():e.body||"";if(i+='<div class="playbook-step-body">'+d+"</div>",e.note&&(i+='<div class="playbook-step-note">'+ae(e.note)+"</div>"),i+="</div>",e.actions&&e.actions.length>0){i+='<div class="playbook-actions">';for(var u=0;u<e.actions.length;u++){var p=e.actions[u],m="playbook-btn";u===0?m+=" playbook-btn-primary":m+=" playbook-btn-secondary",i+='<button class="'+m+'" data-action="'+(p.action||"")+'" data-next="'+(p.next||"")+'">'+ae(p.label)+"</button>"}i+="</div>"}x.innerHTML=i,D();var v=x.querySelector(".playbook-close");v&&v.addEventListener("click",ye);for(var y=x.querySelectorAll(".playbook-btn"),M=0;M<y.length;M++)(function(k){k.addEventListener("click",function(){var A=k.dataset.action,h=k.dataset.next;A&&at[A]?(k.disabled=!0,k.textContent+="...",at[A](function(){h?Oe(h):(Yo(j.id),ye())})):h?Oe(h):(Yo(j.id),ye())})})(y[M]);for(var E=x.querySelectorAll("[data-copy-url]"),P=0;P<E.length;P++)(function(k){k.addEventListener("click",function(A){A.stopPropagation();var h=k.dataset.copyUrl;navigator.clipboard.writeText(h).then(function(){k.textContent="Copied!",setTimeout(function(){k.textContent="Copy"},1500)})})})(E[P])}function Yo(e){Ne[e]=!0;try{localStorage.setItem("clay-playbooks-done",JSON.stringify(Ne))}catch{}}function pi(){try{var e=JSON.parse(localStorage.getItem("clay-playbooks-done")||"{}");Ne=e||{}}catch{Ne={}}}function mi(){if(Ko({id:"push-notifications",title:"Push Notifications",icon:"\u{1F514}",description:"Get notified when Claude finishes a long task",tipMatch:function(t){return t.indexOf("Push notification")!==-1},steps:[{id:"intro",title:"Never miss a response",body:"When Claude is working on a long task, you can walk away and get a push notification the moment it's done. Works even when Clay is in the background.",actions:[{label:"Enable notifications",action:"notif_request",next:"check_perm"},{label:"Not now",next:""}]},{id:"check_perm",condition:function(){return typeof Notification>"u"?"unsupported":Notification.permission},branches:{granted:"test",denied:"denied",default:"denied",unsupported:"unsupported"}},{id:"test",title:"Let's test it!",body:"Click below to send a test notification. You should see it pop up from your system.",actions:[{label:"Send test notification",action:"notif_test",next:"check_test"},{label:"Skip",next:"done"}]},{id:"check_test",title:"Did you see it?",body:"A notification should have appeared from your system just now.",actions:[{label:"Yes, it worked!",next:"done"},{label:"No, nothing appeared",next:"troubleshoot"}]},{id:"troubleshoot",title:"Troubleshooting",body:function(){var t=navigator.platform&&navigator.platform.indexOf("Mac")!==-1,n="your browser",r=navigator.userAgent||"";r.indexOf("Arc")!==-1?n="Arc":r.indexOf("Edg/")!==-1?n="Edge":r.indexOf("Firefox")!==-1?n="Firefox":r.indexOf("Chrome")!==-1?n="Chrome":r.indexOf("Safari")!==-1&&(n="Safari");var a=location.protocol==="https:"&&location.hostname!=="localhost"&&location.hostname!=="127.0.0.1",s="The browser says permission is granted, but the notification didn't show.<br><br>";return a&&(s+="\u{1F512} <strong>Untrusted certificate?</strong><br>If you're using a self-signed or untrusted TLS certificate, some browsers silently block notifications even on HTTPS.<br>Run <strong>mkcert -install</strong> on the server to trust the root CA, or add the certificate to your system keychain as trusted.<br><br>"),s+="<strong>Also check your OS notification settings:</strong><br>",t?s+="<strong>1.</strong> Open <strong>System Settings \u2192 Notifications</strong><br><strong>2.</strong> Find <strong>"+n+"</strong> in the list<br><strong>3.</strong> Make sure <strong>Allow Notifications</strong> is turned on<br><strong>4.</strong> Check that <strong>Do Not Disturb</strong> / Focus mode is off<br>":s+="<strong>1.</strong> Make sure notifications are enabled for <strong>"+n+"</strong><br><strong>2.</strong> Check that Do Not Disturb / Focus mode is off<br>",s+="<br>After adjusting, come back and try again.",s},actions:[{label:"Try again",action:"notif_test",next:"check_test"},{label:"I'll fix it later",next:"done"}]},{id:"denied",title:"Permission needed",body:function(){var t=!window.isSecureContext||location.protocol==="http:"&&location.hostname!=="localhost"&&location.hostname!=="127.0.0.1"&&location.hostname!=="[::1]";if(t)return"\u26A0\uFE0F <strong>Insecure context detected.</strong><br><br>Notifications require a <strong>secure context</strong> (HTTPS or localhost). You're accessing Clay over <strong>"+location.protocol+"//"+location.hostname+"</strong>, so the browser automatically blocks notifications.<br><br><strong>How to fix:</strong><br><strong>1.</strong> Access Clay via <strong>https://</strong> (set up a TLS certificate)<br><strong>2.</strong> Or access via <strong>localhost:"+location.port+"</strong> instead of an IP address<br>";var n="chrome://settings/content/notifications",r=navigator.userAgent||"";return r.indexOf("Firefox")!==-1?n="about:preferences#privacy":r.indexOf("Edg/")!==-1?n="edge://settings/content/notifications":r.indexOf("Arc")!==-1&&(n="arc://settings/content/notifications"),'Your browser blocked the notification permission.<br><br><strong>1.</strong> Click the lock icon in the address bar<br><strong>2.</strong> Find "Notifications" and set it to "Allow"<br><strong>3.</strong> Reload the page<br><br>Or paste this into your address bar:<br><div style="display:flex;align-items:center;gap:6px;margin-top:6px"><code style="font-size:12px;color:var(--accent);flex:1;user-select:all">'+n+'</code><button class="playbook-btn-secondary" style="padding:3px 8px;font-size:11px" data-copy-url="'+n+'">Copy</button></div>'},actions:[{label:"Got it",next:""}]},{id:"unsupported",title:"Not supported",body:"Your browser doesn't support notifications. Try Chrome, Edge, or Firefox for the best experience.",actions:[{label:"Got it",next:""}]},{id:"done",title:"All set! \u{1F389}",body:"You'll now get a notification whenever Claude finishes processing. This works even when Clay is minimized or in another tab.",note:"You can toggle notifications anytime from the header bar.",actions:[{label:"Done",next:""}]}]}),ot("notif_request",function(t){if(typeof Notification>"u"){t();return}Notification.requestPermission().then(function(n){if(n==="granted")try{localStorage.setItem("notif-alert","1");var r=document.getElementById("notif-toggle-alert");r&&(r.checked=!0)}catch{}t()}).catch(function(){t()})}),ot("notif_test",function(t){if(typeof Notification>"u"){t();return}if(Notification.permission!=="granted"){Notification.requestPermission().then(function(n){n==="granted"?e(t):t()}).catch(function(){t()});return}e(t)}),location.protocol==="https:"){let t=function(){var a=navigator.userAgent||"",s=navigator.platform||"";return s.indexOf("Mac")!==-1||a.indexOf("Mac")!==-1?"mac":s.indexOf("Win")!==-1||a.indexOf("Windows")!==-1?"windows":"linux"},n=function(){var a=t(),s="The certificate has been downloaded as <strong>clay-ca.pem</strong>.<br><br>";return a==="mac"?(s+="<strong>macOS \u2014 run in Terminal:</strong><br>",s+=r("sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/Downloads/clay-ca.pem")):a==="windows"?(s+="<strong>Windows \u2014 run in PowerShell (Admin):</strong><br>",s+=r('certutil -addstore -f "Root" %USERPROFILE%\\Downloads\\clay-ca.pem')):(s+="<strong>Linux \u2014 run in terminal:</strong><br>",s+=r("sudo cp ~/Downloads/clay-ca.pem /usr/local/share/ca-certificates/clay-ca.crt && sudo update-ca-certificates")),s+='<br><div style="padding:8px 10px;background:var(--bg-deeper);border-radius:6px;border-left:3px solid var(--accent)"><strong style="font-size:11px">Or ask Claude Code:</strong><br><code style="font-family:monospace;font-size:12px;line-height:1.5;color:var(--text-secondary)">Install ~/Downloads/clay-ca.pem as a trusted root certificate</code></div>',s+="<br>Then <strong>restart your browser</strong> to apply the change.",s},r=function(a){return'<div style="margin-top:8px;position:relative;background:var(--bg-deeper);border-radius:6px;padding:8px 10px"><code style="display:block;font-family:monospace;font-size:12px;word-break:break-all;line-height:1.5;padding-right:50px">'+ae(a)+'</code><button class="playbook-btn-secondary" style="position:absolute;top:8px;right:8px;padding:2px 8px;font-size:11px;white-space:nowrap" data-copy-url="'+ae(a)+'">Copy</button></div>'};Ko({id:"trust-certificate",title:"Trust Certificate",icon:"\u{1F512}",description:"Getting certificate warnings? Fix them here",tipMatch:function(a){return a.indexOf("certificate")!==-1||a.indexOf("Certificate")!==-1},steps:[{id:"intro",title:"Getting certificate warnings?",body:"Clay generates a local CA certificate for secure HTTPS connections. Your browser may show warnings until you install and trust this certificate on your device.",actions:[{label:"Download certificate",action:"cert_download",next:"install"},{label:"Not now",next:""}]},{id:"install",title:"Install the certificate",body:n,actions:[{label:"Done, I installed it",next:"done"},{label:"I'll do it later",next:""}]},{id:"done",title:"All set! \u{1F389}",body:"After restarting your browser, certificate warnings should disappear. If you still see them, make sure you ran the terminal command with admin privileges.",actions:[{label:"Done",next:""}]}]}),ot("cert_download",function(a){var s=document.createElement("a");s.href="/ca/download",s.download="clay-ca.pem",document.body.appendChild(s),s.click(),document.body.removeChild(s),setTimeout(a,500)})}function e(t){try{var n=new Notification("Clay",{body:"Notifications are working! \u{1F389}",tag:"clay-test-"+Date.now()});n.onclick=function(){window.focus(),n.close()},setTimeout(function(){try{n.close()}catch{}},5e3)}catch(r){console.warn("[Playbook] Notification failed:",r)}setTimeout(t,800)}}function ae(e){var t=document.createElement("div");return t.textContent=e||"",t.innerHTML}function ea(e){var t=document.createElement("span");t.className="stt-meter",t.setAttribute("aria-hidden","true");var n=document.createElement("canvas");t.appendChild(n);var r=n.getContext("2d"),a=null,s=0,i=[],l=window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function c(d){a=null;var u=o.get("speechActive");if(!(!u||u.id!==e||!t.isConnected||!r)&&(a=requestAnimationFrame(c),!(d-s<(l?100:32)))){s=d;var p=t.clientWidth,m=t.clientHeight,v=Math.min(window.devicePixelRatio||1,2);(n.width!==Math.round(p*v)||n.height!==Math.round(m*v))&&(n.width=Math.round(p*v),n.height=Math.round(m*v)),r.setTransform(v,0,0,v,0,0),r.clearRect(0,0,p,m);var y=getComputedStyle(t),M=r.createLinearGradient(0,0,p,0);M.addColorStop(0,y.getPropertyValue("--brand-green").trim()||y.color),M.addColorStop(.5,y.getPropertyValue("--brand-blue").trim()||y.color),M.addColorStop(1,y.getPropertyValue("--brand-green").trim()||y.color),r.fillStyle=M;for(var E=u.audioSignal,P=E?E.levels:[],k=E?Date.now()-E.updatedAt:0,A=Math.max(0,1-Math.max(0,k-250)/900),h=Math.max(2,Math.floor(p/4)),b=Math.round(Math.min(160,Math.max(80,h))*1.25),R=l?0:Math.min(1,k/20),S=0;S<h;S++){var _=P.length-b+S/(h-1)*(b-1)+R,N=Math.floor(_),Le=_-N,J=P[N]||0,Te=P[Math.min(N+1,P.length-1)]||0,$=(J+(Te-J)*Le)*A,O=i[S]||0,X=l?$:O+($-O)*($>O?.5:.24);i[S]=X;for(var G=1+X*(m*.46-1),Re=Math.min(1,(S+1)/8,(h-S)/8),Z=0;Z<=m*.48;Z+=3.2){var Ye=Math.exp(-Math.pow(Z/G,2)*1.7);if(!(Ye<.035)){var Rt=.35+Ye*.65;r.globalAlpha=(.12+Ye*.78)*Re,r.beginPath(),r.arc((S+.5)*p/h,m/2+Z,Rt,0,Math.PI*2),r.fill(),Z&&(r.beginPath(),r.arc((S+.5)*p/h,m/2-Z,Rt,0,Math.PI*2),r.fill())}}}r.globalAlpha=1}}return{element:t,update:function(d){t.hidden=!d,d&&a===null&&(a=requestAnimationFrame(c)),!d&&a!==null&&(cancelAnimationFrame(a),a=null,i=[])}}}function ta(e,t,n){var r=document.getElementById(e),a=document.getElementById(t),s=document.getElementById(n);if(!r||!a||!s||r.dataset.speechBound)return;var i=document.getElementById(e==="stt-btn"?"input-row":"home-mate-chat-composer")||s,l=document.getElementById(e==="stt-btn"?"input-bottom":"home-mate-chat-composer")||i;r.addEventListener("click",Fe),r.dataset.speechBound="true",r.classList.add("stt-button");var c=document.createElement("span");c.className="stt-controls",r.before(c),c.appendChild(r);var d=document.createElement("button");d.type="button",d.id=e+"-picker",d.className="stt-picker-toggle",d.innerHTML=ee("chevron-down"),d.setAttribute("aria-label","Choose voice model"),d.setAttribute("aria-haspopup","dialog"),d.setAttribute("aria-expanded","false"),d.title="Choose voice model",c.appendChild(d),d.addEventListener("click",function(){Fe(),Ae(d)});var u=document.createElement("div");u.className="stt-progress",u.hidden=!0;var p=document.createElement("span");p.id=e+"-status",p.className="stt-status",p.setAttribute("role","status");var m=document.createElement("span");m.className="stt-timer",m.setAttribute("aria-hidden","true");var v=document.createElement("button");v.type="button",v.innerHTML=ee("x"),v.className="stt-cancel",v.title="Cancel voice input",v.setAttribute("aria-label","Cancel voice input"),v.addEventListener("click",function(){te(),o.set({speechRetry:null})});var y=ea(e),M=document.createElement("button");M.type="button",M.textContent="Retry",M.addEventListener("click",Jn);var E=document.createElement("a");E.textContent="Provider account",E.target="_blank",E.rel="noopener noreferrer";var P=document.createElement("button");P.type="button",P.textContent="Dismiss",P.addEventListener("click",function(){zn(e,"")}),u.append(v,y.element,m,p,M,E,P),i.prepend(u),r.setAttribute("aria-describedby",p.id),r.addEventListener("click",function(){var h=o.get("speechActive");if(h&&h.id===e){h.model&&h.phase==="recording"?Qn():te();return}var b=et(),R=o.get("speechSettings");if(b.provider==="browser"&&!Xe().available){Ae(d);return}if(b.provider!=="browser"&&(!R||R.configured.indexOf(b.provider)<0)){Ae(d);return}b.provider==="browser"?Gn(e,a):Yn(e,a,b)}),a.addEventListener("beforeinput",function(){var h=o.get("speechActive");h&&h.id===e&&te("Voice input stopped so you can edit your draft."),o.set({speechRetry:null})}),a.addEventListener("input",function(){var h=o.get("speechActive");h&&h.id===e&&!h.writing&&te()});function k(){var h=o.get("speechActive"),b=!!h&&h.id===e,R=et(),S=lr(R.provider),_=R.provider==="browser"?o.get("speechBrowserIdentity"):null,N=b&&h.model&&h.phase!=="recording",Le=b&&!!h.autoSend;i.classList.toggle("stt-recording",b),u.classList.toggle("stt-auto-send",Le),u.classList.toggle("stt-progress-active",b),u.classList.toggle("stt-progress-pending",!!N);var J=b?l:i;(u.parentElement!==J||u!==J.firstElementChild)&&J.prepend(u),y.update(b?h:null),d.hidden=b,r.disabled=a.disabled||a.readOnly||!o.get("speechSettings"),d.disabled=a.disabled||a.readOnly||b,r.classList.toggle("stt-active",b),r.setAttribute("aria-pressed",String(b));var Te=b?Le?"Cancel pending voice send":N?"Cancel voice input":R.mode==="recorded"?"Stop and transcribe":"Stop voice input":"Start voice input";r.setAttribute("aria-label",Te+" \xB7 "+(S?S.name+" \xB7 ":"")+R.name),r.title=Te+" \xB7 "+R.name;var $=[b,N,S&&S.id,_&&_.id].join(":");if(r.dataset.speechIcon!==$){if(r.dataset.speechIcon=$,r.innerHTML=ee(b?N?"x":"square":"mic"),!b&&(S||_&&_.icon)){var O=document.createElement("img");O.className="stt-vendor-badge",O.src=S?S.icon:_.icon,O.alt="",r.appendChild(O)}D()}var X=(o.get("speechStatuses")||{})[e]||"",G=(o.get("speechErrors")||{})[e];u.classList.toggle("stt-progress-error",!!G),p.setAttribute("role",G?"alert":"status"),P.hidden=!G,E.hidden=!G||!S,S&&(E.href=S.url),R.provider==="browser"&&!Wn()&&(X="Browser voice input is unavailable. Choose a connected speech provider or type your message."),window.isSecureContext||(X="Voice input requires a secure HTTPS connection."),p.textContent=X,m.textContent=b&&h.startTime?Math.floor((Date.now()-h.startTime)/6e4)+":"+String(Math.floor((Date.now()-h.startTime)/1e3)%60).padStart(2,"0"):"",v.hidden=!b;var Re=o.get("speechRetry");M.hidden=!Re||Re.id!==e,u.hidden=!b&&!G&&M.hidden}o.subscribe(k);var A=new MutationObserver(k);A.observe(a,{attributes:!0,attributeFilter:["disabled","readonly"]}),k()}function Fe(){o.set({speechBrowserIdentity:Xe()})}function na(){Fe(),window.addEventListener("focus",Fe),Kn(),dr(),ta("stt-btn","input","input-wrapper"),ta("home-stt-btn","home-mate-chat-input","home-mate-chat-composer-frame"),De(),window.addEventListener("focus",De);try{window.top.document.addEventListener("clay:speech-settings-saved",De)}catch{}}var g=null,T=null,Se=null;function we(){return document.body.dataset.myDisplayName||"Clay user"}function se(e){if(g){var t=g.querySelector("#account-ai-section");t&&ur(t),g.remove(),g=null,T.setAttribute("aria-expanded","false"),T.setAttribute("aria-label","Open account menu for "+we()),document.removeEventListener("pointerdown",ra),document.removeEventListener("focusin",oa),document.removeEventListener("keydown",aa),window.removeEventListener("resize",ie),o.set({defaultAiInlineEditing:!1}),e&&Se&&document.contains(Se)&&Se.focus({preventScroll:!0}),Se=null}}function dt(e){return e&&e.closest&&e.closest(".avatar-positioner-overlay")}function ra(e){!g||g.contains(e.target)||T.contains(e.target)||dt(e.target)||se(!1)}function oa(e){!g||g.contains(e.target)||T.contains(e.target)||dt(e.target)||se(!1)}function aa(e){e.key==="Escape"&&(dt(e.target)||document.querySelector(".avatar-positioner-overlay")||(e.preventDefault(),e.stopPropagation(),se(!0)))}function ie(){if(!(!g||!T)){var e=T.getBoundingClientRect(),t=Math.min(280,window.innerWidth-24),n=Math.max(12,Math.min(window.innerWidth-t-12,e.left));g.style.width=t+"px",g.style.left=n+"px",g.style.top=Math.max(12,e.top-g.offsetHeight-8)+"px"}}function st(e){var t=g&&g.querySelector(".account-identity-copy");t&&(t.innerHTML='<button type="button" id="account-name-edit" class="account-name-display"><span></span><i data-lucide="pencil" aria-hidden="true"></i></button><small>Personal account</small>',t.querySelector("span").textContent=we(),t.querySelector("#account-name-edit").addEventListener("click",gi),window.lucide&&window.lucide.createIcons({nodes:[t]}),e&&t.querySelector("#account-name-edit").focus())}function gi(){var e=g&&g.querySelector(".account-identity-copy");if(e){var t=document.createElement("input");t.id="account-profile-name",t.setAttribute("aria-label","Display name"),t.className="account-name-input",t.type="text",t.maxLength=50,t.autocomplete="name",t.value=o.get("accountNameDraft")===void 0?Ze().name||"":o.get("accountNameDraft"),t.addEventListener("input",function(){o.set({accountNameDraft:t.value})}),e.innerHTML="",e.appendChild(t);var n=document.createElement("small");n.textContent="Enter to save \xB7 Escape to cancel",e.appendChild(n),t.addEventListener("keydown",function(r){r.key==="Enter"?(r.preventDefault(),t.disabled=!0,n.textContent="Saving\u2026",$n({name:t.value.trim()}).then(function(){o.set({accountNameDraft:void 0}),st(!0)}).catch(function(a){t.disabled=!1,n.textContent=a.message,t.focus()})):r.key==="Escape"&&(r.preventDefault(),o.set({accountNameDraft:void 0}),st(!0)),r.stopPropagation()}),t.focus(),t.select()}}function hi(){var e=g&&g.querySelector("#account-avatar-editor");e&&(e.hidden=!e.hidden,e.hidden||e.querySelector("#account-avatar-upload").focus(),ie())}function vi(){var e=g.querySelector("#account-avatar-edit"),t=g.querySelector("#account-avatar-editor"),n=t.querySelector("#account-avatar-upload"),r=t.querySelector("#account-avatar-file"),a=t.querySelector("#account-avatar-generate");e.addEventListener("click",function(s){s.stopPropagation(),hi()}),t.addEventListener("click",function(s){s.stopPropagation()}),n.addEventListener("click",function(){r.click()}),r.addEventListener("change",function(){var s=r.files&&r.files[0];if(s){var i=new Image,l=URL.createObjectURL(s);i.onload=function(){er(i,l,function(c){URL.revokeObjectURL(l),Zn(c).then(function(){t.hidden=!0}).catch(function(){t.dataset.error="true"})})},i.src=l}}),a.addEventListener("click",function(){Xn(),t.hidden=!0})}function bi(){g=document.createElement("div"),g.id="account-popover",g.className="account-popover",g.setAttribute("role","dialog"),g.setAttribute("aria-label","Account");var e=Ze(),t=document.createElement("div");t.className="account-menu-identity",t.innerHTML='<button type="button" id="account-avatar-edit" class="account-avatar-edit" aria-label="Edit avatar"><img src="'+(document.body.dataset.myAvatarUrl||"")+'" alt=""></button><div class="account-identity-copy"></div><button type="button" class="account-settings-button" aria-label="User Settings" title="User Settings"><i data-lucide="settings" aria-hidden="true"></i></button>',t.querySelector("#account-avatar-edit img").alt=e.name||"Clay user";var n=document.createElement("div");n.id="account-avatar-editor",n.className="account-avatar-editor",n.hidden=!0,n.innerHTML='<button type="button" id="account-avatar-upload">Upload photo</button><button type="button" id="account-avatar-generate">Generate avatar</button><input id="account-avatar-file" type="file" accept="image/*">',g.appendChild(t),g.appendChild(n);var r=document.createElement("section");r.id="account-ai-section",r.className="account-inline-section account-ai-section",r.setAttribute("aria-label","Default AI"),g.appendChild(r),cr(r),t.querySelector(".account-settings-button").addEventListener("click",yi),document.body.appendChild(g),st(),vi(),lt(),window.lucide&&window.lucide.createIcons({nodes:[g]}),ie()}function lt(){var e=document.getElementById("cursor-share-toggle");if(e){var t=o.get("cursorSharingHydrated")===!0,n=t&&o.get("cursorSharingEnabled")===!0,r=o.get("cursorSharingPending")!==null&&o.get("cursorSharingPending")!==void 0,a=o.get("connected")!==!1,s=o.get("cursorSharingError"),i=!!s&&!t&&a,l=t&&!n&&!r&&!s&&a;e.hidden=o.get("isMultiUserMode")!==!0,e.removeAttribute("role"),e.removeAttribute("aria-checked"),e.setAttribute("aria-pressed",n?"true":"false"),e.classList.toggle("on",n),e.classList.toggle("off",l),e.classList.toggle("pending",r),e.disabled=r||!a||!t&&!i;var c=r?"waiting":a?s?i?"error; activate to retry":"error":t?n?"on":"off":"unavailable":"offline";e.setAttribute("aria-label","Cursor sharing "+c);var d=r?"Cursor sharing is waiting for confirmation.":a?s?i?"Cursor sharing is unavailable. Click to retry.":"Cursor sharing is unavailable.":t?n?"Your cursor is visible to others. Click to stop sharing.":"Cursor sharing is off. Click to share your cursor.":"Cursor sharing is unavailable.":"Cursor sharing is offline.";Cn(e,d)}}function yi(e){e.stopPropagation(),se(!0),pr()}function Si(e){if(e.stopPropagation(),!e.currentTarget.disabled){if(o.get("cursorSharingError")&&o.get("cursorSharingHydrated")!==!0){Br();return}Ar(o.get("cursorSharingEnabled")!==!0)}}function wi(){var e=g&&g.querySelector("#account-ai-section select");e&&e.focus({preventScroll:!0})}function ki(){g||ia(),o.set({defaultAiInlineEditing:!0}),wi()}function ia(){if(g){se(!0);return}Se=document.activeElement,bi(),T.setAttribute("aria-expanded","true"),T.setAttribute("aria-label","Close account menu for "+we()),document.addEventListener("pointerdown",ra),document.addEventListener("focusin",oa),document.addEventListener("keydown",aa),window.addEventListener("resize",ie)}function sa(){if(T=document.getElementById("user-account-trigger"),!!T){T.addEventListener("click",ia),document.addEventListener("clay:open-account-default-ai",ki);var e=document.getElementById("cursor-share-toggle");e&&e.addEventListener("click",Si),lt(),T.setAttribute("aria-label","Open account menu for "+we()),o.subscribe(function(t,n){t.myUserId!==n.myUserId&&t.accountNameDraft!==void 0&&o.set({accountNameDraft:void 0}),(t.myUserId!==n.myUserId||t.connected===!1&&n.connected!==!1)&&se(!1),lt(),g&&ie()}),document.addEventListener("clay:profile-updated",function(){if(g){var t=g.querySelector(".account-name-display span");t&&(t.textContent=we());var n=g.querySelector("#account-avatar-edit img");n&&(n.src=document.body.dataset.myAvatarUrl||n.src)}}),window.addEventListener("resize",ie)}}var Ci=[{id:"file-browser-btn",icon:"folder-tree",label:"File browser"},{id:"terminal-sidebar-btn",icon:"square-terminal",label:"Terminal",countId:"terminal-sidebar-count"},{id:"sticky-notes-sidebar-btn",icon:"sticky-note",label:"Sticky Notes",countId:"sticky-notes-sidebar-count"},{id:"project-logs-btn",icon:"notebook-tabs",label:"Logs",countId:"project-logs-count"},{id:"mcp-btn",icon:"cable",label:"MCP / Skills",countId:"mcp-sidebar-count"},{id:"scheduler-btn",icon:"calendar-clock",label:"Scheduled"},{id:"issues-btn",icon:"circle-dot",label:"Issues"},{id:"shared-browser-btn",icon:"globe",label:"Browser"}],Mi=[{id:"mate-memory-btn",icon:"brain",label:"Memory",countId:"mate-memory-count"},{id:"mate-knowledge-btn",icon:"book-open",label:"Knowledge",countId:"mate-knowledge-count"},{id:"mate-sticky-notes-btn",icon:"sticky-note",label:"Sticky Notes"},{id:"mate-debates-btn",icon:"messages-square",label:"Debates"},{id:"mate-mcp-btn",icon:"cable",label:"MCP / Skills",countId:"mate-mcp-sidebar-count"}],de={session:{tools:Ci,fixedTools:[{id:"you-button",icon:"user-round",label:"Me",countId:"me-unread-badge",fixed:!0,scope:"clay"}],activeContainerId:"session-actions",hiddenSectionId:"session-actions-hidden"},mate:{tools:Mi,activeContainerId:"mate-sidebar-tools",hiddenSectionId:"mate-sidebar-tools-hidden"}},Ei={"skills-btn":"mcp-btn"},Pi={"mate-skills-btn":"mate-mcp-btn","mate-debate-btn":"mate-debates-btn"},la=["git-sidebar-btn","loop-tool-btn","debates-btn"];function le(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}function ua(e,t){var n=t&&t.order||[],r=t&&t.hidden||[],a={order:n.slice(),hidden:r.slice(),migrated:!1};if(e!=="session"&&e!=="mate")return a;for(var s=e==="mate"?Pi:Ei,i=Object.keys(s),l=0;l<i.length;l++){var c=i[l],d=s[c],u=le(a.order,c)!==-1,p=le(a.hidden,c)!==-1;if(!(!u&&!p)){var m=le(a.order,d)!==-1||le(a.hidden,d)!==-1;a.order=ca(a.order,c,d,m),a.hidden=ca(a.hidden,c,d,m),a.migrated=!0}}if(e!=="session")return a;for(var v=0;v<la.length;v++){var y=la[v];le(a.order,y)===-1&&le(a.hidden,y)===-1||(a.order=da(a.order,y),a.hidden=da(a.hidden,y),a.migrated=!0)}return a}function da(e,t){for(var n=[],r=0;r<e.length;r++)e[r]!==t&&n.push(e[r]);return n}function ca(e,t,n,r){for(var a=[],s={},i=0;i<e.length;i++){var l=e[i];if(l===t){if(r)continue;l=n}s[l]||(s[l]=!0,a.push(l))}return a}var He={},q=null,ce=null;function ma(){for(var e in de)xi(e);Li(),D()}function xi(e){var t=de[e],n=document.getElementById(t.activeContainerId);if(n){(t.fixedTools||[]).forEach(function(a){n.appendChild(fa(a,e))});for(var r=0;r<t.tools.length;r++)n.appendChild(fa(t.tools[r],e));n.addEventListener("dragover",function(a){if(!(ce!==e||!q)){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="move");var s=Ii(n,a.clientX,a.clientY);s==null?(q.parentNode!==n||q.nextSibling)&&n.appendChild(q):s!==q&&n.insertBefore(q,s)}}),n.addEventListener("drop",function(a){ce===e&&a.preventDefault()})}}function fa(e,t){var n=document.createElement("button");n.id=e.id,n.type="button",n.className="palette-tile",n.title=e.label,n.setAttribute("aria-label",e.label),n.dataset.toolId=e.id,n.dataset.palette=t,n.draggable=!0,e.fixed&&(n.draggable=!1,n.dataset.fixed="true"),e.scope&&(n.dataset.scope=e.scope),e.id==="you-button"&&(n.classList.add("you-button"),n.setAttribute("aria-pressed","false"));var r=document.createElement("i");r.setAttribute("data-lucide",e.icon),n.appendChild(r);var a=document.createElement("span");if(a.className="tool-btn-label",a.textContent=e.label,n.appendChild(a),e.countId){var s=document.createElement("span");s.id=e.countId,s.className="sidebar-badge hidden",e.id==="you-button"&&(s.className="sidebar-badge me-unread-badge",s.hidden=!0),n.appendChild(s)}return n.addEventListener("dragstart",function(i){if(e.fixed){i.preventDefault();return}var l=n.parentNode;if(!l||l.id!==de[t].activeContainerId){i.preventDefault();return}q=n,ce=t,i.dataTransfer.effectAllowed="move";try{i.dataTransfer.setData("text/plain",e.id)}catch{}n.classList.add("dragging")}),n.addEventListener("dragend",function(){n.classList.remove("dragging"),ce&&Ti(ce),q=null,ce=null}),n}function Ii(e,t,n){for(var r=Array.prototype.slice.call(e.querySelectorAll("[data-tool-id]:not(.dragging)")),a=null,s=Number.POSITIVE_INFINITY,i=0;i<r.length;i++)if(r[i].dataset.fixed!=="true"){var l=r[i].getBoundingClientRect(),c=n-(l.top+l.height/2),d=t-(l.left+l.width/2),u=Math.abs(c)*2+Math.abs(d),p=c<-l.height/2||Math.abs(c)<=l.height/2&&d<0;p&&u<s&&(s=u,a=r[i])}return a}function Li(){fetch("/api/user/tool-palettes",{credentials:"same-origin"}).then(function(e){return e.ok?e.json():null}).then(function(e){e&&(pa("session",e.session||null),pa("mate",e.mate||null))}).catch(function(){})}function pa(e,t){if(!t)return;var n=de[e];if(!n)return;var r=document.getElementById(n.activeContainerId);if(!r)return;var a=ua(e,t),s={};function i(v){if(!s[v]){var y=document.getElementById(v);!y||y.dataset.fixed==="true"||(r.appendChild(y),s[v]=!0)}}for(var l={},c=0;c<a.hidden.length;c++)l[a.hidden[c]]=!0;for(var d=0;d<a.order.length;d++)l[a.order[d]]||i(a.order[d]);for(var u=0;u<n.tools.length;u++)l[n.tools[u].id]||i(n.tools[u].id);for(var p=0;p<a.hidden.length;p++)i(a.hidden[p]);for(var m=0;m<n.tools.length;m++)i(n.tools[m].id)}function Ti(e){He[e]&&clearTimeout(He[e]),He[e]=setTimeout(function(){He[e]=null,Ri(e)},250)}function Ri(e){var t=de[e];if(t){var n=document.getElementById(t.activeContainerId);if(n){for(var r=[],a=n.querySelectorAll("[data-tool-id]"),s=0;s<a.length;s++)a[s].dataset.fixed!=="true"&&r.push(a[s].dataset.toolId);fetch("/api/user/tool-palettes",{method:"PUT",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({palette:e,order:r,hidden:[]})}).catch(function(){})}}}var ke=[],ct=[],I=null,K=null,ut=null,U=!1,Ce="project",V=0,C=[];function ga(e){e!=="project"&&e!=="mate"||(U&&W(!1),ft(e))}function ba(){Di(),K=I.querySelector(".cmd-palette-results"),ut=I.querySelector(".project-switcher-header");var e=o.get("currentSlug");e&&(ke=[e]);var t=o.get("dmTargetUser");t&&t.isMate&&t.id&&(ct=[t.id]),o.subscribe(function(d,u){d.currentSlug&&d.currentSlug!==u.currentSlug&&(va(ke,d.currentSlug),ke=ke);var p=ha(d.dmTargetUser),m=ha(u.dmTargetUser);p&&p!==m&&va(ct,p)});var n=I.querySelector(".cmd-palette-backdrop");n&&n.addEventListener("click",function(){W(!1)}),document.addEventListener("keydown",Ai,!0),document.addEventListener("keyup",Bi,!0),window.addEventListener("blur",function(){U&&W(!1)});var r=/Mac|iPhone|iPod|iPad/i.test(navigator.platform),a=r?"\u2318E":"Ctrl+E",s=r?"\u2318M":"Ctrl+M",i=document.getElementById("icon-strip-hint-project"),l=document.getElementById("icon-strip-hint-mate");i&&(i.textContent=a,i.title="Switch project ("+a+")",i.addEventListener("click",function(){ga("project")})),l&&(l.textContent=s,l.title="Switch mate ("+s+")",l.addEventListener("click",function(){ga("mate")}));function c(){if(l){var d=o.get("cachedMatesList")||[];l.classList.toggle("hidden",d.length===0)}}c(),o.subscribe(function(d,u){(d.cachedMatesList!==u.cachedMatesList||d.projectMateDmsEnabled!==u.projectMateDmsEnabled)&&c()})}function Di(){if(I=document.getElementById("project-switcher"),!I){var e=/Mac|iPhone|iPod|iPad/i.test(navigator.platform),t=e?"<kbd>\u2318</kbd>":"<kbd>Ctrl</kbd>";I=document.createElement("div"),I.id="project-switcher",I.className="cmd-palette hidden project-switcher",I.innerHTML='<div class="cmd-palette-backdrop"></div><div class="cmd-palette-dialog project-switcher-dialog"><div class="project-switcher-header">Switch project</div><div class="cmd-palette-results"></div><div class="cmd-palette-footer project-switcher-footer"><span class="project-switcher-shortcuts">'+t+'<kbd class="proj-next-key">E</kbd> next \xB7 <kbd>\u21E7</kbd>'+t+'<kbd class="proj-prev-key">E</kbd> prev \xB7 <kbd>\u23CE</kbd> select \xB7 <kbd>Esc</kbd> cancel</span></div></div>',document.body.appendChild(I)}}function ha(e){return e&&e.isMate&&e.id?e.id:null}function va(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),e.unshift(t)}function Ai(e){if(e.key){var t=(e.metaKey||e.ctrlKey)&&!e.altKey,n=e.key.toLowerCase();if(t&&(n==="e"||n==="m")){var r=n==="e"?"project":"mate";e.preventDefault(),e.stopPropagation(),U?Ce!==r?ft(r):e.shiftKey?qe(-1):qe(1):ft(r);return}if(U){if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),W(!1);return}if(e.key==="Enter"){e.preventDefault(),e.stopPropagation(),W(!0);return}if(e.key==="ArrowRight"||e.key==="ArrowDown"){e.preventDefault(),qe(1);return}if(e.key==="ArrowLeft"||e.key==="ArrowUp"){e.preventDefault(),qe(-1);return}}}}function Bi(e){U&&(e.key==="Meta"||e.key==="Control")&&W(!0)}function ft(e){if(Ce=e,C=_i(e),C.length===0){U&&W(!1);return}ut&&(ut.textContent=e==="mate"?"Switch mate":"Switch project"),ji(e),Fi(),V=Ui(),pt(),I.classList.remove("hidden"),U=!0,D(),Ue(K)}function ji(e){var t=I.querySelector(".proj-next-key"),n=I.querySelector(".proj-prev-key"),r=e==="mate"?"M":"E";t&&(t.textContent=r),n&&(n.textContent=r)}function Ui(){if(C.length===0)return 0;for(var e=Ce==="mate"?ct:ke,t=ya(),n=0;n<e.length;n++){var r=e[n];if(r!==t){for(var a=0;a<C.length;a++)if(C[a].key===r&&!C[a].disabled)return a}}for(var s=0;s<C.length;s++)if(!C[s].disabled&&C[s].key!==t)return s;for(var i=0;i<C.length;i++)if(!C[i].disabled)return i;return 0}function ya(){if(Ce==="mate"){var e=tt(o.snap());return e?e.id:null}return o.get("currentSlug")}function _i(e){return e==="mate"?Oi():Ni()}function Ni(){var e=(ge()||[]).filter(function(t){return!t.isMate});return e.map(function(t){var n=Zr(t);return{key:t.slug,title:t.title||t.project||t.slug,icon:t.icon||null,fallbackIcon:"folder",isCurrent:t.slug===o.get("currentSlug"),external:n,disabled:!1,disabledReason:null}})}function Oi(){var e=o.get("cachedMatesList")||[],t=tt(o.snap()),n=t?t.id:null;return e.map(function(r){return{key:r.id,title:r.displayName||r.name||r.id,icon:null,avatarUrl:Nt(r,88),fallbackIcon:"user",isCurrent:r.id===n,disabled:!1,disabledReason:null}})}function W(e){if(U&&(U=!1,I.classList.add("hidden"),!!e)){var t=C[V];!t||t.disabled||(Ce==="mate"?t.key!==ya()&&ro(t.key):t.key!==o.get("currentSlug")&&je(t.key))}}function qe(e){if(C.length!==0){for(var t=e>0?1:-1,n=V,r=0;r<C.length;r++)if(n=(n+t+C.length)%C.length,!C[n].disabled){V=n,pt();return}}}function Fi(){if(K){K.innerHTML="";for(var e=0;e<C.length;e++)K.appendChild(Hi(C[e],e))}}function Hi(e,t){var n=document.createElement("button");n.type="button",n.className="cmd-palette-item project-switcher-item",e.disabled&&n.classList.add("disabled"),e.disabled&&e.disabledReason&&(n.title=e.disabledReason),e.external&&(n.title=eo(e.title)),n.dataset.index=String(t);var r=document.createElement("div");if(r.className="cmd-palette-item-icon",e.icon)r.textContent=e.icon;else if(e.avatarUrl){var a=document.createElement("img");a.src=e.avatarUrl,a.alt="",a.className="project-switcher-avatar",r.appendChild(a)}else{var s=document.createElement("i");s.setAttribute("data-lucide",e.fallbackIcon||"folder"),r.appendChild(s)}e.external&&to(r,"project-switcher-external-badge"),n.appendChild(r);var i=document.createElement("div");i.className="cmd-palette-item-body";var l=document.createElement("div");l.className="cmd-palette-item-title-row";var c=document.createElement("span");if(c.className="cmd-palette-item-title",c.textContent=e.title,l.appendChild(c),e.isCurrent){var d=document.createElement("span");d.className="project-switcher-current",d.textContent="current",l.appendChild(d)}if(e.disabled&&e.disabledReason){var u=document.createElement("span");u.className="project-switcher-disabled-reason",u.textContent=e.disabledReason,l.appendChild(u)}return i.appendChild(l),n.appendChild(i),n.addEventListener("mouseenter",function(){e.disabled||(V=t,pt())}),n.addEventListener("click",function(){e.disabled||(V=t,W(!0))}),n}function pt(){if(K){for(var e=K.querySelectorAll(".cmd-palette-item"),t=0;t<e.length;t++)e[t].classList.toggle("active",t===V);var n=e[V];n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest"})}}var qi=/^[a-zA-Z0-9_-]{1,120}$/;function mt(){return Array.prototype.filter.call(document.querySelectorAll("iframe"),function(e){try{var t=new URL(e.src,window.location.href);return t.origin===window.location.origin&&t.searchParams.get("pane")==="1"}catch{return!1}})}function gt(e){var t=Ro();try{e.contentWindow&&e.contentWindow.postMessage({type:"clay-appearance",snapshot:t},window.location.origin)}catch{}}function Sa(e){return typeof e=="string"&&qi.test(e)}function ht(e){return e===null||Sa(e)}function Vi(e){var t=e&&typeof e=="object"?e.preference:null;return!t||typeof t!="object"||!Sa(e.themeId)||e.userId!==null&&(typeof e.userId!="string"||!e.userId||e.userId.length>200)||typeof t.configured!="boolean"||t.mode!==null&&t.mode!=="light"&&t.mode!=="dark"?!1:ht(t.theme)&&ht(t.lightTheme)&&ht(t.darkTheme)}function wa(){if(o.get("paneMode")){if(window.parent===window)return;window.addEventListener("message",function(e){if(!(e.origin!==window.location.origin||e.source!==window.parent)){var t=e.data;if(!(!t||t.type!=="clay-appearance"||!Vi(t.snapshot))){var n=o.get("myUserId")||null;n!==null&&t.snapshot.userId!==n||Do(t.snapshot)}}});return}To(function(){mt().forEach(gt)}),o.subscribe(function(e,t){e.myUserId!==t.myUserId&&mt().forEach(gt)}),document.addEventListener("load",function(e){e.target&&e.target.tagName==="IFRAME"&&mt().indexOf(e.target)>=0&>(e.target)},!0)}var Wi=500,ka=10,ue=null,vt=0,bt=0,Me=!1,Ca=null;function Ve(){ue&&(clearTimeout(ue),ue=null)}function Ma(){"ontouchstart"in window&&(document.addEventListener("touchstart",function(e){if(e.touches.length!==1){Ve();return}var t=e.touches[0];vt=t.clientX,bt=t.clientY,Me=!1,Ca=e.target,ue=setTimeout(function(){ue=null,Me=!0,navigator.vibrate&&navigator.vibrate(30);var n=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,clientX:vt,clientY:bt});Ca.dispatchEvent(n)},Wi)},{passive:!0}),document.addEventListener("touchmove",function(e){if(ue){var t=e.touches[0],n=t.clientX-vt,r=t.clientY-bt;n*n+r*r>ka*ka&&Ve()}},{passive:!0}),document.addEventListener("touchend",function(e){Ve(),Me&&(Me=!1,e.preventDefault())},{passive:!1}),document.addEventListener("touchcancel",function(){Ve(),Me=!1},{passive:!0}))}var Ea=!1,Pa=!1;function yt(e){return/^\/p\/[a-z0-9_-]+(?:\/|$)/.test(e||"")}function zi(e){return e?e.paneMode||yt(e.pathname)||e.currentSlug?"project":e.projectsLoaded!==!0?"wait":"projects":"wait"}function xa(){document.body.classList.remove("home-surface-boot-pending");var e=document.getElementById("connect-overlay");e&&o.get("connected")&&e.classList.add("hidden")}function Gi(e){return e?"/p/"+e+"/":null}function Ia(e){if(!Pa){var t=zi({surfaceLoaded:e.homeSurfaceLoaded,projectsLoaded:e.projectListLoaded,dockLoaded:e.homeDockPreferenceLoaded,surface:e.homePrimarySurface,currentSlug:e.currentSlug,pathname:location.pathname,paneMode:e.paneMode});if(t!=="wait"){if(Pa=!0,t==="project"){if(!yt(location.pathname)){var n=Gi(e.currentSlug);n&&history.replaceState(null,"",n)}o.set({homeSurfaceBootResolved:!0}),xa();var r=document.getElementById("input");r&&!r.disabled&&r.focus({preventScroll:!0});return}o.set({homeSurfaceBootResolved:!0,projectsHubRestoreRequested:!0}),xa()}}}function La(){if(!Ea){if(Ea=!0,!yt(location.pathname)&&!o.get("paneMode")){document.body.classList.add("home-surface-boot-pending");var e=document.getElementById("connect-overlay-msg");e&&(e.textContent="Restoring your workspace\u2026")}o.subscribe(function(t){Ia(t)}),Ia(o.snap())}}var Ki=3600*1e3,Yi="(max-width: 768px)",St=null,wt=!1;function Qi(e){if(typeof e!="number"||!isFinite(e)||e<0)return"";if(e=Math.floor(e),e<1e3)return String(e);for(var t=[[1e6,"m"],[1e3,"k"]],n=0;n<t.length;n++)if(e>=t[n][0]){var r=Math.floor(e/t[n][0]*10)/10;return(r%1===0?String(r):r.toFixed(1))+t[n][1]}return String(e)}function Ra(){var e=o.get("githubStarCount"),t=document.getElementById("github-star-count"),n=document.getElementById("github-star-link");if(!(!t||!n)){var r=typeof e=="number"?Qi(e):"";t.textContent=r,t.classList.toggle("hidden",!r),n.setAttribute("aria-label",r?"Star Clay on GitHub, "+e+" stars":"Star Clay on GitHub")}}function Ji(){return!!(window.matchMedia&&window.matchMedia(Yi).matches)}function Ta(){return wt||Ji()?Promise.resolve():(wt=!0,fetch("/api/github-stars",{credentials:"same-origin"}).then(function(e){return e.ok?e.json():null}).then(function(e){e&&typeof e.stars=="number"&&(o.set({githubStarCount:e.stars}),Ra())}).catch(function(){}).then(function(){wt=!1}))}function Da(){document.getElementById("github-star")&&(Ra(),Ta(),St&&clearInterval(St),St=setInterval(Ta,Ki))}function ja(){o.subscribe(function(e,t){if(e.sessionOriginId!==t.sessionOriginId||e.currentSlug!==t.currentSlug){o.set({activeBackgroundTasks:[],backgroundTaskCatalog:[]});return}e.backgroundTaskViewer!==t.backgroundTaskViewer&&document.querySelectorAll("[data-background-task]").forEach(function(n){var r=e.backgroundTaskViewer;n.setAttribute("aria-expanded",String(!!r&&n.dataset.backgroundTask===r.taskId))}),(e.activeBackgroundTasks!==t.activeBackgroundTasks||e.backgroundTaskCatalog!==t.backgroundTaskCatalog)&&Ba()}),Ba()}function $i(e,t){if(typeof e!="number"||!isFinite(e)||e<=0)return"";var n=typeof t=="number"?t:Date.now(),r=Math.floor((n-e)/1e3);if(r<0&&(r=0),r<60)return r+"s";var a=Math.floor(r/60),s=r%60;if(a<60)return a+"m "+Aa(s)+"s";var i=Math.floor(a/60);return i+"h "+Aa(a%60)+"m"}function Aa(e){return e<10?"0"+e:String(e)}function Xi(e){return!!(e&&e.ambient===!0)}function Zi(e){for(var t=[],n=[],r=Array.isArray(e)?e:[],a=0;a<r.length;a++)r[a]&&(Xi(r[a])?n.push(r[a]):t.push(r[a]));return{user:t,ambient:n}}function Ba(){var e=document.getElementById("background-tasks-bar");e&&e.remove();var t=Zi(o.get("backgroundTaskCatalog")||o.get("activeBackgroundTasks")||[]),n=t.user.length?t.user.concat(t.ambient):[],r=document.getElementById("background-task-tabs");if(!n.length){r&&r.remove();return}var a=document.getElementById("messages");if(a){r||(r=document.createElement("div"),r.id="background-task-tabs",r.className="split-view-workers background-task-tabs",r.setAttribute("aria-label","Background tasks"),a.parentNode.insertBefore(r,a));var s=JSON.stringify(n.map(function(i){return[i.task_id,i.run_id,i.active,i.description]}));r.dataset.signature!==s&&(r.dataset.signature=s,r.textContent="",n.forEach(function(i){var l=document.createElement("span");l.className="split-view-worker-pill"+(i.ambient?" background-task-ambient":"");var c=document.createElement("button");c.type="button",c.className="split-view-worker-chip",c.dataset.backgroundTask=i.task_id,En(c,$e(i)),i.preview&&Mn($e(i),i.preview,!1),c.title=(i.ambient?"Housekeeping \xB7 ":"")+(i.description||"Background task")+(i.started_at?" \xB7 "+$i(i.started_at):"")+(i.active===!1?" \xB7 Finished":" \xB7 Running"),c.setAttribute("aria-haspopup","dialog");var d=o.get("backgroundTaskViewer");c.setAttribute("aria-expanded",String(!!d&&d.taskId===i.task_id));var u=document.createElement("span");u.className="split-view-worker-dot",u.dataset.state=i.active===!1?"ready":"working";var p=document.createElement("span");if(p.className="split-view-worker-name",p.textContent=i.description||"Background task",u.setAttribute("aria-label",i.active===!1?"Finished":"Running"),c.append(u,p),c.addEventListener("click",function(){Pn(i)}),l.appendChild(c),i.active!==!1){var m=document.createElement("button");m.type="button",m.className="split-view-worker-remove",m.setAttribute("aria-label","Stop "+(i.description||"background task")),m.title="Stop task",m.innerHTML=ee("square"),m.addEventListener("click",function(){var v=w();v&&v.readyState===1&&v.send(JSON.stringify({type:"background_task_stop",requestId:crypto.randomUUID(),taskId:i.task_id,runId:i.run_id||null,sessionOriginId:o.get("sessionOriginId")}))}),l.appendChild(m)}r.appendChild(l)}),D())}}var Pt=new URLSearchParams(location.search),pe=Pt.get("pane")==="1";pe&&typeof performance<"u"&&performance.mark&&performance.mark("clay:app-evaluated");var Q=Number(Pt.get("session"));(!Number.isSafeInteger(Q)||Q<1)&&(Q=null);pe&&document.body.classList.add("pane-mode");var ze=location.pathname.match(/^\/p\/([a-z0-9_-]+)/),es=document.body.dataset.homeProjectSlug||null,xe=ze?ze[1]:es,z=xe?"/p/"+xe+"/":"/",fe=xe?"/p/"+xe+"/ws":"/ws";pe&&(fe+="?pane=1",Q&&(fe+="&session="+Q),Pt.get("contextual")==="1"&&(fe+="&contextual=1"));var f=function(e){return document.getElementById(e)},L=f("messages"),Ke=f("input"),ts=f("send-btn");var Mt=f("header-title"),fh=f("header-rename-btn"),ns=f("slash-menu"),ph=f("suggestion-chips"),rs=f("sidebar"),os=f("sidebar-overlay"),za=f("session-list"),as=f("new-session-btn"),is=f("hamburger-btn"),ss=f("sidebar-toggle-btn"),ls=f("sidebar-expand-btn"),ds=f("image-preview-bar"),mh=f("connect-overlay");var cs="/claude-code-avatar.png";function Ga(e){Be(e)}function us(){return!1}function Ka(){var e=document.getElementById("icon-strip-add");e&&e.click()}function Ya(e){$r(e)}function fs(){Xr()}var gh=f("project-list-section"),hh=f("project-list"),vh=f("project-list-add"),ps=f("project-hint"),Ua=f("project-hint-dismiss"),Ge=xe||null;document.addEventListener("keydown",function(e){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="z"){var t=document.activeElement,n=t&&t.tagName;(n==="TEXTAREA"||n==="INPUT"||t&&t.isContentEditable)&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?document.execCommand("redo",!1,null):document.execCommand("undo",!1,null))}},!0);document.addEventListener("keydown",function(e){e.key==="Escape"&&It()});Ua&&Ua.addEventListener("click",function(){ps.classList.add("hidden");try{localStorage.setItem("clay-project-hint-dismissed","1")}catch{}});f("mermaid-modal").querySelector(".confirm-backdrop").addEventListener("click",nt);f("mermaid-modal").querySelector(".mermaid-modal-btn[title='Close']").addEventListener("click",nt);f("image-modal").querySelector(".confirm-backdrop").addEventListener("click",It);f("image-modal").querySelector(".image-modal-close").addEventListener("click",It);function xt(e){on(e)}function It(){an()}var Qa="";try{Ee=localStorage.getItem("clay-project-name-"+(Ge||"default")),Ee&&(Qa=Ee,Mt&&(Mt.textContent=Ee),kt=f("title-bar-project-name"),kt&&(kt.textContent=Ee)),Ct=localStorage.getItem("clay-project-icon-"+(Ge||"default")),Ct&&(Pe=f("title-bar-project-icon"),Pe&&(Pe.textContent=Ct,Ue(Pe),Pe.classList.add("has-icon")))}catch{}var Ee,kt,Ct,Pe;function Ja(e,t,n,r){sn(e,t,n,r)}Dt({networkSettings:{loaded:!1,busy:!1,confirming:!1,draft:"",saved:"",status:"",errorKind:"",requestId:0},vendorLoginBrowser:null,githubStarCount:null,sharedBrowser:null,sharedBrowsers:[],mcpSkillsWorkbench:{},mateKnowledgeWorkspaces:{},mateColorSave:null,mcpConnections:{screen:"list",servers:[],search:"",loaded:!1},sharedBrowserOpen:!1,sharedBrowserUi:{},sharedBrowserSettings:{},browserLinksBound:!1,basePath:z,wsPath:fe,paneMode:pe,paneSessionId:Q,panePinPending:pe&&!!Q,paneCommittedBinding:null,panePendingBinding:null,paneReady:!1,paneSuspended:!1,paneActivationGeneration:0,paneActivationTimer:null,panePointerBinding:null,paneRichDrafts:{},paneLayoutScrollLock:null,paneLastUserScrollTop:null,paneUserScrollIntent:null,paneUserScrollRevision:0,sessionRichDrafts:{},sessionActionEpoch:0,composerUploadingCount:0,deferredSessionSwitch:null,paneCallbackBinding:null,paneActionEvents:[],paneHeldKeys:{},rewindAction:null,handoffAction:null,authIdentityLoaded:!1,splitIdentityBlockedSocket:null,splitIdentityHydrated:!1,paneActivationUnsupported:!1,paneBindingSessions:[],splitPanes:null,splitGroups:[],splitViewWorkerConversation:null,splitViewWorkerRemoval:null,projectSplitViews:[],projectSplitViewRevision:0,projectSplitViewContextKey:null,projectSplitViewHydrated:!1,projectSplitViewPending:null,projectSplitViewError:"",projectSplitViewActiveId:null,projectSplitViewFocusedOrigin:null,projectSplitViewPreviewTree:null,projectSplitViewDrag:null,splitViewOrganizationDrag:null,projectSplitViewDividerDrag:null,projectSplitViewTranscriptScroll:{},projectSplitViewSuppressClick:null,projectSplitViewSocketGeneration:0,projectSplitViewRequestSocket:null,projectSplitViewRequestGeneration:null,projectSplitViewRequestOwnerId:null,projectSplitViewRequestSlug:null,sessionFolders:null,sessionFoldersSlug:null,sessionFolderCreate:null,sidebarCreationEffects:[],sessionSearch:null,sessionFolderViewMenu:null,sessionFolderLayouts:{},sessionFolderDrag:null,sessionFolderMenu:null,sessionFolderContext:null,sessionFolderModal:null,sessionContextMenu:null,sessionInlineRename:null,splitDelegations:{},pairResultStatus:[],notesTemporarilyHidden:!1,pairResultTrayOpen:!1,dmMode:!1,historyFrom:0,loadingMore:!1,historyTotal:0,replayingHistory:!1,historyReplayBatch:null,pendingSessionEntryNavigation:null,sessionEntryHighlight:null,sessionNavigationRequestId:null,projectName:Qa,cwd:"",currentSlug:Ge,githubWorkPopoverBound:!1,githubWorkSessions:[],githubWorkProject:null,githubWorkRefresh:null,workPrimaryPending:null,activeProjectSlug:null,activeProjectMateId:null,activeProjectMateName:"",clayReturnTarget:null,contextualPrepared:null,contextualSubmitted:{},contextualClay:{mode:"closed",mateId:null},contextualConversationHistory:null,contextualConversationRequest:null,clayControlActivity:null,clayControlOrder:0,clayControlReceipts:[],clayControlForwarded:null,controlRuntimeId:null,studioDocumentSource:null,studioDocumentView:null,clayStudioRelays:{},clayStudioForwarded:{},clayStudioSurfaces:{},clayControlNotifications:[],clayControlFileView:null,clayControlTerminalViews:[],clayControlGitView:null,clayNavigationRendering:null,clayControlViewerRef:null,contextualSessionReady:!1,contextualSessionReceived:!1,contextualSessionUnavailable:!1,clayReturnPendingProjectSlug:null,activeSessionMateId:null,activeSessionMateName:"",sessionActivatedProjectSlug:null,sessionListProjectSlug:null,splitGroupsProjectSlug:null,socketPath:null,pendingHomeProjectSlug:null,homeProjectEmptyVisible:!1,homeShellVisible:!1,projectMateFilterMode:"all",projectMateFilterTurns:0,projectMateFilterActivated:!1,projectMateCreationActive:!1,projectMateCreationMateId:null,projectMateCreationSessionId:null,projectMateCreationRequestId:null,projectMateCreationPendingStart:!1,projectMateCreationAwaitingHistory:!1,projectMateCreationAwaitingMateList:!1,projectMateCreationHistoryReady:!1,projectMateCreationLocalId:null,projectMateCreationMessages:[],projectMateCreationPendingMateId:null,projectDebatePlanningActive:!1,projectDebatePlanningMateId:null,projectDebatePlanningSessionId:null,projectDebatePlanningLocalId:null,projectDebatePlanningRequestId:null,projectDebatePlanningPendingStart:!1,projectDebatePlanningAwaitingHistory:!1,projectDebatePlanningAwaitingMateList:!1,projectDebatePlanningHistoryReady:!1,projectDebatePlanningTopic:"",projectDebatePlanningMessages:[],projectDebatePlanningError:"",projectDebatePlanningRetryable:!1,debatesWorkbenchStatus:"idle",debatesWorkbenchRequestId:null,debatesWorkbenchItems:[],debatesWorkbenchError:"",debatesWorkbenchFilter:"all",debatesWorkbenchCreating:!1,debatesWorkbenchWide:!1,debatesWorkbenchFullscreen:!1,debatesWorkbenchScrollTop:0,pendingDebateNavigation:null,pendingProjectSessionNavigation:null,projectsHubVisible:!1,projectsHubMarkup:null,projectsHubList:[],projectListLoaded:!1,projectsAccessLoaded:!1,projectsHubRestoreRequested:!1,projectStart:br(),projectStartFolder:yr(),onboardingStep:"welcome",onboardingIntent:null,currentProjectOwnerId:null,isOsUsers:!1,skipPermsEnabled:!1,autonomousSelectedMode:"normal",autonomousArming:!1,autonomousArmToken:null,autonomousArmRequestId:null,autonomousArmSessionId:null,autonomousActionRequestId:null,autonomousActionSessionId:null,autonomousCriteria:"",autonomousMaxContinuations:10,autonomousMaxMinutes:60,autonomousRun:null,autonomousExpanded:!1,loopInterviewBrief:null,loopInterviewEditing:!1,loopInterviewRunRequestId:null,loopInterviewRunSessionId:null,loopInterviewStarting:!1,loopInterviewRequestId:null,loopInterviewSessionId:null,slashCommands:[],processing:!1,scheduledMessageCorrelation:null,activeSessionId:null,speechActive:null,speechSettings:null,speechSettingsRequest:0,speechSettingsSaving:!1,speechSettingsError:"",speechPopup:null,speechRetry:null,speechLang:"en-US",speechStatuses:{},speechErrors:{},speechLanguageSaving:!1,speechLifecycleBound:!1,askUserRequests:{},activeBackgroundTasks:[],backgroundTaskCatalog:[],backgroundTaskViewer:null,splitSessionPicker:null,splitSessionCreation:null,agentMessagePreviews:{},agentMessageBubble:null,workerMessagePreviewSubscription:null,sessionVendorBound:!1,cliSessionId:null,isHeadlessMode:!1,savedMainSlug:null,connected:!1,fileReadRequest:null,filePaneInstances:{},activeFilePaneId:null,fileViewerIsPlantUml:!1,plantUmlPreviewJob:null,wireframeDraft:null,wireframeRenderQueue:[],wireframeRenderActive:null,wireframeRenderCache:[],pendingFileNavigation:null,rightWorkbenchOwner:null,rightWorkbenchRevision:0,fileViewerOpenRevision:0,cursorSharingEnabled:!1,cursorSharingHydrated:!1,cursorSharingPending:null,pendingOutboundMessages:[],pendingMessageQueue:{projectSlug:null,sessionId:null,revision:0,paused:!1,items:[],loading:!1,error:""},pendingMessageQueueRecovery:!1,pendingMessageQueueRequests:{},pendingMessageQueueEdit:null,pendingMessageQueueDrag:null,pendingMessageQueueFocusReturn:null,searchClayChatState:null,homeChatMateId:null,homeChatSessionId:null,homeChatSessionModel:null,homeChatSessionVendor:null,homeChatSessionModelLoading:!1,homeMateSessions:{},homeActiveSessionByMate:{},homePreferredMateId:null,homeSidebarCollapsed:!1,homeMatesCollapsed:!1,homeChatScope:"all",homeSubSurface:"chat",homeDebatesStatus:"idle",homeDebates:[],homeDebatesRequestId:null,homeDebatesError:"",homeSurfaceLoaded:!1,homePrimarySurface:null,homeSurfaceProjectSlug:null,homeSurfaceIntent:null,homeSurfaceBootResolved:!1,homeSurfaceRestoreRequested:!1,dockActiveToolId:null,dockOpen:!1,homeDockPreferenceLoaded:!1,dockFocus:!1,dockLibraryOpen:!1,dockBackstageOpen:!1,dockWidth:null,dockHasActivity:!1,dockActivityToolId:null,you:{},youActivity:{},youSequence:0,projectLogsOpen:!1,projectLogsWide:!1,projectLogsFullscreen:!1,projectLogsEntries:[],projectLogsSelectedRef:null,projectLogsView:"list",projectLogsCategory:"",projectLogsContextMode:"",projectLogsIsWorktree:!1,projectLogsListScroll:0,projectLogsListRequestId:null,projectLogsReadRequestId:null,projectLogsCommentRequestId:null,projectLogsCommentStatusEl:null,projectLogsDeleteRequestId:null,projectLogsCanDelete:!1,projectLogsUnread:0,projectLogsSeenRevisions:{},scheduledResultUnread:0,scheduledResultAutoFocusHandled:!1,scheduledResultFocusRef:null,scheduledResultPendingReadRef:null,scheduledResultSeenRefs:{},scheduledResultSessionRequestId:null,issuesOpen:!1,issuesView:"list",issuesSelected:null,issuesRows:[],issuesRequests:{},issueGithub:null,issuesViewRequest:null,issuesViewGeneration:0,issuesUpdateAvailable:null,issuesCache:{},issuesEpoch:0,issuesSearchTimer:null,issueLinkRequests:{},issueLinkOpenRef:null,scheduledTasksOpen:!1,scheduledTasksWide:!1,scheduledTasksFullscreen:!1,scheduledTaskRecords:[],scheduledTaskDraft:null,scheduledTaskEditingId:null,scheduledTaskNewSessionPending:!1,scheduledTaskInterviewRequestId:null,scheduledTaskActionRequestId:null,scheduledTaskListRequest:null,scheduledTaskInterviewId:null,scheduledTaskExpandedId:null,scheduledTaskDeleteId:null,scheduledTaskDraftForm:null,scheduledTaskEditForm:null,scheduledTaskCreateMenuOpen:!1,scheduledTaskManualRequest:null,installedTools:[],capsulesEnabled:!1,capsulesPreferenceLoaded:!1,homeToolRegistryLoaded:!1,toolScanErrors:[],defaultAiState:{loading:!1,saving:!1,refreshRequestId:null,saveRequestId:null,catalogRequestIds:{},catalogs:{},preference:null,selection:null,installedVendors:[],accountAvailable:!0,accountId:null,serverEpoch:null,canonicalRevision:0,error:""},defaultAiDraft:{vendor:"",model:"",effort:""},defaultAiDraftDirty:!1,defaultVendorState:{loading:!1,saving:!1,getRequestId:null,saveRequestId:null,preference:null,preferencePresent:!1,installedVendors:[],accountId:null,projectSlug:null,serverEpoch:null,canonicalRevision:0,error:""},projectSessionVisibilityState:{active:null,pending:null},dmTargetUser:null,dmKey:null,cachedMatesList:[],cachedDmFavorites:[],cachedAvailableBuiltins:[],projectMateDmsEnabled:!0,returningFromMateDm:!1,pendingMateInterview:null,pendingTermCommand:null,shellCommandMode:!1,shellCommandRunning:!1,pendingShellCommandId:null,mateProjectSlug:null,myUserId:null,contextViewPreferenceState:{mode:"off",canonicalMode:"off",preferencePresent:!1,loading:!1,saving:!1,requestId:null,saveRequestId:null,pendingSaves:[],accountId:null,serverEpoch:null,rejectedEpoch:null,canonicalRevision:0,error:""},contextViewOverride:null,isMultiUserMode:!1,dmUnread:{},dmRemovedUsers:{},cachedAllUsers:[],cachedOnlineIds:[],cachedDmConversations:[],sessionDrafts:{},messageUuidMap:[],currentMsgTs:null,richContextUsage:null,contextMeasurement:"unavailable",currentMsgEl:null,currentFullText:"",matePreThinkingEl:null,thinkingState:null,fileViewerFullscreen:!1,markdownSlidesActive:!1,markdownSlideIndex:0,markdownSlideCount:0,markdownSlideLevel:1,markdownSlidePreferredLevel:1,markdownSlideLevelExplicit:!1,currentModel:"",currentModels:[],modelListVendor:"",modelListStatus:"idle",modelListError:"",modelRequestId:"",modelSelectionPending:null,modelSelectionError:"",lastVendor:"",vendorInfo:{},rateLimitState:{},vendorUsageOverview:null,vendorUsageOpen:null,currentMode:"default",effectivePermissionMode:null,permissionCapabilities:{auto:!1,mcpOverride:!1},permissionModePendingByTarget:{},mcpPermissionModePendingByTarget:{},mcpPermissionModeOverrides:{},currentEffort:"medium",currentBetas:[],currentThinking:"adaptive",currentThinkingBudget:1e4,sessionFullAccess:!1,codexApproval:null,codexSandbox:null,codexWebSearch:null,ctxPopoverVisible:!1,headerContextEl:null,loopActive:!1,loopAvailable:!1,loopIteration:0,loopMaxIterations:0,loopBannerName:null,ralphPhase:"idle",ralphCraftingSessionId:null,ralphCraftingSource:null,ralphFilesReady:{promptReady:!1,judgeReady:!1,bothReady:!1},ralphPreviewContent:{prompt:"",judge:""},execModalShown:!1,debateStickyState:null,debateFloorMode:!1,debateConcludeMode:!1,debateEndedMode:!1,knownInstalledSkills:{},permissions:null,wizardData:{name:"",task:"",maxIterations:null,cron:null}});gr({$:f,get ws(){return w()},get connected(){return o.get("connected")},get processing(){return o.get("processing")},messagesEl:L,addSystemMessage:ni});Ao();wa();kn();Ma();var ms={$:f,get ws(){return w()},get connected(){return o.get("connected")},get projectName(){return o.get("projectName")},messagesEl:L,sessionListEl:za,sidebar:rs,sidebarOverlay:os,sidebarToggleBtn:ss,sidebarExpandBtn:ls,hamburgerBtn:is,newSessionBtn:as,headerTitleEl:Mt,showConfirm:Ja,onFilesTabOpen:function(){_o(),Oo(),H()&&F()},requestKnowledgeList:function(){qn()},switchProject:function(e){ri(e)},openTerminal:function(){Lo()},showHomeHub:function(){Ga()},getUpcomingSchedules:fn,get multiUser(){return o.get("isMultiUserMode")},get myUserId(){return o.get("myUserId")},get projectOwnerId(){return o.get("currentProjectOwnerId")},get ownerLocked(){return o.get("ownerLocked")},openDm:function(e){Ya(e)},openMateWizard:function(){Ka()},openAddProjectModal:function(){Sr()},sendWs:function(e){var t=w();t&&t.readyState===1&&t.send(JSON.stringify(e))},onDmRemoveUser:function(e){var t=Object.assign({},o.get("dmRemovedUsers"));t[e]=!0,o.set({dmRemovedUsers:t})},getHistoryFrom:function(){return o.get("historyFrom")},get permissions(){return o.get("permissions")},get projectList(){return ge()||[]},availableBuiltins:function(){return o.get("cachedAvailableBuiltins")||[]}};ma();_e([Bo,Un,_n,Qt,Nn,Jt,vr,Gr]);xo(ms);var Lt=function(){return w()};Vn(Lt);Fn(Lt);_e([rr]);On(Lt,{onShow:function(){Hn(),wo()}});ao({switchProject:function(e){ri(e)},currentSlug:function(){return o.get("currentSlug")},matesList:function(){return o.get("cachedMatesList")||[]},availableBuiltins:function(){return o.get("cachedAvailableBuiltins")||[]},allUsers:function(){return o.get("cachedAllUsers")||[]},dmConversations:function(){return o.get("cachedDmConversations")||[]},myUserId:function(){return o.get("myUserId")},selectSession:function(e){H()&&F();var t=document.getElementById("sticky-notes-panel");if(t&&!t.classList.contains("hidden")){var n=document.getElementById("sticky-notes-sidebar-btn");n&&n.click()}var r=w();r&&r.readyState===1&&r.send(JSON.stringify({type:"switch_session",id:e}))},openDm:function(e){Ya(e)},runAction:function(e){switch(e){case"createMate":Ka();break;case"openSettings":pn();break;case"showHome":Ga();break}}});ba();Bn();Yt();function gs(e){yn(e)}function hs(){Sn()}function vs(e){wn(e)}function bs(){po()}function ys(){mo()}function $a(){Ln()}function Xa(){Tn()}function Ss(){Rn()}function ws(){Dn()}function Tt(e){Vt(e)}var Y=f("new-msg-btn"),_a="\u2193 Latest";function Et(){var e=f("input-area");e&&(Y.style.bottom=e.offsetHeight+12+"px")}var Na=f("input-area");Na&&window.ResizeObserver?new ResizeObserver(Et).observe(Na):window.addEventListener("resize",Et);Et();L.addEventListener("scroll",function(){if(!Ot()){var e=L.scrollHeight-L.scrollTop-L.clientHeight,t=e>150;qt(t),t?(Y.classList.contains("hidden")&&(Y.textContent=_a),Y.classList.remove("hidden")):(Y.classList.add("hidden"),Y.textContent=_a)}});Y.addEventListener("click",function(){Za()});document.addEventListener("visibilitychange",function(){document.hidden||Ie()});L.addEventListener("click",function(e){var t=e.target.closest(".msg-action-fork");if(t){var n=t.closest("[data-uuid]");if(!(!n||!n.dataset.uuid)){var r=n.dataset.uuid;Ja("Fork session from this message?",function(){var a=w();a&&a.readyState===1&&a.send(JSON.stringify({type:"fork_session",uuid:r}))},"Fork",!1)}}});function Ie(){Wt()}function Za(){zt()}rn();bn();Pr();or();Fr();Ur();ja();Kr();Nr();Or();Vr();io();In();An();Ft();Zt({$:f,get ws(){return w()},get connected(){return o.get("connected")},get turnCounter(){return Ht()},messagesEl:L,inputEl:Ke,finalizeAssistantBlock:function(){ks()},addToMessages:function(e){Tt(e)},scrollToBottom:function(){Ie()},setActivity:function(e){vs(e)},stopUrgentBlink:function(){hs()},showImageModal:xt,getContextPercent:function(){var e=xn();return e.contextWindow>0?Math.round(e.input/e.contextWindow*100):0},isMateDm:function(){return o.get("dmMode")&&o.get("dmTargetUser")&&o.get("dmTargetUser").isMate},getMateName:function(){return o.get("dmTargetUser")&&o.get("dmTargetUser").displayName||"Mate"},getMateAvatarUrl:function(){return document.body.dataset.mateAvatarUrl||""},getClaudeAvatar:function(){return cs},getMateById:function(e){var t=o.get("cachedMatesList");if(!e||!t)return null;for(var n=0;n<t.length;n++)if(t[n].id===e)return t[n];return null}});function ei(e,t,n,r,a){lo(e,t,n,r,a)}function ti(e,t){uo(e,t)}function ks(){fo()}function ni(e,t){co(e,t)}function Cs(){ho()}function Ms(){Rr()}function ri(e){je(e)}window.addEventListener("popstate",function(){if(/^\/projects\/?$/.test(location.pathname)){Be(!0);return}Cr();var e=location.pathname.match(/^\/p\/([a-z0-9_-]+)/),t=e?e[1]:null;if(!t){Be(!0);return}nr("project",t),us()&&void 0,t&&t!==o.get("currentSlug")&&(Uo(),ne(),H()&&F(),cn(t),o.set({currentSlug:t}),z="/p/"+t+"/",fe="/p/"+t+"/ws",o.set({basePath:z,wsPath:fe}),Ms(),oi())});function oi(){Qr()}so({get ws(){return w()},get connected(){return o.get("connected")},get processing(){return o.get("processing")},get basePath(){return z},inputEl:Ke,sendBtn:ts,slashMenu:ns,messagesEl:L,imagePreviewBar:ds,slashCommands:function(){return o.get("slashCommands")},messageUuidMap:function(){return o.get("messageUuidMap")},addUserMessage:ei,addSystemMessage:ni,toggleUsagePanel:$a,toggleStatusPanel:Xa,toggleContextPanel:ws,resetContextData:Ss,showImageModal:xt,hideSuggestionChips:Cs,getGhostSuggestion:function(){return go()},setSendBtnMode:gs,isDmMode:function(){return o.get("dmMode")&&!(o.get("dmTargetUser")&&o.get("dmTargetUser").isMate)},getDmKey:function(){return o.get("dmKey")},handleDmSend:function(){fs()},isDebateEndedMode:function(){return o.get("debateEndedMode")},handleDebateEndedSend:function(){handleDebateEndedSend()},isDebateConcludeMode:function(){return o.get("debateConcludeMode")},handleDebateConcludeSend:function(){xs()},isDebateFloorMode:function(){return o.get("debateFloorMode")},handleDebateFloorSend:function(){Ls()},isMateDm:function(){return o.get("dmMode")&&o.get("dmTargetUser")&&o.get("dmTargetUser").isMate},getDmMateId:function(){var e=o.get("dmTargetUser");return o.get("dmMode")&&e&&e.isMate?e.id:null},getMateName:function(){return o.get("dmTargetUser")&&o.get("dmTargetUser").displayName||"Mate"},getMateAvatarUrl:function(){return document.body.dataset.mateAvatarUrl||""},showMatePreThinking:function(){ys()},showClaudePreThinking:function(){bs()},myUserId:function(){return o.get("myUserId")},myDisplayName:function(){var e=null;try{e=JSON.parse(localStorage.getItem("clay_my_user")||"null")}catch{}return e&&(e.displayName||e.username)||document.body.dataset.myDisplayName||"Me"}});hr();Wr({get ws(){return w()},get connected(){return o.get("connected")},inputEl:Ke,messagesEl:L,matesList:function(){return o.get("cachedMatesList")||[]},availableBuiltins:function(){return o.get("cachedAvailableBuiltins")||[]},allUsers:function(){return o.get("cachedAllUsers")||[]},myUserId:function(){return o.get("myUserId")},scrollToBottom:Ie,addUserMessage:ei,addCopyHandler:ti,addToMessages:Tt,showImageModal:xt,showPasteModal:nn});xr({get ws(){return w()},sendWs:function(e){var t=w();t&&t.readyState===1&&t.send(JSON.stringify(e))},messagesEl:L,addToMessages:function(e){Tt(e)},scrollToBottom:Ie,addCopyHandler:ti,matesList:function(){return o.get("cachedMatesList")||[]},availableBuiltins:function(){return o.get("cachedAvailableBuiltins")||[]},currentMateId:function(){return o.get("dmTargetUser")&&o.get("dmTargetUser").isMate?o.get("dmTargetUser").id:o.get("homeChatMateId")||null},requireSkills:Ps,showDebateEndedMode:function(e){Is(e)}});na();tr({basePath:z});mn();fr({basePath:z});function Es(){ln()}fetch("/api/me").then(function(e){return e.json()}).then(function(e){if(e.multiUser&&(o.set({isMultiUserMode:!0}),document.body&&document.body.classList.add("is-multi-user")),e.user&&e.user.id&&(o.set({myUserId:e.user.id}),gn()),o.set({authIdentityLoaded:!0}),o.set({permissions:e.permissions||null,projectsAccessLoaded:!0}),e.mustChangePin&&Es(),!o.get("isMultiUserMode")){var t=document.getElementById("icon-strip-users");t&&(t.innerHTML="",t.classList.add("hidden"))}sa();var n=o.get("permissions");if(n){if(!n.terminal){var r=document.getElementById("terminal-toggle-btn");r&&(r.style.display="none");var a=document.getElementById("terminal-sidebar-btn");a&&(a.style.display="none");var s=document.getElementById("shell-command-btn");s&&(s.style.display="none");var i=document.getElementById("input-more-shell");i&&(i.style.display="none")}if(!n.fileBrowser){var l=document.getElementById("file-browser-btn");l&&(l.style.display="none");var c=document.getElementById("git-placard");c&&(c.style.display="none")}if(!n.skills){var d=document.getElementById("skills-btn");d&&(d.style.display="none");var u=document.getElementById("mate-skills-btn");u&&(u.style.display="none")}if(!n.scheduledTasks){var p=document.getElementById("scheduler-btn");p&&(p.style.display="none")}if(!n.createProject){var m=document.getElementById("icon-strip-add");m&&(m.style.display="none")}}}).catch(function(){});ir().then(function(e){if(o.get("isMultiUserMode")&&!e){var t=document.getElementById("update-pill-wrap");t&&(t.style.display="none")}});ar({$:f,get ws(){return w()},get connected(){return o.get("connected")},messagesEl:L,sessionListEl:za,scrollToBottom:Ie,forceScrollToBottom:Za,basePath:z,toggleUsagePanel:$a,toggleStatusPanel:Xa});sr();hn(no());vn();jo({get ws(){return w()},get connected(){return o.get("connected")},get activeSessionId(){return o.get("activeSessionId")},get cwd(){return o.get("cwd")},messagesEl:L,fileTreeEl:f("file-tree"),fileViewerEl:f("file-viewer")});_e([Po,Go,$t]);Ho();_r();jn();Io({get ws(){return w()},get connected(){return o.get("connected")},terminalContainerEl:f("terminal-container"),terminalBodyEl:f("terminal-body"),fileViewerEl:f("file-viewer")});en({get ws(){return w()},get connected(){return o.get("connected")}});Zo();(function(){var e=new URLSearchParams(window.location.search),t=e.get("playbook");if(t){setTimeout(function(){Xo(t)},300),e.delete("playbook");var n=e.toString(),r=window.location.pathname+(n?"?"+n:"")+window.location.hash;window.history.replaceState(null,"",r)}})();Gt({messagesEl:L,get ws(){return w()},getHistoryFrom:function(){return o.get("historyFrom")}});var Oa=f("find-in-session-btn");Oa&&Oa.addEventListener("click",function(){Kt()});yo();Eo();vo(function(){re()&&Co()});var Fa=f("sticky-notes-sidebar-btn");Fa&&Fa.addEventListener("click",function(){he(),me(),H()&&F(),re()&&ne(),So(),ko()});var Ha=document.querySelectorAll("#sticky-notes-toggle-btn");for(We=0;We<Ha.length;We++)Ha[We].addEventListener("click",function(){bo()});var We,qa=f("sticky-notes-sidebar-count");qa&&qa.addEventListener("click",function(e){e.stopPropagation(),he(),me(),H()&&F(),re()?ne():Mo()});var Va=f("git-placard-more"),Wa=f("terminal-sidebar-btn");Va&&Va.addEventListener("click",function(){Je(),he(),me(),re()&&ne(),H()&&F()});Wa&&Wa.addEventListener("click",function(){Je(),he(),me(),re()&&ne(),H()&&F()});function Ps(e,t){Hr(e,t)}function xs(){Ir()}function Is(e){Lr(e)}function Ls(){Tr()}tn();mr();dn({get ws(){return w()},get connected(){return o.get("connected")},get activeSessionId(){return o.get("activeSessionId")},basePath:z,currentSlug:Ge,getProjects:function(){return ge()}});jr();Er();Dr();Da();wr();oo();qr();kr();zr();Mr();La();Jr();Yr();lucide.createIcons();pe&&typeof performance<"u"&&performance.mark&&performance.mark("clay:bootstrap-complete");oi();ze&&location.hash==="#scheduler"?setTimeout(function(){un("calendar")},500):ze&&Ke.focus();
|
|
1
|
+
import{$ as $e,$a as Xn,$b as _r,$c as Io,Ab as me,Ac as ao,B as tn,Bc as io,C as nn,Cc as so,D as rn,Dc as lo,E as on,Ea as jn,Eb as vr,Ec as co,F as an,Fb as br,Fc as uo,G as sn,Gb as yr,Gc as fo,H as ln,Hb as Sr,Hc as po,I as dn,Ib as wr,Ic as mo,J as F,Ja as Un,Jb as kr,Jc as go,K as cn,Ka as _n,Kb as Be,Kc as ho,Kd as jo,L as un,La as Nn,Lb as Cr,Lc as vo,M as H,Ma as On,Mb as Mr,Mc as bo,N as fn,Na as Fn,Nb as Er,Nc as yo,O as pn,Oa as Hn,Ob as Pr,Oc as So,Od as Uo,P as mn,Pa as qn,Pb as xr,Pc as wo,Q as gn,Qa as Vn,Qb as Ir,Qc as ko,Qd as _o,R as hn,Ra as Xe,Rb as Lr,S as vn,Sa as Wn,Sb as Tr,Sd as No,T as bn,Ta as zn,Tb as ge,Td as Oo,U as yn,Ua as te,Ub as Rr,Uc as Co,V as Sn,Va as Gn,Vb as je,Vc as Mo,W as wn,Wa as Kn,Wb as Dr,Wc as ne,X as kn,Xa as Yn,Xb as Ar,Xc as re,Y as Cn,Ya as Qn,Yb as Br,Yc as Eo,Z as Mn,Za as Jn,Zb as jr,Zc as Po,_ as En,_a as $n,_b as Ur,_c as xo,_d as Fo,a as Nt,aa as Pn,ab as Zn,ac as Nr,ad as Lo,b as Ot,bb as er,bc as Or,c as Ft,cb as tr,cc as Fr,d as Ht,db as Ze,dc as Hr,e as qt,eb as nr,ec as qr,f as Vt,fc as Vr,g as Wt,gb as rr,gc as Wr,h as zt,hb as or,hc as zr,i as Gt,ib as ar,j as Kt,jb as ir,k as Yt,kb as sr,lb as et,lc as Gr,ma as xn,mb as lr,mc as Kr,na as In,nb as De,nc as Yr,oa as Ln,ob as Ae,oc as Qr,od as To,pa as Tn,pb as dr,pc as Jr,pd as Ro,qa as Rn,qb as cr,qc as $r,qd as Do,r as Je,ra as Dn,rb as ur,rc as Xr,rd as Ao,sa as An,sb as fr,sc as Zr,t as Qt,ta as Bn,tb as pr,tc as eo,td as Ue,ub as mr,uc as to,v as Jt,vb as gr,vc as no,vd as nt,w as Zt,wb as hr,wd as Bo,x as en,xc as tt,yc as ro,zc as oo,zd as he}from"./chunk-UNTZB4WP.js";import"./chunk-FK43VMMW.js";import"./chunk-JIV7O5GN.js";import{g as $t}from"./chunk-HQUGZW4P.js";import{h as Xt}from"./chunk-UQPN3SQX.js";import{A as _t,a as At,b as Bt,f as jt,w as Qe,x as Ut}from"./chunk-LLBLEJM4.js";import{a as w}from"./chunk-R7QVVFUG.js";import{d as D,e as ee}from"./chunk-G6ZL6VPR.js";import{a as Dt,b as o}from"./chunk-VZ2OKDAO.js";var ve=[];function rt(){var e=o.snap(),t=e.paneDeferredBootstrap;!t||t.scheduled||!t.jobs.length||!e.connected||!e.paneReady||e.paneSuspended||(o.set({paneDeferredBootstrap:Object.assign({},t,{scheduled:!0})}),setTimeout(function(){var n=o.snap(),r=n.paneDeferredBootstrap;if(r){var a=r.jobs.slice(),s=n.connected&&n.paneReady&&!n.paneSuspended?a.shift():null;o.set({paneDeferredBootstrap:Object.assign({},r,{scheduled:!1,jobs:a})});try{if(s!==null&&ve[s]){var i=ve[s];ve[s]=null,i()}}finally{rt()}}},0))}function _e(e){if(!o.get("paneMode")){e.forEach(function(n){n()});return}var t=o.get("paneDeferredBootstrap");t||(t={jobs:[],scheduled:!1},o.subscribe(function(n,r){(n.paneReady!==r.paneReady||n.connected!==r.connected||n.paneSuspended!==r.paneSuspended)&&rt()})),o.set({paneDeferredBootstrap:Object.assign({},t,{jobs:t.jobs.concat(e.map(function(n){var r=ve.length;return ve.push(n),r}))})}),rt()}function Ho(){_t(),jt(),window.addEventListener("message",function(e){var t=e.data;if(e.origin===location.origin&&t&&t.type==="clay-studio-document-update"&&t.message){var n=Bt(t.message.path);n&&n.source===e.source&&n.descriptor.token===t.token&&Fo(t.message,n);return}!t||["clay-pane-present-markdown","clay-pane-present-wireframe"].indexOf(t.type)<0||!t.message||!t.message.controlPresentation||!Qe(e,t)||!Ut(e,t)||(t.type==="clay-pane-present-markdown"?(At(e,t,Qe(e,t)),No(t.message)):Xt(t.message))})}var ai="(max-width: 768px)",ii=["sticky-notes-toggle-btn","shared-browser-toggle-btn","terminal-toggle-btn"],si=["shared-browser-toggle-btn","terminal-toggle-btn","sticky-notes-toggle-btn"];function qo(e){var t=document.querySelector("#main-column > .title-bar-content .status"),n=document.querySelector("#top-bar .top-bar-actions"),r=document.getElementById("notif-center-btn");if(!(!t||!n))for(var a=e?ii:si,s=0;s<a.length;s++){var i=document.getElementById(a[s]);i&&(e?t.appendChild(i):n.insertBefore(i,r))}}var li=150,oe=24,be=12,Vo=null;function Wo(e,t,n){return Math.round(e.offsetWidth)+"|"+Math.round(t.offsetWidth)+"|"+Math.round(n.offsetWidth)}function zo(e){var t=document.getElementById("top-bar"),n=t&&t.querySelector(".top-bar-left-pills"),r=t&&t.querySelector(".top-bar-actions"),a=document.getElementById("cmd-palette-btn");if(!(!t||!n||!r||!a)&&t.offsetWidth&&!(!e&&Vo===Wo(t,n,r))&&getComputedStyle(a).display!=="none"){for(var s=[[],["usage-compact"],["usage-compact","usage-compact-link"]],i=null,l=0;l<s.length&&!i;l++){t.classList.remove("usage-compact","usage-compact-link","search-icon"),s[l].forEach(function(P){t.classList.add(P)}),t.style.removeProperty("--top-bar-search-width"),t.style.removeProperty("--top-bar-search-left");var c=t.getBoundingClientRect().width,d=c/2,u=t.getBoundingClientRect().left,p=n.getBoundingClientRect().right-u,m=r.getBoundingClientRect().left-u,v=Math.min(d-p,m-d)-be,y=Math.min(520,c*.4);if(2*v>=li)i={mode:"full",width:Math.min(y,2*v),left:null,level:l};else if(m-p>=oe+2*be){var M=p+be+oe/2,E=m-be-oe/2;i={mode:"icon",width:oe,left:Math.min(Math.max(d,M),E),level:l}}}i||(i={mode:"icon",width:oe,left:Math.max(n.getBoundingClientRect().right-t.getBoundingClientRect().left+be+oe/2,0),level:s.length-1}),t.classList.toggle("search-icon",i.mode==="icon"),i.mode==="full"?t.style.setProperty("--top-bar-search-width",Math.round(i.width)+"px"):t.style.setProperty("--top-bar-search-left",Math.round(i.left)+"px"),Vo=Wo(t,n,r)}}function di(){var e=document.getElementById("top-bar");if(!(!e||typeof ResizeObserver>"u")){var t=!1,n=function(a){t||(t=!0,requestAnimationFrame(function(){t=!1,zo(a===!0)}))},r=new ResizeObserver(function(){n(!1)});r.observe(e),[".top-bar-left-pills",".top-bar-actions"].forEach(function(a){var s=e.querySelector(a);s&&r.observe(s)}),new MutationObserver(function(){n(!0)}).observe(e.querySelector(".top-bar-actions"),{childList:!0,subtree:!0,characterData:!0}),zo(!0)}}function ci(){var e=document.querySelector("#main-column > .title-bar-content"),t=document.getElementById("top-bar");if(!(!e||!t)){var n=function(){t.classList.toggle("title-bar-hidden",e.classList.contains("hidden"))};n(),new MutationObserver(n).observe(e,{attributes:!0,attributeFilter:["class"]})}}function Go(){var e=window.matchMedia(ai);qo(e.matches),e.addEventListener("change",function(){qo(e.matches)}),ci(),di()}var Qo={},at={},x=null,B=null,j=null,Jo=0,$o=[],Ne={},it=null;function Ko(e){Qo[e.id]=e}function ot(e,t){at[e]=t}function Xo(e,t){var n=Qo[e];n&&(j=n,Jo=0,$o=[],it=t||null,ui(),Oe(n.steps[0].id),B.classList.remove("hidden"),x.classList.remove("hidden"),setTimeout(function(){x.focus()},50))}function ye(){B&&B.classList.add("hidden"),x&&x.classList.add("hidden");var e=it;j=null,it=null,e&&e()}function Zo(){pi(),mi()}function ui(){x||(B=document.createElement("div"),B.className="playbook-overlay hidden",B.addEventListener("click",function(e){e.target===B&&ye()}),x=document.createElement("div"),x.className="playbook-modal hidden",x.setAttribute("tabindex","-1"),x.addEventListener("keydown",function(e){e.key==="Escape"&&ye()}),B.appendChild(x),document.body.appendChild(B))}function Oe(e){if(j){for(var t=null,n=0,r=0;r<j.steps.length;r++)if(j.steps[r].id===e){t=j.steps[r],n=r;break}if(t){if(Jo=n,$o.push(e),t.condition&&t.branches){var a=t.condition(),s=t.branches[a]||t.branches.default;if(s){Oe(s);return}}fi(t)}}}function fi(e){for(var t=j,n=t.steps.filter(function(k){return!k.condition}).length,r=0,a=0,s=0;s<t.steps.length;s++)t.steps[s].condition||(a++,t.steps[s].id===e.id&&(r=a));var i="";i+='<div class="playbook-header">',i+='<div class="playbook-header-left">',i+='<span class="playbook-icon">'+(t.icon||"\u{1F4D6}")+"</span>",i+='<span class="playbook-title">'+ae(t.title)+"</span>",i+="</div>",i+='<button class="playbook-close" title="Close">×</button>',i+="</div>",i+='<div class="playbook-progress">';for(var l=0;l<n;l++){var c="playbook-progress-dot";l+1<r?c+=" done":l+1===r&&(c+=" active"),i+='<span class="'+c+'"></span>'}i+="</div>",i+='<div class="playbook-body">',i+='<h2 class="playbook-step-title">'+ae(e.title)+"</h2>";var d=typeof e.body=="function"?e.body():e.body||"";if(i+='<div class="playbook-step-body">'+d+"</div>",e.note&&(i+='<div class="playbook-step-note">'+ae(e.note)+"</div>"),i+="</div>",e.actions&&e.actions.length>0){i+='<div class="playbook-actions">';for(var u=0;u<e.actions.length;u++){var p=e.actions[u],m="playbook-btn";u===0?m+=" playbook-btn-primary":m+=" playbook-btn-secondary",i+='<button class="'+m+'" data-action="'+(p.action||"")+'" data-next="'+(p.next||"")+'">'+ae(p.label)+"</button>"}i+="</div>"}x.innerHTML=i,D();var v=x.querySelector(".playbook-close");v&&v.addEventListener("click",ye);for(var y=x.querySelectorAll(".playbook-btn"),M=0;M<y.length;M++)(function(k){k.addEventListener("click",function(){var A=k.dataset.action,h=k.dataset.next;A&&at[A]?(k.disabled=!0,k.textContent+="...",at[A](function(){h?Oe(h):(Yo(j.id),ye())})):h?Oe(h):(Yo(j.id),ye())})})(y[M]);for(var E=x.querySelectorAll("[data-copy-url]"),P=0;P<E.length;P++)(function(k){k.addEventListener("click",function(A){A.stopPropagation();var h=k.dataset.copyUrl;navigator.clipboard.writeText(h).then(function(){k.textContent="Copied!",setTimeout(function(){k.textContent="Copy"},1500)})})})(E[P])}function Yo(e){Ne[e]=!0;try{localStorage.setItem("clay-playbooks-done",JSON.stringify(Ne))}catch{}}function pi(){try{var e=JSON.parse(localStorage.getItem("clay-playbooks-done")||"{}");Ne=e||{}}catch{Ne={}}}function mi(){if(Ko({id:"push-notifications",title:"Push Notifications",icon:"\u{1F514}",description:"Get notified when Claude finishes a long task",tipMatch:function(t){return t.indexOf("Push notification")!==-1},steps:[{id:"intro",title:"Never miss a response",body:"When Claude is working on a long task, you can walk away and get a push notification the moment it's done. Works even when Clay is in the background.",actions:[{label:"Enable notifications",action:"notif_request",next:"check_perm"},{label:"Not now",next:""}]},{id:"check_perm",condition:function(){return typeof Notification>"u"?"unsupported":Notification.permission},branches:{granted:"test",denied:"denied",default:"denied",unsupported:"unsupported"}},{id:"test",title:"Let's test it!",body:"Click below to send a test notification. You should see it pop up from your system.",actions:[{label:"Send test notification",action:"notif_test",next:"check_test"},{label:"Skip",next:"done"}]},{id:"check_test",title:"Did you see it?",body:"A notification should have appeared from your system just now.",actions:[{label:"Yes, it worked!",next:"done"},{label:"No, nothing appeared",next:"troubleshoot"}]},{id:"troubleshoot",title:"Troubleshooting",body:function(){var t=navigator.platform&&navigator.platform.indexOf("Mac")!==-1,n="your browser",r=navigator.userAgent||"";r.indexOf("Arc")!==-1?n="Arc":r.indexOf("Edg/")!==-1?n="Edge":r.indexOf("Firefox")!==-1?n="Firefox":r.indexOf("Chrome")!==-1?n="Chrome":r.indexOf("Safari")!==-1&&(n="Safari");var a=location.protocol==="https:"&&location.hostname!=="localhost"&&location.hostname!=="127.0.0.1",s="The browser says permission is granted, but the notification didn't show.<br><br>";return a&&(s+="\u{1F512} <strong>Untrusted certificate?</strong><br>If you're using a self-signed or untrusted TLS certificate, some browsers silently block notifications even on HTTPS.<br>Run <strong>mkcert -install</strong> on the server to trust the root CA, or add the certificate to your system keychain as trusted.<br><br>"),s+="<strong>Also check your OS notification settings:</strong><br>",t?s+="<strong>1.</strong> Open <strong>System Settings \u2192 Notifications</strong><br><strong>2.</strong> Find <strong>"+n+"</strong> in the list<br><strong>3.</strong> Make sure <strong>Allow Notifications</strong> is turned on<br><strong>4.</strong> Check that <strong>Do Not Disturb</strong> / Focus mode is off<br>":s+="<strong>1.</strong> Make sure notifications are enabled for <strong>"+n+"</strong><br><strong>2.</strong> Check that Do Not Disturb / Focus mode is off<br>",s+="<br>After adjusting, come back and try again.",s},actions:[{label:"Try again",action:"notif_test",next:"check_test"},{label:"I'll fix it later",next:"done"}]},{id:"denied",title:"Permission needed",body:function(){var t=!window.isSecureContext||location.protocol==="http:"&&location.hostname!=="localhost"&&location.hostname!=="127.0.0.1"&&location.hostname!=="[::1]";if(t)return"\u26A0\uFE0F <strong>Insecure context detected.</strong><br><br>Notifications require a <strong>secure context</strong> (HTTPS or localhost). You're accessing Clay over <strong>"+location.protocol+"//"+location.hostname+"</strong>, so the browser automatically blocks notifications.<br><br><strong>How to fix:</strong><br><strong>1.</strong> Access Clay via <strong>https://</strong> (set up a TLS certificate)<br><strong>2.</strong> Or access via <strong>localhost:"+location.port+"</strong> instead of an IP address<br>";var n="chrome://settings/content/notifications",r=navigator.userAgent||"";return r.indexOf("Firefox")!==-1?n="about:preferences#privacy":r.indexOf("Edg/")!==-1?n="edge://settings/content/notifications":r.indexOf("Arc")!==-1&&(n="arc://settings/content/notifications"),'Your browser blocked the notification permission.<br><br><strong>1.</strong> Click the lock icon in the address bar<br><strong>2.</strong> Find "Notifications" and set it to "Allow"<br><strong>3.</strong> Reload the page<br><br>Or paste this into your address bar:<br><div style="display:flex;align-items:center;gap:6px;margin-top:6px"><code style="font-size:12px;color:var(--accent);flex:1;user-select:all">'+n+'</code><button class="playbook-btn-secondary" style="padding:3px 8px;font-size:11px" data-copy-url="'+n+'">Copy</button></div>'},actions:[{label:"Got it",next:""}]},{id:"unsupported",title:"Not supported",body:"Your browser doesn't support notifications. Try Chrome, Edge, or Firefox for the best experience.",actions:[{label:"Got it",next:""}]},{id:"done",title:"All set! \u{1F389}",body:"You'll now get a notification whenever Claude finishes processing. This works even when Clay is minimized or in another tab.",note:"You can toggle notifications anytime from the header bar.",actions:[{label:"Done",next:""}]}]}),ot("notif_request",function(t){if(typeof Notification>"u"){t();return}Notification.requestPermission().then(function(n){if(n==="granted")try{localStorage.setItem("notif-alert","1");var r=document.getElementById("notif-toggle-alert");r&&(r.checked=!0)}catch{}t()}).catch(function(){t()})}),ot("notif_test",function(t){if(typeof Notification>"u"){t();return}if(Notification.permission!=="granted"){Notification.requestPermission().then(function(n){n==="granted"?e(t):t()}).catch(function(){t()});return}e(t)}),location.protocol==="https:"){let t=function(){var a=navigator.userAgent||"",s=navigator.platform||"";return s.indexOf("Mac")!==-1||a.indexOf("Mac")!==-1?"mac":s.indexOf("Win")!==-1||a.indexOf("Windows")!==-1?"windows":"linux"},n=function(){var a=t(),s="The certificate has been downloaded as <strong>clay-ca.pem</strong>.<br><br>";return a==="mac"?(s+="<strong>macOS \u2014 run in Terminal:</strong><br>",s+=r("sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/Downloads/clay-ca.pem")):a==="windows"?(s+="<strong>Windows \u2014 run in PowerShell (Admin):</strong><br>",s+=r('certutil -addstore -f "Root" %USERPROFILE%\\Downloads\\clay-ca.pem')):(s+="<strong>Linux \u2014 run in terminal:</strong><br>",s+=r("sudo cp ~/Downloads/clay-ca.pem /usr/local/share/ca-certificates/clay-ca.crt && sudo update-ca-certificates")),s+='<br><div style="padding:8px 10px;background:var(--bg-deeper);border-radius:6px;border-left:3px solid var(--accent)"><strong style="font-size:11px">Or ask Claude Code:</strong><br><code style="font-family:monospace;font-size:12px;line-height:1.5;color:var(--text-secondary)">Install ~/Downloads/clay-ca.pem as a trusted root certificate</code></div>',s+="<br>Then <strong>restart your browser</strong> to apply the change.",s},r=function(a){return'<div style="margin-top:8px;position:relative;background:var(--bg-deeper);border-radius:6px;padding:8px 10px"><code style="display:block;font-family:monospace;font-size:12px;word-break:break-all;line-height:1.5;padding-right:50px">'+ae(a)+'</code><button class="playbook-btn-secondary" style="position:absolute;top:8px;right:8px;padding:2px 8px;font-size:11px;white-space:nowrap" data-copy-url="'+ae(a)+'">Copy</button></div>'};Ko({id:"trust-certificate",title:"Trust Certificate",icon:"\u{1F512}",description:"Getting certificate warnings? Fix them here",tipMatch:function(a){return a.indexOf("certificate")!==-1||a.indexOf("Certificate")!==-1},steps:[{id:"intro",title:"Getting certificate warnings?",body:"Clay generates a local CA certificate for secure HTTPS connections. Your browser may show warnings until you install and trust this certificate on your device.",actions:[{label:"Download certificate",action:"cert_download",next:"install"},{label:"Not now",next:""}]},{id:"install",title:"Install the certificate",body:n,actions:[{label:"Done, I installed it",next:"done"},{label:"I'll do it later",next:""}]},{id:"done",title:"All set! \u{1F389}",body:"After restarting your browser, certificate warnings should disappear. If you still see them, make sure you ran the terminal command with admin privileges.",actions:[{label:"Done",next:""}]}]}),ot("cert_download",function(a){var s=document.createElement("a");s.href="/ca/download",s.download="clay-ca.pem",document.body.appendChild(s),s.click(),document.body.removeChild(s),setTimeout(a,500)})}function e(t){try{var n=new Notification("Clay",{body:"Notifications are working! \u{1F389}",tag:"clay-test-"+Date.now()});n.onclick=function(){window.focus(),n.close()},setTimeout(function(){try{n.close()}catch{}},5e3)}catch(r){console.warn("[Playbook] Notification failed:",r)}setTimeout(t,800)}}function ae(e){var t=document.createElement("div");return t.textContent=e||"",t.innerHTML}function ea(e){var t=document.createElement("span");t.className="stt-meter",t.setAttribute("aria-hidden","true");var n=document.createElement("canvas");t.appendChild(n);var r=n.getContext("2d"),a=null,s=0,i=[],l=window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function c(d){a=null;var u=o.get("speechActive");if(!(!u||u.id!==e||!t.isConnected||!r)&&(a=requestAnimationFrame(c),!(d-s<(l?100:32)))){s=d;var p=t.clientWidth,m=t.clientHeight,v=Math.min(window.devicePixelRatio||1,2);(n.width!==Math.round(p*v)||n.height!==Math.round(m*v))&&(n.width=Math.round(p*v),n.height=Math.round(m*v)),r.setTransform(v,0,0,v,0,0),r.clearRect(0,0,p,m);var y=getComputedStyle(t),M=r.createLinearGradient(0,0,p,0);M.addColorStop(0,y.getPropertyValue("--brand-green").trim()||y.color),M.addColorStop(.5,y.getPropertyValue("--brand-blue").trim()||y.color),M.addColorStop(1,y.getPropertyValue("--brand-green").trim()||y.color),r.fillStyle=M;for(var E=u.audioSignal,P=E?E.levels:[],k=E?Date.now()-E.updatedAt:0,A=Math.max(0,1-Math.max(0,k-250)/900),h=Math.max(2,Math.floor(p/4)),b=Math.round(Math.min(160,Math.max(80,h))*1.25),R=l?0:Math.min(1,k/20),S=0;S<h;S++){var _=P.length-b+S/(h-1)*(b-1)+R,N=Math.floor(_),Le=_-N,J=P[N]||0,Te=P[Math.min(N+1,P.length-1)]||0,$=(J+(Te-J)*Le)*A,O=i[S]||0,X=l?$:O+($-O)*($>O?.5:.24);i[S]=X;for(var G=1+X*(m*.46-1),Re=Math.min(1,(S+1)/8,(h-S)/8),Z=0;Z<=m*.48;Z+=3.2){var Ye=Math.exp(-Math.pow(Z/G,2)*1.7);if(!(Ye<.035)){var Rt=.35+Ye*.65;r.globalAlpha=(.12+Ye*.78)*Re,r.beginPath(),r.arc((S+.5)*p/h,m/2+Z,Rt,0,Math.PI*2),r.fill(),Z&&(r.beginPath(),r.arc((S+.5)*p/h,m/2-Z,Rt,0,Math.PI*2),r.fill())}}}r.globalAlpha=1}}return{element:t,update:function(d){t.hidden=!d,d&&a===null&&(a=requestAnimationFrame(c)),!d&&a!==null&&(cancelAnimationFrame(a),a=null,i=[])}}}function ta(e,t,n){var r=document.getElementById(e),a=document.getElementById(t),s=document.getElementById(n);if(!r||!a||!s||r.dataset.speechBound)return;var i=document.getElementById(e==="stt-btn"?"input-row":"home-mate-chat-composer")||s,l=document.getElementById(e==="stt-btn"?"input-bottom":"home-mate-chat-composer")||i;r.addEventListener("click",Fe),r.dataset.speechBound="true",r.classList.add("stt-button");var c=document.createElement("span");c.className="stt-controls",r.before(c),c.appendChild(r);var d=document.createElement("button");d.type="button",d.id=e+"-picker",d.className="stt-picker-toggle",d.innerHTML=ee("chevron-down"),d.setAttribute("aria-label","Choose voice model"),d.setAttribute("aria-haspopup","dialog"),d.setAttribute("aria-expanded","false"),d.title="Choose voice model",c.appendChild(d),d.addEventListener("click",function(){Fe(),Ae(d)});var u=document.createElement("div");u.className="stt-progress",u.hidden=!0;var p=document.createElement("span");p.id=e+"-status",p.className="stt-status",p.setAttribute("role","status");var m=document.createElement("span");m.className="stt-timer",m.setAttribute("aria-hidden","true");var v=document.createElement("button");v.type="button",v.innerHTML=ee("x"),v.className="stt-cancel",v.title="Cancel voice input",v.setAttribute("aria-label","Cancel voice input"),v.addEventListener("click",function(){te(),o.set({speechRetry:null})});var y=ea(e),M=document.createElement("button");M.type="button",M.textContent="Retry",M.addEventListener("click",Jn);var E=document.createElement("a");E.textContent="Provider account",E.target="_blank",E.rel="noopener noreferrer";var P=document.createElement("button");P.type="button",P.textContent="Dismiss",P.addEventListener("click",function(){zn(e,"")}),u.append(v,y.element,m,p,M,E,P),i.prepend(u),r.setAttribute("aria-describedby",p.id),r.addEventListener("click",function(){var h=o.get("speechActive");if(h&&h.id===e){h.model&&h.phase==="recording"?Qn():te();return}var b=et(),R=o.get("speechSettings");if(b.provider==="browser"&&!Xe().available){Ae(d);return}if(b.provider!=="browser"&&(!R||R.configured.indexOf(b.provider)<0)){Ae(d);return}b.provider==="browser"?Gn(e,a):Yn(e,a,b)}),a.addEventListener("beforeinput",function(){var h=o.get("speechActive");h&&h.id===e&&te("Voice input stopped so you can edit your draft."),o.set({speechRetry:null})}),a.addEventListener("input",function(){var h=o.get("speechActive");h&&h.id===e&&!h.writing&&te()});function k(){var h=o.get("speechActive"),b=!!h&&h.id===e,R=et(),S=lr(R.provider),_=R.provider==="browser"?o.get("speechBrowserIdentity"):null,N=b&&h.model&&h.phase!=="recording",Le=b&&!!h.autoSend;i.classList.toggle("stt-recording",b),u.classList.toggle("stt-auto-send",Le),u.classList.toggle("stt-progress-active",b),u.classList.toggle("stt-progress-pending",!!N);var J=b?l:i;(u.parentElement!==J||u!==J.firstElementChild)&&J.prepend(u),y.update(b?h:null),d.hidden=b,r.disabled=a.disabled||a.readOnly||!o.get("speechSettings"),d.disabled=a.disabled||a.readOnly||b,r.classList.toggle("stt-active",b),r.setAttribute("aria-pressed",String(b));var Te=b?Le?"Cancel pending voice send":N?"Cancel voice input":R.mode==="recorded"?"Stop and transcribe":"Stop voice input":"Start voice input";r.setAttribute("aria-label",Te+" \xB7 "+(S?S.name+" \xB7 ":"")+R.name),r.title=Te+" \xB7 "+R.name;var $=[b,N,S&&S.id,_&&_.id].join(":");if(r.dataset.speechIcon!==$){if(r.dataset.speechIcon=$,r.innerHTML=ee(b?N?"x":"square":"mic"),!b&&(S||_&&_.icon)){var O=document.createElement("img");O.className="stt-vendor-badge",O.src=S?S.icon:_.icon,O.alt="",r.appendChild(O)}D()}var X=(o.get("speechStatuses")||{})[e]||"",G=(o.get("speechErrors")||{})[e];u.classList.toggle("stt-progress-error",!!G),p.setAttribute("role",G?"alert":"status"),P.hidden=!G,E.hidden=!G||!S,S&&(E.href=S.url),R.provider==="browser"&&!Wn()&&(X="Browser voice input is unavailable. Choose a connected speech provider or type your message."),window.isSecureContext||(X="Voice input requires a secure HTTPS connection."),p.textContent=X,m.textContent=b&&h.startTime?Math.floor((Date.now()-h.startTime)/6e4)+":"+String(Math.floor((Date.now()-h.startTime)/1e3)%60).padStart(2,"0"):"",v.hidden=!b;var Re=o.get("speechRetry");M.hidden=!Re||Re.id!==e,u.hidden=!b&&!G&&M.hidden}o.subscribe(k);var A=new MutationObserver(k);A.observe(a,{attributes:!0,attributeFilter:["disabled","readonly"]}),k()}function Fe(){o.set({speechBrowserIdentity:Xe()})}function na(){Fe(),window.addEventListener("focus",Fe),Kn(),dr(),ta("stt-btn","input","input-wrapper"),ta("home-stt-btn","home-mate-chat-input","home-mate-chat-composer-frame"),De(),window.addEventListener("focus",De);try{window.top.document.addEventListener("clay:speech-settings-saved",De)}catch{}}var g=null,T=null,Se=null;function we(){return document.body.dataset.myDisplayName||"Clay user"}function se(e){if(g){var t=g.querySelector("#account-ai-section");t&&ur(t),g.remove(),g=null,T.setAttribute("aria-expanded","false"),T.setAttribute("aria-label","Open account menu for "+we()),document.removeEventListener("pointerdown",ra),document.removeEventListener("focusin",oa),document.removeEventListener("keydown",aa),window.removeEventListener("resize",ie),o.set({defaultAiInlineEditing:!1}),e&&Se&&document.contains(Se)&&Se.focus({preventScroll:!0}),Se=null}}function dt(e){return e&&e.closest&&e.closest(".avatar-positioner-overlay")}function ra(e){!g||g.contains(e.target)||T.contains(e.target)||dt(e.target)||se(!1)}function oa(e){!g||g.contains(e.target)||T.contains(e.target)||dt(e.target)||se(!1)}function aa(e){e.key==="Escape"&&(dt(e.target)||document.querySelector(".avatar-positioner-overlay")||(e.preventDefault(),e.stopPropagation(),se(!0)))}function ie(){if(!(!g||!T)){var e=T.getBoundingClientRect(),t=Math.min(280,window.innerWidth-24),n=Math.max(12,Math.min(window.innerWidth-t-12,e.left));g.style.width=t+"px",g.style.left=n+"px",g.style.top=Math.max(12,e.top-g.offsetHeight-8)+"px"}}function st(e){var t=g&&g.querySelector(".account-identity-copy");t&&(t.innerHTML='<button type="button" id="account-name-edit" class="account-name-display"><span></span><i data-lucide="pencil" aria-hidden="true"></i></button><small>Personal account</small>',t.querySelector("span").textContent=we(),t.querySelector("#account-name-edit").addEventListener("click",gi),window.lucide&&window.lucide.createIcons({nodes:[t]}),e&&t.querySelector("#account-name-edit").focus())}function gi(){var e=g&&g.querySelector(".account-identity-copy");if(e){var t=document.createElement("input");t.id="account-profile-name",t.setAttribute("aria-label","Display name"),t.className="account-name-input",t.type="text",t.maxLength=50,t.autocomplete="name",t.value=o.get("accountNameDraft")===void 0?Ze().name||"":o.get("accountNameDraft"),t.addEventListener("input",function(){o.set({accountNameDraft:t.value})}),e.innerHTML="",e.appendChild(t);var n=document.createElement("small");n.textContent="Enter to save \xB7 Escape to cancel",e.appendChild(n),t.addEventListener("keydown",function(r){r.key==="Enter"?(r.preventDefault(),t.disabled=!0,n.textContent="Saving\u2026",$n({name:t.value.trim()}).then(function(){o.set({accountNameDraft:void 0}),st(!0)}).catch(function(a){t.disabled=!1,n.textContent=a.message,t.focus()})):r.key==="Escape"&&(r.preventDefault(),o.set({accountNameDraft:void 0}),st(!0)),r.stopPropagation()}),t.focus(),t.select()}}function hi(){var e=g&&g.querySelector("#account-avatar-editor");e&&(e.hidden=!e.hidden,e.hidden||e.querySelector("#account-avatar-upload").focus(),ie())}function vi(){var e=g.querySelector("#account-avatar-edit"),t=g.querySelector("#account-avatar-editor"),n=t.querySelector("#account-avatar-upload"),r=t.querySelector("#account-avatar-file"),a=t.querySelector("#account-avatar-generate");e.addEventListener("click",function(s){s.stopPropagation(),hi()}),t.addEventListener("click",function(s){s.stopPropagation()}),n.addEventListener("click",function(){r.click()}),r.addEventListener("change",function(){var s=r.files&&r.files[0];if(s){var i=new Image,l=URL.createObjectURL(s);i.onload=function(){er(i,l,function(c){URL.revokeObjectURL(l),Zn(c).then(function(){t.hidden=!0}).catch(function(){t.dataset.error="true"})})},i.src=l}}),a.addEventListener("click",function(){Xn(),t.hidden=!0})}function bi(){g=document.createElement("div"),g.id="account-popover",g.className="account-popover",g.setAttribute("role","dialog"),g.setAttribute("aria-label","Account");var e=Ze(),t=document.createElement("div");t.className="account-menu-identity",t.innerHTML='<button type="button" id="account-avatar-edit" class="account-avatar-edit" aria-label="Edit avatar"><img src="'+(document.body.dataset.myAvatarUrl||"")+'" alt=""></button><div class="account-identity-copy"></div><button type="button" class="account-settings-button" aria-label="User Settings" title="User Settings"><i data-lucide="settings" aria-hidden="true"></i></button>',t.querySelector("#account-avatar-edit img").alt=e.name||"Clay user";var n=document.createElement("div");n.id="account-avatar-editor",n.className="account-avatar-editor",n.hidden=!0,n.innerHTML='<button type="button" id="account-avatar-upload">Upload photo</button><button type="button" id="account-avatar-generate">Generate avatar</button><input id="account-avatar-file" type="file" accept="image/*">',g.appendChild(t),g.appendChild(n);var r=document.createElement("section");r.id="account-ai-section",r.className="account-inline-section account-ai-section",r.setAttribute("aria-label","Default AI"),g.appendChild(r),cr(r),t.querySelector(".account-settings-button").addEventListener("click",yi),document.body.appendChild(g),st(),vi(),lt(),window.lucide&&window.lucide.createIcons({nodes:[g]}),ie()}function lt(){var e=document.getElementById("cursor-share-toggle");if(e){var t=o.get("cursorSharingHydrated")===!0,n=t&&o.get("cursorSharingEnabled")===!0,r=o.get("cursorSharingPending")!==null&&o.get("cursorSharingPending")!==void 0,a=o.get("connected")!==!1,s=o.get("cursorSharingError"),i=!!s&&!t&&a,l=t&&!n&&!r&&!s&&a;e.hidden=o.get("isMultiUserMode")!==!0,e.removeAttribute("role"),e.removeAttribute("aria-checked"),e.setAttribute("aria-pressed",n?"true":"false"),e.classList.toggle("on",n),e.classList.toggle("off",l),e.classList.toggle("pending",r),e.disabled=r||!a||!t&&!i;var c=r?"waiting":a?s?i?"error; activate to retry":"error":t?n?"on":"off":"unavailable":"offline";e.setAttribute("aria-label","Cursor sharing "+c);var d=r?"Cursor sharing is waiting for confirmation.":a?s?i?"Cursor sharing is unavailable. Click to retry.":"Cursor sharing is unavailable.":t?n?"Your cursor is visible to others. Click to stop sharing.":"Cursor sharing is off. Click to share your cursor.":"Cursor sharing is unavailable.":"Cursor sharing is offline.";Cn(e,d)}}function yi(e){e.stopPropagation(),se(!0),pr()}function Si(e){if(e.stopPropagation(),!e.currentTarget.disabled){if(o.get("cursorSharingError")&&o.get("cursorSharingHydrated")!==!0){Br();return}Ar(o.get("cursorSharingEnabled")!==!0)}}function wi(){var e=g&&g.querySelector("#account-ai-section select");e&&e.focus({preventScroll:!0})}function ki(){g||ia(),o.set({defaultAiInlineEditing:!0}),wi()}function ia(){if(g){se(!0);return}Se=document.activeElement,bi(),T.setAttribute("aria-expanded","true"),T.setAttribute("aria-label","Close account menu for "+we()),document.addEventListener("pointerdown",ra),document.addEventListener("focusin",oa),document.addEventListener("keydown",aa),window.addEventListener("resize",ie)}function sa(){if(T=document.getElementById("user-account-trigger"),!!T){T.addEventListener("click",ia),document.addEventListener("clay:open-account-default-ai",ki);var e=document.getElementById("cursor-share-toggle");e&&e.addEventListener("click",Si),lt(),T.setAttribute("aria-label","Open account menu for "+we()),o.subscribe(function(t,n){t.myUserId!==n.myUserId&&t.accountNameDraft!==void 0&&o.set({accountNameDraft:void 0}),(t.myUserId!==n.myUserId||t.connected===!1&&n.connected!==!1)&&se(!1),lt(),g&&ie()}),document.addEventListener("clay:profile-updated",function(){if(g){var t=g.querySelector(".account-name-display span");t&&(t.textContent=we());var n=g.querySelector("#account-avatar-edit img");n&&(n.src=document.body.dataset.myAvatarUrl||n.src)}}),window.addEventListener("resize",ie)}}var Ci=[{id:"file-browser-btn",icon:"folder-tree",label:"File browser"},{id:"terminal-sidebar-btn",icon:"square-terminal",label:"Terminal",countId:"terminal-sidebar-count"},{id:"sticky-notes-sidebar-btn",icon:"sticky-note",label:"Sticky Notes",countId:"sticky-notes-sidebar-count"},{id:"project-logs-btn",icon:"notebook-tabs",label:"Logs",countId:"project-logs-count"},{id:"mcp-btn",icon:"cable",label:"MCP / Skills",countId:"mcp-sidebar-count"},{id:"scheduler-btn",icon:"calendar-clock",label:"Scheduled"},{id:"issues-btn",icon:"circle-dot",label:"Issues"},{id:"shared-browser-btn",icon:"globe",label:"Browser"}],Mi=[{id:"mate-memory-btn",icon:"brain",label:"Memory",countId:"mate-memory-count"},{id:"mate-knowledge-btn",icon:"book-open",label:"Knowledge",countId:"mate-knowledge-count"},{id:"mate-sticky-notes-btn",icon:"sticky-note",label:"Sticky Notes"},{id:"mate-debates-btn",icon:"messages-square",label:"Debates"},{id:"mate-mcp-btn",icon:"cable",label:"MCP / Skills",countId:"mate-mcp-sidebar-count"}],de={session:{tools:Ci,fixedTools:[{id:"you-button",icon:"user-round",label:"Me",countId:"me-unread-badge",fixed:!0,scope:"clay"}],activeContainerId:"session-actions",hiddenSectionId:"session-actions-hidden"},mate:{tools:Mi,activeContainerId:"mate-sidebar-tools",hiddenSectionId:"mate-sidebar-tools-hidden"}},Ei={"skills-btn":"mcp-btn"},Pi={"mate-skills-btn":"mate-mcp-btn","mate-debate-btn":"mate-debates-btn"},la=["git-sidebar-btn","loop-tool-btn","debates-btn"];function le(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}function ua(e,t){var n=t&&t.order||[],r=t&&t.hidden||[],a={order:n.slice(),hidden:r.slice(),migrated:!1};if(e!=="session"&&e!=="mate")return a;for(var s=e==="mate"?Pi:Ei,i=Object.keys(s),l=0;l<i.length;l++){var c=i[l],d=s[c],u=le(a.order,c)!==-1,p=le(a.hidden,c)!==-1;if(!(!u&&!p)){var m=le(a.order,d)!==-1||le(a.hidden,d)!==-1;a.order=ca(a.order,c,d,m),a.hidden=ca(a.hidden,c,d,m),a.migrated=!0}}if(e!=="session")return a;for(var v=0;v<la.length;v++){var y=la[v];le(a.order,y)===-1&&le(a.hidden,y)===-1||(a.order=da(a.order,y),a.hidden=da(a.hidden,y),a.migrated=!0)}return a}function da(e,t){for(var n=[],r=0;r<e.length;r++)e[r]!==t&&n.push(e[r]);return n}function ca(e,t,n,r){for(var a=[],s={},i=0;i<e.length;i++){var l=e[i];if(l===t){if(r)continue;l=n}s[l]||(s[l]=!0,a.push(l))}return a}var He={},q=null,ce=null;function ma(){for(var e in de)xi(e);Li(),D()}function xi(e){var t=de[e],n=document.getElementById(t.activeContainerId);if(n){(t.fixedTools||[]).forEach(function(a){n.appendChild(fa(a,e))});for(var r=0;r<t.tools.length;r++)n.appendChild(fa(t.tools[r],e));n.addEventListener("dragover",function(a){if(!(ce!==e||!q)){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="move");var s=Ii(n,a.clientX,a.clientY);s==null?(q.parentNode!==n||q.nextSibling)&&n.appendChild(q):s!==q&&n.insertBefore(q,s)}}),n.addEventListener("drop",function(a){ce===e&&a.preventDefault()})}}function fa(e,t){var n=document.createElement("button");n.id=e.id,n.type="button",n.className="palette-tile",n.title=e.label,n.setAttribute("aria-label",e.label),n.dataset.toolId=e.id,n.dataset.palette=t,n.draggable=!0,e.fixed&&(n.draggable=!1,n.dataset.fixed="true"),e.scope&&(n.dataset.scope=e.scope),e.id==="you-button"&&(n.classList.add("you-button"),n.setAttribute("aria-pressed","false"));var r=document.createElement("i");r.setAttribute("data-lucide",e.icon),n.appendChild(r);var a=document.createElement("span");if(a.className="tool-btn-label",a.textContent=e.label,n.appendChild(a),e.countId){var s=document.createElement("span");s.id=e.countId,s.className="sidebar-badge hidden",e.id==="you-button"&&(s.className="sidebar-badge me-unread-badge",s.hidden=!0),n.appendChild(s)}return n.addEventListener("dragstart",function(i){if(e.fixed){i.preventDefault();return}var l=n.parentNode;if(!l||l.id!==de[t].activeContainerId){i.preventDefault();return}q=n,ce=t,i.dataTransfer.effectAllowed="move";try{i.dataTransfer.setData("text/plain",e.id)}catch{}n.classList.add("dragging")}),n.addEventListener("dragend",function(){n.classList.remove("dragging"),ce&&Ti(ce),q=null,ce=null}),n}function Ii(e,t,n){for(var r=Array.prototype.slice.call(e.querySelectorAll("[data-tool-id]:not(.dragging)")),a=null,s=Number.POSITIVE_INFINITY,i=0;i<r.length;i++)if(r[i].dataset.fixed!=="true"){var l=r[i].getBoundingClientRect(),c=n-(l.top+l.height/2),d=t-(l.left+l.width/2),u=Math.abs(c)*2+Math.abs(d),p=c<-l.height/2||Math.abs(c)<=l.height/2&&d<0;p&&u<s&&(s=u,a=r[i])}return a}function Li(){fetch("/api/user/tool-palettes",{credentials:"same-origin"}).then(function(e){return e.ok?e.json():null}).then(function(e){e&&(pa("session",e.session||null),pa("mate",e.mate||null))}).catch(function(){})}function pa(e,t){if(!t)return;var n=de[e];if(!n)return;var r=document.getElementById(n.activeContainerId);if(!r)return;var a=ua(e,t),s={};function i(v){if(!s[v]){var y=document.getElementById(v);!y||y.dataset.fixed==="true"||(r.appendChild(y),s[v]=!0)}}for(var l={},c=0;c<a.hidden.length;c++)l[a.hidden[c]]=!0;for(var d=0;d<a.order.length;d++)l[a.order[d]]||i(a.order[d]);for(var u=0;u<n.tools.length;u++)l[n.tools[u].id]||i(n.tools[u].id);for(var p=0;p<a.hidden.length;p++)i(a.hidden[p]);for(var m=0;m<n.tools.length;m++)i(n.tools[m].id)}function Ti(e){He[e]&&clearTimeout(He[e]),He[e]=setTimeout(function(){He[e]=null,Ri(e)},250)}function Ri(e){var t=de[e];if(t){var n=document.getElementById(t.activeContainerId);if(n){for(var r=[],a=n.querySelectorAll("[data-tool-id]"),s=0;s<a.length;s++)a[s].dataset.fixed!=="true"&&r.push(a[s].dataset.toolId);fetch("/api/user/tool-palettes",{method:"PUT",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({palette:e,order:r,hidden:[]})}).catch(function(){})}}}var ke=[],ct=[],I=null,K=null,ut=null,U=!1,Ce="project",V=0,C=[];function ga(e){e!=="project"&&e!=="mate"||(U&&W(!1),ft(e))}function ba(){Di(),K=I.querySelector(".cmd-palette-results"),ut=I.querySelector(".project-switcher-header");var e=o.get("currentSlug");e&&(ke=[e]);var t=o.get("dmTargetUser");t&&t.isMate&&t.id&&(ct=[t.id]),o.subscribe(function(d,u){d.currentSlug&&d.currentSlug!==u.currentSlug&&(va(ke,d.currentSlug),ke=ke);var p=ha(d.dmTargetUser),m=ha(u.dmTargetUser);p&&p!==m&&va(ct,p)});var n=I.querySelector(".cmd-palette-backdrop");n&&n.addEventListener("click",function(){W(!1)}),document.addEventListener("keydown",Ai,!0),document.addEventListener("keyup",Bi,!0),window.addEventListener("blur",function(){U&&W(!1)});var r=/Mac|iPhone|iPod|iPad/i.test(navigator.platform),a=r?"\u2318E":"Ctrl+E",s=r?"\u2318M":"Ctrl+M",i=document.getElementById("icon-strip-hint-project"),l=document.getElementById("icon-strip-hint-mate");i&&(i.textContent=a,i.title="Switch project ("+a+")",i.addEventListener("click",function(){ga("project")})),l&&(l.textContent=s,l.title="Switch mate ("+s+")",l.addEventListener("click",function(){ga("mate")}));function c(){if(l){var d=o.get("cachedMatesList")||[];l.classList.toggle("hidden",d.length===0)}}c(),o.subscribe(function(d,u){(d.cachedMatesList!==u.cachedMatesList||d.projectMateDmsEnabled!==u.projectMateDmsEnabled)&&c()})}function Di(){if(I=document.getElementById("project-switcher"),!I){var e=/Mac|iPhone|iPod|iPad/i.test(navigator.platform),t=e?"<kbd>\u2318</kbd>":"<kbd>Ctrl</kbd>";I=document.createElement("div"),I.id="project-switcher",I.className="cmd-palette hidden project-switcher",I.innerHTML='<div class="cmd-palette-backdrop"></div><div class="cmd-palette-dialog project-switcher-dialog"><div class="project-switcher-header">Switch project</div><div class="cmd-palette-results"></div><div class="cmd-palette-footer project-switcher-footer"><span class="project-switcher-shortcuts">'+t+'<kbd class="proj-next-key">E</kbd> next \xB7 <kbd>\u21E7</kbd>'+t+'<kbd class="proj-prev-key">E</kbd> prev \xB7 <kbd>\u23CE</kbd> select \xB7 <kbd>Esc</kbd> cancel</span></div></div>',document.body.appendChild(I)}}function ha(e){return e&&e.isMate&&e.id?e.id:null}function va(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),e.unshift(t)}function Ai(e){if(e.key){var t=(e.metaKey||e.ctrlKey)&&!e.altKey,n=e.key.toLowerCase();if(t&&(n==="e"||n==="m")){var r=n==="e"?"project":"mate";e.preventDefault(),e.stopPropagation(),U?Ce!==r?ft(r):e.shiftKey?qe(-1):qe(1):ft(r);return}if(U){if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),W(!1);return}if(e.key==="Enter"){e.preventDefault(),e.stopPropagation(),W(!0);return}if(e.key==="ArrowRight"||e.key==="ArrowDown"){e.preventDefault(),qe(1);return}if(e.key==="ArrowLeft"||e.key==="ArrowUp"){e.preventDefault(),qe(-1);return}}}}function Bi(e){U&&(e.key==="Meta"||e.key==="Control")&&W(!0)}function ft(e){if(Ce=e,C=_i(e),C.length===0){U&&W(!1);return}ut&&(ut.textContent=e==="mate"?"Switch mate":"Switch project"),ji(e),Fi(),V=Ui(),pt(),I.classList.remove("hidden"),U=!0,D(),Ue(K)}function ji(e){var t=I.querySelector(".proj-next-key"),n=I.querySelector(".proj-prev-key"),r=e==="mate"?"M":"E";t&&(t.textContent=r),n&&(n.textContent=r)}function Ui(){if(C.length===0)return 0;for(var e=Ce==="mate"?ct:ke,t=ya(),n=0;n<e.length;n++){var r=e[n];if(r!==t){for(var a=0;a<C.length;a++)if(C[a].key===r&&!C[a].disabled)return a}}for(var s=0;s<C.length;s++)if(!C[s].disabled&&C[s].key!==t)return s;for(var i=0;i<C.length;i++)if(!C[i].disabled)return i;return 0}function ya(){if(Ce==="mate"){var e=tt(o.snap());return e?e.id:null}return o.get("currentSlug")}function _i(e){return e==="mate"?Oi():Ni()}function Ni(){var e=(ge()||[]).filter(function(t){return!t.isMate});return e.map(function(t){var n=Zr(t);return{key:t.slug,title:t.title||t.project||t.slug,icon:t.icon||null,fallbackIcon:"folder",isCurrent:t.slug===o.get("currentSlug"),external:n,disabled:!1,disabledReason:null}})}function Oi(){var e=o.get("cachedMatesList")||[],t=tt(o.snap()),n=t?t.id:null;return e.map(function(r){return{key:r.id,title:r.displayName||r.name||r.id,icon:null,avatarUrl:Nt(r,88),fallbackIcon:"user",isCurrent:r.id===n,disabled:!1,disabledReason:null}})}function W(e){if(U&&(U=!1,I.classList.add("hidden"),!!e)){var t=C[V];!t||t.disabled||(Ce==="mate"?t.key!==ya()&&ro(t.key):t.key!==o.get("currentSlug")&&je(t.key))}}function qe(e){if(C.length!==0){for(var t=e>0?1:-1,n=V,r=0;r<C.length;r++)if(n=(n+t+C.length)%C.length,!C[n].disabled){V=n,pt();return}}}function Fi(){if(K){K.innerHTML="";for(var e=0;e<C.length;e++)K.appendChild(Hi(C[e],e))}}function Hi(e,t){var n=document.createElement("button");n.type="button",n.className="cmd-palette-item project-switcher-item",e.disabled&&n.classList.add("disabled"),e.disabled&&e.disabledReason&&(n.title=e.disabledReason),e.external&&(n.title=eo(e.title)),n.dataset.index=String(t);var r=document.createElement("div");if(r.className="cmd-palette-item-icon",e.icon)r.textContent=e.icon;else if(e.avatarUrl){var a=document.createElement("img");a.src=e.avatarUrl,a.alt="",a.className="project-switcher-avatar",r.appendChild(a)}else{var s=document.createElement("i");s.setAttribute("data-lucide",e.fallbackIcon||"folder"),r.appendChild(s)}e.external&&to(r,"project-switcher-external-badge"),n.appendChild(r);var i=document.createElement("div");i.className="cmd-palette-item-body";var l=document.createElement("div");l.className="cmd-palette-item-title-row";var c=document.createElement("span");if(c.className="cmd-palette-item-title",c.textContent=e.title,l.appendChild(c),e.isCurrent){var d=document.createElement("span");d.className="project-switcher-current",d.textContent="current",l.appendChild(d)}if(e.disabled&&e.disabledReason){var u=document.createElement("span");u.className="project-switcher-disabled-reason",u.textContent=e.disabledReason,l.appendChild(u)}return i.appendChild(l),n.appendChild(i),n.addEventListener("mouseenter",function(){e.disabled||(V=t,pt())}),n.addEventListener("click",function(){e.disabled||(V=t,W(!0))}),n}function pt(){if(K){for(var e=K.querySelectorAll(".cmd-palette-item"),t=0;t<e.length;t++)e[t].classList.toggle("active",t===V);var n=e[V];n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest"})}}var qi=/^[a-zA-Z0-9_-]{1,120}$/;function mt(){return Array.prototype.filter.call(document.querySelectorAll("iframe"),function(e){try{var t=new URL(e.src,window.location.href);return t.origin===window.location.origin&&t.searchParams.get("pane")==="1"}catch{return!1}})}function gt(e){var t=Ro();try{e.contentWindow&&e.contentWindow.postMessage({type:"clay-appearance",snapshot:t},window.location.origin)}catch{}}function Sa(e){return typeof e=="string"&&qi.test(e)}function ht(e){return e===null||Sa(e)}function Vi(e){var t=e&&typeof e=="object"?e.preference:null;return!t||typeof t!="object"||!Sa(e.themeId)||e.userId!==null&&(typeof e.userId!="string"||!e.userId||e.userId.length>200)||typeof t.configured!="boolean"||t.mode!==null&&t.mode!=="light"&&t.mode!=="dark"?!1:ht(t.theme)&&ht(t.lightTheme)&&ht(t.darkTheme)}function wa(){if(o.get("paneMode")){if(window.parent===window)return;window.addEventListener("message",function(e){if(!(e.origin!==window.location.origin||e.source!==window.parent)){var t=e.data;if(!(!t||t.type!=="clay-appearance"||!Vi(t.snapshot))){var n=o.get("myUserId")||null;n!==null&&t.snapshot.userId!==n||Do(t.snapshot)}}});return}To(function(){mt().forEach(gt)}),o.subscribe(function(e,t){e.myUserId!==t.myUserId&&mt().forEach(gt)}),document.addEventListener("load",function(e){e.target&&e.target.tagName==="IFRAME"&&mt().indexOf(e.target)>=0&>(e.target)},!0)}var Wi=500,ka=10,ue=null,vt=0,bt=0,Me=!1,Ca=null;function Ve(){ue&&(clearTimeout(ue),ue=null)}function Ma(){"ontouchstart"in window&&(document.addEventListener("touchstart",function(e){if(e.touches.length!==1){Ve();return}var t=e.touches[0];vt=t.clientX,bt=t.clientY,Me=!1,Ca=e.target,ue=setTimeout(function(){ue=null,Me=!0,navigator.vibrate&&navigator.vibrate(30);var n=new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,clientX:vt,clientY:bt});Ca.dispatchEvent(n)},Wi)},{passive:!0}),document.addEventListener("touchmove",function(e){if(ue){var t=e.touches[0],n=t.clientX-vt,r=t.clientY-bt;n*n+r*r>ka*ka&&Ve()}},{passive:!0}),document.addEventListener("touchend",function(e){Ve(),Me&&(Me=!1,e.preventDefault())},{passive:!1}),document.addEventListener("touchcancel",function(){Ve(),Me=!1},{passive:!0}))}var Ea=!1,Pa=!1;function yt(e){return/^\/p\/[a-z0-9_-]+(?:\/|$)/.test(e||"")}function zi(e){return e?e.paneMode||yt(e.pathname)||e.currentSlug?"project":e.projectsLoaded!==!0?"wait":"projects":"wait"}function xa(){document.body.classList.remove("home-surface-boot-pending");var e=document.getElementById("connect-overlay");e&&o.get("connected")&&e.classList.add("hidden")}function Gi(e){return e?"/p/"+e+"/":null}function Ia(e){if(!Pa){var t=zi({surfaceLoaded:e.homeSurfaceLoaded,projectsLoaded:e.projectListLoaded,dockLoaded:e.homeDockPreferenceLoaded,surface:e.homePrimarySurface,currentSlug:e.currentSlug,pathname:location.pathname,paneMode:e.paneMode});if(t!=="wait"){if(Pa=!0,t==="project"){if(!yt(location.pathname)){var n=Gi(e.currentSlug);n&&history.replaceState(null,"",n)}o.set({homeSurfaceBootResolved:!0}),xa();var r=document.getElementById("input");r&&!r.disabled&&r.focus({preventScroll:!0});return}o.set({homeSurfaceBootResolved:!0,projectsHubRestoreRequested:!0}),xa()}}}function La(){if(!Ea){if(Ea=!0,!yt(location.pathname)&&!o.get("paneMode")){document.body.classList.add("home-surface-boot-pending");var e=document.getElementById("connect-overlay-msg");e&&(e.textContent="Restoring your workspace\u2026")}o.subscribe(function(t){Ia(t)}),Ia(o.snap())}}var Ki=3600*1e3,Yi="(max-width: 768px)",St=null,wt=!1;function Qi(e){if(typeof e!="number"||!isFinite(e)||e<0)return"";if(e=Math.floor(e),e<1e3)return String(e);for(var t=[[1e6,"m"],[1e3,"k"]],n=0;n<t.length;n++)if(e>=t[n][0]){var r=Math.floor(e/t[n][0]*10)/10;return(r%1===0?String(r):r.toFixed(1))+t[n][1]}return String(e)}function Ra(){var e=o.get("githubStarCount"),t=document.getElementById("github-star-count"),n=document.getElementById("github-star-link");if(!(!t||!n)){var r=typeof e=="number"?Qi(e):"";t.textContent=r,t.classList.toggle("hidden",!r),n.setAttribute("aria-label",r?"Star Clay on GitHub, "+e+" stars":"Star Clay on GitHub")}}function Ji(){return!!(window.matchMedia&&window.matchMedia(Yi).matches)}function Ta(){return wt||Ji()?Promise.resolve():(wt=!0,fetch("/api/github-stars",{credentials:"same-origin"}).then(function(e){return e.ok?e.json():null}).then(function(e){e&&typeof e.stars=="number"&&(o.set({githubStarCount:e.stars}),Ra())}).catch(function(){}).then(function(){wt=!1}))}function Da(){document.getElementById("github-star")&&(Ra(),Ta(),St&&clearInterval(St),St=setInterval(Ta,Ki))}function ja(){o.subscribe(function(e,t){if(e.sessionOriginId!==t.sessionOriginId||e.currentSlug!==t.currentSlug){o.set({activeBackgroundTasks:[],backgroundTaskCatalog:[]});return}e.backgroundTaskViewer!==t.backgroundTaskViewer&&document.querySelectorAll("[data-background-task]").forEach(function(n){var r=e.backgroundTaskViewer;n.setAttribute("aria-expanded",String(!!r&&n.dataset.backgroundTask===r.taskId))}),(e.activeBackgroundTasks!==t.activeBackgroundTasks||e.backgroundTaskCatalog!==t.backgroundTaskCatalog)&&Ba()}),Ba()}function $i(e,t){if(typeof e!="number"||!isFinite(e)||e<=0)return"";var n=typeof t=="number"?t:Date.now(),r=Math.floor((n-e)/1e3);if(r<0&&(r=0),r<60)return r+"s";var a=Math.floor(r/60),s=r%60;if(a<60)return a+"m "+Aa(s)+"s";var i=Math.floor(a/60);return i+"h "+Aa(a%60)+"m"}function Aa(e){return e<10?"0"+e:String(e)}function Xi(e){return!!(e&&e.ambient===!0)}function Zi(e){for(var t=[],n=[],r=Array.isArray(e)?e:[],a=0;a<r.length;a++)r[a]&&(Xi(r[a])?n.push(r[a]):t.push(r[a]));return{user:t,ambient:n}}function Ba(){var e=document.getElementById("background-tasks-bar");e&&e.remove();var t=Zi(o.get("backgroundTaskCatalog")||o.get("activeBackgroundTasks")||[]),n=t.user.length?t.user.concat(t.ambient):[],r=document.getElementById("background-task-tabs");if(!n.length){r&&r.remove();return}var a=document.getElementById("messages");if(a){r||(r=document.createElement("div"),r.id="background-task-tabs",r.className="split-view-workers background-task-tabs",r.setAttribute("aria-label","Background tasks"),a.parentNode.insertBefore(r,a));var s=JSON.stringify(n.map(function(i){return[i.task_id,i.run_id,i.active,i.description]}));r.dataset.signature!==s&&(r.dataset.signature=s,r.textContent="",n.forEach(function(i){var l=document.createElement("span");l.className="split-view-worker-pill"+(i.ambient?" background-task-ambient":"");var c=document.createElement("button");c.type="button",c.className="split-view-worker-chip",c.dataset.backgroundTask=i.task_id,En(c,$e(i)),i.preview&&Mn($e(i),i.preview,!1),c.title=(i.ambient?"Housekeeping \xB7 ":"")+(i.description||"Background task")+(i.started_at?" \xB7 "+$i(i.started_at):"")+(i.active===!1?" \xB7 Finished":" \xB7 Running"),c.setAttribute("aria-haspopup","dialog");var d=o.get("backgroundTaskViewer");c.setAttribute("aria-expanded",String(!!d&&d.taskId===i.task_id));var u=document.createElement("span");u.className="split-view-worker-dot",u.dataset.state=i.active===!1?"ready":"working";var p=document.createElement("span");if(p.className="split-view-worker-name",p.textContent=i.description||"Background task",u.setAttribute("aria-label",i.active===!1?"Finished":"Running"),c.append(u,p),c.addEventListener("click",function(){Pn(i)}),l.appendChild(c),i.active!==!1){var m=document.createElement("button");m.type="button",m.className="split-view-worker-remove",m.setAttribute("aria-label","Stop "+(i.description||"background task")),m.title="Stop task",m.innerHTML=ee("square"),m.addEventListener("click",function(){var v=w();v&&v.readyState===1&&v.send(JSON.stringify({type:"background_task_stop",requestId:crypto.randomUUID(),taskId:i.task_id,runId:i.run_id||null,sessionOriginId:o.get("sessionOriginId")}))}),l.appendChild(m)}r.appendChild(l)}),D())}}var Pt=new URLSearchParams(location.search),pe=Pt.get("pane")==="1";pe&&typeof performance<"u"&&performance.mark&&performance.mark("clay:app-evaluated");var Q=Number(Pt.get("session"));(!Number.isSafeInteger(Q)||Q<1)&&(Q=null);pe&&document.body.classList.add("pane-mode");var ze=location.pathname.match(/^\/p\/([a-z0-9_-]+)/),es=document.body.dataset.homeProjectSlug||null,xe=ze?ze[1]:es,z=xe?"/p/"+xe+"/":"/",fe=xe?"/p/"+xe+"/ws":"/ws";pe&&(fe+="?pane=1",Q&&(fe+="&session="+Q),Pt.get("contextual")==="1"&&(fe+="&contextual=1"));var f=function(e){return document.getElementById(e)},L=f("messages"),Ke=f("input"),ts=f("send-btn");var Mt=f("header-title"),fh=f("header-rename-btn"),ns=f("slash-menu"),ph=f("suggestion-chips"),rs=f("sidebar"),os=f("sidebar-overlay"),za=f("session-list"),as=f("new-session-btn"),is=f("hamburger-btn"),ss=f("sidebar-toggle-btn"),ls=f("sidebar-expand-btn"),ds=f("image-preview-bar"),mh=f("connect-overlay");var cs="/claude-code-avatar.png";function Ga(e){Be(e)}function us(){return!1}function Ka(){var e=document.getElementById("icon-strip-add");e&&e.click()}function Ya(e){$r(e)}function fs(){Xr()}var gh=f("project-list-section"),hh=f("project-list"),vh=f("project-list-add"),ps=f("project-hint"),Ua=f("project-hint-dismiss"),Ge=xe||null;document.addEventListener("keydown",function(e){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="z"){var t=document.activeElement,n=t&&t.tagName;(n==="TEXTAREA"||n==="INPUT"||t&&t.isContentEditable)&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?document.execCommand("redo",!1,null):document.execCommand("undo",!1,null))}},!0);document.addEventListener("keydown",function(e){e.key==="Escape"&&It()});Ua&&Ua.addEventListener("click",function(){ps.classList.add("hidden");try{localStorage.setItem("clay-project-hint-dismissed","1")}catch{}});f("mermaid-modal").querySelector(".confirm-backdrop").addEventListener("click",nt);f("mermaid-modal").querySelector(".mermaid-modal-btn[title='Close']").addEventListener("click",nt);f("image-modal").querySelector(".confirm-backdrop").addEventListener("click",It);f("image-modal").querySelector(".image-modal-close").addEventListener("click",It);function xt(e){on(e)}function It(){an()}var Qa="";try{Ee=localStorage.getItem("clay-project-name-"+(Ge||"default")),Ee&&(Qa=Ee,Mt&&(Mt.textContent=Ee),kt=f("title-bar-project-name"),kt&&(kt.textContent=Ee)),Ct=localStorage.getItem("clay-project-icon-"+(Ge||"default")),Ct&&(Pe=f("title-bar-project-icon"),Pe&&(Pe.textContent=Ct,Ue(Pe),Pe.classList.add("has-icon")))}catch{}var Ee,kt,Ct,Pe;function Ja(e,t,n,r){sn(e,t,n,r)}Dt({networkSettings:{loaded:!1,busy:!1,confirming:!1,draft:"",saved:"",status:"",errorKind:"",requestId:0},vendorLoginBrowser:null,githubStarCount:null,sharedBrowser:null,sharedBrowsers:[],mcpSkillsWorkbench:{},mateKnowledgeWorkspaces:{},mateColorSave:null,mcpConnections:{screen:"list",servers:[],search:"",loaded:!1},sharedBrowserOpen:!1,sharedBrowserUi:{},sharedBrowserSettings:{},browserLinksBound:!1,basePath:z,wsPath:fe,paneMode:pe,paneSessionId:Q,panePinPending:pe&&!!Q,paneCommittedBinding:null,panePendingBinding:null,paneReady:!1,paneSuspended:!1,paneActivationGeneration:0,paneActivationTimer:null,panePointerBinding:null,paneRichDrafts:{},paneLayoutScrollLock:null,paneLastUserScrollTop:null,paneUserScrollIntent:null,paneUserScrollRevision:0,sessionRichDrafts:{},sessionActionEpoch:0,composerUploadingCount:0,deferredSessionSwitch:null,paneCallbackBinding:null,paneActionEvents:[],paneHeldKeys:{},rewindAction:null,handoffAction:null,authIdentityLoaded:!1,splitIdentityBlockedSocket:null,splitIdentityHydrated:!1,paneActivationUnsupported:!1,paneBindingSessions:[],splitPanes:null,splitGroups:[],splitViewWorkerConversation:null,splitViewWorkerRemoval:null,projectSplitViews:[],projectSplitViewRevision:0,projectSplitViewContextKey:null,projectSplitViewHydrated:!1,projectSplitViewPending:null,projectSplitViewError:"",projectSplitViewActiveId:null,projectSplitViewFocusedOrigin:null,projectSplitViewPreviewTree:null,projectSplitViewDrag:null,splitViewOrganizationDrag:null,projectSplitViewDividerDrag:null,projectSplitViewTranscriptScroll:{},projectSplitViewSuppressClick:null,projectSplitViewSocketGeneration:0,projectSplitViewRequestSocket:null,projectSplitViewRequestGeneration:null,projectSplitViewRequestOwnerId:null,projectSplitViewRequestSlug:null,sessionFolders:null,sessionFoldersSlug:null,sessionFolderCreate:null,sidebarCreationEffects:[],sessionSearch:null,sessionFolderViewMenu:null,sessionFolderLayouts:{},sessionFolderDrag:null,sessionFolderMenu:null,sessionFolderContext:null,sessionFolderModal:null,sessionContextMenu:null,sessionInlineRename:null,splitDelegations:{},pairResultStatus:[],notesTemporarilyHidden:!1,pairResultTrayOpen:!1,dmMode:!1,historyFrom:0,loadingMore:!1,historyTotal:0,replayingHistory:!1,historyReplayBatch:null,pendingSessionEntryNavigation:null,sessionEntryHighlight:null,sessionNavigationRequestId:null,projectName:Qa,cwd:"",currentSlug:Ge,githubWorkPopoverBound:!1,githubWorkSessions:[],githubWorkProject:null,githubWorkRefresh:null,workPrimaryPending:null,activeProjectSlug:null,activeProjectMateId:null,activeProjectMateName:"",clayReturnTarget:null,contextualPrepared:null,contextualSubmitted:{},contextualClay:{mode:"closed",mateId:null},contextualConversationHistory:null,contextualConversationRequest:null,clayControlActivity:null,clayControlOrder:0,clayControlReceipts:[],clayControlForwarded:null,controlRuntimeId:null,studioDocumentSource:null,studioDocumentView:null,clayStudioRelays:{},clayStudioForwarded:{},clayStudioSurfaces:{},clayControlNotifications:[],clayControlFileView:null,clayControlTerminalViews:[],clayControlGitView:null,clayNavigationRendering:null,clayControlViewerRef:null,contextualSessionReady:!1,contextualSessionReceived:!1,contextualSessionUnavailable:!1,clayReturnPendingProjectSlug:null,activeSessionMateId:null,activeSessionMateName:"",sessionActivatedProjectSlug:null,sessionListProjectSlug:null,splitGroupsProjectSlug:null,socketPath:null,pendingHomeProjectSlug:null,homeProjectEmptyVisible:!1,homeShellVisible:!1,projectMateFilterMode:"all",projectMateFilterTurns:0,projectMateFilterActivated:!1,projectMateCreationActive:!1,projectMateCreationMateId:null,projectMateCreationSessionId:null,projectMateCreationRequestId:null,projectMateCreationPendingStart:!1,projectMateCreationAwaitingHistory:!1,projectMateCreationAwaitingMateList:!1,projectMateCreationHistoryReady:!1,projectMateCreationLocalId:null,projectMateCreationMessages:[],projectMateCreationPendingMateId:null,projectDebatePlanningActive:!1,projectDebatePlanningMateId:null,projectDebatePlanningSessionId:null,projectDebatePlanningLocalId:null,projectDebatePlanningRequestId:null,projectDebatePlanningPendingStart:!1,projectDebatePlanningAwaitingHistory:!1,projectDebatePlanningAwaitingMateList:!1,projectDebatePlanningHistoryReady:!1,projectDebatePlanningTopic:"",projectDebatePlanningMessages:[],projectDebatePlanningError:"",projectDebatePlanningRetryable:!1,debatesWorkbenchStatus:"idle",debatesWorkbenchRequestId:null,debatesWorkbenchItems:[],debatesWorkbenchError:"",debatesWorkbenchFilter:"all",debatesWorkbenchCreating:!1,debatesWorkbenchWide:!1,debatesWorkbenchFullscreen:!1,debatesWorkbenchScrollTop:0,pendingDebateNavigation:null,pendingProjectSessionNavigation:null,projectsHubVisible:!1,projectsHubMarkup:null,projectsHubList:[],projectListLoaded:!1,projectsAccessLoaded:!1,projectsHubRestoreRequested:!1,projectStart:br(),projectStartFolder:yr(),onboardingStep:"welcome",onboardingIntent:null,currentProjectOwnerId:null,isOsUsers:!1,skipPermsEnabled:!1,autonomousSelectedMode:"normal",autonomousArming:!1,autonomousArmToken:null,autonomousArmRequestId:null,autonomousArmSessionId:null,autonomousActionRequestId:null,autonomousActionSessionId:null,autonomousCriteria:"",autonomousMaxContinuations:10,autonomousMaxMinutes:60,autonomousRun:null,autonomousExpanded:!1,loopInterviewBrief:null,loopInterviewEditing:!1,loopInterviewRunRequestId:null,loopInterviewRunSessionId:null,loopInterviewStarting:!1,loopInterviewRequestId:null,loopInterviewSessionId:null,slashCommands:[],processing:!1,scheduledMessageCorrelation:null,activeSessionId:null,speechActive:null,speechSettings:null,speechSettingsRequest:0,speechSettingsSaving:!1,speechSettingsError:"",speechPopup:null,speechRetry:null,speechLang:"en-US",speechStatuses:{},speechErrors:{},speechLanguageSaving:!1,speechLifecycleBound:!1,askUserRequests:{},activeBackgroundTasks:[],backgroundTaskCatalog:[],backgroundTaskViewer:null,splitSessionPicker:null,splitSessionCreation:null,agentMessagePreviews:{},agentMessageBubble:null,workerMessagePreviewSubscription:null,sessionVendorBound:!1,cliSessionId:null,isHeadlessMode:!1,savedMainSlug:null,connected:!1,fileReadRequest:null,filePaneInstances:{},activeFilePaneId:null,fileViewerIsPlantUml:!1,plantUmlPreviewJob:null,wireframeDraft:null,wireframeRenderQueue:[],wireframeRenderActive:null,wireframeRenderCache:[],pendingFileNavigation:null,rightWorkbenchOwner:null,rightWorkbenchRevision:0,fileViewerOpenRevision:0,cursorSharingEnabled:!1,cursorSharingHydrated:!1,cursorSharingPending:null,pendingOutboundMessages:[],pendingMessageQueue:{projectSlug:null,sessionId:null,revision:0,paused:!1,items:[],loading:!1,error:""},pendingMessageQueueRecovery:!1,pendingMessageQueueRequests:{},pendingMessageQueueEdit:null,pendingMessageQueueDrag:null,pendingMessageQueueFocusReturn:null,searchClayChatState:null,homeChatMateId:null,homeChatSessionId:null,homeChatSessionModel:null,homeChatSessionVendor:null,homeChatSessionModelLoading:!1,homeMateSessions:{},homeActiveSessionByMate:{},homePreferredMateId:null,homeSidebarCollapsed:!1,homeMatesCollapsed:!1,homeChatScope:"all",homeSubSurface:"chat",homeDebatesStatus:"idle",homeDebates:[],homeDebatesRequestId:null,homeDebatesError:"",homeSurfaceLoaded:!1,homePrimarySurface:null,homeSurfaceProjectSlug:null,homeSurfaceIntent:null,homeSurfaceBootResolved:!1,homeSurfaceRestoreRequested:!1,dockActiveToolId:null,dockOpen:!1,homeDockPreferenceLoaded:!1,dockFocus:!1,dockLibraryOpen:!1,dockBackstageOpen:!1,dockWidth:null,dockHasActivity:!1,dockActivityToolId:null,you:{},youActivity:{},youSequence:0,projectLogsOpen:!1,projectLogsWide:!1,projectLogsFullscreen:!1,projectLogsEntries:[],projectLogsSelectedRef:null,projectLogsView:"list",projectLogsCategory:"",projectLogsContextMode:"",projectLogsIsWorktree:!1,projectLogsListScroll:0,projectLogsListRequestId:null,projectLogsReadRequestId:null,projectLogsCommentRequestId:null,projectLogsCommentStatusEl:null,projectLogsDeleteRequestId:null,projectLogsCanDelete:!1,projectLogsUnread:0,projectLogsSeenRevisions:{},scheduledResultUnread:0,scheduledResultAutoFocusHandled:!1,scheduledResultFocusRef:null,scheduledResultPendingReadRef:null,scheduledResultSeenRefs:{},scheduledResultSessionRequestId:null,issuesOpen:!1,issuesView:"list",issuesSelected:null,issuesRows:[],issuesRequests:{},issueGithub:null,issuesViewRequest:null,issuesViewGeneration:0,issuesUpdateAvailable:null,issuesCache:{},issuesEpoch:0,issuesSearchTimer:null,issueLinkRequests:{},issueLinkOpenRef:null,scheduledTasksOpen:!1,scheduledTasksWide:!1,scheduledTasksFullscreen:!1,scheduledTaskRecords:[],scheduledTaskDraft:null,scheduledTaskEditingId:null,scheduledTaskNewSessionPending:!1,scheduledTaskInterviewRequestId:null,scheduledTaskActionRequestId:null,scheduledTaskListRequest:null,scheduledTaskInterviewId:null,scheduledTaskExpandedId:null,scheduledTaskDeleteId:null,scheduledTaskDraftForm:null,scheduledTaskEditForm:null,scheduledTaskCreateMenuOpen:!1,scheduledTaskManualRequest:null,installedTools:[],capsulesEnabled:!1,capsulesPreferenceLoaded:!1,homeToolRegistryLoaded:!1,toolScanErrors:[],defaultAiState:{loading:!1,saving:!1,refreshRequestId:null,saveRequestId:null,catalogRequestIds:{},catalogs:{},preference:null,selection:null,installedVendors:[],accountAvailable:!0,accountId:null,serverEpoch:null,canonicalRevision:0,error:""},defaultAiDraft:{vendor:"",model:"",effort:""},defaultAiDraftDirty:!1,defaultVendorState:{loading:!1,saving:!1,getRequestId:null,saveRequestId:null,preference:null,preferencePresent:!1,installedVendors:[],accountId:null,projectSlug:null,serverEpoch:null,canonicalRevision:0,error:""},projectSessionVisibilityState:{active:null,pending:null},dmTargetUser:null,dmKey:null,cachedMatesList:[],cachedDmFavorites:[],cachedAvailableBuiltins:[],projectMateDmsEnabled:!0,returningFromMateDm:!1,pendingMateInterview:null,pendingTermCommand:null,shellCommandMode:!1,shellCommandRunning:!1,pendingShellCommandId:null,mateProjectSlug:null,myUserId:null,contextViewPreferenceState:{mode:"off",canonicalMode:"off",preferencePresent:!1,loading:!1,saving:!1,requestId:null,saveRequestId:null,pendingSaves:[],accountId:null,serverEpoch:null,rejectedEpoch:null,canonicalRevision:0,error:""},contextViewOverride:null,isMultiUserMode:!1,dmUnread:{},dmRemovedUsers:{},cachedAllUsers:[],cachedOnlineIds:[],cachedDmConversations:[],sessionDrafts:{},messageUuidMap:[],currentMsgTs:null,richContextUsage:null,contextMeasurement:"unavailable",currentMsgEl:null,currentFullText:"",matePreThinkingEl:null,thinkingState:null,fileViewerFullscreen:!1,markdownSlidesActive:!1,markdownSlideIndex:0,markdownSlideCount:0,markdownSlideLevel:1,markdownSlidePreferredLevel:1,markdownSlideLevelExplicit:!1,currentModel:"",currentModels:[],modelListVendor:"",modelListStatus:"idle",modelListError:"",modelRequestId:"",modelSelectionPending:null,modelSelectionError:"",lastVendor:"",vendorInfo:{},rateLimitState:{},vendorUsageOverview:null,vendorUsageOpen:null,currentMode:"default",effectivePermissionMode:null,permissionCapabilities:{auto:!1,mcpOverride:!1},permissionModePendingByTarget:{},mcpPermissionModePendingByTarget:{},mcpPermissionModeOverrides:{},currentEffort:"medium",currentBetas:[],currentThinking:"adaptive",currentThinkingBudget:1e4,sessionFullAccess:!1,codexApproval:null,codexSandbox:null,codexWebSearch:null,ctxPopoverVisible:!1,headerContextEl:null,loopActive:!1,loopAvailable:!1,loopIteration:0,loopMaxIterations:0,loopBannerName:null,ralphPhase:"idle",ralphCraftingSessionId:null,ralphCraftingSource:null,ralphFilesReady:{promptReady:!1,judgeReady:!1,bothReady:!1},ralphPreviewContent:{prompt:"",judge:""},execModalShown:!1,debateStickyState:null,debateFloorMode:!1,debateConcludeMode:!1,debateEndedMode:!1,knownInstalledSkills:{},permissions:null,wizardData:{name:"",task:"",maxIterations:null,cron:null}});gr({$:f,get ws(){return w()},get connected(){return o.get("connected")},get processing(){return o.get("processing")},messagesEl:L,addSystemMessage:ni});Ao();wa();kn();Ma();var ms={$:f,get ws(){return w()},get connected(){return o.get("connected")},get projectName(){return o.get("projectName")},messagesEl:L,sessionListEl:za,sidebar:rs,sidebarOverlay:os,sidebarToggleBtn:ss,sidebarExpandBtn:ls,hamburgerBtn:is,newSessionBtn:as,headerTitleEl:Mt,showConfirm:Ja,onFilesTabOpen:function(){_o(),Oo(),H()&&F()},requestKnowledgeList:function(){qn()},switchProject:function(e){ri(e)},openTerminal:function(){Lo()},showHomeHub:function(){Ga()},getUpcomingSchedules:fn,get multiUser(){return o.get("isMultiUserMode")},get myUserId(){return o.get("myUserId")},get projectOwnerId(){return o.get("currentProjectOwnerId")},get ownerLocked(){return o.get("ownerLocked")},openDm:function(e){Ya(e)},openMateWizard:function(){Ka()},openAddProjectModal:function(){Sr()},sendWs:function(e){var t=w();t&&t.readyState===1&&t.send(JSON.stringify(e))},onDmRemoveUser:function(e){var t=Object.assign({},o.get("dmRemovedUsers"));t[e]=!0,o.set({dmRemovedUsers:t})},getHistoryFrom:function(){return o.get("historyFrom")},get permissions(){return o.get("permissions")},get projectList(){return ge()||[]},availableBuiltins:function(){return o.get("cachedAvailableBuiltins")||[]}};ma();_e([Bo,Un,_n,Qt,Nn,Jt,vr,Gr]);xo(ms);var Lt=function(){return w()};Vn(Lt);Fn(Lt);_e([rr]);On(Lt,{onShow:function(){Hn(),wo()}});ao({switchProject:function(e){ri(e)},currentSlug:function(){return o.get("currentSlug")},matesList:function(){return o.get("cachedMatesList")||[]},availableBuiltins:function(){return o.get("cachedAvailableBuiltins")||[]},allUsers:function(){return o.get("cachedAllUsers")||[]},dmConversations:function(){return o.get("cachedDmConversations")||[]},myUserId:function(){return o.get("myUserId")},selectSession:function(e){H()&&F();var t=document.getElementById("sticky-notes-panel");if(t&&!t.classList.contains("hidden")){var n=document.getElementById("sticky-notes-sidebar-btn");n&&n.click()}var r=w();r&&r.readyState===1&&r.send(JSON.stringify({type:"switch_session",id:e}))},openDm:function(e){Ya(e)},runAction:function(e){switch(e){case"createMate":Ka();break;case"openSettings":pn();break;case"showHome":Ga();break}}});ba();Bn();Yt();function gs(e){yn(e)}function hs(){Sn()}function vs(e){wn(e)}function bs(){po()}function ys(){mo()}function $a(){Ln()}function Xa(){Tn()}function Ss(){Rn()}function ws(){Dn()}function Tt(e){Vt(e)}var Y=f("new-msg-btn"),_a="\u2193 Latest";function Et(){var e=f("input-area");e&&(Y.style.bottom=e.offsetHeight+12+"px")}var Na=f("input-area");Na&&window.ResizeObserver?new ResizeObserver(Et).observe(Na):window.addEventListener("resize",Et);Et();L.addEventListener("scroll",function(){if(!Ot()){var e=L.scrollHeight-L.scrollTop-L.clientHeight,t=e>150;qt(t),t?(Y.classList.contains("hidden")&&(Y.textContent=_a),Y.classList.remove("hidden")):(Y.classList.add("hidden"),Y.textContent=_a)}});Y.addEventListener("click",function(){Za()});document.addEventListener("visibilitychange",function(){document.hidden||Ie()});L.addEventListener("click",function(e){var t=e.target.closest(".msg-action-fork");if(t){var n=t.closest("[data-uuid]");if(!(!n||!n.dataset.uuid)){var r=n.dataset.uuid;Ja("Fork session from this message?",function(){var a=w();a&&a.readyState===1&&a.send(JSON.stringify({type:"fork_session",uuid:r}))},"Fork",!1)}}});function Ie(){Wt()}function Za(){zt()}rn();bn();Pr();or();Fr();Ur();ja();Kr();Nr();Or();Vr();io();In();An();Ft();Zt({$:f,get ws(){return w()},get connected(){return o.get("connected")},get turnCounter(){return Ht()},messagesEl:L,inputEl:Ke,finalizeAssistantBlock:function(){ks()},addToMessages:function(e){Tt(e)},scrollToBottom:function(){Ie()},setActivity:function(e){vs(e)},stopUrgentBlink:function(){hs()},showImageModal:xt,getContextPercent:function(){var e=xn();return e.contextWindow>0?Math.round(e.input/e.contextWindow*100):0},isMateDm:function(){return o.get("dmMode")&&o.get("dmTargetUser")&&o.get("dmTargetUser").isMate},getMateName:function(){return o.get("dmTargetUser")&&o.get("dmTargetUser").displayName||"Mate"},getMateAvatarUrl:function(){return document.body.dataset.mateAvatarUrl||""},getClaudeAvatar:function(){return cs},getMateById:function(e){var t=o.get("cachedMatesList");if(!e||!t)return null;for(var n=0;n<t.length;n++)if(t[n].id===e)return t[n];return null}});function ei(e,t,n,r,a){lo(e,t,n,r,a)}function ti(e,t){uo(e,t)}function ks(){fo()}function ni(e,t){co(e,t)}function Cs(){ho()}function Ms(){Rr()}function ri(e){je(e)}window.addEventListener("popstate",function(){if(/^\/projects\/?$/.test(location.pathname)){Be(!0);return}Cr();var e=location.pathname.match(/^\/p\/([a-z0-9_-]+)/),t=e?e[1]:null;if(!t){Be(!0);return}nr("project",t),us()&&void 0,t&&t!==o.get("currentSlug")&&(Uo(),ne(),H()&&F(),cn(t),o.set({currentSlug:t}),z="/p/"+t+"/",fe="/p/"+t+"/ws",o.set({basePath:z,wsPath:fe}),Ms(),oi())});function oi(){Qr()}so({get ws(){return w()},get connected(){return o.get("connected")},get processing(){return o.get("processing")},get basePath(){return z},inputEl:Ke,sendBtn:ts,slashMenu:ns,messagesEl:L,imagePreviewBar:ds,slashCommands:function(){return o.get("slashCommands")},messageUuidMap:function(){return o.get("messageUuidMap")},addUserMessage:ei,addSystemMessage:ni,toggleUsagePanel:$a,toggleStatusPanel:Xa,toggleContextPanel:ws,resetContextData:Ss,showImageModal:xt,hideSuggestionChips:Cs,getGhostSuggestion:function(){return go()},setSendBtnMode:gs,isDmMode:function(){return o.get("dmMode")&&!(o.get("dmTargetUser")&&o.get("dmTargetUser").isMate)},getDmKey:function(){return o.get("dmKey")},handleDmSend:function(){fs()},isDebateEndedMode:function(){return o.get("debateEndedMode")},handleDebateEndedSend:function(){handleDebateEndedSend()},isDebateConcludeMode:function(){return o.get("debateConcludeMode")},handleDebateConcludeSend:function(){xs()},isDebateFloorMode:function(){return o.get("debateFloorMode")},handleDebateFloorSend:function(){Ls()},isMateDm:function(){return o.get("dmMode")&&o.get("dmTargetUser")&&o.get("dmTargetUser").isMate},getDmMateId:function(){var e=o.get("dmTargetUser");return o.get("dmMode")&&e&&e.isMate?e.id:null},getMateName:function(){return o.get("dmTargetUser")&&o.get("dmTargetUser").displayName||"Mate"},getMateAvatarUrl:function(){return document.body.dataset.mateAvatarUrl||""},showMatePreThinking:function(){ys()},showClaudePreThinking:function(){bs()},myUserId:function(){return o.get("myUserId")},myDisplayName:function(){var e=null;try{e=JSON.parse(localStorage.getItem("clay_my_user")||"null")}catch{}return e&&(e.displayName||e.username)||document.body.dataset.myDisplayName||"Me"}});hr();Wr({get ws(){return w()},get connected(){return o.get("connected")},inputEl:Ke,messagesEl:L,matesList:function(){return o.get("cachedMatesList")||[]},availableBuiltins:function(){return o.get("cachedAvailableBuiltins")||[]},allUsers:function(){return o.get("cachedAllUsers")||[]},myUserId:function(){return o.get("myUserId")},scrollToBottom:Ie,addUserMessage:ei,addCopyHandler:ti,addToMessages:Tt,showImageModal:xt,showPasteModal:nn});xr({get ws(){return w()},sendWs:function(e){var t=w();t&&t.readyState===1&&t.send(JSON.stringify(e))},messagesEl:L,addToMessages:function(e){Tt(e)},scrollToBottom:Ie,addCopyHandler:ti,matesList:function(){return o.get("cachedMatesList")||[]},availableBuiltins:function(){return o.get("cachedAvailableBuiltins")||[]},currentMateId:function(){return o.get("dmTargetUser")&&o.get("dmTargetUser").isMate?o.get("dmTargetUser").id:o.get("homeChatMateId")||null},requireSkills:Ps,showDebateEndedMode:function(e){Is(e)}});na();tr({basePath:z});mn();fr({basePath:z});function Es(){ln()}fetch("/api/me").then(function(e){return e.json()}).then(function(e){if(e.multiUser&&(o.set({isMultiUserMode:!0}),document.body&&document.body.classList.add("is-multi-user")),e.user&&e.user.id&&(o.set({myUserId:e.user.id}),gn()),o.set({authIdentityLoaded:!0}),o.set({permissions:e.permissions||null,projectsAccessLoaded:!0}),e.mustChangePin&&Es(),!o.get("isMultiUserMode")){var t=document.getElementById("icon-strip-users");t&&(t.innerHTML="",t.classList.add("hidden"))}sa();var n=o.get("permissions");if(n){if(!n.terminal){var r=document.getElementById("terminal-toggle-btn");r&&(r.style.display="none");var a=document.getElementById("terminal-sidebar-btn");a&&(a.style.display="none");var s=document.getElementById("shell-command-btn");s&&(s.style.display="none");var i=document.getElementById("input-more-shell");i&&(i.style.display="none")}if(!n.fileBrowser){var l=document.getElementById("file-browser-btn");l&&(l.style.display="none");var c=document.getElementById("git-placard");c&&(c.style.display="none")}if(!n.skills){var d=document.getElementById("skills-btn");d&&(d.style.display="none");var u=document.getElementById("mate-skills-btn");u&&(u.style.display="none")}if(!n.scheduledTasks){var p=document.getElementById("scheduler-btn");p&&(p.style.display="none")}if(!n.createProject){var m=document.getElementById("icon-strip-add");m&&(m.style.display="none")}}}).catch(function(){});ir().then(function(e){if(o.get("isMultiUserMode")&&!e){var t=document.getElementById("update-pill-wrap");t&&(t.style.display="none")}});ar({$:f,get ws(){return w()},get connected(){return o.get("connected")},messagesEl:L,sessionListEl:za,scrollToBottom:Ie,forceScrollToBottom:Za,basePath:z,toggleUsagePanel:$a,toggleStatusPanel:Xa});sr();hn(no());vn();jo({get ws(){return w()},get connected(){return o.get("connected")},get activeSessionId(){return o.get("activeSessionId")},get cwd(){return o.get("cwd")},messagesEl:L,fileTreeEl:f("file-tree"),fileViewerEl:f("file-viewer")});_e([Po,Go,$t]);Ho();_r();jn();Io({get ws(){return w()},get connected(){return o.get("connected")},terminalContainerEl:f("terminal-container"),terminalBodyEl:f("terminal-body"),fileViewerEl:f("file-viewer")});en({get ws(){return w()},get connected(){return o.get("connected")}});Zo();(function(){var e=new URLSearchParams(window.location.search),t=e.get("playbook");if(t){setTimeout(function(){Xo(t)},300),e.delete("playbook");var n=e.toString(),r=window.location.pathname+(n?"?"+n:"")+window.location.hash;window.history.replaceState(null,"",r)}})();Gt({messagesEl:L,get ws(){return w()},getHistoryFrom:function(){return o.get("historyFrom")}});var Oa=f("find-in-session-btn");Oa&&Oa.addEventListener("click",function(){Kt()});yo();Eo();vo(function(){re()&&Co()});var Fa=f("sticky-notes-sidebar-btn");Fa&&Fa.addEventListener("click",function(){he(),me(),H()&&F(),re()&&ne(),So(),ko()});var Ha=document.querySelectorAll("#sticky-notes-toggle-btn");for(We=0;We<Ha.length;We++)Ha[We].addEventListener("click",function(){bo()});var We,qa=f("sticky-notes-sidebar-count");qa&&qa.addEventListener("click",function(e){e.stopPropagation(),he(),me(),H()&&F(),re()?ne():Mo()});var Va=f("git-placard-more"),Wa=f("terminal-sidebar-btn");Va&&Va.addEventListener("click",function(){Je(),he(),me(),re()&&ne(),H()&&F()});Wa&&Wa.addEventListener("click",function(){Je(),he(),me(),re()&&ne(),H()&&F()});function Ps(e,t){Hr(e,t)}function xs(){Ir()}function Is(e){Lr(e)}function Ls(){Tr()}tn();mr();dn({get ws(){return w()},get connected(){return o.get("connected")},get activeSessionId(){return o.get("activeSessionId")},basePath:z,currentSlug:Ge,getProjects:function(){return ge()}});jr();Er();Dr();Da();wr();oo();qr();kr();zr();Mr();La();Jr();Yr();lucide.createIcons();pe&&typeof performance<"u"&&performance.mark&&performance.mark("clay:bootstrap-complete");oi();ze&&location.hash==="#scheduler"?setTimeout(function(){un("calendar")},500):ze&&Ke.focus();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as a,G as b,H as c,I as d,J as e,K as f,L as g,M as h,N as i}from"./chunk-
|
|
1
|
+
import{F as a,G as b,H as c,I as d,J as e,K as f,L as g,M as h,N as i}from"./chunk-G6ZL6VPR.js";import"./chunk-VZ2OKDAO.js";export{d as claimRightWorkbench,i as handlesWorkbenchKey,f as isRightWorkbenchCurrent,b as registerRightWorkbench,e as releaseRightWorkbench,g as resetRightWorkbench,h as restoreWorkbenchDock,a as rightWorkbenchRevisionFor,c as unregisterRightWorkbench};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as a,m as b,n as c,o as d}from"./chunk-UNTZB4WP.js";import"./chunk-FK43VMMW.js";import"./chunk-JIV7O5GN.js";import"./chunk-HQUGZW4P.js";import"./chunk-UQPN3SQX.js";import"./chunk-LLBLEJM4.js";import"./chunk-R7QVVFUG.js";import"./chunk-G6ZL6VPR.js";import"./chunk-VZ2OKDAO.js";export{a as closeLinear,c as handleLinearResult,d as initLinearPanel,b as openLinear};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$d as r,Kd as a,Ld as b,Md as c,Nd as d,Od as e,Pd as f,Qd as g,Rd as h,Sd as i,Td as j,Ud as k,Vd as l,Wd as m,Xd as n,Yd as o,Zd as p,_d as q,ae as s,be as t,ce as u,de as v}from"./chunk-
|
|
1
|
+
import{$d as r,Kd as a,Ld as b,Md as c,Nd as d,Od as e,Pd as f,Qd as g,Rd as h,Sd as i,Td as j,Ud as k,Vd as l,Wd as m,Xd as n,Yd as o,Zd as p,_d as q,ae as s,be as t,ce as u,de as v}from"./chunk-UNTZB4WP.js";import"./chunk-FK43VMMW.js";import"./chunk-JIV7O5GN.js";import"./chunk-HQUGZW4P.js";import"./chunk-UQPN3SQX.js";import"./chunk-LLBLEJM4.js";import"./chunk-R7QVVFUG.js";import"./chunk-G6ZL6VPR.js";import"./chunk-VZ2OKDAO.js";export{c as closeFileViewer,b as focusFileTree,v as getPendingNavigate,o as handleDirChanged,t as handleFileAt,q as handleFileChanged,r as handleFileHistory,n as handleFsList,p as handleFsRead,m as handleFsSearch,s as handleGitDiff,a as initFileBrowser,j as loadRootDirectory,u as navigateToEdit,f as openFile,h as openWorkingTreeDiff,i as presentMarkdownEdit,l as refreshIfOpen,k as refreshTree,g as reopenFileViewer,e as resetFileBrowser,d as setFileViewerFullscreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$c as a,ad as b,bd as c,cd as d,dd as e,ed as f,fd as g,gd as h,hd as i,id as j,jd as k,kd as l,ld as m,md as n,nd as o}from"./chunk-
|
|
1
|
+
import{$c as a,ad as b,bd as c,cd as d,dd as e,ed as f,fd as g,gd as h,hd as i,id as j,jd as k,kd as l,ld as m,md as n,nd as o}from"./chunk-UNTZB4WP.js";import"./chunk-FK43VMMW.js";import"./chunk-JIV7O5GN.js";import"./chunk-HQUGZW4P.js";import"./chunk-UQPN3SQX.js";import"./chunk-LLBLEJM4.js";import"./chunk-R7QVVFUG.js";import"./chunk-G6ZL6VPR.js";import"./chunk-VZ2OKDAO.js";export{c as closeTerminal,j as handleTermClosed,e as handleTermCreated,i as handleTermExited,d as handleTermList,g as handleTermOutput,h as handleTermResized,f as handleTerminalProjection,a as initTerminal,b as openTerminal,k as resetTerminals,n as restoreExistingTerminal,l as sendTerminalCommand,o as setTerminalExpanded,m as setTerminalTheme};
|