1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1329],{3818:(e,t,n)=>{n.d(t,{C:()=>l,w:()=>c});var r=n(95155),i=n(27199),o=n(51616),a=n(12115),s=n(66201);function l(e){let t,n,l,c;let u=(0,i.c)(9),{children:d,setDisplayedDocument:p,documentId:f}=e;u[0]!==p?(t=e=>p(t=>o(t,e)?t:e),u[0]=p,u[1]=t):t=u[1];let m=t;return u[2]!==f||u[3]!==p?(n=()=>{if(f)return;let e=setTimeout(()=>p(null));return()=>clearTimeout(e)},l=[f,p],u[2]=f,u[3]=p,u[4]=n,u[5]=l):(n=u[4],l=u[5]),(0,a.useEffect)(n,l),u[6]!==d||u[7]!==m?(c=(0,r.jsx)(s.Af.Provider,{value:m,children:d}),u[6]=d,u[7]=m,u[8]=c):c=u[8],c}function c(){return(0,a.useContext)(s.Af)}},51329:(e,t,n)=>{let r;n.r(t),n.d(t,{default:()=>tM});var i=n(95155),o=n(27199),a=n(63340),s=n(83060),l=n(24323),c=n(90621),u=n(12115),d=n(54557),p=n(50152),f=n(6814),m=n(25356),h=n(67192),v=n(71286),g=n(44987),x=n(46295),y=n(66201),b=n(90330),w=n(47242),j=n(30994),_=n(3818);let S={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},E=new Uint8Array(16),P=[];for(let e=0;e<256;++e)P.push((e+256).toString(16).slice(1));let k=function(e,t,n){if(S.randomUUID&&!t&&!e)return S.randomUUID();let i=(e=e||{}).random??e.rng?.()??function(){if(!r){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(E)}();if(i.length<16)throw Error("Random bytes length must be >= 16");if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){if((n=n||0)<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=i[e];return t}return function(e,t=0){return(P[e[t+0]]+P[e[t+1]]+P[e[t+2]]+P[e[t+3]]+"-"+P[e[t+4]]+P[e[t+5]]+"-"+P[e[t+6]]+P[e[t+7]]+"-"+P[e[t+8]]+P[e[t+9]]+"-"+P[e[t+10]]+P[e[t+11]]+P[e[t+12]]+P[e[t+13]]+P[e[t+14]]+P[e[t+15]]).toLowerCase()}(i)};var C=n(61300),R=n(60760),z=n(51508),I=n(95500),T=n(82885);function $(e){let{children:t,isValidProp:n,...r}=e;n&&(0,I.D)(n),(r={...(0,u.useContext)(z.Q),...r}).isStatic=(0,T.M)(()=>r.isStatic);let o=(0,u.useMemo)(()=>r,[JSON.stringify(r.transition),r.transformPagePoint,r.reducedMotion]);return(0,i.jsx)(z.Q.Provider,{value:o,children:t})}var A=n(47650),M=n(51408);function L(){if("u">typeof crypto){let e=new Uint8Array(16);crypto.getRandomValues(e);let t="";for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,"0");return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/[=]+$/,"")}return Math.random().toString(36).slice(2)}async function O(e,t,n,r){let i=e.withConfig({apiVersion:a.XV}),o=L(),s=i.patch(a.YL).set({secret:o,studioUrl:n,userId:r});return await i.transaction().createIfNotExists({_id:a.YL,_type:a.dR,source:t,studioUrl:n,userId:r}).patch(s).commit({tag:a.Tc}),{secret:o}}async function U(e,t,n,r){let i=e.withConfig({apiVersion:a.XV}),o=i.patch(a.YL).set({secret:null,studioUrl:n,userId:r});await i.transaction().createIfNotExists({_id:a.YL,_type:a.dR,source:t,studioUrl:n,userId:r}).patch(o).commit({tag:a.Tc})}var Y=n(63296),B=n(51616);function D(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function N(e){return e&&e.sensitive?"":"i"}var W=n(29206);async function F(e,t,n,r,i=(0,c.A)()){let o=e.withConfig({apiVersion:a.XV});try{let e=new Date(Date.now()+1e3*a.eZ),s=`drafts.${i}`,l=L(),c=o.patch(s).set({secret:l,source:t,studioUrl:n,userId:r});return await o.transaction().createOrReplace({_id:s,_type:a.uf}).patch(c).commit({tag:a.Tc}),{secret:l,expiresAt:e}}finally{try{await o.delete({query:a.W_})}catch(e){console.error("Failed to delete expired secrets",e)}}}let V=e=>"object"==typeof e&&"function"==typeof e.then,Z=[],H=(e,t,n)=>(function(e,t=null,n=!1,r={}){for(let i of(null===t&&(t=[e]),Z))if(function(e,t,n=(e,t)=>e===t){if(e===t)return!0;if(!e||!t)return!1;let r=e.length;if(t.length!==r)return!1;for(let i=0;i<r;i++)if(!n(e[i],t[i]))return!1;return!0}(t,i.keys,i.equal)){if(n)return;if(Object.prototype.hasOwnProperty.call(i,"error"))throw i.error;if(Object.prototype.hasOwnProperty.call(i,"response"))return r.lifespan&&r.lifespan>0&&(i.timeout&&clearTimeout(i.timeout),i.timeout=setTimeout(i.remove,r.lifespan)),i.response;if(!n)throw i.promise}let i={keys:t,equal:r.equal,remove:()=>{let e=Z.indexOf(i);-1!==e&&Z.splice(e,1)},promise:(V(e)?e:e(...t)).then(e=>{i.response=e,r.lifespan&&r.lifespan>0&&(i.timeout=setTimeout(i.remove,r.lifespan))}).catch(e=>i.error=e)};if(Z.push(i),!n)throw i.promise})(e,t,!1,n);var J=(0,u.memo)(e=>{let t,n;let r=(0,o.c)(3),{comlink:i}=e;return r[0]!==i?(t=()=>i.on("visual-editing/features",K),n=[i],r[0]=i,r[1]=t,r[2]=n):(t=r[1],n=r[2]),(0,u.useEffect)(t,n),null});function K(){return{features:{optimistic:!0}}}function q(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(e,r)},t)}}let X=function(e){let t,n,r,a,s,l,c,d;let p=(0,o.c)(14),{comlink:f,children:m}=e;p[0]===Symbol.for("react.memo_cache_sentinel")?(t={},p[0]=t):t=p[0];let h=(0,u.useRef)(t);p[1]!==f?(n=()=>f?.on("visual-editing/shared-state",()=>({state:h.current})),r=[f],p[1]=f,p[2]=n,p[3]=r):(n=p[2],r=p[3]),(0,u.useEffect)(n,r),p[4]!==f?(a=(e,t)=>{h.current[e]=t,f?.post("presentation/shared-state",{key:e,value:t})},p[4]=f,p[5]=a):a=p[5];let v=a;p[6]!==f?(s=e=>{f?.post("presentation/shared-state",{key:e}),delete h.current[e]},p[6]=f,p[7]=s):s=p[7];let g=s;return p[8]!==g||p[9]!==v?(c={removeValue:g,setValue:v}
1,p[8]=g,p[9]=v,p[10]=c):c=p[10],l=c,p[11]!==m||p[12]!==l?(d=(0,i.jsx)(y.En.Provider,{value:l,children:m}),p[11]=m,p[12]=l,p[13]=d):d=p[13],d},G=g.I4.div` 2 overflow: hidden; 3 flex-basis: 0; 4 flex-shrink: 1; 5`,Q=function(e){let t,n,r,a;let s=(0,o.c)(15),{children:l,defaultSize:c,id:d,minWidth:p,maxWidth:f,order:m}=e,h=void 0===c?null:c,v=void 0===m?0:m,g=(0,u.useContext)(y.Tf);if(null===g)throw Error("Panel components must be rendered within a PanelGroup container");let{getPanelStyle:x,registerElement:b,unregisterElement:w}=g;s[0]!==x||s[1]!==d?(t=x(d),s[0]=x,s[1]=d,s[2]=t):t=s[2];let j=t;return s[3]!==h||s[4]!==d||s[5]!==f||s[6]!==p||s[7]!==v||s[8]!==b||s[9]!==w?(n=()=>(b(d,{id:d,type:"panel",defaultSize:h,maxWidth:f??null,minWidth:p??0,order:v}),()=>{w(d)}),r=[d,h,v,f,p,b,w],s[3]=h,s[4]=d,s[5]=f,s[6]=p,s[7]=v,s[8]=b,s[9]=w,s[10]=n,s[11]=r):(n=s[10],r=s[11]),(0,u.useLayoutEffect)(n,r),s[12]!==l||s[13]!==j?(a=(0,i.jsx)(G,{style:j,children:l}),s[12]=l,s[13]=j,s[14]=a):a=s[14],a},ee="presentation/panels",et=()=>JSON.parse(localStorage.getItem(ee)||"{}"),en=e=>{localStorage.setItem(ee,JSON.stringify(e))},er=e=>e.map(e=>[e.id,e.order].join(":")).join(",");function ei(e,t){let n=et(),r=er(e);en({...n,[r]:t})}function eo(e){let t=et(),n=er(e);return Array.isArray(t[n])&&t[n].some(ea)?void 0:t[n]}function ea(e){return null===e}
5function es(e,t,n){let{maxWidth:r,minWidth:i}=e;return Math.min(null==r?100:r/n*100,Math.max(i/n*100,t))}function el(e,t,n=0,r=null){return e.clientX-(r||t.getBoundingClientRect()).left-n}function ec(e){return"panel"===e.type}function eu(e){return"resizer"===e.type}function ed(e){return Array.from(e.values()).sort(({order:e},{order:t})=>null==e&&null==t?0:null==e?-1:null==t?1:e-t)}function ep(e,t,n){let r=t.reduce((e,t)=>e+t,0),i=[...t].map(e=>e/r*100),o=0;for(let t=0;t<e.length;t++){let r=e[t],a=i[t],s=es(r,a,n);a!=s&&(o+=a-s,i[t]=s)}if("0.000"!==o.toFixed(3))for(let t=0;t<e.length;t++){let{maxWidth:r,minWidth:a}=e[t];a=a/n*100,null!=r&&(r=r/n*100);let s=Math.min(r??100,Math.max(a,i[t]+o));if(s!==i[t]&&(o-=s-i[t],i[t]=s,"0.000"===Math.abs(o).toFixed(3)))break}return i}let ef=g.I4.div` 6 display: flex; 7 flex-direction: row; 8 height: 100%; 9 overflow: hidden; 10 width: 100%; 11`,em=function(e){let t,n,r,a,s,l,c,d,p,f,m,h,v,g,x,b,w,j,_,S,E,P,k,C;let R=(0,o.c)(46),{children:z}=e,I=(0,u.useRef)(null);R[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Map,R[0]=t):t=R[0];let[T,$]=(0,u.useState)(t);R[1]!==T?(r=ed(T).filter(ec),R[1]=T,R[2]=r):r=R[2],n=r,R[3]===Symbol.for("react.memo_cache_sentinel")?(a=[],R[3]=a):a=R[3];let[A,M]=(0,u.useState)(a),[L,O]=(0,u.useState)(null);R[4]!==T||R[5]!==n||R[6]!==A?(s={elements:T,panels:n,widths:A},R[4]=T,R[5]=n,R[6]=A,R[7]=s):s=R[7];let U=(0,u.useRef)(s);R[8]!==L||R[9]!==n||R[10]!==A?(l=e=>({flexGrow:function(e,t,n){if(1===e.length)return"100";let r=n[e.findIndex(e=>e.id===t)];return null==r?"0":r.toPrecision(10)}(n,e,A),pointerEvents:null===L?void 0:"none"}),R[8]=L,R[9]=n,R[10]=A,R[11]=l):l=R[11];let Y=l;R[12]===Symbol.for("react.memo_cache_sentinel")?(c=(e,t)=>{$(n=>{if(n.has(e))return n;let r=new Map(n);return r.set(e,t),r})},R[12]=c):c=R[12];let B=c;R[13]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{$(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},R[13]=d):d=R[13];let D=d;R[14]===Symbol.for("react.memo_cache_sentinel")?(p={containerWidth:window.innerWidth,dragOffset:0,panelAfter:null,panelBefore:null,resizerIndex:-1,resizerRect:null,startX:0,widths:[]},R[14]=p):p=R[14];let N=(0,u.useRef)(p);R[15]!==T?(f=(e,t)=>{let n=ed(T),r=n.findIndex(t=>t.id===e),i=T.get(e);if(!i||!eu(i))return;let o=i.el.current;o&&(N.current={resizerIndex:r,panelBefore:n.reduce((e,t,n)=>ec(t)&&n<r?t:e,null),panelAfter:n.reduce((e,t,n)=>null===e&&ec(t)&&n>r?t:e,null),containerWidth:window.innerWidth,startX:t.pageX,dragOffset:el(t,o),resizerRect:o.getBoundingClientRect(),widths:U.current.widths},O(e))},R[15]=T,R[16]=f):f=R[16];let W=f;R[17]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{O(null)},R[17]=m):m=R[17];let F=m;R[18]!==T?(h=(e,t)=>{t.preventDefault(),t.stopPropagation();let{containerWidth:n,dragOffset:r,panelBefore:i,panelAfter:o,resizerRect:a}=N.current;if(null==i||null==o)return;let s=T.get(e);if(!s||!eu(s))return;let l=s.el.current;if(!l)return;let c=el(t,l,r,a);if(0===c)return;let{widths:u}=U.current,d=function(e,t,n,r,i,o){let{panels:a,widths:s}=i,{widths:l}=o,c=l||s,u=[...c];{let i=e<0?r:n,o=c[a.findIndex(e=>e.id===i.id)],s=es(i,o+Math.abs(e),t);if(o===s)return c;e=e<0?o-s:s-o}let d=0,p=e<0?n:r,f=a.findIndex(e=>e.id===p.id);for(;;){let n=a[f],r=c[f],i=es(n,r-(Math.abs(e)-Math.abs(d)),t);if(r!==i&&(d+=r-i,u[f]=i,d.toPrecision(10).localeCompare(Math.abs(e).toPrecision(10),void 0,{numeric:!0})>=0))break;if(e<0){if(--f<0)break}else if(++f>=a.length)break}return 0===d?c:(p=e<0?r:n,u[f=a.findIndex(e=>e.id===p.id)]=c[f]+d,u)}(c/I.current.getBoundingClientRect().width*100,n,i,o,U.current,N.current);u.some((e,t)=>e!==d[t])&&M(d)},R[18]=T,R[19]=h):h=R[19];let V=h;R[20]!==T||R[21]!==n||R[22]!==A?(v=()=>{U.current.elements=T,U.current.panels=n,U.current.widths=A},g=[T,n,A],R[20]=T,R[21]=n,R[22]=A,R[23]=v,R[24]=g):(v=R[23],g=R[24]),(0,u.useLayoutEffect)(v,g);let Z=function(){let e;let t=(0,o.c)(1);if(t[0]===Symbol.for("react.memo_cache_sentinel")){let n=q(ei,100);e={get:eo,set:ei,setDebounced:n},t[0]=e}else e=t[0];return e}();return R[25]!==n||R[26]!==Z?(x=()=>{let{widths:e}=U.current;if(e.length===n.length)return;let t=Z.get(n);if(t){M(ep(n,t,window.innerWidth));return}M(function(e){let t=e.length,n=100,r=e.map(e=>e.defaultSize?(n-=e.defaultSize,t-=1,e.defaultSize):null),i=n/t;return r.map(e=>null===e?i:e)}(n))},b=[Z,n],R[25]=n,R[26]=Z,R[27]=x,R[28]=b):(x=R[27],b=R[28]),(0,u.useLayoutEffect)(x,b),R[29]!==n||R[30]!==Z||R[31]!==A?(w=()=>{A.length&&Z.setDebounced(n,A)},j=[Z,n,A],R[29]=n,R[30]=Z,R[31]=A,R[32]=w,R[33]=j):(w=R[32],j=R[33]),(0,u.useEffect)(w,j),R[34]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{let e=new ResizeObserver(()=>{let{panels:e,widths:t}=U.current,n=ep(e,t,window.innerWidth);t.some((e,t)=>e!==n[t])&&M(n)});return e.observe(I.current),()=>{e.disconnect()}},S=[],R[34]=_,R[35]=S):(_=R[34],S=R[35]),(0,u.useLayoutEffect)(_,S),R[36]!==L||R[37]!==V||R[38]!==Y||R[39]!==W?(P={activeResizer:L,drag:V,getPanelStyle:Y,registerElement:B,startDragging:W,stopDragging:F,unregisterElement:D},R[36]=L,R[37]=V,R[38]=Y,R[39]=W,R[40]=P):P=R[40],E=P,R[41]!==z?(k=(0,i.jsx)(ef,{ref:I,children:z}),R[41]=z,R[42]=k):k=R[42],R[43]!==E||R[44]!==k?(C=(0,i.jsx)(y.Tf.Provider,{value:E,children:k}),R[43]=E,R[44]=k,R[45]=C):C=R[45],C};function eh(e){let t,n,r,a,l,c,u,f,m,h,v,g,x,y,b,w;let _=(0,o.c)(37);_[0]!==e?({children:t,message:n,onRetry:a,onContinueAnyway:r,...l}=e,_[0]=e,_[1]=t,_[2]=n,_[3]=r,_[4]=a,_[5]=l):(t=_[1],n=_[2],r=_[3],a=_[4],l=_[5]);let{t:S}=(0,d.Bdt)(p.Yi);_[6]!==S?(c=S("error-card.retry-button.text"),_[6]=S,_[7]=c):c=_[7],_[8]!==a||_[9]!==c?(u=(0,i.jsx)(j.$n,{mode:"ghost",onClick:a,text:c}
11),_[8]=a,_[9]=c,_[10]=u):u=_[10];let E=u;_[11]!==S?(f=S("error-card.continue-button.text"),_[11]=S,_[12]=f):f=_[12],_[13]!==r||_[14]!==f?(m=(0,i.jsx)(j.$n,{mode:"ghost",tone:"critical",onClick:r,text:f}),_[13]=r,_[14]=f,_[15]=m):m=_[15];let P=m;return _[16]!==S?(h=S("error-card.title"),_[16]=S,_[17]=h):h=_[17],_[18]!==h?(v=(0,i.jsx)(s.EY,{size:1,weight:"semibold",children:h}),_[18]=h,_[19]=v):v=_[19],_[20]!==n?(g=(0,i.jsx)(s.EY,{muted:!0,size:1,children:n}),_[20]=n,_[21]=g):g=_[21],_[22]!==v||_[23]!==g?(x=(0,i.jsxs)(s.BJ,{space:3,children:[v,g]}),_[22]=v,_[23]=g,_[24]=x):x=_[24],_[25]!==P||_[26]!==r||_[27]!==a||_[28]!==E?(y=a&&r?(0,i.jsxs)(s.cV,{space:2,children:[E,P]}):a?(0,i.jsx)(s.az,{children:E}):r?(0,i.jsx)(s.az,{children:P}):null,_[25]=P,_[26]=r,_[27]=a,_[28]=E,_[29]=y):y=_[29],_[30]!==t||_[31]!==x||_[32]!==y?(b=(0,i.jsx)(s.so,{align:"center",height:"fill",justify:"center",children:(0,i.jsx)(s.mc,{padding:4,sizing:"border",width:0,children:(0,i.jsxs)(s.BJ,{space:4,children:[x,t,y]})})}),_[30]=t,_[31]=x,_[32]=y,_[33]=b):b=_[33],_[34]!==l||_[35]!==b?(w=(0,i.jsx)(s.Zp,{height:"fill",...l,children:b}),_[34]=l,_[35]=b,_[36]=w):w=_[36],w}let ev=(0,u.forwardRef)(function(e,t){let n,r,a,s,l;let c=(0,o.c)(11);return c[0]!==e?({searchParams:r,...n}=e,c[0]=e,c[1]=n,c[2]=r):(n=c[1],r=c[2]),c[3]!==r?(a=Object.entries(r),c[3]=r,c[4]=a):a=c[4],c[5]!==a?(s={type:void 0,_searchParams:a},c[5]=a,c[6]=s):s=c[6],c[7]!==t||c[8]!==n||c[9]!==s?(l=(0,i.jsx)(v.s8,{...n,ref:t,state:s,title:void 0}),c[7]=t,c[8]=n,c[9]=s,c[10]=l):l=c[10],l}),eg=(0,u.forwardRef)(function(e,t){let n,r,a,s,l,c,u;let d=(0,o.c)(15);if(d[0]!==e){let{documentId:t,documentType:i,parentRefPath:o,template:l,searchParams:c,...u}=e;n=t,r=i,s=c,a=u,d[0]=e,d[1]=n,d[2]=r,d[3]=a,d[4]=s}else n=d[1],r=d[2],a=d[3],s=d[4];return d[5]!==s?(l=Object.entries(s),d[5]=s,d[6]=l):l=d[6],d[7]!==n||d[8]!==r||d[9]!==l?(c={id:n,type:r,_searchParams:l},d[7]=n,d[8]=r,d[9]=l,d[10]=c):c=d[10],d[11]!==t||d[12]!==a||d[13]!==c?(u=(0,i.jsx)(v.s8,{...a,ref:t,state:c,title:void 0}),d[11]=t,d[12]=a,d[13]=c,d[14]=u):u=d[14],u});function ex(e){let t,n,r,a,s,l,c,u,p,f,m;let h=(0,o.c)(26),{children:g,onStructureParams:x,structureParams:b,searchParams:w,refs:j}=e,{state:_,resolvePathFromState:S}=(0,v.rd)();h[0]!==_._searchParams?(t=Object.fromEntries(_._searchParams||[]),h[0]=_._searchParams,h[1]=t):t=h[1];let E=(0,d.$6H)(t);h[2]!==S||h[3]!==E||h[4]!==_?(n=e=>{let t=S(_),n=function(e){let t=["comment","inspect","instruction","pathKey","rev","since","template","view"];return function(e={}){let t=Object.entries(e).map(([e,t])=>`${e}=${t}`).join("&");return t.length?`?${t}`:""}(Object.entries(e).filter(([e])=>t.includes(e)).reduce((e,[t,n])=>null==n?e:{...e,[t]:n},{}))}({...E,...e});return`${t}${n}`},h[2]=S,h[3]=E,h[4]=_,h[5]=n):n=h[5];let P=n;return h[6]===Symbol.for("react.memo_cache_sentinel")?(a={},h[6]=a):a=h[6],h[7]===Symbol.for("react.memo_cache_sentinel")?(s=[],h[7]=s):s=h[7],h[8]!==j||h[9]!==w?(l=e=>{let{childId:t,...n}=e,r=j?.find(e=>e._id===t||d.IMx(e._id)===t);return r?(0,i.jsx)(v.s8,{...n,state:{id:t,type:r._type,_searchParams:Object.entries(w)}}):(0,i.jsx)("div",{...n})},h[8]=j,h[9]=w,h[10]=l):l=h[10],h[11]!==w?(c=e=>(0,i.jsx)(ev,{...e,searchParams:w}),u=e=>(0,i.jsx)(eg,{...e,searchParams:w}),h[11]=w,h[12]=c,h[13]=u):(c=h[12],u=h[13]),h[14]!==x?(p=e=>{x({...e,inspect:e.inspect??void 0})},h[14]=x,h[15]=p):p=h[15],h[16]!==P||h[17]!==b||h[18]!==l||h[19]!==c||h[20]!==u||h[21]!==p?(f={index:0,groupIndex:0,siblingIndex:0,payload:a,params:b,hasGroupSiblings:!1,groupLength:1,routerPanesState:s,ChildLink:l,BackLink:c,ReferenceChildLink:u,ParameterizedLink:ek,closeCurrentAndAfter:eP,handleEditReference:eE,replaceCurrent:eS,closeCurrent:e_,duplicateCurrent:ej,setView:ew,setParams:p,setPayload:eb,navigateIntent:ey,createPathWithParams:P},h[16]=P,h[17]=b,h[18]=l,h[19]=c,h[20]=u,h[21]=p,h[22]=f):f=h[22],r=f,h[23]!==g||h[24]!==r?(m=(0,i.jsx)(y.l4.Provider,{value:r,children:g}),h[23]=g,h[24]=r,h[25]=m):m=h[25],m}function ey(e,t,n){console.warn("navigateIntent",e,t,n)}function eb(e){console.warn("setPayload",e)}
11function ew(e){console.warn("setView",e)}function ej(e){console.warn("duplicateCurrent",e)}function e_(){console.warn("closeCurrent")}function eS(e){console.warn("replaceCurrent",e)}function eE(e){console.warn("handleEditReference",e)}function eP(){console.warn("closeCurrentAndAfter")}function ek(){throw Error("ParameterizedLink not implemented")}let eC=(0,g.I4)(w.PaneLayout)` 12 height: 100%; 13`,eR=(0,g.I4)(s.so)` 14 & > div { 15 min-width: none !important; 16 max-width: none !important; 17 } 18`,ez=(0,g.I4)(s.Cy)` 19 white-space: pre-wrap; 20`;function eI(e){let t,n,r,a,l,c,f,m,h,v,g;let x=(0,o.c)(33),{mainDocumentState:y,onStructureParams:b,searchParams:_,refs:S}=e,{t:E}=(0,d.Bdt)(p.Yi),{devMode:P}=(0,p.Qe)();if(x[0]!==y?.document?._id||x[1]!==S){let e;x[3]!==y?.document?._id?(e=e=>(0,d.IMx)(e._id)!==y?.document?._id,x[3]=y?.document?._id,x[4]=e):e=x[4],n=S.filter(e).map(e$),x[0]=y?.document?._id,x[1]=S,x[2]=n}else n=x[2];t=n,x[5]!==t?(a={filter:"_id in $ids",params:{ids:t}},x[5]=t,x[6]=a):a=x[6],x[7]!==E?(l=E("document-list-pane.document-list.title"),x[7]=E,x[8]=l):l=x[8],x[9]!==a||x[10]!==l?(c={id:"$root",options:a,schemaTypeName:"",title:l,type:"documentList"},x[9]=a,x[10]=l,x[11]=c):c=x[11],r=c;let[k,C]=(0,u.useState)(null);x[12]===Symbol.for("react.memo_cache_sentinel")?(f=()=>C(null),x[12]=f):f=x[12];let R=f,[z]=(0,u.useState)(eT);if(x[13]===Symbol.for("react.memo_cache_sentinel")?(m=()=>C(null),x[13]=m):m=x[13],x[14]!==S?(h=[S],x[14]=S,x[15]=h):h=x[15],(0,u.useEffect)(m,h),k){let e,t,n;return x[16]!==E?(e=E("document-list-pane.error.text"),x[16]=E,x[17]=e):e=x[17],x[18]!==P||x[19]!==k||x[20]!==E?(t=P&&(0,i.jsx)(s.Zp,{overflow:"auto",padding:3,radius:2,tone:"critical",children:(0,i.jsxs)(s.BJ,{space:3,children:[(0,i.jsx)(s.JU,{muted:!0,size:0,children:E("presentation-error.label")}),(0,i.jsx)(ez,{size:1,children:k.error.message})]})}),x[18]=P,x[19]=k,x[20]=E,x[21]=t):t=x[21],x[22]!==t||x[23]!==e?(n=(0,i.jsx)(eh,{flex:1,message:e,onRetry:R,children:t}),x[22]=t,x[23]=e,x[24]=n):n=x[24],n}return x[25]!==r?(v=(0,i.jsx)(eR,{direction:"column",flex:1,children:(0,i.jsx)(w.PaneContainer,{index:0,itemId:"$root",pane:r,paneKey:"$root"})}),x[25]=r,x[26]=v):v=x[26],x[27]!==b||x[28]!==S||x[29]!==_||x[30]!==z||x[31]!==v?(g=(0,i.jsx)(j.tH,{onCatch:C,children:(0,i.jsx)(eC,{children:(0,i.jsx)(w.StructureToolProvider,{children:(0,i.jsx)(ex,{onStructureParams:b,structureParams:z,searchParams:_,refs:S,children:v})})})}),x[27]=b,x[28]=S,x[29]=_,x[30]=z,x[31]=v,x[32]=g):g=x[32],g}function eT(){return{}}function e$(e){return(0,d.IMx)(e._id)}let eA=(0,g.I4)(s.Cy)` 21 white-space: pre-wrap; 22`;function eM(e){let t,n,r,a,l,c,f,m,h,g,x;let y=(0,o.c)(35),{documentId:b,documentType:_,onFocusPath:S,onStructureParams:E,searchParams:P,structureParams:k}=e,{template:C,templateParams:R}=k,{t:z}=(0,d.Bdt)(p.Yi),{devMode:I}=(0,p.Qe)();y[0]!==R?(n=(0,v.fA)(R),y[0]=R,y[1]=n):n=y[1],y[2]!==b||y[3]!==_||y[4]!==n||y[5]!==C?(r={id:b,type:_,template:C,templateParameters:n},y[2]=b,y[3]=_,y[4]=n,y[5]=C,y[6]=r):r=y[6],y[7]!==b||y[8]!==r?(a={id:b,options:r,title:"",type:"document"},y[7]=b,y[8]=r,y[9]=a):a=y[9],t=a;let[T,$]=(0,u.useState)(null);y[10]===Symbol.for("react.memo_cache_sentinel")?(l=()=>$(null),y[10]=l):l=y[10];let A=l;if(y[11]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{$(null)},y[11]=c):c=y[11],y[12]!==b||y[13]!==_||y[14]!==k?(f=[b,_,k],y[12]=b,y[13]=_,y[14]=k,y[15]=f):f=y[15],(0,u.useEffect)(c,f),T){let e,t,n;return y[16]!==z?(e=z("document-pane.error.text"),y[16]=z,y[17]=e):e=y[17],y[18]!==I||y[19]!==T||y[20]!==z?(t=I&&(0,i.jsx)(s.Zp,{overflow:"auto",padding:3,radius:2,tone:"critical",children:(0,i.jsxs)(s.BJ,{space:3,children:[(0,i.jsx)(s.JU,{muted:!0,size:0,children:z("presentation-error.label")}),(0,i.jsx)(eA,{size:1,children:T.error.message})]})}),y[18]=I,y[19]=T,y[20]=z,y[21]=t):t=y[21],y[22]!==e||y[23]!==t?(n=(0,i.jsx)(eh,{flex:1,message:e,onRetry:A,children:t}),y[22]=e,y[23]=t,y[24]=n):n=y[24],n}return y[25]===Symbol.for("react.memo_cache_sentinel")?(m={height:"100%"},y[25]=m):m=y[25],y[26]===Symbol.for("react.memo_cache_sentinel")?(h=(0,i.jsx)(p.gu,{}),y[26]=h):h=y[26],y[27]!==S||y[28]!==t?(g=(0,i.jsx)(u.Suspense,{fallback:h,children:(0,i.jsx)(w.DocumentPane,{paneKey:"document",index:1,itemId:"document",pane:t,onFocusPath:S})}),y[27]=S,y[28]=t,y[29]=g):g=y[29],y[30]!==E||y[31]!==P||y[32]!==k||y[33]!==g?(x=(0,i.jsx)(j.tH,{onCatch:$,children:(0,i.jsx)(w.PaneLayout,{style:m,children:(0,i.jsx)(ex,{searchParams:P,onStructureParam
22s:E,structureParams:k,children:g})})}),y[30]=E,y[31]=P,y[32]=k,y[33]=g,y[34]=x):x=y[34],x}function eL(e){let t;let n=(0,o.c)(7),{documentId:r,documentType:a,onFocusPath:s,onStructureParams:l,searchParams:c,structureParams:u}=e;return n[0]!==r||n[1]!==a||n[2]!==s||n[3]!==l||n[4]!==c||n[5]!==u?(t=(0,i.jsx)(w.StructureToolProvider,{children:(0,i.jsx)(eM,{documentId:r,documentType:a,onFocusPath:s,onStructureParams:l,searchParams:c,structureParams:u})}),n[0]=r,n[1]=a,n[2]=s,n[3]=l,n[4]=c,n[5]=u,n[6]=t):t=n[6],t}function eO(e){let t,n,r,a,l,c,f;let m=(0,o.c)(38),{documentId:h,documentType:g,mainDocumentState:x,onFocusPath:y,onStructureParams:w,refs:j,searchParams:_,structureParams:S}=e,{t:E}=(0,d.Bdt)(p.Yi),P=(0,d.pDY)();m[0]!==x?.document?._id||m[1]!==x?.document?._type||m[2]!==_?(t=e=>(0,i.jsx)(v.s8,{...e,state:{id:x?.document?._id,type:x?.document?._type,_searchParams:Object.entries(_)}}),m[0]=x?.document?._id,m[1]=x?.document?._type,m[2]=_,m[3]=t):t=m[3];let k=t;m[4]!==x?.document?._type||m[5]!==P?(r=P.get(x?.document?._type||"shoe"),m[4]=x?.document?._type,m[5]=P,m[6]=r):r=m[6],n=r;let C=function(e,t){let n,r,i;let a=(0,o.c)(6),s=(0,d.yKO)();a[0]===Symbol.for("react.memo_cache_sentinel")?(n={},a[0]=n):n=a[0];let[l,c]=(0,u.useState)(n);return a[1]!==e||a[2]!==s||a[3]!==t?(r=()=>{if(!t)return;let n=(0,d.TU6)(s,t,e).subscribe(e=>{c(e)});return()=>{n?.unsubscribe()}},i=[s,t,e],a[1]=e,a[2]=s,a[3]=t,a[4]=r,a[5]=i):(r=a[4],i=a[5]),(0,u.useEffect)(r,i),l}(x?.document?._id||"",n);e:{let e,t,r,o;if(!x?.document){a=null;break e}let l=x.document;m[7]!==C.snapshot||m[8]!==l?(e=(0,d.ADU)({document:l,snapshot:C.snapshot}),m[7]=C.snapshot,m[8]=l,m[9]=e):e=m[9],m[10]!==E?(t=E("main-document.label"),m[10]=E,m[11]=t):t=m[11],m[12]!==t?(r=(0,i.jsx)(s.Zp,{padding:1,radius:2,shadow:1,children:(0,i.jsx)(s.EY,{muted:!0,size:0,weight:"medium",children:t})}),m[12]=t,m[13]=r):r=m[13],m[14]!==n||m[15]!==e||m[16]!==r?(o=(0,i.jsx)(d.m6P,{...e,schemaType:n,status:r}),m[14]=n,m[15]=e,m[16]=r,m[17]=o):o=m[17],a=o}let R=a;if(h&&g){let e;return m[18]!==h||m[19]!==g||m[20]!==y||m[21]!==w||m[22]!==_||m[23]!==S?(e=(0,i.jsx)(eL,{documentId:h,documentType:g,onFocusPath:y,onStructureParams:w,searchParams:_,structureParams:S}),m[18]=h,m[19]=g,m[20]=y,m[21]=w,m[22]=_,m[23]=S,m[24]=e):e=m[24],e}return m[25]!==k||m[26]!==x||m[27]!==R||m[28]!==E?(l=x&&(0,i.jsx)(s.Zp,{padding:3,tone:x.document?"inherit":"caution",children:x.document?(0,i.jsx)(d.Ns2,{__unstable_focusRing:!0,as:k,"data-as":"a",radius:2,sizing:"border",tone:"inherit",children:R}):(0,i.jsx)(s.Zp,{padding:2,radius:2,tone:"inherit",children:(0,i.jsxs)(s.so,{gap:3,children:[(0,i.jsx)(s.az,{flex:"none",children:(0,i.jsx)(s.EY,{size:1,children:(0,i.jsx)(b.sAQ,{})})}),(0,i.jsx)(s.az,{flex:1,children:(0,i.jsx)(s.EY,{size:1,children:(0,i.jsx)(d.HTc,{t:E,i18nKey:"main-document.missing.text",components:{Code:"code"},values:{path:x.path}})})})]})})}),m[25]=k,m[26]=x,m[27]=R,m[28]=E,m[29]=l):l=m[29],m[30]!==x||m[31]!==w||m[32]!==j||m[33]!==_?(c=(0,i.jsx)(eI,{mainDocumentState:x,onStructureParams:w,searchParams:_,refs:j}),m[30]=x,m[31]=w,m[32]=j,m[33]=_,m[34]=c):c=m[34],m[35]!==l||m[36]!==c?(f=(0,i.jsxs)(s.so,{direction:"column",flex:1,height:"fill",children:[l,c]}),m[35]=l,m[36]=c,m[37]=f):f=m[37],f}let eU=g.I4.div` 23 position: relative; 24`,eY=g.I4.div` 25 position: absolute; 26 top: 0; 27 bottom: 0; 28 left: -5px; 29 width: 9px; 30 z-index: 10; 31 cursor: ${({$disabled:e})=>e?"auto":"ew-resize"}; 32 33 /* Border */ 34 & > span:nth-child(1) { 35 display: block; 36 border-left: 1px solid var(--card-border-color); 37 position: absolute; 38 top: 0; 39 left: 4px; 40 bottom: 0; 41 transition: opacity 200ms; 42 } 43 44 ${({$disabled:e})=>!e&&` 45 /* Hover effect */ 46 & > span:nth-child(2) { 47 display: block; 48 position: absolute; 49 top: 0; 50 left: 0; 51 width: 9px; 52 bottom: 0; 53 background-color: var(--card-border-color); 54 opacity: 0; 55 transition: opacity 150ms; 56 } 57 58 @media (hover: hover) { 59 &:hover > span:nth-child(2) { 60 opacity: 0.2; 61 } 62 } 63 `} 64`,eB=function(e){let t,n,r,a,s,l,c,d,p,f,m;let h=(0,o.c)(27),{id:v,order:g,disabled:x}=e,b=void 0!==x&&x,w=(0,u.useRef)(null),j=(0,u.useContext)(y.Tf);if(null===j)throw Error("Panel components must be rendered within a PanelGroup container");let _=function(e){let t;let n=(0,o.c)(2);n[0]!==e?(t=()=>e||k(),n[0]=e,n[1]=t):t=n[1];let[r]=(0,u.useState)(t);return r}(v),{activeResizer:S,drag:E,startDragging:P,stopDragging:C,registerElement:R,unregisterElement:z}=j,I=S===_;if(null===j)throw Error("Panel components must be rendered within a PanelGroup container");h[0]!==_||h[1]!==P?(t=e=>{P(_,e.nativeEvent)},h[0]=_,h[1]=P,h[2]=t):t=h[2];let T=t;h[3]!==E||h[4]!==_?(n=e=>{E(_,e)},h[3]=E,h[4]=_,h[5]=n):n=h[5];let $=n;h[6]!==C?(r=()=>{w.current.blur(),C()},h[6]=C,h[7]=r):r=h[7];let A=r;return h[8]!==b||h[9]!==I||h[10]!==$||h[11]!==A?(a=()=>
64{if(!I||b)return;let e=function(){let e=document.body.style,t=document.documentElement.style,{cursor:n}=t,{userSelect:r}=e;return t.cursor="ew-resize",e.userSelect="none",()=>{n?t.cursor=n:t.removeProperty("cursor"),r?e.userSelect=r:e.removeProperty("user-select")}}();return window.addEventListener("mousemove",$),window.addEventListener("mouseup",A),window.addEventListener("contextmenu",A),()=>{e(),window.removeEventListener("mousemove",$),window.removeEventListener("mouseup",A),window.removeEventListener("contextmenu",A)}},s=[b,I,$,A],h[8]=b,h[9]=I,h[10]=$,h[11]=A,h[12]=a,h[13]=s):(a=h[12],s=h[13]),(0,u.useEffect)(a,s),h[14]!==_||h[15]!==g||h[16]!==R||h[17]!==z?(l=()=>(R(_,{id:_,order:g,type:"resizer",el:w}),()=>{z(_)}),c=[_,g,R,z],h[14]=_,h[15]=g,h[16]=R,h[17]=z,h[18]=l,h[19]=c):(l=h[18],c=h[19]),(0,u.useLayoutEffect)(l,c),h[20]===Symbol.for("react.memo_cache_sentinel")?(p=(0,i.jsx)("span",{}),d=(0,i.jsx)("span",{}),h[20]=d,h[21]=p):(d=h[20],p=h[21]),h[22]!==b?(f=(0,i.jsxs)(eY,{$disabled:b,children:[p,d]}),h[22]=b,h[23]=f):f=h[23],h[24]!==T||h[25]!==f?(m=(0,i.jsx)(eU,{onMouseDown:T,ref:w,children:f}),h[24]=T,h[25]=f,h[26]=m):m=h[26],m},eD=e=>{let t,n,r;let a=(0,o.c)(8),{documentId:s,setDisplayedDocument:l,getCommentIntent:c}=e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,i.jsx)(eB,{order:4}),a[0]=t):t=a[0],a[1]!==c||a[2]!==e.children?(n=(0,i.jsx)(d.S4U,{getIntent:c,children:e.children}),a[1]=c,a[2]=e.children,a[3]=n):n=a[3],a[4]!==s||a[5]!==l||a[6]!==n?(r=(0,i.jsxs)(i.Fragment,{children:[t,(0,i.jsx)(Q,{id:"content",minWidth:325,order:5,children:(0,i.jsx)(_.C,{documentId:s,setDisplayedDocument:l,children:n})})]}),a[4]=s,a[5]=l,a[6]=n,a[7]=r):r=a[7],r},eN=e=>{let t,n;let r=(0,o.c)(14),{documentId:a,documentsOnPage:s,documentType:l,getCommentIntent:c,mainDocumentState:u,onFocusPath:d,onStructureParams:p,searchParams:f,setDisplayedDocument:m,structureParams:h}=e;return r[0]!==a||r[1]!==l||r[2]!==s||r[3]!==u||r[4]!==d||r[5]!==p||r[6]!==f||r[7]!==h?(t=(0,i.jsx)(eO,{documentId:a,documentType:l,mainDocumentState:u,onFocusPath:d,onStructureParams:p,refs:s,searchParams:f,structureParams:h}),r[0]=a,r[1]=l,r[2]=s,r[3]=u,r[4]=d,r[5]=p,r[6]=f,r[7]=h,r[8]=t):t=r[8],r[9]!==a||r[10]!==c||r[11]!==m||r[12]!==t?(n=(0,i.jsx)(eD,{documentId:a,getCommentIntent:c,setDisplayedDocument:m,children:t}),r[9]=a,r[10]=c,r[11]=m,r[12]=t,r[13]=n):n=r[13],n},eW=function(e){let t,n;let r=(0,o.c)(5),{children:a,navigate:s}=e;r[0]!==s?(t=(e,t)=>{s((void 0===t?void 0:t)||{},e?{preview:e}:{})},r[0]=s,r[1]=t):t=r[1];let l=t;return r[2]!==a||r[3]!==l?(n=(0,i.jsx)(y.iY.Provider,{value:l,children:a}),r[2]=a,r[3]=l,r[4]=n):n=r[4],n};function eF(e){return!e}let eV=(0,u.memo)(function(e){let t,n,r,a;let s=(0,o.c)(11),{minWidth:l,maxWidth:c,component:u}=e,d=null!=l&&null!=c&&l===c;return s[0]!==u?(t=(0,i.jsx)(u,{}),s[0]=u,s[1]=t):t=s[1],s[2]!==c||s[3]!==l||s[4]!==t?(n=(0,i.jsx)(Q,{id:"navigator",minWidth:l,maxWidth:c,order:1,children:t}),s[2]=c,s[3]=l,s[4]=t,s[5]=n):n=s[5],s[6]!==d?(r=(0,i.jsx)(eB,{order:2,disabled:d}),s[6]=d,s[7]=r):r=s[7],s[8]!==n||s[9]!==r?(a=(0,i.jsxs)(i.Fragment,{children:[n,r]}),s[8]=n,s[9]=r,s[10]=a):a=s[10],a}),eZ=function(e){let t;let n=(0,o.c)(3),{children:r,params:a}=e;return n[0]!==r||n[1]!==a?(t=(0,i.jsx)(y.ix.Provider,{value:a,children:r}),n[0]=r,n[1]=a,n[2]=t):t=n[2],t},eH=function(e){let t,n,r;let a=(0,o.c)(10),{children:s,devMode:l,name:c,navigate:u,params:d,searchParams:p,structureParams:f}=e;return a[0]!==l||a[1]!==c||a[2]!==u||a[3]!==d||a[4]!==p||a[5]!==f?(n={devMode:l,name:c,navigate:u,params:d,searchParams:p,structureParams:f},a[0]=l,a[1]=c,a[2]=u,a[3]=d,a[4]=p,a[5]=f,a[6]=n):n=a[6],t=n,a[7]!==s||a[8]!==t?(r=(0,i.jsx)(y.SM.Provider,{value:t,children:s}),a[7]=s,a[8]=t,a[9]=r):r=a[9],r};function eJ(e){return Array.isArray(e)?e.join(","):e}let eK=C.P.create(g.I4.iframe` 65 box-shadow: 0 0 0 1px var(--card-border-color); 66 border: 0; 67 max-height: 100%; 68 width: 100%; 69 view-transition-class: presentation-tool-iframe; 70`),eq=(0,g.I4)(s.az)` 71 position: absolute; 72 inset: 0; 73 background: transparent; 74`,eX=(0,u.forwardRef)(function(e,t){let n,r,a,s;let l=(0,o.c)(16),{animate:c,initial:d,onLoad:p,preventClick:f,src:m,variants:h,style:v}=e,g=`presentation-tool-iframe-${(0,u.useId)().replace(/[^a-zA-Z0-9-_]/g,"_")}`;return l[0]!==v||l[1]!==g?(n={...v,viewTransitionName:g},l[0]=v,l[1]=g,l[2]=n):n=l[2],l[3]!==c||l[4]!==d||l[5]!==p||l[6]!==t||l[7]!==m||l[8]!==n||l[9]!==h?(r=(0,i.jsx)(eK,{style:n,animate:c,initial:d,onLoad:p,ref:t,src:m,variants:h}),l[3]=c,l[4]=d,l[5]=p,l[6]=t,l[7]=m,l[8]=n,l[9]=h,l[10]=r):r=l[10],l[11]!==f?(a=f&&(0,i.jsx)(eq,{}),l[11]=f,l[12]=a):a=l[12],l[13]!==r||l[14]!==a?(s=(0,i.jsxs)(i.Fragment,{children:[r,a]}),l[13]=r,l[14]=a,l[15]=s):s=l[15],s});function eG(e){let t,n,r,a,l,c,u;let f=(0,o.c)(16),{openPopup:m,previewLocationOrigin:h,previewLocationRoute:v}=e,{t:g}=(0,d.Bdt)(p.Yi);f[0]!==m?(t=e=>{e.preventDefault(),m(e.currentTarget.href)},f[0]=m,f[1]=t):t=f[1];let x=t;f[2]!==g?(n=g("share-url.menu-item.open.text"),f[2]=g,f[3]=n):n=f[3],f[4]!==n?(r=(0,i.jsx)(s.EY,{size:1,children:n}),f[4]=n,f[5]=r):r=f[5],f[6]===Symbol.for("react.memo_cache_sentinel")?(a=["bottom-start"],f[6]=a):a=f[6],f[7]!==g?(l=g("share-url.menu-item.open.text"),f[7]=g,f[8]=l):l=f[8];let y=`${h}${v}`;return f[9]!==x||f[10]!==l||f[11]!==y?(c=(0,i.jsx)(j.$n,{as:"a","aria-label":l,icon:b.ZPM,mode:"bleed",href:y,rel:"opener",target:"_blank",tooltipProps:null,onClick:x}),f[9]=x,f[10]=l,f[11]=y,f[12]=c):c=f[12],f[13]!==r||f[14]!==c?(u=(0,i.jsx)(j.m_,{animate:!0,content:r,fallbackPlacements:a,placement:"bottom",portal:!0,children:c}),f[13]=r,f[14]=c,f[15]=u):u=f[15],u}let eQ=function(e){let t,n,r,a,l,c,f,m,h,v;let g=(0,o.c)(27),{fontSize:x,onChange:y,origin:w,padding:j,prefix:_,suffix:S,value:E}=e,P=void 0===x?1:x,k=void 0===j?3:j,{t:C}=(0,d.Bdt)(p.Yi),{basePath:R}=d.VrO()?.activeWorkspace||{},z=void 0===R?"/":R,I=(0,u.useRef)(null),[T,$]=(0,u.useState)(void 0),[A,M]=(0,u.useState)(void 0);g[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{$(e.currentTarget.value)},g[0]=t):t=g[0];let L=t;g[1]!==z||g[2]!==y||g[3]!==w||g[4]!==T||g[5]!==C?(n=e=>{if("Enter"===e.key){if(void 0===T)return;let e=T.startsWith("/")||""===T?`${w}${T}`:T;if(!e.startsWith(`${w}/`)&&e!==w){M(C("preview-location-input.error",{origin:w,context:"missing-origin"}));return}if(!w&&(e.startsWith(`${z}/`)||e===z)){M(C("preview-location-input.error",{basePath:z,context:"same-base-path"}));return}let t=e===w?`${w}/`:e;M(void 0),$(void 0),y(t.slice(w.length)),I.current?.blur()}"Escape"===e.key&&(M(void 0),$(void 0))},g[1]=z,g[2]=y,g[3]=w,g[4]=T,g[5]=C,g[6]=n):n=g[6];let O=n;g[7]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{M(void 0),$(void 0)},g[7]=r):r=g[7];let U=r;g[8]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{M(void 0),$(void 0)},g[8]=a):a=g[8],g[9]!==w||g[10]!==E?(l=[w,E],g[9]=w,g[10]=E,g[11]=l):l=g[11
74],(0,u.useEffect)(a,l),g[12]===Symbol.for("react.memo_cache_sentinel")?(f={icon:b.NAP},g[12]=f):f=g[12],c=f;let Y=A?c:void 0;g[13]!==w||g[14]!==E?(m=()=>{M(void 0),$(w+E)},g[13]=w,g[14]=E,g[15]=m):m=g[15],g[16]===Symbol.for("react.memo_cache_sentinel")?(h={zIndex:1},g[16]=h):h=g[16];let B=void 0===T?`${w}${E}`:T;return g[17]!==A||g[18]!==P||g[19]!==O||g[20]!==k||g[21]!==_||g[22]!==S||g[23]!==Y||g[24]!==m||g[25]!==B?(v=(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(s.ks,{clearButton:Y,customValidity:A,fontSize:P,onBlur:U,onClear:m,onChange:L,onKeyDownCapture:O,padding:k,prefix:_,style:h,radius:2,ref:I,space:k,suffix:S,value:B})}),g[17]=A,g[18]=P,g[19]=O,g[20]=k,g[21]=_,g[22]=S,g[23]=Y,g[24]=m,g[25]=B,g[26]=v):v=g[26],v},e0=(0,u.lazy)(()=>n.e(8634).then(n.bind(n,98634))),e1=(0,g.I4)(M.jM)` 75 position: absolute; 76 top: 50%; 77 left: 50%; 78 transform: translate(-50%, -50%); 79 height: ${24}px; 80 width: ${24}px; 81`,e2=C.P.create(s.y$),e3=C.P.create(s.EY),e4=C.P.create(e1),e5=(0,u.memo)(function(e){let{canToggleSharePreviewAccess:t,canUseSharedPreviewAccess:n,initialUrl:r,previewLocationRoute:o,perspective:c}=e,{t:f}=(0,d.Bdt)(p.Yi),{push:m}=(0,l.dj)(),h=(0,d.tH7)({apiVersion:p.mG}),v=(0,d.iZK)(),[g,x]=(0,u.useState)(!0),[y,w]=(0,u.useState)(!1),[_,S]=(0,u.useState)(!1),[E,P]=(0,u.useState)(null),k=y||_||g,C=(0,u.useMemo)(()=>E?function(e,t,n,r){let i=new URL(e),{searchParams:o}=i;return t&&(o.set(a.Vm,t),o.set(a.Zm,n)),o.set(a.Pd,r),i}(r,E,o,eJ(c)):null,[r,c,o,E]),[z,I]=(0,u.useState)(null);if(z)throw z;let T=(0,u.useCallback)(()=>{m({closable:!0,status:"warning",title:f("share-preview-menu.error_toggle-sharing",{context:"toggle-sharing"})})},[m,f]),$=(0,u.useCallback)(async()=>{try{S(!0),await U(h,"@sanity/presentation",typeof window>"u"?"":location.href,v?.id),P(null)}catch(e){I(e)}finally{S(!1)}},[h,v?.id]),A=(0,u.useCallback)(async()=>{try{w(!0);let e=await O(h,"@sanity/presentation",typeof window>"u"?"":location.href,v?.id);P(e.secret)}catch(e){I(e)}finally{w(!1)}},[h,v?.id]),M=(0,u.useCallback)(()=>{try{if(!C)throw Error("No URL to copy");navigator.clipboard.writeText(C.toString()),m({closable:!0,status:"success",title:f("share-url.clipboard.status",{context:"success"})})}catch(e){I(e)}},[m,f,C]);return(0,u.useEffect)(()=>{let e=new AbortController,t=[];async function n(e,n){let{result:r,syncTags:i}=await h.fetch(a._g,{},{filterResponse:!1,lastLiveEventId:e,tag:"presentation.fetch-shared-access-secret"});Array.isArray(i)&&(t=i),n.aborted||P(r)}let r=h.live.events().subscribe({next:r=>{"message"===r.type&&(e.abort(),e=new AbortController,r.tags.some(e=>t.includes(e))&&n(r.id,e.signal))},error:I});return n(null,e.signal).finally(()=>x(!1)),()=>{r.unsubscribe(),e.abort()}},[h]),(0,i.jsx)(j.IU,{button:(0,i.jsx)(j.$n,{"aria-label":f("preview-frame.share-button.aria-label"),icon:b.liv,mode:"bleed",tooltipProps:null}),id:"share-menu",menu:(0,i.jsx)(s.W1,{style:{maxWidth:248},padding:n?void 0:0,children:n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("label",{style:{cursor:"pointer"},children:(0,i.jsxs)(s.xA,{columns:2,rows:2,gapX:3,gapY:1,style:{justifyContent:"center",alignItems:"center",gridTemplateColumns:"min-content 1fr",gridTemplateRows:"min-content"},paddingTop:3,paddingX:3,children:[(0,i.jsx)(j.m_,{animate:!0,content:(0,i.jsx)(s.EY,{size:1,children:f("share-preview-menu.toggle-button.tooltip",{context:C?"disable":"enable"})}),fallbackPlacements:["bottom-start"],placement:"bottom",portal:!0,children:(0,i.jsx)(s.dO,{checked:y||null!==C&&!_,readOnly:y||_,indeterminate:g,onChange:t?C?$:A:T})}),(0,i.jsx)(s.EY,{size:1,weight:"medium",children:f("share-preview-menu.toggle-button.label",{context:"first-line"})}),(0,i.jsx)("span",{}),(0,i.jsx)(s.EY,{muted:!0,size:1,children:f("share-preview-menu.toggle-button.label",{context:"second-line"})})]})}),(0,i.jsx)(s.az,{padding:3,paddingTop:2,children:(0,i.jsxs)(s.BJ,{space:3,children:[(0,i.jsx)(s.Zp,{tone:k||!C?"transparent":void 0,style:{position:"relative",aspectRatio:"1 / 1",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,i.jsx)(R.N,{children:k?(0,i.jsx)(e2,{muted:!0,initial:{opacity:0}
81,animate:{opacity:1},exit:{opacity:0}}):C?(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(u.Suspense,{fallback:(0,i.jsx)(s.y$,{}),children:[(0,i.jsx)(e0,{title:f("share-preview-menu.qr-code.title",{url:C.toString()}),value:C.toString(),size:224,color:"var(--card-fg-color)",logoSize:40}),(0,i.jsx)(e4,{initial:{opacity:-.5},animate:{opacity:1.5},exit:{opacity:0}})]})}):(0,i.jsx)(e3,{muted:!0,size:1,style:{maxWidth:"100px",textWrap:"pretty",textAlign:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:f("share-preview-menu.qr-code.placeholder")})})}),(0,i.jsx)(s.EY,{muted:!0,size:1,children:f("share-preview-menu.qr-code.instructions")})]})}),(0,i.jsx)(s.Nj,{}),(0,i.jsx)(j.Dr,{disabled:!C||_,icon:b.TdU,onClick:M,text:f("share-preview-menu.copy-url.text")})]}):(0,i.jsx)(s.Zp,{padding:2,tone:"caution",radius:3,children:(0,i.jsx)(s.EY,{style:{textWrap:"pretty"},children:f("share-preview-menu.error",{context:"missing-grants"})})})}),popover:{constrainSize:!0,placement:"bottom",portal:!0}})});e5.displayName="Memo(SharePreviewMenu)";let e6=e=>{let t,n,r,l,c,u,f,m,h,v,g,x,y,w,_,S,E,P,k,C,R,z,I,T,$,A,M,L,O,U,Y,B,D,N,W,F;let V=(0,o.c)(97),{canSharePreviewAccess:Z,canToggleSharePreviewAccess:H,canUseSharedPreviewAccess:J,dispatch:K,iframe:q,iframeRef:X,initialUrl:G,navigatorEnabled:Q,onPathChange:ee,onRefresh:et,openPopup:en,overlaysConnection:er,perspective:ei,previewUrl:eo,setViewport:ea,targetOrigin:es,toggleNavigator:el,toggleOverlay:ec,viewport:eu,visualEditing:ed}=e,{overlaysEnabled:ep}=ed,{t:ef}=(0,d.Bdt)(p.Yi);V[0]!==ea||V[1]!==eu?(t=()=>ea("desktop"===eu?"mobile":"desktop"),V[0]=ea,V[1]=eu,V[2]=t):t=V[2];let em=t;n=es===location.origin?"":es,V[3]!==K||V[4]!==X.current||V[5]!==et||V[6]!==eo||V[7]!==es?(r=()=>{et(()=>{X.current&&(K({type:p.my}),Object.assign(X.current,{src:`${es}${eo||"/"}`}))})},V[3]=K,V[4]=X.current,V[5]=et,V[6]=eo,V[7]=es,V[8]=r):r=V[8];let eh=r,{pathname:ev,search:eg}=function(e){let t=new URL(e),{searchParams:n}=t;return n.delete(a.Zm),n.delete(a.Vm),n.delete(a.Pd),n.delete(a.tt),n.delete(a.c4),t}(new URL(eo||"/",es));l=`${ev}${eg}`,V[9]===Symbol.for("react.memo_cache_sentinel")?(c={width:"100%"},V[9]=c):c=V[9],V[10]!==Q||V[11]!==ef||V[12]!==el?(u=el&&(0,i.jsx)(j.$n,{"aria-label":ef("preview-frame.navigator.toggle-button.aria-label"),icon:b.lC2,mode:"bleed",onClick:el,selected:Q,tooltipProps:{content:(0,i.jsx)(s.EY,{size:1,children:ef("preview-frame.navigator.toggle-button.tooltip")}),fallbackPlacements:["bottom-start"],placement:"bottom"}}),V[10]=Q,V[11]=ef,V[12]=el,V[13]=u):u=V[13],V[14]===Symbol.for("react.memo_cache_sentinel")?(f={whiteSpace:"nowrap"},V[14]=f):f=V[14];let ex=ep?"disable":"enable";V[15]!==ef||V[16]!==ex?(m=ef("preview-frame.overlay.toggle-button.tooltip",{context:ex}
81),V[15]=ef,V[16]=ex,V[17]=m):m=V[17],V[18]!==m?(h=(0,i.jsx)(s.az,{padding:1,children:(0,i.jsx)(s.EY,{size:1,children:m})}),V[18]=m,V[19]=h):h=V[19],V[20]===Symbol.for("react.memo_cache_sentinel")?(v=(0,i.jsx)(s.az,{paddingY:1,children:(0,i.jsx)(s.qW,{keys:["Alt"],style:{marginTop:-4,marginBottom:-4}})}),V[20]=v):v=V[20],V[21]!==h?(g=(0,i.jsxs)(s.so,{align:"center",style:f,children:[h,v]}),V[21]=h,V[22]=g):g=V[22],V[23]===Symbol.for("react.memo_cache_sentinel")?(x=["bottom-start"],V[23]=x):x=V[23],V[24]===Symbol.for("react.memo_cache_sentinel")?(y={lineHeight:0,borderRadius:999,userSelect:"none"},V[24]=y):y=V[24];let ey=ep?"transparent":void 0;V[25]===Symbol.for("react.memo_cache_sentinel")?(w={margin:-4},V[25]=w):w=V[25];let eb="loading"===q.status||"connected"!==er;V[26]!==ep||V[27]!==eb||V[28]!==ec?(_=(0,i.jsx)("div",{style:w,children:(0,i.jsx)(s.dO,{checked:ep,onChange:ec,disabled:eb})}),V[26]=ep,V[27]=eb,V[28]=ec,V[29]=_):_=V[29];let ew=!ep;V[30]!==ef?(S=ef("preview-frame.overlay.toggle-button.text"),V[30]=ef,V[31]=S):S=V[31],V[32]!==ew||V[33]!==S?(E=(0,i.jsx)(s.az,{children:(0,i.jsx)(s.EY,{muted:ew,size:1,weight:"medium",children:S})}),V[32]=ew,V[33]=S,V[34]=E):E=V[34],V[35]!==_||V[36]!==E?(P=(0,i.jsxs)(s.so,{align:"center",gap:3,children:[_,E]}),V[35]=_,V[36]=E,V[37]=P):P=V[37],V[38]!==ey||V[39]!==P?(k=(0,i.jsx)(s.Zp,{as:"label",flex:"none",padding:3,marginX:1,style:y,tone:ey,children:P}),V[38]=ey,V[39]=P,V[40]=k):k=V[40],V[41]!==g||V[42]!==k?(C=(0,i.jsx)(j.m_,{animate:!0,content:g,fallbackPlacements:x,placement:"bottom",portal:!0,children:k}),V[41]=g,V[42]=k,V[43]=C):C=V[43],V[44]!==q.status||V[45]!==ef?(R="loaded"===q.status?ef("preview-frame.refresh-button.tooltip"):ef("preview-frame.status",{context:q.status}),V[44]=q.status,V[45]=ef,V[46]=R):R=V[46],V[47]!==R?(z=(0,i.jsx)(s.EY,{size:1,children:R}),V[47]=R,V[48]=z):z=V[48],V[49]===Symbol.for("react.memo_cache_sentinel")?(I=["bottom-end"],V[49]=I):I=V[49],V[50]!==ef?(T=ef("preview-frame.refresh-button.aria-label"),V[50]=ef,V[51]=T):T=V[51];let ej="reloading"===q.status||"refreshing"===q.status;V[52]!==eh||V[53]!==T||V[54]!==ej?($=(0,i.jsx)(j.$n,{"aria-label":T,icon:b.fNY,mode:"bleed",loading:ej,onClick:eh,tooltipProps:null}),V[52]=eh,V[53]=T,V[54]=ej,V[55]=$):$=V[55],V[56]!==z||V[57]!==$?(A=(0,i.jsx)(s.az,{padding:1,children:(0,i.jsx)(j.m_,{animate:!0,content:z,fallbackPlacements:I,placement:"bottom",portal:!0,children:$})}),V[56]=z,V[57]=$,V[58]=A):A=V[58],V[59]!==en||V[60]!==n||V[61]!==l?(M=(0,i.jsx)(s.az,{padding:1,children:(0,i.jsx)(eG,{openPopup:en,previewLocationOrigin:n,previewLocationRoute:l})}),V[59]=en,V[60]=n,V[61]=l,V[62]=M):M=V[62],V[63]!==ee||V[64]!==n||V[65]!==l||V[66]!==A||V[67]!==M?(L=(0,i.jsx)(s.az,{flex:1,children:(0,i.jsx)(eQ,{prefix:A,onChange:ee,origin:n,suffix:M,value:l})}),V[63]=ee,V[64]=n,V[65]=l,V[66]=A,V[67]=M,V[68]=L):L=V[68];let e_="desktop"===eu?"narrow":"full";V[69]!==ef||V[70]!==e_?(O=ef("preview-frame.viewport-button.tooltip",{context:e_}),V[69]=ef,V[70]=e_,V[71]=O):O=V[71],V[72]!==O?(U=(0,i.jsx)(s.EY,{size:1,children:O}),V[72]=O,V[73]=U):U=V[73],V[74]===Symbol.for("react.memo_cache_sentinel")?(Y=["bottom-start"],V[74]=Y):Y=V[74],V[75]!==ef?(B=ef("preview-frame.viewport-button.aria-label"),V[75]=ef,V[76]=B):B=V[76];let eS="desktop"===eu?b.Ck_:b.eZO;return V[77]!==B||V[78]!==eS||V[79]!==em?(D=(0,i.jsx)(j.$n,{"aria-label":B,icon:eS,mode:"bleed",onClick:em,tooltipProps:null}),V[77]=B,V[78]=eS,V[79]=em,V[80]=D):D=V[80],V[81]!==U||V[82]!==D?(N=(0,i.jsx)(s.so,{align:"center",flex:"none",gap:1,children:(0,i.jsx)(j.m_,{animate:!0,content:U,fallbackPlacements:Y,placement:"bottom",portal:!0,children:D})}),V[81]=U,V[82]=D,V[83]=N):N=V[83],V[84]!==Z||V[85]!==H||V[86]!==J||V[87]!==G||V[88]!==ei||V[89]!==l?(W=Z&&(0,i.jsx)(s.so,{align:"center",flex:"none",gap:1,children:(0,i.jsx)(e5,{canToggleSharePreviewAccess:H,canUseSharedPreviewAccess:J,previewLocationRoute:l,initialUrl:G,perspective:ei})}),V[84]=Z,V[85]=H,V[86]=J,V[87]=G,V[88]=ei,V[89]=l,V[90]=W):W=V[90],V[91]!==C||V[92]!==L||V[93]!==N||V[94]!==W||V[95]!==u?(F=(0,i.jsxs)(s.so,{align:"center",gap:1,paddingX:1,style:c,children:[u,C,L,N,W]}),V[91]=C,V[92]=L,V[93]=N,V[94]=W,V[95]=u,V[96]=F):F=V[96],F};function e9(e){let t,n,r,a;let l=(0,o.c)(7),c=e8,u=e.options?.component;l[0]!==u||l[1]!==e?(t=u?(0,i.jsx)(u,{...e,renderDefault:c}):c(e),l[0]=u,l[1]=e,l[2]=t):t=l[2];let d=t;return l[3]===Symbol.for("react.memo_cache_sentinel")?(n={position:"relative"},l[3]=n):n=l[3],l[4]===Symbol.for("react.memo_cache_sentinel")?(r={minHeight:0},l[4]=r):r=l[4],l[5]!==d?(a=(0,i.jsx)(s.Zp,{flex:"none",padding:2,borderBottom:!0,style:n,children:(0,i.jsx)(s.so,{align:"center",style:r,children:d})}),l[5]=d,l[6]=a):a=l[6],a}function e8(e){return(0,i.jsx)(e6,{...e})}let e7=C.P.create(s.so),te=(0,u.memo)((0,u.forwardRef)(function(e,t){let{dispatch:n,iframe:r,header:o,initialUrl:l,loadersConnection:c,overlaysConnection:f,perspective:m,viewport:h,vercelProtectionBypass:v}=e,[g,x]=(0,u.useState)(null),y=eJ(null===g?m:g),b=(0,u.useMemo)(()=>{let e=new URL(l);return e.searchParams.get(a.Pd)||e.searchParams.set(a.Pd,y),(v||e.searchParams.get(a.tt))&&e.searchParams.set(a.c4,"samesitenone"),v&&!e.searchParams.get(a.tt)&&e.searchParams.set(a.tt,v),e},[l,y,v]);(0,u.useEffect)(()=>{"connected"===c&&x(e=>null===e?m:e)},[c,m]);let{t:w}=(0,d.Bdt)(p.Yi),{devMode:_}=(0,p.Qe)(),S=(0,s.jt)(),E=(0,u.useRef)(null),P=(0,i.jsx)(e9,{...e,iframeRef:E,options:o});(0,u.useImperativeHandle)(t,()=>E.current);let k="loading"===r.status||"reloading"===r.status,[C,z]=(0,u.useState)(!1),I="refreshing"===r.status,[T,M]=(0,u.useState)(!1),L=k||I||"connecting"===f,O=(0,u.useCallback)(()=>{E.current&&(E.current.src=b.toString(),n({type:p.my}))},[n,b]),U=(0,u.useCallback)(()=>{B(!0)},[]),[Y,B]=(0,u.useState)(!1),[D,N]=(0,u.useState)(!1);(0,u.useEffect)(()=>
81{if(!(k||I)&&("connecting"===f||"reconnecting"===f)){let e=setTimeout(()=>{N(!0)},5e3);return()=>clearTimeout(e)}},[f,k,I]),(0,u.useEffect)(()=>{if(!(k||I||!D)){if("connected"===f&&(M(!1),N(!1),z(!1),B(!1)),"connecting"===f){let e=setTimeout(()=>{z(!0),console.error("Unable to connect to visual editing. Make sure you've setup '@sanity/visual-editing' correctly")},p.Cw);return()=>clearTimeout(e)}if("reconnecting"===f){let e=setTimeout(()=>{z(!0),M(!0)},p.Cw);return()=>clearTimeout(e)}}},[k,f,I,D]);let W=(0,u.useCallback)(()=>{n({type:p.cr})},[n]);(0,u.useEffect)(()=>{if(!E.current)return;let e=E.current;function t(){e===document.activeElement&&e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0}))}return window.addEventListener("blur",t),()=>{window.removeEventListener("blur",t)}},[]);let F=(0,u.useMemo)(()=>(k||"connecting"===f&&"refreshing"!==r.status)&&!Y,[Y,r.status,k,f]),V=(0,u.useSyncExternalStore)((0,u.useCallback)(()=>()=>{},[]),()=>CSS.supports("(view-transition-name: test)")),Z=(0,u.useMemo)(()=>[F?"background":"active",k?"reloading":"idle",V?"":h,D&&!Y?"timedOut":""],[V,Y,k,F,D,h]),[H,J]=(0,u.useState)(h),[K,q]=(0,u.useState)(ti[h]);return(0,u.useEffect)(()=>{if(V&&h!==H){let e=()=>{J(h),q(ti[h])};!S&&"startViewTransition"in document&&"function"==typeof document.startViewTransition?document.startViewTransition(()=>(0,A.flushSync)(()=>e())):e()}},[V,S,H,h]),(0,i.jsx)($,{transition:S?{duration:0}:void 0,children:(0,i.jsxs)(j.vE,{children:[P,(0,i.jsx)(s.Zp,{flex:1,tone:"transparent",children:(0,i.jsxs)(s.so,{align:"center",height:"fill",justify:"center",padding:2*((V?H:h)!=="desktop"),sizing:"border",style:{position:"relative",cursor:L?"wait":void 0},children:[(0,i.jsx)(R.N,{children:T||k||I||!D||Y?(k||"connecting"===f&&"refreshing"!==r.status)&&!Y?(0,i.jsx)(e7,{initial:"initial",animate:"animate",exit:"exit",variants:tn,justify:"center",align:"center",style:{inset:"0",position:"absolute"},children:(0,i.jsxs)(s.so,{style:{...tt[h]},justify:"center",align:"center",direction:"column",gap:4,children:[(0,i.jsx)(s.y$,{muted:!0}),(0,i.jsx)(s.EY,{muted:!0,size:1,children:w("preview-frame.status",{context:"loading"})})]})}):T&&!Y?(0,i.jsx)(e7,{initial:"initial",animate:"animate",exit:"exit",variants:tr,justify:"center",align:"center",style:{background:"var(--card-bg-color)",inset:"0",position:"absolute"},children:(0,i.jsx)(eh,{flex:1,message:w("preview-frame.connection.error.text"),onRetry:O,onContinueAnyway:U,children:_&&(0,i.jsxs)(i.Fragment,{children:["connected"!==f&&(0,i.jsx)(s.Zp,{padding:3,radius:2,tone:"critical",children:(0,i.jsxs)(s.BJ,{space:3,children:[(0,i.jsx)(s.JU,{muted:!0,size:0,children:w("preview-frame.overlay.connection-status.label")}),(0,i.jsx)(s.Cy,{size:1,children:w("channel.status",{context:f})})]})}),"connected"!==c&&(0,i.jsx)(s.Zp,{padding:3,radius:2,tone:"critical",children:(0,i.jsxs)(s.BJ,{space:3,children:[(0,i.jsx)(s.JU,{muted:!0,size:0,children:w("preview-frame.loader.connection-status.label")}),(0,i.jsx)(s.Cy,{size:1,children:w("channel.status",{context:c})})]})})]})})}):null:(0,i.jsx)(e7,{initial:"initial",animate:"animate",exit:"exit",variants:tn,justify:"center",align:"center",style:{inset:"0",position:"absolute",backdropFilter:C?"blur(16px) saturate(0.5) grayscale(0.5)":"blur(2px)",transition:"backdrop-filter 0.2s ease-in-out",WebkitBackdropFilter:C?"blur(16px) saturate(0.5) grayscale(0.5)":"blur(2px)",WebkitTransition:"-webkit-backdrop-filter 0.2s ease-in-out",zIndex:1},children:(0,i.jsxs)(s.so,{style:{...tt[h]},justify:"center",align:"center",direction:"column",gap:4,children:[C&&(0,i.jsx)(j.$n,{disabled:!0,mode:"ghost",text:w("preview-frame.continue-button.text"),style:{opacity:0}}),(0,i.jsx)(s.Zp,{radius:2,tone:C?"caution":"inherit",padding:4,shadow:1,children:(0,i.jsxs)(s.so,{justify:"center",align:"center",direction:"column",gap:4,children:[(0,i.jsx)(s.y$,{muted:!0}),(0,i.jsx)(s.EY,{muted:!0,size:1,children:w("preview-frame.status",C?{context:"timeout"}:{context:"connecting"})})]})}),C&&(0,i.jsx)(j.$n,{tone:"critical",onClick:U,text:w("preview-frame.continue-button.text")})]})})}),(0,i.jsx)(eX,{animate:Z,initial:["background"],onLoad:W,preventClick:F,ref:E,src:b.toString(),style:K,variants:ti})]})})]})})}));te.displayName="Memo(ForwardRef(Preview))";let tt={desktop:{width:"100%",height:"100%"},mobile:{width:375,height:650}},tn={initial:{opacity:1}
81,animate:{opacity:[0,0,1]},exit:{opacity:[1,0,0]}},tr={initial:{opacity:1},animate:{opacity:[0,0,1]},exit:{opacity:[1,0,0]}},ti={desktop:{...tt.desktop,boxShadow:"0 0 0 0px var(--card-border-color)"},mobile:{...tt.mobile,boxShadow:"0 0 0 1px var(--card-border-color)"},background:{opacity:0,scale:1},idle:{scale:1},reloading:{scale:[1,1,1,.98]},active:{opacity:[0,0,1],scale:1},timedOut:{opacity:[0,0,1]}},to=function(){let e=!1;return(...t)=>{e||(console.warn(...t),e=!0)}}();function ta(e,t){return e instanceof Function?e(t):e}function ts(e){let[t]=e;return"preview"===t}let tl=(0,W.FsL)((0,W.YjP)(),(0,W.BpQ)(1)),tc=(0,W.lqM)(tl);(0,W.Ikc)({baseUrl:tl,dataset:tc,id:tl,path:tl,projectId:tc,tool:tc,type:tc,workspace:tc});let tu=/^([\w-]+):(0|[1-9][0-9]*)$/,td=/^([\w-]+):([0-9]+),([0-9]+)$/,tp=/^([\w-]+):([\w-]+)$/,tf=(0,W.FsL)((0,W.YjP)(),(0,W.BpQ)(1));function tm(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e&&""!==e&&null!==e))}(0,W.Ikc)({origin:tf,href:tf,data:(0,W.lqM)((0,W.g1P)((0,W.YjP)(),(0,W.L5J)()))});let th=e=>{let t,n,r,i,a,s;let l=(0,o.c)(10),[c,d]=(0,u.useState)(tv);l[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{let t=window.open(e,"_blank");t&&d(e=>new Set(e).add(t))},l[0]=t):t=l[0];let f=t;return l[1]!==e||l[2]!==c?(n=()=>{let t=[];if(c.size&&e)for(let n of c)n&&"closed"in n&&!n.closed&&t.push(e.addTarget(n));return()=>{t.forEach(tg)}},r=[e,c],l[1]=e,l[2]=c,l[3]=n,l[4]=r):(n=l[3],r=l[4]),(0,u.useEffect)(n,r),l[5]!==c?(i=()=>{if(c.size){let e=setInterval(()=>{let e=new Set;for(let t of c)t&&"closed"in t&&t.closed&&e.add(t);e.size&&d(t=>{let n=new Set(t);for(let t of e)n.delete(t);return n})},p.M);return()=>{clearInterval(e)}}},a=[c],l[5]=c,l[6]=i,l[7]=a):(i=l[6],a=l[7]),(0,u.useEffect)(i,a),l[8]!==c?(s={popups:c,open:f},l[8]=c,l[9]=s):s=l[9],s};function tv(){return new Set}function tg(e){return e()}let tx=Symbol("sanity/presentation/resolveUUID");function ty(){let e,t,n,r;let i=(0,o.c)(4);i[0]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,i[0]=e):e=i[0];let[a,s]=(0,u.useState)(e);e:{let e=Array.from(a.values());if(e.find(tj)){t="connected";break e}let n=e.filter(tw);if(n.length){t=n.some(tb)?"connecting":"reconnecting";break e}t="idle"}let l=t;i[1]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{s(t=>{let n=new Map(t);if("disconnected"===e.status)n.delete(e.connection);else{let t=n.get(e.connection)?.hasConnected||"connected"===e.status,r="handshaking"===e.status?"connecting":e.status;n.set(e.connection,{status:r,hasConnected:t})}return n})},i[1]=n):n=i[1];let c=n;return i[2]!==l?(r=[l,c],i[2]=l,i[3]=r):r=i[3],r}function tb(e){let{hasConnected:t}=e;return!t}function tw(e){let{status:t}=e;return"connecting"===t}function tj(e){let{status:t}=e;return"connected"===t}let t_=(0,u.lazy)(()=>n.e(8691).then(n.bind(n,78691))),tS=(0,u.lazy)(()=>n.e(1699).then(n.bind(n,11699))),tE=(0,u.lazy)(()=>n.e(42).then(n.bind(n,80042))),tP=(0,u.lazy)(()=>n.e(4631).then(n.bind(n,64631))),tk=(0,u.lazy)(()=>n.e(8408).then(n.bind(n,48408))),tC=(0,u.lazy)(()=>n.e(2976).then(n.bind(n,2976))),tR=(0,u.lazy)(()=>n.e(404).then(n.bind(n,10404))),tz=(0,g.I4)(s.so)` 82 overflow-x: auto; 83`;function tI(e){let{canCreateUrlPreviewSecrets:t,canToggleSharePreviewAccess:n,canUseSharedPreviewAccess:r,tool:l,vercelProtectionBypass:c}=e,g=l.options?.components,y=l.options?.previewUrl,b=l.name||p.P5,{unstable_navigator:w,unstable_header:j}=g||{},{navigate:_,state:S}=(0,v.rd)(),E=(0,d.$6H)(Object.fromEntries(S._searchParams||[])),{perspectiveStack:P,selectedPerspectiveName:k="drafts",selectedReleaseId:C}=(0,d.QO2)(),R=C?P:k,z=function(e,t,n,r,i){let s=(0,d.tH7)({apiVersion:p.mG}),l=(0,d.VrO)(),c=l?.activeWorkspace?.basePath||"/",f=function(e,t,n,r){let i,a,s,l,c;let p=(0,o.c)(12);p[0]!==r?(i=()=>r||"",p[0]=r,p[1]=i):i=p[1];let[f,m]=(0,u.useState)(i),h=(0,u.useRef)(0);p[2]!==f||p[3]!==r?(a=()=>{if(f&&r)return window.clearTimeout(h.current),()=>{h.current=window.setTimeout(()=>{m("")},100)}},s=[f,r],p[2]=f,p[3]=r,p[4]=a,p[5]=s):(a=p[4],s=p[5]),(0,u.useEffect)(a,s);let v=(0,d.iZK)(),g=v?.id;return p[6]!==t||p[7]!==f||p[8]!==g||p[9]!==e||p[10]!==n?(c=["sanity/presentation",t,n,e,g,tx,f],p[6]=t,p[7]=f,p[8]=g,p[9]=e,p[10]=n,p[11]=c):c=p[11],c}(t,c,l?.activeWorkspace?.name||"default",r),m=function(e,t){let n,r,i,a;let s=(0,o.c)(10);s[0]===Symbol.for("react.memo_cache_sentinel")?(n={apiVersion:p.mG},s[0]=n):n=s[0];let l=(0,d.tH7)(n),c=(0,d.iZK)(),[f,m]=(0,u.useState)("");s[1]!==l||s[2]!==c?.id||s[3]!==t||s[4]!==e||s[5]!==f?(r=e?H(async()=>await F(l,"@sanity/presentation",typeof window>"u"?"":location.href,c?.id),[...t,f]):null,s[1]=l,s[2]=c?.id,s[3]=t,s[4]=e,s[5]=f,s[6]=r):r=s[6];let h=r;return s[7]!==h?(i=()=>
83{if(!h)return;let e=setTimeout(()=>{(0,u.startTransition)(()=>m(h.expiresAt.toString()))},h.expiresAt.getTime()-Date.now());return()=>clearTimeout(e)},a=[h],s[7]=h,s[8]=i,s[9]=a):(i=s[8],a=s[9]),(0,u.useEffect)(i,a),h?.secret||null}(i&&"object"==typeof e||"function"==typeof e,f);return H(async()=>{if("string"==typeof e){let t=new URL(e,location.origin),n=t;try{if(r){let e=new URL(r,t);e.origin===t.origin&&(n=e)}}catch{}return location.origin===n.origin&&(n.pathname.startsWith(`${c}/`)||n.pathname===c)?t:n}let t=await ("object"==typeof e?function(e){let{draftMode:t,previewMode:n,origin:r=typeof location>"u"?"https://localhost":location.origin}=e,i=n?.enable||t?.enable,{preview:o="/"}=e,s=new URL(o,r),l=i?new URL(i,r):void 0;return async t=>{try{if(t.previewSearchParam){let e=new URL(t.previewSearchParam,s);e.origin===s.origin&&(o=`${e.pathname}${e.search}`)}}catch{}"u">typeof location&&location.origin===s.origin&&t.studioBasePath&&(o.startsWith(`${t.studioBasePath}/`)||o===t.studioBasePath)&&(o=e.preview||"/");let n=new URL(o,s);if(l){let e=new URL(l),{searchParams:r}=e;return r.set(a.Vm,t.previewUrlSecret),r.set(a.Pd,t.studioPreviewPerspective),n.pathname!==e.pathname&&r.set(a.Zm,`${n.pathname}${n.search}`),e.toString()}return n.toString()}}(e):e)({client:s,previewUrlSecret:m,studioPreviewPerspective:eJ(n),previewSearchParam:r,studioBasePath:c});return new URL(t,location.origin)},[...f,m])}(y||"/",b,R,E.preview||null,t),I=(0,u.useMemo)(()=>y&&"object"==typeof y&&"draftMode"in y&&y.draftMode?(console.warn("previewUrl.draftMode is deprecated, use previewUrl.previewMode instead"),!1!==y.draftMode.shareAccess):!!y&&"object"==typeof y&&"previewMode"in y&&!!y.previewMode&&!1!==y.previewMode.shareAccess,[y]),[T]=(0,u.useState)(()=>{let e=l.options?.devMode;return"function"==typeof e?e():"boolean"==typeof e?e:"u">typeof window&&"localhost"===window.location.hostname}),$=(0,u.useMemo)(()=>z.origin,[z.origin]),A=(0,u.useRef)(null),[M,L]=(0,u.useState)(),[O,U]=(0,u.useState)(null),W=(0,u.useRef)({title:void 0,url:void 0}),{navigate:V,navigationHistory:Z,params:K,searchParams:G,structureParams:ee}=function({initialPreviewUrl:e,routerNavigate:t,routerState:n,routerSearchParams:r,frameStateRef:i}){let o=(0,u.useMemo)(()=>{let{id:t,path:i,type:o}={id:function(e){if(void 0===e)return;let t=decodeURIComponent(e)?.split(".");return"drafts"===t[0]&&t.shift(),t.join(".")}(n.id),path:function(e){if(void 0!==e)return f.C.toString(function(e){let t=[];for(let n of e.split(".")){let e=tu.exec(n);if(e){t.push(e[1],Number(e[2]));continue}let r=td.exec(n);if(r){t.push(r[1],[Number(r[2]),Number(r[3])]);continue}let i=tp.exec(n);if(i){t.push(i[1],{_key:i[2]});continue}t.push(n)}return t}(decodeURIComponent(e)))}(n.path),type:n.type};return{id:t,type:o,path:i,preview:r.preview||`${e.pathname}${e.search}`,perspective:r.perspective,viewport:r.viewport,inspect:r.inspect,rev:r.rev,since:r.since,template:r.template,templateParams:r.templateParams,view:r.view,pathKey:r.pathKey,instruction:r.instruction,comment:r.comment,changesInspectorTab:r.changesInspectorTab}},[n,r,e]),a=(0,u.useMemo)(()=>tm({inspect:o.inspect,path:o.path,rev:o.rev,since:o.since,template:o.template,templateParams:o.templateParams,view:o.view,pathKey:o.pathKey,instruction:o.instruction,comment:o.comment,changesInspectorTab:o.changesInspectorTab}),[o.changesInspectorTab,o.comment,o.inspect,o.instruction,o.path,o.pathKey,o.rev,o.since,o.template,o.templateParams,o.view]),s=(0,u.useMemo)(()=>tm({perspective:o.perspective,preview:o.preview,viewport:o.viewport}),[o.perspective,o.preview,o.viewport]),l=(0,u.useRef)(n);(0,u.useEffect)(()=>{l.current=n},[n]);let[c,p]=(0,u.useState)([n]);return{navigate:(0,u.useCallback)((e,n={},r)=>{e.id&&(e.id=(0,d.IMx)(e.id));let{_searchParams:o,...a}=l.current,s=(o||[]).reduce((e,[t,n])=>(e[t]=n,e),{}),c=tm({...a,...e}),u=tm({...s,...n});a.id!==c.id&&(delete u.template,delete u.templateParams),c._searchParams=Object.entries(u).reduce((e,[t,n])=>[...e,[t,n]],[]);let f=r??u.preview===i.current.url;p(e=>[...e,c]),t(c,{replace:f})},[t,i]),navigationHistory:c,params:o,searchParams:s,structureParam
83s:a}}({initialPreviewUrl:z,routerNavigate:_,routerState:S,routerSearchParams:E,frameStateRef:W}),et=(0,u.useMemo)(()=>q(V,50),[V]),[en,er]=(0,u.useReducer)(p.dL,{},p.xe),ei=(0,u.useMemo)(()=>K.viewport?"mobile":"desktop",[K.viewport]),[eo,ea]=function(e,t){(0,Y.x_)(e);let[n,r]=(0,u.useState)({}),[i,o]=(0,u.useState)({}),a=(0,u.useRef)(""),s=(0,u.useCallback)((e,n,i=[])=>{let s=i.filter(e=>"_projectId"in e&&e._projectId?(to("Cross dataset references are not supported yet, ignoring source document",e),!1):e);("published"===n?r:o)(n=>{let r={};for(let e of s)r[e._id]=e;return a.current!==t.current.url?(a.current=t.current.url,{[e]:r}):B(n[e],r)?n:{...n,[e]:r}})},[t]);return[(0,u.useMemo)(()=>Object.values(Object.values("published"===e?n:i).reduce((e,t)=>(Object.values(t).forEach(t=>{e[t._id]=t}),e),{})),[e,i,n]),s]}(R,W),es=(0,d.M91)(),el=(0,d.EL1)(),ec=function(e){let t,n,r,i,a,s;let l=(0,o.c)(20),{navigate:c,navigationHistory:f,path:m,previewUrl:h,resolvers:g}=e;l[0]!==g?(t=void 0===g?[]:g,l[0]=g,l[1]=t):t=l[1];let y=t,{state:b}=(0,v.rd)();l[2]===Symbol.for("react.memo_cache_sentinel")?(n={apiVersion:p.mG},l[2]=n):n=l[2];let w=(0,d.tH7)(n);l[3]!==m||l[4]!==b?(r=m||b._searchParams?.find(ts)?.[1]||"",l[3]=m,l[4]=b,l[5]=r):r=l[5];let j=r,[_,S]=(0,u.useState)(void 0),E=(0,u.useRef)(void 0);l[6]!==c||l[7]!==f?(i=(e,t)=>{e&&E.current===e._id||(S({document:e,path:t.pathname}),E.current=e?._id,f.at(-1)?.id===f.at(-2)?.id&&c?.({id:e?._id,type:e?._type}))},l[6]=c,l[7]=f,l[8]=i):i=l[8];let P=(0,x.J)(i);return l[9]!==w||l[10]!==P||l[11]!==h||l[12]!==j||l[13]!==y?(a=()=>{let e=new URL(j,"string"==typeof h?h:"object"==typeof h&&h?.origin||location.origin);if(y.length){let r;for(let t of y){let n=function(e,t){for(e of Array.isArray(e)?e:[e]){let n,r=e;if("string"==typeof e)try{let t=new URL(e);n=t.origin,r=t.pathname}catch{}if(!(n&&t.origin!==n))try{let e=(function(e,t){var n=[];return function(e,t,n){void 0===n&&(n={});var r=n.decode,i=void 0===r?function(e){return e}:r;return function(n){var r=e.exec(n);if(!r)return!1;for(var o=r[0],a=r.index,s=Object.create(null),l=1;l<r.length;l++)!function(e){if(void 0!==r[e]){var n=t[e-1];"*"===n.modifier||"+"===n.modifier?s[n.name]=r[e].split(n.prefix+n.suffix).map(function(e){return i(e,n)}):s[n.name]=i(r[e],n)}}(l);return{path:o,index:a,params:s}}}(function e(t,n,r){var i;return t instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,i=n.exec(e.source);i;)t.push({name:i[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),i=n.exec(e.source);return e}(t,n):Array.isArray(t)?(i=t.map(function(t){return e(t,n,r).source}),new RegExp("(?:".concat(i.join("|"),")"),N(r))):function(e,t,n){void 0===n&&(n={});for(var r=n.strict,i=void 0!==r&&r,o=n.start,a=n.end,s=n.encode,l=void 0===s?function(e){return e}:s,c=n.delimiter,u=n.endsWith,d="[".concat(D(void 0===u?"":u),"]|$"),p="[".concat(D(void 0===c?"/#?":c),"]"),f=void 0===o||o?"^":"",m=0;m<e.length;m++){var h=e[m];if("string"==typeof h)f+=D(l(h));else{var v=D(l(h.prefix)),g=D(l(h.suffix));if(h.pattern){if(t&&t.push(h),v||g){if("+"===h.modifier||"*"===h.modifier){var x="*"===h.modifier?"?":"";f+="(?:".concat(v,"((?:").concat(h.pattern,")(?:").concat(g).concat(v,"(?:").concat(h.pattern,"))*)").concat(g,")").concat(x)}else f+="(?:".concat(v,"(").concat(h.pattern,")").concat(g,")").concat(h.modifier)}else{if("+"===h.modifier||"*"===h.modifier)throw TypeError('Can not repeat "'.concat(h.name,'" without a prefix and suffix'));f+="(".concat(h.pattern,")").concat(h.modifier)}}else f+="(?:".concat(v).concat(g,")").concat(h.modifier)}}if(void 0===a||a)i||(f+="".concat(p,"?")),f+=n.endsWith?"(?=".concat(d,")"):"$";else{var y=e[e.length-1],b="string"==typeof y?p.indexOf(y[y.length-1])>-1:void 0===y;i||(f+="(?:".concat(p,"(?=").concat(d,"))?")),b||(f+="(?=".concat(p,"|").concat(d,")"))}return new RegExp(f,N(n))}(function(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"===r||"+"===r||"?"===r){t.push({type:"MODIFIER",index:n,value:e[n++]});continue}if("\\"===r){t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});continue}if("{"===r){t.push({type:"OPEN",index:n,value:e[n++]});continue}if("}"===r){t.push({type:"CLOSE",index:n,value:e[n++]});continue}if(":"===r){for(var i="",o=n+1;o<e.length;){var a=e.charCodeAt(o);if(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||95===a){i+=e[o++];continue}break}if(!i)throw TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:i}),n=o;continue}if("("===r){var s=1,l="",o=n+1;if("?"===e[o])throw TypeError('Pattern cannot start with "?" at '.concat(o));for(;o<e.length;){if("\\"===e[o]){l+=e[o++]+e[o++];continue}if(")"===e[o]){if(0==--s){o++;break}}else if("("===e[o]&&(s++,"?"!==e[o+1]))throw TypeError("Capturing groups are not allowed at ".concat(o));l+=e[o++]}if(s)throw TypeError("Unbalanced pattern at ".concat(n));if(!l)throw TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:l}),n=o;continue}t.push({type:"CHAR",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),r=t.prefixes,i=void 0===r?"./":r,o=t.delimiter,a=void 0===o?"/#?":o,s=[],l=0,c=0,u="",d=function(e){if(c<n.length&&n[c].type===e)return n[c++].value},p=function(e){var t=d(e);if(void 0!==t)return t;var r=n[c],i=r.type,o=r.index;throw TypeError("Unexpected ".concat(i," at ").concat(o,", expected ").concat(e))},f=function(){for(var e,t="";e=d("CHAR")||d("ESCAPED_CHAR");)t+=e;return t},m=function(e){for(var t=0;t<a.length;t++){var n=a[t];if(e.indexOf(n)>-1)return!0}return!1},h=function(e){var t=s[s.length-1],n=e||(t&&"string"==typeof t?t:"");
83if(t&&!n)throw TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!n||m(n)?"[^".concat(D(a),"]+?"):"(?:(?!".concat(D(n),")[^").concat(D(a),"])+?")};c<n.length;){var v=d("CHAR"),g=d("NAME"),x=d("PATTERN");if(g||x){var y=v||"";-1===i.indexOf(y)&&(u+=y,y=""),u&&(s.push(u),u=""),s.push({name:g||l++,prefix:y,suffix:"",pattern:x||h(y),modifier:d("MODIFIER")||""});continue}var b=v||d("ESCAPED_CHAR");if(b){u+=b;continue}if(u&&(s.push(u),u=""),d("OPEN")){var y=f(),w=d("NAME")||"",j=d("PATTERN")||"",_=f();p("CLOSE"),s.push({name:w||(j?l++:""),pattern:w&&!j?h(y):j,prefix:y,suffix:_,modifier:d("MODIFIER")||""});continue}p("END")}return s}(t,r),n,r)}(e,n,t),n,t)})(r,{decode:decodeURIComponent})(t.pathname);if(e){let{params:t,path:r}=e;return{origin:n,params:t,path:r}}}catch{throw Error(`"${e}" is not a valid route pattern`)}}}(t.route,e);if(n){r={context:n,resolver:t};break}}if(r){var t,n;let i=function(e,t){if(e.resolve){let n=e.resolve(t)?.filter;return n?`// groq 84*[${n}][0]{_id, _type}`:void 0}return"type"in e?`// groq 85*[_type == "${e.type}"][0]{_id, _type}`:`// groq 86*[${ta(e.filter,t)}][0]{_id, _type}`}(r.resolver,r.context),o=(t=r.resolver,n=r.context,t.resolve?t.resolve(n)?.params??n.params:"type"in t?{}:ta(t.params,n)??n.params);if(i){let t=new AbortController,n={perspective:"drafts",signal:t.signal};return w.fetch(i,o,n).then(t=>P(t,e)).catch(t=>{t instanceof Error&&"AbortError"===t.name||(S({document:void 0,path:e.pathname}),E.current=void 0)}),()=>{t.abort()}}}}S(void 0),E.current=void 0},l[9]=w,l[10]=P,l[11]=h,l[12]=j,l[13]=y,l[14]=a):a=l[14],l[15]!==w||l[16]!==h||l[17]!==j||l[18]!==y?(s=[w,h,j,y],l[15]=w,l[16]=h,l[17]=j,l[18]=y,l[19]=s):s=l[19],(0,u.useEffect)(a,s),_}({navigate:V,navigationHistory:Z,path:K.preview,previewUrl:l.options?.previewUrl,resolvers:l.options?.resolve?.mainDocuments}),[eu,ed]=ty(),[ep,ef]=ty(),[eh,ev]=ty(),{open:eg}=th(M),ex="loading"===en.iframe.status;(0,u.useEffect)(()=>{let e=A.current?.contentWindow;if(!e||ex)return;let t=(0,m.dK)({targetOrigin:$});return t.addTarget(e),L(t),()=>{t.destroy(),L(void 0)}},[$,ex]);let ey=(0,x.J)((e,t,n)=>et(e,t,n));(0,u.useEffect)(()=>{if(!M)return;let e=M.createChannel({name:"presentation",heartbeat:!0,connectTo:"visual-editing"},(0,m.e3)().provide({actors:(0,h.jF)()}));e.on("visual-editing/focus",e=>{"id"in e&&ey({type:e.type,id:e.id,path:e.path})}),e.on("visual-editing/navigate",e=>{let{title:t,url:n}=e;if(W.current.url!==n)try{let[e,t]=n.split("?"),r=new URLSearchParams(t);r.delete(a.tt),r.delete(a.c4),ey({},{preview:`${e}${r.size>0?"?":""}${r}`})}catch{ey({},{preview:n})}W.current={title:t,url:n}}),e.on("visual-editing/meta",e=>{W.current.title=e.title}),e.on("visual-editing/toggle",e=>{er({type:p.u5,enabled:e.enabled})}),e.on("visual-editing/documents",e=>{ea("visual-editing",e.perspective,e.documents)}),e.on("visual-editing/refreshing",e=>{"manual"===e.source?clearTimeout(eI.current):"mutation"===e.source&&er({type:p.iY})}),e.on("visual-editing/refreshed",()=>{er({type:p.cr})}),e.onStatus(ed);let t=e.start();return U(e),()=>{t(),U(null)}},[M,ea,ed,$]),(0,u.useEffect)(()=>{if(!M)return;let e=M.createChannel({name:"presentation",connectTo:"preview-kit",heartbeat:!0},(0,m.e3)().provide({actors:(0,h.jF)()}));return e.onStatus(ev),e.on("preview-kit/documents",e=>{e.projectId===es&&e.dataset===el&&ea("preview-kit",e.perspective,e.documents)}),e.start()},[M,el,es,ea,ev,$]);let eb=(0,u.useCallback)(e=>{et({path:f.C.toString(e)},{},!0)},[et]),ew=(0,u.useCallback)(e=>{let t=new URL(e,z.origin),n=t.pathname+t.search;t.origin===z.origin&&n!==K.preview&&et({},{preview:n})},[z,K,et]),ej=(0,u.useCallback)(e=>{et({},e)},[et]);(0,u.useEffect)(()=>{K.id&&K.path?O?.post("presentation/focus",{id:K.id,path:K.path}):O?.post("presentation/blur")},[K.id,K.path,O]),(0,u.useEffect)(()=>{W.current.url&&K.preview&&W.current.url!==K.preview&&(W.current.url=K.preview,"connected"!==eu&&A.current?A.current.src=`${$}${K.preview}`:O?.post("presentation/navigate",{url:K.preview,type:"replace"}))},[eu,$,K.preview,O]);let e_=(0,u.useCallback)(()=>O?.post("presentation/toggle-overlay"),[O]),[eS,eE]=(0,u.useState)(null);(0,u.useEffect)(()=>{let e=e=>{tT(e)&&e_()},t=e=>{var t,n;tT(e)&&e_(),t=["mod","\\"],n=e,t.every(e=>t$[e]?n[t$[e]]:n.key===e.toUpperCase())&&e_()};return window.addEventListener("keydown",t),window.addEventListener("keyup",e),()=>{window.removeEventListener("keydown",t),window.removeEventListener("keyup",e)}},[e_]);let[eP,ek]=(0,u.useState)(null),[{navigatorEnabled:eC,toggleNavigator:eR},ez]=function(e){let t,n,r,a;let s=(0,o.c)(11),{unstable_navigator:l}=e,c=!!l?.component,[d,p]=function(e,t){let n,r,i,a;let s=(0,o.c)(9);s[0]!==t||s[1]!==e?(n=()=>JSON.parse(localStorage.getItem(e)??JSON.stringify(t)),s[0]=t,s[1]=e,s[2]=n):n=s[2];let[l,c]=(0,u.useState)(n);return s[3]!==e||s[4]!==l?(r=()=>{localStorage.setItem(e,JSON.stringify(l))},i=[e,l],s[3]=e,s[4]=l,s[5]=r,s[6]=i):(r=s[5],i=s[6]),(0,u.useEffect)(r,i),s[7]!==l?(a=[l,c],s[7]=l,s[8]=a):a=s[8],a}("presentation/navigator",c),f=!!c&&d;e:{let e;if(!c){t=void 0;break e}s[0]!==p?(e=()=>p(eF),s[0]=p,s[1]=e):e=s[1],t=e}let m=t;s[2]!==f||s[3]!==l?(n=function(){return(0,i.jsx)(i.Fragment,{children:f&&(0,i.jsx)(eV,{...l})})},s[2]=f,s[3]=l,s[4]=n):n=s[4];let h=n;return s[5]!==f||s[6]!==m?(r={navigatorEnabled:f,toggleNavigator:m},s[5]=f,s[6]=m,s[7]=r):r=s[7],s[8]!==h||s[9]!==r?(a=[r,h],s[8]=h,s[9]=r,s[10]=a):a=s[10],a}({unstable_navigator:w}),eI=(0,u.useRef)(void 0),eT=(0,u.useCallback)(e=>{if(er({type:p.iY}
86),O){eI.current=window.setTimeout(e,300),O.post("presentation/refresh",{source:"manual",livePreviewEnabled:"connected"===eh||"connected"===ep});return}e()},[ep,eh,O]),e$=(0,d.hA9)(),eA=(0,u.useCallback)(({id:e,type:t,path:n})=>{if(W.current.url)return{title:W.current.title||W.current.url,name:"edit",params:{id:e,path:n,type:t,inspect:d.nHq,workspace:e$.name,mode:p.cc,preview:K.preview}}},[K.preview,e$.name]),eM=(0,u.useCallback)(e=>{et({},{viewport:"desktop"===e?void 0:"mobile"},!0)},[et]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eH,{devMode:T,name:b,navigate:et,params:K,searchParams:G,structureParams:ee,children:(0,i.jsx)(eW,{navigate:et,children:(0,i.jsx)(eZ,{params:K,children:(0,i.jsx)(X,{comlink:O,children:(0,i.jsx)(tz,{height:"fill",children:(0,i.jsxs)(em,{children:[(0,i.jsx)(ez,{}),(0,i.jsx)(Q,{id:"preview",minWidth:325,defaultSize:eC?50:75,order:3,children:(0,i.jsx)(s.so,{direction:"column",flex:1,height:"fill",ref:ek,children:(0,i.jsx)(s.EZ,{element:eP,children:(0,i.jsx)(te,{canSharePreviewAccess:I,canToggleSharePreviewAccess:n,canUseSharedPreviewAccess:r,dispatch:er,header:j,iframe:en.iframe,initialUrl:z,loadersConnection:ep,navigatorEnabled:eC,onPathChange:ew,onRefresh:eT,openPopup:eg,overlaysConnection:eu,previewUrl:K.preview,perspective:R,ref:A,setViewport:eM,targetOrigin:$,toggleNavigator:eR,toggleOverlay:e_,viewport:ei,visualEditing:en.visualEditing,vercelProtectionBypass:c},$)})})}),(0,i.jsx)(eN,{documentId:K.id,documentsOnPage:eo,documentType:K.type,getCommentIntent:eA,mainDocumentState:ec,onFocusPath:eb,onStructureParams:ej,searchParams:G,setDisplayedDocument:eE,structureParams:ee})]})})})})})}),(0,i.jsxs)(u.Suspense,{children:[M&&(0,i.jsx)(t_,{controller:M,perspective:R,liveDocument:eS,onDocumentsOnPage:ea,onLoadersConnection:ef}),O&&K.id&&K.type&&(0,i.jsx)(tE,{comlink:O,id:K.id,type:K.type,loadersConnection:ep,previewKitConnection:eh}),O&&(0,i.jsx)(tC,{comlink:O,perspective:R}),O&&eo.length>0&&(0,i.jsx)(tk,{comlink:O,perspective:R,refs:eo}),O&&(0,i.jsx)(tS,{comlink:O,perspective:R}),O&&(0,i.jsx)(J,{comlink:O}),O&&(0,i.jsx)(tP,{comlink:O,perspective:R}),O&&(0,i.jsx)(tR,{comlink:O})]})]})}function tT(e){return"Alt"===e.key}let t$={alt:"altKey",ctrl:"ctrlKey",mod:"u">typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)?"metaKey":"ctrlKey",shift:"shiftKey"};function tA(){return"ready"}function tM(e){let t,n,r,s,f;let m=(0,o.c)(17),{t:h}=(0,d.Bdt)(p.Yi),{previewUrl:v}=e.tool.options??{},{push:g}=(0,l.dj)(),x="object"==typeof v||"function"==typeof v,y=(0,d.E9)(),[b,w]=(0,u.useState)(null),[j,_]=(0,u.useState)(null),[S,E]=(0,u.useState)(null),[P,k]=(0,u.useState)(null);m[0]!==y||m[1]!==x?(t=()=>{if(!x)return;let e=y.checkDocumentPermission("create",{_id:a.YL,_type:a.dR}).subscribe(w),t=y.checkDocumentPermission("update",{_id:a.YL,_type:a.dR}).subscribe(_),n=y.checkDocumentPermission("read",{_id:a.YL,_type:a.dR}).subscribe(E),r=y.checkDocumentPermission("create",{_id:`drafts.${(0,c.A)()}`,_type:a.uf}).subscribe(k);return()=>{e.unsubscribe(),t.unsubscribe(),n.unsubscribe(),r.unsubscribe()}},n=[y,x],m[0]=y,m[1]=x,m[2]=t,m[3]=n):(t=m[2],n=m[3]),(0,u.useEffect)(t,n);let C=P?.granted;m[4]!==C||m[5]!==g||m[6]!==h||m[7]!==x?(r=()=>{if(!x||!1!==C)return;let e=requestAnimationFrame(()=>g({closable:!0,status:"error",duration:3e4,title:h("preview-url-secret.missing-grants")}));return()=>cancelAnimationFrame(e)},s=[C,g,h,x],m[4]=C,m[5]=g,m[6]=h,m[7]=x,m[8]=r,m[9]=s):(r=m[8],s=m[9]),(0,u.useEffect)(r,s);let[R,z]=function(){let e,t,n,r;let i=(0,o.c)(7);i[0]===Symbol.for("react.memo_cache_sentinel")?(e={apiVersion:p.mG},i[0]=e):e=i[0];let s=(0,d.tH7)(e),[l,c]=(0,u.useReducer)(tA,"loading"),[f,m]=(0,u.useState)(null);return i[1]!==s?(t=()=>{let e=function(e,t){let n=new AbortController,r=[];async function i(n,i){let{result:o,syncTags:s}=await e.fetch(a.lj,{},{filterResponse:!1,lastLiveEventId:n,tag:"preview-url-secret.fetch-vercel-bypass-protection-secret"});Array.isArray(s)&&(r=s),i.aborted||t(o)}let o=e.live.events().subscribe({next:e=>{"message"===e.type&&(n.abort(),n=new AbortController,e.tags.some(e=>r.includes(e))&&i(e.id,n.signal))},error:e=>console.error(e)});return i(null,n.signal),()=>{o.unsubscribe(),n.abort()}}(s,e=>{m(e),c()});return()=>e()},n=[s],i[1]=s,i[2]=t,i[3]=n):(t=i[2],n=i[3]),(0,u.useEffect)(t,n),i[4]!==l||i[5]!==f?(r=[f,l],i[4]=l,i[5]=f,i[6]=r):r=i[6],r}();if("loading"===z||x&&(!b||typeof b.granted>"u"||!j||typeof j.granted>"u"||!P||!S||typeof S.granted>"u"||typeof P.granted>"u")){let e;return m[10]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsx)(p.gu,{}),m[10]=e):e=m[10],e}let I=!0===C,T=b?.granted===!0&&j?.granted===!0,$=S?.granted===!0;return m[11]!==e||m[12]!==I||m[13]!==T||m[14]!==$||m[15]!==R?(f=(0,i.jsx)(tI,{...e,vercelProtectionBypass:R,canCreateUrlPreviewSecrets:I,canToggleSharePreviewAccess:T,canUseSharedPreviewAccess:$}
86),m[11]=e,m[12]=I,m[13]=T,m[14]=$,m[15]=R,m[16]=f):f=m[16],f}},51616:e=>{e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var r,i,o,a=o[i];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.