@datalayer/agent-runtimes 1.5.53 → 1.5.55
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-embed/chunks/ChatView-D4hFmYbm.js +32 -0
- package/dist-embed/chunks/{DeckComponent-C7AztSPA.js → DeckComponent-y0KZOMsH.js} +1 -1
- package/dist-embed/chunks/{DocumentView-DwpK2feQ.js → DocumentView-BKeO-v4k.js} +1 -1
- package/dist-embed/chunks/{EphemeralDocument-rusBlgBp.js → EphemeralDocument-BvbG68Jm.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawComponent-Qv9LHutW.js → ExcalidrawComponent-DeNgg0ms.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawModal-D6Mb9nmf.js → ExcalidrawModal-X6Yh6FKI.js} +1 -1
- package/dist-embed/chunks/{JupyterLexicalExtension-r47Jyrrd.js → JupyterLexicalExtension-Ght2bbbp.js} +5 -5
- package/dist-embed/chunks/{YouTubePlugin-4pUBJORX.js → YouTubePlugin-BnaV5Sxl.js} +1 -1
- package/dist-embed/chunks/{ar-SA-G6X2FPQ2-CD4X_3wm.js → ar-SA-G6X2FPQ2-DFML-KO4.js} +1 -1
- package/dist-embed/chunks/{az-AZ-76LH7QW2-oMbKQcB-.js → az-AZ-76LH7QW2-DTzTpRpk.js} +1 -1
- package/dist-embed/chunks/{bg-BG-XCXSNQG7-lSIB5dDU.js → bg-BG-XCXSNQG7-DMTmzgtc.js} +1 -1
- package/dist-embed/chunks/{bn-BD-2XOGV67Q-B5PkHAFO.js → bn-BD-2XOGV67Q-D1xy-Djm.js} +1 -1
- package/dist-embed/chunks/{ca-ES-6MX7JW3Y-BPeavtUl.js → ca-ES-6MX7JW3Y-hTO_csy7.js} +1 -1
- package/dist-embed/chunks/{cs-CZ-2BRQDIVT-DrBOFpi4.js → cs-CZ-2BRQDIVT-DBcXv81g.js} +1 -1
- package/dist-embed/chunks/{da-DK-5WZEPLOC-G5bUTE3Z.js → da-DK-5WZEPLOC-Rp51nhJX.js} +1 -1
- package/dist-embed/chunks/{de-DE-XR44H4JA-Drpt3qDZ.js → de-DE-XR44H4JA-DIgLamrP.js} +1 -1
- package/dist-embed/chunks/{el-GR-BZB4AONW-D4taPxaF.js → el-GR-BZB4AONW-XWt7TL7f.js} +1 -1
- package/dist-embed/chunks/{es-ES-U4NZUMDT-BvIGVphk.js → es-ES-U4NZUMDT-Bh1eks-u.js} +1 -1
- package/dist-embed/chunks/{eu-ES-A7QVB2H4-B8nvrNDk.js → eu-ES-A7QVB2H4-Bslg2HDc.js} +1 -1
- package/dist-embed/chunks/{fa-IR-HGAKTJCU-hwisHoU4.js → fa-IR-HGAKTJCU-9fGOejth.js} +1 -1
- package/dist-embed/chunks/{fi-FI-Z5N7JZ37-DKrDvTXs.js → fi-FI-Z5N7JZ37-DctXrD-R.js} +1 -1
- package/dist-embed/chunks/{fr-FR-RHASNOE6-DPtlBK_j.js → fr-FR-RHASNOE6-PUSl_g5c.js} +1 -1
- package/dist-embed/chunks/{gl-ES-HMX3MZ6V-B1ngwQkd.js → gl-ES-HMX3MZ6V-C5hGec18.js} +1 -1
- package/dist-embed/chunks/{he-IL-6SHJWFNN-BaoAQZ3f.js → he-IL-6SHJWFNN-rdU3Uatf.js} +1 -1
- package/dist-embed/chunks/{hi-IN-IWLTKZ5I-DzPeRmLM.js → hi-IN-IWLTKZ5I-CbVBP2OS.js} +1 -1
- package/dist-embed/chunks/{hu-HU-A5ZG7DT2-BgLcm8oA.js → hu-HU-A5ZG7DT2-BqNM3HXj.js} +1 -1
- package/dist-embed/chunks/{id-ID-SAP4L64H-egIA8l8_.js → id-ID-SAP4L64H-Z7074d-A.js} +1 -1
- package/dist-embed/chunks/{index-cYM4KfdD.js → index-2ciQBsIP.js} +1 -1
- package/dist-embed/chunks/{index-CkQ6IAoY.js → index-BIbnsdGY.js} +1 -1
- package/dist-embed/chunks/{index-Z2pxzg3H.js → index-BP84Dsqq.js} +1 -1
- package/dist-embed/chunks/{index-BzMt3uYX.js → index-BdQdhGo5.js} +1 -1
- package/dist-embed/chunks/{index-BKB97UwL.js → index-BpX_2Evh.js} +1 -1
- package/dist-embed/chunks/{index-CEbnhuIo.js → index-BrPjTG8-.js} +1 -1
- package/dist-embed/chunks/{index-Di3aBGLV.js → index-CAPuT1O_.js} +1 -1
- package/dist-embed/chunks/{index-5N0EOEHV.js → index-CC3OzP1C.js} +1 -1
- package/dist-embed/chunks/{index-D9_026K2.js → index-COWwWw7v.js} +1 -1
- package/dist-embed/chunks/{index-BTdq_niO.js → index-C_IEokTU.js} +1 -1
- package/dist-embed/chunks/{index-_H5U6gal.js → index-CalzGdbU.js} +1 -1
- package/dist-embed/chunks/{index-DVaPKQyL.js → index-CynaHotU.js} +1 -1
- package/dist-embed/chunks/{index-Cd5CgKFr.js → index-D4zET-qQ.js} +1 -1
- package/dist-embed/chunks/{index-BKOQQ5Ku.js → index-DJq5Nwi9.js} +1 -1
- package/dist-embed/chunks/{index-CZB8DyUw.js → index-Dx_VgK3b.js} +1 -1
- package/dist-embed/chunks/{index-BN8Bbau-.js → index-Dzf9vro3.js} +2 -2
- package/dist-embed/chunks/{index-DWfzdTZo.js → index-IGJ-OsCO.js} +1 -1
- package/dist-embed/chunks/{index-b6e3y1R-.js → index-mjwdOWLk.js} +1 -1
- package/dist-embed/chunks/{index-Gngo0bXi.js → index-wuTQQ7uK.js} +1 -1
- package/dist-embed/chunks/{index-CCRwowMu.js → index-zOsAyJ2Z.js} +1 -1
- package/dist-embed/chunks/{it-IT-JPQ66NNP-DDwc6pzw.js → it-IT-JPQ66NNP-CMr44eTw.js} +1 -1
- package/dist-embed/chunks/{ja-JP-DBVTYXUO-TrA2khDT.js → ja-JP-DBVTYXUO-DT0NU6hE.js} +1 -1
- package/dist-embed/chunks/{kaa-6HZHGXH3-GwFnOAIz.js → kaa-6HZHGXH3-C7H2NR4A.js} +1 -1
- package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-xYS1Kjfb.js → kab-KAB-ZGHBKWFO-CNMStwQY.js} +1 -1
- package/dist-embed/chunks/{kk-KZ-P5N5QNE5-BwDJRk5I.js → kk-KZ-P5N5QNE5-D6IFMubV.js} +1 -1
- package/dist-embed/chunks/{km-KH-HSX4SM5Z-Di9J-9zc.js → km-KH-HSX4SM5Z-sh4HcGEj.js} +1 -1
- package/dist-embed/chunks/{ko-KR-MTYHY66A-BxF1Locw.js → ko-KR-MTYHY66A-Bgk5LE7Q.js} +1 -1
- package/dist-embed/chunks/{ku-TR-6OUDTVRD-mGflwIcv.js → ku-TR-6OUDTVRD-CoM0o1jW.js} +1 -1
- package/dist-embed/chunks/{lt-LT-XHIRWOB4-DWluphZ2.js → lt-LT-XHIRWOB4-1uHPL6b-.js} +1 -1
- package/dist-embed/chunks/{lv-LV-5QDEKY6T-D9EEzVQ9.js → lv-LV-5QDEKY6T-DYKbCrq6.js} +1 -1
- package/dist-embed/chunks/{mr-IN-CRQNXWMA-DoMvP_Jp.js → mr-IN-CRQNXWMA-C7qlI0yH.js} +1 -1
- package/dist-embed/chunks/{my-MM-5M5IBNSE-CPPbx93K.js → my-MM-5M5IBNSE-BWSQ_5V3.js} +1 -1
- package/dist-embed/chunks/{nb-NO-T6EIAALU-m2hgNNww.js → nb-NO-T6EIAALU-BVQfX-Pe.js} +1 -1
- package/dist-embed/chunks/{nl-NL-IS3SIHDZ-B809T0Iy.js → nl-NL-IS3SIHDZ-BXjyEe9g.js} +1 -1
- package/dist-embed/chunks/{nn-NO-6E72VCQL-DcMxKEVg.js → nn-NO-6E72VCQL-3eaL8woM.js} +1 -1
- package/dist-embed/chunks/{oc-FR-POXYY2M6-BZTBaY64.js → oc-FR-POXYY2M6-CDqoITm8.js} +1 -1
- package/dist-embed/chunks/{pa-IN-N4M65BXN-Cs4i3fnS.js → pa-IN-N4M65BXN-CoKaIMNa.js} +1 -1
- package/dist-embed/chunks/{percentages-BXMCSKIN-D82iCuEy.js → percentages-BXMCSKIN-X4aF_7zv.js} +3 -3
- package/dist-embed/chunks/{pl-PL-T2D74RX3-B3jg7qOY.js → pl-PL-T2D74RX3-DDD5SgtT.js} +1 -1
- package/dist-embed/chunks/{pt-BR-5N22H2LF-aCJuloaY.js → pt-BR-5N22H2LF-BIIRVQqv.js} +1 -1
- package/dist-embed/chunks/{pt-PT-UZXXM6DQ-8ZZdQp1P.js → pt-PT-UZXXM6DQ-HB1n3nNc.js} +1 -1
- package/dist-embed/chunks/{ro-RO-JPDTUUEW-BmyO5zyl.js → ro-RO-JPDTUUEW-CDxFIF2P.js} +1 -1
- package/dist-embed/chunks/{ru-RU-B4JR7IUQ-BneR_2Bm.js → ru-RU-B4JR7IUQ-CM2wpzEh.js} +1 -1
- package/dist-embed/chunks/{si-LK-N5RQ5JYF-CDB0IyVm.js → si-LK-N5RQ5JYF-u_f-pZ4T.js} +1 -1
- package/dist-embed/chunks/{sk-SK-C5VTKIMK-ypZmPMe_.js → sk-SK-C5VTKIMK-1MdhriDY.js} +1 -1
- package/dist-embed/chunks/{sl-SI-NN7IZMDC-D9OrZXr7.js → sl-SI-NN7IZMDC-BtkaEwYy.js} +1 -1
- package/dist-embed/chunks/{subset-shared.chunk-cQajIUFT.js → subset-shared.chunk-Ca3xPoZL.js} +1 -1
- package/dist-embed/chunks/{subset-worker.chunk-DEC9qaDu.js → subset-worker.chunk-CEgJtfh9.js} +1 -1
- package/dist-embed/chunks/{sv-SE-XGPEYMSR-CXBRqMMZ.js → sv-SE-XGPEYMSR-CX9l-s8b.js} +1 -1
- package/dist-embed/chunks/{ta-IN-2NMHFXQM-BuB9HEjH.js → ta-IN-2NMHFXQM-Bs3QMZdy.js} +1 -1
- package/dist-embed/chunks/{th-TH-HPSO5L25-Ci7wR5dZ.js → th-TH-HPSO5L25-yCfu_zLh.js} +1 -1
- package/dist-embed/chunks/{tr-TR-DEFEU3FU-CEJUT8zN.js → tr-TR-DEFEU3FU-PnpIJqSm.js} +1 -1
- package/dist-embed/chunks/{uk-UA-QMV73CPH-Ceh5JIiD.js → uk-UA-QMV73CPH--aODafpt.js} +1 -1
- package/dist-embed/chunks/{url-DuKx0yk0.js → url-CzjbCo42.js} +1 -1
- package/dist-embed/chunks/{vi-VN-M7AON7JQ-8-R9Ohxp.js → vi-VN-M7AON7JQ-BruA8Fg-.js} +1 -1
- package/dist-embed/chunks/{zh-CN-LNUGB5OW-D4q5wqKm.js → zh-CN-LNUGB5OW-DtbH5pJi.js} +1 -1
- package/dist-embed/chunks/{zh-HK-E62DVLB3-_UiIVKpk.js → zh-HK-E62DVLB3-CPacR6Re.js} +1 -1
- package/dist-embed/chunks/{zh-TW-RAJ6MFWO-DyXZ-PXI.js → zh-TW-RAJ6MFWO-CImbtPSf.js} +1 -1
- package/dist-embed/datalayer-app-main.js +86 -86
- package/lib/apps/core/index.d.ts +11 -0
- package/lib/apps/plugins/app-rules/AppRulesCard.d.ts +6 -0
- package/lib/apps/plugins/app-rules/AppRulesCard.js +9 -1
- package/lib/apps/plugins/chat/ChatView.js +18 -3
- package/lib/apps/shell/LoopWorkspace.js +8 -0
- package/lib/portable/hosts/contracts.json +30 -0
- package/lib/specs/agents/agents.d.ts +6 -0
- package/lib/specs/agents/agents.js +294 -0
- package/lib/voice/HandsFree.js +11 -1
- package/lib/voice/VoiceInput.js +10 -2
- package/lib/voice/handsFree.d.ts +4 -2
- package/lib/voice/handsFree.js +4 -2
- package/package.json +1 -1
- package/dist-embed/chunks/ChatView-CRp8Mt57.js +0 -32
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import{E as N,e$ as So,r as o,j as t,f0 as yo,f1 as Co,b_ as Mn,B as p,H as ht,T as H,c as Q,cu as zt,eu as Dt,f2 as ue,co as bt,e as wo,f3 as ko,f4 as jo,e3 as Io,f5 as Eo,aH as To,f6 as Ro,dX as Bn,dV as Ao,dY as Gt,f7 as Mo,f8 as Po,f9 as Uo,fa as Lo,fb as $o,fc as Fo,d3 as Oo,a_ as _o,fd as zo,fe as No,ff as Bo,fg as Vo,fh as Ho,fi as Wo,x as Nt,fj as Do,fk as Go,fl as Ko,fm as Yo,fn as qo,fo as Jo,fp as Qo,fq as Xo,fr as Zo,fs as es,ft as ts,fu as ns,fv as os,fw as ss,fx as as,fy as is,fz as rs,fA as ls,fB as cs,fC as ds,fD as tt,fE as us,fF as fs,fG as ps,fH as ms,fI as Pn,fJ as gs,fK as Fe,fL as hs,fM as bs,a$ as xt,fN as xs,fO as vs,fP as Un,fQ as Ss,fR as ys,fS as Cs,fT as ws,eC as ks,fU as Bt,fV as je,fW as js,fX as Is,fY as Es,fZ as Ln,f_ as Ts,f$ as $n,g0 as Rs,g1 as As,g2 as Ms,g3 as Ps,g4 as Us,g5 as Ls,g6 as $s,g7 as Fs,g8 as Os,g9 as _s,ga as vt,gb as zs,gc as Ns,gd as Bs,I as Vs,ge as Hs,gf as Ws,gg as Fn,gh as Ds,gi as Gs,gj as Ks,gk as Kt,gl as Ys,gm as qs,ek as Vt,gn as Js,go as Qs}from"../datalayer-app-main.js";import{S as Xs,E as Zs,a as ea}from"./SignInIcon-4HkE48mS.js";import{F as ta,a as na,b as oa}from"./LinkedInGreyIcon-BoWXE-HS.js";function Vn(){const n=N(So);return o.useMemo(()=>n.map(a=>a.value),[n])}const Ht={github:{name:"github",oauth2CallbackServerRoute:"jupyter_iam/oauth2/callback",oauth2CallbackUIRoute:"/iam/oauth2/github/callback"},google:{name:"google",oauth2CallbackServerRoute:"jupyter_iam/oauth2/callback",oauth2CallbackUIRoute:"/iam/oauth2/google/callback"},linkedin:{name:"linkedin",oauth2CallbackServerRoute:"jupyter_iam/oauth2/callback",oauth2CallbackUIRoute:"/iam/oauth2/linkedin/callback"}},On=()=>{if(typeof document>"u")return"";const n=document.getElementById("datalayer-config-data");if(!n?.textContent)return"";try{const a=JSON.parse(n.textContent);return String(a?.iamUrl||"").replace(/\/$/,"")}catch{return""}},sa=(n,a="Unable to start social sign-in.")=>{if(n instanceof Error&&n.message)return n.message;if(typeof n=="string"&&n.trim())return n;if(n&&typeof n=="object"&&"message"in n){const l=n.message;if(typeof l=="string"&&l.trim())return l}return a},aa=Eo`
|
|
2
|
+
.signin-input-theme-scope input:-webkit-autofill,
|
|
3
|
+
.signin-input-theme-scope input:-webkit-autofill:hover,
|
|
4
|
+
.signin-input-theme-scope input:-webkit-autofill:focus,
|
|
5
|
+
.signin-input-theme-scope input:-webkit-autofill:active,
|
|
6
|
+
.signin-input-theme-scope input:-webkit-autofill:disabled,
|
|
7
|
+
.signin-input-theme-scope textarea:-webkit-autofill,
|
|
8
|
+
.signin-input-theme-scope textarea:-webkit-autofill:hover,
|
|
9
|
+
.signin-input-theme-scope textarea:-webkit-autofill:focus,
|
|
10
|
+
.signin-input-theme-scope textarea:-webkit-autofill:active,
|
|
11
|
+
.signin-input-theme-scope textarea:-webkit-autofill:disabled {
|
|
12
|
+
-webkit-text-fill-color: var(--fgColor-default) !important;
|
|
13
|
+
caret-color: var(--fgColor-default) !important;
|
|
14
|
+
-webkit-box-shadow: 0 0 0 1000px var(--bgColor-default) inset !important;
|
|
15
|
+
box-shadow: 0 0 0 1000px var(--bgColor-default) inset !important;
|
|
16
|
+
background-color: var(--bgColor-default) !important;
|
|
17
|
+
transition: background-color 9999s ease-in-out 0s !important;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.signin-input-theme-scope input:disabled,
|
|
21
|
+
.signin-input-theme-scope textarea:disabled {
|
|
22
|
+
-webkit-text-fill-color: var(--fgColor-muted) !important;
|
|
23
|
+
-webkit-box-shadow: 0 0 0 1000px var(--bgColor-default) inset !important;
|
|
24
|
+
box-shadow: 0 0 0 1000px var(--bgColor-default) inset !important;
|
|
25
|
+
background-color: var(--bgColor-default) !important;
|
|
26
|
+
opacity: 1 !important;
|
|
27
|
+
}
|
|
28
|
+
`,ia=({onSignIn:n,onApiKeySignIn:a,loginUrl:l,name:i,title:u="Datalayer OTEL",description:x="Sign in to access the observability dashboard.",icon:y,leadingIcon:L=t.jsx(Io,{size:24}),github:W=!1,google:U=!1,linkedin:f=!1,apiKey:St=!1,signUp:oe=!0,socialSignInNavigationTarget:Ie,asDoc:g=!1,fillHeight:fe=!0,hideHero:D=!1,calloutTitle:w,calloutDescription:Oe,passwordToggleLabel:yt="Sign in with a password",signUpTitle:Yt="Don't have an account?",signUpDescription:pe="Create a free Datalayer account with your email address.",signUpLabel:qt="Sign up with email",signUpHref:G="https://datalayer.ai/signup",onSignUp:_e,forgotPasswordHref:X="/password",forgotPasswordLabel:Z="Forgot password?",showForgotPassword:nt=!0,socialButtonMarginTop:me=3,actionButtonMaxWidth:se=320})=>{const h=g&&!D,ot=i??(g&&u==="Datalayer OTEL"?"Datalayer Sign In":u),st=y??(g?t.jsx(Xs,{size:24}):L),ge=o.useMemo(()=>{if(l)return l;const c=On();return c?`${c}/api/iam/v1/login`:"/api/iam/v1/login"},[l]),[K,Y]=o.useState(""),[he,Ee]=o.useState(""),[at,Ct]=o.useState(!1),[Te,wt]=o.useState(!1),[k,q]=o.useState(!1),[ae,ze]=o.useState(!1),[Re,it]=o.useState(null),[$,Ne]=o.useState(null),[be,kt]=o.useState(""),[Be,Ae]=o.useState(null),[Ve,B]=o.useState(null),{enqueueToast:ie}=yo(),[re,He]=o.useState(!1),[le,ce]=o.useState(""),We=o.useRef(null),xe=o.useCallback(c=>Co()?Mn.URLExt.join(Mn.PageConfig.getBaseUrl(),c.oauth2CallbackServerRoute):`${window.location.protocol}//${window.location.hostname}${window.location.port?`:${window.location.port}`:""}${c.oauth2CallbackUIRoute}`,[]),C=o.useMemo(()=>{if(typeof window>"u")return"/";const c=`${window.location.pathname}${window.location.search}${window.location.hash}`;return c.startsWith("/")?c:"/"},[]),ve=o.useCallback(async c=>{if(!ae){B(null),it(c.name),ze(!0);try{const j=On(),M=new URLSearchParams({provider:c.name,callback_uri:xe(c)}),O=Ie===void 0?void 0:String(Ie||"").trim(),Pe=O===void 0?C&&C!=="/"?C:void 0:O&&O.startsWith("/")&&!O.startsWith("//")?O:void 0;Pe&&M.set("post_auth_redirect",Pe);const R=`${j||""}/api/iam/v1/oauth2/authz/url?${M.toString()}`,v=await fetch(R),te=await v.json(),S=te?.autorization_url;if(!v.ok||!S)throw new Error(te?.message||"Unable to start social sign-in.");window.location.assign(S)}catch(j){const M=sa(j);B(M),ie(M,{variant:"error"}),it(null),ze(!1)}}},[xe,C,ie,ae,Ie]);o.useEffect(()=>{re&&We.current?.focus()},[re]);const V=o.useCallback(()=>{He(!1),ce("")},[]),ee=o.useCallback(()=>{!le.trim()||!a||(a(le.trim()),V())},[le,a,V]),rt=o.useCallback(()=>{if(_e){_e();return}window.location.assign(G)},[_e,G]),lt=o.useCallback(()=>{if(X){if(X.startsWith("http://")||X.startsWith("https://")){window.open(X,"_blank","noopener,noreferrer");return}window.location.assign(X)}},[X]),Me=o.useCallback(async()=>{if(!(g||!K||!he||k)){q(!0),B(null);try{const c=await fetch(ge,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({handle:K,password:he})});if(!c.ok)throw new Error(`HTTP ${c.status}`);const j=await c.json();if(j.success&&j.token){const M=String(j?.user?.id||j?.user?.uid||"").trim();if(!!j?.user?.mfaUrl&&M){Ne(M),Ae(j.token),B(null);return}n&&n(j.token,K)}else B(j.message||"Invalid username or password.")}catch(c){B(c instanceof Error?c.message:String(c))}finally{q(!1)}}},[g,K,he,k,ge,n]),F=o.useCallback(async()=>{if(!(g||k||!$||!be.trim()||!Be)){q(!0),B(null);try{const c=new URL(ge,window.location.origin),j=c.pathname.endsWith("/api/iam/v1/login")?c.href.replace(/\/api\/iam\/v1\/login$/,""):`${c.origin}`,M=await fetch(`${j}/api/iam/v1/users/${$}/mfa/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userUid:$,code:be.trim()})}),O=await M.json();if(!M.ok||!O?.success)throw new Error(O?.message||"Failed to validate your MFA code.");n&&n(Be,K)}catch(c){const j=c instanceof Error?c.message:String(c);B(j),ie(j,{variant:"error"})}finally{q(!1)}}},[g,ie,K,k,ge,be,Be,$,n]),De=o.useCallback(c=>{c.key==="Enter"&&($?F():Me())},[$,Me,F]),Ge=ae||k||g;return t.jsxs(p,{className:"signin-input-theme-scope",display:"flex",alignItems:D||h||!fe?"flex-start":"center",justifyContent:"center",minHeight:D||h||!fe?"auto":"100vh",bg:D?"transparent":"canvas.default",color:"fg.default",py:D?0:h?2:4,children:[t.jsx(aa,{}),t.jsxs(p,{width:"100%",maxWidth:440,p:0,children:[!D&&t.jsxs(t.Fragment,{children:[t.jsxs(p,{display:"flex",alignItems:"center",gap:2,mb:h?2:3,justifyContent:"center",children:[st,t.jsx(ht,{sx:{fontSize:3},children:ot})]}),t.jsx(H,{as:"p",sx:{fontSize:1,color:"fg.muted",mb:h?2:3,textAlign:"center"},children:x})]}),(w||Oe)&&t.jsxs(p,{mb:3,textAlign:"center",children:[w&&t.jsx(ht,{as:"h3",sx:{fontSize:2,mb:1},children:w}),Oe&&t.jsx(H,{sx:{color:"fg.muted",fontSize:1},children:Oe})]}),!$&&(W||U||f)&&t.jsxs(t.Fragment,{children:[W&&t.jsx(Q,{block:!0,size:"large",leadingVisual:Re==="github"?()=>t.jsx(zt,{size:"small"}):ta,disabled:Ge,onClick:()=>ve(Ht.github),sx:{mt:me,maxWidth:se,mx:"auto"},children:"Sign in with GitHub"}),U&&t.jsx(Q,{block:!0,size:"large",leadingVisual:Re==="google"?()=>t.jsx(zt,{size:"small"}):na,disabled:Ge,onClick:()=>ve(Ht.google),sx:{mt:me,maxWidth:se,mx:"auto"},children:"Sign in with Google"}),f&&t.jsx(Q,{block:!0,size:"large",leadingVisual:Re==="linkedin"?()=>t.jsx(zt,{size:"small"}):oa,disabled:Ge,onClick:()=>ve(Ht.linkedin),sx:{mt:me,maxWidth:se,mx:"auto"},children:"Sign in with LinkedIn"})]}),!$&&!at&&t.jsx(p,{mt:3,display:"flex",justifyContent:"center",children:t.jsx(Q,{leadingVisual:Dt,size:"large",block:!0,disabled:g||k||ae,onClick:()=>Ct(!0),sx:{maxWidth:se,mx:"auto"},children:yt})}),!$&&at&&t.jsxs(p,{mt:4,children:[t.jsxs(ue,{required:!0,sx:{mb:3},children:[t.jsx(ue.Label,{children:"Username"}),t.jsx(bt,{autoFocus:!0,block:!0,placeholder:"Your username",value:K,disabled:k||g,onChange:c=>Y(c.target.value),onKeyDown:De})]}),t.jsxs(ue,{required:!0,sx:{mb:3},children:[t.jsx(ue.Label,{children:"Password"}),t.jsx(bt,{block:!0,placeholder:"Your password",type:Te?"text":"password",value:he,disabled:k||g,onChange:c=>Ee(c.target.value),onKeyDown:De,trailingAction:t.jsx(bt.Action,{onClick:()=>wt(!Te),disabled:k||g,icon:Te?Zs:ea,"aria-label":Te?"Hide password":"Show password",sx:{color:"var(--fgColor-muted)"}})})]}),t.jsxs(p,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:3,children:[t.jsx(Q,{variant:"primary",disabled:k||g||!K||!he,onClick:Me,children:k?"Signing in…":"Sign In"}),nt&&t.jsx(wo,{as:"button",sx:{fontSize:1,cursor:g?"not-allowed":"pointer",background:"none",border:"none",opacity:g?.6:1},onClick:()=>{g||k||lt()},children:Z})]})]}),$&&t.jsxs(t.Fragment,{children:[t.jsxs(ue,{required:!0,sx:{mb:3,mt:2},children:[t.jsx(ue.Label,{children:"MFA Code"}),t.jsx(bt,{autoFocus:!0,block:!0,placeholder:"Your MFA code",value:be,disabled:k||g,onChange:c=>kt(c.target.value),onKeyDown:De})]}),t.jsx(Q,{variant:"primary",block:!0,disabled:k||g||!be.trim(),onClick:F,sx:{maxWidth:se,mx:"auto"},children:k?"Validating…":"Validate MFA Code"})]}),Ve&&t.jsx(H,{sx:{color:"danger.fg",fontSize:1,mt:3,display:"block"},children:Ve}),oe&&t.jsxs(p,{mt:4,pt:4,textAlign:"center",borderTop:"1px solid",borderColor:"border.muted",children:[t.jsx(ht,{as:"h3",sx:{fontSize:2,mb:2},children:Yt}),t.jsx(H,{as:"p",sx:{color:"fg.muted",fontSize:1,mb:3},children:pe}),t.jsx(p,{display:"flex",justifyContent:"center",children:t.jsx(Q,{variant:"primary",size:"large",leadingVisual:ko,disabled:g||k,onClick:rt,children:qt})})]}),St&&a&&t.jsxs(t.Fragment,{children:[t.jsxs(p,{display:"flex",alignItems:"center",gap:2,my:3,children:[t.jsx(p,{flex:1,height:"1px",bg:"border.default"}),t.jsx(H,{sx:{fontSize:0,color:"fg.muted"},children:"or"}),t.jsx(p,{flex:1,height:"1px",bg:"border.default"})]}),t.jsx(Q,{block:!0,leadingVisual:Dt,disabled:g||k||ae,onClick:()=>He(!0),sx:{maxWidth:se,mx:"auto"},children:"Sign in with an API Key"}),re&&t.jsx(p,{role:"dialog","aria-modal":"true","aria-labelledby":"signin-api-key-title",onKeyDown:c=>{c.key==="Escape"&&V()},onClick:V,position:"fixed",inset:0,zIndex:200,p:3,bg:"canvas.backdrop",display:"flex",alignItems:"center",justifyContent:"center",children:t.jsxs(p,{as:"form",onClick:c=>c.stopPropagation(),onSubmit:c=>{c.preventDefault(),ee()},width:"min(560px, 100%)",p:3,borderRadius:2,border:"1px solid",borderColor:"border.default",bg:"canvas.overlay",color:"fg.default",boxShadow:"shadow.large",children:[t.jsx(ht,{id:"signin-api-key-title",sx:{fontSize:2,mb:2},children:"Enter your API Key"}),t.jsxs(ue,{required:!0,children:[t.jsx(ue.Label,{children:"API Key"}),t.jsx(jo,{block:!0,required:!0,autoFocus:!0,placeholder:"Paste your API key here",value:le,onInput:c=>ce(c.currentTarget.value),ref:We})]}),t.jsxs(p,{mt:3,display:"flex",justifyContent:"flex-end",gap:2,children:[t.jsx(Q,{type:"button",onClick:V,children:"Cancel"}),t.jsx(Q,{type:"submit",variant:"primary",disabled:!le.trim(),children:"Authenticate"})]})]})})]})]})]})};function ra(n){const{agentId:a,instructions:l,model:i,frontendTools:u,inference:x,subagents:y,sharing:L,onSubagentEvent:W,modeEffect:U}=n;return{type:"browser-vercel-ai",endpoint:"",agentId:a,enableConfigQuery:!1,options:{instructions:l,model:i,frontendTools:u,inference:x,subagents:y,sharing:L,onSubagentEvent:W,modeEffect:U}}}const _n=To((n,a)=>({pending:void 0,suggest:(l,i)=>{const u=l.trim();u&&n({pending:{text:u,submit:i?.submit??!1,nonce:(a().pending?.nonce??0)+1}})},consume:()=>n({pending:void 0})})),la=({state:n})=>Ro[n];function ca({agentName:n,sandboxStillRuns:a=!1,temporary:l=!0,onSignedIn:i,onSignUp:u}){const{configuration:x}=Bn(),y=o.useCallback(L=>{Ao.getState().checkIAMToken(L),i?.()},[i]);return t.jsx(p,{height:"100%",minHeight:0,overflowY:"auto",bg:"canvas.default",px:4,py:4,children:t.jsxs(p,{maxWidth:440,mx:"auto",children:[t.jsxs(p,{display:"flex",alignItems:"center",justifyContent:"center",gap:2,color:"attention.fg",mb:2,children:[t.jsx(Dt,{size:20}),t.jsx(H,{sx:{fontSize:2,fontWeight:"semibold",color:"fg.default"},children:l?"This demo runs on a shared key":"Your key has expired"})]}),t.jsxs(H,{as:"p",sx:{fontSize:1,color:"fg.muted",textAlign:"center",mb:3},children:[l?`${n??"The agent"} has used the time this key allows. Sign in to point your own agent at it, use your own data, and drop the time limit.`:`${n??"The agent"} stopped because your session ran out.`,a?" Your notebook is still running in this page.":""]}),t.jsx(ia,{hideHero:!0,fillHeight:!1,calloutTitle:"Sign in to keep going",github:!0,google:!0,linkedin:!0,socialSignInNavigationTarget:typeof window>"u"?void 0:`${window.location.pathname}${window.location.search}`,loginUrl:x?.iamUrl?`${x.iamUrl}/api/iam/v1/login`:void 0,onSignIn:y,onSignUp:u})]})})}const da="https://r1.datalayer.run";function ua(n=!0){const{configuration:a}=Bn(),l=Gt(L=>L.token),i=a?.aiInferenceUrl||da,u=Mo(i,n&&!l),x=l||u.token,y=o.useMemo(()=>({inferenceUrl:i,token:x||void 0}),[i,x]);return{inference:y,needsSignIn:Po(y),anonymous:u,inferenceUrl:i}}const fa={name:"general-purpose",description:"A capable generalist for a task none of the specialists covers: research, reasoning, drafting, checking.",instructions:"You are a capable general-purpose assistant. Carry out the task you are given completely and report the result plainly, saying what you could not do."};function zn(n){const a=n?.subagents;if(!a)return[];const l=(a.subagents??[]).map(i=>{const u=i.ref?Uo(i.ref):void 0;return{name:i.name,description:i.description||u?.description||i.name,instructions:i.instructions??u?.systemPrompt,model:i.model??u?.model??a.defaultModel,icon:u?.icon}});return a.includeGeneralPurpose?[...l,fa]:l}function pa(n){return n.replace(/^datalayer_/,"").replace(/_lexical$/,"")}function ma(n){const a=pa(n);return/^executeCodeIn(Notebook|Document)$/.test(a)||/^(read|list)[A-Z]/.test(a)}function ga(n,a){return n.filter(l=>a?.has(l.name)||ma(l.name))}function ha(n,a){const l=i=>a&&i.value.id===`${a}-tools`?0:i.value.id==="notebook-tools"?1:2;return n.map((i,u)=>({entry:i,index:u,rank:l(i)})).sort((i,u)=>i.rank-u.rank||i.index-u.index).map(i=>i.entry)}function ba(n,a,l){if(!l||!n.endsWith("-tools"))return!1;const i=n.slice(0,-6);return a.has(i)&&i!==l}const xa={type:"object",properties:{}};function va(n,a){const l=new Set(n.toolset);return n.commands.filter(i=>l.has(i.name)).map(i=>({name:i.name,description:i.description,parameters:i.parameters??xa,location:"frontend",handler:async u=>{if(!a)throw new Error(`${i.name}: the ${n.plugin??n.id} plugin is not mounted on this page.`);const x=Object.keys(u??{}).length>0?u:void 0,y=await a.executeCommand(i.command,x);return y===void 0?{ok:!0,command:i.command,argument:x}:y}}))}function Hn(n,a){return n.flatMap(l=>va(l,a))}function Sa(){const n=Lo(),a=Vn();return o.useMemo(()=>Hn(a,n),[a,n])}function ya(n){const a=n?.app_instance;if(!a||typeof a!="object")return"";const l=a.deployment_uid;return typeof l=="string"?l.trim():""}function Ca(n,a,l){return n||!a?n:{id:l,messages:[]}}const wa="var(--theme-accent)";function Wn({face:n,size:a}){return typeof n=="string"?t.jsx($o,{emoji:n,size:a,label:""}):t.jsx(t.Fragment,{children:n})}function ka({face:n,size:a,state:l}){const i=l==="thinking"||l==="working",u=l==="paused";return t.jsxs(p,{as:"span","aria-hidden":!0,"data-presence":l,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:a+8,height:a+8,flexShrink:0,fontSize:a,lineHeight:1,children:[t.jsx(p,{as:"span",position:"absolute",inset:0,borderRadius:"50%",boxShadow:u?"none":`0 0 0 2px ${wa}`,border:u?"2px dashed":"none",borderColor:"border.default",opacity:i||l==="waiting"||u?.9:0,transition:"opacity var(--theme-motion-status, 0ms) var(--theme-motion-easing, ease)",animation:i?"loopPresenceBreath 1.8s ease-in-out infinite":"none",reducedMotion:{animation:"none"},sx:{"@keyframes loopPresenceBreath":{"0%, 100%":{transform:"scale(0.92)",opacity:.35},"50%":{transform:"scale(1.06)",opacity:.9}}}}),t.jsx(p,{as:"span",display:"inline-flex",opacity:u?.55:1,filter:u?"grayscale(0.6)":"none",transition:"opacity var(--theme-motion-status, 0ms) var(--theme-motion-easing, ease)",children:t.jsx(Wn,{face:n,size:a})})]})}function ja({state:n}){return t.jsx(H,{role:"status","aria-live":"polite","data-presence-line":n,sx:{fontSize:0,color:n==="waiting"?"fg.default":"fg.muted",fontWeight:n==="waiting"?"semibold":"normal",whiteSpace:"nowrap",flexShrink:0},children:la({state:n})})}const Ia=Kt(void 0),Ea=Kt(""),Ta=Kt({}),ne="",Ra=1400,Nn=parseInt(Js["--loop-face-large"],10);function La({workspace:n}){const a=Fo(),l=Oo(),i=o.useRef(null),{setViewControls:u}=n,x=o.useRef(n.setThread);x.current=n.setThread;const y=o.useCallback(()=>{const e=i.current?.thread();return e&&x.current?.(e),e},[]),[L,W]=o.useState(null),U=_o(),f=U.getConfig(zo),St=f?.placeholder||a.placeholder,oe=f?.defaultSurface??"notebook",Ie=U.getConfig(No),[g,fe]=o.useState(ne),D=o.useRef(!1),w=N(Bo),Oe=N(Vo),yt=N(Ho),pe=N(Wo)[0]?.value,G=Nt(pe?.promptStance??Ia)??pe?.prompt,_e=N(Do),X=Go(_e[0]?.value),Z=o.useRef(X);Z.current=X;const nt=o.useRef(""),me=N(Ko),se=o.useMemo(()=>Yo(()=>me.reduce((e,r)=>({...e,...r.value.extras.value}),{})),[me]),h=Nt(me.length>0?se:Ta),ot=o.useRef(new Set),st=qo(Ys,n),ge=!st.allowed,K=ge?st.reason??"Chat is unavailable for this sandbox":void 0,[Y,he]=o.useState(!1),[Ee,at]=o.useState(!1),[Ct,Te]=o.useState(!1),[wt,k]=o.useState({open:!1,pendingApproval:!1}),q=Jo(Y,wt,f?.presence?.paused===!0),ae=f?.presence?.onPresence;o.useEffect(()=>{ae?.(q),Z.current?.setPresence(q)},[ae,q]);const ze=o.useRef(f?.presence?.onSaying);ze.current=f?.presence?.onSaying;const Re=o.useRef({answering:!1}),it=o.useCallback(e=>{i.current=e,at(!!e)},[]),$=o.useCallback(e=>{const{open:r,pendingApproval:s}=Qo(e);k(ke=>ke.open===r&&ke.pendingApproval===s?ke:{open:r,pendingApproval:s});const m={saying:Zo(e),answering:Xo(e)},d=Re.current;(d.saying?.id!==m.saying?.id||d.saying?.text!==m.saying?.text||d.answering!==m.answering)&&(Re.current=m,ze.current?.(m));const z=Z.current;if(!z)return;z.items(e);const A=new Set(["complete","completed","done","error","failed","cancelled","canceled","rejected","denied","stopped"]),J={insertcell:"adding a cell",updatecell:"editing a cell",runcell:"running a cell",deletecells:"removing cells",readallcells:"reading the notebook",readcell:"reading a cell",executecode:"running code",insertblock:"adding a block",updateblock:"editing a block",runblock:"running a block",readdocument:"reading the document"};let b;for(let ke=e.length-1;ke>=0;ke-=1){const gt=e[ke];if(typeof gt.toolName=="string"&>.toolCallId){A.has(String(gt.status).toLowerCase())||(b=gt);break}}if(!b){z.activity(void 0);return}const we=b.toolName.toLowerCase().replace(/^datalayer_/,"").replace(/_lexical$/,"").replace(/[^a-z]/g,""),vo=J[we]??`using ${b.toolName}`;z.activity(`${nt.current||"The agent"} is ${vo}…`)},[]),Ne=o.useRef(h);Ne.current=h;const be=o.useCallback(e=>{no(e),Z.current?.usage(e),Ne.current.onUsage?.(e)},[]),kt=o.useCallback(e=>{he(e),e||Z.current?.end("done")},[]),Be=o.useCallback(e=>{const r=Z.current;if(!r)return;let s=-1;for(let d=e.length-1;d>=0;d-=1)if(e[d].role==="user"){s=d;break}const m=e.slice(s+1).filter(d=>d.role==="assistant").map(es).filter(d=>d.trim().length>0).join(`
|
|
29
|
+
|
|
30
|
+
`);r.assistant(m)},[]),Ae=o.useRef([]),Ve=o.useRef(!1),B=o.useRef(void 0),ie=o.useRef(void 0),re=o.useRef(void 0),He=N(ts),le=o.useRef(He);le.current=He;const ce=o.useCallback((e,r)=>{if(ie.current)return ie.current;const s=re.current;re.current=void 0;const m=ns(le.current.map(A=>A.value),s?{...r??{},voice:s}:r),d=m?.loop;if(Ve.current&&d?.files&&d.files.length>0){const A=B.current;if(!A)return"A file is given to an application running on a runtime: run it on Datalayer or on your machine to give it one.";let J;try{J=d.files.map(b=>({file:ss(String(b.name??"")),base64:os(String(b.data_url??""))}))}catch(b){return b instanceof Error?b.message:String(b)}A.execute(as(J)).then(b=>{if(!b.success){W(`The files could not be put in the sandbox: ${b.error??"it failed"}.`);return}ce(`${e}
|
|
31
|
+
|
|
32
|
+
${is(J.map(we=>we.file))}`,{...m,loop:Object.fromEntries(Object.entries(d).filter(([we])=>we!=="files"))})});return}Z.current?.begin(e,y());const z=i.current?.send;if(!z){Ae.current.push([e,m]);return}z(e,m)},[y]);o.useEffect(()=>{u(Ee?{busy:Y,stop:i.current?.stop,newChat:i.current?.newChat,send:ce}:null)},[Y,Ee,u,ce]),o.useEffect(()=>()=>u(null),[u]),o.useEffect(()=>n.prompts.subscribe(ce),[n.prompts,ce]),o.useEffect(()=>{if(!Ee||Ae.current.length===0)return;const e=Ae.current.splice(0,Ae.current.length);for(const[r,s]of e)y(),i.current?.send(r,s)},[Ee,y]);const We=o.useRef(!1),xe=o.useCallback(async e=>{W(null);const r=await rs(Ne.current,e);if(r){r.sent?Qe(""):W(r.refused);return}We.current||(We.current=!0,Ie?.firstPromptHook?.());const s=await n.submit(e);if(!s.handled){W(s.reason??null);return}Qe(""),s.result?.content&&W(s.result.content)},[n,Ie?.firstPromptHook]),C=o.useMemo(()=>w.find(e=>e.value.surfaceId===g)?.value,[w,g]),ve=o.useCallback(e=>{D.current=!0,fe(e)},[]);o.useEffect(()=>ls(ve),[ve]),o.useEffect(()=>{cs(w.map(e=>e.value.surfaceId))},[w]),o.useEffect(()=>{ds(g&&g!==ne?g:Qs)},[g]);const V=o.useMemo(()=>oe===ne||oe==="none"?void 0:w.find(e=>e.value.surfaceId===oe),[w,oe]);o.useEffect(()=>{D.current||!V||tt(V.value,n)&&fe(oe)},[V,n,oe]);const[ee,rt]=o.useState(null),lt=o.useRef(null),Me=f?.fullScreenTopOffset??0,{fullScreen:F,usingApi:De,toggle:Ge,topOffsetPx:c}=us(lt,{forceOverlay:!!Me,topOffset:Me}),[j,M]=o.useState(!1),O=o.useRef(!1);o.useEffect(()=>{!Y||O.current||F||(O.current=!0,M(!0))},[Y,F]),o.useEffect(()=>{F&&M(!1)},[F]),o.useEffect(()=>{C&&!tt(C,n)&&(rt(C.surfaceId),fe(ne))},[C,n]);const Pe=o.useMemo(()=>{if(ee)return w.find(e=>e.value.surfaceId===ee)?.value;if(!D.current&&g===ne)return V?.value},[w,ee,g,V]);o.useEffect(()=>{if(!ee||g!==ne)return;const e=w.find(r=>r.value.surfaceId===ee);e&&tt(e.value,n)&&(rt(null),fe(ee))},[w,g,ee,n]);const I=n.agentId?.trim()||"default",R=fs(n.sandbox.target??"local");Ve.current=R;const v=ps(),te=Nt(v?.selected??Ea),S=v?.members.find(e=>e.id===te),Jt=N(ms)[0]?.value,jt=Jt?.specId,T=Pn(S?.specId??I)??(jt?Pn(jt):void 0),Ke=S?void 0:Jt,Qt=R&&!S?Ks(jt,T):void 0;nt.current=S?.name??T?.name??I;const Xt=N(gs),Zt=h.hiddenOpeners,en=h.hideOpeners,It=h.openers,Et=o.useMemo(()=>{if(en)return[];const e=new Set(Zt??[]),r=b=>e.size===0?b:b.filter(we=>!e.has(we.text));if(It)return r(It);const s=Xt.flatMap(b=>b.value.suggestions);if(s.length>0)return r(s);const m=r(T?.suggestions??[]),d=r(v?.team.suggestions??[]);if(d.length===0)return m;const z=new Set(d.map(b=>b.text)),A=v?.team.name??"Team",J=S?.name??T?.name??I;return[...d.map(b=>({...b,group:A})),...m.filter(b=>!z.has(b.text)).map(b=>({...b,group:J}))]},[Xt,v,T,S,I,Zt,en,It]),ct=o.useMemo(()=>Et.map(e=>({title:e.summary??e.text,message:e.message??e.text,group:e.group})),[Et]),Tt=Fe(T?.icon),_=f?.presence,Dn=Fe(v?.team.icon),tn=N(hs),dt=o.useMemo(()=>{const e=[],r=new Map,s=new Set,m=new Set(w.map(d=>d.value.surfaceId));for(const d of ha(tn,C?.surfaceId)){if(ba(d.value.id,m,C?.surfaceId))continue;let z;try{z=d.value.tools(n)}catch(A){console.warn(`[loop] frontend tools from '${d.plugin}' failed:`,A);continue}for(const A of z){const J=r.get(A.name);if(J){console.warn(`[loop] frontend tool '${A.name}' from '${d.plugin}' is shadowed by the one from '${J}'.`);continue}r.set(A.name,d.plugin),e.push(A),d.value.chatView&&s.add(A.name)}}for(const d of h.frontendTools??[])r.has(d.name)||(r.set(d.name,"chat-extras"),e.push(d),s.add(d.name));return C?e:ga(e,s)},[tn,n.surfaceId,n.agentId,h.frontendTools,C?.surfaceId,w]),Rt=Sa(),Ye=o.useMemo(()=>{if(Rt.length===0)return dt;const e=new Set(dt.map(r=>r.name));return[...dt,...Rt.filter(r=>!e.has(r.name))]},[dt,Rt]),nn=Vn(),At=h.agentToolBundles,Gn=o.useMemo(()=>{const e=h.frontendTools??[];if(!At?.length)return h.frontendTools;const r=Hn(nn.filter(m=>At.includes(m.id)),U),s=new Set(e.map(m=>m.name));return[...e,...r.filter(m=>!s.has(m.name))]},[h.frontendTools,At,nn,U]);B.current=R&&Ye.some(e=>e.name===bs)?U.getOutput(xt)?.sandbox:void 0;const E=xs(n.sandbox,n.serverUrl),on=N(vs),Kn=o.useMemo(()=>on.filter(e=>e.value.composer).map(e=>({name:e.value.name,description:e.value.description})),[on]),Yn=o.useMemo(()=>{if(!v||!S)return zn(T).map(s=>({name:s.name,description:s.description,icon:Fe(s.icon)}));const e=v.members.map(s=>({name:s.name,description:s.description,emoji:s.emoji,icon:Fe(s.icon),disabled:s.id===S.id,disabledReason:s.id===S.id?`You are already talking to ${s.name}`:void 0})),r=Un(v.team,S.id).filter(s=>!v.members.some(m=>m.name===s.name)).map(s=>({name:s.name,description:s.description,icon:Fe(s.icon)}));return[...e,...r]},[v,S,T]),{inference:sn,anonymous:qn}=ua(R),Jn=Gt(e=>e.user),Mt=R&&qn.status==="expired",an=!Jn,qe=Ss();ie.current=qe.disabled?qe.disableReason||"This conversation is closed here.":void 0;const Pt=E===void 0?ys(n.sandbox,a):void 0,Je=ge||Mt||!!Qt||!!Pt||qe.disabled,rn=Mt?an?a.demoKeyExpired:a.keyExpired:Qt??Pt??K??(qe.disabled?qe.disableReason:void 0),[Ut,Qe]=o.useState(""),[ln]=Cs(),Xe=o.useMemo(()=>f?.voice?ws(f.voice,ln):void 0,[f?.voice,ln]),[Qn,Xn]=o.useState(!1),[Zn,cn]=o.useState(),ut=Zn??Ke?.model??T?.model??n.model??"",Ue=ks(),dn=o.useRef(Ue),un=o.useRef(te),fn=o.useRef(Ue);fn.current=Ue,o.useEffect(()=>{un.current!==te&&(un.current=te,dn.current=fn.current,cn(void 0))},[te]);const eo=Ue&&Ue!==dn.current?Ue:null,[to,no]=o.useState(),oo=eo??to??null,so=Bt(je.inpromptMenu),pn=Bt(je.promptAction),mn=Bt(je.chatHeader),ao=o.useMemo(()=>v?.members.map(e=>({id:e.id,name:e.name,description:e.description,icon:Fe(e.icon)}))??[],[v]),Se=_n(e=>e.pending),[gn,io]=o.useState(0);o.useEffect(()=>js(()=>io(e=>e+1)),[]),o.useEffect(()=>{Se&&(Qe(Se.text),_n.getState().consume(),Se.submit&&xe(Se.text))},[Se]);const hn=U.getConfig(xt)?.datalayerCreatePayload,ye=!!(Ke?.createPayload?.app_spec||hn?.app_spec),Lt=ya(hn),ro=Gt(e=>e.token),$t=U.getConfig(xt)?.datalayerVisitors,lo=Is($t),co=U.getConfig(xt)?.embedToken,Ce=$t?lo.token:co||ro,uo=o.useMemo(()=>Es(f?.voice,Ce||void 0),[f?.voice,Ce]),de=!!(Lt||$t);if(de&&!ye)throw new Error("A deployment’s page runs its application: its host gave no app_spec.");const[bn]=o.useState(Ln),P=o.useMemo(()=>Ca(f?.thread,Lt,bn),[f?.thread,Lt,bn]),[Le,xn]=o.useState(null),fo=!!(P?.fromRuntime&&Le?.given!==P.id);o.useEffect(()=>{if(!P?.fromRuntime||!ye||!E)return;let e=!0;return(async()=>{let r="";for(let s=0;s<4&&e;s+=1)try{const m=await Ts({agentBaseUrl:E,agentId:I,uid:P.id,token:Ce});e&&xn({given:P.id,thread:{...P,fromRuntime:!1,messages:m}});return}catch(m){r=m instanceof Error?m.message:String(m),await new Promise(d=>setTimeout(d,1500))}e&&xn({given:P.id,thread:{id:Ln(),messages:[],onStarted:P.onStarted},said:$n.notOpened(r)})})(),()=>{e=!1}},[P?.id,P?.fromRuntime,ye,E,I,Ce]);const vn=P?.fromRuntime?Le?.given===P.id?Le.thread:void 0:P,Ft=o.useMemo(()=>R?ra({agentId:S?.specId??I,instructions:Rs(T,Ke?.instructions),model:ut||void 0,inference:sn,frontendTools:Ye,subagents:v&&S?Un(v.team,S.id):zn(T),sharing:v?.sharing,onSubagentEvent:e=>qs.getState().appendSubagentEvent(e),modeEffect:Ke?.modeEffect}):E!==void 0?{type:"ag-ui",endpoint:ye?`${E}/api/v1/apps/agents/${encodeURIComponent(I)}/ag-ui/`:`${E}/api/v1/ag-ui/${I}/`,...ye&&Ce?{authToken:Ce}:{},...ye?{uiSocket:`${E.replace(/^http/,"ws")}/api/v1/apps/ui`,uiFiles:`${E}/api/v1/apps/agents/${encodeURIComponent(I)}/files`,appSessions:`${E}/api/v1/apps/sessions`,...de?{ownRoutesOnly:!0}:{}}:{},agentId:I,configEndpoint:`${E}/api/v1/configure`,enableConfigQuery:!0}:void 0,[I,R,sn,S,Ye,v,T,Ke,ut,E,ye,Ce,de]),ft=As(!R,Ft?.type==="ag-ui"?Ft.configEndpoint:void 0,void 0,I),Ze=Ms(),pt=Ps(I),[Sn,Ot]=o.useState(void 0),[po,mo]=o.useState(void 0);o.useEffect(()=>{if(R||E===void 0)return;const e=Us(E,I,de);if(!e){Ot([]);return}let r=!1;return fetch(e).then(s=>s.ok?s.json():null).then(s=>{r||(Ot(s?Ls(s):[]),mo(s?$s(s):void 0))}).catch(()=>{r||Ot([])}),()=>{r=!0}},[E,I,R,de]);const go=o.useMemo(()=>Fs(Sn,()=>Object.values(Os).filter(e=>e.available&&_s(e)).map(e=>({id:e.id,name:e.name,provider:e.provider}))),[Sn]),yn=o.useMemo(()=>{const e=ft.data?.builtinTools??[],r=new Set(e.map(s=>s.name));return{runtime:e,frontend:Ye.filter(s=>!r.has(s.name)).map(s=>({id:s.name,name:s.name}))}},[ft.data?.builtinTools,Ye]),Cn=o.useMemo(()=>new Set((Ze.data?.skills??[]).filter(e=>e.status==="enabled"||e.status==="loaded").map(e=>e.id)),[Ze.data]),ho=o.useCallback(async e=>{if(de)throw new Error("A deployment’s chat does not switch its runtime’s model.");cn(e),!(R||E===void 0)&&await fetch(`${E}/api/v1/configure/inference/provider`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({model:e})}).catch(()=>{})},[E,R,de]),wn=f?.promptPlacement==="bottom-chat",bo=f?.promptPlacement==="floating",$e=f?.promptPlacement==="top",et=f?.hidePrompt===!0||h.hidePrompt===!0,xo={onSend:()=>{xe(Ut)},input:Ut,setInput:Qe,focusTrigger:Se||gn?(Se?.nonce??0)+gn:void 0,placement:bo||G==="floating"||G==="floating-top"||G==="floating-bottom"?"floating":"docked",floatingAnchor:G==="floating-top"?"top":"bottom",isLoading:Y,onStop:()=>n.viewControls.stop?.(),placeholder:rn??h.sendInstead?.says??St,typingSuggestions:Et.map(e=>e.text),suggestions:ct,disableInputPrompt:Je,connectionConfirmed:!Je,interim:Qn,padding:$e||G==="floating-top"||G==="floating-bottom"||G==="docked-top"?2:3,promptVariant:"lexical",autoFocus:f?.autoFocusPrompt??!0,mentionableAgents:Yn,promptCommands:Kn,headerContent:so.length>0?t.jsx(vt,{slot:je.inpromptMenu,props:{workspace:n}}):void 0,footerExtras:pn.length>0||Xe&&Xe.input!=="off"?t.jsxs(t.Fragment,{children:[pn.length>0?t.jsx(vt,{slot:je.promptAction,props:{workspace:n}}):null,Xe&&Xe.input!=="off"?t.jsx(zs,{voice:Xe,input:Ut,setInput:Qe,disabled:Je,speaking:Ct,onStopSpeaking:()=>i.current?.stopSpeaking?.(),playbackLevel:()=>i.current?.voiceLevel?.()??0,running:Y,onStopRun:()=>i.current?.stop?.(),onInterrupted:()=>i.current?.markInterrupted(),onInterimChange:Xn,answers:!!(f?.voice?.output&&f.voice.output!=="off"&&f.voice.speechUrl),onSpoken:e=>{re.current=e},send:(e,r)=>{re.current=r,xe(e)}}):null]}):void 0,showAgentsMenu:!_,showInlineAgentsMenu:!1,agents:ao,selectedAgentId:te,onSelectAgent:e=>v?.select(e),showTokenUsage:h.showTokenUsage??f?.showTokenUsage??!0,showContextRing:!0,agentUsage:oo??void 0,showModelSelector:!_&&!de,models:go,decisions:po,selectedModel:ut,onModelSelect:e=>{ho(e)},showToolsMenu:!_,availableTools:yn.runtime,availableFrontendTools:yn.frontend,mcpServers:ft.data?.mcpServers??[],mcpStatusData:h.mcpStatusData??void 0,showSkillsMenu:!_,skills:Ze.data?.skills??[],skillsLoading:Ze.isLoading,enabledSkills:Cn,onToggleSkill:e=>Cn.has(e)?pt.disableSkill(e):pt.enableSkill(e),onToggleAllSkills:(e,r)=>e.forEach(s=>r?pt.enableSkill(s):pt.disableSkill(s)),codemodeEnabled:h.codemodeEnabled??!1,onToggleCodemode:h.onToggleCodemode,isA2AProtocol:!1,hasConfigData:!!ft.data,hasSkillsData:!!Ze.data},kn=Oe[0]?.value.Component,_t=yt[0]?.value.Component,jn=!f?.hideHeader&&!!_t,mt=kn?t.jsx(kn,{workspace:n,composer:xo}):null,In=w.length>0&&f?.showSurfaceSelector!==!1?t.jsx(Aa,{surfaces:w.map(e=>e.value),active:C?.surfaceId??Pe?.surfaceId??ne,onChange:ve,workspace:n}):null,En=t.jsxs(t.Fragment,{children:[w.map(e=>{const r=e.value,s=C?.surfaceId===r.surfaceId;return s||ot.current.has(r.surfaceId)||tt(r,n)?(ot.current.add(r.surfaceId),t.jsx(p,{sx:s?{flex:"1 1 0",minWidth:0,minHeight:0}:{position:"absolute",inset:0,visibility:"hidden",pointerEvents:"none",zIndex:-1},children:t.jsx(Ns,{load:r.load,props:{surfaceId:r.surfaceId,workspace:n},fallback:t.jsxs(Wt,{children:["Loading ",r.title,"…"]}),errorFallback:d=>t.jsxs(Wt,{children:[r.title," failed to load: ",d.message]})})},r.surfaceId)):null}),!C&&Pe?t.jsx(p,{flex:"1 1 0",minWidth:0,minHeight:0,children:t.jsxs(Wt,{children:["Starting ",Pe.title,"…"]})}):null]}),Tn=t.jsx(t.Fragment,{children:t.jsxs(p,{flex:$e&&C?"0 0 34%":"1 1 0",maxWidth:$e&&C?460:void 0,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",borderLeft:C?"1px solid":void 0,borderColor:"border.default",position:"relative",children:[h.errorBanner?t.jsx(p,{flexShrink:0,px:3,py:2,fontSize:1,borderBottom:"1px solid",bg:h.errorBanner.variant==="warning"?"attention.subtle":"danger.subtle",color:h.errorBanner.variant==="warning"?"attention.fg":"danger.fg",borderColor:h.errorBanner.variant==="warning"?"attention.muted":"danger.muted",children:h.errorBanner.message}):null,Le?.said&&Le.given===P?.id?t.jsx(H,{as:"p",role:"status",sx:{m:0,px:3,py:2,fontSize:1,color:"fg.muted"},children:Le.said}):null,t.jsx(p,{flex:"1 1 auto",minHeight:0,display:"flex",children:fo?t.jsx(H,{as:"p",role:"status",sx:{m:0,p:3,fontSize:1,color:"fg.muted"},children:$n.opening}):t.jsx(Bs,{themeVariant:f?.themeVariant,themeOverrides:f?.themeOverrides,colorMode:f?.colorMode,thread:vn,voice:uo,disabled:Je,disableReason:rn,protocol:Ft,frontendTools:R?void 0:Gn,initialModel:ut||void 0,title:_?.name??S?.name??T?.name??I,description:_?.welcome??T?.description,brandIcon:_?.face?t.jsx(ka,{face:_.face,size:20,state:q}):t.jsx(Tt,{size:20}),headerContent:_&&!Pt?t.jsx(ja,{state:q}):void 0,emptyState:{icon:_?.face?t.jsx("span",{"aria-hidden":!0,style:{fontSize:Nn,lineHeight:1},children:t.jsx(Wn,{face:_.face,size:Nn})}):t.jsx(Tt,{size:48}),title:_?.name??S?.name??T?.name??I,...v&&S?{sections:[{group:v.team.name,icon:t.jsx(Dn,{size:48}),title:v.team.name,subtitle:v.team.description},{group:S.name,icon:t.jsx(Tt,{size:32}),title:S.name,subtitle:T?.description}]}:null},suggestions:$e||pe||f?.suggestionLabels===!1?[]:ct,showHeader:jn,headerButtons:{showNewChat:f?.headerButtons?.newChat??!1,showClear:f?.headerButtons?.clear??!1},renderHeader:_t?e=>t.jsx(_t,{workspace:n,header:n.chatViewModes?{...e,chatViewMode:n.chatViewModes.value,onChatViewModeChange:n.chatViewModes.onChange,offeredViewModes:n.chatViewModes.offered}:e}):void 0,showInformation:!0,headerActions:t.jsxs(p,{display:"inline-flex",alignItems:"center",gap:2,children:[n.chatHeaderActions,mn.length>0?t.jsx(vt,{slot:je.chatHeader,props:{workspace:n}}):null,t.jsx(Vs,{icon:F?Hs:Ws,"aria-label":F?"Exit full screen":"Enter full screen",variant:"invisible",size:"small",onClick:()=>{M(!1),Ge()},sx:j?{"@keyframes dla-fullscreen-hint":{"0%, 100%":{opacity:1},"50%":{opacity:.4}},"&&":{bg:`color-mix(in srgb, ${l.primary} 16%, transparent)`,boxShadow:`inset 0 0 0 1.5px ${l.primary}`,animation:`dla-fullscreen-hint ${Ra}ms ease-in-out infinite`},"@media (prefers-reduced-motion: reduce)":{"&&":{animation:"none"}}}:void 0})]}),showInput:!1,onSendReady:it,notebookToolSurfacesId:C?void 0:n.surfaceId,showTurnFooter:h.showTokenUsage??f?.showTokenUsage??!0,onContextSnapshot:be,onLoadingChange:kt,onSpeakingChange:Te,onItemsChange:Be,onDisplayItemsChange:$,enableStreaming:!0},vn?.id)}),!jn&&mn.length>0?t.jsx(p,{hidden:!0,children:t.jsx(vt,{slot:je.chatHeader,props:{workspace:n}})}):null,wn&&!et?mt:null]})}),Rn=f?.suggestionLabels!==!1&&ct.length>0?t.jsx(p,{"aria-label":a.suggestedPrompts,display:"flex",flexWrap:"wrap",gap:2,px:2,pb:"6px",children:ct.map(e=>t.jsx(p,{as:"button",type:"button",title:e.message,disabled:Y||Je,onClick:()=>{xe(e.message)},appearance:"none",font:"inherit",fontSize:0,fontWeight:"semibold",lineHeight:1.25,px:"10px",py:"5px",width:Fn,flex:`0 0 ${Fn}px`,borderRadius:"999px",border:"1px solid",bg:"canvas.subtle",whiteSpace:"nowrap",sx:{borderColor:"border.default",color:"fg.default",cursor:"pointer","&:hover:not(:disabled)":{borderColor:"accent.fg",color:"accent.fg"},"&:disabled":{opacity:.5,cursor:"default"}},children:t.jsx(Ds,{title:e.title,maxWidth:"100%",sx:{minWidth:0},children:e.title})},e.title))}):null,An=L?t.jsx(p,{flex:"0 0 auto",px:3,py:2,borderTop:"1px solid",borderColor:"border.default",bg:"canvas.subtle",fontSize:1,maxHeight:"40%",overflowY:"auto",children:L}):null;return t.jsxs(p,{ref:lt,sx:{height:"100%",minHeight:0,display:"flex",flexDirection:"column",position:"relative",...F?{bg:"canvas.default"}:null,...F&&!De.current?{position:"fixed",top:c,right:0,bottom:0,left:0,height:"auto",zIndex:1e3}:null},children:[pe?t.jsx(pe.Component,{workspace:n,editors:En,hasEditor:!!C,transcript:Tn,prompt:et?null:mt,chips:et?null:Rn,picker:In,transient:An}):t.jsxs(t.Fragment,{children:[$e&&!et?t.jsxs(p,{flex:"0 0 auto",borderBottom:"1px solid",borderColor:"border.default",children:[mt,Rn]}):null,In,t.jsxs(p,{flex:"1 1 auto",minHeight:0,display:"flex",position:"relative",children:[En,Tn]}),An,wn||et||$e?null:mt]}),Mt?t.jsx(p,{position:"absolute",inset:0,zIndex:5,bg:"canvas.default",display:"flex",flexDirection:"column",minHeight:0,children:t.jsx(ca,{agentName:S?.name??T?.name,sandboxStillRuns:R,temporary:an,onSignedIn:()=>Gs.getState().clear()})}):null]})}function Aa({surfaces:n,active:a,onChange:l,workspace:i}){const u=[...n].sort((x,y)=>(x.order??100)-(y.order??100));return t.jsxs(p,{flex:"0 0 auto",display:"flex",alignItems:"center",gap:2,px:3,py:2,borderBottom:"1px solid",borderColor:"border.default",children:[t.jsx(H,{sx:{fontSize:0,color:"fg.muted"},children:"Beside the chat"}),t.jsxs(Vt,{"aria-label":"Editor beside the chat",size:"small",children:[t.jsx(Vt.Button,{selected:a===ne,onClick:()=>l(ne),children:"Chat"}),u.map(x=>{const y=tt(x,i),L=y?void 0:x.unavailableReason?.(i)??"Not available right now";return t.jsx(Vt.Button,{selected:a===x.surfaceId,"aria-disabled":!y,title:L??x.title,leadingIcon:x.icon,onClick:()=>{y&&l(x.surfaceId)},children:x.title},x.surfaceId)})]})]})}function Wt({children:n}){return t.jsx(p,{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"fg.muted",fontSize:1,px:3,textAlign:"center",children:n})}export{La as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jm as je,jn as We,jo as Qe,jp as Ke,jq as Xe,jr as Ze,js as Je,jt as et,ju as xe,r as Q,j as S,ar as br,_ as fr,jv as Tr,K as vr,bW as Cr,I as yr,bX as Rr,D as Nr,f4 as Or,bi as da,T as Ar}from"../datalayer-app-main.js";import{x as Ir,B as xr,N as Dr}from"./JupyterLexicalExtension-r47Jyrrd.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./url-DuKx0yk0.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-CGQDY041.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./PrismCss-CcU1ChRk.js";import"./Output-no9rnFJ7.js";import"./index-CFP9psRB.js";import"./hoverbox-CStlKQWE.js";import"./index-DSN70XMH.js";import"./index-S4sn4R3i.js";import"./color-CG7_7V2-.js";import"./isEqual-g-jK7vY0.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";import"./LexicalToolRegistry-8wJyLumb.js";const _a={datalayer:{light:{primary:xe.greenAccent,secondary:xe.greenText,textColor:xe.gray,primaryGradient:[xe.greenAccent,xe.greenBrand],secondaryGradient:[xe.greenHover,xe.greenBrand]},dark:{primary:xe.greenBright,secondary:xe.greenAccent,textColor:xe.gray,primaryGradient:[xe.greenAccent,xe.greenBrand],secondaryGradient:[xe.greenHover,xe.greenText]}},spatial:{light:{primary:et.indigoBrand,secondary:et.indigoText,textColor:et.gray,primaryGradient:[et.indigoBright,et.indigoBrand],secondaryGradient:[et.indigoHover,et.indigoAccent]},dark:{primary:et.indigoBright,secondary:et.indigoAccent,textColor:et.gray,primaryGradient:[et.indigoBright,et.indigoBrand],secondaryGradient:[et.indigoHover,et.indigoAccent]}},lovely:{light:{primary:Je.roseBrand,secondary:Je.roseText,textColor:Je.gray,primaryGradient:[Je.roseBright,Je.roseBrand],secondaryGradient:[Je.roseHover,Je.roseAccent]},dark:{primary:Je.roseBright,secondary:Je.roseAccent,textColor:Je.gray,primaryGradient:[Je.roseBright,Je.roseBrand],secondaryGradient:[Je.roseHover,Je.roseAccent]}},matrix:{light:{primary:Ze.greenBrand,secondary:Ze.greenText,textColor:Ze.gray,primaryGradient:[Ze.greenGlow,Ze.greenBrand],secondaryGradient:[Ze.greenHover,Ze.greenAccent]},dark:{primary:Ze.greenGlow,secondary:Ze.greenPhosphor,textColor:Ze.gray,primaryGradient:[Ze.greenGlow,Ze.greenBrand],secondaryGradient:[Ze.greenHover,Ze.greenAccent]}},earth:{light:{primary:Xe.oceanBrand,secondary:Xe.oceanText,textColor:Xe.gray,primaryGradient:[Xe.oceanAccent,Xe.oceanBrand],secondaryGradient:[Xe.oceanHover,Xe.oceanText]},dark:{primary:Xe.oceanBright,secondary:Xe.oceanAccent,textColor:Xe.gray,primaryGradient:[Xe.oceanBright,Xe.oceanBrand],secondaryGradient:[Xe.oceanHover,Xe.oceanAccent]}},sand:{light:{primary:Ke.sandBrand,secondary:Ke.sandText,textColor:Ke.gray,primaryGradient:[Ke.sandAccent,Ke.sandBrand],secondaryGradient:[Ke.sandHover,Ke.sandText]},dark:{primary:Ke.sandBright,secondary:Ke.sandAccent,textColor:Ke.gray,primaryGradient:[Ke.sandBright,Ke.sandBrand],secondaryGradient:[Ke.sandHover,Ke.sandAccent]}},ivory:{light:{primary:Qe.ivoryBrand,secondary:Qe.ivoryText,textColor:Qe.gray,primaryGradient:[Qe.ivoryAccent,Qe.ivoryBrand],secondaryGradient:[Qe.ivoryHover,Qe.ivoryText]},dark:{primary:Qe.ivoryBright,secondary:Qe.ivoryAccent,textColor:Qe.gray,primaryGradient:[Qe.ivoryBright,Qe.ivoryBrand],secondaryGradient:[Qe.ivoryHover,Qe.ivoryAccent]}},sun:{light:{primary:We.sunBrand,secondary:We.sunText,textColor:We.gray,primaryGradient:[We.sunAccent,We.sunBrand],secondaryGradient:[We.sunHover,We.sunText]},dark:{primary:We.sunBright,secondary:We.sunAccent,textColor:We.gray,primaryGradient:[We.sunBright,We.sunBrand],secondaryGradient:[We.sunHover,We.sunAccent]}},loop:{light:{primary:je.loopAccent,secondary:je.ink,textColor:je.gray,primaryGradient:[je.loopAccent,je.loopAccent],secondaryGradient:[je.ink,je.ink]},dark:{primary:je.loopBrand,secondary:je.inkDark,textColor:je.grayDark,primaryGradient:[je.loopBrand,je.loopBrand],secondaryGradient:[je.inkDark,je.inkDark]}}};function Ya(i="datalayer",t="light"){const n=t==="auto"?"light":t;return _a[i]?.[n]??_a.datalayer.light}const ua=25,wr=[{y:0,secondaryWidth:30,primaryWidth:70},{y:37.5,secondaryWidth:50,primaryWidth:50},{y:75,secondaryWidth:70,primaryWidth:30}];Q.forwardRef(function({size:t=16,variant:n="datalayer",colorMode:e="light",primaryColor:a,secondaryColor:r,primaryGradient:s,secondaryGradient:o,gradient:l=!0,...c},d){const _=Ya(n,e),u=a??_.primary,m=r??_.secondary,p=Q.useId().replace(/:/g,""),[g,b]=s??_.primaryGradient,[C,y]=o??_.secondaryGradient;return S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:t,height:t,"aria-hidden":"true",ref:d,...c,children:[l&&S.jsxs("defs",{children:[S.jsxs("linearGradient",{id:`${p}-p`,x1:"0",y1:"0",x2:"1",y2:"0",children:[S.jsx("stop",{offset:"0",stopColor:g}),S.jsx("stop",{offset:"1",stopColor:b})]}),S.jsxs("linearGradient",{id:`${p}-s`,x1:"0",y1:"0",x2:"1",y2:"0",children:[S.jsx("stop",{offset:"0",stopColor:C}),S.jsx("stop",{offset:"1",stopColor:y})]})]}),wr.map(({y:N,secondaryWidth:O,primaryWidth:v})=>S.jsxs("g",{children:[S.jsx("rect",{x:0,y:N,width:O,height:ua,fill:l?`url(#${p}-p)`:u}),S.jsx("rect",{x:O,y:N,width:v,height:ua,fill:l?`url(#${p}-s)`:m})]},N))]})});const Ha=new Map,On=i=>Ha.get(i),an=i=>Ha.has(i),kr=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|==[^=]+==)/g,ie=i=>i.split(kr).map((t,n)=>{const e=`${n}-${t}`;if(t.startsWith("**")&&t.endsWith("**"))return S.jsx("strong",{children:ie(t.slice(2,-2))},e);if(t.startsWith("`")&&t.endsWith("`"))return S.jsx("code",{children:t.slice(1,-1)},e);if(t.startsWith("==")&&t.endsWith("=="))return S.jsx("mark",{className:"dla-alert",children:t.slice(2,-2)},e);const a=/^\[([^\]]+)\]\(([^)]+)\)$/.exec(t);return a?S.jsx("a",{href:a[2],target:"_blank",rel:"noopener noreferrer",children:a[1]},e):t}),Mr=i=>i.trim().split(/\n\s*\n/).map((t,n)=>S.jsx("p",{children:ie(t.trim())},`${n}-${t.slice(0,24)}`)),Lr=()=>{const{theme:i,colorMode:t}=br();return{theme:i,colorMode:t}},Pr={useTheme:Lr},Fr=Q.createContext(Pr),Va=()=>Q.useContext(Fr),za=()=>{const{useTheme:i}=Va();return i()},An=({footer:i,theme:t,index:n,total:e})=>{const{colorMode:a,theme:r}=za(),{Logo:s}=Va(),o=a==="auto"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a,l=Ya(r,o),c=new Date().getFullYear(),d=i.since&&i.since<c?`${i.since}–${c}`:`${c}`;return S.jsxs("div",{className:"dla-slide-footer",children:[i.logo&&S.jsx("a",{className:"dla-slide-footer-logo",href:i.href,target:"_blank",rel:"noopener noreferrer","aria-label":`${i.holder} — ${i.href}`,children:s?S.jsx(s,{height:26,variant:r,colorMode:a,inverse:t.logo.inverse,colored:t.logo.colored,primaryColor:t.logo.primaryColor??l.primary,secondaryColor:t.logo.secondaryColor??l.secondary,textColor:t.logo.textColor??l.textColor}):S.jsx("span",{className:"dla-slide-footer-holder",children:i.holder})}),i.note&&S.jsx("div",{className:"dla-slide-footer-note",children:i.note}),S.jsxs("div",{className:"dla-slide-footer-legal",children:[S.jsx("a",{href:i.href,target:"_blank",rel:"noopener noreferrer",children:i.href.replace(/^https?:\/\//,"")}),S.jsxs("span",{children:["© ",d," ",i.holder]}),i.slideNumbers&&S.jsxs("span",{className:"dla-slide-footer-number",children:[n," / ",e]})]})]})},In=({name:i})=>{if(!i)return null;const t=On(i);return t?S.jsx("div",{className:"dla-slide-backdrop","aria-hidden":!0,children:S.jsx(t,{})}):null},Le=({theme:i,footer:t,index:n,total:e,eyebrow:a,title:r,subtitle:s,layout:o,variant:l,backdrop:c,children:d})=>{const _=["dla-slide"];return l&&_.push(`dla-slide--${l}`),(o==="centered"||o==="full-bleed")&&_.push(`dla-slide--${o}`),S.jsxs("div",{className:_.join(" "),children:[S.jsx(In,{name:c}),S.jsxs("div",{className:"dla-slide-head",children:[a&&S.jsx("div",{className:"dla-slide-eyebrow",children:a}),r&&S.jsx("h2",{className:"dla-slide-title",children:ie(r)}),s&&S.jsx("p",{className:"dla-slide-subtitle",children:ie(s)})]}),S.jsx("div",{className:"dla-slide-body",children:d}),t&&S.jsx(An,{footer:t,theme:i,index:n,total:e})]})};var jt=(i,t)=>{for(let n in t)i[n]=t[n];return i},j=(i,t)=>Array.from(i.querySelectorAll(t)),Mn=(i,t,n)=>{n?i.classList.add(t):i.classList.remove(t)},$t=i=>{if(typeof i=="string"){if(i==="null")return null;if(i==="true")return!0;if(i==="false")return!1;if(i.match(/^-?[\d\.]+$/))return parseFloat(i)}return i},Rt=(i,t)=>{i.style.transform=t},Cn=(i,t)=>{let n=i.matches||i.matchesSelector||i.msMatchesSelector;return!!(n&&n.call(i,t))},De=(i,t)=>{if(i&&typeof i.closest=="function")return i.closest(t);for(;i;){if(Cn(i,t))return i;i=i.parentElement}return null},qa=i=>{i=i||document.documentElement;let t=i.requestFullscreen||i.webkitRequestFullscreen||i.webkitRequestFullScreen||i.mozRequestFullScreen||i.msRequestFullscreen;t&&t.apply(i)},Ur=(i,t,n,e="")=>{let a=i.querySelectorAll("."+n);for(let s=0;s<a.length;s++){let o=a[s];if(o.parentNode===i)return o}let r=document.createElement(t);return r.className=n,r.innerHTML=e,i.appendChild(r),r},Hn=i=>{let t=document.createElement("style");return i&&i.length>0&&t.appendChild(document.createTextNode(i)),document.head.appendChild(t),t},pa=()=>{let i={};location.search.replace(/[A-Z0-9]+?=([\w\.%-]*)/gi,t=>{let n=t.split("=").shift(),e=t.split("=").pop();return n&&e!==void 0&&(i[n]=e),t});for(let t in i){let n=i[t];i[t]=$t(unescape(n))}return i.dependencies!==void 0&&delete i.dependencies,i},Br=(i,t=0)=>{if(i){var n;let e,a=i.style.height;return i.style.height="0px",i.parentElement&&(i.parentElement.style.height="auto"),e=t-(((n=i.parentElement)==null?void 0:n.offsetHeight)||0),i.style.height=a+"px",i.parentElement&&i.parentElement.style.removeProperty("height"),e}return t},Gr={mp4:"video/mp4",m4a:"video/mp4",ogv:"video/ogg",mpeg:"video/mpeg",webm:"video/webm"},Yr=(i="")=>{let t=i.split(".").pop();return t?Gr[t]:void 0},Hr=(i="")=>encodeURI(i).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),$a=navigator.userAgent,Lt=/(iphone|ipod|ipad|android)/gi.test($a)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,ja=/android/gi.test($a),Vr=(function(i){if(i){var t=function(R){return[].slice.call(R)},n=0,e=1,a=2,r=3,s=[],o=null,l="requestAnimationFrame"in i?function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{sync:!1};i.cancelAnimationFrame(o);var U=function(){return d(s.filter((function(z){return z.dirty&&z.active})))};if(R.sync)return U();o=i.requestAnimationFrame(U)}:function(){},c=function(R){return function(U){s.forEach((function(z){return z.dirty=R})),l(U)}},d=function(R){R.filter((function(z){return!z.styleComputed})).forEach((function(z){z.styleComputed=p(z)})),R.filter(g).forEach(b);var U=R.filter(m);U.forEach(u),U.forEach((function(z){b(z),_(z)})),U.forEach(C)},_=function(R){return R.dirty=n},u=function(R){R.availableWidth=R.element.parentNode.clientWidth,R.currentWidth=R.element.scrollWidth,R.previousFontSize=R.currentFontSize,R.currentFontSize=Math.min(Math.max(R.minSize,R.availableWidth/R.currentWidth*R.previousFontSize),R.maxSize),R.whiteSpace=R.multiLine&&R.currentFontSize===R.minSize?"normal":"nowrap"},m=function(R){return R.dirty!==a||R.dirty===a&&R.element.parentNode.clientWidth!==R.availableWidth},p=function(R){var U=i.getComputedStyle(R.element,null);return R.currentFontSize=parseFloat(U.getPropertyValue("font-size")),R.display=U.getPropertyValue("display"),R.whiteSpace=U.getPropertyValue("white-space"),!0},g=function(R){var U=!1;return!R.preStyleTestCompleted&&(/inline-/.test(R.display)||(U=!0,R.display="inline-block"),R.whiteSpace!=="nowrap"&&(U=!0,R.whiteSpace="nowrap"),R.preStyleTestCompleted=!0,U)},b=function(R){R.element.style.whiteSpace=R.whiteSpace,R.element.style.display=R.display,R.element.style.fontSize=R.currentFontSize+"px"},C=function(R){R.element.dispatchEvent(new CustomEvent("fit",{detail:{oldValue:R.previousFontSize,newValue:R.currentFontSize,scaleFactor:R.currentFontSize/R.previousFontSize}}))},y=function(R,U){return function(z){R.dirty=U,R.active&&l(z)}},N=function(R){return function(){s=s.filter((function(U){return U.element!==R.element})),R.observeMutations&&R.observer.disconnect(),R.element.style.whiteSpace=R.originalStyle.whiteSpace,R.element.style.display=R.originalStyle.display,R.element.style.fontSize=R.originalStyle.fontSize}},O=function(R){return function(){R.active||(R.active=!0,l())}},v=function(R){return function(){return R.active=!1}},A=function(R){R.observeMutations&&(R.observer=new MutationObserver(y(R,e)),R.observer.observe(R.element,R.observeMutations))},M={minSize:16,maxSize:512,multiLine:!0,observeMutations:"MutationObserver"in i&&{subtree:!0,childList:!0,characterData:!0}},F=null,Y=function(){i.clearTimeout(F),F=i.setTimeout(c(a),B.observeWindowDelay)},x=["resize","orientationchange"];return Object.defineProperty(B,"observeWindow",{set:function(R){var U=`${R?"add":"remove"}EventListener`;x.forEach((function(z){i[U](z,Y)}))}}),B.observeWindow=!0,B.observeWindowDelay=100,B.fitAll=c(r),B}function K(R,U){var z=Object.assign({},M,U),Z=R.map((function(te){var se=Object.assign({},z,{element:te,active:!0});return(function(ae){ae.originalStyle={whiteSpace:ae.element.style.whiteSpace,display:ae.element.style.display,fontSize:ae.element.style.fontSize},A(ae),ae.newbie=!0,ae.dirty=!0,s.push(ae)})(se),{element:te,fit:y(se,r),unfreeze:O(se),freeze:v(se),unsubscribe:N(se)}}));return l(),Z}function B(R){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return typeof R=="string"?K(t(document.querySelectorAll(R)),U):K([R],U)[0]}})(typeof window>"u"?null:window);function ln(i){"@babel/helpers - typeof";return ln=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ln(i)}function zr(i,t){if(ln(i)!="object"||!i)return i;var n=i[Symbol.toPrimitive];if(n!==void 0){var e=n.call(i,t);if(ln(e)!="object")return e;throw TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function qr(i){var t=zr(i,"string");return ln(t)=="symbol"?t:t+""}function Kn(i,t,n){return(t=qr(t))in i?Object.defineProperty(i,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[t]=n,i}var $r=class{constructor(t){Kn(this,"allowedToPlayAudio",null),this.Reveal=t,this.startEmbeddedMedia=this.startEmbeddedMedia.bind(this),this.startEmbeddedIframe=this.startEmbeddedIframe.bind(this),this.preventIframeAutoFocus=this.preventIframeAutoFocus.bind(this),this.ensureMobileMediaPlaying=this.ensureMobileMediaPlaying.bind(this),this.failedAudioPlaybackTargets=new Set,this.failedVideoPlaybackTargets=new Set,this.failedMutedVideoPlaybackTargets=new Set,this.renderMediaPlayButton()}renderMediaPlayButton(){this.mediaPlayButton=document.createElement("button"),this.mediaPlayButton.className="r-overlay-button r-media-play-button",this.mediaPlayButton.addEventListener("click",()=>{this.resetTemporarilyMutedMedia(),new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(t=>{this.startEmbeddedMedia({target:t})}),this.clearMediaPlaybackErrors()})}shouldPreload(t){if(this.Reveal.isScrollView())return!0;let n=this.Reveal.getConfig().preloadIframes;return typeof n!="boolean"&&(n=t.hasAttribute("data-preload")),n}load(t,n={}){let e=this.Reveal.getConfig().display;if(e.includes("!important")){let r=e.replace(/\s*!important\s*$/,"").trim();t.style.setProperty("display",r,"important")}else t.style.display=e;j(t,"img[data-src], video[data-src], audio[data-src], iframe[data-src]").forEach(r=>{let s=r.tagName==="IFRAME";(!s||this.shouldPreload(r))&&(r.setAttribute("src",r.getAttribute("data-src")),r.setAttribute("data-lazy-loaded",""),r.removeAttribute("data-src"),s&&r.addEventListener("load",this.preventIframeAutoFocus))}),j(t,"video, audio").forEach(r=>{let s=0;j(r,"source[data-src]").forEach(o=>{o.setAttribute("src",o.getAttribute("data-src")),o.removeAttribute("data-src"),o.setAttribute("data-lazy-loaded",""),s+=1}),Lt&&r.tagName==="VIDEO"&&r.setAttribute("playsinline",""),s>0&&r.load()});let a=t.slideBackgroundElement;if(a){a.style.display="block";let r=t.slideBackgroundContentElement,s=t.getAttribute("data-background-iframe");if(a.hasAttribute("data-loaded")===!1){a.setAttribute("data-loaded","true");let l=t.getAttribute("data-background-image"),c=t.getAttribute("data-background-video"),d=t.hasAttribute("data-background-video-loop"),_=t.hasAttribute("data-background-video-muted");if(l)/^data:/.test(l.trim())?r.style.backgroundImage=`url(${l.trim()})`:r.style.backgroundImage=l.split(",").map(u=>`url(${Hr(decodeURI(u.trim()))})`).join(",");else if(c){let u=document.createElement("video");d&&u.setAttribute("loop",""),(_||this.Reveal.isSpeakerNotes())&&(u.muted=!0),Lt&&u.setAttribute("playsinline",""),c.split(",").forEach(m=>{let p=document.createElement("source");p.setAttribute("src",m);let g=Yr(m);g&&p.setAttribute("type",g),u.appendChild(p)}),r.appendChild(u)}else if(s&&n.excludeIframes!==!0){let u=document.createElement("iframe");u.setAttribute("allowfullscreen",""),u.setAttribute("mozallowfullscreen",""),u.setAttribute("webkitallowfullscreen",""),u.setAttribute("allow","autoplay"),u.setAttribute("data-src",s),u.style.width="100%",u.style.height="100%",u.style.maxHeight="100%",u.style.maxWidth="100%",r.appendChild(u)}}let o=r.querySelector("iframe[data-src]");o&&this.shouldPreload(a)&&!/autoplay=(1|true|yes)/gi.test(s)&&o.getAttribute("src")!==s&&o.setAttribute("src",s)}this.layout(t)}layout(t){Array.from(t.querySelectorAll(".r-fit-text")).forEach(n=>{Vr(n,{minSize:24,maxSize:this.Reveal.getConfig().height*.8,observeMutations:!1,observeWindow:!1})})}unload(t){t.style.display="none";let n=this.Reveal.getSlideBackground(t);n&&(n.style.display="none",j(n,"iframe[src]").forEach(e=>{e.removeAttribute("src")})),j(t,"video[data-lazy-loaded][src], audio[data-lazy-loaded][src], iframe[data-lazy-loaded][src]").forEach(e=>{e.setAttribute("data-src",e.getAttribute("src")),e.removeAttribute("src")}),j(t,"video[data-lazy-loaded] source[src], audio source[src]").forEach(e=>{e.setAttribute("data-src",e.getAttribute("src")),e.removeAttribute("src")})}formatEmbeddedContent(){let t=(n,e,a)=>{j(this.Reveal.getSlidesElement(),"iframe["+n+'*="'+e+'"]').forEach(r=>{let s=r.getAttribute(n);s&&s.indexOf(a)===-1&&r.setAttribute(n,s+(/\?/.test(s)?"&":"?")+a)})};t("src","youtube.com/embed/","enablejsapi=1"),t("data-src","youtube.com/embed/","enablejsapi=1"),t("src","player.vimeo.com/","api=1"),t("data-src","player.vimeo.com/","api=1")}startEmbeddedContent(t){if(t){let n=this.Reveal.isSpeakerNotes();j(t,'img[src$=".gif"]').forEach(e=>{e.setAttribute("src",e.getAttribute("src"))}),j(t,"video, audio").forEach(e=>{if(De(e,".fragment")&&!De(e,".fragment.visible"))return;let a=this.Reveal.getConfig().autoPlayMedia;if(typeof a!="boolean"&&(a=e.hasAttribute("data-autoplay")||!!De(e,".slide-background")),a&&typeof e.play=="function"){if(n&&!e.muted)return;e.readyState>1?this.startEmbeddedMedia({target:e}):Lt?(e.addEventListener("canplay",this.ensureMobileMediaPlaying),this.playMediaElement(e)):(e.removeEventListener("loadeddata",this.startEmbeddedMedia),e.addEventListener("loadeddata",this.startEmbeddedMedia))}}),n||(j(t,"iframe[src]").forEach(e=>{De(e,".fragment")&&!De(e,".fragment.visible")||this.startEmbeddedIframe({target:e})}),j(t,"iframe[data-src]").forEach(e=>{De(e,".fragment")&&!De(e,".fragment.visible")||e.getAttribute("src")!==e.getAttribute("data-src")&&(e.removeEventListener("load",this.startEmbeddedIframe),e.addEventListener("load",this.startEmbeddedIframe),e.setAttribute("src",e.getAttribute("data-src")))}))}}ensureMobileMediaPlaying(t){let n=t.target;typeof n.getVideoPlaybackQuality=="function"&&setTimeout(()=>{let e=n.paused===!1,a=n.getVideoPlaybackQuality().totalVideoFrames;e&&a===0&&(n.load(),n.play())},1e3)}startEmbeddedMedia(t){let n=!!De(t.target,"html"),e=!!De(t.target,".present");n&&e&&(t.target.paused||t.target.ended)&&(t.target.currentTime=0,this.playMediaElement(t.target)),t.target.removeEventListener("loadeddata",this.startEmbeddedMedia)}playMediaElement(t){let n=t.play();n&&typeof n.catch=="function"&&n.then(()=>{t.muted||(this.allowedToPlayAudio=!0)}).catch(e=>{if(e.name==="NotAllowedError")if(this.allowedToPlayAudio=!1,t.tagName==="VIDEO"){this.onVideoPlaybackNotAllowed(t);let a=!!De(t,"html"),r=!!De(t,".present"),s=t.muted;a&&r&&!s&&(t.setAttribute("data-muted-by-reveal","true"),t.muted=!0,t.play().catch(()=>{this.onMutedVideoPlaybackNotAllowed(t)}))}else t.tagName==="AUDIO"&&this.onAudioPlaybackNotAllowed(t)})}startEmbeddedIframe(t){let n=t.target;if(this.preventIframeAutoFocus(t),n&&n.contentWindow){let e=!!De(t.target,"html"),a=!!De(t.target,".present");if(e&&a){let r=this.Reveal.getConfig().autoPlayMedia;typeof r!="boolean"&&(r=n.hasAttribute("data-autoplay")||!!De(n,".slide-background")),/youtube\.com\/embed\//.test(n.getAttribute("src"))&&r?n.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*"):/player\.vimeo\.com\//.test(n.getAttribute("src"))&&r?n.contentWindow.postMessage('{"method":"play"}',"*"):n.contentWindow.postMessage("slide:start","*")}}}stopEmbeddedContent(t,n={}){n=jt({unloadIframes:!0},n),t&&t.parentNode&&(j(t,"video, audio").forEach(e=>{!e.hasAttribute("data-ignore")&&typeof e.pause=="function"&&(e.setAttribute("data-paused-by-reveal",""),e.pause(),Lt&&e.removeEventListener("canplay",this.ensureMobileMediaPlaying))}),j(t,"iframe").forEach(e=>{e.contentWindow&&e.contentWindow.postMessage("slide:stop","*"),e.removeEventListener("load",this.preventIframeAutoFocus),e.removeEventListener("load",this.startEmbeddedIframe)}),j(t,'iframe[src*="youtube.com/embed/"]').forEach(e=>{!e.hasAttribute("data-ignore")&&e.contentWindow&&typeof e.contentWindow.postMessage=="function"&&e.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),j(t,'iframe[src*="player.vimeo.com/"]').forEach(e=>{!e.hasAttribute("data-ignore")&&e.contentWindow&&typeof e.contentWindow.postMessage=="function"&&e.contentWindow.postMessage('{"method":"pause"}',"*")}),n.unloadIframes===!0&&j(t,"iframe[data-src]").forEach(e=>{e.setAttribute("src","about:blank"),e.removeAttribute("src")}))}isAllowedToPlayAudio(){return this.allowedToPlayAudio}showPlayOrUnmuteButton(){let t=this.failedAudioPlaybackTargets.size,n=this.failedVideoPlaybackTargets.size,e=this.failedMutedVideoPlaybackTargets.size,a="Play media";e>0?a="Play video":n>0?a="Unmute video":t>0&&(a="Play audio"),this.mediaPlayButton.textContent=a,this.Reveal.getRevealElement().appendChild(this.mediaPlayButton)}onAudioPlaybackNotAllowed(t){this.failedAudioPlaybackTargets.add(t),this.showPlayOrUnmuteButton(t)}onVideoPlaybackNotAllowed(t){this.failedVideoPlaybackTargets.add(t),this.showPlayOrUnmuteButton()}onMutedVideoPlaybackNotAllowed(t){this.failedMutedVideoPlaybackTargets.add(t),this.showPlayOrUnmuteButton()}resetTemporarilyMutedMedia(){new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(t=>{t.hasAttribute("data-muted-by-reveal")&&(t.muted=!1,t.removeAttribute("data-muted-by-reveal"))})}clearMediaPlaybackErrors(){this.resetTemporarilyMutedMedia(),this.failedAudioPlaybackTargets.clear(),this.failedVideoPlaybackTargets.clear(),this.failedMutedVideoPlaybackTargets.clear(),this.mediaPlayButton&&this.mediaPlayButton.parentNode&&this.mediaPlayButton.remove()}preventIframeAutoFocus(t){let n=t.target;if(n&&this.Reveal.getConfig().preventIframeAutoFocus){let e=0,a=()=>{document.activeElement===n?document.activeElement.blur():e<1e3&&(e+=100,setTimeout(a,100))};setTimeout(a,100)}}afterSlideChanged(){this.clearMediaPlaybackErrors()}},Nt=".slides section",ht=".slides>section",Ln=".slides>section.present>section",jr=".backgrounds>.slide-background",Wr=/registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener|showPreview|previewIframe/,Qr=class{constructor(t){this.Reveal=t}render(){this.element=document.createElement("div"),this.element.className="slide-number",this.Reveal.getRevealElement().appendChild(this.element)}configure(t,n){let e="none";t.slideNumber&&!this.Reveal.isPrintView()&&(t.showSlideNumber==="all"||t.showSlideNumber==="speaker"&&this.Reveal.isSpeakerNotes())&&(e="block"),this.element.style.display=e}update(){this.Reveal.getConfig().slideNumber&&this.element&&(this.element.innerHTML=this.getSlideNumber())}getSlideNumber(t=this.Reveal.getCurrentSlide()){let n=this.Reveal.getConfig(),e,a="h.v";if(typeof n.slideNumber=="function")e=n.slideNumber(t);else{typeof n.slideNumber=="string"&&(a=n.slideNumber),!/c/.test(a)&&this.Reveal.getHorizontalSlides().length===1&&(a="c");let s=t&&t.dataset.visibility==="uncounted"?0:1;switch(e=[],a){case"c":e.push(this.Reveal.getSlidePastCount(t)+s);break;case"c/t":e.push(this.Reveal.getSlidePastCount(t)+s,"/",this.Reveal.getTotalSlides());break;default:let o=this.Reveal.getIndices(t);e.push(o.h+s);let l=a==="h/v"?"/":".";this.Reveal.isVerticalSlide(t)&&e.push(l,o.v+1)}}let r="#"+this.Reveal.location.getHash(t);return this.formatNumber(e[0],e[1],e[2],r)}formatNumber(t,n,e,a="#"+this.Reveal.location.getHash()){return typeof e=="number"&&!isNaN(e)?`<a href="${a}">
|
|
1
|
+
import{jm as je,jn as We,jo as Qe,jp as Ke,jq as Xe,jr as Ze,js as Je,jt as et,ju as xe,r as Q,j as S,ar as br,_ as fr,jv as Tr,K as vr,bW as Cr,I as yr,bX as Rr,D as Nr,f4 as Or,bi as da,T as Ar}from"../datalayer-app-main.js";import{x as Ir,B as xr,N as Dr}from"./JupyterLexicalExtension-Ght2bbbp.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./url-CzjbCo42.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-CGQDY041.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./PrismCss-CcU1ChRk.js";import"./Output-no9rnFJ7.js";import"./index-CFP9psRB.js";import"./hoverbox-CStlKQWE.js";import"./index-DSN70XMH.js";import"./index-S4sn4R3i.js";import"./color-CG7_7V2-.js";import"./isEqual-g-jK7vY0.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";import"./LexicalToolRegistry-8wJyLumb.js";const _a={datalayer:{light:{primary:xe.greenAccent,secondary:xe.greenText,textColor:xe.gray,primaryGradient:[xe.greenAccent,xe.greenBrand],secondaryGradient:[xe.greenHover,xe.greenBrand]},dark:{primary:xe.greenBright,secondary:xe.greenAccent,textColor:xe.gray,primaryGradient:[xe.greenAccent,xe.greenBrand],secondaryGradient:[xe.greenHover,xe.greenText]}},spatial:{light:{primary:et.indigoBrand,secondary:et.indigoText,textColor:et.gray,primaryGradient:[et.indigoBright,et.indigoBrand],secondaryGradient:[et.indigoHover,et.indigoAccent]},dark:{primary:et.indigoBright,secondary:et.indigoAccent,textColor:et.gray,primaryGradient:[et.indigoBright,et.indigoBrand],secondaryGradient:[et.indigoHover,et.indigoAccent]}},lovely:{light:{primary:Je.roseBrand,secondary:Je.roseText,textColor:Je.gray,primaryGradient:[Je.roseBright,Je.roseBrand],secondaryGradient:[Je.roseHover,Je.roseAccent]},dark:{primary:Je.roseBright,secondary:Je.roseAccent,textColor:Je.gray,primaryGradient:[Je.roseBright,Je.roseBrand],secondaryGradient:[Je.roseHover,Je.roseAccent]}},matrix:{light:{primary:Ze.greenBrand,secondary:Ze.greenText,textColor:Ze.gray,primaryGradient:[Ze.greenGlow,Ze.greenBrand],secondaryGradient:[Ze.greenHover,Ze.greenAccent]},dark:{primary:Ze.greenGlow,secondary:Ze.greenPhosphor,textColor:Ze.gray,primaryGradient:[Ze.greenGlow,Ze.greenBrand],secondaryGradient:[Ze.greenHover,Ze.greenAccent]}},earth:{light:{primary:Xe.oceanBrand,secondary:Xe.oceanText,textColor:Xe.gray,primaryGradient:[Xe.oceanAccent,Xe.oceanBrand],secondaryGradient:[Xe.oceanHover,Xe.oceanText]},dark:{primary:Xe.oceanBright,secondary:Xe.oceanAccent,textColor:Xe.gray,primaryGradient:[Xe.oceanBright,Xe.oceanBrand],secondaryGradient:[Xe.oceanHover,Xe.oceanAccent]}},sand:{light:{primary:Ke.sandBrand,secondary:Ke.sandText,textColor:Ke.gray,primaryGradient:[Ke.sandAccent,Ke.sandBrand],secondaryGradient:[Ke.sandHover,Ke.sandText]},dark:{primary:Ke.sandBright,secondary:Ke.sandAccent,textColor:Ke.gray,primaryGradient:[Ke.sandBright,Ke.sandBrand],secondaryGradient:[Ke.sandHover,Ke.sandAccent]}},ivory:{light:{primary:Qe.ivoryBrand,secondary:Qe.ivoryText,textColor:Qe.gray,primaryGradient:[Qe.ivoryAccent,Qe.ivoryBrand],secondaryGradient:[Qe.ivoryHover,Qe.ivoryText]},dark:{primary:Qe.ivoryBright,secondary:Qe.ivoryAccent,textColor:Qe.gray,primaryGradient:[Qe.ivoryBright,Qe.ivoryBrand],secondaryGradient:[Qe.ivoryHover,Qe.ivoryAccent]}},sun:{light:{primary:We.sunBrand,secondary:We.sunText,textColor:We.gray,primaryGradient:[We.sunAccent,We.sunBrand],secondaryGradient:[We.sunHover,We.sunText]},dark:{primary:We.sunBright,secondary:We.sunAccent,textColor:We.gray,primaryGradient:[We.sunBright,We.sunBrand],secondaryGradient:[We.sunHover,We.sunAccent]}},loop:{light:{primary:je.loopAccent,secondary:je.ink,textColor:je.gray,primaryGradient:[je.loopAccent,je.loopAccent],secondaryGradient:[je.ink,je.ink]},dark:{primary:je.loopBrand,secondary:je.inkDark,textColor:je.grayDark,primaryGradient:[je.loopBrand,je.loopBrand],secondaryGradient:[je.inkDark,je.inkDark]}}};function Ya(i="datalayer",t="light"){const n=t==="auto"?"light":t;return _a[i]?.[n]??_a.datalayer.light}const ua=25,wr=[{y:0,secondaryWidth:30,primaryWidth:70},{y:37.5,secondaryWidth:50,primaryWidth:50},{y:75,secondaryWidth:70,primaryWidth:30}];Q.forwardRef(function({size:t=16,variant:n="datalayer",colorMode:e="light",primaryColor:a,secondaryColor:r,primaryGradient:s,secondaryGradient:o,gradient:l=!0,...c},d){const _=Ya(n,e),u=a??_.primary,m=r??_.secondary,p=Q.useId().replace(/:/g,""),[g,b]=s??_.primaryGradient,[C,y]=o??_.secondaryGradient;return S.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:t,height:t,"aria-hidden":"true",ref:d,...c,children:[l&&S.jsxs("defs",{children:[S.jsxs("linearGradient",{id:`${p}-p`,x1:"0",y1:"0",x2:"1",y2:"0",children:[S.jsx("stop",{offset:"0",stopColor:g}),S.jsx("stop",{offset:"1",stopColor:b})]}),S.jsxs("linearGradient",{id:`${p}-s`,x1:"0",y1:"0",x2:"1",y2:"0",children:[S.jsx("stop",{offset:"0",stopColor:C}),S.jsx("stop",{offset:"1",stopColor:y})]})]}),wr.map(({y:N,secondaryWidth:O,primaryWidth:v})=>S.jsxs("g",{children:[S.jsx("rect",{x:0,y:N,width:O,height:ua,fill:l?`url(#${p}-p)`:u}),S.jsx("rect",{x:O,y:N,width:v,height:ua,fill:l?`url(#${p}-s)`:m})]},N))]})});const Ha=new Map,On=i=>Ha.get(i),an=i=>Ha.has(i),kr=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|==[^=]+==)/g,ie=i=>i.split(kr).map((t,n)=>{const e=`${n}-${t}`;if(t.startsWith("**")&&t.endsWith("**"))return S.jsx("strong",{children:ie(t.slice(2,-2))},e);if(t.startsWith("`")&&t.endsWith("`"))return S.jsx("code",{children:t.slice(1,-1)},e);if(t.startsWith("==")&&t.endsWith("=="))return S.jsx("mark",{className:"dla-alert",children:t.slice(2,-2)},e);const a=/^\[([^\]]+)\]\(([^)]+)\)$/.exec(t);return a?S.jsx("a",{href:a[2],target:"_blank",rel:"noopener noreferrer",children:a[1]},e):t}),Mr=i=>i.trim().split(/\n\s*\n/).map((t,n)=>S.jsx("p",{children:ie(t.trim())},`${n}-${t.slice(0,24)}`)),Lr=()=>{const{theme:i,colorMode:t}=br();return{theme:i,colorMode:t}},Pr={useTheme:Lr},Fr=Q.createContext(Pr),Va=()=>Q.useContext(Fr),za=()=>{const{useTheme:i}=Va();return i()},An=({footer:i,theme:t,index:n,total:e})=>{const{colorMode:a,theme:r}=za(),{Logo:s}=Va(),o=a==="auto"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a,l=Ya(r,o),c=new Date().getFullYear(),d=i.since&&i.since<c?`${i.since}–${c}`:`${c}`;return S.jsxs("div",{className:"dla-slide-footer",children:[i.logo&&S.jsx("a",{className:"dla-slide-footer-logo",href:i.href,target:"_blank",rel:"noopener noreferrer","aria-label":`${i.holder} — ${i.href}`,children:s?S.jsx(s,{height:26,variant:r,colorMode:a,inverse:t.logo.inverse,colored:t.logo.colored,primaryColor:t.logo.primaryColor??l.primary,secondaryColor:t.logo.secondaryColor??l.secondary,textColor:t.logo.textColor??l.textColor}):S.jsx("span",{className:"dla-slide-footer-holder",children:i.holder})}),i.note&&S.jsx("div",{className:"dla-slide-footer-note",children:i.note}),S.jsxs("div",{className:"dla-slide-footer-legal",children:[S.jsx("a",{href:i.href,target:"_blank",rel:"noopener noreferrer",children:i.href.replace(/^https?:\/\//,"")}),S.jsxs("span",{children:["© ",d," ",i.holder]}),i.slideNumbers&&S.jsxs("span",{className:"dla-slide-footer-number",children:[n," / ",e]})]})]})},In=({name:i})=>{if(!i)return null;const t=On(i);return t?S.jsx("div",{className:"dla-slide-backdrop","aria-hidden":!0,children:S.jsx(t,{})}):null},Le=({theme:i,footer:t,index:n,total:e,eyebrow:a,title:r,subtitle:s,layout:o,variant:l,backdrop:c,children:d})=>{const _=["dla-slide"];return l&&_.push(`dla-slide--${l}`),(o==="centered"||o==="full-bleed")&&_.push(`dla-slide--${o}`),S.jsxs("div",{className:_.join(" "),children:[S.jsx(In,{name:c}),S.jsxs("div",{className:"dla-slide-head",children:[a&&S.jsx("div",{className:"dla-slide-eyebrow",children:a}),r&&S.jsx("h2",{className:"dla-slide-title",children:ie(r)}),s&&S.jsx("p",{className:"dla-slide-subtitle",children:ie(s)})]}),S.jsx("div",{className:"dla-slide-body",children:d}),t&&S.jsx(An,{footer:t,theme:i,index:n,total:e})]})};var jt=(i,t)=>{for(let n in t)i[n]=t[n];return i},j=(i,t)=>Array.from(i.querySelectorAll(t)),Mn=(i,t,n)=>{n?i.classList.add(t):i.classList.remove(t)},$t=i=>{if(typeof i=="string"){if(i==="null")return null;if(i==="true")return!0;if(i==="false")return!1;if(i.match(/^-?[\d\.]+$/))return parseFloat(i)}return i},Rt=(i,t)=>{i.style.transform=t},Cn=(i,t)=>{let n=i.matches||i.matchesSelector||i.msMatchesSelector;return!!(n&&n.call(i,t))},De=(i,t)=>{if(i&&typeof i.closest=="function")return i.closest(t);for(;i;){if(Cn(i,t))return i;i=i.parentElement}return null},qa=i=>{i=i||document.documentElement;let t=i.requestFullscreen||i.webkitRequestFullscreen||i.webkitRequestFullScreen||i.mozRequestFullScreen||i.msRequestFullscreen;t&&t.apply(i)},Ur=(i,t,n,e="")=>{let a=i.querySelectorAll("."+n);for(let s=0;s<a.length;s++){let o=a[s];if(o.parentNode===i)return o}let r=document.createElement(t);return r.className=n,r.innerHTML=e,i.appendChild(r),r},Hn=i=>{let t=document.createElement("style");return i&&i.length>0&&t.appendChild(document.createTextNode(i)),document.head.appendChild(t),t},pa=()=>{let i={};location.search.replace(/[A-Z0-9]+?=([\w\.%-]*)/gi,t=>{let n=t.split("=").shift(),e=t.split("=").pop();return n&&e!==void 0&&(i[n]=e),t});for(let t in i){let n=i[t];i[t]=$t(unescape(n))}return i.dependencies!==void 0&&delete i.dependencies,i},Br=(i,t=0)=>{if(i){var n;let e,a=i.style.height;return i.style.height="0px",i.parentElement&&(i.parentElement.style.height="auto"),e=t-(((n=i.parentElement)==null?void 0:n.offsetHeight)||0),i.style.height=a+"px",i.parentElement&&i.parentElement.style.removeProperty("height"),e}return t},Gr={mp4:"video/mp4",m4a:"video/mp4",ogv:"video/ogg",mpeg:"video/mpeg",webm:"video/webm"},Yr=(i="")=>{let t=i.split(".").pop();return t?Gr[t]:void 0},Hr=(i="")=>encodeURI(i).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),$a=navigator.userAgent,Lt=/(iphone|ipod|ipad|android)/gi.test($a)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,ja=/android/gi.test($a),Vr=(function(i){if(i){var t=function(R){return[].slice.call(R)},n=0,e=1,a=2,r=3,s=[],o=null,l="requestAnimationFrame"in i?function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{sync:!1};i.cancelAnimationFrame(o);var U=function(){return d(s.filter((function(z){return z.dirty&&z.active})))};if(R.sync)return U();o=i.requestAnimationFrame(U)}:function(){},c=function(R){return function(U){s.forEach((function(z){return z.dirty=R})),l(U)}},d=function(R){R.filter((function(z){return!z.styleComputed})).forEach((function(z){z.styleComputed=p(z)})),R.filter(g).forEach(b);var U=R.filter(m);U.forEach(u),U.forEach((function(z){b(z),_(z)})),U.forEach(C)},_=function(R){return R.dirty=n},u=function(R){R.availableWidth=R.element.parentNode.clientWidth,R.currentWidth=R.element.scrollWidth,R.previousFontSize=R.currentFontSize,R.currentFontSize=Math.min(Math.max(R.minSize,R.availableWidth/R.currentWidth*R.previousFontSize),R.maxSize),R.whiteSpace=R.multiLine&&R.currentFontSize===R.minSize?"normal":"nowrap"},m=function(R){return R.dirty!==a||R.dirty===a&&R.element.parentNode.clientWidth!==R.availableWidth},p=function(R){var U=i.getComputedStyle(R.element,null);return R.currentFontSize=parseFloat(U.getPropertyValue("font-size")),R.display=U.getPropertyValue("display"),R.whiteSpace=U.getPropertyValue("white-space"),!0},g=function(R){var U=!1;return!R.preStyleTestCompleted&&(/inline-/.test(R.display)||(U=!0,R.display="inline-block"),R.whiteSpace!=="nowrap"&&(U=!0,R.whiteSpace="nowrap"),R.preStyleTestCompleted=!0,U)},b=function(R){R.element.style.whiteSpace=R.whiteSpace,R.element.style.display=R.display,R.element.style.fontSize=R.currentFontSize+"px"},C=function(R){R.element.dispatchEvent(new CustomEvent("fit",{detail:{oldValue:R.previousFontSize,newValue:R.currentFontSize,scaleFactor:R.currentFontSize/R.previousFontSize}}))},y=function(R,U){return function(z){R.dirty=U,R.active&&l(z)}},N=function(R){return function(){s=s.filter((function(U){return U.element!==R.element})),R.observeMutations&&R.observer.disconnect(),R.element.style.whiteSpace=R.originalStyle.whiteSpace,R.element.style.display=R.originalStyle.display,R.element.style.fontSize=R.originalStyle.fontSize}},O=function(R){return function(){R.active||(R.active=!0,l())}},v=function(R){return function(){return R.active=!1}},A=function(R){R.observeMutations&&(R.observer=new MutationObserver(y(R,e)),R.observer.observe(R.element,R.observeMutations))},M={minSize:16,maxSize:512,multiLine:!0,observeMutations:"MutationObserver"in i&&{subtree:!0,childList:!0,characterData:!0}},F=null,Y=function(){i.clearTimeout(F),F=i.setTimeout(c(a),B.observeWindowDelay)},x=["resize","orientationchange"];return Object.defineProperty(B,"observeWindow",{set:function(R){var U=`${R?"add":"remove"}EventListener`;x.forEach((function(z){i[U](z,Y)}))}}),B.observeWindow=!0,B.observeWindowDelay=100,B.fitAll=c(r),B}function K(R,U){var z=Object.assign({},M,U),Z=R.map((function(te){var se=Object.assign({},z,{element:te,active:!0});return(function(ae){ae.originalStyle={whiteSpace:ae.element.style.whiteSpace,display:ae.element.style.display,fontSize:ae.element.style.fontSize},A(ae),ae.newbie=!0,ae.dirty=!0,s.push(ae)})(se),{element:te,fit:y(se,r),unfreeze:O(se),freeze:v(se),unsubscribe:N(se)}}));return l(),Z}function B(R){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return typeof R=="string"?K(t(document.querySelectorAll(R)),U):K([R],U)[0]}})(typeof window>"u"?null:window);function ln(i){"@babel/helpers - typeof";return ln=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ln(i)}function zr(i,t){if(ln(i)!="object"||!i)return i;var n=i[Symbol.toPrimitive];if(n!==void 0){var e=n.call(i,t);if(ln(e)!="object")return e;throw TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function qr(i){var t=zr(i,"string");return ln(t)=="symbol"?t:t+""}function Kn(i,t,n){return(t=qr(t))in i?Object.defineProperty(i,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):i[t]=n,i}var $r=class{constructor(t){Kn(this,"allowedToPlayAudio",null),this.Reveal=t,this.startEmbeddedMedia=this.startEmbeddedMedia.bind(this),this.startEmbeddedIframe=this.startEmbeddedIframe.bind(this),this.preventIframeAutoFocus=this.preventIframeAutoFocus.bind(this),this.ensureMobileMediaPlaying=this.ensureMobileMediaPlaying.bind(this),this.failedAudioPlaybackTargets=new Set,this.failedVideoPlaybackTargets=new Set,this.failedMutedVideoPlaybackTargets=new Set,this.renderMediaPlayButton()}renderMediaPlayButton(){this.mediaPlayButton=document.createElement("button"),this.mediaPlayButton.className="r-overlay-button r-media-play-button",this.mediaPlayButton.addEventListener("click",()=>{this.resetTemporarilyMutedMedia(),new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(t=>{this.startEmbeddedMedia({target:t})}),this.clearMediaPlaybackErrors()})}shouldPreload(t){if(this.Reveal.isScrollView())return!0;let n=this.Reveal.getConfig().preloadIframes;return typeof n!="boolean"&&(n=t.hasAttribute("data-preload")),n}load(t,n={}){let e=this.Reveal.getConfig().display;if(e.includes("!important")){let r=e.replace(/\s*!important\s*$/,"").trim();t.style.setProperty("display",r,"important")}else t.style.display=e;j(t,"img[data-src], video[data-src], audio[data-src], iframe[data-src]").forEach(r=>{let s=r.tagName==="IFRAME";(!s||this.shouldPreload(r))&&(r.setAttribute("src",r.getAttribute("data-src")),r.setAttribute("data-lazy-loaded",""),r.removeAttribute("data-src"),s&&r.addEventListener("load",this.preventIframeAutoFocus))}),j(t,"video, audio").forEach(r=>{let s=0;j(r,"source[data-src]").forEach(o=>{o.setAttribute("src",o.getAttribute("data-src")),o.removeAttribute("data-src"),o.setAttribute("data-lazy-loaded",""),s+=1}),Lt&&r.tagName==="VIDEO"&&r.setAttribute("playsinline",""),s>0&&r.load()});let a=t.slideBackgroundElement;if(a){a.style.display="block";let r=t.slideBackgroundContentElement,s=t.getAttribute("data-background-iframe");if(a.hasAttribute("data-loaded")===!1){a.setAttribute("data-loaded","true");let l=t.getAttribute("data-background-image"),c=t.getAttribute("data-background-video"),d=t.hasAttribute("data-background-video-loop"),_=t.hasAttribute("data-background-video-muted");if(l)/^data:/.test(l.trim())?r.style.backgroundImage=`url(${l.trim()})`:r.style.backgroundImage=l.split(",").map(u=>`url(${Hr(decodeURI(u.trim()))})`).join(",");else if(c){let u=document.createElement("video");d&&u.setAttribute("loop",""),(_||this.Reveal.isSpeakerNotes())&&(u.muted=!0),Lt&&u.setAttribute("playsinline",""),c.split(",").forEach(m=>{let p=document.createElement("source");p.setAttribute("src",m);let g=Yr(m);g&&p.setAttribute("type",g),u.appendChild(p)}),r.appendChild(u)}else if(s&&n.excludeIframes!==!0){let u=document.createElement("iframe");u.setAttribute("allowfullscreen",""),u.setAttribute("mozallowfullscreen",""),u.setAttribute("webkitallowfullscreen",""),u.setAttribute("allow","autoplay"),u.setAttribute("data-src",s),u.style.width="100%",u.style.height="100%",u.style.maxHeight="100%",u.style.maxWidth="100%",r.appendChild(u)}}let o=r.querySelector("iframe[data-src]");o&&this.shouldPreload(a)&&!/autoplay=(1|true|yes)/gi.test(s)&&o.getAttribute("src")!==s&&o.setAttribute("src",s)}this.layout(t)}layout(t){Array.from(t.querySelectorAll(".r-fit-text")).forEach(n=>{Vr(n,{minSize:24,maxSize:this.Reveal.getConfig().height*.8,observeMutations:!1,observeWindow:!1})})}unload(t){t.style.display="none";let n=this.Reveal.getSlideBackground(t);n&&(n.style.display="none",j(n,"iframe[src]").forEach(e=>{e.removeAttribute("src")})),j(t,"video[data-lazy-loaded][src], audio[data-lazy-loaded][src], iframe[data-lazy-loaded][src]").forEach(e=>{e.setAttribute("data-src",e.getAttribute("src")),e.removeAttribute("src")}),j(t,"video[data-lazy-loaded] source[src], audio source[src]").forEach(e=>{e.setAttribute("data-src",e.getAttribute("src")),e.removeAttribute("src")})}formatEmbeddedContent(){let t=(n,e,a)=>{j(this.Reveal.getSlidesElement(),"iframe["+n+'*="'+e+'"]').forEach(r=>{let s=r.getAttribute(n);s&&s.indexOf(a)===-1&&r.setAttribute(n,s+(/\?/.test(s)?"&":"?")+a)})};t("src","youtube.com/embed/","enablejsapi=1"),t("data-src","youtube.com/embed/","enablejsapi=1"),t("src","player.vimeo.com/","api=1"),t("data-src","player.vimeo.com/","api=1")}startEmbeddedContent(t){if(t){let n=this.Reveal.isSpeakerNotes();j(t,'img[src$=".gif"]').forEach(e=>{e.setAttribute("src",e.getAttribute("src"))}),j(t,"video, audio").forEach(e=>{if(De(e,".fragment")&&!De(e,".fragment.visible"))return;let a=this.Reveal.getConfig().autoPlayMedia;if(typeof a!="boolean"&&(a=e.hasAttribute("data-autoplay")||!!De(e,".slide-background")),a&&typeof e.play=="function"){if(n&&!e.muted)return;e.readyState>1?this.startEmbeddedMedia({target:e}):Lt?(e.addEventListener("canplay",this.ensureMobileMediaPlaying),this.playMediaElement(e)):(e.removeEventListener("loadeddata",this.startEmbeddedMedia),e.addEventListener("loadeddata",this.startEmbeddedMedia))}}),n||(j(t,"iframe[src]").forEach(e=>{De(e,".fragment")&&!De(e,".fragment.visible")||this.startEmbeddedIframe({target:e})}),j(t,"iframe[data-src]").forEach(e=>{De(e,".fragment")&&!De(e,".fragment.visible")||e.getAttribute("src")!==e.getAttribute("data-src")&&(e.removeEventListener("load",this.startEmbeddedIframe),e.addEventListener("load",this.startEmbeddedIframe),e.setAttribute("src",e.getAttribute("data-src")))}))}}ensureMobileMediaPlaying(t){let n=t.target;typeof n.getVideoPlaybackQuality=="function"&&setTimeout(()=>{let e=n.paused===!1,a=n.getVideoPlaybackQuality().totalVideoFrames;e&&a===0&&(n.load(),n.play())},1e3)}startEmbeddedMedia(t){let n=!!De(t.target,"html"),e=!!De(t.target,".present");n&&e&&(t.target.paused||t.target.ended)&&(t.target.currentTime=0,this.playMediaElement(t.target)),t.target.removeEventListener("loadeddata",this.startEmbeddedMedia)}playMediaElement(t){let n=t.play();n&&typeof n.catch=="function"&&n.then(()=>{t.muted||(this.allowedToPlayAudio=!0)}).catch(e=>{if(e.name==="NotAllowedError")if(this.allowedToPlayAudio=!1,t.tagName==="VIDEO"){this.onVideoPlaybackNotAllowed(t);let a=!!De(t,"html"),r=!!De(t,".present"),s=t.muted;a&&r&&!s&&(t.setAttribute("data-muted-by-reveal","true"),t.muted=!0,t.play().catch(()=>{this.onMutedVideoPlaybackNotAllowed(t)}))}else t.tagName==="AUDIO"&&this.onAudioPlaybackNotAllowed(t)})}startEmbeddedIframe(t){let n=t.target;if(this.preventIframeAutoFocus(t),n&&n.contentWindow){let e=!!De(t.target,"html"),a=!!De(t.target,".present");if(e&&a){let r=this.Reveal.getConfig().autoPlayMedia;typeof r!="boolean"&&(r=n.hasAttribute("data-autoplay")||!!De(n,".slide-background")),/youtube\.com\/embed\//.test(n.getAttribute("src"))&&r?n.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*"):/player\.vimeo\.com\//.test(n.getAttribute("src"))&&r?n.contentWindow.postMessage('{"method":"play"}',"*"):n.contentWindow.postMessage("slide:start","*")}}}stopEmbeddedContent(t,n={}){n=jt({unloadIframes:!0},n),t&&t.parentNode&&(j(t,"video, audio").forEach(e=>{!e.hasAttribute("data-ignore")&&typeof e.pause=="function"&&(e.setAttribute("data-paused-by-reveal",""),e.pause(),Lt&&e.removeEventListener("canplay",this.ensureMobileMediaPlaying))}),j(t,"iframe").forEach(e=>{e.contentWindow&&e.contentWindow.postMessage("slide:stop","*"),e.removeEventListener("load",this.preventIframeAutoFocus),e.removeEventListener("load",this.startEmbeddedIframe)}),j(t,'iframe[src*="youtube.com/embed/"]').forEach(e=>{!e.hasAttribute("data-ignore")&&e.contentWindow&&typeof e.contentWindow.postMessage=="function"&&e.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),j(t,'iframe[src*="player.vimeo.com/"]').forEach(e=>{!e.hasAttribute("data-ignore")&&e.contentWindow&&typeof e.contentWindow.postMessage=="function"&&e.contentWindow.postMessage('{"method":"pause"}',"*")}),n.unloadIframes===!0&&j(t,"iframe[data-src]").forEach(e=>{e.setAttribute("src","about:blank"),e.removeAttribute("src")}))}isAllowedToPlayAudio(){return this.allowedToPlayAudio}showPlayOrUnmuteButton(){let t=this.failedAudioPlaybackTargets.size,n=this.failedVideoPlaybackTargets.size,e=this.failedMutedVideoPlaybackTargets.size,a="Play media";e>0?a="Play video":n>0?a="Unmute video":t>0&&(a="Play audio"),this.mediaPlayButton.textContent=a,this.Reveal.getRevealElement().appendChild(this.mediaPlayButton)}onAudioPlaybackNotAllowed(t){this.failedAudioPlaybackTargets.add(t),this.showPlayOrUnmuteButton(t)}onVideoPlaybackNotAllowed(t){this.failedVideoPlaybackTargets.add(t),this.showPlayOrUnmuteButton()}onMutedVideoPlaybackNotAllowed(t){this.failedMutedVideoPlaybackTargets.add(t),this.showPlayOrUnmuteButton()}resetTemporarilyMutedMedia(){new Set([...this.failedAudioPlaybackTargets,...this.failedVideoPlaybackTargets,...this.failedMutedVideoPlaybackTargets]).forEach(t=>{t.hasAttribute("data-muted-by-reveal")&&(t.muted=!1,t.removeAttribute("data-muted-by-reveal"))})}clearMediaPlaybackErrors(){this.resetTemporarilyMutedMedia(),this.failedAudioPlaybackTargets.clear(),this.failedVideoPlaybackTargets.clear(),this.failedMutedVideoPlaybackTargets.clear(),this.mediaPlayButton&&this.mediaPlayButton.parentNode&&this.mediaPlayButton.remove()}preventIframeAutoFocus(t){let n=t.target;if(n&&this.Reveal.getConfig().preventIframeAutoFocus){let e=0,a=()=>{document.activeElement===n?document.activeElement.blur():e<1e3&&(e+=100,setTimeout(a,100))};setTimeout(a,100)}}afterSlideChanged(){this.clearMediaPlaybackErrors()}},Nt=".slides section",ht=".slides>section",Ln=".slides>section.present>section",jr=".backgrounds>.slide-background",Wr=/registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener|showPreview|previewIframe/,Qr=class{constructor(t){this.Reveal=t}render(){this.element=document.createElement("div"),this.element.className="slide-number",this.Reveal.getRevealElement().appendChild(this.element)}configure(t,n){let e="none";t.slideNumber&&!this.Reveal.isPrintView()&&(t.showSlideNumber==="all"||t.showSlideNumber==="speaker"&&this.Reveal.isSpeakerNotes())&&(e="block"),this.element.style.display=e}update(){this.Reveal.getConfig().slideNumber&&this.element&&(this.element.innerHTML=this.getSlideNumber())}getSlideNumber(t=this.Reveal.getCurrentSlide()){let n=this.Reveal.getConfig(),e,a="h.v";if(typeof n.slideNumber=="function")e=n.slideNumber(t);else{typeof n.slideNumber=="string"&&(a=n.slideNumber),!/c/.test(a)&&this.Reveal.getHorizontalSlides().length===1&&(a="c");let s=t&&t.dataset.visibility==="uncounted"?0:1;switch(e=[],a){case"c":e.push(this.Reveal.getSlidePastCount(t)+s);break;case"c/t":e.push(this.Reveal.getSlidePastCount(t)+s,"/",this.Reveal.getTotalSlides());break;default:let o=this.Reveal.getIndices(t);e.push(o.h+s);let l=a==="h/v"?"/":".";this.Reveal.isVerticalSlide(t)&&e.push(l,o.v+1)}}let r="#"+this.Reveal.location.getHash(t);return this.formatNumber(e[0],e[1],e[2],r)}formatNumber(t,n,e,a="#"+this.Reveal.location.getHash()){return typeof e=="number"&&!isNaN(e)?`<a href="${a}">
|
|
2
2
|
<span class="slide-number-a">${t}</span>
|
|
3
3
|
<span class="slide-number-delimiter">${n}</span>
|
|
4
4
|
<span class="slide-number-b">${e}</span>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{w as b,x as E,E as v,r as I,j as i,B as c,T as N,bk as j,bl as T,bm as U}from"../datalayer-app-main.js";import{EphemeralDocument as O}from"./EphemeralDocument-
|
|
1
|
+
import{w as b,x as E,E as v,r as I,j as i,B as c,T as N,bk as j,bl as T,bm as U}from"../datalayer-app-main.js";import{EphemeralDocument as O}from"./EphemeralDocument-BvbG68Jm.js";import{O as _,b as P,u as w}from"./openingNotebook-CjjarT8V.js";import{P as d}from"./PrismCss-CcU1ChRk.js";import"./lexicalHooks-Pqoe8h_O.js";import"./LexicalToolRegistry-8wJyLumb.js";import"./useProgressTask-UPro-gwc.js";import"./JupyterLexicalExtension-Ght2bbbp.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./url-CzjbCo42.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-CGQDY041.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./Output-no9rnFJ7.js";import"./index-CFP9psRB.js";import"./hoverbox-CStlKQWE.js";import"./index-DSN70XMH.js";import"./index-S4sn4R3i.js";import"./color-CG7_7V2-.js";import"./isEqual-g-jK7vY0.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";const D="Quarterly revenue by region",M="Six rows of revenue, two quarters, three regions. The cell below loads them and shows the frame; run it, change it, or ask an agent to take it further — the code and its output live in this document, beside the words about them.",l="opening-document-input",S="opening-document-output",g=e=>({detail:0,format:0,mode:"normal",style:"",text:e,type:"text",version:1}),u=(e,o,t={})=>({children:o,direction:"ltr",format:"",indent:0,type:e,version:1,...t}),h={type:"linebreak",version:1},s=(e,o)=>({detail:0,format:0,mode:"normal",style:"",text:e,type:"jupyter-input-highlight",version:1,highlightType:o}),f=e=>e.flatMap(o=>{if(typeof o=="string")return o.split(`
|
|
2
2
|
`).flatMap((n,m)=>[...m>0?[h]:[],...n.length>0?[s(n)]:[]]);const{content:t,type:r}=o;return typeof t=="string"?[s(t,r)]:Array.isArray(t)?t.length===1&&typeof t[0]=="string"?[s(t[0],r)]:f(t):[]}),k=e=>{const o=d.languages.python;return o?f(d.tokenize(e,o)):e.split(`
|
|
3
3
|
`).flatMap((t,r)=>[...r>0?[h]:[],...t.length>0?[s(t)]:[]])};function A(){const e=_.join("");return{root:{children:[u("heading",[g(D)],{tag:"h1"}),u("paragraph",[g(M)],{textFormat:0,textStyle:""}),u("jupyter-input",k(e),{language:"python",jupyterInputNodeUuid:l}),{type:"jupyter-output",version:1,format:"",source:e,outputs:[{output_type:"execute_result",execution_count:1,data:{"text/plain":P},metadata:{}}],jupyterInputNodeUuid:l,jupyterOutputNodeUuid:S}],direction:"ltr",format:"",indent:0,type:"root",version:1}}}function lt({workspace:e}){const o=b(),t=E(o.snapshot),r=e.surfaceId,n=w(T,j,{workspace:e,editorId:r}),a=v(U)[0]?.value,y=I.useMemo(()=>JSON.stringify((a?.document??A)()),[a]),x=a?.autoFocus??!0;if(t.state!=="running")return i.jsx(c,{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"fg.muted",fontSize:1,px:4,textAlign:"center",children:i.jsx(N,{children:"The document needs a running sandbox for its code blocks. Open the Sandbox view to see what it is doing."})});const p=o.getServiceManager()??void 0;return i.jsx(c,{height:"100%",minHeight:0,children:i.jsx(O,{inheritTheme:!0,documentId:r,content:y,autoFocus:x,serviceManager:p,showToolbar:n.present,toolbarExtraItems:n.items,kernelId:p?t.kernelId:void 0,runtimeOverride:!p&&t.jupyterUrl?{baseUrl:t.jupyterUrl,token:t.jupyterToken}:void 0})})}export{lt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,ap as ke,aq as Se,ar as je,as as we,at as ve,j as e,B as M,au as Ce,av as Ee,aw as be,ax as Re,ay as V,l as q,az as Me,aA as Te,aB as Pe,K as T,aC as De,aD as K,aE as $,aF as Ne,aG as Ue}from"../datalayer-app-main.js";import{useLexicalTools as Be}from"./lexicalHooks-Pqoe8h_O.js";import{u as He}from"./useProgressTask-UPro-gwc.js";import{L as Ae,j as Ie,T as Le,k as We,l as Fe,m as _e,D as G,n as ze,o as Je,p as Ve,q as qe,J as Ke,s as $e,F as Ge,t as Ye,u as Qe,v as Xe,w as Ze}from"./JupyterLexicalExtension-
|
|
1
|
+
import{r,ap as ke,aq as Se,ar as je,as as we,at as ve,j as e,B as M,au as Ce,av as Ee,aw as be,ax as Re,ay as V,l as q,az as Me,aA as Te,aB as Pe,K as T,aC as De,aD as K,aE as $,aF as Ne,aG as Ue}from"../datalayer-app-main.js";import{useLexicalTools as Be}from"./lexicalHooks-Pqoe8h_O.js";import{u as He}from"./useProgressTask-UPro-gwc.js";import{L as Ae,j as Ie,T as Le,k as We,l as Fe,m as _e,D as G,n as ze,o as Je,p as Ve,q as qe,J as Ke,s as $e,F as Ge,t as Ye,u as Qe,v as Xe,w as Ze}from"./JupyterLexicalExtension-Ght2bbbp.js";import"./LexicalToolRegistry-8wJyLumb.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./url-CzjbCo42.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-CGQDY041.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./PrismCss-CcU1ChRk.js";import"./Output-no9rnFJ7.js";import"./index-CFP9psRB.js";import"./hoverbox-CStlKQWE.js";import"./index-DSN70XMH.js";import"./index-S4sn4R3i.js";import"./color-CG7_7V2-.js";import"./isEqual-g-jK7vY0.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";function Oe({content:o}){const[s]=T(),l=r.useRef(!0);return r.useEffect(()=>{if(l.current){if(l.current=!1,!o){s.update(()=>{const t=K();t.getChildrenSize()===0&&t.append($())},{tag:"history-merge"});return}try{const t=JSON.parse(o);if(t&&typeof t=="object"&&t.root){const d=s.parseEditorState(o);s.setEditorState(d,{tag:"history-merge"})}else throw new Error("Invalid Lexical editor state format")}catch{s.update(()=>{const t=K();t.clear(),t.append($())},{tag:"history-merge"})}}},[o,s]),null}function et({disabled:o}){const[s]=T();return r.useEffect(()=>{De(s,Ne).output.disabled.value=o},[s,o]),null}function tt({setIsLinkEditMode:o,extraItems:s}){const[l]=T(),[t,d]=r.useState(l);return e.jsx(Ze,{editor:l,activeEditor:t,setActiveEditor:d,setIsLinkEditMode:o,extraItems:s})}function Y({inherit:o,colorMode:s,themeConfig:l,children:t}){return o?e.jsx(e.Fragment,{children:t}):e.jsx(Te,{colorMode:s,theme:l.primerTheme,themeStyles:l.themeStyles,children:t})}function Ut({documentId:o,runtimeName:s,runtimeOverride:l,serviceManager:t,kernelId:d,themeVariant:Q,colorMode:X,content:P,onContentChange:w,onToolsReady:D,onKernelChange:v,collaboration:n,toolbarExtraItems:Z,showToolbar:O=!0,inheritTheme:N=!1,autoFocus:U=!0}){const h=!!(n?.websocketUrl&&n?.roomId),ee=n?.identity?.displayName||n?.identity?.handle||n?.identity?.userId,te=n?.identity?.color,ne=r.useMemo(()=>({user:{id:n?.identity?.userId,username:n?.identity?.userId||n?.identity?.handle||n?.identity?.displayName,name:n?.identity?.handle||n?.identity?.displayName,display_name:n?.identity?.displayName||n?.identity?.handle,initials:n?.identity?.initials,color:n?.identity?.color,avatar_url:n?.identity?.avatarUrl,handle:n?.identity?.handle}}),[n?.identity]),B=r.useRef(P),H=r.useRef(o);H.current!==o&&(H.current=o,B.current=P);const A=B.current,I=r.useRef(A??""),L=Be(o);r.useEffect(()=>{D?.(L)},[L,D]);const{runtimes:W,refetchRuntimes:C}=ke(),m=r.useMemo(()=>{const i=String(l?.baseUrl||"").trim();if(i)return{url:i,wsUrl:String(l?.wsUrl||"").trim()||void 0,token:String(l?.token||"").trim(),runtime_name:String(l?.runtimeName||"").trim()||"agent-node-proxy"};const a=String(s||"").trim();if(a)return W.find(j=>String(j?.runtime_name||"")===a)},[l,s,W]),F=!!(!l?.baseUrl&&String(s||"").trim()&&!m);r.useEffect(()=>{if(!F)return;C();const i=window.setInterval(()=>{C()},1e3);return()=>{window.clearInterval(i)}},[F,C]);const[re,g]=r.useState(null),[p,f]=r.useState(void 0);r.useEffect(()=>{let i=!1,a=null,j=null;return(async()=>{if(t){try{await t.ready;const u=d?t.kernels.connectTo({model:{id:d,name:"python"}}):await t.kernels.startNew();i||(g(t),f(new V({kernelName:u.model.name,kernelSpecName:u.model.name,kernelModel:u.model,kernelManager:t.kernels,kernelspecsManager:t.kernelspecs,sessionManager:t.sessions})))}catch(u){console.error("[agent-runtimes] The document could not reach the kernel of the sandbox it was given.",u),i||(g(null),f(void 0))}return}const b=String(m?.url||"").trim();if(!b){i||(g(null),f(void 0));return}try{const u=String(m?.token||"").trim(),pe=String(m?.wsUrl||"").trim()||b.replace(/^http/,"ws"),xe=q.ServerConnection.makeSettings({baseUrl:b,wsUrl:pe,token:u,appendToken:!0});a=new q.ServiceManager({serverSettings:xe}),j=Me(String(m?.runtime_name||""),a),await a.ready;const R=await a.kernels.startNew();if(!i){const ye=new V({kernelName:R.model.name,kernelSpecName:R.model.name,kernelModel:R.model,kernelManager:a.kernels,kernelspecsManager:a.kernelspecs,sessionManager:a.sessions});g(a),f(ye)}}catch{i||(g(null),f(void 0))}})(),()=>{i=!0,j?.(),a&&Ue(a)}},[t,d,m?.runtime_name,m?.url,m?.token]),r.useEffect(()=>(v?.(p?.connection??null),()=>{v?.(null)}),[p,v]);const E=re,_=!!((String(s||"").trim()||String(l?.baseUrl||"").trim()||t)&&!E);He(`ephemeral-document-start-${o}`,_);const oe=r.useMemo(()=>Se({name:"@datalayer/agent-runtimes/EphemeralDocument",namespace:`ephemeral-document-${o}`,theme:Xe,dependencies:[Qe,...U?[Pe]:[]],onError(i){console.error("[EphemeralDocument]",i)}}),[o,U]),ie=r.useCallback(i=>{if(!w)return;const a=JSON.stringify(i.toJSON());a!==I.current&&(I.current=a,w(a))},[w]),[x,se]=r.useState(null),[,z]=r.useState(!1),y=h?n?.roomId:void 0,[ae,le]=r.useState(),ce=y===void 0||ae===y,me=r.useCallback(i=>le(i?y:void 0),[y]),de=i=>{i!==null&&se(i)},{colorMode:ue,theme:he}=je(),k=X??ue,ge=Q??he,fe=we(),S=ve(ge),J=k==="auto"?fe:k,c=(J==="dark"?S.themeStyles.dark:S.themeStyles.light).backgroundColor??"";return e.jsx(M,{flex:1,minHeight:0,height:"100%",position:"relative",overflow:"hidden",bg:"canvas.default",children:E?e.jsx(Y,{inherit:N,colorMode:k,themeConfig:S,children:e.jsx(Ce,{colormode:J,backgroundColor:c,children:e.jsx(M,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",overscrollBehaviorY:"contain",padding:2,backgroundColor:c,"--bgColor-default":c,"& .editor-shell":{backgroundColor:c,borderRadius:2,display:"flex",flexDirection:"column",minHeight:0,flex:1,maxWidth:"none",width:"100%",margin:0},"& .editor-container":{backgroundColor:c,display:"flex",flexDirection:"column",minHeight:0,flex:1,width:"100%",maxWidth:"none",margin:0},"& .editor-inner":{backgroundColor:c,display:"flex",flexDirection:"column",minHeight:0,flex:1,width:"100%",maxWidth:"none"},"& .editor-scroller":{minHeight:0,flex:1,overflow:"auto",width:"100%",maxWidth:"none"},"& .editor":{minHeight:"100%",width:"100%",maxWidth:"none",margin:0},"& .editor-input":{backgroundColor:c,width:"100%",maxWidth:"none",margin:0},"& .ContentEditable__root":{width:"100%",maxWidth:"none",margin:0},'& [role="toolbar"][aria-label="Editor toolbar"]':{backgroundColor:c}},children:e.jsx(Ae,{lexicalId:o,serviceManager:E,children:e.jsx(Ee,{extension:oe,contentEditable:null,children:e.jsx(Ie,{children:e.jsx(Le,{children:e.jsxs("div",{className:"editor-shell",children:[O?e.jsx(tt,{setIsLinkEditMode:z,extraItems:Z}):null,e.jsx("div",{className:"editor-container",children:e.jsxs("div",{className:"editor-inner",children:[h&&n?e.jsx(We,{id:n.roomId,providerFactory:Fe,websocketUrl:n.websocketUrl,shouldBootstrap:!0,showCollaborators:!0,username:ee,cursorColor:te,awarenessData:ne,onInitialization:me}):null,e.jsx(_e,{}),ce?e.jsx("div",{className:"editor-scroller",children:e.jsx("div",{className:"editor",ref:de,children:e.jsx(be,{className:"editor-input","aria-label":"Ephemeral document editor"})})}):e.jsx(G,{maxWidth:"100%"}),!h&&e.jsx(Re,{onChange:ie}),e.jsx(et,{disabled:h}),!h&&e.jsx(Oe,{content:A}),e.jsx(ze,{}),e.jsx(Je,{}),e.jsx(Ve,{}),e.jsx(qe,{kernel:p}),e.jsx(Ke,{kernel:p}),x&&e.jsxs(e.Fragment,{children:[e.jsx($e,{anchorElem:x}),e.jsx(Ge,{anchorElem:x,setIsLinkEditMode:z}),e.jsx(Ye,{anchorElem:x})]})]})})]})})})})})})})}):_?e.jsx(Y,{inherit:N,colorMode:k,themeConfig:S,children:e.jsx(M,{position:"absolute",inset:0,display:"flex",flexDirection:"column",padding:2,backgroundColor:c,children:e.jsx(G,{label:"Starting the document",maxWidth:"100%"})})}):null})}export{Ut as EphemeralDocument,Ut as default};
|
package/dist-embed/chunks/{ExcalidrawComponent-Qv9LHutW.js → ExcalidrawComponent-DeNgg0ms.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as p,K as N,bS as T,bT as z,bU as L,bV as F,bW as R,I as O,bX as U}from"../datalayer-app-main.js";import{x as _,y as W,z as $,A as M}from"./JupyterLexicalExtension-
|
|
1
|
+
import{r as o,j as p,K as N,bS as T,bT as z,bU as L,bV as F,bW as R,I as O,bX as U}from"../datalayer-app-main.js";import{x as _,y as W,z as $,A as M}from"./JupyterLexicalExtension-Ght2bbbp.js";import H from"./ExcalidrawModal-X6Yh6FKI.js";import{r as X}from"./percentages-BXMCSKIN-X4aF_7zv.js";import{u as V}from"./ThemeContext-D9ztCaU3.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./url-CzjbCo42.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-CGQDY041.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./PrismCss-CcU1ChRk.js";import"./Output-no9rnFJ7.js";import"./index-CFP9psRB.js";import"./hoverbox-CStlKQWE.js";import"./index-DSN70XMH.js";import"./index-S4sn4R3i.js";import"./color-CG7_7V2-.js";import"./isEqual-g-jK7vY0.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";import"./LexicalToolRegistry-8wJyLumb.js";import"./extends-CF3RwP-h.js";import"./index-BvgsWH_d.js";import"./index-DoBkwclg.js";const J=e=>{const n=e?.firstElementChild?.firstElementChild,b=e.getAttribute("viewBox");if(b!=null){const a=b.split(" ");e.setAttribute("width",a[2]),e.setAttribute("height",a[3])}n&&n.tagName==="style"&&n.remove()};function P({elements:e,files:n,imageContainerRef:b,appState:a,rootClassName:s=null,width:c="inherit",height:C="inherit"}){const[g,x]=o.useState(null),{theme:E}=V(g),[B,u]=o.useState(null),[v,S]=o.useState(0);o.useEffect(()=>{const r=new MutationObserver(w=>{for(const h of w)if(h.type==="attributes"&&(h.attributeName==="style"||h.attributeName==="class")){S(l=>l+1);break}});return r.observe(document.documentElement,{attributes:!0,attributeFilter:["style","class"]}),r.observe(document.body,{attributes:!0,attributeFilter:["style","class"]}),()=>r.disconnect()},[]),o.useEffect(()=>{(async()=>{await new Promise(D=>setTimeout(D,150));const w=["#ffffff","#000000","transparent",""],h=a?.viewBackgroundColor||"transparent",l=w.includes(h.toLowerCase()),A={...a,viewBackgroundColor:l?"transparent":a?.viewBackgroundColor,exportBackground:!l,exportWithDarkMode:E==="dark"},m=await X({appState:A,elements:e,files:n});J(m),m.setAttribute("width","100%"),m.setAttribute("height","100%"),m.setAttribute("display","block"),u(m)})()},[e,n,a,E,v]);const f={};c!=="inherit"&&(f.width=`${c}px`),C!=="inherit"&&(f.height=`${C}px`);const k=a?.viewBackgroundColor||"transparent";if(["#ffffff","#000000","transparent",""].includes(k.toLowerCase())){const r=E==="dark"?"#1e1e1e":"#ffffff";f.backgroundColor=`var(--bgColor-default, var(--jp-layout-color0, var(--vscode-editor-background, ${r})))`}return p.jsx("div",{ref:r=>{x(r),r&&b&&(b.current=r)},className:s??"",style:f,dangerouslySetInnerHTML:{__html:B?.outerHTML??""}})}function Bt({nodeKey:e,data:n,width:b,height:a}){const[s]=N(),c=_(),[C,g]=o.useState(n==="[]"&&s.isEditable()),x=o.useRef(null),E=o.useRef(null),B=o.useRef(null),[u,v,S]=W(e),[f,k]=o.useState(!1);o.useEffect(()=>{if(!c){u&&S();return}return T(s.registerCommand(z,t=>{const d=E.current,i=t.target;return f?!0:d!==null&&L(i)&&d.contains(i)?(t.shiftKey||S(),v(!u),t.detail>1&&g(!0),!0):!1},F))},[S,s,u,f,v,c]);const j=o.useCallback(()=>(g(!1),s.update(()=>{const t=R(e);t&&t.remove()})),[s,e]),I=(t,d,i)=>s.update(()=>{const y=R(e);M(y)&&(t&&t.length>0||Object.keys(i).length>0?y.setData(JSON.stringify({appState:d,elements:t,files:i})):y.remove())}),r=()=>{k(!0)},w=(t,d)=>{setTimeout(()=>{k(!1)},200),s.update(()=>{const i=R(e);M(i)&&(i.setWidth(t),i.setHeight(d))})},h=o.useCallback(()=>{g(!0)},[]),{elements:l=[],files:A={},appState:m={}}=o.useMemo(()=>JSON.parse(n),[n]),D=o.useCallback(()=>{g(!1),l.length===0&&s.update(()=>{const t=R(e);t&&t.remove()})},[s,e,l.length]);return p.jsxs(p.Fragment,{children:[c&&C&&p.jsx(H,{initialElements:l,initialFiles:A,initialAppState:m,isShown:C,onDelete:j,onClose:D,onSave:(t,d,i)=>{I(t,d,i),g(!1)},closeOnClickOutside:!1}),l.length>0&&p.jsxs("button",{ref:E,className:`excalidraw-button ${u?"selected":""}`,children:[p.jsx(P,{imageContainerRef:x,className:"image",elements:l,files:A,appState:m,width:b,height:a}),u&&c&&p.jsx(O,{icon:U,"aria-label":"Edit the drawing",size:"small",variant:"default",sx:{position:"absolute",top:8,right:8,zIndex:10},onMouseDown:t=>t.preventDefault(),onClick:h}),(u||f)&&c&&p.jsx($,{buttonRef:B,showCaption:!0,setShowCaption:()=>null,imageRef:x,editor:s,onResizeStart:r,onResizeEnd:w})]})]})}export{Bt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,j as o,D as u,bi as h,c as f}from"../datalayer-app-main.js";import{I as T}from"./percentages-BXMCSKIN-
|
|
1
|
+
import{r as t,j as o,D as u,bi as h,c as f}from"../datalayer-app-main.js";import{I as T}from"./percentages-BXMCSKIN-X4aF_7zv.js";import{u as z}from"./ThemeContext-D9ztCaU3.js";import"./JupyterLexicalExtension-Ght2bbbp.js";import"./NotebookSkeleton-CI7ovjNW.js";import"./Avatar-9MpXENSs.js";import"./url-CzjbCo42.js";import"./isSymbol-BLtK9CV6.js";import"./toNumber-B1wj8-wx.js";import"./VideoIcon-BjP_LDa4.js";import"./LinkIcon-DUI0jw25.js";import"./Toolbar-CGQDY041.js";import"./KebabHorizontalIcon-CXDXtkuL.js";import"./ArrowUpIcon-BUCpIXDR.js";import"./SortDescIcon-CS4EzHeS.js";import"./PaintbrushIcon-CLU8RilX.js";import"./PrismCss-CcU1ChRk.js";import"./Output-no9rnFJ7.js";import"./index-CFP9psRB.js";import"./hoverbox-CStlKQWE.js";import"./index-DSN70XMH.js";import"./index-S4sn4R3i.js";import"./color-CG7_7V2-.js";import"./isEqual-g-jK7vY0.js";import"./defaultLocale-5voVPcsN.js";import"./index-DbMBnR4l.js";import"./index-BJhxZF_K.js";import"./RestartIcon-Ca6_HoK0.js";import"./LexicalToolRegistry-8wJyLumb.js";import"./extends-CF3RwP-h.js";import"./index-BvgsWH_d.js";import"./index-DoBkwclg.js";function pe({closeOnClickOutside:I=!1,onSave:x,initialElements:l,initialAppState:g,initialFiles:d,isShown:n=!1,onDelete:v,onClose:c}){const[w,C]=t.useState(null),{theme:b}=z(w),m=t.useRef(null),E=t.useCallback(e=>{m.current=e,C(e)},[]),[r,k]=t.useState(null),[j,i]=t.useState(!1),[p,M]=t.useState(l),[D,S]=t.useState(d);t.useEffect(()=>{m.current?.focus()},[]),t.useEffect(()=>{if(!r||!n)return;const e=()=>r.refresh(),a=requestAnimationFrame(e),s=setTimeout(e,300);return window.addEventListener("resize",e),()=>{cancelAnimationFrame(a),clearTimeout(s),window.removeEventListener("resize",e)}},[r,n]);const A=()=>{if(p?.some(e=>!e.isDeleted)){const e=r?.getAppState(),a={exportBackground:e?.exportBackground,exportScale:e?.exportScale,exportWithDarkMode:e?.theme==="dark",isBindingEnabled:e?.isBindingEnabled,isLoading:e?.isLoading,name:e?.name,theme:e?.theme,viewBackgroundColor:e?.viewBackgroundColor,viewModeEnabled:e?.viewModeEnabled,zenModeEnabled:e?.zenModeEnabled,zoom:e?.zoom};x(p,a,D)}else v()},B=()=>{i(!0)};if(n===!1)return null;const y=(e,a,s)=>{M(e),S(s)};return o.jsxs(o.Fragment,{children:[o.jsxs(u,{title:"Excalidraw",onClose:()=>c(),width:"xlarge",height:"auto",sx:{width:"80vw !important",maxWidth:"80vw !important",height:"80vh !important",maxHeight:"80vh !important"},children:[o.jsx(h,{ref:E,tabIndex:-1,sx:{height:"calc(80vh - 140px)",position:"relative",overflow:"hidden"},children:o.jsx(T,{onChange:y,excalidrawAPI:e=>k(e),initialData:{appState:g||{isLoading:!1},elements:l,files:d},theme:b})}),o.jsxs(h,{sx:{display:"flex",gap:2,justifyContent:"flex-end",p:2,borderTop:"1px solid",borderColor:"var(--borderColor-default)"},children:[o.jsx(f,{variant:"invisible",onClick:B,children:"Discard"}),o.jsx(f,{variant:"primary",onClick:A,children:"Save"})]})]}),j&&o.jsx(u,{title:"Discard",onClose:()=>i(!1),width:"small",height:"auto",footerButtons:[{buttonType:"danger",content:"Discard",onClick:()=>{i(!1),c()}},{buttonType:"default",content:"Cancel",onClick:()=>i(!1)}],children:"Are you sure you want to discard the changes?"})]})}export{pe as default};
|