PageSourceSearch

https://www.eviny.no/_next/static/chunks/1899a420.cc97cf6a62d9b16f.js

js eviny.no collected 2026-10-02 03:37:17 UTC 323,336 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[647],{78440:(e,t,n)=>{let i;n.d(t,{C:()=>tc,S:()=>B.l4,_:()=>nC,b:()=>tP,c:()=>ow,d:()=>oo,f:()=>ot,h:()=>lF,l:()=>ob,s:()=>oq,t:()=>sI,u:()=>oc,v:()=>ns});var r=n(47419),l=n(57581),o=n(90603),a=n(19377),s=n(52823),d=n(14232),c=n(30271),u=n(56362),p=n(56706),m=n(9120),h=n(49617),f=n(95933),x=n(3649),g=n(607),b=n(33441),y=n(45019),j=n(14659),v=n(37563),_=n(49769),I=n(44492),w=n(97729),S=n(18476),C=n(1969),k=n(7262),T=n(1458),D=n(54631),P=n(27964),A=n(37876),E=n(96763),z=n(20824),R=n(31969),B=n(73889),O=n(5646),N=n(68830),L=n(36966),$=n(55543),M=n(51171),H=n(12877),V=n(13679),W=n(75308),K=n(24497),F=n(58034),J=n(18058),U=n(54501),Y=n(71397),Q=n(57714),q=n(17230),G=n(72927),X=n(97463),Z=n(77081),ee=n(71083),et=n(6266),en=n(62941),ei=n(55364),er=n(62024),el=n(52661),eo=n(51161),ea=n(69241),es=n(58465),ed=n(18371),ec=n(33383),eu=n(440),ep=n(33250),em=n(94851),eh=n(25082),ef=n(23568),ex=n(48974),eg=n(90433),eb=n(56986),ey=n(71132),ej=n(68173),ev=n(4087),e_=n(51195),eI=n(89630),ew=n(78285),eS=n(95670),eC=n(56395),ek=n(46332),eT=n(62688),eD=n(76507),eP=n(12543),eA=n(97601),eE=n(27868),ez=n(53925),eR=n(95124),eB=n(45291),eO=n(77074),eN=n(44930),eL=n(70368),e$=n(36686),eM=n(85663),eH=n(34680),eV=n(6997),eW=n(715),eK=n(82795),eF=n(48449),eJ=n(3988),eU=n(53206),eY=n(15431),eQ=n(37173),eq=n(47782),eG=n(60502),eX=n(19564),eZ=n(89959),e0=n(20426),e1=n(91423),e2=n(89770),e3=n(94875),e4=n(34635),e5=n(75485),e6=n(53617),e7=n(39796),e8=n(25737);function e9(){let e=(0,d.useContext)(B.Fi);if(!e)throw Error("DocumentPane: missing context value");return e}function te(){let e,t=(0,P.c)(25),{connectionState:n,schemaType:i,isDeleted:l,lastRevisionDocument:o,value:a,editState:s}=e9(),{t:d}=(0,R.Bdt)(r.I),c;e:{if(l){c=o;break e}c=a}let u=c,p=!!u,m;t:{if(l&&o&&i)try{let e;t[0]!==o||t[1]!==i?(e=(0,R.hCw)(o,i),t[0]=o,t[1]=i,t[2]=e):e=t[2],m=e;break t}catch(e){console.warn("Failed to prepare preview for deleted document:",e),m=null;break t}m=null}let h=m,f=p&&!l,x;t[3]===s?.version?x=t[4]:(x=s?.version&&(0,R.YW1)(s?.version)?[]:void 0,t[3]=s?.version,t[4]=x),t[5]!==u||t[6]!==i||t[7]!==f||t[8]!==x?(e={enabled:f,schemaType:i,value:u,perspectiveStack:x},t[5]=u,t[6]=i,t[7]=f,t[8]=x,t[9]=e):e=t[9];let{error:g,value:b}=(0,R.d3q)(e);if("connecting"===n&&!p){let e;return t[10]===Symbol.for("react.memo_cache_sentinel")?(e={error:void 0,title:void 0},t[10]=e):e=t[10],e}if(l&&h){let e;return t[11]===h.title?e=t[12]:(e={error:void 0,title:h.title},t[11]=h.title,t[12]=e),e}if(!b&&!l){let e,n=i?.title||i?.name,r;return t[13]!==d||t[14]!==n?(r=d("panes.document-header-title.new.text",{schemaType:n}),t[13]=d,t[14]=n,t[15]=r):r=t[15],t[16]===r?e=t[17]:(e={error:void 0,title:r},t[16]=r,t[17]=e),e}if(g){let e,n;return t[18]!==g.message||t[19]!==d?(e=d("panes.document-list-pane.error.text",{error:g.message}),t[18]=g.message,t[19]=d,t[20]=e):e=t[20],t[21]===e?n=t[22]:(n={error:e,title:void 0},t[21]=e,t[22]=n),n}let y=b?.title,j;return t[23]===y?j=t[24]:(j={error:void 0,title:y},t[23]=y,t[24]=j),j}function tt(e){let t,n,i=(0,P.c)(10),{document:l}=e,o=(0,R.I07)().get(l._type),{t:a}=(0,R.Bdt)(r.I),{title:s}=te();if(!o){let e,t;return i[0]!==l._type||i[1]!==a?(e=a("doc-title.unknown-schema-type.text",{schemaType:l._type}),i[0]=l._type,i[1]=a,i[2]=e):e=i[2],i[3]===e?t=i[4]:(t=(0,A.jsx)("code",{children:e}),i[3]=e,i[4]=t),t}return i[5]!==a||i[6]!==s?(t=s||(0,A.jsx)("span",{style:{color:"var(--card-muted-fg-color)"},children:a("doc-title.fallback.text")}),i[5]=a,i[6]=s,i[7]=t):t=i[7],i[8]===t?n=i[9]:(n=(0,A.jsx)(A.Fragment,{children:t}),i[8]=t,i[9]=n),n}let tn=(0,O.I4)(E.lt).withConfig({displayName:"ChevronWrapper",componentId:"sc-kx4hi9-0"})`margin-left:auto;`,ti=O.I4.details.withConfig({displayName:"CrossDatasetReferencesDetails",componentId:"sc-kx4hi9-1"})`flex:none;&[open] ${tn}{transform:rotate(180deg);}`,tr=O.I4.summary.withConfig({displayName:"CrossDatasetReferencesSummary",componentId:"sc-kx4hi9-2"})`list-style:none;&::-webkit-details-marker{display:none;}`,tl=O.I4.table.withConfig({displayName:"Table",componentId:"sc-kx4hi9-3"})`width:100%;text-align:left;padding:0 ${({theme:e})=>(0,E.ht)(e.sanity.space[2])};border-collapse:collapse;th{padding:${({theme:e})=>(0,E.ht)(e.sanity.space[1])};}td{padding:0 ${({theme:e})=>(0,E.ht)(e.sanity.space[1])};}tr > *:last-child{text-align:right;}`,to=(0,O.I4)(E.at).withConfig({displayName:"DocumentIdFlex",componentId:"sc-kx4hi9-4"})`min-height:33px;`,ta=e=>{let t,n,i,l,a,s,d=(0,P.c)(13),{t:c}=(0,R.Bdt)(r.I),u=e.totalCount-e.references.length;return u?(d[0]!==u||d[1]!==c?(t=c("confirm-delete-dialog.other-reference-count.title",{count:u}),d[0]=u,d[1]=c,d[2]=t):t=d[2],d[3]===t?n=d[4]:(n=(0,A.jsx)(E.et,{size:1,muted:!0,children:t}),d[3]=t,d[4]=n),d[5]===c?i=d[6]:(i=c("confirm-delete-dialog.other-reference-count.tooltip"),d[5]=c,d[6]=i),d[7]===Symbol.for("react.memo_cache_sentinel")?(l=(0,A.jsx)(E.et,{size:1,muted:!0,children:(0,A.jsx)(V.InfoOutlineIcon,{})}),d[7]=l):l=d[7],d[8]===i?a=d[9]:(a=(0,A.jsx)(o.o,{portal:!0,placement:"top",content:i,
1children:l}),d[8]=i,d[9]=a),d[10]!==n||d[11]!==a?(s=(0,A.jsx)(E.lt,{padding:2,children:(0,A.jsxs)(E.g,{gap:2,children:[n,a]})}),d[10]=n,d[11]=a,d[12]=s):s=d[12],s):null},ts={snapshot:null,isLoading:!0,original:null};function td(e){let t,n=(0,P.c)(30),{icon:i,layout:r,presence:l,schemaType:a,sortOrder:s,value:d}=e,c=(0,R.r0j)(d._id),{perspectiveStack:u,selectedVariantName:p}=(0,R.QO2)(),m;e:{let e;if(!s){m=void 0;break e}n[0]===s.by?e=n[1]:(e={ordering:{title:"",name:"",by:s.by}},n[0]=s.by,n[1]=e),m=e}let h=m,f;n[2]!==u||n[3]!==e.documentPreviewStore||n[4]!==a||n[5]!==p||n[6]!==d._id||n[7]!==h?(f=(0,R.TU6)(e.documentPreviewStore,a,d._id,u,h,p),n[2]=u,n[3]=e.documentPreviewStore,n[4]=a,n[5]=p,n[6]=d._id,n[7]=h,n[8]=f):f=n[8];let{snapshot:x,original:g,isLoading:b}=(0,W.J2)(f,ts),y;n[9]!==b||n[10]!==l||n[11]!==c.draft||n[12]!==c.published||n[13]!==c.versions?(y=b?null:(0,A.jsx)(o.i,{children:(0,A.jsxs)(E.at,{align:"center",gap:3,children:[l&&l.length>0&&(0,A.jsx)(R.JEU,{presence:l}),(0,A.jsx)(R.ZDR,{draft:c.draft,published:c.published,versions:c.versions})]})}),n[9]=b,n[10]=l,n[11]=c.draft,n[12]=c.published,n[13]=c.versions,n[14]=y):y=n[14];let j=y,v;n[15]!==c.draft||n[16]!==c.published||n[17]!==c.versions?(v=(0,A.jsx)(R.Aii,{draft:c.draft,published:c.published,versions:c.versions}),n[15]=c.draft,n[16]=c.published,n[17]=c.versions,n[18]=v):v=n[18];let _=v,I;return n[19]!==g||n[20]!==x||n[21]!==d?(I=(0,R.ADU)({snapshot:x,original:g,fallback:d}),n[19]=g,n[20]=x,n[21]=d,n[22]=I):I=n[22],n[23]!==i||n[24]!==b||n[25]!==r||n[26]!==j||n[27]!==I||n[28]!==_?(t=(0,A.jsx)(R.m6P,{...I,isPlaceholder:b,icon:i,layout:r,status:j,tooltip:_}),n[23]=i,n[24]=b,n[25]=r,n[26]=j,n[27]=I,n[28]=_,n[29]=t):t=n[29],t}function tc(){return(0,d.useContext)(B.l4)}let tu=[];function tp(e){let t,n=(0,P.c)(16),{onClick:i,type:r,value:l}=e,o=l?._id,a;n[0]===o?a=n[1]:(a=(0,R.IMx)(o),n[0]=o,n[1]=a);let s=(0,R.cVB)(a),d=(0,R.yKO)(),{ReferenceChildLink:c}=tc(),u;n[2]!==c||n[3]!==r?.name||n[4]!==l?._id?(u=function(e){return(0,A.jsx)(c,{documentId:l?._id,documentType:r?.name,parentRefPath:tu,...e})},n[2]=c,n[3]=r?.name,n[4]=l?._id,n[5]=u):u=n[5],r?.name,l?._id;let p=u,m=r?.icon,h=s?.length>0?s:tu,f;return n[6]!==d||n[7]!==m||n[8]!==h||n[9]!==r||n[10]!==l?(f=(0,A.jsx)(td,{documentPreviewStore:d,icon:m,layout:"compact",presence:h,schemaType:r,value:l}),n[6]=d,n[7]=m,n[8]=h,n[9]=r,n[10]=l,n[11]=f):f=n[11],n[12]!==p||n[13]!==i||n[14]!==f?(t=(0,A.jsx)(R.Ns2,{__unstable_focusRing:!0,as:p,"data-as":"a",onClick:i,radius:2,children:f}),n[12]=p,n[13]=i,n[14]=f,n[15]=t):t=n[15],t}let tm=(0,O.I4)(E.et).withConfig({displayName:"EllipsisText",componentId:"sc-7hioe1-0"})`max-width:120px;`,th=e=>{let t,n,i,r,l,o=(0,P.c)(43),{versionId:a,schemaType:s}=e,{t:d}=(0,R.Bdt)(),c=(0,R.yKO)(),u;o[0]===a?u=o[1]:(u=(0,R.tfA)(a),o[0]=a,o[1]=u);let p=u,{data:m}=(0,R.K0D)(),h;if(o[2]!==c||o[3]!==p||o[4]!==s||o[5]!==a){let e=["version"===p?(0,R._Sr)(a):"published"===p?"published":"drafts"];h=(0,R.TU6)(c,s,(0,R.IMx)(a),e),o[2]=c,o[3]=p,o[4]=s,o[5]=a,o[6]=h}else h=o[6];let f=h,x;o[7]===Symbol.for("react.memo_cache_sentinel")?(x={snapshot:null,isLoading:!0,original:null},o[7]=x):x=o[7];let{snapshot:g,original:b,isLoading:y}=(0,W.J2)(f,x),j;e:{let e;if("version"!==p){j=void 0;break e}if(o[8]!==m||o[9]!==a){let t;o[11]===a?t=o[12]:(t=e=>(0,R._hI)(e._id)===(0,R._Sr)(a),o[11]=a,o[12]=t),e=m.find(t),o[8]=m,o[9]=a,o[10]=e}else e=o[10];j=e}let v=j,_;t:{let e;if("version"===p){_=void 0;break t}o[13]!==p||o[14]!==d?(e=d("published"===p?"release.chip.published":"release.chip.draft"),o[13]=p,o[14]=d,o[15]=e):e=o[15],_=e}let I=_,w;o[16]!==p||o[17]!==v?(w=v?(0,R.Y73)(v):"published"===p?"positive":"caution",o[16]=p,o[17]=v,o[18]=w):w=o[18];let S=w,C;o[19]!==b||o[20]!==s.name||o[21]!==g||o[22]!==a?(C=(0,R.ADU)({snapshot:g,original:b,fallback:{_id:a,_type:s.name}}),o[19]=b,o[20]=s.name,o[21]=g,o[22]=a,o[23]=C):C=o[23],o[24]===Symbol.for("react.memo_cache_sentinel")?(t={backgroundColor:"transparent"},o[24]=t):t=o[24];let k="version"===p&&v?v:p,T;return o[25]===k?T=o[26]:(T=(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.YeQ,{release:k})}
1),o[25]=k,o[26]=T),o[27]!==p||o[28]!==v?.metadata?.title||o[29]!==I||o[30]!==a?(n="version"===p?(0,A.jsx)(R.Qfr,{title:v?.metadata?.title,fallback:(0,R._Sr)(a),children:tx}):(0,A.jsx)(tm,{size:1,weight:"medium",textOverflow:"ellipsis",children:I}),o[27]=p,o[28]=v?.metadata?.title,o[29]=I,o[30]=a,o[31]=n):n=o[31],o[32]!==T||o[33]!==n?(i=(0,A.jsxs)(E.at,{align:"center",gap:2,paddingY:2,paddingRight:3,paddingLeft:2,children:[T,n]}),o[32]=T,o[33]=n,o[34]=i):i=o[34],o[35]!==i||o[36]!==S?(r=(0,A.jsx)(E.W,{border:!0,radius:"full",children:(0,A.jsx)(E.W,{radius:"full",tone:S,style:t,children:i})}),o[35]=i,o[36]=S,o[37]=r):r=o[37],o[38]!==y||o[39]!==s.icon||o[40]!==r||o[41]!==C?(l=(0,A.jsx)(R.m6P,{...C,isPlaceholder:y,icon:s.icon,layout:"default",status:r}),o[38]=y,o[39]=s.icon,o[40]=r,o[41]=C,o[42]=l):l=o[42],l},tf=e=>{let t,n,i=(0,P.c)(8),{documentType:r,documentVersions:l}=e,o=(0,R.I07)(),a;i[0]!==r||i[1]!==o?(a=o.get(r),i[0]=r,i[1]=o,i[2]=a):a=i[2];let s=a;if(!s)throw Error(`Schema type ${r} not found`);return i[3]!==l||i[4]!==s?(t=l?.map(e=>(0,A.jsx)(th,{versionId:e,schemaType:s},e)),i[3]=l,i[4]=s,i[5]=t):t=i[5],i[6]===t?n=i[7]:(n=(0,A.jsx)(E.W,{border:!0,padding:1,radius:2,children:(0,A.jsx)(E.O,{children:t})}),i[6]=t,i[7]=n),n};function tx(e){let{displayTitle:t}=e;return(0,A.jsx)(tm,{size:1,weight:"medium",textOverflow:"ellipsis",children:t})}function tg(e){let t,n,i,l,a,s,d,c,u,p,m,h,f,x,g,b=(0,P.c)(66),{crossDatasetReferences:y,internalReferences:j,documentTitle:v,totalCount:_,action:I,datasetNames:w,hasUnknownDatasetNames:S,documentId:C,documentType:k,onReferenceLinkClick:T,documentVersions:D}=e,B=(0,R.I07)(),O=(0,z.dj)(),{t:V}=(0,R.Bdt)(r.I),W;b[0]!==T||b[1]!==B||b[2]!==V?(W=e=>{let t=B.get(e._type);return t?(0,A.jsx)(tp,{type:t,value:e,onClick:T}):(0,A.jsx)(E.lt,{padding:2,children:(0,A.jsx)(R.m6P,{icon:M.UnknownIcon,title:V("confirm-delete-dialog.preview-item.preview-unavailable.title"),subtitle:V("confirm-delete-dialog.preview-item.preview-unavailable.subtitle",{documentId:e._id}),layout:"default"})})},b[0]=T,b[1]=B,b[2]=V,b[3]=W):W=b[3];let K=W,F;b[4]!==I||b[5]!==v||b[6]!==k||b[7]!==D||b[8]!==V?(F=()=>(0,A.jsxs)(E.O,{gap:4,children:[(0,A.jsx)(E.et,{as:"p",size:1,children:(0,A.jsx)(R.HTc,{t:V,i18nKey:"confirm-delete-dialog.confirmation.text",context:I,components:{DocumentTitle:()=>(0,A.jsx)("strong",{children:v})}})}),"delete"===I&&(0,A.jsx)(tf,{documentType:k,documentVersions:D})]}),b[4]=I,b[5]=v,b[6]=k,b[7]=D,b[8]=V,b[9]=F):F=b[9];let J=F;if(j?.totalCount===0&&y?.totalCount===0){let e;return b[10]===J?e=b[11]:(e=J(),b[10]=J,b[11]=e),e}b[12]===S?t=b[13]:(t=S?["unavailable"]:[],b[12]=S,b[13]=t),b[14]!==w||b[15]!==t?(n=[...w,...t],b[14]=w,b[15]=t,b[16]=n):n=b[16];let U=n,Y=U.length,Q=U.join(", "),q=S&&U.length?"unavailable":"",G;b[17]!==U.length||b[18]!==V||b[19]!==Q||b[20]!==q?(G=V("confirm-delete-dialog.cdr-summary.subtitle",{count:Y,datasets:Q,context:q}),b[17]=U.length,b[18]=V,b[19]=Q,b[20]=q,b[21]=G):G=b[21];let X=G,Z;return b[22]===J?Z=b[23]:(Z=J(),b[22]=J,b[23]=Z),b[24]===Symbol.for("react.memo_cache_sentinel")?(i=(0,A.jsx)(E.W,{borderTop:!0,padding:1}),b[24]=i):i=b[24],b[25]===Symbol.for("react.memo_cache_sentinel")?(l=(0,A.jsx)(E.et,{"aria-hidden":"true",size:1,children:(0,A.jsx)(H.WarningOutlineIcon,{})}),b[25]=l):l=b[25],b[26]===v?a=b[27]:(a={DocumentTitle:()=>v},b[26]=v,b[27]=a),b[28]===_?s=b[29]:(s={count:_},b[28]=_,b[29]=s),b[30]!==V||b[31]!==a||b[32]!==s?(d=(0,A.jsxs)("div",{children:[i,(0,A.jsx)(E.W,{padding:3,radius:2,tone:"caution",flex:"none",children:(0,A.jsxs)(E.at,{children:[l,(0,A.jsx)(E.lt,{flex:1,marginLeft:3,children:(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.HTc,{i18nKey:"confirm-delete-dialog.referring-document-count.text",components:a,t:V,values:s})})})]})})]}),b[30]=V,b[31]=a,b[32]=s,b[33]=d):d=b[33],b[34]===v?c=b[35]:(c={DocumentTitle:()=>v},b[34]=v,b[35]=c),b[36]!==I||b[37]!==V||b[38]!==c?(u=(0,A.jsx)(E.lt,{flex:"none",children:(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.HTc,{i18nKey:"confirm-delete-dialog.referring-documents-descriptor.text",t:V,context:I,components:c})})}),b[36]=I,b[37]=V,b[38]=c,b[39]=u):u=b[39],b[40]!==j||b[41]!==K?(p=j.totalCount>0&&(0,A.jsxs)(E.O,{as:"ul",gap:2,"data-testid":"internal-references",children:[j?.references.map(e=>(0,A.jsx)(E.lt,{as:"li",children:K(e)},e._id)),j.totalCount>j.references.length&&(0,A.jsx)(E.lt,{as:"li",padding:3,children:(0,A.jsx)(ta,{...j})})]}),b[40]=j,b[41]=K,b[42]=p):p=b[42],b[43]!==y||b[44]!==X||b[45]!==C||b[46]!==j.totalCount||b[47]!==U.length||b[48]!==V||b[49]!==O?(m=y.totalCount>0&&(0,A.jsxs)(ti,{"data-testid":"cross-dataset-references",style:{borderTop:j.totalCount>0?"1px solid var(--card-shadow-outline-color)":void 0},children:[(0,A.jsx)(tr,{children:(0,A.jsx)(E.W,{as:"a",marginTop:2*(j.totalCount>0),radius:2,shadow:1,paddingY:1,children:(0,A.jsxs)(E.at,{align:"center",gap:3,paddingX:3,paddingY:1,children:[(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)($.DocumentsIcon,{})}),(0,A.jsxs)(E.O,{gap:2,children:[(0,A.jsx)(E.et,{textOverflow:"ellipsis",size:1,children:V("confirm-delete-dialog.cdr-summary.title",{count:U.length,documentCount:V("confirm-delete-dialog.cdr-summary.document-count",{count:y.totalCount})})}),(0,A.jsx)(E.et,{title:X,textOverflow:"ellipsis",size:1,muted:!0,children:X})]}),(0,A.jsx)(tn,{children:(0,A.jsx)(E.et,{muted:!0,size:1,children:(0,A.jsx)(N.ChevronDownIcon,{})})})]})})}),(0,A.jsxs)(E.lt,{overflow:"auto",paddingTop:2,children:[(0,A.jsxs)(tl,{children:[(0,A.jsx)("thead",{children:(0,A.jsxs)("tr",{children:[(0,A.jsx)("th",{children:(0,A.jsx)(E.et,{muted:!0,size:1,style:{minWidth:"5rem"},weight:"medium",children:V("confirm-delete-dialog.cdr-table.project-id.label")})}),(0,A.jsx)("th",{children:(0,A.jsx)(E.et,{muted:!0,size:1,weight:"medium",children:V("confirm-delete-dialog.cdr-table.dataset.label")})}),(0,A.jsx)("th",{children:(0,A.jsx)(E.et,{muted:!0,size:1,weight:"medium",children:V("confirm-delete-dialog.cdr-table.document-id.label")})})]})}),(0,A.jsx)("tbody",{children:y.references.filter(tb).map((e,t)=>{let{projectId:n,datasetName:i,documentId:r}=e;return(0,A.jsxs)("tr",{children:[(0,A.jsx)("td",{children:(0,A.jsx)(E.et,{size:1,children:n})}),(0,A.jsx)("td",{children:(0,A.jsx)(E.et,{size:1,children:i||"unavailable"})}),(0,A.jsx)("td",{children:(0,A.jsxs)(to,{align:"center",gap:2,justify:"flex-end",children:[(0,A.jsx)(E.et,{textOverflow:"ellipsis",size:1,children:r||"unavailable"}),r&&(0,A.jsx)(o.a,{mode:"bleed",icon:L.CopyIcon,tooltipProps:{content:V("confirm-delete-dialog.cdr-table.copy-id-button.tooltip")},onClick:()=>
1{navigator.clipboard.writeText(r).catch(()=>{O.push({status:"error",title:V("confirm-delete-dialog.cdr-table.id-copied-toast.title-failed")})})}})]})})]},`${C}-${t}`)})})]}),(0,A.jsx)(ta,{...y})]})]}),b[43]=y,b[44]=X,b[45]=C,b[46]=j.totalCount,b[47]=U.length,b[48]=V,b[49]=O,b[50]=m):m=b[50],b[51]!==p||b[52]!==m?(h=(0,A.jsx)(E.W,{radius:2,shadow:1,flex:"auto",padding:1,children:(0,A.jsxs)(E.at,{direction:"column",children:[p,m]})}),b[51]=p,b[52]=m,b[53]=h):h=b[53],b[54]===v?f=b[55]:(f={DocumentTitle:()=>v},b[54]=v,b[55]=f),b[56]!==I||b[57]!==V||b[58]!==f?(x=(0,A.jsx)(E.lt,{flex:"none",children:(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.HTc,{i18nKey:"confirm-delete-dialog.referential-integrity-disclaimer.text",t:V,context:I,components:f})})}),b[56]=I,b[57]=V,b[58]=f,b[59]=x):x=b[59],b[60]!==d||b[61]!==u||b[62]!==h||b[63]!==x||b[64]!==Z?(g=(0,A.jsxs)(E.at,{direction:"column",gap:4,children:[Z,d,u,h,x]}),b[60]=d,b[61]=u,b[62]=h,b[63]=x,b[64]=Z,b[65]=g):g=b[65],g}function tb(e){return"projectId"in e}let ty=()=>i||=(0,c.R)(document,"visibilitychange").pipe((0,_.Z)(null),(0,y.T)(()=>"visible"===document.visibilityState),(0,g.F)(),(0,D.n)(e=>e?(0,u.O)(0,5e3):p.w),(0,K.t)({refCount:!0,bufferSize:1}));function tj(e,t){let{versionedClient:n}=t;return ty().pipe((0,D.n)(()=>(function(e,{versionedClient:t}){let n=(0,R.T4)(e),i=(0,R.IMx)(e),r={uri:t.getDataUrl("doc",`${n},${i}`),json:!0,query:{excludeContent:"true"},tag:"use-referring-documents.document-existence"};return t.observable.request(r).pipe((0,y.T)(({omitted:e})=>{let t=e.filter(e=>"existence"===e.reason);if(2!==t.length)return 0===t.length||t.some(e=>e.id===n)?i:n}))})(e,t)),(0,D.n)(e=>{if(!e)return(0,m.of)({totalCount:0,references:[]});let t=n.config().dataset;return n.observable.request({url:`/data/references/${t}/documents/${e}/to?excludeInternalReferences=true&excludePaths=true`,tag:"use-referring-documents.external"}).pipe((0,I.W)(e=>{if("object"==typeof e&&e&&"statusCode"in e&&"response"in e&&404===e.statusCode)return(0,m.of)({totalCount:0,references:[]});throw e}))}))}function tv({documentId:e,versionedClient:t,documentStore:n}){var i;let r=(0,R.IMx)(e);return(0,h.z)([tI((i=r,n.listenQuery({fetch:'{"references":*[references($documentId)][0...100]{_id,_type},"totalCount":count(*[references($documentId)])}',listen:"*[references($documentId)]"},{documentId:i},{tag:"use-referring-documents",transitions:["appear","disappear"],throttleTime:5e3}))),tI(ty().pipe((0,D.n)(()=>tj(r,{versionedClient:t}))))]).pipe((0,y.T)(([[e,t],[n,i]])=>{let r=Array.from(new Set(n?.references.map(e=>e.projectId).filter(Boolean))).sort(),l=Array.from(new Set(n?.references.map(e=>e?.datasetName||"").filter(e=>!!e&&""!==e))).sort(),o=!!n?.references.some(e=>"string"!=typeof e.datasetName);return{totalCount:(e?.totalCount||0)+(n?.totalCount||0),projectIds:r,datasetNames:l,hasUnknownDatasetNames:o,internalReferences:e,crossDatasetReferences:n,isLoading:t||i}}))}let t_={isLoading:!0,totalCount:0,projectIds:[],datasetNames:[],hasUnknownDatasetNames:!1,internalReferences:void 0,crossDatasetReferences:void 0};function tI(e){return(0,f.x)((0,m.of)([void 0,!0]),e.pipe((0,y.T)(e=>[e,!1])))}let tw=(0,O.I4)(E.lt).withConfig({displayName:"DialogBody",componentId:"sc-qf8ya1-0"})`box-sizing:border-box;`,tS=(0,O.I4)(E.at).attrs({align:"center",direction:"column",justify:"center"}).withConfig({displayName:"LoadingContainer",componentId:"sc-qf8ya1-1"})`height:110px;`;function tC(e){let t,n,i,o,a,s,c,u,p,m,h,f=(0,P.c)(54),{id:x,type:g,action:b,onCancel:y,onConfirm:j}=e,v=void 0===b?"delete":b,{t:_}=(0,R.Bdt)(r.I),I=`deletion-confirmation-${(0,d.useId)()}`,{internalReferences:w,crossDatasetReferences:S,isLoading:C,totalCount:k,projectIds:T,datasetNames:D,hasUnknownDatasetNames:E}=(t=(0,P.c)(4),n=(0,R.tH7)(R.miu),i=(0,R.q3J)(),t[0]!==x||t[1]!==i||t[2]!==n?(o=tv({documentId:x,versionedClient:n,documentStore:i}),t[0]=x,t[1]=i,t[2]=n,t[3]=o):o=t[3],(0,W.J2)(o,t_)),z;f[0]!==x||f[1]!==g?(z={_id:x,_type:g},f[0]=x,f[1]=g,f[2]=z):z=f[2];let B=z,O;f[3]===B?O=f[4]:(O=(0,A.jsx)(tt,{document:B}),f[3]=B,f[4]=O);let N=O,L=!C,$;f[5]===x?$=f[6]:($=(0,R.IMx)(x),f[5]=x,f[6]=$),f[7]===$?a=f[8]:(a={documentId:$},f[7]=$,f[8]=a);let{data:M,loading:H}=(0,R.gn8)(a),V;f[9]!==S?.totalCount||f[10]!==M||f[11]!==w?.totalCount||f[12]!==j||f[13]!==k?(V=()=>{j(M,{totalReferenceCount:k,internalReferenceCount:w?.totalCount??0,crossDatasetReferenceCount:S?.totalCount??0})},f[9]=S?.totalCount,f[10]=M,f[11]=w?.totalCount,f[12]=j,f[13]=k,f[14]=V):V=f[14];let K=V,F;return f[15]!==v||f[16]!==_?(F=_("confirm-delete-dialog.header.text",{context:v}
1),f[15]=v,f[16]=_,f[17]=F):F=f[17],f[18]===_?s=f[19]:(s=_("confirm-delete-dialog.cancel-button.text"),f[18]=_,f[19]=s),f[20]!==y||f[21]!==s?(c={onClick:y,text:s},f[20]=y,f[21]=s,f[22]=c):c=f[22],f[23]!==v||f[24]!==K||f[25]!==L||f[26]!==_||f[27]!==k?(u=L?{text:_(k>0?"confirm-delete-dialog.confirm-anyway-button.text":"confirm-delete-dialog.confirm-button.text",{context:v}),onClick:K}:void 0,f[23]=v,f[24]=K,f[25]=L,f[26]=_,f[27]=k,f[28]=u):u=f[28],f[29]!==c||f[30]!==u?(p={cancelButton:c,confirmButton:u},f[29]=c,f[30]=u,f[31]=p):p=f[31],f[32]!==v||f[33]!==S||f[34]!==D||f[35]!==N||f[36]!==M||f[37]!==E||f[38]!==x||f[39]!==w||f[40]!==C||f[41]!==y||f[42]!==T||f[43]!==_||f[44]!==k||f[45]!==g||f[46]!==H?(m=(0,A.jsx)(tw,{children:S&&w&&!C&&!H?(0,A.jsx)(tg,{crossDatasetReferences:S,internalReferences:w,documentTitle:N,isLoading:C,totalCount:k,action:v,projectIds:T,datasetNames:D,hasUnknownDatasetNames:E,onReferenceLinkClick:y,documentId:x,documentType:g,documentVersions:M}):(0,A.jsx)(tS,{"data-testid":"loading-container",children:(0,A.jsx)(R.gd4,{showText:!0,title:_("confirm-delete-dialog.loading.text")})})}),f[32]=v,f[33]=S,f[34]=D,f[35]=N,f[36]=M,f[37]=E,f[38]=x,f[39]=w,f[40]=C,f[41]=y,f[42]=T,f[43]=_,f[44]=k,f[45]=g,f[46]=H,f[47]=m):m=f[47],f[48]!==I||f[49]!==y||f[50]!==p||f[51]!==m||f[52]!==F?(h=(0,A.jsx)(l.i,{width:1,id:I,header:F,footer:p,onClose:y,onClickOutside:y,children:m}),f[48]=I,f[49]=y,f[50]=p,f[51]=m,f[52]=F,f[53]=h):h=f[53],h}function tk(e){let t=(0,P.c)(6),{t:n}=(0,R.Bdt)(r.I),i=(0,d.useId)(),[a,s]=(0,d.useState)(null),c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>s(null),t[0]=c):c=t[0];let u=c,p;return t[1]!==a||t[2]!==i||t[3]!==e||t[4]!==n?(p=a?(0,A.jsx)(l.i,{id:`dialog-error-${i}`,"data-testid":"confirm-delete-error-dialog",header:n("confirm-delete-dialog.error.title.text"),footer:{confirmButton:{text:n("confirm-delete-dialog.error.retry-button.text"),onClick:u,tone:"default"}},onClose:e.onCancel,children:(0,A.jsx)(E.lt,{padding:4,children:(0,A.jsx)(E.et,{size:1,children:n("confirm-delete-dialog.error.message.text")})})}):(0,A.jsx)(o.c,{onCatch:s,children:(0,A.jsx)(tC,{...e})}),t[1]=a,t[2]=i,t[3]=e,t[4]=n,t[5]=p):p=t[5],p}let tT=(0,O.I4)(E.W).withConfig({displayName:"Root",componentId:"sc-8y3ry9-0"})`transition:opacity 200ms;position:relative;z-index:1;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);opacity:0;&:not([hidden]){display:flex;}&:not([data-collapsed]){overflow:auto;}&[data-mounted]{opacity:1;}&[data-resizing]{pointer-events:none;}`,tD=[];function tP(e){let t,n,i,r,l,o,a,s,c=(0,P.c)(41),u,p,m,h,f;c[0]===e?(u=c[1],p=c[2],m=c[3],h=c[4],f=c[5]):({children:u,minWidth:p,onCollapse:m,onExpand:h,...f}=e,c[0]=e,c[1]=u,c[2]=p,c[3]=m,c[4]=h,c[5]=f);let[x]=(0,d.useState)(tA),[g,b]=(0,d.useState)(null),y=(0,z.sQ)(g)?.width||0,j=void 0!==y&&p?y<p:void 0,v;c[6]===Symbol.for("react.memo_cache_sentinel")?(v={expandedElement:null,panes:[],resizing:!1},c[6]=v):v=c[6];let[_,I]=(0,d.useState)(v),w,S;c[7]!==x||c[8]!==g?(w=()=>x.setRootElement(g),S=[x,g],c[7]=x,c[8]=g,c[9]=w,c[10]=S):(w=c[9],S=c[10]),(0,d.useEffect)(w,S),c[11]!==x||c[12]!==y?(t=()=>x.setRootWidth(y),n=[x,y],c[11]=x,c[12]=y,c[13]=t,c[14]=n):(t=c[13],n=c[14]),(0,d.useEffect)(t,n),c[15]===x?(i=c[16],r=c[17]):(i=()=>x.subscribe(I),r=[x],c[15]=x,c[16]=i,c[17]=r),(0,d.useEffect)(i,r),c[18]!==j||c[19]!==m||c[20]!==h?(l=()=>{void 0!==j&&(j&&m&&m(),!j&&h&&h())},o=[j,m,h],c[18]=j,c[19]=m,c[20]=h,c[21]=l,c[22]=o):(l=c[21],o=c[22]),(0,d.useEffect)(l,o),c[23]!==j||c[24]!==x.collapse||c[25]!==x.expand||c[26]!==x.mount||c[27]!==x.resize||c[28]!==_.expandedElement||c[29]!==_.panes||c[30]!==_.resizing?(a={collapse:x.collapse,collapsed:j,expand:x.expand,expandedElement:_.expandedElement,mount:x.mount,panes:_.panes,resize:x.resize,resizing:_.resizing},c[23]=j,c[24]=x.collapse,c[25]=x.expand,c[26]=x.mount,c[27]=x.resize,c[28]=_.expandedElement,c[29]=_.panes,c[30]=_.resizing,c[31]=a):a=c[31];let C=a,k=j?"":void 0,T=_.resizing?"":void 0,D=y?"":void 0,E;return c[32]!==u||c[33]!==f||c[34]!==k||c[35]!==T||c[36]!==D?(E=(0,A.jsx)(tT,{"data-ui":"PaneLayout",...f,"data-collapsed":k,"data-resizing":T,"data-mounted":D,ref:b,children:u}),c[32]=u,c[33]=f,c[34]=k,c[35]=T,c[36]=D,c[37]=E):E=c[37],c[38]!==C||c[39]!==E?(s=(0,A.jsx)(B._U.Provider,{value:C,children:E}),c[38]=C,c[39]=E,c[40]=s):s=c[40],s}function tA(){return function(){let e=[],t=[],n=new WeakMap,i=new Set,r={},l=null,o=0,a=null,s=null,d=new Map,c=!1;function u(e){i.delete(e),a=e,p()}return{collapse:function(e){i.add(e),a===e&&(a=null),p()},expand:u,maximize:function(e){s=e,p()},mount:function(e,i){return n.set(e,{...i,original:i}),t.push(e),l&&function(e,t){let n=new WeakMap;for(let i of t)n.set(i,function(e,t){let n=[],i=t;for(;i!==e;){let t=i.parentElement;if(!t)break;let r=Array.from(t.childNodes).indexOf(i);if(n.unshift(r),t===e)break;i=t}return n}(e,i));t.sort((e,t)=>
1{let i=n.get(e)||tD,r=n.get(t)||tD,l=Math.max(i.length,r.length);for(let e=0;e<l;e+=1){let t=i[e]||-1,n=r[e]||-1;if(t!==n)return t-n}return 0})}(l,t),u(e),()=>{let i=t.indexOf(e);i>-1&&t.splice(i,1),n.delete(e),s===e&&(s=null),p()}},resize:function(e,i,l){let o=t.indexOf(i),a=n.get(i);if(!a)return;let s=t[o+1],u=n.get(s);if(u){if("start"===e&&(c=!0,r.left={element:i,flex:a.flex||1,width:i.offsetWidth},r.right={element:s,flex:u.flex||1,width:s.offsetWidth},p()),"move"===e&&r.left&&r.right){let e,t,n,o,c,m,h,f,x,g,b,y;d=new Map;let{leftW:j,rightW:v,leftFlex:_,rightFlex:I}=(e={flex:r.left.flex+r.right.flex,width:r.left.width+r.right.width},t=a.minWidth??204,n=u.minWidth??204,o=Math.min(a.maxWidth||1/0,e.width-n),c=Math.min(u.maxWidth||1/0,e.width-t),(m=t-r.left.width)<(h=r.right.width-c)&&(m=h),(f=r.right.width-n)>(x=o-r.left.width)&&(f=x),g=Math.min(Math.max(l,m),f),b=r.left.width+g,y=r.right.width-g,{leftFlex:b/e.width*e.flex,leftW:b,rightFlex:y/e.width*e.flex,rightW:y});d.set(i,{flex:_,width:j}),d.set(s,{flex:I,width:v}),p()}if("end"===e){c=!1;let e=d.get(i),t=d.get(s);n.set(i,{...a,currentMinWidth:0,currentMaxWidth:a.maxWidth??1/0,flex:e?.flex??a.flex}),n.set(s,{...u,currentMinWidth:0,currentMaxWidth:a.maxWidth??1/0,flex:t?.flex??u.flex}),d=new Map,delete r.left,delete r.right,p()}}},setRootElement:function(e){l=e},setRootWidth:function(e){o=e,p()},subscribe:function(t){return e.push(t),()=>{let n=e.push(t);n>-1&&e.splice(n,1)}}};function p(){if(!o)return;let r=[];for(let e of t)e!==a&&r.unshift(e);a&&r.unshift(a);let l=new WeakMap,u=r.length,p=r[0],m=o-(u-1)*51;for(let e of r){let t=n.get(e);if(!t)continue;let r=t.currentMinWidth||t.minWidth||204,o=e===p,a=i.has(e),c=!o&&(a||r>m),u=d.get(e);l.set(e,{element:e,collapsed:c,currentMinWidth:u?.width??t.currentMinWidth,currentMaxWidth:u?.width??t.currentMaxWidth,flex:u?.flex??t.flex??1,maximized:e===s}),c?m-=51:m-=r-51}let h=[];for(let e of t){let t=l.get(e);t&&h.push(t)}for(let n of e)n({expandedElement:a||t[t.length-1]||null,panes:h,resizing:c})}}()}let tE=(0,O.I4)(E.W).withConfig({displayName:"Root",componentId:"sc-7enki7-0"})({position:"relative",zIndex:"1",lineHeight:"0"});function tz(e){let t,n,i,l,a,s=(0,P.c)(25),d,c,u,p,m,h;s[0]===e?(d=s[1],c=s[2],u=s[3],p=s[4],m=s[5],h=s[6]):({as:u,children:d,closeButtonLabel:c,onClose:p,title:h,...m}=e,s[0]=e,s[1]=d,s[2]=c,s[3]=u,s[4]=p,s[5]=m,s[6]=h);let{t:f}=(0,R.Bdt)(r.I),x;return s[7]===h?x=s[8]:(x=(0,A.jsx)(E.lt,{flex:1,padding:3,children:(0,A.jsx)(E.et,{as:"h1",size:1,weight:"medium",children:h})}),s[7]=h,s[8]=x),s[9]===f?t=s[10]:(t=f("document-inspector.close-button.tooltip"),s[9]=f,s[10]=t),s[11]===t?n=s[12]:(n={content:t},s[11]=t,s[12]=n),s[13]!==c||s[14]!==p||s[15]!==n?(i=(0,A.jsx)(E.lt,{flex:"none",padding:1,children:(0,A.jsx)(o.a,{"aria-label":c,icon:Y.CloseIcon,mode:"bleed",onClick:p,tooltipProps:n})}),s[13]=c,s[14]=p,s[15]=n,s[16]=i):i=s[16],s[17]!==x||s[18]!==i?(l=(0,A.jsxs)(E.at,{padding:2,children:[x,i]}),s[17]=x,s[18]=i,s[19]=l):l=s[19],s[20]!==d||s[21]!==u||s[22]!==m||s[23]!==l?(a=(0,A.jsxs)(tE,{...m,as:u,children:[l,d]}),s[20]=d,s[21]=u,s[22]=m,s[23]=l,s[24]=a):a=s[24],a}let tR=(0,G.g_)({name:"DiffViewEntered",version:1,description:"User entered document comparison view"}),tB=(0,G.g_)({name:"DiffViewExited",version:1,description:"User exited document comparison view"}),tO=(0,G.g_)({name:"DiffViewDocumentSelectionChanged",version:1,description:"User set one of the documents being compared"}),tN="diffView",tL="previousDocument",t$="nextDocument";function tM(){let e=(0,P.c)(9),{navigate:t,state:n}=(0,ee.rd)(),i;e[0]!==t||e[1]!==n?(i=e=>{let{mode:i,previousDocument:r,nextDocument:l}=e,o={...(0,X.A)(n._searchParams),...i?{[tN]:i}:{},...r?{[tL]:[r.type,r.id].join(",")}:{},...l?{[t$]:[l.type,l.id].join(",")}:{}};t({...n,_searchParams:(0,Z.A)(o)})},e[0]=t,e[1]=n,e[2]=i):i=e[2];let r=i,l;e[3]!==t||e[4]!==n?(l=()=>{t({...n,_searchParams:(n._searchParams??[]).filter(tH)})},e[3]=t,e[4]=n,e[5]=l):l=e[5];let o=l,a;return e[6]!==o||e[7]!==r?(a={navigateDiffView:r,exitDiffView:o},e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function tH(e){let[t]=e;return![tN,tL,t$].includes(t)}let tV=["version"];function tW(e){let t,n,i,r,l,o,a=(0,P.c)(33),s;a[0]===e?s=a[1]:(s=void 0===e?{}:e,a[0]=e,a[1]=s);let{onParamsError:c,onActiveChanged:u,onTargetDocumentsChanged:p}=s,{state:m}=(0,ee.rd)(),h,f,x;if(a[2]!==m._searchParams){let e=new URLSearchParams(m._searchParams);f=e.get(tL),h=e.get(t$),x=e.get(tN),a[2]=m._searchParams,a[3]=h,a[4]=f,a[5]=x}else h=a[3],f=a[4],x=a[5];let g=x,b=[f,h,g].some(tK),y=(0,d.useRef)(void 0),j=f??"",v=h??"",_=g??"",I;a[6]!==j||a[7]!==v||a[8]!==_?(I=function({previousDocument:e,nextDocument:t,mode:n}
1){let i=[],[r,l]=e.split(",").filter(Boolean),[o,a]=t.split(",").filter(Boolean);return tV.includes(n)||i.push(["invalidModeParam",n]),(void 0===r||void 0===l)&&i.push(["invalidPreviousDocumentParam",e]),(void 0===o||void 0===a)&&i.push(["invalidNextDocumentParam",t]),0===i.length?{result:"success",params:{mode:n,documents:{previous:{type:r,id:l},next:{type:o,id:a}}}}:{result:"error",errors:i}}({previousDocument:j,nextDocument:v,mode:_}),a[6]=j,a[7]=v,a[8]=_,a[9]=I):I=a[9];let w=I,S;a[10]!==b||a[11]!==c||a[12]!==w.errors||a[13]!==w.result?(S=()=>{"error"===w.result&&b&&c?.(w.errors)},a[10]=b,a[11]=c,a[12]=w.errors,a[13]=w.result,a[14]=S):S=a[14],a[15]!==b||a[16]!==c||a[17]!==w?(t=[b,c,w],a[15]=b,a[16]=c,a[17]=w,a[18]=t):t=a[18],(0,d.useEffect)(S,t);e:{let e;if("error"===w.result){let e;a[19]===Symbol.for("react.memo_cache_sentinel")?(e={isActive:!1},a[19]=e):e=a[19],n=e;break e}a[20]===w.params?e=a[21]:(e={state:"ready",isActive:!0,...w.params},a[20]=w.params,a[21]=e),n=e}let C=n,k,T;return a[22]!==u||a[23]!==C?(k=()=>{"function"==typeof u&&y.current?.isActive!==C.isActive&&u(y.current,C)},T=[u,C],a[22]=u,a[23]=C,a[24]=k,a[25]=T):(k=a[24],T=a[25]),(0,d.useEffect)(k,T),a[26]!==p||a[27]!==C?(i=()=>{"function"==typeof p&&y.current?.isActive&&C.isActive&&!(0,et.A)([y?.current?.documents?.previous.id,y?.current?.documents?.next.id],[C.documents?.previous.id,C.documents?.next.id])&&p(y.current,C)},r=[p,C],a[26]=p,a[27]=C,a[28]=i,a[29]=r):(i=a[28],r=a[29]),(0,d.useEffect)(i,r),a[30]===C?(l=a[31],o=a[32]):(l=()=>{y.current=C},o=[C],a[30]=C,a[31]=l,a[32]=o),(0,d.useEffect)(l,o),C}function tK(e){return null!==e}function tF(e,t){return!e?.isActive&&t.isActive?"entered":e?.isActive&&!t.isActive?"exited":void 0}function tJ(e){return null!==e}function tU(e,t){return(0,R._4P)(e)?"published":(0,R.R8D)(e)?"draft":t.find(({_id:t})=>(0,R._hI)(t)===(0,R._Sr)(e))??(0,R._Sr)(e)}let tY=O.I4.header.withConfig({displayName:"VersionModeHeaderLayout",componentId:"sc-cjujev-0"})`display:grid;grid-area:header;grid-template-columns:1fr min-content 1fr;border-block-end:1px solid var(--card-border-color);`,tQ=O.I4.div.withConfig({displayName:"VersionModeHeaderLayoutSection",componentId:"sc-cjujev-1"})`display:flex;justify-content:space-between;align-items:center;`,tq=e=>{let t,n,i,l,o,a,s,d,c,u=(0,P.c)(48),{documentId:p,state:m}=e,{t:h}=(0,R.Bdt)(r.I),f;u[0]===p?f=u[1]:(f={documentId:p},u[0]=p,u[1]=f);let{data:x}=(0,R.gn8)(f),{exitDiffView:g,navigateDiffView:b}=tM(),{documents:y}=tW(),j=(0,R.K0D)(),v;u[2]===x?v=u[3]:(v=x.flatMap(tZ),u[2]=x,u[3]=v);let _=v,I;if(u[4]!==j.data||u[5]!==_){let e;u[7]===_?e=u[8]:(e=e=>{let t=(0,R._hI)(e._id);return void 0!==t&&_.includes(t)},u[7]=_,u[8]=e),I=j.data.filter(e),u[4]=j.data,u[5]=_,u[6]=I}else I=u[6];let w=I,S;u[9]===j?S=u[10]:(S=function({loading:e,error:t}){return e?"pending":void 0===t?"ready":"error"}(j),u[9]=j,u[10]=S);let C=S,k;u[11]!==y||u[12]!==b?(k=e=>{y?.previous!==void 0&&b({previousDocument:{...y.previous,id:e}})},u[11]=y,u[12]=b,u[13]=k):k=u[13];let T=k,D;u[14]!==y||u[15]!==b?(D=e=>{y?.next!==void 0&&b({nextDocument:{...y.next,id:e}})},u[14]=y,u[15]=b,u[16]=D):D=u[16];let z=D,B;return u[17]===h?B=u[18]:(B=h("compare-versions.title"),u[17]=h,u[18]=B),u[19]===B?t=u[20]:(t=(0,A.jsx)(E.lt,{padding:4,children:(0,A.jsx)(E.et,{as:"h1",size:1,muted:!0,children:B})}),u[19]=B,u[20]=t),u[21]!==p||u[22]!==y||u[23]!==T||u[24]!==w||u[25]!==C||u[26]!==m?(n=y?.previous!==void 0&&(0,A.jsx)(tG,{releases:w,releasesState:C,onSelectRelease:T,role:"previous",documentId:p,state:m,document:y.previous}),u[21]=p,u[22]=y,u[23]=T,u[24]=w,u[25]=C,u[26]=m,u[27]=n):n=u[27],u[28]!==t||u[29]!==n?(i=(0,A.jsxs)(tQ,{children:[t,n]}),u[28]=t,u[29]=n,u[30]=i):i=u[30],u[31]===Symbol.for("react.memo_cache_sentinel")?(l=(0,A.jsx)(E.at,{align:"center",paddingX:3,children:(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(er.TransferIcon,{})})}),u[31]=l):l=u[31],u[32]!==p||u[33]!==y||u[34]!==z||u[35]!==w||u[36]!==C||u[37]!==m?(o=y?.next!==void 0&&(0,A.jsx)(tG,{releases:w,releasesState:C,onSelectRelease:z,role:"next",documentId:p,state:m,document:y.next}),u[32]=p,u[33]=y,u[34]=z,u[35]=w,u[36]=C,u[37]=m,u[38]=o):o=u[38],u[39]===Symbol.for("react.memo_cache_sentinel")?(a={justifySelf:"end"},u[39]=a):a=u[39],u[40]===g?s=u[41]:(s=(0,A.jsx)(E.lt,{padding:3,style:a,children:(0,A.jsx)(E.Y,{icon:Y.CloseIcon,mode:"bleed",onClick:g,padding:2})}),u[40]=g,u[41]=s),u[42]!==o||u[43]!==s?(d=(0,A.jsxs)(tQ,{children:[o,s]}),u[42]=o,u[43]=s,u[44]=d):d=u[44],u[45]!==i||u[46]!==d?(c=(0,A.jsxs)(tY,{children:[i,l,d]}),u[45]=i,u[46]=d,u[47]=c):c=u[47],c},tG=e=>{let t,n,i,l,a,s,d,c=(0,P.c)(46),{releases:u,releasesState:p,onSelectRelease:m,role:h,documentId:f,document:x}=e,g;c[0]===u?g=c[1]:(g=void 0===u?[]:u,c[0]=u,c[1]=g);let b=g,y;c[2]===x.id?y=c[3]:(y=(0,R.IMx)(x.id),c[2]=x.id,c[3]=y);let{published:j,draft:v}=(0,R.zX2)(y,x.type),_;c[4]!==x.id||c[5]!==b?(_=tU(x.id,b),c[4]=x.id,c[5]=b,c[6]=_):_=c[6];let I=_,{t:w}=(0,R.Bdt)(r.I),{t:S}=(0,R.Bdt)(),{document:C}=(0,R.hA9)(),{drafts:k}=C,{enabled:T}=k;if("error"===p){let e,t;return c[7]===w?e=c[8]:(e=w("compare-version.error.loadReleases.title"),c[7]=w,c[8]=e),c[9]===e?t=c[10]:(t=(0,A.jsx)(z.Ex,{tone:"critical",radiu
1s:3,children:e}),c[9]=e,c[10]=t),t}if(c[11]!==p||c[12]!==I||c[13]!==S||c[14]!==w?(t=function({selected:e,tCore:t,tStructure:n,releasesState:i}){if("pending"===i)return{text:t("common.loading"),tone:"neutral",disabled:!0};if((0,R.Jrl)(e)){let n=e?(0,R.Y73)(e):"neutral";return{text:e?.metadata.title||t("release.placeholder-untitled-release"),icon:(0,A.jsx)(R.Rdi,{padding:1,release:e}),iconRight:e&&(0,R.KJ$)(e)?(0,A.jsx)(ei.LockIcon,{}):void 0,tone:n}}if((0,R.bM7)(e)){let t="published"===e?"positive":"caution",i="published"===e?R.ly_:R.k0f;return{text:n(["compare-versions.status",e].join(".")),icon:(0,A.jsx)(R.Rdi,{padding:1,release:i}),tone:t}}return{text:e,icon:(0,A.jsx)(R.Rdi,{padding:1,releaseType:"undecided"}),tone:"neutral"}}({selected:I,tCore:S,tStructure:w,releasesState:p}),c[11]=p,c[12]=I,c[13]=S,c[14]=w,c[15]=t):t=c[15],c[16]===t?n=c[17]:(n=(0,A.jsx)(E.Y,{type:"button",mode:"bleed",padding:2,paddingRight:3,radius:"full",selected:!0,...t}),c[16]=t,c[17]=n),c[18]!==f||c[19]!==m||c[20]!==j||c[21]!==I?(i=j&&(0,A.jsx)(tX,{type:"published",onSelect:m,isSelected:"published"===I,documentId:f}),c[18]=f,c[19]=m,c[20]=j,c[21]=I,c[22]=i):i=c[22],c[23]!==f||c[24]!==v||c[25]!==T||c[26]!==m||c[27]!==I?(l=T&&v&&(0,A.jsx)(tX,{type:"draft",onSelect:m,isSelected:"draft"===I,documentId:f}),c[23]=f,c[24]=v,c[25]=T,c[26]=m,c[27]=I,c[28]=l):l=c[28],c[29]!==f||c[30]!==m||c[31]!==b||c[32]!==I){let e;c[34]!==f||c[35]!==m||c[36]!==I?(e=e=>(0,A.jsx)(tX,{release:e,onSelect:m,isSelected:"string"!=typeof I&&I?._id===e._id,documentId:f},e._id),c[34]=f,c[35]=m,c[36]=I,c[37]=e):e=c[37],a=b.map(e),c[29]=f,c[30]=m,c[31]=b,c[32]=I,c[33]=a}else a=c[33];return c[38]!==l||c[39]!==a||c[40]!==i?(s=(0,A.jsxs)(E.p,{children:[i,l,a]}),c[38]=l,c[39]=a,c[40]=i,c[41]=s):s=c[41],c[42]!==h||c[43]!==s||c[44]!==n?(d=(0,A.jsx)(o.r,{id:h,button:n,menu:s}),c[42]=h,c[43]=s,c[44]=n,c[45]=d):d=c[45],d},tX=e=>{let t,n,i,l,o,a,s,d,c,u,p,m=(0,P.c)(52),{type:h,release:f,onSelect:x,isSelected:g,documentId:b}=e,{t:y}=(0,R.Bdt)(),{t:j}=(0,R.Bdt)(r.I),v=(0,R.sfL)(),_;m[0]!==b||m[1]!==x||m[2]!==f||m[3]!==h?(_=()=>{"draft"===h?x((0,R.T4)(b)):"published"===h?x((0,R.IMx)(b)):f?._id!==void 0&&x((0,R.ctg)(b,(0,R._hI)(f._id)))},m[0]=b,m[1]=x,m[2]=f,m[3]=h,m[4]=_):_=m[4];let I=_;if(h){let e,t,n,i,r="published"===h?R.ly_:R.k0f,l;m[5]===r?l=m[6]:(l=(0,A.jsx)(R.Rdi,{padding:2,release:r}),m[5]=r,m[6]=l),m[7]===h?e=m[8]:(e=["compare-versions.status",h],m[7]=h,m[8]=e);let o=e.join("."),a;return m[9]!==o||m[10]!==j?(a=j(o),m[9]=o,m[10]=j,m[11]=a):a=m[11],m[12]===a?t=m[13]:(t=(0,A.jsx)(E.lt,{paddingY:2,children:(0,A.jsx)(E.et,{size:1,weight:"medium",children:a})}),m[12]=a,m[13]=t),m[14]!==l||m[15]!==t?(n=(0,A.jsxs)(E.at,{gap:1,children:[l,t]}),m[14]=l,m[15]=t,m[16]=n):n=m[16],m[17]!==g||m[18]!==I||m[19]!==n?(i=(0,A.jsx)(E.u,{padding:1,paddingRight:3,onClick:I,pressed:g,children:n}),m[17]=g,m[18]=I,m[19]=n,m[20]=i):i=m[20],i}m[21]===f?t=m[22]:(t=(0,A.jsx)(R.Rdi,{padding:2,release:f}),m[21]=f,m[22]=t),m[23]===Symbol.for("react.memo_cache_sentinel")?(n={minWidth:0},m[23]=n):n=m[23];let w=f.metadata.title,S;return m[24]===y?S=m[25]:(S=y("release.placeholder-untitled-release"),m[24]=y,m[25]=S),m[26]===Symbol.for("react.memo_cache_sentinel")?(i={size:1,weight:"medium"},m[26]=i):i=m[26],m[27]!==f.metadata.title||m[28]!==S?(l=(0,A.jsx)(R.Qfr,{title:w,fallback:S,textProps:i}),m[27]=f.metadata.title,m[28]=S,m[29]=l):l=m[29],m[30]!==f.metadata.releaseType||m[31]!==y?(o=["asap","undecided"].includes(f.metadata.releaseType)&&(0,A.jsx)(E.et,{muted:!0,size:1,children:y(`release.type.${f.metadata.releaseType}`)}),m[30]=f.metadata.releaseType,m[31]=y,m[32]=o):o=m[32],m[33]!==v||m[34]!==f?(a="scheduled"===f.metadata.releaseType&&(0,A.jsx)(E.et,{muted:!0,size:1,children:v(f)}),m[33]=v,m[34]=f,m[35]=a):a=m[35],m[36]!==l||m[37]!==o||m[38]!==a?(s=(0,A.jsxs)(E.O,{flex:1,paddingY:2,paddingRight:2,gap:2,style:n,children:[l,o,a]}),m[36]=l,m[37]=o,m[38]=a,m[39]=s):s=m[39],m[40]===f?d=m[41]:(d=(0,R.KJ$)(f)&&(0,A.jsx)(E.lt,{padding:2,children:(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(ei.LockIcon,{})})}),m[40]=f,m[41]=d),m[42]===d?c=m[43]:(c=(0,A.jsx)(E.at,{flex:"none",children:d}),m[42]=d,m[43]=c),m[44]!==s||m[45]!==c||m[46]!==t?(u=(0,A.jsxs)(E.at,{gap:1,children:[t,s,c]}),m[44]=s,m[45]=c,m[46]=t,m[47]=u):u=m[47],m[48]!==g||m[49]!==I||m[50]!==u?(p=(0,A.jsx)(E.u,{padding:1,paddingRight:3,onClick:I,pressed:g,children:u}),m[48]=g,m[49]=I,m[50]=u,m[51]=p):p=m[51],p};function tZ(e){return(0,R._Sr)(e)??[]}let t0=O.I4.div.withConfig({displayName:"DialogLayout",componentId:"sc-40rvp0-0"})`--offset-block:40px;
1display:grid;height:calc(100vh - var(--offset-block));min-height:0;overflow:hidden;grid-template-areas:'header header' 'previous-document next-document';grid-template-columns:1fr 1fr;grid-template-rows:min-content minmax(0,1fr);`;function t1(e){return e.document?.components?.unstable_layout}function t2(e){return e.path}function t3(e,t){return eo(e.path,t.path)}let t4=O.I4.div.withConfig({displayName:"Scroller",componentId:"sc-5g13hq-0"})`position:relative;height:100%;overflow:auto;scroll-behavior:smooth;scrollbar-width:var(--scrollbar-width);overscroll-behavior:contain;will-change:scroll-position;`,t5=(0,O.I4)(E.W).withConfig({displayName:"DiffViewPaneLayout",componentId:"sc-qn9ba3-0"})`position:relative;grid-area:var(--grid-area);`,t6=(0,O.I4)(z.mc).withConfig({displayName:"Container",componentId:"sc-qn9ba3-1"})`width:auto;`;function t7(e){let t,n,i,r,l,o,a=(0,P.c)(36),{ref:s,role:c,documentType:u,documentId:p,scrollElement:m,syncChannel:h,compareDocument:f}=e,x=(0,d.useRef)(null),[g,b]=(0,d.useState)(null),[y,j]=(0,d.useState)(null),v;a[0]!==f||a[1]!==p||a[2]!==u||a[3]!==c||a[4]!==m||a[5]!==h?(v=()=>(0,A.jsx)(t8,{compareDocument:f,documentId:p,documentType:u,role:c,scrollElement:m,syncChannel:h}),a[0]=f,a[1]=p,a[2]=u,a[3]=c,a[4]=m,a[5]=h,a[6]=v):v=a[6];let _=v,I;a[7]===_?I=a[8]:(I={pick:t1,defaultComponent:_},a[7]=_,a[8]=I);let w=(0,R.A1m)(I),S;a[9]===Symbol.for("react.memo_cache_sentinel")?(S={isInteractive:!1,onOpenReviewChanges:el.A,onSetFocus:el.A,isReviewChangesOpen:!1},a[9]=S):S=a[9];let C=`${c}-document`,k;a[10]===C?k=a[11]:(k={"--grid-area":C},a[10]=C,a[11]=k);let T="next"===c,D="next"!==c&&"none",O;a[12]===D?O=a[13]:(O={"--scrollbar-width":D},a[12]=D,a[13]=O);let N=O,L;return a[14]!==w||a[15]!==p||a[16]!==u?(L=(0,A.jsx)(z.Co,{position:"absolute",children:(0,A.jsx)(t6,{ref:x,padding:4,width:1,children:(0,A.jsx)(w,{documentId:p,documentType:u})})}),a[14]=w,a[15]=p,a[16]=u,a[17]=L):L=a[17],a[18]!==g||a[19]!==L?(t=(0,A.jsx)(E.t,{element:g,children:L}),a[18]=g,a[19]=L,a[20]=t):t=a[20],a[21]!==s||a[22]!==N||a[23]!==t?(n=(0,A.jsx)(t4,{ref:s,style:N,children:t}),a[21]=s,a[22]=N,a[23]=t,a[24]=n):n=a[24],a[25]===Symbol.for("react.memo_cache_sentinel")?(i=(0,A.jsx)("div",{"data-testid":"diffView-document-panel-portal",ref:b}),a[25]=i):i=a[25],a[26]!==n||a[27]!==k||a[28]!==T?(r=(0,A.jsxs)(t5,{ref:j,style:k,borderLeft:T,children:[n,i]}),a[26]=n,a[27]=k,a[28]=T,a[29]=r):r=a[29],a[30]!==y||a[31]!==r?(l=(0,A.jsx)(z.EZ,{element:y,children:r}),a[30]=y,a[31]=r,a[32]=l):l=a[32],a[33]!==m||a[34]!==l?(o=(0,A.jsx)(B.HJ.Provider,{value:S,children:(0,A.jsx)(R.tmD,{children:(0,A.jsx)(R.jsZ,{scrollElement:m,containerElement:x,children:l})})}),a[33]=m,a[34]=l,a[35]=o):o=a[35],o}let t8=e=>{var t,n;let i,r,l,o,a,s=(0,P.c)(52),{role:c,documentType:u,documentId:p,syncChannel:m,compareDocument:h}=e,f;s[0]===h?f=s[1]:(f={compareDocument:h},s[0]=h,s[1]=f);let x=function(e){let t=(0,P.c)(4),{compareDocument:n}=e,i;t[0]===n.id?i=t[1]:(i=(0,R.IMx)(n.id),t[0]=n.id,t[1]=i);let r=n.type,l;t[2]===n.id?l=t[3]:(l=(0,R._Sr)(n.id),t[2]=n.id,t[3]=l);let o=(0,R.zX2)(i,r,"low",l),a;e:{if((0,R.A_X)(n.id)){a=o.version??void 0;break e}if((0,R.R8D)(n.id)){a=o.draft??void 0;break e}if((0,R._4P)(n.id)){a=o.published??void 0;break e}a=void 0}return a}(f),{data:j}=(0,R.K0D)(),[v]=(0,d.useState)(t9),_;s[2]!==p||s[3]!==j?(_=tU(p,j),s[2]=p,s[3]=j,s[4]=_):_=s[4];let I=_,w;s[5]===p?w=s[6]:(w=(0,R.IMx)(p),s[5]=p,s[6]=w),s[7]===p?i=s[8]:(t=p,i=(0,R.A_X)(t)?(0,R._Sr)(t):(0,R._4P)(t)?"published":void 0,s[7]=p,s[8]=i),s[9]===p?r=s[10]:(r=(0,R._Sr)(p),s[9]=p,s[10]=r),s[11]!==x||s[12]!==u||s[13]!==w||s[14]!==i||s[15]!==r?(l={documentId:w,documentType:u,selectedPerspectiveName:i,releaseId:r,comparisonValue:x,displayInlineChanges:!0},s[11]=x,s[12]=u,s[13]=w,s[14]=i,s[15]=r,s[16]=l):l=s[16];let{formState:S,onChange:C,onFocus:k,onBlur:T,onSetActiveFieldGroup:D,onSetCollapsedFieldSet:E,onSetCollapsedPath:z,collapsedFieldSets:O,ready:N,collapsedPaths:L,schemaType:$,value:M,onProgrammaticFocus:H,openPath:V,onPathOpen:W}=(0,R.Lay)(l),K=null===S||!N,F;s[17]!==c||s[18]!==m?(F={id:c,syncChannel:m},s[17]=c,s[18]=m,s[19]=F):F=s[19];let J=function(e){let t=(0,P.c)(11),{syncChannel:n,id:i}=e,r;t[0]!==i||t[1]!==n?(r=e=>n.next({...e,source:i}),t[0]=i,t[1]=n,t[2]=r):r=t[2];let l=r,o;if(t[3]!==i||t[4]!==n){let e;t[6]===i?e=t[7]:(e=e=>{let{source:t}=e;return t!==i},t[6]=i,t[7]=e),o=n.pipe((0,g.F)(t3),(0,b.p)(e),(0,y.T)(t2)),t[3]=i,t[4]=n,t[5]=o}else o=t[5];let a=o,s;return t[8]!==a||t[9]!==l?(s={path:a,push:l},t[8]=a,t[9]=l,t[10]=s):s=t[10],s}(F),U;s[20]!==W||s[21]!==J||s[22]!==c?(U=e=>{W(e),J.push({source:c,path:e})},s[20]=W,s[21]=J,s[22]=c,s[23]=U):U=s[23];let Y=U,Q;return s[24]!==W||s[25]!==H||s[26]!==J.path?(Q=()=>{let e=J.path.subscribe(e=>{W(e),H(e)});return()=>e.unsubscribe()},s[24]=W,s[25]=H,s[26]=J.path,s[27]=Q):Q=s[27],s[28]!==W||s[29]!==H||s[30]!==J.path||s[31]!==c?(o=[W,H,J.path,c],s[28]=W,s[29]=H,s[30]=J.path,s[31]=c,s[32]=o):o=s[32],(0,d.useEffect)(Q,o),s[33]!==O||s[34]!==L||s[35]!==x||s[36]!==S||s[37]!==K||s[38]!==T||s[39]!==C||s[40]!==k||s[41]!==Y||s[42]!==D||s[43]!==E||s[44]!==z||s[45]!==V||s[46]!==v||s[47]!==I||s[48]!==c||s[49]!==$||s[50]!==M?(a=K?(0,A.jsx)(R.gd4,{showText:!0}):(0,A.jsx)(B.pn.Provider,{value:{enabled:!1,mode:null},children:(0,A.jsx)(R.okx,{__internal_patchChannel:v,id:`diffView-pane-${c}
1`,onChange:C,onPathFocus:k,onPathOpen:Y,onPathBlur:T,onFieldGroupSelect:D,onSetFieldSetCollapsed:E,onSetPathCollapsed:z,collapsedPaths:L,collapsedFieldSets:O,focusPath:S.focusPath,openPath:V,changed:S.changed,focused:S.focused,groups:S.groups,validation:S.validation,members:S.members,perspective:"draft"===(n=I)?"drafts":n,hasUpstreamVersion:S.hasUpstreamVersion,presence:S.presence,schemaType:$,value:M,compareValue:x})}),s[33]=O,s[34]=L,s[35]=x,s[36]=S,s[37]=K,s[38]=T,s[39]=C,s[40]=k,s[41]=Y,s[42]=D,s[43]=E,s[44]=z,s[45]=V,s[46]=v,s[47]=I,s[48]=c,s[49]=$,s[50]=M,s[51]=a):a=s[51],a};function t9(){return(0,R.Ijd)()}let ne=O.I4.a.withConfig({displayName:"Link",componentId:"sc-zyj49r-0"})`flex:1;text-decoration:none;color:inherit;`,nt=e=>{let t=(0,P.c)(6),{children:n,documentId:i,documentType:r}=e,l;t[0]!==i||t[1]!==r?(l={intent:"edit",params:{id:i,type:r}},t[0]=i,t[1]=r,t[2]=l):l=t[2];let{href:o}=(0,ee.cQ)(l),a;return t[3]!==n||t[4]!==o?(a=(0,A.jsx)(ne,{href:o,target:"_blank",rel:"noopener noreferrer",children:n}),t[3]=n,t[4]=o,t[5]=a):a=t[5],a},nn=e=>{var t;let n,i,r,o,a,s,c,u,p,m,h=(0,P.c)(24),{documentId:f}=e,{documents:g,state:b,mode:y}=tW(),{exitDiffView:j}=tM(),v=((n=(0,P.c)(1))[0]===Symbol.for("react.memo_cache_sentinel")?(i=new x.B,n[0]=i):i=n[0],i),[_,I]=(0,d.useState)(null),[w,S]=(0,d.useState)(null),C=(0,d.useContext)(B.DA),k;h[0]===C?k=h[1]:(k={...C,disableNew:!0,EditReferenceLinkComponent:nt},h[0]=C,h[1]=k);let T=k,D;return h[2]!==w||h[3]!==_?(D=[_,w],h[2]=w,h[3]=_,h[4]=D):D=h[4],t=D,(r=(0,P.c)(3))[0]===t?(o=r[1],a=r[2]):(o=()=>{let e=t.filter(tJ);if(0===e.length)return;let n=new en.Ay(e);return()=>n.destroy()},a=[t],r[0]=t,r[1]=o,r[2]=a),(0,d.useEffect)(o,a),h[5]!==f||h[6]!==y||h[7]!==b?(s="version"===y&&(0,A.jsx)(tq,{documentId:f,state:b}),h[5]=f,h[6]=y,h[7]=b,h[8]=s):s=h[8],h[9]!==g||h[10]!==w||h[11]!==_||h[12]!==b||h[13]!==v?(c="ready"===b&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(t7,{documentType:g.previous.type,documentId:g.previous.id,role:"previous",ref:I,scrollElement:_,syncChannel:v,compareDocument:g.previous}),(0,A.jsx)(t7,{documentType:g.next.type,documentId:g.next.id,role:"next",ref:S,scrollElement:w,syncChannel:v,compareDocument:g.previous})]}),h[9]=g,h[10]=w,h[11]=_,h[12]=b,h[13]=v,h[14]=c):c=h[14],h[15]!==s||h[16]!==c?(u=(0,A.jsxs)(t0,{children:[s,c]}),h[15]=s,h[16]=c,h[17]=u):u=h[17],h[18]!==j||h[19]!==u?(p=(0,A.jsx)(l.i,{id:"diffView",width:"auto",onClose:j,padding:!1,__unstable_hideCloseButton:!0,children:u}),h[18]=j,h[19]=u,h[20]=p):p=h[20],h[21]!==T||h[22]!==p?(m=(0,A.jsx)(B.DA.Provider,{value:T,children:p}),h[21]=T,h[22]=p,h[23]=m):m=h[23],m},ni=e=>{let t,n,i,l,o=(0,P.c)(16),{children:a,documentId:s}=e,d=(0,z.dj)(),{t:c}=(0,R.Bdt)(r.I),{log:u}=(0,q.Jr)(),p;o[0]!==c||o[1]!==d?(p=e=>{d.push({id:"diffViewParamsParsingError",status:"error",title:c("compare-version.error.invalidParams.title"),description:(0,A.jsx)("ul",{children:e.map(e=>{let[t,n]=e;return(0,A.jsx)("li",{children:c(`compare-version.error.${t}`,{input:n})},t)})})})},o[0]=c,o[1]=d,o[2]=p):p=o[2],o[3]===u?(t=o[4],n=o[5]):(t=(e,t)=>
1{"entered"===tF(e,t)?u(tR,{documentVariantTypes:nr([t.documents?.previous.id,t.documents?.next.id])}):"exited"===tF(e,t)&&void 0!==e&&u(tB,{documentVariantTypes:nr([e.documents?.previous.id,e.documents?.next.id])})},n=(e,t)=>{void 0!==e&&u(tO,{previousDocumentVariantTypes:nr([e.documents?.previous.id,e.documents?.next.id]),documentVariantTypes:nr([t.documents?.previous.id,t.documents?.next.id])})},o[3]=u,o[4]=t,o[5]=n),o[6]!==p||o[7]!==t||o[8]!==n?(i={onParamsError:p,onActiveChanged:t,onTargetDocumentsChanged:n},o[6]=p,o[7]=t,o[8]=n,o[9]=i):i=o[9];let{isActive:m}=tW(i),h;return o[10]!==s||o[11]!==m?(h=m&&(0,A.jsx)(nn,{documentId:s}),o[10]=s,o[11]=m,o[12]=h):h=o[12],o[13]!==a||o[14]!==h?(l=(0,A.jsxs)(A.Fragment,{children:[a,h]}),o[13]=a,o[14]=h,o[15]=l):l=o[15],l};function nr(e){return e.filter(e=>"string"==typeof e).map(R.tfA)}function nl(e){let t,n,i=(0,P.c)(12),{children:r,currentMinWidth:l,flex:o,minWidth:d,paneKey:c,title:u,tone:p}=e,m=void 0===u?"Error":u,h=void 0===p?"critical":p,f;return i[0]===m?f=i[1]:(f=(0,A.jsx)(a.n,{title:m}),i[0]=m,i[1]=f),i[2]===r?t=i[3]:(t=(0,A.jsx)(s.i,{overflow:"auto",children:(0,A.jsx)(E.lt,{paddingX:4,paddingY:5,children:r})}),i[2]=r,i[3]=t),i[4]!==l||i[5]!==o||i[6]!==d||i[7]!==c||i[8]!==f||i[9]!==t||i[10]!==h?(n=(0,A.jsxs)(a.i,{currentMinWidth:l,flex:o,id:c,minWidth:d,tone:h,children:[f,t]}),i[4]=l,i[5]=o,i[6]=d,i[7]=c,i[8]=f,i[9]=t,i[10]=h,i[11]=n):n=i[11],n}function no(e){let t=[{ms:300,messageKey:"panes.resolving.default-message"},{ms:5e3,messageKey:"panes.resolving.slow-resolve-message"}];if(R.Cu5){let n=["Check console for errors?","Is your observable/promise resolving?",e.length>0?`Structure path: ${e.join(" ➝ ")}`:""];t.push({ms:1e4,message:n.join("\n")})}let n=(0,m.of)(null);return(0,j.h)(...t.map(e=>n.pipe((0,F.u)("messageKey"in e?{messageKey:e.messageKey}:{message:e.message}),(0,J.c)(e.ms))))}let na=(0,O.I4)(E.at).withConfig({displayName:"Content",componentId:"sc-9mj59n-0"})`opacity:0;transition:opacity 200ms;&[data-mounted]{opacity:1;}`,ns=(0,d.memo)(e=>{let t,n,i=(0,P.c)(33),{delay:l,flex:o,message:c,minWidth:u,paneKey:p,path:h,selected:f,title:x,tone:g}=e,b=void 0===l?300:l,j=void 0===c?no:c,{t:_}=(0,R.Bdt)(r.I),I;e:{if("function"==typeof j){let e;i[0]!==j||i[1]!==h?(e=j(h?h.split(";"):[]),i[0]=j,i[1]=h,i[2]=e):e=i[2],I=e;break e}I=j}let w=I,S;i[3]!==w||i[4]!==_?(S="string"==typeof w?w:_("panes.resolving.default-message"),i[3]=w,i[4]=_,i[5]=S):S=i[5];let C=S,k;t:{let e;if("string"==typeof w){let e;i[6]===w?e=i[7]:(e=(0,m.of)(w),i[6]=w,i[7]=e),k=e;break t}if(!(0,v.A)(w)){let e;i[8]===C?e=i[9]:(e=(0,m.of)(C),i[8]=C,i[9]=e),k=e;break t}if(i[10]!==w||i[11]!==_){let t;i[13]===_?t=i[14]:(t=e=>"messageKey"in e?_(e.messageKey):e.message,i[13]=_,i[14]=t),e=w.pipe((0,y.T)(t)),i[10]=w,i[11]=_,i[12]=e}else e=i[12];k=e}let T=(0,W.J2)(k,C),[D,E]=(0,d.useState)(null),[B,O]=(0,d.useState)(!1),N,L;i[15]===D?(N=i[16],L=i[17]):(N=()=>{if(D)return(0,z.X)(()=>O(!0))},L=[D],i[15]=D,i[16]=N,i[17]=L),(0,d.useEffect)(N,L);let $=B?"":void 0,M=x||T,H;i[18]===M?H=i[19]:(H=(0,A.jsx)(R.gd4,{showText:!0,title:M}),i[18]=M,i[19]=H),i[20]!==$||i[21]!==H?(t=(0,A.jsx)(na,{align:"center","data-mounted":$,direction:"column",height:"fill",justify:"center",ref:E,children:H}),i[20]=$,i[21]=H,i[22]=t):t=i[22];let V=t,K;return i[23]!==V||i[24]!==b?(K=(0,A.jsx)(s.i,{children:V}),i[23]=V,i[24]=b,i[25]=K):K=i[25],i[26]!==o||i[27]!==u||i[28]!==p||i[29]!==f||i[30]!==K||i[31]!==g?(n=(0,A.jsx)(a.i,{flex:o,id:p,minWidth:u,selected:f,tone:g,children:K}),i[26]=o,i[27]=u,i[28]=p,i[29]=f,i[30]=K,i[31]=g,i[32]=n):n=i[32],n});function nd(e){let t,n=(0,P.c)(8),{children:i,documentId:r,documentType:l}=e,o;return n[0]!==i||n[1]!==r||n[2]!==l?(o=(0,A.jsx)(nc,{documentId:r,documentType:l,children:i}),n[0]=i,n[1]=r,n[2]=l,n[3]=o):o=n[3],n[4]!==r||n[5]!==l||n[6]!==o?(t=(0,A.jsx)(R.ByQ,{documentId:r,documentType:l,children:o}),n[4]=r,n[5]=l,n[6]=o,n[7]=t):t=n[7],t}function nc(e){let t,n=(0,P.c)(31),{children:i,documentId:r,documentType:l}=e,{enabled:o}=(0,R.Dsj)(),{connectionState:a,onPathOpen:s,inspector:c,openInspector:u,targetDocumentState:p}=e9(),{selectedReleaseId:m,selectedVariantName:h}=(0,R.QO2)(),{params:f,setParams:x}=tc(),{resolveIntentLink:g}=(0,ee.rd)(),b;n[0]===p?b=n[1]:(b=(0,R.LEK)(p),n[0]=p,n[1]=b);let y=b,j=f?.comment,v=f?.scheduledDraft,_=(0,d.useRef)(f),I,w;n[2]===f?(I=n[3],w=n[4]):(I=()=>{_.current=f},w=[f],n[2]=f,n[3]=I,n[4]=w),(0,d.useLayoutEffect)(I,w),n[5]!==r||n[
16]!==l||n[7]!==g||n[8]!==v||n[9]!==m||n[10]!==h?(t=e=>{let t=m&&!v?[["perspective",m]]:[];h&&t.push(["variant",h]);let n=g("edit",{id:r,type:l,inspect:R.nHq,comment:e,...v?{scheduledDraft:v}:{}},t);return`${window.location.origin}${n}`},n[5]=r,n[6]=l,n[7]=g,n[8]=v,n[9]=m,n[10]=h,n[11]=t):t=n[11];let S=t,C;n[12]===x?C=n[13]:(C=()=>{x({..._.current,comment:void 0})},n[12]=x,n[13]=C);let k=C,T;n[14]!==c?.name||n[15]!==u?(T=()=>{c?.name!==R.nHq&&u(R.nHq)},n[14]=c?.name,n[15]=u,n[16]=T):T=n[16],c?.name;let D=T;if(!o){let e;return n[17]===i?e=n[18]:(e=(0,A.jsx)(A.Fragment,{children:i}),n[17]=i,n[18]=e),e}let E=c?.name===R.nHq,z="connecting"===a,B;return n[19]!==i||n[20]!==r||n[21]!==l||n[22]!==S||n[23]!==k||n[24]!==D||n[25]!==s||n[26]!==y||n[27]!==j||n[28]!==E||n[29]!==z?(B=(0,A.jsx)(R.ixz,{documentId:r,documentType:l,getCommentLink:S,isCommentsOpen:E,isConnecting:z,onClearSelectedComment:k,onCommentsOpen:D,onPathOpen:s,selectedCommentId:j,sortOrder:"desc",type:"field",releaseId:y,children:i}),n[19]=i,n[20]=r,n[21]=l,n[22]=S,n[23]=k,n[24]=D,n[25]=s,n[26]=y,n[27]=j,n[28]=E,n[29]=z,n[30]=B):B=n[30],B}function nu(e){let t,n,i,r=(0,P.c)(20),{children:l}=e,{data:o}=(0,R.K0D)(),{actions:a,editState:s,isInitialValueLoading:c,revisionId:u}=e9(),p=(0,d.useRef)(null),m;if(r[0]!==o||r[1]!==s?.release){let e;r[3]===s?.release?e=r[4]:(e=e=>e===s?.release,r[3]=s?.release,r[4]=e),m=o.map(np).find(e),r[0]=o,r[1]=s?.release,r[2]=m}else m=r[2];let h=m,f;r[5]!==s||r[6]!==c||r[7]!==h||r[8]!==u?(f=s?{...s,release:h,revision:u||void 0,initialValueResolved:!c}:null,r[5]=s,r[6]=c,r[7]=h,r[8]=u,r[9]=f):f=r[9];let x=f;if(!x)return null;r[10]===Symbol.for("react.memo_cache_sentinel")?(t=()=>p.current?.(),r[10]=t):t=r[10],r[11]===x?n=r[12]:(n={...x,onComplete:t},r[11]=x,r[12]=n);let g=a||R.Mlv,b;return r[13]!==x||r[14]!==l?(b=e=>{let{states:t}=e;return(0,A.jsx)(nh,{states:t,actionProps:x,children:l})},r[13]=x,r[14]=l,r[15]=b):b=r[15],r[16]!==n||r[17]!==g||r[18]!==b?(i=(0,A.jsx)(R.N6R,{args:n,hooks:g,resetRef:p,children:b}),r[16]=n,r[17]=g,r[18]=b,r[19]=i):i=r[19],i}function np(e){return(0,R._hI)(e._id)}ns.displayName="Memo(LoadingPane)";let nm=["delete","duplicate","publish","unpublish","unlinkFromCanvas","editInCanvas","linkToCanvas","schedule","discardVersion","unpublishVersion"];function nh(e){let t,n=(0,P.c)(9),{states:i,children:l,actionProps:o}=e,{t:a}=(0,R.Bdt)(r.I),s;n[0]===o?s=n[1]:(s=(0,R.aJr)(o),n[0]=o,n[1]=s);let{isLockedByCanvas:d}=(0,R.G2c)(s),c;return n[2]!==d||n[3]!==i||n[4]!==a?(c=d?i.map(e=>e.action&&nm.includes(e.action)?e:{...e,disabled:!0,title:a("action.disabled-by-canvas.tooltip")}):i,n[2]=d,n[3]=i,n[4]=a,n[5]=c):c=n[5],n[6]!==l||n[7]!==c?(t=(0,A.jsx)(B.Pq.Provider,{value:c,children:l}),n[6]=l,n[7]=c,n[8]=t):t=n[8],t}let nf={},nx=[{id:"inspectors"},{id:"links"}],ng="sanity/structure/history";function nb(e){let t,n,i,r=(0,P.c)(22),{documentId:l,documentType:o,inspectors:a,onMenuItems:s}=e,c=a.length,u;r[0]===c?u=r[1]:(u=()=>Array.from(Array(c)),r[0]=c,r[1]=u);let[p,m]=(0,d.useState)(u),h,f;r[2]!==c||r[3]!==p?(h=()=>{if(p.length!==c){let e=Array.from(Array(c));for(let t=0;t<c;t++)e[t]=p[t];m(e)}},f=[c,p],r[2]=c,r[3]=p,r[4]=h,r[5]=f):(h=r[4],f=r[5]),(0,d.useEffect)(h,f),r[6]===Symbol.for("react.memo_cache_sentinel")?(t=(e,t)=>{m(n=>{let i=[...n];return i[e]=t,i})},r[6]=t):t=r[6];let x=t,g,b;if(r[7]!==p||r[8]!==s?(g=()=>{s(p.filter(Boolean))},b=[p,s],r[7]=p,r[8]=s,r[9]=g,r[10]=b):(g=r[9],b=r[10]),(0,d.useEffect)(g,b),r[11]!==l||r[12]!==o||r[13]!==a){let e;r[15]!==l||r[16]!==o?(e=(e,t)=>e.useMenuItem?[function({documentId:e,documentType:t,index:n,setMenuItem:i,useMenuItem:r}){return(0,d.memo)(function(){let l=(0,P.c)(4),o;l[0]===Symbol.for("react.memo_cache_sentinel")?(o={documentId:e,documentType:t},l[0]=o):o=l[0];let a=(0,R.$6H)(r(o)),s,c;return l[1]===a?(s=l[2],c=l[3]):(s=()=>{i(n,a)},c=[a],l[1]=a,l[2]=s,l[3]=c),(0,d.useEffect)(s,c),null})}({documentId:l,documentType:o,index:t,setMenuItem:x,useMenuItem:e.useMenuItem}),e.name]:[nj,""],r[15]=l,r[16]=o,r[17]=e):e=r[17],n=a.map(e),r[11]=l,r[12]=o,r[13]=a,r[14]=n}else n=r[14];let y=n,j;return r[18]===y?j=r[19]:(j=y.map(ny),r[18]=y,r[19]=j),r[20]===j?i=r[21]:(i=(0,A.jsx)(A.Fragment,{children:j}),r[20]=j,r[21]=i),i}function ny(e){let[t,n]=e;return n&&(0,A.jsx)(t,{},n)}function nj(){return null}function nv(){let e=(0,d.useContext)(B.lQ);if(!e)throw Error("DocumentPane: missing info context value");return e}nb.displayName="DocumentInspectorMenuItemsResolver";let n_=["patch","commit"],nI=(0,d.memo)(function(){let e=(0,P.c)(13),{push:t}=(0,z.dj)(),{value:n}=e9(),{documentId:i,documentType:l}=nv(),o=te(),a=o.error,s=(0,R.cUp)(i,l),c=(0,d.useRef)(s),u=tc(),{t:p}=(0,R.Bdt)(r.I),{handleOpenDialog:m}=(0,R.pDY)(),h;e:{if(!o.title&&!a&&s&&!n_.includes(s.op)&&"string"==typeof n.title&&s?.type==="success"){h=n.title;break e}h=o.title}let f=h,x;e[0]!==p||e[1]!==f?(x=f||p("panes.document-operation-results.operation-undefined-title"),e[0]=p,e[1]=f,e[2]=x):x=e[2];let g=x,b;e[3]===g?b=e[4]:(b=g.length>25?`${g.slice(0,25)}...`:g,e[3]=g,e[4]=b);let y=b,j,v;return e[5]!==y||e[6]!==s||e[7]!==m||e[8]!==u||e[9]!==t||e[10]!==p?(j=()=>{let e;if(s&&s!==c.current){if("error"===s.type){if((0,R.rML)(s.error))return void m("document_action");t({closable:!0,duration:3e4,status:"error",title:p("panes.document-operation-results.operation-error",{context:s.op}),description:(0,A.jsxs)("details",{children:[(0,A.jsx)("summary",{children:p("panes.document-operation-results.error.summary.title")}),s.error.message]})})}return"success"!==s.type||n_.includes(s.op)||t({closable:!0,status:"success",title:(0,A.jsx)(R.HTc,{context:"publish"===s.op&&s.idPair.versionId?"publishVersion":s.op,i18nKey:"panes.document-operation-results.operation-success",t:p,values:{op:s.op,title:y},components:{Strong:"strong"}})}),"success"===s.type&&"delete"===s.op&&(e=setTimeout(()=>u.closeCurrentAndAfter(),0)),c.current=s,()=>clearTimeout(e)}},v=[s,u,t,p,y,m],e[5]=y,e[6]=s,e[7]=m,e[8]=u,e[9]=t,e[10]=p,e[11]=j,e[12]=v):(j=e[11],v=e[12]),(0,d.useEffect)(j,v),null});function nw(e){let t,n=(0,P.c)(32),{children:i,onClose:l}=e,{t:a}=(0,R.Bdt)(r.I),[s,c]=(0,d.useState)(null),u;n[0]===Symbol.for("react.memo_cache_sentinel")?(u=e=>{let{error:t}=e;c(t)},n[0]=u):u=n[0];let p=u,m;n[1]===Symbol.for("react.memo_cache_sentinel")?(m=()=>c(null),n[1]=m):m=n[1];let h=m;if(s){let e,t,i,r,d,c,u,p,m,f,x,g;return n[2]===a?e=n[3]:(e=a("document-inspector.error.close-button.aria-label"),n[2]=a,n[3]=e),n[4]===a?t=n[5]:(t=a("document-inspector.error.title"),n[4]=a,n[5]=t),n[6]!==l||n[7]!==e||n[8]!==t?(i=(0,A.jsx)(tz,{as:"header",closeButtonLabel:e,flex:"none",onClose:l,title:t}),n[6]=l,n[7]=e,n[8]=t,n[9]=i):i=n[9],n[10]===Symbol.for("react.memo_cache_sentinel")?(r=(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(ed.ErrorOutlineIcon,{})}),n[10]=r):r=n[10],n[11]===a?d=n[12]:(d=a("document-inspector.error.description"),n[11]=a,n[12]=d),n[13]===d?c=n[14]:(c=(0,A.jsx)(E.et,{size:1,children:d}),n[13]=d,n[14]=c),n[15]===s.message?u=n[16]:(u=(0,A.jsx)(E.et,{muted:!0,size:1,children:s.message}),n[15]=s.message,n[16]=u),n[17]!==c||n[18]!==u?(p=(0,A.jsx)(E.W,{padding:3,radius:2,tone:"critical",children:(0,A.jsxs)(E.at,{gap:3,children:[r,(0,A.jsxs)(E.O,{flex:1,gap:3,children:[c,u]})]})}),n[17]=c,n[18]=u,n[19]=p):p=n[19],n[20]===a?m=n[21]:(m=a("document-inspector.error.retry-button.text"),n[20]=a,n[21]=m),n[22]===m?f=n[23]:(f=(0,A.jsx)(E.lt,{children:(0,A.jsx)(o.a,{icon:ec.SyncIcon,mode:"ghost",onClick:h,text:m})}),n[22]=m,n[23]=f),n[24]!==f||n[25]!==p?(x=(0,A.jsx)(E.W,{flex:1,overflow:"auto",padding:3,children:(0,A.jsxs)(E.O,{gap:3,children:[p,f]})}),n[24]=f,n[25]=p,n[26]=x):x=n[26],n[27]!==x||n[28]!==i?(g=(0,A.jsxs)(E.at,{direction:"column",height:"fill",overflow:"hidden",children:[i,x]}),n[27]=x,n[28]=i,n[29]=g):g=n[29],g}return n[30]===i?t=n[31]:(t=(0,A.jsx)(o.c,{onCatch:p,children:i}),n[30]=i,n[31]=t),t}function nS(e){let t,n,i=(0,P.c)(18),{documentId:r,documentType:l,flex:o}=e,{collapsed:s}=(0,a.r)(),{closeInspector:c,inspector:u}=e9(),{features:p}=(0,a.t)(),m;i[0]!==c||i[1]!==u?(m=()=>{u&&c(u.name)},i[0]=c,i[1]=u,i[2]=m):m=i[2];let h=m;if(s||!u)return null;let f=u.component,x;i[3]!==f||i[4]!==r||i[5]!==l||i[6]!==h?(x=(0,A.jsx)(d.Suspense,{fallback:null,children:(0,A.jsx)(f,{onClose:h,documentId:r,documentType:l})}),i[3]=f,i[4]=r,i[5]=l,i[6]=h,i[7]=x):x=i[7],i[8]!==h||i[9]!==u.name||i[10]!==x?(t=(0,A.jsx)(nw,{onClose:h,children:x},u.name),i[8]=h,i[9]=u.name,i[10]=x,i[11]=t):t=i[11];let g=t;if(p.resizablePanes){let e;return i[12]!==g||i[13]!==o?(e=(0,A.jsx)(R.cMO,{as:"aside","data-ui":"DocumentInspectorPanel",flex:o,resizerPosition:"left",maxWidth:540,minWidth:320,children:g}),i[12]=g,i[13]=o,i[14]=e):e=i[14],e}return i[15]!==g||i[16]!==o?(n=(0,A.jsx)(E.lt,{as:"aside","data-ui":"DocumentInspectorPanel",flex:o,children:g}),i[15]=g,i[16]=o,i[17]=n):n=i[17],n}function nC(e,t,n){let i=(0,P.c)(16),r=(0,R.P$5)(),l;
1i[0]!==t||i[1]!==e?(l=["studio.structure-tool",e,t].filter(Boolean),i[0]=t,i[1]=e,i[2]=l):l=i[2];let o=l.join("."),a;if(i[3]!==n||i[4]!==r||i[5]!==o){let e;i[7]===n?e=i[8]:(e=e=>null===e||""===e?n:e,i[7]=n,i[8]=e),a=r.getKey(o).pipe((0,y.T)(e)),i[3]=n,i[4]=r,i[5]=o,i[6]=a}else a=i[6];let s=a,d=(0,W.ut)(s,n),c=(0,W.J2)(s,n),u;i[9]!==r||i[10]!==o||i[11]!==d?(u=async e=>{e!==d&&await r.setKey(o,e)},i[9]=r,i[10]=o,i[11]=d,i[12]=u):u=i[12];let p=u,m;return i[13]!==p||i[14]!==c?(m=[c,p],i[13]=p,i[14]=c,i[15]=m):m=i[15],m}let nk={id:"parsed",title:"document-inspector.view-mode.parsed"},nT={id:"raw",title:"document-inspector.view-mode.raw-json"},nD=[nk,nT],nP=new ep.A({maxSize:1e3});function nA(e){let{path:t}=e,n=nP.get(t);void 0!==n&&nP.set(t,!n)}function nE(e){let t=window.getSelection();if(t){let n=document.createRange();t.removeAllRanges(),n.selectNodeContents(e),t.addRange(n)}}function nz(e){nE(e.target)}function nR(e){65===e.keyCode&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),nE(e.currentTarget))}let nB=O.I4.div.withConfig({displayName:"JSONInspectorWrapper",componentId:"sc-pdik0d-0"})(({theme:e})=>{let{color:t,fonts:n,space:i}=e.sanity;return(0,O.AH)`& .json-inspector,& .json-inspector .json-inspector__selection{font-family:${n.code.family};font-size:${n.code.sizes[1].fontSize}px;line-height:${n.code.sizes[1].lineHeight}px;color:var(--card-code-fg-color);}& .json-inspector .json-inspector__leaf{padding-left:${(0,E.ht)(i[4])};}& .json-inspector .json-inspector__leaf.json-inspector__leaf_root{padding-top:${(0,E.ht)(i[3])};padding-left:0;}& .json-inspector > .json-inspector__leaf_root > .json-inspector__line > .json-inspector__key{display:none;}& .json-inspector .json-inspector__line{display:block;position:relative;cursor:default;}& .json-inspector .json-inspector__line::after{content:'';position:absolute;top:0;left:-200px;right:-50px;bottom:0;z-index:-1;pointer-events:none;}& .json-inspector .json-inspector__line:hover::after{background:var(--card-code-bg-color);}& .json-inspector .json-inspector__leaf_composite > .json-inspector__line{cursor:pointer;}& .json-inspector .json-inspector__leaf_composite > .json-inspector__line::before{content:'▸ ';margin-left:calc(0 - ${(0,E.ht)(i[4])} + 3px);font-size:${n.code.sizes[1].fontSize}px;line-height:${n.code.sizes[1].lineHeight}px;}& .json-inspector .json-inspector__leaf_expanded.json-inspector__leaf_composite > .json-inspector__line::before{content:'▾ ';font-size:${n.code.sizes[1].fontSize}px;line-height:${n.code.sizes[1].lineHeight}px;}& .json-inspector .json-inspector__radio,& .json-inspector .json-inspector__flatpath{display:none;}& .json-inspector .json-inspector__value{margin-left:${(0,E.ht)(i[4]/2)};}& .json-inspector > .json-inspector__leaf_root > .json-inspector__line > .json-inspector__key + .json-inspector__value{margin:0;}& .json-inspector .json-inspector__key{color:${t.syntax.property};}& .json-inspector .json-inspector__value_helper,& .json-inspector .json-inspector__value_null{color:${t.syntax.constant};}& .json-inspector .json-inspector__not-found{padding-top:${(0,E.ht)(i[3])};}& .json-inspector .json-inspector__value_string{color:${t.syntax.string};}& .json-inspector .json-inspector__value_boolean{color:${t.syntax.boolean};}& .json-inspector .json-inspector__value_number{color:${t.syntax.number};}& .json-inspector .json-inspector__show-original{display:inline-block;padding:0 6px;cursor:pointer;}& .json-inspector .json-inspector__show-original:hover{color:inherit;}& .json-inspector .json-inspector__show-original::before{content:'↔';}& .json-inspector .json-inspector__show-original:hover::after{content:' expand';}`});function nO(e){let t=(0,P.c)(8),{onChange:n,query:i}=e,l;t[0]===n?l=t[1]:(l=e=>n(e.target.value),t[0]=n,t[1]=l);let o=l,{t:a}=(0,R.Bdt)(r.I),s;t[2]===a?s=t[3]:(s=a("document-inspector.search.placeholder"),t[2]=a,t[3]=s);let d=i||"",c;return t[4]!==o||t[5]!==s||t[6]!==d?(c=(0,A.jsx)(E.b,{icon:em.SearchIcon,onChange:o,placeholder:s,radius:2,value:d}),t[4]=o,t[5]=s,t[6]=d,t[7]=c):c=t[7],c}function nN(e){let t,n,i,a,s,d,c,u=(0,P.c)(49),{value:p}=e,{onInspectClose:m,paneKey:h}=e9(),f=`${h}_inspect_`,[x,g]=nC("inspect-view-mode",null,"parsed"),b;u[0]===x?b=u[1]:(b=nD.find(e=>e.id===x),u[0]=x,u[1]=b);let y=b,j;u[2]===g?j=u[3]:(j=async()=>{await g(nk.id)},u[2]=g,u[3]=j);let v=j,_;u[4]===g?_=u[5]:(_=async()=>{await g(nT.id)},u[4]=g,u[5]=_);let I=_,{t:w}=(0,R.Bdt)(r.I),S=`${f}dialog`,C;
1u[6]!==w||u[7]!==p?(C=(0,R.u4i)(p)&&(0,R.KgX)(p._id)&&(0,R.KgX)(p._type)?(0,A.jsx)(R.HTc,{t:w,i18nKey:"document-inspector.dialog.title",components:{DocumentTitle:()=>(0,A.jsx)("em",{children:(0,A.jsx)(tt,{document:p})})}}):(0,A.jsx)("em",{children:w("document-inspector.dialog.title-no-value")}),u[6]=w,u[7]=p,u[8]=C):C=u[8],u[9]===Symbol.for("react.memo_cache_sentinel")?(t={position:"sticky",bottom:0,zIndex:3},u[9]=t):t=u[9];let k=`${f}tabpanel`,T=`${f}tab-${nk.id}`,D;u[10]===w?D=u[11]:(D=w(nk.title),u[10]=w,u[11]=D);let B=y===nk,O;u[12]!==v||u[13]!==k||u[14]!==T||u[15]!==D||u[16]!==B?(O=(0,A.jsx)(o.n,{"aria-controls":k,id:T,label:D,onClick:v,selected:B}),u[12]=v,u[13]=k,u[14]=T,u[15]=D,u[16]=B,u[17]=O):O=u[17];let N=`${f}tabpanel`,L=`${f}tab-${nT.id}`,$;u[18]===w?$=u[19]:($=w(nT.title),u[18]=w,u[19]=$);let M=y===nT,H;u[20]!==I||u[21]!==N||u[22]!==L||u[23]!==$||u[24]!==M?(H=(0,A.jsx)(o.n,{"aria-controls":N,id:L,label:$,onClick:I,selected:M}),u[20]=I,u[21]=N,u[22]=L,u[23]=$,u[24]=M,u[25]=H):H=u[25],u[26]!==O||u[27]!==H?(n=(0,A.jsx)(E.W,{padding:3,paddingTop:0,shadow:1,style:t,children:(0,A.jsxs)(E.c,{gap:1,children:[O,H]})}),u[26]=O,u[27]=H,u[28]=n):n=u[28];let V=`${f}tab-${x}`,W=`${f}tabpanel`,K;return u[29]===Symbol.for("react.memo_cache_sentinel")?(K={outline:"none"},u[29]=K):K=u[29],u[30]!==p||u[31]!==y?(i=y===nk&&(0,A.jsx)(nB,{children:(0,A.jsx)(eu.A,{data:p,isExpanded:function e(t,n){let i=nP.get(t);return void 0===i?(nP.set(t,Array.isArray(n)||(0,R.u4i)(n)),e(t,n)):i},onClick:nA,search:nO,filterOptions:{ignoreCase:!0}})}),u[30]=p,u[31]=y,u[32]=i):i=u[32],u[33]!==p||u[34]!==y?(a=y===nT&&(0,A.jsx)(z.Cy,{language:"json",tabIndex:0,onKeyDown:nR,onDoubleClick:nz,size:1,children:JSON.stringify(p,null,2)}),u[33]=p,u[34]=y,u[35]=a):a=u[35],u[36]!==V||u[37]!==W||u[38]!==i||u[39]!==a?(s=(0,A.jsxs)(z.Kp,{"aria-labelledby":V,flex:1,id:W,overflow:"auto",padding:4,style:K,children:[i,a]}),u[36]=V,u[37]=W,u[38]=i,u[39]=a,u[40]=s):s=u[40],u[41]!==n||u[42]!==s?(d=(0,A.jsxs)(E.at,{direction:"column",height:"fill",children:[n,s]}),u[41]=n,u[42]=s,u[43]=d):d=u[43],u[44]!==m||u[45]!==d||u[46]!==S||u[47]!==C?(c=(0,A.jsx)(l.i,{bodyHeight:"fill",id:S,header:C,onClose:m,onClickOutside:m,padding:!1,width:2,children:d}),u[44]=m,u[45]=d,u[46]=S,u[47]=C,u[48]=c):c=u[48],c}function nL(e){let t,n,i,r,l=(0,P.c)(22),a,s,d,c,u,p;l[0]===e?(a=l[1],s=l[2],d=l[3],c=l[4],u=l[5],p=l[6]):({action:s,content:d,icon:a,tone:u,paddingY:p,...c}=e,l[0]=e,l[1]=a,l[2]=s,l[3]=d,l[4]=c,l[5]=u,l[6]=p);let m=void 0===u?"transparent":u,h=void 0===p?2:p,f;return l[7]===a?f=l[8]:(f=a&&(0,A.jsx)(E.et,{size:0,children:(0,A.jsx)(a,{})}),l[7]=a,l[8]=f),l[9]===d?t=l[10]:(t=(0,A.jsx)(E.at,{align:"center",flex:1,gap:2,paddingY:2,children:d}),l[9]=d,l[10]=t),l[11]===s?n=l[12]:(n=s&&(0,A.jsx)(o.a,{...s,mode:s.mode||"ghost",tone:s.tone||"default"}),l[11]=s,l[12]=n),l[13]!==f||l[14]!==t||l[15]!==n?(i=(0,A.jsxs)(E.at,{align:"center",gap:3,paddingX:2,children:[f,t,n]}),l[13]=f,l[14]=t,l[15]=n,l[16]=i):i=l[16],l[17]!==h||l[18]!==c||l[19]!==i||l[20]!==m?(r=(0,A.jsx)(E.lt,{padding:1,children:(0,A.jsx)(E.W,{radius:3,paddingX:2,paddingY:h,tone:m,...c,children:i})}),l[17]=h,l[18]=c,l[19]=i,l[20]=m,l[21]=r):r=l[21],r}function n$(e){let t,n,i,l,o=(0,P.c)(26),a;o[0]===e?a=o[1]:(a=void 0===e?{}:e,o[0]=e,o[1]=a);let{releaseId:s}=a,{t:d}=(0,R.Bdt)(r.I),{t:c}=(0,R.Bdt)(),{data:u}=(0,R.gJZ)(),{params:p,setParams:m}=tc(),h=s??p?.historyVersion,f;o[2]!==p||o[3]!==m?(f=()=>{m({...p,rev:p?.historyEvent||void 0,since:void 0,historyVersion:void 0,scheduledDraft:void 0})},o[2]=p,o[3]=m,o[4]=f):f=o[4];let x=f,g;if(o[5]!==u||o[6]!==h){let e;o[8]===h?e=o[9]:(e=e=>(0,R._hI)(e._id)===h,o[8]=h,o[9]=e),g=u.find(e),o[5]=u,o[6]=h,o[7]=g}else g=o[7];let b=g,y;e:{if(b?.state==="published"){y="banners.published-release.description";break e}if(b&&(0,R._9c)(b)){y="banners.archived-scheduled-draft.description";break e}y="banners.archived-release.description"}let j=y,v=b?.metadata.title,_;return o[10]===c?_=o[11]:(_=c("release.placeholder-untitled-release"),o[10]=c,o[11]=_),o[12]!==j||o[13]!==b||o[14]!==d?(t=e=>{let{displayTitle:t}=e;return(0,A.jsx)(R.HTc,{t:d,i18nKey:j,values:{title:t},components:{VersionBadge:e=>{let{children:t}=e;return(0,A.jsx)((0,R.bSq)(b),{children:t})}}})},o[12]=j,o[13]=b,o[14]=d,o[15]=t):t=o[15],o[16]!==v||o[17]!==_||o[18]!==t?(n=(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.Qfr,{title:v,fallback:_,children:t})}),o[16]=v,o[17]=_,o[18]=t,o[19]=n):n=o[19],o[20]!==x||o[21]!==p?.archivedRelease?(i=p?.archivedRelease?void 0:{text:"Go back to published version",onClick:x},o[20]=x,o[21]=p?.archivedRelease,o[22]=i):i=o[22],o[23]!==n||o[24]!==i?(l=(0,A.jsx)(nL,{tone:"caution",content:n,action:i}),o[23]=n,o[24]=i,o[25]=l):l=o[25],l}let nM=O.I4.img.withConfig({displayName:"Image",componentId:"sc-2nkorc-0"})`object-fit:cover;width:100%;height:100%;height:180px;display:flex;`,nH=e=>{let t,n,i,l,a,s,c,u,p,m=(0,P.c)(24),{onClose:h,isLockedByCanvas:f}=e,{t:x}=(0,R.Bdt)(r.I),g=(0,d.useRef)(null),b;m[0]===Symbol.for("react.memo_cache_sentinel")?(b=()=>[g.current],m[0]=b):b=m[0],(0,E.y)(h,b),m[1]!==f||m[2]!==x?(t=x(f?"canvas.banner.popover-heading":"canvas.banner.editable.popover-heading"),m[1]=f,m[2]=x,m[3]=t):t=m[3];let y=t,j;m[4]!==f||m[5]!==x?(j=x(f?"canvas.banner.popover-description":"canvas.banner.editable.popover-description"),m[4]=f,m[5]=x,m[6]=j):j=m[6];let v=j,_;return m[7]===Symbol.for("react.memo_cache_sentinel")?(_=(0,A.jsx)(nM,{src:"https://cdn.sanity.io/images/pyrmmpch/production/b47224e2f3a7d1747e43b9da1ac31739250e628b-632x376.png",alt:"Canvas"}),m[7]=_):_=m[7],m[8]===Symbol.for("react.memo_cache_sentinel")?(n=(0,A.jsx)(E.et,{size:1,weight:"semibold",children:"Canvas"}),m[8]=n):n=m[8],m[9]===Symbol.for("react.memo_cache_sentinel")?(i=(0,A.jsxs)(E.at,{paddingY:1,gap:2,children:[n,(0,A.jsx)(E.et,{size:1,muted:!0,children:(0,A.jsx)(eh.ComposeSparklesIcon,{})})]}),m[9]=i):i=m[9],m[10]===y?l=m[11]:(l=(0,A.jsx)(E.lt,{paddingTop:3,children:(0,A.jsx)(z.DZ,{size:1,children:y})}),m[10]=y,m[11]=l),m[12]===v?a=m[13]:(a=(0,A.jsx)(E.lt,{paddingTop:4,children:(0,A.jsx)(E.et,{size:1,children:v})}),m[12]=v,m[13]=a),m[14]!==l||m[15]!==a?(s=(0,A.jsxs)(E.at,{paddingX:4,paddingBottom:4,paddingTop:3,direction:"column",children:[i,l,a]}),m[14]=l,m[15]=a,m[16]=s):s=m[16],m[17]===x?c=m[18]:(c=x("canvas.banner.popover-button-text"),m[17]=x,m[18]=c),m[19]===c?u=m[20]:(u=(0,A.jsx)(E.at,{gap:3,justify:"flex-end",paddingX:4,paddingBottom:4,children:(0,A.jsx)(o.a,{mode:"bleed",text:c,autoFocus:!0,tone:"primary",href:"https://snty.link/canvas-docs",target:"_blank",rel:"noopener noreferrer",as:"a",iconRight:ef.LaunchIcon})}),m[19]=c,m[20]=u),m[21]!==u||m[22]!==s?(p=(0,A.jsx)(E.W,{radius:3,overflow:"hidden",ref:g,children:(0,A.jsxs)(z.mc,{width:0,children:[_,s,u]})}),m[21]=u,m[22]=s,m[23]=p):p=m[23],p},nV=e=>{let t,n,i,a,s=(0,P.c)(21),{documentId:c}=e,{t:u}=(0,R.Bdt)(r.I),[p,m]=(0,d.useState)(!1),h=(0,R.tfA)(c),{isLockedByCanvas:f}=(0,R.G2c)(c),x;e:{let e;if(!f){let e;s[0]===u?e=s[1]:(e=u("canvas.banner.editable.linked-text"),s[0]=u,s[
11]=e),x=e;break e}if("published"===h){let e;s[2]===u?e=s[3]:(e=u("canvas.banner.linked-text.published"),s[2]=u,s[3]=e),x=e;break e}if("draft"===h){let e;s[4]===u?e=s[5]:(e=u("canvas.banner.linked-text.draft"),s[4]=u,s[5]=e),x=e;break e}s[6]===u?e=s[7]:(e=u("canvas.banner.linked-text.version"),s[6]=u,s[7]=e),x=e}let g=x,b;s[8]===Symbol.for("react.memo_cache_sentinel")?(b=()=>m(nK),s[8]=b):b=s[8];let y=b,j;s[9]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(!1),s[9]=j):j=s[9];let v=j,_;return s[10]===g?_=s[11]:(_=(0,A.jsx)(E.et,{size:1,weight:"medium",children:g}),s[10]=g,s[11]=_),s[12]===f?t=s[13]:(t=(0,A.jsx)(nH,{onClose:v,isLockedByCanvas:f}),s[12]=f,s[13]=t),s[14]===Symbol.for("react.memo_cache_sentinel")?(n=(0,A.jsx)(o.a,{tooltipProps:null,mode:"bleed",tone:"default",icon:V.InfoOutlineIcon,onClick:y}),s[14]=n):n=s[14],s[15]!==p||s[16]!==t?(i=(0,A.jsx)(l.r,{open:p,size:0,tone:"default",portal:!0,placement:"bottom-start",content:t,children:n}),s[15]=p,s[16]=t,s[17]=i):i=s[17],s[18]!==_||s[19]!==i?(a=(0,A.jsxs)(E.at,{align:"center",gap:2,children:[_,i]}),s[18]=_,s[19]=i,s[20]=a):a=s[20],a};function nW(){let e,t,n,i,l=(0,P.c)(10),{documentId:o,displayed:a}=e9(),{t:s}=(0,R.Bdt)(r.I),d=a?._id||o,{companionDoc:c}=(0,R.G2c)(d),u=(0,R.aqr)(c?.canvasDocumentId,"banner");return c?(l[0]===d?e=l[1]:(e=(0,A.jsx)(nV,{documentId:d}),l[0]=d,l[1]=e),l[2]===s?t=l[3]:(t=s("canvas.banner.edit-in-canvas-action"),l[2]=s,l[3]=t),l[4]!==u||l[5]!==t?(n={mode:"ghost",text:t,onClick:u},l[4]=u,l[5]=t,l[6]=n):n=l[6],l[7]!==e||l[8]!==n?(i=(0,A.jsx)(nL,{tone:"neutral","data-test-id":"canvas-linked-banner",paddingY:0,content:e,action:n}),l[7]=e,l[8]=n,l[9]=i):i=l[9],i):null}function nK(e){return!e}let nF=e=>{let t,n,i,l,o,a,s,d=(0,P.c)(32),{schemaType:c,selectedPerspective:u,reason:p}=e,{t:m}=(0,R.Bdt)(r.I),{t:h}=(0,R.Bdt)(),{document:f}=(0,R.hA9)(),{drafts:x}=f,{enabled:g}=x,b;d[0]!==g||d[1]!==c?(b=e=>{let{perspective:t}=e;return{disabled:!(0,R.CW3)({selectedPerspective:t,isDraftModelEnabled:g,schemaType:c}).result}},d[0]=g,d[1]=c,d[2]=b):b=d[2];let y=b,j=(0,R.Jrl)(u)?u:void 0,v;d[3]!==j||d[4]!==h?(v=j?j.metadata.title||h("release.placeholder-untitled-release"):void 0,d[3]=j,d[4]=h,d[5]=v):v=d[5];let _=v,I;return d[6]!==p||d[7]!==m?(I="PUBLISHED_NOT_WRITEABLE"===p&&m("banners.choose-new-document-destination.cannot-create-published-document"),d[6]=p,d[7]=m,d[8]=I):I=d[8],d[9]!==p||d[10]!==m?(t="DRAFTS_NOT_WRITEABLE"===p&&m("banners.choose-new-document-destination.cannot-create-draft-document"),d[9]=p,d[10]=m,d[11]=t):t=d[11],d[12]!==p||d[13]!==j||d[14]!==_||d[15]!==m||d[16]!==h?(n="RELEASE_NOT_ACTIVE"===p&&j&&_&&(0,A.jsx)(R.HTc,{t:m,i18nKey:"banners.choose-new-document-destination.release-inactive",values:{title:_},components:{VersionBadge:e=>{let{children:t}=e,n=(0,R.bSq)(j);return(0,A.jsx)(R.Qfr,{title:j.metadata.title,fallback:h("release.placeholder-untitled-release"),children:()=>(0,A.jsx)(n,{children:t})})}}}),d[12]=p,d[13]=j,d[14]=_,d[15]=m,d[16]=h,d[17]=n):n=d[17],d[18]===m?i=d[19]:(i=m("banners.choose-new-document-destination.choose-destination"),d[18]=m,d[19]=i),d[20]===i?l=d[21]:(l=(0,A.jsxs)(A.Fragment,{children:[" ",i]}),d[20]=i,d[21]=l),d[22]!==I||d[23]!==t||d[24]!==n||d[25]!==l?(o=(0,A.jsxs)(E.et,{size:1,children:[I,t,n,l]}),d[22]=I,d[23]=t,d[24]=n,d[25]=l,d[26]=o):o=d[26],d[27]===y?a=d[28]:(a=(0,A.jsx)(R.GCV,{menuItemProps:y}),d[27]=y,d[28]=a),d[29]!==o||d[30]!==a?(s=(0,A.jsx)(nL,{tone:"caution",icon:H.WarningOutlineIcon,content:(0,A.jsxs)(E.at,{align:"center",gap:2,children:[o,a]})}),d[29]=o,d[30]=a,d[31]=s):s=d[31],s};function nJ(){let e=(0,P.c)(3),{isDeleted:t,isDeleting:n,ready:i}=e9(),{selectedPerspective:r}=(0,R.QO2)();if(!i)return null;if(!(0,R.xo4)(r)&&!(0,R.o2j)(r)&&(0,R.Jrl)(r)&&"archived"===r.state){let t;return e[0]===r?t=e[1]:(t=(0,A.jsx)(nY,{release:r}),e[0]=r,e[1]=t),t}if(t&&!n){let t;return e[2]===Symbol.for("react.memo_cache_sentinel")?(t=(0,A.jsx)(nU,{}),e[2]=t):t=e[2],t}}function nU(){let e,t,n,i,l=(0,P.c)(17),{documentId:o,documentType:a}=e9(),{restore:s}=(0,R.QSs)(o,a),{navigateIntent:d}=(0,ee.rd)(),c;l[0]!==o||l[1]!==a||l[2]!==d||l[3]!==s?(c=()=>{s.execute("lastRevision"),d("edit",{id:o,type:a})},l[0]=o,l[1]=a,l[2]=d,l[3]=s,l[4]=c):c=l[4];let u=c,{t:p}=(0,R.Bdt)(r.I),m;return l[5]===p?m=l[6]:(m=p("banners.deleted-document-banner.restore-button.text"),l[5]=p,l[6]=m),l[7]!==u||l[8]!==m?(e={onClick:u,text:m},l[7]=u,l[8]=m,l[9]=e):e=l[9],l[10]===p?t=l[11]:(t=p("banners.deleted-document-banner.text"),l[10]=p,l[11]=t),l[12]===t?n=l[13]:(n=(0,A.jsx)(E.et,{size:1,weight:"medium",children:t}),l[12]=t,l[13]=n),l[14]!==e||l[15]!==n?(i=(0,A.jsx)(nL,{action:e,content:n,"data-testid":"deleted-document-banner",icon:eg.ReadOnlyIcon}),l[14]=e,l[15]=n,l[16]=i):i=l[16],i}let nY=e=>{let t,n,i=(0,P.c)(8),{release:r}=e,{t:l}=(0,R.Bdt)(),o;return i[0]!==r.metadata?.title||i[1]!==l?(o=r.metadata?.title||l("release.placeholder-untitled-release"),i[0]=r.metadata?.title,i[1]=l,i[2]=o):o=i[2],i[3]===o?t=i[4]:(t={t
1itle:o},i[3]=o,i[4]=t),i[5]!==l||i[6]!==t?(n=(0,A.jsx)(nL,{tone:"caution",content:(0,A.jsx)(E.et,{size:1,weight:"medium",children:(0,A.jsx)(R.HTc,{t:l,i18nKey:"banners.deleted-release-banner.text",values:t})}),"data-testid":"deleted-release-banner",icon:ex.DocumentRemoveIcon}),i[5]=l,i[6]=t,i[7]=n):n=i[7],n};function nQ(){let e,t,n=(0,P.c)(5),{schemaType:i}=nv(),{t:l}=(0,R.Bdt)(r.I);return(0,R.fqE)(i)?(n[0]===l?e=n[1]:(e=(0,A.jsx)(R.HTc,{t:l,i18nKey:"banners.deprecated-document-type-banner.text"}),n[0]=l,n[1]=e),n[2]!==i.deprecated.reason||n[3]!==e?(t=(0,A.jsx)(nL,{content:(0,A.jsxs)(E.et,{size:1,weight:"medium",children:[e," ",i.deprecated.reason]}),"data-testid":"deprecated-document-type-banner",icon:ed.ErrorOutlineIcon}),n[2]=i.deprecated.reason,n[3]=e,n[4]=t):t=n[4],t):null}function nq(e){let t,n,i,l,o,a,s,c=(0,P.c)(42),{documentId:u,currentRelease:p,isScheduledRelease:m}=e,h=p??R.k0f,f;c[0]===h?f=c[1]:(f=(0,R.Y73)(h),c[0]=h,c[1]=f);let x=f,{t:g}=(0,R.Bdt)(r.I),{t:b}=(0,R.Bdt)(),{createVersion:y}=(0,R.wI4)(),j="string"==typeof p,v;c[2]!==p||c[3]!==j||c[4]!==b?(v=j?p:p?.metadata?.title||b("release.placeholder-untitled-release"),c[2]=p,c[3]=j,c[4]=b,c[5]=v):v=c[5];let _=v,[I,w]=(0,d.useState)(),S=(0,z.dj)(),C;c[6]!==y||c[7]!==p||c[8]!==u||c[9]!==j||c[10]!==g||c[11]!==S?(C=async()=>{if(j||p._id){w({status:"creating",lastUpdate:new Date});let e=j?p:(0,R._hI)(p._id);try{await y(e,u),w({status:"created",lastUpdate:new Date})}catch(e){S.push({status:"error",closable:!0,title:g("banners.release.error.title"),description:g("banners.release.error.description",{message:e.message})}),w(void 0)}}},c[6]=y,c[7]=p,c[8]=u,c[9]=j,c[10]=g,c[11]=S,c[12]=C):C=c[12];let k=C,T=function(){let e=(0,P.c)(4),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Date,e[0]=t):t=e[0];let[n,i]=(0,d.useState)(t),r,l;return 200===e[1]?(r=e[2],l=e[3]):(r=()=>{let e=setInterval(()=>{i(new Date)},200);return()=>clearInterval(e)},l=[200],e[1]=200,e[2]=r,e[3]=l),(0,d.useEffect)(r,l),n}(),D=I?.status==="created"&&T.getTime()-I.lastUpdate.getTime()>1e3,B;return c[13]===g?B=c[14]:(B=g("banners.release.waiting.title"),c[13]=g,c[14]=B),c[15]===g?t=c[16]:(t=g("banners.release.waiting.description"),c[15]=g,c[16]=t),c[17]!==D||c[18]!==B||c[19]!==t?(n={status:"info",id:"add-document-to-release",enabled:D,closable:!0,title:B,description:t}
1,c[17]=D,c[18]=B,c[19]=t,c[20]=n):n=c[20],(0,R.B1J)(n),c[21]===_?i=c[22]:(i={title:_},c[21]=_,c[22]=i),c[23]!==p||c[24]!==j||c[25]!==b?(l={VersionBadge:e=>{let{children:t}=e,n=(0,R.bSq)(p);return j?(0,A.jsx)(n,{children:t}):(0,A.jsx)(R.Qfr,{title:p.metadata?.title,fallback:b("release.placeholder-untitled-release"),children:()=>(0,A.jsx)(n,{children:t})})}},c[23]=p,c[24]=j,c[25]=b,c[26]=l):l=c[26],c[27]!==g||c[28]!==l||c[29]!==i?(o=(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.HTc,{i18nKey:"banners.release.not-in-release",t:g,values:i,components:l})}),c[27]=g,c[28]=l,c[29]=i,c[30]=o):o=c[30],c[31]!==p||c[32]!==k||c[33]!==m||c[34]!==g||c[35]!==x||c[36]!==I?(a=m?void 0:{text:(0,R.zPk)(p)?g("banners.release.action.add-to-bundle"):g("banners.release.action.add-to-release"),tone:x,disabled:!!I,onClick:k,mode:"default"},c[31]=p,c[32]=k,c[33]=m,c[34]=g,c[35]=x,c[36]=I,c[37]=a):a=c[37],c[38]!==o||c[39]!==a||c[40]!==x?(s=(0,A.jsx)(nL,{tone:x,content:o,action:a}),c[38]=o,c[39]=a,c[40]=x,c[41]=s):s=c[41],s}function nG(){let e,t,n,i,l,o,a=(0,P.c)(43),{t:s}=(0,R.Bdt)(r.I),{t:c}=(0,R.Bdt)(),{value:u,documentId:p}=e9(),{selectedPerspective:m,selectedVariant:h,selectedReleaseId:f}=(0,R.QO2)(),x;a[0]===p?x=a[1]:(x={documentId:p},a[0]=p,a[1]=x);let{versions:g}=(0,R.gn8)(x),{createVariantDocument:b}=(0,R.I6i)(),[y,j]=(0,d.useState)("idle"),v=(0,z.dj)(),_=(0,R.Rcw)(),I;a[2]===h?I=a[3]:(I=h?(0,R.Ayf)(h):"",a[2]=h,a[3]=I);let w=I,S;e:{if((0,R.Jrl)(m)){let e;a[4]!==m.metadata?.title||a[5]!==c?(e=m.metadata?.title||c("release.placeholder-untitled-release"),a[4]=m.metadata?.title,a[5]=c,a[6]=e):e=a[6],S=e;break e}if((0,R.o2j)(m)){let e;a[7]===c?e=a[8]:(e=c("release.chip.global.drafts"),a[7]=c,a[8]=e),S=e;break e}if((0,R.xo4)(m)){let e;a[9]===c?e=a[10]:(e=c("release.chip.published"),a[9]=c,a[10]=e),S=e;break e}S=String(m)}let C=S,k;a[11]!==b||a[12]!==p||a[13]!==m||a[14]!==h||a[15]!==s||a[16]!==v||a[17]!==u||a[18]!==g?(k=async()=>{if(h){j("in-progress");try{if(u._createdAt){let e=function({variant:e,documentVersions:t,fallback:n}){let i=(0,R.Dum)({bundle:"drafts",variant:e._id,documentVersions:t})||(0,R.Dum)({bundle:"published",variant:e._id,documentVersions:t});return i?{_id:i._id,_rev:i._rev}:{_id:n._id,_rev:n._rev}}({variant:h,documentVersions:g,fallback:{_id:u._id,_rev:u._rev}});await b({baseId:e._id,ifBaseRevisionId:e._rev,documentGroupId:p,variant:h,selectedPerspective:m})}else{let{_id:e,_rev:t,_createdAt:n,_updatedAt:i,_system:r,...l}=u;await b({document:l,documentGroupId:p,variant:h,selectedPerspective:m})}j("success")}catch(e){v.push({status:"error",closable:!0,title:s("banners.variant.error.title"),description:s("banners.variant.error.description",{message:e instanceof Error?e.message:String(e)})}),j("failed")}}},a[11]=b,a[12]=p,a[13]=m,a[14]=h,a[15]=s,a[16]=v,a[17]=u,a[18]=g,a[19]=k):k=a[19];let T=k,D="success"===y,B;a[20]===s?B=a[21]:(B=s("banners.variant.waiting.title"),a[20]=s,a[21]=B),a[22]===s?e=a[23]:(e=s("banners.variant.waiting.description"),a[22]=s,a[23]=e),a[24]!==D||a[25]!==B||a[26]!==e?(t={status:"info",id:"add-document-to-variant",enabled:D,delay:1e3,closable:!0,title:B,description:e},a[24]=D,a[25]=B,a[26]=e,a[27]=t):t=a[27],(0,R.B1J)(t);let O=m===_||f,N;return a[28]!==C||a[29]!==w?(N={variantTitle:w,perspectiveTitle:C},a[28]=C,a[29]=w,a[30]=N):N=a[30],a[31]===Symbol.for("react.memo_cache_sentinel")?(n={VariantBadge:nZ,PerspectiveTitle:nX},a[31]=n):n=a[31],a[32]!==s||a[33]!==N?(i=(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.HTc,{i18nKey:"banners.variant.not-in-variant",t:s,values:N,components:n})}),a[32]=s,a[33]=N,a[34]=i):i=a[34],a[35]!==T||a[36]!==O||a[37]!==y||a[38]!==s?(l=O?{text:s("banners.variant.action.add-to-variant"),tone:"suggest",disabled:"in-progress"===y||"success"===y,onClick:T,mode:"default"}:void 0,a[35]=T,a[36]=O,a[37]=y,a[38]=s,a[39]=l):l=a[39],a[40]!==i||a[41]!==l?(o=(0,A.jsx)(nL,{tone:"suggest",content:i,action:l}),a[40]=i,a[41]=l,a[42]=o):o=a[42],o}function nX(e){let{children:t}=e;return(0,A.jsx)("strong",{children:t})}function nZ(e){let{children:t}=e;return(0,A.jsx)("strong",{children:t})}let n0=(0,G.g_)({name:"Ask To Edit Dialog Opened",version:1,description:'User clicked the "Ask to edit" button in the document permissions banner'}),n1=(0,G.g_)({name:"Ask To Edit Request Sent",version:1,description:"User sent a role change request from the dialog"}),n2=(0,O.I4)(E.lt).withConfig({displayName:"DialogBody",componentId:"sc-ol9l75-0"})`box-sizing:border-box;`;function n3(e){let t,n,i,o,a,s,c,u,p,h,f=(0,P.c)(56),{onClose:x,onRequestSubmitted:g}=e,{t:b}=(0,R.Bdt)(r.I),j=(0,q.Jr)(),v=`request-permissions-${(0,d.useId)()}`,w=(0,R.M91)(),S;f[0]===Symbol.for("react.memo_cache_sentinel")?(S={apiVersion:"2024-09-26"},f[0]=S):S=f[0];let C=(0,R.tH7)(S),k=(0,z.dj)(),T=(0,R.YKH)(),[D,B]=(0,d.useState)(!1),[O,N]=(0,d.useState)(""),[L,$]=(0,d.useState)(),[M,H]=(0,d.useState)(!1),[V,K]=(0,d.useState)(!1),F;e:{let e,t="administrator";if(!w||!C){let e;f[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,m.of)(t),f[1]=e):e=f[1],F=e;break e}if(f[2]!==C.observable||f[3]!==w){let n,i;f[5]===Symbol.for("react.memo_cache_sentinel")?(n=e=>e.filter(n5).find(n4)?"editor":t,f[5]=n):n=f[5],f[6]===Symbol.for("react.memo_cache_sentinel")?(i=()=>(0,m.of)(t),f[6]=i):i=f[6],e=C.observable.request({url:`/projects/${w}/roles`}).pipe((0,y.T)(n),(0,_.Z)(t),(0,I.W)(i)),f[2]=C.observable,f[3]=w,f[4]=e}else e=f[4];F=e}let J=(0,W.ut)(F),U;f[7]!==C||f[8]!==O||f[9]!==g||f[10]!==w||f[11]!==J||f[12]!==j||f[13]!==k?(U=()=>{B(!0),C.request({url:`/access/project/${w}/requests`,method:"post",body:{note:O,requestUrl:window?.location.href,requestedRole:J,type:"role"}}).then(e=>{e&&(g&&g(),j.log(n1),k.push({title:"Edit access requested"}))}).catch(e=>{let t=e?.response?.statusCode,n=e?.response?.body?.message;429===t&&(H(!0),$(n)),409===t?(K(!0),$(n)):k.push({title:"There was a problem submitting your request.",status:"error"})}).finally(()=>{B(!1)})},f[7]=C,f[8]=O,f[9]=g,f[10]=w,f[11]=J,f[12]=j,f[13]=k,f[14]=U):U=f[14];let Y=U,Q=T.fullscreen,G;f[15]===b?G=f[16]:(G=b("request-permission-dialog.header.text"),f[15]=b,f[16]=G),f[17]===b?t=f[18]:(t=b("confirm-dialog.cancel-button.fallback-text"),f[17]=b,f[18]=t),f[19]!==x||f[20]!==t?(n={onClick:x,text:t},f[19]=x,f[20]=t,f[21]=n):n=f[21];let X=M||V,Z;return f[22]===b?Z=f[23]:(Z=b("request-permission-dialog.confirm-button.text"),f[22]=b,f[23]=Z),f[24]!==D||f[25]!==Y||f[26]!==X||f[27]!==Z?(i={onClick:Y,loading:D,disabled:X,text:Z,tone:"primary",type:"submit"},f[24]=D,f[25]=Y,f[26]=X,f[27]=Z,f[28]=i):i=f[28],f[29]!==i||f[30]!==n?(o={cancelButton:n,confirmButton:i},f[29]=i,f[30]=n,f[31]=o):o=f[31],f[32]===b?a=f[33]:(a=b("request-permission-dialog.description.text"),f[32]=b,f[33]=a),f[34]===a?s=f[35]:(s=(0,A.jsx)(E.et,{children:a}),f[34]=a,f[35]=s),f[36]!==V||f[37]!==M||f[38]!==D||f[39]!==L||f[40]!==O||f[41]!==Y||f[42]!==b?(c=M||V?(0,A.jsx)(E.W,{tone:"caution",padding:3,radius:2,shadow:1,children:(0,A.jsxs)(E.et,{size:1,children:[M&&(0,A.jsx)(A.Fragment,{children:L??b("request-permission-dialog.warning.limit-reached.text")}),V&&(0,A.jsx)(A.Fragment,{children:L??b("request-permission-dialog.warning.denied.text")})]})}):(0,A.jsxs)(E.O,{gap:3,paddingBottom:0,children:[(0,A.jsx)(E.b,{placeholder:b("request-permission-dialog.note-input.placeholder.text"),disabled:D,onKeyDown:e=>{"Enter"===e.key&&Y()},maxLength:150,value:O,onChange:e=>{N(e.currentTarget.value)}}),(0,A.jsx)(E.et,{align:"right",muted:!0,size:1,children:`${O.length}/150`})]}),f[36]=V,f[37]=M,f[38]=D,f[39]=L,f[40]=O,f[41]=Y,f[42]=b,f[43]=c):c=f[43],f[44]!==s||f[45]!==c?(u=(0,A.jsx)(n2,{children:(0,A.jsxs)(E.O,{gap:4,children:[s,c]})}),f[44]=s,f[45]=c,f[46]=u):u=f[46],f[47]!==v||f[48]!==x||f[49]!==o||f[50]!==u||f[51]!==G?(p=(0,A.jsx)(l.i,{width:1,id:v,header:G,footer
1:o,onClose:x,onClickOutside:x,children:u}),f[47]=v,f[48]=x,f[49]=o,f[50]=u,f[51]=G,f[52]=p):p=f[52],f[53]!==p||f[54]!==T.fullscreen?(h=(0,A.jsx)(z.Co,{position:"fixed",zOffset:Q,children:p}),f[53]=p,f[54]=T.fullscreen,f[55]=h):h=f[55],h}function n4(e){return"editor"===e.name}function n5(e){return e?.appliesToUsers}(0,O.I4)(E.at).attrs({align:"center",direction:"column",justify:"center"}).withConfig({displayName:"LoadingContainer",componentId:"sc-ol9l75-1"})`height:110px;`;let n6={loading:!0,error:!1,status:void 0},n7={loading:!1,error:!1,status:"none"},n8={loading:!1,error:!1,status:"declined"},n9={loading:!1,error:!1,status:"pending"},ie={loading:!1,error:!1,status:"expired"};function it(e){let t,n,i,l,o,a,s=(0,P.c)(30),{requiredPermission:c}=e,u=(0,R.iZK)(),p=(0,R.hA9)(),{documentId:h,schemaType:f}=e9(),x;s[0]!==h||s[1]!==f.name||s[2]!==p.document.askToEdit?(x=p.document.askToEdit.enabled({documentId:h,documentType:f.name}),s[0]=h,s[1]=f.name,s[2]=p.document.askToEdit,s[3]=x):x=s[3];let g=x,{data:b,loading:j,error:v}=(()=>{let e=(0,P.c)(9),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={apiVersion:"2024-07-01"},e[0]=t):t=e[0];let n=(0,R.tH7)(t),i=(0,R.M91)(),r;e:{var l,o;let t;if(!n||!i){let t;e[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,m.of)(n7),e[1]=t):t=e[1],r=t;break e}e[2]!==n||e[3]!==i?(l=n,o=i,t=l.observable.request({url:"/access/requests/me",tag:"use-role-requests-status"}).pipe((0,y.T)(e=>{if(!e||0===e.length)return n7;let t=e.filter(e=>e.resourceId===o&&"role"===e.type),n=t.find(e=>"declined"===e.status);return n&&(0,ey.d)((0,eb.J)(new Date(n.createdAt),2),new Date)?n8:t.find(e=>"pending"===e.status&&(0,ey.d)((0,eb.J)(new Date(e.createdAt),2),new Date))?n9:t.find(e=>"pending"===e.status&&(0,ej.Y)((0,eb.J)(new Date(e.createdAt),2),new Date))?ie:n7}),(0,I.W)(e=>(console.error("Failed to fetch access requests",e),(0,m.of)({loading:!1,error:!0,status:void 0}))),(0,_.Z)(n6)),e[2]=n,e[3]=i,e[4]=t):t=e[4],r=t}let{loading:a,error:s,status:d}=(0,W.J2)(r,n6),c;return e[5]!==s||e[6]!==a||e[7]!==d?(c={data:d,loading:a,error:s},e[5]=s,e[6]=a,e[7]=d,e[8]=c):c=e[8],c})(),[w,S]=(0,d.useState)(!1),C="pending"===b||"declined"===b||w,k=u?.roles||[],T=1===k.length&&"viewer"===k[0].name,[D,z]=(0,d.useState)(!1),B;s[4]===Symbol.for("react.memo_cache_sentinel")?(B={style:"short"},s[4]=B):B=s[4];let O=(0,R.FfM)(B),{t:N}=(0,R.Bdt)(r.I),L=(0,q.Jr)(),$=k.map(ir),M=O.formatToParts($).map(ii),H=g&&T&&b&&!v&&!j,V;return s[5]===M?V=s[6]:(V={Roles:()=>(0,A.jsx)(A.Fragment,{children:M})},s[5]=M,s[6]=V),s[7]!==$||s[8]!==M.length?(t={count:M.length,roles:$},s[7]=$,s[8]=M.length,s[9]=t):t=s[9],s[10]!==c||s[11]!==N||s[12]!==V||s[13]!==t?(n=(0,A.jsx)(E.et,{size:1,weight:"medium",children:(0,A.jsx)(R.HTc,{t:N,i18nKey:"banners.permission-check-banner.missing-permission",components:V,values:t,context:c})}),s[10]=c,s[11]=N,s[12]=V,s[13]=t,s[14]=n):n=s[14],s[15]!==C||s[16]!==z||s[17]!==H||s[18]!==N||s[19]!==L?(i=H?{onClick:C?void 0:()=>{z(!0),L.log(n0)},text:N(C?"banners.permission-check-banner.request-permission-button.sent":"banners.permission-check-banner.request-permission-button.text"),tone:C?"default":"primary",disabled:C,mode:C?"bleed":void 0}:void 0,s[15]=C,s[16]=z,s[17]=H,s[18]=N,s[19]=L,s[20]=i):i=s[20],s[21]!==n||s[22]!==i?(l=(0,A.jsx)(nL,{content:n,action:i,"data-testid":"permission-check-banner",icon:eg.ReadOnlyIcon}),s[21]=n,s[22]=i,s[23]=l):l=s[23],s[24]!==z||s[25]!==D?(o=D&&(0,A.jsx)(n3,{onClose:()=>z(!1),onRequestSubmitted:()=>{S(!0),z(!1)}}),s[24]=z,s[25]=D,s[26]=o):o=s[26],s[27]!==l||s[28]!==o?(a=(0,A.jsxs)(A.Fragment,{children:[l,o]}),s[27]=l,s[28]=o,s[29]=a):a=s[29],a}function ii(e){return"element"===e.type?(0,A.jsx)("code",{children:e.value},e.value):e.value}function ir(e){return e.title}let il=(0,G.g_)({name:"LiveEdit Draft Resolved",version:1,description:"User resolved a draft of a live edit document to continue editing"}),io=e=>{let t,n,i,l,a,s,c,u,p,m,h=(0,P.c)(47),{displayed:f,documentId:x,schemaType:g,i18nKey:b,isEditBlocking:y}=e,{t:j}=(0,R.Bdt)(r.I),[v,_]=(0,d.useState)(!1),[I,w]=(0,d.useState)(!1),S=(0,q.Jr)(),{publish:C,discardChanges:k}=(0,R.QSs)(x,f?._type||""),T;h[0]!==C||h[1]!==S?(T=()=>{C.execute(),_(!0),S.log(il,{liveEditResolveType:"publish"})},h[0]=C,h[1]=S,h[2]=T):T=h[2];let D=T,z;h[3]!==k||h[4]!==S?(z=()=>{k.execute(),w(!0),S.log(il,{liveEditResolveType:"discard"})},h[3]=k,h[4]=S,h[5]=z):z=h[5];let B=z,O;h[6]===Symbol.for("react.memo_cache_sentinel")?(O=()=>()=>{_(!1),w(!1)}
1,h[6]=O):O=h[6],(0,d.useEffect)(O);let N=tM(),L;h[7]!==N||h[8]!==f?._id||h[9]!==g.name?(L=()=>{f?._id!==void 0&&N.navigateDiffView({mode:"version",previousDocument:{type:g.name,id:(0,R.IMx)(f?._id)},nextDocument:{type:g.name,id:(0,R.T4)(f?._id)}})},h[7]=N,h[8]=f?._id,h[9]=g.name,h[10]=L):L=h[10],f?._id;let $=L,M;return h[11]===g.title?M=h[12]:(M={schemaType:g.title},h[11]=g.title,h[12]=M),h[13]!==b||h[14]!==j||h[15]!==M?(t=(0,A.jsx)(E.et,{size:1,weight:"medium",children:(0,A.jsx)(R.HTc,{t:j,i18nKey:b,values:M})}),h[13]=b,h[14]=j,h[15]=M,h[16]=t):t=h[16],h[17]===j?n=h[18]:(n=j("banners.obsolete-draft.actions.compare-draft.text"),h[17]=j,h[18]=n),h[19]!==$||h[20]!==n?(i=(0,A.jsx)(o.a,{text:n,mode:"ghost",onClick:$}),h[19]=$,h[20]=n,h[21]=i):i=h[21],h[22]===j?l=h[23]:(l=j("banners.obsolete-draft.actions.publish-draft.text"),h[22]=j,h[23]=l),h[24]!==y||h[25]!==j?(a=y?{content:j("banners.live-edit-draft-banner.publish.tooltip")}:{},h[24]=y,h[25]=j,h[26]=a):a=h[26],h[27]!==D||h[28]!==v||h[29]!==a||h[30]!==l?(s=(0,A.jsx)(o.a,{onClick:D,text:l,tooltipProps:a,loading:v,tone:"positive"}),h[27]=D,h[28]=v,h[29]=a,h[30]=l,h[31]=s):s=h[31],h[32]===j?c=h[33]:(c=j("banners.obsolete-draft.actions.discard-draft.text"),h[32]=j,h[33]=c),h[34]!==y||h[35]!==j?(u=y?{content:j("banners.live-edit-draft-banner.discard.tooltip")}:{},h[34]=y,h[35]=j,h[36]=u):u=h[36],h[37]!==B||h[38]!==I||h[39]!==c||h[40]!==u?(p=(0,A.jsx)(o.a,{onClick:B,text:c,tooltipProps:u,loading:I,tone:"caution"}),h[37]=B,h[38]=I,h[39]=c,h[40]=u,h[41]=p):p=h[41],h[42]!==s||h[43]!==p||h[44]!==t||h[45]!==i?(m=(0,A.jsx)(nL,{content:(0,A.jsxs)(E.at,{align:"center",justify:"space-between",gap:2,children:[t,i,s,p]}),"data-testid":"live-edit-type-banner",icon:ed.ErrorOutlineIcon}),h[42]=s,h[43]=p,h[44]=t,h[45]=i,h[46]=m):m=h[46],m};function ia(e){let t,n=(0,P.c)(4),{documentId:i,isPinnedDraftOrPublished:r}=e,l;n[0]===i?l=n[1]:(l={documentId:i},n[0]=i,n[1]=l);let o=(0,R.Jr6)(l);return(0,R.A_X)(i)&&o&&r?(n[2]===i?t=n[3]:(t=(0,A.jsx)(is,{documentId:i}),n[2]=i,n[3]=t),t):null}function is(e){let t,n,i,l=(0,P.c)(37),{documentId:o}=e,{data:a}=(0,R.K0D)(),s=(0,R._T7)(),d;l[0]===o?d=l[1]:(d=(0,R._Sr)(o)??"",l[0]=o,l[1]=d);let c=d,u;if(l[2]!==a||l[3]!==c){let e;l[5]===c?e=l[6]:(e=e=>e._id.includes(c),l[5]=c,l[6]=e),u=a.find(e),l[2]=a,l[3]=c,l[4]=u}else u=l[4];let p=u,{t:m}=(0,R.Bdt)(),h;l[7]===o?h=l[8]:(h={documentId:o},l[7]=o,l[8]=h);let{data:f}=(0,R.gn8)(h),x;if(l[9]!==a||l[10]!==f){let e;l[12]===f?e=l[13]:(e=e=>f.find(t=>{let n=(0,R._Sr)(t)??"";return(0,R._hI)(e._id)===n})&&!(0,R._9c)(e),l[12]=f,l[13]=e),x=a.filter(e),l[9]=a,l[10]=f,l[11]=x}else x=l[11];let g=x,b;l[14]===p?b=l[15]:(b=p&&(0,R.Y73)(p),l[14]=p,l[15]=b);let y=b,{t:j}=(0,R.Bdt)(r.I),v;l[16]!==c||l[17]!==s?(v=async()=>{s(c)},l[16]=c,l[17]=s,l[18]=v):v=l[18];let _=v;if(0===g.length)return null;let I=g[0],w;l[19]===m?w=l[20]:(w=m("release.placeholder-untitled-release"),l[19]=m,l[20]=w);let S=w,C;return l[21]!==g.length||l[22]!==j?(C=e=>{let{displayTitle:t}=e;return g.length>1?(0,A.jsx)(R.HTc,{t:j,i18nKey:"banners.release.navigate-to-edit-description-multiple",components:{VersionBadge:()=>(0,A.jsx)(R.RwK,{children:t})},values:{count:g.length-1}}):(0,A.jsx)(R.HTc,{t:j,i18nKey:"banners.release.navigate-to-edit-description-single",components:{VersionBadge:()=>(0,A.jsx)(R.RwK,{children:t})}})},l[21]=g.length,l[22]=j,l[23]=C):C=l[23],l[24]!==S||l[25]!==I.metadata.title||l[26]!==C?(t=(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(E.at,{direction:"row",gap:1,wrap:"wrap",children:(0,A.jsx)(R.Qfr,{title:I.metadata.title,fallback:S,children:C})})}),l[24]=S,l[25]=I.metadata.title,l[26]=C,l[27]=t):t=l[27],l[28]!==g.length||l[29]!==_||l[30]!==j||l[31]!==y?(n=g.length>0?{text:j("banners.release.action.open-to-edit"),tone:y,onClick:_,mode:"default"}:void 0,l[28]=g.length,l[29]=_,l[30]=j,l[31]=y,l[32]=n):n=l[32],l[33]!==n||l[34]!==t||l[35]!==y?(i=(0,A.jsx)(nL,{tone:y,"data-testid":"open-release-to-edit-banner",content:t,action:n}),l[33]=n,l[34]=t,l[35]=y,l[36]=i):i=l[36],i}function id(){let e=(0,P.c)(2),{t}=(0,R.Bdt)(r.I),n;return e[0]===t?n=e[1]:(n=(0,A.jsx)(nL,{tone:"caution",icon:ev.PauseIcon,content:(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.HTc,{t,i18nKey:"banners.paused-scheduled-draft.text"})})}),e[0]=t,e[1]=n),n}let ic=(0,d.memo)(()=>{let e,t,n,i,l=(0,P.c)(32),o=(0,R.yKO)(),{selectedPerspectiveName:a}=(0,R.QO2)(),{params:s,groupIndex:d,routerPanesState:c,replaceCurrent:u,BackLink:p}=tc(),h=c[d]?.[0].id,x=c[d-1]?.[0],g=x?.id,b=!!x?.params?.rev,j;l[0]===s?j=l[1]:(j=s?.parentRefPath&&(0,Q.sH)(s.parentRefPath)||null,l[0]=s,l[1]=j);let v=j,{t:_}=(0,R.Bdt)(r.I),I;e:{let e,t=v?.[0];if(!g||!t||!v){let e;l[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,m.of)({loading:!1}),l[2]=e):e=l[2],I=e;break e}if(l[3]!==o||l[4]!==g||l[5]!==v||l[6]!==t||l[7]!==a){let n,i=(0,R.IMx)(g),r=(0,Q.sH)(t),s=r.findIndex(iu),d;l[9]===a?d=l[10]:(d=(0,R.sBy)(a)?void 0:a,l[9]=a,l[10]=d),l[11]===v?n=l[12]:(n=e=>{let{draft:t,published:n,version:i}=e;return{loading:!1,result:{availability:{draft:t.availability,published:n.availability,...i?.availability?{version:i.availability}:{}},refValue:(0,Q.Jt)(i?.snapshot||t.snapshot||n.snapshot,v)?._ref}}},l[11]=v,l[12]=n),e=(0,f.x)((0,m.of)({loading:!0}),o.unstable_observePathsDocumentPair(i,-1===s?r:r.slice(0,s),{version:d}).pipe((0,U.B)(750),(0,y.T)(n))),l[3]=o,l[4]=g,l[5]=v,l[6]=t,l[7]=a,l[8]=e}else e=l[8];I=e}let w=I,S;l[13]===Symbol.for("react.memo_cache_sentinel")?(S={loading:!0},l[13]=S):S=l[13];let C=(0,W.ut)(w,S),k;l[14]!==s||l[15]!==C.loading||l[16]!==C.result||l[17]!==u?(k=()=>{C.loading||C.result?.refValue&&u({id:C.result.refValue,params:s})},l[14]=s,l[15]=C.loading,l[16]=C.result,l[17]=u,l[18]=k):k=l[18];let T=k;return g&&v&&!b&&!C.loading&&(C.result?.availability.draft.available||C.result?.availability.published.available)&&C.result?.refValue!==h?(l[19]!==p||l[20]!==T||l[21]!==C.result?.refValue||l[22]!==_?(e=C.result?.refValue?{onClick:T,icon:ec.SyncIcon,text:_("banners.reference-changed-banner.reason-changed.reload-button.text")}:{as:p,icon:Y.CloseIcon,text:_("banners.reference-changed-banner.reason-removed.close-button.text")},l[19]=p,l[20]=T,l[21]=C.result?.refValue,l[22]=_,l[23]=e):e=l[23],l[24]!==C.result?.refValue||l[25]!==_?(t=_(C.result?.refValue?"banners.reference-changed-banner.reason-changed.text":"banners.reference-changed-banner.reason-removed.text"),l[24]=C.result?.refValue,l[25]=_,l[26]=t):t=l[26],l[27]===t?n=l[28]:(n=(0,A.jsx)(E.et,{size:1,weight:"medium",children:t}),l[27]=t,l[28]=n),l[29]!==e||l[30]!==n?(i=(0,A.jsx)(nL,{action:e,"data-testid":"reference-changed-banner",content:n,icon:H.WarningOutlineIcon,tone:"caution"}),l[29]=e,l[30]=n,l[31]=i):i=l[31],i):null});function iu(e){return"object"==typeof e&&"_key"in e}function ip(){let e,t,n=(0,P.c)(4),{revisionNotFound:i}=e9(),{t:l}=(0,R.Bdt)(r.I);return i?(n[0]===l?e=n[1]:(e=l("banners.revision-not-found.description"),n[0]=l,n[1]=e),n[2]===e?t=n[3]:(t=(0,A.jsx)(nL,{tone:"caution","data-test-id":"revision-not-found-banner",icon:H.WarningOutlineIcon,content:(0,A.jsx)(E.et,{size:1,children:e})}),n[2]=e,n[3]=t),t):null}function im(e){let t,n=(0,P.c)(2),{releaseId:i,draftDocument:l}=e,{t:o}=(0,R.Bdt)(r.I),{firstDocument:a}=(0,R.dxd)(i),s=l?._id?(0,R.IMx)(l._id):null,d=a?._id?(0,R.IMx)(a._id):null,c=l?._rev,u=a?._system?.base?.rev;return s!==d||c&&u&&c===u?null:(n[0]===o?t=n[1]:(t=(0,A.jsx)(nL,{tone:"caution",icon:H.WarningOutlineIcon,content:(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.HTc,{t:o,i18nKey:"banners.scheduled-draft-override-banner.text"})})}),n[0]=o,n[1]=t),t)}function ih(e){let t,n,i,r=(0,P.c)(13),{currentRelease:l}=e,o=l??R.k0f,a;r[0]===o?a=r[1]:(a=(0,R.Y73)(o),r[0]=o,r[1]=a);let s=a,{t:d}=(0,R.Bdt)(),c=(0,R.sfL)(),u;return r[2]!==l||r[3]!==c?(u=c(l),r[2]=l,r[3]=c,r[4]=u):u=r[4],r[5]===u?t=r[6]:(t={date:u},r[5]=u,r[6]=t),r[7]!==t||r[8]!==d?(n=(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.HTc,{t:d,i18nKey:"release.banner.scheduled-for-publishing-on",values:t})}),r[7]=t,r[8]=d,r[9]=n):n=r[9],r[10]!==n||r[11]!==s?(i=(0,A.jsx)(nL,{tone:s,icon:ei.LockIcon,content:n}),r[10]=n,r[11]=s,r[12]=i):i=r[12],i}function ix(){let e=(0,P.c)(17),{value:t,editState:n}=e9(),{selectedPerspective:i}=(0,R.QO2)(),l=(0,R.YW1)(t)||n?.version&&(0,R.YW1)(n?.version),{t:o}=(0,R.Bdt)(r.I),{t:a}=(0,R.Bdt)();if((0,R.Jrl)(i)&&l){let t,n,r,l,s;e[0]!==i.metadata?.title||e[1]!==a?(t=i.metadata?.title||a("release.placeholder-untitled-release"),e[0]=i.metadata?.title,e[1]=a,e[2]=t):t=e[2];let d=t,c;return e[3]===d?c=e[4]:(c={title:d},e[3]=d,e[4]=c),e[5]!==i||e[6]!==a?(n={VersionBadge:e=>{let{children:t}=e,n=(0,R.bSq)(i);return(0,A.jsx)(R.Qfr,{title:i.metadata?.title,fallback:a("release.placeholder-untitled-release"),children:()=>(0,A.jsx)(n,{children:t})})}}
1,e[5]=i,e[6]=a,e[7]=n):n=e[7],e[8]!==o||e[9]!==c||e[10]!==n?(r=(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.HTc,{t:o,i18nKey:"banners.unpublished-release-banner.text",values:c,components:n})}),e[8]=o,e[9]=c,e[10]=n,e[11]=r):r=e[11],e[12]===o?l=e[13]:(l=(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.HTc,{t:o,i18nKey:"banners.unpublished-release-banner.text-with-published"})}),e[12]=o,e[13]=l),e[14]!==r||e[15]!==l?(s=(0,A.jsx)(nL,{tone:"critical",content:(0,A.jsxs)(E.O,{gap:2,children:[r,l]}),icon:e_.UnpublishIcon}),e[14]=r,e[15]=l,e[16]=s):s=e[16],s}return null}function ig(e){let t,n,i=(0,P.c)(6),{requestedVariantName:l}=e,{t:o}=(0,R.Bdt)(r.I),a;return i[0]===l?a=i[1]:(a={name:l},i[0]=l,i[1]=a),i[2]===Symbol.for("react.memo_cache_sentinel")?(t={VariantName:ib},i[2]=t):t=i[2],i[3]!==o||i[4]!==a?(n=(0,A.jsx)(nL,{tone:"caution",icon:H.WarningOutlineIcon,content:(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.HTc,{i18nKey:"banners.variant.definition-not-found",t:o,values:a,components:t})})}),i[3]=o,i[4]=a,i[5]=n):n=i[5],n}function ib(e){let{children:t}=e;return(0,A.jsx)("strong",{children:t})}ic.displayName="Memo(ReferenceChangedBanner)";let iy=(0,O.I4)(E.O).withConfig({displayName:"TitleContainer",componentId:"sc-skpmvg-0"})`${({theme:e})=>(0,O.AH)`@supports not (container-type:inline-size){display:none !important;}container-type:inline-size;[data-heading]{font-size:${e.sanity.fonts.heading.sizes[4].fontSize}px;line-height:${e.sanity.fonts.heading.sizes[4].lineHeight}px;overflow-wrap:break-word;text-wrap:pretty;}@container (max-width:560px){[data-heading]{font-size:${e.sanity.fonts.heading.sizes[3].fontSize}px;line-height:${e.sanity.fonts.heading.sizes[3].lineHeight}px;}}@container (max-width:420px){[data-heading]{font-size:${e.sanity.fonts.heading.sizes[2].fontSize}px;line-height:${e.sanity.fonts.heading.sizes[2].lineHeight}px;}}`}`,ij=e=>{let t,n,i,l=(0,P.c)(14),{documentId:a,schemaType:s,title:d}=e,c=a===s.name,u=s.description,{t:p}=(0,R.Bdt)(r.I);if(!1===s.__experimental_formPreviewTitle)return null;l[0]!==u||l[1]!==c||l[2]!==s.name||l[3]!==s.title?(t=!c&&(0,A.jsxs)(E.g,{gap:1,children:[(0,A.jsx)(E.et,{muted:!0,size:1,children:s.title??s.name}),u&&(0,A.jsx)(o.o,{content:u,placement:"right",children:(0,A.jsx)(V.InfoOutlineIcon,{"data-testid":"schema-description-icon"})})]}),l[0]=u,l[1]=c,l[2]=s.name,l[3]=s.title,l[4]=t):t=l[4];let m=!d,h;return l[5]!==p||l[6]!==d?(h=d??p("document-view.form-view.form-title-fallback"),l[5]=p,l[6]=d,l[7]=h):h=l[7],l[8]!==m||l[9]!==h?(n=(0,A.jsx)(z.DZ,{as:"h2","data-heading":!0,muted:m,"data-testid":"document-panel-document-title",children:h}),l[8]=m,l[9]=h,l[10]=n):n=l[10],l[11]!==t||l[12]!==n?(i=(0,A.jsxs)(iy,{marginBottom:6,gap:4,children:[t,n]}),l[11]=t,l[12]=n,l[13]=i):i=l[13],i},iv=e=>e.preventDefault();function i_(e){let t,n,i,l,o,a,s,c,u,p,m,h,f,x,g,b,y,j,v,_,I,w=(0,P.c)(112),{ref:C,hidden:k,margins:T}=e,{collapsedFieldSets:D,collapsedPaths:B,displayed:O,editState:N,documentId:L,documentType:$,fieldActions:M,onChange:H,validation:V,ready:W,formState:K,onFocus:F,connectionState:J,onBlur:U,onSetCollapsedPath:Y,onPathOpen:Q,onSetCollapsedFieldSet:q,onSetActiveFieldGroup:G,openPath:X,inspectOpen:Z,compareValue:ee,hasUpstreamVersion:et,focusPath:en,syncState:ei,targetDocumentState:er}=e9(),{selectedPerspective:el}=(0,R.QO2)(),eo=(0,R.q3J)(),ea;w[0]===er?ea=w[1]:(ea=(0,R.LEK)(er),w[0]=er,w[1]=ea);let es=ea,ed=(0,R.cVB)(L),{title:ec}=te(),[eu]=(0,d.useState)(iI),ep=N?.transactionSyncLock?.enabled,{t:em}=(0,R.Bdt)(r.I),eh;w[2]===em?eh=w[3]:(eh=em("document-view.form-view.sync-lock-toast.title"),w[2]=em,w[3]=eh),w[4]===em?t=w[5]:(t=em("document-view.form-view.sync-lock-toast.description"),w[4]=em,w[5]=t),w[6]!==ep||w[7]!==eh||w[8]!==t?(n={id:"sync-lock",status:"warning",enabled:ep,title:eh,description:t,closable:!0},w[6]=ep,w[7]=eh,w[8]=t,w[9]=n):n=w[9],(0,R.B1J)(n),w[10]===em?i=w[11]:(i=em("document-view.form-view.sync-pending.title"),w[10]=em,w[11]=i),w[12]===em?l=w[13]:(l=em("document-view.form-view.sync-pending.description"),w[12]=em,w[13]=l),w[14]!==i||w[15]!==l?(o={status:"warning",title:i,description:l},w[14]=i,w[15]=l,w[16]=o):o=w[16],w[17]===em?a=w[18]:(a=em("document-view.form-view.sync-stalled.title"),w[17]=em,w[18]=a),w[19]===em?s=w[20]:(s=em("document-view.form-view.sync-stalled.description"),w[19]=em,w[20]=s),w[21]!==a||w[22]!==s?(c={status:"error",title:a,description:s},w[21]=a,w[22]=s,w[23]=c):c=w[23],w[24]===em?u=w[25]:(u=em("document-view.form-view.sync-recovering.title"),w[24]=em,w[25]=u),w[26]===em?p=w[27]:(p=em("document-view.form-view.sync-recovering.description"),w[26]=em,w[27]=p),w[28]!==u||w[29]!==p?(m={status:"warning",title:u,description:p},w[28]=u,w[29]=p,w[30]=m):m=w[30],w[31]!==m||w[32]!==o||w[33]!==c?(h={pending:o,stalled:c,recovering:m},w[31]=m,w[32]=o,w[33]=c,w[34]=h):h=w[34];let ef="synced"===ei?void 0:h[ei],ex="synced"!==ei,eg;w[35]!==ef||w[36]!==ex?(eg={id:"document-sync-state",enabled:ex,closable:!0,...ef},w[35]=ef,w[36]=ex,w[37]=eg):eg=w[37],(0,R.B1J)(eg),w[38]!==L||w[39]!==eo.pair||w[40]!==$||w[41]!==eu||w[42]!==es?(f=()=>{let e=eo.pair.documentEvents(L,$,es).pipe((0,S.M)(e=>{var t,n;let i,r,l;"mutation"===e.type&&eu.publish((i=(t=e).mutations.map(e=>
1e.patch).filter(Boolean),{type:"mutation",snapshot:t.document,patches:(0,R.i6N)(t.origin,i)})),"rebase"===e.type&&eu.publish((r=(n=e).remoteMutations.map(e=>e.patch).filter(Boolean),l=n.localMutations.map(e=>e.patch).filter(Boolean),{type:"rebase",snapshot:n.document,patches:(0,R.i6N)("remote",r).concat((0,R.i6N)("local",l))}))})).subscribe();return()=>{e.unsubscribe()}},w[38]=L,w[39]=eo.pair,w[40]=$,w[41]=eu,w[42]=es,w[43]=f):f=w[43],w[44]!==L||w[45]!==eo||w[46]!==$||w[47]!==eu||w[48]!==es?(x=[L,eo,$,eu,es],w[44]=L,w[45]=eo,w[46]=$,w[47]=eu,w[48]=es,w[49]=x):x=w[49],(0,d.useEffect)(f,x);let eb=!!O?._rev,ey;w[50]!==eu||w[51]!==O?(ey=()=>{eu.publish({type:"mutation",patches:[],snapshot:O})},w[50]=eu,w[51]=O,w[52]=ey):ey=w[52];let ej=(0,eI.J)(ey),ev;w[53]!==ej||w[54]!==eb?(ev=()=>{eb&&ej()},w[53]=ej,w[54]=eb,w[55]=ev):ev=w[55],w[56]===eb?g=w[57]:(g=[eb],w[56]=eb,w[57]=g),(0,d.useEffect)(ev,g);let[e_,ew]=(0,d.useState)(null),[eS,eC]=(0,d.useState)(!1),ek;w[58]!==e_||w[59]!==K?.focusPath.length||w[60]!==eS||w[61]!==W?(ek=()=>{!eS&&W&&!K?.focusPath.length&&e_&&(0,z.s5)(e_)},w[58]=e_,w[59]=K?.focusPath.length,w[60]=eS,w[61]=W,w[62]=ek):ek=w[62];let eT=K?.focusPath.length,eD;w[63]!==e_||w[64]!==eS||w[65]!==W||w[66]!==eT?(eD=[eS,e_,eT,W],w[63]=e_,w[64]=eS,w[65]=W,w[66]=eT,w[67]=eD):eD=w[67],(0,d.useEffect)(ek,eD),w[68]===en.length?b=w[69]:(b=()=>{0!==en.length&&eC(!0)},w[68]=en.length,w[69]=b),w[70]===en?y=w[71]:(y=[en],w[70]=en,w[71]=y),(0,d.useEffect)(b,y),w[72]===C?j=w[73]:(j=e=>{ew(e),"function"==typeof C?C(e):C&&(C.current=e)},w[72]=C,w[73]=j);let eP=j,eA="reconnecting"===J||K?.readOnly||!N?.ready,eE=eA?"true":void 0,ez;return w[74]!==D||w[75]!==B||w[76]!==ee||w[77]!==J||w[78]!==L||w[79]!==N?.draft||w[80]!==N?.published||w[81]!==M||w[82]!==K||w[83]!==et||w[84]!==k||w[85]!==Z||w[86]!==eA||w[87]!==U||w[88]!==H||w[89]!==F||w[90]!==Q||w[91]!==G||w[92]!==q||w[93]!==Y||w[94]!==X||w[95]!==eu||w[96]!==ed||w[97]!==el||w[98]!==em||w[99]!==ec||w[100]!==V?(ez="connecting"!==J||N?.draft||N?.published?null===K||k?(0,A.jsx)(E.lt,{padding:2,children:(0,A.jsx)(E.et,{children:em("document-view.form-view.form-hidden")})}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(R.fh$,{children:(0,A.jsx)(ij,{documentId:L,schemaType:K.schemaType,title:ec})}),(0,A.jsx)(R.okx,{__internal_fieldActions:M,__internal_inspectOpen:Z,__internal_patchChannel:eu,changed:K.changed,collapsedFieldSets:D,collapsedPaths:B,compareValue:ee??void 0,focused:K.focused,focusPath:K.focusPath,groups:K.groups,id:"root",members:K.members,onChange:H,onFieldGroupSelect:G,onPathBlur:U,onPathFocus:F,onPathOpen:Q,onSetFieldSetCollapsed:q,onSetPathCollapsed:Y,openPath:X,perspective:el,hasUpstreamVersion:et,presence:ed,readOnly:eA,schemaType:K.schemaType,validation:V,value:K.value})]}):(0,A.jsx)(R.Guw,{ms:300,children:(0,A.jsxs)(E.at,{align:"center",direction:"column",height:"fill",justify:"center",children:[(0,A.jsx)(E.$,{muted:!0}),(0,A.jsx)(E.lt,{marginTop:3,children:(0,A.jsx)(E.et,{align:"center",muted:!0,size:1,children:em("document-view.form-view.loading")})})]})}),w[74]=D,w[75]=B,w[76]=ee,w[77]=J,w[78]=L,w[79]=N?.draft,w[80]=N?.published,w[81]=M,w[82]=K,w[83]=et,w[84]=k,w[85]=Z,w[86]=eA,w[87]=U,w[88]=H,w[89]=F,w[90]=Q,w[91]=G,w[92]=q,w[93]=Y,w[94]=X,w[95]=eu,w[96]=ed,w[97]=el,w[98]=em,w[99]=ec,w[100]=V,w[101]=ez):ez=w[101],w[102]!==eP||w[103]!==eE||w[104]!==ez?(v=(0,A.jsx)(E.lt,{as:"form",onSubmit:iv,ref:eP,"data-testid":"form-view","data-read-only":eE,children:ez}),w[102]=eP,w[103]=eE,w[104]=ez,w[105]=v):v=w[105],w[106]!==T||w[107]!==v?(_=(0,A.jsx)(R.MLZ,{margins:T,children:v}),w[106]=T,w[107]=v,w[108]=_):_=w[108],w[109]!==k||w[110]!==_?(I=(0,A.jsx)(R.MG2,{hidden:k,children:_}),w[109]=k,w[110]=_,w[111]=I):I=w[111],I}function iI(){return(0,R.Ijd)()}function iw(){let e,t=(0,P.c)(11),{activeViewId:n}=e9(),{paneKey:i,views:r}=nv(),l=`${i}tabpanel`,o;if(t[0]!==n||t[1]!==i||t[2]!==l||t[3]!==r){let e;t[5]!==n||t[6]!==i||t[7]!==l?(e=(e,t)=>(0,A.jsx)(iS,{icon:e.icon,id:`${i}tab-${e.id}`,isActive:n===e.id,label:e.title,tabPanelId:l,viewId:0===t?null:e.id??null},e.id),t[5]=n,t[6]=i,t[7]=l,t[8]=e):e=t[8],o=r.map(e),t[0]=n,t[1]=i,t[2]=l,t[3]=r,t[4]=o}else o=t[4];return t[9]===o?e=t[10]:(e=(0,A.jsx)(E.c,{gap:1,children:o}),t[9]=o,t[10]=e),e}function iS(e){let t=(0,P.c)(20),n,i,r,l,a,s,d;t[0]===e?(n=t[1],i=t[2],r=t[3],l=t[4],a=t[5],s=t[6],d=t[7]):({icon:n,id:i,isActive:r,label:l,tabPanelId:s,viewId:d,...a}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=l,t[5]=a,t[6]=s,t[7]=d);let{ready:c,editState:u}=e9(),{setView:p}=tc(),m;t[8]!==p||t[9]!==d?(m=()=>p(d),t[8]=p,t[9]=d,t[10]=m):m=t[10];let h=m,f=!c&&!u?.draft&&!u?.published,x;return t[11]!==h||t[12]!==n||t[13]!==i||t[14]!==r||t[15]!==l||t[16]!==a||t[17]!==f||t[18]!==s?(
1x=(0,A.jsx)(o.n,{...a,"aria-controls":s,disabled:f,icon:n,id:i,label:l,onClick:h,selected:r}),t[11]=h,t[12]=n,t[13]=i,t[14]=r,t[15]=l,t[16]=a,t[17]=f,t[18]=s,t[19]=x):x=t[19],x}let iC={paneDataItems:[],routerPanes:[],resolvedPanes:[],maximizedPane:null,setMaximizedPane:()=>{}};function ik(){return(0,d.useContext)(B.DU)??iC}let iT=(0,G.g_)({name:"Document Pane Maximized",version:1,description:"User maximized a document pane via the focus pane button"}),iD=(0,G.g_)({name:"Document Pane Collapsed",version:1,description:"User collapsed a maximized document pane via the focus pane button"}),iP=(0,G.g_)({name:"Document Pane Navigated",version:1,description:"User navigated to a different document pane via the breadcrumbs in the header"});function iA(e){let t,n,i,l,a=(0,P.c)(28),{paneData:d,index:c}=e,{pane:u}=d,p=(0,ee.rd)(),{t:m}=(0,R.Bdt)(r.I),h=(0,ee.ks)(),f=(0,q.Jr)();h?.panes,a[0]===h?.panes?t=a[1]:(t=h?.panes||[],a[0]=h?.panes,a[1]=t);let x=t,{perspectiveStack:g,selectedVariantName:b}=(0,R.QO2)(),y=u!==s.r&&"title"in u?u.title:null,j=u!==s.r&&"document"===u.type?u.options.id:null,v=u!==s.r&&"document"===u.type?u.options.type:null,_=j??"",I=v??"",w;a[2]!==g||a[3]!==b||a[4]!==_||a[5]!==I?(w={documentId:_,documentType:I,perspectiveStack:g,variant:b},a[2]=g,a[3]=b,a[4]=_,a[5]=I,a[6]=w):w=a[6];let{value:S,isLoading:C}=(0,R.twe)(w),k;e:{if(j&&!C){let e;a[7]!==S?.title||a[8]!==m?(e=S?.title||m("panes.document-header-title.untitled.text"),a[7]=S?.title,a[8]=m,a[9]=e):e=a[9],k=e;break e}k=y}let T=k,D;a[10]!==d.groupIndex||a[11]!==p||a[12]!==x||a[13]!==f?(D=()=>{f.log(iP,{path:"breadcrumb"}),p.navigate({panes:x.slice(0,d.groupIndex)})},a[10]=d.groupIndex,a[11]=p,a[12]=x,a[13]=f,a[14]=D):D=a[14];let E=D;if(!T&&!C)return null;a[15]!==T||a[16]!==m?(n=T||m("panes.document-header-title.untitled.text"),a[15]=T,a[16]=m,a[17]=n):n=a[17],a[18]!==T||a[19]!==m?(i=T||m("panes.document-header-title.untitled.text"),a[18]=T,a[19]=m,a[20]=i):i=a[20],a[21]===i?l=a[22]:(l={content:i},a[21]=i,a[22]=l);let z=+(0!==c),B;return a[23]!==E||a[24]!==z||a[25]!==n||a[26]!==l?(B=(0,A.jsx)(o.a,{mode:"bleed",text:n,tooltipProps:l,onClick:E,paddingLeft:z}),a[23]=E,a[24]=z,a[25]=n,a[26]=l,a[27]=B):B=a[27],B}function iE(e){let t,n=(0,P.c)(7),{paneDataItems:i,currentPaneIndex:r}=e,l;if(n[0]!==r||n[1]!==i){let e;n[3]===r?e=n[4]:(e=(e,t)=>{if(t>r)return null;let n=e.pane!==s.r&&"document"===e.pane.type;return(0,A.jsxs)(d.Fragment,{children:[(0,A.jsx)(iA,{paneData:e,index:t}),t<r&&(n?(0,A.jsx)(E.lt,{padding:1,children:(0,A.jsx)(eS.ArrowRightIcon,{})}):(0,A.jsx)(E.et,{children:"/"}))]},`breadcrumb-item-${e.key}-${t}`)},n[3]=r,n[4]=e),l=i.map(e),n[0]=r,n[1]=i,n[2]=l}else l=n[2];return n[5]===l?t=n[6]:(t=(0,A.jsx)(E.at,{direction:"row",align:"center","data-testid":"document-header-breadcrumb",children:l}),n[5]=l,n[6]=t),t}function iz(){let e,t,n=(0,P.c)(23),{connectionState:i,schemaType:l,title:o,value:a,index:s}=e9(),{paneDataItems:d}=ik(),{title:c,error:u}=te(),{t:p}=(0,R.Bdt)(r.I),m;n[0]===d?m=n[1]:(m=d.some(iR),n[0]=d,n[1]=m);let h=m;if("connecting"===i&&!a){let e;return n[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(A.Fragment,{}),n[2]=e):e=n[2],e}if(o){let e;return n[3]===o?e=n[4]:(e=(0,A.jsx)(A.Fragment,{children:o}),n[3]=o,n[4]=e),e}if(!a){let e,t=l?.title||l?.name,i;return n[5]!==p||n[6]!==t?(i=p("panes.document-header-title.new.text",{schemaType:t}),n[5]=p,n[6]=t,n[7]=i):i=n[7],n[8]===i?e=n[9]:(e=(0,A.jsx)(A.Fragment,{children:i}),n[8]=i,n[9]=e),e}if(u){let e,t;return n[10]!==u||n[11]!==p?(e=p("panes.document-header-title.error.text",{error:u}),n[10]=u,n[11]=p,n[12]=e):e=n[12],n[13]===e?t=n[14]:(t=(0,A.jsx)(A.Fragment,{children:e}),n[13]=e,n[14]=t),t}return n[15]!==c||n[16]!==h||n[17]!==s||n[18]!==d||n[19]!==p?(e=h?(0,A.jsx)(iE,{paneDataItems:d,currentPaneIndex:s}):c||(0,A.jsx)("span",{style:{color:"var(--card-muted-fg-color)"},children:p("panes.document-header-title.untitled.text")}),n[15]=c,n[16]=h,n[17]=s,n[18]=d,n[19]=p,n[20]=e):e=n[20],n[21]===e?t=n[22]:(t=(0,A.jsx)(A.Fragment,{children:e}),n[21]=e,n[22]=t),t}function iR(e){return e.maximized}let iB=e=>{let t,n,i=(0,P.c)(16),l,a;i[0]===e?(l=i[1],a=i[2]):({documentExists:l,...a}=e,i[0]=e,i[1]=l,i[2]=a);let{isFavorited:s,isReady:d,favorite:c,unfavorite:u}=(0,R.$_6)(a),{t:p}=(0,R.Bdt)(r.I),m=s?"document.favorites.remove-from-favorites":"document.favorites.add-to-favorites",h;i[3]!==p||i[4]!==m?(h=p(m),i[3]=p,i[4]=m,i[5]=h):h=i[5];let f=h,x=s?u:c,g=!d||!l,b;return i[6]===f?b=i[7]:(b={content:(0,A.jsx)(E.et,{size:1,children:f}),placement:"right"},i[6]=f,i[7]=b),i[8]===s?t=i[9]:(t=(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(s?ek.StarFilledIcon:eC.StarIcon,{})}),i[8]=s,i[9]=t),i[10]!==f||i[11]!==x||i[12]!==g||i[13]!==b||i[14]!==t?(n=(0,A.jsx)(o.a,{mode:"bleed",onClick:x,disabled:g,"aria-label":f,"aria-live":"assertive",tooltipProps:b,children:t}),i[10]=f,i[11]=x,i[12]=g,i[13]=b,i[14]=t,i[15]=n):n=i[15],n},iO=(0,d.memo)(function(){let e=(0,P.c)(24),{editState:t,connectionState:n,views:i,documentId:l,displayed:s}=e9(),{features:d}=(0,a.t)(),{index:c,BackLink:u}=tc(),{activeWorkspace:p}=(0,R.VrO)(),m=i.length>1,{collapsed:h,isLast:f}=(0,a.r)(),x=f&&!h?-1:0,g=d.backButton&&c>0,{t:b}=(0,R.Bdt)(r.I),y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=(0,A.jsx)(iz,{}),e[0]=y):y=e[0];let j=y,v;e[1]===m?v=e[2]:(v=m&&(0,A.jsx)(iw,{}),e[1]=m,e[2]=v);let _=v,I;e[3]!==u||e[4]!==g||e[5]!==b?(I=g&&(0,A.jsx)(o.a,{as:u,"data-as":"a",icon:ew.ArrowLeftIcon,mode:"bleed",tooltipProps:{content:b("pane-header.back-button.text")}}),e[3]=u,e[4]=g,e[5]=b,e[6]=I):I=e[6];let w=I,S=s?._id??l,C=s?._type??"",k;e[7]!==p.dataset||e[8]!==p.projectId?(k=[p.projectId,p.dataset],e[7]=p.dataset,e[8]=p.projectId,e[9]=k):k=e[9];let T=k.join("."),D=(t?.ready&&(t.version??t.draft??t.published)!==null)??!1,E;e[10]!==p.dataset||e[11]!==p.name||e[12]!==p.projectId||e[13]!==S||e[14]!==C||e[15]!==T||e[16]!==D?(E=(0,A.jsx)(R.m2r,{capability:"comlink",condition:"available",children:(0,A.jsx)(iB,{resourceType:"studio",documentId:S,documentType:C,resourceId:T,schemaName:p.name,projectId:p.projectId,dataset:p.dataset,documentExists:D})}),e[10]=p.dataset,e[11]=p.name,e[12]=p.projectId,e[13]=S,e[14]=C,e[15]=T,e[16]=D,e[17]=E):E=e[17];let z=E,B="connecting"===n&&!t?.draft&&!t?.published,O;return e[18]!==w||e[19]!==z||e[20]!==B||e[21]!==x||e[22]!==_?(O=(0,A.jsx)(a.n,{loading:B,title:j,tabs:_,tabIndex:x,backButton:w,appendTitle:z}),e[18]=w,e[19]=z,e[20]=B,e[21]=x,e[22]=_,e[23]=O):O=e[23],O}),iN=(0,O.I4)(E.lt).withConfig({displayName:"DocumentBox",componentId:"sc-qe394w-0"})({position:"relative"}),iL=(0,O.I4)(R.PaW).withConfig({displayName:"Scroller",componentId:"sc-qe394w-1"})(({$disabled:e})=>e?{height:"100%"}:(0,O.AH)`height:100%;overflow:auto;position:relative;scroll-behavior:smooth;outline:none;`),i$=function(e){let t,n,i,r,l,o,c,u=(0,P.c)(85),{footerHeight:p,headerHeight:m,isInspectOpen:h,rootElement:f,setDocumentPanelPortalElement:x,footer:g}=e,{activeViewId:b,displayed:y,documentId:j,editState:v,inspector:_,value:I,views:w,ready:S,schemaType:C,permissions:k,isPermissionsLoading:T,targetDocumentState:D}
1=e9(),{params:B}=tc(),{collapsed:O}=(0,a.a)(),{collapsed:N}=(0,a.r)(),L=(0,E.M)(),{features:$}=(0,a.t)(),[M,H]=(0,d.useState)(null),[V,W]=(0,d.useState)(null),K=(0,d.useRef)(null),F=(0,R.hA9)(),J=I._createdAt?"update":"create",U;u[0]!==b||u[1]!==w?(U=w.find(e=>e.id===b)||w[0]||{type:"form"},u[0]=b,u[1]=w,u[2]=U):U=u[2];let Y=U,Q=$.splitPanes&&M||L.element,q;e:{let e;if(O){let e=m||0,t=p?p+2:2,n;u[3]!==e||u[4]!==t?(n=[e,0,t,0],u[3]=e,u[4]=t,u[5]=n):n=u[5],q=n;break e}u[6]===Symbol.for("react.memo_cache_sentinel")?(e=[0,0,2,0],u[6]=e):e=u[6],q=e}let G=q,X="form"!==Y.type,Z;u[7]!==Y.component||u[8]!==Y.options||u[9]!==Y.type||u[10]!==y||u[11]!==j||u[12]!==v?.draft||u[13]!==v?.published||u[14]!==C||u[15]!==I?(Z=()=>{if("component"===Y.type&&Y.component){let e=Y.component;return(0,A.jsx)(e,{document:{draft:v?.draft||null,displayed:y||I,historical:y,published:v?.published||null},documentId:j,options:Y.options,schemaType:C})}return!1},u[7]=Y.component,u[8]=Y.options,u[9]=Y.type,u[10]=y,u[11]=j,u[12]=v?.draft,u[13]=v?.published,u[14]=C,u[15]=I,u[16]=Z):Z=u[16],v?.draft,v?.published,u[17]===Z?t=u[18]:(t=Z(),u[17]=Z,u[18]=t);let ee=t,et=(0,d.useRef)(void 0),en,ei;u[19]!==j||u[20]!==V?(en=()=>{if(V?.scrollTo){if(void 0===et.current){et.current=j;return}et.current!==j&&(V.scrollTo(0,0),et.current=j)}},ei=[j,V],u[19]=j,u[20]=V,u[21]=en,u[22]=ei):(en=u[21],ei=u[22]),(0,d.useEffect)(en,ei),u[23]!==Q||u[24]!==x?(n=()=>{Q&&x(Q)},i=[Q,x],u[23]=Q,u[24]=x,u[25]=n,u[26]=i):(n=u[25],i=u[26]),(0,d.useEffect)(n,i),u[27]!==y||u[28]!==h||u[29]!==I?(r=h?(0,A.jsx)(R.wG1,{zOffset:"inspectorDialog",children:(0,A.jsx)(nN,{value:y||I})}):null,u[27]=y,u[28]=h,u[29]=I,u[30]=r):r=u[30];let er=r,el=!!(!N&&_),{selectedReleaseId:eo,selectedPerspectiveName:ea,selectedPerspective:es}=(0,R.QO2)(),ed=ea&&"ready"===D.status&&!!D.targetDocument,ec=B?.historyVersion,eu;u[31]!==y||u[32]!==j||u[33]!==ec?(eu={historyVersion:ec,displayed:y,documentId:j},u[31]=y,u[32]=j,u[33]=ec,u[34]=eu):eu=u[34];let ep=(0,R.LJ4)(eu),{isPaused:em}=(0,R.akJ)(),{data:eh}=(0,R.gJZ)(),ef;if(u[35]!==eh||u[36]!==ea){let e;u[38]===ea?e=u[39]:(e=e=>(0,R._hI)(e._id)===ea&&(0,R._9c)(e),u[38]=ea,u[39]=e),ef=eh.find(e),u[35]=eh,u[36]=ea,u[37]=ef}else ef=u[37];let ex=ef,eg;u[40]!==Y.type||u[41]!==ex||u[42]!==y||u[43]!==j||u[44]!==v||u[45]!==ep||u[46]!==ed||u[47]!==em||u[48]!==T||u[49]!==B?.historyVersion||u[50]!==k?.granted||u[51]!==S||u[52]!==J||u[53]!==C||u[54]!==es||u[55]!==ea||u[56]!==eo||u[57]!==D||u[58]!==I._id||u[59]!==F?(eg=()=>{let e=B?.historyVersion??(ex?(0,R._hI)(ex._id):void 0);if(e)return(0,A.jsx)(n$,{releaseId:e});let t=(0,R.Jrl)(es)&&(0,R.KJ$)(es),n=!!(t&&y?._id&&(0,R._Sr)(y?._id)===eo),i=(0,R.CW3)({selectedPerspective:es,isDraftModelEnabled:F.document.drafts.enabled,schemaType:C});if(function({isSelectedPerspectiveWriteable:e,editState:t}){return(0,R.cX9)(t)&&!e.result}({isSelectedPerspectiveWriteable:i,editState:v}))return!i.result&&(0,A.jsx)(nF,{schemaType:C,selectedPerspective:es,reason:i.reason});if(em&&y?._id)return(0,A.jsx)(id,{});if(n)return(0,A.jsx)(ih,{currentRelease:es});let r=[...ep.currentReleases,...ep.notCurrentReleases].find(iM),l=(0,R.sBy)(es);if("variant-missing"===D.status&&!D.creatableTarget)return(0,A.jsx)(nG,{});if("variant-definition-document-not-found"===D.status)return(0,A.jsx)(ig,{requestedVariantName:D.requestedVariantName});let o=v?.version&&(0,R.YW1)(v?.version);if(!(0,R.sBy)(es)&&y?._id&&ea&&!ed&&S&&!l&&!1===(0,R.cX9)(v)&&!o)return(0,A.jsx)(nq,{documentId:I._id,currentRelease:es,isScheduledRelease:t});let a=function({editState:e,workspace:t,schemaType:n}){if(!e?.ready)return{result:void 0};let i=null!==e.draft,{document:{drafts:{enabled:r}}}=t;return i?r?!0===n.liveEdit?{result:!0,reason:"LIVE_EDIT_ACTIVE"}:{result:!1}:{result:!0,reason:"DRAFT_MODEL_INACTIVE"}:{result:!1}}({editState:v,workspace:F,schemaType:C});if("form"===Y.type&&!eo&&a.result){if("DRAFT_MODEL_INACTIVE"===a.reason)return(0,A.jsx)(io,{displayed:y,documentId:j,schemaType:C,i18nKey:"banners.obsolete-draft.draft-model-inactive.text"});if("LIVE_EDIT_ACTIVE"===a.reason)return(0,A.jsx)(io,{displayed:y,documentId:j,schemaType:C,i18nKey:"banners.live-edit-draft-banner.text",isEditBlocking:!0})}if("form"!==Y.type||T)return null;let s=y?._id&&(0,R.R8D)(y._id);return(0,A.jsxs)(A.Fragment,{children:["drafts"===es&&r&&s&&(0,A.jsx)(im,{releaseId:r._id,draftDocument:y}),!k?.granted&&(0,A.jsx)(it,{requiredPermission:J}),(0,A.jsx)(ip,{}),(0,A.jsx)(ic,{}),(0,A.jsx)(nQ,{}),(0,A.jsx)(nW,{}),(0,A.jsx)(nJ,{}),(0,A.jsx)(ix,{}),(0,A.jsx)(ia,{documentId:y?._id??j,isPinnedDraftOrPublished:l})]})},u[40]=Y.type,u[41]=ex,u[42]=y,u[43]=j,u[44]=v,u[45]=ep,u[46]=ed,u[47]=em,u[48]=T,u[49]=B?.historyVersion,u[50]=k?.granted,u[51]=S,u[52]=J,u[53]=C,u[54]=es,u[55]=ea,u[56]=eo,u[57]=D,u[58]=I._id,u[59]=F,u[60]=eg):eg=u[60],B?.historyVersion,k?.granted,u[61]===eg?l=u[62]:(l=eg(),u[61]=eg,u[62]=l);let eb=l,ey;u[63]===V?ey=u[64]:(ey={documentScrollElement:V},u[63]=V,u[64]=ey);let ej=ey,ev=$.resizablePanes||!el,e_;return u[65]!==ee||u[66]!==eb||u[67]!==V||u[68]!==g||u[69]!==X||u[70]!==er||u[71]!==O||u[72]!==G||u[73]!==Q||u[74]!==ej||u[75]!==ev?(e_=ev&&(0,A.jsxs)(E.at,{height:"fill",direction:"column",flex:2,children:[(0,A.jsxs)(R.wG1,{zOffset:"paneHeader",children:[eb,(0,A.jsx)(iO,{})]}),(0,A.jsx)(iN,{flex:2,children:(0,A.jsx)(E.t,{element:Q,__unstable_elements:ej,children:(0,A.jsx)(z.EZ,{element:V,children:(0,A.jsxs)(R.jsZ,{scrollElement:V,containerElement:K,children:[(0,A.jsxs)(iL,{$disabled:O||!1,"data-testid":"document-panel-scroller",ref:W,children:[(0,A.jsx)(i_,{hidden:X,margins:G,ref:K}),ee]}),er,(0,A.jsx)("div",{"data-testid":"document-panel-portal",ref:H})]})})})}),g]}),u[65]=ee,u[66]=eb,u[67]=V,u[68]=g,u[69]=X,u[70]=er,u[71]=O,u[72]=G,u[73]=Q,u[74]=ej,u[75]=ev,u[76]=e_):e_=u[76],u[77]!==j||u[78]!==f||u[79]!==C||u[80]!==el?(o=el&&(0,A.jsx)(z.EZ,{element:f,children:(0,A.jsx)(nS,{documentId:j,documentType:C.name,flex:1})}),u[77]=j,u[78]=f,u[79]=C,u[80]=el,u[81]=o):o=u[81],u[82]!==e_||u[83]!==o?(c=(0,A.jsx)(s.i,{children:(0,A.jsxs)(E.at,{height:"fill",children:[e_,o]})}),u[82]=e_,u[83]=o,u[84]=c):c=u[84],c};function iM(e){return(0,R._9c)(e)&&((0,R.KJ$)(e)||(0,R.yk9)(e))}function iH(e){return e?e.toLocaleLowerCase().replaceAll(" ",""):""}i$.displayName="DocumentPanel";let iV={constrainSize:!0,placement:"left-start",portal:!0};function iW(e){let t,n,i,r,o=(0,P.c)(38),{disabled:a,isAfterGroup:s,node:d}=e,c=(0,R.Bvg)("i18n"in d?d:void 0);if("divider"===d.type){let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(E.f,{}
1),o[0]=e):e=o[0],e}o[1]!==c||o[2]!==d?(t=c(d),o[1]=c,o[2]=d,o[3]=t):t=o[3];let{title:u}=t;if("group"===d.type){let e,t,n;if(0===d.children.length)return null;if(d.expanded){let e,t,n,i;return o[4]===s?e=o[5]:(e=s&&(0,A.jsx)(E.f,{}),o[4]=s,o[5]=e),o[6]===u?t=o[7]:(t=u&&(0,A.jsx)(E.lt,{padding:3,paddingBottom:2,children:(0,A.jsx)(z.JU,{size:1,children:u})}),o[6]=u,o[7]=t),o[8]!==a||o[9]!==d.children||o[10]!==d.disabled?(n=d.children.map((e,t)=>(0,A.jsx)(iW,{disabled:a||!!d.disabled,isAfterGroup:d.children[t-1]?.type==="group",node:e},e.key)),o[8]=a,o[9]=d.children,o[10]=d.disabled,o[11]=n):n=o[11],o[12]!==e||o[13]!==t||o[14]!==n?(i=(0,A.jsxs)(A.Fragment,{children:[e,t,n]}),o[12]=e,o[13]=t,o[14]=n,o[15]=i):i=o[15],i}o[16]===s?e=o[17]:(e=s&&(0,A.jsx)(E.f,{}),o[16]=s,o[17]=e);let i=d.icon,r;return o[18]!==a||o[19]!==d.children||o[20]!==d.disabled?(r=d.children.map((e,t)=>(0,A.jsx)(iW,{disabled:a||!!d.disabled,isAfterGroup:d.children[t-1]?.type==="group",node:e},e.key)),o[18]=a,o[19]=d.children,o[20]=d.disabled,o[21]=r):r=o[21],o[22]!==a||o[23]!==d.icon||o[24]!==r||o[25]!==u?(t=(0,A.jsx)(l.n,{disabled:a,icon:i,popover:iV,text:u,children:r}),o[22]=a,o[23]=d.icon,o[24]=r,o[25]=u,o[26]=t):t=o[26],o[27]!==e||o[28]!==t?(n=(0,A.jsxs)(A.Fragment,{children:[e,t]}),o[27]=e,o[28]=t,o[29]=n):n=o[29],n}return o[30]===s?n=o[31]:(n=s&&(0,A.jsx)(E.f,{}),o[30]=s,o[31]=n),o[32]!==a||o[33]!==d?(i=(0,A.jsx)(iK,{disabled:a,node:d}),o[32]=a,o[33]=d,o[34]=i):i=o[34],o[35]!==n||o[36]!==i?(r=(0,A.jsxs)(A.Fragment,{children:[n,i]}),o[35]=n,o[36]=i,o[37]=r):r=o[37],r}function iK(e){let t,n=(0,P.c)(5),{node:i}=e;if(i.intent){let t;return n[0]!==i.intent||n[1]!==e?(t=(0,A.jsx)(iJ,{...e,intent:i.intent}),n[0]=i.intent,n[1]=e,n[2]=t):t=n[2],t}return n[3]===e?t=n[4]:(t=(0,A.jsx)(iF,{...e}),n[3]=e,n[4]=t),t}function iF(e){let t,n=(0,P.c)(19),{disabled:i,node:r}=e,l;n[0]===r.disabled?l=n[1]:(l="object"==typeof r.disabled&&(0,A.jsx)(E.et,{size:1,children:r.disabled.reason}),n[0]=r.disabled,n[1]=l);let a=l,{title:s}=(0,R.FP1)(r),d=r.selected&&!r.hideSelectionIndicator,c=i||!!r.disabled,u;n[2]===r.hotkey?u=n[3]:(u=r.hotkey?.split("+"),n[2]=r.hotkey,n[3]=u);let p=r.icon,m=r.iconRight||d&&eE.CheckmarkIcon,h=r.onAction,f=r.tone,x;n[4]===r.title?x=n[5]:(x=iH(r.title),n[4]=r.title,n[5]=x);let g=`action-${x}`,b;return n[6]!==r.icon||n[7]!==r.onAction||n[8]!==r.tone||n[9]!==d||n[10]!==c||n[11]!==u||n[12]!==m||n[13]!==g||n[14]!==s?(b=(0,A.jsx)(o.t,{disabled:c,hotkeys:u,icon:p,iconRight:m,onClick:h,pressed:d,text:s,tone:f,"data-testid":g}),n[6]=r.icon,n[7]=r.onAction,n[8]=r.tone,n[9]=d,n[10]=c,n[11]=u,n[12]=m,n[13]=g,n[14]=s,n[15]=b):b=n[15],n[16]!==b||n[17]!==a?(t=(0,A.jsx)(R.FUn,{content:a,placement:"left",children:b}),n[16]=b,n[17]=a,n[18]=t):t=n[18],t}function iJ(e){let t,n=(0,P.c)(23),{disabled:i,intent:r,node:l}=e,a;n[0]===l.disabled?a=n[1]:(a="object"==typeof l.disabled&&(0,A.jsx)(E.et,{size:1,children:l.disabled.reason}),n[0]=l.disabled,n[1]=a);let s=a,d;n[2]!==r.params||n[3]!==r.type?(d={intent:r.type,params:r.params},n[2]=r.params,n[3]=r.type,n[4]=d):d=n[4];let c=(0,ee.cQ)(d),u;n[5]!==c||n[6]!==l?(u=e=>{c.onClick(e),l.onAction()},n[5]=c,n[6]=l,n[7]=u):u=n[7];let p=u,{title:m}=(0,R.FP1)(l),h=l.selected&&!l.hideSelectionIndicator,f=i||!!l.disabled,x;n[8]===l.hotkey?x=n[9]:(x=l.hotkey?.split("+"),n[8]=l.hotkey,n[9]=x);let g=h?eE.CheckmarkIcon:void 0,b;return n[10]!==p||n[11]!==c.href||n[12]!==l.icon||n[13]!==l.tone||n[14]!==h||n[15]!==f||n[16]!==x||n[17]!==g||n[18]!==m?(b=(0,A.jsx)(o.t,{as:"a",disabled:f,hotkeys:x,href:c.href,icon:l.icon,iconRight:g,onClick:p,pressed:h,text:m,tone:l.tone}),n[10]=p,n[11]=c.href,n[12]=l.icon,n[13]=l.tone,n[14]=h,n[15]=f,n[16]=x,n[17]=g,n[18]=m,n[19]=b):b=n[19],n[20]!==b||n[21]!==s?(t=(0,A.jsx)(R.FUn,{content:s,placement:"left",children:b}),n[20]=b,n[21]=s,n[22]=t):t=n[22],t}let iU={constrainSize:!0,placement:"bottom",portal:!0};function iY(e,t){return e.some(e=>"item"===e.type&&e.tone===t||"group"===e.type&&iY(e.children,t))}function iQ(e){let t,n,i,r,l=(0,P.c)(13),{nodes:a,actionsNodes:s}=e,c=(0,d.useId)(),u=iY(a,"critical"),p=iY(a,"caution"),m=u?"critical":p?"caution":void 0,h;return l[0]===m?h=l[1]:(h=(0,A.jsx)(R.VJU,{tone:m,"data-testid":"pane-context-menu-button"}),l[0]=m,l[1]=h),l[2]===s?t=l[3]:(t=s&&(0,A.jsxs)(A.Fragment,{children:[s,(0,A.jsx)(E.f,{})]}),l[2]=s,l[3]=t),l[4]===a?n=l[5]:(n=a.map((e,t)=>(0,A.jsx)(iW,{isAfterGroup:a[t-1]?.type==="group",node:e},e.key)),l[4]=a,l[5]=n),l[6]!==t||l[7]!==n?(i=(0,A.jsxs)(E.p,{children:[t,n]}),l[6]=t,l[7]=n,l[8]=i):i=l[8],l[9]!==c||l[10]!==h||l[11]!==i?(r=(0,A.jsx)(o.r,{button:h,id:c,menu:i,popover:iU}),l[9]=c,l[10]=h,l[11]=i,l[12]=r):r=l[12],r}function iq(e){return e.disabled?{disabledReason:"object"==typeof e.disabled?e.disabled.reason:void 0,ariaLabel:"object"==typeof e.disabled&&"string"==typeof e.disabled?.reason?e.disabled.reason:"This is disabled",isDisabled:!!e.disabled}:{disabledReason:void 0,ariaLabel:void 0,isDisabled:!1}}function iG(e){let t=(0,P.c)(4),{node:n}=e;if("item"===n.type){let e;return t[0]===n?e=t[1]:(e=(0,A.jsx)(iX,{node:n}),t[0]=n,t[1]=e),e}if("group"===n.type){let e;return t[2]===n?e=t[3]:(e=(0,A.jsx)(i0,{node:n}),t[2]=n,t[3]=e),e}return console.warn('unknown menu node (expected `type: "item" | "group"`):',n),null}function iX(e){let t,n,i,r=(0,P.c)(23),{node:l}=e,{title:o}=(0,R.FP1)(l),{t:a}=(0,R.Bdt)();if(l.intent){let t;return r[0]!==l.intent||r[1]!==e?(t=(0,A.jsx)(iZ,{...e,intent:l.intent}),r[0]=l.intent,r[1]=e,r[2]=t):t=r[2],t}r[3]===l?t=r[4]:(t=iq(l),r[3]=l,r[4]=t);let{disabledReason:s,ariaLabel:d,isDisabled:c}=t,u;r[5]!==d||r[6]!==a||r[7]!==o?(u=d||o||a("status-button.aria-label"),r[5]=d,r[6]=a,r[7]=o,r[8]=u):u=r[8],r[9]!==c||r[10]!==l.hotkey?(n=!c&&l.hotkey?l.hotkey.split("+"):void 0,r[9]=c,r[10]=l.hotkey,r[11]=n):n=r[11];let p=c?s:o,m;return r[12]!==n||r[13]!==p?(m={hotkeys:n,content:p},r[12]=n,r[13]=p,r[14]=m):m=r[14],r[15]!==c||r[16]!==l.icon||r[17]!==l.onAction||r[18]!==l.selected||r[19]!==l.tone||r[20]!==u||r[21]!==m?(i=(0,A.jsx)(R.pfD,{disabled:c,icon:l.icon,onClick:l.onAction,selected:l.selected,tone:l.tone,"aria-label":u,tooltipProps:m}),r[15]=c,r[16]=l.icon,r[17]=l.onAction,r[18]=l.selected,r[19]=l.tone,r[20]=u,r[21]=m,r[22]=i):i=r[22],i}function iZ(e){let t,n,i=(0,P.c)(27),{intent:r,node:l}=e,o;i[0]!==r.params||i[1]!==r.type?(o={intent:r.type,params:r.params},i[0]=r.params,i[1]=r.type,i[2]=o):o=i[2];let a=(0,ee.cQ)(o),{t:s}=(0,R.Bdt)(),d;i[3]!==a||i[4]!==l?(d=e=>{a.onClick(e),l.onAction()},i[3]=a,i[4]=l,i[5]=d):d=i[5];let c=d,u;i[6]===l?u=i[7]:(u=iq(l),i[6]=l,i[7]=u);let{disabledReason:p,ariaLabel:m,isDisabled:h}=u,f;i[8]!==m||i[9]!==l.title||i[10]!==s?(f=m||l.title||s("status-button.aria-label"),i[8]=m,i[9]=l.title,i[10]=s,i[11]=f):f=i[11],i[12]!==h||i[13]!==l.hotkey?(t=!h&&l.hotkey?l.hotkey.split("+"):void 0,i[12]=h,i[13]=l.hotkey,i[14]=t):t=i[14];let x=h?p:l.title,g;return i[15]!==t||i[16]!==x?(g={hotkeys:t,content:x,placement:"bottom",portal:!0},i[15]=t,i[16]=x,i[17]=g):g=i[17],i[18]!==c||i[19]!==a.href||i[20]!==h||i[21]!==l.icon||i[22]!==l.selected||i[23]!==l.tone||i[24]!==f||i[25]!==g?(n=(0,A.jsx)(R.pfD,{forwardedAs:"a",disabled:h,href:a.href,icon:l.icon,onClick:c,selected:l.selected,tone:l.tone,"aria-label":f,tooltipProps:g}),i[18]=c,i[19]=a.href,i[20]=h,i[21]=l.icon,i[22]=l.selected,i[23]=l.tone,i[24]=f,i[25]=g,i[26]=n):n=i[26],n}function i0(e){let t,n,i,r=(0,P.c)(16),{node:l}=e,{title:a}=(0,R.FP1)(l),s=!!l.disabled,c=l.icon??M.UnknownIcon,u;r[0]===l.title?u=r[1]:(u={content:l.title,portal:!0},r[0]=l.title,r[1]=u),r[2]!==s||r[3]!==c||r[4]!==u||r[5]!==a?(t=(0,A.jsx)(o.a,{disabled:s,icon:c,label:a,mode:"bleed",tooltipProps:u}),r[2]=s,r[3]=c,r[4]=u,r[5]=a,r[6]=t):t=r[6];let p=(0,d.useId)(),m;return r[7]!==l.children||r[8]!==l.disabled?(m=l.children.map((e,t)=>(0,A.jsx)(iW,{disabled:!!l.disabled,isAfterGroup:l.children[t-1]?.type==="group",node:e},e.key)),r[7]=l.children,r[8]=l.disabled,r[9]=m):m=r[9],r[10]===m?n=r[11]:(n=(0,A.jsx)(E.p,{children:m}),r[10]=m,r[11]=n),r[12]!==t||r[13]!==p||r[14]!==n?(i=(0,A.jsx)(o.r,{button:t,id:p,menu:n}),r[12]=t,r[13]=p,r[14]=n,r[15]=i):i=r[15],i}let i1=(0,d.memo)(e=>{let t,n=(0,P.c)(4),{children:i,group:r}=e,l=(0,d.useContext)(B.Pq);if(null===l)throw Error("DocumentActionsStateContext is not set. This should not happen.");return n[0]!==i||n[1]!==r||n[2]!==l?(t=i({states:r?l.filter(e=>(e.group||["default"]).includes(r)):l}),n[0]=i,n[1]=r,n[2]=l,n[3]=t):t=n[3],t});i1.displayName="Memo(RenderActionCollectionState)";let i2=e=>{let t,n=(0,P.c)(28),{id:i,type:l,revision:o}=e,{revisionNotFound:a,targetDocumentState:s}=e9(),c="ready"===s.status,u;n[0]===s?u=n[1]:(u=(0,R.Uyl)(s),n[0]=s,n[1]=u);let{restore:p}=(0,R.QSs)(i,l,u),m=(0,R.cUp)(i,l),{navigateIntent:h}=(0,ee.rd)(),f=(0,d.useRef)(m),[x,g]=(0,d.useState)(!1),{t:b}=(0,R.Bdt)(r.I),y;n[2]!==p||n[3]!==o?(y=()=>{p.execute(o),g(!1)},n[2]=p,n[3]=o,n[4]=y):y=n[4];let j=y,v;n[5]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{g(!1)},n[5]=v):v=n[5];let _=v,I,w;
1n[6]!==m||n[7]!==i||n[8]!==h||n[9]!==l?(I=()=>{m&&m!==f.current&&("success"===m.type&&"restore"===m.op&&h("edit",{id:i,type:l}),f.current=m)},w=[m,i,h,l],n[6]=m,n[7]=i,n[8]=h,n[9]=l,n[10]=I,n[11]=w):(I=n[10],w=n[11]),(0,d.useEffect)(I,w),n[12]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{g(!0)},n[12]=t):t=n[12];let S=t,C;e:{if(x){let e,t;n[13]===b?e=n[14]:(e=b("action.restore.confirm.message"),n[13]=b,n[14]=e),n[15]!==j||n[16]!==e?(t={type:"confirm",tone:"critical",onCancel:_,onConfirm:j,message:e},n[15]=j,n[16]=e,n[17]=t):t=n[17],C=t;break e}C=null}let k=C,T="@initial"===o,D=void 0===o,A;t:{let e;if(D||a){A=null;break t}n[18]===b?e=n[19]:(e=b("action.restore.label"),n[18]=b,n[19]=e);let t=T?"action.restore.disabled.cannot-restore-initial":"action.restore.tooltip",i;n[20]!==b||n[21]!==t?(i=b(t),n[20]=b,n[21]=t,n[22]=i):i=n[22];let r=T||!c,l;n[23]!==k||n[24]!==i||n[25]!==r||n[26]!==e?(l={label:e,tone:"caution",onHandle:S,title:i,icon:ez.RevertIcon,dialog:k,disabled:r},n[23]=k,n[24]=i,n[25]=r,n[26]=e,n[27]=l):l=n[27],A=l}return A};function i3(e){return("item"===e.type||"group"===e.type)&&e.renderAsButton}i2.action="restore",i2.displayName="HistoryRestoreAction";let i4=(0,eR.A)(i3);function i5(e){let{fieldActions:t=[],menuItems:n,menuItemGroups:i}=e,r=[],l=0;for(let e=0;e<t.length;e+=1){let n=t[e];r.push(function e(t,n){return"divider"===t.type?{type:"divider",key:n}:"group"===t.type?{type:"group",key:n,children:t.children.map((t,i)=>e(t,`${n}-${i}-${t.type}`)),disabled:t.disabled,expanded:t.expanded??!0,icon:t.icon,title:t.title,i18n:t.i18n,renderAsButton:t.renderAsButton??!1}:{type:"item",key:n,intent:t.intent,disabled:t.disabled,icon:t.icon,iconRight:t.iconRight,onAction:t.onAction,renderAsButton:t.renderAsButton??!1,selected:t.selected,title:t.title,i18n:t.i18n,tone:t.tone}}(n,`${e}-${n.type}`))}l+=r.length;let o=[];for(let e of i)o.find(t=>t.key===e.id)||o.push({type:"group",key:e.id,children:[],expanded:!0,renderAsButton:!1,title:e.title,i18n:e.i18n});let a=[];for(let t=0;t<n.length;t+=1){let i=n[t],r=i.group&&o.find(e=>e.key===i.group),s="string"==typeof i.disabled?{reason:i.disabled}:i.disabled;i.group&&!r&&(r={type:"group",key:i.group,disabled:s,expanded:!0,icon:i.icon,title:i.group,children:[],renderAsButton:!1},o.push(r)),r?r.children.push({type:"item",key:`${l+t}-item`,hideSelectionIndicator:i.params?.hideSelectionIndicator===!0,hotkey:i.shortcut,icon:i.icon,intent:i.intent,disabled:s,onAction:()=>e.actionHandler(i),renderAsButton:i.showAsAction??!1,selected:i.selected,title:i.title,i18n:i.i18n,tone:i.tone}):a.push({type:"item",key:`${l+t}-item`,hideSelectionIndicator:i.params?.hideSelectionIndicator===!0,hotkey:i.shortcut,icon:i.icon,intent:i.intent,disabled:s,onAction:()=>e.actionHandler(i),renderAsButton:i.showAsAction??!1,selected:i.selected,title:i.title,i18n:i.i18n,tone:i.tone})}return[...a,...o,...r]}let i6=["left","bottom"],i7={small:0,medium:1,large:2,full:"auto"};function i8(e){let t,n,i=(0,P.c)(16),{dialog:o,referenceElement:a}=e,{t:s}=(0,R.Bdt)(r.I),{cancelButtonIcon:d,cancelButtonText:c,confirmButtonIcon:u,confirmButtonText:p,message:m,onCancel:h,onConfirm:f,tone:x}=o,g;return i[0]!==c||i[1]!==s?(g=c||s("confirm-dialog.cancel-button.fallback-text"),i[0]=c,i[1]=s,i[2]=g):g=i[2],i[3]!==p||i[4]!==s?(t=p||s("confirm-dialog.confirm-button.fallback-text"),i[3]=p,i[4]=s,i[5]=t):t=i[5],i[6]!==d||i[7]!==u||i[8]!==m||i[9]!==h||i[10]!==f||i[11]!==a||i[12]!==g||i[13]!==t||i[14]!==x?(n=(0,A.jsx)(l.t,{cancelButtonIcon:d,cancelButtonText:g,confirmButtonIcon:u,confirmButtonText:t,message:m,onCancel:h,onConfirm:f,open:!0,referenceElement:a,tone:x,placement:"top",fallbackPlacements:i6}),i[6]=d,i[7]=u,i[8]=m,i[9]=h,i[10]=f,i[11]=a,i[12]=g,i[13]=t,i[14]=x,i[15]=n):n=i[15],n}function i9(e){let t,n=(0,P.c)(12),{dialog:i}=e,r=(0,d.useId)(),l;n[0]===i.footer?l=n[1]:(l=i.footer&&(0,A.jsx)(E.lt,{paddingX:4,paddingY:3,children:i.footer}),n[0]=i.footer,n[1]=l);let o=l,a=!1===i.showCloseButton,s=void 0===i.width?1:i7[i.width],c;return n[2]===i.content?c=n[3]:(c=(0,A.jsx)(E.lt,{padding:4,children:i.content}),n[2]=i.content,n[3]=c),n[4]!==i.header||n[5]!==i.onClose||n[6]!==r||n[7]!==o||n[8]!==a||n[9]!==s||n[10]!==c?(t=(0,A.jsx)(R.wG1,{zOffset:"fullscreen",children:(0,A.jsx)(z.lG,{animate:!0,__unstable_hideCloseButton:a,footer:o,header:i.header,id:r,onClose:i.onClose,onClickOutside:i.onClose,width:s,children:c})}),n[4]=i.header,n[5]=i.onClose,n[6]=r,n[7]=o,n[8]=a,n[9]=s,n[10]=c,n[11]=t):t=n[11],t}function re(e){let t,n=(0,P.c)(5),{dialog:i,referenceElement:r}=e,l;return n[0]===i?l=n[1]:(l=(0,A.jsx)(rt,{dialog:i}),n[0]=i,n[1]=l),n[2]!==r||n[3]!==l?(t=(0,A.jsx)(E.k,{content:l,fallbackPlacements:i6,open:!0,placement:"top",portal:!0,preventOverflow:!0,referenceElement:r}),n[2]=r,n[3]=l,n[4]=t):t=n[4],t}function rt(e){let t,n,i=(0,P.c)(6),{dialog:r}=e,{content:l,onClose:o}=r,{isTopLayer:a}=(0,E.N)(),s=(0,d.useRef)(null),c;return i[0]!==a||i[1]!==o?(c=e=>{"Escape"===e.key&&a&&o()},i[0]=a,i[1]=o,i[2]=c):c=i[2],(0,E.v)(c),i[3]===Symbol.for("react.memo_cache_sentinel")?(t=()=>[s.current],i[3]=t):t=i[3],(0,E.y)(a&&o,t),i[4]===l?n=i[5]:(n=(0,A.jsx)("div",{ref:s,children:l}),i[4]=l,i[5]=n),n}function rn(e){let t=(0,P.c)(3),{children:n}=e,{element:i,elements:r}=(0,E.M)(),l=r?.documentPanelPortalElement||i,o;return t[0]!==n||t[1]!==l?(o=(0,A.jsx)(E.t,{element:l,children:n}),t[0]=n,t[1]=l,t[2]=o):o=t[2],o}function ri(e){let t,n,i=(0,P.c)(17),{dialog:r,referenceElement:o}=e,a=void 0===o?null:o,s=(0,d.useId)();if("confirm"===r.type){let e;return i[0]!==r||i[1]!==a?(e=(0,A.jsx)(i8,{dialog:r,referenceElement:a}),i[0]=r,i[1]=a,i[2]=e):e=i[2],e}if("popover"===r.type){let e;return i[3]!==r||i[4]!==a?(e=(0,A.jsx)(re,{dialog:r,referenceElement:a}),i[3]=r,i[4]=a,i[5]=e):e=i[5],e}if("dialog"===r.type||!r.type){let e;return i[6]===r?e=i[7]:(e=(0,A.jsx)(rn,{children:(0,A.jsx)(i9,{dialog:r})}),i[6]=r,i[7]=e),e}if("custom"===r.type){let e=r?.component,t;return i[8]===e?t=i[9]:(t=(0,A.jsx)(rn,{children:e}),i[8]=e,i[9]=t),t}return console.warn(`Unsupported modal type ${r.type}`),i[10]!==r.content||i[11]!==r.type?(t=r.content||(0,A.jsxs)(E.et,{size:1,children:["Unexpected modal type (",(0,A.jsx)("code",{children:r.type}),")"]}),i[10]=r.content,i[11]=r.type,i[12]=t):t=i[12],i[13]!==s||i[14]!==t||i[15]!==r.onClose?
1(n=(0,A.jsx)(l.i,{id:s,onClose:r.onClose,onClickOutside:r.onClose,width:1,children:t}),i[13]=s,i[14]=t,i[15]=r.onClose,i[16]=n):n=i[16],n}let rr=(0,d.memo)(function(e){let t,n=(0,P.c)(9),{actionStates:i,children:r,referenceElement:l}=e,[o,a]=(0,d.useState)(-1),s=i[o],c;n[0]===Symbol.for("react.memo_cache_sentinel")?(c=e=>{a(e)},n[0]=c):c=n[0];let u=c,p;n[1]===r?p=n[2]:(p=r({handleAction:u}),n[1]=r,n[2]=p);let m=p,h;return n[3]!==s||n[4]!==l?(h=s&&s.dialog&&(0,A.jsx)(R.wG1,{zOffset:"paneFooter",children:(0,A.jsx)(ri,{dialog:s.dialog,referenceElement:l})}),n[3]=s,n[4]=l,n[5]=h):h=n[5],n[6]!==m||n[7]!==h?(t=(0,A.jsxs)(A.Fragment,{children:[h,m]}),n[6]=m,n[7]=h,n[8]=t):t=n[8],t});function rl(e){let t=(0,P.c)(10),{actionStates:n,disabled:i}=e,l=(0,d.useId)(),[a,s]=(0,d.useState)(null),c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c={placement:"top-end",portal:!0,preventOverflow:!0},t[0]=c):c=t[0];let u=c,{t:p}=(0,R.Bdt)(r.I),m;t[1]!==n||t[2]!==i||t[3]!==l||t[4]!==p?(m=e=>{let{handleAction:t}=e;return(0,A.jsx)(o.r,{id:`${l}-action-menu`,button:(0,A.jsx)(R.VJU,{"aria-label":p("buttons.action-menu-button.aria-label"),disabled:i,"data-testid":"action-menu-button",tooltipProps:{content:p("buttons.action-menu-button.tooltip")}}),menu:(0,A.jsx)(E.p,{padding:1,children:n.map((e,n)=>(0,A.jsx)(ro,{actionState:e,disabled:i,index:n,onAction:t},n))}),popover:u,ref:s})},t[1]=n,t[2]=i,t[3]=l,t[4]=p,t[5]=m):m=t[5];let h=m,f;return t[6]!==n||t[7]!==a||t[8]!==h?(f=(0,A.jsx)(rr,{actionStates:n,referenceElement:a,children:h}),t[6]=n,t[7]=a,t[8]=h,t[9]=f):f=t[9],f}function ro(e){let t,n=(0,P.c)(20),{actionState:i,disabled:r,index:l,onAction:a}=e,{onHandle:s}=i,d;n[0]!==l||n[1]!==a||n[2]!==s?(d=()=>{a(l),s&&s()},n[0]=l,n[1]=a,n[2]=s,n[3]=d):d=n[3];let c=d,u;n[4]===i.shortcut?u=n[5]:(u=i.shortcut?String(i.shortcut).split("+").map(ra):void 0,n[4]=i.shortcut,n[5]=u);let p=u,m;n[6]===i.label?m=n[7]:(m=i.label.replace(" ",""),n[6]=i.label,n[7]=m);let h=`action-${m}`,f=r||!!i.disabled,x;return n[8]!==i.disabled||n[9]!==i.title?(x=i.disabled&&{tooltipProps:{content:i.title}},n[8]=i.disabled,n[9]=i.title,n[10]=x):x=n[10],n[11]!==i.icon||n[12]!==i.label||n[13]!==i.tone||n[14]!==c||n[15]!==p||n[16]!==h||n[17]!==f||n[18]!==x?(t=(0,A.jsx)(o.t,{"data-testid":h,disabled:f,hotkeys:p,icon:i.icon,onClick:c,text:i.label,tone:i.tone,...x}),n[11]=i.icon,n[12]=i.label,n[13]=i.tone,n[14]=c,n[15]=p,n[16]=h,n[17]=f,n[18]=x,n[19]=t):t=n[19],t}function ra(e){return e.slice(0,1).toUpperCase()+e.slice(1)}let rs=(0,G.g_)({name:"Document URL Copied",version:1,description:"User copied document URL to clipboard"}),rd=(0,G.g_)({name:"Document ID Copied",version:1,description:"User copied document ID to clipboard"}
1),rc=(0,G.g_)({name:"Inline Changes Switched On",version:1,description:"User switched on display of inline changes"}),ru=(0,G.g_)({name:"Inline Changes Switched Off",version:1,description:"User switched off display of inline changes"});function rp(){let e,t,n,i,l,a,s,d,c,u,p=(0,P.c)(43),{documentId:m,documentType:h,schemaType:f}=nv(),{editState:x}=e9(),g=(0,R.p_E)(m),b;p[0]===m?b=p[1]:(b={documentId:m},p[0]=m,p[1]=b);let{data:y,loading:j}=(0,R.gn8)(b),{selectedReleaseId:v,selectedPerspectiveName:_}=(0,R.QO2)(),{params:I}=tc(),{resolveIntentLink:w}=(0,ee.rd)(),{buildIntentUrl:S}=(0,R.HuN)(),{t:C}=(0,R.Bdt)(r.I),k=(0,q.Jr)(),{push:T}=(0,z.dj)(),D=I?.scheduledDraft;f?.liveEdit;e:{let t,n=D||v;if(n){let t;p[2]!==m||p[3]!==n?(t=(0,R.ctg)(m,n),p[2]=m,p[3]=n,p[4]=t):t=p[4],e=t;break e}if("published"===_||f?.liveEdit){e=m;break e}p[5]===m?t=p[6]:(t=(0,R.T4)(m),p[5]=m,p[6]=t),e=t}let B=e,O="variant-missing"===g.status||"variant-definition-document-not-found"===g.status,N=!!x?.ready&&!j&&(0,R.A_X)(B)&&!(0,R.cX9)(x)&&!y.includes(B),L;p[7]!==S||p[8]!==m||p[9]!==h||p[10]!==T||p[11]!==w||p[12]!==D||p[13]!==v||p[14]!==C||p[15]!==k?(L=async()=>{k.log(rs);let e=v&&!D?[["perspective",v]]:[],t=S(w("edit",{id:m,type:h,...D&&{scheduledDraft:D}},e));await navigator.clipboard.writeText(t),T({id:"copy-document-url",status:"info",title:C("panes.document-operation-results.operation-success_copy-url")})},p[7]=S,p[8]=m,p[9]=h,p[10]=T,p[11]=w,p[12]=D,p[13]=v,p[14]=C,p[15]=k,p[16]=L):L=p[16];let $=L,M;p[17]!==B||p[18]!==T||p[19]!==C||p[20]!==k?(M=async()=>{k.log(rd),await navigator.clipboard.writeText(B),T({id:"copy-document-id",status:"info",title:C("panes.document-operation-results.operation-success_copy-id")})},p[17]=B,p[18]=T,p[19]=C,p[20]=k,p[21]=M):M=p[21];let H=M;return O||N?null:(p[22]===C?t=p[23]:(t=C("action.copy-document-url.label"),p[22]=C,p[23]=t),p[24]===t?n=p[25]:(n=(0,A.jsx)(o.a,{icon:eO.ShareIcon,mode:"bleed",tooltipProps:{content:t},"data-testid":"copy-document-actions-button"}),p[24]=t,p[25]=n),p[26]===C?i=p[27]:(i=C("action.copy-link-to-document.label"),p[26]=C,p[27]=i),p[28]!==$||p[29]!==i?(l=(0,A.jsx)(o.t,{icon:eB.LinkIcon,onClick:$,text:i,"data-testid":"copy-link-to-document"}),p[28]=$,p[29]=i,p[30]=l):l=p[30],p[31]===C?a=p[32]:(a=C("action.copy-document-id.label"),p[31]=C,p[32]=a),p[33]!==H||p[34]!==a?(s=(0,A.jsx)(o.t,{icon:eN.TargetIcon,onClick:H,text:a,"data-testid":"copy-document-id"}),p[33]=H,p[34]=a,p[35]=s):s=p[35],p[36]!==l||p[37]!==s?(d=(0,A.jsxs)(E.p,{children:[l,s]}),p[36]=l,p[37]=s,p[38]=d):d=p[38],p[39]===Symbol.for("react.memo_cache_sentinel")?(c={portal:!0,placement:"bottom-end"},p[39]=c):c=p[39],p[40]!==d||p[41]!==n?(u=(0,A.jsx)(o.r,{id:"copy-document-actions",button:n,menu:d,popover:c}),p[40]=d,p[41]=n,p[42]=u):u=p[42],u)}let rm=(0,G.g_)({version:1,name:"Document Group Inventory Hint Pressed",description:"User opened the document group inventory by pressing the onboarding hint."}),rh=["studio","document-group-inventory","hint"],rf=["session-count"],rx=["has-displayed"],rg={readCount:async()=>{let e,t=localStorage.getItem(rb(rf));if(null===t)return 0;try{e=JSON.parse(t)}catch{return console.warn("Failed to parse:",t),0}return"number"==typeof e?e:0},writeCount:async e=>{localStorage.setItem(rb(rf),JSON.stringify(e))},readHasDisplayed:async()=>{let e,t=sessionStorage.getItem(rb(rx));if(null===t)return!1;try{e=JSON.parse(t)}catch{return console.warn("Failed to parse:",t),!1}return"boolean"==typeof e&&e},writeHasDisplayed:async e=>{sessionStorage.setItem(rb(rx),JSON.stringify(e))}};function rb(e){return rh.concat(e).join(".")}let ry=()=>{let e,t,n,i,l,o=(0,P.c)(12),{t:a}=(0,R.Bdt)(r.I),{setIsDocumentGroupInventoryActive:s}=e9(),d=(0,q.Jr)(),c;return(o[0]===Symbol.for("react.memo_cache_sentinel")?(c=function({readCount:e,writeCount:t,readHasDisplayed:n,writeHasDisplayed:i}){return(0,w.H)((0,h.z)([e(),n()])).pipe((0,y.T)(([e,t])=>{var n;return[e,-1===(n=e)||n>3?"inactive":"active",t]}),(0,S.M)(async([e,n,r])=>{"active"!==n||r||await Promise.all([t(e+1),i(!0)])}),(0,y.T)(([,e])=>e))}(rg),o[0]=c):c=o[0],"inactive"===(0,W.J2)(c))?null:(o[1]!==s||o[2]!==d?(e=async()=>{d.log(rm),s(!0),await function({writeCount:e}){return e(-1)}(rg)},o[1]=s,o[2]=d,o[3]=e):e=o[3],o[4]===Symbol.for("react.memo_cache_sentinel")?(t=(0,A.jsx)(V.InfoOutlineIcon,{}),o[4]=t):t=o[4],o[5]===a?n=o[6]:(n=a("document-group-inventory.onboarding-hint"),o[5]=a,o[6]=n),o[7]===n?i=o[8]:(i=(0,A.jsx)(E.et,{size:1,weight:"medium",children:(0,A.jsxs)(E.at,{gap:2,align:"center",flex:"none",justify:"flex-end",children:[t," ",n]})}),o[7]=n,o[8]=i),o[9]!==e||o[10]!==i?(l=(0,A.jsx)(rj,{onClick:e,children:i}),o[9]=e,o[10]=i,o[11]=l):l=o[11],l)}
1,rj=O.I4.button.withConfig({displayName:"TextButton",componentId:"sc-z5lwsu-0"})(({theme:e})=>(0,O.AH)`display:inline-block;vertical-align:middle;appearance:none;border:0;margin:0;padding:0;outline:none;all:unset;flex:none;white-space:nowrap;color:var(--card-badge-suggest-fg-color);cursor:pointer;*{color:inherit;}svg[data-sanity-icon]{color:currentColor;}`);function rv(e){let t,n,i=(0,P.c)(7),r,l;return i[0]===e?(r=i[1],l=i[2]):({ref:r,...l}=e,i[0]=e,i[1]=r,i[2]=l),i[3]===Symbol.for("react.memo_cache_sentinel")?(t=(0,A.jsx)("path",{d:"M10.5 3.78L17.22 10.5L10.5 17.22L3.78 10.5L10.5 3.78Z",stroke:"currentColor",strokeWidth:1.2,strokeLinejoin:"round"}),i[3]=t):t=i[3],i[4]!==r||i[5]!==l?(n=(0,A.jsx)("svg",{"data-sanity-icon":"rhombus",width:"1em",height:"1em",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l,ref:r,children:t}),i[4]=r,i[5]=l,i[6]=n):n=i[6],n}let r_=(0,O.I4)(E.W).withConfig({displayName:"TargetBadge",componentId:"sc-2brdlz-0"})`display:inline-flex;align-items:center;flex:none;`,rI=(0,O.I4)(E.at).withConfig({displayName:"BadgeContainer",componentId:"sc-2brdlz-1"})`user-select:none;flex:none;`,rw=(0,O.I4)(eL.PY1.div).withConfig({displayName:"BadgeMotionWrapper",componentId:"sc-2brdlz-2"})`flex:none;`,rS=(0,d.memo)(function(e){let t,n,i=(0,P.c)(20),{selectedPerspective:r}=e,{t:l}=(0,R.Bdt)();if((0,R.xo4)(r)||(0,R.o2j)(r)){let e,t;return i[0]!==r||i[1]!==l?(e=l((0,R.xo4)(r)?"release.chip.published":"release.chip.global.drafts"),i[0]=r,i[1]=l,i[2]=e):e=i[2],i[3]===e?t=i[4]:(t=(0,A.jsx)(rI,{padding:2,children:(0,A.jsx)(E.et,{size:1,weight:"medium",children:e})}),i[3]=e,i[4]=t),t}if((0,R.Jrl)(r)){let e,t,n,o;i[5]===r?e=i[6]:(e=(0,A.jsx)(R.YeQ,{release:r}),i[5]=r,i[6]=e);let a=r.metadata?.title,s;return i[7]===l?s=i[8]:(s=l("release.placeholder-untitled-release"),i[7]=l,i[8]=s),i[9]===Symbol.for("react.memo_cache_sentinel")?(t={size:1,weight:"medium"},i[9]=t):t=i[9],i[10]!==a||i[11]!==s?(n=(0,A.jsx)(R.Qfr,{title:a,fallback:s,enableTooltip:!1,textProps:t}),i[10]=a,i[11]=s,i[12]=n):n=i[12],i[13]!==e||i[14]!==n?(o=(0,A.jsxs)(rI,{gap:2,paddingY:1,paddingRight:2,align:"center",children:[e,n]}),i[13]=e,i[14]=n,i[15]=o):o=i[15],o}return i[16]===l?t=i[17]:(t=l("version.agent-bundle.proposed-changes"),i[16]=l,i[17]=t),i[18]===t?n=i[19]:(n=(0,A.jsx)(rI,{padding:2,children:(0,A.jsx)(E.et,{size:1,textOverflow:"ellipsis",weight:"medium",children:t})}),i[18]=t,i[19]=n),n}),rC=(0,d.memo)(function(e){let t,n,i=(0,P.c)(5),{variant:r}=e,l;return i[0]===Symbol.for("react.memo_cache_sentinel")?(l=(0,A.jsx)(E.et,{size:0,children:(0,A.jsx)(rv,{})}),i[0]=l):l=i[0],i[1]===r?t=i[2]:(t=(0,R.Ayf)(r),i[1]=r,i[2]=t),i[3]===t?n=i[4]:(n=(0,A.jsx)(rI,{padding:2,children:(0,A.jsxs)(E.at,{align:"center",gap:2,children:[l,(0,A.jsx)(E.et,{size:1,weight:"medium",children:t})]})}),i[3]=t,i[4]=n),n}),rk=(0,d.memo)(function(){let e,t,n,i,l,a,s,d,c=(0,P.c)(31),{targetDocumentState:u}=e9(),{bundle:p,selectedPerspective:m,selectedVariant:h}=(0,R.QO2)(),{t:f}=(0,R.Bdt)(r.I),x;c[0]!==p||c[1]!==u?(x=function(e,t){switch(e.status){case"resolving":default:return!1;case"variant-definition-document-not-found":case"variant-missing":return!0;case"ready":return!e.targetDocument&&!e.variant&&!(0,R.sBy)(t)}}(u,p),c[0]=p,c[1]=u,c[2]=x):x=c[2];let g=x,b=g?.5:1,y;c[3]!==h||c[4]!==u?(y="ready"===u.status||"variant-missing"===u.status?u.variant:h,c[3]=h,c[4]=u,c[5]=y):y=c[5];let j=y,v;c[6]===f?v=c[7]:(v=f("document-target-badges.not-in-target.tooltip"),c[6]=f,c[7]=v);let _=!g,I;return c[8]===b?I=c[9]:(I={opacity:b},c[8]=b,c[9]=I),c[10]===Symbol.for("react.memo_cache_sentinel")?(e={duration:.2},c[10]=e):e=c[10],c[11]===m?t=c[12]:(t=(0,R.o2j)(m)?"caution":(0,R.Y73)(m),c[11]=m,c[12]=t),c[13]===m?n=c[14]:(n=(0,A.jsx)(rS,{selectedPerspective:m}),c[13]=m,c[14]=n),c[15]!==t||c[16]!==n?(i=(0,A.jsx)(r_,{tone:t,border:!0,radius:4,"data-ui":"DocumentTargetPerspectiveBadge",children:n}),c[15]=t,c[16]=n,c[17]=i):i=c[17],c[18]!==I||c[19]!==i?(l=(0,A.jsx)(rw,{animate:I,transition:e,children:i}),c[18]=I,c[19]=i,c[20]=l):l=c[20],c[21]!==b||c[22]!==j?(a=j?(0,A.jsx)(rw,{animate:{o
1pacity:b},transition:{duration:.2},children:(0,A.jsx)(r_,{tone:"suggest",border:!0,radius:4,"data-ui":"DocumentTargetVariantBadge",children:(0,A.jsx)(rC,{variant:j})})}):null,c[21]=b,c[22]=j,c[23]=a):a=c[23],c[24]!==a||c[25]!==l?(s=(0,A.jsxs)(E.at,{align:"center",flex:"none",gap:2,paddingRight:1,children:[l,a]}),c[24]=a,c[25]=l,c[26]=s):s=c[26],c[27]!==s||c[28]!==v||c[29]!==_?(d=(0,A.jsx)(o.o,{content:v,disabled:_,children:s}),c[27]=s,c[28]=v,c[29]=_,c[30]=d):d=c[30],d});function rT(){let e,t,n,i=(0,P.c)(58),{selectedReleaseId:r,selectedPerspectiveName:l,selectedVariant:o,bundle:a}=(0,R.QO2)(),{params:s}=tc(),d=(0,R.I07)(),{editState:c,displayed:u}=e9(),{documentType:p,documentId:m}=nv(),h=u&&!u._createdAt,f=s?.historyVersion,x;i[0]!==u||i[1]!==m||i[2]!==f?(x={historyVersion:f,displayed:u,documentId:m},i[0]=u,i[1]=m,i[2]=f,i[3]=x):x=i[3];let g=(0,R.LJ4)(x),{byId:b}=(0,R.h_C)(),y;i[4]===m?y=i[5]:(y={documentId:m},i[4]=m,i[5]=y);let{versions:j,data:v}=(0,R.gn8)(y),_=v.length>0&&!v.some(rA),I=(0,R.hA9)(),{onSetScheduledDraftPerspective:w}=(0,R.B3H)(),S;i[6]!==w||i[7]!==s?.scheduledDraft?(S=()=>{s?.scheduledDraft&&w("")},i[6]=w,i[7]=s?.scheduledDraft,i[8]=S):S=i[8];let C=S,{navigate:k}=function(){let e=(0,P.c)(8),t=(0,R._T7)(),{params:n,setParams:i}=tc(),r=(0,R.Rcw)(),{onSetScheduledDraftPerspective:l}=(0,R.B3H)(),o;e[0]!==r||e[1]!==l||e[2]!==n||e[3]!==i||e[4]!==t?(o=e=>{if((0,R.Jrl)(e)&&(0,R._9c)(e))return void l((0,R._hI)(e._id));"published"===e&&n?.historyVersion&&i({...n,rev:n?.historyEvent||void 0,since:void 0,historyVersion:void 0});let o=(0,R.Jrl)(e)?(0,R._hI)(e._id):e===r?"":e;n?.scheduledDraft?i({...n,scheduledDraft:void 0},{perspective:o}):t(o)},e[0]=r,e[1]=l,e[2]=n,e[3]=i,e[4]=t,e[5]=o):o=e[5];let a=o,s;return e[6]===a?s=e[7]:(s={navigate:a},e[6]=a,e[7]=s),s}(),T;if(i[9]!==p||i[10]!==d){let e=d.get(p);T=!!e&&!0===e.liveEdit,i[9]=p,i[10]=d,i[11]=T}else T=i[11];let D=T;c?.published;e:{if(D&&!r){e=!1;break e}e=!c?.published}let A=e,E;i[12]!==u?._id||i[13]!==c?.version||i[14]!==s?(E=e=>{if(!s?.historyVersion){let t=c?.version&&(0,R.YW1)(c?.version)&&e===(0,R._Sr)(c?.version?._id);return{selected:!!(e===(0,R._Sr)(u?._id||"")||t)}}let t=e===s.historyVersion;return{selected:t,disabled:t}},i[12]=u?._id,i[13]=c?.version,i[14]=s,i[15]=E):E=i[15],c?.version,u?._id;let z=E;u?._id,c?.draft?._id;t:{if(D&&!c?.draft?._id&&!r||(0,R._4P)(u?._id||"")&&(0,R.xo4)(l||"")){t=!0;break t}t=!1}let B=t,O;i[16]!==u?._id||i[17]!==c?.published||i[18]!==B||i[19]!==s?.historyVersion||i[20]!==l?(O=()=>{let e=u?._id||"";return!(B||s?.historyVersion||l||(0,R.A_X)(e))&&(!!(0,R.R8D)(e)||!((0,R._4P)(e)&&c?.published&&(0,R.xo4)(l||"")))},i[16]=u?._id,i[17]=c?.published,i[18]=B,i[19]=s?.historyVersion,i[20]=l,i[21]=O):O=i[21],u?._id,c?.published,s?.historyVersion;let N=O();c?.draft;n:{if(_||h&&r){n=!0;break n}
1if(!c?.draft&&!D){n=!1;break n}if(h&&r||D){n=!0;break n}n=!1}let L=n,$=I.document.drafts?.enabled,{filteredVersionIds:M,getVersionDisplay:H}=(0,R.fOM)(v,l),V;if(i[22]!==j||i[23]!==M){let e;i[25]===M?e=i[26]:(e=e=>M.includes(e._id),i[25]=M,i[26]=e),V=j.filter(e),i[22]=j,i[23]=M,i[24]=V}else V=i[24];let W=V,K;i[27]!==H||i[28]!==b?(K=e=>{if(!e._system.variant)return H(e._id);let t=e._system.variant?._ref,n=t?b.get(t):void 0;return{displayName:`${n?(0,R.Ayf)(n):t??""} [${e._system.bundleId||"published"}]`,tone:e._system.bundleId?"caution":"positive"}},i[27]=H,i[28]=b,i[29]=K):K=i[29];let F=K,J;i[30]===W?J=i[31]:(J=W.filter(rP),i[30]=W,i[31]=J);let U=J,Y;i[32]===W?Y=i[33]:(Y=W.filter(rD),i[32]=W,i[33]=Y);let Q=Y,q=(0,R.HbI)(),G;i[34]!==q||i[35]!==b?(G=e=>{let t=e._system.variant?._ref,n=t?b.get(t):void 0,i=e._system.bundleId||"published";q({variantId:n?._id,perspective:i})},i[34]=q,i[35]=b,i[36]=G):G=i[36];let X=G,Z;if(i[37]!==a||i[38]!==j||i[39]!==F||i[40]!==o){i:{if(!o){Z=null;break i}let e=(0,R.Dum)({bundle:a,variant:o._id,documentVersions:j});if(e){Z=F(e);break i}Z=null}i[37]=a,i[38]=j,i[39]=F,i[40]=o,i[41]=Z}else Z=i[41];let ee=Z,et;return i[42]!==C||i[43]!==g||i[44]!==z||i[45]!==F||i[46]!==k||i[47]!==X||i[48]!==L||i[49]!==$||i[50]!==N||i[51]!==D||i[52]!==B||i[53]!==A||i[54]!==U||i[55]!==ee||i[56]!==Q?(et={filteredReleases:g,getVersionDisplay:F,getReleaseChipState:z,clearScheduledDraftPerspective:C,handlePerspectiveChange:k,isDraftDisabled:L,isDraftModelEnabled:$,isDraftSelected:N,isLiveEdit:D,isPublishedChipDisabled:A,isPublishSelected:B,nonReleaseVersions:U,variantVersions:Q,handleVariantSelectionChange:X,selectedVariantDisplay:ee},i[42]=C,i[43]=g,i[44]=z,i[45]=F,i[46]=k,i[47]=X,i[48]=L,i[49]=$,i[50]=N,i[51]=D,i[52]=B,i[53]=A,i[54]=U,i[55]=ee,i[56]=Q,i[57]=et):et=i[57],et}function rD(e){return!!e._system.variant}function rP(e){if((0,R._4P)(e._id)||(0,R.R8D)(e._id))return!1;let t=!!e._system.release,n=!!e._system.variant;return!t&&!n}function rA(e){return!(0,R.A_X)(e)}function rE(e){var t,n;let i,r,a,s,c,u,p,m,h,f,x=(0,P.c)(47),{nonReleaseVersions:g,selectedPerspective:b,onSelectBundle:y,onCopyToDraftsComplete:j,documentType:v,getVersionDisplay:_,releasesLoading:I,releases:w,mode:S}=e,{t:C}=(0,R.Bdt)(),[k,T]=(0,d.useState)(!1),[D,B]=(0,d.useState)(null),O;x[0]===b?O=x[1]:(O=e=>(0,R._Sr)(e._id)===b,x[0]=b,x[1]=O),x[2]!==g||x[3]!==O?(t=g,n=O,s=[-1===(i=t.findIndex(n))?void 0:t[i],-1===i?t:t.slice(0,i).concat(t.slice(i+1))],x[2]=g,x[3]=O,x[4]=s):s=x[4];let[L,$]=s,M=(0,d.useRef)(null),H,V;if(x[5]===Symbol.for("react.memo_cache_sentinel")?(H=e=>{e.target&&"matches"in e.target&&"function"==typeof e.target.matches&&e.target.matches("[data-portal] *")||T(!1)},V=()=>[M.current],x[5]=H,x[6]=V):(H=x[5],V=x[6]),(0,E.y)(H,V),0===g.length)return null;if(x[7]!==v||x[8]!==_||x[9]!==j||x[10]!==y||x[11]!==w||x[12]!==I||x[13]!==L?(c=L&&(r=(0,R._Sr)(L._id),a=_(L),(0,A.jsx)(R.FCT,{selected:!0,text:a?.displayName??r,tone:a?.tone??"default",onClick:()=>y(L),onCopyToDraftsComplete:j,contextValues:{documentGroupId:(0,R.IMx)(L._id),versionId:L._id,releases:w,releasesLoading:I,documentType:v,bundleId:r,isVersion:!0}},L._id)),x[7]=v,x[8]=_,x[9]=j,x[10]=y,x[11]=w,x[12]=I,x[13]=L,x[14]=c):c=x[14],x[15]!==S||x[16]!==k||x[17]!==$.length||x[18]!==C?(u=$.length>0?(0,A.jsx)(o.o,{content:C(`release.chip.tooltip.other-${S}`,{count:$.length}),fallbackPlacements:[],portal:!0,placement:k?"top":"bottom",children:(0,A.jsx)(R.vu3,{mode:"bleed",fontSize:1,muted:!0,selected:k,iconRight:k?eM.ChevronUpIcon:N.ChevronDownIcon,ref:B,onClick:()=>T(rz),text:C(`release.chip.button.other-${S}`,{count:$.length})})}):null,x[15]=S,x[16]=k,x[17]=$.length,x[18]=C,x[19]=u):u=x[19],x[20]!==v||x[21]!==_||x[22]!==j||x[23]!==y||x[24]!==$||x[25]!==w||x[26]!==I||x[27]!==b){let e;x[29]!==v||x[30]!==_||x[31]!==j||x[32]!==y||x[33]!==w||x[34]!==I||x[35]!==b?(e=e=>{let t=e._system.scopeId,n=b===t,i=_(e);return(0,A.jsx)(R.FCT,{selected:n,text:i?.displayName??t,disabled:!1,contextMenuPortal:!1,tone:i?.tone??"default",onClick:()=>y(e),onCopyToDraftsComplete:j,contextValues:{documentGroupId:(0,R.IMx)(e._id),versionId:e._id,releases:w,releasesLoading:I,documentType:v,bundleId:t,isVersion:!0}},e._id)},x[29]=v,x[30]=_,x[31]=j,x[32]=y,x[33]=w,x[34]=I,x[35]=b,x[36]=e):e=x[36],p=$.map(e),x[20]=v,x[21]=_,x[22]=j,x[23]=y,x[24]=$,x[25]=w,x[26]=I,x[27]=b,x[28]=p}else p=x[28];return x[37]===p?m=x[38]:(m=(0,A.jsx)(z.mc,{width:1,children:(0,A.jsx)(E.at,{padding:3,gap:2,wrap:"wrap",children:p})}),x[37]=p,x[38]=m),x[39]!==k||x[40]!==D||x[41]!==m?(h=(0,A.jsx)(l.r,{animate:!1,open:k,portal:!0,arrow:!0,ref:M,placement:"bottom",referenceElement:D,zOffset:10,content:m}),x[39]=k,x[40]=D,x[41]=m,x[42]=h):h=x[42],x[43]!==c||x[44]!==u||x[45]!==h?(f=(0,A.jsxs)(A.Fragment,{children:[c,u,h]}),x[43]=c,x[44]=u,x[45]=h,x[46]=f):f=x[46],f}function rz(e){return!e}let rR=e=>{let t=(0,P.c)(17),{release:n}=e,{t:i}=(0,R.Bdt)(),r=(0,R.sfL)();if("archived"===n.state){let e,n;return t[0]===i?e=t[1]:(e=i("release.chip.tooltip.archived"),t[0]=i,t[1]=e),t[2]===e?n=t[3]:(n=(0,A.jsx)(E.et,{size:1,children:e}),t[2]=e,t[3]=n),n}if("asap"===n.metadata.releaseType){let e,n;return t[4]===i?e=t[5]:(e=i("release.type.asap"),t[4]=i,t[5]=e),t[6]===e?n=t[7]:(n=(0,A.jsx)(E.et,{size:1,children:e}),t[6]=e,t[7]=n),n}if("scheduled"===n.metadata.releaseType){let e="active"===n.state,l;return t[8]!==r||t[9]!==e||t[10]!==n||t[11]!==i?(l=n.metadata.intendedPublishAt&&(0,A.jsx)(E.et,{size:1,children:e?(0,A.jsx)(R.HTc,{t:i,i18nKey:"release.chip.tooltip.intended-for-date",values:{date:r(n)}}):(0,A.jsx)(R.HTc,{t:i,i18nKey:"release.chip.tooltip.scheduled-for-date",values:{date:r(n)}})}),t[8]=r,t[9]=e,t[10]=n,t[11]=i,t[12]=l):l=t[12],l}if("undecided"===n.metadata.releaseType){let e,n;return t[13]===i?e=t[14]:(e=i("release.type.undecided"),t[13]=i,t[14]=e),t[15]===e?n=t[16]:(n=(0,A.jsx)(E.et,{size:1,children:e}),t[15]=e,t[16]=n),n}return null},rB={dateStyle:"medium",timeStyle:"short"},rO=(0,d.memo)(function(){let e,t,n,i,r,l,o,a,s=(0,P.c)(50),{selectedPerspectiveName:d}=(0,R.QO2)(),{t:c}=(0,R.Bdt)(),u=(0,R.ixk)(rB),{loading:p}=(0,R.K0D)(),{editState:m,displayed:h,documentId:f}=e9(),{documentType:x}=nv(),g=(0,R.IMx)(f),{filteredReleases:b,getVersionDisplay:y,getReleaseChipState:j,clearScheduledDraftPerspective:v,handlePerspectiveChange:_,handleVariantSelectionChange:I,isDraftDisabled:w,variantVersions:S,isDraftModelEnabled:C,isDraftSelected:k,isLiveEdit:T,isPublishedChipDisabled:D,isPublishSelected:z,nonReleaseVersions:B,selectedVariantDisplay:O}=rT(),N;return s[0]!==u||s[1]!==m?.published||s[2]!==c?(N=(0,A.jsx)(E.et,{size:1,children:m?.published&&m?.published?._updatedAt?(0,A.jsx)(R.HTc,{t:c,i18nKey:"release.chip.tooltip.published-date",values:{date:u.format(new Date(m?.published._updatedAt))}}):(0,A.jsx)(A.Fragment,{children:c("release.chip.tooltip.not-published")})}
1),s[0]=u,s[1]=m?.published,s[2]=c,s[3]=N):N=s[3],s[4]===_?e=s[5]:(e=()=>_("published"),s[4]=_,s[5]=e),s[6]===c?t=s[7]:(t=c("release.chip.published"),s[6]=c,s[7]=t),s[8]!==v||s[9]!==g||s[10]!==x||s[11]!==b.inCreation||s[12]!==b.notCurrentReleases||s[13]!==p||s[14]!==c?(n=b.inCreation&&(0,A.jsx)(R.Qfr,{title:b.inCreation.metadata.title,fallback:c("release.placeholder-untitled-release"),enableTooltip:!1,children:e=>{let{displayTitle:t,fullTitle:n,isTruncated:i}=e;return(0,A.jsx)(R.FCT,{tooltipContent:i?(0,A.jsxs)(E.O,{gap:2,style:{maxWidth:"300px"},children:[(0,A.jsx)(E.et,{size:1,weight:"medium",children:n}),(0,A.jsx)(rR,{release:b.inCreation})]}):(0,A.jsx)(rR,{release:b.inCreation}),selected:!0,onClick:rN,locked:!1,tone:(0,R.Y73)(b.inCreation),text:t,onCopyToDraftsComplete:v,contextValues:{documentGroupId:g,versionId:(0,R.ctg)(g,(0,R._hI)(b.inCreation._id)),documentType:x,disabled:!0,releases:b.notCurrentReleases,releasesLoading:p,bundleId:(0,R._hI)(b.inCreation._id),isVersion:!0,release:b.inCreation}})}}),s[8]=v,s[9]=g,s[10]=x,s[11]=b.inCreation,s[12]=b.notCurrentReleases,s[13]=p,s[14]=c,s[15]=n):n=s[15],s[16]!==v||s[17]!==h||s[18]!==g||s[19]!==x||s[20]!==m?.version||s[21]!==b.currentReleases||s[22]!==b.notCurrentReleases||s[23]!==j||s[24]!==_||s[25]!==p||s[26]!==c?(i=h&&b.currentReleases?.map(e=>(0,A.jsx)(R.Qfr,{title:e.metadata.title,fallback:c("release.placeholder-untitled-release"),enableTooltip:!1,children:t=>{let{displayTitle:n,fullTitle:i,isTruncated:r}=t;return(0,A.jsx)(R.FCT,{tooltipContent:r?(0,A.jsxs)(E.O,{gap:2,style:{maxWidth:"300px"},children:[(0,A.jsx)(E.et,{size:1,weight:"medium",children:i}),(0,A.jsx)(rR,{release:e})]}):(0,A.jsx)(rR,{release:e}),...j((0,R._hI)(e._id)),onClick:()=>_(e),text:n,tone:(0,R.Y73)(e),locked:(0,R.KJ$)(e),onCopyToDraftsComplete:v,contextValues:{documentGroupId:g,versionId:(0,R.ctg)(g,(0,R._hI)(e._id)),documentType:x,releases:b.notCurrentReleases,releasesLoading:p,bundleId:(0,R._hI)(e._id),isVersion:!0,release:e,isGoingToUnpublish:!!m?.version&&(0,R.YW1)(m?.version)}})}},e._id)),s[16]=v,s[17]=h,s[18]=g,s[19]=x,s[20]=m?.version,s[21]=b.currentReleases,s[22]=b.notCurrentReleases,s[23]=j,s[24]=_,s[25]=p,s[26]=c,s[27]=i):i=s[27],s[28]===_?r=s[29]:(r=e=>{_(e._system.scopeId)},s[28]=_,s[29]=r),s[30]!==v||s[31]!==x||s[32]!==b.notCurrentReleases||s[33]!==y||s[34]!==p||s[35]!==B||s[36]!==d||s[37]!==r?(l=(0,A.jsx)(rE,{nonReleaseVersions:B,selectedPerspective:d,onSelectBundle:r,onCopyToDraftsComplete:v,releases:b.notCurrentReleases,releasesLoading:p,documentType:x,getVersionDisplay:y,mode:"versions"}),s[30]=v,s[31]=x,s[32]=b.notCurrentReleases,s[33]=y,s[34]=p,s[35]=B,s[36]=d,s[37]=r,s[38]=l):l=s[38],s[39]===O?o=s[40]:(o=O?(0,A.jsx)(R.vu3,{selected:!0,tone:O.tone,mode:"bleed",text:O.displayName}):null,s[39]=O,s[40]=o),s[41]!==v||s[42]!==x||s[43]!==b.notCurrentReleases||s[44]!==y||s[45]!==I||s[46]!==p||s[47]!==d||s[48]!==S?(a=S.length>0?(0,A.jsx)(rE,{nonReleaseVersions:S,selectedPerspective:d,onSelectBundle:I,onCopyToDraftsComplete:v,releases:b.notCurrentReleases,releasesLoading:p,documentType:x,getVersionDisplay:y,mode:"variants"}):null,s[41]=v,s[42]=x,s[43]=b.notCurrentReleases,s[44]=y,s[45]=I,s[46]=p,s[47]=d,s[48]=S,s[49]=a):a=s[49],(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(R.FCT,{tooltipContent:N,disabled:D,onClick:e,selected:z,text:t,tone:"positive",onCopyToDraftsComplete:v,contextValues:{documentGroupId:g,versionId:(0,R.IMx)(g),releases:b.notCurrentReleases,releasesLoading:p,documentType:x,bundleId:"published",isVersion:!1,disabled:!m?.published}}),C&&(0,A.jsx)(R.FCT,{tooltipContent:(0,A.jsx)(E.et,{size:1,children:m?.draft?(0,A.jsx)(A.Fragment,{children:m?.draft._updatedAt?(0,A.jsx)(R.HTc,{t:c,i18nKey:"release.chip.tooltip.edited-date",values:{date:u.format(new Date(m?.draft._updatedAt))}}):(0,A.jsx)(R.HTc,{t:c,i18nKey:"release.chip.tooltip.created-date",values:{date:u.format(new Date(m?.draft._createdAt))}})}):(0,A.jsx)(A.Fragment,{children:c(T?"release.chip.tooltip.draft-disabled.live-edit":"release.chip.tooltip.no-edits")})}),selected:k,disabled:w,text:c("release.chip.draft"),tone:m?.draft?"caution":"neutral",onClick:()=>_("drafts"),onCopyToDraftsComplete:v,contextValues:{documentGroupId:g,versionId:m?.draft?._id??m?.published?._id??(0,R.T4)(g),documentType:x,releases:b.notCurrentReleases,releasesLoading:p,bundleId:"draft",isVersion:!1}}),n,i,l,o,a]})});function rN(){}let rL=(0,O.I4)(E.W).withConfig({displayName:"HorizontalScroller",componentId:"sc-o3i8xm-0"})(e=>{let t=(0,eA.i)(e.theme);return(0,O.AH)`scrollbar-width:none;z-index:1;flex:1;position:relative;> div{&::-webkit-scrollbar{width:0;height:0;}}${e.$showGradient&&(0,O.AH)`&::after{content:'';display:block;position:absolute;top:0;right:0;bottom:0;width:150px;background:linear-gradient(to right,${(0,eA.l)(t.color.bg,0)},var(--card-bg-color));transition:'opacity 300ms ease-out';pointer-events:none;}`}`}),r$=(0,d.memo)(function(e){let t=(0,P.c)(46),{ref:n,menuItems:i}=e,{editState:l,onMenuAction:s,onPaneClose:c,onPaneSplit:u,onSetMaximizedPane:p,menuItemGroups:m,schemaType:h,connectionState:f,views:x,unstable_languageFilter:g,documentId:b}=e9(),{features:y}=(0,a.t)(),{beta:j}=(0,R.hA9)(),{index:v,BackLink:_,hasGroupSiblings:I}=tc(),{maximizedPane:w}=ik(),{actions:S}=(0,R.vM8)(),[C,k]=(0,d.useState)(null),T=(0,d.useRef)(null),D=function(e){let t=(0,P.c)(3),[n,i]=(0,d.useState)(!1),r,l;return t[0]===e?(r=t[1],l=t[2]):(r=()=>{let t=()=>{let t=e.current;if(!t)return;let{scrollWidth:n,clientWidth:r}=t;if(!(n>r))return void i(!1);let{scrollLeft:l}=t;i(!(l+r>=n))},{intersectionObserver:n,mutationObserver:r}=function(){t();let n=e.current;if(!n)return{intersectionObserver:null,mutationObserver:null};let r=new IntersectionObserver(e=>{let t=e[0];t&&i(!t.isIntersecting)}),l=()=>{r.disconnect();let e=n.children[n.children.length-1];r.observe(e)};l();let o=new MutationObserver(()=>{l(),t()});return o.observe(n,{childList:!0,subtree:!1}),{intersectionObserver:r,mutationObserver:o}}();return()=>{n?.disconnect(),r?.disconnect()}},l=[e],t[0]=e,t[1]=r,t[2]=l),(0,d.useEffect)(r,l),n}(T),z=(0,q.Jr)(),B=(0,R.YKH)(),O=Array.isArray(B.paneHeader)?B.paneHeader[1]:B.paneHeader,N;t[0]!==S||t[1]!==m||t[2]!==i||t[3]!==s?(N=i5({actionHandler:s,fieldActions:S,menuItems:i,menuItemGroups:m}),t[0]=S,t[1]=m,t[2]=i,t[3]=s,t[4]=N):N=t[4];let L=N,$;t[5]===L?$=t[6]:($=L.filter(i3),t[5]=L,t[6]=$);let M=$,H;t[7]===L?H=t[8]:(H=L.filter(i4),t[7]=L,t[8]=H);let V=H,W=j?.documentGroupInventory?.enabled===!0,{collapsed:K,isLast:F}=(0,a.r)(),J=F&&!K?-1:0,U=y.splitViews&&u&&x.length>1,Q=U&&I,G=y.backButton&&v>0,X=!Q&&!G&&!!_,{t:Z}=(0,R.Bdt)(r.I),ee=(0,R.cVB)(b),et;t[9]===ee?et=t[10]:(et=ee.filter(rV),t[9]=ee,t[10]=et);let en=et,ei=w?.pane&&"object"==typeof w.pane&&"document"===w.pane.type&&w.pane.options.id===b,er;t[11]!==ei||t[12]!==p||t[13]!==z?(er=()=>{p?.(),ei?z.log(iD):z.log(iT)},t[11]=ei,t[12]=p,t[13]=z,t[14]=er):er=t[14];let el=er,eo;t[15]===Symbol.for("react.memo_cache_sentinel")?(eo=(0,A.jsx)(iz,{}),t[15]=eo):eo=t[15];let ea=eo,es;t[16]!==_||t[17]!==G||t[18]!==Z?(es=G&&(0,A.jsx)(o.a,{as:_,"data-as":"a",icon:ew.ArrowLeftIcon,mode:"bleed",tooltipProps:{content:Z("pane-header.back-button.text")}}
1),t[16]=_,t[17]=G,t[18]=Z,t[19]=es):es=t[19];let ed=es,ec;return t[20]!==_||t[21]!==ed||t[22]!==K||t[23]!==f||t[24]!==V||t[25]!==en||t[26]!==l||t[27]!==el||t[28]!==W||t[29]!==ei||t[30]!==M||t[31]!==c||t[32]!==u||t[33]!==p||t[34]!==O||t[35]!==n||t[36]!==C||t[37]!==h||t[38]!==D||t[39]!==X||t[40]!==U||t[41]!==Q||t[42]!==Z||t[43]!==J||t[44]!==g?(ec=(0,A.jsx)(o.i,{children:K?(0,A.jsx)(a.n,{border:!0,ref:n,loading:"connecting"===f&&!l?.draft&&!l?.published,title:ea,tabIndex:J,backButton:ed}):(0,A.jsx)(E.W,{hidden:K,style:{lineHeight:0,position:"relative",zIndex:O},borderBottom:!0,children:(0,A.jsxs)(E.at,{gap:3,paddingY:3,justify:"space-between",align:"center",children:[!W&&(0,A.jsx)(rL,{$showGradient:D,children:(0,A.jsx)(E.at,{flex:1,gap:1,overflow:"auto",paddingX:3,"data-testid":"document-perspective-list",ref:T,children:(0,A.jsx)(rO,{})})}),W&&(0,A.jsx)(rL,{$showGradient:!1,children:(0,A.jsxs)(E.at,{flex:1,gap:2,align:"center",overflow:"auto",paddingX:3,"data-testid":"document-target-badges",style:{minWidth:0},children:[(0,A.jsx)(E.lt,{flex:"none",children:(0,A.jsx)(rk,{})}),(0,A.jsx)(E.lt,{flex:"none",children:(0,A.jsx)(ry,{})})]})}),(0,A.jsx)(E.lt,{flex:"none",paddingRight:3,children:(0,A.jsxs)(E.at,{align:"center",gap:1,children:[en.length>0&&(0,A.jsx)(E.lt,{"data-testid":"document-level-presence",marginRight:2,children:(0,A.jsx)(R.al0,{presence:en,stack:!0})}),g.length>0&&(0,A.jsx)(A.Fragment,{children:g.map((e,t)=>(0,A.jsx)(e,{schemaType:h},`language-filter-${t}`))}),(0,A.jsx)(rp,{}),M.map(rW),l&&(0,A.jsx)(i1,{group:"paneActions",children:e=>{let{states:t}=e;return(0,A.jsx)(rM,{contextMenuNodes:V,setReferenceElement:k,referenceElement:C,states:t})}}),U&&(0,A.jsx)(o.a,{"aria-label":Z("buttons.split-pane-button.aria-label"),icon:eP.SplitVerticalIcon,mode:"bleed",onClick:u,tooltipProps:{content:Z("buttons.split-pane-button.tooltip")}},"split-pane-button"),p&&(0,A.jsx)(o.a,{"aria-label":Z(ei?"buttons.focus-pane-button.aria-label.collapse":"buttons.focus-pane-button.aria-label.focus"),icon:ei?eT.CollapseIcon:eD.ExpandIcon,mode:"bleed",onClick:el,tooltipProps:{content:Z(ei?"buttons.focus-pane-button.tooltip.collapse":"buttons.focus-pane-button.tooltip.focus")},"data-testid":ei?"focus-pane-button-collapse":"focus-pane-button-focus"},"focus-pane-button"),Q&&(0,A.jsx)(o.a,{icon:Y.CloseIcon,mode:"bleed",onClick:c,tooltipProps:{content:Z("buttons.split-pane-close-button.title")}},"close-view-button"),X&&(0,A.jsx)(o.a,{icon:Y.CloseIcon,mode:"bleed",tooltipProps:{content:Z("buttons.split-pane-close-group-button.title")},as:_},"close-view-button")]})})]})})}),t[20]=_,t[21]=ed,t[22]=K,t[23]=f,t[24]=V,t[25]=en,t[26]=l,t[27]=el,t[28]=W,t[29]=ei,t[30]=M,t[31]=c,t[32]=u,t[33]=p,t[34]=O,t[35]=n,t[36]=C,t[37]=h,t[38]=D,t[39]=X,t[40]=U,t[41]=Q,t[42]=Z,t[43]=J,t[44]=g,t[45]=ec):ec=t[45],ec}),rM=(0,d.memo)(function(e){let t,n=(0,P.c)(7),{setReferenceElement:i,referenceElement:r,contextMenuNodes:l}=e,o=(0,d.useDeferredValue)(e.states),a;return n[0]===o?a=n[1]:(a=o.filter(rK),n[0]=o,n[1]=a),n[2]!==l||n[3]!==r||n[4]!==i||n[5]!==a?(t=(0,A.jsx)(rH,{setReferenceElement:i,referenceElement:r,contextMenuNodes:l,states:a}),n[2]=l,n[3]=r,n[4]=i,n[5]=a,n[6]=t):t=n[6],t}),rH=(0,d.memo)(function(e){let t=(0,P.c)(8),{states:n,setReferenceElement:i,contextMenuNodes:r,referenceElement:l}=e,o;t[0]!==r||t[1]!==i||t[2]!==n?(o=e=>{let{handleAction:t}=e;return(0,A.jsx)("div",{ref:i,children:(0,A.jsx)(iQ,{nodes:r,actionsNodes:n.length>0?n.map((e,n)=>(0,A.jsx)(ro,{actionState:e,disabled:!!e.disabled,index:n,onAction:t},e.label)):void 0},"context-menu")})},t[0]=r,t[1]=i,t[2]=n,t[3]=o):o=t[3];let a=o,s;return t[4]!==l||t[5]!==a||t[6]!==n?(s=(0,A.jsx)(rr,{actionStates:n,referenceElement:l,children:a}),t[4]=l,t[5]=a,t[6]=n,t[7]=s):s=t[7],s});function rV(e){return 0===e.path.length}function rW(e){return(0,A.jsx)(iG,{node:e},e.key)}function rK(e){return!e.action||e.action!==i2.action}let rF=(0,d.memo)(function(e){let t,n=(0,P.c)(26),i,r,l,o,a,s,d,c,u,p;n[0]===e?(i=n[1],r=n[2],l=n[3],o=n[4],a=n[5],s=n[6],d=n[7],c=n[8],u=n[9],p=n[10]):({actionsBoxElement:i,activeIndex:r,as:p,children:l,id:o,onActionStart:a,onKeyDown:s,rootRef:c,states:u,...d}=e,n[0]=e,n[1]=i,n[2]=r,n[3]=l,n[4]=o,n[5]=a,n[6]=s,n[7]=d,n[8]=c,n[9]=u,n[10]=p);let m=void 0===p?"div":p,h=u[r],f;n[11]!==a||n[12]!==s||n[13]!==u?(f=e=>{let t=u.filter(t=>t.shortcut&&(0,es.v_)(t.shortcut,e)),n=t[0];if(t.length>1&&console.warn(`Keyboard shortcut conflict: More than one document action matches the shortcut "${n.shortcut}"`),n&&!n.disabled&&n.onHandle){e.preventDefault(),n.onHandle(),a(u.indexOf(n));return}s&&s(e)},n[11]=a,n[12]=s,n[13]=u,n[14]=f):f=n[14];let x=f,g;return n[15]!==i||n[16]!==h?(g=h&&h.dialog&&(0,A.jsx)(R.wG1,{zOffset:"paneFooter",children:(0,A.jsx)(ri,{dialog:h.dialog,referenceElement:i})}),n[15]=i,n[16]=h,n[17]=g):g=n[17],n[18]!==m||n[19]!==l||n[20]!==x||n[21]!==o||n[22]!==d||n[23]!==c||n[24]!==g?(t=(0,A.jsxs)(m,{id:o,onKeyDown:x,tabIndex:-1,...d,ref:c,children:[l,g]}),n[18]=m,n[19]=l,n[20]=x,n[21]=o,n[22]=d,n[23]=c,n[24]=g,n[25]=t):t=n[25],t}),rJ=(0,d.memo)(e=>{let t=(0,P.c)(12),n,i,r,l;t[0]===e?(n=t[1],i=t[2],r=t[3],l=t[4]):({actionsBoxElement:n,as:l,children:i,...r}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=l);let o=void 0===l?"div":l,[a,s]=(0,d.useState)(-1),c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=e=>{s(e)},t[5]=c):c=t[5];let u=c,p;return t[6]!==n||t[7]!==a||t[8]!==o||t[9]!==i||t[10]!==r?(p=(0,A.jsx)(i1,{children:e=>{let{states:t}=e;return(0,A.jsx)(rF,{...r,activeIndex:a,actionsBoxElement:n,as:o,onActionStart:u,states:t,children:i})}}),t[6]=n,t[7]=a,t[8]=o,t[9]=i,t[10]=r,t[11]=p):p=t[11],p});rJ.displayName="Memo(DocumentActionShortcuts)";let rU=()=>{let e=(0,P.c)(1),t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,A.jsx)(eE.CheckmarkIcon,{style:{visibility:"hidden"}}),e[0]=t):t=e[0],t};function rY(e){let t,n,i,r,l,o,a=(0,P.c)(23),{documentType:s,value:d,currentMinWidth:c,paneKey:u,minWidth:p}=e,{t:m}=(0,R.Bdt)(),h;return a[0]===s?h=a[1]:(h={documentType:s},a[0]=s,a[1]=h),a[2]!==m||a[3]!==h?(t=(0,A.jsx)(R.HTc,{t:m,i18nKey:"panes.document-pane.document-unknown-type.title",values:h}),a[2]=m,a[3]=h,a[4]=t):t=a[4],a[5]!==s||a[6]!==m?(n=s&&(0,A.jsx)(E.et,{as:"p",children:(0,A.jsx)(R.HTc,{t:m,i18nKey:"panes.document-pane.document-unknown-type.text",values:{documentType:s}})}),a[5]=s,a[6]=m,a[7]=n):n=a[7],a[8]!==s||a[9]!==m?(i=!s&&(0,A.jsx)(E.et,{as:"p",children:m("panes.document-pane.document-unknown-type.without-schema.text")}),a[8]=s,a[9]=m,a[10]=i):i=a[10],a[11]===d?r=a[12]:(r=R.Cu5&&d&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(E.et,{as:"p",children:"Here is the JSON representation of the document:"}),(0,A.jsx)(E.W,{padding:3,overflow:"auto",radius:2,shadow:1,tone:"inherit",children:(0,A.jsx)(z.Cy,{language:"json",size:[1,1,2],children:JSON.stringify(d,null,2)})})]}),a[11]=d,a[12]=r),a[13]!==n||a[14]!==i||a[15]!==r?(l=(0,A.jsxs)(E.O,{gap:4,children:[n,i,r]}),a[13]=n,a[14]=i,a[15]=r,a[16]=l):l=a[16],a[17]!==c||a[18]!==p||a[19]!==u||a[20]!==t||a[21]!==l?(o=(0,A.jsx)(nl,{currentMinWidth:c,flex:2.5,minWidth:p,paneKey:u,title:t,tone:"caution",children:l}),a[17]=c,a[18]=p,a[19]=u,a[20]=t,a[21]=l,a[22]=o):o=a[22],o}let rQ=(0,O.I4)(E._).withConfig({displayName:"Root",componentId:"sc-olseyq-0"})`position:sticky;bottom:0;`,rq=(0,O.I4)(E.W).withConfig({displayName:"RootCard",componentId:"sc-olseyq-1"})`padding-bottom:env(safe-area-inset-bottom);`;function rG(e){let t,n=(0,P.c)(7),{ref:i,children:r,padding:l}=e,{collapsed:o}=(0,a.r)(),s;return n[0]!==r||n[1]!==l?(s=(0,A.jsx)(rq,{tone:"inherit",children:(0,A.jsx)(E.lt,{padding:l,children:r})}),n[0]=r,n[1]=l,n[2]=s):s=n[2],n[3]!==o||n[4]!==i||n[5]!==s?(t=(0,A.jsx)(R.wG1,{zOffset:"paneFooter",children:(0,A.jsx)(rQ,{"data-testid":"pane-footer",hidden:o,ref:i,children:s})}),n[3]=o,n[4]=i,n[5]=s,n[6]=t):t=n[6],t}function rX(e){let t,n=(0,P.c)(3),{size:i}=e,r;return n[0]===Symbol.for("react.memo_cache_sentinel")?(r={pointerEvents:"none",visibility:"hidden",
1width:0},n[0]=r):r=n[0],n[1]===i?t=n[2]:(t=(0,A.jsx)(o.a,{"aria-hidden":!0,disabled:!0,size:i,style:r,text:"-"}),n[1]=i,n[2]=t),t}let rZ=(0,d.memo)(e=>{let t=(0,P.c)(4),{badges:n,children:i,badgeProps:r}=e,l;return t[0]!==r||t[1]!==n||t[2]!==i?(l=(0,A.jsx)(R.N6R,{hooks:n,args:r,children:i}),t[0]=r,t[1]=n,t[2]=i,t[3]=l):l=t[3],l});rZ.displayName="Memo(RenderBadgeCollectionState)";let r0={primary:"primary",success:"positive",warning:"caution",danger:"critical"},r1=(0,d.memo)(function(e){let t,n,i=(0,P.c)(4),{states:r}=e;return 0===r.length?null:(i[0]===r?t=i[1]:(t=r.map(r5),i[0]=r,i[1]=t),i[2]===t?n=i[3]:(n=(0,A.jsx)(E.g,{gap:1,children:t}),i[2]=t,i[3]=n),n)}),r2=(0,d.memo)(function(e){let t=(0,P.c)(2),n=(0,d.useDeferredValue)(e.states),i;return t[0]===n?i=t[1]:(i=(0,A.jsx)(r1,{states:n}),t[0]=n,t[1]=i),i});function r3(){let e,t=(0,P.c)(3),{badges:n,editState:i}=e9();return i&&n?(t[0]!==n||t[1]!==i?(e=(0,A.jsx)(rZ,{badges:n,badgeProps:i,children:r4}),t[0]=n,t[1]=i,t[2]=e):e=t[2],e):null}function r4(e){let{states:t}=e;return(0,A.jsx)(r2,{states:t})}function r5(e,t){return(0,A.jsx)(o.o,{content:e.title,disabled:!e.title,placement:"top",portal:!0,children:(0,A.jsx)(z.Ex,{fontSize:1,paddingX:2,paddingY:1,radius:4,tone:e.color?r0[e.color]:void 0,style:{whiteSpace:"nowrap"},children:e.label})},`${e.label}-${t}`)}let r6={DocTitle:tt,ReferencePreviewLink:tp,VersionsPreviewList:tf},r7=(0,d.memo)(function(e){let t,n,i,r,l=(0,P.c)(58),{disabled:a,states:s}=e,{__internal_tasks:c,beta:u}=(0,R.For)(),{displayed:p,editState:m,isDocumentGroupInventoryActive:h,setIsDocumentGroupInventoryActive:f,documentId:x,documentType:g}=e9(),{params:b}=tc(),y=!!b?.rev,j=rT(),v=(0,R.tH7)(R.miu),_=(0,R.q3J)(),I;l[0]!==v||l[1]!==x||l[2]!==_?(I=tv({documentId:x,versionedClient:v,documentStore:_}),l[0]=v,l[1]=x,l[2]=_,l[3]=I):I=l[3];let w=I,S;l[4]===f?S=l[5]:(S=()=>f(!1),l[4]=f,l[5]=S);let C=S,{selectedReleaseId:k}=(0,R.QO2)(),T,D;l[6]===s?(T=l[7],D=l[8]):([T,...D]=s,l[6]=s,l[7]=T,l[8]=D);let[z,B]=(0,d.useState)(null),{isPaused:O}=(0,R.akJ)(),N=u?.documentGroupInventory?.enabled===!0,L;e:{let e,t,n,i;if(!T||!T.title&&!T.shortcut){L=null;break e}l[9]===Symbol.for("react.memo_cache_sentinel")?(e={maxWidth:300},l[9]=e):e=l[9],l[10]===T.title?t=l[11]:(t=T.title&&(0,A.jsx)(E.et,{size:1,children:T.title}),l[10]=T.title,l[11]=t),l[12]===T.shortcut?n=l[13]:(n=T.shortcut&&(0,A.jsx)(R.qW3,{"data-testid":"document-status-bar-hotkeys",fontSize:1,style:{marginTop:-4,marginBottom:-4},keys:String(T.shortcut).split("+").map(lr)}),l[12]=T.shortcut,l[13]=n),l[14]!==t||l[15]!==n?(i=(0,A.jsxs)(E.at,{style:e,align:"center",gap:3,children:[t,n]}),l[14]=t,l[15]=n,l[16]=i):i=l[16],L=i}let $=L,M=T?.action==="schedule"&&O,H;l[17]!==m?.liveEdit||l[18]!==m?.version||l[19]!==T||l[20]!==k||l[21]!==M||l[22]!==y?(H=y?!!T:k?T&&(M||!(0,R.UYh)(T)):T&&(!m?.liveEdit||m?.version),l[17]=m?.liveEdit,l[18]=m?.version,l[19]=T,l[20]=k,l[21]=M,l[22]=y,l[23]=H):H=l[23];let V=H,W;l[24]!==T||l[25]!==D||l[26]!==V?(W=V?D:[T,...D].filter(Boolean),l[24]=T,l[25]=D,l[26]=V,l[27]=W):W=l[27];let K=W,F;l[28]!==p?._id||l[29]!==m?(F=m?.version&&(0,R.YW1)(m?.version)?m.version._id:p?._id,l[28]=p?._id,l[29]=m,l[30]=F):F=l[30];let J=F,U=c&&c.footerAction,Y;return l[31]!==g||l[32]!==N||l[33]!==h||l[34]!==j||l[35]!==w||l[36]!==C||l[37]!==f||l[38]!==J?(Y=N&&void 0!==J&&(0,A.jsx)(R.Nhh,{documentId:J,portalElementName:"documentPanelPortalElement",isDocumentGroupInventoryActive:h,setIsDocumentGroupInventoryActive:f,children:(0,A.jsx)(R.NE$,{documentId:J,documentType:g,portalElementName:"documentPanelPortalElement",perspectiveList:j,referringDocuments$:w,requestClose:C,components:r6})}),l[31]=g,l[32]=N,l[33]=h,l[34]=j,l[35]=w,l[36]=C,l[37]=f,l[38]=J,l[39]=Y):Y=l[39],l[40]!==a||l[41]!==T||l[42]!==V||l[43]!==$?(t=V&&(0,A.jsx)(E.P,{zOffset:200,children:(0,A.jsx)(o.o,{disabled:!$,content:$,placement:"top",children:(0,A.jsx)(E.O,{children:(0,A.jsx)(o.a,{"data-testid":`action-${iH(T.label)}`,disabled:a||!!T.disabled,icon:T.icon,onClick:T.onHandle,ref:B,text:T.label,tone:T.tone||"primary"})})})}),l[40]=a,l[41]=T,l[42]=V,l[43]=$,l[44]=t):t=l[44],l[45]!==a||l[46]!==K?(n=K.length>0&&(0,A.jsx)(rl,{actionStates:K,disabled:a}),l[45]=a,l[46]=K,l[47]=n):n=l[47],l[48]!==z||l[49]!==T||l[50]!==V?(i=V&&T&&T.dialog&&(0,A.jsx)(ri,{dialog:T.dialog,referenceElement:z}),l[48]=z,l[49]=T,l[50]=V,l[51]=i):i=l[51],l[52]!==i||l[53]!==U||l[54]!==Y||l[55]!==t||l[56]!==n?(r=(0,A.jsxs)(E.at,{align:"center",gap:3,children:[U,Y,t,n,i]}),l[52]=i,l[53]=U,l[54]=Y,l[55]=t,l[56]=n,l[57]=r):r=l[57],r}),r8=(0,d.memo)(function(){let e=(0,P.c)(1),t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,A.jsx)(i1,{group:"default",children:ll}),e[0]=t):t=e[0],t});function r9(e){let t=(0,P.c)(6),{connectionState:n,documentId:i}=e9(),r;t[0]===e.states?r=t[1]:(r=e.states.filter(le),t[0]=e.states,t[1]=r);let l=r;if(0===l.length)return null;let o="connected"!==n,a;return t[2]!==i||t[3]!==l||t[4]!==o?(a=(0,A.jsx)(r7,{disabled:o,states:l},i),t[2]=i,t[3]=l,t[4]=o,t[5]=a):a=t[5],a}function le(e){return!e.action||e.action!==i2.action}let lt=(0,d.memo)(function(){let e=(0,P.c)(1),t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,A.jsx)(i1,{group:"default",children:lo}),e[0]=t):t=e[0],t});function ln(e){let t,n=(0,P.c)(8),{states:i}=e,{connectionState:r,editState:l,revisionId:o}=e9(),a;n[0]!==l?.draft||n[1]!==l?.published?(a=l?.draft||l?.published||{},n[0]=l?.draft,n[1]=l?.published,n[2]=a):a=n[2];let s=a._rev===o,d="connected"!==r||!!s,c;return n[3]===i?c=n[4]:(c=i.filter(li).slice(-1),n[3]=i,n[4]=c),n[5]!==d||n[6]!==c?(t=(0,A.jsx)(r7,{disabled:d,states:c}
1),n[5]=d,n[6]=c,n[7]=t):t=n[7],t}function li(e){return!!e.action&&e.action===i2.action}function lr(e){return e.slice(0,1).toUpperCase()+e.slice(1).toLowerCase()}function ll(e){let{states:t}=e;return(0,A.jsx)(r9,{states:t})}function lo(e){let{states:t}=e;return(0,A.jsx)(ln,{states:t})}let la={initial:"timeline.operation.created-initial",create:"timeline.operation.created",publish:"timeline.operation.published",editLive:"timeline.operation.edited-live",editDraft:"timeline.operation.edited-draft",unpublish:"timeline.operation.unpublished",discardDraft:"timeline.operation.draft-discarded",delete:"timeline.operation.deleted"},ls=(0,O.I4)(eL.PY1.path).withConfig({displayName:"StyledMotionPath",componentId:"sc-j78tsp-0"})`transform-origin:center;`,ld=e=>{let t=(0,P.c)(2),n;return t[0]===e?n=t[1]:(n=(0,A.jsx)(eL.PY1.circle,{fill:"none",r:"8",cx:"12.5",cy:"12.5",strokeWidth:"1.2",...e}),t[0]=e,t[1]=n),n},lc=e=>{let t=(0,P.c)(2),n;return t[0]===e?n=t[1]:(n=(0,A.jsx)(ls,{fill:"none",d:"M14 17.5619L11.5 20.5L14.5 23.0619M11 7.43811L13.5 4.50001L10.5 1.93811",...e}),t[0]=e,t[1]=n),n},lu=e=>{let t=(0,P.c)(2),n;return t[0]===e?n=t[1]:(n=(0,A.jsx)(eL.PY1.path,{d:"M9.5 12.1316L11.7414 14.5L16 10",...e}),t[0]=e,t[1]=n),n},lp=(0,O.i7)`0%{transform:rotate(0);}100%{transform:rotate(360deg);}`,lm=O.I4.g.withConfig({displayName:"RotateGroup",componentId:"sc-j78tsp-1"})`transform-origin:center;&[data-rotate]{animation:${lp} 1s ease-in-out infinite;}`,lh={syncing:{scale:1,transition:{duration:0}},saved:{scale:[1,.8,1.2,.9,1.1,.95,1.05,.99,1],transition:{duration:.5,delay:.2}},changes:{transition:{duration:0}}},lf={syncing:{strokeDasharray:"0, 0, 23, 3, 23, 3",strokeDashoffset:10,opacity:1,transition:{duration:0}},saved:{strokeDasharray:"0, 0, 23, 0, 23, 0",strokeDashoffset:10,opacity:1,transition:{duration:.2}},changes:{strokeDasharray:"0, 60, 23, 0, 23, 0",strokeDashoffset:0,opacity:0,transition:{duration:.5}}},lx={syncing:{opacity:1,transition:{duration:0}},saved:{opacity:0,transition:{duration:.2}},changes:{opacity:0}},lg={syncing:{pathLength:0,transition:{duration:0}},saved:{pathLength:1,transition:{delay:.4,duration:.3}},changes:{pathLength:0,transition:{duration:.2}}};function lb(e){let t,n,i,r=(0,P.c)(13),{status:l}=e;if(!l)return null;let o="changes"===l?void 0:"",a,s;return r[0]===l?(a=r[1],s=r[2]):(a=(0,A.jsx)(lc,{variants:lx,initial:l,animate:l}),s=(0,A.jsx)(ld,{variants:lf,initial:l,animate:l}),r[0]=l,r[1]=a,r[2]=s),r[3]!==o||r[4]!==a||r[5]!==s?(t=(0,A.jsxs)(lm,{"data-rotate":o,children:[a,s]}),r[3]=o,r[4]=a,r[5]=s,r[6]=t):t=r[6],r[7]===l?n=r[8]:(n=(0,A.jsx)(lu,{variants:lg,initial:l,animate:l}),r[7]=l,r[8]=n),r[9]!==l||r[10]!==t||r[11]!==n?(i=(0,A.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 25 25",fill:"none",stroke:"currentColor",strokeWidth:"1.2","data-sanity-icon":"animated-status-icon",children:(0,A.jsxs)(eL.PY1.g,{variants:lh,initial:l,animate:l,children:[t,n]})}),r[9]=l,r[10]=t,r[11]=n,r[12]=i):i=r[12],i}let ly={saved:{i18nKey:"status-bar.document-status-pulse.status.saved.text",tone:"positive"},syncing:{i18nKey:"status-bar.document-status-pulse.status.syncing.text",tone:"default"}},lj=e=>{let t,n,i,l,o=(0,P.c)(13),{status:a}=e,{t:s}=(0,R.Bdt)(r.I);if("saved"!==a&&"syncing"!==a)return null;let d=ly[a],c;return o[0]===a?c=o[1]:(c=(0,A.jsx)(lb,{status:a}),o[0]=a,o[1]=c),o[2]!==d.tone||o[3]!==c?(t=(0,A.jsx)(R.SxK,{size:1,tone:d.tone,children:c}),o[2]=d.tone,o[3]=c,o[4]=t):t=o[4],o[5]!==d.i18nKey||o[6]!==s?(n=s(d.i18nKey),o[5]=d.i18nKey,o[6]=s,o[7]=n):n=o[7],o[8]===n?i=o[9]:(i=(0,A.jsx)(E.et,{muted:!0,size:1,children:n}),o[8]=n,o[9]=i),o[10]!==t||o[11]!==i?(l=(0,A.jsxs)(E.at,{align:"center",gap:2,"data-testid":"pane-footer-document-status-pulse",children:[t,i]}),o[10]=t,o[11]=i,o[12]=l):l=o[12],l},lv={minimal:!0,useTemporalPhrase:!0},l_=eL.PY1.create(E.Y),lI=eL.PY1.create(E.lt);function lw(e){return"timeline.operation.published"===e?"document-status.last-published":e}let lS=()=>{let e,t=(0,P.c)(2),n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,A.jsx)("div",{style:{margin:-5},children:(0,A.jsx)(R.LIN,{$size:0,animated:!0})}),t[0]=n):n=t[0],t[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsxs)(E.at,{align:"center",gap:3,paddingLeft:1,paddingRight:2,paddingY:2,children:[n,(0,A.jsx)(z.EA,{animated:!0,style:{width:"80px",height:"15px"},radius:2})]}),t[1]=e):e=t[1],e},lC=e=>{let t,n,i,r,l=(0,P.c)(17),{author:o,translationKey:a,timestamp:s}
1=e,{onHistoryOpen:d,inspector:c,onHistoryClose:u}=e9(),{t:p}=(0,R.Bdt)(),m=(0,R.Vq9)(void 0===s?"":s,lv),h,f,x;l[0]===Symbol.for("react.memo_cache_sentinel")?(h={opacity:1},f={opacity:0},x={opacity:0},l[0]=h,l[1]=f,l[2]=x):(h=l[0],f=l[1],x=l[2]);let g=c?.name==="sanity/structure/history"?u:d,b;return l[3]===o?b=l[4]:(b=o&&(0,A.jsx)("div",{style:{margin:-5},children:(0,A.jsx)(R.H8m,{user:o,size:0})}),l[3]=o,l[4]=b),l[5]!==p||l[6]!==a?(t=p(a),l[5]=p,l[6]=a,l[7]=t):t=l[7],l[8]!==m||l[9]!==t?(n=(0,A.jsxs)(E.et,{muted:!0,size:1,children:[t," ",m]}),l[8]=m,l[9]=t,l[10]=n):n=l[10],l[11]!==b||l[12]!==n?(i=(0,A.jsxs)(E.at,{align:"center",flex:"none",gap:3,children:[b,n]}),l[11]=b,l[12]=n,l[13]=i):i=l[13],l[14]!==g||l[15]!==i?(r=(0,A.jsx)(l_,{"data-testid":"pane-footer-document-status",animate:h,initial:f,exit:x,mode:"bleed",onClick:g,padding:2,muted:!0,children:i}),l[14]=g,l[15]=i,l[16]=r):r=l[16],r},lk=()=>{let e,t=(0,P.c)(6),{editState:n}=e9(),{selectedPerspective:i}=(0,R.QO2)(),r;t[0]!==n||t[1]!==i?(r=(0,R.xo4)(i)&&n?.published?._updatedAt?{translationKey:R.uMx.published.createDocumentVersion,timestamp:n.published._updatedAt}:n?.version?._updatedAt?{translationKey:n.version._updatedAt===n.version._createdAt?R.uMx.version.createDocumentVersion:R.uMx.version.editDocumentVersion,timestamp:n.version._updatedAt}:n?.draft?._updatedAt?{translationKey:n.draft._updatedAt===n.draft._createdAt?R.uMx.draft.createDocumentVersion:R.uMx.draft.editDocumentVersion,timestamp:n.draft._updatedAt}:null,t[0]=n,t[1]=i,t[2]=r):r=t[2];let l=r;return l?(t[3]!==l.timestamp||t[4]!==l.translationKey?(e=(0,A.jsx)(lC,{author:"",translationKey:l.translationKey,timestamp:l.timestamp}),t[3]=l.timestamp,t[4]=l.translationKey,t[5]=e):e=t[5],e):null},lT=()=>{let e,t=(0,P.c)(8),{events:n,loading:i}=(0,R.LJN)(),r=n?.[0];if(!r&&i){let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(lS,{}),t[0]=e):e=t[0],e}if(!r){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(lk,{}),t[1]=e):e=t[1],e}let l=r.author,o=R.uMx[r.documentVariantType][r.type],a;return t[2]===o?a=t[3]:(a=lw(o),t[2]=o,t[3]=a),t[4]!==r.author||t[5]!==r.timestamp||t[6]!==a?(e=(0,A.jsx)(lC,{author:l,translationKey:a,timestamp:r.timestamp}),t[4]=r.author,t[5]=r.timestamp,t[6]=a,t[7]=e):e=t[7],e},lD=()=>{let e,t,n=(0,P.c)(10),{timelineStore:i}=e9(),r=(0,R.SfM)(i,lA),l=(0,R.SfM)(i,lE),o=r?.[0];if(!o&&l){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(lS,{}),n[0]=e):e=n[0],e}if(!o){let e;return n[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(lk,{}),n[1]=e):e=n[1],e}n[2]===o.authors?e=n[3]:(e=Array.from(o.authors),n[2]=o.authors,n[3]=e);let a=e[0],s=la[o.type],d;return n[4]===s?d=n[5]:(d=lw(s),n[4]=s,n[5]=d),n[6]!==a||n[7]!==o.endTimestamp||n[8]!==d?(t=(0,A.jsx)(lC,{author:a,translationKey:d,timestamp:o.endTimestamp}),n[6]=a,n[7]=o.endTimestamp,n[8]=d,n[9]=t):t=n[9],t};function lP(){let e,t,n,i,r,l,o=(0,P.c)(20),{value:a,targetDocumentState:s}=e9(),{documentId:c,documentType:u}=nv(),[p,m]=(0,d.useState)(null),h=(0,R.For)().beta?.eventsAPI?.documents,f;o[0]===s?f=o[1]:(f=(0,R.LEK)(s),o[0]=s,o[1]=f);let x=(0,R.M7h)(c,u,f),g=a?._updatedAt,b;return o[2]!==p||o[3]!==x.isSyncing?(b=()=>{if("syncing"===p&&!x.isSyncing){let e=setTimeout(()=>m("saved"),1e3);return()=>clearTimeout(e)}if("saved"===p){let e=setTimeout(()=>m(null),3e3);return()=>clearTimeout(e)}},o[2]=p,o[3]=x.isSyncing,o[4]=b):b=o[4],o[5]!==g||o[6]!==p||o[7]!==x.isSyncing?(e=[p,g,x.isSyncing],o[5]=g,o[6]=p,o[7]=x.isSyncing,o[8]=e):e=o[8],(0,d.useEffect)(b,e),o[9]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{m(null)},o[9]=t):t=o[9],o[10]===c?n=o[11]:(n=[c],o[10]=c,o[11]=n),(0,d.useLayoutEffect)(t,n),o[12]===x.isSyncing?i=o[13]:(i=()=>{x.isSyncing&&m("syncing")},o[12]=x.isSyncing,o[13]=i),o[14]!==g||o[15]!==x.isSyncing?(r=[x.isSyncing,g],o[14]=g,o[15]=x.isSyncing,o[16]=r):r=o[16],(0,d.useLayoutEffect)(i,r),o[17]!==h||o[18]!==p?(l=(0,A.jsx)(e$.N,{children:p?(0,A.jsx)(lI,{paddingLeft:2,animate:{opacity:1},initial:{opacity:0}
1,exit:{opacity:0},children:(0,A.jsx)(lj,{status:p||void 0})}):(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(h?lT:lD,{})})}),o[17]=h,o[18]=p,o[19]=l):l=o[19],l}function lA(e){return e.chunks}function lE(e){return e.isLoading}let lz=(0,O.I4)(E.et).withConfig({displayName:"StatusText",componentId:"sc-jrnx2p-0"})`color:var(--card-muted-fg-color);em{color:var(--card-fg-color);font-weight:500;font-style:normal;}`;function lR(){let e,t,n=(0,P.c)(9),{displayed:i,revisionNotFound:r}=e9(),l=(0,d.useContext)(B.Pc),o=l?.revision,a=l?.events.find(e=>e.id===o?.revisionId),{t:s}=(0,R.Bdt)(),c=a?.timestamp||i?._updatedAt||i?._createdAt,u=c?(0,A.jsx)(R.HTc,{t:s,i18nKey:"document-status.revision-from",values:{date:(0,eK.GP)(new Date(c),"MMM d, yyyy '@' pp")}}):null,p;n[0]===u?p=n[1]:(p={name:"revision",text:u,tone:"caution"},n[0]=u,n[1]=p);let m=p,h;return n[2]===Symbol.for("react.memo_cache_sentinel")?(h=(0,A.jsx)(E.lt,{flex:"none",children:(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(eW.RestoreIcon,{})})}),n[2]=h):h=n[2],n[3]!==m||n[4]!==r||n[5]!==s?(e=r?(0,A.jsx)(R.HTc,{t:s,i18nKey:"document-status.revision-not-found"}):m.text,n[3]=m,n[4]=r,n[5]=s,n[6]=e):e=n[6],n[7]===e?t=n[8]:(t=(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)(E.at,{flex:1,gap:3,padding:2,children:[h,(0,A.jsx)(E.lt,{flex:1,children:(0,A.jsx)(lz,{size:1,textOverflow:"ellipsis",children:e})})]})}),n[7]=e,n[8]=t),t}let lB=eL.PY1.create(E.W);function lO(e){let t,n,i,r=(0,P.c)(17),{actionsBoxRef:l}=e,{editState:o,revisionNotFound:a,targetDocumentState:s}=e9(),{params:c}=tc(),u=void 0===c?nf:c,{selectedPerspective:p,selectedVariantName:m}=(0,R.QO2)(),h=!!u.rev,[f,x]=(0,d.useState)(null),[g,b]=(0,d.useState)(null),y;r[0]===Symbol.for("react.memo_cache_sentinel")?(y=e=>{x(e.contentRect.width<480)},r[0]=y):y=r[0];let j=y,v;r[1]===g?v=r[2]:(v={element:g,onResize:j},r[1]=g,r[2]=v),function(e){let t=(0,P.c)(4),{element:n,onResize:i}=e,r,l;t[0]!==n||t[1]!==i?(r=()=>{if(!n)return;let e=new ResizeObserver(e=>{let t=e.find(e=>e.target===n);t&&i(t)});return e.observe(n),()=>e.disconnect()},l=[n,i],t[0]=n,t[1]=i,t[2]=r,t[3]=l):(r=t[2],l=t[3]),(0,d.useLayoutEffect)(r,l)}(v);e:{let e=!!(o?.ready&&"boolean"==typeof f);if(m&&"ready"!==s.status&&!(0,R._il)(s)){t=!1;break e}if(p){if((0,R.xo4)(p)){t=e&&!!o?.published;break e}if((0,R.Jrl)(p)){t=e&&!!o?.version;break e}}t=e}let _=t,I;if(h){let e;r[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(lt,{}),r[3]=e):e=r[3],I=e}else{let e;r[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(r8,{}),r[4]=e):e=r[4],I=e}if(h&&a)return null;let w=h?"revision":"published",S;r[5]===Symbol.for("react.memo_cache_sentinel")?(S={opacity:.2},r[5]=S):S=r[5],r[6]===Symbol.for("react.memo_cache_sentinel")?(n={opacity:1,transition:{duration:.3}},r[6]=n):n=r[6];let C=h?"caution":void 0,k;return r[7]!==I||r[8]!==l||r[9]!==f||r[10]!==_||r[11]!==h?(k=_&&(0,A.jsxs)(E.at,{align:"stretch",gap:1,justify:"space-between",paddingLeft:+!h,paddingRight:+!h,children:[(0,A.jsxs)(E.at,{align:"center",flex:1,gap:f?2:3,wrap:"wrap",paddingRight:3,children:[(0,A.jsxs)(E.at,{align:"center",children:[(0,A.jsx)(h?lR:lP,{}),(0,A.jsx)(rX,{})]}),(0,A.jsx)(r3,{})]}),(0,A.jsxs)(E.at,{align:"flex-start",justify:"flex-end",ref:l,style:{flexShrink:0,marginLeft:"auto"},children:[(0,A.jsx)(rX,{}),I]})]}),r[7]=I,r[8]=l,r[9]=f,r[10]=_,r[11]=h,r[12]=k):k=r[12],r[13]!==w||r[14]!==C||r[15]!==k?(i=(0,A.jsx)(lB,{initial:S,animate:n,tone:C,radius:3,ref:b,sizing:"border",padding:2,children:k},w),r[13]=w,r[14]=C,r[15]=k,r[16]=i):i=r[16],i}let lN=["fixed","fixed","absolute"];function lL(e){let t,n,i,r=(0,P.c)(13),{documentPanelPortalElement:l,setFooterElement:a,setActionsBoxElement:d}=e,c=(0,R.YKH)(),u;r[0]===l?u=r[1]:(u={[s.t]:l},r[0]=l,r[1]=u);let p=u,m;return r[2]===d?m=r[3]:(m=(0,A.jsx)(o.i,{children:(0,A.jsx)(lO,{actionsBoxRef:d})}),r[2]=d,r[3]=m),r[4]!==a||r[5]!==m?(t=(0,A.jsx)(rG,{ref:a,padding:1,children:m}),r[4]=a,r[5]=m,r[6]=t):t=r[6],r[7]!==t||r[8]!==c.portal?(n=(0,A.jsx)(z.Co,{position:lN,zOffset:c.portal,children:t}),r[7]=t,r[8]=c.portal,r[9]=n):n=r[9],r[10]!==p||r[11]!==n?(i=(0,A.jsx)(E.t,{__unstable_elements:p,children:n}),r[10]=p,r[11]=n,r[12]=i):i=r[12],i}let l$=[],lM=["fixed","fixed","absolute"];function lH(e){let t,n,i=(0,P.c)(8),r,l;return i[0]===e?(r=i[1],l=i[2]):({className:r,...l}=e,i[0]=e,i[1]=r,i[2]=l),i[3]===r?t=i[4]:(t=(0,ea.$)("_1urskea0",r),i[3]=r,i[4]=t),i[5]!==l||i[6]!==t?(n=(0,A.jsx)(R.olN,{...l,className:t}
1),i[5]=l,i[6]=t,i[7]=n):n=i[7],n}function lV(){var e;let t,n,i,l,o,s,c,u,p,m,h,f,x,g,b,y=(0,P.c)(82),{changesOpen:j,displayed:v,documentId:_,documentType:I,editState:w,fieldActions:S,focusPath:C,inspectOpen:k,inspector:T,inspectors:D,onFocus:B,onHistoryOpen:O,onMenuAction:N,onPathOpen:L,paneKey:$,schemaType:M,value:H,previewUrl:V}=e9(),{stickyParams:W}=(0,ee.rd)(),{params:K}=tc(),{features:F}=(0,a.t)(),{t:J}=(0,R.Bdt)(r.I),{collapsed:U}=(0,a.a)(),Y=(0,R.YKH)(),[Q,q]=(0,d.useState)(null),[G,X]=(0,d.useState)(null),[Z,et]=(0,d.useState)(null),[en,ei]=(0,d.useState)(null),[el,eo]=(0,d.useState)(null),ea;y[0]!==C||y[1]!==Q||y[2]!==H?(ea={element:Q,focusPath:C,value:H},y[0]=C,y[1]=Q,y[2]=H,y[3]=ea):ea=y[3],(0,R.ti5)(ea),y[4]===Symbol.for("react.memo_cache_sentinel")?(i=[],y[4]=i):i=y[4];let[ed,ec]=(0,d.useState)(i),eu;y[5]===Symbol.for("react.memo_cache_sentinel")?(eu=[],y[5]=eu):eu=y[5];let[ep,em]=(0,d.useState)(eu),eh=(0,z.sQ)(G),ef=(0,z.sQ)(Z),ex=eh?.height,eg=ef?.height,eb=600+320*!!T,ey=320+320*!!T;T?.name,y[6]!==T?.name||y[7]!==D?(l=D?.find(e=>e.name===T?.name),y[6]=T?.name,y[7]=D,y[8]=l):l=y[8];let ej=l,ev;y[9]!==v||y[10]!==_||y[11]!==w?(ev={displayed:v,documentId:_,editState:w},y[9]=v,y[10]=_,y[11]=w,y[12]=ev):ev=y[12];let e_=(0,R.aSp)(ev),eI=!!H,ew="true"===W.displayInlineChanges,eS;y[13]!==ej||y[14]!==e_||y[15]!==F||y[16]!==eI||y[17]!==ed||y[18]!==D||y[19]!==V||y[20]!==J||y[21]!==ew?(t=function({currentInspector:e,hasValue:t,inspectors:n,inspectorMenuItems:i}){return n.map((n,r)=>{let l=i[r];return!l||l.hidden?null:{action:`inspect:${n.name}`,group:l.showAsAction?void 0:"inspectors",icon:l.icon,disabled:!t,selected:e?.name===n.name,shortcut:l.hotkeys?.join("+"),showAsAction:l.showAsAction,title:l.title,tone:l.tone}}).filter(Boolean)}(e={currentInspector:ej,features:F,hasValue:eI,inspectorMenuItems:ed,inspectors:D,previewUrl:V,documentIdStack:e_,t:J,displayInlineChanges:ew}),n=[function({previewUrl:e,t}){return e?{action:"production-preview",group:"links",title:t("production-preview.menu-item.title"),icon:eH.EarthAmericasIcon,shortcut:"Ctrl+Alt+O"}:null}(e),function({documentIdStack:e,t}){let n=e?.previousId===void 0&&{reason:t("compare-versions.menu-item.disabled-reason")};return{action:"compareVersions",group:"inspectors",title:t("compare-versions.menu-item.title"),icon:er.TransferIcon,disabled:n}}(e),function({displayInlineChanges:e,t}){return{action:"toggleInlineChanges",group:"inspectors",title:t("toggle-inline-changes.menu-item.title"),icon:e?eE.CheckmarkIcon:rU}}(e)].filter(Boolean),eS=[...t,function({hasValue:e,t}){return{action:"inspect",group:"inspectors",title:t("document-inspector.menu-item.title"),icon:eV.JsonIcon,disabled:!e,shortcut:"Ctrl+Alt+I"}}(e),...n],y[13]=ej,y[14]=e_,y[15]=F,y[16]=eI,y[17]=ed,y[18]=D,y[19]=V,y[20]=J,y[21]=ew,y[22]=eS):eS=y[22];let eC=eS,ek;y[23]!==eC||y[24]!==N?(ek=e=>{for(let t of eC)if(t.shortcut&&(0,es.v_)(t.shortcut,e)){e.preventDefault(),e.stopPropagation(),N(t);return}},y[23]=eC,y[24]=N,y[25]=ek):ek=y[25];let eT=ek,eD;y[26]!==B||y[27]!==L?(eD=e=>{L(e),B(e)},y[26]=B,y[27]=L,y[28]=eD):eD=y[28];let eP=eD;if(!M){let e;return y[29]!==eb||y[30]!==I||y[31]!==ey||y[32]!==$||y[33]!==H?(e=(0,A.jsx)(rY,{currentMinWidth:eb,documentType:I,minWidth:ey,paneKey:$,value:H}),y[29]=eb,y[30]=I,y[31]=ey,y[32]=$,y[33]=H,y[34]=e):e=y[34],e}y[35]!==_||y[36]!==I||y[37]!==D?(o=D.length>0&&(0,A.jsx)(nb,{documentId:_,documentType:I,inspectors:D,onMenuItems:ec}),y[35]=_,y[36]=I,y[37]=D,y[38]=o):o=y[38],y[39]!==_||y[40]!==I||y[41]!==S||y[42]!==M?(s=S.length>0&&M&&(0,A.jsx)(R.yW8,{actions:S,documentId:_,documentType:I,onActions:em,path:l$,schemaType:M}),y[39]=_,y[40]=I,y[41]=S,y[42]=M,y[43]=s):s=y[43],y[44]===eC?c=y[45]:(c=(0,A.jsx)(r$,{ref:et,menuItems:eC}),y[44]=eC,y[45]=c);let eA=U?void 0:"fill",ez=j&&K?.changesInspectorTab==="review",eR=ex||null,eB=eg||null,eO;return y[46]===el?eO=y[47]:(eO=(0,A.jsx)(lL,{documentPanelPortalElement:el,setFooterElement:X,setActionsBoxElement:ei}),y[46]=el,y[47]=eO),y[48]!==k||y[49]!==Q||y[50]!==eR||y[51]!==eB||y[52]!==eO?(u=(0,A.jsx)(i$,{footerHeight:eR,headerHeight:eB,isInspectOpen:k,rootElement:Q,setDocumentPanelPortalElement:eo,footer:eO}),y[48]=k,y[49]=Q,y[50]=eR,y[51]=eB,y[52]=eO,y[53]=u):u=y[53],y[54]!==eP||y[55]!==O||y[56]!==ez||y[57]!==u?(p=(0,A.jsx)(lH,{"data-testid":"change-connector-root",isReviewChangesOpen:ez,onOpenReviewChanges:O,onSetFocus:eP,children:u}),y[54]=eP,y[55]=O,y[56]=ez,y[57]=u,y[58]=p):p=y[58],y[59]!==eA||y[60]!==p?(m=(0,A.jsx)(E.at,{direction:"column",flex:1,height:eA,children:p}),y[59]=eA,y[60]=p,y[61]=m):m=y[61],y[62]!==m||y[63]!==Y.paneDialog?(h=(0,A.jsx)(z.Co,{position:lM,zOffset:Y.paneDialog,children:m}),y[62]=m,y[63]=Y.paneDialog,y[64]=h):h=y[64],y[65]===Symbol.for("react.memo_cache_sentinel")?(f=(0,A.jsx)(nI,{}),y[65]=f):f=y[65],y[66]!==en||y[67]!==eb||y[68]!==eT||y[69]!==ey||y[70]!==$||y[71]!==c||y[72]!==h?(x=(0,A.jsxs)(rJ,{actionsBoxElement:en,as:a.i,currentMinWidth:eb,"data-testid":"document-pane",flex:2.5,id:$,minWidth:ey,onKeyUp:eT,rootRef:q,children:[c,h,f]}),y[66]=en,y[67]=eb,y[68]=eT,y[69]=ey,y[70]=$,y[71]=c,y[72]=h,y[73]=x):x=y[73],y[74]!==ep||y[75]!==x?(g=(0,A.jsx)(nu,{children:(0,A.jsx)(R.tdH,{actions:ep,path:l$,children:x})}),y[74]=ep,y[75]=x,y[76]=g):g=y[76],y[77]!==s||y[78]!==g||y[79]!==o||y[80]!==H?(b=(0,A.jsxs)(R.niW,{value:H,children:[o,s,g]}),y[77]=s,y[78]=g,y[79]=o,y[80]=H,y[81]=b):b=y[81],b}let lW=e=>{let t,n=(0,P.c)(20),{isDeleted:i,displayed:l,ready:o,schemaType:a}=e,{t:s}=(0,R.Bdt)(r.I),c=!l?._createdAt,u=!!l,p;n[0]!==l||n[1]!==a||n[2]!==u?(p={enabled:u,schemaType:a,value:l},n[0]=l,n[1]=a,n[2]=u,n[3]=p):p=n[3];let{value:m,isLoading:h}=(0,R.d3q)(p),f;n[4]!==i||n[5]!==c||n[6]!==a?.name||n[7]!==a?.title||n[8]!==s||n[9]!==m?.title?(f=i?"":c?s("browser-document-title.new-document",{schemaType:a?.title||a?.name}):m?.title||s("browser-document-title.untitled-document"),n[4]=i,n[5]=c,n[6]=a?.name,n[7]=a?.title,n[8]=s,n[9]=m?.title,n[10]=f):f=n[10];let x=f,g=lJ(x),b;return n[11]!==g||n[12]!==h||n[13]!==o?(b=()=>{!o||h||(document.title=g)},n[11]=g,n[12]=h,n[13]=o,n[14]=b):b=n[14],n[15]!==x||n[16]!==g||n[17]!==h||n[18]!==o?(t=[x,o,g,h],n[15]=x,n[16]=g,n[17]=h,n[18]=o,n[19]=t):t=n[19],(0,d.useEffect)(b,t),null},lK=e=>{let t,n=(0,P.c)(5),{title:i}=e,r=lJ(i),l;return n[0]===r?l=n[1]:(l=()=>{document.title=r},n[0]=r,n[1]=l),n[2]!==r||n[3]!==i?(t=[r,i],n[2]=r,n[3]=i,n[4]=t):t=n[4],(0,d.useEffect)(l,t),null},lF=e=>{var t;let n=(0,P.c)(5),{resolvedPanes:i}=e;if(!i?.length)return null;let r=i[i.length-1];if(r===s.r){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(lK,{}),n[0]=e):e=n[0],e}if((t=r)!==s.r&&"document"===t.type){if(r?.title){let e;return n[1]===r.title?e=n[2]:(e=(0,A.jsx)(lK,{title:r.title}),n[1]=r.title,n[2]=e),e}return null}let l=r?.title,o;return n[3]===l?o=n[4]:(o=(0,A.jsx)(lK,{title:l}),n[3]=l,n[4]=o),o};function lJ(e){let t=(0,P.c)(3),n=(0,a.t)().structureContext.title,i;return t[0]!==e||t[1]!==n?(i=[e,n].filter(lU),t[0]=e,t[1]=n,t[2]=i):i=t[2],i.join(" | ")}function lU(e){return e}let lY={revision:null},lQ=(0,G.g_)({name:"Document Initial Load Measured",version:1,description:"Time from a document pane mounting to its form becoming ready to edit. Includes data load, schema resolution, template permissions, and (if applicable) timeline readiness. Superset of Document Pair Load Time Measured.",maxSampleRate:3e4});function lq(e){return e.name===ng}function lG(e){let t=(0,R.u4i)(e)&&"string"==typeof e.message?e.message:"Unknown error";throw Error(`An error was thrown while trying to get your preview url: ${t}`)}function lX(e){let t,n,i,r,l,o,s,c,u,p,h=(0,P.c)(258),{children:f,index:x,pane:b,paneKey:y,onFocusPath:j,onSetMaximizedPane:v,maximized:_,forcedVersion:S,historyStore:k}=e,T=void 0!==_&&_,{store:E,error:z,ready:O,revisionDocument:N,onOlderRevision:L,sinceDocument:$,isPristine:M,revisionId:H,lastNonDeletedRevId:V}=k,K=(0,R.I07)(),{setDocumentMeta:F}=(0,R.e8q)(),{document:J}=(0,R.For)(),{actions:Y,badges:G,unstable_fieldActions:X,unstable_languageFilter:Z,drafts:et}=J,{enabled:en}=et,ei=(0,q.Jr)(),er=(0,ee.rd)(),el=tc(),eo=el.setParams,{options:ea,menuItemGroups:es,title:ed,views:ec}=b,eu=void 0===es?nx:es,ep=void 0===ed?null:ed,em;h[0]===ec?em=h[1]:(em=void 0===ec?[]:ec,h[0]=ec,h[1]=em);let eh=em,ef=(0,R.$6H)(ea),ex=ef.id,eg;h[2]===ex?eg=h[3]:(eg=(0,R.IMx)(ex),h[2]=ex,h[3]=eg);let eb=eg,ey=ea.type,ej=(0,R.$6H)(el.params)||nf,ev=(0,R.QO2)(),e_=(0,R.hA9)(),ew=e_.advancedVersionControl.enabled,eS=e_.document.drafts.enabled,eC;e:{let e;if(S){eC=S;break e}h[4]!==ev.selectedPerspectiveName||h[5]!==ev.selectedReleaseId?(e={selectedPerspectiveName:ev.selectedPerspectiveName,selectedReleaseId:ev.selectedReleaseId}
1,h[4]=ev.selectedPerspectiveName,h[5]=ev.selectedReleaseId,h[6]=e):e=h[6],eC=e}let{selectedReleaseId:ek,selectedPerspectiveName:eT}=eC,{data:eD}=(0,R.K0D)(),eP=void 0===eD?R.Mlv:eD,eA=tM(),eE=(0,R.p_E)(eb),ez;h[7]!==eb||h[8]!==ey||h[9]!==ef||h[10]!==ej?(ez={paneOptions:ef,documentId:eb,documentType:ey,params:ej},h[7]=eb,h[8]=ey,h[9]=ef,h[10]=ej,h[11]=ez):ez=h[11];let eR=(0,R.Nhe)(eE,(e=>{var t;let n,i,r,l,o,a,s=(0,P.c)(13),{paneOptions:d,documentType:c,documentId:u,params:p}=e,m=(0,R.bgA)(),h=(0,R.$6H)(tc().payload),f;s[0]!==c||s[1]!==d.template||s[2]!==d.templateParameters||s[3]!==h||s[4]!==p.template||s[5]!==m?(n=(t={documentType:c,templateName:d.template,templateParams:d.templateParameters,panePayload:h,urlTemplate:p.template}).panePayload||{},i=t.templateName,t.urlTemplate&&i&&i!==t.urlTemplate&&console.warn(`Conflicting templates: URL says "${t.urlTemplate}", structure node says "${i}". Using "${i}".`),r=i||t.urlTemplate,l=m.filter(e=>e.schemaType===t.documentType),o={...t.templateParams,..."object"==typeof n&&n||{}},a=r,r||1!==l.length||(a=l[0].id),f={templateName:a,templateParams:o},s[0]=c,s[1]=d.template,s[2]=d.templateParameters,s[3]=h,s[4]=p.template,s[5]=m,s[6]=f):f=s[6];let{templateName:x,templateParams:g}=f,b;return s[7]!==u||s[8]!==c||s[9]!==p.version||s[10]!==x||s[11]!==g?(b={documentId:u,documentType:c,templateName:x,templateParams:g,version:p.version},s[7]=u,s[8]=c,s[9]=p.version,s[10]=x,s[11]=g,s[12]=b):b=s[12],(0,R.$6H)((0,R.nfZ)(b))})(ez)),eB=eR.loading,eO;h[12]!==eb||h[13]!==ey||h[14]!==ej||h[15]!==eo?(eO={documentId:eb,documentType:ey,params:ej,setParams:eo},h[12]=eb,h[13]=ey,h[14]=ej,h[15]=eo,h[16]=eO):eO=h[16];let{changesOpen:eN,currentInspector:eL,inspectors:e$,closeInspector:eM,openInspector:eH,handleHistoryClose:eV,handleHistoryOpen:eW,handleInspectorAction:eK,inspectOpen:eF,handleLegacyInspectClose:eJ}=function(e){let t,n=(0,P.c)(54),{documentId:i,documentType:r,params:l,setParams:o}=e,{features:s}=(0,a.t)(),c=(0,R.For)().document.inspectors,u;n[0]!==i||n[1]!==r||n[2]!==c?(u=c({documentId:i,documentType:r}),n[0]=i,n[1]=r,n[2]=c,n[3]=u):u=n[3];let p=u,m;n[4]===l.inspect?m=n[5]:(m=()=>l.inspect||null,n[4]=l.inspect,n[5]=m);let[h,f]=(0,d.useState)(m),x=(0,d.useRef)(l.inspect),g,b;n[6]===l.inspect?(g=n[7],b=n[8]):(g=()=>{x.current!==l.inspect&&(x.current=l.inspect,f(l.inspect||null))},b=[l.inspect],n[6]=l.inspect,n[7]=g,n[8]=b),(0,d.useEffect)(g,b),n[9]!==h||n[10]!==p?(t=p?.find(e=>e.name===h),n[9]=h,n[10]=p,n[11]=t):t=n[11];let y=t,j;n[12]===p?j=n[13]:(j=p.find(lq),n[12]=p,n[13]=j);let v=j,_=y?.name===ng,I;n[14]!==y||n[15]!==p||n[16]!==l||n[17]!==o?(I=e=>{let t=e&&p.find(t=>t.name===e);if(e&&!t)return void console.warn(`No inspector named "${e}"`);if(y){if(t){let e=t.onClose?.({params:l})??{params:l};f(null),x.current=void 0,o({...e.params,inspect:void 0});return}if(y){let e=y.onClose?.({params:l})??{params:l};f(null),x.current=void 0,o({...e.params,inspect:void 0})}}},n[14]=y,n[15]=p,n[16]=l,n[17]=o,n[18]=I):I=n[18];let w=I,S;n[19]!==y||n[20]!==p||n[21]!==l||n[22]!==o?(S=(e,t)=>{let n=p.find(t=>t.name===e);if(!n)return void console.warn(`No inspector named "${e}"`);if(y?.name===n.name)return void o({...l,...t,inspect:n.name});let i=l;y&&(i=(n.onClose?.({params:i})??{params:i}).params);let r=n.onOpen?.({params:i})??{params:i};f(n.name),x.current=n.name,o({...r.params,...t,inspect:n.name})},n[19]=y,n[20]=p,n[21]=l,n[22]=o,n[23]=S):S=n[23];let C=S,k;n[24]!==w||n[25]!==v?(k=()=>{v&&w(v.name)},n[24]=w,n[25]=v,n[26]=k):k=n[26];let T=k,D;n[27]!==s.reviewChanges||n[28]!==v||n[29]!==C?(D=()=>{s.reviewChanges&&v&&C(v.name,{changesInspectorTab:"review"})},n[27]=s.reviewChanges,n[28]=v,n[29]=C,n[30]=D):D=n[30];let A=D,E="on"===l.inspect,z;n[31]!==E||n[32]!==l||n[33]!==o?(z=e=>{o((void 0===e?!E:e)?{...l,inspect:"on"}:{...l,inspect:void 0})},n[31]=E,n[32]=l,n[33]=o,n[34]=z):z=n[34];let B=z,O;n[35]===B?O=n[36]:(O=()=>B(!1),n[35]=B,n[36]=O);let N=O,L;n[37]!==w||n[38]!==h||n[39]!==p||n[40]!==C||n[41]!==B?(L=e=>{if("inspect"===e.action)return B(!0),!0;if("string"!=typeof e.action)return!1;let t=e.action.slice(8),n=p.find(e=>e.name===t);return!!n&&(n.name===h?w(n.name):C(n.name),!0)},n[37]=w,n[38]=h,n[39]=p,n[40]=C,n[41]=B,n[42]=L):L=n[42];let $=L,M;return n[43]!==_||n[44]!==w||n[45]!==y||n[46]!==T||n[47]!==A||n[48]!==$||n[49]!==N||n[50]!==E||n[51]!==
1p||n[52]!==C?(M={changesOpen:_,currentInspector:y,inspectors:p,closeInspector:w,openInspector:C,handleHistoryClose:T,handleHistoryOpen:A,handleInspectorAction:$,handleLegacyInspectClose:N,inspectOpen:E},n[43]=_,n[44]=w,n[45]=y,n[46]=T,n[47]=A,n[48]=$,n[49]=N,n[50]=E,n[51]=p,n[52]=C,n[53]=M):M=n[53],M}(eO),[eU,eY]=(0,d.useState)(!1),[eQ,eq]=(0,d.useState)(!1),{lastRevisionDocument:eG}=(()=>{let e=(0,P.c)(3),{revision:t}=(0,d.useContext)(B.Pc)||lY,n=t?.document||null,i=t?.loading||!1,r;return e[0]!==n||e[1]!==i?(r={lastRevisionDocument:n,loading:i},e[0]=n,e[1]=i,e[2]=r):r=e[2],r})(),eX;h[17]!==M||h[18]!==O?(eX=e=>!!O&&!e?.draft&&!e?.published&&!e?.version&&!M,h[17]=M,h[18]=O,h[19]=eX):eX=h[19];let eZ=eX,e0;h[20]!==eN||h[21]!==$?(e0=e=>{let t=(0,R.spc)(e);return eN?$||t:t||null},h[20]=eN,h[21]=$,h[22]=e0):e0=h[22];let e1=e0,e2;h[23]!==ey||h[24]!==K?(e2=K.get(ey),h[23]=ey,h[24]=K,h[25]=e2):e2=h[25];let e3=e2,e4;h[26]!==ev.selectedVariantName||h[27]!==eE?(e4=!!ev.selectedVariantName&&"ready"!==eE.status&&!(0,R._il)(eE),h[26]=ev.selectedVariantName,h[27]=eE,h[28]=e4):e4=h[28];let e5=e4,e6;h[29]!==eZ||h[30]!==eU||h[31]!==eS||h[32]!==e5||h[33]!==ej.rev||h[34]!==ev.selectedPerspective||h[35]!==eP||h[36]!==e3||h[37]!==ek?(e6=e=>{let t=eZ(e),n=!!ej.rev,i=(0,R.yk9)(eP.find(e=>(0,R._hI)(e._id)===ek));return n||eU||t||e5||!i&&!(0,R.CW3)({selectedPerspective:ev.selectedPerspective,isDraftModelEnabled:eS,schemaType:e3}).result},h[29]=eZ,h[30]=eU,h[31]=eS,h[32]=e5,h[33]=ej.rev,h[34]=ev.selectedPerspective,h[35]=eP,h[36]=e3,h[37]=ek,h[38]=e6):e6=h[38];let e7=e6,e8;h[39]!==V||h[40]!==eG||h[41]!==L||h[42]!==N?(e8=e=>L?N||{_id:e._id,_type:e._type}:!e._createdAt&&!e._updatedAt&&V&&eG?eG:e,h[39]=V,h[40]=eG,h[41]=L,h[42]=N,h[43]=e8):e8=h[43];let e9=e8,te;h[44]===ej.path?te=h[45]:(te=ej.path?(0,Q.sH)(ej.path):R.Mlv,h[44]=ej.path,h[45]=te);let tt="true"===er.stickyParams.displayInlineChanges,tn;h[46]!==eN||h[47]!==eb||h[48]!==ey||h[49]!==e1||h[50]!==e9||h[51]!==e7||h[52]!==eR||h[53]!==j||h[54]!==L||h[55]!==eT||h[56]!==te||h[57]!==tt?(tn={changesOpen:eN,documentType:ey,documentId:eb,initialValue:eR,comparisonValue:e1,releaseId:eT,selectedPerspectiveName:eT,initialFocusPath:te,readOnly:e7,onFocusPath:j,getFormDocumentValue:e9,displayInlineChanges:tt,isOlderRevision:L},h[46]=eN,h[47]=eb,h[48]=ey,h[49]=e1,h[50]=e9,h[51]=e7,h[52]=eR,h[53]=j,h[54]=L,h[55]=eT,h[56]=te,h[57]=tt,h[58]=tn):tn=h[58];let{editState:ti,upstreamEditState:tr,hasUpstreamVersion:tl,connectionState:to,syncState:ta,focusPath:ts,onChange:td,validation:tu,ready:tp,value:tm,formState:th,permissions:tf,onPathOpen:tx,isPermissionsLoading:tg,formStateRef:tb,onProgrammaticFocus:ty,collapsedFieldSets:tj,collapsedPaths:tv,onBlur:t_,onFocus:tI,onSetActiveFieldGroup:tw,onSetCollapsedPath:tS,onSetCollapsedFieldSet:tC,openPath:tk}=(0,R.Lay)(tn),tT;h[59]!==en||h[60]!==ej||h[61]!==eP||h[62]!==eT||h[63]!==ek||h[64]!==tm?(tT=function(e,t,n,i,r,l){let o;switch(!0){case!!e?.rev:o="revision";break;case t&&(0,R.A_X)(n._id):{let e=l.find(e=>(0,R._hI)(e._id)===t);o=e&&(0,R._9c)(e)?"scheduled-draft":"version";break}case"published"===i:o="published";break;case r:o="draft";break;default:o="published"}return o}(ej,ek,tm,eT,en,eP),h[59]=en,h[60]=ej,h[61]=eP,h[62]=eT,h[63]=ek,h[64]=tm,h[65]=tT):tT=h[65];let tD=tT,tP;h[66]!==tD||h[67]!==eb||h[68]!==ey||h[69]!==ek?(tP={schemaType:ey,documentId:eb,versionType:tD,releaseId:ek},h[66]=tD,h[67]=eb,h[68]=ey,h[69]=ek,h[70]=tP):tP=h[70];let tA=tP,tE;h[71]!==Y||h[72]!==tA?(tE=Y(tA),h[71]=Y,h[72]=tA,h[73]=tE):tE=h[73];let tz=tE,tR;h[74]!==tx||h[75]!==ej||h[76]!==eo?(tR=e=>{tx(e);let t=(0,R.ujC)(e);ej.path!==t&&eo({...ej,path:t})},h[74]=tx,h[75]=ej,h[76]=eo,h[77]=tR):tR=h[77];let tB=tR,tO;h[78]!==G||h[79]!==eb||h[80]!==ey?(tO=G({schemaType:ey,documentId:eb}),h[78]=G,h[79]=eb,h[80]=ey,h[81]=tO):tO=h[81];let tN=tO,tL;h[82]!==eb||h[83]!==ey||h[84]!==Z?(tL=Z({schemaType:ey,documentId:eb}),h[82]=eb,h[83]=ey,h[84]=Z,h[85]=tL):tL=h[85];let t$=tL,tH=(0,R.$6H)(eh),tV=ej.view||tH[0]&&tH[0].id||null,tW=function(e){let t,n=(0,P.c)(6),{resolveProductionUrl:i}=(0,R.For)().document,r;n[0]===Symbol.for("react.memo_cache_sentinel")?(r=new C.t(void 0),n[0]=r):r=n[0];let l=r,o,a;return n[1]===e?(o=n[2],a=n[3]):(o=()=>{l.next(e)},a=[l,e],n[1]=e,n[2]=o,n[3]=a),(0,d.useEffect)(o,a),n[4]===i?t=n[5]:(t=l.asObservable().pipe((0,g.F)(),(0,U.B)(500),(0,D.n)(e=>(0,R.u4i)(e)&&"string"==typeof e._id&&"string"==typeof e._type?(0,w.H)(i({document:e})):(0,m.of)(void 0)),(0,g.F)(),(0,I.W)(lG)),n[4]=i,n[5]=t),(0,W.J2)(t)}(tm),tK;h[86]!==eb||h[87]!==ey||h[88]!==X||h[89]!==e3?(tK=e3?X({documentId:eb,documentType:ey,schemaType:e3}):[],h[86]=eb,h[87]=ey,h[88]=X,h[89]=e3,h[90]=tK):tK=h[90];let tF=tK,tJ=tp&&(!ej.rev||O||!!z),tU=e3?.name,tY=!!ej.rev,tQ;h[91]!==ti||h[92]!==tJ||h[93]!==tU||h[94]!==tY?(tQ={ready:tJ,schemaTypeName:tU,editState:ti,hasRevisionParam:tY},h[91]=ti,h[92]=tJ,h[93]=tU,h[94]=tY,h[95]=tQ):tQ=h[95],function(e){let t=(0,P.c)(9),{ready:n,schemaTypeName:i,editState:r,hasRevisionParam:l}=e,o=(0,q.Jr)(),a=(0,d.useRef)(null),s,c;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{a.current=performance.now()},c=[],t[0]=s,t[1]=c):(s=t[0],c=t[1]),(0,d.useEffect)(s,c);let u=(0,d.useRef)(!1),p,m;t[2]!==r||t[3]!==l||t[4]!==n||t[5]!==i||t[6]!==o?(p=()=>
1{if(u.current||!n||null===a.current)return;u.current=!0;let e=r?.ready===!0&&null===r.draft&&null===r.published&&null===r.version;o.log(lQ,{durationMs:performance.now()-a.current,documentTypeName:i??"unknown",isNewDocument:e,hasRevisionParam:l})},m=[n,o,i,r,l],t[2]=r,t[3]=l,t[4]=n,t[5]=i,t[6]=o,t[7]=p,t[8]=m):(p=t[7],m=t[8]),(0,d.useEffect)(p,m)}(tQ),h[96]!==e9||h[97]!==tm?(t=e9(tm),h[96]=e9,h[97]=tm,h[98]=t):t=h[98];let tq=t,tG;h[99]!==tq||h[100]!==eb||h[101]!==ti?(tG={strict:!0,displayed:tq,documentId:eb,editState:ti},h[99]=tq,h[100]=eb,h[101]=ti,h[102]=tG):tG=h[102];let{previousId:tX}=(0,R.aSp)(tG),tZ;h[103]!==ej||h[104]!==eo?(tZ=(e,t)=>{eo({...ej,since:e,rev:t||void 0})},h[103]=ej,h[104]=eo,h[105]=tZ):tZ=h[105];let t0=tZ,t1;h[106]===el?t1=h[107]:(t1=()=>el.closeCurrent(),h[106]=el,h[107]=t1);let t2=t1,t3;h[108]===el?t3=h[109]:(t3=()=>el.duplicateCurrent(),h[108]=el,h[109]=t3);let t4=t3,t5;h[110]!==er||h[111]!==ei?(t5=()=>{let e="true"!==er.stickyParams.displayInlineChanges;ei.log(e?rc:ru),er.navigate({stickyParams:{displayInlineChanges:String(e)}})},h[110]=er,h[111]=ei,h[112]=t5):t5=h[112];let t6=t5,t7;h[113]!==eA||h[114]!==ey||h[115]!==eW||h[116]!==eK||h[117]!==tW||h[118]!==tX||h[119]!==t6||h[120]!==tm._id?(t7=async e=>"production-preview"===e.action&&tW?(window.open(tW),!0):"reviewChanges"===e.action?(eW(),!0):(("inspect"===e.action||"string"==typeof e.action&&e.action.startsWith("inspect:"))&&eK(e),"compareVersions"===e.action&&void 0!==tX?(eA.navigateDiffView({mode:"version",previousDocument:{type:ey,id:tX},nextDocument:{type:ey,id:tm._id}}),!0):"toggleInlineChanges"===e.action&&(t6(),!0)),h[113]=eA,h[114]=ey,h[115]=eW,h[116]=eK,h[117]=tW,h[118]=tX,h[119]=t6,h[120]=tm._id,h[121]=t7):t7=h[121];let t8=t7,t9,ne;h[122]!==eb||h[123]!==ey||h[124]!==td||h[125]!==e3||h[126]!==F?(t9=()=>{F({documentId:eb,documentType:ey,schemaType:e3,onChange:td})},ne=[eb,ey,e3,td,F],h[122]=eb,h[123]=ey,h[124]=td,h[125]=e3,h[126]=F,h[127]=t9,h[128]=ne):(t9=h[127],ne=h[128]),(0,d.useEffect)(t9,ne),h[129]!==e1||h[130]!==tr?(n=e1(tr),h[129]=e1,h[130]=tr,h[131]=n):n=h[131];let nt=n,nn=eZ(ti),ni=L&&!N&&tJ,nr;t:{if(ti.version&&(0,R.YW1)(ti.version)){nr=ti.published;break t}nr=tq}let nl=nr,no=eL||null,na;h[132]===eu?na=h[133]:(na=eu||[],h[132]=eu,h[133]=na),h[134]!==tz||h[135]!==tV||h[136]!==tN||h[137]!==eN||h[138]!==eM||h[139]!==tj||h[140]!==tv||h[141]!==nt||h[142]!==to||h[143]!==nl||h[144]!==eb||h[145]!==ex||h[146]!==ey||h[147]!==ti||h[148]!==tF||h[149]!==ts||h[150]!==th||h[151]!==eV||h[152]!==eW||h[153]!==eJ||h[154]!==t8||h[155]!==t2||h[156]!==t4||h[157]!==tB||h[158]!==tl||h[159]!==x||h[160]!==eF||h[161]!==e$||h[162]!==nn||h[163]!==eU||h[164]!==eQ||h[165]!==eB||h[166]!==tg||h[167]!==t$||h[168]!==V||h[169]!==eG||h[170]!==T||h[171]!==t_||h[172]!==td||h[173]!==tI||h[174]!==tw||h[175]!==tC||h[176]!==tS||h[177]!==v||h[178]!==eH||h[179]!==tk||h[180]!==y||h[181]!==tf||h[182]!==tW||h[183]!==tJ||h[184]!==H||h[185]!==ni||h[186]!==e3||h[187]!==ek||h[188]!==t0||h[189]!==ta||h[190]!==no||h[191]!==na||h[192]!==eE||h[193]!==z||h[194]!==E||h[195]!==ep||h[196]!==tu||h[197]!==tm||h[198]!==tH?(i={actions:tz,activeViewId:tV,badges:tN,changesOpen:eN,closeInspector:eM,collapsedFieldSets:tj,collapsedPaths:tv,compareValue:nt,connectionState:to,syncState:ta,displayed:nl,documentId:eb,documentIdRaw:ex,documentType:ey,editState:ti,fieldActions:tF,focusPath:ts,inspector:no,inspectors:e$,onBlur:t_,onChange:td,onFocus:tI,onPathOpen:tB,onHistoryClose:eV,onHistoryOpen:eW,onInspectClose:eJ,onMenuAction:t8,onPaneClose:t2,onPaneSplit:t4,onSetActiveFieldGroup:tw,onSetCollapsedPath:tS,onSetCollapsedFieldSet:tC,onSetMaximizedPane:v,maximized:T,openInspector:eH,openPath:tk,index:x,inspectOpen:eF,validation:tu,menuItemGroups:na,paneKey:y,previewUrl:tW,ready:tJ,schemaType:e3,hasUpstreamVersion:tl,isPermissionsLoading:tg,isInitialValueLoading:eB,permissions:tf,setTimelineRange:t0,setIsDeleting:eY,targetDocumentState:eE,isDeleting:eU,isDocumentGroupInventoryActive:eQ,setIsDocumentGroupInventoryActive:eq,isDeleted:nn,timelineError:z,timelineStore:E,title:ep,value:tm,selectedReleaseId:ek,views:tH,formState:th,unstable_languageFilter:t$,revisionId:H,revisionNotFound:ni,lastNonDeletedRevId:V,lastRevisionDocument:eG},h[134]=tz,h[135]=tV,h[136]=tN,h[137]=eN,h[138]=eM,h[139]=tj,h[140]=tv,h[141]=nt,h[142]=to,h[143]=nl,h[144]=eb,h[145]=ex,h[146]=ey,h[147]=ti,h[148]=tF,h[149]=ts,h[150]=th,h[151]=eV,h[152]=eW,h[153]=eJ,h[154]=t8,h[155]=t2,h[156]=t4,h[157]=tB,h[158]=tl,h[159]=x,h[160]=eF,h[161]=e$,h[162]=nn,h[163]=eU,h[164]=eQ,h[165]=eB,h[166]=tg,h[167]=t$,h[168]=V,h[169]=eG,h[170]=T,h[171]=t_,h[172]=td,h[173]=tI,h[174]=tw,h[175]=tC,h[176]=tS,h[177]=v,h[178]=eH,h[179]=tk,h[180]=y,h[181]=tf,h[182]=tW,h[183]=tJ,h[184]=H,h[185]=ni,h[186]=e3,h[187]=ek,h[188]=t0,h[189]=ta,h[190]=no,h[191]=na,h[192]=eE,h[193]=z,h[194]=E,h[195]=ep,h[196]=tu,h[197]=tm,h[198]=tH,h[199]=i):i=h[199];let ns=i,nd;h[200]===eu?nd=h[201]:(nd=eu||[],h[200]=eu,h[201]=nd),h[202]!==tz||h[203]!==tN||h[204]!==eb||h[205]!==ex||h[206]!==ey||h[207]!==tF||h[208]!==t2||h[209]!==t4||h[210]!==x||h[211]!==t$||h[212]!==T||h[213]!==v||h[214]!==y||h[215]!==e3||h[216]!==nd||h[217]!==ep||h[218]!==tH?(r={actions:tz,badges:tN,documentId:eb,documentIdRaw:ex,documentType:ey,fieldActions:tF,index:x,menuItemGroups:nd,maximized:T,onPaneClose:t2,onPaneSplit:t4,onSetMaximizedPane:v,paneKey:y,schemaType:e3,title:ep,views:tH,unstable_languageFilter:t$},h[202]=tz,h[203]=tN,h[204]=eb,h[205]=ex,h[206]=ey,h[207]=tF,h[208]=t2,h[209]=t4,h[210]=x,h[211]=t$,h[212]=T,h[213]=v,h[214]=y,h[215]=e3,h[216]=nd,h[217]=ep,h[218]=tH,h[219]=r):r=h[219];let nc=r,nu=(0,d.useRef)(void 0),np=ej.path,nm;h[220]!==tb||h[221]!==ty||h[222]!==tk?(nm=e=>{let t=(0,R.ujC)(tk);e!==nu.current&&e!==t&&ty((0,Q.Y7)(tb.current?.value,(0,Q.sH)(e)))},h[220]=tb,h[221]=ty,h[222]=tk,h[223]=nm):nm=h[223];let nh=(0,eI.J)(nm),nb;h[224]!==np||h[225]!==tJ||h[226]!==nh?(nb=()=>{tJ&&np&&nh(np),nu.current=np},h[224]=np,h[225]=tJ,h[226]=nh,h[227]=nb):nb=h[227],h[228]!==np||h[229]!==tJ?(l=[np,tJ],h[228]=np,h[229]=tJ,h[230]=l):l=h[230],(0,d.useEffect)(nb,l);let ny=ew&&!!(th&&e3),nj;h[231]!==ti||h[232]!==th||h[233]!==ny||h[234]!==e3||h[235]!==tr||h[236]!==tm._id?(nj=ny&&th&&e3?{enabled:!0,upstreamEditState:tr,editState:ti,subjectId:tm._id,schemaType:e3,formState:th}:{enabled:!1}
1,h[231]=ti,h[232]=th,h[233]=ny,h[234]=e3,h[235]=tr,h[236]=tm._id,h[237]=nj):nj=h[237];let nv=nj,n_;return h[238]===ty?n_=h[239]:(n_=(0,A.jsx)(lZ,{onProgrammaticFocus:ty}),h[238]=ty,h[239]=n_),h[240]!==tq||h[241]!==nn||h[242]!==tJ||h[243]!==e3?(o=(0,A.jsx)(lW,{isDeleted:nn,displayed:tq,ready:tJ,schemaType:e3}),h[240]=tq,h[241]=nn,h[242]=tJ,h[243]=e3,h[244]=o):o=h[244],h[245]===f?s=h[246]:(s=(0,A.jsx)(R.CJG,{children:f}),h[245]=f,h[246]=s),h[247]!==nv||h[248]!==n_||h[249]!==o||h[250]!==s?(c=(0,A.jsxs)(R.vHp,{...nv,children:[n_,o,s]}),h[247]=nv,h[248]=n_,h[249]=o,h[250]=s,h[251]=c):c=h[251],h[252]!==ns||h[253]!==c?(u=(0,A.jsx)(B.Fi.Provider,{value:ns,children:c}),h[252]=ns,h[253]=c,h[254]=u):u=h[254],h[255]!==nc||h[256]!==u?(p=(0,A.jsx)(B.lQ.Provider,{value:nc,children:u}),h[255]=nc,h[256]=u,h[257]=p):p=h[257],p}let lZ=e=>{let t,n=(0,P.c)(8),{onProgrammaticFocus:i}=e,r=(0,R.ycZ)(),l=r.enabled?r.state.focusedDivergence:void 0,o;n[0]!==r.enabled||n[1]!==r.state||n[2]!==i?(o=()=>{r.enabled&&void 0!==r.state.focusedDivergence&&i((0,Q.sH)(r.state.focusedDivergence))},n[0]=r.enabled,n[1]=r.state,n[2]=i,n[3]=o):o=n[3];let a=(0,eI.J)(o),s;return n[4]===a?s=n[5]:(s=()=>{a()},n[4]=a,n[5]=s),n[6]===l?t=n[7]:(t=[l],n[6]=l,n[7]=t),(0,d.useEffect)(s,t),null},l0=e=>{let t,n,i=(0,P.c)(39),{params:r}=tc(),l=void 0===r?nf:r,o=or(e.pane.options,l),a=!!(0,R.I07)().get(o.type)?.liveEdit,{selectedPerspectiveName:s,selectedPerspective:d,selectedVariantName:c}=(0,R.QO2)(),{data:u}=(0,R.gJZ)(),p;i[0]===o.id?p=i[1]:(p=(0,R.IMx)(o.id),i[0]=o.id,i[1]=p),i[2]===p?t=i[3]:(t={documentId:p},i[2]=p,i[3]=t);let{versions:m}=(0,R.gn8)(t),h;i[4]===o.id?h=i[5]:(h=(0,R.IMx)(o.id),i[4]=o.id,i[5]=h);let f=(0,R.p_E)(h),x=(0,R.Dum)({bundle:"draft",variant:c,documentVersions:m}),{rev:g,since:b}=l,y=l.historyVersion,j;e:{if(a&&"drafts"===d&&!x){let e;i[6]===o.id?e=i[7]:(e=(0,R.IMx)(o.id),i[6]=o.id,i[7]=e),j=e;break e}if(y&&u.some(e=>(0,R._hI)(e._id)===y)){let e;i[8]!==y||i[9]!==o.id?(e=(0,R.ctg)(o.id,y),i[8]=y,i[9]=o.id,i[10]=e):e=i[10],j=e;break e}if("ready"===f.status&&void 0!==f.variant&&f.targetDocument){j=f.targetDocument._id;break e}if(void 0===s){let e;i[11]===o.id?e=i[12]:(e=(0,R.T4)(o.id),i[11]=o.id,i[12]=e),j=e;break e}if("published"===s){let e;i[13]===o.id?e=i[14]:(e=(0,R.IMx)(o.id),i[13]=o.id,i[14]=e),j=e;break e}if(0!==s.length){let e;i[15]!==o.id||i[16]!==s?(e=(0,R.ctg)(o.id,s),i[15]=o.id,i[16]=s,i[17]=e):e=i[17],j=e;break e}j=o.id}let v=j,_;i[18]!==v||i[19]!==o.type||i[20]!==g||i[21]!==b?(_={documentId:v,documentType:o.type,rev:g,since:b},i[18]=v,i[19]=o.type,i[20]=g,i[21]=b,i[22]=_):_=i[22];let I=(0,R.Sjd)(_),w=I.error,S=I.revision?.revisionId||null,C=!!(g&&!I.revision?.loading),k=I.revision?.document||null,T=I.sinceRevision?.document||null,D=!I.loading,E=0===I.events.length,z;i[23]!==I.error||i[24]!==I.lastNonDeletedRevId||i[25]!==T||i[26]!==D||i[27]!==E||i[28]!==S||i[29]!==C||i[30]!==k?(z={error:w,revisionId:S,onOlderRevision:C,revisionDocument:k,sinceDocument:T,ready:D,isPristine:E,lastNonDeletedRevId:I.lastNonDeletedRevId}
1,i[23]=I.error,i[24]=I.lastNonDeletedRevId,i[25]=T,i[26]=D,i[27]=E,i[28]=S,i[29]=C,i[30]=k,i[31]=z):z=i[31];let B=z,O;return i[32]!==B||i[33]!==y||i[34]!==e?(O=y?(0,A.jsx)(R.g19,{selectedPerspectiveName:y,excludedPerspectives:R.Mlv,children:(0,A.jsx)(lX,{...e,historyStore:B})}):(0,A.jsx)(lX,{...e,historyStore:B}),i[32]=B,i[33]=y,i[34]=e,i[35]=O):O=i[35],i[36]!==O||i[37]!==I?(n=(0,A.jsx)(R.tGd,{value:I,children:O}),i[36]=O,i[37]=I,i[38]=n):n=i[38],n},l1=e=>{let t,n=(0,P.c)(20),{pane:i}=e,r=tc(),l=or(i.options,r.params),o=r.params||nf,[a,s]=(0,d.useState)(null),c;n[0]===l.id?c=n[1]:(c=(0,R.IMx)(l.id),n[0]=l.id,n[1]=c),n[2]!==l.type||n[3]!==o.rev||n[4]!==o.since||n[5]!==c?(t={documentId:c,documentType:l.type,onError:s,rev:o.rev,since:o.since},n[2]=l.type,n[3]=o.rev,n[4]=o.since,n[5]=c,n[6]=t):t=n[6];let u=(0,R.Az$)(t),p=(0,R.SfM)(u,l2),m=(0,R.SfM)(u,l3),h=(0,R.SfM)(u,l4),f=(0,R.SfM)(u,l5),x=(0,R.SfM)(u,l6),g=(0,R.SfM)(u,l7),b=(0,R.SfM)(u,l8);m?.id;let y=m?.id||null,j=!!g,v;n[7]!==b||n[8]!==p||n[9]!==u||n[10]!==y||n[11]!==f||n[12]!==h||n[13]!==j||n[14]!==a||n[15]!==x?(v={store:u,error:a,revisionId:y,onOlderRevision:p,revisionDocument:f,sinceDocument:h,ready:x,isPristine:j,lastNonDeletedRevId:b},n[7]=b,n[8]=p,n[9]=u,n[10]=y,n[11]=f,n[12]=h,n[13]=j,n[14]=a,n[15]=x,n[16]=v):v=n[16];let _=v,I;return n[17]!==_||n[18]!==e?(I=(0,A.jsx)(lX,{...e,historyStore:_}),n[17]=_,n[18]=e,n[19]=I):I=n[19],I};function l2(e){return e.onOlderRevision}function l3(e){return e.revTime}function l4(e){return e.sinceAttributes}function l5(e){return e.timelineDisplayed}function l6(e){return e.timelineReady}function l7(e){return e.isPristine}function l8(e){return e.lastNonDeletedRevId}function l9(e){let t=(0,P.c)(5),{children:n}=e,i=tc(),{excludedPerspectives:r}=(0,R.QO2)(),l=(0,ee.rd)(),o="string"==typeof l.stickyParams.variant?l.stickyParams.variant:void 0,{scheduledDraft:a}=i.params;if(a){let e;return t[0]!==n||t[1]!==r||t[2]!==a||t[3]!==o?(e=(0,A.jsx)(R.g19,{selectedPerspectiveName:a,selectedVariantName:o,excludedPerspectives:r,children:n}),t[0]=n,t[1]=r,t[2]=a,t[3]=o,t[4]=e):e=t[4],e}return n}let oe=(0,d.memo)(e=>{let t,n=(0,P.c)(9),i=(0,R.For)(),{setParams:r,params:l}=tc(),o;n[0]!==l||n[1]!==r?(o=e=>{r({...l,scheduledDraft:e},{perspective:""})},n[0]=l,n[1]=r,n[2]=o):o=n[2];let a=o,s;return n[3]!==e||n[4]!==i.beta?.eventsAPI?.documents?(s=i.beta?.eventsAPI?.documents?(0,A.jsx)(l0,{...e}):(0,A.jsx)(l1,{...e}),n[3]=e,n[4]=i.beta?.eventsAPI?.documents,n[5]=s):s=n[5],n[6]!==a||n[7]!==s?(t=(0,A.jsx)(l9,{children:(0,A.jsx)(R.BRe,{onSetScheduledDraftPerspective:a,children:s})}),n[6]=a,n[7]=s,n[8]=t):t=n[8],t});oe.displayName="Memo(DocumentPaneProviderWrapper)";let ot=(0,d.memo)(function(e){let t,n=(0,P.c)(5),{name:i}=(0,R.For)(),r=e.pane.source||i,l;return n[0]===e?l=n[1]:(l=(0,A.jsx)(R.K1$,{children:(0,A.jsx)(on,{...e})}),n[0]=e,n[1]=l),n[2]!==r||n[3]!==l?(t=(0,A.jsx)(R.NeO,{name:r,children:l}),n[2]=r,n[3]=l,n[4]=t):t=n[4],t});function on(e){var t,n,i;let l,o,a,s,c,u,p,m=(0,P.c)(66),{pane:h,paneKey:f}=e,{resolveNewDocumentOptions:x}=(0,R.For)().document,{selectedPerspectiveName:g,selectedVariantName:b}=(0,R.QO2)(),y=tc(),j=or(h.options,y.params),{documentType:v,isLoaded:_}=(0,R.fRg)(j.id,j.type),I;m[0]===j.id?I=m[1]:(I=(0,R.IMx)(j.id),m[0]=j.id,m[1]=I);let w=(0,R.p_E)(I);!function(){let e,t,n,i=(0,P.c)(10),{params:r,setParams:l}=tc(),o=void 0===r?nf:r,{selectedPerspectiveName:a}=(0,R.QO2)(),s=(0,d.useRef)(!1),c;i[0]!==o||i[1]!==l?(c=e=>{["since","historyVersion","rev","preserveRev"].some(e=>o[e])&&l({...o,rev:"true"===o.preserveRev?o.rev:void 0,preserveRev:void 0,since:void 0,historyVersion:void 0})},i[0]=o,i[1]=l,i[2]=c):c=i[2];let u=(0,eI.J)(c),p;i[3]!==a||i[4]!==u?(p=()=>{s.current&&u(a)},i[3]=a,i[4]=u,i[5]=p):p=i[5],i[6]===a?e=i[7]:(e=[a],i[6]=a,i[7]=e),(0,d.useEffect)(p,e),i[8]===Symbol.for("react.memo_cache_sentinel")?(t=()=>(s.current=!0,()=>{s.current=!1}),n=[],i[8]=t,i[9]=n):(t=i[8],n=i[9]),(0,d.useEffect)(t,n)}();let S=((l=(0,P.c)(1))[0]===Symbol.for("react.memo_cache_sentinel")?(o={pick:t1,defaultComponent:lV},l[0]=o):o=l[0],(0,R.A1m)(o)),C;m[2]!==j.id||m[3]!==j.type||m[4]!==x?(C=x({type:"document",documentId:j.id,schemaType:j.type}),m[2]=j.id,m[3]=j.type,m[4]=x,m[5]=C):C=m[5];let k=C,T;m[6]===k?T=m[7]:(T={templateItems:k},m[6]=k,m[7]=T);let[D,z]=(0,R.CzS)(T),B=_&&!z,O;m[8]!==v||m[9]!==B||m[10]!==j||m[11]!==e?(O=B&&v&&j.type!==v?(t=e,n=j,i=v,{...t,pane:{...t.pane,options:{...n,type:i}}}
1):e,m[8]=v,m[9]=B,m[10]=j,m[11]=e,m[12]=O):O=m[12];let N=O,{ReferenceChildLink:L,handleEditReference:$,groupIndex:M,routerPanesState:H}=y,V;m[13]!==M||m[14]!==H?(V=H[M+1]?.[0].params||{},m[13]=M,m[14]=H,m[15]=V):V=m[15];let W=V,K=H.length,{parentRefPath:F}=W,J;m[16]!==M||m[17]!==F||m[18]!==K?(J=F?{path:(0,Q.sH)(F),state:M>=K-1?"none":M>=K-2?"selected":"pressed"}:{path:[],state:"none"},m[16]=M,m[17]=F,m[18]=K,m[19]=J):J=m[19];let U=J,{t:Y}=(0,R.Bdt)(r.I);if("*"===j.type&&!B){let e,t;return m[20]===Y?e=m[21]:(e=Y("panes.document-pane.document-not-found.loading"),m[20]=Y,m[21]=e),m[22]!==f||m[23]!==e?(t=(0,A.jsx)(ns,{flex:2.5,minWidth:320,paneKey:f,title:e}),m[22]=f,m[23]=e,m[24]=t):t=m[24],t}if(!v){let e,t,n,i,r;return m[25]===Y?e=m[26]:(e=Y("panes.document-pane.document-not-found.title"),m[25]=Y,m[26]=e),m[27]===j.id?t=m[28]:(t={id:j.id},m[27]=j.id,m[28]=t),m[29]===Symbol.for("react.memo_cache_sentinel")?(n={Code:oi},m[29]=n):n=m[29],m[30]!==Y||m[31]!==t?(i=(0,A.jsx)(E.O,{gap:4,children:(0,A.jsx)(E.et,{as:"p",children:(0,A.jsx)(R.HTc,{t:Y,i18nKey:"panes.document-pane.document-not-found.text",values:t,components:n})})}),m[30]=Y,m[31]=t,m[32]=i):i=m[32],m[33]!==f||m[34]!==e||m[35]!==i?(r=(0,A.jsx)(nl,{flex:2.5,minWidth:320,paneKey:f,title:e,children:i}),m[33]=f,m[34]=e,m[35]=i,m[36]=r):r=m[36],r}if(b&&"resolving"===w.status){let e,t;return m[37]===Y?e=m[38]:(e=Y("panes.document-pane.variant-target.loading"),m[37]=Y,m[38]=e),m[39]!==f||m[40]!==e?(t=(0,A.jsx)(ns,{flex:2.5,minWidth:320,paneKey:f,title:e}),m[39]=f,m[40]=e,m[41]=t):t=m[41],t}m[42]===w?a=m[43]:(a=(0,R._il)(w),m[42]=w,m[43]=a);let q=a,G=b?`-${b}-${"ready"===w.status?w.targetDocument?._id??"none":q?.id??w.status}`:"",X=`${v}-${j.id}-${g||""}${G}`,Z;return m[44]!==S||m[45]!==j.id||m[46]!==j.type?(Z=(0,A.jsx)(S,{documentId:j.id,documentType:j.type}),m[44]=S,m[45]=j.id,m[46]=j.type,m[47]=Z):Z=m[47],m[48]!==j.id||m[49]!==j.type||m[50]!==Z?(s=(0,A.jsx)(nd,{documentId:j.id,documentType:j.type,children:Z}),m[48]=j.id,m[49]=j.type,m[50]=Z,m[51]=s):s=m[51],m[52]!==j.id||m[53]!==j.type||m[54]!==s?(c=(0,A.jsx)(ni,{documentId:j.id,documentType:j.type,children:s}),m[52]=j.id,m[53]=j.type,m[54]=s,m[55]=c):c=m[55],m[56]!==L||m[57]!==U||m[58]!==$||m[59]!==c||m[60]!==D?(u=(0,A.jsx)(R.NO5,{EditReferenceLinkComponent:L,onEditReference:$,initialValueTemplateItems:D,activePath:U,children:c}),m[56]=L,m[57]=U,m[58]=$,m[59]=c,m[60]=D,m[61]=u):u=m[61],m[62]!==N||m[63]!==u||m[64]!==X?(p=(0,A.jsx)(oe,{...N,children:u},X),m[62]=N,m[63]=u,m[64]=X,m[65]=p):p=m[65],p}function oi(e){let{children:t}=e;return(0,A.jsx)("code",{children:t})}function or(e,t){let n=(0,P.c)(8),i;n[0]===t?i=n[1]:(i=void 0===t?{}:t,n[0]=t,n[1]=i);let r=i,l=(0,R.bgA)(),o;e:{let t;if(e.type&&"*"!==e.type){o=e;break e}let i=e.template||r.template,a;n[2]!==i||n[3]!==l?(a=i?l.find(e=>e.id===i):void 0,n[2]=i,n[3]=l,n[4]=a):a=n[4];let s=a?.schemaType;if(!s){o=e;break e}n[5]!==s||n[6]!==e?(t={...e,type:s},n[5]=s,n[6]=e,n[7]=t):t=n[7],o=t}return o}let ol=new WeakMap;function oo(e){let t=ol.get(e);if(t)return t;let n=(0,eF.Ak)();return ol.set(e,n),n}function oa(e){let t,n,i,l,o,a,s=(0,P.c)(16),{t:d}=(0,R.Bdt)(r.I),{layout:c,value:u}=e,p;return s[0]===Symbol.for("react.memo_cache_sentinel")?(p={Code:"code"},s[0]=p):p=s[0],s[1]===u._type?t=s[2]:(t={documentType:u._type},s[1]=u._type,s[2]=t),s[3]!==d||s[4]!==t?(n=(0,A.jsx)("em",{children:(0,A.jsx)(R.HTc,{t:d,i18nKey:"pane-item.missing-schema-type.title",components:p,values:t})}),s[3]=d,s[4]=t,s[5]=n):n=s[5],s[6]===Symbol.for("react.memo_cache_sentinel")?(i={Code:"code"},s[6]=i):i=s[6],s[7]===u._id?l=s[8]:(l={documentId:u._id},s[7]=u._id,s[8]=l),s[9]!==d||s[10]!==l?(o=(0,A.jsx)(R.HTc,{t:d,i18nKey:"pane-item.missing-schema-type.subtitle",components:i,values:l}),s[9]=d,s[10]=l,s[11]=o):o=s[11],s[12]!==c||s[13]!==n||s[14]!==o?(a=(0,A.jsx)(R.m6P,{title:n,subtitle:o,media:os,layout:c}),s[12]=c,s[13]=n,s[14]=o,s[15]=a):a=s[15],a}function os(){return(0,A.jsx)(H.WarningOutlineIcon,{})}function od(e,t,n){return!1!==e&&(e||t&&t.icon||n||!1)}function oc(e){let t,n,i=(0,P.c)(43),{icon:r,id:l,layout:o,pressed:a,schemaType:s,selected:c,sortOrder:u,title:p,value:m,margin:h,marginBottom:f,marginTop:x}=e,g=void 0===o?"default":o,b=(0,R.I07)(),y=(0,R.yKO)(),{ChildLink:j}=tc(),v=(0,R.cVB)(l),_=!!(s&&s.name&&b.get(s.name)),[I,w]=(0,d.useState)(!1),S;e:{let e,t,n,l;if(m&&(0,eQ.ME)(m)){let e,t;if(!s||!_){let e;i[0]===m?e=i[1]:(e=(0,A.jsx)(oa,{value:m}),i[0]=m,i[1]=e),S=e;break e}i[2]!==r||i[3]!==s?(e=od(r,s,eU.DocumentIcon),i[2]=r,i[3]=s,i[4]=e):e=i[4],i[5]!==v||i[6]!==y||i[7]!==g||i[8]!==s||i[9]!==u||i[10]!==e||i[11]!==m?(t=(0,A.jsx)(td,{documentPreviewStore:y,icon:e,layout:g,schemaType:s,sortOrder:u,value:m,presence:v}),i[5]=v,i[6]=y,i[7]=g,i[8]=s,i[9]=u,i[10]=e,i[11]=m,i[12]=t):t=i[12],S=t;break e}i[13]===Symbol.for("react.memo_cache_sentinel")?(e={opacity:.5},i[13]=e):e=i[13],i[14]===Symbol.for("react.memo_cache_sentinel")?(t=(0,A.jsx)(E.lt,{style:e,children:(0,A.jsx)(E.et,{muted:!0,size:1,children:(0,A.jsx)(eJ.ChevronRightIcon,{})})}),i[14]=t):t=i[14],i[15]!==r||i[16]!==s?(n=od(r,s,eY.FolderIcon),i[15]=r,i[16]=s,i[17]=n):n=i[17],i[18]!==n||i[19]!==p?(l=(0,A.jsx)(R.m6P,{status:t,icon:n,layout:"compact",title:p}),i[18]=n,i[19]=p,i[20]=l):l=i[20],S=l}let C=S,k;i[21]===Symbol.for("react.memo_cache_sentinel")?(k=e=>{e.metaKey?w(!1):w(!0)},i[21]=k):k=i[21];let T=k,D;i[22]===Symbol.for("react.memo_cache_sentinel")?(D=()=>w(!1),i[22]=D):D=i[22],i[23]===c?t=i[24]:(t=[c],i[23]=c,i[24]=t),(0,d.useEffect)(D,t);
1let[z,B]=(0,d.useState)(!1),O=(0,d.useRef)(null),N;i[25]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{O.current=setTimeout(()=>(0,d.startTransition)(()=>B(!0)),400)},i[25]=N):N=i[25];let L=N,$;i[26]===Symbol.for("react.memo_cache_sentinel")?($=()=>{O.current&&clearTimeout(O.current),(0,d.startTransition)(()=>B(!1))},i[26]=$):$=i[26];let M=$,H=`pane-item-${p}`,V=c||I,W;return i[27]!==l||i[28]!==z||i[29]!==s||i[30]!==m?(W=z&&s?.name&&m&&(0,eQ.ME)(m)&&(0,A.jsx)(ou,{documentId:l,documentType:s.name}),i[27]=l,i[28]=z,i[29]=s,i[30]=m,i[31]=W):W=i[31],i[32]!==l||i[33]!==h||i[34]!==f||i[35]!==x||i[36]!==a||i[37]!==C||i[38]!==W||i[39]!==H||i[40]!==j||i[41]!==V?(n=(0,A.jsxs)(R.Ns2,{"data-testid":H,__unstable_focusRing:!0,as:j,childId:l,"data-as":"a",margin:h,marginBottom:f,marginTop:x,onClick:T,onMouseEnter:L,onMouseLeave:M,pressed:a,radius:2,selected:V,sizing:"border",tabIndex:-1,tone:"inherit",children:[C,W]}),i[32]=l,i[33]=h,i[34]=f,i[35]=x,i[36]=a,i[37]=C,i[38]=W,i[39]=H,i[40]=j,i[41]=V,i[42]=n):n=i[42],n}function ou(e){let t=(0,P.c)(2),{documentId:n,documentType:i}=e,r;return t[0]===n?r=t[1]:(r=(0,R.IMx)(n),t[0]=n,t[1]=r),(0,R.zX2)(r,i),null}function op(e){let{intent:t,ref:n,...i}=e,r=(0,d.useMemo)(()=>{function e(e){let{ref:n,...i}=e;return(0,A.jsx)(ee.RZ,{...i,intent:t.type,params:t.params,ref:n,searchParams:t.searchParams})}return e.displayName="Link",e},[t]);return e.disabled?(0,A.jsx)(o.a,{...i,as:"a",role:"link","aria-disabled":"true"}):(0,A.jsx)(o.a,{...i,as:r,"data-as":"a",ref:n})}function om(e){let t,n,i,l=(0,P.c)(12),{reveal:a,context:s,loading:d,children:c}=e,u=(0,R.iZK)(),{t:p}=(0,R.Bdt)(r.I);if(!a){let e;return l[0]===c?e=l[1]:(e=(0,A.jsx)(A.Fragment,{children:c}),l[0]=c,l[1]=e),e}return l[2]!==s||l[3]!==u||l[4]!==d||l[5]!==p?(t=d?p("insufficient-permissions-message-tooltip.loading-text"):(0,A.jsx)(R.TLO,{context:s,currentUser:u}),l[2]=s,l[3]=u,l[4]=d,l[5]=p,l[6]=t):t=l[6],l[7]===c?n=l[8]:(n=(0,A.jsx)("div",{children:c}),l[7]=c,l[8]=n),l[9]!==t||l[10]!==n?(i=(0,A.jsx)(o.o,{content:t,portal:!0,children:n}),l[9]=t,l[10]=n,l[11]=i):i=l[11],i}ou.displayName="PreloadDocumentPane";let oh={constrainSize:!0,placement:"bottom",portal:!0},of=(e,t,n)=>{let i=e.find(e=>e.id===t.templateId)?.schemaType;if(!i)return null;let r={template:t.templateId,type:i,version:n,id:t.initialDocumentId};return{type:"create",params:t.parameters?[r,t.parameters]:r,searchParams:n?[["perspective",n]]:void 0}};function ox({templateItems:e}){let t=(0,R.bgA)(),{selectedReleaseId:n}=(0,R.QO2)(),{t:i}=(0,R.Bdt)(r.I),l=(0,R.Bvg)([...e,...t]),[a,s]=(0,R.CzS)({templateItems:e}),c=(0,d.useMemo)(()=>!s&&a?.length!==0&&a?.every(e=>!e.granted),[s,a]),u=(0,d.useMemo)(()=>a?a.reduce((e,t)=>(e[t.id]=t,e),{}):{},[a]);if(0===e.length)return null;if(c)return(0,A.jsx)(om,{context:"create-document-type",reveal:!0,loading:s,children:(0,A.jsx)(o.a,{"aria-label":i("pane-header.disabled-created-button.aria-label"),icon:eG.AddIcon,"data-testid":"action-intent-button",disabled:!0,mode:"bleed",tooltipProps:null})});if(1===e.length){let r=e[0],o=!u[r.id]?.granted,a=of(t,r,n);return a?(0,A.jsx)(om,{reveal:o,loading:s,context:"create-document-type",children:(0,A.jsx)(op,{"aria-label":l(r).title,icon:eG.AddIcon,intent:a,mode:"bleed",disabled:o,"data-testid":"action-intent-button",tooltipProps:{content:i("pane-header.create-new-button.tooltip")}})}):null}return(0,A.jsx)(o.r,{button:(0,A.jsx)(o.a,{icon:eG.AddIcon,mode:"bleed","data-testid":"multi-action-intent-button",tooltipProps:{content:i("pane-header.create-new-button.tooltip")}}),id:"create-menu",menu:(0,A.jsx)(E.p,{children:e.map((e,r)=>{let a=!u[e.id]?.granted,d=of(t,e,n),c=t.find(t=>t.id===e.templateId);if(!c||!d)return null;let p=e=>{let{ref:t,...n}=e;return a?(0,A.jsx)("button",{type:"button",disabled:!0,...n,ref:t}):(0,A.jsx)(ee.RZ,{...n,intent:d.type,params:d.params,searchParams:d.searchParams,ref:t})};p.displayName="Link";let{title:m}=l({...e,title:e.title||l(c).title});return(0,A.jsx)(om,{context:"create-document-type",reveal:a,loading:s,children:(0,A.jsx)(o.t,{as:p,"data-as":a?"button":"a",icon:e.icon,text:m,"aria-label":a?i("pane-header.disabled-created-button.aria-label"):m,disabled:a,"data-testid":`action-intent-button-${r}`})},e.id)})}),popover:oh})}function og(e){return null!=e}let ob=(0,d.memo)(function(e){let t,n,i,r=(0,P.c)(31),{initialValueTemplateItems:l,menuItems:o,menuItemGroups:a,actionHandlers:s}=e,d=void 0===l?R.Mlv:l,c=void 0===o?R.Mlv:o,u=void 0===a?R.Mlv:a,p=void 0===s?R.MlF:s,m=(0,R.bgA)(),h;r[0]===p?h=r[1]:(h=e=>{if(e.id){let t=p.setMenuItemState;if(t&&t({_menuItemId:e.id,...e.params}),!e.action||"setMenuItemState"===e.action)return!!t}if("string"==typeof e.action&&!(e.action in p))return console.warn("No handler for action:",e.action),!1;let t="function"==typeof e.action?e.action:"string"==typeof e.action?p[e.action]:null;return!!t&&(t(e.id?{...e.params,_menuItemId:e.id,isSelected:!e.selected}:{...e.params,isSelected:!e.selected}),!0)},r[0]=p,r[1]=h);let f=h,x;r[2]!==f||r[3]!==u||r[4]!==c?(x=i5({actionHandler:f,menuItemGroups:u,menuItems:c.filter(oy)}),r[2]=f,r[3]=u,r[4]=c,r[5]=x):x=r[5];let g=x,b;r[6]===g?b=r[7]:(b=g.filter(i3),r[6]=g,r[7]=b);let y=b,j;r[8]===g?j=r[9]:(j=g.filter(i4),r[8]=g,r[9]=j);let v=j,_;r[10]===v?_=r[11]:(_=v.some(oj),r[10]=v,r[11]=_);let I=_,w;if(r[12]!==c||r[13]!==m){let e;r[15]===m?e=r[16]:(e=(e,t)=>{if(e.intent?.type!=="create")return null;let{params:n}=e.intent;if(!n)return null;let i=Array.isArray(n)?n[0]:n,r=Array.isArray(n)?n[1]:void 0,l=i.template||i.type;if(!l)return null;
1let o=m.find(e=>e.id===l);return o?{item:e,template:o,templateParams:r,menuItemIndex:t,initialDocumentId:i.id}:null},r[15]=m,r[16]=e),w=c.map(e).filter(og).map(ov),r[12]=c,r[13]=m,r[14]=w}else w=r[14];let S=w,C;r[17]!==S||r[18]!==d?(C=(0,eq.A)([...S,...d],o_),r[17]=S,r[18]=d,r[19]=C):C=r[19];let k=C,T;return r[20]===k?T=r[21]:(T=(0,A.jsx)(ox,{templateItems:k}),r[20]=k,r[21]=T),r[22]===y?t=r[23]:(t=y.map(oI),r[22]=y,r[23]=t),r[24]!==v||r[25]!==I?(n=I&&(0,A.jsx)(iQ,{nodes:v}),r[24]=v,r[25]=I,r[26]=n):n=r[26],r[27]!==T||r[28]!==t||r[29]!==n?(i=(0,A.jsxs)(E.at,{gap:1,children:[T,t,n]}),r[27]=T,r[28]=t,r[29]=n,r[30]=i):i=r[30],i});function oy(e){return e.intent?.type!=="create"}function oj(e){return"item"===e.type||"group"===e.type&&e.children.length>0}function ov(e){let{initialDocumentId:t,item:n,template:i,menuItemIndex:r,templateParams:l}=e;return{id:`menuItem${r}`,initialDocumentId:t,templateId:i.id,type:"initialValueTemplateItem",title:n.title||i.title,i18n:n.i18n||i.i18n,icon:n.icon,description:i.description,parameters:l,schemaType:i.schemaType}}function o_(e){var t=[e.initialDocumentId,e.templateId,e.parameters];let n=e=>"object"==typeof e&&e?Array.isArray(e)?e.map(n):Object.entries(e).sort(([e],[t])=>e.localeCompare(t,"en")):e;return JSON.stringify(n(JSON.parse(JSON.stringify(t))))}function oI(e){return(0,A.jsx)(iG,{node:e},e.key)}let ow=function(e){let t=(0,P.c)(12),n,i;t[0]===e?(n=t[1],i=t[2]):({ref:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let{routerPanesState:r,groupIndex:l}=(0,d.useContext)(B.l4),o;t[3]!==l||t[4]!==r?(o=r.slice(0,l),t[3]=l,t[4]=r,t[5]=o):o=t[5];let a=o,s;t[6]===a?s=t[7]:(s={panes:a},t[6]=a,t[7]=s);let c=s,u;return t[8]!==n||t[9]!==i||t[10]!==c?(u=(0,A.jsx)(ee.s8,{...i,ref:n,state:c}),t[8]=n,t[9]=i,t[10]=c,t[11]=u):u=t[11],u},oS=(0,G.g_)({name:"Document Published",version:1,description:'User clicked the "Publish" button in the document pane'}),oC=(0,G.g_)({name:"Publish Button Clicked",version:1,description:"Logs when a publish operation is started, completed, or failed"}),ok=(0,G.g_)({name:"Publish Button Becomes Disabled - Started",version:1,description:"Logs when the publish button becomes disabled"}),oT=(0,G.g_)({name:"Publish Button Becomes Disabled - Completed",version:1,description:"Logs when the publish button becomes enabled again"}),oD=(0,G.g_)({name:"Document Deleted",version:1,description:"Logs when a document delete is confirmed, completed, or failed, including how many documents referred to it"}),oP={NOTHING_TO_DELETE:"action.delete.disabled.nothing-to-delete",NOT_READY:"action.delete.disabled.not-ready",TARGET_NOT_FOUND:"action.delete.disabled.target-not-found"},oA=e=>{let t,n=(0,P.c)(48),{id:i,type:l,draft:o}=e,{targetDocumentState:a}=e9(),s="ready"===a.status,c,u;n[0]===a?(c=n[1],u=n[2]):(c=(0,R.LEK)(a),u=(0,R.zPk)(c),n[0]=a,n[1]=c,n[2]=u);let p=u,m;n[3]===a?m=n[4]:(m=(0,R.Uyl)(a),n[3]=a,n[4]=m);let{delete:h}=(0,R.QSs)(i,l,m),[f,x]=(0,d.useState)(!1),[g,j]=(0,d.useState)(!1),v=(0,R.q3J)(),_=(0,q.Jr)(),{t:w}=(0,R.Bdt)(r.I),S;n[5]===i?S=n[6]:(S={documentId:i},n[5]=i,n[6]=S);let{sortedDocumentList:C}=(0,R.A6c)(S),D;n[7]===C?D=n[8]:(D=C.some(R.KJ$),n[7]=C,n[8]=D);let E=D,z;n[9]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{j(!1)},n[9]=z):z=n[9];let B=z,O;n[10]!==h||n[11]!==v.pair||n[12]!==i||n[13]!==_||n[14]!==l?(O=(e,t)=>{let{totalReferenceCount:n,internalReferenceCount:r,crossDatasetReferenceCount:o}=t,a={documentId:i,referenceCount:n,internalReferenceCount:r,crossDatasetReferenceCount:o};j(!1),x(!0),_.log(oD,{...a,stage:"confirmed"}),(0,k._)(v.pair.operationEvents(i,l).pipe((0,b.p)(oE),(0,y.T)(oz),(0,T.w)({first:3e4}),(0,I.W)(oR))).then(e=>{"dropped"!==e&&_.log(oD,{...a,stage:"success"===e?"deleted":"failed"})}),h.execute(e),x(!1)},n[10]=h,n[11]=v.pair,n[12]=i,n[13]=_,n[14]=l,n[15]=O):O=n[15];let N=O,L;n[16]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{j(!0)},n[16]=L):L=n[16];let $=L,M;n[17]!==i||n[18]!==c||n[19]!==l?(M={id:i,type:l,version:c,permission:"delete"},n[17]=i,n[18]=c,n[19]=l,n[20]=M):M=n[20];let[H,V]=(0,R.LyQ)(M),W=(0,R.iZK)();o?._id,H?.granted;e:{let e,r,a,d;if(p){t=null;break e}if(!V&&!H?.granted){let e,i,r;n[21]===w?e=n[22]:(e=w("action.delete.label"),n[21]=w,n[22]=e),n[23]===W?i=n[24]:(i=(0,A.jsx)(R.TLO,{context:"delete-document",currentUser:W}),n[23]=W,n[24]=i),n[25]!==e||n[26]!==i?(r={tone:"critical",icon:eZ.TrashIcon,disabled:!0,label:e,title:i},n[25]=e,n[26]=i,n[27]=r):r=n[27],t=r;break e}n[28]!==h.disabled||n[29]!==E||n[30]!==w?(e=()=>E?w("action.delete.disabled.scheduled-release"):h.disabled?w(oP[h.disabled]):"",n[28]=h.disabled,n[29]=E,n[30]=w,n[31]=e):e=n[31];let c=e,u=f||E||!!h.disabled||V||!s,m;n[32]===c?m=n[33]:(m=c(),n[32]=c,n[33]=m),n[34]!==f||n[35]!==w?(r=w(f?"action.delete.running.label":"action.delete.label"),n[34]=f,n[35]=w,n[36]=r):r=n[36],n[37]!==o?._id||n[38]!==N||n[39]!==i||n[40]!==g||n[41]!==l?(a=g&&{type:"custom",component:(0,A.jsx)(tk,{action:"delete",id:o?._id||i,type:l,onCancel:B,onConfirm:N})},n[37]=o?._id,n[38]=N,n[39]=i,n[40]=g,n[41]=l,n[42]=a):a=n[42],n[43]!==u||n[44]!==m||n[45]!==r||n[46]!==a?(d={tone:"critical",icon:eZ.TrashIcon,disabled:u,title:m,label:r,shortcut:"Ctrl+Alt+D",onHandle:$,dialog:a},n[43]=u,n[44]=m,n[45]=r,n[46]=a,n[47]=d):d=n[47],t=d}return t};function oE(e){return"delete"===e.op}function oz(e){return e.type}function oR(){return(0,m.of)("dropped")}function oB(e){let t,n,i,o,a,s=(0,P.c)(18),{publishedExists:c,onCancel:u,onConfirm:p}=e,{t:m}=(0,R.Bdt)(r.I),h=`deletion-confirmation-${(0,d.useId)()}`,f;return s[0]===m?f=s[1]:(f=m("action.discard-changes.confirm-dialog.header.text"),s[0]=m,s[1]=f),s[2]===m?t=s[3]:(t=m("action.discard-changes.label"),s[2]=m,s[3]=t),s[4]!==p||s[5]!==t?(n={confirmButton:{text:t,onClick:p}},s[4]=p,s[5]=t,s[6]=n):n=s[6],s[7]!==c||s[8]!==m?(i=m(c?"action.discard-changes.confirm-dialog.confirm-discard-changes":"action.discard-changes.confirm-dialog.confirm-discard-changes-draft"),s[7]=c,s[8]=m,s[9]=i):i=s[9],s[10]===i?o=s[11]:(o=(0,A.jsx)(E.et,{size:1,children:i}),s[10]=i,s[11]=o),s[12]!==h||s[13]!==u||s[14]!==f||s[15]!==n||s[16]!==o?(a=(0,A.jsx)(l.i,{width:1,id:h,header:f,footer
1:n,onClose:u,onClickOutside:u,children:o}),s[12]=h,s[13]=u,s[14]=f,s[15]=n,s[16]=o,s[17]=a):a=s[17],a}oA.action="delete",oA.displayName="DeleteAction";let oO={NO_CHANGES:"action.discard-changes.disabled.no-change",NOT_PUBLISHED:"action.discard-changes.disabled.not-published",NOT_READY:"action.discard-changes.disabled.not-ready",TARGET_NOT_FOUND:"action.discard-changes.disabled.target-not-found"},oN=e=>{let t,n=(0,P.c)(33),{id:i,type:l,published:o,version:a,draft:s}=e,{displayed:c,targetDocumentState:u}=e9(),p="ready"===u.status,m;n[0]===u?m=n[1]:(m=(0,R.LEK)(u),n[0]=u,n[1]=m);let h=m,f=p&&void 0!==u.variant?void 0!==u.publishedSibling:!!o,x;n[2]===u?x=n[3]:(x=(0,R.Uyl)(u),n[2]=u,n[3]=x);let{discardChanges:g}=(0,R.QSs)(i,l,x),[b,y]=(0,d.useState)(!1),j;n[4]!==i||n[5]!==h||n[6]!==l?(j={id:i,type:l,version:h,permission:"discardDraft"},n[4]=i,n[5]=h,n[6]=l,n[7]=j):j=n[7];let[v,_]=(0,R.LyQ)(j),I=(0,R.iZK)(),{t:w}=(0,R.Bdt)(r.I),S=c?._id&&(0,R._4P)(c?._id),C;n[8]===g?C=n[9]:(C=()=>{g.execute(),y(!1)},n[8]=g,n[9]=C);let k=C,T;n[10]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{y(!1)},n[10]=T):T=n[10];let D=T,E;n[11]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{y(!0)},n[11]=E):E=n[11];let z=E;v?.granted;e:{let e,i,r;if(!a&&!s||S){t=null;break e}if(!_&&!v?.granted){let e,i,r;n[12]===w?e=n[13]:(e=w("action.discard-changes.label"),n[12]=w,n[13]=e),n[14]===I?i=n[15]:(i=(0,A.jsx)(R.TLO,{context:"discard-changes",currentUser:I}),n[14]=I,n[15]=i),n[16]!==e||n[17]!==i?(r={tone:"critical",icon:e0.ResetIcon,disabled:!0,label:e,title:i},n[16]=e,n[17]=i,n[18]=r):r=n[18],t=r;break e}let l=!!g.disabled||_||!p,o=g.disabled&&oO[g.disabled]||"",d;n[19]!==w||n[20]!==o?(d=w(o),n[19]=w,n[20]=o,n[21]=d):d=n[21],n[22]===w?e=n[23]:(e=w("action.discard-changes.label"),n[22]=w,n[23]=e),n[24]!==k||n[25]!==b||n[26]!==f?(i=b&&{type:"custom",component:(0,A.jsx)(oB,{onCancel:D,onConfirm:k,publishedExists:f})},n[24]=k,n[25]=b,n[26]=f,n[27]=i):i=n[27],n[28]!==d||n[29]!==e||n[30]!==i||n[31]!==l?(r={tone:"critical",icon:e0.ResetIcon,disabled:l,title:d,label:e,onHandle:z,dialog:i},n[28]=d,n[29]=e,n[30]=i,n[31]=l,n[32]=r):r=n[32],t=r}return t};oN.action="discardChanges",oN.displayName="DiscardChangesAction";let oL={NOTHING_TO_DUPLICATE:"action.duplicate.disabled.nothing-to-duplicate",NOT_READY:"action.duplicate.disabled.not-ready",TARGET_NOT_FOUND:"action.duplicate.disabled.target-not-found"},o$=e=>{let t,n=(0,P.c)(33),{id:i,type:l,mapDocument:o}=e,a=(0,R.q3J)(),{targetDocumentState:s}=e9(),c="ready"===s.status,u;n[0]===s?u=n[1]:(u=(0,R.LEK)(s),n[0]=s,n[1]=u);let p=u,m;n[2]===s?m=n[3]:(m=(0,R.Uyl)(s),n[2]=s,n[3]=m);let{duplicate:h}=(0,R.QSs)(i,l,m),{navigateIntent:f}=(0,ee.rd)(),[x,g]=(0,d.useState)(!1),y;n[4]!==i||n[5]!==p||n[6]!==l?(y={id:i,type:l,version:p,permission:"duplicate"},n[4]=i,n[5]=p,n[6]=l,n[7]=y):y=n[7];let[j,v]=(0,R.LyQ)(y),{t:_}=(0,R.Bdt)(r.I),I=(0,R.iZK)(),w;n[8]!==a.pair||n[9]!==h||n[10]!==i||n[11]!==o||n[12]!==f||n[13]!==l?(w=async()=>{let e=(0,e1.A)();g(!0);let t=(0,k._)(a.pair.operationEvents(i,l).pipe((0,b.p)(oM)));h.execute(e,{mapDocument:o}),await t,f("edit",{id:e,type:l}),g(!1)},n[8]=a.pair,n[9]=h,n[10]=i,n[11]=o,n[12]=f,n[13]=l,n[14]=w):w=n[14];let S=w;j?.granted;e:{let e,i;if(!v&&!j?.granted){let e,i,r;n[15]===_?e=n[16]:(e=_("action.duplicate.label"),n[15]=_,n[16]=e),n[17]===I?i=n[18]:(i=(0,A.jsx)(R.TLO,{context:"duplicate-document",currentUser:I}),n[17]=I,n[18]=i),n[19]!==e||n[20]!==i?(r={icon:L.CopyIcon,disabled:!0,label:e,title:i},n[19]=e,n[20]=i,n[21]=r):r=n[21],t=r;break e}let r=x||!!h.disabled||v||!c,l;n[22]!==x||n[23]!==_?(l=_(x?"action.duplicate.running.label":"action.duplicate.label"),n[22]=x,n[23]=_,n[24]=l):l=n[24],n[25]!==h.disabled||n[26]!==_?(e=h.disabled?_(oL[h.disabled]):"",n[25]=h.disabled,n[26]=_,n[27]=e):e=n[27],n[28]!==S||n[29]!==r||n[30]!==l||n[31]!==e?(i={icon:L.CopyIcon,disabled:r,label:l,title:e,onHandle:S},n[28]=S,n[29]=r,n[30]=l,n[31]=e,n[32]=i):i=n[32],t=i}return t};function oM(e){return"duplicate"===e.op&&"success"===e.type}o$.action="duplicate",o$.displayName="DuplicateAction";let oH={LIVE_EDIT_ENABLED:"action.publish.live-edit.publish-disabled",ALREADY_PUBLISHED:"action.publish.already-published.no-time-ago.tooltip",NO_CHANGES:"action.publish.no-changes.tooltip",NOT_READY:"action.publish.disabled.not-ready",NOT_PUBLISHABLE:"action.publish.disabled.not-publishable",TARGET_NOT_FOUND:"action.publish.disabled.target-not-found"},oV={status:"published"};function oW(e,t,n){return"ALREADY_PUBLISHED"===e&&t?(0,A.jsx)(oK,{publishedAt:t}):n(oH[e])}function oK(e){let t,n=(0,P.c)(6),{publishedAt:i}=e,{t:l}=(0,R.Bdt)(r.I),o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={useTemporalPhrase:!0},n[0]=o):o=n[0];let a=(0,R.Vq9)(i,o),s;return n[1]!==l||n[2]!==a?(s=l("action.publish.already-published.tooltip",{timeSincePublished:a}),n[1]=l,n[2]=a,n[3]=s):s=n[3],n[4]===s?t=n[5]:(t=(0,A.jsx)(E.et,{children:s}),n[4]=s,n[5]=t),t}let oF=e=>{let t,n,i,l,o,a=(0,P.c)(107),{id:s,type:c,liveEdit:u,draft:p,published:m,release:h,version:f}=e,{selectedPerspective:x,selectedVariantName:g}=(0,R.QO2)(),[b,y]=(0,d.useState)(null),{changesOpen:j,documentId:v,documentType:_,value:I,targetDocumentState:w}=e9(),S="ready"===w.status,C;a[0]===w?C=a[1]:(C=(0,R.LEK)(w),a[0]=w,a[1]=C);let k=C,T=S&&void 0!==w.variant,D=T?w.publishedSibling:m,E=T?w.publishedSibling?._rev:void 0,B;a[2]===w?B=a[3]:(B=(0,R.Uyl)(w),a[2]=w,a[3]=B);let{publish:O}=(0,R.QSs)(s,c,B),N=(0,R.dWw)(I._id,c,!h),L=(0,R.M7h)(s,c,k),$=(0,R.zX2)(v,_,"default",k),{t:M}=(0,R.Bdt)(r.I),H;a[4]!==$?.draft||a[5]!==$?.published||a[6]!==$?.version?(H=$?.ver
1sion||$?.draft||$?.published||{},a[4]=$?.draft,a[5]=$?.published,a[6]=$?.version,a[7]=H):H=a[7];let V=H._rev,W=(0,z.dj)(),K;a[8]===N.validation?K=a[9]:(K=N.validation.some(eQ.Uw),a[8]=N.validation,a[9]=K);let F=K,[J,U]=(0,d.useState)(!1),Y=L.isSyncing,Q=N.isValidating,G;a[10]!==s||a[11]!==k||a[12]!==c?(G={id:s,type:c,version:k,permission:"publish"},a[10]=s,a[11]=k,a[12]=c,a[13]=G):G=a[13];let[X,Z]=(0,R.LyQ)(G),ee=(0,R.iZK)(),et;a[14]!==F||a[15]!==O.disabled||a[16]!==D?._updatedAt||a[17]!==M?(et=O.disabled?oW(O.disabled,D?._updatedAt,M)||"":F?M("action.publish.validation-issues.tooltip"):"",a[14]=F,a[15]=O.disabled,a[16]=D?._updatedAt,a[17]=M,a[18]=et):et=a[18];let en=et,ei=D?._rev,er=(0,q.Jr)(),el;a[19]!==ei||a[20]!==s||a[21]!==T||a[22]!==O||a[23]!==E||a[24]!==er?(el=()=>{O.execute(T?{publishedRevisionId:E}:void 0),er.log(oC,{documentId:s,stage:"started"}),y({status:"publishing",publishRevision:ei})},a[19]=ei,a[20]=s,a[21]=T,a[22]=O,a[23]=E,a[24]=er,a[25]=el):el=a[25];let eo=el,ea;a[26]!==eo||a[27]!==F||a[28]!==Y||a[29]!==J||a[30]!==V||a[31]!==M||a[32]!==W||a[33]!==N.isValidating||a[34]!==N.revision?(ea=()=>{let e=!N.isValidating&&N.revision===V;J&&!Y&&e&&(F?W.push({title:M("action.publish.validation-issues-toast.title"),description:M("action.publish.validation-issues-toast.description"),status:"error"}):eo(),U(!1))},a[26]=eo,a[27]=F,a[28]=Y,a[29]=J,a[30]=V,a[31]=M,a[32]=W,a[33]=N.isValidating,a[34]=N.revision,a[35]=ea):ea=a[35],a[36]!==eo||a[37]!==F||a[38]!==Y||a[39]!==Q||a[40]!==J||a[41]!==V||a[42]!==M||a[43]!==W||a[44]!==N.isValidating||a[45]!==N.revision?(t=[Y,eo,F,J,N.revision,V,Q,N.isValidating,W,M],a[36]=eo,a[37]=F,a[38]=Y,a[39]=Q,a[40]=J,a[41]=V,a[42]=M,a[43]=W,a[44]=N.isValidating,a[45]=N.revision,a[46]=t):t=a[46],(0,d.useEffect)(ea,t),a[47]!==ei||a[48]!==s||a[49]!==b||a[50]!==er?(n=()=>{let e=b?.status==="publishing"&&ei!==b.publishRevision;e&&er.log(oC,{documentId:s,stage:"completed"});let t=e?oV:null,n=setTimeout(()=>{b?.status==="publishing"&&ei===b.publishRevision&&er.log(oC,{documentId:s,stage:"failed"}),y(t)},e?200:4e3);return()=>clearTimeout(n)},a[47]=ei,a[48]=s,a[49]=b,a[50]=er,a[51]=n):n=a[51],a[52]!==j||a[53]!==ei||a[54]!==s||a[55]!==b||a[56]!==er?(i=[j,b,ei,er,s],a[52]=j,a[53]=ei,a[54]=s,a[55]=b,a[56]=er,a[57]=i):i=a[57],(0,d.useEffect)(n,i);let es=!!((p||f)&&(J||$?.transactionSyncLock?.enabled||Z)),ed;a[58]!==$?.transactionSyncLock?.enabled||a[59]!==s||a[60]!==es||a[61]!==er?(ed=()=>{if(es)return er.log(ok,{documentId:s,isRemoteEvent:$?.transactionSyncLock?.enabled}),()=>{er.log(oT,{documentId:s,isRemoteEvent:$?.transactionSyncLock?.enabled})}},a[58]=$?.transactionSyncLock?.enabled,a[59]=s,a[60]=es,a[61]=er,a[62]=ed):ed=a[62];let ec=$?.transactionSyncLock?.enabled,eu;a[63]!==s||a[64]!==es||a[65]!==ec||a[66]!==er?(eu=[es,er,s,ec],a[63]=s,a[64]=es,a[65]=ec,a[66]=er,a[67]=eu):eu=a[67],(0,d.useEffect)(ed,eu),a[68]!==eo||a[69]!==p?._createdAt||a[70]!==D||a[71]!==V||a[72]!==L.isSyncing||a[73]!==er||a[74]!==N.isValidating||a[75]!==N.revision?(l=()=>{er.log(oS,{publishedImmediately:!p?._createdAt,previouslyPublished:!!D}),L.isSyncing||N.isValidating||N.revision!==V?U(!0):eo()},a[68]=eo,a[69]=p?._createdAt,a[70]=D,a[71]=V,a[72]=L.isSyncing,a[73]=er,a[74]=N.isValidating,a[75]=N.revision,a[76]=l):l=a[76],p?._createdAt;let ep=l;X?.granted,$?.transactionSyncLock?.enabled;e:{let e;if((0,R.xo4)(x)||h&&f||u&&!f){o=null;break e}if(m&&!p&&!f&&!g){let e,t;a[77]===M?e=a[78]:(e=M("action.publish.label"),a[77]=M,a[78]=e);let n=m?._updatedAt,i;a[79]!==M||a[80]!==n?(i=oW("ALREADY_PUBLISHED",n,M),a[79]=M,a[80]=n,a[81]=i):i=a[81],a[82]!==e||a[83]!==i?(t={tone:"default",icon:e2.PublishIcon,label:e,title:i,disabled:!0},a[82]=e,a[83]=i,a[84]=t):t=a[84],o=t;break e}if(!Z&&!X?.granted){let e,t,n;a[85]===M?e=a[86]:(e=M("action.publish.label"),a[85]=M,a[86]=e),a[87]===ee?t=a[88]:(t=(0,A.jsx)(R.TLO,{context:"publish-document",currentUser:ee}),a[87]=ee,a[88]=t),a[89]!==e||a[90]!==t?(n={tone:"default",icon:e2.PublishIcon,label:e,title:t,disabled:!0},a[89]=e,a[90]=t,a[91]=n):n=a[91],o=n;break e}let t=!!(J||$?.transactionSyncLock?.enabled||b?.status==="publishing"||b?.status==="published"||F||O.disabled||!S),n=t||Z,i;a[92]!==J||a[93]!==b?.status||a[94]!==M?(i=b?.status==="published"?M("action.publish.published.label"):J?M("action.publish.validation-in-progress.label"):b?.status==="publishing"?M("action.publish.running.label"):M("action.publish.draft.label"),a[92]=J,a[93]=b?.status,a[94]=M,a[95]=i):i=a[95],a[96]!==J||a[97]!==b?.status||a[98]!==M||a[99]!==en?(e=J?M("action.publish.waiting"):b?.status==="published"||b?.status==="publishing"?null:en,a[96]=J,a[97]=b?.status,a[98]=M,a[99]=en,a[100]=e):e
1=a[100];let r=t||J?null:"Ctrl+Alt+P",l;a[101]!==ep||a[102]!==n||a[103]!==i||a[104]!==e||a[105]!==r?(l={disabled:n,tone:"default",label:i,icon:e2.PublishIcon,title:e,shortcut:r,onHandle:ep},a[101]=ep,a[102]=n,a[103]=i,a[104]=e,a[105]=r,a[106]=l):l=a[106],o=l}return o};oF.action="publish",oF.displayName="PublishAction";let oJ={NOT_PUBLISHED:"action.unpublish.disabled.not-published",NOT_READY:"action.unpublish.disabled.not-ready",LIVE_EDIT_ENABLED:"action.unpublish.disabled.live-edit-enabled",TARGET_NOT_FOUND:"action.unpublish.disabled.target-not-found"},oU=e=>{let t,n=(0,P.c)(29),{id:i,type:l,draft:o,liveEditSchemaType:a,release:s}=e,{targetDocumentState:c}=e9(),u="ready"===c.status,p;n[0]===c?p=n[1]:(p=(0,R.LEK)(c),n[0]=c,n[1]=p);let m=p,h=!u||void 0===c.variant||void 0!==c.publishedSibling,f;n[2]===c?f=n[3]:(f=(0,R.Uyl)(c),n[2]=c,n[3]=f);let{unpublish:x}=(0,R.QSs)(i,l,f),[g,b]=(0,d.useState)(!1),y;n[4]!==i||n[5]!==m||n[6]!==l?(y={id:i,type:l,version:m,permission:"unpublish"},n[4]=i,n[5]=m,n[6]=l,n[7]=y):y=n[7];let[j,v]=(0,R.LyQ)(y),_=(0,R.iZK)(),{t:I}=(0,R.Bdt)(r.I),{selectedPerspective:w}=(0,R.QO2)(),S="drafts"===w,C;n[8]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{b(!1)},n[8]=C):C=n[8];let k=C,T;n[9]===x?T=n[10]:(T=()=>{b(!1),x.execute()},n[9]=x,n[10]=T);let D=T,E;e:{if(g){let e=o?._id||i,t;n[11]!==D||n[12]!==e||n[13]!==l?(t={type:"dialog",onClose:k,content:(0,A.jsx)(tk,{id:e,type:l,action:"unpublish",onCancel:k,onConfirm:D})},n[11]=D,n[12]=e,n[13]=l,n[14]=t):t=n[14],E=t;break e}E=null}let z=E,B;return n[15]!==_||n[16]!==z||n[17]!==S||n[18]!==v||n[19]!==u||n[20]!==h||n[21]!==a||n[22]!==j?.granted||n[23]!==s||n[24]!==I||n[25]!==x.disabled?(B=()=>s||S||a?null:v||j?.granted?h?{tone:"critical",icon:e_.UnpublishIcon,disabled:!!x.disabled||v||!u,label:I("action.unpublish.label"),title:x.disabled?I(oJ[x.disabled]):"",onHandle:()=>b(!0),dialog:z}:{tone:"critical",icon:e_.UnpublishIcon,disabled:!0,label:I("action.unpublish.label"),title:I(oJ.NOT_PUBLISHED)}:{tone:"critical",icon:e_.UnpublishIcon,label:"Unpublish",title:(0,A.jsx)(R.TLO,{context:"unpublish-document",currentUser:_}),disabled:!0},n[15]=_,n[16]=z,n[17]=S,n[18]=v,n[19]=u,n[20]=h,n[21]=a,n[22]=j?.granted,n[23]=s,n[24]=I,n[25]=x.disabled,n[26]=B):B=n[26],j?.granted,n[27]===B?t=n[28]:(t=B(),n[27]=B,n[28]=t),t};oU.action="unpublish",oU.displayName="UnpublishAction";let oY=e=>{let{liveEditSchemaType:t,version:n}=e;return t&&!n?{label:"Live",color:"danger"}:null};oY.displayName="LiveEditBadge";let oQ={activePanes:[]};function oq(e){oQ.activePanes=e}function oG(e,t,n,i){let r=n?.panes||[],l=oQ.activePanes||[],o=t.id||(0,e1.A)();for(let n=l.length-1;n>=0;n--){let a=l[n];if("object"==typeof a&&(a.canHandleIntent?.(e,t,{pane:a,index:n})||"documentList"===a.type&&a.schemaTypeName===t.type&&"_type == $type"===a.options.filter)){let l=function(e,t){switch(e){case"create":return{template:t.template,version:t.version};case"edit":{let{id:e,type:n,template:i,...r}=t;return r}default:return s.n}}(e,t);return{panes:r.slice(0,n).concat([[{id:o,params:l,payload:i}]])}}}return{intent:e,params:t,payload:i}}function oX(e){let t,n,i,r,l,o=(0,P.c)(14),{versionError:a}=e,{t:s}=(0,R.Bdt)("studio"),d;return o[0]===Symbol.for("react.memo_cache_sentinel")?(d=(0,A.jsx)(R.SxK,{tone:"critical",children:(0,A.jsx)(ed.ErrorOutlineIcon,{})}),o[0]=d):d=o[0],o[1]!==s||o[2]!==a?(t=s(a?"timeline.error.load-document-changes-version-title":"timeline.error.load-document-changes-title"),o[1]=s,o[2]=a,o[3]=t):t=o[3],o[4]===t?n=o[5]:(n=(0,A.jsx)(R.SxK,{size:1,tone:"critical",weight:"medium",children:t}),o[4]=t,o[5]=n),o[6]!==s||o[7]!==a?(i=s(a?"timeline.error.load-document-changes-version-description":"timeline.error.load-document-changes-description"),o[6]=s,o[7]=a,o[8]=i):i=o[8],o[9]===i?r=o[10]:(r=(0,A.jsx)(R.SxK,{size:1,tone:"critical",children:i}),o[9]=i,o[10]=r),o[11]!==n||o[12]!==r?(l=(0,A.jsxs)(E.at,{align:"flex-start",gap:3,padding:4,children:[d,(0,A.jsxs)(E.O,{gap:4,children:[n,r]})]}),o[11]=n,o[12]=r,o[13]=l):l=o[13],l}let oZ=(0,O.I4)(e3.ChevronLeftIcon).withConfig({displayName:"FlipIcon",componentId:"sc-z86omx-0"})`transition:transform 200ms;&[data-expanded='true']{transform:rotate(-90deg);}`;function o0(e){let t,n,i,l=(0,P.c)(14),{isExpanded:a,onExpand:s}=e,{t:d}=(0,R.Bdt)(r.I),c;l[0]!==a||l[1]!==s?(c=e=>{e.stopPropagation(),function(e){if(e)return;let t=document.getElementById(ao);if(t){let e=t.children[0];if(!(e.scrollHeight>e.clientHeight)){let t=getComputedStyle(e).overflowY;e.style.overflowY="hidden",setTimeout(()=>{e.style.overflowY=t},0)}}}(a),s()},l[0]=a,l[1]=s,l[2]=c):c=l[2];let u=c,p;return l[3]===a?p=l[4]:(p=(0,A.jsx)(oZ,{"data-expanded":a}),l[3]=a,l[4]=p),l[5]!==a||l[6]!==d?(t=d(a?"timeline-item.menu.action-collapse":"timeline-item.menu.action-expand"),l[5]=a,l[6]=d,l[7]=t):t=l[7],l[8]===t?n=l[9]:(n={content:t},l[8]=t,l[9]=n),l[10]!==u||l[11]!==p||l[12]!==n?(i=(0,A.jsx)(o.a,{mode:"bleed",icon:p,tooltipProps:n,onClick:u}),l[10]=u,l[11]=p,l[12]=n,l[13]=i):i=l[13],i}let o1=(0,O.I4)(E.O).withConfig({displayName:"StackWrapper",componentId:"sc-iw77b5-0"}
1)`max-width:200px;`,o2=(0,O.I4)(E.at).withConfig({displayName:"ListWrapper",componentId:"sc-iw77b5-1"})`max-height:${e=>e.$maxHeight};min-width:244px;`,o3=(0,O.I4)(E.lt).withConfig({displayName:"Root",componentId:"sc-iw77b5-2"})(({$visible:e})=>(0,O.AH)`opacity:0;pointer-events:none;transition:opacity 0.2s;${e&&(0,O.AH)`opacity:1;pointer-events:auto;`}`),o4={create:eG.AddIcon,delete:eZ.TrashIcon,discardDraft:Y.CloseIcon,initial:eG.AddIcon,editDraft:e4.EditIcon,editLive:e4.EditIcon,publish:e2.PublishIcon,unpublish:e_.UnpublishIcon};function o5(e){let t,n=(0,P.c)(9),{maxLength:i,userIds:r,size:l,withTooltip:o}=e,a=void 0===o||o,s;if(n[0]!==r||n[1]!==a){let e;n[3]===a?e=n[4]:(e=e=>(0,A.jsx)(R.H8m,{user:e,withTooltip:a},e),n[3]=a,n[4]=e),s=r.map(e),n[0]=r,n[1]=a,n[2]=s}else s=n[2];return n[5]!==i||n[6]!==l||n[7]!==s?(t=(0,A.jsx)(z.GE,{maxLength:i,size:l,children:s}),n[5]=i,n[6]=l,n[7]=s,n[8]=t):t=n[8],t}let o6=(0,O.I4)(E.at).withConfig({displayName:"IconBox",componentId:"sc-lh0xgb-0"})(e=>{let t=(0,eA.i)(e.theme),n=e.$color;return(0,O.AH)`--card-icon-color:${t.color.avatar[n].fg};background-color:${t.color.avatar[n].bg};box-shadow:0 0 0 1px var(--card-bg-color);position:absolute;width:${t.avatar.sizes[0].size}px;height:${t.avatar.sizes[0].size}px;right:-3px;bottom:-3px;border-radius:50%;`}),o7={initial:"blue",create:"blue",publish:"green",editLive:"green",editDraft:"yellow",unpublish:"orange",discardDraft:"orange",delete:"red",withinSelection:"magenta"},o8={minimal:!0,useTemporalPhrase:!0},o9=(0,O.I4)(z.EA).withConfig({displayName:"NameSkeleton",componentId:"sc-lh0xgb-1"})(e=>(0,O.AH)`width:6ch;height:${(0,eA.i)(e.theme).font.text.sizes[0].lineHeight}px;`),ae=e=>{let t,n,i=(0,P.c)(10),{userId:r}=e,[l,o]=(0,R.Jd3)(r),a;return i[0]!==o||i[1]!==l?(a=(0,A.jsx)(E.lt,{children:o||!l?(0,A.jsx)(R.LIN,{animated:!0}):(0,A.jsx)(R.H8m,{user:l})}),i[0]=o,i[1]=l,i[2]=a):a=i[2],i[3]!==o||i[4]!==l?(t=(0,A.jsx)(E.lt,{children:o||!l?.displayName?(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(o9,{animated:!0})}):(0,A.jsx)(E.et,{muted:!0,size:1,children:l.displayName})}),i[3]=o,i[4]=l,i[5]=t):t=i[5],i[6]!==a||i[7]!==t||i[8]!==r?(n=(0,A.jsxs)(E.at,{align:"center",gap:2,padding:1,children:[a,t]},r),i[6]=a,i[7]=t,i[8]=r,i[9]=n):n=i[9],n},at=e=>{let t,n,i,r=(0,P.c)(9),{collaborators:l}=e,{t:o}=(0,R.Bdt)("studio"),a;return r[0]===o?a=r[1]:(a=o("timeline.changes.title"),r[0]=o,r[1]=a),r[2]===a?t=r[3]:(t=(0,A.jsx)(E.lt,{padding:1,paddingBottom:2,children:(0,A.jsx)(E.et,{size:1,weight:"medium",children:a})}),r[2]=a,r[3]=t),r[4]===l?n=r[5]:(n=l.map(ai),r[4]=l,r[5]=n),r[6]!==t||r[7]!==n?(i=(0,A.jsxs)(E.O,{paddingBottom:1,children:[t,n]}),r[6]=t,r[7]=n,r[8]=i):i=r[8],i};function an(e){let t,n,i,r,l,a,s,d,c,u,p,m,h=(0,P.c)(55),{chunk:f,isSelected:x,onSelect:g,collaborators:b,optionsMenu:y}=e,{t:j}=(0,R.Bdt)("studio"),{type:v,endTimestamp:_}=f,I;h[0]===v?I=h[1]:(I=o4[v],h[0]=v,h[1]=I);let w=I,S;h[2]===f.authors?S=h[3]:(S=Array.from(f.authors),h[2]=f.authors,h[3]=S);let C=S,k;h[4]===b?k=h[5]:(k=b?Array.from(b):[],h[4]=b,h[5]=k);let T=k,D="delete"!==v,z;h[6]===Symbol.for("react.memo_cache_sentinel")?(z={dateStyle:"medium",timeStyle:"short"},h[6]=z):z=h[6];let B=(0,R.ixk)(z),O;h[7]===_?O=h[8]:(O=new Date(_),h[7]=_,h[8]=O);let N=(0,R.Vq9)(O||"",o8),L;if(h[9]!==B||h[10]!==_){let e=new Date(_);L=B.format(e),h[9]=B,h[10]=_,h[11]=L}else L=h[11];let $=L,M;h[12]!==f||h[13]!==D||h[14]!==g?(M=e=>{e.preventDefault(),e.stopPropagation(),D&&g(f)},h[12]=f,h[13]=D,h[14]=g,h[15]=M):M=h[15];let H=M,V;h[16]===Symbol.for("react.memo_cache_sentinel")?(V={position:"relative"},h[16]=V):V=h[16],h[17]===C?t=h[18]:(t=(0,A.jsx)(o5,{maxLength:3,userIds:C,size:2}),h[17]=C,h[18]=t);let W=o7[v],K;return h[19]===w?K=h[20]:(K=w&&(0,A.jsx)(w,{}),h[19]=w,h[20]=K),h[21]===K?n=h[22]:(n=(0,A.jsx)(E.et,{size:0,children:K}),h[21]=K,h[22]=n),h[23]!==W||h[24]!==n?(i=(0,A.jsx)(o6,{align:"center",justify:"center",$color:W,children:n}),h[23]=W,h[24]=n,h[25]=i):i=h[25],h[26]!==i||h[27]!==t?(r=(0,A.jsxs)("div",{style:V,children:[t,i]}),h[26]=i,h[27]=t,h[28]=r):r=h[28],h[29]!==j||h[30]!==v?(l=j(la[v])||(0,A.jsx)("code",{children:v}),h[29]=j,h[30]=v,h[31]=l):l=h[31],h[32]===l?a=h[33]:(a=(0,A.jsx)(E.et,{size:1,weight:"medium",children:l}),h[32]=l,h[33]=a),h[34]!==$||h[35]!==_||h[36]!==N?(s=(0,A.jsx)(E.et,{as:"time",size:1,muted:!0,dateTime:_,title:$,children:N}),h[34]=$,h[35]=_,h[36]=N,h[37]=s):s=h[37],h[38]!==a||h[39]!==s?(d=(0,A.jsxs)(E.O,{gap:2,children:[a,s]}),h[38]=a,h[39]=s,h[40]=d):d=h[40],h[41]===T?c=h[42]:(c=T.length>0&&(0,A.jsx)(E.at,{flex:1,justify:"flex-end",align:"center",children:(0,A.jsx)(o.o,{placement:"top",content:(0,A.jsx)(at,{collaborators:T}),portal:!0,children:(0,A.jsx)(E.lt,{paddingLeft:2,paddingY:2,children:(0,A.jsx)(o5,{maxLength:3,userIds:T,size:0,withTooltip:!1})})})}),h[41]=T,h[42]=c),h[43]!==r||h[44]!==d||h[45]!==c?(u=(0,A.jsxs)(E.at,{align:"center",gap:3,children:[r,d,c]}),h[43]=r,h[44]=d,h[45]=c,h[46]=u):u=h[46],h[47]!==f.id||h[48]!==H||h[49]!==x||h[50]!==u?(p=(0,A.jsx)(E.W,{as:"button",onClick:H,padding:2,pressed:x,radius:2,"data-ui":"timelineItem","data-testid":"timeline-item-button","data-chunk-id":f.id,children:u}),h[47]=f.id,h[48]=H,h[49]=x,h[50]=u,h[51]=p):p=h[51],h[52]!==y||h[53]!==p?(m=(0,A.jsxs)(E.at,{align:"center",gap:1,children:[p,y]}),h[52]=y,h[53]=p,h[54]=m):m=h[54],m}function ai(e){return(0,A.jsx)(ae,{userId:e},e)}let ar=e=>"publish"!==e.type,al=e=>"publish"===e.type,ao="timeline-list-wrapper",aa=e=>{let t,n,i,r,l,o=(0,P.c)(51),{chunks:a,hasMoreChunks:s,lastChunk:c,onLoadMore:u,onSelect:p,listMaxHeight:m}=e,h=void 0===m?"calc(100vh - 280px)":m,[f,x]=(0,d.useState)(!1),{t:g}=(0,R.Bdt)("studio"),b=c?.id,y;o[0]===a?y=o[1]:(y=function(e){let t=[];for(let n of e){if(al(n)){t.push({...n,type:"publish",children:[],collaborators:new Set});continue}if(ar(n)){let e=function(e){let t=null;for(let n=e.length-1;n>=0;n--){let i=e[n];if(al(i)){t=i;break}
1if("editDraft"!==i.type)break}return t}(t);if("editDraft"===n.type&&e?.type==="publish"){Array.from(n.authors).forEach(t=>{e.collaborators.add(t)}),e.children.push(n.id),t.push({...n,parentId:e.id});continue}}ar(n)&&t.push(n)}return t}(a),o[0]=a,o[1]=y);let j=y,v;o[2]!==j||o[3]!==b?(v=()=>{if(b){let e=j.find(e=>e.id===b);if(e&&ar(e)&&e.parentId)return new Set([e.parentId])}return new Set},o[2]=j,o[3]=b,o[4]=v):v=o[4];let[_,I]=(0,d.useState)(v),w,S;if(o[5]!==j||o[6]!==b?(w=()=>{if(b){let e=j.find(e=>e.id===b);if(e&&ar(e)&&e.parentId){let t=e.parentId;I(e=>{if(e.has(t))return e;let n=new Set(e);return n.add(t),n})}}},S=[j,b],o[5]=j,o[6]=b,o[7]=w,o[8]=S):(w=o[7],S=o[8]),(0,d.useEffect)(w,S),o[9]!==j||o[10]!==_){let e;o[12]===_?e=o[13]:(e=e=>!!al(e)||!e.parentId||_.has(e.parentId),o[12]=_,o[13]=e),t=j.filter(e),o[9]=j,o[10]=_,o[11]=t}else t=o[11];let C=t,k;o[14]!==C.length||o[15]!==s||o[16]!==u?(k=()=>{C.length<16&&s&&u()},o[14]=C.length,o[15]=s,o[16]=u,o[17]=k):k=o[17],o[18]!==C||o[19]!==s||o[20]!==u?(n=[C,s,u],o[18]=C,o[19]=s,o[20]=u,o[21]=n):n=o[21],(0,d.useEffect)(k,n),o[22]===Symbol.for("react.memo_cache_sentinel")?(i=e=>()=>I(t=>{let n=new Set(t);return t.has(e)?n.delete(e):n.add(e),n}),o[22]=i):i=o[22];let T=i,D;o[23]!==C||o[24]!==b?(D=b?C.findIndex(e=>e.id===b):-1,o[23]=C,o[24]=b,o[25]=D):D=o[25];let z=D,B;o[26]!==a||o[27]!==p?(B=e=>{let t=a.find(t=>t.id===e.id);t?p(t):(console.error("TimelineItem: chunk not found"),p(e))},o[26]=a,o[27]=p,o[28]=B):B=o[28];let O=B,N;o[29]!==_||o[30]!==C.length||o[31]!==O||o[32]!==s||o[33]!==b?(N=(e,t)=>{let{activeIndex:n}=t;return(0,A.jsxs)(E.lt,{paddingBottom:1,paddingTop:+(0===n),paddingRight:1,paddingLeft:ar(e)&&e.parentId?4:1,children:[(0,A.jsx)(an,{chunk:e,isSelected:b===e.id,onSelect:O,collaborators:al(e)?e.collaborators:void 0,optionsMenu:al(e)&&e.children.length>0?(0,A.jsx)(o0,{isExpanded:_.has(e.id),onExpand:T(e.id)}):null}),n===C.length-1&&s&&(0,A.jsx)(R.gd4,{})]})},o[29]=_,o[30]=C.length,o[31]=O,o[32]=s,o[33]=b,o[34]=N):N=o[34];let L=N,$,M;o[35]===Symbol.for("react.memo_cache_sentinel")?($=()=>x(!0),M=[],o[35]=$,o[36]=M):($=o[35],M=o[36]),(0,d.useEffect)($,M);let H=!z||f,V;return o[37]!==C.length||o[38]!==g?(V=0===C.length&&(0,A.jsxs)(o1,{padding:3,gap:3,children:[(0,A.jsx)(E.et,{size:1,weight:"medium",children:g("timeline.error.no-document-history-title")}),(0,A.jsx)(E.et,{muted:!0,size:1,children:g("timeline.error.no-document-history-description")})]}),o[37]=C.length,o[38]=g,o[39]=V):V=o[39],o[40]!==C||o[41]!==h||o[42]!==u||o[43]!==L||o[44]!==z||o[45]!==g?(r=C.length>0&&(0,A.jsx)(o2,{direction:"column",$maxHeight:h,id:"timeline-list-wrapper",children:(0,A.jsx)(R.oIj,{activeItemDataAttr:"data-hovered",ariaLabel:g("timeline.list.aria-label"),autoFocus:"list",initialIndex:z,initialScrollAlign:"center",itemHeight:57,items:C,onEndReached:u,onEndReachedIndexOffset:20,overscan:5,renderItem:L,wrapAround:!1})}),o[40]=C,o[41]=h,o[42]=u,o[43]=L,o[44]=z,o[45]=g,o[46]=r):r=o[46],o[47]!==H||o[48]!==V||o[49]!==r?(l=(0,A.jsxs)(o3,{$visible:H,"data-ui":"timeline",children:[V,r]}),o[47]=H,o[48]=V,o[49]=r,o[50]=l):l=o[50],l},as=(0,O.I4)(l.r).withConfig({displayName:"Root",componentId:"sc-wgzjgm-0"})`overflow:hidden;overflow:clip;`,ad="timeline-menu";function ac(e){let t,n,i,r,l,a,s=(0,P.c)(62),{chunk:c,mode:u,placement:p}=e,{setTimelineRange:m,timelineError:h,ready:f,timelineStore:x}=e9(),[g,b]=(0,d.useState)(!1),[y,j]=(0,d.useState)(null),[v,_]=(0,d.useState)(null),I=(0,z.dj)(),w=(0,R.SfM)(x,af),S=(0,R.SfM)(x,ah),C=(0,R.SfM)(x,am),k=(0,R.SfM)(x,ap),T=(0,R.SfM)(x,au),{t:D}=(0,R.Bdt)("studio"),B;s[0]===Symbol.for("react.memo_cache_sentinel")?(B=()=>{b(!0)},s[0]=B):B=s[0];let O=B,L;s[1]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{b(!1)},s[1]=L):L=s[1];let $=L,M;s[2]!==y||s[3]!==g?(M=e=>{g&&("Escape"===e.key||"Tab"===e.key)&&($(),y?.focus())},s[2]=y,s[3]=g,s[4]=M):M=s[4],(0,E.v)(M),s[5]!==y||s[6]!==v?(t=()=>[y,v],s[5]=y,s[6]=v,s[7]=t):t=s[7],(0,E.y)(g&&$,t),s[8]!==m||s[9]!==D||s[10]!==x||s[11]!==I?(n=e=>{try{(()=>{let[t,n]=x?.findRangeForRev(e)||[null,null];m(t,n)})()}catch(e){I.push({closable:!0,description:e.message,status:"error",title:D("timeline.error.unable-to-load-revision")})}},s[8]=m,s[9]=D,s[10]=x,s[11]=I,s[12]=n):n=s[12];let H=n,V;s[13]!==m||s[14]!==D||s[15]!==x||s[16]!==I?(V=e=>{try{(()=>{let[t,n]=x?.findRangeForSince(e)||[null,null];m(t,n)})()}catch(e){I.push({closable:!0,description:e.message,status:"error",title:D("timeline.error.unable-to-load-revision")})}},s[13]=m,s[14]=D,s[15]=x,s[16]=I,s[17]=V):V=s[17];let W=V,K;s[18]!==S||s[19]!==x?(K=()=>{S||x?.loadMore()},s[18]=S,s[19]=x,s[20]=K):K=s[20];let F=K,J;e:{let e;if(h){let e;s[21]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(oX,{}),s[21]=e):e=s[21],J=e;break e}if("rev"===u){let e;s[22]!==w||s[23]!==F||s[24]!==C||s[25]!==k||s[26]!==H?(e=(0,A.jsx)(aa,{chunks:w,hasMoreChunks:C,lastChunk:k,onLoadMore:F,onSelect:H}
1),s[22]=w,s[23]=F,s[24]=C,s[25]=k,s[26]=H,s[27]=e):e=s[27],J=e;break e}s[28]!==w||s[29]!==k?(e=k?w.filter(e=>e.index<k.index):w,s[28]=w,s[29]=k,s[30]=e):e=s[30];let t=e,n;s[31]!==t||s[32]!==F||s[33]!==C||s[34]!==W||s[35]!==T?(n=(0,A.jsx)(aa,{chunks:t,hasMoreChunks:C,lastChunk:T,onLoadMore:F,onSelect:W}),s[31]=t,s[32]=F,s[33]=C,s[34]=W,s[35]=T,s[36]=n):n=s[36],J=n}let U=J,Y,Q;if(s[37]!==c||s[38]!==D){let e={timestamp:{dateStyle:"medium",timeStyle:"short"}};Y=c?D(la[c.type],{context:"timestamp",timestamp:new Date(c?.endTimestamp),formatParams:e}):D("timeline.latest-revision"),Q=c?D("timeline.since",{timestamp:new Date(c?.endTimestamp),formatParams:e}):D("timeline.since-version-missing"),s[37]=c,s[38]=D,s[39]=Y,s[40]=Q}else Y=s[39],Q=s[40];let q="rev"===u?Y:Q,G;s[41]===v?G=s[42]:(G={[ad]:v},s[41]=v,s[42]=G);let X=G,Z=g&&U,ee=g?"timeline-menu-close-button":"timeline-menu-open-button",et=!f,en=g?$:O,ei;return s[43]===Symbol.for("react.memo_cache_sentinel")?(ei={maxWidth:"100%"},s[43]=ei):ei=s[43],s[44]!==q||s[45]!==f||s[46]!==D?(i=f?q:D("timeline.loading-history"),s[44]=q,s[45]=f,s[46]=D,s[47]=i):i=s[47],s[48]!==g||s[49]!==ee||s[50]!==et||s[51]!==en||s[52]!==i?(r=(0,A.jsx)(E.at,{children:(0,A.jsx)(o.a,{"data-testid":ee,disabled:et,mode:"ghost",onClick:en,ref:j,selected:g,width:"fill",tooltipProps:null,justify:"space-between",style:ei,iconRight:N.ChevronDownIcon,text:i})}),s[48]=g,s[49]=ee,s[50]=et,s[51]=en,s[52]=i,s[53]=r):r=s[53],s[54]!==g||s[55]!==p||s[56]!==Z||s[57]!==r?(l=(0,A.jsx)(as,{"data-testid":"timeline-menu",constrainSize:!0,content:Z,"data-ui":"versionMenu",open:g,placement:p,matchReferenceWidth:!0,portal:!0,ref:_,children:r}),s[54]=g,s[55]=p,s[56]=Z,s[57]=r,s[58]=l):l=s[58],s[59]!==X||s[60]!==l?(a=(0,A.jsx)(E.t,{__unstable_elements:X,children:l}),s[59]=X,s[60]=l,s[61]=a):a=s[61],a}function au(e){return e.sinceTime}function ap(e){return e.realRevChunk}function am(e){return e.hasMoreChunks}function ah(e){return e.isLoading}function af(e){return e.chunks}let ax=(0,O.I4)(R.PaW).withConfig({displayName:"Scroller",componentId:"sc-gutnse-0"})`height:100%;overflow:auto;position:relative;scroll-behavior:smooth;`,ag=(0,O.I4)(E.lt).withConfig({displayName:"Grid",componentId:"sc-gutnse-1"})`&:not([hidden]){display:grid;}grid-template-columns:48px 1fr;align-items:center;gap:0.25em;`;function ab(e){let t,n,i,l,o,a,s,c,u,p,m,h=(0,P.c)(39),{showChanges:f}=e,{documentId:x,schemaType:g,timelineError:b,timelineStore:y,value:j}=e9(),{selectedReleaseId:v}=(0,R.QO2)(),[_,I]=(0,d.useState)(null),w=(0,R.SfM)(y,aw),S=(0,R.SfM)(y,aI),C=(0,R.SfM)(y,a_),k=(0,R.SfM)(y,av),T=(0,R.SfM)(y,aj),D="loading"===k,B=!C,{t:O}=(0,R.Bdt)(r.I),N;h[0]!==S||h[1]!==x||h[2]!==B||h[3]!==g||h[4]!==j?(N={documentId:x,schemaType:g,FieldWrapper:ay,rootDiff:S,isComparingCurrent:B,value:j,showFromValue:!0},h[0]=S,h[1]=x,h[2]=B,h[3]=g,h[4]=j,h[5]=N):N=h[5];let L=N;if(v){let e;return h[6]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(E.at,{"data-testid":"review-changes-pane",direction:"column",height:"fill",children:(0,A.jsx)(E.W,{flex:1,padding:2,paddingTop:0,children:(0,A.jsx)(oX,{versionError:!0})})}),h[6]=e):e=h[6],e}return h[7]===O?t=h[8]:(t=O("changes.from.label"),h[7]=O,h[8]=t),h[9]===t?n=h[10]:(n=(0,A.jsx)(E.et,{size:1,muted:!0,children:t}),h[9]=t,h[10]=n),h[11]===T?i=h[12]:(i=(0,A.jsx)(ac,{mode:"since",chunk:T,placement:"bottom-start"}),h[11]=T,h[12]=i),h[13]===O?l=h[14]:(l=O("changes.to.label"),h[13]=O,h[14]=l),h[15]===l?o=h[16]:(o=(0,A.jsx)(E.et,{size:1,muted:!0,children:l}),h[15]=l,h[16]=o),h[17]===w?a=h[18]:(a=(0,A.jsx)(ac,{chunk:w,mode:"rev",placement:"bottom-end"}),h[17]=w,h[18]=a),h[19]!==n||h[20]!==i||h[21]!==o||h[22]!==a?(s=(0,A.jsx)(E.lt,{padding:3,children:(0,A.jsxs)(ag,{paddingX:2,paddingBottom:2,children:[n,i,o,a]})}),h[19]=n,h[20]=i,h[21]=o,h[22]=a,h[23]=s):s=h[23],h[24]!==S||h[25]!==L||h[26]!==D||h[27]!==g||h[28]!==f||h[29]!==b?(c=f&&(0,A.jsx)(aS,{diff:S,documentContext:L,error:b,loading:D,schemaType:g}),h[24]=S,h[25]=L,h[26]=D,h[27]=g,h[28]=f,h[29]=b,h[30]=c):c=h[30],h[31]===c?u=h[32]:(u=(0,A.jsx)(ax,{"data-ui":"Scroller",ref:I,children:(0,A.jsx)(E.lt,{flex:1,paddingX:3,height:"fill",children:c})}),h[31]=c,h[32]=u),h[33]!==_||h[34]!==u?(p=(0,A.jsx)(E.W,{flex:1,paddingX:2,paddingY:2,children:(0,A.jsx)(z.EZ,{element:_,children:u})}),h[33]=_,h[34]=u,h[35]=p):p=h[35],h[36]!==p||h[37]!==s?(m=(0,A.jsxs)(E.at,{"data-testid":"review-changes-pane",direction:"column",height:"fill",overflow:"hidden",children:[s,p]}),h[36]=p,h[37]=s,h[38]=m):m=h[38],m}function ay(e){return(0,A.jsx)(R.uD1,{...e,hasRevertHover:!1})}function aj(e){return e.sinceTime}function av(e){return e.selectionState}function a_(e){return e.onOlderRevision}function aI(e){return e.diff}function aw(e){return e.revTime}function aS(e){let t,n,i=(0,P.c)(9),{error:r,diff:l,documentContext:o,loading:a,schemaType:s}=e;if(r){let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(R.J7,{}),i[0]=e):e=i[0],e}if(a){let e;return i[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(R.gd4,{showText:!0}),i[1]=e):e=i[1],e}if(!l){let e;return i[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(R.J7,{}),i[2]=e):e=i[2],e}return i[3]!==l||i[4]!==s?(t=(0,A.jsx)(R.Vki,{diff:l,schemaType:s}),i[3]=l,i[4]=s,i[5]=t):t=i[5],i[6]!==o||i[7]!==t?(n=(0,A.jsx)(B.HU.Provider,{value:o,children:t}),i[6]=o,i[7]=t,i[8]=n):n=i[8],n}function aC(e){let t,n,i,r,l=(0,P.c)(27),{event:a,isSelected:s,onSelect:d,optionsMenu:c}=e,{t:u}=(0,R.Bdt)("studio"),p;l[0]===a?p=l[1]:(p=!(0,R.zOx)(a)&&!(0,R.GDb)(a)&&!(0,R.ayN)(a)&&!(0,R.Bkf)(a)&&!(0,R.azN)(a),l[0]=a,l[1]=p);let m=p,h;l[2]!==a||l[3]!==m||l[4]!==d?(h=e=>{e.preventDefault(),e.stopPropagation(),m&&d(a)},l[2]=a,l[3]=m,l[4]=d,l[5]=h):h=l[5];let f=h,x;l[6]!==m||l[7]!==u?(x=m?"":u("changes.not-selectable"),l[6]=m,l[7]=u,l[8]=x):x=l[8];let g=m?"button":"div",b=m?"pointer":"default",y;
1return l[9]===b?y=l[10]:(y={cursor:b,width:"100%"},l[9]=b,l[10]=y),l[11]===a?t=l[12]:(t=(0,A.jsx)(R.JhA,{event:a,showChangesBy:"tooltip"}),l[11]=a,l[12]=t),l[13]!==a.timestamp||l[14]!==f||l[15]!==s||l[16]!==g||l[17]!==y||l[18]!==t?(n=(0,A.jsx)(E.W,{as:g,onClick:f,padding:2,pressed:s,radius:2,"data-ui":"timelineItem","data-testid":"timeline-item-button","data-chunk-timestamp":a.timestamp,style:y,children:t}),l[13]=a.timestamp,l[14]=f,l[15]=s,l[16]=g,l[17]=y,l[18]=t,l[19]=n):n=l[19],l[20]!==m||l[21]!==x||l[22]!==n?(i=(0,A.jsx)(o.o,{content:x,disabled:m,children:n}),l[20]=m,l[21]=x,l[22]=n,l[23]=i):i=l[23],l[24]!==c||l[25]!==i?(r=(0,A.jsxs)(E.at,{gap:1,children:[i,c]}),l[24]=c,l[25]=i,l[26]=r):r=l[26],r}function ak(e){let t,n,i,l,a,s,d=(0,P.c)(47),{event:c}=e,{t:u}=(0,R.Bdt)(r.I),{t:p}=(0,R.Bdt)(),m=(0,E.M)(),{params:h,setParams:f}=tc(),x=(0,R._T7)(),{document:g}=(0,R.hA9)(),{drafts:b}=g,{enabled:y}=b,j;d[0]!==c.id||d[1]!==c.versionId||d[2]!==c.versionRevisionId||d[3]!==h||d[4]!==f?(j=()=>{f({...h,rev:c.versionRevisionId||"@lastPublished",since:void 0,historyEvent:c.id,historyVersion:(0,R._Sr)(c.versionId)})},d[0]=c.id,d[1]=c.versionId,d[2]=c.versionRevisionId,d[3]=h,d[4]=f,d[5]=j):j=d[5];let v=j,_;d[6]!==c.versionRevisionId||d[7]!==y||d[8]!==h||d[9]!==f||d[10]!==x?(_=()=>{f({...h,rev:c.versionRevisionId,preserveRev:"true",since:void 0}),setTimeout(()=>{x(y?"drafts":"published")},100)},d[6]=c.versionRevisionId,d[7]=y,d[8]=h,d[9]=f,d[10]=x,d[11]=_):_=d[11];let I=_,w=c.release?.metadata?.title,S;d[12]===p?S=d[13]:(S=p("release.placeholder-untitled-release"),d[12]=p,d[13]=S);let C=S,k;d[14]===c.release?k=d[15]:(k=e=>{let{children:t}=e;return(0,A.jsx)(R.RwK,{$tone:c.release?(0,R.Jrl)(c.release)?(0,R.Y73)(c.release):"default":void 0,children:t})},d[14]=c.release,d[15]=k);let T=k,D;d[16]===c.release?D=d[17]:(D=c.release&&!(0,R.Jrl)(c.release),d[16]=c.release,d[17]=D);let z=D,B=`timeline-item-menu-button-${c.versionId}`,O;d[18]===u?O=d[19]:(O=u("timeline-item.menu-button.aria-label"),d[18]=u,d[19]=O),d[20]!==c.release||d[21]!==z||d[22]!==u?(t=z?u("timeline-item.not-found-release.tooltip",{releaseId:c.release?._id?(0,R._hI)(c.release._id):void 0}):u("timeline-item.menu-button.tooltip"),d[20]=c.release,d[21]=z,d[22]=u,d[23]=t):t=d[23],d[24]===t?n=d[25]:(n={content:t},d[24]=t,d[25]=n),d[26]!==z||d[27]!==n||d[28]!==O?(i=(0,A.jsx)(R.VJU,{"aria-label":O,tooltipProps:n,disabled:z}),d[26]=z,d[27]=n,d[28]=O,d[29]=i):i=d[29],d[30]!==T||d[31]!==c.release||d[32]!==c.versionRevisionId||d[33]!==I||d[34]!==v||d[35]!==C||d[36]!==w||d[37]!==u?(l=(0,A.jsx)(E.p,{padding:1,children:c.release?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(ee.RZ,{intent:R.wwz,params:{id:(0,R._hI)(c.release._id)},style:{textDecoration:"none"},children:(0,A.jsx)(E.u,{padding:3,children:(0,A.jsx)(E.at,{align:"center",justify:"flex-start",children:(0,A.jsx)(E.et,{size:1,style:{textDecoration:"none"},children:(0,A.jsx)(R.Qfr,{title:w,fallback:C,children:e=>{let{displayTitle:t}=e;return(0,A.jsx)(R.HTc,{components:{VersionBadge:e=>{let{children:t}=e;return(0,A.jsx)(T,{children:t})}},i18nKey:"events.open.release",values:{releaseTitle:t},t:u})}})})})})}),(0,A.jsx)(E.u,{onClick:v,children:(0,A.jsx)(E.at,{align:"center",justify:"flex-start",children:(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.Qfr,{title:w,fallback:C,children:e=>{let{displayTitle:t}=e;return(0,A.jsx)(R.HTc,{components:{VersionBadge:e=>{let{children:t}=e;return(0,A.jsx)(T,{children:t})}},i18nKey:"events.inspect.release",values:{releaseTitle:t},t:u})}})})})})]}):(0,A.jsx)(E.u,{onClick:I,disabled:!c.versionRevisionId,children:(0,A.jsx)(E.at,{align:"center",children:(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.HTc,{components:{VersionBadge:aT},i18nKey:"events.open.draft",t:u})})})})}),d[30]=T,d[31]=c.release,d[32]=c.versionRevisionId,d[33]=I,d[34]=v,d[35]=C,d[36]=w,d[37]=u,d[38]=l):l=d[38];let N=!m.elements?.["timeline-menu"]||ad,L;return d[39]===Symbol.for("react.memo_cache_sentinel")?(L=["bottom-end","bottom-start"],d[39]=L):L=d[39],d[40]===N?a=d[41]:(a={portal:N,placement:"bottom",fallbackPlacements:L},d[40]=N,d[41]=a),d[42]!==i||d[43]!==l||d[44]!==a||d[45]!==B?(s=(0,A.jsx)(o.r,{id:B,button:i,menu:l,popover:a}),d[42]=i,d[43]=l,d[44]=a,d[45]=B,d[46]=s):s=d[46],s}function aT(e){let{children:t}=e;return(0,A.jsx)(R.RwK,{$tone:"caution",children:t})}let aD=eL.PY1.create(E.lt),aP={initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0}},aA=e=>{let t,n,i=(0,P.c)(38),{events:r,hasMoreEvents:l,selectedEventId:o,onLoadMore:a,onSelect:s,listMaxHeight:c,fetchEventChildren:u}=e,p=void 0===c?"calc(100vh - 280px)":c,[m,h]=(0,d.useState)(!1),{t:f}=(0,R.Bdt)("studio"),x;i[0]!==r||i[1]!==o?(x=()=>{if(o){let e=r.find(e=>e.id===o);if(e&&"parentId"in e&&e.parentId)return new Set([e.parentId])}return new Set},i[0]=r,i[1]=o,i[2]=x):x=i[2];let[g,b]=(0,d.useState)(x),y;i[3]===Symbol.for("react.memo_cache_sentinel")?(y=new Set,i[3]=y):y=i[3];let[j,v]=(0,d.useState)(y),_;i[4]!==r||i[5]!==g?(_=r.filter(e=>(0,R.y4b)(e)&&e.parentId?r[r.length-1].id===e.id||g.has(e.parentId):!(0,R.WUV)(e)||!e.parentId||g.has(e.parentId)),i[4]=r,i[5]=g,i[6]=_):_=i[6];let I=_,w;i[7]===u?w=i[8]:(w=e=>async()=>{let t=e.id,n=!1;b(e=>{let i=new Set(e);return e.has(t)?i.delete(t):(n=!0,i.add(t)),i}),n&&(v(e=>{let n=new Set(e);return n.add(t),n}),await u(e),v(e=>{let n=new Set(e);return n.delete(t),n}))},i[7]=u,i[8]=w);let S=w,C;i[9]===s?C=i[10]:(C=e=>{s(e)},i[9]=s,i[10]=C);let k=C,T;i[11]!==g||i[12]!==S?(T=e=>{let t=(0,R.tfA)(e.documentId);return(0,R.BaK)(e)&&"published"===t?(0,A.jsx)(ak,{event:e}):(0,R.BaK)(e)&&"draft"===t&&e.creationEvent||(0,R.zOx)(e)&&e.creationEvent?(0,A.jsx)(o0,{isExpanded:g.has(e.id),onExpand:S(e)}):null},i[11]=g,i[12]=S,i[13]=T):T=i[13];let D=T,z;i[14]!==I.length||i[15]!==j||i[16]!==k||i[17]!==l||i[18]!==D||i[19]!==o?(z=(e,t)=>{let{activeIndex:n}=t,i=(0,R.y4b)(e)&&e.parentId&&j.has(e.parentId),r=n===I.length-1;return i?(0,A.jsx)(aD,{animate:{opacity:1},initial:{opacity:0}
1,transition:{duration:.2,delay:.2},children:(0,A.jsx)(E.at,{align:"center",justify:"center",style:{height:57},children:(0,A.jsx)(E.$,{})})}):(0,A.jsxs)(aD,{paddingBottom:1,paddingRight:1,animate:"animate",exit:"exit",initial:"initial",variants:"parentId"in e?aP:void 0,paddingLeft:((0,R.WUV)(e)||(0,R.y4b)(e))&&e.parentId&&!r?4:1,children:[(0,A.jsx)(aC,{event:e,isSelected:e.id===o,onSelect:k,optionsMenu:D(e)}),r&&l&&(0,A.jsx)(R.gd4,{})]},e.timestamp)},i[14]=I.length,i[15]=j,i[16]=k,i[17]=l,i[18]=D,i[19]=o,i[20]=z):z=i[20];let B=z,O,N;if(i[21]===Symbol.for("react.memo_cache_sentinel")?(N=()=>h(!0),O=[],i[21]=O,i[22]=N):(O=i[21],N=i[22]),(0,d.useEffect)(N,O),i[23]!==I||i[24]!==o){let e;i[26]===o?e=i[27]:(e=e=>e.id===o,i[26]=o,i[27]=e),t=I.findIndex(e),i[23]=I,i[24]=o,i[25]=t}else t=i[25];let L=t,$=!L||m,M;return i[28]!==I||i[29]!==p||i[30]!==a||i[31]!==B||i[32]!==L||i[33]!==f?(M=I.length>0?(0,A.jsx)(o2,{direction:"column",$maxHeight:p,id:"timeline-list-wrapper",children:(0,A.jsx)(R.oIj,{activeItemDataAttr:"data-hovered",ariaLabel:f("timeline.list.aria-label"),autoFocus:"list",initialIndex:L,initialScrollAlign:"center",itemHeight:57,items:I,onEndReached:a,onEndReachedIndexOffset:20,overscan:5,renderItem:B,wrapAround:!1})}):(0,A.jsxs)(E.O,{padding:3,gap:3,children:[(0,A.jsx)(E.et,{size:1,weight:"medium",children:f("timeline.error.no-document-history-title")}),(0,A.jsx)(E.et,{muted:!0,size:1,children:f("timeline.error.no-document-history-description")})]}),i[28]=I,i[29]=p,i[30]=a,i[31]=B,i[32]=L,i[33]=f,i[34]=M):M=i[34],i[35]!==$||i[36]!==M?(n=(0,A.jsx)(o3,{$visible:$,"data-ui":"timeline",children:M}),i[35]=$,i[36]=M,i[37]=n):n=i[37],n};aA.displayName="EventsTimeline";let aE=(0,O.I4)(l.r).withConfig({displayName:"Root",componentId:"sc-yitozd-0"})`overflow:hidden;overflow:clip;`,az={timestamp:{dateStyle:"medium",timeStyle:"short"}};function aR(e){let t,n,i,r,l,a,s,c=(0,P.c)(58),{event:u,events:p,mode:m,placement:h}=e,{setTimelineRange:f}=e9(),[x,g]=(0,d.useState)(!1),[b,y]=(0,d.useState)(null),[j,v]=(0,d.useState)(null),_=(0,z.dj)(),{nextCursor:I,loading:w,error:S,findRangeForRevision:C,findRangeForSince:k,loadMoreEvents:T,expandEvent:D}=(0,R.LJN)(),{t:B}=(0,R.Bdt)("studio"),O;c[0]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{g(!0)},c[0]=O):O=c[0];let L=O,$;c[1]===Symbol.for("react.memo_cache_sentinel")?($=()=>{g(!1)},c[1]=$):$=c[1];let M=$,H;c[2]!==b||c[3]!==x?(H=e=>{x&&("Escape"===e.key||"Tab"===e.key)&&(M(),b?.focus())},c[2]=b,c[3]=x,c[4]=H):H=c[4],(0,E.v)(H),c[5]!==b||c[6]!==j?(t=()=>[b,j],c[5]=b,c[6]=j,c[7]=t):t=c[7],(0,E.y)(x&&M,t),c[8]!==C||c[9]!==f||c[10]!==B||c[11]!==_?(n=e=>{try{(()=>{if((0,R.zOx)(e)||(0,R.GDb)(e)||(0,R.ayN)(e)||(0,R.Bkf)(e)||(0,R.azN)(e))return console.error("Event is not selectable");let[t,n]=C(e?.id);f(t,n),M()})()}catch(e){_.push({closable:!0,description:e.message,status:"error",title:B("timeline.error.unable-to-load-revision")})}},c[8]=C,c[9]=f,c[10]=B,c[11]=_,c[12]=n):n=c[12];let V=n,W;c[13]!==k||c[14]!==f||c[15]!==B||c[16]!==_?(W=e=>{try{let[t,n]=k(e.id);f(t,n),M()}catch(e){_.push({closable:!0,description:e.message,status:"error",title:B("timeline.error.unable-to-load-revision")})}},c[13]=k,c[14]=f,c[15]=B,c[16]=_,c[17]=W):W=c[17];let K=W,F;c[18]!==T||c[19]!==w||c[20]!==I?(F=()=>{!w&&I&&T()},c[18]=T,c[19]=w,c[20]=I,c[21]=F):F=c[21];let J=F;u?.id;e:{if(S){let e;c[22]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(oX,{}),c[22]=e):e=c[22],i=e;break e}let e=!!I,t=u?.id,n="rev"===m?V:K,r;c[23]!==p||c[24]!==D||c[25]!==J||c[26]!==t||c[27]!==n||c[28]!==e?(r=(0,A.jsx)(aA,{events:p,fetchEventChildren:D,hasMoreEvents:e,selectedEventId:t,onLoadMore:J,onSelect:n}),c[23]=p,c[24]=D,c[25]=J,c[26]=t,c[27]=n,c[28]=e,c[29]=r):r=c[29],i=r}let U=i,Y;c[30]!==u||c[31]!==B?(Y=u?B(R.uMx[u.documentVariantType][u.type],{context:"timestamp",timestamp:new Date(u.timestamp),formatParams:az}):B("timeline.latest-revision"),c[30]=u,c[31]=B,c[32]=Y):Y=c[32];let Q=Y,q;c[33]!==u||c[34]!==p||c[35]!==B?(q=u?B(R.uMx[u.documentVariantType][u.type],{context:"timestamp",timestamp:new Date(u.timestamp),formatParams:az}):p.length>0?B("timeline.since-version-missing"):B("timeline.no-previous-events"),c[33]=u,c[34]=p,c[35]=B,c[36]=q):q=c[36];let G="rev"===m?Q:q,X;
1c[37]===j?X=c[38]:(X={"timeline-menu":j},c[37]=j,c[38]=X);let Z=X,ee=x&&U,et=x?"timeline-menu-close-button":"timeline-menu-open-button",en=w||!p.length,ei=x?M:L,er;return c[39]===Symbol.for("react.memo_cache_sentinel")?(er={maxWidth:"100%"},c[39]=er):er=c[39],c[40]!==G||c[41]!==w||c[42]!==B?(r=w?B("timeline.loading-history"):G,c[40]=G,c[41]=w,c[42]=B,c[43]=r):r=c[43],c[44]!==x||c[45]!==et||c[46]!==en||c[47]!==ei||c[48]!==r?(l=(0,A.jsx)(E.at,{children:(0,A.jsx)(o.a,{"data-testid":et,disabled:en,mode:"ghost",onClick:ei,ref:y,selected:x,width:"fill",tooltipProps:null,justify:"space-between",style:er,iconRight:N.ChevronDownIcon,text:r})}),c[44]=x,c[45]=et,c[46]=en,c[47]=ei,c[48]=r,c[49]=l):l=c[49],c[50]!==x||c[51]!==h||c[52]!==ee||c[53]!==l?(a=(0,A.jsx)(aE,{"data-testid":"timeline-menu",constrainSize:!0,content:ee,"data-ui":"versionMenu",open:x,placement:h,matchReferenceWidth:!0,portal:!0,ref:v,children:l}),c[50]=x,c[51]=h,c[52]=ee,c[53]=l,c[54]=a):a=c[54],c[55]!==Z||c[56]!==a?(s=(0,A.jsx)(E.t,{__unstable_elements:Z,children:a}),c[55]=Z,c[56]=a,c[57]=s):s=c[57],s}let aB=(0,O.I4)(R.PaW).withConfig({displayName:"Scroller",componentId:"sc-u62lrb-0"})`height:100%;overflow:auto;position:relative;scroll-behavior:smooth;`,aO=(0,O.I4)(E.lt).withConfig({displayName:"Grid",componentId:"sc-u62lrb-1"})`&:not([hidden]){display:grid;}grid-template-columns:48px 1fr;align-items:center;gap:0.25em;`,aN=(0,O.I4)(E.at).withConfig({displayName:"SpinnerContainer",componentId:"sc-u62lrb-2"})`width:100%;position:absolute;bottom:-4px;`,aL={diff:null,loading:!0,error:null},a$=()=>{let e,t,n,i,l,o,a,s,d,c,u=(0,P.c)(31),{documentId:p,documentType:m,schemaType:h,editState:f,displayed:x,targetDocumentState:g}=e9(),{selectedPerspective:b,selectedPerspectiveName:y,selectedReleaseId:j}=(0,R.QO2)(),{t:v}=(0,R.Bdt)(r.I),_="ready"===g.status&&void 0!==g.variant,I=_?g.publishedSibling?._system.scopeId:void 0,w=(0,R.zX2)(p,m,"default",I),S=_?I&&w.version||null:f?.published,C;u[0]!==x||u[1]!==S?(C=(0,e5.g)((0,e5.L)(S??{},{author:""}),(0,e5.L)(x??{},{author:""})),u[0]=x,u[1]=S,u[2]=C):C=u[2];let k=C;return(!_||S)&&(!j||f?.version)&&("drafts"!==b||f?.draft)&&"published"!==y&&x?._rev?(u[3]===v?e=u[4]:(e=v("events.compare-with-published.title"),u[3]=v,u[4]=e),u[5]===e?t=u[6]:(t=(0,A.jsx)(E.et,{size:1,weight:"medium",children:e}),u[5]=e,u[6]=t),u[7]===b?n=u[8]:(n=(0,R.Jrl)(b)?b.metadata?.title:"draft",u[7]=b,u[8]=n),u[9]===n?i=u[10]:(i={version:n},u[9]=n,u[10]=i),u[11]!==v||u[12]!==i?(l=(0,A.jsx)(E.et,{size:1,muted:!0,children:(0,A.jsx)(R.HTc,{i18nKey:"events.compare-with-published.description",t:v,values:i})}),u[11]=v,u[12]=i,u[13]=l):l=u[13],u[14]!==t||u[15]!==l?(o=(0,A.jsx)(E.W,{borderBottom:!0,paddingBottom:3,children:(0,A.jsxs)(E.O,{gap:3,paddingTop:1,children:[t,l]})}),u[14]=t,u[15]=l,u[16]=o):o=u[16],u[17]!==x||u[18]!==p||u[19]!==k||u[20]!==h?(a={documentId:p,schemaType:h,rootDiff:k,isComparingCurrent:!0,FieldWrapper:aK,value:x,showFromValue:!0},u[17]=x,u[18]=p,u[19]=k,u[20]=h,u[21]=a):a=u[21],u[22]!==k||u[23]!==h?(s=(0,A.jsx)(E.lt,{paddingY:1,children:(0,A.jsx)(R.Vki,{diff:k,schemaType:h})}),u[22]=k,u[23]=h,u[24]=s):s=u[24],u[25]!==a||u[26]!==s?(d=(0,A.jsx)(B.HU.Provider,{value:a,children:s}),u[25]=a,u[26]=s,u[27]=d):d=u[27],u[28]!==o||u[29]!==d?(c=(0,A.jsxs)(E.O,{gap:2,marginBottom:3,children:[o,d]}),u[28]=o,u[29]=d,u[30]=c):c=u[30],c):null};function aM(e){let t,n,i,r,l,o,a,s,c,u,p,m,h,f,x=(0,P.c)(83),{showChanges:g}=e,{documentId:b,schemaType:y,timelineError:j,value:v,formState:_}=e9(),[I,w]=(0,d.useState)(null),{events:S,revision:C,sinceRevision:k,getChangesList:T}=(0,R.LJN)(),D=!C?.revisionId,B;x[0]===T?B=x[1]:(B=T(),x[0]=T,x[1]=B);let{diff:O,loading:N,error:L}=(0,W.ut)(B,aL),{t:$}=(0,R.Bdt)("studio"),M;x[2]!==O||x[3]!==b||x[4]!==_?.readOnly||x[5]!==D||x[6]!==y||x[7]!==v?(M=()=>({documentId:b,schemaType:y,FieldWrapper:aH,rootDiff:O,isComparingCurrent:D&&!_?.readOnly,value:v,showFromValue:!0}),x[2]=O,x[3]=b,x[4]=_?.readOnly,x[5]=D,x[6]=y,x[7]=v,x[8]=M):M=x[8],_?.readOnly,x[9]===M?t=x[10]:(t=M(),x[9]=M,x[10]=t);let H=t;C?.revisionId,k?.revisionId;e:{let e,t,i;if(!S){let e;
1x[11]===Symbol.for("react.memo_cache_sentinel")?(e=[null,null],x[11]=e):e=x[11],n=e;break e}x[12]!==S||x[13]!==k?.revisionId?(e=S.find(e=>e.id===k?.revisionId)||null,x[12]=S,x[13]=k?.revisionId,x[14]=e):e=x[14],x[15]!==S||x[16]!==C?.revisionId?(t=S.find(e=>e.id===C?.revisionId)||S[0],x[15]=S,x[16]=C?.revisionId,x[17]=t):t=x[17],x[18]!==e||x[19]!==t?(i=[e,t],x[18]=e,x[19]=t,x[20]=i):i=x[20],n=i}let[V,K]=n,F;t:{let e;if(!K){let e;x[21]===S?e=x[22]:(e=S.slice(1),x[21]=S,x[22]=e),F=e;break t}if(x[23]!==S||x[24]!==K){let t;x[26]===K?t=x[27]:(t=e=>"parentId"in K&&"parentId"in e&&e.parentId===K.parentId||"parentId"in e&&K.id===e.parentId?{...e,parentId:void 0}:e,x[26]=K,x[27]=t),e=S.slice(S.indexOf(K)+1).map(t),x[23]=S,x[24]=K,x[25]=e}else e=x[25];F=e}let J=F;if(!S.length){let e,t,n,i,r;return x[28]===$?e=x[29]:(e=$("timeline.error.no-document-history-title"),x[28]=$,x[29]=e),x[30]===e?t=x[31]:(t=(0,A.jsx)(E.et,{size:1,weight:"medium",children:e}),x[30]=e,x[31]=t),x[32]===$?n=x[33]:(n=$("timeline.error.no-document-history-description"),x[32]=$,x[33]=n),x[34]===n?i=x[35]:(i=(0,A.jsx)(E.et,{muted:!0,size:1,children:n}),x[34]=n,x[35]=i),x[36]!==t||x[37]!==i?(r=(0,A.jsx)(E.lt,{paddingX:2,children:(0,A.jsxs)(E.O,{padding:3,gap:3,children:[t,i]})}),x[36]=t,x[37]=i,x[38]=r):r=x[38],r}x[39]===Symbol.for("react.memo_cache_sentinel")?(i={position:"relative"},x[39]=i):i=x[39],x[40]===$?r=x[41]:(r=$("changes.inspector.from-label"),x[40]=$,x[41]=r),x[42]===r?l=x[43]:(l=(0,A.jsx)(E.et,{size:1,muted:!0,children:r}),x[42]=r,x[43]=l);let U=V||null,Y;x[44]!==J||x[45]!==U?(Y=(0,A.jsx)(aR,{event:U,events:J,mode:"since",placement:"bottom-start"}),x[44]=J,x[45]=U,x[46]=Y):Y=x[46],x[47]===$?o=x[48]:(o=$("changes.inspector.to-label"),x[47]=$,x[48]=o),x[49]===o?a=x[50]:(a=(0,A.jsx)(E.et,{size:1,muted:!0,children:o}),x[49]=o,x[50]=a);let Q=K||null,q;return x[51]!==S||x[52]!==Q?(q=(0,A.jsx)(aR,{event:Q,events:S,mode:"rev",placement:"bottom-end"}),x[51]=S,x[52]=Q,x[53]=q):q=x[53],x[54]!==Y||x[55]!==a||x[56]!==q||x[57]!==l?(s=(0,A.jsxs)(aO,{paddingX:2,paddingBottom:2,children:[l,Y,a,q]}),x[54]=Y,x[55]=a,x[56]=q,x[57]=l,x[58]=s):s=x[58],x[59]!==N||x[60]!==$?(c=N&&(0,A.jsx)(eL.PY1.div,{animate:{opacity:1},initial:{opacity:0}
1,transition:{delay:.2,duration:.2},children:(0,A.jsxs)(aN,{justify:"center",align:"center",gap:2,children:[(0,A.jsx)(E.et,{muted:!0,size:0,children:$("changes.loading-changes")}),(0,A.jsx)(E.$,{size:0})]})}),x[59]=N,x[60]=$,x[61]=c):c=x[61],x[62]!==s||x[63]!==c?(u=(0,A.jsxs)(E.lt,{padding:3,style:i,children:[s,c]}),x[62]=s,x[63]=c,x[64]=u):u=x[64],x[65]!==L||x[66]!==H||x[67]!==C?.loading||x[68]!==y||x[69]!==g||x[70]!==V||x[71]!==k?.loading||x[72]!==j||x[73]!==K?.id?(p=g&&(0,A.jsx)(aV,{documentContext:H,error:j||L,loading:C?.loading||k?.loading||!1,schemaType:y,sameRevisionSelected:V?.id===K?.id,sinceEvent:V}),x[65]=L,x[66]=H,x[67]=C?.loading,x[68]=y,x[69]=g,x[70]=V,x[71]=k?.loading,x[72]=j,x[73]=K?.id,x[74]=p):p=x[74],x[75]===p?m=x[76]:(m=(0,A.jsx)(aB,{"data-ui":"Scroller",ref:w,children:(0,A.jsx)(E.lt,{flex:1,paddingX:3,height:"fill",children:p})}),x[75]=p,x[76]=m),x[77]!==I||x[78]!==m?(h=(0,A.jsx)(E.W,{flex:1,paddingX:2,paddingY:2,children:(0,A.jsx)(z.EZ,{element:I,children:m})}),x[77]=I,x[78]=m,x[79]=h):h=x[79],x[80]!==u||x[81]!==h?(f=(0,A.jsxs)(E.at,{"data-testid":"review-changes-pane",direction:"column",height:"fill",overflow:"hidden",children:[u,h]}),x[80]=u,x[81]=h,x[82]=f):f=x[82],f}function aH(e){return e.path.length>0?(0,A.jsx)(R.uD1,{...e}):e.children}function aV(e){let t,n,i=(0,P.c)(15),{error:r,documentContext:l,loading:o,schemaType:a,sameRevisionSelected:s,sinceEvent:d}=e;if(r){let e,t,n;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(a$,{}),i[0]=e):e=i[0],i[1]!==r||i[2]!==d?.type?(t=d?.type!=="historyCleared"&&(0,A.jsx)(R.isY,{error:r}),i[1]=r,i[2]=d?.type,i[3]=t):t=i[3],i[4]===t?n=i[5]:(n=(0,A.jsxs)(A.Fragment,{children:[e,t]}),i[4]=t,i[5]=n),n}if(o){let e;return i[6]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(R.gd4,{showText:!0}),i[6]=e):e=i[6],e}if(s){let e;return i[7]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(aW,{}),i[7]=e):e=i[7],e}if(!l.rootDiff){let e;return i[8]===Symbol.for("react.memo_cache_sentinel")?(e=(0,A.jsx)(eL.PY1.div,{animate:{opacity:1},initial:{opacity:0}
1,transition:{delay:.2,duration:.2},children:(0,A.jsx)(R.J7,{})}),i[8]=e):e=i[8],e}return i[9]!==l.rootDiff||i[10]!==a?(t=(0,A.jsx)(E.lt,{paddingY:1,children:(0,A.jsx)(R.Vki,{diff:l.rootDiff,schemaType:a})}),i[9]=l.rootDiff,i[10]=a,i[11]=t):t=i[11],i[12]!==l||i[13]!==t?(n=(0,A.jsx)(B.HU.Provider,{value:l,children:t}),i[12]=l,i[13]=t,i[14]=n):n=i[14],n}function aW(){let e,t,n,i,r=(0,P.c)(12),{t:l}=(0,R.Bdt)(""),o,a,s;return r[0]===Symbol.for("react.memo_cache_sentinel")?(o={opacity:1},a={opacity:0},s={delay:.2,duration:.2},r[0]=o,r[1]=a,r[2]=s):(o=r[0],a=r[1],s=r[2]),r[3]===l?e=r[4]:(e=l("changes.same-revision-selected-title"),r[3]=l,r[4]=e),r[5]===e?t=r[6]:(t=(0,A.jsx)(E.et,{size:1,weight:"medium",as:"h3",children:e}),r[5]=e,r[6]=t),r[7]===l?n=r[8]:(n=(0,A.jsx)(E.et,{as:"p",size:1,muted:!0,children:(0,A.jsx)(R.HTc,{i18nKey:"changes.same-revision-selected-description",t:l})}),r[7]=l,r[8]=n),r[9]!==t||r[10]!==n?(i=(0,A.jsx)(eL.PY1.div,{animate:o,initial:a,transition:s,children:(0,A.jsxs)(E.O,{gap:3,paddingTop:2,children:[t,n]})}),r[9]=t,r[10]=n,r[11]=i):i=r[11],i}function aK(e){return e.children}let aF=(0,O.I4)(R.PaW).withConfig({displayName:"Scroller",componentId:"sc-lrtv50-0"})`height:100%;overflow:auto;position:relative;scroll-behavior:smooth;`;function aJ(e){let t=(0,P.c)(21),{showList:n}=e,[i,r]=(0,d.useState)(null),[l,o]=(0,d.useState)(0),{setTimelineRange:a}=e9(),s;t[0]===l?s=t[1]:(s=e=>{!l&&e&&(o(e.clientHeight?e.clientHeight-1:0),r(e))},t[0]=l,t[1]=s);let c=s,{events:u,nextCursor:p,loading:m,error:h,revision:f,loadMoreEvents:x,findRangeForRevision:g,expandEvent:b}=(0,R.LJN)(),{t:y}=(0,R.Bdt)("studio"),j=(0,z.dj)(),v;t[2]!==g||t[3]!==a||t[4]!==y||t[5]!==j?(v=e=>{try{(()=>{if((0,R.zOx)(e)||(0,R.GDb)(e)||(0,R.ayN)(e)||(0,R.Bkf)(e)||(0,R.azN)(e))return console.error("Event is not selectable");let[t,n]=g(e.id);a(t,n)})()}catch(e){j.push({closable:!0,description:e.message,status:"error",title:y("timeline.error.unable-to-load-revision")})}},t[2]=g,t[3]=a,t[4]=y,t[5]=j,t[6]=v):v=t[6];let _=v,I=m&&!u.length,w;return t[7]!==h||t[8]!==u||t[9]!==b||t[10]!==c||t[11]!==I||t[12]!==l||t[13]!==x||t[14]!==m||t[15]!==p||t[16]!==f?.revisionId||t[17]!==i||t[18]!==_||t[19]!==n?(w=(0,A.jsx)(E.at,{"data-testid":"review-changes-pane",direction:"column",height:"fill",children:(0,A.jsx)(E.W,{flex:1,padding:2,paddingTop:0,children:h?(0,A.jsx)(oX,{}):(0,A.jsx)(z.EZ,{element:i,children:(0,A.jsxs)(aF,{"data-ui":"Scroller",ref:c,children:[l&&n&&!I?(0,A.jsx)(aA,{events:u,fetchEventChildren:b,hasMoreEvents:!!p,selectedEventId:f?.revisionId||u[0]?.id,onLoadMore:x,onSelect:_,listMaxHeight:`${l}px`}):null,m&&(0,A.jsx)(R.gd4,{})]})})})}),t[7]=h,t[8]=u,t[9]=b,t[10]=c,t[11]=I,t[12]=l,t[13]=x,t[14]=m,t[15]=p,t[16]=f?.revisionId,t[17]=i,t[18]=_,t[19]=n,t[20]=w):w=t[20],w}let aU=(0,O.I4)(R.PaW).withConfig({displayName:"Scroller",componentId:"sc-2i8xoe-0"})`height:100%;overflow:auto;position:relative;scroll-behavior:smooth;`;function aY(e){let t=(0,P.c)(20),{showList:n}=e,{timelineError:i,setTimelineRange:r,timelineStore:l}=e9(),{selectedReleaseId:o}=(0,R.QO2)(),[a,s]=(0,d.useState)(null),[c,u]=(0,d.useState)(0),p;t[0]===Symbol.for("react.memo_cache_sentinel")?(p=e=>{e?.clientHeight&&(u(e.clientHeight-1),s(e))},t[0]=p):p=t[0];let m=p,h=(0,R.SfM)(l,aX),f=(0,R.SfM)(l,aG),x=(0,R.SfM)(l,aq),g=(0,R.SfM)(l,aQ),{t:b}=(0,R.Bdt)("studio"),y=(0,z.dj)(),j;t[1]!==r||t[2]!==b||t[3]!==l||t[4]!==y?(j=e=>{try{(()=>{let[t,n]=l?.findRangeForRev(e)||[null,null];r(t,n)})()}catch(e){y.push({closable:!0,description:e.message,status:"error",title:b("timeline.error.unable-to-load-revision")})}},t[1]=r,t[2]=b,t[3]=l,t[4]=y,t[5]=j):j=t[5];let v=j,_;t[6]!==g||t[7]!==l?(_=()=>{g||l?.loadMore()},t[6]=g,t[7]=l,t[8]=_):_=t[8];let I=_,w;return t[9]!==h||t[10]!==I||t[11]!==x||t[12]!==c||t[13]!==f||t[14]!==a||t[15]!==v||t[16]!==o||t[17]!==n||t[18]!==i?(w=(0,A.jsx)(E.at,{"data-testid":"review-changes-pane",direction:"column",height:"fill",children:(0,A.jsx)(E.W,{flex:1,padding:2,paddingTop:0,children:i||o?(0,A.jsx)(oX,{versionError:!!o}):(0,A.jsx)(z.EZ,{element:a,children:(0,A.jsx)(aU,{"data-ui":"Scroller",ref:m,children:c&&n?(0,A.jsx)(aa,{chunks:h,hasMoreChunks:x,lastChunk:f,onLoadMore:I,onSelect:v,listMaxHeight:`${c}px`}):null})})})}),t[9]=h,t[10]=I,t[11]=x,t[12]=c,t[13]=f,t[14]=a,t[15]=v,t[16]=o,t[17]=n,t[18]=i,t[19]=w):w=t[19],w}function aQ(e){return e.isLoading}function aq(e){return e.hasMoreChunks}function aG(e){return e.realRevChunk}function aX(e){return e.chunks}let aZ=(0,O.I4)(E.at).withConfig({displayName:"FadeInFlex",componentId:"sc-zb6rxr-0"})`opacity:0;transition:opacity 200ms;&[data-ready]{opacity:1;}`,a0=["history","review"];function a1(e){let t,n,i,r=(0,P.c)(26),{type:l,document:o}=e,a;r[0]!==o.id||r[1]!==o.type||r[2]!==l?(a=l?.studioUrl?.({id:o.id,type:o.type}),r[0]=o.id,r[1]=o.type,r[2]=l,r[3]=a):a=r[3];let s=a,d=o.id,c=s?"a":"div",u=3*!!s,p;r[4]===s?p=r[5]:(p=s?{href:s,target:"_blank",rel:"noopener noreferrer",as:"a"}:{},r[4]=s,r[5]=p);let m=o.availability,h=!!s,f=!!s,x;return r[6]!==o.preview||r[7]!==l?(x=l?{type:l.type,title:o.preview.published?.title,icon:a2,preview:l.preview}:void 0,r[6]=o.preview,r[7]=l,r[8]=x):x=r[8],r[9]!==o.availability||r[10]!==o.dataset||r[11]!==o.id||r[12]!==o.preview||r[13]!==o.projectId||r[14]!==h||r[15]!==f||r[16]!==x?(t=(0,A.jsx)(R.Ons,{availability:m,hasStudioUrl:h,showStudioUrlIcon:f,preview:o.preview,refType:x,projectId:o.projectId,dataset:o.dataset,id:o.id,showTypeLabel:!1}),r[9]=o.availability,r[10]=o.dataset,r[11]=o.id,r[12]=o.preview,r[13]=o.projectId,r[14]=h,r[15]=f,r[16]=x,r[17]=t):t=r[17],r[18]!==t||r[19]!==c||r[20]!==u||r[21]!==p?(n=(0,A.jsx)(E.lt,{flex:1,children:(0,A.jsx)(R.Ns2,{"data-as":c,flex:1,radius:2,paddingRight:u,tone:"inherit",__unstable_focusRing:!0,tabIndex:0,...p,children:t})}),r[18]=t,r[19]=c,r[20]=u,r[21]=p,r[22]=n):n=r[22],r[23]!==o.id||r[24]!==n?(i=(0,A.jsx)(E.at,{gap:1,align:"center",children:n},d),r[23]=o.id,r[24]=n,r[25]=i):i=r[25],i}function a2(){return null}async function a3(e,{document:t,getClient:n}){let i=await e({document:t,getClient:n});return"string"==typeof i?{filter:i,filterParams:void 0}:i}let a4=(0,O.I4)(E.lt).withConfig({displayName:"IncomingReferencesListContainer",componentId:"sc-n3dean-0"})`height:${({$itemCount:e})=>51*Math.min(e,10)}px;`;
1function a5(e){let t,n=(0,P.c)(16),{type:i,value:r,path:l}=e,o=r?._id,a;n[0]===o?a=n[1]:(a=(0,R.IMx)(o),n[0]=o,n[1]=a);let s=a,d=(0,R.cVB)(s),c=(0,R.yKO)(),{ChildLink:u}=tc(),p;n[2]!==u||n[3]!==l||n[4]!==s||n[5]!==i.name?(p=function(e){return(0,A.jsx)(u,{childId:s,childParameters:{type:i.name,...Array.isArray(l)&&l.length>0?{path:(0,R.ujC)(l)}:{}},...e})},n[2]=u,n[3]=l,n[4]=s,n[5]=i.name,n[6]=p):p=n[6];let m=p,h=i.icon||!1,f;return n[7]!==d||n[8]!==c||n[9]!==h||n[10]!==i||n[11]!==r?(f=(0,A.jsx)(td,{documentPreviewStore:c,icon:h,layout:"default",presence:d,schemaType:i,value:r}),n[7]=d,n[8]=c,n[9]=h,n[10]=i,n[11]=r,n[12]=f):f=n[12],n[13]!==m||n[14]!==f?(t=(0,A.jsx)(R.Ns2,{__unstable_focusRing:!0,as:m,"data-as":"a",radius:2,children:f}),n[13]=m,n[14]=f,n[15]=t):t=n[15],t}let a6=eL.PY1.create(E.at),a7=e=>{let t,n,i,l=(0,P.c)(17),{t:o}=(0,R.Bdt)(r.I),{document:a,referenceToId:s}=e,d;l[0]!==a||l[1]!==s?(d=(0,R.oJj)(a,s),l[0]=a,l[1]=s,l[2]=d):d=l[2];let c=d,u=(0,R.I07)(),p;l[3]!==a._type||l[4]!==u?(p=u.get(a._type),l[3]=a._type,l[4]=u,l[5]=p
1):p=l[5];let m=p;if(!m){let e,t;return l[6]!==a._type||l[7]!==o?(e=o("incoming-references-pane.schema-type-not-found",{type:a._type}),l[6]=a._type,l[7]=o,l[8]=e):e=l[8],l[9]===e?t=l[10]:(t=(0,A.jsx)(E.W,{radius:2,tone:"critical",children:(0,A.jsx)(E.lt,{paddingY:4,paddingX:3,children:(0,A.jsx)(E.et,{size:1,children:e})})}),l[9]=e,l[10]=t),t}return l[11]===Symbol.for("react.memo_cache_sentinel")?(t={opacity:0},n={opacity:1},l[11]=t,l[12]=n):(t=l[11],n=l[12]),l[13]!==a||l[14]!==c[0]||l[15]!==m?(i=(0,A.jsx)(E.W,{radius:2,tone:"default",children:(0,A.jsx)(a6,{initial:t,animate:n,gap:1,align:"center",children:(0,A.jsx)(E.lt,{flex:1,children:(0,A.jsx)(a5,{type:m,value:a,path:c[0]})})})}),l[13]=a,l[14]=c[0],l[15]=m,l[16]=i):i=l[16],i};function a8(e){let t,n,i=(0,P.c)(16),{type:l,documents:o,renderItem:a,getItemKey:s,emptyMessage:d}=e,c=(0,R.I07)(),{t:u}=(0,R.Bdt)(r.I),p;i[0]!==c||i[1]!==l?(p=c.get(l),i[0]=c,i[1]=l,i[2]=p):p=i[2];let m=p?.title||l,h;return i[3]===m?h=i[4]:(h=(0,A.jsx)(E.at,{align:"center",justify:"space-between",paddingBottom:2,gap:2,children:(0,A.jsx)(E.lt,{padding:2,children:(0,A.jsx)(E.et,{size:1,weight:"medium",children:m})})}),i[3]=m,i[4]=h),i[5]!==o||i[6]!==d||i[7]!==s||i[8]!==a||i[9]!==u||i[10]!==m?(t=o.length>0?(0,A.jsx)(E.W,{radius:2,padding:1,border:!0,tone:"default",children:(0,A.jsx)(a4,{$itemCount:o.length,children:(0,A.jsx)(R.oIj,{activeItemDataAttr:"data-hovered",ariaLabel:u("incoming-references-input.list-label",{type:m}),canReceiveFocus:!0,fixedHeight:!0,getItemKey:s,itemHeight:51,items:o,onlyShowSelectionWhenActive:!0,overscan:5,renderItem:a,wrapAround:!1})})}):(0,A.jsx)(E.lt,{padding:0,children:(0,A.jsx)(E.W,{border:!0,radius:3,padding:1,tone:"default",children:(0,A.jsx)(E.lt,{paddingY:3,paddingX:2,children:(0,A.jsx)(E.et,{size:1,muted:!0,children:d})})})}),i[5]=o,i[6]=d,i[7]=s,i[8]=a,i[9]=u,i[10]=m,i[11]=t):t=i[11],i[12]!==h||i[13]!==t||i[14]!==l?(n=(0,A.jsxs)(E.O,{padding:2,gap:1,marginBottom:2,children:[h,t]},l),i[12]=h,i[13]=t,i[14]=l,i[15]=n):n=i[15],n}function a9(e,t){let n=new Map;for(let i of e){let e=t(i),r=n.get(e);r?r.push(i):n.set(e,[i])}return Array.from(n,([e,t])=>({type:e,documents:t}))}function se(){let e,t,n,i=(0,P.c)(19),{documentId:l}=nv(),{t:o}=(0,R.Bdt)(r.I),{getClient:a}=(0,R.For)(),s=(0,R.yKO)(),c=(0,R.tH7)(R.miu),u;i[0]!==l||i[1]!==s||i[2]!==a?(u=(function({documentId:e,documentPreviewStore:t,type:n,filter:i,filterParams:r,getClient:l}){let o=(0,R.IMx)(e);return("function"==typeof i?t.unstable_observeDocument(e).pipe((0,g.F)((e,t)=>e?._rev===t?._rev),(0,D.n)(e=>a3(i,{document:e,getClient:l})),(0,y.T)(e=>({filter:e.filter,filterParams:e.filterParams||r}))):(0,m.of)({filter:i,filterParams:r})).pipe((0,g.F)((e,t)=>e.filter===t.filter&&JSON.stringify(e.filterParams)===JSON.stringify(t.filterParams)),(0,D.n)(({filter:e,filterParams:i})=>t.unstable_observeDocumentIdSet(`references("${o}") && _system.group._ref != "${o}" ${n?`&& _type == "${n}"`:""} ${e?`&& ${e}`:""}`,i,{insert:"append"}).pipe((0,y.T)(e=>e.documentIds),(0,e6.q)(e=>t.unstable_observeDocument(e).pipe((0,b.p)(Boolean),(0,y.T)(e=>e))),(0,y.T)(e=>{let t=[];return e.filter(e=>{let n=(0,R.IMx)(e._id);return!t.includes(n)&&(t.push(n),!0)})}),(0,I.W)(e=>(console.error(Error("Failed to load incoming references",{cause:e})),(0,m.of)([]))))))})({documentId:l,documentPreviewStore:s,getClient:a}).pipe((0,y.T)(si)),i[0]=l,i[1]=s,i[2]=a,i[3]=u):u=i[3];let p=(0,W.i5)(u),h;i[4]!==c||i[5]!==l||i[6]!==s?(h=(function({documentId:e,type:t,client:n,documentPreviewStore:i}){return tj(e,{versionedClient:n}).pipe((0,D.n)(e=>(0,m.of)(e).pipe((0,y.T)(e=>e?t?.dataset?e.references.filter(e=>e.datasetName===t.dataset&&e.documentId):e.references.filter(e=>e.documentId&&e.datasetName):[]),(0,e6.q)(e=>i.observeDocumentTypeFromId((0,R.IMx)(e.documentId),{dataset:e.datasetName,projectId:e.projectId}).pipe((0,y.T)(t=>({...e,documentType:t})))),(0,e6.q)(e=>{if(!e.documentType)return(0,m.of)(null);if(!t)return(0,m.of)({type:e.documentType,id:e.documentId,preview:{published:{_id:e.documentId,title:`Document Id: ${e.documentId}`,subtitle:`Dataset: ${e.datasetName} - Project Id: ${e.projectId}`,media:(0,A.jsx)(eU.DocumentIcon,{})}},availability:{available:!0,reason:"READABLE"},projectId:e.projectId,dataset:e.datasetName});if(e.documentType!==t.type)return(0,m.of)(null);let n=(0,R.Jne)(t.preview)||[];return i.observePaths({_id:(0,R.IMx)(e.documentId)},n,{dataset:e.datasetName,projectId:e.projectId}).pipe((0,y.T)(n=>{let i=(0,R.hCw)(n,{type:t.type,title:t.title||"",icon:()=>(0,A.jsx)(eU.DocumentIcon,{}),preview:t.preview});return{type:e.documentType,id:e.documentId,preview:{published:{...i,media:i.media??(0,A.jsx)(eU.DocumentIcon,{})}},availability:{available:!0,reason:"READABLE"},projectId:e.projectId,dataset:e.datasetName}}))}),(0,y.T)(e=>e.filter(R.RaY)),(0,I.W)(e=>(console.error(Error("Failed to load cross-dataset incoming references",{cause:e})),(0,m.of)([]))))))})({documentId:l,client:c,documentPreviewStore:s}).pipe((0,y.T)(st)),i[4]=c,i[5]=l,i[6]=s,i[7]=h):h=i[7];let f=(0,W.i5)(h),x;return i[8]===o?x=i[9]:(x=o("incoming-references-input.types-loading"),i[8]=o,i[9]=x),i[10]===x?e=i[11]:(e=(0,A.jsx)(R.gd4,{showText:!0,title:x}),i[10]=x,i[11]=e),i[12]!==f||i[13]!==l||i[14]!==p?(t=(0,A.jsx)(sl,{crossDatasetRefsPromise:f,documentId:l,referencesPromise:p}),i[12]=f,i[13]=l,i[14]=p,i[15]=t):t=i[15],i[16]!==e||i[17]!==t?(n=(0,A.jsx)(d.Suspense,{fallback:e,children:t}),i[16]=e,i[17]=t,i[18]=n):n=i[18],n}function st(e){return a9(e,sn)}function sn(e){return e.type}function si(e){return a9(e,sr)}function sr(e){return e._type}function sl(e){let t,n,i,l=(0,P.c)(23),{documentId:o,referencesPromise:a,crossDatasetRefsPromise:s}=e,c=(0,d.use)(a),u=(0,d.use)(s),{t:p}=(0,R.Bdt)(r.I),m;
1l[0]===o?m=l[1]:(m=e=>(0,A.jsx)(a7,{document:e,referenceToId:o}),l[0]=o,l[1]=m);let h=m,f;l[2]===p?f=l[3]:(f=p("incoming-references-pane.no-references-found"),l[2]=p,l[3]=f);let x=f,g=0===c.length&&0===u.length,b;if(l[4]!==g||l[5]!==p?(b=g&&(0,A.jsx)(E.W,{border:!0,radius:3,padding:1,tone:"default",children:(0,A.jsx)(E.lt,{paddingY:3,paddingX:2,children:(0,A.jsx)(E.et,{size:1,muted:!0,children:p("incoming-references-pane.no-references")})})}),l[4]=g,l[5]=p,l[6]=b):b=l[6],l[7]!==x||l[8]!==c||l[9]!==h){let e;l[11]!==x||l[12]!==h?(e=e=>{let{type:t,documents:n}=e;return(0,A.jsx)(a8,{type:t,documents:n,renderItem:h,getItemKey:e=>n[e]._id,emptyMessage:x},t)},l[11]=x,l[12]=h,l[13]=e):e=l[13],t=c.map(e),l[7]=x,l[8]=c,l[9]=h,l[10]=t}else t=l[10];if(l[14]!==u||l[15]!==x){let e;l[17]===x?e=l[18]:(e=e=>{let{type:t,documents:n}=e;return(0,A.jsx)(a8,{type:t,documents:n,renderItem:so,getItemKey:e=>n[e].id,emptyMessage:x},t)},l[17]=x,l[18]=e),n=u.map(e),l[14]=u,l[15]=x,l[16]=n}else n=l[16];return l[19]!==b||l[20]!==t||l[21]!==n?(i=(0,A.jsxs)(A.Fragment,{children:[b,t,n]}),l[19]=b,l[20]=t,l[21]=n,l[22]=i):i=l[22],i}function so(e){return(0,A.jsx)(a1,{document:e})}let sa={error:ed.ErrorOutlineIcon,warning:H.WarningOutlineIcon,info:V.InfoOutlineIcon},ss={error:"critical",warning:"caution",info:"primary"};function sd(e){let t,n,i=(0,P.c)(17),{marker:r,onOpen:l,schemaType:a,value:s}=e,c;i[0]!==r.path||i[1]!==l?(c=e=>{let t=window.getSelection();t&&t.toString().length>0&&e.currentTarget.contains(t.anchorNode)||l(r.path)},i[0]=r.path,i[1]=l,i[2]=c):c=i[2];let u=c,[p,m]=(0,d.useState)(null),h=sa[r.level],f;return i[3]===p?f=i[4]:(f=p&&(0,A.jsx)(E.W,{padding:3,radius:2,tone:"critical",children:(0,A.jsx)(E.et,{size:1,children:p.error.message})}),i[3]=p,i[4]=f),i[5]!==h||i[6]!==p||i[7]!==u||i[8]!==r.level||i[9]!==r.message||i[10]!==r.path||i[11]!==a||i[12]!==s?(t=!p&&(0,A.jsx)(E.W,{__unstable_focusRing:!0,as:"button",onClick:u,padding:3,radius:2,style:{userSelect:"text"},tone:ss[r.level],children:(0,A.jsxs)(E.at,{align:"flex-start",gap:3,children:[(0,A.jsx)(E.lt,{flex:"none",children:(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(h,{})})}),(0,A.jsxs)(E.O,{flex:1,gap:2,children:[(0,A.jsx)(sc,{path:r.path,schemaType:a,value:s}),(0,A.jsx)(E.et,{muted:!0,size:1,children:r.message})]})]})}),i[5]=h,i[6]=p,i[7]=u,i[8]=r.level,i[9]=r.message,i[10]=r.path,i[11]=a,i[12]=s,i[13]=t):t=i[13],i[14]!==f||i[15]!==t?(n=(0,A.jsxs)(o.c,{onCatch:m,children:[f,t]}),i[14]=f,i[15]=t,i[16]=n):n=i[16],n}function sc(e){let t,n,i=(0,P.c)(8),{path:r,schemaType:l,value:o}=e,a;e:{try{let e;i[0]!==r||i[1]!==l||i[2]!==o?(e=function(e){let{path:t,schemaType:n,value:i}=e,r=[],l=n,o=i;for(let e of t){if("string"==typeof e){if(!(0,R.u4i)(o)&&void 0!==o)throw Error(`Parent value is not an object, cannot get path segment: .${e}`);if("object"!==l.jsonType)throw Error(`Parent type is not an object schema type, cannot get path segment: .${e}`);o=o?.[e];let t=l.fields.find(t=>t.name===e);if(!t)return r.push({name:e}),r;l=t.type,r.push(l);continue}if("number"==typeof e){if(!(0,R.cyL)(o)&&void 0!==o)throw Error(`Parent value is not an array, cannot get path segment: [${e}]`);if("array"!==l.jsonType)throw Error(`Parent type is not an array schema type, cannot get path segment: [${e}]`);o=o?.[e];let t=l.of.find(e=>"string"==typeof o?"string"===e.jsonType:"number"==typeof o?"number"===e.jsonType:"boolean"==typeof o?"boolean"===e.jsonType:!!(0,R.u4i)(o)&&e.name===o?._type);if(!t)throw Error(`Item type not found: [${e}]`);l=t,r.push(l);continue}if((0,R.u4i)(e)&&e._key){if(void 0===o)return r;if(!(0,R.cyL)(o))throw Error(`Parent value is not an array, cannot get path segment: [_key == ${e}]`);if("array"!==l.jsonType)throw Error(`Parent type is not an array schema type, cannot get path segment: .${e}`);if(void 0===(o=(o??[]).find(t=>(0,R.u4i)(t)&&t._key===e._key)))return r;if(!(0,R.u4i)(o))throw Error(`Array item not found: [_key == ${e._key}]`);let t=l.of.find(e=>(0,R.u4i)(o)&&e.name===o?._type);if(!t&&!o?._type){let e=l.of.filter(e=>"object"===e.jsonType);1===e.length&&(t=e[0])}if(!t)throw Error(`Array item type not found: .${o?._type}`);l=t,r.push(l);continue}throw Error(`Invalid path segment: ${JSON.stringify(e)}`)}return r}({path:r,schemaType:l,value:o}),i[0]=r,i[1]=l,i[2]=o,i[3]=e):e=i[3],a=e;break e}catch(e){console.error(e)}a=null}let s=a;return s?.length?(i[4]===s?t=i[5]:(t=s.map(su),i[4]=s,i[5]=t),i[6]===t?n=i[7]:(n=(0,A.jsx)(E.et,{size:1,children:t}
1),i[6]=t,i[7]=n),n):null}function su(e,t){return(0,A.jsxs)(d.Fragment,{children:[t>0&&(0,A.jsx)("span",{style:{color:"var(--card-muted-fg-color)",opacity:.5},children:" / "}),(0,A.jsx)("span",{style:{fontWeight:500},children:e.title||e.name})]},t)}function sp(e){return{level:e.level,message:e.message,path:e.path}}let sm={},sh=ee.wE.create("/",[ee.wE.intents("/intent"),ee.wE.create("/edit/:type/:editDocumentId",[ee.wE.create({path:"/:params",transform:{params:{toState:function(e){try{return JSON.parse(decodeURIComponent(e))}catch{return console.warn("Failed to parse JSON parameters"),{}}},toPath:function(e){return JSON.stringify(e)}}}})]),ee.wE.create({path:"/:panes",children:[ee.wE.create("/:action",ee.wE.create("/:legacyEditDocumentId"))],transform:{panes:{toState:function(e){var t;return -1===(t=decodeURIComponent(e)).indexOf(",{")?t.split(";").map(e=>{let[t,...n]=e.split("|").map(e=>{let t,[n,...i]=e.split(",");return t={id:n,params:sm,payload:void 0},i.reduce((e,t)=>{if(/^[a-z0-9]+=[^=]+/i.test(t)){let n=t.slice(0,t.indexOf("=")),i=t.slice(n.length+1);e.params={...e.params,[decodeURIComponent(n)]:decodeURIComponent(i)}}else/^[A-Za-z0-9\-_]+(?:={0,2})$/.test(t)?e.payload=function(e){try{return e?(0,ee.fA)(e):void 0}catch(e){console.warn(`Failed to parse parameters: ${e.message}`);return}}(t):t&&console.warn("Unknown pane segment: %s - skipping",t);return e},t)});return[t,...n.map(e=>({...t,...e,id:e.id||t.id,params:{...(0,e8.A)(t.params,sx),...e.params},payload:e.payload||t.payload}))]}).filter(e=>e.length>0):function(e){let t=[],n=e;for(;n.length;){let[e,i,r]=n.match(sf)||[];if(!e){n=n.slice(1);continue}let l=r&&function(e){try{return JSON.parse(e)}catch(e){console.warn(`Failed to parse parameters: ${e.message}`);return}}(r);t.push({id:i,payload:l}),n=n.slice(e.length)}return[t]}(t)},toPath:function(e){return(e||[]).map(e=>e.map(sb).join("|")).map(encodeURIComponent).join(";")}}}})]),sf=/^([.a-z0-9_-]+),?({.*?})?(?:(;|$))/i,sx=["view","since","rev","inspect","comment"],sg=Boolean;function sb(e,t,n){let{payload:i,params:r={},id:l}=e,[o]=n,a=e===o,s=0!==t&&l===o.id,d=void 0===i?void 0:(0,ee.nk)(i),c=Object.entries(r).filter(e=>{let[t,n]=e;return!!n&&(!!a||!(n===o.params?.[t]&&!sx.includes(t)))}).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`);return[s?"":l].concat([c.length>0&&c,d].filter(sg).flat()).join(",")||","}let sy=[oF,oU,oN,o$,oA,i2],sj=["delete","discardChanges"],sv=[oY],s_=[{name:"sanity/structure/validation",component:function(e){let t,n,i,r,l=(0,P.c)(26),{onClose:o}=e,{onFocus:a,onPathOpen:s,schemaType:d,validation:c,value:u,editState:p}=e9(),m=(0,R.ExU)(),h;l[0]!==m||l[1]!==c?(h=(0,R.Llw)(c,m),l[0]=m,l[1]=c,l[2]=h):h=l[2];let f=h,{t:x}=(0,R.Bdt)("validation"),g;l[3]!==a||l[4]!==s?(g=e=>{s(e),a(e)},l[3]=a,l[4]=s,l[5]=g):g=l[5];let b=g,y;l[6]===p?y=l[7]:(y=p&&p.version&&(0,R.YW1)(p.version),l[6]=p,l[7]=y);let j=y,v;return l[8]===x?v=l[9]:(v=x("panel.close-button-aria-label"),l[8]=x,l[9]=v),l[10]===x?t=l[11]:(t=x("panel.title"),l[10]=x,l[11]=t),l[12]!==o||l[13]!==v||l[14]!==t?(n=(0,A.jsx)(tz,{as:"header",closeButtonLabel:v,flex:"none",onClose:o,title:t}),l[12]=o,l[13]=v,l[14]=t,l[15]=n):n=l[15],l[16]!==b||l[17]!==j||l[18]!==f||l[19]!==d||l[20]!==x||l[21]!==u?(i=(0,A.jsx)(E.W,{flex:1,overflow:"auto",padding:3,children:j?(0,A.jsx)(E.lt,{padding:2,children:(0,A.jsx)(E.et,{muted:!0,size:1,children:x("panel.unpublish-message")})}):(0,A.jsxs)(A.Fragment,{children:[0===f.length&&(0,A.jsx)(E.lt,{padding:2,children:(0,A.jsx)(E.et,{muted:!0,size:1,children:x("panel.no-errors-message")})}),f.length>0&&(0,A.jsx)(E.O,{gap:2,children:f.map((e,t)=>(0,A.jsx)(sd,{marker:e,onOpen:b,schemaType:d,value:u},t))})]})}),l[16]=b,l[17]=j,l[18]=f,l[19]=d,l[20]=x,l[21]=u,l[22]=i):i=l[22],l[23]!==n||l[24]!==i?(r=(0,A.jsxs)(E.at,{direction:"column",height:"fill",overflow:"hidden",children:[n,i]}),l[23]=n,l[24]=i,l[25]=r):r=l[25],r},useMenuItem:function(e){let t,n=(0,P.c)(12),{t:i}=(0,R.Bdt)("validation"),{validation:r,value:l}=e9(),o=(0,R.ExU)(),a;n[0]!==o||n[1]!==r?(a=(0,R.Llw)(r,o).map(sp),n[0]=o,n[1]=r,n[2]=a):a=n[2];let s=a,d=s.some(R.Ah6),c=s.some(R.ci$),u;n[3]===l?u=n[4]:(u=(0,R.YW1)(l),n[3]=l,n[4]=u);let p=u,m;e:{if(d){m=ed.ErrorOutlineIcon;break e}if(c){m=H.WarningOutlineIcon;break e}m=e7.CheckmarkCircleIcon}let h=m,f;
1t:{if(d){f="critical";break t}if(c){f="caution";break t}f="positive"}let x=f,g=0===s.length||p,b;return n[5]===i?b=n[6]:(b=i("panel.title"),n[5]=i,n[6]=b),n[7]!==h||n[8]!==g||n[9]!==b||n[10]!==x?(t={hidden:g,icon:h,title:b,tone:x,showAsAction:!0},n[7]=h,n[8]=g,n[9]=b,n[10]=x,n[11]=t):t=n[11],t}},{name:ng,useMenuItem:()=>{let{features:e}=(0,a.t)(),{t}=(0,R.Bdt)();return{hidden:!e.reviewChanges,icon:eW.RestoreIcon,title:t("changes.title")}},component:function(e){let t,n,i,l,a,s,c,u,p,m,h,f,x,g,b,y,j,v,_,I=(0,P.c)(73),{params:w,setParams:S}=tc(),C=(0,R.For)(),[k,T]=(0,d.useState)(null),{t:D}=(0,R.Bdt)(r.I),{t:B}=(0,R.Bdt)(),O=w?.inspect===ng,{selectedPerspective:N}=(0,R.QO2)(),L;I[0]===w?L=I[1]:(L=(t=w?.changesInspectorTab)&&a0.includes(t)?w.changesInspectorTab:a0[0],I[0]=w,I[1]=L);let $=L,M;I[2]!==w||I[3]!==S?(M=e=>S({...w,changesInspectorTab:e,since:"history"===e?void 0:w?.since}),I[2]=w,I[3]=S,I[4]=M):M=I[4];let H=M,W=O?"":void 0,K;I[5]===D?K=I[6]:(K=D("changes.tab.history"),I[5]=D,I[6]=K),I[7]===H?n=I[8]:(n=()=>H("history"),I[7]=H,I[8]=n);let F="history"===$,J;I[9]!==K||I[10]!==n||I[11]!==F?(J=(0,A.jsx)(o.n,{"aria-controls":"history-panel",id:"history-tab",label:K,onClick:n,selected:F}),I[9]=K,I[10]=n,I[11]=F,I[12]=J):J=I[12],I[13]===D?i=I[14]:(i=D("changes.tab.review-changes"),I[13]=D,I[14]=i),I[15]===H?l=I[16]:(l=()=>H("review"),I[15]=H,I[16]=l);let U="review"===$,Q;I[17]!==i||I[18]!==l||I[19]!==U?(Q=(0,A.jsx)(o.n,{"aria-controls":"review-changes-panel",id:"changes-tab",label:i,onClick:l,selected:U}),I[17]=i,I[18]=l,I[19]=U,I[20]=Q):Q=I[20],I[21]!==Q||I[22]!==J?(a=(0,A.jsxs)(E.c,{gap:1,flex:1,children:[J,Q]}),I[21]=Q,I[22]=J,I[23]=a):a=I[23],I[24]===D?s=I[25]:(s=D("changes.action.close-label"),I[24]=D,I[25]=s);let q=e.onClose,G;I[26]===D?G=I[27]:(G=D("document-inspector.close-button.tooltip"),I[26]=D,I[27]=G),I[28]===G?c=I[29]:(c={content:G},I[28]=G,I[29]=c),I[30]!==e.onClose||I[31]!==s||I[32]!==c?(u=(0,A.jsx)(o.a,{"aria-label":s,icon:Y.CloseIcon,mode:"bleed",onClick:q,tooltipProps:c}),I[30]=e.onClose,I[31]=s,I[32]=c,I[33]=u):u=I[33],I[34]!==a||I[35]!==u?(p=(0,A.jsx)(E.W,{paddingBottom:1,children:(0,A.jsxs)(E.at,{align:"center",padding:3,gap:2,children:[a,u]})}),I[34]=a,I[35]=u,I[36]=p):p=I[36],I[37]===D?m=I[38]:(m=(0,A.jsx)(E.lt,{flex:1,padding:1,children:(0,A.jsx)(E.et,{size:1,children:(0,A.jsx)(R.HTc,{t:D,i18nKey:"changes.banner.tooltip"})})}),I[37]=D,I[38]=m),I[39]===Symbol.for("react.memo_cache_sentinel")?(h=(0,A.jsx)(E.et,{size:0,muted:!0,children:(0,A.jsx)(V.InfoOutlineIcon,{fontSize:1})}),I[39]=h):h=I[39],I[40]!==k||I[41]!==m?(f=(0,A.jsx)(o.o,{portal:!0,placement:"bottom-end",boundaryElement:k,content:m,children:h}),I[40]=k,I[41]=m,I[42]=f):f=I[42],I[43]!==N||I[44]!==D||I[45]!==B?(x=function(e,{t,tCore:n}){return(0,R.Jrl)(e)?e.metadata.title||n("release.placeholder-untitled-release"):"drafts"===e?t("compare-versions.status.draft"):"published"===e?t("compare-versions.status.published"):e}(N,{t:D,tCore:B}),I[43]=N,I[44]=D,I[45]=B,I[46]=x):x=I[46],I[47]===x?g=I[48]:(g={perspective:x},I[47]=x,I[48]=g),I[49]!==D||I[50]!==g?(b=(0,A.jsx)(E.et,{size:0,muted:!0,children:(0,A.jsx)(R.HTc,{t:D,values:g,i18nKey:"changes.banner.description"})}),I[49]=D,I[50]=g,I[51]=b):b=I[51],I[52]!==f||I[53]!==b?(y=(0,A.jsx)(E.W,{padding:2,marginBottom:3,marginX:3,tone:"neutral",border:!0,radius:3,children:(0,A.jsxs)(E.at,{gap:2,align:"flex-start",children:[f,b]})}),I[52]=f,I[53]=b,I[54]=y):y=I[54];let X="history"!==$,Z;I[55]!==$||I[56]!==C.beta?.eventsAPI?.documents?(Z=C.beta?.eventsAPI?.documents?(0,A.jsx)(aJ,{showList:"history"===$}):(0,A.jsx)(aY,{showList:"history"===$}),I[55]=$,I[56]=C.beta?.eventsAPI?.documents,I[57]=Z):Z=I[57],I[58]!==X||I[59]!==Z?(j=(0,A.jsx)(z.Kp,{"aria-labelledby":"history-tab",height:"fill",hidden:X,id:"history-panel",children:Z}),I[58]=X,I[59]=Z,I[60]=j):j=I[60];let ee="review"!==$,et;return I[61]!==$||I[62]!==C.beta?.eventsAPI?.documents?(et=C.beta?.eventsAPI?.documents?(0,A.jsx)(A.Fragment,{children:"review"===$?(0,A.jsx)(aM,{showChanges:"review"===$}):null}):(0,A.jsx)(ab,{showChanges:"review"===$}),I[61]=$,I[62]=C.beta?.eventsAPI?.documents,I[63]=et):et=I[63],I[64]!==ee||I[65]!==et?(v=(0,A.jsx)(z.Kp,{"aria-labelledby":"review-tab",hidden:ee,id:"review-panel",height:"fill",children:et}),I[64]=ee,I[65]=et,I[66]=v):v=I[66],I[67]!==p||I[68]!==W||I[69]!==y||I[70]!==j||I[71]!==v?(_=(0,A.jsxs)(aZ,{direction:"column",padding:0,height:"fill","data-ready":W,ref:T,children:[p,y,j,v]}),I[67]=p,I[68]=W,I[69]=y,I[70]=j,I[71]=v,I[72]=_):_=I[72],_},onClose:({params:e})=>({params:{...e,since:void 0,rev:void 0,changesInspectorTab:void 0,historyVersion:void 0}}),onOpen:({params:e})=>({params:{...e,since:"@lastPublished"}})},{name:"sanity/structure/incoming-references",useMenuItem:()=>{let{t:e}=(0,R.Bdt)();return{icon:ec.SyncIcon,title:e("incoming-references.title")}},component:e=>{let t,n,i,r=(0,P.c)(11),{t:l}=(0,R.Bdt)(),o;r[0]===l?o=r[1]:(o=l("panel.close-button-aria-label"),r[0]=l,r[1]=o);let a=e.onClose,s;return r[2]===l?s=r[3]:(s=l("incoming-references.title"),r[2]=l,r[3]=s),r[4]!==e.onClose||r[5]!==o||r[6]!==s?(t=(0,A.jsx)(tz,{as:"header",closeButtonLabel:o,flex:"none",onClose:a,title:s}),r[4]=e.onClose,r[5]=o,r[6]=s,r[7]=t):t=r[7],r[8]===Symbol.for("react.memo_cache_sentinel")?(n=(0,A.jsx)(E.W,{flex:1,overflow:"auto",padding:3,children:(0,A.jsx)(se,{})}),r[8]=n):n=r[8],r[9]===t?i=r[10]:(i=(0,A.jsxs)(E.at,{direction:"column",height:"fill",overflow:"hidden",children:[t,n]}),r[9]=t,r[10]=i),i}}],sI=(0,R.bzQ)(e=>{let t=e?.icon||eX.MasterDetailIcon;return{name:"sanity/structure",document:{actions:(e,t)=>{let n=Array.from(new Set([...e,...sy])),i=n.filter(e=>
1sj.includes(e.action)),r=n.filter(e=>!sj.includes(e.action));return"published"===t.versionType?[...[...r].sort((e,t)=>"unpublish"===e.action?-1:+("unpublish"===t.action)),...i]:[...r,...i]},badges:e=>Array.from(new Set([...e,...sv])),inspectors:e=>Array.from(new Set([...e,...s_]))},tools:[{name:e?.name||"structure",title:e?.title||"Structure",icon:t,component:(0,d.lazy)(()=>Promise.all([n.e(3881),n.e(2079)]).then(n.bind(n,63881))),canHandleIntent:(e,t)=>{var n;return"create"===e?function(e){if(!("type"in e))return!1;let t={};return"mode"in e&&(t.mode="structure"===e.mode),"template"in e&&(t.template=!0),!Object.keys(t).length||t}(t):"edit"===e&&"id"in(n=t)&&(!("mode"in n)||{mode:"structure"===n.mode})},getIntentState:oG,controlsDocumentTitle:!0,options:e,router:sh,__internalApplicationType:"sanity/structure"}],i18n:{bundles:[r.L]}}})}}]);

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.