@rizom/brain 0.2.0-alpha.843 → 0.2.0-alpha.844
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/dist/brain.js +5 -5
- package/dist/chunks/{app-xwcj6nrj.js → app-kgqkeyte.js} +2 -2
- package/dist/chunks/{index-n3nbytk3.js → index-6t12x5me.js} +3 -3
- package/dist/chunks/{index-n3nbytk3.js.map → index-6t12x5me.js.map} +1 -1
- package/dist/chunks/{index-p89e6rzz.js → index-pkjvv0ay.js} +2 -2
- package/dist/chunks/{package-scqh3wsz.js → package-96xwdrgf.js} +3 -3
- package/dist/chunks/{package-scqh3wsz.js.map → package-96xwdrgf.js.map} +1 -1
- package/dist/model.js +4 -4
- package/dist/model.js.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/ui/{studio-app-e1c11eddbeb196cb8afcdb54108bd5eeec2e207bb86aabb061720ac41586a76b.css → studio-app-593eb360c4965395c311068e78c3ec19b3d6f43c590c1824648b4cb8f26ae340.css} +2 -1
- package/dist/ui/{studio-app-mnzsgt8r.js → studio-app-sybdqvxs.js} +2 -2
- package/dist/ui/studio-asset-manifest.json +9 -9
- package/dist/ui/studio-chunks/main-zxr0aqw3.js +4 -0
- package/dist/ui/studio-chunks/{main-zy0c7qnp.js.map → main-zxr0aqw3.js.map} +4 -4
- package/dist/ui/studio-chunks/{studio-chat-workspace-5pwyt1ja.js → studio-chat-workspace-rfr7egmk.js} +1 -1
- package/package.json +1 -1
- package/dist/ui/studio-chunks/main-zy0c7qnp.js +0 -4
- /package/dist/chunks/{app-xwcj6nrj.js.map → app-kgqkeyte.js.map} +0 -0
- /package/dist/chunks/{index-p89e6rzz.js.map → index-pkjvv0ay.js.map} +0 -0
- /package/dist/ui/{studio-app-mnzsgt8r.js.map → studio-app-sybdqvxs.js.map} +0 -0
- /package/dist/ui/studio-chunks/{studio-chat-workspace-5pwyt1ja.js.map → studio-chat-workspace-rfr7egmk.js.map} +0 -0
package/dist/testing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ge as k,he as V,ie as U}from"./chunks/index-
|
|
2
|
+
import{ge as k,he as V,ie as U}from"./chunks/index-6t12x5me.js";import{Ae as A,Be as x,bf as N,cf as O,df as z,ef as M,ff as q,gf as J,hf as L,je as E,jf as _,kf as j,me as I}from"./chunks/index-ygeeaab7.js";import"./chunks/index-dv4tqrbw.js";import{of as D}from"./chunks/index-24r1t300.js";import{$i as C,Ko as B,ll as P,ml as w,sg as h}from"./chunks/index-590f2jt0.js";import{Xp as p}from"./chunks/index-s7mrb3rq.js";import{fu as S,hu as v}from"./chunks/index-0va9v6ve.js";import"./chunks/index-ky8tsadx.js";import"./chunks/index-gb5500kt.js";import"./chunks/index-r8mzr1hv.js";import"./chunks/index-cmk5se4p.js";import{mkdtemp as K,rm as b}from"fs/promises";import{tmpdir as X}from"os";import{join as m}from"path";var y="none";function s(){return Promise.reject(Error("A test brain has no AI provider"))}function W(e){return{specificationVersion:"v3",provider:"test-brain",modelId:e,supportedUrls:{},doGenerate:s,doStream:s}}function T(e){let r={...e};return{generateText:s,generateObject:s,judge:s,generateImage:s,getModel:()=>W(r.model??"none"),canGenerateImages:()=>!1,getConfig:()=>({...r}),updateConfig:(o)=>{r={...r,...o}}}}function R(){return{identity:{model:"test:none",dimensions:1536,promptRevision:0},embedQuery:s,embedDocuments:s}}var Y="shell",ee=20;function te(e){if("needsConfirmation"in e)return{needsConfirmation:!0,summary:e.summary};if(!e.success)return{success:!1,error:e.error,...p({code:e.code})};return{success:!0,...p({data:e.data,message:e.message})}}function re(e,r){if(e.status==="completed"||e.status==="failed")return!0;return e.status==="pending"&&e.lastError!==null&&e.scheduledFor>r}function ne(e,r){return e.flatMap((o)=>{if(!D(o))throw Error("A test brain runs packages configured with use(), as defineBrain does");return P(o.definition,o.config,r)})}async function F(e,r){let o=k(r.directory);V(o,r.brainVersion);let f=ne(e.plugins,{name:o.name,version:o.version}),a=await K(m(r.temporaryRoot??X(),"rizom-test-brain-")),g={...E({dataDir:a,cacheDir:m(a,"cache"),distDir:m(a,"dist")}),embedding:{enabled:!1}},i;try{await new J(v.createFresh({level:S.WARN,context:"test-brain"}),{getStandardConfigWithDirectories:async()=>g,migrateEntities:O,migrateJobQueue:z,migrateConversations:M,migrateRuntimeState:q}).runAllMigrations();let t=_({name:o.name,version:o.version,logLevel:"warn",plugins:f,shellConfig:{...g,dataDir:m(a,"brain-data"),ai:{model:y}}}),n=I(j(t));i=N.createFresh(n,{aiService:T(A(n)),embeddingService:R()}),await i.initialize()}catch(t){throw await b(a,{recursive:!0,force:!0}),t}let Z=f.map((t)=>t.id),H,Q=async()=>{try{await i.shutdown()}finally{await b(a,{recursive:!0,force:!0})}};return Object.freeze({async tool(t,n){let l=i.getMCPService().listTools(),d=l.find(({tool:u})=>u.name===t);if(!d)throw Error(`No tool "${t}"; this brain has ${l.map(({tool:u})=>u.name).join(", ")}`);return te(await d.tool.handler(n,L()))},request:(t,n)=>h(i.getMessageBus(),t,n,Y),async fetch(t){let n=x(B(i),t.method.toUpperCase(),new URL(t.url).pathname);if(!n)return new Response("Not Found",{status:404});if(n.sharedHostAdmission==="deny")return new Response("Unauthorized",{status:401});return n.handler(t)},entities:C(i.getEntityService(),"restricted"),jobs:Object.freeze({async wait(t,n){let l=i.getJobQueueService(),d=async()=>{let c=await l.getStatus(n);if(!c||!Z.some((G)=>c.type===`${G}:${t.name}`))return null;if(re(c,Date.now()))return c;return await Bun.sleep(ee),d()},u=await d();return u?w(t,u):null}}),stop:()=>H??=Q()})}function Ee(e){return F(e,{brainVersion:U.version,directory:process.cwd()})}export{Ee as startTestBrain};
|
|
3
3
|
|
|
4
4
|
//# debugId=6B453CF90E8CBEB964756E2164756E21
|
|
5
5
|
//# sourceMappingURL=testing.js.map
|
|
@@ -1241,6 +1241,7 @@
|
|
|
1241
1241
|
.xfb3i0g:not(#\#):not(#\#):not(#\#):not(#\#){min-width:180px}
|
|
1242
1242
|
.x46jg8d:not(#\#):not(#\#):not(#\#):not(#\#){min-width:32px}
|
|
1243
1243
|
.x1nb6za0:not(#\#):not(#\#):not(#\#):not(#\#){min-width:44px}
|
|
1244
|
+
.x12tqqkd:not(#\#):not(#\#):not(#\#):not(#\#){min-width:8ch}
|
|
1244
1245
|
.x450l9j:not(#\#):not(#\#):not(#\#):not(#\#){min-width:90px}
|
|
1245
1246
|
.xk8lq53:not(#\#):not(#\#):not(#\#):not(#\#){min-width:max-content}
|
|
1246
1247
|
.xlsvjbk:not(#\#):not(#\#):not(#\#):not(#\#){min-width:var(--console-touch)}
|
|
@@ -1305,7 +1306,6 @@
|
|
|
1305
1306
|
.x187nhsf:not(#\#):not(#\#):not(#\#):not(#\#){width:44px}
|
|
1306
1307
|
.x1v4s8kt:not(#\#):not(#\#):not(#\#):not(#\#){width:6px}
|
|
1307
1308
|
.xci0xqf:not(#\#):not(#\#):not(#\#):not(#\#){width:7px}
|
|
1308
|
-
.x16ck42q:not(#\#):not(#\#):not(#\#):not(#\#){width:8ch}
|
|
1309
1309
|
.x1xc55vz:not(#\#):not(#\#):not(#\#):not(#\#){width:8px}
|
|
1310
1310
|
.x1wc42o8:not(#\#):not(#\#):not(#\#):not(#\#){width:9px}
|
|
1311
1311
|
.x14atkfc:not(#\#):not(#\#):not(#\#):not(#\#){width:auto}
|
|
@@ -1321,6 +1321,7 @@
|
|
|
1321
1321
|
.xwr7mz2:is([data-studio-field-assist] *):not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:9px}
|
|
1322
1322
|
.x1nopeu7:is([data-studio-system-fields] *):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:0}
|
|
1323
1323
|
.x15x95ik:empty:not(#\#):not(#\#):not(#\#):not(#\#){min-height:0}
|
|
1324
|
+
.xwlmubu:focus:not(#\#):not(#\#):not(#\#):not(#\#){min-width:12ch}
|
|
1324
1325
|
.x1boxzuo:focus:not(#\#):not(#\#):not(#\#):not(#\#){width:12ch}
|
|
1325
1326
|
@media (max-width: 640px){.x1lclwwd.x1lclwwd:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-left-radius:0}}
|
|
1326
1327
|
@media (max-width: 640px){.xgrp7ii.xgrp7ii:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-right-radius:0}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as Np,A as my,B as U2,C as P2,D as $I,E as UI,F as Ln,G as PI,H as _I,I as jI,J as zw,K as fy,L as VI,M as GI,N as K0,O as J0,P as Qd,Q as j2,R as W0,S as Dw,T as Vu,U as Ip,V as Mw,W as Q0,X as xz,Y as Bt,Z as N0,_ as Zz,a as Rw,aa as Z0,b as Hw,ba as Rz,c as W3,ca as z0,d as a8,da as G0,e as u8,ea as o8,f as Q3,fa as SI,g as v2,h as k2,i as S2,j as ay,k as yn,l as pe,m as M2,n as Ta,o as R2,p as we,q as L2,r as dy,s as lI,t as bI,u as h8,v as qh,w as p8,x as Ft,y as To,z as qI}from"./studio-chunks/main-zy0c7qnp.js";import{ta as jd,wa as vI,xa as kI}from"./studio-chunks/main-pmfg03ry.js";import{$a as I2,Ab as PL,Ba as b8,Bb as _L,Ca as xs,Cb as X,Da as k8,Db as u0,Ea as B0,Eb as d0,Fa as Qt,Fb as Wx,Ga as Jo,Gb as qu,Ha as s8,Hb as uz,Ia as S8,Ib as eI,Ja as l8,Jb as U3,Ka as rb,La as Eo,Ma as HI,Mb as cz,Na as ha,Oa as ib,Pa as Wu,Qa as eb,Ra as Hp,Sa as Yo,Ua as t8,Va as n8,Wa as x8,Xa as Xi,Ya as ob,_a as vu,ab as ww,cb as nI,db as Cw,eb as iI,fb as oI,gb as rI,hb as Zo,ib as sI,kb as On,lb as ud,mb as m8,nb as g8,ob as qw,pb as fn,qb as hl,rb as Yy,sb as Lu,tb as Oi,ub as a0,vb as ap,wb as Ky,xb as DB,yb as MB,zb as Bu}from"./studio-chunks/main-jyhbh07e.js";import"./studio-chunks/main-wyzt8zma.js";import{Ub as gI,Vb as yI,Xb as c8,bc as dI,dc as fI,ec as hI}from"./studio-chunks/main-3bfhgpcq.js";import{fc as Yn,gc as jn,ic as Jz,jc as O2,kc as Ko}from"./studio-chunks/main-px4xemnw.js";import{Ac as Wz,Ad as Hz,Bc as Bn,Bd as Ao,Cc as uI,Cd as w8,Dd as C8,Ed as Lt,Fd as io,Hc as cI,Ic as w0,Jc as C0,Kc as A0,Lc as Mp,Nc as Xz,Oc as uR,Qc as R0,Rc as ry,Sc as sy,Uc as Vk,Vc as Gk,Wc as li,Xc as ie,Yc as _n,_c as xu,cd as tb,fd as Nw,gd as T0,hd as jk,id as Ez,mc as T,oc as DI,od as Ss,pc as he,qc as Fz,qd as Hi,rc as Ae,rd as ld,sc as Su,sd as d8,tc as bu,td as $p,uc as ad,ud as $n,vd as nb,wc as Ca,wd as ii,xc as Aa,xd as f8,yc as Gz,yd as Iz,zc as Ea,zd as yw}from"./studio-chunks/main-qzww64vy.js";import{ee as zi}from"./studio-chunks/main-dfmjnvb5.js";import{qf as Je,sf as sH}from"./studio-chunks/main-nbfatnag.js";import{Yf as W,_f as $k,bg as gy}from"./studio-chunks/main-1ad1b2wa.js";var c2=$k(function(rH){(function(){function e(){if(P=!1,ee){var Q=rH.unstable_now();J=Q;var ue=!0;try{e:{I=!1,H&&(H=!1,q(Ee),Ee=-1),E=!0;var se=D;try{t:{a(Q);for(A=o(k);A!==null&&!(A.expirationTime>Q&&f());){var ge=A.callback;if(typeof ge==="function"){A.callback=null,D=A.priorityLevel;var ye=ge(A.expirationTime<=Q);if(Q=rH.unstable_now(),typeof ye==="function"){A.callback=ye,a(Q),ue=!0;break t}A===o(k)&&r(k),a(Q)}else r(k);A=o(k)}if(A!==null)ue=!0;else{var Dt=o(x);Dt!==null&&p(c,Dt.startTime-Q),ue=!1}}break e}finally{A=null,D=se,E=!1}ue=void 0}}finally{ue?re():ee=!1}}}function n(Q,ue){var se=Q.length;Q.push(ue);e:for(;0<se;){var ge=se-1>>>1,ye=Q[ge];if(0<l(ye,ue))Q[ge]=ue,Q[se]=ye,se=ge;else break e}}function o(Q){return Q.length===0?null:Q[0]}function r(Q){if(Q.length===0)return null;var ue=Q[0],se=Q.pop();if(se!==ue){Q[0]=se;e:for(var ge=0,ye=Q.length,Dt=ye>>>1;ge<Dt;){var Me=2*(ge+1)-1,vt=Q[Me],ct=Me+1,ot=Q[ct];if(0>l(vt,se))ct<ye&&0>l(ot,vt)?(Q[ge]=ot,Q[ct]=se,ge=ct):(Q[ge]=vt,Q[Me]=se,ge=Me);else if(ct<ye&&0>l(ot,se))Q[ge]=ot,Q[ct]=se,ge=ct;else break e}}return ue}function l(Q,ue){var se=Q.sortIndex-ue.sortIndex;return se!==0?se:Q.id-ue.id}function a(Q){for(var ue=o(x);ue!==null;){if(ue.callback===null)r(x);else if(ue.startTime<=Q)r(x),ue.sortIndex=ue.expirationTime,n(k,ue);else break;ue=o(x)}}function c(Q){if(H=!1,a(Q),!I)if(o(k)!==null)I=!0,ee||(ee=!0,re());else{var ue=o(x);ue!==null&&p(c,ue.startTime-Q)}}function f(){return P?!0:rH.unstable_now()-J<K?!1:!0}function p(Q,ue){Ee=B(function(){Q(rH.unstable_now())},ue)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),rH.unstable_now=void 0,typeof performance==="object"&&typeof performance.now==="function"){var m=performance;rH.unstable_now=function(){return m.now()}}else{var g=Date,b=g.now();rH.unstable_now=function(){return g.now()-b}}var k=[],x=[],C=1,A=null,D=3,E=!1,I=!1,H=!1,P=!1,B=typeof setTimeout==="function"?setTimeout:null,q=typeof clearTimeout==="function"?clearTimeout:null,F=typeof setImmediate<"u"?setImmediate:null,ee=!1,Ee=-1,K=5,J=-1;if(typeof F==="function")var re=function(){F(e)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,Tt=Te.port2;Te.port1.onmessage=e,re=function(){Tt.postMessage(null)}}else re=function(){B(e,0)};rH.unstable_IdlePriority=5,rH.unstable_ImmediatePriority=1,rH.unstable_LowPriority=4,rH.unstable_NormalPriority=3,rH.unstable_Profiling=null,rH.unstable_UserBlockingPriority=2,rH.unstable_cancelCallback=function(Q){Q.callback=null},rH.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<Q?Math.floor(1000/Q):5},rH.unstable_getCurrentPriorityLevel=function(){return D},rH.unstable_next=function(Q){switch(D){case 1:case 2:case 3:var ue=3;break;default:ue=D}var se=D;D=ue;try{return Q()}finally{D=se}},rH.unstable_requestPaint=function(){P=!0},rH.unstable_runWithPriority=function(Q,ue){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var se=D;D=Q;try{return ue()}finally{D=se}},rH.unstable_scheduleCallback=function(Q,ue,se){var ge=rH.unstable_now();switch(typeof se==="object"&&se!==null?(se=se.delay,se=typeof se==="number"&&0<se?ge+se:ge):se=ge,Q){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5000}return ye=se+ye,Q={id:C++,callback:ue,priorityLevel:Q,startTime:se,expirationTime:ye,sortIndex:-1},se>ge?(Q.sortIndex=se,n(x,Q),o(k)===null&&Q===o(x)&&(H?(q(Ee),Ee=-1):H=!0,p(c,se-ge))):(Q.sortIndex=ye,n(k,Q),I||E||(I=!0,ee||(ee=!0,re()))),Q},rH.unstable_shouldYield=f,rH.unstable_wrapCallback=function(Q){var ue=D;return function(){var se=D;D=ue;try{return Q.apply(this,arguments)}finally{D=se}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var d2=$k(function(lH){var dt=W(c2()),nd=W(Je()),Uk=W(sH());(function(){function e(t,i){for(t=t.memoizedState;t!==null&&0<i;)t=t.next,i--;return t}function n(t,i,s,u){if(s>=i.length)return u;var d=i[s],h=Dn(t)?t.slice():We({},t);return h[d]=n(t[d],i,s+1,u),h}function o(t,i,s){if(i.length!==s.length)console.warn("copyWithRename() expects paths of the same length");else{for(var u=0;u<s.length-1;u++)if(i[u]!==s[u]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return r(t,i,s,0)}}function r(t,i,s,u){var d=i[u],h=Dn(t)?t.slice():We({},t);return u+1===i.length?(h[s[u]]=h[d],Dn(h)?h.splice(d,1):delete h[d]):h[d]=r(t[d],i,s,u+1),h}function l(t,i,s){var u=i[s],d=Dn(t)?t.slice():We({},t);if(s+1===i.length)return Dn(d)?d.splice(u,1):delete d[u],d;return d[u]=l(t[u],i,s+1),d}function a(){return!1}function c(){return null}function f(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function p(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function m(){}function g(){}function b(t){var i=[];return t.forEach(function(s){i.push(s)}),i.sort().join(", ")}function k(t,i,s,u){return new F8(t,i,s,u)}function x(t,i){t.context===Vl&&(r1(t.current,2,i,t,null,null),hc())}function C(t,i){if(Uo!==null){var s=i.staleFamilies;i=i.updatedFamilies,Of(),gC(t.current,i,s),hc()}}function A(t){Uo=t}function D(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function E(t){var i=t,s=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(s=i.return),t=i.return;while(t)}return i.tag===3?s:null}function I(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function H(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function P(t){if(E(t)!==t)throw Error("Unable to find node on an unmounted component.")}function B(t){var i=t.alternate;if(!i){if(i=E(t),i===null)throw Error("Unable to find node on an unmounted component.");return i!==t?null:t}for(var s=t,u=i;;){var d=s.return;if(d===null)break;var h=d.alternate;if(h===null){if(u=d.return,u!==null){s=u;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===s)return P(d),t;if(h===u)return P(d),i;h=h.sibling}throw Error("Unable to find node on an unmounted component.")}if(s.return!==u.return)s=d,u=h;else{for(var y=!1,v=d.child;v;){if(v===s){y=!0,s=d,u=h;break}if(v===u){y=!0,u=d,s=h;break}v=v.sibling}if(!y){for(v=h.child;v;){if(v===s){y=!0,s=h,u=d;break}if(v===u){y=!0,u=h,s=d;break}v=v.sibling}if(!y)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(s.alternate!==u)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(s.tag!==3)throw Error("Unable to find node on an unmounted component.");return s.stateNode.current===s?t:i}function q(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=q(t),i!==null)return i;t=t.sibling}return null}function F(t){if(t===null||typeof t!=="object")return null;return t=wT&&t[wT]||t["@@iterator"],typeof t==="function"?t:null}function ee(t){if(t==null)return null;if(typeof t==="function")return t.$$typeof===m6?null:t.displayName||t.name||null;if(typeof t==="string")return t;switch(t){case kc:return"Fragment";case d1:return"Profiler";case Zm:return"StrictMode";case h1:return"Suspense";case p1:return"SuspenseList";case m1:return"Activity"}if(typeof t==="object")switch(typeof t.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case vc:return"Portal";case cs:return t.displayName||"Context";case f1:return(t._context.displayName||"Context")+".Consumer";case Pf:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case eg:return i=t.displayName||null,i!==null?i:ee(t.type)||"Memo";case yo:i=t._payload,t=t._init;try{return ee(t(i))}catch(s){}}return null}function Ee(t){return typeof t.tag==="number"?K(t):typeof t.name==="string"?t.name:null}function K(t){var i=t.type;switch(t.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(i._context.displayName||"Context")+".Consumer";case 10:return i.displayName||"Context";case 18:return"DehydratedFragment";case 11:return t=i.render,t=t.displayName||t.name||"",i.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ee(i);case 8:return i===Zm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof i==="function")return i.displayName||i.name||null;if(typeof i==="string")return i;break;case 29:if(i=t._debugInfo,i!=null){for(var s=i.length-1;0<=s;s--)if(typeof i[s].name==="string")return i[s].name}if(t.return!==null)return K(t.return)}return null}function J(t){return{current:t}}function re(t,i){0>js?console.error("Unexpected pop."):(i!==y1[js]&&console.error("Unexpected Fiber popped."),t.current=g1[js],g1[js]=null,y1[js]=null,js--)}function Te(t,i,s){js++,g1[js]=t.current,y1[js]=s,t.current=i}function Tt(t){return t===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),t}function Q(t,i){Te(ql,i,t),Te(_f,t,t),Te(Hl,null,t);var s=i.nodeType;switch(s){case 9:case 11:s=s===9?"#document":"#fragment",i=(i=i.documentElement)?(i=i.namespaceURI)?QE(i):il:il;break;default:if(s=i.tagName,i=i.namespaceURI)i=QE(i),i=FE(i,s);else switch(s){case"svg":i=ed;break;case"math":i=Jg;break;default:i=il}}s=s.toLowerCase(),s=Pw(null,s),s={context:i,ancestorInfo:s},re(Hl,t),Te(Hl,s,t)}function ue(t){re(Hl,t),re(_f,t),re(ql,t)}function se(){return Tt(Hl.current)}function ge(t){t.memoizedState!==null&&Te(tg,t,t);var i=Tt(Hl.current),s=t.type,u=FE(i.context,s);s=Pw(i.ancestorInfo,s),u={context:u,ancestorInfo:s},i!==u&&(Te(_f,t,t),Te(Hl,u,t))}function ye(t){_f.current===t&&(re(Hl,t),re(_f,t)),tg.current===t&&(re(tg,t),Bh._currentValue=gu)}function Dt(){}function Me(){if(jf===0){CT=console.log,AT=console.info,ET=console.warn,TT=console.error,DT=console.group,MT=console.groupCollapsed,RT=console.groupEnd;var t={configurable:!0,enumerable:!0,value:Dt,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}jf++}function vt(){if(jf--,jf===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:We({},t,{value:CT}),info:We({},t,{value:AT}),warn:We({},t,{value:ET}),error:We({},t,{value:TT}),group:We({},t,{value:DT}),groupCollapsed:We({},t,{value:MT}),groupEnd:We({},t,{value:RT})})}0>jf&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function ct(t){var i=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,t=t.stack,Error.prepareStackTrace=i,t.startsWith(`Error: react-stack-top-frame
|
|
1
|
+
import{$ as Np,A as my,B as U2,C as P2,D as $I,E as UI,F as Ln,G as PI,H as _I,I as jI,J as zw,K as fy,L as VI,M as GI,N as K0,O as J0,P as Qd,Q as j2,R as W0,S as Dw,T as Vu,U as Ip,V as Mw,W as Q0,X as xz,Y as Bt,Z as N0,_ as Zz,a as Rw,aa as Z0,b as Hw,ba as Rz,c as W3,ca as z0,d as a8,da as G0,e as u8,ea as o8,f as Q3,fa as SI,g as v2,h as k2,i as S2,j as ay,k as yn,l as pe,m as M2,n as Ta,o as R2,p as we,q as L2,r as dy,s as lI,t as bI,u as h8,v as qh,w as p8,x as Ft,y as To,z as qI}from"./studio-chunks/main-zxr0aqw3.js";import{ta as jd,wa as vI,xa as kI}from"./studio-chunks/main-pmfg03ry.js";import{$a as I2,Ab as PL,Ba as b8,Bb as _L,Ca as xs,Cb as X,Da as k8,Db as u0,Ea as B0,Eb as d0,Fa as Qt,Fb as Wx,Ga as Jo,Gb as qu,Ha as s8,Hb as uz,Ia as S8,Ib as eI,Ja as l8,Jb as U3,Ka as rb,La as Eo,Ma as HI,Mb as cz,Na as ha,Oa as ib,Pa as Wu,Qa as eb,Ra as Hp,Sa as Yo,Ua as t8,Va as n8,Wa as x8,Xa as Xi,Ya as ob,_a as vu,ab as ww,cb as nI,db as Cw,eb as iI,fb as oI,gb as rI,hb as Zo,ib as sI,kb as On,lb as ud,mb as m8,nb as g8,ob as qw,pb as fn,qb as hl,rb as Yy,sb as Lu,tb as Oi,ub as a0,vb as ap,wb as Ky,xb as DB,yb as MB,zb as Bu}from"./studio-chunks/main-jyhbh07e.js";import"./studio-chunks/main-wyzt8zma.js";import{Ub as gI,Vb as yI,Xb as c8,bc as dI,dc as fI,ec as hI}from"./studio-chunks/main-3bfhgpcq.js";import{fc as Yn,gc as jn,ic as Jz,jc as O2,kc as Ko}from"./studio-chunks/main-px4xemnw.js";import{Ac as Wz,Ad as Hz,Bc as Bn,Bd as Ao,Cc as uI,Cd as w8,Dd as C8,Ed as Lt,Fd as io,Hc as cI,Ic as w0,Jc as C0,Kc as A0,Lc as Mp,Nc as Xz,Oc as uR,Qc as R0,Rc as ry,Sc as sy,Uc as Vk,Vc as Gk,Wc as li,Xc as ie,Yc as _n,_c as xu,cd as tb,fd as Nw,gd as T0,hd as jk,id as Ez,mc as T,oc as DI,od as Ss,pc as he,qc as Fz,qd as Hi,rc as Ae,rd as ld,sc as Su,sd as d8,tc as bu,td as $p,uc as ad,ud as $n,vd as nb,wc as Ca,wd as ii,xc as Aa,xd as f8,yc as Gz,yd as Iz,zc as Ea,zd as yw}from"./studio-chunks/main-qzww64vy.js";import{ee as zi}from"./studio-chunks/main-dfmjnvb5.js";import{qf as Je,sf as sH}from"./studio-chunks/main-nbfatnag.js";import{Yf as W,_f as $k,bg as gy}from"./studio-chunks/main-1ad1b2wa.js";var c2=$k(function(rH){(function(){function e(){if(P=!1,ee){var Q=rH.unstable_now();J=Q;var ue=!0;try{e:{I=!1,H&&(H=!1,q(Ee),Ee=-1),E=!0;var se=D;try{t:{a(Q);for(A=o(k);A!==null&&!(A.expirationTime>Q&&f());){var ge=A.callback;if(typeof ge==="function"){A.callback=null,D=A.priorityLevel;var ye=ge(A.expirationTime<=Q);if(Q=rH.unstable_now(),typeof ye==="function"){A.callback=ye,a(Q),ue=!0;break t}A===o(k)&&r(k),a(Q)}else r(k);A=o(k)}if(A!==null)ue=!0;else{var Dt=o(x);Dt!==null&&p(c,Dt.startTime-Q),ue=!1}}break e}finally{A=null,D=se,E=!1}ue=void 0}}finally{ue?re():ee=!1}}}function n(Q,ue){var se=Q.length;Q.push(ue);e:for(;0<se;){var ge=se-1>>>1,ye=Q[ge];if(0<l(ye,ue))Q[ge]=ue,Q[se]=ye,se=ge;else break e}}function o(Q){return Q.length===0?null:Q[0]}function r(Q){if(Q.length===0)return null;var ue=Q[0],se=Q.pop();if(se!==ue){Q[0]=se;e:for(var ge=0,ye=Q.length,Dt=ye>>>1;ge<Dt;){var Me=2*(ge+1)-1,vt=Q[Me],ct=Me+1,ot=Q[ct];if(0>l(vt,se))ct<ye&&0>l(ot,vt)?(Q[ge]=ot,Q[ct]=se,ge=ct):(Q[ge]=vt,Q[Me]=se,ge=Me);else if(ct<ye&&0>l(ot,se))Q[ge]=ot,Q[ct]=se,ge=ct;else break e}}return ue}function l(Q,ue){var se=Q.sortIndex-ue.sortIndex;return se!==0?se:Q.id-ue.id}function a(Q){for(var ue=o(x);ue!==null;){if(ue.callback===null)r(x);else if(ue.startTime<=Q)r(x),ue.sortIndex=ue.expirationTime,n(k,ue);else break;ue=o(x)}}function c(Q){if(H=!1,a(Q),!I)if(o(k)!==null)I=!0,ee||(ee=!0,re());else{var ue=o(x);ue!==null&&p(c,ue.startTime-Q)}}function f(){return P?!0:rH.unstable_now()-J<K?!1:!0}function p(Q,ue){Ee=B(function(){Q(rH.unstable_now())},ue)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),rH.unstable_now=void 0,typeof performance==="object"&&typeof performance.now==="function"){var m=performance;rH.unstable_now=function(){return m.now()}}else{var g=Date,b=g.now();rH.unstable_now=function(){return g.now()-b}}var k=[],x=[],C=1,A=null,D=3,E=!1,I=!1,H=!1,P=!1,B=typeof setTimeout==="function"?setTimeout:null,q=typeof clearTimeout==="function"?clearTimeout:null,F=typeof setImmediate<"u"?setImmediate:null,ee=!1,Ee=-1,K=5,J=-1;if(typeof F==="function")var re=function(){F(e)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,Tt=Te.port2;Te.port1.onmessage=e,re=function(){Tt.postMessage(null)}}else re=function(){B(e,0)};rH.unstable_IdlePriority=5,rH.unstable_ImmediatePriority=1,rH.unstable_LowPriority=4,rH.unstable_NormalPriority=3,rH.unstable_Profiling=null,rH.unstable_UserBlockingPriority=2,rH.unstable_cancelCallback=function(Q){Q.callback=null},rH.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<Q?Math.floor(1000/Q):5},rH.unstable_getCurrentPriorityLevel=function(){return D},rH.unstable_next=function(Q){switch(D){case 1:case 2:case 3:var ue=3;break;default:ue=D}var se=D;D=ue;try{return Q()}finally{D=se}},rH.unstable_requestPaint=function(){P=!0},rH.unstable_runWithPriority=function(Q,ue){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var se=D;D=Q;try{return ue()}finally{D=se}},rH.unstable_scheduleCallback=function(Q,ue,se){var ge=rH.unstable_now();switch(typeof se==="object"&&se!==null?(se=se.delay,se=typeof se==="number"&&0<se?ge+se:ge):se=ge,Q){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5000}return ye=se+ye,Q={id:C++,callback:ue,priorityLevel:Q,startTime:se,expirationTime:ye,sortIndex:-1},se>ge?(Q.sortIndex=se,n(x,Q),o(k)===null&&Q===o(x)&&(H?(q(Ee),Ee=-1):H=!0,p(c,se-ge))):(Q.sortIndex=ye,n(k,Q),I||E||(I=!0,ee||(ee=!0,re()))),Q},rH.unstable_shouldYield=f,rH.unstable_wrapCallback=function(Q){var ue=D;return function(){var se=D;D=ue;try{return Q.apply(this,arguments)}finally{D=se}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var d2=$k(function(lH){var dt=W(c2()),nd=W(Je()),Uk=W(sH());(function(){function e(t,i){for(t=t.memoizedState;t!==null&&0<i;)t=t.next,i--;return t}function n(t,i,s,u){if(s>=i.length)return u;var d=i[s],h=Dn(t)?t.slice():We({},t);return h[d]=n(t[d],i,s+1,u),h}function o(t,i,s){if(i.length!==s.length)console.warn("copyWithRename() expects paths of the same length");else{for(var u=0;u<s.length-1;u++)if(i[u]!==s[u]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return r(t,i,s,0)}}function r(t,i,s,u){var d=i[u],h=Dn(t)?t.slice():We({},t);return u+1===i.length?(h[s[u]]=h[d],Dn(h)?h.splice(d,1):delete h[d]):h[d]=r(t[d],i,s,u+1),h}function l(t,i,s){var u=i[s],d=Dn(t)?t.slice():We({},t);if(s+1===i.length)return Dn(d)?d.splice(u,1):delete d[u],d;return d[u]=l(t[u],i,s+1),d}function a(){return!1}function c(){return null}function f(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function p(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function m(){}function g(){}function b(t){var i=[];return t.forEach(function(s){i.push(s)}),i.sort().join(", ")}function k(t,i,s,u){return new F8(t,i,s,u)}function x(t,i){t.context===Vl&&(r1(t.current,2,i,t,null,null),hc())}function C(t,i){if(Uo!==null){var s=i.staleFamilies;i=i.updatedFamilies,Of(),gC(t.current,i,s),hc()}}function A(t){Uo=t}function D(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function E(t){var i=t,s=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(s=i.return),t=i.return;while(t)}return i.tag===3?s:null}function I(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function H(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function P(t){if(E(t)!==t)throw Error("Unable to find node on an unmounted component.")}function B(t){var i=t.alternate;if(!i){if(i=E(t),i===null)throw Error("Unable to find node on an unmounted component.");return i!==t?null:t}for(var s=t,u=i;;){var d=s.return;if(d===null)break;var h=d.alternate;if(h===null){if(u=d.return,u!==null){s=u;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===s)return P(d),t;if(h===u)return P(d),i;h=h.sibling}throw Error("Unable to find node on an unmounted component.")}if(s.return!==u.return)s=d,u=h;else{for(var y=!1,v=d.child;v;){if(v===s){y=!0,s=d,u=h;break}if(v===u){y=!0,u=d,s=h;break}v=v.sibling}if(!y){for(v=h.child;v;){if(v===s){y=!0,s=h,u=d;break}if(v===u){y=!0,u=h,s=d;break}v=v.sibling}if(!y)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(s.alternate!==u)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(s.tag!==3)throw Error("Unable to find node on an unmounted component.");return s.stateNode.current===s?t:i}function q(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=q(t),i!==null)return i;t=t.sibling}return null}function F(t){if(t===null||typeof t!=="object")return null;return t=wT&&t[wT]||t["@@iterator"],typeof t==="function"?t:null}function ee(t){if(t==null)return null;if(typeof t==="function")return t.$$typeof===m6?null:t.displayName||t.name||null;if(typeof t==="string")return t;switch(t){case kc:return"Fragment";case d1:return"Profiler";case Zm:return"StrictMode";case h1:return"Suspense";case p1:return"SuspenseList";case m1:return"Activity"}if(typeof t==="object")switch(typeof t.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case vc:return"Portal";case cs:return t.displayName||"Context";case f1:return(t._context.displayName||"Context")+".Consumer";case Pf:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case eg:return i=t.displayName||null,i!==null?i:ee(t.type)||"Memo";case yo:i=t._payload,t=t._init;try{return ee(t(i))}catch(s){}}return null}function Ee(t){return typeof t.tag==="number"?K(t):typeof t.name==="string"?t.name:null}function K(t){var i=t.type;switch(t.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(i._context.displayName||"Context")+".Consumer";case 10:return i.displayName||"Context";case 18:return"DehydratedFragment";case 11:return t=i.render,t=t.displayName||t.name||"",i.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ee(i);case 8:return i===Zm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof i==="function")return i.displayName||i.name||null;if(typeof i==="string")return i;break;case 29:if(i=t._debugInfo,i!=null){for(var s=i.length-1;0<=s;s--)if(typeof i[s].name==="string")return i[s].name}if(t.return!==null)return K(t.return)}return null}function J(t){return{current:t}}function re(t,i){0>js?console.error("Unexpected pop."):(i!==y1[js]&&console.error("Unexpected Fiber popped."),t.current=g1[js],g1[js]=null,y1[js]=null,js--)}function Te(t,i,s){js++,g1[js]=t.current,y1[js]=s,t.current=i}function Tt(t){return t===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),t}function Q(t,i){Te(ql,i,t),Te(_f,t,t),Te(Hl,null,t);var s=i.nodeType;switch(s){case 9:case 11:s=s===9?"#document":"#fragment",i=(i=i.documentElement)?(i=i.namespaceURI)?QE(i):il:il;break;default:if(s=i.tagName,i=i.namespaceURI)i=QE(i),i=FE(i,s);else switch(s){case"svg":i=ed;break;case"math":i=Jg;break;default:i=il}}s=s.toLowerCase(),s=Pw(null,s),s={context:i,ancestorInfo:s},re(Hl,t),Te(Hl,s,t)}function ue(t){re(Hl,t),re(_f,t),re(ql,t)}function se(){return Tt(Hl.current)}function ge(t){t.memoizedState!==null&&Te(tg,t,t);var i=Tt(Hl.current),s=t.type,u=FE(i.context,s);s=Pw(i.ancestorInfo,s),u={context:u,ancestorInfo:s},i!==u&&(Te(_f,t,t),Te(Hl,u,t))}function ye(t){_f.current===t&&(re(Hl,t),re(_f,t)),tg.current===t&&(re(tg,t),Bh._currentValue=gu)}function Dt(){}function Me(){if(jf===0){CT=console.log,AT=console.info,ET=console.warn,TT=console.error,DT=console.group,MT=console.groupCollapsed,RT=console.groupEnd;var t={configurable:!0,enumerable:!0,value:Dt,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}jf++}function vt(){if(jf--,jf===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:We({},t,{value:CT}),info:We({},t,{value:AT}),warn:We({},t,{value:ET}),error:We({},t,{value:TT}),group:We({},t,{value:DT}),groupCollapsed:We({},t,{value:MT}),groupEnd:We({},t,{value:RT})})}0>jf&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function ct(t){var i=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,t=t.stack,Error.prepareStackTrace=i,t.startsWith(`Error: react-stack-top-frame
|
|
2
2
|
`)&&(t=t.slice(29)),i=t.indexOf(`
|
|
3
3
|
`),i!==-1&&(t=t.slice(i+1)),i=t.indexOf("react_stack_bottom_frame"),i!==-1&&(i=t.lastIndexOf(`
|
|
4
4
|
`,i)),i!==-1)t=t.slice(0,i);else return"";return t}function ot(t){if(b1===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);b1=i&&i[1]||"",OT=-1<s.stack.indexOf(`
|
|
@@ -264,6 +264,6 @@ ${a}`:`# ${r}`}}var Ce=W(he(),1),cR=15000,aR=2;function $h(e){return Ce.jsxDEV("
|
|
|
264
264
|
|
|
265
265
|
[Open the Inbox item](${n.backlink})`;return{draft:o,body:n.body?`${n.body}
|
|
266
266
|
|
|
267
|
-
${r}`:r}}function zP(){let e=window.history.state;return Nw(e)?e:{}}function ZI(e){let{api:n,queryClient:o,history:r,studioBasePath:l,routeTarget:a,routePathname:c,routeSearch:f,currentStudioPathname:p,createMode:m,entityType:g,collectionType:b,activeType:k,entityCollectionQuery:x,preferredMobilePane:C,dispatchEditor:A,setMobilePane:D,setFieldAssistState:E}=e,I=k?.capabilities.canCreate===!0,H=k?.hierarchy.nested!==!1,[P,B]=so.useState(null),[q,F]=so.useState(0),ee=so.useRef(null),Ee=so.useRef(0),K=so.useRef(g);K.current=g,so.useEffect(()=>{if(a.kind==="grouping"){A({type:"collectionChanged"});return}if(!g||a.kind==="workspace"||a.kind==="not-found")return;let Q=a.kind==="entity"&&a.entityType===g?a.id:null,ue=++Ee.current;A({type:"collectionChanged"}),D("details"),E({kind:"idle"});let se=!0,ge=()=>se&&ue===Ee.current;return o.fetchQuery({...K0(n,g),staleTime:0}).then(async(ye)=>{if(!se||ue!==Ee.current)return;let Dt=xI(ye,C.current);if(D(Dt),m&&Q===null){if(!I){B(`Creating ${g} is not allowed.`);return}let Me=KI(window.history.state,g,()=>window.history.replaceState(YI(zP()),"",window.location.href)),vt=JI(ye.fields,Me);A({type:"creationStarted",draft:vt.draft,body:vt.body,...ye.isSingleton&&{singleton:!0},...Me&&{prefilled:!0},...!Me&&!ye.isSingleton&&{prefix:H?Wd(f).prefix:null}});return}if(Q!==null)return o.fetchQuery({...Qd(n,g,Q),staleTime:0}).then((Me)=>{if(!se||ue!==Ee.current)return;let vt=Vd(Me),ct=ee.current,ot=$n(l,g,Q),ln=ct?.pathname===ot?ct.save:{kind:"idle"};if(ct?.pathname===ot)ee.current=null;A({type:"documentOpened",document:vt,save:ln})});if(ye.isSingleton){let Me=await o.ensureQueryData(J0(n,g,Wd("?scope=collection")));if(!ge())return;let vt=Me.entities[0];if(vt)return o.fetchQuery({...Qd(n,g,vt.id),staleTime:0}).then((ct)=>{if(!se||ue!==Ee.current)return;let ot=Vd(ct);A({type:"documentOpened",document:ot})});A({type:"creationStarted",singleton:!0,draft:ob(ye.fields)})}return}).catch((ye)=>{if(se&&ue===Ee.current)B(Da(ye))}),()=>{se=!1}},[m,p,g,q,o,c,f,a,I,H]);let J=so.useCallback((Q,ue={kind:"idle"},se=g)=>{if(!se||!g)return;let ge=$n(l,se,Q);if(!(se===g&&a.kind==="entity"&&a.entityType===g&&a.id===Q)){ee.current={pathname:ge,save:ue};let vt=`${Hi(l,b??g)}${ni(x)}`,ct=m&&ue.kind==="saved",ot=r.location.state,ln=!ct||Nw(ot)&&ot.studioCollectionPath===vt;r[ct?"replace":"push"](`${ge}${ni(x)}`,ln?{studioCollectionPath:vt}:void 0,ue.kind==="saved"?{ignoreBlocker:!0}:void 0);return}let Dt=++Ee.current,Me=g;o.fetchQuery({...Qd(n,g,Q),staleTime:0}).then((vt)=>{if(Dt!==Ee.current||K.current!==Me)return;let ct=Vd(vt);A({type:"documentOpened",document:ct,save:ue}),E({kind:"idle"})}).catch((vt)=>{if(Dt===Ee.current)B(Da(vt))})},[l,p,a,m,g,b,x,o,r]),re=so.useCallback(()=>{F((Q)=>Q+1)},[]),Te=so.useCallback(()=>{Ee.current+=1},[]),Tt=so.useCallback(()=>Ee.current,[]);return{openEntity:J,loadError:P,setLoadError:B,retryOpen:re,supersedeOpen:Te,currentOpenRequest:Tt,pendingOpenState:ee}}var Pr=W(Je(),1);function e8(e){let{api:n,queryClient:o,history:r,studioBasePath:l,entityType:a,collectionType:c,entityCollectionQuery:f,groupReturnPath:p,activeCapabilities:m,schema:g,editor:b,dispatchEditor:k,createPath:x,syncStatus:C,deleting:A,saveEntityMutation:D,deleteEntityMutation:E,openEntity:I,currentOpenRequest:H,setMobilePane:P,setFieldAssistState:B}=e,{mode:q,draft:F,body:ee,save:Ee}=b,[K,J]=Pr.useState(null),re=Pr.useRef(0);Pr.useEffect(()=>{if(Ee.kind!=="saved"||!C?.git)return;if(by({save:Ee,git:C.git,baselineCommit:K}).committed==="done")return;if(Date.now()-re.current>20000)return;let ge=window.setTimeout(()=>{o.invalidateQueries({queryKey:Ln.syncStatus()})},900);return()=>window.clearTimeout(ge)},[Ee,C,K,o]);let Te=Pr.useCallback((se,ge)=>{if(!a||q.kind!=="edit"||m?.canUpdate!==!0||m.canAssist!==!0||ee.trim().length===0)return;B({kind:"loading",field:ge,variant:se}),n.requestFieldAssist({variant:se,entityType:a,id:q.entity.id,targetField:ge}).then((ye)=>{let Dt=ye.variant==="summarize"?ye.suggestion:ye.suggestions;B({kind:"suggested",field:ye.targetField,variant:ye.variant,suggestion:Dt})}).catch((ye)=>{B({kind:"error",field:ge,message:On(ye)})})},[m,ee,a,q]),Tt=Pr.useCallback((se,ge)=>{k({type:"fieldAssistApplied",field:se,suggestion:ge}),B({kind:"idle"})},[]),Q=Pr.useCallback(()=>{if(!a||q.kind==="browse"||!g||a===vl&&!g.groupingDefinitions||Hh(b)||(q.kind==="create"&&g.isSingleton||a===vl)&&!ly(b))return;if(q.kind==="create"?m?.canCreate!==!0:m?.canUpdate!==!0)return;re.current=Date.now(),J(C?.git?.lastCommit??null),k({type:"saveStarted"});let se=g.hasBody?{body:ee}:{},ge=Z0(g.fields,F),ye=q.kind==="create"?{kind:"create",entityType:a,...x&&{idPath:x},frontmatter:ge,...se}:{kind:"update",entityType:a,id:q.entity.id,frontmatter:ge,baseContentHash:q.entity.contentHash,...se},Dt=H();D.mutate(ye,{onSuccess:async(Me)=>{if(await Promise.all([o.invalidateQueries({queryKey:["studio","groupings"]}),o.invalidateQueries({queryKey:Ln.entities(a)}),...c&&c!==a?[o.invalidateQueries({queryKey:Ln.entities(c)})]:[],o.invalidateQueries({queryKey:Ln.syncStatus()}),...a===vl?[o.invalidateQueries({queryKey:["studio","schema"]})]:[],...q.kind==="create"||a===vl?[o.invalidateQueries({queryKey:Ln.navigation()})]:[]]),Dt!==H())return;let vt="skipped"in Me&&Me.skipped===!0;I(Me.entityId,{kind:"saved",noop:vt})},onError:(Me)=>{if(Dt!==H())return;if(Me instanceof Ao&&(Me.status===400||Me.status===409))Promise.all([o.invalidateQueries({queryKey:Ln.navigation()}),o.invalidateQueries({queryKey:["studio","schema"]}),o.invalidateQueries({queryKey:["studio","groupings"]})]);if(Me instanceof Ao&&Me.issues.length>0)P("details");k({type:"saveFailed",save:Me instanceof Ao&&Me.status===409&&q.kind==="edit"?{kind:"conflict",message:On(Me),...Me.conflictId!==void 0&&{conflictId:Me.conflictId}}:{kind:"error",message:Me instanceof Ao&&Me.issues.length>0?Me.message||"Validation failed":On(Me),...Me instanceof Ao?{issues:Me.issues}:{}}})}})},[m,a,c,q,x,b,F,ee,g,I,C,o,D]),ue=Pr.useCallback(()=>{if(!a||q.kind!=="edit"||A||m?.canDelete!==!0)return;let{id:se}=q.entity;E.mutate({entityType:a,id:se},{onSuccess:async()=>{k({type:"deleteSucceeded"}),o.removeQueries({queryKey:Ln.entity(a,se)}),await Promise.all([o.invalidateQueries({queryKey:["studio","groupings"]}),o.invalidateQueries({queryKey:Ln.entityLists()}),o.invalidateQueries({queryKey:Ln.syncStatus()}),o.invalidateQueries({queryKey:Ln.navigation()})]),r.replace(p??`${Hi(l,c??a)}${ni(f)}`,void 0,{ignoreBlocker:!0})},onError:(ge)=>{k({type:"deleteFailed",message:On(ge)})}})},[m,l,a,c,q,A,o,E,r,p,f]);return{runFieldAssist:Te,applyFieldAssist:Tt,save:Q,remove:ue,baselineCommit:K}}var qp=W(Je(),1);function i8(e){let{history:n,queryClient:o,studioBasePath:r,routeTarget:l,routePathname:a,routeSearch:c,entityType:f,activeWorkspaceId:p,types:m,groupings:g,workspaces:b,activeType:k,activeWorkspace:x,entityCollectionQuery:C,entityListOffset:A,entityListTotal:D,declarativeWorkspaceData:E,initialUrlWorkspaceQuery:I,setActiveWorkspaceId:H,setEntityType:P,setLoadError:B,supersedeOpen:q}=e;qp.useEffect(()=>{if(!f||!k||p||l.kind!=="collection"&&l.kind!=="entity"||l.entityType!==f)return;if(D===void 0)return;let F=Math.floor(Math.max(0,D-1)/C.limit)*C.limit;if(A>F)n.replace(`${a}${ni({...C,offset:F})}`,n.location.state)},[k,p,A,D,C,f,a,l,n]),qp.useEffect(()=>{if(!p||!E?.refreshAfterMs)return;let F=window.setTimeout(()=>{o.invalidateQueries({queryKey:Ln.workspace(p)})},E.refreshAfterMs);return()=>window.clearTimeout(F)},[p,E,o]),qp.useEffect(()=>{if(x?.urlQuery!==!0||l.kind!=="workspace"||l.workspaceId!==x.id)return;let F=ii(r,x.id);if(Sl(F,I)!==`${F}${c}`)Y0(n,F,I,window.location.pathname)},[x,r,I,c,l,n]),qp.useEffect(()=>{if(!m)return;if(B(null),l.kind==="not-found"){q(),B(`Studio route not found: ${l.pathname}`);return}if(l.kind==="images"||l.kind==="documents"){q(),H(null),P(null);return}if(l.kind==="grouping"){if(q(),H(null),P(null),!g.some((K)=>K.key===l.grouping))B("Collection unavailable for this account.");return}if(l.kind==="workspace"){let K=b.find((J)=>J.id===l.workspaceId);if(!K){let J=t8(r,l.workspaceId,c,b);if(J){n.replace(J);return}q(),B(`Workspace unavailable for this account: ${l.workspaceId}`);return}H(K.id),P(null);return}if(l.kind==="entity"&&l.entityType==="document"){n.replace($p(r,l.id));return}let F=l.kind==="collection"||l.kind==="entity"?l.entityType:void 0,ee=m.find((K)=>!K.isSingleton)??m[0];if(l.kind==="home"){let K=n8(r,m,b);if(K!==r){n.replace(K);return}}let Ee=F??ee?.entityType??null;if(F!==void 0&&!m.some((K)=>K.entityType===F)){q(),B(`Collection unavailable for this account: ${F}`);return}H(null),P(Ee)},[c,l,n,r,m,g,b])}var Iw=W(Je(),1);function r8(e){let{queryClient:n,workspaces:o,activeWorkspaceId:r,entityType:l,mode:a,declarativeWorkspaceActionMutation:c,openEntity:f}=e,p=Iw.useCallback(async(g)=>{let b=o8(o,g.entityType);if(!b)throw Error("Publishing is unavailable");let k={entityType:g.entityType,entityId:g.entityId,...g.type==="reorder"?{position:g.position}:{}};if(g.type==="publish"&&!g.confirmation){let A=await c.mutateAsync({workspaceId:b.id,action:{actionId:"publish",label:"Publish now",input:k,invocation:{mode:"prepare"}}});if(typeof A!=="object"||A===null||!("kind"in A)||A.kind!=="prepared-confirmation"||!("token"in A)||typeof A.token!=="string"||!("summary"in A)||typeof A.summary!=="string"||!("expiresAt"in A)||typeof A.expiresAt!=="string")throw Error("Publishing confirmation is unavailable");return{needsConfirmation:!0,summary:A.summary,args:{confirmed:!0,confirmationToken:A.token,contentHash:A.token,expiresAt:A.expiresAt}}}let x=await c.mutateAsync({workspaceId:b.id,action:{actionId:g.type,label:g.type,input:k,...g.type==="publish"&&g.confirmation?{invocation:{mode:"execute",token:g.confirmation.confirmationToken}}:{}}});if(typeof x!=="object"||x===null)throw Error("Publishing returned an invalid result");let C="success"in x&&x.success===!1?{success:!1,error:"error"in x&&typeof x.error==="string"?x.error:"Publishing failed",..."code"in x&&typeof x.code==="string"?{code:x.code}:{}}:{success:!0};if(!pw(C)&&!mw(C)){if(await zw(n,b.id),a.kind==="edit"&&l===g.entityType&&a.entity.id===g.entityId)f(g.entityId)}return C},[l,a,f,n,c,o]),m=Iw.useCallback(async(g)=>{if(!r)throw Error("Declarative workspace is unavailable");try{let b=await c.mutateAsync({workspaceId:r,action:g});return await zw(n,r),b}finally{c.reset()}},[r,c,n]);return{performPublishingAction:p,performDeclarativeAction:m}}var Et=W(he(),1),IP=ut.lazy(()=>Yk(async()=>({default:(await import("./studio-chunks/account-view-5hn8fnzw.js")).AccountApp}))),HP=ut.lazy(()=>Yk(async()=>({default:(await import("./studio-chunks/studio-chat-workspace-5pwyt1ja.js")).StudioChatWorkspace}),()=>Et.jsxDEV(Gu,{message:"Chat could not open.",children:Et.jsxDEV(Xk,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)));function qP(e){let n=new URLSearchParams(e).get("session")?.trim();return n&&n.length<=256?n:null}var $P=["public","trusted","admin"];function UP(e,n,o){let r=document.querySelector("[data-studio-root]"),l=r?.getAttribute("data-studio-principal-name")??"Your account",a=r?.getAttribute("data-studio-principal-role"),c=$P.find((b)=>b===a)??"public",f=r?.getAttribute("data-studio-mcp-url")??void 0,p=r?.getAttribute("data-studio-dav-url")??void 0,m=new URLSearchParams(o).get("section")??void 0,g=c8(o);return{displayName:l,role:c,routePath:e,studioPath:n,...f?{mcpUrl:f}:{},...p?{davUrl:p}:{},...m?{initialSection:m}:{},...g?{connect:g}:{}}}function y8(){let e=s8(),n=rb({select:(te)=>te.location.pathname}),o=rb({select:(te)=>te.location.searchStr}),r=rb({select:(te)=>te.location.state}),l=Yo(),a=ut.useMemo(()=>n===ha?{kind:"workspace",workspaceId:ib}:f8(n,l),[n,l]),c=ut.useMemo(()=>a.kind==="collection"&&new URLSearchParams(o).get("mode")==="create",[o,a]),f=n,[p,m]=ut.useState(null),[g,b]=ut.useState(null),[k,x]=ut.useState({}),[C,A]=ut.useReducer(b2,Ih),{mode:D}=C,E=ly(C),[I]=ut.useState(()=>new g8),H=ut.useSyncExternalStore(I.subscribe,I.hasDrafts,I.hasDrafts),[P,B]=ut.useState({hasDraft:!1,busy:!1}),q=l8({shouldBlockFn:({next:te})=>E||n===ha&&m8({...P,hasDraft:H},te.pathname),enableBeforeUnload:E||H||P.busy,withResolver:!0}),[F,ee]=ut.useState({kind:"idle"}),[Ee,K]=ut.useState(m2),[J,re]=ut.useState("details"),Te=ut.useRef(null),Tt=ut.useCallback((te)=>{if(te!=="details")Te.current=te;re(te)},[]),Q=xs(),ue=Lt(),{navigationQuery:se,types:ge,groupings:ye,activeType:Dt,collectionType:Me,activeCapabilities:vt,entityCollectionQuery:ct,entityListOffset:ot,workspaces:ln,activeWorkspace:Io,activeAccount:Ms,activeChat:_r,initialUrlWorkspaceQuery:pi,workspaceRequestQuery:Rs,workspaceQuery:ce,workspaceData:Vn,workspaceError:jr,agentTargets:Os,syncStatus:fr,entityListQuery:Fe,entities:xl,entityListTotal:Ls,schema:ke,createPath:Ne,destinationQuery:lo,saveEntityMutation:Ct,deleteEntityMutation:hr,declarativeWorkspaceActionMutation:pr,deleting:Qu,declarativeWorkspaceData:Fu}=WI({api:ue,entityType:g,activeWorkspaceId:p,routeSearch:o,workspaceQueries:k,editor:C}),Ma=ln.find((te)=>te.rendererName===Wu),[Ra,Xu]=ut.useState(!1),[Up,Fd]=ut.useState(null),Yu=C.mode.kind==="edit"?`${C.mode.entity.entityType}:${C.mode.entity.id}`:null;ut.useEffect(()=>{Fd(null)},[Yu]);let qi=Ma?.chatApiPath;ut.useEffect(()=>{if(!qi||Yu===null)return;let te=(Jt)=>{if(Jt.key.toLowerCase()!=="j"||!(Jt.metaKey||Jt.ctrlKey)||Jt.altKey||Jt.shiftKey)return;Jt.preventDefault(),Xu((Pi)=>!Pi)};return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[qi,Yu]);let Xd=C.mode.kind==="edit"&&ge?.find((te)=>te.entityType===g)?.capabilities.canAssist===!0;ut.useEffect(()=>{u8(qi!==void 0)},[qi]),ut.useEffect(()=>{if(!qi)return;let te=()=>{if(Xd)Xu(!0);else e.history.push(ha)};return window.addEventListener(Hw,te),()=>window.removeEventListener(Hw,te)},[qi,Xd,e]);let Yd=J2({entityType:g,entities:xl}),Ku=x2({principalId:document.querySelector("[data-studio-root]")?.getAttribute("data-studio-principal-id")??null,entityType:g,editor:C,hasUnsavedChanges:E,fields:ke?.fields??[],dispatch:A}),Bs=a.kind==="grouping"?ye.find((te)=>te.key===a.grouping):void 0,Oa=ut.useMemo(()=>h8(o),[o]),La=a.kind==="entity"?p8(r,l,ye):null,Ns=La?.path,Vr=ut.useMemo(()=>g?ye.filter((te)=>te.types.includes(g)):[],[ye,g]),Ba=NI(Vr),{openEntity:Gr,loadError:kn,setLoadError:Wr,retryOpen:wl,supersedeOpen:Cl,currentOpenRequest:Kd,pendingOpenState:Jd}=ZI({api:ue,queryClient:Q,history:e.history,studioBasePath:l,routeTarget:a,routePathname:n,routeSearch:o,currentStudioPathname:f,createMode:c,entityType:g,collectionType:Me,activeType:Dt,entityCollectionQuery:ct,preferredMobilePane:Te,dispatchEditor:A,setMobilePane:re,setFieldAssistState:ee});i8({history:e.history,queryClient:Q,studioBasePath:l,routeTarget:a,routePathname:n,routeSearch:o,entityType:g,activeWorkspaceId:p,types:ge,groupings:ye,workspaces:ln,activeType:Dt,activeWorkspace:Io,entityCollectionQuery:ct,entityListOffset:ot,entityListTotal:Ls,declarativeWorkspaceData:Fu,initialUrlWorkspaceQuery:pi,setActiveWorkspaceId:m,setEntityType:b,setLoadError:Wr,supersedeOpen:Cl});let{openWorkspaceEntity:Ju,openWorkspaceLaunch:Zu,selectEntityType:ao,changeEntityPage:$i,selectWorkspace:ec,selectFolder:ab,startCreate:Zd,backToList:Pp,changeWorkspaceQuery:tc}=XI({history:e.history,studioBasePath:l,routeSearch:o,entityType:g,collectionType:Me,entityCollectionQuery:ct,groupReturnPath:Ns,workspaces:ln,schema:ke,activeCapabilities:vt,pendingOpenState:Jd,setFieldAssistState:ee,setWorkspaceQueries:x}),{runFieldAssist:Ui,applyFieldAssist:_p,save:ef,remove:jp,baselineCommit:tf}=e8({api:ue,queryClient:Q,history:e.history,studioBasePath:l,entityType:g,collectionType:Me,entityCollectionQuery:ct,groupReturnPath:Ns,activeCapabilities:vt,schema:ke,editor:C,dispatchEditor:A,createPath:Ne,syncStatus:fr,deleting:Qu,saveEntityMutation:Ct,deleteEntityMutation:hr,openEntity:Gr,currentOpenRequest:Kd,setMobilePane:re,setFieldAssistState:ee}),{performPublishingAction:Vp,performDeclarativeAction:Gp}=r8({queryClient:Q,workspaces:ln,activeWorkspaceId:p,entityType:g,mode:D,declarativeWorkspaceActionMutation:pr,openEntity:Gr}),mi=kn??(se.error?Da(se.error):Fe.error?Da(Fe.error):null),nf=()=>{if(Wr(null),se.error)se.refetch();if(Fe.error)Fe.refetch();if(ce.error)ce.refetch();if(D.kind==="browse")wl()};if(mi&&!ge)return Et.jsxDEV(Gu,{message:mi,error:!0,onRetry:nf},void 0,!1,void 0,this);if(!ge)return Et.jsxDEV(Gu,{message:"Loading…"},void 0,!1,void 0,this);let of=ge.find((te)=>te.entityType===g),Wp=async(te)=>{if(te.kind==="run")await ue.runWorkspaceAction(te.workspaceId,{actionId:te.actionId,input:{}}),e.history.push(te.href);else if(te.kind==="ask-entry")Xu(!0);else if(te.kind==="ask-brain")I.update(qw(qi,null),{text:te.question}),e.history.push(ha);else if(te.kind==="create")e.history.push(nb(l,te.entityType));else if(te.kind==="climate")a8(document.documentElement.getAttribute("data-climate")==="instrument"?"paper":"instrument");else if(te.href.startsWith("/"))e.history.push(te.href);else window.location.assign(te.href)},nc=Et.jsxDEV(MI,{types:ge.map((te)=>({entityType:te.entityType,singularLabel:te.singularLabel,classification:te.classification,isSingleton:te.isSingleton,canCreate:te.capabilities.canCreate})),hasChat:qi!==void 0,openEntry:D.kind==="edit"&&of?.capabilities.canAssist?{typeLabel:of.singularLabel.toLowerCase()}:null,onCommand:Wp},void 0,!1,void 0,this);if(Ms&&Io){let te=ii(l,tb);return Et.jsxDEV(Et.Fragment,{children:[nc,Et.jsxDEV(wI,{types:ge,workspaces:ln,workspaceId:Io.id,selectEntityType:ao,selectWorkspace:ec,children:Et.jsxDEV(ut.Suspense,{fallback:Et.jsxDEV(pe,{children:"Opening Account…"},void 0,!1,void 0,this),children:Et.jsxDEV(IP,{bootstrap:UP(te,l,o)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}if(_r&&Io)return Et.jsxDEV(Et.Fragment,{children:[nc,Et.jsxDEV(ut.Suspense,{fallback:Et.jsxDEV(Gu,{message:"Opening Chat…"},void 0,!1,void 0,this),children:Et.jsxDEV(HP,{apiPath:Io.chatApiPath,draftStore:I,onNavigationStateChange:B,studioBasePath:l,sessionId:qP(o),types:ge,workspaces:ln,handoff:BI(r),question:LI(r),navigate:(te,Jt)=>{e.history.push(te,void 0,{ignoreBlocker:Jt?.preserveWork===!0})},selectEntityType:ao,selectWorkspace:ec},void 0,!1,void 0,this)},void 0,!1,void 0,this),q.status==="blocked"&&Et.jsxDEV(Bn,{mark:"↩",title:"Leave this conversation?",titleId:"chat-navigation-title",cancelLabel:"Stay",confirmLabel:"Leave",onCancel:()=>q.reset(),onConfirm:()=>q.proceed(),children:Et.jsxDEV("p",{children:"Your draft stays in this tab. Leaving stops receiving the response, but does not undo completed actions or background jobs."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(p?p!==Hp&&!Vn&&!jr:g&&!ke&&!mi)return Et.jsxDEV(Gu,{message:"Loading…"},void 0,!1,void 0,this);if(!Bs&&a.kind!=="images"&&a.kind!=="documents"&&!p&&(!g||!ke&&!mi))return Et.jsxDEV(Gu,{message:mi??"No readable collections are available for this account.",error:Boolean(mi),...mi?{onHome:()=>e.history.push(l)}:{}},void 0,!1,void 0,this);let rf=(te,Jt)=>e.history.push($n(l,te,Jt));return Et.jsxDEV(Et.Fragment,{children:[nc,Et.jsxDEV(CI,{groupings:{items:ye,active:Bs?.key??La?.grouping??null,onSelect:(te)=>e.history.push(ld(l,te))},media:{active:a.kind==="images"||a.kind==="documents"?a.kind:null,onSelect:(te)=>e.history.push(te==="images"?d8(l):$p(l))},mediaView:a.kind==="images"?Et.jsxDEV(V2,{onOpen:rf},void 0,!1,void 0,this):a.kind==="documents"?Et.jsxDEV(_2,{documentId:new URLSearchParams(o).get("id"),onPick:(te)=>e.history.push($p(l,te??void 0)),onOpen:rf},void 0,!1,void 0,this):null,homeView:p===Hp?Et.jsxDEV(dR,{chatApiPath:Ma?.chatApiPath,onNavigate:(te)=>e.history.push(te),onAsk:(te)=>{I.update(qw(Ma?.chatApiPath,null),{text:te}),e.history.push(ha)}},void 0,!1,void 0,this):null,groupReturnLabel:La?.label,groupingSuggestions:Ba,groupingView:Bs?Et.jsxDEV(B2,{basePath:l,grouping:Bs,types:ge,query:Oa,onChange:(te,Jt)=>{let Pi=`${ld(l,Bs.key)}${qh(te)}`,Qp=te.value!==Oa.value||te.offset!==Oa.offset;e.history[Qp&&Jt?.replace!==!0?"push":"replace"](Pi)},onOpen:(te,Jt)=>{let Pi=$n(l,te,Jt);Jd.current={pathname:Pi,save:{kind:"idle"}},e.history.push(Pi,{studioGroupingPath:`${ld(l,Bs.key)}${qh(Oa)}`})}},void 0,!1,void 0,this):null,activeWorkspaceId:p,types:ge,workspaces:ln,workspaceError:jr,readError:mi,onRetryRead:nf,declarativeWorkspaceData:Fu,workspaceQuery:Rs,entityType:g,entities:xl,refineNotice:Yd.notice,onRefineConfirmed:Yd.confirmed,folders:Fe.data?.folders??[],collectionTrail:Fe.data?.trail,collectionPath:Me?Hi(l,Me):l,selectFolder:ab,creationDestination:{data:lo.data??null,pending:lo.isPending,error:lo.error},entityOffset:ot,entityLimit:ct.limit,entityTotal:Ls??0,collectionQuery:ct,onCollectionQueryChange:(te)=>{if(!Me)return;e.history.push(`${Hi(l,Me)}${ni({...te,offset:0})}`),window.scrollTo({top:0,left:0})},entityListLoading:Fe.isPending,schema:ke,editor:C,fieldAssistState:F,bodyMode:Ee,mobilePane:J,syncStatus:fr,baselineCommit:tf,agentTargets:Os,ask:qi?{chatApiPath:qi,draftStore:I,open:Ra,setOpen:Xu,selection:Up,setSelection:Fd}:void 0,deleting:Qu,hasUnsavedChanges:E,navigationBlocked:q.status==="blocked",dispatchEditor:A,setFieldAssistState:ee,setBodyMode:K,setMobilePane:Tt,backToList:Pp,selectEntityType:ao,selectWorkspace:ec,changeEntityPage:$i,openWorkspaceEntity:Ju,openWorkspaceLaunch:Zu,performPublishingAction:Vp,performDeclarativeAction:Gp,onWorkspaceQueryChange:tc,startCreate:Zd,openEntity:(te,Jt)=>Gr(te,void 0,Jt),runFieldAssist:Ui,applyFieldAssist:_p,save:ef,remove:jp,onNavigationReset:()=>q.reset?.(),draftRecovery:Ku,onNavigationProceed:()=>{Ku.forget(),q.proceed?.()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function v8(){return new b8({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1},mutations:{retry:!1}}})}var lb=W(he(),1),sb=document.querySelector("[data-studio-root]");if(sb){let e=sb.getAttribute("data-studio-base-path")??"/studio",n=new w8({basePath:e});sb.textContent="";let o=v8(),r=x8(e,y8);A8.createRoot(sb).render(lb.jsxDEV(k8,{client:o,children:lb.jsxDEV(C8,{api:n,children:lb.jsxDEV(S8,{router:r},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this))}
|
|
267
|
+
${r}`:r}}function zP(){let e=window.history.state;return Nw(e)?e:{}}function ZI(e){let{api:n,queryClient:o,history:r,studioBasePath:l,routeTarget:a,routePathname:c,routeSearch:f,currentStudioPathname:p,createMode:m,entityType:g,collectionType:b,activeType:k,entityCollectionQuery:x,preferredMobilePane:C,dispatchEditor:A,setMobilePane:D,setFieldAssistState:E}=e,I=k?.capabilities.canCreate===!0,H=k?.hierarchy.nested!==!1,[P,B]=so.useState(null),[q,F]=so.useState(0),ee=so.useRef(null),Ee=so.useRef(0),K=so.useRef(g);K.current=g,so.useEffect(()=>{if(a.kind==="grouping"){A({type:"collectionChanged"});return}if(!g||a.kind==="workspace"||a.kind==="not-found")return;let Q=a.kind==="entity"&&a.entityType===g?a.id:null,ue=++Ee.current;A({type:"collectionChanged"}),D("details"),E({kind:"idle"});let se=!0,ge=()=>se&&ue===Ee.current;return o.fetchQuery({...K0(n,g),staleTime:0}).then(async(ye)=>{if(!se||ue!==Ee.current)return;let Dt=xI(ye,C.current);if(D(Dt),m&&Q===null){if(!I){B(`Creating ${g} is not allowed.`);return}let Me=KI(window.history.state,g,()=>window.history.replaceState(YI(zP()),"",window.location.href)),vt=JI(ye.fields,Me);A({type:"creationStarted",draft:vt.draft,body:vt.body,...ye.isSingleton&&{singleton:!0},...Me&&{prefilled:!0},...!Me&&!ye.isSingleton&&{prefix:H?Wd(f).prefix:null}});return}if(Q!==null)return o.fetchQuery({...Qd(n,g,Q),staleTime:0}).then((Me)=>{if(!se||ue!==Ee.current)return;let vt=Vd(Me),ct=ee.current,ot=$n(l,g,Q),ln=ct?.pathname===ot?ct.save:{kind:"idle"};if(ct?.pathname===ot)ee.current=null;A({type:"documentOpened",document:vt,save:ln})});if(ye.isSingleton){let Me=await o.ensureQueryData(J0(n,g,Wd("?scope=collection")));if(!ge())return;let vt=Me.entities[0];if(vt)return o.fetchQuery({...Qd(n,g,vt.id),staleTime:0}).then((ct)=>{if(!se||ue!==Ee.current)return;let ot=Vd(ct);A({type:"documentOpened",document:ot})});A({type:"creationStarted",singleton:!0,draft:ob(ye.fields)})}return}).catch((ye)=>{if(se&&ue===Ee.current)B(Da(ye))}),()=>{se=!1}},[m,p,g,q,o,c,f,a,I,H]);let J=so.useCallback((Q,ue={kind:"idle"},se=g)=>{if(!se||!g)return;let ge=$n(l,se,Q);if(!(se===g&&a.kind==="entity"&&a.entityType===g&&a.id===Q)){ee.current={pathname:ge,save:ue};let vt=`${Hi(l,b??g)}${ni(x)}`,ct=m&&ue.kind==="saved",ot=r.location.state,ln=!ct||Nw(ot)&&ot.studioCollectionPath===vt;r[ct?"replace":"push"](`${ge}${ni(x)}`,ln?{studioCollectionPath:vt}:void 0,ue.kind==="saved"?{ignoreBlocker:!0}:void 0);return}let Dt=++Ee.current,Me=g;o.fetchQuery({...Qd(n,g,Q),staleTime:0}).then((vt)=>{if(Dt!==Ee.current||K.current!==Me)return;let ct=Vd(vt);A({type:"documentOpened",document:ct,save:ue}),E({kind:"idle"})}).catch((vt)=>{if(Dt===Ee.current)B(Da(vt))})},[l,p,a,m,g,b,x,o,r]),re=so.useCallback(()=>{F((Q)=>Q+1)},[]),Te=so.useCallback(()=>{Ee.current+=1},[]),Tt=so.useCallback(()=>Ee.current,[]);return{openEntity:J,loadError:P,setLoadError:B,retryOpen:re,supersedeOpen:Te,currentOpenRequest:Tt,pendingOpenState:ee}}var Pr=W(Je(),1);function e8(e){let{api:n,queryClient:o,history:r,studioBasePath:l,entityType:a,collectionType:c,entityCollectionQuery:f,groupReturnPath:p,activeCapabilities:m,schema:g,editor:b,dispatchEditor:k,createPath:x,syncStatus:C,deleting:A,saveEntityMutation:D,deleteEntityMutation:E,openEntity:I,currentOpenRequest:H,setMobilePane:P,setFieldAssistState:B}=e,{mode:q,draft:F,body:ee,save:Ee}=b,[K,J]=Pr.useState(null),re=Pr.useRef(0);Pr.useEffect(()=>{if(Ee.kind!=="saved"||!C?.git)return;if(by({save:Ee,git:C.git,baselineCommit:K}).committed==="done")return;if(Date.now()-re.current>20000)return;let ge=window.setTimeout(()=>{o.invalidateQueries({queryKey:Ln.syncStatus()})},900);return()=>window.clearTimeout(ge)},[Ee,C,K,o]);let Te=Pr.useCallback((se,ge)=>{if(!a||q.kind!=="edit"||m?.canUpdate!==!0||m.canAssist!==!0||ee.trim().length===0)return;B({kind:"loading",field:ge,variant:se}),n.requestFieldAssist({variant:se,entityType:a,id:q.entity.id,targetField:ge}).then((ye)=>{let Dt=ye.variant==="summarize"?ye.suggestion:ye.suggestions;B({kind:"suggested",field:ye.targetField,variant:ye.variant,suggestion:Dt})}).catch((ye)=>{B({kind:"error",field:ge,message:On(ye)})})},[m,ee,a,q]),Tt=Pr.useCallback((se,ge)=>{k({type:"fieldAssistApplied",field:se,suggestion:ge}),B({kind:"idle"})},[]),Q=Pr.useCallback(()=>{if(!a||q.kind==="browse"||!g||a===vl&&!g.groupingDefinitions||Hh(b)||(q.kind==="create"&&g.isSingleton||a===vl)&&!ly(b))return;if(q.kind==="create"?m?.canCreate!==!0:m?.canUpdate!==!0)return;re.current=Date.now(),J(C?.git?.lastCommit??null),k({type:"saveStarted"});let se=g.hasBody?{body:ee}:{},ge=Z0(g.fields,F),ye=q.kind==="create"?{kind:"create",entityType:a,...x&&{idPath:x},frontmatter:ge,...se}:{kind:"update",entityType:a,id:q.entity.id,frontmatter:ge,baseContentHash:q.entity.contentHash,...se},Dt=H();D.mutate(ye,{onSuccess:async(Me)=>{if(await Promise.all([o.invalidateQueries({queryKey:["studio","groupings"]}),o.invalidateQueries({queryKey:Ln.entities(a)}),...c&&c!==a?[o.invalidateQueries({queryKey:Ln.entities(c)})]:[],o.invalidateQueries({queryKey:Ln.syncStatus()}),...a===vl?[o.invalidateQueries({queryKey:["studio","schema"]})]:[],...q.kind==="create"||a===vl?[o.invalidateQueries({queryKey:Ln.navigation()})]:[]]),Dt!==H())return;let vt="skipped"in Me&&Me.skipped===!0;I(Me.entityId,{kind:"saved",noop:vt})},onError:(Me)=>{if(Dt!==H())return;if(Me instanceof Ao&&(Me.status===400||Me.status===409))Promise.all([o.invalidateQueries({queryKey:Ln.navigation()}),o.invalidateQueries({queryKey:["studio","schema"]}),o.invalidateQueries({queryKey:["studio","groupings"]})]);if(Me instanceof Ao&&Me.issues.length>0)P("details");k({type:"saveFailed",save:Me instanceof Ao&&Me.status===409&&q.kind==="edit"?{kind:"conflict",message:On(Me),...Me.conflictId!==void 0&&{conflictId:Me.conflictId}}:{kind:"error",message:Me instanceof Ao&&Me.issues.length>0?Me.message||"Validation failed":On(Me),...Me instanceof Ao?{issues:Me.issues}:{}}})}})},[m,a,c,q,x,b,F,ee,g,I,C,o,D]),ue=Pr.useCallback(()=>{if(!a||q.kind!=="edit"||A||m?.canDelete!==!0)return;let{id:se}=q.entity;E.mutate({entityType:a,id:se},{onSuccess:async()=>{k({type:"deleteSucceeded"}),o.removeQueries({queryKey:Ln.entity(a,se)}),await Promise.all([o.invalidateQueries({queryKey:["studio","groupings"]}),o.invalidateQueries({queryKey:Ln.entityLists()}),o.invalidateQueries({queryKey:Ln.syncStatus()}),o.invalidateQueries({queryKey:Ln.navigation()})]),r.replace(p??`${Hi(l,c??a)}${ni(f)}`,void 0,{ignoreBlocker:!0})},onError:(ge)=>{k({type:"deleteFailed",message:On(ge)})}})},[m,l,a,c,q,A,o,E,r,p,f]);return{runFieldAssist:Te,applyFieldAssist:Tt,save:Q,remove:ue,baselineCommit:K}}var qp=W(Je(),1);function i8(e){let{history:n,queryClient:o,studioBasePath:r,routeTarget:l,routePathname:a,routeSearch:c,entityType:f,activeWorkspaceId:p,types:m,groupings:g,workspaces:b,activeType:k,activeWorkspace:x,entityCollectionQuery:C,entityListOffset:A,entityListTotal:D,declarativeWorkspaceData:E,initialUrlWorkspaceQuery:I,setActiveWorkspaceId:H,setEntityType:P,setLoadError:B,supersedeOpen:q}=e;qp.useEffect(()=>{if(!f||!k||p||l.kind!=="collection"&&l.kind!=="entity"||l.entityType!==f)return;if(D===void 0)return;let F=Math.floor(Math.max(0,D-1)/C.limit)*C.limit;if(A>F)n.replace(`${a}${ni({...C,offset:F})}`,n.location.state)},[k,p,A,D,C,f,a,l,n]),qp.useEffect(()=>{if(!p||!E?.refreshAfterMs)return;let F=window.setTimeout(()=>{o.invalidateQueries({queryKey:Ln.workspace(p)})},E.refreshAfterMs);return()=>window.clearTimeout(F)},[p,E,o]),qp.useEffect(()=>{if(x?.urlQuery!==!0||l.kind!=="workspace"||l.workspaceId!==x.id)return;let F=ii(r,x.id);if(Sl(F,I)!==`${F}${c}`)Y0(n,F,I,window.location.pathname)},[x,r,I,c,l,n]),qp.useEffect(()=>{if(!m)return;if(B(null),l.kind==="not-found"){q(),B(`Studio route not found: ${l.pathname}`);return}if(l.kind==="images"||l.kind==="documents"){q(),H(null),P(null);return}if(l.kind==="grouping"){if(q(),H(null),P(null),!g.some((K)=>K.key===l.grouping))B("Collection unavailable for this account.");return}if(l.kind==="workspace"){let K=b.find((J)=>J.id===l.workspaceId);if(!K){let J=t8(r,l.workspaceId,c,b);if(J){n.replace(J);return}q(),B(`Workspace unavailable for this account: ${l.workspaceId}`);return}H(K.id),P(null);return}if(l.kind==="entity"&&l.entityType==="document"){n.replace($p(r,l.id));return}let F=l.kind==="collection"||l.kind==="entity"?l.entityType:void 0,ee=m.find((K)=>!K.isSingleton)??m[0];if(l.kind==="home"){let K=n8(r,m,b);if(K!==r){n.replace(K);return}}let Ee=F??ee?.entityType??null;if(F!==void 0&&!m.some((K)=>K.entityType===F)){q(),B(`Collection unavailable for this account: ${F}`);return}H(null),P(Ee)},[c,l,n,r,m,g,b])}var Iw=W(Je(),1);function r8(e){let{queryClient:n,workspaces:o,activeWorkspaceId:r,entityType:l,mode:a,declarativeWorkspaceActionMutation:c,openEntity:f}=e,p=Iw.useCallback(async(g)=>{let b=o8(o,g.entityType);if(!b)throw Error("Publishing is unavailable");let k={entityType:g.entityType,entityId:g.entityId,...g.type==="reorder"?{position:g.position}:{}};if(g.type==="publish"&&!g.confirmation){let A=await c.mutateAsync({workspaceId:b.id,action:{actionId:"publish",label:"Publish now",input:k,invocation:{mode:"prepare"}}});if(typeof A!=="object"||A===null||!("kind"in A)||A.kind!=="prepared-confirmation"||!("token"in A)||typeof A.token!=="string"||!("summary"in A)||typeof A.summary!=="string"||!("expiresAt"in A)||typeof A.expiresAt!=="string")throw Error("Publishing confirmation is unavailable");return{needsConfirmation:!0,summary:A.summary,args:{confirmed:!0,confirmationToken:A.token,contentHash:A.token,expiresAt:A.expiresAt}}}let x=await c.mutateAsync({workspaceId:b.id,action:{actionId:g.type,label:g.type,input:k,...g.type==="publish"&&g.confirmation?{invocation:{mode:"execute",token:g.confirmation.confirmationToken}}:{}}});if(typeof x!=="object"||x===null)throw Error("Publishing returned an invalid result");let C="success"in x&&x.success===!1?{success:!1,error:"error"in x&&typeof x.error==="string"?x.error:"Publishing failed",..."code"in x&&typeof x.code==="string"?{code:x.code}:{}}:{success:!0};if(!pw(C)&&!mw(C)){if(await zw(n,b.id),a.kind==="edit"&&l===g.entityType&&a.entity.id===g.entityId)f(g.entityId)}return C},[l,a,f,n,c,o]),m=Iw.useCallback(async(g)=>{if(!r)throw Error("Declarative workspace is unavailable");try{let b=await c.mutateAsync({workspaceId:r,action:g});return await zw(n,r),b}finally{c.reset()}},[r,c,n]);return{performPublishingAction:p,performDeclarativeAction:m}}var Et=W(he(),1),IP=ut.lazy(()=>Yk(async()=>({default:(await import("./studio-chunks/account-view-5hn8fnzw.js")).AccountApp}))),HP=ut.lazy(()=>Yk(async()=>({default:(await import("./studio-chunks/studio-chat-workspace-rfr7egmk.js")).StudioChatWorkspace}),()=>Et.jsxDEV(Gu,{message:"Chat could not open.",children:Et.jsxDEV(Xk,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)));function qP(e){let n=new URLSearchParams(e).get("session")?.trim();return n&&n.length<=256?n:null}var $P=["public","trusted","admin"];function UP(e,n,o){let r=document.querySelector("[data-studio-root]"),l=r?.getAttribute("data-studio-principal-name")??"Your account",a=r?.getAttribute("data-studio-principal-role"),c=$P.find((b)=>b===a)??"public",f=r?.getAttribute("data-studio-mcp-url")??void 0,p=r?.getAttribute("data-studio-dav-url")??void 0,m=new URLSearchParams(o).get("section")??void 0,g=c8(o);return{displayName:l,role:c,routePath:e,studioPath:n,...f?{mcpUrl:f}:{},...p?{davUrl:p}:{},...m?{initialSection:m}:{},...g?{connect:g}:{}}}function y8(){let e=s8(),n=rb({select:(te)=>te.location.pathname}),o=rb({select:(te)=>te.location.searchStr}),r=rb({select:(te)=>te.location.state}),l=Yo(),a=ut.useMemo(()=>n===ha?{kind:"workspace",workspaceId:ib}:f8(n,l),[n,l]),c=ut.useMemo(()=>a.kind==="collection"&&new URLSearchParams(o).get("mode")==="create",[o,a]),f=n,[p,m]=ut.useState(null),[g,b]=ut.useState(null),[k,x]=ut.useState({}),[C,A]=ut.useReducer(b2,Ih),{mode:D}=C,E=ly(C),[I]=ut.useState(()=>new g8),H=ut.useSyncExternalStore(I.subscribe,I.hasDrafts,I.hasDrafts),[P,B]=ut.useState({hasDraft:!1,busy:!1}),q=l8({shouldBlockFn:({next:te})=>E||n===ha&&m8({...P,hasDraft:H},te.pathname),enableBeforeUnload:E||H||P.busy,withResolver:!0}),[F,ee]=ut.useState({kind:"idle"}),[Ee,K]=ut.useState(m2),[J,re]=ut.useState("details"),Te=ut.useRef(null),Tt=ut.useCallback((te)=>{if(te!=="details")Te.current=te;re(te)},[]),Q=xs(),ue=Lt(),{navigationQuery:se,types:ge,groupings:ye,activeType:Dt,collectionType:Me,activeCapabilities:vt,entityCollectionQuery:ct,entityListOffset:ot,workspaces:ln,activeWorkspace:Io,activeAccount:Ms,activeChat:_r,initialUrlWorkspaceQuery:pi,workspaceRequestQuery:Rs,workspaceQuery:ce,workspaceData:Vn,workspaceError:jr,agentTargets:Os,syncStatus:fr,entityListQuery:Fe,entities:xl,entityListTotal:Ls,schema:ke,createPath:Ne,destinationQuery:lo,saveEntityMutation:Ct,deleteEntityMutation:hr,declarativeWorkspaceActionMutation:pr,deleting:Qu,declarativeWorkspaceData:Fu}=WI({api:ue,entityType:g,activeWorkspaceId:p,routeSearch:o,workspaceQueries:k,editor:C}),Ma=ln.find((te)=>te.rendererName===Wu),[Ra,Xu]=ut.useState(!1),[Up,Fd]=ut.useState(null),Yu=C.mode.kind==="edit"?`${C.mode.entity.entityType}:${C.mode.entity.id}`:null;ut.useEffect(()=>{Fd(null)},[Yu]);let qi=Ma?.chatApiPath;ut.useEffect(()=>{if(!qi||Yu===null)return;let te=(Jt)=>{if(Jt.key.toLowerCase()!=="j"||!(Jt.metaKey||Jt.ctrlKey)||Jt.altKey||Jt.shiftKey)return;Jt.preventDefault(),Xu((Pi)=>!Pi)};return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[qi,Yu]);let Xd=C.mode.kind==="edit"&&ge?.find((te)=>te.entityType===g)?.capabilities.canAssist===!0;ut.useEffect(()=>{u8(qi!==void 0)},[qi]),ut.useEffect(()=>{if(!qi)return;let te=()=>{if(Xd)Xu(!0);else e.history.push(ha)};return window.addEventListener(Hw,te),()=>window.removeEventListener(Hw,te)},[qi,Xd,e]);let Yd=J2({entityType:g,entities:xl}),Ku=x2({principalId:document.querySelector("[data-studio-root]")?.getAttribute("data-studio-principal-id")??null,entityType:g,editor:C,hasUnsavedChanges:E,fields:ke?.fields??[],dispatch:A}),Bs=a.kind==="grouping"?ye.find((te)=>te.key===a.grouping):void 0,Oa=ut.useMemo(()=>h8(o),[o]),La=a.kind==="entity"?p8(r,l,ye):null,Ns=La?.path,Vr=ut.useMemo(()=>g?ye.filter((te)=>te.types.includes(g)):[],[ye,g]),Ba=NI(Vr),{openEntity:Gr,loadError:kn,setLoadError:Wr,retryOpen:wl,supersedeOpen:Cl,currentOpenRequest:Kd,pendingOpenState:Jd}=ZI({api:ue,queryClient:Q,history:e.history,studioBasePath:l,routeTarget:a,routePathname:n,routeSearch:o,currentStudioPathname:f,createMode:c,entityType:g,collectionType:Me,activeType:Dt,entityCollectionQuery:ct,preferredMobilePane:Te,dispatchEditor:A,setMobilePane:re,setFieldAssistState:ee});i8({history:e.history,queryClient:Q,studioBasePath:l,routeTarget:a,routePathname:n,routeSearch:o,entityType:g,activeWorkspaceId:p,types:ge,groupings:ye,workspaces:ln,activeType:Dt,activeWorkspace:Io,entityCollectionQuery:ct,entityListOffset:ot,entityListTotal:Ls,declarativeWorkspaceData:Fu,initialUrlWorkspaceQuery:pi,setActiveWorkspaceId:m,setEntityType:b,setLoadError:Wr,supersedeOpen:Cl});let{openWorkspaceEntity:Ju,openWorkspaceLaunch:Zu,selectEntityType:ao,changeEntityPage:$i,selectWorkspace:ec,selectFolder:ab,startCreate:Zd,backToList:Pp,changeWorkspaceQuery:tc}=XI({history:e.history,studioBasePath:l,routeSearch:o,entityType:g,collectionType:Me,entityCollectionQuery:ct,groupReturnPath:Ns,workspaces:ln,schema:ke,activeCapabilities:vt,pendingOpenState:Jd,setFieldAssistState:ee,setWorkspaceQueries:x}),{runFieldAssist:Ui,applyFieldAssist:_p,save:ef,remove:jp,baselineCommit:tf}=e8({api:ue,queryClient:Q,history:e.history,studioBasePath:l,entityType:g,collectionType:Me,entityCollectionQuery:ct,groupReturnPath:Ns,activeCapabilities:vt,schema:ke,editor:C,dispatchEditor:A,createPath:Ne,syncStatus:fr,deleting:Qu,saveEntityMutation:Ct,deleteEntityMutation:hr,openEntity:Gr,currentOpenRequest:Kd,setMobilePane:re,setFieldAssistState:ee}),{performPublishingAction:Vp,performDeclarativeAction:Gp}=r8({queryClient:Q,workspaces:ln,activeWorkspaceId:p,entityType:g,mode:D,declarativeWorkspaceActionMutation:pr,openEntity:Gr}),mi=kn??(se.error?Da(se.error):Fe.error?Da(Fe.error):null),nf=()=>{if(Wr(null),se.error)se.refetch();if(Fe.error)Fe.refetch();if(ce.error)ce.refetch();if(D.kind==="browse")wl()};if(mi&&!ge)return Et.jsxDEV(Gu,{message:mi,error:!0,onRetry:nf},void 0,!1,void 0,this);if(!ge)return Et.jsxDEV(Gu,{message:"Loading…"},void 0,!1,void 0,this);let of=ge.find((te)=>te.entityType===g),Wp=async(te)=>{if(te.kind==="run")await ue.runWorkspaceAction(te.workspaceId,{actionId:te.actionId,input:{}}),e.history.push(te.href);else if(te.kind==="ask-entry")Xu(!0);else if(te.kind==="ask-brain")I.update(qw(qi,null),{text:te.question}),e.history.push(ha);else if(te.kind==="create")e.history.push(nb(l,te.entityType));else if(te.kind==="climate")a8(document.documentElement.getAttribute("data-climate")==="instrument"?"paper":"instrument");else if(te.href.startsWith("/"))e.history.push(te.href);else window.location.assign(te.href)},nc=Et.jsxDEV(MI,{types:ge.map((te)=>({entityType:te.entityType,singularLabel:te.singularLabel,classification:te.classification,isSingleton:te.isSingleton,canCreate:te.capabilities.canCreate})),hasChat:qi!==void 0,openEntry:D.kind==="edit"&&of?.capabilities.canAssist?{typeLabel:of.singularLabel.toLowerCase()}:null,onCommand:Wp},void 0,!1,void 0,this);if(Ms&&Io){let te=ii(l,tb);return Et.jsxDEV(Et.Fragment,{children:[nc,Et.jsxDEV(wI,{types:ge,workspaces:ln,workspaceId:Io.id,selectEntityType:ao,selectWorkspace:ec,children:Et.jsxDEV(ut.Suspense,{fallback:Et.jsxDEV(pe,{children:"Opening Account…"},void 0,!1,void 0,this),children:Et.jsxDEV(IP,{bootstrap:UP(te,l,o)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}if(_r&&Io)return Et.jsxDEV(Et.Fragment,{children:[nc,Et.jsxDEV(ut.Suspense,{fallback:Et.jsxDEV(Gu,{message:"Opening Chat…"},void 0,!1,void 0,this),children:Et.jsxDEV(HP,{apiPath:Io.chatApiPath,draftStore:I,onNavigationStateChange:B,studioBasePath:l,sessionId:qP(o),types:ge,workspaces:ln,handoff:BI(r),question:LI(r),navigate:(te,Jt)=>{e.history.push(te,void 0,{ignoreBlocker:Jt?.preserveWork===!0})},selectEntityType:ao,selectWorkspace:ec},void 0,!1,void 0,this)},void 0,!1,void 0,this),q.status==="blocked"&&Et.jsxDEV(Bn,{mark:"↩",title:"Leave this conversation?",titleId:"chat-navigation-title",cancelLabel:"Stay",confirmLabel:"Leave",onCancel:()=>q.reset(),onConfirm:()=>q.proceed(),children:Et.jsxDEV("p",{children:"Your draft stays in this tab. Leaving stops receiving the response, but does not undo completed actions or background jobs."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(p?p!==Hp&&!Vn&&!jr:g&&!ke&&!mi)return Et.jsxDEV(Gu,{message:"Loading…"},void 0,!1,void 0,this);if(!Bs&&a.kind!=="images"&&a.kind!=="documents"&&!p&&(!g||!ke&&!mi))return Et.jsxDEV(Gu,{message:mi??"No readable collections are available for this account.",error:Boolean(mi),...mi?{onHome:()=>e.history.push(l)}:{}},void 0,!1,void 0,this);let rf=(te,Jt)=>e.history.push($n(l,te,Jt));return Et.jsxDEV(Et.Fragment,{children:[nc,Et.jsxDEV(CI,{groupings:{items:ye,active:Bs?.key??La?.grouping??null,onSelect:(te)=>e.history.push(ld(l,te))},media:{active:a.kind==="images"||a.kind==="documents"?a.kind:null,onSelect:(te)=>e.history.push(te==="images"?d8(l):$p(l))},mediaView:a.kind==="images"?Et.jsxDEV(V2,{onOpen:rf},void 0,!1,void 0,this):a.kind==="documents"?Et.jsxDEV(_2,{documentId:new URLSearchParams(o).get("id"),onPick:(te)=>e.history.push($p(l,te??void 0)),onOpen:rf},void 0,!1,void 0,this):null,homeView:p===Hp?Et.jsxDEV(dR,{chatApiPath:Ma?.chatApiPath,onNavigate:(te)=>e.history.push(te),onAsk:(te)=>{I.update(qw(Ma?.chatApiPath,null),{text:te}),e.history.push(ha)}},void 0,!1,void 0,this):null,groupReturnLabel:La?.label,groupingSuggestions:Ba,groupingView:Bs?Et.jsxDEV(B2,{basePath:l,grouping:Bs,types:ge,query:Oa,onChange:(te,Jt)=>{let Pi=`${ld(l,Bs.key)}${qh(te)}`,Qp=te.value!==Oa.value||te.offset!==Oa.offset;e.history[Qp&&Jt?.replace!==!0?"push":"replace"](Pi)},onOpen:(te,Jt)=>{let Pi=$n(l,te,Jt);Jd.current={pathname:Pi,save:{kind:"idle"}},e.history.push(Pi,{studioGroupingPath:`${ld(l,Bs.key)}${qh(Oa)}`})}},void 0,!1,void 0,this):null,activeWorkspaceId:p,types:ge,workspaces:ln,workspaceError:jr,readError:mi,onRetryRead:nf,declarativeWorkspaceData:Fu,workspaceQuery:Rs,entityType:g,entities:xl,refineNotice:Yd.notice,onRefineConfirmed:Yd.confirmed,folders:Fe.data?.folders??[],collectionTrail:Fe.data?.trail,collectionPath:Me?Hi(l,Me):l,selectFolder:ab,creationDestination:{data:lo.data??null,pending:lo.isPending,error:lo.error},entityOffset:ot,entityLimit:ct.limit,entityTotal:Ls??0,collectionQuery:ct,onCollectionQueryChange:(te)=>{if(!Me)return;e.history.push(`${Hi(l,Me)}${ni({...te,offset:0})}`),window.scrollTo({top:0,left:0})},entityListLoading:Fe.isPending,schema:ke,editor:C,fieldAssistState:F,bodyMode:Ee,mobilePane:J,syncStatus:fr,baselineCommit:tf,agentTargets:Os,ask:qi?{chatApiPath:qi,draftStore:I,open:Ra,setOpen:Xu,selection:Up,setSelection:Fd}:void 0,deleting:Qu,hasUnsavedChanges:E,navigationBlocked:q.status==="blocked",dispatchEditor:A,setFieldAssistState:ee,setBodyMode:K,setMobilePane:Tt,backToList:Pp,selectEntityType:ao,selectWorkspace:ec,changeEntityPage:$i,openWorkspaceEntity:Ju,openWorkspaceLaunch:Zu,performPublishingAction:Vp,performDeclarativeAction:Gp,onWorkspaceQueryChange:tc,startCreate:Zd,openEntity:(te,Jt)=>Gr(te,void 0,Jt),runFieldAssist:Ui,applyFieldAssist:_p,save:ef,remove:jp,onNavigationReset:()=>q.reset?.(),draftRecovery:Ku,onNavigationProceed:()=>{Ku.forget(),q.proceed?.()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function v8(){return new b8({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1},mutations:{retry:!1}}})}var lb=W(he(),1),sb=document.querySelector("[data-studio-root]");if(sb){let e=sb.getAttribute("data-studio-base-path")??"/studio",n=new w8({basePath:e});sb.textContent="";let o=v8(),r=x8(e,y8);A8.createRoot(sb).render(lb.jsxDEV(k8,{client:o,children:lb.jsxDEV(C8,{api:n,children:lb.jsxDEV(S8,{router:r},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this))}
|
|
268
268
|
|
|
269
269
|
//# debugId=B9A98C963564164D64756E2164756E21
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 2,
|
|
3
3
|
"entrypoints": {
|
|
4
|
-
"script": "studio-app-
|
|
5
|
-
"stylesheet": "studio-app-
|
|
4
|
+
"script": "studio-app-sybdqvxs.js",
|
|
5
|
+
"stylesheet": "studio-app-593eb360c4965395c311068e78c3ec19b3d6f43c590c1824648b4cb8f26ae340.css"
|
|
6
6
|
},
|
|
7
7
|
"assets": {
|
|
8
|
-
"studio-app-
|
|
9
|
-
"studio-app-
|
|
10
|
-
"studio-app-
|
|
8
|
+
"studio-app-593eb360c4965395c311068e78c3ec19b3d6f43c590c1824648b4cb8f26ae340.css": "studio-app-593eb360c4965395c311068e78c3ec19b3d6f43c590c1824648b4cb8f26ae340.css",
|
|
9
|
+
"studio-app-sybdqvxs.js": "studio-app-sybdqvxs.js",
|
|
10
|
+
"studio-app-sybdqvxs.js.map": "studio-app-sybdqvxs.js.map",
|
|
11
11
|
"studio-chunks/account-view-5hn8fnzw.js": "studio-chunks/account-view-5hn8fnzw.js",
|
|
12
12
|
"studio-chunks/account-view-5hn8fnzw.js.map": "studio-chunks/account-view-5hn8fnzw.js.map",
|
|
13
13
|
"studio-chunks/chat-552ft422.js": "studio-chunks/chat-552ft422.js",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"studio-chunks/main-wkp4g23f.js.map": "studio-chunks/main-wkp4g23f.js.map",
|
|
35
35
|
"studio-chunks/main-wyzt8zma.js": "studio-chunks/main-wyzt8zma.js",
|
|
36
36
|
"studio-chunks/main-wyzt8zma.js.map": "studio-chunks/main-wyzt8zma.js.map",
|
|
37
|
-
"studio-chunks/main-
|
|
38
|
-
"studio-chunks/main-
|
|
37
|
+
"studio-chunks/main-zxr0aqw3.js": "studio-chunks/main-zxr0aqw3.js",
|
|
38
|
+
"studio-chunks/main-zxr0aqw3.js.map": "studio-chunks/main-zxr0aqw3.js.map",
|
|
39
39
|
"studio-chunks/mermaid-GHXKKRXX-72bpwfn8.js": "studio-chunks/mermaid-GHXKKRXX-72bpwfn8.js",
|
|
40
40
|
"studio-chunks/mermaid-GHXKKRXX-72bpwfn8.js.map": "studio-chunks/mermaid-GHXKKRXX-72bpwfn8.js.map",
|
|
41
41
|
"studio-chunks/studio-ask-panel-4anny620.js": "studio-chunks/studio-ask-panel-4anny620.js",
|
|
42
42
|
"studio-chunks/studio-ask-panel-4anny620.js.map": "studio-chunks/studio-ask-panel-4anny620.js.map",
|
|
43
|
-
"studio-chunks/studio-chat-workspace-
|
|
44
|
-
"studio-chunks/studio-chat-workspace-
|
|
43
|
+
"studio-chunks/studio-chat-workspace-rfr7egmk.js": "studio-chunks/studio-chat-workspace-rfr7egmk.js",
|
|
44
|
+
"studio-chunks/studio-chat-workspace-rfr7egmk.js.map": "studio-chunks/studio-chat-workspace-rfr7egmk.js.map"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Aa as En,Ca as Dn,Fa as hn,Ga as Wn,La as ie,Oa as qt,Sa as ae,Ta as Xe,Xa as Xn,Za as Gn,bb as Qn,hb as Fn,ib as tt,jb as vt,kb as _e,lb as In}from"./main-jyhbh07e.js";import{hc as xn,jc as St,lc as Bn}from"./main-px4xemnw.js";import{Bd as Hn,Ed as we,Fd as Re,Ic as ln,Jc as un,Kc as cn,Lc as he,Mc as dn,Nc as Ue,Xc as O,Yc as fn,cd as ye,fd as Tt,mc as r,nc as yt,od as rt,pc as I,qd as Ae,rc as D,rd as Be,sc as te,sd as Et,tc as J,td as jt,uc as Je,ud as Nn,vc as Pn,wc as Wt,wd as kn,xc as Pt,xd as Nt,zc as Gt,zd as me}from"./main-qzww64vy.js";import{ee as oe}from"./main-dfmjnvb5.js";import{qf as R}from"./main-nbfatnag.js";import{Yf as M}from"./main-1ad1b2wa.js";var Pe={recordLink:{kMwMTN:"x1heor9g",kybGjl:"x1hl2dhg",kLWn49:"xggjnk3",$$css:!0},readable:{kMwMTN:"xqvuw85","--console-text-muted":"x1phc7po",$$css:!0},frame:{"--console-text-muted":"x1phc7po",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kUk6DE:"x98rzlu x1ba37h5 x1dkdqs9",kAzted:"x2lwn1j x19xbvgk xfc1thu",kWkggS:"x1dd94t5",$$css:!0},boot:{kmVPX3:"x1o8uwn5",$$css:!0},listing:{kzqmXN:"x14atkfc",kogj98:"x1ghz6dp",kGO01o:"xbe17z6",kgwM9Q:"xx1slpc",kXkAfU:"x1w9335",keaIxW:"x7zq708",kh9fTk:"x1m3yuwo",$$css:!0},row:{k1xSpc:"xrvj5dj",kOIVth:"xaobbuh",kGNEyG:"x1pha0wt",kzqmXN:"xh8yej3",kmVPX3:"x1ecgsid",kEafiO:"x972fbf",kWqL5O:"xgfja2r",kZ1KPB:"xyj58a3",kt9PQ7:"xso031l",kfdmCh:"x1q0q8m5",kL6WhQ:"xna4lh4",kWkggS:"xjbqb8w xd8d5gp",k9WMMc:"xdpxx8g",kkrTdU:"x1ypdohk",k1ekBW:"x15406qy x4wkmsb",kIyJzY:"xgdialr",kAMwcw:"xwji4o3",kMv6JI:"x5ddh9m",kAzted:"x2lwn1j",kLyoy9:"x1hqb3p9",kTWfjk:"x79d85h",kRugJJ:"xj4fmvg",$$css:!0},index:{kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",kMwMTN:"x1ar3pfp",$$css:!0},title:{k7Eaqz:"xeuugli",kHjlTd:"xj0a0fe",kMv6JI:"xssy22x",ka26j:"xvy63o1",k63SB2:"x11zgcw",kGuDYH:"xksbqk4",kb6lSQ:"x3rbum1",kMwMTN:"xqvuw85 xz8qu5x",kr4CYY:"xn50ssu",katwyW:"x1tvf21l",$$css:!0},covered:{kumcoG:"x4u00d1",k1JLwA:"x1yjaet2",$$css:!0},cover:{k1xSpc:"x1lliihq",kSGwAc:"x1y8v6su",kzqmXN:"xh8yej3",kOBAk4:"x1dltgaz",kVQacm:"xb3r6kr",kaIpWk:"x12oqio5",$$css:!0},compact:{kmVPX3:"x1ah2213",kTWfjk:"x1qm741w",kRugJJ:"x1h4xdqo",$$css:!0},inlineStatus:{k1xSpc:"xt0psk2",keoZOQ:"xdj266r",koQZXg:"x16ydxro",$$css:!0},members:{k1xSpc:"x1lliihq",keoZOQ:"x1gslohp",kMv6JI:"x5ddh9m",kGuDYH:"x1j6dyjg",k63SB2:"xo1l8bm",kMwMTN:"x1ar3pfp",kb6lSQ:"x12oo3zp",$$css:!0},coverPending:{k1xSpc:"x1lliihq",kzqmXN:"xh8yej3",kZKoxP:"x5yr21d",kWkggS:"x18s3upu",$$css:!0},coverImage:{k1xSpc:"x1lliihq",kzqmXN:"xh8yej3",kZKoxP:"x5yr21d",kVIFPx:"xl1xv1r",$$css:!0},excerpt:{k1xSpc:"x104kibb",kJFfOR:"x1h7i4cw",kgKLqz:"x1ua5tub",kVQacm:"xb3r6kr",keoZOQ:"x1gslohp",kMv6JI:"x5ddh9m",kGuDYH:"x2ouz8m",k63SB2:"xo1l8bm",kLWn49:"xfrs9s4",kb6lSQ:"x12oo3zp",kMwMTN:"x1ar3pfp",$$css:!0},updated:{kFhvOy:"x12fk4p8",kMwMTN:"xgi1xjn",kMv6JI:"x5ddh9m",kGuDYH:"x1ct8sxb",kb6lSQ:"x12oo3zp",kCrP1I:"x3h480r",kU6wY8:"xnoo4qv",kV7FkP:"x1re7oy7",kR4nxE:"x1y8onsm",kT6U2d:"x162edmi",kr4CYY:"x155ir8z",$$css:!0},empty:{kmVPX3:"x1easoi4",$$css:!0},pagination:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"x13a6bvl",kOIVth:"x1af02g3",kmVPX3:"x1y7lb24",kMwMTN:"x1ar3pfp",kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",kGOSNy:"x1s9bmkn",kLyoy9:"x1otypdl",k3VDzK:"x12xhqv2",$$css:!0},pager:{k1xSpc:"x3nfvp2",kOIVth:"x17d4w8g",$$css:!0},range:{khDVqt:"xuxw1ft",$$css:!0}};var F={bar:{k1xSpc:"x1s85apg x1ur00lv",kVAEAm:"xixxii4",kkqhue:"x17y0mx6",krVfgx:"x1ey2m1c",kY2c9j:"xa9119d",kjj79g:"x1l1ennw",kGNEyG:"x1cy8zhl",kZKoxP:"xtx5lt5",kLKAdn:"x1y1aw1k",kGO01o:"x11ba12",kEafiO:"x178xt8z",kPef9Z:"x13fuv20",kLZC3w:"xvg7k2t",kWkggS:"xbslqsl",kMv6JI:"x5ddh9m",$$css:!0},tab:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kGNEyG:"x6s0dn4",kOIVth:"x1ed6fcf",k7Eaqz:"xlsvjbk",kAzted:"x1eguyfn",kg3NbH:"x1xijbu4",kMzoRj:"xc342km",kWkggS:"xjbqb8w",kMwMTN:"xqvuw85",kMv6JI:"x5ddh9m",kGuDYH:"x1j6dyjg",kkrTdU:"x1ypdohk",kybGjl:"x1hl2dhg",k3XXqK:"x1t137rt x9v5kkp",kMeerF:"x1de99jn",kjBf7l:"x1itw484",kInvED:"x2ssjo2",kaIpWk:"xur7f20",$$css:!0},active:{kMwMTN:"x1q7454x",k63SB2:"x1s688f",$$css:!0},icon:{k1xSpc:"x1lliihq",$$css:!0},light:{kVAEAm:"x10l6tqk",k87sOh:"x1pdr0v7",kt4wiu:"xxx7yvo",kzqmXN:"xci0xqf",kZKoxP:"x1hagigm",kaIpWk:"x16rqkct",kWkggS:"x15vqgvx",$$css:!0},space:{kGO01o:"x1rybyne",$$css:!0},sheetList:{kORKVm:"x1odjw0f",kZeWKH:"xish69e",kqGvvJ:"x10im51j",kUOVxO:"x1x57ub9",k8WAf4:"xt970qd",kg3NbH:"xnjsko4",kB88ic:"xe8uvvx",$$css:!0},option:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x883omv",kzqmXN:"xh8yej3",kAzted:"x1eguyfn",kg3NbH:"xdqyycr",kMzoRj:"xc342km",kaIpWk:"xur7f20",kWkggS:"xjbqb8w",kMwMTN:"xqvuw85",kMv6JI:"x5ddh9m",kGuDYH:"x1jvydc1",k9WMMc:"x1yc453h",kybGjl:"x1hl2dhg",kkrTdU:"x1ypdohk",$$css:!0},optionActive:{kWkggS:"x9kxhyz",k63SB2:"x1s688f",$$css:!0},optionCount:{keTefX:"xvc5jky",kMv6JI:"xa9opjo",kGuDYH:"xfifm61",kMwMTN:"xqvuw85",$$css:!0},optionAttention:{kMwMTN:"x1q7454x",$$css:!0}};var wt=M(R(),1),at="studio.navigation.collapsed",it="studio-navigation-preference",Ge=new WeakMap;function Un(){if(typeof window>"u")return!1;let e=Ge.get(window);if(e!==void 0)return e;try{return window.localStorage.getItem(at)==="true"}catch{return Ge.get(window)??!1}}function Yn(e){let t=(n)=>{if(n.key!==at&&n.key!==null)return;Ge.delete(window),e()};return window.addEventListener(it,e),window.addEventListener("storage",t),()=>{window.removeEventListener(it,e),window.removeEventListener("storage",t)}}function Ve(e){Ge.set(window,e);try{window.localStorage.setItem(at,String(e))}catch{}window.dispatchEvent(new Event(it))}function $t(){return wt.useSyncExternalStore(Yn,Un,()=>!1)}var q={shell:{kumcoG:"x1i9x5af x6bw718 x1ukz75g",kjdo94:"xirox3h",$$css:!0},shellCollapsed:{kumcoG:"x1hxcnyl",kjdo94:"xirox3h",$$css:!0},navigationCollapsed:{kg3NbH:"x1awh872",$$css:!0},allTypes:{kmVPX3:"xyfktp2",$$css:!0},allTypesSummary:{kkrTdU:"x1ypdohk",kpqbRz:"x1cy9i3i",kMv6JI:"x5ddh9m",kGuDYH:"xfifm61",kb6lSQ:"x12oo3zp",kP9fke:"x6mezaz",$$css:!0},section:{k1xSpc:"xrvj5dj",kOIVth:"x195vfkc",$$css:!0},collapsedLabel:{k1xSpc:"x1s85apg",$$css:!0},collapsedLink:{kumcoG:"x1y6fwsi",kAPf3g:"x1o2pa38",kg3NbH:"xfn1xvj",$$css:!0},collapsedTitle:{kjj79g:"xl56j7k",kg3NbH:"xnjsko4",$$css:!0},collapseButton:{kzqmXN:"xgd8bvy",kAzted:"xe0p6wg",kmVPX3:"x1717udv",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"x1kogg8i",kWkggS:"xjbqb8w",kMwMTN:"xgi1xjn",kkrTdU:"x1ypdohk",kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",kPJHz1:"x784prv",k7shQP:"x9v5kkp",kZs9gx:"xxh1od1",kiEn40:"x1bqaal",$$css:!0},mobileSummary:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x167g77z",kAzted:"x1eguyfn",kg3NbH:"xb1dmaa",kaIpWk:"xur7f20",kMwMTN:"xqvuw85",kkrTdU:"x1ypdohk",kB88ic:"xe8uvvx",kGqHtl:"x1i5lizr",kGzVvX:"xd8d5gp",kPJHz1:"x784prv",k7shQP:"x9v5kkp",kZs9gx:"xxh1od1",kiEn40:"x1bqaal",$$css:!0},mobileGroupName:{kMwMTN:"xqvuw85",$$css:!0},mobileCurrent:{koQZXg:"x8x9d4c",ks0D6T:"x73t7g",k7Eaqz:"xeuugli",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",kMwMTN:"x1ar3pfp",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",k63SB2:"xo1l8bm",kb6lSQ:"x12oo3zp",kP9fke:"x6mezaz",$$css:!0},mobileDisclosure:{k1xSpc:"xrvj5dj",kgQiWS:"x1ku5rj1",kzqmXN:"xw4jnvo",kMwMTN:"x1ar3pfp",kGuDYH:"x1k6wstc",k1ekBW:"x11xpdln x4wkmsb",kIyJzY:"xgdialr",k3aq6I:"x9tu13d x53p255",$$css:!0},mobileDirect:{k1xSpc:"x1lliihq",k1K539:"x1yztbdb",kGO01o:"xsag5q8",kt9PQ7:"xso031l",kfdmCh:"x1q0q8m5",kL6WhQ:"xpqg30t",$$css:!0},mobileDirectLink:{kZCmMZ:"xe2zdcy",$$css:!0},mobileFilter:{kUk6DE:"x12lumcd",k7Eaqz:"xeuugli",$$css:!0},mobileEmpty:{kmVPX3:"x1f7pr5y",kMwMTN:"x1ar3pfp",kMv6JI:"x5ddh9m",kGuDYH:"xif65rj",kLWn49:"x1jjo3f5",$$css:!0},mobileTally:{koQZXg:"x8x9d4c",kMwMTN:"x1jdz31e",kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",$$css:!0},mobileAttention:{koQZXg:"x8x9d4c",kMwMTN:"x1q7454x",kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",k63SB2:"x19s9jnd",$$css:!0},rail:{k7Eaqz:"xeuugli",kAzted:"x2lwn1j",kVQacm:"xb3r6kr",kmVPX3:"x1717udv",kWqL5O:"xs1s249",kSWEuD:"x32b0ac",k26BEO:"xe636ye",kWkggS:"xbslqsl",kOgw8m:"xzd29fr",$$css:!0},navigation:{k1xSpc:"x78zum5",kXwgrk:"xdt5ytf",kOIVth:"x1jnr06f",kzqmXN:"xh8yej3",kZKoxP:"x5yr21d",kAzted:"x2lwn1j",kmVPX3:"x7obcpk",kWqL5O:"xs1s249",kSWEuD:"x32b0ac",k26BEO:"xe636ye",kWkggS:"xbslqsl",kOgw8m:"xzd29fr",$$css:!0},areaRail:{k1xSpc:"x78zum5",k7Eaqz:"xeuugli",kXwgrk:"xdt5ytf",kOIVth:"x1jnr06f",kmVPX3:"x7obcpk",kWqL5O:"xs1s249",kSWEuD:"x32b0ac",k26BEO:"xe636ye",kWkggS:"xbslqsl",$$css:!0},areaTitle:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"x13a6bvl",kOIVth:"x1jnr06f",kmVPX3:"x6uox72",kMwMTN:"x1ar3pfp",$$css:!0},areaLink:{kVAEAm:"x1n2onr6",k1xSpc:"xrvj5dj",kumcoG:"x1otrvri",kGNEyG:"x6s0dn4",kOIVth:"x17d4w8g",kAzted:"x141feeh",kmVPX3:"x1xq1gxn",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x9r1u3d",kaIpWk:"xu4hgxq",kWkggS:"xjbqb8w",kMwMTN:"xgi1xjn",kkrTdU:"x1ypdohk",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",k9WMMc:"xdpxx8g",kaVNsj:"xdn345r",kDPRdz:"x18m2ztq",kYPGJ8:"xtgyt42",kWCcOm:"xnqy2f1",kPJHz1:"x784prv",k7shQP:"x9v5kkp",kZs9gx:"xxh1od1",kiEn40:"x1bqaal",$$css:!0},areaActive:{kVAM5u:"x8tuc8h",kWkggS:"x18s3upu",kMwMTN:"xqvuw85",$$css:!0},ordinal:{kMwMTN:"x1ar3pfp",kMv6JI:"xa9opjo",kGuDYH:"xvwhms9",kKX8nH:"x1j61x8r",k63SB2:"x1s688f",$$css:!0},ordinalActive:{kMwMTN:"x1q7454x",$$css:!0},leaf:{k1xSpc:"xrvj5dj",k7Eaqz:"xeuugli",kogj98:"xh8a1rz",kE3dHu:"x11iknt3",kZ1KPB:"xe0pwq",k4WBpm:"x19ypqd9",kaZRDh:"xz6lizu",$$css:!0},leafHead:{kmVPX3:"xaukpwp",kt9PQ7:"xso031l",kfdmCh:"x1q0q8m5",kL6WhQ:"xpqg30t",$$css:!0},leafTitle:{kogj98:"x91luw6",kMwMTN:"xqvuw85",$$css:!0},leafDescription:{kogj98:"x1ghz6dp",kMwMTN:"x1ar3pfp",kGuDYH:"x1k6wstc",kLWn49:"xfrs9s4",$$css:!0},leafScroll:{k1xSpc:"xrvj5dj",kfiyM8:"x10ukxgv",kOIVth:"x195vfkc",kUk6DE:"x98rzlu",kAzted:"x2lwn1j",kORKVm:"x1odjw0f",kZeWKH:"xish69e",$$css:!0},leafGroup:{kmVPX3:"xyfktp2",$$css:!0},leafLabel:{kmVPX3:"x61dodf",kMwMTN:"x1ar3pfp",$$css:!0},list:{kB88ic:"xe8uvvx",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",$$css:!0},leafLink:{k1xSpc:"x78zum5",kGNEyG:"x1pha0wt",kOIVth:"x167g77z",kzqmXN:"xh8yej3",kAzted:"x21xpn4",kmVPX3:"xk61eof",kMzoRj:"xc342km",kZ1KPB:"x19sr0n1",ksu8eU:"x1y0btm7",kVAM5u:"x9r1u3d",kWkggS:"xjbqb8w",kMwMTN:"xgi1xjn",kMv6JI:"x5ddh9m",kGuDYH:"xfifm61",kLWn49:"xggjnk3",k9WMMc:"xdpxx8g",kybGjl:"x1hl2dhg",kkrTdU:"x1ypdohk",kGzVvX:"xd8d5gp",kDPRdz:"x18m2ztq",kPJHz1:"x784prv",k7shQP:"x9v5kkp",kZs9gx:"xxh1od1",kiEn40:"x1bqaal",$$css:!0},leafActive:{kaZRDh:"x1yn89ol",kWkggS:"x18s3upu",kMwMTN:"xqvuw85",k63SB2:"x1s688f",$$css:!0},count:{koQZXg:"x8x9d4c",kMwMTN:"x1jdz31e",kMv6JI:"xa9opjo",kGuDYH:"xvwhms9",$$css:!0},singleton:{kMwMTN:"x1ar3pfp",kb6lSQ:"x12oo3zp",$$css:!0},mobileHost:{k1xSpc:"x1s85apg xnty2cc",$$css:!0},areaFoot:{k1xSpc:"xrvj5dj",keoZOQ:"xr1yuqi",$$css:!0},areaLabel:{k1xSpc:"x78zum5",k7Eaqz:"xeuugli",kGNEyG:"x6s0dn4",kOIVth:"x17d4w8g",$$css:!0},browse:{k1xSpc:"x1s85apg",kGNEyG:"x6s0dn4",kOIVth:"x1j9xkj6",kAzted:"x1gg8mnh",kmVPX3:"x1astma3",kMzoRj:"xc342km",kWkggS:"xjbqb8w",kMwMTN:"xqvuw85",kkrTdU:"x1ypdohk",kOgw8m:"x168i3sl",kPJHz1:"x784prv",k7shQP:"x9v5kkp",kZs9gx:"xxh1od1",kiEn40:"x1bqaal",$$css:!0},sheetOverlay:{kVAEAm:"xixxii4",kY2c9j:"x6y9o1m",k87sOh:"xz02az6",kCIrl2:"x3m8u43",krVfgx:"x1ey2m1c",kbCHJM:"xu96u03",$$css:!0},sheet:{"--console-text-muted":"x1phc7po",kVAEAm:"xixxii4",kY2c9j:"x1aciyhk",k87sOh:"xz02az6",kCIrl2:"x3m8u43",krVfgx:"x1ey2m1c",kbCHJM:"xu96u03",k1xSpc:"xrvj5dj",k9llMU:"x5o4joa",kmVPX3:"x1717udv",kMzoRj:"xc342km",kI3sdo:"x1a2a7pz",kWkggS:"xdls3ah",k6WDB:"x1jh03n0",kMwMTN:"xqvuw85",$$css:!0},sheetList:{kAzted:"x2lwn1j",kORKVm:"x1odjw0f",kZeWKH:"xish69e",kmVPX3:"x17yoobn",$$css:!0},sheetHead:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x883omv",k1K539:"x1yztbdb",$$css:!0},sheetTitle:{kogj98:"x1ghz6dp",$$css:!0},sheetClose:{k1xSpc:"xrvj5dj",kgQiWS:"x1ku5rj1",kzqmXN:"x6uih76",kZKoxP:"x2e9ysv",kmuXW:"x2lah0s",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"x16rqkct",kWkggS:"xjbqb8w",kMwMTN:"xgi1xjn",kkrTdU:"x1ypdohk",kGuDYH:"x1jvydc1",kDPRdz:"x18m2ztq",kPJHz1:"x784prv",k7shQP:"x9v5kkp",kZs9gx:"xxh1od1",$$css:!0},mobileGroup:{k1K539:"x1yztbdb",k4rD7h:"xr2l1fr",$$css:!0},mobileLink:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x167g77z",kzqmXN:"xh8yej3",kAzted:"x1eguyfn",kmVPX3:"x6jaaxu",kMzoRj:"xc342km",kaIpWk:"xur7f20",kWkggS:"xjbqb8w",kMwMTN:"xgi1xjn",kkrTdU:"x1ypdohk",kMv6JI:"x5ddh9m",kGuDYH:"x1j61zf2",kLWn49:"xggjnk3",k9WMMc:"xdpxx8g",kybGjl:"x1hl2dhg",kGzVvX:"xuvuc2f",kDPRdz:"x18m2ztq",kPJHz1:"x784prv",k7shQP:"x9v5kkp",kZs9gx:"xxh1od1",kiEn40:"x1bqaal",$$css:!0},mobileActive:{kL6WhQ:"x16stqrj",kaIpWk:"xu4hgxq",kWkggS:"x9kxhyz",kMwMTN:"xqvuw85",k63SB2:"xh88oxj",$$css:!0}};function g(e,...t){return`${e} ${r(...t).className??""}`}var Fe=M(R(),1);var ot=new Set(["profile","settings","site-info","siteInfo"]),Ee=[{label:"Structure",presentation:"form",types:["grouping-definitions"]},{label:"Identity",presentation:"form",types:["anchor-profile","brain-character","style-guide"]},{label:"Intelligence",presentation:"document",types:["prompt","prompts","skill","skills","playbook","playbooks","swot","swots"]},{label:"Network",presentation:"form",types:["agent","agents"]}];function Oe(e){if(e.classification==="system")return ot.has(e.entityType)?"Site":"System";return"Content"}function Y(e,t){if(t)return t.id===ye?null:t.section;return e?.classification==="system"?"brain":"library"}function Mt(e){if(e==="\\")return"\\\\";return`\\u${(e.codePointAt(0)??0).toString(16).padStart(4,"0")}`}function X(e){if(e==="")return"(empty)";if(e==="(empty)")return`${Mt("(")}${e.slice(1)}`;return e.replace(/\\|·|[^\S ]|\p{Cc}|\p{Cf}/gu,Mt).replace(/^ +| +$| {2,}/g,(n)=>"·".repeat(n.length))}var je=[{key:"images",label:"Images",path:Et},{key:"documents",label:"Documents",path:(e)=>jt(e)}];function Zn(e){let t=rt.safeParse(Object.fromEntries(new URLSearchParams(e)));return t.success?t.data:rt.parse({})}function Jn(e){let t=new URLSearchParams;if(e.value!==null)t.set("value",e.value);if(e.type)t.set("type",e.type);if(e.q)t.set("q",e.q);if(e.sort!=="updated-desc")t.set("sort",e.sort);if(e.offset)t.set("offset",String(e.offset));if(e.limit!==50)t.set("limit",String(e.limit));let n=t.toString();return n?`?${n}`:""}function Qi(e,t,n){if(!Tt(e))return null;let i=e.studioGroupingPath;if(typeof i!=="string"||!i.startsWith("/")||i.startsWith("//")||i.includes("\\"))return null;let o=new URL(i,"https://studio.invalid"),a=Nt(o.pathname,t);if(a.kind!=="grouping")return null;let s=n.find((b)=>b.key===a.grouping);if(!s)return null;let p=Zn(o.search);return{path:`${o.pathname}${Jn(p)}`,label:p.value===null?s.label:X(p.value),grouping:s.key}}var le={field:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kUk6DE:"x12lumcd",k7Eaqz:"xeuugli",$$css:!0},wide:{ks0D6T:"xxc7z9f",$$css:!0},glyph:{kVAEAm:"x10l6tqk",kLqNvP:"xi5uv41",kzqmXN:"x6jxa94",kZKoxP:"x1v9usgg",kMwMTN:"x1ar3pfp",kfzvcC:"x47corl",$$css:!0},input:{kzqmXN:"xh8yej3",kAzted:"x141feeh x1c4ya5t",kZCmMZ:"xhikr00",kwRFfy:"xpdmqnj",kGuDYH:"x4z9k3i xf2x79s",k9l4BL:"x1hcrkkg",$$css:!0},roomy:{kwRFfy:"xhig867",$$css:!0},clear:{kVAEAm:"x10l6tqk",kt4wiu:"xxx7yvo",k1xSpc:"xrvj5dj",kzqmXN:"xgd8bvy x199zukc",kZKoxP:"x1fgtraw xpj9cei",kAzted:"xe0p6wg x18kkpoz",kmVPX3:"x1717udv",kgQiWS:"x1ku5rj1",kMzoRj:"xc342km",kaIpWk:"x1kogg8i",kWkggS:"xjbqb8w xgvbf8n",kMwMTN:"x1ar3pfp x18m2ztq",kMv6JI:"xa9opjo",kGuDYH:"xif65rj",$$css:!0}};var ue=M(I(),1);function st(e){let t=r(le.field,e.wide===!0&&le.wide);return ue.jsxDEV("div",{className:`${e.hook??""} ${t.className??""}`.trim(),style:t.style,"data-studio-search":"",children:[ue.jsxDEV("svg",{...r(le.glyph),viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[ue.jsxDEV("circle",{cx:"6.8",cy:"6.8",r:"4.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6"},void 0,!1,void 0,this),ue.jsxDEV("line",{x1:"10.2",y1:"10.2",x2:"14",y2:"14",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),ue.jsxDEV(te,{xstyle:[le.input,e.value.length>0&&le.roomy],type:"search","aria-label":e.label,placeholder:e.placeholder,maxLength:200,value:e.value,onChange:(n)=>e.onChange(n.target.value)},void 0,!1,void 0,this),e.value.length>0&&ue.jsxDEV(D,{type:"button",variant:"ghost",xstyle:le.clear,"aria-label":`Clear ${e.label.toLowerCase()}`,onClick:()=>e.onChange(""),children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Le(e,t){return e?t?.[e.id]??0:0}function qe(e){if(e.entityType==="grouping-definitions")return"Groupings";return e.isSingleton&&e.entityType!=="settings"?e.singularLabel:e.label}var ce="group:",Ne="type:",Ie="workspace:";function It(e){if(e.startsWith(ce)){let t=e.slice(ce.length);return t.length>0?{kind:"grouping",id:t}:null}if(e.startsWith(Ne)){let t=e.slice(Ne.length);return t.length>0?{kind:"type",id:t}:null}if(e.startsWith(Ie)){let t=e.slice(Ie.length);return t.length>0?{kind:"workspace",id:t}:null}return null}var lt=["library","publish","brain"];function ze(e,t){let n=e.reduce((i,o)=>i+Le(o,t),0);return n>0?n:void 0}function zt(e,t){if(t==="home")return e.homeWorkspaces.length>0;if(t==="chat")return e.chatWorkspaces.length>0;return lt.includes(t)}function Ct(e){let t=e.types.filter((h)=>h.containedIn===void 0),n=e.types.find((h)=>h.entityType===e.active)?.containedIn??e.active,i=e.workspaces??[],o=(h)=>i.filter((P)=>Y(null,P)===h),a=i.find((h)=>h.id==="studio:overview"),s=i.find((h)=>h.id===qt),p=o("chat").filter((h)=>h!==s),b=o("home").filter((h)=>h!==a),m=o("library"),w=o("publish"),T=o("brain"),k=["Content","Site","System"].map((h)=>({label:h,types:t.filter((P)=>Oe(P)===h)})).filter((h)=>h.types.length>0),y=e.recentTypes??[],j=(h)=>{let P=y.indexOf(h.entityType);return P<0?y.length:P},S=(h)=>h.count>0||h.isSingleton||h.entityType===n,x=t.filter((h)=>Oe(h)==="Content"),u=x.filter(S).map((h,P)=>({info:h,index:P})).sort((h,P)=>j(h.info)-j(P.info)||h.index-P.index).map(({info:h})=>h),v=x.filter((h)=>!S(h)),C=(h)=>h.flatMap((P)=>t.filter((We)=>We.entityType===P&&We.classification==="system")),ge=[...Ee.map((h)=>({label:h.label,types:C([...h.types])})),...k.filter((h)=>h.label==="Site"),{label:"Other",types:t.filter((h)=>Oe(h)==="System"&&!Ee.some((P)=>P.types.some((We)=>We===h.entityType)))}].filter((h)=>h.types.length>0),A=i.find((h)=>h.id===e.activeWorkspace),re=e.groupings?.active?"library":A?Y(null,A):Y(t.find((h)=>h.entityType===n)??null,null),Me=e.groupings?.active?`${ce}${e.groupings.active}`:e.activeWorkspace??n,se=e.workspaceBadges,Te=(h,P)=>P===void 0?h:{...h,badge:P},Kn=[Te({id:"home",label:"Home",available:a!==void 0||b.length>0},ze([a,...b],se)),Te({id:"library",label:"Library",available:u.length>0||v.length>0||m.length>0||(e.groupings?.items.length??0)>0},ze(m,se)),Te({id:"publish",label:"Publish",available:w.length>0},ze(w,se)),Te({id:"chat",label:"Chat",available:s!==void 0||p.length>0},ze([s,...p],se)),Te({id:"brain",label:"Brain",available:ge.length>0||T.length>0},ze(T,se))];return{types:t,active:n,overviewWorkspace:a,chatWorkspace:s,homeWorkspaces:b,chatWorkspaces:p,libraryTypes:u,emptyLibraryTypes:v,libraryWorkspaces:m,publishWorkspaces:w,brainTypeGroups:ge,brainWorkspaces:T,currentArea:re,destination:Me,sections:Kn}}var N=M(I(),1),_n={home:"M3 11l9-7 9 7 M5 10v10h14V10 M10 20v-6h4v6",library:"M12 5v16 M12 5C9 3 5 3 2 4v15c3-1 7-1 10 2 3-3 7-3 10-2V4c-3-1-7-1-10 1z",publish:"M12 3v12 M7 8l5-5 5 5 M4 15v5h16v-5",chat:"M5 4h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H9l-5 3v-3a2 2 0 0 1-2-2V6a2 2 0 0 1 3-2z",brain:"M9 4a3 3 0 0 0-3 3 3 3 0 0 0-2 5 3 3 0 0 0 2 5 3 3 0 0 0 6 1V5a3 3 0 0 0-3-1z M15 4a3 3 0 0 1 3 3 3 3 0 0 1 2 5 3 3 0 0 1-2 5 3 3 0 0 1-6 1"};function ut({area:e}){return N.jsxDEV("svg",{"aria-hidden":"true",focusable:"false",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:N.jsxDEV("path",{d:_n[e]},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function Ce(e){return N.jsxDEV("li",{children:N.jsxDEV("a",{href:e.href,className:g(e.active?"studio-leaf-link active":"studio-leaf-link",q.leafLink,e.active&&q.leafActive),"aria-current":e.active?"page":void 0,onClick:(t)=>{if(!ie(t))return;t.preventDefault(),e.onSelect()},children:[e.label,e.count!==void 0&&N.jsxDEV("span",{className:g(e.attention?"count count--attention":"count",q.count),children:e.count},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function He(e){return N.jsxDEV("section",{className:g("studio-leaf-group",q.leafGroup),children:[e.label?N.jsxDEV("div",{className:g("studio-leaf-label",q.leafLabel,Re.eyebrow),children:e.label},void 0,!1,void 0,this):null,N.jsxDEV("ul",{className:g("",q.list),children:e.children},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function At(e){let t=$t(),n=e.focus===!0&&!e.tree.browsing,i=t||n,o=e.model,{sections:a}=o,{activeArea:s,leafOpen:p,leafId:b,selectArea:m,endBrowsing:w}=e.tree,T=()=>{if(e.focus===!0&&!t){if(e.tree.browsing)w();else if(s)m(s);return}Ve(!i)},k=ae(),y=(u)=>N.jsxDEV(He,{label:u.label,children:u.types.map((v)=>N.jsxDEV(Ce,{label:qe(v),active:v.entityType===e.active,href:Ae(k,v.entityType),onSelect:()=>e.onSelect(v.entityType),count:v.isSingleton?void 0:v.count},v.entityType,!1,void 0,this))},u.label,!1,void 0,this),j=(u)=>{let v=e.workspaceBadges?.[u.id]??0;return N.jsxDEV(Ce,{label:u.label,active:u.id===e.activeWorkspace,href:Xe(k,u.id),onSelect:()=>e.onSelectWorkspace?.(u.id),count:v>0?v:void 0,attention:!0},u.id,!1,void 0,this)},S=(u,v)=>v.length>0?N.jsxDEV(He,{label:u,children:v.map(j)},u??"pages",!1,void 0,this):null,x=(u)=>{switch(u){case"home":return S(void 0,o.homeWorkspaces);case"library":return N.jsxDEV(N.Fragment,{children:[o.libraryTypes.length>0?y({types:o.libraryTypes}):null,o.emptyLibraryTypes.length>0?N.jsxDEV("details",{className:g("",q.allTypes),children:[N.jsxDEV("summary",{className:g("",q.leafLabel,q.allTypesSummary),children:"All types"},void 0,!1,void 0,this),N.jsxDEV("ul",{className:g("",q.list),children:o.emptyLibraryTypes.map((v)=>N.jsxDEV(Ce,{label:qe(v),active:!1,href:Ae(k,v.entityType),onSelect:()=>e.onSelect(v.entityType)},v.entityType,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null,(e.groupings?.items.length??0)>0?N.jsxDEV(He,{label:"Groups",children:(e.groupings?.items??[]).map((v)=>N.jsxDEV(Ce,{label:v.label,active:v.key===e.groupings?.active,href:Be(k,v.key),onSelect:()=>e.groupings?.onSelect(v.key)},v.key,!1,void 0,this))},void 0,!1,void 0,this):null,e.media?N.jsxDEV(He,{label:"Media",children:je.map((v)=>N.jsxDEV(Ce,{label:v.label,active:e.media?.active===v.key,href:v.path(k),onSelect:()=>e.media?.onSelect(v.key)},v.key,!1,void 0,this))},void 0,!1,void 0,this):null,S("Pages",o.libraryWorkspaces)]},void 0,!0,void 0,this);case"publish":return S(void 0,o.publishWorkspaces);case"brain":return N.jsxDEV(N.Fragment,{children:[o.brainTypeGroups.map(y),S("Pages",o.brainWorkspaces)]},void 0,!0,void 0,this);case"chat":return S(void 0,o.chatWorkspaces)}};return N.jsxDEV("nav",{className:g("types studio-navigation",q.navigation,i&&q.navigationCollapsed),"data-leaf-open":p,"data-collapsed":i,"aria-label":"Studio navigation",children:[N.jsxDEV("div",{className:g("studio-area-title",q.areaTitle,Re.eyebrow,i&&q.collapsedTitle),children:N.jsxDEV("button",{type:"button",className:g("studio-navigation-collapse",q.collapseButton),"aria-label":i?"Expand navigation":"Collapse navigation",title:i?"Expand navigation":"Collapse navigation","aria-expanded":!i,"aria-controls":p&&!i?b:void 0,onClick:T,children:i?"⇥":"⇤"},void 0,!1,void 0,this)},void 0,!1,void 0,this),N.jsxDEV("div",{className:g("studio-leaf-scroll",q.leafScroll),children:a.filter((u)=>u.available).map((u)=>{let v=u.id===s,C=v&&p&&!i;return N.jsxDEV("section",{"aria-label":u.label,className:g("studio-area",q.section),children:[N.jsxDEV("button",{className:g(v?"studio-area-link active":"studio-area-link",q.areaLink,v&&q.areaActive,i&&q.collapsedLink),type:"button","aria-label":u.label,title:i?u.label:void 0,"aria-pressed":v,"aria-description":(u.badge??0)>0?`${u.badge} need attention`:void 0,"aria-controls":C?b:void 0,"aria-expanded":lt.includes(u.id)?C:void 0,onClick:()=>m(u.id),children:[N.jsxDEV("b",{className:g("",q.ordinal,v&&q.ordinalActive),children:N.jsxDEV(ut,{area:u.id},void 0,!1,void 0,this)},void 0,!1,void 0,this),N.jsxDEV("span",{"data-area-label":u.label,className:g("",q.areaLabel,i&&q.collapsedLabel),children:[u.label,(u.badge??0)>0?N.jsxDEV("small",{className:g("",q.count),children:u.badge},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),C?N.jsxDEV("div",{id:b,className:g("studio-leaf-rail",q.leaf),"aria-label":`${u.label} destinations`,role:"group",children:x(u.id)},void 0,!1,void 0,this):null]},u.id,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Dt(e,t){return e.flatMap((n)=>{let[i]=n.options;if(!i)return[];return[{area:n.area,label:n.label,main:i,options:n.options,active:n.options.some((o)=>o.value===t),attention:n.options.reduce((o,a)=>o+(a.attention??0),0)}]})}var Qe=M(R(),1);var V=M(I(),1);function Vt(e){let[t,n]=Qe.useState(null),i=Qe.useRef(null),o=(a)=>{n(null),e.onSelect(a.value)};return V.jsxDEV(V.Fragment,{children:[V.jsxDEV("nav",{...r(F.bar),"aria-label":"Studio sections","data-studio-tab-bar":"",children:e.tabs.map((a)=>V.jsxDEV("a",{href:a.main.href,...r(F.tab,a.active&&F.active),"aria-current":a.active?"page":void 0,"aria-haspopup":a.active&&a.options.length>1?"dialog":void 0,"aria-label":a.attention>0?`${a.label}, ${a.attention} need you`:a.label,"data-studio-tab":a.area,onClick:(s)=>{if(!ie(s))return;if(s.preventDefault(),a.active&&a.options.length>1){i.current=s.currentTarget,n(a);return}o(a.main)},children:[V.jsxDEV("span",{...r(F.icon),children:V.jsxDEV(ut,{area:a.area},void 0,!1,void 0,this)},void 0,!1,void 0,this),a.label,a.attention>0&&V.jsxDEV("span",{...r(F.light),"aria-hidden":"true"},void 0,!1,void 0,this)]},a.area,!0,void 0,this))},void 0,!1,void 0,this),V.jsxDEV(Wt,{open:t!==null,onOpenChange:(a)=>{if(!a)n(null)},children:V.jsxDEV(Pt,{className:"studio-tab-sheet","aria-describedby":void 0,onCloseAutoFocus:(a)=>{a.preventDefault(),i.current?.focus()},children:[V.jsxDEV(Gt,{children:t?.label},void 0,!1,void 0,this),V.jsxDEV("ul",{...r(F.sheetList),children:t?.options.map((a)=>{let s=a.value===e.activeValue;return V.jsxDEV("li",{children:V.jsxDEV("a",{href:a.href,...r(F.option,s&&F.optionActive),"aria-current":s?"page":void 0,"aria-label":a.accessibleLabel,"data-studio-tab-option":a.value,onClick:(p)=>{if(!ie(p))return;p.preventDefault(),o(a)},children:[a.label,(a.attention??0)>0?V.jsxDEV("span",{...r(F.optionCount,F.optionAttention),children:[a.attention," need you"]},void 0,!0,void 0,this):a.tally!==void 0?V.jsxDEV("span",{...r(F.optionCount),children:a.tally},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},a.value,!1,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var De=M(I(),1),ct="page:";function Ot(e){let{overviewWorkspace:t,chatWorkspace:n,homeWorkspaces:i,chatWorkspaces:o,libraryTypes:a,emptyLibraryTypes:s,libraryWorkspaces:p,publishWorkspaces:b,brainTypeGroups:m,brainWorkspaces:w}=e.model,T=ae(),k=(u)=>({value:`${Ne}${u.entityType}`,href:Ae(T,u.entityType),label:qe(u),...u.isSingleton?{}:{tally:u.count}}),y=(u)=>{let v=Le(u,e.workspaceBadges);return{value:`${Ie}${u.id}`,href:Xe(T,u.id),label:u.label,accessibleLabel:u.label,...v>0?{attention:v}:{}}},j=[{area:"home",label:"Home",options:[...t?[y(t)]:[],...i.map(y)]},{area:"library",label:"Library",options:[...a.map(k),...(e.groupings?.items??[]).map((u)=>({value:`${ce}${u.key}`,href:Be(T,u.key),label:u.label})),...e.media?je.map((u)=>({value:`${ct}${u.key}`,href:u.path(T),label:u.label})):[],...p.map(y),...s.map(k)]},{area:"publish",label:"Publish",options:b.map(y)},{area:"chat",label:"Chat",options:[...n?[y(n)]:[],...o.map(y)]},{area:"brain",label:"Brain",options:[...m.flatMap((u)=>u.types.map(k)),...w.map(y)]}].filter((u)=>u.options.length>0),S=e.media?.active?`${ct}${e.media.active}`:e.groupings?.active?`${ce}${e.groupings.active}`:e.active?`${Ne}${e.active}`:e.activeWorkspace?`${Ie}${e.activeWorkspace}`:"",x=(u)=>{let v=je.find((ge)=>u===`${ct}${ge.key}`);if(v){e.media?.onSelect(v.key);return}let C=It(u);if(C?.kind==="grouping"){e.groupings?.onSelect(C.id);return}if(C?.kind==="type"){e.onSelect(C.id);return}if(C?.kind==="workspace"&&C.id!==e.activeWorkspace)e.onSelectWorkspace?.(C.id)};if(e.hidden)return De.jsxDEV(De.Fragment,{},void 0,!1,void 0,this);return De.jsxDEV(Vt,{tabs:Dt(j,S),activeValue:S,onSelect:x},void 0,!1,void 0,this)}var fe=M(R(),1);function Rt(e){let{currentArea:t,destination:n,activeWorkspace:i,areaWorkspaces:o}=e,[a,s]=fe.useState(null),[p,b]=fe.useState(n);if(n!==p)b(n),s(null);let m=a??t,w=fe.useId(),T=(S)=>{let x=o.find((u)=>u&&Y(null,u)===S);if(x){if(x.id===i)s(null);else e.onSelectWorkspace?.(x.id);return}Ve(!1),s(S)},[k,y]=fe.useState(t?{[t]:!0}:{}),j=(S,x)=>{y((u)=>u[S]===x?u:{...u,[S]:x})};return{activeArea:m,leafOpen:m!==null&&e.hasList(m),browsing:a!==null,endBrowsing:()=>s(null),leafId:w,selectArea:T,openGroups:k,toggleGroup:j}}function dt(){try{let e=JSON.parse(window.localStorage.getItem("studio.recent-types")??"[]");return Array.isArray(e)?e.filter((t)=>typeof t==="string"):[]}catch{return[]}}function Lt(e){let t=[e,...dt().filter((n)=>n!==e)].slice(0,8);try{window.localStorage.setItem("studio.recent-types",JSON.stringify(t))}catch{}}var be=M(I(),1);function Ht(e,t){if(!t||ot.has(e))return"form";return Ee.find((n)=>n.types.some((i)=>i===e))?.presentation??"split"}function Bt(e){let[t]=Fe.useState(dt);Fe.useEffect(()=>{if(e.active)Lt(e.active)},[e.active]);let n=Ct({...e,recentTypes:t}),i=Rt({currentArea:n.currentArea,destination:n.destination,activeWorkspace:e.activeWorkspace,areaWorkspaces:[n.overviewWorkspace,n.chatWorkspace],hasList:(o)=>zt(n,o),onSelectWorkspace:e.onSelectWorkspace});return be.jsxDEV(be.Fragment,{children:[e.renderMode!=="desktop"?be.jsxDEV(Ot,{types:n.types,active:n.active,onSelect:e.onSelect,groupings:e.groupings,media:e.media,activeWorkspace:e.activeWorkspace,workspaceBadges:e.workspaceBadges,onSelectWorkspace:e.onSelectWorkspace,hidden:e.focus===!0,model:n,tree:i},void 0,!1,void 0,this):null,e.renderMode!=="mobile"?be.jsxDEV(At,{model:n,tree:i,focus:e.focus,active:n.active,onSelect:e.onSelect,groupings:e.groupings,media:e.media,activeWorkspace:e.activeWorkspace,workspaceBadges:e.workspaceBadges,onSelectWorkspace:e.onSelectWorkspace},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)}var pn=M(R(),1);var Ra="studio:open-palette";function kt(){window.dispatchEvent(new Event("studio:open-palette"))}var ei="studio:open-ask";function Xt(){window.dispatchEvent(new Event(ei))}var Qt=M(R(),1),xt=!1,pt=new Set;function Ha(e){if(e===xt)return;xt=e;for(let t of pt)t()}function ti(e){return pt.add(e),()=>pt.delete(e)}function Ft(){return Qt.useSyncExternalStore(ti,()=>xt,()=>!1)}var gt=M(R(),1),mt="console.climate";function Kt(){let e=null;try{e=window.localStorage}catch{}return{storage:e,root:document.documentElement,systemDark:()=>window.matchMedia("(prefers-color-scheme: dark)").matches}}function ni(e=Kt()){let t=null;try{t=e.storage?.getItem(mt)??null}catch{}return t==="paper"||t==="instrument"?t:"system"}function Ke(e,t=Kt()){try{if(e==="system")t.storage?.removeItem(mt);else t.storage?.setItem(mt,e)}catch{}let n=e==="system"?t.systemDark()?"instrument":"paper":e;t.root.setAttribute("data-climate",n),t.root.setAttribute("data-theme",n==="paper"?"light":"dark")}function Ut(e){let t=document.defaultView?.MutationObserver;if(!t)return()=>{};let n=new t(e);return n.observe(document.documentElement,{attributes:!0,attributeFilter:["data-climate"]}),()=>n.disconnect()}function Yt(){return gt.useSyncExternalStore(Ut,()=>ni(),()=>"system")}function Zt(){return gt.useSyncExternalStore(Ut,()=>document.documentElement.getAttribute("data-climate")==="instrument"?"instrument":"paper",()=>"paper")}var f={skip:{kVAEAm:"xixxii4",kY2c9j:"x11uqc5h",k87sOh:"xfr5jun",kbCHJM:"x1qpfodn",kAzted:"x1gg8mnh",kmVPX3:"x1ff1495",kWkggS:"x18s3upu",kMwMTN:"xqvuw85",kMzoRj:"xdh2fpr",ksu8eU:"x1y0btm7",kVAM5u:"xawfzfr",kmkexE:"xq2gx43",k3aq6I:"x1bee3ir x1wfrlr2",$$css:!0},header:{kVAEAm:"x1n2onr6 x71uzt7",k87sOh:"x1bfa1r9",kY2c9j:"xf5e64p",k1xSpc:"xrvj5dj x1ux6vrq",kwnvtZ:"x1a02dak",kUk6DE:"x3psx0u",kumcoG:"xp2jwox x1twgeho xhr0jsp",kGNEyG:"x6s0dn4",k1C7PZ:"x18hwk67 x1u4temk",khm7nJ:"x3pnbk8",kAzted:"x1wzw5q2 xlohplz",kmVPX3:"x168p7lp x15j6q5g xux5zyz",kt9PQ7:"x1qhh985 xwd3hym",kfdmCh:"x1q0q8m5",kL6WhQ:"xpqg30t",kWkggS:"x1dd94t5",$$css:!0},brand:{k1xSpc:"x78zum5",kSGwAc:"xkh2ocl xp6pnuw",k7Eaqz:"xeuugli x17yga0g",kAzted:"x1gg8mnh",kGNEyG:"x6s0dn4",kjj79g:"x1nhvcw1 xdlhuee",kOIVth:"x883omv",kg3NbH:"x12j899k xkc6btg xn3s92p",kWqL5O:"xs1s249 x1w3mbok",kSWEuD:"x32b0ac",k26BEO:"xe636ye",kWkggS:"xbslqsl x16qhwdp",kMwMTN:"xqvuw85",kybGjl:"x1hl2dhg",khDVqt:"xuxw1ft",kMeerF:"x784prv",k3XXqK:"x9v5kkp",kjBf7l:"xxh1od1",kInvED:"x7s97pk",$$css:!0},brainName:{k1xSpc:"x1lliihq x1dky1ju xzd29fr",k7Eaqz:"xeuugli",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",kMv6JI:"xssy22x",kGuDYH:"x19d36u7 x1r5g0cu",ka26j:"x1umjory",k63SB2:"xlpn31b",kb6lSQ:"x1ixy4ik",$$css:!0},brainAccent:{kMwMTN:"x1q7454x",kKX8nH:"x1k4tb9n",ka26j:"x62unnn",k63SB2:"x184j2wm",$$css:!0},phoneGone:{k1xSpc:"xkaaz9w",$$css:!0},brandGone:{k1xSpc:"x78zum5 xkaaz9w",$$css:!0},barFromStart:{kjj79g:"xa996tt",kGNEyG:"xp7j7s0",kOIVth:"xzzyo3b",$$css:!0},back:{k1xSpc:"x1s85apg x1h5fwb6",kgQiWS:"x1ku5rj1",kmuXW:"x2lah0s",kzqmXN:"x187nhsf",kZKoxP:"xn3w4p2",keTefX:"x18xomjl",kmVPX3:"x1717udv",kMzoRj:"xc342km",kWkggS:"xjbqb8w",kMwMTN:"x1q7454x",kGuDYH:"xneq65o",kLWn49:"xo5v014",kkrTdU:"x1ypdohk",$$css:!0},pageTitle:{k1xSpc:"x1s85apg xfsj286",k7Eaqz:"xeuugli",kogj98:"x1ghz6dp",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",kMv6JI:"xssy22x",kGuDYH:"xosj86m",ka26j:"xucjisz",k63SB2:"xmvyi9x",kMwMTN:"xqvuw85",$$css:!0},phoneAction:{k1xSpc:"x1s85apg x1ux6vrq",kayTVb:"x10tba2y",kmuXW:"x2lah0s",kGNEyG:"x6s0dn4",kOIVth:"x1jnr06f",k7Eaqz:"xeuugli",$$css:!0},mark:{k1xSpc:"xrvj5dj",kUk6DE:"x3psx0u",kzqmXN:"x1849jeq",kZKoxP:"x1gnnpzl",kgQiWS:"x1ku5rj1",kMzoRj:"xvndefy",ksu8eU:"x1y0btm7",kVAM5u:"xawfzfr",kaIpWk:"x16rqkct",kMwMTN:"x1q7454x",kMv6JI:"xssy22x",kGuDYH:"xif65rj",k63SB2:"x1s688f",$$css:!0},location:{k1xSpc:"x78zum5",kUk6DE:"x168tng7",k7Eaqz:"xeuugli",kGNEyG:"x6s0dn4",kOIVth:"xmmi0ta",kGOSNy:"x1l3568u",$$css:!0},crumbs:{k1xSpc:"x78zum5",k7Eaqz:"xeuugli",kGNEyG:"x1pha0wt",kOIVth:"x17d4w8g",kVQacm:"xb3r6kr",khDVqt:"xuxw1ft",$$css:!0},crumbsGone:{k1xSpc:"x78zum5 xkaaz9w",$$css:!0},crumbItem:{k1xSpc:"x3nfvp2",k7Eaqz:"xeuugli",kGNEyG:"x1pha0wt",kOIVth:"x17d4w8g",kmuXW:"x2lah0s x1sb3ws4",$$css:!0},crumbSeparator:{kMwMTN:"x1v3krkk",kGuDYH:"x4z9k3i",$$css:!0},crumb:{kMwMTN:"x1ar3pfp",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",k63SB2:"xk50ysn",kHdLCk:"xkaaz9w",$$css:!0},crumbLink:{kmVPX3:"x1717udv",kMzoRj:"xc342km",kWkggS:"xjbqb8w",kkrTdU:"x1ypdohk",kMwMTN:"x1ar3pfp x1xiaf3t",kMeerF:"x784prv",k3XXqK:"x9v5kkp",kjBf7l:"xxh1od1",kInvED:"x7s97pk",$$css:!0},crumbCurrent:{k7Eaqz:"xeuugli",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",kMwMTN:"xqvuw85",kMv6JI:"xssy22x",kGuDYH:"xwsyq91 x1szwvsd",ka26j:"xucjisz",k63SB2:"xmvyi9x",$$css:!0},lineBreak:{k1xSpc:"x1s85apg xfsj286",kayTVb:"x14yy4lh",kCS8Yb:"x1l7klhg",kZKoxP:"xqtp20y",$$css:!0},capsule:{k1xSpc:"x78zum5",kayTVb:"x1iqbltf",kUk6DE:"x168tng7",k7Eaqz:"xeuugli",kZKoxP:"xn3w4p2",kGNEyG:"x6s0dn4",kOIVth:"x1jnr06f",kg3NbH:"x14oi46j",kaIpWk:"x1e6avla",kWkggS:"x18s3upu",kGVxlE:"x1oyyjme",$$css:!0},search:{k1xSpc:"x78zum5",kUk6DE:"x12lumcd",k7Eaqz:"xeuugli",kZKoxP:"x1vqgdyp",kGNEyG:"x6s0dn4",kOIVth:"x883omv",kg3NbH:"x1dry65w",kMzoRj:"xc342km",kaIpWk:"x1e6avla",kWkggS:"xjbqb8w",kMwMTN:"x1ar3pfp x18m2ztq",kkrTdU:"x1ypdohk",kMv6JI:"x5ddh9m",kGuDYH:"xif65rj",k9WMMc:"x1yc453h",kMeerF:"x784prv",k3XXqK:"x9v5kkp",kjBf7l:"xxh1od1",kInvED:"x7s97pk",$$css:!0},searchHint:{kUk6DE:"x12lumcd",k7Eaqz:"xeuugli",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",$$css:!0},ask:{kUk6DE:"x3psx0u",kAzted:"x21xpn4",kmVPX3:"x1csxjeb",kMzoRj:"xc342km",kaIpWk:"x1e6avla",kWkggS:"xc788m6",kMwMTN:"xb8ja0n",kkrTdU:"x1ypdohk",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",k63SB2:"x1s688f",kMeerF:"x784prv",k3XXqK:"x9v5kkp",kjBf7l:"xxh1od1",kInvED:"x7s97pk",$$css:!0},key:{k1xSpc:"x1rg5ohu xzd29fr",kmVPX3:"x12ox6j3",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"x1sxf85j",kMwMTN:"xgi1xjn",kMv6JI:"xa9opjo",kGuDYH:"x1k6wstc",$$css:!0},tools:{k1xSpc:"x78zum5 xisjrt3",kGNEyG:"x6s0dn4",kjj79g:"x13a6bvl",kOIVth:"x167g77z xfb96bw",$$css:!0},climate:{k1xSpc:"x3nfvp2 xkaaz9w",kOIVth:"x195vfkc",kmVPX3:"x9ms5i6",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"x1e6avla",$$css:!0},climateOption:{k1xSpc:"xrvj5dj",kzqmXN:"x1691je0",kZKoxP:"x1gnnpzl",kgQiWS:"x1ku5rj1",kmVPX3:"x1717udv",kMzoRj:"xc342km",kaIpWk:"x1e6avla",kWkggS:"xjbqb8w",kMwMTN:"xgi1xjn x18m2ztq",kkrTdU:"x1ypdohk",kMeerF:"x784prv",k3XXqK:"x9v5kkp",kjBf7l:"xxh1od1",kInvED:"x7s97pk",$$css:!0},climateOn:{kWkggS:"x18s3upu",kGVxlE:"xmmh7sb",kMwMTN:"xqvuw85",$$css:!0},identity:{k1xSpc:"xrvj5dj",kUk6DE:"x3psx0u",kayTVb:"x1nuf2lx",kzqmXN:"x187nhsf",kZKoxP:"xn3w4p2",kgQiWS:"x1ku5rj1",kmVPX3:"x1717udv",kMzoRj:"xc342km",kaIpWk:"x16rqkct",kWkggS:"xjbqb8w",kkrTdU:"x1ypdohk",kMeerF:"x784prv",k3XXqK:"x9v5kkp",kjBf7l:"xxh1od1",kInvED:"x7s97pk",$$css:!0},identityBadge:{k1xSpc:"xrvj5dj",kzqmXN:"x1691je0 x9swi1t",kZKoxP:"x90ne7k xhty0c3",kgQiWS:"x1ku5rj1",kaIpWk:"x16rqkct",kWkggS:"x11orspz",kMwMTN:"xb8ja0n",kMv6JI:"xssy22x",kGuDYH:"xif65rj",k63SB2:"xmvyi9x",kGVxlE:"x1gnnqk1 x1dhj52s",$$css:!0},identityCurrent:{kGVxlE:"xgc96el",$$css:!0},menu:{kzqmXN:"xdzyupr x1drzd2p",ks0D6T:"x1usz39j",$$css:!0},who:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1v2ro7d",kmVPX3:"x1s8cm8o",$$css:!0},whoBadge:{k1xSpc:"xrvj5dj",kUk6DE:"x3psx0u",kzqmXN:"x187nhsf",kZKoxP:"xn3w4p2",kgQiWS:"x1ku5rj1",kaIpWk:"x16rqkct",kWkggS:"x11orspz",kMwMTN:"xb8ja0n",kMv6JI:"xssy22x",kGuDYH:"x19d36u7",k63SB2:"xmvyi9x",$$css:!0},whoText:{k1xSpc:"xrvj5dj",k7Eaqz:"xeuugli",kOIVth:"x195vfkc",$$css:!0},name:{k1xSpc:"x1lliihq",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",kMwMTN:"xqvuw85",kMv6JI:"xssy22x",kGuDYH:"x19d36u7",ka26j:"xw8howw",k63SB2:"xmvyi9x",kb6lSQ:"x12oo3zp",kP9fke:"x6mezaz",$$css:!0},role:{k1xSpc:"x1lliihq",kVQacm:"xb3r6kr",kg5iWk:"xlyipyv",khDVqt:"xuxw1ft",kMwMTN:"x1ar3pfp",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",k63SB2:"xo1l8bm",kb6lSQ:"x12oo3zp",kP9fke:"x6mezaz",$$css:!0},arrow:{koQZXg:"x8x9d4c",kMwMTN:"xgi1xjn",$$css:!0},newTab:{kGuDYH:"xfifm61",$$css:!0},appearance:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x167g77z",kAzted:"x1wxaq2x",kg3NbH:"x1kw6p96",kMwMTN:"xgi1xjn",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",$$css:!0},appearanceLabel:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x167g77z",$$css:!0},appearanceChoices:{k1xSpc:"x3nfvp2",koQZXg:"x8x9d4c",kOIVth:"x195vfkc",kmVPX3:"x9ms5i6",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"x1e6avla",$$css:!0},appearanceChoice:{k1xSpc:"xrvj5dj",kAzted:"xe0p6wg x19tnhmq",kgQiWS:"x1ku5rj1",kg3NbH:"x1awh872",kaIpWk:"x1e6avla",kMwMTN:"xgi1xjn",kkrTdU:"x1ypdohk",kGuDYH:"xfifm61",k3XXqK:"x1t137rt",kfSwDN:"x87ps6o",kWkggS:"xjbqb8w xs1gn80",$$css:!0},appearanceOn:{kWkggS:"x1dd94t5",kGVxlE:"xmmh7sb",kMwMTN:"xqvuw85",$$css:!0},icon:{kUk6DE:"x3psx0u",kzqmXN:"x1se2ifz",kZKoxP:"x1ta3ar0",kDwRjp:"xbh8q5q",kjVXCG:"x73je2i",kfJifR:"x190q0s9",kU5bRw:"x1owpc8m",kJdQPc:"x1f6yumg",$$css:!0}};function Jt(e,t){return[...e,t].map((n)=>n?.trim()??"").filter((n,i,o)=>n!==""&&n!==o[i-1]).join(" — ")}var ii=604800000,_t="studio.draft.",en=oe.object({draft:oe.record(oe.string(),oe.unknown()),body:oe.string(),baseContentHash:oe.string().optional(),savedAt:oe.number()});function Ua(e,t){return`${_t}${e}.${t}`}function Ya(e,t,n){let{secretFields:i,...o}=n,a={...o,draft:Object.fromEntries(Object.entries(o.draft).filter(([s])=>!i.includes(s)))};e.setItem(t,JSON.stringify(en.parse(a)))}function Za(e,t,n){let i=e.getItem(t);if(i===null)return null;let o=en.safeParse(ai(i));if(!o.success||n-o.data.savedAt>ii)return e.removeItem(t),null;return o.data}function Ja(e,t){e.removeItem(t)}function tn(e,t){let n=`${_t}${t}.`;Array.from({length:e.length},(i,o)=>e.key(o)).filter((i)=>i?.startsWith(n)===!0).forEach((i)=>e.removeItem(i))}function ai(e){try{return JSON.parse(e)}catch{return}}var l=M(I(),1);function oi(e){try{tn(window.localStorage,e)}catch{}}function de(e,t){if(typeof document>"u")return t;return document.querySelector("[data-studio-root]")?.getAttribute(e)??t}function nn(e){return e.trim().slice(0,1).toUpperCase()}function ri(e){return e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:e}function an(e){window.location.assign(e)}function on(e){window.open(e,"_blank","noopener")}var si=[{value:"paper",label:"Light"},{value:"system",label:"Auto"},{value:"instrument",label:"Dark"}];function li(e){let t=e.name.trim(),n=t.lastIndexOf(" ");if(n<=0)return l.jsxDEV(l.Fragment,{children:t},void 0,!1,void 0,this);return l.jsxDEV(l.Fragment,{children:[t.slice(0,n)," ",l.jsxDEV("em",{className:g("",f.brainAccent),children:t.slice(n+1)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function ke(e){return l.jsxDEV("svg",{className:g("",f.icon),viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:e.children},void 0,!1,void 0,this)}var rn=()=>l.jsxDEV(ke,{children:[l.jsxDEV("circle",{cx:"11",cy:"11",r:"7"},void 0,!1,void 0,this),l.jsxDEV("path",{d:"m20 20-3.5-3.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),ui=()=>l.jsxDEV(ke,{children:[l.jsxDEV("circle",{cx:"12",cy:"12",r:"4"},void 0,!1,void 0,this),l.jsxDEV("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),sn=()=>l.jsxDEV(ke,{children:l.jsxDEV("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),ci=()=>l.jsxDEV(ke,{children:[l.jsxDEV("circle",{cx:"12",cy:"8",r:"4"},void 0,!1,void 0,this),l.jsxDEV("path",{d:"M4 21a8 8 0 0 1 16 0"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),di=()=>l.jsxDEV(ke,{children:[l.jsxDEV("circle",{cx:"12",cy:"12",r:"9"},void 0,!1,void 0,this),l.jsxDEV("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),ki=()=>l.jsxDEV(ke,{children:l.jsxDEV("path",{d:"M4 19V9M10 19V5M16 19v-7M22 19H2"},void 0,!1,void 0,this)},void 0,!1,void 0,this),xi=()=>l.jsxDEV(ke,{children:l.jsxDEV("path",{d:"M15 4h4v16h-4M10 8l-4 4 4 4M6 12h11"},void 0,!1,void 0,this)},void 0,!1,void 0,this);function go(e){let t=ae(),n=de("data-studio-brand-name","Brain"),i=de("data-studio-principal-name","Your account"),o=de("data-studio-principal-role","trusted"),a=Jt([e.pageTitle,e.contextLabel],n);pn.useEffect(()=>{document.title=a},[a]);let s=de("data-studio-principal-id",""),p=de("data-studio-session-href",`/logout?return_to=${encodeURIComponent(t)}`),b=de("data-studio-site-href",""),m=de("data-studio-dashboard-href","/dashboard"),w=kn(t,ye),T=e.navigation?Y(e.navigation.types.find((A)=>A.entityType===e.navigation?.activeEntityType)??null,e.navigation.workspaces.find((A)=>A.id===e.navigation?.activeWorkspaceId)??null):null,k=e.navigation?.activeWorkspaceId===ye,y=xn(),j=Ft(),S=e.canAsk??j,x=Zt(),u=Yt(),v=T&&e.navigation?.activeEntityType?`${T.charAt(0).toUpperCase()}${T.slice(1)}`:"",C=[v&&v!==e.contextLabel?v:null,e.contextLabel,e.pageTitle&&e.pageTitle!==e.contextLabel?e.pageTitle:null].filter((A)=>Boolean(A)),ge=C.length-1;return l.jsxDEV("header",{className:g("studio-chrome",f.header),"aria-label":"Studio",children:[e.navigation&&l.jsxDEV(D,{type:"button",xstyle:f.skip,variant:"outline",className:"studio-skip-content",onClick:()=>{let A=document.querySelector('[data-studio-shell] main, [data-studio-shell] [role="main"]');if(A)A.tabIndex=-1,A.focus()},children:"Skip to content"},void 0,!1,void 0,this),l.jsxDEV("a",{className:g("studio-chrome-brand",f.brand,y?.back!==void 0&&f.brandGone),href:t,"aria-label":`${n} Studio`,children:[l.jsxDEV("span",{className:g("studio-chrome-mark",f.mark),"aria-hidden":"true",children:n.slice(0,1).toUpperCase()},void 0,!1,void 0,this),l.jsxDEV("span",{className:g("studio-chrome-brain",f.brainName),children:l.jsxDEV(li,{name:n},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e.navigation?l.jsxDEV("div",{className:g("studio-chrome-mobile-navigation",q.mobileHost),children:l.jsxDEV(Bt,{renderMode:"mobile",groupings:e.navigation.groupings,media:e.navigation.media,types:e.navigation.types,active:e.navigation.activeEntityType,onSelect:e.navigation.selectEntityType,workspaces:e.navigation.workspaces,activeWorkspace:e.navigation.activeWorkspaceId,workspaceBadges:e.navigation.workspaceBadges,onSelectWorkspace:e.navigation.selectWorkspace,focus:e.navigation.editing===!0},void 0,!1,void 0,this)},void 0,!1,void 0,this):null,l.jsxDEV("div",{className:g("studio-chrome-location",f.location,y?.back!==void 0&&f.barFromStart),"data-studio-phone-bar":"",children:[y?.back&&l.jsxDEV("button",{type:"button",className:g("studio-chrome-back",f.back),"aria-label":`Back to ${y.back.label}`,onClick:y.back.onBack,children:l.jsxDEV("span",{"aria-hidden":"true",children:"‹"},void 0,!1,void 0,this)},void 0,!1,void 0,this),y?.title&&l.jsxDEV("h1",{className:g("studio-chrome-page",f.pageTitle),children:y.title},void 0,!1,void 0,this),l.jsxDEV("nav",{className:g("studio-chrome-location-text",f.crumbs,y?.title!==void 0&&f.crumbsGone),"aria-label":"You are here",children:C.map((A,re)=>{let Me=re===ge,se=e.onContextClick!==void 0&&A===e.contextLabel&&!Me;return l.jsxDEV("span",{className:g("",f.crumbItem),children:[re>0&&l.jsxDEV("span",{className:g("",f.crumbSeparator),"aria-hidden":"true",children:"›"},void 0,!1,void 0,this),se?l.jsxDEV("button",{type:"button",className:g("",f.crumb,f.crumbLink),"data-studio-crumb":"",onClick:e.onContextClick,children:A},void 0,!1,void 0,this):l.jsxDEV("span",{className:g("",Me?f.crumbCurrent:f.crumb),"data-studio-crumb":"","aria-current":Me?"page":void 0,children:A},void 0,!1,void 0,this)]},`${re}:${A}`,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("span",{className:g("",f.lineBreak),"aria-hidden":"true"},void 0,!1,void 0,this),l.jsxDEV("div",{className:g("studio-chrome-capsule",f.capsule),children:[l.jsxDEV("button",{className:g("command-chip studio-chrome-command",f.search),type:"button","aria-label":"Search or run a command","aria-keyshortcuts":"Control+k Meta+k","data-studio-search":"",onClick:kt,children:[l.jsxDEV(rn,{},void 0,!1,void 0,this),l.jsxDEV("span",{className:g("",f.searchHint),children:S?"Search, open, or ask":"Search or open"},void 0,!1,void 0,this),l.jsxDEV("kbd",{className:g("",f.key),children:"⌘K"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),S&&l.jsxDEV("button",{type:"button",className:g("studio-chrome-ask",f.ask),"data-studio-ask":"",onClick:Xt,children:"Ask"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:g("studio-chrome-tools",f.tools),children:[y?.action&&l.jsxDEV("div",{className:g("studio-chrome-phone-action",f.phoneAction),"data-studio-phone-action":"","data-operator-action-popover":"",children:y.action},void 0,!1,void 0,this),l.jsxDEV("div",{className:g("studio-chrome-climate",f.climate),role:"group","aria-label":"Light and dark",children:[l.jsxDEV("button",{type:"button",className:g("",f.climateOption,x==="paper"&&f.climateOn),"aria-label":"Light","aria-pressed":x==="paper",title:"Light",onClick:()=>Ke("paper"),children:l.jsxDEV(ui,{},void 0,!1,void 0,this)},void 0,!1,void 0,this),l.jsxDEV("button",{type:"button",className:g("",f.climateOption,x==="instrument"&&f.climateOn),"aria-label":"Dark","aria-pressed":x==="instrument",title:"Dark",onClick:()=>Ke("instrument"),children:l.jsxDEV(sn,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(ln,{children:[l.jsxDEV(un,{asChild:!0,children:l.jsxDEV("button",{className:g("studio-chrome-identity",f.identity),type:"button","aria-label":`${i} account menu`,"aria-current":k?"page":void 0,children:l.jsxDEV("span",{className:g("",f.identityBadge,k&&f.identityCurrent),children:nn(i)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),l.jsxDEV(cn,{className:g("studio-chrome-identity-menu",f.menu),align:"end",sideOffset:8,collisionPadding:8,children:[l.jsxDEV(dn,{className:g("studio-chrome-identity-label",f.who),children:[l.jsxDEV("span",{className:g("",f.whoBadge),"aria-hidden":"true",children:nn(i)},void 0,!1,void 0,this),l.jsxDEV("span",{className:g("",f.whoText),children:[l.jsxDEV("strong",{className:g("",f.name),children:i},void 0,!1,void 0,this),l.jsxDEV("span",{className:g("",f.role),children:[ri(o)," · ",n]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(Ue,{},void 0,!1,void 0,this),l.jsxDEV(he,{onSelect:()=>{if(e.navigation){if(!k)e.navigation.selectWorkspace(ye)}else an(w)},children:[l.jsxDEV(ci,{},void 0,!1,void 0,this),"Your account",l.jsxDEV("span",{className:g("",f.arrow),"aria-hidden":"true",children:"→"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(he,{onSelect:kt,children:[l.jsxDEV(rn,{},void 0,!1,void 0,this),"Search and commands",l.jsxDEV("kbd",{className:g("",f.arrow,f.key),children:"⌘K"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV("div",{className:g("",f.appearance),children:[l.jsxDEV("span",{className:g("",f.appearanceLabel),children:[l.jsxDEV(sn,{},void 0,!1,void 0,this),"Appearance"]},void 0,!0,void 0,this),l.jsxDEV(yt.RadioGroup,{className:g("",f.appearanceChoices),value:u,onValueChange:(A)=>{if(A==="paper"||A==="instrument"||A==="system")Ke(A)},"aria-label":"Appearance",children:si.map((A)=>l.jsxDEV(yt.RadioItem,{value:A.value,className:g("",f.appearanceChoice,u===A.value&&f.appearanceOn),onSelect:(re)=>re.preventDefault(),children:A.label},A.value,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(Ue,{},void 0,!1,void 0,this),b&&l.jsxDEV(he,{onSelect:()=>on(b),children:[l.jsxDEV(di,{},void 0,!1,void 0,this),"Public site",l.jsxDEV("span",{className:g("",f.arrow,f.newTab),children:"new tab ↗"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(he,{onSelect:()=>on(m),children:[l.jsxDEV(ki,{},void 0,!1,void 0,this),"Public dashboard",l.jsxDEV("span",{className:g("",f.arrow,f.newTab),children:"new tab ↗"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l.jsxDEV(Ue,{},void 0,!1,void 0,this),l.jsxDEV(he,{variant:"destructive",onSelect:()=>{if(s)oi(s);an(p)},children:[l.jsxDEV(xi,{},void 0,!1,void 0,this),"Sign out"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var c={field:{k1xSpc:"x1lliihq",kmVPX3:"xvethbn",kEafiO:"x178xt8z",kPef9Z:"x13fuv20",kLZC3w:"xltl5i9",kGO01o:"x1l90r2v xwr7mz2",k3VDzK:"x12xhqv2",kh9fTk:"xaoxr2g xokao6x",kQ2hZB:"x1nopeu7",knQIc7:"xgxr4er",kEsNXn:"x1hzjcfh",$$css:!0},label:{k1xSpc:"x78zum5",kjj79g:"x1qughib",kGNEyG:"x1pha0wt",kGuDYH:"xfifm61",k63SB2:"xk50ysn",kb6lSQ:"x16q24ku",kMwMTN:"xgi1xjn",k1K539:"xwoyzhm",$$css:!0},required:{kMv6JI:"xa9opjo",kKX8nH:"x1j61x8r",kGuDYH:"x1k6wstc",kMwMTN:"x1q7454x",$$css:!0},kind:{kMv6JI:"xa9opjo",kKX8nH:"x1j61x8r",kGuDYH:"x1k6wstc",kMwMTN:"x1jdz31e",k63SB2:"xo1l8bm",$$css:!0},inline:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kjj79g:"x1qughib",kOIVth:"x883omv",$$css:!0},inlineLabel:{k1K539:"xat24cr",$$css:!0},control:{kVAM5u:"xck444f",kGVxlE:"xxkzt7h",kr4CYY:"xf2x79s",$$css:!0},date:{kMv6JI:"xa9opjo",kQNsl9:"x19aimcq xbzer8s",$$css:!0},fact:{k7Eaqz:"xeuugli",kHjlTd:"xj0a0fe",$$css:!0},readOnly:{kMv6JI:"xa9opjo",ksu8eU:"xbsl7fq",kWkggS:"xlu1wsh",kkrTdU:"x1h6gzvc",kSiTet:"x1667htg x1gmafxx",$$css:!0},imageRef:{k1xSpc:"x78zum5",kGNEyG:"x1qjc9v5",kOIVth:"x167g77z",kogj98:"x1q6ys4k",$$css:!0},imageCode:{k1xSpc:"x78zum5",k7Eaqz:"xeuugli",kUk6DE:"x98rzlu",kGNEyG:"x6s0dn4",kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",kWkggS:"x18s3upu",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kmVPX3:"x1asu97y",kaIpWk:"x12oqio5",kHjlTd:"xj0a0fe",$$css:!0},clear:{kMv6JI:"x5ddh9m",kGuDYH:"xfifm61",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h xt5ozwv",kWkggS:"xjbqb8w",kMwMTN:"xgi1xjn xz2iokx",kaIpWk:"x1sxf85j",kmVPX3:"x1x7i2cb",kkrTdU:"x1ypdohk",$$css:!0},upload:{k1xSpc:"xrvj5dj",kAPf3g:"x1o2pa38",kmVPX3:"x1n79iv5",kMzoRj:"xvndefy",ksu8eU:"xbsl7fq",kVAM5u:"x1vw2y1n x8bwlc1 x5nc5hl",kaIpWk:"xhpnuu7",kWkggS:"xom8tl7 x1b36lsf x1lfl0h9",kkrTdU:"x1ypdohk",k9WMMc:"x2b8uid",k1ekBW:"xq90yva x4wkmsb",kIyJzY:"xx6bhzk",kAMwcw:"xwji4o3",$$css:!0},glyph:{kMwMTN:"x1es3s4s",kVVagm:"x1e7j1t8",ka26j:"x1gtap3s",$$css:!0},uploadTitle:{keoZOQ:"x1xmf6yo",kMwMTN:"xqvuw85",kGuDYH:"x4z9k3i",k63SB2:"xk50ysn",$$css:!0},uploadNote:{keoZOQ:"x7r5mf7",kMwMTN:"x1ar3pfp",kVVagm:"xmjulw5",$$css:!0},file:{kVAEAm:"x10l6tqk",kzqmXN:"x1i1rx1s",kZKoxP:"xjm9jq1",kVQacm:"xb3r6kr",kz4h6p:"x1hyvwdk",$$css:!0},tags:{k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kOIVth:"x17d4w8g",$$css:!0},tag:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"x1nejdyq",kAzted:"xe0p6wg",kmVPX3:"xwxl2sp",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"x1e6avla",kWkggS:"x18s3upu",kMwMTN:"xgi1xjn",kGuDYH:"xfifm61",k7Eaqz:"xeuugli",kHjlTd:"xj0a0fe",$$css:!0},tagButton:{k1xSpc:"xrvj5dj",kzqmXN:"xw4jnvo",kZKoxP:"x1qx5ct2",kAzted:"xisnujt",kgQiWS:"x1ku5rj1",kMzoRj:"xc342km",kaIpWk:"x16rqkct",kWkggS:"xjbqb8w xuvuc2f x7gom6s",kMwMTN:"x1ar3pfp xz2iokx xi7w4f5",kkrTdU:"x1ypdohk",kVVagm:"x1ae94xz",koRygp:"xzy26m8",kya2p2:"x1fkvin3",kDjvIb:"xr6d2im",kTvGMo:"x756nxt",$$css:!0},literalInput:{kzqmXN:"x1o0uqad x1boxzuo",$$css:!0},listHelp:{kMwMTN:"x1ar3pfp",kGuDYH:"xfifm61",kLWn49:"x1evy7pa",kHjlTd:"xj0a0fe",$$css:!0},tagAdd:{kE3dHu:"xyndbda",$$css:!0},tagInput:{kzqmXN:"x14atkfc",k7Eaqz:"x12tqqkd xwlmubu",k8WAf4:"xt970qd",kg3NbH:"xnjsko4",kMzoRj:"xc342km",kWkggS:"xjbqb8w",kMwMTN:"xqvuw85",kGuDYH:"xfifm61 xf2x79s",kGVxlE:"x1gnnqk1",k8Qsv1:"x1wku8z5",$$css:!0},assist:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x167g77z",kmVPX3:"xri99sx",$$css:!0},suggestion:{k1xSpc:"x78zum5",kwnvtZ:"x1a02dak",kGNEyG:"x6s0dn4",kOIVth:"x17d4w8g",kogj98:"xjgi5au",kmVPX3:"xskserf",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"xmt0h0j",kaIpWk:"xu4hgxq",kWkggS:"x9kxhyz",$$css:!0},suggestionCopy:{kUk6DE:"xy3jww0",kGuDYH:"xfifm61",kLWn49:"xfrs9s4",kMwMTN:"xqvuw85",$$css:!0},suggestionTags:{k1xSpc:"x78zum5",kUk6DE:"xy3jww0",kwnvtZ:"x1a02dak",kOIVth:"x1nejdyq",$$css:!0},suggestionToken:{kMv6JI:"xa9opjo",kGuDYH:"x1k6wstc",kmVPX3:"x18juh3m",kaIpWk:"x12oqio5",kWkggS:"x18s3upu",kMwMTN:"xqvuw85",$$css:!0}};var ve=M(R(),1);var Ye={checkbox:{kzqmXN:"x1xp8n7a",kZKoxP:"xmix8c7",kmuXW:"x2lah0s",keaTxX:"x1q9s9ta",$$css:!0},marker:{k1xSpc:"x1rg5ohu",keTefX:"x13fj5qh",kmVPX3:"x1987f1p",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"xawfzfr",kMwMTN:"x1q7454x",kMv6JI:"xa9opjo",kGuDYH:"x1k6wstc",k63SB2:"xo1l8bm",khDVqt:"xuxw1ft",$$css:!0},section:{kEafiO:"x178xt8z",kPef9Z:"x13fuv20",kLZC3w:"xltl5i9",kmVPX3:"x1t7086c",k7Eaqz:"xeuugli",$$css:!0},head:{k1xSpc:"x78zum5",kjj79g:"x1qughib",kGNEyG:"x1pha0wt",kOIVth:"xou54vl",$$css:!0},title:{kMv6JI:"xssy22x",kGuDYH:"x1i1m3gp",kogj98:"x1ghz6dp",k63SB2:"xk50ysn",$$css:!0}};var K={count:{kMv6JI:"xa9opjo",kGuDYH:"x1k6wstc",kZCmMZ:"x25sj25",$$css:!0},frame:{kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"xur7f20",kmVPX3:"xskserf",kWkggS:"xbslqsl",k7Eaqz:"xeuugli",$$css:!0},select:{kUk6DE:"x1iojvbi",kzqmXN:"x14atkfc",k7Eaqz:"x1i9suas",ks0D6T:"x193iq5w",kAzted:"x21xpn4",kGuDYH:"xfifm61 xf2x79s",$$css:!0},slot:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"x1jnr06f",kUk6DE:"x1en5fvg",k7Eaqz:"xeuugli",ks0D6T:"x193iq5w",$$css:!0},input:{kUk6DE:"x98rzlu",k7Eaqz:"x450l9j",kzqmXN:"xja02kk",$$css:!0},helpText:{kMwMTN:"xgi1xjn",$$css:!0},help:{k1xSpc:"x78zum5",kjj79g:"x1qughib",kGNEyG:"x1pha0wt",kwnvtZ:"x1a02dak",kOIVth:"x167g77z",$$css:!0},suggestions:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kwnvtZ:"x1a02dak",kOIVth:"x167g77z",keoZOQ:"x1k70j0n",$$css:!0}};var xe={status:{kMwMTN:"xgi1xjn",kGuDYH:"x4z9k3i",kHjlTd:"xj0a0fe",$$css:!0},error:{k1xSpc:"x78zum5",kGNEyG:"x1pha0wt",kOIVth:"x1j9xkj6",kMwMTN:"x1mel2pz",kgeoSG:"xjsvk3w",kQcDng:"x69dl0f",k7yrt4:"xcj0i9h",$$css:!0},good:{kMwMTN:"x19k5i5u",$$css:!0},saveStatus:{kMv6JI:"xa9opjo",kGuDYH:"x1qt5hsa",koQZXg:"xcmxlu1",kHdLCk:"x5dg28r",keaIxW:"xhmgfki",kEh2j3:"x703316",kOqvnJ:"xmi8g4k",kN0ZIM:"x14b9exp",kr4CYY:"x155ir8z",katwyW:"x1qp586l",$$css:!0},saveError:{kMwMTN:"xj8651r",$$css:!0},validationSummary:{k7Eaqz:"xeuugli",ks0D6T:"x193iq5w",kHjlTd:"xj0a0fe",$$css:!0},validationDetails:{kskxy:"x1js9hbl",kORKVm:"x1odjw0f",kZeWKH:"xish69e",$$css:!0},saveGood:{kMwMTN:"xic3461",$$css:!0},conflict:{kVAEAm:"x10l6tqk",kCIrl2:"xn5hqff",krVfgx:"xgcxmh",kzqmXN:"xk0hezx",ks0D6T:"x197vjsw",kUOVxO:"xrxpjvj",kmVPX3:"x1gqud3g",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x1rrq9tc",kaIpWk:"xur7f20",kWkggS:"xy32unz",kGVxlE:"x1hc8we6",kHjlTd:"xj0a0fe",$$css:!0},conflictTitle:{k1K539:"x12nagc",kMwMTN:"xqvuw85",kVVagm:"x1bcsevs",ka26j:"x1nqv8xj",$$css:!0},conflictCopy:{k1K539:"xyorhqc",kMwMTN:"xgi1xjn",kGuDYH:"xfifm61",$$css:!0},reload:{kAzted:"x1rz828m x1c4ya5t",kmVPX3:"xk61eof",kGuDYH:"x1j6dyjg",$$css:!0},wrap:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",k7Eaqz:"xeuugli",kwnvtZ:"x1a02dak",kOIVth:"x167g77z",kqGvvJ:"x1jp4ehj",$$css:!0},stations:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kwnvtZ:"x1a02dak",kOIVth:"x167g77z",$$css:!0},station:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"xmmi0ta",kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",kb6lSQ:"x1dgsrnt",kMwMTN:"x1ar3pfp xwj15ni",khDVqt:"xuxw1ft",$$css:!0},done:{kMwMTN:"xqvuw85 x1xvnxvj",$$css:!0},active:{kMwMTN:"xqvuw85 x1xvnxvj",$$css:!0},dot:{kzqmXN:"x1wc42o8",kZKoxP:"xegnrdp",kaIpWk:"x16rqkct",kMzoRj:"xvndefy",ksu8eU:"x1y0btm7",kVAM5u:"x1vw2y1n xcdqty3",k1ekBW:"x11vqxbs x4wkmsb",kIyJzY:"x13dflua",kAMwcw:"xwji4o3",$$css:!0},doneDot:{kWkggS:"x1wztykf",kVAM5u:"x5a8oox xcdqty3",kGVxlE:"x7yya20",$$css:!0},activeDot:{kWkggS:"xnrmrls",kVAM5u:"x11qqpng xcdqty3",kKVMdj:"x1cs8pv1 x1aquc0h",k44tkh:"x1m9vv7p",kyAemX:"x4hg4is",ko0y90:"xa4qsjk",$$css:!0},noGit:{kKX8nH:"x1k4tb9n",$$css:!0},track:{kZKoxP:"xjm9jq1",kzqmXN:"x1691je0 xxydkhx",kWkggS:"x3ee1ji x10zscow",kogj98:"xmtjor9",kVAEAm:"x1n2onr6",kVQacm:"xb3r6kr",k1xSpc:"x1rg5ohu xkaaz9w",$$css:!0},flow:{kVAEAm:"x10l6tqk",kpwlN0:"x10a8y8t",kKwaWg:"x295toi",k3aq6I:"x5i6ehr",$$css:!0},flowing:{kKVMdj:"x1xftmv1 x1aquc0h",k44tkh:"xegkacw",kyAemX:"x4hg4is",ko0y90:"xa4qsjk",$$css:!0},ref:{kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",kMwMTN:"x1ar3pfp xwj15ni",khDVqt:"xuxw1ft",$$css:!0},refValue:{kMwMTN:"xqvuw85 x1xvnxvj",k63SB2:"xk50ysn",$$css:!0}};var mn=M(I(),1);function Z(e){let t=e.inline?"span":"p";return mn.jsxDEV(t,{"data-studio-status":e.tone??"neutral",role:e.tone==="error"?"alert":void 0,className:O(e.className??"",xe.status,e.tone==="error"&&xe.error,e.tone==="good"&&xe.good,e.save&&xe.saveStatus,e.save&&e.tone==="error"&&xe.saveError,e.save&&e.tone==="good"&&xe.saveGood),children:e.children},void 0,!1,void 0,this)}var z=M(I(),1);function gn(e){let t=ve.useId(),n=ve.useId(),i=ve.useId(),[o,a]=ve.useState(""),{multiple:s,values:p}=e.definition,b=p!==void 0,m=e.value===void 0||Array.isArray(e.value)&&e.value.every((x)=>typeof x==="string"),w=Array.isArray(e.value)?e.value.filter((x)=>typeof x==="string"):[],T=[...new Set(e.suggestions??[])].filter((x)=>!w.includes(x)),k=!s&&w.length>0,y={"aria-invalid":e.errorId?!0:void 0,"aria-describedby":[b?void 0:n,e.errorId].filter(Boolean).join(" ")||void 0},j=(x)=>{if(e.readOnly||!m)return;if(!s)e.onChange([x]);else if(!w.includes(x))e.onChange([...w,x]);a("")},S=()=>{if(o.length>0)j(o)};return z.jsxDEV("div",{...r(c.field),"data-studio-field":"grouping-membership",children:[z.jsxDEV("div",{id:i,...r(e.purpose==="allowed-values"?c.file:c.label),children:[z.jsxDEV("span",{children:e.label},void 0,!1,void 0,this),e.purpose!=="allowed-values"&&z.jsxDEV("em",{...r(c.kind),children:s?"several":"one"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!m?z.jsxDEV(Z,{tone:"error",children:"This field is not a list of text values. Repair its source before changing memberships."},void 0,!1,void 0,this):z.jsxDEV(z.Fragment,{children:[z.jsxDEV("div",{...r(K.frame),role:"group","aria-labelledby":i,...y,children:z.jsxDEV("div",{...r(c.tags),children:[w.map((x,u)=>z.jsxDEV("span",{...r(c.tag),"data-grouping-member":"",children:[z.jsxDEV("span",{children:X(x)},void 0,!1,void 0,this),e.counts&&z.jsxDEV("span",{...r(K.count),"aria-label":e.counts.has(x)?`${e.counts.get(x)} entries`:"Usage unavailable",children:e.counts.get(x)??"—"},void 0,!1,void 0,this),p&&!p.includes(x)&&z.jsxDEV("span",{...r(Ye.marker),children:"not in list"},void 0,!1,void 0,this),!e.readOnly&&z.jsxDEV(D,{type:"button",variant:"ghost",size:"icon-xs",xstyle:c.tagButton,"aria-label":`Remove ${X(x)}`,onClick:()=>e.onChange(w.filter((v,C)=>C!==u)),children:"×"},void 0,!1,void 0,this)]},`${u}:${x}`,!0,void 0,this)),!e.readOnly&&(p?z.jsxDEV(J,{id:t,"aria-label":`${k?"Replace":"Add"} ${e.label} value`,...y,xstyle:[c.control,K.select],value:"",onChange:(x)=>{if(x.currentTarget.value==="")return;let u=p[Number(x.currentTarget.value)];if(u!==void 0)j(u)},children:[z.jsxDEV("option",{value:"",disabled:!0,children:p.every((x)=>w.includes(x))?"No other listed values":k?"Replace value…":"Choose value…"},void 0,!1,void 0,this),p.map((x,u)=>w.includes(x)?null:z.jsxDEV("option",{value:String(u),children:X(x)},x,!1,void 0,this))]},void 0,!0,void 0,this):z.jsxDEV("span",{...r(K.slot),children:[z.jsxDEV(te,{id:t,type:"text","aria-label":`${k?"Replace":"Add"} ${e.label} value`,...y,xstyle:[c.tagInput,c.literalInput,K.input],value:o,placeholder:k?"Replace value…":"Add a value…",onChange:(x)=>a(x.currentTarget.value),onKeyDown:(x)=>{if(x.nativeEvent.isComposing||x.key!=="Enter")return;x.preventDefault(),S()}},void 0,!1,void 0,this),z.jsxDEV(D,{type:"button",size:"sm",variant:"ghost","aria-label":k?"Replace value":"Add value",disabled:o.length===0,onClick:S,children:k?"Replace":"Add"},void 0,!1,void 0,this)]},void 0,!0,void 0,this))]},void 0,!0,void 0,this)},void 0,!1,void 0,this),!b&&!e.readOnly&&z.jsxDEV(z.Fragment,{children:[z.jsxDEV("div",{...r(K.help),children:[z.jsxDEV("span",{id:n,...r(c.listHelp,K.helpText),children:[s?"Enter adds one exact value.":"A new value replaces the current choice."," ","Commas and spaces are literal.",(o!==o.trim()||w.some((x)=>x!==x.trim()))&&z.jsxDEV("strong",{children:[" ","Surrounding whitespace is preserved and creates a different group."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),e.assist]},void 0,!0,void 0,this),T.length>0&&z.jsxDEV("div",{...r(K.suggestions),children:[z.jsxDEV("span",{...r(c.kind),children:"From your entries"},void 0,!1,void 0,this),T.map((x)=>z.jsxDEV(D,{type:"button",size:"xs",variant:"outline","aria-label":`Choose ${X(x)}`,onClick:()=>j(x),children:X(x)},x,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var ft=M(I(),1);function yn({value:e,vocabulary:t}){return ft.jsxDEV("span",{children:[X(e),t?.values&&!t.values.includes(e)&&ft.jsxDEV("span",{...r(Ye.marker),children:"not in list"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var pe={root:{k7Eaqz:"xeuugli",$$css:!0},collectionIntro:{kogj98:"x1r2gm6t",kMwMTN:"xgi1xjn",kGuDYH:"xif65rj",kLWn49:"x11m8ghp",ks0D6T:"x15g8yj6",$$css:!0},grid:{k1xSpc:"xrvj5dj",kumcoG:"xcjjqqt",kOIVth:"x1wszfx9 xqdxl5a",kjdo94:"xirox3h",$$css:!0},wide:{kBCFzs:"x1osaytk",k7Eaqz:"xeuugli",$$css:!0},onlyField:{kBCFzs:"xk8na9e",$$css:!0},link:{kMwMTN:"xqvuw85",kcSHmL:"xda060z",$$css:!0},section:{kEafiO:"x178xt8z",kPef9Z:"x13fuv20",kLZC3w:"xltl5i9",keoZOQ:"xjv05ge",kLKAdn:"x1p5oq8j",k7Eaqz:"xeuugli",$$css:!0},heading:{kGuDYH:"xif65rj",k63SB2:"x19s9jnd",keoZOQ:"xdj266r",k1K539:"xieb3on",kMwMTN:"xqvuw85",$$css:!0},intro:{kMwMTN:"xgi1xjn",kGuDYH:"xif65rj",kLWn49:"x11m8ghp",ks0D6T:"x15g8yj6",kogj98:"x108hnsc",kKwWVI:"xbfn22o",$$css:!0},bodyHeading:{kmVPX3:"xhlzbb6",kRugJJ:"x1pmdsly",$$css:!0},description:{kMwMTN:"xgi1xjn",kGuDYH:"x4z9k3i",kLWn49:"x11m8ghp",keoZOQ:"x1xmf6yo",k1K539:"x1c436fg",ks0D6T:"x15g8yj6",$$css:!0},profile:{kogj98:"x1ghz6dp",k7Eaqz:"xeuugli",$$css:!0},row:{k1xSpc:"xrvj5dj",kumcoG:"x1yzlmg0",kOIVth:"x16stusp",k8WAf4:"xhyosrm",kEafiO:"x178xt8z",kPef9Z:"x13fuv20",kLZC3w:"xltl5i9",k1JLwA:"x4jmfmw",$$css:!0},term:{kGuDYH:"xfifm61",k63SB2:"x19s9jnd",kMwMTN:"xgi1xjn",kHjlTd:"xj0a0fe",$$css:!0},value:{kogj98:"x1ghz6dp",k7Eaqz:"xeuugli",khDVqt:"x126k92a",kHjlTd:"xj0a0fe",kGuDYH:"xif65rj",kLWn49:"x11m8ghp",$$css:!0},list:{kogj98:"x1ghz6dp",kZCmMZ:"x106a9eq",$$css:!0}};var L=M(I(),1);function Se({value:e,fields:t,literalStrings:n,vocabulary:i}){if(n&&typeof e==="string")return L.jsxDEV(yn,{value:e,vocabulary:i},void 0,!1,void 0,this);if(e===void 0||e===null||e==="")return L.jsxDEV("span",{children:"Not set"},void 0,!1,void 0,this);if(Array.isArray(e))return e.length?L.jsxDEV("ul",{...r(pe.list),children:e.map((o,a)=>L.jsxDEV("li",{children:L.jsxDEV(Se,{value:o,fields:t,literalStrings:n,vocabulary:i},void 0,!1,void 0,this)},a,!1,void 0,this))},void 0,!1,void 0,this):L.jsxDEV("span",{children:"None"},void 0,!1,void 0,this);if(fn(e))return L.jsxDEV("dl",{...r(pe.profile),children:Object.entries(e).map(([o,a])=>L.jsxDEV("div",{...r(pe.row),children:[L.jsxDEV("dt",{...r(pe.term),children:t?.find((s)=>s.name===o)?.label??o},void 0,!1,void 0,this),L.jsxDEV("dd",{...r(pe.value),children:L.jsxDEV(Se,{value:a,fields:t?.find((s)=>s.name===o)?.fields},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},o,!0,void 0,this))},void 0,!1,void 0,this);if(typeof e==="string"&&/^https?:\/\//.test(e))return L.jsxDEV("a",{href:e,...r(pe.link),children:e},void 0,!1,void 0,this);return L.jsxDEV("span",{children:typeof e==="boolean"?e?"Yes":"No":String(e)},void 0,!1,void 0,this)}var vn=M(R(),1);var G=M(I(),1);function Sn(e){if(!Array.isArray(e))return[];return e.flatMap((t)=>{if(typeof t!=="object"||t===null)return[];let n=Reflect.get(t,"name")??Reflect.get(t,"displayName"),i=Reflect.get(t,"id");return[{name:typeof n==="string"&&n.length>0?n:"Someone",...typeof i==="string"?{id:i}:{}}]})}function bn(e){return`user:${e.id}`}function wn(e){let t=Sn(e.value);if(t.length===0)return null;return G.jsxDEV("div",{...r(c.field),"data-studio-field":"people",children:[G.jsxDEV("div",{...r(c.label),children:G.jsxDEV("span",{children:e.label},void 0,!1,void 0,this)},void 0,!1,void 0,this),G.jsxDEV("div",{...r(c.tags),children:t.map((n,i)=>G.jsxDEV("span",{...r(c.tag),children:n.name},`${i}:${n.name}`,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function pi(e){let t=vn.useId(),n=Sn(e.value),i=new Set(n.flatMap((a)=>a.id??[])),o=e.members.filter((a)=>!i.has(bn(a)));return G.jsxDEV("div",{...r(c.field),"data-studio-field":"members",children:[G.jsxDEV("div",{id:t,...r(c.label),children:G.jsxDEV("span",{children:e.label},void 0,!1,void 0,this)},void 0,!1,void 0,this),G.jsxDEV("div",{...r(K.frame),role:"group","aria-labelledby":t,children:G.jsxDEV("div",{...r(c.tags),children:[n.map((a,s)=>G.jsxDEV("span",{...r(c.tag),children:[G.jsxDEV("span",{children:a.name},void 0,!1,void 0,this),!e.readOnly&&G.jsxDEV(D,{type:"button",variant:"ghost",size:"icon-xs",xstyle:c.tagButton,"aria-label":`Remove ${a.name}`,onClick:()=>e.onChange(n.filter((p,b)=>b!==s)),children:"×"},void 0,!1,void 0,this)]},`${s}:${a.name}`,!0,void 0,this)),!e.readOnly&&o.length>0&&G.jsxDEV(J,{"aria-label":`Add to ${e.label}`,xstyle:[c.control,K.select],value:"",onChange:(a)=>{let s=o.find(({id:p})=>p===a.currentTarget.value);if(s)e.onChange([...n,{name:s.name,id:bn(s)}])},children:[G.jsxDEV("option",{value:"",children:"Add a member"},void 0,!1,void 0,this),o.map((a)=>G.jsxDEV("option",{value:a.id,children:a.name},a.id,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function mi(){let e=we(),{data:t}=hn({queryKey:["studio","members"],queryFn:()=>e.fetchMembers(),staleTime:60000});return t??[]}function $n(e){return G.jsxDEV(pi,{...e,members:mi()},void 0,!1,void 0,this)}var $e=M(I(),1),gi=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})/;function bt(e){let t=gi.exec(e);return t?`${t[1]} ${t[2]} UTC`:void 0}function yi(e,t){if(typeof t==="string"){if(t.length===0)return;let n=bt(t);if(n)return n;return e==="origin"?t.charAt(0).toUpperCase()+t.slice(1):t}if(typeof t==="number"||typeof t==="boolean")return String(t);if(typeof t==="object"&&t!==null){let n=Reflect.get(t,"entityType"),i=Reflect.get(t,"entityId");if(typeof n==="string"&&typeof i==="string")return`${n} · ${i}`;let o=Reflect.get(t,"start"),a=Reflect.get(t,"end");if(typeof o==="string"&&typeof a==="string")return`${bt(o)??o} → ${bt(a)??a}`}return}function Mn(e){let t=yi(e.name,e.value),n=t===void 0&&fi(e.value)?e.value:void 0;if(t===void 0&&n===void 0)return null;return $e.jsxDEV("div",{...r(c.field),"data-studio-field":"provenance",children:[$e.jsxDEV("div",{...r(c.label),children:$e.jsxDEV("span",{children:e.label},void 0,!1,void 0,this)},void 0,!1,void 0,this),t!==void 0?$e.jsxDEV("span",{...r(c.fact),children:t},void 0,!1,void 0,this):$e.jsxDEV(Se,{value:n},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function fi(e){if(Array.isArray(e))return e.length>0;return typeof e==="object"&&e!==null&&Object.values(e).some((t)=>t!==void 0&&t!==null)}var B=M(R(),1);function Uo(e,t){return e.runWorkspaceAction(t.workspaceId,{actionId:t.action.actionId,input:t.action.input,...t.action.invocation?.mode==="prepare"?{mode:"prepare"}:t.action.invocation?.mode==="execute"?{mode:"execute",confirmationToken:t.action.invocation.token}:{}})}function Tn(e,t){return e.uploadFile(t)}var Ze={".pdf":"application/pdf",".epub":"application/epub+zip"},Yo=[...Object.values(Ze),...Object.keys(Ze)].join(",");async function Zo(e,t){let n=Ze[t.name.slice(t.name.lastIndexOf(".")).toLowerCase()],i=t.type===""?n:t.type;if(i===void 0||!Object.values(Ze).includes(i))throw Error("Documents takes PDF and EPUB files.");return e.uploadFile(i===t.type?t:new File([t],t.name,{type:i}))}function Jo(e,t){return e.deleteEntity(t.entityType,t.id)}function _o(e,t){let n=t.body===void 0?{}:{body:t.body};if(t.kind==="create")return e.createEntity({entityType:t.entityType,...t.idPath&&{idPath:t.idPath},frontmatter:t.frontmatter,...n});return e.updateEntity({entityType:t.entityType,id:t.id,frontmatter:t.frontmatter,baseContentHash:t.baseContentHash,...n})}var H={all:()=>["studio"],navigation:()=>["studio","navigation"],destination:(e)=>["studio","destination",e],workspaceScope:(e)=>["studio","workspace",e],workspace:(e,t={})=>["studio","workspace",e,t],agentTargets:(e,t)=>["studio","agent-targets",e,t],syncStatus:()=>["studio","sync-status"],schema:(e)=>["studio","schema",e],entityLists:()=>["studio","entities"],entities:(e)=>["studio","entities",e],entityPage:(e,t)=>["studio","entities",e,t],entity:(e,t)=>["studio","entity",e,t]};function ir(e,t){return{queryKey:H.destination(t),queryFn:({signal:n})=>{if(!t)throw Error("No creation destination selected");return e.previewDestination(t,n)},enabled:t!==null,retry:!1}}function ar(e){return{queryKey:H.navigation(),queryFn:()=>e.fetchNavigation()}}function or(e,t,n={}){return{queryKey:H.workspace(t,n),queryFn:()=>e.fetchWorkspace(t,n),placeholderData:En,staleTime:15000}}async function rr(e,t){await Promise.all([e.invalidateQueries({queryKey:H.workspaceScope(t)}),e.invalidateQueries({queryKey:H.navigation()})])}async function jn(e){await Promise.all([e.invalidateQueries({queryKey:H.entities("image")}),e.invalidateQueries({queryKey:H.entities("document")}),e.invalidateQueries({queryKey:H.navigation()}),e.invalidateQueries({queryKey:H.syncStatus()})])}function sr(e,t,n){return{queryKey:H.agentTargets(t,n),queryFn:()=>e.fetchAgentTargets(t,n)}}function lr(e){return{queryKey:H.syncStatus(),queryFn:()=>e.fetchSyncStatus()}}function ur(e,t){return{queryKey:H.schema(t),queryFn:()=>e.fetchSchema(t),staleTime:Number.POSITIVE_INFINITY}}function cr(e,t,n=me.parse({})){let i=me.parse(n);return{queryKey:H.entityPage(t,i),queryFn:()=>e.fetchEntities(t,i)}}function dr(e,t,n){return{queryKey:H.entity(t,n),queryFn:()=>e.fetchEntity(t,n),staleTime:Number.POSITIVE_INFINITY}}var ne=M(R(),1);var U={details:{k1xSpc:"xrvj5dj",kumcoG:"x1mkdm3x",kOIVth:"x1af02g3",kogj98:"xjgi5au",$$css:!0},preview:{kFhvOy:"x1lqcxt8 xf9p01c",kzqmXN:"x14atkfc x1dbdljh",ks0D6T:"x193iq5w",kZKoxP:"xt7dq6l",kskxy:"xctk3hg xzp9ylj",kVIFPx:"x19kjcj4",kaIpWk:"x12oqio5",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",$$css:!0},fields:{k1xSpc:"xrvj5dj",kOIVth:"x883omv",k7Eaqz:"xeuugli",$$css:!0},label:{k1xSpc:"xrvj5dj",kOIVth:"x1jnr06f",$$css:!0},source:{kogj98:"x1ghz6dp",kGuDYH:"xfifm61",kMwMTN:"xgi1xjn",$$css:!0},uses:{k1xSpc:"xrvj5dj",kOIVth:"x17d4w8g",keoZOQ:"x1xmf6yo",$$css:!0},useList:{k1xSpc:"xrvj5dj",kOIVth:"x1jnr06f",kogj98:"x1ghz6dp",kmVPX3:"x1717udv",kB88ic:"xe8uvvx",$$css:!0},useLink:{kMwMTN:"xqvuw85",kGuDYH:"x2ouz8m",kcSHmL:"xda060z",$$css:!0}};var W=M(I(),1),bi={fallback:"Not described yet: the alt text stands in until the brain describes the image.",generated:"Written by the brain's vision model. Edit it to make it yours.",owner:"Written by you. The brain will not replace it."};function qn(e){let t=we(),[n,i]=ne.useState(null),[o,a]=ne.useState(""),[s,p]=ne.useState(""),[b,m]=ne.useState(),[w,T]=ne.useState(!1),[k,y]=ne.useState(!1);ne.useEffect(()=>{let S=!0;return i(null),y(!1),m(void 0),t.fetchImageDetails(e.imageId).then((x)=>{if(!S)return;i(x),a(x.title),p(x.alt)},()=>{if(S)y(!0)}),()=>{S=!1}},[t,e.imageId]);let j=async()=>{if(!n)return;T(!0),m(void 0);try{await t.saveImageDetails({id:n.id,title:o,alt:s,baseContentHash:n.contentHash});let S=await t.fetchImageDetails(n.id);i(S),m({tone:"good",text:"Image details saved."})}catch(S){m({tone:"error",text:_e(S)})}finally{T(!1)}};if(k)return W.jsxDEV("p",{...r(U.source),children:"This image's title and alt text are not available here."},void 0,!1,void 0,this);return W.jsxDEV("div",{...r(U.details),"data-studio-image-details":"",children:[W.jsxDEV(In,{imageId:e.imageId,alt:s,...r(U.preview)},void 0,!1,void 0,this),W.jsxDEV("div",{...r(U.fields),children:[W.jsxDEV("label",{...r(U.label),children:[W.jsxDEV("span",{...r(c.label),children:"Title"},void 0,!1,void 0,this),W.jsxDEV(te,{xstyle:c.control,type:"text",value:o,disabled:!n||w,onChange:(S)=>a(S.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),W.jsxDEV("label",{...r(U.label),children:[W.jsxDEV("span",{...r(c.label),children:"Alt text"},void 0,!1,void 0,this),W.jsxDEV(Je,{xstyle:c.control,rows:2,value:s,disabled:!n||w,onChange:(S)=>p(S.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),n&&W.jsxDEV("p",{...r(U.source),children:bi[n.altSource]},void 0,!1,void 0,this),W.jsxDEV("div",{children:W.jsxDEV(D,{type:"button",variant:"outline",size:"sm",disabled:!n||w,onClick:()=>void j(),children:"Save image details"},void 0,!1,void 0,this)},void 0,!1,void 0,this),W.jsxDEV("div",{role:"status","aria-live":"polite",children:b&&W.jsxDEV(Z,{tone:b.tone,children:b.text},void 0,!1,void 0,this)},void 0,!1,void 0,this),n?.usedIn&&W.jsxDEV("section",{"data-studio-image-uses":"",...r(U.uses),children:[W.jsxDEV("h3",{...r(c.label),children:"Used in"},void 0,!1,void 0,this),n.usedIn.length===0?W.jsxDEV("p",{...r(U.source),children:"Not used in any entry yet."},void 0,!1,void 0,this):W.jsxDEV("ul",{...r(U.useList),children:n.usedIn.map((S)=>W.jsxDEV("li",{children:W.jsxDEV("a",{href:Nn(ae(),S.entityType,S.id),onClick:(x)=>{if(!e.onOpen||!ie(x))return;x.preventDefault(),e.onOpen(S.entityType,S.id)},...r(U.useLink),children:S.title},void 0,!1,void 0,this)},`${S.entityType}/${S.id}`,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var et=M(R(),1),An=M(I(),1),zn=et.createContext("save");function Mr(e){return An.jsxDEV(zn.Provider,{value:e.value,children:e.children},void 0,!1,void 0,this)}function Cn(){return et.useContext(zn)}var d=M(I(),1),ht=M(R(),1);function Vn(e){return e.some((t)=>t.name==="published"||t.name==="status"&&t.options?.includes("published"))}function hi(e,t){if(!e.condition)return!0;let n=e.condition.value,i=t[e.condition.field];return Array.isArray(n)?n.some((o)=>o===i):n===i}function Lr(e,t){let n=new Set(e.filter((i)=>!hi(i,t)).map((i)=>i.name));return Object.fromEntries(Object.entries(t).filter(([i])=>!n.has(i)))}function vi(e){let{descriptor:t,value:n,onChange:i}=e,o=Dn(),a=we(),s=Wn({mutationFn:(j)=>Tn(a,j),onSuccess:()=>{jn(o)}}),p=typeof n==="string"&&n.length>0?n:null,[b,m]=B.useState(null),w=B.useRef(null),T=B.useRef(!1),k=(j)=>{if(T.current)return;T.current=!0,m(j),s.mutate(j,{onSuccess:(S)=>{i(S.entityId),m(null)},onSettled:()=>{T.current=!1}})},y=d.jsxDEV("input",{ref:w,...r(c.file),tabIndex:p?-1:void 0,"aria-label":p?`Change ${t.label.toLowerCase()}`:void 0,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",disabled:s.isPending,onChange:(j)=>{let S=j.currentTarget.files?.[0];if(j.currentTarget.value="",S)k(S)}},void 0,!1,void 0,this);return d.jsxDEV("div",{...r(c.field),"data-studio-field":"image",children:[d.jsxDEV("span",{...r(c.label),children:t.label},void 0,!1,void 0,this),p?d.jsxDEV(d.Fragment,{children:[d.jsxDEV(qn,{imageId:p},void 0,!1,void 0,this),d.jsxDEV("p",{...r(c.imageRef),children:[d.jsxDEV(D,{type:"button",variant:"link",size:"xs",xstyle:c.clear,disabled:s.isPending,onClick:()=>w.current?.click(),children:"Change"},void 0,!1,void 0,this),y,d.jsxDEV(D,{type:"button",variant:"link",size:"xs",xstyle:c.clear,disabled:s.isPending,onClick:()=>{i(""),m(null),s.reset()},children:"Remove"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):d.jsxDEV("label",{...r(c.upload),children:[d.jsxDEV("span",{...r(c.glyph),"aria-hidden":"true",children:"↑"},void 0,!1,void 0,this),d.jsxDEV("strong",{...r(c.uploadTitle),children:"Choose an image"},void 0,!1,void 0,this),d.jsxDEV("small",{...r(c.uploadNote),children:"PNG, JPEG, GIF or WebP. Keep files below 10 MiB."},void 0,!1,void 0,this),y]},void 0,!0,void 0,this),d.jsxDEV("div",{role:"status","aria-live":"polite",children:[s.isPending&&d.jsxDEV(Z,{children:["Uploading ",b?.name,"… Wait for the upload before saving this reference."]},void 0,!0,void 0,this),s.isSuccess&&d.jsxDEV(Z,{tone:"good",children:["Uploaded ",s.variables.name,". Save changes to keep this reference."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.error&&d.jsxDEV(Z,{tone:"error",children:d.jsxDEV("span",{children:[b?.name,": ",_e(s.error)," Your previous image reference is unchanged.",d.jsxDEV("br",{},void 0,!1,void 0,this),"Choose another file, or retry. If the previous upload reached the server, retrying may create another image.",d.jsxDEV("br",{},void 0,!1,void 0,this),b&&d.jsxDEV(D,{type:"button",variant:"outline",onClick:()=>k(b),children:"Retry upload"},void 0,!1,void 0,this),d.jsxDEV(D,{type:"button",variant:"ghost",onClick:()=>{m(null),s.reset()},children:"Dismiss upload error"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Si(e){let t=e.trim().toLowerCase(),n=/series$/u.test(t)?"":/[^aeiou]ies$/u.test(t)?`${t.slice(0,-3)}y`:/(ss|x|z|ch|sh)es$/u.test(t)?t.slice(0,-2):/[^s]s$/u.test(t)?t.slice(0,-1):"";if(!n)return`an entry in ${t}`;return`${/^[aeiou]/u.test(n)?"an":"a"} ${n}`}function wi(e){let[t,n]=B.useState(""),i=B.useId(),o=B.useId(),a=e.literalList===!0,s=(e.suggestions??[]).filter((k)=>!(Array.isArray(e.value)?e.value:[]).includes(k)),p=Array.isArray(e.value)?e.value.filter((k)=>typeof k==="string"):[],b=Si(e.descriptor.label),m=a?"Add value":`Add ${b}`,w=a?`Add ${e.descriptor.label.toLowerCase()} value`:`New ${b.replace(/^an? /u,"")}`,T=()=>{let k=a?t:t.trim();if(k&&!p.includes(k))e.onChange([...p,k]);n("")};return d.jsxDEV("div",{...r(c.field),"data-studio-field":"tags",children:[d.jsxDEV("span",{...r(c.label),children:[e.descriptor.label,a&&d.jsxDEV("em",{...r(c.kind),children:"values"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),d.jsxDEV("div",{...r(c.tags),children:[p.map((k)=>ht.createElement("span",{...r(c.tag),key:k},a?X(k):k,d.jsxDEV(D,{type:"button",variant:"ghost",size:"icon-xs",xstyle:c.tagButton,"aria-label":`Remove ${a?X(k):k}`,onClick:()=>e.onChange(p.filter((y)=>y!==k)),children:"×"},void 0,!1,void 0,this))),d.jsxDEV("span",{...r(c.tag,c.tagAdd),children:[d.jsxDEV(te,{xstyle:[c.tagInput,a&&c.literalInput],size:m.length+1,type:"text",value:t,list:s.length>0?o:void 0,"aria-label":w,"aria-describedby":a?i:void 0,placeholder:m,"data-studio-list-add":"",onChange:(k)=>n(k.currentTarget.value),onKeyDown:(k)=>{if(k.nativeEvent.isComposing)return;if(k.key==="Enter"||!a&&k.key===",")k.preventDefault(),T()}},void 0,!1,void 0,this),d.jsxDEV(D,{type:"button",variant:"ghost",size:"icon-xs",xstyle:c.tagButton,"aria-label":m,onClick:T,children:"+"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.length>0&&d.jsxDEV("datalist",{id:o,children:s.map((k)=>d.jsxDEV("option",{value:k},k,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),a&&d.jsxDEV("span",{id:i,...r(c.listHelp),children:["Enter or + adds one value. Commas and spaces are literal.",(t!==t.trim()||p.some((k)=>k!==k.trim()))&&d.jsxDEV("strong",{children:[" ","Surrounding whitespace is preserved and creates a different group."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function $i(e){if(e.widget==="text")return"summarize";if(e.widget==="list"&&e.field?.widget==="string")return"tag-suggest";return null}function Hr(e){let{descriptor:t,state:n,onRun:i,onApply:o,onDiscard:a}=e,s=$i(t);if(!s)return null;let p="field"in n&&n.field===t.name;if(p&&n.kind==="suggested")return d.jsxDEV("div",{...r(c.suggestion),children:[Array.isArray(n.suggestion)?d.jsxDEV("span",{...r(c.suggestionTags),children:n.suggestion.map((b)=>ht.createElement("code",{...r(c.suggestionToken),key:b},b))},void 0,!1,void 0,this):d.jsxDEV("span",{...r(c.suggestionCopy),children:n.suggestion},void 0,!1,void 0,this),d.jsxDEV(D,{type:"button",size:"xs",onClick:()=>o(n.field,n.suggestion),children:"Apply"},void 0,!1,void 0,this),d.jsxDEV(D,{type:"button",variant:"ghost",size:"xs",onClick:a,children:"Discard"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return d.jsxDEV("div",{...r(c.assist),children:[d.jsxDEV(D,{type:"button",variant:"outline",size:"xs",disabled:p&&n.kind==="loading",onClick:()=>i(s,t.name),children:p&&n.kind==="loading"?"Thinking…":s==="summarize"?"Write one for me":`Suggest ${t.label.toLowerCase()}`},void 0,!1,void 0,this),p&&n.kind==="error"&&d.jsxDEV(Z,{inline:!0,tone:"error",children:n.message},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Br(e){let t=B.useId(),n=Cn(),i=B.useRef(null),o=e.issues?.filter((a)=>a.path[0]===e.descriptor.name)??[];return B.useEffect(()=>{let a=i.current;if(!a?.hasAttribute("data-studio-invalid-field")||a!==a.closest("form")?.querySelector("[data-studio-invalid-field]"))return;let s=a.querySelector('input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [role="switch"]:not([disabled])');((s?.getAttribute("aria-describedby")?.split(" ").includes(t))?s:a).focus()},[e.issues,t]),d.jsxDEV("div",{ref:i,role:"group","aria-label":e.descriptor.label,tabIndex:-1,"aria-describedby":o.length?t:void 0,"data-studio-invalid-field":o.length?e.descriptor.name:void 0,children:[d.jsxDEV(Ti,{readOnly:e.readOnly,vocabulary:e.vocabulary,literalList:e.literalList,suggestions:e.suggestions,descriptor:e.descriptor,value:e.value,onChange:e.onChange,errorId:o.length?t:void 0},void 0,!1,void 0,this),o.length>0&&d.jsxDEV("div",{id:t,children:d.jsxDEV(Z,{tone:"error",children:[n==="save"&&"Last save: ",o.map((a)=>`${a.path.length>1?`${a.path.slice(1).join(".")}: `:""}${a.message}`).join(" · ")]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Mi(e,t){if(e.name==="published"&&e.widget==="boolean")return{label:"On the site",hint:t===!0?"Published: anyone can read it on the site.":"Draft: only you and your team see it."};if(e.name==="slug")return{label:"Web address",hint:"The last part of its address on the site. Changing it changes the address once it is published."};if(e.widget==="text"&&["excerpt","summary","description"].includes(e.name))return{label:e.label,hint:"One or two lines that show in lists and when shared."};return{label:e.label}}function Ti(e){let{descriptor:t,value:n,onChange:i,errorId:o}=e,a=Mi(t,n),s=B.useId(),p=[o,a.hint?s:void 0].filter(Boolean).join(" ")||void 0,b=a.hint?d.jsxDEV("span",{id:s,...r(c.listHelp),children:a.hint},void 0,!1,void 0,this):null,m={"aria-invalid":o?!0:void 0,"aria-describedby":p},w=t.required!==!1,T=typeof n==="string"||typeof n==="number"?String(n):"",k=d.jsxDEV("span",{...r(c.label),children:[a.label,w?d.jsxDEV("em",{...r(c.required),children:"required"},void 0,!1,void 0,this):null]},void 0,!0,void 0,this);if(t.widget==="image")return d.jsxDEV(vi,{descriptor:t,value:n,onChange:i},void 0,!1,void 0,this);if(t.widget==="boolean")return d.jsxDEV("div",{...r(c.field),"data-studio-field":"boolean",children:[d.jsxDEV("label",{...r(c.inline),children:[d.jsxDEV("span",{...r(c.label,c.inlineLabel),children:a.label},void 0,!1,void 0,this),d.jsxDEV(Pn,{...m,checked:n===!0,onCheckedChange:(y)=>i(y)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b]},void 0,!0,void 0,this);if(t.widget==="select")return d.jsxDEV("label",{...r(c.field),"data-studio-field":"select",children:[k,d.jsxDEV(J,{...m,xstyle:c.control,value:T,required:w,onChange:(y)=>i(y.currentTarget.value),children:[d.jsxDEV("option",{value:"",children:"—"},void 0,!1,void 0,this),(t.options??[]).map((y)=>d.jsxDEV("option",{value:y,children:tt(y)},y,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);if(t.widget==="text")return d.jsxDEV(d.Fragment,{children:[d.jsxDEV("label",{...r(c.field),"data-studio-field":"text",children:[k,d.jsxDEV(Je,{...m,xstyle:c.control,value:T,required:w,rows:4,onChange:(y)=>i(y.currentTarget.value)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b]},void 0,!0,void 0,this);if(t.widget==="list"&&t.field?.widget==="string"){if(e.vocabulary)return d.jsxDEV(gn,{label:t.label,definition:e.vocabulary,value:n,onChange:i,errorId:o,readOnly:e.readOnly,suggestions:e.suggestions},void 0,!1,void 0,this);return d.jsxDEV(wi,{literalList:e.literalList,suggestions:e.suggestions,descriptor:t,value:n,onChange:i},void 0,!1,void 0,this)}if(t.widget==="provenance")return d.jsxDEV(Mn,{name:t.name,label:t.label,value:n},void 0,!1,void 0,this);if(t.widget==="people")return d.jsxDEV(wn,{label:t.label,value:n},void 0,!1,void 0,this);if(t.widget==="members")return d.jsxDEV($n,{label:t.label,value:n,onChange:i,readOnly:e.readOnly},void 0,!1,void 0,this);if(t.widget==="list"||t.widget==="object")return d.jsxDEV("div",{...r(c.field),"data-studio-field":"structured",children:[d.jsxDEV("span",{...r(c.label),children:[t.label,d.jsxDEV("em",{...r(c.kind),children:"read-only"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),d.jsxDEV(Se,{value:n,fields:t.fields},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return d.jsxDEV(d.Fragment,{children:[d.jsxDEV("label",{...r(c.field),"data-studio-field":t.widget,children:[k,d.jsxDEV(te,{...m,xstyle:[c.control,(t.widget==="datetime"||t.widget==="date")&&c.date],type:t.widget==="number"?"number":t.widget==="datetime"?"datetime-local":t.widget==="date"?"date":"text",value:t.widget==="datetime"?Gn(T):T,required:w,onChange:(y)=>{let j=y.currentTarget.value;if(t.widget==="date"&&j===""){i(void 0);return}i(t.widget==="datetime"&&j?new Date(j).toISOString():j)}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b]},void 0,!0,void 0,this)}var On={"grouping-definitions":{title:"Groupings",intro:"Define how entries are collected, without moving or rewriting their content.",fieldsTitle:"",bodyTitle:"",bodyDescription:""},"anchor-profile":{intro:"Who this Brain represents. Profile details and the longer story belong to the same record.",fieldsTitle:"Profile details",bodyTitle:"Story",bodyDescription:"Longer background, kept as Markdown alongside the structured profile."},"brain-character":{intro:"The Brain’s name, role, purpose, and values. Everything is in this form.",fieldsTitle:"Character",bodyTitle:"Written content",bodyDescription:"Additional content supported by this record."},"style-guide":{intro:"Shared direction for writing and visual work. Detailed guidance remains part of the same record.",fieldsTitle:"Style details",bodyTitle:"Guidance",bodyDescription:"Examples, exceptions, and longer instructions. Structured direction stays above."},"site-info":{intro:"Shared site details. Update the existing settings in one place.",fieldsTitle:"Site details",bodyTitle:"Written content",bodyDescription:"Additional content supported by this record."},prompt:{intro:"Reusable instructions that guide the Brain in specific contexts.",fieldsTitle:"Properties",bodyTitle:"Instructions",bodyDescription:"Instructions, examples, and constraints for this prompt."},skill:{intro:"Capabilities advertised by the Brain and its collaborators.",fieldsTitle:"Properties",bodyTitle:"Capability notes",bodyDescription:"Additional details recorded for this capability."},playbook:{intro:"Operational instructions, kept together as a document.",fieldsTitle:"Properties",bodyTitle:"Procedure",bodyDescription:"Steps and guidance for a repeatable process."},swot:{intro:"Strengths, weaknesses, opportunities, and threats that inform your next steps.",fieldsTitle:"Properties",bodyTitle:"Analysis",bodyDescription:"Context, evidence, and implications of this assessment."},agent:{intro:"A connected agent’s identity, relationship, and capabilities.",fieldsTitle:"Agent details",bodyTitle:"Profile and capabilities",bodyDescription:"The description and capabilities recorded for this agent."}},Rn={prompts:"prompt",skills:"skill",playbooks:"playbook",swots:"swot",agents:"agent",siteInfo:"site-info",settings:"site-info",profile:"site-info"};function Ln(e){let t=(Object.hasOwn(Rn,e)?Rn[e]:void 0)??e;return Object.hasOwn(On,t)?On[t]:void 0}var Ei={entityType:"",format:"frontmatter",isSingleton:!1,hasBody:!1,fields:[]};function ji(e){return Object.fromEntries(e.flatMap((t)=>t.badge===void 0?[]:[[t.id,t.badge]]))}function Ni(e,t){return e.find((n)=>n.publishesEntityTypes===!0&&n.entityTypes.includes(t))}function Ii(e,t){let{mode:n,save:i}=e.editor,o=t?.capabilities,a=t?.hierarchy.nested===!0||(n.kind==="create"?!n.prefix:e.collectionQuery.prefix===null),s=o?.canCreate===!0&&a,p=n.kind==="create"?s:n.kind==="edit"&&o?.canUpdate===!0,b=n.kind==="create"&&n.segment!==void 0,m=e.creationDestination,w=b&&m.error instanceof Hn?m.error.issues:void 0;return{canCreate:s,canEdit:p,canDelete:o?.canDelete===!0,canPublish:o?.canPublish===!0,canAssist:p&&o?.canAssist===!0,namedCreate:b,fieldIssues:i.kind==="error"?i.issues:w,destinationBlocked:b&&(!m.data||m.pending||Boolean(m.error))}}function nt(e,t,n){return`${e} ${e===1?t:n}`}function qi(e,t){let{entityTotal:n,folders:i,collectionQuery:o}=e,{hierarchyKind:a}=t,s=Boolean(o.q)||o.visibility!=="all"||Boolean(o.status),p=o.scope==="folder"&&!o.q&&(o.prefix!==null||i.length>0),b=s?[]:p?n>0?[`${nt(n,"entry","entries")} here`]:[]:[nt(n,"entry","entries")],m=i.reduce((k,y)=>k+y.descendantCount,n),w=i.length>0?[`${nt(i.length,a,`${a}s`)} · ${nt(m,"entry","entries")} in total`]:[],T=o.prefix&&!p?[o.scope==="collection"?"Whole collection":`In this ${a}`]:[];return{collectionFiltered:s,directFolderCount:p,listingHead:{kicker:"Content library",access:St("trusted"),title:t.activeType?.label??e.entityType??"Library",metadata:[...b,...w,...T,...t.syncPending?["Sync pending"]:[]],totals:[]}}}function zi(e,t){let{entityType:n}=e,{mode:i}=e.editor,{activeType:o,entitySchema:a,systemDesign:s}=t,p=o?.label??n,b=o?.singularLabel??vt(p??"Entry"),m=o?.isSingleton?o.singularLabel:void 0,w=i.kind==="edit"?m??Xn(i.entity,i.entity.id===n?b:void 0):i.kind==="create"?m??`New ${Fn(b)}`:p,T=t.activeWorkspace?.label??s?.title??m??p??"Studio",k=t.activeWorkspace||s?vt(T):b,y=i.kind==="edit"&&Vn(a.fields)?Qn(i.entity):null,j=i.kind==="create"?"new":y??void 0;return{heading:w,collectionLabel:T,entryLabel:k,publicationState:y,editorHead:{kicker:a.isSingleton?`${Y(o??null,null)} / singleton`:T,access:St("trusted"),title:s?.title??w??"Editor",metadata:j?[`${k} · ${j}`]:[],totals:[]}}}function es(e){let{activeWorkspaceId:t,types:n,workspaces:i,declarativeWorkspaceData:o,entityType:a,entities:s,entityOffset:p,entityLimit:b,entityTotal:m,schema:w}=e,T=n.find((C)=>C.entityType===a),k=i.find((C)=>C.id===t),y=w??Ei,j=a??"",S=(e.groupings?.items??[]).filter((C)=>C.types.includes(j)),x=Ln(j),u=T?.hierarchy.kind??"folder",v=e.syncStatus?.git?.hasChanges===!0;return{activeType:T,activeWorkspace:k,entitySchema:y,presentation:Ht(y.entityType,y.hasBody),selectedEntityType:j,groupingFields:S.map((C)=>C.field),groupingVocabularies:Object.fromEntries(S.map((C)=>[C.field,C.rules??{multiple:!0}])),systemDesign:x,editing:!e.groupingView&&!t&&e.editor.mode.kind!=="browse",...Ii(e,T),hierarchyKind:u,...zi(e,{activeType:T,activeWorkspace:k,entitySchema:y,systemDesign:x}),syncPending:v,publicationWorkspace:Ni(i,j),pageEnd:Math.min(p+(s?.length??b),m),workspaceBadges:ji(i),...qi(e,{activeType:T,hierarchyKind:u,syncPending:v}),declarativeHead:k&&o?Bn(k,o.view):null}}var _=M(R(),1);var Q={scope:{k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kOIVth:"x1v2ro7d",kLKAdn:"xz9dl7a",kMv6JI:"xa9opjo",kGuDYH:"x1k6wstc",$$css:!0},scopeChoice:{kmVPX3:"xokocfn",kEafiO:"x972fbf",kWqL5O:"xgfja2r",kZ1KPB:"xyj58a3",kt9PQ7:"xso031l",kfdmCh:"x1q0q8m5",kL6WhQ:"x16stqrj",kWkggS:"xjbqb8w",kVVagm:"xln7xf2",kMwMTN:"x1heor9g",kkrTdU:"x1ypdohk",kiDhMy:"x1nx0emz",kLioUB:"xrp573z",kTWfjk:"x1c4ya5t",$$css:!0},controls:{k8WAf4:"xxlmvz2",kt9PQ7:"xso031l",kfdmCh:"x1q0q8m5",kL6WhQ:"xpqg30t",kMv6JI:"x5ddh9m",kGuDYH:"x4z9k3i",kMwMTN:"x1ar3pfp",$$css:!0},row:{kVAEAm:"x1n2onr6",k1xSpc:"x78zum5",kGNEyG:"x6s0dn4",kwnvtZ:"x1a02dak",kOIVth:"x883omv",$$css:!0},filters:{kVAEAm:"x1uhb9sk",k1xSpc:"x1lp9gga",$$css:!0},summary:{k1xSpc:"x3nfvp2",kGNEyG:"x6s0dn4",kOIVth:"x1j9xkj6",kAzted:"x141feeh x1c4ya5t",kg3NbH:"xfoe8qy",kMzoRj:"xmkeg23",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"xu4hgxq",kWkggS:"x18s3upu",kMwMTN:"xgi1xjn",kGuDYH:"x4z9k3i",kB88ic:"xe8uvvx",kkrTdU:"x1ypdohk",kGqHtl:"x1i5lizr",k3XXqK:"x1t137rt x9v5kkp",kMeerF:"x1de99jn",kjBf7l:"x1itw484",kInvED:"x1hl8ikr",$$css:!0},open:{kVAM5u:"xawfzfr",kMwMTN:"xqvuw85",$$css:!0},panel:{k1xSpc:"xrvj5dj",kOIVth:"x1v2ro7d",kumcoG:"x1rdfzu x4jmfmw",kVAEAm:"x10l6tqk xip7ul3",kY2c9j:"x1w0boku",k87sOh:"x1d1n87m xl7365u",kLqNvP:"x1o0tod",kzqmXN:"x3p9ev8 x1dbdljh",kCS8Yb:"xfhngxr",ks0D6T:"x193iq5w",keoZOQ:"xdj266r x7xdyrl",kmVPX3:"x1gnqi22 x1bf66pj",kMzoRj:"xmkeg23 xwddm5z",ksu8eU:"x1y0btm7",kVAM5u:"x8tuc8h",kaIpWk:"xhpnuu7",kWkggS:"x18s3upu x1norit2",kGVxlE:"x1mxzbga xlc8tcj",$$css:!0},state:{keTefX:"xvc5jky",kMwMTN:"x1ar3pfp",kMv6JI:"xa9opjo",kGuDYH:"x1j6dyjg",khDVqt:"xuxw1ft",$$css:!0}};var E=M(I(),1);function Ci(e){let t=_.useRef(null);return _.useEffect(()=>{let n=(i)=>{let o=t.current;if(i.key!=="Escape"||!o?.open||!(i.target instanceof Node)||!o.contains(i.target))return;i.preventDefault(),i.stopPropagation(),o.open=!1,o.querySelector("summary")?.focus()};return window.addEventListener("keydown",n,!0),()=>window.removeEventListener("keydown",n,!0)},[]),E.jsxDEV("section",{className:O("studio-collection-controls",Q.controls),"aria-label":e.label,children:E.jsxDEV("div",{className:O("",Q.row),children:[E.jsxDEV(st,{label:e.searchLabel,placeholder:e.searchLabel,value:e.search,wide:!0,onChange:e.onSearch},void 0,!1,void 0,this),E.jsxDEV("details",{ref:t,className:O("",Q.filters),onBlur:(n)=>{if(n.relatedTarget instanceof Node&&!n.currentTarget.contains(n.relatedTarget))n.currentTarget.open=!1},children:[E.jsxDEV("summary",{className:O("",Q.summary,e.filterCount>0&&Q.open),children:[e.filterLabel,e.filterCount>0?` · ${e.filterCount}`:""]},void 0,!0,void 0,this),E.jsxDEV("div",{className:O("",Q.panel),children:e.children},void 0,!1,void 0,this)]},void 0,!0,void 0,this),e.trailing,e.filtered&&E.jsxDEV(E.Fragment,{children:[e.matchingCount!==void 0&&E.jsxDEV("span",{className:O("",Q.state),children:[e.matchingCount," ",e.matchingCount===1?"match":"matches"]},void 0,!0,void 0,this),E.jsxDEV(D,{type:"button",variant:"ghost","aria-label":"Clear search and filters",onClick:e.onClear,children:"Clear"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function cs(e){if(e.offset===0&&!e.hasNext&&!e.loading)return null;let t=e.count>0?`${e.offset+1}–${e.offset+e.count}${e.total===void 0?"":` of ${e.total}`}`:"No results on this page";return E.jsxDEV("nav",{className:O("listing-pagination",Pe.pagination),"aria-label":e.label,"aria-busy":e.loading,children:[E.jsxDEV("span",{className:O("",Pe.range),"aria-live":"polite",children:e.loading?"Loading…":t},void 0,!1,void 0,this),E.jsxDEV("span",{className:O("",Pe.pager),children:[E.jsxDEV(D,{type:"button",variant:"ghost",disabled:e.loading||e.offset===0,onClick:e.onPrevious,children:"Previous"},void 0,!1,void 0,this),E.jsxDEV(D,{type:"button",variant:"ghost",disabled:e.loading||!e.hasNext,onClick:e.onNext,children:"Next"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Ai=250;function ds(e){let[t,n]=_.useState(e.query.q);_.useEffect(()=>n(e.query.q),[e.query.q]);let i=_.useRef(e.onChange);i.current=e.onChange;let o=_.useRef(e.query);o.current=e.query,_.useEffect(()=>{if(t===o.current.q)return;let m=window.setTimeout(()=>{let w=me.safeParse({...o.current,q:t,offset:0});if(w.success)i.current(w.data)},Ai);return()=>window.clearTimeout(m)},[t]);let a=(m)=>{let w=me.safeParse({...e.query,...m,offset:0});if(w.success)e.onChange(w.data)},s=[...new Set([...e.fields.find((m)=>m.name==="status")?.options??[],e.query.status].filter(Boolean))],p=(e.query.visibility==="all"?0:1)+(e.query.status?1:0),b=Boolean(e.query.q)||p>0||e.query.sort!=="updated-desc";return E.jsxDEV(E.Fragment,{children:[E.jsxDEV(Ci,{label:"Collection search and filters",searchLabel:"Search title or content",search:t,onSearch:n,filterLabel:"Filter and sort",trailing:e.density&&e.onDensityChange&&E.jsxDEV("button",{type:"button","aria-label":"Compact rows","aria-pressed":e.density==="compact",className:O("",Q.summary,e.density==="compact"&&Q.open),onClick:()=>e.onDensityChange?.(e.density==="compact"?"comfortable":"compact"),children:"Compact"},void 0,!1,void 0,this),filterCount:p,filtered:b,matchingCount:e.total,onClear:()=>{n(""),e.onChange(me.parse({limit:e.query.limit,prefix:e.query.prefix,scope:e.query.scope}))},children:[E.jsxDEV("label",{children:["Visibility",E.jsxDEV(J,{value:e.query.visibility,onChange:(m)=>a({visibility:m.target.value}),children:[E.jsxDEV("option",{value:"all",children:"All available"},void 0,!1,void 0,this),E.jsxDEV("option",{value:"public",children:"Public"},void 0,!1,void 0,this),E.jsxDEV("option",{value:"shared",children:"Shared"},void 0,!1,void 0,this),E.jsxDEV("option",{value:"restricted",children:"Restricted"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.length>0&&E.jsxDEV("label",{children:["Status",E.jsxDEV(J,{value:e.query.status,onChange:(m)=>a({status:m.target.value}),children:[E.jsxDEV("option",{value:"",children:"All statuses"},void 0,!1,void 0,this),s.map((m)=>E.jsxDEV("option",{value:m,children:tt(m)},m,!1,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),E.jsxDEV("label",{children:["Sort",E.jsxDEV(J,{value:e.query.sort,onChange:(m)=>a({sort:m.target.value}),children:[E.jsxDEV("option",{value:"updated-desc",children:"Recently updated"},void 0,!1,void 0,this),E.jsxDEV("option",{value:"updated-asc",children:"Least recently updated"},void 0,!1,void 0,this),E.jsxDEV("option",{value:"created-desc",children:"Newest created"},void 0,!1,void 0,this),E.jsxDEV("option",{value:"created-asc",children:"Oldest created"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),(e.query.prefix!==null||e.query.scope==="collection")&&E.jsxDEV("div",{role:"group","aria-label":"Search scope",className:O("",Q.scope),children:[E.jsxDEV("span",{children:"Search"},void 0,!1,void 0,this),E.jsxDEV("button",{type:"button","aria-pressed":e.query.scope==="folder",className:O("",Q.scopeChoice),onClick:()=>a({scope:"folder"}),children:["This ",e.kind??"folder"]},void 0,!0,void 0,this),E.jsxDEV("button",{type:"button","aria-pressed":e.query.scope==="collection",className:O("",Q.scopeChoice),onClick:()=>a({scope:"collection"}),children:"Whole collection"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}
|
|
2
|
+
export{Ra as a,ei as b,Xt as c,Ke as d,Ha as e,Ft as f,Ua as g,Ya as h,Za as i,Ja as j,xe as k,Z as l,X as m,Ye as n,yn as o,Pe as p,Ci as q,cs as r,ds as s,je as t,Zn as u,Jn as v,Qi as w,c as x,U as y,Uo as z,Tn as A,Yo as B,Zo as C,Jo as D,_o as E,H as F,ir as G,ar as H,or as I,rr as J,jn as K,sr as L,lr as M,ur as N,cr as O,dr as P,qn as Q,F as R,$t as S,q as T,g as U,Bt as V,go as W,gn as X,pe as Y,Se as Z,Mr as _,hi as $,Lr as aa,Hr as ba,Br as ca,ji as da,Ni as ea,es as fa};
|
|
3
|
+
|
|
4
|
+
//# debugId=69CAFDD1162381EC64756E2164756E21
|