@krantho/studio 1.0.0 → 1.0.2
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/assets/AssistantPanel-ECkcslXS.js +8 -0
- package/dist/assets/GraphBrowser-BBKTzzRV.js +2 -0
- package/dist/assets/GraphCanvas-Cct1E2As.js +1 -0
- package/dist/assets/{action-button-Co7fp7HS.js → action-button-DIrhqMRc.js} +1 -1
- package/dist/assets/{api-seo-2H6_VoWE.js → api-seo-CwGP6Bi2.js} +1 -1
- package/dist/assets/{arduino-CEYAtK6G.js → arduino-DKR9_xyJ.js} +1 -1
- package/dist/assets/{arrow-down-CsgZZR1B.js → arrow-down-B5kfR2lG.js} +1 -1
- package/dist/assets/{arrow-left-DKjipJjb.js → arrow-left-7opbl8fu.js} +1 -1
- package/dist/assets/{auth-GRfs02w7.js → auth-CIpilSKF.js} +1 -1
- package/dist/assets/{c-C8PoWFx3.js → c-CEM0h_nK.js} +1 -1
- package/dist/assets/{circle-check-big-zoQrH4Hp.js → circle-check-big-DQjpuxcC.js} +1 -1
- package/dist/assets/{circle-dashed-Cu2MEHnb.js → circle-dashed-cuYrILNo.js} +1 -1
- package/dist/assets/{circle-x-DMb3ZtiK.js → circle-x-peGpq98w.js} +1 -1
- package/dist/assets/{clike-jjKDqbJf.js → clike-BlGBRct5.js} +1 -1
- package/dist/assets/{clock-CzpAlvS3.js → clock-DoBIVjZO.js} +1 -1
- package/dist/assets/collection-view--erTGbRH.js +5 -0
- package/dist/assets/{copy-DloNx7rC.js → copy-V85khWct.js} +1 -1
- package/dist/assets/{corner-down-right-D2cWjQTP.js → corner-down-right-BpwOGRFR.js} +1 -1
- package/dist/assets/{cpp-BNrDeSFM.js → cpp-C0nea612.js} +1 -1
- package/dist/assets/createLucideIcon-BklFHeMd.js +1 -0
- package/dist/assets/{csharp-C2EQRp-I.js → csharp-C430X67Y.js} +1 -1
- package/dist/assets/{data-table-D8BsE1pn.js → data-table-B1kqxrEw.js} +1 -1
- package/dist/assets/editor-page-XOJrwlcZ.js +27 -0
- package/dist/assets/{empty-state-CU7q3Ypl.js → empty-state-CeUZocHx.js} +1 -1
- package/dist/assets/{export-helpers-B2KV_EB5.js → export-helpers-C_HVpJN9.js} +1 -1
- package/dist/assets/{external-link-BRKJTCZG.js → external-link-Dh7p8Ii6.js} +1 -1
- package/dist/assets/{fill-job-D41ra-DR.js → fill-job-YPZFETW1.js} +1 -1
- package/dist/assets/{fill-run-view-DFeyjdsI.js → fill-run-view-B6rnYhKS.js} +1 -1
- package/dist/assets/{findability-CUYOthYI.js → findability-BrhtZ2yD.js} +1 -1
- package/dist/assets/{format-pPdsDgeS.js → format-C3ZX9yGM.js} +1 -1
- package/dist/assets/{go-BTdFQSkQ.js → go-2ldyX7zA.js} +1 -1
- package/dist/assets/graph-config-DKVGDPTG.js +1 -0
- package/dist/assets/image-editor-BX-DHJDa.js +1 -0
- package/dist/assets/index-CEQ7ZdKC.js +2 -0
- package/dist/assets/{info-B69U-gXd.js → info-Cxkabti5.js} +1 -1
- package/dist/assets/{java-OEPW09uX.js → java-BaDy4FT-.js} +1 -1
- package/dist/assets/{javascript-DWFokqmn.js → javascript-DoKZVVG7.js} +1 -1
- package/dist/assets/{kotlin-lSpEPTBz.js → kotlin-aNSUnDDr.js} +1 -1
- package/dist/assets/{layers-BQ89qo5R.js → layers-0VWe0rKm.js} +1 -1
- package/dist/assets/{list-checks-DmMdd-uP.js → list-checks-BCEhMMVY.js} +1 -1
- package/dist/assets/live-markdown-editor-DM8hYG3n.js +54 -0
- package/dist/assets/{markdown-D0Y7CUbI.js → markdown-ChIsYjIt.js} +1 -1
- package/dist/assets/{markup-Bfi2BWVm.js → markup-C09yLKTH.js} +1 -1
- package/dist/assets/{markup-templating-BkH2dBCn.js → markup-templating-DNhq-UOv.js} +1 -1
- package/dist/assets/media-page-CeBC5FQS.js +1 -0
- package/dist/assets/{meter-mJxPk3I3.js → meter-ZOLJ0WhG.js} +1 -1
- package/dist/assets/{objectivec-Cv_qlwGW.js → objectivec-s2I4Tn1D.js} +1 -1
- package/dist/assets/{pen-line-CZkcVGBd.js → pen-line-B524Nue8.js} +1 -1
- package/dist/assets/{pencil-BHnNXVY1.js → pencil-xdGZtrO4.js} +1 -1
- package/dist/assets/{php-MrfIyKXK.js → php-B_6N-5RT.js} +1 -1
- package/dist/assets/pulse-page-C00oCF2o.js +1 -0
- package/dist/assets/rolldown-runtime-COiEfhsA.js +1 -0
- package/dist/assets/{rotate-ccw-CjpQmti_.js → rotate-ccw-BgARBEK3.js} +1 -1
- package/dist/assets/ruby-C8GJZDTg.js +1 -0
- package/dist/assets/{save-kXwhieDK.js → save-ClSXW9cb.js} +1 -1
- package/dist/assets/{send-ib_sr-OU.js → send-kYpW5JED.js} +1 -1
- package/dist/assets/setup-page-BHJcTaTH.js +1 -0
- package/dist/assets/{site-XpqFn80l.js → site-BYsfQB_3.js} +1 -1
- package/dist/assets/site-model-C5bJvTbk.js +1 -0
- package/dist/assets/site-overview-5EhmXIR0.js +1 -0
- package/dist/assets/structure-page-9d9MG7vU.js +2 -0
- package/dist/assets/{trash-Cknp3eZ5.js → trash-DzRCm500.js} +1 -1
- package/dist/assets/triangle-exclamation-point-ttN5lZI0.js +1 -0
- package/dist/assets/{typescript-Brau3Puh.js → typescript-s_P45ayF.js} +1 -1
- package/dist/assets/{upload-BvBYjswd.js → upload-CaqQJaUr.js} +1 -1
- package/dist/assets/{use-drawer-actions-DChrztN2.js → use-drawer-actions-CR6Q0qdd.js} +1 -1
- package/dist/assets/{use-loaded-C3hBdQe0.js → use-loaded-BBFak2E1.js} +1 -1
- package/dist/assets/{use-locale-versions-Bp4V9fN-.js → use-locale-versions-BycCbBLd.js} +1 -1
- package/dist/assets/{vendor-diff-Dm2YfgXt.js → vendor-diff-DGCTJYJ4.js} +14 -14
- package/dist/assets/vendor-markdown-pd8vs9n-.js +74 -0
- package/dist/assets/{vendor-media-yY6fAUvp.js → vendor-media-DXSmPN_d.js} +1 -1
- package/dist/assets/vendor-react-CXaWJ_ii.js +15 -0
- package/dist/assets/{vendor-reactflow-5Qvgw90M.js → vendor-reactflow-CMKi7AEX.js} +1 -1
- package/dist/assets/vendor-router-B4czwg8X.js +1 -0
- package/dist/index.html +8 -8
- package/package.json +27 -27
- package/dist/assets/AssistantPanel-CzFfUizn.js +0 -8
- package/dist/assets/GraphBrowser-DvcHXw-i.js +0 -2
- package/dist/assets/GraphCanvas-Bq75rYgC.js +0 -1
- package/dist/assets/collection-view-BlqX2SDN.js +0 -5
- package/dist/assets/createLucideIcon-D_HN41p3.js +0 -1
- package/dist/assets/editor-page-C8G81B5n.js +0 -27
- package/dist/assets/graph-config-ZUe9BjGK.js +0 -1
- package/dist/assets/image-editor-Bmjrioxz.js +0 -1
- package/dist/assets/index-DVe5jFLX.js +0 -2
- package/dist/assets/live-markdown-editor-CTvxOTrh.js +0 -53
- package/dist/assets/media-page-DYRRse48.js +0 -1
- package/dist/assets/pulse-page-B44AnguJ.js +0 -1
- package/dist/assets/rolldown-runtime-Dd_uD5pT.js +0 -1
- package/dist/assets/ruby-DGkU311C.js +0 -1
- package/dist/assets/setup-page-x51U8px6.js +0 -1
- package/dist/assets/site-model-DX8WxTJg.js +0 -1
- package/dist/assets/site-overview--k6hNYk0.js +0 -1
- package/dist/assets/structure-page-BW1y8L1n.js +0 -2
- package/dist/assets/triangle-alert-C4yqbtOC.js +0 -1
- package/dist/assets/vendor-markdown-DlwjVoJi.js +0 -66
- package/dist/assets/vendor-react-DMqGe90A.js +0 -15
- package/dist/assets/vendor-router-DjV3D6zM.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AssistantPanel-CzFfUizn.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/vendor-diff-Dm2YfgXt.js","assets/vendor-router-DjV3D6zM.js","assets/auth-GRfs02w7.js","assets/createLucideIcon-D_HN41p3.js","assets/createLucideIcon-DO6kYgVn.css","assets/circle-check-big-zoQrH4Hp.js","assets/circle-x-DMb3ZtiK.js","assets/clock-CzpAlvS3.js","assets/copy-DloNx7rC.js","assets/info-B69U-gXd.js","assets/send-ib_sr-OU.js","assets/triangle-alert-C4yqbtOC.js","assets/api-client-BRi_ki2Y.js","assets/vendor-markdown-DlwjVoJi.js","assets/AssistantPanel-DB6gluI1.css","assets/pulse-page-B44AnguJ.js","assets/format-pPdsDgeS.js","assets/findability-CUYOthYI.js","assets/pen-line-CZkcVGBd.js","assets/api-seo-2H6_VoWE.js","assets/empty-state-CU7q3Ypl.js","assets/empty-state-Bvnil5AQ.css","assets/meter-mJxPk3I3.js","assets/meter-WebPk4WX.css","assets/source-CGZGd3Xy.js","assets/pulse-page-HgFM-MfC.css","assets/site-overview--k6hNYk0.js","assets/use-loaded-C3hBdQe0.js","assets/site-model-DX8WxTJg.js","assets/data-table-D8BsE1pn.js","assets/data-table-Dm9uZXES.css","assets/site-XpqFn80l.js","assets/circle-dashed-Cu2MEHnb.js","assets/corner-down-right-D2cWjQTP.js","assets/external-link-BRKJTCZG.js","assets/site-lUERQFzn.css","assets/collection-view-BlqX2SDN.js","assets/export-helpers-B2KV_EB5.js","assets/trash-Cknp3eZ5.js","assets/upload-BvBYjswd.js","assets/guards-BFEDbduR.js","assets/collection-view-Dllo4l_w.css","assets/editor-page-C8G81B5n.js","assets/vendor-react-DMqGe90A.js","assets/vendor-react-DLioOiRN.css","assets/arrow-left-DKjipJjb.js","assets/graph-config-ZUe9BjGK.js","assets/layers-BQ89qo5R.js","assets/graph-config-mZyX0Lqo.css","assets/use-drawer-actions-DChrztN2.js","assets/media-model-D4F1Farw.js","assets/action-button-Co7fp7HS.js","assets/use-drawer-actions-DeFJMhBn.css","assets/rotate-ccw-CjpQmti_.js","assets/fill-job-D41ra-DR.js","assets/use-locale-versions-Bp4V9fN-.js","assets/editor-page-D-qGDgmd.css","assets/structure-page-BW1y8L1n.js","assets/arrow-down-CsgZZR1B.js","assets/list-checks-DmMdd-uP.js","assets/save-kXwhieDK.js","assets/catalog-offer-CeRRk2Zo.js","assets/vendor-reactflow-5Qvgw90M.js","assets/fill-run-view-DFeyjdsI.js","assets/fill-run-view-BhqhXo7I.css","assets/structure-page-DVSxQzgj.css","assets/media-page-DYRRse48.js","assets/pencil-BHnNXVY1.js","assets/media-page-DBdAvFvu.css","assets/image-editor-Bmjrioxz.js","assets/vendor-media-yY6fAUvp.js","assets/vendor-media-DJOnVxEf.css","assets/image-editor-BTlqjPtS.css","assets/setup-page-x51U8px6.js","assets/setup-page-Bc799yav.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{a as t,o as n,s as r}from"./vendor-diff-Dm2YfgXt.js";import{m as i,p as a}from"./vendor-react-DMqGe90A.js";import{a as o,c as s,d as c,i as l,l as u,n as d,o as ee,p as f,t as p,u as te}from"./vendor-router-DjV3D6zM.js";import{i as m,r as ne,t as re}from"./auth-GRfs02w7.js";import{c as ie,d as h,o as ae,s as oe,t as g,u as _}from"./format-pPdsDgeS.js";import{i as v,n as y,r as b,t as x}from"./createLucideIcon-D_HN41p3.js";import{i as S,r as C,t as se}from"./api-client-BRi_ki2Y.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var w=e(r(),1),ce=a(),T=`globals`,E=encodeURIComponent;function D(e,t,n){let r=e===`globals`?`/layout/${E(t)}`:`/site/${E(e)}/${E(t)}`;return n?`${r}?locale=${E(n)}`:r}function le(e,t,n){let r=new URLSearchParams({...n?{locale:n}:{},mode:`data`});return`/site/${E(e)}/${E(t)}?${r}`}function O(e){return`/site/${E(e)}`}function k(e){return`/new/${E(e)}`}var ue=`/structure/graph?fill=1`;function de(e){return e?`/structure/scopes#scope-${e}`:`/structure/scopes`}function fe(e){return`/media/${E(e)}/edit`}var pe=`/setup/ai`,A=t();function me(e){if(typeof e!=`object`||!e)return!1;let{name:t,login_url:n}=e;return typeof t==`string`&&typeof n==`string`}function he(e){let t=e?.capabilities?.oidc_providers;return Array.isArray(t)?t.filter(me):[]}function ge(){let{login:e,authMode:t}=m(),[n,r]=(0,w.useState)(``),[i,a]=(0,w.useState)(null),[o,s]=(0,w.useState)(!1),[c,l]=(0,w.useState)([]),u=(0,w.useCallback)(e=>{e?.focus()},[]);(0,w.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get(`error`);e&&(a(e),window.history.replaceState({},``,window.location.pathname))},[]),(0,w.useEffect)(()=>{t===`oidc`&&fetch(`/api/auth/capabilities`).then(e=>e.json()).then(e=>{l(he(e))}).catch(()=>{})},[t]);async function d(t){t.preventDefault(),n.trim()&&(s(!0),a(null),await e(n.trim())||a(`Invalid access token`),s(!1))}return(0,A.jsx)(`div`,{className:`login-page`,children:(0,A.jsxs)(`div`,{className:`login-card`,children:[(0,A.jsx)(`h1`,{className:`login-title`,children:`krantho`}),(0,A.jsx)(`p`,{className:`login-subtitle`,children:t===`token`?`Enter your access token to continue`:`Sign in to continue`}),i&&(0,A.jsx)(`div`,{className:`login-error`,children:i}),t===`token`&&(0,A.jsxs)(`form`,{onSubmit:d,className:`login-form`,children:[(0,A.jsxs)(`div`,{className:`field`,children:[(0,A.jsx)(`label`,{className:`field-label`,htmlFor:`token`,children:`Access Token`}),(0,A.jsx)(`input`,{id:`token`,type:`password`,className:`field-input`,value:n,onChange:e=>r(e.target.value),placeholder:`Enter token`,ref:u})]}),(0,A.jsx)(`button`,{type:`submit`,className:v(`primary`,`md`,`login-btn`),disabled:o,children:o?`Signing in...`:`Sign In`})]}),t===`oidc`&&(0,A.jsxs)(`div`,{className:`login-oidc`,children:[c.map(e=>(0,A.jsxs)(`a`,{href:e.login_url,className:v(`primary`,`md`,`login-btn`),children:[`Sign in with `,e.name]},e.login_url)),c.length===0&&(0,A.jsx)(`p`,{className:`login-subtitle`,children:`No OIDC providers configured`})]})]})})}var _e=(0,w.createContext)(null);function ve({children:e}){let[t,n]=(0,w.useState)(!1),[r,i]=(0,w.useState)(!1),a=(0,w.useRef)(null),o=(0,w.useCallback)(()=>{i(!0),n(e=>!e)},[]),s=(0,w.useCallback)(()=>{n(!1),a.current?.focus()},[]),c=(0,w.useMemo)(()=>({open:t,opened:r,toggle:o,close:s,launcherRef:a}),[t,r,o,s]);return(0,A.jsx)(_e,{value:c,children:e})}function j(){return(0,w.useContext)(_e)}function ye(e){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(e).matches}function be(e){let[t,n]=(0,w.useState)(()=>ye(e));return(0,w.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function xe(e){try{let t=JSON.parse(localStorage.getItem(e)??`null`);return typeof t==`object`&&t?t:{}}catch{return{}}}function Se(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function Ce(e,t,n){return typeof e==`number`&&e>=t.min&&e<=t.max?e:n}function we(e,t){let[n,r]=(0,w.useState)(t),i=(0,w.useRef)(n);return(0,w.useEffect)(()=>{n!==i.current&&(i.current=n,Se(e,n))},[e,n]),[n,r]}var Te=`krantho-studio-nav`,M={min:200,max:360,fallback:236};function Ee(){let{collapsed:e,width:t,closedGroups:n}=xe(Te);return{collapsed:e===!0,width:Ce(t,M,M.fallback),closedGroups:Array.isArray(n)?n.filter(e=>typeof e==`string`):[]}}function De(){let[e,t]=we(Te,Ee),n=(0,w.useCallback)(e=>t(t=>({...t,collapsed:e})),[t]),r=(0,w.useCallback)(e=>t(t=>({...t,width:e})),[t]),i=(0,w.useCallback)(e=>t(t=>({...t,closedGroups:t.closedGroups.includes(e)?t.closedGroups.filter(t=>t!==e):[...t.closedGroups,e]})),[t]);return{...e,setCollapsed:n,setWidth:r,toggleGroup:i}}var Oe={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};Oe.node;var ke=x(Oe),Ae={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};Ae.node;var je=x(Ae),Me={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};Me.node;var Ne=x(Me),Pe={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};Pe.node;var Fe=x(Pe),Ie={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Ie.node;var N=x(Ie),Le={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Le.node;var Re=x(Le),ze={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};ze.node;var Be=x(ze),Ve={name:`cloud-upload`,size:24,node:[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]],aliases:[`upload-cloud`]};Ve.node;var He=x(Ve),Ue={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};Ue.node;var We=x(Ue),Ge={name:`file-plus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};Ge.node;var Ke=x(Ge),qe={name:`folder-tree`,size:24,node:[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]};qe.node;var Je=x(qe),Ye={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Ye.node;var Xe=x(Ye),Ze={name:`languages`,size:24,node:[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]};Ze.node;var Qe=x(Ze),$e={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};$e.node;var et=x($e),tt={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};tt.node;var nt=x(tt),rt={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};rt.node;var it=x(rt),at={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};at.node;var ot=x(at),st={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};st.node;var ct=x(st),lt={name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]};lt.node;var P=x(lt),ut={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]};ut.node;var dt=x(ut),ft={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]};ft.node;var pt=x(ft),mt={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};mt.node;var ht=x(mt),gt={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};gt.node;var _t=x(gt),vt={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};vt.node;var F=x(vt),yt={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};yt.node;var bt=x(yt),xt={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};xt.node;var St=x(xt),Ct={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Ct.node;var wt=x(Ct),Tt={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};Tt.node;var Et=x(Tt),Dt={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};Dt.node;var Ot=x(Dt),kt={name:`webhook`,size:24,node:[[`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`,key:`q3hayz`}],[`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06`,key:`1go1hn`}],[`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`,key:`qlwsc0`}]]};kt.node;var At=x(kt),jt={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};jt.node;var I=x(jt),Mt=6e3,Nt=(0,w.createContext)(null);function Pt(){let e=(0,w.useContext)(Nt);if(!e)throw Error(`useToast needs a ToastProvider`);return e}function Ft(e,t){let[n,r]=(0,w.useState)(!1),i=(0,w.useRef)(t);return(0,w.useEffect)(()=>{i.current=t},[t]),(0,w.useEffect)(()=>{if(e!==`success`||n)return;let t=setTimeout(()=>i.current(),Mt);return()=>clearTimeout(t)},[e,n]),r}function It(e){(0,w.useLayoutEffect)(()=>{let t=e.current;return()=>{if(!t?.contains(document.activeElement))return;let e=[...document.querySelectorAll(`.ui-toast-dismiss`)].filter(e=>!t.contains(e))[0]??document.getElementById(`studio-main`);queueMicrotask(()=>(e?.isConnected?e:document.getElementById(`studio-main`))?.focus())}},[e])}var Lt={success:Be,error:Re};function Rt({entry:e,onExpire:t,onDismiss:n}){let r=Ft(e.tone,t),i=(0,w.useRef)(null);It(i);let a=Lt[e.tone];return(0,A.jsxs)(`div`,{ref:i,className:`ui-toast ui-toast--${e.tone}`,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),onFocus:()=>r(!0),onBlur:()=>r(!1),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),n())},children:[(0,A.jsx)(a,{className:`ui-toast-icon`,"aria-hidden":`true`}),(0,A.jsx)(`p`,{className:`ui-toast-text`,children:e.text}),(0,A.jsx)(`button`,{type:`button`,className:`ui-toast-dismiss`,"aria-label":`Dismiss`,onClick:n,children:(0,A.jsx)(I,{"aria-hidden":`true`})})]})}function zt({entries:e,dismiss:t}){return e.map(e=>(0,A.jsx)(Rt,{entry:e,onExpire:()=>t(e.id),onDismiss:()=>t(e.id)},e.id))}function Bt({children:e}){let[t,n]=(0,w.useState)([]),r=(0,w.useRef)(0),i=(0,w.useCallback)(({text:e,tone:t=`success`})=>{r.current+=1;let i={id:r.current,text:e,tone:t};n(e=>[...e,i].slice(-3))},[]),a=(0,w.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e))},[]);return(0,A.jsxs)(Nt.Provider,{value:i,children:[e,(0,A.jsxs)(`div`,{className:`ui-toasts`,children:[(0,A.jsx)(`div`,{className:`ui-toast-region`,role:`status`,"aria-label":`Notifications`,children:(0,A.jsx)(zt,{entries:t.filter(e=>e.tone===`success`),dismiss:a})}),(0,A.jsx)(`div`,{className:`ui-toast-region`,role:`alert`,"aria-label":`Errors`,children:(0,A.jsx)(zt,{entries:t.filter(e=>e.tone===`error`),dismiss:a})})]})]})}var Vt=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function L(e){return[...e.querySelectorAll(Vt)].filter(e=>!e.closest(`[hidden], [inert]`))}function Ht(e,t){if(e.key!==`Tab`)return;let n=L(t),r=n[0],i=n[n.length-1];if(!r||!i){e.preventDefault();return}let a=document.activeElement;e.shiftKey&&(a===r||!t.contains(a))?(e.preventDefault(),i.focus()):!e.shiftKey&&(a===i||!t.contains(a))&&(e.preventDefault(),r.focus())}function R(e,t,n){(0,w.useEffect)(()=>{let r=e.current;if(!t||!r)return;let i=document.activeElement instanceof HTMLElement?document.activeElement:null;(n?.current??L(r)[0]??r).focus();let a=e=>Ht(e,r);return document.addEventListener(`keydown`,a),()=>{document.removeEventListener(`keydown`,a),i?.isConnected&&i.focus()}},[t,e,n])}async function z(){return(await S(`/collections`)).collections}async function Ut(e,t){let n=new URLSearchParams({view:`summary`});t?.status&&n.set(`status`,t.status),t?.sort&&n.set(`sort`,t.sort),t?.limit!==void 0&&n.set(`limit`,String(t.limit)),t?.offset!==void 0&&n.set(`offset`,String(t.offset)),t?.locale&&n.set(`locale`,t.locale);let r=n.toString();return S(`/content/${e}?${r}`)}async function Wt(e){return S(`/content-tree?locale=${encodeURIComponent(e)}`)}var Gt=500;async function Kt(e={}){let t=[];for(;;){let n=new URLSearchParams({view:e.view??`summary`});e.collections?.length&&n.set(`collections`,e.collections.join(`,`)),e.locale&&n.set(`locale`,e.locale),e.status&&n.set(`status`,e.status),n.set(`limit`,String(Gt)),n.set(`offset`,String(t.length));let r=await S(`/content?${n}`);if(t.push(...r.items),!r.hasMore||r.items.length===0)return t}}async function qt(e,t,n){return S(`/content/${e}/${t}${C(n)}`)}async function Jt(e){return S(`/schema/${e}`)}async function Yt(e,t){return S(`/content/${e}`,{method:`POST`,body:JSON.stringify(t)})}async function Xt(e,t,n){return S(`/content/${e}/${t}`,{method:`PUT`,body:JSON.stringify(n)})}async function Zt(e,t,n){return S(`/content/${e}/${t}/publish-impact${C(n)}`)}async function Qt(e,t,n){let r={method:`POST`};return n?.status&&(r.body=JSON.stringify({status:n.status})),S(`/content/${e}/${t}/publish${C(n?.locale)}`,r)}async function $t(e){return S(`/content/search?q=${encodeURIComponent(e)}`)}async function en(e,t,n){return S(`/content/${e}/bulk`,{method:`DELETE`,body:JSON.stringify(n?{slugs:t,locale:n}:{slugs:t})})}async function tn(e,t,n){return S(`/content/${e}/bulk-publish`,{method:`POST`,body:JSON.stringify(n?{slugs:t,locale:n}:{slugs:t})})}async function nn(e){return S(`/schema/${e}/runtime`)}async function rn(e,t){return S(`/schema/${e}/fields`,{method:`PUT`,body:JSON.stringify(t)})}async function an(e,t){return S(`/schema/${e}/fields/${t}`,{method:`DELETE`})}async function on(e){return S(`/schema/${e}/export`)}async function sn(e,t=`json`,n){let r=new URLSearchParams({format:t});return n&&r.set(`locale`,n),S(`/content/${e}/export?${r}`)}async function cn(e,t){return S(`/content/${e}/import`,{method:`POST`,body:JSON.stringify({items:t})})}async function ln(e){let t=new URLSearchParams;e?.limit!==void 0&&t.set(`limit`,String(e.limit)),e?.offset!==void 0&&t.set(`offset`,String(e.offset)),e?.status&&t.set(`status`,e.status);let n=t.toString();return S(`/webhooks/deliveries${n?`?${n}`:``}`)}async function un(e){return S(`/webhooks/deliveries/${e}/retry`,{method:`POST`})}async function dn(){return S(`/translations/status`)}function B(e){return e.liveVersion===null?`draft`:e.liveVersion>=e.version?`live`:`ahead`}var fn={live:`Live`,ahead:`Unpublished changes`,draft:`Not published`};async function pn(){return S(`/site-config`)}async function mn(){return S(`/settings/locales`)}async function hn(e){return S(`/settings/locales`,{method:`PUT`,body:JSON.stringify({supportedLocales:e})})}async function gn(){return S(`/settings/llm`)}async function _n(e){return S(`/settings/llm`,{method:`PUT`,body:JSON.stringify(e)})}async function vn(e){return S(`/settings/llm?provider=${encodeURIComponent(e)}`,{method:`DELETE`})}async function yn(e){return S(`/settings/llm/test`,{method:`POST`,body:JSON.stringify({provider:e})})}async function V(){let{defaultLocale:e,supportedLocales:t}=await mn();return{defaultLocale:e,supportedLocales:t}}function bn(e){return e.supportedLocales.length>1}async function xn(){let[e,t]=await Promise.all([Kt({view:`meta`}),V()]),n=new Map;for(let r of e){if(!t.supportedLocales.includes(r.locale)||B(r)!==`ahead`)continue;let e=`${r.collection}\u0000${r.locale}`,i=n.get(e)??{collection:r.collection,locale:r.locale,slugs:[]};i.slugs.push(r.slug),n.set(e,i)}return[...n.values()]}function Sn(e){return e.reduce((e,t)=>e+t.slugs.length,0)}async function Cn(e){let t=0;for(let n of e){let e=await tn(n.collection,n.slugs,n.locale);t+=e.published}return t}function H({status:e,decorative:t=!1}){let n=`ui-status-dot ui-status-dot--${e}`;if(t)return(0,A.jsx)(`span`,{className:n,"aria-hidden":`true`});let r=fn[e];return(0,A.jsx)(`span`,{className:n,role:`img`,"aria-label":r,title:r})}async function wn(){let{checkpoints:e}=await S(`/checkpoints`);return e}async function Tn(e){return S(`/checkpoints`,{method:`POST`,body:JSON.stringify(e?{name:e}:{})})}async function En(e){return S(`/checkpoints/${e}/restore`,{method:`POST`})}async function Dn(e){await S(`/checkpoints/${e}`,{method:`DELETE`})}async function On(e,t,n){try{return await S(`/content/${e}/${t}/lock${C(n)}`,{method:`POST`})}catch(e){if(e instanceof se){let t=typeof e.body.lockedBy==`string`?e.body.lockedBy:null,n=typeof e.body.expiresAt==`string`?e.body.expiresAt:null;return{locked:!1,error:e.message,status:e.status,...t?{lockedBy:t}:{},...n?{expiresAt:n}:{}}}return{locked:!1,error:e instanceof Error?e.message:`Failed to acquire lock`}}}async function kn(e,t,n){try{await S(`/content/${e}/${t}/lock${C(n)}`,{method:`DELETE`})}catch{}}async function An(){return(await S(`/locks`)).locks}function jn(e){return e instanceof se&&e.status===404}function U(e,t){return e instanceof Error?e.message:t}var Mn=200,Nn=8;function Pn(e){let[t,n]=(0,w.useState)({phase:`idle`}),r=e.trim();return(0,w.useEffect)(()=>{if(r.length<2){n({phase:`idle`});return}let e=!0;n({phase:`loading`});let t=setTimeout(()=>{$t(r).then(t=>{e&&n({phase:`done`,items:t.items.slice(0,Nn)})}).catch(t=>{e&&n({phase:`failed`,message:t instanceof Error?t.message:`Search failed`})})},Mn);return()=>{e=!1,clearTimeout(t)}},[r]),t}function Fn(){let[e,t]=(0,w.useState)(null);return(0,w.useEffect)(()=>{let e=!0;return z().then(n=>{e&&t(n.find(e=>e.pages)??null)}).catch(()=>{}),()=>{e=!1}},[]),e}function In({canEdit:e,pages:t,go:n,confirmPublishAll:r}){if(!e)return[];let i=[];return t&&i.push({id:`new-page`,label:`New page`,detail:`In ${g(t.name)}`,icon:Ke,run:n(k(t.name))}),i.push({id:`publish-all`,label:`Publish all drafts ahead of live`,detail:`Asks before publishing`,icon:He,run:r}),i}function Ln({canEdit:e,checkpoints:t,seo:n,go:r}){let i=[];return e&&t&&i.push({id:`checkpoint`,label:`Create checkpoint`,detail:`A restorable copy of the whole content store`,icon:je,run:async()=>{await Tn(),r(`/setup/checkpoints`)()}}),e&&n&&i.push({id:`enrich`,label:`Enrich missing SEO`,detail:`Opens Structure's Fill what's missing`,icon:Ot,run:r(ue)}),n&&i.push({id:`structure`,label:`Structure`,detail:`How search engines and assistants read the site`,icon:P,run:r(`/structure`)}),i}function Rn({close:e,confirmPublishAll:t}){let n=te(),r=h(),{hasRole:i}=m(),a=Fn(),o=i(`editor`),s=_(r,`checkpoints`),c=_(r,`seo`);return(0,w.useMemo)(()=>{let r={canEdit:o,checkpoints:s,seo:c,pages:a,go:t=>()=>{e(),n(t)},confirmPublishAll:t};return[...In(r),...Ln(r)]},[o,s,c,a,e,t,n])}function zn(e){return e.map(({id:e,label:t,detail:n,icon:r,run:i})=>({id:e,label:t,detail:n,icon:r,run:i}))}function Bn(e,t){return e.phase===`done`?e.items.map(({meta:e,fields:n})=>({id:`${e.collection}/${e.slug}/${e.locale}`,label:typeof n.title==`string`&&n.title?n.title:e.slug,detail:`${g(e.collection)} · ${e.slug}`,status:B(e),run:()=>t(D(e.collection,e.slug))})):[]}function Vn(e,t,n){let r=e.trim();return r===``?n===0?`No commands are available to you here.`:null:r.length<2?`Keep typing to search documents.`:t.phase===`loading`?`Searching…`:t.phase===`failed`?t.message:t.phase===`done`&&n===0?`No documents match “${r}”.`:null}function Hn(e,t){let n=te(),r=Pn(e),i=Rn({close:t.onClose,confirmPublishAll:t.confirmPublishAll});return e.trim()===``?{options:zn(i),search:r}:{options:Bn(r,e=>{t.onClose(),n(e)}),search:r}}function Un(e,t,n,r){return i=>{let a=e.length;if(i.key===`ArrowDown`||i.key===`ArrowUp`){if(i.preventDefault(),a===0)return;let e=i.key===`ArrowDown`?1:-1;n(t=>(t+e+a)%a)}else i.key===`Enter`&&(i.preventDefault(),r(e[t]))}}function Wn(e){let[t,n]=(0,w.useState)(``),[r,i]=(0,w.useState)(0),[a,o]=(0,w.useState)(null),{options:s,search:c}=Hn(t,e),l=a??Vn(t,c,s.length);(0,w.useEffect)(()=>i(0),[t,s.length]);async function u(e){if(e){o(e.id===`publish-all`?`Counting drafts ahead of live…`:null);try{await e.run()}catch(t){o(U(t,`${e.label} failed`))}}}return{query:t,setQuery:e=>{n(e),o(null)},active:r,setActive:i,options:s,status:l,run:u,handleKeyDown:Un(s,r,i,u)}}var Gn=i();function Kn({title:e,children:t,actions:n,onClose:r,initialFocus:i,busy:a=!1}){let o=(0,w.useRef)(null),s=(0,w.useId)();R(o,!0,i);function c(e){e.key===`Escape`&&(e.stopPropagation(),r())}return(0,Gn.createPortal)((0,A.jsxs)(`div`,{className:`ui-modal-layer`,children:[(0,A.jsx)(`div`,{className:`ui-modal-scrim`,"aria-hidden":`true`,onClick:r}),(0,A.jsxs)(`div`,{ref:o,role:`dialog`,"aria-modal":`true`,"aria-labelledby":s,"aria-busy":a,className:`ui-modal`,tabIndex:-1,onKeyDown:c,children:[(0,A.jsx)(`h2`,{id:s,className:`ui-modal-title`,children:e}),(0,A.jsx)(`div`,{className:`ui-modal-body`,children:t}),(0,A.jsx)(`div`,{className:`ui-modal-actions`,children:n})]})]}),document.body)}function qn(e){return e===1?`1 document`:`${e} documents`}function Jn({phase:e,count:t}){return e.name===`done`?(0,A.jsxs)(`p`,{role:`status`,children:[`Published `,qn(e.published),`. Visitors now see the saved versions.`]}):e.name===`failed`?(0,A.jsx)(`p`,{role:`alert`,children:e.message}):t===0?(0,A.jsx)(`p`,{children:`No document has unpublished changes. Every live page shows its latest saved version.`}):(0,A.jsxs)(`p`,{children:[t===1?`1 document has`:`${t} documents have`,` unpublished changes. Publishing makes each saved version what visitors see.`]})}function Yn(e,t){let[n,r]=(0,w.useState)({name:`ask`});async function i(){if(n.name!==`publishing`){r({name:`publishing`});try{let n=await Cn(e);r({name:`done`,published:n}),t()}catch(e){r({name:`failed`,message:U(e,`Publishing failed`)})}}}return{phase:n,publish:i}}function Xn({phase:e,count:t,safeRef:n,onClose:r,onPublish:i}){let a=e.name===`publishing`;return t===0||e.name===`done`||e.name===`failed`?(0,A.jsx)(y,{ref:n,onClick:r,children:`Close`}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(y,{ref:n,onClick:a?void 0:r,"aria-disabled":a,children:`Cancel`}),(0,A.jsx)(y,{variant:`primary`,onClick:a?void 0:i,"aria-disabled":a,children:a?`Publishing…`:`Publish ${qn(t)}`})]})}function Zn({groups:e,onClose:t,onPublished:n}){let r=Sn(e),{phase:i,publish:a}=Yn(e,n),o=(0,w.useRef)(null),s=i.name===`publishing`;return(0,w.useEffect)(()=>{(i.name===`done`||i.name===`failed`)&&o.current?.focus()},[i.name]),(0,A.jsx)(Kn,{title:`Publish all drafts ahead of live`,onClose:s?()=>void 0:t,initialFocus:o,busy:s,actions:(0,A.jsx)(Xn,{phase:i,count:r,safeRef:o,onClose:t,onPublish:()=>void a()}),children:(0,A.jsx)(Jn,{phase:i,count:r})})}function Qn({open:e,onClose:t,onContentChanged:n}){let[r,i]=(0,w.useState)(null),a=(0,w.useCallback)(async()=>{i(await xn())},[]);return(0,w.useEffect)(()=>{e||i(null)},[e]),e?r?(0,A.jsx)(Zn,{groups:r,onClose:t,onPublished:n}):(0,A.jsx)($n,{onClose:t,confirmPublishAll:a}):null}function $n(e){let t=Wn(e),n=(0,w.useRef)(null),r=(0,w.useRef)(null),i=(0,w.useId)();return R(n,!0,r),(0,A.jsxs)(`div`,{className:`palette-layer`,children:[(0,A.jsx)(`div`,{className:`palette-scrim`,"aria-hidden":`true`,onClick:e.onClose}),(0,A.jsxs)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,className:`palette`,onKeyDown:t=>{t.key===`Escape`&&e.onClose()},children:[(0,A.jsx)(er,{inputRef:r,listId:i,state:t}),(0,A.jsx)(`p`,{className:`palette-status`,role:`status`,children:t.status}),(0,A.jsx)(tr,{listId:i,state:t}),(0,A.jsxs)(`p`,{className:`palette-hint`,"aria-hidden":`true`,children:[(0,A.jsx)(`kbd`,{children:`↑`}),(0,A.jsx)(`kbd`,{children:`↓`}),` to move `,(0,A.jsx)(`kbd`,{children:`↵`}),` to open `,(0,A.jsx)(`kbd`,{children:`Esc`}),` to close`]})]})]})}function er({inputRef:e,listId:t,state:n}){let r=n.options.length>0;return(0,A.jsxs)(`div`,{className:`palette-search`,children:[(0,A.jsx)(F,{className:`palette-search-icon`,"aria-hidden":`true`}),(0,A.jsx)(`input`,{ref:e,className:`palette-input`,role:`combobox`,"aria-expanded":r,"aria-controls":t,"aria-autocomplete":`list`,"aria-activedescendant":r?`${t}-${n.active}`:void 0,"aria-label":`Search documents or run a command`,placeholder:`Search documents or run a command…`,autoComplete:`off`,spellCheck:!1,value:n.query,onChange:e=>n.setQuery(e.target.value),onKeyDown:n.handleKeyDown}),(0,A.jsx)(`kbd`,{className:`palette-key`,children:`Esc`})]})}function tr({listId:e,state:t}){return(0,w.useEffect)(()=>{document.getElementById(`${e}-${t.active}`)?.scrollIntoView({block:`nearest`})},[e,t.active]),(0,A.jsx)(`div`,{id:e,role:`listbox`,"aria-label":t.query.trim()===``?`Commands`:`Documents`,className:`palette-list`,hidden:t.options.length===0,children:t.options.map((n,r)=>{let i=n.icon;return(0,A.jsxs)(`div`,{id:`${e}-${r}`,role:`option`,"aria-selected":r===t.active,className:`palette-option`,onMouseMove:()=>t.setActive(r),onClick:()=>void t.run(n),children:[(0,A.jsx)(`span`,{className:`palette-option-icon`,"aria-hidden":!n.status||void 0,children:n.status?(0,A.jsx)(H,{status:n.status}):i&&(0,A.jsx)(i,{})}),(0,A.jsxs)(`span`,{className:`palette-option-text`,children:[(0,A.jsx)(`span`,{className:`palette-option-label`,children:n.label}),(0,A.jsx)(`span`,{className:`palette-option-detail`,children:n.detail})]})]},n.id)})})}var nr=16;function rr(e,t,n){return Math.min(n,Math.max(t,e))}function ir(e){let{label:t,value:n,min:r,max:i,grows:a,onChange:o,onReset:s,controls:c}=e,l=a===`right`?1:-1,u=(0,w.useRef)(null);function d(e){if(e.button!==0)return;let t=e.currentTarget;typeof t.setPointerCapture==`function`&&t.setPointerCapture(e.pointerId),u.current={x:e.clientX,width:n},document.body.dataset.resizing=`true`}function ee(e){let t=u.current;t&&o(rr(t.width+l*(e.clientX-t.x),r,i))}function f(){u.current=null,delete document.body.dataset.resizing}function p(e){let t=e.shiftKey?64:nr,a={ArrowRight:t,ArrowLeft:-t};if(e.key===`Home`)o(r);else if(e.key===`End`)o(i);else if(e.key in a)o(rr(n+l*(a[e.key]??0),r,i));else return;e.preventDefault()}return(0,A.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":t,"aria-valuenow":n,"aria-valuemin":r,"aria-valuemax":i,"aria-controls":c,tabIndex:0,className:`resize-handle`,"data-edge":a,onPointerDown:d,onPointerMove:ee,onPointerUp:f,onPointerCancel:f,onKeyDown:p,onDoubleClick:s})}var W=()=>!0,G=e=>t=>_(t,e),K=[{id:`collections`,path:`/setup/collections`,label:`Collections & schema`,icon:Fe,visible:(e,t)=>_(e,`runtimeSchema`)&&(!t.loginRequired||ne(t.roles,`admin`))},{id:`locales`,path:`/setup/locales`,label:`Locales`,icon:Qe,visible:W},{id:`ai`,path:`/setup/ai`,label:`AI provider`,icon:We,visible:W},{id:`integrations`,path:`/setup/integrations`,label:`Integrations`,icon:At,visible:G(`webhookDeliveries`)},{id:`checkpoints`,path:`/setup/checkpoints`,label:`Checkpoints`,icon:_t,visible:G(`checkpoints`)},{id:`people`,path:`/setup/people`,label:`People`,icon:Et,visible:(e,t)=>(e.authMode===`token`||e.authMode===`oidc`)&&ne(t.roles,`admin`)},{id:`environment`,path:`/setup/environment`,label:`Environment`,icon:bt,visible:W}],ar=[{id:`pulse`,path:`/`,label:`Pulse`,icon:ke,visible:W},{id:`site`,path:`/site`,label:`Site`,icon:Je,visible:W},{id:`structure`,path:`/structure`,label:`Structure`,icon:P,visible:G(`seo`)},{id:`media`,path:`/media`,label:`Media`,icon:Xe,visible:G(`media`)},{id:`setup`,path:`/setup`,label:`Setup`,icon:St,visible:(e,t)=>K.some(n=>n.visible(e,t))}],q=[{id:`graph`,path:`/structure/graph`,label:`Graph`},{id:`scopes`,path:`/structure/scopes`,label:`Scopes & archetypes`},{id:`rich-results`,path:`/structure/rich-results`,label:`Rich results`},{id:`crawlers`,path:`/structure/crawlers`,label:`Crawlers & assistants`}];function or(e,t){return ar.filter(n=>n.visible(e,t))}function sr(e,t){return K.filter(n=>n.visible(e,t))}function cr(e,t,n){return ar.some(r=>r.id===e&&r.visible(t,n))}function lr(e){if(e===`/`||e===``)return`pulse`;let t=e.split(`/`)[1]??``;return t===`site`||t===`layout`||t===`new`?`site`:t===`structure`||t===`media`||t===`setup`?t:null}function ur(e=`neutral`,t){return[`ui-chip`,`ui-chip--${e}`,t].filter(Boolean).join(` `)}function dr({tone:e=`neutral`,icon:t,children:n}){return(0,A.jsxs)(`span`,{className:ur(e),children:[t&&(0,A.jsx)(t,{className:`ui-chip-icon`,"aria-hidden":`true`}),n]})}var fr=`krantho-studio-theme`;function pr(){try{let e=localStorage.getItem(fr);return e===`light`||e===`dark`?e:`system`}catch{return`system`}}function mr(){let[e,t]=(0,w.useState)(pr),n=(0,w.useCallback)(e=>{t(e);try{localStorage.setItem(fr,e)}catch{}},[]);return(0,w.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,e)},[e]),{theme:e,setTheme:n}}var J=[{value:`light`,label:`Light`,icon:wt},{value:`dark`,label:`Dark`,icon:ct},{value:`system`,label:`System`,icon:ot}],hr={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1};function gr({index:e,checked:t,buttons:n,onChoose:r}){let i=J[e];if(!i)return null;let a=i.icon;function o(t){let n=hr[t.key];n!==void 0&&(t.preventDefault(),r((e+n+J.length)%J.length))}return(0,A.jsx)(`button`,{ref:t=>{n.current[e]=t},type:`button`,role:`radio`,"aria-checked":t,"aria-label":i.label,title:i.label,tabIndex:t?0:-1,className:`theme-switch-option`,onClick:()=>r(e),onKeyDown:o,children:(0,A.jsx)(a,{"aria-hidden":`true`})})}function _r({vertical:e=!1}){let{theme:t,setTheme:n}=mr(),r=(0,w.useRef)([]);function i(e){let t=J[e];t&&(n(t.value),r.current[e]?.focus())}return(0,A.jsx)(`div`,{className:`theme-switch`,role:`radiogroup`,"aria-label":`Theme`,"aria-orientation":e?`vertical`:`horizontal`,"data-vertical":e,children:J.map((e,n)=>(0,A.jsx)(gr,{index:n,checked:t===e.value,buttons:r,onChoose:i},e.value))})}function vr(){let e=j();return e?(0,A.jsxs)(`button`,{ref:e.launcherRef,type:`button`,className:`nav-item`,"aria-expanded":e.open,"aria-controls":e.opened?`assistant-panel`:void 0,onClick:e.toggle,children:[(0,A.jsx)(Ne,{className:`nav-item-icon`,"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`nav-item-label`,children:`Assistant`})]}):null}function yr({collapsed:e}){let t=m();if(!t.loginRequired)return null;let n=t.user?.roles[0]??`viewer`;return(0,A.jsxs)(A.Fragment,{children:[t.user&&!e&&(0,A.jsxs)(`div`,{className:`nav-user`,children:[(0,A.jsx)(`span`,{className:`nav-user-email`,title:t.user.email,children:t.user.email}),(0,A.jsx)(dr,{tone:n===`admin`?`accent`:`neutral`,children:n})]}),(0,A.jsxs)(`button`,{type:`button`,className:`nav-item`,onClick:()=>void t.logout(),children:[(0,A.jsx)(nt,{className:`nav-item-icon`,"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`nav-item-label`,children:`Log out`})]})]})}function br({mode:e,onToggleCollapsed:t}){let n=e===`collapsed`;return(0,A.jsxs)(`div`,{className:`nav-footer`,children:[(0,A.jsx)(vr,{}),(0,A.jsx)(yr,{collapsed:n}),(0,A.jsxs)(`div`,{className:`nav-footer-row`,children:[(0,A.jsx)(_r,{vertical:n}),e!==`drawer`&&(0,A.jsx)(b,{icon:n?pt:dt,label:n?`Expand navigation`:`Collapse navigation`,"aria-expanded":!n,"aria-controls":`studio-nav`,size:`sm`,onClick:t})]})]})}var Y=`:slug`;function xr(e){return e.path===void 0?e.name!==`globals`:e.path!==!1}function Sr(e,t){if(!xr(e))return null;let{name:n,path:r}=e;return typeof r==`string`?wr(r,t):n===`pages`?t===`home`?`/`:`/${t}`:`/${n}/${t}`}function Cr(e){if(!xr(e))return null;let{name:t,path:n}=e;return typeof n==`string`?n.replace(`/${Y}`,``)||`/`:t===`pages`?`/`:`/${t}`}function wr(e,t){if(!e.includes(Y))return e;let n=`/${Y}`;return t===`index`&&e.includes(n)?e.replace(n,``)||`/`:e.replaceAll(Y,t)}function Tr(e){return e?`${e.roles[0]??`unknown`}:${e.email}`:null}function Er(e){return e.replace(/^(admin|editor|viewer|unknown):/,``)}function Dr(e,t,n=Date.now()){let r=Tr(t);return e.filter(e=>e.lockedBy!==r&&new Date(e.expiresAt).getTime()>n)}function Or(e,t,n,r=Date.now()){let i=new Map;for(let a of Dr(e,n,r))t&&a.locale!==t||i.set(`${a.collection}/${a.slug}`,Er(a.lockedBy));return i}function kr(){let[e,t]=(0,w.useState)(null);return(0,w.useEffect)(()=>{let e=!0;return V().then(n=>{e&&t(n)}).catch(()=>{e&&t(null)}),()=>{e=!1}},[]),e}var Ar=6e4,jr=6e5,Mr=[`pointerdown`,`pointermove`,`keydown`,`wheel`,`touchstart`],Nr={groups:[],layout:null};function Pr(e,t){let n=new Set;return e.filter(e=>!n.has(e.slug)&&!!n.add(e.slug)).map(e=>({collection:e.collection,slug:e.slug,status:B(e),lockedBy:t.get(`${e.collection}/${e.slug}`)??null})).sort((e,t)=>e.slug.localeCompare(t.slug))}async function Fr(e,t){let[n,r,{collections:i}]=await Promise.all([z(),An().catch(()=>[]),Wt(e)]),a=Or(r,e,t),o=new Map(i.map(e=>[e.name,e.documents])),s=[],c=null;for(let e of n){let t=Pr(o.get(e.name)??[],a);e.name===`globals`?c=t:s.push({collection:e,documents:t})}return{groups:s,layout:c}}function Ir(e,t){let[n,r]=(0,w.useState)(Nr),{pathname:i}=s(),a=kr()?.defaultLocale,o=(0,w.useCallback)(async()=>{if(a===void 0)return null;try{return await Fr(a,e)}catch(e){return console.warn(`[studio] Failed to load the site tree:`,e),null}},[a,e]);return(0,w.useEffect)(()=>{let e=!0,t=()=>{o().then(t=>{e&&t&&r(t)})},n=()=>document.visibilityState===`visible`,i=Date.now(),a=()=>Date.now()-i>=jr,s=()=>{n()&&!a()&&t()},c=()=>{let e=a();i=Date.now(),e&&n()&&t()},l=()=>{n()&&(i=Date.now(),t())};t();let u=setInterval(s,Ar);document.addEventListener(`visibilitychange`,l);for(let e of Mr)document.addEventListener(e,c,{passive:!0});return()=>{e=!1,clearInterval(u),document.removeEventListener(`visibilitychange`,l);for(let e of Mr)document.removeEventListener(e,c)}},[o,i,t]),n}function Lr(e){let t=e.key===`ArrowDown`?1:e.key===`ArrowUp`?-1:0;if(t===0)return;let n=L(e.currentTarget),r=n.indexOf(document.activeElement);r!==-1&&(e.preventDefault(),n[(r+t+n.length)%n.length]?.focus())}function Rr({document:e}){let{pathname:t}=s(),n=D(e.collection,e.slug),r=t===n||t.startsWith(`${n}/`);return(0,A.jsx)(`li`,{children:(0,A.jsxs)(p,{to:n,className:`tree-item`,"aria-current":r?`page`:void 0,children:[(0,A.jsx)(H,{status:e.status}),(0,A.jsx)(`span`,{className:`tree-item-label`,children:e.slug}),e.lockedBy&&(0,A.jsx)(`span`,{className:`tree-lock`,role:`img`,"aria-label":`Locked by ${e.lockedBy}`,children:(0,A.jsx)(et,{"aria-hidden":`true`})})]})})}function zr({label:e,urlPath:t,path:n}){let{pathname:r}=s();return n?(0,A.jsxs)(p,{to:n,className:`tree-group-label`,"aria-current":r===n?`page`:void 0,children:[e,t&&(0,A.jsxs)(A.Fragment,{children:[` `,(0,A.jsx)(`span`,{className:`tree-group-path`,children:t})]})]}):(0,A.jsx)(`span`,{className:`tree-group-label`,children:e})}function Br(e){let{name:t,label:n,open:r,onToggle:i,children:a}=e,o=(0,w.useId)();return(0,A.jsxs)(`div`,{className:`tree-group`,role:`group`,"aria-label":n,"data-group":t,children:[(0,A.jsxs)(`div`,{className:`tree-group-head`,children:[(0,A.jsx)(`button`,{type:`button`,className:`tree-toggle`,"aria-expanded":r,"aria-controls":o,"aria-label":`${n} documents`,onClick:i,children:(0,A.jsx)(N,{"aria-hidden":`true`})}),(0,A.jsx)(zr,{label:n,urlPath:e.urlPath,path:e.path})]}),(0,A.jsx)(`ul`,{id:o,className:`tree-list`,hidden:!r,children:a})]})}function Vr(){return(0,A.jsxs)(`ul`,{className:`tree-legend`,"aria-label":`Status legend`,children:[(0,A.jsxs)(`li`,{children:[(0,A.jsx)(H,{status:`live`,decorative:!0}),`live`]}),(0,A.jsxs)(`li`,{children:[(0,A.jsx)(H,{status:`ahead`,decorative:!0}),`draft ahead`]}),(0,A.jsxs)(`li`,{children:[(0,A.jsx)(H,{status:`draft`,decorative:!0}),`draft`]})]})}function Hr({group:e,canCreate:t,open:n,onToggle:r}){let{collection:i,documents:a}=e;return(0,A.jsxs)(Br,{name:i.name,label:g(i.name),urlPath:Cr(i),path:O(i.name),open:n,onToggle:r,children:[a.map(e=>(0,A.jsx)(Rr,{document:e},e.slug)),t&&(0,A.jsx)(`li`,{children:(0,A.jsxs)(p,{to:k(i.name),className:`tree-item tree-item--new`,children:[(0,A.jsx)(ht,{"aria-hidden":`true`}),(0,A.jsxs)(`span`,{className:`tree-item-label`,children:[`New `,ae(i.name)]})]})})]})}function Ur({revision:e,closedGroups:t,onToggleGroup:n}){let{user:r,hasRole:i}=m(),a=Ir(r,e),o=i(`editor`);return(0,A.jsxs)(`div`,{className:`site-tree`,role:`group`,"aria-label":`Site tree`,onKeyDown:Lr,children:[a.groups.map(e=>(0,A.jsx)(Hr,{group:e,canCreate:o,open:!t.includes(e.collection.name),onToggle:()=>n(e.collection.name)},e.collection.name)),a.layout&&(0,A.jsx)(Br,{name:`globals`,label:`Layout`,open:!t.includes(`globals`),onToggle:()=>n(`globals`),children:a.layout.map(e=>(0,A.jsx)(Rr,{document:e},e.slug))}),(0,A.jsx)(Vr,{})]})}function Wr(){return(0,A.jsxs)(`svg`,{className:`nav-brand-mark`,viewBox:`0 0 32 32`,fill:`none`,"aria-hidden":`true`,children:[(0,A.jsxs)(`g`,{stroke:`currentColor`,strokeWidth:`2.25`,strokeLinecap:`round`,children:[(0,A.jsx)(`path`,{d:`M9 4.5v23`}),(0,A.jsx)(`path`,{d:`M9 17.5 23 7`}),(0,A.jsx)(`path`,{d:`M14.5 13.4 23.5 27`})]}),(0,A.jsxs)(`g`,{fill:`currentColor`,children:[(0,A.jsx)(`circle`,{cx:`9`,cy:`4.5`,r:`2.6`}),(0,A.jsx)(`circle`,{cx:`9`,cy:`27.5`,r:`2.6`}),(0,A.jsx)(`circle`,{cx:`23`,cy:`7`,r:`2.6`}),(0,A.jsx)(`circle`,{cx:`23.5`,cy:`27`,r:`2.6`})]}),(0,A.jsx)(`circle`,{cx:`9`,cy:`17.5`,r:`3.6`,fill:`var(--color-accent)`})]})}function Gr(){let e=h(),{user:t,loginRequired:n}=m(),{pathname:r}=s(),i=lr(r),a={roles:t?.roles??[],loginRequired:n};return(0,A.jsx)(`ul`,{className:`nav-destinations`,"aria-label":`Destinations`,children:or(e,a).map(e=>{let t=e.icon,n=r===e.path?`page`:i===e.id?`true`:void 0;return(0,A.jsx)(`li`,{children:(0,A.jsxs)(p,{to:e.path,className:`nav-item`,"aria-current":n,children:[(0,A.jsx)(t,{className:`nav-item-icon`,"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`nav-item-label`,children:e.label})]})},e.id)})})}function Kr(e,t,n){R(e,t),(0,w.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t,n])}function qr(e){(0,w.useEffect)(()=>{let t=e.current;if(!t)return;let n=new Set,r=e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`.nav-item`),r=e.relatedTarget;!t||r instanceof Node&&t.contains(r)||n.delete(t)&&t.removeAttribute(`data-tip-dismissed`)},i=e=>{if(e.key===`Escape`&&t.dataset.mode===`collapsed`)for(let e of t.querySelectorAll(`.nav-item:hover, .nav-item:focus`))e.setAttribute(`data-tip-dismissed`,``),n.add(e)};return document.addEventListener(`keydown`,i),t.addEventListener(`mouseout`,r),t.addEventListener(`focusout`,r),()=>{document.removeEventListener(`keydown`,i),t.removeEventListener(`mouseout`,r),t.removeEventListener(`focusout`,r)}},[e])}function Jr({onCloseDrawer:e}){return(0,A.jsxs)(`div`,{className:`nav-header`,children:[(0,A.jsxs)(p,{to:`/`,className:`nav-brand`,children:[(0,A.jsx)(Wr,{}),(0,A.jsxs)(`span`,{className:`nav-brand-word`,children:[`krantho `,(0,A.jsx)(`span`,{className:`nav-brand-studio`,children:`studio`})]})]}),e&&(0,A.jsx)(b,{icon:I,label:`Close navigation`,onClick:e})]})}function Yr(e){let{mode:t,drawerOpen:n,onCloseDrawer:r}=e,i=(0,w.useRef)(null),a=t===`drawer`,o=a&&n;return Kr(i,o,r),qr(i),(0,A.jsxs)(`div`,{ref:i,id:`studio-nav`,className:`shell-nav`,"data-mode":t,"data-open":o,inert:a&&!n,...o?{role:`dialog`,"aria-modal":!0,"aria-label":`Navigation`}:{},children:[(0,A.jsxs)(`nav`,{className:`nav`,"aria-label":`Studio`,children:[(0,A.jsx)(Jr,{onCloseDrawer:a?r:null}),(0,A.jsxs)(`div`,{className:`nav-scroll`,children:[(0,A.jsx)(Gr,{}),t!==`collapsed`&&(0,A.jsx)(Ur,{revision:e.treeRevision,closedGroups:e.closedGroups,onToggleGroup:e.onToggleGroup})]}),(0,A.jsx)(br,{mode:t,onToggleCollapsed:e.onToggleCollapsed})]}),t===`expanded`&&(0,A.jsx)(ir,{label:`Resize navigation`,value:e.width,min:M.min,max:M.max,grows:`right`,onChange:e.onResize,onReset:e.onResetWidth,controls:`studio-nav`})]})}var Xr={notFound:!0};function Zr(e){return typeof e==`object`&&!!e&&`notFound`in e}var X=(0,w.createContext)({path:null,report:()=>{}});function Qr({children:e}){let[t,n]=(0,w.useState)(null);return(0,A.jsx)(X.Provider,{value:{path:t,report:n},children:e})}function $r(e){return(0,w.useContext)(X).path===e}function Z(){let{pathname:e}=s(),{report:t}=(0,w.useContext)(X);return(0,w.useEffect)(()=>(t(e),()=>t(null)),[t,e]),(0,A.jsxs)(`section`,{className:`not-found`,"aria-labelledby":`not-found-title`,children:[(0,A.jsx)(`p`,{className:`not-found-code`,children:`404`}),(0,A.jsx)(`h1`,{id:`not-found-title`,children:`Nothing here`}),(0,A.jsx)(`p`,{children:`This screen does not exist, or it is turned off for this site or for your role.`}),(0,A.jsx)(p,{to:`/`,className:v(`primary`),children:`Go to Pulse`})]})}var Q={label:`Site`,path:`/site`},ei={label:`Structure`,path:`/structure`},ti={label:`Setup`,path:`/setup`},ni={label:`Media`,path:`/media`};function ri(e){return{label:g(e),path:O(e)}}function ii(e){return q.find(t=>t.id===e)?.label??e}function ai(e){return K.find(t=>t.id===e)?.label??e}var oi=[{pattern:`/`,trail:()=>[{label:`Pulse`}]},{pattern:`/site`,trail:()=>[{label:`Site`}]},{pattern:`/site/:collection`,trail:e=>[Q,{label:g(e.collection??``)}]},{pattern:`/site/:collection/:slug`,trail:e=>[Q,ri(e.collection??``),{label:e.slug??``}]},{pattern:`/new/:collection`,trail:e=>[Q,ri(e.collection??``),{label:`New`}]},{pattern:`/layout/:slug`,trail:e=>[Q,{label:`Layout`},{label:e.slug??``}]},{pattern:`/structure`,trail:()=>[ei,{label:ii(`graph`)}]},{pattern:`/structure/:tab`,trail:e=>[ei,{label:ii(e.tab??``)}]},{pattern:`/setup`,trail:()=>[{label:`Setup`}]},{pattern:`/setup/:tab`,trail:e=>[ti,{label:ai(e.tab??``)}]},{pattern:`/media`,trail:()=>[{label:`Media`}]},{pattern:`/media/:id/edit`,trail:()=>[ni,{label:`Edit image`}]}],si=[{label:`Not found`}];function ci(e,t=!1){if(t)return si;for(let{pattern:t,trail:n}of oi){let r=f(t,e);if(r)return n(r.params)}return si}function li(){let{pathname:e}=s(),t=u().some(e=>Zr(e.handle)),n=$r(e),r=ci(e,t||n);return(0,A.jsx)(`nav`,{className:`breadcrumbs`,"aria-label":`Breadcrumb`,children:(0,A.jsx)(`ol`,{className:`breadcrumbs-list`,children:r.map((e,t)=>{let n=t===r.length-1;return(0,A.jsxs)(`li`,{className:`breadcrumbs-item`,children:[t>0&&(0,A.jsx)(N,{className:`breadcrumbs-separator`,"aria-hidden":`true`}),n?(0,A.jsx)(`span`,{className:`breadcrumbs-current`,"aria-current":`page`,children:e.label}):e.path?(0,A.jsx)(p,{to:e.path,className:`breadcrumbs-link`,children:e.label}):(0,A.jsx)(`span`,{className:`breadcrumbs-text`,children:e.label})]},r.slice(0,t+1).map(e=>e.label).join(`/`))})})})}function ui(){let e=typeof navigator>`u`?``:navigator.platform||navigator.userAgent;return/Mac|iPhone|iPad|iPod/i.test(e)?`⌘K`:`Ctrl K`}function di({showMenuButton:e,menuOpen:t,onOpenMenu:n,onOpenPalette:r}){return(0,A.jsxs)(`header`,{className:`top-bar`,children:[e&&(0,A.jsx)(b,{icon:it,label:`Open navigation`,"aria-expanded":t,"aria-controls":`studio-nav`,onClick:n}),(0,A.jsx)(li,{}),(0,A.jsxs)(`button`,{type:`button`,className:`top-bar-command`,"aria-label":`Search or command`,"aria-keyshortcuts":`Meta+K Control+K`,"aria-haspopup":`dialog`,onClick:r,children:[(0,A.jsx)(F,{className:`top-bar-command-icon`,"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`top-bar-command-label`,children:`Search or command`}),(0,A.jsx)(`kbd`,{className:`top-bar-command-key`,children:ui()})]})]})}var fi=(0,w.lazy)(()=>n(()=>import(`./AssistantPanel-CzFfUizn.js`).then(e=>({default:e.AssistantPanel})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])));function pi(){}function mi(){return c()?.contentChanged??pi}var hi=`(max-width: 959.98px)`;function gi(){return j()?.opened?(0,A.jsx)(w.Suspense,{fallback:null,children:(0,A.jsx)(fi,{})}):null}function _i(e){(0,w.useEffect)(()=>{function t(t){(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`k`&&(t.preventDefault(),e())}return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function vi(e){let[t,n]=(0,w.useState)(!1),{pathname:r}=s();return(0,w.useEffect)(()=>n(!1),[r,e]),[t,n]}function yi(){let e=be(hi),t=De(),[n,r]=vi(e),[i,a]=(0,w.useState)(!1),[o,s]=(0,w.useState)(0),c=(0,w.useCallback)(()=>{r(!1),a(!0)},[r]);return _i((0,w.useCallback)(()=>{r(!1),a(e=>!e)},[r])),{mode:e?`drawer`:t.collapsed?`collapsed`:`expanded`,drawerOpen:n,openDrawer:(0,w.useCallback)(()=>r(!0),[r]),closeDrawer:(0,w.useCallback)(()=>r(!1),[r]),toggleCollapsed:()=>t.setCollapsed(!t.collapsed),paletteOpen:i,openPalette:c,closePalette:(0,w.useCallback)(()=>a(!1),[]),treeRevision:o,contentChanged:(0,w.useCallback)(()=>s(e=>e+1),[]),preferences:t}}function bi(){let e=yi();return(0,A.jsxs)(`div`,{className:`shell`,"data-nav":e.mode,style:{"--nav-width":`${e.preferences.width}px`},children:[(0,A.jsx)(`a`,{className:`shell-skip`,href:`#studio-main`,children:`Skip to content`}),(0,A.jsx)(Yr,{mode:e.mode,drawerOpen:e.drawerOpen,onCloseDrawer:e.closeDrawer,onToggleCollapsed:e.toggleCollapsed,width:e.preferences.width,onResize:e.preferences.setWidth,onResetWidth:()=>e.preferences.setWidth(M.fallback),treeRevision:e.treeRevision,closedGroups:e.preferences.closedGroups,onToggleGroup:e.preferences.toggleGroup}),e.mode===`drawer`&&e.drawerOpen&&(0,A.jsx)(`div`,{className:`shell-scrim`,"aria-hidden":`true`,onClick:e.closeDrawer}),(0,A.jsxs)(`div`,{className:`shell-column`,children:[(0,A.jsx)(di,{showMenuButton:e.mode===`drawer`,menuOpen:e.drawerOpen,onOpenMenu:e.openDrawer,onOpenPalette:e.openPalette}),(0,A.jsx)(`main`,{id:`studio-main`,className:`shell-page`,tabIndex:-1,children:(0,A.jsx)(w.Suspense,{fallback:(0,A.jsx)(`div`,{className:`loading`,children:`Loading…`}),children:(0,A.jsx)(o,{context:{contentChanged:e.contentChanged}})})})]}),(0,A.jsx)(Qn,{open:e.paletteOpen,onClose:e.closePalette,onContentChanged:e.contentChanged}),(0,A.jsx)(gi,{})]})}function xi(){let{isAuthenticated:e,user:t}=m(),n=h(),r=_(n,`assistant`)&&e&&t!==null,i=(0,A.jsx)(Bt,{children:(0,A.jsx)(Qr,{children:(0,A.jsx)(bi,{})})});return r?(0,A.jsx)(ve,{children:i}):i}var Si=(0,w.lazy)(()=>n(()=>import(`./pulse-page-B44AnguJ.js`).then(e=>({default:e.PulsePage})),__vite__mapDeps([17,1,2,3,4,18,5,6,19,20,21,14,13,22,23,24,25,26,27]))),Ci=(0,w.lazy)(()=>n(()=>import(`./site-overview--k6hNYk0.js`).then(e=>({default:e.SiteOverview})),__vite__mapDeps([28,1,2,3,18,5,6,29,19,22,23,30,21,14,13,31,32,33,34,8,35,36,26,37]))),wi=(0,w.lazy)(()=>n(()=>import(`./collection-view-BlqX2SDN.js`).then(e=>({default:e.CollectionPage})),__vite__mapDeps([38,1,2,3,4,18,5,6,29,39,19,40,41,22,23,30,21,14,13,42,31,32,33,34,8,35,36,26,37,43]))),$=(0,w.lazy)(()=>n(()=>import(`./editor-page-C8G81B5n.js`).then(e=>({default:e.EditorPage})),__vite__mapDeps([44,1,2,45,46,3,4,18,5,6,47,48,29,10,35,19,49,42,50,51,41,52,14,53,54,8,9,36,11,20,55,21,56,13,15,22,23,30,24,25,57,58]))),Ti=(0,w.lazy)(()=>n(()=>import(`./structure-page-BW1y8L1n.js`).then(e=>({default:e.StructurePage})),__vite__mapDeps([59,1,2,3,4,18,5,6,60,48,29,10,35,19,49,42,50,34,8,39,36,11,61,20,55,21,14,62,56,13,63,64,22,23,53,26,65,66,31,32,67]))),Ei=(0,w.lazy)(()=>n(()=>import(`./media-page-DYRRse48.js`).then(e=>({default:e.MediaPage})),__vite__mapDeps([68,1,2,3,4,18,5,6,51,41,52,14,53,54,10,36,49,61,69,62,40,22,23,42,70]))),Di=(0,w.lazy)(()=>n(()=>import(`./image-editor-Bmjrioxz.js`).then(e=>({default:e.ImageEditorPage})),__vite__mapDeps([71,1,2,3,4,5,6,47,55,62,52,14,53,72,73,74]))),Oi=(0,w.lazy)(()=>n(()=>import(`./setup-page-x51U8px6.js`).then(e=>({default:e.SetupPage})),__vite__mapDeps([75,1,2,3,4,18,5,6,29,9,10,61,69,21,14,12,56,40,22,23,53,42,57,26,65,66,31,32,76]))),ki=[{path:`site`,element:(0,A.jsx)(Ci,{})},{path:`site/${T}`,element:(0,A.jsx)(Z,{}),handle:Xr},{path:`site/:collection`,element:(0,A.jsx)(wi,{})},{path:`site/:collection/:slug`,element:(0,A.jsx)($,{})},{path:`new/:collection`,element:(0,A.jsx)($,{})},{path:`layout/:slug`,element:(0,A.jsx)($,{collection:T})}],Ai=[{path:`structure`,element:(0,A.jsx)(l,{replace:!0,to:q[0]?.path??`/`})},...q.map(e=>({path:e.path.slice(1),element:(0,A.jsx)(Ti,{tab:e.id})}))],ji=[{path:`media`,element:(0,A.jsx)(Ei,{})},{path:`media/:id/edit`,element:(0,A.jsx)(Di,{})}];function Mi(e){let t=e[0];return t?[{path:`setup`,element:(0,A.jsx)(l,{replace:!0,to:t.path})},...e.map(t=>({path:t.path.slice(1),element:(0,A.jsx)(Oi,{tab:t.id,tabs:e})}))]:[]}function Ni({caps:e,viewer:t}){let n=n=>cr(n,e,t),r=[{index:!0,element:(0,A.jsx)(Si,{})},...ki,...n(`structure`)?Ai:[],...n(`media`)?ji:[],...n(`setup`)?Mi(sr(e,t)):[],{path:`*`,element:(0,A.jsx)(Z,{}),handle:Xr}];return[{path:`/`,element:(0,A.jsx)(xi,{}),children:r}]}function Pi(e){return d(e,{basename:`/studio`})}function Fi(){return(0,A.jsx)(`div`,{className:`loading`,children:`Loading…`})}function Ii({children:e}){let[t,n]=(0,w.useState)(null);return(0,w.useEffect)(()=>{ie().then(n)},[]),t?(0,A.jsx)(oe.Provider,{value:t,children:e}):(0,A.jsx)(Fi,{})}function Li({makeRouter:e}){let{user:t,loginRequired:n}=m(),r=h(),i=t?.roles,a=(0,w.useMemo)(()=>e(Ni({caps:r,viewer:{roles:i??[],loginRequired:n}})),[e,r,i,n]);return(0,w.useEffect)(()=>()=>a.dispose(),[a]),(0,A.jsx)(ee,{router:a})}function Ri({makeRouter:e}){let{isLoading:t,isAuthenticated:n,loginRequired:r}=m();return t?(0,A.jsx)(Fi,{}):r&&!n?(0,A.jsx)(ge,{}):(0,A.jsx)(Li,{makeRouter:e})}function zi({makeRouter:e=Pi}){return(0,A.jsx)(re,{children:(0,A.jsx)(Ii,{children:(0,A.jsx)(Ri,{makeRouter:e})})})}var Bi=document.getElementById(`root`);if(!Bi)throw Error(`Root element not found`);(0,ce.createRoot)(Bi).render((0,A.jsx)(w.StrictMode,{children:(0,A.jsx)(zi,{})}));export{R as $,hn as A,Ut as B,V as C,O as Ct,pn as D,k as Dt,mn as E,fe as Et,Yt as F,Jt as G,qt as H,an as I,cn as J,dn as K,sn as L,B as M,en as N,yn as O,de as Ot,tn as P,Xt as Q,on as R,bn as S,T as St,gn as T,D as Tt,Zt as U,z as V,nn as W,un as X,Qt as Y,rn as Z,Tn as _,xe as _t,Cr as a,_t as at,En as b,j as bt,ur as c,et as ct,Kn as d,Ke as dt,Pt as et,U as f,Be as ft,kn as g,we as gt,An as h,je as ht,Dr as i,F as it,fn as j,_n as k,q as l,Qe as lt,On as m,N as mt,Z as n,At as nt,Sr as o,ht as ot,jn as p,Re as pt,ln as q,Er as r,bt as rt,dr as s,P as st,mi as t,I as tt,ir as u,Je as ut,Dn as v,Ce as vt,vn as w,le as wt,H as x,pe as xt,wn as y,be as yt,Kt as z};
|